@wordpress/block-editor 15.8.1-next.dc3f6d3c1.0 → 15.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (205) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/block-list/index.js +2 -1
  3. package/build/components/block-list/index.js.map +2 -2
  4. package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js +27 -5
  5. package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +2 -2
  6. package/build/components/block-lock/modal.js +5 -5
  7. package/build/components/block-lock/modal.js.map +2 -2
  8. package/build/components/block-lock/use-block-lock.js +10 -13
  9. package/build/components/block-lock/use-block-lock.js.map +2 -2
  10. package/build/components/block-settings-menu-controls/index.js +1 -1
  11. package/build/components/block-settings-menu-controls/index.js.map +2 -2
  12. package/build/components/block-tools/index.js +56 -45
  13. package/build/components/block-tools/index.js.map +3 -3
  14. package/build/components/block-visibility/toolbar.js +1 -1
  15. package/build/components/block-visibility/toolbar.js.map +1 -1
  16. package/build/components/content-only-controls/fields-dropdown-menu.js +66 -0
  17. package/build/components/content-only-controls/fields-dropdown-menu.js.map +7 -0
  18. package/build/components/content-only-controls/index.js +225 -44
  19. package/build/components/content-only-controls/index.js.map +3 -3
  20. package/build/components/content-only-controls/link/index.js +92 -103
  21. package/build/components/content-only-controls/link/index.js.map +3 -3
  22. package/build/components/content-only-controls/media/index.js +134 -134
  23. package/build/components/content-only-controls/media/index.js.map +3 -3
  24. package/build/components/content-only-controls/rich-text/index.js +65 -74
  25. package/build/components/content-only-controls/rich-text/index.js.map +3 -3
  26. package/build/components/font-family/index.js +1 -15
  27. package/build/components/font-family/index.js.map +2 -2
  28. package/build/components/global-styles/dimensions-panel.js +35 -2
  29. package/build/components/global-styles/dimensions-panel.js.map +2 -2
  30. package/build/components/global-styles/hooks.js +1 -1
  31. package/build/components/global-styles/hooks.js.map +2 -2
  32. package/build/components/global-styles/typography-panel.js +1 -2
  33. package/build/components/global-styles/typography-panel.js.map +2 -2
  34. package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js +1 -1
  35. package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +2 -2
  36. package/build/components/link-control/index.js +15 -7
  37. package/build/components/link-control/index.js.map +2 -2
  38. package/build/components/list-view/block-select-button.js +3 -11
  39. package/build/components/list-view/block-select-button.js.map +2 -2
  40. package/build/components/list-view/block.js +9 -7
  41. package/build/components/list-view/block.js.map +2 -2
  42. package/build/components/media-placeholder/index.js +17 -4
  43. package/build/components/media-placeholder/index.js.map +2 -2
  44. package/build/components/media-placeholder/utils.js +60 -0
  45. package/build/components/media-placeholder/utils.js.map +7 -0
  46. package/build/components/media-replace-flow/index.js +20 -3
  47. package/build/components/media-replace-flow/index.js.map +2 -2
  48. package/build/components/use-block-commands/index.js +1 -1
  49. package/build/components/use-block-commands/index.js.map +2 -2
  50. package/build/components/use-block-drop-zone/index.js +1 -5
  51. package/build/components/use-block-drop-zone/index.js.map +2 -2
  52. package/build/hooks/dimensions.js +3 -3
  53. package/build/hooks/dimensions.js.map +2 -2
  54. package/build/hooks/metadata.js +1 -1
  55. package/build/hooks/metadata.js.map +2 -2
  56. package/build/hooks/utils.js +5 -1
  57. package/build/hooks/utils.js.map +2 -2
  58. package/build/store/private-selectors.js +43 -3
  59. package/build/store/private-selectors.js.map +2 -2
  60. package/build/store/reducer.js +2 -1
  61. package/build/store/reducer.js.map +2 -2
  62. package/build/store/selectors.js +6 -4
  63. package/build/store/selectors.js.map +2 -2
  64. package/build-module/components/block-list/index.js +2 -1
  65. package/build-module/components/block-list/index.js.map +2 -2
  66. package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js +27 -5
  67. package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +2 -2
  68. package/build-module/components/block-lock/modal.js +5 -5
  69. package/build-module/components/block-lock/modal.js.map +2 -2
  70. package/build-module/components/block-lock/use-block-lock.js +10 -13
  71. package/build-module/components/block-lock/use-block-lock.js.map +2 -2
  72. package/build-module/components/block-settings-menu-controls/index.js +1 -1
  73. package/build-module/components/block-settings-menu-controls/index.js.map +2 -2
  74. package/build-module/components/block-tools/index.js +56 -45
  75. package/build-module/components/block-tools/index.js.map +2 -2
  76. package/build-module/components/block-visibility/toolbar.js +1 -1
  77. package/build-module/components/block-visibility/toolbar.js.map +1 -1
  78. package/build-module/components/content-only-controls/fields-dropdown-menu.js +45 -0
  79. package/build-module/components/content-only-controls/fields-dropdown-menu.js.map +7 -0
  80. package/build-module/components/content-only-controls/index.js +229 -46
  81. package/build-module/components/content-only-controls/index.js.map +2 -2
  82. package/build-module/components/content-only-controls/link/index.js +92 -104
  83. package/build-module/components/content-only-controls/link/index.js.map +2 -2
  84. package/build-module/components/content-only-controls/media/index.js +134 -135
  85. package/build-module/components/content-only-controls/media/index.js.map +2 -2
  86. package/build-module/components/content-only-controls/rich-text/index.js +67 -81
  87. package/build-module/components/content-only-controls/rich-text/index.js.map +2 -2
  88. package/build-module/components/font-family/index.js +1 -15
  89. package/build-module/components/font-family/index.js.map +2 -2
  90. package/build-module/components/global-styles/dimensions-panel.js +35 -2
  91. package/build-module/components/global-styles/dimensions-panel.js.map +2 -2
  92. package/build-module/components/global-styles/hooks.js +1 -1
  93. package/build-module/components/global-styles/hooks.js.map +2 -2
  94. package/build-module/components/global-styles/typography-panel.js +1 -2
  95. package/build-module/components/global-styles/typography-panel.js.map +2 -2
  96. package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js +1 -1
  97. package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +2 -2
  98. package/build-module/components/link-control/index.js +16 -8
  99. package/build-module/components/link-control/index.js.map +2 -2
  100. package/build-module/components/list-view/block-select-button.js +3 -11
  101. package/build-module/components/list-view/block-select-button.js.map +2 -2
  102. package/build-module/components/list-view/block.js +9 -7
  103. package/build-module/components/list-view/block.js.map +2 -2
  104. package/build-module/components/media-placeholder/index.js +18 -5
  105. package/build-module/components/media-placeholder/index.js.map +2 -2
  106. package/build-module/components/media-placeholder/utils.js +35 -0
  107. package/build-module/components/media-placeholder/utils.js.map +7 -0
  108. package/build-module/components/media-replace-flow/index.js +20 -3
  109. package/build-module/components/media-replace-flow/index.js.map +2 -2
  110. package/build-module/components/use-block-commands/index.js +1 -1
  111. package/build-module/components/use-block-commands/index.js.map +2 -2
  112. package/build-module/components/use-block-drop-zone/index.js +1 -5
  113. package/build-module/components/use-block-drop-zone/index.js.map +2 -2
  114. package/build-module/hooks/dimensions.js +3 -3
  115. package/build-module/hooks/dimensions.js.map +2 -2
  116. package/build-module/hooks/metadata.js +1 -1
  117. package/build-module/hooks/metadata.js.map +2 -2
  118. package/build-module/hooks/utils.js +5 -1
  119. package/build-module/hooks/utils.js.map +2 -2
  120. package/build-module/store/private-selectors.js +39 -3
  121. package/build-module/store/private-selectors.js.map +2 -2
  122. package/build-module/store/reducer.js +2 -1
  123. package/build-module/store/reducer.js.map +2 -2
  124. package/build-module/store/selectors.js +6 -4
  125. package/build-module/store/selectors.js.map +2 -2
  126. package/build-style/content-rtl.css +3 -0
  127. package/build-style/content.css +3 -0
  128. package/build-style/style-rtl.css +14 -5
  129. package/build-style/style.css +14 -5
  130. package/package.json +38 -37
  131. package/src/components/block-list/content.scss +5 -0
  132. package/src/components/block-list/index.js +3 -1
  133. package/src/components/block-list/use-block-props/use-selected-block-event-handlers.js +34 -3
  134. package/src/components/block-lock/modal.js +6 -5
  135. package/src/components/block-lock/use-block-lock.js +10 -14
  136. package/src/components/block-patterns-list/stories/{index.story.js → index.story.jsx} +3 -1
  137. package/src/components/block-settings-menu-controls/index.js +1 -1
  138. package/src/components/block-tools/index.js +15 -2
  139. package/src/components/block-tools/style.scss +4 -0
  140. package/src/components/block-visibility/toolbar.js +1 -1
  141. package/src/components/content-only-controls/fields-dropdown-menu.js +53 -0
  142. package/src/components/content-only-controls/index.js +314 -50
  143. package/src/components/content-only-controls/link/index.js +62 -57
  144. package/src/components/content-only-controls/media/index.js +177 -156
  145. package/src/components/content-only-controls/rich-text/index.js +30 -44
  146. package/src/components/content-only-controls/styles.scss +10 -1
  147. package/src/components/font-family/README.md +0 -9
  148. package/src/components/font-family/index.js +1 -16
  149. package/src/components/font-family/stories/{index.story.js → index.story.jsx} +0 -1
  150. package/src/components/global-styles/dimensions-panel.js +36 -0
  151. package/src/components/global-styles/hooks.js +1 -1
  152. package/src/components/global-styles/typography-panel.js +0 -1
  153. package/src/components/inspector-controls-tabs/use-inspector-controls-tabs.js +1 -5
  154. package/src/components/link-control/index.js +36 -12
  155. package/src/components/list-view/block-select-button.js +22 -30
  156. package/src/components/list-view/block.js +9 -7
  157. package/src/components/media-placeholder/index.js +20 -5
  158. package/src/components/media-placeholder/test/get-computed-accept-attribute.js +164 -0
  159. package/src/components/media-placeholder/utils.js +65 -0
  160. package/src/components/media-replace-flow/index.js +22 -3
  161. package/src/components/use-block-commands/index.js +1 -1
  162. package/src/components/use-block-drop-zone/index.js +1 -5
  163. package/src/hooks/dimensions.js +8 -3
  164. package/src/hooks/metadata.js +1 -1
  165. package/src/hooks/test/metadata.js +1 -1
  166. package/src/hooks/utils.js +4 -0
  167. package/src/store/private-selectors.js +123 -6
  168. package/src/store/reducer.js +3 -0
  169. package/src/store/selectors.js +6 -4
  170. package/src/store/test/private-selectors.js +242 -0
  171. package/src/store/test/reducer.js +17 -7
  172. package/src/style.scss +0 -1
  173. package/tsconfig.json +1 -0
  174. package/build/components/content-only-controls/plain-text/index.js +0 -68
  175. package/build/components/content-only-controls/plain-text/index.js.map +0 -7
  176. package/build-module/components/content-only-controls/plain-text/index.js +0 -50
  177. package/build-module/components/content-only-controls/plain-text/index.js.map +0 -7
  178. package/src/components/content-only-controls/plain-text/index.js +0 -49
  179. package/src/components/font-family/style.scss +0 -7
  180. /package/src/components/alignment-control/stories/{aliginment-toolbar.story.js → aliginment-toolbar.story.jsx} +0 -0
  181. /package/src/components/alignment-control/stories/{index.story.js → index.story.jsx} +0 -0
  182. /package/src/components/block-alignment-matrix-control/stories/{index.story.js → index.story.jsx} +0 -0
  183. /package/src/components/block-draggable/stories/{index.story.js → index.story.jsx} +0 -0
  184. /package/src/components/block-heading-level-dropdown/stories/{index.story.js → index.story.jsx} +0 -0
  185. /package/src/components/block-mover/stories/{index.story.js → index.story.jsx} +0 -0
  186. /package/src/components/block-title/stories/{index.story.js → index.story.jsx} +0 -0
  187. /package/src/components/border-radius-control/stories/{index.story.js → index.story.jsx} +0 -0
  188. /package/src/components/date-format-picker/stories/{index.story.js → index.story.jsx} +0 -0
  189. /package/src/components/dimensions-tool/stories/{aspect-ratio-tool.story.js → aspect-ratio-tool.story.jsx} +0 -0
  190. /package/src/components/dimensions-tool/stories/{index.story.js → index.story.jsx} +0 -0
  191. /package/src/components/dimensions-tool/stories/{scale-tool.story.js → scale-tool.story.jsx} +0 -0
  192. /package/src/components/dimensions-tool/stories/{width-height-tool.story.js → width-height-tool.story.jsx} +0 -0
  193. /package/src/components/height-control/stories/{index.story.js → index.story.jsx} +0 -0
  194. /package/src/components/inserter/stories/{index.story.js → index.story.jsx} +0 -0
  195. /package/src/components/line-height-control/stories/{index.story.js → index.story.jsx} +0 -0
  196. /package/src/components/plain-text/stories/{index.story.js → index.story.jsx} +0 -0
  197. /package/src/components/resolution-tool/stories/{index.story.js → index.story.jsx} +0 -0
  198. /package/src/components/tabbed-sidebar/stories/{index.story.js → index.story.jsx} +0 -0
  199. /package/src/components/text-alignment-control/stories/{index.story.js → index.story.jsx} +0 -0
  200. /package/src/components/text-decoration-control/stories/{index.story.js → index.story.jsx} +0 -0
  201. /package/src/components/text-transform-control/stories/{index.story.js → index.story.jsx} +0 -0
  202. /package/src/components/unit-control/stories/{index.story.js → index.story.jsx} +0 -0
  203. /package/src/components/url-popover/stories/{index.story.js → index.story.jsx} +0 -0
  204. /package/src/components/warning/stories/{index.story.js → index.story.jsx} +0 -0
  205. /package/src/components/writing-mode-control/stories/{index.story.js → index.story.jsx} +0 -0
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/hooks/dimensions.js"],
4
- "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { Platform, useState, useEffect, useCallback } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { getBlockSupport } from '@wordpress/blocks';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport InspectorControls from '../components/inspector-controls';\nimport {\n\tDimensionsPanel as StylesDimensionsPanel,\n\tuseHasDimensionsPanel,\n} from '../components/global-styles';\nimport { MarginVisualizer, PaddingVisualizer } from './spacing-visualizer';\nimport { store as blockEditorStore } from '../store';\nimport { unlock } from '../lock-unlock';\nimport { cleanEmptyObject, shouldSkipSerialization } from './utils';\n\nexport const DIMENSIONS_SUPPORT_KEY = 'dimensions';\nexport const SPACING_SUPPORT_KEY = 'spacing';\nexport const ALL_SIDES = [ 'top', 'right', 'bottom', 'left' ];\nexport const AXIAL_SIDES = [ 'vertical', 'horizontal' ];\n\nfunction useVisualizer() {\n\tconst [ property, setProperty ] = useState( false );\n\tconst { hideBlockInterface, showBlockInterface } = unlock(\n\t\tuseDispatch( blockEditorStore )\n\t);\n\tuseEffect( () => {\n\t\tif ( ! property ) {\n\t\t\tshowBlockInterface();\n\t\t} else {\n\t\t\thideBlockInterface();\n\t\t}\n\t}, [ property, showBlockInterface, hideBlockInterface ] );\n\n\treturn [ property, setProperty ];\n}\n\nfunction DimensionsInspectorControl( { children, resetAllFilter } ) {\n\tconst attributesResetAllFilter = useCallback(\n\t\t( attributes ) => {\n\t\t\tconst existingStyle = attributes.style;\n\t\t\tconst updatedStyle = resetAllFilter( existingStyle );\n\t\t\treturn {\n\t\t\t\t...attributes,\n\t\t\t\tstyle: updatedStyle,\n\t\t\t};\n\t\t},\n\t\t[ resetAllFilter ]\n\t);\n\n\treturn (\n\t\t<InspectorControls\n\t\t\tgroup=\"dimensions\"\n\t\t\tresetAllFilter={ attributesResetAllFilter }\n\t\t>\n\t\t\t{ children }\n\t\t</InspectorControls>\n\t);\n}\n\nexport function DimensionsPanel( { clientId, name, setAttributes, settings } ) {\n\tconst isEnabled = useHasDimensionsPanel( settings );\n\tconst value = useSelect(\n\t\t( select ) => {\n\t\t\t// Early return to avoid subscription when disabled\n\t\t\tif ( ! isEnabled ) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\treturn select( blockEditorStore ).getBlockAttributes( clientId )\n\t\t\t\t?.style;\n\t\t},\n\t\t[ clientId, isEnabled ]\n\t);\n\tconst [ visualizedProperty, setVisualizedProperty ] = useVisualizer();\n\tconst onChange = ( newStyle ) => {\n\t\tsetAttributes( {\n\t\t\tstyle: cleanEmptyObject( newStyle ),\n\t\t} );\n\t};\n\n\tif ( ! isEnabled ) {\n\t\treturn null;\n\t}\n\n\tconst defaultDimensionsControls = getBlockSupport( name, [\n\t\tDIMENSIONS_SUPPORT_KEY,\n\t\t'__experimentalDefaultControls',\n\t] );\n\tconst defaultSpacingControls = getBlockSupport( name, [\n\t\tSPACING_SUPPORT_KEY,\n\t\t'__experimentalDefaultControls',\n\t] );\n\tconst defaultControls = {\n\t\t...defaultDimensionsControls,\n\t\t...defaultSpacingControls,\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<StylesDimensionsPanel\n\t\t\t\tas={ DimensionsInspectorControl }\n\t\t\t\tpanelId={ clientId }\n\t\t\t\tsettings={ settings }\n\t\t\t\tvalue={ value }\n\t\t\t\tonChange={ onChange }\n\t\t\t\tdefaultControls={ defaultControls }\n\t\t\t\tonVisualize={ setVisualizedProperty }\n\t\t\t/>\n\t\t\t{ !! settings?.spacing?.padding &&\n\t\t\t\tvisualizedProperty === 'padding' && (\n\t\t\t\t\t<PaddingVisualizer\n\t\t\t\t\t\tforceShow={ visualizedProperty === 'padding' }\n\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t{ !! settings?.spacing?.margin &&\n\t\t\t\tvisualizedProperty === 'margin' && (\n\t\t\t\t\t<MarginVisualizer\n\t\t\t\t\t\tforceShow={ visualizedProperty === 'margin' }\n\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t</>\n\t);\n}\n\n/**\n * Determine whether there is block support for dimensions.\n *\n * @param {string} blockName Block name.\n * @param {string} feature Background image feature to check for.\n *\n * @return {boolean} Whether there is support.\n */\nexport function hasDimensionsSupport( blockName, feature = 'any' ) {\n\tif ( Platform.OS !== 'web' ) {\n\t\treturn false;\n\t}\n\n\tconst support = getBlockSupport( blockName, DIMENSIONS_SUPPORT_KEY );\n\n\tif ( support === true ) {\n\t\treturn true;\n\t}\n\n\tif ( feature === 'any' ) {\n\t\treturn !! ( support?.aspectRatio || !! support?.minHeight );\n\t}\n\n\treturn !! support?.[ feature ];\n}\n\nexport default {\n\tuseBlockProps,\n\tattributeKeys: [ 'minHeight', 'style' ],\n\thasSupport( name ) {\n\t\treturn hasDimensionsSupport( name, 'aspectRatio' );\n\t},\n};\n\nfunction useBlockProps( { name, minHeight, style } ) {\n\tif (\n\t\t! hasDimensionsSupport( name, 'aspectRatio' ) ||\n\t\tshouldSkipSerialization( name, DIMENSIONS_SUPPORT_KEY, 'aspectRatio' )\n\t) {\n\t\treturn {};\n\t}\n\n\tconst className = clsx( {\n\t\t'has-aspect-ratio': !! style?.dimensions?.aspectRatio,\n\t} );\n\n\t// Allow dimensions-based inline style overrides to override any global styles rules that\n\t// might be set for the block, and therefore affect the display of the aspect ratio.\n\tconst inlineStyleOverrides = {};\n\n\t// Apply rules to unset incompatible styles.\n\t// Note that a set `aspectRatio` will win out if both an aspect ratio and a minHeight are set.\n\t// This is because the aspect ratio is a newer block support, so (in theory) any aspect ratio\n\t// that is set should be intentional and should override any existing minHeight. The Cover block\n\t// and dimensions controls have logic that will manually clear the aspect ratio if a minHeight\n\t// is set.\n\tif ( style?.dimensions?.aspectRatio ) {\n\t\t// To ensure the aspect ratio does not get overridden by `minHeight` unset any existing rule.\n\t\tinlineStyleOverrides.minHeight = 'unset';\n\t} else if ( minHeight || style?.dimensions?.minHeight ) {\n\t\t// To ensure the minHeight does not get overridden by `aspectRatio` unset any existing rule.\n\t\tinlineStyleOverrides.aspectRatio = 'unset';\n\t}\n\n\treturn { className, style: inlineStyleOverrides };\n}\n\n/**\n * @deprecated\n */\nexport function useCustomSides() {\n\tdeprecated( 'wp.blockEditor.__experimentalUseCustomSides', {\n\t\tsince: '6.3',\n\t\tversion: '6.4',\n\t} );\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAiB;AAKjB,qBAA2D;AAC3D,kBAAuC;AACvC,oBAAgC;AAChC,wBAAuB;AAKvB,gCAA8B;AAC9B,2BAGO;AACP,gCAAoD;AACpD,mBAA0C;AAC1C,yBAAuB;AACvB,mBAA0D;AAqCxD;AAnCK,IAAM,yBAAyB;AAC/B,IAAM,sBAAsB;AAC5B,IAAM,YAAY,CAAE,OAAO,SAAS,UAAU,MAAO;AACrD,IAAM,cAAc,CAAE,YAAY,YAAa;AAEtD,SAAS,gBAAgB;AACxB,QAAM,CAAE,UAAU,WAAY,QAAI,yBAAU,KAAM;AAClD,QAAM,EAAE,oBAAoB,mBAAmB,QAAI;AAAA,QAClD,yBAAa,aAAAA,KAAiB;AAAA,EAC/B;AACA,gCAAW,MAAM;AAChB,QAAK,CAAE,UAAW;AACjB,yBAAmB;AAAA,IACpB,OAAO;AACN,yBAAmB;AAAA,IACpB;AAAA,EACD,GAAG,CAAE,UAAU,oBAAoB,kBAAmB,CAAE;AAExD,SAAO,CAAE,UAAU,WAAY;AAChC;AAEA,SAAS,2BAA4B,EAAE,UAAU,eAAe,GAAI;AACnE,QAAM,+BAA2B;AAAA,IAChC,C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AE;AACH;",
4
+ "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { Platform, useState, useEffect, useCallback } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { getBlockSupport } from '@wordpress/blocks';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport InspectorControls from '../components/inspector-controls';\nimport {\n\tDimensionsPanel as StylesDimensionsPanel,\n\tuseHasDimensionsPanel,\n} from '../components/global-styles';\nimport { MarginVisualizer, PaddingVisualizer } from './spacing-visualizer';\nimport { store as blockEditorStore } from '../store';\nimport { unlock } from '../lock-unlock';\nimport { cleanEmptyObject, shouldSkipSerialization } from './utils';\n\nexport const DIMENSIONS_SUPPORT_KEY = 'dimensions';\nexport const SPACING_SUPPORT_KEY = 'spacing';\nexport const ALL_SIDES = [ 'top', 'right', 'bottom', 'left' ];\nexport const AXIAL_SIDES = [ 'vertical', 'horizontal' ];\n\nfunction useVisualizer() {\n\tconst [ property, setProperty ] = useState( false );\n\tconst { hideBlockInterface, showBlockInterface } = unlock(\n\t\tuseDispatch( blockEditorStore )\n\t);\n\tuseEffect( () => {\n\t\tif ( ! property ) {\n\t\t\tshowBlockInterface();\n\t\t} else {\n\t\t\thideBlockInterface();\n\t\t}\n\t}, [ property, showBlockInterface, hideBlockInterface ] );\n\n\treturn [ property, setProperty ];\n}\n\nfunction DimensionsInspectorControl( { children, resetAllFilter } ) {\n\tconst attributesResetAllFilter = useCallback(\n\t\t( attributes ) => {\n\t\t\tconst existingStyle = attributes.style;\n\t\t\tconst updatedStyle = resetAllFilter( existingStyle );\n\t\t\treturn {\n\t\t\t\t...attributes,\n\t\t\t\tstyle: updatedStyle,\n\t\t\t};\n\t\t},\n\t\t[ resetAllFilter ]\n\t);\n\n\treturn (\n\t\t<InspectorControls\n\t\t\tgroup=\"dimensions\"\n\t\t\tresetAllFilter={ attributesResetAllFilter }\n\t\t>\n\t\t\t{ children }\n\t\t</InspectorControls>\n\t);\n}\n\nexport function DimensionsPanel( { clientId, name, setAttributes, settings } ) {\n\tconst isEnabled = useHasDimensionsPanel( settings );\n\tconst value = useSelect(\n\t\t( select ) => {\n\t\t\t// Early return to avoid subscription when disabled\n\t\t\tif ( ! isEnabled ) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\treturn select( blockEditorStore ).getBlockAttributes( clientId )\n\t\t\t\t?.style;\n\t\t},\n\t\t[ clientId, isEnabled ]\n\t);\n\n\tconst [ visualizedProperty, setVisualizedProperty ] = useVisualizer();\n\tconst onChange = ( newStyle ) => {\n\t\tsetAttributes( {\n\t\t\tstyle: cleanEmptyObject( newStyle ),\n\t\t} );\n\t};\n\n\tif ( ! isEnabled ) {\n\t\treturn null;\n\t}\n\n\tconst defaultDimensionsControls = getBlockSupport( name, [\n\t\tDIMENSIONS_SUPPORT_KEY,\n\t\t'__experimentalDefaultControls',\n\t] );\n\tconst defaultSpacingControls = getBlockSupport( name, [\n\t\tSPACING_SUPPORT_KEY,\n\t\t'__experimentalDefaultControls',\n\t] );\n\tconst defaultControls = {\n\t\t...defaultDimensionsControls,\n\t\t...defaultSpacingControls,\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<StylesDimensionsPanel\n\t\t\t\tas={ DimensionsInspectorControl }\n\t\t\t\tpanelId={ clientId }\n\t\t\t\tsettings={ settings }\n\t\t\t\tvalue={ value }\n\t\t\t\tonChange={ onChange }\n\t\t\t\tdefaultControls={ defaultControls }\n\t\t\t\tonVisualize={ setVisualizedProperty }\n\t\t\t/>\n\t\t\t{ !! settings?.spacing?.padding &&\n\t\t\t\tvisualizedProperty === 'padding' && (\n\t\t\t\t\t<PaddingVisualizer\n\t\t\t\t\t\tforceShow={ visualizedProperty === 'padding' }\n\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t{ !! settings?.spacing?.margin &&\n\t\t\t\tvisualizedProperty === 'margin' && (\n\t\t\t\t\t<MarginVisualizer\n\t\t\t\t\t\tforceShow={ visualizedProperty === 'margin' }\n\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t</>\n\t);\n}\n\n/**\n * Determine whether there is block support for dimensions.\n *\n * @param {string} blockName Block name.\n * @param {string} feature Background image feature to check for.\n *\n * @return {boolean} Whether there is support.\n */\nexport function hasDimensionsSupport( blockName, feature = 'any' ) {\n\tif ( Platform.OS !== 'web' ) {\n\t\treturn false;\n\t}\n\n\tconst support = getBlockSupport( blockName, DIMENSIONS_SUPPORT_KEY );\n\n\tif ( support === true ) {\n\t\treturn true;\n\t}\n\n\tif ( feature === 'any' ) {\n\t\treturn !! (\n\t\t\tsupport?.aspectRatio ||\n\t\t\t!! support?.minHeight ||\n\t\t\t!! support?.width\n\t\t);\n\t}\n\n\treturn !! support?.[ feature ];\n}\n\nexport default {\n\tuseBlockProps,\n\tattributeKeys: [ 'minHeight', 'width', 'style' ],\n\thasSupport( name ) {\n\t\treturn hasDimensionsSupport( name );\n\t},\n};\n\nfunction useBlockProps( { name, minHeight, style } ) {\n\tif (\n\t\t! hasDimensionsSupport( name, 'aspectRatio' ) ||\n\t\tshouldSkipSerialization( name, DIMENSIONS_SUPPORT_KEY, 'aspectRatio' )\n\t) {\n\t\treturn {};\n\t}\n\n\tconst className = clsx( {\n\t\t'has-aspect-ratio': !! style?.dimensions?.aspectRatio,\n\t} );\n\n\t// Allow dimensions-based inline style overrides to override any global styles rules that\n\t// might be set for the block, and therefore affect the display of the aspect ratio.\n\tconst inlineStyleOverrides = {};\n\n\t// Apply rules to unset incompatible styles.\n\t// Note that a set `aspectRatio` will win out if both an aspect ratio and a minHeight are set.\n\t// This is because the aspect ratio is a newer block support, so (in theory) any aspect ratio\n\t// that is set should be intentional and should override any existing minHeight. The Cover block\n\t// and dimensions controls have logic that will manually clear the aspect ratio if a minHeight\n\t// is set.\n\tif ( style?.dimensions?.aspectRatio ) {\n\t\t// To ensure the aspect ratio does not get overridden by `minHeight` unset any existing rule.\n\t\tinlineStyleOverrides.minHeight = 'unset';\n\t} else if ( minHeight || style?.dimensions?.minHeight ) {\n\t\t// To ensure the minHeight does not get overridden by `aspectRatio` unset any existing rule.\n\t\tinlineStyleOverrides.aspectRatio = 'unset';\n\t}\n\n\treturn { className, style: inlineStyleOverrides };\n}\n\n/**\n * @deprecated\n */\nexport function useCustomSides() {\n\tdeprecated( 'wp.blockEditor.__experimentalUseCustomSides', {\n\t\tsince: '6.3',\n\t\tversion: '6.4',\n\t} );\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAiB;AAKjB,qBAA2D;AAC3D,kBAAuC;AACvC,oBAAgC;AAChC,wBAAuB;AAKvB,gCAA8B;AAC9B,2BAGO;AACP,gCAAoD;AACpD,mBAA0C;AAC1C,yBAAuB;AACvB,mBAA0D;AAqCxD;AAnCK,IAAM,yBAAyB;AAC/B,IAAM,sBAAsB;AAC5B,IAAM,YAAY,CAAE,OAAO,SAAS,UAAU,MAAO;AACrD,IAAM,cAAc,CAAE,YAAY,YAAa;AAEtD,SAAS,gBAAgB;AACxB,QAAM,CAAE,UAAU,WAAY,QAAI,yBAAU,KAAM;AAClD,QAAM,EAAE,oBAAoB,mBAAmB,QAAI;AAAA,QAClD,yBAAa,aAAAA,KAAiB;AAAA,EAC/B;AACA,gCAAW,MAAM;AAChB,QAAK,CAAE,UAAW;AACjB,yBAAmB;AAAA,IACpB,OAAO;AACN,yBAAmB;AAAA,IACpB;AAAA,EACD,GAAG,CAAE,UAAU,oBAAoB,kBAAmB,CAAE;AAExD,SAAO,CAAE,UAAU,WAAY;AAChC;AAEA,SAAS,2BAA4B,EAAE,UAAU,eAAe,GAAI;AACnE,QAAM,+BAA2B;AAAA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O;AAAA,IACP,SAAS;AAAA,EACV,CAAE;AACH;",
6
6
  "names": ["blockEditorStore", "InspectorControls", "StylesDimensionsPanel", "clsx", "deprecated"]
