@wordpress/block-editor 14.3.6 → 14.5.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 (953) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/README.md +6 -2
  3. package/build/autocompleters/block.js.map +1 -1
  4. package/build/autocompleters/link.js +2 -1
  5. package/build/autocompleters/link.js.map +1 -1
  6. package/build/components/background-image-control/index.js +1 -1
  7. package/build/components/background-image-control/index.js.map +1 -1
  8. package/build/components/block-actions/index.js +1 -13
  9. package/build/components/block-actions/index.js.map +1 -1
  10. package/build/components/block-controls/slot.js.map +1 -1
  11. package/build/components/block-controls/slot.native.js.map +1 -1
  12. package/build/components/block-draggable/draggable-chip.js +1 -1
  13. package/build/components/block-draggable/draggable-chip.js.map +1 -1
  14. package/build/components/block-inspector/index.js +56 -75
  15. package/build/components/block-inspector/index.js.map +1 -1
  16. package/build/components/block-list/block-invalid-warning.native.js +1 -1
  17. package/build/components/block-list/block-invalid-warning.native.js.map +1 -1
  18. package/build/components/block-list/block-list-item.native.js.map +1 -1
  19. package/build/components/block-list/block.js +5 -16
  20. package/build/components/block-list/block.js.map +1 -1
  21. package/build/components/block-list/index.js +6 -8
  22. package/build/components/block-list/index.js.map +1 -1
  23. package/build/components/block-list/index.native.js.map +1 -1
  24. package/build/components/block-list/use-block-props/index.js +3 -8
  25. package/build/components/block-list/use-block-props/index.js.map +1 -1
  26. package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js +14 -6
  27. package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
  28. package/build/components/block-list/use-in-between-inserter.js +5 -3
  29. package/build/components/block-list/use-in-between-inserter.js.map +1 -1
  30. package/build/components/block-list/zoom-out-separator.js +24 -13
  31. package/build/components/block-list/zoom-out-separator.js.map +1 -1
  32. package/build/components/block-lock/modal.js +1 -1
  33. package/build/components/block-lock/modal.js.map +1 -1
  34. package/build/components/block-mover/button.js.map +1 -1
  35. package/build/components/block-navigation/dropdown.js +2 -4
  36. package/build/components/block-navigation/dropdown.js.map +1 -1
  37. package/build/components/block-parent-selector/index.js +14 -11
  38. package/build/components/block-parent-selector/index.js.map +1 -1
  39. package/build/components/block-pattern-setup/index.js.map +1 -1
  40. package/build/components/block-pattern-setup/setup-toolbar.js +10 -20
  41. package/build/components/block-pattern-setup/setup-toolbar.js.map +1 -1
  42. package/build/components/block-patterns-list/index.js.map +1 -1
  43. package/build/components/block-patterns-paging/index.js +11 -13
  44. package/build/components/block-patterns-paging/index.js.map +1 -1
  45. package/build/components/block-popover/index.js +45 -2
  46. package/build/components/block-popover/index.js.map +1 -1
  47. package/build/components/block-preview/auto.js +1 -4
  48. package/build/components/block-preview/auto.js.map +1 -1
  49. package/build/components/block-preview/index.js.map +1 -1
  50. package/build/components/block-quick-navigation/index.js +2 -4
  51. package/build/components/block-quick-navigation/index.js.map +1 -1
  52. package/build/components/block-rename/modal.js +2 -2
  53. package/build/components/block-rename/modal.js.map +1 -1
  54. package/build/components/block-settings-menu/block-parent-selector-menu-item.js +1 -1
  55. package/build/components/block-settings-menu/block-parent-selector-menu-item.js.map +1 -1
  56. package/build/components/block-settings-menu/block-settings-dropdown.js +79 -76
  57. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  58. package/build/components/block-settings-menu-controls/index.js +1 -6
  59. package/build/components/block-settings-menu-controls/index.js.map +1 -1
  60. package/build/components/block-switcher/block-transformations-menu.native.js +1 -1
  61. package/build/components/block-switcher/block-transformations-menu.native.js.map +1 -1
  62. package/build/components/block-switcher/index.js +19 -15
  63. package/build/components/block-switcher/index.js.map +1 -1
  64. package/build/components/block-switcher/pattern-transformations-menu.js.map +1 -1
  65. package/build/components/block-switcher/use-transformed-patterns.js +1 -0
  66. package/build/components/block-switcher/use-transformed-patterns.js.map +1 -1
  67. package/build/components/block-switcher/utils.js +1 -0
  68. package/build/components/block-switcher/utils.js.map +1 -1
  69. package/build/components/block-toolbar/index.js +16 -19
  70. package/build/components/block-toolbar/index.js.map +1 -1
  71. package/build/components/block-toolbar/use-has-block-toolbar.js +3 -5
  72. package/build/components/block-toolbar/use-has-block-toolbar.js.map +1 -1
  73. package/build/components/block-tools/index.js +8 -18
  74. package/build/components/block-tools/index.js.map +1 -1
  75. package/build/components/block-tools/insertion-point.js +1 -4
  76. package/build/components/block-tools/insertion-point.js.map +1 -1
  77. package/build/components/block-tools/use-show-block-tools.js +8 -7
  78. package/build/components/block-tools/use-show-block-tools.js.map +1 -1
  79. package/build/components/block-tools/zoom-out-mode-inserter-button.js +1 -12
  80. package/build/components/block-tools/zoom-out-mode-inserter-button.js.map +1 -1
  81. package/build/components/block-tools/zoom-out-mode-inserters.js +14 -17
  82. package/build/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
  83. package/build/components/block-tools/zoom-out-popover.js +3 -2
  84. package/build/components/block-tools/zoom-out-popover.js.map +1 -1
  85. package/build/components/block-tools/zoom-out-toolbar.js +5 -32
  86. package/build/components/block-tools/zoom-out-toolbar.js.map +1 -1
  87. package/build/components/block-types-list/index.js.map +1 -1
  88. package/build/components/block-types-list/index.native.js.map +1 -1
  89. package/build/components/block-variation-transforms/index.js +3 -2
  90. package/build/components/block-variation-transforms/index.js.map +1 -1
  91. package/build/components/border-radius-control/index.js.map +1 -1
  92. package/build/components/border-radius-control/utils.js.map +1 -1
  93. package/build/components/button-block-appender/index.js.map +1 -1
  94. package/build/components/color-style-selector/index.js.map +1 -1
  95. package/build/components/colors/utils.js.map +1 -1
  96. package/build/components/colors/with-colors.js.map +1 -1
  97. package/build/components/colors-gradients/panel-color-gradient-settings.native.js.map +1 -1
  98. package/build/components/date-format-picker/index.js +1 -0
  99. package/build/components/date-format-picker/index.js.map +1 -1
  100. package/build/components/duotone/utils.js.map +1 -1
  101. package/build/components/duotone-control/index.js.map +1 -1
  102. package/build/components/font-sizes/fluid-utils.js.map +1 -1
  103. package/build/components/font-sizes/utils.js.map +1 -1
  104. package/build/components/font-sizes/with-font-sizes.js.map +1 -1
  105. package/build/components/global-styles/border-panel.js +1 -1
  106. package/build/components/global-styles/border-panel.js.map +1 -1
  107. package/build/components/global-styles/color-panel.js +1 -1
  108. package/build/components/global-styles/color-panel.js.map +1 -1
  109. package/build/components/global-styles/dimensions-panel.js +3 -3
  110. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  111. package/build/components/global-styles/filters-panel.js.map +1 -1
  112. package/build/components/global-styles/get-block-css-selector.js.map +1 -1
  113. package/build/components/global-styles/get-global-styles-changes.js +2 -1
  114. package/build/components/global-styles/get-global-styles-changes.js.map +1 -1
  115. package/build/components/global-styles/hooks.js.map +1 -1
  116. package/build/components/global-styles/typography-panel.js.map +1 -1
  117. package/build/components/global-styles/use-global-styles-context.native.js.map +1 -1
  118. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  119. package/build/components/global-styles/utils.js.map +1 -1
  120. package/build/components/gradients/use-gradient.js.map +1 -1
  121. package/build/components/grid/grid-item-movers.js.map +1 -1
  122. package/build/components/grid/grid-visualizer.js.map +1 -1
  123. package/build/components/iframe/index.js +44 -9
  124. package/build/components/iframe/index.js.map +1 -1
  125. package/build/components/image-editor/use-save-image.js +1 -1
  126. package/build/components/image-editor/use-save-image.js.map +1 -1
  127. package/build/components/inner-blocks/index.js +1 -9
  128. package/build/components/inner-blocks/index.js.map +1 -1
  129. package/build/components/inner-blocks/use-nested-settings-update.js +15 -8
  130. package/build/components/inner-blocks/use-nested-settings-update.js.map +1 -1
  131. package/build/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js +1 -1
  132. package/build/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js.map +1 -1
  133. package/build/components/inserter/block-patterns-explorer/pattern-list.js +2 -2
  134. package/build/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
  135. package/build/components/inserter/block-patterns-tab/use-pattern-categories.js +1 -1
  136. package/build/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
  137. package/build/components/inserter/block-types-tab.js +1 -1
  138. package/build/components/inserter/block-types-tab.js.map +1 -1
  139. package/build/components/inserter/block-types-tab.native.js.map +1 -1
  140. package/build/components/inserter/category-tabs/index.js +1 -10
  141. package/build/components/inserter/category-tabs/index.js.map +1 -1
  142. package/build/components/inserter/hooks/use-block-types-state.js +24 -5
  143. package/build/components/inserter/hooks/use-block-types-state.js.map +1 -1
  144. package/build/components/inserter/hooks/use-insertion-point.js +22 -12
  145. package/build/components/inserter/hooks/use-insertion-point.js.map +1 -1
  146. package/build/components/inserter/hooks/use-patterns-state.js +24 -11
  147. package/build/components/inserter/hooks/use-patterns-state.js.map +1 -1
  148. package/build/components/inserter/media-tab/media-panel.js.map +1 -1
  149. package/build/components/inserter/media-tab/media-preview.js +36 -14
  150. package/build/components/inserter/media-tab/media-preview.js.map +1 -1
  151. package/build/components/inserter/media-tab/media-tab.js.map +1 -1
  152. package/build/components/inserter/media-tab/utils.js.map +1 -1
  153. package/build/components/inserter/menu.js +4 -4
  154. package/build/components/inserter/menu.js.map +1 -1
  155. package/build/components/inserter/mobile-tab-navigation.js +5 -5
  156. package/build/components/inserter/mobile-tab-navigation.js.map +1 -1
  157. package/build/components/inserter/preview-panel.js.map +1 -1
  158. package/build/components/inserter/quick-inserter.js +5 -5
  159. package/build/components/inserter/quick-inserter.js.map +1 -1
  160. package/build/components/inserter/search-results.js +1 -1
  161. package/build/components/inserter/search-results.js.map +1 -1
  162. package/build/components/inserter/tabs.native.js.map +1 -1
  163. package/build/components/inspector-controls/block-support-tools-panel.js.map +1 -1
  164. package/build/components/inspector-controls/fill.js.map +1 -1
  165. package/build/components/inspector-controls/fill.native.js.map +1 -1
  166. package/build/components/inspector-controls/slot.js.map +1 -1
  167. package/build/components/inspector-controls/slot.native.js.map +1 -1
  168. package/build/components/line-height-control/index.js.map +1 -1
  169. package/build/components/link-control/index.js +1 -2
  170. package/build/components/link-control/index.js.map +1 -1
  171. package/build/components/link-control/is-url-like.js.map +1 -1
  172. package/build/components/link-control/search-create-button.js +1 -1
  173. package/build/components/link-control/search-create-button.js.map +1 -1
  174. package/build/components/link-control/search-input.js +3 -5
  175. package/build/components/link-control/search-input.js.map +1 -1
  176. package/build/components/link-control/search-results.js +5 -15
  177. package/build/components/link-control/search-results.js.map +1 -1
  178. package/build/components/link-control/settings-drawer.js.map +1 -1
  179. package/build/components/link-control/use-rich-url-data.js.map +1 -1
  180. package/build/components/list-view/appender.js +1 -1
  181. package/build/components/list-view/appender.js.map +1 -1
  182. package/build/components/list-view/block-contents.js +1 -25
  183. package/build/components/list-view/block-contents.js.map +1 -1
  184. package/build/components/list-view/block-select-button.js.map +1 -1
  185. package/build/components/list-view/block.js.map +1 -1
  186. package/build/components/list-view/branch.js.map +1 -1
  187. package/build/components/list-view/drop-indicator.js.map +1 -1
  188. package/build/components/list-view/index.js.map +1 -1
  189. package/build/components/list-view/use-block-selection.js +2 -2
  190. package/build/components/list-view/use-block-selection.js.map +1 -1
  191. package/build/components/list-view/utils.js +1 -1
  192. package/build/components/list-view/utils.js.map +1 -1
  193. package/build/components/media-placeholder/index.native.js +1 -1
  194. package/build/components/media-placeholder/index.native.js.map +1 -1
  195. package/build/components/media-replace-flow/index.js.map +1 -1
  196. package/build/components/multi-selection-inspector/index.js +2 -2
  197. package/build/components/multi-selection-inspector/index.js.map +1 -1
  198. package/build/components/observe-typing/index.js +1 -0
  199. package/build/components/observe-typing/index.js.map +1 -1
  200. package/build/components/recursion-provider/index.js +1 -0
  201. package/build/components/recursion-provider/index.js.map +1 -1
  202. package/build/components/responsive-block-control/index.js +3 -3
  203. package/build/components/responsive-block-control/index.js.map +1 -1
  204. package/build/components/responsive-block-control/label.js +1 -1
  205. package/build/components/responsive-block-control/label.js.map +1 -1
  206. package/build/components/rich-text/content.js.map +1 -1
  207. package/build/components/rich-text/file-paste-handler.native.js.map +1 -1
  208. package/build/components/rich-text/format-toolbar/index.js.map +1 -1
  209. package/build/components/rich-text/format-toolbar/index.native.js.map +1 -1
  210. package/build/components/rich-text/index.js +3 -2
  211. package/build/components/rich-text/index.js.map +1 -1
  212. package/build/components/rich-text/multiline.js.map +1 -1
  213. package/build/components/rich-text/native/get-format-colors.native.js.map +1 -1
  214. package/build/components/rich-text/native/index.native.js.map +1 -1
  215. package/build/components/rich-text/native/use-format-types.js +1 -0
  216. package/build/components/rich-text/native/use-format-types.js.map +1 -1
  217. package/build/components/rich-text/toolbar-button.js.map +1 -1
  218. package/build/components/rich-text/use-format-types.js +1 -0
  219. package/build/components/rich-text/use-format-types.js.map +1 -1
  220. package/build/components/spacing-sizes-control/input-controls/axial.js.map +1 -1
  221. package/build/components/spacing-sizes-control/input-controls/separated.js.map +1 -1
  222. package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
  223. package/build/components/spacing-sizes-control/utils.js +1 -0
  224. package/build/components/spacing-sizes-control/utils.js.map +1 -1
  225. package/build/components/tool-selector/index.js +13 -8
  226. package/build/components/tool-selector/index.js.map +1 -1
  227. package/build/components/typewriter/index.js +1 -0
  228. package/build/components/typewriter/index.js.map +1 -1
  229. package/build/components/unsupported-block-details/index.native.js.map +1 -1
  230. package/build/components/url-input/index.js +1 -1
  231. package/build/components/url-input/index.js.map +1 -1
  232. package/build/components/use-block-commands/index.js +0 -61
  233. package/build/components/use-block-commands/index.js.map +1 -1
  234. package/build/components/use-block-drop-zone/index.js.map +1 -1
  235. package/build/components/use-flash-editable-blocks/index.js.map +1 -1
  236. package/build/components/use-moving-animation/index.js.map +1 -1
  237. package/build/components/writing-flow/use-tab-nav.js +23 -30
  238. package/build/components/writing-flow/use-tab-nav.js.map +1 -1
  239. package/build/hooks/align.js.map +1 -1
  240. package/build/hooks/block-hooks.js +1 -1
  241. package/build/hooks/block-hooks.js.map +1 -1
  242. package/build/hooks/block-style-variation.js.map +1 -1
  243. package/build/hooks/duotone.js +4 -1
  244. package/build/hooks/duotone.js.map +1 -1
  245. package/build/hooks/font-family.js.map +1 -1
  246. package/build/hooks/gap.js.map +1 -1
  247. package/build/hooks/generated-class-name.js +1 -0
  248. package/build/hooks/generated-class-name.js.map +1 -1
  249. package/build/hooks/layout-child.js +3 -1
  250. package/build/hooks/layout-child.js.map +1 -1
  251. package/build/hooks/layout.js.map +1 -1
  252. package/build/hooks/position.js +4 -3
  253. package/build/hooks/position.js.map +1 -1
  254. package/build/hooks/spacing-visualizer.js.map +1 -1
  255. package/build/hooks/style.js.map +1 -1
  256. package/build/hooks/text-align.js.map +1 -1
  257. package/build/hooks/use-typography-props.js.map +1 -1
  258. package/build/hooks/use-zoom-out.js +24 -16
  259. package/build/hooks/use-zoom-out.js.map +1 -1
  260. package/build/layouts/constrained.js.map +1 -1
  261. package/build/layouts/flex.js.map +1 -1
  262. package/build/layouts/grid.js.map +1 -1
  263. package/build/layouts/utils.js.map +1 -1
  264. package/build/store/actions.js +18 -20
  265. package/build/store/actions.js.map +1 -1
  266. package/build/store/private-actions.js +15 -0
  267. package/build/store/private-actions.js.map +1 -1
  268. package/build/store/private-selectors.js +104 -7
  269. package/build/store/private-selectors.js.map +1 -1
  270. package/build/store/reducer.js +24 -44
  271. package/build/store/reducer.js.map +1 -1
  272. package/build/store/selectors.js +149 -71
  273. package/build/store/selectors.js.map +1 -1
  274. package/build/store/utils.js +4 -3
  275. package/build/store/utils.js.map +1 -1
  276. package/build/utils/block-bindings.js +2 -0
  277. package/build/utils/block-bindings.js.map +1 -1
  278. package/build/utils/get-font-styles-and-weights.js +1 -1
  279. package/build/utils/get-font-styles-and-weights.js.map +1 -1
  280. package/build/utils/object.js +1 -0
  281. package/build/utils/object.js.map +1 -1
  282. package/build/utils/pasting.js.map +1 -1
  283. package/build-module/autocompleters/block.js +1 -3
  284. package/build-module/autocompleters/block.js.map +1 -1
  285. package/build-module/autocompleters/link.js +3 -4
  286. package/build-module/autocompleters/link.js.map +1 -1
  287. package/build-module/components/audio-player/index.native.js +1 -2
  288. package/build-module/components/audio-player/index.native.js.map +1 -1
  289. package/build-module/components/background-image-control/index.js +2 -3
  290. package/build-module/components/background-image-control/index.js.map +1 -1
  291. package/build-module/components/block-actions/index.js +1 -13
  292. package/build-module/components/block-actions/index.js.map +1 -1
  293. package/build-module/components/block-alignment-control/ui.js +1 -2
  294. package/build-module/components/block-alignment-control/ui.js.map +1 -1
  295. package/build-module/components/block-breadcrumb/index.js +1 -2
  296. package/build-module/components/block-breadcrumb/index.js.map +1 -1
  297. package/build-module/components/block-canvas/index.js +1 -2
  298. package/build-module/components/block-canvas/index.js.map +1 -1
  299. package/build-module/components/block-card/index.js +1 -2
  300. package/build-module/components/block-card/index.js.map +1 -1
  301. package/build-module/components/block-compare/block-view.js +1 -2
  302. package/build-module/components/block-compare/block-view.js.map +1 -1
  303. package/build-module/components/block-compare/index.js +1 -2
  304. package/build-module/components/block-compare/index.js.map +1 -1
  305. package/build-module/components/block-controls/fill.js +1 -3
  306. package/build-module/components/block-controls/fill.js.map +1 -1
  307. package/build-module/components/block-controls/slot.js.map +1 -1
  308. package/build-module/components/block-controls/slot.native.js.map +1 -1
  309. package/build-module/components/block-draggable/draggable-chip.js +2 -3
  310. package/build-module/components/block-draggable/draggable-chip.js.map +1 -1
  311. package/build-module/components/block-draggable/draggable-chip.native.js +1 -2
  312. package/build-module/components/block-draggable/draggable-chip.native.js.map +1 -1
  313. package/build-module/components/block-draggable/index.native.js +1 -3
  314. package/build-module/components/block-draggable/index.native.js.map +1 -1
  315. package/build-module/components/block-edit/index.js +1 -2
  316. package/build-module/components/block-edit/index.js.map +1 -1
  317. package/build-module/components/block-edit/multiple-usage-warning.js +1 -2
  318. package/build-module/components/block-edit/multiple-usage-warning.js.map +1 -1
  319. package/build-module/components/block-inspector/index.js +57 -78
  320. package/build-module/components/block-inspector/index.js.map +1 -1
  321. package/build-module/components/block-list/block-crash-warning.js +1 -1
  322. package/build-module/components/block-list/block-crash-warning.js.map +1 -1
  323. package/build-module/components/block-list/block-crash-warning.native.js +1 -1
  324. package/build-module/components/block-list/block-crash-warning.native.js.map +1 -1
  325. package/build-module/components/block-list/block-invalid-warning.js +1 -3
  326. package/build-module/components/block-list/block-invalid-warning.js.map +1 -1
  327. package/build-module/components/block-list/block-invalid-warning.native.js +1 -1
  328. package/build-module/components/block-list/block-invalid-warning.native.js.map +1 -1
  329. package/build-module/components/block-list/block-list-item.native.js +1 -2
  330. package/build-module/components/block-list/block-list-item.native.js.map +1 -1
  331. package/build-module/components/block-list/block-selection-button.native.js +1 -2
  332. package/build-module/components/block-list/block-selection-button.native.js.map +1 -1
  333. package/build-module/components/block-list/block.js +6 -19
  334. package/build-module/components/block-list/block.js.map +1 -1
  335. package/build-module/components/block-list/block.native.js +1 -2
  336. package/build-module/components/block-list/block.native.js.map +1 -1
  337. package/build-module/components/block-list/index.js +7 -10
  338. package/build-module/components/block-list/index.js.map +1 -1
  339. package/build-module/components/block-list/index.native.js +1 -3
  340. package/build-module/components/block-list/index.native.js.map +1 -1
  341. package/build-module/components/block-list/insertion-point.native.js +1 -2
  342. package/build-module/components/block-list/insertion-point.native.js.map +1 -1
  343. package/build-module/components/block-list/use-block-props/index.js +3 -8
  344. package/build-module/components/block-list/use-block-props/index.js.map +1 -1
  345. package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js +14 -6
  346. package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
  347. package/build-module/components/block-list/use-in-between-inserter.js +5 -3
  348. package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
  349. package/build-module/components/block-list/zoom-out-separator.js +24 -13
  350. package/build-module/components/block-list/zoom-out-separator.js.map +1 -1
  351. package/build-module/components/block-lock/menu-item.js +1 -3
  352. package/build-module/components/block-lock/menu-item.js.map +1 -1
  353. package/build-module/components/block-lock/modal.js +2 -3
  354. package/build-module/components/block-lock/modal.js.map +1 -1
  355. package/build-module/components/block-lock/toolbar.js +1 -3
  356. package/build-module/components/block-lock/toolbar.js.map +1 -1
  357. package/build-module/components/block-media-update-progress/index.native.js +1 -2
  358. package/build-module/components/block-media-update-progress/index.native.js.map +1 -1
  359. package/build-module/components/block-mover/button.js +1 -3
  360. package/build-module/components/block-mover/button.js.map +1 -1
  361. package/build-module/components/block-mover/index.js +1 -2
  362. package/build-module/components/block-mover/index.js.map +1 -1
  363. package/build-module/components/block-mover/index.native.js +1 -2
  364. package/build-module/components/block-mover/index.native.js.map +1 -1
  365. package/build-module/components/block-navigation/dropdown.js +3 -6
  366. package/build-module/components/block-navigation/dropdown.js.map +1 -1
  367. package/build-module/components/block-parent-selector/index.js +14 -11
  368. package/build-module/components/block-parent-selector/index.js.map +1 -1
  369. package/build-module/components/block-pattern-setup/index.js +1 -3
  370. package/build-module/components/block-pattern-setup/index.js.map +1 -1
  371. package/build-module/components/block-pattern-setup/setup-toolbar.js +11 -22
  372. package/build-module/components/block-pattern-setup/setup-toolbar.js.map +1 -1
  373. package/build-module/components/block-patterns-list/index.js +1 -3
  374. package/build-module/components/block-patterns-list/index.js.map +1 -1
  375. package/build-module/components/block-patterns-paging/index.js +12 -15
  376. package/build-module/components/block-patterns-paging/index.js.map +1 -1
  377. package/build-module/components/block-popover/index.js +45 -2
  378. package/build-module/components/block-popover/index.js.map +1 -1
  379. package/build-module/components/block-preview/auto.js +2 -7
  380. package/build-module/components/block-preview/auto.js.map +1 -1
  381. package/build-module/components/block-preview/index.js +1 -2
  382. package/build-module/components/block-preview/index.js.map +1 -1
  383. package/build-module/components/block-quick-navigation/index.js +3 -6
  384. package/build-module/components/block-quick-navigation/index.js.map +1 -1
  385. package/build-module/components/block-removal-warning-modal/index.js +1 -2
  386. package/build-module/components/block-removal-warning-modal/index.js.map +1 -1
  387. package/build-module/components/block-rename/modal.js +3 -4
  388. package/build-module/components/block-rename/modal.js.map +1 -1
  389. package/build-module/components/block-rename/rename-control.js +1 -3
  390. package/build-module/components/block-rename/rename-control.js.map +1 -1
  391. package/build-module/components/block-settings/container.native.js +1 -3
  392. package/build-module/components/block-settings/container.native.js.map +1 -1
  393. package/build-module/components/block-settings-menu/block-parent-selector-menu-item.js +1 -1
  394. package/build-module/components/block-settings-menu/block-parent-selector-menu-item.js.map +1 -1
  395. package/build-module/components/block-settings-menu/block-settings-dropdown.js +80 -79
  396. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  397. package/build-module/components/block-settings-menu-controls/index.js +3 -9
  398. package/build-module/components/block-settings-menu-controls/index.js.map +1 -1
  399. package/build-module/components/block-styles/index.js +1 -2
  400. package/build-module/components/block-styles/index.js.map +1 -1
  401. package/build-module/components/block-styles/menu-items.js +1 -2
  402. package/build-module/components/block-styles/menu-items.js.map +1 -1
  403. package/build-module/components/block-styles/preview.native.js +1 -2
  404. package/build-module/components/block-styles/preview.native.js.map +1 -1
  405. package/build-module/components/block-switcher/block-transformations-menu.js +1 -3
  406. package/build-module/components/block-switcher/block-transformations-menu.js.map +1 -1
  407. package/build-module/components/block-switcher/block-transformations-menu.native.js +1 -1
  408. package/build-module/components/block-switcher/block-transformations-menu.native.js.map +1 -1
  409. package/build-module/components/block-switcher/block-variation-transformations.js +1 -3
  410. package/build-module/components/block-switcher/block-variation-transformations.js.map +1 -1
  411. package/build-module/components/block-switcher/index.js +20 -18
  412. package/build-module/components/block-switcher/index.js.map +1 -1
  413. package/build-module/components/block-switcher/pattern-transformations-menu.js +1 -2
  414. package/build-module/components/block-switcher/pattern-transformations-menu.js.map +1 -1
  415. package/build-module/components/block-switcher/preview-block-popover.js +1 -2
  416. package/build-module/components/block-switcher/preview-block-popover.js.map +1 -1
  417. package/build-module/components/block-switcher/use-transformed-patterns.js +1 -0
  418. package/build-module/components/block-switcher/use-transformed-patterns.js.map +1 -1
  419. package/build-module/components/block-switcher/utils.js +1 -0
  420. package/build-module/components/block-switcher/utils.js.map +1 -1
  421. package/build-module/components/block-toolbar/block-toolbar-menu.native.js +1 -2
  422. package/build-module/components/block-toolbar/block-toolbar-menu.native.js.map +1 -1
  423. package/build-module/components/block-toolbar/index.js +17 -22
  424. package/build-module/components/block-toolbar/index.js.map +1 -1
  425. package/build-module/components/block-toolbar/index.native.js +1 -3
  426. package/build-module/components/block-toolbar/index.native.js.map +1 -1
  427. package/build-module/components/block-toolbar/use-has-block-toolbar.js +3 -5
  428. package/build-module/components/block-toolbar/use-has-block-toolbar.js.map +1 -1
  429. package/build-module/components/block-tools/index.js +9 -20
  430. package/build-module/components/block-tools/index.js.map +1 -1
  431. package/build-module/components/block-tools/insertion-point.js +2 -6
  432. package/build-module/components/block-tools/insertion-point.js.map +1 -1
  433. package/build-module/components/block-tools/use-show-block-tools.js +8 -7
  434. package/build-module/components/block-tools/use-show-block-tools.js.map +1 -1
  435. package/build-module/components/block-tools/zoom-out-mode-inserter-button.js +1 -12
  436. package/build-module/components/block-tools/zoom-out-mode-inserter-button.js.map +1 -1
  437. package/build-module/components/block-tools/zoom-out-mode-inserters.js +14 -17
  438. package/build-module/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
  439. package/build-module/components/block-tools/zoom-out-popover.js +2 -1
  440. package/build-module/components/block-tools/zoom-out-popover.js.map +1 -1
  441. package/build-module/components/block-tools/zoom-out-toolbar.js +7 -35
  442. package/build-module/components/block-tools/zoom-out-toolbar.js.map +1 -1
  443. package/build-module/components/block-types-list/index.js +1 -2
  444. package/build-module/components/block-types-list/index.js.map +1 -1
  445. package/build-module/components/block-types-list/index.native.js +1 -2
  446. package/build-module/components/block-types-list/index.native.js.map +1 -1
  447. package/build-module/components/block-variation-picker/index.js +1 -2
  448. package/build-module/components/block-variation-picker/index.js.map +1 -1
  449. package/build-module/components/block-variation-picker/index.native.js +1 -2
  450. package/build-module/components/block-variation-picker/index.native.js.map +1 -1
  451. package/build-module/components/block-variation-transforms/index.js +4 -4
  452. package/build-module/components/block-variation-transforms/index.js.map +1 -1
  453. package/build-module/components/border-radius-control/index.js +1 -3
  454. package/build-module/components/border-radius-control/index.js.map +1 -1
  455. package/build-module/components/border-radius-control/utils.js.map +1 -1
  456. package/build-module/components/button-block-appender/index.js.map +1 -1
  457. package/build-module/components/button-block-appender/index.native.js +1 -2
  458. package/build-module/components/button-block-appender/index.native.js.map +1 -1
  459. package/build-module/components/child-layout-control/index.js +1 -3
  460. package/build-module/components/child-layout-control/index.js.map +1 -1
  461. package/build-module/components/color-style-selector/index.js.map +1 -1
  462. package/build-module/components/colors/utils.js.map +1 -1
  463. package/build-module/components/colors/with-colors.js.map +1 -1
  464. package/build-module/components/colors-gradients/control.js +1 -2
  465. package/build-module/components/colors-gradients/control.js.map +1 -1
  466. package/build-module/components/colors-gradients/dropdown.js +1 -3
  467. package/build-module/components/colors-gradients/dropdown.js.map +1 -1
  468. package/build-module/components/colors-gradients/panel-color-gradient-settings.js +1 -3
  469. package/build-module/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
  470. package/build-module/components/colors-gradients/panel-color-gradient-settings.native.js +1 -3
  471. package/build-module/components/colors-gradients/panel-color-gradient-settings.native.js.map +1 -1
  472. package/build-module/components/contrast-checker/index.native.js +1 -2
  473. package/build-module/components/contrast-checker/index.native.js.map +1 -1
  474. package/build-module/components/convert-to-group-buttons/index.js +1 -3
  475. package/build-module/components/convert-to-group-buttons/index.js.map +1 -1
  476. package/build-module/components/convert-to-group-buttons/toolbar.js +1 -2
  477. package/build-module/components/convert-to-group-buttons/toolbar.js.map +1 -1
  478. package/build-module/components/date-format-picker/index.js +2 -2
  479. package/build-module/components/date-format-picker/index.js.map +1 -1
  480. package/build-module/components/default-block-appender/index.js +1 -2
  481. package/build-module/components/default-block-appender/index.js.map +1 -1
  482. package/build-module/components/dimensions-tool/index.js +1 -3
  483. package/build-module/components/dimensions-tool/index.js.map +1 -1
  484. package/build-module/components/dimensions-tool/width-height-tool.js +1 -3
  485. package/build-module/components/dimensions-tool/width-height-tool.js.map +1 -1
  486. package/build-module/components/duotone/utils.js.map +1 -1
  487. package/build-module/components/duotone-control/index.js +1 -2
  488. package/build-module/components/duotone-control/index.js.map +1 -1
  489. package/build-module/components/editor-styles/index.js +1 -3
  490. package/build-module/components/editor-styles/index.js.map +1 -1
  491. package/build-module/components/floating-toolbar/index.native.js +1 -2
  492. package/build-module/components/floating-toolbar/index.native.js.map +1 -1
  493. package/build-module/components/floating-toolbar/nav-up-icon.js +1 -2
  494. package/build-module/components/floating-toolbar/nav-up-icon.js.map +1 -1
  495. package/build-module/components/font-sizes/fluid-utils.js.map +1 -1
  496. package/build-module/components/font-sizes/utils.js.map +1 -1
  497. package/build-module/components/font-sizes/with-font-sizes.js +2 -2
  498. package/build-module/components/font-sizes/with-font-sizes.js.map +1 -1
  499. package/build-module/components/global-styles/advanced-panel.js +1 -2
  500. package/build-module/components/global-styles/advanced-panel.js.map +1 -1
  501. package/build-module/components/global-styles/border-panel.js +2 -3
  502. package/build-module/components/global-styles/border-panel.js.map +1 -1
  503. package/build-module/components/global-styles/color-panel.js +2 -3
  504. package/build-module/components/global-styles/color-panel.js.map +1 -1
  505. package/build-module/components/global-styles/dimensions-panel.js +2 -3
  506. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  507. package/build-module/components/global-styles/filters-panel.js +1 -2
  508. package/build-module/components/global-styles/filters-panel.js.map +1 -1
  509. package/build-module/components/global-styles/get-block-css-selector.js.map +1 -1
  510. package/build-module/components/global-styles/get-global-styles-changes.js +2 -1
  511. package/build-module/components/global-styles/get-global-styles-changes.js.map +1 -1
  512. package/build-module/components/global-styles/hooks.js.map +1 -1
  513. package/build-module/components/global-styles/image-settings-panel.js +1 -2
  514. package/build-module/components/global-styles/image-settings-panel.js.map +1 -1
  515. package/build-module/components/global-styles/shadow-panel-components.js +1 -2
  516. package/build-module/components/global-styles/shadow-panel-components.js.map +1 -1
  517. package/build-module/components/global-styles/typography-panel.js +1 -2
  518. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  519. package/build-module/components/global-styles/use-global-styles-context.native.js.map +1 -1
  520. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  521. package/build-module/components/global-styles/utils.js.map +1 -1
  522. package/build-module/components/gradients/use-gradient.js.map +1 -1
  523. package/build-module/components/grid/grid-item-movers.js +1 -3
  524. package/build-module/components/grid/grid-item-movers.js.map +1 -1
  525. package/build-module/components/grid/grid-visualizer.js.map +1 -1
  526. package/build-module/components/height-control/index.js +1 -2
  527. package/build-module/components/height-control/index.js.map +1 -1
  528. package/build-module/components/iframe/index.js +45 -12
  529. package/build-module/components/iframe/index.js.map +1 -1
  530. package/build-module/components/image-editor/aspect-ratio-dropdown.js +1 -3
  531. package/build-module/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
  532. package/build-module/components/image-editor/cropper.js +1 -3
  533. package/build-module/components/image-editor/cropper.js.map +1 -1
  534. package/build-module/components/image-editor/form-controls.js +1 -3
  535. package/build-module/components/image-editor/form-controls.js.map +1 -1
  536. package/build-module/components/image-editor/index.js +1 -2
  537. package/build-module/components/image-editor/index.js.map +1 -1
  538. package/build-module/components/image-editor/use-save-image.js +1 -1
  539. package/build-module/components/image-editor/use-save-image.js.map +1 -1
  540. package/build-module/components/image-link-destinations/index.native.js +1 -3
  541. package/build-module/components/image-link-destinations/index.native.js.map +1 -1
  542. package/build-module/components/image-size-control/index.js +1 -3
  543. package/build-module/components/image-size-control/index.js.map +1 -1
  544. package/build-module/components/inner-blocks/index.js +1 -9
  545. package/build-module/components/inner-blocks/index.js.map +1 -1
  546. package/build-module/components/inner-blocks/use-nested-settings-update.js +16 -9
  547. package/build-module/components/inner-blocks/use-nested-settings-update.js.map +1 -1
  548. package/build-module/components/inner-blocks/warning-max-depth-exceeded.native.js +1 -2
  549. package/build-module/components/inner-blocks/warning-max-depth-exceeded.native.js.map +1 -1
  550. package/build-module/components/inserter/block-patterns-explorer/index.js +1 -2
  551. package/build-module/components/inserter/block-patterns-explorer/index.js.map +1 -1
  552. package/build-module/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js +2 -3
  553. package/build-module/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js.map +1 -1
  554. package/build-module/components/inserter/block-patterns-explorer/pattern-list.js +3 -5
  555. package/build-module/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
  556. package/build-module/components/inserter/block-patterns-tab/index.js +1 -3
  557. package/build-module/components/inserter/block-patterns-tab/index.js.map +1 -1
  558. package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js +1 -3
  559. package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
  560. package/build-module/components/inserter/block-patterns-tab/patterns-filter.js +1 -3
  561. package/build-module/components/inserter/block-patterns-tab/patterns-filter.js.map +1 -1
  562. package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js +1 -1
  563. package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
  564. package/build-module/components/inserter/block-types-tab.js +2 -4
  565. package/build-module/components/inserter/block-types-tab.js.map +1 -1
  566. package/build-module/components/inserter/block-types-tab.native.js.map +1 -1
  567. package/build-module/components/inserter/category-tabs/index.js +3 -13
  568. package/build-module/components/inserter/category-tabs/index.js.map +1 -1
  569. package/build-module/components/inserter/hooks/use-block-types-state.js +27 -8
  570. package/build-module/components/inserter/hooks/use-block-types-state.js.map +1 -1
  571. package/build-module/components/inserter/hooks/use-insertion-point.js +22 -12
  572. package/build-module/components/inserter/hooks/use-insertion-point.js.map +1 -1
  573. package/build-module/components/inserter/hooks/use-patterns-state.js +24 -11
  574. package/build-module/components/inserter/hooks/use-patterns-state.js.map +1 -1
  575. package/build-module/components/inserter/index.native.js +1 -3
  576. package/build-module/components/inserter/index.native.js.map +1 -1
  577. package/build-module/components/inserter/media-tab/media-panel.js +1 -2
  578. package/build-module/components/inserter/media-tab/media-panel.js.map +1 -1
  579. package/build-module/components/inserter/media-tab/media-preview.js +37 -17
  580. package/build-module/components/inserter/media-tab/media-preview.js.map +1 -1
  581. package/build-module/components/inserter/media-tab/media-tab.js +1 -3
  582. package/build-module/components/inserter/media-tab/media-tab.js.map +1 -1
  583. package/build-module/components/inserter/media-tab/utils.js.map +1 -1
  584. package/build-module/components/inserter/menu.js +5 -7
  585. package/build-module/components/inserter/menu.js.map +1 -1
  586. package/build-module/components/inserter/menu.native.js +1 -3
  587. package/build-module/components/inserter/menu.native.js.map +1 -1
  588. package/build-module/components/inserter/mobile-tab-navigation.js +7 -8
  589. package/build-module/components/inserter/mobile-tab-navigation.js.map +1 -1
  590. package/build-module/components/inserter/no-results.js +1 -2
  591. package/build-module/components/inserter/no-results.js.map +1 -1
  592. package/build-module/components/inserter/no-results.native.js +1 -2
  593. package/build-module/components/inserter/no-results.native.js.map +1 -1
  594. package/build-module/components/inserter/panel.js +1 -3
  595. package/build-module/components/inserter/panel.js.map +1 -1
  596. package/build-module/components/inserter/preview-panel.js +1 -2
  597. package/build-module/components/inserter/preview-panel.js.map +1 -1
  598. package/build-module/components/inserter/quick-inserter.js +6 -7
  599. package/build-module/components/inserter/quick-inserter.js.map +1 -1
  600. package/build-module/components/inserter/search-results.js +2 -3
  601. package/build-module/components/inserter/search-results.js.map +1 -1
  602. package/build-module/components/inserter/tabs.native.js.map +1 -1
  603. package/build-module/components/inserter-button/index.native.js +1 -2
  604. package/build-module/components/inserter-button/index.native.js.map +1 -1
  605. package/build-module/components/inserter-list-item/index.js +1 -2
  606. package/build-module/components/inserter-list-item/index.js.map +1 -1
  607. package/build-module/components/inserter-listbox/index.js +1 -2
  608. package/build-module/components/inserter-listbox/index.js.map +1 -1
  609. package/build-module/components/inspector-controls/block-support-tools-panel.js.map +1 -1
  610. package/build-module/components/inspector-controls/fill.js.map +1 -1
  611. package/build-module/components/inspector-controls/fill.native.js +1 -3
  612. package/build-module/components/inspector-controls/fill.native.js.map +1 -1
  613. package/build-module/components/inspector-controls/slot.js.map +1 -1
  614. package/build-module/components/inspector-controls/slot.native.js.map +1 -1
  615. package/build-module/components/inspector-controls-tabs/index.js +1 -2
  616. package/build-module/components/inspector-controls-tabs/index.js.map +1 -1
  617. package/build-module/components/inspector-controls-tabs/settings-tab.js +1 -3
  618. package/build-module/components/inspector-controls-tabs/settings-tab.js.map +1 -1
  619. package/build-module/components/inspector-controls-tabs/styles-tab.js +1 -3
  620. package/build-module/components/inspector-controls-tabs/styles-tab.js.map +1 -1
  621. package/build-module/components/inspector-popover-header/index.js +1 -2
  622. package/build-module/components/inspector-popover-header/index.js.map +1 -1
  623. package/build-module/components/line-height-control/index.js.map +1 -1
  624. package/build-module/components/link-control/index.js +2 -5
  625. package/build-module/components/link-control/index.js.map +1 -1
  626. package/build-module/components/link-control/is-url-like.js.map +1 -1
  627. package/build-module/components/link-control/link-preview.js +1 -3
  628. package/build-module/components/link-control/link-preview.js.map +1 -1
  629. package/build-module/components/link-control/search-create-button.js +1 -1
  630. package/build-module/components/link-control/search-create-button.js.map +1 -1
  631. package/build-module/components/link-control/search-input.js +4 -7
  632. package/build-module/components/link-control/search-input.js.map +1 -1
  633. package/build-module/components/link-control/search-results.js +6 -17
  634. package/build-module/components/link-control/search-results.js.map +1 -1
  635. package/build-module/components/link-control/settings-drawer.js +1 -3
  636. package/build-module/components/link-control/settings-drawer.js.map +1 -1
  637. package/build-module/components/link-control/settings.js +1 -2
  638. package/build-module/components/link-control/settings.js.map +1 -1
  639. package/build-module/components/link-control/use-rich-url-data.js.map +1 -1
  640. package/build-module/components/list-view/appender.js +2 -3
  641. package/build-module/components/list-view/appender.js.map +1 -1
  642. package/build-module/components/list-view/block-contents.js +2 -28
  643. package/build-module/components/list-view/block-contents.js.map +1 -1
  644. package/build-module/components/list-view/block-select-button.js +1 -2
  645. package/build-module/components/list-view/block-select-button.js.map +1 -1
  646. package/build-module/components/list-view/block.js +1 -3
  647. package/build-module/components/list-view/block.js.map +1 -1
  648. package/build-module/components/list-view/branch.js +1 -3
  649. package/build-module/components/list-view/branch.js.map +1 -1
  650. package/build-module/components/list-view/drop-indicator.js +1 -2
  651. package/build-module/components/list-view/drop-indicator.js.map +1 -1
  652. package/build-module/components/list-view/index.js +1 -2
  653. package/build-module/components/list-view/index.js.map +1 -1
  654. package/build-module/components/list-view/use-block-selection.js +2 -2
  655. package/build-module/components/list-view/use-block-selection.js.map +1 -1
  656. package/build-module/components/list-view/utils.js +1 -1
  657. package/build-module/components/list-view/utils.js.map +1 -1
  658. package/build-module/components/media-placeholder/index.js +1 -3
  659. package/build-module/components/media-placeholder/index.js.map +1 -1
  660. package/build-module/components/media-placeholder/index.native.js +2 -4
  661. package/build-module/components/media-placeholder/index.native.js.map +1 -1
  662. package/build-module/components/media-replace-flow/index.js +1 -3
  663. package/build-module/components/media-replace-flow/index.js.map +1 -1
  664. package/build-module/components/media-upload/index.native.js +1 -3
  665. package/build-module/components/media-upload/index.native.js.map +1 -1
  666. package/build-module/components/media-upload-progress/index.native.js +1 -2
  667. package/build-module/components/media-upload-progress/index.native.js.map +1 -1
  668. package/build-module/components/multi-selection-inspector/index.js +3 -4
  669. package/build-module/components/multi-selection-inspector/index.js.map +1 -1
  670. package/build-module/components/observe-typing/index.js +1 -0
  671. package/build-module/components/observe-typing/index.js.map +1 -1
  672. package/build-module/components/provider/index.js +1 -2
  673. package/build-module/components/provider/index.js.map +1 -1
  674. package/build-module/components/publish-date-time-picker/index.js +1 -2
  675. package/build-module/components/publish-date-time-picker/index.js.map +1 -1
  676. package/build-module/components/recursion-provider/index.js +1 -0
  677. package/build-module/components/recursion-provider/index.js.map +1 -1
  678. package/build-module/components/responsive-block-control/index.js +4 -5
  679. package/build-module/components/responsive-block-control/index.js.map +1 -1
  680. package/build-module/components/responsive-block-control/label.js +2 -4
  681. package/build-module/components/responsive-block-control/label.js.map +1 -1
  682. package/build-module/components/rich-text/content.js.map +1 -1
  683. package/build-module/components/rich-text/event-listeners/before-input-rules.js +2 -2
  684. package/build-module/components/rich-text/event-listeners/before-input-rules.js.map +1 -1
  685. package/build-module/components/rich-text/event-listeners/delete.js +2 -2
  686. package/build-module/components/rich-text/event-listeners/delete.js.map +1 -1
  687. package/build-module/components/rich-text/event-listeners/enter.js +2 -2
  688. package/build-module/components/rich-text/event-listeners/enter.js.map +1 -1
  689. package/build-module/components/rich-text/event-listeners/firefox-compat.js +2 -2
  690. package/build-module/components/rich-text/event-listeners/firefox-compat.js.map +1 -1
  691. package/build-module/components/rich-text/event-listeners/input-events.js +2 -2
  692. package/build-module/components/rich-text/event-listeners/input-events.js.map +1 -1
  693. package/build-module/components/rich-text/event-listeners/input-rules.js +2 -2
  694. package/build-module/components/rich-text/event-listeners/input-rules.js.map +1 -1
  695. package/build-module/components/rich-text/event-listeners/insert-replacement-text.js +2 -2
  696. package/build-module/components/rich-text/event-listeners/insert-replacement-text.js.map +1 -1
  697. package/build-module/components/rich-text/event-listeners/paste-handler.js +2 -2
  698. package/build-module/components/rich-text/event-listeners/paste-handler.js.map +1 -1
  699. package/build-module/components/rich-text/event-listeners/remove-browser-shortcuts.js +2 -2
  700. package/build-module/components/rich-text/event-listeners/remove-browser-shortcuts.js.map +1 -1
  701. package/build-module/components/rich-text/event-listeners/shortcuts.js +2 -2
  702. package/build-module/components/rich-text/event-listeners/shortcuts.js.map +1 -1
  703. package/build-module/components/rich-text/event-listeners/undo-automatic-change.js +2 -2
  704. package/build-module/components/rich-text/event-listeners/undo-automatic-change.js.map +1 -1
  705. package/build-module/components/rich-text/file-paste-handler.native.js.map +1 -1
  706. package/build-module/components/rich-text/format-toolbar/index.js +1 -3
  707. package/build-module/components/rich-text/format-toolbar/index.js.map +1 -1
  708. package/build-module/components/rich-text/format-toolbar/index.native.js +1 -3
  709. package/build-module/components/rich-text/format-toolbar/index.native.js.map +1 -1
  710. package/build-module/components/rich-text/index.js +4 -5
  711. package/build-module/components/rich-text/index.js.map +1 -1
  712. package/build-module/components/rich-text/index.native.js +1 -3
  713. package/build-module/components/rich-text/index.native.js.map +1 -1
  714. package/build-module/components/rich-text/multiline.js.map +1 -1
  715. package/build-module/components/rich-text/native/get-format-colors.native.js.map +1 -1
  716. package/build-module/components/rich-text/native/index.js +1 -1
  717. package/build-module/components/rich-text/native/index.js.map +1 -1
  718. package/build-module/components/rich-text/native/index.native.js +1 -3
  719. package/build-module/components/rich-text/native/index.native.js.map +1 -1
  720. package/build-module/components/rich-text/native/toolbar-button-with-options.native.js +1 -3
  721. package/build-module/components/rich-text/native/toolbar-button-with-options.native.js.map +1 -1
  722. package/build-module/components/rich-text/native/use-format-types.js +1 -0
  723. package/build-module/components/rich-text/native/use-format-types.js.map +1 -1
  724. package/build-module/components/rich-text/toolbar-button.js.map +1 -1
  725. package/build-module/components/rich-text/use-format-types.js +1 -0
  726. package/build-module/components/rich-text/use-format-types.js.map +1 -1
  727. package/build-module/components/spacing-sizes-control/index.js +1 -2
  728. package/build-module/components/spacing-sizes-control/index.js.map +1 -1
  729. package/build-module/components/spacing-sizes-control/input-controls/axial.js +1 -2
  730. package/build-module/components/spacing-sizes-control/input-controls/axial.js.map +1 -1
  731. package/build-module/components/spacing-sizes-control/input-controls/separated.js +1 -2
  732. package/build-module/components/spacing-sizes-control/input-controls/separated.js.map +1 -1
  733. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js +1 -3
  734. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
  735. package/build-module/components/spacing-sizes-control/utils.js +1 -0
  736. package/build-module/components/spacing-sizes-control/utils.js.map +1 -1
  737. package/build-module/components/tabbed-sidebar/index.js +1 -2
  738. package/build-module/components/tabbed-sidebar/index.js.map +1 -1
  739. package/build-module/components/tool-selector/index.js +14 -11
  740. package/build-module/components/tool-selector/index.js.map +1 -1
  741. package/build-module/components/typewriter/index.js +1 -0
  742. package/build-module/components/typewriter/index.js.map +1 -1
  743. package/build-module/components/unsupported-block-details/index.native.js +1 -2
  744. package/build-module/components/unsupported-block-details/index.native.js.map +1 -1
  745. package/build-module/components/url-input/button.js +1 -2
  746. package/build-module/components/url-input/button.js.map +1 -1
  747. package/build-module/components/url-input/index.js +2 -4
  748. package/build-module/components/url-input/index.js.map +1 -1
  749. package/build-module/components/url-popover/image-url-input-ui.js +1 -3
  750. package/build-module/components/url-popover/image-url-input-ui.js.map +1 -1
  751. package/build-module/components/url-popover/index.js +1 -2
  752. package/build-module/components/url-popover/index.js.map +1 -1
  753. package/build-module/components/url-popover/link-editor.js +1 -2
  754. package/build-module/components/url-popover/link-editor.js.map +1 -1
  755. package/build-module/components/url-popover/link-viewer.js +1 -2
  756. package/build-module/components/url-popover/link-viewer.js.map +1 -1
  757. package/build-module/components/use-block-commands/index.js +1 -62
  758. package/build-module/components/use-block-commands/index.js.map +1 -1
  759. package/build-module/components/use-block-drop-zone/index.js.map +1 -1
  760. package/build-module/components/use-flash-editable-blocks/index.js.map +1 -1
  761. package/build-module/components/use-moving-animation/index.js.map +1 -1
  762. package/build-module/components/video-player/index.native.js +1 -2
  763. package/build-module/components/video-player/index.native.js.map +1 -1
  764. package/build-module/components/warning/index.js +1 -2
  765. package/build-module/components/warning/index.js.map +1 -1
  766. package/build-module/components/warning/index.native.js +1 -2
  767. package/build-module/components/warning/index.native.js.map +1 -1
  768. package/build-module/components/writing-flow/index.js +1 -3
  769. package/build-module/components/writing-flow/index.js.map +1 -1
  770. package/build-module/components/writing-flow/use-tab-nav.js +24 -31
  771. package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
  772. package/build-module/hooks/align.js.map +1 -1
  773. package/build-module/hooks/anchor.js +1 -3
  774. package/build-module/hooks/anchor.js.map +1 -1
  775. package/build-module/hooks/block-bindings.js +1 -3
  776. package/build-module/hooks/block-bindings.js.map +1 -1
  777. package/build-module/hooks/block-hooks.js +2 -3
  778. package/build-module/hooks/block-hooks.js.map +1 -1
  779. package/build-module/hooks/block-style-variation.js +1 -2
  780. package/build-module/hooks/block-style-variation.js.map +1 -1
  781. package/build-module/hooks/dimensions.js +1 -3
  782. package/build-module/hooks/dimensions.js.map +1 -1
  783. package/build-module/hooks/duotone.js +5 -4
  784. package/build-module/hooks/duotone.js.map +1 -1
  785. package/build-module/hooks/font-family.js.map +1 -1
  786. package/build-module/hooks/gap.js.map +1 -1
  787. package/build-module/hooks/generated-class-name.js +1 -0
  788. package/build-module/hooks/generated-class-name.js.map +1 -1
  789. package/build-module/hooks/grid-visualizer.js +1 -3
  790. package/build-module/hooks/grid-visualizer.js.map +1 -1
  791. package/build-module/hooks/layout-child.js +5 -4
  792. package/build-module/hooks/layout-child.js.map +1 -1
  793. package/build-module/hooks/layout.js +1 -3
  794. package/build-module/hooks/layout.js.map +1 -1
  795. package/build-module/hooks/position.js +5 -2
  796. package/build-module/hooks/position.js.map +1 -1
  797. package/build-module/hooks/spacing-visualizer.js.map +1 -1
  798. package/build-module/hooks/style.js +1 -3
  799. package/build-module/hooks/style.js.map +1 -1
  800. package/build-module/hooks/text-align.js.map +1 -1
  801. package/build-module/hooks/typography.native.js +1 -2
  802. package/build-module/hooks/typography.native.js.map +1 -1
  803. package/build-module/hooks/use-bindings-attributes.js +1 -2
  804. package/build-module/hooks/use-bindings-attributes.js.map +1 -1
  805. package/build-module/hooks/use-typography-props.js.map +1 -1
  806. package/build-module/hooks/use-zoom-out.js +24 -17
  807. package/build-module/hooks/use-zoom-out.js.map +1 -1
  808. package/build-module/layouts/constrained.js +1 -3
  809. package/build-module/layouts/constrained.js.map +1 -1
  810. package/build-module/layouts/flex.js +1 -3
  811. package/build-module/layouts/flex.js.map +1 -1
  812. package/build-module/layouts/grid.js +1 -3
  813. package/build-module/layouts/grid.js.map +1 -1
  814. package/build-module/layouts/utils.js.map +1 -1
  815. package/build-module/store/actions.js +17 -18
  816. package/build-module/store/actions.js.map +1 -1
  817. package/build-module/store/private-actions.js +14 -0
  818. package/build-module/store/private-actions.js.map +1 -1
  819. package/build-module/store/private-selectors.js +98 -7
  820. package/build-module/store/private-selectors.js.map +1 -1
  821. package/build-module/store/reducer.js +22 -41
  822. package/build-module/store/reducer.js.map +1 -1
  823. package/build-module/store/selectors.js +150 -70
  824. package/build-module/store/selectors.js.map +1 -1
  825. package/build-module/store/utils.js +3 -2
  826. package/build-module/store/utils.js.map +1 -1
  827. package/build-module/utils/block-bindings.js +2 -0
  828. package/build-module/utils/block-bindings.js.map +1 -1
  829. package/build-module/utils/get-font-styles-and-weights.js +1 -1
  830. package/build-module/utils/get-font-styles-and-weights.js.map +1 -1
  831. package/build-module/utils/get-px-from-css-unit.js +1 -1
  832. package/build-module/utils/get-px-from-css-unit.js.map +1 -1
  833. package/build-module/utils/object.js +1 -0
  834. package/build-module/utils/object.js.map +1 -1
  835. package/build-module/utils/pasting.js.map +1 -1
  836. package/build-style/content-rtl.css +22 -73
  837. package/build-style/content.css +22 -73
  838. package/build-style/default-editor-styles-rtl.css +10 -1
  839. package/build-style/default-editor-styles.css +10 -1
  840. package/build-style/style-rtl.css +48 -165
  841. package/build-style/style.css +48 -165
  842. package/package.json +33 -33
  843. package/src/autocompleters/link.js +2 -1
  844. package/src/components/block-actions/index.js +1 -13
  845. package/src/components/block-canvas/style.scss +0 -1
  846. package/src/components/block-draggable/style.scss +2 -2
  847. package/src/components/block-inspector/index.js +79 -95
  848. package/src/components/block-list/block.js +7 -25
  849. package/src/components/block-list/content.scss +4 -63
  850. package/src/components/block-list/index.js +21 -29
  851. package/src/components/block-list/use-block-props/index.js +2 -8
  852. package/src/components/block-list/use-block-props/use-selected-block-event-handlers.js +25 -4
  853. package/src/components/block-list/use-in-between-inserter.js +5 -2
  854. package/src/components/block-list/zoom-out-separator.js +32 -14
  855. package/src/components/block-navigation/dropdown.js +1 -2
  856. package/src/components/block-parent-selector/index.js +13 -10
  857. package/src/components/block-pattern-setup/setup-toolbar.js +5 -10
  858. package/src/components/block-patterns-paging/index.js +8 -7
  859. package/src/components/block-patterns-paging/style.scss +10 -27
  860. package/src/components/block-popover/index.js +64 -2
  861. package/src/components/block-preview/auto.js +1 -4
  862. package/src/components/block-quick-navigation/index.js +1 -2
  863. package/src/components/block-settings-menu/block-settings-dropdown.js +120 -106
  864. package/src/components/block-settings-menu-controls/index.js +0 -15
  865. package/src/components/block-switcher/index.js +37 -30
  866. package/src/components/block-toolbar/index.js +22 -34
  867. package/src/components/block-toolbar/style.scss +10 -1
  868. package/src/components/block-toolbar/use-has-block-toolbar.js +19 -31
  869. package/src/components/block-tools/index.js +7 -27
  870. package/src/components/block-tools/insertion-point.js +1 -4
  871. package/src/components/block-tools/style.scss +0 -90
  872. package/src/components/block-tools/use-show-block-tools.js +10 -13
  873. package/src/components/block-tools/zoom-out-mode-inserter-button.js +2 -17
  874. package/src/components/block-tools/zoom-out-mode-inserters.js +11 -19
  875. package/src/components/block-tools/zoom-out-popover.js +2 -1
  876. package/src/components/block-tools/zoom-out-toolbar.js +4 -36
  877. package/src/components/font-family/README.md +5 -1
  878. package/src/components/global-styles/border-panel.js +1 -1
  879. package/src/components/global-styles/dimensions-panel.js +1 -1
  880. package/src/components/iframe/content.scss +20 -24
  881. package/src/components/iframe/index.js +56 -12
  882. package/src/components/iframe/style.scss +6 -5
  883. package/src/components/inner-blocks/index.js +1 -16
  884. package/src/components/inner-blocks/use-nested-settings-update.js +16 -10
  885. package/src/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js +1 -1
  886. package/src/components/inserter/block-types-tab.js +1 -1
  887. package/src/components/inserter/category-tabs/index.js +1 -11
  888. package/src/components/inserter/hooks/use-block-types-state.js +34 -14
  889. package/src/components/inserter/hooks/use-insertion-point.js +35 -13
  890. package/src/components/inserter/hooks/use-patterns-state.js +46 -9
  891. package/src/components/inserter/media-tab/media-preview.js +38 -12
  892. package/src/components/inserter/menu.js +4 -4
  893. package/src/components/inserter/mobile-tab-navigation.js +10 -13
  894. package/src/components/inserter/quick-inserter.js +6 -5
  895. package/src/components/inserter/style.scss +1 -69
  896. package/src/components/inspector-controls-tabs/style.scss +2 -6
  897. package/src/components/link-control/index.js +0 -1
  898. package/src/components/link-control/search-input.js +4 -5
  899. package/src/components/link-control/search-results.js +2 -13
  900. package/src/components/link-control/test/index.js +84 -46
  901. package/src/components/list-view/block-contents.js +1 -28
  902. package/src/components/list-view/style.scss +0 -14
  903. package/src/components/media-replace-flow/test/index.js +1 -1
  904. package/src/components/responsive-block-control/style.scss +0 -1
  905. package/src/components/rich-text/style.scss +5 -0
  906. package/src/components/tool-selector/index.js +15 -7
  907. package/src/components/tool-selector/style.scss +5 -0
  908. package/src/components/use-block-commands/index.js +0 -58
  909. package/src/components/writing-flow/use-tab-nav.js +32 -40
  910. package/src/content.scss +0 -1
  911. package/src/hooks/duotone.js +4 -1
  912. package/src/hooks/layout-child.js +4 -1
  913. package/src/hooks/position.js +4 -1
  914. package/src/hooks/use-zoom-out.js +36 -20
  915. package/src/store/actions.js +17 -15
  916. package/src/store/private-actions.js +14 -0
  917. package/src/store/private-selectors.js +120 -16
  918. package/src/store/reducer.js +22 -45
  919. package/src/store/selectors.js +218 -118
  920. package/src/store/test/private-actions.js +15 -0
  921. package/src/store/test/private-selectors.js +41 -1
  922. package/src/store/test/reducer.js +40 -4
  923. package/src/store/test/selectors.js +195 -21
  924. package/src/store/utils.js +4 -2
  925. package/src/style.scss +1 -0
  926. package/src/utils/block-bindings.js +2 -0
  927. package/build/components/block-controls/use-has-block-controls.js +0 -43
  928. package/build/components/block-controls/use-has-block-controls.js.map +0 -1
  929. package/build/components/block-list/use-block-props/use-nav-mode-exit.js +0 -54
  930. package/build/components/block-list/use-block-props/use-nav-mode-exit.js.map +0 -1
  931. package/build/components/block-tools/block-selection-button.js +0 -259
  932. package/build/components/block-tools/block-selection-button.js.map +0 -1
  933. package/build/components/block-tools/block-toolbar-breadcrumb.js +0 -57
  934. package/build/components/block-tools/block-toolbar-breadcrumb.js.map +0 -1
  935. package/build/components/inserter/tabs.js +0 -78
  936. package/build/components/inserter/tabs.js.map +0 -1
  937. package/build-module/components/block-controls/use-has-block-controls.js +0 -34
  938. package/build-module/components/block-controls/use-has-block-controls.js.map +0 -1
  939. package/build-module/components/block-list/use-block-props/use-nav-mode-exit.js +0 -48
  940. package/build-module/components/block-list/use-block-props/use-nav-mode-exit.js.map +0 -1
  941. package/build-module/components/block-tools/block-selection-button.js +0 -254
  942. package/build-module/components/block-tools/block-selection-button.js.map +0 -1
  943. package/build-module/components/block-tools/block-toolbar-breadcrumb.js +0 -49
  944. package/build-module/components/block-tools/block-toolbar-breadcrumb.js.map +0 -1
  945. package/build-module/components/inserter/tabs.js +0 -72
  946. package/build-module/components/inserter/tabs.js.map +0 -1
  947. package/src/components/block-controls/use-has-block-controls.js +0 -35
  948. package/src/components/block-list/use-block-props/use-nav-mode-exit.js +0 -46
  949. package/src/components/block-tools/block-selection-button.js +0 -302
  950. package/src/components/block-tools/block-toolbar-breadcrumb.js +0 -51
  951. package/src/components/inner-blocks/content.scss +0 -13
  952. package/src/components/inserter/tabs.js +0 -78
  953. package/src/components/inserter/test/block-types-tab.native.js +0 -67
