@wordpress/block-editor 13.0.2 → 13.0.4

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.
Files changed (95) hide show
  1. package/build/components/block-toolbar/shuffle.js +3 -1
  2. package/build/components/block-toolbar/shuffle.js.map +1 -1
  3. package/build/components/global-styles/background-panel.js +2 -1
  4. package/build/components/global-styles/background-panel.js.map +1 -1
  5. package/build/components/global-styles/border-panel.js +2 -1
  6. package/build/components/global-styles/border-panel.js.map +1 -1
  7. package/build/components/global-styles/color-panel.js +2 -1
  8. package/build/components/global-styles/color-panel.js.map +1 -1
  9. package/build/components/global-styles/dimensions-panel.js +2 -1
  10. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  11. package/build/components/global-styles/filters-panel.js +2 -1
  12. package/build/components/global-styles/filters-panel.js.map +1 -1
  13. package/build/components/global-styles/image-settings-panel.js +2 -1
  14. package/build/components/global-styles/image-settings-panel.js.map +1 -1
  15. package/build/components/global-styles/typography-panel.js +2 -1
  16. package/build/components/global-styles/typography-panel.js.map +1 -1
  17. package/build/components/global-styles/use-global-styles-output.js +4 -3
  18. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  19. package/build/components/global-styles/utils.js +17 -7
  20. package/build/components/global-styles/utils.js.map +1 -1
  21. package/build/components/image-editor/aspect-ratio-dropdown.js +0 -1
  22. package/build/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
  23. package/build/components/inspector-controls/block-support-tools-panel.js +2 -1
  24. package/build/components/inspector-controls/block-support-tools-panel.js.map +1 -1
  25. package/build/hooks/block-style-variation.js +112 -5
  26. package/build/hooks/block-style-variation.js.map +1 -1
  27. package/build/hooks/duotone.js +16 -11
  28. package/build/hooks/duotone.js.map +1 -1
  29. package/build/hooks/index.js +7 -1
  30. package/build/hooks/index.js.map +1 -1
  31. package/build/hooks/use-bindings-attributes.js +11 -6
  32. package/build/hooks/use-bindings-attributes.js.map +1 -1
  33. package/build/hooks/utils.js +2 -0
  34. package/build/hooks/utils.js.map +1 -1
  35. package/build/private-apis.js +2 -1
  36. package/build/private-apis.js.map +1 -1
  37. package/build-module/components/block-toolbar/shuffle.js +3 -1
  38. package/build-module/components/block-toolbar/shuffle.js.map +1 -1
  39. package/build-module/components/global-styles/background-panel.js +3 -2
  40. package/build-module/components/global-styles/background-panel.js.map +1 -1
  41. package/build-module/components/global-styles/border-panel.js +3 -2
  42. package/build-module/components/global-styles/border-panel.js.map +1 -1
  43. package/build-module/components/global-styles/color-panel.js +3 -2
  44. package/build-module/components/global-styles/color-panel.js.map +1 -1
  45. package/build-module/components/global-styles/dimensions-panel.js +3 -2
  46. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  47. package/build-module/components/global-styles/filters-panel.js +3 -2
  48. package/build-module/components/global-styles/filters-panel.js.map +1 -1
  49. package/build-module/components/global-styles/image-settings-panel.js +3 -2
  50. package/build-module/components/global-styles/image-settings-panel.js.map +1 -1
  51. package/build-module/components/global-styles/typography-panel.js +3 -2
  52. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  53. package/build-module/components/global-styles/use-global-styles-output.js +4 -3
  54. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  55. package/build-module/components/global-styles/utils.js +15 -6
  56. package/build-module/components/global-styles/utils.js.map +1 -1
  57. package/build-module/components/image-editor/aspect-ratio-dropdown.js +0 -1
  58. package/build-module/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
  59. package/build-module/components/inspector-controls/block-support-tools-panel.js +3 -2
  60. package/build-module/components/inspector-controls/block-support-tools-panel.js.map +1 -1
  61. package/build-module/hooks/block-style-variation.js +112 -5
  62. package/build-module/hooks/block-style-variation.js.map +1 -1
  63. package/build-module/hooks/duotone.js +16 -11
  64. package/build-module/hooks/duotone.js.map +1 -1
  65. package/build-module/hooks/index.js +1 -0
  66. package/build-module/hooks/index.js.map +1 -1
  67. package/build-module/hooks/use-bindings-attributes.js +11 -6
  68. package/build-module/hooks/use-bindings-attributes.js.map +1 -1
  69. package/build-module/hooks/utils.js +2 -0
  70. package/build-module/hooks/utils.js.map +1 -1
  71. package/build-module/private-apis.js +3 -2
  72. package/build-module/private-apis.js.map +1 -1
  73. package/build-style/content-rtl.css +1 -0
  74. package/build-style/content.css +1 -0
  75. package/package.json +7 -7
  76. package/src/components/block-toolbar/shuffle.js +3 -1
  77. package/src/components/global-styles/background-panel.js +3 -2
  78. package/src/components/global-styles/border-panel.js +3 -2
  79. package/src/components/global-styles/color-panel.js +3 -2
  80. package/src/components/global-styles/dimensions-panel.js +3 -2
  81. package/src/components/global-styles/filters-panel.js +3 -2
  82. package/src/components/global-styles/image-settings-panel.js +3 -2
  83. package/src/components/global-styles/test/use-global-styles-output.js +38 -3
  84. package/src/components/global-styles/typography-panel.js +3 -2
  85. package/src/components/global-styles/use-global-styles-output.js +4 -3
  86. package/src/components/global-styles/utils.js +17 -6
  87. package/src/components/iframe/content.scss +1 -0
  88. package/src/components/image-editor/aspect-ratio-dropdown.js +0 -1
  89. package/src/components/inspector-controls/block-support-tools-panel.js +3 -3
  90. package/src/hooks/block-style-variation.js +127 -4
  91. package/src/hooks/duotone.js +16 -12
  92. package/src/hooks/index.js +1 -0
  93. package/src/hooks/use-bindings-attributes.js +13 -4
  94. package/src/hooks/utils.js +2 -0
  95. package/src/private-apis.js +6 -1
