@wordpress/block-editor 14.4.0 → 14.6.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 (1056) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/README.md +4 -8
  3. package/build/autocompleters/block.js +13 -5
  4. package/build/autocompleters/block.js.map +1 -1
  5. package/build/components/background-image-control/index.js +1 -1
  6. package/build/components/background-image-control/index.js.map +1 -1
  7. package/build/components/block-canvas/index.js +10 -0
  8. package/build/components/block-canvas/index.js.map +1 -1
  9. package/build/components/block-card/index.js +2 -2
  10. package/build/components/block-card/index.js.map +1 -1
  11. package/build/components/block-controls/slot.js.map +1 -1
  12. package/build/components/block-controls/slot.native.js.map +1 -1
  13. package/build/components/block-draggable/draggable-chip.js +1 -1
  14. package/build/components/block-draggable/draggable-chip.js.map +1 -1
  15. package/build/components/block-full-height-alignment-control/index.js +1 -1
  16. package/build/components/block-full-height-alignment-control/index.js.map +1 -1
  17. package/build/components/block-list/block-invalid-warning.native.js +1 -1
  18. package/build/components/block-list/block-invalid-warning.native.js.map +1 -1
  19. package/build/components/block-list/block-list-item.native.js.map +1 -1
  20. package/build/components/block-list/block.js +1 -1
  21. package/build/components/block-list/block.js.map +1 -1
  22. package/build/components/block-list/block.native.js +1 -7
  23. package/build/components/block-list/block.native.js.map +1 -1
  24. package/build/components/block-list/index.js +6 -5
  25. package/build/components/block-list/index.js.map +1 -1
  26. package/build/components/block-list/index.native.js.map +1 -1
  27. package/build/components/block-list/use-block-props/index.js +1 -2
  28. package/build/components/block-list/use-block-props/index.js.map +1 -1
  29. package/build/components/block-list/use-block-props/use-focus-first-element.js +4 -3
  30. package/build/components/block-list/use-block-props/use-focus-first-element.js.map +1 -1
  31. package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js +11 -6
  32. package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
  33. package/build/components/block-list/use-in-between-inserter.js +1 -1
  34. package/build/components/block-list/use-in-between-inserter.js.map +1 -1
  35. package/build/components/block-list/zoom-out-separator.js +10 -7
  36. package/build/components/block-list/zoom-out-separator.js.map +1 -1
  37. package/build/components/block-lock/modal.js +1 -1
  38. package/build/components/block-lock/modal.js.map +1 -1
  39. package/build/components/block-mover/button.js.map +1 -1
  40. package/build/components/block-parent-selector/index.js +1 -1
  41. package/build/components/block-parent-selector/index.js.map +1 -1
  42. package/build/components/block-pattern-setup/index.js.map +1 -1
  43. package/build/components/block-patterns-list/index.js.map +1 -1
  44. package/build/components/block-patterns-paging/index.js +1 -1
  45. package/build/components/block-patterns-paging/index.js.map +1 -1
  46. package/build/components/block-popover/index.js +1 -1
  47. package/build/components/block-popover/index.js.map +1 -1
  48. package/build/components/block-preview/auto.js +1 -4
  49. package/build/components/block-preview/auto.js.map +1 -1
  50. package/build/components/block-preview/index.js +2 -2
  51. package/build/components/block-preview/index.js.map +1 -1
  52. package/build/components/block-rename/modal.js +2 -2
  53. package/build/components/block-rename/modal.js.map +1 -1
  54. package/build/components/block-settings-menu/block-parent-selector-menu-item.js +1 -1
  55. package/build/components/block-settings-menu/block-parent-selector-menu-item.js.map +1 -1
  56. package/build/components/block-settings-menu/block-settings-dropdown.js +5 -0
  57. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  58. package/build/components/block-settings-menu/index.js +4 -3
  59. package/build/components/block-settings-menu/index.js.map +1 -1
  60. package/build/components/block-switcher/block-transformations-menu.native.js +1 -1
  61. package/build/components/block-switcher/block-transformations-menu.native.js.map +1 -1
  62. package/build/components/block-switcher/index.js +2 -1
  63. package/build/components/block-switcher/index.js.map +1 -1
  64. package/build/components/block-switcher/pattern-transformations-menu.js.map +1 -1
  65. package/build/components/block-switcher/use-transformed-patterns.js +1 -0
  66. package/build/components/block-switcher/use-transformed-patterns.js.map +1 -1
  67. package/build/components/block-switcher/utils.js +1 -0
  68. package/build/components/block-switcher/utils.js.map +1 -1
  69. package/build/components/block-toolbar/change-design.js +122 -0
  70. package/build/components/block-toolbar/change-design.js.map +1 -0
  71. package/build/components/block-toolbar/index.js +19 -7
  72. package/build/components/block-toolbar/index.js.map +1 -1
  73. package/build/components/block-tools/index.js +4 -17
  74. package/build/components/block-tools/index.js.map +1 -1
  75. package/build/components/block-tools/insertion-point.js +4 -3
  76. package/build/components/block-tools/insertion-point.js.map +1 -1
  77. package/build/components/block-tools/use-show-block-tools.js +4 -6
  78. package/build/components/block-tools/use-show-block-tools.js.map +1 -1
  79. package/build/components/block-tools/zoom-out-mode-inserters.js +20 -29
  80. package/build/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
  81. package/build/components/block-types-list/index.js.map +1 -1
  82. package/build/components/block-types-list/index.native.js.map +1 -1
  83. package/build/components/block-variation-transforms/index.js +3 -2
  84. package/build/components/block-variation-transforms/index.js.map +1 -1
  85. package/build/components/block-vertical-alignment-control/ui.js +6 -10
  86. package/build/components/block-vertical-alignment-control/ui.js.map +1 -1
  87. package/build/components/border-radius-control/index.js.map +1 -1
  88. package/build/components/border-radius-control/linked-button.js +7 -10
  89. package/build/components/border-radius-control/linked-button.js.map +1 -1
  90. package/build/components/border-radius-control/utils.js.map +1 -1
  91. package/build/components/button-block-appender/index.js.map +1 -1
  92. package/build/components/collab/block-comment-icon-slot.js +18 -0
  93. package/build/components/collab/block-comment-icon-slot.js.map +1 -0
  94. package/build/components/collab/block-comment-icon-toolbar-slot.js +18 -0
  95. package/build/components/collab/block-comment-icon-toolbar-slot.js.map +1 -0
  96. package/build/components/color-style-selector/index.js.map +1 -1
  97. package/build/components/colors/utils.js.map +1 -1
  98. package/build/components/colors/with-colors.js.map +1 -1
  99. package/build/components/colors-gradients/panel-color-gradient-settings.native.js.map +1 -1
  100. package/build/components/colors-gradients/use-multiple-origin-colors-and-gradients.js +7 -1
  101. package/build/components/colors-gradients/use-multiple-origin-colors-and-gradients.js.map +1 -1
  102. package/build/components/convert-to-group-buttons/toolbar.js +4 -4
  103. package/build/components/convert-to-group-buttons/toolbar.js.map +1 -1
  104. package/build/components/date-format-picker/index.js +1 -0
  105. package/build/components/date-format-picker/index.js.map +1 -1
  106. package/build/components/duotone/utils.js.map +1 -1
  107. package/build/components/duotone-control/index.js.map +1 -1
  108. package/build/components/font-sizes/fluid-utils.js.map +1 -1
  109. package/build/components/font-sizes/utils.js.map +1 -1
  110. package/build/components/font-sizes/with-font-sizes.js.map +1 -1
  111. package/build/components/global-styles/border-panel.js.map +1 -1
  112. package/build/components/global-styles/color-panel.js +1 -4
  113. package/build/components/global-styles/color-panel.js.map +1 -1
  114. package/build/components/global-styles/filters-panel.js.map +1 -1
  115. package/build/components/global-styles/get-block-css-selector.js.map +1 -1
  116. package/build/components/global-styles/get-global-styles-changes.js +2 -1
  117. package/build/components/global-styles/get-global-styles-changes.js.map +1 -1
  118. package/build/components/global-styles/hooks.js.map +1 -1
  119. package/build/components/global-styles/typography-panel.js.map +1 -1
  120. package/build/components/global-styles/use-global-styles-context.native.js +6 -0
  121. package/build/components/global-styles/use-global-styles-context.native.js.map +1 -1
  122. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  123. package/build/components/global-styles/utils.js.map +1 -1
  124. package/build/components/gradients/use-gradient.js.map +1 -1
  125. package/build/components/grid/grid-item-movers.js.map +1 -1
  126. package/build/components/grid/grid-visualizer.js.map +1 -1
  127. package/build/components/iframe/index.js +46 -11
  128. package/build/components/iframe/index.js.map +1 -1
  129. package/build/components/image-editor/use-save-image.js +1 -1
  130. package/build/components/image-editor/use-save-image.js.map +1 -1
  131. package/build/components/image-size-control/index.js +61 -20
  132. package/build/components/image-size-control/index.js.map +1 -1
  133. package/build/components/inner-blocks/index.js +9 -5
  134. package/build/components/inner-blocks/index.js.map +1 -1
  135. package/build/components/inner-blocks/use-nested-settings-update.js +15 -8
  136. package/build/components/inner-blocks/use-nested-settings-update.js.map +1 -1
  137. package/build/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js +1 -1
  138. package/build/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js.map +1 -1
  139. package/build/components/inserter/block-patterns-explorer/pattern-list.js +2 -2
  140. package/build/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
  141. package/build/components/inserter/block-patterns-tab/pattern-category-previews.js +2 -2
  142. package/build/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
  143. package/build/components/inserter/block-patterns-tab/patterns-filter.js +1 -1
  144. package/build/components/inserter/block-patterns-tab/patterns-filter.js.map +1 -1
  145. package/build/components/inserter/block-patterns-tab/use-pattern-categories.js +1 -1
  146. package/build/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
  147. package/build/components/inserter/block-types-tab.native.js.map +1 -1
  148. package/build/components/inserter/category-tabs/index.js +16 -12
  149. package/build/components/inserter/category-tabs/index.js.map +1 -1
  150. package/build/components/inserter/hooks/use-block-types-state.js +1 -1
  151. package/build/components/inserter/hooks/use-block-types-state.js.map +1 -1
  152. package/build/components/inserter/hooks/use-patterns-state.js +1 -1
  153. package/build/components/inserter/hooks/use-patterns-state.js.map +1 -1
  154. package/build/components/inserter/media-tab/media-panel.js.map +1 -1
  155. package/build/components/inserter/media-tab/media-preview.js +1 -1
  156. package/build/components/inserter/media-tab/media-preview.js.map +1 -1
  157. package/build/components/inserter/media-tab/media-tab.js.map +1 -1
  158. package/build/components/inserter/media-tab/utils.js.map +1 -1
  159. package/build/components/inserter/menu.js +8 -3
  160. package/build/components/inserter/menu.js.map +1 -1
  161. package/build/components/inserter/mobile-tab-navigation.js.map +1 -1
  162. package/build/components/inserter/preview-panel.js.map +1 -1
  163. package/build/components/inserter/quick-inserter.js +1 -1
  164. package/build/components/inserter/quick-inserter.js.map +1 -1
  165. package/build/components/inserter/search-results.js +1 -1
  166. package/build/components/inserter/search-results.js.map +1 -1
  167. package/build/components/inserter/tabs.native.js.map +1 -1
  168. package/build/components/inserter-button/index.native.js +1 -1
  169. package/build/components/inserter-button/index.native.js.map +1 -1
  170. package/build/components/inspector-controls/block-support-tools-panel.js.map +1 -1
  171. package/build/components/inspector-controls/fill.js.map +1 -1
  172. package/build/components/inspector-controls/fill.native.js.map +1 -1
  173. package/build/components/inspector-controls/slot.js.map +1 -1
  174. package/build/components/inspector-controls/slot.native.js.map +1 -1
  175. package/build/components/inspector-controls-tabs/index.js +0 -2
  176. package/build/components/inspector-controls-tabs/index.js.map +1 -1
  177. package/build/components/inspector-controls-tabs/utils.js +3 -6
  178. package/build/components/inspector-controls-tabs/utils.js.map +1 -1
  179. package/build/components/line-height-control/index.js.map +1 -1
  180. package/build/components/link-control/is-url-like.js.map +1 -1
  181. package/build/components/link-control/link-preview.js +12 -9
  182. package/build/components/link-control/link-preview.js.map +1 -1
  183. package/build/components/link-control/search-create-button.js +1 -1
  184. package/build/components/link-control/search-create-button.js.map +1 -1
  185. package/build/components/link-control/search-input.js +3 -5
  186. package/build/components/link-control/search-input.js.map +1 -1
  187. package/build/components/link-control/search-results.js +5 -15
  188. package/build/components/link-control/search-results.js.map +1 -1
  189. package/build/components/link-control/settings-drawer.js.map +1 -1
  190. package/build/components/link-control/use-rich-url-data.js.map +1 -1
  191. package/build/components/list-view/appender.js +5 -4
  192. package/build/components/list-view/appender.js.map +1 -1
  193. package/build/components/list-view/block-select-button.js.map +1 -1
  194. package/build/components/list-view/block.js.map +1 -1
  195. package/build/components/list-view/branch.js +6 -5
  196. package/build/components/list-view/branch.js.map +1 -1
  197. package/build/components/list-view/drop-indicator.js.map +1 -1
  198. package/build/components/list-view/index.js +1 -2
  199. package/build/components/list-view/index.js.map +1 -1
  200. package/build/components/list-view/use-block-selection.js +2 -2
  201. package/build/components/list-view/use-block-selection.js.map +1 -1
  202. package/build/components/list-view/utils.js +1 -1
  203. package/build/components/list-view/utils.js.map +1 -1
  204. package/build/components/media-placeholder/index.native.js +1 -1
  205. package/build/components/media-placeholder/index.native.js.map +1 -1
  206. package/build/components/media-replace-flow/index.js.map +1 -1
  207. package/build/components/multi-selection-inspector/index.js +2 -2
  208. package/build/components/multi-selection-inspector/index.js.map +1 -1
  209. package/build/components/observe-typing/index.js +1 -0
  210. package/build/components/observe-typing/index.js.map +1 -1
  211. package/build/components/provider/index.js +1 -1
  212. package/build/components/provider/index.js.map +1 -1
  213. package/build/components/recursion-provider/index.js +1 -0
  214. package/build/components/recursion-provider/index.js.map +1 -1
  215. package/build/components/responsive-block-control/index.js +3 -3
  216. package/build/components/responsive-block-control/index.js.map +1 -1
  217. package/build/components/responsive-block-control/label.js +1 -1
  218. package/build/components/responsive-block-control/label.js.map +1 -1
  219. package/build/components/rich-text/content.js.map +1 -1
  220. package/build/components/rich-text/event-listeners/index.js +3 -1
  221. package/build/components/rich-text/event-listeners/index.js.map +1 -1
  222. package/build/components/rich-text/file-paste-handler.native.js.map +1 -1
  223. package/build/components/rich-text/format-toolbar/index.js.map +1 -1
  224. package/build/components/rich-text/format-toolbar/index.native.js.map +1 -1
  225. package/build/components/rich-text/index.js +3 -2
  226. package/build/components/rich-text/index.js.map +1 -1
  227. package/build/components/rich-text/index.native.js +2 -6
  228. package/build/components/rich-text/index.native.js.map +1 -1
  229. package/build/components/rich-text/multiline.js.map +1 -1
  230. package/build/components/rich-text/native/get-format-colors.native.js.map +1 -1
  231. package/build/components/rich-text/native/index.native.js.map +1 -1
  232. package/build/components/rich-text/native/use-format-types.js +1 -0
  233. package/build/components/rich-text/native/use-format-types.js.map +1 -1
  234. package/build/components/rich-text/toolbar-button.js.map +1 -1
  235. package/build/components/rich-text/use-format-types.js +1 -0
  236. package/build/components/rich-text/use-format-types.js.map +1 -1
  237. package/build/components/spacing-sizes-control/index.js +2 -2
  238. package/build/components/spacing-sizes-control/index.js.map +1 -1
  239. package/build/components/spacing-sizes-control/input-controls/axial.js.map +1 -1
  240. package/build/components/spacing-sizes-control/input-controls/separated.js.map +1 -1
  241. package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js +3 -3
  242. package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
  243. package/build/components/spacing-sizes-control/linked-button.js +1 -5
  244. package/build/components/spacing-sizes-control/linked-button.js.map +1 -1
  245. package/build/components/spacing-sizes-control/utils.js +1 -0
  246. package/build/components/spacing-sizes-control/utils.js.map +1 -1
  247. package/build/components/tool-selector/index.js +8 -5
  248. package/build/components/tool-selector/index.js.map +1 -1
  249. package/build/components/typewriter/index.js +1 -0
  250. package/build/components/typewriter/index.js.map +1 -1
  251. package/build/components/unsupported-block-details/index.native.js.map +1 -1
  252. package/build/components/url-input/index.js +1 -1
  253. package/build/components/url-input/index.js.map +1 -1
  254. package/build/components/use-block-commands/index.js +1 -1
  255. package/build/components/use-block-commands/index.js.map +1 -1
  256. package/build/components/use-block-drop-zone/index.js +5 -5
  257. package/build/components/use-block-drop-zone/index.js.map +1 -1
  258. package/build/components/use-block-drop-zone/index.native.js +0 -1
  259. package/build/components/use-block-drop-zone/index.native.js.map +1 -1
  260. package/build/components/use-flash-editable-blocks/index.js.map +1 -1
  261. package/build/components/use-moving-animation/index.js +1 -3
  262. package/build/components/use-moving-animation/index.js.map +1 -1
  263. package/build/components/use-resize-canvas/index.js +1 -2
  264. package/build/components/use-resize-canvas/index.js.map +1 -1
  265. package/build/components/use-settings/index.js +1 -3
  266. package/build/components/use-settings/index.js.map +1 -1
  267. package/build/components/writing-flow/index.js +5 -3
  268. package/build/components/writing-flow/index.js.map +1 -1
  269. package/build/components/writing-flow/use-tab-nav.js +20 -5
  270. package/build/components/writing-flow/use-tab-nav.js.map +1 -1
  271. package/build/hooks/align.js.map +1 -1
  272. package/build/hooks/block-bindings.js +19 -8
  273. package/build/hooks/block-bindings.js.map +1 -1
  274. package/build/hooks/block-hooks.js +1 -1
  275. package/build/hooks/block-hooks.js.map +1 -1
  276. package/build/hooks/block-style-variation.js.map +1 -1
  277. package/build/hooks/contrast-checker.js +0 -1
  278. package/build/hooks/contrast-checker.js.map +1 -1
  279. package/build/hooks/duotone.js +2 -2
  280. package/build/hooks/duotone.js.map +1 -1
  281. package/build/hooks/font-family.js.map +1 -1
  282. package/build/hooks/gap.js.map +1 -1
  283. package/build/hooks/generated-class-name.js +1 -0
  284. package/build/hooks/generated-class-name.js.map +1 -1
  285. package/build/hooks/grid-visualizer.js +13 -11
  286. package/build/hooks/grid-visualizer.js.map +1 -1
  287. package/build/hooks/layout-child.js +41 -3
  288. package/build/hooks/layout-child.js.map +1 -1
  289. package/build/hooks/layout.js.map +1 -1
  290. package/build/hooks/position.js +1 -1
  291. package/build/hooks/position.js.map +1 -1
  292. package/build/hooks/spacing-visualizer.js.map +1 -1
  293. package/build/hooks/style.js +4 -1
  294. package/build/hooks/style.js.map +1 -1
  295. package/build/hooks/text-align.js.map +1 -1
  296. package/build/hooks/use-typography-props.js.map +1 -1
  297. package/build/hooks/use-zoom-out.js +17 -18
  298. package/build/hooks/use-zoom-out.js.map +1 -1
  299. package/build/index.js +0 -7
  300. package/build/index.js.map +1 -1
  301. package/build/layouts/constrained.js.map +1 -1
  302. package/build/layouts/flex.js.map +1 -1
  303. package/build/layouts/grid.js.map +1 -1
  304. package/build/layouts/utils.js.map +1 -1
  305. package/build/private-apis.js +6 -1
  306. package/build/private-apis.js.map +1 -1
  307. package/build/store/actions.js +6 -38
  308. package/build/store/actions.js.map +1 -1
  309. package/build/store/defaults.js +1 -1
  310. package/build/store/defaults.js.map +1 -1
  311. package/build/store/private-actions.js +57 -8
  312. package/build/store/private-actions.js.map +1 -1
  313. package/build/store/private-selectors.js +9 -21
  314. package/build/store/private-selectors.js.map +1 -1
  315. package/build/store/reducer.js +18 -24
  316. package/build/store/reducer.js.map +1 -1
  317. package/build/store/selectors.js +66 -22
  318. package/build/store/selectors.js.map +1 -1
  319. package/build/utils/block-bindings.js +9 -6
  320. package/build/utils/block-bindings.js.map +1 -1
  321. package/build/utils/dom.js +16 -1
  322. package/build/utils/dom.js.map +1 -1
  323. package/build/utils/get-font-styles-and-weights.js +2 -2
  324. package/build/utils/get-font-styles-and-weights.js.map +1 -1
  325. package/build/utils/object.js +1 -0
  326. package/build/utils/object.js.map +1 -1
  327. package/build/utils/pasting.js.map +1 -1
  328. package/build/utils/transform-styles/index.js +4 -3
  329. package/build/utils/transform-styles/index.js.map +1 -1
  330. package/build-module/autocompleters/block.js +15 -9
  331. package/build-module/autocompleters/block.js.map +1 -1
  332. package/build-module/autocompleters/link.js +1 -3
  333. package/build-module/autocompleters/link.js.map +1 -1
  334. package/build-module/components/audio-player/index.native.js +1 -2
  335. package/build-module/components/audio-player/index.native.js.map +1 -1
  336. package/build-module/components/background-image-control/index.js +2 -3
  337. package/build-module/components/background-image-control/index.js.map +1 -1
  338. package/build-module/components/block-alignment-control/ui.js +1 -2
  339. package/build-module/components/block-alignment-control/ui.js.map +1 -1
  340. package/build-module/components/block-breadcrumb/index.js +1 -2
  341. package/build-module/components/block-breadcrumb/index.js.map +1 -1
  342. package/build-module/components/block-canvas/index.js +12 -3
  343. package/build-module/components/block-canvas/index.js.map +1 -1
  344. package/build-module/components/block-card/index.js +4 -5
  345. package/build-module/components/block-card/index.js.map +1 -1
  346. package/build-module/components/block-compare/block-view.js +1 -2
  347. package/build-module/components/block-compare/block-view.js.map +1 -1
  348. package/build-module/components/block-compare/index.js +1 -2
  349. package/build-module/components/block-compare/index.js.map +1 -1
  350. package/build-module/components/block-controls/fill.js +1 -3
  351. package/build-module/components/block-controls/fill.js.map +1 -1
  352. package/build-module/components/block-controls/slot.js.map +1 -1
  353. package/build-module/components/block-controls/slot.native.js.map +1 -1
  354. package/build-module/components/block-draggable/draggable-chip.js +2 -3
  355. package/build-module/components/block-draggable/draggable-chip.js.map +1 -1
  356. package/build-module/components/block-draggable/draggable-chip.native.js +1 -2
  357. package/build-module/components/block-draggable/draggable-chip.native.js.map +1 -1
  358. package/build-module/components/block-draggable/index.native.js +1 -3
  359. package/build-module/components/block-draggable/index.native.js.map +1 -1
  360. package/build-module/components/block-edit/index.js +1 -2
  361. package/build-module/components/block-edit/index.js.map +1 -1
  362. package/build-module/components/block-edit/multiple-usage-warning.js +1 -2
  363. package/build-module/components/block-edit/multiple-usage-warning.js.map +1 -1
  364. package/build-module/components/block-full-height-alignment-control/index.js +1 -1
  365. package/build-module/components/block-full-height-alignment-control/index.js.map +1 -1
  366. package/build-module/components/block-inspector/index.js +1 -3
  367. package/build-module/components/block-inspector/index.js.map +1 -1
  368. package/build-module/components/block-list/block-crash-warning.js +1 -1
  369. package/build-module/components/block-list/block-crash-warning.js.map +1 -1
  370. package/build-module/components/block-list/block-crash-warning.native.js +1 -1
  371. package/build-module/components/block-list/block-crash-warning.native.js.map +1 -1
  372. package/build-module/components/block-list/block-invalid-warning.js +1 -3
  373. package/build-module/components/block-list/block-invalid-warning.js.map +1 -1
  374. package/build-module/components/block-list/block-invalid-warning.native.js +1 -1
  375. package/build-module/components/block-list/block-invalid-warning.native.js.map +1 -1
  376. package/build-module/components/block-list/block-list-item.native.js +1 -2
  377. package/build-module/components/block-list/block-list-item.native.js.map +1 -1
  378. package/build-module/components/block-list/block-selection-button.native.js +1 -2
  379. package/build-module/components/block-list/block-selection-button.native.js.map +1 -1
  380. package/build-module/components/block-list/block.js +2 -4
  381. package/build-module/components/block-list/block.js.map +1 -1
  382. package/build-module/components/block-list/block.native.js +2 -9
  383. package/build-module/components/block-list/block.native.js.map +1 -1
  384. package/build-module/components/block-list/index.js +7 -7
  385. package/build-module/components/block-list/index.js.map +1 -1
  386. package/build-module/components/block-list/index.native.js +1 -3
  387. package/build-module/components/block-list/index.native.js.map +1 -1
  388. package/build-module/components/block-list/insertion-point.native.js +1 -2
  389. package/build-module/components/block-list/insertion-point.native.js.map +1 -1
  390. package/build-module/components/block-list/use-block-props/index.js +1 -2
  391. package/build-module/components/block-list/use-block-props/index.js.map +1 -1
  392. package/build-module/components/block-list/use-block-props/use-focus-first-element.js +4 -3
  393. package/build-module/components/block-list/use-block-props/use-focus-first-element.js.map +1 -1
  394. package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js +11 -6
  395. package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
  396. package/build-module/components/block-list/use-in-between-inserter.js +1 -1
  397. package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
  398. package/build-module/components/block-list/zoom-out-separator.js +10 -7
  399. package/build-module/components/block-list/zoom-out-separator.js.map +1 -1
  400. package/build-module/components/block-lock/menu-item.js +1 -3
  401. package/build-module/components/block-lock/menu-item.js.map +1 -1
  402. package/build-module/components/block-lock/modal.js +2 -3
  403. package/build-module/components/block-lock/modal.js.map +1 -1
  404. package/build-module/components/block-lock/toolbar.js +1 -3
  405. package/build-module/components/block-lock/toolbar.js.map +1 -1
  406. package/build-module/components/block-media-update-progress/index.native.js +1 -2
  407. package/build-module/components/block-media-update-progress/index.native.js.map +1 -1
  408. package/build-module/components/block-mover/button.js +1 -3
  409. package/build-module/components/block-mover/button.js.map +1 -1
  410. package/build-module/components/block-mover/index.js +1 -2
  411. package/build-module/components/block-mover/index.js.map +1 -1
  412. package/build-module/components/block-mover/index.native.js +1 -2
  413. package/build-module/components/block-mover/index.native.js.map +1 -1
  414. package/build-module/components/block-navigation/dropdown.js +1 -2
  415. package/build-module/components/block-navigation/dropdown.js.map +1 -1
  416. package/build-module/components/block-parent-selector/index.js +1 -1
  417. package/build-module/components/block-parent-selector/index.js.map +1 -1
  418. package/build-module/components/block-pattern-setup/index.js +1 -3
  419. package/build-module/components/block-pattern-setup/index.js.map +1 -1
  420. package/build-module/components/block-pattern-setup/setup-toolbar.js +1 -2
  421. package/build-module/components/block-pattern-setup/setup-toolbar.js.map +1 -1
  422. package/build-module/components/block-patterns-list/index.js +1 -3
  423. package/build-module/components/block-patterns-list/index.js.map +1 -1
  424. package/build-module/components/block-patterns-paging/index.js +2 -3
  425. package/build-module/components/block-patterns-paging/index.js.map +1 -1
  426. package/build-module/components/block-popover/index.js +1 -1
  427. package/build-module/components/block-popover/index.js.map +1 -1
  428. package/build-module/components/block-preview/auto.js +2 -7
  429. package/build-module/components/block-preview/auto.js.map +1 -1
  430. package/build-module/components/block-preview/index.js +3 -4
  431. package/build-module/components/block-preview/index.js.map +1 -1
  432. package/build-module/components/block-quick-navigation/index.js +1 -2
  433. package/build-module/components/block-quick-navigation/index.js.map +1 -1
  434. package/build-module/components/block-removal-warning-modal/index.js +1 -2
  435. package/build-module/components/block-removal-warning-modal/index.js.map +1 -1
  436. package/build-module/components/block-rename/modal.js +3 -4
  437. package/build-module/components/block-rename/modal.js.map +1 -1
  438. package/build-module/components/block-rename/rename-control.js +1 -3
  439. package/build-module/components/block-rename/rename-control.js.map +1 -1
  440. package/build-module/components/block-settings/container.native.js +1 -3
  441. package/build-module/components/block-settings/container.native.js.map +1 -1
  442. package/build-module/components/block-settings-menu/block-parent-selector-menu-item.js +1 -1
  443. package/build-module/components/block-settings-menu/block-parent-selector-menu-item.js.map +1 -1
  444. package/build-module/components/block-settings-menu/block-settings-dropdown.js +6 -3
  445. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  446. package/build-module/components/block-settings-menu/index.js +5 -4
  447. package/build-module/components/block-settings-menu/index.js.map +1 -1
  448. package/build-module/components/block-settings-menu-controls/index.js +1 -2
  449. package/build-module/components/block-settings-menu-controls/index.js.map +1 -1
  450. package/build-module/components/block-styles/index.js +1 -2
  451. package/build-module/components/block-styles/index.js.map +1 -1
  452. package/build-module/components/block-styles/menu-items.js +1 -2
  453. package/build-module/components/block-styles/menu-items.js.map +1 -1
  454. package/build-module/components/block-styles/preview.native.js +1 -2
  455. package/build-module/components/block-styles/preview.native.js.map +1 -1
  456. package/build-module/components/block-switcher/block-transformations-menu.js +1 -3
  457. package/build-module/components/block-switcher/block-transformations-menu.js.map +1 -1
  458. package/build-module/components/block-switcher/block-transformations-menu.native.js +1 -1
  459. package/build-module/components/block-switcher/block-transformations-menu.native.js.map +1 -1
  460. package/build-module/components/block-switcher/block-variation-transformations.js +1 -3
  461. package/build-module/components/block-switcher/block-variation-transformations.js.map +1 -1
  462. package/build-module/components/block-switcher/index.js +3 -4
  463. package/build-module/components/block-switcher/index.js.map +1 -1
  464. package/build-module/components/block-switcher/pattern-transformations-menu.js +1 -2
  465. package/build-module/components/block-switcher/pattern-transformations-menu.js.map +1 -1
  466. package/build-module/components/block-switcher/preview-block-popover.js +1 -2
  467. package/build-module/components/block-switcher/preview-block-popover.js.map +1 -1
  468. package/build-module/components/block-switcher/use-transformed-patterns.js +1 -0
  469. package/build-module/components/block-switcher/use-transformed-patterns.js.map +1 -1
  470. package/build-module/components/block-switcher/utils.js +1 -0
  471. package/build-module/components/block-switcher/utils.js.map +1 -1
  472. package/build-module/components/block-toolbar/block-toolbar-menu.native.js +1 -2
  473. package/build-module/components/block-toolbar/block-toolbar-menu.native.js.map +1 -1
  474. package/build-module/components/block-toolbar/change-design.js +114 -0
  475. package/build-module/components/block-toolbar/change-design.js.map +1 -0
  476. package/build-module/components/block-toolbar/index.js +20 -10
  477. package/build-module/components/block-toolbar/index.js.map +1 -1
  478. package/build-module/components/block-toolbar/index.native.js +1 -3
  479. package/build-module/components/block-toolbar/index.native.js.map +1 -1
  480. package/build-module/components/block-tools/index.js +5 -19
  481. package/build-module/components/block-tools/index.js.map +1 -1
  482. package/build-module/components/block-tools/insertion-point.js +5 -5
  483. package/build-module/components/block-tools/insertion-point.js.map +1 -1
  484. package/build-module/components/block-tools/use-show-block-tools.js +4 -6
  485. package/build-module/components/block-tools/use-show-block-tools.js.map +1 -1
  486. package/build-module/components/block-tools/zoom-out-mode-inserters.js +20 -29
  487. package/build-module/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
  488. package/build-module/components/block-types-list/index.js +1 -2
  489. package/build-module/components/block-types-list/index.js.map +1 -1
  490. package/build-module/components/block-types-list/index.native.js +1 -2
  491. package/build-module/components/block-types-list/index.native.js.map +1 -1
  492. package/build-module/components/block-variation-picker/index.js +1 -2
  493. package/build-module/components/block-variation-picker/index.js.map +1 -1
  494. package/build-module/components/block-variation-picker/index.native.js +1 -2
  495. package/build-module/components/block-variation-picker/index.native.js.map +1 -1
  496. package/build-module/components/block-variation-transforms/index.js +4 -4
  497. package/build-module/components/block-variation-transforms/index.js.map +1 -1
  498. package/build-module/components/block-vertical-alignment-control/ui.js +6 -10
  499. package/build-module/components/block-vertical-alignment-control/ui.js.map +1 -1
  500. package/build-module/components/border-radius-control/index.js +1 -3
  501. package/build-module/components/border-radius-control/index.js.map +1 -1
  502. package/build-module/components/border-radius-control/linked-button.js +8 -11
  503. package/build-module/components/border-radius-control/linked-button.js.map +1 -1
  504. package/build-module/components/border-radius-control/utils.js.map +1 -1
  505. package/build-module/components/button-block-appender/index.js.map +1 -1
  506. package/build-module/components/button-block-appender/index.native.js +1 -2
  507. package/build-module/components/button-block-appender/index.native.js.map +1 -1
  508. package/build-module/components/child-layout-control/index.js +1 -3
  509. package/build-module/components/child-layout-control/index.js.map +1 -1
  510. package/build-module/components/collab/block-comment-icon-slot.js +11 -0
  511. package/build-module/components/collab/block-comment-icon-slot.js.map +1 -0
  512. package/build-module/components/collab/block-comment-icon-toolbar-slot.js +11 -0
  513. package/build-module/components/collab/block-comment-icon-toolbar-slot.js.map +1 -0
  514. package/build-module/components/color-style-selector/index.js.map +1 -1
  515. package/build-module/components/colors/utils.js.map +1 -1
  516. package/build-module/components/colors/with-colors.js.map +1 -1
  517. package/build-module/components/colors-gradients/control.js +1 -2
  518. package/build-module/components/colors-gradients/control.js.map +1 -1
  519. package/build-module/components/colors-gradients/dropdown.js +1 -3
  520. package/build-module/components/colors-gradients/dropdown.js.map +1 -1
  521. package/build-module/components/colors-gradients/panel-color-gradient-settings.js +1 -3
  522. package/build-module/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
  523. package/build-module/components/colors-gradients/panel-color-gradient-settings.native.js +1 -3
  524. package/build-module/components/colors-gradients/panel-color-gradient-settings.native.js.map +1 -1
  525. package/build-module/components/colors-gradients/use-multiple-origin-colors-and-gradients.js +7 -1
  526. package/build-module/components/colors-gradients/use-multiple-origin-colors-and-gradients.js.map +1 -1
  527. package/build-module/components/contrast-checker/index.native.js +1 -2
  528. package/build-module/components/contrast-checker/index.native.js.map +1 -1
  529. package/build-module/components/convert-to-group-buttons/index.js +1 -3
  530. package/build-module/components/convert-to-group-buttons/index.js.map +1 -1
  531. package/build-module/components/convert-to-group-buttons/toolbar.js +5 -6
  532. package/build-module/components/convert-to-group-buttons/toolbar.js.map +1 -1
  533. package/build-module/components/date-format-picker/index.js +2 -2
  534. package/build-module/components/date-format-picker/index.js.map +1 -1
  535. package/build-module/components/default-block-appender/index.js +1 -2
  536. package/build-module/components/default-block-appender/index.js.map +1 -1
  537. package/build-module/components/dimensions-tool/index.js +1 -3
  538. package/build-module/components/dimensions-tool/index.js.map +1 -1
  539. package/build-module/components/dimensions-tool/width-height-tool.js +1 -3
  540. package/build-module/components/dimensions-tool/width-height-tool.js.map +1 -1
  541. package/build-module/components/duotone/utils.js.map +1 -1
  542. package/build-module/components/duotone-control/index.js +1 -2
  543. package/build-module/components/duotone-control/index.js.map +1 -1
  544. package/build-module/components/editor-styles/index.js +1 -3
  545. package/build-module/components/editor-styles/index.js.map +1 -1
  546. package/build-module/components/floating-toolbar/index.native.js +1 -2
  547. package/build-module/components/floating-toolbar/index.native.js.map +1 -1
  548. package/build-module/components/floating-toolbar/nav-up-icon.js +1 -2
  549. package/build-module/components/floating-toolbar/nav-up-icon.js.map +1 -1
  550. package/build-module/components/font-sizes/fluid-utils.js.map +1 -1
  551. package/build-module/components/font-sizes/utils.js.map +1 -1
  552. package/build-module/components/font-sizes/with-font-sizes.js +2 -2
  553. package/build-module/components/font-sizes/with-font-sizes.js.map +1 -1
  554. package/build-module/components/global-styles/advanced-panel.js +1 -2
  555. package/build-module/components/global-styles/advanced-panel.js.map +1 -1
  556. package/build-module/components/global-styles/border-panel.js +1 -2
  557. package/build-module/components/global-styles/border-panel.js.map +1 -1
  558. package/build-module/components/global-styles/color-panel.js +3 -7
  559. package/build-module/components/global-styles/color-panel.js.map +1 -1
  560. package/build-module/components/global-styles/dimensions-panel.js +1 -2
  561. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  562. package/build-module/components/global-styles/filters-panel.js +1 -2
  563. package/build-module/components/global-styles/filters-panel.js.map +1 -1
  564. package/build-module/components/global-styles/get-block-css-selector.js.map +1 -1
  565. package/build-module/components/global-styles/get-global-styles-changes.js +2 -1
  566. package/build-module/components/global-styles/get-global-styles-changes.js.map +1 -1
  567. package/build-module/components/global-styles/hooks.js.map +1 -1
  568. package/build-module/components/global-styles/image-settings-panel.js +1 -2
  569. package/build-module/components/global-styles/image-settings-panel.js.map +1 -1
  570. package/build-module/components/global-styles/shadow-panel-components.js +1 -2
  571. package/build-module/components/global-styles/shadow-panel-components.js.map +1 -1
  572. package/build-module/components/global-styles/typography-panel.js +1 -2
  573. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  574. package/build-module/components/global-styles/use-global-styles-context.native.js +6 -0
  575. package/build-module/components/global-styles/use-global-styles-context.native.js.map +1 -1
  576. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  577. package/build-module/components/global-styles/utils.js.map +1 -1
  578. package/build-module/components/gradients/use-gradient.js.map +1 -1
  579. package/build-module/components/grid/grid-item-movers.js +1 -3
  580. package/build-module/components/grid/grid-item-movers.js.map +1 -1
  581. package/build-module/components/grid/grid-visualizer.js.map +1 -1
  582. package/build-module/components/height-control/index.js +1 -2
  583. package/build-module/components/height-control/index.js.map +1 -1
  584. package/build-module/components/iframe/index.js +47 -14
  585. package/build-module/components/iframe/index.js.map +1 -1
  586. package/build-module/components/image-editor/aspect-ratio-dropdown.js +1 -3
  587. package/build-module/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
  588. package/build-module/components/image-editor/cropper.js +1 -3
  589. package/build-module/components/image-editor/cropper.js.map +1 -1
  590. package/build-module/components/image-editor/form-controls.js +1 -3
  591. package/build-module/components/image-editor/form-controls.js.map +1 -1
  592. package/build-module/components/image-editor/index.js +1 -2
  593. package/build-module/components/image-editor/index.js.map +1 -1
  594. package/build-module/components/image-editor/use-save-image.js +1 -1
  595. package/build-module/components/image-editor/use-save-image.js.map +1 -1
  596. package/build-module/components/image-link-destinations/index.native.js +1 -3
  597. package/build-module/components/image-link-destinations/index.native.js.map +1 -1
  598. package/build-module/components/image-size-control/index.js +63 -24
  599. package/build-module/components/image-size-control/index.js.map +1 -1
  600. package/build-module/components/inner-blocks/index.js +9 -5
  601. package/build-module/components/inner-blocks/index.js.map +1 -1
  602. package/build-module/components/inner-blocks/use-nested-settings-update.js +16 -9
  603. package/build-module/components/inner-blocks/use-nested-settings-update.js.map +1 -1
  604. package/build-module/components/inner-blocks/warning-max-depth-exceeded.native.js +1 -2
  605. package/build-module/components/inner-blocks/warning-max-depth-exceeded.native.js.map +1 -1
  606. package/build-module/components/inserter/block-patterns-explorer/index.js +1 -2
  607. package/build-module/components/inserter/block-patterns-explorer/index.js.map +1 -1
  608. package/build-module/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js +2 -3
  609. package/build-module/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js.map +1 -1
  610. package/build-module/components/inserter/block-patterns-explorer/pattern-list.js +3 -5
  611. package/build-module/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
  612. package/build-module/components/inserter/block-patterns-tab/index.js +1 -3
  613. package/build-module/components/inserter/block-patterns-tab/index.js.map +1 -1
  614. package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js +3 -5
  615. package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
  616. package/build-module/components/inserter/block-patterns-tab/patterns-filter.js +2 -4
  617. package/build-module/components/inserter/block-patterns-tab/patterns-filter.js.map +1 -1
  618. package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js +1 -1
  619. package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
  620. package/build-module/components/inserter/block-types-tab.js +1 -3
  621. package/build-module/components/inserter/block-types-tab.js.map +1 -1
  622. package/build-module/components/inserter/block-types-tab.native.js.map +1 -1
  623. package/build-module/components/inserter/category-tabs/index.js +18 -15
  624. package/build-module/components/inserter/category-tabs/index.js.map +1 -1
  625. package/build-module/components/inserter/hooks/use-block-types-state.js +1 -1
  626. package/build-module/components/inserter/hooks/use-block-types-state.js.map +1 -1
  627. package/build-module/components/inserter/hooks/use-patterns-state.js +1 -1
  628. package/build-module/components/inserter/hooks/use-patterns-state.js.map +1 -1
  629. package/build-module/components/inserter/index.native.js +1 -3
  630. package/build-module/components/inserter/index.native.js.map +1 -1
  631. package/build-module/components/inserter/media-tab/media-panel.js +1 -2
  632. package/build-module/components/inserter/media-tab/media-panel.js.map +1 -1
  633. package/build-module/components/inserter/media-tab/media-preview.js +2 -4
  634. package/build-module/components/inserter/media-tab/media-preview.js.map +1 -1
  635. package/build-module/components/inserter/media-tab/media-tab.js +1 -3
  636. package/build-module/components/inserter/media-tab/media-tab.js.map +1 -1
  637. package/build-module/components/inserter/media-tab/utils.js.map +1 -1
  638. package/build-module/components/inserter/menu.js +10 -7
  639. package/build-module/components/inserter/menu.js.map +1 -1
  640. package/build-module/components/inserter/menu.native.js +1 -3
  641. package/build-module/components/inserter/menu.native.js.map +1 -1
  642. package/build-module/components/inserter/mobile-tab-navigation.js +1 -2
  643. package/build-module/components/inserter/mobile-tab-navigation.js.map +1 -1
  644. package/build-module/components/inserter/no-results.js +1 -2
  645. package/build-module/components/inserter/no-results.js.map +1 -1
  646. package/build-module/components/inserter/no-results.native.js +1 -2
  647. package/build-module/components/inserter/no-results.native.js.map +1 -1
  648. package/build-module/components/inserter/panel.js +1 -3
  649. package/build-module/components/inserter/panel.js.map +1 -1
  650. package/build-module/components/inserter/preview-panel.js +1 -2
  651. package/build-module/components/inserter/preview-panel.js.map +1 -1
  652. package/build-module/components/inserter/quick-inserter.js +2 -3
  653. package/build-module/components/inserter/quick-inserter.js.map +1 -1
  654. package/build-module/components/inserter/search-results.js +2 -3
  655. package/build-module/components/inserter/search-results.js.map +1 -1
  656. package/build-module/components/inserter/tabs.native.js.map +1 -1
  657. package/build-module/components/inserter-button/index.native.js +2 -3
  658. package/build-module/components/inserter-button/index.native.js.map +1 -1
  659. package/build-module/components/inserter-list-item/index.js +1 -2
  660. package/build-module/components/inserter-list-item/index.js.map +1 -1
  661. package/build-module/components/inserter-listbox/index.js +1 -2
  662. package/build-module/components/inserter-listbox/index.js.map +1 -1
  663. package/build-module/components/inspector-controls/block-support-tools-panel.js.map +1 -1
  664. package/build-module/components/inspector-controls/fill.js.map +1 -1
  665. package/build-module/components/inspector-controls/fill.native.js +1 -3
  666. package/build-module/components/inspector-controls/fill.native.js.map +1 -1
  667. package/build-module/components/inspector-controls/slot.js.map +1 -1
  668. package/build-module/components/inspector-controls/slot.native.js.map +1 -1
  669. package/build-module/components/inspector-controls-tabs/index.js +1 -4
  670. package/build-module/components/inspector-controls-tabs/index.js.map +1 -1
  671. package/build-module/components/inspector-controls-tabs/settings-tab.js +1 -3
  672. package/build-module/components/inspector-controls-tabs/settings-tab.js.map +1 -1
  673. package/build-module/components/inspector-controls-tabs/styles-tab.js +1 -3
  674. package/build-module/components/inspector-controls-tabs/styles-tab.js.map +1 -1
  675. package/build-module/components/inspector-controls-tabs/utils.js +3 -6
  676. package/build-module/components/inspector-controls-tabs/utils.js.map +1 -1
  677. package/build-module/components/inspector-popover-header/index.js +1 -2
  678. package/build-module/components/inspector-popover-header/index.js.map +1 -1
  679. package/build-module/components/line-height-control/index.js.map +1 -1
  680. package/build-module/components/link-control/index.js +1 -3
  681. package/build-module/components/link-control/index.js.map +1 -1
  682. package/build-module/components/link-control/is-url-like.js.map +1 -1
  683. package/build-module/components/link-control/link-preview.js +14 -13
  684. package/build-module/components/link-control/link-preview.js.map +1 -1
  685. package/build-module/components/link-control/search-create-button.js +1 -1
  686. package/build-module/components/link-control/search-create-button.js.map +1 -1
  687. package/build-module/components/link-control/search-input.js +4 -7
  688. package/build-module/components/link-control/search-input.js.map +1 -1
  689. package/build-module/components/link-control/search-results.js +6 -17
  690. package/build-module/components/link-control/search-results.js.map +1 -1
  691. package/build-module/components/link-control/settings-drawer.js +1 -3
  692. package/build-module/components/link-control/settings-drawer.js.map +1 -1
  693. package/build-module/components/link-control/settings.js +1 -2
  694. package/build-module/components/link-control/settings.js.map +1 -1
  695. package/build-module/components/link-control/use-rich-url-data.js.map +1 -1
  696. package/build-module/components/list-view/appender.js +6 -6
  697. package/build-module/components/list-view/appender.js.map +1 -1
  698. package/build-module/components/list-view/block-contents.js +1 -3
  699. package/build-module/components/list-view/block-contents.js.map +1 -1
  700. package/build-module/components/list-view/block-select-button.js +1 -2
  701. package/build-module/components/list-view/block-select-button.js.map +1 -1
  702. package/build-module/components/list-view/block.js +1 -3
  703. package/build-module/components/list-view/block.js.map +1 -1
  704. package/build-module/components/list-view/branch.js +8 -9
  705. package/build-module/components/list-view/branch.js.map +1 -1
  706. package/build-module/components/list-view/drop-indicator.js +1 -2
  707. package/build-module/components/list-view/drop-indicator.js.map +1 -1
  708. package/build-module/components/list-view/index.js +2 -4
  709. package/build-module/components/list-view/index.js.map +1 -1
  710. package/build-module/components/list-view/use-block-selection.js +2 -2
  711. package/build-module/components/list-view/use-block-selection.js.map +1 -1
  712. package/build-module/components/list-view/utils.js +1 -1
  713. package/build-module/components/list-view/utils.js.map +1 -1
  714. package/build-module/components/media-placeholder/index.js +1 -3
  715. package/build-module/components/media-placeholder/index.js.map +1 -1
  716. package/build-module/components/media-placeholder/index.native.js +2 -4
  717. package/build-module/components/media-placeholder/index.native.js.map +1 -1
  718. package/build-module/components/media-replace-flow/index.js +1 -3
  719. package/build-module/components/media-replace-flow/index.js.map +1 -1
  720. package/build-module/components/media-upload/index.native.js +1 -3
  721. package/build-module/components/media-upload/index.native.js.map +1 -1
  722. package/build-module/components/media-upload-progress/index.native.js +1 -2
  723. package/build-module/components/media-upload-progress/index.native.js.map +1 -1
  724. package/build-module/components/multi-selection-inspector/index.js +3 -4
  725. package/build-module/components/multi-selection-inspector/index.js.map +1 -1
  726. package/build-module/components/observe-typing/index.js +1 -0
  727. package/build-module/components/observe-typing/index.js.map +1 -1
  728. package/build-module/components/provider/index.js +2 -3
  729. package/build-module/components/provider/index.js.map +1 -1
  730. package/build-module/components/publish-date-time-picker/index.js +1 -2
  731. package/build-module/components/publish-date-time-picker/index.js.map +1 -1
  732. package/build-module/components/recursion-provider/index.js +1 -0
  733. package/build-module/components/recursion-provider/index.js.map +1 -1
  734. package/build-module/components/responsive-block-control/index.js +4 -5
  735. package/build-module/components/responsive-block-control/index.js.map +1 -1
  736. package/build-module/components/responsive-block-control/label.js +2 -4
  737. package/build-module/components/responsive-block-control/label.js.map +1 -1
  738. package/build-module/components/rich-text/content.js.map +1 -1
  739. package/build-module/components/rich-text/event-listeners/before-input-rules.js +2 -2
  740. package/build-module/components/rich-text/event-listeners/before-input-rules.js.map +1 -1
  741. package/build-module/components/rich-text/event-listeners/delete.js +2 -2
  742. package/build-module/components/rich-text/event-listeners/delete.js.map +1 -1
  743. package/build-module/components/rich-text/event-listeners/enter.js +2 -2
  744. package/build-module/components/rich-text/event-listeners/enter.js.map +1 -1
  745. package/build-module/components/rich-text/event-listeners/firefox-compat.js +2 -2
  746. package/build-module/components/rich-text/event-listeners/firefox-compat.js.map +1 -1
  747. package/build-module/components/rich-text/event-listeners/index.js +4 -2
  748. package/build-module/components/rich-text/event-listeners/index.js.map +1 -1
  749. package/build-module/components/rich-text/event-listeners/input-events.js +2 -2
  750. package/build-module/components/rich-text/event-listeners/input-events.js.map +1 -1
  751. package/build-module/components/rich-text/event-listeners/input-rules.js +2 -2
  752. package/build-module/components/rich-text/event-listeners/input-rules.js.map +1 -1
  753. package/build-module/components/rich-text/event-listeners/insert-replacement-text.js +2 -2
  754. package/build-module/components/rich-text/event-listeners/insert-replacement-text.js.map +1 -1
  755. package/build-module/components/rich-text/event-listeners/paste-handler.js +2 -2
  756. package/build-module/components/rich-text/event-listeners/paste-handler.js.map +1 -1
  757. package/build-module/components/rich-text/event-listeners/remove-browser-shortcuts.js +2 -2
  758. package/build-module/components/rich-text/event-listeners/remove-browser-shortcuts.js.map +1 -1
  759. package/build-module/components/rich-text/event-listeners/shortcuts.js +2 -2
  760. package/build-module/components/rich-text/event-listeners/shortcuts.js.map +1 -1
  761. package/build-module/components/rich-text/event-listeners/undo-automatic-change.js +2 -2
  762. package/build-module/components/rich-text/event-listeners/undo-automatic-change.js.map +1 -1
  763. package/build-module/components/rich-text/file-paste-handler.native.js.map +1 -1
  764. package/build-module/components/rich-text/format-toolbar/index.js +1 -3
  765. package/build-module/components/rich-text/format-toolbar/index.js.map +1 -1
  766. package/build-module/components/rich-text/format-toolbar/index.native.js +1 -3
  767. package/build-module/components/rich-text/format-toolbar/index.native.js.map +1 -1
  768. package/build-module/components/rich-text/index.js +4 -5
  769. package/build-module/components/rich-text/index.js.map +1 -1
  770. package/build-module/components/rich-text/index.native.js +3 -9
  771. package/build-module/components/rich-text/index.native.js.map +1 -1
  772. package/build-module/components/rich-text/multiline.js.map +1 -1
  773. package/build-module/components/rich-text/native/get-format-colors.native.js.map +1 -1
  774. package/build-module/components/rich-text/native/index.js +1 -1
  775. package/build-module/components/rich-text/native/index.js.map +1 -1
  776. package/build-module/components/rich-text/native/index.native.js +1 -3
  777. package/build-module/components/rich-text/native/index.native.js.map +1 -1
  778. package/build-module/components/rich-text/native/toolbar-button-with-options.native.js +1 -3
  779. package/build-module/components/rich-text/native/toolbar-button-with-options.native.js.map +1 -1
  780. package/build-module/components/rich-text/native/use-format-types.js +1 -0
  781. package/build-module/components/rich-text/native/use-format-types.js.map +1 -1
  782. package/build-module/components/rich-text/toolbar-button.js.map +1 -1
  783. package/build-module/components/rich-text/use-format-types.js +1 -0
  784. package/build-module/components/rich-text/use-format-types.js.map +1 -1
  785. package/build-module/components/spacing-sizes-control/index.js +4 -5
  786. package/build-module/components/spacing-sizes-control/index.js.map +1 -1
  787. package/build-module/components/spacing-sizes-control/input-controls/axial.js +1 -2
  788. package/build-module/components/spacing-sizes-control/input-controls/axial.js.map +1 -1
  789. package/build-module/components/spacing-sizes-control/input-controls/separated.js +1 -2
  790. package/build-module/components/spacing-sizes-control/input-controls/separated.js.map +1 -1
  791. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js +5 -7
  792. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
  793. package/build-module/components/spacing-sizes-control/linked-button.js +2 -6
  794. package/build-module/components/spacing-sizes-control/linked-button.js.map +1 -1
  795. package/build-module/components/spacing-sizes-control/utils.js +1 -0
  796. package/build-module/components/spacing-sizes-control/utils.js.map +1 -1
  797. package/build-module/components/tabbed-sidebar/index.js +1 -2
  798. package/build-module/components/tabbed-sidebar/index.js.map +1 -1
  799. package/build-module/components/tool-selector/index.js +9 -8
  800. package/build-module/components/tool-selector/index.js.map +1 -1
  801. package/build-module/components/typewriter/index.js +1 -0
  802. package/build-module/components/typewriter/index.js.map +1 -1
  803. package/build-module/components/unsupported-block-details/index.native.js +1 -2
  804. package/build-module/components/unsupported-block-details/index.native.js.map +1 -1
  805. package/build-module/components/url-input/button.js +1 -2
  806. package/build-module/components/url-input/button.js.map +1 -1
  807. package/build-module/components/url-input/index.js +2 -4
  808. package/build-module/components/url-input/index.js.map +1 -1
  809. package/build-module/components/url-popover/image-url-input-ui.js +1 -3
  810. package/build-module/components/url-popover/image-url-input-ui.js.map +1 -1
  811. package/build-module/components/url-popover/index.js +1 -2
  812. package/build-module/components/url-popover/index.js.map +1 -1
  813. package/build-module/components/url-popover/link-editor.js +1 -2
  814. package/build-module/components/url-popover/link-editor.js.map +1 -1
  815. package/build-module/components/url-popover/link-viewer.js +1 -2
  816. package/build-module/components/url-popover/link-viewer.js.map +1 -1
  817. package/build-module/components/use-block-commands/index.js +1 -1
  818. package/build-module/components/use-block-commands/index.js.map +1 -1
  819. package/build-module/components/use-block-drop-zone/index.js +5 -5
  820. package/build-module/components/use-block-drop-zone/index.js.map +1 -1
  821. package/build-module/components/use-block-drop-zone/index.native.js +0 -1
  822. package/build-module/components/use-block-drop-zone/index.native.js.map +1 -1
  823. package/build-module/components/use-flash-editable-blocks/index.js.map +1 -1
  824. package/build-module/components/use-moving-animation/index.js +1 -3
  825. package/build-module/components/use-moving-animation/index.js.map +1 -1
  826. package/build-module/components/use-resize-canvas/index.js +1 -2
  827. package/build-module/components/use-resize-canvas/index.js.map +1 -1
  828. package/build-module/components/use-settings/index.js +1 -3
  829. package/build-module/components/use-settings/index.js.map +1 -1
  830. package/build-module/components/video-player/index.native.js +1 -2
  831. package/build-module/components/video-player/index.native.js.map +1 -1
  832. package/build-module/components/warning/index.js +1 -2
  833. package/build-module/components/warning/index.js.map +1 -1
  834. package/build-module/components/warning/index.native.js +1 -2
  835. package/build-module/components/warning/index.native.js.map +1 -1
  836. package/build-module/components/writing-flow/index.js +6 -6
  837. package/build-module/components/writing-flow/index.js.map +1 -1
  838. package/build-module/components/writing-flow/use-tab-nav.js +20 -5
  839. package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
  840. package/build-module/hooks/align.js.map +1 -1
  841. package/build-module/hooks/anchor.js +1 -3
  842. package/build-module/hooks/anchor.js.map +1 -1
  843. package/build-module/hooks/block-bindings.js +21 -12
  844. package/build-module/hooks/block-bindings.js.map +1 -1
  845. package/build-module/hooks/block-hooks.js +2 -3
  846. package/build-module/hooks/block-hooks.js.map +1 -1
  847. package/build-module/hooks/block-style-variation.js +1 -2
  848. package/build-module/hooks/block-style-variation.js.map +1 -1
  849. package/build-module/hooks/contrast-checker.js +0 -1
  850. package/build-module/hooks/contrast-checker.js.map +1 -1
  851. package/build-module/hooks/dimensions.js +1 -3
  852. package/build-module/hooks/dimensions.js.map +1 -1
  853. package/build-module/hooks/duotone.js +3 -5
  854. package/build-module/hooks/duotone.js.map +1 -1
  855. package/build-module/hooks/font-family.js.map +1 -1
  856. package/build-module/hooks/gap.js.map +1 -1
  857. package/build-module/hooks/generated-class-name.js +1 -0
  858. package/build-module/hooks/generated-class-name.js.map +1 -1
  859. package/build-module/hooks/grid-visualizer.js +14 -14
  860. package/build-module/hooks/grid-visualizer.js.map +1 -1
  861. package/build-module/hooks/layout-child.js +42 -6
  862. package/build-module/hooks/layout-child.js.map +1 -1
  863. package/build-module/hooks/layout.js +1 -3
  864. package/build-module/hooks/layout.js.map +1 -1
  865. package/build-module/hooks/position.js +1 -1
  866. package/build-module/hooks/position.js.map +1 -1
  867. package/build-module/hooks/spacing-visualizer.js.map +1 -1
  868. package/build-module/hooks/style.js +5 -4
  869. package/build-module/hooks/style.js.map +1 -1
  870. package/build-module/hooks/text-align.js.map +1 -1
  871. package/build-module/hooks/typography.native.js +1 -2
  872. package/build-module/hooks/typography.native.js.map +1 -1
  873. package/build-module/hooks/use-bindings-attributes.js +1 -2
  874. package/build-module/hooks/use-bindings-attributes.js.map +1 -1
  875. package/build-module/hooks/use-typography-props.js.map +1 -1
  876. package/build-module/hooks/use-zoom-out.js +18 -19
  877. package/build-module/hooks/use-zoom-out.js.map +1 -1
  878. package/build-module/index.js +1 -1
  879. package/build-module/index.js.map +1 -1
  880. package/build-module/layouts/constrained.js +1 -3
  881. package/build-module/layouts/constrained.js.map +1 -1
  882. package/build-module/layouts/flex.js +1 -3
  883. package/build-module/layouts/flex.js.map +1 -1
  884. package/build-module/layouts/grid.js +1 -3
  885. package/build-module/layouts/grid.js.map +1 -1
  886. package/build-module/layouts/utils.js.map +1 -1
  887. package/build-module/private-apis.js +7 -3
  888. package/build-module/private-apis.js.map +1 -1
  889. package/build-module/store/actions.js +6 -38
  890. package/build-module/store/actions.js.map +1 -1
  891. package/build-module/store/defaults.js +1 -1
  892. package/build-module/store/defaults.js.map +1 -1
  893. package/build-module/store/private-actions.js +54 -7
  894. package/build-module/store/private-actions.js.map +1 -1
  895. package/build-module/store/private-selectors.js +9 -20
  896. package/build-module/store/private-selectors.js.map +1 -1
  897. package/build-module/store/reducer.js +17 -22
  898. package/build-module/store/reducer.js.map +1 -1
  899. package/build-module/store/selectors.js +66 -20
  900. package/build-module/store/selectors.js.map +1 -1
  901. package/build-module/utils/block-bindings.js +9 -6
  902. package/build-module/utils/block-bindings.js.map +1 -1
  903. package/build-module/utils/dom.js +16 -1
  904. package/build-module/utils/dom.js.map +1 -1
  905. package/build-module/utils/get-font-styles-and-weights.js +3 -3
  906. package/build-module/utils/get-font-styles-and-weights.js.map +1 -1
  907. package/build-module/utils/get-px-from-css-unit.js +1 -1
  908. package/build-module/utils/get-px-from-css-unit.js.map +1 -1
  909. package/build-module/utils/object.js +1 -0
  910. package/build-module/utils/object.js.map +1 -1
  911. package/build-module/utils/pasting.js.map +1 -1
  912. package/build-module/utils/transform-styles/index.js +3 -2
  913. package/build-module/utils/transform-styles/index.js.map +1 -1
  914. package/build-style/content-rtl.css +19 -27
  915. package/build-style/content.css +19 -27
  916. package/build-style/style-rtl.css +47 -54
  917. package/build-style/style.css +47 -54
  918. package/build-types/utils/dom.d.ts.map +1 -1
  919. package/package.json +34 -33
  920. package/src/autocompleters/block.js +16 -7
  921. package/src/components/block-canvas/index.js +17 -1
  922. package/src/components/block-canvas/style.scss +1 -0
  923. package/src/components/block-card/index.js +3 -3
  924. package/src/components/block-full-height-alignment-control/index.js +1 -1
  925. package/src/components/block-inspector/style.scss +0 -6
  926. package/src/components/block-list/block.js +1 -2
  927. package/src/components/block-list/block.native.js +0 -4
  928. package/src/components/block-list/content.scss +4 -3
  929. package/src/components/block-list/index.js +4 -4
  930. package/src/components/block-list/use-block-props/index.js +0 -2
  931. package/src/components/block-list/use-block-props/use-focus-first-element.js +5 -3
  932. package/src/components/block-list/use-block-props/use-selected-block-event-handlers.js +12 -4
  933. package/src/components/block-list/use-in-between-inserter.js +1 -1
  934. package/src/components/block-list/zoom-out-separator.js +8 -6
  935. package/src/components/block-patterns-list/stories/fixtures.js +834 -0
  936. package/src/components/block-patterns-list/stories/index.story.js +81 -0
  937. package/src/components/block-patterns-list/style.scss +2 -0
  938. package/src/components/block-patterns-paging/index.js +1 -1
  939. package/src/components/block-popover/index.js +2 -2
  940. package/src/components/block-preview/auto.js +1 -4
  941. package/src/components/block-preview/index.js +2 -2
  942. package/src/components/block-settings-menu/block-settings-dropdown.js +4 -0
  943. package/src/components/block-settings-menu/index.js +3 -0
  944. package/src/components/block-toolbar/change-design.js +133 -0
  945. package/src/components/block-toolbar/index.js +25 -8
  946. package/src/components/block-toolbar/style.scss +16 -0
  947. package/src/components/block-tools/index.js +4 -28
  948. package/src/components/block-tools/insertion-point.js +4 -3
  949. package/src/components/block-tools/style.scss +0 -20
  950. package/src/components/block-tools/use-show-block-tools.js +2 -8
  951. package/src/components/block-tools/zoom-out-mode-inserters.js +25 -40
  952. package/src/components/block-variation-transforms/index.js +2 -2
  953. package/src/components/block-vertical-alignment-control/ui.js +11 -15
  954. package/src/components/border-radius-control/linked-button.js +9 -11
  955. package/src/components/collab/block-comment-icon-slot.js +12 -0
  956. package/src/components/collab/block-comment-icon-toolbar-slot.js +12 -0
  957. package/src/components/colors-gradients/use-multiple-origin-colors-and-gradients.js +7 -1
  958. package/src/components/convert-to-group-buttons/toolbar.js +4 -4
  959. package/src/components/global-styles/color-panel.js +2 -10
  960. package/src/components/global-styles/test/use-global-styles-context.native.js +1 -0
  961. package/src/components/global-styles/use-global-styles-context.native.js +6 -0
  962. package/src/components/iframe/content.scss +22 -32
  963. package/src/components/iframe/index.js +62 -15
  964. package/src/components/iframe/style.scss +17 -0
  965. package/src/components/image-size-control/index.js +74 -43
  966. package/src/components/image-size-control/test/index.js +5 -63
  967. package/src/components/inner-blocks/index.js +12 -6
  968. package/src/components/inner-blocks/use-nested-settings-update.js +16 -10
  969. package/src/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js +1 -1
  970. package/src/components/inserter/block-patterns-tab/pattern-category-previews.js +2 -3
  971. package/src/components/inserter/block-patterns-tab/patterns-filter.js +1 -1
  972. package/src/components/inserter/category-tabs/index.js +17 -13
  973. package/src/components/inserter/menu.js +12 -5
  974. package/src/components/inserter/quick-inserter.js +1 -1
  975. package/src/components/inserter/style.scss +14 -41
  976. package/src/components/inserter-button/index.native.js +1 -1
  977. package/src/components/inspector-controls-tabs/index.js +1 -6
  978. package/src/components/inspector-controls-tabs/utils.js +0 -3
  979. package/src/components/link-control/link-preview.js +15 -8
  980. package/src/components/link-control/search-input.js +4 -5
  981. package/src/components/link-control/search-results.js +2 -13
  982. package/src/components/link-control/test/index.js +147 -70
  983. package/src/components/list-view/appender.js +5 -6
  984. package/src/components/list-view/branch.js +8 -6
  985. package/src/components/list-view/index.js +1 -2
  986. package/src/components/media-replace-flow/test/index.js +1 -1
  987. package/src/components/provider/index.js +1 -3
  988. package/src/components/provider/test/experimental-provider.js +43 -1
  989. package/src/components/responsive-block-control/style.scss +0 -1
  990. package/src/components/rich-text/event-listeners/index.js +4 -2
  991. package/src/components/rich-text/index.native.js +0 -2
  992. package/src/components/rich-text/style.scss +5 -0
  993. package/src/components/spacing-sizes-control/index.js +3 -3
  994. package/src/components/spacing-sizes-control/input-controls/spacing-input-control.js +4 -4
  995. package/src/components/spacing-sizes-control/linked-button.js +2 -12
  996. package/src/components/tool-selector/index.js +6 -5
  997. package/src/components/url-input/index.js +1 -1
  998. package/src/components/use-block-commands/index.js +1 -1
  999. package/src/components/use-block-drop-zone/index.js +5 -5
  1000. package/src/components/use-block-drop-zone/index.native.js +0 -1
  1001. package/src/components/use-moving-animation/index.js +0 -1
  1002. package/src/components/use-resize-canvas/index.js +1 -3
  1003. package/src/components/use-settings/index.js +0 -1
  1004. package/src/components/writing-flow/index.js +5 -3
  1005. package/src/components/writing-flow/use-tab-nav.js +27 -4
  1006. package/src/hooks/block-bindings.js +48 -31
  1007. package/src/hooks/contrast-checker.js +0 -1
  1008. package/src/hooks/duotone.js +2 -2
  1009. package/src/hooks/grid-visualizer.js +23 -9
  1010. package/src/hooks/layout-child.js +48 -3
  1011. package/src/hooks/style.js +7 -3
  1012. package/src/hooks/use-zoom-out.js +20 -24
  1013. package/src/index.js +0 -1
  1014. package/src/private-apis.js +6 -1
  1015. package/src/store/actions.js +5 -53
  1016. package/src/store/defaults.js +2 -1
  1017. package/src/store/private-actions.js +71 -8
  1018. package/src/store/private-selectors.js +9 -19
  1019. package/src/store/reducer.js +25 -28
  1020. package/src/store/selectors.js +82 -20
  1021. package/src/store/test/actions.js +41 -0
  1022. package/src/store/test/private-selectors.js +7 -1
  1023. package/src/store/test/reducer.js +23 -0
  1024. package/src/store/test/selectors.js +13 -2
  1025. package/src/style.scss +1 -0
  1026. package/src/utils/block-bindings.js +9 -6
  1027. package/src/utils/dom.js +22 -2
  1028. package/src/utils/get-font-styles-and-weights.js +2 -2
  1029. package/src/utils/test/use-block-bindings-utils.js +174 -0
  1030. package/src/utils/transform-styles/index.js +3 -2
  1031. package/tsconfig.tsbuildinfo +1 -1
  1032. package/build/components/block-list/use-block-props/use-zoom-out-mode-exit.js +0 -57
  1033. package/build/components/block-list/use-block-props/use-zoom-out-mode-exit.js.map +0 -1
  1034. package/build/components/block-toolbar/shuffle.js +0 -110
  1035. package/build/components/block-toolbar/shuffle.js.map +0 -1
  1036. package/build/components/block-tools/zoom-out-popover.js +0 -57
  1037. package/build/components/block-tools/zoom-out-popover.js.map +0 -1
  1038. package/build/components/block-tools/zoom-out-toolbar.js +0 -149
  1039. package/build/components/block-tools/zoom-out-toolbar.js.map +0 -1
  1040. package/build/components/block-vertical-alignment-control/icons.js +0 -48
  1041. package/build/components/block-vertical-alignment-control/icons.js.map +0 -1
  1042. package/build-module/components/block-list/use-block-props/use-zoom-out-mode-exit.js +0 -51
  1043. package/build-module/components/block-list/use-block-props/use-zoom-out-mode-exit.js.map +0 -1
  1044. package/build-module/components/block-toolbar/shuffle.js +0 -103
  1045. package/build-module/components/block-toolbar/shuffle.js.map +0 -1
  1046. package/build-module/components/block-tools/zoom-out-popover.js +0 -48
  1047. package/build-module/components/block-tools/zoom-out-popover.js.map +0 -1
  1048. package/build-module/components/block-tools/zoom-out-toolbar.js +0 -142
  1049. package/build-module/components/block-tools/zoom-out-toolbar.js.map +0 -1
  1050. package/build-module/components/block-vertical-alignment-control/icons.js +0 -41
  1051. package/build-module/components/block-vertical-alignment-control/icons.js.map +0 -1
  1052. package/src/components/block-list/use-block-props/use-zoom-out-mode-exit.js +0 -65
  1053. package/src/components/block-toolbar/shuffle.js +0 -111
  1054. package/src/components/block-tools/zoom-out-popover.js +0 -46
  1055. package/src/components/block-tools/zoom-out-toolbar.js +0 -156
  1056. package/src/components/block-vertical-alignment-control/icons.js +0 -34
