@wordpress/block-editor 16.1.0 → 16.2.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 (1906) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/README.md +13 -1
  3. package/build/autocompleters/block.cjs.map +2 -2
  4. package/build/components/alignment-control/index.cjs.map +2 -2
  5. package/build/components/alignment-control/ui.cjs.map +2 -2
  6. package/build/components/autocomplete/index.cjs.map +2 -2
  7. package/build/components/background-image-control/index.cjs.map +2 -2
  8. package/build/components/block-actions/index.cjs +2 -1
  9. package/build/components/block-actions/index.cjs.map +2 -2
  10. package/build/components/block-alignment-control/constants.cjs.map +2 -2
  11. package/build/components/block-alignment-control/index.cjs.map +2 -2
  12. package/build/components/block-alignment-control/ui.cjs.map +2 -2
  13. package/build/components/block-alignment-control/use-available-alignments.cjs.map +2 -2
  14. package/build/components/block-alignment-matrix-control/index.cjs.map +2 -2
  15. package/build/components/block-allowed-blocks/allowed-blocks-control.cjs.map +2 -2
  16. package/build/components/block-allowed-blocks/modal.cjs.map +2 -2
  17. package/build/components/block-bindings/attribute-control.cjs.map +2 -2
  18. package/build/components/block-bindings/index.cjs.map +2 -2
  19. package/build/components/block-bindings/source-fields-list.cjs.map +2 -2
  20. package/build/components/block-bindings/use-block-bindings-utils.cjs.map +2 -2
  21. package/build/components/block-breadcrumb/index.cjs.map +2 -2
  22. package/build/components/block-canvas/index.cjs.map +2 -2
  23. package/build/components/block-card/index.cjs.map +2 -2
  24. package/build/components/block-compare/block-view.cjs.map +2 -2
  25. package/build/components/block-compare/index.cjs.map +2 -2
  26. package/build/components/block-content-overlay/index.cjs.map +2 -2
  27. package/build/components/block-context/index.cjs.map +2 -2
  28. package/build/components/block-controls/fill.cjs.map +2 -2
  29. package/build/components/block-controls/groups.cjs.map +2 -2
  30. package/build/components/block-controls/hook.cjs.map +2 -2
  31. package/build/components/block-controls/index.cjs.map +2 -2
  32. package/build/components/block-controls/slot.cjs.map +2 -2
  33. package/build/components/block-draggable/draggable-chip.cjs.map +2 -2
  34. package/build/components/block-draggable/index.cjs.map +2 -2
  35. package/build/components/block-draggable/use-scroll-when-dragging.cjs.map +2 -2
  36. package/build/components/block-edit/context.cjs.map +2 -2
  37. package/build/components/block-edit/edit.cjs.map +2 -2
  38. package/build/components/block-edit/index.cjs.map +2 -2
  39. package/build/components/block-edit/multiple-usage-warning.cjs.map +2 -2
  40. package/build/components/block-edit-visually-button/index.cjs.map +2 -2
  41. package/build/components/block-editing-mode/index.cjs.map +2 -2
  42. package/build/components/block-full-height-alignment-control/index.cjs.map +2 -2
  43. package/build/components/block-heading-level-dropdown/heading-level-icon.cjs.map +2 -2
  44. package/build/components/block-heading-level-dropdown/index.cjs.map +2 -2
  45. package/build/components/block-icon/index.cjs.map +2 -2
  46. package/build/components/block-inspector/edit-contents.cjs +48 -40
  47. package/build/components/block-inspector/edit-contents.cjs.map +3 -3
  48. package/build/components/block-inspector/index.cjs +9 -4
  49. package/build/components/block-inspector/index.cjs.map +2 -2
  50. package/build/components/block-inspector/inspector-pre-tabs-slot-fill.cjs.map +2 -2
  51. package/build/components/block-inspector/useBlockInspectorAnimationSettings.cjs.map +2 -2
  52. package/build/components/block-list/block-crash-boundary.cjs.map +2 -2
  53. package/build/components/block-list/block-crash-warning.cjs.map +2 -2
  54. package/build/components/block-list/block-html.cjs.map +2 -2
  55. package/build/components/block-list/block-invalid-warning.cjs.map +2 -2
  56. package/build/components/block-list/block.cjs +36 -10
  57. package/build/components/block-list/block.cjs.map +3 -3
  58. package/build/components/block-list/index.cjs +33 -9
  59. package/build/components/block-list/index.cjs.map +2 -2
  60. package/build/components/block-list/layout.cjs.map +2 -2
  61. package/build/components/block-list/private-block-context.cjs.map +2 -2
  62. package/build/components/block-list/subdirectory-icon.cjs.map +2 -2
  63. package/build/components/block-list/use-block-props/index.cjs +36 -2
  64. package/build/components/block-list/use-block-props/index.cjs.map +3 -3
  65. package/build/components/block-list/use-block-props/use-block-refs.cjs.map +2 -2
  66. package/build/components/block-list/use-block-props/use-firefox-draggable-compatibility.cjs.map +2 -2
  67. package/build/components/block-list/use-block-props/use-focus-first-element.cjs.map +2 -2
  68. package/build/components/block-list/use-block-props/use-focus-handler.cjs.map +2 -2
  69. package/build/components/block-list/use-block-props/use-intersection-observer.cjs.map +2 -2
  70. package/build/components/block-list/use-block-props/use-is-hovered.cjs.map +2 -2
  71. package/build/components/block-list/use-block-props/use-register-block-event-handlers.cjs.map +2 -2
  72. package/build/components/block-list/use-block-props/use-scroll-into-view.cjs.map +2 -2
  73. package/build/components/block-list/use-block-props/use-selected-block-event-handlers.cjs.map +2 -2
  74. package/build/components/block-list/use-in-between-inserter.cjs.map +2 -2
  75. package/build/components/block-list/zoom-out-separator.cjs.map +2 -2
  76. package/build/components/block-list-appender/index.cjs.map +2 -2
  77. package/build/components/block-lock/menu-item.cjs.map +2 -2
  78. package/build/components/block-lock/modal.cjs.map +2 -2
  79. package/build/components/block-lock/toolbar.cjs.map +2 -2
  80. package/build/components/block-lock/use-block-lock.cjs.map +2 -2
  81. package/build/components/block-manager/category.cjs.map +2 -2
  82. package/build/components/block-manager/checklist.cjs.map +2 -2
  83. package/build/components/block-manager/index.cjs.map +2 -2
  84. package/build/components/block-mover/button.cjs +15 -9
  85. package/build/components/block-mover/button.cjs.map +2 -2
  86. package/build/components/block-mover/index.cjs.map +2 -2
  87. package/build/components/block-mover/mover-description.cjs.map +2 -2
  88. package/build/components/block-navigation/dropdown.cjs.map +2 -2
  89. package/build/components/block-parent-selector/index.cjs.map +2 -2
  90. package/build/components/block-pattern-setup/index.cjs.map +2 -2
  91. package/build/components/block-pattern-setup/setup-toolbar.cjs.map +2 -2
  92. package/build/components/block-pattern-setup/use-patterns-setup.cjs.map +2 -2
  93. package/build/components/block-patterns-list/index.cjs.map +2 -2
  94. package/build/components/block-patterns-paging/index.cjs.map +2 -2
  95. package/build/components/block-popover/cover.cjs.map +2 -2
  96. package/build/components/block-popover/drop-zone.cjs.map +2 -2
  97. package/build/components/block-popover/inbetween.cjs.map +2 -2
  98. package/build/components/block-popover/index.cjs.map +2 -2
  99. package/build/components/block-popover/use-popover-scroll.cjs.map +2 -2
  100. package/build/components/block-preview/async.cjs.map +2 -2
  101. package/build/components/block-preview/auto.cjs.map +2 -2
  102. package/build/components/block-preview/index.cjs.map +2 -2
  103. package/build/components/block-quick-navigation/index.cjs.map +2 -2
  104. package/build/components/block-removal-warning-modal/index.cjs.map +2 -2
  105. package/build/components/block-rename/modal.cjs.map +2 -2
  106. package/build/components/block-rename/rename-control.cjs.map +2 -2
  107. package/build/components/block-rename/use-block-rename.cjs.map +2 -2
  108. package/build/components/block-selection-clearer/index.cjs.map +2 -2
  109. package/build/components/block-settings-menu/block-html-convert-button.cjs.map +2 -2
  110. package/build/components/block-settings-menu/block-mode-toggle.cjs.map +2 -2
  111. package/build/components/block-settings-menu/block-parent-selector-menu-item.cjs.map +2 -2
  112. package/build/components/block-settings-menu/block-settings-dropdown.cjs +1 -1
  113. package/build/components/block-settings-menu/block-settings-dropdown.cjs.map +2 -2
  114. package/build/components/block-settings-menu/block-settings-menu-first-item.cjs.map +2 -2
  115. package/build/components/block-settings-menu/index.cjs.map +2 -2
  116. package/build/components/block-settings-menu-controls/index.cjs.map +2 -2
  117. package/build/components/block-styles/index.cjs.map +2 -2
  118. package/build/components/block-styles/menu-items.cjs.map +2 -2
  119. package/build/components/block-styles/use-styles-for-block.cjs.map +2 -2
  120. package/build/components/block-styles/utils.cjs.map +2 -2
  121. package/build/components/block-switcher/block-styles-menu.cjs.map +2 -2
  122. package/build/components/block-switcher/block-transformations-menu.cjs.map +2 -2
  123. package/build/components/block-switcher/block-variation-transformations.cjs.map +2 -2
  124. package/build/components/block-switcher/index.cjs.map +2 -2
  125. package/build/components/block-switcher/pattern-transformations-menu.cjs.map +2 -2
  126. package/build/components/block-switcher/preview-block-popover.cjs.map +2 -2
  127. package/build/components/block-switcher/use-transformed-patterns.cjs.map +2 -2
  128. package/build/components/block-switcher/utils.cjs.map +2 -2
  129. package/build/components/block-title/index.cjs.map +2 -2
  130. package/build/components/block-title/use-block-display-title.cjs.map +2 -2
  131. package/build/components/block-toolbar/block-styles-dropdown.cjs.map +2 -2
  132. package/build/components/block-toolbar/block-toolbar-icon.cjs.map +2 -2
  133. package/build/components/block-toolbar/block-toolbar-last-item.cjs.map +2 -2
  134. package/build/components/block-toolbar/change-design.cjs.map +2 -2
  135. package/build/components/block-toolbar/edit-section-button.cjs.map +2 -2
  136. package/build/components/block-toolbar/index.cjs.map +2 -2
  137. package/build/components/block-toolbar/pattern-overrides-dropdown.cjs.map +2 -2
  138. package/build/components/block-toolbar/switch-section-style.cjs.map +2 -2
  139. package/build/components/block-toolbar/use-has-block-toolbar.cjs.map +2 -2
  140. package/build/components/block-toolbar/utils.cjs.map +2 -2
  141. package/build/components/block-tools/block-toolbar-popover.cjs.map +2 -2
  142. package/build/components/block-tools/empty-block-inserter.cjs.map +2 -2
  143. package/build/components/block-tools/index.cjs +2 -4
  144. package/build/components/block-tools/index.cjs.map +2 -2
  145. package/build/components/block-tools/insertion-point.cjs.map +2 -2
  146. package/build/components/block-tools/use-block-toolbar-popover-props.cjs.map +2 -2
  147. package/build/components/block-tools/use-selected-block-tool-props.cjs.map +2 -2
  148. package/build/components/block-tools/use-show-block-tools.cjs.map +2 -2
  149. package/build/components/block-tools/zoom-out-mode-inserter-button.cjs.map +2 -2
  150. package/build/components/block-tools/zoom-out-mode-inserters.cjs.map +2 -2
  151. package/build/components/block-types-list/index.cjs.map +2 -2
  152. package/build/components/block-variation-picker/index.cjs.map +2 -2
  153. package/build/components/block-variation-transforms/index.cjs.map +2 -2
  154. package/build/components/block-vertical-alignment-control/index.cjs.map +2 -2
  155. package/build/components/block-vertical-alignment-control/ui.cjs.map +2 -2
  156. package/build/components/block-visibility/constants.cjs +1 -1
  157. package/build/components/block-visibility/constants.cjs.map +3 -3
  158. package/build/components/block-visibility/modal.cjs.map +2 -2
  159. package/build/components/block-visibility/use-block-visibility.cjs +15 -17
  160. package/build/components/block-visibility/use-block-visibility.cjs.map +3 -3
  161. package/build/components/block-visibility/utils.cjs.map +2 -2
  162. package/build/components/block-visibility/viewport-menu-item.cjs.map +2 -2
  163. package/build/components/block-visibility/viewport-toolbar.cjs.map +2 -2
  164. package/build/components/block-visibility/viewport-visibility-info.cjs.map +2 -2
  165. package/build/components/border-radius-control/constants.cjs.map +2 -2
  166. package/build/components/border-radius-control/index.cjs.map +2 -2
  167. package/build/components/border-radius-control/linked-button.cjs.map +2 -2
  168. package/build/components/border-radius-control/utils.cjs.map +2 -2
  169. package/build/components/button-block-appender/index.cjs.map +2 -2
  170. package/build/components/child-layout-control/index.cjs.map +2 -2
  171. package/build/components/collab/note-icon-slot.cjs.map +2 -2
  172. package/build/components/collab/note-icon-toolbar-slot.cjs.map +2 -2
  173. package/build/components/color-palette/control.cjs.map +2 -2
  174. package/build/components/color-palette/index.cjs.map +2 -2
  175. package/build/components/color-palette/with-color-context.cjs.map +2 -2
  176. package/build/components/color-style-selector/index.cjs.map +2 -2
  177. package/build/components/colors/utils.cjs +2 -4
  178. package/build/components/colors/utils.cjs.map +3 -3
  179. package/build/components/colors/with-colors.cjs +2 -4
  180. package/build/components/colors/with-colors.cjs.map +3 -3
  181. package/build/components/colors-gradients/control.cjs.map +2 -2
  182. package/build/components/colors-gradients/dropdown.cjs.map +2 -2
  183. package/build/components/colors-gradients/panel-color-gradient-settings.cjs +5 -5
  184. package/build/components/colors-gradients/panel-color-gradient-settings.cjs.map +2 -2
  185. package/build/components/colors-gradients/use-multiple-origin-colors-and-gradients.cjs.map +2 -2
  186. package/build/components/contrast-checker/index.cjs.map +2 -2
  187. package/build/components/convert-to-group-buttons/index.cjs +2 -5
  188. package/build/components/convert-to-group-buttons/index.cjs.map +2 -2
  189. package/build/components/convert-to-group-buttons/toolbar.cjs +2 -4
  190. package/build/components/convert-to-group-buttons/toolbar.cjs.map +2 -2
  191. package/build/components/convert-to-group-buttons/use-convert-to-group-button-props.cjs.map +2 -2
  192. package/build/components/copy-handler/index.cjs.map +2 -2
  193. package/build/components/date-format-picker/index.cjs.map +2 -2
  194. package/build/components/default-block-appender/index.cjs.map +2 -2
  195. package/build/components/dimension-control/index.cjs.map +2 -2
  196. package/build/components/dimensions-tool/aspect-ratio-tool.cjs.map +2 -2
  197. package/build/components/dimensions-tool/index.cjs.map +2 -2
  198. package/build/components/dimensions-tool/scale-tool.cjs.map +2 -2
  199. package/build/components/dimensions-tool/width-height-tool.cjs.map +2 -2
  200. package/build/components/duotone-control/index.cjs.map +2 -2
  201. package/build/components/editable-text/index.cjs.map +2 -2
  202. package/build/components/editor-styles/index.cjs.map +2 -2
  203. package/build/components/fit-text-size-warning/index.cjs.map +2 -2
  204. package/build/components/floating-toolbar/nav-up-icon.cjs.map +2 -2
  205. package/build/components/font-appearance-control/index.cjs.map +2 -2
  206. package/build/components/font-family/index.cjs.map +2 -2
  207. package/build/components/font-sizes/font-size-picker.cjs.map +2 -2
  208. package/build/components/font-sizes/utils.cjs +2 -4
  209. package/build/components/font-sizes/utils.cjs.map +3 -3
  210. package/build/components/font-sizes/with-font-sizes.cjs.map +2 -2
  211. package/build/components/global-styles/advanced-panel.cjs.map +2 -2
  212. package/build/components/global-styles/background-panel.cjs.map +2 -2
  213. package/build/components/global-styles/border-panel.cjs.map +2 -2
  214. package/build/components/global-styles/color-gradient-dropdown-item.cjs.map +2 -2
  215. package/build/components/global-styles/color-panel.cjs.map +2 -2
  216. package/build/components/global-styles/dimensions-panel.cjs.map +2 -2
  217. package/build/components/global-styles/filters-panel.cjs.map +2 -2
  218. package/build/components/global-styles/hooks.cjs.map +2 -2
  219. package/build/components/global-styles/image-settings-panel.cjs.map +2 -2
  220. package/build/components/global-styles/inheritance/index.cjs.map +2 -2
  221. package/build/components/global-styles/inherited-value-context.cjs.map +2 -2
  222. package/build/components/global-styles/shadow-panel-components.cjs.map +2 -2
  223. package/build/components/global-styles/state-control-badges.cjs.map +2 -2
  224. package/build/components/global-styles/state-control.cjs.map +2 -2
  225. package/build/components/global-styles/typography-panel.cjs.map +2 -2
  226. package/build/components/global-styles/typography-utils.cjs.map +2 -2
  227. package/build/components/global-styles/utils.cjs.map +2 -2
  228. package/build/components/gradients/use-gradient.cjs.map +2 -2
  229. package/build/components/gradients/with-gradient.cjs.map +2 -2
  230. package/build/components/grid/grid-item-movers.cjs.map +2 -2
  231. package/build/components/grid/grid-item-resizer.cjs.map +2 -2
  232. package/build/components/grid/grid-visualizer.cjs.map +2 -2
  233. package/build/components/grid/use-get-number-of-blocks-before-cell.cjs.map +2 -2
  234. package/build/components/grid/use-grid-layout-sync.cjs.map +2 -2
  235. package/build/components/height-control/index.cjs.map +2 -2
  236. package/build/components/html-element-control/index.cjs.map +2 -2
  237. package/build/components/html-element-control/messages.cjs.map +2 -2
  238. package/build/components/iframe/index.cjs +19 -24
  239. package/build/components/iframe/index.cjs.map +2 -2
  240. package/build/components/iframe/use-scale-canvas.cjs +20 -6
  241. package/build/components/iframe/use-scale-canvas.cjs.map +2 -2
  242. package/build/components/image-editor/aspect-ratio-dropdown.cjs.map +2 -2
  243. package/build/components/image-editor/context.cjs.map +2 -2
  244. package/build/components/image-editor/cropper.cjs.map +2 -2
  245. package/build/components/image-editor/form-controls.cjs.map +2 -2
  246. package/build/components/image-editor/index.cjs.map +2 -2
  247. package/build/components/image-editor/rotation-button.cjs.map +2 -2
  248. package/build/components/image-editor/use-save-image.cjs.map +2 -2
  249. package/build/components/image-editor/use-transform-image.cjs.map +2 -2
  250. package/build/components/image-editor/zoom-dropdown.cjs.map +2 -2
  251. package/build/components/image-size-control/index.cjs.map +2 -2
  252. package/build/components/image-size-control/use-dimension-handler.cjs.map +2 -2
  253. package/build/components/inner-blocks/button-block-appender.cjs.map +2 -2
  254. package/build/components/inner-blocks/default-block-appender.cjs.map +2 -2
  255. package/build/components/inner-blocks/index.cjs.map +2 -2
  256. package/build/components/inner-blocks/use-block-context.cjs.map +2 -2
  257. package/build/components/inner-blocks/use-inner-block-template-sync.cjs +34 -7
  258. package/build/components/inner-blocks/use-inner-block-template-sync.cjs.map +3 -3
  259. package/build/components/inner-blocks/use-nested-settings-update.cjs.map +2 -2
  260. package/build/components/inner-content/index.cjs.map +2 -2
  261. package/build/components/inserter/block-patterns-explorer/index.cjs.map +2 -2
  262. package/build/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.cjs.map +2 -2
  263. package/build/components/inserter/block-patterns-explorer/pattern-list.cjs.map +2 -2
  264. package/build/components/inserter/block-patterns-tab/index.cjs.map +2 -2
  265. package/build/components/inserter/block-patterns-tab/pattern-category-previews.cjs.map +2 -2
  266. package/build/components/inserter/block-patterns-tab/patterns-filter.cjs.map +2 -2
  267. package/build/components/inserter/block-patterns-tab/use-pattern-categories.cjs.map +2 -2
  268. package/build/components/inserter/block-patterns-tab/utils.cjs.map +2 -2
  269. package/build/components/inserter/block-types-tab.cjs.map +2 -2
  270. package/build/components/inserter/category-tabs/index.cjs.map +2 -2
  271. package/build/components/inserter/hooks/use-block-types-state.cjs.map +2 -2
  272. package/build/components/inserter/hooks/use-insertion-point.cjs.map +2 -2
  273. package/build/components/inserter/hooks/use-patterns-paging.cjs.map +2 -2
  274. package/build/components/inserter/hooks/use-patterns-state.cjs.map +2 -2
  275. package/build/components/inserter/index.cjs +4 -13
  276. package/build/components/inserter/index.cjs.map +2 -2
  277. package/build/components/inserter/library.cjs.map +2 -2
  278. package/build/components/inserter/media-tab/hooks.cjs.map +2 -2
  279. package/build/components/inserter/media-tab/media-list.cjs.map +2 -2
  280. package/build/components/inserter/media-tab/media-panel.cjs.map +2 -2
  281. package/build/components/inserter/media-tab/media-preview.cjs.map +2 -2
  282. package/build/components/inserter/media-tab/media-tab.cjs.map +2 -2
  283. package/build/components/inserter/media-tab/utils.cjs.map +2 -2
  284. package/build/components/inserter/menu.cjs.map +2 -2
  285. package/build/components/inserter/mobile-tab-navigation.cjs.map +2 -2
  286. package/build/components/inserter/no-results.cjs.map +2 -2
  287. package/build/components/inserter/panel.cjs.map +2 -2
  288. package/build/components/inserter/preview-panel.cjs.map +2 -2
  289. package/build/components/inserter/quick-inserter.cjs.map +2 -2
  290. package/build/components/inserter/search-items.cjs.map +2 -2
  291. package/build/components/inserter/search-results.cjs.map +2 -2
  292. package/build/components/inserter/tips.cjs.map +2 -2
  293. package/build/components/inserter-button/sparkles.cjs.map +2 -2
  294. package/build/components/inserter-draggable-blocks/index.cjs.map +2 -2
  295. package/build/components/inserter-list-item/index.cjs.map +2 -2
  296. package/build/components/inserter-listbox/context.cjs.map +2 -2
  297. package/build/components/inserter-listbox/group.cjs.map +2 -2
  298. package/build/components/inserter-listbox/index.cjs.map +2 -2
  299. package/build/components/inserter-listbox/item.cjs.map +2 -2
  300. package/build/components/inserter-listbox/row.cjs.map +2 -2
  301. package/build/components/inserter-menu-extension/index.cjs.map +2 -2
  302. package/build/components/inspector-controls/block-support-slot-container.cjs.map +2 -2
  303. package/build/components/inspector-controls/block-support-tools-panel.cjs.map +2 -2
  304. package/build/components/inspector-controls/fill.cjs +15 -17
  305. package/build/components/inspector-controls/fill.cjs.map +2 -2
  306. package/build/components/inspector-controls/groups.cjs.map +2 -2
  307. package/build/components/inspector-controls/index.cjs.map +2 -2
  308. package/build/components/inspector-controls/last-item.cjs.map +2 -2
  309. package/build/components/inspector-controls/list-view-content-popover.cjs.map +2 -2
  310. package/build/components/inspector-controls/slot.cjs.map +2 -2
  311. package/build/components/inspector-controls-tabs/advanced-controls-panel.cjs.map +2 -2
  312. package/build/components/inspector-controls-tabs/content-tab.cjs.map +2 -2
  313. package/build/components/inspector-controls-tabs/index.cjs.map +2 -2
  314. package/build/components/inspector-controls-tabs/position-controls-panel.cjs.map +2 -2
  315. package/build/components/inspector-controls-tabs/settings-tab.cjs.map +2 -2
  316. package/build/components/inspector-controls-tabs/styles-tab.cjs.map +2 -2
  317. package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.cjs.map +2 -2
  318. package/build/components/inspector-controls-tabs/utils.cjs.map +2 -2
  319. package/build/components/inspector-popover-header/index.cjs.map +2 -2
  320. package/build/components/justify-content-control/index.cjs.map +2 -2
  321. package/build/components/justify-content-control/ui.cjs.map +2 -2
  322. package/build/components/keyboard-shortcuts/index.cjs.map +2 -2
  323. package/build/components/letter-spacing-control/index.cjs.map +2 -2
  324. package/build/components/line-height-control/index.cjs.map +2 -2
  325. package/build/components/link-control/constants.cjs.map +2 -2
  326. package/build/components/link-control/index.cjs.map +2 -2
  327. package/build/components/link-control/is-url-like.cjs.map +2 -2
  328. package/build/components/link-control/link-preview.cjs.map +2 -2
  329. package/build/components/link-control/normalize-url.cjs.map +2 -2
  330. package/build/components/link-control/search-create-button.cjs.map +2 -2
  331. package/build/components/link-control/search-input.cjs.map +2 -2
  332. package/build/components/link-control/search-item.cjs.map +2 -2
  333. package/build/components/link-control/search-results.cjs +1 -1
  334. package/build/components/link-control/search-results.cjs.map +2 -2
  335. package/build/components/link-control/settings-drawer.cjs.map +2 -2
  336. package/build/components/link-control/settings.cjs.map +2 -2
  337. package/build/components/link-control/use-create-page.cjs.map +2 -2
  338. package/build/components/link-control/use-internal-value.cjs.map +2 -2
  339. package/build/components/link-control/use-rich-url-data.cjs +1 -1
  340. package/build/components/link-control/use-rich-url-data.cjs.map +2 -2
  341. package/build/components/link-control/use-search-handler.cjs.map +2 -2
  342. package/build/components/link-control/viewer-slot.cjs.map +2 -2
  343. package/build/components/link-picker/link-picker.cjs.map +2 -2
  344. package/build/components/link-picker/link-preview.cjs.map +2 -2
  345. package/build/components/list-view/appender.cjs +6 -3
  346. package/build/components/list-view/appender.cjs.map +2 -2
  347. package/build/components/list-view/aria-referenced-text.cjs +2 -9
  348. package/build/components/list-view/aria-referenced-text.cjs.map +2 -2
  349. package/build/components/list-view/block-contents.cjs +17 -20
  350. package/build/components/list-view/block-contents.cjs.map +2 -2
  351. package/build/components/list-view/block-select-button.cjs +40 -19
  352. package/build/components/list-view/block-select-button.cjs.map +3 -3
  353. package/build/components/list-view/block.cjs +38 -41
  354. package/build/components/list-view/block.cjs.map +3 -3
  355. package/build/components/list-view/branch.cjs +93 -77
  356. package/build/components/list-view/branch.cjs.map +3 -3
  357. package/build/components/list-view/context.cjs +16 -2
  358. package/build/components/list-view/context.cjs.map +2 -2
  359. package/build/components/list-view/drop-indicator.cjs +4 -3
  360. package/build/components/list-view/drop-indicator.cjs.map +3 -3
  361. package/build/components/list-view/expander.cjs.map +2 -2
  362. package/build/components/list-view/index.cjs +83 -96
  363. package/build/components/list-view/index.cjs.map +2 -2
  364. package/build/components/list-view/leaf.cjs.map +2 -2
  365. package/build/components/list-view/use-block-selection.cjs.map +2 -2
  366. package/build/components/list-view/use-clipboard-handler.cjs.map +2 -2
  367. package/build/components/list-view/use-list-view-block-indexes.cjs.map +2 -2
  368. package/build/components/list-view/use-list-view-client-ids.cjs.map +2 -2
  369. package/build/components/list-view/use-list-view-collapse-items.cjs +3 -4
  370. package/build/components/list-view/use-list-view-collapse-items.cjs.map +2 -2
  371. package/build/components/list-view/use-list-view-drop-zone.cjs +7 -13
  372. package/build/components/list-view/use-list-view-drop-zone.cjs.map +2 -2
  373. package/build/components/list-view/use-list-view-expand-selected-item.cjs +3 -3
  374. package/build/components/list-view/use-list-view-expand-selected-item.cjs.map +2 -2
  375. package/build/components/list-view/use-list-view-images.cjs +4 -3
  376. package/build/components/list-view/use-list-view-images.cjs.map +2 -2
  377. package/build/components/list-view/use-list-view-scroll-into-view.cjs.map +2 -2
  378. package/build/components/list-view/utils.cjs +6 -3
  379. package/build/components/list-view/utils.cjs.map +2 -2
  380. package/build/components/media-placeholder/index.cjs.map +2 -2
  381. package/build/components/media-replace-flow/index.cjs.map +2 -2
  382. package/build/components/media-upload/check.cjs.map +2 -2
  383. package/build/components/media-upload/index.cjs.map +2 -2
  384. package/build/components/multi-selection-inspector/index.cjs +33 -12
  385. package/build/components/multi-selection-inspector/index.cjs.map +3 -3
  386. package/build/components/navigable-toolbar/index.cjs +29 -18
  387. package/build/components/navigable-toolbar/index.cjs.map +2 -2
  388. package/build/components/observe-typing/index.cjs.map +2 -2
  389. package/build/components/panel-color-settings/index.cjs.map +2 -2
  390. package/build/components/plain-text/index.cjs.map +2 -2
  391. package/build/components/preset-input-control/custom-value-controls.cjs.map +2 -2
  392. package/build/components/preset-input-control/index.cjs.map +2 -2
  393. package/build/components/preview-options/index.cjs.map +2 -2
  394. package/build/components/provider/block-refs-provider.cjs.map +2 -2
  395. package/build/components/provider/index.cjs.map +2 -2
  396. package/build/components/provider/selection-context.cjs.map +2 -2
  397. package/build/components/provider/use-block-sync.cjs.map +2 -2
  398. package/build/components/provider/use-media-upload-settings.cjs.map +2 -2
  399. package/build/components/provider/with-registry-provider.cjs.map +2 -2
  400. package/build/components/publish-date-time-picker/index.cjs.map +2 -2
  401. package/build/components/recursion-provider/index.cjs.map +2 -2
  402. package/build/components/resizable-box-popover/index.cjs.map +2 -2
  403. package/build/components/resolution-tool/index.cjs.map +2 -2
  404. package/build/components/responsive-block-control/index.cjs.map +2 -2
  405. package/build/components/responsive-block-control/label.cjs.map +2 -2
  406. package/build/components/rich-text/content.cjs.map +2 -2
  407. package/build/components/rich-text/event-listeners/before-input-rules.cjs.map +2 -2
  408. package/build/components/rich-text/event-listeners/delete.cjs.map +2 -2
  409. package/build/components/rich-text/event-listeners/enter.cjs.map +2 -2
  410. package/build/components/rich-text/event-listeners/firefox-compat.cjs.map +2 -2
  411. package/build/components/rich-text/event-listeners/index.cjs.map +2 -2
  412. package/build/components/rich-text/event-listeners/input-events.cjs.map +2 -2
  413. package/build/components/rich-text/event-listeners/input-rules.cjs +13 -10
  414. package/build/components/rich-text/event-listeners/input-rules.cjs.map +2 -2
  415. package/build/components/rich-text/event-listeners/insert-replacement-text.cjs.map +2 -2
  416. package/build/components/rich-text/event-listeners/paste-handler.cjs +8 -1
  417. package/build/components/rich-text/event-listeners/paste-handler.cjs.map +2 -2
  418. package/build/components/rich-text/event-listeners/remove-browser-shortcuts.cjs.map +2 -2
  419. package/build/components/rich-text/event-listeners/shortcuts.cjs.map +2 -2
  420. package/build/components/rich-text/event-listeners/undo-automatic-change.cjs.map +2 -2
  421. package/build/components/rich-text/format-edit.cjs.map +2 -2
  422. package/build/components/rich-text/format-toolbar/index.cjs.map +2 -2
  423. package/build/components/rich-text/format-toolbar-container.cjs.map +2 -2
  424. package/build/components/rich-text/get-rich-text-values.cjs.map +2 -2
  425. package/build/components/rich-text/index.cjs.map +2 -2
  426. package/build/components/rich-text/multiline.cjs.map +2 -2
  427. package/build/components/rich-text/prevent-event-discovery.cjs.map +2 -2
  428. package/build/components/rich-text/toolbar-button.cjs.map +2 -2
  429. package/build/components/rich-text/use-mark-persistent.cjs.map +2 -2
  430. package/build/components/rich-text/utils.cjs.map +2 -2
  431. package/build/components/rich-text/with-deprecations.cjs.map +2 -2
  432. package/build/components/selection-scroll-into-view/index.cjs.map +2 -2
  433. package/build/components/skip-to-selected-block/index.cjs.map +2 -2
  434. package/build/components/spacing-sizes-control/hooks/use-spacing-sizes.cjs.map +2 -2
  435. package/build/components/spacing-sizes-control/index.cjs +2 -2
  436. package/build/components/spacing-sizes-control/index.cjs.map +2 -2
  437. package/build/components/spacing-sizes-control/input-controls/axial.cjs.map +2 -2
  438. package/build/components/spacing-sizes-control/input-controls/separated.cjs.map +2 -2
  439. package/build/components/spacing-sizes-control/input-controls/single.cjs.map +2 -2
  440. package/build/components/spacing-sizes-control/input-controls/spacing-input-control.cjs.map +2 -2
  441. package/build/components/spacing-sizes-control/linked-button.cjs.map +2 -2
  442. package/build/components/spacing-sizes-control/utils.cjs.map +2 -2
  443. package/build/components/tabbed-sidebar/index.cjs.map +2 -2
  444. package/build/components/text-alignment-control/index.cjs.map +2 -2
  445. package/build/components/text-decoration-control/index.cjs.map +2 -2
  446. package/build/components/text-indent-control/index.cjs.map +2 -2
  447. package/build/components/text-transform-control/index.cjs.map +2 -2
  448. package/build/components/tool-selector/index.cjs.map +2 -2
  449. package/build/components/typewriter/index.cjs.map +2 -2
  450. package/build/components/unit-control/index.cjs.map +2 -2
  451. package/build/components/url-input/button.cjs.map +2 -2
  452. package/build/components/url-input/index.cjs +28 -46
  453. package/build/components/url-input/index.cjs.map +2 -2
  454. package/build/components/url-popover/image-url-input-ui.cjs +2 -2
  455. package/build/components/url-popover/image-url-input-ui.cjs.map +2 -2
  456. package/build/components/url-popover/index.cjs.map +2 -2
  457. package/build/components/url-popover/link-editor.cjs.map +2 -2
  458. package/build/components/url-popover/link-viewer-url.cjs.map +2 -2
  459. package/build/components/url-popover/link-viewer.cjs.map +2 -2
  460. package/build/components/use-block-commands/index.cjs +2 -1
  461. package/build/components/use-block-commands/index.cjs.map +2 -2
  462. package/build/components/use-block-display-information/index.cjs +6 -1
  463. package/build/components/use-block-display-information/index.cjs.map +2 -2
  464. package/build/components/use-block-drop-zone/index.cjs.map +2 -2
  465. package/build/components/use-flash-editable-blocks/index.cjs.map +2 -2
  466. package/build/components/use-list-view-panel-state/index.cjs.map +2 -2
  467. package/build/components/use-moving-animation/index.cjs +2 -2
  468. package/build/components/use-moving-animation/index.cjs.map +2 -2
  469. package/build/components/use-on-block-drop/index.cjs.map +2 -2
  470. package/build/components/use-paste-styles/index.cjs.map +2 -2
  471. package/build/components/use-resize-canvas/index.cjs.map +2 -2
  472. package/build/components/use-settings/index.cjs.map +2 -2
  473. package/build/components/warning/index.cjs.map +2 -2
  474. package/build/components/writing-flow/index.cjs.map +2 -2
  475. package/build/components/writing-flow/use-arrow-nav.cjs +6 -1
  476. package/build/components/writing-flow/use-arrow-nav.cjs.map +2 -2
  477. package/build/components/writing-flow/use-click-selection.cjs.map +2 -2
  478. package/build/components/writing-flow/use-clipboard-handler.cjs +29 -4
  479. package/build/components/writing-flow/use-clipboard-handler.cjs.map +3 -3
  480. package/build/components/writing-flow/use-drag-selection.cjs.map +2 -2
  481. package/build/components/writing-flow/use-editable-root-event-handlers.cjs.map +2 -2
  482. package/build/components/writing-flow/use-editable-root.cjs.map +2 -2
  483. package/build/components/writing-flow/use-home-end.cjs.map +2 -2
  484. package/build/components/writing-flow/use-input.cjs.map +2 -2
  485. package/build/components/writing-flow/use-multi-selection.cjs.map +2 -2
  486. package/build/components/writing-flow/use-preview-mode-nav.cjs.map +2 -2
  487. package/build/components/writing-flow/use-select-all.cjs.map +2 -2
  488. package/build/components/writing-flow/use-selection-observer.cjs.map +2 -2
  489. package/build/components/writing-flow/use-tab-nav.cjs +3 -1
  490. package/build/components/writing-flow/use-tab-nav.cjs.map +2 -2
  491. package/build/components/writing-flow/utils.cjs.map +2 -2
  492. package/build/components/writing-mode-control/index.cjs.map +2 -2
  493. package/build/hooks/align.cjs.map +2 -2
  494. package/build/hooks/allowed-blocks.cjs.map +2 -2
  495. package/build/hooks/anchor.cjs.map +2 -2
  496. package/build/hooks/aria-label.cjs.map +2 -2
  497. package/build/hooks/auto-inspector-controls.cjs.map +2 -2
  498. package/build/hooks/background.cjs +1 -4
  499. package/build/hooks/background.cjs.map +2 -2
  500. package/build/hooks/block-bindings.cjs.map +2 -2
  501. package/build/hooks/block-fields/fields-dropdown-menu.cjs.map +2 -2
  502. package/build/hooks/block-fields/index.cjs.map +2 -2
  503. package/build/hooks/block-fields/link/index.cjs.map +2 -2
  504. package/build/hooks/block-fields/media/index.cjs.map +2 -2
  505. package/build/hooks/block-fields/rich-text/index.cjs.map +2 -2
  506. package/build/hooks/block-fields/use-inspector-popover-placement.cjs.map +2 -2
  507. package/build/hooks/block-hooks.cjs.map +2 -2
  508. package/build/hooks/block-renaming.cjs.map +2 -2
  509. package/build/hooks/block-style-state.cjs.map +2 -2
  510. package/build/hooks/block-style-variation.cjs.map +2 -2
  511. package/build/hooks/border.cjs.map +2 -2
  512. package/build/hooks/color.cjs.map +2 -2
  513. package/build/hooks/compat.cjs.map +2 -2
  514. package/build/hooks/contrast-checker.cjs.map +2 -2
  515. package/build/hooks/custom-class-name.cjs.map +2 -2
  516. package/build/hooks/dimensions.cjs.map +2 -2
  517. package/build/hooks/duotone.cjs.map +2 -2
  518. package/build/hooks/elements.cjs.map +2 -2
  519. package/build/hooks/fit-text.cjs.map +2 -2
  520. package/build/hooks/font-family.cjs +2 -4
  521. package/build/hooks/font-family.cjs.map +3 -3
  522. package/build/hooks/font-size.cjs.map +2 -2
  523. package/build/hooks/gap.cjs.map +2 -2
  524. package/build/hooks/generated-class-name.cjs.map +2 -2
  525. package/build/hooks/grid-visualizer.cjs.map +2 -2
  526. package/build/hooks/index.cjs.map +2 -2
  527. package/build/hooks/layout-child.cjs.map +2 -2
  528. package/build/hooks/layout.cjs +4 -4
  529. package/build/hooks/layout.cjs.map +3 -3
  530. package/build/hooks/line-height.cjs.map +2 -2
  531. package/build/hooks/list-view.cjs.map +2 -2
  532. package/build/hooks/lock.cjs.map +2 -2
  533. package/build/hooks/metadata.cjs.map +2 -2
  534. package/build/hooks/position.cjs.map +2 -2
  535. package/build/hooks/settings.cjs.map +2 -2
  536. package/build/hooks/spacing-visualizer.cjs.map +2 -2
  537. package/build/hooks/state-utils.cjs.map +2 -2
  538. package/build/hooks/states.cjs.map +2 -2
  539. package/build/hooks/style.cjs.map +2 -2
  540. package/build/hooks/supports.cjs.map +2 -2
  541. package/build/hooks/text-align.cjs.map +2 -2
  542. package/build/hooks/typography.cjs.map +2 -2
  543. package/build/hooks/use-border-props.cjs.map +2 -2
  544. package/build/hooks/use-cached-truthy.cjs.map +2 -2
  545. package/build/hooks/use-color-props.cjs.map +2 -2
  546. package/build/hooks/use-content-only-section-edit.cjs.map +2 -2
  547. package/build/hooks/use-dimensions-props.cjs.map +2 -2
  548. package/build/hooks/use-shadow-props.cjs.map +2 -2
  549. package/build/hooks/use-spacing-props.cjs.map +2 -2
  550. package/build/hooks/use-typography-props.cjs +2 -4
  551. package/build/hooks/use-typography-props.cjs.map +3 -3
  552. package/build/hooks/use-zoom-out.cjs.map +2 -2
  553. package/build/hooks/utils.cjs.map +2 -2
  554. package/build/index.cjs.map +2 -2
  555. package/build/layouts/constrained.cjs.map +2 -2
  556. package/build/layouts/flex.cjs.map +2 -2
  557. package/build/layouts/flow.cjs.map +2 -2
  558. package/build/layouts/grid.cjs.map +2 -2
  559. package/build/layouts/index.cjs.map +2 -2
  560. package/build/layouts/utils.cjs.map +2 -2
  561. package/build/lock-unlock.cjs.map +2 -2
  562. package/build/private-apis.cjs.map +2 -2
  563. package/build/store/actions.cjs +104 -36
  564. package/build/store/actions.cjs.map +3 -3
  565. package/build/store/defaults.cjs +2 -0
  566. package/build/store/defaults.cjs.map +2 -2
  567. package/build/store/get-block-settings.cjs.map +2 -2
  568. package/build/store/index.cjs.map +2 -2
  569. package/build/store/private-actions.cjs +19 -2
  570. package/build/store/private-actions.cjs.map +2 -2
  571. package/build/store/private-selectors.cjs +28 -10
  572. package/build/store/private-selectors.cjs.map +2 -2
  573. package/build/store/reducer.cjs +3 -1
  574. package/build/store/reducer.cjs.map +2 -2
  575. package/build/store/selectors.cjs +21 -8
  576. package/build/store/selectors.cjs.map +2 -2
  577. package/build/store/utils.cjs.map +2 -2
  578. package/build/utils/fit-text-frontend.cjs.map +2 -2
  579. package/build/utils/format-font-style.cjs.map +2 -2
  580. package/build/utils/format-font-weight.cjs.map +2 -2
  581. package/build/utils/get-font-styles-and-weights.cjs.map +2 -2
  582. package/build/utils/group-blocks.cjs +42 -0
  583. package/build/utils/group-blocks.cjs.map +7 -0
  584. package/build/utils/native-undo.cjs.map +2 -2
  585. package/build/utils/pasting.cjs.map +2 -2
  586. package/build/utils/selection.cjs.map +2 -2
  587. package/build/utils/sibling-block-attributes.cjs +45 -0
  588. package/build/utils/sibling-block-attributes.cjs.map +7 -0
  589. package/build/utils/transform-styles/index.cjs.map +2 -2
  590. package/build/utils/use-notify-copy.cjs.map +2 -2
  591. package/build-module/autocompleters/block.mjs.map +2 -2
  592. package/build-module/components/alignment-control/index.mjs.map +2 -2
  593. package/build-module/components/alignment-control/ui.mjs.map +2 -2
  594. package/build-module/components/autocomplete/index.mjs.map +2 -2
  595. package/build-module/components/background-image-control/index.mjs.map +2 -2
  596. package/build-module/components/block-actions/index.mjs +3 -6
  597. package/build-module/components/block-actions/index.mjs.map +2 -2
  598. package/build-module/components/block-alignment-control/constants.mjs.map +2 -2
  599. package/build-module/components/block-alignment-control/index.mjs.map +2 -2
  600. package/build-module/components/block-alignment-control/ui.mjs.map +2 -2
  601. package/build-module/components/block-alignment-control/use-available-alignments.mjs.map +2 -2
  602. package/build-module/components/block-alignment-matrix-control/index.mjs.map +2 -2
  603. package/build-module/components/block-allowed-blocks/allowed-blocks-control.mjs.map +2 -2
  604. package/build-module/components/block-allowed-blocks/modal.mjs.map +2 -2
  605. package/build-module/components/block-bindings/attribute-control.mjs.map +2 -2
  606. package/build-module/components/block-bindings/index.mjs.map +2 -2
  607. package/build-module/components/block-bindings/source-fields-list.mjs.map +2 -2
  608. package/build-module/components/block-bindings/use-block-bindings-utils.mjs.map +2 -2
  609. package/build-module/components/block-breadcrumb/index.mjs.map +2 -2
  610. package/build-module/components/block-canvas/index.mjs.map +2 -2
  611. package/build-module/components/block-card/index.mjs.map +2 -2
  612. package/build-module/components/block-compare/block-view.mjs.map +2 -2
  613. package/build-module/components/block-compare/index.mjs.map +2 -2
  614. package/build-module/components/block-content-overlay/index.mjs.map +2 -2
  615. package/build-module/components/block-context/index.mjs.map +2 -2
  616. package/build-module/components/block-controls/fill.mjs.map +2 -2
  617. package/build-module/components/block-controls/groups.mjs.map +2 -2
  618. package/build-module/components/block-controls/hook.mjs.map +2 -2
  619. package/build-module/components/block-controls/index.mjs.map +2 -2
  620. package/build-module/components/block-controls/slot.mjs.map +2 -2
  621. package/build-module/components/block-draggable/draggable-chip.mjs.map +2 -2
  622. package/build-module/components/block-draggable/index.mjs.map +2 -2
  623. package/build-module/components/block-draggable/use-scroll-when-dragging.mjs.map +2 -2
  624. package/build-module/components/block-edit/context.mjs.map +2 -2
  625. package/build-module/components/block-edit/edit.mjs.map +2 -2
  626. package/build-module/components/block-edit/index.mjs.map +2 -2
  627. package/build-module/components/block-edit/multiple-usage-warning.mjs.map +2 -2
  628. package/build-module/components/block-edit-visually-button/index.mjs.map +2 -2
  629. package/build-module/components/block-editing-mode/index.mjs.map +2 -2
  630. package/build-module/components/block-full-height-alignment-control/index.mjs.map +2 -2
  631. package/build-module/components/block-heading-level-dropdown/heading-level-icon.mjs.map +2 -2
  632. package/build-module/components/block-heading-level-dropdown/index.mjs.map +2 -2
  633. package/build-module/components/block-icon/index.mjs.map +2 -2
  634. package/build-module/components/block-inspector/edit-contents.mjs +49 -41
  635. package/build-module/components/block-inspector/edit-contents.mjs.map +2 -2
  636. package/build-module/components/block-inspector/index.mjs +9 -4
  637. package/build-module/components/block-inspector/index.mjs.map +2 -2
  638. package/build-module/components/block-inspector/inspector-pre-tabs-slot-fill.mjs.map +2 -2
  639. package/build-module/components/block-inspector/useBlockInspectorAnimationSettings.mjs.map +2 -2
  640. package/build-module/components/block-list/block-crash-boundary.mjs.map +2 -2
  641. package/build-module/components/block-list/block-crash-warning.mjs.map +2 -2
  642. package/build-module/components/block-list/block-html.mjs.map +2 -2
  643. package/build-module/components/block-list/block-invalid-warning.mjs.map +2 -2
  644. package/build-module/components/block-list/block.mjs +36 -10
  645. package/build-module/components/block-list/block.mjs.map +3 -3
  646. package/build-module/components/block-list/index.mjs +34 -10
  647. package/build-module/components/block-list/index.mjs.map +2 -2
  648. package/build-module/components/block-list/layout.mjs.map +2 -2
  649. package/build-module/components/block-list/private-block-context.mjs.map +2 -2
  650. package/build-module/components/block-list/subdirectory-icon.mjs.map +2 -2
  651. package/build-module/components/block-list/use-block-props/index.mjs +36 -2
  652. package/build-module/components/block-list/use-block-props/index.mjs.map +2 -2
  653. package/build-module/components/block-list/use-block-props/use-block-refs.mjs.map +2 -2
  654. package/build-module/components/block-list/use-block-props/use-firefox-draggable-compatibility.mjs.map +2 -2
  655. package/build-module/components/block-list/use-block-props/use-focus-first-element.mjs.map +2 -2
  656. package/build-module/components/block-list/use-block-props/use-focus-handler.mjs.map +2 -2
  657. package/build-module/components/block-list/use-block-props/use-intersection-observer.mjs.map +2 -2
  658. package/build-module/components/block-list/use-block-props/use-is-hovered.mjs.map +2 -2
  659. package/build-module/components/block-list/use-block-props/use-register-block-event-handlers.mjs.map +2 -2
  660. package/build-module/components/block-list/use-block-props/use-scroll-into-view.mjs.map +2 -2
  661. package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.mjs.map +2 -2
  662. package/build-module/components/block-list/use-in-between-inserter.mjs.map +2 -2
  663. package/build-module/components/block-list/zoom-out-separator.mjs.map +2 -2
  664. package/build-module/components/block-list-appender/index.mjs.map +2 -2
  665. package/build-module/components/block-lock/menu-item.mjs.map +2 -2
  666. package/build-module/components/block-lock/modal.mjs.map +2 -2
  667. package/build-module/components/block-lock/toolbar.mjs.map +2 -2
  668. package/build-module/components/block-lock/use-block-lock.mjs.map +2 -2
  669. package/build-module/components/block-manager/category.mjs.map +2 -2
  670. package/build-module/components/block-manager/checklist.mjs.map +2 -2
  671. package/build-module/components/block-manager/index.mjs.map +2 -2
  672. package/build-module/components/block-mover/button.mjs +17 -11
  673. package/build-module/components/block-mover/button.mjs.map +2 -2
  674. package/build-module/components/block-mover/index.mjs.map +2 -2
  675. package/build-module/components/block-mover/mover-description.mjs.map +2 -2
  676. package/build-module/components/block-navigation/dropdown.mjs.map +2 -2
  677. package/build-module/components/block-parent-selector/index.mjs.map +2 -2
  678. package/build-module/components/block-pattern-setup/index.mjs.map +2 -2
  679. package/build-module/components/block-pattern-setup/setup-toolbar.mjs.map +2 -2
  680. package/build-module/components/block-pattern-setup/use-patterns-setup.mjs.map +2 -2
  681. package/build-module/components/block-patterns-list/index.mjs.map +2 -2
  682. package/build-module/components/block-patterns-paging/index.mjs.map +2 -2
  683. package/build-module/components/block-popover/cover.mjs.map +2 -2
  684. package/build-module/components/block-popover/drop-zone.mjs.map +2 -2
  685. package/build-module/components/block-popover/inbetween.mjs.map +2 -2
  686. package/build-module/components/block-popover/index.mjs.map +2 -2
  687. package/build-module/components/block-popover/use-popover-scroll.mjs.map +2 -2
  688. package/build-module/components/block-preview/async.mjs.map +2 -2
  689. package/build-module/components/block-preview/auto.mjs.map +2 -2
  690. package/build-module/components/block-preview/index.mjs.map +2 -2
  691. package/build-module/components/block-quick-navigation/index.mjs.map +2 -2
  692. package/build-module/components/block-removal-warning-modal/index.mjs.map +2 -2
  693. package/build-module/components/block-rename/modal.mjs.map +2 -2
  694. package/build-module/components/block-rename/rename-control.mjs.map +2 -2
  695. package/build-module/components/block-rename/use-block-rename.mjs.map +2 -2
  696. package/build-module/components/block-selection-clearer/index.mjs.map +2 -2
  697. package/build-module/components/block-settings-menu/block-html-convert-button.mjs.map +2 -2
  698. package/build-module/components/block-settings-menu/block-mode-toggle.mjs.map +2 -2
  699. package/build-module/components/block-settings-menu/block-parent-selector-menu-item.mjs.map +2 -2
  700. package/build-module/components/block-settings-menu/block-settings-dropdown.mjs +1 -1
  701. package/build-module/components/block-settings-menu/block-settings-dropdown.mjs.map +2 -2
  702. package/build-module/components/block-settings-menu/block-settings-menu-first-item.mjs.map +2 -2
  703. package/build-module/components/block-settings-menu/index.mjs.map +2 -2
  704. package/build-module/components/block-settings-menu-controls/index.mjs.map +2 -2
  705. package/build-module/components/block-styles/index.mjs.map +2 -2
  706. package/build-module/components/block-styles/menu-items.mjs.map +2 -2
  707. package/build-module/components/block-styles/use-styles-for-block.mjs.map +2 -2
  708. package/build-module/components/block-styles/utils.mjs.map +2 -2
  709. package/build-module/components/block-switcher/block-styles-menu.mjs.map +2 -2
  710. package/build-module/components/block-switcher/block-transformations-menu.mjs.map +2 -2
  711. package/build-module/components/block-switcher/block-variation-transformations.mjs.map +2 -2
  712. package/build-module/components/block-switcher/index.mjs.map +2 -2
  713. package/build-module/components/block-switcher/pattern-transformations-menu.mjs.map +2 -2
  714. package/build-module/components/block-switcher/preview-block-popover.mjs.map +2 -2
  715. package/build-module/components/block-switcher/use-transformed-patterns.mjs.map +2 -2
  716. package/build-module/components/block-switcher/utils.mjs.map +2 -2
  717. package/build-module/components/block-title/index.mjs.map +2 -2
  718. package/build-module/components/block-title/use-block-display-title.mjs.map +2 -2
  719. package/build-module/components/block-toolbar/block-styles-dropdown.mjs.map +2 -2
  720. package/build-module/components/block-toolbar/block-toolbar-icon.mjs.map +2 -2
  721. package/build-module/components/block-toolbar/block-toolbar-last-item.mjs.map +2 -2
  722. package/build-module/components/block-toolbar/change-design.mjs.map +2 -2
  723. package/build-module/components/block-toolbar/edit-section-button.mjs.map +2 -2
  724. package/build-module/components/block-toolbar/index.mjs.map +2 -2
  725. package/build-module/components/block-toolbar/pattern-overrides-dropdown.mjs.map +2 -2
  726. package/build-module/components/block-toolbar/switch-section-style.mjs.map +2 -2
  727. package/build-module/components/block-toolbar/use-has-block-toolbar.mjs.map +2 -2
  728. package/build-module/components/block-toolbar/utils.mjs.map +2 -2
  729. package/build-module/components/block-tools/block-toolbar-popover.mjs.map +2 -2
  730. package/build-module/components/block-tools/empty-block-inserter.mjs.map +2 -2
  731. package/build-module/components/block-tools/index.mjs +3 -9
  732. package/build-module/components/block-tools/index.mjs.map +2 -2
  733. package/build-module/components/block-tools/insertion-point.mjs.map +2 -2
  734. package/build-module/components/block-tools/use-block-toolbar-popover-props.mjs.map +2 -2
  735. package/build-module/components/block-tools/use-selected-block-tool-props.mjs.map +2 -2
  736. package/build-module/components/block-tools/use-show-block-tools.mjs.map +2 -2
  737. package/build-module/components/block-tools/zoom-out-mode-inserter-button.mjs.map +2 -2
  738. package/build-module/components/block-tools/zoom-out-mode-inserters.mjs.map +2 -2
  739. package/build-module/components/block-types-list/index.mjs.map +2 -2
  740. package/build-module/components/block-variation-picker/index.mjs.map +2 -2
  741. package/build-module/components/block-variation-transforms/index.mjs.map +2 -2
  742. package/build-module/components/block-vertical-alignment-control/index.mjs.map +2 -2
  743. package/build-module/components/block-vertical-alignment-control/ui.mjs.map +2 -2
  744. package/build-module/components/block-visibility/constants.mjs +1 -1
  745. package/build-module/components/block-visibility/constants.mjs.map +3 -3
  746. package/build-module/components/block-visibility/modal.mjs.map +2 -2
  747. package/build-module/components/block-visibility/use-block-visibility.mjs +15 -17
  748. package/build-module/components/block-visibility/use-block-visibility.mjs.map +3 -3
  749. package/build-module/components/block-visibility/utils.mjs.map +2 -2
  750. package/build-module/components/block-visibility/viewport-menu-item.mjs.map +2 -2
  751. package/build-module/components/block-visibility/viewport-toolbar.mjs.map +2 -2
  752. package/build-module/components/block-visibility/viewport-visibility-info.mjs.map +2 -2
  753. package/build-module/components/border-radius-control/constants.mjs.map +2 -2
  754. package/build-module/components/border-radius-control/index.mjs.map +2 -2
  755. package/build-module/components/border-radius-control/linked-button.mjs.map +2 -2
  756. package/build-module/components/border-radius-control/utils.mjs.map +2 -2
  757. package/build-module/components/button-block-appender/index.mjs.map +2 -2
  758. package/build-module/components/child-layout-control/index.mjs.map +2 -2
  759. package/build-module/components/collab/note-icon-slot.mjs.map +2 -2
  760. package/build-module/components/collab/note-icon-toolbar-slot.mjs.map +2 -2
  761. package/build-module/components/color-palette/control.mjs.map +2 -2
  762. package/build-module/components/color-palette/index.mjs.map +2 -2
  763. package/build-module/components/color-palette/with-color-context.mjs.map +2 -2
  764. package/build-module/components/color-style-selector/index.mjs.map +2 -2
  765. package/build-module/components/colors/utils.mjs +1 -3
  766. package/build-module/components/colors/utils.mjs.map +2 -2
  767. package/build-module/components/colors/with-colors.mjs +1 -3
  768. package/build-module/components/colors/with-colors.mjs.map +2 -2
  769. package/build-module/components/colors-gradients/control.mjs.map +2 -2
  770. package/build-module/components/colors-gradients/dropdown.mjs.map +2 -2
  771. package/build-module/components/colors-gradients/panel-color-gradient-settings.mjs +5 -5
  772. package/build-module/components/colors-gradients/panel-color-gradient-settings.mjs.map +2 -2
  773. package/build-module/components/colors-gradients/use-multiple-origin-colors-and-gradients.mjs.map +2 -2
  774. package/build-module/components/contrast-checker/index.mjs.map +2 -2
  775. package/build-module/components/convert-to-group-buttons/index.mjs +2 -5
  776. package/build-module/components/convert-to-group-buttons/index.mjs.map +2 -2
  777. package/build-module/components/convert-to-group-buttons/toolbar.mjs +3 -5
  778. package/build-module/components/convert-to-group-buttons/toolbar.mjs.map +2 -2
  779. package/build-module/components/convert-to-group-buttons/use-convert-to-group-button-props.mjs.map +2 -2
  780. package/build-module/components/copy-handler/index.mjs.map +2 -2
  781. package/build-module/components/date-format-picker/index.mjs.map +2 -2
  782. package/build-module/components/default-block-appender/index.mjs.map +2 -2
  783. package/build-module/components/dimension-control/index.mjs.map +2 -2
  784. package/build-module/components/dimensions-tool/aspect-ratio-tool.mjs.map +2 -2
  785. package/build-module/components/dimensions-tool/index.mjs.map +2 -2
  786. package/build-module/components/dimensions-tool/scale-tool.mjs.map +2 -2
  787. package/build-module/components/dimensions-tool/width-height-tool.mjs.map +2 -2
  788. package/build-module/components/duotone-control/index.mjs.map +2 -2
  789. package/build-module/components/editable-text/index.mjs.map +2 -2
  790. package/build-module/components/editor-styles/index.mjs.map +2 -2
  791. package/build-module/components/fit-text-size-warning/index.mjs.map +2 -2
  792. package/build-module/components/floating-toolbar/nav-up-icon.mjs.map +2 -2
  793. package/build-module/components/font-appearance-control/index.mjs.map +2 -2
  794. package/build-module/components/font-family/index.mjs.map +2 -2
  795. package/build-module/components/font-sizes/font-size-picker.mjs.map +2 -2
  796. package/build-module/components/font-sizes/utils.mjs +1 -3
  797. package/build-module/components/font-sizes/utils.mjs.map +2 -2
  798. package/build-module/components/font-sizes/with-font-sizes.mjs.map +2 -2
  799. package/build-module/components/global-styles/advanced-panel.mjs.map +2 -2
  800. package/build-module/components/global-styles/background-panel.mjs.map +2 -2
  801. package/build-module/components/global-styles/border-panel.mjs.map +2 -2
  802. package/build-module/components/global-styles/color-gradient-dropdown-item.mjs.map +2 -2
  803. package/build-module/components/global-styles/color-panel.mjs.map +2 -2
  804. package/build-module/components/global-styles/dimensions-panel.mjs.map +2 -2
  805. package/build-module/components/global-styles/filters-panel.mjs.map +2 -2
  806. package/build-module/components/global-styles/hooks.mjs.map +2 -2
  807. package/build-module/components/global-styles/image-settings-panel.mjs.map +2 -2
  808. package/build-module/components/global-styles/inheritance/index.mjs.map +2 -2
  809. package/build-module/components/global-styles/inherited-value-context.mjs.map +2 -2
  810. package/build-module/components/global-styles/shadow-panel-components.mjs.map +2 -2
  811. package/build-module/components/global-styles/state-control-badges.mjs.map +2 -2
  812. package/build-module/components/global-styles/state-control.mjs.map +2 -2
  813. package/build-module/components/global-styles/typography-panel.mjs.map +2 -2
  814. package/build-module/components/global-styles/typography-utils.mjs.map +2 -2
  815. package/build-module/components/global-styles/utils.mjs.map +2 -2
  816. package/build-module/components/gradients/use-gradient.mjs.map +2 -2
  817. package/build-module/components/gradients/with-gradient.mjs.map +2 -2
  818. package/build-module/components/grid/grid-item-movers.mjs.map +2 -2
  819. package/build-module/components/grid/grid-item-resizer.mjs.map +2 -2
  820. package/build-module/components/grid/grid-visualizer.mjs.map +2 -2
  821. package/build-module/components/grid/use-get-number-of-blocks-before-cell.mjs.map +2 -2
  822. package/build-module/components/grid/use-grid-layout-sync.mjs.map +2 -2
  823. package/build-module/components/height-control/index.mjs.map +2 -2
  824. package/build-module/components/html-element-control/index.mjs.map +2 -2
  825. package/build-module/components/html-element-control/messages.mjs.map +2 -2
  826. package/build-module/components/iframe/index.mjs +19 -24
  827. package/build-module/components/iframe/index.mjs.map +2 -2
  828. package/build-module/components/iframe/use-scale-canvas.mjs +21 -7
  829. package/build-module/components/iframe/use-scale-canvas.mjs.map +2 -2
  830. package/build-module/components/image-editor/aspect-ratio-dropdown.mjs.map +2 -2
  831. package/build-module/components/image-editor/context.mjs.map +2 -2
  832. package/build-module/components/image-editor/cropper.mjs.map +2 -2
  833. package/build-module/components/image-editor/form-controls.mjs.map +2 -2
  834. package/build-module/components/image-editor/index.mjs.map +2 -2
  835. package/build-module/components/image-editor/rotation-button.mjs.map +2 -2
  836. package/build-module/components/image-editor/use-save-image.mjs.map +2 -2
  837. package/build-module/components/image-editor/use-transform-image.mjs.map +2 -2
  838. package/build-module/components/image-editor/zoom-dropdown.mjs.map +2 -2
  839. package/build-module/components/image-size-control/index.mjs.map +2 -2
  840. package/build-module/components/image-size-control/use-dimension-handler.mjs.map +2 -2
  841. package/build-module/components/inner-blocks/button-block-appender.mjs.map +2 -2
  842. package/build-module/components/inner-blocks/default-block-appender.mjs.map +2 -2
  843. package/build-module/components/inner-blocks/index.mjs.map +2 -2
  844. package/build-module/components/inner-blocks/use-block-context.mjs.map +2 -2
  845. package/build-module/components/inner-blocks/use-inner-block-template-sync.mjs +35 -8
  846. package/build-module/components/inner-blocks/use-inner-block-template-sync.mjs.map +2 -2
  847. package/build-module/components/inner-blocks/use-nested-settings-update.mjs.map +2 -2
  848. package/build-module/components/inner-content/index.mjs.map +2 -2
  849. package/build-module/components/inserter/block-patterns-explorer/index.mjs.map +2 -2
  850. package/build-module/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.mjs.map +2 -2
  851. package/build-module/components/inserter/block-patterns-explorer/pattern-list.mjs.map +2 -2
  852. package/build-module/components/inserter/block-patterns-tab/index.mjs.map +2 -2
  853. package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.mjs.map +2 -2
  854. package/build-module/components/inserter/block-patterns-tab/patterns-filter.mjs.map +2 -2
  855. package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.mjs.map +2 -2
  856. package/build-module/components/inserter/block-patterns-tab/utils.mjs.map +2 -2
  857. package/build-module/components/inserter/block-types-tab.mjs.map +2 -2
  858. package/build-module/components/inserter/category-tabs/index.mjs.map +2 -2
  859. package/build-module/components/inserter/hooks/use-block-types-state.mjs.map +2 -2
  860. package/build-module/components/inserter/hooks/use-insertion-point.mjs.map +2 -2
  861. package/build-module/components/inserter/hooks/use-patterns-paging.mjs.map +2 -2
  862. package/build-module/components/inserter/hooks/use-patterns-state.mjs.map +2 -2
  863. package/build-module/components/inserter/index.mjs +4 -13
  864. package/build-module/components/inserter/index.mjs.map +2 -2
  865. package/build-module/components/inserter/library.mjs.map +2 -2
  866. package/build-module/components/inserter/media-tab/hooks.mjs.map +2 -2
  867. package/build-module/components/inserter/media-tab/media-list.mjs.map +2 -2
  868. package/build-module/components/inserter/media-tab/media-panel.mjs.map +2 -2
  869. package/build-module/components/inserter/media-tab/media-preview.mjs.map +2 -2
  870. package/build-module/components/inserter/media-tab/media-tab.mjs.map +2 -2
  871. package/build-module/components/inserter/media-tab/utils.mjs.map +2 -2
  872. package/build-module/components/inserter/menu.mjs.map +2 -2
  873. package/build-module/components/inserter/mobile-tab-navigation.mjs.map +2 -2
  874. package/build-module/components/inserter/no-results.mjs.map +2 -2
  875. package/build-module/components/inserter/panel.mjs.map +2 -2
  876. package/build-module/components/inserter/preview-panel.mjs.map +2 -2
  877. package/build-module/components/inserter/quick-inserter.mjs.map +2 -2
  878. package/build-module/components/inserter/search-items.mjs.map +2 -2
  879. package/build-module/components/inserter/search-results.mjs.map +2 -2
  880. package/build-module/components/inserter/tips.mjs.map +2 -2
  881. package/build-module/components/inserter-button/sparkles.mjs.map +2 -2
  882. package/build-module/components/inserter-draggable-blocks/index.mjs.map +2 -2
  883. package/build-module/components/inserter-list-item/index.mjs.map +2 -2
  884. package/build-module/components/inserter-listbox/context.mjs.map +2 -2
  885. package/build-module/components/inserter-listbox/group.mjs.map +2 -2
  886. package/build-module/components/inserter-listbox/index.mjs.map +2 -2
  887. package/build-module/components/inserter-listbox/item.mjs.map +2 -2
  888. package/build-module/components/inserter-listbox/row.mjs.map +2 -2
  889. package/build-module/components/inserter-menu-extension/index.mjs.map +2 -2
  890. package/build-module/components/inspector-controls/block-support-slot-container.mjs.map +2 -2
  891. package/build-module/components/inspector-controls/block-support-tools-panel.mjs.map +2 -2
  892. package/build-module/components/inspector-controls/fill.mjs +15 -17
  893. package/build-module/components/inspector-controls/fill.mjs.map +2 -2
  894. package/build-module/components/inspector-controls/groups.mjs.map +2 -2
  895. package/build-module/components/inspector-controls/index.mjs.map +2 -2
  896. package/build-module/components/inspector-controls/last-item.mjs.map +2 -2
  897. package/build-module/components/inspector-controls/list-view-content-popover.mjs.map +2 -2
  898. package/build-module/components/inspector-controls/slot.mjs.map +2 -2
  899. package/build-module/components/inspector-controls-tabs/advanced-controls-panel.mjs.map +2 -2
  900. package/build-module/components/inspector-controls-tabs/content-tab.mjs.map +2 -2
  901. package/build-module/components/inspector-controls-tabs/index.mjs.map +2 -2
  902. package/build-module/components/inspector-controls-tabs/position-controls-panel.mjs.map +2 -2
  903. package/build-module/components/inspector-controls-tabs/settings-tab.mjs.map +2 -2
  904. package/build-module/components/inspector-controls-tabs/styles-tab.mjs.map +2 -2
  905. package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.mjs.map +2 -2
  906. package/build-module/components/inspector-controls-tabs/utils.mjs.map +2 -2
  907. package/build-module/components/inspector-popover-header/index.mjs.map +2 -2
  908. package/build-module/components/justify-content-control/index.mjs.map +2 -2
  909. package/build-module/components/justify-content-control/ui.mjs.map +2 -2
  910. package/build-module/components/keyboard-shortcuts/index.mjs.map +2 -2
  911. package/build-module/components/letter-spacing-control/index.mjs.map +2 -2
  912. package/build-module/components/line-height-control/index.mjs.map +2 -2
  913. package/build-module/components/link-control/constants.mjs.map +2 -2
  914. package/build-module/components/link-control/index.mjs.map +2 -2
  915. package/build-module/components/link-control/is-url-like.mjs.map +2 -2
  916. package/build-module/components/link-control/link-preview.mjs.map +2 -2
  917. package/build-module/components/link-control/normalize-url.mjs.map +2 -2
  918. package/build-module/components/link-control/search-create-button.mjs.map +2 -2
  919. package/build-module/components/link-control/search-input.mjs.map +2 -2
  920. package/build-module/components/link-control/search-item.mjs.map +2 -2
  921. package/build-module/components/link-control/search-results.mjs +1 -1
  922. package/build-module/components/link-control/search-results.mjs.map +2 -2
  923. package/build-module/components/link-control/settings-drawer.mjs.map +2 -2
  924. package/build-module/components/link-control/settings.mjs.map +2 -2
  925. package/build-module/components/link-control/use-create-page.mjs.map +2 -2
  926. package/build-module/components/link-control/use-internal-value.mjs.map +2 -2
  927. package/build-module/components/link-control/use-rich-url-data.mjs +1 -1
  928. package/build-module/components/link-control/use-rich-url-data.mjs.map +2 -2
  929. package/build-module/components/link-control/use-search-handler.mjs.map +2 -2
  930. package/build-module/components/link-control/viewer-slot.mjs.map +2 -2
  931. package/build-module/components/link-picker/link-picker.mjs.map +2 -2
  932. package/build-module/components/link-picker/link-preview.mjs.map +2 -2
  933. package/build-module/components/list-view/appender.mjs +7 -4
  934. package/build-module/components/list-view/appender.mjs.map +2 -2
  935. package/build-module/components/list-view/aria-referenced-text.mjs +2 -9
  936. package/build-module/components/list-view/aria-referenced-text.mjs.map +2 -2
  937. package/build-module/components/list-view/block-contents.mjs +18 -21
  938. package/build-module/components/list-view/block-contents.mjs.map +2 -2
  939. package/build-module/components/list-view/block-select-button.mjs +49 -26
  940. package/build-module/components/list-view/block-select-button.mjs.map +2 -2
  941. package/build-module/components/list-view/block.mjs +40 -47
  942. package/build-module/components/list-view/block.mjs.map +2 -2
  943. package/build-module/components/list-view/branch.mjs +100 -80
  944. package/build-module/components/list-view/branch.mjs.map +2 -2
  945. package/build-module/components/list-view/context.mjs +11 -1
  946. package/build-module/components/list-view/context.mjs.map +2 -2
  947. package/build-module/components/list-view/drop-indicator.mjs +6 -6
  948. package/build-module/components/list-view/drop-indicator.mjs.map +2 -2
  949. package/build-module/components/list-view/expander.mjs.map +2 -2
  950. package/build-module/components/list-view/index.mjs +87 -95
  951. package/build-module/components/list-view/index.mjs.map +2 -2
  952. package/build-module/components/list-view/leaf.mjs.map +2 -2
  953. package/build-module/components/list-view/use-block-selection.mjs.map +2 -2
  954. package/build-module/components/list-view/use-clipboard-handler.mjs.map +2 -2
  955. package/build-module/components/list-view/use-list-view-block-indexes.mjs.map +2 -2
  956. package/build-module/components/list-view/use-list-view-client-ids.mjs.map +2 -2
  957. package/build-module/components/list-view/use-list-view-collapse-items.mjs +3 -4
  958. package/build-module/components/list-view/use-list-view-collapse-items.mjs.map +2 -2
  959. package/build-module/components/list-view/use-list-view-drop-zone.mjs +7 -13
  960. package/build-module/components/list-view/use-list-view-drop-zone.mjs.map +2 -2
  961. package/build-module/components/list-view/use-list-view-expand-selected-item.mjs +3 -3
  962. package/build-module/components/list-view/use-list-view-expand-selected-item.mjs.map +2 -2
  963. package/build-module/components/list-view/use-list-view-images.mjs +4 -3
  964. package/build-module/components/list-view/use-list-view-images.mjs.map +2 -2
  965. package/build-module/components/list-view/use-list-view-scroll-into-view.mjs.map +2 -2
  966. package/build-module/components/list-view/utils.mjs +5 -3
  967. package/build-module/components/list-view/utils.mjs.map +2 -2
  968. package/build-module/components/media-placeholder/index.mjs.map +2 -2
  969. package/build-module/components/media-replace-flow/index.mjs.map +2 -2
  970. package/build-module/components/media-upload/check.mjs.map +2 -2
  971. package/build-module/components/media-upload/index.mjs.map +2 -2
  972. package/build-module/components/multi-selection-inspector/index.mjs +33 -12
  973. package/build-module/components/multi-selection-inspector/index.mjs.map +2 -2
  974. package/build-module/components/navigable-toolbar/index.mjs +30 -18
  975. package/build-module/components/navigable-toolbar/index.mjs.map +2 -2
  976. package/build-module/components/observe-typing/index.mjs.map +2 -2
  977. package/build-module/components/panel-color-settings/index.mjs.map +2 -2
  978. package/build-module/components/plain-text/index.mjs.map +2 -2
  979. package/build-module/components/preset-input-control/custom-value-controls.mjs.map +2 -2
  980. package/build-module/components/preset-input-control/index.mjs.map +2 -2
  981. package/build-module/components/preview-options/index.mjs.map +2 -2
  982. package/build-module/components/provider/block-refs-provider.mjs.map +2 -2
  983. package/build-module/components/provider/index.mjs.map +2 -2
  984. package/build-module/components/provider/selection-context.mjs.map +2 -2
  985. package/build-module/components/provider/use-block-sync.mjs.map +2 -2
  986. package/build-module/components/provider/use-media-upload-settings.mjs.map +2 -2
  987. package/build-module/components/provider/with-registry-provider.mjs.map +2 -2
  988. package/build-module/components/publish-date-time-picker/index.mjs.map +2 -2
  989. package/build-module/components/recursion-provider/index.mjs.map +2 -2
  990. package/build-module/components/resizable-box-popover/index.mjs.map +2 -2
  991. package/build-module/components/resolution-tool/index.mjs.map +2 -2
  992. package/build-module/components/responsive-block-control/index.mjs.map +2 -2
  993. package/build-module/components/responsive-block-control/label.mjs.map +2 -2
  994. package/build-module/components/rich-text/content.mjs.map +2 -2
  995. package/build-module/components/rich-text/event-listeners/before-input-rules.mjs.map +2 -2
  996. package/build-module/components/rich-text/event-listeners/delete.mjs.map +2 -2
  997. package/build-module/components/rich-text/event-listeners/enter.mjs.map +2 -2
  998. package/build-module/components/rich-text/event-listeners/firefox-compat.mjs.map +2 -2
  999. package/build-module/components/rich-text/event-listeners/index.mjs.map +2 -2
  1000. package/build-module/components/rich-text/event-listeners/input-events.mjs.map +2 -2
  1001. package/build-module/components/rich-text/event-listeners/input-rules.mjs +13 -10
  1002. package/build-module/components/rich-text/event-listeners/input-rules.mjs.map +2 -2
  1003. package/build-module/components/rich-text/event-listeners/insert-replacement-text.mjs.map +2 -2
  1004. package/build-module/components/rich-text/event-listeners/paste-handler.mjs +8 -1
  1005. package/build-module/components/rich-text/event-listeners/paste-handler.mjs.map +2 -2
  1006. package/build-module/components/rich-text/event-listeners/remove-browser-shortcuts.mjs.map +2 -2
  1007. package/build-module/components/rich-text/event-listeners/shortcuts.mjs.map +2 -2
  1008. package/build-module/components/rich-text/event-listeners/undo-automatic-change.mjs.map +2 -2
  1009. package/build-module/components/rich-text/format-edit.mjs.map +2 -2
  1010. package/build-module/components/rich-text/format-toolbar/index.mjs.map +2 -2
  1011. package/build-module/components/rich-text/format-toolbar-container.mjs.map +2 -2
  1012. package/build-module/components/rich-text/get-rich-text-values.mjs.map +2 -2
  1013. package/build-module/components/rich-text/index.mjs.map +2 -2
  1014. package/build-module/components/rich-text/multiline.mjs.map +2 -2
  1015. package/build-module/components/rich-text/prevent-event-discovery.mjs.map +2 -2
  1016. package/build-module/components/rich-text/toolbar-button.mjs.map +2 -2
  1017. package/build-module/components/rich-text/use-mark-persistent.mjs.map +2 -2
  1018. package/build-module/components/rich-text/utils.mjs.map +2 -2
  1019. package/build-module/components/rich-text/with-deprecations.mjs.map +2 -2
  1020. package/build-module/components/selection-scroll-into-view/index.mjs.map +2 -2
  1021. package/build-module/components/skip-to-selected-block/index.mjs.map +2 -2
  1022. package/build-module/components/spacing-sizes-control/hooks/use-spacing-sizes.mjs.map +2 -2
  1023. package/build-module/components/spacing-sizes-control/index.mjs +2 -2
  1024. package/build-module/components/spacing-sizes-control/index.mjs.map +2 -2
  1025. package/build-module/components/spacing-sizes-control/input-controls/axial.mjs.map +2 -2
  1026. package/build-module/components/spacing-sizes-control/input-controls/separated.mjs.map +2 -2
  1027. package/build-module/components/spacing-sizes-control/input-controls/single.mjs.map +2 -2
  1028. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.mjs.map +2 -2
  1029. package/build-module/components/spacing-sizes-control/linked-button.mjs.map +2 -2
  1030. package/build-module/components/spacing-sizes-control/utils.mjs.map +2 -2
  1031. package/build-module/components/tabbed-sidebar/index.mjs.map +2 -2
  1032. package/build-module/components/text-alignment-control/index.mjs.map +2 -2
  1033. package/build-module/components/text-decoration-control/index.mjs.map +2 -2
  1034. package/build-module/components/text-indent-control/index.mjs.map +2 -2
  1035. package/build-module/components/text-transform-control/index.mjs.map +2 -2
  1036. package/build-module/components/tool-selector/index.mjs.map +2 -2
  1037. package/build-module/components/typewriter/index.mjs.map +2 -2
  1038. package/build-module/components/unit-control/index.mjs.map +2 -2
  1039. package/build-module/components/url-input/button.mjs.map +2 -2
  1040. package/build-module/components/url-input/index.mjs +28 -46
  1041. package/build-module/components/url-input/index.mjs.map +2 -2
  1042. package/build-module/components/url-popover/image-url-input-ui.mjs +2 -2
  1043. package/build-module/components/url-popover/image-url-input-ui.mjs.map +2 -2
  1044. package/build-module/components/url-popover/index.mjs.map +2 -2
  1045. package/build-module/components/url-popover/link-editor.mjs.map +2 -2
  1046. package/build-module/components/url-popover/link-viewer-url.mjs.map +2 -2
  1047. package/build-module/components/url-popover/link-viewer.mjs.map +2 -2
  1048. package/build-module/components/use-block-commands/index.mjs +2 -1
  1049. package/build-module/components/use-block-commands/index.mjs.map +2 -2
  1050. package/build-module/components/use-block-display-information/index.mjs +2 -1
  1051. package/build-module/components/use-block-display-information/index.mjs.map +2 -2
  1052. package/build-module/components/use-block-drop-zone/index.mjs.map +2 -2
  1053. package/build-module/components/use-flash-editable-blocks/index.mjs.map +2 -2
  1054. package/build-module/components/use-list-view-panel-state/index.mjs.map +2 -2
  1055. package/build-module/components/use-moving-animation/index.mjs +2 -2
  1056. package/build-module/components/use-moving-animation/index.mjs.map +2 -2
  1057. package/build-module/components/use-on-block-drop/index.mjs.map +2 -2
  1058. package/build-module/components/use-paste-styles/index.mjs.map +2 -2
  1059. package/build-module/components/use-resize-canvas/index.mjs.map +2 -2
  1060. package/build-module/components/use-settings/index.mjs.map +2 -2
  1061. package/build-module/components/warning/index.mjs.map +2 -2
  1062. package/build-module/components/writing-flow/index.mjs.map +2 -2
  1063. package/build-module/components/writing-flow/use-arrow-nav.mjs +11 -2
  1064. package/build-module/components/writing-flow/use-arrow-nav.mjs.map +2 -2
  1065. package/build-module/components/writing-flow/use-click-selection.mjs.map +2 -2
  1066. package/build-module/components/writing-flow/use-clipboard-handler.mjs +31 -5
  1067. package/build-module/components/writing-flow/use-clipboard-handler.mjs.map +2 -2
  1068. package/build-module/components/writing-flow/use-drag-selection.mjs.map +2 -2
  1069. package/build-module/components/writing-flow/use-editable-root-event-handlers.mjs.map +2 -2
  1070. package/build-module/components/writing-flow/use-editable-root.mjs.map +2 -2
  1071. package/build-module/components/writing-flow/use-home-end.mjs.map +2 -2
  1072. package/build-module/components/writing-flow/use-input.mjs.map +2 -2
  1073. package/build-module/components/writing-flow/use-multi-selection.mjs.map +2 -2
  1074. package/build-module/components/writing-flow/use-preview-mode-nav.mjs.map +2 -2
  1075. package/build-module/components/writing-flow/use-select-all.mjs.map +2 -2
  1076. package/build-module/components/writing-flow/use-selection-observer.mjs.map +2 -2
  1077. package/build-module/components/writing-flow/use-tab-nav.mjs +3 -1
  1078. package/build-module/components/writing-flow/use-tab-nav.mjs.map +2 -2
  1079. package/build-module/components/writing-flow/utils.mjs.map +2 -2
  1080. package/build-module/components/writing-mode-control/index.mjs.map +2 -2
  1081. package/build-module/hooks/align.mjs.map +2 -2
  1082. package/build-module/hooks/allowed-blocks.mjs.map +2 -2
  1083. package/build-module/hooks/anchor.mjs.map +2 -2
  1084. package/build-module/hooks/aria-label.mjs.map +2 -2
  1085. package/build-module/hooks/auto-inspector-controls.mjs.map +2 -2
  1086. package/build-module/hooks/background.mjs +1 -4
  1087. package/build-module/hooks/background.mjs.map +2 -2
  1088. package/build-module/hooks/block-bindings.mjs.map +2 -2
  1089. package/build-module/hooks/block-fields/fields-dropdown-menu.mjs.map +2 -2
  1090. package/build-module/hooks/block-fields/index.mjs.map +2 -2
  1091. package/build-module/hooks/block-fields/link/index.mjs.map +2 -2
  1092. package/build-module/hooks/block-fields/media/index.mjs.map +2 -2
  1093. package/build-module/hooks/block-fields/rich-text/index.mjs.map +2 -2
  1094. package/build-module/hooks/block-fields/use-inspector-popover-placement.mjs.map +2 -2
  1095. package/build-module/hooks/block-hooks.mjs.map +2 -2
  1096. package/build-module/hooks/block-renaming.mjs.map +2 -2
  1097. package/build-module/hooks/block-style-state.mjs.map +2 -2
  1098. package/build-module/hooks/block-style-variation.mjs.map +2 -2
  1099. package/build-module/hooks/border.mjs.map +2 -2
  1100. package/build-module/hooks/color.mjs.map +2 -2
  1101. package/build-module/hooks/compat.mjs.map +2 -2
  1102. package/build-module/hooks/contrast-checker.mjs.map +2 -2
  1103. package/build-module/hooks/custom-class-name.mjs.map +2 -2
  1104. package/build-module/hooks/dimensions.mjs.map +2 -2
  1105. package/build-module/hooks/duotone.mjs.map +2 -2
  1106. package/build-module/hooks/elements.mjs.map +2 -2
  1107. package/build-module/hooks/fit-text.mjs.map +2 -2
  1108. package/build-module/hooks/font-family.mjs +1 -3
  1109. package/build-module/hooks/font-family.mjs.map +2 -2
  1110. package/build-module/hooks/font-size.mjs.map +2 -2
  1111. package/build-module/hooks/gap.mjs.map +2 -2
  1112. package/build-module/hooks/generated-class-name.mjs.map +2 -2
  1113. package/build-module/hooks/grid-visualizer.mjs.map +2 -2
  1114. package/build-module/hooks/index.mjs.map +2 -2
  1115. package/build-module/hooks/layout-child.mjs.map +2 -2
  1116. package/build-module/hooks/layout.mjs +2 -3
  1117. package/build-module/hooks/layout.mjs.map +2 -2
  1118. package/build-module/hooks/line-height.mjs.map +2 -2
  1119. package/build-module/hooks/list-view.mjs.map +2 -2
  1120. package/build-module/hooks/lock.mjs.map +2 -2
  1121. package/build-module/hooks/metadata.mjs.map +2 -2
  1122. package/build-module/hooks/position.mjs.map +2 -2
  1123. package/build-module/hooks/settings.mjs.map +2 -2
  1124. package/build-module/hooks/spacing-visualizer.mjs.map +2 -2
  1125. package/build-module/hooks/state-utils.mjs.map +2 -2
  1126. package/build-module/hooks/states.mjs.map +2 -2
  1127. package/build-module/hooks/style.mjs.map +2 -2
  1128. package/build-module/hooks/supports.mjs.map +2 -2
  1129. package/build-module/hooks/text-align.mjs.map +2 -2
  1130. package/build-module/hooks/typography.mjs.map +2 -2
  1131. package/build-module/hooks/use-border-props.mjs.map +2 -2
  1132. package/build-module/hooks/use-cached-truthy.mjs.map +2 -2
  1133. package/build-module/hooks/use-color-props.mjs.map +2 -2
  1134. package/build-module/hooks/use-content-only-section-edit.mjs.map +2 -2
  1135. package/build-module/hooks/use-dimensions-props.mjs.map +2 -2
  1136. package/build-module/hooks/use-shadow-props.mjs.map +2 -2
  1137. package/build-module/hooks/use-spacing-props.mjs.map +2 -2
  1138. package/build-module/hooks/use-typography-props.mjs +1 -3
  1139. package/build-module/hooks/use-typography-props.mjs.map +2 -2
  1140. package/build-module/hooks/use-zoom-out.mjs.map +2 -2
  1141. package/build-module/hooks/utils.mjs.map +2 -2
  1142. package/build-module/index.mjs.map +2 -2
  1143. package/build-module/layouts/constrained.mjs.map +2 -2
  1144. package/build-module/layouts/flex.mjs.map +2 -2
  1145. package/build-module/layouts/flow.mjs.map +2 -2
  1146. package/build-module/layouts/grid.mjs.map +2 -2
  1147. package/build-module/layouts/index.mjs.map +2 -2
  1148. package/build-module/layouts/utils.mjs.map +2 -2
  1149. package/build-module/lock-unlock.mjs.map +2 -2
  1150. package/build-module/private-apis.mjs.map +2 -2
  1151. package/build-module/store/actions.mjs +104 -36
  1152. package/build-module/store/actions.mjs.map +3 -3
  1153. package/build-module/store/defaults.mjs +2 -0
  1154. package/build-module/store/defaults.mjs.map +2 -2
  1155. package/build-module/store/get-block-settings.mjs.map +2 -2
  1156. package/build-module/store/index.mjs.map +2 -2
  1157. package/build-module/store/private-actions.mjs +19 -2
  1158. package/build-module/store/private-actions.mjs.map +2 -2
  1159. package/build-module/store/private-selectors.mjs +27 -10
  1160. package/build-module/store/private-selectors.mjs.map +2 -2
  1161. package/build-module/store/reducer.mjs +3 -1
  1162. package/build-module/store/reducer.mjs.map +2 -2
  1163. package/build-module/store/selectors.mjs +21 -8
  1164. package/build-module/store/selectors.mjs.map +2 -2
  1165. package/build-module/store/utils.mjs.map +2 -2
  1166. package/build-module/utils/fit-text-frontend.mjs.map +2 -2
  1167. package/build-module/utils/format-font-style.mjs.map +2 -2
  1168. package/build-module/utils/format-font-weight.mjs.map +2 -2
  1169. package/build-module/utils/get-font-styles-and-weights.mjs.map +2 -2
  1170. package/build-module/utils/group-blocks.mjs +21 -0
  1171. package/build-module/utils/group-blocks.mjs.map +7 -0
  1172. package/build-module/utils/native-undo.mjs.map +2 -2
  1173. package/build-module/utils/pasting.mjs.map +2 -2
  1174. package/build-module/utils/selection.mjs.map +2 -2
  1175. package/build-module/utils/sibling-block-attributes.mjs +20 -0
  1176. package/build-module/utils/sibling-block-attributes.mjs.map +7 -0
  1177. package/build-module/utils/transform-styles/index.mjs.map +2 -2
  1178. package/build-module/utils/use-notify-copy.mjs.map +2 -2
  1179. package/build-style/content-rtl.css +2 -2
  1180. package/build-style/content.css +2 -2
  1181. package/build-style/style-rtl.css +37 -5
  1182. package/build-style/style.css +37 -5
  1183. package/build-types/components/block-context/index.d.ts.map +1 -1
  1184. package/build-types/components/block-visibility/constants.d.ts +44 -0
  1185. package/build-types/components/block-visibility/constants.d.ts.map +1 -0
  1186. package/build-types/components/block-visibility/use-block-visibility.d.ts +35 -0
  1187. package/build-types/components/block-visibility/use-block-visibility.d.ts.map +1 -0
  1188. package/build-types/lock-unlock.d.ts +2 -0
  1189. package/build-types/lock-unlock.d.ts.map +1 -0
  1190. package/build-types/utils/fit-text-frontend.d.ts +0 -5
  1191. package/build-types/utils/fit-text-frontend.d.ts.map +1 -1
  1192. package/build-types/utils/format-font-style.d.ts +0 -3
  1193. package/build-types/utils/format-font-style.d.ts.map +1 -1
  1194. package/build-types/utils/format-font-weight.d.ts +0 -3
  1195. package/build-types/utils/format-font-weight.d.ts.map +1 -1
  1196. package/build-types/utils/get-font-styles-and-weights.d.ts.map +1 -1
  1197. package/build-types/utils/pasting.d.ts.map +1 -1
  1198. package/build-types/utils/selection.d.ts.map +1 -1
  1199. package/build-types/utils/transform-styles/index.d.ts +0 -3
  1200. package/build-types/utils/transform-styles/index.d.ts.map +1 -1
  1201. package/package.json +42 -41
  1202. package/src/autocompleters/block.js +0 -7
  1203. package/src/autocompleters/test/block.js +0 -7
  1204. package/src/components/alignment-control/index.js +0 -3
  1205. package/src/components/alignment-control/stories/aliginment-toolbar.story.jsx +0 -7
  1206. package/src/components/alignment-control/stories/index.story.jsx +0 -7
  1207. package/src/components/alignment-control/test/index.js +0 -11
  1208. package/src/components/alignment-control/ui.js +0 -3
  1209. package/src/components/autocomplete/index.js +0 -7
  1210. package/src/components/background-image-control/index.js +0 -12
  1211. package/src/components/background-image-control/test/index.js +0 -4
  1212. package/src/components/block-actions/README.md +67 -0
  1213. package/src/components/block-actions/index.js +3 -14
  1214. package/src/components/block-alignment-control/constants.js +0 -3
  1215. package/src/components/block-alignment-control/index.js +0 -3
  1216. package/src/components/block-alignment-control/test/index.js +0 -7
  1217. package/src/components/block-alignment-control/ui.js +0 -11
  1218. package/src/components/block-alignment-control/use-available-alignments.js +0 -7
  1219. package/src/components/block-alignment-matrix-control/index.js +0 -3
  1220. package/src/components/block-alignment-matrix-control/stories/index.story.jsx +0 -7
  1221. package/src/components/block-allowed-blocks/allowed-blocks-control.js +0 -7
  1222. package/src/components/block-allowed-blocks/modal.js +0 -7
  1223. package/src/components/block-bindings/attribute-control.js +10 -11
  1224. package/src/components/block-bindings/index.js +0 -3
  1225. package/src/components/block-bindings/source-fields-list.js +0 -11
  1226. package/src/components/block-bindings/test/use-block-bindings-utils.js +1 -12
  1227. package/src/components/block-bindings/use-block-bindings-utils.js +0 -7
  1228. package/src/components/block-breadcrumb/index.js +0 -7
  1229. package/src/components/block-breadcrumb/test/index.js +0 -7
  1230. package/src/components/block-canvas/index.js +0 -7
  1231. package/src/components/block-card/index.js +0 -11
  1232. package/src/components/block-compare/block-view.js +0 -3
  1233. package/src/components/block-compare/index.js +0 -11
  1234. package/src/components/block-compare/test/block-view.js +0 -7
  1235. package/src/components/block-content-overlay/index.js +0 -7
  1236. package/src/components/block-context/README.md +0 -1
  1237. package/src/components/block-context/index.js +0 -3
  1238. package/src/components/block-controls/README.md +0 -3
  1239. package/src/components/block-controls/fill.js +0 -7
  1240. package/src/components/block-controls/groups.js +0 -3
  1241. package/src/components/block-controls/hook.js +0 -7
  1242. package/src/components/block-controls/index.js +0 -3
  1243. package/src/components/block-controls/slot.js +0 -7
  1244. package/src/components/block-controls/test/index.js +0 -11
  1245. package/src/components/block-draggable/draggable-chip.js +0 -7
  1246. package/src/components/block-draggable/index.js +0 -7
  1247. package/src/components/block-draggable/stories/index.story.jsx +0 -3
  1248. package/src/components/block-draggable/use-scroll-when-dragging.js +0 -3
  1249. package/src/components/block-edit/context.js +0 -3
  1250. package/src/components/block-edit/edit.js +0 -11
  1251. package/src/components/block-edit/index.js +0 -7
  1252. package/src/components/block-edit/multiple-usage-warning.js +0 -7
  1253. package/src/components/block-edit/test/edit.js +0 -11
  1254. package/src/components/block-edit-visually-button/index.js +0 -7
  1255. package/src/components/block-editing-mode/index.js +0 -7
  1256. package/src/components/block-full-height-alignment-control/index.js +0 -3
  1257. package/src/components/block-heading-level-dropdown/heading-level-icon.js +0 -3
  1258. package/src/components/block-heading-level-dropdown/index.js +0 -7
  1259. package/src/components/block-heading-level-dropdown/stories/index.story.jsx +0 -7
  1260. package/src/components/block-icon/index.js +0 -7
  1261. package/src/components/block-icon/stories/index.story.ts +0 -7
  1262. package/src/components/block-icon/test/index.js +0 -11
  1263. package/src/components/block-inspector/edit-contents.js +27 -32
  1264. package/src/components/block-inspector/index.js +7 -8
  1265. package/src/components/block-inspector/inspector-pre-tabs-slot-fill.js +0 -3
  1266. package/src/components/block-inspector/useBlockInspectorAnimationSettings.js +0 -7
  1267. package/src/components/block-list/README.md +98 -0
  1268. package/src/components/block-list/block-crash-boundary.js +0 -3
  1269. package/src/components/block-list/block-crash-warning.js +0 -7
  1270. package/src/components/block-list/block-html.js +0 -11
  1271. package/src/components/block-list/block-invalid-warning.js +0 -7
  1272. package/src/components/block-list/block.js +57 -23
  1273. package/src/components/block-list/index.js +62 -24
  1274. package/src/components/block-list/layout.js +0 -7
  1275. package/src/components/block-list/private-block-context.js +0 -3
  1276. package/src/components/block-list/subdirectory-icon.js +0 -3
  1277. package/src/components/block-list/use-block-props/index.js +57 -12
  1278. package/src/components/block-list/use-block-props/use-block-refs.js +0 -7
  1279. package/src/components/block-list/use-block-props/use-firefox-draggable-compatibility.js +0 -3
  1280. package/src/components/block-list/use-block-props/use-focus-first-element.js +0 -7
  1281. package/src/components/block-list/use-block-props/use-focus-handler.js +0 -7
  1282. package/src/components/block-list/use-block-props/use-intersection-observer.js +0 -7
  1283. package/src/components/block-list/use-block-props/use-is-hovered.js +0 -7
  1284. package/src/components/block-list/use-block-props/use-register-block-event-handlers.js +0 -7
  1285. package/src/components/block-list/use-block-props/use-scroll-into-view.js +0 -3
  1286. package/src/components/block-list/use-block-props/use-selected-block-event-handlers.js +0 -7
  1287. package/src/components/block-list/use-in-between-inserter.js +0 -7
  1288. package/src/components/block-list/zoom-out-separator.js +0 -11
  1289. package/src/components/block-list-appender/index.js +0 -11
  1290. package/src/components/block-lock/README.md +66 -0
  1291. package/src/components/block-lock/menu-item.js +0 -7
  1292. package/src/components/block-lock/modal.js +0 -7
  1293. package/src/components/block-lock/toolbar.js +0 -7
  1294. package/src/components/block-lock/use-block-lock.js +0 -7
  1295. package/src/components/block-manager/category.js +0 -7
  1296. package/src/components/block-manager/checklist.js +0 -7
  1297. package/src/components/block-manager/index.js +0 -7
  1298. package/src/components/block-mover/button.js +17 -26
  1299. package/src/components/block-mover/index.js +0 -12
  1300. package/src/components/block-mover/mover-description.js +0 -3
  1301. package/src/components/block-mover/stories/index.story.jsx +0 -7
  1302. package/src/components/block-mover/test/mover-description.js +0 -3
  1303. package/src/components/block-navigation/dropdown.js +0 -11
  1304. package/src/components/block-parent-selector/index.js +0 -7
  1305. package/src/components/block-pattern-setup/index.js +0 -8
  1306. package/src/components/block-pattern-setup/setup-toolbar.js +0 -7
  1307. package/src/components/block-pattern-setup/use-patterns-setup.js +0 -7
  1308. package/src/components/block-patterns-list/index.js +0 -11
  1309. package/src/components/block-patterns-list/stories/index.story.jsx +3 -10
  1310. package/src/components/block-patterns-paging/index.js +0 -3
  1311. package/src/components/block-popover/cover.js +0 -7
  1312. package/src/components/block-popover/drop-zone.js +0 -7
  1313. package/src/components/block-popover/inbetween.js +0 -11
  1314. package/src/components/block-popover/index.js +0 -11
  1315. package/src/components/block-popover/use-popover-scroll.js +0 -3
  1316. package/src/components/block-preview/async.js +0 -3
  1317. package/src/components/block-preview/auto.js +0 -7
  1318. package/src/components/block-preview/index.js +0 -11
  1319. package/src/components/block-preview/test/index.js +0 -11
  1320. package/src/components/block-quick-navigation/index.js +0 -7
  1321. package/src/components/block-removal-warning-modal/index.js +0 -7
  1322. package/src/components/block-rename/modal.js +0 -7
  1323. package/src/components/block-rename/rename-control.js +0 -7
  1324. package/src/components/block-rename/use-block-rename.js +0 -3
  1325. package/src/components/block-selection-clearer/index.js +0 -7
  1326. package/src/components/block-selection-clearer/test/index.js +0 -11
  1327. package/src/components/block-settings-menu/block-html-convert-button.js +0 -7
  1328. package/src/components/block-settings-menu/block-mode-toggle.js +0 -7
  1329. package/src/components/block-settings-menu/block-parent-selector-menu-item.js +0 -7
  1330. package/src/components/block-settings-menu/block-settings-dropdown.js +1 -8
  1331. package/src/components/block-settings-menu/block-settings-menu-first-item.js +0 -3
  1332. package/src/components/block-settings-menu/index.js +0 -7
  1333. package/src/components/block-settings-menu/test/block-mode-toggle.js +0 -11
  1334. package/src/components/block-settings-menu-controls/index.js +0 -7
  1335. package/src/components/block-styles/index.js +0 -11
  1336. package/src/components/block-styles/menu-items.js +0 -3
  1337. package/src/components/block-styles/test/utils.js +0 -3
  1338. package/src/components/block-styles/use-styles-for-block.js +0 -7
  1339. package/src/components/block-styles/utils.js +0 -3
  1340. package/src/components/block-switcher/block-styles-menu.js +0 -7
  1341. package/src/components/block-switcher/block-transformations-menu.js +0 -7
  1342. package/src/components/block-switcher/block-variation-transformations.js +0 -7
  1343. package/src/components/block-switcher/index.js +0 -7
  1344. package/src/components/block-switcher/pattern-transformations-menu.js +0 -8
  1345. package/src/components/block-switcher/preview-block-popover.js +0 -7
  1346. package/src/components/block-switcher/test/index.js +0 -11
  1347. package/src/components/block-switcher/test/use-transformed.patterns.js +0 -7
  1348. package/src/components/block-switcher/test/utils.js +0 -7
  1349. package/src/components/block-switcher/use-transformed-patterns.js +0 -7
  1350. package/src/components/block-switcher/utils.js +0 -3
  1351. package/src/components/block-title/index.js +0 -4
  1352. package/src/components/block-title/stories/index.story.jsx +0 -7
  1353. package/src/components/block-title/test/index.js +0 -11
  1354. package/src/components/block-title/use-block-display-title.js +0 -7
  1355. package/src/components/block-toolbar/block-styles-dropdown.js +0 -7
  1356. package/src/components/block-toolbar/block-toolbar-icon.js +0 -7
  1357. package/src/components/block-toolbar/block-toolbar-last-item.js +0 -3
  1358. package/src/components/block-toolbar/change-design.js +0 -7
  1359. package/src/components/block-toolbar/edit-section-button.js +0 -7
  1360. package/src/components/block-toolbar/index.js +0 -11
  1361. package/src/components/block-toolbar/pattern-overrides-dropdown.js +0 -7
  1362. package/src/components/block-toolbar/switch-section-style.js +0 -7
  1363. package/src/components/block-toolbar/test/block-toolbar-icon.js +0 -11
  1364. package/src/components/block-toolbar/use-has-block-toolbar.js +0 -6
  1365. package/src/components/block-toolbar/utils.js +0 -7
  1366. package/src/components/block-tools/block-toolbar-popover.js +0 -9
  1367. package/src/components/block-tools/empty-block-inserter.js +0 -7
  1368. package/src/components/block-tools/index.js +3 -20
  1369. package/src/components/block-tools/insertion-point.js +0 -11
  1370. package/src/components/block-tools/use-block-toolbar-popover-props.js +0 -7
  1371. package/src/components/block-tools/use-selected-block-tool-props.js +0 -7
  1372. package/src/components/block-tools/use-show-block-tools.js +0 -7
  1373. package/src/components/block-tools/zoom-out-mode-inserter-button.js +0 -7
  1374. package/src/components/block-tools/zoom-out-mode-inserters.js +0 -7
  1375. package/src/components/block-types-list/index.js +0 -7
  1376. package/src/components/block-variation-picker/index.js +0 -7
  1377. package/src/components/block-variation-transforms/index.js +0 -7
  1378. package/src/components/block-vertical-alignment-control/index.js +0 -3
  1379. package/src/components/block-vertical-alignment-control/test/index.js +0 -7
  1380. package/src/components/block-vertical-alignment-control/ui.js +0 -3
  1381. package/src/components/block-visibility/{constants.js → constants.ts} +10 -4
  1382. package/src/components/block-visibility/modal.js +0 -11
  1383. package/src/components/block-visibility/test/use-block-visibility.js +0 -12
  1384. package/src/components/block-visibility/test/utils.js +0 -3
  1385. package/src/components/block-visibility/use-block-visibility.ts +92 -0
  1386. package/src/components/block-visibility/utils.js +0 -7
  1387. package/src/components/block-visibility/viewport-menu-item.js +0 -7
  1388. package/src/components/block-visibility/viewport-toolbar.js +0 -7
  1389. package/src/components/block-visibility/viewport-visibility-info.js +0 -7
  1390. package/src/components/border-radius-control/README.md +0 -3
  1391. package/src/components/border-radius-control/constants.js +0 -3
  1392. package/src/components/border-radius-control/index.js +0 -7
  1393. package/src/components/border-radius-control/linked-button.js +0 -3
  1394. package/src/components/border-radius-control/stories/index.story.jsx +0 -7
  1395. package/src/components/border-radius-control/test/index.js +0 -12
  1396. package/src/components/border-radius-control/test/utils.js +0 -3
  1397. package/src/components/border-radius-control/utils.js +0 -7
  1398. package/src/components/button-block-appender/index.js +0 -11
  1399. package/src/components/child-layout-control/index.js +0 -7
  1400. package/src/components/child-layout-control/test/index.js +0 -11
  1401. package/src/components/collab/note-icon-slot.js +0 -3
  1402. package/src/components/collab/note-icon-toolbar-slot.js +0 -3
  1403. package/src/components/color-palette/control.js +0 -3
  1404. package/src/components/color-palette/index.js +0 -7
  1405. package/src/components/color-palette/stories/control.story.jsx +0 -7
  1406. package/src/components/color-palette/test/control.js +0 -7
  1407. package/src/components/color-palette/with-color-context.js +0 -7
  1408. package/src/components/color-style-selector/index.js +0 -3
  1409. package/src/components/colors/test/utils.js +0 -3
  1410. package/src/components/colors/test/with-colors.js +0 -7
  1411. package/src/components/colors/utils.js +1 -15
  1412. package/src/components/colors/with-colors.js +1 -11
  1413. package/src/components/colors-gradients/control.js +0 -11
  1414. package/src/components/colors-gradients/dropdown.js +0 -15
  1415. package/src/components/colors-gradients/panel-color-gradient-settings.js +21 -28
  1416. package/src/components/colors-gradients/style.scss +17 -7
  1417. package/src/components/colors-gradients/test/control.js +0 -7
  1418. package/src/components/colors-gradients/use-multiple-origin-colors-and-gradients.js +0 -7
  1419. package/src/components/contrast-checker/index.js +0 -7
  1420. package/src/components/contrast-checker/stories/index.story.ts +0 -3
  1421. package/src/components/contrast-checker/test/index.js +0 -11
  1422. package/src/components/convert-to-group-buttons/index.js +2 -13
  1423. package/src/components/convert-to-group-buttons/toolbar.js +3 -12
  1424. package/src/components/convert-to-group-buttons/use-convert-to-group-button-props.js +0 -7
  1425. package/src/components/copy-handler/index.js +0 -7
  1426. package/src/components/date-format-picker/index.js +0 -3
  1427. package/src/components/date-format-picker/stories/index.story.jsx +0 -7
  1428. package/src/components/default-block-appender/content.scss +6 -3
  1429. package/src/components/default-block-appender/index.js +0 -11
  1430. package/src/components/default-block-appender/test/index.js +0 -7
  1431. package/src/components/dimension-control/index.js +0 -11
  1432. package/src/components/dimension-control/stories/index.story.jsx +0 -7
  1433. package/src/components/dimensions-tool/aspect-ratio-tool.js +0 -6
  1434. package/src/components/dimensions-tool/index.js +0 -7
  1435. package/src/components/dimensions-tool/scale-tool.js +0 -3
  1436. package/src/components/dimensions-tool/stories/aspect-ratio-tool.story.jsx +0 -7
  1437. package/src/components/dimensions-tool/stories/index.story.jsx +0 -7
  1438. package/src/components/dimensions-tool/stories/scale-tool.story.jsx +0 -7
  1439. package/src/components/dimensions-tool/stories/width-height-tool.story.jsx +0 -7
  1440. package/src/components/dimensions-tool/test/index.js +0 -11
  1441. package/src/components/dimensions-tool/width-height-tool.js +0 -3
  1442. package/src/components/duotone-control/index.js +0 -3
  1443. package/src/components/editable-text/index.js +0 -7
  1444. package/src/components/editor-styles/index.js +0 -11
  1445. package/src/components/fit-text-size-warning/index.js +0 -3
  1446. package/src/components/floating-toolbar/nav-up-icon.js +0 -3
  1447. package/src/components/font-appearance-control/index.js +0 -7
  1448. package/src/components/font-family/index.js +0 -11
  1449. package/src/components/font-family/stories/index.story.jsx +0 -7
  1450. package/src/components/font-sizes/font-size-picker.js +0 -7
  1451. package/src/components/font-sizes/test/fluid-utils.js +0 -7
  1452. package/src/components/font-sizes/test/utils.js +0 -7
  1453. package/src/components/font-sizes/utils.js +1 -11
  1454. package/src/components/font-sizes/with-font-sizes.js +0 -7
  1455. package/src/components/global-styles/advanced-panel.js +0 -7
  1456. package/src/components/global-styles/background-panel.js +0 -7
  1457. package/src/components/global-styles/border-panel.js +0 -7
  1458. package/src/components/global-styles/color-gradient-dropdown-item.js +0 -11
  1459. package/src/components/global-styles/color-panel.js +0 -7
  1460. package/src/components/global-styles/dimensions-panel.js +0 -11
  1461. package/src/components/global-styles/filters-panel.js +0 -11
  1462. package/src/components/global-styles/hooks.js +0 -7
  1463. package/src/components/global-styles/image-settings-panel.js +0 -7
  1464. package/src/components/global-styles/inheritance/index.js +0 -7
  1465. package/src/components/global-styles/inheritance/test/index.js +0 -11
  1466. package/src/components/global-styles/inherited-value-context.js +0 -7
  1467. package/src/components/global-styles/shadow-panel-components.js +0 -12
  1468. package/src/components/global-styles/state-control-badges.js +0 -7
  1469. package/src/components/global-styles/state-control.js +0 -3
  1470. package/src/components/global-styles/test/background-panel.js +0 -8
  1471. package/src/components/global-styles/test/border-panel.js +0 -7
  1472. package/src/components/global-styles/test/color-panel.js +0 -7
  1473. package/src/components/global-styles/test/dimensions-panel.js +0 -7
  1474. package/src/components/global-styles/test/filters-panel.js +0 -7
  1475. package/src/components/global-styles/test/inherited-value-context-core.js +0 -11
  1476. package/src/components/global-styles/test/inherited-value-context.js +0 -12
  1477. package/src/components/global-styles/test/state-control-badges.js +0 -7
  1478. package/src/components/global-styles/test/typography-panel-core.js +0 -7
  1479. package/src/components/global-styles/test/typography-panel.js +0 -7
  1480. package/src/components/global-styles/test/typography-utils.js +0 -3
  1481. package/src/components/global-styles/typography-panel.js +0 -7
  1482. package/src/components/global-styles/typography-utils.js +0 -3
  1483. package/src/components/global-styles/utils.js +0 -3
  1484. package/src/components/gradients/use-gradient.js +0 -7
  1485. package/src/components/gradients/with-gradient.js +0 -3
  1486. package/src/components/grid/grid-item-movers.js +0 -11
  1487. package/src/components/grid/grid-item-resizer.js +0 -7
  1488. package/src/components/grid/grid-visualizer.js +0 -11
  1489. package/src/components/grid/use-get-number-of-blocks-before-cell.js +0 -7
  1490. package/src/components/grid/use-grid-layout-sync.js +0 -7
  1491. package/src/components/height-control/index.js +0 -7
  1492. package/src/components/height-control/stories/index.story.jsx +0 -7
  1493. package/src/components/html-element-control/index.js +0 -7
  1494. package/src/components/html-element-control/messages.js +0 -3
  1495. package/src/components/iframe/index.js +4 -16
  1496. package/src/components/iframe/use-scale-canvas.js +38 -14
  1497. package/src/components/image-editor/aspect-ratio-dropdown.js +0 -7
  1498. package/src/components/image-editor/context.js +0 -7
  1499. package/src/components/image-editor/cropper.js +0 -11
  1500. package/src/components/image-editor/form-controls.js +0 -7
  1501. package/src/components/image-editor/index.js +0 -7
  1502. package/src/components/image-editor/rotation-button.js +0 -8
  1503. package/src/components/image-editor/test/index.js +0 -3
  1504. package/src/components/image-editor/use-save-image.js +0 -7
  1505. package/src/components/image-editor/use-transform-image.js +0 -3
  1506. package/src/components/image-editor/zoom-dropdown.js +0 -7
  1507. package/src/components/image-size-control/index.js +0 -7
  1508. package/src/components/image-size-control/test/index.js +0 -7
  1509. package/src/components/image-size-control/use-dimension-handler.js +0 -3
  1510. package/src/components/inner-blocks/README.md +2 -0
  1511. package/src/components/inner-blocks/button-block-appender.js +0 -7
  1512. package/src/components/inner-blocks/default-block-appender.js +0 -3
  1513. package/src/components/inner-blocks/index.js +0 -11
  1514. package/src/components/inner-blocks/test/index.js +0 -8
  1515. package/src/components/inner-blocks/use-block-context.js +0 -7
  1516. package/src/components/inner-blocks/use-inner-block-template-sync.js +47 -23
  1517. package/src/components/inner-blocks/use-nested-settings-update.js +0 -7
  1518. package/src/components/inner-content/index.js +0 -7
  1519. package/src/components/inner-content/test/index.js +0 -11
  1520. package/src/components/inserter/block-patterns-explorer/index.js +0 -7
  1521. package/src/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js +0 -3
  1522. package/src/components/inserter/block-patterns-explorer/pattern-list.js +0 -7
  1523. package/src/components/inserter/block-patterns-tab/index.js +0 -7
  1524. package/src/components/inserter/block-patterns-tab/pattern-category-previews.js +0 -8
  1525. package/src/components/inserter/block-patterns-tab/patterns-filter.js +0 -7
  1526. package/src/components/inserter/block-patterns-tab/use-pattern-categories.js +0 -8
  1527. package/src/components/inserter/block-patterns-tab/utils.js +0 -4
  1528. package/src/components/inserter/block-types-tab.js +0 -7
  1529. package/src/components/inserter/category-tabs/index.js +0 -7
  1530. package/src/components/inserter/hooks/use-block-types-state.js +0 -7
  1531. package/src/components/inserter/hooks/use-insertion-point.js +0 -7
  1532. package/src/components/inserter/hooks/use-patterns-paging.js +0 -3
  1533. package/src/components/inserter/hooks/use-patterns-state.js +0 -7
  1534. package/src/components/inserter/index.js +4 -28
  1535. package/src/components/inserter/library.js +0 -7
  1536. package/src/components/inserter/media-tab/hooks.js +0 -7
  1537. package/src/components/inserter/media-tab/media-list.js +0 -7
  1538. package/src/components/inserter/media-tab/media-panel.js +0 -11
  1539. package/src/components/inserter/media-tab/media-preview.js +0 -12
  1540. package/src/components/inserter/media-tab/media-tab.js +0 -7
  1541. package/src/components/inserter/media-tab/test/hooks.js +0 -7
  1542. package/src/components/inserter/media-tab/test/media-panel.js +0 -7
  1543. package/src/components/inserter/media-tab/utils.js +0 -3
  1544. package/src/components/inserter/menu.js +0 -11
  1545. package/src/components/inserter/mobile-tab-navigation.js +0 -3
  1546. package/src/components/inserter/no-results.js +0 -3
  1547. package/src/components/inserter/panel.js +0 -3
  1548. package/src/components/inserter/preview-panel.js +0 -7
  1549. package/src/components/inserter/quick-inserter.js +0 -11
  1550. package/src/components/inserter/search-items.js +0 -3
  1551. package/src/components/inserter/search-results.js +0 -7
  1552. package/src/components/inserter/stories/index.story.jsx +0 -7
  1553. package/src/components/inserter/test/get-appender-label.js +0 -3
  1554. package/src/components/inserter/test/search-items.js +0 -3
  1555. package/src/components/inserter/tips.js +0 -3
  1556. package/src/components/inserter-button/sparkles.js +0 -3
  1557. package/src/components/inserter-draggable-blocks/index.js +0 -7
  1558. package/src/components/inserter-list-item/index.js +0 -11
  1559. package/src/components/inserter-listbox/context.js +0 -3
  1560. package/src/components/inserter-listbox/group.js +0 -3
  1561. package/src/components/inserter-listbox/index.js +0 -8
  1562. package/src/components/inserter-listbox/item.js +0 -3
  1563. package/src/components/inserter-listbox/row.js +0 -3
  1564. package/src/components/inserter-menu-extension/index.js +0 -3
  1565. package/src/components/inspector-controls/block-support-slot-container.js +0 -3
  1566. package/src/components/inspector-controls/block-support-tools-panel.js +0 -7
  1567. package/src/components/inspector-controls/fill.js +22 -37
  1568. package/src/components/inspector-controls/groups.js +0 -3
  1569. package/src/components/inspector-controls/index.js +0 -3
  1570. package/src/components/inspector-controls/last-item.js +0 -7
  1571. package/src/components/inspector-controls/list-view-content-popover.js +0 -7
  1572. package/src/components/inspector-controls/slot.js +0 -7
  1573. package/src/components/inspector-controls-tabs/advanced-controls-panel.js +0 -7
  1574. package/src/components/inspector-controls-tabs/content-tab.js +0 -7
  1575. package/src/components/inspector-controls-tabs/index.js +0 -8
  1576. package/src/components/inspector-controls-tabs/position-controls-panel.js +0 -7
  1577. package/src/components/inspector-controls-tabs/settings-tab.js +0 -7
  1578. package/src/components/inspector-controls-tabs/styles-tab.js +0 -7
  1579. package/src/components/inspector-controls-tabs/use-inspector-controls-tabs.js +0 -7
  1580. package/src/components/inspector-controls-tabs/utils.js +0 -3
  1581. package/src/components/inspector-popover-header/index.js +0 -3
  1582. package/src/components/justify-content-control/index.js +0 -3
  1583. package/src/components/justify-content-control/ui.js +0 -3
  1584. package/src/components/keyboard-shortcuts/index.js +0 -7
  1585. package/src/components/letter-spacing-control/index.js +0 -7
  1586. package/src/components/letter-spacing-control/stories/index.story.jsx +0 -7
  1587. package/src/components/line-height-control/index.js +0 -7
  1588. package/src/components/line-height-control/stories/index.story.jsx +0 -7
  1589. package/src/components/line-height-control/test/index.js +0 -11
  1590. package/src/components/link-control/constants.js +0 -3
  1591. package/src/components/link-control/index.js +0 -11
  1592. package/src/components/link-control/is-url-like.js +0 -3
  1593. package/src/components/link-control/link-preview.js +0 -13
  1594. package/src/components/link-control/normalize-url.js +0 -7
  1595. package/src/components/link-control/search-create-button.js +0 -3
  1596. package/src/components/link-control/search-input.js +0 -7
  1597. package/src/components/link-control/search-item.js +0 -3
  1598. package/src/components/link-control/search-results.js +1 -12
  1599. package/src/components/link-control/settings-drawer.js +0 -3
  1600. package/src/components/link-control/settings.js +0 -3
  1601. package/src/components/link-control/style.scss +1 -1
  1602. package/src/components/link-control/test/index.js +0 -11
  1603. package/src/components/link-control/test/is-url-like.js +0 -3
  1604. package/src/components/link-control/test/url-normalization.test.js +0 -11
  1605. package/src/components/link-control/use-create-page.js +0 -3
  1606. package/src/components/link-control/use-internal-value.js +0 -7
  1607. package/src/components/link-control/use-rich-url-data.js +1 -8
  1608. package/src/components/link-control/use-search-handler.js +0 -7
  1609. package/src/components/link-control/viewer-slot.js +0 -3
  1610. package/src/components/link-picker/link-picker.js +0 -7
  1611. package/src/components/link-picker/link-preview.js +0 -7
  1612. package/src/components/link-picker/test/index.js +0 -11
  1613. package/src/components/list-view/appender.js +7 -11
  1614. package/src/components/list-view/aria-referenced-text.js +12 -19
  1615. package/src/components/list-view/block-contents.js +28 -28
  1616. package/src/components/list-view/block-select-button.js +62 -40
  1617. package/src/components/list-view/block.js +41 -58
  1618. package/src/components/list-view/branch.js +179 -169
  1619. package/src/components/list-view/context.js +24 -3
  1620. package/src/components/list-view/drop-indicator.js +6 -18
  1621. package/src/components/list-view/expander.js +0 -3
  1622. package/src/components/list-view/index.js +95 -110
  1623. package/src/components/list-view/leaf.js +0 -11
  1624. package/src/components/list-view/style.scss +24 -4
  1625. package/src/components/list-view/test/use-list-view-drop-zone.js +0 -3
  1626. package/src/components/list-view/test/utils.js +0 -3
  1627. package/src/components/list-view/use-block-selection.js +0 -7
  1628. package/src/components/list-view/use-clipboard-handler.js +0 -7
  1629. package/src/components/list-view/use-list-view-block-indexes.js +0 -3
  1630. package/src/components/list-view/use-list-view-client-ids.js +0 -8
  1631. package/src/components/list-view/use-list-view-collapse-items.js +3 -11
  1632. package/src/components/list-view/use-list-view-drop-zone.js +11 -28
  1633. package/src/components/list-view/use-list-view-expand-selected-item.js +3 -10
  1634. package/src/components/list-view/use-list-view-images.js +6 -10
  1635. package/src/components/list-view/use-list-view-scroll-into-view.js +0 -3
  1636. package/src/components/list-view/utils.js +7 -6
  1637. package/src/components/media-placeholder/index.js +0 -11
  1638. package/src/components/media-placeholder/test/get-computed-accept-attribute.js +0 -3
  1639. package/src/components/media-placeholder/test/index.js +0 -7
  1640. package/src/components/media-replace-flow/index.js +0 -11
  1641. package/src/components/media-replace-flow/test/index.js +0 -10
  1642. package/src/components/media-upload/check.js +0 -7
  1643. package/src/components/media-upload/index.js +0 -3
  1644. package/src/components/multi-selection-inspector/index.js +42 -21
  1645. package/src/components/multi-selection-inspector/style.scss +5 -0
  1646. package/src/components/navigable-toolbar/index.js +38 -27
  1647. package/src/components/observe-typing/index.js +0 -7
  1648. package/src/components/panel-color-settings/README.md +0 -7
  1649. package/src/components/panel-color-settings/index.js +0 -3
  1650. package/src/components/panel-color-settings/test/index.js +0 -7
  1651. package/src/components/plain-text/index.js +0 -11
  1652. package/src/components/plain-text/stories/index.story.jsx +0 -7
  1653. package/src/components/preset-input-control/custom-value-controls.js +0 -4
  1654. package/src/components/preset-input-control/index.js +0 -7
  1655. package/src/components/preset-input-control/test/index.js +0 -7
  1656. package/src/components/preset-input-control/test/utils.js +0 -3
  1657. package/src/components/preview-options/index.js +0 -3
  1658. package/src/components/provider/block-refs-provider.js +0 -3
  1659. package/src/components/provider/index.js +0 -7
  1660. package/src/components/provider/selection-context.js +0 -3
  1661. package/src/components/provider/test/experimental-provider.js +0 -10
  1662. package/src/components/provider/test/use-block-sync.js +0 -12
  1663. package/src/components/provider/use-block-sync.js +0 -7
  1664. package/src/components/provider/use-media-upload-settings.js +0 -3
  1665. package/src/components/provider/with-registry-provider.js +0 -7
  1666. package/src/components/publish-date-time-picker/index.js +0 -7
  1667. package/src/components/recursion-provider/README.md +0 -3
  1668. package/src/components/recursion-provider/index.js +0 -7
  1669. package/src/components/recursion-provider/test/index.js +0 -7
  1670. package/src/components/resizable-box-popover/index.js +0 -7
  1671. package/src/components/resolution-tool/index.js +0 -3
  1672. package/src/components/resolution-tool/stories/index.story.jsx +0 -7
  1673. package/src/components/responsive-block-control/index.js +0 -11
  1674. package/src/components/responsive-block-control/label.js +0 -3
  1675. package/src/components/responsive-block-control/test/index.js +0 -11
  1676. package/src/components/rich-text/content.js +0 -11
  1677. package/src/components/rich-text/event-listeners/before-input-rules.js +0 -7
  1678. package/src/components/rich-text/event-listeners/delete.js +0 -7
  1679. package/src/components/rich-text/event-listeners/enter.js +0 -7
  1680. package/src/components/rich-text/event-listeners/firefox-compat.js +0 -3
  1681. package/src/components/rich-text/event-listeners/index.js +0 -7
  1682. package/src/components/rich-text/event-listeners/input-events.js +0 -8
  1683. package/src/components/rich-text/event-listeners/input-rules.js +15 -20
  1684. package/src/components/rich-text/event-listeners/insert-replacement-text.js +0 -8
  1685. package/src/components/rich-text/event-listeners/paste-handler.js +14 -8
  1686. package/src/components/rich-text/event-listeners/remove-browser-shortcuts.js +0 -8
  1687. package/src/components/rich-text/event-listeners/shortcuts.js +0 -8
  1688. package/src/components/rich-text/event-listeners/undo-automatic-change.js +0 -8
  1689. package/src/components/rich-text/format-edit.js +0 -7
  1690. package/src/components/rich-text/format-toolbar/index.js +0 -11
  1691. package/src/components/rich-text/format-toolbar-container.js +0 -7
  1692. package/src/components/rich-text/get-rich-text-values.js +0 -7
  1693. package/src/components/rich-text/index.js +0 -11
  1694. package/src/components/rich-text/multiline.js +0 -7
  1695. package/src/components/rich-text/prevent-event-discovery.js +0 -3
  1696. package/src/components/rich-text/toolbar-button.js +0 -3
  1697. package/src/components/rich-text/use-mark-persistent.js +0 -7
  1698. package/src/components/rich-text/utils.js +0 -3
  1699. package/src/components/rich-text/with-deprecations.js +0 -7
  1700. package/src/components/selection-scroll-into-view/index.js +0 -3
  1701. package/src/components/skip-to-selected-block/index.js +0 -7
  1702. package/src/components/spacing-sizes-control/hooks/use-spacing-sizes.js +0 -7
  1703. package/src/components/spacing-sizes-control/index.js +2 -9
  1704. package/src/components/spacing-sizes-control/input-controls/axial.js +0 -3
  1705. package/src/components/spacing-sizes-control/input-controls/separated.js +0 -3
  1706. package/src/components/spacing-sizes-control/input-controls/single.js +0 -3
  1707. package/src/components/spacing-sizes-control/input-controls/spacing-input-control.js +0 -7
  1708. package/src/components/spacing-sizes-control/linked-button.js +0 -3
  1709. package/src/components/spacing-sizes-control/test/index.js +0 -12
  1710. package/src/components/spacing-sizes-control/test/utils.js +0 -3
  1711. package/src/components/spacing-sizes-control/utils.js +0 -7
  1712. package/src/components/tabbed-sidebar/index.js +0 -7
  1713. package/src/components/tabbed-sidebar/stories/index.story.jsx +0 -7
  1714. package/src/components/text-alignment-control/index.js +0 -7
  1715. package/src/components/text-alignment-control/stories/index.story.jsx +0 -7
  1716. package/src/components/text-decoration-control/index.js +0 -7
  1717. package/src/components/text-decoration-control/stories/index.story.jsx +0 -7
  1718. package/src/components/text-indent-control/index.js +0 -7
  1719. package/src/components/text-transform-control/index.js +0 -7
  1720. package/src/components/text-transform-control/stories/index.story.jsx +0 -7
  1721. package/src/components/tool-selector/index.js +0 -3
  1722. package/src/components/typewriter/index.js +0 -3
  1723. package/src/components/unit-control/index.js +0 -7
  1724. package/src/components/unit-control/stories/index.story.jsx +0 -7
  1725. package/src/components/url-input/button.js +0 -7
  1726. package/src/components/url-input/index.js +55 -75
  1727. package/src/components/url-input/test/button.js +0 -11
  1728. package/src/components/url-input/test/index.js +85 -11
  1729. package/src/components/url-popover/image-url-input-ui.js +2 -9
  1730. package/src/components/url-popover/index.js +0 -7
  1731. package/src/components/url-popover/link-editor.js +0 -11
  1732. package/src/components/url-popover/link-viewer-url.js +0 -7
  1733. package/src/components/url-popover/link-viewer.js +0 -11
  1734. package/src/components/url-popover/stories/index.story.jsx +0 -7
  1735. package/src/components/url-popover/style.scss +5 -0
  1736. package/src/components/use-block-commands/index.js +2 -9
  1737. package/src/components/use-block-display-information/index.js +1 -8
  1738. package/src/components/use-block-display-information/test/index.js +0 -11
  1739. package/src/components/use-block-drop-zone/index.js +0 -7
  1740. package/src/components/use-block-drop-zone/test/index.js +0 -3
  1741. package/src/components/use-flash-editable-blocks/index.js +0 -7
  1742. package/src/components/use-list-view-panel-state/index.js +0 -7
  1743. package/src/components/use-moving-animation/index.js +9 -14
  1744. package/src/components/use-on-block-drop/index.js +0 -7
  1745. package/src/components/use-on-block-drop/test/index.js +1 -7
  1746. package/src/components/use-paste-styles/index.js +0 -7
  1747. package/src/components/use-resize-canvas/index.js +0 -3
  1748. package/src/components/use-settings/index.js +0 -7
  1749. package/src/components/warning/index.js +0 -7
  1750. package/src/components/warning/stories/index.story.jsx +0 -7
  1751. package/src/components/warning/test/index.js +0 -7
  1752. package/src/components/writing-flow/index.js +0 -11
  1753. package/src/components/writing-flow/test/index.js +0 -7
  1754. package/src/components/writing-flow/use-arrow-nav.js +23 -16
  1755. package/src/components/writing-flow/use-click-selection.js +0 -7
  1756. package/src/components/writing-flow/use-clipboard-handler.js +65 -11
  1757. package/src/components/writing-flow/use-drag-selection.js +0 -7
  1758. package/src/components/writing-flow/use-editable-root-event-handlers.js +0 -7
  1759. package/src/components/writing-flow/use-editable-root.js +0 -7
  1760. package/src/components/writing-flow/use-home-end.js +0 -7
  1761. package/src/components/writing-flow/use-input.js +0 -7
  1762. package/src/components/writing-flow/use-multi-selection.js +0 -7
  1763. package/src/components/writing-flow/use-preview-mode-nav.js +0 -7
  1764. package/src/components/writing-flow/use-select-all.js +0 -7
  1765. package/src/components/writing-flow/use-selection-observer.js +0 -7
  1766. package/src/components/writing-flow/use-tab-nav.js +7 -8
  1767. package/src/components/writing-flow/utils.js +0 -7
  1768. package/src/components/writing-mode-control/index.js +0 -7
  1769. package/src/components/writing-mode-control/stories/index.story.jsx +0 -7
  1770. package/src/elements/test/index.js +0 -3
  1771. package/src/hooks/align.js +0 -11
  1772. package/src/hooks/allowed-blocks.js +0 -7
  1773. package/src/hooks/anchor.js +0 -7
  1774. package/src/hooks/aria-label.js +0 -7
  1775. package/src/hooks/auto-inspector-controls.js +0 -7
  1776. package/src/hooks/background.js +3 -15
  1777. package/src/hooks/block-bindings.js +0 -7
  1778. package/src/hooks/block-fields/fields-dropdown-menu.js +0 -7
  1779. package/src/hooks/block-fields/index.js +0 -1
  1780. package/src/hooks/block-fields/link/index.js +0 -7
  1781. package/src/hooks/block-fields/media/index.js +0 -7
  1782. package/src/hooks/block-fields/rich-text/index.js +0 -7
  1783. package/src/hooks/block-fields/use-inspector-popover-placement.js +0 -3
  1784. package/src/hooks/block-hooks.js +0 -7
  1785. package/src/hooks/block-renaming.js +0 -3
  1786. package/src/hooks/block-style-state.js +0 -7
  1787. package/src/hooks/block-style-variation.js +0 -7
  1788. package/src/hooks/border.js +0 -11
  1789. package/src/hooks/color.js +0 -11
  1790. package/src/hooks/compat.js +0 -3
  1791. package/src/hooks/contrast-checker.js +0 -8
  1792. package/src/hooks/custom-class-name.js +0 -11
  1793. package/src/hooks/dimensions.js +0 -11
  1794. package/src/hooks/duotone.js +0 -11
  1795. package/src/hooks/elements.js +0 -7
  1796. package/src/hooks/fit-text.js +0 -8
  1797. package/src/hooks/font-family.js +1 -10
  1798. package/src/hooks/font-size.js +0 -7
  1799. package/src/hooks/gap.js +0 -3
  1800. package/src/hooks/generated-class-name.js +0 -3
  1801. package/src/hooks/grid-visualizer.js +0 -7
  1802. package/src/hooks/index.js +0 -3
  1803. package/src/hooks/layout-child.js +0 -7
  1804. package/src/hooks/layout.js +1 -13
  1805. package/src/hooks/line-height.js +0 -7
  1806. package/src/hooks/list-view.js +0 -8
  1807. package/src/hooks/lock.js +0 -3
  1808. package/src/hooks/metadata.js +0 -3
  1809. package/src/hooks/position.js +0 -11
  1810. package/src/hooks/settings.js +0 -3
  1811. package/src/hooks/spacing-visualizer.js +0 -7
  1812. package/src/hooks/state-utils.js +0 -3
  1813. package/src/hooks/states.js +0 -7
  1814. package/src/hooks/style.js +0 -7
  1815. package/src/hooks/supports.js +0 -3
  1816. package/src/hooks/test/align.js +0 -7
  1817. package/src/hooks/test/allowed-blocks.js +0 -7
  1818. package/src/hooks/test/anchor.js +0 -7
  1819. package/src/hooks/test/auto-inspector-controls.js +0 -7
  1820. package/src/hooks/test/background.js +115 -3
  1821. package/src/hooks/test/block-style-state.js +0 -3
  1822. package/src/hooks/test/custom-class-name.js +0 -7
  1823. package/src/hooks/test/dimensions.js +0 -7
  1824. package/src/hooks/test/duotone.js +0 -3
  1825. package/src/hooks/test/font-size.js +0 -11
  1826. package/src/hooks/test/gap.js +0 -3
  1827. package/src/hooks/test/generate-fields-from-attributes.js +0 -3
  1828. package/src/hooks/test/generated-class-name.js +0 -7
  1829. package/src/hooks/test/inherited-value-wiring.js +0 -3
  1830. package/src/hooks/test/layout-child.js +0 -3
  1831. package/src/hooks/test/layout.js +0 -3
  1832. package/src/hooks/test/metadata.js +0 -7
  1833. package/src/hooks/test/preset-round-trip.js +0 -6
  1834. package/src/hooks/test/settings.js +0 -7
  1835. package/src/hooks/test/state-utils.js +0 -7
  1836. package/src/hooks/test/style.js +0 -7
  1837. package/src/hooks/test/text-align.js +0 -7
  1838. package/src/hooks/test/use-typography-props.js +0 -3
  1839. package/src/hooks/test/utils.js +0 -3
  1840. package/src/hooks/text-align.js +0 -11
  1841. package/src/hooks/typography.js +0 -8
  1842. package/src/hooks/use-border-props.js +0 -3
  1843. package/src/hooks/use-cached-truthy.js +0 -3
  1844. package/src/hooks/use-color-props.js +0 -11
  1845. package/src/hooks/use-content-only-section-edit.js +0 -7
  1846. package/src/hooks/use-dimensions-props.js +0 -3
  1847. package/src/hooks/use-shadow-props.js +0 -3
  1848. package/src/hooks/use-spacing-props.js +0 -3
  1849. package/src/hooks/use-typography-props.js +1 -15
  1850. package/src/hooks/use-zoom-out.js +0 -7
  1851. package/src/hooks/utils.js +0 -11
  1852. package/src/index.js +0 -3
  1853. package/src/layouts/constrained.js +0 -7
  1854. package/src/layouts/flex.js +0 -7
  1855. package/src/layouts/flow.js +0 -7
  1856. package/src/layouts/grid.js +0 -8
  1857. package/src/layouts/index.js +0 -3
  1858. package/src/layouts/test/constrained.js +0 -11
  1859. package/src/layouts/test/flex.js +0 -11
  1860. package/src/layouts/test/flow.js +0 -3
  1861. package/src/layouts/test/grid.js +0 -11
  1862. package/src/layouts/test/utils.js +0 -3
  1863. package/src/layouts/utils.js +0 -7
  1864. package/src/lock-unlock.ts +0 -3
  1865. package/src/private-apis.js +0 -7
  1866. package/src/store/actions.js +162 -53
  1867. package/src/store/defaults.js +4 -3
  1868. package/src/store/get-block-settings.js +0 -7
  1869. package/src/store/index.js +0 -7
  1870. package/src/store/private-actions.js +33 -5
  1871. package/src/store/private-selectors.js +43 -17
  1872. package/src/store/reducer.js +8 -12
  1873. package/src/store/selectors.js +44 -21
  1874. package/src/store/test/actions.js +203 -26
  1875. package/src/store/test/array.js +0 -3
  1876. package/src/store/test/get-block-settings.js +0 -7
  1877. package/src/store/test/performance.js +0 -3
  1878. package/src/store/test/private-actions.js +0 -3
  1879. package/src/store/test/private-selectors.js +155 -17
  1880. package/src/store/test/reducer.js +30 -11
  1881. package/src/store/test/registry-selectors.js +0 -7
  1882. package/src/store/test/selectors.js +143 -7
  1883. package/src/store/utils.js +0 -7
  1884. package/src/utils/fit-text-frontend.ts +0 -8
  1885. package/src/utils/format-font-style.ts +0 -7
  1886. package/src/utils/format-font-weight.ts +0 -7
  1887. package/src/utils/get-font-styles-and-weights.ts +0 -7
  1888. package/src/utils/group-blocks.js +36 -0
  1889. package/src/utils/native-undo.js +0 -3
  1890. package/src/utils/pasting.ts +0 -3
  1891. package/src/utils/selection.ts +0 -3
  1892. package/src/utils/sibling-block-attributes.js +30 -0
  1893. package/src/utils/test/block-bindings.js +0 -3
  1894. package/src/utils/test/color-values.js +0 -3
  1895. package/src/utils/test/format-font-style.js +0 -3
  1896. package/src/utils/test/format-font-weight.js +0 -3
  1897. package/src/utils/test/get-font-styles-and-weights.js +0 -3
  1898. package/src/utils/test/math.js +0 -3
  1899. package/src/utils/test/object.js +0 -3
  1900. package/src/utils/test/pasting.js +0 -3
  1901. package/src/utils/test/selection.js +0 -3
  1902. package/src/utils/test/sorting.js +0 -3
  1903. package/src/utils/test/transform-styles.js +0 -3
  1904. package/src/utils/transform-styles/index.ts +0 -8
  1905. package/src/utils/use-notify-copy.js +0 -7
  1906. package/src/components/block-visibility/use-block-visibility.js +0 -76
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/grid/grid-visualizer.js"],
4
- "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useState, useEffect, forwardRef, useMemo } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __experimentalUseDropZone as useDropZone } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { useBlockElement } from '../block-list/use-block-props/use-block-refs';\nimport BlockPopoverCover from '../block-popover/cover';\nimport { range, GridRect, getGridInfo, getGridItemRect } from './utils';\nimport { store as blockEditorStore } from '../../store';\nimport { useGetNumberOfBlocksBeforeCell } from './use-get-number-of-blocks-before-cell';\nimport ButtonBlockAppender from '../button-block-appender';\nimport { unlock } from '../../lock-unlock';\n\nexport function GridVisualizer( {\n\tclientId,\n\tcontentRef,\n\tparentLayout,\n\tchildGridClientId,\n} ) {\n\tconst isDistractionFree = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).getSettings().isDistractionFree,\n\t\t[]\n\t);\n\tconst gridElement = useBlockElement( clientId );\n\n\tif ( isDistractionFree || ! gridElement ) {\n\t\treturn null;\n\t}\n\n\tconst isManualGrid =\n\t\tparentLayout?.isManualPlacement &&\n\t\twindow.__experimentalEnableGridInteractivity;\n\treturn (\n\t\t<GridVisualizerGrid\n\t\t\tgridClientId={ clientId }\n\t\t\tgridElement={ gridElement }\n\t\t\tisManualGrid={ isManualGrid }\n\t\t\tref={ contentRef }\n\t\t\tchildGridClientId={ childGridClientId }\n\t\t/>\n\t);\n}\n\nconst GridVisualizerGrid = forwardRef(\n\t( { gridClientId, gridElement, isManualGrid, childGridClientId }, ref ) => {\n\t\tconst [ gridInfo, setGridInfo ] = useState( () =>\n\t\t\tgetGridInfo( gridElement )\n\t\t);\n\t\tconst [ isDroppingAllowed, setIsDroppingAllowed ] = useState( false );\n\n\t\t// Get the element for the child grid block so we can\n\t\t// compute its position and hide overlapping visualizer cells.\n\t\tconst childGridElement = useBlockElement( childGridClientId );\n\n\t\t// Compute the child grid block's rect from its position in the grid.\n\t\t// This works for both manual and non-manual grids.\n\t\tconst childGridRect = useMemo( () => {\n\t\t\tif ( ! childGridElement ) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn getGridItemRect( childGridElement );\n\t\t}, [ childGridElement ] );\n\n\t\tuseEffect( () => {\n\t\t\tconst resizeCallback = () =>\n\t\t\t\tsetGridInfo( getGridInfo( gridElement ) );\n\t\t\t// Both border-box and content-box are observed as they may change\n\t\t\t// independently. This requires two observers because a single one\n\t\t\t// can’t be made to monitor both on the same element.\n\t\t\tconst borderBoxSpy = new window.ResizeObserver( resizeCallback );\n\t\t\tborderBoxSpy.observe( gridElement, { box: 'border-box' } );\n\t\t\tconst contentBoxSpy = new window.ResizeObserver( resizeCallback );\n\t\t\tcontentBoxSpy.observe( gridElement );\n\t\t\tfor ( const element of gridElement.children ) {\n\t\t\t\tcontentBoxSpy.observe( element );\n\t\t\t}\n\t\t\treturn () => {\n\t\t\t\tborderBoxSpy.disconnect();\n\t\t\t\tcontentBoxSpy.disconnect();\n\t\t\t};\n\t\t}, [ gridElement ] );\n\n\t\tuseEffect( () => {\n\t\t\tfunction onGlobalDrag() {\n\t\t\t\tsetIsDroppingAllowed( true );\n\t\t\t}\n\t\t\tfunction onGlobalDragEnd() {\n\t\t\t\tsetIsDroppingAllowed( false );\n\t\t\t}\n\t\t\tdocument.addEventListener( 'drag', onGlobalDrag );\n\t\t\tdocument.addEventListener( 'dragend', onGlobalDragEnd );\n\t\t\treturn () => {\n\t\t\t\tdocument.removeEventListener( 'drag', onGlobalDrag );\n\t\t\t\tdocument.removeEventListener( 'dragend', onGlobalDragEnd );\n\t\t\t};\n\t\t}, [] );\n\n\t\treturn (\n\t\t\t<BlockPopoverCover\n\t\t\t\tclassName={ clsx( 'block-editor-grid-visualizer', {\n\t\t\t\t\t'is-dropping-allowed': isDroppingAllowed,\n\t\t\t\t} ) }\n\t\t\t\tclientId={ gridClientId }\n\t\t\t\t__unstablePopoverSlot=\"__unstable-block-tools-after\"\n\t\t\t>\n\t\t\t\t<div\n\t\t\t\t\tref={ ref }\n\t\t\t\t\tclassName=\"block-editor-grid-visualizer__grid\"\n\t\t\t\t\tstyle={ gridInfo.style }\n\t\t\t\t>\n\t\t\t\t\t{ isManualGrid ? (\n\t\t\t\t\t\t<ManualGridVisualizer\n\t\t\t\t\t\t\tgridClientId={ gridClientId }\n\t\t\t\t\t\t\tgridInfo={ gridInfo }\n\t\t\t\t\t\t\tchildGridRect={ childGridRect }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<AutoGridVisualizer\n\t\t\t\t\t\t\tgridInfo={ gridInfo }\n\t\t\t\t\t\t\tchildGridRect={ childGridRect }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t</BlockPopoverCover>\n\t\t);\n\t}\n);\n\nfunction AutoGridVisualizer( { gridInfo, childGridRect } ) {\n\treturn range( 1, gridInfo.numRows ).map( ( row ) =>\n\t\trange( 1, gridInfo.numColumns ).map( ( column ) => {\n\t\t\t// Don't render visualizer cells for a selected child block\n\t\t\t// that is itself a grid, so that only the child's grid\n\t\t\t// visualizer is visible.\n\t\t\tlet color = gridInfo.currentColor;\n\t\t\tif ( childGridRect?.contains( column, row ) ) {\n\t\t\t\tcolor = 'transparent';\n\t\t\t}\n\t\t\treturn (\n\t\t\t\t<GridVisualizerCell\n\t\t\t\t\tkey={ `${ row }-${ column }` }\n\t\t\t\t\tcolor={ color }\n\t\t\t\t/>\n\t\t\t);\n\t\t} )\n\t);\n}\n\nfunction ManualGridVisualizer( { gridClientId, gridInfo, childGridRect } ) {\n\tconst [ highlightedRect, setHighlightedRect ] = useState( null );\n\n\tconst gridItemStyles = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockOrder, getBlockStyles } = unlock(\n\t\t\t\tselect( blockEditorStore )\n\t\t\t);\n\t\t\tconst blockOrder = getBlockOrder( gridClientId );\n\t\t\treturn getBlockStyles( blockOrder );\n\t\t},\n\t\t[ gridClientId ]\n\t);\n\tconst occupiedRects = useMemo( () => {\n\t\tconst rects = [];\n\t\tfor ( const style of Object.values( gridItemStyles ) ) {\n\t\t\tconst {\n\t\t\t\tcolumnStart,\n\t\t\t\trowStart,\n\t\t\t\tcolumnSpan = 1,\n\t\t\t\trowSpan = 1,\n\t\t\t} = style?.layout ?? {};\n\t\t\tif ( ! columnStart || ! rowStart ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\trects.push(\n\t\t\t\tnew GridRect( {\n\t\t\t\t\tcolumnStart,\n\t\t\t\t\trowStart,\n\t\t\t\t\tcolumnSpan,\n\t\t\t\t\trowSpan,\n\t\t\t\t} )\n\t\t\t);\n\t\t}\n\t\treturn rects;\n\t}, [ gridItemStyles ] );\n\n\treturn range( 1, gridInfo.numRows ).map( ( row ) =>\n\t\trange( 1, gridInfo.numColumns ).map( ( column ) => {\n\t\t\t// Don't render visualizer cells for a selected child block\n\t\t\t// that is itself a grid, so that only the child's grid\n\t\t\t// visualizer is visible.\n\t\t\tconst isChildGridCell = childGridRect?.contains( column, row );\n\t\t\tlet color = gridInfo.currentColor;\n\t\t\tif ( isChildGridCell ) {\n\t\t\t\tcolor = 'transparent';\n\t\t\t}\n\t\t\tconst isCellOccupied = occupiedRects.some( ( rect ) =>\n\t\t\t\trect.contains( column, row )\n\t\t\t);\n\t\t\tconst isHighlighted =\n\t\t\t\thighlightedRect?.contains( column, row ) ?? false;\n\t\t\treturn (\n\t\t\t\t<GridVisualizerCell\n\t\t\t\t\tkey={ `${ row }-${ column }` }\n\t\t\t\t\tcolor={ color }\n\t\t\t\t\tclassName={ isHighlighted && 'is-highlighted' }\n\t\t\t\t>\n\t\t\t\t\t{ isCellOccupied && ! isChildGridCell ? (\n\t\t\t\t\t\t<GridVisualizerDropZone\n\t\t\t\t\t\t\tcolumn={ column }\n\t\t\t\t\t\t\trow={ row }\n\t\t\t\t\t\t\tgridClientId={ gridClientId }\n\t\t\t\t\t\t\tgridInfo={ gridInfo }\n\t\t\t\t\t\t\tsetHighlightedRect={ setHighlightedRect }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<GridVisualizerAppender\n\t\t\t\t\t\t\tcolumn={ column }\n\t\t\t\t\t\t\trow={ row }\n\t\t\t\t\t\t\tgridClientId={ gridClientId }\n\t\t\t\t\t\t\tgridInfo={ gridInfo }\n\t\t\t\t\t\t\tsetHighlightedRect={ setHighlightedRect }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</GridVisualizerCell>\n\t\t\t);\n\t\t} )\n\t);\n}\n\nfunction GridVisualizerCell( { color, children, className } ) {\n\treturn (\n\t\t<div\n\t\t\tclassName={ clsx(\n\t\t\t\t'block-editor-grid-visualizer__cell',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t\tstyle={ {\n\t\t\t\tboxShadow: `inset 0 0 0 1px color-mix(in srgb, ${ color } 20%, #0000)`,\n\t\t\t\tcolor,\n\t\t\t} }\n\t\t>\n\t\t\t{ children }\n\t\t</div>\n\t);\n}\n\nfunction useGridVisualizerDropZone(\n\tcolumn,\n\trow,\n\tgridClientId,\n\tgridInfo,\n\tsetHighlightedRect\n) {\n\tconst {\n\t\tgetBlockAttributes,\n\t\tgetBlockRootClientId,\n\t\tcanInsertBlockType,\n\t\tgetBlockName,\n\t} = useSelect( blockEditorStore );\n\tconst {\n\t\tupdateBlockAttributes,\n\t\tmoveBlocksToPosition,\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t} = useDispatch( blockEditorStore );\n\n\tconst getNumberOfBlocksBeforeCell = useGetNumberOfBlocksBeforeCell(\n\t\tgridClientId,\n\t\tgridInfo.numColumns\n\t);\n\n\treturn useDropZoneWithValidation( {\n\t\tvalidateDrag( srcClientId ) {\n\t\t\tconst blockName = getBlockName( srcClientId );\n\t\t\tif ( ! canInsertBlockType( blockName, gridClientId ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tconst attributes = getBlockAttributes( srcClientId );\n\t\t\tconst rect = new GridRect( {\n\t\t\t\tcolumnStart: column,\n\t\t\t\trowStart: row,\n\t\t\t\tcolumnSpan: attributes.style?.layout?.columnSpan,\n\t\t\t\trowSpan: attributes.style?.layout?.rowSpan,\n\t\t\t} );\n\t\t\tconst isInBounds = new GridRect( {\n\t\t\t\tcolumnSpan: gridInfo.numColumns,\n\t\t\t\trowSpan: gridInfo.numRows,\n\t\t\t} ).containsRect( rect );\n\t\t\treturn isInBounds;\n\t\t},\n\t\tonDragEnter( srcClientId ) {\n\t\t\tconst attributes = getBlockAttributes( srcClientId );\n\t\t\tsetHighlightedRect(\n\t\t\t\tnew GridRect( {\n\t\t\t\t\tcolumnStart: column,\n\t\t\t\t\trowStart: row,\n\t\t\t\t\tcolumnSpan: attributes.style?.layout?.columnSpan,\n\t\t\t\t\trowSpan: attributes.style?.layout?.rowSpan,\n\t\t\t\t} )\n\t\t\t);\n\t\t},\n\t\tonDragLeave() {\n\t\t\t// onDragEnter can be called before onDragLeave if the user moves\n\t\t\t// their mouse quickly, so only clear the highlight if it was set\n\t\t\t// by this cell.\n\t\t\tsetHighlightedRect( ( prevHighlightedRect ) =>\n\t\t\t\tprevHighlightedRect?.columnStart === column &&\n\t\t\t\tprevHighlightedRect?.rowStart === row\n\t\t\t\t\t? null\n\t\t\t\t\t: prevHighlightedRect\n\t\t\t);\n\t\t},\n\t\tonDrop( srcClientId ) {\n\t\t\tsetHighlightedRect( null );\n\t\t\tconst attributes = getBlockAttributes( srcClientId );\n\t\t\tupdateBlockAttributes( srcClientId, {\n\t\t\t\tstyle: {\n\t\t\t\t\t...attributes.style,\n\t\t\t\t\tlayout: {\n\t\t\t\t\t\t...attributes.style?.layout,\n\t\t\t\t\t\tcolumnStart: column,\n\t\t\t\t\t\trowStart: row,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t} );\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tmoveBlocksToPosition(\n\t\t\t\t[ srcClientId ],\n\t\t\t\tgetBlockRootClientId( srcClientId ),\n\t\t\t\tgridClientId,\n\t\t\t\tgetNumberOfBlocksBeforeCell( column, row )\n\t\t\t);\n\t\t},\n\t} );\n}\n\nfunction GridVisualizerDropZone( {\n\tcolumn,\n\trow,\n\tgridClientId,\n\tgridInfo,\n\tsetHighlightedRect,\n} ) {\n\treturn (\n\t\t<div\n\t\t\tclassName=\"block-editor-grid-visualizer__drop-zone\"\n\t\t\tref={ useGridVisualizerDropZone(\n\t\t\t\tcolumn,\n\t\t\t\trow,\n\t\t\t\tgridClientId,\n\t\t\t\tgridInfo,\n\t\t\t\tsetHighlightedRect\n\t\t\t) }\n\t\t/>\n\t);\n}\n\nfunction GridVisualizerAppender( {\n\tcolumn,\n\trow,\n\tgridClientId,\n\tgridInfo,\n\tsetHighlightedRect,\n} ) {\n\tconst {\n\t\tupdateBlockAttributes,\n\t\tmoveBlocksToPosition,\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t} = useDispatch( blockEditorStore );\n\n\tconst getNumberOfBlocksBeforeCell = useGetNumberOfBlocksBeforeCell(\n\t\tgridClientId,\n\t\tgridInfo.numColumns\n\t);\n\n\treturn (\n\t\t<ButtonBlockAppender\n\t\t\trootClientId={ gridClientId }\n\t\t\tclassName=\"block-editor-grid-visualizer__appender\"\n\t\t\tref={ useGridVisualizerDropZone(\n\t\t\t\tcolumn,\n\t\t\t\trow,\n\t\t\t\tgridClientId,\n\t\t\t\tgridInfo,\n\t\t\t\tsetHighlightedRect\n\t\t\t) }\n\t\t\tstyle={ {\n\t\t\t\tcolor: gridInfo.currentColor,\n\t\t\t} }\n\t\t\tonSelect={ ( block ) => {\n\t\t\t\tif ( ! block ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tupdateBlockAttributes( block.clientId, {\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\tlayout: {\n\t\t\t\t\t\t\tcolumnStart: column,\n\t\t\t\t\t\t\trowStart: row,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t} );\n\t\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\t\tmoveBlocksToPosition(\n\t\t\t\t\t[ block.clientId ],\n\t\t\t\t\tgridClientId,\n\t\t\t\t\tgridClientId,\n\t\t\t\t\tgetNumberOfBlocksBeforeCell( column, row )\n\t\t\t\t);\n\t\t\t} }\n\t\t/>\n\t);\n}\n\nfunction useDropZoneWithValidation( {\n\tvalidateDrag,\n\tonDragEnter,\n\tonDragLeave,\n\tonDrop,\n} ) {\n\tconst { getDraggedBlockClientIds } = useSelect( blockEditorStore );\n\treturn useDropZone( {\n\t\tonDragEnter() {\n\t\t\tconst [ srcClientId ] = getDraggedBlockClientIds();\n\t\t\tif ( srcClientId && validateDrag( srcClientId ) ) {\n\t\t\t\tonDragEnter( srcClientId );\n\t\t\t}\n\t\t},\n\t\tonDragLeave() {\n\t\t\tonDragLeave();\n\t\t},\n\t\tonDrop() {\n\t\t\tconst [ srcClientId ] = getDraggedBlockClientIds();\n\t\t\tif ( srcClientId && validateDrag( srcClientId ) ) {\n\t\t\t\tonDrop( srcClientId );\n\t\t\t}\n\t\t},\n\t} );\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAiB;AAKjB,qBAAyD;AACzD,kBAAuC;AACvC,qBAAyD;AAKzD,4BAAgC;AAChC,mBAA8B;AAC9B,mBAA8D;AAC9D,mBAA0C;AAC1C,kDAA+C;AAC/C,mCAAgC;AAChC,yBAAuB;AAuBrB;AArBK,SAAS,eAAgB;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GAAI;AACH,QAAM,wBAAoB;AAAA,IACzB,CAAE,WACD,OAAQ,aAAAA,KAAiB,EAAE,YAAY,EAAE;AAAA,I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AAAA,QACP,OAAO,SAAS;AAAA,MACjB;AAAA,MACA,UAAW,CAAE,UAAW;AACvB,YAAK,CAAE,OAAQ;AACd;AAAA,QACD;AACA,8BAAuB,MAAM,UAAU;AAAA,UACtC,OAAO;AAAA,YACN,QAAQ;AAAA,cACP,aAAa;AAAA,cACb,UAAU;AAAA,YACX;AAAA,UACD;AAAA,QACD,CAAE;AACF,gDAAwC;AACxC;AAAA,UACC,CAAE,MAAM,QAAS;AAAA,UACjB;AAAA,UACA;AAAA,UACA,4BAA6B,QAAQ,GAAI;AAAA,QAC1C;AAAA,MACD;AAAA;AAAA,EACD;AAEF;AAEA,SAAS,0BAA2B;AAAA,EACnC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GAAI;AACH,QAAM,EAAE,yBAAyB,QAAI,uBAAW,aAAAH,KAAiB;AACjE,aAAO,eAAAI,2BAAa;AAAA,IACnB,cAAc;AACb,YAAM,CAAE,WAAY,IAAI,yBAAyB;AACjD,UAAK,eAAe,aAAc,WAAY,GAAI;AACjD,oBAAa,WAAY;AAAA,MAC1B;AAAA,IACD;AAAA,IACA,cAAc;AACb,kBAAY;AAAA,IACb;AAAA,IACA,SAAS;AACR,YAAM,CAAE,WAAY,IAAI,yBAAyB;AACjD,UAAK,eAAe,aAAc,WAAY,GAAI;AACjD,eAAQ,WAAY;AAAA,MACrB;AAAA,IACD;AAAA,EACD,CAAE;AACH;",
4
+ "sourcesContent": ["import clsx from 'clsx';\nimport { useState, useEffect, forwardRef, useMemo } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __experimentalUseDropZone as useDropZone } from '@wordpress/compose';\nimport { useBlockElement } from '../block-list/use-block-props/use-block-refs';\nimport BlockPopoverCover from '../block-popover/cover';\nimport { range, GridRect, getGridInfo, getGridItemRect } from './utils';\nimport { store as blockEditorStore } from '../../store';\nimport { useGetNumberOfBlocksBeforeCell } from './use-get-number-of-blocks-before-cell';\nimport ButtonBlockAppender from '../button-block-appender';\nimport { unlock } from '../../lock-unlock';\n\nexport function GridVisualizer( {\n\tclientId,\n\tcontentRef,\n\tparentLayout,\n\tchildGridClientId,\n} ) {\n\tconst isDistractionFree = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).getSettings().isDistractionFree,\n\t\t[]\n\t);\n\tconst gridElement = useBlockElement( clientId );\n\n\tif ( isDistractionFree || ! gridElement ) {\n\t\treturn null;\n\t}\n\n\tconst isManualGrid =\n\t\tparentLayout?.isManualPlacement &&\n\t\twindow.__experimentalEnableGridInteractivity;\n\treturn (\n\t\t<GridVisualizerGrid\n\t\t\tgridClientId={ clientId }\n\t\t\tgridElement={ gridElement }\n\t\t\tisManualGrid={ isManualGrid }\n\t\t\tref={ contentRef }\n\t\t\tchildGridClientId={ childGridClientId }\n\t\t/>\n\t);\n}\n\nconst GridVisualizerGrid = forwardRef(\n\t( { gridClientId, gridElement, isManualGrid, childGridClientId }, ref ) => {\n\t\tconst [ gridInfo, setGridInfo ] = useState( () =>\n\t\t\tgetGridInfo( gridElement )\n\t\t);\n\t\tconst [ isDroppingAllowed, setIsDroppingAllowed ] = useState( false );\n\n\t\t// Get the element for the child grid block so we can\n\t\t// compute its position and hide overlapping visualizer cells.\n\t\tconst childGridElement = useBlockElement( childGridClientId );\n\n\t\t// Compute the child grid block's rect from its position in the grid.\n\t\t// This works for both manual and non-manual grids.\n\t\tconst childGridRect = useMemo( () => {\n\t\t\tif ( ! childGridElement ) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn getGridItemRect( childGridElement );\n\t\t}, [ childGridElement ] );\n\n\t\tuseEffect( () => {\n\t\t\tconst resizeCallback = () =>\n\t\t\t\tsetGridInfo( getGridInfo( gridElement ) );\n\t\t\t// Both border-box and content-box are observed as they may change\n\t\t\t// independently. This requires two observers because a single one\n\t\t\t// can’t be made to monitor both on the same element.\n\t\t\tconst borderBoxSpy = new window.ResizeObserver( resizeCallback );\n\t\t\tborderBoxSpy.observe( gridElement, { box: 'border-box' } );\n\t\t\tconst contentBoxSpy = new window.ResizeObserver( resizeCallback );\n\t\t\tcontentBoxSpy.observe( gridElement );\n\t\t\tfor ( const element of gridElement.children ) {\n\t\t\t\tcontentBoxSpy.observe( element );\n\t\t\t}\n\t\t\treturn () => {\n\t\t\t\tborderBoxSpy.disconnect();\n\t\t\t\tcontentBoxSpy.disconnect();\n\t\t\t};\n\t\t}, [ gridElement ] );\n\n\t\tuseEffect( () => {\n\t\t\tfunction onGlobalDrag() {\n\t\t\t\tsetIsDroppingAllowed( true );\n\t\t\t}\n\t\t\tfunction onGlobalDragEnd() {\n\t\t\t\tsetIsDroppingAllowed( false );\n\t\t\t}\n\t\t\tdocument.addEventListener( 'drag', onGlobalDrag );\n\t\t\tdocument.addEventListener( 'dragend', onGlobalDragEnd );\n\t\t\treturn () => {\n\t\t\t\tdocument.removeEventListener( 'drag', onGlobalDrag );\n\t\t\t\tdocument.removeEventListener( 'dragend', onGlobalDragEnd );\n\t\t\t};\n\t\t}, [] );\n\n\t\treturn (\n\t\t\t<BlockPopoverCover\n\t\t\t\tclassName={ clsx( 'block-editor-grid-visualizer', {\n\t\t\t\t\t'is-dropping-allowed': isDroppingAllowed,\n\t\t\t\t} ) }\n\t\t\t\tclientId={ gridClientId }\n\t\t\t\t__unstablePopoverSlot=\"__unstable-block-tools-after\"\n\t\t\t>\n\t\t\t\t<div\n\t\t\t\t\tref={ ref }\n\t\t\t\t\tclassName=\"block-editor-grid-visualizer__grid\"\n\t\t\t\t\tstyle={ gridInfo.style }\n\t\t\t\t>\n\t\t\t\t\t{ isManualGrid ? (\n\t\t\t\t\t\t<ManualGridVisualizer\n\t\t\t\t\t\t\tgridClientId={ gridClientId }\n\t\t\t\t\t\t\tgridInfo={ gridInfo }\n\t\t\t\t\t\t\tchildGridRect={ childGridRect }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<AutoGridVisualizer\n\t\t\t\t\t\t\tgridInfo={ gridInfo }\n\t\t\t\t\t\t\tchildGridRect={ childGridRect }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t</BlockPopoverCover>\n\t\t);\n\t}\n);\n\nfunction AutoGridVisualizer( { gridInfo, childGridRect } ) {\n\treturn range( 1, gridInfo.numRows ).map( ( row ) =>\n\t\trange( 1, gridInfo.numColumns ).map( ( column ) => {\n\t\t\t// Don't render visualizer cells for a selected child block\n\t\t\t// that is itself a grid, so that only the child's grid\n\t\t\t// visualizer is visible.\n\t\t\tlet color = gridInfo.currentColor;\n\t\t\tif ( childGridRect?.contains( column, row ) ) {\n\t\t\t\tcolor = 'transparent';\n\t\t\t}\n\t\t\treturn (\n\t\t\t\t<GridVisualizerCell\n\t\t\t\t\tkey={ `${ row }-${ column }` }\n\t\t\t\t\tcolor={ color }\n\t\t\t\t/>\n\t\t\t);\n\t\t} )\n\t);\n}\n\nfunction ManualGridVisualizer( { gridClientId, gridInfo, childGridRect } ) {\n\tconst [ highlightedRect, setHighlightedRect ] = useState( null );\n\n\tconst gridItemStyles = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockOrder, getBlockStyles } = unlock(\n\t\t\t\tselect( blockEditorStore )\n\t\t\t);\n\t\t\tconst blockOrder = getBlockOrder( gridClientId );\n\t\t\treturn getBlockStyles( blockOrder );\n\t\t},\n\t\t[ gridClientId ]\n\t);\n\tconst occupiedRects = useMemo( () => {\n\t\tconst rects = [];\n\t\tfor ( const style of Object.values( gridItemStyles ) ) {\n\t\t\tconst {\n\t\t\t\tcolumnStart,\n\t\t\t\trowStart,\n\t\t\t\tcolumnSpan = 1,\n\t\t\t\trowSpan = 1,\n\t\t\t} = style?.layout ?? {};\n\t\t\tif ( ! columnStart || ! rowStart ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\trects.push(\n\t\t\t\tnew GridRect( {\n\t\t\t\t\tcolumnStart,\n\t\t\t\t\trowStart,\n\t\t\t\t\tcolumnSpan,\n\t\t\t\t\trowSpan,\n\t\t\t\t} )\n\t\t\t);\n\t\t}\n\t\treturn rects;\n\t}, [ gridItemStyles ] );\n\n\treturn range( 1, gridInfo.numRows ).map( ( row ) =>\n\t\trange( 1, gridInfo.numColumns ).map( ( column ) => {\n\t\t\t// Don't render visualizer cells for a selected child block\n\t\t\t// that is itself a grid, so that only the child's grid\n\t\t\t// visualizer is visible.\n\t\t\tconst isChildGridCell = childGridRect?.contains( column, row );\n\t\t\tlet color = gridInfo.currentColor;\n\t\t\tif ( isChildGridCell ) {\n\t\t\t\tcolor = 'transparent';\n\t\t\t}\n\t\t\tconst isCellOccupied = occupiedRects.some( ( rect ) =>\n\t\t\t\trect.contains( column, row )\n\t\t\t);\n\t\t\tconst isHighlighted =\n\t\t\t\thighlightedRect?.contains( column, row ) ?? false;\n\t\t\treturn (\n\t\t\t\t<GridVisualizerCell\n\t\t\t\t\tkey={ `${ row }-${ column }` }\n\t\t\t\t\tcolor={ color }\n\t\t\t\t\tclassName={ isHighlighted && 'is-highlighted' }\n\t\t\t\t>\n\t\t\t\t\t{ isCellOccupied && ! isChildGridCell ? (\n\t\t\t\t\t\t<GridVisualizerDropZone\n\t\t\t\t\t\t\tcolumn={ column }\n\t\t\t\t\t\t\trow={ row }\n\t\t\t\t\t\t\tgridClientId={ gridClientId }\n\t\t\t\t\t\t\tgridInfo={ gridInfo }\n\t\t\t\t\t\t\tsetHighlightedRect={ setHighlightedRect }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<GridVisualizerAppender\n\t\t\t\t\t\t\tcolumn={ column }\n\t\t\t\t\t\t\trow={ row }\n\t\t\t\t\t\t\tgridClientId={ gridClientId }\n\t\t\t\t\t\t\tgridInfo={ gridInfo }\n\t\t\t\t\t\t\tsetHighlightedRect={ setHighlightedRect }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</GridVisualizerCell>\n\t\t\t);\n\t\t} )\n\t);\n}\n\nfunction GridVisualizerCell( { color, children, className } ) {\n\treturn (\n\t\t<div\n\t\t\tclassName={ clsx(\n\t\t\t\t'block-editor-grid-visualizer__cell',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t\tstyle={ {\n\t\t\t\tboxShadow: `inset 0 0 0 1px color-mix(in srgb, ${ color } 20%, #0000)`,\n\t\t\t\tcolor,\n\t\t\t} }\n\t\t>\n\t\t\t{ children }\n\t\t</div>\n\t);\n}\n\nfunction useGridVisualizerDropZone(\n\tcolumn,\n\trow,\n\tgridClientId,\n\tgridInfo,\n\tsetHighlightedRect\n) {\n\tconst {\n\t\tgetBlockAttributes,\n\t\tgetBlockRootClientId,\n\t\tcanInsertBlockType,\n\t\tgetBlockName,\n\t} = useSelect( blockEditorStore );\n\tconst {\n\t\tupdateBlockAttributes,\n\t\tmoveBlocksToPosition,\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t} = useDispatch( blockEditorStore );\n\n\tconst getNumberOfBlocksBeforeCell = useGetNumberOfBlocksBeforeCell(\n\t\tgridClientId,\n\t\tgridInfo.numColumns\n\t);\n\n\treturn useDropZoneWithValidation( {\n\t\tvalidateDrag( srcClientId ) {\n\t\t\tconst blockName = getBlockName( srcClientId );\n\t\t\tif ( ! canInsertBlockType( blockName, gridClientId ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tconst attributes = getBlockAttributes( srcClientId );\n\t\t\tconst rect = new GridRect( {\n\t\t\t\tcolumnStart: column,\n\t\t\t\trowStart: row,\n\t\t\t\tcolumnSpan: attributes.style?.layout?.columnSpan,\n\t\t\t\trowSpan: attributes.style?.layout?.rowSpan,\n\t\t\t} );\n\t\t\tconst isInBounds = new GridRect( {\n\t\t\t\tcolumnSpan: gridInfo.numColumns,\n\t\t\t\trowSpan: gridInfo.numRows,\n\t\t\t} ).containsRect( rect );\n\t\t\treturn isInBounds;\n\t\t},\n\t\tonDragEnter( srcClientId ) {\n\t\t\tconst attributes = getBlockAttributes( srcClientId );\n\t\t\tsetHighlightedRect(\n\t\t\t\tnew GridRect( {\n\t\t\t\t\tcolumnStart: column,\n\t\t\t\t\trowStart: row,\n\t\t\t\t\tcolumnSpan: attributes.style?.layout?.columnSpan,\n\t\t\t\t\trowSpan: attributes.style?.layout?.rowSpan,\n\t\t\t\t} )\n\t\t\t);\n\t\t},\n\t\tonDragLeave() {\n\t\t\t// onDragEnter can be called before onDragLeave if the user moves\n\t\t\t// their mouse quickly, so only clear the highlight if it was set\n\t\t\t// by this cell.\n\t\t\tsetHighlightedRect( ( prevHighlightedRect ) =>\n\t\t\t\tprevHighlightedRect?.columnStart === column &&\n\t\t\t\tprevHighlightedRect?.rowStart === row\n\t\t\t\t\t? null\n\t\t\t\t\t: prevHighlightedRect\n\t\t\t);\n\t\t},\n\t\tonDrop( srcClientId ) {\n\t\t\tsetHighlightedRect( null );\n\t\t\tconst attributes = getBlockAttributes( srcClientId );\n\t\t\tupdateBlockAttributes( srcClientId, {\n\t\t\t\tstyle: {\n\t\t\t\t\t...attributes.style,\n\t\t\t\t\tlayout: {\n\t\t\t\t\t\t...attributes.style?.layout,\n\t\t\t\t\t\tcolumnStart: column,\n\t\t\t\t\t\trowStart: row,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t} );\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tmoveBlocksToPosition(\n\t\t\t\t[ srcClientId ],\n\t\t\t\tgetBlockRootClientId( srcClientId ),\n\t\t\t\tgridClientId,\n\t\t\t\tgetNumberOfBlocksBeforeCell( column, row )\n\t\t\t);\n\t\t},\n\t} );\n}\n\nfunction GridVisualizerDropZone( {\n\tcolumn,\n\trow,\n\tgridClientId,\n\tgridInfo,\n\tsetHighlightedRect,\n} ) {\n\treturn (\n\t\t<div\n\t\t\tclassName=\"block-editor-grid-visualizer__drop-zone\"\n\t\t\tref={ useGridVisualizerDropZone(\n\t\t\t\tcolumn,\n\t\t\t\trow,\n\t\t\t\tgridClientId,\n\t\t\t\tgridInfo,\n\t\t\t\tsetHighlightedRect\n\t\t\t) }\n\t\t/>\n\t);\n}\n\nfunction GridVisualizerAppender( {\n\tcolumn,\n\trow,\n\tgridClientId,\n\tgridInfo,\n\tsetHighlightedRect,\n} ) {\n\tconst {\n\t\tupdateBlockAttributes,\n\t\tmoveBlocksToPosition,\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t} = useDispatch( blockEditorStore );\n\n\tconst getNumberOfBlocksBeforeCell = useGetNumberOfBlocksBeforeCell(\n\t\tgridClientId,\n\t\tgridInfo.numColumns\n\t);\n\n\treturn (\n\t\t<ButtonBlockAppender\n\t\t\trootClientId={ gridClientId }\n\t\t\tclassName=\"block-editor-grid-visualizer__appender\"\n\t\t\tref={ useGridVisualizerDropZone(\n\t\t\t\tcolumn,\n\t\t\t\trow,\n\t\t\t\tgridClientId,\n\t\t\t\tgridInfo,\n\t\t\t\tsetHighlightedRect\n\t\t\t) }\n\t\t\tstyle={ {\n\t\t\t\tcolor: gridInfo.currentColor,\n\t\t\t} }\n\t\t\tonSelect={ ( block ) => {\n\t\t\t\tif ( ! block ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tupdateBlockAttributes( block.clientId, {\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\tlayout: {\n\t\t\t\t\t\t\tcolumnStart: column,\n\t\t\t\t\t\t\trowStart: row,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t} );\n\t\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\t\tmoveBlocksToPosition(\n\t\t\t\t\t[ block.clientId ],\n\t\t\t\t\tgridClientId,\n\t\t\t\t\tgridClientId,\n\t\t\t\t\tgetNumberOfBlocksBeforeCell( column, row )\n\t\t\t\t);\n\t\t\t} }\n\t\t/>\n\t);\n}\n\nfunction useDropZoneWithValidation( {\n\tvalidateDrag,\n\tonDragEnter,\n\tonDragLeave,\n\tonDrop,\n} ) {\n\tconst { getDraggedBlockClientIds } = useSelect( blockEditorStore );\n\treturn useDropZone( {\n\t\tonDragEnter() {\n\t\t\tconst [ srcClientId ] = getDraggedBlockClientIds();\n\t\t\tif ( srcClientId && validateDrag( srcClientId ) ) {\n\t\t\t\tonDragEnter( srcClientId );\n\t\t\t}\n\t\t},\n\t\tonDragLeave() {\n\t\t\tonDragLeave();\n\t\t},\n\t\tonDrop() {\n\t\t\tconst [ srcClientId ] = getDraggedBlockClientIds();\n\t\t\tif ( srcClientId && validateDrag( srcClientId ) ) {\n\t\t\t\tonDrop( srcClientId );\n\t\t\t}\n\t\t},\n\t} );\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AACjB,qBAAyD;AACzD,kBAAuC;AACvC,qBAAyD;AACzD,4BAAgC;AAChC,mBAA8B;AAC9B,mBAA8D;AAC9D,mBAA0C;AAC1C,kDAA+C;AAC/C,mCAAgC;AAChC,yBAAuB;AAuBrB;AArBK,SAAS,eAAgB;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GAAI;AACH,QAAM,wBAAoB;AAAA,IACzB,CAAE,WACD,OAAQ,aAAAA,KAAiB,EAAE,YAAY,EAAE;AAAA,IAC1C,CAAC;AAAA,EACF;AACA,QAAM,kBAAc,uCAAiB,QAAS;AAE9C,MAAK,qBAAqB,CAAE,aAAc;AACzC,WAAO;AAAA,EACR;AAEA,QAAM,eACL,cAAc,qBACd,OAAO;AACR,SACC;AAAA,IAAC;AAAA;AAAA,MACA,cAAe;AAAA,MACf;AAAA,MACA;AAAA,MACA,KAAM;AAAA,MACN;AAAA;AAAA,EACD;AAEF;AAEA,IAAM,yBAAqB;AAAA,EAC1B,CAAE,EAAE,cAAc,aAAa,cAAc,kBAAkB,GAAG,QAAS;AAC1E,UAAM,CAAE,UAAU,WAAY,QAAI;AAAA,MAAU,UAC3C,0BAAa,WAAY;AAAA,IAC1B;AACA,UAAM,CAAE,mBAAmB,oBAAqB,QAAI,yBAAU,KAAM;AAIpE,UAAM,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BAAW,aAAAH,KAAiB;AACjE,aAAO,eAAAI,2BAAa;AAAA,IACnB,cAAc;AACb,YAAM,CAAE,WAAY,IAAI,yBAAyB;AACjD,UAAK,eAAe,aAAc,WAAY,GAAI;AACjD,oBAAa,WAAY;AAAA,MAC1B;AAAA,IACD;AAAA,IACA,cAAc;AACb,kBAAY;AAAA,IACb;AAAA,IACA,SAAS;AACR,YAAM,CAAE,WAAY,IAAI,yBAAyB;AACjD,UAAK,eAAe,aAAc,WAAY,GAAI;AACjD,eAAQ,WAAY;AAAA,MACrB;AAAA,IACD;AAAA,EACD,CAAE;AACH;",
6
6
  "names": ["blockEditorStore", "BlockPopoverCover", "clsx", "ButtonBlockAppender", "useDropZone"]
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/grid/use-get-number-of-blocks-before-cell.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\n\nexport function useGetNumberOfBlocksBeforeCell( gridClientId, numColumns ) {\n\tconst { getBlockOrder, getBlockAttributes } = useSelect( blockEditorStore );\n\n\tconst getNumberOfBlocksBeforeCell = ( column, row ) => {\n\t\tconst targetIndex = ( row - 1 ) * numColumns + column - 1;\n\n\t\tlet count = 0;\n\t\tfor ( const clientId of getBlockOrder( gridClientId ) ) {\n\t\t\tconst { columnStart, rowStart } =\n\t\t\t\tgetBlockAttributes( clientId ).style?.layout ?? {};\n\t\t\tconst cellIndex = ( rowStart - 1 ) * numColumns + columnStart - 1;\n\t\t\tif ( cellIndex < targetIndex ) {\n\t\t\t\tcount++;\n\t\t\t}\n\t\t}\n\t\treturn count;\n\t};\n\n\treturn getNumberOfBlocksBeforeCell;\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAA0B;AAK1B,mBAA0C;AAEnC,SAAS,+BAAgC,cAAc,YAAa;AAC1E,QAAM,EAAE,eAAe,mBAAmB,QAAI,uBAAW,aAAAA,KAAiB;AAE1E,QAAM,8BAA8B,CAAE,QAAQ,QAAS;AACtD,UAAM,eAAgB,MAAM,KAAM,aAAa,SAAS;AAExD,QAAI,QAAQ;AACZ,eAAY,YAAY,cAAe,YAAa,GAAI;AACvD,YAAM,EAAE,aAAa,SAAS,IAC7B,mBAAoB,QAAS,EAAE,OAAO,UAAU,CAAC;AAClD,YAAM,aAAc,WAAW,KAAM,aAAa,cAAc;AAChE,UAAK,YAAY,aAAc;AAC9B;AAAA,MACD;AAAA,IACD;AACA,WAAO;AAAA,EACR;AAEA,SAAO;AACR;",
4
+ "sourcesContent": ["import { useSelect } from '@wordpress/data';\nimport { store as blockEditorStore } from '../../store';\n\nexport function useGetNumberOfBlocksBeforeCell( gridClientId, numColumns ) {\n\tconst { getBlockOrder, getBlockAttributes } = useSelect( blockEditorStore );\n\n\tconst getNumberOfBlocksBeforeCell = ( column, row ) => {\n\t\tconst targetIndex = ( row - 1 ) * numColumns + column - 1;\n\n\t\tlet count = 0;\n\t\tfor ( const clientId of getBlockOrder( gridClientId ) ) {\n\t\t\tconst { columnStart, rowStart } =\n\t\t\t\tgetBlockAttributes( clientId ).style?.layout ?? {};\n\t\t\tconst cellIndex = ( rowStart - 1 ) * numColumns + columnStart - 1;\n\t\t\tif ( cellIndex < targetIndex ) {\n\t\t\t\tcount++;\n\t\t\t}\n\t\t}\n\t\treturn count;\n\t};\n\n\treturn getNumberOfBlocksBeforeCell;\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAA0B;AAC1B,mBAA0C;AAEnC,SAAS,+BAAgC,cAAc,YAAa;AAC1E,QAAM,EAAE,eAAe,mBAAmB,QAAI,uBAAW,aAAAA,KAAiB;AAE1E,QAAM,8BAA8B,CAAE,QAAQ,QAAS;AACtD,UAAM,eAAgB,MAAM,KAAM,aAAa,SAAS;AAExD,QAAI,QAAQ;AACZ,eAAY,YAAY,cAAe,YAAa,GAAI;AACvD,YAAM,EAAE,aAAa,SAAS,IAC7B,mBAAoB,QAAS,EAAE,OAAO,UAAU,CAAC;AAClD,YAAM,aAAc,WAAW,KAAM,aAAa,cAAc;AAChE,UAAK,YAAY,aAAc;AAC9B;AAAA,MACD;AAAA,IACD;AACA,WAAO;AAAA,EACR;AAEA,SAAO;AACR;",
6
6
  "names": ["blockEditorStore"]
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/grid/use-grid-layout-sync.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useEffect, useMemo } from '@wordpress/element';\nimport { usePrevious } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\nimport { GridRect } from './utils';\nimport { setImmutably } from '../../utils/object';\n\nexport function useGridLayoutSync( { clientId: gridClientId } ) {\n\tconst { gridLayout, blockOrder, selectedBlockLayout } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockAttributes, getBlockOrder } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst selectedBlock = select( blockEditorStore ).getSelectedBlock();\n\t\t\treturn {\n\t\t\t\tgridLayout: getBlockAttributes( gridClientId ).layout ?? {},\n\t\t\t\tblockOrder: getBlockOrder( gridClientId ),\n\t\t\t\tselectedBlockLayout: selectedBlock?.attributes.style?.layout,\n\t\t\t};\n\t\t},\n\t\t[ gridClientId ]\n\t);\n\n\tconst { getBlockAttributes, getBlockRootClientId } =\n\t\tuseSelect( blockEditorStore );\n\tconst { updateBlockAttributes, __unstableMarkNextChangeAsNotPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\n\tconst selectedBlockRect = useMemo(\n\t\t() =>\n\t\t\tselectedBlockLayout ? new GridRect( selectedBlockLayout ) : null,\n\t\t[ selectedBlockLayout ]\n\t);\n\n\tconst previouslySelectedBlockRect = usePrevious( selectedBlockRect );\n\tconst previousIsManualPlacement = usePrevious(\n\t\tgridLayout.isManualPlacement\n\t);\n\tconst previousBlockOrder = usePrevious( blockOrder );\n\n\tuseEffect( () => {\n\t\tconst updates = {};\n\n\t\tif ( gridLayout.isManualPlacement ) {\n\t\t\tconst occupiedRects = [];\n\n\t\t\t// Respect the position of blocks that already have a columnStart and rowStart value.\n\t\t\tfor ( const clientId of blockOrder ) {\n\t\t\t\tconst {\n\t\t\t\t\tcolumnStart,\n\t\t\t\t\trowStart,\n\t\t\t\t\tcolumnSpan = 1,\n\t\t\t\t\trowSpan = 1,\n\t\t\t\t} = getBlockAttributes( clientId ).style?.layout ?? {};\n\t\t\t\tif ( ! columnStart || ! rowStart ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\toccupiedRects.push(\n\t\t\t\t\tnew GridRect( {\n\t\t\t\t\t\tcolumnStart,\n\t\t\t\t\t\trowStart,\n\t\t\t\t\t\tcolumnSpan,\n\t\t\t\t\t\trowSpan,\n\t\t\t\t\t} )\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// When in manual mode, ensure that every block has a columnStart and rowStart value.\n\t\t\tfor ( const clientId of blockOrder ) {\n\t\t\t\tconst attributes = getBlockAttributes( clientId );\n\t\t\t\tconst {\n\t\t\t\t\tcolumnStart,\n\t\t\t\t\trowStart,\n\t\t\t\t\tcolumnSpan = 1,\n\t\t\t\t\trowSpan = 1,\n\t\t\t\t} = attributes.style?.layout ?? {};\n\t\t\t\tif ( columnStart && rowStart ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tconst [ newColumnStart, newRowStart ] = placeBlock(\n\t\t\t\t\toccupiedRects,\n\t\t\t\t\tgridLayout.columnCount,\n\t\t\t\t\tcolumnSpan,\n\t\t\t\t\trowSpan,\n\t\t\t\t\tpreviouslySelectedBlockRect?.columnEnd,\n\t\t\t\t\tpreviouslySelectedBlockRect?.rowEnd\n\t\t\t\t);\n\t\t\t\toccupiedRects.push(\n\t\t\t\t\tnew GridRect( {\n\t\t\t\t\t\tcolumnStart: newColumnStart,\n\t\t\t\t\t\trowStart: newRowStart,\n\t\t\t\t\t\tcolumnSpan,\n\t\t\t\t\t\trowSpan,\n\t\t\t\t\t} )\n\t\t\t\t);\n\t\t\t\tupdates[ clientId ] = {\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\t...attributes.style,\n\t\t\t\t\t\tlayout: {\n\t\t\t\t\t\t\t...attributes.style?.layout,\n\t\t\t\t\t\t\tcolumnStart: newColumnStart,\n\t\t\t\t\t\t\trowStart: newRowStart,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t}\n\n\t\t\t// Ensure there's enough rows to fit all blocks.\n\t\t\tconst bottomMostRow = Math.max(\n\t\t\t\t...occupiedRects.map( ( r ) => r.rowEnd )\n\t\t\t);\n\t\t\tif (\n\t\t\t\t! gridLayout.rowCount ||\n\t\t\t\tgridLayout.rowCount < bottomMostRow\n\t\t\t) {\n\t\t\t\tupdates[ gridClientId ] = {\n\t\t\t\t\tlayout: {\n\t\t\t\t\t\t...gridLayout,\n\t\t\t\t\t\trowCount: bottomMostRow,\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t}\n\n\t\t\t// Unset grid layout attributes for blocks removed from the grid.\n\t\t\tfor ( const clientId of previousBlockOrder ?? [] ) {\n\t\t\t\tif ( ! blockOrder.includes( clientId ) ) {\n\t\t\t\t\tconst rootClientId = getBlockRootClientId( clientId );\n\n\t\t\t\t\t// Block was removed from the editor, so nothing to do.\n\t\t\t\t\tif ( rootClientId === null ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Check if the block is being moved to another grid.\n\t\t\t\t\t// If so, do nothing and let the new grid parent handle\n\t\t\t\t\t// the attributes.\n\t\t\t\t\tconst rootAttributes = getBlockAttributes( rootClientId );\n\t\t\t\t\tif ( rootAttributes?.layout?.type === 'grid' ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst attributes = getBlockAttributes( clientId );\n\t\t\t\t\tconst {\n\t\t\t\t\t\tcolumnStart,\n\t\t\t\t\t\trowStart,\n\t\t\t\t\t\tcolumnSpan,\n\t\t\t\t\t\trowSpan,\n\t\t\t\t\t\t...layout\n\t\t\t\t\t} = attributes.style?.layout ?? {};\n\n\t\t\t\t\tif ( columnStart || rowStart || columnSpan || rowSpan ) {\n\t\t\t\t\t\tconst hasEmptyLayoutAttribute =\n\t\t\t\t\t\t\tObject.keys( layout ).length === 0;\n\n\t\t\t\t\t\tupdates[ clientId ] = setImmutably(\n\t\t\t\t\t\t\tattributes,\n\t\t\t\t\t\t\t[ 'style', 'layout' ],\n\t\t\t\t\t\t\thasEmptyLayoutAttribute ? undefined : layout\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// Remove all of the columnStart and rowStart values\n\t\t\t// when switching from manual to auto mode,\n\t\t\tif ( previousIsManualPlacement === true ) {\n\t\t\t\tfor ( const clientId of blockOrder ) {\n\t\t\t\t\tconst attributes = getBlockAttributes( clientId );\n\t\t\t\t\tconst { columnStart, rowStart, ...layout } =\n\t\t\t\t\t\tattributes.style?.layout ?? {};\n\t\t\t\t\t// Only update attributes if columnStart or rowStart are set.\n\t\t\t\t\tif ( columnStart || rowStart ) {\n\t\t\t\t\t\tconst hasEmptyLayoutAttribute =\n\t\t\t\t\t\t\tObject.keys( layout ).length === 0;\n\n\t\t\t\t\t\tupdates[ clientId ] = setImmutably(\n\t\t\t\t\t\t\tattributes,\n\t\t\t\t\t\t\t[ 'style', 'layout' ],\n\t\t\t\t\t\t\thasEmptyLayoutAttribute ? undefined : layout\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Remove row styles in auto mode\n\t\t\tif ( gridLayout.rowCount ) {\n\t\t\t\tupdates[ gridClientId ] = {\n\t\t\t\t\tlayout: {\n\t\t\t\t\t\t...gridLayout,\n\t\t\t\t\t\trowCount: undefined,\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\tif ( Object.keys( updates ).length ) {\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tupdateBlockAttributes(\n\t\t\t\tObject.keys( updates ),\n\t\t\t\tupdates,\n\t\t\t\t/* uniqueByBlock: */ true\n\t\t\t);\n\t\t}\n\t}, [\n\t\t// Actual deps to sync:\n\t\tgridClientId,\n\t\tgridLayout,\n\t\tpreviousBlockOrder,\n\t\tblockOrder,\n\t\tpreviouslySelectedBlockRect,\n\t\tpreviousIsManualPlacement,\n\t\t// These won't change, but the linter thinks they might:\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t\tgetBlockAttributes,\n\t\tgetBlockRootClientId,\n\t\tupdateBlockAttributes,\n\t] );\n}\n\n/**\n * @param {GridRect[]} occupiedRects\n * @param {number} gridColumnCount\n * @param {number} blockColumnSpan\n * @param {number} blockRowSpan\n * @param {number?} startColumn\n * @param {number?} startRow\n */\nfunction placeBlock(\n\toccupiedRects,\n\tgridColumnCount,\n\tblockColumnSpan,\n\tblockRowSpan,\n\tstartColumn = 1,\n\tstartRow = 1\n) {\n\tfor ( let row = startRow; ; row++ ) {\n\t\tfor (\n\t\t\tlet column = row === startRow ? startColumn : 1;\n\t\t\tcolumn <= gridColumnCount;\n\t\t\tcolumn++\n\t\t) {\n\t\t\tconst candidateRect = new GridRect( {\n\t\t\t\tcolumnStart: column,\n\t\t\t\trowStart: row,\n\t\t\t\tcolumnSpan: blockColumnSpan,\n\t\t\t\trowSpan: blockRowSpan,\n\t\t\t} );\n\t\t\tif (\n\t\t\t\t! occupiedRects.some( ( r ) =>\n\t\t\t\t\tr.intersectsRect( candidateRect )\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\treturn [ column, row ];\n\t\t\t}\n\t\t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A,IAEA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,CAAE;AACH;AAUA,SAAS,WACR,eACA,iBACA,iBACA,cACA,cAAc,GACd,WAAW,GACV;AACD,WAAU,MAAM,YAAY,OAAQ;AACnC,aACK,SAAS,QAAQ,WAAW,cAAc,GAC9C,UAAU,iBACV,UACC;AACD,YAAM,gBAAgB,IAAI,sBAAU;AAAA,QACnC,aAAa;AAAA,QACb,UAAU;AAAA,QACV,YAAY;AAAA,QACZ,SAAS;AAAA,MACV,CAAE;AACF,UACC,CAAE,cAAc;AAAA,QAAM,CAAE,MACvB,EAAE,eAAgB,aAAc;AAAA,MACjC,GACC;AACD,eAAO,CAAE,QAAQ,GAAI;AAAA,MACtB;AAAA,IACD;AAAA,EACD;AACD;",
4
+ "sourcesContent": ["import { useDispatch, useSelect } from '@wordpress/data';\nimport { useEffect, useMemo } from '@wordpress/element';\nimport { usePrevious } from '@wordpress/compose';\nimport { store as blockEditorStore } from '../../store';\nimport { GridRect } from './utils';\nimport { setImmutably } from '../../utils/object';\n\nexport function useGridLayoutSync( { clientId: gridClientId } ) {\n\tconst { gridLayout, blockOrder, selectedBlockLayout } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockAttributes, getBlockOrder } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst selectedBlock = select( blockEditorStore ).getSelectedBlock();\n\t\t\treturn {\n\t\t\t\tgridLayout: getBlockAttributes( gridClientId ).layout ?? {},\n\t\t\t\tblockOrder: getBlockOrder( gridClientId ),\n\t\t\t\tselectedBlockLayout: selectedBlock?.attributes.style?.layout,\n\t\t\t};\n\t\t},\n\t\t[ gridClientId ]\n\t);\n\n\tconst { getBlockAttributes, getBlockRootClientId } =\n\t\tuseSelect( blockEditorStore );\n\tconst { updateBlockAttributes, __unstableMarkNextChangeAsNotPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\n\tconst selectedBlockRect = useMemo(\n\t\t() =>\n\t\t\tselectedBlockLayout ? new GridRect( selectedBlockLayout ) : null,\n\t\t[ selectedBlockLayout ]\n\t);\n\n\tconst previouslySelectedBlockRect = usePrevious( selectedBlockRect );\n\tconst previousIsManualPlacement = usePrevious(\n\t\tgridLayout.isManualPlacement\n\t);\n\tconst previousBlockOrder = usePrevious( blockOrder );\n\n\tuseEffect( () => {\n\t\tconst updates = {};\n\n\t\tif ( gridLayout.isManualPlacement ) {\n\t\t\tconst occupiedRects = [];\n\n\t\t\t// Respect the position of blocks that already have a columnStart and rowStart value.\n\t\t\tfor ( const clientId of blockOrder ) {\n\t\t\t\tconst {\n\t\t\t\t\tcolumnStart,\n\t\t\t\t\trowStart,\n\t\t\t\t\tcolumnSpan = 1,\n\t\t\t\t\trowSpan = 1,\n\t\t\t\t} = getBlockAttributes( clientId ).style?.layout ?? {};\n\t\t\t\tif ( ! columnStart || ! rowStart ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\toccupiedRects.push(\n\t\t\t\t\tnew GridRect( {\n\t\t\t\t\t\tcolumnStart,\n\t\t\t\t\t\trowStart,\n\t\t\t\t\t\tcolumnSpan,\n\t\t\t\t\t\trowSpan,\n\t\t\t\t\t} )\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// When in manual mode, ensure that every block has a columnStart and rowStart value.\n\t\t\tfor ( const clientId of blockOrder ) {\n\t\t\t\tconst attributes = getBlockAttributes( clientId );\n\t\t\t\tconst {\n\t\t\t\t\tcolumnStart,\n\t\t\t\t\trowStart,\n\t\t\t\t\tcolumnSpan = 1,\n\t\t\t\t\trowSpan = 1,\n\t\t\t\t} = attributes.style?.layout ?? {};\n\t\t\t\tif ( columnStart && rowStart ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tconst [ newColumnStart, newRowStart ] = placeBlock(\n\t\t\t\t\toccupiedRects,\n\t\t\t\t\tgridLayout.columnCount,\n\t\t\t\t\tcolumnSpan,\n\t\t\t\t\trowSpan,\n\t\t\t\t\tpreviouslySelectedBlockRect?.columnEnd,\n\t\t\t\t\tpreviouslySelectedBlockRect?.rowEnd\n\t\t\t\t);\n\t\t\t\toccupiedRects.push(\n\t\t\t\t\tnew GridRect( {\n\t\t\t\t\t\tcolumnStart: newColumnStart,\n\t\t\t\t\t\trowStart: newRowStart,\n\t\t\t\t\t\tcolumnSpan,\n\t\t\t\t\t\trowSpan,\n\t\t\t\t\t} )\n\t\t\t\t);\n\t\t\t\tupdates[ clientId ] = {\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\t...attributes.style,\n\t\t\t\t\t\tlayout: {\n\t\t\t\t\t\t\t...attributes.style?.layout,\n\t\t\t\t\t\t\tcolumnStart: newColumnStart,\n\t\t\t\t\t\t\trowStart: newRowStart,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t}\n\n\t\t\t// Ensure there's enough rows to fit all blocks.\n\t\t\tconst bottomMostRow = Math.max(\n\t\t\t\t...occupiedRects.map( ( r ) => r.rowEnd )\n\t\t\t);\n\t\t\tif (\n\t\t\t\t! gridLayout.rowCount ||\n\t\t\t\tgridLayout.rowCount < bottomMostRow\n\t\t\t) {\n\t\t\t\tupdates[ gridClientId ] = {\n\t\t\t\t\tlayout: {\n\t\t\t\t\t\t...gridLayout,\n\t\t\t\t\t\trowCount: bottomMostRow,\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t}\n\n\t\t\t// Unset grid layout attributes for blocks removed from the grid.\n\t\t\tfor ( const clientId of previousBlockOrder ?? [] ) {\n\t\t\t\tif ( ! blockOrder.includes( clientId ) ) {\n\t\t\t\t\tconst rootClientId = getBlockRootClientId( clientId );\n\n\t\t\t\t\t// Block was removed from the editor, so nothing to do.\n\t\t\t\t\tif ( rootClientId === null ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Check if the block is being moved to another grid.\n\t\t\t\t\t// If so, do nothing and let the new grid parent handle\n\t\t\t\t\t// the attributes.\n\t\t\t\t\tconst rootAttributes = getBlockAttributes( rootClientId );\n\t\t\t\t\tif ( rootAttributes?.layout?.type === 'grid' ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst attributes = getBlockAttributes( clientId );\n\t\t\t\t\tconst {\n\t\t\t\t\t\tcolumnStart,\n\t\t\t\t\t\trowStart,\n\t\t\t\t\t\tcolumnSpan,\n\t\t\t\t\t\trowSpan,\n\t\t\t\t\t\t...layout\n\t\t\t\t\t} = attributes.style?.layout ?? {};\n\n\t\t\t\t\tif ( columnStart || rowStart || columnSpan || rowSpan ) {\n\t\t\t\t\t\tconst hasEmptyLayoutAttribute =\n\t\t\t\t\t\t\tObject.keys( layout ).length === 0;\n\n\t\t\t\t\t\tupdates[ clientId ] = setImmutably(\n\t\t\t\t\t\t\tattributes,\n\t\t\t\t\t\t\t[ 'style', 'layout' ],\n\t\t\t\t\t\t\thasEmptyLayoutAttribute ? undefined : layout\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// Remove all of the columnStart and rowStart values\n\t\t\t// when switching from manual to auto mode,\n\t\t\tif ( previousIsManualPlacement === true ) {\n\t\t\t\tfor ( const clientId of blockOrder ) {\n\t\t\t\t\tconst attributes = getBlockAttributes( clientId );\n\t\t\t\t\tconst { columnStart, rowStart, ...layout } =\n\t\t\t\t\t\tattributes.style?.layout ?? {};\n\t\t\t\t\t// Only update attributes if columnStart or rowStart are set.\n\t\t\t\t\tif ( columnStart || rowStart ) {\n\t\t\t\t\t\tconst hasEmptyLayoutAttribute =\n\t\t\t\t\t\t\tObject.keys( layout ).length === 0;\n\n\t\t\t\t\t\tupdates[ clientId ] = setImmutably(\n\t\t\t\t\t\t\tattributes,\n\t\t\t\t\t\t\t[ 'style', 'layout' ],\n\t\t\t\t\t\t\thasEmptyLayoutAttribute ? undefined : layout\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Remove row styles in auto mode\n\t\t\tif ( gridLayout.rowCount ) {\n\t\t\t\tupdates[ gridClientId ] = {\n\t\t\t\t\tlayout: {\n\t\t\t\t\t\t...gridLayout,\n\t\t\t\t\t\trowCount: undefined,\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\tif ( Object.keys( updates ).length ) {\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tupdateBlockAttributes(\n\t\t\t\tObject.keys( updates ),\n\t\t\t\tupdates,\n\t\t\t\t/* uniqueByBlock: */ true\n\t\t\t);\n\t\t}\n\t}, [\n\t\t// Actual deps to sync:\n\t\tgridClientId,\n\t\tgridLayout,\n\t\tpreviousBlockOrder,\n\t\tblockOrder,\n\t\tpreviouslySelectedBlockRect,\n\t\tpreviousIsManualPlacement,\n\t\t// These won't change, but the linter thinks they might:\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t\tgetBlockAttributes,\n\t\tgetBlockRootClientId,\n\t\tupdateBlockAttributes,\n\t] );\n}\n\n/**\n * @param {GridRect[]} occupiedRects\n * @param {number} gridColumnCount\n * @param {number} blockColumnSpan\n * @param {number} blockRowSpan\n * @param {number?} startColumn\n * @param {number?} startRow\n */\nfunction placeBlock(\n\toccupiedRects,\n\tgridColumnCount,\n\tblockColumnSpan,\n\tblockRowSpan,\n\tstartColumn = 1,\n\tstartRow = 1\n) {\n\tfor ( let row = startRow; ; row++ ) {\n\t\tfor (\n\t\t\tlet column = row === startRow ? startColumn : 1;\n\t\t\tcolumn <= gridColumnCount;\n\t\t\tcolumn++\n\t\t) {\n\t\t\tconst candidateRect = new GridRect( {\n\t\t\t\tcolumnStart: column,\n\t\t\t\trowStart: row,\n\t\t\t\tcolumnSpan: blockColumnSpan,\n\t\t\t\trowSpan: blockRowSpan,\n\t\t\t} );\n\t\t\tif (\n\t\t\t\t! occupiedRects.some( ( r ) =>\n\t\t\t\t\tr.intersectsRect( candidateRect )\n\t\t\t\t)\n\t\t\t) {\n\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A,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAAA,IAEA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,CAAE;AACH;AAUA,SAAS,WACR,eACA,iBACA,iBACA,cACA,cAAc,GACd,WAAW,GACV;AACD,WAAU,MAAM,YAAY,OAAQ;AACnC,aACK,SAAS,QAAQ,WAAW,cAAc,GAC9C,UAAU,iBACV,UACC;AACD,YAAM,gBAAgB,IAAI,sBAAU;AAAA,QACnC,aAAa;AAAA,QACb,UAAU;AAAA,QACV,YAAY;AAAA,QACZ,SAAS;AAAA,MACV,CAAE;AACF,UACC,CAAE,cAAc;AAAA,QAAM,CAAE,MACvB,EAAE,eAAgB,aAAc;AAAA,MACjC,GACC;AACD,eAAO,CAAE,QAAQ,GAAI;AAAA,MACtB;AAAA,IACD;AAAA,EACD;AACD;",
6
6
  "names": ["getBlockAttributes", "blockEditorStore"]
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/height-control/index.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport {\n\tBaseControl,\n\tRangeControl,\n\tFlex,\n\tFlexItem,\n\t__experimentalSpacer as Spacer,\n\t__experimentalUseCustomUnits as useCustomUnits,\n\t__experimentalUnitControl as UnitControl,\n\t__experimentalParseQuantityAndUnitFromRawValue as parseQuantityAndUnitFromRawValue,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport { useSettings } from '../use-settings';\n\nconst RANGE_CONTROL_CUSTOM_SETTINGS = {\n\tpx: { max: 1000, step: 1 },\n\t'%': { max: 100, step: 1 },\n\tvw: { max: 100, step: 1 },\n\tvh: { max: 100, step: 1 },\n\tem: { max: 50, step: 0.1 },\n\trem: { max: 50, step: 0.1 },\n\tsvw: { max: 100, step: 1 },\n\tlvw: { max: 100, step: 1 },\n\tdvw: { max: 100, step: 1 },\n\tsvh: { max: 100, step: 1 },\n\tlvh: { max: 100, step: 1 },\n\tdvh: { max: 100, step: 1 },\n\tvi: { max: 100, step: 1 },\n\tsvi: { max: 100, step: 1 },\n\tlvi: { max: 100, step: 1 },\n\tdvi: { max: 100, step: 1 },\n\tvb: { max: 100, step: 1 },\n\tsvb: { max: 100, step: 1 },\n\tlvb: { max: 100, step: 1 },\n\tdvb: { max: 100, step: 1 },\n\tvmin: { max: 100, step: 1 },\n\tsvmin: { max: 100, step: 1 },\n\tlvmin: { max: 100, step: 1 },\n\tdvmin: { max: 100, step: 1 },\n\tvmax: { max: 100, step: 1 },\n\tsvmax: { max: 100, step: 1 },\n\tlvmax: { max: 100, step: 1 },\n\tdvmax: { max: 100, step: 1 },\n};\n\n/**\n * HeightControl renders a linked unit control and range control for adjusting the height of a block.\n *\n * @deprecated Use DimensionControl instead.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/height-control/README.md\n *\n * @param {Object} props\n * @param {?string} props.label A label for the control.\n * @param {( value: string ) => void } props.onChange Called when the height changes.\n * @param {string} props.value The current height value.\n *\n * @return {Component} The component to be rendered.\n */\nexport default function HeightControl( {\n\tlabel = __( 'Height' ),\n\tonChange,\n\tvalue,\n} ) {\n\tdeprecated( 'wp.blockEditor.HeightControl', {\n\t\tsince: '7.0',\n\t\tversion: '7.2',\n\t\talternative: 'wp.blockEditor.DimensionControl',\n\t} );\n\tconst customRangeValue = parseFloat( value );\n\n\tconst [ availableUnits ] = useSettings( 'spacing.units' );\n\tconst units = useCustomUnits( {\n\t\tavailableUnits: availableUnits || [\n\t\t\t'%',\n\t\t\t'px',\n\t\t\t'em',\n\t\t\t'rem',\n\t\t\t'vh',\n\t\t\t'vw',\n\t\t],\n\t} );\n\n\tconst selectedUnit =\n\t\tuseMemo(\n\t\t\t() => parseQuantityAndUnitFromRawValue( value ),\n\t\t\t[ value ]\n\t\t)[ 1 ] ||\n\t\tunits[ 0 ]?.value ||\n\t\t'px';\n\n\tconst handleSliderChange = ( next ) => {\n\t\tonChange( [ next, selectedUnit ].join( '' ) );\n\t};\n\n\tconst handleUnitChange = ( newUnit ) => {\n\t\t// Attempt to smooth over differences between currentUnit and newUnit.\n\t\t// This should slightly improve the experience of switching between unit types.\n\t\tconst [ currentValue, currentUnit ] =\n\t\t\tparseQuantityAndUnitFromRawValue( value );\n\n\t\tif ( [ 'em', 'rem' ].includes( newUnit ) && currentUnit === 'px' ) {\n\t\t\t// Convert pixel value to an approximate of the new unit, assuming a root size of 16px.\n\t\t\tonChange( ( currentValue / 16 ).toFixed( 2 ) + newUnit );\n\t\t} else if (\n\t\t\t[ 'em', 'rem' ].includes( currentUnit ) &&\n\t\t\tnewUnit === 'px'\n\t\t) {\n\t\t\t// Convert to pixel value assuming a root size of 16px.\n\t\t\tonChange( Math.round( currentValue * 16 ) + newUnit );\n\t\t} else if (\n\t\t\t[\n\t\t\t\t'%',\n\t\t\t\t'vw',\n\t\t\t\t'svw',\n\t\t\t\t'lvw',\n\t\t\t\t'dvw',\n\t\t\t\t'vh',\n\t\t\t\t'svh',\n\t\t\t\t'lvh',\n\t\t\t\t'dvh',\n\t\t\t\t'vi',\n\t\t\t\t'svi',\n\t\t\t\t'lvi',\n\t\t\t\t'dvi',\n\t\t\t\t'vb',\n\t\t\t\t'svb',\n\t\t\t\t'lvb',\n\t\t\t\t'dvb',\n\t\t\t\t'vmin',\n\t\t\t\t'svmin',\n\t\t\t\t'lvmin',\n\t\t\t\t'dvmin',\n\t\t\t\t'vmax',\n\t\t\t\t'svmax',\n\t\t\t\t'lvmax',\n\t\t\t\t'dvmax',\n\t\t\t].includes( newUnit ) &&\n\t\t\tcurrentValue > 100\n\t\t) {\n\t\t\t// When converting to `%` or viewport-relative units, cap the new value at 100.\n\t\t\tonChange( 100 + newUnit );\n\t\t}\n\t};\n\n\treturn (\n\t\t<fieldset className=\"block-editor-height-control\">\n\t\t\t<BaseControl.VisualLabel as=\"legend\">\n\t\t\t\t{ label }\n\t\t\t</BaseControl.VisualLabel>\n\t\t\t<Flex>\n\t\t\t\t<FlexItem isBlock>\n\t\t\t\t\t<UnitControl\n\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\tonUnitChange={ handleUnitChange }\n\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t/>\n\t\t\t\t</FlexItem>\n\t\t\t\t<FlexItem isBlock>\n\t\t\t\t\t<Spacer marginX={ 2 } marginBottom={ 0 }>\n\t\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t\tvalue={ customRangeValue }\n\t\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\t\tmax={\n\t\t\t\t\t\t\t\tRANGE_CONTROL_CUSTOM_SETTINGS[ selectedUnit ]\n\t\t\t\t\t\t\t\t\t?.max ?? 100\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tstep={\n\t\t\t\t\t\t\t\tRANGE_CONTROL_CUSTOM_SETTINGS[ selectedUnit ]\n\t\t\t\t\t\t\t\t\t?.step ?? 0.1\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\twithInputField={ false }\n\t\t\t\t\t\t\tonChange={ handleSliderChange }\n\t\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t/>\n\t\t\t\t\t</Spacer>\n\t\t\t\t</FlexItem>\n\t\t\t</Flex>\n\t\t</fieldset>\n\t);\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,qBAAwB;AACxB,wBASO;AACP,kBAAmB;AACnB,wBAAuB;AAKvB,0BAA4B;AAuIzB;AArIH,IAAM,gCAAgC;AAAA,EACrC,IAAI,EAAE,KAAK,KAAM,MAAM,EAAE;AAAA,EACzB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A,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACD,EAAE,SAAU,OAAQ,KACpB,eAAe,KACd;AAED,eAAU,MAAM,OAAQ;AAAA,IACzB;AAAA,EACD;AAEA,SACC,6CAAC,cAAS,WAAU,+BACnB;AAAA,gDAAC,8BAAY,aAAZ,EAAwB,IAAG,UACzB,iBACH;AAAA,IACA,6CAAC,0BACA;AAAA,kDAAC,8BAAS,SAAO,MAChB;AAAA,QAAC,kBAAAC;AAAA,QAAA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA,cAAe;AAAA,UACf,KAAM;AAAA,UACN;AAAA,UACA,qBAAmB;AAAA;AAAA,MACpB,GACD;AAAA,MACA,4CAAC,8BAAS,SAAO,MAChB,sDAAC,kBAAAC,sBAAA,EAAO,SAAU,GAAI,cAAe,GACpC;AAAA,QAAC;AAAA;AAAA,UACA,OAAQ;AAAA,UACR,KAAM;AAAA,UACN,KACC,8BAA+B,YAAa,GACzC,OAAO;AAAA,UAEX,MACC,8BAA+B,YAAa,GACzC,QAAQ;AAAA,UAEZ,gBAAiB;AAAA,UACjB,UAAW;AAAA,UACX;AAAA,UACA,qBAAmB;AAAA;AAAA,MACpB,GACD,GACD;AAAA,OACD;AAAA,KACD;AAEF;",
4
+ "sourcesContent": ["import { useMemo } from '@wordpress/element';\nimport {\n\tBaseControl,\n\tRangeControl,\n\tFlex,\n\tFlexItem,\n\t__experimentalSpacer as Spacer,\n\t__experimentalUseCustomUnits as useCustomUnits,\n\t__experimentalUnitControl as UnitControl,\n\t__experimentalParseQuantityAndUnitFromRawValue as parseQuantityAndUnitFromRawValue,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport deprecated from '@wordpress/deprecated';\nimport { useSettings } from '../use-settings';\n\nconst RANGE_CONTROL_CUSTOM_SETTINGS = {\n\tpx: { max: 1000, step: 1 },\n\t'%': { max: 100, step: 1 },\n\tvw: { max: 100, step: 1 },\n\tvh: { max: 100, step: 1 },\n\tem: { max: 50, step: 0.1 },\n\trem: { max: 50, step: 0.1 },\n\tsvw: { max: 100, step: 1 },\n\tlvw: { max: 100, step: 1 },\n\tdvw: { max: 100, step: 1 },\n\tsvh: { max: 100, step: 1 },\n\tlvh: { max: 100, step: 1 },\n\tdvh: { max: 100, step: 1 },\n\tvi: { max: 100, step: 1 },\n\tsvi: { max: 100, step: 1 },\n\tlvi: { max: 100, step: 1 },\n\tdvi: { max: 100, step: 1 },\n\tvb: { max: 100, step: 1 },\n\tsvb: { max: 100, step: 1 },\n\tlvb: { max: 100, step: 1 },\n\tdvb: { max: 100, step: 1 },\n\tvmin: { max: 100, step: 1 },\n\tsvmin: { max: 100, step: 1 },\n\tlvmin: { max: 100, step: 1 },\n\tdvmin: { max: 100, step: 1 },\n\tvmax: { max: 100, step: 1 },\n\tsvmax: { max: 100, step: 1 },\n\tlvmax: { max: 100, step: 1 },\n\tdvmax: { max: 100, step: 1 },\n};\n\n/**\n * HeightControl renders a linked unit control and range control for adjusting the height of a block.\n *\n * @deprecated Use DimensionControl instead.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/height-control/README.md\n *\n * @param {Object} props\n * @param {?string} props.label A label for the control.\n * @param {( value: string ) => void } props.onChange Called when the height changes.\n * @param {string} props.value The current height value.\n *\n * @return {Component} The component to be rendered.\n */\nexport default function HeightControl( {\n\tlabel = __( 'Height' ),\n\tonChange,\n\tvalue,\n} ) {\n\tdeprecated( 'wp.blockEditor.HeightControl', {\n\t\tsince: '7.0',\n\t\tversion: '7.2',\n\t\talternative: 'wp.blockEditor.DimensionControl',\n\t} );\n\tconst customRangeValue = parseFloat( value );\n\n\tconst [ availableUnits ] = useSettings( 'spacing.units' );\n\tconst units = useCustomUnits( {\n\t\tavailableUnits: availableUnits || [\n\t\t\t'%',\n\t\t\t'px',\n\t\t\t'em',\n\t\t\t'rem',\n\t\t\t'vh',\n\t\t\t'vw',\n\t\t],\n\t} );\n\n\tconst selectedUnit =\n\t\tuseMemo(\n\t\t\t() => parseQuantityAndUnitFromRawValue( value ),\n\t\t\t[ value ]\n\t\t)[ 1 ] ||\n\t\tunits[ 0 ]?.value ||\n\t\t'px';\n\n\tconst handleSliderChange = ( next ) => {\n\t\tonChange( [ next, selectedUnit ].join( '' ) );\n\t};\n\n\tconst handleUnitChange = ( newUnit ) => {\n\t\t// Attempt to smooth over differences between currentUnit and newUnit.\n\t\t// This should slightly improve the experience of switching between unit types.\n\t\tconst [ currentValue, currentUnit ] =\n\t\t\tparseQuantityAndUnitFromRawValue( value );\n\n\t\tif ( [ 'em', 'rem' ].includes( newUnit ) && currentUnit === 'px' ) {\n\t\t\t// Convert pixel value to an approximate of the new unit, assuming a root size of 16px.\n\t\t\tonChange( ( currentValue / 16 ).toFixed( 2 ) + newUnit );\n\t\t} else if (\n\t\t\t[ 'em', 'rem' ].includes( currentUnit ) &&\n\t\t\tnewUnit === 'px'\n\t\t) {\n\t\t\t// Convert to pixel value assuming a root size of 16px.\n\t\t\tonChange( Math.round( currentValue * 16 ) + newUnit );\n\t\t} else if (\n\t\t\t[\n\t\t\t\t'%',\n\t\t\t\t'vw',\n\t\t\t\t'svw',\n\t\t\t\t'lvw',\n\t\t\t\t'dvw',\n\t\t\t\t'vh',\n\t\t\t\t'svh',\n\t\t\t\t'lvh',\n\t\t\t\t'dvh',\n\t\t\t\t'vi',\n\t\t\t\t'svi',\n\t\t\t\t'lvi',\n\t\t\t\t'dvi',\n\t\t\t\t'vb',\n\t\t\t\t'svb',\n\t\t\t\t'lvb',\n\t\t\t\t'dvb',\n\t\t\t\t'vmin',\n\t\t\t\t'svmin',\n\t\t\t\t'lvmin',\n\t\t\t\t'dvmin',\n\t\t\t\t'vmax',\n\t\t\t\t'svmax',\n\t\t\t\t'lvmax',\n\t\t\t\t'dvmax',\n\t\t\t].includes( newUnit ) &&\n\t\t\tcurrentValue > 100\n\t\t) {\n\t\t\t// When converting to `%` or viewport-relative units, cap the new value at 100.\n\t\t\tonChange( 100 + newUnit );\n\t\t}\n\t};\n\n\treturn (\n\t\t<fieldset className=\"block-editor-height-control\">\n\t\t\t<BaseControl.VisualLabel as=\"legend\">\n\t\t\t\t{ label }\n\t\t\t</BaseControl.VisualLabel>\n\t\t\t<Flex>\n\t\t\t\t<FlexItem isBlock>\n\t\t\t\t\t<UnitControl\n\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\tonUnitChange={ handleUnitChange }\n\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t/>\n\t\t\t\t</FlexItem>\n\t\t\t\t<FlexItem isBlock>\n\t\t\t\t\t<Spacer marginX={ 2 } marginBottom={ 0 }>\n\t\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t\tvalue={ customRangeValue }\n\t\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\t\tmax={\n\t\t\t\t\t\t\t\tRANGE_CONTROL_CUSTOM_SETTINGS[ selectedUnit ]\n\t\t\t\t\t\t\t\t\t?.max ?? 100\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tstep={\n\t\t\t\t\t\t\t\tRANGE_CONTROL_CUSTOM_SETTINGS[ selectedUnit ]\n\t\t\t\t\t\t\t\t\t?.step ?? 0.1\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\twithInputField={ false }\n\t\t\t\t\t\t\tonChange={ handleSliderChange }\n\t\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t/>\n\t\t\t\t\t</Spacer>\n\t\t\t\t</FlexItem>\n\t\t\t</Flex>\n\t\t</fieldset>\n\t);\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAA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AQ;AAAA,IACrD,WACC;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACD,EAAE,SAAU,OAAQ,KACpB,eAAe,KACd;AAED,eAAU,MAAM,OAAQ;AAAA,IACzB;AAAA,EACD;AAEA,SACC,6CAAC,cAAS,WAAU,+BACnB;AAAA,gDAAC,8BAAY,aAAZ,EAAwB,IAAG,UACzB,iBACH;AAAA,IACA,6CAAC,0BACA;AAAA,kDAAC,8BAAS,SAAO,MAChB;AAAA,QAAC,kBAAAC;AAAA,QAAA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA,cAAe;AAAA,UACf,KAAM;AAAA,UACN;AAAA,UACA,qBAAmB;AAAA;AAAA,MACpB,GACD;AAAA,MACA,4CAAC,8BAAS,SAAO,MAChB,sDAAC,kBAAAC,sBAAA,EAAO,SAAU,GAAI,cAAe,GACpC;AAAA,QAAC;AAAA;AAAA,UACA,OAAQ;AAAA,UACR,KAAM;AAAA,UACN,KACC,8BAA+B,YAAa,GACzC,OAAO;AAAA,UAEX,MACC,8BAA+B,YAAa,GACzC,QAAQ;AAAA,UAEZ,gBAAiB;AAAA,UACjB,UAAW;AAAA,UACX;AAAA,UACA,qBAAmB;AAAA;AAAA,MACpB,GACD,GACD;AAAA,OACD;AAAA,KACD;AAEF;",
6
6
  "names": ["deprecated", "useCustomUnits", "parseQuantityAndUnitFromRawValue", "UnitControl", "Spacer"]
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/html-element-control/index.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tSelectControl,\n\tNotice,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\nimport { htmlElementMessages } from './messages';\n\n/**\n * Renders a SelectControl for choosing HTML elements with validation\n * to prevent duplicate <main> elements.\n *\n * @param {Object} props Component props.\n * @param {string} props.tagName The current HTML tag name.\n * @param {Function} props.onChange Function to call when the tag is changed.\n * @param {string} props.clientId Optional. The client ID of the block. Used to check for existing <main> elements.\n * @param {Array} props.options SelectControl options (optional).\n *\n * @return {Component} The HTML element select control with validation.\n */\nexport default function HTMLElementControl( {\n\ttagName,\n\tonChange,\n\tclientId,\n\toptions = [\n\t\t{ label: __( 'Default (<div>)' ), value: 'div' },\n\t\t{ label: '<header>', value: 'header' },\n\t\t{ label: '<main>', value: 'main' },\n\t\t{ label: '<section>', value: 'section' },\n\t\t{ label: '<article>', value: 'article' },\n\t\t{ label: '<aside>', value: 'aside' },\n\t\t{ label: '<footer>', value: 'footer' },\n\t],\n} ) {\n\tconst checkForMainTag =\n\t\t!! clientId && options.some( ( option ) => option.value === 'main' );\n\n\tconst hasMainElementElsewhere = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! checkForMainTag ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tconst { getClientIdsWithDescendants, getBlockAttributes } =\n\t\t\t\tselect( blockEditorStore );\n\n\t\t\treturn getClientIdsWithDescendants().some( ( id ) => {\n\t\t\t\t// Skip the current block.\n\t\t\t\tif ( id === clientId ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\treturn getBlockAttributes( id )?.tagName === 'main';\n\t\t\t} );\n\t\t},\n\t\t[ clientId, checkForMainTag ]\n\t);\n\n\t// Create a modified options array that disables the main option if needed.\n\tconst modifiedOptions = options.map( ( option ) => {\n\t\tif (\n\t\t\toption.value === 'main' &&\n\t\t\thasMainElementElsewhere &&\n\t\t\ttagName !== 'main'\n\t\t) {\n\t\t\treturn {\n\t\t\t\t...option,\n\t\t\t\tdisabled: true,\n\t\t\t\tlabel: sprintf(\n\t\t\t\t\t/* translators: %s: HTML element name */\n\t\t\t\t\t__( '%s (Already in use)' ),\n\t\t\t\t\toption.label\n\t\t\t\t),\n\t\t\t};\n\t\t}\n\t\treturn option;\n\t} );\n\n\treturn (\n\t\t<VStack spacing={ 2 } className=\"block-editor-html-element-control\">\n\t\t\t<SelectControl\n\t\t\t\tlabel={ __( 'HTML element' ) }\n\t\t\t\toptions={ modifiedOptions }\n\t\t\t\tvalue={ tagName }\n\t\t\t\tonChange={ onChange }\n\t\t\t\thelp={ htmlElementMessages[ tagName ] }\n\t\t\t/>\n\n\t\t\t{ tagName === 'main' && hasMainElementElsewhere && (\n\t\t\t\t<Notice status=\"warning\" isDismissible={ false }>\n\t\t\t\t\t{ __(\n\t\t\t\t\t\t'Multiple <main> elements detected. The duplicate may be in your content or template. This is not valid HTML and may cause accessibility issues. Please change this HTML element.'\n\t\t\t\t\t) }\n\t\t\t\t</Notice>\n\t\t\t) }\n\t\t</VStack>\n\t);\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAA4B;AAC5B,wBAIO;AACP,kBAA0B;AAK1B,mBAA0C;AAC1C,sBAAoC;AAyElC;AA3Da,SAAR,mBAAqC;AAAA,EAC3C;AAAA,EACA;AAAA,EACA;AAAA,EACA,UAAU;AAAA,IACT,EAAE,WAAO,gBAAI,iBAAkB,GAAG,OAAO,MAAM;AAAA,IAC/C,EAAE,OAAO,YAAY,OAAO,SAAS;AAAA,IACrC,EAAE,OAAO,UAAU,OAAO,OAAO;AAAA,IACjC,EAAE,OAAO,aAAa,OAAO,UAAU;AAAA,IACvC,EAAE,OAAO,aAAa,OAAO,UAAU;AAAA,IACvC,EAAE,OAAO,WAAW,OAAO,QAAQ;AAAA,IACnC,EAAE,OAAO,YAAY,OAAO,SAAS;AAAA,EACtC;AACD,GAAI;AACH,QAAM,kBACL,CAAC,CAAE,YAAY,QAAQ,KAAM,CAAE,WAAY,OAAO,UAAU,MAAO;AAEpE,QAAM,8BAA0B;AAAA,IAC/B,CAAE,WAAY;AACb,UAAK,CAAE,iBAAkB;AACxB,eAAO;AAAA,MACR;AAEA,YAAM,EAAE,6BAA6B,mBAAmB,IACvD,OAAQ,aAAAA,KAAiB;AAE1B,aAAO,4BAA4B,EAAE,KAAM,CAAE,OAAQ;AAEpD,YAAK,OAAO,UAAW;AACtB,iBAAO;AAAA,QACR;AAEA,eAAO,mBAAoB,EAAG,GAAG,YAAY;AAAA,MAC9C,CAAE;AAAA,IACH;AAAA,IACA,CAAE,UAAU,eAAgB;AAAA,EAC7B;AAGA,QAAM,kBAAkB,QAAQ,IAAK,CAAE,WAAY;AAClD,QACC,OAAO,UAAU,UACjB,2BACA,YAAY,QACX;AACD,aAAO;AAAA,QACN,GAAG;AAAA,QACH,UAAU;AAAA,QACV,WAAO;AAAA;AAAA,cAEN,gBAAI,qBAAsB;AAAA,UAC1B,OAAO;AAAA,QACR;AAAA,MACD;AAAA,IACD;AACA,WAAO;AAAA,EACR,CAAE;AAEF,SACC,6CAAC,kBAAAC,sBAAA,EAAO,SAAU,GAAI,WAAU,qCAC/B;AAAA;AAAA,MAAC;AAAA;AAAA,QACA,WAAQ,gBAAI,cAAe;AAAA,QAC3B,SAAU;AAAA,QACV,OAAQ;AAAA,QACR;AAAA,QACA,MAAO,oCAAqB,OAAQ;AAAA;AAAA,IACrC;AAAA,IAEE,YAAY,UAAU,2BACvB,4CAAC,4BAAO,QAAO,WAAU,eAAgB,OACtC;AAAA,MACD;AAAA,IACD,GACD;AAAA,KAEF;AAEF;",
4
+ "sourcesContent": ["import { __, sprintf } from '@wordpress/i18n';\nimport {\n\tSelectControl,\n\tNotice,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { store as blockEditorStore } from '../../store';\nimport { htmlElementMessages } from './messages';\n\n/**\n * Renders a SelectControl for choosing HTML elements with validation\n * to prevent duplicate <main> elements.\n *\n * @param {Object} props Component props.\n * @param {string} props.tagName The current HTML tag name.\n * @param {Function} props.onChange Function to call when the tag is changed.\n * @param {string} props.clientId Optional. The client ID of the block. Used to check for existing <main> elements.\n * @param {Array} props.options SelectControl options (optional).\n *\n * @return {Component} The HTML element select control with validation.\n */\nexport default function HTMLElementControl( {\n\ttagName,\n\tonChange,\n\tclientId,\n\toptions = [\n\t\t{ label: __( 'Default (<div>)' ), value: 'div' },\n\t\t{ label: '<header>', value: 'header' },\n\t\t{ label: '<main>', value: 'main' },\n\t\t{ label: '<section>', value: 'section' },\n\t\t{ label: '<article>', value: 'article' },\n\t\t{ label: '<aside>', value: 'aside' },\n\t\t{ label: '<footer>', value: 'footer' },\n\t],\n} ) {\n\tconst checkForMainTag =\n\t\t!! clientId && options.some( ( option ) => option.value === 'main' );\n\n\tconst hasMainElementElsewhere = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! checkForMainTag ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tconst { getClientIdsWithDescendants, getBlockAttributes } =\n\t\t\t\tselect( blockEditorStore );\n\n\t\t\treturn getClientIdsWithDescendants().some( ( id ) => {\n\t\t\t\t// Skip the current block.\n\t\t\t\tif ( id === clientId ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\treturn getBlockAttributes( id )?.tagName === 'main';\n\t\t\t} );\n\t\t},\n\t\t[ clientId, checkForMainTag ]\n\t);\n\n\t// Create a modified options array that disables the main option if needed.\n\tconst modifiedOptions = options.map( ( option ) => {\n\t\tif (\n\t\t\toption.value === 'main' &&\n\t\t\thasMainElementElsewhere &&\n\t\t\ttagName !== 'main'\n\t\t) {\n\t\t\treturn {\n\t\t\t\t...option,\n\t\t\t\tdisabled: true,\n\t\t\t\tlabel: sprintf(\n\t\t\t\t\t/* translators: %s: HTML element name */\n\t\t\t\t\t__( '%s (Already in use)' ),\n\t\t\t\t\toption.label\n\t\t\t\t),\n\t\t\t};\n\t\t}\n\t\treturn option;\n\t} );\n\n\treturn (\n\t\t<VStack spacing={ 2 } className=\"block-editor-html-element-control\">\n\t\t\t<SelectControl\n\t\t\t\tlabel={ __( 'HTML element' ) }\n\t\t\t\toptions={ modifiedOptions }\n\t\t\t\tvalue={ tagName }\n\t\t\t\tonChange={ onChange }\n\t\t\t\thelp={ htmlElementMessages[ tagName ] }\n\t\t\t/>\n\n\t\t\t{ tagName === 'main' && hasMainElementElsewhere && (\n\t\t\t\t<Notice status=\"warning\" isDismissible={ false }>\n\t\t\t\t\t{ __(\n\t\t\t\t\t\t'Multiple <main> elements detected. The duplicate may be in your content or template. This is not valid HTML and may cause accessibility issues. Please change this HTML element.'\n\t\t\t\t\t) }\n\t\t\t\t</Notice>\n\t\t\t) }\n\t\t</VStack>\n\t);\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAA4B;AAC5B,wBAIO;AACP,kBAA0B;AAC1B,mBAA0C;AAC1C,sBAAoC;AAyElC;AA3Da,SAAR,mBAAqC;AAAA,EAC3C;AAAA,EACA;AAAA,EACA;AAAA,EACA,UAAU;AAAA,IACT,EAAE,WAAO,gBAAI,iBAAkB,GAAG,OAAO,MAAM;AAAA,IAC/C,EAAE,OAAO,YAAY,OAAO,SAAS;AAAA,IACrC,EAAE,OAAO,UAAU,OAAO,OAAO;AAAA,IACjC,EAAE,OAAO,aAAa,OAAO,UAAU;AAAA,IACvC,EAAE,OAAO,aAAa,OAAO,UAAU;AAAA,IACvC,EAAE,OAAO,WAAW,OAAO,QAAQ;AAAA,IACnC,EAAE,OAAO,YAAY,OAAO,SAAS;AAAA,EACtC;AACD,GAAI;AACH,QAAM,kBACL,CAAC,CAAE,YAAY,QAAQ,KAAM,CAAE,WAAY,OAAO,UAAU,MAAO;AAEpE,QAAM,8BAA0B;AAAA,IAC/B,CAAE,WAAY;AACb,UAAK,CAAE,iBAAkB;AACxB,eAAO;AAAA,MACR;AAEA,YAAM,EAAE,6BAA6B,mBAAmB,IACvD,OAAQ,aAAAA,KAAiB;AAE1B,aAAO,4BAA4B,EAAE,KAAM,CAAE,OAAQ;AAEpD,YAAK,OAAO,UAAW;AACtB,iBAAO;AAAA,QACR;AAEA,eAAO,mBAAoB,EAAG,GAAG,YAAY;AAAA,MAC9C,CAAE;AAAA,IACH;AAAA,IACA,CAAE,UAAU,eAAgB;AAAA,EAC7B;AAGA,QAAM,kBAAkB,QAAQ,IAAK,CAAE,WAAY;AAClD,QACC,OAAO,UAAU,UACjB,2BACA,YAAY,QACX;AACD,aAAO;AAAA,QACN,GAAG;AAAA,QACH,UAAU;AAAA,QACV,WAAO;AAAA;AAAA,cAEN,gBAAI,qBAAsB;AAAA,UAC1B,OAAO;AAAA,QACR;AAAA,MACD;AAAA,IACD;AACA,WAAO;AAAA,EACR,CAAE;AAEF,SACC,6CAAC,kBAAAC,sBAAA,EAAO,SAAU,GAAI,WAAU,qCAC/B;AAAA;AAAA,MAAC;AAAA;AAAA,QACA,WAAQ,gBAAI,cAAe;AAAA,QAC3B,SAAU;AAAA,QACV,OAAQ;AAAA,QACR;AAAA,QACA,MAAO,oCAAqB,OAAQ;AAAA;AAAA,IACrC;AAAA,IAEE,YAAY,UAAU,2BACvB,4CAAC,4BAAO,QAAO,WAAU,eAAgB,OACtC;AAAA,MACD;AAAA,IACD,GACD;AAAA,KAEF;AAEF;",
6
6
  "names": ["blockEditorStore", "VStack"]
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/html-element-control/messages.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Messages providing helpful descriptions for HTML elements.\n */\nexport const htmlElementMessages = {\n\ta: __(\n\t\t'The <a> element should be used for links that navigate to a different page or to a different section within the same page.'\n\t),\n\tarticle: __(\n\t\t'The <article> element should represent a self-contained, syndicatable portion of the document.'\n\t),\n\taside: __(\n\t\t\"The <aside> element should represent a portion of a document whose content is only indirectly related to the document's main content.\"\n\t),\n\tbutton: __(\n\t\t'The <button> element should be used for interactive controls that perform an action on the current page, such as opening a modal or toggling content visibility.'\n\t),\n\tdiv: __(\n\t\t'The <div> element should only be used if the block is a design element with no semantic meaning.'\n\t),\n\tfooter: __(\n\t\t'The <footer> element should represent a footer for its nearest sectioning element (e.g.: <section>, <article>, <main> etc.).'\n\t),\n\theader: __(\n\t\t'The <header> element should represent introductory content, typically a group of introductory or navigational aids.'\n\t),\n\tmain: __(\n\t\t'The <main> element should be used for the primary content of your document only.'\n\t),\n\tnav: __(\n\t\t'The <nav> element should be used to identify groups of links that are intended to be used for website or page content navigation.'\n\t),\n\tsection: __(\n\t\t\"The <section> element should represent a standalone portion of the document that can't be better represented by another element.\"\n\t),\n};\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAmB;AAKZ,IAAM,sBAAsB;AAAA,EAClC,OAAG;AAAA,IACF;AAAA,EACD;AAAA,EACA,aAAS;AAAA,IACR;AAAA,EACD;AAAA,EACA,WAAO;AAAA,IACN;AAAA,EACD;AAAA,EACA,YAAQ;AAAA,IACP;AAAA,EACD;AAAA,EACA,SAAK;AAAA,IACJ;AAAA,EACD;AAAA,EACA,YAAQ;AAAA,IACP;AAAA,EACD;AAAA,EACA,YAAQ;AAAA,IACP;AAAA,EACD;AAAA,EACA,UAAM;AAAA,IACL;AAAA,EACD;AAAA,EACA,SAAK;AAAA,IACJ;AAAA,EACD;AAAA,EACA,aAAS;AAAA,IACR;AAAA,EACD;AACD;",
4
+ "sourcesContent": ["import { __ } from '@wordpress/i18n';\n\n/**\n * Messages providing helpful descriptions for HTML elements.\n */\nexport const htmlElementMessages = {\n\ta: __(\n\t\t'The <a> element should be used for links that navigate to a different page or to a different section within the same page.'\n\t),\n\tarticle: __(\n\t\t'The <article> element should represent a self-contained, syndicatable portion of the document.'\n\t),\n\taside: __(\n\t\t\"The <aside> element should represent a portion of a document whose content is only indirectly related to the document's main content.\"\n\t),\n\tbutton: __(\n\t\t'The <button> element should be used for interactive controls that perform an action on the current page, such as opening a modal or toggling content visibility.'\n\t),\n\tdiv: __(\n\t\t'The <div> element should only be used if the block is a design element with no semantic meaning.'\n\t),\n\tfooter: __(\n\t\t'The <footer> element should represent a footer for its nearest sectioning element (e.g.: <section>, <article>, <main> etc.).'\n\t),\n\theader: __(\n\t\t'The <header> element should represent introductory content, typically a group of introductory or navigational aids.'\n\t),\n\tmain: __(\n\t\t'The <main> element should be used for the primary content of your document only.'\n\t),\n\tnav: __(\n\t\t'The <nav> element should be used to identify groups of links that are intended to be used for website or page content navigation.'\n\t),\n\tsection: __(\n\t\t\"The <section> element should represent a standalone portion of the document that can't be better represented by another element.\"\n\t),\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAmB;AAKZ,IAAM,sBAAsB;AAAA,EAClC,OAAG;AAAA,IACF;AAAA,EACD;AAAA,EACA,aAAS;AAAA,IACR;AAAA,EACD;AAAA,EACA,WAAO;AAAA,IACN;AAAA,EACD;AAAA,EACA,YAAQ;AAAA,IACP;AAAA,EACD;AAAA,EACA,SAAK;AAAA,IACJ;AAAA,EACD;AAAA,EACA,YAAQ;AAAA,IACP;AAAA,EACD;AAAA,EACA,YAAQ;AAAA,IACP;AAAA,EACD;AAAA,EACA,UAAM;AAAA,IACL;AAAA,EACD;AAAA,EACA,SAAK;AAAA,IACJ;AAAA,EACD;AAAA,EACA,aAAS;AAAA,IACR;AAAA,EACD;AACD;",
6
6
  "names": []
7
7
  }
@@ -218,8 +218,8 @@ function Iframe({
218
218
  };
219
219
  }, []);
220
220
  const {
221
- contentResizeListener,
222
- containerResizeListener,
221
+ contentRef: scaleContentRef,
222
+ containerRef,
223
223
  isZoomedOut,
224
224
  scaleContainerWidth
225
225
  } = (0, import_use_scale_canvas.useScaleCanvas)({
@@ -232,7 +232,8 @@ function Iframe({
232
232
  useBubbleEvents(iframeDocument),
233
233
  contentRef,
234
234
  writingFlowRef,
235
- disabledRef
235
+ disabledRef,
236
+ scaleContentRef
236
237
  ]);
237
238
  const bodyRef = (0, import_compose.useRefEffect)(
238
239
  (node) => {
@@ -280,7 +281,7 @@ function Iframe({
280
281
  }
281
282
  },
282
283
  children: iframeDocument && (0, import_element.createPortal)(
283
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
284
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
284
285
  "body",
285
286
  {
286
287
  ref: bodyRef,
@@ -289,10 +290,7 @@ function Iframe({
289
290
  "editor-styles-wrapper",
290
291
  ...bodyClasses
291
292
  ),
292
- children: [
293
- contentResizeListener,
294
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.__experimentalStyleProvider, { document: iframeDocument, children })
295
- ]
293
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.__experimentalStyleProvider, { document: iframeDocument, children })
296
294
  }
297
295
  ),
298
296
  iframeDocument.documentElement
@@ -301,22 +299,19 @@ function Iframe({
301
299
  ),
302
300
  shouldRenderFocusCaptureElements && after
303
301
  ] });
304
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "block-editor-iframe__container", children: [
305
- containerResizeListener,
306
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
307
- "div",
308
- {
309
- className: (0, import_clsx.default)(
310
- "block-editor-iframe__scale-container",
311
- isZoomedOut && "is-zoomed-out"
312
- ),
313
- style: {
314
- "--wp-block-editor-iframe-zoom-out-scale-container-width": isZoomedOut && `${scaleContainerWidth}px`
315
- },
316
- children: iframe
317
- }
318
- )
319
- ] });
302
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "block-editor-iframe__container", ref: containerRef, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
303
+ "div",
304
+ {
305
+ className: (0, import_clsx.default)(
306
+ "block-editor-iframe__scale-container",
307
+ isZoomedOut && "is-zoomed-out"
308
+ ),
309
+ style: {
310
+ "--wp-block-editor-iframe-zoom-out-scale-container-width": isZoomedOut && `${scaleContainerWidth}px`
311
+ },
312
+ children: iframe
313
+ }
314
+ ) });
320
315
  }
321
316
  function IframeIfReady(props, ref) {
322
317
  const isInitialised = (0, import_data.useSelect)(
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/iframe/index.js"],
4
- "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\nimport { version as reactVersion } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useState, createPortal, forwardRef } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { useMergeRefs, useRefEffect, useDisabled } from '@wordpress/compose';\nimport { __experimentalStyleProvider as StyleProvider } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { useWritingFlow } from '../writing-flow';\nimport { getCompatibilityStyles } from './get-compatibility-styles';\nimport { useScaleCanvas } from './use-scale-canvas';\nimport { store as blockEditorStore } from '../../store';\n\nfunction bubbleEvent( event, Constructor, frame ) {\n\tconst init = {};\n\n\tfor ( const key in event ) {\n\t\tinit[ key ] = event[ key ];\n\t}\n\n\t// Check if the event is a MouseEvent generated within the iframe.\n\t// If so, adjust the coordinates to be relative to the position of\n\t// the iframe. This ensures that components such as Draggable\n\t// receive coordinates relative to the window, instead of relative\n\t// to the iframe. Without this, the Draggable event handler would\n\t// result in components \"jumping\" position as soon as the user\n\t// drags over the iframe.\n\tif ( event instanceof frame.contentDocument.defaultView.MouseEvent ) {\n\t\tconst rect = frame.getBoundingClientRect();\n\t\tinit.clientX += rect.left;\n\t\tinit.clientY += rect.top;\n\t}\n\n\tconst newEvent = new Constructor( event.type, init );\n\tif ( init.defaultPrevented ) {\n\t\tnewEvent.preventDefault();\n\t}\n\tconst cancelled = ! frame.dispatchEvent( newEvent );\n\n\tif ( cancelled ) {\n\t\tevent.preventDefault();\n\t}\n}\n\n/**\n * Bubbles some event types (keydown, keypress, and dragover) to parent document\n * document to ensure that the keyboard shortcuts and drag and drop work.\n *\n * Ideally, we should remove event bubbling in the future. Keyboard shortcuts\n * should be context dependent, e.g. actions on blocks like Cmd+A should not\n * work globally outside the block editor.\n *\n * @param {Document} iframeDocument Document to attach listeners to.\n */\nfunction useBubbleEvents( iframeDocument ) {\n\treturn useRefEffect( () => {\n\t\tconst { defaultView } = iframeDocument;\n\t\tif ( ! defaultView ) {\n\t\t\treturn;\n\t\t}\n\t\tconst { frameElement } = defaultView;\n\t\tconst html = iframeDocument.documentElement;\n\t\tconst eventTypes = [ 'dragover', 'mousemove' ];\n\t\tconst handlers = {};\n\t\tfor ( const name of eventTypes ) {\n\t\t\thandlers[ name ] = ( event ) => {\n\t\t\t\tconst prototype = Object.getPrototypeOf( event );\n\t\t\t\tconst constructorName = prototype.constructor.name;\n\t\t\t\tconst Constructor = window[ constructorName ];\n\t\t\t\tbubbleEvent( event, Constructor, frameElement );\n\t\t\t};\n\t\t\thtml.addEventListener( name, handlers[ name ] );\n\t\t}\n\n\t\treturn () => {\n\t\t\tfor ( const name of eventTypes ) {\n\t\t\t\thtml.removeEventListener( name, handlers[ name ] );\n\t\t\t}\n\t\t};\n\t} );\n}\n\nconst iframeSrcCache = new WeakMap();\nconst iframeSrcCleanup = globalThis.FinalizationRegistry\n\t? new globalThis.FinalizationRegistry( ( url ) =>\n\t\t\tURL.revokeObjectURL( url )\n\t )\n\t: undefined;\n\nfunction getIframeSrc( resolvedAssets ) {\n\tlet src = iframeSrcCache.get( resolvedAssets );\n\tif ( src ) {\n\t\treturn src;\n\t}\n\n\tlet body = '';\n\tif ( reactVersion.split( '.' )[ 0 ] === '18' ) {\n\t\tbody =\n\t\t\t'<body><script>document.currentScript.parentElement.remove()</script></body>';\n\t}\n\n\t// Correct doctype is required to enable rendering in standards mode.\n\t// Also preload the styles to avoid a flash of unstyled content.\n\tconst html = `<!doctype html>\n<html>\n\t<head>\n\t\t<meta charset=\"utf-8\">\n\t\t<base href=\"${ window.location.href }\">\n\t\t<style>\n\t\t\thtml{\n\t\t\t\theight: auto !important;\n\t\t\t\tmin-height: 100%;\n\t\t\t}\n\t\t\t/* Lowest specificity to not override global styles */\n\t\t\t:where(body) {\n\t\t\t\tmargin: 0;\n\t\t\t\t/* Default background color in case zoom out mode background\n\t\t\t\tcolors the html element */\n\t\t\t\tbackground-color: white;\n\t\t\t}\n\t\t</style>\n\t\t${ resolvedAssets.styles ?? '' }\n\t\t${ resolvedAssets.scripts ?? '' }\n\t</head>\n\t${ body }\n</html>`;\n\n\tsrc = URL.createObjectURL( new Blob( [ html ], { type: 'text/html' } ) );\n\tiframeSrcCache.set( resolvedAssets, src );\n\tiframeSrcCleanup?.register( resolvedAssets, src );\n\treturn src;\n}\n\nfunction Iframe( {\n\tcontentRef,\n\tchildren,\n\ttabIndex = 0,\n\tscale = 1,\n\tframeSize = 0,\n\treadonly,\n\tforwardedRef: ref,\n\ttitle = __( 'Editor canvas' ),\n\t...props\n} ) {\n\tconst { resolvedAssets, isPreviewMode } = useSelect( ( select ) => {\n\t\tconst settings = select( blockEditorStore ).getSettings();\n\t\treturn {\n\t\t\tresolvedAssets: settings.__unstableResolvedAssets,\n\t\t\tisPreviewMode: settings.isPreviewMode,\n\t\t};\n\t}, [] );\n\t/** @type {[Document, React.Dispatch<Document>]} */\n\tconst [ iframeDocument, setIframeDocument ] = useState();\n\tconst [ bodyClasses, setBodyClasses ] = useState( [] );\n\tconst [ before, writingFlowRef, after ] = useWritingFlow();\n\n\tconst setRef = useRefEffect( ( node ) => {\n\t\tlet iFrameDocument;\n\t\t// Prevent the default browser action for files dropped outside of dropzones.\n\t\tfunction preventFileDropDefault( event ) {\n\t\t\tevent.preventDefault();\n\t\t}\n\t\t// Prevent clicks on link fragments from navigating away. Note that links\n\t\t// inside `contenteditable` are already disabled by the browser, so\n\t\t// this is for links in blocks outside of `contenteditable`.\n\t\tfunction interceptLinkClicks( event ) {\n\t\t\tif (\n\t\t\t\tevent.target.tagName === 'A' &&\n\t\t\t\tevent.target.getAttribute( 'href' )?.startsWith( '#' )\n\t\t\t) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\t// Manually handle link fragment navigation within the iframe. The iframe's\n\t\t\t\t// location is a blob URL, which can't be used to resolve relative links like\n\t\t\t\t// `#hash`. The relative link would be resolved against the iframe's base URL\n\t\t\t\t// or the parent frame's URL, causing the iframe to navigate to a completely\n\t\t\t\t// different page. Setting the `location.hash` works because it really sets the\n\t\t\t\t// blob URL's hash.\n\t\t\t\t//\n\t\t\t\t// Links with fragments are used for example with footnotes. Clicking on these\n\t\t\t\t// links will scroll smoothly to the anchors in the editor canvas.\n\t\t\t\tiFrameDocument.defaultView.location.hash = event.target\n\t\t\t\t\t.getAttribute( 'href' )\n\t\t\t\t\t.slice( 1 );\n\t\t\t}\n\t\t}\n\n\t\tconst { ownerDocument } = node;\n\n\t\t// Ideally ALL classes that are added through get_body_class should\n\t\t// be added in the editor too, which we'll somehow have to get from\n\t\t// the server in the future (which will run the PHP filters).\n\t\tsetBodyClasses(\n\t\t\tArray.from( ownerDocument.body.classList ).filter(\n\t\t\t\t( name ) =>\n\t\t\t\t\tname.startsWith( 'admin-color-' ) ||\n\t\t\t\t\tname.startsWith( 'post-type-' ) ||\n\t\t\t\t\tname === 'wp-embed-responsive'\n\t\t\t)\n\t\t);\n\n\t\tfunction onLoad() {\n\t\t\tconst { contentDocument } = node;\n\t\t\tconst { documentElement } = contentDocument;\n\t\t\tiFrameDocument = contentDocument;\n\t\t\tsetIframeDocument( contentDocument );\n\n\t\t\tdocumentElement.classList.add( 'block-editor-iframe__html' );\n\n\t\t\tcontentDocument.dir = ownerDocument.dir;\n\n\t\t\tfor ( const compatStyle of getCompatibilityStyles() ) {\n\t\t\t\tif ( contentDocument.getElementById( compatStyle.id ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tcontentDocument.head.appendChild(\n\t\t\t\t\tcompatStyle.cloneNode( true )\n\t\t\t\t);\n\n\t\t\t\tif ( ! isPreviewMode ) {\n\t\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\t`${ compatStyle.id } was added to the iframe incorrectly. Please use block.json or enqueue_block_assets to add styles to the iframe.`,\n\t\t\t\t\t\tcompatStyle\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tiFrameDocument.addEventListener(\n\t\t\t\t'dragover',\n\t\t\t\tpreventFileDropDefault,\n\t\t\t\tfalse\n\t\t\t);\n\t\t\tiFrameDocument.addEventListener(\n\t\t\t\t'drop',\n\t\t\t\tpreventFileDropDefault,\n\t\t\t\tfalse\n\t\t\t);\n\t\t\tiFrameDocument.addEventListener( 'click', interceptLinkClicks );\n\t\t}\n\n\t\tnode.addEventListener( 'load', onLoad );\n\n\t\treturn () => {\n\t\t\tsetIframeDocument( undefined );\n\t\t\tnode.removeEventListener( 'load', onLoad );\n\t\t\tiFrameDocument?.removeEventListener(\n\t\t\t\t'dragover',\n\t\t\t\tpreventFileDropDefault\n\t\t\t);\n\t\t\tiFrameDocument?.removeEventListener(\n\t\t\t\t'drop',\n\t\t\t\tpreventFileDropDefault\n\t\t\t);\n\t\t\tiFrameDocument?.removeEventListener( 'click', interceptLinkClicks );\n\t\t};\n\t}, [] );\n\n\tconst {\n\t\tcontentResizeListener,\n\t\tcontainerResizeListener,\n\t\tisZoomedOut,\n\t\tscaleContainerWidth,\n\t} = useScaleCanvas( {\n\t\tscale,\n\t\tframeSize: parseInt( frameSize ),\n\t\tiframeDocument,\n\t} );\n\n\tconst disabledRef = useDisabled( { isDisabled: ! readonly } );\n\n\tconst unguardedBodyRef = useMergeRefs( [\n\t\tuseBubbleEvents( iframeDocument ),\n\t\tcontentRef,\n\t\twritingFlowRef,\n\t\tdisabledRef,\n\t] );\n\n\t// Attach the body ref only when the iframe document and window are available.\n\t// When an iframe element is moved in the DOM, like when reordering a list,\n\t// its `window` object is destroyed and recreated, and the `defaultView` field is\n\t// briefly `null`. We need to guard for such calls of the ref callbacks.\n\tconst bodyRef = useRefEffect(\n\t\t( node ) => {\n\t\t\tif ( node.ownerDocument.defaultView ) {\n\t\t\t\tunguardedBodyRef( node );\n\t\t\t\treturn () => unguardedBodyRef( null );\n\t\t\t}\n\t\t\treturn () => {};\n\t\t},\n\t\t[ unguardedBodyRef ]\n\t);\n\n\tconst src = getIframeSrc( resolvedAssets );\n\n\t// Make sure to not render the before and after focusable div elements in view\n\t// mode. They're only needed to capture focus in edit mode.\n\tconst shouldRenderFocusCaptureElements = tabIndex >= 0 && ! isPreviewMode;\n\n\tconst iframe = (\n\t\t<>\n\t\t\t{ shouldRenderFocusCaptureElements && before }\n\t\t\t{ /* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */ }\n\t\t\t<iframe\n\t\t\t\t{ ...props }\n\t\t\t\tstyle={ {\n\t\t\t\t\t...props.style,\n\t\t\t\t\theight: props.style?.height,\n\t\t\t\t\tborder: 0,\n\t\t\t\t} }\n\t\t\t\tref={ useMergeRefs( [ ref, setRef ] ) }\n\t\t\t\ttabIndex={ tabIndex }\n\t\t\t\tsrc={ src }\n\t\t\t\ttitle={ title }\n\t\t\t\tonKeyDown={ ( event ) => {\n\t\t\t\t\tif ( props.onKeyDown ) {\n\t\t\t\t\t\tprops.onKeyDown( event );\n\t\t\t\t\t}\n\t\t\t\t\t// If the event originates from inside the iframe, it means\n\t\t\t\t\t// it bubbled through the portal, but only with React\n\t\t\t\t\t// events. We need to to bubble native events as well,\n\t\t\t\t\t// though by doing so we also trigger another React event,\n\t\t\t\t\t// so we need to stop the propagation of this event to avoid\n\t\t\t\t\t// duplication.\n\t\t\t\t\tif (\n\t\t\t\t\t\tevent.currentTarget.ownerDocument !==\n\t\t\t\t\t\tevent.target.ownerDocument\n\t\t\t\t\t) {\n\t\t\t\t\t\t// We should only stop propagation of the React event,\n\t\t\t\t\t\t// the native event should further bubble inside the\n\t\t\t\t\t\t// iframe to the document and window.\n\t\t\t\t\t\t// Alternatively, we could consider redispatching the\n\t\t\t\t\t\t// native event in the iframe.\n\t\t\t\t\t\tconst { stopPropagation } = event.nativeEvent;\n\t\t\t\t\t\tevent.nativeEvent.stopPropagation = () => {};\n\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\tevent.nativeEvent.stopPropagation = stopPropagation;\n\t\t\t\t\t\tbubbleEvent(\n\t\t\t\t\t\t\tevent,\n\t\t\t\t\t\t\twindow.KeyboardEvent,\n\t\t\t\t\t\t\tevent.currentTarget\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ iframeDocument &&\n\t\t\t\t\tcreatePortal(\n\t\t\t\t\t\t<body\n\t\t\t\t\t\t\tref={ bodyRef }\n\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t'block-editor-iframe__body',\n\t\t\t\t\t\t\t\t'editor-styles-wrapper',\n\t\t\t\t\t\t\t\t...bodyClasses\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ contentResizeListener }\n\t\t\t\t\t\t\t<StyleProvider document={ iframeDocument }>\n\t\t\t\t\t\t\t\t{ children }\n\t\t\t\t\t\t\t</StyleProvider>\n\t\t\t\t\t\t</body>,\n\t\t\t\t\t\tiframeDocument.documentElement\n\t\t\t\t\t) }\n\t\t\t</iframe>\n\t\t\t{ shouldRenderFocusCaptureElements && after }\n\t\t</>\n\t);\n\n\treturn (\n\t\t<div className=\"block-editor-iframe__container\">\n\t\t\t{ containerResizeListener }\n\t\t\t<div\n\t\t\t\tclassName={ clsx(\n\t\t\t\t\t'block-editor-iframe__scale-container',\n\t\t\t\t\tisZoomedOut && 'is-zoomed-out'\n\t\t\t\t) }\n\t\t\t\tstyle={ {\n\t\t\t\t\t'--wp-block-editor-iframe-zoom-out-scale-container-width':\n\t\t\t\t\t\tisZoomedOut && `${ scaleContainerWidth }px`,\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ iframe }\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\nfunction IframeIfReady( props, ref ) {\n\tconst isInitialised = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).getSettings().__internalIsInitialized,\n\t\t[]\n\t);\n\n\t// We shouldn't render the iframe until the editor settings are initialised.\n\t// The initial settings are needed to get the styles for the srcDoc, which\n\t// cannot be changed after the iframe is mounted. srcDoc is used to to set\n\t// the initial iframe HTML, which is required to avoid a flash of unstyled\n\t// content.\n\tif ( ! isInitialised ) {\n\t\treturn null;\n\t}\n\n\treturn <Iframe { ...props } forwardedRef={ ref } />;\n}\n\nexport default forwardRef( IframeIfReady );\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAiB;AACjB,mBAAwC;AAKxC,qBAAmD;AACnD,kBAAmB;AACnB,qBAAwD;AACxD,wBAA6D;AAC7D,kBAA0B;AAK1B,0BAA+B;AAC/B,sCAAuC;AACvC,8BAA+B;AAC/B,mBAA0C;AAiSxC;AA/RF,SAAS,YAAa,OAAO,aAAa,OAAQ;AACjD,QAAM,OAAO,CAAC;AAEd,aAAY,OAAO,OAAQ;AAC1B,SAAM,GAAI,IAAI,MAAO,GAAI;AAAA,EAC1B;AASA,MAAK,iBAAiB,MAAM,gBAAgB,YAAY,YAAa;AACpE,UAAM,OAAO,MAAM,sBAAsB;AACzC,SAAK,WAAW,KAAK;AACrB,SAAK,WAAW,KAAK;AAAA,EACtB;AAEA,QAAM,WAAW,IAAI,YAAa,MAAM,MAAM,IAAK;AACnD,MAAK,KAAK,kBAAmB;AAC5B,aAAS,eAAe;AAAA,EACzB;AACA,QAAM,YAAY,CAAE,MAAM,cAA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AAAA;AAAA,IACF;AAAA,IACE,oCAAoC;AAAA,KACvC;AAGD,SACC,6CAAC,SAAI,WAAU,kCACZ;AAAA;AAAA,IACF;AAAA,MAAC;AAAA;AAAA,QACA,eAAY,YAAAD;AAAA,UACX;AAAA,UACA,eAAe;AAAA,QAChB;AAAA,QACA,OAAQ;AAAA,UACP,2DACC,eAAe,GAAI,mBAAoB;AAAA,QACzC;AAAA,QAEE;AAAA;AAAA,IACH;AAAA,KACD;AAEF;AAEA,SAAS,cAAe,OAAO,KAAM;AACpC,QAAM,oBAAgB;AAAA,IACrB,CAAE,WACD,OAAQ,aAAAD,KAAiB,EAAE,YAAY,EAAE;AAAA,IAC1C,CAAC;AAAA,EACF;AAOA,MAAK,CAAE,eAAgB;AACtB,WAAO;AAAA,EACR;AAEA,SAAO,4CAAC,UAAS,GAAG,OAAQ,cAAe,KAAM;AAClD;AAEA,IAAO,qBAAQ,2BAAY,aAAc;",
4
+ "sourcesContent": ["import clsx from 'clsx';\nimport { version as reactVersion } from 'react';\nimport { useState, createPortal, forwardRef } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { useMergeRefs, useRefEffect, useDisabled } from '@wordpress/compose';\nimport { __experimentalStyleProvider as StyleProvider } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { useWritingFlow } from '../writing-flow';\nimport { getCompatibilityStyles } from './get-compatibility-styles';\nimport { useScaleCanvas } from './use-scale-canvas';\nimport { store as blockEditorStore } from '../../store';\n\nfunction bubbleEvent( event, Constructor, frame ) {\n\tconst init = {};\n\n\tfor ( const key in event ) {\n\t\tinit[ key ] = event[ key ];\n\t}\n\n\t// Check if the event is a MouseEvent generated within the iframe.\n\t// If so, adjust the coordinates to be relative to the position of\n\t// the iframe. This ensures that components such as Draggable\n\t// receive coordinates relative to the window, instead of relative\n\t// to the iframe. Without this, the Draggable event handler would\n\t// result in components \"jumping\" position as soon as the user\n\t// drags over the iframe.\n\tif ( event instanceof frame.contentDocument.defaultView.MouseEvent ) {\n\t\tconst rect = frame.getBoundingClientRect();\n\t\tinit.clientX += rect.left;\n\t\tinit.clientY += rect.top;\n\t}\n\n\tconst newEvent = new Constructor( event.type, init );\n\tif ( init.defaultPrevented ) {\n\t\tnewEvent.preventDefault();\n\t}\n\tconst cancelled = ! frame.dispatchEvent( newEvent );\n\n\tif ( cancelled ) {\n\t\tevent.preventDefault();\n\t}\n}\n\n/**\n * Bubbles some event types (keydown, keypress, and dragover) to parent document\n * document to ensure that the keyboard shortcuts and drag and drop work.\n *\n * Ideally, we should remove event bubbling in the future. Keyboard shortcuts\n * should be context dependent, e.g. actions on blocks like Cmd+A should not\n * work globally outside the block editor.\n *\n * @param {Document} iframeDocument Document to attach listeners to.\n */\nfunction useBubbleEvents( iframeDocument ) {\n\treturn useRefEffect( () => {\n\t\tconst { defaultView } = iframeDocument;\n\t\tif ( ! defaultView ) {\n\t\t\treturn;\n\t\t}\n\t\tconst { frameElement } = defaultView;\n\t\tconst html = iframeDocument.documentElement;\n\t\tconst eventTypes = [ 'dragover', 'mousemove' ];\n\t\tconst handlers = {};\n\t\tfor ( const name of eventTypes ) {\n\t\t\thandlers[ name ] = ( event ) => {\n\t\t\t\tconst prototype = Object.getPrototypeOf( event );\n\t\t\t\tconst constructorName = prototype.constructor.name;\n\t\t\t\tconst Constructor = window[ constructorName ];\n\t\t\t\tbubbleEvent( event, Constructor, frameElement );\n\t\t\t};\n\t\t\thtml.addEventListener( name, handlers[ name ] );\n\t\t}\n\n\t\treturn () => {\n\t\t\tfor ( const name of eventTypes ) {\n\t\t\t\thtml.removeEventListener( name, handlers[ name ] );\n\t\t\t}\n\t\t};\n\t} );\n}\n\nconst iframeSrcCache = new WeakMap();\nconst iframeSrcCleanup = globalThis.FinalizationRegistry\n\t? new globalThis.FinalizationRegistry( ( url ) =>\n\t\t\tURL.revokeObjectURL( url )\n\t )\n\t: undefined;\n\nfunction getIframeSrc( resolvedAssets ) {\n\tlet src = iframeSrcCache.get( resolvedAssets );\n\tif ( src ) {\n\t\treturn src;\n\t}\n\n\tlet body = '';\n\tif ( reactVersion.split( '.' )[ 0 ] === '18' ) {\n\t\tbody =\n\t\t\t'<body><script>document.currentScript.parentElement.remove()</script></body>';\n\t}\n\n\t// Correct doctype is required to enable rendering in standards mode.\n\t// Also preload the styles to avoid a flash of unstyled content.\n\tconst html = `<!doctype html>\n<html>\n\t<head>\n\t\t<meta charset=\"utf-8\">\n\t\t<base href=\"${ window.location.href }\">\n\t\t<style>\n\t\t\thtml{\n\t\t\t\theight: auto !important;\n\t\t\t\tmin-height: 100%;\n\t\t\t}\n\t\t\t/* Lowest specificity to not override global styles */\n\t\t\t:where(body) {\n\t\t\t\tmargin: 0;\n\t\t\t\t/* Default background color in case zoom out mode background\n\t\t\t\tcolors the html element */\n\t\t\t\tbackground-color: white;\n\t\t\t}\n\t\t</style>\n\t\t${ resolvedAssets.styles ?? '' }\n\t\t${ resolvedAssets.scripts ?? '' }\n\t</head>\n\t${ body }\n</html>`;\n\n\tsrc = URL.createObjectURL( new Blob( [ html ], { type: 'text/html' } ) );\n\tiframeSrcCache.set( resolvedAssets, src );\n\tiframeSrcCleanup?.register( resolvedAssets, src );\n\treturn src;\n}\n\nfunction Iframe( {\n\tcontentRef,\n\tchildren,\n\ttabIndex = 0,\n\tscale = 1,\n\tframeSize = 0,\n\treadonly,\n\tforwardedRef: ref,\n\ttitle = __( 'Editor canvas' ),\n\t...props\n} ) {\n\tconst { resolvedAssets, isPreviewMode } = useSelect( ( select ) => {\n\t\tconst settings = select( blockEditorStore ).getSettings();\n\t\treturn {\n\t\t\tresolvedAssets: settings.__unstableResolvedAssets,\n\t\t\tisPreviewMode: settings.isPreviewMode,\n\t\t};\n\t}, [] );\n\t/** @type {[Document, React.Dispatch<Document>]} */\n\tconst [ iframeDocument, setIframeDocument ] = useState();\n\tconst [ bodyClasses, setBodyClasses ] = useState( [] );\n\tconst [ before, writingFlowRef, after ] = useWritingFlow();\n\n\tconst setRef = useRefEffect( ( node ) => {\n\t\tlet iFrameDocument;\n\t\t// Prevent the default browser action for files dropped outside of dropzones.\n\t\tfunction preventFileDropDefault( event ) {\n\t\t\tevent.preventDefault();\n\t\t}\n\t\t// Prevent clicks on link fragments from navigating away. Note that links\n\t\t// inside `contenteditable` are already disabled by the browser, so\n\t\t// this is for links in blocks outside of `contenteditable`.\n\t\tfunction interceptLinkClicks( event ) {\n\t\t\tif (\n\t\t\t\tevent.target.tagName === 'A' &&\n\t\t\t\tevent.target.getAttribute( 'href' )?.startsWith( '#' )\n\t\t\t) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\t// Manually handle link fragment navigation within the iframe. The iframe's\n\t\t\t\t// location is a blob URL, which can't be used to resolve relative links like\n\t\t\t\t// `#hash`. The relative link would be resolved against the iframe's base URL\n\t\t\t\t// or the parent frame's URL, causing the iframe to navigate to a completely\n\t\t\t\t// different page. Setting the `location.hash` works because it really sets the\n\t\t\t\t// blob URL's hash.\n\t\t\t\t//\n\t\t\t\t// Links with fragments are used for example with footnotes. Clicking on these\n\t\t\t\t// links will scroll smoothly to the anchors in the editor canvas.\n\t\t\t\tiFrameDocument.defaultView.location.hash = event.target\n\t\t\t\t\t.getAttribute( 'href' )\n\t\t\t\t\t.slice( 1 );\n\t\t\t}\n\t\t}\n\n\t\tconst { ownerDocument } = node;\n\n\t\t// Ideally ALL classes that are added through get_body_class should\n\t\t// be added in the editor too, which we'll somehow have to get from\n\t\t// the server in the future (which will run the PHP filters).\n\t\tsetBodyClasses(\n\t\t\tArray.from( ownerDocument.body.classList ).filter(\n\t\t\t\t( name ) =>\n\t\t\t\t\tname.startsWith( 'admin-color-' ) ||\n\t\t\t\t\tname.startsWith( 'post-type-' ) ||\n\t\t\t\t\tname === 'wp-embed-responsive'\n\t\t\t)\n\t\t);\n\n\t\tfunction onLoad() {\n\t\t\tconst { contentDocument } = node;\n\t\t\tconst { documentElement } = contentDocument;\n\t\t\tiFrameDocument = contentDocument;\n\t\t\tsetIframeDocument( contentDocument );\n\n\t\t\tdocumentElement.classList.add( 'block-editor-iframe__html' );\n\n\t\t\tcontentDocument.dir = ownerDocument.dir;\n\n\t\t\tfor ( const compatStyle of getCompatibilityStyles() ) {\n\t\t\t\tif ( contentDocument.getElementById( compatStyle.id ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tcontentDocument.head.appendChild(\n\t\t\t\t\tcompatStyle.cloneNode( true )\n\t\t\t\t);\n\n\t\t\t\tif ( ! isPreviewMode ) {\n\t\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\t`${ compatStyle.id } was added to the iframe incorrectly. Please use block.json or enqueue_block_assets to add styles to the iframe.`,\n\t\t\t\t\t\tcompatStyle\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tiFrameDocument.addEventListener(\n\t\t\t\t'dragover',\n\t\t\t\tpreventFileDropDefault,\n\t\t\t\tfalse\n\t\t\t);\n\t\t\tiFrameDocument.addEventListener(\n\t\t\t\t'drop',\n\t\t\t\tpreventFileDropDefault,\n\t\t\t\tfalse\n\t\t\t);\n\t\t\tiFrameDocument.addEventListener( 'click', interceptLinkClicks );\n\t\t}\n\n\t\tnode.addEventListener( 'load', onLoad );\n\n\t\treturn () => {\n\t\t\tsetIframeDocument( undefined );\n\t\t\tnode.removeEventListener( 'load', onLoad );\n\t\t\tiFrameDocument?.removeEventListener(\n\t\t\t\t'dragover',\n\t\t\t\tpreventFileDropDefault\n\t\t\t);\n\t\t\tiFrameDocument?.removeEventListener(\n\t\t\t\t'drop',\n\t\t\t\tpreventFileDropDefault\n\t\t\t);\n\t\t\tiFrameDocument?.removeEventListener( 'click', interceptLinkClicks );\n\t\t};\n\t}, [] );\n\n\tconst {\n\t\tcontentRef: scaleContentRef,\n\t\tcontainerRef,\n\t\tisZoomedOut,\n\t\tscaleContainerWidth,\n\t} = useScaleCanvas( {\n\t\tscale,\n\t\tframeSize: parseInt( frameSize ),\n\t\tiframeDocument,\n\t} );\n\n\tconst disabledRef = useDisabled( { isDisabled: ! readonly } );\n\n\tconst unguardedBodyRef = useMergeRefs( [\n\t\tuseBubbleEvents( iframeDocument ),\n\t\tcontentRef,\n\t\twritingFlowRef,\n\t\tdisabledRef,\n\t\tscaleContentRef,\n\t] );\n\n\t// Attach the body ref only when the iframe document and window are available.\n\t// When an iframe element is moved in the DOM, like when reordering a list,\n\t// its `window` object is destroyed and recreated, and the `defaultView` field is\n\t// briefly `null`. We need to guard for such calls of the ref callbacks.\n\tconst bodyRef = useRefEffect(\n\t\t( node ) => {\n\t\t\tif ( node.ownerDocument.defaultView ) {\n\t\t\t\tunguardedBodyRef( node );\n\t\t\t\treturn () => unguardedBodyRef( null );\n\t\t\t}\n\t\t\treturn () => {};\n\t\t},\n\t\t[ unguardedBodyRef ]\n\t);\n\n\tconst src = getIframeSrc( resolvedAssets );\n\n\t// Make sure to not render the before and after focusable div elements in view\n\t// mode. They're only needed to capture focus in edit mode.\n\tconst shouldRenderFocusCaptureElements = tabIndex >= 0 && ! isPreviewMode;\n\n\tconst iframe = (\n\t\t<>\n\t\t\t{ shouldRenderFocusCaptureElements && before }\n\t\t\t{ /* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */ }\n\t\t\t<iframe\n\t\t\t\t{ ...props }\n\t\t\t\tstyle={ {\n\t\t\t\t\t...props.style,\n\t\t\t\t\theight: props.style?.height,\n\t\t\t\t\tborder: 0,\n\t\t\t\t} }\n\t\t\t\tref={ useMergeRefs( [ ref, setRef ] ) }\n\t\t\t\ttabIndex={ tabIndex }\n\t\t\t\tsrc={ src }\n\t\t\t\ttitle={ title }\n\t\t\t\tonKeyDown={ ( event ) => {\n\t\t\t\t\tif ( props.onKeyDown ) {\n\t\t\t\t\t\tprops.onKeyDown( event );\n\t\t\t\t\t}\n\t\t\t\t\t// If the event originates from inside the iframe, it means\n\t\t\t\t\t// it bubbled through the portal, but only with React\n\t\t\t\t\t// events. We need to to bubble native events as well,\n\t\t\t\t\t// though by doing so we also trigger another React event,\n\t\t\t\t\t// so we need to stop the propagation of this event to avoid\n\t\t\t\t\t// duplication.\n\t\t\t\t\tif (\n\t\t\t\t\t\tevent.currentTarget.ownerDocument !==\n\t\t\t\t\t\tevent.target.ownerDocument\n\t\t\t\t\t) {\n\t\t\t\t\t\t// We should only stop propagation of the React event,\n\t\t\t\t\t\t// the native event should further bubble inside the\n\t\t\t\t\t\t// iframe to the document and window.\n\t\t\t\t\t\t// Alternatively, we could consider redispatching the\n\t\t\t\t\t\t// native event in the iframe.\n\t\t\t\t\t\tconst { stopPropagation } = event.nativeEvent;\n\t\t\t\t\t\tevent.nativeEvent.stopPropagation = () => {};\n\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\tevent.nativeEvent.stopPropagation = stopPropagation;\n\t\t\t\t\t\tbubbleEvent(\n\t\t\t\t\t\t\tevent,\n\t\t\t\t\t\t\twindow.KeyboardEvent,\n\t\t\t\t\t\t\tevent.currentTarget\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ iframeDocument &&\n\t\t\t\t\tcreatePortal(\n\t\t\t\t\t\t<body\n\t\t\t\t\t\t\tref={ bodyRef }\n\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t'block-editor-iframe__body',\n\t\t\t\t\t\t\t\t'editor-styles-wrapper',\n\t\t\t\t\t\t\t\t...bodyClasses\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<StyleProvider document={ iframeDocument }>\n\t\t\t\t\t\t\t\t{ children }\n\t\t\t\t\t\t\t</StyleProvider>\n\t\t\t\t\t\t</body>,\n\t\t\t\t\t\tiframeDocument.documentElement\n\t\t\t\t\t) }\n\t\t\t</iframe>\n\t\t\t{ shouldRenderFocusCaptureElements && after }\n\t\t</>\n\t);\n\n\treturn (\n\t\t<div className=\"block-editor-iframe__container\" ref={ containerRef }>\n\t\t\t<div\n\t\t\t\tclassName={ clsx(\n\t\t\t\t\t'block-editor-iframe__scale-container',\n\t\t\t\t\tisZoomedOut && 'is-zoomed-out'\n\t\t\t\t) }\n\t\t\t\tstyle={ {\n\t\t\t\t\t'--wp-block-editor-iframe-zoom-out-scale-container-width':\n\t\t\t\t\t\tisZoomedOut && `${ scaleContainerWidth }px`,\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ iframe }\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\nfunction IframeIfReady( props, ref ) {\n\tconst isInitialised = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).getSettings().__internalIsInitialized,\n\t\t[]\n\t);\n\n\t// We shouldn't render the iframe until the editor settings are initialised.\n\t// The initial settings are needed to get the styles for the srcDoc, which\n\t// cannot be changed after the iframe is mounted. srcDoc is used to to set\n\t// the initial iframe HTML, which is required to avoid a flash of unstyled\n\t// content.\n\tif ( ! isInitialised ) {\n\t\treturn null;\n\t}\n\n\treturn <Iframe { ...props } forwardedRef={ ref } />;\n}\n\nexport default forwardRef( IframeIfReady );\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AACjB,mBAAwC;AACxC,qBAAmD;AACnD,kBAAmB;AACnB,qBAAwD;AACxD,wBAA6D;AAC7D,kBAA0B;AAC1B,0BAA+B;AAC/B,sCAAuC;AACvC,8BAA+B;AAC/B,mBAA0C;AAkSxC;AAhSF,SAAS,YAAa,OAAO,aAAa,OAAQ;AACjD,QAAM,OAAO,CAAC;AAEd,aAAY,OAAO,OAAQ;AAC1B,SAAM,GAAI,IAAI,MAAO,GAAI;AAAA,EAC1B;AASA,MAAK,iBAAiB,MAAM,gBAAgB,YAAY,YAAa;AACpE,UAAM,OAAO,MAAM,sBAAsB;AACzC,SAAK,WAAW,KAAK;AACrB,SAAK,WAAW,KAAK;AAAA,EACtB;AAEA,QAAM,WAAW,IAAI,YAAa,MA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,cAEA,sDAAC,kBAAAC,6BAAA,EAAc,UAAW,gBACvB,UACH;AAAA;AAAA,UACD;AAAA,UACA,eAAe;AAAA,QAChB;AAAA;AAAA,IACF;AAAA,IACE,oCAAoC;AAAA,KACvC;AAGD,SACC,4CAAC,SAAI,WAAU,kCAAiC,KAAM,cACrD;AAAA,IAAC;AAAA;AAAA,MACA,eAAY,YAAAD;AAAA,QACX;AAAA,QACA,eAAe;AAAA,MAChB;AAAA,MACA,OAAQ;AAAA,QACP,2DACC,eAAe,GAAI,mBAAoB;AAAA,MACzC;AAAA,MAEE;AAAA;AAAA,EACH,GACD;AAEF;AAEA,SAAS,cAAe,OAAO,KAAM;AACpC,QAAM,oBAAgB;AAAA,IACrB,CAAE,WACD,OAAQ,aAAAD,KAAiB,EAAE,YAAY,EAAE;AAAA,IAC1C,CAAC;AAAA,EACF;AAOA,MAAK,CAAE,eAAgB;AACtB,WAAO;AAAA,EACR;AAEA,SAAO,4CAAC,UAAS,GAAG,OAAQ,cAAe,KAAM;AAClD;AAEA,IAAO,qBAAQ,2BAAY,aAAc;",
6
6
  "names": ["reactVersion", "blockEditorStore", "clsx", "StyleProvider"]
7
7
  }
@@ -77,17 +77,31 @@ function getAnimationKeyframes(transitionFrom, transitionTo) {
77
77
  }
78
78
  ];
79
79
  }
80
+ var NULL_SIZE = { width: null, height: null };
81
+ function extractSize(entries) {
82
+ const contentBoxSize = entries.at(-1).contentBoxSize[0];
83
+ return {
84
+ width: contentBoxSize.inlineSize,
85
+ height: contentBoxSize.blockSize
86
+ };
87
+ }
80
88
  function useScaleCanvas({
81
89
  frameSize,
82
90
  iframeDocument,
83
91
  maxContainerWidth = 750,
84
92
  scale
85
93
  }) {
86
- const [contentResizeListener, { height: contentHeight }] = (0, import_compose.useResizeObserver)();
94
+ const [{ height: contentHeight }, setContentRect] = (0, import_element.useState)(NULL_SIZE);
95
+ const contentRef = (0, import_compose.useResizeObserver)((entries) => {
96
+ setContentRect(extractSize(entries));
97
+ });
87
98
  const [
88
- containerResizeListener,
89
- { width: containerWidth, height: containerHeight }
90
- ] = (0, import_compose.useResizeObserver)();
99
+ { width: containerWidth, height: containerHeight },
100
+ setContainerRect
101
+ ] = (0, import_element.useState)(NULL_SIZE);
102
+ const containerRef = (0, import_compose.useResizeObserver)((entries) => {
103
+ setContainerRect(extractSize(entries));
104
+ });
91
105
  const initialContainerWidthRef = (0, import_element.useRef)(0);
92
106
  const isZoomedOut = scale !== 1;
93
107
  const prefersReducedMotion = (0, import_compose.useReducedMotion)();
@@ -284,8 +298,8 @@ function useScaleCanvas({
284
298
  return {
285
299
  isZoomedOut,
286
300
  scaleContainerWidth,
287
- contentResizeListener,
288
- containerResizeListener
301
+ contentRef,
302
+ containerRef
289
303
  };
290
304
  }
291
305
  // Annotate the CommonJS export names for ESM import in node: