summaryrefslogtreecommitdiffstats
path: root/wp-includes/js/dist/format-library.js
diff options
context:
space:
mode:
Diffstat (limited to 'wp-includes/js/dist/format-library.js')
-rw-r--r--wp-includes/js/dist/format-library.js971
1 files changed, 525 insertions, 446 deletions
diff --git a/wp-includes/js/dist/format-library.js b/wp-includes/js/dist/format-library.js
index f7c9b7e..ccbfbe0 100644
--- a/wp-includes/js/dist/format-library.js
+++ b/wp-includes/js/dist/format-library.js
@@ -22,30 +22,30 @@ __webpack_require__.r(__webpack_exports__);
;// CONCATENATED MODULE: external ["wp","richText"]
const external_wp_richText_namespaceObject = window["wp"]["richText"];
-;// CONCATENATED MODULE: external "React"
-const external_React_namespaceObject = window["React"];
;// CONCATENATED MODULE: external ["wp","i18n"]
const external_wp_i18n_namespaceObject = window["wp"]["i18n"];
;// CONCATENATED MODULE: external ["wp","blockEditor"]
const external_wp_blockEditor_namespaceObject = window["wp"]["blockEditor"];
;// CONCATENATED MODULE: external ["wp","primitives"]
const external_wp_primitives_namespaceObject = window["wp"]["primitives"];
+;// CONCATENATED MODULE: external "ReactJSXRuntime"
+const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"];
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-bold.js
-
/**
* WordPress dependencies
*/
-const formatBold = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
+
+const formatBold = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
-}, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M14.7 11.3c1-.6 1.5-1.6 1.5-3 0-2.3-1.3-3.4-4-3.4H7v14h5.8c1.4 0 2.5-.3 3.3-1 .8-.7 1.2-1.7 1.2-2.9.1-1.9-.8-3.1-2.6-3.7zm-5.1-4h2.3c.6 0 1.1.1 1.4.4.3.3.5.7.5 1.2s-.2 1-.5 1.2c-.3.3-.8.4-1.4.4H9.6V7.3zm4.6 9c-.4.3-1 .4-1.7.4H9.6v-3.9h2.9c.7 0 1.3.2 1.7.5.4.3.6.8.6 1.5s-.2 1.2-.6 1.5z"
-}));
+ viewBox: "0 0 24 24",
+ children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
+ d: "M14.7 11.3c1-.6 1.5-1.6 1.5-3 0-2.3-1.3-3.4-4-3.4H7v14h5.8c1.4 0 2.5-.3 3.3-1 .8-.7 1.2-1.7 1.2-2.9.1-1.9-.8-3.1-2.6-3.7zm-5.1-4h2.3c.6 0 1.1.1 1.4.4.3.3.5.7.5 1.2s-.2 1-.5 1.2c-.3.3-.8.4-1.4.4H9.6V7.3zm4.6 9c-.4.3-1 .4-1.7.4H9.6v-3.9h2.9c.7 0 1.3.2 1.7.5.4.3.6.8.6 1.5s-.2 1.2-.6 1.5z"
+ })
+});
/* harmony default export */ const format_bold = (formatBold);
;// CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/bold/index.js
-
/**
* WordPress dependencies
*/
@@ -53,6 +53,9 @@ const formatBold = (0,external_React_namespaceObject.createElement)(external_wp_
+
+
+
const bold_name = 'core/bold';
const title = (0,external_wp_i18n_namespaceObject.__)('Bold');
const bold = {
@@ -78,41 +81,43 @@ const bold = {
}));
onFocus();
}
- return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichTextShortcut, {
- type: "primary",
- character: "b",
- onUse: onToggle
- }), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichTextToolbarButton, {
- name: "bold",
- icon: format_bold,
- title: title,
- onClick: onClick,
- isActive: isActive,
- shortcutType: "primary",
- shortcutCharacter: "b"
- }), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__unstableRichTextInputEvent, {
- inputType: "formatBold",
- onInput: onToggle
- }));
+ return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
+ children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichTextShortcut, {
+ type: "primary",
+ character: "b",
+ onUse: onToggle
+ }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichTextToolbarButton, {
+ name: "bold",
+ icon: format_bold,
+ title: title,
+ onClick: onClick,
+ isActive: isActive,
+ shortcutType: "primary",
+ shortcutCharacter: "b"
+ }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__unstableRichTextInputEvent, {
+ inputType: "formatBold",
+ onInput: onToggle
+ })]
+ });
}
};
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/code.js
-
/**
* WordPress dependencies
*/
-const code = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
+
+const code = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
viewBox: "0 0 24 24",
- xmlns: "http://www.w3.org/2000/svg"
-}, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M20.8 10.7l-4.3-4.3-1.1 1.1 4.3 4.3c.1.1.1.3 0 .4l-4.3 4.3 1.1 1.1 4.3-4.3c.7-.8.7-1.9 0-2.6zM4.2 11.8l4.3-4.3-1-1-4.3 4.3c-.7.7-.7 1.8 0 2.5l4.3 4.3 1.1-1.1-4.3-4.3c-.2-.1-.2-.3-.1-.4z"
-}));
+ xmlns: "http://www.w3.org/2000/svg",
+ children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
+ d: "M20.8 10.7l-4.3-4.3-1.1 1.1 4.3 4.3c.1.1.1.3 0 .4l-4.3 4.3 1.1 1.1 4.3-4.3c.7-.8.7-1.9 0-2.6zM4.2 11.8l4.3-4.3-1-1-4.3 4.3c-.7.7-.7 1.8 0 2.5l4.3 4.3 1.1-1.1-4.3-4.3c-.2-.1-.2-.3-.1-.4z"
+ })
+});
/* harmony default export */ const library_code = (code);
;// CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/code/index.js
-
/**
* WordPress dependencies
*/
@@ -120,6 +125,9 @@ const code = (0,external_React_namespaceObject.createElement)(external_wp_primit
+
+
+
const code_name = 'core/code';
const code_title = (0,external_wp_i18n_namespaceObject.__)('Inline code');
const code_code = {
@@ -171,17 +179,19 @@ const code_code = {
}));
onFocus();
}
- return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichTextShortcut, {
- type: "access",
- character: "x",
- onUse: onClick
- }), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichTextToolbarButton, {
- icon: library_code,
- title: code_title,
- onClick: onClick,
- isActive: isActive,
- role: "menuitemcheckbox"
- }));
+ return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
+ children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichTextShortcut, {
+ type: "access",
+ character: "x",
+ onUse: onClick
+ }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichTextToolbarButton, {
+ icon: library_code,
+ title: code_title,
+ onClick: onClick,
+ isActive: isActive,
+ role: "menuitemcheckbox"
+ })]
+ });
}
};
@@ -190,21 +200,20 @@ const external_wp_components_namespaceObject = window["wp"]["components"];
;// CONCATENATED MODULE: external ["wp","element"]
const external_wp_element_namespaceObject = window["wp"]["element"];
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/keyboard-return.js
-
/**
* WordPress dependencies
*/
-const keyboardReturn = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
+
+const keyboardReturn = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
- viewBox: "-2 -2 24 24"
-}, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M6.734 16.106l2.176-2.38-1.093-1.028-3.846 4.158 3.846 4.157 1.093-1.027-2.176-2.38h2.811c1.125 0 2.25.03 3.374 0 1.428-.001 3.362-.25 4.963-1.277 1.66-1.065 2.868-2.906 2.868-5.859 0-2.479-1.327-4.896-3.65-5.93-1.82-.813-3.044-.8-4.806-.788l-.567.002v1.5c.184 0 .368 0 .553-.002 1.82-.007 2.704-.014 4.21.657 1.854.827 2.76 2.657 2.76 4.561 0 2.472-.973 3.824-2.178 4.596-1.258.807-2.864 1.04-4.163 1.04h-.02c-1.115.03-2.229 0-3.344 0H6.734z"
-}));
+ children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
+ d: "m6.734 16.106 2.176-2.38-1.093-1.028-3.846 4.158 3.846 4.158 1.093-1.028-2.176-2.38h2.811c1.125 0 2.25.03 3.374 0 1.428-.001 3.362-.25 4.963-1.277 1.66-1.065 2.868-2.906 2.868-5.859 0-2.479-1.327-4.896-3.65-5.93-1.82-.813-3.044-.8-4.806-.788l-.567.002v1.5c.184 0 .368 0 .553-.002 1.82-.007 2.704-.014 4.21.657 1.854.827 2.76 2.657 2.76 4.561 0 2.472-.973 3.824-2.178 4.596-1.258.807-2.864 1.04-4.163 1.04h-.02c-1.115.03-2.229 0-3.344 0H6.734Z"
+ })
+});
/* harmony default export */ const keyboard_return = (keyboardReturn);
;// CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/image/index.js
-
/**
* WordPress dependencies
*/
@@ -214,6 +223,8 @@ const keyboardReturn = (0,external_React_namespaceObject.createElement)(external
+
+
const ALLOWED_MEDIA_TYPES = ['image'];
const image_name = 'core/image';
const image_title = (0,external_wp_i18n_namespaceObject.__)('Inline image');
@@ -246,43 +257,46 @@ function InlineUI({
editableContentElement: contentRef.current,
settings: image_image
});
- return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Popover, {
+ return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Popover, {
placement: "bottom",
focusOnMount: false,
anchor: popoverAnchor,
- className: "block-editor-format-toolbar__image-popover"
- }, (0,external_React_namespaceObject.createElement)("form", {
- className: "block-editor-format-toolbar__image-container-content",
- onSubmit: event => {
- const newReplacements = value.replacements.slice();
- newReplacements[value.start] = {
- type: image_name,
- attributes: {
- ...activeObjectAttributes,
- style: width ? `width: ${width}px;` : ''
- }
- };
- onChange({
- ...value,
- replacements: newReplacements
- });
- event.preventDefault();
- }
- }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHStack, {
- alignment: "bottom",
- spacing: "0"
- }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalNumberControl, {
- className: "block-editor-format-toolbar__image-container-value",
- label: (0,external_wp_i18n_namespaceObject.__)('Width'),
- value: width,
- min: 1,
- onChange: newWidth => setWidth(newWidth)
- }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
- className: "block-editor-format-toolbar__image-container-button",
- icon: keyboard_return,
- label: (0,external_wp_i18n_namespaceObject.__)('Apply'),
- type: "submit"
- }))));
+ className: "block-editor-format-toolbar__image-popover",
+ children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("form", {
+ className: "block-editor-format-toolbar__image-container-content",
+ onSubmit: event => {
+ const newReplacements = value.replacements.slice();
+ newReplacements[value.start] = {
+ type: image_name,
+ attributes: {
+ ...activeObjectAttributes,
+ style: width ? `width: ${width}px;` : ''
+ }
+ };
+ onChange({
+ ...value,
+ replacements: newReplacements
+ });
+ event.preventDefault();
+ },
+ children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, {
+ alignment: "bottom",
+ spacing: "0",
+ children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalNumberControl, {
+ className: "block-editor-format-toolbar__image-container-value",
+ label: (0,external_wp_i18n_namespaceObject.__)('Width'),
+ value: width,
+ min: 1,
+ onChange: newWidth => setWidth(newWidth)
+ }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
+ className: "block-editor-format-toolbar__image-container-button",
+ icon: keyboard_return,
+ label: (0,external_wp_i18n_namespaceObject.__)('Apply'),
+ type: "submit"
+ })]
+ })
+ })
+ });
}
function Edit({
value,
@@ -292,74 +306,65 @@ function Edit({
activeObjectAttributes,
contentRef
}) {
- const [isModalOpen, setIsModalOpen] = (0,external_wp_element_namespaceObject.useState)(false);
- function openModal() {
- setIsModalOpen(true);
- }
- function closeModal() {
- setIsModalOpen(false);
- }
- return (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaUploadCheck, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichTextToolbarButton, {
- icon: (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
- }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
- d: "M4 18.5h16V17H4v1.5zM16 13v1.5h4V13h-4zM5.1 15h7.8c.6 0 1.1-.5 1.1-1.1V6.1c0-.6-.5-1.1-1.1-1.1H5.1C4.5 5 4 5.5 4 6.1v7.8c0 .6.5 1.1 1.1 1.1zm.4-8.5h7V10l-1-1c-.3-.3-.8-.3-1 0l-1.6 1.5-1.2-.7c-.3-.2-.6-.2-.9 0l-1.3 1V6.5zm0 6.1l1.8-1.3 1.3.8c.3.2.7.2.9-.1l1.5-1.4 1.5 1.4v1.5h-7v-.9z"
- })),
- title: image_title,
- onClick: openModal,
- isActive: isObjectActive
- }), isModalOpen && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaUpload, {
- allowedTypes: ALLOWED_MEDIA_TYPES,
- onSelect: ({
- id,
- url,
- alt,
- width: imgWidth
- }) => {
- closeModal();
- onChange((0,external_wp_richText_namespaceObject.insertObject)(value, {
- type: image_name,
- attributes: {
- className: `wp-image-${id}`,
- style: `width: ${Math.min(imgWidth, 150)}px;`,
- url,
- alt
- }
- }));
- onFocus();
- },
- onClose: closeModal,
- render: ({
- open
- }) => {
- open();
- return null;
- }
- }), isObjectActive && (0,external_React_namespaceObject.createElement)(InlineUI, {
- value: value,
- onChange: onChange,
- activeObjectAttributes: activeObjectAttributes,
- contentRef: contentRef
- }));
+ return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.MediaUploadCheck, {
+ children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.MediaUpload, {
+ allowedTypes: ALLOWED_MEDIA_TYPES,
+ onSelect: ({
+ id,
+ url,
+ alt,
+ width: imgWidth
+ }) => {
+ onChange((0,external_wp_richText_namespaceObject.insertObject)(value, {
+ type: image_name,
+ attributes: {
+ className: `wp-image-${id}`,
+ style: `width: ${Math.min(imgWidth, 150)}px;`,
+ url,
+ alt
+ }
+ }));
+ onFocus();
+ },
+ render: ({
+ open
+ }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichTextToolbarButton, {
+ icon: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, {
+ xmlns: "http://www.w3.org/2000/svg",
+ viewBox: "0 0 24 24",
+ children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, {
+ d: "M4 18.5h16V17H4v1.5zM16 13v1.5h4V13h-4zM5.1 15h7.8c.6 0 1.1-.5 1.1-1.1V6.1c0-.6-.5-1.1-1.1-1.1H5.1C4.5 5 4 5.5 4 6.1v7.8c0 .6.5 1.1 1.1 1.1zm.4-8.5h7V10l-1-1c-.3-.3-.8-.3-1 0l-1.6 1.5-1.2-.7c-.3-.2-.6-.2-.9 0l-1.3 1V6.5zm0 6.1l1.8-1.3 1.3.8c.3.2.7.2.9-.1l1.5-1.4 1.5 1.4v1.5h-7v-.9z"
+ })
+ }),
+ title: image_title,
+ onClick: open,
+ isActive: isObjectActive
+ })
+ }), isObjectActive && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(InlineUI, {
+ value: value,
+ onChange: onChange,
+ activeObjectAttributes: activeObjectAttributes,
+ contentRef: contentRef
+ })]
+ });
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-italic.js
-
/**
* WordPress dependencies
*/
-const formatItalic = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
+
+const formatItalic = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
-}, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M12.5 5L10 19h1.9l2.5-14z"
-}));
+ viewBox: "0 0 24 24",
+ children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
+ d: "M12.5 5L10 19h1.9l2.5-14z"
+ })
+});
/* harmony default export */ const format_italic = (formatItalic);
;// CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/italic/index.js
-
/**
* WordPress dependencies
*/
@@ -367,6 +372,9 @@ const formatItalic = (0,external_React_namespaceObject.createElement)(external_w
+
+
+
const italic_name = 'core/italic';
const italic_title = (0,external_wp_i18n_namespaceObject.__)('Italic');
const italic = {
@@ -392,22 +400,24 @@ const italic = {
}));
onFocus();
}
- return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichTextShortcut, {
- type: "primary",
- character: "i",
- onUse: onToggle
- }), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichTextToolbarButton, {
- name: "italic",
- icon: format_italic,
- title: italic_title,
- onClick: onClick,
- isActive: isActive,
- shortcutType: "primary",
- shortcutCharacter: "i"
- }), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__unstableRichTextInputEvent, {
- inputType: "formatItalic",
- onInput: onToggle
- }));
+ return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
+ children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichTextShortcut, {
+ type: "primary",
+ character: "i",
+ onUse: onToggle
+ }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichTextToolbarButton, {
+ name: "italic",
+ icon: format_italic,
+ title: italic_title,
+ onClick: onClick,
+ isActive: isActive,
+ shortcutType: "primary",
+ shortcutCharacter: "i"
+ }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__unstableRichTextInputEvent, {
+ inputType: "formatItalic",
+ onInput: onToggle
+ })]
+ });
}
};
@@ -416,17 +426,18 @@ const external_wp_url_namespaceObject = window["wp"]["url"];
;// CONCATENATED MODULE: external ["wp","htmlEntities"]
const external_wp_htmlEntities_namespaceObject = window["wp"]["htmlEntities"];
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/link.js
-
/**
* WordPress dependencies
*/
-const link_link = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
+
+const link_link = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
-}, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M10 17.389H8.444A5.194 5.194 0 1 1 8.444 7H10v1.5H8.444a3.694 3.694 0 0 0 0 7.389H10v1.5ZM14 7h1.556a5.194 5.194 0 0 1 0 10.39H14v-1.5h1.556a3.694 3.694 0 0 0 0-7.39H14V7Zm-4.5 6h5v-1.5h-5V13Z"
-}));
+ viewBox: "0 0 24 24",
+ children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
+ d: "M10 17.389H8.444A5.194 5.194 0 1 1 8.444 7H10v1.5H8.444a3.694 3.694 0 0 0 0 7.389H10v1.5ZM14 7h1.556a5.194 5.194 0 0 1 0 10.39H14v-1.5h1.556a3.694 3.694 0 0 0 0-7.39H14V7Zm-4.5 6h5v-1.5h-5V13Z"
+ })
+});
/* harmony default export */ const library_link = (link_link);
;// CONCATENATED MODULE: external ["wp","a11y"]
@@ -516,8 +527,12 @@ function createLinkFormat({
url
}
};
- if (type) format.attributes.type = type;
- if (id) format.attributes.id = id;
+ if (type) {
+ format.attributes.type = type;
+ }
+ if (id) {
+ format.attributes.id = id;
+ }
if (opensInNewWindow) {
format.attributes.target = '_blank';
format.attributes.rel = format.attributes.rel ? format.attributes.rel + ' noreferrer noopener' : 'noreferrer noopener';
@@ -635,7 +650,6 @@ const walkToStart = partialRight(walkToBoundary, 'backwards');
const walkToEnd = partialRight(walkToBoundary, 'forwards');
;// CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/link/inline.js
-
/**
* WordPress dependencies
*/
@@ -653,6 +667,7 @@ const walkToEnd = partialRight(walkToBoundary, 'forwards');
*/
+
const LINK_SETTINGS = [...external_wp_blockEditor_namespaceObject.__experimentalLinkControl.DEFAULT_LINK_SETTINGS, {
id: 'nofollow',
title: (0,external_wp_i18n_namespaceObject.__)('Mark as nofollow')
@@ -822,38 +837,40 @@ function InlineLinkUI({
function createButtonText(searchTerm) {
return (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: search term. */
(0,external_wp_i18n_namespaceObject.__)('Create page: <mark>%s</mark>'), searchTerm), {
- mark: (0,external_React_namespaceObject.createElement)("mark", null)
+ mark: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("mark", {})
});
}
- return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Popover, {
+ return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Popover, {
anchor: popoverAnchor,
+ animate: false,
onClose: stopAddingLink,
onFocusOutside: onFocusOutside,
placement: "bottom",
- offset: 10,
+ offset: 8,
shift: true,
focusOnMount: focusOnMount,
- constrainTabbing: true
- }, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalLinkControl, {
- value: linkValue,
- onChange: onChangeLink,
- onRemove: removeLink,
- hasRichPreviews: true,
- createSuggestion: createPageEntity && handleCreate,
- withCreateSuggestion: userCanCreatePages,
- createSuggestionButtonText: createButtonText,
- hasTextControl: true,
- settings: LINK_SETTINGS,
- showInitialSuggestions: true,
- suggestionsQuery: {
- // always show Pages as initial suggestions
- initialSuggestionsSearchOptions: {
- type: 'post',
- subtype: 'page',
- perPage: 20
+ constrainTabbing: true,
+ children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalLinkControl, {
+ value: linkValue,
+ onChange: onChangeLink,
+ onRemove: removeLink,
+ hasRichPreviews: true,
+ createSuggestion: createPageEntity && handleCreate,
+ withCreateSuggestion: userCanCreatePages,
+ createSuggestionButtonText: createButtonText,
+ hasTextControl: true,
+ settings: LINK_SETTINGS,
+ showInitialSuggestions: true,
+ suggestionsQuery: {
+ // always show Pages as initial suggestions
+ initialSuggestionsSearchOptions: {
+ type: 'post',
+ subtype: 'page',
+ perPage: 20
+ }
}
- }
- }));
+ })
+ });
}
function getRichTextValueFromSelection(value, isActive) {
// Default to the selection ranges on the RichTextValue object.
@@ -880,7 +897,6 @@ function getRichTextValueFromSelection(value, isActive) {
/* harmony default export */ const inline = (InlineLinkUI);
;// CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/link/index.js
-
/**
* WordPress dependencies
*/
@@ -898,6 +914,9 @@ function getRichTextValueFromSelection(value, isActive) {
*/
+
+
+
const link_name = 'core/link';
const link_title = (0,external_wp_i18n_namespaceObject.__)('Link');
function link_Edit({
@@ -908,35 +927,16 @@ function link_Edit({
onFocus,
contentRef
}) {
- const [editingLink, setEditingLink] = (0,external_wp_element_namespaceObject.useState)(false);
- const [creatingLink, setCreatingLink] = (0,external_wp_element_namespaceObject.useState)(false);
+ const [addingLink, setAddingLink] = (0,external_wp_element_namespaceObject.useState)(false);
// We only need to store the button element that opened the popover. We can ignore the other states, as they will be handled by the onFocus prop to return to the rich text field.
const [openedBy, setOpenedBy] = (0,external_wp_element_namespaceObject.useState)(null);
-
- // Manages whether the Link UI popover should autofocus when shown.
- const [shouldAutoFocus, setShouldAutoFocus] = (0,external_wp_element_namespaceObject.useState)(true);
- function setIsEditingLink(isEditing, {
- autoFocus = true
- } = {}) {
- setEditingLink(isEditing);
- setShouldAutoFocus(autoFocus);
- }
- function setIsCreatingLink(isCreating) {
- // Don't add a new link if there is already an active link.
- // The two states are mutually exclusive.
- if (isCreating === true && isActive) {
- return;
- }
- setCreatingLink(isCreating);
- }
(0,external_wp_element_namespaceObject.useEffect)(() => {
// When the link becomes inactive (i.e. isActive is false), reset the editingLink state
// and the creatingLink state. This means that if the Link UI is displayed and the link
// becomes inactive (e.g. used arrow keys to move cursor outside of link bounds), the UI will close.
if (!isActive) {
- setEditingLink(false);
- setCreatingLink(false);
+ setAddingLink(false);
}
}, [isActive]);
(0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
@@ -951,14 +951,16 @@ function link_Edit({
// This causes the `editingLink` state to be set to `true` and the link UI
// to be rendered in "creating" mode. We need to check isActive to see if
// we have an active link format.
- if (!event.target.closest('[contenteditable] a') ||
+ const link = event.target.closest('[contenteditable] a');
+ if (!link ||
// other formats (e.g. bold) may be nested within the link.
!isActive) {
- setIsEditingLink(false);
return;
}
- setIsEditingLink(true, {
- autoFocus: false
+ setAddingLink(true);
+ setOpenedBy({
+ el: link,
+ action: 'click'
});
}
editableContentElement.addEventListener('click', handleClick);
@@ -967,7 +969,6 @@ function link_Edit({
};
}, [contentRef, isActive]);
function addLink(target) {
- setShouldAutoFocus(true);
const text = (0,external_wp_richText_namespaceObject.getTextContent)((0,external_wp_richText_namespaceObject.slice)(value));
if (!isActive && text && (0,external_wp_url_namespaceObject.isURL)(text) && isValidHref(text)) {
onChange((0,external_wp_richText_namespaceObject.applyFormat)(value, {
@@ -985,13 +986,12 @@ function link_Edit({
}));
} else {
if (target) {
- setOpenedBy(target);
- }
- if (!isActive) {
- setIsCreatingLink(true);
- } else {
- setIsEditingLink(true);
+ setOpenedBy({
+ el: target,
+ action: null // We don't need to distinguish between click or keyboard here
+ });
}
+ setAddingLink(true);
}
}
@@ -1010,12 +1010,11 @@ function link_Edit({
// Otherwise, we rely on the passed in onFocus to return focus to the rich text field.
// Close the popover
- setIsEditingLink(false);
- setIsCreatingLink(false);
+ setAddingLink(false);
// Return focus to the toolbar button or the rich text field
- if (openedBy?.tagName === 'BUTTON') {
- openedBy.focus();
+ if (openedBy?.el?.tagName === 'BUTTON') {
+ openedBy.el.focus();
} else {
onFocus();
}
@@ -1030,45 +1029,48 @@ function link_Edit({
// 4. Press Escape
// 5. Focus should be on the Options button
function onFocusOutside() {
- setIsEditingLink(false);
- setIsCreatingLink(false);
+ setAddingLink(false);
setOpenedBy(null);
}
function onRemoveFormat() {
onChange((0,external_wp_richText_namespaceObject.removeFormat)(value, link_name));
(0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)('Link removed.'), 'assertive');
}
- const isEditingActiveLink = editingLink && isActive;
- return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichTextShortcut, {
- type: "primary",
- character: "k",
- onUse: addLink
- }), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichTextShortcut, {
- type: "primaryShift",
- character: "k",
- onUse: onRemoveFormat
- }), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichTextToolbarButton, {
- name: "link",
- icon: library_link,
- title: isActive ? (0,external_wp_i18n_namespaceObject.__)('Link') : link_title,
- onClick: event => {
- addLink(event.currentTarget);
- },
- isActive: isActive || editingLink,
- shortcutType: "primary",
- shortcutCharacter: "k",
- "aria-haspopup": "true",
- "aria-expanded": editingLink
- }), (isEditingActiveLink || creatingLink) && (0,external_React_namespaceObject.createElement)(inline, {
- stopAddingLink: stopAddingLink,
- onFocusOutside: onFocusOutside,
- isActive: isActive,
- activeAttributes: activeAttributes,
- value: value,
- onChange: onChange,
- contentRef: contentRef,
- focusOnMount: shouldAutoFocus ? 'firstElement' : false
- }));
+
+ // Only autofocus if we have clicked a link within the editor
+ const shouldAutoFocus = !(openedBy?.el?.tagName === 'A' && openedBy?.action === 'click');
+ return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
+ children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichTextShortcut, {
+ type: "primary",
+ character: "k",
+ onUse: addLink
+ }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichTextShortcut, {
+ type: "primaryShift",
+ character: "k",
+ onUse: onRemoveFormat
+ }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichTextToolbarButton, {
+ name: "link",
+ icon: library_link,
+ title: isActive ? (0,external_wp_i18n_namespaceObject.__)('Link') : link_title,
+ onClick: event => {
+ addLink(event.currentTarget);
+ },
+ isActive: isActive || addingLink,
+ shortcutType: "primary",
+ shortcutCharacter: "k",
+ "aria-haspopup": "true",
+ "aria-expanded": addingLink
+ }), addingLink && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inline, {
+ stopAddingLink: stopAddingLink,
+ onFocusOutside: onFocusOutside,
+ isActive: isActive,
+ activeAttributes: activeAttributes,
+ value: value,
+ onChange: onChange,
+ contentRef: contentRef,
+ focusOnMount: shouldAutoFocus ? 'firstElement' : false
+ })]
+ });
}
const build_module_link_link = {
name: link_name,
@@ -1114,21 +1116,21 @@ const build_module_link_link = {
};
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-strikethrough.js
-
/**
* WordPress dependencies
*/
-const formatStrikethrough = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
+
+const formatStrikethrough = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
-}, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M9.1 9v-.5c0-.6.2-1.1.7-1.4.5-.3 1.2-.5 2-.5.7 0 1.4.1 2.1.3.7.2 1.4.5 2.1.9l.2-1.9c-.6-.3-1.2-.5-1.9-.7-.8-.1-1.6-.2-2.4-.2-1.5 0-2.7.3-3.6 1-.8.7-1.2 1.5-1.2 2.6V9h2zM20 12H4v1h8.3c.3.1.6.2.8.3.5.2.9.5 1.1.8.3.3.4.7.4 1.2 0 .7-.2 1.1-.8 1.5-.5.3-1.2.5-2.1.5-.8 0-1.6-.1-2.4-.3-.8-.2-1.5-.5-2.2-.8L7 18.1c.5.2 1.2.4 2 .6.8.2 1.6.3 2.4.3 1.7 0 3-.3 3.9-1 .9-.7 1.3-1.6 1.3-2.8 0-.9-.2-1.7-.7-2.2H20v-1z"
-}));
+ viewBox: "0 0 24 24",
+ children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
+ d: "M9.1 9v-.5c0-.6.2-1.1.7-1.4.5-.3 1.2-.5 2-.5.7 0 1.4.1 2.1.3.7.2 1.4.5 2.1.9l.2-1.9c-.6-.3-1.2-.5-1.9-.7-.8-.1-1.6-.2-2.4-.2-1.5 0-2.7.3-3.6 1-.8.7-1.2 1.5-1.2 2.6V9h2zM20 12H4v1h8.3c.3.1.6.2.8.3.5.2.9.5 1.1.8.3.3.4.7.4 1.2 0 .7-.2 1.1-.8 1.5-.5.3-1.2.5-2.1.5-.8 0-1.6-.1-2.4-.3-.8-.2-1.5-.5-2.2-.8L7 18.1c.5.2 1.2.4 2 .6.8.2 1.6.3 2.4.3 1.7 0 3-.3 3.9-1 .9-.7 1.3-1.6 1.3-2.8 0-.9-.2-1.7-.7-2.2H20v-1z"
+ })
+});
/* harmony default export */ const format_strikethrough = (formatStrikethrough);
;// CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/strikethrough/index.js
-
/**
* WordPress dependencies
*/
@@ -1136,6 +1138,9 @@ const formatStrikethrough = (0,external_React_namespaceObject.createElement)(ext
+
+
+
const strikethrough_name = 'core/strikethrough';
const strikethrough_title = (0,external_wp_i18n_namespaceObject.__)('Strikethrough');
const strikethrough = {
@@ -1156,28 +1161,32 @@ const strikethrough = {
}));
onFocus();
}
- return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichTextShortcut, {
- type: "access",
- character: "d",
- onUse: onClick
- }), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichTextToolbarButton, {
- icon: format_strikethrough,
- title: strikethrough_title,
- onClick: onClick,
- isActive: isActive,
- role: "menuitemcheckbox"
- }));
+ return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
+ children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichTextShortcut, {
+ type: "access",
+ character: "d",
+ onUse: onClick
+ }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichTextToolbarButton, {
+ icon: format_strikethrough,
+ title: strikethrough_title,
+ onClick: onClick,
+ isActive: isActive,
+ role: "menuitemcheckbox"
+ })]
+ });
}
};
;// CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/underline/index.js
-
/**
* WordPress dependencies
*/
+
+
+
const underline_name = 'core/underline';
const underline_title = (0,external_wp_i18n_namespaceObject.__)('Underline');
const underline = {
@@ -1201,14 +1210,16 @@ const underline = {
title: underline_title
}));
};
- return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichTextShortcut, {
- type: "primary",
- character: "u",
- onUse: onToggle
- }), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__unstableRichTextInputEvent, {
- inputType: "formatUnderline",
- onInput: onToggle
- }));
+ return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
+ children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichTextShortcut, {
+ type: "primary",
+ character: "u",
+ onUse: onToggle
+ }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__unstableRichTextInputEvent, {
+ inputType: "formatUnderline",
+ onInput: onToggle
+ })]
+ });
}
};
@@ -1245,31 +1256,33 @@ function Icon({
/* harmony default export */ const icon = ((0,external_wp_element_namespaceObject.forwardRef)(Icon));
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/text-color.js
-
/**
* WordPress dependencies
*/
-const textColor = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
+
+const textColor = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
-}, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M12.9 6h-2l-4 11h1.9l1.1-3h4.2l1.1 3h1.9L12.9 6zm-2.5 6.5l1.5-4.9 1.7 4.9h-3.2z"
-}));
+ viewBox: "0 0 24 24",
+ children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
+ d: "M12.9 6h-2l-4 11h1.9l1.1-3h4.2l1.1 3h1.9L12.9 6zm-2.5 6.5l1.5-4.9 1.7 4.9h-3.2z"
+ })
+});
/* harmony default export */ const text_color = (textColor);
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/color.js
-
/**
* WordPress dependencies
*/
-const color = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
+
+const color = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
viewBox: "0 0 24 24",
- xmlns: "http://www.w3.org/2000/svg"
-}, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M17.2 10.9c-.5-1-1.2-2.1-2.1-3.2-.6-.9-1.3-1.7-2.1-2.6L12 4l-1 1.1c-.6.9-1.3 1.7-2 2.6-.8 1.2-1.5 2.3-2 3.2-.6 1.2-1 2.2-1 3 0 3.4 2.7 6.1 6.1 6.1s6.1-2.7 6.1-6.1c0-.8-.3-1.8-1-3zm-5.1 7.6c-2.5 0-4.6-2.1-4.6-4.6 0-.3.1-1 .8-2.3.5-.9 1.1-1.9 2-3.1.7-.9 1.3-1.7 1.8-2.3.7.8 1.3 1.6 1.8 2.3.8 1.1 1.5 2.2 2 3.1.7 1.3.8 2 .8 2.3 0 2.5-2.1 4.6-4.6 4.6z"
-}));
+ xmlns: "http://www.w3.org/2000/svg",
+ children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
+ d: "M17.2 10.9c-.5-1-1.2-2.1-2.1-3.2-.6-.9-1.3-1.7-2.1-2.6L12 4l-1 1.1c-.6.9-1.3 1.7-2 2.6-.8 1.2-1.5 2.3-2 3.2-.6 1.2-1 2.2-1 3 0 3.4 2.7 6.1 6.1 6.1s6.1-2.7 6.1-6.1c0-.8-.3-1.8-1-3zm-5.1 7.6c-2.5 0-4.6-2.1-4.6-4.6 0-.3.1-1 .8-2.3.5-.9 1.1-1.9 2-3.1.7-.9 1.3-1.7 1.8-2.3.7.8 1.3 1.6 1.8 2.3.8 1.1 1.5 2.2 2 3.1.7 1.3.8 2 .8 2.3 0 2.5-2.1 4.6-4.6 4.6z"
+ })
+});
/* harmony default export */ const library_color = (color);
;// CONCATENATED MODULE: external ["wp","privateApis"]
@@ -1282,10 +1295,9 @@ const external_wp_privateApis_namespaceObject = window["wp"]["privateApis"];
const {
lock,
unlock
-} = (0,external_wp_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)('I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.', '@wordpress/format-library');
+} = (0,external_wp_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)('I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/format-library');
;// CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/text-color/inline.js
-
/**
* WordPress dependencies
*/
@@ -1301,6 +1313,8 @@ const {
*/
+
+
const {
Tabs
} = unlock(external_wp_components_namespaceObject.privateApis);
@@ -1315,8 +1329,12 @@ function parseCSS(css = '') {
return css.split(';').reduce((accumulator, rule) => {
if (rule) {
const [property, value] = rule.split(':');
- if (property === 'color') accumulator.color = value;
- if (property === 'background-color' && value !== transparentValue) accumulator.backgroundColor = value;
+ if (property === 'color') {
+ accumulator.color = value;
+ }
+ if (property === 'background-color' && value !== transparentValue) {
+ accumulator.backgroundColor = value;
+ }
}
return accumulator;
}, {});
@@ -1370,8 +1388,12 @@ function setColors(value, name, colorSettings, colors) {
styles.push(['color', color].join(':'));
}
}
- if (styles.length) attributes.style = styles.join(';');
- if (classNames.length) attributes.class = classNames.join(' ');
+ if (styles.length) {
+ attributes.style = styles.join(';');
+ }
+ if (classNames.length) {
+ attributes.class = classNames.join(' ');
+ }
return (0,external_wp_richText_namespaceObject.applyFormat)(value, {
type: name,
attributes
@@ -1396,7 +1418,7 @@ function ColorPicker({
}));
}, [colors, onChange, property]);
const activeColors = (0,external_wp_element_namespaceObject.useMemo)(() => getActiveColors(value, name, colors), [name, value, colors]);
- return (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.ColorPalette, {
+ return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.ColorPalette, {
value: activeColors[property],
onChange: onColorChange
});
@@ -1416,27 +1438,31 @@ function InlineColorUI({
isActive
}
});
- return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Popover, {
+ return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Popover, {
onClose: onClose,
className: "format-library__inline-color-popover",
- anchor: popoverAnchor
- }, (0,external_React_namespaceObject.createElement)(Tabs, null, (0,external_React_namespaceObject.createElement)(Tabs.TabList, null, TABS.map(tab => (0,external_React_namespaceObject.createElement)(Tabs.Tab, {
- tabId: tab.name,
- key: tab.name
- }, tab.title))), TABS.map(tab => (0,external_React_namespaceObject.createElement)(Tabs.TabPanel, {
- tabId: tab.name,
- focusable: false,
- key: tab.name
- }, (0,external_React_namespaceObject.createElement)(ColorPicker, {
- name: name,
- property: tab.name,
- value: value,
- onChange: onChange
- })))));
+ anchor: popoverAnchor,
+ children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(Tabs, {
+ children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tabs.TabList, {
+ children: TABS.map(tab => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tabs.Tab, {
+ tabId: tab.name,
+ children: tab.title
+ }, tab.name))
+ }), TABS.map(tab => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tabs.TabPanel, {
+ tabId: tab.name,
+ focusable: false,
+ children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ColorPicker, {
+ name: name,
+ property: tab.name,
+ value: value,
+ onChange: onChange
+ })
+ }, tab.name))]
+ })
+ });
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/text-color/index.js
-
/**
* WordPress dependencies
*/
@@ -1450,6 +1476,9 @@ function InlineColorUI({
* Internal dependencies
*/
+
+
+
const transparentValue = 'rgba(0, 0, 0, 0)';
const text_color_name = 'core/text-color';
const text_color_title = (0,external_wp_i18n_namespaceObject.__)('Highlight');
@@ -1496,27 +1525,29 @@ function TextColorEdit({
if (!hasColorsToChoose && !isActive) {
return null;
}
- return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichTextToolbarButton, {
- className: "format-library-text-color-button",
- isActive: isActive,
- icon: (0,external_React_namespaceObject.createElement)(icon, {
- icon: Object.keys(activeAttributes).length ? text_color : library_color,
- style: colorIndicatorStyle
- }),
- title: text_color_title
- // If has no colors to choose but a color is active remove the color onClick.
- ,
- onClick: hasColorsToChoose ? enableIsAddingColor : () => onChange((0,external_wp_richText_namespaceObject.removeFormat)(value, text_color_name)),
- role: "menuitemcheckbox"
- }), isAddingColor && (0,external_React_namespaceObject.createElement)(InlineColorUI, {
- name: text_color_name,
- onClose: disableIsAddingColor,
- activeAttributes: activeAttributes,
- value: value,
- onChange: onChange,
- contentRef: contentRef,
- isActive: isActive
- }));
+ return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
+ children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichTextToolbarButton, {
+ className: "format-library-text-color-button",
+ isActive: isActive,
+ icon: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(icon, {
+ icon: Object.keys(activeAttributes).length ? text_color : library_color,
+ style: colorIndicatorStyle
+ }),
+ title: text_color_title
+ // If has no colors to choose but a color is active remove the color onClick.
+ ,
+ onClick: hasColorsToChoose ? enableIsAddingColor : () => onChange((0,external_wp_richText_namespaceObject.removeFormat)(value, text_color_name)),
+ role: "menuitemcheckbox"
+ }), isAddingColor && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(InlineColorUI, {
+ name: text_color_name,
+ onClose: disableIsAddingColor,
+ activeAttributes: activeAttributes,
+ value: value,
+ onChange: onChange,
+ contentRef: contentRef,
+ isActive: isActive
+ })]
+ });
}
const text_color_textColor = {
name: text_color_name,
@@ -1531,21 +1562,21 @@ const text_color_textColor = {
};
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/subscript.js
-
/**
* WordPress dependencies
*/
-const subscript = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
+
+const subscript = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
-}, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M16.9 18.3l.8-1.2c.4-.6.7-1.2.9-1.6.2-.4.3-.8.3-1.2 0-.3-.1-.7-.2-1-.1-.3-.4-.5-.6-.7-.3-.2-.6-.3-1-.3s-.8.1-1.1.2c-.3.1-.7.3-1 .6l.2 1.3c.3-.3.5-.5.8-.6s.6-.2.9-.2c.3 0 .5.1.7.2.2.2.2.4.2.7 0 .3-.1.5-.2.8-.1.3-.4.7-.8 1.3L15 19.4h4.3v-1.2h-2.4zM14.1 7.2h-2L9.5 11 6.9 7.2h-2l3.6 5.3L4.7 18h2l2.7-4 2.7 4h2l-3.8-5.5 3.8-5.3z"
-}));
+ viewBox: "0 0 24 24",
+ children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
+ d: "M16.9 18.3l.8-1.2c.4-.6.7-1.2.9-1.6.2-.4.3-.8.3-1.2 0-.3-.1-.7-.2-1-.1-.3-.4-.5-.6-.7-.3-.2-.6-.3-1-.3s-.8.1-1.1.2c-.3.1-.7.3-1 .6l.2 1.3c.3-.3.5-.5.8-.6s.6-.2.9-.2c.3 0 .5.1.7.2.2.2.2.4.2.7 0 .3-.1.5-.2.8-.1.3-.4.7-.8 1.3L15 19.4h4.3v-1.2h-2.4zM14.1 7.2h-2L9.5 11 6.9 7.2h-2l3.6 5.3L4.7 18h2l2.7-4 2.7 4h2l-3.8-5.5 3.8-5.3z"
+ })
+});
/* harmony default export */ const library_subscript = (subscript);
;// CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/subscript/index.js
-
/**
* WordPress dependencies
*/
@@ -1553,6 +1584,7 @@ const subscript = (0,external_React_namespaceObject.createElement)(external_wp_p
+
const subscript_name = 'core/subscript';
const subscript_title = (0,external_wp_i18n_namespaceObject.__)('Subscript');
const subscript_subscript = {
@@ -1576,7 +1608,7 @@ const subscript_subscript = {
onToggle();
onFocus();
}
- return (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichTextToolbarButton, {
+ return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichTextToolbarButton, {
icon: library_subscript,
title: subscript_title,
onClick: onClick,
@@ -1587,21 +1619,21 @@ const subscript_subscript = {
};
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/superscript.js
-
/**
* WordPress dependencies
*/
-const superscript = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
+
+const superscript = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
-}, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M16.9 10.3l.8-1.3c.4-.6.7-1.2.9-1.6.2-.4.3-.8.3-1.2 0-.3-.1-.7-.2-1-.2-.2-.4-.4-.7-.6-.3-.2-.6-.3-1-.3s-.8.1-1.1.2c-.3.1-.7.3-1 .6l.1 1.3c.3-.3.5-.5.8-.6s.6-.2.9-.2c.3 0 .5.1.7.2.2.2.2.4.2.7 0 .3-.1.5-.2.8-.1.3-.4.7-.8 1.3l-1.8 2.8h4.3v-1.2h-2.2zm-2.8-3.1h-2L9.5 11 6.9 7.2h-2l3.6 5.3L4.7 18h2l2.7-4 2.7 4h2l-3.8-5.5 3.8-5.3z"
-}));
+ viewBox: "0 0 24 24",
+ children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
+ d: "M16.9 10.3l.8-1.3c.4-.6.7-1.2.9-1.6.2-.4.3-.8.3-1.2 0-.3-.1-.7-.2-1-.2-.2-.4-.4-.7-.6-.3-.2-.6-.3-1-.3s-.8.1-1.1.2c-.3.1-.7.3-1 .6l.1 1.3c.3-.3.5-.5.8-.6s.6-.2.9-.2c.3 0 .5.1.7.2.2.2.2.4.2.7 0 .3-.1.5-.2.8-.1.3-.4.7-.8 1.3l-1.8 2.8h4.3v-1.2h-2.2zm-2.8-3.1h-2L9.5 11 6.9 7.2h-2l3.6 5.3L4.7 18h2l2.7-4 2.7 4h2l-3.8-5.5 3.8-5.3z"
+ })
+});
/* harmony default export */ const library_superscript = (superscript);
;// CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/superscript/index.js
-
/**
* WordPress dependencies
*/
@@ -1609,6 +1641,7 @@ const superscript = (0,external_React_namespaceObject.createElement)(external_wp
+
const superscript_name = 'core/superscript';
const superscript_title = (0,external_wp_i18n_namespaceObject.__)('Superscript');
const superscript_superscript = {
@@ -1632,7 +1665,7 @@ const superscript_superscript = {
onToggle();
onFocus();
}
- return (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichTextToolbarButton, {
+ return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichTextToolbarButton, {
icon: library_superscript,
title: superscript_title,
onClick: onClick,
@@ -1643,21 +1676,21 @@ const superscript_superscript = {
};
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/button.js
-
/**
* WordPress dependencies
*/
-const button_button = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
+
+const button_button = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
viewBox: "0 0 24 24",
- xmlns: "http://www.w3.org/2000/svg"
-}, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M8 12.5h8V11H8v1.5Z M19 6.5H5a2 2 0 0 0-2 2V15a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8.5a2 2 0 0 0-2-2ZM5 8h14a.5.5 0 0 1 .5.5V15a.5.5 0 0 1-.5.5H5a.5.5 0 0 1-.5-.5V8.5A.5.5 0 0 1 5 8Z"
-}));
+ xmlns: "http://www.w3.org/2000/svg",
+ children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
+ d: "M8 12.5h8V11H8v1.5Z M19 6.5H5a2 2 0 0 0-2 2V15a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8.5a2 2 0 0 0-2-2ZM5 8h14a.5.5 0 0 1 .5.5V15a.5.5 0 0 1-.5.5H5a.5.5 0 0 1-.5-.5V8.5A.5.5 0 0 1 5 8Z"
+ })
+});
/* harmony default export */ const library_button = (button_button);
;// CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/keyboard/index.js
-
/**
* WordPress dependencies
*/
@@ -1665,6 +1698,7 @@ const button_button = (0,external_React_namespaceObject.createElement)(external_
+
const keyboard_name = 'core/keyboard';
const keyboard_title = (0,external_wp_i18n_namespaceObject.__)('Keyboard input');
const keyboard = {
@@ -1688,7 +1722,7 @@ const keyboard = {
onToggle();
onFocus();
}
- return (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichTextToolbarButton, {
+ return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichTextToolbarButton, {
icon: library_button,
title: keyboard_title,
onClick: onClick,
@@ -1699,21 +1733,21 @@ const keyboard = {
};
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/help.js
-
/**
* WordPress dependencies
*/
-const help = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
+
+const help = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
-}, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M12 4.75a7.25 7.25 0 100 14.5 7.25 7.25 0 000-14.5zM3.25 12a8.75 8.75 0 1117.5 0 8.75 8.75 0 01-17.5 0zM12 8.75a1.5 1.5 0 01.167 2.99c-.465.052-.917.44-.917 1.01V14h1.5v-.845A3 3 0 109 10.25h1.5a1.5 1.5 0 011.5-1.5zM11.25 15v1.5h1.5V15h-1.5z"
-}));
+ viewBox: "0 0 24 24",
+ children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
+ d: "M12 4.75a7.25 7.25 0 100 14.5 7.25 7.25 0 000-14.5zM3.25 12a8.75 8.75 0 1117.5 0 8.75 8.75 0 01-17.5 0zM12 8.75a1.5 1.5 0 01.167 2.99c-.465.052-.917.44-.917 1.01V14h1.5v-.845A3 3 0 109 10.25h1.5a1.5 1.5 0 011.5-1.5zM11.25 15v1.5h1.5V15h-1.5z"
+ })
+});
/* harmony default export */ const library_help = (help);
;// CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/unknown/index.js
-
/**
* WordPress dependencies
*/
@@ -1721,8 +1755,18 @@ const help = (0,external_React_namespaceObject.createElement)(external_wp_primit
+
const unknown_name = 'core/unknown';
const unknown_title = (0,external_wp_i18n_namespaceObject.__)('Clear Unknown Formatting');
+function selectionContainsUnknownFormats(value) {
+ if ((0,external_wp_richText_namespaceObject.isCollapsed)(value)) {
+ return false;
+ }
+ const selectedValue = (0,external_wp_richText_namespaceObject.slice)(value);
+ return selectedValue.formats.some(formats => {
+ return formats.some(format => format.type === unknown_name);
+ });
+}
const unknown = {
name: unknown_name,
title: unknown_title,
@@ -1734,18 +1778,14 @@ const unknown = {
onChange,
onFocus
}) {
+ if (!isActive && !selectionContainsUnknownFormats(value)) {
+ return null;
+ }
function onClick() {
onChange((0,external_wp_richText_namespaceObject.removeFormat)(value, unknown_name));
onFocus();
}
- const selectedValue = (0,external_wp_richText_namespaceObject.slice)(value);
- const hasUnknownFormats = selectedValue.formats.some(formats => {
- return formats.some(format => format.type === unknown_name);
- });
- if (!isActive && !hasUnknownFormats) {
- return null;
- }
- return (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichTextToolbarButton, {
+ return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichTextToolbarButton, {
name: "unknown",
icon: library_help,
title: unknown_title,
@@ -1756,21 +1796,21 @@ const unknown = {
};
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/language.js
-
/**
* WordPress dependencies
*/
-const language = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
+
+const language = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
-}, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
- d: "M17.5 10h-1.7l-3.7 10.5h1.7l.9-2.6h3.9l.9 2.6h1.7L17.5 10zm-2.2 6.3 1.4-4 1.4 4h-2.8zm-4.8-3.8c1.6-1.8 2.9-3.6 3.7-5.7H16V5.2h-5.8V3H8.8v2.2H3v1.5h9.6c-.7 1.6-1.8 3.1-3.1 4.6C8.6 10.2 7.8 9 7.2 8H5.6c.6 1.4 1.7 2.9 2.9 4.4l-2.4 2.4c-.3.4-.7.8-1.1 1.2l1 1 1.2-1.2c.8-.8 1.6-1.5 2.3-2.3.8.9 1.7 1.7 2.5 2.5l.6-1.5c-.7-.6-1.4-1.3-2.1-2z"
-}));
+ viewBox: "0 0 24 24",
+ children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
+ d: "M17.5 10h-1.7l-3.7 10.5h1.7l.9-2.6h3.9l.9 2.6h1.7L17.5 10zm-2.2 6.3 1.4-4 1.4 4h-2.8zm-4.8-3.8c1.6-1.8 2.9-3.6 3.7-5.7H16V5.2h-5.8V3H8.8v2.2H3v1.5h9.6c-.7 1.6-1.8 3.1-3.1 4.6C8.6 10.2 7.8 9 7.2 8H5.6c.6 1.4 1.7 2.9 2.9 4.4l-2.4 2.4c-.3.4-.7.8-1.1 1.2l1 1 1.2-1.2c.8-.8 1.6-1.5 2.3-2.3.8.9 1.7 1.7 2.5 2.5l.6-1.5c-.7-.6-1.4-1.3-2.1-2z"
+ })
+});
/* harmony default export */ const library_language = (language);
;// CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/language/index.js
-
/**
* WordPress dependencies
*/
@@ -1784,6 +1824,9 @@ const language = (0,external_React_namespaceObject.createElement)(external_wp_pr
+
+
+
const language_name = 'core/language';
const language_title = (0,external_wp_i18n_namespaceObject.__)('Language');
const language_language = {
@@ -1803,25 +1846,27 @@ function language_Edit({
const togglePopover = () => {
setIsPopoverVisible(state => !state);
};
- return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichTextToolbarButton, {
- icon: library_language,
- label: language_title,
- title: language_title,
- onClick: () => {
- if (isActive) {
- onChange((0,external_wp_richText_namespaceObject.removeFormat)(value, language_name));
- } else {
- togglePopover();
- }
- },
- isActive: isActive,
- role: "menuitemcheckbox"
- }), isPopoverVisible && (0,external_React_namespaceObject.createElement)(InlineLanguageUI, {
- value: value,
- onChange: onChange,
- onClose: togglePopover,
- contentRef: contentRef
- }));
+ return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
+ children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichTextToolbarButton, {
+ icon: library_language,
+ label: language_title,
+ title: language_title,
+ onClick: () => {
+ if (isActive) {
+ onChange((0,external_wp_richText_namespaceObject.removeFormat)(value, language_name));
+ } else {
+ togglePopover();
+ }
+ },
+ isActive: isActive,
+ role: "menuitemcheckbox"
+ }), isPopoverVisible && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(InlineLanguageUI, {
+ value: value,
+ onChange: onChange,
+ onClose: togglePopover,
+ contentRef: contentRef
+ })]
+ });
}
function InlineLanguageUI({
value,
@@ -1835,48 +1880,81 @@ function InlineLanguageUI({
});
const [lang, setLang] = (0,external_wp_element_namespaceObject.useState)('');
const [dir, setDir] = (0,external_wp_element_namespaceObject.useState)('ltr');
- return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Popover, {
+ return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Popover, {
className: "block-editor-format-toolbar__language-popover",
anchor: popoverAnchor,
- onClose: onClose
- }, (0,external_React_namespaceObject.createElement)("form", {
- className: "block-editor-format-toolbar__language-container-content",
- onSubmit: event => {
- event.preventDefault();
- onChange((0,external_wp_richText_namespaceObject.applyFormat)(value, {
- type: language_name,
- attributes: {
- lang,
- dir
- }
- }));
- onClose();
- }
- }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
- label: language_title,
- value: lang,
- onChange: val => setLang(val),
- help: (0,external_wp_i18n_namespaceObject.__)('A valid language attribute, like "en" or "fr".')
- }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
- label: (0,external_wp_i18n_namespaceObject.__)('Text direction'),
- value: dir,
- options: [{
- label: (0,external_wp_i18n_namespaceObject.__)('Left to right'),
- value: 'ltr'
- }, {
- label: (0,external_wp_i18n_namespaceObject.__)('Right to left'),
- value: 'rtl'
- }],
- onChange: val => setDir(val)
- }), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHStack, {
- alignment: "right"
- }, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
- variant: "primary",
- type: "submit",
- text: (0,external_wp_i18n_namespaceObject.__)('Apply')
- }))));
+ onClose: onClose,
+ children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("form", {
+ className: "block-editor-format-toolbar__language-container-content",
+ onSubmit: event => {
+ event.preventDefault();
+ onChange((0,external_wp_richText_namespaceObject.applyFormat)(value, {
+ type: language_name,
+ attributes: {
+ lang,
+ dir
+ }
+ }));
+ onClose();
+ },
+ children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, {
+ label: language_title,
+ value: lang,
+ onChange: val => setLang(val),
+ help: (0,external_wp_i18n_namespaceObject.__)('A valid language attribute, like "en" or "fr".')
+ }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Text direction'),
+ value: dir,
+ options: [{
+ label: (0,external_wp_i18n_namespaceObject.__)('Left to right'),
+ value: 'ltr'
+ }, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Right to left'),
+ value: 'rtl'
+ }],
+ onChange: val => setDir(val)
+ }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHStack, {
+ alignment: "right",
+ children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
+ variant: "primary",
+ type: "submit",
+ text: (0,external_wp_i18n_namespaceObject.__)('Apply')
+ })
+ })]
+ })
+ });
}
+;// CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/non-breaking-space/index.js
+/**
+ * WordPress dependencies
+ */
+
+
+
+
+const non_breaking_space_name = 'core/non-breaking-space';
+const non_breaking_space_title = (0,external_wp_i18n_namespaceObject.__)('Non breaking space');
+const nonBreakingSpace = {
+ name: non_breaking_space_name,
+ title: non_breaking_space_title,
+ tagName: 'nbsp',
+ className: null,
+ edit({
+ value,
+ onChange
+ }) {
+ function addNonBreakingSpace() {
+ onChange((0,external_wp_richText_namespaceObject.insert)(value, '\u00a0'));
+ }
+ return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichTextShortcut, {
+ type: "primaryShift",
+ character: " ",
+ onUse: addNonBreakingSpace
+ });
+ }
+};
+
;// CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/default-formats.js
/**
* Internal dependencies
@@ -1894,7 +1972,8 @@ function InlineLanguageUI({
-/* harmony default export */ const default_formats = ([bold, code_code, image_image, italic, build_module_link_link, strikethrough, underline, text_color_textColor, subscript_subscript, superscript_superscript, keyboard, unknown, language_language]);
+
+/* harmony default export */ const default_formats = ([bold, code_code, image_image, italic, build_module_link_link, strikethrough, underline, text_color_textColor, subscript_subscript, superscript_superscript, keyboard, unknown, language_language, nonBreakingSpace]);
;// CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/index.js
/**