edit pages
This commit is contained in:
77
old/wp-includes/blocks/file/block.json
Normal file
77
old/wp-includes/blocks/file/block.json
Normal file
@ -0,0 +1,77 @@
|
||||
{
|
||||
"$schema": "https://schemas.wp.org/trunk/block.json",
|
||||
"apiVersion": 3,
|
||||
"name": "core/file",
|
||||
"title": "File",
|
||||
"category": "media",
|
||||
"description": "Add a link to a downloadable file.",
|
||||
"keywords": [ "document", "pdf", "download" ],
|
||||
"textdomain": "default",
|
||||
"attributes": {
|
||||
"id": {
|
||||
"type": "number"
|
||||
},
|
||||
"href": {
|
||||
"type": "string"
|
||||
},
|
||||
"fileId": {
|
||||
"type": "string",
|
||||
"source": "attribute",
|
||||
"selector": "a:not([download])",
|
||||
"attribute": "id"
|
||||
},
|
||||
"fileName": {
|
||||
"type": "rich-text",
|
||||
"source": "rich-text",
|
||||
"selector": "a:not([download])"
|
||||
},
|
||||
"textLinkHref": {
|
||||
"type": "string",
|
||||
"source": "attribute",
|
||||
"selector": "a:not([download])",
|
||||
"attribute": "href"
|
||||
},
|
||||
"textLinkTarget": {
|
||||
"type": "string",
|
||||
"source": "attribute",
|
||||
"selector": "a:not([download])",
|
||||
"attribute": "target"
|
||||
},
|
||||
"showDownloadButton": {
|
||||
"type": "boolean",
|
||||
"default": true
|
||||
},
|
||||
"downloadButtonText": {
|
||||
"type": "rich-text",
|
||||
"source": "rich-text",
|
||||
"selector": "a[download]"
|
||||
},
|
||||
"displayPreview": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"previewHeight": {
|
||||
"type": "number",
|
||||
"default": 600
|
||||
}
|
||||
},
|
||||
"supports": {
|
||||
"anchor": true,
|
||||
"align": true,
|
||||
"spacing": {
|
||||
"margin": true,
|
||||
"padding": true
|
||||
},
|
||||
"color": {
|
||||
"gradients": true,
|
||||
"link": true,
|
||||
"text": false,
|
||||
"__experimentalDefaultControls": {
|
||||
"background": true,
|
||||
"link": true
|
||||
}
|
||||
},
|
||||
"interactivity": true
|
||||
},
|
||||
"editorStyle": "wp-block-file-editor",
|
||||
"style": "wp-block-file"
|
||||
}
|
38
old/wp-includes/blocks/file/editor-rtl.css
Normal file
38
old/wp-includes/blocks/file/editor-rtl.css
Normal file
@ -0,0 +1,38 @@
|
||||
.wp-block-file{
|
||||
align-items:center;
|
||||
display:flex;
|
||||
flex-wrap:wrap;
|
||||
justify-content:space-between;
|
||||
margin-bottom:0;
|
||||
}
|
||||
.wp-block[data-align=left]>.wp-block-file,.wp-block[data-align=right]>.wp-block-file{
|
||||
height:auto;
|
||||
}
|
||||
.wp-block-file .components-resizable-box__container{
|
||||
margin-bottom:1em;
|
||||
}
|
||||
.wp-block-file .wp-block-file__preview{
|
||||
height:100%;
|
||||
margin-bottom:1em;
|
||||
width:100%;
|
||||
}
|
||||
.wp-block-file .wp-block-file__preview-overlay{
|
||||
bottom:0;
|
||||
left:0;
|
||||
position:absolute;
|
||||
right:0;
|
||||
top:0;
|
||||
}
|
||||
.wp-block-file .wp-block-file__content-wrapper{
|
||||
flex-grow:1;
|
||||
}
|
||||
.wp-block-file a{
|
||||
min-width:1em;
|
||||
}
|
||||
.wp-block-file a:not(.wp-block-file__button){
|
||||
display:inline-block;
|
||||
}
|
||||
.wp-block-file .wp-block-file__button-richtext-wrapper{
|
||||
display:inline-block;
|
||||
margin-right:.75em;
|
||||
}
|
1
old/wp-includes/blocks/file/editor-rtl.min.css
vendored
Normal file
1
old/wp-includes/blocks/file/editor-rtl.min.css
vendored
Normal file
@ -0,0 +1 @@
|
||||
.wp-block-file{align-items:center;display:flex;flex-wrap:wrap;justify-content:space-between;margin-bottom:0}.wp-block[data-align=left]>.wp-block-file,.wp-block[data-align=right]>.wp-block-file{height:auto}.wp-block-file .components-resizable-box__container{margin-bottom:1em}.wp-block-file .wp-block-file__preview{height:100%;margin-bottom:1em;width:100%}.wp-block-file .wp-block-file__preview-overlay{bottom:0;left:0;position:absolute;right:0;top:0}.wp-block-file .wp-block-file__content-wrapper{flex-grow:1}.wp-block-file a{min-width:1em}.wp-block-file a:not(.wp-block-file__button){display:inline-block}.wp-block-file .wp-block-file__button-richtext-wrapper{display:inline-block;margin-right:.75em}
|
38
old/wp-includes/blocks/file/editor.css
Normal file
38
old/wp-includes/blocks/file/editor.css
Normal file
@ -0,0 +1,38 @@
|
||||
.wp-block-file{
|
||||
align-items:center;
|
||||
display:flex;
|
||||
flex-wrap:wrap;
|
||||
justify-content:space-between;
|
||||
margin-bottom:0;
|
||||
}
|
||||
.wp-block[data-align=left]>.wp-block-file,.wp-block[data-align=right]>.wp-block-file{
|
||||
height:auto;
|
||||
}
|
||||
.wp-block-file .components-resizable-box__container{
|
||||
margin-bottom:1em;
|
||||
}
|
||||
.wp-block-file .wp-block-file__preview{
|
||||
height:100%;
|
||||
margin-bottom:1em;
|
||||
width:100%;
|
||||
}
|
||||
.wp-block-file .wp-block-file__preview-overlay{
|
||||
bottom:0;
|
||||
left:0;
|
||||
position:absolute;
|
||||
right:0;
|
||||
top:0;
|
||||
}
|
||||
.wp-block-file .wp-block-file__content-wrapper{
|
||||
flex-grow:1;
|
||||
}
|
||||
.wp-block-file a{
|
||||
min-width:1em;
|
||||
}
|
||||
.wp-block-file a:not(.wp-block-file__button){
|
||||
display:inline-block;
|
||||
}
|
||||
.wp-block-file .wp-block-file__button-richtext-wrapper{
|
||||
display:inline-block;
|
||||
margin-left:.75em;
|
||||
}
|
1
old/wp-includes/blocks/file/editor.min.css
vendored
Normal file
1
old/wp-includes/blocks/file/editor.min.css
vendored
Normal file
@ -0,0 +1 @@
|
||||
.wp-block-file{align-items:center;display:flex;flex-wrap:wrap;justify-content:space-between;margin-bottom:0}.wp-block[data-align=left]>.wp-block-file,.wp-block[data-align=right]>.wp-block-file{height:auto}.wp-block-file .components-resizable-box__container{margin-bottom:1em}.wp-block-file .wp-block-file__preview{height:100%;margin-bottom:1em;width:100%}.wp-block-file .wp-block-file__preview-overlay{bottom:0;left:0;position:absolute;right:0;top:0}.wp-block-file .wp-block-file__content-wrapper{flex-grow:1}.wp-block-file a{min-width:1em}.wp-block-file a:not(.wp-block-file__button){display:inline-block}.wp-block-file .wp-block-file__button-richtext-wrapper{display:inline-block;margin-left:.75em}
|
35
old/wp-includes/blocks/file/style-rtl.css
Normal file
35
old/wp-includes/blocks/file/style-rtl.css
Normal file
@ -0,0 +1,35 @@
|
||||
.wp-block-file{
|
||||
box-sizing:border-box;
|
||||
}
|
||||
.wp-block-file:not(.wp-element-button){
|
||||
font-size:.8em;
|
||||
}
|
||||
.wp-block-file.aligncenter{
|
||||
text-align:center;
|
||||
}
|
||||
.wp-block-file.alignright{
|
||||
text-align:right;
|
||||
}
|
||||
.wp-block-file *+.wp-block-file__button{
|
||||
margin-right:.75em;
|
||||
}
|
||||
|
||||
:where(.wp-block-file){
|
||||
margin-bottom:1.5em;
|
||||
}
|
||||
|
||||
.wp-block-file__embed{
|
||||
margin-bottom:1em;
|
||||
}
|
||||
|
||||
:where(.wp-block-file__button){
|
||||
border-radius:2em;
|
||||
display:inline-block;
|
||||
padding:.5em 1em;
|
||||
}
|
||||
:where(.wp-block-file__button):is(a):active,:where(.wp-block-file__button):is(a):focus,:where(.wp-block-file__button):is(a):hover,:where(.wp-block-file__button):is(a):visited{
|
||||
box-shadow:none;
|
||||
color:#fff;
|
||||
opacity:.85;
|
||||
text-decoration:none;
|
||||
}
|
1
old/wp-includes/blocks/file/style-rtl.min.css
vendored
Normal file
1
old/wp-includes/blocks/file/style-rtl.min.css
vendored
Normal file
@ -0,0 +1 @@
|
||||
.wp-block-file{box-sizing:border-box}.wp-block-file:not(.wp-element-button){font-size:.8em}.wp-block-file.aligncenter{text-align:center}.wp-block-file.alignright{text-align:right}.wp-block-file *+.wp-block-file__button{margin-right:.75em}:where(.wp-block-file){margin-bottom:1.5em}.wp-block-file__embed{margin-bottom:1em}:where(.wp-block-file__button){border-radius:2em;display:inline-block;padding:.5em 1em}:where(.wp-block-file__button):is(a):active,:where(.wp-block-file__button):is(a):focus,:where(.wp-block-file__button):is(a):hover,:where(.wp-block-file__button):is(a):visited{box-shadow:none;color:#fff;opacity:.85;text-decoration:none}
|
35
old/wp-includes/blocks/file/style.css
Normal file
35
old/wp-includes/blocks/file/style.css
Normal file
@ -0,0 +1,35 @@
|
||||
.wp-block-file{
|
||||
box-sizing:border-box;
|
||||
}
|
||||
.wp-block-file:not(.wp-element-button){
|
||||
font-size:.8em;
|
||||
}
|
||||
.wp-block-file.aligncenter{
|
||||
text-align:center;
|
||||
}
|
||||
.wp-block-file.alignright{
|
||||
text-align:right;
|
||||
}
|
||||
.wp-block-file *+.wp-block-file__button{
|
||||
margin-left:.75em;
|
||||
}
|
||||
|
||||
:where(.wp-block-file){
|
||||
margin-bottom:1.5em;
|
||||
}
|
||||
|
||||
.wp-block-file__embed{
|
||||
margin-bottom:1em;
|
||||
}
|
||||
|
||||
:where(.wp-block-file__button){
|
||||
border-radius:2em;
|
||||
display:inline-block;
|
||||
padding:.5em 1em;
|
||||
}
|
||||
:where(.wp-block-file__button):is(a):active,:where(.wp-block-file__button):is(a):focus,:where(.wp-block-file__button):is(a):hover,:where(.wp-block-file__button):is(a):visited{
|
||||
box-shadow:none;
|
||||
color:#fff;
|
||||
opacity:.85;
|
||||
text-decoration:none;
|
||||
}
|
1
old/wp-includes/blocks/file/style.min.css
vendored
Normal file
1
old/wp-includes/blocks/file/style.min.css
vendored
Normal file
@ -0,0 +1 @@
|
||||
.wp-block-file{box-sizing:border-box}.wp-block-file:not(.wp-element-button){font-size:.8em}.wp-block-file.aligncenter{text-align:center}.wp-block-file.alignright{text-align:right}.wp-block-file *+.wp-block-file__button{margin-left:.75em}:where(.wp-block-file){margin-bottom:1.5em}.wp-block-file__embed{margin-bottom:1em}:where(.wp-block-file__button){border-radius:2em;display:inline-block;padding:.5em 1em}:where(.wp-block-file__button):is(a):active,:where(.wp-block-file__button):is(a):focus,:where(.wp-block-file__button):is(a):hover,:where(.wp-block-file__button):is(a):visited{box-shadow:none;color:#fff;opacity:.85;text-decoration:none}
|
1
old/wp-includes/blocks/file/view.asset.php
Normal file
1
old/wp-includes/blocks/file/view.asset.php
Normal file
@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array(), 'version' => '498971a8a9512421f3b5');
|
97
old/wp-includes/blocks/file/view.js
Normal file
97
old/wp-includes/blocks/file/view.js
Normal file
@ -0,0 +1,97 @@
|
||||
import * as __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__ from "@wordpress/interactivity";
|
||||
/******/ // The require scope
|
||||
/******/ var __webpack_require__ = {};
|
||||
/******/
|
||||
/************************************************************************/
|
||||
/******/ /* webpack/runtime/define property getters */
|
||||
/******/ (() => {
|
||||
/******/ // define getter functions for harmony exports
|
||||
/******/ __webpack_require__.d = (exports, definition) => {
|
||||
/******/ for(var key in definition) {
|
||||
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
||||
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
||||
/******/ }
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
||||
/******/ (() => {
|
||||
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
||||
/******/ })();
|
||||
/******/
|
||||
/************************************************************************/
|
||||
var __webpack_exports__ = {};
|
||||
|
||||
;// CONCATENATED MODULE: external "@wordpress/interactivity"
|
||||
var x = (y) => {
|
||||
var x = {}; __webpack_require__.d(x, y); return x
|
||||
}
|
||||
var y = (x) => (() => (x))
|
||||
const interactivity_namespaceObject = x({ ["store"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.store) });
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/file/utils/index.js
|
||||
/**
|
||||
* Uses a combination of user agent matching and feature detection to determine whether
|
||||
* the current browser supports rendering PDFs inline.
|
||||
*
|
||||
* @return {boolean} Whether or not the browser supports inline PDFs.
|
||||
*/
|
||||
const browserSupportsPdfs = () => {
|
||||
// Most mobile devices include "Mobi" in their UA.
|
||||
if (window.navigator.userAgent.indexOf('Mobi') > -1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Android tablets are the noteable exception.
|
||||
if (window.navigator.userAgent.indexOf('Android') > -1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// iPad pretends to be a Mac.
|
||||
if (window.navigator.userAgent.indexOf('Macintosh') > -1 && window.navigator.maxTouchPoints && window.navigator.maxTouchPoints > 2) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// IE only supports PDFs when there's an ActiveX object available for it.
|
||||
if (!!(window.ActiveXObject || 'ActiveXObject' in window) && !(createActiveXObject('AcroPDF.PDF') || createActiveXObject('PDF.PdfCtrl'))) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
/**
|
||||
* Helper function for creating ActiveX objects, catching any errors that are thrown
|
||||
* when it's generated.
|
||||
*
|
||||
* @param {string} type The name of the ActiveX object to create.
|
||||
* @return {window.ActiveXObject|undefined} The generated ActiveXObject, or null if it failed.
|
||||
*/
|
||||
const createActiveXObject = type => {
|
||||
let ax;
|
||||
try {
|
||||
ax = new window.ActiveXObject(type);
|
||||
} catch (e) {
|
||||
ax = undefined;
|
||||
}
|
||||
return ax;
|
||||
};
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/file/view.js
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
|
||||
(0,interactivity_namespaceObject.store)('core/file', {
|
||||
state: {
|
||||
get hasPdfPreview() {
|
||||
return browserSupportsPdfs();
|
||||
}
|
||||
}
|
||||
}, {
|
||||
lock: true
|
||||
});
|
||||
|
1
old/wp-includes/blocks/file/view.min.asset.php
Normal file
1
old/wp-includes/blocks/file/view.min.asset.php
Normal file
@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array(), 'version' => '9c04187f1796859989c3');
|
1
old/wp-includes/blocks/file/view.min.js
vendored
Normal file
1
old/wp-includes/blocks/file/view.min.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
import*as e from"@wordpress/interactivity";var t={d:(e,o)=>{for(var r in o)t.o(o,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:o[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const o=(e=>{var o={};return t.d(o,e),o})({store:()=>e.store}),r=e=>{let t;try{t=new window.ActiveXObject(e)}catch(e){t=void 0}return t};(0,o.store)("core/file",{state:{get hasPdfPreview(){return!(window.navigator.userAgent.indexOf("Mobi")>-1||window.navigator.userAgent.indexOf("Android")>-1||window.navigator.userAgent.indexOf("Macintosh")>-1&&window.navigator.maxTouchPoints&&window.navigator.maxTouchPoints>2||(window.ActiveXObject||"ActiveXObject"in window)&&!r("AcroPDF.PDF")&&!r("PDF.PdfCtrl"))}}},{lock:!0});
|
Reference in New Issue
Block a user