@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","useState","createPortal","forwardRef","useMemo","useEffect","useRef","__","useResizeObserver","useMergeRefs","useRefEffect","useDisabled","__experimentalStyleProvider","StyleProvider","useSelect","useBlockSelectionClearer","useWritingFlow","getCompatibilityStyles","store","blockEditorStore","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","bubbleEvent","event","Constructor","frame","init","key","contentDocument","defaultView","MouseEvent","rect","getBoundingClientRect","clientX","left","clientY","top","newEvent","type","defaultPrevented","preventDefault","cancelled","dispatchEvent","useBubbleEvents","iframeDocument","frameElement","html","documentElement","eventTypes","handlers","name","prototype","Object","getPrototypeOf","constructorName","constructor","window","addEventListener","removeEventListener","Iframe","contentRef","children","tabIndex","scale","frameSize","readonly","forwardedRef","ref","title","props","resolvedAssets","isPreviewMode","select","getSettings","settings","__unstableResolvedAssets","__unstableIsPreviewMode","styles","scripts","setIframeDocument","prevContainerWidth","bodyClasses","setBodyClasses","clearerRef","before","writingFlowRef","after","contentResizeListener","height","contentHeight","containerResizeListener","width","containerWidth","setRef","node","_load","iFrameDocument","preventFileDropDefault","onLoad","ownerDocument","classList","add","Array","from","body","filter","startsWith","dir","compatStyle","getElementById","id","head","appendChild","cloneNode","console","warn","iframeWindowInnerHeight","setIframeWindowInnerHeight","iframeResizeRef","nodeWindow","innerHeight","onResize","windowInnerWidth","setWindowInnerWidth","windowResizeRef","innerWidth","isZoomedOut","current","disabledRef","isDisabled","bodyRef","src","cleanup","_src","URL","createObjectURL","Blob","revokeObjectURL","maxWidth","style","setProperty","Math","min","remove","removeProperty","shouldRenderFocusCaptureElements","iframe","onKeyDown","currentTarget","target","stopPropagation","nativeEvent","KeyboardEvent","className","document","IframeIfReady","isInitialised","__internalIsInitialized"],"sources":["@wordpress/block-editor/src/components/iframe/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseState,\n\tcreatePortal,\n\tforwardRef,\n\tuseMemo,\n\tuseEffect,\n\tuseRef,\n} from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tuseResizeObserver,\n\tuseMergeRefs,\n\tuseRefEffect,\n\tuseDisabled,\n} from '@wordpress/compose';\nimport { __experimentalStyleProvider as StyleProvider } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { useBlockSelectionClearer } from '../block-selection-clearer';\nimport { useWritingFlow } from '../writing-flow';\nimport { getCompatibilityStyles } from './get-compatibility-styles';\nimport { store as blockEditorStore } from '../../store';\n\nfunction bubbleEvent( event, Constructor, frame ) {\n\tconst init = {};\n\n\tfor ( const key in event ) {\n\t\tinit[ key ] = event[ key ];\n\t}\n\n\t// Check if the event is a MouseEvent generated within the iframe.\n\t// If so, adjust the coordinates to be relative to the position of\n\t// the iframe. This ensures that components such as Draggable\n\t// receive coordinates relative to the window, instead of relative\n\t// to the iframe. Without this, the Draggable event handler would\n\t// result in components \"jumping\" position as soon as the user\n\t// drags over the iframe.\n\tif ( event instanceof frame.contentDocument.defaultView.MouseEvent ) {\n\t\tconst rect = frame.getBoundingClientRect();\n\t\tinit.clientX += rect.left;\n\t\tinit.clientY += rect.top;\n\t}\n\n\tconst newEvent = new Constructor( event.type, init );\n\tif ( init.defaultPrevented ) {\n\t\tnewEvent.preventDefault();\n\t}\n\tconst cancelled = ! frame.dispatchEvent( newEvent );\n\n\tif ( cancelled ) {\n\t\tevent.preventDefault();\n\t}\n}\n\n/**\n * Bubbles some event types (keydown, keypress, and dragover) to parent document\n * document to ensure that the keyboard shortcuts and drag and drop work.\n *\n * Ideally, we should remove event bubbling in the future. Keyboard shortcuts\n * should be context dependent, e.g. actions on blocks like Cmd+A should not\n * work globally outside the block editor.\n *\n * @param {Document} iframeDocument Document to attach listeners to.\n */\nfunction useBubbleEvents( iframeDocument ) {\n\treturn useRefEffect( () => {\n\t\tconst { defaultView } = iframeDocument;\n\t\tif ( ! defaultView ) {\n\t\t\treturn;\n\t\t}\n\t\tconst { frameElement } = defaultView;\n\t\tconst html = iframeDocument.documentElement;\n\t\tconst eventTypes = [ 'dragover', 'mousemove' ];\n\t\tconst handlers = {};\n\t\tfor ( const name of eventTypes ) {\n\t\t\thandlers[ name ] = ( event ) => {\n\t\t\t\tconst prototype = Object.getPrototypeOf( event );\n\t\t\t\tconst constructorName = prototype.constructor.name;\n\t\t\t\tconst Constructor = window[ constructorName ];\n\t\t\t\tbubbleEvent( event, Constructor, frameElement );\n\t\t\t};\n\t\t\thtml.addEventListener( name, handlers[ name ] );\n\t\t}\n\n\t\treturn () => {\n\t\t\tfor ( const name of eventTypes ) {\n\t\t\t\thtml.removeEventListener( name, handlers[ name ] );\n\t\t\t}\n\t\t};\n\t} );\n}\n\nfunction Iframe( {\n\tcontentRef,\n\tchildren,\n\ttabIndex = 0,\n\tscale = 1,\n\tframeSize = 0,\n\treadonly,\n\tforwardedRef: ref,\n\ttitle = __( 'Editor canvas' ),\n\t...props\n} ) {\n\tconst { resolvedAssets, isPreviewMode } = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\tconst settings = getSettings();\n\t\treturn {\n\t\t\tresolvedAssets: settings.__unstableResolvedAssets,\n\t\t\tisPreviewMode: settings.__unstableIsPreviewMode,\n\t\t};\n\t}, [] );\n\tconst { styles = '', scripts = '' } = resolvedAssets;\n\tconst [ iframeDocument, setIframeDocument ] = useState();\n\tconst 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":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SACCC,QAAQ,EACRC,YAAY,EACZC,UAAU,EACVC,OAAO,EACPC,SAAS,EACTC,MAAM,QACA,oBAAoB;AAC3B,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SACCC,iBAAiB,EACjBC,YAAY,EACZC,YAAY,EACZC,WAAW,QACL,oBAAoB;AAC3B,SAASC,2BAA2B,IAAIC,aAAa,QAAQ,uBAAuB;AACpF,SAASC,SAAS,QAAQ,iBAAiB;;AAE3C;AACA;AACA;AACA,SAASC,wBAAwB,QAAQ,4BAA4B;AACrE,SAASC,cAAc,QAAQ,iBAAiB;AAChD,SAASC,sBAAsB,QAAQ,4BAA4B;AACnE,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aA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J,CAAG;QAAApB,QAAA,GAED0B,qBAAqB,eACvBtE,IAAA,CAACR,aAAa;UAACiJ,QAAQ,EAAG9G,cAAgB;UAAAiB,QAAA,EACvCA;QAAQ,CACI,CAAC;MAAA,CACX,CAAC,EACPjB,cAAc,CAACG,eAChB;IAAC,CACK,CAAC,EACPkG,gCAAgC,IAAI3D,KAAK;EAAA,CAC1C,CACF;EAED,oBACCnE,KAAA;IAAKsI,SAAS,EAAC,gCAAgC;IAACtF,GAAG,EAAGyD,eAAiB;IAAA/D,QAAA,GACpE6B,uBAAuB,eACzBzE,IAAA;MACCwI,SAAS,EAAG7J,IAAI,CACf,sCAAsC,EACtCkI,WAAW,IAAI,eAChB,CAAG;MACHa,KAAK,EAAG;QACP,mDAAmD,EAClDb,WAAW,IAAK,GAAGlC,cAAgB,IAAG;QACvC,wDAAwD,EACvDkC,WAAW,IAAK,GAAG9C,kBAAkB,CAAC+C,OAAS;MACjD,CAAG;MAAAlE,QAAA,EAEDqF;IAAM,CACJ,CAAC;EAAA,CACF,CAAC;AAER;AAEA,SAASS,aAAaA,CAAEtF,KAAK,EAAEF,GAAG,EAAG;EACpC,MAAMyF,aAAa,GAAGlJ,SAAS,CAC5B8D,MAAM,IACPA,MAAM,CAAEzD,gBAAiB,CAAC,CAAC0D,WAAW,CAAC,CAAC,CAACoF,uBAAuB,EACjE,EACD,CAAC;;EAED;EACA;EACA;EACA;EACA;EACA,IAAK,CAAED,aAAa,EAAG;IACtB,OAAO,IAAI;EACZ;EAEA,oBAAO3I,IAAA,CAAC0C,MAAM;IAAA,GAAMU,KAAK;IAAGH,YAAY,EAAGC;EAAK,CAAE,CAAC;AACpD;AAEA,eAAepE,UAAU,CAAE4J,aAAc,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["clsx","useState","createPortal","forwardRef","useMemo","useEffect","useRef","__","useResizeObserver","useMergeRefs","useRefEffect","useDisabled","__experimentalStyleProvider","StyleProvider","useSelect","useBlockSelectionClearer","useWritingFlow","getCompatibilityStyles","store","blockEditorStore","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","bubbleEvent","event","Constructor","frame","init","key","contentDocument","defaultView","MouseEvent","rect","getBoundingClientRect","clientX","left","clientY","top","newEvent","type","defaultPrevented","preventDefault","cancelled","dispatchEvent","useBubbleEvents","iframeDocument","frameElement","html","documentElement","eventTypes","handlers","name","prototype","Object","getPrototypeOf","constructorName","constructor","window","addEventListener","removeEventListener","Iframe","contentRef","children","tabIndex","scale","frameSize","readonly","forwardedRef","ref","title","props","resolvedAssets","isPreviewMode","select","getSettings","settings","__unstableResolvedAssets","__unstableIsPreviewMode","styles","scripts","setIframeDocument","prevContainerWidthRef","bodyClasses","setBodyClasses","clearerRef","before","writingFlowRef","after","contentResizeListener","height","contentHeight","containerResizeListener","width","containerWidth","setRef","node","_load","iFrameDocument","preventFileDropDefault","onLoad","ownerDocument","classList","add","Array","from","body","filter","startsWith","dir","compatStyle","getElementById","id","head","appendChild","cloneNode","console","warn","iframeWindowInnerHeight","setIframeWindowInnerHeight","iframeResizeRef","nodeWindow","innerHeight","onResize","windowInnerWidth","setWindowInnerWidth","windowResizeRef","innerWidth","isZoomedOut","current","disabledRef","isDisabled","bodyRef","src","cleanup","_src","URL","createObjectURL","Blob","revokeObjectURL","maxWidth","style","setProperty","Math","min","remove","removeProperty","shouldRenderFocusCaptureElements","iframe","onKeyDown","currentTarget","target","stopPropagation","nativeEvent","KeyboardEvent","className","document","IframeIfReady","isInitialised","__internalIsInitialized"],"sources":["@wordpress/block-editor/src/components/iframe/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseState,\n\tcreatePortal,\n\tforwardRef,\n\tuseMemo,\n\tuseEffect,\n\tuseRef,\n} from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tuseResizeObserver,\n\tuseMergeRefs,\n\tuseRefEffect,\n\tuseDisabled,\n} from '@wordpress/compose';\nimport { __experimentalStyleProvider as StyleProvider } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { useBlockSelectionClearer } from '../block-selection-clearer';\nimport { useWritingFlow } from '../writing-flow';\nimport { getCompatibilityStyles } from './get-compatibility-styles';\nimport { store as blockEditorStore } from '../../store';\n\nfunction bubbleEvent( event, Constructor, frame ) {\n\tconst init = {};\n\n\tfor ( const key in event ) {\n\t\tinit[ key ] = event[ key ];\n\t}\n\n\t// Check if the event is a MouseEvent generated within the iframe.\n\t// If so, adjust the coordinates to be relative to the position of\n\t// the iframe. This ensures that components such as Draggable\n\t// receive coordinates relative to the window, instead of relative\n\t// to the iframe. Without this, the Draggable event handler would\n\t// result in components \"jumping\" position as soon as the user\n\t// drags over the iframe.\n\tif ( event instanceof frame.contentDocument.defaultView.MouseEvent ) {\n\t\tconst rect = frame.getBoundingClientRect();\n\t\tinit.clientX += rect.left;\n\t\tinit.clientY += rect.top;\n\t}\n\n\tconst newEvent = new Constructor( event.type, init );\n\tif ( init.defaultPrevented ) {\n\t\tnewEvent.preventDefault();\n\t}\n\tconst cancelled = ! frame.dispatchEvent( newEvent );\n\n\tif ( cancelled ) {\n\t\tevent.preventDefault();\n\t}\n}\n\n/**\n * Bubbles some event types (keydown, keypress, and dragover) to parent document\n * document to ensure that the keyboard shortcuts and drag and drop work.\n *\n * Ideally, we should remove event bubbling in the future. Keyboard shortcuts\n * should be context dependent, e.g. actions on blocks like Cmd+A should not\n * work globally outside the block editor.\n *\n * @param {Document} iframeDocument Document to attach listeners to.\n */\nfunction useBubbleEvents( iframeDocument ) {\n\treturn useRefEffect( () => {\n\t\tconst { defaultView } = iframeDocument;\n\t\tif ( ! defaultView ) {\n\t\t\treturn;\n\t\t}\n\t\tconst { frameElement } = defaultView;\n\t\tconst html = iframeDocument.documentElement;\n\t\tconst eventTypes = [ 'dragover', 'mousemove' ];\n\t\tconst handlers = {};\n\t\tfor ( const name of eventTypes ) {\n\t\t\thandlers[ name ] = ( event ) => {\n\t\t\t\tconst prototype = Object.getPrototypeOf( event );\n\t\t\t\tconst constructorName = prototype.constructor.name;\n\t\t\t\tconst Constructor = window[ constructorName ];\n\t\t\t\tbubbleEvent( event, Constructor, frameElement );\n\t\t\t};\n\t\t\thtml.addEventListener( name, handlers[ name ] );\n\t\t}\n\n\t\treturn () => {\n\t\t\tfor ( const name of eventTypes ) {\n\t\t\t\thtml.removeEventListener( name, handlers[ name ] );\n\t\t\t}\n\t\t};\n\t} );\n}\n\nfunction Iframe( {\n\tcontentRef,\n\tchildren,\n\ttabIndex = 0,\n\tscale = 1,\n\tframeSize = 0,\n\treadonly,\n\tforwardedRef: ref,\n\ttitle = __( 'Editor canvas' ),\n\t...props\n} ) {\n\tconst { resolvedAssets, isPreviewMode } = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\tconst settings = getSettings();\n\t\treturn {\n\t\t\tresolvedAssets: settings.__unstableResolvedAssets,\n\t\t\tisPreviewMode: settings.__unstableIsPreviewMode,\n\t\t};\n\t}, [] );\n\tconst { styles = '', scripts = '' } = resolvedAssets;\n\tconst [ iframeDocument, setIframeDocument ] = useState();\n\tconst prevContainerWidthRef = useRef();\n\tconst [ bodyClasses, setBodyClasses ] = useState( [] );\n\tconst clearerRef = useBlockSelectionClearer();\n\tconst [ before, writingFlowRef, after ] = useWritingFlow();\n\tconst [ contentResizeListener, { height: contentHeight } ] =\n\t\tuseResizeObserver();\n\tconst [ containerResizeListener, { width: containerWidth } ] =\n\t\tuseResizeObserver();\n\n\tconst setRef = useRefEffect( ( node ) => {\n\t\tnode._load = () => {\n\t\t\tsetIframeDocument( node.contentDocument );\n\t\t};\n\t\tlet iFrameDocument;\n\t\t// Prevent the default browser action for files dropped outside of dropzones.\n\t\tfunction preventFileDropDefault( event ) {\n\t\t\tevent.preventDefault();\n\t\t}\n\t\tfunction onLoad() {\n\t\t\tconst { contentDocument, ownerDocument } = node;\n\t\t\tconst { documentElement } = contentDocument;\n\t\t\tiFrameDocument = contentDocument;\n\n\t\t\tdocumentElement.classList.add( 'block-editor-iframe__html' );\n\n\t\t\tclearerRef( documentElement );\n\n\t\t\t// Ideally ALL classes that are added through get_body_class should\n\t\t\t// be added in the editor too, which we'll somehow have to get from\n\t\t\t// the server in the future (which will run the PHP filters).\n\t\t\tsetBodyClasses(\n\t\t\t\tArray.from( ownerDocument.body.classList ).filter(\n\t\t\t\t\t( name ) =>\n\t\t\t\t\t\tname.startsWith( 'admin-color-' ) ||\n\t\t\t\t\t\tname.startsWith( 'post-type-' ) ||\n\t\t\t\t\t\tname === 'wp-embed-responsive'\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tcontentDocument.dir = ownerDocument.dir;\n\n\t\t\tfor ( const compatStyle of getCompatibilityStyles() ) {\n\t\t\t\tif ( contentDocument.getElementById( compatStyle.id ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tcontentDocument.head.appendChild(\n\t\t\t\t\tcompatStyle.cloneNode( true )\n\t\t\t\t);\n\n\t\t\t\tif ( ! isPreviewMode ) {\n\t\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\t`${ compatStyle.id } was added to the iframe incorrectly. Please use block.json or enqueue_block_assets to add styles to the iframe.`,\n\t\t\t\t\t\tcompatStyle\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tiFrameDocument.addEventListener(\n\t\t\t\t'dragover',\n\t\t\t\tpreventFileDropDefault,\n\t\t\t\tfalse\n\t\t\t);\n\t\t\tiFrameDocument.addEventListener(\n\t\t\t\t'drop',\n\t\t\t\tpreventFileDropDefault,\n\t\t\t\tfalse\n\t\t\t);\n\t\t}\n\n\t\tnode.addEventListener( 'load', onLoad );\n\n\t\treturn () => {\n\t\t\tdelete node._load;\n\t\t\tnode.removeEventListener( 'load', onLoad );\n\t\t\tiFrameDocument?.removeEventListener(\n\t\t\t\t'dragover',\n\t\t\t\tpreventFileDropDefault\n\t\t\t);\n\t\t\tiFrameDocument?.removeEventListener(\n\t\t\t\t'drop',\n\t\t\t\tpreventFileDropDefault\n\t\t\t);\n\t\t};\n\t}, [] );\n\n\tconst [ iframeWindowInnerHeight, setIframeWindowInnerHeight ] = useState();\n\n\tconst iframeResizeRef = useRefEffect( ( node ) => {\n\t\tconst nodeWindow = node.ownerDocument.defaultView;\n\n\t\tsetIframeWindowInnerHeight( nodeWindow.innerHeight );\n\t\tconst onResize = () => {\n\t\t\tsetIframeWindowInnerHeight( nodeWindow.innerHeight );\n\t\t};\n\t\tnodeWindow.addEventListener( 'resize', onResize );\n\t\treturn () => {\n\t\t\tnodeWindow.removeEventListener( 'resize', onResize );\n\t\t};\n\t}, [] );\n\n\tconst [ windowInnerWidth, setWindowInnerWidth ] = useState();\n\n\tconst windowResizeRef = useRefEffect( ( node ) => {\n\t\tconst nodeWindow = node.ownerDocument.defaultView;\n\n\t\tsetWindowInnerWidth( nodeWindow.innerWidth );\n\t\tconst onResize = () => {\n\t\t\tsetWindowInnerWidth( nodeWindow.innerWidth );\n\t\t};\n\t\tnodeWindow.addEventListener( 'resize', onResize );\n\t\treturn () => {\n\t\t\tnodeWindow.removeEventListener( 'resize', onResize );\n\t\t};\n\t}, [] );\n\n\tconst isZoomedOut = scale !== 1;\n\n\tuseEffect( () => {\n\t\tif ( ! isZoomedOut ) {\n\t\t\tprevContainerWidthRef.current = containerWidth;\n\t\t}\n\t}, [ containerWidth, isZoomedOut ] );\n\n\tconst disabledRef = useDisabled( { isDisabled: ! readonly } );\n\tconst bodyRef = useMergeRefs( [\n\t\tuseBubbleEvents( iframeDocument ),\n\t\tcontentRef,\n\t\tclearerRef,\n\t\twritingFlowRef,\n\t\tdisabledRef,\n\t\t// Avoid resize listeners when not needed, these will trigger\n\t\t// unnecessary re-renders when animating the iframe width, or when\n\t\t// expanding preview iframes.\n\t\tisZoomedOut ? iframeResizeRef : null,\n\t] );\n\n\t// Correct doctype is required to enable rendering in standards\n\t// mode. Also preload the styles to avoid a flash of unstyled\n\t// content.\n\tconst html = `<!doctype html>\n<html>\n\t<head>\n\t\t<meta charset=\"utf-8\">\n\t\t<script>window.frameElement._load()</script>\n\t\t<style>\n\t\t\thtml{\n\t\t\t\theight: auto !important;\n\t\t\t\tmin-height: 100%;\n\t\t\t}\n\t\t\t/* Lowest specificity to not override global styles */\n\t\t\t:where(body) {\n\t\t\t\tmargin: 0;\n\t\t\t\t/* Default background color in case zoom out mode background\n\t\t\t\tcolors the html element */\n\t\t\t\tbackground-color: white;\n\t\t\t}\n\t\t</style>\n\t\t${ styles }\n\t\t${ scripts }\n\t</head>\n\t<body>\n\t\t<script>document.currentScript.parentElement.remove()</script>\n\t</body>\n</html>`;\n\n\tconst [ src, cleanup ] = useMemo( () => {\n\t\tconst _src = URL.createObjectURL(\n\t\t\tnew window.Blob( [ html ], { type: 'text/html' } )\n\t\t);\n\t\treturn [ _src, () => URL.revokeObjectURL( _src ) ];\n\t}, [ html ] );\n\n\tuseEffect( () => cleanup, [ cleanup ] );\n\n\tuseEffect( () => {\n\t\tif ( ! iframeDocument || ! isZoomedOut ) {\n\t\t\treturn;\n\t\t}\n\n\t\tiframeDocument.documentElement.classList.add( 'is-zoomed-out' );\n\n\t\tconst maxWidth = 750;\n\t\tiframeDocument.documentElement.style.setProperty(\n\t\t\t'--wp-block-editor-iframe-zoom-out-scale',\n\t\t\tscale === 'default'\n\t\t\t\t? Math.min( containerWidth, maxWidth ) /\n\t\t\t\t\t\tprevContainerWidthRef.current\n\t\t\t\t: scale\n\t\t);\n\t\tiframeDocument.documentElement.style.setProperty(\n\t\t\t'--wp-block-editor-iframe-zoom-out-frame-size',\n\t\t\ttypeof frameSize === 'number' ? `${ frameSize }px` : frameSize\n\t\t);\n\t\tiframeDocument.documentElement.style.setProperty(\n\t\t\t'--wp-block-editor-iframe-zoom-out-content-height',\n\t\t\t`${ contentHeight }px`\n\t\t);\n\t\tiframeDocument.documentElement.style.setProperty(\n\t\t\t'--wp-block-editor-iframe-zoom-out-inner-height',\n\t\t\t`${ iframeWindowInnerHeight }px`\n\t\t);\n\t\tiframeDocument.documentElement.style.setProperty(\n\t\t\t'--wp-block-editor-iframe-zoom-out-container-width',\n\t\t\t`${ containerWidth }px`\n\t\t);\n\t\tiframeDocument.documentElement.style.setProperty(\n\t\t\t'--wp-block-editor-iframe-zoom-out-prev-container-width',\n\t\t\t`${ prevContainerWidthRef.current }px`\n\t\t);\n\n\t\treturn () => {\n\t\t\tiframeDocument.documentElement.classList.remove( 'is-zoomed-out' );\n\n\t\t\tiframeDocument.documentElement.style.removeProperty(\n\t\t\t\t'--wp-block-editor-iframe-zoom-out-scale'\n\t\t\t);\n\t\t\tiframeDocument.documentElement.style.removeProperty(\n\t\t\t\t'--wp-block-editor-iframe-zoom-out-frame-size'\n\t\t\t);\n\t\t\tiframeDocument.documentElement.style.removeProperty(\n\t\t\t\t'--wp-block-editor-iframe-zoom-out-content-height'\n\t\t\t);\n\t\t\tiframeDocument.documentElement.style.removeProperty(\n\t\t\t\t'--wp-block-editor-iframe-zoom-out-inner-height'\n\t\t\t);\n\t\t\tiframeDocument.documentElement.style.removeProperty(\n\t\t\t\t'--wp-block-editor-iframe-zoom-out-container-width'\n\t\t\t);\n\t\t\tiframeDocument.documentElement.style.removeProperty(\n\t\t\t\t'--wp-block-editor-iframe-zoom-out-prev-container-width'\n\t\t\t);\n\t\t};\n\t}, [\n\t\tscale,\n\t\tframeSize,\n\t\tiframeDocument,\n\t\tiframeWindowInnerHeight,\n\t\tcontentHeight,\n\t\tcontainerWidth,\n\t\twindowInnerWidth,\n\t\tisZoomedOut,\n\t] );\n\n\t// Make sure to not render the before and after focusable div elements in view\n\t// mode. They're only needed to capture focus in edit mode.\n\tconst shouldRenderFocusCaptureElements = tabIndex >= 0 && ! isPreviewMode;\n\n\tconst iframe = (\n\t\t<>\n\t\t\t{ shouldRenderFocusCaptureElements && before }\n\t\t\t{ /* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */ }\n\t\t\t<iframe\n\t\t\t\t{ ...props }\n\t\t\t\tstyle={ {\n\t\t\t\t\t...props.style,\n\t\t\t\t\theight: props.style?.height,\n\t\t\t\t} }\n\t\t\t\tref={ useMergeRefs( [ ref, setRef ] ) }\n\t\t\t\ttabIndex={ tabIndex }\n\t\t\t\t// Correct doctype is required to enable rendering in standards\n\t\t\t\t// mode. Also preload the styles to avoid a flash of unstyled\n\t\t\t\t// content.\n\t\t\t\tsrc={ src }\n\t\t\t\ttitle={ title }\n\t\t\t\tonKeyDown={ ( event ) => {\n\t\t\t\t\tif ( props.onKeyDown ) {\n\t\t\t\t\t\tprops.onKeyDown( event );\n\t\t\t\t\t}\n\t\t\t\t\t// If the event originates from inside the iframe, it means\n\t\t\t\t\t// it bubbled through the portal, but only with React\n\t\t\t\t\t// events. We need to to bubble native events as well,\n\t\t\t\t\t// though by doing so we also trigger another React event,\n\t\t\t\t\t// so we need to stop the propagation of this event to avoid\n\t\t\t\t\t// duplication.\n\t\t\t\t\tif (\n\t\t\t\t\t\tevent.currentTarget.ownerDocument !==\n\t\t\t\t\t\tevent.target.ownerDocument\n\t\t\t\t\t) {\n\t\t\t\t\t\t// We should only stop propagation of the React event,\n\t\t\t\t\t\t// the native event should further bubble inside the\n\t\t\t\t\t\t// iframe to the document and window.\n\t\t\t\t\t\t// Alternatively, we could consider redispatching the\n\t\t\t\t\t\t// native event in the iframe.\n\t\t\t\t\t\tconst { stopPropagation } = event.nativeEvent;\n\t\t\t\t\t\tevent.nativeEvent.stopPropagation = () => {};\n\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\tevent.nativeEvent.stopPropagation = stopPropagation;\n\t\t\t\t\t\tbubbleEvent(\n\t\t\t\t\t\t\tevent,\n\t\t\t\t\t\t\twindow.KeyboardEvent,\n\t\t\t\t\t\t\tevent.currentTarget\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ iframeDocument &&\n\t\t\t\t\tcreatePortal(\n\t\t\t\t\t\t// We want to prevent React events from bubbling throught the iframe\n\t\t\t\t\t\t// we bubble these manually.\n\t\t\t\t\t\t/* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */\n\t\t\t\t\t\t<body\n\t\t\t\t\t\t\tref={ bodyRef }\n\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t'block-editor-iframe__body',\n\t\t\t\t\t\t\t\t'editor-styles-wrapper',\n\t\t\t\t\t\t\t\t...bodyClasses\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ contentResizeListener }\n\t\t\t\t\t\t\t<StyleProvider document={ iframeDocument }>\n\t\t\t\t\t\t\t\t{ children }\n\t\t\t\t\t\t\t</StyleProvider>\n\t\t\t\t\t\t</body>,\n\t\t\t\t\t\tiframeDocument.documentElement\n\t\t\t\t\t) }\n\t\t\t</iframe>\n\t\t\t{ shouldRenderFocusCaptureElements && after }\n\t\t</>\n\t);\n\n\treturn (\n\t\t<div className=\"block-editor-iframe__container\" ref={ windowResizeRef }>\n\t\t\t{ containerResizeListener }\n\t\t\t<div\n\t\t\t\tclassName={ clsx(\n\t\t\t\t\t'block-editor-iframe__scale-container',\n\t\t\t\t\tisZoomedOut && 'is-zoomed-out'\n\t\t\t\t) }\n\t\t\t\tstyle={ {\n\t\t\t\t\t'--wp-block-editor-iframe-zoom-out-container-width':\n\t\t\t\t\t\tisZoomedOut && `${ containerWidth }px`,\n\t\t\t\t\t'--wp-block-editor-iframe-zoom-out-prev-container-width':\n\t\t\t\t\t\tisZoomedOut && `${ prevContainerWidthRef.current }px`,\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ iframe }\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\nfunction IframeIfReady( props, ref ) {\n\tconst isInitialised = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).getSettings().__internalIsInitialized,\n\t\t[]\n\t);\n\n\t// We shouldn't render the iframe until the editor settings are initialised.\n\t// The initial settings are needed to get the styles for the srcDoc, which\n\t// cannot be changed after the iframe is mounted. srcDoc is used to to set\n\t// the initial iframe HTML, which is required to avoid a flash of unstyled\n\t// content.\n\tif ( ! isInitialised ) {\n\t\treturn null;\n\t}\n\n\treturn <Iframe { ...props } forwardedRef={ ref } />;\n}\n\nexport default forwardRef( IframeIfReady );\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SACCC,QAAQ,EACRC,YAAY,EACZC,UAAU,EACVC,OAAO,EACPC,SAAS,EACTC,MAAM,QACA,oBAAoB;AAC3B,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SACCC,iBAAiB,EACjBC,YAAY,EACZC,YAAY,EACZC,WAAW,QACL,oBAAoB;AAC3B,SAASC,2BAA2B,IAAIC,aAAa,QAAQ,uBAAuB;AACpF,SAASC,SAAS,QAAQ,iBAAiB;;AAE3C;AACA;AACA;AACA,SAASC,wBAAwB,QAAQ,4BAA4B;AACrE,SAASC,cAAc,QAAQ,iBAAiB;AAChD,SAASC,sBAAsB,QAAQ,4BAA4B;AACnE,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAExD,SAASC,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;EAC3B;;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,IAAKJ,KAAK,YAAYE,KAAK,CAACG,eAAe,CAACC,WAAW,CAACC,UAAU,EAAG;IACpE,MAAMC,IAAI,GAAGN,KAAK,CAAC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IAAI,eAChB,CAAG;MACHa,KAAK,EAAG;QACP,mDAAmD,EAClDb,WAAW,IAAK,GAAGlC,cAAgB,IAAG;QACvC,wDAAwD,EACvDkC,WAAW,IAAK,GAAG9C,qBAAqB,CAAC+C,OAAS;MACpD,CAAG;MAAAlE,QAAA,EAEDqF;IAAM,CACJ,CAAC;EAAA,CACF,CAAC;AAER;AAEA,SAASS,aAAaA,CAAEtF,KAAK,EAAEF,GAAG,EAAG;EACpC,MAAMyF,aAAa,GAAGlJ,SAAS,CAC5B8D,MAAM,IACPA,MAAM,CAAEzD,gBAAiB,CAAC,CAAC0D,WAAW,CAAC,CAAC,CAACoF,uBAAuB,EACjE,EACD,CAAC;;EAED;EACA;EACA;EACA;EACA;EACA,IAAK,CAAED,aAAa,EAAG;IACtB,OAAO,IAAI;EACZ;EAEA,oBAAO3I,IAAA,CAAC0C,MAAM;IAAA,GAAMU,KAAK;IAAGH,YAAY,EAAGC;EAAK,CAAE,CAAC;AACpD;AAEA,eAAepE,UAAU,CAAE4J,aAAc,CAAC","ignoreList":[]}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * WordPress dependencies
3
3
  */
4
- import { ToolbarButton, RangeControl, Dropdown } from '@wordpress/components';
4
+ import { ToolbarButton, RangeControl, Dropdown, __experimentalDropdownContentWrapper as DropdownContentWrapper } from '@wordpress/components';
5
5
  import { __ } from '@wordpress/i18n';
6
6
  import { search } from '@wordpress/icons';
7
7
 
@@ -30,13 +30,17 @@ export default function ZoomDropdown() {
30
30
  "aria-expanded": isOpen,
31
31
  disabled: isInProgress
32
32
  }),