@@ -1 +1 @@
1
- {"version":3,"names":["useCallback","useMemo","useSelect","useDispatch","useBlockEditContext","useSettings","store","blockEditorStore","__experimentalGetGradientClass","gradientSlug","undefined","getGradientValueBySlug","gradients","slug","gradient","find","g","__experimentalGetGradientObjectByGradientValue","value","getGradientSlugByValue","__experimentalUseGradient","gradientAttribute","customGradientAttribute","clientId","userGradientPalette","themeGradientPalette","defaultGradientPalette","allGradients","customGradient","select","getBlockAttributes","attributes","updateBlockAttributes","setGradient","newGradientValue","gradientClass","gradientValue"],"sources":["@wordpress/block-editor/src/components/gradients/use-gradient.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useCallback, useMemo } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { useBlockEditContext } from '../block-edit';\nimport { useSettings } from '../use-settings';\nimport { store as blockEditorStore } from '../../store';\n\nexport function __experimentalGetGradientClass( gradientSlug ) {\n\tif ( ! gradientSlug ) {\n\t\treturn undefined;\n\t}\n\treturn `has-${ gradientSlug }-gradient-background`;\n}\n\n/**\n * Retrieves the gradient value per slug.\n *\n * @param {Array} gradients Gradient Palette\n * @param {string} slug Gradient slug\n *\n * @return {string} Gradient value.\n */\nexport function getGradientValueBySlug( gradients, slug ) {\n\tconst gradient = gradients?.find( ( g ) => g.slug === slug );\n\treturn gradient && gradient.gradient;\n}\n\nexport function __experimentalGetGradientObjectByGradientValue(\n\tgradients,\n\tvalue\n) {\n\tconst gradient = gradients?.find( ( g ) => g.gradient === value );\n\treturn gradient;\n}\n\n/**\n * Retrieves the gradient slug per slug.\n *\n * @param {Array} gradients Gradient Palette\n * @param {string} value Gradient value\n * @return {string} Gradient slug.\n */\nexport function getGradientSlugByValue( gradients, value ) {\n\tconst gradient = __experimentalGetGradientObjectByGradientValue(\n\t\tgradients,\n\t\tvalue\n\t);\n\treturn gradient && gradient.slug;\n}\n\nexport function __experimentalUseGradient( {\n\tgradientAttribute = 'gradient',\n\tcustomGradientAttribute = 'customGradient',\n} = {} ) {\n\tconst { clientId } = useBlockEditContext();\n\n\tconst [\n\t\tuserGradientPalette,\n\t\tthemeGradientPalette,\n\t\tdefaultGradientPalette,\n\t] = useSettings(\n\t\t'color.gradients.custom',\n\t\t'color.gradients.theme',\n\t\t'color.gradients.default'\n\t);\n\tconst allGradients = useMemo(\n\t\t() => [\n\t\t\t...( userGradientPalette || [] ),\n\t\t\t...( themeGradientPalette || [] ),\n\t\t\t...( defaultGradientPalette || [] ),\n\t\t],\n\t\t[ userGradientPalette, themeGradientPalette, defaultGradientPalette ]\n\t);\n\tconst { gradient, customGradient } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockAttributes } = select( blockEditorStore );\n\t\t\tconst attributes = getBlockAttributes( clientId ) || {};\n\t\t\treturn {\n\t\t\t\tcustomGradient: attributes[ customGradientAttribute ],\n\t\t\t\tgradient: attributes[ gradientAttribute ],\n\t\t\t};\n\t\t},\n\t\t[ clientId, gradientAttribute, customGradientAttribute ]\n\t);\n\n\tconst { updateBlockAttributes } = useDispatch( blockEditorStore );\n\tconst setGradient = useCallback(\n\t\t( newGradientValue ) => {\n\t\t\tconst slug = getGradientSlugByValue(\n\t\t\t\tallGradients,\n\t\t\t\tnewGradientValue\n\t\t\t);\n\t\t\tif ( slug ) {\n\t\t\t\tupdateBlockAttributes( clientId, {\n\t\t\t\t\t[ gradientAttribute ]: slug,\n\t\t\t\t\t[ customGradientAttribute ]: undefined,\n\t\t\t\t} );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tupdateBlockAttributes( clientId, {\n\t\t\t\t[ gradientAttribute ]: undefined,\n\t\t\t\t[ customGradientAttribute ]: newGradientValue,\n\t\t\t} );\n\t\t},\n\t\t[ allGradients, clientId, updateBlockAttributes ]\n\t);\n\n\tconst gradientClass = __experimentalGetGradientClass( gradient );\n\tlet gradientValue;\n\tif ( gradient ) {\n\t\tgradientValue = getGradientValueBySlug( allGradients, gradient );\n\t} else {\n\t\tgradientValue = customGradient;\n\t}\n\treturn { gradientClass, gradientValue, setGradient };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAW,EAAEC,OAAO,QAAQ,oBAAoB;AACzD,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;;AAExD;AACA;AACA;AACA,SAASC,mBAAmB,QAAQ,eAAe;AACnD,SAASC,WAAW,QAAQ,iBAAiB;AAC7C,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;AAEvD,OAAO,SAASC,8BAA8BA,CAAEC,YAAY,EAAG;EAC9D,IAAK,CAAEA,YAAY,EAAG;IACrB,OAAOC,SAAS;EACjB;EACA,OAAQ,OAAOD,YAAc,sBAAqB;AACnD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASE,sBAAsBA,CAAEC,SAAS,EAAEC,IAAI,EAAG;EACzD,MAAMC,QAAQ,GAAGF,SAAS,EAAEG,IAAI,CAAIC,CAAC,IAAMA,CAAC,CAACH,IAAI,KAAKA,IAAK,CAAC;EAC5D,OAAOC,QAAQ,IAAIA,QAAQ,CAACA,QAAQ;AACrC;AAEA,OAAO,SAASG,8CAA8CA,CAC7DL,SAAS,EACTM,KAAK,EACJ;EACD,MAAMJ,QAAQ,GAAGF,SAAS,EAAEG,IAAI,CAAIC,CAAC,IAAMA,CAAC,CAACF,QAAQ,KAAKI,KAAM,CAAC;EACjE,OAAOJ,QAAQ;AAChB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASK,sBAAsBA,CAAEP,SAAS,EAAEM,KAAK,EAAG;EAC1D,MAAMJ,QAAQ,GAAGG,8CAA8C,CAC9DL,SAAS,EACTM,KACD,CAAC;EACD,OAAOJ,QAAQ,IAA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EAAE;QAChC,CAAEF,iBAAiB,GAAIR,IAAI;QAC3B,CAAES,uBAAuB,GAAIZ;MAC9B,CAAE,CAAC;MACH;IACD;IACAsB,qBAAqB,CAAET,QAAQ,EAAE;MAChC,CAAEF,iBAAiB,GAAIX,SAAS;MAChC,CAAEY,uBAAuB,GAAIY;IAC9B,CAAE,CAAC;EACJ,CAAC,EACD,CAAEP,YAAY,EAAEJ,QAAQ,EAAES,qBAAqB,CAChD,CAAC;EAED,MAAMG,aAAa,GAAG3B,8BAA8B,CAAEM,QAAS,CAAC;EAChE,IAAIsB,aAAa;EACjB,IAAKtB,QAAQ,EAAG;IACfsB,aAAa,GAAGzB,sBAAsB,CAAEgB,YAAY,EAAEb,QAAS,CAAC;EACjE,CAAC,MAAM;IACNsB,aAAa,GAAGR,cAAc;EAC/B;EACA,OAAO;IAAEO,aAAa;IAAEC,aAAa;IAAEH;EAAY,CAAC;AACrD","ignoreList":[]}
1
+ {"version":3,"names":["useCallback","useMemo","useSelect","useDispatch","useBlockEditContext","useSettings","store","blockEditorStore","__experimentalGetGradientClass","gradientSlug","undefined","getGradientValueBySlug","gradients","slug","gradient","find","g","__experimentalGetGradientObjectByGradientValue","value","getGradientSlugByValue","__experimentalUseGradient","gradientAttribute","customGradientAttribute","clientId","userGradientPalette","themeGradientPalette","defaultGradientPalette","allGradients","customGradient","select","getBlockAttributes","attributes","updateBlockAttributes","setGradient","newGradientValue","gradientClass","gradientValue"],"sources":["@wordpress/block-editor/src/components/gradients/use-gradient.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useCallback, useMemo } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { useBlockEditContext } from '../block-edit';\nimport { useSettings } from '../use-settings';\nimport { store as blockEditorStore } from '../../store';\n\nexport function __experimentalGetGradientClass( gradientSlug ) {\n\tif ( ! gradientSlug ) {\n\t\treturn undefined;\n\t}\n\treturn `has-${ gradientSlug }-gradient-background`;\n}\n\n/**\n * Retrieves the gradient value per slug.\n *\n * @param {Array} gradients Gradient Palette\n * @param {string} slug Gradient slug\n *\n * @return {string} Gradient value.\n */\nexport function getGradientValueBySlug( gradients, slug ) {\n\tconst gradient = gradients?.find( ( g ) => g.slug === slug );\n\treturn gradient && gradient.gradient;\n}\n\nexport function __experimentalGetGradientObjectByGradientValue(\n\tgradients,\n\tvalue\n) {\n\tconst gradient = gradients?.find( ( g ) => g.gradient === value );\n\treturn gradient;\n}\n\n/**\n * Retrieves the gradient slug per slug.\n *\n * @param {Array} gradients Gradient Palette\n * @param {string} value Gradient value\n * @return {string} Gradient slug.\n */\nexport function getGradientSlugByValue( gradients, value ) {\n\tconst gradient = __experimentalGetGradientObjectByGradientValue(\n\t\tgradients,\n\t\tvalue\n\t);\n\treturn gradient && gradient.slug;\n}\n\nexport function __experimentalUseGradient( {\n\tgradientAttribute = 'gradient',\n\tcustomGradientAttribute = 'customGradient',\n} = {} ) {\n\tconst { clientId } = useBlockEditContext();\n\n\tconst [\n\t\tuserGradientPalette,\n\t\tthemeGradientPalette,\n\t\tdefaultGradientPalette,\n\t] = useSettings(\n\t\t'color.gradients.custom',\n\t\t'color.gradients.theme',\n\t\t'color.gradients.default'\n\t);\n\tconst allGradients = useMemo(\n\t\t() => [\n\t\t\t...( userGradientPalette || [] ),\n\t\t\t...( themeGradientPalette || [] ),\n\t\t\t...( defaultGradientPalette || [] ),\n\t\t],\n\t\t[ userGradientPalette, themeGradientPalette, defaultGradientPalette ]\n\t);\n\tconst { gradient, customGradient } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockAttributes } = select( blockEditorStore );\n\t\t\tconst attributes = getBlockAttributes( clientId ) || {};\n\t\t\treturn {\n\t\t\t\tcustomGradient: attributes[ customGradientAttribute ],\n\t\t\t\tgradient: attributes[ gradientAttribute ],\n\t\t\t};\n\t\t},\n\t\t[ clientId, gradientAttribute, customGradientAttribute ]\n\t);\n\n\tconst { updateBlockAttributes } = useDispatch( blockEditorStore );\n\tconst setGradient = useCallback(\n\t\t( newGradientValue ) => {\n\t\t\tconst slug = getGradientSlugByValue(\n\t\t\t\tallGradients,\n\t\t\t\tnewGradientValue\n\t\t\t);\n\t\t\tif ( slug ) {\n\t\t\t\tupdateBlockAttributes( clientId, {\n\t\t\t\t\t[ gradientAttribute ]: slug,\n\t\t\t\t\t[ customGradientAttribute ]: undefined,\n\t\t\t\t} );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tupdateBlockAttributes( clientId, {\n\t\t\t\t[ gradientAttribute ]: undefined,\n\t\t\t\t[ customGradientAttribute ]: newGradientValue,\n\t\t\t} );\n\t\t},\n\t\t[ allGradients, clientId, updateBlockAttributes ]\n\t);\n\n\tconst gradientClass = __experimentalGetGradientClass( gradient );\n\tlet gradientValue;\n\tif ( gradient ) {\n\t\tgradientValue = getGradientValueBySlug( allGradients, gradient );\n\t} else {\n\t\tgradientValue = customGradient;\n\t}\n\treturn { gradientClass, gradientValue, setGradient };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAW,EAAEC,OAAO,QAAQ,oBAAoB;AACzD,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;;AAExD;AACA;AACA;AACA,SAASC,mBAAmB,QAAQ,eAAe;AACnD,SAASC,WAAW,QAAQ,iBAAiB;AAC7C,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;AAEvD,OAAO,SAASC,8BAA8BA,CAAEC,YAAY,EAAG;EAC9D,IAAK,CAAEA,YAAY,EAAG;IACrB,OAAOC,SAAS;EACjB;EACA,OAAO,OAAQD,YAAY,sBAAuB;AACnD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASE,sBAAsBA,CAAEC,SAAS,EAAEC,IAAI,EAAG;EACzD,MAAMC,QAAQ,GAAGF,SAAS,EAAEG,IAAI,CAAIC,CAAC,IAAMA,CAAC,CAACH,IAAI,KAAKA,IAAK,CAAC;EAC5D,OAAOC,QAA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,cAAc,EAAEG,UAAU,CAAET,uBAAuB,CAAE;MACrDR,QAAQ,EAAEiB,UAAU,CAAEV,iBAAiB;IACxC,CAAC;EACF,CAAC,EACD,CAAEE,QAAQ,EAAEF,iBAAiB,EAAEC,uBAAuB,CACvD,CAAC;EAED,MAAM;IAAEU;EAAsB,CAAC,GAAG7B,WAAW,CAAEI,gBAAiB,CAAC;EACjE,MAAM0B,WAAW,GAAGjC,WAAW,CAC5BkC,gBAAgB,IAAM;IACvB,MAAMrB,IAAI,GAAGM,sBAAsB,CAClCQ,YAAY,EACZO,gBACD,CAAC;IACD,IAAKrB,IAAI,EAAG;MACXmB,qBAAqB,CAAET,QAAQ,EAAE;QAChC,CAAEF,iBAAiB,GAAIR,IAAI;QAC3B,CAAES,uBAAuB,GAAIZ;MAC9B,CAAE,CAAC;MACH;IACD;IACAsB,qBAAqB,CAAET,QAAQ,EAAE;MAChC,CAAEF,iBAAiB,GAAIX,SAAS;MAChC,CAAEY,uBAAuB,GAAIY;IAC9B,CAAE,CAAC;EACJ,CAAC,EACD,CAAEP,YAAY,EAAEJ,QAAQ,EAAES,qBAAqB,CAChD,CAAC;EAED,MAAMG,aAAa,GAAG3B,8BAA8B,CAAEM,QAAS,CAAC;EAChE,IAAIsB,aAAa;EACjB,IAAKtB,QAAQ,EAAG;IACfsB,aAAa,GAAGzB,sBAAsB,CAAEgB,YAAY,EAAEb,QAAS,CAAC;EACjE,CAAC,MAAM;IACNsB,aAAa,GAAGR,cAAc;EAC/B;EACA,OAAO;IAAEO,aAAa;IAAEC,aAAa;IAAEH;EAAY,CAAC;AACrD","ignoreList":[]}
@@ -18,9 +18,7 @@ import { useInstanceId } from '@wordpress/compose';
18
18
  import BlockControls from '../block-controls';
19
19
  import { useGetNumberOfBlocksBeforeCell } from './use-get-number-of-blocks-before-cell';
20
20
  import { store as blockEditorStore } from '../../store';
21
- import { jsx as _jsx } from "react/jsx-runtime";
22
- import { jsxs as _jsxs } from "react/jsx-runtime";
23
- import { Fragment as _Fragment } from "react/jsx-runtime";
21
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
24
22
  export function GridItemMovers({
25
23
  layout,
26
24
  parentLayout,
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","__","isRTL","VisuallyHidden","ToolbarButton","ToolbarGroup","chevronLeft","chevronUp","chevronDown","chevronRight","useDispatch","useInstanceId","BlockControls","useGetNumberOfBlocksBeforeCell","store","blockEditorStore","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","GridItemMovers","layout","parentLayout","onChange","gridClientId","blockClientId","_layout$columnStart","_layout$rowStart","_layout$columnSpan","_layout$rowSpan","moveBlocksToPosition","__unstableMarkNextChangeAsNotPersistent","columnStart","rowStart","columnSpan","rowSpan","columnEnd","rowEnd","columnCount","rowCount","getNumberOfBlocksBeforeCell","group","children","className","GridItemMover","icon","label","description","isDisabled","onClick","instanceId","descriptionId","disabled","accessibleWhenDisabled","id"],"sources":["@wordpress/block-editor/src/components/grid/grid-item-movers.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __, isRTL } from '@wordpress/i18n';\nimport {\n\tVisuallyHidden,\n\tToolbarButton,\n\tToolbarGroup,\n} from '@wordpress/components';\nimport {\n\tchevronLeft,\n\tchevronUp,\n\tchevronDown,\n\tchevronRight,\n} from '@wordpress/icons';\nimport { useDispatch } from '@wordpress/data';\nimport { useInstanceId } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport BlockControls from '../block-controls';\nimport { useGetNumberOfBlocksBeforeCell } from './use-get-number-of-blocks-before-cell';\nimport { store as blockEditorStore } from '../../store';\n\nexport function GridItemMovers( {\n\tlayout,\n\tparentLayout,\n\tonChange,\n\tgridClientId,\n\tblockClientId,\n} ) {\n\tconst { moveBlocksToPosition, __unstableMarkNextChangeAsNotPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\n\tconst columnStart = layout?.columnStart ?? 1;\n\tconst rowStart = layout?.rowStart ?? 1;\n\tconst columnSpan = layout?.columnSpan ?? 1;\n\tconst rowSpan = layout?.rowSpan ?? 1;\n\tconst columnEnd = columnStart + columnSpan - 1;\n\tconst rowEnd = rowStart + rowSpan - 1;\n\tconst columnCount = parentLayout?.columnCount;\n\tconst rowCount = parentLayout?.rowCount;\n\n\tconst getNumberOfBlocksBeforeCell = useGetNumberOfBlocksBeforeCell(\n\t\tgridClientId,\n\t\tcolumnCount\n\t);\n\n\treturn (\n\t\t<BlockControls group=\"parent\">\n\t\t\t<ToolbarGroup className=\"block-editor-grid-item-mover__move-button-container\">\n\t\t\t\t<div className=\"block-editor-grid-item-mover__move-horizontal-button-container is-left\">\n\t\t\t\t\t<GridItemMover\n\t\t\t\t\t\ticon={ isRTL() ? chevronRight : chevronLeft }\n\t\t\t\t\t\tlabel={ __( 'Move left' ) }\n\t\t\t\t\t\tdescription={ __( 'Move left' ) }\n\t\t\t\t\t\tisDisabled={ columnStart <= 1 }\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\t\tcolumnStart: columnStart - 1,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\t\t\t\t\tmoveBlocksToPosition(\n\t\t\t\t\t\t\t\t[ blockClientId ],\n\t\t\t\t\t\t\t\tgridClientId,\n\t\t\t\t\t\t\t\tgridClientId,\n\t\t\t\t\t\t\t\tgetNumberOfBlocksBeforeCell(\n\t\t\t\t\t\t\t\t\tcolumnStart - 1,\n\t\t\t\t\t\t\t\t\trowStart\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t\t<div className=\"block-editor-grid-item-mover__move-vertical-button-container\">\n\t\t\t\t\t<GridItemMover\n\t\t\t\t\t\tclassName=\"is-up-button\"\n\t\t\t\t\t\ticon={ chevronUp }\n\t\t\t\t\t\tlabel={ __( 'Move up' ) }\n\t\t\t\t\t\tdescription={ __( 'Move up' ) }\n\t\t\t\t\t\tisDisabled={ rowStart <= 1 }\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\t\trowStart: rowStart - 1,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\t\t\t\t\tmoveBlocksToPosition(\n\t\t\t\t\t\t\t\t[ blockClientId ],\n\t\t\t\t\t\t\t\tgridClientId,\n\t\t\t\t\t\t\t\tgridClientId,\n\t\t\t\t\t\t\t\tgetNumberOfBlocksBeforeCell(\n\t\t\t\t\t\t\t\t\tcolumnStart,\n\t\t\t\t\t\t\t\t\trowStart - 1\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t\t<GridItemMover\n\t\t\t\t\t\tclassName=\"is-down-button\"\n\t\t\t\t\t\ticon={ chevronDown }\n\t\t\t\t\t\tlabel={ __( 'Move down' ) }\n\t\t\t\t\t\tdescription={ __( 'Move down' ) }\n\t\t\t\t\t\tisDisabled={ rowCount && rowEnd >= rowCount }\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\t\trowStart: rowStart + 1,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\t\t\t\t\tmoveBlocksToPosition(\n\t\t\t\t\t\t\t\t[ blockClientId ],\n\t\t\t\t\t\t\t\tgridClientId,\n\t\t\t\t\t\t\t\tgridClientId,\n\t\t\t\t\t\t\t\tgetNumberOfBlocksBeforeCell(\n\t\t\t\t\t\t\t\t\tcolumnStart,\n\t\t\t\t\t\t\t\t\trowStart + 1\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t\t<div className=\"block-editor-grid-item-mover__move-horizontal-button-container is-right\">\n\t\t\t\t\t<GridItemMover\n\t\t\t\t\t\ticon={ isRTL() ? chevronLeft : chevronRight }\n\t\t\t\t\t\tlabel={ __( 'Move right' ) }\n\t\t\t\t\t\tdescription={ __( 'Move right' ) }\n\t\t\t\t\t\tisDisabled={ columnCount && columnEnd >= columnCount }\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\t\tcolumnStart: columnStart + 1,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\t\t\t\t\tmoveBlocksToPosition(\n\t\t\t\t\t\t\t\t[ blockClientId ],\n\t\t\t\t\t\t\t\tgridClientId,\n\t\t\t\t\t\t\t\tgridClientId,\n\t\t\t\t\t\t\t\tgetNumberOfBlocksBeforeCell(\n\t\t\t\t\t\t\t\t\tcolumnStart + 1,\n\t\t\t\t\t\t\t\t\trowStart\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t</ToolbarGroup>\n\t\t</BlockControls>\n\t);\n}\n\nfunction GridItemMover( {\n\tclassName,\n\ticon,\n\tlabel,\n\tisDisabled,\n\tonClick,\n\tdescription,\n} ) {\n\tconst instanceId = useInstanceId( GridItemMover );\n\tconst descriptionId = `block-editor-grid-item-mover-button__description-${ instanceId }`;\n\treturn (\n\t\t<>\n\t\t\t<ToolbarButton\n\t\t\t\tclassName={ clsx(\n\t\t\t\t\t'block-editor-grid-item-mover-button',\n\t\t\t\t\tclassName\n\t\t\t\t) }\n\t\t\t\ticon={ icon }\n\t\t\t\tlabel={ label }\n\t\t\t\taria-describedby={ descriptionId }\n\t\t\t\tonClick={ isDisabled ? null : onClick }\n\t\t\t\tdisabled={ isDisabled }\n\t\t\t\taccessibleWh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AW,IAAIF,SAAS,IAAIE,WAAa;UACtDW,OAAO,EAAGA,CAAA,KAAM;YACf1B,QAAQ,CAAE;cACTS,WAAW,EAAEA,WAAW,GAAG;YAC5B,CAAE,CAAC;YACHD,uCAAuC,CAAC,CAAC;YACzCD,oBAAoB,CACnB,CAAEL,aAAa,CAAE,EACjBD,YAAY,EACZA,YAAY,EACZgB,2BAA2B,CAC1BR,WAAW,GAAG,CAAC,EACfC,QACD,CACD,CAAC;UACF;QAAG,CACH;MAAC,CACE,CAAC;IAAA,CACO;EAAC,CACD,CAAC;AAElB;AAEA,SAASW,aAAaA,CAAE;EACvBD,SAAS;EACTE,IAAI;EACJC,KAAK;EACLE,UAAU;EACVC,OAAO;EACPF;AACD,CAAC,EAAG;EACH,MAAMG,UAAU,GAAGzC,aAAa,CAAEmC,aAAc,CAAC;EACjD,MAAMO,aAAa,GAAI,oDAAoDD,UAAY,EAAC;EACxF,oBACCjC,KAAA,CAAAE,SAAA;IAAAuB,QAAA,gBACC3B,IAAA,CAACb,aAAa;MACbyC,SAAS,EAAG7C,IAAI,CACf,qCAAqC,EACrC6C,SACD,CAAG;MACHE,IAAI,EAAGA,IAAM;MACbC,KAAK,EAAGA,KAAO;MACf,oBAAmBK,aAAe;MAClCF,OAAO,EAAGD,UAAU,GAAG,IAAI,GAAGC,OAAS;MACvCG,QAAQ,EAAGJ,UAAY;MACvBK,sBAAsB;IAAA,CACtB,CAAC,eACFtC,IAAA,CAACd,cAAc;MAACqD,EAAE,EAAGH,aAAe;MAAAT,QAAA,EACjCK;IAAW,CACE,CAAC;EAAA,CAChB,CAAC;AAEL","ignoreList":[]}
1
+ {"version":3,"names":["clsx","__","isRTL","VisuallyHidden","ToolbarButton","ToolbarGroup","chevronLeft","chevronUp","chevronDown","chevronRight","useDispatch","useInstanceId","BlockControls","useGetNumberOfBlocksBeforeCell","store","blockEditorStore","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","GridItemMovers","layout","parentLayout","onChange","gridClientId","blockClientId","_layout$columnStart","_layout$rowStart","_layout$columnSpan","_layout$rowSpan","moveBlocksToPosition","__unstableMarkNextChangeAsNotPersistent","columnStart","rowStart","columnSpan","rowSpan","columnEnd","rowEnd","columnCount","rowCount","getNumberOfBlocksBeforeCell","group","children","className","GridItemMover","icon","label","description","isDisabled","onClick","instanceId","descriptionId","disabled","accessibleWhenDisabled","id"],"sources":["@wordpress/block-editor/src/components/grid/grid-item-movers.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __, isRTL } from '@wordpress/i18n';\nimport {\n\tVisuallyHidden,\n\tToolbarButton,\n\tToolbarGroup,\n} from '@wordpress/components';\nimport {\n\tchevronLeft,\n\tchevronUp,\n\tchevronDown,\n\tchevronRight,\n} from '@wordpress/icons';\nimport { useDispatch } from '@wordpress/data';\nimport { useInstanceId } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport BlockControls from '../block-controls';\nimport { useGetNumberOfBlocksBeforeCell } from './use-get-number-of-blocks-before-cell';\nimport { store as blockEditorStore } from '../../store';\n\nexport function GridItemMovers( {\n\tlayout,\n\tparentLayout,\n\tonChange,\n\tgridClientId,\n\tblockClientId,\n} ) {\n\tconst { moveBlocksToPosition, __unstableMarkNextChangeAsNotPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\n\tconst columnStart = layout?.columnStart ?? 1;\n\tconst rowStart = layout?.rowStart ?? 1;\n\tconst columnSpan = layout?.columnSpan ?? 1;\n\tconst rowSpan = layout?.rowSpan ?? 1;\n\tconst columnEnd = columnStart + columnSpan - 1;\n\tconst rowEnd = rowStart + rowSpan - 1;\n\tconst columnCount = parentLayout?.columnCount;\n\tconst rowCount = parentLayout?.rowCount;\n\n\tconst getNumberOfBlocksBeforeCell = useGetNumberOfBlocksBeforeCell(\n\t\tgridClientId,\n\t\tcolumnCount\n\t);\n\n\treturn (\n\t\t<BlockControls group=\"parent\">\n\t\t\t<ToolbarGroup className=\"block-editor-grid-item-mover__move-button-container\">\n\t\t\t\t<div className=\"block-editor-grid-item-mover__move-horizontal-button-container is-left\">\n\t\t\t\t\t<GridItemMover\n\t\t\t\t\t\ticon={ isRTL() ? chevronRight : chevronLeft }\n\t\t\t\t\t\tlabel={ __( 'Move left' ) }\n\t\t\t\t\t\tdescription={ __( 'Move left' ) }\n\t\t\t\t\t\tisDisabled={ columnStart <= 1 }\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\t\tcolumnStart: columnStart - 1,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\t\t\t\t\tmoveBlocksToPosition(\n\t\t\t\t\t\t\t\t[ blockClientId ],\n\t\t\t\t\t\t\t\tgridClientId,\n\t\t\t\t\t\t\t\tgridClientId,\n\t\t\t\t\t\t\t\tgetNumberOfBlocksBeforeCell(\n\t\t\t\t\t\t\t\t\tcolumnStart - 1,\n\t\t\t\t\t\t\t\t\trowStart\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t\t<div className=\"block-editor-grid-item-mover__move-vertical-button-container\">\n\t\t\t\t\t<GridItemMover\n\t\t\t\t\t\tclassName=\"is-up-button\"\n\t\t\t\t\t\ticon={ chevronUp }\n\t\t\t\t\t\tlabel={ __( 'Move up' ) }\n\t\t\t\t\t\tdescription={ __( 'Move up' ) }\n\t\t\t\t\t\tisDisabled={ rowStart <= 1 }\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\t\trowStart: rowStart - 1,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\t\t\t\t\tmoveBlocksToPosition(\n\t\t\t\t\t\t\t\t[ blockClientId ],\n\t\t\t\t\t\t\t\tgridClientId,\n\t\t\t\t\t\t\t\tgridClientId,\n\t\t\t\t\t\t\t\tgetNumberOfBlocksBeforeCell(\n\t\t\t\t\t\t\t\t\tcolumnStart,\n\t\t\t\t\t\t\t\t\trowStart - 1\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t\t<GridItemMover\n\t\t\t\t\t\tclassName=\"is-down-button\"\n\t\t\t\t\t\ticon={ chevronDown }\n\t\t\t\t\t\tlabel={ __( 'Move down' ) }\n\t\t\t\t\t\tdescription={ __( 'Move down' ) }\n\t\t\t\t\t\tisDisabled={ rowCount && rowEnd >= rowCount }\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\t\trowStart: rowStart + 1,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\t\t\t\t\tmoveBlocksToPosition(\n\t\t\t\t\t\t\t\t[ blockClientId ],\n\t\t\t\t\t\t\t\tgridClientId,\n\t\t\t\t\t\t\t\tgridClientId,\n\t\t\t\t\t\t\t\tgetNumberOfBlocksBeforeCell(\n\t\t\t\t\t\t\t\t\tcolumnStart,\n\t\t\t\t\t\t\t\t\trowStart + 1\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t\t<div className=\"block-editor-grid-item-mover__move-horizontal-button-container is-right\">\n\t\t\t\t\t<GridItemMover\n\t\t\t\t\t\ticon={ isRTL() ? chevronLeft : chevronRight }\n\t\t\t\t\t\tlabel={ __( 'Move right' ) }\n\t\t\t\t\t\tdescription={ __( 'Move right' ) }\n\t\t\t\t\t\tisDisabled={ columnCount && columnEnd >= columnCount }\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\t\tcolumnStart: columnStart + 1,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\t\t\t\t\tmoveBlocksToPosition(\n\t\t\t\t\t\t\t\t[ blockClientId ],\n\t\t\t\t\t\t\t\tgridClientId,\n\t\t\t\t\t\t\t\tgridClientId,\n\t\t\t\t\t\t\t\tgetNumberOfBlocksBeforeCell(\n\t\t\t\t\t\t\t\t\tcolumnStart + 1,\n\t\t\t\t\t\t\t\t\trowStart\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t</ToolbarGroup>\n\t\t</BlockControls>\n\t);\n}\n\nfunction GridItemMover( {\n\tclassName,\n\ticon,\n\tlabel,\n\tisDisabled,\n\tonClick,\n\tdescription,\n} ) {\n\tconst instanceId = useInstanceId( GridItemMover );\n\tconst descriptionId = `block-editor-grid-item-mover-button__description-${ instanceId }`;\n\treturn (\n\t\t<>\n\t\t\t<ToolbarButton\n\t\t\t\tclassName={ clsx(\n\t\t\t\t\t'block-editor-grid-item-mover-button',\n\t\t\t\t\tclassName\n\t\t\t\t) }\n\t\t\t\ticon={ icon }\n\t\t\t\tlabel={ label }\n\t\t\t\taria-describedby={ descriptionId }\n\t\t\t\tonClick={ isDisabled ? null : onClick }\n\t\t\t\tdisabled={ isDisabled }\n\t\t\t\taccessibleWhenDisabled\n\t\t\t/>\n\t\t\t<VisuallyHidden id={ descriptionId }>\n\t\t\t\t{ description }\n\t\t\t</VisuallyHidden>\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,EAAE,EAAEC,KAAK,QAAQ,iBAAiB;AAC3C,SACCC,cAAc,EACdC,aAAa,EACbC,YAAY,QACN,uBAAuB;AAC9B,SACCC,WAAW,EACXC,SAAS,EACTC,WAAW,EACXC,YAAY,QACN,kBAAkB;AACzB,SAAS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AAE;EACvBD,SAAS;EACTE,IAAI;EACJC,KAAK;EACLE,UAAU;EACVC,OAAO;EACPF;AACD,CAAC,EAAG;EACH,MAAMG,UAAU,GAAGzC,aAAa,CAAEmC,aAAc,CAAC;EACjD,MAAMO,aAAa,GAAG,oDAAqDD,UAAU,EAAG;EACxF,oBACCjC,KAAA,CAAAE,SAAA;IAAAuB,QAAA,gBACC3B,IAAA,CAACb,aAAa;MACbyC,SAAS,EAAG7C,IAAI,CACf,qCAAqC,EACrC6C,SACD,CAAG;MACHE,IAAI,EAAGA,IAAM;MACbC,KAAK,EAAGA,KAAO;MACf,oBAAmBK,aAAe;MAClCF,OAAO,EAAGD,UAAU,GAAG,IAAI,GAAGC,OAAS;MACvCG,QAAQ,EAAGJ,UAAY;MACvBK,sBAAsB;IAAA,CACtB,CAAC,eACFtC,IAAA,CAACd,cAAc;MAACqD,EAAE,EAAGH,aAAe;MAAAT,QAAA,EACjCK;IAAW,CACE,CAAC;EAAA,CAChB,CAAC;AAEL","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","useState","useEffect","forwardRef","useMemo","useSelect","useDispatch","__experimentalUseDropZone","useDropZone","useBlockElement","BlockPopoverCover","range","GridRect","getGridInfo","store","blockEditorStore","useGetNumberOfBlocksBeforeCell","ButtonBlockAppender","unlock","jsx","_jsx","GridVisualizer","clientId","contentRef","parentLayout","isDistractionFree","select","getSettings","gridElement","isManualGrid","isManualPlacement","window","__experimentalEnableGridInteractivity","GridVisualizerGrid","gridClientId","ref","gridInfo","setGridInfo","isDroppingAllowed","setIsDroppingAllowed","observers","element","children","observer","ResizeObserver","observe","push","disconnect","onGlobalDrag","onGlobalDragEnd","document","addEventListener","removeEventListener","className","__unstablePopoverSlot","style","ManualGridVisualizer","Array","from","length","numItems","_","i","GridVisualizerCell","color","currentColor","highlightedRect","setHighlightedRect","gridItemStyles","getBlockOrder","getBlockStyles","blockOrder","occupiedRects","rects","Object","values","_style$layout","columnStart","rowStart","columnSpan","rowSpan","layout","numRows","map","row","numColumns","column","_highlightedRect$cont","isCellOccupied","some","rect","contains","isHighlighted","GridVisualizerDropZone","GridVisualizerAppender","boxShadow","useGridVisualizerDropZone","getBlockAttributes","getBlockRootClientId","canInsertBlockType","getBlockName","updateBlockAttributes","moveBlocksToPosition","__unstableMarkNextChangeAsNotPersistent","getNumberOfBlocksBeforeCell","useDropZoneWithValidation","validateDrag","srcClientId","blockName","attributes","isInBounds","containsRect","onDragEnter","onDragLeave","prevHighlightedRect","onDrop","rootClientId","onSelect","block","getDraggedBlockClientIds"],"sources":["@wordpress/block-editor/src/components/grid/grid-visualizer.js"],"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 } 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( { clientId, contentRef, parentLayout } ) {\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/>\n\t);\n}\n\nconst GridVisualizerGrid = forwardRef(\n\t( { gridClientId, gridElement, isManualGrid }, 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\tuseEffect( () => {\n\t\t\tconst observers = [];\n\t\t\tfor ( const element of [ gridElement, ...gridElement.children ] ) {\n\t\t\t\tconst observer = new window.ResizeObserver( () => {\n\t\t\t\t\tsetGridInfo( getGridInfo( gridElement ) );\n\t\t\t\t} );\n\t\t\t\tobserver.observe( element );\n\t\t\t\tobservers.push( observer );\n\t\t\t}\n\t\t\treturn () => {\n\t\t\t\tfor ( const observer of observers ) {\n\t\t\t\t\tobserver.disconnect();\n\t\t\t\t}\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/>\n\t\t\t\t\t) : (\n\t\t\t\t\t\tArray.from( { length: gridInfo.numItems }, ( _, i ) => (\n\t\t\t\t\t\t\t<GridVisualizerCell\n\t\t\t\t\t\t\t\tkey={ i }\n\t\t\t\t\t\t\t\tcolor={ gridInfo.currentColor }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) )\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t</BlockPopoverCover>\n\t\t);\n\t}\n);\n\nfunction ManualGridVisualizer( { gridClientId, gridInfo } ) {\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\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={ gridInfo.currentColor }\n\t\t\t\t\tclassName={ isHighlighted && 'is-highlighted' }\n\t\t\t\t>\n\t\t\t\t\t{ isCellOccupied ? (\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"],"mappings":"AAA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,QAAQ,EAAKC,KAAK,IAAM;MACvB,IAAK,CAAEA,KAAK,EAAG;QACd;MACD;MACAjB,qBAAqB,CAAEiB,KAAK,CAAChG,QAAQ,EAAE;QACtCiC,KAAK,EAAE;UACN0B,MAAM,EAAE;YACPJ,WAAW,EAAES,MAAM;YACnBR,QAAQ,EAAEM;UACX;QACD;MACD,CAAE,CAAC;MACHmB,uCAAuC,CAAC,CAAC;MACzCD,oBAAoB,CACnB,CAAEgB,KAAK,CAAChG,QAAQ,CAAE,EAClBY,YAAY,EACZA,YAAY,EACZsE,2BAA2B,CAAElB,MAAM,EAAEF,GAAI,CAC1C,CAAC;IACF;EAAG,CACH,CAAC;AAEJ;AAEA,SAASqB,yBAAyBA,CAAE;EACnCC,YAAY;EACZM,WAAW;EACXC,WAAW;EACXE;AACD,CAAC,EAAG;EACH,MAAM;IAAEI;EAAyB,CAAC,GAAGlH,SAAS,CAAEU,gBAAiB,CAAC;EAClE,OAAOP,WAAW,CAAE;IACnBwG,WAAWA,CAAA,EAAG;MACb,MAAM,CAAEL,WAAW,CAAE,GAAGY,wBAAwB,CAAC,CAAC;MAClD,IAAKZ,WAAW,IAAID,YAAY,CAAEC,WAAY,CAAC,EAAG;QACjDK,WAAW,CAAEL,WAAY,CAAC;MAC3B;IACD,CAAC;IACDM,WAAWA,CAAA,EAAG;MACbA,WAAW,CAAC,CAAC;IACd,CAAC;IACDE,MAAMA,CAAA,EAAG;MACR,MAAM,CAAER,WAAW,CAAE,GAAGY,wBAAwB,CAAC,CAAC;MAClD,IAAKZ,WAAW,IAAID,YAAY,CAAEC,WAAY,CAAC,EAAG;QACjDQ,MAAM,CAAER,WAAY,CAAC;MACtB;IACD;EACD,CAAE,CAAC;AACJ","ignoreList":[]}
1
+ {"version":3,"names":["clsx","useState","useEffect","forwardRef","useMemo","useSelect","useDispatch","__experimentalUseDropZone","useDropZone","useBlockElement","BlockPopoverCover","range","GridRect","getGridInfo","store","blockEditorStore","useGetNumberOfBlocksBeforeCell","ButtonBlockAppender","unlock","jsx","_jsx","GridVisualizer","clientId","contentRef","parentLayout","isDistractionFree","select","getSettings","gridElement","isManualGrid","isManualPlacement","window","__experimentalEnableGridInteractivity","GridVisualizerGrid","gridClientId","ref","gridInfo","setGridInfo","isDroppingAllowed","setIsDroppingAllowed","observers","element","children","observer","ResizeObserver","observe","push","disconnect","onGlobalDrag","onGlobalDragEnd","document","addEventListener","removeEventListener","className","__unstablePopoverSlot","style","ManualGridVisualizer","Array","from","length","numItems","_","i","GridVisualizerCell","color","currentColor","highlightedRect","setHighlightedRect","gridItemStyles","getBlockOrder","getBlockStyles","blockOrder","occupiedRects","rects","Object","values","_style$layout","columnStart","rowStart","columnSpan","rowSpan","layout","numRows","map","row","numColumns","column","_highlightedRect$cont","isCellOccupied","some","rect","contains","isHighlighted","GridVisualizerDropZone","GridVisualizerAppender","boxShadow","useGridVisualizerDropZone","getBlockAttributes","getBlockRootClientId","canInsertBlockType","getBlockName","updateBlockAttributes","moveBlocksToPosition","__unstableMarkNextChangeAsNotPersistent","getNumberOfBlocksBeforeCell","useDropZoneWithValidation","validateDrag","srcClientId","blockName","attributes","isInBounds","containsRect","onDragEnter","onDragLeave","prevHighlightedRect","onDrop","rootClientId","onSelect","block","getDraggedBlockClientIds"],"sources":["@wordpress/block-editor/src/components/grid/grid-visualizer.js"],"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 } 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( { clientId, contentRef, parentLayout } ) {\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/>\n\t);\n}\n\nconst GridVisualizerGrid = forwardRef(\n\t( { gridClientId, gridElement, isManualGrid }, 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\tuseEffect( () => {\n\t\t\tconst observers = [];\n\t\t\tfor ( const element of [ gridElement, ...gridElement.children ] ) {\n\t\t\t\tconst observer = new window.ResizeObserver( () => {\n\t\t\t\t\tsetGridInfo( getGridInfo( gridElement ) );\n\t\t\t\t} );\n\t\t\t\tobserver.observe( element );\n\t\t\t\tobservers.push( observer );\n\t\t\t}\n\t\t\treturn () => {\n\t\t\t\tfor ( const observer of observers ) {\n\t\t\t\t\tobserver.disconnect();\n\t\t\t\t}\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/>\n\t\t\t\t\t) : (\n\t\t\t\t\t\tArray.from( { length: gridInfo.numItems }, ( _, i ) => (\n\t\t\t\t\t\t\t<GridVisualizerCell\n\t\t\t\t\t\t\t\tkey={ i }\n\t\t\t\t\t\t\t\tcolor={ gridInfo.currentColor }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) )\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t</BlockPopoverCover>\n\t\t);\n\t}\n);\n\nfunction ManualGridVisualizer( { gridClientId, gridInfo } ) {\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\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={ gridInfo.currentColor }\n\t\t\t\t\tclassName={ isHighlighted && 'is-highlighted' }\n\t\t\t\t>\n\t\t\t\t\t{ isCellOccupied ? (\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"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,QAAQ,EAAEC,SAAS,EAAEC,UAAU,EAAEC,OAAO,QAAQ,oBAAoB;AAC7E,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,yBAAyB,IAAIC,WAAW,QAAQ,oBAAoB;;AAE7E;AACA;AACA;AACA,SAASC,eAAe,QAAQ,8CAA8C;AAC9E,OAAOC,iBAAiB,MAAM,wBAAwB;AACtD,SAASC,KAAK,EAAEC,QAAQ,EAAEC,WAAW,QAAQ,SAAS;AACtD,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;AACvD,SAASC,8BAA8B,QAAQ,wCAAwC;AACvF,OAAOC,mBAAmB,MAAM,0BAA0B;AAC1D,SAASC,MAAM,QAAQ,mBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE3C,OAAO,SAASC,cAAcA,CAAE;EAAEC,QAAQ;EAAEC,UAAU;EAAEC;AAAa,CAAC,EAAG;EACxE,MAAMC,iBAAiB,GAAGpB,SAAS,CAChCqB,MAAM,IACPA,MAAM,CAAEX,gBAAiB,CAAC,CAACY,WAAW,CAAC,CAAC,CAACF,iBAAiB,EAC3D,EACD,CAAC;EACD,MAAM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ACDM,WAAWA,CAAA,EAAG;MACbA,WAAW,CAAC,CAAC;IACd,CAAC;IACDE,MAAMA,CAAA,EAAG;MACR,MAAM,CAAER,WAAW,CAAE,GAAGY,wBAAwB,CAAC,CAAC;MAClD,IAAKZ,WAAW,IAAID,YAAY,CAAEC,WAAY,CAAC,EAAG;QACjDQ,MAAM,CAAER,WAAY,CAAC;MACtB;IACD;EACD,CAAE,CAAC;AACJ","ignoreList":[]}
@@ -9,8 +9,7 @@ import { __ } from '@wordpress/i18n';
9
9
  * Internal dependencies
10
10
  */
11
11
  import { useSettings } from '../use-settings';
12
- import { jsx as _jsx } from "react/jsx-runtime";
13
- import { jsxs as _jsxs } from "react/jsx-runtime";
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
13
  const RANGE_CONTROL_CUSTOM_SETTINGS = {
15
14
  px: {
16
15
  max: 1000,
@@ -1 +1 @@
1
- {"version":3,"names":["useMemo","BaseControl","RangeControl","Flex","FlexItem","__experimentalSpacer","Spacer","__experimentalUseCustomUnits","useCustomUnits","__experimentalUnitControl","UnitControl","__experimentalParseQuantityAndUnitFromRawValue","parseQuantityAndUnitFromRawValue","__","useSettings","jsx","_jsx","jsxs","_jsxs","RANGE_CONTROL_CUSTOM_SETTINGS","px","max","step","vw","vh","em","rem","svw","lvw","dvw","svh","lvh","dvh","vi","svi","lvi","dvi","vb","svb","lvb","dvb","vmin","svmin","lvmin","dvmin","vmax","svmax","lvmax","dvmax","HeightControl","label","onChange","value","_RANGE_CONTROL_CUSTOM","_RANGE_CONTROL_CUSTOM2","customRangeValue","parseFloat","availableUnits","units","selectedUnit","handleSliderChange","next","join","handleUnitChange","newUnit","currentValue","currentUnit","includes","toFixed","Math","round","className","children","VisualLabel","as","isBlock","onUnitChange","min","size","hideLabelFromVision","marginX","marginBottom","__next40pxDefaultSize","withInputField","__nextHasNoMarginBottom"],"sources":["@wordpress/block-editor/src/components/height-control/index.js"],"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';\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 * @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\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\tsize=\"__unstable-large\"\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\t__next40pxDefaultSize\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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H,QAAA,eAChBxD,IAAA,CAACN,WAAW;UACX0C,KAAK,EAAGA,KAAO;UACfM,KAAK,EAAGA,KAAO;UACfP,QAAQ,EAAGA,QAAU;UACrByB,YAAY,EAAGb,gBAAkB;UACjCc,GAAG,EAAG,CAAG;UACTC,IAAI,EAAC,kBAAkB;UACvB5B,KAAK,EAAGA,KAAO;UACf6B,mBAAmB;QAAA,CACnB;MAAC,CACO,CAAC,eACX/D,IAAA,CAACZ,QAAQ;QAACuE,OAAO;QAAAH,QAAA,eAChBxD,IAAA,CAACV,MAAM;UAAC0E,OAAO,EAAG,CAAG;UAACC,YAAY,EAAG,CAAG;UAAAT,QAAA,eACvCxD,IAAA,CAACd,YAAY;YACZgF,qBAAqB;YACrB9B,KAAK,EAAGG,gBAAkB;YAC1BsB,GAAG,EAAG,CAAG;YACTxD,GAAG,GAAAgC,qBAAA,GACFlC,6BAA6B,CAAEwC,YAAY,CAAE,EAC1CtC,GAAG,cAAAgC,qBAAA,cAAAA,qBAAA,GAAI,GACV;YACD/B,IAAI,GAAAgC,sBAAA,GACHnC,6BAA6B,CAAEwC,YAAY,CAAE,EAC1CrC,IAAI,cAAAgC,sBAAA,cAAAA,sBAAA,GAAI,GACX;YACD6B,cAAc,EAAG,KAAO;YACxBhC,QAAQ,EAAGS,kBAAoB;YAC/BwB,uBAAuB;YACvBlC,KAAK,EAAGA,KAAO;YACf6B,mBAAmB;UAAA,CACnB;QAAC,CACK;MAAC,CACA,CAAC;IAAA,CACN,CAAC;EAAA,CACE,CAAC;AAEb","ignoreList":[]}
1
+ {"version":3,"names":["useMemo","BaseControl","RangeControl","Flex","FlexItem","__experimentalSpacer","Spacer","__experimentalUseCustomUnits","useCustomUnits","__experimentalUnitControl","UnitControl","__experimentalParseQuantityAndUnitFromRawValue","parseQuantityAndUnitFromRawValue","__","useSettings","jsx","_jsx","jsxs","_jsxs","RANGE_CONTROL_CUSTOM_SETTINGS","px","max","step","vw","vh","em","rem","svw","lvw","dvw","svh","lvh","dvh","vi","svi","lvi","dvi","vb","svb","lvb","dvb","vmin","svmin","lvmin","dvmin","vmax","svmax","lvmax","dvmax","HeightControl","label","onChange","value","_RANGE_CONTROL_CUSTOM","_RANGE_CONTROL_CUSTOM2","customRangeValue","parseFloat","availableUnits","units","selectedUnit","handleSliderChange","next","join","handleUnitChange","newUnit","currentValue","currentUnit","includes","toFixed","Math","round","className","children","VisualLabel","as","isBlock","onUnitChange","min","size","hideLabelFromVision","marginX","marginBottom","__next40pxDefaultSize","withInputField","__nextHasNoMarginBottom"],"sources":["@wordpress/block-editor/src/components/height-control/index.js"],"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';\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 * @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\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\tsize=\"__unstable-large\"\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\t__next40pxDefaultSize\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\t__nextHasNoMarginBottom\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"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,OAAO,QAAQ,oBAAoB;AAC5C,SACCC,WAAW,EACXC,YAAY,EACZC,IAAI,EACJC,QAAQ,EACRC,oBAAoB,IAAIC,MAAM,EAC9BC,4BAA4B,IAAIC,cAAc,EAC9CC,yBAAyB,IAAIC,WAAW,EACxCC,8CAA8C,IAAIC,gCAAgC,QAC5E,uBAAuB;AAC9B,SAASC,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;AACA,SAASC,WAAW,QAAQ,iBAAiB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAE9C,MAAMC,6BAA6B,GAAG;EACrCC,EAAE,EAAE;IAAEC,GAAG,EAAE,IAAI;IAAEC,IAAI,EAAE;EAAE,CAAC;EAC1B,GAAG,EAAE;IAAED,GAAG,EAAE,GAAG;IAAEC,IAAI,EAAE;EAAE,CAAC;EAC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KAAK,EAAGA,KAAO;YACf6B,mBAAmB;UAAA,CACnB;QAAC,CACK;MAAC,CACA,CAAC;IAAA,CACN,CAAC;EAAA,CACE,CAAC;AAEb","ignoreList":[]}
@@ -20,9 +20,7 @@ import { useBlockSelectionClearer } from '../block-selection-clearer';
20
20
  import { useWritingFlow } from '../writing-flow';
21
21
  import { getCompatibilityStyles } from './get-compatibility-styles';
22
22
  import { store as blockEditorStore } from '../../store';
23
- import { jsx as _jsx } from "react/jsx-runtime";
24
- import { jsxs as _jsxs } from "react/jsx-runtime";
25
- import { Fragment as _Fragment } from "react/jsx-runtime";
23
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
26
24
  function bubbleEvent(event, Constructor, frame) {
27
25
  const init = {};
28
26
  for (const key in event) {
@@ -112,7 +110,7 @@ function Iframe({
112
110
  const settings = getSettings();
113
111
  return {
114
112
  resolvedAssets: settings.__unstableResolvedAssets,
115
- isPreviewMode: settings.__unstableIsPreviewMode
113
+ isPreviewMode: settings.isPreviewMode
116
114
  };
117
115
  }, []);
118
116
  const {
@@ -120,7 +118,7 @@ function Iframe({
120
118
  scripts = ''
121
119
  } = resolvedAssets;
122
120
  const [iframeDocument, setIframeDocument] = useState();
123
- const prevContainerWidthRef = useRef();
121
+ const initialContainerWidthRef = useRef(0);
124
122
  const [bodyClasses, setBodyClasses] = useState([]);
125
123
  const clearerRef = useBlockSelectionClearer();
126
124
  const [before, writingFlowRef, after] = useWritingFlow();
@@ -204,9 +202,10 @@ function Iframe({
204
202
  const isZoomedOut = scale !== 1;
205
203
  useEffect(() => {
206
204
  if (!isZoomedOut) {
207
- prevContainerWidthRef.current = containerWidth;
205
+ initialContainerWidthRef.current = containerWidth;
208
206
  }
209
207
  }, [containerWidth, isZoomedOut]);
208
+ const scaleContainerWidth = Math.max(initialContainerWidthRef.current, containerWidth);
210
209
  const disabledRef = useDisabled({
211
210
  isDisabled: !readonly
212
211
  });
@@ -251,28 +250,62 @@ function Iframe({
251
250
  return [_src, () => URL.revokeObjectURL(_src)];
252
251
  }, [html]);
253
252
  useEffect(() => cleanup, [cleanup]);
253
+ const zoomOutAnimationClassnameRef = useRef(null);
254
+
255
+ // Toggle zoom out CSS Classes only when zoom out mode changes. We could add these into the useEffect
256
+ // that controls settings the CSS variables, but then we would need to do more work to ensure we're
257
+ // only toggling these when the zoom out mode changes, as that useEffect is also triggered by a large
258
+ // number of dependencies.
254
259
  useEffect(() => {
255
260
  if (!iframeDocument || !isZoomedOut) {
256
261
  return;
257
262
  }
263
+ const handleZoomOutAnimationClassname = () => {
264
+ clearTimeout(zoomOutAnimationClassnameRef.current);
265
+ iframeDocument.documentElement.classList.add('zoom-out-animation');
266
+ zoomOutAnimationClassnameRef.current = setTimeout(() => {
267
+ iframeDocument.documentElement.classList.remove('zoom-out-animation');
268
+ }, 400); // 400ms should match the animation speed used in components/iframe/content.scss
269
+ };
270
+ handleZoomOutAnimationClassname();
258
271
  iframeDocument.documentElement.classList.add('is-zoomed-out');
272
+ return () => {
273
+ handleZoomOutAnimationClassname();
274
+ iframeDocument.documentElement.classList.remove('is-zoomed-out');
275
+ };
276
+ }, [iframeDocument, isZoomedOut]);
277
+
278
+ // Calculate the scaling and CSS variables for the zoom out canvas
279
+ useEffect(() => {
280
+ if (!iframeDocument || !isZoomedOut) {
281
+ return;
282
+ }
259
283
  const maxWidth = 750;
260
- iframeDocument.documentElement.style.setProperty('--wp-block-editor-iframe-zoom-out-scale', scale === 'default' ? Math.min(containerWidth, maxWidth) / prevContainerWidthRef.current : scale);
284
+ // Note: When we initialize the zoom out when the canvas is smaller (sidebars open),
285
+ // initialContainerWidthRef will be smaller than the full page, and reflow will happen
286
+ // when the canvas area becomes larger due to sidebars closing. This is a known but
287
+ // minor divergence for now.
288
+
289
+ // This scaling calculation has to happen within the JS because CSS calc() can
290
+ // only divide and multiply by a unitless value. I.e. calc( 100px / 2 ) is valid
291
+ // but calc( 100px / 2px ) is not.
292
+ iframeDocument.documentElement.style.setProperty('--wp-block-editor-iframe-zoom-out-scale', scale === 'auto-scaled' ? (Math.min(containerWidth, maxWidth) - parseInt(frameSize) * 2) / scaleContainerWidth : scale);
293
+
294
+ // frameSize has to be a px value for the scaling and frame size to be computed correctly.
261
295
  iframeDocument.documentElement.style.setProperty('--wp-block-editor-iframe-zoom-out-frame-size', typeof frameSize === 'number' ? `${frameSize}px` : frameSize);
262
296
  iframeDocument.documentElement.style.setProperty('--wp-block-editor-iframe-zoom-out-content-height', `${contentHeight}px`);
263
297
  iframeDocument.documentElement.style.setProperty('--wp-block-editor-iframe-zoom-out-inner-height', `${iframeWindowInnerHeight}px`);
264
298
  iframeDocument.documentElement.style.setProperty('--wp-block-editor-iframe-zoom-out-container-width', `${containerWidth}px`);
265
- iframeDocument.documentElement.style.setProperty('--wp-block-editor-iframe-zoom-out-prev-container-width', `${prevContainerWidthRef.current}px`);
299
+ iframeDocument.documentElement.style.setProperty('--wp-block-editor-iframe-zoom-out-scale-container-width', `${scaleContainerWidth}px`);
266
300
  return () => {
267
- iframeDocument.documentElement.classList.remove('is-zoomed-out');
268
301
  iframeDocument.documentElement.style.removeProperty('--wp-block-editor-iframe-zoom-out-scale');
269
302
  iframeDocument.documentElement.style.removeProperty('--wp-block-editor-iframe-zoom-out-frame-size');
270
303
  iframeDocument.documentElement.style.removeProperty('--wp-block-editor-iframe-zoom-out-content-height');
271
304
  iframeDocument.documentElement.style.removeProperty('--wp-block-editor-iframe-zoom-out-inner-height');
272
305
  iframeDocument.documentElement.style.removeProperty('--wp-block-editor-iframe-zoom-out-container-width');
273
- iframeDocument.documentElement.style.removeProperty('--wp-block-editor-iframe-zoom-out-prev-container-width');
306
+ iframeDocument.documentElement.style.removeProperty('--wp-block-editor-iframe-zoom-out-scale-container-width');
274
307
  };
275
- }, [scale, frameSize, iframeDocument, iframeWindowInnerHeight, contentHeight, containerWidth, windowInnerWidth, isZoomedOut]);
308
+ }, [scale, frameSize, iframeDocument, iframeWindowInnerHeight, contentHeight, containerWidth, windowInnerWidth, isZoomedOut, scaleContainerWidth]);
276
309
 
277
310
  // Make sure to not render the before and after focusable div elements in view
278
311
  // mode. They're only needed to capture focus in edit mode.
@@ -282,7 +315,8 @@ function Iframe({
282
315
  ...props,
283
316
  style: {
284
317
  ...props.style,
285
- height: props.style?.height
318
+ height: props.style?.height,
319
+ border: 0
286
320
  },
287
321
  ref: useMergeRefs([ref, setRef]),
288
322
  tabIndex: tabIndex
@@ -338,8 +372,7 @@ function Iframe({
338
372
  children: [containerResizeListener, /*#__PURE__*/_jsx("div", {
339
373
  className: clsx('block-editor-iframe__scale-container', isZoomedOut && 'is-zoomed-out'),
340
374
  style: {
341
- '--wp-block-editor-iframe-zoom-out-container-width': isZoomedOut && `${containerWidth}px`,
342
- '--wp-block-editor-iframe-zoom-out-prev-container-width': isZoomedOut && `${prevContainerWidthRef.current}px`
375
+ '--wp-block-editor-iframe-zoom-out-scale-container-width': isZoomedOut && `${scaleContainerWidth}px`
343
376
  },
344
377
  children: iframe
345
378
  })]
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","useState","createPortal","forwardRef","useMemo","useEffect","useRef","__","useResizeObserver","useMergeRefs","useRefEffect","useDisabled","__experimentalStyleProvider","StyleProvider","useSelect","useBlockSelectionClearer","useWritingFlow","getCompatibilityStyles","store","blockEditorStore","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","bubbleEvent","event","Constructor","frame","init","key","contentDocument","defaultView","MouseEvent","rect","getBoundingClientRect","clientX","left","clientY","top","newEvent","type","defaultPrevented","preventDefault","cancelled","dispatchEvent","useBubbleEvents","iframeDocument","frameElement","html","documentElement","eventTypes","handlers","name","prototype","Object","getPrototypeOf","constructorName","constructor","window","addEventListener","removeEventListener","Iframe","contentRef","children","tabIndex","scale","frameSize","readonly","forwardedRef","ref","title","props","resolvedAssets","isPreviewMode","select","getSettings","settings","__unstableResolvedAssets","__unstableIsPreviewMode","styles","scripts","setIframeDocument","prevContainerWidthRef","bodyClasses","setBodyClasses","clearerRef","before","writingFlowRef","after","contentResizeListener","height","contentHeight","containerResizeListener","width","containerWidth","setRef","node","_load","iFrameDocument","preventFileDropDefault","onLoad","ownerDocument","classList","add","Array","from","body","filter","startsWith","dir","compatStyle","getElementById","id","head","appendChild","cloneNode","console","warn","iframeWindowInnerHeight","setIframeWindowInnerHeight","iframeResizeRef","nodeWindow","innerHeight","onResize","windowInnerWidth","setWindowInnerWidth","windowResizeRef","innerWidth","isZoomedOut","current","disabledRef","isDisabled","bodyRef","src","cleanup","_src","URL","createObjectURL","Blob","revokeObjectURL","maxWidth","style","setProperty","Math","min","remove","removeProperty","shouldRenderFocusCaptureElements","iframe","onKeyDown","currentTarget","target","stopPropagation","nativeEvent","KeyboardEvent","className","document","IframeIfReady","isInitialised","__internalIsInitialized"],"sources":["@wordpress/block-editor/src/components/iframe/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseState,\n\tcreatePortal,\n\tforwardRef,\n\tuseMemo,\n\tuseEffect,\n\tuseRef,\n} from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tuseResizeObserver,\n\tuseMergeRefs,\n\tuseRefEffect,\n\tuseDisabled,\n} from '@wordpress/compose';\nimport { __experimentalStyleProvider as StyleProvider } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { useBlockSelectionClearer } from '../block-selection-clearer';\nimport { useWritingFlow } from '../writing-flow';\nimport { getCompatibilityStyles } from './get-compatibility-styles';\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\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 { getSettings } = select( blockEditorStore );\n\t\tconst settings = getSettings();\n\t\treturn {\n\t\t\tresolvedAssets: settings.__unstableResolvedAssets,\n\t\t\tisPreviewMode: settings.__unstableIsPreviewMode,\n\t\t};\n\t}, [] );\n\tconst { styles = '', scripts = '' } = resolvedAssets;\n\tconst [ iframeDocument, setIframeDocument ] = useState();\n\tconst prevContainerWidthRef = useRef();\n\tconst [ bodyClasses, setBodyClasses ] = useState( [] );\n\tconst clearerRef = useBlockSelectionClearer();\n\tconst [ before, writingFlowRef, after ] = useWritingFlow();\n\tconst [ contentResizeListener, { height: contentHeight } ] =\n\t\tuseResizeObserver();\n\tconst [ containerResizeListener, { width: containerWidth } ] =\n\t\tuseResizeObserver();\n\n\tconst setRef = useRefEffect( ( node ) => {\n\t\tnode._load = () => {\n\t\t\tsetIframeDocument( node.contentDocument );\n\t\t};\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\tfunction onLoad() {\n\t\t\tconst { contentDocument, ownerDocument } = node;\n\t\t\tconst { documentElement } = contentDocument;\n\t\t\tiFrameDocument = contentDocument;\n\n\t\t\tdocumentElement.classList.add( 'block-editor-iframe__html' );\n\n\t\t\tclearerRef( documentElement );\n\n\t\t\t// Ideally ALL classes that are added through get_body_class should\n\t\t\t// be added in the editor too, which we'll somehow have to get from\n\t\t\t// the server in the future (which will run the PHP filters).\n\t\t\tsetBodyClasses(\n\t\t\t\tArray.from( ownerDocument.body.classList ).filter(\n\t\t\t\t\t( name ) =>\n\t\t\t\t\t\tname.startsWith( 'admin-color-' ) ||\n\t\t\t\t\t\tname.startsWith( 'post-type-' ) ||\n\t\t\t\t\t\tname === 'wp-embed-responsive'\n\t\t\t\t)\n\t\t\t);\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}\n\n\t\tnode.addEventListener( 'load', onLoad );\n\n\t\treturn () => {\n\t\t\tdelete node._load;\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};\n\t}, [] );\n\n\tconst [ iframeWindowInnerHeight, setIframeWindowInnerHeight ] = useState();\n\n\tconst iframeResizeRef = useRefEffect( ( node ) => {\n\t\tconst nodeWindow = node.ownerDocument.defaultView;\n\n\t\tsetIframeWindowInnerHeight( nodeWindow.innerHeight );\n\t\tconst onResize = () => {\n\t\t\tsetIframeWindowInnerHeight( nodeWindow.innerHeight );\n\t\t};\n\t\tnodeWindow.addEventListener( 'resize', onResize );\n\t\treturn () => {\n\t\t\tnodeWindow.removeEventListener( 'resize', onResize );\n\t\t};\n\t}, [] );\n\n\tconst [ windowInnerWidth, setWindowInnerWidth ] = useState();\n\n\tconst windowResizeRef = useRefEffect( ( node ) => {\n\t\tconst nodeWindow = node.ownerDocument.defaultView;\n\n\t\tsetWindowInnerWidth( nodeWindow.innerWidth );\n\t\tconst onResize = () => {\n\t\t\tsetWindowInnerWidth( nodeWindow.innerWidth );\n\t\t};\n\t\tnodeWindow.addEventListener( 'resize', onResize );\n\t\treturn () => {\n\t\t\tnodeWindow.removeEventListener( 'resize', onResize );\n\t\t};\n\t}, [] );\n\n\tconst isZoomedOut = scale !== 1;\n\n\tuseEffect( () => {\n\t\tif ( ! isZoomedOut ) {\n\t\t\tprevContainerWidthRef.current = containerWidth;\n\t\t}\n\t}, [ containerWidth, isZoomedOut ] );\n\n\tconst disabledRef = useDisabled( { isDisabled: ! readonly } );\n\tconst bodyRef = useMergeRefs( [\n\t\tuseBubbleEvents( iframeDocument ),\n\t\tcontentRef,\n\t\tclearerRef,\n\t\twritingFlowRef,\n\t\tdisabledRef,\n\t\t// Avoid resize listeners when not needed, these will trigger\n\t\t// unnecessary re-renders when animating the iframe width, or when\n\t\t// expanding preview iframes.\n\t\tisZoomedOut ? iframeResizeRef : null,\n\t] );\n\n\t// Correct doctype is required to enable rendering in standards\n\t// mode. Also preload the styles to avoid a flash of unstyled\n\t// content.\n\tconst html = `<!doctype html>\n<html>\n\t<head>\n\t\t<meta charset=\"utf-8\">\n\t\t<script>window.frameElement._load()</script>\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${ styles }\n\t\t${ scripts }\n\t</head>\n\t<body>\n\t\t<script>document.currentScript.parentElement.remove()</script>\n\t</body>\n</html>`;\n\n\tconst [ src, cleanup ] = useMemo( () => {\n\t\tconst _src = URL.createObjectURL(\n\t\t\tnew window.Blob( [ html ], { type: 'text/html' } )\n\t\t);\n\t\treturn [ _src, () => URL.revokeObjectURL( _src ) ];\n\t}, [ html ] );\n\n\tuseEffect( () => cleanup, [ cleanup ] );\n\n\tuseEffect( () => {\n\t\tif ( ! iframeDocument || ! isZoomedOut ) {\n\t\t\treturn;\n\t\t}\n\n\t\tiframeDocument.documentElement.classList.add( 'is-zoomed-out' );\n\n\t\tconst maxWidth = 750;\n\t\tiframeDocument.documentElement.style.setProperty(\n\t\t\t'--wp-block-editor-iframe-zoom-out-scale',\n\t\t\tscale === 'default'\n\t\t\t\t? Math.min( containerWidth, maxWidth ) /\n\t\t\t\t\t\tprevContainerWidthRef.current\n\t\t\t\t: scale\n\t\t);\n\t\tiframeDocument.documentElement.style.setProperty(\n\t\t\t'--wp-block-editor-iframe-zoom-out-frame-size',\n\t\t\ttypeof frameSize === 'number' ? `${ frameSize }px` : frameSize\n\t\t);\n\t\tiframeDocument.documentElement.style.setProperty(\n\t\t\t'--wp-block-editor-iframe-zoom-out-content-height',\n\t\t\t`${ contentHeight }px`\n\t\t);\n\t\tiframeDocument.documentElement.style.setProperty(\n\t\t\t'--wp-block-editor-iframe-zoom-out-inner-height',\n\t\t\t`${ iframeWindowInnerHeight }px`\n\t\t);\n\t\tiframeDocument.documentElement.style.setProperty(\n\t\t\t'--wp-block-editor-iframe-zoom-out-container-width',\n\t\t\t`${ containerWidth }px`\n\t\t);\n\t\tiframeDocument.documentElement.style.setProperty(\n\t\t\t'--wp-block-editor-iframe-zoom-out-prev-container-width',\n\t\t\t`${ prevContainerWidthRef.current }px`\n\t\t);\n\n\t\treturn () => {\n\t\t\tiframeDocument.documentElement.classList.remove( 'is-zoomed-out' );\n\n\t\t\tiframeDocument.documentElement.style.removeProperty(\n\t\t\t\t'--wp-block-editor-iframe-zoom-out-scale'\n\t\t\t);\n\t\t\tiframeDocument.documentElement.style.removeProperty(\n\t\t\t\t'--wp-block-editor-iframe-zoom-out-frame-size'\n\t\t\t);\n\t\t\tiframeDocument.documentElement.style.removeProperty(\n\t\t\t\t'--wp-block-editor-iframe-zoom-out-content-height'\n\t\t\t);\n\t\t\tiframeDocument.documentElement.style.removeProperty(\n\t\t\t\t'--wp-block-editor-iframe-zoom-out-inner-height'\n\t\t\t);\n\t\t\tiframeDocument.documentElement.style.removeProperty(\n\t\t\t\t'--wp-block-editor-iframe-zoom-out-container-width'\n\t\t\t);\n\t\t\tiframeDocument.documentElement.style.removeProperty(\n\t\t\t\t'--wp-block-editor-iframe-zoom-out-prev-container-width'\n\t\t\t);\n\t\t};\n\t}, [\n\t\tscale,\n\t\tframeSize,\n\t\tiframeDocument,\n\t\tiframeWindowInnerHeight,\n\t\tcontentHeight,\n\t\tcontainerWidth,\n\t\twindowInnerWidth,\n\t\tisZoomedOut,\n\t] );\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} }\n\t\t\t\tref={ useMergeRefs( [ ref, setRef ] ) }\n\t\t\t\ttabIndex={ tabIndex }\n\t\t\t\t// Correct doctype is required to enable rendering in standards\n\t\t\t\t// mode. Also preload the styles to avoid a flash of unstyled\n\t\t\t\t// content.\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// We want to prevent React events from bubbling throught the iframe\n\t\t\t\t\t\t// we bubble these manually.\n\t\t\t\t\t\t/* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */\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\" ref={ windowResizeRef }>\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-container-width':\n\t\t\t\t\t\tisZoomedOut && `${ containerWidth }px`,\n\t\t\t\t\t'--wp-block-editor-iframe-zoom-out-prev-container-width':\n\t\t\t\t\t\tisZoomedOut && `${ prevContainerWidthRef.current }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"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SACCC,QAAQ,EACRC,YAAY,EACZC,UAAU,EACVC,OAAO,EACPC,SAAS,EACTC,MAAM,QACA,oBAAoB;AAC3B,SAASC,EAAE,QAAQ,iB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;EACA;EACA;EACA;EACA;EACA,IAAK,CAAED,aAAa,EAAG;IACtB,OAAO,IAAI;EACZ;EAEA,oBAAO3I,IAAA,CAAC0C,MAAM;IAAA,GAAMU,KAAK;IAAGH,YAAY,EAAGC;EAAK,CAAE,CAAC;AACpD;AAEA,eAAepE,UAAU,CAAE4J,aAAc,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["clsx","useState","createPortal","forwardRef","useMemo","useEffect","useRef","__","useResizeObserver","useMergeRefs","useRefEffect","useDisabled","__experimentalStyleProvider","StyleProvider","useSelect","useBlockSelectionClearer","useWritingFlow","getCompatibilityStyles","store","blockEditorStore","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","bubbleEvent","event","Constructor","frame","init","key","contentDocument","defaultView","MouseEvent","rect","getBoundingClientRect","clientX","left","clientY","top","newEvent","type","defaultPrevented","preventDefault","cancelled","dispatchEvent","useBubbleEvents","iframeDocument","frameElement","html","documentElement","eventTypes","handlers","name","prototype","Object","getPrototypeOf","constructorName","constructor","window","addEventListener","removeEventListener","Iframe","contentRef","children","tabIndex","scale","frameSize","readonly","forwardedRef","ref","title","props","resolvedAssets","isPreviewMode","select","getSettings","settings","__unstableResolvedAssets","styles","scripts","setIframeDocument","initialContainerWidthRef","bodyClasses","setBodyClasses","clearerRef","before","writingFlowRef","after","contentResizeListener","height","contentHeight","containerResizeListener","width","containerWidth","setRef","node","_load","iFrameDocument","preventFileDropDefault","onLoad","ownerDocument","classList","add","Array","from","body","filter","startsWith","dir","compatStyle","getElementById","id","head","appendChild","cloneNode","console","warn","iframeWindowInnerHeight","setIframeWindowInnerHeight","iframeResizeRef","nodeWindow","innerHeight","onResize","windowInnerWidth","setWindowInnerWidth","windowResizeRef","innerWidth","isZoomedOut","current","scaleContainerWidth","Math","max","disabledRef","isDisabled","bodyRef","src","cleanup","_src","URL","createObjectURL","Blob","revokeObjectURL","zoomOutAnimationClassnameRef","handleZoomOutAnimationClassname","clearTimeout","setTimeout","remove","maxWidth","style","setProperty","min","parseInt","removeProperty","shouldRenderFocusCaptureElements","iframe","border","onKeyDown","currentTarget","target","stopPropagation","nativeEvent","KeyboardEvent","className","document","IframeIfReady","isInitialised","__internalIsInitialized"],"sources":["@wordpress/block-editor/src/components/iframe/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseState,\n\tcreatePortal,\n\tforwardRef,\n\tuseMemo,\n\tuseEffect,\n\tuseRef,\n} from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tuseResizeObserver,\n\tuseMergeRefs,\n\tuseRefEffect,\n\tuseDisabled,\n} from '@wordpress/compose';\nimport { __experimentalStyleProvider as StyleProvider } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { useBlockSelectionClearer } from '../block-selection-clearer';\nimport { useWritingFlow } from '../writing-flow';\nimport { getCompatibilityStyles } from './get-compatibility-styles';\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\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 { getSettings } = select( blockEditorStore );\n\t\tconst settings = getSettings();\n\t\treturn {\n\t\t\tresolvedAssets: settings.__unstableResolvedAssets,\n\t\t\tisPreviewMode: settings.isPreviewMode,\n\t\t};\n\t}, [] );\n\tconst { styles = '', scripts = '' } = resolvedAssets;\n\tconst [ iframeDocument, setIframeDocument ] = useState();\n\tconst initialContainerWidthRef = useRef( 0 );\n\tconst [ bodyClasses, setBodyClasses ] = useState( [] );\n\tconst clearerRef = useBlockSelectionClearer();\n\tconst [ before, writingFlowRef, after ] = useWritingFlow();\n\tconst [ contentResizeListener, { height: contentHeight } ] =\n\t\tuseResizeObserver();\n\tconst [ containerResizeListener, { width: containerWidth } ] =\n\t\tuseResizeObserver();\n\n\tconst setRef = useRefEffect( ( node ) => {\n\t\tnode._load = () => {\n\t\t\tsetIframeDocument( node.contentDocument );\n\t\t};\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\tfunction onLoad() {\n\t\t\tconst { contentDocument, ownerDocument } = node;\n\t\t\tconst { documentElement } = contentDocument;\n\t\t\tiFrameDocument = contentDocument;\n\n\t\t\tdocumentElement.classList.add( 'block-editor-iframe__html' );\n\n\t\t\tclearerRef( documentElement );\n\n\t\t\t// Ideally ALL classes that are added through get_body_class should\n\t\t\t// be added in the editor too, which we'll somehow have to get from\n\t\t\t// the server in the future (which will run the PHP filters).\n\t\t\tsetBodyClasses(\n\t\t\t\tArray.from( ownerDocument.body.classList ).filter(\n\t\t\t\t\t( name ) =>\n\t\t\t\t\t\tname.startsWith( 'admin-color-' ) ||\n\t\t\t\t\t\tname.startsWith( 'post-type-' ) ||\n\t\t\t\t\t\tname === 'wp-embed-responsive'\n\t\t\t\t)\n\t\t\t);\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}\n\n\t\tnode.addEventListener( 'load', onLoad );\n\n\t\treturn () => {\n\t\t\tdelete node._load;\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};\n\t}, [] );\n\n\tconst [ iframeWindowInnerHeight, setIframeWindowInnerHeight ] = useState();\n\n\tconst iframeResizeRef = useRefEffect( ( node ) => {\n\t\tconst nodeWindow = node.ownerDocument.defaultView;\n\n\t\tsetIframeWindowInnerHeight( nodeWindow.innerHeight );\n\t\tconst onResize = () => {\n\t\t\tsetIframeWindowInnerHeight( nodeWindow.innerHeight );\n\t\t};\n\t\tnodeWindow.addEventListener( 'resize', onResize );\n\t\treturn () => {\n\t\t\tnodeWindow.removeEventListener( 'resize', onResize );\n\t\t};\n\t}, [] );\n\n\tconst [ windowInnerWidth, setWindowInnerWidth ] = useState();\n\n\tconst windowResizeRef = useRefEffect( ( node ) => {\n\t\tconst nodeWindow = node.ownerDocument.defaultView;\n\n\t\tsetWindowInnerWidth( nodeWindow.innerWidth );\n\t\tconst onResize = () => {\n\t\t\tsetWindowInnerWidth( nodeWindow.innerWidth );\n\t\t};\n\t\tnodeWindow.addEventListener( 'resize', onResize );\n\t\treturn () => {\n\t\t\tnodeWindow.removeEventListener( 'resize', onResize );\n\t\t};\n\t}, [] );\n\n\tconst isZoomedOut = scale !== 1;\n\n\tuseEffect( () => {\n\t\tif ( ! isZoomedOut ) {\n\t\t\tinitialContainerWidthRef.current = containerWidth;\n\t\t}\n\t}, [ containerWidth, isZoomedOut ] );\n\n\tconst scaleContainerWidth = Math.max(\n\t\tinitialContainerWidthRef.current,\n\t\tcontainerWidth\n\t);\n\n\tconst disabledRef = useDisabled( { isDisabled: ! readonly } );\n\tconst bodyRef = useMergeRefs( [\n\t\tuseBubbleEvents( iframeDocument ),\n\t\tcontentRef,\n\t\tclearerRef,\n\t\twritingFlowRef,\n\t\tdisabledRef,\n\t\t// Avoid resize listeners when not needed, these will trigger\n\t\t// unnecessary re-renders when animating the iframe width, or when\n\t\t// expanding preview iframes.\n\t\tisZoomedOut ? iframeResizeRef : null,\n\t] );\n\n\t// Correct doctype is required to enable rendering in standards\n\t// mode. Also preload the styles to avoid a flash of unstyled\n\t// content.\n\tconst html = `<!doctype html>\n<html>\n\t<head>\n\t\t<meta charset=\"utf-8\">\n\t\t<script>window.frameElement._load()</script>\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${ styles }\n\t\t${ scripts }\n\t</head>\n\t<body>\n\t\t<script>document.currentScript.parentElement.remove()</script>\n\t</body>\n</html>`;\n\n\tconst [ src, cleanup ] = useMemo( () => {\n\t\tconst _src = URL.createObjectURL(\n\t\t\tnew window.Blob( [ html ], { type: 'text/html' } )\n\t\t);\n\t\treturn [ _src, () => URL.revokeObjectURL( _src ) ];\n\t}, [ html ] );\n\n\tuseEffect( () => cleanup, [ cleanup ] );\n\n\tconst zoomOutAnimationClassnameRef = useRef( null );\n\n\t// Toggle zoom out CSS Classes only when zoom out mode changes. We could add these into the useEffect\n\t// that controls settings the CSS variables, but then we would need to do more work to ensure we're\n\t// only toggling these when the zoom out mode changes, as that useEffect is also triggered by a large\n\t// number of dependencies.\n\tuseEffect( () => {\n\t\tif ( ! iframeDocument || ! isZoomedOut ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst handleZoomOutAnimationClassname = () => {\n\t\t\tclearTimeout( zoomOutAnimationClassnameRef.current );\n\n\t\t\tiframeDocument.documentElement.classList.add(\n\t\t\t\t'zoom-out-animation'\n\t\t\t);\n\n\t\t\tzoomOutAnimationClassnameRef.current = setTimeout( () => {\n\t\t\t\tiframeDocument.documentElement.classList.remove(\n\t\t\t\t\t'zoom-out-animation'\n\t\t\t\t);\n\t\t\t}, 400 ); // 400ms should match the animation speed used in components/iframe/content.scss\n\t\t};\n\n\t\thandleZoomOutAnimationClassname();\n\t\tiframeDocument.documentElement.classList.add( 'is-zoomed-out' );\n\n\t\treturn () => {\n\t\t\thandleZoomOutAnimationClassname();\n\t\t\tiframeDocument.documentElement.classList.remove( 'is-zoomed-out' );\n\t\t};\n\t}, [ iframeDocument, isZoomedOut ] );\n\n\t// Calculate the scaling and CSS variables for the zoom out canvas\n\tuseEffect( () => {\n\t\tif ( ! iframeDocument || ! isZoomedOut ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst maxWidth = 750;\n\t\t// Note: When we initialize the zoom out when the canvas is smaller (sidebars open),\n\t\t// initialContainerWidthRef will be smaller than the full page, and reflow will happen\n\t\t// when the canvas area becomes larger due to sidebars closing. This is a known but\n\t\t// minor divergence for now.\n\n\t\t// This scaling calculation has to happen within the JS because CSS calc() can\n\t\t// only divide and multiply by a unitless value. I.e. calc( 100px / 2 ) is valid\n\t\t// but calc( 100px / 2px ) is not.\n\t\tiframeDocument.documentElement.style.setProperty(\n\t\t\t'--wp-block-editor-iframe-zoom-out-scale',\n\t\t\tscale === 'auto-scaled'\n\t\t\t\t? ( Math.min( containerWidth, maxWidth ) -\n\t\t\t\t\t\tparseInt( frameSize ) * 2 ) /\n\t\t\t\t\t\tscaleContainerWidth\n\t\t\t\t: scale\n\t\t);\n\n\t\t// frameSize has to be a px value for the scaling and frame size to be computed correctly.\n\t\tiframeDocument.documentElement.style.setProperty(\n\t\t\t'--wp-block-editor-iframe-zoom-out-frame-size',\n\t\t\ttypeof frameSize === 'number' ? `${ frameSize }px` : frameSize\n\t\t);\n\t\tiframeDocument.documentElement.style.setProperty(\n\t\t\t'--wp-block-editor-iframe-zoom-out-content-height',\n\t\t\t`${ contentHeight }px`\n\t\t);\n\t\tiframeDocument.documentElement.style.setProperty(\n\t\t\t'--wp-block-editor-iframe-zoom-out-inner-height',\n\t\t\t`${ iframeWindowInnerHeight }px`\n\t\t);\n\t\tiframeDocument.documentElement.style.setProperty(\n\t\t\t'--wp-block-editor-iframe-zoom-out-container-width',\n\t\t\t`${ containerWidth }px`\n\t\t);\n\t\tiframeDocument.documentElement.style.setProperty(\n\t\t\t'--wp-block-editor-iframe-zoom-out-scale-container-width',\n\t\t\t`${ scaleContainerWidth }px`\n\t\t);\n\n\t\treturn () => {\n\t\t\tiframeDocument.documentElement.style.removeProperty(\n\t\t\t\t'--wp-block-editor-iframe-zoom-out-scale'\n\t\t\t);\n\t\t\tiframeDocument.documentElement.style.removeProperty(\n\t\t\t\t'--wp-block-editor-iframe-zoom-out-frame-size'\n\t\t\t);\n\t\t\tiframeDocument.documentElement.style.removeProperty(\n\t\t\t\t'--wp-block-editor-iframe-zoom-out-content-height'\n\t\t\t);\n\t\t\tiframeDocument.documentElement.style.removeProperty(\n\t\t\t\t'--wp-block-editor-iframe-zoom-out-inner-height'\n\t\t\t);\n\t\t\tiframeDocument.documentElement.style.removeProperty(\n\t\t\t\t'--wp-block-editor-iframe-zoom-out-container-width'\n\t\t\t);\n\t\t\tiframeDocument.documentElement.style.removeProperty(\n\t\t\t\t'--wp-block-editor-iframe-zoom-out-scale-container-width'\n\t\t\t);\n\t\t};\n\t}, [\n\t\tscale,\n\t\tframeSize,\n\t\tiframeDocument,\n\t\tiframeWindowInnerHeight,\n\t\tcontentHeight,\n\t\tcontainerWidth,\n\t\twindowInnerWidth,\n\t\tisZoomedOut,\n\t\tscaleContainerWidth,\n\t] );\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\t// Correct doctype is required to enable rendering in standards\n\t\t\t\t// mode. Also preload the styles to avoid a flash of unstyled\n\t\t\t\t// content.\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// We want to prevent React events from bubbling throught the iframe\n\t\t\t\t\t\t// we bubble these manually.\n\t\t\t\t\t\t/* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */\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\" ref={ windowResizeRef }>\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"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SACCC,QAAQ,EACRC,YAAY,EACZC,UAAU,EACVC,OAAO,EACPC,SAAS,EACTC,MAAM,QACA,oBAAoB;AAC3B,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SACCC,iBAAiB,EACjBC,YAAY,EACZC,YAAY,EACZC,WAAW,QACL,oBAAoB;AAC3B,SAASC,2BAA2B,IAAIC,aAAa,QAAQ,uBAAuB;AACpF,SAASC,SAAS,QAAQ,iBAAiB;;AAE3C;AACA;AACA;AACA,SAASC,wBAAwB,QAAQ,4BAA4B;AACrE,SAASC,cAAc,QAAQ,iBAAiB;AAChD,SAASC,sBAAsB,QAAQ,4BAA4B;AACnE,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA,EAAAC,QAAA,IAAAC,SAAA;AAExD,SAASC,WAAWA,CAAEC,KAAK,EAAEC,WAAW,EAAEC,KAAK,EAAG;EACjD,MAAMC,IAAI,GAAG,CAAC,CAAC;EA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CACJ,CAAC;EAAA,CACF,CAAC;AAER;AAEA,SAASU,aAAaA,CAAE7F,KAAK,EAAEF,GAAG,EAAG;EACpC,MAAMgG,aAAa,GAAGzJ,SAAS,CAC5B8D,MAAM,IACPA,MAAM,CAAEzD,gBAAiB,CAAC,CAAC0D,WAAW,CAAC,CAAC,CAAC2F,uBAAuB,EACjE,EACD,CAAC;;EAED;EACA;EACA;EACA;EACA;EACA,IAAK,CAAED,aAAa,EAAG;IACtB,OAAO,IAAI;EACZ;EAEA,oBAAOlJ,IAAA,CAAC0C,MAAM;IAAA,GAAMU,KAAK;IAAGH,YAAY,EAAGC;EAAK,CAAE,CAAC;AACpD;AAEA,eAAepE,UAAU,CAAEmK,aAAc,CAAC","ignoreList":[]}
@@ -11,9 +11,7 @@ import { __ } from '@wordpress/i18n';
11
11
  import { useSettings } from '../use-settings';
12
12
  import { POPOVER_PROPS } from './constants';
13
13
  import { useImageEditingContext } from './context';
14
- import { jsx as _jsx } from "react/jsx-runtime";
15
- import { Fragment as _Fragment } from "react/jsx-runtime";
16
- import { jsxs as _jsxs } from "react/jsx-runtime";
14
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
17
15
  function AspectRatioGroup({
18
16
  aspectRatios,
19
17
  isDisabled,