@wordpress/block-editor 13.1.0 → 13.3.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 (437) hide show
  1. package/CHANGELOG.md +21 -17
  2. package/README.md +1 -2
  3. package/build/components/block-breadcrumb/index.js +12 -1
  4. package/build/components/block-breadcrumb/index.js.map +1 -1
  5. package/build/components/block-lock/modal.js +67 -67
  6. package/build/components/block-lock/modal.js.map +1 -1
  7. package/build/components/block-lock/toolbar.js +0 -1
  8. package/build/components/block-lock/toolbar.js.map +1 -1
  9. package/build/components/block-mover/button.js +1 -1
  10. package/build/components/block-mover/button.js.map +1 -1
  11. package/build/components/block-mover/index.js +12 -6
  12. package/build/components/block-mover/index.js.map +1 -1
  13. package/build/components/block-pattern-setup/setup-toolbar.js +2 -2
  14. package/build/components/block-pattern-setup/setup-toolbar.js.map +1 -1
  15. package/build/components/block-patterns-paging/index.js +5 -7
  16. package/build/components/block-patterns-paging/index.js.map +1 -1
  17. package/build/components/block-quick-navigation/index.js +20 -17
  18. package/build/components/block-quick-navigation/index.js.map +1 -1
  19. package/build/components/block-rename/modal.js +4 -12
  20. package/build/components/block-rename/modal.js.map +1 -1
  21. package/build/components/block-toolbar/shuffle.js +4 -1
  22. package/build/components/block-toolbar/shuffle.js.map +1 -1
  23. package/build/components/block-tools/block-selection-button.js +7 -58
  24. package/build/components/block-tools/block-selection-button.js.map +1 -1
  25. package/build/components/block-tools/block-toolbar-breadcrumb.js +9 -2
  26. package/build/components/block-tools/block-toolbar-breadcrumb.js.map +1 -1
  27. package/build/components/block-tools/index.js +14 -1
  28. package/build/components/block-tools/index.js.map +1 -1
  29. package/build/components/block-tools/use-show-block-tools.js +4 -2
  30. package/build/components/block-tools/use-show-block-tools.js.map +1 -1
  31. package/build/components/block-tools/zoom-out-mode-inserters.js +5 -4
  32. package/build/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
  33. package/build/components/block-tools/zoom-out-popover.js +57 -0
  34. package/build/components/block-tools/zoom-out-popover.js.map +1 -0
  35. package/build/components/block-tools/zoom-out-toolbar.js +138 -0
  36. package/build/components/block-tools/zoom-out-toolbar.js.map +1 -0
  37. package/build/components/button-block-appender/index.js +3 -1
  38. package/build/components/button-block-appender/index.js.map +1 -1
  39. package/build/components/child-layout-control/index.js +193 -127
  40. package/build/components/child-layout-control/index.js.map +1 -1
  41. package/build/components/date-format-picker/index.js +10 -1
  42. package/build/components/date-format-picker/index.js.map +1 -1
  43. package/build/components/dimensions-tool/index.js +6 -4
  44. package/build/components/dimensions-tool/index.js.map +1 -1
  45. package/build/components/font-appearance-control/index.js +26 -61
  46. package/build/components/font-appearance-control/index.js.map +1 -1
  47. package/build/components/global-styles/background-panel.js +178 -116
  48. package/build/components/global-styles/background-panel.js.map +1 -1
  49. package/build/components/global-styles/border-panel.js +2 -1
  50. package/build/components/global-styles/border-panel.js.map +1 -1
  51. package/build/components/global-styles/color-panel.js +2 -1
  52. package/build/components/global-styles/color-panel.js.map +1 -1
  53. package/build/components/global-styles/dimensions-panel.js +2 -1
  54. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  55. package/build/components/global-styles/filters-panel.js +2 -1
  56. package/build/components/global-styles/filters-panel.js.map +1 -1
  57. package/build/components/global-styles/hooks.js +8 -0
  58. package/build/components/global-styles/hooks.js.map +1 -1
  59. package/build/components/global-styles/image-settings-panel.js +2 -1
  60. package/build/components/global-styles/image-settings-panel.js.map +1 -1
  61. package/build/components/global-styles/typography-panel.js +50 -12
  62. package/build/components/global-styles/typography-panel.js.map +1 -1
  63. package/build/components/global-styles/typography-utils.js +50 -0
  64. package/build/components/global-styles/typography-utils.js.map +1 -1
  65. package/build/components/global-styles/use-global-styles-output.js +25 -9
  66. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  67. package/build/components/global-styles/utils.js +17 -7
  68. package/build/components/global-styles/utils.js.map +1 -1
  69. package/build/components/grid/grid-item-movers.js +94 -0
  70. package/build/components/grid/grid-item-movers.js.map +1 -0
  71. package/build/components/{grid-visualizer → grid}/grid-item-resizer.js +18 -56
  72. package/build/components/grid/grid-item-resizer.js.map +1 -0
  73. package/build/components/grid/grid-visualizer.js +305 -0
  74. package/build/components/grid/grid-visualizer.js.map +1 -0
  75. package/build/components/{grid-visualizer → grid}/index.js +14 -0
  76. package/build/components/grid/index.js.map +1 -0
  77. package/build/components/grid/use-get-number-of-blocks-before-cell.js +40 -0
  78. package/build/components/grid/use-get-number-of-blocks-before-cell.js.map +1 -0
  79. package/build/components/grid/use-grid-layout-sync.js +169 -0
  80. package/build/components/grid/use-grid-layout-sync.js.map +1 -0
  81. package/build/components/grid/utils.js +145 -0
  82. package/build/components/grid/utils.js.map +1 -0
  83. package/build/components/image-editor/aspect-ratio-dropdown.js +0 -1
  84. package/build/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
  85. package/build/components/inner-blocks/index.js +1 -1
  86. package/build/components/inner-blocks/index.js.map +1 -1
  87. package/build/components/inserter/block-patterns-tab/pattern-category-preview-panel.js +1 -19
  88. package/build/components/inserter/block-patterns-tab/pattern-category-preview-panel.js.map +1 -1
  89. package/build/components/inserter/menu.js +26 -4
  90. package/build/components/inserter/menu.js.map +1 -1
  91. package/build/components/inserter/quick-inserter.js +2 -1
  92. package/build/components/inserter/quick-inserter.js.map +1 -1
  93. package/build/components/inspector-controls/block-support-tools-panel.js +2 -1
  94. package/build/components/inspector-controls/block-support-tools-panel.js.map +1 -1
  95. package/build/components/link-control/link-preview.js +1 -1
  96. package/build/components/link-control/link-preview.js.map +1 -1
  97. package/build/components/media-placeholder/index.js +19 -23
  98. package/build/components/media-placeholder/index.js.map +1 -1
  99. package/build/components/navigable-toolbar/index.js +3 -1
  100. package/build/components/navigable-toolbar/index.js.map +1 -1
  101. package/build/components/rich-text/event-listeners/input-rules.js +1 -0
  102. package/build/components/rich-text/event-listeners/input-rules.js.map +1 -1
  103. package/build/components/rich-text/index.native.js +10 -4
  104. package/build/components/rich-text/index.native.js.map +1 -1
  105. package/build/components/rich-text/native/index.native.js +14 -0
  106. package/build/components/rich-text/native/index.native.js.map +1 -1
  107. package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js +5 -1
  108. package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
  109. package/build/components/tabbed-sidebar/index.js +66 -0
  110. package/build/components/tabbed-sidebar/index.js.map +1 -0
  111. package/build/components/url-popover/index.js +3 -0
  112. package/build/components/url-popover/index.js.map +1 -1
  113. package/build/hooks/background.js +26 -4
  114. package/build/hooks/background.js.map +1 -1
  115. package/build/hooks/block-hooks.js +11 -17
  116. package/build/hooks/block-hooks.js.map +1 -1
  117. package/build/hooks/block-style-variation.js +195 -11
  118. package/build/hooks/block-style-variation.js.map +1 -1
  119. package/build/hooks/duotone.js +16 -11
  120. package/build/hooks/duotone.js.map +1 -1
  121. package/build/hooks/grid-visualizer.js +65 -0
  122. package/build/hooks/grid-visualizer.js.map +1 -0
  123. package/build/hooks/index.js +15 -2
  124. package/build/hooks/index.js.map +1 -1
  125. package/build/hooks/layout-child.js +65 -40
  126. package/build/hooks/layout-child.js.map +1 -1
  127. package/build/hooks/position.js +2 -9
  128. package/build/hooks/position.js.map +1 -1
  129. package/build/hooks/use-bindings-attributes.js +16 -6
  130. package/build/hooks/use-bindings-attributes.js.map +1 -1
  131. package/build/hooks/utils.js +5 -2
  132. package/build/hooks/utils.js.map +1 -1
  133. package/build/layouts/constrained.js +44 -2
  134. package/build/layouts/constrained.js.map +1 -1
  135. package/build/layouts/grid.js +92 -76
  136. package/build/layouts/grid.js.map +1 -1
  137. package/build/lock-unlock.js +1 -1
  138. package/build/lock-unlock.js.map +1 -1
  139. package/build/private-apis.js +6 -1
  140. package/build/private-apis.js.map +1 -1
  141. package/build/store/actions.js +17 -1
  142. package/build/store/actions.js.map +1 -1
  143. package/build/store/defaults.js +0 -2
  144. package/build/store/defaults.js.map +1 -1
  145. package/build/store/defaults.native.js +0 -3
  146. package/build/store/defaults.native.js.map +1 -1
  147. package/build/store/private-keys.js +2 -1
  148. package/build/store/private-keys.js.map +1 -1
  149. package/build/utils/format-font-style.js +45 -0
  150. package/build/utils/format-font-style.js.map +1 -0
  151. package/build/utils/format-font-weight.js +68 -0
  152. package/build/utils/format-font-weight.js.map +1 -0
  153. package/build/utils/get-editor-region.js +34 -0
  154. package/build/utils/get-editor-region.js.map +1 -0
  155. package/build/utils/get-font-styles-and-weights.js +167 -0
  156. package/build/utils/get-font-styles-and-weights.js.map +1 -0
  157. package/build/utils/pasting.js +5 -13
  158. package/build/utils/pasting.js.map +1 -1
  159. package/build-module/components/block-breadcrumb/index.js +12 -1
  160. package/build-module/components/block-breadcrumb/index.js.map +1 -1
  161. package/build-module/components/block-lock/modal.js +67 -67
  162. package/build-module/components/block-lock/modal.js.map +1 -1
  163. package/build-module/components/block-lock/toolbar.js +0 -1
  164. package/build-module/components/block-lock/toolbar.js.map +1 -1
  165. package/build-module/components/block-mover/button.js +1 -1
  166. package/build-module/components/block-mover/button.js.map +1 -1
  167. package/build-module/components/block-mover/index.js +12 -6
  168. package/build-module/components/block-mover/index.js.map +1 -1
  169. package/build-module/components/block-pattern-setup/setup-toolbar.js +2 -2
  170. package/build-module/components/block-pattern-setup/setup-toolbar.js.map +1 -1
  171. package/build-module/components/block-patterns-paging/index.js +5 -7
  172. package/build-module/components/block-patterns-paging/index.js.map +1 -1
  173. package/build-module/components/block-quick-navigation/index.js +20 -17
  174. package/build-module/components/block-quick-navigation/index.js.map +1 -1
  175. package/build-module/components/block-rename/modal.js +5 -13
  176. package/build-module/components/block-rename/modal.js.map +1 -1
  177. package/build-module/components/block-toolbar/shuffle.js +4 -1
  178. package/build-module/components/block-toolbar/shuffle.js.map +1 -1
  179. package/build-module/components/block-tools/block-selection-button.js +10 -61
  180. package/build-module/components/block-tools/block-selection-button.js.map +1 -1
  181. package/build-module/components/block-tools/block-toolbar-breadcrumb.js +9 -2
  182. package/build-module/components/block-tools/block-toolbar-breadcrumb.js.map +1 -1
  183. package/build-module/components/block-tools/index.js +14 -1
  184. package/build-module/components/block-tools/index.js.map +1 -1
  185. package/build-module/components/block-tools/use-show-block-tools.js +4 -2
  186. package/build-module/components/block-tools/use-show-block-tools.js.map +1 -1
  187. package/build-module/components/block-tools/zoom-out-mode-inserters.js +5 -4
  188. package/build-module/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
  189. package/build-module/components/block-tools/zoom-out-popover.js +48 -0
  190. package/build-module/components/block-tools/zoom-out-popover.js.map +1 -0
  191. package/build-module/components/block-tools/zoom-out-toolbar.js +131 -0
  192. package/build-module/components/block-tools/zoom-out-toolbar.js.map +1 -0
  193. package/build-module/components/button-block-appender/index.js +3 -1
  194. package/build-module/components/button-block-appender/index.js.map +1 -1
  195. package/build-module/components/child-layout-control/index.js +194 -128
  196. package/build-module/components/child-layout-control/index.js.map +1 -1
  197. package/build-module/components/date-format-picker/index.js +11 -3
  198. package/build-module/components/date-format-picker/index.js.map +1 -1
  199. package/build-module/components/dimensions-tool/index.js +6 -4
  200. package/build-module/components/dimensions-tool/index.js.map +1 -1
  201. package/build-module/components/font-appearance-control/index.js +28 -63
  202. package/build-module/components/font-appearance-control/index.js.map +1 -1
  203. package/build-module/components/global-styles/background-panel.js +181 -119
  204. package/build-module/components/global-styles/background-panel.js.map +1 -1
  205. package/build-module/components/global-styles/border-panel.js +3 -2
  206. package/build-module/components/global-styles/border-panel.js.map +1 -1
  207. package/build-module/components/global-styles/color-panel.js +3 -2
  208. package/build-module/components/global-styles/color-panel.js.map +1 -1
  209. package/build-module/components/global-styles/dimensions-panel.js +3 -2
  210. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  211. package/build-module/components/global-styles/filters-panel.js +3 -2
  212. package/build-module/components/global-styles/filters-panel.js.map +1 -1
  213. package/build-module/components/global-styles/hooks.js +8 -0
  214. package/build-module/components/global-styles/hooks.js.map +1 -1
  215. package/build-module/components/global-styles/image-settings-panel.js +3 -2
  216. package/build-module/components/global-styles/image-settings-panel.js.map +1 -1
  217. package/build-module/components/global-styles/typography-panel.js +52 -14
  218. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  219. package/build-module/components/global-styles/typography-utils.js +48 -0
  220. package/build-module/components/global-styles/typography-utils.js.map +1 -1
  221. package/build-module/components/global-styles/use-global-styles-output.js +25 -9
  222. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  223. package/build-module/components/global-styles/utils.js +15 -6
  224. package/build-module/components/global-styles/utils.js.map +1 -1
  225. package/build-module/components/grid/grid-item-movers.js +87 -0
  226. package/build-module/components/grid/grid-item-movers.js.map +1 -0
  227. package/build-module/components/{grid-visualizer → grid}/grid-item-resizer.js +13 -51
  228. package/build-module/components/grid/grid-item-resizer.js.map +1 -0
  229. package/build-module/components/grid/grid-visualizer.js +297 -0
  230. package/build-module/components/grid/grid-visualizer.js.map +1 -0
  231. package/build-module/components/grid/index.js +5 -0
  232. package/build-module/components/grid/index.js.map +1 -0
  233. package/build-module/components/grid/use-get-number-of-blocks-before-cell.js +33 -0
  234. package/build-module/components/grid/use-get-number-of-blocks-before-cell.js.map +1 -0
  235. package/build-module/components/grid/use-grid-layout-sync.js +162 -0
  236. package/build-module/components/grid/use-grid-layout-sync.js.map +1 -0
  237. package/build-module/components/grid/utils.js +131 -0
  238. package/build-module/components/grid/utils.js.map +1 -0
  239. package/build-module/components/image-editor/aspect-ratio-dropdown.js +0 -1
  240. package/build-module/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
  241. package/build-module/components/inner-blocks/index.js +1 -1
  242. package/build-module/components/inner-blocks/index.js.map +1 -1
  243. package/build-module/components/inserter/block-patterns-tab/pattern-category-preview-panel.js +1 -19
  244. package/build-module/components/inserter/block-patterns-tab/pattern-category-preview-panel.js.map +1 -1
  245. package/build-module/components/inserter/menu.js +26 -4
  246. package/build-module/components/inserter/menu.js.map +1 -1
  247. package/build-module/components/inserter/quick-inserter.js +2 -1
  248. package/build-module/components/inserter/quick-inserter.js.map +1 -1
  249. package/build-module/components/inspector-controls/block-support-tools-panel.js +3 -2
  250. package/build-module/components/inspector-controls/block-support-tools-panel.js.map +1 -1
  251. package/build-module/components/link-control/link-preview.js +1 -1
  252. package/build-module/components/link-control/link-preview.js.map +1 -1
  253. package/build-module/components/media-placeholder/index.js +19 -23
  254. package/build-module/components/media-placeholder/index.js.map +1 -1
  255. package/build-module/components/navigable-toolbar/index.js +3 -1
  256. package/build-module/components/navigable-toolbar/index.js.map +1 -1
  257. package/build-module/components/rich-text/event-listeners/input-rules.js +1 -1
  258. package/build-module/components/rich-text/event-listeners/input-rules.js.map +1 -1
  259. package/build-module/components/rich-text/index.native.js +11 -5
  260. package/build-module/components/rich-text/index.native.js.map +1 -1
  261. package/build-module/components/rich-text/native/index.native.js +14 -0
  262. package/build-module/components/rich-text/native/index.native.js.map +1 -1
  263. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js +5 -1
  264. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
  265. package/build-module/components/tabbed-sidebar/index.js +60 -0
  266. package/build-module/components/tabbed-sidebar/index.js.map +1 -0
  267. package/build-module/components/url-popover/index.js +3 -0
  268. package/build-module/components/url-popover/index.js.map +1 -1
  269. package/build-module/hooks/background.js +26 -4
  270. package/build-module/hooks/background.js.map +1 -1
  271. package/build-module/hooks/block-hooks.js +11 -17
  272. package/build-module/hooks/block-hooks.js.map +1 -1
  273. package/build-module/hooks/block-style-variation.js +193 -11
  274. package/build-module/hooks/block-style-variation.js.map +1 -1
  275. package/build-module/hooks/duotone.js +16 -11
  276. package/build-module/hooks/duotone.js.map +1 -1
  277. package/build-module/hooks/grid-visualizer.js +64 -0
  278. package/build-module/hooks/grid-visualizer.js.map +1 -0
  279. package/build-module/hooks/index.js +3 -0
  280. package/build-module/hooks/index.js.map +1 -1
  281. package/build-module/hooks/layout-child.js +63 -38
  282. package/build-module/hooks/layout-child.js.map +1 -1
  283. package/build-module/hooks/position.js +2 -9
  284. package/build-module/hooks/position.js.map +1 -1
  285. package/build-module/hooks/use-bindings-attributes.js +16 -6
  286. package/build-module/hooks/use-bindings-attributes.js.map +1 -1
  287. package/build-module/hooks/utils.js +5 -2
  288. package/build-module/hooks/utils.js.map +1 -1
  289. package/build-module/layouts/constrained.js +44 -2
  290. package/build-module/layouts/constrained.js.map +1 -1
  291. package/build-module/layouts/grid.js +92 -76
  292. package/build-module/layouts/grid.js.map +1 -1
  293. package/build-module/lock-unlock.js +1 -1
  294. package/build-module/lock-unlock.js.map +1 -1
  295. package/build-module/private-apis.js +8 -3
  296. package/build-module/private-apis.js.map +1 -1
  297. package/build-module/store/actions.js +17 -1
  298. package/build-module/store/actions.js.map +1 -1
  299. package/build-module/store/defaults.js +0 -2
  300. package/build-module/store/defaults.js.map +1 -1
  301. package/build-module/store/defaults.native.js +0 -3
  302. package/build-module/store/defaults.native.js.map +1 -1
  303. package/build-module/store/private-keys.js +1 -0
  304. package/build-module/store/private-keys.js.map +1 -1
  305. package/build-module/utils/format-font-style.js +39 -0
  306. package/build-module/utils/format-font-style.js.map +1 -0
  307. package/build-module/utils/format-font-weight.js +62 -0
  308. package/build-module/utils/format-font-weight.js.map +1 -0
  309. package/build-module/utils/get-editor-region.js +28 -0
  310. package/build-module/utils/get-editor-region.js.map +1 -0
  311. package/build-module/utils/get-font-styles-and-weights.js +160 -0
  312. package/build-module/utils/get-font-styles-and-weights.js.map +1 -0
  313. package/build-module/utils/pasting.js +5 -13
  314. package/build-module/utils/pasting.js.map +1 -1
  315. package/build-style/content-rtl.css +1 -0
  316. package/build-style/content.css +1 -0
  317. package/build-style/style-rtl.css +238 -106
  318. package/build-style/style.css +238 -106
  319. package/package.json +32 -32
  320. package/src/components/block-breadcrumb/index.js +16 -1
  321. package/src/components/block-lock/modal.js +95 -82
  322. package/src/components/block-lock/style.scss +11 -1
  323. package/src/components/block-lock/toolbar.js +0 -1
  324. package/src/components/block-mover/button.js +1 -1
  325. package/src/components/block-mover/index.js +37 -24
  326. package/src/components/block-pattern-setup/setup-toolbar.js +2 -2
  327. package/src/components/block-patterns-paging/index.js +8 -11
  328. package/src/components/block-patterns-paging/style.scss +18 -0
  329. package/src/components/block-quick-navigation/index.js +21 -28
  330. package/src/components/block-rename/modal.js +2 -8
  331. package/src/components/block-switcher/test/index.js +6 -6
  332. package/src/components/block-toolbar/shuffle.js +4 -1
  333. package/src/components/block-toolbar/style.scss +1 -11
  334. package/src/components/block-tools/block-selection-button.js +11 -83
  335. package/src/components/block-tools/block-toolbar-breadcrumb.js +9 -4
  336. package/src/components/block-tools/index.js +21 -1
  337. package/src/components/block-tools/style.scss +15 -0
  338. package/src/components/block-tools/use-show-block-tools.js +14 -6
  339. package/src/components/block-tools/zoom-out-mode-inserters.js +5 -4
  340. package/src/components/block-tools/zoom-out-popover.js +49 -0
  341. package/src/components/block-tools/zoom-out-toolbar.js +140 -0
  342. package/src/components/button-block-appender/index.js +2 -1
  343. package/src/components/child-layout-control/index.js +243 -160
  344. package/src/components/date-format-picker/index.js +10 -1
  345. package/src/components/date-format-picker/style.scss +0 -9
  346. package/src/components/dimensions-tool/index.js +97 -89
  347. package/src/components/font-appearance-control/index.js +29 -83
  348. package/src/components/font-appearance-control/style.scss +3 -5
  349. package/src/components/global-styles/background-panel.js +249 -170
  350. package/src/components/global-styles/border-panel.js +3 -2
  351. package/src/components/global-styles/color-panel.js +3 -2
  352. package/src/components/global-styles/dimensions-panel.js +3 -2
  353. package/src/components/global-styles/filters-panel.js +3 -2
  354. package/src/components/global-styles/hooks.js +9 -0
  355. package/src/components/global-styles/image-settings-panel.js +3 -2
  356. package/src/components/global-styles/style.scss +105 -20
  357. package/src/components/global-styles/test/typography-utils.js +269 -0
  358. package/src/components/global-styles/test/use-global-styles-output.js +38 -3
  359. package/src/components/global-styles/typography-panel.js +49 -12
  360. package/src/components/global-styles/typography-utils.js +63 -0
  361. package/src/components/global-styles/use-global-styles-output.js +25 -9
  362. package/src/components/global-styles/utils.js +17 -6
  363. package/src/components/grid/grid-item-movers.js +112 -0
  364. package/src/components/{grid-visualizer → grid}/grid-item-resizer.js +15 -52
  365. package/src/components/grid/grid-visualizer.js +384 -0
  366. package/src/components/grid/index.js +4 -0
  367. package/src/components/grid/style.scss +98 -0
  368. package/src/components/grid/use-get-number-of-blocks-before-cell.js +30 -0
  369. package/src/components/grid/use-grid-layout-sync.js +170 -0
  370. package/src/components/grid/utils.js +178 -0
  371. package/src/components/iframe/content.scss +1 -0
  372. package/src/components/image-editor/aspect-ratio-dropdown.js +0 -1
  373. package/src/components/inner-blocks/index.js +4 -1
  374. package/src/components/inserter/block-patterns-tab/pattern-category-preview-panel.js +1 -16
  375. package/src/components/inserter/menu.js +47 -13
  376. package/src/components/inserter/quick-inserter.js +6 -1
  377. package/src/components/inserter/style.scss +1 -49
  378. package/src/components/inspector-controls/block-support-tools-panel.js +3 -3
  379. package/src/components/link-control/link-preview.js +1 -1
  380. package/src/components/media-placeholder/index.js +22 -32
  381. package/src/components/navigable-toolbar/index.js +3 -1
  382. package/src/components/rich-text/event-listeners/input-rules.js +1 -1
  383. package/src/components/rich-text/index.native.js +10 -8
  384. package/src/components/rich-text/native/index.native.js +17 -0
  385. package/src/components/spacing-sizes-control/input-controls/spacing-input-control.js +6 -1
  386. package/src/components/tabbed-sidebar/README.md +76 -0
  387. package/src/components/tabbed-sidebar/index.js +70 -0
  388. package/src/components/tabbed-sidebar/style.scss +53 -0
  389. package/src/components/url-popover/index.js +3 -0
  390. package/src/hooks/background.js +25 -10
  391. package/src/hooks/block-hooks.js +9 -16
  392. package/src/hooks/block-style-variation.js +226 -9
  393. package/src/hooks/duotone.js +16 -12
  394. package/src/hooks/grid-visualizer.js +64 -0
  395. package/src/hooks/index.js +3 -0
  396. package/src/hooks/layout-child.js +75 -39
  397. package/src/hooks/position.js +3 -10
  398. package/src/hooks/test/get-variation-styles-with-ref-values.js +91 -0
  399. package/src/hooks/use-bindings-attributes.js +18 -4
  400. package/src/hooks/utils.js +5 -1
  401. package/src/layouts/constrained.js +43 -2
  402. package/src/layouts/grid.js +175 -88
  403. package/src/lock-unlock.js +1 -1
  404. package/src/private-apis.js +12 -1
  405. package/src/store/actions.js +21 -1
  406. package/src/store/defaults.js +0 -2
  407. package/src/store/defaults.native.js +0 -3
  408. package/src/store/private-keys.js +1 -0
  409. package/src/style.scss +2 -2
  410. package/src/utils/format-font-style.js +40 -0
  411. package/src/utils/format-font-weight.js +63 -0
  412. package/src/utils/get-editor-region.js +31 -0
  413. package/src/utils/get-font-styles-and-weights.js +191 -0
  414. package/src/utils/pasting.js +5 -12
  415. package/src/utils/test/format-font-style.js +34 -0
  416. package/src/utils/test/format-font-weight.js +66 -0
  417. package/src/utils/test/get-font-styles-and-weights.js +513 -0
  418. package/tsconfig.tsbuildinfo +1 -1
  419. package/build/components/grid-visualizer/grid-item-resizer.js.map +0 -1
  420. package/build/components/grid-visualizer/grid-visualizer.js +0 -92
  421. package/build/components/grid-visualizer/grid-visualizer.js.map +0 -1
  422. package/build/components/grid-visualizer/index.js.map +0 -1
  423. package/build/components/grid-visualizer/utils.js +0 -10
  424. package/build/components/grid-visualizer/utils.js.map +0 -1
  425. package/build-module/components/grid-visualizer/grid-item-resizer.js.map +0 -1
  426. package/build-module/components/grid-visualizer/grid-visualizer.js +0 -84
  427. package/build-module/components/grid-visualizer/grid-visualizer.js.map +0 -1
  428. package/build-module/components/grid-visualizer/index.js +0 -3
  429. package/build-module/components/grid-visualizer/index.js.map +0 -1
  430. package/build-module/components/grid-visualizer/utils.js +0 -4
  431. package/build-module/components/grid-visualizer/utils.js.map +0 -1
  432. package/src/components/grid-visualizer/grid-visualizer.js +0 -101
  433. package/src/components/grid-visualizer/index.js +0 -2
  434. package/src/components/grid-visualizer/style.scss +0 -34
  435. package/src/components/grid-visualizer/utils.js +0 -5
  436. package/src/hooks/position.scss +0 -18
  437. /package/src/components/font-sizes/{README.MD → README.md} +0 -0