@@ -23,9 +23,7 @@ import { useBlockSettings, usePrivateStyleOverride } from './utils';
23
23
  import { default as StylesFiltersPanel } from '../components/global-styles/filters-panel';
24
24
  import { useBlockEditingMode } from '../components/block-editing-mode';
25
25
  import { useBlockElement } from '../components/block-list/use-block-props/use-block-refs';
26
- import { jsx as _jsx } from "react/jsx-runtime";
27
- import { Fragment as _Fragment } from "react/jsx-runtime";
28
- import { jsxs as _jsxs } from "react/jsx-runtime";
26
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
29
27
  const EMPTY_ARRAY = [];
30
28
 
31
29
  // Safari does not always update the duotone filter when the duotone colors
@@ -251,12 +249,15 @@ function useDuotoneStyles({
251
249
  // change in Safari.
252
250
  }, [isValidFilter, blockElement, colors]);
253
251
  }
252
+
253
+ // Used for generating the instance ID
254
+ const DUOTONE_BLOCK_PROPS_REFERENCE = {};
254
255
  function useBlockProps({
255
256
  clientId,
256
257
  name,
257
258
  style
258
259
  }) {
259
- const id = useInstanceId(useBlockProps);
260
+ const id = useInstanceId(DUOTONE_BLOCK_PROPS_REFERENCE);
260
261
  const selector = useMemo(() => {
261
262
  const blockType = getBlockType(name);
262
263
  if (blockType) {
@@ -1 +1 @@
1
- {"version":3,"names":["extend","namesPlugin","getBlockSupport","getBlockType","hasBlockSupport","useInstanceId","addFilter","useMemo","useEffect","BlockControls","InspectorControls","__experimentalDuotoneControl","DuotoneControl","useSettings","getDuotoneFilter","getDuotoneStylesheet","getDuotoneUnsetStylesheet","getBlockCSSSelector","scopeSelector","useBlockSettings","usePrivateStyleOverride","default","StylesFiltersPanel","useBlockEditingMode","useBlockElement","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","EMPTY_ARRAY","isSafari","window","navigator","userAgent","includes","useMultiOriginPresets","presetSetting","defaultSetting","enableDefault","userPresets","themePresets","defaultPresets","getColorsFromDuotonePreset","duotone","duotonePalette","preset","find","slug","colors","undefined","getDuotonePresetFromColors","Array","isArray","duotonePreset","every","val","index","DuotonePanelPure","style","setAttributes","name","duotoneStyle","color","settings","blockEditingMode","colorPalette","enableCustomColors","enableCustomDuotone","disableCustomColors","disableCustomDuotone","length","duotonePresetOrColors","children","group","value","filter","onChange","newDuotone","newStyle","__experimentalShareWithChildBlocks","maybePreset","shareWithChildBlocks","edit","useBlockProps","attributeKeys","hasSupport","addDuotoneAttributes","attributes","Object","assign","type","useDuotoneStyles","clientId","id","filterId","selector","duotoneSelector","attribute","duotoneAttr","isCustom","isPreset","isCSS","selectors","split","selectorsScoped","map","selectorPart","trim","join","isValidFilter","css","__unstableType","assets","blockElement","display","offsetHeight","blockType","duotoneSupport","experimentalDuotone","rootSelector","fallback","filterClass","shouldRender","className"],"sources":["@wordpress/block-editor/src/hooks/duotone.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { extend } from 'colord';\nimport namesPlugin from 'colord/plugins/names';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tgetBlockSupport,\n\tgetBlockType,\n\thasBlockSupport,\n} from '@wordpress/blocks';\nimport { useInstanceId } from '@wordpress/compose';\nimport { addFilter } from '@wordpress/hooks';\nimport { useMemo, useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport {\n\tBlockControls,\n\tInspectorControls,\n\t__experimentalDuotoneControl as DuotoneControl,\n\tuseSettings,\n} from '../components';\nimport {\n\tgetDuotoneFilter,\n\tgetDuotoneStylesheet,\n\tgetDuotoneUnsetStylesheet,\n} from '../components/duotone/utils';\nimport { getBlockCSSSelector } from '../components/global-styles/get-block-css-selector';\nimport { scopeSelector } from '../components/global-styles/utils';\nimport { useBlockSettings, usePrivateStyleOverride } from './utils';\nimport { default as StylesFiltersPanel } from '../components/global-styles/filters-panel';\nimport { useBlockEditingMode } from '../components/block-editing-mode';\nimport { useBlockElement } from '../components/block-list/use-block-props/use-block-refs';\n\nconst EMPTY_ARRAY = [];\n\n// Safari does not always update the duotone filter when the duotone colors\n// are changed. This browser check is later used to force a re-render of the block\n// element to ensure the duotone filter is updated. The check is included at the\n// root of this file as it only needs to be run once per page load.\nconst isSafari =\n\twindow?.navigator.userAgent &&\n\twindow.navigator.userAgent.includes( 'Safari' ) &&\n\t! window.navigator.userAgent.includes( 'Chrome' ) &&\n\t! window.navigator.userAgent.includes( 'Chromium' );\n\nextend( [ namesPlugin ] );\n\nfunction useMultiOriginPresets( { presetSetting, defaultSetting } ) {\n\tconst [ enableDefault, userPresets, themePresets, defaultPresets ] =\n\t\tuseSettings(\n\t\t\tdefaultSetting,\n\t\t\t`${ presetSetting }.custom`,\n\t\t\t`${ presetSetting }.theme`,\n\t\t\t`${ presetSetting }.default`\n\t\t);\n\treturn useMemo(\n\t\t() => [\n\t\t\t...( userPresets || EMPTY_ARRAY ),\n\t\t\t...( themePresets || EMPTY_ARRAY ),\n\t\t\t...( ( enableDefault && defaultPresets ) || EMPTY_ARRAY ),\n\t\t],\n\t\t[ enableDefault, userPresets, themePresets, defaultPresets ]\n\t);\n}\n\nexport function getColorsFromDuotonePreset( duotone, duotonePalette ) {\n\tif ( ! duotone ) {\n\t\treturn;\n\t}\n\tconst preset = duotonePalette?.find( ( { slug } ) => {\n\t\treturn duotone === `var:preset|duotone|${ slug }`;\n\t} );\n\n\treturn preset ? preset.colors : undefined;\n}\n\nexport function getDuotonePresetFromColors( colors, duotonePalette ) {\n\tif ( ! colors || ! Array.isArray( colors ) ) {\n\t\treturn;\n\t}\n\n\tconst preset = duotonePalette?.find( ( duotonePreset ) => {\n\t\treturn duotonePreset?.colors?.every(\n\t\t\t( val, index ) => val === colors[ index ]\n\t\t);\n\t} );\n\n\treturn preset ? `var:preset|duotone|${ preset.slug }` : undefined;\n}\n\nfunction DuotonePanelPure( { style, setAttributes, name } ) {\n\tconst duotoneStyle = style?.color?.duotone;\n\tconst settings = useBlockSettings( name );\n\tconst blockEditingMode = useBlockEditingMode();\n\n\tconst duotonePalette = useMultiOriginPresets( {\n\t\tpresetSetting: 'color.duotone',\n\t\tdefaultSetting: 'color.defaultDuotone',\n\t} );\n\tconst colorPalette = useMultiOriginPresets( {\n\t\tpresetSetting: 'color.palette',\n\t\tdefaultSetting: 'color.defaultPalette',\n\t} );\n\tconst [ enableCustomColors, enableCustomDuotone ] = useSettings(\n\t\t'color.custom',\n\t\t'color.customDuotone'\n\t);\n\tconst disableCustomColors = ! enableCustomColors;\n\tconst disableCustomDuotone =\n\t\t! enableCustomDuotone ||\n\t\t( colorPalette?.length === 0 && disableCustomColors );\n\n\tif ( duotonePalette?.length === 0 && disableCustomDuotone ) {\n\t\treturn null;\n\t}\n\n\tif ( blockEditingMode !== 'default' ) {\n\t\treturn null;\n\t}\n\n\tconst duotonePresetOrColors = ! Array.isArray( duotoneStyle )\n\t\t? getColorsFromDuotonePreset( duotoneStyle, duotonePalette )\n\t\t: duotoneStyle;\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls group=\"filter\">\n\t\t\t\t<StylesFiltersPanel\n\t\t\t\t\tvalue={ { filter: { duotone: duotonePresetOrColors } } }\n\t\t\t\t\tonChange={ ( newDuotone ) => {\n\t\t\t\t\t\tconst newStyle = {\n\t\t\t\t\t\t\t...style,\n\t\t\t\t\t\t\tcolor: {\n\t\t\t\t\t\t\t\t...newDuotone?.filter,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t};\n\t\t\t\t\t\tsetAttributes( { style: newStyle } );\n\t\t\t\t\t} }\n\t\t\t\t\tsettings={ settings }\n\t\t\t\t/>\n\t\t\t</InspectorControls>\n\t\t\t<BlockControls group=\"block\" __experimentalShareWithChildBlocks>\n\t\t\t\t<DuotoneControl\n\t\t\t\t\tduotonePalette={ duotonePalette }\n\t\t\t\t\tcolorPalette={ colorPalette }\n\t\t\t\t\tdisableCustomDuotone={ disableCustomDuotone }\n\t\t\t\t\tdisableCustomColors={ disableCustomColors }\n\t\t\t\t\tvalue={ duotonePresetOrColors }\n\t\t\t\t\tonChange={ ( newDuotone ) => {\n\t\t\t\t\t\tconst maybePreset = getDuotonePresetFromColors(\n\t\t\t\t\t\t\tnewDuotone,\n\t\t\t\t\t\t\tduotonePalette\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tconst newStyle = {\n\t\t\t\t\t\t\t...style,\n\t\t\t\t\t\t\tcolor: {\n\t\t\t\t\t\t\t\t...style?.color,\n\t\t\t\t\t\t\t\tduotone: maybePreset ?? newDuotone, // use preset or fallback to custom colors.\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t};\n\t\t\t\t\t\tsetAttributes( { style: newStyle } );\n\t\t\t\t\t} }\n\t\t\t\t\tsettings={ settings }\n\t\t\t\t/>\n\t\t\t</BlockControls>\n\t\t</>\n\t);\n}\n\nexport default {\n\tshareWithChildBlocks: true,\n\tedit: DuotonePanelPure,\n\tuseBlockProps,\n\tattributeKeys: [ 'style' ],\n\thasSupport( name ) {\n\t\treturn hasBlockSupport( name, 'filter.duotone' );\n\t},\n};\n\n/**\n * Filters registered block settings, extending attributes to include\n * the `duotone` attribute.\n *\n * @param {Object} settings Original block settings.\n *\n * @return {Object} Filtered block settings.\n */\nfunction addDuotoneAttributes( settings ) {\n\t// Previous `color.__experimentalDuotone` support flag is migrated via\n\t// block_type_metadata_settings filter in `lib/block-supports/duotone.php`.\n\tif ( ! hasBlockSupport( settings, 'filter.duotone' ) ) {\n\t\treturn settings;\n\t}\n\n\t// Allow blocks to specify their own attribute definition with default\n\t// values if needed.\n\tif ( ! settings.attributes.style ) {\n\t\tObject.assign( settings.attributes, {\n\t\t\tstyle: {\n\t\t\t\ttype: 'object',\n\t\t\t},\n\t\t} );\n\t}\n\n\treturn settings;\n}\n\nfunction useDuotoneStyles( {\n\tclientId,\n\tid: filterId,\n\tselector: duotoneSelector,\n\tattribute: duotoneAttr,\n} ) {\n\tconst duotonePalette = useMultiOriginPresets( {\n\t\tpresetSetting: 'color.duotone',\n\t\tdefaultSetting: 'color.defaultDuotone',\n\t} );\n\n\t// Possible values for duotone attribute:\n\t// 1. Array of colors - e.g. ['#000000', '#ffffff'].\n\t// 2. Variable for an existing Duotone preset - e.g. 'var:preset|duotone|green-blue' or 'var(--wp--preset--duotone--green-blue)''\n\t// 3. A CSS string - e.g. 'unset' to remove globally applied duotone.\n\tconst isCustom = Array.isArray( duotoneAttr );\n\tconst duotonePreset = isCustom\n\t\t? undefined\n\t\t: getColorsFromDuotonePreset( duotoneAttr, duotonePalette );\n\tconst isPreset = typeof duotoneAttr === 'string' && duotonePreset;\n\tconst isCSS = typeof duotoneAttr === 'string' && ! isPreset;\n\n\t// Match the structure of WP_Duotone_Gutenberg::render_duotone_support() in PHP.\n\tlet colors = null;\n\tif ( isPreset ) {\n\t\t// Array of colors.\n\t\tcolors = duotonePreset;\n\t} else if ( isCSS ) {\n\t\t// CSS filter property string (e.g. 'unset').\n\t\tcolors = duotoneAttr;\n\t} else if ( isCustom ) {\n\t\t// Array of colors.\n\t\tcolors = duotoneAttr;\n\t}\n\n\t// Build the CSS selectors to which the filter will be applied.\n\tconst selectors = duotoneSelector.split( ',' );\n\n\tconst selectorsScoped = selectors.map( ( selectorPart ) => {\n\t\t// Assuming the selector part is a subclass selector (not a tag name)\n\t\t// so we can prepend the filter id class. If we want to support elements\n\t\t// such as `img` or namespaces, we'll need to add a case for that here.\n\t\treturn `.${ filterId }${ selectorPart.trim() }`;\n\t} );\n\n\tconst selector = selectorsScoped.join( ', ' );\n\n\tconst isValidFilter = Array.isArray( colors ) || colors === 'unset';\n\n\tusePrivateStyleOverride(\n\t\tisValidFilter\n\t\t\t? {\n\t\t\t\t\tcss:\n\t\t\t\t\t\tcolors !== 'unset'\n\t\t\t\t\t\t\t? getDuotoneStylesheet( selector, filterId )\n\t\t\t\t\t\t\t: getDuotoneUnsetStylesheet( selector ),\n\t\t\t\t\t__unstableType: 'presets',\n\t\t\t }\n\t\t\t: undefined\n\t);\n\tusePrivateStyleOverride(\n\t\tisValidFilter\n\t\t\t? {\n\t\t\t\t\tassets:\n\t\t\t\t\t\tcolors !== 'unset'\n\t\t\t\t\t\t\t? getDuotoneFilter( filterId, colors )\n\t\t\t\t\t\t\t: '',\n\t\t\t\t\t__unstableType: 'svgs',\n\t\t\t }\n\t\t\t: undefined\n\t);\n\n\tconst blockElement = useBlockElement( clientId );\n\n\tuseEffect( () => {\n\t\tif ( ! isValidFilter ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Safari does not always update the duotone filter when the duotone\n\t\t// colors are changed. When using Safari, force the block element to be\n\t\t// repainted by the browser to ensure any changes are reflected\n\t\t// visually. This logic matches that used on the site frontend in\n\t\t// `block-supports/duotone.php`.\n\t\tif ( blockElement && isSafari ) {\n\t\t\tconst display = blockElement.style.display;\n\t\t\t// Switch to `inline-block` to force a repaint. In the editor,\n\t\t\t// `inline-block` is used instead of `none` to ensure that scroll\n\t\t\t// position is not affected, as `none` results in the editor\n\t\t\t// scrolling to the top of the block.\n\t\t\tblockElement.style.display = 'inline-block';\n\t\t\t// Simply accessing el.offsetHeight flushes layout and style changes\n\t\t\t// in WebKit without having to wait for setTimeout.\n\t\t\t// eslint-disable-next-line no-unused-expressions\n\t\t\tblockElement.offsetHeight;\n\t\t\tblockElement.style.display = display;\n\t\t}\n\t\t// `colors` must be a dependency so this effect runs when the colors\n\t\t// change in Safari.\n\t}, [ isValidFilter, blockElement, colors ] );\n}\n\nfunction useBlockProps( { clientId, name, style } ) {\n\tconst id = useInstanceId( useBlockProps );\n\tconst selector = useMemo( () => {\n\t\tconst blockType = getBlockType( name );\n\n\t\tif ( blockType ) {\n\t\t\t// Backwards compatibility for `supports.color.__experimentalDuotone`\n\t\t\t// is provided via the `block_type_metadata_settings` filter. If\n\t\t\t// `supports.filter.duotone` has not been set and the\n\t\t\t// experimental property has been, the experimental property\n\t\t\t// value is copied into `supports.filter.duotone`.\n\t\t\tconst duotoneSupport = getBlockSupport(\n\t\t\t\tblockType,\n\t\t\t\t'filter.duotone',\n\t\t\t\tfalse\n\t\t\t);\n\t\t\tif ( ! duotoneSupport ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t// If the experimental duotone support was set, that value is\n\t\t\t// to be treated as a selector and requires scoping.\n\t\t\tconst experimentalDuotone = getBlockSupport(\n\t\t\t\tblockType,\n\t\t\t\t'color.__experimentalDuotone',\n\t\t\t\tfalse\n\t\t\t);\n\t\t\tif ( experimentalDuotone ) {\n\t\t\t\tconst rootSelector = getBlockCSSSelector( blockType );\n\t\t\t\treturn typeof experimentalDuotone === 'string'\n\t\t\t\t\t? scopeSelector( rootSelector, experimentalDuotone )\n\t\t\t\t\t: rootSelector;\n\t\t\t}\n\n\t\t\t// Regular filter.duotone support uses filter.duotone selectors with fallbacks.\n\t\t\treturn getBlockCSSSelector( blockType, 'filter.duotone', {\n\t\t\t\tfallback: true,\n\t\t\t} );\n\t\t}\n\t}, [ name ] );\n\n\tconst attribute = style?.color?.duotone;\n\n\tconst filterClass = `wp-duotone-${ id }`;\n\n\tconst shouldRender = selector && attribute;\n\n\tuseDuotoneStyles( {\n\t\tclientId,\n\t\tid: filterClass,\n\t\tselector,\n\t\tattribute,\n\t} );\n\n\treturn {\n\t\tclassName: shouldRender ? filterClass : '',\n\t};\n}\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/editor/duotone/add-attributes',\n\taddDuotoneAttributes\n);\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,MAAM,QAAQ,QAAQ;AAC/B,OAAOC,WAAW,MAAM,sBAAsB;;AAE9C;AACA;AACA;AACA,SACCC,eAAe,EACfC,YAAY,EACZC,eAAe,QACT,mBAAmB;AAC1B,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,SAAS,QAAQ,kB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EtC,IAAKwD,SAAS,EAAG;MAChB;MACA;MACA;MACA;MACA;MACA,MAAMC,cAAc,GAAGrH,eAAe,CACrCoH,SAAS,EACT,gBAAgB,EAChB,KACD,CAAC;MACD,IAAK,CAAEC,cAAc,EAAG;QACvB,OAAO,IAAI;MACZ;;MAEA;MACA;MACA,MAAMC,mBAAmB,GAAGtH,eAAe,CAC1CoH,SAAS,EACT,6BAA6B,EAC7B,KACD,CAAC;MACD,IAAKE,mBAAmB,EAAG;QAC1B,MAAMC,YAAY,GAAGxG,mBAAmB,CAAEqG,SAAU,CAAC;QACrD,OAAO,OAAOE,mBAAmB,KAAK,QAAQ,GAC3CtG,aAAa,CAAEuG,YAAY,EAAED,mBAAoB,CAAC,GAClDC,YAAY;MAChB;;MAEA;MACA,OAAOxG,mBAAmB,CAAEqG,SAAS,EAAE,gBAAgB,EAAE;QACxDI,QAAQ,EAAE;MACX,CAAE,CAAC;IACJ;EACD,CAAC,EAAE,CAAE5D,IAAI,CAAG,CAAC;EAEb,MAAMqC,SAAS,GAAGvC,KAAK,EAAEI,KAAK,EAAEnB,OAAO;EAEvC,MAAM8E,WAAW,GAAI,cAAc5B,EAAI,EAAC;EAExC,MAAM6B,YAAY,GAAG3B,QAAQ,IAAIE,SAAS;EAE1CN,gBAAgB,CAAE;IACjBC,QAAQ;IACRC,EAAE,EAAE4B,WAAW;IACf1B,QAAQ;IACRE;EACD,CAAE,CAAC;EAEH,OAAO;IACN0B,SAAS,EAAED,YAAY,GAAGD,WAAW,GAAG;EACzC,CAAC;AACF;AAEArH,SAAS,CACR,0BAA0B,EAC1B,oCAAoC,EACpCkF,oBACD,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["extend","namesPlugin","getBlockSupport","getBlockType","hasBlockSupport","useInstanceId","addFilter","useMemo","useEffect","BlockControls","InspectorControls","__experimentalDuotoneControl","DuotoneControl","useSettings","getDuotoneFilter","getDuotoneStylesheet","getDuotoneUnsetStylesheet","getBlockCSSSelector","scopeSelector","useBlockSettings","usePrivateStyleOverride","default","StylesFiltersPanel","useBlockEditingMode","useBlockElement","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","EMPTY_ARRAY","isSafari","window","navigator","userAgent","includes","useMultiOriginPresets","presetSetting","defaultSetting","enableDefault","userPresets","themePresets","defaultPresets","getColorsFromDuotonePreset","duotone","duotonePalette","preset","find","slug","colors","undefined","getDuotonePresetFromColors","Array","isArray","duotonePreset","every","val","index","DuotonePanelPure","style","setAttributes","name","duotoneStyle","color","settings","blockEditingMode","colorPalette","enableCustomColors","enableCustomDuotone","disableCustomColors","disableCustomDuotone","length","duotonePresetOrColors","children","group","value","filter","onChange","newDuotone","newStyle","__experimentalShareWithChildBlocks","maybePreset","shareWithChildBlocks","edit","useBlockProps","attributeKeys","hasSupport","addDuotoneAttributes","attributes","Object","assign","type","useDuotoneStyles","clientId","id","filterId","selector","duotoneSelector","attribute","duotoneAttr","isCustom","isPreset","isCSS","selectors","split","selectorsScoped","map","selectorPart","trim","join","isValidFilter","css","__unstableType","assets","blockElement","display","offsetHeight","DUOTONE_BLOCK_PROPS_REFERENCE","blockType","duotoneSupport","experimentalDuotone","rootSelector","fallback","filterClass","shouldRender","className"],"sources":["@wordpress/block-editor/src/hooks/duotone.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { extend } from 'colord';\nimport namesPlugin from 'colord/plugins/names';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tgetBlockSupport,\n\tgetBlockType,\n\thasBlockSupport,\n} from '@wordpress/blocks';\nimport { useInstanceId } from '@wordpress/compose';\nimport { addFilter } from '@wordpress/hooks';\nimport { useMemo, useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport {\n\tBlockControls,\n\tInspectorControls,\n\t__experimentalDuotoneControl as DuotoneControl,\n\tuseSettings,\n} from '../components';\nimport {\n\tgetDuotoneFilter,\n\tgetDuotoneStylesheet,\n\tgetDuotoneUnsetStylesheet,\n} from '../components/duotone/utils';\nimport { getBlockCSSSelector } from '../components/global-styles/get-block-css-selector';\nimport { scopeSelector } from '../components/global-styles/utils';\nimport { useBlockSettings, usePrivateStyleOverride } from './utils';\nimport { default as StylesFiltersPanel } from '../components/global-styles/filters-panel';\nimport { useBlockEditingMode } from '../components/block-editing-mode';\nimport { useBlockElement } from '../components/block-list/use-block-props/use-block-refs';\n\nconst EMPTY_ARRAY = [];\n\n// Safari does not always update the duotone filter when the duotone colors\n// are changed. This browser check is later used to force a re-render of the block\n// element to ensure the duotone filter is updated. The check is included at the\n// root of this file as it only needs to be run once per page load.\nconst isSafari =\n\twindow?.navigator.userAgent &&\n\twindow.navigator.userAgent.includes( 'Safari' ) &&\n\t! window.navigator.userAgent.includes( 'Chrome' ) &&\n\t! window.navigator.userAgent.includes( 'Chromium' );\n\nextend( [ namesPlugin ] );\n\nfunction useMultiOriginPresets( { presetSetting, defaultSetting } ) {\n\tconst [ enableDefault, userPresets, themePresets, defaultPresets ] =\n\t\tuseSettings(\n\t\t\tdefaultSetting,\n\t\t\t`${ presetSetting }.custom`,\n\t\t\t`${ presetSetting }.theme`,\n\t\t\t`${ presetSetting }.default`\n\t\t);\n\treturn useMemo(\n\t\t() => [\n\t\t\t...( userPresets || EMPTY_ARRAY ),\n\t\t\t...( themePresets || EMPTY_ARRAY ),\n\t\t\t...( ( enableDefault && defaultPresets ) || EMPTY_ARRAY ),\n\t\t],\n\t\t[ enableDefault, userPresets, themePresets, defaultPresets ]\n\t);\n}\n\nexport function getColorsFromDuotonePreset( duotone, duotonePalette ) {\n\tif ( ! duotone ) {\n\t\treturn;\n\t}\n\tconst preset = duotonePalette?.find( ( { slug } ) => {\n\t\treturn duotone === `var:preset|duotone|${ slug }`;\n\t} );\n\n\treturn preset ? preset.colors : undefined;\n}\n\nexport function getDuotonePresetFromColors( colors, duotonePalette ) {\n\tif ( ! colors || ! Array.isArray( colors ) ) {\n\t\treturn;\n\t}\n\n\tconst preset = duotonePalette?.find( ( duotonePreset ) => {\n\t\treturn duotonePreset?.colors?.every(\n\t\t\t( val, index ) => val === colors[ index ]\n\t\t);\n\t} );\n\n\treturn preset ? `var:preset|duotone|${ preset.slug }` : undefined;\n}\n\nfunction DuotonePanelPure( { style, setAttributes, name } ) {\n\tconst duotoneStyle = style?.color?.duotone;\n\tconst settings = useBlockSettings( name );\n\tconst blockEditingMode = useBlockEditingMode();\n\n\tconst duotonePalette = useMultiOriginPresets( {\n\t\tpresetSetting: 'color.duotone',\n\t\tdefaultSetting: 'color.defaultDuotone',\n\t} );\n\tconst colorPalette = useMultiOriginPresets( {\n\t\tpresetSetting: 'color.palette',\n\t\tdefaultSetting: 'color.defaultPalette',\n\t} );\n\tconst [ enableCustomColors, enableCustomDuotone ] = useSettings(\n\t\t'color.custom',\n\t\t'color.customDuotone'\n\t);\n\tconst disableCustomColors = ! enableCustomColors;\n\tconst disableCustomDuotone =\n\t\t! enableCustomDuotone ||\n\t\t( colorPalette?.length === 0 && disableCustomColors );\n\n\tif ( duotonePalette?.length === 0 && disableCustomDuotone ) {\n\t\treturn null;\n\t}\n\n\tif ( blockEditingMode !== 'default' ) {\n\t\treturn null;\n\t}\n\n\tconst duotonePresetOrColors = ! Array.isArray( duotoneStyle )\n\t\t? getColorsFromDuotonePreset( duotoneStyle, duotonePalette )\n\t\t: duotoneStyle;\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls group=\"filter\">\n\t\t\t\t<StylesFiltersPanel\n\t\t\t\t\tvalue={ { filter: { duotone: duotonePresetOrColors } } }\n\t\t\t\t\tonChange={ ( newDuotone ) => {\n\t\t\t\t\t\tconst newStyle = {\n\t\t\t\t\t\t\t...style,\n\t\t\t\t\t\t\tcolor: {\n\t\t\t\t\t\t\t\t...newDuotone?.filter,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t};\n\t\t\t\t\t\tsetAttributes( { style: newStyle } );\n\t\t\t\t\t} }\n\t\t\t\t\tsettings={ settings }\n\t\t\t\t/>\n\t\t\t</InspectorControls>\n\t\t\t<BlockControls group=\"block\" __experimentalShareWithChildBlocks>\n\t\t\t\t<DuotoneControl\n\t\t\t\t\tduotonePalette={ duotonePalette }\n\t\t\t\t\tcolorPalette={ colorPalette }\n\t\t\t\t\tdisableCustomDuotone={ disableCustomDuotone }\n\t\t\t\t\tdisableCustomColors={ disableCustomColors }\n\t\t\t\t\tvalue={ duotonePresetOrColors }\n\t\t\t\t\tonChange={ ( newDuotone ) => {\n\t\t\t\t\t\tconst maybePreset = getDuotonePresetFromColors(\n\t\t\t\t\t\t\tnewDuotone,\n\t\t\t\t\t\t\tduotonePalette\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tconst newStyle = {\n\t\t\t\t\t\t\t...style,\n\t\t\t\t\t\t\tcolor: {\n\t\t\t\t\t\t\t\t...style?.color,\n\t\t\t\t\t\t\t\tduotone: maybePreset ?? newDuotone, // use preset or fallback to custom colors.\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t};\n\t\t\t\t\t\tsetAttributes( { style: newStyle } );\n\t\t\t\t\t} }\n\t\t\t\t\tsettings={ settings }\n\t\t\t\t/>\n\t\t\t</BlockControls>\n\t\t</>\n\t);\n}\n\nexport default {\n\tshareWithChildBlocks: true,\n\tedit: DuotonePanelPure,\n\tuseBlockProps,\n\tattributeKeys: [ 'style' ],\n\thasSupport( name ) {\n\t\treturn hasBlockSupport( name, 'filter.duotone' );\n\t},\n};\n\n/**\n * Filters registered block settings, extending attributes to include\n * the `duotone` attribute.\n *\n * @param {Object} settings Original block settings.\n *\n * @return {Object} Filtered block settings.\n */\nfunction addDuotoneAttributes( settings ) {\n\t// Previous `color.__experimentalDuotone` support flag is migrated via\n\t// block_type_metadata_settings filter in `lib/block-supports/duotone.php`.\n\tif ( ! hasBlockSupport( settings, 'filter.duotone' ) ) {\n\t\treturn settings;\n\t}\n\n\t// Allow blocks to specify their own attribute definition with default\n\t// values if needed.\n\tif ( ! settings.attributes.style ) {\n\t\tObject.assign( settings.attributes, {\n\t\t\tstyle: {\n\t\t\t\ttype: 'object',\n\t\t\t},\n\t\t} );\n\t}\n\n\treturn settings;\n}\n\nfunction useDuotoneStyles( {\n\tclientId,\n\tid: filterId,\n\tselector: duotoneSelector,\n\tattribute: duotoneAttr,\n} ) {\n\tconst duotonePalette = useMultiOriginPresets( {\n\t\tpresetSetting: 'color.duotone',\n\t\tdefaultSetting: 'color.defaultDuotone',\n\t} );\n\n\t// Possible values for duotone attribute:\n\t// 1. Array of colors - e.g. ['#000000', '#ffffff'].\n\t// 2. Variable for an existing Duotone preset - e.g. 'var:preset|duotone|green-blue' or 'var(--wp--preset--duotone--green-blue)''\n\t// 3. A CSS string - e.g. 'unset' to remove globally applied duotone.\n\tconst isCustom = Array.isArray( duotoneAttr );\n\tconst duotonePreset = isCustom\n\t\t? undefined\n\t\t: getColorsFromDuotonePreset( duotoneAttr, duotonePalette );\n\tconst isPreset = typeof duotoneAttr === 'string' && duotonePreset;\n\tconst isCSS = typeof duotoneAttr === 'string' && ! isPreset;\n\n\t// Match the structure of WP_Duotone_Gutenberg::render_duotone_support() in PHP.\n\tlet colors = null;\n\tif ( isPreset ) {\n\t\t// Array of colors.\n\t\tcolors = duotonePreset;\n\t} else if ( isCSS ) {\n\t\t// CSS filter property string (e.g. 'unset').\n\t\tcolors = duotoneAttr;\n\t} else if ( isCustom ) {\n\t\t// Array of colors.\n\t\tcolors = duotoneAttr;\n\t}\n\n\t// Build the CSS selectors to which the filter will be applied.\n\tconst selectors = duotoneSelector.split( ',' );\n\n\tconst selectorsScoped = selectors.map( ( selectorPart ) => {\n\t\t// Assuming the selector part is a subclass selector (not a tag name)\n\t\t// so we can prepend the filter id class. If we want to support elements\n\t\t// such as `img` or namespaces, we'll need to add a case for that here.\n\t\treturn `.${ filterId }${ selectorPart.trim() }`;\n\t} );\n\n\tconst selector = selectorsScoped.join( ', ' );\n\n\tconst isValidFilter = Array.isArray( colors ) || colors === 'unset';\n\n\tusePrivateStyleOverride(\n\t\tisValidFilter\n\t\t\t? {\n\t\t\t\t\tcss:\n\t\t\t\t\t\tcolors !== 'unset'\n\t\t\t\t\t\t\t? getDuotoneStylesheet( selector, filterId )\n\t\t\t\t\t\t\t: getDuotoneUnsetStylesheet( selector ),\n\t\t\t\t\t__unstableType: 'presets',\n\t\t\t }\n\t\t\t: undefined\n\t);\n\tusePrivateStyleOverride(\n\t\tisValidFilter\n\t\t\t? {\n\t\t\t\t\tassets:\n\t\t\t\t\t\tcolors !== 'unset'\n\t\t\t\t\t\t\t? getDuotoneFilter( filterId, colors )\n\t\t\t\t\t\t\t: '',\n\t\t\t\t\t__unstableType: 'svgs',\n\t\t\t }\n\t\t\t: undefined\n\t);\n\n\tconst blockElement = useBlockElement( clientId );\n\n\tuseEffect( () => {\n\t\tif ( ! isValidFilter ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Safari does not always update the duotone filter when the duotone\n\t\t// colors are changed. When using Safari, force the block element to be\n\t\t// repainted by the browser to ensure any changes are reflected\n\t\t// visually. This logic matches that used on the site frontend in\n\t\t// `block-supports/duotone.php`.\n\t\tif ( blockElement && isSafari ) {\n\t\t\tconst display = blockElement.style.display;\n\t\t\t// Switch to `inline-block` to force a repaint. In the editor,\n\t\t\t// `inline-block` is used instead of `none` to ensure that scroll\n\t\t\t// position is not affected, as `none` results in the editor\n\t\t\t// scrolling to the top of the block.\n\t\t\tblockElement.style.display = 'inline-block';\n\t\t\t// Simply accessing el.offsetHeight flushes layout and style changes\n\t\t\t// in WebKit without having to wait for setTimeout.\n\t\t\t// eslint-disable-next-line no-unused-expressions\n\t\t\tblockElement.offsetHeight;\n\t\t\tblockElement.style.display = display;\n\t\t}\n\t\t// `colors` must be a dependency so this effect runs when the colors\n\t\t// change in Safari.\n\t}, [ isValidFilter, blockElement, colors ] );\n}\n\n// Used for generating the instance ID\nconst DUOTONE_BLOCK_PROPS_REFERENCE = {};\n\nfunction useBlockProps( { clientId, name, style } ) {\n\tconst id = useInstanceId( DUOTONE_BLOCK_PROPS_REFERENCE );\n\tconst selector = useMemo( () => {\n\t\tconst blockType = getBlockType( name );\n\n\t\tif ( blockType ) {\n\t\t\t// Backwards compatibility for `supports.color.__experimentalDuotone`\n\t\t\t// is provided via the `block_type_metadata_settings` filter. If\n\t\t\t// `supports.filter.duotone` has not been set and the\n\t\t\t// experimental property has been, the experimental property\n\t\t\t// value is copied into `supports.filter.duotone`.\n\t\t\tconst duotoneSupport = getBlockSupport(\n\t\t\t\tblockType,\n\t\t\t\t'filter.duotone',\n\t\t\t\tfalse\n\t\t\t);\n\t\t\tif ( ! duotoneSupport ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t// If the experimental duotone support was set, that value is\n\t\t\t// to be treated as a selector and requires scoping.\n\t\t\tconst experimentalDuotone = getBlockSupport(\n\t\t\t\tblockType,\n\t\t\t\t'color.__experimentalDuotone',\n\t\t\t\tfalse\n\t\t\t);\n\t\t\tif ( experimentalDuotone ) {\n\t\t\t\tconst rootSelector = getBlockCSSSelector( blockType );\n\t\t\t\treturn typeof experimentalDuotone === 'string'\n\t\t\t\t\t? scopeSelector( rootSelector, experimentalDuotone )\n\t\t\t\t\t: rootSelector;\n\t\t\t}\n\n\t\t\t// Regular filter.duotone support uses filter.duotone selectors with fallbacks.\n\t\t\treturn getBlockCSSSelector( blockType, 'filter.duotone', {\n\t\t\t\tfallback: true,\n\t\t\t} );\n\t\t}\n\t}, [ name ] );\n\n\tconst attribute = style?.color?.duotone;\n\n\tconst filterClass = `wp-duotone-${ id }`;\n\n\tconst shouldRender = selector && attribute;\n\n\tuseDuotoneStyles( {\n\t\tclientId,\n\t\tid: filterClass,\n\t\tselector,\n\t\tattribute,\n\t} );\n\n\treturn {\n\t\tclassName: shouldRender ? filterClass : '',\n\t};\n}\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/editor/duotone/add-attributes',\n\taddDuotoneAttributes\n);\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,MAAM,QAAQ,QAAQ;AAC/B,OAAOC,WAAW,MAAM,sBAAsB;;AAE9C;AACA;AACA;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TokenList","privateApis","componentsPrivateApis","shouldSkipSerialization","TYPOGRAPHY_SUPPORT_KEY","unlock","FONT_FAMILY_SUPPORT_KEY","kebabCase","addAttributes","settings","attributes","fontFamily","Object","assign","type","addSaveProps","props","blockType","classes","className","add","newClassName","value","undefined","useBlockProps","name","attributeKeys","hasSupport","resetFontFamily","setAttributes"],"sources":["@wordpress/block-editor/src/hooks/font-family.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\nimport { hasBlockSupport } from '@wordpress/blocks';\nimport TokenList from '@wordpress/token-list';\nimport { privateApis as componentsPrivateApis } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { shouldSkipSerialization } from './utils';\nimport { TYPOGRAPHY_SUPPORT_KEY } from './typography';\nimport { unlock } from '../lock-unlock';\n\nexport const FONT_FAMILY_SUPPORT_KEY = 'typography.__experimentalFontFamily';\nconst { kebabCase } = unlock( componentsPrivateApis );\n\n/**\n * Filters registered block settings, extending attributes to include\n * the `fontFamily` attribute.\n *\n * @param {Object} settings Original block settings\n * @return {Object} Filtered block settings\n */\nfunction addAttributes( settings ) {\n\tif ( ! hasBlockSupport( settings, FONT_FAMILY_SUPPORT_KEY ) ) {\n\t\treturn settings;\n\t}\n\n\t// Allow blocks to specify a default value if needed.\n\tif ( ! settings.attributes.fontFamily ) {\n\t\tObject.assign( settings.attributes, {\n\t\t\tfontFamily: {\n\t\t\t\ttype: 'string',\n\t\t\t},\n\t\t} );\n\t}\n\n\treturn settings;\n}\n\n/**\n * Override props assigned to save component to inject font family.\n *\n * @param {Object} props Additional props applied to save element\n * @param {Object} blockType Block type\n * @param {Object} attributes Block attributes\n * @return {Object} Filtered props applied to save element\n */\nfunction addSaveProps( props, blockType, attributes ) {\n\tif ( ! hasBlockSupport( blockType, FONT_FAMILY_SUPPORT_KEY ) ) {\n\t\treturn props;\n\t}\n\n\tif (\n\t\tshouldSkipSerialization(\n\t\t\tblockType,\n\t\t\tTYPOGRAPHY_SUPPORT_KEY,\n\t\t\t'fontFamily'\n\t\t)\n\t) {\n\t\treturn props;\n\t}\n\n\tif ( ! attributes?.fontFamily ) {\n\t\treturn props;\n\t}\n\n\t// Use TokenList to dedupe classes.\n\tconst classes = new TokenList( props.className );\n\tclasses.add( `has-${ kebabCase( attributes?.fontFamily ) }-font-family` );\n\tconst newClassName = classes.value;\n\tprops.className = newClassName ? newClassName : undefined;\n\n\treturn props;\n}\n\nfunction useBlockProps( { name, fontFamily } ) {\n\treturn addSaveProps( {}, name, { fontFamily } );\n}\n\nexport default {\n\tuseBlockProps,\n\taddSaveProps,\n\tattributeKeys: [ 'fontFamily' ],\n\thasSupport( name ) {\n\t\treturn hasBlockSupport( name, FONT_FAMILY_SUPPORT_KEY );\n\t},\n};\n\n/**\n * Resets the font family block support attribute. This can be used when\n * disabling the font family support controls for a block via a progressive\n * discovery panel.\n *\n * @param {Object} props Block props.\n * @param {Object} props.setAttributes Function to set block's attributes.\n */\nexport function resetFontFamily( { setAttributes } ) {\n\tsetAttributes( { fontFamily: undefined } );\n}\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/fontFamily/addAttribute',\n\taddAttributes\n);\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,kBAAkB;AAC5C,SAASC,eAAe,QAAQ,mBAAmB;AACnD,OAAOC,SAAS,MAAM,uBAAuB;AAC7C,SAASC,WAAW,IAAIC,qBAAqB,QAAQ,uBAAuB;;AAE5E;AACA;AACA;AACA,SAASC,uBAAuB,QAAQ,SAAS;AACjD,SAASC,sBAAsB,QAAQ,cAAc;AACrD,SAASC,MAAM,QAAQ,gBAAgB;AAEvC,OAAO,MAAMC,uBAAuB,GAAG,qCAAqC;AAC5E,MAAM;EAAEC;AAAU,CAAC,GAAGF,MAAM,CAAEH,qBAAsB,CAAC;;AAErD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASM,aAAaA,CAAEC,QAAQ,EAAG;EAClC,IAAK,CAAEV,eAAe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,IAAI,EAAEnB,uBAAwB,CAAC;EACxD;AACD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASsB,eAAeA,CAAE;EAAEC;AAAc,CAAC,EAAG;EACpDA,aAAa,CAAE;IAAElB,UAAU,EAAEY;EAAU,CAAE,CAAC;AAC3C;AAEAzB,SAAS,CACR,0BAA0B,EAC1B,8BAA8B,EAC9BU,aACD,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["addFilter","hasBlockSupport","TokenList","privateApis","componentsPrivateApis","shouldSkipSerialization","TYPOGRAPHY_SUPPORT_KEY","unlock","FONT_FAMILY_SUPPORT_KEY","kebabCase","addAttributes","settings","attributes","fontFamily","Object","assign","type","addSaveProps","props","blockType","classes","className","add","newClassName","value","undefined","useBlockProps","name","attributeKeys","hasSupport","resetFontFamily","setAttributes"],"sources":["@wordpress/block-editor/src/hooks/font-family.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\nimport { hasBlockSupport } from '@wordpress/blocks';\nimport TokenList from '@wordpress/token-list';\nimport { privateApis as componentsPrivateApis } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { shouldSkipSerialization } from './utils';\nimport { TYPOGRAPHY_SUPPORT_KEY } from './typography';\nimport { unlock } from '../lock-unlock';\n\nexport const FONT_FAMILY_SUPPORT_KEY = 'typography.__experimentalFontFamily';\nconst { kebabCase } = unlock( componentsPrivateApis );\n\n/**\n * Filters registered block settings, extending attributes to include\n * the `fontFamily` attribute.\n *\n * @param {Object} settings Original block settings\n * @return {Object} Filtered block settings\n */\nfunction addAttributes( settings ) {\n\tif ( ! hasBlockSupport( settings, FONT_FAMILY_SUPPORT_KEY ) ) {\n\t\treturn settings;\n\t}\n\n\t// Allow blocks to specify a default value if needed.\n\tif ( ! settings.attributes.fontFamily ) {\n\t\tObject.assign( settings.attributes, {\n\t\t\tfontFamily: {\n\t\t\t\ttype: 'string',\n\t\t\t},\n\t\t} );\n\t}\n\n\treturn settings;\n}\n\n/**\n * Override props assigned to save component to inject font family.\n *\n * @param {Object} props Additional props applied to save element\n * @param {Object} blockType Block type\n * @param {Object} attributes Block attributes\n * @return {Object} Filtered props applied to save element\n */\nfunction addSaveProps( props, blockType, attributes ) {\n\tif ( ! hasBlockSupport( blockType, FONT_FAMILY_SUPPORT_KEY ) ) {\n\t\treturn props;\n\t}\n\n\tif (\n\t\tshouldSkipSerialization(\n\t\t\tblockType,\n\t\t\tTYPOGRAPHY_SUPPORT_KEY,\n\t\t\t'fontFamily'\n\t\t)\n\t) {\n\t\treturn props;\n\t}\n\n\tif ( ! attributes?.fontFamily ) {\n\t\treturn props;\n\t}\n\n\t// Use TokenList to dedupe classes.\n\tconst classes = new TokenList( props.className );\n\tclasses.add( `has-${ kebabCase( attributes?.fontFamily ) }-font-family` );\n\tconst newClassName = classes.value;\n\tprops.className = newClassName ? newClassName : undefined;\n\n\treturn props;\n}\n\nfunction useBlockProps( { name, fontFamily } ) {\n\treturn addSaveProps( {}, name, { fontFamily } );\n}\n\nexport default {\n\tuseBlockProps,\n\taddSaveProps,\n\tattributeKeys: [ 'fontFamily' ],\n\thasSupport( name ) {\n\t\treturn hasBlockSupport( name, FONT_FAMILY_SUPPORT_KEY );\n\t},\n};\n\n/**\n * Resets the font family block support attribute. This can be used when\n * disabling the font family support controls for a block via a progressive\n * discovery panel.\n *\n * @param {Object} props Block props.\n * @param {Object} props.setAttributes Function to set block's attributes.\n */\nexport function resetFontFamily( { setAttributes } ) {\n\tsetAttributes( { fontFamily: undefined } );\n}\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/fontFamily/addAttribute',\n\taddAttributes\n);\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,kBAAkB;AAC5C,SAASC,eAAe,QAAQ,mBAAmB;AACnD,OAAOC,SAAS,MAAM,uBAAuB;AAC7C,SAASC,WAAW,IAAIC,qBAAqB,QAAQ,uBAAuB;;AAE5E;AAC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AAS;EAEzD,OAAOP,KAAK;AACb;AAEA,SAASQ,aAAaA,CAAE;EAAEC,IAAI;EAAEd;AAAW,CAAC,EAAG;EAC9C,OAAOI,YAAY,CAAE,CAAC,CAAC,EAAEU,IAAI,EAAE;IAAEd;EAAW,CAAE,CAAC;AAChD;AAEA,eAAe;EACda,aAAa;EACbT,YAAY;EACZW,aAAa,EAAE,CAAE,YAAY,CAAE;EAC/BC,UAAUA,CAAEF,IAAI,EAAG;IAClB,OAAO1B,eAAe,CAAE0B,IAAI,EAAEnB,uBAAwB,CAAC;EACxD;AACD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASsB,eAAeA,CAAE;EAAEC;AAAc,CAAC,EAAG;EACpDA,aAAa,CAAE;IAAElB,UAAU,EAAEY;EAAU,CAAE,CAAC;AAC3C;AAEAzB,SAAS,CACR,0BAA0B,EAC1B,8BAA8B,EAC9BU,aACD,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["getSpacingPresetCssVar","getGapBoxControlValueFromStyle","blockGapValue","isValueString","top","left","getGapCSSValue","defaultValue","blockGapBoxControlValue","row","column"],"sources":["@wordpress/block-editor/src/hooks/gap.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { getSpacingPresetCssVar } from '../components/spacing-sizes-control/utils';\n\n/**\n * Returns a BoxControl object value from a given blockGap style value.\n * The string check is for backwards compatibility before Gutenberg supported\n * split gap values (row and column) and the value was a string n + unit.\n *\n * @param {string? | Object?} blockGapValue A block gap string or axial object value, e.g., '10px' or { top: '10px', left: '10px'}.\n * @return {Object|null} A value to pass to the BoxControl component.\n */\nexport function getGapBoxControlValueFromStyle( blockGapValue ) {\n\tif ( ! blockGapValue ) {\n\t\treturn null;\n\t}\n\n\tconst isValueString = typeof blockGapValue === 'string';\n\treturn {\n\t\ttop: isValueString ? blockGapValue : blockGapValue?.top,\n\t\tleft: isValueString ? blockGapValue : blockGapValue?.left,\n\t};\n}\n\n/**\n * Returns a CSS value for the `gap` property from a given blockGap style.\n *\n * @param {string? | Object?} blockGapValue A block gap string or axial object value, e.g., '10px' or { top: '10px', left: '10px'}.\n * @param {string?} defaultValue A default gap value.\n * @return {string|null} The concatenated gap value (row and column).\n */\nexport function getGapCSSValue( blockGapValue, defaultValue = '0' ) {\n\tconst blockGapBoxControlValue =\n\t\tgetGapBoxControlValueFromStyle( blockGapValue );\n\tif ( ! blockGapBoxControlValue ) {\n\t\treturn null;\n\t}\n\n\tconst row =\n\t\tgetSpacingPresetCssVar( blockGapBoxControlValue?.top ) || defaultValue;\n\tconst column =\n\t\tgetSpacingPresetCssVar( blockGapBoxControlValue?.left ) || defaultValue;\n\n\treturn row === column ? row : `${ row } ${ column }`;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,sBAAsB,QAAQ,2CAA2C;;AAElF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,8BAA8BA,CAAEC,aAAa,EAAG;EAC/D,IAAK,CAAEA,aAAa,EAAG;IACtB,OAAO,IAAI;EACZ;EAEA,MAAMC,aAAa,GAAG,OAAOD,aAAa,KAAK,QAAQ;EACvD,OAAO;IACNE,GAAG,EAAED,aAAa,GAAGD,aAAa,GAAGA,aAAa,EAAEE,GAAG;IACvDC,IAAI,EAAEF,aAAa,GAAGD,aAAa,GAAGA,aAAa,EAAEG;EACtD,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,cAAcA,CAAEJ,aAAa,EAAEK,YAAY,GAAG,GAAG,EAAG;EACnE,MAAMC,uBAAuB,GAC5BP,8BAA8B,CAAEC,aAAc,CAAC;EAChD,IAAK,CAAEM,uBAAuB,EAAG;IAChC,OAAO,IAAI;EACZ;EAEA,MAAMC,GAAG,GACRT,sBAAsB,CAAEQ,uBAAuB,EAAEJ,GAAI,CAAC,IAAIG,YAAY;EACvE,MAAMG,MAAM,GACXV,sBAAsB,CAAEQ,uBAAuB,EAAEH,IAAK,CAAC,IAAIE,YAAY;EAExE,OAAOE,GAAG,KAAKC,MAAM,GAAGD,GAAG,GAAI,GAAGA,GAAK,IAAIC,MAAQ,EAAC;AACrD","ignoreList":[]}
1
+ {"version":3,"names":["getSpacingPresetCssVar","getGapBoxControlValueFromStyle","blockGapValue","isValueString","top","left","getGapCSSValue","defaultValue","blockGapBoxControlValue","row","column"],"sources":["@wordpress/block-editor/src/hooks/gap.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { getSpacingPresetCssVar } from '../components/spacing-sizes-control/utils';\n\n/**\n * Returns a BoxControl object value from a given blockGap style value.\n * The string check is for backwards compatibility before Gutenberg supported\n * split gap values (row and column) and the value was a string n + unit.\n *\n * @param {string? | Object?} blockGapValue A block gap string or axial object value, e.g., '10px' or { top: '10px', left: '10px'}.\n * @return {Object|null} A value to pass to the BoxControl component.\n */\nexport function getGapBoxControlValueFromStyle( blockGapValue ) {\n\tif ( ! blockGapValue ) {\n\t\treturn null;\n\t}\n\n\tconst isValueString = typeof blockGapValue === 'string';\n\treturn {\n\t\ttop: isValueString ? blockGapValue : blockGapValue?.top,\n\t\tleft: isValueString ? blockGapValue : blockGapValue?.left,\n\t};\n}\n\n/**\n * Returns a CSS value for the `gap` property from a given blockGap style.\n *\n * @param {string? | Object?} blockGapValue A block gap string or axial object value, e.g., '10px' or { top: '10px', left: '10px'}.\n * @param {string?} defaultValue A default gap value.\n * @return {string|null} The concatenated gap value (row and column).\n */\nexport function getGapCSSValue( blockGapValue, defaultValue = '0' ) {\n\tconst blockGapBoxControlValue =\n\t\tgetGapBoxControlValueFromStyle( blockGapValue );\n\tif ( ! blockGapBoxControlValue ) {\n\t\treturn null;\n\t}\n\n\tconst row =\n\t\tgetSpacingPresetCssVar( blockGapBoxControlValue?.top ) || defaultValue;\n\tconst column =\n\t\tgetSpacingPresetCssVar( blockGapBoxControlValue?.left ) || defaultValue;\n\n\treturn row === column ? row : `${ row } ${ column }`;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,sBAAsB,QAAQ,2CAA2C;;AAElF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,8BAA8BA,CAAEC,aAAa,EAAG;EAC/D,IAAK,CAAEA,aAAa,EAAG;IACtB,OAAO,IAAI;EACZ;EAEA,MAAMC,aAAa,GAAG,OAAOD,aAAa,KAAK,QAAQ;EACvD,OAAO;IACNE,GAAG,EAAED,aAAa,GAAGD,aAAa,GAAGA,aAAa,EAAEE,GAAG;IACvDC,IAAI,EAAEF,aAAa,GAAGD,aAAa,GAAGA,aAAa,EAAEG;EACtD,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,cAAcA,CAAEJ,aAAa,EAAEK,YAAY,GAAG,GAAG,EAAG;EACnE,MAAMC,uBAAuB,GAC5BP,8BAA8B,CAAEC,aAAc,CAAC;EAChD,IAAK,CAAEM,uBAAuB,EAAG;IAChC,OAAO,IAAI;EACZ;EAEA,MAAMC,GAAG,GACRT,sBAAsB,CAAEQ,uBAAuB,EAAEJ,GAAI,CAAC,IAAIG,YAAY;EACvE,MAAMG,MAAM,GACXV,sBAAsB,CAAEQ,uBAAuB,EAAEH,IAAK,CAAC,IAAIE,YAAY;EAExE,OAAOE,GAAG,KAAKC,MAAM,GAAGD,GAAG,GAAG,GAAIA,GAAG,IAAMC,MAAM,EAAG;AACrD","ignoreList":[]}
@@ -1,3 +1,4 @@
1
+ /* wp:polyfill */
1
2
  /**
2
3
  * WordPress dependencies
3
4
  */
@@ -1 +1 @@
1
- {"version":3,"names":["addFilter","hasBlockSupport","getBlockDefaultClassName","addGeneratedClassName","extraProps","blockType","className","Set","name","split","join","trim"],"sources":["@wordpress/block-editor/src/hooks/generated-class-name.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\nimport { hasBlockSupport, getBlockDefaultClassName } from '@wordpress/blocks';\n\n/**\n * Override props assigned to save component to inject generated className if\n * block supports it. This is only applied if the block's save result is an\n * element and not a markup string.\n *\n * @param {Object} extraProps Additional props applied to save element.\n * @param {Object} blockType Block type.\n *\n * @return {Object} Filtered props applied to save element.\n */\nexport function addGeneratedClassName( extraProps, blockType ) {\n\t// Adding the generated className.\n\tif ( hasBlockSupport( blockType, 'className', true ) ) {\n\t\tif ( typeof extraProps.className === 'string' ) {\n\t\t\t// We have some extra classes and want to add the default classname\n\t\t\t// We use uniq to prevent duplicate classnames.\n\n\t\t\textraProps.className = [\n\t\t\t\t...new Set( [\n\t\t\t\t\tgetBlockDefaultClassName( blockType.name ),\n\t\t\t\t\t...extraProps.className.split( ' ' ),\n\t\t\t\t] ),\n\t\t\t]\n\t\t\t\t.join( ' ' )\n\t\t\t\t.trim();\n\t\t} else {\n\t\t\t// There is no string in the className variable,\n\t\t\t// so we just dump the default name in there.\n\t\t\textraProps.className = getBlockDefaultClassName( blockType.name );\n\t\t}\n\t}\n\treturn extraProps;\n}\n\naddFilter(\n\t'blocks.getSaveContent.extraProps',\n\t'core/generated-class-name/save-props',\n\taddGeneratedClassName\n);\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,kBAAkB;AAC5C,SAASC,eAAe,EAAEC,wBAAwB,QAAQ,mBAAmB;;AAE7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,qBAAqBA,CAAEC,UAAU,EAAEC,SAAS,EAAG;EAC9D;EACA,IAAKJ,eAAe,CAAEI,SAAS,EAAE,WAAW,EAAE,IAAK,CAAC,EAAG;IACtD,IAAK,OAAOD,UAAU,CAACE,SAAS,KAAK,QAAQ,EAAG;MAC/C;MACA;;MAEAF,UAAU,CAACE,SAAS,GAAG,CACtB,GAAG,IAAIC,GAAG,CAAE,CACXL,wBAAwB,CAAEG,SAAS,CAACG,IAAK,CAAC,EAC1C,GAAGJ,UAAU,CAACE,SAAS,CAACG,KAAK,CAAE,GAAI,CAAC,CACnC,CAAC,CACH,CACCC,IAAI,CAAE,GAAI,CAAC,CACXC,IAAI,CAAC,CAAC;IACT,CAAC,MAAM;MACN;MACA;MACAP,UAAU,CAACE,SAAS,GAAGJ,wBAAwB,CAAEG,SAAS,CAACG,IAAK,CAAC;IAClE;EACD;EACA,OAAOJ,UAAU;AAClB;AAEAJ,SAAS,CACR,kCAAkC,EAClC,sCAAsC,EACtCG,qBACD,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["addFilter","hasBlockSupport","getBlockDefaultClassName","addGeneratedClassName","extraProps","blockType","className","Set","name","split","join","trim"],"sources":["@wordpress/block-editor/src/hooks/generated-class-name.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\nimport { hasBlockSupport, getBlockDefaultClassName } from '@wordpress/blocks';\n\n/**\n * Override props assigned to save component to inject generated className if\n * block supports it. This is only applied if the block's save result is an\n * element and not a markup string.\n *\n * @param {Object} extraProps Additional props applied to save element.\n * @param {Object} blockType Block type.\n *\n * @return {Object} Filtered props applied to save element.\n */\nexport function addGeneratedClassName( extraProps, blockType ) {\n\t// Adding the generated className.\n\tif ( hasBlockSupport( blockType, 'className', true ) ) {\n\t\tif ( typeof extraProps.className === 'string' ) {\n\t\t\t// We have some extra classes and want to add the default classname\n\t\t\t// We use uniq to prevent duplicate classnames.\n\n\t\t\textraProps.className = [\n\t\t\t\t...new Set( [\n\t\t\t\t\tgetBlockDefaultClassName( blockType.name ),\n\t\t\t\t\t...extraProps.className.split( ' ' ),\n\t\t\t\t] ),\n\t\t\t]\n\t\t\t\t.join( ' ' )\n\t\t\t\t.trim();\n\t\t} else {\n\t\t\t// There is no string in the className variable,\n\t\t\t// so we just dump the default name in there.\n\t\t\textraProps.className = getBlockDefaultClassName( blockType.name );\n\t\t}\n\t}\n\treturn extraProps;\n}\n\naddFilter(\n\t'blocks.getSaveContent.extraProps',\n\t'core/generated-class-name/save-props',\n\taddGeneratedClassName\n);\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,kBAAkB;AAC5C,SAASC,eAAe,EAAEC,wBAAwB,QAAQ,mBAAmB;;AAE7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,qBAAqBA,CAAEC,UAAU,EAAEC,SAAS,EAAG;EAC9D;EACA,IAAKJ,eAAe,CAAEI,SAAS,EAAE,WAAW,EAAE,IAAK,CAAC,EAAG;IACtD,IAAK,OAAOD,UAAU,CAACE,SAAS,KAAK,QAAQ,EAAG;MAC/C;MACA;;MAEAF,UAAU,CAACE,SAAS,GAAG,CACtB,GAAG,IAAIC,GAAG,CAAE,CACXL,wBAAwB,CAAEG,SAAS,CAACG,IAAK,CAAC,EAC1C,GAAGJ,UAAU,CAACE,SAAS,CAACG,KAAK,CAAE,GAAI,CAAC,CACnC,CAAC,CACH,CACCC,IAAI,CAAE,GAAI,CAAC,CACXC,IAAI,CAAC,CAAC;IACT,CAAC,MAAM;MACN;MACA;MACAP,UAAU,CAACE,SAAS,GAAGJ,wBAAwB,CAAEG,SAAS,CAACG,IAAK,CAAC;IAClE;EACD;EACA,OAAOJ,UAAU;AAClB;AAEAJ,SAAS,CACR,kCAAkC,EAClC,sCAAsC,EACtCG,qBACD,CAAC","ignoreList":[]}
@@ -10,9 +10,7 @@ import { useSelect } from '@wordpress/data';
10
10
  */
11
11
  import { GridVisualizer, useGridLayoutSync } from '../components/grid';
12
12
  import { store as blockEditorStore } from '../store';
13
- import { jsx as _jsx } from "react/jsx-runtime";
14
- import { Fragment as _Fragment } from "react/jsx-runtime";
15
- import { jsxs as _jsxs } from "react/jsx-runtime";
13
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
16
14
  function GridLayoutSync(props) {
17
15
  useGridLayoutSync(props);
18
16
  }
@@ -1 +1 @@
1
- {"version":3,"names":["createHigherOrderComponent","addFilter","useSelect","GridVisualizer","useGridLayoutSync","store","blockEditorStore","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","GridLayoutSync","props","GridTools","clientId","layout","isVisible","select","isBlockSelected","isDraggingBlocks","getTemplateLock","getBlockEditingMode","children","parentLayout","addGridVisualizerToBlockEdit","BlockEdit","attributes","type"],"sources":["@wordpress/block-editor/src/hooks/grid-visualizer.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport { addFilter } from '@wordpress/hooks';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { GridVisualizer, useGridLayoutSync } from '../components/grid';\nimport { store as blockEditorStore } from '../store';\n\nfunction GridLayoutSync( props ) {\n\tuseGridLayoutSync( props );\n}\n\nfunction GridTools( { clientId, layout } ) {\n\tconst isVisible = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tisBlockSelected,\n\t\t\t\tisDraggingBlocks,\n\t\t\t\tgetTemplateLock,\n\t\t\t\tgetBlockEditingMode,\n\t\t\t} = select( blockEditorStore );\n\n\t\t\t// These calls are purposely ordered from least expensive to most expensive.\n\t\t\t// Hides the visualizer in cases where the user is not or cannot interact with it.\n\t\t\tif (\n\t\t\t\t( ! isDraggingBlocks() && ! isBlockSelected( clientId ) ) ||\n\t\t\t\tgetTemplateLock( clientId ) ||\n\t\t\t\tgetBlockEditingMode( clientId ) !== 'default'\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<GridLayoutSync clientId={ clientId } />\n\t\t\t{ isVisible && (\n\t\t\t\t<GridVisualizer clientId={ clientId } parentLayout={ layout } />\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nconst addGridVisualizerToBlockEdit = createHigherOrderComponent(\n\t( BlockEdit ) => ( props ) => {\n\t\tif ( props.attributes.layout?.type !== 'grid' ) {\n\t\t\treturn <BlockEdit key=\"edit\" { ...props } />;\n\t\t}\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<GridTools\n\t\t\t\t\tclientId={ props.clientId }\n\t\t\t\t\tlayout={ props.attributes.layout }\n\t\t\t\t/>\n\t\t\t\t<BlockEdit key=\"edit\" { ...props } />\n\t\t\t</>\n\t\t);\n\t},\n\t'addGridVisualizerToBlockEdit'\n);\n\naddFilter(\n\t'editor.BlockEdit',\n\t'core/editor/grid-visualizer',\n\taddGridVisualizerToBlockEdit\n);\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,0BAA0B,QAAQ,oBAAoB;AAC/D,SAASC,SAAS,QAAQ,kBAAkB;AAC5C,SAASC,SAAS,QAAQ,iBAAiB;;AAE3C;AACA;AACA;AACA,SAASC,cAAc,EAAEC,iBAAiB,QAAQ,oBAAoB;AACtE,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,UAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAErD,SAASC,cAAcA,CAAEC,KAAK,EAAG;EAChCV,iBAAiB,CAAEU,KAAM,CAAC;AAC3B;AAEA,SAASC,SAASA,CAAE;EAAEC,QAAQ;EAAEC;AAAO,CAAC,EAAG;EAC1C,MAAMC,SAAS,GAAGhB,SAAS,CACxBiB,MAAM,IAAM;IACb,MAAM;MACLC,eAAe;MACfC,gBAAgB;MAChBC,eAAe;MACfC;IACD,CAAC,GAAGJ,MAAM,CAAEb,gBAAiB,CAAC;;IAE9B;IACA;IACA,IACG,CAAEe,gBAAgB,CAAC,CAAC,IAAI,CAAED,eAAe,CAAEJ,QAAS,CAAC,IACvDM,eAAe,CAAEN,QAAS,CAAC,IAC3BO,mBAAmB,CAAEP,QAAS,CAAC,KAAK,SAAS,EAC5C;MACD,OAAO,KAAK;IACb;IAEA,OAAO,IAAI;EACZ,CAAC,EACD,CAAEA,QAAQ,CACX,CAAC;EAED,oBACCJ,KAAA,CAAAF,SAAA;IAAAc,QAAA,gBACChB,IAAA,CAACK,cAAc;MAACG,QAAQ,EAAGA;IAAU,CAAE,CAAC,EACtCE,SAAS,iBACVV,IAAA,CAACL,cAAc;MAACa,QAAQ,EAAGA,QAAU;MAACS,YAAY,EAAGR;IAAQ,CAAE,CAC/D;EAAA,CACA,CAAC;AAEL;AAEA,MAAMS,4BAA4B,GAAG1B,0BAA0B,CAC5D2B,SAAS,IAAQb,KAAK,IAAM;EAC7B,IAAKA,KAAK,CAACc,UAAU,CAACX,MAAM,EAAEY,IAAI,KAAK,MAAM,EAAG;IAC/C,oBAAOrB,IAAA,CAACmB,SAAS;MAAA,GAAiBb;IAAK,GAAjB,MAAqB,CAAC;EAC7C;EAEA,oBACCF,KAAA,CAAAF,SAAA;IAAAc,QAAA,gBACChB,IAAA,CAACO,SAAS;MACTC,QAAQ,EAAGF,KAAK,CAACE,QAAU;MAC3BC,MAAM,EAAGH,KAAK,CAACc,UAAU,CAACX;IAAQ,CAClC,CAAC,eACFT,IAAA,CAACmB,SAAS;MAAA,GAAiBb;IAAK,GAAjB,MAAqB,CAAC;EAAA,CACpC,CAAC;AAEL,CAAC,EACD,8BACD,CAAC;AAEDb,SAAS,CACR,kBAAkB,EAClB,6BAA6B,EAC7ByB,4BACD,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["createHigherOrderComponent","addFilter","useSelect","GridVisualizer","useGridLayoutSync","store","blockEditorStore","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","GridLayoutSync","props","GridTools","clientId","layout","isVisible","select","isBlockSelected","isDraggingBlocks","getTemplateLock","getBlockEditingMode","children","parentLayout","addGridVisualizerToBlockEdit","BlockEdit","attributes","type"],"sources":["@wordpress/block-editor/src/hooks/grid-visualizer.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport { addFilter } from '@wordpress/hooks';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { GridVisualizer, useGridLayoutSync } from '../components/grid';\nimport { store as blockEditorStore } from '../store';\n\nfunction GridLayoutSync( props ) {\n\tuseGridLayoutSync( props );\n}\n\nfunction GridTools( { clientId, layout } ) {\n\tconst isVisible = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tisBlockSelected,\n\t\t\t\tisDraggingBlocks,\n\t\t\t\tgetTemplateLock,\n\t\t\t\tgetBlockEditingMode,\n\t\t\t} = select( blockEditorStore );\n\n\t\t\t// These calls are purposely ordered from least expensive to most expensive.\n\t\t\t// Hides the visualizer in cases where the user is not or cannot interact with it.\n\t\t\tif (\n\t\t\t\t( ! isDraggingBlocks() && ! isBlockSelected( clientId ) ) ||\n\t\t\t\tgetTemplateLock( clientId ) ||\n\t\t\t\tgetBlockEditingMode( clientId ) !== 'default'\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<GridLayoutSync clientId={ clientId } />\n\t\t\t{ isVisible && (\n\t\t\t\t<GridVisualizer clientId={ clientId } parentLayout={ layout } />\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nconst addGridVisualizerToBlockEdit = createHigherOrderComponent(\n\t( BlockEdit ) => ( props ) => {\n\t\tif ( props.attributes.layout?.type !== 'grid' ) {\n\t\t\treturn <BlockEdit key=\"edit\" { ...props } />;\n\t\t}\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<GridTools\n\t\t\t\t\tclientId={ props.clientId }\n\t\t\t\t\tlayout={ props.attributes.layout }\n\t\t\t\t/>\n\t\t\t\t<BlockEdit key=\"edit\" { ...props } />\n\t\t\t</>\n\t\t);\n\t},\n\t'addGridVisualizerToBlockEdit'\n);\n\naddFilter(\n\t'editor.BlockEdit',\n\t'core/editor/grid-visualizer',\n\taddGridVisualizerToBlockEdit\n);\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,0BAA0B,QAAQ,oBAAoB;AAC/D,SAASC,SAAS,QAAQ,kBAAk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b;IAAK,GAAjB,MAAqB,CAAC;EAC7C;EAEA,oBACCF,KAAA,CAAAF,SAAA;IAAAc,QAAA,gBACChB,IAAA,CAACO,SAAS;MACTC,QAAQ,EAAGF,KAAK,CAACE,QAAU;MAC3BC,MAAM,EAAGH,KAAK,CAACc,UAAU,CAACX;IAAQ,CAClC,CAAC,eACFT,IAAA,CAACmB,SAAS;MAAA,GAAiBb;IAAK,GAAjB,MAAqB,CAAC;EAAA,CACpC,CAAC;AAEL,CAAC,EACD,8BACD,CAAC;AAEDb,SAAS,CACR,kBAAkB,EAClB,6BAA6B,EAC7ByB,4BACD,CAAC","ignoreList":[]}
@@ -12,9 +12,10 @@ import { store as blockEditorStore } from '../store';
12
12
  import { useStyleOverride } from './utils';
13
13
  import { useLayout } from '../components/block-list/layout';
14
14
  import { GridVisualizer, GridItemResizer, GridItemMovers } from '../components/grid';
15
- import { jsx as _jsx } from "react/jsx-runtime";
16
- import { Fragment as _Fragment } from "react/jsx-runtime";
17
- import { jsxs as _jsxs } from "react/jsx-runtime";
15
+
16
+ // Used for generating the instance ID
17
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
18
+ const LAYOUT_CHILD_BLOCK_PROPS_REFERENCE = {};
18
19
  function useBlockPropsChildLayoutStyles({
19
20
  style
20
21
  }) {
@@ -36,7 +37,7 @@ function useBlockPropsChildLayoutStyles({
36
37
  columnCount,
37
38
  minimumColumnWidth
38
39
  } = parentLayout;
39
- const id = useInstanceId(useBlockPropsChildLayoutStyles);
40
+ const id = useInstanceId(LAYOUT_CHILD_BLOCK_PROPS_REFERENCE);
40
41
  const selector = `.wp-container-content-${id}`;
41
42
 
42
43
  // Check that the grid layout attributes are of the correct type, so that we don't accidentally
@@ -1 +1 @@
1
- {"version":3,"names":["useInstanceId","useSelect","useState","store","blockEditorStore","useStyleOverride","useLayout","GridVisualizer","GridItemResizer","GridItemMovers","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","useBlockPropsChildLayoutStyles","style","_style$layout","shouldRenderChildLayoutStyles","select","getSettings","disableLayoutStyles","layout","selfStretch","flexSize","columnStart","rowStart","columnSpan","rowSpan","parentLayout","columnCount","minimumColumnWidth","id","selector","process","env","NODE_ENV","Error","css","parentColumnValue","parseFloat","isNaN","parentColumnUnit","replace","includes","numColsToBreakAt","defaultGapValue","containerQueryValue","minimumContainerQueryValue","gridColumnValue","Math","max","className","ChildLayoutControlsPure","clientId","setAttributes","type","parentLayoutType","allowSizingOnChildren","isManualPlacement","GridTools","rootClientId","isVisible","getBlockRootClientId","getBlockEditingMode","getTemplateLock","_rootClientId","resizerBounds","setResizerBounds","updateLayout","children","contentRef","bounds","onChange","window","__experimentalEnableGridInteractivity","gridClientId","blockClientId","useBlockProps","edit","attributeKeys","hasSupport"],"sources":["@wordpress/block-editor/src/hooks/layout-child.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { useSelect } from '@wordpress/data';\nimport { useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../store';\nimport { useStyleOverride } from './utils';\nimport { useLayout } from '../components/block-list/layout';\nimport {\n\tGridVisualizer,\n\tGridItemResizer,\n\tGridItemMovers,\n} from '../components/grid';\n\nfunction useBlockPropsChildLayoutStyles( { style } ) {\n\tconst shouldRenderChildLayoutStyles = useSelect( ( select ) => {\n\t\treturn ! select( blockEditorStore ).getSettings().disableLayoutStyles;\n\t} );\n\tconst layout = style?.layout ?? {};\n\tconst {\n\t\tselfStretch,\n\t\tflexSize,\n\t\tcolumnStart,\n\t\trowStart,\n\t\tcolumnSpan,\n\t\trowSpan,\n\t} = layout;\n\tconst parentLayout = useLayout() || {};\n\tconst { columnCount, minimumColumnWidth } = parentLayout;\n\tconst id = useInstanceId( useBlockPropsChildLayoutStyles );\n\tconst selector = `.wp-container-content-${ id }`;\n\n\t// Check that the grid layout attributes are of the correct type, so that we don't accidentally\n\t// write code that stores a string attribute instead of a number.\n\tif ( process.env.NODE_ENV === 'development' ) {\n\t\tif ( columnStart && typeof columnStart !== 'number' ) {\n\t\t\tthrow new Error( 'columnStart must be a number' );\n\t\t}\n\t\tif ( rowStart && typeof rowStart !== 'number' ) {\n\t\t\tthrow new Error( 'rowStart must be a number' );\n\t\t}\n\t\tif ( columnSpan && typeof columnSpan !== 'number' ) {\n\t\t\tthrow new Error( 'columnSpan must be a number' );\n\t\t}\n\t\tif ( rowSpan && typeof rowSpan !== 'number' ) {\n\t\t\tthrow new Error( 'rowSpan must be a number' );\n\t\t}\n\t}\n\n\tlet css = '';\n\tif ( shouldRenderChildLayoutStyles ) {\n\t\tif ( selfStretch === 'fixed' && flexSize ) {\n\t\t\tcss = `${ selector } {\n\t\t\t\tflex-basis: ${ flexSize };\n\t\t\t\tbox-sizing: border-box;\n\t\t\t}`;\n\t\t} else if ( selfStretch === 'fill' ) {\n\t\t\tcss = `${ selector } {\n\t\t\t\tflex-grow: 1;\n\t\t\t}`;\n\t\t} else if ( columnStart && columnSpan ) {\n\t\t\tcss = `${ selector } {\n\t\t\t\tgrid-column: ${ columnStart } / span ${ columnSpan };\n\t\t\t}`;\n\t\t} else if ( columnStart ) {\n\t\t\tcss = `${ selector } {\n\t\t\t\tgrid-column: ${ columnStart };\n\t\t\t}`;\n\t\t} else if ( columnSpan ) {\n\t\t\tcss = `${ selector } {\n\t\t\t\tgrid-column: span ${ columnSpan };\n\t\t\t}`;\n\t\t}\n\t\tif ( rowStart && rowSpan ) {\n\t\t\tcss += `${ selector } {\n\t\t\t\tgrid-row: ${ rowStart } / span ${ rowSpan };\n\t\t\t}`;\n\t\t} else if ( rowStart ) {\n\t\t\tcss += `${ selector } {\n\t\t\t\tgrid-row: ${ rowStart };\n\t\t\t}`;\n\t\t} else if ( rowSpan ) {\n\t\t\tcss += `${ selector } {\n\t\t\t\tgrid-row: span ${ rowSpan };\n\t\t\t}`;\n\t\t}\n\t\t/**\n\t\t * If minimumColumnWidth is set on the parent, or if no\n\t\t * columnCount is set, the grid is responsive so a\n\t\t * container query is needed for the span to resize.\n\t\t */\n\t\tif (\n\t\t\t( columnSpan || columnStart ) &&\n\t\t\t( minimumColumnWidth || ! columnCount )\n\t\t) {\n\t\t\tlet parentColumnValue = parseFloat( minimumColumnWidth );\n\t\t\t/**\n\t\t\t * 12rem is the default minimumColumnWidth value.\n\t\t\t * If parentColumnValue is not a number, default to 12.\n\t\t\t */\n\t\t\tif ( isNaN( parentColumnValue ) ) {\n\t\t\t\tparentColumnValue = 12;\n\t\t\t}\n\n\t\t\tlet parentColumnUnit = minimumColumnWidth?.replace(\n\t\t\t\tparentColumnValue,\n\t\t\t\t''\n\t\t\t);\n\t\t\t/**\n\t\t\t * Check that parent column unit is either 'px', 'rem' or 'em'.\n\t\t\t * If not, default to 'rem'.\n\t\t\t */\n\t\t\tif ( ! [ 'px', 'rem', 'em' ].includes( parentColumnUnit ) ) {\n\t\t\t\tparentColumnUnit = 'rem';\n\t\t\t}\n\n\t\t\tlet numColsToBreakAt = 2;\n\n\t\t\tif ( columnSpan && columnStart ) {\n\t\t\t\tnumColsToBreakAt = columnSpan + columnStart - 1;\n\t\t\t} else if ( columnSpan ) {\n\t\t\t\tnumColsToBreakAt = columnSpan;\n\t\t\t} else {\n\t\t\t\tnumColsToBreakAt = columnStart;\n\t\t\t}\n\n\t\t\tconst defaultGapValue = parentColumnUnit === 'px' ? 24 : 1.5;\n\t\t\tconst containerQueryValue =\n\t\t\t\tnumColsToBreakAt * parentColumnValue +\n\t\t\t\t( numColsToBreakAt - 1 ) * defaultGapValue;\n\t\t\t// For blocks that only span one column, we want to remove any rowStart values as\n\t\t\t// the container reduces in size, so that blocks are still arranged in markup order.\n\t\t\tconst minimumContainerQueryValue =\n\t\t\t\tparentColumnValue * 2 + defaultGapValue - 1;\n\t\t\t// If a span is set we want to preserve it as long as possible, otherwise we just reset the value.\n\t\t\tconst gridColumnValue =\n\t\t\t\tcolumnSpan && columnSpan > 1 ? '1/-1' : 'auto';\n\n\t\t\tcss += `@container (max-width: ${ Math.max(\n\t\t\t\tcontainerQueryValue,\n\t\t\t\tminimumContainerQueryValue\n\t\t\t) }${ parentColumnUnit }) {\n\t\t\t\t${ selector } {\n\t\t\t\t\tgrid-column: ${ gridColumnValue };\n\t\t\t\t\tgrid-row: auto;\n\t\t\t\t}\n\t\t\t}`;\n\t\t}\n\t}\n\n\tuseStyleOverride( { css } );\n\n\t// Only attach a container class if there is generated CSS to be attached.\n\tif ( ! css ) {\n\t\treturn;\n\t}\n\n\t// Attach a `wp-container-content` id-based classname.\n\treturn { className: `wp-container-content-${ id }` };\n}\n\nfunction ChildLayoutControlsPure( { clientId, style, setAttributes } ) {\n\tconst parentLayout = useLayout() || {};\n\tconst {\n\t\ttype: parentLayoutType = 'default',\n\t\tallowSizingOnChildren = false,\n\t\tisManualPlacement,\n\t} = parentLayout;\n\n\tif ( parentLayoutType !== 'grid' ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<GridTools\n\t\t\tclientId={ clientId }\n\t\t\tstyle={ style }\n\t\t\tsetAttributes={ setAttributes }\n\t\t\tallowSizingOnChildren={ allowSizingOnChildren }\n\t\t\tisManualPlacement={ isManualPlacement }\n\t\t\tparentLayout={ parentLayout }\n\t\t/>\n\t);\n}\n\nfunction GridTools( {\n\tclientId,\n\tstyle,\n\tsetAttributes,\n\tallowSizingOnChildren,\n\tisManualPlacement,\n\tparentLayout,\n} ) {\n\tconst { rootClientId, isVisible } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockRootClientId,\n\t\t\t\tgetBlockEditingMode,\n\t\t\t\tgetTemplateLock,\n\t\t\t} = select( blockEditorStore );\n\n\t\t\tconst _rootClientId = getBlockRootClientId( clientId );\n\n\t\t\tif (\n\t\t\t\tgetTemplateLock( _rootClientId ) ||\n\t\t\t\tgetBlockEditingMode( _rootClientId ) !== 'default'\n\t\t\t) {\n\t\t\t\treturn {\n\t\t\t\t\trootClientId: _rootClientId,\n\t\t\t\t\tisVisible: false,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\trootClientId: _rootClientId,\n\t\t\t\tisVisible: true,\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\t// Use useState() instead of useRef() so that GridItemResizer updates when ref is set.\n\tconst [ resizerBounds, setResizerBounds ] = useState();\n\n\tif ( ! isVisible ) {\n\t\treturn null;\n\t}\n\n\tfunction updateLayout( layout ) {\n\t\tsetAttributes( {\n\t\t\tstyle: {\n\t\t\t\t...style,\n\t\t\t\tlayout: {\n\t\t\t\t\t...style?.layout,\n\t\t\t\t\t...layout,\n\t\t\t\t},\n\t\t\t},\n\t\t} );\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<GridVisualizer\n\t\t\t\tclientId={ rootClientId }\n\t\t\t\tcontentRef={ setResizerBounds }\n\t\t\t\tparentLayout={ parentLayout }\n\t\t\t/>\n\t\t\t{ allowSizingOnChildren && (\n\t\t\t\t<GridItemResizer\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t// Don't allow resizing beyond the grid visualizer.\n\t\t\t\t\tbounds={ resizerBounds }\n\t\t\t\t\tonChange={ updateLayout }\n\t\t\t\t\tparentLayout={ parentLayout }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ isManualPlacement &&\n\t\t\t\twindow.__experimentalEnableGridInteractivity && (\n\t\t\t\t\t<GridItemMovers\n\t\t\t\t\t\tlayout={ style?.layout }\n\t\t\t\t\t\tparentLayout={ parentLayout }\n\t\t\t\t\t\tonChange={ updateLayout }\n\t\t\t\t\t\tgridClientId={ rootClientId }\n\t\t\t\t\t\tblockClientId={ clientId }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default {\n\tuseBlockProps: useBlockPropsChildLayoutStyles,\n\tedit: ChildLayoutControlsPure,\n\tattributeKeys: [ 'style' ],\n\thasSupport() {\n\t\treturn true;\n\t},\n};\n"],"mappings":"AAAA;AACA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EAC7CgE,IAAI,EAAE1B,uBAAuB;EAC7B2B,aAAa,EAAE,CAAE,OAAO,CAAE;EAC1BC,UAAUA,CAAA,EAAG;IACZ,OAAO,IAAI;EACZ;AACD,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["useInstanceId","useSelect","useState","store","blockEditorStore","useStyleOverride","useLayout","GridVisualizer","GridItemResizer","GridItemMovers","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","LAYOUT_CHILD_BLOCK_PROPS_REFERENCE","useBlockPropsChildLayoutStyles","style","_style$layout","shouldRenderChildLayoutStyles","select","getSettings","disableLayoutStyles","layout","selfStretch","flexSize","columnStart","rowStart","columnSpan","rowSpan","parentLayout","columnCount","minimumColumnWidth","id","selector","process","env","NODE_ENV","Error","css","parentColumnValue","parseFloat","isNaN","parentColumnUnit","replace","includes","numColsToBreakAt","defaultGapValue","containerQueryValue","minimumContainerQueryValue","gridColumnValue","Math","max","className","ChildLayoutControlsPure","clientId","setAttributes","type","parentLayoutType","allowSizingOnChildren","isManualPlacement","GridTools","rootClientId","isVisible","getBlockRootClientId","getBlockEditingMode","getTemplateLock","_rootClientId","resizerBounds","setResizerBounds","updateLayout","children","contentRef","bounds","onChange","window","__experimentalEnableGridInteractivity","gridClientId","blockClientId","useBlockProps","edit","attributeKeys","hasSupport"],"sources":["@wordpress/block-editor/src/hooks/layout-child.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { useSelect } from '@wordpress/data';\nimport { useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../store';\nimport { useStyleOverride } from './utils';\nimport { useLayout } from '../components/block-list/layout';\nimport {\n\tGridVisualizer,\n\tGridItemResizer,\n\tGridItemMovers,\n} from '../components/grid';\n\n// Used for generating the instance ID\nconst LAYOUT_CHILD_BLOCK_PROPS_REFERENCE = {};\n\nfunction useBlockPropsChildLayoutStyles( { style } ) {\n\tconst shouldRenderChildLayoutStyles = useSelect( ( select ) => {\n\t\treturn ! select( blockEditorStore ).getSettings().disableLayoutStyles;\n\t} );\n\tconst layout = style?.layout ?? {};\n\tconst {\n\t\tselfStretch,\n\t\tflexSize,\n\t\tcolumnStart,\n\t\trowStart,\n\t\tcolumnSpan,\n\t\trowSpan,\n\t} = layout;\n\tconst parentLayout = useLayout() || {};\n\tconst { columnCount, minimumColumnWidth } = parentLayout;\n\tconst id = useInstanceId( LAYOUT_CHILD_BLOCK_PROPS_REFERENCE );\n\tconst selector = `.wp-container-content-${ id }`;\n\n\t// Check that the grid layout attributes are of the correct type, so that we don't accidentally\n\t// write code that stores a string attribute instead of a number.\n\tif ( process.env.NODE_ENV === 'development' ) {\n\t\tif ( columnStart && typeof columnStart !== 'number' ) {\n\t\t\tthrow new Error( 'columnStart must be a number' );\n\t\t}\n\t\tif ( rowStart && typeof rowStart !== 'number' ) {\n\t\t\tthrow new Error( 'rowStart must be a number' );\n\t\t}\n\t\tif ( columnSpan && typeof columnSpan !== 'number' ) {\n\t\t\tthrow new Error( 'columnSpan must be a number' );\n\t\t}\n\t\tif ( rowSpan && typeof rowSpan !== 'number' ) {\n\t\t\tthrow new Error( 'rowSpan must be a number' );\n\t\t}\n\t}\n\n\tlet css = '';\n\tif ( shouldRenderChildLayoutStyles ) {\n\t\tif ( selfStretch === 'fixed' && flexSize ) {\n\t\t\tcss = `${ selector } {\n\t\t\t\tflex-basis: ${ flexSize };\n\t\t\t\tbox-sizing: border-box;\n\t\t\t}`;\n\t\t} else if ( selfStretch === 'fill' ) {\n\t\t\tcss = `${ selector } {\n\t\t\t\tflex-grow: 1;\n\t\t\t}`;\n\t\t} else if ( columnStart && columnSpan ) {\n\t\t\tcss = `${ selector } {\n\t\t\t\tgrid-column: ${ columnStart } / span ${ columnSpan };\n\t\t\t}`;\n\t\t} else if ( columnStart ) {\n\t\t\tcss = `${ selector } {\n\t\t\t\tgrid-column: ${ columnStart };\n\t\t\t}`;\n\t\t} else if ( columnSpan ) {\n\t\t\tcss = `${ selector } {\n\t\t\t\tgrid-column: span ${ columnSpan };\n\t\t\t}`;\n\t\t}\n\t\tif ( rowStart && rowSpan ) {\n\t\t\tcss += `${ selector } {\n\t\t\t\tgrid-row: ${ rowStart } / span ${ rowSpan };\n\t\t\t}`;\n\t\t} else if ( rowStart ) {\n\t\t\tcss += `${ selector } {\n\t\t\t\tgrid-row: ${ rowStart };\n\t\t\t}`;\n\t\t} else if ( rowSpan ) {\n\t\t\tcss += `${ selector } {\n\t\t\t\tgrid-row: span ${ rowSpan };\n\t\t\t}`;\n\t\t}\n\t\t/**\n\t\t * If minimumColumnWidth is set on the parent, or if no\n\t\t * columnCount is set, the grid is responsive so a\n\t\t * container query is needed for the span to resize.\n\t\t */\n\t\tif (\n\t\t\t( columnSpan || columnStart ) &&\n\t\t\t( minimumColumnWidth || ! columnCount )\n\t\t) {\n\t\t\tlet parentColumnValue = parseFloat( minimumColumnWidth );\n\t\t\t/**\n\t\t\t * 12rem is the default minimumColumnWidth value.\n\t\t\t * If parentColumnValue is not a number, default to 12.\n\t\t\t */\n\t\t\tif ( isNaN( parentColumnValue ) ) {\n\t\t\t\tparentColumnValue = 12;\n\t\t\t}\n\n\t\t\tlet parentColumnUnit = minimumColumnWidth?.replace(\n\t\t\t\tparentColumnValue,\n\t\t\t\t''\n\t\t\t);\n\t\t\t/**\n\t\t\t * Check that parent column unit is either 'px', 'rem' or 'em'.\n\t\t\t * If not, default to 'rem'.\n\t\t\t */\n\t\t\tif ( ! [ 'px', 'rem', 'em' ].includes( parentColumnUnit ) ) {\n\t\t\t\tparentColumnUnit = 'rem';\n\t\t\t}\n\n\t\t\tlet numColsToBreakAt = 2;\n\n\t\t\tif ( columnSpan && columnStart ) {\n\t\t\t\tnumColsToBreakAt = columnSpan + columnStart - 1;\n\t\t\t} else if ( columnSpan ) {\n\t\t\t\tnumColsToBreakAt = columnSpan;\n\t\t\t} else {\n\t\t\t\tnumColsToBreakAt = columnStart;\n\t\t\t}\n\n\t\t\tconst defaultGapValue = parentColumnUnit === 'px' ? 24 : 1.5;\n\t\t\tconst containerQueryValue =\n\t\t\t\tnumColsToBreakAt * parentColumnValue +\n\t\t\t\t( numColsToBreakAt - 1 ) * defaultGapValue;\n\t\t\t// For blocks that only span one column, we want to remove any rowStart values as\n\t\t\t// the container reduces in size, so that blocks are still arranged in markup order.\n\t\t\tconst minimumContainerQueryValue =\n\t\t\t\tparentColumnValue * 2 + defaultGapValue - 1;\n\t\t\t// If a span is set we want to preserve it as long as possible, otherwise we just reset the value.\n\t\t\tconst gridColumnValue =\n\t\t\t\tcolumnSpan && columnSpan > 1 ? '1/-1' : 'auto';\n\n\t\t\tcss += `@container (max-width: ${ Math.max(\n\t\t\t\tcontainerQueryValue,\n\t\t\t\tminimumContainerQueryValue\n\t\t\t) }${ parentColumnUnit }) {\n\t\t\t\t${ selector } {\n\t\t\t\t\tgrid-column: ${ gridColumnValue };\n\t\t\t\t\tgrid-row: auto;\n\t\t\t\t}\n\t\t\t}`;\n\t\t}\n\t}\n\n\tuseStyleOverride( { css } );\n\n\t// Only attach a container class if there is generated CSS to be attached.\n\tif ( ! css ) {\n\t\treturn;\n\t}\n\n\t// Attach a `wp-container-content` id-based classname.\n\treturn { className: `wp-container-content-${ id }` };\n}\n\nfunction ChildLayoutControlsPure( { clientId, style, setAttributes } ) {\n\tconst parentLayout = useLayout() || {};\n\tconst {\n\t\ttype: parentLayoutType = 'default',\n\t\tallowSizingOnChildren = false,\n\t\tisManualPlacement,\n\t} = parentLayout;\n\n\tif ( parentLayoutType !== 'grid' ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<GridTools\n\t\t\tclientId={ clientId }\n\t\t\tstyle={ style }\n\t\t\tsetAttributes={ setAttributes }\n\t\t\tallowSizingOnChildren={ allowSizingOnChildren }\n\t\t\tisManualPlacement={ isManualPlacement }\n\t\t\tparentLayout={ parentLayout }\n\t\t/>\n\t);\n}\n\nfunction GridTools( {\n\tclientId,\n\tstyle,\n\tsetAttributes,\n\tallowSizingOnChildren,\n\tisManualPlacement,\n\tparentLayout,\n} ) {\n\tconst { rootClientId, isVisible } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockRootClientId,\n\t\t\t\tgetBlockEditingMode,\n\t\t\t\tgetTemplateLock,\n\t\t\t} = select( blockEditorStore );\n\n\t\t\tconst _rootClientId = getBlockRootClientId( clientId );\n\n\t\t\tif (\n\t\t\t\tgetTemplateLock( _rootClientId ) ||\n\t\t\t\tgetBlockEditingMode( _rootClientId ) !== 'default'\n\t\t\t) {\n\t\t\t\treturn {\n\t\t\t\t\trootClientId: _rootClientId,\n\t\t\t\t\tisVisible: false,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\trootClientId: _rootClientId,\n\t\t\t\tisVisible: true,\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\t// Use useState() instead of useRef() so that GridItemResizer updates when ref is set.\n\tconst [ resizerBounds, setResizerBounds ] = useState();\n\n\tif ( ! isVisible ) {\n\t\treturn null;\n\t}\n\n\tfunction updateLayout( layout ) {\n\t\tsetAttributes( {\n\t\t\tstyle: {\n\t\t\t\t...style,\n\t\t\t\tlayout: {\n\t\t\t\t\t...style?.layout,\n\t\t\t\t\t...layout,\n\t\t\t\t},\n\t\t\t},\n\t\t} );\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<GridVisualizer\n\t\t\t\tclientId={ rootClientId }\n\t\t\t\tcontentRef={ setResizerBounds }\n\t\t\t\tparentLayout={ parentLayout }\n\t\t\t/>\n\t\t\t{ allowSizingOnChildren && (\n\t\t\t\t<GridItemResizer\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t// Don't allow resizing beyond the grid visualizer.\n\t\t\t\t\tbounds={ resizerBounds }\n\t\t\t\t\tonChange={ updateLayout }\n\t\t\t\t\tparentLayout={ parentLayout }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ isManualPlacement &&\n\t\t\t\twindow.__experimentalEnableGridInteractivity && (\n\t\t\t\t\t<GridItemMovers\n\t\t\t\t\t\tlayout={ style?.layout }\n\t\t\t\t\t\tparentLayout={ parentLayout }\n\t\t\t\t\t\tonChange={ updateLayout }\n\t\t\t\t\t\tgridClientId={ rootClientId }\n\t\t\t\t\t\tblockClientId={ clientId }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default {\n\tuseBlockProps: useBlockPropsChildLayoutStyles,\n\tedit: ChildLayoutControlsPure,\n\tattributeKeys: [ 'style' ],\n\thasSupport() {\n\t\treturn true;\n\t},\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,aAAa,QAAQ,oBAAoB;AAClD,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,QAAQ,QAAQ,oBAAoB;;AAE7C;AACA;AACA;AACA,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,UAAU;AACpD,SAASC,gBAAgB,QAAQ,SAAS;AAC1C,SAASC,SAAS,QAAQ,iCAAiC;AAC3D,SACCC,cAAc,EACdC,eAAe,EACfC,cAAc,QACR,oBAAoB;;AAE3B;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AACA,MAAMC,kCAAkC,GAAG,CAAC,CAAC;AAE7C,SAASC,8BAA8BA,CAAE;EAAEC;AAAM,CAAC,EAAG;EAAA,IAAAC,aAAA;EACpD,MAAMC,6BAA6B,GAAGnB,SAAS,CAAIoB,MAAM,IAAM;IAC9D,OAAO,CAAEA,MAAM,CAAEjB,gBAAiB,CAAC,CAACkB,WAAW,CAAC,CAAC,CAACC,mBAAmB;EACtE,CAAE,CAAC;EACH,MAAMC,MAAM,IAAAL,aAAA,GAAGD,KAAK,EAAEM,MAAM,cAAAL,aAAA,cAAAA,aAAA,GAAI,CAAC,CAAC;EAClC,MAAM;IACLM,WAAW;IACXC,QAAQ;IACRC,WAAW;IACXC,QAAQ;IACR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CAACH,eAAe;MACfgD,QAAQ,EAAGA;MACX;MAAA;MACAkB,MAAM,EAAGL,aAAe;MACxBM,QAAQ,EAAGJ,YAAc;MACzBxC,YAAY,EAAGA;IAAc,CAC7B,CACD,EACC8B,iBAAiB,IAClBe,MAAM,CAACC,qCAAqC,iBAC3ClE,IAAA,CAACF,cAAc;MACde,MAAM,EAAGN,KAAK,EAAEM,MAAQ;MACxBO,YAAY,EAAGA,YAAc;MAC7B4C,QAAQ,EAAGJ,YAAc;MACzBO,YAAY,EAAGf,YAAc;MAC7BgB,aAAa,EAAGvB;IAAU,CAC1B,CACD;EAAA,CACD,CAAC;AAEL;AAEA,eAAe;EACdwB,aAAa,EAAE/D,8BAA8B;EAC7CgE,IAAI,EAAE1B,uBAAuB;EAC7B2B,aAAa,EAAE,CAAE,OAAO,CAAE;EAC1BC,UAAUA,CAAA,EAAG;IACZ,OAAO,IAAI;EACZ;AACD,CAAC","ignoreList":[]}
@@ -24,9 +24,7 @@ import { useBlockEditingMode } from '../components/block-editing-mode';
24
24
  import { LAYOUT_DEFINITIONS } from '../layouts/definitions';
25
25
  import { useBlockSettings, useStyleOverride } from './utils';
26
26
  import { unlock } from '../lock-unlock';
27
- import { jsx as _jsx } from "react/jsx-runtime";
28
- import { Fragment as _Fragment } from "react/jsx-runtime";
29
- import { jsxs as _jsxs } from "react/jsx-runtime";
27
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
30
28
  const layoutBlockSupportKey = 'layout';
31
29
  const {
32
30
  kebabCase
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","createHigherOrderComponent","useInstanceId","addFilter","getBlockSupport","hasBlockSupport","useSelect","__experimentalToggleGroupControl","ToggleGroupControl","__experimentalToggleGroupControlOption","ToggleGroupControlOption","ToggleControl","PanelBody","privateApis","componentsPrivateApis","__","store","blockEditorStore","InspectorControls","useSettings","getLayoutType","getLayoutTypes","useBlockEditingMode","LAYOUT_DEFINITIONS","useBlockSettings","useStyleOverride","unlock","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","layoutBlockSupportKey","kebabCase","hasLayoutBlockSupport","blockName","useLayoutClasses","blockAttributes","layout","default","defaultBlockLayout","usedLayout","inherit","contentSize","wideSize","type","layoutClassnames","className","baseClassName","splitBlockName","split","fullBlockName","pop","join","compoundClassName","push","hasGlobalPadding","select","getSettings","__experimentalFeatures","useRootPaddingAwareAlignments","orientation","justifyContent","flexWrap","useLayoutStyles","selector","style","fullLayoutType","blockGapSupport","hasBlockGapSupport","getLayoutStyle","LayoutPanelPure","setAttributes","name","clientId","settings","layoutSettings","themeSupportsLayout","supportsLayout","blockEditingMode","layoutBlockSupport","blockSupportAndThemeSettings","allowSwitching","allowEditing","allowInheriting","blockSupportAndLayout","defaultType","blockLayoutType","showInheritToggle","layoutType","constrainedType","displayControlsForLegacyLayouts","hasContentSizeOrLegacySettings","onChangeType","newType","onChangeLayout","newLayout","children","title","__nextHasNoMarginBottom","label","checked","onChange","help","LayoutTypeSwitcher","inspectorControls","toolBarControls","shareWithChildBlocks","edit","attributeKeys","hasSupport","__next40pxDefaultSize","isBlock","hideLabelFromVision","isAdaptiveWidth","value","map","addAttribute","_settings$attributes$","attributes","BlockWithLayoutStyles","block","BlockListBlock","props","layoutClasses","id","selectorPrefix","css","layoutClassNames","__unstableLayoutClassNames","withLayoutStyles","blockSupportsLayout","extraProps","getBlockSettings","disableLayoutStyles","undefined"],"sources":["@wordpress/block-editor/src/hooks/layout.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { createHigherOrderComponent, useInstanceId } from '@wordpress/compose';\nimport { addFilter } from '@wordpress/hooks';\nimport { getBlockSupport, hasBlockSupport } from '@wordpress/blocks';\nimport { useSelect } from '@wordpress/data';\nimport {\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n\tToggleControl,\n\tPanelBody,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../store';\nimport { InspectorControls } from '../components';\nimport { useSettings } from '../components/use-settings';\nimport { getLayoutType, getLayoutTypes } from '../layouts';\nimport { useBlockEditingMode } from '../components/block-editing-mode';\nimport { LAYOUT_DEFINITIONS } from '../layouts/definitions';\nimport { useBlockSettings, useStyleOverride } from './utils';\nimport { unlock } from '../lock-unlock';\n\nconst layoutBlockSupportKey = 'layout';\nconst { kebabCase } = unlock( componentsPrivateApis );\n\nfunction hasLayoutBlockSupport( blockName ) {\n\treturn (\n\t\thasBlockSupport( blockName, 'layout' ) ||\n\t\thasBlockSupport( blockName, '__experimentalLayout' )\n\t);\n}\n\n/**\n * Generates the utility classnames for the given block's layout attributes.\n *\n * @param { Object } blockAttributes Block attributes.\n * @param { string } blockName Block name.\n *\n * @return { Array } Array of CSS classname strings.\n */\nexport function useLayoutClasses( blockAttributes = {}, blockName = '' ) {\n\tconst { layout } = blockAttributes;\n\tconst { default: defaultBlockLayout } =\n\t\tgetBlockSupport( blockName, layoutBlockSupportKey ) || {};\n\tconst usedLayout =\n\t\tlayout?.inherit || layout?.contentSize || layout?.wideSize\n\t\t\t? { ...layout, type: 'constrained' }\n\t\t\t: layout || defaultBlockLayout || {};\n\n\tconst layoutClassnames = [];\n\n\tif ( LAYOUT_DEFINITIONS[ usedLayout?.type || 'default' ]?.className ) {\n\t\tconst baseClassName =\n\t\t\tLAYOUT_DEFINITIONS[ usedLayout?.type || 'default' ]?.className;\n\t\tconst splitBlockName = blockName.split( '/' );\n\t\tconst fullBlockName =\n\t\t\tsplitBlockName[ 0 ] === 'core'\n\t\t\t\t? splitBlockName.pop()\n\t\t\t\t: splitBlockName.join( '-' );\n\t\tconst compoundClassName = `wp-block-${ fullBlockName }-${ baseClassName }`;\n\t\tlayoutClassnames.push( baseClassName, compoundClassName );\n\t}\n\n\tconst hasGlobalPadding = useSelect(\n\t\t( select ) => {\n\t\t\treturn (\n\t\t\t\t( usedLayout?.inherit ||\n\t\t\t\t\tusedLayout?.contentSize ||\n\t\t\t\t\tusedLayout?.type === 'constrained' ) &&\n\t\t\t\tselect( blockEditorStore ).getSettings().__experimentalFeatures\n\t\t\t\t\t?.useRootPaddingAwareAlignments\n\t\t\t);\n\t\t},\n\t\t[ usedLayout?.contentSize, usedLayout?.inherit, usedLayout?.type ]\n\t);\n\n\tif ( hasGlobalPadding ) {\n\t\tlayoutClassnames.push( 'has-global-padding' );\n\t}\n\n\tif ( usedLayout?.orientation ) {\n\t\tlayoutClassnames.push( `is-${ kebabCase( usedLayout.orientation ) }` );\n\t}\n\n\tif ( usedLayout?.justifyContent ) {\n\t\tlayoutClassnames.push(\n\t\t\t`is-content-justification-${ kebabCase(\n\t\t\t\tusedLayout.justifyContent\n\t\t\t) }`\n\t\t);\n\t}\n\n\tif ( usedLayout?.flexWrap && usedLayout.flexWrap === 'nowrap' ) {\n\t\tlayoutClassnames.push( 'is-nowrap' );\n\t}\n\n\treturn layoutClassnames;\n}\n\n/**\n * Generates a CSS rule with the given block's layout styles.\n *\n * @param { Object } blockAttributes Block attributes.\n * @param { string } blockName Block name.\n * @param { string } selector A selector to use in generating the CSS rule.\n *\n * @return { string } CSS rule.\n */\nexport function useLayoutStyles( blockAttributes = {}, blockName, selector ) {\n\tconst { layout = {}, style = {} } = blockAttributes;\n\t// Update type for blocks using legacy layouts.\n\tconst usedLayout =\n\t\tlayout?.inherit || layout?.contentSize || layout?.wideSize\n\t\t\t? { ...layout, type: 'constrained' }\n\t\t\t: layout || {};\n\tconst fullLayoutType = getLayoutType( usedLayout?.type || 'default' );\n\tconst [ blockGapSupport ] = useSettings( 'spacing.blockGap' );\n\tconst hasBlockGapSupport = blockGapSupport !== null;\n\treturn fullLayoutType?.getLayoutStyle?.( {\n\t\tblockName,\n\t\tselector,\n\t\tlayout,\n\t\tstyle,\n\t\thasBlockGapSupport,\n\t} );\n}\n\nfunction LayoutPanelPure( {\n\tlayout,\n\tsetAttributes,\n\tname: blockName,\n\tclientId,\n} ) {\n\tconst settings = useBlockSettings( blockName );\n\t// Block settings come from theme.json under settings.[blockName].\n\tconst { layout: layoutSettings } = settings;\n\tconst { themeSupportsLayout } = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\treturn {\n\t\t\tthemeSupportsLayout: getSettings().supportsLayout,\n\t\t};\n\t}, [] );\n\tconst blockEditingMode = useBlockEditingMode();\n\n\tif ( blockEditingMode !== 'default' ) {\n\t\treturn null;\n\t}\n\n\t// Layout block support comes from the block's block.json.\n\tconst layoutBlockSupport = getBlockSupport(\n\t\tblockName,\n\t\tlayoutBlockSupportKey,\n\t\t{}\n\t);\n\tconst blockSupportAndThemeSettings = {\n\t\t...layoutSettings,\n\t\t...layoutBlockSupport,\n\t};\n\tconst {\n\t\tallowSwitching,\n\t\tallowEditing = true,\n\t\tallowInheriting = true,\n\t\tdefault: defaultBlockLayout,\n\t} = blockSupportAndThemeSettings;\n\n\tif ( ! allowEditing ) {\n\t\treturn null;\n\t}\n\n\t/*\n\t * Try to find the layout type from either the\n\t * block's layout settings or any saved layout config.\n\t */\n\tconst blockSupportAndLayout = {\n\t\t...layoutBlockSupport,\n\t\t...layout,\n\t};\n\tconst { type, default: { type: defaultType = 'default' } = {} } =\n\t\tblockSupportAndLayout;\n\tconst blockLayoutType = type || defaultType;\n\n\t// Only show the inherit toggle if it's supported,\n\t// and either the default / flow or the constrained layout type is in use, as the toggle switches from one to the other.\n\tconst showInheritToggle = !! (\n\t\tallowInheriting &&\n\t\t( ! blockLayoutType ||\n\t\t\tblockLayoutType === 'default' ||\n\t\t\tblockLayoutType === 'constrained' ||\n\t\t\tblockSupportAndLayout.inherit )\n\t);\n\n\tconst usedLayout = layout || defaultBlockLayout || {};\n\tconst { inherit = false, contentSize = null } = usedLayout;\n\t/**\n\t * `themeSupportsLayout` is only relevant to the `default/flow` or\n\t * `constrained` layouts and it should not be taken into account when other\n\t * `layout` types are used.\n\t */\n\tif (\n\t\t( blockLayoutType === 'default' ||\n\t\t\tblockLayoutType === 'constrained' ) &&\n\t\t! themeSupportsLayout\n\t) {\n\t\treturn null;\n\t}\n\tconst layoutType = getLayoutType( blockLayoutType );\n\tconst constrainedType = getLayoutType( 'constrained' );\n\tconst displayControlsForLegacyLayouts =\n\t\t! usedLayout.type && ( contentSize || inherit );\n\tconst hasContentSizeOrLegacySettings = !! inherit || !! contentSize;\n\n\tconst onChangeType = ( newType ) =>\n\t\tsetAttributes( { layout: { type: newType } } );\n\tconst onChangeLayout = ( newLayout ) =>\n\t\tsetAttributes( { layout: newLayout } );\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Layout' ) }>\n\t\t\t\t\t{ showInheritToggle && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tlabel={ __( 'Inner blocks use content width' ) }\n\t\t\t\t\t\t\t\tchecked={\n\t\t\t\t\t\t\t\t\tlayoutType?.name === 'constrained' ||\n\t\t\t\t\t\t\t\t\thasContentSizeOrLegacySettings\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\tlayout: {\n\t\t\t\t\t\t\t\t\t\t\ttype:\n\t\t\t\t\t\t\t\t\t\t\t\tlayoutType?.name ===\n\t\t\t\t\t\t\t\t\t\t\t\t\t'constrained' ||\n\t\t\t\t\t\t\t\t\t\t\t\thasContentSizeOrLegacySettings\n\t\t\t\t\t\t\t\t\t\t\t\t\t? 'default'\n\t\t\t\t\t\t\t\t\t\t\t\t\t: 'constrained',\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\thelp={\n\t\t\t\t\t\t\t\t\tlayoutType?.name === 'constrained' ||\n\t\t\t\t\t\t\t\t\thasContentSizeOrLegacySettings\n\t\t\t\t\t\t\t\t\t\t? __(\n\t\t\t\t\t\t\t\t\t\t\t\t'Nested blocks use content width with options for full and wide widths.'\n\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t\t: __(\n\t\t\t\t\t\t\t\t\t\t\t\t'Nested blocks will fill the width of this container. Toggle to constrain.'\n\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\n\t\t\t\t\t{ ! inherit && allowSwitching && (\n\t\t\t\t\t\t<LayoutTypeSwitcher\n\t\t\t\t\t\t\ttype={ blockLayoutType }\n\t\t\t\t\t\t\tonChange={ onChangeType }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\n\t\t\t\t\t{ layoutType && layoutType.name !== 'default' && (\n\t\t\t\t\t\t<layoutType.inspectorControls\n\t\t\t\t\t\t\tlayout={ usedLayout }\n\t\t\t\t\t\t\tonChange={ onChangeLayout }\n\t\t\t\t\t\t\tlayoutBlockSupport={ blockSupportAndThemeSettings }\n\t\t\t\t\t\t\tname={ blockName }\n\t\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ constrainedType && displayControlsForLegacyLayouts && (\n\t\t\t\t\t\t<constrainedType.inspectorControls\n\t\t\t\t\t\t\tlayout={ usedLayout }\n\t\t\t\t\t\t\tonChange={ onChangeLayout }\n\t\t\t\t\t\t\tlayoutBlockSupport={ blockSupportAndThemeSettings }\n\t\t\t\t\t\t\tname={ blockName }\n\t\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t\t{ ! inherit && layoutType && (\n\t\t\t\t<layoutType.toolBarControls\n\t\t\t\t\tlayout={ usedLayout }\n\t\t\t\t\tonChange={ onChangeLayout }\n\t\t\t\t\tlayoutBlockSupport={ layoutBlockSupport }\n\t\t\t\t\tname={ blockName }\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default {\n\tshareWithChildBlocks: true,\n\tedit: LayoutPanelPure,\n\tattributeKeys: [ 'layout' ],\n\thasSupport( name ) {\n\t\treturn hasLayoutBlockSupport( name );\n\t},\n};\n\nfunction LayoutTypeSwitcher( { type, onChange } ) {\n\treturn (\n\t\t<ToggleGroupControl\n\t\t\t__next40pxDefaultSize\n\t\t\tisBlock\n\t\t\tlabel={ __( 'Layout type' ) }\n\t\t\t__nextHasNoMarginBottom\n\t\t\thideLabelFromVision\n\t\t\tisAdaptiveWidth\n\t\t\tvalue={ type }\n\t\t\tonChange={ onChange }\n\t\t>\n\t\t\t{ getLayoutTypes().map( ( { name, label } ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\tkey={ name }\n\t\t\t\t\t\tvalue={ name }\n\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</ToggleGroupControl>\n\t);\n}\n\n/**\n * Filters registered block settings, extending attributes to include `layout`.\n *\n * @param {Object} settings Original block settings.\n *\n * @return {Object} Filtered block settings.\n */\nexport function addAttribute( settings ) {\n\tif ( 'type' in ( settings.attributes?.layout ?? {} ) ) {\n\t\treturn settings;\n\t}\n\tif ( hasLayoutBlockSupport( settings ) ) {\n\t\tsettings.attributes = {\n\t\t\t...settings.attributes,\n\t\t\tlayout: {\n\t\t\t\ttype: 'object',\n\t\t\t},\n\t\t};\n\t}\n\n\treturn settings;\n}\n\nfunction BlockWithLayoutStyles( {\n\tblock: BlockListBlock,\n\tprops,\n\tblockGapSupport,\n\tlayoutClasses,\n} ) {\n\tconst { name, attributes } = props;\n\tconst id = useInstanceId( BlockListBlock );\n\tconst { layout } = attributes;\n\tconst { default: defaultBlockLayout } =\n\t\tgetBlockSupport( name, layoutBlockSupportKey ) || {};\n\tconst usedLayout =\n\t\tlayout?.inherit || layout?.contentSize || layout?.wideSize\n\t\t\t? { ...layout, type: 'constrained' }\n\t\t\t: layout || defaultBlockLayout || {};\n\n\tconst selectorPrefix = `wp-container-${ kebabCase( name ) }-is-layout-`;\n\t// Higher specificity to override defaults from theme.json.\n\tconst selector = `.${ selectorPrefix }${ id }`;\n\tconst hasBlockGapSupport = blockGapSupport !== null;\n\n\t// Get CSS string for the current layout type.\n\t// The CSS and `style` element is only output if it is not empty.\n\tconst fullLayoutType = getLayoutType( usedLayout?.type || 'default' );\n\tconst css = fullLayoutType?.getLayoutStyle?.( {\n\t\tblockName: name,\n\t\tselector,\n\t\tlayout: usedLayout,\n\t\tstyle: attributes?.style,\n\t\thasBlockGapSupport,\n\t} );\n\n\t// Attach a `wp-container-` id-based class name as well as a layout class name such as `is-layout-flex`.\n\tconst layoutClassNames = clsx(\n\t\t{\n\t\t\t[ `${ selectorPrefix }${ id }` ]: !! css, // Only attach a container class if there is generated CSS to be attached.\n\t\t},\n\t\tlayoutClasses\n\t);\n\n\tuseStyleOverride( { css } );\n\n\treturn (\n\t\t<BlockListBlock\n\t\t\t{ ...props }\n\t\t\t__unstableLayoutClassNames={ layoutClassNames }\n\t\t/>\n\t);\n}\n\n/**\n * Override the default block element to add the layout styles.\n *\n * @param {Function} BlockListBlock Original component.\n *\n * @return {Function} Wrapped component.\n */\nexport const withLayoutStyles = createHigherOrderComponent(\n\t( BlockListBlock ) => ( props ) => {\n\t\tconst { clientId, name, attributes } = props;\n\t\tconst blockSupportsLayout = hasLayoutBlockSupport( name );\n\t\tconst layoutClasses = useLayoutClasses( attributes, name );\n\t\tconst extraProps = useSelect(\n\t\t\t( select ) => {\n\t\t\t\t// The callback returns early to avoid block editor subscription.\n\t\t\t\tif ( ! blockSupportsLayout ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst { getSettings, getBlockSettings } = unlock(\n\t\t\t\t\tselect( blockEditorStore )\n\t\t\t\t);\n\t\t\t\tconst { disableLayoutStyles } = getSettings();\n\n\t\t\t\tif ( disableLayoutStyles ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst [ blockGapSupport ] = getBlockSettings(\n\t\t\t\t\tclientId,\n\t\t\t\t\t'spacing.blockGap'\n\t\t\t\t);\n\n\t\t\t\treturn { blockGapSupport };\n\t\t\t},\n\t\t\t[ blockSupportsLayout, clientId ]\n\t\t);\n\n\t\tif ( ! extraProps ) {\n\t\t\treturn (\n\t\t\t\t<BlockListBlock\n\t\t\t\t\t{ ...props }\n\t\t\t\t\t__unstableLayoutClassNames={\n\t\t\t\t\t\tblockSupportsLayout ? layoutClasses : undefined\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<BlockWithLayoutStyles\n\t\t\t\tblock={ BlockListBlock }\n\t\t\t\tprops={ props }\n\t\t\t\tlayoutClasses={ layoutClasses }\n\t\t\t\t{ ...extraProps }\n\t\t\t/>\n\t\t);\n\t},\n\t'withLayoutStyles'\n);\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/layout/addAttribute',\n\taddAttribute\n);\naddFilter(\n\t'editor.BlockListBlock',\n\t'core/editor/layout/with-layout-styles',\n\twithLayoutStyles\n);\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,0BAA0B,EAAEC,aAAa,QAAQ,oBAAoB;AAC9E,SAASC,SAAS,QAAQ,kBAAkB;AAC5C,SAASC,eAAe,EAAEC,eAAe,QAAQ,mBAAmB;AACpE,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SACCC,gCAAgC,IAAIC,kBAAkB,EACtDC,sCAAsC,IAAIC,wBAAwB,EAClEC,aAAa,EACbC,SAAS,EAC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oreList":[]}
1
+ {"version":3,"names":["clsx","createHigherOrderComponent","useInstanceId","addFilter","getBlockSupport","hasBlockSupport","useSelect","__experimentalToggleGroupControl","ToggleGroupControl","__experimentalToggleGroupControlOption","ToggleGroupControlOption","ToggleControl","PanelBody","privateApis","componentsPrivateApis","__","store","blockEditorStore","InspectorControls","useSettings","getLayoutType","getLayoutTypes","useBlockEditingMode","LAYOUT_DEFINITIONS","useBlockSettings","useStyleOverride","unlock","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","layoutBlockSupportKey","kebabCase","hasLayoutBlockSupport","blockName","useLayoutClasses","blockAttributes","layout","default","defaultBlockLayout","usedLayout","inherit","contentSize","wideSize","type","layoutClassnames","className","baseClassName","splitBlockName","split","fullBlockName","pop","join","compoundClassName","push","hasGlobalPadding","select","getSettings","__experimentalFeatures","useRootPaddingAwareAlignments","orientation","justifyContent","flexWrap","useLayoutStyles","selector","style","fullLayoutType","blockGapSupport","hasBlockGapSupport","getLayoutStyle","LayoutPanelPure","setAttributes","name","clientId","settings","layoutSettings","themeSupportsLayout","supportsLayout","blockEditingMode","layoutBlockSupport","blockSupportAndThemeSettings","allowSwitching","allowEditing","allowInheriting","blockSupportAndLayout","defaultType","blockLayoutType","showInheritToggle","layoutType","constrainedType","displayControlsForLegacyLayouts","hasContentSizeOrLegacySettings","onChangeType","newType","onChangeLayout","newLayout","children","title","__nextHasNoMarginBottom","label","checked","onChange","help","LayoutTypeSwitcher","inspectorControls","toolBarControls","shareWithChildBlocks","edit","attributeKeys","hasSupport","__next40pxDefaultSize","isBlock","hideLabelFromVision","isAdaptiveWidth","value","map","addAttribute","_settings$attributes$","attributes","BlockWithLayoutStyles","block","BlockListBlock","props","layoutClasses","id","selectorPrefix","css","layoutClassNames","__unstableLayoutClassNames","withLayoutStyles","blockSupportsLayout","extraProps","getBlockSettings","disableLayoutStyles","undefined"],"sources":["@wordpress/block-editor/src/hooks/layout.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { createHigherOrderComponent, useInstanceId } from '@wordpress/compose';\nimport { addFilter } from '@wordpress/hooks';\nimport { getBlockSupport, hasBlockSupport } from '@wordpress/blocks';\nimport { useSelect } from '@wordpress/data';\nimport {\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n\tToggleControl,\n\tPanelBody,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../store';\nimport { InspectorControls } from '../components';\nimport { useSettings } from '../components/use-settings';\nimport { getLayoutType, getLayoutTypes } from '../layouts';\nimport { useBlockEditingMode } from '../components/block-editing-mode';\nimport { LAYOUT_DEFINITIONS } from '../layouts/definitions';\nimport { useBlockSettings, useStyleOverride } from './utils';\nimport { unlock } from '../lock-unlock';\n\nconst layoutBlockSupportKey = 'layout';\nconst { kebabCase } = unlock( componentsPrivateApis );\n\nfunction hasLayoutBlockSupport( blockName ) {\n\treturn (\n\t\thasBlockSupport( blockName, 'layout' ) ||\n\t\thasBlockSupport( blockName, '__experimentalLayout' )\n\t);\n}\n\n/**\n * Generates the utility classnames for the given block's layout attributes.\n *\n * @param { Object } blockAttributes Block attributes.\n * @param { string } blockName Block name.\n *\n * @return { Array } Array of CSS classname strings.\n */\nexport function useLayoutClasses( blockAttributes = {}, blockName = '' ) {\n\tconst { layout } = blockAttributes;\n\tconst { default: defaultBlockLayout } =\n\t\tgetBlockSupport( blockName, layoutBlockSupportKey ) || {};\n\tconst usedLayout =\n\t\tlayout?.inherit || layout?.contentSize || layout?.wideSize\n\t\t\t? { ...layout, type: 'constrained' }\n\t\t\t: layout || defaultBlockLayout || {};\n\n\tconst layoutClassnames = [];\n\n\tif ( LAYOUT_DEFINITIONS[ usedLayout?.type || 'default' ]?.className ) {\n\t\tconst baseClassName =\n\t\t\tLAYOUT_DEFINITIONS[ usedLayout?.type || 'default' ]?.className;\n\t\tconst splitBlockName = blockName.split( '/' );\n\t\tconst fullBlockName =\n\t\t\tsplitBlockName[ 0 ] === 'core'\n\t\t\t\t? splitBlockName.pop()\n\t\t\t\t: splitBlockName.join( '-' );\n\t\tconst compoundClassName = `wp-block-${ fullBlockName }-${ baseClassName }`;\n\t\tlayoutClassnames.push( baseClassName, compoundClassName );\n\t}\n\n\tconst hasGlobalPadding = useSelect(\n\t\t( select ) => {\n\t\t\treturn (\n\t\t\t\t( usedLayout?.inherit ||\n\t\t\t\t\tusedLayout?.contentSize ||\n\t\t\t\t\tusedLayout?.type === 'constrained' ) &&\n\t\t\t\tselect( blockEditorStore ).getSettings().__experimentalFeatures\n\t\t\t\t\t?.useRootPaddingAwareAlignments\n\t\t\t);\n\t\t},\n\t\t[ usedLayout?.contentSize, usedLayout?.inherit, usedLayout?.type ]\n\t);\n\n\tif ( hasGlobalPadding ) {\n\t\tlayoutClassnames.push( 'has-global-padding' );\n\t}\n\n\tif ( usedLayout?.orientation ) {\n\t\tlayoutClassnames.push( `is-${ kebabCase( usedLayout.orientation ) }` );\n\t}\n\n\tif ( usedLayout?.justifyContent ) {\n\t\tlayoutClassnames.push(\n\t\t\t`is-content-justification-${ kebabCase(\n\t\t\t\tusedLayout.justifyContent\n\t\t\t) }`\n\t\t);\n\t}\n\n\tif ( usedLayout?.flexWrap && usedLayout.flexWrap === 'nowrap' ) {\n\t\tlayoutClassnames.push( 'is-nowrap' );\n\t}\n\n\treturn layoutClassnames;\n}\n\n/**\n * Generates a CSS rule with the given block's layout styles.\n *\n * @param { Object } blockAttributes Block attributes.\n * @param { string } blockName Block name.\n * @param { string } selector A selector to use in generating the CSS rule.\n *\n * @return { string } CSS rule.\n */\nexport function useLayoutStyles( blockAttributes = {}, blockName, selector ) {\n\tconst { layout = {}, style = {} } = blockAttributes;\n\t// Update type for blocks using legacy layouts.\n\tconst usedLayout =\n\t\tlayout?.inherit || layout?.contentSize || layout?.wideSize\n\t\t\t? { ...layout, type: 'constrained' }\n\t\t\t: layout || {};\n\tconst fullLayoutType = getLayoutType( usedLayout?.type || 'default' );\n\tconst [ blockGapSupport ] = useSettings( 'spacing.blockGap' );\n\tconst hasBlockGapSupport = blockGapSupport !== null;\n\treturn fullLayoutType?.getLayoutStyle?.( {\n\t\tblockName,\n\t\tselector,\n\t\tlayout,\n\t\tstyle,\n\t\thasBlockGapSupport,\n\t} );\n}\n\nfunction LayoutPanelPure( {\n\tlayout,\n\tsetAttributes,\n\tname: blockName,\n\tclientId,\n} ) {\n\tconst settings = useBlockSettings( blockName );\n\t// Block settings come from theme.json under settings.[blockName].\n\tconst { layout: layoutSettings } = settings;\n\tconst { themeSupportsLayout } = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\treturn {\n\t\t\tthemeSupportsLayout: getSettings().supportsLayout,\n\t\t};\n\t}, [] );\n\tconst blockEditingMode = useBlockEditingMode();\n\n\tif ( blockEditingMode !== 'default' ) {\n\t\treturn null;\n\t}\n\n\t// Layout block support comes from the block's block.json.\n\tconst layoutBlockSupport = getBlockSupport(\n\t\tblockName,\n\t\tlayoutBlockSupportKey,\n\t\t{}\n\t);\n\tconst blockSupportAndThemeSettings = {\n\t\t...layoutSettings,\n\t\t...layoutBlockSupport,\n\t};\n\tconst {\n\t\tallowSwitching,\n\t\tallowEditing = true,\n\t\tallowInheriting = true,\n\t\tdefault: defaultBlockLayout,\n\t} = blockSupportAndThemeSettings;\n\n\tif ( ! allowEditing ) {\n\t\treturn null;\n\t}\n\n\t/*\n\t * Try to find the layout type from either the\n\t * block's layout settings or any saved layout config.\n\t */\n\tconst blockSupportAndLayout = {\n\t\t...layoutBlockSupport,\n\t\t...layout,\n\t};\n\tconst { type, default: { type: defaultType = 'default' } = {} } =\n\t\tblockSupportAndLayout;\n\tconst blockLayoutType = type || defaultType;\n\n\t// Only show the inherit toggle if it's supported,\n\t// and either the default / flow or the constrained layout type is in use, as the toggle switches from one to the other.\n\tconst showInheritToggle = !! (\n\t\tallowInheriting &&\n\t\t( ! blockLayoutType ||\n\t\t\tblockLayoutType === 'default' ||\n\t\t\tblockLayoutType === 'constrained' ||\n\t\t\tblockSupportAndLayout.inherit )\n\t);\n\n\tconst usedLayout = layout || defaultBlockLayout || {};\n\tconst { inherit = false, contentSize = null } = usedLayout;\n\t/**\n\t * `themeSupportsLayout` is only relevant to the `default/flow` or\n\t * `constrained` layouts and it should not be taken into account when other\n\t * `layout` types are used.\n\t */\n\tif (\n\t\t( blockLayoutType === 'default' ||\n\t\t\tblockLayoutType === 'constrained' ) &&\n\t\t! themeSupportsLayout\n\t) {\n\t\treturn null;\n\t}\n\tconst layoutType = getLayoutType( blockLayoutType );\n\tconst constrainedType = getLayoutType( 'constrained' );\n\tconst displayControlsForLegacyLayouts =\n\t\t! usedLayout.type && ( contentSize || inherit );\n\tconst hasContentSizeOrLegacySettings = !! inherit || !! contentSize;\n\n\tconst onChangeType = ( newType ) =>\n\t\tsetAttributes( { layout: { type: newType } } );\n\tconst onChangeLayout = ( newLayout ) =>\n\t\tsetAttributes( { layout: newLayout } );\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Layout' ) }>\n\t\t\t\t\t{ showInheritToggle && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tlabel={ __( 'Inner blocks use content width' ) }\n\t\t\t\t\t\t\t\tchecked={\n\t\t\t\t\t\t\t\t\tlayoutType?.name === 'constrained' ||\n\t\t\t\t\t\t\t\t\thasContentSizeOrLegacySettings\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\tlayout: {\n\t\t\t\t\t\t\t\t\t\t\ttype:\n\t\t\t\t\t\t\t\t\t\t\t\tlayoutType?.name ===\n\t\t\t\t\t\t\t\t\t\t\t\t\t'constrained' ||\n\t\t\t\t\t\t\t\t\t\t\t\thasContentSizeOrLegacySettings\n\t\t\t\t\t\t\t\t\t\t\t\t\t? 'default'\n\t\t\t\t\t\t\t\t\t\t\t\t\t: 'constrained',\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\thelp={\n\t\t\t\t\t\t\t\t\tlayoutType?.name === 'constrained' ||\n\t\t\t\t\t\t\t\t\thasContentSizeOrLegacySettings\n\t\t\t\t\t\t\t\t\t\t? __(\n\t\t\t\t\t\t\t\t\t\t\t\t'Nested blocks use content width with options for full and wide widths.'\n\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t\t: __(\n\t\t\t\t\t\t\t\t\t\t\t\t'Nested blocks will fill the width of this container. Toggle to constrain.'\n\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\n\t\t\t\t\t{ ! inherit && allowSwitching && (\n\t\t\t\t\t\t<LayoutTypeSwitcher\n\t\t\t\t\t\t\ttype={ blockLayoutType }\n\t\t\t\t\t\t\tonChange={ onChangeType }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\n\t\t\t\t\t{ layoutType && layoutType.name !== 'default' && (\n\t\t\t\t\t\t<layoutType.inspectorControls\n\t\t\t\t\t\t\tlayout={ usedLayout }\n\t\t\t\t\t\t\tonChange={ onChangeLayout }\n\t\t\t\t\t\t\tlayoutBlockSupport={ blockSupportAndThemeSettings }\n\t\t\t\t\t\t\tname={ blockName }\n\t\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ constrainedType && displayControlsForLegacyLayouts && (\n\t\t\t\t\t\t<constrainedType.inspectorControls\n\t\t\t\t\t\t\tlayout={ usedLayout }\n\t\t\t\t\t\t\tonChange={ onChangeLayout }\n\t\t\t\t\t\t\tlayoutBlockSupport={ blockSupportAndThemeSettings }\n\t\t\t\t\t\t\tname={ blockName }\n\t\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t\t{ ! inherit && layoutType && (\n\t\t\t\t<layoutType.toolBarControls\n\t\t\t\t\tlayout={ usedLayout }\n\t\t\t\t\tonChange={ onChangeLayout }\n\t\t\t\t\tlayoutBlockSupport={ layoutBlockSupport }\n\t\t\t\t\tname={ blockName }\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default {\n\tshareWithChildBlocks: true,\n\tedit: LayoutPanelPure,\n\tattributeKeys: [ 'layout' ],\n\thasSupport( name ) {\n\t\treturn hasLayoutBlockSupport( name );\n\t},\n};\n\nfunction LayoutTypeSwitcher( { type, onChange } ) {\n\treturn (\n\t\t<ToggleGroupControl\n\t\t\t__next40pxDefaultSize\n\t\t\tisBlock\n\t\t\tlabel={ __( 'Layout type' ) }\n\t\t\t__nextHasNoMarginBottom\n\t\t\thideLabelFromVision\n\t\t\tisAdaptiveWidth\n\t\t\tvalue={ type }\n\t\t\tonChange={ onChange }\n\t\t>\n\t\t\t{ getLayoutTypes().map( ( { name, label } ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\tkey={ name }\n\t\t\t\t\t\tvalue={ name }\n\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</ToggleGroupControl>\n\t);\n}\n\n/**\n * Filters registered block settings, extending attributes to include `layout`.\n *\n * @param {Object} settings Original block settings.\n *\n * @return {Object} Filtered block settings.\n */\nexport function addAttribute( settings ) {\n\tif ( 'type' in ( settings.attributes?.layout ?? {} ) ) {\n\t\treturn settings;\n\t}\n\tif ( hasLayoutBlockSupport( settings ) ) {\n\t\tsettings.attributes = {\n\t\t\t...settings.attributes,\n\t\t\tlayout: {\n\t\t\t\ttype: 'object',\n\t\t\t},\n\t\t};\n\t}\n\n\treturn settings;\n}\n\nfunction BlockWithLayoutStyles( {\n\tblock: BlockListBlock,\n\tprops,\n\tblockGapSupport,\n\tlayoutClasses,\n} ) {\n\tconst { name, attributes } = props;\n\tconst id = useInstanceId( BlockListBlock );\n\tconst { layout } = attributes;\n\tconst { default: defaultBlockLayout } =\n\t\tgetBlockSupport( name, layoutBlockSupportKey ) || {};\n\tconst usedLayout =\n\t\tlayout?.inherit || layout?.contentSize || layout?.wideSize\n\t\t\t? { ...layout, type: 'constrained' }\n\t\t\t: layout || defaultBlockLayout || {};\n\n\tconst selectorPrefix = `wp-container-${ kebabCase( name ) }-is-layout-`;\n\t// Higher specificity to override defaults from theme.json.\n\tconst selector = `.${ selectorPrefix }${ id }`;\n\tconst hasBlockGapSupport = blockGapSupport !== null;\n\n\t// Get CSS string for the current layout type.\n\t// The CSS and `style` element is only output if it is not empty.\n\tconst fullLayoutType = getLayoutType( usedLayout?.type || 'default' );\n\tconst css = fullLayoutType?.getLayoutStyle?.( {\n\t\tblockName: name,\n\t\tselector,\n\t\tlayout: usedLayout,\n\t\tstyle: attributes?.style,\n\t\thasBlockGapSupport,\n\t} );\n\n\t// Attach a `wp-container-` id-based class name as well as a layout class name such as `is-layout-flex`.\n\tconst layoutClassNames = clsx(\n\t\t{\n\t\t\t[ `${ selectorPrefix }${ id }` ]: !! css, // Only attach a container class if there is generated CSS to be attached.\n\t\t},\n\t\tlayoutClasses\n\t);\n\n\tuseStyleOverride( { css } );\n\n\treturn (\n\t\t<BlockListBlock\n\t\t\t{ ...props }\n\t\t\t__unstableLayoutClassNames={ layoutClassNames }\n\t\t/>\n\t);\n}\n\n/**\n * Override the default block element to add the layout styles.\n *\n * @param {Function} BlockListBlock Original component.\n *\n * @return {Function} Wrapped component.\n */\nexport const withLayoutStyles = createHigherOrderComponent(\n\t( BlockListBlock ) => ( props ) => {\n\t\tconst { clientId, name, attributes } = props;\n\t\tconst blockSupportsLayout = hasLayoutBlockSupport( name );\n\t\tconst layoutClasses = useLayoutClasses( attributes, name );\n\t\tconst extraProps = useSelect(\n\t\t\t( select ) => {\n\t\t\t\t// The callback returns early to avoid block editor subscription.\n\t\t\t\tif ( ! blockSupportsLayout ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst { getSettings, getBlockSettings } = unlock(\n\t\t\t\t\tselect( blockEditorStore )\n\t\t\t\t);\n\t\t\t\tconst { disableLayoutStyles } = getSettings();\n\n\t\t\t\tif ( disableLayoutStyles ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst [ blockGapSupport ] = getBlockSettings(\n\t\t\t\t\tclientId,\n\t\t\t\t\t'spacing.blockGap'\n\t\t\t\t);\n\n\t\t\t\treturn { blockGapSupport };\n\t\t\t},\n\t\t\t[ blockSupportsLayout, clientId ]\n\t\t);\n\n\t\tif ( ! extraProps ) {\n\t\t\treturn (\n\t\t\t\t<BlockListBlock\n\t\t\t\t\t{ ...props }\n\t\t\t\t\t__unstableLayoutClassNames={\n\t\t\t\t\t\tblockSupportsLayout ? layoutClasses : undefined\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<BlockWithLayoutStyles\n\t\t\t\tblock={ BlockListBlock }\n\t\t\t\tprops={ props }\n\t\t\t\tlayoutClasses={ layoutClasses }\n\t\t\t\t{ ...extraProps }\n\t\t\t/>\n\t\t);\n\t},\n\t'withLayoutStyles'\n);\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/layout/addAttribute',\n\taddAttribute\n);\naddFilter(\n\t'editor.BlockListBlock',\n\t'core/editor/layout/with-layout-styles',\n\twithLayoutStyles\n);\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB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EAAGC,cAAgB;IACxBC,KAAK,EAAGA,KAAO;IACfC,aAAa,EAAGA,aAAe;IAAA,GAC1BQ;EAAU,CACf,CAAC;AAEJ,CAAC,EACD,kBACD,CAAC;AAEDlI,SAAS,CACR,0BAA0B,EAC1B,0BAA0B,EAC1BmH,YACD,CAAC;AACDnH,SAAS,CACR,uBAAuB,EACvB,uCAAuC,EACvCgI,gBACD,CAAC","ignoreList":[]}
@@ -208,7 +208,7 @@ export function PositionPanelPure({
208
208
  };
209
209
  }, [clientId]);
210
210
  const blockInformation = useBlockDisplayInformation(firstParentClientId);
211
- const stickyHelpText = allowSticky && value === STICKY_OPTION.value && blockInformation ? sprintf( /* translators: %s: the name of the parent block. */
211
+ const stickyHelpText = allowSticky && value === STICKY_OPTION.value && blockInformation ? sprintf(/* translators: %s: the name of the parent block. */
212
212
  __('The block will stick to the scrollable area of the parent %s block.'), blockInformation.title) : null;
213
213
  const options = useMemo(() => {
214
214
  const availableOptions = [DEFAULT_OPTION];
@@ -285,6 +285,9 @@ export default {
285
285
  return hasBlockSupport(name, POSITION_SUPPORT_KEY);
286
286
  }
287
287
  };
288
+
289
+ // Used for generating the instance ID
290
+ const POSITION_BLOCK_PROPS_REFERENCE = {};
288
291
  function useBlockProps({
289
292
  name,
290
293
  style
@@ -294,7 +297,7 @@ function useBlockProps({
294
297
  name
295
298
  });
296
299
  const allowPositionStyles = hasPositionBlockSupport && !isPositionDisabled;
297
- const id = useInstanceId(useBlockProps);
300
+ const id = useInstanceId(POSITION_BLOCK_PROPS_REFERENCE);
298
301
 
299
302
  // Higher specificity to override defaults in editor UI.
300
303
  const positionSelector = `.wp-container-${id}.wp-container-${id}`;