@wordpress/block-editor 14.0.0 → 14.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (807) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/README.md +10 -24
  3. package/build/autocompleters/block.js +1 -1
  4. package/build/autocompleters/block.js.map +1 -1
  5. package/build/components/block-alignment-matrix-control/index.js +2 -2
  6. package/build/components/block-alignment-matrix-control/index.js.map +1 -1
  7. package/build/components/block-breadcrumb/index.js +8 -2
  8. package/build/components/block-breadcrumb/index.js.map +1 -1
  9. package/build/components/block-canvas/index.js +8 -1
  10. package/build/components/block-canvas/index.js.map +1 -1
  11. package/build/components/block-compare/block-view.js +4 -1
  12. package/build/components/block-compare/block-view.js.map +1 -1
  13. package/build/components/block-draggable/index.js +4 -4
  14. package/build/components/block-draggable/index.js.map +1 -1
  15. package/build/components/block-draggable/use-scroll-when-dragging.js +25 -25
  16. package/build/components/block-draggable/use-scroll-when-dragging.js.map +1 -1
  17. package/build/components/block-edit/multiple-usage-warning.js +8 -2
  18. package/build/components/block-edit/multiple-usage-warning.js.map +1 -1
  19. package/build/components/block-inspector/index.js +27 -9
  20. package/build/components/block-inspector/index.js.map +1 -1
  21. package/build/components/block-list/block-invalid-warning.js +6 -3
  22. package/build/components/block-list/block-invalid-warning.js.map +1 -1
  23. package/build/components/block-list/block.js +5 -1
  24. package/build/components/block-list/block.js.map +1 -1
  25. package/build/components/block-list/use-block-props/index.js +7 -3
  26. package/build/components/block-list/use-block-props/index.js.map +1 -1
  27. package/build/components/block-list/use-block-props/use-focus-first-element.js +1 -0
  28. package/build/components/block-list/use-block-props/use-focus-first-element.js.map +1 -1
  29. package/build/components/block-list/use-block-props/use-zoom-out-mode-exit.js +46 -0
  30. package/build/components/block-list/use-block-props/use-zoom-out-mode-exit.js.map +1 -0
  31. package/build/components/block-list/use-in-between-inserter.js +11 -4
  32. package/build/components/block-list/use-in-between-inserter.js.map +1 -1
  33. package/build/components/block-lock/toolbar.js +3 -3
  34. package/build/components/block-lock/toolbar.js.map +1 -1
  35. package/build/components/block-mover/button.js +4 -1
  36. package/build/components/block-mover/button.js.map +1 -1
  37. package/build/components/block-mover/index.js +4 -1
  38. package/build/components/block-mover/index.js.map +1 -1
  39. package/build/components/block-navigation/dropdown.js +4 -1
  40. package/build/components/block-navigation/dropdown.js.map +1 -1
  41. package/build/components/block-pattern-setup/index.js +1 -4
  42. package/build/components/block-pattern-setup/index.js.map +1 -1
  43. package/build/components/block-pattern-setup/setup-toolbar.js +22 -7
  44. package/build/components/block-pattern-setup/setup-toolbar.js.map +1 -1
  45. package/build/components/block-patterns-list/index.js +11 -14
  46. package/build/components/block-patterns-list/index.js.map +1 -1
  47. package/build/components/block-patterns-paging/index.js +12 -3
  48. package/build/components/block-patterns-paging/index.js.map +1 -1
  49. package/build/components/block-popover/index.js +2 -15
  50. package/build/components/block-popover/index.js.map +1 -1
  51. package/build/components/block-quick-navigation/index.js +4 -1
  52. package/build/components/block-quick-navigation/index.js.map +1 -1
  53. package/build/components/block-settings-menu/block-mode-toggle.js +28 -34
  54. package/build/components/block-settings-menu/block-mode-toggle.js.map +1 -1
  55. package/build/components/block-settings-menu-controls/index.js +4 -0
  56. package/build/components/block-settings-menu-controls/index.js.map +1 -1
  57. package/build/components/block-switcher/index.js +22 -17
  58. package/build/components/block-switcher/index.js.map +1 -1
  59. package/build/components/block-switcher/pattern-transformations-menu.js +1 -4
  60. package/build/components/block-switcher/pattern-transformations-menu.js.map +1 -1
  61. package/build/components/block-toolbar/index.js +12 -11
  62. package/build/components/block-toolbar/index.js.map +1 -1
  63. package/build/components/block-toolbar/shuffle.js +6 -2
  64. package/build/components/block-toolbar/shuffle.js.map +1 -1
  65. package/build/components/block-tools/block-selection-button.js +8 -2
  66. package/build/components/block-tools/block-selection-button.js.map +1 -1
  67. package/build/components/block-tools/block-toolbar-popover.js +10 -6
  68. package/build/components/block-tools/block-toolbar-popover.js.map +1 -1
  69. package/build/components/block-tools/insertion-point.js +14 -3
  70. package/build/components/block-tools/insertion-point.js.map +1 -1
  71. package/build/components/block-tools/use-block-toolbar-popover-props.js +2 -1
  72. package/build/components/block-tools/use-block-toolbar-popover-props.js.map +1 -1
  73. package/build/components/block-tools/use-show-block-tools.js +2 -1
  74. package/build/components/block-tools/use-show-block-tools.js.map +1 -1
  75. package/build/components/block-tools/zoom-out-mode-inserters.js +4 -5
  76. package/build/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
  77. package/build/components/block-tools/zoom-out-popover.js +3 -4
  78. package/build/components/block-tools/zoom-out-popover.js.map +1 -1
  79. package/build/components/block-tools/zoom-out-toolbar.js +14 -5
  80. package/build/components/block-tools/zoom-out-toolbar.js.map +1 -1
  81. package/build/components/block-variation-picker/index.js +4 -1
  82. package/build/components/block-variation-picker/index.js.map +1 -1
  83. package/build/components/block-variation-transforms/index.js +4 -1
  84. package/build/components/block-variation-transforms/index.js.map +1 -1
  85. package/build/components/border-radius-control/index.js +1 -0
  86. package/build/components/border-radius-control/index.js.map +1 -1
  87. package/build/components/button-block-appender/index.js +14 -3
  88. package/build/components/button-block-appender/index.js.map +1 -1
  89. package/build/components/colors-gradients/dropdown.js +4 -1
  90. package/build/components/colors-gradients/dropdown.js.map +1 -1
  91. package/build/components/content-lock/index.js +13 -0
  92. package/build/components/content-lock/index.js.map +1 -0
  93. package/build/components/content-lock/modify-content-lock-menu-item.js +64 -0
  94. package/build/components/content-lock/modify-content-lock-menu-item.js.map +1 -0
  95. package/build/components/convert-to-group-buttons/index.js +1 -1
  96. package/build/components/convert-to-group-buttons/index.js.map +1 -1
  97. package/build/components/date-format-picker/index.js +2 -0
  98. package/build/components/date-format-picker/index.js.map +1 -1
  99. package/build/components/editor-styles/index.js +4 -3
  100. package/build/components/editor-styles/index.js.map +1 -1
  101. package/build/components/font-appearance-control/index.js +3 -0
  102. package/build/components/font-appearance-control/index.js.map +1 -1
  103. package/build/components/font-family/index.js +3 -0
  104. package/build/components/font-family/index.js.map +1 -1
  105. package/build/components/global-styles/background-panel.js +118 -50
  106. package/build/components/global-styles/background-panel.js.map +1 -1
  107. package/build/components/global-styles/color-panel.js +8 -5
  108. package/build/components/global-styles/color-panel.js.map +1 -1
  109. package/build/components/global-styles/color-panel.native.js +1 -1
  110. package/build/components/global-styles/color-panel.native.js.map +1 -1
  111. package/build/components/global-styles/dimensions-panel.js +34 -37
  112. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  113. package/build/components/global-styles/filters-panel.js +4 -1
  114. package/build/components/global-styles/filters-panel.js.map +1 -1
  115. package/build/components/global-styles/get-global-styles-changes.js +3 -1
  116. package/build/components/global-styles/get-global-styles-changes.js.map +1 -1
  117. package/build/components/global-styles/hooks.js +0 -7
  118. package/build/components/global-styles/hooks.js.map +1 -1
  119. package/build/components/global-styles/index.js +0 -6
  120. package/build/components/global-styles/index.js.map +1 -1
  121. package/build/components/global-styles/shadow-panel-components.js +13 -7
  122. package/build/components/global-styles/shadow-panel-components.js.map +1 -1
  123. package/build/components/global-styles/typography-utils.js +17 -6
  124. package/build/components/global-styles/typography-utils.js.map +1 -1
  125. package/build/components/global-styles/use-global-styles-output.js +3 -3
  126. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  127. package/build/components/global-styles/utils.js +11 -29
  128. package/build/components/global-styles/utils.js.map +1 -1
  129. package/build/components/grid/grid-item-movers.js +2 -2
  130. package/build/components/grid/grid-item-movers.js.map +1 -1
  131. package/build/components/grid/grid-visualizer.js +20 -5
  132. package/build/components/grid/grid-visualizer.js.map +1 -1
  133. package/build/components/height-control/index.js +1 -0
  134. package/build/components/height-control/index.js.map +1 -1
  135. package/build/components/iframe/index.js +8 -6
  136. package/build/components/iframe/index.js.map +1 -1
  137. package/build/components/image-editor/zoom-dropdown.js +11 -7
  138. package/build/components/image-editor/zoom-dropdown.js.map +1 -1
  139. package/build/components/inner-blocks/button-block-appender.js +8 -8
  140. package/build/components/inner-blocks/button-block-appender.js.map +1 -1
  141. package/build/components/inner-blocks/default-block-appender.js +7 -25
  142. package/build/components/inner-blocks/default-block-appender.js.map +1 -1
  143. package/build/components/inner-blocks/index.js +8 -12
  144. package/build/components/inner-blocks/index.js.map +1 -1
  145. package/build/components/inner-blocks/use-inner-block-template-sync.js +3 -3
  146. package/build/components/inner-blocks/use-inner-block-template-sync.js.map +1 -1
  147. package/build/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js +4 -1
  148. package/build/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js.map +1 -1
  149. package/build/components/inserter/block-patterns-tab/index.js +4 -1
  150. package/build/components/inserter/block-patterns-tab/index.js.map +1 -1
  151. package/build/components/inserter/media-tab/hooks.js +3 -3
  152. package/build/components/inserter/media-tab/hooks.js.map +1 -1
  153. package/build/components/inserter/media-tab/media-list.js +1 -4
  154. package/build/components/inserter/media-tab/media-list.js.map +1 -1
  155. package/build/components/inserter/media-tab/media-preview.js +8 -2
  156. package/build/components/inserter/media-tab/media-preview.js.map +1 -1
  157. package/build/components/inserter/media-tab/media-tab.js +4 -1
  158. package/build/components/inserter/media-tab/media-tab.js.map +1 -1
  159. package/build/components/inserter/menu.js +14 -13
  160. package/build/components/inserter/menu.js.map +1 -1
  161. package/build/components/inserter/quick-inserter.js +8 -1
  162. package/build/components/inserter/quick-inserter.js.map +1 -1
  163. package/build/components/inserter-list-item/index.js +4 -4
  164. package/build/components/inserter-list-item/index.js.map +1 -1
  165. package/build/components/inserter-listbox/index.js +3 -7
  166. package/build/components/inserter-listbox/index.js.map +1 -1
  167. package/build/components/inserter-listbox/item.js +4 -1
  168. package/build/components/inserter-listbox/item.js.map +1 -1
  169. package/build/components/inspector-controls/groups.js +2 -0
  170. package/build/components/inspector-controls/groups.js.map +1 -1
  171. package/build/components/inspector-controls-tabs/index.js +4 -1
  172. package/build/components/inspector-controls-tabs/index.js.map +1 -1
  173. package/build/components/inspector-controls-tabs/settings-tab.js +3 -1
  174. package/build/components/inspector-controls-tabs/settings-tab.js.map +1 -1
  175. package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js +2 -1
  176. package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -1
  177. package/build/components/inspector-popover-header/index.js +8 -2
  178. package/build/components/inspector-popover-header/index.js.map +1 -1
  179. package/build/components/letter-spacing-control/index.js +7 -4
  180. package/build/components/letter-spacing-control/index.js.map +1 -1
  181. package/build/components/line-height-control/index.js +3 -0
  182. package/build/components/line-height-control/index.js.map +1 -1
  183. package/build/components/link-control/index.js +19 -10
  184. package/build/components/link-control/index.js.map +1 -1
  185. package/build/components/link-control/settings-drawer.js +4 -1
  186. package/build/components/link-control/settings-drawer.js.map +1 -1
  187. package/build/components/list-view/block-select-button.js +4 -1
  188. package/build/components/list-view/block-select-button.js.map +1 -1
  189. package/build/components/media-placeholder/index.js +36 -10
  190. package/build/components/media-placeholder/index.js.map +1 -1
  191. package/build/components/media-replace-flow/index.js +8 -1
  192. package/build/components/media-replace-flow/index.js.map +1 -1
  193. package/build/components/media-upload/index.native.js +4 -1
  194. package/build/components/media-upload/index.native.js.map +1 -1
  195. package/build/components/multi-selection-inspector/index.js +12 -12
  196. package/build/components/multi-selection-inspector/index.js.map +1 -1
  197. package/build/components/provider/use-block-sync.js +19 -19
  198. package/build/components/provider/use-block-sync.js.map +1 -1
  199. package/build/components/rich-text/event-listeners/paste-handler.js +12 -1
  200. package/build/components/rich-text/event-listeners/paste-handler.js.map +1 -1
  201. package/build/components/rich-text/index.js +38 -30
  202. package/build/components/rich-text/index.js.map +1 -1
  203. package/build/components/rich-text/use-mark-persistent.js +5 -5
  204. package/build/components/rich-text/use-mark-persistent.js.map +1 -1
  205. package/build/components/skip-to-selected-block/index.js +4 -1
  206. package/build/components/skip-to-selected-block/index.js.map +1 -1
  207. package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js +4 -2
  208. package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
  209. package/build/components/text-alignment-control/index.js +13 -8
  210. package/build/components/text-alignment-control/index.js.map +1 -1
  211. package/build/components/text-decoration-control/index.js +13 -8
  212. package/build/components/text-decoration-control/index.js.map +1 -1
  213. package/build/components/text-transform-control/index.js +13 -8
  214. package/build/components/text-transform-control/index.js.map +1 -1
  215. package/build/components/tool-selector/index.js +4 -1
  216. package/build/components/tool-selector/index.js.map +1 -1
  217. package/build/components/url-input/button.js +12 -3
  218. package/build/components/url-input/button.js.map +1 -1
  219. package/build/components/url-input/index.js +4 -1
  220. package/build/components/url-input/index.js.map +1 -1
  221. package/build/components/url-popover/image-url-input-ui.js +2 -0
  222. package/build/components/url-popover/image-url-input-ui.js.map +1 -1
  223. package/build/components/use-block-drop-zone/index.js +12 -2
  224. package/build/components/use-block-drop-zone/index.js.map +1 -1
  225. package/build/components/writing-flow/index.js +2 -1
  226. package/build/components/writing-flow/index.js.map +1 -1
  227. package/build/components/writing-flow/use-arrow-nav.js +4 -1
  228. package/build/components/writing-flow/use-arrow-nav.js.map +1 -1
  229. package/build/components/writing-flow/use-event-redirect.js +66 -0
  230. package/build/components/writing-flow/use-event-redirect.js.map +1 -0
  231. package/build/components/writing-flow/use-input.js +31 -1
  232. package/build/components/writing-flow/use-input.js.map +1 -1
  233. package/build/components/writing-flow/use-select-all.js +14 -1
  234. package/build/components/writing-flow/use-select-all.js.map +1 -1
  235. package/build/components/writing-flow/use-selection-observer.js +20 -6
  236. package/build/components/writing-flow/use-selection-observer.js.map +1 -1
  237. package/build/components/writing-flow/use-tab-nav.js +4 -4
  238. package/build/components/writing-flow/use-tab-nav.js.map +1 -1
  239. package/build/components/writing-flow/utils.js +27 -0
  240. package/build/components/writing-flow/utils.js.map +1 -1
  241. package/build/components/writing-mode-control/index.js +13 -8
  242. package/build/components/writing-mode-control/index.js.map +1 -1
  243. package/build/hooks/background.js +19 -23
  244. package/build/hooks/background.js.map +1 -1
  245. package/build/hooks/block-bindings.js +64 -103
  246. package/build/hooks/block-bindings.js.map +1 -1
  247. package/build/hooks/content-lock-ui.js +8 -26
  248. package/build/hooks/content-lock-ui.js.map +1 -1
  249. package/build/hooks/duotone.js +0 -4
  250. package/build/hooks/duotone.js.map +1 -1
  251. package/build/hooks/layout.js +4 -1
  252. package/build/hooks/layout.js.map +1 -1
  253. package/build/hooks/spacing-visualizer.js +3 -3
  254. package/build/hooks/spacing-visualizer.js.map +1 -1
  255. package/build/hooks/style.js +1 -5
  256. package/build/hooks/style.js.map +1 -1
  257. package/build/hooks/use-bindings-attributes.js +19 -20
  258. package/build/hooks/use-bindings-attributes.js.map +1 -1
  259. package/build/hooks/use-zoom-out.js +7 -7
  260. package/build/hooks/use-zoom-out.js.map +1 -1
  261. package/build/layouts/constrained.js +42 -41
  262. package/build/layouts/constrained.js.map +1 -1
  263. package/build/layouts/flex.js +6 -1
  264. package/build/layouts/flex.js.map +1 -1
  265. package/build/layouts/grid.js +3 -0
  266. package/build/layouts/grid.js.map +1 -1
  267. package/build/layouts/utils.js +1 -7
  268. package/build/layouts/utils.js.map +1 -1
  269. package/build/private-apis.js +4 -1
  270. package/build/private-apis.js.map +1 -1
  271. package/build/store/actions.js +2 -7
  272. package/build/store/actions.js.map +1 -1
  273. package/build/store/private-actions.js +1 -0
  274. package/build/store/private-actions.js.map +1 -1
  275. package/build/store/private-keys.js +2 -1
  276. package/build/store/private-keys.js.map +1 -1
  277. package/build/store/private-selectors.js +39 -11
  278. package/build/store/private-selectors.js.map +1 -1
  279. package/build/store/reducer.js +2 -0
  280. package/build/store/reducer.js.map +1 -1
  281. package/build/store/selectors.js +19 -43
  282. package/build/store/selectors.js.map +1 -1
  283. package/build/store/utils.js +48 -0
  284. package/build/store/utils.js.map +1 -1
  285. package/build/utils/block-bindings.js +117 -0
  286. package/build/utils/block-bindings.js.map +1 -0
  287. package/build/utils/dom.js +101 -0
  288. package/build/utils/dom.js.map +1 -1
  289. package/build/utils/get-font-styles-and-weights.js +4 -4
  290. package/build/utils/get-font-styles-and-weights.js.map +1 -1
  291. package/build/utils/transform-styles/index.js +120 -16
  292. package/build/utils/transform-styles/index.js.map +1 -1
  293. package/build-module/autocompleters/block.js +1 -1
  294. package/build-module/autocompleters/block.js.map +1 -1
  295. package/build-module/components/block-alignment-matrix-control/index.js +1 -1
  296. package/build-module/components/block-alignment-matrix-control/index.js.map +1 -1
  297. package/build-module/components/block-breadcrumb/index.js +8 -2
  298. package/build-module/components/block-breadcrumb/index.js.map +1 -1
  299. package/build-module/components/block-canvas/index.js +9 -1
  300. package/build-module/components/block-canvas/index.js.map +1 -1
  301. package/build-module/components/block-compare/block-view.js +4 -1
  302. package/build-module/components/block-compare/block-view.js.map +1 -1
  303. package/build-module/components/block-draggable/index.js +4 -4
  304. package/build-module/components/block-draggable/index.js.map +1 -1
  305. package/build-module/components/block-draggable/use-scroll-when-dragging.js +25 -25
  306. package/build-module/components/block-draggable/use-scroll-when-dragging.js.map +1 -1
  307. package/build-module/components/block-edit/multiple-usage-warning.js +8 -2
  308. package/build-module/components/block-edit/multiple-usage-warning.js.map +1 -1
  309. package/build-module/components/block-inspector/index.js +27 -9
  310. package/build-module/components/block-inspector/index.js.map +1 -1
  311. package/build-module/components/block-list/block-invalid-warning.js +6 -3
  312. package/build-module/components/block-list/block-invalid-warning.js.map +1 -1
  313. package/build-module/components/block-list/block.js +5 -1
  314. package/build-module/components/block-list/block.js.map +1 -1
  315. package/build-module/components/block-list/use-block-props/index.js +7 -3
  316. package/build-module/components/block-list/use-block-props/index.js.map +1 -1
  317. package/build-module/components/block-list/use-block-props/use-focus-first-element.js +1 -0
  318. package/build-module/components/block-list/use-block-props/use-focus-first-element.js.map +1 -1
  319. package/build-module/components/block-list/use-block-props/use-zoom-out-mode-exit.js +40 -0
  320. package/build-module/components/block-list/use-block-props/use-zoom-out-mode-exit.js.map +1 -0
  321. package/build-module/components/block-list/use-in-between-inserter.js +11 -4
  322. package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
  323. package/build-module/components/block-lock/toolbar.js +3 -3
  324. package/build-module/components/block-lock/toolbar.js.map +1 -1
  325. package/build-module/components/block-mover/button.js +4 -1
  326. package/build-module/components/block-mover/button.js.map +1 -1
  327. package/build-module/components/block-mover/index.js +4 -1
  328. package/build-module/components/block-mover/index.js.map +1 -1
  329. package/build-module/components/block-navigation/dropdown.js +4 -1
  330. package/build-module/components/block-navigation/dropdown.js.map +1 -1
  331. package/build-module/components/block-pattern-setup/index.js +1 -4
  332. package/build-module/components/block-pattern-setup/index.js.map +1 -1
  333. package/build-module/components/block-pattern-setup/setup-toolbar.js +23 -8
  334. package/build-module/components/block-pattern-setup/setup-toolbar.js.map +1 -1
  335. package/build-module/components/block-patterns-list/index.js +11 -14
  336. package/build-module/components/block-patterns-list/index.js.map +1 -1
  337. package/build-module/components/block-patterns-paging/index.js +12 -3
  338. package/build-module/components/block-patterns-paging/index.js.map +1 -1
  339. package/build-module/components/block-popover/index.js +2 -15
  340. package/build-module/components/block-popover/index.js.map +1 -1
  341. package/build-module/components/block-quick-navigation/index.js +4 -1
  342. package/build-module/components/block-quick-navigation/index.js.map +1 -1
  343. package/build-module/components/block-settings-menu/block-mode-toggle.js +29 -34
  344. package/build-module/components/block-settings-menu/block-mode-toggle.js.map +1 -1
  345. package/build-module/components/block-settings-menu-controls/index.js +4 -0
  346. package/build-module/components/block-settings-menu-controls/index.js.map +1 -1
  347. package/build-module/components/block-switcher/index.js +22 -17
  348. package/build-module/components/block-switcher/index.js.map +1 -1
  349. package/build-module/components/block-switcher/pattern-transformations-menu.js +1 -4
  350. package/build-module/components/block-switcher/pattern-transformations-menu.js.map +1 -1
  351. package/build-module/components/block-toolbar/index.js +12 -11
  352. package/build-module/components/block-toolbar/index.js.map +1 -1
  353. package/build-module/components/block-toolbar/shuffle.js +6 -2
  354. package/build-module/components/block-toolbar/shuffle.js.map +1 -1
  355. package/build-module/components/block-tools/block-selection-button.js +8 -2
  356. package/build-module/components/block-tools/block-selection-button.js.map +1 -1
  357. package/build-module/components/block-tools/block-toolbar-popover.js +10 -6
  358. package/build-module/components/block-tools/block-toolbar-popover.js.map +1 -1
  359. package/build-module/components/block-tools/insertion-point.js +14 -3
  360. package/build-module/components/block-tools/insertion-point.js.map +1 -1
  361. package/build-module/components/block-tools/use-block-toolbar-popover-props.js +2 -1
  362. package/build-module/components/block-tools/use-block-toolbar-popover-props.js.map +1 -1
  363. package/build-module/components/block-tools/use-show-block-tools.js +2 -1
  364. package/build-module/components/block-tools/use-show-block-tools.js.map +1 -1
  365. package/build-module/components/block-tools/zoom-out-mode-inserters.js +4 -5
  366. package/build-module/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
  367. package/build-module/components/block-tools/zoom-out-popover.js +3 -4
  368. package/build-module/components/block-tools/zoom-out-popover.js.map +1 -1
  369. package/build-module/components/block-tools/zoom-out-toolbar.js +15 -6
  370. package/build-module/components/block-tools/zoom-out-toolbar.js.map +1 -1
  371. package/build-module/components/block-variation-picker/index.js +4 -1
  372. package/build-module/components/block-variation-picker/index.js.map +1 -1
  373. package/build-module/components/block-variation-transforms/index.js +4 -1
  374. package/build-module/components/block-variation-transforms/index.js.map +1 -1
  375. package/build-module/components/border-radius-control/index.js +1 -0
  376. package/build-module/components/border-radius-control/index.js.map +1 -1
  377. package/build-module/components/button-block-appender/index.js +15 -4
  378. package/build-module/components/button-block-appender/index.js.map +1 -1
  379. package/build-module/components/colors-gradients/dropdown.js +4 -1
  380. package/build-module/components/colors-gradients/dropdown.js.map +1 -1
  381. package/build-module/components/content-lock/index.js +2 -0
  382. package/build-module/components/content-lock/index.js.map +1 -0
  383. package/build-module/components/content-lock/modify-content-lock-menu-item.js +57 -0
  384. package/build-module/components/content-lock/modify-content-lock-menu-item.js.map +1 -0
  385. package/build-module/components/convert-to-group-buttons/index.js +1 -1
  386. package/build-module/components/convert-to-group-buttons/index.js.map +1 -1
  387. package/build-module/components/date-format-picker/index.js +2 -0
  388. package/build-module/components/date-format-picker/index.js.map +1 -1
  389. package/build-module/components/editor-styles/index.js +4 -3
  390. package/build-module/components/editor-styles/index.js.map +1 -1
  391. package/build-module/components/font-appearance-control/index.js +3 -0
  392. package/build-module/components/font-appearance-control/index.js.map +1 -1
  393. package/build-module/components/font-family/index.js +3 -0
  394. package/build-module/components/font-family/index.js.map +1 -1
  395. package/build-module/components/global-styles/background-panel.js +121 -53
  396. package/build-module/components/global-styles/background-panel.js.map +1 -1
  397. package/build-module/components/global-styles/color-panel.js +7 -4
  398. package/build-module/components/global-styles/color-panel.js.map +1 -1
  399. package/build-module/components/global-styles/color-panel.native.js +2 -2
  400. package/build-module/components/global-styles/color-panel.native.js.map +1 -1
  401. package/build-module/components/global-styles/dimensions-panel.js +36 -39
  402. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  403. package/build-module/components/global-styles/filters-panel.js +4 -1
  404. package/build-module/components/global-styles/filters-panel.js.map +1 -1
  405. package/build-module/components/global-styles/get-global-styles-changes.js +3 -1
  406. package/build-module/components/global-styles/get-global-styles-changes.js.map +1 -1
  407. package/build-module/components/global-styles/hooks.js +0 -6
  408. package/build-module/components/global-styles/hooks.js.map +1 -1
  409. package/build-module/components/global-styles/index.js +1 -1
  410. package/build-module/components/global-styles/index.js.map +1 -1
  411. package/build-module/components/global-styles/shadow-panel-components.js +13 -7
  412. package/build-module/components/global-styles/shadow-panel-components.js.map +1 -1
  413. package/build-module/components/global-styles/typography-utils.js +17 -6
  414. package/build-module/components/global-styles/typography-utils.js.map +1 -1
  415. package/build-module/components/global-styles/use-global-styles-output.js +5 -5
  416. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  417. package/build-module/components/global-styles/utils.js +11 -28
  418. package/build-module/components/global-styles/utils.js.map +1 -1
  419. package/build-module/components/grid/grid-item-movers.js +3 -3
  420. package/build-module/components/grid/grid-item-movers.js.map +1 -1
  421. package/build-module/components/grid/grid-visualizer.js +20 -5
  422. package/build-module/components/grid/grid-visualizer.js.map +1 -1
  423. package/build-module/components/height-control/index.js +1 -0
  424. package/build-module/components/height-control/index.js.map +1 -1
  425. package/build-module/components/iframe/index.js +8 -6
  426. package/build-module/components/iframe/index.js.map +1 -1
  427. package/build-module/components/image-editor/zoom-dropdown.js +12 -8
  428. package/build-module/components/image-editor/zoom-dropdown.js.map +1 -1
  429. package/build-module/components/inner-blocks/button-block-appender.js +7 -6
  430. package/build-module/components/inner-blocks/button-block-appender.js.map +1 -1
  431. package/build-module/components/inner-blocks/default-block-appender.js +6 -23
  432. package/build-module/components/inner-blocks/default-block-appender.js.map +1 -1
  433. package/build-module/components/inner-blocks/index.js +8 -12
  434. package/build-module/components/inner-blocks/index.js.map +1 -1
  435. package/build-module/components/inner-blocks/use-inner-block-template-sync.js +3 -3
  436. package/build-module/components/inner-blocks/use-inner-block-template-sync.js.map +1 -1
  437. package/build-module/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js +4 -1
  438. package/build-module/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js.map +1 -1
  439. package/build-module/components/inserter/block-patterns-tab/index.js +4 -1
  440. package/build-module/components/inserter/block-patterns-tab/index.js.map +1 -1
  441. package/build-module/components/inserter/media-tab/hooks.js +3 -3
  442. package/build-module/components/inserter/media-tab/hooks.js.map +1 -1
  443. package/build-module/components/inserter/media-tab/media-list.js +1 -4
  444. package/build-module/components/inserter/media-tab/media-list.js.map +1 -1
  445. package/build-module/components/inserter/media-tab/media-preview.js +8 -2
  446. package/build-module/components/inserter/media-tab/media-preview.js.map +1 -1
  447. package/build-module/components/inserter/media-tab/media-tab.js +4 -1
  448. package/build-module/components/inserter/media-tab/media-tab.js.map +1 -1
  449. package/build-module/components/inserter/menu.js +14 -13
  450. package/build-module/components/inserter/menu.js.map +1 -1
  451. package/build-module/components/inserter/quick-inserter.js +9 -2
  452. package/build-module/components/inserter/quick-inserter.js.map +1 -1
  453. package/build-module/components/inserter-list-item/index.js +4 -4
  454. package/build-module/components/inserter-list-item/index.js.map +1 -1
  455. package/build-module/components/inserter-listbox/index.js +3 -7
  456. package/build-module/components/inserter-listbox/index.js.map +1 -1
  457. package/build-module/components/inserter-listbox/item.js +4 -1
  458. package/build-module/components/inserter-listbox/item.js.map +1 -1
  459. package/build-module/components/inspector-controls/groups.js +2 -0
  460. package/build-module/components/inspector-controls/groups.js.map +1 -1
  461. package/build-module/components/inspector-controls-tabs/index.js +4 -1
  462. package/build-module/components/inspector-controls-tabs/index.js.map +1 -1
  463. package/build-module/components/inspector-controls-tabs/settings-tab.js +3 -1
  464. package/build-module/components/inspector-controls-tabs/settings-tab.js.map +1 -1
  465. package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js +2 -1
  466. package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -1
  467. package/build-module/components/inspector-popover-header/index.js +8 -2
  468. package/build-module/components/inspector-popover-header/index.js.map +1 -1
  469. package/build-module/components/letter-spacing-control/index.js +7 -4
  470. package/build-module/components/letter-spacing-control/index.js.map +1 -1
  471. package/build-module/components/line-height-control/index.js +3 -0
  472. package/build-module/components/line-height-control/index.js.map +1 -1
  473. package/build-module/components/link-control/index.js +19 -10
  474. package/build-module/components/link-control/index.js.map +1 -1
  475. package/build-module/components/link-control/settings-drawer.js +4 -1
  476. package/build-module/components/link-control/settings-drawer.js.map +1 -1
  477. package/build-module/components/list-view/block-select-button.js +4 -1
  478. package/build-module/components/list-view/block-select-button.js.map +1 -1
  479. package/build-module/components/media-placeholder/index.js +36 -10
  480. package/build-module/components/media-placeholder/index.js.map +1 -1
  481. package/build-module/components/media-replace-flow/index.js +8 -1
  482. package/build-module/components/media-replace-flow/index.js.map +1 -1
  483. package/build-module/components/media-upload/index.native.js +4 -1
  484. package/build-module/components/media-upload/index.native.js.map +1 -1
  485. package/build-module/components/multi-selection-inspector/index.js +12 -12
  486. package/build-module/components/multi-selection-inspector/index.js.map +1 -1
  487. package/build-module/components/provider/use-block-sync.js +19 -19
  488. package/build-module/components/provider/use-block-sync.js.map +1 -1
  489. package/build-module/components/rich-text/event-listeners/paste-handler.js +12 -1
  490. package/build-module/components/rich-text/event-listeners/paste-handler.js.map +1 -1
  491. package/build-module/components/rich-text/index.js +39 -31
  492. package/build-module/components/rich-text/index.js.map +1 -1
  493. package/build-module/components/rich-text/use-mark-persistent.js +5 -5
  494. package/build-module/components/rich-text/use-mark-persistent.js.map +1 -1
  495. package/build-module/components/skip-to-selected-block/index.js +4 -1
  496. package/build-module/components/skip-to-selected-block/index.js.map +1 -1
  497. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js +4 -2
  498. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
  499. package/build-module/components/text-alignment-control/index.js +13 -8
  500. package/build-module/components/text-alignment-control/index.js.map +1 -1
  501. package/build-module/components/text-decoration-control/index.js +13 -8
  502. package/build-module/components/text-decoration-control/index.js.map +1 -1
  503. package/build-module/components/text-transform-control/index.js +13 -8
  504. package/build-module/components/text-transform-control/index.js.map +1 -1
  505. package/build-module/components/tool-selector/index.js +4 -1
  506. package/build-module/components/tool-selector/index.js.map +1 -1
  507. package/build-module/components/url-input/button.js +12 -3
  508. package/build-module/components/url-input/button.js.map +1 -1
  509. package/build-module/components/url-input/index.js +4 -1
  510. package/build-module/components/url-input/index.js.map +1 -1
  511. package/build-module/components/url-popover/image-url-input-ui.js +2 -0
  512. package/build-module/components/url-popover/image-url-input-ui.js.map +1 -1
  513. package/build-module/components/use-block-drop-zone/index.js +12 -2
  514. package/build-module/components/use-block-drop-zone/index.js.map +1 -1
  515. package/build-module/components/writing-flow/index.js +2 -1
  516. package/build-module/components/writing-flow/index.js.map +1 -1
  517. package/build-module/components/writing-flow/use-arrow-nav.js +4 -1
  518. package/build-module/components/writing-flow/use-arrow-nav.js.map +1 -1
  519. package/build-module/components/writing-flow/use-event-redirect.js +60 -0
  520. package/build-module/components/writing-flow/use-event-redirect.js.map +1 -0
  521. package/build-module/components/writing-flow/use-input.js +31 -1
  522. package/build-module/components/writing-flow/use-input.js.map +1 -1
  523. package/build-module/components/writing-flow/use-select-all.js +14 -1
  524. package/build-module/components/writing-flow/use-select-all.js.map +1 -1
  525. package/build-module/components/writing-flow/use-selection-observer.js +16 -2
  526. package/build-module/components/writing-flow/use-selection-observer.js.map +1 -1
  527. package/build-module/components/writing-flow/use-tab-nav.js +4 -4
  528. package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
  529. package/build-module/components/writing-flow/utils.js +26 -0
  530. package/build-module/components/writing-flow/utils.js.map +1 -1
  531. package/build-module/components/writing-mode-control/index.js +13 -8
  532. package/build-module/components/writing-mode-control/index.js.map +1 -1
  533. package/build-module/hooks/background.js +19 -23
  534. package/build-module/hooks/background.js.map +1 -1
  535. package/build-module/hooks/block-bindings.js +66 -105
  536. package/build-module/hooks/block-bindings.js.map +1 -1
  537. package/build-module/hooks/content-lock-ui.js +10 -30
  538. package/build-module/hooks/content-lock-ui.js.map +1 -1
  539. package/build-module/hooks/duotone.js +0 -4
  540. package/build-module/hooks/duotone.js.map +1 -1
  541. package/build-module/hooks/layout.js +4 -1
  542. package/build-module/hooks/layout.js.map +1 -1
  543. package/build-module/hooks/spacing-visualizer.js +3 -3
  544. package/build-module/hooks/spacing-visualizer.js.map +1 -1
  545. package/build-module/hooks/style.js +1 -5
  546. package/build-module/hooks/style.js.map +1 -1
  547. package/build-module/hooks/use-bindings-attributes.js +19 -20
  548. package/build-module/hooks/use-bindings-attributes.js.map +1 -1
  549. package/build-module/hooks/use-zoom-out.js +7 -7
  550. package/build-module/hooks/use-zoom-out.js.map +1 -1
  551. package/build-module/layouts/constrained.js +44 -43
  552. package/build-module/layouts/constrained.js.map +1 -1
  553. package/build-module/layouts/flex.js +6 -1
  554. package/build-module/layouts/flex.js.map +1 -1
  555. package/build-module/layouts/grid.js +3 -0
  556. package/build-module/layouts/grid.js.map +1 -1
  557. package/build-module/layouts/utils.js +1 -7
  558. package/build-module/layouts/utils.js.map +1 -1
  559. package/build-module/private-apis.js +5 -2
  560. package/build-module/private-apis.js.map +1 -1
  561. package/build-module/store/actions.js +2 -7
  562. package/build-module/store/actions.js.map +1 -1
  563. package/build-module/store/private-actions.js +1 -0
  564. package/build-module/store/private-actions.js.map +1 -1
  565. package/build-module/store/private-keys.js +1 -0
  566. package/build-module/store/private-keys.js.map +1 -1
  567. package/build-module/store/private-selectors.js +36 -12
  568. package/build-module/store/private-selectors.js.map +1 -1
  569. package/build-module/store/reducer.js +2 -0
  570. package/build-module/store/reducer.js.map +1 -1
  571. package/build-module/store/selectors.js +22 -46
  572. package/build-module/store/selectors.js.map +1 -1
  573. package/build-module/store/utils.js +46 -0
  574. package/build-module/store/utils.js.map +1 -1
  575. package/build-module/utils/block-bindings.js +110 -0
  576. package/build-module/utils/block-bindings.js.map +1 -0
  577. package/build-module/utils/dom.js +99 -0
  578. package/build-module/utils/dom.js.map +1 -1
  579. package/build-module/utils/get-font-styles-and-weights.js +4 -4
  580. package/build-module/utils/get-font-styles-and-weights.js.map +1 -1
  581. package/build-module/utils/transform-styles/index.js +120 -16
  582. package/build-module/utils/transform-styles/index.js.map +1 -1
  583. package/build-style/content-rtl.css +9 -25
  584. package/build-style/content.css +9 -25
  585. package/build-style/default-editor-styles-rtl.css +2 -2
  586. package/build-style/default-editor-styles.css +2 -2
  587. package/build-style/style-rtl.css +53 -76
  588. package/build-style/style.css +53 -76
  589. package/build-types/utils/dom.d.ts +25 -0
  590. package/build-types/utils/dom.d.ts.map +1 -1
  591. package/package.json +34 -32
  592. package/src/autocompleters/block.js +2 -1
  593. package/src/components/block-alignment-matrix-control/index.js +1 -1
  594. package/src/components/block-breadcrumb/index.js +4 -0
  595. package/src/components/block-breadcrumb/style.scss +1 -1
  596. package/src/components/block-canvas/index.js +9 -1
  597. package/src/components/block-compare/block-view.js +7 -1
  598. package/src/components/block-draggable/content.scss +1 -1
  599. package/src/components/block-draggable/index.js +4 -4
  600. package/src/components/block-draggable/style.scss +1 -1
  601. package/src/components/block-draggable/use-scroll-when-dragging.js +25 -25
  602. package/src/components/block-edit/multiple-usage-warning.js +4 -0
  603. package/src/components/block-inspector/index.js +22 -6
  604. package/src/components/block-list/block-invalid-warning.js +4 -2
  605. package/src/components/block-list/block.js +6 -2
  606. package/src/components/block-list/content.scss +7 -16
  607. package/src/components/block-list/use-block-props/index.js +5 -2
  608. package/src/components/block-list/use-block-props/use-focus-first-element.js +1 -0
  609. package/src/components/block-list/use-block-props/use-zoom-out-mode-exit.js +44 -0
  610. package/src/components/block-list/use-in-between-inserter.js +17 -5
  611. package/src/components/block-lock/style.scss +1 -1
  612. package/src/components/block-lock/toolbar.js +3 -3
  613. package/src/components/block-mover/button.js +2 -0
  614. package/src/components/block-mover/index.js +2 -0
  615. package/src/components/block-mover/style.scss +1 -1
  616. package/src/components/block-navigation/dropdown.js +2 -0
  617. package/src/components/block-pattern-setup/index.js +3 -7
  618. package/src/components/block-pattern-setup/setup-toolbar.js +17 -4
  619. package/src/components/block-pattern-setup/style.scss +2 -2
  620. package/src/components/block-patterns-list/index.js +15 -13
  621. package/src/components/block-patterns-list/style.scss +2 -2
  622. package/src/components/block-patterns-paging/index.js +6 -0
  623. package/src/components/block-popover/index.js +7 -28
  624. package/src/components/block-popover/style.scss +1 -1
  625. package/src/components/block-quick-navigation/index.js +2 -0
  626. package/src/components/block-settings-menu/block-mode-toggle.js +28 -31
  627. package/src/components/block-settings-menu/test/block-mode-toggle.js +26 -23
  628. package/src/components/block-settings-menu-controls/index.js +7 -1
  629. package/src/components/block-switcher/index.js +26 -20
  630. package/src/components/block-switcher/pattern-transformations-menu.js +3 -7
  631. package/src/components/block-switcher/style.scss +5 -6
  632. package/src/components/block-toolbar/index.js +17 -8
  633. package/src/components/block-toolbar/shuffle.js +9 -7
  634. package/src/components/block-tools/block-selection-button.js +4 -0
  635. package/src/components/block-tools/block-toolbar-popover.js +10 -6
  636. package/src/components/block-tools/insertion-point.js +11 -0
  637. package/src/components/block-tools/style.scss +4 -5
  638. package/src/components/block-tools/use-block-toolbar-popover-props.js +2 -1
  639. package/src/components/block-tools/use-show-block-tools.js +4 -1
  640. package/src/components/block-tools/zoom-out-mode-inserters.js +5 -2
  641. package/src/components/block-tools/zoom-out-popover.js +3 -7
  642. package/src/components/block-tools/zoom-out-toolbar.js +20 -6
  643. package/src/components/block-variation-picker/README.md +2 -2
  644. package/src/components/block-variation-picker/index.js +6 -1
  645. package/src/components/block-variation-transforms/index.js +2 -0
  646. package/src/components/block-variation-transforms/style.scss +2 -2
  647. package/src/components/border-radius-control/index.js +1 -0
  648. package/src/components/border-radius-control/style.scss +0 -10
  649. package/src/components/button-block-appender/content.scss +0 -1
  650. package/src/components/button-block-appender/index.js +14 -3
  651. package/src/components/color-palette/test/control.js +15 -2
  652. package/src/components/colors-gradients/dropdown.js +5 -1
  653. package/src/components/colors-gradients/style.scss +4 -4
  654. package/src/components/content-lock/index.js +1 -0
  655. package/src/components/content-lock/modify-content-lock-menu-item.js +58 -0
  656. package/src/components/convert-to-group-buttons/index.js +1 -1
  657. package/src/components/date-format-picker/index.js +2 -0
  658. package/src/components/default-block-appender/content.scss +0 -1
  659. package/src/components/editor-styles/index.js +4 -3
  660. package/src/components/font-appearance-control/index.js +3 -0
  661. package/src/components/font-family/README.md +11 -2
  662. package/src/components/font-family/index.js +3 -0
  663. package/src/components/global-styles/background-panel.js +135 -64
  664. package/src/components/global-styles/color-panel.js +8 -4
  665. package/src/components/global-styles/color-panel.native.js +2 -2
  666. package/src/components/global-styles/dimensions-panel.js +40 -40
  667. package/src/components/global-styles/filters-panel.js +5 -1
  668. package/src/components/global-styles/get-global-styles-changes.js +4 -1
  669. package/src/components/global-styles/hooks.js +0 -5
  670. package/src/components/global-styles/index.js +0 -1
  671. package/src/components/global-styles/shadow-panel-components.js +12 -8
  672. package/src/components/global-styles/style.scss +16 -6
  673. package/src/components/global-styles/test/typography-utils.js +96 -5
  674. package/src/components/global-styles/test/use-global-styles-output.js +20 -4
  675. package/src/components/global-styles/test/utils.js +10 -0
  676. package/src/components/global-styles/typography-utils.js +22 -6
  677. package/src/components/global-styles/use-global-styles-output.js +5 -6
  678. package/src/components/global-styles/utils.js +11 -35
  679. package/src/components/grid/grid-item-movers.js +3 -3
  680. package/src/components/grid/grid-visualizer.js +22 -7
  681. package/src/components/grid/style.scss +1 -1
  682. package/src/components/height-control/index.js +1 -0
  683. package/src/components/iframe/index.js +8 -6
  684. package/src/components/image-editor/zoom-dropdown.js +17 -9
  685. package/src/components/inner-blocks/button-block-appender.js +5 -7
  686. package/src/components/inner-blocks/default-block-appender.js +4 -23
  687. package/src/components/inner-blocks/index.js +11 -10
  688. package/src/components/inner-blocks/use-inner-block-template-sync.js +3 -3
  689. package/src/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js +2 -0
  690. package/src/components/inserter/block-patterns-tab/index.js +2 -0
  691. package/src/components/inserter/media-tab/hooks.js +3 -3
  692. package/src/components/inserter/media-tab/media-list.js +1 -4
  693. package/src/components/inserter/media-tab/media-preview.js +12 -2
  694. package/src/components/inserter/media-tab/media-tab.js +2 -0
  695. package/src/components/inserter/menu.js +13 -22
  696. package/src/components/inserter/quick-inserter.js +6 -1
  697. package/src/components/inserter/style.scss +7 -9
  698. package/src/components/inserter-list-item/index.js +4 -4
  699. package/src/components/inserter-list-item/style.scss +2 -3
  700. package/src/components/inserter-listbox/index.js +2 -8
  701. package/src/components/inserter-listbox/item.js +9 -1
  702. package/src/components/inspector-controls/groups.js +2 -0
  703. package/src/components/inspector-controls-tabs/index.js +2 -0
  704. package/src/components/inspector-controls-tabs/settings-tab.js +1 -0
  705. package/src/components/inspector-controls-tabs/use-inspector-controls-tabs.js +5 -2
  706. package/src/components/inspector-popover-header/index.js +4 -0
  707. package/src/components/letter-spacing-control/README.md +8 -1
  708. package/src/components/letter-spacing-control/index.js +7 -4
  709. package/src/components/line-height-control/README.md +7 -0
  710. package/src/components/line-height-control/index.js +3 -0
  711. package/src/components/link-control/index.js +17 -8
  712. package/src/components/link-control/settings-drawer.js +2 -0
  713. package/src/components/link-control/style.scss +2 -4
  714. package/src/components/list-view/block-select-button.js +2 -0
  715. package/src/components/list-view/style.scss +14 -16
  716. package/src/components/media-placeholder/index.js +26 -7
  717. package/src/components/media-replace-flow/index.js +12 -1
  718. package/src/components/media-upload/README.md +2 -0
  719. package/src/components/media-upload/index.native.js +2 -0
  720. package/src/components/multi-selection-inspector/index.js +8 -9
  721. package/src/components/provider/use-block-sync.js +20 -20
  722. package/src/components/responsive-block-control/README.md +3 -26
  723. package/src/components/responsive-block-control/test/index.js +1 -0
  724. package/src/components/rich-text/content.scss +1 -1
  725. package/src/components/rich-text/event-listeners/paste-handler.js +6 -1
  726. package/src/components/rich-text/index.js +54 -41
  727. package/src/components/rich-text/style.scss +1 -1
  728. package/src/components/rich-text/use-mark-persistent.js +5 -5
  729. package/src/components/skip-to-selected-block/index.js +2 -0
  730. package/src/components/spacing-sizes-control/input-controls/spacing-input-control.js +8 -4
  731. package/src/components/spacing-sizes-control/style.scss +17 -16
  732. package/src/components/text-alignment-control/index.js +20 -8
  733. package/src/components/text-decoration-control/index.js +20 -8
  734. package/src/components/text-decoration-control/stories/index.story.js +0 -4
  735. package/src/components/text-transform-control/index.js +20 -8
  736. package/src/components/text-transform-control/stories/index.story.js +0 -4
  737. package/src/components/tool-selector/index.js +2 -0
  738. package/src/components/url-input/button.js +6 -0
  739. package/src/components/url-input/index.js +2 -0
  740. package/src/components/url-input/style.scss +2 -2
  741. package/src/components/url-popover/image-url-input-ui.js +2 -0
  742. package/src/components/url-popover/stories/index.story.js +7 -1
  743. package/src/components/use-block-drop-zone/index.js +21 -3
  744. package/src/components/warning/content.scss +3 -10
  745. package/src/components/writing-flow/index.js +2 -0
  746. package/src/components/writing-flow/use-arrow-nav.js +9 -2
  747. package/src/components/writing-flow/use-event-redirect.js +72 -0
  748. package/src/components/writing-flow/use-input.js +36 -1
  749. package/src/components/writing-flow/use-select-all.js +18 -1
  750. package/src/components/writing-flow/use-selection-observer.js +23 -3
  751. package/src/components/writing-flow/use-tab-nav.js +4 -4
  752. package/src/components/writing-flow/utils.js +30 -0
  753. package/src/components/writing-mode-control/index.js +20 -8
  754. package/src/hooks/background.js +21 -27
  755. package/src/hooks/block-bindings.js +64 -122
  756. package/src/hooks/block-bindings.scss +2 -10
  757. package/src/hooks/content-lock-ui.js +11 -36
  758. package/src/hooks/duotone.js +0 -4
  759. package/src/hooks/layout.js +2 -0
  760. package/src/hooks/layout.scss +3 -11
  761. package/src/hooks/spacing-visualizer.js +3 -3
  762. package/src/hooks/style.js +1 -4
  763. package/src/hooks/test/background.js +60 -0
  764. package/src/hooks/use-bindings-attributes.js +23 -24
  765. package/src/hooks/use-zoom-out.js +7 -7
  766. package/src/layouts/constrained.js +51 -47
  767. package/src/layouts/flex.js +4 -0
  768. package/src/layouts/grid.js +3 -0
  769. package/src/layouts/test/grid.js +2 -2
  770. package/src/layouts/test/utils.js +6 -8
  771. package/src/layouts/utils.js +1 -9
  772. package/src/private-apis.js +4 -0
  773. package/src/store/actions.js +4 -6
  774. package/src/store/private-actions.js +1 -0
  775. package/src/store/private-keys.js +1 -0
  776. package/src/store/private-selectors.js +44 -7
  777. package/src/store/reducer.js +2 -0
  778. package/src/store/selectors.js +32 -51
  779. package/src/store/test/private-selectors.js +89 -0
  780. package/src/store/utils.js +50 -0
  781. package/src/style.scss +0 -1
  782. package/src/utils/block-bindings.js +97 -0
  783. package/src/utils/dom.js +117 -0
  784. package/src/utils/get-font-styles-and-weights.js +12 -4
  785. package/src/utils/test/get-font-styles-and-weights.js +148 -0
  786. package/src/utils/test/transform-styles.js +284 -26
  787. package/src/utils/transform-styles/index.js +132 -21
  788. package/tsconfig.json +1 -0
  789. package/tsconfig.tsbuildinfo +1 -1
  790. package/build/components/global-styles/theme-file-uri-utils.js +0 -21
  791. package/build/components/global-styles/theme-file-uri-utils.js.map +0 -1
  792. package/build/components/inner-blocks/with-client-id.js +0 -28
  793. package/build/components/inner-blocks/with-client-id.js.map +0 -1
  794. package/build/components/segmented-text-control/index.js +0 -63
  795. package/build/components/segmented-text-control/index.js.map +0 -1
  796. package/build-module/components/global-styles/theme-file-uri-utils.js +0 -15
  797. package/build-module/components/global-styles/theme-file-uri-utils.js.map +0 -1
  798. package/build-module/components/inner-blocks/with-client-id.js +0 -21
  799. package/build-module/components/inner-blocks/with-client-id.js.map +0 -1
  800. package/build-module/components/segmented-text-control/index.js +0 -58
  801. package/build-module/components/segmented-text-control/index.js.map +0 -1
  802. package/src/components/global-styles/test/theme-file-uri-utils.js +0 -41
  803. package/src/components/global-styles/theme-file-uri-utils.js +0 -18
  804. package/src/components/inner-blocks/with-client-id.js +0 -19
  805. package/src/components/segmented-text-control/index.js +0 -63
  806. package/src/components/segmented-text-control/style.scss +0 -15
  807. package/src/utils/test/__snapshots__/transform-styles.js.snap +0 -109
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_element","_i18n","_compose","_components","_data","_blockSelectionClearer","_writingFlow","_getCompatibilityStyles","_store","_jsxRuntime","bubbleEvent","event","Constructor","frame","init","key","contentDocument","defaultView","MouseEvent","rect","getBoundingClientRect","clientX","left","clientY","top","newEvent","type","defaultPrevented","preventDefault","cancelled","dispatchEvent","useBubbleEvents","iframeDocument","useRefEffect","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","useSelect","select","getSettings","blockEditorStore","settings","__unstableResolvedAssets","__unstableIsPreviewMode","styles","scripts","setIframeDocument","useState","prevContainerWidth","useRef","bodyClasses","setBodyClasses","clearerRef","useBlockSelectionClearer","before","writingFlowRef","after","useWritingFlow","contentResizeListener","height","contentHeight","useResizeObserver","containerResizeListener","width","containerWidth","setRef","node","_load","iFrameDocument","preventFileDropDefault","onLoad","ownerDocument","classList","add","Array","from","body","filter","startsWith","dir","compatStyle","getCompatibilityStyles","getElementById","id","head","appendChild","cloneNode","console","warn","iframeWindowInnerHeight","setIframeWindowInnerHeight","iframeResizeRef","nodeWindow","innerHeight","onResize","windowInnerWidth","setWindowInnerWidth","windowResizeRef","innerWidth","isZoomedOut","useEffect","current","disabledRef","useDisabled","isDisabled","bodyRef","useMergeRefs","src","cleanup","useMemo","_src","URL","createObjectURL","Blob","revokeObjectURL","maxWidth","style","setProperty","Math","min","remove","removeProperty","shouldRenderFocusCaptureElements","iframe","jsxs","Fragment","jsx","onKeyDown","currentTarget","target","stopPropagation","nativeEvent","KeyboardEvent","createPortal","className","clsx","__experimentalStyleProvider","document","IframeIfReady","isInitialised","__internalIsInitialized","_default","exports","default","forwardRef"],"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 prevContainerWidth = 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\tprevContainerWidth.current = containerWidth;\n\t}, [ containerWidth ] );\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\tprevContainerWidth.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`${ prevContainerWidth.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 && `${ prevContainerWidth.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":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AAQA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAMA,IAAAI,WAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AAKA,IAAAM,sBAAA,GAAAN,OAAA;AACA,IAAAO,YAAA,GAAAP,OAAA;AACA,IAAAQ,uBAAA,GAAAR,OAAA;AACA,IAAAS,MAAA,GAAAT,OAAA;AAAwD,IAAAU,WAAA,GAAAV,OAAA;AAhCxD;AACA;AACA;;AAGA;AACA;AACA;;AAmBA;AACA;AACA;;AAMA,S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C;AACpD;AAAC,IAAA8G,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEc,IAAAC,mBAAU,EAAEN,aAAc,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_element","_i18n","_compose","_components","_data","_blockSelectionClearer","_writingFlow","_getCompatibilityStyles","_store","_jsxRuntime","bubbleEvent","event","Constructor","frame","init","key","contentDocument","defaultView","MouseEvent","rect","getBoundingClientRect","clientX","left","clientY","top","newEvent","type","defaultPrevented","preventDefault","cancelled","dispatchEvent","useBubbleEvents","iframeDocument","useRefEffect","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","useSelect","select","getSettings","blockEditorStore","settings","__unstableResolvedAssets","__unstableIsPreviewMode","styles","scripts","setIframeDocument","useState","prevContainerWidthRef","useRef","bodyClasses","setBodyClasses","clearerRef","useBlockSelectionClearer","before","writingFlowRef","after","useWritingFlow","contentResizeListener","height","contentHeight","useResizeObserver","containerResizeListener","width","containerWidth","setRef","node","_load","iFrameDocument","preventFileDropDefault","onLoad","ownerDocument","classList","add","Array","from","body","filter","startsWith","dir","compatStyle","getCompatibilityStyles","getElementById","id","head","appendChild","cloneNode","console","warn","iframeWindowInnerHeight","setIframeWindowInnerHeight","iframeResizeRef","nodeWindow","innerHeight","onResize","windowInnerWidth","setWindowInnerWidth","windowResizeRef","innerWidth","isZoomedOut","useEffect","current","disabledRef","useDisabled","isDisabled","bodyRef","useMergeRefs","src","cleanup","useMemo","_src","URL","createObjectURL","Blob","revokeObjectURL","maxWidth","style","setProperty","Math","min","remove","removeProperty","shouldRenderFocusCaptureElements","iframe","jsxs","Fragment","jsx","onKeyDown","currentTarget","target","stopPropagation","nativeEvent","KeyboardEvent","createPortal","className","clsx","__experimentalStyleProvider","document","IframeIfReady","isInitialised","__internalIsInitialized","_default","exports","default","forwardRef"],"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":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AAQA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAMA,IAAAI,WAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AAKA,IAAAM,sBAAA,GAAAN,OAAA;AACA,IAAAO,YAAA,GAAAP,OAAA;AACA,IAAAQ,uBAAA,GAAAR,OAAA;AACA,IAAAS,MAAA,GAAAT,OAAA;AAAwD,IAAAU,WAAA,GAAAV,OAAA;AAhCxD;AACA;AACA;;AAGA;AACA;AACA;;AAmBA;AACA;AACA;;AAMA,SAASW,WAAWA,CAAEC,KAAK,EAAEC,WAAW,EAAEC,KAAK,EAAG;EACjD,MAAMC,IAAI,GAAG,CAAC,CAAC;EAEf,KAAM,MAAMC,GAAG,IAAIJ,KAAK,EAAG;IAC1BG,IAAI,CAAEC,GAAG,CAAE,GAAGJ,KAAK,CAAEI,GAAG,CAAE;EAC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38
38
  disabled: isInProgress