33
- renderContent: () => /*#__PURE__*/_jsx(RangeControl, {
34
- __nextHasNoMarginBottom: true,
35
- label: __('Zoom'),
36
- min: MIN_ZOOM,
37
- max: MAX_ZOOM,
38
- value: Math.round(zoom),
39
- onChange: setZoom
33
+ renderContent: () => /*#__PURE__*/_jsx(DropdownContentWrapper, {
34
+ paddingSize: "medium",
35
+ children: /*#__PURE__*/_jsx(RangeControl, {
36
+ __next40pxDefaultSize: true,
37
+ __nextHasNoMarginBottom: true,
38
+ label: __('Zoom'),
39
+ min: MIN_ZOOM,
40
+ max: MAX_ZOOM,
41
+ value: Math.round(zoom),
42
+ onChange: setZoom
43
+ })
40
44
  })
41
45
  });
42
46
  }
@@ -1 +1 @@
1
- {"version":3,"names":["ToolbarButton","RangeControl","Dropdown","__","search","MIN_ZOOM","MAX_ZOOM","POPOVER_PROPS","useImageEditingContext","jsx","_jsx","ZoomDropdown","isInProgress","zoom","setZoom","contentClassName","popoverProps","renderToggle","isOpen","onToggle","icon","label","onClick","disabled","renderContent","__nextHasNoMarginBottom","min","max","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":"AAAA;AACA;AACA;AACA,SAASA,aAAa,EAAEC,YAAY,EAAEC,QAAQ,QAAQ,uBAAuB;AAC7E,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,MAAM,QAAQ,kBAAkB;;AAEzC;AACA;AACA;AACA,SAASC,QAAQ,EAAEC,QAAQ,EAAEC,aAAa,QAAQ,aAAa;AAC/D,SAASC,sBAAsB,QAAQ,WAAW;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEnD,eAAe,SAASC,YAAYA,CAAA,EAAG;EACtC,MAAM;IAAEC,YAAY;IAAEC,IAAI;IAAEC;EAAQ,CAAC,GAAGN,sBAAsB,CAAC,CAAC;EAChE,oBACCE,IAAA,CAACR,QAAQ;IACRa,gBAAgB,EAAC,sBAAsB;IACvCC,YAAY,EAAGT,aAAe;IAC9BU,YAAY,EAAGA,CAAE;MAAEC,MAAM;MAAEC;IAAS,CAAC,kBACpCT,IAAA,CAACV,aAAa;MACboB,IAAI,EAAGhB,MAAQ;MACfiB,KAAK,EAAGlB,EAAE,CAAE,MAAO,CAAG;MACtBmB,OAAO,EAAGH,QAAU;MACpB,iBAAgBD,MAAQ;MACxBK,QAAQ,EAAGX;IAAc,CACzB,CACC;IACHY,aAAa,EAAGA,CAAA,kBACfd,IAAA,CAACT,YAAY;MACZwB,uBAAuB;MACvBJ,KAAK,EAAGlB,EAAE,CAAE,MAAO,CAAG;MACtBuB,GAAG,EAAGrB,QAAU;MAChBsB,GAAG,EAAGrB,QAAU;MAChBsB,KAAK,EAAGC,IAAI,CAACC,KAAK,CAAEjB,IAAK,CAAG;MAC5BkB,QAAQ,EAAGjB;IAAS,CACpB;EACC,CACH,CAAC;AAEJ","ignoreList":[]}
1
+ {"version":3,"names":["ToolbarButton","RangeControl","Dropdown","__experimentalDropdownContentWrapper","DropdownContentWrapper","__","search","MIN_ZOOM","MAX_ZOOM","POPOVER_PROPS","useImageEditingContext","jsx","_jsx","ZoomDropdown","isInProgress","zoom","setZoom","contentClassName","popoverProps","renderToggle","isOpen","onToggle","icon","label","onClick","disabled","renderContent","paddingSize","children","__next40pxDefaultSize","__nextHasNoMarginBottom","min","max","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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List":[]}
@@ -7,15 +7,17 @@ import clsx from 'clsx';
7
7
  * Internal dependencies
8
8
  */
9
9
  import BaseButtonBlockAppender from '../button-block-appender';
10
- import withClientId from './with-client-id';
10
+ import { useBlockEditContext } from '../block-edit/context';
11
11
  import { jsx as _jsx } from "react/jsx-runtime";
12
- export const ButtonBlockAppender = ({
13
- clientId,
12
+ export default function ButtonBlockAppender({
14
13
  showSeparator,
15
14
  isFloating,
16
15
  onAddBlock,
17
16
  isToggle
18
- }) => {
17
+ }) {
18
+ const {
19
+ clientId
20
+ } = useBlockEditContext();
19
21
  return /*#__PURE__*/_jsx(BaseButtonBlockAppender, {
20
22
  className: clsx({
21
23
  'block-list-appender__toggle': isToggle
@@ -25,6 +27,5 @@ export const ButtonBlockAppender = ({
25
27
  isFloating: isFloating,
26
28
  onAddBlock: onAddBlock
27
29
  });
28
- };
29
- export default withClientId(ButtonBlockAppender);
30
+ }
30
31
  //# sourceMappingURL=button-block-appender.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","BaseButtonBlockAppender","withClientId","jsx","_jsx","ButtonBlockAppender","clientId","showSeparator","isFloating","onAddBlock","isToggle","className","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 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":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,OAAOC,uBAAuB,MAAM,0BAA0B;AAC9D,OAAOC,YAAY,MAAM,kBAAkB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE5C,OAAO,MAAMC,mBAAmB,GAAGA,CAAE;EACpCC,QAAQ;EACRC,aAAa;EACbC,UAAU;EACVC,UAAU;EACVC;AACD,CAAC,KAAM;EACN,oBACCN,IAAA,CAACH,uBAAuB;IACvBU,SAAS,EAAGX,IAAI,CAAE;MACjB,6BAA6B,EAAEU;IAChC,CAAE,CAAG;IACLE,YAAY,EAAGN,QAAU;IACzBC,aAAa,EAAGA,aAAe;IAC/BC,UAAU,EAAGA,UAAY;IACzBC,UAAU,EAAGA;EAAY,CACzB,CAAC;AAEJ,CAAC;AAED,eAAeP,YAAY,CAAEG,mBAAoB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["clsx","BaseButtonBlockAppender","useBlockEditContext","jsx","_jsx","ButtonBlockAppender","showSeparator","isFloating","onAddBlock","isToggle","clientId","className","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":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,OAAOC,uBAAuB,MAAM,0BAA0B;AAC9D,SAASC,mBAAmB,QAAQ,uBAAuB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE5D,eAAe,SAASC,mBAAmBA,CAAE;EAC5CC,aAAa;EACbC,UAAU;EACVC,UAAU;EACVC;AACD,CAAC,EAAG;EACH,MAAM;IAAEC;EAAS,CAAC,GAAGR,mBAAmB,CAAC,CAAC;EAC1C,oBACCE,IAAA,CAACH,uBAAuB;IACvBU,SAAS,EAAGX,IAAI,CAAE;MACjB,6BAA6B,EAAES;IAChC,CAAE,CAAG;IACLG,YAAY,EAAGF,QAAU;IACzBJ,aAAa,EAAGA,aAAe;IAC/BC,UAAU,EAAGA,UAAY;IACzBC,UAAU,EAAGA;EAAY,CACzB,CAAC;AAEJ","ignoreList":[]}
@@ -1,32 +1,15 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { compose } from '@wordpress/compose';
5
- import { withSelect } from '@wordpress/data';
6
-
7
1
  /**
8
2
  * Internal dependencies
9
3
  */
10
4
  import BaseDefaultBlockAppender from '../default-block-appender';
11
- import withClientId from './with-client-id';
12
- import { store as blockEditorStore } from '../../store';
5
+ import { useBlockEditContext } from '../block-edit/context';
13
6
  import { jsx as _jsx } from "react/jsx-runtime";
14
- export const DefaultBlockAppender = ({
15
- clientId
16
- }) => {
7
+ export default function DefaultBlockAppender() {
8
+ const {
9
+ clientId
10
+ } = useBlockEditContext();
17
11
  return /*#__PURE__*/_jsx(BaseDefaultBlockAppender, {
18
12
  rootClientId: clientId
19
13
  });
20
- };
21
- export default compose([withClientId, withSelect((select, {
22
- clientId
23
- }) => {
24
- const {
25
- getBlockOrder
26
- } = select(blockEditorStore);
27
- const blockClientIds = getBlockOrder(clientId);
28
- return {
29
- lastBlockClientId: blockClientIds[blockClientIds.length - 1]
30
- };
31
- })])(DefaultBlockAppender);
14
+ }
32
15
  //# sourceMappingURL=default-block-appender.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["compose","withSelect","BaseDefaultBlockAppender","withClientId","store","blockEditorStore","jsx","_jsx","DefaultBlockAppender","clientId","rootClientId","select","getBlockOrder","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":"AAAA;AACA;AACA;AACA,SAASA,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,UAAU,QAAQ,iBAAiB;;AAE5C;AACA;AACA;AACA,OAAOC,wBAAwB,MAAM,2BAA2B;AAChE,OAAOC,YAAY,MAAM,kBAAkB;AAC3C,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAExD,OAAO,MAAMC,oBAAoB,GAAGA,CAAE;EAAEC;AAAS,CAAC,KAAM;EACvD,oBAAOF,IAAA,CAACL,wBAAwB;IAACQ,YAAY,EAAGD;EAAU,CAAE,CAAC;AAC9D,CAAC;AAED,eAAeT,OAAO,CAAE,CACvBG,YAAY,EACZF,UAAU,CAAE,CAAEU,MAAM,EAAE;EAAEF;AAAS,CAAC,KAAM;EACvC,MAAM;IAAEG;EAAc,CAAC,GAAGD,MAAM,CAAEN,gBAAiB,CAAC;EAEpD,MAAMQ,cAAc,GAAGD,aAAa,CAAEH,QAAS,CAAC;EAEhD,OAAO;IACNK,iBAAiB,EAAED,cAAc,CAAEA,cAAc,CAACE,MAAM,GAAG,CAAC;EAC7D,CAAC;AACF,CAAE,CAAC,CACF,CAAC,CAAEP,oBAAqB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["BaseDefaultBlockAppender","useBlockEditContext","jsx","_jsx","DefaultBlockAppender","clientId","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":"AAAA;AACA;AACA;AACA,OAAOA,wBAAwB,MAAM,2BAA2B;AAChE,SAASC,mBAAmB,QAAQ,uBAAuB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE5D,eAAe,SAASC,oBAAoBA,CAAA,EAAG;EAC9C,MAAM;IAAEC;EAAS,CAAC,GAAGJ,mBAAmB,CAAC,CAAC;EAC1C,oBAAOE,IAAA,CAACH,wBAAwB;IAACM,YAAY,EAAGD;EAAU,CAAE,CAAC;AAC9D","ignoreList":[]}
@@ -171,18 +171,9 @@ export function useInnerBlocksProps(props = {}, options = {}) {
171
171
  getBlockEditingMode,
172
172
  getBlockSettings,
173
173
  isDragging,
174
- getSettings
174
+ getSectionRootClientId
175
175
  } = unlock(select(blockEditorStore));
176
176
  let _isDropZoneDisabled;
177
- // In zoom out mode, we want to disable the drop zone for the sections.
178
- // The inner blocks belonging to the section drop zone is
179
- // already disabled by the blocks themselves being disabled.
180
- if (__unstableGetEditorMode() === 'zoom-out') {
181
- const {
182
- sectionRootClientId
183
- } = unlock(getSettings());
184
- _isDropZoneDisabled = clientId !== sectionRootClientId;
185
- }
186
177
  if (!clientId) {
187
178
  return {
188
179
  isDropZoneDisabled: _isDropZoneDisabled
@@ -197,8 +188,13 @@ export function useInnerBlocksProps(props = {}, options = {}) {
197
188
  const blockEditingMode = getBlockEditingMode(clientId);
198
189
  const parentClientId = getBlockRootClientId(clientId);
199
190
  const [defaultLayout] = getBlockSettings(clientId, 'layout');
200
- if (_isDropZoneDisabled !== undefined) {
201
- _isDropZoneDisabled = blockEditingMode === 'disabled';
191
+ _isDropZoneDisabled = blockEditingMode === 'disabled';
192
+ if (__unstableGetEditorMode() === 'zoom-out') {
193
+ // In zoom out mode, we want to disable the drop zone for the sections.
194
+ // The inner blocks belonging to the section drop zone is
195
+ // already disabled by the blocks themselves being disabled.
196
+ const sectionRootClientId = getSectionRootClientId();
197
+ _isDropZoneDisabled = clientId !== sectionRootClientId;
202
198
  }
203
199
  return {
204
200
  __experimentalCaptureToolbars: hasBlockSupport(blockName, '__experimentalExposeControlsToChildren', false),
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","useMergeRefs","forwardRef","useMemo","memo","useSelect","getBlockSupport","store","blocksStore","__unstableGetInnerBlocksProps","getInnerBlocksProps","ButtonBlockAppender","DefaultBlockAppender","useNestedSettingsUpdate","useInnerBlockTemplateSync","useBlockContext","BlockListItems","BlockContextProvider","useBlockEditContext","useBlockSync","blockEditorStore","useBlockDropZone","unlock","jsx","_jsx","EMPTY_OBJECT","BlockContext","children","clientId","context","value","BlockListItemsMemo","UncontrolledInnerBlocks","props","allowedBlocks","prioritizedInserterBlocks","defaultBlock","directInsert","__experimentalDefaultBlock","__experimentalDirectInsert","template","templateLock","wrapperRef","templateInsertUpdatesSelection","__experimentalCaptureToolbars","captureToolbars","__experimentalAppenderTagName","renderAppender","orientation","placeholder","layout","name","blockType","parentLock","defaultLayout","defaultLayoutBlockSupport","allowSizingOnChildren","usedLayout","memoedLayout","items","rootClientId","providesContext","Object","keys","length","ControlledInnerBlocks","ForwardedInnerBlocks","ref","innerBlocksProps","useInnerBlocksProps","className","options","__unstableDisableLayoutClassNames","__unstableDisableDropZone","dropZoneElement","__unstableLayoutClassNames","layoutClassNames","selected","select","getBlockName","isBlockSelected","hasSelectedInnerBlock","__unstableGetEditorMode","getTemplateLock","getBlockRootClientId","getBlockEditingMode","getBlockSettings","isDragging","getSettings","_isDropZoneDisabled","sectionRootClientId","isDropZoneDisabled","hasBlockSupport","getBlockType","blockName","enableClickThrough","blockEditingMode","parentClientId","undefined","hasOverlay","blockDropZoneRef","isManualPlacement","window","__experimentalEnableGridInteractivity","InnerBlocks","onChange","save","Content"],"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":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,YAAY,QAAQ,oBAAoB;AACjD,SAASC,UAAU,EAAEC,OAAO,EAAEC,IAAI,QAAQ,oBAAoB;AAC9D,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SACCC,eAAe,EACfC,KAAK,IAAIC,WAAW,EACpBC,6BAA6B,IAAIC,mBAAmB,QAC9C,mBAAmB;;AAE1B;AACA;AACA;AACA,OAAOC,mBAAmB,MAAM,yBAAyB;AACzD,OAAOC,oBAAoB,MAAM,0BAA0B;AAC3D,OAAOC,uBAAuB,MAAM,8BAA8B;AAClE,OAAOC,yBAAyB,MAAM,iCAAiC;AACvE,OAAOC,eAAe,MAAM,qBAAqB;AACjD,SAASC,cAAc,QAAQ,eAAe;AAC9C,SAASC,oBAAoB,QAAQ,kBAAkB;AACvD,SAASC,mBAAmB,QAAQ,uBAAuB;AAC3D,OAAOC,YAAY,MAAM,4BAA4B;AACrD,SAASZ,KAAK,IAAIa,gBAAgB,QAAQ,aAAa;AACvD,OAAOC,gBAAgB,MAAM,wBAAwB;AACrD,SAASC,MAAM,QAAQ,mBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE3C,MAAMC,YAAY,GAAG,C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b,GAAGiB;EACJ,CAAC;EACD,MAAMiC,WAAW,GAChBpC,gBAAgB,CAACtC,KAAK,IAAIsC,gBAAgB,CAACqC,QAAQ,GAChDxC,qBAAqB,GACrBjC,uBAAuB;EAE3B,OAAO;IACN,GAAGC,KAAK;IACRkC,GAAG;IACHG,SAAS,EAAEtE,IAAI,CACdiC,KAAK,CAACqC,SAAS,EACf,iCAAiC,EACjCE,iCAAiC,GAAG,EAAE,GAAGI,gBAAgB,EACzD;MACC,aAAa,EAAEuB;IAChB,CACD,CAAC;IACDxE,QAAQ,EAAEC,QAAQ,gBACjBJ,IAAA,CAACgF,WAAW;MAAA,GAAMpC,gBAAgB;MAAGxC,QAAQ,EAAGA;IAAU,CAAE,CAAC,gBAE7DJ,IAAA,CAACR,cAAc;MAAA,GAAMuD;IAAO,CAAI;EAElC,CAAC;AACF;AAEAF,mBAAmB,CAACqC,IAAI,GAAGhG,mBAAmB;;AAE9C;AACAwD,oBAAoB,CAACtD,oBAAoB,GAAGA,oBAAoB;AAChEsD,oBAAoB,CAACvD,mBAAmB,GAAGA,mBAAmB;AAE9DuD,oBAAoB,CAACyC,OAAO,GAAG,MAAMtC,mBAAmB,CAACqC,IAAI,CAAC,CAAC,CAAC/E,QAAQ;;AAExE;AACA;AACA;AACA,eAAeuC,oBAAoB","ignoreList":[]}
1
+ {"version":3,"names":["clsx","useMergeRefs","forwardRef","useMemo","memo","useSelect","getBlockSupport","store","blocksStore","__unstableGetInnerBlocksProps","getInnerBlocksProps","ButtonBlockAppender","DefaultBlockAppender","useNestedSettingsUpdate","useInnerBlockTemplateSync","useBlockContext","BlockListItems","BlockContextProvider","useBlockEditContext","useBlockSync","blockEditorStore","useBlockDropZone","unlock","jsx","_jsx","EMPTY_OBJECT","BlockContext","children","clientId","context","value","BlockListItemsMemo","UncontrolledInnerBlocks","props","allowedBlocks","prioritizedInserterBlocks","defaultBlock","directInsert","__experimentalDefaultBlock","__experimentalDirectInsert","template","templateLock","wrapperRef","templateInsertUpdatesSelection","__experimentalCaptureToolbars","captureToolbars","__experimentalAppenderTagName","renderAppender","orientation","placeholder","layout","name","blockType","parentLock","defaultLayout","defaultLayoutBlockSupport","allowSizingOnChildren","usedLayout","memoedLayout","items","rootClientId","providesContext","Object","keys","length","ControlledInnerBlocks","ForwardedInnerBlocks","ref","innerBlocksProps","useInnerBlocksProps","className","options","__unstableDisableLayoutClassNames","__unstableDisableDropZone","dropZoneElement","__unstableLayoutClassNames","layoutClassNames","selected","select","getBlockName","isBlockSelected","hasSelectedInnerBlock","__unstableGetEditorMode","getTemplateLock","getBlockRootClientId","getBlockEditingMode","getBlockSettings","isDragging","getSectionRootClientId","_isDropZoneDisabled","isDropZoneDisabled","hasBlockSupport","getBlockType","blockName","enableClickThrough","blockEditingMode","parentClientId","sectionRootClientId","hasOverlay","blockDropZoneRef","isManualPlacement","window","__experimentalEnableGridInteractivity","InnerBlocks","onChange","save","Content"],"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":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,YAAY,QAAQ,oBAAoB;AACjD,SAASC,UAAU,EAAEC,OAAO,EAAEC,IAAI,QAAQ,oBAAoB;AAC9D,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SACCC,eAAe,EACfC,KAAK,IAAIC,WAAW,EACpBC,6BAA6B,IAAIC,mBAAmB,QAC9C,mBAAmB;;AAE1B;AACA;AACA;AACA,OAAOC,mBAAmB,MAAM,yBAAyB;AACzD,OAAOC,oBAAoB,MAAM,0BAA0B;AAC3D,OAAOC,uBAAuB,MAAM,8BAA8B;AAClE,OAAOC,yBAAyB,MAAM,iCAAiC;AACvE,OAAOC,eAAe,MAAM,qBAAqB;AACjD,SAASC,cAAc,QAAQ,eAAe;AAC9C,SAASC,oBAAoB,QAAQ,kBAAkB;AACvD,SAASC,mBAAmB,QAAQ,uBAAuB;AAC3D,O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gBAAgB,CAClB,CAAC;EAEH,MAAM/B,gBAAgB,GAAG;IACxBxB,6BAA6B;IAC7BM,MAAM;IACNC,IAAI;IACJC,SAAS;IACTC,UAAU;IACVC,aAAa;IACb,GAAGiB;EACJ,CAAC;EACD,MAAMgC,WAAW,GAChBnC,gBAAgB,CAACtC,KAAK,IAAIsC,gBAAgB,CAACoC,QAAQ,GAChDvC,qBAAqB,GACrBjC,uBAAuB;EAE3B,OAAO;IACN,GAAGC,KAAK;IACRkC,GAAG;IACHG,SAAS,EAAEtE,IAAI,CACdiC,KAAK,CAACqC,SAAS,EACf,iCAAiC,EACjCE,iCAAiC,GAAG,EAAE,GAAGI,gBAAgB,EACzD;MACC,aAAa,EAAEsB;IAChB,CACD,CAAC;IACDvE,QAAQ,EAAEC,QAAQ,gBACjBJ,IAAA,CAAC+E,WAAW;MAAA,GAAMnC,gBAAgB;MAAGxC,QAAQ,EAAGA;IAAU,CAAE,CAAC,gBAE7DJ,IAAA,CAACR,cAAc;MAAA,GAAMuD;IAAO,CAAI;EAElC,CAAC;AACF;AAEAF,mBAAmB,CAACoC,IAAI,GAAG/F,mBAAmB;;AAE9C;AACAwD,oBAAoB,CAACtD,oBAAoB,GAAGA,oBAAoB;AAChEsD,oBAAoB,CAACvD,mBAAmB,GAAGA,mBAAmB;AAE9DuD,oBAAoB,CAACwC,OAAO,GAAG,MAAMrC,mBAAmB,CAACoC,IAAI,CAAC,CAAC,CAAC9E,QAAQ;;AAExE;AACA;AACA;AACA,eAAeuC,oBAAoB","ignoreList":[]}
@@ -49,7 +49,7 @@ export default function useInnerBlockTemplateSync(clientId, template, templateLo
49
49
  } = useDispatch(blockEditorStore);
50
50
 
51
51
  // Maintain a reference to the previous value so we can do a deep equality check.
52
- const existingTemplate = useRef(null);
52
+ const existingTemplateRef = useRef(null);
53
53
  useLayoutEffect(() => {
54
54
  let isCancelled = false;
55
55
 
@@ -66,11 +66,11 @@ export default function useInnerBlockTemplateSync(clientId, template, templateLo
66
66
  // or a locking "all" or "contentOnly" exists directly on the block.
67
67
  const currentInnerBlocks = getBlocks(clientId);
68
68
  const shouldApplyTemplate = currentInnerBlocks.length === 0 || templateLock === 'all' || templateLock === 'contentOnly';
69
- const hasTemplateChanged = !fastDeepEqual(template, existingTemplate.current);
69
+ const hasTemplateChanged = !fastDeepEqual(template, existingTemplateRef.current);
70
70
  if (!shouldApplyTemplate || !hasTemplateChanged) {
71
71
  return;
72
72
  }
73
- existingTemplate.current = template;
73
+ existingTemplateRef.current = template;
74
74
  const nextBlocks = synchronizeBlocksWithTemplate(currentInnerBlocks, template);
75
75
  if (!fastDeepEqual(nextBlocks, currentInnerBlocks)) {
76
76
  __unstableMarkNextChangeAsNotPersistent();
@@ -1 +1 @@
1
- {"version":3,"names":["fastDeepEqual","useRef","useLayoutEffect","useSelect","useDispatch","synchronizeBlocksWithTemplate","store","blockEditorStore","useInnerBlockTemplateSync","clientId","template","templateLock","templateInsertUpdatesSelection","getBlocks","getSelectedBlocksInitialCaretPosition","isBlockSelected","replaceInnerBlocks","__unstableMarkNextChangeAsNotPersistent","existingTemplate","isCancelled","window","queueMicrotask","currentInnerBlocks","shouldApplyTemplate","length","hasTemplateChanged","current","nextBlocks"],"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":"AAAA;AACA;AACA;AACA,OAAOA,aAAa,MAAM,qBAAqB;;AAE/C;AACA;AACA;AACA,SAASC,MAAM,EAAEC,eAAe,QAAQ,oBAAoB;AAC5D,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,6BAA6B,QAAQ,mBAAmB;;AAEjE;AACA;AACA;AACA,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;;AAEvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,yBAAyBA,CAChDC,QAAQ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IACD,CAAE,CAAC;IAEH,OAAO,MAAM;MACZK,WAAW,GAAG,IAAI;IACnB,CAAC;EACF,CAAC,EAAE,CAAET,QAAQ,EAAEC,YAAY,EAAEF,QAAQ,CAAG,CAAC;AAC1C","ignoreList":[]}
1
+ {"version":3,"names":["fastDeepEqual","useRef","useLayoutEffect","useSelect","useDispatch","synchronizeBlocksWithTemplate","store","blockEditorStore","useInnerBlockTemplateSync","clientId","template","templateLock","templateInsertUpdatesSelection","getBlocks","getSelectedBlocksInitialCaretPosition","isBlockSelected","replaceInnerBlocks","__unstableMarkNextChangeAsNotPersistent","existingTemplateRef","isCancelled","window","queueMicrotask","currentInnerBlocks","shouldApplyTemplate","length","hasTemplateChanged","current","nextBlocks"],"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":"AAAA;AACA;AACA;AACA,OAAOA,aAAa,MAAM,qBAAqB;;AAE/C;AACA;AACA;AACA,SAASC,MAAM,EAAEC,eAAe,QAAQ,oBAAoB;AAC5D,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,6BAA6B,QAAQ,mBAAmB;;AAEjE;AACA;AACA;AACA,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;;AAEvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,yBAAyBA,CAChDC,QAAQ,EACRC,QAAQ,EACRC,YAAY,EACZC,8BAA8B,EAC7B;EACD;EACA;;EAEA,MAAM;IACLC,SAAS;IACTC,qCAAqC;IACrCC;EACD,CAAC,GAAGZ,SAAS,CAAEI,gBAAiB,CAAC;EACjC,MAAM;IAAES,kBAAkB;IAAEC;EAAwC,CAAC,GACpEb,WAAW,CAAEG,gBAAiB,CAAC;;EAEhC;EACA,MAAMW,mBAAmB,GAAGjB,MAAM,CAAE,IAAK,CAAC;EAE1CC,eAAe,CAAE,MAAM;IACtB,IAAIiB,WAAW,GAAG,KAAK;;IAEvB;IACA;IACA;IACA;IACAC,MAAM,CAACC,cAAc,CAAE,MAAM;MAC5B,IAAKF,WAAW,EAAG;QAClB;MACD;;MAEA;MACA;MACA,MAAMG,kBAAkB,GAAGT,SAAS,CAAEJ,QAAS,CAAC;MAChD,MAAMc,mBAAmB,GACxBD,kBAAkB,CAACE,MAAM,KAAK,CAAC,IAC/Bb,YAAY,KAAK,KAAK,IACtBA,YAAY,KAAK,aAAa;MAE/B,MAAMc,kBAAkB,GAAG,CAAEzB,aAAa,CACzCU,QAAQ,EACRQ,mBAAmB,CAACQ,OACrB,CAAC;MAED,IAAK,CAAEH,mBAAmB,IAAI,CAAEE,kBAAkB,EAAG;QACpD;MACD;MAEAP,mBAAmB,CAACQ,OAAO,GAAGhB,QAAQ;MACtC,MAAMiB,UAAU,GAAGtB,6BAA6B,CAC/CiB,kBAAkB,EAClBZ,QACD,CAAC;MAED,IAAK,CAAEV,aAAa,CAAE2B,UAAU,EAAEL,kBAAmB,CAAC,EAAG;QACxDL,uCAAuC,CAAC,CAAC;QACzCD,kBAAkB,CACjBP,QAAQ,EACRkB,UAAU,EACVL,kBAAkB,CAACE,MAAM,KAAK,CAAC,IAC9BZ,8BAA8B,IAC9Be,UAAU,CAACH,MAAM,KAAK,CAAC,IACvBT,eAAe,CAAEN,QAAS,CAAC;QAC5B;QACA;QACA;QACA;QACAK,qCAAqC,CAAC,CACvC,CAAC;MACF;IACD,CAAE,CAAC;IAEH,OAAO,MAAM;MACZK,WAAW,GAAG,IAAI;IACnB,CAAC;EACF,CAAC,EAAE,CAAET,QAAQ,EAAEC,YAAY,EAAEF,QAAQ,CAAG,CAAC;AAC1C","ignoreList":[]}
@@ -17,7 +17,10 @@ function PatternCategoriesList({
17
17
  name,
18
18
  label
19
19
  }) => {
20
- return /*#__PURE__*/_jsx(Button, {
20
+ return /*#__PURE__*/_jsx(Button
21
+ // TODO: Switch to `true` (40px size) if possible
22
+ , {
23
+ __next40pxDefaultSize: false,
21
24
  label: label,
22
25
  className: `${baseClassName}__categories-list__item`,
23
26
  isPressed: selectedCategory === name,
@@ -1 +1 @@
1
- {"version":3,"names":["Button","SearchControl","__","jsx","_jsx","jsxs","_jsxs","PatternCategoriesList","selectedCategory","patternCategories","onClickCategory","baseClassName","className","children","map","name","label","isPressed","onClick","PatternsExplorerSearch","searchValue","setSearchValue","__nextHasNoMarginBottom","onChange","value","placeholder","PatternExplorerSidebar"],"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":"AAAA;AACA;AACA;AACA,SAASA,MAAM,EAAEC,aAAa,QAAQ,uBAAuB;AAC7D,SAASC,EAAE,QAAQ,iBAAiB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAErC,SAASC,qBAAqBA,CAAE;EAC/BC,gBAAgB;EAChBC,iBAAiB;EACjBC;AACD,CAAC,EAAG;EACH,MAAMC,aAAa,GAAG,+CAA+C;EACrE,oBACCP,IAAA;IAAKQ,SAAS,EAAI,GAAGD,aAAe,mBAAoB;IAAAE,QAAA,EACrDJ,iBAAiB,CAACK,GAAG,CAAE,CAAE;MAAEC,IAAI;MAAEC;IAAM,CAAC,KAAM;MAC/C,oBACCZ,IAAA,CAACJ,MAAM;QAENgB,KAAK,EAAGA,KAAO;QACfJ,SAAS,EAAI,GAAGD,aAAe,yBAA0B;QACzDM,SAAS,EAAGT,gBAAgB,KAAKO,IAAM;QACvCG,OAAO,EAAGA,CAAA,KAAM;UACfR,eAAe,CAAEK,IAAK,CAAC;QACxB,CAAG;QAAAF,QAAA,EAEDG;MAAK,GARDD,IASC,CAAC;IAEX,CAAE;EAAC,CACC,CAAC;AAER;AAEA,SAASI,sBAAsBA,CAAE;EAAEC,WAAW;EAAEC;AAAe,CAAC,EAAG;EAClE,MAAMV,aAAa,GAAG,8CAA8C;EACpE,oBACCP,IAAA;IAAKQ,SAAS,EAAGD,aAAe;IAAAE,QAAA,eAC/BT,IAAA,CAACH,aAAa;MACbqB,uBAAuB;MACvBC,QAAQ,EAAGF,cAAgB;MAC3BG,KAAK,EAAGJ,WAAa;MACrBJ,KAAK,EAAGd,EAAE,CAAE,qBAAsB,CAAG;MACrCuB,WAAW,EAAGvB,EAAE,CAAE,QAAS;IAAG,CAC9B;EAAC,CACE,CAAC;AAER;AAEA,SAASwB,sBAAsBA,CAAE;EAChClB,gBAAgB;EAChBC,iBAAiB;EACjBC,eAAe;EACfU,WAAW;EACXC;AACD,CAAC,EAAG;EACH,MAAMV,aAAa,GAAG,+CAA+C;EACrE,oBACCL,KAAA;IAAKM,SAAS,EAAGD,aAAe;IAAAE,QAAA,gBAC/BT,IAAA,CAACe,sBAAsB;MACtBC,WAAW,EAAGA,WAAa;MAC3BC,cAAc,EAAGA;IAAgB,CACjC,CAAC,EACA,CAAED,WAAW,iBACdhB,IAAA,CAACG,qBAAqB;MACrBC,gBAAgB,EAAGA,gBAAkB;MACrCC,iBAAiB,EAAGA,iBAAmB;MACvCC,eAAe,EAAGA;IAAiB,CACnC,CACD;EAAA,CACG,CAAC;AAER;AAEA,eAAegB,sBAAsB","ignoreList":[]}
1
+ {"version":3,"names":["Button","SearchControl","__","jsx","_jsx","jsxs","_jsxs","PatternCategoriesList","selectedCategory","patternCategories","onClickCategory","baseClassName","className","children","map","name","label","__next40pxDefaultSize","isPressed","onClick","PatternsExplorerSearch","searchValue","setSearchValue","__nextHasNoMarginBottom","onChange","value","placeholder","PatternExplorerSidebar"],"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":"AAAA;AACA;AACA;AACA,SAASA,MAAM,EAAEC,aAAa,QAAQ,uBAAuB;AAC7D,SAASC,EAAE,QAAQ,iBAAiB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAErC,SAASC,qBAAqBA,CAAE;EAC/BC,gBAAgB;EAChBC,iBAAiB;EACjBC;AACD,CAAC,EAAG;EACH,MAAMC,aAAa,GAAG,+CAA+C;EACrE,oBACCP,IAAA;IAAKQ,SAAS,EAAI,GAAGD,aAAe,mBAAoB;IAAAE,QAAA,EACrDJ,iBAAiB,CAACK,GAAG,CAAE,CAAE;MAAEC,IAAI;MAAEC;IAAM,CAAC,KAAM;MAC/C,oBACCZ,IAAA,CAACJ;MACA;MAAA;QACAiB,qBAAqB,EAAG,KAAO;QAE/BD,KAAK,EAAGA,KAAO;QACfJ,SAAS,EAAI,GAAGD,aAAe,yBAA0B;QACzDO,SAAS,EAAGV,gBAAgB,KAAKO,IAAM;QACvCI,OAAO,EAAGA,CAAA,KAAM;UACfT,eAAe,CAAEK,IAAK,CAAC;QACxB,CAAG;QAAAF,QAAA,EAEDG;MAAK,GARDD,IASC,CAAC;IAEX,CAAE;EAAC,CACC,CAAC;AAER;AAEA,SAASK,sBAAsBA,CAAE;EAAEC,WAAW;EAAEC;AAAe,CAAC,EAAG;EAClE,MAAMX,aAAa,GAAG,8CAA8C;EACpE,oBACCP,IAAA;IAAKQ,SAAS,EAAGD,aAAe;IAAAE,QAAA,eAC/BT,IAAA,CAACH,aAAa;MACbsB,uBAAuB;MACvBC,QAAQ,EAAGF,cAAgB;MAC3BG,KAAK,EAAGJ,WAAa;MACrBL,KAAK,EAAGd,EAAE,CAAE,qBAAsB,CAAG;MACrCwB,WAAW,EAAGxB,EAAE,CAAE,QAAS;IAAG,CAC9B;EAAC,CACE,CAAC;AAER;AAEA,SAASyB,sBAAsBA,CAAE;EAChCnB,gBAAgB;EAChBC,iBAAiB;EACjBC,eAAe;EACfW,WAAW;EACXC;AACD,CAAC,EAAG;EACH,MAAMX,aAAa,GAAG,+CAA+C;EACrE,oBACCL,KAAA;IAAKM,SAAS,EAAGD,aAAe;IAAAE,QAAA,gBAC/BT,IAAA,CAACgB,sBAAsB;MACtBC,WAAW,EAAGA,WAAa;MAC3BC,cAAc,EAAGA;IAAgB,CACjC,CAAC,EACA,CAAED,WAAW,iBACdjB,IAAA,CAACG,qBAAqB;MACrBC,gBAAgB,EAAGA,gBAAkB;MACrCC,iBAAiB,EAAGA,iBAAmB;MACvCC,eAAe,EAAGA;IAAiB,CACnC,CACD;EAAA,CACG,CAAC;AAER;AAEA,eAAeiB,sBAAsB","ignoreList":[]}
@@ -49,7 +49,10 @@ function BlockPatternsTab({
49
49
  selectedCategory: selectedCategory,
50
50
  onSelectCategory: onSelectCategory,
51
51
  children: children
52
- }), /*#__PURE__*/_jsx(Button, {
52
+ }), /*#__PURE__*/_jsx(Button
53
+ // TODO: Switch to `true` (40px size) if possible
54
+ , {
55
+ __next40pxDefaultSize: false,
53
56
  className: "block-editor-inserter__patterns-explore-button",
54
57
  onClick: () => setShowPatternsExplorer(true),
55
58
  variant: "secondary",
@@ -1 +1 @@
1
- {"version":3,"names":["useState","useViewportMatch","Button","Spinner","__","useSelect","PatternsExplorerModal","MobileTabNavigation","PatternCategoryPreviews","usePatternCategories","CategoryTabs","InserterNoResults","store","blockEditorStore","unlock","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","BlockPatternsTab","onSelectCategory","selectedCategory","onInsert","rootClientId","children","showPatternsExplorer","setShowPatternsExplorer","categories","isMobile","isResolvingPatterns","select","className","length","onClick","variant","category","showTitlesAsTooltip","name","initialCategory","patternCategories","onModalClose"],"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":"AAAA;AACA;AACA;AACA,SAASA,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,MAAM,EAAEC,OAAO,QAAQ,uBAAuB;AACvD,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,SAAS,QAAQ,iBAAiB;;AAE3C;AACA;AACA;AACA,OAAOC,qBAAqB,MAAM,4BAA4B;AAC9D,OAAOC,mBAAmB,MAAM,0BAA0B;AAC1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GA,gBAAkB;QACrCD,gBAAgB,EAAGA,gBAAkB;QAAAI,QAAA,EAEnCA;MAAQ,CACG,CAAC,eACfV,IAAA,CAACd,MAAM;QACN+B,SAAS,EAAC,gDAAgD;QAC1DE,OAAO,EAAGA,CAAA,KAAMP,uBAAuB,CAAE,IAAK,CAAG;QACjDQ,OAAO,EAAC,WAAW;QAAAV,QAAA,EAEjBtB,EAAE,CAAE,sBAAuB;MAAC,CACvB,CAAC;IAAA,CACL,CACL,EACC0B,QAAQ,iBACTd,IAAA,CAACT,mBAAmB;MAACsB,UAAU,EAAGA,UAAY;MAAAH,QAAA,EACzCW,QAAQ,iBACXrB,IAAA;QAAKiB,SAAS,EAAC,uCAAuC;QAAAP,QAAA,eACrDV,IAAA,CAACR,uBAAuB;UAEvBgB,QAAQ,EAAGA,QAAU;UACrBC,YAAY,EAAGA,YAAc;UAC7BY,QAAQ,EAAGA,QAAU;UACrBC,mBAAmB,EAAG;QAAO,GAJvBD,QAAQ,CAACE,IAKf;MAAC,CACE;IACL,CACmB,CACrB,EACCZ,oBAAoB,iBACrBX,IAAA,CAACV,qBAAqB;MACrBkC,eAAe,EAAGjB,gBAAgB,IAAIM,UAAU,CAAE,CAAC,CAAI;MACvDY,iBAAiB,EAAGZ,UAAY;MAChCa,YAAY,EAAGA,CAAA,KAAMd,uBAAuB,CAAE,KAAM,CAAG;MACvDH,YAAY,EAAGA;IAAc,CAC7B,CACD;EAAA,CACA,CAAC;AAEL;AAEA,eAAeJ,gBAAgB","ignoreList":[]}
1
+ {"version":3,"names":["useState","useViewportMatch","Button","Spinner","__","useSelect","PatternsExplorerModal","MobileTabNavigation","PatternCategoryPreviews","usePatternCategories","CategoryTabs","InserterNoResults","store","blockEditorStore","unlock","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","BlockPatternsTab","onSelectCategory","selectedCategory","onInsert","rootClientId","children","showPatternsExplorer","setShowPatternsExplorer","categories","isMobile","isResolvingPatterns","select","className","length","__next40pxDefaultSize","onClick","variant","category","showTitlesAsTooltip","name","initialCategory","patternCategories","onModalClose"],"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":"AAAA;AACA;AACA;AACA,SAASA,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,MAAM,EAAEC,OAAO,QAAQ,uBAAuB;AACvD,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,SAAS,QAAQ,iBAAiB;;AAE3C;AACA;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AP,QAAA,gBACpEV,IAAA,CAACN,YAAY;QACZmB,UAAU,EAAGA,UAAY;QACzBN,gBAAgB,EAAGA,gBAAkB;QACrCD,gBAAgB,EAAGA,gBAAkB;QAAAI,QAAA,EAEnCA;MAAQ,CACG,CAAC,eACfV,IAAA,CAACd;MACA;MAAA;QACAiC,qBAAqB,EAAG,KAAO;QAC/BF,SAAS,EAAC,gDAAgD;QAC1DG,OAAO,EAAGA,CAAA,KAAMR,uBAAuB,CAAE,IAAK,CAAG;QACjDS,OAAO,EAAC,WAAW;QAAAX,QAAA,EAEjBtB,EAAE,CAAE,sBAAuB;MAAC,CACvB,CAAC;IAAA,CACL,CACL,EACC0B,QAAQ,iBACTd,IAAA,CAACT,mBAAmB;MAACsB,UAAU,EAAGA,UAAY;MAAAH,QAAA,EACzCY,QAAQ,iBACXtB,IAAA;QAAKiB,SAAS,EAAC,uCAAuC;QAAAP,QAAA,eACrDV,IAAA,CAACR,uBAAuB;UAEvBgB,QAAQ,EAAGA,QAAU;UACrBC,YAAY,EAAGA,YAAc;UAC7Ba,QAAQ,EAAGA,QAAU;UACrBC,mBAAmB,EAAG;QAAO,GAJvBD,QAAQ,CAACE,IAKf;MAAC,CACE;IACL,CACmB,CACrB,EACCb,oBAAoB,iBACrBX,IAAA,CAACV,qBAAqB;MACrBmC,eAAe,EAAGlB,gBAAgB,IAAIM,UAAU,CAAE,CAAC,CAAI;MACvDa,iBAAiB,EAAGb,UAAY;MAChCc,YAAY,EAAGA,CAAA,KAAMf,uBAAuB,CAAE,KAAM,CAAG;MACvDH,YAAY,EAAGA;IAAc,CAC7B,CACD;EAAA,CACA,CAAC;AAEL;AAEA,eAAeJ,gBAAgB","ignoreList":[]}
@@ -31,18 +31,18 @@ export function useMediaResults(category, query = {}) {
31
31
  // In the future we could use AbortController to cancel previous
32
32
  // requests, but we don't for now as it involves adding support
33
33
  // for this to `core-data` package.
34
- const lastRequest = useRef();
34
+ const lastRequestRef = useRef();
35
35
  useEffect(() => {
36
36
  (async () => {
37
37
  const key = JSON.stringify({
38
38
  category: category.name,
39
39
  ...query
40
40
  });
41
- lastRequest.current = key;
41
+ lastRequestRef.current = key;
42
42
  setIsLoading(true);
43
43
  setMediaList([]); // Empty the previous results.
44
44
  const _media = await category.fetch?.(query);
45
- if (key === lastRequest.current) {
45
+ if (key === lastRequestRef.current) {
46
46
  setMediaList(_media);
47
47
  setIsLoading(false);
48
48
  }