@wordpress/block-editor 14.3.6 → 14.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (953) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/README.md +6 -2
  3. package/build/autocompleters/block.js.map +1 -1
  4. package/build/autocompleters/link.js +2 -1
  5. package/build/autocompleters/link.js.map +1 -1
  6. package/build/components/background-image-control/index.js +1 -1
  7. package/build/components/background-image-control/index.js.map +1 -1
  8. package/build/components/block-actions/index.js +1 -13
  9. package/build/components/block-actions/index.js.map +1 -1
  10. package/build/components/block-controls/slot.js.map +1 -1
  11. package/build/components/block-controls/slot.native.js.map +1 -1
  12. package/build/components/block-draggable/draggable-chip.js +1 -1
  13. package/build/components/block-draggable/draggable-chip.js.map +1 -1
  14. package/build/components/block-inspector/index.js +56 -75
  15. package/build/components/block-inspector/index.js.map +1 -1
  16. package/build/components/block-list/block-invalid-warning.native.js +1 -1
  17. package/build/components/block-list/block-invalid-warning.native.js.map +1 -1
  18. package/build/components/block-list/block-list-item.native.js.map +1 -1
  19. package/build/components/block-list/block.js +5 -16
  20. package/build/components/block-list/block.js.map +1 -1
  21. package/build/components/block-list/index.js +6 -8
  22. package/build/components/block-list/index.js.map +1 -1
  23. package/build/components/block-list/index.native.js.map +1 -1
  24. package/build/components/block-list/use-block-props/index.js +3 -8
  25. package/build/components/block-list/use-block-props/index.js.map +1 -1
  26. package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js +14 -6
  27. package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
  28. package/build/components/block-list/use-in-between-inserter.js +5 -3
  29. package/build/components/block-list/use-in-between-inserter.js.map +1 -1
  30. package/build/components/block-list/zoom-out-separator.js +24 -13
  31. package/build/components/block-list/zoom-out-separator.js.map +1 -1
  32. package/build/components/block-lock/modal.js +1 -1
  33. package/build/components/block-lock/modal.js.map +1 -1
  34. package/build/components/block-mover/button.js.map +1 -1
  35. package/build/components/block-navigation/dropdown.js +2 -4
  36. package/build/components/block-navigation/dropdown.js.map +1 -1
  37. package/build/components/block-parent-selector/index.js +14 -11
  38. package/build/components/block-parent-selector/index.js.map +1 -1
  39. package/build/components/block-pattern-setup/index.js.map +1 -1
  40. package/build/components/block-pattern-setup/setup-toolbar.js +10 -20
  41. package/build/components/block-pattern-setup/setup-toolbar.js.map +1 -1
  42. package/build/components/block-patterns-list/index.js.map +1 -1
  43. package/build/components/block-patterns-paging/index.js +11 -13
  44. package/build/components/block-patterns-paging/index.js.map +1 -1
  45. package/build/components/block-popover/index.js +45 -2
  46. package/build/components/block-popover/index.js.map +1 -1
  47. package/build/components/block-preview/auto.js +1 -4
  48. package/build/components/block-preview/auto.js.map +1 -1
  49. package/build/components/block-preview/index.js.map +1 -1
  50. package/build/components/block-quick-navigation/index.js +2 -4
  51. package/build/components/block-quick-navigation/index.js.map +1 -1
  52. package/build/components/block-rename/modal.js +2 -2
  53. package/build/components/block-rename/modal.js.map +1 -1
  54. package/build/components/block-settings-menu/block-parent-selector-menu-item.js +1 -1
  55. package/build/components/block-settings-menu/block-parent-selector-menu-item.js.map +1 -1
  56. package/build/components/block-settings-menu/block-settings-dropdown.js +79 -76
  57. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  58. package/build/components/block-settings-menu-controls/index.js +1 -6
  59. package/build/components/block-settings-menu-controls/index.js.map +1 -1
  60. package/build/components/block-switcher/block-transformations-menu.native.js +1 -1
  61. package/build/components/block-switcher/block-transformations-menu.native.js.map +1 -1
  62. package/build/components/block-switcher/index.js +19 -15
  63. package/build/components/block-switcher/index.js.map +1 -1
  64. package/build/components/block-switcher/pattern-transformations-menu.js.map +1 -1
  65. package/build/components/block-switcher/use-transformed-patterns.js +1 -0
  66. package/build/components/block-switcher/use-transformed-patterns.js.map +1 -1
  67. package/build/components/block-switcher/utils.js +1 -0
  68. package/build/components/block-switcher/utils.js.map +1 -1
  69. package/build/components/block-toolbar/index.js +16 -19
  70. package/build/components/block-toolbar/index.js.map +1 -1
  71. package/build/components/block-toolbar/use-has-block-toolbar.js +3 -5
  72. package/build/components/block-toolbar/use-has-block-toolbar.js.map +1 -1
  73. package/build/components/block-tools/index.js +8 -18
  74. package/build/components/block-tools/index.js.map +1 -1
  75. package/build/components/block-tools/insertion-point.js +1 -4
  76. package/build/components/block-tools/insertion-point.js.map +1 -1
  77. package/build/components/block-tools/use-show-block-tools.js +8 -7
  78. package/build/components/block-tools/use-show-block-tools.js.map +1 -1
  79. package/build/components/block-tools/zoom-out-mode-inserter-button.js +1 -12
  80. package/build/components/block-tools/zoom-out-mode-inserter-button.js.map +1 -1
  81. package/build/components/block-tools/zoom-out-mode-inserters.js +14 -17
  82. package/build/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
  83. package/build/components/block-tools/zoom-out-popover.js +3 -2
  84. package/build/components/block-tools/zoom-out-popover.js.map +1 -1
  85. package/build/components/block-tools/zoom-out-toolbar.js +5 -32
  86. package/build/components/block-tools/zoom-out-toolbar.js.map +1 -1
  87. package/build/components/block-types-list/index.js.map +1 -1
  88. package/build/components/block-types-list/index.native.js.map +1 -1
  89. package/build/components/block-variation-transforms/index.js +3 -2
  90. package/build/components/block-variation-transforms/index.js.map +1 -1
  91. package/build/components/border-radius-control/index.js.map +1 -1
  92. package/build/components/border-radius-control/utils.js.map +1 -1
  93. package/build/components/button-block-appender/index.js.map +1 -1
  94. package/build/components/color-style-selector/index.js.map +1 -1
  95. package/build/components/colors/utils.js.map +1 -1
  96. package/build/components/colors/with-colors.js.map +1 -1
  97. package/build/components/colors-gradients/panel-color-gradient-settings.native.js.map +1 -1
  98. package/build/components/date-format-picker/index.js +1 -0
  99. package/build/components/date-format-picker/index.js.map +1 -1
  100. package/build/components/duotone/utils.js.map +1 -1
  101. package/build/components/duotone-control/index.js.map +1 -1
  102. package/build/components/font-sizes/fluid-utils.js.map +1 -1
  103. package/build/components/font-sizes/utils.js.map +1 -1
  104. package/build/components/font-sizes/with-font-sizes.js.map +1 -1
  105. package/build/components/global-styles/border-panel.js +1 -1
  106. package/build/components/global-styles/border-panel.js.map +1 -1
  107. package/build/components/global-styles/color-panel.js +1 -1
  108. package/build/components/global-styles/color-panel.js.map +1 -1
  109. package/build/components/global-styles/dimensions-panel.js +3 -3
  110. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  111. package/build/components/global-styles/filters-panel.js.map +1 -1
  112. package/build/components/global-styles/get-block-css-selector.js.map +1 -1
  113. package/build/components/global-styles/get-global-styles-changes.js +2 -1
  114. package/build/components/global-styles/get-global-styles-changes.js.map +1 -1
  115. package/build/components/global-styles/hooks.js.map +1 -1
  116. package/build/components/global-styles/typography-panel.js.map +1 -1
  117. package/build/components/global-styles/use-global-styles-context.native.js.map +1 -1
  118. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  119. package/build/components/global-styles/utils.js.map +1 -1
  120. package/build/components/gradients/use-gradient.js.map +1 -1
  121. package/build/components/grid/grid-item-movers.js.map +1 -1
  122. package/build/components/grid/grid-visualizer.js.map +1 -1
  123. package/build/components/iframe/index.js +44 -9
  124. package/build/components/iframe/index.js.map +1 -1
  125. package/build/components/image-editor/use-save-image.js +1 -1
  126. package/build/components/image-editor/use-save-image.js.map +1 -1
  127. package/build/components/inner-blocks/index.js +1 -9
  128. package/build/components/inner-blocks/index.js.map +1 -1
  129. package/build/components/inner-blocks/use-nested-settings-update.js +15 -8
  130. package/build/components/inner-blocks/use-nested-settings-update.js.map +1 -1
  131. package/build/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js +1 -1
  132. package/build/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js.map +1 -1
  133. package/build/components/inserter/block-patterns-explorer/pattern-list.js +2 -2
  134. package/build/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
  135. package/build/components/inserter/block-patterns-tab/use-pattern-categories.js +1 -1
  136. package/build/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
  137. package/build/components/inserter/block-types-tab.js +1 -1
  138. package/build/components/inserter/block-types-tab.js.map +1 -1
  139. package/build/components/inserter/block-types-tab.native.js.map +1 -1
  140. package/build/components/inserter/category-tabs/index.js +1 -10
  141. package/build/components/inserter/category-tabs/index.js.map +1 -1
  142. package/build/components/inserter/hooks/use-block-types-state.js +24 -5
  143. package/build/components/inserter/hooks/use-block-types-state.js.map +1 -1
  144. package/build/components/inserter/hooks/use-insertion-point.js +22 -12
  145. package/build/components/inserter/hooks/use-insertion-point.js.map +1 -1
  146. package/build/components/inserter/hooks/use-patterns-state.js +24 -11
  147. package/build/components/inserter/hooks/use-patterns-state.js.map +1 -1
  148. package/build/components/inserter/media-tab/media-panel.js.map +1 -1
  149. package/build/components/inserter/media-tab/media-preview.js +36 -14
  150. package/build/components/inserter/media-tab/media-preview.js.map +1 -1
  151. package/build/components/inserter/media-tab/media-tab.js.map +1 -1
  152. package/build/components/inserter/media-tab/utils.js.map +1 -1
  153. package/build/components/inserter/menu.js +4 -4
  154. package/build/components/inserter/menu.js.map +1 -1
  155. package/build/components/inserter/mobile-tab-navigation.js +5 -5
  156. package/build/components/inserter/mobile-tab-navigation.js.map +1 -1
  157. package/build/components/inserter/preview-panel.js.map +1 -1
  158. package/build/components/inserter/quick-inserter.js +5 -5
  159. package/build/components/inserter/quick-inserter.js.map +1 -1
  160. package/build/components/inserter/search-results.js +1 -1
  161. package/build/components/inserter/search-results.js.map +1 -1
  162. package/build/components/inserter/tabs.native.js.map +1 -1
  163. package/build/components/inspector-controls/block-support-tools-panel.js.map +1 -1
  164. package/build/components/inspector-controls/fill.js.map +1 -1
  165. package/build/components/inspector-controls/fill.native.js.map +1 -1
  166. package/build/components/inspector-controls/slot.js.map +1 -1
  167. package/build/components/inspector-controls/slot.native.js.map +1 -1
  168. package/build/components/line-height-control/index.js.map +1 -1
  169. package/build/components/link-control/index.js +1 -2
  170. package/build/components/link-control/index.js.map +1 -1
  171. package/build/components/link-control/is-url-like.js.map +1 -1
  172. package/build/components/link-control/search-create-button.js +1 -1
  173. package/build/components/link-control/search-create-button.js.map +1 -1
  174. package/build/components/link-control/search-input.js +3 -5
  175. package/build/components/link-control/search-input.js.map +1 -1
  176. package/build/components/link-control/search-results.js +5 -15
  177. package/build/components/link-control/search-results.js.map +1 -1
  178. package/build/components/link-control/settings-drawer.js.map +1 -1
  179. package/build/components/link-control/use-rich-url-data.js.map +1 -1
  180. package/build/components/list-view/appender.js +1 -1
  181. package/build/components/list-view/appender.js.map +1 -1
  182. package/build/components/list-view/block-contents.js +1 -25
  183. package/build/components/list-view/block-contents.js.map +1 -1
  184. package/build/components/list-view/block-select-button.js.map +1 -1
  185. package/build/components/list-view/block.js.map +1 -1
  186. package/build/components/list-view/branch.js.map +1 -1
  187. package/build/components/list-view/drop-indicator.js.map +1 -1
  188. package/build/components/list-view/index.js.map +1 -1
  189. package/build/components/list-view/use-block-selection.js +2 -2
  190. package/build/components/list-view/use-block-selection.js.map +1 -1
  191. package/build/components/list-view/utils.js +1 -1
  192. package/build/components/list-view/utils.js.map +1 -1
  193. package/build/components/media-placeholder/index.native.js +1 -1
  194. package/build/components/media-placeholder/index.native.js.map +1 -1
  195. package/build/components/media-replace-flow/index.js.map +1 -1
  196. package/build/components/multi-selection-inspector/index.js +2 -2
  197. package/build/components/multi-selection-inspector/index.js.map +1 -1
  198. package/build/components/observe-typing/index.js +1 -0
  199. package/build/components/observe-typing/index.js.map +1 -1
  200. package/build/components/recursion-provider/index.js +1 -0
  201. package/build/components/recursion-provider/index.js.map +1 -1
  202. package/build/components/responsive-block-control/index.js +3 -3
  203. package/build/components/responsive-block-control/index.js.map +1 -1
  204. package/build/components/responsive-block-control/label.js +1 -1
  205. package/build/components/responsive-block-control/label.js.map +1 -1
  206. package/build/components/rich-text/content.js.map +1 -1
  207. package/build/components/rich-text/file-paste-handler.native.js.map +1 -1
  208. package/build/components/rich-text/format-toolbar/index.js.map +1 -1
  209. package/build/components/rich-text/format-toolbar/index.native.js.map +1 -1
  210. package/build/components/rich-text/index.js +3 -2
  211. package/build/components/rich-text/index.js.map +1 -1
  212. package/build/components/rich-text/multiline.js.map +1 -1
  213. package/build/components/rich-text/native/get-format-colors.native.js.map +1 -1
  214. package/build/components/rich-text/native/index.native.js.map +1 -1
  215. package/build/components/rich-text/native/use-format-types.js +1 -0
  216. package/build/components/rich-text/native/use-format-types.js.map +1 -1
  217. package/build/components/rich-text/toolbar-button.js.map +1 -1
  218. package/build/components/rich-text/use-format-types.js +1 -0
  219. package/build/components/rich-text/use-format-types.js.map +1 -1
  220. package/build/components/spacing-sizes-control/input-controls/axial.js.map +1 -1
  221. package/build/components/spacing-sizes-control/input-controls/separated.js.map +1 -1
  222. package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
  223. package/build/components/spacing-sizes-control/utils.js +1 -0
  224. package/build/components/spacing-sizes-control/utils.js.map +1 -1
  225. package/build/components/tool-selector/index.js +13 -8
  226. package/build/components/tool-selector/index.js.map +1 -1
  227. package/build/components/typewriter/index.js +1 -0
  228. package/build/components/typewriter/index.js.map +1 -1
  229. package/build/components/unsupported-block-details/index.native.js.map +1 -1
  230. package/build/components/url-input/index.js +1 -1
  231. package/build/components/url-input/index.js.map +1 -1
  232. package/build/components/use-block-commands/index.js +0 -61
  233. package/build/components/use-block-commands/index.js.map +1 -1
  234. package/build/components/use-block-drop-zone/index.js.map +1 -1
  235. package/build/components/use-flash-editable-blocks/index.js.map +1 -1
  236. package/build/components/use-moving-animation/index.js.map +1 -1
  237. package/build/components/writing-flow/use-tab-nav.js +23 -30
  238. package/build/components/writing-flow/use-tab-nav.js.map +1 -1
  239. package/build/hooks/align.js.map +1 -1
  240. package/build/hooks/block-hooks.js +1 -1
  241. package/build/hooks/block-hooks.js.map +1 -1
  242. package/build/hooks/block-style-variation.js.map +1 -1
  243. package/build/hooks/duotone.js +4 -1
  244. package/build/hooks/duotone.js.map +1 -1
  245. package/build/hooks/font-family.js.map +1 -1
  246. package/build/hooks/gap.js.map +1 -1
  247. package/build/hooks/generated-class-name.js +1 -0
  248. package/build/hooks/generated-class-name.js.map +1 -1
  249. package/build/hooks/layout-child.js +3 -1
  250. package/build/hooks/layout-child.js.map +1 -1
  251. package/build/hooks/layout.js.map +1 -1
  252. package/build/hooks/position.js +4 -3
  253. package/build/hooks/position.js.map +1 -1
  254. package/build/hooks/spacing-visualizer.js.map +1 -1
  255. package/build/hooks/style.js.map +1 -1
  256. package/build/hooks/text-align.js.map +1 -1
  257. package/build/hooks/use-typography-props.js.map +1 -1
  258. package/build/hooks/use-zoom-out.js +24 -16
  259. package/build/hooks/use-zoom-out.js.map +1 -1
  260. package/build/layouts/constrained.js.map +1 -1
  261. package/build/layouts/flex.js.map +1 -1
  262. package/build/layouts/grid.js.map +1 -1
  263. package/build/layouts/utils.js.map +1 -1
  264. package/build/store/actions.js +18 -20
  265. package/build/store/actions.js.map +1 -1
  266. package/build/store/private-actions.js +15 -0
  267. package/build/store/private-actions.js.map +1 -1
  268. package/build/store/private-selectors.js +104 -7
  269. package/build/store/private-selectors.js.map +1 -1
  270. package/build/store/reducer.js +24 -44
  271. package/build/store/reducer.js.map +1 -1
  272. package/build/store/selectors.js +149 -71
  273. package/build/store/selectors.js.map +1 -1
  274. package/build/store/utils.js +4 -3
  275. package/build/store/utils.js.map +1 -1
  276. package/build/utils/block-bindings.js +2 -0
  277. package/build/utils/block-bindings.js.map +1 -1
  278. package/build/utils/get-font-styles-and-weights.js +1 -1
  279. package/build/utils/get-font-styles-and-weights.js.map +1 -1
  280. package/build/utils/object.js +1 -0
  281. package/build/utils/object.js.map +1 -1
  282. package/build/utils/pasting.js.map +1 -1
  283. package/build-module/autocompleters/block.js +1 -3
  284. package/build-module/autocompleters/block.js.map +1 -1
  285. package/build-module/autocompleters/link.js +3 -4
  286. package/build-module/autocompleters/link.js.map +1 -1
  287. package/build-module/components/audio-player/index.native.js +1 -2
  288. package/build-module/components/audio-player/index.native.js.map +1 -1
  289. package/build-module/components/background-image-control/index.js +2 -3
  290. package/build-module/components/background-image-control/index.js.map +1 -1
  291. package/build-module/components/block-actions/index.js +1 -13
  292. package/build-module/components/block-actions/index.js.map +1 -1
  293. package/build-module/components/block-alignment-control/ui.js +1 -2
  294. package/build-module/components/block-alignment-control/ui.js.map +1 -1
  295. package/build-module/components/block-breadcrumb/index.js +1 -2
  296. package/build-module/components/block-breadcrumb/index.js.map +1 -1
  297. package/build-module/components/block-canvas/index.js +1 -2
  298. package/build-module/components/block-canvas/index.js.map +1 -1
  299. package/build-module/components/block-card/index.js +1 -2
  300. package/build-module/components/block-card/index.js.map +1 -1
  301. package/build-module/components/block-compare/block-view.js +1 -2
  302. package/build-module/components/block-compare/block-view.js.map +1 -1
  303. package/build-module/components/block-compare/index.js +1 -2
  304. package/build-module/components/block-compare/index.js.map +1 -1
  305. package/build-module/components/block-controls/fill.js +1 -3
  306. package/build-module/components/block-controls/fill.js.map +1 -1
  307. package/build-module/components/block-controls/slot.js.map +1 -1
  308. package/build-module/components/block-controls/slot.native.js.map +1 -1
  309. package/build-module/components/block-draggable/draggable-chip.js +2 -3
  310. package/build-module/components/block-draggable/draggable-chip.js.map +1 -1
  311. package/build-module/components/block-draggable/draggable-chip.native.js +1 -2
  312. package/build-module/components/block-draggable/draggable-chip.native.js.map +1 -1
  313. package/build-module/components/block-draggable/index.native.js +1 -3
  314. package/build-module/components/block-draggable/index.native.js.map +1 -1
  315. package/build-module/components/block-edit/index.js +1 -2
  316. package/build-module/components/block-edit/index.js.map +1 -1
  317. package/build-module/components/block-edit/multiple-usage-warning.js +1 -2
  318. package/build-module/components/block-edit/multiple-usage-warning.js.map +1 -1
  319. package/build-module/components/block-inspector/index.js +57 -78
  320. package/build-module/components/block-inspector/index.js.map +1 -1
  321. package/build-module/components/block-list/block-crash-warning.js +1 -1
  322. package/build-module/components/block-list/block-crash-warning.js.map +1 -1
  323. package/build-module/components/block-list/block-crash-warning.native.js +1 -1
  324. package/build-module/components/block-list/block-crash-warning.native.js.map +1 -1
  325. package/build-module/components/block-list/block-invalid-warning.js +1 -3
  326. package/build-module/components/block-list/block-invalid-warning.js.map +1 -1
  327. package/build-module/components/block-list/block-invalid-warning.native.js +1 -1
  328. package/build-module/components/block-list/block-invalid-warning.native.js.map +1 -1
  329. package/build-module/components/block-list/block-list-item.native.js +1 -2
  330. package/build-module/components/block-list/block-list-item.native.js.map +1 -1
  331. package/build-module/components/block-list/block-selection-button.native.js +1 -2
  332. package/build-module/components/block-list/block-selection-button.native.js.map +1 -1
  333. package/build-module/components/block-list/block.js +6 -19
  334. package/build-module/components/block-list/block.js.map +1 -1
  335. package/build-module/components/block-list/block.native.js +1 -2
  336. package/build-module/components/block-list/block.native.js.map +1 -1
  337. package/build-module/components/block-list/index.js +7 -10
  338. package/build-module/components/block-list/index.js.map +1 -1
  339. package/build-module/components/block-list/index.native.js +1 -3
  340. package/build-module/components/block-list/index.native.js.map +1 -1
  341. package/build-module/components/block-list/insertion-point.native.js +1 -2
  342. package/build-module/components/block-list/insertion-point.native.js.map +1 -1
  343. package/build-module/components/block-list/use-block-props/index.js +3 -8
  344. package/build-module/components/block-list/use-block-props/index.js.map +1 -1
  345. package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js +14 -6
  346. package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
  347. package/build-module/components/block-list/use-in-between-inserter.js +5 -3
  348. package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
  349. package/build-module/components/block-list/zoom-out-separator.js +24 -13
  350. package/build-module/components/block-list/zoom-out-separator.js.map +1 -1
  351. package/build-module/components/block-lock/menu-item.js +1 -3
  352. package/build-module/components/block-lock/menu-item.js.map +1 -1
  353. package/build-module/components/block-lock/modal.js +2 -3
  354. package/build-module/components/block-lock/modal.js.map +1 -1
  355. package/build-module/components/block-lock/toolbar.js +1 -3
  356. package/build-module/components/block-lock/toolbar.js.map +1 -1
  357. package/build-module/components/block-media-update-progress/index.native.js +1 -2
  358. package/build-module/components/block-media-update-progress/index.native.js.map +1 -1
  359. package/build-module/components/block-mover/button.js +1 -3
  360. package/build-module/components/block-mover/button.js.map +1 -1
  361. package/build-module/components/block-mover/index.js +1 -2
  362. package/build-module/components/block-mover/index.js.map +1 -1
  363. package/build-module/components/block-mover/index.native.js +1 -2
  364. package/build-module/components/block-mover/index.native.js.map +1 -1
  365. package/build-module/components/block-navigation/dropdown.js +3 -6
  366. package/build-module/components/block-navigation/dropdown.js.map +1 -1
  367. package/build-module/components/block-parent-selector/index.js +14 -11
  368. package/build-module/components/block-parent-selector/index.js.map +1 -1
  369. package/build-module/components/block-pattern-setup/index.js +1 -3
  370. package/build-module/components/block-pattern-setup/index.js.map +1 -1
  371. package/build-module/components/block-pattern-setup/setup-toolbar.js +11 -22
  372. package/build-module/components/block-pattern-setup/setup-toolbar.js.map +1 -1
  373. package/build-module/components/block-patterns-list/index.js +1 -3
  374. package/build-module/components/block-patterns-list/index.js.map +1 -1
  375. package/build-module/components/block-patterns-paging/index.js +12 -15
  376. package/build-module/components/block-patterns-paging/index.js.map +1 -1
  377. package/build-module/components/block-popover/index.js +45 -2
  378. package/build-module/components/block-popover/index.js.map +1 -1
  379. package/build-module/components/block-preview/auto.js +2 -7
  380. package/build-module/components/block-preview/auto.js.map +1 -1
  381. package/build-module/components/block-preview/index.js +1 -2
  382. package/build-module/components/block-preview/index.js.map +1 -1
  383. package/build-module/components/block-quick-navigation/index.js +3 -6
  384. package/build-module/components/block-quick-navigation/index.js.map +1 -1
  385. package/build-module/components/block-removal-warning-modal/index.js +1 -2
  386. package/build-module/components/block-removal-warning-modal/index.js.map +1 -1
  387. package/build-module/components/block-rename/modal.js +3 -4
  388. package/build-module/components/block-rename/modal.js.map +1 -1
  389. package/build-module/components/block-rename/rename-control.js +1 -3
  390. package/build-module/components/block-rename/rename-control.js.map +1 -1
  391. package/build-module/components/block-settings/container.native.js +1 -3
  392. package/build-module/components/block-settings/container.native.js.map +1 -1
  393. package/build-module/components/block-settings-menu/block-parent-selector-menu-item.js +1 -1
  394. package/build-module/components/block-settings-menu/block-parent-selector-menu-item.js.map +1 -1
  395. package/build-module/components/block-settings-menu/block-settings-dropdown.js +80 -79
  396. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  397. package/build-module/components/block-settings-menu-controls/index.js +3 -9
  398. package/build-module/components/block-settings-menu-controls/index.js.map +1 -1
  399. package/build-module/components/block-styles/index.js +1 -2
  400. package/build-module/components/block-styles/index.js.map +1 -1
  401. package/build-module/components/block-styles/menu-items.js +1 -2
  402. package/build-module/components/block-styles/menu-items.js.map +1 -1
  403. package/build-module/components/block-styles/preview.native.js +1 -2
  404. package/build-module/components/block-styles/preview.native.js.map +1 -1
  405. package/build-module/components/block-switcher/block-transformations-menu.js +1 -3
  406. package/build-module/components/block-switcher/block-transformations-menu.js.map +1 -1
  407. package/build-module/components/block-switcher/block-transformations-menu.native.js +1 -1
  408. package/build-module/components/block-switcher/block-transformations-menu.native.js.map +1 -1
  409. package/build-module/components/block-switcher/block-variation-transformations.js +1 -3
  410. package/build-module/components/block-switcher/block-variation-transformations.js.map +1 -1
  411. package/build-module/components/block-switcher/index.js +20 -18
  412. package/build-module/components/block-switcher/index.js.map +1 -1
  413. package/build-module/components/block-switcher/pattern-transformations-menu.js +1 -2
  414. package/build-module/components/block-switcher/pattern-transformations-menu.js.map +1 -1
  415. package/build-module/components/block-switcher/preview-block-popover.js +1 -2
  416. package/build-module/components/block-switcher/preview-block-popover.js.map +1 -1
  417. package/build-module/components/block-switcher/use-transformed-patterns.js +1 -0
  418. package/build-module/components/block-switcher/use-transformed-patterns.js.map +1 -1
  419. package/build-module/components/block-switcher/utils.js +1 -0
  420. package/build-module/components/block-switcher/utils.js.map +1 -1
  421. package/build-module/components/block-toolbar/block-toolbar-menu.native.js +1 -2
  422. package/build-module/components/block-toolbar/block-toolbar-menu.native.js.map +1 -1
  423. package/build-module/components/block-toolbar/index.js +17 -22
  424. package/build-module/components/block-toolbar/index.js.map +1 -1
  425. package/build-module/components/block-toolbar/index.native.js +1 -3
  426. package/build-module/components/block-toolbar/index.native.js.map +1 -1
  427. package/build-module/components/block-toolbar/use-has-block-toolbar.js +3 -5
  428. package/build-module/components/block-toolbar/use-has-block-toolbar.js.map +1 -1
  429. package/build-module/components/block-tools/index.js +9 -20
  430. package/build-module/components/block-tools/index.js.map +1 -1
  431. package/build-module/components/block-tools/insertion-point.js +2 -6
  432. package/build-module/components/block-tools/insertion-point.js.map +1 -1
  433. package/build-module/components/block-tools/use-show-block-tools.js +8 -7
  434. package/build-module/components/block-tools/use-show-block-tools.js.map +1 -1
  435. package/build-module/components/block-tools/zoom-out-mode-inserter-button.js +1 -12
  436. package/build-module/components/block-tools/zoom-out-mode-inserter-button.js.map +1 -1
  437. package/build-module/components/block-tools/zoom-out-mode-inserters.js +14 -17
  438. package/build-module/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
  439. package/build-module/components/block-tools/zoom-out-popover.js +2 -1
  440. package/build-module/components/block-tools/zoom-out-popover.js.map +1 -1
  441. package/build-module/components/block-tools/zoom-out-toolbar.js +7 -35
  442. package/build-module/components/block-tools/zoom-out-toolbar.js.map +1 -1
  443. package/build-module/components/block-types-list/index.js +1 -2
  444. package/build-module/components/block-types-list/index.js.map +1 -1
  445. package/build-module/components/block-types-list/index.native.js +1 -2
  446. package/build-module/components/block-types-list/index.native.js.map +1 -1
  447. package/build-module/components/block-variation-picker/index.js +1 -2
  448. package/build-module/components/block-variation-picker/index.js.map +1 -1
  449. package/build-module/components/block-variation-picker/index.native.js +1 -2
  450. package/build-module/components/block-variation-picker/index.native.js.map +1 -1
  451. package/build-module/components/block-variation-transforms/index.js +4 -4
  452. package/build-module/components/block-variation-transforms/index.js.map +1 -1
  453. package/build-module/components/border-radius-control/index.js +1 -3
  454. package/build-module/components/border-radius-control/index.js.map +1 -1
  455. package/build-module/components/border-radius-control/utils.js.map +1 -1
  456. package/build-module/components/button-block-appender/index.js.map +1 -1
  457. package/build-module/components/button-block-appender/index.native.js +1 -2
  458. package/build-module/components/button-block-appender/index.native.js.map +1 -1
  459. package/build-module/components/child-layout-control/index.js +1 -3
  460. package/build-module/components/child-layout-control/index.js.map +1 -1
  461. package/build-module/components/color-style-selector/index.js.map +1 -1
  462. package/build-module/components/colors/utils.js.map +1 -1
  463. package/build-module/components/colors/with-colors.js.map +1 -1
  464. package/build-module/components/colors-gradients/control.js +1 -2
  465. package/build-module/components/colors-gradients/control.js.map +1 -1
  466. package/build-module/components/colors-gradients/dropdown.js +1 -3
  467. package/build-module/components/colors-gradients/dropdown.js.map +1 -1
  468. package/build-module/components/colors-gradients/panel-color-gradient-settings.js +1 -3
  469. package/build-module/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
  470. package/build-module/components/colors-gradients/panel-color-gradient-settings.native.js +1 -3
  471. package/build-module/components/colors-gradients/panel-color-gradient-settings.native.js.map +1 -1
  472. package/build-module/components/contrast-checker/index.native.js +1 -2
  473. package/build-module/components/contrast-checker/index.native.js.map +1 -1
  474. package/build-module/components/convert-to-group-buttons/index.js +1 -3
  475. package/build-module/components/convert-to-group-buttons/index.js.map +1 -1
  476. package/build-module/components/convert-to-group-buttons/toolbar.js +1 -2
  477. package/build-module/components/convert-to-group-buttons/toolbar.js.map +1 -1
  478. package/build-module/components/date-format-picker/index.js +2 -2
  479. package/build-module/components/date-format-picker/index.js.map +1 -1
  480. package/build-module/components/default-block-appender/index.js +1 -2
  481. package/build-module/components/default-block-appender/index.js.map +1 -1
  482. package/build-module/components/dimensions-tool/index.js +1 -3
  483. package/build-module/components/dimensions-tool/index.js.map +1 -1
  484. package/build-module/components/dimensions-tool/width-height-tool.js +1 -3
  485. package/build-module/components/dimensions-tool/width-height-tool.js.map +1 -1
  486. package/build-module/components/duotone/utils.js.map +1 -1
  487. package/build-module/components/duotone-control/index.js +1 -2
  488. package/build-module/components/duotone-control/index.js.map +1 -1
  489. package/build-module/components/editor-styles/index.js +1 -3
  490. package/build-module/components/editor-styles/index.js.map +1 -1
  491. package/build-module/components/floating-toolbar/index.native.js +1 -2
  492. package/build-module/components/floating-toolbar/index.native.js.map +1 -1
  493. package/build-module/components/floating-toolbar/nav-up-icon.js +1 -2
  494. package/build-module/components/floating-toolbar/nav-up-icon.js.map +1 -1
  495. package/build-module/components/font-sizes/fluid-utils.js.map +1 -1
  496. package/build-module/components/font-sizes/utils.js.map +1 -1
  497. package/build-module/components/font-sizes/with-font-sizes.js +2 -2
  498. package/build-module/components/font-sizes/with-font-sizes.js.map +1 -1
  499. package/build-module/components/global-styles/advanced-panel.js +1 -2
  500. package/build-module/components/global-styles/advanced-panel.js.map +1 -1
  501. package/build-module/components/global-styles/border-panel.js +2 -3
  502. package/build-module/components/global-styles/border-panel.js.map +1 -1
  503. package/build-module/components/global-styles/color-panel.js +2 -3
  504. package/build-module/components/global-styles/color-panel.js.map +1 -1
  505. package/build-module/components/global-styles/dimensions-panel.js +2 -3
  506. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  507. package/build-module/components/global-styles/filters-panel.js +1 -2
  508. package/build-module/components/global-styles/filters-panel.js.map +1 -1
  509. package/build-module/components/global-styles/get-block-css-selector.js.map +1 -1
  510. package/build-module/components/global-styles/get-global-styles-changes.js +2 -1
  511. package/build-module/components/global-styles/get-global-styles-changes.js.map +1 -1
  512. package/build-module/components/global-styles/hooks.js.map +1 -1
  513. package/build-module/components/global-styles/image-settings-panel.js +1 -2
  514. package/build-module/components/global-styles/image-settings-panel.js.map +1 -1
  515. package/build-module/components/global-styles/shadow-panel-components.js +1 -2
  516. package/build-module/components/global-styles/shadow-panel-components.js.map +1 -1
  517. package/build-module/components/global-styles/typography-panel.js +1 -2
  518. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  519. package/build-module/components/global-styles/use-global-styles-context.native.js.map +1 -1
  520. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  521. package/build-module/components/global-styles/utils.js.map +1 -1
  522. package/build-module/components/gradients/use-gradient.js.map +1 -1
  523. package/build-module/components/grid/grid-item-movers.js +1 -3
  524. package/build-module/components/grid/grid-item-movers.js.map +1 -1
  525. package/build-module/components/grid/grid-visualizer.js.map +1 -1
  526. package/build-module/components/height-control/index.js +1 -2
  527. package/build-module/components/height-control/index.js.map +1 -1
  528. package/build-module/components/iframe/index.js +45 -12
  529. package/build-module/components/iframe/index.js.map +1 -1
  530. package/build-module/components/image-editor/aspect-ratio-dropdown.js +1 -3
  531. package/build-module/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
  532. package/build-module/components/image-editor/cropper.js +1 -3
  533. package/build-module/components/image-editor/cropper.js.map +1 -1
  534. package/build-module/components/image-editor/form-controls.js +1 -3
  535. package/build-module/components/image-editor/form-controls.js.map +1 -1
  536. package/build-module/components/image-editor/index.js +1 -2
  537. package/build-module/components/image-editor/index.js.map +1 -1
  538. package/build-module/components/image-editor/use-save-image.js +1 -1
  539. package/build-module/components/image-editor/use-save-image.js.map +1 -1
  540. package/build-module/components/image-link-destinations/index.native.js +1 -3
  541. package/build-module/components/image-link-destinations/index.native.js.map +1 -1
  542. package/build-module/components/image-size-control/index.js +1 -3
  543. package/build-module/components/image-size-control/index.js.map +1 -1
  544. package/build-module/components/inner-blocks/index.js +1 -9
  545. package/build-module/components/inner-blocks/index.js.map +1 -1
  546. package/build-module/components/inner-blocks/use-nested-settings-update.js +16 -9
  547. package/build-module/components/inner-blocks/use-nested-settings-update.js.map +1 -1
  548. package/build-module/components/inner-blocks/warning-max-depth-exceeded.native.js +1 -2
  549. package/build-module/components/inner-blocks/warning-max-depth-exceeded.native.js.map +1 -1
  550. package/build-module/components/inserter/block-patterns-explorer/index.js +1 -2
  551. package/build-module/components/inserter/block-patterns-explorer/index.js.map +1 -1
  552. package/build-module/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js +2 -3
  553. package/build-module/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js.map +1 -1
  554. package/build-module/components/inserter/block-patterns-explorer/pattern-list.js +3 -5
  555. package/build-module/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
  556. package/build-module/components/inserter/block-patterns-tab/index.js +1 -3
  557. package/build-module/components/inserter/block-patterns-tab/index.js.map +1 -1
  558. package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js +1 -3
  559. package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
  560. package/build-module/components/inserter/block-patterns-tab/patterns-filter.js +1 -3
  561. package/build-module/components/inserter/block-patterns-tab/patterns-filter.js.map +1 -1
  562. package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js +1 -1
  563. package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
  564. package/build-module/components/inserter/block-types-tab.js +2 -4
  565. package/build-module/components/inserter/block-types-tab.js.map +1 -1
  566. package/build-module/components/inserter/block-types-tab.native.js.map +1 -1
  567. package/build-module/components/inserter/category-tabs/index.js +3 -13
  568. package/build-module/components/inserter/category-tabs/index.js.map +1 -1
  569. package/build-module/components/inserter/hooks/use-block-types-state.js +27 -8
  570. package/build-module/components/inserter/hooks/use-block-types-state.js.map +1 -1
  571. package/build-module/components/inserter/hooks/use-insertion-point.js +22 -12
  572. package/build-module/components/inserter/hooks/use-insertion-point.js.map +1 -1
  573. package/build-module/components/inserter/hooks/use-patterns-state.js +24 -11
  574. package/build-module/components/inserter/hooks/use-patterns-state.js.map +1 -1
  575. package/build-module/components/inserter/index.native.js +1 -3
  576. package/build-module/components/inserter/index.native.js.map +1 -1
  577. package/build-module/components/inserter/media-tab/media-panel.js +1 -2
  578. package/build-module/components/inserter/media-tab/media-panel.js.map +1 -1
  579. package/build-module/components/inserter/media-tab/media-preview.js +37 -17
  580. package/build-module/components/inserter/media-tab/media-preview.js.map +1 -1
  581. package/build-module/components/inserter/media-tab/media-tab.js +1 -3
  582. package/build-module/components/inserter/media-tab/media-tab.js.map +1 -1
  583. package/build-module/components/inserter/media-tab/utils.js.map +1 -1
  584. package/build-module/components/inserter/menu.js +5 -7
  585. package/build-module/components/inserter/menu.js.map +1 -1
  586. package/build-module/components/inserter/menu.native.js +1 -3
  587. package/build-module/components/inserter/menu.native.js.map +1 -1
  588. package/build-module/components/inserter/mobile-tab-navigation.js +7 -8
  589. package/build-module/components/inserter/mobile-tab-navigation.js.map +1 -1
  590. package/build-module/components/inserter/no-results.js +1 -2
  591. package/build-module/components/inserter/no-results.js.map +1 -1
  592. package/build-module/components/inserter/no-results.native.js +1 -2
  593. package/build-module/components/inserter/no-results.native.js.map +1 -1
  594. package/build-module/components/inserter/panel.js +1 -3
  595. package/build-module/components/inserter/panel.js.map +1 -1
  596. package/build-module/components/inserter/preview-panel.js +1 -2
  597. package/build-module/components/inserter/preview-panel.js.map +1 -1
  598. package/build-module/components/inserter/quick-inserter.js +6 -7
  599. package/build-module/components/inserter/quick-inserter.js.map +1 -1
  600. package/build-module/components/inserter/search-results.js +2 -3
  601. package/build-module/components/inserter/search-results.js.map +1 -1
  602. package/build-module/components/inserter/tabs.native.js.map +1 -1
  603. package/build-module/components/inserter-button/index.native.js +1 -2
  604. package/build-module/components/inserter-button/index.native.js.map +1 -1
  605. package/build-module/components/inserter-list-item/index.js +1 -2
  606. package/build-module/components/inserter-list-item/index.js.map +1 -1
  607. package/build-module/components/inserter-listbox/index.js +1 -2
  608. package/build-module/components/inserter-listbox/index.js.map +1 -1
  609. package/build-module/components/inspector-controls/block-support-tools-panel.js.map +1 -1
  610. package/build-module/components/inspector-controls/fill.js.map +1 -1
  611. package/build-module/components/inspector-controls/fill.native.js +1 -3
  612. package/build-module/components/inspector-controls/fill.native.js.map +1 -1
  613. package/build-module/components/inspector-controls/slot.js.map +1 -1
  614. package/build-module/components/inspector-controls/slot.native.js.map +1 -1
  615. package/build-module/components/inspector-controls-tabs/index.js +1 -2
  616. package/build-module/components/inspector-controls-tabs/index.js.map +1 -1
  617. package/build-module/components/inspector-controls-tabs/settings-tab.js +1 -3
  618. package/build-module/components/inspector-controls-tabs/settings-tab.js.map +1 -1
  619. package/build-module/components/inspector-controls-tabs/styles-tab.js +1 -3
  620. package/build-module/components/inspector-controls-tabs/styles-tab.js.map +1 -1
  621. package/build-module/components/inspector-popover-header/index.js +1 -2
  622. package/build-module/components/inspector-popover-header/index.js.map +1 -1
  623. package/build-module/components/line-height-control/index.js.map +1 -1
  624. package/build-module/components/link-control/index.js +2 -5
  625. package/build-module/components/link-control/index.js.map +1 -1
  626. package/build-module/components/link-control/is-url-like.js.map +1 -1
  627. package/build-module/components/link-control/link-preview.js +1 -3
  628. package/build-module/components/link-control/link-preview.js.map +1 -1
  629. package/build-module/components/link-control/search-create-button.js +1 -1
  630. package/build-module/components/link-control/search-create-button.js.map +1 -1
  631. package/build-module/components/link-control/search-input.js +4 -7
  632. package/build-module/components/link-control/search-input.js.map +1 -1
  633. package/build-module/components/link-control/search-results.js +6 -17
  634. package/build-module/components/link-control/search-results.js.map +1 -1
  635. package/build-module/components/link-control/settings-drawer.js +1 -3
  636. package/build-module/components/link-control/settings-drawer.js.map +1 -1
  637. package/build-module/components/link-control/settings.js +1 -2
  638. package/build-module/components/link-control/settings.js.map +1 -1
  639. package/build-module/components/link-control/use-rich-url-data.js.map +1 -1
  640. package/build-module/components/list-view/appender.js +2 -3
  641. package/build-module/components/list-view/appender.js.map +1 -1
  642. package/build-module/components/list-view/block-contents.js +2 -28
  643. package/build-module/components/list-view/block-contents.js.map +1 -1
  644. package/build-module/components/list-view/block-select-button.js +1 -2
  645. package/build-module/components/list-view/block-select-button.js.map +1 -1
  646. package/build-module/components/list-view/block.js +1 -3
  647. package/build-module/components/list-view/block.js.map +1 -1
  648. package/build-module/components/list-view/branch.js +1 -3
  649. package/build-module/components/list-view/branch.js.map +1 -1
  650. package/build-module/components/list-view/drop-indicator.js +1 -2
  651. package/build-module/components/list-view/drop-indicator.js.map +1 -1
  652. package/build-module/components/list-view/index.js +1 -2
  653. package/build-module/components/list-view/index.js.map +1 -1
  654. package/build-module/components/list-view/use-block-selection.js +2 -2
  655. package/build-module/components/list-view/use-block-selection.js.map +1 -1
  656. package/build-module/components/list-view/utils.js +1 -1
  657. package/build-module/components/list-view/utils.js.map +1 -1
  658. package/build-module/components/media-placeholder/index.js +1 -3
  659. package/build-module/components/media-placeholder/index.js.map +1 -1
  660. package/build-module/components/media-placeholder/index.native.js +2 -4
  661. package/build-module/components/media-placeholder/index.native.js.map +1 -1
  662. package/build-module/components/media-replace-flow/index.js +1 -3
  663. package/build-module/components/media-replace-flow/index.js.map +1 -1
  664. package/build-module/components/media-upload/index.native.js +1 -3
  665. package/build-module/components/media-upload/index.native.js.map +1 -1
  666. package/build-module/components/media-upload-progress/index.native.js +1 -2
  667. package/build-module/components/media-upload-progress/index.native.js.map +1 -1
  668. package/build-module/components/multi-selection-inspector/index.js +3 -4
  669. package/build-module/components/multi-selection-inspector/index.js.map +1 -1
  670. package/build-module/components/observe-typing/index.js +1 -0
  671. package/build-module/components/observe-typing/index.js.map +1 -1
  672. package/build-module/components/provider/index.js +1 -2
  673. package/build-module/components/provider/index.js.map +1 -1
  674. package/build-module/components/publish-date-time-picker/index.js +1 -2
  675. package/build-module/components/publish-date-time-picker/index.js.map +1 -1
  676. package/build-module/components/recursion-provider/index.js +1 -0
  677. package/build-module/components/recursion-provider/index.js.map +1 -1
  678. package/build-module/components/responsive-block-control/index.js +4 -5
  679. package/build-module/components/responsive-block-control/index.js.map +1 -1
  680. package/build-module/components/responsive-block-control/label.js +2 -4
  681. package/build-module/components/responsive-block-control/label.js.map +1 -1
  682. package/build-module/components/rich-text/content.js.map +1 -1
  683. package/build-module/components/rich-text/event-listeners/before-input-rules.js +2 -2
  684. package/build-module/components/rich-text/event-listeners/before-input-rules.js.map +1 -1
  685. package/build-module/components/rich-text/event-listeners/delete.js +2 -2
  686. package/build-module/components/rich-text/event-listeners/delete.js.map +1 -1
  687. package/build-module/components/rich-text/event-listeners/enter.js +2 -2
  688. package/build-module/components/rich-text/event-listeners/enter.js.map +1 -1
  689. package/build-module/components/rich-text/event-listeners/firefox-compat.js +2 -2
  690. package/build-module/components/rich-text/event-listeners/firefox-compat.js.map +1 -1
  691. package/build-module/components/rich-text/event-listeners/input-events.js +2 -2
  692. package/build-module/components/rich-text/event-listeners/input-events.js.map +1 -1
  693. package/build-module/components/rich-text/event-listeners/input-rules.js +2 -2
  694. package/build-module/components/rich-text/event-listeners/input-rules.js.map +1 -1
  695. package/build-module/components/rich-text/event-listeners/insert-replacement-text.js +2 -2
  696. package/build-module/components/rich-text/event-listeners/insert-replacement-text.js.map +1 -1
  697. package/build-module/components/rich-text/event-listeners/paste-handler.js +2 -2
  698. package/build-module/components/rich-text/event-listeners/paste-handler.js.map +1 -1
  699. package/build-module/components/rich-text/event-listeners/remove-browser-shortcuts.js +2 -2
  700. package/build-module/components/rich-text/event-listeners/remove-browser-shortcuts.js.map +1 -1
  701. package/build-module/components/rich-text/event-listeners/shortcuts.js +2 -2
  702. package/build-module/components/rich-text/event-listeners/shortcuts.js.map +1 -1
  703. package/build-module/components/rich-text/event-listeners/undo-automatic-change.js +2 -2
  704. package/build-module/components/rich-text/event-listeners/undo-automatic-change.js.map +1 -1
  705. package/build-module/components/rich-text/file-paste-handler.native.js.map +1 -1
  706. package/build-module/components/rich-text/format-toolbar/index.js +1 -3
  707. package/build-module/components/rich-text/format-toolbar/index.js.map +1 -1
  708. package/build-module/components/rich-text/format-toolbar/index.native.js +1 -3
  709. package/build-module/components/rich-text/format-toolbar/index.native.js.map +1 -1
  710. package/build-module/components/rich-text/index.js +4 -5
  711. package/build-module/components/rich-text/index.js.map +1 -1
  712. package/build-module/components/rich-text/index.native.js +1 -3
  713. package/build-module/components/rich-text/index.native.js.map +1 -1
  714. package/build-module/components/rich-text/multiline.js.map +1 -1
  715. package/build-module/components/rich-text/native/get-format-colors.native.js.map +1 -1
  716. package/build-module/components/rich-text/native/index.js +1 -1
  717. package/build-module/components/rich-text/native/index.js.map +1 -1
  718. package/build-module/components/rich-text/native/index.native.js +1 -3
  719. package/build-module/components/rich-text/native/index.native.js.map +1 -1
  720. package/build-module/components/rich-text/native/toolbar-button-with-options.native.js +1 -3
  721. package/build-module/components/rich-text/native/toolbar-button-with-options.native.js.map +1 -1
  722. package/build-module/components/rich-text/native/use-format-types.js +1 -0
  723. package/build-module/components/rich-text/native/use-format-types.js.map +1 -1
  724. package/build-module/components/rich-text/toolbar-button.js.map +1 -1
  725. package/build-module/components/rich-text/use-format-types.js +1 -0
  726. package/build-module/components/rich-text/use-format-types.js.map +1 -1
  727. package/build-module/components/spacing-sizes-control/index.js +1 -2
  728. package/build-module/components/spacing-sizes-control/index.js.map +1 -1
  729. package/build-module/components/spacing-sizes-control/input-controls/axial.js +1 -2
  730. package/build-module/components/spacing-sizes-control/input-controls/axial.js.map +1 -1
  731. package/build-module/components/spacing-sizes-control/input-controls/separated.js +1 -2
  732. package/build-module/components/spacing-sizes-control/input-controls/separated.js.map +1 -1
  733. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js +1 -3
  734. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
  735. package/build-module/components/spacing-sizes-control/utils.js +1 -0
  736. package/build-module/components/spacing-sizes-control/utils.js.map +1 -1
  737. package/build-module/components/tabbed-sidebar/index.js +1 -2
  738. package/build-module/components/tabbed-sidebar/index.js.map +1 -1
  739. package/build-module/components/tool-selector/index.js +14 -11
  740. package/build-module/components/tool-selector/index.js.map +1 -1
  741. package/build-module/components/typewriter/index.js +1 -0
  742. package/build-module/components/typewriter/index.js.map +1 -1
  743. package/build-module/components/unsupported-block-details/index.native.js +1 -2
  744. package/build-module/components/unsupported-block-details/index.native.js.map +1 -1
  745. package/build-module/components/url-input/button.js +1 -2
  746. package/build-module/components/url-input/button.js.map +1 -1
  747. package/build-module/components/url-input/index.js +2 -4
  748. package/build-module/components/url-input/index.js.map +1 -1
  749. package/build-module/components/url-popover/image-url-input-ui.js +1 -3
  750. package/build-module/components/url-popover/image-url-input-ui.js.map +1 -1
  751. package/build-module/components/url-popover/index.js +1 -2
  752. package/build-module/components/url-popover/index.js.map +1 -1
  753. package/build-module/components/url-popover/link-editor.js +1 -2
  754. package/build-module/components/url-popover/link-editor.js.map +1 -1
  755. package/build-module/components/url-popover/link-viewer.js +1 -2
  756. package/build-module/components/url-popover/link-viewer.js.map +1 -1
  757. package/build-module/components/use-block-commands/index.js +1 -62
  758. package/build-module/components/use-block-commands/index.js.map +1 -1
  759. package/build-module/components/use-block-drop-zone/index.js.map +1 -1
  760. package/build-module/components/use-flash-editable-blocks/index.js.map +1 -1
  761. package/build-module/components/use-moving-animation/index.js.map +1 -1
  762. package/build-module/components/video-player/index.native.js +1 -2
  763. package/build-module/components/video-player/index.native.js.map +1 -1
  764. package/build-module/components/warning/index.js +1 -2
  765. package/build-module/components/warning/index.js.map +1 -1
  766. package/build-module/components/warning/index.native.js +1 -2
  767. package/build-module/components/warning/index.native.js.map +1 -1
  768. package/build-module/components/writing-flow/index.js +1 -3
  769. package/build-module/components/writing-flow/index.js.map +1 -1
  770. package/build-module/components/writing-flow/use-tab-nav.js +24 -31
  771. package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
  772. package/build-module/hooks/align.js.map +1 -1
  773. package/build-module/hooks/anchor.js +1 -3
  774. package/build-module/hooks/anchor.js.map +1 -1
  775. package/build-module/hooks/block-bindings.js +1 -3
  776. package/build-module/hooks/block-bindings.js.map +1 -1
  777. package/build-module/hooks/block-hooks.js +2 -3
  778. package/build-module/hooks/block-hooks.js.map +1 -1
  779. package/build-module/hooks/block-style-variation.js +1 -2
  780. package/build-module/hooks/block-style-variation.js.map +1 -1
  781. package/build-module/hooks/dimensions.js +1 -3
  782. package/build-module/hooks/dimensions.js.map +1 -1
  783. package/build-module/hooks/duotone.js +5 -4
  784. package/build-module/hooks/duotone.js.map +1 -1
  785. package/build-module/hooks/font-family.js.map +1 -1
  786. package/build-module/hooks/gap.js.map +1 -1
  787. package/build-module/hooks/generated-class-name.js +1 -0
  788. package/build-module/hooks/generated-class-name.js.map +1 -1
  789. package/build-module/hooks/grid-visualizer.js +1 -3
  790. package/build-module/hooks/grid-visualizer.js.map +1 -1
  791. package/build-module/hooks/layout-child.js +5 -4
  792. package/build-module/hooks/layout-child.js.map +1 -1
  793. package/build-module/hooks/layout.js +1 -3
  794. package/build-module/hooks/layout.js.map +1 -1
  795. package/build-module/hooks/position.js +5 -2
  796. package/build-module/hooks/position.js.map +1 -1
  797. package/build-module/hooks/spacing-visualizer.js.map +1 -1
  798. package/build-module/hooks/style.js +1 -3
  799. package/build-module/hooks/style.js.map +1 -1
  800. package/build-module/hooks/text-align.js.map +1 -1
  801. package/build-module/hooks/typography.native.js +1 -2
  802. package/build-module/hooks/typography.native.js.map +1 -1
  803. package/build-module/hooks/use-bindings-attributes.js +1 -2
  804. package/build-module/hooks/use-bindings-attributes.js.map +1 -1
  805. package/build-module/hooks/use-typography-props.js.map +1 -1
  806. package/build-module/hooks/use-zoom-out.js +24 -17
  807. package/build-module/hooks/use-zoom-out.js.map +1 -1
  808. package/build-module/layouts/constrained.js +1 -3
  809. package/build-module/layouts/constrained.js.map +1 -1
  810. package/build-module/layouts/flex.js +1 -3
  811. package/build-module/layouts/flex.js.map +1 -1
  812. package/build-module/layouts/grid.js +1 -3
  813. package/build-module/layouts/grid.js.map +1 -1
  814. package/build-module/layouts/utils.js.map +1 -1
  815. package/build-module/store/actions.js +17 -18
  816. package/build-module/store/actions.js.map +1 -1
  817. package/build-module/store/private-actions.js +14 -0
  818. package/build-module/store/private-actions.js.map +1 -1
  819. package/build-module/store/private-selectors.js +98 -7
  820. package/build-module/store/private-selectors.js.map +1 -1
  821. package/build-module/store/reducer.js +22 -41
  822. package/build-module/store/reducer.js.map +1 -1
  823. package/build-module/store/selectors.js +150 -70
  824. package/build-module/store/selectors.js.map +1 -1
  825. package/build-module/store/utils.js +3 -2
  826. package/build-module/store/utils.js.map +1 -1
  827. package/build-module/utils/block-bindings.js +2 -0
  828. package/build-module/utils/block-bindings.js.map +1 -1
  829. package/build-module/utils/get-font-styles-and-weights.js +1 -1
  830. package/build-module/utils/get-font-styles-and-weights.js.map +1 -1
  831. package/build-module/utils/get-px-from-css-unit.js +1 -1
  832. package/build-module/utils/get-px-from-css-unit.js.map +1 -1
  833. package/build-module/utils/object.js +1 -0
  834. package/build-module/utils/object.js.map +1 -1
  835. package/build-module/utils/pasting.js.map +1 -1
  836. package/build-style/content-rtl.css +22 -73
  837. package/build-style/content.css +22 -73
  838. package/build-style/default-editor-styles-rtl.css +10 -1
  839. package/build-style/default-editor-styles.css +10 -1
  840. package/build-style/style-rtl.css +48 -165
  841. package/build-style/style.css +48 -165
  842. package/package.json +33 -33
  843. package/src/autocompleters/link.js +2 -1
  844. package/src/components/block-actions/index.js +1 -13
  845. package/src/components/block-canvas/style.scss +0 -1
  846. package/src/components/block-draggable/style.scss +2 -2
  847. package/src/components/block-inspector/index.js +79 -95
  848. package/src/components/block-list/block.js +7 -25
  849. package/src/components/block-list/content.scss +4 -63
  850. package/src/components/block-list/index.js +21 -29
  851. package/src/components/block-list/use-block-props/index.js +2 -8
  852. package/src/components/block-list/use-block-props/use-selected-block-event-handlers.js +25 -4
  853. package/src/components/block-list/use-in-between-inserter.js +5 -2
  854. package/src/components/block-list/zoom-out-separator.js +32 -14
  855. package/src/components/block-navigation/dropdown.js +1 -2
  856. package/src/components/block-parent-selector/index.js +13 -10
  857. package/src/components/block-pattern-setup/setup-toolbar.js +5 -10
  858. package/src/components/block-patterns-paging/index.js +8 -7
  859. package/src/components/block-patterns-paging/style.scss +10 -27
  860. package/src/components/block-popover/index.js +64 -2
  861. package/src/components/block-preview/auto.js +1 -4
  862. package/src/components/block-quick-navigation/index.js +1 -2
  863. package/src/components/block-settings-menu/block-settings-dropdown.js +120 -106
  864. package/src/components/block-settings-menu-controls/index.js +0 -15
  865. package/src/components/block-switcher/index.js +37 -30
  866. package/src/components/block-toolbar/index.js +22 -34
  867. package/src/components/block-toolbar/style.scss +10 -1
  868. package/src/components/block-toolbar/use-has-block-toolbar.js +19 -31
  869. package/src/components/block-tools/index.js +7 -27
  870. package/src/components/block-tools/insertion-point.js +1 -4
  871. package/src/components/block-tools/style.scss +0 -90
  872. package/src/components/block-tools/use-show-block-tools.js +10 -13
  873. package/src/components/block-tools/zoom-out-mode-inserter-button.js +2 -17
  874. package/src/components/block-tools/zoom-out-mode-inserters.js +11 -19
  875. package/src/components/block-tools/zoom-out-popover.js +2 -1
  876. package/src/components/block-tools/zoom-out-toolbar.js +4 -36
  877. package/src/components/font-family/README.md +5 -1
  878. package/src/components/global-styles/border-panel.js +1 -1
  879. package/src/components/global-styles/dimensions-panel.js +1 -1
  880. package/src/components/iframe/content.scss +20 -24
  881. package/src/components/iframe/index.js +56 -12
  882. package/src/components/iframe/style.scss +6 -5
  883. package/src/components/inner-blocks/index.js +1 -16
  884. package/src/components/inner-blocks/use-nested-settings-update.js +16 -10
  885. package/src/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js +1 -1
  886. package/src/components/inserter/block-types-tab.js +1 -1
  887. package/src/components/inserter/category-tabs/index.js +1 -11
  888. package/src/components/inserter/hooks/use-block-types-state.js +34 -14
  889. package/src/components/inserter/hooks/use-insertion-point.js +35 -13
  890. package/src/components/inserter/hooks/use-patterns-state.js +46 -9
  891. package/src/components/inserter/media-tab/media-preview.js +38 -12
  892. package/src/components/inserter/menu.js +4 -4
  893. package/src/components/inserter/mobile-tab-navigation.js +10 -13
  894. package/src/components/inserter/quick-inserter.js +6 -5
  895. package/src/components/inserter/style.scss +1 -69
  896. package/src/components/inspector-controls-tabs/style.scss +2 -6
  897. package/src/components/link-control/index.js +0 -1
  898. package/src/components/link-control/search-input.js +4 -5
  899. package/src/components/link-control/search-results.js +2 -13
  900. package/src/components/link-control/test/index.js +84 -46
  901. package/src/components/list-view/block-contents.js +1 -28
  902. package/src/components/list-view/style.scss +0 -14
  903. package/src/components/media-replace-flow/test/index.js +1 -1
  904. package/src/components/responsive-block-control/style.scss +0 -1
  905. package/src/components/rich-text/style.scss +5 -0
  906. package/src/components/tool-selector/index.js +15 -7
  907. package/src/components/tool-selector/style.scss +5 -0
  908. package/src/components/use-block-commands/index.js +0 -58
  909. package/src/components/writing-flow/use-tab-nav.js +32 -40
  910. package/src/content.scss +0 -1
  911. package/src/hooks/duotone.js +4 -1
  912. package/src/hooks/layout-child.js +4 -1
  913. package/src/hooks/position.js +4 -1
  914. package/src/hooks/use-zoom-out.js +36 -20
  915. package/src/store/actions.js +17 -15
  916. package/src/store/private-actions.js +14 -0
  917. package/src/store/private-selectors.js +120 -16
  918. package/src/store/reducer.js +22 -45
  919. package/src/store/selectors.js +218 -118
  920. package/src/store/test/private-actions.js +15 -0
  921. package/src/store/test/private-selectors.js +41 -1
  922. package/src/store/test/reducer.js +40 -4
  923. package/src/store/test/selectors.js +195 -21
  924. package/src/store/utils.js +4 -2
  925. package/src/style.scss +1 -0
  926. package/src/utils/block-bindings.js +2 -0
  927. package/build/components/block-controls/use-has-block-controls.js +0 -43
  928. package/build/components/block-controls/use-has-block-controls.js.map +0 -1
  929. package/build/components/block-list/use-block-props/use-nav-mode-exit.js +0 -54
  930. package/build/components/block-list/use-block-props/use-nav-mode-exit.js.map +0 -1
  931. package/build/components/block-tools/block-selection-button.js +0 -259
  932. package/build/components/block-tools/block-selection-button.js.map +0 -1
  933. package/build/components/block-tools/block-toolbar-breadcrumb.js +0 -57
  934. package/build/components/block-tools/block-toolbar-breadcrumb.js.map +0 -1
  935. package/build/components/inserter/tabs.js +0 -78
  936. package/build/components/inserter/tabs.js.map +0 -1
  937. package/build-module/components/block-controls/use-has-block-controls.js +0 -34
  938. package/build-module/components/block-controls/use-has-block-controls.js.map +0 -1
  939. package/build-module/components/block-list/use-block-props/use-nav-mode-exit.js +0 -48
  940. package/build-module/components/block-list/use-block-props/use-nav-mode-exit.js.map +0 -1
  941. package/build-module/components/block-tools/block-selection-button.js +0 -254
  942. package/build-module/components/block-tools/block-selection-button.js.map +0 -1
  943. package/build-module/components/block-tools/block-toolbar-breadcrumb.js +0 -49
  944. package/build-module/components/block-tools/block-toolbar-breadcrumb.js.map +0 -1
  945. package/build-module/components/inserter/tabs.js +0 -72
  946. package/build-module/components/inserter/tabs.js.map +0 -1
  947. package/src/components/block-controls/use-has-block-controls.js +0 -35
  948. package/src/components/block-list/use-block-props/use-nav-mode-exit.js +0 -46
  949. package/src/components/block-tools/block-selection-button.js +0 -302
  950. package/src/components/block-tools/block-toolbar-breadcrumb.js +0 -51
  951. package/src/components/inner-blocks/content.scss +0 -13
  952. package/src/components/inserter/tabs.js +0 -78
  953. package/src/components/inserter/test/block-types-tab.native.js +0 -67