@@ -6,10 +6,10 @@ import clsx from 'clsx';
6
6
  /**
7
7
  * WordPress dependencies
8
8
  */
9
- import { dragHandle, trash } from '@wordpress/icons';
10
- import { Button, Flex, FlexItem, ToolbarButton } from '@wordpress/components';
9
+ import { dragHandle } from '@wordpress/icons';
10
+ import { Button, Flex, FlexItem } from '@wordpress/components';
11
11
  import { useSelect, useDispatch } from '@wordpress/data';
12
- import { useEffect, useRef } from '@wordpress/element';
12
+ import { forwardRef, useEffect } from '@wordpress/element';
13
13
  import {
14
14
  BACKSPACE,
15
15
  DELETE,
@@ -38,8 +38,6 @@ import BlockIcon from '../block-icon';
38
38
  import { store as blockEditorStore } from '../../store';
39
39
  import BlockDraggable from '../block-draggable';
40
40
  import { __unstableUseBlockElement as useBlockElement } from '../block-list/use-block-props/use-block-refs';
41
- import BlockMover from '../block-mover';
42
- import Shuffle from '../block-toolbar/shuffle';
43
41
 
44
42
  /**
45
43
  * Block selection button component, displaying the label of the block. If the block
@@ -48,10 +46,11 @@ import Shuffle from '../block-toolbar/shuffle';
48
46
  *
49
47
  * @param {string} props Component props.
50
48
  * @param {string} props.clientId Client ID of block.
49
+ * @param {Object} ref Reference to the component.
51
50
  *
52
51
  * @return {Component} The component to be rendered.
53
52
  */
54
- function BlockSelectionButton( { clientId, rootClientId } ) {
53
+ function BlockSelectionButton( { clientId, rootClientId }, ref ) {
55
54
  const selected = useSelect(
56
55
  ( select ) => {
57
56
  const {
@@ -62,7 +61,6 @@ function BlockSelectionButton( { clientId, rootClientId } ) {
62
61
  __unstableGetEditorMode,
63
62
  getNextBlockClientId,
64
63
  getPreviousBlockClientId,
65
- canRemoveBlock,
66
64
  canMoveBlock,
67
65
  } = select( blockEditorStore );
68
66
  const { getActiveBlockVariation, getBlockType } =
@@ -73,26 +71,6 @@ function BlockSelectionButton( { clientId, rootClientId } ) {
73
71
  const orientation =
74
72
  getBlockListSettings( rootClientId )?.orientation;
75
73
  const match = getActiveBlockVariation( name, attributes );
76
- const isBlockTemplatePart =
77
- blockType?.name === 'core/template-part';
78
-
79
- let isNextBlockTemplatePart = false;
80
- const nextClientId = getNextBlockClientId();
81
- if ( nextClientId ) {
82
- const { name: nextName } = getBlock( nextClientId );
83
- const nextBlockType = getBlockType( nextName );
84
- isNextBlockTemplatePart =
85
- nextBlockType?.name === 'core/template-part';
86
- }
87
-
88
- let isPrevBlockTemplatePart = false;
89
- const prevClientId = getPreviousBlockClientId();
90
- if ( prevClientId ) {
91
- const { name: prevName } = getBlock( prevClientId );
92
- const prevBlockType = getBlockType( prevName );
93
- isPrevBlockTemplatePart =
94
- prevBlockType?.name === 'core/template-part';
95
- }
96
74
 
97
75
  return {
98
76
  blockMovingMode: hasBlockMovingClientId(),
@@ -104,28 +82,15 @@ function BlockSelectionButton( { clientId, rootClientId } ) {
104
82
  index + 1,
105
83
  orientation
106
84
  ),
107
- isBlockTemplatePart,
108
- isNextBlockTemplatePart,
109
- isPrevBlockTemplatePart,
110
- canRemove: canRemoveBlock( clientId ),
111
- canMove: canMoveBlock( clientId ),
85
+ canMove: canMoveBlock( clientId, rootClientId ),
86
+ getNextBlockClientId,
87
+ getPreviousBlockClientId,
112
88
  };
113
89
  },
114
90
  [ clientId, rootClientId ]
115
91
  );
116
- const {
117
- label,
118
- icon,
119
- blockMovingMode,
120
- editorMode,
121
- isBlockTemplatePart,
122
- isNextBlockTemplatePart,
123
- isPrevBlockTemplatePart,
124
- canRemove,
125
- canMove,
126
- } = selected;
92
+ const { label, icon, blockMovingMode, editorMode, canMove } = selected;
127
93
  const { setNavigationMode, removeBlock } = useDispatch( blockEditorStore );
128
- const ref = useRef();
129
94
 
130
95
  // Focus the breadcrumb in navigation mode.
131
96
  useEffect( () => {
@@ -164,11 +129,6 @@ function BlockSelectionButton( { clientId, rootClientId } ) {
164
129
  const isEnter = keyCode === ENTER;
165
130
  const isSpace = keyCode === SPACE;
166
131
  const isShift = event.shiftKey;
167
- if ( isEscape && editorMode === 'navigation' ) {
168
- setNavigationMode( false );
169
- event.preventDefault();
170
- return;
171
- }
172
132
 
173
133
  if ( keyCode === BACKSPACE || keyCode === DELETE ) {
174
134
  removeBlock( clientId );
@@ -281,9 +241,7 @@ function BlockSelectionButton( { clientId, rootClientId } ) {
281
241
  );
282
242
 
283
243
  const dragHandleLabel = __( 'Drag' );
284
- const showBlockDraggable =
285
- ( canMove && editorMode === 'navigation' ) ||
286
- ( editorMode === 'zoom-out' && canMove && ! isBlockTemplatePart );
244
+ const showBlockDraggable = canMove && editorMode === 'navigation';
287
245
 
288
246
  return (
289
247
  <div className={ classNames }>
@@ -312,36 +270,6 @@ function BlockSelectionButton( { clientId, rootClientId } ) {
312
270
  </BlockDraggable>
313
271
  </FlexItem>
314
272
  ) }
315
- { editorMode === 'zoom-out' && ! isBlockTemplatePart && (
316
- <FlexItem>
317
- <BlockMover
318
- clientIds={ [ clientId ] }
319
- hideDragHandle
320
- isBlockMoverUpButtonDisabled={
321
- isPrevBlockTemplatePart
322
- }
323
- isBlockMoverDownButtonDisabled={
324
- isNextBlockTemplatePart
325
- }
326
- />
327
- </FlexItem>
328
- ) }
329
- { canMove && canRemove && editorMode === 'zoom-out' && (
330
- <Shuffle clientId={ clientId } as={ Button } />
331
- ) }
332
- { canRemove &&
333
- editorMode === 'zoom-out' &&
334
- ! isBlockTemplatePart && (
335
- <FlexItem>
336
- <ToolbarButton
337
- icon={ trash }
338
- label="Delete"
339
- onClick={ () => {
340
- removeBlock( clientId );
341
- } }
342
- />
343
- </FlexItem>
344
- ) }
345
273
  { editorMode === 'navigation' && (
346
274
  <FlexItem>
347
275
  <Button
@@ -368,4 +296,4 @@ function BlockSelectionButton( { clientId, rootClientId } ) {
368
296
  );
369
297
  }
370
298
 
371
- export default BlockSelectionButton;
299
+ export default forwardRef( BlockSelectionButton );
@@ -3,6 +3,11 @@
3
3
  */
4
4
  import clsx from 'clsx';
5
5
 
6
+ /**
7
+ * WordPress dependencies
8
+ */
9
+ import { forwardRef } from '@wordpress/element';
10
+
6
11
  /**
7
12
  * Internal dependencies
8
13
  */
@@ -11,10 +16,7 @@ import { PrivateBlockPopover } from '../block-popover';
11
16
  import useBlockToolbarPopoverProps from './use-block-toolbar-popover-props';
12
17
  import useSelectedBlockToolProps from './use-selected-block-tool-props';
13
18
 
14
- export default function BlockToolbarBreadcrumb( {
15
- clientId,
16
- __unstableContentRef,
17
- } ) {
19
+ function BlockToolbarBreadcrumb( { clientId, __unstableContentRef }, ref ) {
18
20
  const {
19
21
  capturingClientId,
20
22
  isInsertionPointVisible,
@@ -38,9 +40,12 @@ export default function BlockToolbarBreadcrumb( {
38
40
  { ...popoverProps }
39
41
  >
40
42
  <BlockSelectionButton
43
+ ref={ ref }
41
44
  clientId={ clientId }
42
45
  rootClientId={ rootClientId }
43
46
  />
44
47
  </PrivateBlockPopover>
45
48
  );
46
49
  }
50
+
51
+ export default forwardRef( BlockToolbarBreadcrumb );
@@ -20,11 +20,13 @@ import {
20
20
  } from './insertion-point';
21
21
  import BlockToolbarPopover from './block-toolbar-popover';
22
22
  import BlockToolbarBreadcrumb from './block-toolbar-breadcrumb';
23
+ import ZoomOutPopover from './zoom-out-popover';
23
24
  import { store as blockEditorStore } from '../../store';
24
25
  import usePopoverScroll from '../block-popover/use-popover-scroll';
25
26
  import ZoomOutModeInserters from './zoom-out-mode-inserters';
26
27
  import { useShowBlockTools } from './use-show-block-tools';
27
28
  import { unlock } from '../../lock-unlock';
29
+ import getEditorRegion from '../../utils/get-editor-region';
28
30
 
29
31
  function selector( select ) {
30
32
  const {
@@ -78,9 +80,11 @@ export default function BlockTools( {
78
80
  showEmptyBlockSideInserter,
79
81
  showBreadcrumb,
80
82
  showBlockToolbarPopover,
83
+ showZoomOutToolbar,
81
84
  } = useShowBlockTools();
82
85
 
83
86
  const {
87
+ clearSelectedBlock,
84
88
  duplicateBlocks,
85
89
  removeBlocks,
86
90
  replaceBlocks,
@@ -92,6 +96,8 @@ export default function BlockTools( {
92
96
  expandBlock,
93
97
  } = unlock( useDispatch( blockEditorStore ) );
94
98
 
99
+ const blockSelectionButtonRef = useRef();
100
+
95
101
  function onKeyDown( event ) {
96
102
  if ( event.defaultPrevented ) {
97
103
  return;
@@ -152,6 +158,13 @@ export default function BlockTools( {
152
158
  // block so that focus is directed back to the beginning of the selection.
153
159
  // In effect, to the user this feels like deselecting the multi-selection.
154
160
  selectBlock( clientIds[ 0 ] );
161
+ } else if (
162
+ clientIds.length === 1 &&
163
+ event.target === blockSelectionButtonRef?.current
164
+ ) {
165
+ event.preventDefault();
166
+ clearSelectedBlock();
167
+ getEditorRegion( __unstableContentRef.current )?.focus();
155
168
  }
156
169
  } else if ( isMatch( 'core/block-editor/collapse-list-view', event ) ) {
157
170
  // If focus is currently within a text field, such as a rich text block or other editable field,
@@ -182,7 +195,6 @@ export default function BlockTools( {
182
195
  }
183
196
  }
184
197
  }
185
-
186
198
  const blockToolbarRef = usePopoverScroll( __unstableContentRef );
187
199
  const blockToolbarAfterRef = usePopoverScroll( __unstableContentRef );
188
200
 
@@ -213,6 +225,14 @@ export default function BlockTools( {
213
225
 
214
226
  { showBreadcrumb && (
215
227
  <BlockToolbarBreadcrumb
228
+ ref={ blockSelectionButtonRef }
229
+ __unstableContentRef={ __unstableContentRef }
230
+ clientId={ clientId }
231
+ />
232
+ ) }
233
+
234
+ { showZoomOutToolbar && (
235
+ <ZoomOutPopover
216
236
  __unstableContentRef={ __unstableContentRef }
217
237
  clientId={ clientId }
218
238
  />
@@ -270,3 +270,18 @@
270
270
  top: 50%;
271
271
  left: 50%;
272
272
  }
273
+
274
+ .zoom-out-toolbar {
275
+
276
+ .block-editor-block-mover-button.block-editor-block-mover-button:focus-visible::before,
277
+ .zoom-out-toolbar-button:focus::before,
278
+ .block-editor-block-toolbar-shuffle:focus::before,
279
+ .block-selection-button_drag-handle:focus::before {
280
+ box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
281
+ }
282
+
283
+ .block-editor-block-mover {
284
+ background: none;
285
+ border: none;
286
+ }
287
+ }
@@ -41,18 +41,26 @@ export function useShowBlockTools() {
41
41
  const maybeShowBreadcrumb =
42
42
  hasSelectedBlock &&
43
43
  ! hasMultiSelection() &&
44
- ( editorMode === 'navigation' || editorMode === 'zoom-out' );
44
+ editorMode === 'navigation';
45
+
46
+ const _showBlockToolbarPopover =
47
+ editorMode !== 'zoom-out' &&
48
+ ! getSettings().hasFixedToolbar &&
49
+ ! _showEmptyBlockSideInserter &&
50
+ hasSelectedBlock &&
51
+ ! isEmptyDefaultBlock &&
52
+ ! maybeShowBreadcrumb;
45
53
 
46
54
  return {
47
55
  showEmptyBlockSideInserter: _showEmptyBlockSideInserter,
48
56
  showBreadcrumb:
49
57
  ! _showEmptyBlockSideInserter && maybeShowBreadcrumb,
50
- showBlockToolbarPopover:
51
- ! getSettings().hasFixedToolbar &&
58
+ showBlockToolbarPopover: _showBlockToolbarPopover,
59
+ showZoomOutToolbar:
60
+ editorMode === 'zoom-out' &&
52
61
  ! _showEmptyBlockSideInserter &&
53
- hasSelectedBlock &&
54
- ! isEmptyDefaultBlock &&
55
- ! maybeShowBreadcrumb,
62
+ ! maybeShowBreadcrumb &&
63
+ ! _showBlockToolbarPopover,
56
64
  };
57
65
  }, [] );
58
66
  }
@@ -21,9 +21,10 @@ function ZoomOutModeInserters() {
21
21
  sectionRootClientId,
22
22
  insertionPoint,
23
23
  setInserterIsOpened,
24
- selectedSection,
24
+ hasSelection,
25
25
  } = useSelect( ( select ) => {
26
- const { getSettings, getBlockOrder } = select( blockEditorStore );
26
+ const { getSettings, getBlockOrder, getSelectionStart } =
27
+ select( blockEditorStore );
27
28
  const { sectionRootClientId: root } = unlock( getSettings() );
28
29
  // To do: move ZoomOutModeInserters to core/editor.
29
30
  // Or we perhaps we should move the insertion point state to the
@@ -33,7 +34,7 @@ function ZoomOutModeInserters() {
33
34
  // eslint-disable-next-line @wordpress/data-no-store-string-literals
34
35
  const editor = select( 'core/editor' );
35
36
  return {
36
- selectedSection: editor.getSelectedBlock(),
37
+ hasSelection: !! getSelectionStart().clientId,
37
38
  blockOrder: getBlockOrder( root ),
38
39
  insertionPoint: unlock( editor ).getInsertionPoint(),
39
40
  sectionRootClientId: root,
@@ -63,7 +64,7 @@ function ZoomOutModeInserters() {
63
64
  };
64
65
  }, [] );
65
66
 
66
- if ( ! isReady || ! selectedSection ) {
67
+ if ( ! isReady || ! hasSelection ) {
67
68
  return null;
68
69
  }
69
70
 
@@ -0,0 +1,49 @@
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import clsx from 'clsx';
5
+ /**
6
+ * Internal dependencies
7
+ */
8
+ import BlockPopover from '../block-popover';
9
+ import useBlockToolbarPopoverProps from './use-block-toolbar-popover-props';
10
+ import useSelectedBlockToolProps from './use-selected-block-tool-props';
11
+ import ZoomOutToolbar from './zoom-out-toolbar';
12
+
13
+ export default function ZoomOutPopover( { clientId, __unstableContentRef } ) {
14
+ const {
15
+ capturingClientId,
16
+ isInsertionPointVisible,
17
+ lastClientId,
18
+ rootClientId,
19
+ } = useSelectedBlockToolProps( clientId );
20
+
21
+ const popoverProps = useBlockToolbarPopoverProps( {
22
+ contentElement: __unstableContentRef?.current,
23
+ clientId,
24
+ } );
25
+
26
+ // Override some of the popover props for the zoom-out toolbar.
27
+ const props = {
28
+ ...popoverProps,
29
+ placement: 'left-start',
30
+ flip: false,
31
+ };
32
+
33
+ return (
34
+ <BlockPopover
35
+ clientId={ capturingClientId || clientId }
36
+ bottomClientId={ lastClientId }
37
+ className={ clsx( 'zoom-out-toolbar-popover', {
38
+ 'is-insertion-point-visible': isInsertionPointVisible,
39
+ } ) }
40
+ resize={ false }
41
+ { ...props }
42
+ >
43
+ <ZoomOutToolbar
44
+ clientId={ clientId }
45
+ rootClientId={ rootClientId }
46
+ />
47
+ </BlockPopover>
48
+ );
49
+ }
@@ -0,0 +1,140 @@
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import clsx from 'clsx';
5
+
6
+ /**
7
+ * WordPress dependencies
8
+ */
9
+ import { dragHandle, trash } from '@wordpress/icons';
10
+ import { Button, ToolbarButton } from '@wordpress/components';
11
+ import { useSelect, useDispatch } from '@wordpress/data';
12
+ import { store as blocksStore } from '@wordpress/blocks';
13
+ import { __ } from '@wordpress/i18n';
14
+
15
+ /**
16
+ * Internal dependencies
17
+ */
18
+ import { store as blockEditorStore } from '../../store';
19
+ import BlockDraggable from '../block-draggable';
20
+ import BlockMover from '../block-mover';
21
+ import Shuffle from '../block-toolbar/shuffle';
22
+ import NavigableToolbar from '../navigable-toolbar';
23
+
24
+ export default function ZoomOutToolbar( { clientId, rootClientId } ) {
25
+ const selected = useSelect(
26
+ ( select ) => {
27
+ const {
28
+ getBlock,
29
+ hasBlockMovingClientId,
30
+ getNextBlockClientId,
31
+ getPreviousBlockClientId,
32
+ canRemoveBlock,
33
+ canMoveBlock,
34
+ } = select( blockEditorStore );
35
+ const { getBlockType } = select( blocksStore );
36
+ const { name } = getBlock( clientId );
37
+ const blockType = getBlockType( name );
38
+ const isBlockTemplatePart =
39
+ blockType?.name === 'core/template-part';
40
+
41
+ let isNextBlockTemplatePart = false;
42
+ const nextClientId = getNextBlockClientId();
43
+ if ( nextClientId ) {
44
+ const { name: nextName } = getBlock( nextClientId );
45
+ const nextBlockType = getBlockType( nextName );
46
+ isNextBlockTemplatePart =
47
+ nextBlockType?.name === 'core/template-part';
48
+ }
49
+
50
+ let isPrevBlockTemplatePart = false;
51
+ const prevClientId = getPreviousBlockClientId();
52
+ if ( prevClientId ) {
53
+ const { name: prevName } = getBlock( prevClientId );
54
+ const prevBlockType = getBlockType( prevName );
55
+ isPrevBlockTemplatePart =
56
+ prevBlockType?.name === 'core/template-part';
57
+ }
58
+
59
+ return {
60
+ blockMovingMode: hasBlockMovingClientId(),
61
+ isBlockTemplatePart,
62
+ isNextBlockTemplatePart,
63
+ isPrevBlockTemplatePart,
64
+ canRemove: canRemoveBlock( clientId, rootClientId ),
65
+ canMove: canMoveBlock( clientId, rootClientId ),
66
+ };
67
+ },
68
+ [ clientId, rootClientId ]
69
+ );
70
+
71
+ const {
72
+ blockMovingMode,
73
+ isBlockTemplatePart,
74
+ isNextBlockTemplatePart,
75
+ isPrevBlockTemplatePart,
76
+ canRemove,
77
+ canMove,
78
+ } = selected;
79
+
80
+ const { removeBlock } = useDispatch( blockEditorStore );
81
+
82
+ const classNames = clsx( 'zoom-out-toolbar', {
83
+ 'is-block-moving-mode': !! blockMovingMode,
84
+ } );
85
+
86
+ const showBlockDraggable = canMove && ! isBlockTemplatePart;
87
+
88
+ return (
89
+ <NavigableToolbar
90
+ className={ classNames }
91
+ /* translators: accessibility text for the block toolbar */
92
+ aria-label={ __( 'Block tools' ) }
93
+ // The variant is applied as "toolbar" when undefined, which is the black border style of the dropdown from the toolbar popover.
94
+ variant="unstyled"
95
+ orientation="vertical"
96
+ >
97
+ { showBlockDraggable && (
98
+ <BlockDraggable clientIds={ [ clientId ] }>
99
+ { ( draggableProps ) => (
100
+ <Button
101
+ icon={ dragHandle }
102
+ className="block-selection-button_drag-handle zoom-out-toolbar-button"
103
+ aria-hidden="true"
104
+ label={ __( 'Drag' ) }
105
+ iconSize={ 24 }
106
+ size="compact"
107
+ // Should not be able to tab to drag handle as this
108
+ // button can only be used with a pointer device.
109
+ tabIndex="-1"
110
+ { ...draggableProps }
111
+ />
112
+ ) }
113
+ </BlockDraggable>
114
+ ) }
115
+ { ! isBlockTemplatePart && (
116
+ <BlockMover
117
+ clientIds={ [ clientId ] }
118
+ hideDragHandle
119
+ isBlockMoverUpButtonDisabled={ isPrevBlockTemplatePart }
120
+ isBlockMoverDownButtonDisabled={ isNextBlockTemplatePart }
121
+ iconSize={ 24 }
122
+ size="compact"
123
+ />
124
+ ) }
125
+ { canMove && canRemove && (
126
+ <Shuffle clientId={ clientId } as={ ToolbarButton } />
127
+ ) }
128
+ { canRemove && ! isBlockTemplatePart && (
129
+ <ToolbarButton
130
+ className="zoom-out-toolbar-button"
131
+ icon={ trash }
132
+ label="Delete"
133
+ onClick={ () => {
134
+ removeBlock( clientId );
135
+ } }
136
+ />
137
+ ) }
138
+ </NavigableToolbar>
139
+ );
140
+ }
@@ -18,7 +18,7 @@ import deprecated from '@wordpress/deprecated';
18
18
  import Inserter from '../inserter';
19
19
 
20
20
  function ButtonBlockAppender(
21
- { rootClientId, className, onFocus, tabIndex },
21
+ { rootClientId, className, onFocus, tabIndex, onSelect },
22
22
  ref
23
23
  ) {
24
24
  return (
@@ -26,6 +26,7 @@ function ButtonBlockAppender(
26
26
  position="bottom center"
27
27
  rootClientId={ rootClientId }
28
28
  __experimentalIsQuick
29
+ onSelectOrClose={ onSelect }
29
30
  renderToggle={ ( {
30
31
  onToggle,
31
32
  disabled,