@@ -1 +1 @@
1
- {"version":3,"names":["_colord","require","_names","_interopRequireDefault","_blocks","_compose","_hooks","_element","_components","_utils","_getBlockCssSelector","_utils2","_utils3","_filtersPanel","_blockEditingMode","_useBlockRefs","_jsxRuntime","EMPTY_ARRAY","isSafari","window","navigator","userAgent","includes","extend","namesPlugin","useMultiOriginPresets","presetSetting","defaultSetting","enableDefault","userPresets","themePresets","defaultPresets","useSettings","useMemo","getColorsFromDuotonePreset","duotone","duotonePalette","preset","find","slug","colors","undefined","getDuotonePresetFromColors","Array","isArray","duotonePreset","every","val","index","DuotonePanelPure","style","setAttributes","name","duotoneStyle","color","settings","useBlockSettings","blockEditingMode","useBlockEditingMode","colorPalette","enableCustomColors","enableCustomDuotone","disableCustomColors","disableCustomDuotone","length","duotonePresetOrColors","jsxs","Fragment","children","jsx","InspectorControls","group","default","value","filter","onChange","newDuotone","newStyle","BlockControls","__experimentalShareWithChildBlocks","__experimentalDuotoneControl","maybePreset","_default","exports","shareWithChildBlocks","edit","useBlockProps","attributeKeys","hasSupport","hasBlockSupport","addDuotoneAttributes","attributes","Object","assign","type","useDuotoneStyles","clientId","id","filterId","selector","duotoneSelector","attribute","duotoneAttr","isCustom","isPreset","isCSS","selectors","split","selectorsScoped","map","selectorPart","trim","join","isValidFilter","useStyleOverride","css","getDuotoneStylesheet","getDuotoneUnsetStylesheet","__unstableType","assets","getDuotoneFilter","blockElement","useBlockElement","useEffect","display","offsetHeight","useInstanceId","blockType","getBlockType","duotoneSupport","getBlockSupport","experimentalDuotone","rootSelector","getBlockCSSSelector","scopeSelector","fallback","filterClass","shouldRender","className","addFilter"],"sources":["@wordpress/block-editor/src/hooks/duotone.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { extend } from 'colord';\nimport namesPlugin from 'colord/plugins/names';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tgetBlockSupport,\n\tgetBlockType,\n\thasBlockSupport,\n} from '@wordpress/blocks';\nimport { useInstanceId } from '@wordpress/compose';\nimport { addFilter } from '@wordpress/hooks';\nimport { useMemo, useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport {\n\tBlockControls,\n\tInspectorControls,\n\t__experimentalDuotoneControl as DuotoneControl,\n\tuseSettings,\n} from '../components';\nimport {\n\tgetDuotoneFilter,\n\tgetDuotoneStylesheet,\n\tgetDuotoneUnsetStylesheet,\n} from '../components/duotone/utils';\nimport { getBlockCSSSelector } from '../components/global-styles/get-block-css-selector';\nimport { scopeSelector } from '../components/global-styles/utils';\nimport { useBlockSettings, useStyleOverride } from './utils';\nimport { default as StylesFiltersPanel } from '../components/global-styles/filters-panel';\nimport { useBlockEditingMode } from '../components/block-editing-mode';\nimport { __unstableUseBlockElement as useBlockElement } from '../components/block-list/use-block-props/use-block-refs';\n\nconst EMPTY_ARRAY = [];\n\n// Safari does not always update the duotone filter when the duotone colors\n// are changed. This browser check is later used to force a re-render of the block\n// element to ensure the duotone filter is updated. The check is included at the\n// root of this file as it only needs to be run once per page load.\nconst isSafari =\n\twindow?.navigator.userAgent &&\n\twindow.navigator.userAgent.includes( 'Safari' ) &&\n\t! window.navigator.userAgent.includes( 'Chrome' ) &&\n\t! window.navigator.userAgent.includes( 'Chromium' );\n\nextend( [ namesPlugin ] );\n\nfunction useMultiOriginPresets( { presetSetting, defaultSetting } ) {\n\tconst [ enableDefault, userPresets, themePresets, defaultPresets ] =\n\t\tuseSettings(\n\t\t\tdefaultSetting,\n\t\t\t`${ presetSetting }.custom`,\n\t\t\t`${ presetSetting }.theme`,\n\t\t\t`${ presetSetting }.default`\n\t\t);\n\treturn useMemo(\n\t\t() => [\n\t\t\t...( userPresets || EMPTY_ARRAY ),\n\t\t\t...( themePresets || EMPTY_ARRAY ),\n\t\t\t...( ( enableDefault && defaultPresets ) || EMPTY_ARRAY ),\n\t\t],\n\t\t[ enableDefault, userPresets, themePresets, defaultPresets ]\n\t);\n}\n\nexport function getColorsFromDuotonePreset( duotone, duotonePalette ) {\n\tif ( ! duotone ) {\n\t\treturn;\n\t}\n\tconst preset = duotonePalette?.find( ( { slug } ) => {\n\t\treturn duotone === `var:preset|duotone|${ slug }`;\n\t} );\n\n\treturn preset ? preset.colors : undefined;\n}\n\nexport function getDuotonePresetFromColors( colors, duotonePalette ) {\n\tif ( ! colors || ! Array.isArray( colors ) ) {\n\t\treturn;\n\t}\n\n\tconst preset = duotonePalette?.find( ( duotonePreset ) => {\n\t\treturn duotonePreset?.colors?.every(\n\t\t\t( val, index ) => val === colors[ index ]\n\t\t);\n\t} );\n\n\treturn preset ? `var:preset|duotone|${ preset.slug }` : undefined;\n}\n\nfunction DuotonePanelPure( { style, setAttributes, name } ) {\n\tconst duotoneStyle = style?.color?.duotone;\n\tconst settings = useBlockSettings( name );\n\tconst blockEditingMode = useBlockEditingMode();\n\n\tconst duotonePalette = useMultiOriginPresets( {\n\t\tpresetSetting: 'color.duotone',\n\t\tdefaultSetting: 'color.defaultDuotone',\n\t} );\n\tconst colorPalette = useMultiOriginPresets( {\n\t\tpresetSetting: 'color.palette',\n\t\tdefaultSetting: 'color.defaultPalette',\n\t} );\n\tconst [ enableCustomColors, enableCustomDuotone ] = useSettings(\n\t\t'color.custom',\n\t\t'color.customDuotone'\n\t);\n\tconst disableCustomColors = ! enableCustomColors;\n\tconst disableCustomDuotone =\n\t\t! enableCustomDuotone ||\n\t\t( colorPalette?.length === 0 && disableCustomColors );\n\n\tif ( duotonePalette?.length === 0 && disableCustomDuotone ) {\n\t\treturn null;\n\t}\n\n\tif ( blockEditingMode !== 'default' ) {\n\t\treturn null;\n\t}\n\n\tconst duotonePresetOrColors = ! Array.isArray( duotoneStyle )\n\t\t? getColorsFromDuotonePreset( duotoneStyle, duotonePalette )\n\t\t: duotoneStyle;\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls group=\"filter\">\n\t\t\t\t<StylesFiltersPanel\n\t\t\t\t\tvalue={ { filter: { duotone: duotonePresetOrColors } } }\n\t\t\t\t\tonChange={ ( newDuotone ) => {\n\t\t\t\t\t\tconst newStyle = {\n\t\t\t\t\t\t\t...style,\n\t\t\t\t\t\t\tcolor: {\n\t\t\t\t\t\t\t\t...newDuotone?.filter,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t};\n\t\t\t\t\t\tsetAttributes( { style: newStyle } );\n\t\t\t\t\t} }\n\t\t\t\t\tsettings={ settings }\n\t\t\t\t/>\n\t\t\t</InspectorControls>\n\t\t\t<BlockControls group=\"block\" __experimentalShareWithChildBlocks>\n\t\t\t\t<DuotoneControl\n\t\t\t\t\tduotonePalette={ duotonePalette }\n\t\t\t\t\tcolorPalette={ colorPalette }\n\t\t\t\t\tdisableCustomDuotone={ disableCustomDuotone }\n\t\t\t\t\tdisableCustomColors={ disableCustomColors }\n\t\t\t\t\tvalue={ duotonePresetOrColors }\n\t\t\t\t\tonChange={ ( newDuotone ) => {\n\t\t\t\t\t\tconst maybePreset = getDuotonePresetFromColors(\n\t\t\t\t\t\t\tnewDuotone,\n\t\t\t\t\t\t\tduotonePalette\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tconst newStyle = {\n\t\t\t\t\t\t\t...style,\n\t\t\t\t\t\t\tcolor: {\n\t\t\t\t\t\t\t\t...style?.color,\n\t\t\t\t\t\t\t\tduotone: maybePreset ?? newDuotone, // use preset or fallback to custom colors.\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t};\n\t\t\t\t\t\tsetAttributes( { style: newStyle } );\n\t\t\t\t\t} }\n\t\t\t\t\tsettings={ settings }\n\t\t\t\t/>\n\t\t\t</BlockControls>\n\t\t</>\n\t);\n}\n\nexport default {\n\tshareWithChildBlocks: true,\n\tedit: DuotonePanelPure,\n\tuseBlockProps,\n\tattributeKeys: [ 'style' ],\n\thasSupport( name ) {\n\t\treturn hasBlockSupport( name, 'filter.duotone' );\n\t},\n};\n\n/**\n * Filters registered block settings, extending attributes to include\n * the `duotone` attribute.\n *\n * @param {Object} settings Original block settings.\n *\n * @return {Object} Filtered block settings.\n */\nfunction addDuotoneAttributes( settings ) {\n\t// Previous `color.__experimentalDuotone` support flag is migrated via\n\t// block_type_metadata_settings filter in `lib/block-supports/duotone.php`.\n\tif ( ! hasBlockSupport( settings, 'filter.duotone' ) ) {\n\t\treturn settings;\n\t}\n\n\t// Allow blocks to specify their own attribute definition with default\n\t// 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\nfunction useDuotoneStyles( {\n\tclientId,\n\tid: filterId,\n\tselector: duotoneSelector,\n\tattribute: duotoneAttr,\n} ) {\n\tconst duotonePalette = useMultiOriginPresets( {\n\t\tpresetSetting: 'color.duotone',\n\t\tdefaultSetting: 'color.defaultDuotone',\n\t} );\n\n\t// Possible values for duotone attribute:\n\t// 1. Array of colors - e.g. ['#000000', '#ffffff'].\n\t// 2. Variable for an existing Duotone preset - e.g. 'var:preset|duotone|green-blue' or 'var(--wp--preset--duotone--green-blue)''\n\t// 3. A CSS string - e.g. 'unset' to remove globally applied duotone.\n\tconst isCustom = Array.isArray( duotoneAttr );\n\tconst duotonePreset = isCustom\n\t\t? undefined\n\t\t: getColorsFromDuotonePreset( duotoneAttr, duotonePalette );\n\tconst isPreset = typeof duotoneAttr === 'string' && duotonePreset;\n\tconst isCSS = typeof duotoneAttr === 'string' && ! isPreset;\n\n\t// Match the structure of WP_Duotone_Gutenberg::render_duotone_support() in PHP.\n\tlet colors = null;\n\tif ( isPreset ) {\n\t\t// Array of colors.\n\t\tcolors = duotonePreset;\n\t} else if ( isCSS ) {\n\t\t// CSS filter property string (e.g. 'unset').\n\t\tcolors = duotoneAttr;\n\t} else if ( isCustom ) {\n\t\t// Array of colors.\n\t\tcolors = duotoneAttr;\n\t}\n\n\t// Build the CSS selectors to which the filter will be applied.\n\tconst selectors = duotoneSelector.split( ',' );\n\n\tconst selectorsScoped = selectors.map( ( selectorPart ) => {\n\t\t// Extra .editor-styles-wrapper specificity is needed in the editor\n\t\t// since we're not using inline styles to apply the filter. We need to\n\t\t// override duotone applied by global styles and theme.json.\n\n\t\t// Assuming the selector part is a subclass selector (not a tag name)\n\t\t// so we can prepend the filter id class. If we want to support elements\n\t\t// such as `img` or namespaces, we'll need to add a case for that here.\n\t\treturn `.${ filterId }${ selectorPart.trim() }`;\n\t} );\n\n\tconst selector = selectorsScoped.join( ', ' );\n\n\tconst isValidFilter = Array.isArray( colors ) || colors === 'unset';\n\n\tuseStyleOverride(\n\t\tisValidFilter\n\t\t\t? {\n\t\t\t\t\tcss:\n\t\t\t\t\t\tcolors !== 'unset'\n\t\t\t\t\t\t\t? getDuotoneStylesheet( selector, filterId )\n\t\t\t\t\t\t\t: getDuotoneUnsetStylesheet( selector ),\n\t\t\t\t\t__unstableType: 'presets',\n\t\t\t }\n\t\t\t: undefined\n\t);\n\tuseStyleOverride(\n\t\tisValidFilter\n\t\t\t? {\n\t\t\t\t\tassets:\n\t\t\t\t\t\tcolors !== 'unset'\n\t\t\t\t\t\t\t? getDuotoneFilter( filterId, colors )\n\t\t\t\t\t\t\t: '',\n\t\t\t\t\t__unstableType: 'svgs',\n\t\t\t }\n\t\t\t: undefined\n\t);\n\n\tconst blockElement = useBlockElement( clientId );\n\n\tuseEffect( () => {\n\t\tif ( ! isValidFilter ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Safari does not always update the duotone filter when the duotone colors\n\t\t// are changed. When using Safari, force the block element to be repainted by\n\t\t// the browser to ensure any changes are reflected visually. This logic matches\n\t\t// that used on the site frontend in `block-supports/duotone.php`.\n\t\tif ( blockElement && isSafari ) {\n\t\t\tconst display = blockElement.style.display;\n\t\t\t// Switch to `inline-block` to force a repaint. In the editor, `inline-block`\n\t\t\t// is used instead of `none` to ensure that scroll position is not affected,\n\t\t\t// as `none` results in the editor scrolling to the top of the block.\n\t\t\tblockElement.style.display = 'inline-block';\n\t\t\t// Simply accessing el.offsetHeight flushes layout and style\n\t\t\t// changes in WebKit without having to wait for setTimeout.\n\t\t\t// eslint-disable-next-line no-unused-expressions\n\t\t\tblockElement.offsetHeight;\n\t\t\tblockElement.style.display = display;\n\t\t}\n\t}, [ isValidFilter, blockElement ] );\n}\n\nfunction useBlockProps( { name, style } ) {\n\tconst id = useInstanceId( useBlockProps );\n\tconst selector = useMemo( () => {\n\t\tconst blockType = getBlockType( name );\n\n\t\tif ( blockType ) {\n\t\t\t// Backwards compatibility for `supports.color.__experimentalDuotone`\n\t\t\t// is provided via the `block_type_metadata_settings` filter. If\n\t\t\t// `supports.filter.duotone` has not been set and the\n\t\t\t// experimental property has been, the experimental property\n\t\t\t// value is copied into `supports.filter.duotone`.\n\t\t\tconst duotoneSupport = getBlockSupport(\n\t\t\t\tblockType,\n\t\t\t\t'filter.duotone',\n\t\t\t\tfalse\n\t\t\t);\n\t\t\tif ( ! duotoneSupport ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t// If the experimental duotone support was set, that value is\n\t\t\t// to be treated as a selector and requires scoping.\n\t\t\tconst experimentalDuotone = getBlockSupport(\n\t\t\t\tblockType,\n\t\t\t\t'color.__experimentalDuotone',\n\t\t\t\tfalse\n\t\t\t);\n\t\t\tif ( experimentalDuotone ) {\n\t\t\t\tconst rootSelector = getBlockCSSSelector( blockType );\n\t\t\t\treturn typeof experimentalDuotone === 'string'\n\t\t\t\t\t? scopeSelector( rootSelector, experimentalDuotone )\n\t\t\t\t\t: rootSelector;\n\t\t\t}\n\n\t\t\t// Regular filter.duotone support uses filter.duotone selectors with fallbacks.\n\t\t\treturn getBlockCSSSelector( blockType, 'filter.duotone', {\n\t\t\t\tfallback: true,\n\t\t\t} );\n\t\t}\n\t}, [ name ] );\n\n\tconst attribute = style?.color?.duotone;\n\n\tconst filterClass = `wp-duotone-${ id }`;\n\n\tconst shouldRender = selector && attribute;\n\n\tuseDuotoneStyles( {\n\t\tclientId: id,\n\t\tid: filterClass,\n\t\tselector,\n\t\tattribute,\n\t} );\n\n\treturn {\n\t\tclassName: shouldRender ? filterClass : '',\n\t};\n}\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/editor/duotone/add-attributes',\n\taddDuotoneAttributes\n);\n"],"mappings":";;;;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AAKA,IAAAG,OAAA,GAAAH,OAAA;AAKA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AAKA,IAAAO,WAAA,GAAAP,OAAA;AAMA,IAAAQ,MAAA,GAAAR,OAAA;AAKA,IAAAS,oBA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IAAK2E,SAAS,EAAG;MAChB;MACA;MACA;MACA;MACA;MACA,MAAME,cAAc,GAAG,IAAAC,uBAAe,EACrCH,SAAS,EACT,gBAAgB,EAChB,KACD,CAAC;MACD,IAAK,CAAEE,cAAc,EAAG;QACvB,OAAO,IAAI;MACZ;;MAEA;MACA;MACA,MAAME,mBAAmB,GAAG,IAAAD,uBAAe,EAC1CH,SAAS,EACT,6BAA6B,EAC7B,KACD,CAAC;MACD,IAAKI,mBAAmB,EAAG;QAC1B,MAAMC,YAAY,GAAG,IAAAC,wCAAmB,EAAEN,SAAU,CAAC;QACrD,OAAO,OAAOI,mBAAmB,KAAK,QAAQ,GAC3C,IAAAG,qBAAa,EAAEF,YAAY,EAAED,mBAAoB,CAAC,GAClDC,YAAY;MAChB;;MAEA;MACA,OAAO,IAAAC,wCAAmB,EAAEN,SAAS,EAAE,gBAAgB,EAAE;QACxDQ,QAAQ,EAAE;MACX,CAAE,CAAC;IACJ;EACD,CAAC,EAAE,CAAEnF,IAAI,CAAG,CAAC;EAEb,MAAMiD,SAAS,GAAGnD,KAAK,EAAEI,KAAK,EAAEnB,OAAO;EAEvC,MAAMqG,WAAW,GAAI,cAAcvC,EAAI,EAAC;EAExC,MAAMwC,YAAY,GAAGtC,QAAQ,IAAIE,SAAS;EAE1CN,gBAAgB,CAAE;IACjBC,QAAQ,EAAEC,EAAE;IACZA,EAAE,EAAEuC,WAAW;IACfrC,QAAQ;IACRE;EACD,CAAE,CAAC;EAEH,OAAO;IACNqC,SAAS,EAAED,YAAY,GAAGD,WAAW,GAAG;EACzC,CAAC;AACF;AAEA,IAAAG,gBAAS,EACR,0BAA0B,EAC1B,oCAAoC,EACpCjD,oBACD,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_colord","require","_names","_interopRequireDefault","_blocks","_compose","_hooks","_element","_components","_utils","_getBlockCssSelector","_utils2","_utils3","_filtersPanel","_blockEditingMode","_useBlockRefs","_jsxRuntime","EMPTY_ARRAY","isSafari","window","navigator","userAgent","includes","extend","namesPlugin","useMultiOriginPresets","presetSetting","defaultSetting","enableDefault","userPresets","themePresets","defaultPresets","useSettings","useMemo","getColorsFromDuotonePreset","duotone","duotonePalette","preset","find","slug","colors","undefined","getDuotonePresetFromColors","Array","isArray","duotonePreset","every","val","index","DuotonePanelPure","style","setAttributes","name","duotoneStyle","color","settings","useBlockSettings","blockEditingMode","useBlockEditingMode","colorPalette","enableCustomColors","enableCustomDuotone","disableCustomColors","disableCustomDuotone","length","duotonePresetOrColors","jsxs","Fragment","children","jsx","InspectorControls","group","default","value","filter","onChange","newDuotone","newStyle","BlockControls","__experimentalShareWithChildBlocks","__experimentalDuotoneControl","maybePreset","_default","exports","shareWithChildBlocks","edit","useBlockProps","attributeKeys","hasSupport","hasBlockSupport","addDuotoneAttributes","attributes","Object","assign","type","useDuotoneStyles","clientId","id","filterId","selector","duotoneSelector","attribute","duotoneAttr","isCustom","isPreset","isCSS","selectors","split","selectorsScoped","map","selectorPart","trim","join","isValidFilter","useStyleOverride","css","getDuotoneStylesheet","getDuotoneUnsetStylesheet","__unstableType","assets","getDuotoneFilter","blockElement","useBlockElement","useEffect","display","offsetHeight","useInstanceId","blockType","getBlockType","duotoneSupport","getBlockSupport","experimentalDuotone","rootSelector","getBlockCSSSelector","scopeSelector","fallback","filterClass","shouldRender","className","addFilter"],"sources":["@wordpress/block-editor/src/hooks/duotone.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { extend } from 'colord';\nimport namesPlugin from 'colord/plugins/names';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tgetBlockSupport,\n\tgetBlockType,\n\thasBlockSupport,\n} from '@wordpress/blocks';\nimport { useInstanceId } from '@wordpress/compose';\nimport { addFilter } from '@wordpress/hooks';\nimport { useMemo, useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport {\n\tBlockControls,\n\tInspectorControls,\n\t__experimentalDuotoneControl as DuotoneControl,\n\tuseSettings,\n} from '../components';\nimport {\n\tgetDuotoneFilter,\n\tgetDuotoneStylesheet,\n\tgetDuotoneUnsetStylesheet,\n} from '../components/duotone/utils';\nimport { getBlockCSSSelector } from '../components/global-styles/get-block-css-selector';\nimport { scopeSelector } from '../components/global-styles/utils';\nimport { useBlockSettings, useStyleOverride } from './utils';\nimport { default as StylesFiltersPanel } from '../components/global-styles/filters-panel';\nimport { useBlockEditingMode } from '../components/block-editing-mode';\nimport { __unstableUseBlockElement as useBlockElement } from '../components/block-list/use-block-props/use-block-refs';\n\nconst EMPTY_ARRAY = [];\n\n// Safari does not always update the duotone filter when the duotone colors\n// are changed. This browser check is later used to force a re-render of the block\n// element to ensure the duotone filter is updated. The check is included at the\n// root of this file as it only needs to be run once per page load.\nconst isSafari =\n\twindow?.navigator.userAgent &&\n\twindow.navigator.userAgent.includes( 'Safari' ) &&\n\t! window.navigator.userAgent.includes( 'Chrome' ) &&\n\t! window.navigator.userAgent.includes( 'Chromium' );\n\nextend( [ namesPlugin ] );\n\nfunction useMultiOriginPresets( { presetSetting, defaultSetting } ) {\n\tconst [ enableDefault, userPresets, themePresets, defaultPresets ] =\n\t\tuseSettings(\n\t\t\tdefaultSetting,\n\t\t\t`${ presetSetting }.custom`,\n\t\t\t`${ presetSetting }.theme`,\n\t\t\t`${ presetSetting }.default`\n\t\t);\n\treturn useMemo(\n\t\t() => [\n\t\t\t...( userPresets || EMPTY_ARRAY ),\n\t\t\t...( themePresets || EMPTY_ARRAY ),\n\t\t\t...( ( enableDefault && defaultPresets ) || EMPTY_ARRAY ),\n\t\t],\n\t\t[ enableDefault, userPresets, themePresets, defaultPresets ]\n\t);\n}\n\nexport function getColorsFromDuotonePreset( duotone, duotonePalette ) {\n\tif ( ! duotone ) {\n\t\treturn;\n\t}\n\tconst preset = duotonePalette?.find( ( { slug } ) => {\n\t\treturn duotone === `var:preset|duotone|${ slug }`;\n\t} );\n\n\treturn preset ? preset.colors : undefined;\n}\n\nexport function getDuotonePresetFromColors( colors, duotonePalette ) {\n\tif ( ! colors || ! Array.isArray( colors ) ) {\n\t\treturn;\n\t}\n\n\tconst preset = duotonePalette?.find( ( duotonePreset ) => {\n\t\treturn duotonePreset?.colors?.every(\n\t\t\t( val, index ) => val === colors[ index ]\n\t\t);\n\t} );\n\n\treturn preset ? `var:preset|duotone|${ preset.slug }` : undefined;\n}\n\nfunction DuotonePanelPure( { style, setAttributes, name } ) {\n\tconst duotoneStyle = style?.color?.duotone;\n\tconst settings = useBlockSettings( name );\n\tconst blockEditingMode = useBlockEditingMode();\n\n\tconst duotonePalette = useMultiOriginPresets( {\n\t\tpresetSetting: 'color.duotone',\n\t\tdefaultSetting: 'color.defaultDuotone',\n\t} );\n\tconst colorPalette = useMultiOriginPresets( {\n\t\tpresetSetting: 'color.palette',\n\t\tdefaultSetting: 'color.defaultPalette',\n\t} );\n\tconst [ enableCustomColors, enableCustomDuotone ] = useSettings(\n\t\t'color.custom',\n\t\t'color.customDuotone'\n\t);\n\tconst disableCustomColors = ! enableCustomColors;\n\tconst disableCustomDuotone =\n\t\t! enableCustomDuotone ||\n\t\t( colorPalette?.length === 0 && disableCustomColors );\n\n\tif ( duotonePalette?.length === 0 && disableCustomDuotone ) {\n\t\treturn null;\n\t}\n\n\tif ( blockEditingMode !== 'default' ) {\n\t\treturn null;\n\t}\n\n\tconst duotonePresetOrColors = ! Array.isArray( duotoneStyle )\n\t\t? getColorsFromDuotonePreset( duotoneStyle, duotonePalette )\n\t\t: duotoneStyle;\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls group=\"filter\">\n\t\t\t\t<StylesFiltersPanel\n\t\t\t\t\tvalue={ { filter: { duotone: duotonePresetOrColors } } }\n\t\t\t\t\tonChange={ ( newDuotone ) => {\n\t\t\t\t\t\tconst newStyle = {\n\t\t\t\t\t\t\t...style,\n\t\t\t\t\t\t\tcolor: {\n\t\t\t\t\t\t\t\t...newDuotone?.filter,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t};\n\t\t\t\t\t\tsetAttributes( { style: newStyle } );\n\t\t\t\t\t} }\n\t\t\t\t\tsettings={ settings }\n\t\t\t\t/>\n\t\t\t</InspectorControls>\n\t\t\t<BlockControls group=\"block\" __experimentalShareWithChildBlocks>\n\t\t\t\t<DuotoneControl\n\t\t\t\t\tduotonePalette={ duotonePalette }\n\t\t\t\t\tcolorPalette={ colorPalette }\n\t\t\t\t\tdisableCustomDuotone={ disableCustomDuotone }\n\t\t\t\t\tdisableCustomColors={ disableCustomColors }\n\t\t\t\t\tvalue={ duotonePresetOrColors }\n\t\t\t\t\tonChange={ ( newDuotone ) => {\n\t\t\t\t\t\tconst maybePreset = getDuotonePresetFromColors(\n\t\t\t\t\t\t\tnewDuotone,\n\t\t\t\t\t\t\tduotonePalette\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tconst newStyle = {\n\t\t\t\t\t\t\t...style,\n\t\t\t\t\t\t\tcolor: {\n\t\t\t\t\t\t\t\t...style?.color,\n\t\t\t\t\t\t\t\tduotone: maybePreset ?? newDuotone, // use preset or fallback to custom colors.\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t};\n\t\t\t\t\t\tsetAttributes( { style: newStyle } );\n\t\t\t\t\t} }\n\t\t\t\t\tsettings={ settings }\n\t\t\t\t/>\n\t\t\t</BlockControls>\n\t\t</>\n\t);\n}\n\nexport default {\n\tshareWithChildBlocks: true,\n\tedit: DuotonePanelPure,\n\tuseBlockProps,\n\tattributeKeys: [ 'style' ],\n\thasSupport( name ) {\n\t\treturn hasBlockSupport( name, 'filter.duotone' );\n\t},\n};\n\n/**\n * Filters registered block settings, extending attributes to include\n * the `duotone` attribute.\n *\n * @param {Object} settings Original block settings.\n *\n * @return {Object} Filtered block settings.\n */\nfunction addDuotoneAttributes( settings ) {\n\t// Previous `color.__experimentalDuotone` support flag is migrated via\n\t// block_type_metadata_settings filter in `lib/block-supports/duotone.php`.\n\tif ( ! hasBlockSupport( settings, 'filter.duotone' ) ) {\n\t\treturn settings;\n\t}\n\n\t// Allow blocks to specify their own attribute definition with default\n\t// 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\nfunction useDuotoneStyles( {\n\tclientId,\n\tid: filterId,\n\tselector: duotoneSelector,\n\tattribute: duotoneAttr,\n} ) {\n\tconst duotonePalette = useMultiOriginPresets( {\n\t\tpresetSetting: 'color.duotone',\n\t\tdefaultSetting: 'color.defaultDuotone',\n\t} );\n\n\t// Possible values for duotone attribute:\n\t// 1. Array of colors - e.g. ['#000000', '#ffffff'].\n\t// 2. Variable for an existing Duotone preset - e.g. 'var:preset|duotone|green-blue' or 'var(--wp--preset--duotone--green-blue)''\n\t// 3. A CSS string - e.g. 'unset' to remove globally applied duotone.\n\tconst isCustom = Array.isArray( duotoneAttr );\n\tconst duotonePreset = isCustom\n\t\t? undefined\n\t\t: getColorsFromDuotonePreset( duotoneAttr, duotonePalette );\n\tconst isPreset = typeof duotoneAttr === 'string' && duotonePreset;\n\tconst isCSS = typeof duotoneAttr === 'string' && ! isPreset;\n\n\t// Match the structure of WP_Duotone_Gutenberg::render_duotone_support() in PHP.\n\tlet colors = null;\n\tif ( isPreset ) {\n\t\t// Array of colors.\n\t\tcolors = duotonePreset;\n\t} else if ( isCSS ) {\n\t\t// CSS filter property string (e.g. 'unset').\n\t\tcolors = duotoneAttr;\n\t} else if ( isCustom ) {\n\t\t// Array of colors.\n\t\tcolors = duotoneAttr;\n\t}\n\n\t// Build the CSS selectors to which the filter will be applied.\n\tconst selectors = duotoneSelector.split( ',' );\n\n\tconst selectorsScoped = selectors.map( ( selectorPart ) => {\n\t\t// Extra .editor-styles-wrapper specificity is needed in the editor\n\t\t// since we're not using inline styles to apply the filter. We need to\n\t\t// override duotone applied by global styles and theme.json.\n\n\t\t// Assuming the selector part is a subclass selector (not a tag name)\n\t\t// so we can prepend the filter id class. If we want to support elements\n\t\t// such as `img` or namespaces, we'll need to add a case for that here.\n\t\treturn `.${ filterId }${ selectorPart.trim() }`;\n\t} );\n\n\tconst selector = selectorsScoped.join( ', ' );\n\n\tconst isValidFilter = Array.isArray( colors ) || colors === 'unset';\n\n\tuseStyleOverride(\n\t\tisValidFilter\n\t\t\t? {\n\t\t\t\t\tcss:\n\t\t\t\t\t\tcolors !== 'unset'\n\t\t\t\t\t\t\t? getDuotoneStylesheet( selector, filterId )\n\t\t\t\t\t\t\t: getDuotoneUnsetStylesheet( selector ),\n\t\t\t\t\t__unstableType: 'presets',\n\t\t\t }\n\t\t\t: undefined\n\t);\n\tuseStyleOverride(\n\t\tisValidFilter\n\t\t\t? {\n\t\t\t\t\tassets:\n\t\t\t\t\t\tcolors !== 'unset'\n\t\t\t\t\t\t\t? getDuotoneFilter( filterId, colors )\n\t\t\t\t\t\t\t: '',\n\t\t\t\t\t__unstableType: 'svgs',\n\t\t\t }\n\t\t\t: undefined\n\t);\n\n\tconst blockElement = useBlockElement( clientId );\n\n\tuseEffect( () => {\n\t\tif ( ! isValidFilter ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Safari does not always update the duotone filter when the duotone\n\t\t// colors are changed. When using Safari, force the block element to be\n\t\t// repainted by the browser to ensure any changes are reflected\n\t\t// visually. This logic matches that used on the site frontend in\n\t\t// `block-supports/duotone.php`.\n\t\tif ( blockElement && isSafari ) {\n\t\t\tconst display = blockElement.style.display;\n\t\t\t// Switch to `inline-block` to force a repaint. In the editor,\n\t\t\t// `inline-block` is used instead of `none` to ensure that scroll\n\t\t\t// position is not affected, as `none` results in the editor\n\t\t\t// scrolling to the top of the block.\n\t\t\tblockElement.style.display = 'inline-block';\n\t\t\t// Simply accessing el.offsetHeight flushes layout and style changes\n\t\t\t// in WebKit without having to wait for setTimeout.\n\t\t\t// eslint-disable-next-line no-unused-expressions\n\t\t\tblockElement.offsetHeight;\n\t\t\tblockElement.style.display = display;\n\t\t}\n\t\t// `colors` must be a dependency so this effect runs when the colors\n\t\t// change in Safari.\n\t}, [ isValidFilter, blockElement, colors ] );\n}\n\nfunction useBlockProps( { clientId, name, style } ) {\n\tconst id = useInstanceId( useBlockProps );\n\tconst selector = useMemo( () => {\n\t\tconst blockType = getBlockType( name );\n\n\t\tif ( blockType ) {\n\t\t\t// Backwards compatibility for `supports.color.__experimentalDuotone`\n\t\t\t// is provided via the `block_type_metadata_settings` filter. If\n\t\t\t// `supports.filter.duotone` has not been set and the\n\t\t\t// experimental property has been, the experimental property\n\t\t\t// value is copied into `supports.filter.duotone`.\n\t\t\tconst duotoneSupport = getBlockSupport(\n\t\t\t\tblockType,\n\t\t\t\t'filter.duotone',\n\t\t\t\tfalse\n\t\t\t);\n\t\t\tif ( ! duotoneSupport ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t// If the experimental duotone support was set, that value is\n\t\t\t// to be treated as a selector and requires scoping.\n\t\t\tconst experimentalDuotone = getBlockSupport(\n\t\t\t\tblockType,\n\t\t\t\t'color.__experimentalDuotone',\n\t\t\t\tfalse\n\t\t\t);\n\t\t\tif ( experimentalDuotone ) {\n\t\t\t\tconst rootSelector = getBlockCSSSelector( blockType );\n\t\t\t\treturn typeof experimentalDuotone === 'string'\n\t\t\t\t\t? scopeSelector( rootSelector, experimentalDuotone )\n\t\t\t\t\t: rootSelector;\n\t\t\t}\n\n\t\t\t// Regular filter.duotone support uses filter.duotone selectors with fallbacks.\n\t\t\treturn getBlockCSSSelector( blockType, 'filter.duotone', {\n\t\t\t\tfallback: true,\n\t\t\t} );\n\t\t}\n\t}, [ name ] );\n\n\tconst attribute = style?.color?.duotone;\n\n\tconst filterClass = `wp-duotone-${ id }`;\n\n\tconst shouldRender = selector && attribute;\n\n\tuseDuotoneStyles( {\n\t\tclientId,\n\t\tid: filterClass,\n\t\tselector,\n\t\tattribute,\n\t} );\n\n\treturn {\n\t\tclassName: shouldRender ? filterClass : '',\n\t};\n}\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/editor/duotone/add-attributes',\n\taddDuotoneAttributes\n);\n"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;IACRE;EACD,CAAE,CAAC;EAEH,OAAO;IACNqC,SAAS,EAAED,YAAY,GAAGD,WAAW,GAAG;EACzC,CAAC;AACF;AAEA,IAAAG,gBAAS,EACR,0BAA0B,EAC1B,oCAAoC,EACpCjD,oBACD,CAAC","ignoreList":[]}
@@ -4,6 +4,12 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
+ Object.defineProperty(exports, "__unstableBlockStyleVariationOverridesWithConfig", {
8
+ enumerable: true,
9
+ get: function () {
10
+ return _blockStyleVariation.__unstableBlockStyleVariationOverridesWithConfig;
11
+ }
12
+ });
7
13
  Object.defineProperty(exports, "getBorderClassesAndStyles", {
8
14
  enumerable: true,
9
15
  get: function () {
@@ -101,7 +107,7 @@ var _fontSize = _interopRequireDefault(require("./font-size"));
101
107
  var _textAlign = _interopRequireDefault(require("./text-align"));
102
108
  var _border = _interopRequireDefault(require("./border"));
103
109
  var _position = _interopRequireDefault(require("./position"));
104
- var _blockStyleVariation = _interopRequireDefault(require("./block-style-variation"));
110
+ var _blockStyleVariation = _interopRequireWildcard(require("./block-style-variation"));
105
111
  var _layout = _interopRequireWildcard(require("./layout"));
106
112
  var _layoutChild = _interopRequireDefault(require("./layout-child"));
107
113
  var _contentLockUi = _interopRequireDefault(require("./content-lock-ui"));
@@ -1 +1 @@
1
- {"version":3,"names":["_utils","require","_align","_interopRequireDefault","_background","_anchor","_ariaLabel","_customClassName","_style","_color","_dimensions","_interopRequireWildcard","_duotone","_fontFamily","_fontSize","_textAlign","_border","_position","_blockStyleVariation","_layout","_layoutChild","_contentLockUi","_blockHooks","_blockBindings","_useBorderProps","_useShadowProps","_useColorProps","_useSpacingProps","_useTypographyProps","_gap","_useCachedTruthy","_useZoomOut","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","createBlockEditFilter","blockBindingsPanel","align","textAlign","anchor","customClassName","style","duotone","position","layout","contentLockUI","blockHooks","childLayout","filter","Boolean","createBlockListBlockFilter","background","color","dimensions","fontFamily","fontSize","border","blockStyleVariation","createBlockSaveFilter","ariaLabel"],"sources":["@wordpress/block-editor/src/hooks/index.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport {\n\tcreateBlockEditFilter,\n\tcreateBlockListBlockFilter,\n\tcreateBlockSaveFilter,\n} from './utils';\nimport './compat';\nimport align from './align';\nimport background from './background';\nimport './lock';\nimport anchor from './anchor';\nimport ariaLabel from './aria-label';\nimport customClassName from './custom-class-name';\nimport './generated-class-name';\nimport style from './style';\nimport './settings';\nimport color from './color';\nimport dimensions from './dimensions';\nimport duotone from './duotone';\nimport fontFamily from './font-family';\nimport fontSize from './font-size';\nimport textAlign from './text-align';\nimport border from './border';\nimport position from './position';\nimport blockStyleVariation from './block-style-variation';\nimport layout from './layout';\nimport childLayout from './layout-child';\nimport contentLockUI from './content-lock-ui';\nimport './metadata';\nimport blockHooks from './block-hooks';\nimport blockBindingsPanel from './block-bindings';\nimport './block-renaming';\nimport './use-bindings-attributes';\n\ncreateBlockEditFilter(\n\t[\n\t\tblockBindingsPanel,\n\t\talign,\n\t\ttextAlign,\n\t\tanchor,\n\t\tcustomClassName,\n\t\tstyle,\n\t\tduotone,\n\t\tposition,\n\t\tlayout,\n\t\tcontentLockUI,\n\t\tblockHooks,\n\t\tchildLayout,\n\t].filter( Boolean )\n);\ncreateBlockListBlockFilter( [\n\talign,\n\ttextAlign,\n\tbackground,\n\tstyle,\n\tcolor,\n\tdimensions,\n\tduotone,\n\tfontFamily,\n\tfontSize,\n\tborder,\n\tposition,\n\tblockStyleVariation,\n\tchildLayout,\n] );\ncreateBlockSaveFilter( [\n\talign,\n\ttextAlign,\n\tanchor,\n\tariaLabel,\n\tcustomClassName,\n\tborder,\n\tcolor,\n\tstyle,\n\tfontFamily,\n\tfontSize,\n] );\n\nexport { useCustomSides } from './dimensions';\nexport { useLayoutClasses, useLayoutStyles } from './layout';\nexport { getBorderClassesAndStyles, useBorderProps } from './use-border-props';\nexport { getShadowClassesAndStyles } from './use-shadow-props';\nexport { getColorClassesAndStyles, useColorProps } from './use-color-props';\nexport { getSpacingClassesAndStyles } from './use-spacing-props';\nexport { getTypographyClassesAndStyles } from './use-typography-props';\nexport { getGapCSSValue } from './gap';\nexport { useCachedTruthy } from './use-cached-truthy';\nexport { useZoomOut } from './use-zoom-out';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AAKAA,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,WAAA,GAAAD,sBAAA,CAAAF,OAAA;AACAA,OAAA;AACA,IAAAI,OAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,UAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,gBAAA,GAAAJ,sBAAA,CAAAF,OAAA;AACAA,OAAA;AACA,IAAAO,MAAA,GAAAL,sBAAA,CAAAF,OAAA;AACAA,OAAA;AACA,IAAAQ,MAAA,GAAAN,sBAAA,CAAAF,OAAA;AACA,IAAAS,WAAA,GAAAC,uBAAA,CAAAV,OAAA;AACA,IAAAW,QAAA,GAAAT,sBAAA,CAAAF,OAAA;AACA,IAAAY,WAAA,GAAAV,sBAAA,CAAAF,OAAA;AACA,IAAAa,SAAA,GAAAX,sBAAA,CAAAF,OAAA;AACA,IAAAc,UAAA,GAAAZ,sBAAA,CAAAF,OAAA;AACA,IAAAe,OAAA,GAAAb,sBAAA,CAAAF,OAAA;AACA,IAAAgB,SAAA,GAAAd,sBAAA,CAAAF,OAAA;AACA,IAAAiB,oBAAA,GAAAf,sBAAA,CAAAF,OAAA;AACA,IAAAkB,OAAA,GAAAR,uBAAA,CAAAV,OAAA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A,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAG,CAAA,KAAAA,CAAA,CAAAV,GAAA,IAAAU,CAAA,CAAAC,GAAA,IAAAP,MAAA,CAAAC,cAAA,CAAAJ,CAAA,EAAAM,CAAA,EAAAG,CAAA,IAAAT,CAAA,CAAAM,CAAA,IAAAd,CAAA,CAAAc,CAAA,YAAAN,CAAA,CAAAH,OAAA,GAAAL,CAAA,EAAAG,CAAA,IAAAA,CAAA,CAAAe,GAAA,CAAAlB,CAAA,EAAAQ,CAAA,GAAAA,CAAA;AAzF5C;AACA;AACA;;AAkCA,IAAAW,4BAAqB,EACpB,CACCC,sBAAkB,EAClBC,cAAK,EACLC,kBAAS,EACTC,eAAM,EACNC,wBAAe,EACfC,cAAK,EACLC,gBAAO,EACPC,iBAAQ,EACRC,eAAM,EACNC,sBAAa,EACbC,mBAAU,EACVC,oBAAW,CACX,CAACC,MAAM,CAAEC,OAAQ,CACnB,CAAC;AACD,IAAAC,iCAA0B,EAAE,CAC3Bb,cAAK,EACLC,kBAAS,EACTa,mBAAU,EACVV,cAAK,EACLW,cAAK,EACLC,mBAAU,EACVX,gBAAO,EACPY,mBAAU,EACVC,iBAAQ,EACRC,eAAM,EACNb,iBAAQ,EACRc,4BAAmB,EACnBV,oBAAW,CACV,CAAC;AACH,IAAAW,4BAAqB,EAAE,CACtBrB,cAAK,EACLC,kBAAS,EACTC,eAAM,EACNoB,kBAAS,EACTnB,wBAAe,EACfgB,eAAM,EACNJ,cAAK,EACLX,cAAK,EACLa,mBAAU,EACVC,iBAAQ,CACP,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_utils","require","_align","_interopRequireDefault","_background","_anchor","_ariaLabel","_customClassName","_style","_color","_dimensions","_interopRequireWildcard","_duotone","_fontFamily","_fontSize","_textAlign","_border","_position","_blockStyleVariation","_layout","_layoutChild","_contentLockUi","_blockHooks","_blockBindings","_useBorderProps","_useShadowProps","_useColorProps","_useSpacingProps","_useTypographyProps","_gap","_useCachedTruthy","_useZoomOut","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","createBlockEditFilter","blockBindingsPanel","align","textAlign","anchor","customClassName","style","duotone","position","layout","contentLockUI","blockHooks","childLayout","filter","Boolean","createBlockListBlockFilter","background","color","dimensions","fontFamily","fontSize","border","blockStyleVariation","createBlockSaveFilter","ariaLabel"],"sources":["@wordpress/block-editor/src/hooks/index.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport {\n\tcreateBlockEditFilter,\n\tcreateBlockListBlockFilter,\n\tcreateBlockSaveFilter,\n} from './utils';\nimport './compat';\nimport align from './align';\nimport background from './background';\nimport './lock';\nimport anchor from './anchor';\nimport ariaLabel from './aria-label';\nimport customClassName from './custom-class-name';\nimport './generated-class-name';\nimport style from './style';\nimport './settings';\nimport color from './color';\nimport dimensions from './dimensions';\nimport duotone from './duotone';\nimport fontFamily from './font-family';\nimport fontSize from './font-size';\nimport textAlign from './text-align';\nimport border from './border';\nimport position from './position';\nimport blockStyleVariation from './block-style-variation';\nimport layout from './layout';\nimport childLayout from './layout-child';\nimport contentLockUI from './content-lock-ui';\nimport './metadata';\nimport blockHooks from './block-hooks';\nimport blockBindingsPanel from './block-bindings';\nimport './block-renaming';\nimport './use-bindings-attributes';\n\ncreateBlockEditFilter(\n\t[\n\t\tblockBindingsPanel,\n\t\talign,\n\t\ttextAlign,\n\t\tanchor,\n\t\tcustomClassName,\n\t\tstyle,\n\t\tduotone,\n\t\tposition,\n\t\tlayout,\n\t\tcontentLockUI,\n\t\tblockHooks,\n\t\tchildLayout,\n\t].filter( Boolean )\n);\ncreateBlockListBlockFilter( [\n\talign,\n\ttextAlign,\n\tbackground,\n\tstyle,\n\tcolor,\n\tdimensions,\n\tduotone,\n\tfontFamily,\n\tfontSize,\n\tborder,\n\tposition,\n\tblockStyleVariation,\n\tchildLayout,\n] );\ncreateBlockSaveFilter( [\n\talign,\n\ttextAlign,\n\tanchor,\n\tariaLabel,\n\tcustomClassName,\n\tborder,\n\tcolor,\n\tstyle,\n\tfontFamily,\n\tfontSize,\n] );\n\nexport { useCustomSides } from './dimensions';\nexport { useLayoutClasses, useLayoutStyles } from './layout';\nexport { getBorderClassesAndStyles, useBorderProps } from './use-border-props';\nexport { getShadowClassesAndStyles } from './use-shadow-props';\nexport { getColorClassesAndStyles, useColorProps } from './use-color-props';\nexport { getSpacingClassesAndStyles } from './use-spacing-props';\nexport { getTypographyClassesAndStyles } from './use-typography-props';\nexport { getGapCSSValue } from './gap';\nexport { useCachedTruthy } from './use-cached-truthy';\nexport { useZoomOut } from './use-zoom-out';\nexport { __unstableBlockStyleVariationOverridesWithConfig } from './block-style-variation';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AAKAA,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,WAAA,GAAAD,sBAAA,CAAAF,OAAA;AACAA,OAAA;AACA,IAAAI,OAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,UAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,gBAAA,GAAAJ,sBAAA,CAAAF,OAAA;AACAA,OAAA;AACA,IAAAO,MAAA,GAAAL,sBAAA,CAAAF,OAAA;AACAA,OAAA;AACA,IAAAQ,MAAA,GAAAN,sBAAA,CAAAF,OAAA;AACA,IAAAS,WAAA,GAAAC,uBAAA,CAAAV,OAAA;AACA,IAAAW,QAAA,GAAAT,sBAAA,CAAAF,OAAA;AACA,IAAAY,WAAA,GAAAV,sBAAA,CAAAF,OAAA;AACA,IAAAa,SAAA,GAAAX,sBAAA,CAAAF,OAAA;AACA,IAAAc,UAAA,GAAAZ,sBAAA,CAAAF,OAAA;AACA,I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_compose.c
96
96
  clientId,
97
97
  context
98
98
  } = props;
99
+ const hasParentPattern = !!props.context['pattern/overrides'];
99
100
  const hasPatternOverridesDefaultBinding = props.attributes.metadata?.bindings?.[DEFAULT_ATTRIBUTE]?.source === 'core/pattern-overrides';
100
101
  const bindings = (0, _element.useMemo)(() => replacePatternOverrideDefaultBindings(name, props.attributes.metadata?.bindings), [props.attributes.metadata?.bindings, name]);
101
102
  const boundAttributes = (0, _data.useSelect)(() => {
@@ -180,15 +181,19 @@ const withBlockBindingSupport = exports.withBlockBindingSupport = (0, _compose.c
180
181
  }
181
182
  }
182
183
  }
183
-
184
- // Only apply normal attribute updates to blocks
185
- // that have partial bindings. Currently this is
186
- // only skipped for pattern overrides sources.
187
- if (!hasPatternOverridesDefaultBinding && Object.keys(keptAttributes).length) {
184
+ if (
185
+ // Don't update non-connected attributes if the block is using pattern overrides
186
+ // and the editing is happening while overriding the pattern (not editing the original).
187
+ !(hasPatternOverridesDefaultBinding && hasParentPattern) && Object.keys(keptAttributes).length) {
188
+ // Don't update caption and href until they are supported.
189
+ if (hasPatternOverridesDefaultBinding) {
190
+ delete keptAttributes?.caption;
191
+ delete keptAttributes?.href;
192
+ }
188
193
  setAttributes(keptAttributes);
189
194
  }
190
195
  });
191
- }, [registry, bindings, name, clientId, context, setAttributes, sources, hasPatternOverridesDefaultBinding]);
196
+ }, [registry, bindings, name, clientId, context, setAttributes, sources, hasPatternOverridesDefaultBinding, hasParentPattern]);
192
197
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
193
198
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(BlockEdit, {
194
199
  ...props,
@@ -1 +1 @@
1
- {"version":3,"names":["_blocks","require","_compose","_data","_element","_hooks","_lockUnlock","_jsxRuntime","BLOCK_BINDINGS_ALLOWED_BLOCKS","DEFAULT_ATTRIBUTE","replacePatternOverrideDefaultBindings","blockName","bindings","source","supportedAttributes","bindingsWithDefaults","attributeName","bindingSource","canBindBlock","canBindAttribute","includes","withBlockBindingSupport","exports","createHigherOrderComponent","BlockEdit","props","registry","useRegistry","sources","useSelect","select","unlock","blocksStore","getAllBlockBindingsSources","name","clientId","context","hasPatternOverridesDefaultBinding","attributes","metadata","useMemo","boundAttributes","boundAttribute","Object","entries","getValue","args","undefined","getPlaceholder","setAttributes","_setAttributes","useCallback","nextAttributes","batch","keptAttributes","updatesBySource","Map","newValue","binding","setValue","setValues","set","get","size","value","keys","length","jsx","Fragment","children","shimAttributeSource","settings","edit","addFilter"],"sources":["@wordpress/block-editor/src/hooks/use-bindings-attributes.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport { useRegistry, useSelect } from '@wordpress/data';\nimport { useCallback, useMemo } from '@wordpress/element';\nimport { addFilter } from '@wordpress/hooks';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../lock-unlock';\n\n/** @typedef {import('@wordpress/compose').WPHigherOrderComponent} WPHigherOrderComponent */\n/** @typedef {import('@wordpress/blocks').WPBlockSettings} WPBlockSettings */\n\n/**\n * Given a binding of block attributes, returns a higher order component that\n * overrides its `attributes` and `setAttributes` props to sync any changes needed.\n *\n * @return {WPHigherOrderComponent} Higher-order component.\n */\n\nconst BLOCK_BINDINGS_ALLOWED_BLOCKS = {\n\t'core/paragraph': [ 'content' ],\n\t'core/heading': [ 'content' ],\n\t'core/image': [ 'id', 'url', 'title', 'alt' ],\n\t'core/button': [ 'url', 'text', 'linkTarget', 'rel' ],\n};\n\nconst DEFAULT_ATTRIBUTE = '__default';\n\n/**\n * Returns the bindings with the `__default` binding for pattern overrides\n * replaced with the full-set of supported attributes. e.g.:\n *\n * bindings passed in: `{ __default: { source: 'core/pattern-overrides' } }`\n * bindings returned: `{ content: { source: 'core/pattern-overrides' } }`\n *\n * @param {string} blockName The block name (e.g. 'core/paragraph').\n * @param {Object} bindings A block's bindings from the metadata attribute.\n *\n * @return {Object} The bindings with default replaced for pattern overrides.\n */\nfunction replacePatternOverrideDefaultBindings( blockName, bindings ) {\n\t// The `__default` binding currently only works for pattern overrides.\n\tif (\n\t\tbindings?.[ DEFAULT_ATTRIBUTE ]?.source === 'core/pattern-overrides'\n\t) {\n\t\tconst supportedAttributes = BLOCK_BINDINGS_ALLOWED_BLOCKS[ blockName ];\n\t\tconst bindingsWithDefaults = {};\n\t\tfor ( const attributeName of supportedAttributes ) {\n\t\t\t// If the block has mixed binding sources, retain any non pattern override bindings.\n\t\t\tconst bindingSource = bindings[ attributeName ]\n\t\t\t\t? bindings[ attributeName ]\n\t\t\t\t: { source: 'core/pattern-overrides' };\n\t\t\tbindingsWithDefaults[ attributeName ] = bindingSource;\n\t\t}\n\n\t\treturn bindingsWithDefaults;\n\t}\n\n\treturn bindings;\n}\n\n/**\n * Based on the given block name,\n * check if it is possible to bind the block.\n *\n * @param {string} blockName - The block name.\n * @return {boolean} Whether it is possible to bind the block to sources.\n */\nexport function canBindBlock( blockName ) {\n\treturn blockName in BLOCK_BINDINGS_ALLOWED_BLOCKS;\n}\n\n/**\n * Based on the given block name and attribute name,\n * check if it is possible to bind the block attribute.\n *\n * @param {string} blockName - The block name.\n * @param {string} attributeName - The attribute name.\n * @return {boolean} Whether it is possible to bind the block attribute.\n */\nexport function canBindAttribute( blockName, attributeName ) {\n\treturn (\n\t\tcanBindBlock( blockName ) &&\n\t\tBLOCK_BINDINGS_ALLOWED_BLOCKS[ blockName ].includes( attributeName )\n\t);\n}\n\nexport const withBlockBindingSupport = createHigherOrderComponent(\n\t( BlockEdit ) => ( props ) => {\n\t\tconst registry = useRegistry();\n\t\tconst sources = useSelect( ( select ) =>\n\t\t\tunlock( select( blocksStore ) ).getAllBlockBindingsSources()\n\t\t);\n\t\tconst { name, clientId, context } = props;\n\t\tconst hasPatternOverridesDefaultBinding =\n\t\t\tprops.attributes.metadata?.bindings?.[ DEFAULT_ATTRIBUTE ]\n\t\t\t\t?.source === 'core/pattern-overrides';\n\t\tconst bindings = useMemo(\n\t\t\t() =>\n\t\t\t\treplacePatternOverrideDefaultBindings(\n\t\t\t\t\tname,\n\t\t\t\t\tprops.attributes.metadata?.bindings\n\t\t\t\t),\n\t\t\t[ props.attributes.metadata?.bindings, name ]\n\t\t);\n\t\tconst boundAttributes = useSelect( () => {\n\t\t\tif ( ! bindings ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst attributes = {};\n\n\t\t\tfor ( const [ attributeName, boundAttribute ] of Object.entries(\n\t\t\t\tbindings\n\t\t\t) ) {\n\t\t\t\tconst source = sources[ boundAttribute.source ];\n\t\t\t\tif (\n\t\t\t\t\t! source?.getValue ||\n\t\t\t\t\t! canBindAttribute( name, attributeName )\n\t\t\t\t) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tconst args = {\n\t\t\t\t\tregistry,\n\t\t\t\t\tcontext,\n\t\t\t\t\tclientId,\n\t\t\t\t\tattributeName,\n\t\t\t\t\targs: boundAttribute.args,\n\t\t\t\t};\n\n\t\t\t\tattributes[ attributeName ] = source.getValue( args );\n\n\t\t\t\tif ( attributes[ attributeName ] === undefined ) {\n\t\t\t\t\tif ( attributeName === 'url' ) {\n\t\t\t\t\t\tattributes[ attributeName ] = null;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tattributes[ attributeName ] =\n\t\t\t\t\t\t\tsource.getPlaceholder?.( args );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn attributes;\n\t\t}, [ bindings, name, clientId, context, registry, sources ] );\n\n\t\tconst { setAttributes } = props;\n\n\t\tconst _setAttributes = useCallback(\n\t\t\t( nextAttributes ) => {\n\t\t\t\tregistry.batch( () => {\n\t\t\t\t\tif ( ! bindings ) {\n\t\t\t\t\t\tsetAttributes( nextAttributes );\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst keptAttributes = { ...nextAttributes };\n\t\t\t\t\tconst updatesBySource = new Map();\n\n\t\t\t\t\t// Loop only over the updated attributes to avoid modifying the bound ones that haven't changed.\n\t\t\t\t\tfor ( const [ attributeName, newValue ] of Object.entries(\n\t\t\t\t\t\tkeptAttributes\n\t\t\t\t\t) ) {\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t! bindings[ attributeName ] ||\n\t\t\t\t\t\t\t! canBindAttribute( name, attributeName )\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst binding = bindings[ attributeName ];\n\t\t\t\t\t\tconst source = sources[ binding?.source ];\n\t\t\t\t\t\tif ( ! source?.setValue && ! source?.setValues ) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tupdatesBySource.set( source, {\n\t\t\t\t\t\t\t...updatesBySource.get( source ),\n\t\t\t\t\t\t\t[ attributeName ]: newValue,\n\t\t\t\t\t\t} );\n\t\t\t\t\t\tdelete keptAttributes[ attributeName ];\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( updatesBySource.size ) {\n\t\t\t\t\t\tfor ( const [\n\t\t\t\t\t\t\tsource,\n\t\t\t\t\t\t\tattributes,\n\t\t\t\t\t\t] of updatesBySource ) {\n\t\t\t\t\t\t\tif ( source.setValues ) {\n\t\t\t\t\t\t\t\tsource.setValues( {\n\t\t\t\t\t\t\t\t\tregistry,\n\t\t\t\t\t\t\t\t\tcontext,\n\t\t\t\t\t\t\t\t\tclientId,\n\t\t\t\t\t\t\t\t\tattributes,\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tfor ( const [\n\t\t\t\t\t\t\t\t\tattributeName,\n\t\t\t\t\t\t\t\t\tvalue,\n\t\t\t\t\t\t\t\t] of Object.entries( attributes ) ) {\n\t\t\t\t\t\t\t\t\tconst binding = bindings[ attributeName ];\n\t\t\t\t\t\t\t\t\tsource.setValue( {\n\t\t\t\t\t\t\t\t\t\tregistry,\n\t\t\t\t\t\t\t\t\t\tcontext,\n\t\t\t\t\t\t\t\t\t\tclientId,\n\t\t\t\t\t\t\t\t\t\tattributeName,\n\t\t\t\t\t\t\t\t\t\targs: binding.args,\n\t\t\t\t\t\t\t\t\t\tvalue,\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\n\t\t\t\t\t// Only apply normal attribute updates to blocks\n\t\t\t\t\t// that have partial bindings. Currently this is\n\t\t\t\t\t// only skipped for pattern overrides sources.\n\t\t\t\t\tif (\n\t\t\t\t\t\t! hasPatternOverridesDefaultBinding &&\n\t\t\t\t\t\tObject.keys( keptAttributes ).length\n\t\t\t\t\t) {\n\t\t\t\t\t\tsetAttributes( keptAttributes );\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t},\n\t\t\t[\n\t\t\t\tregistry,\n\t\t\t\tbindings,\n\t\t\t\tname,\n\t\t\t\tclientId,\n\t\t\t\tcontext,\n\t\t\t\tsetAttributes,\n\t\t\t\tsources,\n\t\t\t\thasPatternOverridesDefaultBinding,\n\t\t\t]\n\t\t);\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<BlockEdit\n\t\t\t\t\t{ ...props }\n\t\t\t\t\tattributes={ { ...props.attributes, ...boundAttributes } }\n\t\t\t\t\tsetAttributes={ _setAttributes }\n\t\t\t\t/>\n\t\t\t</>\n\t\t);\n\t},\n\t'withBlockBindingSupport'\n);\n\n/**\n * Filters a registered block's settings to enhance a block's `edit` component\n * to upgrade bound attributes.\n *\n * @param {WPBlockSettings} settings - Registered block settings.\n * @param {string} name - Block name.\n * @return {WPBlockSettings} Filtered block settings.\n */\nfunction shimAttributeSource( settings, name ) {\n\tif ( ! canBindBlock( name ) ) {\n\t\treturn settings;\n\t}\n\n\treturn {\n\t\t...settings,\n\t\tedit: withBlockBindingSupport( settings.edit ),\n\t};\n}\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/editor/custom-sources-backwards-compatibility/shim-attribute-source',\n\tshimAttributeSource\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,WAAA,GAAAL,OAAA;AAAwC,IAAAM,WAAA,GAAAN,OAAA;AAZxC;AACA;AACA;;AAOA;AACA;AACA;;AAGA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAEA,MAAMO,6BAA6B,GAAG;EACrC,gBAAgB,EAAE,CAAE,SAAS,CAAE;EAC/B,cAAc,EAAE,CAAE,SAAS,CAAE;EAC7B,YAAY,EAAE,CAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,CAAE;EAC7C,aAAa,EAAE,CAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,KAAK;AACpD,CAAC;AAED,MAAMC,iBAAiB,GAAG,WAAW;;AAErC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,qCAAqCA,CAAEC,SAAS,EAAEC,QAAQ,EAAG;EACrE;EACA,IACCA,QAAQ,GAAIH,iBAAiB,CAAE,EAAEI,MAAM,KAAK,wBAAwB,EACnE;IACD,MAAMC,mBAAmB,GAAGN,6BAA6B,CAAEG,SAAS,CAAE;IACtE,MAAMI,oBAAoB,GAAG,CAAC,CAAC;IAC/B,KAAM,MAAMC,aAAa,IAAIF,mBAAmB,EAAG;MAClD;MACA,MAAMG,aAAa,GAAGL,QAAQ,CAAEI,aAAa,CAAE,GAC5CJ,QAAQ,CAAEI,aAAa,CAAE,GACzB;QAAEH,MAAM,EAAE;MAAyB,CAAC;MACvCE,oBAAoB,CAAEC,aAAa,CAAE,GAAGC,aAAa;IACtD;IAEA,OAAOF,oBAAoB;EAC5B;EAEA,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nCM,MAAM,CAACsB,IAAI,CAAEX,cAAe,CAAC,CAACY,MAAM,EACnC;QACDjB,aAAa,CAAEK,cAAe,CAAC;MAChC;IACD,CAAE,CAAC;EACJ,CAAC,EACD,CACC5B,QAAQ,EACRd,QAAQ,EACRsB,IAAI,EACJC,QAAQ,EACRC,OAAO,EACPa,aAAa,EACbrB,OAAO,EACPS,iCAAiC,CAEnC,CAAC;EAED,oBACC,IAAA9B,WAAA,CAAA4D,GAAA,EAAA5D,WAAA,CAAA6D,QAAA;IAAAC,QAAA,eACC,IAAA9D,WAAA,CAAA4D,GAAA,EAAC3C,SAAS;MAAA,GACJC,KAAK;MACVa,UAAU,EAAG;QAAE,GAAGb,KAAK,CAACa,UAAU;QAAE,GAAGG;MAAgB,CAAG;MAC1DQ,aAAa,EAAGC;IAAgB,CAChC;EAAC,CACD,CAAC;AAEL,CAAC,EACD,yBACD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASoB,mBAAmBA,CAAEC,QAAQ,EAAErC,IAAI,EAAG;EAC9C,IAAK,CAAEhB,YAAY,CAAEgB,IAAK,CAAC,EAAG;IAC7B,OAAOqC,QAAQ;EAChB;EAEA,OAAO;IACN,GAAGA,QAAQ;IACXC,IAAI,EAAEnD,uBAAuB,CAAEkD,QAAQ,CAACC,IAAK;EAC9C,CAAC;AACF;AAEA,IAAAC,gBAAS,EACR,0BAA0B,EAC1B,0EAA0E,EAC1EH,mBACD,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_blocks","require","_compose","_data","_element","_hooks","_lockUnlock","_jsxRuntime","BLOCK_BINDINGS_ALLOWED_BLOCKS","DEFAULT_ATTRIBUTE","replacePatternOverrideDefaultBindings","blockName","bindings","source","supportedAttributes","bindingsWithDefaults","attributeName","bindingSource","canBindBlock","canBindAttribute","includes","withBlockBindingSupport","exports","createHigherOrderComponent","BlockEdit","props","registry","useRegistry","sources","useSelect","select","unlock","blocksStore","getAllBlockBindingsSources","name","clientId","context","hasParentPattern","hasPatternOverridesDefaultBinding","attributes","metadata","useMemo","boundAttributes","boundAttribute","Object","entries","getValue","args","undefined","getPlaceholder","setAttributes","_setAttributes","useCallback","nextAttributes","batch","keptAttributes","updatesBySource","Map","newValue","binding","setValue","setValues","set","get","size","value","keys","length","caption","href","jsx","Fragment","children","shimAttributeSource","settings","edit","addFilter"],"sources":["@wordpress/block-editor/src/hooks/use-bindings-attributes.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport { useRegistry, useSelect } from '@wordpress/data';\nimport { useCallback, useMemo } from '@wordpress/element';\nimport { addFilter } from '@wordpress/hooks';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../lock-unlock';\n\n/** @typedef {import('@wordpress/compose').WPHigherOrderComponent} WPHigherOrderComponent */\n/** @typedef {import('@wordpress/blocks').WPBlockSettings} WPBlockSettings */\n\n/**\n * Given a binding of block attributes, returns a higher order component that\n * overrides its `attributes` and `setAttributes` props to sync any changes needed.\n *\n * @return {WPHigherOrderComponent} Higher-order component.\n */\n\nconst BLOCK_BINDINGS_ALLOWED_BLOCKS = {\n\t'core/paragraph': [ 'content' ],\n\t'core/heading': [ 'content' ],\n\t'core/image': [ 'id', 'url', 'title', 'alt' ],\n\t'core/button': [ 'url', 'text', 'linkTarget', 'rel' ],\n};\n\nconst DEFAULT_ATTRIBUTE = '__default';\n\n/**\n * Returns the bindings with the `__default` binding for pattern overrides\n * replaced with the full-set of supported attributes. e.g.:\n *\n * bindings passed in: `{ __default: { source: 'core/pattern-overrides' } }`\n * bindings returned: `{ content: { source: 'core/pattern-overrides' } }`\n *\n * @param {string} blockName The block name (e.g. 'core/paragraph').\n * @param {Object} bindings A block's bindings from the metadata attribute.\n *\n * @return {Object} The bindings with default replaced for pattern overrides.\n */\nfunction replacePatternOverrideDefaultBindings( blockName, bindings ) {\n\t// The `__default` binding currently only works for pattern overrides.\n\tif (\n\t\tbindings?.[ DEFAULT_ATTRIBUTE ]?.source === 'core/pattern-overrides'\n\t) {\n\t\tconst supportedAttributes = BLOCK_BINDINGS_ALLOWED_BLOCKS[ blockName ];\n\t\tconst bindingsWithDefaults = {};\n\t\tfor ( const attributeName of supportedAttributes ) {\n\t\t\t// If the block has mixed binding sources, retain any non pattern override bindings.\n\t\t\tconst bindingSource = bindings[ attributeName ]\n\t\t\t\t? bindings[ attributeName ]\n\t\t\t\t: { source: 'core/pattern-overrides' };\n\t\t\tbindingsWithDefaults[ attributeName ] = bindingSource;\n\t\t}\n\n\t\treturn bindingsWithDefaults;\n\t}\n\n\treturn bindings;\n}\n\n/**\n * Based on the given block name,\n * check if it is possible to bind the block.\n *\n * @param {string} blockName - The block name.\n * @return {boolean} Whether it is possible to bind the block to sources.\n */\nexport function canBindBlock( blockName ) {\n\treturn blockName in BLOCK_BINDINGS_ALLOWED_BLOCKS;\n}\n\n/**\n * Based on the given block name and attribute name,\n * check if it is possible to bind the block attribute.\n *\n * @param {string} blockName - The block name.\n * @param {string} attributeName - The attribute name.\n * @return {boolean} Whether it is possible to bind the block attribute.\n */\nexport function canBindAttribute( blockName, attributeName ) {\n\treturn (\n\t\tcanBindBlock( blockName ) &&\n\t\tBLOCK_BINDINGS_ALLOWED_BLOCKS[ blockName ].includes( attributeName )\n\t);\n}\n\nexport const withBlockBindingSupport = createHigherOrderComponent(\n\t( BlockEdit ) => ( props ) => {\n\t\tconst registry = useRegistry();\n\t\tconst sources = useSelect( ( select ) =>\n\t\t\tunlock( select( blocksStore ) ).getAllBlockBindingsSources()\n\t\t);\n\t\tconst { name, clientId, context } = props;\n\t\tconst hasParentPattern = !! props.context[ 'pattern/overrides' ];\n\t\tconst hasPatternOverridesDefaultBinding =\n\t\t\tprops.attributes.metadata?.bindings?.[ DEFAULT_ATTRIBUTE ]\n\t\t\t\t?.source === 'core/pattern-overrides';\n\t\tconst bindings = useMemo(\n\t\t\t() =>\n\t\t\t\treplacePatternOverrideDefaultBindings(\n\t\t\t\t\tname,\n\t\t\t\t\tprops.attributes.metadata?.bindings\n\t\t\t\t),\n\t\t\t[ props.attributes.metadata?.bindings, name ]\n\t\t);\n\t\tconst boundAttributes = useSelect( () => {\n\t\t\tif ( ! bindings ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst attributes = {};\n\n\t\t\tfor ( const [ attributeName, boundAttribute ] of Object.entries(\n\t\t\t\tbindings\n\t\t\t) ) {\n\t\t\t\tconst source = sources[ boundAttribute.source ];\n\t\t\t\tif (\n\t\t\t\t\t! source?.getValue ||\n\t\t\t\t\t! canBindAttribute( name, attributeName )\n\t\t\t\t) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tconst args = {\n\t\t\t\t\tregistry,\n\t\t\t\t\tcontext,\n\t\t\t\t\tclientId,\n\t\t\t\t\tattributeName,\n\t\t\t\t\targs: boundAttribute.args,\n\t\t\t\t};\n\n\t\t\t\tattributes[ attributeName ] = source.getValue( args );\n\n\t\t\t\tif ( attributes[ attributeName ] === undefined ) {\n\t\t\t\t\tif ( attributeName === 'url' ) {\n\t\t\t\t\t\tattributes[ attributeName ] = null;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tattributes[ attributeName ] =\n\t\t\t\t\t\t\tsource.getPlaceholder?.( args );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn attributes;\n\t\t}, [ bindings, name, clientId, context, registry, sources ] );\n\n\t\tconst { setAttributes } = props;\n\n\t\tconst _setAttributes = useCallback(\n\t\t\t( nextAttributes ) => {\n\t\t\t\tregistry.batch( () => {\n\t\t\t\t\tif ( ! bindings ) {\n\t\t\t\t\t\tsetAttributes( nextAttributes );\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst keptAttributes = { ...nextAttributes };\n\t\t\t\t\tconst updatesBySource = new Map();\n\n\t\t\t\t\t// Loop only over the updated attributes to avoid modifying the bound ones that haven't changed.\n\t\t\t\t\tfor ( const [ attributeName, newValue ] of Object.entries(\n\t\t\t\t\t\tkeptAttributes\n\t\t\t\t\t) ) {\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t! bindings[ attributeName ] ||\n\t\t\t\t\t\t\t! canBindAttribute( name, attributeName )\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst binding = bindings[ attributeName ];\n\t\t\t\t\t\tconst source = sources[ binding?.source ];\n\t\t\t\t\t\tif ( ! source?.setValue && ! source?.setValues ) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tupdatesBySource.set( source, {\n\t\t\t\t\t\t\t...updatesBySource.get( source ),\n\t\t\t\t\t\t\t[ attributeName ]: newValue,\n\t\t\t\t\t\t} );\n\t\t\t\t\t\tdelete keptAttributes[ attributeName ];\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( updatesBySource.size ) {\n\t\t\t\t\t\tfor ( const [\n\t\t\t\t\t\t\tsource,\n\t\t\t\t\t\t\tattributes,\n\t\t\t\t\t\t] of updatesBySource ) {\n\t\t\t\t\t\t\tif ( source.setValues ) {\n\t\t\t\t\t\t\t\tsource.setValues( {\n\t\t\t\t\t\t\t\t\tregistry,\n\t\t\t\t\t\t\t\t\tcontext,\n\t\t\t\t\t\t\t\t\tclientId,\n\t\t\t\t\t\t\t\t\tattributes,\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tfor ( const [\n\t\t\t\t\t\t\t\t\tattributeName,\n\t\t\t\t\t\t\t\t\tvalue,\n\t\t\t\t\t\t\t\t] of Object.entries( attributes ) ) {\n\t\t\t\t\t\t\t\t\tconst binding = bindings[ attributeName ];\n\t\t\t\t\t\t\t\t\tsource.setValue( {\n\t\t\t\t\t\t\t\t\t\tregistry,\n\t\t\t\t\t\t\t\t\t\tcontext,\n\t\t\t\t\t\t\t\t\t\tclientId,\n\t\t\t\t\t\t\t\t\t\tattributeName,\n\t\t\t\t\t\t\t\t\t\targs: binding.args,\n\t\t\t\t\t\t\t\t\t\tvalue,\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\n\t\t\t\t\tif (\n\t\t\t\t\t\t// Don't update non-connected attributes if the block is using pattern overrides\n\t\t\t\t\t\t// and the editing is happening while overriding the pattern (not editing the original).\n\t\t\t\t\t\t! (\n\t\t\t\t\t\t\thasPatternOverridesDefaultBinding &&\n\t\t\t\t\t\t\thasParentPattern\n\t\t\t\t\t\t) &&\n\t\t\t\t\t\tObject.keys( keptAttributes ).length\n\t\t\t\t\t) {\n\t\t\t\t\t\t// Don't update caption and href until they are supported.\n\t\t\t\t\t\tif ( hasPatternOverridesDefaultBinding ) {\n\t\t\t\t\t\t\tdelete keptAttributes?.caption;\n\t\t\t\t\t\t\tdelete keptAttributes?.href;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsetAttributes( keptAttributes );\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t},\n\t\t\t[\n\t\t\t\tregistry,\n\t\t\t\tbindings,\n\t\t\t\tname,\n\t\t\t\tclientId,\n\t\t\t\tcontext,\n\t\t\t\tsetAttributes,\n\t\t\t\tsources,\n\t\t\t\thasPatternOverridesDefaultBinding,\n\t\t\t\thasParentPattern,\n\t\t\t]\n\t\t);\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<BlockEdit\n\t\t\t\t\t{ ...props }\n\t\t\t\t\tattributes={ { ...props.attributes, ...boundAttributes } }\n\t\t\t\t\tsetAttributes={ _setAttributes }\n\t\t\t\t/>\n\t\t\t</>\n\t\t);\n\t},\n\t'withBlockBindingSupport'\n);\n\n/**\n * Filters a registered block's settings to enhance a block's `edit` component\n * to upgrade bound attributes.\n *\n * @param {WPBlockSettings} settings - Registered block settings.\n * @param {string} name - Block name.\n * @return {WPBlockSettings} Filtered block settings.\n */\nfunction shimAttributeSource( settings, name ) {\n\tif ( ! canBindBlock( name ) ) {\n\t\treturn settings;\n\t}\n\n\treturn {\n\t\t...settings,\n\t\tedit: withBlockBindingSupport( settings.edit ),\n\t};\n}\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/editor/custom-sources-backwards-compatibility/shim-attribute-source',\n\tshimAttributeSource\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,WAAA,GAAAL,OAAA;AAAwC,IAAAM,WAAA,GAAAN,OAAA;AAZxC;AACA;AACA;;AAOA;AACA;AACA;;AAGA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAEA,MAAMO,6BAA6B,GAAG;EACrC,gBAAgB,EAAE,CAAE,SAAS,CAAE;EAC/B,cAAc,EAAE,CAAE,SAAS,CAAE;EAC7B,YAAY,EAAE,CAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,CAAE;EAC7C,aAAa,EAAE,CAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,KAAK;AACpD,CAAC;AAED,MAAMC,iBAAiB,GAAG,WAAW;;AAErC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,qCAAqCA,CAAEC,SAAS,EAAEC,QAAQ,EAAG;EACrE;EACA,IACCA,QAAQ,GAAIH,iBAAiB,CAAE,EAAEI,MAAM,KAAK,wBAAwB,EACnE;IACD,MAAMC,mBAAmB,GAAGN,6BAA6B,CAAEG,SAAS,CAAE;IACtE,MAAMI,oBAAoB,GAAG,CAAC,CAAC;IAC/B,KAAM,MAAMC,aAAa,IAAIF,mBAAmB,EAAG;MAClD;MACA,MAAMG,aAAa,GAAGL,QAAQ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AACF;AAEA,IAAAC,gBAAS,EACR,0BAA0B,EAC1B,0EAA0E,EAC1EH,mBACD,CAAC","ignoreList":[]}
@@ -117,6 +117,7 @@ function useStyleOverride({
117
117
  css,
118
118
  assets,
119
119
  __unstableType,
120
+ variation,
120
121
  clientId
121
122
  } = {}) {
122
123
  const {
@@ -136,6 +137,7 @@ function useStyleOverride({
136
137
  css,
137
138
  assets,
138
139
  __unstableType,
140
+ variation,
139
141
  clientId
140
142
  };
141
143
  // Batch updates to style overrides to avoid triggering cascading renders
@@ -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","assets","__unstableType","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","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\nexport function useStyleOverride( {\n\tid,\n\tcss,\n\tassets,\n\t__unstableType,\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\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( { index, useBlockProps, setAllWrapperProps, ...props } ) {\n\tconst wrapperProps = useBlockProps( 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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,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","__experimentalSkipSerialization","includes","pendingStyleOverrides","WeakMap","useStyleOverride","id","css","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","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\nexport function useStyleOverride( {\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( { index, useBlockProps, setAllWrapperProps, ...props } ) {\n\tconst wrapperProps = useBlockProps( 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,OAAO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D,OAAOsI,QAAQ,CAAC0C,MAAM,CAAE,CAAEM,IAAI,EAAE3K,OAAO,KAAM;MAC5C,MAAM;QAAEuI,UAAU;QAAEC,aAAa,GAAG,EAAE;QAAEoC;MAAa,CAAC,GAAG5K,OAAO;MAEhE,MAAM6K,gBAAgB,GAAG,CAAC,CAAC;MAC3B,KAAM,MAAM3M,GAAG,IAAIsK,aAAa,EAAG;QAClC,IAAKnJ,UAAU,CAAEnB,GAAG,CAAE,EAAG;UACxB2M,gBAAgB,CAAE3M,GAAG,CAAE,GAAGmB,UAAU,CAAEnB,GAAG,CAAE;QAC5C;MACD;MAEA;MACC;MACA;MACA,CAAEH,MAAM,CAACoM,IAAI,CAAEU,gBAAiB,CAAC,CAACvM,MAAM,IACxC,CAAEiK,UAAU,CAAElG,IAAK,CAAC,EACnB;QACD,OAAOsI,IAAI;MACZ;MAEA,OAAOC,YAAY,CAAED,IAAI,EAAEtI,IAAI,EAAEwI,gBAAiB,CAAC;IACpD,CAAC,EAAE1C,KAAM,CAAC;EACX;EACA,IAAAe,gBAAS,EACR,kCAAkC,EAClC,mBAAmB,EACnBwB,mBAAmB,EACnB,CACD,CAAC;EACD,IAAAxB,gBAAS,EACR,kCAAkC,EAClC,mBAAmB,EACjBf,KAAK,IAAM;IACZ;IACA;IACA;IACA,IAAKA,KAAK,CAAC2C,cAAc,CAAE,WAAY,CAAC,IAAI,CAAE3C,KAAK,CAACoC,SAAS,EAAG;MAC/D,OAAOpC,KAAK,CAACoC,SAAS;IACvB;IAEA,OAAOpC,KAAK;EACb,CACD,CAAC;AACF","ignoreList":[]}
@@ -85,6 +85,7 @@ const privateApis = exports.privateApis = {};
85
85
  PrivateBlockPopover: _blockPopover.PrivateBlockPopover,
86
86
  PrivatePublishDateTimePicker: _publishDateTimePicker.PrivatePublishDateTimePicker,
87
87
  useSpacingSizes: _useSpacingSizes.default,
88
- useBlockDisplayTitle: _useBlockDisplayTitle.default
88
+ useBlockDisplayTitle: _useBlockDisplayTitle.default,
89
+ __unstableBlockStyleVariationOverridesWithConfig: _hooks.__unstableBlockStyleVariationOverridesWithConfig
89
90
  });
90
91
  //# sourceMappingURL=private-apis.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["globalStyles","_interopRequireWildcard","require","_provider","_lockUnlock","_getRichTextValues","_resizableBoxPopover","_interopRequireDefault","_inserter","_quickInserter","_searchItems","_listView","_blockInfoSlotFill","_useHasBlockToolbar","_utils","_blockQuickNavigation","_layout","_blockRemovalWarningModal","_hooks","_dimensionsTool","_resolutionTool","_textAlignmentControl","_reusableBlockRenameHint","_formatEdit","_blockCanvas","_utils2","_useFlashEditableBlocks","_privateKeys","_utils3","_richText","_blockPopover","_library","_publishDateTimePicker","_useSpacingSizes","_useBlockDisplayTitle","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","privateApis","exports","lock","ExperimentalBlockCanvas","ExperimentalBlockEditorProvider","getDuotoneFilter","getRichTextValues","PrivateInserter","PrivateQuickInserter","extractWords","getNormalizedSearchTerms","normalizeString","PrivateListView","ResizableBoxPopover","BlockInfo","useHasBlockToolbar","cleanEmptyObject","useStyleOverride","BlockQuickNavigation","LayoutStyle","BlockRemovalWarningModal","useLayoutClasses","useLayoutStyles","DimensionsTool","ResolutionTool","TextAlignmentControl","ReusableBlocksRenameHint","useReusableBlocksRenameHint","usesContextKey","useFlashEditableBlocks","globalStylesDataKey","selectBlockPatternsKey","requiresWrapperOnCopy","PrivateRichText","PrivateInserterLibrary","reusableBlocksSelectKey","PrivateBlockPopover","PrivatePublishDateTimePicker","useSpacingSizes","useBlockDisplayTitle"],"sources":["@wordpress/block-editor/src/private-apis.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport * as globalStyles from './components/global-styles';\nimport { ExperimentalBlockEditorProvider } from './components/provider';\nimport { lock } from './lock-unlock';\nimport { getRichTextValues } from './components/rich-text/get-rich-text-values';\nimport ResizableBoxPopover from './components/resizable-box-popover';\nimport { ComposedPrivateInserter as PrivateInserter } from './components/inserter';\nimport { default as PrivateQuickInserter } from './components/inserter/quick-inserter';\nimport {\n\textractWords,\n\tgetNormalizedSearchTerms,\n\tnormalizeString,\n} from './components/inserter/search-items';\nimport { PrivateListView } from './components/list-view';\nimport BlockInfo from './components/block-info-slot-fill';\nimport { useHasBlockToolbar } from './components/block-toolbar/use-has-block-toolbar';\nimport { cleanEmptyObject, useStyleOverride } from './hooks/utils';\nimport BlockQuickNavigation from './components/block-quick-navigation';\nimport { LayoutStyle } from './components/block-list/layout';\nimport { BlockRemovalWarningModal } from './components/block-removal-warning-modal';\nimport { useLayoutClasses, useLayoutStyles } from './hooks';\nimport DimensionsTool from './components/dimensions-tool';\nimport ResolutionTool from './components/resolution-tool';\nimport TextAlignmentControl from './components/text-alignment-control';\nimport {\n\tdefault as ReusableBlocksRenameHint,\n\tuseReusableBlocksRenameHint,\n} from './components/inserter/reusable-block-rename-hint';\nimport { usesContextKey } from './components/rich-text/format-edit';\nimport { ExperimentalBlockCanvas } from './components/block-canvas';\nimport { getDuotoneFilter } from './components/duotone/utils';\nimport { useFlashEditableBlocks } from './components/use-flash-editable-blocks';\nimport {\n\tselectBlockPatternsKey,\n\treusableBlocksSelectKey,\n\tglobalStylesDataKey,\n} from './store/private-keys';\nimport { requiresWrapperOnCopy } from './components/writing-flow/utils';\nimport { PrivateRichText } from './components/rich-text/';\nimport { PrivateBlockPopover } from './components/block-popover';\nimport { PrivateInserterLibrary } from './components/inserter/library';\nimport { PrivatePublishDateTimePicker } from './components/publish-date-time-picker';\nimport useSpacingSizes from './components/spacing-sizes-control/hooks/use-spacing-sizes';\nimport useBlockDisplayTitle from './components/block-title/use-block-display-title';\n\n/**\n * Private @wordpress/block-editor APIs.\n */\nexport const privateApis = {};\nlock( privateApis, {\n\t...globalStyles,\n\tExperimentalBlockCanvas,\n\tExperimentalBlockEditorProvider,\n\tgetDuotoneFilter,\n\tgetRichTextValues,\n\tPrivateInserter,\n\tPrivateQuickInserter,\n\textractWords,\n\tgetNormalizedSearchTerms,\n\tnormalizeString,\n\tPrivateListView,\n\tResizableBoxPopover,\n\tBlockInfo,\n\tuseHasBlockToolbar,\n\tcleanEmptyObject,\n\tuseStyleOverride,\n\tBlockQuickNavigation,\n\tLayoutStyle,\n\tBlockRemovalWarningModal,\n\tuseLayoutClasses,\n\tuseLayoutStyles,\n\tDimensionsTool,\n\tResolutionTool,\n\tTextAlignmentControl,\n\tReusableBlocksRenameHint,\n\tuseReusableBlocksRenameHint,\n\tusesContextKey,\n\tuseFlashEditableBlocks,\n\tglobalStylesDataKey,\n\tselectBlockPatternsKey,\n\trequiresWrapperOnCopy,\n\tPrivateRichText,\n\tPrivateInserterLibrary,\n\treusableBlocksSelectKey,\n\tPrivateBlockPopover,\n\tPrivatePublishDateTimePicker,\n\tuseSpacingSizes,\n\tuseBlockDisplayTitle,\n} );\n"],"mappings":";;;;;;;AAGA,IAAAA,YAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,kBAAA,GAAAH,OAAA;AACA,IAAAI,oBAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AACA,IAAAO,cAAA,GAAAF,sBAAA,CAAAL,OAAA;AACA,IAAAQ,YAAA,GAAAR,OAAA;AAKA,IAAAS,SAAA,GAAAT,OAAA;AACA,IAAAU,kBAAA,GAAAL,sBAAA,CAAAL,OAAA;AACA,IAAAW,mBAAA,GAAAX,OAAA;AACA,IAAAY,MAAA,GAAAZ,OAAA;AACA,IAAAa,qBAAA,GAAAR,sBAAA,CAAAL,OAAA;AACA,IAAAc,OAAA,GAAAd,OAAA;AACA,IAAAe,yBAAA,GAAAf,OAAA;AACA,IAAAgB,MAAA,GAAAhB,OAAA;AACA,IAAAiB,eAAA,GAAAZ,sBAAA,CAAAL,OAAA;AACA,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AdA,uBAAc;EACdC,oBAAoB,EAApBA,6BAAoB;EACpBC,wBAAwB,EAAxBA,gCAAwB;EACxBC,2BAA2B,EAA3BA,oDAA2B;EAC3BC,cAAc,EAAdA,0BAAc;EACdC,sBAAsB,EAAtBA,8CAAsB;EACtBC,mBAAmB,EAAnBA,gCAAmB;EACnBC,sBAAsB,EAAtBA,mCAAsB;EACtBC,qBAAqB,EAArBA,6BAAqB;EACrBC,eAAe,EAAfA,yBAAe;EACfC,sBAAsB,EAAtBA,+BAAsB;EACtBC,uBAAuB,EAAvBA,oCAAuB;EACvBC,mBAAmB,EAAnBA,iCAAmB;EACnBC,4BAA4B,EAA5BA,mDAA4B;EAC5BC,eAAe,EAAfA,wBAAe;EACfC,oBAAoB,EAApBA;AACD,CAAE,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["globalStyles","_interopRequireWildcard","require","_provider","_lockUnlock","_getRichTextValues","_resizableBoxPopover","_interopRequireDefault","_inserter","_quickInserter","_searchItems","_listView","_blockInfoSlotFill","_useHasBlockToolbar","_utils","_blockQuickNavigation","_layout","_blockRemovalWarningModal","_hooks","_dimensionsTool","_resolutionTool","_textAlignmentControl","_reusableBlockRenameHint","_formatEdit","_blockCanvas","_utils2","_useFlashEditableBlocks","_privateKeys","_utils3","_richText","_blockPopover","_library","_publishDateTimePicker","_useSpacingSizes","_useBlockDisplayTitle","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","privateApis","exports","lock","ExperimentalBlockCanvas","ExperimentalBlockEditorProvider","getDuotoneFilter","getRichTextValues","PrivateInserter","PrivateQuickInserter","extractWords","getNormalizedSearchTerms","normalizeString","PrivateListView","ResizableBoxPopover","BlockInfo","useHasBlockToolbar","cleanEmptyObject","useStyleOverride","BlockQuickNavigation","LayoutStyle","BlockRemovalWarningModal","useLayoutClasses","useLayoutStyles","DimensionsTool","ResolutionTool","TextAlignmentControl","ReusableBlocksRenameHint","useReusableBlocksRenameHint","usesContextKey","useFlashEditableBlocks","globalStylesDataKey","selectBlockPatternsKey","requiresWrapperOnCopy","PrivateRichText","PrivateInserterLibrary","reusableBlocksSelectKey","PrivateBlockPopover","PrivatePublishDateTimePicker","useSpacingSizes","useBlockDisplayTitle","__unstableBlockStyleVariationOverridesWithConfig"],"sources":["@wordpress/block-editor/src/private-apis.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport * as globalStyles from './components/global-styles';\nimport { ExperimentalBlockEditorProvider } from './components/provider';\nimport { lock } from './lock-unlock';\nimport { getRichTextValues } from './components/rich-text/get-rich-text-values';\nimport ResizableBoxPopover from './components/resizable-box-popover';\nimport { ComposedPrivateInserter as PrivateInserter } from './components/inserter';\nimport { default as PrivateQuickInserter } from './components/inserter/quick-inserter';\nimport {\n\textractWords,\n\tgetNormalizedSearchTerms,\n\tnormalizeString,\n} from './components/inserter/search-items';\nimport { PrivateListView } from './components/list-view';\nimport BlockInfo from './components/block-info-slot-fill';\nimport { useHasBlockToolbar } from './components/block-toolbar/use-has-block-toolbar';\nimport { cleanEmptyObject, useStyleOverride } from './hooks/utils';\nimport BlockQuickNavigation from './components/block-quick-navigation';\nimport { LayoutStyle } from './components/block-list/layout';\nimport { BlockRemovalWarningModal } from './components/block-removal-warning-modal';\nimport {\n\tuseLayoutClasses,\n\tuseLayoutStyles,\n\t__unstableBlockStyleVariationOverridesWithConfig,\n} from './hooks';\nimport DimensionsTool from './components/dimensions-tool';\nimport ResolutionTool from './components/resolution-tool';\nimport TextAlignmentControl from './components/text-alignment-control';\nimport {\n\tdefault as ReusableBlocksRenameHint,\n\tuseReusableBlocksRenameHint,\n} from './components/inserter/reusable-block-rename-hint';\nimport { usesContextKey } from './components/rich-text/format-edit';\nimport { ExperimentalBlockCanvas } from './components/block-canvas';\nimport { getDuotoneFilter } from './components/duotone/utils';\nimport { useFlashEditableBlocks } from './components/use-flash-editable-blocks';\nimport {\n\tselectBlockPatternsKey,\n\treusableBlocksSelectKey,\n\tglobalStylesDataKey,\n} from './store/private-keys';\nimport { requiresWrapperOnCopy } from './components/writing-flow/utils';\nimport { PrivateRichText } from './components/rich-text/';\nimport { PrivateBlockPopover } from './components/block-popover';\nimport { PrivateInserterLibrary } from './components/inserter/library';\nimport { PrivatePublishDateTimePicker } from './components/publish-date-time-picker';\nimport useSpacingSizes from './components/spacing-sizes-control/hooks/use-spacing-sizes';\nimport useBlockDisplayTitle from './components/block-title/use-block-display-title';\n\n/**\n * Private @wordpress/block-editor APIs.\n */\nexport const privateApis = {};\nlock( privateApis, {\n\t...globalStyles,\n\tExperimentalBlockCanvas,\n\tExperimentalBlockEditorProvider,\n\tgetDuotoneFilter,\n\tgetRichTextValues,\n\tPrivateInserter,\n\tPrivateQuickInserter,\n\textractWords,\n\tgetNormalizedSearchTerms,\n\tnormalizeString,\n\tPrivateListView,\n\tResizableBoxPopover,\n\tBlockInfo,\n\tuseHasBlockToolbar,\n\tcleanEmptyObject,\n\tuseStyleOverride,\n\tBlockQuickNavigation,\n\tLayoutStyle,\n\tBlockRemovalWarningModal,\n\tuseLayoutClasses,\n\tuseLayoutStyles,\n\tDimensionsTool,\n\tResolutionTool,\n\tTextAlignmentControl,\n\tReusableBlocksRenameHint,\n\tuseReusableBlocksRenameHint,\n\tusesContextKey,\n\tuseFlashEditableBlocks,\n\tglobalStylesDataKey,\n\tselectBlockPatternsKey,\n\trequiresWrapperOnCopy,\n\tPrivateRichText,\n\tPrivateInserterLibrary,\n\treusableBlocksSelectKey,\n\tPrivateBlockPopover,\n\tPrivatePublishDateTimePicker,\n\tuseSpacingSizes,\n\tuseBlockDisplayTitle,\n\t__unstableBlockStyleVariationOverridesWithConfig,\n} );\n"],"mappings":";;;;;;;AAGA,IAAAA,YAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,kBAAA,GAAAH,OAAA;AACA,IAAAI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EACfC,oBAAoB,EAApBA,sBAAoB;EACpBC,YAAY,EAAZA,yBAAY;EACZC,wBAAwB,EAAxBA,qCAAwB;EACxBC,eAAe,EAAfA,4BAAe;EACfC,eAAe,EAAfA,yBAAe;EACfC,mBAAmB,EAAnBA,4BAAmB;EACnBC,SAAS,EAATA,0BAAS;EACTC,kBAAkB,EAAlBA,sCAAkB;EAClBC,gBAAgB,EAAhBA,uBAAgB;EAChBC,gBAAgB,EAAhBA,uBAAgB;EAChBC,oBAAoB,EAApBA,6BAAoB;EACpBC,WAAW,EAAXA,mBAAW;EACXC,wBAAwB,EAAxBA,kDAAwB;EACxBC,gBAAgB,EAAhBA,uBAAgB;EAChBC,eAAe,EAAfA,sBAAe;EACfC,cAAc,EAAdA,uBAAc;EACdC,cAAc,EAAdA,uBAAc;EACdC,oBAAoB,EAApBA,6BAAoB;EACpBC,wBAAwB,EAAxBA,gCAAwB;EACxBC,2BAA2B,EAA3BA,oDAA2B;EAC3BC,cAAc,EAAdA,0BAAc;EACdC,sBAAsB,EAAtBA,8CAAsB;EACtBC,mBAAmB,EAAnBA,gCAAmB;EACnBC,sBAAsB,EAAtBA,mCAAsB;EACtBC,qBAAqB,EAArBA,6BAAqB;EACrBC,eAAe,EAAfA,yBAAe;EACfC,sBAAsB,EAAtBA,+BAAsB;EACtBC,uBAAuB,EAAvBA,oCAAuB;EACvBC,mBAAmB,EAAnBA,iCAAmB;EACnBC,4BAA4B,EAA5BA,mDAA4B;EAC5BC,eAAe,EAAfA,wBAAe;EACfC,oBAAoB,EAApBA,6BAAoB;EACpBC,gDAAgD,EAAhDA;AACD,CAAE,CAAC","ignoreList":[]}
@@ -58,7 +58,9 @@ export default function Shuffle({
58
58
  // otherwise we may shuffle to pattern that will not allow to continue shuffling.
59
59
  pattern.blocks.length === 1 && pattern.categories?.some(category => {
60
60
  return categories.includes(category);
61
- })
61
+ }) && (
62
+ // Check if the pattern is not a synced pattern.
63
+ pattern.syncStatus === 'unsynced' || !pattern.id)
62
64
  );
63
65
  });
64
66
  }, [categories, patterns]);