@@ -1 +1 @@
1
- {"version":3,"names":["useSelect","useDispatch","isTextField","Popover","__unstableUseShortcutEventMatch","useShortcutEventMatch","useRef","switchToBlockType","store","blocksStore","speak","__","EmptyBlockInserter","InsertionPointOpenRef","default","InsertionPoint","BlockToolbarPopover","BlockToolbarBreadcrumb","ZoomOutPopover","blockEditorStore","usePopoverScroll","ZoomOutModeInserters","useShowBlockTools","unlock","getEditorRegion","jsx","_jsx","jsxs","_jsxs","selector","select","getSelectedBlockClientId","getFirstMultiSelectedBlockClientId","getSettings","__unstableGetEditorMode","isTyping","clientId","editorMode","hasFixedToolbar","isZoomOutMode","BlockTools","children","__unstableContentRef","props","isMatch","getBlocksByClientId","getSelectedBlockClientIds","getBlockRootClientId","isGroupable","getGroupingBlockName","showEmptyBlockSideInserter","showBreadcrumb","showBlockToolbarPopover","showZoomOutToolbar","clearSelectedBlock","duplicateBlocks","removeBlocks","replaceBlocks","insertAfterBlock","insertBeforeBlock","selectBlock","moveBlocksUp","moveBlocksDown","expandBlock","blockSelectionButtonRef","onKeyDown","event","defaultPrevented","clientIds","length","preventDefault","rootClientId","target","closest","current","focus","contentWindow","document","activeElement","blocks","groupingBlockName","newBlocks","blockToolbarRef","blockToolbarAfterRef","Provider","value","ref","Slot","name"],"sources":["@wordpress/block-editor/src/components/block-tools/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { isTextField } from '@wordpress/dom';\nimport { Popover } from '@wordpress/components';\nimport { __unstableUseShortcutEventMatch as useShortcutEventMatch } from '@wordpress/keyboard-shortcuts';\nimport { useRef } from '@wordpress/element';\nimport { switchToBlockType, store as blocksStore } from '@wordpress/blocks';\nimport { speak } from '@wordpress/a11y';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport EmptyBlockInserter from './empty-block-inserter';\nimport {\n\tInsertionPointOpenRef,\n\tdefault as InsertionPoint,\n} from './insertion-point';\nimport BlockToolbarPopover from './block-toolbar-popover';\nimport BlockToolbarBreadcrumb from './block-toolbar-breadcrumb';\nimport ZoomOutPopover from './zoom-out-popover';\nimport { store as blockEditorStore } from '../../store';\nimport usePopoverScroll from '../block-popover/use-popover-scroll';\nimport ZoomOutModeInserters from './zoom-out-mode-inserters';\nimport { useShowBlockTools } from './use-show-block-tools';\nimport { unlock } from '../../lock-unlock';\nimport getEditorRegion from '../../utils/get-editor-region';\n\nfunction selector( select ) {\n\tconst {\n\t\tgetSelectedBlockClientId,\n\t\tgetFirstMultiSelectedBlockClientId,\n\t\tgetSettings,\n\t\t__unstableGetEditorMode,\n\t\tisTyping,\n\t} = select( blockEditorStore );\n\n\tconst clientId =\n\t\tgetSelectedBlockClientId() || getFirstMultiSelectedBlockClientId();\n\n\tconst editorMode = __unstableGetEditorMode();\n\n\treturn {\n\t\tclientId,\n\t\thasFixedToolbar: getSettings().hasFixedToolbar,\n\t\tisTyping: isTyping(),\n\t\tisZoomOutMode: editorMode === 'zoom-out',\n\t};\n}\n\n/**\n * Renders block tools (the block toolbar, select/navigation mode toolbar, the\n * insertion point and a slot for the inline rich text toolbar). Must be wrapped\n * around the block content and editor styles wrapper or iframe.\n *\n * @param {Object} $0 Props.\n * @param {Object} $0.children The block content and style container.\n * @param {Object} $0.__unstableContentRef Ref holding the content scroll container.\n */\nexport default function BlockTools( {\n\tchildren,\n\t__unstableContentRef,\n\t...props\n} ) {\n\tconst { clientId, hasFixedToolbar, isTyping, isZoomOutMode } = useSelect(\n\t\tselector,\n\t\t[]\n\t);\n\tconst isMatch = useShortcutEventMatch();\n\tconst {\n\t\tgetBlocksByClientId,\n\t\tgetSelectedBlockClientIds,\n\t\tgetBlockRootClientId,\n\t\tisGroupable,\n\t} = useSelect( blockEditorStore );\n\tconst { getGroupingBlockName } = useSelect( blocksStore );\n\tconst {\n\t\tshowEmptyBlockSideInserter,\n\t\tshowBreadcrumb,\n\t\tshowBlockToolbarPopover,\n\t\tshowZoomOutToolbar,\n\t} = useShowBlockTools();\n\n\tconst {\n\t\tclearSelectedBlock,\n\t\tduplicateBlocks,\n\t\tremoveBlocks,\n\t\treplaceBlocks,\n\t\tinsertAfterBlock,\n\t\tinsertBeforeBlock,\n\t\tselectBlock,\n\t\tmoveBlocksUp,\n\t\tmoveBlocksDown,\n\t\texpandBlock,\n\t} = unlock( useDispatch( blockEditorStore ) );\n\n\tconst blockSelectionButtonRef = useRef();\n\n\tfunction onKeyDown( event ) {\n\t\tif ( event.defaultPrevented ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( isMatch( 'core/block-editor/move-up', event ) ) {\n\t\t\tconst clientIds = getSelectedBlockClientIds();\n\t\t\tif ( clientIds.length ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tconst rootClientId = getBlockRootClientId( clientIds[ 0 ] );\n\t\t\t\tmoveBlocksUp( clientIds, rootClientId );\n\t\t\t}\n\t\t} else if ( isMatch( 'core/block-editor/move-down', event ) ) {\n\t\t\tconst clientIds = getSelectedBlockClientIds();\n\t\t\tif ( clientIds.length ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tconst rootClientId = getBlockRootClientId( clientIds[ 0 ] );\n\t\t\t\tmoveBlocksDown( clientIds, rootClientId );\n\t\t\t}\n\t\t} else if ( isMatch( 'core/block-editor/duplicate', event ) ) {\n\t\t\tconst clientIds = getSelectedBlockClientIds();\n\t\t\tif ( clientIds.length ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tduplicateBlocks( clientIds );\n\t\t\t}\n\t\t} else if ( isMatch( 'core/block-editor/remove', event ) ) {\n\t\t\tconst clientIds = getSelectedBlockClientIds();\n\t\t\tif ( clientIds.length ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tremoveBlocks( clientIds );\n\t\t\t}\n\t\t} else if ( isMatch( 'core/block-editor/insert-after', event ) ) {\n\t\t\tconst clientIds = getSelectedBlockClientIds();\n\t\t\tif ( clientIds.length ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tinsertAfterBlock( clientIds[ clientIds.length - 1 ] );\n\t\t\t}\n\t\t} else if ( isMatch( 'core/block-editor/insert-before', event ) ) {\n\t\t\tconst clientIds = getSelectedBlockClientIds();\n\t\t\tif ( clientIds.length ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tinsertBeforeBlock( clientIds[ 0 ] );\n\t\t\t}\n\t\t} else if ( isMatch( 'core/block-editor/unselect', event ) ) {\n\t\t\tif ( event.target.closest( '[role=toolbar]' ) ) {\n\t\t\t\t// This shouldn't be necessary, but we have a combination of a few things all combining to create a situation where:\n\t\t\t\t// - Because the block toolbar uses createPortal to populate the block toolbar fills, we can't rely on the React event bubbling to hit the onKeyDown listener for the block toolbar\n\t\t\t\t// - Since we can't use the React tree, we use the DOM tree which _should_ handle the event bubbling correctly from a `createPortal` element.\n\t\t\t\t// - This bubbles via the React tree, which hits this `unselect` escape keypress before the block toolbar DOM event listener has access to it.\n\t\t\t\t// An alternative would be to remove the addEventListener on the navigableToolbar and use this event to handle it directly right here. That feels hacky too though.\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst clientIds = getSelectedBlockClientIds();\n\t\t\tif ( clientIds.length > 1 ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\t// If there is more than one block selected, select the first\n\t\t\t\t// block so that focus is directed back to the beginning of the selection.\n\t\t\t\t// In effect, to the user this feels like deselecting the multi-selection.\n\t\t\t\tselectBlock( clientIds[ 0 ] );\n\t\t\t} else if (\n\t\t\t\tclientIds.length === 1 &&\n\t\t\t\tevent.target === blockSelectionButtonRef?.current\n\t\t\t) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tclearSelectedBlock();\n\t\t\t\tgetEditorRegion( __unstableContentRef.current )?.focus();\n\t\t\t}\n\t\t} else if ( isMatch( 'core/block-editor/collapse-list-view', event ) ) {\n\t\t\t// If focus is currently within a text field, such as a rich text block or other editable field,\n\t\t\t// skip collapsing the list view, and allow the keyboard shortcut to be handled by the text field.\n\t\t\t// This condition checks for both the active element and the active element within an iframed editor.\n\t\t\tif (\n\t\t\t\tisTextField( event.target ) ||\n\t\t\t\tisTextField(\n\t\t\t\t\tevent.target?.contentWindow?.document?.activeElement\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tevent.preventDefault();\n\t\t\texpandBlock( clientId );\n\t\t} else if ( isMatch( 'core/block-editor/group', event ) ) {\n\t\t\tconst clientIds = getSelectedBlockClientIds();\n\t\t\tif ( clientIds.length > 1 && isGroupable( clientIds ) ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tconst blocks = getBlocksByClientId( clientIds );\n\t\t\t\tconst groupingBlockName = getGroupingBlockName();\n\t\t\t\tconst newBlocks = switchToBlockType(\n\t\t\t\t\tblocks,\n\t\t\t\t\tgroupingBlockName\n\t\t\t\t);\n\t\t\t\treplaceBlocks( clientIds, newBlocks );\n\t\t\t\tspeak( __( 'Selected blocks are grouped.' ) );\n\t\t\t}\n\t\t}\n\t}\n\tconst blockToolbarRef = usePopoverScroll( __unstableContentRef );\n\tconst blockToolbarAfterRef = usePopoverScroll( __unstableContentRef );\n\n\treturn (\n\t\t// eslint-disable-next-line jsx-a11y/no-static-element-interactions\n\t\t<div { ...props } onKeyDown={ onKeyDown }>\n\t\t\t<InsertionPointOpenRef.Provider value={ useRef( false ) }>\n\t\t\t\t{ ! isTyping && ! isZoomOutMode && (\n\t\t\t\t\t<InsertionPoint\n\t\t\t\t\t\t__unstableContentRef={ __unstableContentRef }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\n\t\t\t\t{ showEmptyBlockSideInserter && (\n\t\t\t\t\t<EmptyBlockInserter\n\t\t\t\t\t\t__unstableContentRef={ __unstableContentRef }\n\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\n\t\t\t\t{ showBlockToolbarPopover && (\n\t\t\t\t\t<BlockToolbarPopover\n\t\t\t\t\t\t__unstableContentRef={ __unstableContentRef }\n\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\tisTyping={ isTyping }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\n\t\t\t\t{ showBreadcrumb && (\n\t\t\t\t\t<BlockToolbarBreadcrumb\n\t\t\t\t\t\tref={ blockSelectionButtonRef }\n\t\t\t\t\t\t__unstableContentRef={ __unstableContentRef }\n\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\n\t\t\t\t{ showZoomOutToolbar && (\n\t\t\t\t\t<ZoomOutPopover\n\t\t\t\t\t\t__unstableContentRef={ __unstableContentRef }\n\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\n\t\t\t\t{ /* Used for the inline rich text toolbar. Until this toolbar is combined into BlockToolbar, someone implementing their own BlockToolbar will also need to use this to see the image caption toolbar. */ }\n\t\t\t\t{ ! isZoomOutMode && ! hasFixedToolbar && (\n\t\t\t\t\t<Popover.Slot\n\t\t\t\t\t\tname=\"block-toolbar\"\n\t\t\t\t\t\tref={ blockToolbarRef }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t{ children }\n\t\t\t\t{ /* Used for inline rich text popovers. */ }\n\t\t\t\t<Popover.Slot\n\t\t\t\t\tname=\"__unstable-block-tools-after\"\n\t\t\t\t\tref={ blockToolbarAfterRef }\n\t\t\t\t/>\n\t\t\t\t{ isZoomOutMode && (\n\t\t\t\t\t<ZoomOutModeInserters\n\t\t\t\t\t\t__unstableContentRef={ __unstableContentRef }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</InsertionPointOpenR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AACT,sBAAsB;UACtBqE,GAAG,EAAGtB,uBAAyB;UAC/BtB,oBAAoB,EAAGA,oBAAsB;UAC7CN,QAAQ,EAAGA;QAAU,CACrB,CACD,EAECiB,kBAAkB,iBACnB3B,IAAA,CAACR,cAAc;UACdwB,oBAAoB,EAAGA,oBAAsB;UAC7CN,QAAQ,EAAGA;QAAU,CACrB,CACD,EAGC,CAAEG,aAAa,IAAI,CAAED,eAAe,iBACrCZ,IAAA,CAACvB,OAAO,CAACoF,IAAI;UACZC,IAAI,EAAC,eAAe;UACpBF,GAAG,EAAGJ;QAAiB,CACvB,CACD,EACCzC,QAAQ,eAEVf,IAAA,CAACvB,OAAO,CAACoF,IAAI;UACZC,IAAI,EAAC,8BAA8B;UACnCF,GAAG,EAAGH;QAAsB,CAC5B,CAAC,EACA5C,aAAa,iBACdb,IAAA,CAACL,oBAAoB;UACpBqB,oBAAoB,EAAGA;QAAsB,CAC7C,CACD;MAAA,CAC8B;IAAC,CAC7B;EAAC;AAER","ignoreList":[]}
1
+ {"version":3,"names":["useSelect","useDispatch","isTextField","Popover","__unstableUseShortcutEventMatch","useShortcutEventMatch","useRef","switchToBlockType","store","blocksStore","speak","__","EmptyBlockInserter","InsertionPointOpenRef","default","InsertionPoint","BlockToolbarPopover","ZoomOutPopover","blockEditorStore","usePopoverScroll","ZoomOutModeInserters","useShowBlockTools","unlock","jsx","_jsx","jsxs","_jsxs","selector","select","getSelectedBlockClientId","getFirstMultiSelectedBlockClientId","getSettings","__unstableGetEditorMode","isTyping","isDragging","clientId","editorMode","hasFixedToolbar","isZoomOutMode","BlockTools","children","__unstableContentRef","props","isMatch","getBlocksByClientId","getSelectedBlockClientIds","getBlockRootClientId","isGroupable","getGroupingBlockName","showEmptyBlockSideInserter","showBlockToolbarPopover","showZoomOutToolbar","duplicateBlocks","removeBlocks","replaceBlocks","insertAfterBlock","insertBeforeBlock","selectBlock","moveBlocksUp","moveBlocksDown","expandBlock","onKeyDown","event","defaultPrevented","clientIds","length","preventDefault","rootClientId","target","closest","contentWindow","document","activeElement","blocks","groupingBlockName","newBlocks","blockToolbarRef","blockToolbarAfterRef","Provider","value","Slot","name","ref"],"sources":["@wordpress/block-editor/src/components/block-tools/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { isTextField } from '@wordpress/dom';\nimport { Popover } from '@wordpress/components';\nimport { __unstableUseShortcutEventMatch as useShortcutEventMatch } from '@wordpress/keyboard-shortcuts';\nimport { useRef } from '@wordpress/element';\nimport { switchToBlockType, store as blocksStore } from '@wordpress/blocks';\nimport { speak } from '@wordpress/a11y';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport EmptyBlockInserter from './empty-block-inserter';\nimport {\n\tInsertionPointOpenRef,\n\tdefault as InsertionPoint,\n} from './insertion-point';\nimport BlockToolbarPopover from './block-toolbar-popover';\nimport ZoomOutPopover from './zoom-out-popover';\nimport { store as blockEditorStore } from '../../store';\nimport usePopoverScroll from '../block-popover/use-popover-scroll';\nimport ZoomOutModeInserters from './zoom-out-mode-inserters';\nimport { useShowBlockTools } from './use-show-block-tools';\nimport { unlock } from '../../lock-unlock';\n\nfunction selector( select ) {\n\tconst {\n\t\tgetSelectedBlockClientId,\n\t\tgetFirstMultiSelectedBlockClientId,\n\t\tgetSettings,\n\t\t__unstableGetEditorMode,\n\t\tisTyping,\n\t\tisDragging,\n\t} = unlock( select( blockEditorStore ) );\n\n\tconst clientId =\n\t\tgetSelectedBlockClientId() || getFirstMultiSelectedBlockClientId();\n\n\tconst editorMode = __unstableGetEditorMode();\n\n\treturn {\n\t\tclientId,\n\t\thasFixedToolbar: getSettings().hasFixedToolbar,\n\t\tisTyping: isTyping(),\n\t\tisZoomOutMode: editorMode === 'zoom-out',\n\t\tisDragging: isDragging(),\n\t};\n}\n\n/**\n * Renders block tools (the block toolbar, select/navigation mode toolbar, the\n * insertion point and a slot for the inline rich text toolbar). Must be wrapped\n * around the block content and editor styles wrapper or iframe.\n *\n * @param {Object} $0 Props.\n * @param {Object} $0.children The block content and style container.\n * @param {Object} $0.__unstableContentRef Ref holding the content scroll container.\n */\nexport default function BlockTools( {\n\tchildren,\n\t__unstableContentRef,\n\t...props\n} ) {\n\tconst { clientId, hasFixedToolbar, isTyping, isZoomOutMode, isDragging } =\n\t\tuseSelect( selector, [] );\n\n\tconst isMatch = useShortcutEventMatch();\n\tconst {\n\t\tgetBlocksByClientId,\n\t\tgetSelectedBlockClientIds,\n\t\tgetBlockRootClientId,\n\t\tisGroupable,\n\t} = useSelect( blockEditorStore );\n\tconst { getGroupingBlockName } = useSelect( blocksStore );\n\tconst {\n\t\tshowEmptyBlockSideInserter,\n\t\tshowBlockToolbarPopover,\n\t\tshowZoomOutToolbar,\n\t} = useShowBlockTools();\n\n\tconst {\n\t\tduplicateBlocks,\n\t\tremoveBlocks,\n\t\treplaceBlocks,\n\t\tinsertAfterBlock,\n\t\tinsertBeforeBlock,\n\t\tselectBlock,\n\t\tmoveBlocksUp,\n\t\tmoveBlocksDown,\n\t\texpandBlock,\n\t} = unlock( useDispatch( blockEditorStore ) );\n\n\tfunction onKeyDown( event ) {\n\t\tif ( event.defaultPrevented ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( isMatch( 'core/block-editor/move-up', event ) ) {\n\t\t\tconst clientIds = getSelectedBlockClientIds();\n\t\t\tif ( clientIds.length ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tconst rootClientId = getBlockRootClientId( clientIds[ 0 ] );\n\t\t\t\tmoveBlocksUp( clientIds, rootClientId );\n\t\t\t}\n\t\t} else if ( isMatch( 'core/block-editor/move-down', event ) ) {\n\t\t\tconst clientIds = getSelectedBlockClientIds();\n\t\t\tif ( clientIds.length ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tconst rootClientId = getBlockRootClientId( clientIds[ 0 ] );\n\t\t\t\tmoveBlocksDown( clientIds, rootClientId );\n\t\t\t}\n\t\t} else if ( isMatch( 'core/block-editor/duplicate', event ) ) {\n\t\t\tconst clientIds = getSelectedBlockClientIds();\n\t\t\tif ( clientIds.length ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tduplicateBlocks( clientIds );\n\t\t\t}\n\t\t} else if ( isMatch( 'core/block-editor/remove', event ) ) {\n\t\t\tconst clientIds = getSelectedBlockClientIds();\n\t\t\tif ( clientIds.length ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tremoveBlocks( clientIds );\n\t\t\t}\n\t\t} else if ( isMatch( 'core/block-editor/insert-after', event ) ) {\n\t\t\tconst clientIds = getSelectedBlockClientIds();\n\t\t\tif ( clientIds.length ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tinsertAfterBlock( clientIds[ clientIds.length - 1 ] );\n\t\t\t}\n\t\t} else if ( isMatch( 'core/block-editor/insert-before', event ) ) {\n\t\t\tconst clientIds = getSelectedBlockClientIds();\n\t\t\tif ( clientIds.length ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tinsertBeforeBlock( clientIds[ 0 ] );\n\t\t\t}\n\t\t} else if ( isMatch( 'core/block-editor/unselect', event ) ) {\n\t\t\tif ( event.target.closest( '[role=toolbar]' ) ) {\n\t\t\t\t// This shouldn't be necessary, but we have a combination of a few things all combining to create a situation where:\n\t\t\t\t// - Because the block toolbar uses createPortal to populate the block toolbar fills, we can't rely on the React event bubbling to hit the onKeyDown listener for the block toolbar\n\t\t\t\t// - Since we can't use the React tree, we use the DOM tree which _should_ handle the event bubbling correctly from a `createPortal` element.\n\t\t\t\t// - This bubbles via the React tree, which hits this `unselect` escape keypress before the block toolbar DOM event listener has access to it.\n\t\t\t\t// An alternative would be to remove the addEventListener on the navigableToolbar and use this event to handle it directly right here. That feels hacky too though.\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst clientIds = getSelectedBlockClientIds();\n\t\t\tif ( clientIds.length > 1 ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\t// If there is more than one block selected, select the first\n\t\t\t\t// block so that focus is directed back to the beginning of the selection.\n\t\t\t\t// In effect, to the user this feels like deselecting the multi-selection.\n\t\t\t\tselectBlock( clientIds[ 0 ] );\n\t\t\t}\n\t\t} else if ( isMatch( 'core/block-editor/collapse-list-view', event ) ) {\n\t\t\t// If focus is currently within a text field, such as a rich text block or other editable field,\n\t\t\t// skip collapsing the list view, and allow the keyboard shortcut to be handled by the text field.\n\t\t\t// This condition checks for both the active element and the active element within an iframed editor.\n\t\t\tif (\n\t\t\t\tisTextField( event.target ) ||\n\t\t\t\tisTextField(\n\t\t\t\t\tevent.target?.contentWindow?.document?.activeElement\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tevent.preventDefault();\n\t\t\texpandBlock( clientId );\n\t\t} else if ( isMatch( 'core/block-editor/group', event ) ) {\n\t\t\tconst clientIds = getSelectedBlockClientIds();\n\t\t\tif ( clientIds.length > 1 && isGroupable( clientIds ) ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tconst blocks = getBlocksByClientId( clientIds );\n\t\t\t\tconst groupingBlockName = getGroupingBlockName();\n\t\t\t\tconst newBlocks = switchToBlockType(\n\t\t\t\t\tblocks,\n\t\t\t\t\tgroupingBlockName\n\t\t\t\t);\n\t\t\t\treplaceBlocks( clientIds, newBlocks );\n\t\t\t\tspeak( __( 'Selected blocks are grouped.' ) );\n\t\t\t}\n\t\t}\n\t}\n\tconst blockToolbarRef = usePopoverScroll( __unstableContentRef );\n\tconst blockToolbarAfterRef = usePopoverScroll( __unstableContentRef );\n\n\treturn (\n\t\t// eslint-disable-next-line jsx-a11y/no-static-element-interactions\n\t\t<div { ...props } onKeyDown={ onKeyDown }>\n\t\t\t<InsertionPointOpenRef.Provider value={ useRef( false ) }>\n\t\t\t\t{ ! isTyping && ! isZoomOutMode && (\n\t\t\t\t\t<InsertionPoint\n\t\t\t\t\t\t__unstableContentRef={ __unstableContentRef }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\n\t\t\t\t{ showEmptyBlockSideInserter && (\n\t\t\t\t\t<EmptyBlockInserter\n\t\t\t\t\t\t__unstableContentRef={ __unstableContentRef }\n\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\n\t\t\t\t{ showBlockToolbarPopover && (\n\t\t\t\t\t<BlockToolbarPopover\n\t\t\t\t\t\t__unstableContentRef={ __unstableContentRef }\n\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\tisTyping={ isTyping }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\n\t\t\t\t{ showZoomOutToolbar && (\n\t\t\t\t\t<ZoomOutPopover\n\t\t\t\t\t\t__unstableContentRef={ __unstableContentRef }\n\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\n\t\t\t\t{ /* Used for the inline rich text toolbar. Until this toolbar is combined into BlockToolbar, someone implementing their own BlockToolbar will also need to use this to see the image caption toolbar. */ }\n\t\t\t\t{ ! isZoomOutMode && ! hasFixedToolbar && (\n\t\t\t\t\t<Popover.Slot\n\t\t\t\t\t\tname=\"block-toolbar\"\n\t\t\t\t\t\tref={ blockToolbarRef }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t{ children }\n\t\t\t\t{ /* Used for inline rich text popovers. */ }\n\t\t\t\t<Popover.Slot\n\t\t\t\t\tname=\"__unstable-block-tools-after\"\n\t\t\t\t\tref={ blockToolbarAfterRef }\n\t\t\t\t/>\n\t\t\t\t{ isZoomOutMode && ! isDragging && (\n\t\t\t\t\t<ZoomOutModeInserters\n\t\t\t\t\t\t__unstableContentRef={ __unstableContentRef }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</InsertionPointOpenRef.Provider>\n\t\t</div>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,WAAW,QAAQ,gBAAgB;AAC5C,SAASC,OAAO,QAAQ,uBAAuB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AAER","ignoreList":[]}
@@ -18,8 +18,7 @@ import Inserter from '../inserter';
18
18
  import { store as blockEditorStore } from '../../store';
19
19
  import BlockPopoverInbetween from '../block-popover/inbetween';
20
20
  import BlockDropZonePopover from '../block-popover/drop-zone';
21
- import { jsx as _jsx } from "react/jsx-runtime";
22
- import { jsxs as _jsxs } from "react/jsx-runtime";
21
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
23
22
  export const InsertionPointOpenRef = createContext();
24
23
  function InbetweenInsertionPointPopover({
25
24
  __unstablePopoverSlot,
@@ -40,7 +39,6 @@ function InbetweenInsertionPointPopover({
40
39
  rootClientId,
41
40
  isInserterShown,
42
41
  isDistractionFree,
43
- isNavigationMode,
44
42
  isZoomOutMode
45
43
  } = useSelect(select => {
46
44
  const {
@@ -51,7 +49,6 @@ function InbetweenInsertionPointPopover({
51
49
  getPreviousBlockClientId,
52
50
  getNextBlockClientId,
53
51
  getSettings,
54
- isNavigationMode: _isNavigationMode,
55
52
  __unstableGetEditorMode
56
53
  } = select(blockEditorStore);
57
54
  const insertionPoint = getBlockInsertionPoint();
@@ -73,7 +70,6 @@ function InbetweenInsertionPointPopover({
73
70
  nextClientId: _nextClientId,
74
71
  orientation: getBlockListSettings(insertionPoint.rootClientId)?.orientation || 'vertical',
75
72
  rootClientId: insertionPoint.rootClientId,
76
- isNavigationMode: _isNavigationMode(),
77
73
  isDistractionFree: settings.isDistractionFree,
78
74
  isInserterShown: insertionPoint?.__unstableWithInserter,
79
75
  isZoomOutMode: __unstableGetEditorMode() === 'zoom-out'
@@ -139,7 +135,7 @@ function InbetweenInsertionPointPopover({
139
135
  }
140
136
  }
141
137
  };
142
- if (isDistractionFree && !isNavigationMode) {
138
+ if (isDistractionFree) {
143
139
  return null;
144
140
  }
145
141
 
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","useSelect","useDispatch","useRef","createContext","useContext","__unstableMotion","motion","useReducedMotion","Inserter","store","blockEditorStore","BlockPopoverInbetween","BlockDropZonePopover","jsx","_jsx","jsxs","_jsxs","InsertionPointOpenRef","InbetweenInsertionPointPopover","__unstablePopoverSlot","__unstableContentRef","operation","nearestSide","selectBlock","hideInsertionPoint","openRef","ref","orientation","previousClientId","nextClientId","rootClientId","isInserterShown","isDistractionFree","isNavigationMode","isZoomOutMode","select","getBlockOrder","getBlockListSettings","getBlockInsertionPoint","isBlockBeingDragged","getPreviousBlockClientId","getNextBlockClientId","getSettings","_isNavigationMode","__unstableGetEditorMode","insertionPoint","order","length","_previousClientId","index","_nextClientId","settings","__unstableWithInserter","getBlockEditingMode","disableMotion","onClick","event","target","current","maybeHideInserterPoint","onFocus","lineVariants","start","opacity","scale","rest","transition","delay","type","hover","inserterVariants","orientationClassname","className","children","div","layout","initial","animate","whileHover","whileTap","exit","tabIndex","onHoverEnd","variants","position","clientId","__experimentalIsQuick","onToggle","isOpen","onSelectOrClose","InsertionPoint","props","isVisible","isBlockListEmpty","isBlockInsertionPointVisible","getBlockCount","blockInsertionPoint"],"sources":["@wordpress/block-editor/src/components/block-tools/insertion-point.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useRef, createContext, useContext } from '@wordpress/element';\nimport { __unstableMotion as motion } from '@wordpress/components';\nimport { useReducedMotion } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport Inserter from '../inserter';\nimport { store as blockEditorStore } from '../../store';\nimport BlockPopoverInbetween from '../block-popover/inbetween';\nimport BlockDropZonePopover from '../block-popover/drop-zone';\n\nexport const InsertionPointOpenRef = createContext();\n\nfunction InbetweenInsertionPointPopover( {\n\t__unstablePopoverSlot,\n\t__unstableContentRef,\n\toperation = 'insert',\n\tnearestSide = 'right',\n} ) {\n\tconst { selectBlock, hideInsertionPoint } = useDispatch( blockEditorStore );\n\tconst openRef = useContext( InsertionPointOpenRef );\n\tconst ref = useRef();\n\tconst {\n\t\torientation,\n\t\tpreviousClientId,\n\t\tnextClientId,\n\t\trootClientId,\n\t\tisInserterShown,\n\t\tisDistractionFree,\n\t\tisNavigationMode,\n\t\tisZoomOutMode,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetBlockOrder,\n\t\t\tgetBlockListSettings,\n\t\t\tgetBlockInsertionPoint,\n\t\t\tisBlockBeingDragged,\n\t\t\tgetPreviousBlockClientId,\n\t\t\tgetNextBlockClientId,\n\t\t\tgetSettings,\n\t\t\tisNavigationMode: _isNavigationMode,\n\t\t\t__unstableGetEditorMode,\n\t\t} = select( blockEditorStore );\n\t\tconst insertionPoint = getBlockInsertionPoint();\n\t\tconst order = getBlockOrder( insertionPoint.rootClientId );\n\n\t\tif ( ! order.length ) {\n\t\t\treturn {};\n\t\t}\n\n\t\tlet _previousClientId = order[ insertionPoint.index - 1 ];\n\t\tlet _nextClientId = order[ insertionPoint.index ];\n\n\t\twhile ( isBlockBeingDragged( _previousClientId ) ) {\n\t\t\t_previousClientId = getPreviousBlockClientId( _previousClientId );\n\t\t}\n\n\t\twhile ( isBlockBeingDragged( _nextClientId ) ) {\n\t\t\t_nextClientId = getNextBlockClientId( _nextClientId );\n\t\t}\n\n\t\tconst settings = getSettings();\n\n\t\treturn {\n\t\t\tpreviousClientId: _previousClientId,\n\t\t\tnextClientId: _nextClientId,\n\t\t\torientation:\n\t\t\t\tgetBlockListSettings( insertionPoint.rootClientId )\n\t\t\t\t\t?.orientation || 'vertical',\n\t\t\trootClientId: insertionPoint.rootClientId,\n\t\t\tisNavigationMode: _isNavigationMode(),\n\t\t\tisDistractionFree: settings.isDistractionFree,\n\t\t\tisInserterShown: insertionPoint?.__unstableWithInserter,\n\t\t\tisZoomOutMode: __unstableGetEditorMode() === 'zoom-out',\n\t\t};\n\t}, [] );\n\tconst { getBlockEditingMode } = useSelect( blockEditorStore );\n\n\tconst disableMotion = useReducedMotion();\n\n\tfunction onClick( event ) {\n\t\tif (\n\t\t\tevent.target === ref.current &&\n\t\t\tnextClientId &&\n\t\t\tgetBlockEditingMode( nextClientId ) !== 'disabled'\n\t\t) {\n\t\t\tselectBlock( nextClientId, -1 );\n\t\t}\n\t}\n\n\tfunction maybeHideInserterPoint( event ) {\n\t\t// Only hide the inserter if it's triggered on the wrapper,\n\t\t// and the inserter is not open.\n\t\tif ( event.target === ref.current && ! openRef.current ) {\n\t\t\thideInsertionPoint();\n\t\t}\n\t}\n\n\tfunction onFocus( event ) {\n\t\t// Only handle click on the wrapper specifically, and not an event\n\t\t// bubbled from the inserter itself.\n\t\tif ( event.target !== ref.current ) {\n\t\t\topenRef.current = true;\n\t\t}\n\t}\n\n\tconst lineVariants = {\n\t\t// Initial position starts from the center and invisible.\n\t\tstart: {\n\t\t\topacity: 0,\n\t\t\tscale: 0,\n\t\t},\n\t\t// The line expands to fill the container. If the inserter is visible it\n\t\t// is delayed so it appears orchestrated.\n\t\trest: {\n\t\t\topacity: 1,\n\t\t\tscale: 1,\n\t\t\ttransition: { delay: isInserterShown ? 0.5 : 0, type: 'tween' },\n\t\t},\n\t\thover: {\n\t\t\topacity: 1,\n\t\t\tscale: 1,\n\t\t\ttransition: { delay: 0.5, type: 'tween' },\n\t\t},\n\t};\n\n\tconst inserterVariants = {\n\t\tstart: {\n\t\t\tscale: disableMotion ? 1 : 0,\n\t\t},\n\t\trest: {\n\t\t\tscale: 1,\n\t\t\ttransition: { delay: 0.4, type: 'tween' },\n\t\t},\n\t};\n\n\tif ( isDistractionFree && ! isNavigationMode ) {\n\t\treturn null;\n\t}\n\n\t// Zoom out mode should only show the insertion point for the insert operation.\n\t// Other operations such as \"group\" are when the editor tries to create a row\n\t// block by grouping the block being dragged with the block it's being dropped\n\t// onto.\n\tif ( isZoomOutMode && operation !== 'insert' ) {\n\t\treturn null;\n\t}\n\n\tconst orientationClassname =\n\t\torientation === 'horizontal' || operation === 'group'\n\t\t\t? 'is-horizontal'\n\t\t\t: 'is-vertical';\n\n\tconst className = clsx(\n\t\t'block-editor-block-list__insertion-point',\n\t\torientationClassname\n\t);\n\n\treturn (\n\t\t<BlockPopoverInbetween\n\t\t\tpreviousClientId={ previousClientId }\n\t\t\tnextClientId={ nextClientId }\n\t\t\t__unstablePopoverSlot={ __unstablePopoverSlot }\n\t\t\t__unstableContentRef={ __unstableContentRef }\n\t\t\toperation={ operation }\n\t\t\tnearestSide={ nearestSide }\n\t\t>\n\t\t\t<motion.div\n\t\t\t\tlayout={ ! disableMotion }\n\t\t\t\tinitial={ disableMotion ? 'rest' : 'start' }\n\t\t\t\tanimate=\"rest\"\n\t\t\t\twhileHover=\"hover\"\n\t\t\t\twhileTap=\"pressed\"\n\t\t\t\texit=\"start\"\n\t\t\t\tref={ ref }\n\t\t\t\ttabIndex={ -1 }\n\t\t\t\tonClick={ onClick }\n\t\t\t\tonFocus={ onFocus }\n\t\t\t\tclassName={ clsx( className, {\n\t\t\t\t\t'is-with-inserter': isInserterShown,\n\t\t\t\t} ) }\n\t\t\t\tonHoverEnd={ maybeHideInserterPoint }\n\t\t\t>\n\t\t\t\t<motion.div\n\t\t\t\t\tvariants={ lineVariants }\n\t\t\t\t\tclassName=\"block-editor-block-list__insertion-point-indicator\"\n\t\t\t\t\tdata-testid=\"block-list-insertion-point-indicator\"\n\t\t\t\t/>\n\t\t\t\t{ isInserterShown && (\n\t\t\t\t\t<motion.div\n\t\t\t\t\t\tvariants={ inserterVariants }\n\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t'block-editor-block-list__insertion-point-inserter'\n\t\t\t\t\t\t) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<Inserter\n\t\t\t\t\t\t\tposition=\"bottom center\"\n\t\t\t\t\t\t\tclientId={ nextClientId }\n\t\t\t\t\t\t\trootClientId={ rootClientId }\n\t\t\t\t\t\t\t__experimentalIsQuick\n\t\t\t\t\t\t\tonToggle={ ( isOpen ) => {\n\t\t\t\t\t\t\t\topenRef.current = isOpen;\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tonSelectOrClose={ () => {\n\t\t\t\t\t\t\t\topenRef.current = false;\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</motion.div>\n\t\t\t\t) }\n\t\t\t</motion.div>\n\t\t</BlockPopoverInbetween>\n\t);\n}\n\nexport default function InsertionPoint( props ) {\n\tconst { insertionPoint, isVisible, isBlockListEmpty } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockInsertionPoint,\n\t\t\t\tisBlockInsertionPointVisible,\n\t\t\t\tgetBlockCount,\n\t\t\t} = select( blockEditorStore );\n\t\t\tconst blockInsertionPoint = getBlockInsertionPoint();\n\t\t\treturn {\n\t\t\t\tinsertionPoint: blockInsertionPoint,\n\t\t\t\tisVisible: isBlockInsertionPointVisible(),\n\t\t\t\tisBlockListEmpty:\n\t\t\t\t\tgetBlockCount( blockInsertionPoint?.rootClientId ) === 0,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tif (\n\t\t! isVisible ||\n\t\t// Don't render the insertion point if the block list is empty.\n\t\t// The insertion point will be represented by the appender instead.\n\t\tisBlockListEmpty\n\t) {\n\t\treturn null;\n\t}\n\n\t/**\n\t * Render a popover that overlays the block when the desired operation is to replace it.\n\t * Otherwise, render a popover in between blocks for the indication of inserting between them.\n\t */\n\treturn insertionPoint.operation === 'replace' ? (\n\t\t<BlockDropZonePopover\n\t\t\t// Force remount to trigger the animation.\n\t\t\tkey={ `${ insertionPoint.rootClientId }-${ insertionPoint.index }` }\n\t\t\t{ ...props }\n\t\t/>\n\t) : (\n\t\t<InbetweenInsertionPointPopover\n\t\t\toperation={ insertionPoint.operation }\n\t\t\tnearestSide={ insertionPoint.nearestSide }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,MAAM,EAAEC,aAA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xB/D,OAAO,CAACiC,OAAO,GAAG8B,MAAM;UACzB,CAAG;UACHC,eAAe,EAAGA,CAAA,KAAM;YACvBhE,OAAO,CAACiC,OAAO,GAAG,KAAK;UACxB;QAAG,CACH;MAAC,CACS,CACZ;IAAA,CACU;EAAC,CACS,CAAC;AAE1B;AAEA,eAAe,SAASgC,cAAcA,CAAEC,KAAK,EAAG;EAC/C,MAAM;IAAE9C,cAAc;IAAE+C,SAAS;IAAEC;EAAiB,CAAC,GAAG7F,SAAS,CAC9DmC,MAAM,IAAM;IACb,MAAM;MACLG,sBAAsB;MACtBwD,4BAA4B;MAC5BC;IACD,CAAC,GAAG5D,MAAM,CAAEzB,gBAAiB,CAAC;IAC9B,MAAMsF,mBAAmB,GAAG1D,sBAAsB,CAAC,CAAC;IACpD,OAAO;MACNO,cAAc,EAAEmD,mBAAmB;MACnCJ,SAAS,EAAEE,4BAA4B,CAAC,CAAC;MACzCD,gBAAgB,EACfE,aAAa,CAAEC,mBAAmB,EAAElE,YAAa,CAAC,KAAK;IACzD,CAAC;EACF,CAAC,EACD,EACD,CAAC;EAED,IACC,CAAE8D,SAAS;EACX;EACA;EACAC,gBAAgB,EACf;IACD,OAAO,IAAI;EACZ;;EAEA;AACD;AACA;AACA;EACC,OAAOhD,cAAc,CAACxB,SAAS,KAAK,SAAS,gBAC5CP,IAAA,CAACF;EACA;EAAA;IAAA,GAEK+E;EAAK,GADH,GAAG9C,cAAc,CAACf,YAAc,IAAIe,cAAc,CAACI,KAAO,EAEjE,CAAC,gBAEFnC,IAAA,CAACI,8BAA8B;IAC9BG,SAAS,EAAGwB,cAAc,CAACxB,SAAW;IACtCC,WAAW,EAAGuB,cAAc,CAACvB,WAAa;IAAA,GACrCqE;EAAK,CACV,CACD;AACF","ignoreList":[]}
1
+ {"version":3,"names":["clsx","useSelect","useDispatch","useRef","createContext","useContext","__unstableMotion","motion","useReducedMotion","Inserter","store","blockEditorStore","BlockPopoverInbetween","BlockDropZonePopover","jsx","_jsx","jsxs","_jsxs","InsertionPointOpenRef","InbetweenInsertionPointPopover","__unstablePopoverSlot","__unstableContentRef","operation","nearestSide","selectBlock","hideInsertionPoint","openRef","ref","orientation","previousClientId","nextClientId","rootClientId","isInserterShown","isDistractionFree","isZoomOutMode","select","getBlockOrder","getBlockListSettings","getBlockInsertionPoint","isBlockBeingDragged","getPreviousBlockClientId","getNextBlockClientId","getSettings","__unstableGetEditorMode","insertionPoint","order","length","_previousClientId","index","_nextClientId","settings","__unstableWithInserter","getBlockEditingMode","disableMotion","onClick","event","target","current","maybeHideInserterPoint","onFocus","lineVariants","start","opacity","scale","rest","transition","delay","type","hover","inserterVariants","orientationClassname","className","children","div","layout","initial","animate","whileHover","whileTap","exit","tabIndex","onHoverEnd","variants","position","clientId","__experimentalIsQuick","onToggle","isOpen","onSelectOrClose","InsertionPoint","props","isVisible","isBlockListEmpty","isBlockInsertionPointVisible","getBlockCount","blockInsertionPoint"],"sources":["@wordpress/block-editor/src/components/block-tools/insertion-point.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useRef, createContext, useContext } from '@wordpress/element';\nimport { __unstableMotion as motion } from '@wordpress/components';\nimport { useReducedMotion } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport Inserter from '../inserter';\nimport { store as blockEditorStore } from '../../store';\nimport BlockPopoverInbetween from '../block-popover/inbetween';\nimport BlockDropZonePopover from '../block-popover/drop-zone';\n\nexport const InsertionPointOpenRef = createContext();\n\nfunction InbetweenInsertionPointPopover( {\n\t__unstablePopoverSlot,\n\t__unstableContentRef,\n\toperation = 'insert',\n\tnearestSide = 'right',\n} ) {\n\tconst { selectBlock, hideInsertionPoint } = useDispatch( blockEditorStore );\n\tconst openRef = useContext( InsertionPointOpenRef );\n\tconst ref = useRef();\n\tconst {\n\t\torientation,\n\t\tpreviousClientId,\n\t\tnextClientId,\n\t\trootClientId,\n\t\tisInserterShown,\n\t\tisDistractionFree,\n\t\tisZoomOutMode,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetBlockOrder,\n\t\t\tgetBlockListSettings,\n\t\t\tgetBlockInsertionPoint,\n\t\t\tisBlockBeingDragged,\n\t\t\tgetPreviousBlockClientId,\n\t\t\tgetNextBlockClientId,\n\t\t\tgetSettings,\n\t\t\t__unstableGetEditorMode,\n\t\t} = select( blockEditorStore );\n\t\tconst insertionPoint = getBlockInsertionPoint();\n\t\tconst order = getBlockOrder( insertionPoint.rootClientId );\n\n\t\tif ( ! order.length ) {\n\t\t\treturn {};\n\t\t}\n\n\t\tlet _previousClientId = order[ insertionPoint.index - 1 ];\n\t\tlet _nextClientId = order[ insertionPoint.index ];\n\n\t\twhile ( isBlockBeingDragged( _previousClientId ) ) {\n\t\t\t_previousClientId = getPreviousBlockClientId( _previousClientId );\n\t\t}\n\n\t\twhile ( isBlockBeingDragged( _nextClientId ) ) {\n\t\t\t_nextClientId = getNextBlockClientId( _nextClientId );\n\t\t}\n\n\t\tconst settings = getSettings();\n\n\t\treturn {\n\t\t\tpreviousClientId: _previousClientId,\n\t\t\tnextClientId: _nextClientId,\n\t\t\torientation:\n\t\t\t\tgetBlockListSettings( insertionPoint.rootClientId )\n\t\t\t\t\t?.orientation || 'vertical',\n\t\t\trootClientId: insertionPoint.rootClientId,\n\t\t\tisDistractionFree: settings.isDistractionFree,\n\t\t\tisInserterShown: insertionPoint?.__unstableWithInserter,\n\t\t\tisZoomOutMode: __unstableGetEditorMode() === 'zoom-out',\n\t\t};\n\t}, [] );\n\tconst { getBlockEditingMode } = useSelect( blockEditorStore );\n\n\tconst disableMotion = useReducedMotion();\n\n\tfunction onClick( event ) {\n\t\tif (\n\t\t\tevent.target === ref.current &&\n\t\t\tnextClientId &&\n\t\t\tgetBlockEditingMode( nextClientId ) !== 'disabled'\n\t\t) {\n\t\t\tselectBlock( nextClientId, -1 );\n\t\t}\n\t}\n\n\tfunction maybeHideInserterPoint( event ) {\n\t\t// Only hide the inserter if it's triggered on the wrapper,\n\t\t// and the inserter is not open.\n\t\tif ( event.target === ref.current && ! openRef.current ) {\n\t\t\thideInsertionPoint();\n\t\t}\n\t}\n\n\tfunction onFocus( event ) {\n\t\t// Only handle click on the wrapper specifically, and not an event\n\t\t// bubbled from the inserter itself.\n\t\tif ( event.target !== ref.current ) {\n\t\t\topenRef.current = true;\n\t\t}\n\t}\n\n\tconst lineVariants = {\n\t\t// Initial position starts from the center and invisible.\n\t\tstart: {\n\t\t\topacity: 0,\n\t\t\tscale: 0,\n\t\t},\n\t\t// The line expands to fill the container. If the inserter is visible it\n\t\t// is delayed so it appears orchestrated.\n\t\trest: {\n\t\t\topacity: 1,\n\t\t\tscale: 1,\n\t\t\ttransition: { delay: isInserterShown ? 0.5 : 0, type: 'tween' },\n\t\t},\n\t\thover: {\n\t\t\topacity: 1,\n\t\t\tscale: 1,\n\t\t\ttransition: { delay: 0.5, type: 'tween' },\n\t\t},\n\t};\n\n\tconst inserterVariants = {\n\t\tstart: {\n\t\t\tscale: disableMotion ? 1 : 0,\n\t\t},\n\t\trest: {\n\t\t\tscale: 1,\n\t\t\ttransition: { delay: 0.4, type: 'tween' },\n\t\t},\n\t};\n\n\tif ( isDistractionFree ) {\n\t\treturn null;\n\t}\n\n\t// Zoom out mode should only show the insertion point for the insert operation.\n\t// Other operations such as \"group\" are when the editor tries to create a row\n\t// block by grouping the block being dragged with the block it's being dropped\n\t// onto.\n\tif ( isZoomOutMode && operation !== 'insert' ) {\n\t\treturn null;\n\t}\n\n\tconst orientationClassname =\n\t\torientation === 'horizontal' || operation === 'group'\n\t\t\t? 'is-horizontal'\n\t\t\t: 'is-vertical';\n\n\tconst className = clsx(\n\t\t'block-editor-block-list__insertion-point',\n\t\torientationClassname\n\t);\n\n\treturn (\n\t\t<BlockPopoverInbetween\n\t\t\tpreviousClientId={ previousClientId }\n\t\t\tnextClientId={ nextClientId }\n\t\t\t__unstablePopoverSlot={ __unstablePopoverSlot }\n\t\t\t__unstableContentRef={ __unstableContentRef }\n\t\t\toperation={ operation }\n\t\t\tnearestSide={ nearestSide }\n\t\t>\n\t\t\t<motion.div\n\t\t\t\tlayout={ ! disableMotion }\n\t\t\t\tinitial={ disableMotion ? 'rest' : 'start' }\n\t\t\t\tanimate=\"rest\"\n\t\t\t\twhileHover=\"hover\"\n\t\t\t\twhileTap=\"pressed\"\n\t\t\t\texit=\"start\"\n\t\t\t\tref={ ref }\n\t\t\t\ttabIndex={ -1 }\n\t\t\t\tonClick={ onClick }\n\t\t\t\tonFocus={ onFocus }\n\t\t\t\tclassName={ clsx( className, {\n\t\t\t\t\t'is-with-inserter': isInserterShown,\n\t\t\t\t} ) }\n\t\t\t\tonHoverEnd={ maybeHideInserterPoint }\n\t\t\t>\n\t\t\t\t<motion.div\n\t\t\t\t\tvariants={ lineVariants }\n\t\t\t\t\tclassName=\"block-editor-block-list__insertion-point-indicator\"\n\t\t\t\t\tdata-testid=\"block-list-insertion-point-indicator\"\n\t\t\t\t/>\n\t\t\t\t{ isInserterShown && (\n\t\t\t\t\t<motion.div\n\t\t\t\t\t\tvariants={ inserterVariants }\n\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t'block-editor-block-list__insertion-point-inserter'\n\t\t\t\t\t\t) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<Inserter\n\t\t\t\t\t\t\tposition=\"bottom center\"\n\t\t\t\t\t\t\tclientId={ nextClientId }\n\t\t\t\t\t\t\trootClientId={ rootClientId }\n\t\t\t\t\t\t\t__experimentalIsQuick\n\t\t\t\t\t\t\tonToggle={ ( isOpen ) => {\n\t\t\t\t\t\t\t\topenRef.current = isOpen;\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tonSelectOrClose={ () => {\n\t\t\t\t\t\t\t\topenRef.current = false;\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</motion.div>\n\t\t\t\t) }\n\t\t\t</motion.div>\n\t\t</BlockPopoverInbetween>\n\t);\n}\n\nexport default function InsertionPoint( props ) {\n\tconst { insertionPoint, isVisible, isBlockListEmpty } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockInsertionPoint,\n\t\t\t\tisBlockInsertionPointVisible,\n\t\t\t\tgetBlockCount,\n\t\t\t} = select( blockEditorStore );\n\t\t\tconst blockInsertionPoint = getBlockInsertionPoint();\n\t\t\treturn {\n\t\t\t\tinsertionPoint: blockInsertionPoint,\n\t\t\t\tisVisible: isBlockInsertionPointVisible(),\n\t\t\t\tisBlockListEmpty:\n\t\t\t\t\tgetBlockCount( blockInsertionPoint?.rootClientId ) === 0,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tif (\n\t\t! isVisible ||\n\t\t// Don't render the insertion point if the block list is empty.\n\t\t// The insertion point will be represented by the appender instead.\n\t\tisBlockListEmpty\n\t) {\n\t\treturn null;\n\t}\n\n\t/**\n\t * Render a popover that overlays the block when the desired operation is to replace it.\n\t * Otherwise, render a popover in between blocks for the indication of inserting between them.\n\t */\n\treturn insertionPoint.operation === 'replace' ? (\n\t\t<BlockDropZonePopover\n\t\t\t// Force remount to trigger the animation.\n\t\t\tkey={ `${ insertionPoint.rootClientId }-${ insertionPoint.index }` }\n\t\t\t{ ...props }\n\t\t/>\n\t) : (\n\t\t<InbetweenInsertionPointPopover\n\t\t\toperation={ insertionPoint.operation }\n\t\t\tnearestSide={ insertionPoint.nearestSide }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,MAAM,EAAEC,aAAa,EAAEC,UAAU,QAAQ,oBAAoB;AACtE,SAASC,gBAAgB,IAAIC,MAAM,QAAQ,uBAAuB;AAClE,SAASC,gBAAgB,QAAQ,oBAAoB;;AAErD;AACA;A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EAC/C,MAAM;IAAE9C,cAAc;IAAE+C,SAAS;IAAEC;EAAiB,CAAC,GAAG3F,SAAS,CAC9DkC,MAAM,IAAM;IACb,MAAM;MACLG,sBAAsB;MACtBuD,4BAA4B;MAC5BC;IACD,CAAC,GAAG3D,MAAM,CAAExB,gBAAiB,CAAC;IAC9B,MAAMoF,mBAAmB,GAAGzD,sBAAsB,CAAC,CAAC;IACpD,OAAO;MACNM,cAAc,EAAEmD,mBAAmB;MACnCJ,SAAS,EAAEE,4BAA4B,CAAC,CAAC;MACzCD,gBAAgB,EACfE,aAAa,CAAEC,mBAAmB,EAAEhE,YAAa,CAAC,KAAK;IACzD,CAAC;EACF,CAAC,EACD,EACD,CAAC;EAED,IACC,CAAE4D,SAAS;EACX;EACA;EACAC,gBAAgB,EACf;IACD,OAAO,IAAI;EACZ;;EAEA;AACD;AACA;AACA;EACC,OAAOhD,cAAc,CAACtB,SAAS,KAAK,SAAS,gBAC5CP,IAAA,CAACF;EACA;EAAA;IAAA,GAEK6E;EAAK,GADJ,GAAI9C,cAAc,CAACb,YAAY,IAAMa,cAAc,CAACI,KAAK,EAE/D,CAAC,gBAEFjC,IAAA,CAACI,8BAA8B;IAC9BG,SAAS,EAAGsB,cAAc,CAACtB,SAAW;IACtCC,WAAW,EAAGqB,cAAc,CAACrB,WAAa;IAAA,GACrCmE;EAAK,CACV,CACD;AACF","ignoreList":[]}
@@ -8,6 +8,7 @@ import { isUnmodifiedDefaultBlock } from '@wordpress/blocks';
8
8
  * Internal dependencies
9
9
  */
10
10
  import { store as blockEditorStore } from '../../store';
11
+ import { unlock } from '../../lock-unlock';
11
12
 
12
13
  /**
13
14
  * Source of truth for which block tools are showing in the block editor.
@@ -22,23 +23,23 @@ export function useShowBlockTools() {
22
23
  getBlock,
23
24
  getBlockMode,
24
25
  getSettings,
25
- hasMultiSelection,
26
26
  __unstableGetEditorMode,
27
- isTyping
28
- } = select(blockEditorStore);
27
+ isTyping,
28
+ getBlockOrder,
29
+ getSectionRootClientId
30
+ } = unlock(select(blockEditorStore));
29
31
  const clientId = getSelectedBlockClientId() || getFirstMultiSelectedBlockClientId();
30
32
  const block = getBlock(clientId);
31
33
  const editorMode = __unstableGetEditorMode();
32
34
  const hasSelectedBlock = !!clientId && !!block;
33
35
  const isEmptyDefaultBlock = hasSelectedBlock && isUnmodifiedDefaultBlock(block) && getBlockMode(clientId) !== 'html';
34
36
  const _showEmptyBlockSideInserter = clientId && !isTyping() && editorMode === 'edit' && isEmptyDefaultBlock;
35
- const maybeShowBreadcrumb = hasSelectedBlock && !hasMultiSelection() && editorMode === 'navigation';
36
37
  const isZoomOut = editorMode === 'zoom-out';
37
- const _showZoomOutToolbar = isZoomOut && block?.attributes?.align === 'full' && !_showEmptyBlockSideInserter && !maybeShowBreadcrumb;
38
- const _showBlockToolbarPopover = !_showZoomOutToolbar && !getSettings().hasFixedToolbar && !_showEmptyBlockSideInserter && hasSelectedBlock && !isEmptyDefaultBlock && !maybeShowBreadcrumb;
38
+ const isSectionSelected = getBlockOrder(getSectionRootClientId()).includes(clientId);
39
+ const _showZoomOutToolbar = clientId && isZoomOut && !_showEmptyBlockSideInserter && isSectionSelected;
40
+ const _showBlockToolbarPopover = !_showZoomOutToolbar && !getSettings().hasFixedToolbar && !_showEmptyBlockSideInserter && hasSelectedBlock && !isEmptyDefaultBlock;
39
41
  return {
40
42
  showEmptyBlockSideInserter: _showEmptyBlockSideInserter,
41
- showBreadcrumb: !_showEmptyBlockSideInserter && maybeShowBreadcrumb,
42
43
  showBlockToolbarPopover: _showBlockToolbarPopover,
43
44
  showZoomOutToolbar: _showZoomOutToolbar
44
45
  };
@@ -1 +1 @@
1
- {"version":3,"names":["useSelect","isUnmodifiedDefaultBlock","store","blockEditorStore","useShowBlockTools","select","getSelectedBlockClientId","getFirstMultiSelectedBlockClientId","getBlock","getBlockMode","getSettings","hasMultiSelection","__unstableGetEditorMode","isTyping","clientId","block","editorMode","hasSelectedBlock","isEmptyDefaultBlock","_showEmptyBlockSideInserter","maybeShowBreadcrumb","isZoomOut","_showZoomOutToolbar","attributes","align","_showBlockToolbarPopover","hasFixedToolbar","showEmptyBlockSideInserter","showBreadcrumb","showBlockToolbarPopover","showZoomOutToolbar"],"sources":["@wordpress/block-editor/src/components/block-tools/use-show-block-tools.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { isUnmodifiedDefaultBlock } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\n\n/**\n * Source of truth for which block tools are showing in the block editor.\n *\n * @return {Object} Object of which block tools will be shown.\n */\nexport function useShowBlockTools() {\n\treturn useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetSelectedBlockClientId,\n\t\t\tgetFirstMultiSelectedBlockClientId,\n\t\t\tgetBlock,\n\t\t\tgetBlockMode,\n\t\t\tgetSettings,\n\t\t\thasMultiSelection,\n\t\t\t__unstableGetEditorMode,\n\t\t\tisTyping,\n\t\t} = select( blockEditorStore );\n\n\t\tconst clientId =\n\t\t\tgetSelectedBlockClientId() || getFirstMultiSelectedBlockClientId();\n\n\t\tconst block = getBlock( clientId );\n\t\tconst editorMode = __unstableGetEditorMode();\n\t\tconst hasSelectedBlock = !! clientId && !! block;\n\t\tconst isEmptyDefaultBlock =\n\t\t\thasSelectedBlock &&\n\t\t\tisUnmodifiedDefaultBlock( block ) &&\n\t\t\tgetBlockMode( clientId ) !== 'html';\n\t\tconst _showEmptyBlockSideInserter =\n\t\t\tclientId &&\n\t\t\t! isTyping() &&\n\t\t\teditorMode === 'edit' &&\n\t\t\tisEmptyDefaultBlock;\n\t\tconst maybeShowBreadcrumb =\n\t\t\thasSelectedBlock &&\n\t\t\t! hasMultiSelection() &&\n\t\t\teditorMode === 'navigation';\n\n\t\tconst isZoomOut = editorMode === 'zoom-out';\n\t\tconst _showZoomOutToolbar =\n\t\t\tisZoomOut &&\n\t\t\tblock?.attributes?.align === 'full' &&\n\t\t\t! _showEmptyBlockSideInserter &&\n\t\t\t! maybeShowBreadcrumb;\n\t\tconst _showBlockToolbarPopover =\n\t\t\t! _showZoomOutToolbar &&\n\t\t\t! getSettings().hasFixedToolbar &&\n\t\t\t! _showEmptyBlockSideInserter &&\n\t\t\thasSelectedBlock &&\n\t\t\t! isEmptyDefaultBlock &&\n\t\t\t! maybeShowBreadcrumb;\n\n\t\treturn {\n\t\t\tshowEmptyBlockSideInserter: _showEmptyBlockSideInserter,\n\t\t\tshowBreadcrumb:\n\t\t\t\t! _showEmptyBlockSideInserter && maybeShowBreadcrumb,\n\t\t\tshowBlockToolbarPopover: _showBlockToolbarPopover,\n\t\t\tshowZoomOutToolbar: _showZoomOutToolbar,\n\t\t};\n\t}, [] );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,wBAAwB,QAAQ,mBAAmB;;AAE5D;AACA;AACA;AACA,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;;AAEvD;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,iBAAiBA,CAAA,EAAG;EACnC,OAAOJ,SAAS,CAAIK,MAAM,IAAM;IAC/B,MAAM;MACLC,wBAAwB;MACxBC,kCAAkC;MAClCC,QAAQ;MACRC,YAAY;MACZC,WAAW;MACXC,iBAAiB;MACjBC,uBAAuB;MACvBC;IACD,CAAC,GAAGR,MAAM,CAAEF,gBAAiB,CAAC;IAE9B,MAAMW,QAAQ,GACbR,wBAAwB,CAAC,CAAC,IAAIC,kCAAkC,CAAC,CAAC;IAEnE,MAAMQ,KAAK,GAAGP,QAAQ,CAAEM,QAAS,CAAC;IAClC,MAAME,UAAU,GAAGJ,uBAAuB,CAAC,CAAC;IAC5C,MAAMK,gBAAgB,GAAG,CAAC,CAAEH,QAAQ,IAAI,CAAC,CAAEC,KAAK;IAChD,MAAMG,mBAAmB,GACxBD,gBAAgB,IAChBhB,wBAAwB,CAAEc,KAAM,CAAC,IACjCN,YAAY,CAAEK,QAAS,CAAC,KAAK,MAAM;IACpC,MAAMK,2BAA2B,GAChCL,QAAQ,IACR,CAAED,QAAQ,CAAC,CAAC,IACZG,UAAU,KAAK,MAAM,IACrBE,mBAAmB;IACpB,MAAME,mBAAmB,GACxBH,gBAAgB,IAChB,CAAEN,iBAAiB,CAAC,CAAC,IACrBK,UAAU,KAAK,YAAY;IAE5B,MAAMK,SAAS,GAAGL,UAAU,KAAK,UAAU;IAC3C,MAAMM,mBAAmB,GACxBD,SAAS,IACTN,KAAK,EAAEQ,UAAU,EAAEC,KAAK,KAAK,MAAM,IACnC,CAAEL,2BAA2B,IAC7B,CAAEC,mBAAmB;IACtB,MAAMK,wBAAwB,GAC7B,CAAEH,mBAAmB,IACrB,CAAEZ,WAAW,CAAC,CAAC,CAACgB,eAAe,IAC/B,CAAEP,2BAA2B,IAC7BF,gBAAgB,IAChB,CAAEC,mBAAmB,IACrB,CAAEE,mBAAmB;IAEtB,OAAO;MACNO,0BAA0B,EAAER,2BAA2B;MACvDS,cAAc,EACb,CAAET,2BAA2B,IAAIC,mBAAmB;MACrDS,uBAAuB,EAAEJ,wBAAwB;MACjDK,kBAAkB,EAAER;IACrB,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;AACR","ignoreList":[]}
1
+ {"version":3,"names":["useSelect","isUnmodifiedDefaultBlock","store","blockEditorStore","unlock","useShowBlockTools","select","getSelectedBlockClientId","getFirstMultiSelectedBlockClientId","getBlock","getBlockMode","getSettings","__unstableGetEditorMode","isTyping","getBlockOrder","getSectionRootClientId","clientId","block","editorMode","hasSelectedBlock","isEmptyDefaultBlock","_showEmptyBlockSideInserter","isZoomOut","isSectionSelected","includes","_showZoomOutToolbar","_showBlockToolbarPopover","hasFixedToolbar","showEmptyBlockSideInserter","showBlockToolbarPopover","showZoomOutToolbar"],"sources":["@wordpress/block-editor/src/components/block-tools/use-show-block-tools.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { isUnmodifiedDefaultBlock } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\n/**\n * Source of truth for which block tools are showing in the block editor.\n *\n * @return {Object} Object of which block tools will be shown.\n */\nexport function useShowBlockTools() {\n\treturn useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetSelectedBlockClientId,\n\t\t\tgetFirstMultiSelectedBlockClientId,\n\t\t\tgetBlock,\n\t\t\tgetBlockMode,\n\t\t\tgetSettings,\n\t\t\t__unstableGetEditorMode,\n\t\t\tisTyping,\n\t\t\tgetBlockOrder,\n\t\t\tgetSectionRootClientId,\n\t\t} = unlock( select( blockEditorStore ) );\n\n\t\tconst clientId =\n\t\t\tgetSelectedBlockClientId() || getFirstMultiSelectedBlockClientId();\n\n\t\tconst block = getBlock( clientId );\n\t\tconst editorMode = __unstableGetEditorMode();\n\t\tconst hasSelectedBlock = !! clientId && !! block;\n\t\tconst isEmptyDefaultBlock =\n\t\t\thasSelectedBlock &&\n\t\t\tisUnmodifiedDefaultBlock( block ) &&\n\t\t\tgetBlockMode( clientId ) !== 'html';\n\t\tconst _showEmptyBlockSideInserter =\n\t\t\tclientId &&\n\t\t\t! isTyping() &&\n\t\t\teditorMode === 'edit' &&\n\t\t\tisEmptyDefaultBlock;\n\t\tconst isZoomOut = editorMode === 'zoom-out';\n\t\tconst isSectionSelected = getBlockOrder(\n\t\t\tgetSectionRootClientId()\n\t\t).includes( clientId );\n\t\tconst _showZoomOutToolbar =\n\t\t\tclientId &&\n\t\t\tisZoomOut &&\n\t\t\t! _showEmptyBlockSideInserter &&\n\t\t\tisSectionSelected;\n\t\tconst _showBlockToolbarPopover =\n\t\t\t! _showZoomOutToolbar &&\n\t\t\t! getSettings().hasFixedToolbar &&\n\t\t\t! _showEmptyBlockSideInserter &&\n\t\t\thasSelectedBlock &&\n\t\t\t! isEmptyDefaultBlock;\n\n\t\treturn {\n\t\t\tshowEmptyBlockSideInserter: _show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IACtB,MAAMS,mBAAmB,GACxBT,QAAQ,IACRM,SAAS,IACT,CAAED,2BAA2B,IAC7BE,iBAAiB;IAClB,MAAMG,wBAAwB,GAC7B,CAAED,mBAAmB,IACrB,CAAEd,WAAW,CAAC,CAAC,CAACgB,eAAe,IAC/B,CAAEN,2BAA2B,IAC7BF,gBAAgB,IAChB,CAAEC,mBAAmB;IAEtB,OAAO;MACNQ,0BAA0B,EAAEP,2BAA2B;MACvDQ,uBAAuB,EAAEH,wBAAwB;MACjDI,kBAAkB,EAAEL;IACrB,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;AACR","ignoreList":[]}
@@ -6,30 +6,19 @@ import clsx from 'clsx';
6
6
  /**
7
7
  * WordPress dependencies
8
8
  */
9
- import { useState } from '@wordpress/element';
10
9
  import { Button } from '@wordpress/components';
11
10
  import { plus } from '@wordpress/icons';
12
11
  import { _x } from '@wordpress/i18n';
13
12
  import { jsx as _jsx } from "react/jsx-runtime";
14
13
  function ZoomOutModeInserterButton({
15
- isVisible,
16
14
  onClick
17
15
  }) {
18
- const [zoomOutModeInserterButtonHovered, setZoomOutModeInserterButtonHovered] = useState(false);
19
16
  return /*#__PURE__*/_jsx(Button, {
20
17
  variant: "primary",
21
18
  icon: plus,
22
19
  size: "compact",
23
- className: clsx('block-editor-button-pattern-inserter__button', 'block-editor-block-tools__zoom-out-mode-inserter-button', {
24
- 'is-visible': isVisible || zoomOutModeInserterButtonHovered
25
- }),
20
+ className: clsx('block-editor-button-pattern-inserter__button', 'block-editor-block-tools__zoom-out-mode-inserter-button'),
26
21
  onClick: onClick,
27
- onMouseOver: () => {
28
- setZoomOutModeInserterButtonHovered(true);
29
- },
30
- onMouseOut: () => {
31
- setZoomOutModeInserterButtonHovered(false);
32
- },
33
22
  label: _x('Add pattern', 'Generic label for pattern inserter button')
34
23
  });
35
24
  }
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","useState","Button","plus","_x","jsx","_jsx","ZoomOutModeInserterButton","isVisible","onClick","zoomOutModeInserterButtonHovered","setZoomOutModeInserterButtonHovered","variant","icon","size","className","onMouseOver","onMouseOut","label"],"sources":["@wordpress/block-editor/src/components/block-tools/zoom-out-mode-inserter-button.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useState } from '@wordpress/element';\nimport { Button } from '@wordpress/components';\nimport { plus } from '@wordpress/icons';\nimport { _x } from '@wordpress/i18n';\n\nfunction ZoomOutModeInserterButton( { isVisible, onClick } ) {\n\tconst [\n\t\tzoomOutModeInserterButtonHovered,\n\t\tsetZoomOutModeInserterButtonHovered,\n\t] = useState( false );\n\n\treturn (\n\t\t<Button\n\t\t\tvariant=\"primary\"\n\t\t\ticon={ plus }\n\t\t\tsize=\"compact\"\n\t\t\tclassName={ clsx(\n\t\t\t\t'block-editor-button-pattern-inserter__button',\n\t\t\t\t'block-editor-block-tools__zoom-out-mode-inserter-button',\n\t\t\t\t{\n\t\t\t\t\t'is-visible': isVisible || zoomOutModeInserterButtonHovered,\n\t\t\t\t}\n\t\t\t) }\n\t\t\tonClick={ onClick }\n\t\t\tonMouseOver={ () => {\n\t\t\t\tsetZoomOutModeInserterButtonHovered( true );\n\t\t\t} }\n\t\t\tonMouseOut={ () => {\n\t\t\t\tsetZoomOutModeInserterButtonHovered( false );\n\t\t\t} }\n\t\t\tlabel={ _x(\n\t\t\t\t'Add pattern',\n\t\t\t\t'Generic label for pattern inserter button'\n\t\t\t) }\n\t\t/>\n\t);\n}\n\nexport default ZoomOutModeInserterButton;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,IAAI,QAAQ,kBAAkB;AACvC,SAASC,EAAE,QAAQ,iBAAiB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAErC,SAASC,yBAAyBA,CAAE;EAAEC,SAAS;EAAEC;AAAQ,CAAC,EAAG;EAC5D,MAAM,CACLC,gCAAgC,EAChCC,mCAAmC,CACnC,GAAGV,QAAQ,CAAE,KAAM,CAAC;EAErB,oBACCK,IAAA,CAACJ,MAAM;IACNU,OAAO,EAAC,SAAS;IACjBC,IAAI,EAAGV,IAAM;IACbW,IAAI,EAAC,SAAS;IACdC,SAAS,EAAGf,IAAI,CACf,8CAA8C,EAC9C,yDAAyD,EACzD;MACC,YAAY,EAAEQ,SAAS,IAAIE;IAC5B,CACD,CAAG;IACHD,OAAO,EAAGA,OAAS;IACnBO,WAAW,EAAGA,CAAA,KAAM;MACnBL,mCAAmC,CAAE,IAAK,CAAC;IAC5C,CAAG;IACHM,UAAU,EAAGA,CAAA,KAAM;MAClBN,mCAAmC,CAAE,KAAM,CAAC;IAC7C,CAAG;IACHO,KAAK,EAAGd,EAAE,CACT,aAAa,EACb,2CACD;EAAG,CACH,CAAC;AAEJ;AAEA,eAAeG,yBAAyB","ignoreList":[]}
1
+ {"version":3,"names":["clsx","Button","plus","_x","jsx","_jsx","ZoomOutModeInserterButton","onClick","variant","icon","size","className","label"],"sources":["@wordpress/block-editor/src/components/block-tools/zoom-out-mode-inserter-button.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\nimport { plus } from '@wordpress/icons';\nimport { _x } from '@wordpress/i18n';\n\nfunction ZoomOutModeInserterButton( { onClick } ) {\n\treturn (\n\t\t<Button\n\t\t\tvariant=\"primary\"\n\t\t\ticon={ plus }\n\t\t\tsize=\"compact\"\n\t\t\tclassName={ clsx(\n\t\t\t\t'block-editor-button-pattern-inserter__button',\n\t\t\t\t'block-editor-block-tools__zoom-out-mode-inserter-button'\n\t\t\t) }\n\t\t\tonClick={ onClick }\n\t\t\tlabel={ _x(\n\t\t\t\t'Add pattern',\n\t\t\t\t'Generic label for pattern inserter button'\n\t\t\t) }\n\t\t/>\n\t);\n}\n\nexport default ZoomOutModeInserterButton;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,IAAI,QAAQ,kBAAkB;AACvC,SAASC,EAAE,QAAQ,iBAAiB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAErC,SAASC,yBAAyBA,CAAE;EAAEC;AAAQ,CAAC,EAAG;EACjD,oBACCF,IAAA,CAACJ,MAAM;IACNO,OAAO,EAAC,SAAS;IACjBC,IAAI,EAAGP,IAAM;IACbQ,IAAI,EAAC,SAAS;IACdC,SAAS,EAAGX,IAAI,CACf,8CAA8C,EAC9C,yDACD,CAAG;IACHO,OAAO,EAAGA,OAAS;IACnBK,KAAK,EAAGT,EAAE,CACT,aAAa,EACb,2CACD;EAAG,CACH,CAAC;AAEJ;AAEA,eAAeG,yBAAyB","ignoreList":[]}
@@ -16,39 +16,38 @@ function ZoomOutModeInserters() {
16
16
  const [isReady, setIsReady] = useState(false);
17
17
  const {
18
18
  hasSelection,
19
- blockInsertionPoint,
19
+ insertionPoint,
20
20
  blockOrder,
21
21
  blockInsertionPointVisible,
22
22
  setInserterIsOpened,
23
23
  sectionRootClientId,
24
- selectedBlockClientId,
25
- hoveredBlockClientId
24
+ selectedBlockClientId
26
25
  } = useSelect(select => {
27
26
  const {
28
27
  getSettings,
29
- getBlockInsertionPoint,
28
+ getInsertionPoint,
30
29
  getBlockOrder,
31
30
  getSelectionStart,
32
31
  getSelectedBlockClientId,
33
- getHoveredBlockClientId,
34
- isBlockInsertionPointVisible,
35
- getSectionRootClientId
32
+ getSectionRootClientId,
33
+ isBlockInsertionPointVisible
36
34
  } = unlock(select(blockEditorStore));
37
35
  const root = getSectionRootClientId();
38
36
  return {
39
37
  hasSelection: !!getSelectionStart().clientId,
40
- blockInsertionPoint: getBlockInsertionPoint(),
38
+ insertionPoint: getInsertionPoint(),
41
39
  blockOrder: getBlockOrder(root),
42
40
  blockInsertionPointVisible: isBlockInsertionPointVisible(),
43
41
  sectionRootClientId: root,
44
42
  setInserterIsOpened: getSettings().__experimentalSetIsInserterOpened,
45
- selectedBlockClientId: getSelectedBlockClientId(),
46
- hoveredBlockClientId: getHoveredBlockClientId()
43
+ selectedBlockClientId: getSelectedBlockClientId()
47
44
  };
48
45
  }, []);
46
+
47
+ // eslint-disable-next-line @wordpress/no-unused-vars-before-return
49
48
  const {
50
49
  showInsertionPoint
51
- } = useDispatch(blockEditorStore);
50
+ } = unlock(useDispatch(blockEditorStore));
52
51
 
53
52
  // Defer the initial rendering to avoid the jumps due to the animation.
54
53
  useEffect(() => {
@@ -59,20 +58,18 @@ function ZoomOutModeInserters() {
59
58
  clearTimeout(timeout);
60
59
  };
61
60
  }, []);
62
- if (!isReady) {
61
+ if (!isReady || !hasSelection) {
63
62
  return null;
64
63
  }
65
64
  return [undefined, ...blockOrder].map((clientId, index) => {
66
- const shouldRenderInsertionPoint = blockInsertionPointVisible && blockInsertionPoint.index === index;
65
+ const shouldRenderInsertionPoint = blockInsertionPointVisible && insertionPoint?.index === index;
67
66
  const previousClientId = clientId;
68
67
  const nextClientId = blockOrder[index];
69
- const isSelected = hasSelection && (selectedBlockClientId === previousClientId || selectedBlockClientId === nextClientId);
70
- const isHovered = hoveredBlockClientId === previousClientId || hoveredBlockClientId === nextClientId;
68
+ const isSelected = selectedBlockClientId === previousClientId || selectedBlockClientId === nextClientId;
71
69
  return /*#__PURE__*/_jsx(BlockPopoverInbetween, {
72
70
  previousClientId: previousClientId,
73
71
  nextClientId: nextClientId,
74
- children: !shouldRenderInsertionPoint && /*#__PURE__*/_jsx(ZoomOutModeInserterButton, {
75
- isVisible: isSelected || isHovered,
72
+ children: !shouldRenderInsertionPoint && isSelected && /*#__PURE__*/_jsx(ZoomOutModeInserterButton, {
76
73
  onClick: () => {
77
74
  setInserterIsOpened({
78
75
  rootClientId: sectionRootClientId,
@@ -1 +1 @@
1
- {"version":3,"names":["useSelect","useDispatch","useEffect","useState","BlockPopoverInbetween","ZoomOutModeInserterButton","store","blockEditorStore","unlock","jsx","_jsx","ZoomOutModeInserters","isReady","setIsReady","hasSelection","blockInsertionPoint","blockOrder","blockInsertionPointVisible","setInserterIsOpened","sectionRootClientId","selectedBlockClientId","hoveredBlockClientId","select","getSettings","getBlockInsertionPoint","getBlockOrder","getSelectionStart","getSelectedBlockClientId","getHoveredBlockClientId","isBlockInsertionPointVisible","getSectionRootClientId","root","clientId","__experimentalSetIsInserterOpened","showInsertionPoint","timeout","setTimeout","clearTimeout","undefined","map","index","shouldRenderInsertionPoint","previousClientId","nextClientId","isSelected","isHovered","children","isVisible","onClick","rootClientId","insertionIndex","tab","category","operation"],"sources":["@wordpress/block-editor/src/components/block-tools/zoom-out-mode-inserters.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useEffect, useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport BlockPopoverInbetween from '../block-popover/inbetween';\nimport ZoomOutModeInserterButton from './zoom-out-mode-inserter-button';\nimport { store as blockEditorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nfunction ZoomOutModeInserters() {\n\tconst [ isReady, setIsReady ] = useState( false );\n\tconst {\n\t\thasSelection,\n\t\tblockInsertionPoint,\n\t\tblockOrder,\n\t\tblockInsertionPointVisible,\n\t\tsetInserterIsOpened,\n\t\tsectionRootClientId,\n\t\tselectedBlockClientId,\n\t\thoveredBlockClientId,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetSettings,\n\t\t\tgetBlockInsertionPoint,\n\t\t\tgetBlockOrder,\n\t\t\tgetSelectionStart,\n\t\t\tgetSelectedBlockClientId,\n\t\t\tgetHoveredBlockClientId,\n\t\t\tisBlockInsertionPointVisible,\n\t\t\tgetSectionRootClientId,\n\t\t} = unlock( select( blockEditorStore ) );\n\n\t\tconst root = getSectionRootClientId();\n\n\t\treturn {\n\t\t\thasSelection: !! getSelectionStart().clientId,\n\t\t\tblockInsertionPoint: getBlockInsertionPoint(),\n\t\t\tblockOrder: getBlockOrder( root ),\n\t\t\tblockInsertionPointVisible: isBlockInsertionPointVisible(),\n\t\t\tsectionRootClientId: root,\n\t\t\tsetInserterIsOpened:\n\t\t\t\tgetSettings().__experimentalSetIsInserterOpened,\n\t\t\tselectedBlockClientId: getSelectedBlockClientId(),\n\t\t\thoveredBlockClientId: getHoveredBlockClientId(),\n\t\t};\n\t}, [] );\n\n\tconst { showInsertionPoint } = useDispatch( blockEditorStore );\n\n\t// Defer the initial rendering to avoid the jumps due to the animation.\n\tuseEffect( () => {\n\t\tconst timeout = setTimeout( () => {\n\t\t\tsetIsReady( true );\n\t\t}, 500 );\n\t\treturn () => {\n\t\t\tclearTimeout( timeout );\n\t\t};\n\t}, [] );\n\n\tif ( ! isReady ) {\n\t\treturn null;\n\t}\n\n\treturn [ undefined, ...blockOrder ].map( ( clientId, index ) => {\n\t\tconst shouldRenderInsertionPoint =\n\t\t\tblockInsertionPointVisible && blockInsertionPoint.index === index;\n\n\t\tconst previousClientId = clientId;\n\t\tconst nextClientId = blockOrder[ index ];\n\n\t\tconst isSelected =\n\t\t\thasSelection &&\n\t\t\t( selectedBlockClientId === previousClientId ||\n\t\t\t\tselectedBlockClientId === nextClientId );\n\n\t\tconst isHovered =\n\t\t\thoveredBlockClientId === previousClientId ||\n\t\t\thoveredBlockClientId === nextClientId;\n\n\t\treturn (\n\t\t\t<BlockPopoverInbetween\n\t\t\t\tkey={ index }\n\t\t\t\tpreviousClientId={ previousClientId }\n\t\t\t\tnextClientId={ nextClientId }\n\t\t\t>\n\t\t\t\t{ ! shouldRenderInsertionPoint && (\n\t\t\t\t\t<ZoomOutModeInserterButton\n\t\t\t\t\t\tisVisible={ isSelected || isHovered }\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tsetInserterIsOpened( {\n\t\t\t\t\t\t\t\trootClientId: sectionRootClientId,\n\t\t\t\t\t\t\t\tinsertionIndex: index,\n\t\t\t\t\t\t\t\ttab: 'patterns',\n\t\t\t\t\t\t\t\tcategory: 'all',\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\tshowInsertionPoint( sectionRootClientId, index, {\n\t\t\t\t\t\t\t\toperation: 'insert',\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</BlockPopoverInbetween>\n\t\t);\n\t} );\n}\n\nexport default ZoomOutModeInserters;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,SAAS,EAAEC,QAAQ,QAAQ,oBAAoB;;AAExD;AACA;AACA;AACA,OAAOC,qBAAqB,MAAM,4BAA4B;AAC9D,OAAOC,yBAAyB,MAAM,iCAAiC;AACvE,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;AACvD,SAASC,MAAM,QAAQ,mBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE3C,SAASC,oBAAoBA,CAAA,EAAG;EAC/B,MAAM,CAAEC,OAAO,EAAEC,UAAU,CAAE,GAAGV,QAAQ,CAAE,KAAM,CAAC;EACjD,MAAM;IACLW,YAAY;IACZC,mBAAmB;IACnBC,UAAU;IACVC,0BAA0B;IAC1BC,mBAAmB;IACnBC,mBAAmB;IACnBC,qBAAqB;IACrBC;EACD,CAAC,GAAGrB,SAAS,CAAIsB,MAAM,IAAM;IAC5B,MAAM;MACLC,WAAW;MACXC,sBAAsB;MACtBC,aAAa;MACbC,iBAAiB;MACjBC,wBAAwB;MACxBC,uBAAuB;MACvBC,4BAA4B;MAC5BC;IACD,CAAC,GAAGtB,MAAM,CAAEc,MAAM,CAAEf,gBAAiB,CAAE,CAAC;IAExC,MAAMwB,IAAI,GAAGD,sBAAsB,CAAC,CAAC;IAErC,OAAO;MACNhB,YAAY,EAAE,CAAC,CAAEY,iBAAiB,CAAC,C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B,EAAGA,gBAAkB;MACrCC,YAAY,EAAGA,YAAc;MAAAG,QAAA,EAE3B,CAAEL,0BAA0B,iBAC7B/B,IAAA,CAACL,yBAAyB;QACzB0C,SAAS,EAAGH,UAAU,IAAIC,SAAW;QACrCG,OAAO,EAAGA,CAAA,KAAM;UACf9B,mBAAmB,CAAE;YACpB+B,YAAY,EAAE9B,mBAAmB;YACjC+B,cAAc,EAAEV,KAAK;YACrBW,GAAG,EAAE,UAAU;YACfC,QAAQ,EAAE;UACX,CAAE,CAAC;UACHlB,kBAAkB,CAAEf,mBAAmB,EAAEqB,KAAK,EAAE;YAC/Ca,SAAS,EAAE;UACZ,CAAE,CAAC;QACJ;MAAG,CACH;IACD,GAnBKb,KAoBgB,CAAC;EAE1B,CAAE,CAAC;AACJ;AAEA,eAAe7B,oBAAoB","ignoreList":[]}
1
+ {"version":3,"names":["useSelect","useDispatch","useEffect","useState","BlockPopoverInbetween","ZoomOutModeInserterButton","store","blockEditorStore","unlock","jsx","_jsx","ZoomOutModeInserters","isReady","setIsReady","hasSelection","insertionPoint","blockOrder","blockInsertionPointVisible","setInserterIsOpened","sectionRootClientId","selectedBlockClientId","select","getSettings","getInsertionPoint","getBlockOrder","getSelectionStart","getSelectedBlockClientId","getSectionRootClientId","isBlockInsertionPointVisible","root","clientId","__experimentalSetIsInserterOpened","showInsertionPoint","timeout","setTimeout","clearTimeout","undefined","map","index","shouldRenderInsertionPoint","previousClientId","nextClientId","isSelected","children","onClick","rootClientId","insertionIndex","tab","category","operation"],"sources":["@wordpress/block-editor/src/components/block-tools/zoom-out-mode-inserters.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useEffect, useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport BlockPopoverInbetween from '../block-popover/inbetween';\nimport ZoomOutModeInserterButton from './zoom-out-mode-inserter-button';\nimport { store as blockEditorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nfunction ZoomOutModeInserters() {\n\tconst [ isReady, setIsReady ] = useState( false );\n\tconst {\n\t\thasSelection,\n\t\tinsertionPoint,\n\t\tblockOrder,\n\t\tblockInsertionPointVisible,\n\t\tsetInserterIsOpened,\n\t\tsectionRootClientId,\n\t\tselectedBlockClientId,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetSettings,\n\t\t\tgetInsertionPoint,\n\t\t\tgetBlockOrder,\n\t\t\tgetSelectionStart,\n\t\t\tgetSelectedBlockClientId,\n\t\t\tgetSectionRootClientId,\n\t\t\tisBlockInsertionPointVisible,\n\t\t} = unlock( select( blockEditorStore ) );\n\n\t\tconst root = getSectionRootClientId();\n\n\t\treturn {\n\t\t\thasSelection: !! getSelectionStart().clientId,\n\t\t\tinsertionPoint: getInsertionPoint(),\n\t\t\tblockOrder: getBlockOrder( root ),\n\t\t\tblockInsertionPointVisible: isBlockInsertionPointVisible(),\n\t\t\tsectionRootClientId: root,\n\t\t\tsetInserterIsOpened:\n\t\t\t\tgetSettings().__experimentalSetIsInserterOpened,\n\t\t\tselectedBlockClientId: getSelectedBlockClientId(),\n\t\t};\n\t}, [] );\n\n\t// eslint-disable-next-line @wordpress/no-unused-vars-before-return\n\tconst { showInsertionPoint } = unlock( useDispatch( blockEditorStore ) );\n\n\t// Defer the initial rendering to avoid the jumps due to the animation.\n\tuseEffect( () => {\n\t\tconst timeout = setTimeout( () => {\n\t\t\tsetIsReady( true );\n\t\t}, 500 );\n\t\treturn () => {\n\t\t\tclearTimeout( timeout );\n\t\t};\n\t}, [] );\n\n\tif ( ! isReady || ! hasSelection ) {\n\t\treturn null;\n\t}\n\n\treturn [ undefined, ...blockOrder ].map( ( clientId, index ) => {\n\t\tconst shouldRenderInsertionPoint =\n\t\t\tblockInsertionPointVisible && insertionPoint?.index === index;\n\n\t\tconst previousClientId = clientId;\n\t\tconst nextClientId = blockOrder[ index ];\n\n\t\tconst isSelected =\n\t\t\tselectedBlockClientId === previousClientId ||\n\t\t\tselectedBlockClientId === nextClientId;\n\n\t\treturn (\n\t\t\t<BlockPopoverInbetween\n\t\t\t\tkey={ index }\n\t\t\t\tpreviousClientId={ previousClientId }\n\t\t\t\tnextClientId={ nextClientId }\n\t\t\t>\n\t\t\t\t{ ! shouldRenderInsertionPoint && isSelected && (\n\t\t\t\t\t<ZoomOutModeInserterButton\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tsetInserterIsOpened( {\n\t\t\t\t\t\t\t\trootClientId: sectionRootClientId,\n\t\t\t\t\t\t\t\tinsertionIndex: index,\n\t\t\t\t\t\t\t\ttab: 'patterns',\n\t\t\t\t\t\t\t\tcategory: 'all',\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\tshowInsertionPoint( sectionRootClientId, index, {\n\t\t\t\t\t\t\t\toperation: 'insert',\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</BlockPopoverInbetween>\n\t\t);\n\t} );\n}\n\nexport default ZoomOutModeInserters;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,SAAS,EAAEC,QAAQ,QAAQ,oBAAoB;;AAExD;AACA;AACA;AACA,OAAOC,qBAAqB,MAAM,4BAA4B;AAC9D,OAAOC,yBAAyB,MAAM,iCAAiC;AACvE,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;AACvD,SAASC,MAAM,QAAQ,mBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE3C,SAASC,oBAAoBA,CAAA,EAAG;EAC/B,MAAM,CAAEC,OAAO,EAAEC,UAAU,CAAE,GAAGV,QAAQ,CAAE,KAAM,CAAC;EACjD,MAAM;IACLW,YAAY;IACZC,cAAc;IACdC,UAAU;IACVC,0BAA0B;IAC1BC,mBAAmB;IACnBC,mBAAmB;IACnBC;EACD,CAAC,GAAGpB,SAAS,CAAIqB,MAAM,IA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AAMW,YAAY,GAAGzB,UAAU,CAAEsB,KAAK,CAAE;IAExC,MAAMI,UAAU,GACftB,qBAAqB,KAAKoB,gBAAgB,IAC1CpB,qBAAqB,KAAKqB,YAAY;IAEvC,oBACC/B,IAAA,CAACN,qBAAqB;MAErBoC,gBAAgB,EAAGA,gBAAkB;MACrCC,YAAY,EAAGA,YAAc;MAAAE,QAAA,EAE3B,CAAEJ,0BAA0B,IAAIG,UAAU,iBAC3ChC,IAAA,CAACL,yBAAyB;QACzBuC,OAAO,EAAGA,CAAA,KAAM;UACf1B,mBAAmB,CAAE;YACpB2B,YAAY,EAAE1B,mBAAmB;YACjC2B,cAAc,EAAER,KAAK;YACrBS,GAAG,EAAE,UAAU;YACfC,QAAQ,EAAE;UACX,CAAE,CAAC;UACHhB,kBAAkB,CAAEb,mBAAmB,EAAEmB,KAAK,EAAE;YAC/CW,SAAS,EAAE;UACZ,CAAE,CAAC;QACJ;MAAG,CACH;IACD,GAlBKX,KAmBgB,CAAC;EAE1B,CAAE,CAAC;AACJ;AAEA,eAAe3B,oBAAoB","ignoreList":[]}
@@ -5,7 +5,7 @@ import clsx from 'clsx';
5
5
  /**
6
6
  * Internal dependencies
7
7
  */
8
- import BlockPopover from '../block-popover';
8
+ import { PrivateBlockPopover as BlockPopover } from '../block-popover';
9
9
  import useBlockToolbarPopoverProps from './use-block-toolbar-popover-props';
10
10
  import useSelectedBlockToolProps from './use-selected-block-tool-props';
11
11
  import ZoomOutToolbar from './zoom-out-toolbar';
@@ -32,6 +32,7 @@ export default function ZoomOutPopover({
32
32
  shift: true
33
33
  };
34
34
  return /*#__PURE__*/_jsx(BlockPopover, {
35
+ __unstableContentRef: __unstableContentRef,
35
36
  clientId: capturingClientId || clientId,
36
37
  bottomClientId: lastClientId,
37
38
  className: clsx('zoom-out-toolbar-popover', {
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","BlockPopover","useBlockToolbarPopoverProps","useSelectedBlockToolProps","ZoomOutToolbar","jsx","_jsx","ZoomOutPopover","clientId","__unstableContentRef","capturingClientId","isInsertionPointVisible","lastClientId","popoverProps","contentElement","current","props","placement","flip","shift","bottomClientId","className","resize","children"],"sources":["@wordpress/block-editor/src/components/block-tools/zoom-out-popover.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n/**\n * Internal dependencies\n */\nimport BlockPopover from '../block-popover';\nimport useBlockToolbarPopoverProps from './use-block-toolbar-popover-props';\nimport useSelectedBlockToolProps from './use-selected-block-tool-props';\nimport ZoomOutToolbar from './zoom-out-toolbar';\n\nexport default function ZoomOutPopover( { clientId, __unstableContentRef } ) {\n\tconst { capturingClientId, isInsertionPointVisible, lastClientId } =\n\t\tuseSelectedBlockToolProps( clientId );\n\n\tconst popoverProps = useBlockToolbarPopoverProps( {\n\t\tcontentElement: __unstableContentRef?.current,\n\t\tclientId,\n\t} );\n\n\t// Override some of the popover props for the zoom-out toolbar.\n\tconst props = {\n\t\t...popoverProps,\n\t\tplacement: 'left-start',\n\t\tflip: false,\n\t\tshift: true,\n\t};\n\n\treturn (\n\t\t<BlockPopover\n\t\t\tclientId={ capturingClientId || clientId }\n\t\t\tbottomClientId={ lastClientId }\n\t\t\tclassName={ clsx( 'zoom-out-toolbar-popover', {\n\t\t\t\t'is-insertion-point-visible': isInsertionPointVisible,\n\t\t\t} ) }\n\t\t\tresize={ false }\n\t\t\t{ ...props }\n\t\t>\n\t\t\t<ZoomOutToolbar\n\t\t\t\t__unstableContentRef={ __unstableContentRef }\n\t\t\t\tclientId={ clientId }\n\t\t\t/>\n\t\t</BlockPopover>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;AACvB;AACA;AACA;AACA,OAAOC,YAAY,MAAM,kBAAkB;AAC3C,OAAOC,2BAA2B,MAAM,mCAAmC;AAC3E,OAAOC,yBAAyB,MAAM,iCAAiC;AACvE,OAAOC,cAAc,MAAM,oBAAoB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEhD,eAAe,SAASC,cAAcA,CAAE;EAAEC,QAAQ;EAAEC;AAAqB,CAAC,EAAG;EAC5E,MAAM;IAAEC,iBAAiB;IAAEC,uBAAuB;IAAEC;EAAa,CAAC,GACjET,yBAAyB,CAAEK,QAAS,CAAC;EAEtC,MAAMK,YAAY,GAAGX,2BAA2B,CAAE;IACjDY,cAAc,EAAEL,oBAAoB,EAAEM,OAAO;IAC7CP;EACD,CAAE,CAAC;;EAEH;EACA,MAAMQ,KAAK,GAAG;IACb,GAAGH,YAAY;IACfI,SAAS,EAAE,YAAY;IACvBC,IAAI,EAAE,KAAK;IACXC,KAAK,EAAE;EACR,CAAC;EAED,oBACCb,IAAA,CAACL,YAAY;IACZO,QAAQ,EAAGE,iBAAiB,IAAIF,QAAU;IAC1CY,cAAc,EAAGR,YAAc;IAC/BS,SAAS,EAAGrB,IAAI,CAAE,0BAA0B,EAAE;MAC7C,4BAA4B,EAAEW;IAC/B,CAAE,CAAG;IACLW,MAAM,EAAG,KAAO;IAAA,GACXN,KAAK;IAAAO,QAAA,eAEVjB,IAAA,CAACF,cAAc;MACdK,oBAAoB,EAAGA,oBAAsB;MAC7CD,QAAQ,EAAGA;IAAU,CACrB;EAAC,CACW,CAAC;AAEjB","ignoreList":[]}
1
+ {"version":3,"names":["clsx","PrivateBlockPopover","BlockPopover","useBlockToolbarPopoverProps","useSelectedBlockToolProps","ZoomOutToolbar","jsx","_jsx","ZoomOutPopover","clientId","__unstableContentRef","capturingClientId","isInsertionPointVisible","lastClientId","popoverProps","contentElement","current","props","placement","flip","shift","bottomClientId","className","resize","children"],"sources":["@wordpress/block-editor/src/components/block-tools/zoom-out-popover.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n/**\n * Internal dependencies\n */\nimport { PrivateBlockPopover as BlockPopover } from '../block-popover';\nimport useBlockToolbarPopoverProps from './use-block-toolbar-popover-props';\nimport useSelectedBlockToolProps from './use-selected-block-tool-props';\nimport ZoomOutToolbar from './zoom-out-toolbar';\n\nexport default function ZoomOutPopover( { clientId, __unstableContentRef } ) {\n\tconst { capturingClientId, isInsertionPointVisible, lastClientId } =\n\t\tuseSelectedBlockToolProps( clientId );\n\n\tconst popoverProps = useBlockToolbarPopoverProps( {\n\t\tcontentElement: __unstableContentRef?.current,\n\t\tclientId,\n\t} );\n\n\t// Override some of the popover props for the zoom-out toolbar.\n\tconst props = {\n\t\t...popoverProps,\n\t\tplacement: 'left-start',\n\t\tflip: false,\n\t\tshift: true,\n\t};\n\n\treturn (\n\t\t<BlockPopover\n\t\t\t__unstableContentRef={ __unstableContentRef }\n\t\t\tclientId={ capturingClientId || clientId }\n\t\t\tbottomClientId={ lastClientId }\n\t\t\tclassName={ clsx( 'zoom-out-toolbar-popover', {\n\t\t\t\t'is-insertion-point-visible': isInsertionPointVisible,\n\t\t\t} ) }\n\t\t\tresize={ false }\n\t\t\t{ ...props }\n\t\t>\n\t\t\t<ZoomOutToolbar\n\t\t\t\t__unstableContentRef={ __unstableContentRef }\n\t\t\t\tclientId={ clientId }\n\t\t\t/>\n\t\t</BlockPopover>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;AACvB;AACA;AACA;AACA,SAASC,mBAAmB,IAAIC,YAAY,QAAQ,kBAAkB;AACtE,OAAOC,2BAA2B,MAAM,mCAAmC;AAC3E,OAAOC,yBAAyB,MAAM,iCAAiC;AACvE,OAAOC,cAAc,MAAM,oBAAoB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEhD,eAAe,SAASC,cAAcA,CAAE;EAAEC,QAAQ;EAAEC;AAAqB,CAAC,EAAG;EAC5E,MAAM;IAAEC,iBAAiB;IAAEC,uBAAuB;IAAEC;EAAa,CAAC,GACjET,yBAAyB,CAAEK,QAAS,CAAC;EAEtC,MAAMK,YAAY,GAAGX,2BAA2B,CAAE;IACjDY,cAAc,EAAEL,oBAAoB,EAAEM,OAAO;IAC7CP;EACD,CAAE,CAAC;;EAEH;EACA,MAAMQ,KAAK,GAAG;IACb,GAAGH,YAAY;IACfI,SAAS,EAAE,YAAY;IACvBC,IAAI,EAAE,KAAK;IACXC,KAAK,EAAE;EACR,CAAC;EAED,oBACCb,IAAA,CAACL,YAAY;IACZQ,oBAAoB,EAAGA,oBAAsB;IAC7CD,QAAQ,EAAGE,iBAAiB,IAAIF,QAAU;IAC1CY,cAAc,EAAGR,YAAc;IAC/BS,SAAS,EAAGtB,IAAI,CAAE,0BAA0B,EAAE;MAC7C,4BAA4B,EAAEY;IAC/B,CAAE,CAAG;IACLW,MAAM,EAAG,KAAO;IAAA,GACXN,KAAK;IAAAO,QAAA,eAEVjB,IAAA,CAACF,cAAc;MACdK,oBAAoB,EAAGA,oBAAsB;MAC7CD,QAAQ,EAAGA;IAAU,CACrB;EAAC,CACW,CAAC;AAEjB","ignoreList":[]}
@@ -1,12 +1,7 @@
1
- /**
2
- * External dependencies
3
- */
4
- import clsx from 'clsx';
5
-
6
1
  /**
7
2
  * WordPress dependencies
8
3
  */
9
- import { dragHandle, trash, edit } from '@wordpress/icons';
4
+ import { dragHandle, trash } from '@wordpress/icons';
10
5
  import { Button, ToolbarButton } from '@wordpress/components';
11
6
  import { useSelect, useDispatch } from '@wordpress/data';
12
7
  import { store as blocksStore } from '@wordpress/blocks';
@@ -20,9 +15,7 @@ import BlockDraggable from '../block-draggable';
20
15
  import BlockMover from '../block-mover';
21
16
  import Shuffle from '../block-toolbar/shuffle';
22
17
  import NavigableToolbar from '../navigable-toolbar';
23
- import { unlock } from '../../lock-unlock';
24
- import { jsx as _jsx } from "react/jsx-runtime";
25
- import { jsxs as _jsxs } from "react/jsx-runtime";
18
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
26
19
  export default function ZoomOutToolbar({
27
20
  clientId,
28
21
  __unstableContentRef
@@ -30,7 +23,6 @@ export default function ZoomOutToolbar({
30
23
  const selected = useSelect(select => {
31
24
  const {
32
25
  getBlock,
33
- hasBlockMovingClientId,
34
26
  getNextBlockClientId,
35
27
  getPreviousBlockClientId,
36
28
  canRemoveBlock,
@@ -67,7 +59,6 @@ export default function ZoomOutToolbar({
67
59
  isPrevBlockTemplatePart = prevBlockType?.name === 'core/template-part';
68
60
  }
69
61
  return {
70
- blockMovingMode: hasBlockMovingClientId(),
71
62
  isBlockTemplatePart,
72
63
  isNextBlockTemplatePart,
73
64
  isPrevBlockTemplatePart,
@@ -77,25 +68,18 @@ export default function ZoomOutToolbar({
77
68
  };
78
69
  }, [clientId]);
79
70
  const {
80
- blockMovingMode,
81
71
  isBlockTemplatePart,
82
72
  isNextBlockTemplatePart,
83
73
  isPrevBlockTemplatePart,
84
74
  canRemove,
85
- canMove,
86
- setIsInserterOpened
75
+ canMove
87
76
  } = selected;
88
77
  const {
89
- removeBlock,
90
- __unstableSetEditorMode,
91
- resetZoomLevel
92
- } = unlock(useDispatch(blockEditorStore));
93
- const classNames = clsx('zoom-out-toolbar', {
94
- 'is-block-moving-mode': !!blockMovingMode
95
- });
78
+ removeBlock
79
+ } = useDispatch(blockEditorStore);
96
80
  const showBlockDraggable = canMove && !isBlockTemplatePart;
97
81
  return /*#__PURE__*/_jsxs(NavigableToolbar, {
98
- className: classNames
82
+ className: "zoom-out-toolbar"
99
83
  /* translators: accessibility text for the block toolbar */,
100
84
  "aria-label": __('Block tools')
101
85
  // The variant is applied as "toolbar" when undefined, which is the black border style of the dropdown from the toolbar popover.
@@ -126,25 +110,13 @@ export default function ZoomOutToolbar({
126
110
  }), canMove && canRemove && /*#__PURE__*/_jsx(Shuffle, {
127
111
  clientId: clientId,
128
112
  as: ToolbarButton
129
- }), !isBlockTemplatePart && /*#__PURE__*/_jsx(ToolbarButton, {
130
- className: "zoom-out-toolbar-button",
131
- icon: edit,
132
- label: __('Edit'),
133
- onClick: () => {
134
- // Setting may be undefined.
135
- if (typeof setIsInserterOpened === 'function') {
136
- setIsInserterOpened(false);
137
- }
138
- __unstableSetEditorMode('edit');
139
- resetZoomLevel();
140
- __unstableContentRef.current?.focus();
141
- }
142
113
  }), canRemove && !isBlockTemplatePart && /*#__PURE__*/_jsx(ToolbarButton, {
143
114
  className: "zoom-out-toolbar-button",
144
115
  icon: trash,
145
116
  label: __('Delete'),
146
117
  onClick: () => {
147
118
  removeBlock(clientId);
119
+ __unstableContentRef.current?.focus();
148
120
  }
149
121
  })]
150
122
  });