@wordpress/list-reusable-blocks 4.19.2 → 4.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/build/components/import-dropdown/index.js +4 -4
- package/build/components/import-dropdown/index.js.map +1 -1
- package/build/components/import-form/index.js +6 -5
- package/build/components/import-form/index.js.map +1 -1
- package/build/index.js +2 -1
- package/build/index.js.map +1 -1
- package/build-module/components/import-dropdown/index.js +1 -1
- package/build-module/components/import-form/index.js +1 -1
- package/build-module/index.js +1 -1
- package/build-style/style-rtl.css +9 -9
- package/build-style/style.css +9 -9
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
-
var
|
|
8
|
+
var _react = require("react");
|
|
9
9
|
var _compose = require("@wordpress/compose");
|
|
10
10
|
var _i18n = require("@wordpress/i18n");
|
|
11
11
|
var _components = require("@wordpress/components");
|
|
@@ -21,7 +21,7 @@ var _importForm = _interopRequireDefault(require("../import-form"));
|
|
|
21
21
|
function ImportDropdown({
|
|
22
22
|
onUpload
|
|
23
23
|
}) {
|
|
24
|
-
return (0,
|
|
24
|
+
return (0, _react.createElement)(_components.Dropdown, {
|
|
25
25
|
popoverProps: {
|
|
26
26
|
placement: 'bottom-start'
|
|
27
27
|
},
|
|
@@ -29,14 +29,14 @@ function ImportDropdown({
|
|
|
29
29
|
renderToggle: ({
|
|
30
30
|
isOpen,
|
|
31
31
|
onToggle
|
|
32
|
-
}) => (0,
|
|
32
|
+
}) => (0, _react.createElement)(_components.Button, {
|
|
33
33
|
"aria-expanded": isOpen,
|
|
34
34
|
onClick: onToggle,
|
|
35
35
|
variant: "primary"
|
|
36
36
|
}, (0, _i18n.__)('Import from JSON')),
|
|
37
37
|
renderContent: ({
|
|
38
38
|
onClose
|
|
39
|
-
}) => (0,
|
|
39
|
+
}) => (0, _react.createElement)(_importForm.default, {
|
|
40
40
|
onUpload: (0, _compose.pipe)(onClose, onUpload)
|
|
41
41
|
})
|
|
42
42
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_compose","require","_i18n","_components","_importForm","_interopRequireDefault","ImportDropdown","onUpload","
|
|
1
|
+
{"version":3,"names":["_compose","require","_i18n","_components","_importForm","_interopRequireDefault","ImportDropdown","onUpload","_react","createElement","Dropdown","popoverProps","placement","contentClassName","renderToggle","isOpen","onToggle","Button","onClick","variant","__","renderContent","onClose","default","pipe","_default","exports"],"sources":["@wordpress/list-reusable-blocks/src/components/import-dropdown/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { pipe } from '@wordpress/compose';\nimport { __ } from '@wordpress/i18n';\nimport { Dropdown, Button } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport ImportForm from '../import-form';\n\nfunction ImportDropdown( { onUpload } ) {\n\treturn (\n\t\t<Dropdown\n\t\t\tpopoverProps={ { placement: 'bottom-start' } }\n\t\t\tcontentClassName=\"list-reusable-blocks-import-dropdown__content\"\n\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t<Button\n\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Import from JSON' ) }\n\t\t\t\t</Button>\n\t\t\t) }\n\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t<ImportForm onUpload={ pipe( onClose, onUpload ) } />\n\t\t\t) }\n\t\t/>\n\t);\n}\n\nexport default ImportDropdown;\n"],"mappings":";;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAKA,IAAAG,WAAA,GAAAC,sBAAA,CAAAJ,OAAA;AAVA;AACA;AACA;;AAKA;AACA;AACA;;AAGA,SAASK,cAAcA,CAAE;EAAEC;AAAS,CAAC,EAAG;EACvC,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACN,WAAA,CAAAO,QAAQ;IACRC,YAAY,EAAG;MAAEC,SAAS,EAAE;IAAe,CAAG;IAC9CC,gBAAgB,EAAC,+CAA+C;IAChEC,YAAY,EAAGA,CAAE;MAAEC,MAAM;MAAEC;IAAS,CAAC,KACpC,IAAAR,MAAA,CAAAC,aAAA,EAACN,WAAA,CAAAc,MAAM;MACN,iBAAgBF,MAAQ;MACxBG,OAAO,EAAGF,QAAU;MACpBG,OAAO,EAAC;IAAS,GAEf,IAAAC,QAAE,EAAE,kBAAmB,CAClB,CACN;IACHC,aAAa,EAAGA,CAAE;MAAEC;IAAQ,CAAC,KAC5B,IAAAd,MAAA,CAAAC,aAAA,EAACL,WAAA,CAAAmB,OAAU;MAAChB,QAAQ,EAAG,IAAAiB,aAAI,EAAEF,OAAO,EAAEf,QAAS;IAAG,CAAE;EAClD,CACH,CAAC;AAEJ;AAAC,IAAAkB,QAAA,GAEcnB,cAAc;AAAAoB,OAAA,CAAAH,OAAA,GAAAE,QAAA"}
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
+
var _react = require("react");
|
|
8
9
|
var _element = require("@wordpress/element");
|
|
9
10
|
var _compose = require("@wordpress/compose");
|
|
10
11
|
var _i18n = require("@wordpress/i18n");
|
|
@@ -67,21 +68,21 @@ function ImportForm({
|
|
|
67
68
|
const onDismissError = () => {
|
|
68
69
|
setError(null);
|
|
69
70
|
};
|
|
70
|
-
return (0,
|
|
71
|
+
return (0, _react.createElement)("form", {
|
|
71
72
|
className: "list-reusable-blocks-import-form",
|
|
72
73
|
onSubmit: onSubmit,
|
|
73
74
|
ref: formRef
|
|
74
|
-
}, error && (0,
|
|
75
|
+
}, error && (0, _react.createElement)(_components.Notice, {
|
|
75
76
|
status: "error",
|
|
76
77
|
onRemove: () => onDismissError()
|
|
77
|
-
}, error), (0,
|
|
78
|
+
}, error), (0, _react.createElement)("label", {
|
|
78
79
|
htmlFor: inputId,
|
|
79
80
|
className: "list-reusable-blocks-import-form__label"
|
|
80
|
-
}, (0, _i18n.__)('File')), (0,
|
|
81
|
+
}, (0, _i18n.__)('File')), (0, _react.createElement)("input", {
|
|
81
82
|
id: inputId,
|
|
82
83
|
type: "file",
|
|
83
84
|
onChange: onChangeFile
|
|
84
|
-
}), (0,
|
|
85
|
+
}), (0, _react.createElement)(_components.Button, {
|
|
85
86
|
type: "submit",
|
|
86
87
|
isBusy: isLoading,
|
|
87
88
|
disabled: !file || isLoading,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_compose","_i18n","_components","_import","_interopRequireDefault","ImportForm","instanceId","onUpload","inputId","formRef","useRef","isLoading","setIsLoading","useState","error","setError","file","setFile","onChangeFile","event","target","files","onSubmit","preventDefault","importReusableBlock","then","reusableBlock","catch","errors","uiMessage","message","__","onDismissError","createElement","className","ref","Notice","status","onRemove","htmlFor","id","type","onChange","Button","isBusy","disabled","variant","_x","_default","withInstanceId","exports","default"],"sources":["@wordpress/list-reusable-blocks/src/components/import-form/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState, useRef } from '@wordpress/element';\nimport { withInstanceId } from '@wordpress/compose';\nimport { __, _x } from '@wordpress/i18n';\nimport { Button, Notice } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport importReusableBlock from '../../utils/import';\n\nfunction ImportForm( { instanceId, onUpload } ) {\n\tconst inputId = 'list-reusable-blocks-import-form-' + instanceId;\n\n\tconst formRef = useRef();\n\tconst [ isLoading, setIsLoading ] = useState( false );\n\tconst [ error, setError ] = useState( null );\n\tconst [ file, setFile ] = useState( null );\n\n\tconst onChangeFile = ( event ) => {\n\t\tsetFile( event.target.files[ 0 ] );\n\t\tsetError( null );\n\t};\n\n\tconst onSubmit = ( event ) => {\n\t\tevent.preventDefault();\n\t\tif ( ! file ) {\n\t\t\treturn;\n\t\t}\n\t\tsetIsLoading( { isLoading: true } );\n\t\timportReusableBlock( file )\n\t\t\t.then( ( reusableBlock ) => {\n\t\t\t\tif ( ! formRef ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tsetIsLoading( false );\n\t\t\t\tonUpload( reusableBlock );\n\t\t\t} )\n\t\t\t.catch( ( errors ) => {\n\t\t\t\tif ( ! formRef ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tlet uiMessage;\n\t\t\t\tswitch ( errors.message ) {\n\t\t\t\t\tcase 'Invalid JSON file':\n\t\t\t\t\t\tuiMessage = __( 'Invalid JSON file' );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Invalid pattern JSON file':\n\t\t\t\t\t\tuiMessage = __( 'Invalid pattern JSON file' );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tuiMessage = __( 'Unknown error' );\n\t\t\t\t}\n\n\t\t\t\tsetIsLoading( false );\n\t\t\t\tsetError( uiMessage );\n\t\t\t} );\n\t};\n\n\tconst onDismissError = () => {\n\t\tsetError( null );\n\t};\n\n\treturn (\n\t\t<form\n\t\t\tclassName=\"list-reusable-blocks-import-form\"\n\t\t\tonSubmit={ onSubmit }\n\t\t\tref={ formRef }\n\t\t>\n\t\t\t{ error && (\n\t\t\t\t<Notice status=\"error\" onRemove={ () => onDismissError() }>\n\t\t\t\t\t{ error }\n\t\t\t\t</Notice>\n\t\t\t) }\n\t\t\t<label\n\t\t\t\thtmlFor={ inputId }\n\t\t\t\tclassName=\"list-reusable-blocks-import-form__label\"\n\t\t\t>\n\t\t\t\t{ __( 'File' ) }\n\t\t\t</label>\n\t\t\t<input id={ inputId } type=\"file\" onChange={ onChangeFile } />\n\t\t\t<Button\n\t\t\t\ttype=\"submit\"\n\t\t\t\tisBusy={ isLoading }\n\t\t\t\tdisabled={ ! file || isLoading }\n\t\t\t\tvariant=\"secondary\"\n\t\t\t\tclassName=\"list-reusable-blocks-import-form__button\"\n\t\t\t>\n\t\t\t\t{ _x( 'Import', 'button label' ) }\n\t\t\t</Button>\n\t\t</form>\n\t);\n}\n\nexport default withInstanceId( ImportForm );\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_element","require","_compose","_i18n","_components","_import","_interopRequireDefault","ImportForm","instanceId","onUpload","inputId","formRef","useRef","isLoading","setIsLoading","useState","error","setError","file","setFile","onChangeFile","event","target","files","onSubmit","preventDefault","importReusableBlock","then","reusableBlock","catch","errors","uiMessage","message","__","onDismissError","_react","createElement","className","ref","Notice","status","onRemove","htmlFor","id","type","onChange","Button","isBusy","disabled","variant","_x","_default","withInstanceId","exports","default"],"sources":["@wordpress/list-reusable-blocks/src/components/import-form/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState, useRef } from '@wordpress/element';\nimport { withInstanceId } from '@wordpress/compose';\nimport { __, _x } from '@wordpress/i18n';\nimport { Button, Notice } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport importReusableBlock from '../../utils/import';\n\nfunction ImportForm( { instanceId, onUpload } ) {\n\tconst inputId = 'list-reusable-blocks-import-form-' + instanceId;\n\n\tconst formRef = useRef();\n\tconst [ isLoading, setIsLoading ] = useState( false );\n\tconst [ error, setError ] = useState( null );\n\tconst [ file, setFile ] = useState( null );\n\n\tconst onChangeFile = ( event ) => {\n\t\tsetFile( event.target.files[ 0 ] );\n\t\tsetError( null );\n\t};\n\n\tconst onSubmit = ( event ) => {\n\t\tevent.preventDefault();\n\t\tif ( ! file ) {\n\t\t\treturn;\n\t\t}\n\t\tsetIsLoading( { isLoading: true } );\n\t\timportReusableBlock( file )\n\t\t\t.then( ( reusableBlock ) => {\n\t\t\t\tif ( ! formRef ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tsetIsLoading( false );\n\t\t\t\tonUpload( reusableBlock );\n\t\t\t} )\n\t\t\t.catch( ( errors ) => {\n\t\t\t\tif ( ! formRef ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tlet uiMessage;\n\t\t\t\tswitch ( errors.message ) {\n\t\t\t\t\tcase 'Invalid JSON file':\n\t\t\t\t\t\tuiMessage = __( 'Invalid JSON file' );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Invalid pattern JSON file':\n\t\t\t\t\t\tuiMessage = __( 'Invalid pattern JSON file' );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tuiMessage = __( 'Unknown error' );\n\t\t\t\t}\n\n\t\t\t\tsetIsLoading( false );\n\t\t\t\tsetError( uiMessage );\n\t\t\t} );\n\t};\n\n\tconst onDismissError = () => {\n\t\tsetError( null );\n\t};\n\n\treturn (\n\t\t<form\n\t\t\tclassName=\"list-reusable-blocks-import-form\"\n\t\t\tonSubmit={ onSubmit }\n\t\t\tref={ formRef }\n\t\t>\n\t\t\t{ error && (\n\t\t\t\t<Notice status=\"error\" onRemove={ () => onDismissError() }>\n\t\t\t\t\t{ error }\n\t\t\t\t</Notice>\n\t\t\t) }\n\t\t\t<label\n\t\t\t\thtmlFor={ inputId }\n\t\t\t\tclassName=\"list-reusable-blocks-import-form__label\"\n\t\t\t>\n\t\t\t\t{ __( 'File' ) }\n\t\t\t</label>\n\t\t\t<input id={ inputId } type=\"file\" onChange={ onChangeFile } />\n\t\t\t<Button\n\t\t\t\ttype=\"submit\"\n\t\t\t\tisBusy={ isLoading }\n\t\t\t\tdisabled={ ! file || isLoading }\n\t\t\t\tvariant=\"secondary\"\n\t\t\t\tclassName=\"list-reusable-blocks-import-form__button\"\n\t\t\t>\n\t\t\t\t{ _x( 'Import', 'button label' ) }\n\t\t\t</Button>\n\t\t</form>\n\t);\n}\n\nexport default withInstanceId( ImportForm );\n"],"mappings":";;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAC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,CAAC;AAET;AAAC,IAAAC,QAAA,GAEc,IAAAC,uBAAc,EAAE7C,UAAW,CAAC;AAAA8C,OAAA,CAAAC,OAAA,GAAAH,QAAA"}
|
package/build/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _react = require("react");
|
|
4
5
|
var _element = require("@wordpress/element");
|
|
5
6
|
var _i18n = require("@wordpress/i18n");
|
|
6
7
|
var _export = _interopRequireDefault(require("./utils/export"));
|
|
@@ -41,7 +42,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
|
|
41
42
|
const container = document.createElement('div');
|
|
42
43
|
container.className = 'list-reusable-blocks__container';
|
|
43
44
|
button.parentNode.insertBefore(container, button);
|
|
44
|
-
(0, _element.createRoot)(container).render((0,
|
|
45
|
+
(0, _element.createRoot)(container).render((0, _react.createElement)(_importDropdown.default, {
|
|
45
46
|
onUpload: showNotice
|
|
46
47
|
}));
|
|
47
48
|
});
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_i18n","_export","_interopRequireDefault","_importDropdown","document","body","addEventListener","event","target","classList","contains","preventDefault","exportReusableBlock","dataset","id","button","querySelector","showNotice","notice","createElement","className","innerHTML","__","headerEnd","parentNode","insertBefore","container","createRoot","render","default","onUpload"],"sources":["@wordpress/list-reusable-blocks/src/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createRoot } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport exportReusableBlock from './utils/export';\nimport ImportDropdown from './components/import-dropdown';\n\n// Setup Export Links.\ndocument.body.addEventListener( 'click', ( event ) => {\n\tif (\n\t\t! event.target.classList.contains( 'wp-list-reusable-blocks__export' )\n\t) {\n\t\treturn;\n\t}\n\tevent.preventDefault();\n\texportReusableBlock( event.target.dataset.id );\n} );\n\n// Setup Import Form.\ndocument.addEventListener( 'DOMContentLoaded', () => {\n\tconst button = document.querySelector( '.page-title-action' );\n\tif ( ! button ) {\n\t\treturn;\n\t}\n\n\tconst showNotice = () => {\n\t\tconst notice = document.createElement( 'div' );\n\t\tnotice.className = 'notice notice-success is-dismissible';\n\t\tnotice.innerHTML = `<p>${ __( 'Pattern imported successfully!' ) }</p>`;\n\n\t\tconst headerEnd = document.querySelector( '.wp-header-end' );\n\t\tif ( ! headerEnd ) {\n\t\t\treturn;\n\t\t}\n\t\theaderEnd.parentNode.insertBefore( notice, headerEnd );\n\t};\n\n\tconst container = document.createElement( 'div' );\n\tcontainer.className = 'list-reusable-blocks__container';\n\tbutton.parentNode.insertBefore( container, button );\n\tcreateRoot( container ).render(\n\t\t<ImportDropdown onUpload={ showNotice } />\n\t);\n} );\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_element","require","_i18n","_export","_interopRequireDefault","_importDropdown","document","body","addEventListener","event","target","classList","contains","preventDefault","exportReusableBlock","dataset","id","button","querySelector","showNotice","notice","createElement","className","innerHTML","__","headerEnd","parentNode","insertBefore","container","createRoot","render","_react","default","onUpload"],"sources":["@wordpress/list-reusable-blocks/src/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createRoot } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport exportReusableBlock from './utils/export';\nimport ImportDropdown from './components/import-dropdown';\n\n// Setup Export Links.\ndocument.body.addEventListener( 'click', ( event ) => {\n\tif (\n\t\t! event.target.classList.contains( 'wp-list-reusable-blocks__export' )\n\t) {\n\t\treturn;\n\t}\n\tevent.preventDefault();\n\texportReusableBlock( event.target.dataset.id );\n} );\n\n// Setup Import Form.\ndocument.addEventListener( 'DOMContentLoaded', () => {\n\tconst button = document.querySelector( '.page-title-action' );\n\tif ( ! button ) {\n\t\treturn;\n\t}\n\n\tconst showNotice = () => {\n\t\tconst notice = document.createElement( 'div' );\n\t\tnotice.className = 'notice notice-success is-dismissible';\n\t\tnotice.innerHTML = `<p>${ __( 'Pattern imported successfully!' ) }</p>`;\n\n\t\tconst headerEnd = document.querySelector( '.wp-header-end' );\n\t\tif ( ! headerEnd ) {\n\t\t\treturn;\n\t\t}\n\t\theaderEnd.parentNode.insertBefore( notice, headerEnd );\n\t};\n\n\tconst container = document.createElement( 'div' );\n\tcontainer.className = 'list-reusable-blocks__container';\n\tbutton.parentNode.insertBefore( container, button );\n\tcreateRoot( container ).render(\n\t\t<ImportDropdown onUpload={ showNotice } />\n\t);\n} );\n"],"mappings":";;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAKA,IAAAE,OAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,eAAA,GAAAD,sBAAA,CAAAH,OAAA;AAVA;AACA;AACA;;AAIA;AACA;AACA;;AAIA;AACAK,QAAQ,CAACC,IAAI,CAACC,gBAAgB,CAAE,OAAO,EAAIC,KAAK,IAAM;EACrD,IACC,CAAEA,KAAK,CAACC,MAAM,CAACC,SAAS,CAACC,QAAQ,CAAE,iCAAkC,CAAC,EACrE;IACD;EACD;EACAH,KAAK,CAACI,cAAc,CAAC,CAAC;EACtB,IAAAC,eAAmB,EAAEL,KAAK,CAACC,MAAM,CAACK,OAAO,CAACC,EAAG,CAAC;AAC/C,CAAE,CAAC;;AAEH;AACAV,QAAQ,CAACE,gBAAgB,CAAE,kBAAkB,EAAE,MAAM;EACpD,MAAMS,MAAM,GAAGX,QAAQ,CAACY,aAAa,CAAE,oBAAqB,CAAC;EAC7D,IAAK,CAAED,MAAM,EAAG;IACf;EACD;EAEA,MAAME,UAAU,GAAGA,CAAA,KAAM;IACxB,MAAMC,MAAM,GAAGd,QAAQ,CAACe,aAAa,CAAE,KAAM,CAAC;IAC9CD,MAAM,CAACE,SAAS,GAAG,sCAAsC;IACzDF,MAAM,CAACG,SAAS,GAAI,MAAM,IAAAC,QAAE,EAAE,gCAAiC,CAAG,MAAK;IAEvE,MAAMC,SAAS,GAAGnB,QAAQ,CAACY,aAAa,CAAE,gBAAiB,CAAC;IAC5D,IAAK,CAAEO,SAAS,EAAG;MAClB;IACD;IACAA,SAAS,CAACC,UAAU,CAACC,YAAY,CAAEP,MAAM,EAAEK,SAAU,CAAC;EACvD,CAAC;EAED,MAAMG,SAAS,GAAGtB,QAAQ,CAACe,aAAa,CAAE,KAAM,CAAC;EACjDO,SAAS,CAACN,SAAS,GAAG,iCAAiC;EACvDL,MAAM,CAACS,UAAU,CAACC,YAAY,CAAEC,SAAS,EAAEX,MAAO,CAAC;EACnD,IAAAY,mBAAU,EAAED,SAAU,CAAC,CAACE,MAAM,CAC7B,IAAAC,MAAA,CAAAV,aAAA,EAAChB,eAAA,CAAA2B,OAAc;IAACC,QAAQ,EAAGd;EAAY,CAAE,CAC1C,CAAC;AACF,CAAE,CAAC"}
|
package/build-module/index.js
CHANGED
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
--wp-block-synced-color: #7a00df;
|
|
98
98
|
--wp-block-synced-color--rgb: 122, 0, 223;
|
|
99
99
|
}
|
|
100
|
-
@media (min-resolution: 192dpi) {
|
|
100
|
+
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
|
|
101
101
|
:root {
|
|
102
102
|
--wp-admin-border-width-focus: 1.5px;
|
|
103
103
|
}
|
|
@@ -145,7 +145,7 @@ body.admin-color-light {
|
|
|
145
145
|
--wp-admin-theme-color-darker-20--rgb: 0, 97, 135;
|
|
146
146
|
--wp-admin-border-width-focus: 2px;
|
|
147
147
|
}
|
|
148
|
-
@media (min-resolution: 192dpi) {
|
|
148
|
+
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
|
|
149
149
|
body.admin-color-light {
|
|
150
150
|
--wp-admin-border-width-focus: 1.5px;
|
|
151
151
|
}
|
|
@@ -160,7 +160,7 @@ body.admin-color-modern {
|
|
|
160
160
|
--wp-admin-theme-color-darker-20--rgb: 24, 58, 214;
|
|
161
161
|
--wp-admin-border-width-focus: 2px;
|
|
162
162
|
}
|
|
163
|
-
@media (min-resolution: 192dpi) {
|
|
163
|
+
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
|
|
164
164
|
body.admin-color-modern {
|
|
165
165
|
--wp-admin-border-width-focus: 1.5px;
|
|
166
166
|
}
|
|
@@ -175,7 +175,7 @@ body.admin-color-blue {
|
|
|
175
175
|
--wp-admin-theme-color-darker-20--rgb: 6, 64, 84;
|
|
176
176
|
--wp-admin-border-width-focus: 2px;
|
|
177
177
|
}
|
|
178
|
-
@media (min-resolution: 192dpi) {
|
|
178
|
+
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
|
|
179
179
|
body.admin-color-blue {
|
|
180
180
|
--wp-admin-border-width-focus: 1.5px;
|
|
181
181
|
}
|
|
@@ -190,7 +190,7 @@ body.admin-color-coffee {
|
|
|
190
190
|
--wp-admin-theme-color-darker-20--rgb: 43, 39, 36;
|
|
191
191
|
--wp-admin-border-width-focus: 2px;
|
|
192
192
|
}
|
|
193
|
-
@media (min-resolution: 192dpi) {
|
|
193
|
+
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
|
|
194
194
|
body.admin-color-coffee {
|
|
195
195
|
--wp-admin-border-width-focus: 1.5px;
|
|
196
196
|
}
|
|
@@ -205,7 +205,7 @@ body.admin-color-ectoplasm {
|
|
|
205
205
|
--wp-admin-theme-color-darker-20--rgb: 58, 44, 77;
|
|
206
206
|
--wp-admin-border-width-focus: 2px;
|
|
207
207
|
}
|
|
208
|
-
@media (min-resolution: 192dpi) {
|
|
208
|
+
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
|
|
209
209
|
body.admin-color-ectoplasm {
|
|
210
210
|
--wp-admin-border-width-focus: 1.5px;
|
|
211
211
|
}
|
|
@@ -220,7 +220,7 @@ body.admin-color-midnight {
|
|
|
220
220
|
--wp-admin-theme-color-darker-20--rgb: 208, 44, 33;
|
|
221
221
|
--wp-admin-border-width-focus: 2px;
|
|
222
222
|
}
|
|
223
|
-
@media (min-resolution: 192dpi) {
|
|
223
|
+
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
|
|
224
224
|
body.admin-color-midnight {
|
|
225
225
|
--wp-admin-border-width-focus: 1.5px;
|
|
226
226
|
}
|
|
@@ -235,7 +235,7 @@ body.admin-color-ocean {
|
|
|
235
235
|
--wp-admin-theme-color-darker-20--rgb: 76, 96, 102;
|
|
236
236
|
--wp-admin-border-width-focus: 2px;
|
|
237
237
|
}
|
|
238
|
-
@media (min-resolution: 192dpi) {
|
|
238
|
+
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
|
|
239
239
|
body.admin-color-ocean {
|
|
240
240
|
--wp-admin-border-width-focus: 1.5px;
|
|
241
241
|
}
|
|
@@ -250,7 +250,7 @@ body.admin-color-sunrise {
|
|
|
250
250
|
--wp-admin-theme-color-darker-20--rgb: 195, 105, 34;
|
|
251
251
|
--wp-admin-border-width-focus: 2px;
|
|
252
252
|
}
|
|
253
|
-
@media (min-resolution: 192dpi) {
|
|
253
|
+
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
|
|
254
254
|
body.admin-color-sunrise {
|
|
255
255
|
--wp-admin-border-width-focus: 1.5px;
|
|
256
256
|
}
|
package/build-style/style.css
CHANGED
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
--wp-block-synced-color: #7a00df;
|
|
98
98
|
--wp-block-synced-color--rgb: 122, 0, 223;
|
|
99
99
|
}
|
|
100
|
-
@media (min-resolution: 192dpi) {
|
|
100
|
+
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
|
|
101
101
|
:root {
|
|
102
102
|
--wp-admin-border-width-focus: 1.5px;
|
|
103
103
|
}
|
|
@@ -145,7 +145,7 @@ body.admin-color-light {
|
|
|
145
145
|
--wp-admin-theme-color-darker-20--rgb: 0, 97, 135;
|
|
146
146
|
--wp-admin-border-width-focus: 2px;
|
|
147
147
|
}
|
|
148
|
-
@media (min-resolution: 192dpi) {
|
|
148
|
+
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
|
|
149
149
|
body.admin-color-light {
|
|
150
150
|
--wp-admin-border-width-focus: 1.5px;
|
|
151
151
|
}
|
|
@@ -160,7 +160,7 @@ body.admin-color-modern {
|
|
|
160
160
|
--wp-admin-theme-color-darker-20--rgb: 24, 58, 214;
|
|
161
161
|
--wp-admin-border-width-focus: 2px;
|
|
162
162
|
}
|
|
163
|
-
@media (min-resolution: 192dpi) {
|
|
163
|
+
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
|
|
164
164
|
body.admin-color-modern {
|
|
165
165
|
--wp-admin-border-width-focus: 1.5px;
|
|
166
166
|
}
|
|
@@ -175,7 +175,7 @@ body.admin-color-blue {
|
|
|
175
175
|
--wp-admin-theme-color-darker-20--rgb: 6, 64, 84;
|
|
176
176
|
--wp-admin-border-width-focus: 2px;
|
|
177
177
|
}
|
|
178
|
-
@media (min-resolution: 192dpi) {
|
|
178
|
+
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
|
|
179
179
|
body.admin-color-blue {
|
|
180
180
|
--wp-admin-border-width-focus: 1.5px;
|
|
181
181
|
}
|
|
@@ -190,7 +190,7 @@ body.admin-color-coffee {
|
|
|
190
190
|
--wp-admin-theme-color-darker-20--rgb: 43, 39, 36;
|
|
191
191
|
--wp-admin-border-width-focus: 2px;
|
|
192
192
|
}
|
|
193
|
-
@media (min-resolution: 192dpi) {
|
|
193
|
+
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
|
|
194
194
|
body.admin-color-coffee {
|
|
195
195
|
--wp-admin-border-width-focus: 1.5px;
|
|
196
196
|
}
|
|
@@ -205,7 +205,7 @@ body.admin-color-ectoplasm {
|
|
|
205
205
|
--wp-admin-theme-color-darker-20--rgb: 58, 44, 77;
|
|
206
206
|
--wp-admin-border-width-focus: 2px;
|
|
207
207
|
}
|
|
208
|
-
@media (min-resolution: 192dpi) {
|
|
208
|
+
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
|
|
209
209
|
body.admin-color-ectoplasm {
|
|
210
210
|
--wp-admin-border-width-focus: 1.5px;
|
|
211
211
|
}
|
|
@@ -220,7 +220,7 @@ body.admin-color-midnight {
|
|
|
220
220
|
--wp-admin-theme-color-darker-20--rgb: 208, 44, 33;
|
|
221
221
|
--wp-admin-border-width-focus: 2px;
|
|
222
222
|
}
|
|
223
|
-
@media (min-resolution: 192dpi) {
|
|
223
|
+
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
|
|
224
224
|
body.admin-color-midnight {
|
|
225
225
|
--wp-admin-border-width-focus: 1.5px;
|
|
226
226
|
}
|
|
@@ -235,7 +235,7 @@ body.admin-color-ocean {
|
|
|
235
235
|
--wp-admin-theme-color-darker-20--rgb: 76, 96, 102;
|
|
236
236
|
--wp-admin-border-width-focus: 2px;
|
|
237
237
|
}
|
|
238
|
-
@media (min-resolution: 192dpi) {
|
|
238
|
+
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
|
|
239
239
|
body.admin-color-ocean {
|
|
240
240
|
--wp-admin-border-width-focus: 1.5px;
|
|
241
241
|
}
|
|
@@ -250,7 +250,7 @@ body.admin-color-sunrise {
|
|
|
250
250
|
--wp-admin-theme-color-darker-20--rgb: 195, 105, 34;
|
|
251
251
|
--wp-admin-border-width-focus: 2px;
|
|
252
252
|
}
|
|
253
|
-
@media (min-resolution: 192dpi) {
|
|
253
|
+
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
|
|
254
254
|
body.admin-color-sunrise {
|
|
255
255
|
--wp-admin-border-width-focus: 1.5px;
|
|
256
256
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/list-reusable-blocks",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.20.0",
|
|
4
4
|
"description": "Adding Export/Import support to the reusable blocks listing.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -26,11 +26,11 @@
|
|
|
26
26
|
"module": "build-module/index.js",
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@babel/runtime": "^7.16.0",
|
|
29
|
-
"@wordpress/api-fetch": "^6.
|
|
30
|
-
"@wordpress/components": "^25.
|
|
31
|
-
"@wordpress/compose": "^6.
|
|
32
|
-
"@wordpress/element": "^5.
|
|
33
|
-
"@wordpress/i18n": "^4.
|
|
29
|
+
"@wordpress/api-fetch": "^6.40.0",
|
|
30
|
+
"@wordpress/components": "^25.9.0",
|
|
31
|
+
"@wordpress/compose": "^6.20.0",
|
|
32
|
+
"@wordpress/element": "^5.20.0",
|
|
33
|
+
"@wordpress/i18n": "^4.43.0",
|
|
34
34
|
"change-case": "^4.1.2"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
@@ -40,5 +40,5 @@
|
|
|
40
40
|
"publishConfig": {
|
|
41
41
|
"access": "public"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "9b8e598c5418d38fe72197c24ef1d3dd6c712151"
|
|
44
44
|
}
|