diff -r 48c4eec2b7e6 -r 8c2e4d02f4ef wp/wp-includes/js/dist/block-library.js --- a/wp/wp-includes/js/dist/block-library.js Fri Sep 05 18:40:08 2025 +0200 +++ b/wp/wp-includes/js/dist/block-library.js Fri Sep 05 18:52:52 2025 +0200 @@ -660,7 +660,7 @@ /******/ /************************************************************************/ var __webpack_exports__ = {}; -// This entry need to be wrapped in an IIFE because it need to be in strict mode. +// This entry needs to be wrapped in an IIFE because it needs to be in strict mode. (() => { "use strict"; // ESM COMPAT FLAG @@ -1464,6 +1464,16 @@ settings: () => (query_title_settings) }); +// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/query-total/index.js +var query_total_namespaceObject = {}; +__webpack_require__.r(query_total_namespaceObject); +__webpack_require__.d(query_total_namespaceObject, { + init: () => (query_total_init), + metadata: () => (query_total_metadata), + name: () => (query_total_name), + settings: () => (query_total_settings) +}); + // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/quote/index.js var build_module_quote_namespaceObject = {}; __webpack_require__.r(build_module_quote_namespaceObject); @@ -1684,13 +1694,13 @@ settings: () => (footnotes_settings) }); -;// CONCATENATED MODULE: external ["wp","blocks"] +;// external ["wp","blocks"] const external_wp_blocks_namespaceObject = window["wp"]["blocks"]; -;// CONCATENATED MODULE: external ["wp","primitives"] +;// external ["wp","primitives"] const external_wp_primitives_namespaceObject = window["wp"]["primitives"]; -;// CONCATENATED MODULE: external "ReactJSXRuntime" +;// external "ReactJSXRuntime" const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"]; -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/archive.js +;// ./node_modules/@wordpress/icons/build-module/library/archive.js /** * WordPress dependencies */ @@ -1707,7 +1717,7 @@ }); /* harmony default export */ const library_archive = (archive); -;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/utils/init-block.js +;// ./node_modules/@wordpress/block-library/build-module/utils/init-block.js /** * WordPress dependencies */ @@ -1736,24 +1746,134 @@ }, settings); } -;// CONCATENATED MODULE: external ["wp","components"] +;// external ["wp","components"] const external_wp_components_namespaceObject = window["wp"]["components"]; -;// CONCATENATED MODULE: external ["wp","i18n"] +;// external ["wp","i18n"] const external_wp_i18n_namespaceObject = window["wp"]["i18n"]; -;// CONCATENATED MODULE: external ["wp","blockEditor"] +;// external ["wp","blockEditor"] const external_wp_blockEditor_namespaceObject = window["wp"]["blockEditor"]; -;// CONCATENATED MODULE: external ["wp","serverSideRender"] +;// external ["wp","serverSideRender"] const external_wp_serverSideRender_namespaceObject = window["wp"]["serverSideRender"]; var external_wp_serverSideRender_default = /*#__PURE__*/__webpack_require__.n(external_wp_serverSideRender_namespaceObject); -;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/archives/edit.js -/** - * WordPress dependencies - */ - - - - - +;// external ["wp","data"] +const external_wp_data_namespaceObject = window["wp"]["data"]; +;// external ["wp","element"] +const external_wp_element_namespaceObject = window["wp"]["element"]; +;// external ["wp","blob"] +const external_wp_blob_namespaceObject = window["wp"]["blob"]; +;// external ["wp","coreData"] +const external_wp_coreData_namespaceObject = window["wp"]["coreData"]; +;// external ["wp","compose"] +const external_wp_compose_namespaceObject = window["wp"]["compose"]; +;// ./node_modules/@wordpress/block-library/build-module/utils/hooks.js +/** + * WordPress dependencies + */ + + + + + + + +/** + * Returns whether the current user can edit the given entity. + * + * @param {string} kind Entity kind. + * @param {string} name Entity name. + * @param {string} recordId Record's id. + */ +function useCanEditEntity(kind, name, recordId) { + return (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).canUser('update', { + kind, + name, + id: recordId + }), [kind, name, recordId]); +} + +/** + * Handles uploading a media file from a blob URL on mount. + * + * @param {Object} args Upload media arguments. + * @param {string} args.url Blob URL. + * @param {?Array} args.allowedTypes Array of allowed media types. + * @param {Function} args.onChange Function called when the media is uploaded. + * @param {Function} args.onError Function called when an error happens. + */ +function useUploadMediaFromBlobURL(args = {}) { + const latestArgsRef = (0,external_wp_element_namespaceObject.useRef)(args); + const hasUploadStartedRef = (0,external_wp_element_namespaceObject.useRef)(false); + const { + getSettings + } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store); + (0,external_wp_element_namespaceObject.useLayoutEffect)(() => { + latestArgsRef.current = args; + }); + (0,external_wp_element_namespaceObject.useEffect)(() => { + // Uploading is a special effect that can't be canceled via the cleanup method. + // The extra check avoids duplicate uploads in development mode (React.StrictMode). + if (hasUploadStartedRef.current) { + return; + } + if (!latestArgsRef.current.url || !(0,external_wp_blob_namespaceObject.isBlobURL)(latestArgsRef.current.url)) { + return; + } + const file = (0,external_wp_blob_namespaceObject.getBlobByURL)(latestArgsRef.current.url); + if (!file) { + return; + } + const { + url, + allowedTypes, + onChange, + onError + } = latestArgsRef.current; + const { + mediaUpload + } = getSettings(); + hasUploadStartedRef.current = true; + mediaUpload({ + filesList: [file], + allowedTypes, + onFileChange: ([media]) => { + if ((0,external_wp_blob_namespaceObject.isBlobURL)(media?.url)) { + return; + } + (0,external_wp_blob_namespaceObject.revokeBlobURL)(url); + onChange(media); + hasUploadStartedRef.current = false; + }, + onError: message => { + (0,external_wp_blob_namespaceObject.revokeBlobURL)(url); + onError(message); + hasUploadStartedRef.current = false; + } + }); + }, [getSettings]); +} +function useToolsPanelDropdownMenuProps() { + const isMobile = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium', '<'); + return !isMobile ? { + popoverProps: { + placement: 'left-start', + // For non-mobile, inner sidebar width (248px) - button width (24px) - border (1px) + padding (16px) + spacing (20px) + offset: 259 + } + } : {}; +} + +;// ./node_modules/@wordpress/block-library/build-module/archives/edit.js +/** + * WordPress dependencies + */ + + + + + +/** + * Internal dependencies + */ function ArchivesEdit({ @@ -1766,50 +1886,93 @@ displayAsDropdown, type } = attributes; + const dropdownMenuProps = useToolsPanelDropdownMenuProps(); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, { - title: (0,external_wp_i18n_namespaceObject.__)('Settings'), - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { - __nextHasNoMarginBottom: true, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanel, { + label: (0,external_wp_i18n_namespaceObject.__)('Settings'), + resetAll: () => { + setAttributes({ + displayAsDropdown: false, + showLabel: false, + showPostCounts: false, + type: 'monthly' + }); + }, + dropdownMenuProps: dropdownMenuProps, + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { label: (0,external_wp_i18n_namespaceObject.__)('Display as dropdown'), - checked: displayAsDropdown, - onChange: () => setAttributes({ - displayAsDropdown: !displayAsDropdown - }) - }), displayAsDropdown && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { - __nextHasNoMarginBottom: true, + isShownByDefault: true, + hasValue: () => displayAsDropdown, + onDeselect: () => setAttributes({ + displayAsDropdown: false + }), + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { + __nextHasNoMarginBottom: true, + label: (0,external_wp_i18n_namespaceObject.__)('Display as dropdown'), + checked: displayAsDropdown, + onChange: () => setAttributes({ + displayAsDropdown: !displayAsDropdown + }) + }) + }), displayAsDropdown && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { label: (0,external_wp_i18n_namespaceObject.__)('Show label'), - checked: showLabel, - onChange: () => setAttributes({ - showLabel: !showLabel - }) - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { - __nextHasNoMarginBottom: true, + isShownByDefault: true, + hasValue: () => !showLabel, + onDeselect: () => setAttributes({ + showLabel: false + }), + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { + __nextHasNoMarginBottom: true, + label: (0,external_wp_i18n_namespaceObject.__)('Show label'), + checked: showLabel, + onChange: () => setAttributes({ + showLabel: !showLabel + }) + }) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { label: (0,external_wp_i18n_namespaceObject.__)('Show post counts'), - checked: showPostCounts, - onChange: () => setAttributes({ - showPostCounts: !showPostCounts - }) - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { - __nextHasNoMarginBottom: true, - label: (0,external_wp_i18n_namespaceObject.__)('Group by:'), - options: [{ - label: (0,external_wp_i18n_namespaceObject.__)('Year'), - value: 'yearly' - }, { - label: (0,external_wp_i18n_namespaceObject.__)('Month'), - value: 'monthly' - }, { - label: (0,external_wp_i18n_namespaceObject.__)('Week'), - value: 'weekly' - }, { - label: (0,external_wp_i18n_namespaceObject.__)('Day'), - value: 'daily' - }], - value: type, - onChange: value => setAttributes({ - type: value + isShownByDefault: true, + hasValue: () => showPostCounts, + onDeselect: () => setAttributes({ + showPostCounts: false + }), + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { + __nextHasNoMarginBottom: true, + label: (0,external_wp_i18n_namespaceObject.__)('Show post counts'), + checked: showPostCounts, + onChange: () => setAttributes({ + showPostCounts: !showPostCounts + }) + }) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { + label: (0,external_wp_i18n_namespaceObject.__)('Group by'), + isShownByDefault: true, + hasValue: () => type !== 'monthly', + onDeselect: () => setAttributes({ + type: 'monthly' + }), + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { + __next40pxDefaultSize: true, + __nextHasNoMarginBottom: true, + label: (0,external_wp_i18n_namespaceObject.__)('Group by'), + options: [{ + label: (0,external_wp_i18n_namespaceObject.__)('Year'), + value: 'yearly' + }, { + label: (0,external_wp_i18n_namespaceObject.__)('Month'), + value: 'monthly' + }, { + label: (0,external_wp_i18n_namespaceObject.__)('Week'), + value: 'weekly' + }, { + label: (0,external_wp_i18n_namespaceObject.__)('Day'), + value: 'daily' + }], + value: type, + onChange: value => setAttributes({ + type: value + }) }) })] }) @@ -1826,7 +1989,7 @@ }); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/archives/index.js +;// ./node_modules/@wordpress/block-library/build-module/archives/index.js /** * WordPress dependencies */ @@ -1864,6 +2027,12 @@ }, supports: { align: true, + __experimentalBorder: { + radius: true, + color: true, + width: true, + style: true + }, html: false, spacing: { margin: true, @@ -1886,6 +2055,15 @@ fontSize: true } }, + color: { + gradients: true, + link: true, + __experimentalDefaultControls: { + background: true, + text: true, + link: true + } + }, interactivity: { clientNavigation: true } @@ -1908,7 +2086,7 @@ settings }); -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/comment-author-avatar.js +;// ./node_modules/@wordpress/icons/build-module/library/comment-author-avatar.js /** * WordPress dependencies */ @@ -1925,15 +2103,11 @@ }); /* harmony default export */ const comment_author_avatar = (commentAuthorAvatar); -;// CONCATENATED MODULE: ./node_modules/clsx/dist/clsx.mjs +;// ./node_modules/clsx/dist/clsx.mjs function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t setAttributes({ linkTarget: value ? '_blank' : '_self' @@ -2274,7 +2445,7 @@ }); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/avatar/index.js +;// ./node_modules/@wordpress/block-library/build-module/avatar/index.js /** * WordPress dependencies */ @@ -2354,7 +2525,8 @@ const avatar_settings = { icon: comment_author_avatar, - edit: Edit + edit: Edit, + example: {} }; const avatar_init = () => initBlock({ name: avatar_name, @@ -2362,7 +2534,7 @@ settings: avatar_settings }); -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/audio.js +;// ./node_modules/@wordpress/icons/build-module/library/audio.js /** * WordPress dependencies */ @@ -2377,11 +2549,10 @@ }); /* harmony default export */ const library_audio = (audio); -;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/audio/deprecated.js -/** - * WordPress dependencies - */ - +;// ./node_modules/@wordpress/block-library/build-module/audio/deprecated.js +/** + * WordPress dependencies + */ /* harmony default export */ const deprecated = ([{ @@ -2447,11 +2618,9 @@ } }]); -;// CONCATENATED MODULE: external ["wp","blob"] -const external_wp_blob_namespaceObject = window["wp"]["blob"]; -;// CONCATENATED MODULE: external ["wp","notices"] +;// external ["wp","notices"] const external_wp_notices_namespaceObject = window["wp"]["notices"]; -;// CONCATENATED MODULE: ./node_modules/memize/dist/index.js +;// ./node_modules/memize/dist/index.js /** * Memize options object. * @@ -2613,7 +2782,7 @@ -;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/constants.js +;// ./node_modules/@wordpress/block-library/build-module/embed/constants.js const ASPECT_RATIOS = [ // Common video resolutions. { @@ -2642,9 +2811,9 @@ }]; const WP_EMBED_TYPE = 'wp-embed'; -;// CONCATENATED MODULE: external ["wp","privateApis"] +;// external ["wp","privateApis"] const external_wp_privateApis_namespaceObject = window["wp"]["privateApis"]; -;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/lock-unlock.js +;// ./node_modules/@wordpress/block-library/build-module/lock-unlock.js /** * WordPress dependencies */ @@ -2654,7 +2823,7 @@ unlock } = (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/block-library'); -;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/util.js +;// ./node_modules/@wordpress/block-library/build-module/embed/util.js /** * External dependencies */ @@ -2682,21 +2851,21 @@ attributes: { url: { type: "string", - __experimentalRole: "content" + role: "content" }, caption: { type: "rich-text", source: "rich-text", selector: "figcaption", - __experimentalRole: "content" + role: "content" }, type: { type: "string", - __experimentalRole: "content" + role: "content" }, providerNameSlug: { type: "string", - __experimentalRole: "content" + role: "content" }, allowResponsive: { type: "boolean", @@ -2705,12 +2874,12 @@ responsive: { type: "boolean", "default": false, - __experimentalRole: "content" + role: "content" }, previewable: { type: "boolean", "default": true, - __experimentalRole: "content" + role: "content" } }, supports: { @@ -2751,7 +2920,7 @@ * Returns true if any of the regular expressions match the URL. * * @param {string} url The URL to test. - * @param {Array} patterns The list of regular expressions to test agains. + * @param {Array} patterns The list of regular expressions to test against. * @return {boolean} True if any of the regular expressions match the URL. */ const matchesPatterns = (url, patterns = []) => patterns.some(pattern => url.match(pattern)); @@ -3011,102 +3180,7 @@ }; }; -;// CONCATENATED MODULE: external ["wp","compose"] -const external_wp_compose_namespaceObject = window["wp"]["compose"]; -;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/utils/hooks.js -/** - * WordPress dependencies - */ - - - - - - - -/** - * Returns whether the current user can edit the given entity. - * - * @param {string} kind Entity kind. - * @param {string} name Entity name. - * @param {string} recordId Record's id. - */ -function useCanEditEntity(kind, name, recordId) { - return (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).canUserEditEntityRecord(kind, name, recordId), [kind, name, recordId]); -} - -/** - * Handles uploading a media file from a blob URL on mount. - * - * @param {Object} args Upload media arguments. - * @param {string} args.url Blob URL. - * @param {?Array} args.allowedTypes Array of allowed media types. - * @param {Function} args.onChange Function called when the media is uploaded. - * @param {Function} args.onError Function called when an error happens. - */ -function useUploadMediaFromBlobURL(args = {}) { - const latestArgs = (0,external_wp_element_namespaceObject.useRef)(args); - const hasUploadStarted = (0,external_wp_element_namespaceObject.useRef)(false); - const { - getSettings - } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store); - (0,external_wp_element_namespaceObject.useLayoutEffect)(() => { - latestArgs.current = args; - }); - (0,external_wp_element_namespaceObject.useEffect)(() => { - // Uploading is a special effect that can't be canceled via the cleanup method. - // The extra check avoids duplicate uploads in development mode (React.StrictMode). - if (hasUploadStarted.current) { - return; - } - if (!latestArgs.current.url || !(0,external_wp_blob_namespaceObject.isBlobURL)(latestArgs.current.url)) { - return; - } - const file = (0,external_wp_blob_namespaceObject.getBlobByURL)(latestArgs.current.url); - if (!file) { - return; - } - const { - url, - allowedTypes, - onChange, - onError - } = latestArgs.current; - const { - mediaUpload - } = getSettings(); - hasUploadStarted.current = true; - mediaUpload({ - filesList: [file], - allowedTypes, - onFileChange: ([media]) => { - if ((0,external_wp_blob_namespaceObject.isBlobURL)(media?.url)) { - return; - } - (0,external_wp_blob_namespaceObject.revokeBlobURL)(url); - onChange(media); - hasUploadStarted.current = false; - }, - onError: message => { - (0,external_wp_blob_namespaceObject.revokeBlobURL)(url); - onError(message); - hasUploadStarted.current = false; - } - }); - }, [getSettings]); -} -function useToolsPanelDropdownMenuProps() { - const isMobile = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium', '<'); - return !isMobile ? { - popoverProps: { - placement: 'left-start', - // For non-mobile, inner sidebar width (248px) - button width (24px) - border (1px) + padding (16px) + spacing (20px) - offset: 259 - } - } : {}; -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/caption.js +;// ./node_modules/@wordpress/icons/build-module/library/caption.js /** * WordPress dependencies */ @@ -3123,28 +3197,26 @@ }); /* harmony default export */ const library_caption = (caption); -;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/utils/caption.js -/** - * External dependencies - */ - - -/** - * WordPress dependencies - */ - - - - - - - - -/** - * Internal dependencies - */ - - +;// ./node_modules/@wordpress/block-library/build-module/utils/caption.js +/** + * External dependencies + */ + + +/** + * WordPress dependencies + */ + + + + + + + + +/** + * Internal dependencies + */ function Caption({ @@ -3228,28 +3300,27 @@ }); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/audio/edit.js -/** - * External dependencies - */ - - -/** - * WordPress dependencies - */ - - - - - - - - -/** - * Internal dependencies - */ - - +;// ./node_modules/@wordpress/block-library/build-module/audio/edit.js +/** + * External dependencies + */ + + +/** + * WordPress dependencies + */ + + + + + + + + + +/** + * Internal dependencies + */ @@ -3270,9 +3341,9 @@ preload, src } = attributes; - const isTemporaryAudio = !id && (0,external_wp_blob_namespaceObject.isBlobURL)(src); + const [temporaryURL, setTemporaryURL] = (0,external_wp_element_namespaceObject.useState)(attributes.blob); useUploadMediaFromBlobURL({ - url: src, + url: temporaryURL, allowedTypes: ALLOWED_MEDIA_TYPES, onChange: onSelectAudio, onError: onUploadError @@ -3300,8 +3371,10 @@ } setAttributes({ src: newSrc, - id: undefined - }); + id: undefined, + blob: undefined + }); + setTemporaryURL(); } } const { @@ -3322,25 +3395,34 @@ setAttributes({ src: undefined, id: undefined, - caption: undefined - }); - return; - } + caption: undefined, + blob: undefined + }); + setTemporaryURL(); + return; + } + if ((0,external_wp_blob_namespaceObject.isBlobURL)(media.url)) { + setTemporaryURL(media.url); + return; + } + // Sets the block's attribute and updates the edit component from the // selected media, then switches off the editing UI. setAttributes({ + blob: undefined, src: media.url, id: media.id, caption: media.caption }); + setTemporaryURL(); } const classes = dist_clsx(className, { - 'is-transient': isTemporaryAudio + 'is-transient': !!temporaryURL }); const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ className: classes }); - if (!src) { + if (!src && !temporaryURL) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...blockProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, { @@ -3366,7 +3448,8 @@ accept: "audio/*", onSelect: onSelectAudio, onSelectURL: onSelectURL, - onError: onUploadError + onError: onUploadError, + onReset: () => onSelectAudio(undefined) }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, { @@ -3383,6 +3466,7 @@ onChange: toggleAttribute('loop'), checked: loop }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { + __next40pxDefaultSize: true, __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject._x)('Preload', 'noun; Audio block parameter'), value: preload || '' @@ -3412,9 +3496,9 @@ isDisabled: !isSingleSelected, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("audio", { controls: "controls", - src: src - }) - }), isTemporaryAudio && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Caption, { + src: src !== null && src !== void 0 ? src : temporaryURL + }) + }), !!temporaryURL && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Caption, { attributes: attributes, setAttributes: setAttributes, isSelected: isSingleSelected, @@ -3427,11 +3511,10 @@ } /* harmony default export */ const edit = (AudioEdit); -;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/audio/save.js -/** - * WordPress dependencies - */ - +;// ./node_modules/@wordpress/block-library/build-module/audio/save.js +/** + * WordPress dependencies + */ function save({ @@ -3460,7 +3543,7 @@ }); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/audio/transforms.js +;// ./node_modules/@wordpress/block-library/build-module/audio/transforms.js /** * WordPress dependencies */ @@ -3478,7 +3561,7 @@ // It's already done as part of the `componentDidMount` // in the audio block. const block = (0,external_wp_blocks_namespaceObject.createBlock)('core/audio', { - src: (0,external_wp_blob_namespaceObject.createBlobURL)(file) + blob: (0,external_wp_blob_namespaceObject.createBlobURL)(file) }); return block; } @@ -3536,7 +3619,7 @@ }; /* harmony default export */ const audio_transforms = (transforms); -;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/audio/index.js +;// ./node_modules/@wordpress/block-library/build-module/audio/index.js /** * WordPress dependencies */ @@ -3558,22 +3641,26 @@ keywords: ["music", "sound", "podcast", "recording"], textdomain: "default", attributes: { + blob: { + type: "string", + role: "local" + }, src: { type: "string", source: "attribute", selector: "audio", attribute: "src", - __experimentalRole: "content" + role: "content" }, caption: { type: "rich-text", source: "rich-text", selector: "figcaption", - __experimentalRole: "content" + role: "content" }, id: { type: "number", - __experimentalRole: "content" + role: "content" }, autoplay: { type: "boolean", @@ -3637,7 +3724,7 @@ settings: audio_settings }); -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/button.js +;// ./node_modules/@wordpress/icons/build-module/library/button.js /** * WordPress dependencies */ @@ -3652,7 +3739,7 @@ }); /* harmony default export */ const library_button = (button_button); -;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/utils/migrate-font-family.js +;// ./node_modules/@wordpress/block-library/build-module/utils/migrate-font-family.js /** * WordPress dependencies */ @@ -3692,7 +3779,7 @@ }; } -;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/button/deprecated.js +;// ./node_modules/@wordpress/block-library/build-module/button/deprecated.js /** * External dependencies */ @@ -3804,6 +3891,187 @@ selector: 'a' } }; +const v12 = { + attributes: { + tagName: { + type: 'string', + enum: ['a', 'button'], + default: 'a' + }, + type: { + type: 'string', + default: 'button' + }, + textAlign: { + type: 'string' + }, + url: { + type: 'string', + source: 'attribute', + selector: 'a', + attribute: 'href' + }, + title: { + type: 'string', + source: 'attribute', + selector: 'a,button', + attribute: 'title', + role: 'content' + }, + text: { + type: 'rich-text', + source: 'rich-text', + selector: 'a,button', + role: 'content' + }, + linkTarget: { + type: 'string', + source: 'attribute', + selector: 'a', + attribute: 'target', + role: 'content' + }, + rel: { + type: 'string', + source: 'attribute', + selector: 'a', + attribute: 'rel', + role: 'content' + }, + placeholder: { + type: 'string' + }, + backgroundColor: { + type: 'string' + }, + textColor: { + type: 'string' + }, + gradient: { + type: 'string' + }, + width: { + type: 'number' + } + }, + supports: { + anchor: true, + align: true, + alignWide: false, + color: { + __experimentalSkipSerialization: true, + gradients: true, + __experimentalDefaultControls: { + background: true, + text: true + } + }, + typography: { + fontSize: true, + lineHeight: true, + __experimentalFontFamily: true, + __experimentalFontWeight: true, + __experimentalFontStyle: true, + __experimentalTextTransform: true, + __experimentalTextDecoration: true, + __experimentalLetterSpacing: true, + __experimentalWritingMode: true, + __experimentalDefaultControls: { + fontSize: true + } + }, + reusable: false, + shadow: { + __experimentalSkipSerialization: true + }, + spacing: { + __experimentalSkipSerialization: true, + padding: ['horizontal', 'vertical'], + __experimentalDefaultControls: { + padding: true + } + }, + __experimentalBorder: { + color: true, + radius: true, + style: true, + width: true, + __experimentalSkipSerialization: true, + __experimentalDefaultControls: { + color: true, + radius: true, + style: true, + width: true + } + }, + __experimentalSelector: '.wp-block-button__link', + interactivity: { + clientNavigation: true + } + }, + save({ + attributes, + className + }) { + const { + tagName, + type, + textAlign, + fontSize, + linkTarget, + rel, + style, + text, + title, + url, + width + } = attributes; + const TagName = tagName || 'a'; + const isButtonTag = 'button' === TagName; + const buttonType = type || 'button'; + const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetBorderClassesAndStyles)(attributes); + const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes); + const spacingProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetSpacingClassesAndStyles)(attributes); + const shadowProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetShadowClassesAndStyles)(attributes); + const buttonClasses = dist_clsx('wp-block-button__link', colorProps.className, borderProps.className, { + [`has-text-align-${textAlign}`]: textAlign, + // For backwards compatibility add style that isn't provided via + // block support. + 'no-border-radius': style?.border?.radius === 0 + }, (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('button')); + const buttonStyle = { + ...borderProps.style, + ...colorProps.style, + ...spacingProps.style, + ...shadowProps.style + }; + + // The use of a `title` attribute here is soft-deprecated, but still applied + // if it had already been assigned, for the sake of backward-compatibility. + // A title will no longer be assigned for new or updated button block links. + + const wrapperClasses = dist_clsx(className, { + [`has-custom-width wp-block-button__width-${width}`]: width, + [`has-custom-font-size`]: fontSize || style?.typography?.fontSize + }); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ + className: wrapperClasses + }), + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { + tagName: TagName, + type: isButtonTag ? buttonType : null, + className: buttonClasses, + href: isButtonTag ? null : url, + title: title, + style: buttonStyle, + value: text, + target: isButtonTag ? null : linkTarget, + rel: isButtonTag ? null : rel + }) + }); + } +}; const v11 = { attributes: { url: { @@ -4078,7 +4346,7 @@ return style?.typography?.fontFamily; } }; -const deprecated_deprecated = [v11, v10, { +const deprecated_deprecated = [v12, v11, v10, { supports: { anchor: true, align: true, @@ -4767,12 +5035,12 @@ }]; /* harmony default export */ const button_deprecated = (deprecated_deprecated); -;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/button/constants.js +;// ./node_modules/@wordpress/block-library/build-module/button/constants.js const NEW_TAB_REL = 'noreferrer noopener'; const NEW_TAB_TARGET = '_blank'; const NOFOLLOW_REL = 'nofollow'; -;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/button/get-updated-link-attributes.js +;// ./node_modules/@wordpress/block-library/build-module/button/get-updated-link-attributes.js /** * Internal dependencies */ @@ -4809,7 +5077,7 @@ updatedRel = updatedRel?.replace(relRegex, '').trim(); } if (nofollow) { - updatedRel = updatedRel?.includes(NOFOLLOW_REL) ? updatedRel : updatedRel + ` ${NOFOLLOW_REL}`; + updatedRel = updatedRel?.includes(NOFOLLOW_REL) ? updatedRel : (updatedRel + ` ${NOFOLLOW_REL}`).trim(); } else { const relRegex = new RegExp(`\\b${NOFOLLOW_REL}\\s*`, 'g'); updatedRel = updatedRel?.replace(relRegex, '').trim(); @@ -4821,7 +5089,7 @@ }; } -;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/utils/remove-anchor-tag.js +;// ./node_modules/@wordpress/block-library/build-module/utils/remove-anchor-tag.js /** * Removes anchor tags from a string. * @@ -4834,9 +5102,9 @@ return value.toString().replace(/<\/?a[^>]*>/g, ''); } -;// CONCATENATED MODULE: external ["wp","keycodes"] +;// external ["wp","keycodes"] const external_wp_keycodes_namespaceObject = window["wp"]["keycodes"]; -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/link.js +;// ./node_modules/@wordpress/icons/build-module/library/link.js /** * WordPress dependencies */ @@ -4851,7 +5119,7 @@ }); /* harmony default export */ const library_link = (link_link); -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/link-off.js +;// ./node_modules/@wordpress/icons/build-module/library/link-off.js /** * WordPress dependencies */ @@ -4866,36 +5134,34 @@ }); /* harmony default export */ const link_off = (linkOff); -;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/button/edit.js -/** - * External dependencies - */ - - -/** - * Internal dependencies - */ - - - - - -/** - * WordPress dependencies - */ - - - - - - - - - - - - -const LINK_SETTINGS = [...external_wp_blockEditor_namespaceObject.__experimentalLinkControl.DEFAULT_LINK_SETTINGS, { +;// ./node_modules/@wordpress/block-library/build-module/button/edit.js +/** + * External dependencies + */ + + +/** + * Internal dependencies + */ + + + + + +/** + * WordPress dependencies + */ + + + + + + + + + + +const LINK_SETTINGS = [...external_wp_blockEditor_namespaceObject.LinkControl.DEFAULT_LINK_SETTINGS, { id: 'nofollow', title: (0,external_wp_i18n_namespaceObject.__)('Mark as nofollow') }]; @@ -4951,26 +5217,37 @@ selectedWidth, setAttributes }) { - function handleChange(newWidth) { - // Check if we are toggling the width off - const width = selectedWidth === newWidth ? undefined : newWidth; - - // Update attributes. - setAttributes({ - width - }); - } - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.PanelBody, { - title: (0,external_wp_i18n_namespaceObject.__)('Settings'), - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ButtonGroup, { - "aria-label": (0,external_wp_i18n_namespaceObject.__)('Button width'), - children: [25, 50, 75, 100].map(widthValue => { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Button, { - size: "small", - variant: widthValue === selectedWidth ? 'primary' : undefined, - onClick: () => handleChange(widthValue), - children: [widthValue, "%"] - }, widthValue); + const dropdownMenuProps = useToolsPanelDropdownMenuProps(); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanel, { + label: (0,external_wp_i18n_namespaceObject.__)('Settings'), + resetAll: () => setAttributes({ + width: undefined + }), + dropdownMenuProps: dropdownMenuProps, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { + label: (0,external_wp_i18n_namespaceObject.__)('Width'), + isShownByDefault: true, + hasValue: () => !!selectedWidth, + onDeselect: () => setAttributes({ + width: undefined + }), + __nextHasNoMarginBottom: true, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, { + label: (0,external_wp_i18n_namespaceObject.__)('Width'), + value: selectedWidth, + onChange: newWidth => setAttributes({ + width: newWidth + }), + isBlock: true, + __next40pxDefaultSize: true, + __nextHasNoMarginBottom: true, + children: [25, 50, 75, 100].map(widthValue => { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { + value: widthValue, + label: (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: Percentage value. */ + (0,external_wp_i18n_namespaceObject.__)('%d%%'), widthValue) + }, widthValue); + }) }) }) }); @@ -5063,21 +5340,29 @@ if (!isSelected) { return {}; } - const blockBindingsSource = unlock(select(external_wp_blocks_namespaceObject.store)).getBlockBindingsSource(metadata?.bindings?.url?.source); - return { - lockUrlControls: !!metadata?.bindings?.url && !blockBindingsSource?.canUserEditValue({ + const blockBindingsSource = (0,external_wp_blocks_namespaceObject.getBlockBindingsSource)(metadata?.bindings?.url?.source); + return { + lockUrlControls: !!metadata?.bindings?.url && !blockBindingsSource?.canUserEditValue?.({ select, context, args: metadata?.bindings?.url?.args }) }; - }, [isSelected, metadata?.bindings?.url]); + }, [context, isSelected, metadata?.bindings?.url]); + const [fluidTypographySettings, layout] = (0,external_wp_blockEditor_namespaceObject.useSettings)('typography.fluid', 'layout'); + const typographyProps = (0,external_wp_blockEditor_namespaceObject.getTypographyClassesAndStyles)(attributes, { + typography: { + fluid: fluidTypographySettings + }, + layout: { + wideSize: layout?.wideSize + } + }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...blockProps, className: dist_clsx(blockProps.className, { - [`has-custom-width wp-block-button__width-${width}`]: width, - [`has-custom-font-size`]: blockProps.style.fontSize + [`has-custom-width wp-block-button__width-${width}`]: width }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, { ref: mergedRef, @@ -5088,17 +5373,20 @@ text: removeAnchorTag(value) }), withoutInteractiveFormatting: true, - className: dist_clsx(className, 'wp-block-button__link', colorProps.className, borderProps.className, { + className: dist_clsx(className, 'wp-block-button__link', colorProps.className, borderProps.className, typographyProps.className, { [`has-text-align-${textAlign}`]: textAlign, // For backwards compatibility add style that isn't // provided via block support. - 'no-border-radius': style?.border?.radius === 0 + 'no-border-radius': style?.border?.radius === 0, + [`has-custom-font-size`]: blockProps.style.fontSize }, (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('button')), style: { ...borderProps.style, ...colorProps.style, ...spacingProps.style, - ...shadowProps.style + ...shadowProps.style, + ...typographyProps.style, + writingMode: undefined }, onReplace: onReplace, onMerge: mergeBlocks, @@ -5137,7 +5425,7 @@ focusOnMount: isEditingURL ? 'firstElement' : false, __unstableSlotName: "__unstable-block-tools-after", shift: true, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalLinkControl, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.LinkControl, { value: linkValue, onChange: ({ url: newURL, @@ -5164,6 +5452,7 @@ }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { group: "advanced", children: isLinkTag && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { + __next40pxDefaultSize: true, __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Link rel'), value: rel || '', @@ -5176,7 +5465,7 @@ } /* harmony default export */ const button_edit = (ButtonEdit); -;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/button/save.js +;// ./node_modules/@wordpress/block-library/build-module/button/save.js /** * External dependencies */ @@ -5211,17 +5500,21 @@ const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes); const spacingProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetSpacingClassesAndStyles)(attributes); const shadowProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetShadowClassesAndStyles)(attributes); - const buttonClasses = dist_clsx('wp-block-button__link', colorProps.className, borderProps.className, { + const typographyProps = (0,external_wp_blockEditor_namespaceObject.getTypographyClassesAndStyles)(attributes); + const buttonClasses = dist_clsx('wp-block-button__link', colorProps.className, borderProps.className, typographyProps.className, { [`has-text-align-${textAlign}`]: textAlign, // For backwards compatibility add style that isn't provided via // block support. - 'no-border-radius': style?.border?.radius === 0 + 'no-border-radius': style?.border?.radius === 0, + [`has-custom-font-size`]: fontSize || style?.typography?.fontSize }, (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('button')); const buttonStyle = { ...borderProps.style, ...colorProps.style, ...spacingProps.style, - ...shadowProps.style + ...shadowProps.style, + ...typographyProps.style, + writingMode: undefined }; // The use of a `title` attribute here is soft-deprecated, but still applied @@ -5229,8 +5522,7 @@ // A title will no longer be assigned for new or updated button block links. const wrapperClasses = dist_clsx(className, { - [`has-custom-width wp-block-button__width-${width}`]: width, - [`has-custom-font-size`]: fontSize || style?.typography?.fontSize + [`has-custom-width wp-block-button__width-${width}`]: width }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ @@ -5250,7 +5542,7 @@ }); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/button/index.js +;// ./node_modules/@wordpress/block-library/build-module/button/index.js /** * WordPress dependencies */ @@ -5291,34 +5583,34 @@ source: "attribute", selector: "a", attribute: "href", - __experimentalRole: "content" + role: "content" }, title: { type: "string", source: "attribute", selector: "a,button", attribute: "title", - __experimentalRole: "content" + role: "content" }, text: { type: "rich-text", source: "rich-text", selector: "a,button", - __experimentalRole: "content" + role: "content" }, linkTarget: { type: "string", source: "attribute", selector: "a", attribute: "target", - __experimentalRole: "content" + role: "content" }, rel: { type: "string", source: "attribute", selector: "a", attribute: "rel", - __experimentalRole: "content" + role: "content" }, placeholder: { type: "string" @@ -5350,14 +5642,16 @@ } }, typography: { - fontSize: true, - lineHeight: true, - __experimentalFontFamily: true, - __experimentalFontWeight: true, - __experimentalFontStyle: true, - __experimentalTextTransform: true, - __experimentalTextDecoration: true, - __experimentalLetterSpacing: true, + __experimentalSkipSerialization: ["fontSize", "lineHeight", "fontFamily", "fontWeight", "fontStyle", "textTransform", "textDecoration", "letterSpacing"], + fontSize: true, + lineHeight: true, + __experimentalFontFamily: true, + __experimentalFontWeight: true, + __experimentalFontStyle: true, + __experimentalTextTransform: true, + __experimentalTextDecoration: true, + __experimentalLetterSpacing: true, + __experimentalWritingMode: true, __experimentalDefaultControls: { fontSize: true } @@ -5386,7 +5680,6 @@ width: true } }, - __experimentalSelector: ".wp-block-button .wp-block-button__link", interactivity: { clientNavigation: true } @@ -5400,7 +5693,13 @@ label: "Outline" }], editorStyle: "wp-block-button-editor", - style: "wp-block-button" + style: "wp-block-button", + selectors: { + root: ".wp-block-button .wp-block-button__link", + typography: { + writingMode: ".wp-block-button" + } + } }; const { @@ -5412,7 +5711,7 @@ example: { attributes: { className: 'is-style-fill', - text: (0,external_wp_i18n_namespaceObject.__)('Call to Action') + text: (0,external_wp_i18n_namespaceObject.__)('Call to action') } }, edit: button_edit, @@ -5431,7 +5730,7 @@ settings: button_settings }); -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/buttons.js +;// ./node_modules/@wordpress/icons/build-module/library/buttons.js /** * WordPress dependencies */ @@ -5446,7 +5745,7 @@ }); /* harmony default export */ const library_buttons = (buttons); -;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/buttons/deprecated.js +;// ./node_modules/@wordpress/block-library/build-module/buttons/deprecated.js /** * External dependencies */ @@ -5558,9 +5857,9 @@ }]; /* harmony default export */ const buttons_deprecated = (buttons_deprecated_deprecated); -;// CONCATENATED MODULE: external ["wp","richText"] +;// external ["wp","richText"] const external_wp_richText_namespaceObject = window["wp"]["richText"]; -;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/utils/get-transformed-metadata.js +;// ./node_modules/@wordpress/block-library/build-module/utils/get-transformed-metadata.js /** * WordPress dependencies */ @@ -5612,7 +5911,7 @@ return Object.keys(newMetadata).length ? newMetadata : undefined; } -;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/buttons/transforms.js +;// ./node_modules/@wordpress/block-library/build-module/buttons/transforms.js /** * WordPress dependencies */ @@ -5677,7 +5976,7 @@ }; /* harmony default export */ const buttons_transforms = (transforms_transforms); -;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/buttons/edit.js +;// ./node_modules/@wordpress/block-library/build-module/buttons/edit.js /** * External dependencies */ @@ -5731,7 +6030,7 @@ } /* harmony default export */ const buttons_edit = (ButtonsEdit); -;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/buttons/save.js +;// ./node_modules/@wordpress/block-library/build-module/buttons/save.js /** * External dependencies */ @@ -5761,7 +6060,7 @@ }); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/buttons/index.js +;// ./node_modules/@wordpress/block-library/build-module/buttons/index.js /** * WordPress dependencies */ @@ -5790,8 +6089,16 @@ align: ["wide", "full"], html: false, __experimentalExposeControlsToChildren: true, - spacing: { - blockGap: true, + color: { + gradients: true, + text: false, + __experimentalDefaultControls: { + background: true + } + }, + spacing: { + blockGap: ["horizontal", "vertical"], + padding: true, margin: ["top", "bottom"], __experimentalDefaultControls: { blockGap: true @@ -5810,6 +6117,18 @@ fontSize: true } }, + __experimentalBorder: { + color: true, + radius: true, + style: true, + width: true, + __experimentalDefaultControls: { + color: true, + radius: true, + style: true, + width: true + } + }, layout: { allowSwitching: false, allowInheriting: false, @@ -5832,6 +6151,12 @@ const buttons_settings = { icon: library_buttons, example: { + attributes: { + layout: { + type: 'flex', + justifyContent: 'center' + } + }, innerBlocks: [{ name: 'core/button', attributes: { @@ -5855,7 +6180,7 @@ settings: buttons_settings }); -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/calendar.js +;// ./node_modules/@wordpress/icons/build-module/library/calendar.js /** * WordPress dependencies */ @@ -5870,7 +6195,7 @@ }); /* harmony default export */ const library_calendar = (calendar); -;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/calendar/edit.js +;// ./node_modules/@wordpress/block-library/build-module/calendar/edit.js /** * External dependencies */ @@ -5970,7 +6295,7 @@ }); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/calendar/transforms.js +;// ./node_modules/@wordpress/block-library/build-module/calendar/transforms.js /** * WordPress dependencies */ @@ -5989,7 +6314,7 @@ }; /* harmony default export */ const calendar_transforms = (calendar_transforms_transforms); -;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/calendar/index.js +;// ./node_modules/@wordpress/block-library/build-module/calendar/index.js /** * WordPress dependencies */ @@ -6063,7 +6388,7 @@ settings: calendar_settings }); -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/category.js +;// ./node_modules/@wordpress/icons/build-module/library/category.js /** * WordPress dependencies */ @@ -6080,9 +6405,9 @@ }); /* harmony default export */ const library_category = (category); -;// CONCATENATED MODULE: external ["wp","htmlEntities"] +;// external ["wp","htmlEntities"] const external_wp_htmlEntities_namespaceObject = window["wp"]["htmlEntities"]; -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/pin.js +;// ./node_modules/@wordpress/icons/build-module/library/pin.js /** * WordPress dependencies */ @@ -6097,23 +6422,26 @@ }); /* harmony default export */ const library_pin = (pin); -;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/categories/edit.js -/** - * External dependencies - */ - - -/** - * WordPress dependencies - */ - - - - - - - - +;// ./node_modules/@wordpress/block-library/build-module/categories/edit.js +/** + * External dependencies + */ + + +/** + * WordPress dependencies + */ + + + + + + + + +/** + * Internal dependencies + */ function CategoriesEdit({ @@ -6122,24 +6450,34 @@ showHierarchy, showPostCounts, showOnlyTopLevel, - showEmpty + showEmpty, + label, + showLabel, + taxonomy: taxonomySlug }, setAttributes, className }) { const selectId = (0,external_wp_compose_namespaceObject.useInstanceId)(CategoriesEdit, 'blocks-category-select'); + const { + records: allTaxonomies, + isResolvingTaxonomies + } = (0,external_wp_coreData_namespaceObject.useEntityRecords)('root', 'taxonomy'); + const taxonomies = allTaxonomies?.filter(t => t.visibility.public); + const taxonomy = taxonomies?.find(t => t.slug === taxonomySlug); + const isHierarchicalTaxonomy = !isResolvingTaxonomies && taxonomy?.hierarchical; const query = { per_page: -1, hide_empty: !showEmpty, context: 'view' }; - if (showOnlyTopLevel) { + if (isHierarchicalTaxonomy && showOnlyTopLevel) { query.parent = 0; } const { records: categories, isResolving - } = (0,external_wp_coreData_namespaceObject.useEntityRecords)('taxonomy', 'category', query); + } = (0,external_wp_coreData_namespaceObject.useEntityRecords)('taxonomy', taxonomySlug, query); const getCategoriesList = parentId => { if (!categories?.length) { return []; @@ -6156,7 +6494,7 @@ }); const renderCategoryName = name => !name ? (0,external_wp_i18n_namespaceObject.__)('(Untitled)') : (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(name).trim(); const renderCategoryList = () => { - const parentId = showHierarchy ? 0 : null; + const parentId = isHierarchicalTaxonomy && showHierarchy ? 0 : null; const categoriesList = getCategoriesList(parentId); return categoriesList.map(category => renderCategoryListItem(category)); }; @@ -6175,24 +6513,34 @@ target: "_blank", rel: "noreferrer noopener", children: renderCategoryName(name) - }), showPostCounts && ` (${count})`, showHierarchy && !!childCategories.length && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("ul", { + }), showPostCounts && ` (${count})`, isHierarchicalTaxonomy && showHierarchy && !!childCategories.length && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("ul", { className: "children", children: childCategories.map(childCategory => renderCategoryListItem(childCategory)) })] }, id); }; const renderCategoryDropdown = () => { - const parentId = showHierarchy ? 0 : null; + const parentId = isHierarchicalTaxonomy && showHierarchy ? 0 : null; const categoriesList = getCategoriesList(parentId); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, { + children: [showLabel ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, { + className: "wp-block-categories__label", + "aria-label": (0,external_wp_i18n_namespaceObject.__)('Label text'), + placeholder: taxonomy.name, + withoutInteractiveFormatting: true, + value: label, + onChange: html => setAttributes({ + label: html + }) + }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, { as: "label", htmlFor: selectId, - children: (0,external_wp_i18n_namespaceObject.__)('Categories') + children: label ? label : taxonomy.name }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("select", { id: selectId, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("option", { - children: (0,external_wp_i18n_namespaceObject.__)('Select Category') + children: (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: taxonomy's singular name */ + (0,external_wp_i18n_namespaceObject.__)('Select %s'), taxonomy.labels.singular_name) }), categoriesList.map(category => renderCategoryDropdownItem(category, 0))] })] }); @@ -6209,7 +6557,7 @@ children: [Array.from({ length: level * 3 }).map(() => '\xa0'), renderCategoryName(name), showPostCounts && ` (${count})`] - }, id), showHierarchy && !!childCategories.length && childCategories.map(childCategory => renderCategoryDropdownItem(childCategory, level + 1))]; + }, id), isHierarchicalTaxonomy && showHierarchy && !!childCategories.length && childCategories.map(childCategory => renderCategoryDropdownItem(childCategory, level + 1))]; }; const TagName = !!categories?.length && !displayAsDropdown && !isResolving ? 'ul' : 'div'; const classes = dist_clsx(className, { @@ -6219,49 +6567,177 @@ const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ className: classes }); + const dropdownMenuProps = useToolsPanelDropdownMenuProps(); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(TagName, { ...blockProps, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, { - title: (0,external_wp_i18n_namespaceObject.__)('Settings'), - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { - __nextHasNoMarginBottom: true, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanel, { + label: (0,external_wp_i18n_namespaceObject.__)('Settings'), + resetAll: () => { + setAttributes({ + taxonomy: 'category', + displayAsDropdown: false, + showHierarchy: false, + showPostCounts: false, + showOnlyTopLevel: false, + showEmpty: false, + showLabel: true + }); + }, + dropdownMenuProps: dropdownMenuProps, + children: [Array.isArray(taxonomies) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { + hasValue: () => { + return taxonomySlug !== 'category'; + }, + label: (0,external_wp_i18n_namespaceObject.__)('Taxonomy'), + onDeselect: () => { + setAttributes({ + taxonomy: 'category' + }); + }, + isShownByDefault: true, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { + __nextHasNoMarginBottom: true, + __next40pxDefaultSize: true, + label: (0,external_wp_i18n_namespaceObject.__)('Taxonomy'), + options: taxonomies.map(t => ({ + label: t.name, + value: t.slug + })), + value: taxonomySlug, + onChange: selectedTaxonomy => setAttributes({ + taxonomy: selectedTaxonomy + }) + }) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { + hasValue: () => !!displayAsDropdown, label: (0,external_wp_i18n_namespaceObject.__)('Display as dropdown'), - checked: displayAsDropdown, - onChange: toggleAttribute('displayAsDropdown') - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { - __nextHasNoMarginBottom: true, + onDeselect: () => setAttributes({ + displayAsDropdown: false + }), + isShownByDefault: true, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { + __nextHasNoMarginBottom: true, + label: (0,external_wp_i18n_namespaceObject.__)('Display as dropdown'), + checked: displayAsDropdown, + onChange: toggleAttribute('displayAsDropdown') + }) + }), displayAsDropdown && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { + hasValue: () => !showLabel, + label: (0,external_wp_i18n_namespaceObject.__)('Show label'), + onDeselect: () => setAttributes({ + showLabel: true + }), + isShownByDefault: true, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { + __nextHasNoMarginBottom: true, + className: "wp-block-categories__indentation", + label: (0,external_wp_i18n_namespaceObject.__)('Show label'), + checked: showLabel, + onChange: toggleAttribute('showLabel') + }) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { + hasValue: () => !!showPostCounts, label: (0,external_wp_i18n_namespaceObject.__)('Show post counts'), - checked: showPostCounts, - onChange: toggleAttribute('showPostCounts') - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { - __nextHasNoMarginBottom: true, - label: (0,external_wp_i18n_namespaceObject.__)('Show only top level categories'), - checked: showOnlyTopLevel, - onChange: toggleAttribute('showOnlyTopLevel') - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { - __nextHasNoMarginBottom: true, - label: (0,external_wp_i18n_namespaceObject.__)('Show empty categories'), - checked: showEmpty, - onChange: toggleAttribute('showEmpty') - }), !showOnlyTopLevel && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { - __nextHasNoMarginBottom: true, + onDeselect: () => setAttributes({ + showPostCounts: false + }), + isShownByDefault: true, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { + __nextHasNoMarginBottom: true, + label: (0,external_wp_i18n_namespaceObject.__)('Show post counts'), + checked: showPostCounts, + onChange: toggleAttribute('showPostCounts') + }) + }), isHierarchicalTaxonomy && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { + hasValue: () => !!showOnlyTopLevel, + label: (0,external_wp_i18n_namespaceObject.__)('Show only top level terms'), + onDeselect: () => setAttributes({ + showOnlyTopLevel: false + }), + isShownByDefault: true, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { + __nextHasNoMarginBottom: true, + label: (0,external_wp_i18n_namespaceObject.__)('Show only top level terms'), + checked: showOnlyTopLevel, + onChange: toggleAttribute('showOnlyTopLevel') + }) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { + hasValue: () => !!showEmpty, + label: (0,external_wp_i18n_namespaceObject.__)('Show empty terms'), + onDeselect: () => setAttributes({ + showEmpty: false + }), + isShownByDefault: true, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { + __nextHasNoMarginBottom: true, + label: (0,external_wp_i18n_namespaceObject.__)('Show empty terms'), + checked: showEmpty, + onChange: toggleAttribute('showEmpty') + }) + }), isHierarchicalTaxonomy && !showOnlyTopLevel && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { + hasValue: () => !!showHierarchy, label: (0,external_wp_i18n_namespaceObject.__)('Show hierarchy'), - checked: showHierarchy, - onChange: toggleAttribute('showHierarchy') + onDeselect: () => setAttributes({ + showHierarchy: false + }), + isShownByDefault: true, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { + __nextHasNoMarginBottom: true, + label: (0,external_wp_i18n_namespaceObject.__)('Show hierarchy'), + checked: showHierarchy, + onChange: toggleAttribute('showHierarchy') + }) })] }) }), isResolving && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Placeholder, { icon: library_pin, - label: (0,external_wp_i18n_namespaceObject.__)('Categories'), + label: (0,external_wp_i18n_namespaceObject.__)('Terms'), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}) }), !isResolving && categories?.length === 0 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { - children: (0,external_wp_i18n_namespaceObject.__)('Your site does not have any posts, so there is nothing to display here at the moment.') + children: taxonomy.labels.no_terms }), !isResolving && categories?.length > 0 && (displayAsDropdown ? renderCategoryDropdown() : renderCategoryList())] }); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/categories/index.js +;// ./node_modules/@wordpress/block-library/build-module/categories/variations.js +/** + * WordPress dependencies + */ + + +const variations = [{ + name: 'terms', + title: (0,external_wp_i18n_namespaceObject.__)('Terms List'), + icon: library_category, + attributes: { + // We need to set an attribute here that will be set when inserting the block. + // We cannot leave this empty, as that would be interpreted as the default value, + // which is `category` -- for which we're defining a distinct variation below, + // for backwards compatibility reasons. + // The logical fallback is thus the only other built-in and public taxonomy: Tags. + taxonomy: 'post_tag' + }, + isActive: blockAttributes => + // This variation is used for any taxonomy other than `category`. + blockAttributes.taxonomy !== 'category' +}, { + name: 'categories', + title: (0,external_wp_i18n_namespaceObject.__)('Categories List'), + description: (0,external_wp_i18n_namespaceObject.__)('Display a list of all categories.'), + icon: library_category, + attributes: { + taxonomy: 'category' + }, + isActive: ['taxonomy'], + // The following is needed to prevent "Terms List" from showing up twice in the inserter + // (once for the block, once for the variation). Fortunately, it does not collide with + // `categories` being the default value of the `taxonomy` attribute. + isDefault: true +}]; +/* harmony default export */ const categories_variations = (variations); + +;// ./node_modules/@wordpress/block-library/build-module/categories/index.js /** * WordPress dependencies */ @@ -6275,11 +6751,16 @@ $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/categories", - title: "Categories List", + title: "Terms List", category: "widgets", - description: "Display a list of all categories.", - textdomain: "default", - attributes: { + description: "Display a list of all terms of a given taxonomy.", + keywords: ["categories"], + textdomain: "default", + attributes: { + taxonomy: { + type: "string", + "default": "category" + }, displayAsDropdown: { type: "boolean", "default": false @@ -6299,8 +6780,17 @@ showEmpty: { type: "boolean", "default": false - } - }, + }, + label: { + type: "string", + role: "content" + }, + showLabel: { + type: "boolean", + "default": true + } + }, + usesContext: ["enhancedPagination"], supports: { align: true, html: false, @@ -6325,14 +6815,36 @@ fontSize: true } }, - interactivity: { - clientNavigation: true + color: { + gradients: true, + link: true, + __experimentalDefaultControls: { + background: true, + text: true, + link: true + } + }, + interactivity: { + clientNavigation: true + }, + __experimentalBorder: { + radius: true, + color: true, + width: true, + style: true, + __experimentalDefaultControls: { + radius: true, + color: true, + width: true, + style: true + } } }, editorStyle: "wp-block-categories-editor", style: "wp-block-categories" }; + const { name: categories_name } = categories_metadata; @@ -6340,7 +6852,8 @@ const categories_settings = { icon: library_category, example: {}, - edit: CategoriesEdit + edit: CategoriesEdit, + variations: categories_variations }; const categories_init = () => initBlock({ name: categories_name, @@ -6348,7 +6861,7 @@ settings: categories_settings }); -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/classic.js +;// ./node_modules/@wordpress/icons/build-module/library/classic.js /** * WordPress dependencies */ @@ -6363,7 +6876,7 @@ }); /* harmony default export */ const library_classic = (classic); -;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/freeform/convert-to-blocks-button.js +;// ./node_modules/@wordpress/block-library/build-module/freeform/convert-to-blocks-button.js /** * WordPress dependencies */ @@ -6391,7 +6904,7 @@ }; /* harmony default export */ const convert_to_blocks_button = (ConvertToBlocksButton); -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/fullscreen.js +;// ./node_modules/@wordpress/icons/build-module/library/fullscreen.js /** * WordPress dependencies */ @@ -6406,12 +6919,10 @@ }); /* harmony default export */ const library_fullscreen = (fullscreen); -;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/freeform/modal.js -/** - * WordPress dependencies - */ - - +;// ./node_modules/@wordpress/block-library/build-module/freeform/modal.js +/** + * WordPress dependencies + */ @@ -6430,6 +6941,7 @@ return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + size: "compact", onClick: onClick, icon: library_fullscreen, isPressed: isModalFullScreen, @@ -6516,12 +7028,14 @@ expanded: false, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + __next40pxDefaultSize: true, variant: "tertiary", onClick: onClose, children: (0,external_wp_i18n_namespaceObject.__)('Cancel') }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + __next40pxDefaultSize: true, variant: "primary", onClick: () => { setAttributes({ @@ -6537,23 +7051,21 @@ }); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/freeform/edit.js -/** - * WordPress dependencies - */ - - - - - - - - -/** - * Internal dependencies - */ - - +;// ./node_modules/@wordpress/block-library/build-module/freeform/edit.js +/** + * WordPress dependencies + */ + + + + + + + + +/** + * Internal dependencies + */ @@ -6614,9 +7126,9 @@ const { getMultiSelectedBlockClientIds } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store); - const didMount = (0,external_wp_element_namespaceObject.useRef)(false); - (0,external_wp_element_namespaceObject.useEffect)(() => { - if (!didMount.current) { + const didMountRef = (0,external_wp_element_namespaceObject.useRef)(false); + (0,external_wp_element_namespaceObject.useEffect)(() => { + if (!didMountRef.current) { return; } const editor = window.tinymce.get(`editor-${clientId}`); @@ -6633,7 +7145,7 @@ baseURL, suffix } = window.wpEditorL10n.tinymce; - didMount.current = true; + didMountRef.current = true; window.tinymce.EditorManager.overrideDefaults({ base_url: baseURL, suffix @@ -6745,7 +7257,7 @@ return () => { document.removeEventListener('readystatechange', onReadyStateChange); wp.oldEditor.remove(`editor-${clientId}`); - didMount.current = false; + didMountRef.current = false; }; }, []); function focus() { @@ -6783,7 +7295,7 @@ /* eslint-enable jsx-a11y/no-static-element-interactions */ } -;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/freeform/save.js +;// ./node_modules/@wordpress/block-library/build-module/freeform/save.js /** * WordPress dependencies */ @@ -6800,7 +7312,7 @@ }); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/freeform/index.js +;// ./node_modules/@wordpress/block-library/build-module/freeform/index.js /** * WordPress dependencies */ @@ -6848,7 +7360,7 @@ settings: freeform_settings }); -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/code.js +;// ./node_modules/@wordpress/icons/build-module/library/code.js /** * WordPress dependencies */ @@ -6863,7 +7375,7 @@ }); /* harmony default export */ const library_code = (code); -;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/code/edit.js +;// ./node_modules/@wordpress/block-library/build-module/code/edit.js /** * WordPress dependencies */ @@ -6899,7 +7411,7 @@ }); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/code/utils.js +;// ./node_modules/@wordpress/block-library/build-module/code/utils.js /** * WordPress dependencies */ @@ -6950,7 +7462,7 @@ return content.replace(/^(\s*https?:)\/\/([^\s<>"]+\s*)$/m, '$1//$2'); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/code/save.js +;// ./node_modules/@wordpress/block-library/build-module/code/save.js /** * WordPress dependencies */ @@ -6979,7 +7491,7 @@ }); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/code/transforms.js +;// ./node_modules/@wordpress/block-library/build-module/code/transforms.js /** * WordPress dependencies */ @@ -7052,7 +7564,7 @@ }; /* harmony default export */ const code_transforms = (code_transforms_transforms); -;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/code/index.js +;// ./node_modules/@wordpress/block-library/build-module/code/index.js /** * WordPress dependencies */ @@ -7160,7 +7672,7 @@ settings: code_settings }); -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/column.js +;// ./node_modules/@wordpress/icons/build-module/library/column.js /** * WordPress dependencies */ @@ -7175,7 +7687,7 @@ }); /* harmony default export */ const library_column = (column); -;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/column/deprecated.js +;// ./node_modules/@wordpress/block-library/build-module/column/deprecated.js /** * External dependencies */ @@ -7230,20 +7742,23 @@ }]; /* harmony default export */ const column_deprecated = (column_deprecated_deprecated); -;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/column/edit.js -/** - * External dependencies - */ - - -/** - * WordPress dependencies - */ - - - - - +;// ./node_modules/@wordpress/block-library/build-module/column/edit.js +/** + * External dependencies + */ + + +/** + * WordPress dependencies + */ + + + + + +/** + * Internal dependencies + */ function ColumnInspectorControls({ @@ -7254,20 +7769,35 @@ const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({ availableUnits: availableUnits || ['%', 'px', 'em', 'rem', 'vw'] }); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.PanelBody, { - title: (0,external_wp_i18n_namespaceObject.__)('Settings'), - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalUnitControl, { + const dropdownMenuProps = useToolsPanelDropdownMenuProps(); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanel, { + label: (0,external_wp_i18n_namespaceObject.__)('Settings'), + resetAll: () => { + setAttributes({ + width: undefined + }); + }, + dropdownMenuProps: dropdownMenuProps, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { + hasValue: () => width !== undefined, label: (0,external_wp_i18n_namespaceObject.__)('Width'), - labelPosition: "edge", - __unstableInputWidth: "80px", - value: width || '', - onChange: nextWidth => { - nextWidth = 0 > parseFloat(nextWidth) ? '0' : nextWidth; - setAttributes({ - width: nextWidth - }); - }, - units: units + onDeselect: () => setAttributes({ + width: undefined + }), + isShownByDefault: true, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalUnitControl, { + label: (0,external_wp_i18n_namespaceObject.__)('Width'), + __unstableInputWidth: "calc(50% - 8px)", + __next40pxDefaultSize: true, + value: width || '', + onChange: nextWidth => { + nextWidth = 0 > parseFloat(nextWidth) ? '0' : nextWidth; + setAttributes({ + width: nextWidth + }); + }, + units: units + }) }) }); } @@ -7322,7 +7852,7 @@ }); const columnsCount = columnsIds.length; const currentColumnPosition = columnsIds.indexOf(clientId) + 1; - const label = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: 1: Block label (i.e. "Block: Column"), 2: Position of the selected block, 3: Total number of sibling blocks of the same type */ + const label = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: 1: Block label (i.e. "Block: Column"), 2: Position of the selected block, 3: Total number of sibling blocks of the same type */ (0,external_wp_i18n_namespaceObject.__)('%1$s (%2$d of %3$d)'), blockProps['aria-label'], currentColumnPosition, columnsCount); const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)({ ...blockProps, @@ -7351,7 +7881,7 @@ } /* harmony default export */ const column_edit = (ColumnEdit); -;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/column/save.js +;// ./node_modules/@wordpress/block-library/build-module/column/save.js /** * External dependencies */ @@ -7396,7 +7926,7 @@ }); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/column/index.js +;// ./node_modules/@wordpress/block-library/build-module/column/index.js /** * WordPress dependencies */ @@ -7458,10 +7988,12 @@ }, __experimentalBorder: { color: true, + radius: true, style: true, width: true, __experimentalDefaultControls: { color: true, + radius: true, style: true, width: true } @@ -7502,7 +8034,7 @@ settings: column_settings }); -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/columns.js +;// ./node_modules/@wordpress/icons/build-module/library/columns.js /** * WordPress dependencies */ @@ -7519,7 +8051,7 @@ }); /* harmony default export */ const library_columns = (columns); -;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/columns/deprecated.js +;// ./node_modules/@wordpress/block-library/build-module/columns/deprecated.js /** * External dependencies */ @@ -7721,7 +8253,7 @@ } }]); -;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/columns/utils.js +;// ./node_modules/@wordpress/block-library/build-module/columns/utils.js /** * Returns a column width attribute value rounded to standard precision. * Returns `undefined` if the value is not a valid finite number. @@ -7877,25 +8409,24 @@ return unit === '%'; } -;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/columns/edit.js -/** - * External dependencies - */ - - -/** - * WordPress dependencies - */ - - - - - - -/** - * Internal dependencies - */ - +;// ./node_modules/@wordpress/block-library/build-module/columns/edit.js +/** + * External dependencies + */ + + +/** + * WordPress dependencies + */ + + + + + + +/** + * Internal dependencies + */ @@ -7915,21 +8446,20 @@ const { canInsertBlockType, canRemoveBlock, - getBlocks, - getBlockCount + getBlockOrder } = select(external_wp_blockEditor_namespaceObject.store); - const innerBlocks = getBlocks(clientId); + const blockOrder = getBlockOrder(clientId); // Get the indexes of columns for which removal is prevented. // The highest index will be used to determine the minimum column count. - const preventRemovalBlockIndexes = innerBlocks.reduce((acc, block, index) => { - if (!canRemoveBlock(block.clientId)) { + const preventRemovalBlockIndexes = blockOrder.reduce((acc, blockId, index) => { + if (!canRemoveBlock(blockId)) { acc.push(index); } return acc; }, []); return { - count: getBlockCount(clientId), + count: blockOrder.length, canInsertColumnBlock: canInsertBlockType('core/column', clientId), minCount: Math.max(...preventRemovalBlockIndexes) + 1 }; @@ -7987,28 +8517,51 @@ } replaceInnerBlocks(clientId, innerBlocks); } - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, { - title: (0,external_wp_i18n_namespaceObject.__)('Settings'), - children: [canInsertColumnBlock && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RangeControl, { + const dropdownMenuProps = useToolsPanelDropdownMenuProps(); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanel, { + label: (0,external_wp_i18n_namespaceObject.__)('Settings'), + resetAll: () => { + updateColumns(count, minCount); + setAttributes({ + isStackedOnMobile: true + }); + }, + dropdownMenuProps: dropdownMenuProps, + children: [canInsertColumnBlock && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { + label: (0,external_wp_i18n_namespaceObject.__)('Columns'), + isShownByDefault: true, + hasValue: () => count, + onDeselect: () => updateColumns(count, minCount), + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { + spacing: 4, + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RangeControl, { + __nextHasNoMarginBottom: true, + __next40pxDefaultSize: true, + label: (0,external_wp_i18n_namespaceObject.__)('Columns'), + value: count, + onChange: value => updateColumns(count, Math.max(minCount, value)), + min: Math.max(1, minCount), + max: Math.max(6, count) + }), count > 6 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Notice, { + status: "warning", + isDismissible: false, + children: (0,external_wp_i18n_namespaceObject.__)('This column count exceeds the recommended amount and may cause visual breakage.') + })] + }) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { + label: (0,external_wp_i18n_namespaceObject.__)('Stack on mobile'), + isShownByDefault: true, + hasValue: () => isStackedOnMobile !== true, + onDeselect: () => setAttributes({ + isStackedOnMobile: true + }), + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, - __next40pxDefaultSize: true, - label: (0,external_wp_i18n_namespaceObject.__)('Columns'), - value: count, - onChange: value => updateColumns(count, Math.max(minCount, value)), - min: Math.max(1, minCount), - max: Math.max(6, count) - }), count > 6 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Notice, { - status: "warning", - isDismissible: false, - children: (0,external_wp_i18n_namespaceObject.__)('This column count exceeds the recommended amount and may cause visual breakage.') - })] - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { - __nextHasNoMarginBottom: true, - label: (0,external_wp_i18n_namespaceObject.__)('Stack on mobile'), - checked: isStackedOnMobile, - onChange: () => setAttributes({ - isStackedOnMobile: !isStackedOnMobile + label: (0,external_wp_i18n_namespaceObject.__)('Stack on mobile'), + checked: isStackedOnMobile, + onChange: () => setAttributes({ + isStackedOnMobile: !isStackedOnMobile + }) }) })] }); @@ -8048,7 +8601,7 @@ /** * Update all child Column blocks with a new vertical alignment setting * based on whatever alignment is passed in. This allows change to parent - * to overide anything set on a individual column basis. + * to override anything set on a individual column basis. * * @param {string} newVerticalAlignment The vertical alignment setting. */ @@ -8139,7 +8692,7 @@ }; /* harmony default export */ const columns_edit = (ColumnsEdit); -;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/columns/save.js +;// ./node_modules/@wordpress/block-library/build-module/columns/save.js /** * External dependencies */ @@ -8170,7 +8723,7 @@ }); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/columns/variations.js +;// ./node_modules/@wordpress/block-library/build-module/columns/variations.js /** * WordPress dependencies */ @@ -8185,7 +8738,7 @@ * @type {WPBlockVariation[]} */ -const variations = [{ +const variations_variations = [{ name: 'one-column-full', title: (0,external_wp_i18n_namespaceObject.__)('100'), description: (0,external_wp_i18n_namespaceObject.__)('One column'), @@ -8291,9 +8844,9 @@ }]], scope: ['block'] }]; -/* harmony default export */ const columns_variations = (variations); - -;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/columns/transforms.js +/* harmony default export */ const columns_variations = (variations_variations); + +;// ./node_modules/@wordpress/block-library/build-module/columns/transforms.js /** * WordPress dependencies */ @@ -8394,7 +8947,7 @@ }; /* harmony default export */ const columns_transforms = (columns_transforms_transforms); -;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/columns/index.js +;// ./node_modules/@wordpress/block-library/build-module/columns/index.js /** * WordPress dependencies */ @@ -8508,8 +9061,8 @@ icon: library_columns, variations: columns_variations, example: { - viewportWidth: 600, - // Columns collapse "@media (max-width: 599px)". + viewportWidth: 782, + // Columns collapse "@media (max-width: 781px)". innerBlocks: [{ name: 'core/column', innerBlocks: [{ @@ -8558,7 +9111,7 @@ settings: columns_settings }); -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post-comments.js +;// ./node_modules/@wordpress/icons/build-module/library/post-comments.js /** * WordPress dependencies */ @@ -8573,7 +9126,7 @@ }); /* harmony default export */ const post_comments = (postComments); -;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments/deprecated.js +;// ./node_modules/@wordpress/block-library/build-module/comments/deprecated.js /** * WordPress dependencies */ @@ -8630,12 +9183,33 @@ }; /* harmony default export */ const comments_deprecated = ([v1]); -;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments/edit/comments-inspector-controls.js -/** - * WordPress dependencies - */ - - +;// ./node_modules/@wordpress/block-library/build-module/utils/messages.js +/** + * WordPress dependencies + */ + +const htmlElementMessages = { + article: (0,external_wp_i18n_namespaceObject.__)('The
element should represent a self-contained, syndicatable portion of the document.'), + aside: (0,external_wp_i18n_namespaceObject.__)("The