1 /******/ (() => { // webpackBootstrap |
1 /******/ (() => { // webpackBootstrap |
2 /******/ "use strict"; |
2 /******/ "use strict"; |
3 /******/ // The require scope |
|
4 /******/ var __webpack_require__ = {}; |
|
5 /******/ |
|
6 /************************************************************************/ |
|
7 /******/ /* webpack/runtime/make namespace object */ |
|
8 /******/ (() => { |
|
9 /******/ // define __esModule on exports |
|
10 /******/ __webpack_require__.r = (exports) => { |
|
11 /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { |
|
12 /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); |
|
13 /******/ } |
|
14 /******/ Object.defineProperty(exports, '__esModule', { value: true }); |
|
15 /******/ }; |
|
16 /******/ })(); |
|
17 /******/ |
|
18 /************************************************************************/ |
|
19 var __webpack_exports__ = {}; |
3 var __webpack_exports__ = {}; |
20 // ESM COMPAT FLAG |
4 |
21 __webpack_require__.r(__webpack_exports__); |
5 ;// external ["wp","richText"] |
22 |
|
23 ;// CONCATENATED MODULE: external ["wp","richText"] |
|
24 const external_wp_richText_namespaceObject = window["wp"]["richText"]; |
6 const external_wp_richText_namespaceObject = window["wp"]["richText"]; |
25 ;// CONCATENATED MODULE: external ["wp","i18n"] |
7 ;// external ["wp","i18n"] |
26 const external_wp_i18n_namespaceObject = window["wp"]["i18n"]; |
8 const external_wp_i18n_namespaceObject = window["wp"]["i18n"]; |
27 ;// CONCATENATED MODULE: external ["wp","blockEditor"] |
9 ;// external ["wp","blockEditor"] |
28 const external_wp_blockEditor_namespaceObject = window["wp"]["blockEditor"]; |
10 const external_wp_blockEditor_namespaceObject = window["wp"]["blockEditor"]; |
29 ;// CONCATENATED MODULE: external ["wp","primitives"] |
11 ;// external ["wp","primitives"] |
30 const external_wp_primitives_namespaceObject = window["wp"]["primitives"]; |
12 const external_wp_primitives_namespaceObject = window["wp"]["primitives"]; |
31 ;// CONCATENATED MODULE: external "ReactJSXRuntime" |
13 ;// external "ReactJSXRuntime" |
32 const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"]; |
14 const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"]; |
33 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-bold.js |
15 ;// ./node_modules/@wordpress/icons/build-module/library/format-bold.js |
34 /** |
16 /** |
35 * WordPress dependencies |
17 * WordPress dependencies |
36 */ |
18 */ |
37 |
19 |
38 |
20 |
193 })] |
171 })] |
194 }); |
172 }); |
195 } |
173 } |
196 }; |
174 }; |
197 |
175 |
198 ;// CONCATENATED MODULE: external ["wp","components"] |
176 ;// external ["wp","components"] |
199 const external_wp_components_namespaceObject = window["wp"]["components"]; |
177 const external_wp_components_namespaceObject = window["wp"]["components"]; |
200 ;// CONCATENATED MODULE: external ["wp","element"] |
178 ;// external ["wp","element"] |
201 const external_wp_element_namespaceObject = window["wp"]["element"]; |
179 const external_wp_element_namespaceObject = window["wp"]["element"]; |
202 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/keyboard-return.js |
180 ;// ./node_modules/@wordpress/format-library/build-module/image/index.js |
203 /** |
181 /** |
204 * WordPress dependencies |
182 * WordPress dependencies |
205 */ |
183 */ |
206 |
|
207 |
|
208 const keyboardReturn = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { |
|
209 xmlns: "http://www.w3.org/2000/svg", |
|
210 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { |
|
211 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" |
|
212 }) |
|
213 }); |
|
214 /* harmony default export */ const keyboard_return = (keyboardReturn); |
|
215 |
|
216 ;// CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/image/index.js |
|
217 /** |
|
218 * WordPress dependencies |
|
219 */ |
|
220 |
|
221 |
|
222 |
184 |
223 |
185 |
224 |
186 |
225 |
187 |
226 |
188 |
248 onChange, |
210 onChange, |
249 activeObjectAttributes, |
211 activeObjectAttributes, |
250 contentRef |
212 contentRef |
251 }) { |
213 }) { |
252 const { |
214 const { |
253 style |
215 style, |
|
216 alt |
254 } = activeObjectAttributes; |
217 } = activeObjectAttributes; |
255 const [width, setWidth] = (0,external_wp_element_namespaceObject.useState)(style?.replace(/\D/g, '')); |
218 const width = style?.replace(/\D/g, ''); |
|
219 const [editedWidth, setEditedWidth] = (0,external_wp_element_namespaceObject.useState)(width); |
|
220 const [editedAlt, setEditedAlt] = (0,external_wp_element_namespaceObject.useState)(alt); |
|
221 const hasChanged = editedWidth !== width || editedAlt !== alt; |
256 const popoverAnchor = (0,external_wp_richText_namespaceObject.useAnchor)({ |
222 const popoverAnchor = (0,external_wp_richText_namespaceObject.useAnchor)({ |
257 editableContentElement: contentRef.current, |
223 editableContentElement: contentRef.current, |
258 settings: image_image |
224 settings: image_image |
259 }); |
225 }); |
260 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Popover, { |
226 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Popover, { |
268 const newReplacements = value.replacements.slice(); |
234 const newReplacements = value.replacements.slice(); |
269 newReplacements[value.start] = { |
235 newReplacements[value.start] = { |
270 type: image_name, |
236 type: image_name, |
271 attributes: { |
237 attributes: { |
272 ...activeObjectAttributes, |
238 ...activeObjectAttributes, |
273 style: width ? `width: ${width}px;` : '' |
239 style: width ? `width: ${editedWidth}px;` : '', |
|
240 alt: editedAlt |
274 } |
241 } |
275 }; |
242 }; |
276 onChange({ |
243 onChange({ |
277 ...value, |
244 ...value, |
278 replacements: newReplacements |
245 replacements: newReplacements |
279 }); |
246 }); |
280 event.preventDefault(); |
247 event.preventDefault(); |
281 }, |
248 }, |
282 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { |
249 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { |
283 alignment: "bottom", |
250 spacing: 4, |
284 spacing: "0", |
|
285 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalNumberControl, { |
251 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalNumberControl, { |
286 className: "block-editor-format-toolbar__image-container-value", |
252 __next40pxDefaultSize: true, |
287 label: (0,external_wp_i18n_namespaceObject.__)('Width'), |
253 label: (0,external_wp_i18n_namespaceObject.__)('Width'), |
288 value: width, |
254 value: editedWidth, |
289 min: 1, |
255 min: 1, |
290 onChange: newWidth => setWidth(newWidth) |
256 onChange: newWidth => { |
291 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { |
257 setEditedWidth(newWidth); |
292 className: "block-editor-format-toolbar__image-container-button", |
258 } |
293 icon: keyboard_return, |
259 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextareaControl, { |
294 label: (0,external_wp_i18n_namespaceObject.__)('Apply'), |
260 label: (0,external_wp_i18n_namespaceObject.__)('Alternative text'), |
295 type: "submit" |
261 __nextHasNoMarginBottom: true, |
|
262 value: editedAlt, |
|
263 onChange: newAlt => { |
|
264 setEditedAlt(newAlt); |
|
265 }, |
|
266 help: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { |
|
267 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ExternalLink, { |
|
268 href: |
|
269 // translators: Localized tutorial, if one exists. W3C Web Accessibility Initiative link has list of existing translations. |
|
270 (0,external_wp_i18n_namespaceObject.__)('https://www.w3.org/WAI/tutorials/images/decision-tree/'), |
|
271 children: (0,external_wp_i18n_namespaceObject.__)('Describe the purpose of the image.') |
|
272 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("br", {}), (0,external_wp_i18n_namespaceObject.__)('Leave empty if decorative.')] |
|
273 }) |
|
274 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHStack, { |
|
275 justify: "right", |
|
276 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { |
|
277 disabled: !hasChanged, |
|
278 accessibleWhenDisabled: true, |
|
279 variant: "primary", |
|
280 type: "submit", |
|
281 size: "compact", |
|
282 children: (0,external_wp_i18n_namespaceObject.__)('Apply') |
|
283 }) |
296 })] |
284 })] |
297 }) |
285 }) |
298 }) |
286 }) |
299 }); |
287 }); |
300 } |
288 } |
438 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" |
424 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" |
439 }) |
425 }) |
440 }); |
426 }); |
441 /* harmony default export */ const library_link = (link_link); |
427 /* harmony default export */ const library_link = (link_link); |
442 |
428 |
443 ;// CONCATENATED MODULE: external ["wp","a11y"] |
429 ;// external ["wp","a11y"] |
444 const external_wp_a11y_namespaceObject = window["wp"]["a11y"]; |
430 const external_wp_a11y_namespaceObject = window["wp"]["a11y"]; |
445 ;// CONCATENATED MODULE: external ["wp","data"] |
431 ;// external ["wp","data"] |
446 const external_wp_data_namespaceObject = window["wp"]["data"]; |
432 const external_wp_data_namespaceObject = window["wp"]["data"]; |
447 ;// CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/link/utils.js |
433 ;// ./node_modules/@wordpress/format-library/build-module/link/utils.js |
448 /** |
434 /** |
449 * WordPress dependencies |
435 * WordPress dependencies |
450 */ |
436 */ |
451 |
437 |
452 |
438 |
647 } |
633 } |
648 const partialRight = (fn, ...partialArgs) => (...args) => fn(...args, ...partialArgs); |
634 const partialRight = (fn, ...partialArgs) => (...args) => fn(...args, ...partialArgs); |
649 const walkToStart = partialRight(walkToBoundary, 'backwards'); |
635 const walkToStart = partialRight(walkToBoundary, 'backwards'); |
650 const walkToEnd = partialRight(walkToBoundary, 'forwards'); |
636 const walkToEnd = partialRight(walkToBoundary, 'forwards'); |
651 |
637 |
652 ;// CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/link/inline.js |
638 ;// ./node_modules/@wordpress/format-library/build-module/link/inline.js |
653 /** |
639 /** |
654 * WordPress dependencies |
640 * WordPress dependencies |
655 */ |
641 */ |
656 |
642 |
657 |
643 |
787 // 1. The new text content. |
773 // 1. The new text content. |
788 // 2. The new link format. |
774 // 2. The new link format. |
789 // As "replace" will operate on the first match only, it is |
775 // As "replace" will operate on the first match only, it is |
790 // run only against the second half of the value which was |
776 // run only against the second half of the value which was |
791 // split at the active format's boundary. This avoids a bug |
777 // split at the active format's boundary. This avoids a bug |
792 // with incorrectly targetted replacements. |
778 // with incorrectly targeted replacements. |
793 // See: https://github.com/WordPress/gutenberg/issues/41771. |
779 // See: https://github.com/WordPress/gutenberg/issues/41771. |
794 // Note original formats will be lost when applying this change. |
780 // Note original formats will be lost when applying this change. |
795 // That is expected behaviour. |
781 // That is expected behaviour. |
796 // See: https://github.com/WordPress/gutenberg/pull/33849#issuecomment-936134179. |
782 // See: https://github.com/WordPress/gutenberg/pull/33849#issuecomment-936134179. |
797 const newValAfter = (0,external_wp_richText_namespaceObject.replace)(valAfter, richTextText, newValue); |
783 const newValAfter = (0,external_wp_richText_namespaceObject.replace)(valAfter, richTextText, newValue); |
833 url: page.link, |
819 url: page.link, |
834 kind: 'post-type' |
820 kind: 'post-type' |
835 }; |
821 }; |
836 } |
822 } |
837 function createButtonText(searchTerm) { |
823 function createButtonText(searchTerm) { |
838 return (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: search term. */ |
824 return (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: search term. */ |
839 (0,external_wp_i18n_namespaceObject.__)('Create page: <mark>%s</mark>'), searchTerm), { |
825 (0,external_wp_i18n_namespaceObject.__)('Create page: <mark>%s</mark>'), searchTerm), { |
840 mark: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("mark", {}) |
826 mark: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("mark", {}) |
841 }); |
827 }); |
842 } |
828 } |
843 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Popover, { |
829 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Popover, { |
848 placement: "bottom", |
834 placement: "bottom", |
849 offset: 8, |
835 offset: 8, |
850 shift: true, |
836 shift: true, |
851 focusOnMount: focusOnMount, |
837 focusOnMount: focusOnMount, |
852 constrainTabbing: true, |
838 constrainTabbing: true, |
853 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalLinkControl, { |
839 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.LinkControl, { |
854 value: linkValue, |
840 value: linkValue, |
855 onChange: onChangeLink, |
841 onChange: onChangeLink, |
856 onRemove: removeLink, |
842 onRemove: removeLink, |
857 hasRichPreviews: true, |
843 hasRichPreviews: true, |
858 createSuggestion: createPageEntity && handleCreate, |
844 createSuggestion: createPageEntity && handleCreate, |
1037 (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)('Link removed.'), 'assertive'); |
1028 (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)('Link removed.'), 'assertive'); |
1038 } |
1029 } |
1039 |
1030 |
1040 // Only autofocus if we have clicked a link within the editor |
1031 // Only autofocus if we have clicked a link within the editor |
1041 const shouldAutoFocus = !(openedBy?.el?.tagName === 'A' && openedBy?.action === 'click'); |
1032 const shouldAutoFocus = !(openedBy?.el?.tagName === 'A' && openedBy?.action === 'click'); |
|
1033 const hasSelection = !(0,external_wp_richText_namespaceObject.isCollapsed)(value); |
1042 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { |
1034 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { |
1043 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichTextShortcut, { |
1035 children: [hasSelection && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichTextShortcut, { |
1044 type: "primary", |
1036 type: "primary", |
1045 character: "k", |
1037 character: "k", |
1046 onUse: addLink |
1038 onUse: addLink |
1047 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichTextShortcut, { |
1039 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichTextShortcut, { |
1048 type: "primaryShift", |
1040 type: "primaryShift", |
1283 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" |
1271 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" |
1284 }) |
1272 }) |
1285 }); |
1273 }); |
1286 /* harmony default export */ const library_color = (color); |
1274 /* harmony default export */ const library_color = (color); |
1287 |
1275 |
1288 ;// CONCATENATED MODULE: external ["wp","privateApis"] |
1276 ;// external ["wp","privateApis"] |
1289 const external_wp_privateApis_namespaceObject = window["wp"]["privateApis"]; |
1277 const external_wp_privateApis_namespaceObject = window["wp"]["privateApis"]; |
1290 ;// CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/lock-unlock.js |
1278 ;// ./node_modules/@wordpress/format-library/build-module/lock-unlock.js |
1291 /** |
1279 /** |
1292 * WordPress dependencies |
1280 * WordPress dependencies |
1293 */ |
1281 */ |
1294 |
1282 |
1295 const { |
1283 const { |
1296 lock, |
1284 lock, |
1297 unlock |
1285 unlock |
1298 } = (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'); |
1286 } = (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'); |
1299 |
1287 |
1300 ;// CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/text-color/inline.js |
1288 ;// ./node_modules/@wordpress/format-library/build-module/text-color/inline.js |
1301 /** |
1289 /** |
1302 * WordPress dependencies |
1290 * WordPress dependencies |
1303 */ |
1291 */ |
1304 |
1292 |
1305 |
1293 |
1410 const { |
1397 const { |
1411 getSettings |
1398 getSettings |
1412 } = select(external_wp_blockEditor_namespaceObject.store); |
1399 } = select(external_wp_blockEditor_namespaceObject.store); |
1413 return (_getSettings$colors = getSettings().colors) !== null && _getSettings$colors !== void 0 ? _getSettings$colors : []; |
1400 return (_getSettings$colors = getSettings().colors) !== null && _getSettings$colors !== void 0 ? _getSettings$colors : []; |
1414 }, []); |
1401 }, []); |
1415 const onColorChange = (0,external_wp_element_namespaceObject.useCallback)(color => { |
|
1416 onChange(setColors(value, name, colors, { |
|
1417 [property]: color |
|
1418 })); |
|
1419 }, [colors, onChange, property]); |
|
1420 const activeColors = (0,external_wp_element_namespaceObject.useMemo)(() => getActiveColors(value, name, colors), [name, value, colors]); |
1402 const activeColors = (0,external_wp_element_namespaceObject.useMemo)(() => getActiveColors(value, name, colors), [name, value, colors]); |
1421 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.ColorPalette, { |
1403 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.ColorPalette, { |
1422 value: activeColors[property], |
1404 value: activeColors[property], |
1423 onChange: onColorChange |
1405 onChange: color => { |
|
1406 onChange(setColors(value, name, colors, { |
|
1407 [property]: color |
|
1408 })); |
|
1409 } |
|
1410 // Prevent the text and color picker from overlapping. |
|
1411 , |
|
1412 __experimentalIsRenderedInSidebar: true |
1424 }); |
1413 }); |
1425 } |
1414 } |
1426 function InlineColorUI({ |
1415 function InlineColorUI({ |
1427 name, |
1416 name, |
1428 value, |
1417 value, |
1516 activeAttributes, |
1503 activeAttributes, |
1517 contentRef |
1504 contentRef |
1518 }) { |
1505 }) { |
1519 const [allowCustomControl, colors = EMPTY_ARRAY] = (0,external_wp_blockEditor_namespaceObject.useSettings)('color.custom', 'color.palette'); |
1506 const [allowCustomControl, colors = EMPTY_ARRAY] = (0,external_wp_blockEditor_namespaceObject.useSettings)('color.custom', 'color.palette'); |
1520 const [isAddingColor, setIsAddingColor] = (0,external_wp_element_namespaceObject.useState)(false); |
1507 const [isAddingColor, setIsAddingColor] = (0,external_wp_element_namespaceObject.useState)(false); |
1521 const enableIsAddingColor = (0,external_wp_element_namespaceObject.useCallback)(() => setIsAddingColor(true), [setIsAddingColor]); |
1508 const colorIndicatorStyle = (0,external_wp_element_namespaceObject.useMemo)(() => fillComputedColors(contentRef.current, getActiveColors(value, text_color_name, colors)), [contentRef, value, colors]); |
1522 const disableIsAddingColor = (0,external_wp_element_namespaceObject.useCallback)(() => setIsAddingColor(false), [setIsAddingColor]); |
1509 const hasColorsToChoose = !!colors.length || allowCustomControl; |
1523 const colorIndicatorStyle = (0,external_wp_element_namespaceObject.useMemo)(() => fillComputedColors(contentRef.current, getActiveColors(value, text_color_name, colors)), [value, colors]); |
|
1524 const hasColorsToChoose = colors.length || !allowCustomControl; |
|
1525 if (!hasColorsToChoose && !isActive) { |
1510 if (!hasColorsToChoose && !isActive) { |
1526 return null; |
1511 return null; |
1527 } |
1512 } |
1528 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { |
1513 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { |
1529 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichTextToolbarButton, { |
1514 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichTextToolbarButton, { |
1534 style: colorIndicatorStyle |
1519 style: colorIndicatorStyle |
1535 }), |
1520 }), |
1536 title: text_color_title |
1521 title: text_color_title |
1537 // If has no colors to choose but a color is active remove the color onClick. |
1522 // If has no colors to choose but a color is active remove the color onClick. |
1538 , |
1523 , |
1539 onClick: hasColorsToChoose ? enableIsAddingColor : () => onChange((0,external_wp_richText_namespaceObject.removeFormat)(value, text_color_name)), |
1524 onClick: hasColorsToChoose ? () => setIsAddingColor(true) : () => onChange((0,external_wp_richText_namespaceObject.removeFormat)(value, text_color_name)), |
1540 role: "menuitemcheckbox" |
1525 role: "menuitemcheckbox" |
1541 }), isAddingColor && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(InlineColorUI, { |
1526 }), isAddingColor && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(InlineColorUI, { |
1542 name: text_color_name, |
1527 name: text_color_name, |
1543 onClose: disableIsAddingColor, |
1528 onClose: () => setIsAddingColor(false), |
1544 activeAttributes: activeAttributes, |
1529 activeAttributes: activeAttributes, |
1545 value: value, |
1530 value: value, |
1546 onChange: onChange, |
1531 onChange: onChange, |
1547 contentRef: contentRef, |
1532 contentRef: contentRef, |
1548 isActive: isActive |
1533 isActive: isActive |
1882 const [dir, setDir] = (0,external_wp_element_namespaceObject.useState)('ltr'); |
1865 const [dir, setDir] = (0,external_wp_element_namespaceObject.useState)('ltr'); |
1883 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Popover, { |
1866 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Popover, { |
1884 className: "block-editor-format-toolbar__language-popover", |
1867 className: "block-editor-format-toolbar__language-popover", |
1885 anchor: popoverAnchor, |
1868 anchor: popoverAnchor, |
1886 onClose: onClose, |
1869 onClose: onClose, |
1887 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("form", { |
1870 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { |
|
1871 as: "form", |
|
1872 spacing: 4, |
1888 className: "block-editor-format-toolbar__language-container-content", |
1873 className: "block-editor-format-toolbar__language-container-content", |
1889 onSubmit: event => { |
1874 onSubmit: event => { |
1890 event.preventDefault(); |
1875 event.preventDefault(); |
1891 onChange((0,external_wp_richText_namespaceObject.applyFormat)(value, { |
1876 onChange((0,external_wp_richText_namespaceObject.applyFormat)(value, { |
1892 type: language_name, |
1877 type: language_name, |
1896 } |
1881 } |
1897 })); |
1882 })); |
1898 onClose(); |
1883 onClose(); |
1899 }, |
1884 }, |
1900 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { |
1885 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { |
|
1886 __next40pxDefaultSize: true, |
|
1887 __nextHasNoMarginBottom: true, |
1901 label: language_title, |
1888 label: language_title, |
1902 value: lang, |
1889 value: lang, |
1903 onChange: val => setLang(val), |
1890 onChange: val => setLang(val), |
1904 help: (0,external_wp_i18n_namespaceObject.__)('A valid language attribute, like "en" or "fr".') |
1891 help: (0,external_wp_i18n_namespaceObject.__)('A valid language attribute, like "en" or "fr".') |
1905 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { |
1892 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { |
|
1893 __next40pxDefaultSize: true, |
|
1894 __nextHasNoMarginBottom: true, |
1906 label: (0,external_wp_i18n_namespaceObject.__)('Text direction'), |
1895 label: (0,external_wp_i18n_namespaceObject.__)('Text direction'), |
1907 value: dir, |
1896 value: dir, |
1908 options: [{ |
1897 options: [{ |
1909 label: (0,external_wp_i18n_namespaceObject.__)('Left to right'), |
1898 label: (0,external_wp_i18n_namespaceObject.__)('Left to right'), |
1910 value: 'ltr' |
1899 value: 'ltr' |
1914 }], |
1903 }], |
1915 onChange: val => setDir(val) |
1904 onChange: val => setDir(val) |
1916 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHStack, { |
1905 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHStack, { |
1917 alignment: "right", |
1906 alignment: "right", |
1918 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { |
1907 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { |
|
1908 __next40pxDefaultSize: true, |
1919 variant: "primary", |
1909 variant: "primary", |
1920 type: "submit", |
1910 type: "submit", |
1921 text: (0,external_wp_i18n_namespaceObject.__)('Apply') |
1911 text: (0,external_wp_i18n_namespaceObject.__)('Apply') |
1922 }) |
1912 }) |
1923 })] |
1913 })] |
1924 }) |
1914 }) |
1925 }); |
1915 }); |
1926 } |
1916 } |
1927 |
1917 |
1928 ;// CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/non-breaking-space/index.js |
1918 ;// ./node_modules/@wordpress/format-library/build-module/non-breaking-space/index.js |
1929 /** |
1919 /** |
1930 * WordPress dependencies |
1920 * WordPress dependencies |
1931 */ |
1921 */ |
1932 |
1922 |
1933 |
1923 |
1973 |
1963 |
1974 |
1964 |
1975 |
1965 |
1976 /* 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]); |
1966 /* 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]); |
1977 |
1967 |
1978 ;// CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/index.js |
1968 ;// ./node_modules/@wordpress/format-library/build-module/index.js |
1979 /** |
1969 /** |
1980 * WordPress dependencies |
1970 * WordPress dependencies |
1981 */ |
1971 */ |
1982 |
1972 |
1983 |
1973 |