@wordpress/block-editor 14.7.0 → 14.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/build/components/block-controls/slot.js +6 -3
- package/build/components/block-controls/slot.js.map +1 -1
- package/build/components/block-inspector/index.js +1 -2
- package/build/components/block-inspector/index.js.map +1 -1
- package/build/components/block-lock/modal.js +1 -1
- package/build/components/block-lock/modal.js.map +1 -1
- package/build/components/block-manager/category.js +79 -0
- package/build/components/block-manager/category.js.map +1 -0
- package/build/components/block-manager/checklist.js +40 -0
- package/build/components/block-manager/checklist.js.map +1 -0
- package/build/components/block-manager/index.js +108 -0
- package/build/components/block-manager/index.js.map +1 -0
- package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build/components/block-settings-menu/index.js.map +1 -1
- package/build/components/block-toolbar/index.js +16 -4
- package/build/components/block-toolbar/index.js.map +1 -1
- package/build/components/block-toolbar/switch-section-style.js +105 -0
- package/build/components/block-toolbar/switch-section-style.js.map +1 -0
- package/build/components/collab/block-comment-icon-slot.js +2 -6
- package/build/components/collab/block-comment-icon-slot.js.map +1 -1
- package/build/components/collab/block-comment-icon-toolbar-slot.js +2 -6
- package/build/components/collab/block-comment-icon-toolbar-slot.js.map +1 -1
- package/build/components/color-palette/with-color-context.js +4 -2
- package/build/components/color-palette/with-color-context.js.map +1 -1
- package/build/components/font-family/index.js +14 -13
- package/build/components/font-family/index.js.map +1 -1
- package/build/components/global-styles/use-global-styles-output.js +1 -1
- package/build/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build/components/iframe/index.js +13 -100
- package/build/components/iframe/index.js.map +1 -1
- package/build/components/iframe/use-scale-canvas.js +377 -0
- package/build/components/iframe/use-scale-canvas.js.map +1 -0
- package/build/components/image-editor/use-save-image.js +22 -3
- package/build/components/image-editor/use-save-image.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/pattern-category-previews.js +1 -5
- package/build/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
- package/build/components/inserter/category-tabs/index.js +7 -8
- package/build/components/inserter/category-tabs/index.js.map +1 -1
- package/build/components/inserter-draggable-blocks/index.js +2 -1
- package/build/components/inserter-draggable-blocks/index.js.map +1 -1
- package/build/components/inspector-controls/slot.js +7 -4
- package/build/components/inspector-controls/slot.js.map +1 -1
- package/build/components/inspector-controls-tabs/position-controls-panel.js +1 -1
- package/build/components/inspector-controls-tabs/position-controls-panel.js.map +1 -1
- package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js +4 -4
- package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -1
- package/build/components/media-placeholder/index.js +29 -21
- package/build/components/media-placeholder/index.js.map +1 -1
- package/build/hooks/border.js +3 -3
- package/build/hooks/border.js.map +1 -1
- package/build/hooks/color.js +1 -1
- package/build/hooks/color.js.map +1 -1
- package/build/hooks/dimensions.js +2 -2
- package/build/hooks/dimensions.js.map +1 -1
- package/build/hooks/style.js +6 -6
- package/build/hooks/style.js.map +1 -1
- package/build/hooks/supports.js +1 -1
- package/build/hooks/supports.js.map +1 -1
- package/build/hooks/typography.js +1 -1
- package/build/hooks/typography.js.map +1 -1
- package/build/hooks/utils.js +1 -1
- package/build/hooks/utils.js.map +1 -1
- package/build/layouts/flex.js +11 -9
- package/build/layouts/flex.js.map +1 -1
- package/build/private-apis.js +4 -4
- package/build/private-apis.js.map +1 -1
- package/build/store/private-selectors.js +1 -1
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/selectors.js +3 -0
- package/build/store/selectors.js.map +1 -1
- package/build-module/components/block-controls/slot.js +6 -3
- package/build-module/components/block-controls/slot.js.map +1 -1
- package/build-module/components/block-inspector/index.js +1 -2
- package/build-module/components/block-inspector/index.js.map +1 -1
- package/build-module/components/block-lock/modal.js +1 -1
- package/build-module/components/block-lock/modal.js.map +1 -1
- package/build-module/components/block-manager/category.js +71 -0
- package/build-module/components/block-manager/category.js.map +1 -0
- package/build-module/components/block-manager/checklist.js +32 -0
- package/build-module/components/block-manager/checklist.js.map +1 -0
- package/build-module/components/block-manager/index.js +102 -0
- package/build-module/components/block-manager/index.js.map +1 -0
- package/build-module/components/block-settings-menu/block-settings-dropdown.js +2 -2
- package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build-module/components/block-settings-menu/index.js +2 -2
- package/build-module/components/block-settings-menu/index.js.map +1 -1
- package/build-module/components/block-toolbar/index.js +16 -4
- package/build-module/components/block-toolbar/index.js.map +1 -1
- package/build-module/components/block-toolbar/switch-section-style.js +97 -0
- package/build-module/components/block-toolbar/switch-section-style.js.map +1 -0
- package/build-module/components/collab/block-comment-icon-slot.js +2 -6
- package/build-module/components/collab/block-comment-icon-slot.js.map +1 -1
- package/build-module/components/collab/block-comment-icon-toolbar-slot.js +2 -6
- package/build-module/components/collab/block-comment-icon-toolbar-slot.js.map +1 -1
- package/build-module/components/color-palette/with-color-context.js +4 -2
- package/build-module/components/color-palette/with-color-context.js.map +1 -1
- package/build-module/components/font-family/index.js +15 -14
- package/build-module/components/font-family/index.js.map +1 -1
- package/build-module/components/global-styles/use-global-styles-output.js +1 -1
- package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build-module/components/iframe/index.js +15 -102
- package/build-module/components/iframe/index.js.map +1 -1
- package/build-module/components/iframe/use-scale-canvas.js +371 -0
- package/build-module/components/iframe/use-scale-canvas.js.map +1 -0
- package/build-module/components/image-editor/use-save-image.js +22 -3
- package/build-module/components/image-editor/use-save-image.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js +1 -5
- package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
- package/build-module/components/inserter/category-tabs/index.js +8 -9
- package/build-module/components/inserter/category-tabs/index.js.map +1 -1
- package/build-module/components/inserter-draggable-blocks/index.js +2 -1
- package/build-module/components/inserter-draggable-blocks/index.js.map +1 -1
- package/build-module/components/inspector-controls/slot.js +7 -4
- package/build-module/components/inspector-controls/slot.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/position-controls-panel.js +1 -1
- package/build-module/components/inspector-controls-tabs/position-controls-panel.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js +4 -4
- package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -1
- package/build-module/components/media-placeholder/index.js +29 -21
- package/build-module/components/media-placeholder/index.js.map +1 -1
- package/build-module/hooks/border.js +3 -3
- package/build-module/hooks/border.js.map +1 -1
- package/build-module/hooks/color.js +1 -1
- package/build-module/hooks/color.js.map +1 -1
- package/build-module/hooks/dimensions.js +2 -2
- package/build-module/hooks/dimensions.js.map +1 -1
- package/build-module/hooks/style.js +6 -6
- package/build-module/hooks/style.js.map +1 -1
- package/build-module/hooks/supports.js +1 -1
- package/build-module/hooks/supports.js.map +1 -1
- package/build-module/hooks/typography.js +1 -1
- package/build-module/hooks/typography.js.map +1 -1
- package/build-module/hooks/utils.js +1 -1
- package/build-module/hooks/utils.js.map +1 -1
- package/build-module/layouts/flex.js +11 -9
- package/build-module/layouts/flex.js.map +1 -1
- package/build-module/private-apis.js +6 -6
- package/build-module/private-apis.js.map +1 -1
- package/build-module/store/private-selectors.js +1 -1
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/selectors.js +3 -0
- package/build-module/store/selectors.js.map +1 -1
- package/build-style/content-rtl.css +27 -28
- package/build-style/content.css +27 -28
- package/build-style/style-rtl.css +108 -0
- package/build-style/style.css +108 -0
- package/package.json +2 -2
- package/src/components/block-canvas/style.scss +2 -1
- package/src/components/block-controls/slot.js +5 -3
- package/src/components/block-inspector/index.js +0 -2
- package/src/components/block-lock/modal.js +1 -1
- package/src/components/block-manager/category.js +102 -0
- package/src/components/block-manager/checklist.js +34 -0
- package/src/components/block-manager/index.js +127 -0
- package/src/components/block-manager/style.scss +82 -0
- package/src/components/block-mover/README.md +15 -8
- package/src/components/block-mover/stories/index.story.js +73 -71
- package/src/components/block-mover/style.scss +3 -0
- package/src/components/block-settings-menu/block-settings-dropdown.js +2 -2
- package/src/components/block-settings-menu/index.js +2 -2
- package/src/components/block-toolbar/index.js +14 -0
- package/src/components/block-toolbar/switch-section-style.js +115 -0
- package/src/components/block-tools/style.scss +39 -0
- package/src/components/collab/block-comment-icon-slot.js +2 -6
- package/src/components/collab/block-comment-icon-toolbar-slot.js +3 -5
- package/src/components/color-palette/test/__snapshots__/control.js.snap +2 -2
- package/src/components/color-palette/with-color-context.js +25 -7
- package/src/components/font-family/index.js +13 -13
- package/src/components/global-styles/test/use-global-styles-output.js +1 -1
- package/src/components/global-styles/use-global-styles-output.js +1 -1
- package/src/components/iframe/content.scss +49 -43
- package/src/components/iframe/index.js +14 -171
- package/src/components/iframe/use-scale-canvas.js +468 -0
- package/src/components/image-editor/use-save-image.js +27 -2
- package/src/components/inserter/block-patterns-tab/pattern-category-previews.js +7 -16
- package/src/components/inserter/category-tabs/index.js +8 -9
- package/src/components/inserter-draggable-blocks/index.js +10 -1
- package/src/components/inspector-controls/README.md +2 -0
- package/src/components/inspector-controls/slot.js +6 -4
- package/src/components/inspector-controls-tabs/position-controls-panel.js +1 -3
- package/src/components/inspector-controls-tabs/use-inspector-controls-tabs.js +10 -10
- package/src/components/media-placeholder/index.js +37 -33
- package/src/components/provider/test/use-block-sync.js +3 -1
- package/src/components/rich-text/content.scss +15 -10
- package/src/hooks/border.js +3 -9
- package/src/hooks/color.js +1 -1
- package/src/hooks/dimensions.js +2 -2
- package/src/hooks/style.js +6 -12
- package/src/hooks/supports.js +1 -1
- package/src/hooks/test/style.js +1 -2
- package/src/hooks/typography.js +1 -1
- package/src/hooks/utils.js +1 -1
- package/src/layouts/flex.js +26 -18
- package/src/private-apis.js +6 -6
- package/src/store/private-selectors.js +1 -1
- package/src/store/selectors.js +3 -0
- package/src/store/test/selectors.js +87 -58
- package/src/style.scss +1 -0
- package/build/components/block-info-slot-fill/index.js +0 -39
- package/build/components/block-info-slot-fill/index.js.map +0 -1
- package/build-module/components/block-info-slot-fill/index.js +0 -32
- package/build-module/components/block-info-slot-fill/index.js.map +0 -1
- package/src/components/block-info-slot-fill/index.js +0 -27
package/build/hooks/style.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_hooks","_blocks","_compose","_styleEngine","_background","_border","_color","_typography","_dimensions","_utils","_utils2","_blockEditingMode","_jsxRuntime","styleSupportKeys","TYPOGRAPHY_SUPPORT_KEYS","BORDER_SUPPORT_KEY","COLOR_SUPPORT_KEY","DIMENSIONS_SUPPORT_KEY","BACKGROUND_SUPPORT_KEY","SPACING_SUPPORT_KEY","SHADOW_SUPPORT_KEY","hasStyleSupport","nameOrType","some","key","hasBlockSupport","getInlineStyles","styles","output","getCSSRules","forEach","rule","value","addAttribute","settings","attributes","style","Object","assign","type","skipSerializationPathsEdit","TYPOGRAPHY_SUPPORT_KEY","skipSerializationPathsSave","skipSerializationPathsSaveChecks","renamedFeatures","gradients","omitStyle","paths","preserveReference","newStyle","JSON","parse","stringify","Array","isArray","path","split","length","firstSubpath","restPath","addSaveProps","props","blockNameOrType","skipPaths","entries","indicator","skipSerialization","getBlockSupport","featureName","feature","BlockStyleControls","clientId","name","setAttributes","__unstableParentLayout","useBlockSettings","blockEditingMode","useBlockEditingMode","passedProps","typography","textAlign","jsxs","Fragment","children","jsx","ColorEdit","BackgroundImagePanel","TypographyPanel","BorderPanel","DimensionsPanel","_default","exports","default","edit","hasSupport","attributeKeys","useBlockProps","elementTypes","elementType","pseudo","elements","STYLE_BLOCK_PROPS_REFERENCE","blockElementsContainerIdentifier","useInstanceId","baseElementSelector","blockElementStyles","useMemo","elementCSSRules","shouldSkipSerialization","elementStyles","selector","scopeSelector","ELEMENTS","push","compileCSS","pseudoSelector","element","join","undefined","useStyleOverride","css","className","addFilter"],"sources":["@wordpress/block-editor/src/hooks/style.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { addFilter } from '@wordpress/hooks';\nimport {\n\tgetBlockSupport,\n\thasBlockSupport,\n\t__EXPERIMENTAL_ELEMENTS as ELEMENTS,\n} from '@wordpress/blocks';\nimport { useInstanceId } from '@wordpress/compose';\nimport { getCSSRules, compileCSS } from '@wordpress/style-engine';\n\n/**\n * Internal dependencies\n */\nimport { BACKGROUND_SUPPORT_KEY, BackgroundImagePanel } from './background';\nimport { BORDER_SUPPORT_KEY, BorderPanel, SHADOW_SUPPORT_KEY } from './border';\nimport { COLOR_SUPPORT_KEY, ColorEdit } from './color';\nimport {\n\tTypographyPanel,\n\tTYPOGRAPHY_SUPPORT_KEY,\n\tTYPOGRAPHY_SUPPORT_KEYS,\n} from './typography';\nimport {\n\tDIMENSIONS_SUPPORT_KEY,\n\tSPACING_SUPPORT_KEY,\n\tDimensionsPanel,\n} from './dimensions';\nimport {\n\tshouldSkipSerialization,\n\tuseStyleOverride,\n\tuseBlockSettings,\n} from './utils';\nimport { scopeSelector } from '../components/global-styles/utils';\nimport { useBlockEditingMode } from '../components/block-editing-mode';\n\nconst styleSupportKeys = [\n\t...TYPOGRAPHY_SUPPORT_KEYS,\n\tBORDER_SUPPORT_KEY,\n\tCOLOR_SUPPORT_KEY,\n\tDIMENSIONS_SUPPORT_KEY,\n\tBACKGROUND_SUPPORT_KEY,\n\tSPACING_SUPPORT_KEY,\n\tSHADOW_SUPPORT_KEY,\n];\n\nconst hasStyleSupport = ( nameOrType ) =>\n\tstyleSupportKeys.some( ( key ) => hasBlockSupport( nameOrType, key ) );\n\n/**\n * Returns the inline styles to add depending on the style object\n *\n * @param {Object} styles Styles configuration.\n *\n * @return {Object} Flattened CSS variables declaration.\n */\nexport function getInlineStyles( styles = {} ) {\n\tconst output = {};\n\t// The goal is to move everything to server side generated engine styles\n\t// This is temporary as we absorb more and more styles into the engine.\n\tgetCSSRules( styles ).forEach( ( rule ) => {\n\t\toutput[ rule.key ] = rule.value;\n\t} );\n\n\treturn output;\n}\n\n/**\n * Filters registered block settings, extending attributes to include `style` attribute.\n *\n * @param {Object} settings Original block settings.\n *\n * @return {Object} Filtered block settings.\n */\nfunction addAttribute( settings ) {\n\tif ( ! hasStyleSupport( settings ) ) {\n\t\treturn settings;\n\t}\n\n\t// Allow blocks to specify their own attribute definition with default values if needed.\n\tif ( ! settings.attributes.style ) {\n\t\tObject.assign( settings.attributes, {\n\t\t\tstyle: {\n\t\t\t\ttype: 'object',\n\t\t\t},\n\t\t} );\n\t}\n\n\treturn settings;\n}\n\n/**\n * A dictionary of paths to flag skipping block support serialization as the key,\n * with values providing the style paths to be omitted from serialization.\n *\n * @constant\n * @type {Record<string, string[]>}\n */\nconst skipSerializationPathsEdit = {\n\t[ `${ BORDER_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [ 'border' ],\n\t[ `${ COLOR_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [\n\t\tCOLOR_SUPPORT_KEY,\n\t],\n\t[ `${ TYPOGRAPHY_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [\n\t\tTYPOGRAPHY_SUPPORT_KEY,\n\t],\n\t[ `${ DIMENSIONS_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [\n\t\tDIMENSIONS_SUPPORT_KEY,\n\t],\n\t[ `${ SPACING_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [\n\t\tSPACING_SUPPORT_KEY,\n\t],\n\t[ `${ SHADOW_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [\n\t\tSHADOW_SUPPORT_KEY,\n\t],\n};\n\n/**\n * A dictionary of paths to flag skipping block support serialization as the key,\n * with values providing the style paths to be omitted from serialization.\n *\n * Extends the Edit skip paths to enable skipping additional paths in just\n * the Save component. This allows a block support to be serialized within the\n * editor, while using an alternate approach, such as server-side rendering, when\n * the support is saved.\n *\n * @constant\n * @type {Record<string, string[]>}\n */\nconst skipSerializationPathsSave = {\n\t...skipSerializationPathsEdit,\n\t[ `${ DIMENSIONS_SUPPORT_KEY }.aspectRatio` ]: [\n\t\t`${ DIMENSIONS_SUPPORT_KEY }.aspectRatio`,\n\t], // Skip serialization of aspect ratio in save mode.\n\t[ `${ BACKGROUND_SUPPORT_KEY }` ]: [ BACKGROUND_SUPPORT_KEY ], // Skip serialization of background support in save mode.\n};\n\nconst skipSerializationPathsSaveChecks = {\n\t[ `${ DIMENSIONS_SUPPORT_KEY }.aspectRatio` ]: true,\n\t[ `${ BACKGROUND_SUPPORT_KEY }` ]: true,\n};\n\n/**\n * A dictionary used to normalize feature names between support flags, style\n * object properties and __experimentSkipSerialization configuration arrays.\n *\n * This allows not having to provide a migration for a support flag and possible\n * backwards compatibility bridges, while still achieving consistency between\n * the support flag and the skip serialization array.\n *\n * @constant\n * @type {Record<string, string>}\n */\nconst renamedFeatures = { gradients: 'gradient' };\n\n/**\n * A utility function used to remove one or more paths from a style object.\n * Works in a way similar to Lodash's `omit()`. See unit tests and examples below.\n *\n * It supports a single string path:\n *\n * ```\n * omitStyle( { color: 'red' }, 'color' ); // {}\n * ```\n *\n * or an array of paths:\n *\n * ```\n * omitStyle( { color: 'red', background: '#fff' }, [ 'color', 'background' ] ); // {}\n * ```\n *\n * It also allows you to specify paths at multiple levels in a string.\n *\n * ```\n * omitStyle( { typography: { textDecoration: 'underline' } }, 'typography.textDecoration' ); // {}\n * ```\n *\n * You can remove multiple paths at the same time:\n *\n * ```\n * omitStyle(\n * \t\t{\n * \t\t\ttypography: {\n * \t\t\t\ttextDecoration: 'underline',\n * \t\t\t\ttextTransform: 'uppercase',\n * \t\t\t}\n *\t\t},\n *\t\t[\n * \t\t\t'typography.textDecoration',\n * \t\t\t'typography.textTransform',\n *\t\t]\n * );\n * // {}\n * ```\n *\n * You can also specify nested paths as arrays:\n *\n * ```\n * omitStyle(\n * \t\t{\n * \t\t\ttypography: {\n * \t\t\t\ttextDecoration: 'underline',\n * \t\t\t\ttextTransform: 'uppercase',\n * \t\t\t}\n *\t\t},\n *\t\t[\n * \t\t\t[ 'typography', 'textDecoration' ],\n * \t\t\t[ 'typography', 'textTransform' ],\n *\t\t]\n * );\n * // {}\n * ```\n *\n * With regards to nesting of styles, infinite depth is supported:\n *\n * ```\n * omitStyle(\n * \t\t{\n * \t\t\tborder: {\n * \t\t\t\tradius: {\n * \t\t\t\t\ttopLeft: '10px',\n * \t\t\t\t\ttopRight: '0.5rem',\n * \t\t\t\t}\n * \t\t\t}\n *\t\t},\n *\t\t[\n * \t\t\t[ 'border', 'radius', 'topRight' ],\n *\t\t]\n * );\n * // { border: { radius: { topLeft: '10px' } } }\n * ```\n *\n * The third argument, `preserveReference`, defines how to treat the input style object.\n * It is mostly necessary to properly handle mutation when recursively handling the style object.\n * Defaulting to `false`, this will always create a new object, avoiding to mutate `style`.\n * However, when recursing, we change that value to `true` in order to work with a single copy\n * of the original style object.\n *\n * @see https://lodash.com/docs/4.17.15#omit\n *\n * @param {Object} style Styles object.\n * @param {Array|string} paths Paths to remove.\n * @param {boolean} preserveReference True to mutate the `style` object, false otherwise.\n * @return {Object} Styles object with the specified paths removed.\n */\nexport function omitStyle( style, paths, preserveReference = false ) {\n\tif ( ! style ) {\n\t\treturn style;\n\t}\n\n\tlet newStyle = style;\n\tif ( ! preserveReference ) {\n\t\tnewStyle = JSON.parse( JSON.stringify( style ) );\n\t}\n\n\tif ( ! Array.isArray( paths ) ) {\n\t\tpaths = [ paths ];\n\t}\n\n\tpaths.forEach( ( path ) => {\n\t\tif ( ! Array.isArray( path ) ) {\n\t\t\tpath = path.split( '.' );\n\t\t}\n\n\t\tif ( path.length > 1 ) {\n\t\t\tconst [ firstSubpath, ...restPath ] = path;\n\t\t\tomitStyle( newStyle[ firstSubpath ], [ restPath ], true );\n\t\t} else if ( path.length === 1 ) {\n\t\t\tdelete newStyle[ path[ 0 ] ];\n\t\t}\n\t} );\n\n\treturn newStyle;\n}\n\n/**\n * Override props assigned to save component to inject the CSS variables definition.\n *\n * @param {Object} props Additional props applied to save element.\n * @param {Object|string} blockNameOrType Block type.\n * @param {Object} attributes Block attributes.\n * @param {?Record<string, string[]>} skipPaths An object of keys and paths to skip serialization.\n *\n * @return {Object} Filtered props applied to save element.\n */\nexport function addSaveProps(\n\tprops,\n\tblockNameOrType,\n\tattributes,\n\tskipPaths = skipSerializationPathsSave\n) {\n\tif ( ! hasStyleSupport( blockNameOrType ) ) {\n\t\treturn props;\n\t}\n\n\tlet { style } = attributes;\n\tObject.entries( skipPaths ).forEach( ( [ indicator, path ] ) => {\n\t\tconst skipSerialization =\n\t\t\tskipSerializationPathsSaveChecks[ indicator ] ||\n\t\t\tgetBlockSupport( blockNameOrType, indicator );\n\n\t\tif ( skipSerialization === true ) {\n\t\t\tstyle = omitStyle( style, path );\n\t\t}\n\n\t\tif ( Array.isArray( skipSerialization ) ) {\n\t\t\tskipSerialization.forEach( ( featureName ) => {\n\t\t\t\tconst feature = renamedFeatures[ featureName ] || featureName;\n\t\t\t\tstyle = omitStyle( style, [ [ ...path, feature ] ] );\n\t\t\t} );\n\t\t}\n\t} );\n\n\tprops.style = {\n\t\t...getInlineStyles( style ),\n\t\t...props.style,\n\t};\n\n\treturn props;\n}\n\nfunction BlockStyleControls( {\n\tclientId,\n\tname,\n\tsetAttributes,\n\t__unstableParentLayout,\n} ) {\n\tconst settings = useBlockSettings( name, __unstableParentLayout );\n\tconst blockEditingMode = useBlockEditingMode();\n\tconst passedProps = {\n\t\tclientId,\n\t\tname,\n\t\tsetAttributes,\n\t\tsettings: {\n\t\t\t...settings,\n\t\t\ttypography: {\n\t\t\t\t...settings.typography,\n\t\t\t\t// The text alignment UI for individual blocks is rendered in\n\t\t\t\t// the block toolbar, so disable it here.\n\t\t\t\ttextAlign: false,\n\t\t\t},\n\t\t},\n\t};\n\tif ( blockEditingMode !== 'default' ) {\n\t\treturn null;\n\t}\n\treturn (\n\t\t<>\n\t\t\t<ColorEdit { ...passedProps } />\n\t\t\t<BackgroundImagePanel { ...passedProps } />\n\t\t\t<TypographyPanel { ...passedProps } />\n\t\t\t<BorderPanel { ...passedProps } />\n\t\t\t<DimensionsPanel { ...passedProps } />\n\t\t</>\n\t);\n}\n\nexport default {\n\tedit: BlockStyleControls,\n\thasSupport: hasStyleSupport,\n\taddSaveProps,\n\tattributeKeys: [ 'style' ],\n\tuseBlockProps,\n};\n\n// Defines which element types are supported, including their hover styles or\n// any other elements that have been included under a single element type\n// e.g. heading and h1-h6.\nconst elementTypes = [\n\t{ elementType: 'button' },\n\t{ elementType: 'link', pseudo: [ ':hover' ] },\n\t{\n\t\telementType: 'heading',\n\t\telements: [ 'h1', 'h2', 'h3', 'h4', 'h5', 'h6' ],\n\t},\n];\n\n// Used for generating the instance ID\nconst STYLE_BLOCK_PROPS_REFERENCE = {};\n\nfunction useBlockProps( { name, style } ) {\n\tconst blockElementsContainerIdentifier = useInstanceId(\n\t\tSTYLE_BLOCK_PROPS_REFERENCE,\n\t\t'wp-elements'\n\t);\n\n\tconst baseElementSelector = `.${ blockElementsContainerIdentifier }`;\n\tconst blockElementStyles = style?.elements;\n\n\tconst styles = useMemo( () => {\n\t\tif ( ! blockElementStyles ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst elementCSSRules = [];\n\n\t\telementTypes.forEach( ( { elementType, pseudo, elements } ) => {\n\t\t\tconst skipSerialization = shouldSkipSerialization(\n\t\t\t\tname,\n\t\t\t\tCOLOR_SUPPORT_KEY,\n\t\t\t\telementType\n\t\t\t);\n\n\t\t\tif ( skipSerialization ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst elementStyles = blockElementStyles?.[ elementType ];\n\n\t\t\t// Process primary element type styles.\n\t\t\tif ( elementStyles ) {\n\t\t\t\tconst selector = scopeSelector(\n\t\t\t\t\tbaseElementSelector,\n\t\t\t\t\tELEMENTS[ elementType ]\n\t\t\t\t);\n\n\t\t\t\telementCSSRules.push(\n\t\t\t\t\tcompileCSS( elementStyles, { selector } )\n\t\t\t\t);\n\n\t\t\t\t// Process any interactive states for the element type.\n\t\t\t\tif ( pseudo ) {\n\t\t\t\t\tpseudo.forEach( ( pseudoSelector ) => {\n\t\t\t\t\t\tif ( elementStyles[ pseudoSelector ] ) {\n\t\t\t\t\t\t\telementCSSRules.push(\n\t\t\t\t\t\t\t\tcompileCSS( elementStyles[ pseudoSelector ], {\n\t\t\t\t\t\t\t\t\tselector: scopeSelector(\n\t\t\t\t\t\t\t\t\t\tbaseElementSelector,\n\t\t\t\t\t\t\t\t\t\t`${ ELEMENTS[ elementType ] }${ pseudoSelector }`\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Process related elements e.g. h1-h6 for headings\n\t\t\tif ( elements ) {\n\t\t\t\telements.forEach( ( element ) => {\n\t\t\t\t\tif ( blockElementStyles[ element ] ) {\n\t\t\t\t\t\telementCSSRules.push(\n\t\t\t\t\t\t\tcompileCSS( blockElementStyles[ element ], {\n\t\t\t\t\t\t\t\tselector: scopeSelector(\n\t\t\t\t\t\t\t\t\tbaseElementSelector,\n\t\t\t\t\t\t\t\t\tELEMENTS[ element ]\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\n\t\treturn elementCSSRules.length > 0\n\t\t\t? elementCSSRules.join( '' )\n\t\t\t: undefined;\n\t}, [ baseElementSelector, blockElementStyles, name ] );\n\n\tuseStyleOverride( { css: styles } );\n\n\treturn addSaveProps(\n\t\t{ className: blockElementsContainerIdentifier },\n\t\tname,\n\t\t{ style },\n\t\tskipSerializationPathsEdit\n\t);\n}\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/style/addAttribute',\n\taddAttribute\n);\n"],"mappings":";;;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAKA,IAAAG,QAAA,GAAAH,OAAA;AACA,I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U,EAAEL,aAAa,CAAEM,cAAc,CAAE,EAAE;gBAC5CL,QAAQ,EAAE,IAAAC,qBAAa,EACtBP,mBAAmB,EACnB,GAAIQ,+BAAQ,CAAEd,WAAW,CAAE,GAAKiB,cAAc,EAC/C;cACD,CAAE,CACH,CAAC;YACF;UACD,CAAE,CAAC;QACJ;MACD;;MAEA;MACA,IAAKf,QAAQ,EAAG;QACfA,QAAQ,CAACtE,OAAO,CAAIsF,OAAO,IAAM;UAChC,IAAKX,kBAAkB,CAAEW,OAAO,CAAE,EAAG;YACpCT,eAAe,CAACM,IAAI,CACnB,IAAAC,uBAAU,EAAET,kBAAkB,CAAEW,OAAO,CAAE,EAAE;cAC1CN,QAAQ,EAAE,IAAAC,qBAAa,EACtBP,mBAAmB,EACnBQ,+BAAQ,CAAEI,OAAO,CAClB;YACD,CAAE,CACH,CAAC;UACF;QACD,CAAE,CAAC;MACJ;IACD,CAAE,CAAC;IAEH,OAAOT,eAAe,CAAClD,MAAM,GAAG,CAAC,GAC9BkD,eAAe,CAACU,IAAI,CAAE,EAAG,CAAC,GAC1BC,SAAS;EACb,CAAC,EAAE,CAAEd,mBAAmB,EAAEC,kBAAkB,EAAEjC,IAAI,CAAG,CAAC;EAEtD,IAAA+C,uBAAgB,EAAE;IAAEC,GAAG,EAAE7F;EAAO,CAAE,CAAC;EAEnC,OAAOiC,YAAY,CAClB;IAAE6D,SAAS,EAAEnB;EAAiC,CAAC,EAC/C9B,IAAI,EACJ;IAAEpC;EAAM,CAAC,EACTI,0BACD,CAAC;AACF;AAEA,IAAAkF,gBAAS,EACR,0BAA0B,EAC1B,yBAAyB,EACzBzF,YACD,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_element","require","_hooks","_blocks","_compose","_styleEngine","_background","_border","_color","_typography","_dimensions","_utils","_utils2","_blockEditingMode","_jsxRuntime","styleSupportKeys","TYPOGRAPHY_SUPPORT_KEYS","BORDER_SUPPORT_KEY","COLOR_SUPPORT_KEY","DIMENSIONS_SUPPORT_KEY","BACKGROUND_SUPPORT_KEY","SPACING_SUPPORT_KEY","SHADOW_SUPPORT_KEY","hasStyleSupport","nameOrType","some","key","hasBlockSupport","getInlineStyles","styles","output","getCSSRules","forEach","rule","value","addAttribute","settings","attributes","style","Object","assign","type","skipSerializationPathsEdit","TYPOGRAPHY_SUPPORT_KEY","skipSerializationPathsSave","skipSerializationPathsSaveChecks","renamedFeatures","gradients","omitStyle","paths","preserveReference","newStyle","JSON","parse","stringify","Array","isArray","path","split","length","firstSubpath","restPath","addSaveProps","props","blockNameOrType","skipPaths","entries","indicator","skipSerialization","getBlockSupport","featureName","feature","BlockStyleControls","clientId","name","setAttributes","__unstableParentLayout","useBlockSettings","blockEditingMode","useBlockEditingMode","passedProps","typography","textAlign","jsxs","Fragment","children","jsx","ColorEdit","BackgroundImagePanel","TypographyPanel","BorderPanel","DimensionsPanel","_default","exports","default","edit","hasSupport","attributeKeys","useBlockProps","elementTypes","elementType","pseudo","elements","STYLE_BLOCK_PROPS_REFERENCE","blockElementsContainerIdentifier","useInstanceId","baseElementSelector","blockElementStyles","useMemo","elementCSSRules","shouldSkipSerialization","elementStyles","selector","scopeSelector","ELEMENTS","push","compileCSS","pseudoSelector","element","join","undefined","useStyleOverride","css","className","addFilter"],"sources":["@wordpress/block-editor/src/hooks/style.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { addFilter } from '@wordpress/hooks';\nimport {\n\tgetBlockSupport,\n\thasBlockSupport,\n\t__EXPERIMENTAL_ELEMENTS as ELEMENTS,\n} from '@wordpress/blocks';\nimport { useInstanceId } from '@wordpress/compose';\nimport { getCSSRules, compileCSS } from '@wordpress/style-engine';\n\n/**\n * Internal dependencies\n */\nimport { BACKGROUND_SUPPORT_KEY, BackgroundImagePanel } from './background';\nimport { BORDER_SUPPORT_KEY, BorderPanel, SHADOW_SUPPORT_KEY } from './border';\nimport { COLOR_SUPPORT_KEY, ColorEdit } from './color';\nimport {\n\tTypographyPanel,\n\tTYPOGRAPHY_SUPPORT_KEY,\n\tTYPOGRAPHY_SUPPORT_KEYS,\n} from './typography';\nimport {\n\tDIMENSIONS_SUPPORT_KEY,\n\tSPACING_SUPPORT_KEY,\n\tDimensionsPanel,\n} from './dimensions';\nimport {\n\tshouldSkipSerialization,\n\tuseStyleOverride,\n\tuseBlockSettings,\n} from './utils';\nimport { scopeSelector } from '../components/global-styles/utils';\nimport { useBlockEditingMode } from '../components/block-editing-mode';\n\nconst styleSupportKeys = [\n\t...TYPOGRAPHY_SUPPORT_KEYS,\n\tBORDER_SUPPORT_KEY,\n\tCOLOR_SUPPORT_KEY,\n\tDIMENSIONS_SUPPORT_KEY,\n\tBACKGROUND_SUPPORT_KEY,\n\tSPACING_SUPPORT_KEY,\n\tSHADOW_SUPPORT_KEY,\n];\n\nconst hasStyleSupport = ( nameOrType ) =>\n\tstyleSupportKeys.some( ( key ) => hasBlockSupport( nameOrType, key ) );\n\n/**\n * Returns the inline styles to add depending on the style object\n *\n * @param {Object} styles Styles configuration.\n *\n * @return {Object} Flattened CSS variables declaration.\n */\nexport function getInlineStyles( styles = {} ) {\n\tconst output = {};\n\t// The goal is to move everything to server side generated engine styles\n\t// This is temporary as we absorb more and more styles into the engine.\n\tgetCSSRules( styles ).forEach( ( rule ) => {\n\t\toutput[ rule.key ] = rule.value;\n\t} );\n\n\treturn output;\n}\n\n/**\n * Filters registered block settings, extending attributes to include `style` attribute.\n *\n * @param {Object} settings Original block settings.\n *\n * @return {Object} Filtered block settings.\n */\nfunction addAttribute( settings ) {\n\tif ( ! hasStyleSupport( settings ) ) {\n\t\treturn settings;\n\t}\n\n\t// Allow blocks to specify their own attribute definition with default values if needed.\n\tif ( ! settings.attributes.style ) {\n\t\tObject.assign( settings.attributes, {\n\t\t\tstyle: {\n\t\t\t\ttype: 'object',\n\t\t\t},\n\t\t} );\n\t}\n\n\treturn settings;\n}\n\n/**\n * A dictionary of paths to flag skipping block support serialization as the key,\n * with values providing the style paths to be omitted from serialization.\n *\n * @constant\n * @type {Record<string, string[]>}\n */\nconst skipSerializationPathsEdit = {\n\t[ `${ BORDER_SUPPORT_KEY }.skipSerialization` ]: [ 'border' ],\n\t[ `${ COLOR_SUPPORT_KEY }.skipSerialization` ]: [ COLOR_SUPPORT_KEY ],\n\t[ `${ TYPOGRAPHY_SUPPORT_KEY }.skipSerialization` ]: [\n\t\tTYPOGRAPHY_SUPPORT_KEY,\n\t],\n\t[ `${ DIMENSIONS_SUPPORT_KEY }.skipSerialization` ]: [\n\t\tDIMENSIONS_SUPPORT_KEY,\n\t],\n\t[ `${ SPACING_SUPPORT_KEY }.skipSerialization` ]: [ SPACING_SUPPORT_KEY ],\n\t[ `${ SHADOW_SUPPORT_KEY }.skipSerialization` ]: [ SHADOW_SUPPORT_KEY ],\n};\n\n/**\n * A dictionary of paths to flag skipping block support serialization as the key,\n * with values providing the style paths to be omitted from serialization.\n *\n * Extends the Edit skip paths to enable skipping additional paths in just\n * the Save component. This allows a block support to be serialized within the\n * editor, while using an alternate approach, such as server-side rendering, when\n * the support is saved.\n *\n * @constant\n * @type {Record<string, string[]>}\n */\nconst skipSerializationPathsSave = {\n\t...skipSerializationPathsEdit,\n\t[ `${ DIMENSIONS_SUPPORT_KEY }.aspectRatio` ]: [\n\t\t`${ DIMENSIONS_SUPPORT_KEY }.aspectRatio`,\n\t], // Skip serialization of aspect ratio in save mode.\n\t[ `${ BACKGROUND_SUPPORT_KEY }` ]: [ BACKGROUND_SUPPORT_KEY ], // Skip serialization of background support in save mode.\n};\n\nconst skipSerializationPathsSaveChecks = {\n\t[ `${ DIMENSIONS_SUPPORT_KEY }.aspectRatio` ]: true,\n\t[ `${ BACKGROUND_SUPPORT_KEY }` ]: true,\n};\n\n/**\n * A dictionary used to normalize feature names between support flags, style\n * object properties and __experimentSkipSerialization configuration arrays.\n *\n * This allows not having to provide a migration for a support flag and possible\n * backwards compatibility bridges, while still achieving consistency between\n * the support flag and the skip serialization array.\n *\n * @constant\n * @type {Record<string, string>}\n */\nconst renamedFeatures = { gradients: 'gradient' };\n\n/**\n * A utility function used to remove one or more paths from a style object.\n * Works in a way similar to Lodash's `omit()`. See unit tests and examples below.\n *\n * It supports a single string path:\n *\n * ```\n * omitStyle( { color: 'red' }, 'color' ); // {}\n * ```\n *\n * or an array of paths:\n *\n * ```\n * omitStyle( { color: 'red', background: '#fff' }, [ 'color', 'background' ] ); // {}\n * ```\n *\n * It also allows you to specify paths at multiple levels in a string.\n *\n * ```\n * omitStyle( { typography: { textDecoration: 'underline' } }, 'typography.textDecoration' ); // {}\n * ```\n *\n * You can remove multiple paths at the same time:\n *\n * ```\n * omitStyle(\n * \t\t{\n * \t\t\ttypography: {\n * \t\t\t\ttextDecoration: 'underline',\n * \t\t\t\ttextTransform: 'uppercase',\n * \t\t\t}\n *\t\t},\n *\t\t[\n * \t\t\t'typography.textDecoration',\n * \t\t\t'typography.textTransform',\n *\t\t]\n * );\n * // {}\n * ```\n *\n * You can also specify nested paths as arrays:\n *\n * ```\n * omitStyle(\n * \t\t{\n * \t\t\ttypography: {\n * \t\t\t\ttextDecoration: 'underline',\n * \t\t\t\ttextTransform: 'uppercase',\n * \t\t\t}\n *\t\t},\n *\t\t[\n * \t\t\t[ 'typography', 'textDecoration' ],\n * \t\t\t[ 'typography', 'textTransform' ],\n *\t\t]\n * );\n * // {}\n * ```\n *\n * With regards to nesting of styles, infinite depth is supported:\n *\n * ```\n * omitStyle(\n * \t\t{\n * \t\t\tborder: {\n * \t\t\t\tradius: {\n * \t\t\t\t\ttopLeft: '10px',\n * \t\t\t\t\ttopRight: '0.5rem',\n * \t\t\t\t}\n * \t\t\t}\n *\t\t},\n *\t\t[\n * \t\t\t[ 'border', 'radius', 'topRight' ],\n *\t\t]\n * );\n * // { border: { radius: { topLeft: '10px' } } }\n * ```\n *\n * The third argument, `preserveReference`, defines how to treat the input style object.\n * It is mostly necessary to properly handle mutation when recursively handling the style object.\n * Defaulting to `false`, this will always create a new object, avoiding to mutate `style`.\n * However, when recursing, we change that value to `true` in order to work with a single copy\n * of the original style object.\n *\n * @see https://lodash.com/docs/4.17.15#omit\n *\n * @param {Object} style Styles object.\n * @param {Array|string} paths Paths to remove.\n * @param {boolean} preserveReference True to mutate the `style` object, false otherwise.\n * @return {Object} Styles object with the specified paths removed.\n */\nexport function omitStyle( style, paths, preserveReference = false ) {\n\tif ( ! style ) {\n\t\treturn style;\n\t}\n\n\tlet newStyle = style;\n\tif ( ! preserveReference ) {\n\t\tnewStyle = JSON.parse( JSON.stringify( style ) );\n\t}\n\n\tif ( ! Array.isArray( paths ) ) {\n\t\tpaths = [ paths ];\n\t}\n\n\tpaths.forEach( ( path ) => {\n\t\tif ( ! Array.isArray( path ) ) {\n\t\t\tpath = path.split( '.' );\n\t\t}\n\n\t\tif ( path.length > 1 ) {\n\t\t\tconst [ firstSubpath, ...restPath ] = path;\n\t\t\tomitStyle( newStyle[ firstSubpath ], [ restPath ], true );\n\t\t} else if ( path.length === 1 ) {\n\t\t\tdelete newStyle[ path[ 0 ] ];\n\t\t}\n\t} );\n\n\treturn newStyle;\n}\n\n/**\n * Override props assigned to save component to inject the CSS variables definition.\n *\n * @param {Object} props Additional props applied to save element.\n * @param {Object|string} blockNameOrType Block type.\n * @param {Object} attributes Block attributes.\n * @param {?Record<string, string[]>} skipPaths An object of keys and paths to skip serialization.\n *\n * @return {Object} Filtered props applied to save element.\n */\nexport function addSaveProps(\n\tprops,\n\tblockNameOrType,\n\tattributes,\n\tskipPaths = skipSerializationPathsSave\n) {\n\tif ( ! hasStyleSupport( blockNameOrType ) ) {\n\t\treturn props;\n\t}\n\n\tlet { style } = attributes;\n\tObject.entries( skipPaths ).forEach( ( [ indicator, path ] ) => {\n\t\tconst skipSerialization =\n\t\t\tskipSerializationPathsSaveChecks[ indicator ] ||\n\t\t\tgetBlockSupport( blockNameOrType, indicator );\n\n\t\tif ( skipSerialization === true ) {\n\t\t\tstyle = omitStyle( style, path );\n\t\t}\n\n\t\tif ( Array.isArray( skipSerialization ) ) {\n\t\t\tskipSerialization.forEach( ( featureName ) => {\n\t\t\t\tconst feature = renamedFeatures[ featureName ] || featureName;\n\t\t\t\tstyle = omitStyle( style, [ [ ...path, feature ] ] );\n\t\t\t} );\n\t\t}\n\t} );\n\n\tprops.style = {\n\t\t...getInlineStyles( style ),\n\t\t...props.style,\n\t};\n\n\treturn props;\n}\n\nfunction BlockStyleControls( {\n\tclientId,\n\tname,\n\tsetAttributes,\n\t__unstableParentLayout,\n} ) {\n\tconst settings = useBlockSettings( name, __unstableParentLayout );\n\tconst blockEditingMode = useBlockEditingMode();\n\tconst passedProps = {\n\t\tclientId,\n\t\tname,\n\t\tsetAttributes,\n\t\tsettings: {\n\t\t\t...settings,\n\t\t\ttypography: {\n\t\t\t\t...settings.typography,\n\t\t\t\t// The text alignment UI for individual blocks is rendered in\n\t\t\t\t// the block toolbar, so disable it here.\n\t\t\t\ttextAlign: false,\n\t\t\t},\n\t\t},\n\t};\n\tif ( blockEditingMode !== 'default' ) {\n\t\treturn null;\n\t}\n\treturn (\n\t\t<>\n\t\t\t<ColorEdit { ...passedProps } />\n\t\t\t<BackgroundImagePanel { ...passedProps } />\n\t\t\t<TypographyPanel { ...passedProps } />\n\t\t\t<BorderPanel { ...passedProps } />\n\t\t\t<DimensionsPanel { ...passedProps } />\n\t\t</>\n\t);\n}\n\nexport default {\n\tedit: BlockStyleControls,\n\thasSupport: hasStyleSupport,\n\taddSaveProps,\n\tattributeKeys: [ 'style' ],\n\tuseBlockProps,\n};\n\n// Defines which element types are supported, including their hover styles or\n// any other elements that have been included under a single element type\n// e.g. heading and h1-h6.\nconst elementTypes = [\n\t{ elementType: 'button' },\n\t{ elementType: 'link', pseudo: [ ':hover' ] },\n\t{\n\t\telementType: 'heading',\n\t\telements: [ 'h1', 'h2', 'h3', 'h4', 'h5', 'h6' ],\n\t},\n];\n\n// Used for generating the instance ID\nconst STYLE_BLOCK_PROPS_REFERENCE = {};\n\nfunction useBlockProps( { name, style } ) {\n\tconst blockElementsContainerIdentifier = useInstanceId(\n\t\tSTYLE_BLOCK_PROPS_REFERENCE,\n\t\t'wp-elements'\n\t);\n\n\tconst baseElementSelector = `.${ blockElementsContainerIdentifier }`;\n\tconst blockElementStyles = style?.elements;\n\n\tconst styles = useMemo( () => {\n\t\tif ( ! blockElementStyles ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst elementCSSRules = [];\n\n\t\telementTypes.forEach( ( { elementType, pseudo, elements } ) => {\n\t\t\tconst skipSerialization = shouldSkipSerialization(\n\t\t\t\tname,\n\t\t\t\tCOLOR_SUPPORT_KEY,\n\t\t\t\telementType\n\t\t\t);\n\n\t\t\tif ( skipSerialization ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst elementStyles = blockElementStyles?.[ elementType ];\n\n\t\t\t// Process primary element type styles.\n\t\t\tif ( elementStyles ) {\n\t\t\t\tconst selector = scopeSelector(\n\t\t\t\t\tbaseElementSelector,\n\t\t\t\t\tELEMENTS[ elementType ]\n\t\t\t\t);\n\n\t\t\t\telementCSSRules.push(\n\t\t\t\t\tcompileCSS( elementStyles, { selector } )\n\t\t\t\t);\n\n\t\t\t\t// Process any interactive states for the element type.\n\t\t\t\tif ( pseudo ) {\n\t\t\t\t\tpseudo.forEach( ( pseudoSelector ) => {\n\t\t\t\t\t\tif ( elementStyles[ pseudoSelector ] ) {\n\t\t\t\t\t\t\telementCSSRules.push(\n\t\t\t\t\t\t\t\tcompileCSS( elementStyles[ pseudoSelector ], {\n\t\t\t\t\t\t\t\t\tselector: scopeSelector(\n\t\t\t\t\t\t\t\t\t\tbaseElementSelector,\n\t\t\t\t\t\t\t\t\t\t`${ ELEMENTS[ elementType ] }${ pseudoSelector }`\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Process related elements e.g. h1-h6 for headings\n\t\t\tif ( elements ) {\n\t\t\t\telements.forEach( ( element ) => {\n\t\t\t\t\tif ( blockElementStyles[ element ] ) {\n\t\t\t\t\t\telementCSSRules.push(\n\t\t\t\t\t\t\tcompileCSS( blockElementStyles[ element ], {\n\t\t\t\t\t\t\t\tselector: scopeSelector(\n\t\t\t\t\t\t\t\t\tbaseElementSelector,\n\t\t\t\t\t\t\t\t\tELEMENTS[ element ]\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\n\t\treturn elementCSSRules.length > 0\n\t\t\t? elementCSSRules.join( '' )\n\t\t\t: undefined;\n\t}, [ baseElementSelector, blockElementStyles, name ] );\n\n\tuseStyleOverride( { css: styles } );\n\n\treturn addSaveProps(\n\t\t{ className: blockElementsContainerIdentifier },\n\t\tname,\n\t\t{ style },\n\t\tskipSerializationPathsEdit\n\t);\n}\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/style/addAttribute',\n\taddAttribute\n);\n"],"mappings":";;;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAKA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AAKA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,WAAA,GAAAR,OAAA;AAKA,IAAAS,WAAA,GAAAT,OAAA;AAKA,IAAAU,MAAA,GAAAV,OAAA;AAKA,IAAAW,OAAA,GAAAX,OAAA;AACA,IAAAY,iBAAA,GAAAZ,OAAA;AAAuE,IAAAa,WAAA,GAAAb,OAAA;AAnCvE;AACA;AACA;;AAWA;AACA;AACA;;AAsBA,MAAMc,gBAAgB,GAAG,CACxB,GAAGC,mCAAuB,EAC1BC,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;EACD,CAAE,GAAIE,+BAAmB,oBAAqB,GAAI,CAAEA,+BAAmB,CAAE;EACzE,CAAE,GAAIC,0BAAkB,oBAAqB,GAAI,CAAEA,0BAAkB;AACtE,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMsB,0BAA0B,GAAG;EAClC,GAAGF,0BAA0B;EAC7B,CAAE,GAAIvB,kCAAsB,cAAe,GAAI,CAC9C,GAAIA,kCAAsB,cAAe,CACzC;EAAE;EACH,CAAE,GAAIC,kCAAsB,EAAG,GAAI,CAAEA,kCAAsB,CAAE,CAAE;AAChE,CAAC;AAED,MAAMyB,gCAAgC,GAAG;EACxC,CAAE,GAAI1B,kCAAsB,cAAe,GAAI,IAAI;EACnD,CAAE,GAAIC,kCAAsB,EAAG,GAAI;AACpC,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM0B,eAAe,GAAG;EAAEC,SAAS,EAAE;AAAW,CAAC;;AAEjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,SAASA,CAAEV,KAAK,EAAEW,KAAK,EAAEC,iBAAiB,GAAG,KAAK,EAAG;EACpE,IAAK,CAAEZ,KAAK,EAAG;IACd,OAAOA,KAAK;EACb;EAEA,IAAIa,QAAQ,GA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,EAAE;cAC1CN,QAAQ,EAAE,IAAAC,qBAAa,EACtBP,mBAAmB,EACnBQ,+BAAQ,CAAEI,OAAO,CAClB;YACD,CAAE,CACH,CAAC;UACF;QACD,CAAE,CAAC;MACJ;IACD,CAAE,CAAC;IAEH,OAAOT,eAAe,CAAClD,MAAM,GAAG,CAAC,GAC9BkD,eAAe,CAACU,IAAI,CAAE,EAAG,CAAC,GAC1BC,SAAS;EACb,CAAC,EAAE,CAAEd,mBAAmB,EAAEC,kBAAkB,EAAEjC,IAAI,CAAG,CAAC;EAEtD,IAAA+C,uBAAgB,EAAE;IAAEC,GAAG,EAAE7F;EAAO,CAAE,CAAC;EAEnC,OAAOiC,YAAY,CAClB;IAAE6D,SAAS,EAAEnB;EAAiC,CAAC,EAC/C9B,IAAI,EACJ;IAAEpC;EAAM,CAAC,EACTI,0BACD,CAAC;AACF;AAEA,IAAAkF,gBAAS,EACR,0BAA0B,EAC1B,yBAAyB,EACzBzF,YACD,CAAC","ignoreList":[]}
|
package/build/hooks/supports.js
CHANGED
|
@@ -14,7 +14,7 @@ var _element = require("@wordpress/element");
|
|
|
14
14
|
|
|
15
15
|
const ALIGN_SUPPORT_KEY = 'align';
|
|
16
16
|
const ALIGN_WIDE_SUPPORT_KEY = 'alignWide';
|
|
17
|
-
const BORDER_SUPPORT_KEY = '
|
|
17
|
+
const BORDER_SUPPORT_KEY = 'border';
|
|
18
18
|
const COLOR_SUPPORT_KEY = 'color';
|
|
19
19
|
const CUSTOM_CLASS_NAME_SUPPORT_KEY = 'customClassName';
|
|
20
20
|
const FONT_FAMILY_SUPPORT_KEY = 'typography.fontFamily';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_blocks","require","_element","ALIGN_SUPPORT_KEY","ALIGN_WIDE_SUPPORT_KEY","BORDER_SUPPORT_KEY","COLOR_SUPPORT_KEY","CUSTOM_CLASS_NAME_SUPPORT_KEY","FONT_FAMILY_SUPPORT_KEY","FONT_SIZE_SUPPORT_KEY","LINE_HEIGHT_SUPPORT_KEY","FONT_STYLE_SUPPORT_KEY","FONT_WEIGHT_SUPPORT_KEY","TEXT_ALIGN_SUPPORT_KEY","TEXT_COLUMNS_SUPPORT_KEY","TEXT_DECORATION_SUPPORT_KEY","WRITING_MODE_SUPPORT_KEY","TEXT_TRANSFORM_SUPPORT_KEY","LETTER_SPACING_SUPPORT_KEY","LAYOUT_SUPPORT_KEY","TYPOGRAPHY_SUPPORT_KEYS","EFFECTS_SUPPORT_KEYS","SPACING_SUPPORT_KEY","styleSupportKeys","hasAlignSupport","nameOrType","hasBlockSupport","exports","getAlignSupport","getBlockSupport","hasAlignWideSupport","getAlignWideSupport","hasBorderSupport","feature","Platform","OS","support","color","radius","width","style","getBorderSupport","hasColorSupport","colorSupport","link","gradient","background","text","hasLinkColorSupport","hasGradientSupport","gradients","hasBackgroundColorSupport","hasTextAlignSupport","getTextAlignSupport","hasTextColorSupport","getColorSupport","hasCustomClassNameSupport","getCustomClassNameSupport","hasFontFamilySupport","getFontFamilySupport","hasFontSizeSupport","getFontSizeSupport","hasLayoutSupport","getLayoutSupport","hasStyleSupport","some","key"],"sources":["@wordpress/block-editor/src/hooks/supports.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { getBlockSupport, hasBlockSupport } from '@wordpress/blocks';\nimport { Platform } from '@wordpress/element';\n\nconst ALIGN_SUPPORT_KEY = 'align';\nconst ALIGN_WIDE_SUPPORT_KEY = 'alignWide';\nconst BORDER_SUPPORT_KEY = '__experimentalBorder';\nconst COLOR_SUPPORT_KEY = 'color';\nconst CUSTOM_CLASS_NAME_SUPPORT_KEY = 'customClassName';\nconst FONT_FAMILY_SUPPORT_KEY = 'typography.fontFamily';\nconst FONT_SIZE_SUPPORT_KEY = 'typography.fontSize';\nconst LINE_HEIGHT_SUPPORT_KEY = 'typography.lineHeight';\n/**\n * Key within block settings' support array indicating support for font style.\n */\nconst FONT_STYLE_SUPPORT_KEY = 'typography.fontStyle';\n/**\n * Key within block settings' support array indicating support for font weight.\n */\nconst FONT_WEIGHT_SUPPORT_KEY = 'typography.fontWeight';\n/**\n * Key within block settings' supports array indicating support for text\n * align e.g. settings found in `block.json`.\n */\nconst TEXT_ALIGN_SUPPORT_KEY = 'typography.textAlign';\n/**\n * Key within block settings' supports array indicating support for text\n * columns e.g. settings found in `block.json`.\n */\nconst TEXT_COLUMNS_SUPPORT_KEY = 'typography.textColumns';\n/**\n * Key within block settings' supports array indicating support for text\n * decorations e.g. settings found in `block.json`.\n */\nconst TEXT_DECORATION_SUPPORT_KEY = 'typography.textDecoration';\n/**\n * Key within block settings' supports array indicating support for writing mode\n * e.g. settings found in `block.json`.\n */\nconst WRITING_MODE_SUPPORT_KEY = 'typography.__experimentalWritingMode';\n/**\n * Key within block settings' supports array indicating support for text\n * transforms e.g. settings found in `block.json`.\n */\nconst TEXT_TRANSFORM_SUPPORT_KEY = 'typography.textTransform';\n\n/**\n * Key within block settings' supports array indicating support for letter-spacing\n * e.g. settings found in `block.json`.\n */\nconst LETTER_SPACING_SUPPORT_KEY = 'typography.letterSpacing';\nconst LAYOUT_SUPPORT_KEY = 'layout';\nconst TYPOGRAPHY_SUPPORT_KEYS = [\n\tLINE_HEIGHT_SUPPORT_KEY,\n\tFONT_SIZE_SUPPORT_KEY,\n\tFONT_STYLE_SUPPORT_KEY,\n\tFONT_WEIGHT_SUPPORT_KEY,\n\tFONT_FAMILY_SUPPORT_KEY,\n\tTEXT_ALIGN_SUPPORT_KEY,\n\tTEXT_COLUMNS_SUPPORT_KEY,\n\tTEXT_DECORATION_SUPPORT_KEY,\n\tTEXT_TRANSFORM_SUPPORT_KEY,\n\tWRITING_MODE_SUPPORT_KEY,\n\tLETTER_SPACING_SUPPORT_KEY,\n];\nconst EFFECTS_SUPPORT_KEYS = [ 'shadow' ];\nconst SPACING_SUPPORT_KEY = 'spacing';\nconst styleSupportKeys = [\n\t...EFFECTS_SUPPORT_KEYS,\n\t...TYPOGRAPHY_SUPPORT_KEYS,\n\tBORDER_SUPPORT_KEY,\n\tCOLOR_SUPPORT_KEY,\n\tSPACING_SUPPORT_KEY,\n];\n\n/**\n * Returns true if the block defines support for align.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasAlignSupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, ALIGN_SUPPORT_KEY );\n\n/**\n * Returns the block support value for align, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getAlignSupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, ALIGN_SUPPORT_KEY );\n\n/**\n * Returns true if the block defines support for align wide.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasAlignWideSupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, ALIGN_WIDE_SUPPORT_KEY );\n\n/**\n * Returns the block support value for align wide, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getAlignWideSupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, ALIGN_WIDE_SUPPORT_KEY );\n\n/**\n * Determine whether there is block support for border properties.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @param {string} feature Border feature to check support for.\n *\n * @return {boolean} Whether there is support.\n */\nexport function hasBorderSupport( nameOrType, feature = 'any' ) {\n\tif ( Platform.OS !== 'web' ) {\n\t\treturn false;\n\t}\n\n\tconst support = getBlockSupport( nameOrType, BORDER_SUPPORT_KEY );\n\n\tif ( support === true ) {\n\t\treturn true;\n\t}\n\n\tif ( feature === 'any' ) {\n\t\treturn !! (\n\t\t\tsupport?.color ||\n\t\t\tsupport?.radius ||\n\t\t\tsupport?.width ||\n\t\t\tsupport?.style\n\t\t);\n\t}\n\n\treturn !! support?.[ feature ];\n}\n\n/**\n * Get block support for border properties.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @param {string} feature Border feature to get.\n *\n * @return {unknown} The block support.\n */\nexport const getBorderSupport = ( nameOrType, feature ) =>\n\tgetBlockSupport( nameOrType, [ BORDER_SUPPORT_KEY, feature ] );\n\n/**\n * Returns true if the block defines support for color.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasColorSupport = ( nameOrType ) => {\n\tconst colorSupport = getBlockSupport( nameOrType, COLOR_SUPPORT_KEY );\n\treturn (\n\t\tcolorSupport &&\n\t\t( colorSupport.link === true ||\n\t\t\tcolorSupport.gradient === true ||\n\t\t\tcolorSupport.background !== false ||\n\t\t\tcolorSupport.text !== false )\n\t);\n};\n\n/**\n * Returns true if the block defines support for link color.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasLinkColorSupport = ( nameOrType ) => {\n\tif ( Platform.OS !== 'web' ) {\n\t\treturn false;\n\t}\n\n\tconst colorSupport = getBlockSupport( nameOrType, COLOR_SUPPORT_KEY );\n\n\treturn (\n\t\tcolorSupport !== null &&\n\t\ttypeof colorSupport === 'object' &&\n\t\t!! colorSupport.link\n\t);\n};\n\n/**\n * Returns true if the block defines support for gradient color.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasGradientSupport = ( nameOrType ) => {\n\tconst colorSupport = getBlockSupport( nameOrType, COLOR_SUPPORT_KEY );\n\n\treturn (\n\t\tcolorSupport !== null &&\n\t\ttypeof colorSupport === 'object' &&\n\t\t!! colorSupport.gradients\n\t);\n};\n\n/**\n * Returns true if the block defines support for background color.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasBackgroundColorSupport = ( nameOrType ) => {\n\tconst colorSupport = getBlockSupport( nameOrType, COLOR_SUPPORT_KEY );\n\n\treturn colorSupport && colorSupport.background !== false;\n};\n\n/**\n * Returns true if the block defines support for text-align.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasTextAlignSupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, TEXT_ALIGN_SUPPORT_KEY );\n\n/**\n * Returns the block support value for text-align, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getTextAlignSupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, TEXT_ALIGN_SUPPORT_KEY );\n\n/**\n * Returns true if the block defines support for background color.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasTextColorSupport = ( nameOrType ) => {\n\tconst colorSupport = getBlockSupport( nameOrType, COLOR_SUPPORT_KEY );\n\n\treturn colorSupport && colorSupport.text !== false;\n};\n\n/**\n * Get block support for color properties.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @param {string} feature Color feature to get.\n *\n * @return {unknown} The block support.\n */\nexport const getColorSupport = ( nameOrType, feature ) =>\n\tgetBlockSupport( nameOrType, [ COLOR_SUPPORT_KEY, feature ] );\n\n/**\n * Returns true if the block defines support for custom class name.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasCustomClassNameSupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, CUSTOM_CLASS_NAME_SUPPORT_KEY, true );\n\n/**\n * Returns the block support value for custom class name, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getCustomClassNameSupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, CUSTOM_CLASS_NAME_SUPPORT_KEY, true );\n\n/**\n * Returns true if the block defines support for font family.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasFontFamilySupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, FONT_FAMILY_SUPPORT_KEY );\n\n/**\n * Returns the block support value for font family, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getFontFamilySupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, FONT_FAMILY_SUPPORT_KEY );\n\n/**\n * Returns true if the block defines support for font size.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasFontSizeSupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, FONT_SIZE_SUPPORT_KEY );\n\n/**\n * Returns the block support value for font size, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getFontSizeSupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, FONT_SIZE_SUPPORT_KEY );\n\n/**\n * Returns true if the block defines support for layout.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasLayoutSupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, LAYOUT_SUPPORT_KEY );\n\n/**\n * Returns the block support value for layout, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getLayoutSupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, LAYOUT_SUPPORT_KEY );\n\n/**\n * Returns true if the block defines support for style.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasStyleSupport = ( nameOrType ) =>\n\tstyleSupportKeys.some( ( key ) => hasBlockSupport( nameOrType, key ) );\n"],"mappings":";;;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAIA,MAAME,iBAAiB,GAAG,OAAO;AACjC,MAAMC,sBAAsB,GAAG,WAAW;AAC1C,MAAMC,kBAAkB,GAAG,sBAAsB;AACjD,MAAMC,iBAAiB,GAAG,OAAO;AACjC,MAAMC,6BAA6B,GAAG,iBAAiB;AACvD,MAAMC,uBAAuB,GAAG,uBAAuB;AACvD,MAAMC,qB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","ALIGN_SUPPORT_KEY","ALIGN_WIDE_SUPPORT_KEY","BORDER_SUPPORT_KEY","COLOR_SUPPORT_KEY","CUSTOM_CLASS_NAME_SUPPORT_KEY","FONT_FAMILY_SUPPORT_KEY","FONT_SIZE_SUPPORT_KEY","LINE_HEIGHT_SUPPORT_KEY","FONT_STYLE_SUPPORT_KEY","FONT_WEIGHT_SUPPORT_KEY","TEXT_ALIGN_SUPPORT_KEY","TEXT_COLUMNS_SUPPORT_KEY","TEXT_DECORATION_SUPPORT_KEY","WRITING_MODE_SUPPORT_KEY","TEXT_TRANSFORM_SUPPORT_KEY","LETTER_SPACING_SUPPORT_KEY","LAYOUT_SUPPORT_KEY","TYPOGRAPHY_SUPPORT_KEYS","EFFECTS_SUPPORT_KEYS","SPACING_SUPPORT_KEY","styleSupportKeys","hasAlignSupport","nameOrType","hasBlockSupport","exports","getAlignSupport","getBlockSupport","hasAlignWideSupport","getAlignWideSupport","hasBorderSupport","feature","Platform","OS","support","color","radius","width","style","getBorderSupport","hasColorSupport","colorSupport","link","gradient","background","text","hasLinkColorSupport","hasGradientSupport","gradients","hasBackgroundColorSupport","hasTextAlignSupport","getTextAlignSupport","hasTextColorSupport","getColorSupport","hasCustomClassNameSupport","getCustomClassNameSupport","hasFontFamilySupport","getFontFamilySupport","hasFontSizeSupport","getFontSizeSupport","hasLayoutSupport","getLayoutSupport","hasStyleSupport","some","key"],"sources":["@wordpress/block-editor/src/hooks/supports.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { getBlockSupport, hasBlockSupport } from '@wordpress/blocks';\nimport { Platform } from '@wordpress/element';\n\nconst ALIGN_SUPPORT_KEY = 'align';\nconst ALIGN_WIDE_SUPPORT_KEY = 'alignWide';\nconst BORDER_SUPPORT_KEY = 'border';\nconst COLOR_SUPPORT_KEY = 'color';\nconst CUSTOM_CLASS_NAME_SUPPORT_KEY = 'customClassName';\nconst FONT_FAMILY_SUPPORT_KEY = 'typography.fontFamily';\nconst FONT_SIZE_SUPPORT_KEY = 'typography.fontSize';\nconst LINE_HEIGHT_SUPPORT_KEY = 'typography.lineHeight';\n/**\n * Key within block settings' support array indicating support for font style.\n */\nconst FONT_STYLE_SUPPORT_KEY = 'typography.fontStyle';\n/**\n * Key within block settings' support array indicating support for font weight.\n */\nconst FONT_WEIGHT_SUPPORT_KEY = 'typography.fontWeight';\n/**\n * Key within block settings' supports array indicating support for text\n * align e.g. settings found in `block.json`.\n */\nconst TEXT_ALIGN_SUPPORT_KEY = 'typography.textAlign';\n/**\n * Key within block settings' supports array indicating support for text\n * columns e.g. settings found in `block.json`.\n */\nconst TEXT_COLUMNS_SUPPORT_KEY = 'typography.textColumns';\n/**\n * Key within block settings' supports array indicating support for text\n * decorations e.g. settings found in `block.json`.\n */\nconst TEXT_DECORATION_SUPPORT_KEY = 'typography.textDecoration';\n/**\n * Key within block settings' supports array indicating support for writing mode\n * e.g. settings found in `block.json`.\n */\nconst WRITING_MODE_SUPPORT_KEY = 'typography.__experimentalWritingMode';\n/**\n * Key within block settings' supports array indicating support for text\n * transforms e.g. settings found in `block.json`.\n */\nconst TEXT_TRANSFORM_SUPPORT_KEY = 'typography.textTransform';\n\n/**\n * Key within block settings' supports array indicating support for letter-spacing\n * e.g. settings found in `block.json`.\n */\nconst LETTER_SPACING_SUPPORT_KEY = 'typography.letterSpacing';\nconst LAYOUT_SUPPORT_KEY = 'layout';\nconst TYPOGRAPHY_SUPPORT_KEYS = [\n\tLINE_HEIGHT_SUPPORT_KEY,\n\tFONT_SIZE_SUPPORT_KEY,\n\tFONT_STYLE_SUPPORT_KEY,\n\tFONT_WEIGHT_SUPPORT_KEY,\n\tFONT_FAMILY_SUPPORT_KEY,\n\tTEXT_ALIGN_SUPPORT_KEY,\n\tTEXT_COLUMNS_SUPPORT_KEY,\n\tTEXT_DECORATION_SUPPORT_KEY,\n\tTEXT_TRANSFORM_SUPPORT_KEY,\n\tWRITING_MODE_SUPPORT_KEY,\n\tLETTER_SPACING_SUPPORT_KEY,\n];\nconst EFFECTS_SUPPORT_KEYS = [ 'shadow' ];\nconst SPACING_SUPPORT_KEY = 'spacing';\nconst styleSupportKeys = [\n\t...EFFECTS_SUPPORT_KEYS,\n\t...TYPOGRAPHY_SUPPORT_KEYS,\n\tBORDER_SUPPORT_KEY,\n\tCOLOR_SUPPORT_KEY,\n\tSPACING_SUPPORT_KEY,\n];\n\n/**\n * Returns true if the block defines support for align.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasAlignSupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, ALIGN_SUPPORT_KEY );\n\n/**\n * Returns the block support value for align, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getAlignSupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, ALIGN_SUPPORT_KEY );\n\n/**\n * Returns true if the block defines support for align wide.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasAlignWideSupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, ALIGN_WIDE_SUPPORT_KEY );\n\n/**\n * Returns the block support value for align wide, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getAlignWideSupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, ALIGN_WIDE_SUPPORT_KEY );\n\n/**\n * Determine whether there is block support for border properties.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @param {string} feature Border feature to check support for.\n *\n * @return {boolean} Whether there is support.\n */\nexport function hasBorderSupport( nameOrType, feature = 'any' ) {\n\tif ( Platform.OS !== 'web' ) {\n\t\treturn false;\n\t}\n\n\tconst support = getBlockSupport( nameOrType, BORDER_SUPPORT_KEY );\n\n\tif ( support === true ) {\n\t\treturn true;\n\t}\n\n\tif ( feature === 'any' ) {\n\t\treturn !! (\n\t\t\tsupport?.color ||\n\t\t\tsupport?.radius ||\n\t\t\tsupport?.width ||\n\t\t\tsupport?.style\n\t\t);\n\t}\n\n\treturn !! support?.[ feature ];\n}\n\n/**\n * Get block support for border properties.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @param {string} feature Border feature to get.\n *\n * @return {unknown} The block support.\n */\nexport const getBorderSupport = ( nameOrType, feature ) =>\n\tgetBlockSupport( nameOrType, [ BORDER_SUPPORT_KEY, feature ] );\n\n/**\n * Returns true if the block defines support for color.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasColorSupport = ( nameOrType ) => {\n\tconst colorSupport = getBlockSupport( nameOrType, COLOR_SUPPORT_KEY );\n\treturn (\n\t\tcolorSupport &&\n\t\t( colorSupport.link === true ||\n\t\t\tcolorSupport.gradient === true ||\n\t\t\tcolorSupport.background !== false ||\n\t\t\tcolorSupport.text !== false )\n\t);\n};\n\n/**\n * Returns true if the block defines support for link color.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasLinkColorSupport = ( nameOrType ) => {\n\tif ( Platform.OS !== 'web' ) {\n\t\treturn false;\n\t}\n\n\tconst colorSupport = getBlockSupport( nameOrType, COLOR_SUPPORT_KEY );\n\n\treturn (\n\t\tcolorSupport !== null &&\n\t\ttypeof colorSupport === 'object' &&\n\t\t!! colorSupport.link\n\t);\n};\n\n/**\n * Returns true if the block defines support for gradient color.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasGradientSupport = ( nameOrType ) => {\n\tconst colorSupport = getBlockSupport( nameOrType, COLOR_SUPPORT_KEY );\n\n\treturn (\n\t\tcolorSupport !== null &&\n\t\ttypeof colorSupport === 'object' &&\n\t\t!! colorSupport.gradients\n\t);\n};\n\n/**\n * Returns true if the block defines support for background color.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasBackgroundColorSupport = ( nameOrType ) => {\n\tconst colorSupport = getBlockSupport( nameOrType, COLOR_SUPPORT_KEY );\n\n\treturn colorSupport && colorSupport.background !== false;\n};\n\n/**\n * Returns true if the block defines support for text-align.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasTextAlignSupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, TEXT_ALIGN_SUPPORT_KEY );\n\n/**\n * Returns the block support value for text-align, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getTextAlignSupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, TEXT_ALIGN_SUPPORT_KEY );\n\n/**\n * Returns true if the block defines support for background color.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasTextColorSupport = ( nameOrType ) => {\n\tconst colorSupport = getBlockSupport( nameOrType, COLOR_SUPPORT_KEY );\n\n\treturn colorSupport && colorSupport.text !== false;\n};\n\n/**\n * Get block support for color properties.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @param {string} feature Color feature to get.\n *\n * @return {unknown} The block support.\n */\nexport const getColorSupport = ( nameOrType, feature ) =>\n\tgetBlockSupport( nameOrType, [ COLOR_SUPPORT_KEY, feature ] );\n\n/**\n * Returns true if the block defines support for custom class name.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasCustomClassNameSupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, CUSTOM_CLASS_NAME_SUPPORT_KEY, true );\n\n/**\n * Returns the block support value for custom class name, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getCustomClassNameSupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, CUSTOM_CLASS_NAME_SUPPORT_KEY, true );\n\n/**\n * Returns true if the block defines support for font family.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasFontFamilySupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, FONT_FAMILY_SUPPORT_KEY );\n\n/**\n * Returns the block support value for font family, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getFontFamilySupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, FONT_FAMILY_SUPPORT_KEY );\n\n/**\n * Returns true if the block defines support for font size.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasFontSizeSupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, FONT_SIZE_SUPPORT_KEY );\n\n/**\n * Returns the block support value for font size, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getFontSizeSupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, FONT_SIZE_SUPPORT_KEY );\n\n/**\n * Returns true if the block defines support for layout.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasLayoutSupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, LAYOUT_SUPPORT_KEY );\n\n/**\n * Returns the block support value for layout, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getLayoutSupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, LAYOUT_SUPPORT_KEY );\n\n/**\n * Returns true if the block defines support for style.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasStyleSupport = ( nameOrType ) =>\n\tstyleSupportKeys.some( ( key ) => hasBlockSupport( nameOrType, key ) );\n"],"mappings":";;;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAIA,MAAME,iBAAiB,GAAG,OAAO;AACjC,MAAMC,sBAAsB,GAAG,WAAW;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IC,GAAG,IAAM,IAAAxC,uBAAe,EAAED,UAAU,EAAEyC,GAAI,CAAE,CAAC;AAACvC,OAAA,CAAAqC,eAAA,GAAAA,eAAA","ignoreList":[]}
|
|
@@ -122,7 +122,7 @@ function TypographyPanel({
|
|
|
122
122
|
if (!isEnabled) {
|
|
123
123
|
return null;
|
|
124
124
|
}
|
|
125
|
-
const defaultControls = (0, _blocks.getBlockSupport)(name, [TYPOGRAPHY_SUPPORT_KEY, '
|
|
125
|
+
const defaultControls = (0, _blocks.getBlockSupport)(name, [TYPOGRAPHY_SUPPORT_KEY, 'defaultControls']);
|
|
126
126
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_typographyPanel.default, {
|
|
127
127
|
as: TypographyInspectorControl,
|
|
128
128
|
panelId: clientId,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_blocks","require","_element","_data","_inspectorControls","_interopRequireDefault","_typographyPanel","_interopRequireWildcard","_lineHeight","_fontFamily","_fontSize","_textAlign","_utils","_store","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","omit","object","keys","fromEntries","entries","filter","key","includes","LETTER_SPACING_SUPPORT_KEY","TEXT_TRANSFORM_SUPPORT_KEY","TEXT_DECORATION_SUPPORT_KEY","TEXT_COLUMNS_SUPPORT_KEY","FONT_STYLE_SUPPORT_KEY","FONT_WEIGHT_SUPPORT_KEY","WRITING_MODE_SUPPORT_KEY","TYPOGRAPHY_SUPPORT_KEY","exports","TYPOGRAPHY_SUPPORT_KEYS","LINE_HEIGHT_SUPPORT_KEY","FONT_SIZE_SUPPORT_KEY","FONT_FAMILY_SUPPORT_KEY","TEXT_ALIGN_SUPPORT_KEY","styleToAttributes","style","updatedStyle","fontSizeValue","typography","fontSize","fontFamilyValue","fontFamily","fontSizeSlug","startsWith","substring","length","undefined","fontFamilySlug","cleanEmptyObject","attributesToStyle","attributes","TypographyInspectorControl","children","resetAllFilter","attributesResetAllFilter","useCallback","existingStyle","jsx","group","TypographyPanel","clientId","name","setAttributes","settings","selector","select","blockEditorStore","getBlockAttributes","useSelect","isEnabled","useHasTypographyPanel","value","useMemo","onChange","newStyle","defaultControls","getBlockSupport","as","panelId","hasTypographySupport","blockName","some","hasBlockSupport"],"sources":["@wordpress/block-editor/src/hooks/typography.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { getBlockSupport, hasBlockSupport } from '@wordpress/blocks';\nimport { useMemo, useCallback } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport InspectorControls from '../components/inspector-controls';\nimport {\n\tdefault as StylesTypographyPanel,\n\tuseHasTypographyPanel,\n} from '../components/global-styles/typography-panel';\n\nimport { LINE_HEIGHT_SUPPORT_KEY } from './line-height';\nimport { FONT_FAMILY_SUPPORT_KEY } from './font-family';\nimport { FONT_SIZE_SUPPORT_KEY } from './font-size';\nimport { TEXT_ALIGN_SUPPORT_KEY } from './text-align';\nimport { cleanEmptyObject } from './utils';\nimport { store as blockEditorStore } from '../store';\n\nfunction omit( object, keys ) {\n\treturn Object.fromEntries(\n\t\tObject.entries( object ).filter( ( [ key ] ) => ! keys.includes( key ) )\n\t);\n}\n\nconst LETTER_SPACING_SUPPORT_KEY = 'typography.letterSpacing';\nconst TEXT_TRANSFORM_SUPPORT_KEY = 'typography.textTransform';\nconst TEXT_DECORATION_SUPPORT_KEY = 'typography.textDecoration';\nconst TEXT_COLUMNS_SUPPORT_KEY = 'typography.textColumns';\nconst FONT_STYLE_SUPPORT_KEY = 'typography.fontStyle';\nconst FONT_WEIGHT_SUPPORT_KEY = 'typography.fontWeight';\nconst WRITING_MODE_SUPPORT_KEY = 'typography.__experimentalWritingMode';\nexport const TYPOGRAPHY_SUPPORT_KEY = 'typography';\nexport const TYPOGRAPHY_SUPPORT_KEYS = [\n\tLINE_HEIGHT_SUPPORT_KEY,\n\tFONT_SIZE_SUPPORT_KEY,\n\tFONT_STYLE_SUPPORT_KEY,\n\tFONT_WEIGHT_SUPPORT_KEY,\n\tFONT_FAMILY_SUPPORT_KEY,\n\tTEXT_ALIGN_SUPPORT_KEY,\n\tTEXT_COLUMNS_SUPPORT_KEY,\n\tTEXT_DECORATION_SUPPORT_KEY,\n\tWRITING_MODE_SUPPORT_KEY,\n\tTEXT_TRANSFORM_SUPPORT_KEY,\n\tLETTER_SPACING_SUPPORT_KEY,\n];\n\nfunction styleToAttributes( style ) {\n\tconst updatedStyle = { ...omit( style, [ 'fontFamily' ] ) };\n\tconst fontSizeValue = style?.typography?.fontSize;\n\tconst fontFamilyValue = style?.typography?.fontFamily;\n\tconst fontSizeSlug = fontSizeValue?.startsWith( 'var:preset|font-size|' )\n\t\t? fontSizeValue.substring( 'var:preset|font-size|'.length )\n\t\t: undefined;\n\tconst fontFamilySlug = fontFamilyValue?.startsWith(\n\t\t'var:preset|font-family|'\n\t)\n\t\t? fontFamilyValue.substring( 'var:preset|font-family|'.length )\n\t\t: undefined;\n\tupdatedStyle.typography = {\n\t\t...omit( updatedStyle.typography, [ 'fontFamily' ] ),\n\t\tfontSize: fontSizeSlug ? undefined : fontSizeValue,\n\t};\n\treturn {\n\t\tstyle: cleanEmptyObject( updatedStyle ),\n\t\tfontFamily: fontFamilySlug,\n\t\tfontSize: fontSizeSlug,\n\t};\n}\n\nfunction attributesToStyle( attributes ) {\n\treturn {\n\t\t...attributes.style,\n\t\ttypography: {\n\t\t\t...attributes.style?.typography,\n\t\t\tfontFamily: attributes.fontFamily\n\t\t\t\t? 'var:preset|font-family|' + attributes.fontFamily\n\t\t\t\t: undefined,\n\t\t\tfontSize: attributes.fontSize\n\t\t\t\t? 'var:preset|font-size|' + attributes.fontSize\n\t\t\t\t: attributes.style?.typography?.fontSize,\n\t\t},\n\t};\n}\n\nfunction TypographyInspectorControl( { children, resetAllFilter } ) {\n\tconst attributesResetAllFilter = useCallback(\n\t\t( attributes ) => {\n\t\t\tconst existingStyle = attributesToStyle( attributes );\n\t\t\tconst updatedStyle = resetAllFilter( existingStyle );\n\t\t\treturn {\n\t\t\t\t...attributes,\n\t\t\t\t...styleToAttributes( updatedStyle ),\n\t\t\t};\n\t\t},\n\t\t[ resetAllFilter ]\n\t);\n\n\treturn (\n\t\t<InspectorControls\n\t\t\tgroup=\"typography\"\n\t\t\tresetAllFilter={ attributesResetAllFilter }\n\t\t>\n\t\t\t{ children }\n\t\t</InspectorControls>\n\t);\n}\n\nexport function TypographyPanel( { clientId, name, setAttributes, settings } ) {\n\tfunction selector( select ) {\n\t\tconst { style, fontFamily, fontSize } =\n\t\t\tselect( blockEditorStore ).getBlockAttributes( clientId ) || {};\n\t\treturn { style, fontFamily, fontSize };\n\t}\n\tconst { style, fontFamily, fontSize } = useSelect( selector, [ clientId ] );\n\tconst isEnabled = useHasTypographyPanel( settings );\n\tconst value = useMemo(\n\t\t() => attributesToStyle( { style, fontFamily, fontSize } ),\n\t\t[ style, fontSize, fontFamily ]\n\t);\n\n\tconst onChange = ( newStyle ) => {\n\t\tsetAttributes( styleToAttributes( newStyle ) );\n\t};\n\n\tif ( ! isEnabled ) {\n\t\treturn null;\n\t}\n\n\tconst defaultControls = getBlockSupport( name, [\n\t\tTYPOGRAPHY_SUPPORT_KEY,\n\t\t'__experimentalDefaultControls',\n\t] );\n\n\treturn (\n\t\t<StylesTypographyPanel\n\t\t\tas={ TypographyInspectorControl }\n\t\t\tpanelId={ clientId }\n\t\t\tsettings={ settings }\n\t\t\tvalue={ value }\n\t\t\tonChange={ onChange }\n\t\t\tdefaultControls={ defaultControls }\n\t\t/>\n\t);\n}\n\nexport const hasTypographySupport = ( blockName ) => {\n\treturn TYPOGRAPHY_SUPPORT_KEYS.some( ( key ) =>\n\t\thasBlockSupport( blockName, key )\n\t);\n};\n"],"mappings":";;;;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAA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AAsB,EACtB,+BAA+B,CAC9B,CAAC;EAEH,oBACC,IAAApC,WAAA,CAAAkE,GAAA,EAAC1E,gBAAA,CAAAe,OAAqB;IACrB+E,EAAE,EAAG1B,0BAA4B;IACjC2B,OAAO,EAAGlB,QAAU;IACpBG,QAAQ,EAAGA,QAAU;IACrBQ,KAAK,EAAGA,KAAO;IACfE,QAAQ,EAAGA,QAAU;IACrBE,eAAe,EAAGA;EAAiB,CACnC,CAAC;AAEJ;AAEO,MAAMI,oBAAoB,GAAKC,SAAS,IAAM;EACpD,OAAOnD,uBAAuB,CAACoD,IAAI,CAAI/D,GAAG,IACzC,IAAAgE,uBAAe,EAAEF,SAAS,EAAE9D,GAAI,CACjC,CAAC;AACF,CAAC;AAACU,OAAA,CAAAmD,oBAAA,GAAAA,oBAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_blocks","require","_element","_data","_inspectorControls","_interopRequireDefault","_typographyPanel","_interopRequireWildcard","_lineHeight","_fontFamily","_fontSize","_textAlign","_utils","_store","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","omit","object","keys","fromEntries","entries","filter","key","includes","LETTER_SPACING_SUPPORT_KEY","TEXT_TRANSFORM_SUPPORT_KEY","TEXT_DECORATION_SUPPORT_KEY","TEXT_COLUMNS_SUPPORT_KEY","FONT_STYLE_SUPPORT_KEY","FONT_WEIGHT_SUPPORT_KEY","WRITING_MODE_SUPPORT_KEY","TYPOGRAPHY_SUPPORT_KEY","exports","TYPOGRAPHY_SUPPORT_KEYS","LINE_HEIGHT_SUPPORT_KEY","FONT_SIZE_SUPPORT_KEY","FONT_FAMILY_SUPPORT_KEY","TEXT_ALIGN_SUPPORT_KEY","styleToAttributes","style","updatedStyle","fontSizeValue","typography","fontSize","fontFamilyValue","fontFamily","fontSizeSlug","startsWith","substring","length","undefined","fontFamilySlug","cleanEmptyObject","attributesToStyle","attributes","TypographyInspectorControl","children","resetAllFilter","attributesResetAllFilter","useCallback","existingStyle","jsx","group","TypographyPanel","clientId","name","setAttributes","settings","selector","select","blockEditorStore","getBlockAttributes","useSelect","isEnabled","useHasTypographyPanel","value","useMemo","onChange","newStyle","defaultControls","getBlockSupport","as","panelId","hasTypographySupport","blockName","some","hasBlockSupport"],"sources":["@wordpress/block-editor/src/hooks/typography.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { getBlockSupport, hasBlockSupport } from '@wordpress/blocks';\nimport { useMemo, useCallback } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport InspectorControls from '../components/inspector-controls';\nimport {\n\tdefault as StylesTypographyPanel,\n\tuseHasTypographyPanel,\n} from '../components/global-styles/typography-panel';\n\nimport { LINE_HEIGHT_SUPPORT_KEY } from './line-height';\nimport { FONT_FAMILY_SUPPORT_KEY } from './font-family';\nimport { FONT_SIZE_SUPPORT_KEY } from './font-size';\nimport { TEXT_ALIGN_SUPPORT_KEY } from './text-align';\nimport { cleanEmptyObject } from './utils';\nimport { store as blockEditorStore } from '../store';\n\nfunction omit( object, keys ) {\n\treturn Object.fromEntries(\n\t\tObject.entries( object ).filter( ( [ key ] ) => ! keys.includes( key ) )\n\t);\n}\n\nconst LETTER_SPACING_SUPPORT_KEY = 'typography.letterSpacing';\nconst TEXT_TRANSFORM_SUPPORT_KEY = 'typography.textTransform';\nconst TEXT_DECORATION_SUPPORT_KEY = 'typography.textDecoration';\nconst TEXT_COLUMNS_SUPPORT_KEY = 'typography.textColumns';\nconst FONT_STYLE_SUPPORT_KEY = 'typography.fontStyle';\nconst FONT_WEIGHT_SUPPORT_KEY = 'typography.fontWeight';\nconst WRITING_MODE_SUPPORT_KEY = 'typography.__experimentalWritingMode';\nexport const TYPOGRAPHY_SUPPORT_KEY = 'typography';\nexport const TYPOGRAPHY_SUPPORT_KEYS = [\n\tLINE_HEIGHT_SUPPORT_KEY,\n\tFONT_SIZE_SUPPORT_KEY,\n\tFONT_STYLE_SUPPORT_KEY,\n\tFONT_WEIGHT_SUPPORT_KEY,\n\tFONT_FAMILY_SUPPORT_KEY,\n\tTEXT_ALIGN_SUPPORT_KEY,\n\tTEXT_COLUMNS_SUPPORT_KEY,\n\tTEXT_DECORATION_SUPPORT_KEY,\n\tWRITING_MODE_SUPPORT_KEY,\n\tTEXT_TRANSFORM_SUPPORT_KEY,\n\tLETTER_SPACING_SUPPORT_KEY,\n];\n\nfunction styleToAttributes( style ) {\n\tconst updatedStyle = { ...omit( style, [ 'fontFamily' ] ) };\n\tconst fontSizeValue = style?.typography?.fontSize;\n\tconst fontFamilyValue = style?.typography?.fontFamily;\n\tconst fontSizeSlug = fontSizeValue?.startsWith( 'var:preset|font-size|' )\n\t\t? fontSizeValue.substring( 'var:preset|font-size|'.length )\n\t\t: undefined;\n\tconst fontFamilySlug = fontFamilyValue?.startsWith(\n\t\t'var:preset|font-family|'\n\t)\n\t\t? fontFamilyValue.substring( 'var:preset|font-family|'.length )\n\t\t: undefined;\n\tupdatedStyle.typography = {\n\t\t...omit( updatedStyle.typography, [ 'fontFamily' ] ),\n\t\tfontSize: fontSizeSlug ? undefined : fontSizeValue,\n\t};\n\treturn {\n\t\tstyle: cleanEmptyObject( updatedStyle ),\n\t\tfontFamily: fontFamilySlug,\n\t\tfontSize: fontSizeSlug,\n\t};\n}\n\nfunction attributesToStyle( attributes ) {\n\treturn {\n\t\t...attributes.style,\n\t\ttypography: {\n\t\t\t...attributes.style?.typography,\n\t\t\tfontFamily: attributes.fontFamily\n\t\t\t\t? 'var:preset|font-family|' + attributes.fontFamily\n\t\t\t\t: undefined,\n\t\t\tfontSize: attributes.fontSize\n\t\t\t\t? 'var:preset|font-size|' + attributes.fontSize\n\t\t\t\t: attributes.style?.typography?.fontSize,\n\t\t},\n\t};\n}\n\nfunction TypographyInspectorControl( { children, resetAllFilter } ) {\n\tconst attributesResetAllFilter = useCallback(\n\t\t( attributes ) => {\n\t\t\tconst existingStyle = attributesToStyle( attributes );\n\t\t\tconst updatedStyle = resetAllFilter( existingStyle );\n\t\t\treturn {\n\t\t\t\t...attributes,\n\t\t\t\t...styleToAttributes( updatedStyle ),\n\t\t\t};\n\t\t},\n\t\t[ resetAllFilter ]\n\t);\n\n\treturn (\n\t\t<InspectorControls\n\t\t\tgroup=\"typography\"\n\t\t\tresetAllFilter={ attributesResetAllFilter }\n\t\t>\n\t\t\t{ children }\n\t\t</InspectorControls>\n\t);\n}\n\nexport function TypographyPanel( { clientId, name, setAttributes, settings } ) {\n\tfunction selector( select ) {\n\t\tconst { style, fontFamily, fontSize } =\n\t\t\tselect( blockEditorStore ).getBlockAttributes( clientId ) || {};\n\t\treturn { style, fontFamily, fontSize };\n\t}\n\tconst { style, fontFamily, fontSize } = useSelect( selector, [ clientId ] );\n\tconst isEnabled = useHasTypographyPanel( settings );\n\tconst value = useMemo(\n\t\t() => attributesToStyle( { style, fontFamily, fontSize } ),\n\t\t[ style, fontSize, fontFamily ]\n\t);\n\n\tconst onChange = ( newStyle ) => {\n\t\tsetAttributes( styleToAttributes( newStyle ) );\n\t};\n\n\tif ( ! isEnabled ) {\n\t\treturn null;\n\t}\n\n\tconst defaultControls = getBlockSupport( name, [\n\t\tTYPOGRAPHY_SUPPORT_KEY,\n\t\t'defaultControls',\n\t] );\n\n\treturn (\n\t\t<StylesTypographyPanel\n\t\t\tas={ TypographyInspectorControl }\n\t\t\tpanelId={ clientId }\n\t\t\tsettings={ settings }\n\t\t\tvalue={ value }\n\t\t\tonChange={ onChange }\n\t\t\tdefaultControls={ defaultControls }\n\t\t/>\n\t);\n}\n\nexport const hasTypographySupport = ( blockName ) => {\n\treturn TYPOGRAPHY_SUPPORT_KEYS.some( ( key ) =>\n\t\thasBlockSupport( blockName, key )\n\t);\n};\n"],"mappings":";;;;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OA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,EACtB,iBAAiB,CAChB,CAAC;EAEH,oBACC,IAAApC,WAAA,CAAAkE,GAAA,EAAC1E,gBAAA,CAAAe,OAAqB;IACrB+E,EAAE,EAAG1B,0BAA4B;IACjC2B,OAAO,EAAGlB,QAAU;IACpBG,QAAQ,EAAGA,QAAU;IACrBQ,KAAK,EAAGA,KAAO;IACfE,QAAQ,EAAGA,QAAU;IACrBE,eAAe,EAAGA;EAAiB,CACnC,CAAC;AAEJ;AAEO,MAAMI,oBAAoB,GAAKC,SAAS,IAAM;EACpD,OAAOnD,uBAAuB,CAACoD,IAAI,CAAI/D,GAAG,IACzC,IAAAgE,uBAAe,EAAEF,SAAS,EAAE9D,GAAI,CACjC,CAAC;AACF,CAAC;AAACU,OAAA,CAAAmD,oBAAA,GAAAA,oBAAA","ignoreList":[]}
|
package/build/hooks/utils.js
CHANGED
|
@@ -106,7 +106,7 @@ function transformStyles(activeSupports, migrationPaths, result, source, index,
|
|
|
106
106
|
*/
|
|
107
107
|
function shouldSkipSerialization(blockNameOrType, featureSet, feature) {
|
|
108
108
|
const support = (0, _blocks.getBlockSupport)(blockNameOrType, featureSet);
|
|
109
|
-
const skipSerialization = support?.
|
|
109
|
+
const skipSerialization = support?.skipSerialization;
|
|
110
110
|
if (Array.isArray(skipSerialization)) {
|
|
111
111
|
return skipSerialization.includes(feature);
|
|
112
112
|
}
|
package/build/hooks/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_blocks","require","_element","_data","_compose","_hooks","_context","_components","_hooks2","_object","_store","_lockUnlock","_clsx","_interopRequireDefault","_jsxRuntime","cleanEmptyObject","object","Array","isArray","cleanedNestedObjects","Object","entries","map","key","value","filter","undefined","length","fromEntries","exports","transformStyles","activeSupports","migrationPaths","result","source","index","results","values","every","isActive","innerBlocks","referenceBlockAttributes","attributes","returnBlock","forEach","support","path","styleValue","getValueFromObjectPath","setImmutably","shouldSkipSerialization","blockNameOrType","featureSet","feature","getBlockSupport","skipSerialization","__experimentalSkipSerialization","includes","pendingStyleOverrides","WeakMap","useStyleOverride","id","css","usePrivateStyleOverride","assets","__unstableType","variation","clientId","setStyleOverride","deleteStyleOverride","unlock","useDispatch","blockEditorStore","registry","useRegistry","fallbackId","useId","useEffect","_id","override","get","set","push","window","queueMicrotask","batch","args","isPending","find","currentId","useBlockSettings","name","parentLayout","backgroundImage","backgroundSize","customFontFamilies","defaultFontFamilies","themeFontFamilies","defaultFontSizesEnabled","customFontSizes","defaultFontSizes","themeFontSizes","customFontSize","fontStyle","fontWeight","lineHeight","textAlign","textColumns","textDecoration","writingMode","textTransform","letterSpacing","padding","margin","blockGap","defaultSpacingSizesEnabled","customSpacingSize","userSpacingSizes","defaultSpacingSizes","themeSpacingSizes","units","aspectRatio","minHeight","layout","borderColor","borderRadius","borderStyle","borderWidth","customColorsEnabled","customColors","customDuotone","themeColors","defaultColors","defaultPalette","defaultDuotone","userDuotonePalette","themeDuotonePalette","defaultDuotonePalette","userGradientPalette","themeGradientPalette","defaultGradientPalette","defaultGradients","areCustomGradientsEnabled","isBackgroundEnabled","isLinkEnabled","isTextEnabled","isHeadingEnabled","isButtonEnabled","shadow","useSettings","rawSettings","useMemo","background","color","palette","custom","theme","default","gradients","duotone","customGradient","link","heading","button","text","typography","fontFamilies","fontSizes","spacing","spacingSizes","border","radius","style","width","dimensions","useSettingsForBlockElement","createBlockEditFilter","features","settings","Edit","memo","edit","withBlockEditHooks","createHigherOrderComponent","OriginalBlockEdit","props","context","useBlockEditContext","i","hasSupport","attributeKeys","shareWithChildBlocks","shouldDisplayControls","mayDisplayControlsKey","mayDisplayParentControlsKey","neededProps","jsx","isSelected","setAttributes","__unstableParentLayout","addFilter","BlockProps","useBlockProps","hook","setAllWrapperProps","wrapperProps","setWrapperProps","next","prev","nextAll","BlockPropsPure","createBlockListBlockFilter","withBlockListBlockHooks","BlockListBlock","allWrapperProps","useState","fill","isMatch","keys","Boolean","reduce","acc","className","clsx","createBlockSaveFilter","extraPropsFromHooks","accu","addSaveProps","neededAttributes","hasOwnProperty"],"sources":["@wordpress/block-editor/src/hooks/utils.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { getBlockSupport } from '@wordpress/blocks';\nimport { memo, useMemo, useEffect, useId, useState } from '@wordpress/element';\nimport { useDispatch, useRegistry } from '@wordpress/data';\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport { addFilter } from '@wordpress/hooks';\n\n/**\n * Internal dependencies\n */\nimport {\n\tuseBlockEditContext,\n\tmayDisplayControlsKey,\n\tmayDisplayParentControlsKey,\n} from '../components/block-edit/context';\nimport { useSettings } from '../components';\nimport { useSettingsForBlockElement } from '../components/global-styles/hooks';\nimport { getValueFromObjectPath, setImmutably } from '../utils/object';\nimport { store as blockEditorStore } from '../store';\nimport { unlock } from '../lock-unlock';\n/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * Removed falsy values from nested object.\n *\n * @param {*} object\n * @return {*} Object cleaned from falsy values\n */\nexport const cleanEmptyObject = ( object ) => {\n\tif (\n\t\tobject === null ||\n\t\ttypeof object !== 'object' ||\n\t\tArray.isArray( object )\n\t) {\n\t\treturn object;\n\t}\n\n\tconst cleanedNestedObjects = Object.entries( object )\n\t\t.map( ( [ key, value ] ) => [ key, cleanEmptyObject( value ) ] )\n\t\t.filter( ( [ , value ] ) => value !== undefined );\n\treturn ! cleanedNestedObjects.length\n\t\t? undefined\n\t\t: Object.fromEntries( cleanedNestedObjects );\n};\n\nexport function transformStyles(\n\tactiveSupports,\n\tmigrationPaths,\n\tresult,\n\tsource,\n\tindex,\n\tresults\n) {\n\t// If there are no active supports return early.\n\tif (\n\t\tObject.values( activeSupports ?? {} ).every(\n\t\t\t( isActive ) => ! isActive\n\t\t)\n\t) {\n\t\treturn result;\n\t}\n\t// If the condition verifies we are probably in the presence of a wrapping transform\n\t// e.g: nesting paragraphs in a group or columns and in that case the styles should not be transformed.\n\tif ( results.length === 1 && result.innerBlocks.length === source.length ) {\n\t\treturn result;\n\t}\n\t// For cases where we have a transform from one block to multiple blocks\n\t// or multiple blocks to one block we apply the styles of the first source block\n\t// to the result(s).\n\tlet referenceBlockAttributes = source[ 0 ]?.attributes;\n\t// If we are in presence of transform between more than one block in the source\n\t// that has more than one block in the result\n\t// we apply the styles on source N to the result N,\n\t// if source N does not exists we do nothing.\n\tif ( results.length > 1 && source.length > 1 ) {\n\t\tif ( source[ index ] ) {\n\t\t\treferenceBlockAttributes = source[ index ]?.attributes;\n\t\t} else {\n\t\t\treturn result;\n\t\t}\n\t}\n\tlet returnBlock = result;\n\tObject.entries( activeSupports ).forEach( ( [ support, isActive ] ) => {\n\t\tif ( isActive ) {\n\t\t\tmigrationPaths[ support ].forEach( ( path ) => {\n\t\t\t\tconst styleValue = getValueFromObjectPath(\n\t\t\t\t\treferenceBlockAttributes,\n\t\t\t\t\tpath\n\t\t\t\t);\n\t\t\t\tif ( styleValue ) {\n\t\t\t\t\treturnBlock = {\n\t\t\t\t\t\t...returnBlock,\n\t\t\t\t\t\tattributes: setImmutably(\n\t\t\t\t\t\t\treturnBlock.attributes,\n\t\t\t\t\t\t\tpath,\n\t\t\t\t\t\t\tstyleValue\n\t\t\t\t\t\t),\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t} );\n\treturn returnBlock;\n}\n\n/**\n * Check whether serialization of specific block support feature or set should\n * be skipped.\n *\n * @param {string|Object} blockNameOrType Block name or block type object.\n * @param {string} featureSet Name of block support feature set.\n * @param {string} feature Name of the individual feature to check.\n *\n * @return {boolean} Whether serialization should occur.\n */\nexport function shouldSkipSerialization(\n\tblockNameOrType,\n\tfeatureSet,\n\tfeature\n) {\n\tconst support = getBlockSupport( blockNameOrType, featureSet );\n\tconst skipSerialization = support?.__experimentalSkipSerialization;\n\n\tif ( Array.isArray( skipSerialization ) ) {\n\t\treturn skipSerialization.includes( feature );\n\t}\n\n\treturn skipSerialization;\n}\n\nconst pendingStyleOverrides = new WeakMap();\n\n/**\n * Override a block editor settings style. Leave the ID blank to create a new\n * style.\n *\n * @param {Object} override Override object.\n * @param {?string} override.id Id of the style override, leave blank to create\n * a new style.\n * @param {string} override.css CSS to apply.\n */\nexport function useStyleOverride( { id, css } ) {\n\treturn usePrivateStyleOverride( { id, css } );\n}\n\nexport function usePrivateStyleOverride( {\n\tid,\n\tcss,\n\tassets,\n\t__unstableType,\n\tvariation,\n\tclientId,\n} = {} ) {\n\tconst { setStyleOverride, deleteStyleOverride } = unlock(\n\t\tuseDispatch( blockEditorStore )\n\t);\n\tconst registry = useRegistry();\n\tconst fallbackId = useId();\n\tuseEffect( () => {\n\t\t// Unmount if there is CSS and assets are empty.\n\t\tif ( ! css && ! assets ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst _id = id || fallbackId;\n\t\tconst override = {\n\t\t\tid,\n\t\t\tcss,\n\t\t\tassets,\n\t\t\t__unstableType,\n\t\t\tvariation,\n\t\t\tclientId,\n\t\t};\n\t\t// Batch updates to style overrides to avoid triggering cascading renders\n\t\t// for each style override block included in a tree and optimize initial render.\n\t\tif ( ! pendingStyleOverrides.get( registry ) ) {\n\t\t\tpendingStyleOverrides.set( registry, [] );\n\t\t}\n\t\tpendingStyleOverrides.get( registry ).push( [ _id, override ] );\n\t\twindow.queueMicrotask( () => {\n\t\t\tif ( pendingStyleOverrides.get( registry )?.length ) {\n\t\t\t\tregistry.batch( () => {\n\t\t\t\t\tpendingStyleOverrides.get( registry ).forEach( ( args ) => {\n\t\t\t\t\t\tsetStyleOverride( ...args );\n\t\t\t\t\t} );\n\t\t\t\t\tpendingStyleOverrides.set( registry, [] );\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\n\t\treturn () => {\n\t\t\tconst isPending = pendingStyleOverrides\n\t\t\t\t.get( registry )\n\t\t\t\t?.find( ( [ currentId ] ) => currentId === _id );\n\t\t\tif ( isPending ) {\n\t\t\t\tpendingStyleOverrides.set(\n\t\t\t\t\tregistry,\n\t\t\t\t\tpendingStyleOverrides\n\t\t\t\t\t\t.get( registry )\n\t\t\t\t\t\t.filter( ( [ currentId ] ) => currentId !== _id )\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tdeleteStyleOverride( _id );\n\t\t\t}\n\t\t};\n\t}, [\n\t\tid,\n\t\tcss,\n\t\tclientId,\n\t\tassets,\n\t\t__unstableType,\n\t\tfallbackId,\n\t\tsetStyleOverride,\n\t\tdeleteStyleOverride,\n\t\tregistry,\n\t] );\n}\n\n/**\n * Based on the block and its context, returns an object of all the block settings.\n * This object can be passed as a prop to all the Styles UI components\n * (TypographyPanel, DimensionsPanel...).\n *\n * @param {string} name Block name.\n * @param {*} parentLayout Parent layout.\n *\n * @return {Object} Settings object.\n */\nexport function useBlockSettings( name, parentLayout ) {\n\tconst [\n\t\tbackgroundImage,\n\t\tbackgroundSize,\n\t\tcustomFontFamilies,\n\t\tdefaultFontFamilies,\n\t\tthemeFontFamilies,\n\t\tdefaultFontSizesEnabled,\n\t\tcustomFontSizes,\n\t\tdefaultFontSizes,\n\t\tthemeFontSizes,\n\t\tcustomFontSize,\n\t\tfontStyle,\n\t\tfontWeight,\n\t\tlineHeight,\n\t\ttextAlign,\n\t\ttextColumns,\n\t\ttextDecoration,\n\t\twritingMode,\n\t\ttextTransform,\n\t\tletterSpacing,\n\t\tpadding,\n\t\tmargin,\n\t\tblockGap,\n\t\tdefaultSpacingSizesEnabled,\n\t\tcustomSpacingSize,\n\t\tuserSpacingSizes,\n\t\tdefaultSpacingSizes,\n\t\tthemeSpacingSizes,\n\t\tunits,\n\t\taspectRatio,\n\t\tminHeight,\n\t\tlayout,\n\t\tborderColor,\n\t\tborderRadius,\n\t\tborderStyle,\n\t\tborderWidth,\n\t\tcustomColorsEnabled,\n\t\tcustomColors,\n\t\tcustomDuotone,\n\t\tthemeColors,\n\t\tdefaultColors,\n\t\tdefaultPalette,\n\t\tdefaultDuotone,\n\t\tuserDuotonePalette,\n\t\tthemeDuotonePalette,\n\t\tdefaultDuotonePalette,\n\t\tuserGradientPalette,\n\t\tthemeGradientPalette,\n\t\tdefaultGradientPalette,\n\t\tdefaultGradients,\n\t\tareCustomGradientsEnabled,\n\t\tisBackgroundEnabled,\n\t\tisLinkEnabled,\n\t\tisTextEnabled,\n\t\tisHeadingEnabled,\n\t\tisButtonEnabled,\n\t\tshadow,\n\t] = useSettings(\n\t\t'background.backgroundImage',\n\t\t'background.backgroundSize',\n\t\t'typography.fontFamilies.custom',\n\t\t'typography.fontFamilies.default',\n\t\t'typography.fontFamilies.theme',\n\t\t'typography.defaultFontSizes',\n\t\t'typography.fontSizes.custom',\n\t\t'typography.fontSizes.default',\n\t\t'typography.fontSizes.theme',\n\t\t'typography.customFontSize',\n\t\t'typography.fontStyle',\n\t\t'typography.fontWeight',\n\t\t'typography.lineHeight',\n\t\t'typography.textAlign',\n\t\t'typography.textColumns',\n\t\t'typography.textDecoration',\n\t\t'typography.writingMode',\n\t\t'typography.textTransform',\n\t\t'typography.letterSpacing',\n\t\t'spacing.padding',\n\t\t'spacing.margin',\n\t\t'spacing.blockGap',\n\t\t'spacing.defaultSpacingSizes',\n\t\t'spacing.customSpacingSize',\n\t\t'spacing.spacingSizes.custom',\n\t\t'spacing.spacingSizes.default',\n\t\t'spacing.spacingSizes.theme',\n\t\t'spacing.units',\n\t\t'dimensions.aspectRatio',\n\t\t'dimensions.minHeight',\n\t\t'layout',\n\t\t'border.color',\n\t\t'border.radius',\n\t\t'border.style',\n\t\t'border.width',\n\t\t'color.custom',\n\t\t'color.palette.custom',\n\t\t'color.customDuotone',\n\t\t'color.palette.theme',\n\t\t'color.palette.default',\n\t\t'color.defaultPalette',\n\t\t'color.defaultDuotone',\n\t\t'color.duotone.custom',\n\t\t'color.duotone.theme',\n\t\t'color.duotone.default',\n\t\t'color.gradients.custom',\n\t\t'color.gradients.theme',\n\t\t'color.gradients.default',\n\t\t'color.defaultGradients',\n\t\t'color.customGradient',\n\t\t'color.background',\n\t\t'color.link',\n\t\t'color.text',\n\t\t'color.heading',\n\t\t'color.button',\n\t\t'shadow'\n\t);\n\n\tconst rawSettings = useMemo( () => {\n\t\treturn {\n\t\t\tbackground: {\n\t\t\t\tbackgroundImage,\n\t\t\t\tbackgroundSize,\n\t\t\t},\n\t\t\tcolor: {\n\t\t\t\tpalette: {\n\t\t\t\t\tcustom: customColors,\n\t\t\t\t\ttheme: themeColors,\n\t\t\t\t\tdefault: defaultColors,\n\t\t\t\t},\n\t\t\t\tgradients: {\n\t\t\t\t\tcustom: userGradientPalette,\n\t\t\t\t\ttheme: themeGradientPalette,\n\t\t\t\t\tdefault: defaultGradientPalette,\n\t\t\t\t},\n\t\t\t\tduotone: {\n\t\t\t\t\tcustom: userDuotonePalette,\n\t\t\t\t\ttheme: themeDuotonePalette,\n\t\t\t\t\tdefault: defaultDuotonePalette,\n\t\t\t\t},\n\t\t\t\tdefaultGradients,\n\t\t\t\tdefaultPalette,\n\t\t\t\tdefaultDuotone,\n\t\t\t\tcustom: customColorsEnabled,\n\t\t\t\tcustomGradient: areCustomGradientsEnabled,\n\t\t\t\tcustomDuotone,\n\t\t\t\tbackground: isBackgroundEnabled,\n\t\t\t\tlink: isLinkEnabled,\n\t\t\t\theading: isHeadingEnabled,\n\t\t\t\tbutton: isButtonEnabled,\n\t\t\t\ttext: isTextEnabled,\n\t\t\t},\n\t\t\ttypography: {\n\t\t\t\tfontFamilies: {\n\t\t\t\t\tcustom: customFontFamilies,\n\t\t\t\t\tdefault: defaultFontFamilies,\n\t\t\t\t\ttheme: themeFontFamilies,\n\t\t\t\t},\n\t\t\t\tfontSizes: {\n\t\t\t\t\tcustom: customFontSizes,\n\t\t\t\t\tdefault: defaultFontSizes,\n\t\t\t\t\ttheme: themeFontSizes,\n\t\t\t\t},\n\t\t\t\tcustomFontSize,\n\t\t\t\tdefaultFontSizes: defaultFontSizesEnabled,\n\t\t\t\tfontStyle,\n\t\t\t\tfontWeight,\n\t\t\t\tlineHeight,\n\t\t\t\ttextAlign,\n\t\t\t\ttextColumns,\n\t\t\t\ttextDecoration,\n\t\t\t\ttextTransform,\n\t\t\t\tletterSpacing,\n\t\t\t\twritingMode,\n\t\t\t},\n\t\t\tspacing: {\n\t\t\t\tspacingSizes: {\n\t\t\t\t\tcustom: userSpacingSizes,\n\t\t\t\t\tdefault: defaultSpacingSizes,\n\t\t\t\t\ttheme: themeSpacingSizes,\n\t\t\t\t},\n\t\t\t\tcustomSpacingSize,\n\t\t\t\tdefaultSpacingSizes: defaultSpacingSizesEnabled,\n\t\t\t\tpadding,\n\t\t\t\tmargin,\n\t\t\t\tblockGap,\n\t\t\t\tunits,\n\t\t\t},\n\t\t\tborder: {\n\t\t\t\tcolor: borderColor,\n\t\t\t\tradius: borderRadius,\n\t\t\t\tstyle: borderStyle,\n\t\t\t\twidth: borderWidth,\n\t\t\t},\n\t\t\tdimensions: {\n\t\t\t\taspectRatio,\n\t\t\t\tminHeight,\n\t\t\t},\n\t\t\tlayout,\n\t\t\tparentLayout,\n\t\t\tshadow,\n\t\t};\n\t}, [\n\t\tbackgroundImage,\n\t\tbackgroundSize,\n\t\tcustomFontFamilies,\n\t\tdefaultFontFamilies,\n\t\tthemeFontFamilies,\n\t\tdefaultFontSizesEnabled,\n\t\tcustomFontSizes,\n\t\tdefaultFontSizes,\n\t\tthemeFontSizes,\n\t\tcustomFontSize,\n\t\tfontStyle,\n\t\tfontWeight,\n\t\tlineHeight,\n\t\ttextAlign,\n\t\ttextColumns,\n\t\ttextDecoration,\n\t\ttextTransform,\n\t\tletterSpacing,\n\t\twritingMode,\n\t\tpadding,\n\t\tmargin,\n\t\tblockGap,\n\t\tdefaultSpacingSizesEnabled,\n\t\tcustomSpacingSize,\n\t\tuserSpacingSizes,\n\t\tdefaultSpacingSizes,\n\t\tthemeSpacingSizes,\n\t\tunits,\n\t\taspectRatio,\n\t\tminHeight,\n\t\tlayout,\n\t\tparentLayout,\n\t\tborderColor,\n\t\tborderRadius,\n\t\tborderStyle,\n\t\tborderWidth,\n\t\tcustomColorsEnabled,\n\t\tcustomColors,\n\t\tcustomDuotone,\n\t\tthemeColors,\n\t\tdefaultColors,\n\t\tdefaultPalette,\n\t\tdefaultDuotone,\n\t\tuserDuotonePalette,\n\t\tthemeDuotonePalette,\n\t\tdefaultDuotonePalette,\n\t\tuserGradientPalette,\n\t\tthemeGradientPalette,\n\t\tdefaultGradientPalette,\n\t\tdefaultGradients,\n\t\tareCustomGradientsEnabled,\n\t\tisBackgroundEnabled,\n\t\tisLinkEnabled,\n\t\tisTextEnabled,\n\t\tisHeadingEnabled,\n\t\tisButtonEnabled,\n\t\tshadow,\n\t] );\n\n\treturn useSettingsForBlockElement( rawSettings, name );\n}\n\nexport function createBlockEditFilter( features ) {\n\t// We don't want block controls to re-render when typing inside a block.\n\t// `memo` will prevent re-renders unless props change, so only pass the\n\t// needed props and not the whole attributes object.\n\tfeatures = features.map( ( settings ) => {\n\t\treturn { ...settings, Edit: memo( settings.edit ) };\n\t} );\n\tconst withBlockEditHooks = createHigherOrderComponent(\n\t\t( OriginalBlockEdit ) => ( props ) => {\n\t\t\tconst context = useBlockEditContext();\n\t\t\t// CAUTION: code added before this line will be executed for all\n\t\t\t// blocks, not just those that support the feature! Code added\n\t\t\t// above this line should be carefully evaluated for its impact on\n\t\t\t// performance.\n\t\t\treturn [\n\t\t\t\t...features.map( ( feature, i ) => {\n\t\t\t\t\tconst {\n\t\t\t\t\t\tEdit,\n\t\t\t\t\t\thasSupport,\n\t\t\t\t\t\tattributeKeys = [],\n\t\t\t\t\t\tshareWithChildBlocks,\n\t\t\t\t\t} = feature;\n\t\t\t\t\tconst shouldDisplayControls =\n\t\t\t\t\t\tcontext[ mayDisplayControlsKey ] ||\n\t\t\t\t\t\t( context[ mayDisplayParentControlsKey ] &&\n\t\t\t\t\t\t\tshareWithChildBlocks );\n\n\t\t\t\t\tif (\n\t\t\t\t\t\t! shouldDisplayControls ||\n\t\t\t\t\t\t! hasSupport( props.name )\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst neededProps = {};\n\t\t\t\t\tfor ( const key of attributeKeys ) {\n\t\t\t\t\t\tif ( props.attributes[ key ] ) {\n\t\t\t\t\t\t\tneededProps[ key ] = props.attributes[ key ];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<Edit\n\t\t\t\t\t\t\t// We can use the index because the array length\n\t\t\t\t\t\t\t// is fixed per page load right now.\n\t\t\t\t\t\t\tkey={ i }\n\t\t\t\t\t\t\tname={ props.name }\n\t\t\t\t\t\t\tisSelected={ props.isSelected }\n\t\t\t\t\t\t\tclientId={ props.clientId }\n\t\t\t\t\t\t\tsetAttributes={ props.setAttributes }\n\t\t\t\t\t\t\t__unstableParentLayout={\n\t\t\t\t\t\t\t\tprops.__unstableParentLayout\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// This component is pure, so only pass needed\n\t\t\t\t\t\t\t// props!!!\n\t\t\t\t\t\t\t{ ...neededProps }\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t} ),\n\t\t\t\t<OriginalBlockEdit key=\"edit\" { ...props } />,\n\t\t\t];\n\t\t},\n\t\t'withBlockEditHooks'\n\t);\n\taddFilter( 'editor.BlockEdit', 'core/editor/hooks', withBlockEditHooks );\n}\n\nfunction BlockProps( {\n\tindex,\n\tuseBlockProps: hook,\n\tsetAllWrapperProps,\n\t...props\n} ) {\n\tconst wrapperProps = hook( props );\n\tconst setWrapperProps = ( next ) =>\n\t\tsetAllWrapperProps( ( prev ) => {\n\t\t\tconst nextAll = [ ...prev ];\n\t\t\tnextAll[ index ] = next;\n\t\t\treturn nextAll;\n\t\t} );\n\t// Setting state after every render is fine because this component is\n\t// pure and will only re-render when needed props change.\n\tuseEffect( () => {\n\t\t// We could shallow compare the props, but since this component only\n\t\t// changes when needed attributes change, the benefit is probably small.\n\t\tsetWrapperProps( wrapperProps );\n\t\treturn () => {\n\t\t\tsetWrapperProps( undefined );\n\t\t};\n\t} );\n\treturn null;\n}\n\nconst BlockPropsPure = memo( BlockProps );\n\nexport function createBlockListBlockFilter( features ) {\n\tconst withBlockListBlockHooks = createHigherOrderComponent(\n\t\t( BlockListBlock ) => ( props ) => {\n\t\t\tconst [ allWrapperProps, setAllWrapperProps ] = useState(\n\t\t\t\tArray( features.length ).fill( undefined )\n\t\t\t);\n\t\t\treturn [\n\t\t\t\t...features.map( ( feature, i ) => {\n\t\t\t\t\tconst {\n\t\t\t\t\t\thasSupport,\n\t\t\t\t\t\tattributeKeys = [],\n\t\t\t\t\t\tuseBlockProps,\n\t\t\t\t\t\tisMatch,\n\t\t\t\t\t} = feature;\n\n\t\t\t\t\tconst neededProps = {};\n\t\t\t\t\tfor ( const key of attributeKeys ) {\n\t\t\t\t\t\tif ( props.attributes[ key ] ) {\n\t\t\t\t\t\t\tneededProps[ key ] = props.attributes[ key ];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (\n\t\t\t\t\t\t// Skip rendering if none of the needed attributes are\n\t\t\t\t\t\t// set.\n\t\t\t\t\t\t! Object.keys( neededProps ).length ||\n\t\t\t\t\t\t! hasSupport( props.name ) ||\n\t\t\t\t\t\t( isMatch && ! isMatch( neededProps ) )\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<BlockPropsPure\n\t\t\t\t\t\t\t// We can use the index because the array length\n\t\t\t\t\t\t\t// is fixed per page load right now.\n\t\t\t\t\t\t\tkey={ i }\n\t\t\t\t\t\t\tindex={ i }\n\t\t\t\t\t\t\tuseBlockProps={ useBlockProps }\n\t\t\t\t\t\t\t// This component is pure, so we must pass a stable\n\t\t\t\t\t\t\t// function reference.\n\t\t\t\t\t\t\tsetAllWrapperProps={ setAllWrapperProps }\n\t\t\t\t\t\t\tname={ props.name }\n\t\t\t\t\t\t\tclientId={ props.clientId }\n\t\t\t\t\t\t\t// This component is pure, so only pass needed\n\t\t\t\t\t\t\t// props!!!\n\t\t\t\t\t\t\t{ ...neededProps }\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t} ),\n\t\t\t\t<BlockListBlock\n\t\t\t\t\tkey=\"edit\"\n\t\t\t\t\t{ ...props }\n\t\t\t\t\twrapperProps={ allWrapperProps\n\t\t\t\t\t\t.filter( Boolean )\n\t\t\t\t\t\t.reduce( ( acc, wrapperProps ) => {\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t...acc,\n\t\t\t\t\t\t\t\t...wrapperProps,\n\t\t\t\t\t\t\t\tclassName: clsx(\n\t\t\t\t\t\t\t\t\tacc.className,\n\t\t\t\t\t\t\t\t\twrapperProps.className\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\t\t\t...acc.style,\n\t\t\t\t\t\t\t\t\t...wrapperProps.style,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}, props.wrapperProps || {} ) }\n\t\t\t\t/>,\n\t\t\t];\n\t\t},\n\t\t'withBlockListBlockHooks'\n\t);\n\taddFilter(\n\t\t'editor.BlockListBlock',\n\t\t'core/editor/hooks',\n\t\twithBlockListBlockHooks\n\t);\n}\n\nexport function createBlockSaveFilter( features ) {\n\tfunction extraPropsFromHooks( props, name, attributes ) {\n\t\treturn features.reduce( ( accu, feature ) => {\n\t\t\tconst { hasSupport, attributeKeys = [], addSaveProps } = feature;\n\n\t\t\tconst neededAttributes = {};\n\t\t\tfor ( const key of attributeKeys ) {\n\t\t\t\tif ( attributes[ key ] ) {\n\t\t\t\t\tneededAttributes[ key ] = attributes[ key ];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\t// Skip rendering if none of the needed attributes are\n\t\t\t\t// set.\n\t\t\t\t! Object.keys( neededAttributes ).length ||\n\t\t\t\t! hasSupport( name )\n\t\t\t) {\n\t\t\t\treturn accu;\n\t\t\t}\n\n\t\t\treturn addSaveProps( accu, name, neededAttributes );\n\t\t}, props );\n\t}\n\taddFilter(\n\t\t'blocks.getSaveContent.extraProps',\n\t\t'core/editor/hooks',\n\t\textraPropsFromHooks,\n\t\t0\n\t);\n\taddFilter(\n\t\t'blocks.getSaveContent.extraProps',\n\t\t'core/editor/hooks',\n\t\t( props ) => {\n\t\t\t// Previously we had a filter deleting the className if it was an empty\n\t\t\t// string. That filter is no longer running, so now we need to delete it\n\t\t\t// here.\n\t\t\tif ( props.hasOwnProperty( 'className' ) && ! props.className ) {\n\t\t\t\tdelete props.className;\n\t\t\t}\n\n\t\t\treturn props;\n\t\t}\n\t);\n}\n"],"mappings":";;;;;;;;;;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AAKA,IAAAK,QAAA,GAAAL,OAAA;AAKA,IAAAM,WAAA,GAAAN,OAAA;AACA,IAAAO,OAAA,GAAAP,OAAA;AACA,IAAAQ,OAAA,GAAAR,OAAA;AACA,IAAAS,MAAA,GAAAT,OAAA;AACA,IAAAU,WAAA,GAAAV,OAAA;AAIA,IAAAW,KAAA,GAAAC,sBAAA,CAAAZ,OAAA;AAAwB,IAAAa,WAAA,GAAAb,OAAA;AAzBxB;AACA;AACA;;AAOA;AACA;AACA;;AAWA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMc,gBAAgB,GAAKC,MAAM,IAAM;EAC7C,IACCA,MAAM,KAAK,IAAI,IACf,OAAOA,MAAM,KAAK,QAAQ,IAC1BC,KAAK,CAACC,OAAO,CAAEF,MAAO,CAAC,EACtB;IACD,OAAOA,MAAM;EACd;EAEA,MAAMG,oBAAoB,GAAGC,MAAM,CAACC,OAAO,CAAEL,MAAO,CAAC,CACnDM,GAAG,CAAE,CAAE,CAAEC,GAAG,EAAEC,K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gD,mBAAmBA,CAAExC,KAAK,EAAE9F,IAAI,EAAEjD,UAAU,EAAG;IACvD,OAAOuI,QAAQ,CAAC2C,MAAM,CAAE,CAAEM,IAAI,EAAE7K,OAAO,KAAM;MAC5C,MAAM;QAAEwI,UAAU;QAAEC,aAAa,GAAG,EAAE;QAAEqC;MAAa,CAAC,GAAG9K,OAAO;MAEhE,MAAM+K,gBAAgB,GAAG,CAAC,CAAC;MAC3B,KAAM,MAAM7M,GAAG,IAAIuK,aAAa,EAAG;QAClC,IAAKpJ,UAAU,CAAEnB,GAAG,CAAE,EAAG;UACxB6M,gBAAgB,CAAE7M,GAAG,CAAE,GAAGmB,UAAU,CAAEnB,GAAG,CAAE;QAC5C;MACD;MAEA;MACC;MACA;MACA,CAAEH,MAAM,CAACsM,IAAI,CAAEU,gBAAiB,CAAC,CAACzM,MAAM,IACxC,CAAEkK,UAAU,CAAElG,IAAK,CAAC,EACnB;QACD,OAAOuI,IAAI;MACZ;MAEA,OAAOC,YAAY,CAAED,IAAI,EAAEvI,IAAI,EAAEyI,gBAAiB,CAAC;IACpD,CAAC,EAAE3C,KAAM,CAAC;EACX;EACA,IAAAe,gBAAS,EACR,kCAAkC,EAClC,mBAAmB,EACnByB,mBAAmB,EACnB,CACD,CAAC;EACD,IAAAzB,gBAAS,EACR,kCAAkC,EAClC,mBAAmB,EACjBf,KAAK,IAAM;IACZ;IACA;IACA;IACA,IAAKA,KAAK,CAAC4C,cAAc,CAAE,WAAY,CAAC,IAAI,CAAE5C,KAAK,CAACqC,SAAS,EAAG;MAC/D,OAAOrC,KAAK,CAACqC,SAAS;IACvB;IAEA,OAAOrC,KAAK;EACb,CACD,CAAC;AACF","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_blocks","require","_element","_data","_compose","_hooks","_context","_components","_hooks2","_object","_store","_lockUnlock","_clsx","_interopRequireDefault","_jsxRuntime","cleanEmptyObject","object","Array","isArray","cleanedNestedObjects","Object","entries","map","key","value","filter","undefined","length","fromEntries","exports","transformStyles","activeSupports","migrationPaths","result","source","index","results","values","every","isActive","innerBlocks","referenceBlockAttributes","attributes","returnBlock","forEach","support","path","styleValue","getValueFromObjectPath","setImmutably","shouldSkipSerialization","blockNameOrType","featureSet","feature","getBlockSupport","skipSerialization","includes","pendingStyleOverrides","WeakMap","useStyleOverride","id","css","usePrivateStyleOverride","assets","__unstableType","variation","clientId","setStyleOverride","deleteStyleOverride","unlock","useDispatch","blockEditorStore","registry","useRegistry","fallbackId","useId","useEffect","_id","override","get","set","push","window","queueMicrotask","batch","args","isPending","find","currentId","useBlockSettings","name","parentLayout","backgroundImage","backgroundSize","customFontFamilies","defaultFontFamilies","themeFontFamilies","defaultFontSizesEnabled","customFontSizes","defaultFontSizes","themeFontSizes","customFontSize","fontStyle","fontWeight","lineHeight","textAlign","textColumns","textDecoration","writingMode","textTransform","letterSpacing","padding","margin","blockGap","defaultSpacingSizesEnabled","customSpacingSize","userSpacingSizes","defaultSpacingSizes","themeSpacingSizes","units","aspectRatio","minHeight","layout","borderColor","borderRadius","borderStyle","borderWidth","customColorsEnabled","customColors","customDuotone","themeColors","defaultColors","defaultPalette","defaultDuotone","userDuotonePalette","themeDuotonePalette","defaultDuotonePalette","userGradientPalette","themeGradientPalette","defaultGradientPalette","defaultGradients","areCustomGradientsEnabled","isBackgroundEnabled","isLinkEnabled","isTextEnabled","isHeadingEnabled","isButtonEnabled","shadow","useSettings","rawSettings","useMemo","background","color","palette","custom","theme","default","gradients","duotone","customGradient","link","heading","button","text","typography","fontFamilies","fontSizes","spacing","spacingSizes","border","radius","style","width","dimensions","useSettingsForBlockElement","createBlockEditFilter","features","settings","Edit","memo","edit","withBlockEditHooks","createHigherOrderComponent","OriginalBlockEdit","props","context","useBlockEditContext","i","hasSupport","attributeKeys","shareWithChildBlocks","shouldDisplayControls","mayDisplayControlsKey","mayDisplayParentControlsKey","neededProps","jsx","isSelected","setAttributes","__unstableParentLayout","addFilter","BlockProps","useBlockProps","hook","setAllWrapperProps","wrapperProps","setWrapperProps","next","prev","nextAll","BlockPropsPure","createBlockListBlockFilter","withBlockListBlockHooks","BlockListBlock","allWrapperProps","useState","fill","isMatch","keys","Boolean","reduce","acc","className","clsx","createBlockSaveFilter","extraPropsFromHooks","accu","addSaveProps","neededAttributes","hasOwnProperty"],"sources":["@wordpress/block-editor/src/hooks/utils.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { getBlockSupport } from '@wordpress/blocks';\nimport { memo, useMemo, useEffect, useId, useState } from '@wordpress/element';\nimport { useDispatch, useRegistry } from '@wordpress/data';\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport { addFilter } from '@wordpress/hooks';\n\n/**\n * Internal dependencies\n */\nimport {\n\tuseBlockEditContext,\n\tmayDisplayControlsKey,\n\tmayDisplayParentControlsKey,\n} from '../components/block-edit/context';\nimport { useSettings } from '../components';\nimport { useSettingsForBlockElement } from '../components/global-styles/hooks';\nimport { getValueFromObjectPath, setImmutably } from '../utils/object';\nimport { store as blockEditorStore } from '../store';\nimport { unlock } from '../lock-unlock';\n/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * Removed falsy values from nested object.\n *\n * @param {*} object\n * @return {*} Object cleaned from falsy values\n */\nexport const cleanEmptyObject = ( object ) => {\n\tif (\n\t\tobject === null ||\n\t\ttypeof object !== 'object' ||\n\t\tArray.isArray( object )\n\t) {\n\t\treturn object;\n\t}\n\n\tconst cleanedNestedObjects = Object.entries( object )\n\t\t.map( ( [ key, value ] ) => [ key, cleanEmptyObject( value ) ] )\n\t\t.filter( ( [ , value ] ) => value !== undefined );\n\treturn ! cleanedNestedObjects.length\n\t\t? undefined\n\t\t: Object.fromEntries( cleanedNestedObjects );\n};\n\nexport function transformStyles(\n\tactiveSupports,\n\tmigrationPaths,\n\tresult,\n\tsource,\n\tindex,\n\tresults\n) {\n\t// If there are no active supports return early.\n\tif (\n\t\tObject.values( activeSupports ?? {} ).every(\n\t\t\t( isActive ) => ! isActive\n\t\t)\n\t) {\n\t\treturn result;\n\t}\n\t// If the condition verifies we are probably in the presence of a wrapping transform\n\t// e.g: nesting paragraphs in a group or columns and in that case the styles should not be transformed.\n\tif ( results.length === 1 && result.innerBlocks.length === source.length ) {\n\t\treturn result;\n\t}\n\t// For cases where we have a transform from one block to multiple blocks\n\t// or multiple blocks to one block we apply the styles of the first source block\n\t// to the result(s).\n\tlet referenceBlockAttributes = source[ 0 ]?.attributes;\n\t// If we are in presence of transform between more than one block in the source\n\t// that has more than one block in the result\n\t// we apply the styles on source N to the result N,\n\t// if source N does not exists we do nothing.\n\tif ( results.length > 1 && source.length > 1 ) {\n\t\tif ( source[ index ] ) {\n\t\t\treferenceBlockAttributes = source[ index ]?.attributes;\n\t\t} else {\n\t\t\treturn result;\n\t\t}\n\t}\n\tlet returnBlock = result;\n\tObject.entries( activeSupports ).forEach( ( [ support, isActive ] ) => {\n\t\tif ( isActive ) {\n\t\t\tmigrationPaths[ support ].forEach( ( path ) => {\n\t\t\t\tconst styleValue = getValueFromObjectPath(\n\t\t\t\t\treferenceBlockAttributes,\n\t\t\t\t\tpath\n\t\t\t\t);\n\t\t\t\tif ( styleValue ) {\n\t\t\t\t\treturnBlock = {\n\t\t\t\t\t\t...returnBlock,\n\t\t\t\t\t\tattributes: setImmutably(\n\t\t\t\t\t\t\treturnBlock.attributes,\n\t\t\t\t\t\t\tpath,\n\t\t\t\t\t\t\tstyleValue\n\t\t\t\t\t\t),\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t} );\n\treturn returnBlock;\n}\n\n/**\n * Check whether serialization of specific block support feature or set should\n * be skipped.\n *\n * @param {string|Object} blockNameOrType Block name or block type object.\n * @param {string} featureSet Name of block support feature set.\n * @param {string} feature Name of the individual feature to check.\n *\n * @return {boolean} Whether serialization should occur.\n */\nexport function shouldSkipSerialization(\n\tblockNameOrType,\n\tfeatureSet,\n\tfeature\n) {\n\tconst support = getBlockSupport( blockNameOrType, featureSet );\n\tconst skipSerialization = support?.skipSerialization;\n\n\tif ( Array.isArray( skipSerialization ) ) {\n\t\treturn skipSerialization.includes( feature );\n\t}\n\n\treturn skipSerialization;\n}\n\nconst pendingStyleOverrides = new WeakMap();\n\n/**\n * Override a block editor settings style. Leave the ID blank to create a new\n * style.\n *\n * @param {Object} override Override object.\n * @param {?string} override.id Id of the style override, leave blank to create\n * a new style.\n * @param {string} override.css CSS to apply.\n */\nexport function useStyleOverride( { id, css } ) {\n\treturn usePrivateStyleOverride( { id, css } );\n}\n\nexport function usePrivateStyleOverride( {\n\tid,\n\tcss,\n\tassets,\n\t__unstableType,\n\tvariation,\n\tclientId,\n} = {} ) {\n\tconst { setStyleOverride, deleteStyleOverride } = unlock(\n\t\tuseDispatch( blockEditorStore )\n\t);\n\tconst registry = useRegistry();\n\tconst fallbackId = useId();\n\tuseEffect( () => {\n\t\t// Unmount if there is CSS and assets are empty.\n\t\tif ( ! css && ! assets ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst _id = id || fallbackId;\n\t\tconst override = {\n\t\t\tid,\n\t\t\tcss,\n\t\t\tassets,\n\t\t\t__unstableType,\n\t\t\tvariation,\n\t\t\tclientId,\n\t\t};\n\t\t// Batch updates to style overrides to avoid triggering cascading renders\n\t\t// for each style override block included in a tree and optimize initial render.\n\t\tif ( ! pendingStyleOverrides.get( registry ) ) {\n\t\t\tpendingStyleOverrides.set( registry, [] );\n\t\t}\n\t\tpendingStyleOverrides.get( registry ).push( [ _id, override ] );\n\t\twindow.queueMicrotask( () => {\n\t\t\tif ( pendingStyleOverrides.get( registry )?.length ) {\n\t\t\t\tregistry.batch( () => {\n\t\t\t\t\tpendingStyleOverrides.get( registry ).forEach( ( args ) => {\n\t\t\t\t\t\tsetStyleOverride( ...args );\n\t\t\t\t\t} );\n\t\t\t\t\tpendingStyleOverrides.set( registry, [] );\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\n\t\treturn () => {\n\t\t\tconst isPending = pendingStyleOverrides\n\t\t\t\t.get( registry )\n\t\t\t\t?.find( ( [ currentId ] ) => currentId === _id );\n\t\t\tif ( isPending ) {\n\t\t\t\tpendingStyleOverrides.set(\n\t\t\t\t\tregistry,\n\t\t\t\t\tpendingStyleOverrides\n\t\t\t\t\t\t.get( registry )\n\t\t\t\t\t\t.filter( ( [ currentId ] ) => currentId !== _id )\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tdeleteStyleOverride( _id );\n\t\t\t}\n\t\t};\n\t}, [\n\t\tid,\n\t\tcss,\n\t\tclientId,\n\t\tassets,\n\t\t__unstableType,\n\t\tfallbackId,\n\t\tsetStyleOverride,\n\t\tdeleteStyleOverride,\n\t\tregistry,\n\t] );\n}\n\n/**\n * Based on the block and its context, returns an object of all the block settings.\n * This object can be passed as a prop to all the Styles UI components\n * (TypographyPanel, DimensionsPanel...).\n *\n * @param {string} name Block name.\n * @param {*} parentLayout Parent layout.\n *\n * @return {Object} Settings object.\n */\nexport function useBlockSettings( name, parentLayout ) {\n\tconst [\n\t\tbackgroundImage,\n\t\tbackgroundSize,\n\t\tcustomFontFamilies,\n\t\tdefaultFontFamilies,\n\t\tthemeFontFamilies,\n\t\tdefaultFontSizesEnabled,\n\t\tcustomFontSizes,\n\t\tdefaultFontSizes,\n\t\tthemeFontSizes,\n\t\tcustomFontSize,\n\t\tfontStyle,\n\t\tfontWeight,\n\t\tlineHeight,\n\t\ttextAlign,\n\t\ttextColumns,\n\t\ttextDecoration,\n\t\twritingMode,\n\t\ttextTransform,\n\t\tletterSpacing,\n\t\tpadding,\n\t\tmargin,\n\t\tblockGap,\n\t\tdefaultSpacingSizesEnabled,\n\t\tcustomSpacingSize,\n\t\tuserSpacingSizes,\n\t\tdefaultSpacingSizes,\n\t\tthemeSpacingSizes,\n\t\tunits,\n\t\taspectRatio,\n\t\tminHeight,\n\t\tlayout,\n\t\tborderColor,\n\t\tborderRadius,\n\t\tborderStyle,\n\t\tborderWidth,\n\t\tcustomColorsEnabled,\n\t\tcustomColors,\n\t\tcustomDuotone,\n\t\tthemeColors,\n\t\tdefaultColors,\n\t\tdefaultPalette,\n\t\tdefaultDuotone,\n\t\tuserDuotonePalette,\n\t\tthemeDuotonePalette,\n\t\tdefaultDuotonePalette,\n\t\tuserGradientPalette,\n\t\tthemeGradientPalette,\n\t\tdefaultGradientPalette,\n\t\tdefaultGradients,\n\t\tareCustomGradientsEnabled,\n\t\tisBackgroundEnabled,\n\t\tisLinkEnabled,\n\t\tisTextEnabled,\n\t\tisHeadingEnabled,\n\t\tisButtonEnabled,\n\t\tshadow,\n\t] = useSettings(\n\t\t'background.backgroundImage',\n\t\t'background.backgroundSize',\n\t\t'typography.fontFamilies.custom',\n\t\t'typography.fontFamilies.default',\n\t\t'typography.fontFamilies.theme',\n\t\t'typography.defaultFontSizes',\n\t\t'typography.fontSizes.custom',\n\t\t'typography.fontSizes.default',\n\t\t'typography.fontSizes.theme',\n\t\t'typography.customFontSize',\n\t\t'typography.fontStyle',\n\t\t'typography.fontWeight',\n\t\t'typography.lineHeight',\n\t\t'typography.textAlign',\n\t\t'typography.textColumns',\n\t\t'typography.textDecoration',\n\t\t'typography.writingMode',\n\t\t'typography.textTransform',\n\t\t'typography.letterSpacing',\n\t\t'spacing.padding',\n\t\t'spacing.margin',\n\t\t'spacing.blockGap',\n\t\t'spacing.defaultSpacingSizes',\n\t\t'spacing.customSpacingSize',\n\t\t'spacing.spacingSizes.custom',\n\t\t'spacing.spacingSizes.default',\n\t\t'spacing.spacingSizes.theme',\n\t\t'spacing.units',\n\t\t'dimensions.aspectRatio',\n\t\t'dimensions.minHeight',\n\t\t'layout',\n\t\t'border.color',\n\t\t'border.radius',\n\t\t'border.style',\n\t\t'border.width',\n\t\t'color.custom',\n\t\t'color.palette.custom',\n\t\t'color.customDuotone',\n\t\t'color.palette.theme',\n\t\t'color.palette.default',\n\t\t'color.defaultPalette',\n\t\t'color.defaultDuotone',\n\t\t'color.duotone.custom',\n\t\t'color.duotone.theme',\n\t\t'color.duotone.default',\n\t\t'color.gradients.custom',\n\t\t'color.gradients.theme',\n\t\t'color.gradients.default',\n\t\t'color.defaultGradients',\n\t\t'color.customGradient',\n\t\t'color.background',\n\t\t'color.link',\n\t\t'color.text',\n\t\t'color.heading',\n\t\t'color.button',\n\t\t'shadow'\n\t);\n\n\tconst rawSettings = useMemo( () => {\n\t\treturn {\n\t\t\tbackground: {\n\t\t\t\tbackgroundImage,\n\t\t\t\tbackgroundSize,\n\t\t\t},\n\t\t\tcolor: {\n\t\t\t\tpalette: {\n\t\t\t\t\tcustom: customColors,\n\t\t\t\t\ttheme: themeColors,\n\t\t\t\t\tdefault: defaultColors,\n\t\t\t\t},\n\t\t\t\tgradients: {\n\t\t\t\t\tcustom: userGradientPalette,\n\t\t\t\t\ttheme: themeGradientPalette,\n\t\t\t\t\tdefault: defaultGradientPalette,\n\t\t\t\t},\n\t\t\t\tduotone: {\n\t\t\t\t\tcustom: userDuotonePalette,\n\t\t\t\t\ttheme: themeDuotonePalette,\n\t\t\t\t\tdefault: defaultDuotonePalette,\n\t\t\t\t},\n\t\t\t\tdefaultGradients,\n\t\t\t\tdefaultPalette,\n\t\t\t\tdefaultDuotone,\n\t\t\t\tcustom: customColorsEnabled,\n\t\t\t\tcustomGradient: areCustomGradientsEnabled,\n\t\t\t\tcustomDuotone,\n\t\t\t\tbackground: isBackgroundEnabled,\n\t\t\t\tlink: isLinkEnabled,\n\t\t\t\theading: isHeadingEnabled,\n\t\t\t\tbutton: isButtonEnabled,\n\t\t\t\ttext: isTextEnabled,\n\t\t\t},\n\t\t\ttypography: {\n\t\t\t\tfontFamilies: {\n\t\t\t\t\tcustom: customFontFamilies,\n\t\t\t\t\tdefault: defaultFontFamilies,\n\t\t\t\t\ttheme: themeFontFamilies,\n\t\t\t\t},\n\t\t\t\tfontSizes: {\n\t\t\t\t\tcustom: customFontSizes,\n\t\t\t\t\tdefault: defaultFontSizes,\n\t\t\t\t\ttheme: themeFontSizes,\n\t\t\t\t},\n\t\t\t\tcustomFontSize,\n\t\t\t\tdefaultFontSizes: defaultFontSizesEnabled,\n\t\t\t\tfontStyle,\n\t\t\t\tfontWeight,\n\t\t\t\tlineHeight,\n\t\t\t\ttextAlign,\n\t\t\t\ttextColumns,\n\t\t\t\ttextDecoration,\n\t\t\t\ttextTransform,\n\t\t\t\tletterSpacing,\n\t\t\t\twritingMode,\n\t\t\t},\n\t\t\tspacing: {\n\t\t\t\tspacingSizes: {\n\t\t\t\t\tcustom: userSpacingSizes,\n\t\t\t\t\tdefault: defaultSpacingSizes,\n\t\t\t\t\ttheme: themeSpacingSizes,\n\t\t\t\t},\n\t\t\t\tcustomSpacingSize,\n\t\t\t\tdefaultSpacingSizes: defaultSpacingSizesEnabled,\n\t\t\t\tpadding,\n\t\t\t\tmargin,\n\t\t\t\tblockGap,\n\t\t\t\tunits,\n\t\t\t},\n\t\t\tborder: {\n\t\t\t\tcolor: borderColor,\n\t\t\t\tradius: borderRadius,\n\t\t\t\tstyle: borderStyle,\n\t\t\t\twidth: borderWidth,\n\t\t\t},\n\t\t\tdimensions: {\n\t\t\t\taspectRatio,\n\t\t\t\tminHeight,\n\t\t\t},\n\t\t\tlayout,\n\t\t\tparentLayout,\n\t\t\tshadow,\n\t\t};\n\t}, [\n\t\tbackgroundImage,\n\t\tbackgroundSize,\n\t\tcustomFontFamilies,\n\t\tdefaultFontFamilies,\n\t\tthemeFontFamilies,\n\t\tdefaultFontSizesEnabled,\n\t\tcustomFontSizes,\n\t\tdefaultFontSizes,\n\t\tthemeFontSizes,\n\t\tcustomFontSize,\n\t\tfontStyle,\n\t\tfontWeight,\n\t\tlineHeight,\n\t\ttextAlign,\n\t\ttextColumns,\n\t\ttextDecoration,\n\t\ttextTransform,\n\t\tletterSpacing,\n\t\twritingMode,\n\t\tpadding,\n\t\tmargin,\n\t\tblockGap,\n\t\tdefaultSpacingSizesEnabled,\n\t\tcustomSpacingSize,\n\t\tuserSpacingSizes,\n\t\tdefaultSpacingSizes,\n\t\tthemeSpacingSizes,\n\t\tunits,\n\t\taspectRatio,\n\t\tminHeight,\n\t\tlayout,\n\t\tparentLayout,\n\t\tborderColor,\n\t\tborderRadius,\n\t\tborderStyle,\n\t\tborderWidth,\n\t\tcustomColorsEnabled,\n\t\tcustomColors,\n\t\tcustomDuotone,\n\t\tthemeColors,\n\t\tdefaultColors,\n\t\tdefaultPalette,\n\t\tdefaultDuotone,\n\t\tuserDuotonePalette,\n\t\tthemeDuotonePalette,\n\t\tdefaultDuotonePalette,\n\t\tuserGradientPalette,\n\t\tthemeGradientPalette,\n\t\tdefaultGradientPalette,\n\t\tdefaultGradients,\n\t\tareCustomGradientsEnabled,\n\t\tisBackgroundEnabled,\n\t\tisLinkEnabled,\n\t\tisTextEnabled,\n\t\tisHeadingEnabled,\n\t\tisButtonEnabled,\n\t\tshadow,\n\t] );\n\n\treturn useSettingsForBlockElement( rawSettings, name );\n}\n\nexport function createBlockEditFilter( features ) {\n\t// We don't want block controls to re-render when typing inside a block.\n\t// `memo` will prevent re-renders unless props change, so only pass the\n\t// needed props and not the whole attributes object.\n\tfeatures = features.map( ( settings ) => {\n\t\treturn { ...settings, Edit: memo( settings.edit ) };\n\t} );\n\tconst withBlockEditHooks = createHigherOrderComponent(\n\t\t( OriginalBlockEdit ) => ( props ) => {\n\t\t\tconst context = useBlockEditContext();\n\t\t\t// CAUTION: code added before this line will be executed for all\n\t\t\t// blocks, not just those that support the feature! Code added\n\t\t\t// above this line should be carefully evaluated for its impact on\n\t\t\t// performance.\n\t\t\treturn [\n\t\t\t\t...features.map( ( feature, i ) => {\n\t\t\t\t\tconst {\n\t\t\t\t\t\tEdit,\n\t\t\t\t\t\thasSupport,\n\t\t\t\t\t\tattributeKeys = [],\n\t\t\t\t\t\tshareWithChildBlocks,\n\t\t\t\t\t} = feature;\n\t\t\t\t\tconst shouldDisplayControls =\n\t\t\t\t\t\tcontext[ mayDisplayControlsKey ] ||\n\t\t\t\t\t\t( context[ mayDisplayParentControlsKey ] &&\n\t\t\t\t\t\t\tshareWithChildBlocks );\n\n\t\t\t\t\tif (\n\t\t\t\t\t\t! shouldDisplayControls ||\n\t\t\t\t\t\t! hasSupport( props.name )\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst neededProps = {};\n\t\t\t\t\tfor ( const key of attributeKeys ) {\n\t\t\t\t\t\tif ( props.attributes[ key ] ) {\n\t\t\t\t\t\t\tneededProps[ key ] = props.attributes[ key ];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<Edit\n\t\t\t\t\t\t\t// We can use the index because the array length\n\t\t\t\t\t\t\t// is fixed per page load right now.\n\t\t\t\t\t\t\tkey={ i }\n\t\t\t\t\t\t\tname={ props.name }\n\t\t\t\t\t\t\tisSelected={ props.isSelected }\n\t\t\t\t\t\t\tclientId={ props.clientId }\n\t\t\t\t\t\t\tsetAttributes={ props.setAttributes }\n\t\t\t\t\t\t\t__unstableParentLayout={\n\t\t\t\t\t\t\t\tprops.__unstableParentLayout\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// This component is pure, so only pass needed\n\t\t\t\t\t\t\t// props!!!\n\t\t\t\t\t\t\t{ ...neededProps }\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t} ),\n\t\t\t\t<OriginalBlockEdit key=\"edit\" { ...props } />,\n\t\t\t];\n\t\t},\n\t\t'withBlockEditHooks'\n\t);\n\taddFilter( 'editor.BlockEdit', 'core/editor/hooks', withBlockEditHooks );\n}\n\nfunction BlockProps( {\n\tindex,\n\tuseBlockProps: hook,\n\tsetAllWrapperProps,\n\t...props\n} ) {\n\tconst wrapperProps = hook( props );\n\tconst setWrapperProps = ( next ) =>\n\t\tsetAllWrapperProps( ( prev ) => {\n\t\t\tconst nextAll = [ ...prev ];\n\t\t\tnextAll[ index ] = next;\n\t\t\treturn nextAll;\n\t\t} );\n\t// Setting state after every render is fine because this component is\n\t// pure and will only re-render when needed props change.\n\tuseEffect( () => {\n\t\t// We could shallow compare the props, but since this component only\n\t\t// changes when needed attributes change, the benefit is probably small.\n\t\tsetWrapperProps( wrapperProps );\n\t\treturn () => {\n\t\t\tsetWrapperProps( undefined );\n\t\t};\n\t} );\n\treturn null;\n}\n\nconst BlockPropsPure = memo( BlockProps );\n\nexport function createBlockListBlockFilter( features ) {\n\tconst withBlockListBlockHooks = createHigherOrderComponent(\n\t\t( BlockListBlock ) => ( props ) => {\n\t\t\tconst [ allWrapperProps, setAllWrapperProps ] = useState(\n\t\t\t\tArray( features.length ).fill( undefined )\n\t\t\t);\n\t\t\treturn [\n\t\t\t\t...features.map( ( feature, i ) => {\n\t\t\t\t\tconst {\n\t\t\t\t\t\thasSupport,\n\t\t\t\t\t\tattributeKeys = [],\n\t\t\t\t\t\tuseBlockProps,\n\t\t\t\t\t\tisMatch,\n\t\t\t\t\t} = feature;\n\n\t\t\t\t\tconst neededProps = {};\n\t\t\t\t\tfor ( const key of attributeKeys ) {\n\t\t\t\t\t\tif ( props.attributes[ key ] ) {\n\t\t\t\t\t\t\tneededProps[ key ] = props.attributes[ key ];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (\n\t\t\t\t\t\t// Skip rendering if none of the needed attributes are\n\t\t\t\t\t\t// set.\n\t\t\t\t\t\t! Object.keys( neededProps ).length ||\n\t\t\t\t\t\t! hasSupport( props.name ) ||\n\t\t\t\t\t\t( isMatch && ! isMatch( neededProps ) )\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<BlockPropsPure\n\t\t\t\t\t\t\t// We can use the index because the array length\n\t\t\t\t\t\t\t// is fixed per page load right now.\n\t\t\t\t\t\t\tkey={ i }\n\t\t\t\t\t\t\tindex={ i }\n\t\t\t\t\t\t\tuseBlockProps={ useBlockProps }\n\t\t\t\t\t\t\t// This component is pure, so we must pass a stable\n\t\t\t\t\t\t\t// function reference.\n\t\t\t\t\t\t\tsetAllWrapperProps={ setAllWrapperProps }\n\t\t\t\t\t\t\tname={ props.name }\n\t\t\t\t\t\t\tclientId={ props.clientId }\n\t\t\t\t\t\t\t// This component is pure, so only pass needed\n\t\t\t\t\t\t\t// props!!!\n\t\t\t\t\t\t\t{ ...neededProps }\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t} ),\n\t\t\t\t<BlockListBlock\n\t\t\t\t\tkey=\"edit\"\n\t\t\t\t\t{ ...props }\n\t\t\t\t\twrapperProps={ allWrapperProps\n\t\t\t\t\t\t.filter( Boolean )\n\t\t\t\t\t\t.reduce( ( acc, wrapperProps ) => {\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t...acc,\n\t\t\t\t\t\t\t\t...wrapperProps,\n\t\t\t\t\t\t\t\tclassName: clsx(\n\t\t\t\t\t\t\t\t\tacc.className,\n\t\t\t\t\t\t\t\t\twrapperProps.className\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\t\t\t...acc.style,\n\t\t\t\t\t\t\t\t\t...wrapperProps.style,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}, props.wrapperProps || {} ) }\n\t\t\t\t/>,\n\t\t\t];\n\t\t},\n\t\t'withBlockListBlockHooks'\n\t);\n\taddFilter(\n\t\t'editor.BlockListBlock',\n\t\t'core/editor/hooks',\n\t\twithBlockListBlockHooks\n\t);\n}\n\nexport function createBlockSaveFilter( features ) {\n\tfunction extraPropsFromHooks( props, name, attributes ) {\n\t\treturn features.reduce( ( accu, feature ) => {\n\t\t\tconst { hasSupport, attributeKeys = [], addSaveProps } = feature;\n\n\t\t\tconst neededAttributes = {};\n\t\t\tfor ( const key of attributeKeys ) {\n\t\t\t\tif ( attributes[ key ] ) {\n\t\t\t\t\tneededAttributes[ key ] = attributes[ key ];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\t// Skip rendering if none of the needed attributes are\n\t\t\t\t// set.\n\t\t\t\t! Object.keys( neededAttributes ).length ||\n\t\t\t\t! hasSupport( name )\n\t\t\t) {\n\t\t\t\treturn accu;\n\t\t\t}\n\n\t\t\treturn addSaveProps( accu, name, neededAttributes );\n\t\t}, props );\n\t}\n\taddFilter(\n\t\t'blocks.getSaveContent.extraProps',\n\t\t'core/editor/hooks',\n\t\textraPropsFromHooks,\n\t\t0\n\t);\n\taddFilter(\n\t\t'blocks.getSaveContent.extraProps',\n\t\t'core/editor/hooks',\n\t\t( props ) => {\n\t\t\t// Previously we had a filter deleting the className if it was an empty\n\t\t\t// string. That filter is no longer running, so now we need to delete it\n\t\t\t// here.\n\t\t\tif ( props.hasOwnProperty( 'className' ) && ! props.className ) {\n\t\t\t\tdelete props.className;\n\t\t\t}\n\n\t\t\treturn props;\n\t\t}\n\t);\n}\n"],"mappings":";;;;;;;;;;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AAKA,IAAAK,QAAA,GAAAL,OAAA;AAKA,IAAAM,WAAA,GAAAN,OAAA;AACA,IAAAO,OAAA,GAAAP,OAAA;AACA,IAAAQ,OAAA,GAAAR,OAAA;AACA,IAAAS,MAAA,GAAAT,OAAA;AACA,IAAAU,WAAA,GAAAV,OAAA;AAIA,IAAAW,KAAA,GAAAC,sBAAA,CAAAZ,OAAA;AAAwB,IAAAa,WAAA,GAAAb,OAAA;AAzBxB;AACA;AACA;;AAOA;AACA;AACA;;AAWA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMc,gBAAgB,GAAKC,MAAM,IAAM;EAC7C,IACCA,MAAM,KAAK,IAAI,IACf,OAAOA,MAAM,KAAK,QAAQ,IAC1BC,KAAK,CAACC,OAAO,CAAEF,MAAO,CAAC,EAC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18 @@ var _default = exports.default = {
|
|
|
53
53
|
layoutBlockSupport = {}
|
|
54
54
|
}) {
|
|
55
55
|
const {
|
|
56
|
-
allowOrientation = true
|
|
56
|
+
allowOrientation = true,
|
|
57
|
+
allowJustification = true
|
|
57
58
|
} = layoutBlockSupport;
|
|
58
59
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
59
60
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.Flex, {
|
|
60
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.FlexItem, {
|
|
61
|
+
children: [allowJustification && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.FlexItem, {
|
|
61
62
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(FlexLayoutJustifyContentControl, {
|
|
62
63
|
layout: layout,
|
|
63
64
|
onChange: onChange
|
|
64
65
|
})
|
|
65
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.FlexItem, {
|
|
66
|
-
children:
|
|
66
|
+
}), allowOrientation && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.FlexItem, {
|
|
67
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(OrientationControl, {
|
|
67
68
|
layout: layout,
|
|
68
69
|
onChange: onChange
|
|
69
70
|
})
|
|
@@ -79,16 +80,17 @@ var _default = exports.default = {
|
|
|
79
80
|
onChange,
|
|
80
81
|
layoutBlockSupport
|
|
81
82
|
}) {
|
|
82
|
-
if (layoutBlockSupport?.allowSwitching) {
|
|
83
|
-
return null;
|
|
84
|
-
}
|
|
85
83
|
const {
|
|
86
|
-
allowVerticalAlignment = true
|
|
84
|
+
allowVerticalAlignment = true,
|
|
85
|
+
allowJustification = true
|
|
87
86
|
} = layoutBlockSupport;
|
|
87
|
+
if (!allowJustification && !allowVerticalAlignment) {
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
88
90
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components2.BlockControls, {
|
|
89
91
|
group: "block",
|
|
90
92
|
__experimentalShareWithChildBlocks: true,
|
|
91
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(FlexLayoutJustifyContentControl, {
|
|
93
|
+
children: [allowJustification && /*#__PURE__*/(0, _jsxRuntime.jsx)(FlexLayoutJustifyContentControl, {
|
|
92
94
|
layout: layout,
|
|
93
95
|
onChange: onChange,
|
|
94
96
|
isToolbar: true
|