39
39
  }),
40
- renderContent: () => /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.RangeControl, {
41
- __nextHasNoMarginBottom: true,
42
- label: (0, _i18n.__)('Zoom'),
43
- min: _constants.MIN_ZOOM,
44
- max: _constants.MAX_ZOOM,
45
- value: Math.round(zoom),
46
- onChange: setZoom
40
+ renderContent: () => /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalDropdownContentWrapper, {
41
+ paddingSize: "medium",
42
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.RangeControl, {
43
+ __next40pxDefaultSize: true,
44
+ __nextHasNoMarginBottom: true,
45
+ label: (0, _i18n.__)('Zoom'),
46
+ min: _constants.MIN_ZOOM,
47
+ max: _constants.MAX_ZOOM,
48
+ value: Math.round(zoom),
49
+ onChange: setZoom
50
+ })
47
51
  })
48
52
  });
49
53
  }
@@ -1 +1 @@
1
- {"version":3,"names":["_components","require","_i18n","_icons","_constants","_context","_jsxRuntime","ZoomDropdown","isInProgress","zoom","setZoom","useImageEditingContext","jsx","Dropdown","contentClassName","popoverProps","POPOVER_PROPS","renderToggle","isOpen","onToggle","ToolbarButton","icon","search","label","__","onClick","disabled","renderContent","RangeControl","__nextHasNoMarginBottom","min","MIN_ZOOM","max","MAX_ZOOM","value","Math","round","onChange"],"sources":["@wordpress/block-editor/src/components/image-editor/zoom-dropdown.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { ToolbarButton, RangeControl, Dropdown } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { search } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { MIN_ZOOM, MAX_ZOOM, POPOVER_PROPS } from './constants';\nimport { useImageEditingContext } from './context';\n\nexport default function ZoomDropdown() {\n\tconst { isInProgress, zoom, setZoom } = useImageEditingContext();\n\treturn (\n\t\t<Dropdown\n\t\t\tcontentClassName=\"wp-block-image__zoom\"\n\t\t\tpopoverProps={ POPOVER_PROPS }\n\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t<ToolbarButton\n\t\t\t\t\ticon={ search }\n\t\t\t\t\tlabel={ __( 'Zoom' ) }\n\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\tdisabled={ isInProgress }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\trenderContent={ () => (\n\t\t\t\t<RangeControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Zoom' ) }\n\t\t\t\t\tmin={ MIN_ZOOM }\n\t\t\t\t\tmax={ MAX_ZOOM }\n\t\t\t\t\tvalue={ Math.round( zoom ) }\n\t\t\t\t\tonChange={ setZoom }\n\t\t\t\t/>\n\t\t\t) }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAKA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AAAmD,IAAAK,WAAA,GAAAL,OAAA;AAXnD;AACA;AACA;;AAKA;AACA;AACA;;AAIe,SAASM,YAAYA,CAAA,EAAG;EACtC,MAAM;IAAEC,YAAY;IAAEC,IAAI;IAAEC;EAAQ,CAAC,GAAG,IAAAC,+BAAsB,EAAC,CAAC;EAChE,oBACC,IAAAL,WAAA,CAAAM,GAAA,EAACZ,WAAA,CAAAa,QAAQ;IACRC,gBAAgB,EAAC,sBAAsB;IACvCC,YAAY,EAAGC,wBAAe;IAC9BC,YAAY,EAAGA,CAAE;MAAEC,MAAM;MAAEC;IAAS,CAAC,kBACpC,IAAAb,WAAA,CAAAM,GAAA,EAACZ,WAAA,CAAAoB,aAAa;MACbC,IAAI,EAAGC,aAAQ;MACfC,KAAK,EAAG,IAAAC,QAAE,EAAE,MAAO,CAAG;MACtBC,OAAO,EAAGN,QAAU;MACpB,iBAAgBD,MAAQ;MACxBQ,QAAQ,EAAGlB;IAAc,CACzB,CACC;IACHmB,aAAa,EAAGA,CAAA,kBACf,IAAArB,WAAA,CAAAM,GAAA,EAACZ,WAAA,CAAA4B,YAAY;MACZC,uBAAuB;MACvBN,KAAK,EAAG,IAAAC,QAAE,EAAE,MAAO,CAAG;MACtBM,GAAG,EAAGC,mBAAU;MAChBC,GAAG,EAAGC,mBAAU;MAChBC,KAAK,EAAGC,IAAI,CAACC,KAAK,CAAE3B,IAAK,CAAG;MAC5B4B,QAAQ,EAAG3B;IAAS,CACpB;EACC,CACH,CAAC;AAEJ","ignoreList":[]}
1
+ {"version":3,"names":["_components","require","_i18n","_icons","_constants","_context","_jsxRuntime","ZoomDropdown","isInProgress","zoom","setZoom","useImageEditingContext","jsx","Dropdown","contentClassName","popoverProps","POPOVER_PROPS","renderToggle","isOpen","onToggle","ToolbarButton","icon","search","label","__","onClick","disabled","renderContent","__experimentalDropdownContentWrapper","paddingSize","children","RangeControl","__next40pxDefaultSize","__nextHasNoMarginBottom","min","MIN_ZOOM","max","MAX_ZOOM","value","Math","round","onChange"],"sources":["@wordpress/block-editor/src/components/image-editor/zoom-dropdown.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tToolbarButton,\n\tRangeControl,\n\tDropdown,\n\t__experimentalDropdownContentWrapper as DropdownContentWrapper,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { search } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { MIN_ZOOM, MAX_ZOOM, POPOVER_PROPS } from './constants';\nimport { useImageEditingContext } from './context';\n\nexport default function ZoomDropdown() {\n\tconst { isInProgress, zoom, setZoom } = useImageEditingContext();\n\treturn (\n\t\t<Dropdown\n\t\t\tcontentClassName=\"wp-block-image__zoom\"\n\t\t\tpopoverProps={ POPOVER_PROPS }\n\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t<ToolbarButton\n\t\t\t\t\ticon={ search }\n\t\t\t\t\tlabel={ __( 'Zoom' ) }\n\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\tdisabled={ isInProgress }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\trenderContent={ () => (\n\t\t\t\t<DropdownContentWrapper paddingSize=\"medium\">\n\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Zoom' ) }\n\t\t\t\t\t\tmin={ MIN_ZOOM }\n\t\t\t\t\t\tmax={ MAX_ZOOM }\n\t\t\t\t\t\tvalue={ Math.round( zoom ) }\n\t\t\t\t\t\tonChange={ setZoom }\n\t\t\t\t\t/>\n\t\t\t\t</DropdownContentWrapper>\n\t\t\t) }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AAMA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAKA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AAAmD,IAAAK,WAAA,GAAAL,OAAA;AAhBnD;AACA;AACA;;AAUA;AACA;AACA;;AAIe,SAASM,YAAYA,CAAA,EAAG;EACtC,MAAM;IAAEC,YAAY;IAAEC,IAAI;IAAEC;EAAQ,CAAC,GAAG,IAAAC,+BAAsB,EAAC,CAAC;EAChE,oBACC,IAAAL,WAAA,CAAAM,GAAA,EAACZ,WAAA,CAAAa,QAAQ;IACRC,gBAAgB,EAAC,sBAAsB;IACvCC,YAAY,EAAGC,wBAAe;IAC9BC,YAAY,EAAGA,CAAE;MAAEC,MAAM;MAAEC;IAAS,CAAC,kBACpC,IAAAb,WAAA,CAAAM,GAAA,EAACZ,WAAA,CAAAoB,aAAa;MACbC,IAAI,EAAGC,aAAQ;MACfC,KAAK,EAAG,IAAAC,QAAE,EAAE,MAAO,CAAG;MACtBC,OAAO,EAAGN,QAAU;MACpB,iBAAgBD,MAAQ;MACxBQ,QAAQ,EAAGlB;IAAc,CACzB,CACC;IACHmB,aAAa,EAAGA,CAAA,kBACf,IAAArB,WAAA,CAAAM,GAAA,EAACZ,WAAA,CAAA4B,oCAAsB;MAACC,WAAW,EAAC,QAAQ;MAAAC,QAAA,eAC3C,IAAAxB,WAAA,CAAAM,GAAA,EAACZ,WAAA,CAAA+B,YAAY;QACZC,qBAAqB;QACrBC,uBAAuB;QACvBV,KAAK,EAAG,IAAAC,QAAE,EAAE,MAAO,CAAG;QACtBU,GAAG,EAAGC,mBAAU;QAChBC,GAAG,EAAGC,mBAAU;QAChBC,KAAK,EAAGC,IAAI,CAACC,KAAK,CAAE/B,IAAK,CAAG;QAC5BgC,QAAQ,EAAG/B;MAAS,CACpB;IAAC,CACqB;EACtB,CACH,CAAC;AAEJ","ignoreList":[]}
@@ -4,10 +4,10 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.default = exports.ButtonBlockAppender = void 0;
7
+ exports.default = ButtonBlockAppender;
8
8
  var _clsx = _interopRequireDefault(require("clsx"));
9
9
  var _buttonBlockAppender = _interopRequireDefault(require("../button-block-appender"));
10
- var _withClientId = _interopRequireDefault(require("./with-client-id"));
10
+ var _context = require("../block-edit/context");
11
11
  var _jsxRuntime = require("react/jsx-runtime");
12
12
  /**
13
13
  * External dependencies
@@ -17,13 +17,15 @@ var _jsxRuntime = require("react/jsx-runtime");
17
17
  * Internal dependencies
18
18
  */
19
19
 
20
- const ButtonBlockAppender = ({
21
- clientId,
20
+ function ButtonBlockAppender({
22
21
  showSeparator,
23
22
  isFloating,
24
23
  onAddBlock,
25
24
  isToggle
26
- }) => {
25
+ }) {
26
+ const {
27
+ clientId
28
+ } = (0, _context.useBlockEditContext)();
27
29
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_buttonBlockAppender.default, {
28
30
  className: (0, _clsx.default)({
29
31
  'block-list-appender__toggle': isToggle
@@ -33,7 +35,5 @@ const ButtonBlockAppender = ({
33
35
  isFloating: isFloating,
34
36
  onAddBlock: onAddBlock
35
37
  });
36
- };
37
- exports.ButtonBlockAppender = ButtonBlockAppender;
38
- var _default = exports.default = (0, _withClientId.default)(ButtonBlockAppender);
38
+ }
39
39
  //# sourceMappingURL=button-block-appender.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_buttonBlockAppender","_withClientId","_jsxRuntime","ButtonBlockAppender","clientId","showSeparator","isFloating","onAddBlock","isToggle","jsx","default","className","clsx","rootClientId","exports","_default","withClientId"],"sources":["@wordpress/block-editor/src/components/inner-blocks/button-block-appender.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * Internal dependencies\n */\nimport BaseButtonBlockAppender from '../button-block-appender';\nimport withClientId from './with-client-id';\n\nexport const ButtonBlockAppender = ( {\n\tclientId,\n\tshowSeparator,\n\tisFloating,\n\tonAddBlock,\n\tisToggle,\n} ) => {\n\treturn (\n\t\t<BaseButtonBlockAppender\n\t\t\tclassName={ clsx( {\n\t\t\t\t'block-list-appender__toggle': isToggle,\n\t\t\t} ) }\n\t\t\trootClientId={ clientId }\n\t\t\tshowSeparator={ showSeparator }\n\t\t\tisFloating={ isFloating }\n\t\t\tonAddBlock={ onAddBlock }\n\t\t/>\n\t);\n};\n\nexport default withClientId( ButtonBlockAppender );\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,oBAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,aAAA,GAAAH,sBAAA,CAAAC,OAAA;AAA4C,IAAAG,WAAA,GAAAH,OAAA;AAT5C;AACA;AACA;;AAGA;AACA;AACA;;AAIO,MAAMI,mBAAmB,GAAGA,CAAE;EACpCC,QAAQ;EACRC,aAAa;EACbC,UAAU;EACVC,UAAU;EACVC;AACD,CAAC,KAAM;EACN,oBACC,IAAAN,WAAA,CAAAO,GAAA,EAACT,oBAAA,CAAAU,OAAuB;IACvBC,SAAS,EAAG,IAAAC,aAAI,EAAE;MACjB,6BAA6B,EAAEJ;IAChC,CAAE,CAAG;IACLK,YAAY,EAAGT,QAAU;IACzBC,aAAa,EAAGA,aAAe;IAC/BC,UAAU,EAAGA,UAAY;IACzBC,UAAU,EAAGA;EAAY,CACzB,CAAC;AAEJ,CAAC;AAACO,OAAA,CAAAX,mBAAA,GAAAA,mBAAA;AAAA,IAAAY,QAAA,GAAAD,OAAA,CAAAJ,OAAA,GAEa,IAAAM,qBAAY,EAAEb,mBAAoB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_buttonBlockAppender","_context","_jsxRuntime","ButtonBlockAppender","showSeparator","isFloating","onAddBlock","isToggle","clientId","useBlockEditContext","jsx","default","className","clsx","rootClientId"],"sources":["@wordpress/block-editor/src/components/inner-blocks/button-block-appender.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * Internal dependencies\n */\nimport BaseButtonBlockAppender from '../button-block-appender';\nimport { useBlockEditContext } from '../block-edit/context';\n\nexport default function ButtonBlockAppender( {\n\tshowSeparator,\n\tisFloating,\n\tonAddBlock,\n\tisToggle,\n} ) {\n\tconst { clientId } = useBlockEditContext();\n\treturn (\n\t\t<BaseButtonBlockAppender\n\t\t\tclassName={ clsx( {\n\t\t\t\t'block-list-appender__toggle': isToggle,\n\t\t\t} ) }\n\t\t\trootClientId={ clientId }\n\t\t\tshowSeparator={ showSeparator }\n\t\t\tisFloating={ isFloating }\n\t\t\tonAddBlock={ onAddBlock }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,oBAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAA4D,IAAAG,WAAA,GAAAH,OAAA;AAT5D;AACA;AACA;;AAGA;AACA;AACA;;AAIe,SAASI,mBAAmBA,CAAE;EAC5CC,aAAa;EACbC,UAAU;EACVC,UAAU;EACVC;AACD,CAAC,EAAG;EACH,MAAM;IAAEC;EAAS,CAAC,GAAG,IAAAC,4BAAmB,EAAC,CAAC;EAC1C,oBACC,IAAAP,WAAA,CAAAQ,GAAA,EAACV,oBAAA,CAAAW,OAAuB;IACvBC,SAAS,EAAG,IAAAC,aAAI,EAAE;MACjB,6BAA6B,EAAEN;IAChC,CAAE,CAAG;IACLO,YAAY,EAAGN,QAAU;IACzBJ,aAAa,EAAGA,aAAe;IAC/BC,UAAU,EAAGA,UAAY;IACzBC,UAAU,EAAGA;EAAY,CACzB,CAAC;AAEJ","ignoreList":[]}
@@ -4,38 +4,20 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.default = exports.DefaultBlockAppender = void 0;
8
- var _compose = require("@wordpress/compose");
9
- var _data = require("@wordpress/data");
7
+ exports.default = DefaultBlockAppender;
10
8
  var _defaultBlockAppender = _interopRequireDefault(require("../default-block-appender"));
11
- var _withClientId = _interopRequireDefault(require("./with-client-id"));
12
- var _store = require("../../store");
9
+ var _context = require("../block-edit/context");
13
10
  var _jsxRuntime = require("react/jsx-runtime");
14
- /**
15
- * WordPress dependencies
16
- */
17
-
18
11
  /**
19
12
  * Internal dependencies
20
13
  */
21
14
 
22
- const DefaultBlockAppender = ({
23
- clientId
24
- }) => {
15
+ function DefaultBlockAppender() {
16
+ const {
17
+ clientId
18
+ } = (0, _context.useBlockEditContext)();
25
19
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_defaultBlockAppender.default, {
26
20
  rootClientId: clientId
27
21
  });
28
- };
29
- exports.DefaultBlockAppender = DefaultBlockAppender;
30
- var _default = exports.default = (0, _compose.compose)([_withClientId.default, (0, _data.withSelect)((select, {
31
- clientId
32
- }) => {
33
- const {
34
- getBlockOrder
35
- } = select(_store.store);
36
- const blockClientIds = getBlockOrder(clientId);
37
- return {
38
- lastBlockClientId: blockClientIds[blockClientIds.length - 1]
39
- };
40
- })])(DefaultBlockAppender);
22
+ }
41
23
  //# sourceMappingURL=default-block-appender.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_compose","require","_data","_defaultBlockAppender","_interopRequireDefault","_withClientId","_store","_jsxRuntime","DefaultBlockAppender","clientId","jsx","default","rootClientId","exports","_default","compose","withClientId","withSelect","select","getBlockOrder","blockEditorStore","blockClientIds","lastBlockClientId","length"],"sources":["@wordpress/block-editor/src/components/inner-blocks/default-block-appender.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { compose } from '@wordpress/compose';\nimport { withSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport BaseDefaultBlockAppender from '../default-block-appender';\nimport withClientId from './with-client-id';\nimport { store as blockEditorStore } from '../../store';\n\nexport const DefaultBlockAppender = ( { clientId } ) => {\n\treturn <BaseDefaultBlockAppender rootClientId={ clientId } />;\n};\n\nexport default compose( [\n\twithClientId,\n\twithSelect( ( select, { clientId } ) => {\n\t\tconst { getBlockOrder } = select( blockEditorStore );\n\n\t\tconst blockClientIds = getBlockOrder( clientId );\n\n\t\treturn {\n\t\t\tlastBlockClientId: blockClientIds[ blockClientIds.length - 1 ],\n\t\t};\n\t} ),\n] )( DefaultBlockAppender );\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAKA,IAAAE,qBAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,aAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AAAwD,IAAAM,WAAA,GAAAN,OAAA;AAXxD;AACA;AACA;;AAIA;AACA;AACA;;AAKO,MAAMO,oBAAoB,GAAGA,CAAE;EAAEC;AAAS,CAAC,KAAM;EACvD,oBAAO,IAAAF,WAAA,CAAAG,GAAA,EAACP,qBAAA,CAAAQ,OAAwB;IAACC,YAAY,EAAGH;EAAU,CAAE,CAAC;AAC9D,CAAC;AAACI,OAAA,CAAAL,oBAAA,GAAAA,oBAAA;AAAA,IAAAM,QAAA,GAAAD,OAAA,CAAAF,OAAA,GAEa,IAAAI,gBAAO,EAAE,CACvBC,qBAAY,EACZ,IAAAC,gBAAU,EAAE,CAAEC,MAAM,EAAE;EAAET;AAAS,CAAC,KAAM;EACvC,MAAM;IAAEU;EAAc,CAAC,GAAGD,MAAM,CAAEE,YAAiB,CAAC;EAEpD,MAAMC,cAAc,GAAGF,aAAa,CAAEV,QAAS,CAAC;EAEhD,OAAO;IACNa,iBAAiB,EAAED,cAAc,CAAEA,cAAc,CAACE,MAAM,GAAG,CAAC;EAC7D,CAAC;AACF,CAAE,CAAC,CACF,CAAC,CAAEf,oBAAqB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_defaultBlockAppender","_interopRequireDefault","require","_context","_jsxRuntime","DefaultBlockAppender","clientId","useBlockEditContext","jsx","default","rootClientId"],"sources":["@wordpress/block-editor/src/components/inner-blocks/default-block-appender.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport BaseDefaultBlockAppender from '../default-block-appender';\nimport { useBlockEditContext } from '../block-edit/context';\n\nexport default function DefaultBlockAppender() {\n\tconst { clientId } = useBlockEditContext();\n\treturn <BaseDefaultBlockAppender rootClientId={ clientId } />;\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,qBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAA4D,IAAAE,WAAA,GAAAF,OAAA;AAJ5D;AACA;AACA;;AAIe,SAASG,oBAAoBA,CAAA,EAAG;EAC9C,MAAM;IAAEC;EAAS,CAAC,GAAG,IAAAC,4BAAmB,EAAC,CAAC;EAC1C,oBAAO,IAAAH,WAAA,CAAAI,GAAA,EAACR,qBAAA,CAAAS,OAAwB;IAACC,YAAY,EAAGJ;EAAU,CAAE,CAAC;AAC9D","ignoreList":[]}
@@ -180,18 +180,9 @@ function useInnerBlocksProps(props = {}, options = {}) {
180
180
  getBlockEditingMode,
181
181
  getBlockSettings,
182
182
  isDragging,
183
- getSettings
183
+ getSectionRootClientId
184
184
  } = (0, _lockUnlock.unlock)(select(_store.store));
185
185
  let _isDropZoneDisabled;
186
- // In zoom out mode, we want to disable the drop zone for the sections.
187
- // The inner blocks belonging to the section drop zone is
188
- // already disabled by the blocks themselves being disabled.
189
- if (__unstableGetEditorMode() === 'zoom-out') {
190
- const {
191
- sectionRootClientId
192
- } = (0, _lockUnlock.unlock)(getSettings());
193
- _isDropZoneDisabled = clientId !== sectionRootClientId;
194
- }
195
186
  if (!clientId) {
196
187
  return {
197
188
  isDropZoneDisabled: _isDropZoneDisabled
@@ -206,8 +197,13 @@ function useInnerBlocksProps(props = {}, options = {}) {
206
197
  const blockEditingMode = getBlockEditingMode(clientId);
207
198
  const parentClientId = getBlockRootClientId(clientId);
208
199
  const [defaultLayout] = getBlockSettings(clientId, 'layout');
209
- if (_isDropZoneDisabled !== undefined) {
210
- _isDropZoneDisabled = blockEditingMode === 'disabled';
200
+ _isDropZoneDisabled = blockEditingMode === 'disabled';
201
+ if (__unstableGetEditorMode() === 'zoom-out') {
202
+ // In zoom out mode, we want to disable the drop zone for the sections.
203
+ // The inner blocks belonging to the section drop zone is
204
+ // already disabled by the blocks themselves being disabled.
205
+ const sectionRootClientId = getSectionRootClientId();
206
+ _isDropZoneDisabled = clientId !== sectionRootClientId;
211
207
  }
212
208
  return {
213
209
  __experimentalCaptureToolbars: hasBlockSupport(blockName, '__experimentalExposeControlsToChildren', false),
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_compose","_element","_data","_blocks","_buttonBlockAppender","_defaultBlockAppender","_useNestedSettingsUpdate","_useInnerBlockTemplateSync","_useBlockContext","_blockList","_blockContext","_context","_useBlockSync","_store","_useBlockDropZone","_lockUnlock","_jsxRuntime","EMPTY_OBJECT","BlockContext","children","clientId","context","useBlockContext","jsx","BlockContextProvider","value","BlockListItemsMemo","memo","BlockListItems","UncontrolledInnerBlocks","props","allowedBlocks","prioritizedInserterBlocks","defaultBlock","directInsert","__experimentalDefaultBlock","__experimentalDirectInsert","template","templateLock","wrapperRef","templateInsertUpdatesSelection","__experimentalCaptureToolbars","captureToolbars","__experimentalAppenderTagName","renderAppender","orientation","placeholder","layout","name","blockType","parentLock","defaultLayout","useNestedSettingsUpdate","useInnerBlockTemplateSync","defaultLayoutBlockSupport","getBlockSupport","allowSizingOnChildren","usedLayout","memoedLayout","useMemo","items","rootClientId","providesContext","Object","keys","length","ControlledInnerBlocks","useBlockSync","ForwardedInnerBlocks","forwardRef","ref","innerBlocksProps","useInnerBlocksProps","className","options","__unstableDisableLayoutClassNames","__unstableDisableDropZone","dropZoneElement","__unstableLayoutClassNames","layoutClassNames","useBlockEditContext","selected","useSelect","select","getBlockName","isBlockSelected","hasSelectedInnerBlock","__unstableGetEditorMode","getTemplateLock","getBlockRootClientId","getBlockEditingMode","getBlockSettings","isDragging","getSettings","unlock","blockEditorStore","_isDropZoneDisabled","sectionRootClientId","isDropZoneDisabled","hasBlockSupport","getBlockType","blocksStore","blockName","enableClickThrough","blockEditingMode","parentClientId","undefined","hasOverlay","blockDropZoneRef","useBlockDropZone","useMergeRefs","isManualPlacement","window","__experimentalEnableGridInteractivity","InnerBlocks","onChange","clsx","save","getInnerBlocksProps","DefaultBlockAppender","ButtonBlockAppender","Content","_default","exports","default"],"sources":["@wordpress/block-editor/src/components/inner-blocks/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useMergeRefs } from '@wordpress/compose';\nimport { forwardRef, useMemo, memo } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport {\n\tgetBlockSupport,\n\tstore as blocksStore,\n\t__unstableGetInnerBlocksProps as getInnerBlocksProps,\n} from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport ButtonBlockAppender from './button-block-appender';\nimport DefaultBlockAppender from './default-block-appender';\nimport useNestedSettingsUpdate from './use-nested-settings-update';\nimport useInnerBlockTemplateSync from './use-inner-block-template-sync';\nimport useBlockContext from './use-block-context';\nimport { BlockListItems } from '../block-list';\nimport { BlockContextProvider } from '../block-context';\nimport { useBlockEditContext } from '../block-edit/context';\nimport useBlockSync from '../provider/use-block-sync';\nimport { store as blockEditorStore } from '../../store';\nimport useBlockDropZone from '../use-block-drop-zone';\nimport { unlock } from '../../lock-unlock';\n\nconst EMPTY_OBJECT = {};\n\nfunction BlockContext( { children, clientId } ) {\n\tconst context = useBlockContext( clientId );\n\treturn (\n\t\t<BlockContextProvider value={ context }>\n\t\t\t{ children }\n\t\t</BlockContextProvider>\n\t);\n}\n\nconst BlockListItemsMemo = memo( BlockListItems );\n\n/**\n * InnerBlocks is a component which allows a single block to have multiple blocks\n * as children. The UncontrolledInnerBlocks component is used whenever the inner\n * blocks are not controlled by another entity. In other words, it is normally\n * used for inner blocks in the post editor\n *\n * @param {Object} props The component props.\n */\nfunction UncontrolledInnerBlocks( props ) {\n\tconst {\n\t\tclientId,\n\t\tallowedBlocks,\n\t\tprioritizedInserterBlocks,\n\t\tdefaultBlock,\n\t\tdirectInsert,\n\t\t__experimentalDefaultBlock,\n\t\t__experimentalDirectInsert,\n\t\ttemplate,\n\t\ttemplateLock,\n\t\twrapperRef,\n\t\ttemplateInsertUpdatesSelection,\n\t\t__experimentalCaptureToolbars: captureToolbars,\n\t\t__experimentalAppenderTagName,\n\t\trenderAppender,\n\t\torientation,\n\t\tplaceholder,\n\t\tlayout,\n\t\tname,\n\t\tblockType,\n\t\tparentLock,\n\t\tdefaultLayout,\n\t} = props;\n\n\tuseNestedSettingsUpdate(\n\t\tclientId,\n\t\tparentLock,\n\t\tallowedBlocks,\n\t\tprioritizedInserterBlocks,\n\t\tdefaultBlock,\n\t\tdirectInsert,\n\t\t__experimentalDefaultBlock,\n\t\t__experimentalDirectInsert,\n\t\ttemplateLock,\n\t\tcaptureToolbars,\n\t\torientation,\n\t\tlayout\n\t);\n\n\tuseInnerBlockTemplateSync(\n\t\tclientId,\n\t\ttemplate,\n\t\ttemplateLock,\n\t\ttemplateInsertUpdatesSelection\n\t);\n\n\tconst defaultLayoutBlockSupport =\n\t\tgetBlockSupport( name, 'layout' ) ||\n\t\tgetBlockSupport( name, '__experimentalLayout' ) ||\n\t\tEMPTY_OBJECT;\n\n\tconst { allowSizingOnChildren = false } = defaultLayoutBlockSupport;\n\tconst usedLayout = layout || defaultLayoutBlockSupport;\n\n\tconst memoedLayout = useMemo(\n\t\t() => ( {\n\t\t\t// Default layout will know about any content/wide size defined by the theme.\n\t\t\t...defaultLayout,\n\t\t\t...usedLayout,\n\t\t\t...( allowSizingOnChildren && {\n\t\t\t\tallowSizingOnChildren: true,\n\t\t\t} ),\n\t\t} ),\n\t\t[ defaultLayout, usedLayout, allowSizingOnChildren ]\n\t);\n\n\t// For controlled inner blocks, we don't want a change in blocks to\n\t// re-render the blocks list.\n\tconst items = (\n\t\t<BlockListItemsMemo\n\t\t\trootClientId={ clientId }\n\t\t\trenderAppender={ renderAppender }\n\t\t\t__experimentalAppenderTagName={ __experimentalAppenderTagName }\n\t\t\tlayout={ memoedLayout }\n\t\t\twrapperRef={ wrapperRef }\n\t\t\tplaceholder={ placeholder }\n\t\t/>\n\t);\n\n\tif (\n\t\t! blockType?.providesContext ||\n\t\tObject.keys( blockType.providesContext ).length === 0\n\t) {\n\t\treturn items;\n\t}\n\n\treturn <BlockContext clientId={ clientId }>{ items }</BlockContext>;\n}\n\n/**\n * The controlled inner blocks component wraps the uncontrolled inner blocks\n * component with the blockSync hook. This keeps the innerBlocks of the block in\n * the block-editor store in sync with the blocks of the controlling entity. An\n * example of an inner block controller is a template part block, which provides\n * its own blocks from the template part entity data source.\n *\n * @param {Object} props The component props.\n */\nfunction ControlledInnerBlocks( props ) {\n\tuseBlockSync( props );\n\treturn <UncontrolledInnerBlocks { ...props } />;\n}\n\nconst ForwardedInnerBlocks = forwardRef( ( props, ref ) => {\n\tconst innerBlocksProps = useInnerBlocksProps( { ref }, props );\n\treturn (\n\t\t<div className=\"block-editor-inner-blocks\">\n\t\t\t<div { ...innerBlocksProps } />\n\t\t</div>\n\t);\n} );\n\n/**\n * This hook is used to lightly mark an element as an inner blocks wrapper\n * element. Call this hook and pass the returned props to the element to mark as\n * an inner blocks wrapper, automatically rendering inner blocks as children. If\n * you define a ref for the element, it is important to pass the ref to this\n * hook, which the hook in turn will pass to the component through the props it\n * returns. Optionally, you can also pass any other props through this hook, and\n * they will be merged and returned.\n *\n * @param {Object} props Optional. Props to pass to the element. Must contain\n * the ref if one is defined.\n * @param {Object} options Optional. Inner blocks options.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/inner-blocks/README.md\n */\nexport function useInnerBlocksProps( props = {}, options = {} ) {\n\tconst {\n\t\t__unstableDisableLayoutClassNames,\n\t\t__unstableDisableDropZone,\n\t\tdropZoneElement,\n\t} = options;\n\tconst {\n\t\tclientId,\n\t\tlayout = null,\n\t\t__unstableLayoutClassNames: layoutClassNames = '',\n\t} = useBlockEditContext();\n\tconst selected = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockName,\n\t\t\t\tisBlockSelected,\n\t\t\t\thasSelectedInnerBlock,\n\t\t\t\t__unstableGetEditorMode,\n\t\t\t\tgetTemplateLock,\n\t\t\t\tgetBlockRootClientId,\n\t\t\t\tgetBlockEditingMode,\n\t\t\t\tgetBlockSettings,\n\t\t\t\tisDragging,\n\t\t\t\tgetSettings,\n\t\t\t} = unlock( select( blockEditorStore ) );\n\t\t\tlet _isDropZoneDisabled;\n\t\t\t// In zoom out mode, we want to disable the drop zone for the sections.\n\t\t\t// The inner blocks belonging to the section drop zone is\n\t\t\t// already disabled by the blocks themselves being disabled.\n\t\t\tif ( __unstableGetEditorMode() === 'zoom-out' ) {\n\t\t\t\tconst { sectionRootClientId } = unlock( getSettings() );\n\t\t\t\t_isDropZoneDisabled = clientId !== sectionRootClientId;\n\t\t\t}\n\t\t\tif ( ! clientId ) {\n\t\t\t\treturn { isDropZoneDisabled: _isDropZoneDisabled };\n\t\t\t}\n\n\t\t\tconst { hasBlockSupport, getBlockType } = select( blocksStore );\n\t\t\tconst blockName = getBlockName( clientId );\n\t\t\tconst enableClickThrough =\n\t\t\t\t__unstableGetEditorMode() === 'navigation';\n\t\t\tconst blockEditingMode = getBlockEditingMode( clientId );\n\t\t\tconst parentClientId = getBlockRootClientId( clientId );\n\t\t\tconst [ defaultLayout ] = getBlockSettings( clientId, 'layout' );\n\n\t\t\tif ( _isDropZoneDisabled !== undefined ) {\n\t\t\t\t_isDropZoneDisabled = blockEditingMode === 'disabled';\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\t__experimentalCaptureToolbars: hasBlockSupport(\n\t\t\t\t\tblockName,\n\t\t\t\t\t'__experimentalExposeControlsToChildren',\n\t\t\t\t\tfalse\n\t\t\t\t),\n\t\t\t\thasOverlay:\n\t\t\t\t\tblockName !== 'core/template' &&\n\t\t\t\t\t! isBlockSelected( clientId ) &&\n\t\t\t\t\t! hasSelectedInnerBlock( clientId, true ) &&\n\t\t\t\t\tenableClickThrough &&\n\t\t\t\t\t! isDragging(),\n\t\t\t\tname: blockName,\n\t\t\t\tblockType: getBlockType( blockName ),\n\t\t\t\tparentLock: getTemplateLock( parentClientId ),\n\t\t\t\tparentClientId,\n\t\t\t\tisDropZoneDisabled: _isDropZoneDisabled,\n\t\t\t\tdefaultLayout,\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\tconst {\n\t\t__experimentalCaptureToolbars,\n\t\thasOverlay,\n\t\tname,\n\t\tblockType,\n\t\tparentLock,\n\t\tparentClientId,\n\t\tisDropZoneDisabled,\n\t\tdefaultLayout,\n\t} = selected;\n\n\tconst blockDropZoneRef = useBlockDropZone( {\n\t\tdropZoneElement,\n\t\trootClientId: clientId,\n\t\tparentClientId,\n\t} );\n\n\tconst ref = useMergeRefs( [\n\t\tprops.ref,\n\t\t__unstableDisableDropZone ||\n\t\tisDropZoneDisabled ||\n\t\t( layout?.isManualPlacement &&\n\t\t\twindow.__experimentalEnableGridInteractivity )\n\t\t\t? null\n\t\t\t: blockDropZoneRef,\n\t] );\n\n\tconst innerBlocksProps = {\n\t\t__experimentalCaptureToolbars,\n\t\tlayout,\n\t\tname,\n\t\tblockType,\n\t\tparentLock,\n\t\tdefaultLayout,\n\t\t...options,\n\t};\n\tconst InnerBlocks =\n\t\tinnerBlocksProps.value && innerBlocksProps.onChange\n\t\t\t? ControlledInnerBlocks\n\t\t\t: UncontrolledInnerBlocks;\n\n\treturn {\n\t\t...props,\n\t\tref,\n\t\tclassName: clsx(\n\t\t\tprops.className,\n\t\t\t'block-editor-block-list__layout',\n\t\t\t__unstableDisableLayoutClassNames ? '' : layoutClassNames,\n\t\t\t{\n\t\t\t\t'has-overlay': hasOverlay,\n\t\t\t}\n\t\t),\n\t\tchildren: clientId ? (\n\t\t\t<InnerBlocks { ...innerBlocksProps } clientId={ clientId } />\n\t\t) : (\n\t\t\t<BlockListItems { ...options } />\n\t\t),\n\t};\n}\n\nuseInnerBlocksProps.save = getInnerBlocksProps;\n\n// Expose default appender placeholders as components.\nForwardedInnerBlocks.DefaultBlockAppender = DefaultBlockAppender;\nForwardedInnerBlocks.ButtonBlockAppender = ButtonBlockAppender;\n\nForwardedInnerBlocks.Content = () => useInnerBlocksProps.save().children;\n\n/**\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/inner-blocks/README.md\n */\nexport default ForwardedInnerBlocks;\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAA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AA,CAAAO,GAAA,EAAC2F,WAAW;MAAA,GAAM3C,gBAAgB;MAAGnD,QAAQ,EAAGA;IAAU,CAAE,CAAC,gBAE7D,IAAAJ,WAAA,CAAAO,GAAA,EAACd,UAAA,CAAAmB,cAAc;MAAA,GAAM8C;IAAO,CAAI;EAElC,CAAC;AACF;AAEAF,mBAAmB,CAAC6C,IAAI,GAAGC,qCAAmB;;AAE9C;AACAlD,oBAAoB,CAACmD,oBAAoB,GAAGA,6BAAoB;AAChEnD,oBAAoB,CAACoD,mBAAmB,GAAGA,4BAAmB;AAE9DpD,oBAAoB,CAACqD,OAAO,GAAG,MAAMjD,mBAAmB,CAAC6C,IAAI,CAAC,CAAC,CAAClG,QAAQ;;AAExE;AACA;AACA;AAFA,IAAAuG,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAGexD,oBAAoB","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_compose","_element","_data","_blocks","_buttonBlockAppender","_defaultBlockAppender","_useNestedSettingsUpdate","_useInnerBlockTemplateSync","_useBlockContext","_blockList","_blockContext","_context","_useBlockSync","_store","_useBlockDropZone","_lockUnlock","_jsxRuntime","EMPTY_OBJECT","BlockContext","children","clientId","context","useBlockContext","jsx","BlockContextProvider","value","BlockListItemsMemo","memo","BlockListItems","UncontrolledInnerBlocks","props","allowedBlocks","prioritizedInserterBlocks","defaultBlock","directInsert","__experimentalDefaultBlock","__experimentalDirectInsert","template","templateLock","wrapperRef","templateInsertUpdatesSelection","__experimentalCaptureToolbars","captureToolbars","__experimentalAppenderTagName","renderAppender","orientation","placeholder","layout","name","blockType","parentLock","defaultLayout","useNestedSettingsUpdate","useInnerBlockTemplateSync","defaultLayoutBlockSupport","getBlockSupport","allowSizingOnChildren","usedLayout","memoedLayout","useMemo","items","rootClientId","providesContext","Object","keys","length","ControlledInnerBlocks","useBlockSync","ForwardedInnerBlocks","forwardRef","ref","innerBlocksProps","useInnerBlocksProps","className","options","__unstableDisableLayoutClassNames","__unstableDisableDropZone","dropZoneElement","__unstableLayoutClassNames","layoutClassNames","useBlockEditContext","selected","useSelect","select","getBlockName","isBlockSelected","hasSelectedInnerBlock","__unstableGetEditorMode","getTemplateLock","getBlockRootClientId","getBlockEditingMode","getBlockSettings","isDragging","getSectionRootClientId","unlock","blockEditorStore","_isDropZoneDisabled","isDropZoneDisabled","hasBlockSupport","getBlockType","blocksStore","blockName","enableClickThrough","blockEditingMode","parentClientId","sectionRootClientId","hasOverlay","blockDropZoneRef","useBlockDropZone","useMergeRefs","isManualPlacement","window","__experimentalEnableGridInteractivity","InnerBlocks","onChange","clsx","save","getInnerBlocksProps","DefaultBlockAppender","ButtonBlockAppender","Content","_default","exports","default"],"sources":["@wordpress/block-editor/src/components/inner-blocks/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useMergeRefs } from '@wordpress/compose';\nimport { forwardRef, useMemo, memo } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport {\n\tgetBlockSupport,\n\tstore as blocksStore,\n\t__unstableGetInnerBlocksProps as getInnerBlocksProps,\n} from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport ButtonBlockAppender from './button-block-appender';\nimport DefaultBlockAppender from './default-block-appender';\nimport useNestedSettingsUpdate from './use-nested-settings-update';\nimport useInnerBlockTemplateSync from './use-inner-block-template-sync';\nimport useBlockContext from './use-block-context';\nimport { BlockListItems } from '../block-list';\nimport { BlockContextProvider } from '../block-context';\nimport { useBlockEditContext } from '../block-edit/context';\nimport useBlockSync from '../provider/use-block-sync';\nimport { store as blockEditorStore } from '../../store';\nimport useBlockDropZone from '../use-block-drop-zone';\nimport { unlock } from '../../lock-unlock';\n\nconst EMPTY_OBJECT = {};\n\nfunction BlockContext( { children, clientId } ) {\n\tconst context = useBlockContext( clientId );\n\treturn (\n\t\t<BlockContextProvider value={ context }>\n\t\t\t{ children }\n\t\t</BlockContextProvider>\n\t);\n}\n\nconst BlockListItemsMemo = memo( BlockListItems );\n\n/**\n * InnerBlocks is a component which allows a single block to have multiple blocks\n * as children. The UncontrolledInnerBlocks component is used whenever the inner\n * blocks are not controlled by another entity. In other words, it is normally\n * used for inner blocks in the post editor\n *\n * @param {Object} props The component props.\n */\nfunction UncontrolledInnerBlocks( props ) {\n\tconst {\n\t\tclientId,\n\t\tallowedBlocks,\n\t\tprioritizedInserterBlocks,\n\t\tdefaultBlock,\n\t\tdirectInsert,\n\t\t__experimentalDefaultBlock,\n\t\t__experimentalDirectInsert,\n\t\ttemplate,\n\t\ttemplateLock,\n\t\twrapperRef,\n\t\ttemplateInsertUpdatesSelection,\n\t\t__experimentalCaptureToolbars: captureToolbars,\n\t\t__experimentalAppenderTagName,\n\t\trenderAppender,\n\t\torientation,\n\t\tplaceholder,\n\t\tlayout,\n\t\tname,\n\t\tblockType,\n\t\tparentLock,\n\t\tdefaultLayout,\n\t} = props;\n\n\tuseNestedSettingsUpdate(\n\t\tclientId,\n\t\tparentLock,\n\t\tallowedBlocks,\n\t\tprioritizedInserterBlocks,\n\t\tdefaultBlock,\n\t\tdirectInsert,\n\t\t__experimentalDefaultBlock,\n\t\t__experimentalDirectInsert,\n\t\ttemplateLock,\n\t\tcaptureToolbars,\n\t\torientation,\n\t\tlayout\n\t);\n\n\tuseInnerBlockTemplateSync(\n\t\tclientId,\n\t\ttemplate,\n\t\ttemplateLock,\n\t\ttemplateInsertUpdatesSelection\n\t);\n\n\tconst defaultLayoutBlockSupport =\n\t\tgetBlockSupport( name, 'layout' ) ||\n\t\tgetBlockSupport( name, '__experimentalLayout' ) ||\n\t\tEMPTY_OBJECT;\n\n\tconst { allowSizingOnChildren = false } = defaultLayoutBlockSupport;\n\tconst usedLayout = layout || defaultLayoutBlockSupport;\n\n\tconst memoedLayout = useMemo(\n\t\t() => ( {\n\t\t\t// Default layout will know about any content/wide size defined by the theme.\n\t\t\t...defaultLayout,\n\t\t\t...usedLayout,\n\t\t\t...( allowSizingOnChildren && {\n\t\t\t\tallowSizingOnChildren: true,\n\t\t\t} ),\n\t\t} ),\n\t\t[ defaultLayout, usedLayout, allowSizingOnChildren ]\n\t);\n\n\t// For controlled inner blocks, we don't want a change in blocks to\n\t// re-render the blocks list.\n\tconst items = (\n\t\t<BlockListItemsMemo\n\t\t\trootClientId={ clientId }\n\t\t\trenderAppender={ renderAppender }\n\t\t\t__experimentalAppenderTagName={ __experimentalAppenderTagName }\n\t\t\tlayout={ memoedLayout }\n\t\t\twrapperRef={ wrapperRef }\n\t\t\tplaceholder={ placeholder }\n\t\t/>\n\t);\n\n\tif (\n\t\t! blockType?.providesContext ||\n\t\tObject.keys( blockType.providesContext ).length === 0\n\t) {\n\t\treturn items;\n\t}\n\n\treturn <BlockContext clientId={ clientId }>{ items }</BlockContext>;\n}\n\n/**\n * The controlled inner blocks component wraps the uncontrolled inner blocks\n * component with the blockSync hook. This keeps the innerBlocks of the block in\n * the block-editor store in sync with the blocks of the controlling entity. An\n * example of an inner block controller is a template part block, which provides\n * its own blocks from the template part entity data source.\n *\n * @param {Object} props The component props.\n */\nfunction ControlledInnerBlocks( props ) {\n\tuseBlockSync( props );\n\treturn <UncontrolledInnerBlocks { ...props } />;\n}\n\nconst ForwardedInnerBlocks = forwardRef( ( props, ref ) => {\n\tconst innerBlocksProps = useInnerBlocksProps( { ref }, props );\n\treturn (\n\t\t<div className=\"block-editor-inner-blocks\">\n\t\t\t<div { ...innerBlocksProps } />\n\t\t</div>\n\t);\n} );\n\n/**\n * This hook is used to lightly mark an element as an inner blocks wrapper\n * element. Call this hook and pass the returned props to the element to mark as\n * an inner blocks wrapper, automatically rendering inner blocks as children. If\n * you define a ref for the element, it is important to pass the ref to this\n * hook, which the hook in turn will pass to the component through the props it\n * returns. Optionally, you can also pass any other props through this hook, and\n * they will be merged and returned.\n *\n * @param {Object} props Optional. Props to pass to the element. Must contain\n * the ref if one is defined.\n * @param {Object} options Optional. Inner blocks options.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/inner-blocks/README.md\n */\nexport function useInnerBlocksProps( props = {}, options = {} ) {\n\tconst {\n\t\t__unstableDisableLayoutClassNames,\n\t\t__unstableDisableDropZone,\n\t\tdropZoneElement,\n\t} = options;\n\tconst {\n\t\tclientId,\n\t\tlayout = null,\n\t\t__unstableLayoutClassNames: layoutClassNames = '',\n\t} = useBlockEditContext();\n\tconst selected = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockName,\n\t\t\t\tisBlockSelected,\n\t\t\t\thasSelectedInnerBlock,\n\t\t\t\t__unstableGetEditorMode,\n\t\t\t\tgetTemplateLock,\n\t\t\t\tgetBlockRootClientId,\n\t\t\t\tgetBlockEditingMode,\n\t\t\t\tgetBlockSettings,\n\t\t\t\tisDragging,\n\t\t\t\tgetSectionRootClientId,\n\t\t\t} = unlock( select( blockEditorStore ) );\n\t\t\tlet _isDropZoneDisabled;\n\n\t\t\tif ( ! clientId ) {\n\t\t\t\treturn { isDropZoneDisabled: _isDropZoneDisabled };\n\t\t\t}\n\n\t\t\tconst { hasBlockSupport, getBlockType } = select( blocksStore );\n\t\t\tconst blockName = getBlockName( clientId );\n\t\t\tconst enableClickThrough =\n\t\t\t\t__unstableGetEditorMode() === 'navigation';\n\t\t\tconst blockEditingMode = getBlockEditingMode( clientId );\n\t\t\tconst parentClientId = getBlockRootClientId( clientId );\n\t\t\tconst [ defaultLayout ] = getBlockSettings( clientId, 'layout' );\n\n\t\t\t_isDropZoneDisabled = blockEditingMode === 'disabled';\n\n\t\t\tif ( __unstableGetEditorMode() === 'zoom-out' ) {\n\t\t\t\t// In zoom out mode, we want to disable the drop zone for the sections.\n\t\t\t\t// The inner blocks belonging to the section drop zone is\n\t\t\t\t// already disabled by the blocks themselves being disabled.\n\t\t\t\tconst sectionRootClientId = getSectionRootClientId();\n\n\t\t\t\t_isDropZoneDisabled = clientId !== sectionRootClientId;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\t__experimentalCaptureToolbars: hasBlockSupport(\n\t\t\t\t\tblockName,\n\t\t\t\t\t'__experimentalExposeControlsToChildren',\n\t\t\t\t\tfalse\n\t\t\t\t),\n\t\t\t\thasOverlay:\n\t\t\t\t\tblockName !== 'core/template' &&\n\t\t\t\t\t! isBlockSelected( clientId ) &&\n\t\t\t\t\t! hasSelectedInnerBlock( clientId, true ) &&\n\t\t\t\t\tenableClickThrough &&\n\t\t\t\t\t! isDragging(),\n\t\t\t\tname: blockName,\n\t\t\t\tblockType: getBlockType( blockName ),\n\t\t\t\tparentLock: getTemplateLock( parentClientId ),\n\t\t\t\tparentClientId,\n\t\t\t\tisDropZoneDisabled: _isDropZoneDisabled,\n\t\t\t\tdefaultLayout,\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\tconst {\n\t\t__experimentalCaptureToolbars,\n\t\thasOverlay,\n\t\tname,\n\t\tblockType,\n\t\tparentLock,\n\t\tparentClientId,\n\t\tisDropZoneDisabled,\n\t\tdefaultLayout,\n\t} = selected;\n\n\tconst blockDropZoneRef = useBlockDropZone( {\n\t\tdropZoneElement,\n\t\trootClientId: clientId,\n\t\tparentClientId,\n\t} );\n\n\tconst ref = useMergeRefs( [\n\t\tprops.ref,\n\t\t__unstableDisableDropZone ||\n\t\tisDropZoneDisabled ||\n\t\t( layout?.isManualPlacement &&\n\t\t\twindow.__experimentalEnableGridInteractivity )\n\t\t\t? null\n\t\t\t: blockDropZoneRef,\n\t] );\n\n\tconst innerBlocksProps = {\n\t\t__experimentalCaptureToolbars,\n\t\tlayout,\n\t\tname,\n\t\tblockType,\n\t\tparentLock,\n\t\tdefaultLayout,\n\t\t...options,\n\t};\n\tconst InnerBlocks =\n\t\tinnerBlocksProps.value && innerBlocksProps.onChange\n\t\t\t? ControlledInnerBlocks\n\t\t\t: UncontrolledInnerBlocks;\n\n\treturn {\n\t\t...props,\n\t\tref,\n\t\tclassName: clsx(\n\t\t\tprops.className,\n\t\t\t'block-editor-block-list__layout',\n\t\t\t__unstableDisableLayoutClassNames ? '' : layoutClassNames,\n\t\t\t{\n\t\t\t\t'has-overlay': hasOverlay,\n\t\t\t}\n\t\t),\n\t\tchildren: clientId ? (\n\t\t\t<InnerBlocks { ...innerBlocksProps } clientId={ clientId } />\n\t\t) : (\n\t\t\t<BlockListItems { ...options } />\n\t\t),\n\t};\n}\n\nuseInnerBlocksProps.save = getInnerBlocksProps;\n\n// Expose default appender placeholders as components.\nForwardedInnerBlocks.DefaultBlockAppender = DefaultBlockAppender;\nForwardedInnerBlocks.ButtonBlockAppender = ButtonBlockAppender;\n\nForwardedInnerBlocks.Content = () => useInnerBlocksProps.save().children;\n\n/**\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/inner-blocks/README.md\n */\nexport default ForwardedInnerBlocks;\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AASA,IAAAK,oBAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,qBAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,wBAAA,GAAAR,sBAAA,CAAAC,OAAA;AACA,IAAAQ,0BAAA,GAAAT,sBAAA,CAAAC,OAAA;AACA,IAAAS,gBAAA,GAAAV,sBAAA,CAAAC,OAAA;AACA,IAAAU,UAAA,GAAAV,OAAA;AACA,IAAAW,aAAA,GAAAX,OAAA;AACA,IAAAY,QAAA,GAAAZ,OAAA;AACA,IAAAa,aAAA,GAAAd,sBAAA,CAAAC,OAAA;AACA,IAAAc,MAAA,GAAAd,OAAA;AACA,IAAAe,iBAAA,GAAAhB,sBAAA,CAAAC,OAAA;AACA,IAAAgB,WAAA,GAAAhB,OAAA;AAA2C,IAAAiB,WAAA,GAAAjB,OAAA;AA/B3C;AACA;A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AM,EAAE+D,iBAAiB,IAC1BC,MAAM,CAACC,qCAAuC,GAC5C,IAAI,GACJL,gBAAgB,CAClB,CAAC;EAEH,MAAMpC,gBAAgB,GAAG;IACxB9B,6BAA6B;IAC7BM,MAAM;IACNC,IAAI;IACJC,SAAS;IACTC,UAAU;IACVC,aAAa;IACb,GAAGuB;EACJ,CAAC;EACD,MAAMuC,WAAW,GAChB1C,gBAAgB,CAAC9C,KAAK,IAAI8C,gBAAgB,CAAC2C,QAAQ,GAChDhD,qBAAqB,GACrBrC,uBAAuB;EAE3B,OAAO;IACN,GAAGC,KAAK;IACRwC,GAAG;IACHG,SAAS,EAAE,IAAA0C,aAAI,EACdrF,KAAK,CAAC2C,SAAS,EACf,iCAAiC,EACjCE,iCAAiC,GAAG,EAAE,GAAGI,gBAAgB,EACzD;MACC,aAAa,EAAE2B;IAChB,CACD,CAAC;IACDvF,QAAQ,EAAEC,QAAQ,gBACjB,IAAAJ,WAAA,CAAAO,GAAA,EAAC0F,WAAW;MAAA,GAAM1C,gBAAgB;MAAGnD,QAAQ,EAAGA;IAAU,CAAE,CAAC,gBAE7D,IAAAJ,WAAA,CAAAO,GAAA,EAACd,UAAA,CAAAmB,cAAc;MAAA,GAAM8C;IAAO,CAAI;EAElC,CAAC;AACF;AAEAF,mBAAmB,CAAC4C,IAAI,GAAGC,qCAAmB;;AAE9C;AACAjD,oBAAoB,CAACkD,oBAAoB,GAAGA,6BAAoB;AAChElD,oBAAoB,CAACmD,mBAAmB,GAAGA,4BAAmB;AAE9DnD,oBAAoB,CAACoD,OAAO,GAAG,MAAMhD,mBAAmB,CAAC4C,IAAI,CAAC,CAAC,CAACjG,QAAQ;;AAExE;AACA;AACA;AAFA,IAAAsG,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAGevD,oBAAoB","ignoreList":[]}
@@ -56,7 +56,7 @@ function useInnerBlockTemplateSync(clientId, template, templateLock, templateIns
56
56
  } = (0, _data.useDispatch)(_store.store);
57
57
 
58
58
  // Maintain a reference to the previous value so we can do a deep equality check.
59
- const existingTemplate = (0, _element.useRef)(null);
59
+ const existingTemplateRef = (0, _element.useRef)(null);
60
60
  (0, _element.useLayoutEffect)(() => {
61
61
  let isCancelled = false;
62
62
 
@@ -73,11 +73,11 @@ function useInnerBlockTemplateSync(clientId, template, templateLock, templateIns
73
73
  // or a locking "all" or "contentOnly" exists directly on the block.
74
74
  const currentInnerBlocks = getBlocks(clientId);
75
75
  const shouldApplyTemplate = currentInnerBlocks.length === 0 || templateLock === 'all' || templateLock === 'contentOnly';
76
- const hasTemplateChanged = !(0, _es.default)(template, existingTemplate.current);
76
+ const hasTemplateChanged = !(0, _es.default)(template, existingTemplateRef.current);
77
77
  if (!shouldApplyTemplate || !hasTemplateChanged) {
78
78
  return;
79
79
  }
80
- existingTemplate.current = template;
80
+ existingTemplateRef.current = template;
81
81
  const nextBlocks = (0, _blocks.synchronizeBlocksWithTemplate)(currentInnerBlocks, template);
82
82
  if (!(0, _es.default)(nextBlocks, currentInnerBlocks)) {
83
83
  __unstableMarkNextChangeAsNotPersistent();
@@ -1 +1 @@
1
- {"version":3,"names":["_es","_interopRequireDefault","require","_element","_data","_blocks","_store","useInnerBlockTemplateSync","clientId","template","templateLock","templateInsertUpdatesSelection","getBlocks","getSelectedBlocksInitialCaretPosition","isBlockSelected","useSelect","blockEditorStore","replaceInnerBlocks","__unstableMarkNextChangeAsNotPersistent","useDispatch","existingTemplate","useRef","useLayoutEffect","isCancelled","window","queueMicrotask","currentInnerBlocks","shouldApplyTemplate","length","hasTemplateChanged","fastDeepEqual","current","nextBlocks","synchronizeBlocksWithTemplate"],"sources":["@wordpress/block-editor/src/components/inner-blocks/use-inner-block-template-sync.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport fastDeepEqual from 'fast-deep-equal/es6';\n\n/**\n * WordPress dependencies\n */\nimport { useRef, useLayoutEffect } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { synchronizeBlocksWithTemplate } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\n\n/**\n * This hook makes sure that a block's inner blocks stay in sync with the given\n * block \"template\". The template is a block hierarchy to which inner blocks must\n * conform. If the blocks get \"out of sync\" with the template and the template\n * is meant to be locked (e.g. templateLock = \"all\" or templateLock = \"contentOnly\"),\n * then we replace the inner blocks with the correct value after synchronizing it with the template.\n *\n * @param {string} clientId The block client ID.\n * @param {Object} template The template to match.\n * @param {string} templateLock The template lock state for the inner blocks. For\n * example, if the template lock is set to \"all\",\n * then the inner blocks will stay in sync with the\n * template. If not defined or set to false, then\n * the inner blocks will not be synchronized with\n * the given template.\n * @param {boolean} templateInsertUpdatesSelection Whether or not to update the\n * block-editor selection state when inner blocks\n * are replaced after template synchronization.\n */\nexport default function useInnerBlockTemplateSync(\n\tclientId,\n\ttemplate,\n\ttemplateLock,\n\ttemplateInsertUpdatesSelection\n) {\n\t// Instead of adding a useSelect mapping here, please add to the useSelect\n\t// mapping in InnerBlocks! Every subscription impacts performance.\n\n\tconst {\n\t\tgetBlocks,\n\t\tgetSelectedBlocksInitialCaretPosition,\n\t\tisBlockSelected,\n\t} = useSelect( blockEditorStore );\n\tconst { replaceInnerBlocks, __unstableMarkNextChangeAsNotPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\n\t// Maintain a reference to the previous value so we can do a deep equality check.\n\tconst existingTemplate = useRef( null );\n\n\tuseLayoutEffect( () => {\n\t\tlet isCancelled = false;\n\n\t\t// There's an implicit dependency between useInnerBlockTemplateSync and useNestedSettingsUpdate\n\t\t// The former needs to happen after the latter and since the latter is using microtasks to batch updates (performance optimization),\n\t\t// we need to schedule this one in a microtask as well.\n\t\t// Example: If you remove queueMicrotask here, ctrl + click to insert quote block won't close the inserter.\n\t\twindow.queueMicrotask( () => {\n\t\t\tif ( isCancelled ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Only synchronize innerBlocks with template if innerBlocks are empty\n\t\t\t// or a locking \"all\" or \"contentOnly\" exists directly on the block.\n\t\t\tconst currentInnerBlocks = getBlocks( clientId );\n\t\t\tconst shouldApplyTemplate =\n\t\t\t\tcurrentInnerBlocks.length === 0 ||\n\t\t\t\ttemplateLock === 'all' ||\n\t\t\t\ttemplateLock === 'contentOnly';\n\n\t\t\tconst hasTemplateChanged = ! fastDeepEqual(\n\t\t\t\ttemplate,\n\t\t\t\texistingTemplate.current\n\t\t\t);\n\n\t\t\tif ( ! shouldApplyTemplate || ! hasTemplateChanged ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\texistingTemplate.current = template;\n\t\t\tconst nextBlocks = synchronizeBlocksWithTemplate(\n\t\t\t\tcurrentInnerBlocks,\n\t\t\t\ttemplate\n\t\t\t);\n\n\t\t\tif ( ! fastDeepEqual( nextBlocks, currentInnerBlocks ) ) {\n\t\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\t\treplaceInnerBlocks(\n\t\t\t\t\tclientId,\n\t\t\t\t\tnextBlocks,\n\t\t\t\t\tcurrentInnerBlocks.length === 0 &&\n\t\t\t\t\t\ttemplateInsertUpdatesSelection &&\n\t\t\t\t\t\tnextBlocks.length !== 0 &&\n\t\t\t\t\t\tisBlockSelected( clientId ),\n\t\t\t\t\t// This ensures the \"initialPosition\" doesn't change when applying the template\n\t\t\t\t\t// If we're supposed to focus the block, we'll focus the first inner block\n\t\t\t\t\t// otherwise, we won't apply any auto-focus.\n\t\t\t\t\t// This ensures for instance that the focus stays in the inserter when inserting the \"buttons\" block.\n\t\t\t\t\tgetSelectedBlocksInitialCaretPosition()\n\t\t\t\t);\n\t\t\t}\n\t\t} );\n\n\t\treturn () => {\n\t\t\tisCancelled = true;\n\t\t};\n\t}, [ template, templateLock, clientId ] );\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,GAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH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DR,uCAAuC,CAAC,CAAC;QACzCD,kBAAkB,CACjBT,QAAQ,EACRwB,UAAU,EACVN,kBAAkB,CAACE,MAAM,KAAK,CAAC,IAC9BjB,8BAA8B,IAC9BqB,UAAU,CAACJ,MAAM,KAAK,CAAC,IACvBd,eAAe,CAAEN,QAAS,CAAC;QAC5B;QACA;QACA;QACA;QACAK,qCAAqC,CAAC,CACvC,CAAC;MACF;IACD,CAAE,CAAC;IAEH,OAAO,MAAM;MACZU,WAAW,GAAG,IAAI;IACnB,CAAC;EACF,CAAC,EAAE,CAAEd,QAAQ,EAAEC,YAAY,EAAEF,QAAQ,CAAG,CAAC;AAC1C","ignoreList":[]}
1
+ {"version":3,"names":["_es","_interopRequireDefault","require","_element","_data","_blocks","_store","useInnerBlockTemplateSync","clientId","template","templateLock","templateInsertUpdatesSelection","getBlocks","getSelectedBlocksInitialCaretPosition","isBlockSelected","useSelect","blockEditorStore","replaceInnerBlocks","__unstableMarkNextChangeAsNotPersistent","useDispatch","existingTemplateRef","useRef","useLayoutEffect","isCancelled","window","queueMicrotask","currentInnerBlocks","shouldApplyTemplate","length","hasTemplateChanged","fastDeepEqual","current","nextBlocks","synchronizeBlocksWithTemplate"],"sources":["@wordpress/block-editor/src/components/inner-blocks/use-inner-block-template-sync.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport fastDeepEqual from 'fast-deep-equal/es6';\n\n/**\n * WordPress dependencies\n */\nimport { useRef, useLayoutEffect } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { synchronizeBlocksWithTemplate } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\n\n/**\n * This hook makes sure that a block's inner blocks stay in sync with the given\n * block \"template\". The template is a block hierarchy to which inner blocks must\n * conform. If the blocks get \"out of sync\" with the template and the template\n * is meant to be locked (e.g. templateLock = \"all\" or templateLock = \"contentOnly\"),\n * then we replace the inner blocks with the correct value after synchronizing it with the template.\n *\n * @param {string} clientId The block client ID.\n * @param {Object} template The template to match.\n * @param {string} templateLock The template lock state for the inner blocks. For\n * example, if the template lock is set to \"all\",\n * then the inner blocks will stay in sync with the\n * template. If not defined or set to false, then\n * the inner blocks will not be synchronized with\n * the given template.\n * @param {boolean} templateInsertUpdatesSelection Whether or not to update the\n * block-editor selection state when inner blocks\n * are replaced after template synchronization.\n */\nexport default function useInnerBlockTemplateSync(\n\tclientId,\n\ttemplate,\n\ttemplateLock,\n\ttemplateInsertUpdatesSelection\n) {\n\t// Instead of adding a useSelect mapping here, please add to the useSelect\n\t// mapping in InnerBlocks! Every subscription impacts performance.\n\n\tconst {\n\t\tgetBlocks,\n\t\tgetSelectedBlocksInitialCaretPosition,\n\t\tisBlockSelected,\n\t} = useSelect( blockEditorStore );\n\tconst { replaceInnerBlocks, __unstableMarkNextChangeAsNotPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\n\t// Maintain a reference to the previous value so we can do a deep equality check.\n\tconst existingTemplateRef = useRef( null );\n\n\tuseLayoutEffect( () => {\n\t\tlet isCancelled = false;\n\n\t\t// There's an implicit dependency between useInnerBlockTemplateSync and useNestedSettingsUpdate\n\t\t// The former needs to happen after the latter and since the latter is using microtasks to batch updates (performance optimization),\n\t\t// we need to schedule this one in a microtask as well.\n\t\t// Example: If you remove queueMicrotask here, ctrl + click to insert quote block won't close the inserter.\n\t\twindow.queueMicrotask( () => {\n\t\t\tif ( isCancelled ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Only synchronize innerBlocks with template if innerBlocks are empty\n\t\t\t// or a locking \"all\" or \"contentOnly\" exists directly on the block.\n\t\t\tconst currentInnerBlocks = getBlocks( clientId );\n\t\t\tconst shouldApplyTemplate =\n\t\t\t\tcurrentInnerBlocks.length === 0 ||\n\t\t\t\ttemplateLock === 'all' ||\n\t\t\t\ttemplateLock === 'contentOnly';\n\n\t\t\tconst hasTemplateChanged = ! fastDeepEqual(\n\t\t\t\ttemplate,\n\t\t\t\texistingTemplateRef.current\n\t\t\t);\n\n\t\t\tif ( ! shouldApplyTemplate || ! hasTemplateChanged ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\texistingTemplateRef.current = template;\n\t\t\tconst nextBlocks = synchronizeBlocksWithTemplate(\n\t\t\t\tcurrentInnerBlocks,\n\t\t\t\ttemplate\n\t\t\t);\n\n\t\t\tif ( ! fastDeepEqual( nextBlocks, currentInnerBlocks ) ) {\n\t\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\t\treplaceInnerBlocks(\n\t\t\t\t\tclientId,\n\t\t\t\t\tnextBlocks,\n\t\t\t\t\tcurrentInnerBlocks.length === 0 &&\n\t\t\t\t\t\ttemplateInsertUpdatesSelection &&\n\t\t\t\t\t\tnextBlocks.length !== 0 &&\n\t\t\t\t\t\tisBlockSelected( clientId ),\n\t\t\t\t\t// This ensures the \"initialPosition\" doesn't change when applying the template\n\t\t\t\t\t// If we're supposed to focus the block, we'll focus the first inner block\n\t\t\t\t\t// otherwise, we won't apply any auto-focus.\n\t\t\t\t\t// This ensures for instance that the focus stays in the inserter when inserting the \"buttons\" block.\n\t\t\t\t\tgetSelectedBlocksInitialCaretPosition()\n\t\t\t\t);\n\t\t\t}\n\t\t} );\n\n\t\treturn () => {\n\t\t\tisCancelled = true;\n\t\t};\n\t}, [ template, templateLock, clientId ] );\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,GAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AAKA,IAAAI,MAAA,GAAAJ,OAAA;AAfA;AACA;AACA;;AAGA;AACA;AACA;;AAKA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASK,yBAAyBA,CAChDC,QAAQ,EACRC,QAAQ,EACRC,YAAY,EACZ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AC;MACF;IACD,CAAE,CAAC;IAEH,OAAO,MAAM;MACZU,WAAW,GAAG,IAAI;IACnB,CAAC;EACF,CAAC,EAAE,CAAEd,QAAQ,EAAEC,YAAY,EAAEF,QAAQ,CAAG,CAAC;AAC1C","ignoreList":[]}
@@ -23,7 +23,10 @@ function PatternCategoriesList({
23
23
  name,
24
24
  label
25
25
  }) => {
26
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
26
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button
27
+ // TODO: Switch to `true` (40px size) if possible
28
+ , {
29
+ __next40pxDefaultSize: false,
27
30
  label: label,
28
31
  className: `${baseClassName}__categories-list__item`,
29
32
  isPressed: selectedCategory === name,
@@ -1 +1 @@
1
- {"version":3,"names":["_components","require","_i18n","_jsxRuntime","PatternCategoriesList","selectedCategory","patternCategories","onClickCategory","baseClassName","jsx","className","children","map","name","label","Button","isPressed","onClick","PatternsExplorerSearch","searchValue","setSearchValue","SearchControl","__nextHasNoMarginBottom","onChange","value","__","placeholder","PatternExplorerSidebar","jsxs","_default","exports","default"],"sources":["@wordpress/block-editor/src/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button, SearchControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\nfunction PatternCategoriesList( {\n\tselectedCategory,\n\tpatternCategories,\n\tonClickCategory,\n} ) {\n\tconst baseClassName = 'block-editor-block-patterns-explorer__sidebar';\n\treturn (\n\t\t<div className={ `${ baseClassName }__categories-list` }>\n\t\t\t{ patternCategories.map( ( { name, label } ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tkey={ name }\n\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\tclassName={ `${ baseClassName }__categories-list__item` }\n\t\t\t\t\t\tisPressed={ selectedCategory === name }\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tonClickCategory( name );\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ label }\n\t\t\t\t\t</Button>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</div>\n\t);\n}\n\nfunction PatternsExplorerSearch( { searchValue, setSearchValue } ) {\n\tconst baseClassName = 'block-editor-block-patterns-explorer__search';\n\treturn (\n\t\t<div className={ baseClassName }>\n\t\t\t<SearchControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tonChange={ setSearchValue }\n\t\t\t\tvalue={ searchValue }\n\t\t\t\tlabel={ __( 'Search for patterns' ) }\n\t\t\t\tplaceholder={ __( 'Search' ) }\n\t\t\t/>\n\t\t</div>\n\t);\n}\n\nfunction PatternExplorerSidebar( {\n\tselectedCategory,\n\tpatternCategories,\n\tonClickCategory,\n\tsearchValue,\n\tsetSearchValue,\n} ) {\n\tconst baseClassName = 'block-editor-block-patterns-explorer__sidebar';\n\treturn (\n\t\t<div className={ baseClassName }>\n\t\t\t<PatternsExplorerSearch\n\t\t\t\tsearchValue={ searchValue }\n\t\t\t\tsetSearchValue={ setSearchValue }\n\t\t\t/>\n\t\t\t{ ! searchValue && (\n\t\t\t\t<PatternCategoriesList\n\t\t\t\t\tselectedCategory={ selectedCategory }\n\t\t\t\t\tpatternCategories={ patternCategories }\n\t\t\t\t\tonClickCategory={ onClickCategory }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</div>\n\t);\n}\n\nexport default PatternExplorerSidebar;\n"],"mappings":";;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAAqC,IAAAE,WAAA,GAAAF,OAAA;AAJrC;AACA;AACA;;AAIA,SAASG,qBAAqBA,CAAE;EAC/BC,gBAAgB;EAChBC,iBAAiB;EACjBC;AACD,CAAC,EAAG;EACH,MAAMC,aAAa,GAAG,+CAA+C;EACrE,oBACC,IAAAL,WAAA,CAAAM,GAAA;IAAKC,SAAS,EAAI,GAAGF,aAAe,mBAAoB;IA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AAA,CAAAM,GAAA,EAACL,qBAAqB;MACrBC,gBAAgB,EAAGA,gBAAkB;MACrCC,iBAAiB,EAAGA,iBAAmB;MACvCC,eAAe,EAAGA;IAAiB,CACnC,CACD;EAAA,CACG,CAAC;AAER;AAAC,IAAAsB,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcJ,sBAAsB","ignoreList":[]}
1
+ {"version":3,"names":["_components","require","_i18n","_jsxRuntime","PatternCategoriesList","selectedCategory","patternCategories","onClickCategory","baseClassName","jsx","className","children","map","name","label","Button","__next40pxDefaultSize","isPressed","onClick","PatternsExplorerSearch","searchValue","setSearchValue","SearchControl","__nextHasNoMarginBottom","onChange","value","__","placeholder","PatternExplorerSidebar","jsxs","_default","exports","default"],"sources":["@wordpress/block-editor/src/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button, SearchControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\nfunction PatternCategoriesList( {\n\tselectedCategory,\n\tpatternCategories,\n\tonClickCategory,\n} ) {\n\tconst baseClassName = 'block-editor-block-patterns-explorer__sidebar';\n\treturn (\n\t\t<div className={ `${ baseClassName }__categories-list` }>\n\t\t\t{ patternCategories.map( ( { name, label } ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<Button\n\t\t\t\t\t\t// TODO: Switch to `true` (40px size) if possible\n\t\t\t\t\t\t__next40pxDefaultSize={ false }\n\t\t\t\t\t\tkey={ name }\n\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\tclassName={ `${ baseClassName }__categories-list__item` }\n\t\t\t\t\t\tisPressed={ selectedCategory === name }\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tonClickCategory( name );\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ label }\n\t\t\t\t\t</Button>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</div>\n\t);\n}\n\nfunction PatternsExplorerSearch( { searchValue, setSearchValue } ) {\n\tconst baseClassName = 'block-editor-block-patterns-explorer__search';\n\treturn (\n\t\t<div className={ baseClassName }>\n\t\t\t<SearchControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tonChange={ setSearchValue }\n\t\t\t\tvalue={ searchValue }\n\t\t\t\tlabel={ __( 'Search for patterns' ) }\n\t\t\t\tplaceholder={ __( 'Search' ) }\n\t\t\t/>\n\t\t</div>\n\t);\n}\n\nfunction PatternExplorerSidebar( {\n\tselectedCategory,\n\tpatternCategories,\n\tonClickCategory,\n\tsearchValue,\n\tsetSearchValue,\n} ) {\n\tconst baseClassName = 'block-editor-block-patterns-explorer__sidebar';\n\treturn (\n\t\t<div className={ baseClassName }>\n\t\t\t<PatternsExplorerSearch\n\t\t\t\tsearchValue={ searchValue }\n\t\t\t\tsetSearchValue={ setSearchValue }\n\t\t\t/>\n\t\t\t{ ! searchValue && (\n\t\t\t\t<PatternCategoriesList\n\t\t\t\t\tselectedCategory={ selectedCategory }\n\t\t\t\t\tpatternCategories={ patternCategories }\n\t\t\t\t\tonClickCategory={ onClickCategory }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</div>\n\t);\n}\n\nexport default PatternExplorerSidebar;\n"],"mappings":";;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAAqC,IAAAE,WAAA,GAAAF,OAAA;AAJrC;AACA;AACA;;AAIA,SAASG,qBAAqBA,CAAE;EAC/BC,gBAAgB;EAChBC,iBAAiB;EACjBC;AACD,CAAC,EAAG;EACH,MAAMC,aAAa,GAAG,+CAA+C;EACrE,oBACC,IAAAL,WAAA,CAAAM,GAAA;IAAKC,SAAS,EAAI,GAAGF,aAAe,mBAAoB;IAAAG,QAAA,EACrDL,iBAAiB,CAACM,GAAG,CAAE,CAAE;MAAEC,IAAI;MAAEC;IAAM,CAAC,KAAM;MAC/C,oBACC,IAAAX,WAAA,CAAAM,GAAA,EAACT,WAAA,CAAA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;IAAiB,CACnC,CACD;EAAA,CACG,CAAC;AAER;AAAC,IAAAuB,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcJ,sBAAsB","ignoreList":[]}
@@ -55,7 +55,10 @@ function BlockPatternsTab({
55
55
  selectedCategory: selectedCategory,
56
56
  onSelectCategory: onSelectCategory,
57
57
  children: children
58
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
58
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button
59
+ // TODO: Switch to `true` (40px size) if possible
60
+ , {
61
+ __next40pxDefaultSize: false,
59
62
  className: "block-editor-inserter__patterns-explore-button",
60
63
  onClick: () => setShowPatternsExplorer(true),
61
64
  variant: "secondary",
@@ -1 +1 @@
1
- {"version":3,"names":["_element","require","_compose","_components","_i18n","_data","_blockPatternsExplorer","_interopRequireDefault","_mobileTabNavigation","_patternCategoryPreviews","_usePatternCategories","_categoryTabs","_noResults","_store","_lockUnlock","_jsxRuntime","BlockPatternsTab","onSelectCategory","selectedCategory","onInsert","rootClientId","children","showPatternsExplorer","setShowPatternsExplorer","useState","categories","usePatternCategories","isMobile","useViewportMatch","isResolvingPatterns","useSelect","select","unlock","blockEditorStore","jsx","className","Spinner","length","default","jsxs","Fragment","Button","onClick","variant","__","category","PatternCategoryPreviews","showTitlesAsTooltip","name","initialCategory","patternCategories","onModalClose","_default","exports"],"sources":["@wordpress/block-editor/src/components/inserter/block-patterns-tab/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState } from '@wordpress/element';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { Button, Spinner } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport PatternsExplorerModal from '../block-patterns-explorer';\nimport MobileTabNavigation from '../mobile-tab-navigation';\nimport { PatternCategoryPreviews } from './pattern-category-previews';\nimport { usePatternCategories } from './use-pattern-categories';\nimport CategoryTabs from '../category-tabs';\nimport InserterNoResults from '../no-results';\nimport { store as blockEditorStore } from '../../../store';\nimport { unlock } from '../../../lock-unlock';\n\nfunction BlockPatternsTab( {\n\tonSelectCategory,\n\tselectedCategory,\n\tonInsert,\n\trootClientId,\n\tchildren,\n} ) {\n\tconst [ showPatternsExplorer, setShowPatternsExplorer ] = useState( false );\n\n\tconst categories = usePatternCategories( rootClientId );\n\n\tconst isMobile = useViewportMatch( 'medium', '<' );\n\tconst isResolvingPatterns = useSelect(\n\t\t( select ) =>\n\t\t\tunlock( select( blockEditorStore ) ).isResolvingPatterns(),\n\t\t[]\n\t);\n\n\tif ( isResolvingPatterns ) {\n\t\treturn (\n\t\t\t<div className=\"block-editor-inserter__patterns-loading\">\n\t\t\t\t<Spinner />\n\t\t\t</div>\n\t\t);\n\t}\n\n\tif ( ! categories.length ) {\n\t\treturn <InserterNoResults />;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ ! isMobile && (\n\t\t\t\t<div className=\"block-editor-inserter__block-patterns-tabs-container\">\n\t\t\t\t\t<CategoryTabs\n\t\t\t\t\t\tcategories={ categories }\n\t\t\t\t\t\tselectedCategory={ selectedCategory }\n\t\t\t\t\t\tonSelectCategory={ onSelectCategory }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ children }\n\t\t\t\t\t</CategoryTabs>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tclassName=\"block-editor-inserter__patterns-explore-button\"\n\t\t\t\t\t\tonClick={ () => setShowPatternsExplorer( true ) }\n\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Explore all patterns' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t{ isMobile && (\n\t\t\t\t<MobileTabNavigation categories={ categories }>\n\t\t\t\t\t{ ( category ) => (\n\t\t\t\t\t\t<div className=\"block-editor-inserter__category-panel\">\n\t\t\t\t\t\t\t<PatternCategoryPreviews\n\t\t\t\t\t\t\t\tkey={ category.name }\n\t\t\t\t\t\t\t\tonInsert={ onInsert }\n\t\t\t\t\t\t\t\trootClientId={ rootClientId }\n\t\t\t\t\t\t\t\tcategory={ category }\n\t\t\t\t\t\t\t\tshowTitlesAsTooltip={ false }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t</MobileTabNavigation>\n\t\t\t) }\n\t\t\t{ showPatternsExplorer && (\n\t\t\t\t<PatternsExplorerModal\n\t\t\t\t\tinitialCategory={ selectedCategory || categories[ 0 ] }\n\t\t\t\t\tpatternCategories={ categories }\n\t\t\t\t\tonModalClose={ () => setShowPatternsExplorer( false ) }\n\t\t\t\t\trootClientId={ rootClientId }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default BlockPatternsTab;\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AAKA,IAAAK,sBAAA,GAAAC,sBAAA,CAAAN,OAAA;AACA,IAAAO,oBAAA,GAAAD,sBAAA,CAAAN,OAAA;AACA,IAAAQ,wBAAA,GAAAR,OAAA;AACA,IAAAS,qBAAA,GAAAT,OAAA;AACA,IAAAU,aAAA,GAAAJ,sBAAA,CAAAN,OAAA;AACA,IAAAW,UAAA,GAAAL,sBAAA,CAAAN,OAAA;AACA,IAAAY,MAAA,GAAAZ,OAAA;AACA,IAAAa,WAAA,GAAAb,OAAA;AAA8C,IAAAc,WAAA,GAAAd,OAAA;AAnB9C;AACA;AACA;;AAOA;AACA;AACA;;AAUA,SAASe,gBAAgBA,CAAE;EAC1BC,gBAAgB;EAChBC,gBAAgB;EAChBC,QAAQ;EACRC,YAAY;EACZC;AACD,CAAC,EAAG;EACH,MAAM,CAAEC,oBAAoB,EAAEC,uBAAuB,CAAE,GA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,IAAAuB,QAAE,EAAE,sBAAuB;MAAC,CACvB,CAAC;IAAA,CACL,CACL,EACCjB,QAAQ,iBACT,IAAAZ,WAAA,CAAAmB,GAAA,EAAC1B,oBAAA,CAAA8B,OAAmB;MAACb,UAAU,EAAGA,UAAY;MAAAJ,QAAA,EACzCwB,QAAQ,iBACX,IAAA9B,WAAA,CAAAmB,GAAA;QAAKC,SAAS,EAAC,uCAAuC;QAAAd,QAAA,eACrD,IAAAN,WAAA,CAAAmB,GAAA,EAACzB,wBAAA,CAAAqC,uBAAuB;UAEvB3B,QAAQ,EAAGA,QAAU;UACrBC,YAAY,EAAGA,YAAc;UAC7ByB,QAAQ,EAAGA,QAAU;UACrBE,mBAAmB,EAAG;QAAO,GAJvBF,QAAQ,CAACG,IAKf;MAAC,CACE;IACL,CACmB,CACrB,EACC1B,oBAAoB,iBACrB,IAAAP,WAAA,CAAAmB,GAAA,EAAC5B,sBAAA,CAAAgC,OAAqB;MACrBW,eAAe,EAAG/B,gBAAgB,IAAIO,UAAU,CAAE,CAAC,CAAI;MACvDyB,iBAAiB,EAAGzB,UAAY;MAChC0B,YAAY,EAAGA,CAAA,KAAM5B,uBAAuB,CAAE,KAAM,CAAG;MACvDH,YAAY,EAAGA;IAAc,CAC7B,CACD;EAAA,CACA,CAAC;AAEL;AAAC,IAAAgC,QAAA,GAAAC,OAAA,CAAAf,OAAA,GAEctB,gBAAgB","ignoreList":[]}
1
+ {"version":3,"names":["_element","require","_compose","_components","_i18n","_data","_blockPatternsExplorer","_interopRequireDefault","_mobileTabNavigation","_patternCategoryPreviews","_usePatternCategories","_categoryTabs","_noResults","_store","_lockUnlock","_jsxRuntime","BlockPatternsTab","onSelectCategory","selectedCategory","onInsert","rootClientId","children","showPatternsExplorer","setShowPatternsExplorer","useState","categories","usePatternCategories","isMobile","useViewportMatch","isResolvingPatterns","useSelect","select","unlock","blockEditorStore","jsx","className","Spinner","length","default","jsxs","Fragment","Button","__next40pxDefaultSize","onClick","variant","__","category","PatternCategoryPreviews","showTitlesAsTooltip","name","initialCategory","patternCategories","onModalClose","_default","exports"],"sources":["@wordpress/block-editor/src/components/inserter/block-patterns-tab/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState } from '@wordpress/element';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { Button, Spinner } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport PatternsExplorerModal from '../block-patterns-explorer';\nimport MobileTabNavigation from '../mobile-tab-navigation';\nimport { PatternCategoryPreviews } from './pattern-category-previews';\nimport { usePatternCategories } from './use-pattern-categories';\nimport CategoryTabs from '../category-tabs';\nimport InserterNoResults from '../no-results';\nimport { store as blockEditorStore } from '../../../store';\nimport { unlock } from '../../../lock-unlock';\n\nfunction BlockPatternsTab( {\n\tonSelectCategory,\n\tselectedCategory,\n\tonInsert,\n\trootClientId,\n\tchildren,\n} ) {\n\tconst [ showPatternsExplorer, setShowPatternsExplorer ] = useState( false );\n\n\tconst categories = usePatternCategories( rootClientId );\n\n\tconst isMobile = useViewportMatch( 'medium', '<' );\n\tconst isResolvingPatterns = useSelect(\n\t\t( select ) =>\n\t\t\tunlock( select( blockEditorStore ) ).isResolvingPatterns(),\n\t\t[]\n\t);\n\n\tif ( isResolvingPatterns ) {\n\t\treturn (\n\t\t\t<div className=\"block-editor-inserter__patterns-loading\">\n\t\t\t\t<Spinner />\n\t\t\t</div>\n\t\t);\n\t}\n\n\tif ( ! categories.length ) {\n\t\treturn <InserterNoResults />;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ ! isMobile && (\n\t\t\t\t<div className=\"block-editor-inserter__block-patterns-tabs-container\">\n\t\t\t\t\t<CategoryTabs\n\t\t\t\t\t\tcategories={ categories }\n\t\t\t\t\t\tselectedCategory={ selectedCategory }\n\t\t\t\t\t\tonSelectCategory={ onSelectCategory }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ children }\n\t\t\t\t\t</CategoryTabs>\n\t\t\t\t\t<Button\n\t\t\t\t\t\t// TODO: Switch to `true` (40px size) if possible\n\t\t\t\t\t\t__next40pxDefaultSize={ false }\n\t\t\t\t\t\tclassName=\"block-editor-inserter__patterns-explore-button\"\n\t\t\t\t\t\tonClick={ () => setShowPatternsExplorer( true ) }\n\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Explore all patterns' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t{ isMobile && (\n\t\t\t\t<MobileTabNavigation categories={ categories }>\n\t\t\t\t\t{ ( category ) => (\n\t\t\t\t\t\t<div className=\"block-editor-inserter__category-panel\">\n\t\t\t\t\t\t\t<PatternCategoryPreviews\n\t\t\t\t\t\t\t\tkey={ category.name }\n\t\t\t\t\t\t\t\tonInsert={ onInsert }\n\t\t\t\t\t\t\t\trootClientId={ rootClientId }\n\t\t\t\t\t\t\t\tcategory={ category }\n\t\t\t\t\t\t\t\tshowTitlesAsTooltip={ false }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t</MobileTabNavigation>\n\t\t\t) }\n\t\t\t{ showPatternsExplorer && (\n\t\t\t\t<PatternsExplorerModal\n\t\t\t\t\tinitialCategory={ selectedCategory || categories[ 0 ] }\n\t\t\t\t\tpatternCategories={ categories }\n\t\t\t\t\tonModalClose={ () => setShowPatternsExplorer( false ) }\n\t\t\t\t\trootClientId={ rootClientId }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default BlockPatternsTab;\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AAKA,IAAAK,sBAAA,GAAAC,sBAAA,C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