wp core update 6.6
This commit is contained in:
67
wp/wp-includes/js/dist/list-reusable-blocks.js
vendored
67
wp/wp-includes/js/dist/list-reusable-blocks.js
vendored
@@ -49,8 +49,6 @@ var __webpack_exports__ = {};
|
||||
// ESM COMPAT FLAG
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
|
||||
;// CONCATENATED MODULE: external "React"
|
||||
const external_React_namespaceObject = window["React"];
|
||||
;// CONCATENATED MODULE: external ["wp","element"]
|
||||
const external_wp_element_namespaceObject = window["wp"]["element"];
|
||||
;// CONCATENATED MODULE: external ["wp","i18n"]
|
||||
@@ -639,8 +637,9 @@ async function importReusableBlock(file) {
|
||||
}
|
||||
/* harmony default export */ const utils_import = (importReusableBlock);
|
||||
|
||||
;// CONCATENATED MODULE: external "ReactJSXRuntime"
|
||||
const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"];
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/list-reusable-blocks/build-module/components/import-form/index.js
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
@@ -653,6 +652,8 @@ async function importReusableBlock(file) {
|
||||
* Internal dependencies
|
||||
*/
|
||||
|
||||
|
||||
|
||||
function ImportForm({
|
||||
instanceId,
|
||||
onUpload
|
||||
@@ -702,32 +703,36 @@ function ImportForm({
|
||||
const onDismissError = () => {
|
||||
setError(null);
|
||||
};
|
||||
return (0,external_React_namespaceObject.createElement)("form", {
|
||||
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("form", {
|
||||
className: "list-reusable-blocks-import-form",
|
||||
onSubmit: onSubmit,
|
||||
ref: formRef
|
||||
}, error && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Notice, {
|
||||
status: "error",
|
||||
onRemove: () => onDismissError()
|
||||
}, error), (0,external_React_namespaceObject.createElement)("label", {
|
||||
htmlFor: inputId,
|
||||
className: "list-reusable-blocks-import-form__label"
|
||||
}, (0,external_wp_i18n_namespaceObject.__)('File')), (0,external_React_namespaceObject.createElement)("input", {
|
||||
id: inputId,
|
||||
type: "file",
|
||||
onChange: onChangeFile
|
||||
}), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
|
||||
type: "submit",
|
||||
isBusy: isLoading,
|
||||
disabled: !file || isLoading,
|
||||
variant: "secondary",
|
||||
className: "list-reusable-blocks-import-form__button"
|
||||
}, (0,external_wp_i18n_namespaceObject._x)('Import', 'button label')));
|
||||
ref: formRef,
|
||||
children: [error && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Notice, {
|
||||
status: "error",
|
||||
onRemove: () => onDismissError(),
|
||||
children: error
|
||||
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("label", {
|
||||
htmlFor: inputId,
|
||||
className: "list-reusable-blocks-import-form__label",
|
||||
children: (0,external_wp_i18n_namespaceObject.__)('File')
|
||||
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("input", {
|
||||
id: inputId,
|
||||
type: "file",
|
||||
onChange: onChangeFile
|
||||
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
|
||||
type: "submit",
|
||||
isBusy: isLoading,
|
||||
__experimentalIsFocusable: true,
|
||||
disabled: !file || isLoading,
|
||||
variant: "secondary",
|
||||
className: "list-reusable-blocks-import-form__button",
|
||||
children: (0,external_wp_i18n_namespaceObject._x)('Import', 'button label')
|
||||
})]
|
||||
});
|
||||
}
|
||||
/* harmony default export */ const import_form = ((0,external_wp_compose_namespaceObject.withInstanceId)(ImportForm));
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/list-reusable-blocks/build-module/components/import-dropdown/index.js
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
@@ -739,10 +744,11 @@ function ImportForm({
|
||||
* Internal dependencies
|
||||
*/
|
||||
|
||||
|
||||
function ImportDropdown({
|
||||
onUpload
|
||||
}) {
|
||||
return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Dropdown, {
|
||||
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Dropdown, {
|
||||
popoverProps: {
|
||||
placement: 'bottom-start'
|
||||
},
|
||||
@@ -750,14 +756,15 @@ function ImportDropdown({
|
||||
renderToggle: ({
|
||||
isOpen,
|
||||
onToggle
|
||||
}) => (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
|
||||
}) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
|
||||
"aria-expanded": isOpen,
|
||||
onClick: onToggle,
|
||||
variant: "primary"
|
||||
}, (0,external_wp_i18n_namespaceObject.__)('Import from JSON')),
|
||||
variant: "primary",
|
||||
children: (0,external_wp_i18n_namespaceObject.__)('Import from JSON')
|
||||
}),
|
||||
renderContent: ({
|
||||
onClose
|
||||
}) => (0,external_React_namespaceObject.createElement)(import_form, {
|
||||
}) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(import_form, {
|
||||
onUpload: (0,external_wp_compose_namespaceObject.pipe)(onClose, onUpload)
|
||||
})
|
||||
});
|
||||
@@ -765,7 +772,6 @@ function ImportDropdown({
|
||||
/* harmony default export */ const import_dropdown = (ImportDropdown);
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/list-reusable-blocks/build-module/index.js
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
@@ -779,6 +785,7 @@ function ImportDropdown({
|
||||
|
||||
|
||||
// Setup Export Links.
|
||||
|
||||
document.body.addEventListener('click', event => {
|
||||
if (!event.target.classList.contains('wp-list-reusable-blocks__export')) {
|
||||
return;
|
||||
@@ -806,7 +813,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
const container = document.createElement('div');
|
||||
container.className = 'list-reusable-blocks__container';
|
||||
button.parentNode.insertBefore(container, button);
|
||||
(0,external_wp_element_namespaceObject.createRoot)(container).render((0,external_React_namespaceObject.createElement)(import_dropdown, {
|
||||
(0,external_wp_element_namespaceObject.createRoot)(container).render( /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(import_dropdown, {
|
||||
onUpload: showNotice
|
||||
}));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user