7
7
  }
@@ -60,7 +60,7 @@ function addTransforms(result, source, index, results) {
60
60
  if (sourceMetadata.name && !result.attributes?.metadata?.name && (0, import_blocks.hasBlockSupport)(result.name, "renaming", true)) {
61
61
  preservedMetadata.name = sourceMetadata.name;
62
62
  }
63
- if (sourceMetadata.blockVisibility !== void 0 && !result.attributes?.metadata?.blockVisibility && (0, import_blocks.hasBlockSupport)(result.name, "blockVisibility", true)) {
63
+ if (sourceMetadata.blockVisibility !== void 0 && !result.attributes?.metadata?.blockVisibility && (0, import_blocks.hasBlockSupport)(result.name, "visibility", true)) {
64
64
  preservedMetadata.blockVisibility = sourceMetadata.blockVisibility;
65
65
  }
66
66
  if (Object.keys(preservedMetadata).length > 0) {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/hooks/metadata.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\nimport { hasBlockSupport } from '@wordpress/blocks';\n\nconst META_ATTRIBUTE_NAME = 'metadata';\n\n/**\n * Filters registered block settings, extending attributes to include `metadata`.\n *\n * see: https://github.com/WordPress/gutenberg/pull/40393/files#r864632012\n *\n * @param {Object} blockTypeSettings Original block settings.\n * @return {Object} Filtered block settings.\n */\nexport function addMetaAttribute( blockTypeSettings ) {\n\t// Allow blocks to specify their own attribute definition with default values if needed.\n\tif ( blockTypeSettings?.attributes?.[ META_ATTRIBUTE_NAME ]?.type ) {\n\t\treturn blockTypeSettings;\n\t}\n\n\tblockTypeSettings.attributes = {\n\t\t...blockTypeSettings.attributes,\n\t\t[ META_ATTRIBUTE_NAME ]: {\n\t\t\ttype: 'object',\n\t\t},\n\t};\n\n\treturn blockTypeSettings;\n}\n\n/**\n * Add metadata transforms.\n *\n * @param {Object} result The transformed block.\n * @param {Array} source Original blocks transformed.\n * @param {number} index Index of the transformed block.\n * @param {Array} results All blocks that resulted from the transformation.\n * @return {Object} Modified transformed block.\n */\nexport function addTransforms( result, source, index, results ) {\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 metadata should not be kept.\n\tif ( results.length === 1 && result.innerBlocks.length === source.length ) {\n\t\treturn result;\n\t}\n\n\t// If we are transforming one block to multiple blocks or multiple blocks to one block,\n\t// we ignore the metadata during the transform.\n\tif (\n\t\t( results.length === 1 && source.length > 1 ) ||\n\t\t( results.length > 1 && source.length === 1 )\n\t) {\n\t\treturn result;\n\t}\n\n\t// If we are transforming multiple blocks to multiple blocks with different counts,\n\t// we ignore the metadata during the transform.\n\tif (\n\t\tresults.length > 1 &&\n\t\tsource.length > 1 &&\n\t\tresults.length !== source.length\n\t) {\n\t\treturn result;\n\t}\n\n\tconst sourceMetadata = source[ index ]?.attributes?.metadata;\n\n\tif ( ! sourceMetadata ) {\n\t\treturn result;\n\t}\n\n\tconst preservedMetadata = {};\n\n\t// Notes\n\tif ( sourceMetadata.noteId && ! result.attributes?.metadata?.noteId ) {\n\t\tpreservedMetadata.noteId = sourceMetadata.noteId;\n\t}\n\n\t// Custom name\n\tif (\n\t\tsourceMetadata.name &&\n\t\t! result.attributes?.metadata?.name &&\n\t\thasBlockSupport( result.name, 'renaming', true )\n\t) {\n\t\tpreservedMetadata.name = sourceMetadata.name;\n\t}\n\n\t// Block visibility\n\tif (\n\t\tsourceMetadata.blockVisibility !== undefined &&\n\t\t! result.attributes?.metadata?.blockVisibility &&\n\t\thasBlockSupport( result.name, 'blockVisibility', true )\n\t) {\n\t\tpreservedMetadata.blockVisibility = sourceMetadata.blockVisibility;\n\t}\n\n\tif ( Object.keys( preservedMetadata ).length > 0 ) {\n\t\treturn {\n\t\t\t...result,\n\t\t\tattributes: {\n\t\t\t\t...result.attributes,\n\t\t\t\tmetadata: {\n\t\t\t\t\t...result.attributes.metadata,\n\t\t\t\t\t...preservedMetadata,\n\t\t\t\t},\n\t\t\t},\n\t\t};\n\t}\n\treturn result;\n}\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/metadata/addMetaAttribute',\n\taddMetaAttribute\n);\n\naddFilter(\n\t'blocks.switchToBlockType.transformedBlock',\n\t'core/metadata/addTransforms',\n\taddTransforms\n);\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,mBAA0B;AAC1B,oBAAgC;AAEhC,IAAM,sBAAsB;AAUrB,SAAS,iBAAkB,mBAAoB;AAErD,MAAK,mBAAmB,aAAc,mBAAoB,GAAG,MAAO;AACnE,WAAO;AAAA,EACR;AAEA,oBAAkB,aAAa;AAAA,IAC9B,GAAG,kBAAkB;AAAA,IACrB,CAAE,mBAAoB,GAAG;AAAA,MACxB,MAAM;AAAA,IACP;AAAA,EACD;AAEA,SAAO;AACR;AAWO,SAAS,cAAe,QAAQ,QAAQ,OAAO,SAAU;AAG/D,MAAK,QAAQ,WAAW,KAAK,OAAO,YAAY,WAAW,OAAO,QAAS;AAC1E,WAAO;AAAA,EACR;AAIA,MACG,QAAQ,WAAW,KAAK,OAAO,SAAS,KACxC,QAAQ,SAAS,KAAK,OAAO,WAAW,GACzC;AACD,WAAO;AAAA,EACR;AAIA,MACC,QAAQ,SAAS,KACjB,OAAO,SAAS,KAChB,QAAQ,WAAW,OAAO,QACzB;AACD,WAAO;AAAA,EACR;AAEA,QAAM,iBAAiB,OAAQ,KAAM,GAAG,YAAY;AAEpD,MAAK,CAAE,gBAAiB;AACvB,WAAO;AAAA,EACR;AAEA,QAAM,oBAAoB,CAAC;AAG3B,MAAK,eAAe,UAAU,CAAE,OAAO,YAAY,UAAU,QAAS;AACrE,sBAAkB,SAAS,eAAe;AAAA,EAC3C;AAGA,MACC,eAAe,QACf,CAAE,OAAO,YAAY,UAAU,YAC/B,+BAAiB,OAAO,MAAM,YAAY,IAAK,GAC9C;AACD,sBAAkB,OAAO,eAAe;AAAA,EACzC;AAGA,MACC,eAAe,oBAAoB,UACnC,CAAE,OAAO,YAAY,UAAU,uBAC/B,+BAAiB,OAAO,MAAM,mBAAmB,IAAK,GACrD;AACD,sBAAkB,kBAAkB,eAAe;AAAA,EACpD;AAEA,MAAK,OAAO,KAAM,iBAAkB,EAAE,SAAS,GAAI;AAClD,WAAO;AAAA,MACN,GAAG;AAAA,MACH,YAAY;AAAA,QACX,GAAG,OAAO;AAAA,QACV,UAAU;AAAA,UACT,GAAG,OAAO,WAAW;AAAA,UACrB,GAAG;AAAA,QACJ;AAAA,MACD;AAAA,IACD;AAAA,EACD;AACA,SAAO;AACR;AAAA,IAEA;AAAA,EACC;AAAA,EACA;AAAA,EACA;AACD;AAAA,IAEA;AAAA,EACC;AAAA,EACA;AAAA,EACA;AACD;",
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\nimport { hasBlockSupport } from '@wordpress/blocks';\n\nconst META_ATTRIBUTE_NAME = 'metadata';\n\n/**\n * Filters registered block settings, extending attributes to include `metadata`.\n *\n * see: https://github.com/WordPress/gutenberg/pull/40393/files#r864632012\n *\n * @param {Object} blockTypeSettings Original block settings.\n * @return {Object} Filtered block settings.\n */\nexport function addMetaAttribute( blockTypeSettings ) {\n\t// Allow blocks to specify their own attribute definition with default values if needed.\n\tif ( blockTypeSettings?.attributes?.[ META_ATTRIBUTE_NAME ]?.type ) {\n\t\treturn blockTypeSettings;\n\t}\n\n\tblockTypeSettings.attributes = {\n\t\t...blockTypeSettings.attributes,\n\t\t[ META_ATTRIBUTE_NAME ]: {\n\t\t\ttype: 'object',\n\t\t},\n\t};\n\n\treturn blockTypeSettings;\n}\n\n/**\n * Add metadata transforms.\n *\n * @param {Object} result The transformed block.\n * @param {Array} source Original blocks transformed.\n * @param {number} index Index of the transformed block.\n * @param {Array} results All blocks that resulted from the transformation.\n * @return {Object} Modified transformed block.\n */\nexport function addTransforms( result, source, index, results ) {\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 metadata should not be kept.\n\tif ( results.length === 1 && result.innerBlocks.length === source.length ) {\n\t\treturn result;\n\t}\n\n\t// If we are transforming one block to multiple blocks or multiple blocks to one block,\n\t// we ignore the metadata during the transform.\n\tif (\n\t\t( results.length === 1 && source.length > 1 ) ||\n\t\t( results.length > 1 && source.length === 1 )\n\t) {\n\t\treturn result;\n\t}\n\n\t// If we are transforming multiple blocks to multiple blocks with different counts,\n\t// we ignore the metadata during the transform.\n\tif (\n\t\tresults.length > 1 &&\n\t\tsource.length > 1 &&\n\t\tresults.length !== source.length\n\t) {\n\t\treturn result;\n\t}\n\n\tconst sourceMetadata = source[ index ]?.attributes?.metadata;\n\n\tif ( ! sourceMetadata ) {\n\t\treturn result;\n\t}\n\n\tconst preservedMetadata = {};\n\n\t// Notes\n\tif ( sourceMetadata.noteId && ! result.attributes?.metadata?.noteId ) {\n\t\tpreservedMetadata.noteId = sourceMetadata.noteId;\n\t}\n\n\t// Custom name\n\tif (\n\t\tsourceMetadata.name &&\n\t\t! result.attributes?.metadata?.name &&\n\t\thasBlockSupport( result.name, 'renaming', true )\n\t) {\n\t\tpreservedMetadata.name = sourceMetadata.name;\n\t}\n\n\t// Block visibility\n\tif (\n\t\tsourceMetadata.blockVisibility !== undefined &&\n\t\t! result.attributes?.metadata?.blockVisibility &&\n\t\thasBlockSupport( result.name, 'visibility', true )\n\t) {\n\t\tpreservedMetadata.blockVisibility = sourceMetadata.blockVisibility;\n\t}\n\n\tif ( Object.keys( preservedMetadata ).length > 0 ) {\n\t\treturn {\n\t\t\t...result,\n\t\t\tattributes: {\n\t\t\t\t...result.attributes,\n\t\t\t\tmetadata: {\n\t\t\t\t\t...result.attributes.metadata,\n\t\t\t\t\t...preservedMetadata,\n\t\t\t\t},\n\t\t\t},\n\t\t};\n\t}\n\treturn result;\n}\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/metadata/addMet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cAAc,IAAK,GAChD;AACD,sBAAkB,kBAAkB,eAAe;AAAA,EACpD;AAEA,MAAK,OAAO,KAAM,iBAAkB,EAAE,SAAS,GAAI;AAClD,WAAO;AAAA,MACN,GAAG;AAAA,MACH,YAAY;AAAA,QACX,GAAG,OAAO;AAAA,QACV,UAAU;AAAA,UACT,GAAG,OAAO,WAAW;AAAA,UACrB,GAAG;AAAA,QACJ;AAAA,MACD;AAAA,IACD;AAAA,EACD;AACA,SAAO;AACR;AAAA,IAEA;AAAA,EACC;AAAA,EACA;AAAA,EACA;AACD;AAAA,IAEA;AAAA,EACC;AAAA,EACA;AAAA,EACA;AACD;",
6
6
  "names": []
7
7
  }
@@ -208,6 +208,7 @@ function useBlockSettings(name, parentLayout) {
208
208
  units,
209
209
  aspectRatio,
210
210
  minHeight,
211
+ width,
211
212
  layout,
212
213
  borderColor,
213
214
  borderRadius,
@@ -266,6 +267,7 @@ function useBlockSettings(name, parentLayout) {
266
267
  "spacing.units",
267
268
  "dimensions.aspectRatio",
268
269
  "dimensions.minHeight",
270
+ "dimensions.width",
269
271
  "layout",
270
272
  "border.color",
271
273
  "border.radius",
@@ -373,7 +375,8 @@ function useBlockSettings(name, parentLayout) {
373
375
  },
374
376
  dimensions: {
375
377
  aspectRatio,
376
- minHeight
378
+ minHeight,
379
+ width
377
380
  },
378
381
  layout,
379
382
  parentLayout,
@@ -410,6 +413,7 @@ function useBlockSettings(name, parentLayout) {
410
413
  units,
411
414
  aspectRatio,
412
415
  minHeight,
416
+ width,
413
417
  layout,
414
418
  parentLayout,
415
419
  borderColor,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/hooks/utils.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { getBlockSupport } from '@wordpress/blocks';\nimport { memo, useMemo, useEffect, useId, useState } from '@wordpress/element';\nimport { useDispatch, useRegistry } from '@wordpress/data';\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport { addFilter } from '@wordpress/hooks';\n\n/**\n * Internal dependencies\n */\nimport {\n\tuseBlockEditContext,\n\tmayDisplayControlsKey,\n\tmayDisplayParentControlsKey,\n} from '../components/block-edit/context';\nimport { useSettings } from '../components';\nimport { useSettingsForBlockElement } from '../components/global-styles/hooks';\nimport { getValueFromObjectPath, setImmutably } from '../utils/object';\nimport { store as blockEditorStore } from '../store';\nimport { unlock } from '../lock-unlock';\n/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * Removed falsy values from nested object.\n *\n * @param {*} object\n * @return {*} Object cleaned from falsy values\n */\nexport const cleanEmptyObject = ( object ) => {\n\tif (\n\t\tobject === null ||\n\t\ttypeof object !== 'object' ||\n\t\tArray.isArray( object )\n\t) {\n\t\treturn object;\n\t}\n\n\tconst cleanedNestedObjects = Object.entries( object )\n\t\t.map( ( [ key, value ] ) => [ key, cleanEmptyObject( value ) ] )\n\t\t.filter( ( [ , value ] ) => value !== undefined );\n\treturn ! cleanedNestedObjects.length\n\t\t? undefined\n\t\t: Object.fromEntries( cleanedNestedObjects );\n};\n\nexport function transformStyles(\n\tactiveSupports,\n\tmigrationPaths,\n\tresult,\n\tsource,\n\tindex,\n\tresults\n) {\n\t// If there are no active supports return early.\n\tif (\n\t\tObject.values( activeSupports ?? {} ).every(\n\t\t\t( isActive ) => ! isActive\n\t\t)\n\t) {\n\t\treturn result;\n\t}\n\t// If the condition verifies we are probably in the presence of a wrapping transform\n\t// e.g: nesting paragraphs in a group or columns and in that case the styles should not be transformed.\n\tif ( results.length === 1 && result.innerBlocks.length === source.length ) {\n\t\treturn result;\n\t}\n\t// For cases where we have a transform from one block to multiple blocks\n\t// or multiple blocks to one block we apply the styles of the first source block\n\t// to the result(s).\n\tlet referenceBlockAttributes = source[ 0 ]?.attributes;\n\t// If we are in presence of transform between more than one block in the source\n\t// that has more than one block in the result\n\t// we apply the styles on source N to the result N,\n\t// if source N does not exists we do nothing.\n\tif ( results.length > 1 && source.length > 1 ) {\n\t\tif ( source[ index ] ) {\n\t\t\treferenceBlockAttributes = source[ index ]?.attributes;\n\t\t} else {\n\t\t\treturn result;\n\t\t}\n\t}\n\tlet returnBlock = result;\n\tObject.entries( activeSupports ).forEach( ( [ support, isActive ] ) => {\n\t\tif ( isActive ) {\n\t\t\tmigrationPaths[ support ].forEach( ( path ) => {\n\t\t\t\tconst styleValue = getValueFromObjectPath(\n\t\t\t\t\treferenceBlockAttributes,\n\t\t\t\t\tpath\n\t\t\t\t);\n\t\t\t\tif ( styleValue ) {\n\t\t\t\t\treturnBlock = {\n\t\t\t\t\t\t...returnBlock,\n\t\t\t\t\t\tattributes: setImmutably(\n\t\t\t\t\t\t\treturnBlock.attributes,\n\t\t\t\t\t\t\tpath,\n\t\t\t\t\t\t\tstyleValue\n\t\t\t\t\t\t),\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t} );\n\treturn returnBlock;\n}\n\n/**\n * Check whether serialization of specific block support feature or set should\n * be skipped.\n *\n * @param {string|Object} blockNameOrType Block name or block type object.\n * @param {string} featureSet Name of block support feature set.\n * @param {string} feature Name of the individual feature to check.\n *\n * @return {boolean} Whether serialization should occur.\n */\nexport function shouldSkipSerialization(\n\tblockNameOrType,\n\tfeatureSet,\n\tfeature\n) {\n\tconst support = getBlockSupport( blockNameOrType, featureSet );\n\tconst skipSerialization = support?.__experimentalSkipSerialization;\n\n\tif ( Array.isArray( skipSerialization ) ) {\n\t\treturn skipSerialization.includes( feature );\n\t}\n\n\treturn skipSerialization;\n}\n\nconst pendingStyleOverrides = new WeakMap();\n\n/**\n * Override a block editor settings style. Leave the ID blank to create a new\n * style.\n *\n * @param {Object} override Override object.\n * @param {?string} override.id Id of the style override, leave blank to create\n * a new style.\n * @param {string} override.css CSS to apply.\n */\nexport function useStyleOverride( { id, css } ) {\n\treturn usePrivateStyleOverride( { id, css } );\n}\n\nexport function usePrivateStyleOverride( {\n\tid,\n\tcss,\n\tassets,\n\t__unstableType,\n\tvariation,\n\tclientId,\n} = {} ) {\n\tconst { setStyleOverride, deleteStyleOverride } = unlock(\n\t\tuseDispatch( blockEditorStore )\n\t);\n\tconst registry = useRegistry();\n\tconst fallbackId = useId();\n\tuseEffect( () => {\n\t\t// Unmount if there is CSS and assets are empty.\n\t\tif ( ! css && ! assets ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst _id = id || fallbackId;\n\t\tconst override = {\n\t\t\tid,\n\t\t\tcss,\n\t\t\tassets,\n\t\t\t__unstableType,\n\t\t\tvariation,\n\t\t\tclientId,\n\t\t};\n\t\t// Batch updates to style overrides to avoid triggering cascading renders\n\t\t// for each style override block included in a tree and optimize initial render.\n\t\tif ( ! pendingStyleOverrides.get( registry ) ) {\n\t\t\tpendingStyleOverrides.set( registry, [] );\n\t\t}\n\t\tpendingStyleOverrides.get( registry ).push( [ _id, override ] );\n\t\twindow.queueMicrotask( () => {\n\t\t\tif ( pendingStyleOverrides.get( registry )?.length ) {\n\t\t\t\tregistry.batch( () => {\n\t\t\t\t\tpendingStyleOverrides.get( registry ).forEach( ( args ) => {\n\t\t\t\t\t\tsetStyleOverride( ...args );\n\t\t\t\t\t} );\n\t\t\t\t\tpendingStyleOverrides.set( registry, [] );\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\n\t\treturn () => {\n\t\t\tconst isPending = pendingStyleOverrides\n\t\t\t\t.get( registry )\n\t\t\t\t?.find( ( [ currentId ] ) => currentId === _id );\n\t\t\tif ( isPending ) {\n\t\t\t\tpendingStyleOverrides.set(\n\t\t\t\t\tregistry,\n\t\t\t\t\tpendingStyleOverrides\n\t\t\t\t\t\t.get( registry )\n\t\t\t\t\t\t.filter( ( [ currentId ] ) => currentId !== _id )\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tdeleteStyleOverride( _id );\n\t\t\t}\n\t\t};\n\t}, [\n\t\tid,\n\t\tcss,\n\t\tclientId,\n\t\tassets,\n\t\t__unstableType,\n\t\tfallbackId,\n\t\tsetStyleOverride,\n\t\tdeleteStyleOverride,\n\t\tregistry,\n\t] );\n}\n\n/**\n * Based on the block and its context, returns an object of all the block settings.\n * This object can be passed as a prop to all the Styles UI components\n * (TypographyPanel, DimensionsPanel...).\n *\n * @param {string} name Block name.\n * @param {*} parentLayout Parent layout.\n *\n * @return {Object} Settings object.\n */\nexport function useBlockSettings( name, parentLayout ) {\n\tconst [\n\t\tbackgroundImage,\n\t\tbackgroundSize,\n\t\tcustomFontFamilies,\n\t\tdefaultFontFamilies,\n\t\tthemeFontFamilies,\n\t\tdefaultFontSizesEnabled,\n\t\tcustomFontSizes,\n\t\tdefaultFontSizes,\n\t\tthemeFontSizes,\n\t\tcustomFontSize,\n\t\tfontStyle,\n\t\tfontWeight,\n\t\tlineHeight,\n\t\ttextAlign,\n\t\ttextColumns,\n\t\ttextDecoration,\n\t\twritingMode,\n\t\ttextTransform,\n\t\tletterSpacing,\n\t\tpadding,\n\t\tmargin,\n\t\tblockGap,\n\t\tdefaultSpacingSizesEnabled,\n\t\tcustomSpacingSize,\n\t\tuserSpacingSizes,\n\t\tdefaultSpacingSizes,\n\t\tthemeSpacingSizes,\n\t\tunits,\n\t\taspectRatio,\n\t\tminHeight,\n\t\tlayout,\n\t\tborderColor,\n\t\tborderRadius,\n\t\tborderStyle,\n\t\tborderWidth,\n\t\tborderRadiusSizes,\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'border.radiusSizes',\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\tradiusSizes: borderRadiusSizes,\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\tborderRadiusSizes,\n\t\tcustomColorsEnabled,\n\t\tcustomColors,\n\t\tcustomDuotone,\n\t\tthemeColors,\n\t\tdefaultColors,\n\t\tdefaultPalette,\n\t\tdefaultDuotone,\n\t\tuserDuotonePalette,\n\t\tthemeDuotonePalette,\n\t\tdefaultDuotonePalette,\n\t\tuserGradientPalette,\n\t\tthemeGradientPalette,\n\t\tdefaultGradientPalette,\n\t\tdefaultGradients,\n\t\tareCustomGradientsEnabled,\n\t\tisBackgroundEnabled,\n\t\tisLinkEnabled,\n\t\tisTextEnabled,\n\t\tisHeadingEnabled,\n\t\tisButtonEnabled,\n\t\tshadow,\n\t] );\n\n\treturn useSettingsForBlockElement( rawSettings, name );\n}\n\nexport function createBlockEditFilter( features ) {\n\t// We don't want block controls to re-render when typing inside a block.\n\t// `memo` will prevent re-renders unless props change, so only pass the\n\t// needed props and not the whole attributes object.\n\tfeatures = features.map( ( settings ) => {\n\t\treturn { ...settings, Edit: memo( settings.edit ) };\n\t} );\n\tconst withBlockEditHooks = createHigherOrderComponent(\n\t\t( OriginalBlockEdit ) => ( props ) => {\n\t\t\tconst context = useBlockEditContext();\n\t\t\t// CAUTION: code added before this line will be executed for all\n\t\t\t// blocks, not just those that support the feature! Code added\n\t\t\t// above this line should be carefully evaluated for its impact on\n\t\t\t// performance.\n\t\t\treturn [\n\t\t\t\t...features.map( ( feature, i ) => {\n\t\t\t\t\tconst {\n\t\t\t\t\t\tEdit,\n\t\t\t\t\t\thasSupport,\n\t\t\t\t\t\tattributeKeys = [],\n\t\t\t\t\t\tshareWithChildBlocks,\n\t\t\t\t\t} = feature;\n\t\t\t\t\tconst shouldDisplayControls =\n\t\t\t\t\t\tcontext[ mayDisplayControlsKey ] ||\n\t\t\t\t\t\t( context[ mayDisplayParentControlsKey ] &&\n\t\t\t\t\t\t\tshareWithChildBlocks );\n\n\t\t\t\t\tif (\n\t\t\t\t\t\t! shouldDisplayControls ||\n\t\t\t\t\t\t! hasSupport( props.name )\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst neededProps = {};\n\t\t\t\t\tfor ( const key of attributeKeys ) {\n\t\t\t\t\t\tif ( props.attributes[ key ] ) {\n\t\t\t\t\t\t\tneededProps[ key ] = props.attributes[ key ];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<Edit\n\t\t\t\t\t\t\t// We can use the index because the array length\n\t\t\t\t\t\t\t// is fixed per page load right now.\n\t\t\t\t\t\t\tkey={ i }\n\t\t\t\t\t\t\tname={ props.name }\n\t\t\t\t\t\t\tisSelected={ props.isSelected }\n\t\t\t\t\t\t\tclientId={ props.clientId }\n\t\t\t\t\t\t\tsetAttributes={ props.setAttributes }\n\t\t\t\t\t\t\t__unstableParentLayout={\n\t\t\t\t\t\t\t\tprops.__unstableParentLayout\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// This component is pure, so only pass needed\n\t\t\t\t\t\t\t// props!!!\n\t\t\t\t\t\t\t{ ...neededProps }\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t} ),\n\t\t\t\t<OriginalBlockEdit key=\"edit\" { ...props } />,\n\t\t\t];\n\t\t},\n\t\t'withBlockEditHooks'\n\t);\n\taddFilter( 'editor.BlockEdit', 'core/editor/hooks', withBlockEditHooks );\n}\n\nfunction BlockProps( {\n\tindex,\n\tuseBlockProps: hook,\n\tsetAllWrapperProps,\n\t...props\n} ) {\n\tconst wrapperProps = hook( props );\n\tconst setWrapperProps = ( next ) =>\n\t\tsetAllWrapperProps( ( prev ) => {\n\t\t\tconst nextAll = [ ...prev ];\n\t\t\tnextAll[ index ] = next;\n\t\t\treturn nextAll;\n\t\t} );\n\t// Setting state after every render is fine because this component is\n\t// pure and will only re-render when needed props change.\n\tuseEffect( () => {\n\t\t// We could shallow compare the props, but since this component only\n\t\t// changes when needed attributes change, the benefit is probably small.\n\t\tsetWrapperProps( wrapperProps );\n\t\treturn () => {\n\t\t\tsetWrapperProps( undefined );\n\t\t};\n\t} );\n\treturn null;\n}\n\nconst BlockPropsPure = memo( BlockProps );\n\nexport function createBlockListBlockFilter( features ) {\n\tconst withBlockListBlockHooks = createHigherOrderComponent(\n\t\t( BlockListBlock ) => ( props ) => {\n\t\t\tconst [ allWrapperProps, setAllWrapperProps ] = useState(\n\t\t\t\tArray( features.length ).fill( undefined )\n\t\t\t);\n\t\t\treturn [\n\t\t\t\t...features.map( ( feature, i ) => {\n\t\t\t\t\tconst {\n\t\t\t\t\t\thasSupport,\n\t\t\t\t\t\tattributeKeys = [],\n\t\t\t\t\t\tuseBlockProps,\n\t\t\t\t\t\tisMatch,\n\t\t\t\t\t} = feature;\n\n\t\t\t\t\tconst neededProps = {};\n\t\t\t\t\tfor ( const key of attributeKeys ) {\n\t\t\t\t\t\tif ( props.attributes[ key ] ) {\n\t\t\t\t\t\t\tneededProps[ key ] = props.attributes[ key ];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (\n\t\t\t\t\t\t// Skip rendering if none of the needed attributes are\n\t\t\t\t\t\t// set.\n\t\t\t\t\t\t! Object.keys( neededProps ).length ||\n\t\t\t\t\t\t! hasSupport( props.name ) ||\n\t\t\t\t\t\t( isMatch && ! isMatch( neededProps ) )\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<BlockPropsPure\n\t\t\t\t\t\t\t// We can use the index because the array length\n\t\t\t\t\t\t\t// is fixed per page load right now.\n\t\t\t\t\t\t\tkey={ i }\n\t\t\t\t\t\t\tindex={ i }\n\t\t\t\t\t\t\tuseBlockProps={ useBlockProps }\n\t\t\t\t\t\t\t// This component is pure, so we must pass a stable\n\t\t\t\t\t\t\t// function reference.\n\t\t\t\t\t\t\tsetAllWrapperProps={ setAllWrapperProps }\n\t\t\t\t\t\t\tname={ props.name }\n\t\t\t\t\t\t\tclientId={ props.clientId }\n\t\t\t\t\t\t\t// This component is pure, so only pass needed\n\t\t\t\t\t\t\t// props!!!\n\t\t\t\t\t\t\t{ ...neededProps }\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t} ),\n\t\t\t\t<BlockListBlock\n\t\t\t\t\tkey=\"edit\"\n\t\t\t\t\t{ ...props }\n\t\t\t\t\twrapperProps={ allWrapperProps\n\t\t\t\t\t\t.filter( Boolean )\n\t\t\t\t\t\t.reduce( ( acc, wrapperProps ) => {\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t...acc,\n\t\t\t\t\t\t\t\t...wrapperProps,\n\t\t\t\t\t\t\t\tclassName: clsx(\n\t\t\t\t\t\t\t\t\tacc.className,\n\t\t\t\t\t\t\t\t\twrapperProps.className\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\t\t\t...acc.style,\n\t\t\t\t\t\t\t\t\t...wrapperProps.style,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}, props.wrapperProps || {} ) }\n\t\t\t\t/>,\n\t\t\t];\n\t\t},\n\t\t'withBlockListBlockHooks'\n\t);\n\taddFilter(\n\t\t'editor.BlockListBlock',\n\t\t'core/editor/hooks',\n\t\twithBlockListBlockHooks\n\t);\n}\n\nexport function createBlockSaveFilter( features ) {\n\tfunction extraPropsFromHooks( props, name, attributes ) {\n\t\treturn features.reduce( ( accu, feature ) => {\n\t\t\tconst { hasSupport, attributeKeys = [], addSaveProps } = feature;\n\n\t\t\tconst neededAttributes = {};\n\t\t\tfor ( const key of attributeKeys ) {\n\t\t\t\tif ( attributes[ key ] ) {\n\t\t\t\t\tneededAttributes[ key ] = attributes[ key ];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\t// Skip rendering if none of the needed attributes are\n\t\t\t\t// set.\n\t\t\t\t! Object.keys( neededAttributes ).length ||\n\t\t\t\t! hasSupport( name )\n\t\t\t) {\n\t\t\t\treturn accu;\n\t\t\t}\n\n\t\t\treturn addSaveProps( accu, name, neededAttributes );\n\t\t}, props );\n\t}\n\taddFilter(\n\t\t'blocks.getSaveContent.extraProps',\n\t\t'core/editor/hooks',\n\t\textraPropsFromHooks,\n\t\t0\n\t);\n\taddFilter(\n\t\t'blocks.getSaveContent.extraProps',\n\t\t'core/editor/hooks',\n\t\t( props ) => {\n\t\t\t// Previously we had a filter deleting the className if it was an empty\n\t\t\t// string. That filter is no longer running, so now we need to delete it\n\t\t\t// here.\n\t\t\tif ( props.hasOwnProperty( 'className' ) && ! props.className ) {\n\t\t\t\tdelete props.className;\n\t\t\t}\n\n\t\t\treturn props;\n\t\t}\n\t);\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,oBAAgC;AAChC,qBAA0D;AAC1D,kBAAyC;AACzC,qBAA2C;AAC3C,mBAA0B;AAK1B,qBAIO;AACP,wBAA4B;AAC5B,IAAAA,gBAA2C;AAC3C,oBAAqD;AACrD,mBAA0C;AAC1C,yBAAuB;AAIvB,kBAAiB;AAsgBX;AA9fC,IAAM,mBAAmB,CAAE,WAAY;AAC7C,MACC,WAAW,QACX,OAAO,WAAW,YAClB,MAAM,QAAS,MAAO,GACrB;AACD,WAAO;AAAA,EACR;AAEA,QAAM,uBAAuB,OAAO,QAAS,MAAO,EAClD,IAAK,CAAE,CAAE,KAAK,KAAM,MAAO,CAAE,KAAK,iBAAkB,KAAM,CAAE,CAAE,EAC9D,OAAQ,CAAE,CAAE,EAAE,KAAM,MAAO,UAAU,MAAU;AACjD,SAAO,CAAE,qBAAqB,SAC3B,SACA,OAAO,YAAa,oBAAqB;AAC7C;AAEO,SAAS,gBACf,gBACA,gBACA,QACA,QACA,OACA,SACC;AAED,MACC,OAAO,OAAQ,kBAAkB,CAAC,CAAE,EAAE;AAAA,IACrC,CAAE,aAAc,CAAE;AAAA,EACnB,GACC;AACD,WAAO;AAAA,EACR;AAGA,MAAK,QAAQ,WAAW,KAAK,OAAO,YAAY,WAAW,OAAO,QAAS;AAC1E,WAAO;AAAA,EACR;AAIA,MAAI,2BAA2B,OAAQ,CAAE,GAAG;AAK5C,M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AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,QAAI;AAAA,IACH;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AAEA,QAAM,kBAAc,wBAAS,MAAM;AAClC,WAAO;AAAA,MACN,YAAY;AAAA,QACX;AAAA,QACA;AAAA,MACD;AAAA,MACA,OAAO;AAAA,QACN,SAAS;AAAA,UACR,QAAQ;AAAA,UACR,OAAO;AAAA,UACP,SAAS;AAAA,Q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IAAK;AAAA,QAClB;AACD,eAAO;AAAA,MACR;AAEA,aAAO,aAAc,MAAM,MAAM,gBAAiB;AAAA,IACnD,GAAG,KAAM;AAAA,EACV;AACA;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AACA;AAAA,IACC;AAAA,IACA;AAAA,IACA,CAAE,UAAW;AAIZ,UAAK,MAAM,eAAgB,WAAY,KAAK,CAAE,MAAM,WAAY;AAC/D,eAAO,MAAM;AAAA,MACd;AAEA,aAAO;AAAA,IACR;AAAA,EACD;AACD;",
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { getBlockSupport } from '@wordpress/blocks';\nimport { memo, useMemo, useEffect, useId, useState } from '@wordpress/element';\nimport { useDispatch, useRegistry } from '@wordpress/data';\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport { addFilter } from '@wordpress/hooks';\n\n/**\n * Internal dependencies\n */\nimport {\n\tuseBlockEditContext,\n\tmayDisplayControlsKey,\n\tmayDisplayParentControlsKey,\n} from '../components/block-edit/context';\nimport { useSettings } from '../components';\nimport { useSettingsForBlockElement } from '../components/global-styles/hooks';\nimport { getValueFromObjectPath, setImmutably } from '../utils/object';\nimport { store as blockEditorStore } from '../store';\nimport { unlock } from '../lock-unlock';\n/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * Removed falsy values from nested object.\n *\n * @param {*} object\n * @return {*} Object cleaned from falsy values\n */\nexport const cleanEmptyObject = ( object ) => {\n\tif (\n\t\tobject === null ||\n\t\ttypeof object !== 'object' ||\n\t\tArray.isArray( object )\n\t) {\n\t\treturn object;\n\t}\n\n\tconst cleanedNestedObjects = Object.entries( object )\n\t\t.map( ( [ key, value ] ) => [ key, cleanEmptyObject( value ) ] )\n\t\t.filter( ( [ , value ] ) => value !== undefined );\n\treturn ! cleanedNestedObjects.length\n\t\t? undefined\n\t\t: Object.fromEntries( cleanedNestedObjects );\n};\n\nexport function transformStyles(\n\tactiveSupports,\n\tmigrationPaths,\n\tresult,\n\tsource,\n\tindex,\n\tresults\n) {\n\t// If there are no active supports return early.\n\tif (\n\t\tObject.values( activeSupports ?? {} ).every(\n\t\t\t( isActive ) => ! isActive\n\t\t)\n\t) {\n\t\treturn result;\n\t}\n\t// If the condition verifies we are probably in the presence of a wrapping transform\n\t// e.g: nesting paragraphs in a group or columns and in that case the styles should not be transformed.\n\tif ( results.length === 1 && result.innerBlocks.length === source.length ) {\n\t\treturn result;\n\t}\n\t// For cases where we have a transform from one block to multiple blocks\n\t// or multiple blocks to one block we apply the styles of the first source block\n\t// to the result(s).\n\tlet referenceBlockAttributes = source[ 0 ]?.attributes;\n\t// If we are in presence of transform between more than one block in the source\n\t// that has more than one block in the result\n\t// we apply the styles on source N to the result N,\n\t// if source N does not exists we do nothing.\n\tif ( results.length > 1 && source.length > 1 ) {\n\t\tif ( source[ index ] ) {\n\t\t\treferenceBlockAttributes = source[ index ]?.attributes;\n\t\t} else {\n\t\t\treturn result;\n\t\t}\n\t}\n\tlet returnBlock = result;\n\tObject.entries( activeSupports ).forEach( ( [ support, isActive ] ) => {\n\t\tif ( isActive ) {\n\t\t\tmigrationPaths[ support ].forEach( ( path ) => {\n\t\t\t\tconst styleValue = getValueFromObjectPath(\n\t\t\t\t\treferenceBlockAttributes,\n\t\t\t\t\tpath\n\t\t\t\t);\n\t\t\t\tif ( styleValue ) {\n\t\t\t\t\treturnBlock = {\n\t\t\t\t\t\t...returnBlock,\n\t\t\t\t\t\tattributes: setImmutably(\n\t\t\t\t\t\t\treturnBlock.attributes,\n\t\t\t\t\t\t\tpath,\n\t\t\t\t\t\t\tstyleValue\n\t\t\t\t\t\t),\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t} );\n\treturn returnBlock;\n}\n\n/**\n * Check whether serialization of specific block support feature or set should\n * be skipped.\n *\n * @param {string|Object} blockNameOrType Block name or block type object.\n * @param {string} featureSet Name of block support feature set.\n * @param {string} feature Name of the individual feature to check.\n *\n * @return {boolean} Whether serialization should occur.\n */\nexport function shouldSkipSerialization(\n\tblockNameOrType,\n\tfeatureSet,\n\tfeature\n) {\n\tconst support = getBlockSupport( blockNameOrType, featureSet );\n\tconst skipSerialization = support?.__experimentalSkipSerialization;\n\n\tif ( Array.isArray( skipSerialization ) ) {\n\t\treturn skipSerialization.includes( feature );\n\t}\n\n\treturn skipSerialization;\n}\n\nconst pendingStyleOverrides = new WeakMap();\n\n/**\n * Override a block editor settings style. Leave the ID blank to create a new\n * style.\n *\n * @param {Object} override Override object.\n * @param {?string} override.id Id of the style override, leave blank to create\n * a new style.\n * @param {string} override.css CSS to apply.\n */\nexport function useStyleOverride( { id, css } ) {\n\treturn usePrivateStyleOverride( { id, css } );\n}\n\nexport function usePrivateStyleOverride( {\n\tid,\n\tcss,\n\tassets,\n\t__unstableType,\n\tvariation,\n\tclientId,\n} = {} ) {\n\tconst { setStyleOverride, deleteStyleOverride } = unlock(\n\t\tuseDispatch( blockEditorStore )\n\t);\n\tconst registry = useRegistry();\n\tconst fallbackId = useId();\n\tuseEffect( () => {\n\t\t// Unmount if there is CSS and assets are empty.\n\t\tif ( ! css && ! assets ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst _id = id || fallbackId;\n\t\tconst override = {\n\t\t\tid,\n\t\t\tcss,\n\t\t\tassets,\n\t\t\t__unstableType,\n\t\t\tvariation,\n\t\t\tclientId,\n\t\t};\n\t\t// Batch updates to style overrides to avoid triggering cascading renders\n\t\t// for each style override block included in a tree and optimize initial render.\n\t\tif ( ! pendingStyleOverrides.get( registry ) ) {\n\t\t\tpendingStyleOverrides.set( registry, [] );\n\t\t}\n\t\tpendingStyleOverrides.get( registry ).push( [ _id, override ] );\n\t\twindow.queueMicrotask( () => {\n\t\t\tif ( pendingStyleOverrides.get( registry )?.length ) {\n\t\t\t\tregistry.batch( () => {\n\t\t\t\t\tpendingStyleOverrides.get( registry ).forEach( ( args ) => {\n\t\t\t\t\t\tsetStyleOverride( ...args );\n\t\t\t\t\t} );\n\t\t\t\t\tpendingStyleOverrides.set( registry, [] );\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\n\t\treturn () => {\n\t\t\tconst isPending = pendingStyleOverrides\n\t\t\t\t.get( registry )\n\t\t\t\t?.find( ( [ currentId ] ) => currentId === _id );\n\t\t\tif ( isPending ) {\n\t\t\t\tpendingStyleOverrides.set(\n\t\t\t\t\tregistry,\n\t\t\t\t\tpendingStyleOverrides\n\t\t\t\t\t\t.get( registry )\n\t\t\t\t\t\t.filter( ( [ currentId ] ) => currentId !== _id )\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tdeleteStyleOverride( _id );\n\t\t\t}\n\t\t};\n\t}, [\n\t\tid,\n\t\tcss,\n\t\tclientId,\n\t\tassets,\n\t\t__unstableType,\n\t\tfallbackId,\n\t\tsetStyleOverride,\n\t\tdeleteStyleOverride,\n\t\tregistry,\n\t] );\n}\n\n/**\n * Based on the block and its context, returns an object of all the block settings.\n * This object can be passed as a prop to all the Styles UI components\n * (TypographyPanel, DimensionsPanel...).\n *\n * @param {string} name Block name.\n * @param {*} parentLayout Parent layout.\n *\n * @return {Object} Settings object.\n */\nexport function useBlockSettings( name, parentLayout ) {\n\tconst [\n\t\tbackgroundImage,\n\t\tbackgroundSize,\n\t\tcustomFontFamilies,\n\t\tdefaultFontFamilies,\n\t\tthemeFontFamilies,\n\t\tdefaultFontSizesEnabled,\n\t\tcustomFontSizes,\n\t\tdefaultFontSizes,\n\t\tthemeFontSizes,\n\t\tcustomFontSize,\n\t\tfontStyle,\n\t\tfontWeight,\n\t\tlineHeight,\n\t\ttextAlign,\n\t\ttextColumns,\n\t\ttextDecoration,\n\t\twritingMode,\n\t\ttextTransform,\n\t\tletterSpacing,\n\t\tpadding,\n\t\tmargin,\n\t\tblockGap,\n\t\tdefaultSpacingSizesEnabled,\n\t\tcustomSpacingSize,\n\t\tuserSpacingSizes,\n\t\tdefaultSpacingSizes,\n\t\tthemeSpacingSizes,\n\t\tunits,\n\t\taspectRatio,\n\t\tminHeight,\n\t\twidth,\n\t\tlayout,\n\t\tborderColor,\n\t\tborderRadius,\n\t\tborderStyle,\n\t\tborderWidth,\n\t\tborderRadiusSizes,\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'dimensions.width',\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'border.radiusSizes',\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\tradiusSizes: borderRadiusSizes,\n\t\t\t},\n\t\t\tdimensions: {\n\t\t\t\taspectRatio,\n\t\t\t\tminHeight,\n\t\t\t\twidth,\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\twidth,\n\t\tlayout,\n\t\tparentLayout,\n\t\tborderColor,\n\t\tborderRadius,\n\t\tborderStyle,\n\t\tborderWidth,\n\t\tborderRadiusSizes,\n\t\tcustomColorsEnabled,\n\t\tcustomColors,\n\t\tcustomDuotone,\n\t\tthemeColors,\n\t\tdefaultColors,\n\t\tdefaultPalette,\n\t\tdefaultDuotone,\n\t\tuserDuotonePalette,\n\t\tthemeDuotonePalette,\n\t\tdefaultDuotonePalette,\n\t\tuserGradientPalette,\n\t\tthemeGradientPalette,\n\t\tdefaultGradientPalette,\n\t\tdefaultGradients,\n\t\tareCustomGradientsEnabled,\n\t\tisBackgroundEnabled,\n\t\tisLinkEnabled,\n\t\tisTextEnabled,\n\t\tisHeadingEnabled,\n\t\tisButtonEnabled,\n\t\tshadow,\n\t] );\n\n\treturn useSettingsForBlockElement( rawSettings, name );\n}\n\nexport function createBlockEditFilter( features ) {\n\t// We don't want block controls to re-render when typing inside a block.\n\t// `memo` will prevent re-renders unless props change, so only pass the\n\t// needed props and not the whole attributes object.\n\tfeatures = features.map( ( settings ) => {\n\t\treturn { ...settings, Edit: memo( settings.edit ) };\n\t} );\n\tconst withBlockEditHooks = createHigherOrderComponent(\n\t\t( OriginalBlockEdit ) => ( props ) => {\n\t\t\tconst context = useBlockEditContext();\n\t\t\t// CAUTION: code added before this line will be executed for all\n\t\t\t// blocks, not just those that support the feature! Code added\n\t\t\t// above this line should be carefully evaluated for its impact on\n\t\t\t// performance.\n\t\t\treturn [\n\t\t\t\t...features.map( ( feature, i ) => {\n\t\t\t\t\tconst {\n\t\t\t\t\t\tEdit,\n\t\t\t\t\t\thasSupport,\n\t\t\t\t\t\tattributeKeys = [],\n\t\t\t\t\t\tshareWithChildBlocks,\n\t\t\t\t\t} = feature;\n\t\t\t\t\tconst shouldDisplayControls =\n\t\t\t\t\t\tcontext[ mayDisplayControlsKey ] ||\n\t\t\t\t\t\t( context[ mayDisplayParentControlsKey ] &&\n\t\t\t\t\t\t\tshareWithChildBlocks );\n\n\t\t\t\t\tif (\n\t\t\t\t\t\t! shouldDisplayControls ||\n\t\t\t\t\t\t! hasSupport( props.name )\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst neededProps = {};\n\t\t\t\t\tfor ( const key of attributeKeys ) {\n\t\t\t\t\t\tif ( props.attributes[ key ] ) {\n\t\t\t\t\t\t\tneededProps[ key ] = props.attributes[ key ];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<Edit\n\t\t\t\t\t\t\t// We can use the index because the array length\n\t\t\t\t\t\t\t// is fixed per page load right now.\n\t\t\t\t\t\t\tkey={ i }\n\t\t\t\t\t\t\tname={ props.name }\n\t\t\t\t\t\t\tisSelected={ props.isSelected }\n\t\t\t\t\t\t\tclientId={ props.clientId }\n\t\t\t\t\t\t\tsetAttributes={ props.setAttributes }\n\t\t\t\t\t\t\t__unstableParentLayout={\n\t\t\t\t\t\t\t\tprops.__unstableParentLayout\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// This component is pure, so only pass needed\n\t\t\t\t\t\t\t// props!!!\n\t\t\t\t\t\t\t{ ...neededProps }\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t} ),\n\t\t\t\t<OriginalBlockEdit key=\"edit\" { ...props } />,\n\t\t\t];\n\t\t},\n\t\t'withBlockEditHooks'\n\t);\n\taddFilter( 'editor.BlockEdit', 'core/editor/hooks', withBlockEditHooks );\n}\n\nfunction BlockProps( {\n\tindex,\n\tuseBlockProps: hook,\n\tsetAllWrapperProps,\n\t...props\n} ) {\n\tconst wrapperProps = hook( props );\n\tconst setWrapperProps = ( next ) =>\n\t\tsetAllWrapperProps( ( prev ) => {\n\t\t\tconst nextAll = [ ...prev ];\n\t\t\tnextAll[ index ] = next;\n\t\t\treturn nextAll;\n\t\t} );\n\t// Setting state after every render is fine because this component is\n\t// pure and will only re-render when needed props change.\n\tuseEffect( () => {\n\t\t// We could shallow compare the props, but since this component only\n\t\t// changes when needed attributes change, the benefit is probably small.\n\t\tsetWrapperProps( wrapperProps );\n\t\treturn () => {\n\t\t\tsetWrapperProps( undefined );\n\t\t};\n\t} );\n\treturn null;\n}\n\nconst BlockPropsPure = memo( BlockProps );\n\nexport function createBlockListBlockFilter( features ) {\n\tconst withBlockListBlockHooks = createHigherOrderComponent(\n\t\t( BlockListBlock ) => ( props ) => {\n\t\t\tconst [ allWrapperProps, setAllWrapperProps ] = useState(\n\t\t\t\tArray( features.length ).fill( undefined )\n\t\t\t);\n\t\t\treturn [\n\t\t\t\t...features.map( ( feature, i ) => {\n\t\t\t\t\tconst {\n\t\t\t\t\t\thasSupport,\n\t\t\t\t\t\tattributeKeys = [],\n\t\t\t\t\t\tuseBlockProps,\n\t\t\t\t\t\tisMatch,\n\t\t\t\t\t} = feature;\n\n\t\t\t\t\tconst neededProps = {};\n\t\t\t\t\tfor ( const key of attributeKeys ) {\n\t\t\t\t\t\tif ( props.attributes[ key ] ) {\n\t\t\t\t\t\t\tneededProps[ key ] = props.attributes[ key ];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (\n\t\t\t\t\t\t// Skip rendering if none of the needed attributes are\n\t\t\t\t\t\t// set.\n\t\t\t\t\t\t! Object.keys( neededProps ).length ||\n\t\t\t\t\t\t! hasSupport( props.name ) ||\n\t\t\t\t\t\t( isMatch && ! isMatch( neededProps ) )\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<BlockPropsPure\n\t\t\t\t\t\t\t// We can use the index because the array length\n\t\t\t\t\t\t\t// is fixed per page load right now.\n\t\t\t\t\t\t\tkey={ i }\n\t\t\t\t\t\t\tindex={ i }\n\t\t\t\t\t\t\tuseBlockProps={ useBlockProps }\n\t\t\t\t\t\t\t// This component is pure, so we must pass a stable\n\t\t\t\t\t\t\t// function reference.\n\t\t\t\t\t\t\tsetAllWrapperProps={ setAllWrapperProps }\n\t\t\t\t\t\t\tname={ props.name }\n\t\t\t\t\t\t\tclientId={ props.clientId }\n\t\t\t\t\t\t\t// This component is pure, so only pass needed\n\t\t\t\t\t\t\t// props!!!\n\t\t\t\t\t\t\t{ ...neededProps }\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t} ),\n\t\t\t\t<BlockListBlock\n\t\t\t\t\tkey=\"edit\"\n\t\t\t\t\t{ ...props }\n\t\t\t\t\twrapperProps={ allWrapperProps\n\t\t\t\t\t\t.filter( Boolean )\n\t\t\t\t\t\t.reduce( ( acc, wrapperProps ) => {\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t...acc,\n\t\t\t\t\t\t\t\t...wrapperProps,\n\t\t\t\t\t\t\t\tclassName: clsx(\n\t\t\t\t\t\t\t\t\tacc.className,\n\t\t\t\t\t\t\t\t\twrapperProps.className\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\t\t\t...acc.style,\n\t\t\t\t\t\t\t\t\t...wrapperProps.style,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}, props.wrapperProps || {} ) }\n\t\t\t\t/>,\n\t\t\t];\n\t\t},\n\t\t'withBlockListBlockHooks'\n\t);\n\taddFilter(\n\t\t'editor.BlockListBlock',\n\t\t'core/editor/hooks',\n\t\twithBlockListBlockHooks\n\t);\n}\n\nexport function createBlockSaveFilter( features ) {\n\tfunction extraPropsFromHooks( props, name, attributes ) {\n\t\treturn features.reduce( ( accu, feature ) => {\n\t\t\tconst { hasSupport, attributeKeys = [], addSaveProps } = feature;\n\n\t\t\tconst neededAttributes = {};\n\t\t\tfor ( const key of attributeKeys ) {\n\t\t\t\tif ( attributes[ key ] ) {\n\t\t\t\t\tneededAttributes[ key ] = attributes[ key ];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\t// Skip rendering if none of the needed attributes are\n\t\t\t\t// set.\n\t\t\t\t! Object.keys( neededAttributes ).length ||\n\t\t\t\t! hasSupport( name )\n\t\t\t) {\n\t\t\t\treturn accu;\n\t\t\t}\n\n\t\t\treturn addSaveProps( accu, name, neededAttributes );\n\t\t}, props );\n\t}\n\taddFilter(\n\t\t'blocks.getSaveContent.extraProps',\n\t\t'core/editor/hooks',\n\t\textraPropsFromHooks,\n\t\t0\n\t);\n\taddFilter(\n\t\t'blocks.getSaveContent.extraProps',\n\t\t'core/editor/hooks',\n\t\t( props ) => {\n\t\t\t// Previously we had a filter deleting the className if it was an empty\n\t\t\t// string. That filter is no longer running, so now we need to delete it\n\t\t\t// here.\n\t\t\tif ( props.hasOwnProperty( 'className' ) && ! props.className ) {\n\t\t\t\tdelete props.className;\n\t\t\t}\n\n\t\t\treturn props;\n\t\t}\n\t);\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,oBAAgC;AAChC,qBAA0D;AAC1D,kBAAyC;AACzC,qBAA2C;AAC3C,mBAA0B;AAK1B,qBAIO;AACP,wBAA4B;AAC5B,IAAAA,gBAA2C;AAC3C,oBAAqD;AACrD,mBAA0C;AAC1C,yBAAuB;AAIvB,kBAAiB;AA0gBX;AAlgBC,IAAM,mBAAmB,CAAE,WAAY;AAC7C,MACC,WAAW,QACX,OAAO,WAAW,YAClB,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ACN,GAAG,IAAI;AAAA,kBACP,GAAG,aAAa;AAAA,gBACjB;AAAA,cACD;AAAA,YACD,GAAG,MAAM,gBAAgB,CAAC,CAAE;AAAA;AAAA,UAjBzB;AAAA,QAkBL;AAAA,MACD;AAAA,IACD;AAAA,IACA;AAAA,EACD;AACA;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,EACD;AACD;AAEO,SAAS,sBAAuB,UAAW;AACjD,WAAS,oBAAqB,OAAO,MAAM,YAAa;AACvD,WAAO,SAAS,OAAQ,CAAE,MAAM,YAAa;AAC5C,YAAM,EAAE,YAAY,gBAAgB,CAAC,GAAG,aAAa,IAAI;AAEzD,YAAM,mBAAmB,CAAC;AAC1B,iBAAY,OAAO,eAAgB;AAClC,YAAK,WAAY,GAAI,GAAI;AACxB,2BAAkB,GAAI,IAAI,WAAY,GAAI;AAAA,QAC3C;AAAA,MACD;AAEA;AAAA;AAAA;AAAA,QAGC,CAAE,OAAO,KAAM,gBAAiB,EAAE,UAClC,CAAE,WAAY,IAAK;AAAA,QAClB;AACD,eAAO;AAAA,MACR;AAEA,aAAO,aAAc,MAAM,MAAM,gBAAiB;AAAA,IACnD,GAAG,KAAM;AAAA,EACV;AACA;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AACA;AAAA,IACC;AAAA,IACA;AAAA,IACA,CAAE,UAAW;AAIZ,UAAK,MAAM,eAAgB,WAAY,KAAK,CAAE,MAAM,WAAY;AAC/D,eAAO,MAAM;AAAA,MACd;AAEA,aAAO;AAAA,IACR;AAAA,EACD;AACD;",
6
6
  "names": ["import_hooks", "blockEditorStore", "clsx"]
7
7
  }
@@ -52,6 +52,10 @@ __export(private_selectors_exports, {
52
52
  isBlockSubtreeDisabled: () => isBlockSubtreeDisabled,
53
53
  isContainerInsertableToInContentOnlyMode: () => isContainerInsertableToInContentOnlyMode,
54
54
  isDragging: () => isDragging,
55
+ isEditLockedBlock: () => isEditLockedBlock,
56
+ isLockedBlock: () => isLockedBlock,
57
+ isMoveLockedBlock: () => isMoveLockedBlock,
58
+ isRemoveLockedBlock: () => isRemoveLockedBlock,
55
59
  isSectionBlock: () => isSectionBlock,
56
60
  isWithinEditedContentOnlySection: () => isWithinEditedContentOnlySection,
57
61
  isZoomOut: () => isZoomOut
@@ -304,11 +308,18 @@ function isSectionBlock(state, clientId) {
304
308
  return false;
305
309
  }
306
310
  const blockName = (0, import_selectors.getBlockName)(state, clientId);
307
- if (blockName === "core/block" || (0, import_selectors.getTemplateLock)(state, clientId) === "contentOnly") {
311
+ if (blockName === "core/block") {
308
312
  return true;
309
313
  }
310
314
  const attributes = (0, import_selectors.getBlockAttributes)(state, clientId);
311
- if (attributes?.metadata?.patternName && !!window?.__experimentalContentOnlyPatternInsertion) {
315
+ const isTemplatePart = blockName === "core/template-part";
316
+ if ((attributes?.metadata?.patternName || isTemplatePart) && !!window?.__experimentalContentOnlyPatternInsertion) {
317
+ return true;
318
+ }
319
+ const hasContentOnlyTempateLock = (0, import_selectors.getTemplateLock)(state, clientId) === "contentOnly";
320
+ const rootClientId = (0, import_selectors.getBlockRootClientId)(state, clientId);
321
+ const hasRootContentOnlyTemplateLock = (0, import_selectors.getTemplateLock)(state, rootClientId) === "contentOnly";
322
+ if (hasContentOnlyTempateLock && !hasRootContentOnlyTemplateLock) {
312
323
  return true;
313
324
  }
314
325
  return false;
@@ -390,7 +401,7 @@ function getInsertionPoint(state) {
390
401
  }
391
402
  var isBlockHidden = (state, clientId) => {
392
403
  const blockName = (0, import_selectors.getBlockName)(state, clientId);
393
- if (!(0, import_blocks.hasBlockSupport)(state, blockName, "blockVisibility", true)) {
404
+ if (!(0, import_blocks.hasBlockSupport)(state, blockName, "visibility", true)) {
394
405
  return false;
395
406
  }
396
407
  const attributes = state.blocks.attributes.get(clientId);
@@ -399,6 +410,31 @@ var isBlockHidden = (state, clientId) => {
399
410
  function hasBlockSpotlight(state) {
400
411
  return !!state.hasBlockSpotlight || !!state.editedContentOnlySection;
401
412
  }
413
+ function isEditLockedBlock(state, clientId) {
414
+ const attributes = (0, import_selectors.getBlockAttributes)(state, clientId);
415
+ return !!attributes?.lock?.edit;
416
+ }
417
+ function isMoveLockedBlock(state, clientId) {
418
+ const attributes = (0, import_selectors.getBlockAttributes)(state, clientId);
419
+ if (attributes?.lock?.move !== void 0) {
420
+ return !!attributes?.lock?.move;
421
+ }
422
+ const rootClientId = (0, import_selectors.getBlockRootClientId)(state, clientId);
423
+ const templateLock = (0, import_selectors.getTemplateLock)(state, rootClientId);
424
+ return templateLock === "all";
425
+ }
426
+ function isRemoveLockedBlock(state, clientId) {
427
+ const attributes = (0, import_selectors.getBlockAttributes)(state, clientId);
428
+ if (attributes?.lock?.remove !== void 0) {
429
+ return !!attributes?.lock?.remove;
430
+ }
431
+ const rootClientId = (0, import_selectors.getBlockRootClientId)(state, clientId);
432
+ const templateLock = (0, import_selectors.getTemplateLock)(state, rootClientId);
433
+ return templateLock === "all" || templateLock === "insert";
434
+ }
435
+ function isLockedBlock(state, clientId) {
436
+ return isEditLockedBlock(state, clientId) || isMoveLockedBlock(state, clientId) || isRemoveLockedBlock(state, clientId);
437
+ }
402
438
  // Annotate the CommonJS export names for ESM import in node:
403
439
  0 && (module.exports = {
404
440
  getAllPatterns,
@@ -433,6 +469,10 @@ function hasBlockSpotlight(state) {
433
469
  isBlockSubtreeDisabled,
434
470
  isContainerInsertableToInContentOnlyMode,
435
471
  isDragging,
472
+ isEditLockedBlock,
473
+ isLockedBlock,
474
+ isMoveLockedBlock,
475
+ isRemoveLockedBlock,
436
476
  isSectionBlock,
437
477
  isWithinEditedContentOnlySection,
438
478
  isZoomOut
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/store/private-selectors.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { createSelector, createRegistrySelector } from '@wordpress/data';\nimport {\n\thasBlockSupport,\n\tprivateApis as blocksPrivateApis,\n} from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport {\n\tgetBlockOrder,\n\tgetBlockParents,\n\tgetBlockEditingMode,\n\tgetSettings,\n\tcanInsertBlockType,\n\tgetBlockName,\n\tgetTemplateLock,\n\tgetClientIdsWithDescendants,\n\tgetBlockRootClientId,\n\tgetBlockAttributes,\n} from './selectors';\nimport {\n\tcheckAllowListRecursive,\n\tgetAllPatternsDependants,\n\tgetInsertBlockTypeDependants,\n\tgetGrammar,\n\tmapUserPattern,\n} from './utils';\nimport { STORE_NAME } from './constants';\nimport { unlock } from '../lock-unlock';\nimport {\n\tselectBlockPatternsKey,\n\treusableBlocksSelectKey,\n\tsectionRootClientIdKey,\n} from './private-keys';\n\nconst { isContentBlock } = unlock( blocksPrivateApis );\n\nexport { getBlockSettings } from './get-block-settings';\n\n/**\n * Returns true if the block interface is hidden, or false otherwise.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the block toolbar is hidden.\n */\nexport function isBlockInterfaceHidden( state ) {\n\treturn state.isBlockInterfaceHidden;\n}\n\n/**\n * Gets the client ids of the last inserted blocks.\n *\n * @param {Object} state Global application state.\n * @return {Array|undefined} Client Ids of the last inserted block(s).\n */\nexport function getLastInsertedBlocksClientIds( state ) {\n\treturn state?.lastBlockInserted?.clientIds;\n}\n\nexport function getBlockWithoutAttributes( state, clientId ) {\n\treturn state.blocks.byClientId.get( clientId );\n}\n\n/**\n * Returns true if all of the descendants of a block with the given client ID\n * have an editing mode of 'disabled', or false otherwise.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId The block client ID.\n *\n * @return {boolean} Whether the block descendants are disabled.\n */\nexport const isBlockSubtreeDisabled = ( state, clientId ) => {\n\tconst isChildSubtreeDisabled = ( childClientId ) => {\n\t\treturn (\n\t\t\tgetBlockEditingMode( state, childClientId ) === 'disabled' &&\n\t\t\tgetBlockOrder( state, childClientId ).every(\n\t\t\t\tisChildSubtreeDisabled\n\t\t\t)\n\t\t);\n\t};\n\treturn getBlockOrder( state, clientId ).every( isChildSubtreeDisabled );\n};\n\n/**\n * Determines if a container (clientId) allows insertion of blocks, considering contentOnly mode restrictions.\n *\n * @param {Object} state Editor state.\n * @param {string} blockName The block name to insert.\n * @param {string} rootClientId The client ID of the root container block.\n * @return {boolean} Whether the container allows insertion.\n */\nexport function isContainerInsertableToInContentOnlyMode(\n\tstate,\n\tblockName,\n\trootClientId\n) {\n\tconst isBlockContentBlock = isContentBlock( blockName );\n\tconst rootBlockName = getBlockName( state, rootClientId );\n\tconst isContainerContentBlock = isContentBlock( rootBlockName );\n\tconst isRootBlockMain = getSectionRootClientId( state ) === rootClientId;\n\n\t// In contentOnly mode, containers shouldn't be inserted into unless:\n\t// 1. they are a section root;\n\t// 2. they are a content block and the block to be inserted is also content.\n\treturn (\n\t\tisRootBlockMain || ( isContainerContentBlock && isBlockContentBlock )\n\t);\n}\n\nfunction getEnabledClientIdsTreeUnmemoized( state, rootClientId ) {\n\tconst blockOrder = getBlockOrder( state, rootClientId );\n\tconst result = [];\n\n\tfor ( const clientId of blockOrder ) {\n\t\tconst innerBlocks = getEnabledClientIdsTreeUnmemoized(\n\t\t\tstate,\n\t\t\tclientId\n\t\t);\n\t\tif ( getBlockEditingMode( state, clientId ) !== 'disabled' ) {\n\t\t\tresult.push( { clientId, innerBlocks } );\n\t\t} else {\n\t\t\tresult.push( ...innerBlocks );\n\t\t}\n\t}\n\n\treturn result;\n}\n\n/**\n * Returns a tree of block objects with only clientID and innerBlocks set.\n * Blocks with a 'disabled' editing mode are not included.\n *\n * @param {Object} state Global application state.\n * @param {?string} rootClientId Optional root client ID of block list.\n *\n * @return {Object[]} Tree of block objects with only clientID and innerBlocks set.\n */\nexport const getEnabledClientIdsTree = createRegistrySelector( () =>\n\tcreateSelector( getEnabledClientIdsTreeUnmemoized, ( state ) => [\n\t\tstate.blocks.order,\n\t\tstate.derivedBlockEditingModes,\n\t\tstate.blockEditingModes,\n\t] )\n);\n\n/**\n * Returns a list of a given block's ancestors, from top to bottom. Blocks with\n * a 'disabled' editing mode are excluded.\n *\n * @see getBlockParents\n *\n * @param {Object} state Global application state.\n * @param {string} clientId The block client ID.\n * @param {boolean} ascending Order results from bottom to top (true) or top\n * to bottom (false).\n */\nexport const getEnabledBlockParents = createSelector(\n\t( state, clientId, ascending = false ) => {\n\t\treturn getBlockParents( state, clientId, ascending ).filter(\n\t\t\t( parent ) => getBlockEditingMode( state, parent ) !== 'disabled'\n\t\t);\n\t},\n\t( state ) => [\n\t\tstate.blocks.parents,\n\t\tstate.blockEditingModes,\n\t\tstate.settings.templateLock,\n\t\tstate.blockListSettings,\n\t]\n);\n\n/**\n * Selector that returns the data needed to display a prompt when certain\n * blocks are removed, or `false` if no such prompt is requested.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object|false} Data for removal prompt display, if any.\n */\nexport function getRemovalPromptData( state ) {\n\treturn state.removalPromptData;\n}\n\n/**\n * Returns true if removal prompt exists, or false otherwise.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether removal prompt exists.\n */\nexport function getBlockRemovalRules( state ) {\n\treturn state.blockRemovalRules;\n}\n\n/**\n * Returns the client ID of the block settings menu that is currently open.\n *\n * @param {Object} state Global application state.\n * @return {string|null} The client ID of the block menu that is currently open.\n */\nexport function getOpenedBlockSettingsMenu( state ) {\n\treturn state.openedBlockSettingsMenu;\n}\n\n/**\n * Returns all style overrides, intended to be merged with global editor styles.\n *\n * Overrides are sorted to match the order of the blocks they relate to. This\n * is useful to maintain correct CSS cascade order.\n *\n * @param {Object} state Global application state.\n *\n * @return {Array} An array of style ID to style override pairs.\n */\nexport const getStyleOverrides = createSelector(\n\t( state ) => {\n\t\tconst clientIds = getClientIdsWithDescendants( state );\n\t\tconst clientIdMap = clientIds.reduce( ( acc, clientId, index ) => {\n\t\t\tacc[ clientId ] = index;\n\t\t\treturn acc;\n\t\t}, {} );\n\n\t\treturn [ ...state.styleOverrides ].sort( ( overrideA, overrideB ) => {\n\t\t\t// Once the overrides Map is spread to an array, the first element\n\t\t\t// is the key, while the second is the override itself including\n\t\t\t// the clientId to sort by.\n\t\t\tconst [ , { clientId: clientIdA } ] = overrideA;\n\t\t\tconst [ , { clientId: clientIdB } ] = overrideB;\n\n\t\t\tconst aIndex = clientIdMap[ clientIdA ] ?? -1;\n\t\t\tconst bIndex = clientIdMap[ clientIdB ] ?? -1;\n\n\t\t\treturn aIndex - bIndex;\n\t\t} );\n\t},\n\t( state ) => [ state.blocks.order, state.styleOverrides ]\n);\n\n/** @typedef {import('./actions').InserterMediaCategory} InserterMediaCategory */\n/**\n * Returns the registered inserter media categories through the public API.\n *\n * @param {Object} state Editor state.\n *\n * @return {InserterMediaCategory[]} Inserter media categories.\n */\nexport function getRegisteredInserterMediaCategories( state ) {\n\treturn state.registeredInserterMediaCategories;\n}\n\n/**\n * Returns an array containing the allowed inserter media categories.\n * It merges the registered media categories from extenders with the\n * core ones. It also takes into account the allowed `mime_types`, which\n * can be altered by `upload_mimes` filter and restrict some of them.\n *\n * @param {Object} state Global application state.\n *\n * @return {InserterMediaCategory[]} Client IDs of descendants.\n */\nexport const getInserterMediaCategories = createSelector(\n\t( state ) => {\n\t\tconst {\n\t\t\tsettings: {\n\t\t\t\tinserterMediaCategories,\n\t\t\t\tallowedMimeTypes,\n\t\t\t\tenableOpenverseMediaCategory,\n\t\t\t},\n\t\t\tregisteredInserterMediaCategories,\n\t\t} = state;\n\t\t// The allowed `mime_types` can be altered by `upload_mimes` filter and restrict\n\t\t// some of them. In this case we shouldn't add the category to the available media\n\t\t// categories list in the inserter.\n\t\tif (\n\t\t\t( ! inserterMediaCategories &&\n\t\t\t\t! registeredInserterMediaCategories.length ) ||\n\t\t\t! allowedMimeTypes\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t\tconst coreInserterMediaCategoriesNames =\n\t\t\tinserterMediaCategories?.map( ( { name } ) => name ) || [];\n\t\tconst mergedCategories = [\n\t\t\t...( inserterMediaCategories || [] ),\n\t\t\t...( registeredInserterMediaCategories || [] ).filter(\n\t\t\t\t( { name } ) =>\n\t\t\t\t\t! coreInserterMediaCategoriesNames.includes( name )\n\t\t\t),\n\t\t];\n\t\treturn mergedCategories.filter( ( category ) => {\n\t\t\t// Check if Openverse category is enabled.\n\t\t\tif (\n\t\t\t\t! enableOpenverseMediaCategory &&\n\t\t\t\tcategory.name === 'openverse'\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn Object.values( allowedMimeTypes ).some( ( mimeType ) =>\n\t\t\t\tmimeType.startsWith( `${ category.mediaType }/` )\n\t\t\t);\n\t\t} );\n\t},\n\t( state ) => [\n\t\tstate.settings.inserterMediaCategories,\n\t\tstate.settings.allowedMimeTypes,\n\t\tstate.settings.enableOpenverseMediaCategory,\n\t\tstate.registeredInserterMediaCategories,\n\t]\n);\n\n/**\n * Returns whether there is at least one allowed pattern for inner blocks children.\n * This is useful for deferring the parsing of all patterns until needed.\n *\n * @param {Object} state Editor state.\n * @param {string} [rootClientId=null] Target root client ID.\n *\n * @return {boolean} If there is at least one allowed pattern.\n */\nexport const hasAllowedPatterns = createRegistrySelector( ( select ) =>\n\tcreateSelector(\n\t\t( state, rootClientId = null ) => {\n\t\t\tconst { getAllPatterns } = unlock( select( STORE_NAME ) );\n\t\t\tconst patterns = getAllPatterns();\n\t\t\tconst { allowedBlockTypes } = getSettings( state );\n\t\t\treturn patterns.some( ( pattern ) => {\n\t\t\t\tconst { inserter = true } = pattern;\n\t\t\t\tif ( ! inserter ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tconst grammar = getGrammar( pattern );\n\t\t\t\treturn (\n\t\t\t\t\tcheckAllowListRecursive( grammar, allowedBlockTypes ) &&\n\t\t\t\t\tgrammar.every( ( { name: blockName } ) =>\n\t\t\t\t\t\tcanInsertBlockType( state, blockName, rootClientId )\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t} );\n\t\t},\n\t\t( state, rootClientId ) => [\n\t\t\t...getAllPatternsDependants( select )( state ),\n\t\t\t...getInsertBlockTypeDependants( select )( state, rootClientId ),\n\t\t]\n\t)\n);\n\nexport const getPatternBySlug = createRegistrySelector( ( select ) =>\n\tcreateSelector(\n\t\t( state, patternName ) => {\n\t\t\t// Only fetch reusable blocks if we know we need them. To do: maybe\n\t\t\t// use the entity record API to retrieve the block by slug.\n\t\t\tif ( patternName?.startsWith( 'core/block/' ) ) {\n\t\t\t\tconst _id = parseInt(\n\t\t\t\t\tpatternName.slice( 'core/block/'.length ),\n\t\t\t\t\t10\n\t\t\t\t);\n\t\t\t\tconst block = unlock( select( STORE_NAME ) )\n\t\t\t\t\t.getReusableBlocks()\n\t\t\t\t\t.find( ( { id } ) => id === _id );\n\n\t\t\t\tif ( ! block ) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\treturn mapUserPattern(\n\t\t\t\t\tblock,\n\t\t\t\t\tstate.settings.__experimentalUserPatternCategories\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn [\n\t\t\t\t// This setting is left for back compat.\n\t\t\t\t...( state.settings.__experimentalBlockPatterns ?? [] ),\n\t\t\t\t...( state.settings[ selectBlockPatternsKey ]?.( select ) ??\n\t\t\t\t\t[] ),\n\t\t\t].find( ( { name } ) => name === patternName );\n\t\t},\n\t\t( state, patternName ) =>\n\t\t\tpatternName?.startsWith( 'core/block/' )\n\t\t\t\t? [\n\t\t\t\t\t\tunlock( select( STORE_NAME ) ).getReusableBlocks(),\n\t\t\t\t\t\tstate.settings.__experimentalReusableBlocks,\n\t\t\t\t ]\n\t\t\t\t: [\n\t\t\t\t\t\tstate.settings.__experimentalBlockPatterns,\n\t\t\t\t\t\tstate.settings[ selectBlockPatternsKey ]?.( select ),\n\t\t\t\t ]\n\t)\n);\n\nexport const getAllPatterns = createRegistrySelector( ( select ) =>\n\tcreateSelector( ( state ) => {\n\t\treturn [\n\t\t\t...unlock( select( STORE_NAME ) )\n\t\t\t\t.getReusableBlocks()\n\t\t\t\t.map( ( userPattern ) =>\n\t\t\t\t\tmapUserPattern(\n\t\t\t\t\t\tuserPattern,\n\t\t\t\t\t\tstate.settings.__experimentalUserPatternCategories\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t// This setting is left for back compat.\n\t\t\t...( state.settings.__experimentalBlockPatterns ?? [] ),\n\t\t\t...( state.settings[ selectBlockPatternsKey ]?.( select ) ?? [] ),\n\t\t].filter(\n\t\t\t( x, index, arr ) =>\n\t\t\t\tindex === arr.findIndex( ( y ) => x.name === y.name )\n\t\t);\n\t}, getAllPatternsDependants( select ) )\n);\n\nconst EMPTY_ARRAY = [];\n\nexport const getReusableBlocks = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tconst reusableBlocksSelect = state.settings[ reusableBlocksSelectKey ];\n\t\treturn (\n\t\t\t( reusableBlocksSelect\n\t\t\t\t? reusableBlocksSelect( select )\n\t\t\t\t: state.settings.__experimentalReusableBlocks ) ?? EMPTY_ARRAY\n\t\t);\n\t}\n);\n\n/**\n * Returns the element of the last element that had focus when focus left the editor canvas.\n *\n * @param {Object} state Block editor state.\n *\n * @return {Object} Element.\n */\nexport function getLastFocus( state ) {\n\treturn state.lastFocus;\n}\n\n/**\n * Returns true if the user is dragging anything, or false otherwise. It is possible for a\n * user to be dragging data from outside of the editor, so this selector is separate from\n * the `isDraggingBlocks` selector which only returns true if the user is dragging blocks.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether user is dragging.\n */\nexport function isDragging( state ) {\n\treturn state.isDragging;\n}\n\n/**\n * Retrieves the expanded block from the state.\n *\n * @param {Object} state Block editor state.\n *\n * @return {string|null} The client ID of the expanded block, if set.\n */\nexport function getExpandedBlock( state ) {\n\treturn state.expandedBlock;\n}\n\n/**\n * Retrieves the client ID of the ancestor block that is content locking the block\n * with the provided client ID.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId Client Id of the block.\n *\n * @return {?string} Client ID of the ancestor block that is content locking the block.\n */\nexport const getContentLockingParent = ( state, clientId ) => {\n\tlet current = clientId;\n\tlet result;\n\twhile ( ! result && ( current = state.blocks.parents.get( current ) ) ) {\n\t\tif ( getTemplateLock( state, current ) === 'contentOnly' ) {\n\t\t\tresult = current;\n\t\t}\n\t}\n\treturn result;\n};\n\n/**\n * Retrieves the client ID of the parent section block.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId Client Id of the block.\n *\n * @return {?string} Client ID of the ancestor block that is a contentOnly section.\n */\nexport const getParentSectionBlock = ( state, clientId ) => {\n\tlet current = clientId;\n\tlet result;\n\n\t// If sections are nested, return the top level section block.\n\t// Don't return early.\n\twhile ( ( current = state.blocks.parents.get( current ) ) ) {\n\t\tif ( isSectionBlock( state, current ) ) {\n\t\t\tresult = current;\n\t\t}\n\t}\n\treturn result;\n};\n\n/**\n * Returns whether the block is a contentOnly section.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId Client Id of the block.\n *\n * @return {boolean} Whether the block is a contentOnly section.\n */\nexport function isSectionBlock( state, clientId ) {\n\tif ( clientId === state.editedContentOnlySection ) {\n\t\treturn false;\n\t}\n\n\tconst blockName = getBlockName( state, clientId );\n\tif (\n\t\tblockName === 'core/block' ||\n\t\tgetTemplateLock( state, clientId ) === 'contentOnly'\n\t) {\n\t\treturn true;\n\t}\n\n\tconst attributes = getBlockAttributes( state, clientId );\n\tif (\n\t\tattributes?.metadata?.patternName &&\n\t\t!! window?.__experimentalContentOnlyPatternInsertion\n\t) {\n\t\treturn true;\n\t}\n\treturn false;\n}\n\n/**\n * Retrieves the client ID of the block that is a contentOnly section but is\n * currently being temporarily edited (contentOnly is deactivated).\n *\n * @param {Object} state Global application state.\n *\n * @return {?string} The client ID of the block being temporarily edited.\n */\nexport function getEditedContentOnlySection( state ) {\n\treturn state.editedContentOnlySection;\n}\n\nexport function isWithinEditedContentOnlySection( state, clientId ) {\n\tif ( ! state.editedContentOnlySection ) {\n\t\treturn false;\n\t}\n\n\tif ( state.editedContentOnlySection === clientId ) {\n\t\treturn true;\n\t}\n\n\tlet current = clientId;\n\twhile ( ( current = state.blocks.parents.get( current ) ) ) {\n\t\tif ( state.editedContentOnlySection === current ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n\n/**\n * Returns the style attributes of multiple blocks.\n *\n * @param {Object} state Global application state.\n * @param {string[]} clientIds An array of block client IDs.\n *\n * @return {Object} An object where keys are client IDs and values are the corresponding block styles or undefined.\n */\nexport const getBlockStyles = createSelector(\n\t( state, clientIds ) =>\n\t\tclientIds.reduce( ( styles, clientId ) => {\n\t\t\tstyles[ clientId ] = state.blocks.attributes.get( clientId )?.style;\n\t\t\treturn styles;\n\t\t}, {} ),\n\t( state, clientIds ) => [\n\t\t...clientIds.map(\n\t\t\t( clientId ) => state.blocks.attributes.get( clientId )?.style\n\t\t),\n\t]\n);\n\n/**\n * Retrieves the client ID of the block which contains the blocks\n * acting as \"sections\" in the editor. This is typically the \"main content\"\n * of the template/post.\n *\n * @param {Object} state Editor state.\n *\n * @return {string|undefined} The section root client ID or undefined if not set.\n */\nexport function getSectionRootClientId( state ) {\n\treturn state.settings?.[ sectionRootClientIdKey ];\n}\n\n/**\n * Returns whether the editor is considered zoomed out.\n *\n * @param {Object} state Global application state.\n * @return {boolean} Whether the editor is zoomed.\n */\nexport function isZoomOut( state ) {\n\treturn state.zoomLevel === 'auto-scaled' || state.zoomLevel < 100;\n}\n\n/**\n * Returns whether the zoom level.\n *\n * @param {Object} state Global application state.\n * @return {number|\"auto-scaled\"} Zoom level.\n */\nexport function getZoomLevel( state ) {\n\treturn state.zoomLevel;\n}\n\n/**\n * Finds the closest block where the block is allowed to be inserted.\n *\n * @param {Object} state Editor state.\n * @param {string[] | string} name Block name or names.\n * @param {string} clientId Default insertion point.\n *\n * @return {string} clientID of the closest container when the block name can be inserted.\n */\nexport function getClosestAllowedInsertionPoint( state, name, clientId = '' ) {\n\tconst blockNames = Array.isArray( name ) ? name : [ name ];\n\tconst areBlockNamesAllowedInClientId = ( id ) =>\n\t\tblockNames.every( ( currentName ) =>\n\t\t\tcanInsertBlockType( state, currentName, id )\n\t\t);\n\n\t// If we're trying to insert at the root level and it's not allowed\n\t// Try the section root instead.\n\tif ( ! clientId ) {\n\t\tif ( areBlockNamesAllowedInClientId( clientId ) ) {\n\t\t\treturn clientId;\n\t\t}\n\n\t\tconst sectionRootClientId = getSectionRootClientId( state );\n\t\tif (\n\t\t\tsectionRootClientId &&\n\t\t\tareBlockNamesAllowedInClientId( sectionRootClientId )\n\t\t) {\n\t\t\treturn sectionRootClientId;\n\t\t}\n\t\treturn null;\n\t}\n\n\t// Traverse the block tree up until we find a place where we can insert.\n\tlet current = clientId;\n\twhile ( current !== null && ! areBlockNamesAllowedInClientId( current ) ) {\n\t\tconst parentClientId = getBlockRootClientId( state, current );\n\t\tcurrent = parentClientId;\n\t}\n\n\treturn current;\n}\n\nexport function getClosestAllowedInsertionPointForPattern(\n\tstate,\n\tpattern,\n\tclientId\n) {\n\tconst { allowedBlockTypes } = getSettings( state );\n\tconst isAllowed = checkAllowListRecursive(\n\t\tgetGrammar( pattern ),\n\t\tallowedBlockTypes\n\t);\n\tif ( ! isAllowed ) {\n\t\treturn null;\n\t}\n\tconst names = getGrammar( pattern ).map( ( { blockName: name } ) => name );\n\treturn getClosestAllowedInsertionPoint( state, names, clientId );\n}\n\n/**\n * Where the point where the next block will be inserted into.\n *\n * @param {Object} state\n * @return {Object} where the insertion point in the block editor is or null if none is set.\n */\nexport function getInsertionPoint( state ) {\n\treturn state.insertionPoint;\n}\n\n/**\n * Returns true if the block is hidden, or false otherwise.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId Client ID of the block.\n *\n * @return {boolean} Whether the block is hidden.\n */\nexport const isBlockHidden = ( state, clientId ) => {\n\tconst blockName = getBlockName( state, clientId );\n\tif ( ! hasBlockSupport( state, blockName, 'blockVisibility', true ) ) {\n\t\treturn false;\n\t}\n\tconst attributes = state.blocks.attributes.get( clientId );\n\treturn attributes?.metadata?.blockVisibility === false;\n};\n\n/**\n * Returns true if there is a spotlighted block.\n *\n * The spotlight is also active when a contentOnly section is being edited, the selector\n * also returns true if this is the case.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the block is currently spotlighted.\n */\nexport function hasBlockSpotlight( state ) {\n\treturn !! state.hasBlockSpotlight || !! state.editedContentOnlySection;\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAuD;AACvD,oBAGO;AAKP,uBAWO;AACP,mBAMO;AACP,uBAA2B;AAC3B,yBAAuB;AACvB,0BAIO;AAIP,gCAAiC;AAFjC,IAAM,EAAE,eAAe,QAAI,2BAAQ,cAAAA,WAAkB;AAW9C,SAAS,uBAAwB,OAAQ;AAC/C,SAAO,MAAM;AACd;AAQO,SAAS,+BAAgC,OAAQ;AACvD,SAAO,OAAO,mBAAmB;AAClC;AAEO,SAAS,0BAA2B,OAAO,UAAW;AAC5D,SAAO,MAAM,OAAO,WAAW,IAAK,QAAS;AAC9C;AAWO,IAAM,yBAAyB,CAAE,OAAO,aAAc;AAC5D,QAAM,yBAAyB,CAAE,kBAAmB;AACnD,eACC,sCAAqB,OAAO,aAAc,MAAM,kBAChD,gCAAe,OAAO,aAAc,EAAE;AAAA,MACrC;AAAA,IACD;AAAA,EAEF;AACA,aAAO,gCAAe,OAAO,QAAS,EAAE,MAAO,sBAAuB;AACvE;AAUO,SAAS,yCACf,OACA,WACA,cACC;AACD,QAAM,sBAAsB,eAAgB,SAAU;AACtD,QAAM,oBAAgB,+BAAc,OAAO,YAAa;AACxD,QAAM,0BAA0B,eAAgB,aAAc;AAC9D,QAAM,kBAAkB,uBAAwB,KAAM,MAAM;AAK5D,SACC,mBAAqB,2BAA2B;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gBAAgB,CAAE,OAAO,aAAc;AACnD,QAAM,gBAAY,+BAAc,OAAO,QAAS;AAChD,MAAK,KAAE,+BAAiB,OAAO,WAAW,mBAAmB,IAAK,GAAI;AACrE,WAAO;AAAA,EACR;AACA,QAAM,aAAa,MAAM,OAAO,WAAW,IAAK,QAAS;AACzD,SAAO,YAAY,UAAU,oBAAoB;AAClD;AAYO,SAAS,kBAAmB,OAAQ;AAC1C,SAAO,CAAC,CAAE,MAAM,qBAAqB,CAAC,CAAE,MAAM;AAC/C;",
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { createSelector, createRegistrySelector } from '@wordpress/data';\nimport {\n\thasBlockSupport,\n\tprivateApis as blocksPrivateApis,\n} from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport {\n\tgetBlockOrder,\n\tgetBlockParents,\n\tgetBlockEditingMode,\n\tgetSettings,\n\tcanInsertBlockType,\n\tgetBlockName,\n\tgetTemplateLock,\n\tgetClientIdsWithDescendants,\n\tgetBlockRootClientId,\n\tgetBlockAttributes,\n} from './selectors';\nimport {\n\tcheckAllowListRecursive,\n\tgetAllPatternsDependants,\n\tgetInsertBlockTypeDependants,\n\tgetGrammar,\n\tmapUserPattern,\n} from './utils';\nimport { STORE_NAME } from './constants';\nimport { unlock } from '../lock-unlock';\nimport {\n\tselectBlockPatternsKey,\n\treusableBlocksSelectKey,\n\tsectionRootClientIdKey,\n} from './private-keys';\n\nconst { isContentBlock } = unlock( blocksPrivateApis );\n\nexport { getBlockSettings } from './get-block-settings';\n\n/**\n * Returns true if the block interface is hidden, or false otherwise.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the block toolbar is hidden.\n */\nexport function isBlockInterfaceHidden( state ) {\n\treturn state.isBlockInterfaceHidden;\n}\n\n/**\n * Gets the client ids of the last inserted blocks.\n *\n * @param {Object} state Global application state.\n * @return {Array|undefined} Client Ids of the last inserted block(s).\n */\nexport function getLastInsertedBlocksClientIds( state ) {\n\treturn state?.lastBlockInserted?.clientIds;\n}\n\nexport function getBlockWithoutAttributes( state, clientId ) {\n\treturn state.blocks.byClientId.get( clientId );\n}\n\n/**\n * Returns true if all of the descendants of a block with the given client ID\n * have an editing mode of 'disabled', or false otherwise.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId The block client ID.\n *\n * @return {boolean} Whether the block descendants are disabled.\n */\nexport const isBlockSubtreeDisabled = ( state, clientId ) => {\n\tconst isChildSubtreeDisabled = ( childClientId ) => {\n\t\treturn (\n\t\t\tgetBlockEditingMode( state, childClientId ) === 'disabled' &&\n\t\t\tgetBlockOrder( state, childClientId ).every(\n\t\t\t\tisChildSubtreeDisabled\n\t\t\t)\n\t\t);\n\t};\n\treturn getBlockOrder( state, clientId ).every( isChildSubtreeDisabled );\n};\n\n/**\n * Determines if a container (clientId) allows insertion of blocks, considering contentOnly mode restrictions.\n *\n * @param {Object} state Editor state.\n * @param {string} blockName The block name to insert.\n * @param {string} rootClientId The client ID of the root container block.\n * @return {boolean} Whether the container allows insertion.\n */\nexport function isContainerInsertableToInContentOnlyMode(\n\tstate,\n\tblockName,\n\trootClientId\n) {\n\tconst isBlockContentBlock = isContentBlock( blockName );\n\tconst rootBlockName = getBlockName( state, rootClientId );\n\tconst isContainerContentBlock = isContentBlock( rootBlockName );\n\tconst isRootBlockMain = getSectionRootClientId( state ) === rootClientId;\n\n\t// In contentOnly mode, containers shouldn't be inserted into unless:\n\t// 1. they are a section root;\n\t// 2. they are a content block and the block to be inserted is also content.\n\treturn (\n\t\tisRootBlockMain || ( isContainerContentBlock && isBlockContentBlock )\n\t);\n}\n\nfunction getEnabledClientIdsTreeUnmemoized( state, rootClientId ) {\n\tconst blockOrder = getBlockOrder( state, rootClientId );\n\tconst result = [];\n\n\tfor ( const clientId of blockOrder ) {\n\t\tconst innerBlocks = getEnabledClientIdsTreeUnmemoized(\n\t\t\tstate,\n\t\t\tclientId\n\t\t);\n\t\tif ( getBlockEditingMode( state, clientId ) !== 'disabled' ) {\n\t\t\tresult.push( { clientId, innerBlocks } );\n\t\t} else {\n\t\t\tresult.push( ...innerBlocks );\n\t\t}\n\t}\n\n\treturn result;\n}\n\n/**\n * Returns a tree of block objects with only clientID and innerBlocks set.\n * Blocks with a 'disabled' editing mode are not included.\n *\n * @param {Object} state Global application state.\n * @param {?string} rootClientId Optional root client ID of block list.\n *\n * @return {Object[]} Tree of block objects with only clientID and innerBlocks set.\n */\nexport const getEnabledClientIdsTree = createRegistrySelector( () =>\n\tcreateSelector( getEnabledClientIdsTreeUnmemoized, ( state ) => [\n\t\tstate.blocks.order,\n\t\tstate.derivedBlockEditingModes,\n\t\tstate.blockEditingModes,\n\t] )\n);\n\n/**\n * Returns a list of a given block's ancestors, from top to bottom. Blocks with\n * a 'disabled' editing mode are excluded.\n *\n * @see getBlockParents\n *\n * @param {Object} state Global application state.\n * @param {string} clientId The block client ID.\n * @param {boolean} ascending Order results from bottom to top (true) or top\n * to bottom (false).\n */\nexport const getEnabledBlockParents = createSelector(\n\t( state, clientId, ascending = false ) => {\n\t\treturn getBlockParents( state, clientId, ascending ).filter(\n\t\t\t( parent ) => getBlockEditingMode( state, parent ) !== 'disabled'\n\t\t);\n\t},\n\t( state ) => [\n\t\tstate.blocks.parents,\n\t\tstate.blockEditingModes,\n\t\tstate.settings.templateLock,\n\t\tstate.blockListSettings,\n\t]\n);\n\n/**\n * Selector that returns the data needed to display a prompt when certain\n * blocks are removed, or `false` if no such prompt is requested.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object|false} Data for removal prompt display, if any.\n */\nexport function getRemovalPromptData( state ) {\n\treturn state.removalPromptData;\n}\n\n/**\n * Returns true if removal prompt exists, or false otherwise.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether removal prompt exists.\n */\nexport function getBlockRemovalRules( state ) {\n\treturn state.blockRemovalRules;\n}\n\n/**\n * Returns the client ID of the block settings menu that is currently open.\n *\n * @param {Object} state Global application state.\n * @return {string|null} The client ID of the block menu that is currently open.\n */\nexport function getOpenedBlockSettingsMenu( state ) {\n\treturn state.openedBlockSettingsMenu;\n}\n\n/**\n * Returns all style overrides, intended to be merged with global editor styles.\n *\n * Overrides are sorted to match the order of the blocks they relate to. This\n * is useful to maintain correct CSS cascade order.\n *\n * @param {Object} state Global application state.\n *\n * @return {Array} An array of style ID to style override pairs.\n */\nexport const getStyleOverrides = createSelector(\n\t( state ) => {\n\t\tconst clientIds = getClientIdsWithDescendants( state );\n\t\tconst clientIdMap = clientIds.reduce( ( acc, clientId, index ) => {\n\t\t\tacc[ clientId ] = index;\n\t\t\treturn acc;\n\t\t}, {} );\n\n\t\treturn [ ...state.styleOverrides ].sort( ( overrideA, overrideB ) => {\n\t\t\t// Once the overrides Map is spread to an array, the first element\n\t\t\t// is the key, while the second is the override itself including\n\t\t\t// the clientId to sort by.\n\t\t\tconst [ , { clientId: clientIdA } ] = overrideA;\n\t\t\tconst [ , { clientId: clientIdB } ] = overrideB;\n\n\t\t\tconst aIndex = clientIdMap[ clientIdA ] ?? -1;\n\t\t\tconst bIndex = clientIdMap[ clientIdB ] ?? -1;\n\n\t\t\treturn aIndex - bIndex;\n\t\t} );\n\t},\n\t( state ) => [ state.blocks.order, state.styleOverrides ]\n);\n\n/** @typedef {import('./actions').InserterMediaCategory} InserterMediaCategory */\n/**\n * Returns the registered inserter media categories through the public API.\n *\n * @param {Object} state Editor state.\n *\n * @return {InserterMediaCategory[]} Inserter media categories.\n */\nexport function getRegisteredInserterMediaCategories( state ) {\n\treturn state.registeredInserterMediaCategories;\n}\n\n/**\n * Returns an array containing the allowed inserter media categories.\n * It merges the registered media categories from extenders with the\n * core ones. It also takes into account the allowed `mime_types`, which\n * can be altered by `upload_mimes` filter and restrict some of them.\n *\n * @param {Object} state Global application state.\n *\n * @return {InserterMediaCategory[]} Client IDs of descendants.\n */\nexport const getInserterMediaCategories = createSelector(\n\t( state ) => {\n\t\tconst {\n\t\t\tsettings: {\n\t\t\t\tinserterMediaCategories,\n\t\t\t\tallowedMimeTypes,\n\t\t\t\tenableOpenverseMediaCategory,\n\t\t\t},\n\t\t\tregisteredInserterMediaCategories,\n\t\t} = state;\n\t\t// The allowed `mime_types` can be altered by `upload_mimes` filter and restrict\n\t\t// some of them. In this case we shouldn't add the category to the available media\n\t\t// categories list in the inserter.\n\t\tif (\n\t\t\t( ! inserterMediaCategories &&\n\t\t\t\t! registeredInserterMediaCategories.length ) ||\n\t\t\t! allowedMimeTypes\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t\tconst coreInserterMediaCategoriesNames =\n\t\t\tinserterMediaCategories?.map( ( { name } ) => name ) || [];\n\t\tconst mergedCategories = [\n\t\t\t...( inserterMediaCategories || [] ),\n\t\t\t...( registeredInserterMediaCategories || [] ).filter(\n\t\t\t\t( { name } ) =>\n\t\t\t\t\t! coreInserterMediaCategoriesNames.includes( name )\n\t\t\t),\n\t\t];\n\t\treturn mergedCategories.filter( ( category ) => {\n\t\t\t// Check if Openverse category is enabled.\n\t\t\tif (\n\t\t\t\t! enableOpenverseMediaCategory &&\n\t\t\t\tcategory.name === 'openverse'\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn Object.values( allowedMimeTypes ).some( ( mimeType ) =>\n\t\t\t\tmimeType.startsWith( `${ category.mediaType }/` )\n\t\t\t);\n\t\t} );\n\t},\n\t( state ) => [\n\t\tstate.settings.inserterMediaCategories,\n\t\tstate.settings.allowedMimeTypes,\n\t\tstate.settings.enableOpenverseMediaCategory,\n\t\tstate.registeredInserterMediaCategories,\n\t]\n);\n\n/**\n * Returns whether there is at least one allowed pattern for inner blocks children.\n * This is useful for deferring the parsing of all patterns until needed.\n *\n * @param {Object} state Editor state.\n * @param {string} [rootClientId=null] Target root client ID.\n *\n * @return {boolean} If there is at least one allowed pattern.\n */\nexport const hasAllowedPatterns = createRegistrySelector( ( select ) =>\n\tcreateSelector(\n\t\t( state, rootClientId = null ) => {\n\t\t\tconst { getAllPatterns } = unlock( select( STORE_NAME ) );\n\t\t\tconst patterns = getAllPatterns();\n\t\t\tconst { allowedBlockTypes } = getSettings( state );\n\t\t\treturn patterns.some( ( pattern ) => {\n\t\t\t\tconst { inserter = true } = pattern;\n\t\t\t\tif ( ! inserter ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tconst grammar = getGrammar( pattern );\n\t\t\t\treturn (\n\t\t\t\t\tcheckAllowListRecursive( grammar, allowedBlockTypes ) &&\n\t\t\t\t\tgrammar.every( ( { name: blockName } ) =>\n\t\t\t\t\t\tcanInsertBlockType( state, blockName, rootClientId )\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t} );\n\t\t},\n\t\t( state, rootClientId ) => [\n\t\t\t...getAllPatternsDependants( select )( state ),\n\t\t\t...getInsertBlockTypeDependants( select )( state, rootClientId ),\n\t\t]\n\t)\n);\n\nexport const getPatternBySlug = createRegistrySelector( ( select ) =>\n\tcreateSelector(\n\t\t( state, patternName ) => {\n\t\t\t// Only fetch reusable blocks if we know we need them. To do: maybe\n\t\t\t// use the entity record API to retrieve the block by slug.\n\t\t\tif ( patternName?.startsWith( 'core/block/' ) ) {\n\t\t\t\tconst _id = parseInt(\n\t\t\t\t\tpatternName.slice( 'core/block/'.length ),\n\t\t\t\t\t10\n\t\t\t\t);\n\t\t\t\tconst block = unlock( select( STORE_NAME ) )\n\t\t\t\t\t.getReusableBlocks()\n\t\t\t\t\t.find( ( { id } ) => id === _id );\n\n\t\t\t\tif ( ! block ) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\treturn mapUserPattern(\n\t\t\t\t\tblock,\n\t\t\t\t\tstate.settings.__experimentalUserPatternCategories\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn [\n\t\t\t\t// This setting is left for back compat.\n\t\t\t\t...( state.settings.__experimentalBlockPatterns ?? [] ),\n\t\t\t\t...( state.settings[ selectBlockPatternsKey ]?.( select ) ??\n\t\t\t\t\t[] ),\n\t\t\t].find( ( { name } ) => name === patternName );\n\t\t},\n\t\t( state, patternName ) =>\n\t\t\tpatternName?.startsWith( 'core/block/' )\n\t\t\t\t? [\n\t\t\t\t\t\tunlock( select( STORE_NAME ) ).getReusableBlocks(),\n\t\t\t\t\t\tstate.settings.__experimentalReusableBlocks,\n\t\t\t\t ]\n\t\t\t\t: [\n\t\t\t\t\t\tstate.settings.__experimentalBlockPatterns,\n\t\t\t\t\t\tstate.settings[ selectBlockPatternsKey ]?.( select ),\n\t\t\t\t ]\n\t)\n);\n\nexport const getAllPatterns = createRegistrySelector( ( select ) =>\n\tcreateSelector( ( state ) => {\n\t\treturn [\n\t\t\t...unlock( select( STORE_NAME ) )\n\t\t\t\t.getReusableBlocks()\n\t\t\t\t.map( ( userPattern ) =>\n\t\t\t\t\tmapUserPattern(\n\t\t\t\t\t\tuserPattern,\n\t\t\t\t\t\tstate.settings.__experimentalUserPatternCategories\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t// This setting is left for back compat.\n\t\t\t...( state.settings.__experimentalBlockPatterns ?? [] ),\n\t\t\t...( state.settings[ selectBlockPatternsKey ]?.( select ) ?? [] ),\n\t\t].filter(\n\t\t\t( x, index, arr ) =>\n\t\t\t\tindex === arr.findIndex( ( y ) => x.name === y.name )\n\t\t);\n\t}, getAllPatternsDependants( select ) )\n);\n\nconst EMPTY_ARRAY = [];\n\nexport const getReusableBlocks = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tconst reusableBlocksSelect = state.settings[ reusableBlocksSelectKey ];\n\t\treturn (\n\t\t\t( reusableBlocksSelect\n\t\t\t\t? reusableBlocksSelect( select )\n\t\t\t\t: state.settings.__experimentalReusableBlocks ) ?? EMPTY_ARRAY\n\t\t);\n\t}\n);\n\n/**\n * Returns the element of the last element that had focus when focus left the editor canvas.\n *\n * @param {Object} state Block editor state.\n *\n * @return {Object} Element.\n */\nexport function getLastFocus( state ) {\n\treturn state.lastFocus;\n}\n\n/**\n * Returns true if the user is dragging anything, or false otherwise. It is possible for a\n * user to be dragging data from outside of the editor, so this selector is separate from\n * the `isDraggingBlocks` selector which only returns true if the user is dragging blocks.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether user is dragging.\n */\nexport function isDragging( state ) {\n\treturn state.isDragging;\n}\n\n/**\n * Retrieves the expanded block from the state.\n *\n * @param {Object} state Block editor state.\n *\n * @return {string|null} The client ID of the expanded block, if set.\n */\nexport function getExpandedBlock( state ) {\n\treturn state.expandedBlock;\n}\n\n/**\n * Retrieves the client ID of the ancestor block that is content locking the block\n * with the provided client ID.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId Client Id of the block.\n *\n * @return {?string} Client ID of the ancestor block that is content locking the block.\n */\nexport const getContentLockingParent = ( state, clientId ) => {\n\tlet current = clientId;\n\tlet result;\n\twhile ( ! result && ( current = state.blocks.parents.get( current ) ) ) {\n\t\tif ( getTemplateLock( state, current ) === 'contentOnly' ) {\n\t\t\tresult = current;\n\t\t}\n\t}\n\treturn result;\n};\n\n/**\n * Retrieves the client ID of the parent section block.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId Client Id of the block.\n *\n * @return {?string} Client ID of the ancestor block that is a contentOnly section.\n */\nexport const getParentSectionBlock = ( state, clientId ) => {\n\tlet current = clientId;\n\tlet result;\n\n\t// If sections are nested, return the top level section block.\n\t// Don't return early.\n\twhile ( ( current = state.blocks.parents.get( current ) ) ) {\n\t\tif ( isSectionBlock( state, current ) ) {\n\t\t\tresult = current;\n\t\t}\n\t}\n\treturn result;\n};\n\n/**\n * Returns whether the block is a contentOnly section.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId Client Id of the block.\n *\n * @return {boolean} Whether the block is a contentOnly section.\n */\nexport function isSectionBlock( state, clientId ) {\n\tif ( clientId === state.editedContentOnlySection ) {\n\t\treturn false;\n\t}\n\n\tconst blockName = getBlockName( state, clientId );\n\tif ( blockName === 'core/block' ) {\n\t\treturn true;\n\t}\n\n\tconst attributes = getBlockAttributes( state, clientId );\n\tconst isTemplatePart = blockName === 'core/template-part';\n\tif (\n\t\t( attributes?.metadata?.patternName || isTemplatePart ) &&\n\t\t!! window?.__experimentalContentOnlyPatternInsertion\n\t) {\n\t\treturn true;\n\t}\n\n\t// TemplateLock cascades to all inner parent blocks. Only the top-level\n\t// block that's contentOnly templateLocked is the true contentLocker,\n\t// all the others are mere imitators.\n\tconst hasContentOnlyTempateLock =\n\t\tgetTemplateLock( state, clientId ) === 'contentOnly';\n\tconst rootClientId = getBlockRootClientId( state, clientId );\n\tconst hasRootContentOnlyTemplateLock =\n\t\tgetTemplateLock( state, rootClientId ) === 'contentOnly';\n\tif ( hasContentOnlyTempateLock && ! hasRootContentOnlyTemplateLock ) {\n\t\treturn true;\n\t}\n\n\treturn false;\n}\n\n/**\n * Retrieves the client ID of the block that is a contentOnly section but is\n * currently being temporarily edited (contentOnly is deactivated).\n *\n * @param {Object} state Global application state.\n *\n * @return {?string} The client ID of the block being temporarily edited.\n */\nexport function getEditedContentOnlySection( state ) {\n\treturn state.editedContentOnlySection;\n}\n\nexport function isWithinEditedContentOnlySection( state, clientId ) {\n\tif ( ! state.editedContentOnlySection ) {\n\t\treturn false;\n\t}\n\n\tif ( state.editedContentOnlySection === clientId ) {\n\t\treturn true;\n\t}\n\n\tlet current = clientId;\n\twhile ( ( current = state.blocks.parents.get( current ) ) ) {\n\t\tif ( state.editedContentOnlySection === current ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n\n/**\n * Returns the style attributes of multiple blocks.\n *\n * @param {Object} state Global application state.\n * @param {string[]} clientIds An array of block client IDs.\n *\n * @return {Object} An object where keys are client IDs and values are the corresponding block styles or undefined.\n */\nexport const getBlockStyles = createSelector(\n\t( state, clientIds ) =>\n\t\tclientIds.reduce( ( styles, clientId ) => {\n\t\t\tstyles[ clientId ] = state.blocks.attributes.get( clientId )?.style;\n\t\t\treturn styles;\n\t\t}, {} ),\n\t( state, clientIds ) => [\n\t\t...clientIds.map(\n\t\t\t( clientId ) => state.blocks.attributes.get( clientId )?.style\n\t\t),\n\t]\n);\n\n/**\n * Retrieves the client ID of the block which contains the blocks\n * acting as \"sections\" in the editor. This is typically the \"main content\"\n * of the template/post.\n *\n * @param {Object} state Editor state.\n *\n * @return {string|undefined} The section root client ID or undefined if not set.\n */\nexport function getSectionRootClientId( state ) {\n\treturn state.settings?.[ sectionRootClientIdKey ];\n}\n\n/**\n * Returns whether the editor is considered zoomed out.\n *\n * @param {Object} state Global application state.\n * @return {boolean} Whether the editor is zoomed.\n */\nexport function isZoomOut( state ) {\n\treturn state.zoomLevel === 'auto-scaled' || state.zoomLevel < 100;\n}\n\n/**\n * Returns whether the zoom level.\n *\n * @param {Object} state Global application state.\n * @return {number|\"auto-scaled\"} Zoom level.\n */\nexport function getZoomLevel( state ) {\n\treturn state.zoomLevel;\n}\n\n/**\n * Finds the closest block where the block is allowed to be inserted.\n *\n * @param {Object} state Editor state.\n * @param {string[] | string} name Block name or names.\n * @param {string} clientId Default insertion point.\n *\n * @return {string} clientID of the closest container when the block name can be inserted.\n */\nexport function getClosestAllowedInsertionPoint( state, name, clientId = '' ) {\n\tconst blockNames = Array.isArray( name ) ? name : [ name ];\n\tconst areBlockNamesAllowedInClientId = ( id ) =>\n\t\tblockNames.every( ( currentName ) =>\n\t\t\tcanInsertBlockType( state, currentName, id )\n\t\t);\n\n\t// If we're trying to insert at the root level and it's not allowed\n\t// Try the section root instead.\n\tif ( ! clientId ) {\n\t\tif ( areBlockNamesAllowedInClientId( clientId ) ) {\n\t\t\treturn clientId;\n\t\t}\n\n\t\tconst sectionRootClientId = getSectionRootClientId( state );\n\t\tif (\n\t\t\tsectionRootClientId &&\n\t\t\tareBlockNamesAllowedInClientId( sectionRootClientId )\n\t\t) {\n\t\t\treturn sectionRootClientId;\n\t\t}\n\t\treturn null;\n\t}\n\n\t// Traverse the block tree up until we find a place where we can insert.\n\tlet current = clientId;\n\twhile ( current !== null && ! areBlockNamesAllowedInClientId( current ) ) {\n\t\tconst parentClientId = getBlockRootClientId( state, current );\n\t\tcurrent = parentClientId;\n\t}\n\n\treturn current;\n}\n\nexport function getClosestAllowedInsertionPointForPattern(\n\tstate,\n\tpattern,\n\tclientId\n) {\n\tconst { allowedBlockTypes } = getSettings( state );\n\tconst isAllowed = checkAllowListRecursive(\n\t\tgetGrammar( pattern ),\n\t\tallowedBlockTypes\n\t);\n\tif ( ! isAllowed ) {\n\t\treturn null;\n\t}\n\tconst names = getGrammar( pattern ).map( ( { blockName: name } ) => name );\n\treturn getClosestAllowedInsertionPoint( state, names, clientId );\n}\n\n/**\n * Where the point where the next block will be inserted into.\n *\n * @param {Object} state\n * @return {Object} where the insertion point in the block editor is or null if none is set.\n */\nexport function getInsertionPoint( state ) {\n\treturn state.insertionPoint;\n}\n\n/**\n * Returns true if the block is hidden, or false otherwise.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId Client ID of the block.\n *\n * @return {boolean} Whether the block is hidden.\n */\nexport const isBlockHidden = ( state, clientId ) => {\n\tconst blockName = getBlockName( state, clientId );\n\tif ( ! hasBlockSupport( state, blockName, 'visibility', true ) ) {\n\t\treturn false;\n\t}\n\tconst attributes = state.blocks.attributes.get( clientId );\n\treturn attributes?.metadata?.blockVisibility === false;\n};\n\n/**\n * Returns true if there is a spotlighted block.\n *\n * The spotlight is also active when a contentOnly section is being edited, the selector\n * also returns true if this is the case.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the block is currently spotlighted.\n */\nexport function hasBlockSpotlight( state ) {\n\treturn !! state.hasBlockSpotlight || !! state.editedContentOnlySection;\n}\n\n/**\n * Returns whether a block is locked to prevent editing.\n *\n * This selector only reasons about block lock, not associated features\n * like `blockEditingMode` that might prevent user modifications to a block.\n * Currently there's also no way to prevent editing via `templateLock`.\n *\n * This distinction is important as this selector specifically drives the block lock UI\n * that a user interacts with. `blockEditingModes` aren't included as a user can't change\n * them.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId ClientId of the block.\n *\n * @return {boolean} Whether the block is currently locked.\n */\nexport function isEditLockedBlock( state, clientId ) {\n\tconst attributes = getBlockAttributes( state, clientId );\n\treturn !! attributes?.lock?.edit;\n}\n\n/**\n * Returns whether a block is locked to prevent moving.\n *\n * This selector only reasons about templateLock and block lock, not associated features\n * like `blockEditingMode` that might prevent user modifications to a block.\n *\n * This distinction is important as this selector specifically drives the block lock UI\n * that a user interacts with. `blockEditingModes` are excluded as a user can't change\n * them.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId ClientId of the block.\n *\n * @return {boolean} Whether the block is currently locked.\n */\nexport function isMoveLockedBlock( state, clientId ) {\n\tconst attributes = getBlockAttributes( state, clientId );\n\t// If a block explicitly has `move` set to `false`, it turns off\n\t// any locking that might be inherited from a parent.\n\tif ( attributes?.lock?.move !== undefined ) {\n\t\treturn !! attributes?.lock?.move;\n\t}\n\n\tconst rootClientId = getBlockRootClientId( state, clientId );\n\tconst templateLock = getTemplateLock( state, rootClientId );\n\n\t// While `contentOnly` templateLock does sometimes prevent moving, a user can't modify\n\t// this, so don't include it in this function. See the `canMoveBlock` selector\n\t// as an alternative.\n\treturn templateLock === 'all';\n}\n\n/**\n * Returns whether a block is locked to prevent removal.\n *\n * This selector only reasons about templateLock and block lock, not associated features\n * like `blockEditingMode` that might prevent user modifications to a block.\n *\n * This distinction is important as this selector specifically drives the block lock UI\n * that a user interacts with. `blockEditingModes` are excluded as a user can't change\n * them.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId ClientId of the block.\n *\n * @return {boolean} Whether the block is currently locked.\n */\nexport function isRemoveLockedBlock( state, clientId ) {\n\tconst attributes = getBlockAttributes( state, clientId );\n\tif ( attributes?.lock?.remove !== undefined ) {\n\t\treturn !! attributes?.lock?.remove;\n\t}\n\n\tconst rootClientId = getBlockRootClientId( state, clientId );\n\tconst templateLock = getTemplateLock( state, rootClientId );\n\n\t// While `contentOnly` templateLock does sometimes prevent removal, a user can't modify\n\t// this, so don't include it in this function. See the `canRemoveBlock` selector\n\t// as an alternative.\n\treturn templateLock === 'all' || templateLock === 'insert';\n}\n\n/**\n * Returns whether a block is locked.\n *\n * This selector only reasons about templateLock and block lock, not associated features\n * like `blockEditingMode` that might prevent user modifications to a block.\n *\n * This distinction is important as this selector specifically drives the block lock UI\n * that a user interacts with. `blockEditingModes` are excluded as a user can't change\n * them.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId ClientId of the block.\n *\n * @return {boolean} Whether the block is currently locked.\n */\nexport function isLockedBlock( state, clientId ) {\n\treturn (\n\t\tisEditLockedBlock( state, clientId ) ||\n\t\tisMoveLockedBlock( state, clientId ) ||\n\t\tisRemoveLockedBlock( state, clientId )\n\t);\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAuD;AACvD,oBAGO;AAKP,uBAWO;AACP,mBAMO;AACP,uBAA2B;AAC3B,yBAAuB;AACvB,0BAIO;AAIP,gCAAiC;AAFjC,IAAM,EAAE,eAAe,QAAI,2BAAQ,cAAAA,WAAkB;AAW9C,SAAS,uBAAwB,OAAQ;AAC/C,SAAO,MAAM;AACd;AAQO,SAAS,+BAAgC,OAAQ;AACvD,SAAO,OAAO,mBAAmB;AAClC;AAEO,SAAS,0BAA2B,OAAO,UAAW;AAC5D,SAAO,MAAM,OAAO,WAAW,IAAK,QAAS;AAC9C;AAWO,IAAM,yBAAyB,CAAE,OAAO,aAAc;AAC5D,QAAM,yBAAyB,CAAE,kBAAmB;AACnD,eACC,sCAAqB,OAAO,aAAc,MAAM,kBAChD,gCAAe,OAAO,aAAc,EAAE;AAAA,MACrC;AAAA,IACD;AAAA,EAEF;AACA,aAAO,gCAAe,OAAO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AAY,MAAM,WAAW,QAAY;AAC7C,WAAO,CAAC,CAAE,YAAY,MAAM;AAAA,EAC7B;AAEA,QAAM,mBAAe,uCAAsB,OAAO,QAAS;AAC3D,QAAM,mBAAe,kCAAiB,OAAO,YAAa;AAK1D,SAAO,iBAAiB,SAAS,iBAAiB;AACnD;AAiBO,SAAS,cAAe,OAAO,UAAW;AAChD,SACC,kBAAmB,OAAO,QAAS,KACnC,kBAAmB,OAAO,QAAS,KACnC,oBAAqB,OAAO,QAAS;AAEvC;",
6
6
  "names": ["blocksPrivateApis", "getAllPatterns"]
7
7
  }
@@ -1535,7 +1535,8 @@ function getDerivedBlockEditingModesForTree(state, treeClientId = "") {
1535
1535
  ) : [];
1536
1536
  const contentOnlyParents = [
1537
1537
  ...contentOnlyTemplateLockedClientIds,
1538
- ...unsyncedPatternClientIds
1538
+ ...unsyncedPatternClientIds,
1539
+ ...window?.__experimentalContentOnlyPatternInsertion ? templatePartClientIds : []
1539
1540
  ];
1540
1541
  traverseBlockTree(state, treeClientId, (block) => {
1541
1542
  const { clientId, name: blockName } = block;