summaryrefslogtreecommitdiffstats
path: root/wp-includes/js/dist/list-reusable-blocks.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-19 04:51:22 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-19 04:51:22 +0000
commitfc0a79914946dac00ccd51b1aacffe267de7210e (patch)
tree1403384efbfe8f8776ff60aaa40f7d535c02c822 /wp-includes/js/dist/list-reusable-blocks.js
parentReleasing progress-linux version 6.5.5+dfsg1-1~progress7.99u1. (diff)
downloadwordpress-fc0a79914946dac00ccd51b1aacffe267de7210e.tar.xz
wordpress-fc0a79914946dac00ccd51b1aacffe267de7210e.zip
Merging upstream version 6.6.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'wp-includes/js/dist/list-reusable-blocks.js')
-rw-r--r--wp-includes/js/dist/list-reusable-blocks.js67
1 files changed, 37 insertions, 30 deletions
diff --git a/wp-includes/js/dist/list-reusable-blocks.js b/wp-includes/js/dist/list-reusable-blocks.js
index cd8d3fb..6010995 100644
--- a/wp-includes/js/dist/list-reusable-blocks.js
+++ b/wp-includes/js/dist/list-reusable-blocks.js
@@ -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
}));
});