@wordpress/block-editor 8.4.0 → 8.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 (369) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/README.md +56 -19
  3. package/build/components/alignment-control/index.js +13 -6
  4. package/build/components/alignment-control/index.js.map +1 -1
  5. package/build/components/block-alignment-control/index.js +13 -6
  6. package/build/components/block-alignment-control/index.js.map +1 -1
  7. package/build/components/block-draggable/index.js +2 -3
  8. package/build/components/block-draggable/index.js.map +1 -1
  9. package/build/components/block-icon/index.js +4 -0
  10. package/build/components/block-icon/index.js.map +1 -1
  11. package/build/components/block-inspector/index.js +6 -1
  12. package/build/components/block-inspector/index.js.map +1 -1
  13. package/build/components/block-list/use-block-props/index.js +1 -6
  14. package/build/components/block-list/use-block-props/index.js.map +1 -1
  15. package/build/components/block-list/use-block-props/use-focus-first-element.js +14 -17
  16. package/build/components/block-list/use-block-props/use-focus-first-element.js.map +1 -1
  17. package/build/components/block-list/use-block-props/use-focus-handler.js +7 -1
  18. package/build/components/block-list/use-block-props/use-focus-handler.js.map +1 -1
  19. package/build/components/block-list-appender/index.js +6 -1
  20. package/build/components/block-list-appender/index.js.map +1 -1
  21. package/build/components/block-lock/menu-item.js +9 -0
  22. package/build/components/block-lock/menu-item.js.map +1 -1
  23. package/build/components/block-lock/modal.js +4 -13
  24. package/build/components/block-lock/modal.js.map +1 -1
  25. package/build/components/block-lock/toolbar.js +11 -3
  26. package/build/components/block-lock/toolbar.js.map +1 -1
  27. package/build/components/block-mover/index.js +4 -0
  28. package/build/components/block-mover/index.js.map +1 -1
  29. package/build/components/block-settings-menu/block-settings-dropdown.js +50 -5
  30. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  31. package/build/components/block-switcher/index.js +1 -1
  32. package/build/components/block-switcher/index.js.map +1 -1
  33. package/build/components/block-title/index.js +2 -2
  34. package/build/components/block-title/index.js.map +1 -1
  35. package/build/components/block-title/use-block-display-title.js +1 -1
  36. package/build/components/block-title/use-block-display-title.js.map +1 -1
  37. package/build/components/block-toolbar/block-name-context.js +17 -0
  38. package/build/components/block-toolbar/block-name-context.js.map +1 -0
  39. package/build/components/block-toolbar/block-toolbar-last-item.js +20 -0
  40. package/build/components/block-toolbar/block-toolbar-last-item.js.map +1 -0
  41. package/build/components/block-toolbar/index.js +20 -5
  42. package/build/components/block-toolbar/index.js.map +1 -1
  43. package/build/components/block-tools/index.js +0 -16
  44. package/build/components/block-tools/index.js.map +1 -1
  45. package/build/components/block-variation-transforms/index.js +92 -47
  46. package/build/components/block-variation-transforms/index.js.map +1 -1
  47. package/build/components/block-vertical-alignment-control/index.js +13 -6
  48. package/build/components/block-vertical-alignment-control/index.js.map +1 -1
  49. package/build/components/contrast-checker/index.js +4 -0
  50. package/build/components/contrast-checker/index.js.map +1 -1
  51. package/build/components/convert-to-group-buttons/index.js +8 -0
  52. package/build/components/convert-to-group-buttons/index.js.map +1 -1
  53. package/build/components/convert-to-group-buttons/toolbar.js +105 -0
  54. package/build/components/convert-to-group-buttons/toolbar.js.map +1 -0
  55. package/build/components/copy-handler/index.js +4 -0
  56. package/build/components/copy-handler/index.js.map +1 -1
  57. package/build/components/font-sizes/font-size-picker.js +4 -0
  58. package/build/components/font-sizes/font-size-picker.js.map +1 -1
  59. package/build/components/iframe/index.js +6 -9
  60. package/build/components/iframe/index.js.map +1 -1
  61. package/build/components/index.js +18 -0
  62. package/build/components/index.js.map +1 -1
  63. package/build/components/justify-content-control/index.js +13 -6
  64. package/build/components/justify-content-control/index.js.map +1 -1
  65. package/build/components/keyboard-shortcuts/index.js +1 -1
  66. package/build/components/keyboard-shortcuts/index.js.map +1 -1
  67. package/build/components/line-height-control/index.js +10 -3
  68. package/build/components/line-height-control/index.js.map +1 -1
  69. package/build/components/list-view/block-select-button.js +25 -6
  70. package/build/components/list-view/block-select-button.js.map +1 -1
  71. package/build/components/list-view/block.js +5 -1
  72. package/build/components/list-view/block.js.map +1 -1
  73. package/build/components/list-view/branch.js +1 -1
  74. package/build/components/list-view/branch.js.map +1 -1
  75. package/build/components/media-replace-flow/index.js +4 -0
  76. package/build/components/media-replace-flow/index.js.map +1 -1
  77. package/build/components/multi-selection-inspector/index.js +1 -1
  78. package/build/components/multi-selection-inspector/index.js.map +1 -1
  79. package/build/components/rich-text/index.js +26 -4
  80. package/build/components/rich-text/index.js.map +1 -1
  81. package/build/components/rich-text/split-value.js +12 -2
  82. package/build/components/rich-text/split-value.js.map +1 -1
  83. package/build/components/rich-text/use-firefox-compat.js +49 -0
  84. package/build/components/rich-text/use-firefox-compat.js.map +1 -0
  85. package/build/components/rich-text/use-input-rules.js +34 -2
  86. package/build/components/rich-text/use-input-rules.js.map +1 -1
  87. package/build/components/skip-to-selected-block/index.js +4 -0
  88. package/build/components/skip-to-selected-block/index.js.map +1 -1
  89. package/build/components/writing-flow/index.js +9 -1
  90. package/build/components/writing-flow/index.js.map +1 -1
  91. package/build/components/writing-flow/use-arrow-nav.js +3 -44
  92. package/build/components/writing-flow/use-arrow-nav.js.map +1 -1
  93. package/build/components/writing-flow/use-click-selection.js +68 -0
  94. package/build/components/writing-flow/use-click-selection.js.map +1 -0
  95. package/build/components/writing-flow/use-drag-selection.js +134 -0
  96. package/build/components/writing-flow/use-drag-selection.js.map +1 -0
  97. package/build/components/writing-flow/use-input.js +116 -0
  98. package/build/components/writing-flow/use-input.js.map +1 -0
  99. package/build/components/writing-flow/use-multi-selection.js +18 -38
  100. package/build/components/writing-flow/use-multi-selection.js.map +1 -1
  101. package/build/components/writing-flow/use-selection-observer.js +161 -0
  102. package/build/components/writing-flow/use-selection-observer.js.map +1 -0
  103. package/build/components/writing-flow/use-tab-nav.js +1 -8
  104. package/build/components/writing-flow/use-tab-nav.js.map +1 -1
  105. package/build/hooks/border-color.js +3 -3
  106. package/build/hooks/border-color.js.map +1 -1
  107. package/build/hooks/border.js +0 -14
  108. package/build/hooks/border.js.map +1 -1
  109. package/build/hooks/color.js +20 -17
  110. package/build/hooks/color.js.map +1 -1
  111. package/build/hooks/font-family.js +5 -1
  112. package/build/hooks/font-family.js.map +1 -1
  113. package/build/hooks/font-size.js +4 -2
  114. package/build/hooks/font-size.js.map +1 -1
  115. package/build/hooks/gap.js +23 -16
  116. package/build/hooks/gap.js.map +1 -1
  117. package/build/hooks/layout.js +7 -2
  118. package/build/hooks/layout.js.map +1 -1
  119. package/build/hooks/style.js +34 -3
  120. package/build/hooks/style.js.map +1 -1
  121. package/build/hooks/utils.js +29 -0
  122. package/build/hooks/utils.js.map +1 -1
  123. package/build/layouts/flex.js +76 -12
  124. package/build/layouts/flex.js.map +1 -1
  125. package/build/layouts/flow.js +9 -4
  126. package/build/layouts/flow.js.map +1 -1
  127. package/build/store/actions.js +297 -51
  128. package/build/store/actions.js.map +1 -1
  129. package/build/store/defaults.js +5 -2
  130. package/build/store/defaults.js.map +1 -1
  131. package/build/store/reducer.js +25 -13
  132. package/build/store/reducer.js.map +1 -1
  133. package/build/store/selectors.js +142 -18
  134. package/build/store/selectors.js.map +1 -1
  135. package/build/utils/dom.js +2 -1
  136. package/build/utils/dom.js.map +1 -1
  137. package/build-module/components/alignment-control/index.js +12 -4
  138. package/build-module/components/alignment-control/index.js.map +1 -1
  139. package/build-module/components/block-alignment-control/index.js +12 -4
  140. package/build-module/components/block-alignment-control/index.js.map +1 -1
  141. package/build-module/components/block-draggable/index.js +2 -3
  142. package/build-module/components/block-draggable/index.js.map +1 -1
  143. package/build-module/components/block-icon/index.js +4 -0
  144. package/build-module/components/block-icon/index.js.map +1 -1
  145. package/build-module/components/block-inspector/index.js +6 -1
  146. package/build-module/components/block-inspector/index.js.map +1 -1
  147. package/build-module/components/block-list/use-block-props/index.js +1 -4
  148. package/build-module/components/block-list/use-block-props/index.js.map +1 -1
  149. package/build-module/components/block-list/use-block-props/use-focus-first-element.js +15 -17
  150. package/build-module/components/block-list/use-block-props/use-focus-first-element.js.map +1 -1
  151. package/build-module/components/block-list/use-block-props/use-focus-handler.js +7 -1
  152. package/build-module/components/block-list/use-block-props/use-focus-handler.js.map +1 -1
  153. package/build-module/components/block-list-appender/index.js +6 -1
  154. package/build-module/components/block-list-appender/index.js.map +1 -1
  155. package/build-module/components/block-lock/menu-item.js +9 -0
  156. package/build-module/components/block-lock/menu-item.js.map +1 -1
  157. package/build-module/components/block-lock/modal.js +5 -14
  158. package/build-module/components/block-lock/modal.js.map +1 -1
  159. package/build-module/components/block-lock/toolbar.js +11 -3
  160. package/build-module/components/block-lock/toolbar.js.map +1 -1
  161. package/build-module/components/block-mover/index.js +4 -0
  162. package/build-module/components/block-mover/index.js.map +1 -1
  163. package/build-module/components/block-settings-menu/block-settings-dropdown.js +50 -7
  164. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  165. package/build-module/components/block-switcher/index.js +2 -2
  166. package/build-module/components/block-switcher/index.js.map +1 -1
  167. package/build-module/components/block-title/index.js +2 -2
  168. package/build-module/components/block-title/index.js.map +1 -1
  169. package/build-module/components/block-title/use-block-display-title.js +1 -1
  170. package/build-module/components/block-title/use-block-display-title.js.map +1 -1
  171. package/build-module/components/block-toolbar/block-name-context.js +9 -0
  172. package/build-module/components/block-toolbar/block-name-context.js.map +1 -0
  173. package/build-module/components/block-toolbar/block-toolbar-last-item.js +11 -0
  174. package/build-module/components/block-toolbar/block-toolbar-last-item.js.map +1 -0
  175. package/build-module/components/block-toolbar/index.js +16 -4
  176. package/build-module/components/block-toolbar/index.js.map +1 -1
  177. package/build-module/components/block-tools/index.js +0 -16
  178. package/build-module/components/block-tools/index.js.map +1 -1
  179. package/build-module/components/block-variation-transforms/index.js +95 -49
  180. package/build-module/components/block-variation-transforms/index.js.map +1 -1
  181. package/build-module/components/block-vertical-alignment-control/index.js +12 -4
  182. package/build-module/components/block-vertical-alignment-control/index.js.map +1 -1
  183. package/build-module/components/contrast-checker/index.js +4 -0
  184. package/build-module/components/contrast-checker/index.js.map +1 -1
  185. package/build-module/components/convert-to-group-buttons/index.js +2 -1
  186. package/build-module/components/convert-to-group-buttons/index.js.map +1 -1
  187. package/build-module/components/convert-to-group-buttons/toolbar.js +90 -0
  188. package/build-module/components/convert-to-group-buttons/toolbar.js.map +1 -0
  189. package/build-module/components/copy-handler/index.js +4 -0
  190. package/build-module/components/copy-handler/index.js.map +1 -1
  191. package/build-module/components/font-sizes/font-size-picker.js +4 -0
  192. package/build-module/components/font-sizes/font-size-picker.js.map +1 -1
  193. package/build-module/components/iframe/index.js +6 -9
  194. package/build-module/components/iframe/index.js.map +1 -1
  195. package/build-module/components/index.js +2 -0
  196. package/build-module/components/index.js.map +1 -1
  197. package/build-module/components/justify-content-control/index.js +12 -4
  198. package/build-module/components/justify-content-control/index.js.map +1 -1
  199. package/build-module/components/keyboard-shortcuts/index.js +1 -1
  200. package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
  201. package/build-module/components/line-height-control/index.js +9 -2
  202. package/build-module/components/line-height-control/index.js.map +1 -1
  203. package/build-module/components/list-view/block-select-button.js +22 -6
  204. package/build-module/components/list-view/block-select-button.js.map +1 -1
  205. package/build-module/components/list-view/block.js +5 -1
  206. package/build-module/components/list-view/block.js.map +1 -1
  207. package/build-module/components/list-view/branch.js +1 -1
  208. package/build-module/components/list-view/branch.js.map +1 -1
  209. package/build-module/components/media-replace-flow/index.js +4 -0
  210. package/build-module/components/media-replace-flow/index.js.map +1 -1
  211. package/build-module/components/multi-selection-inspector/index.js +2 -2
  212. package/build-module/components/multi-selection-inspector/index.js.map +1 -1
  213. package/build-module/components/rich-text/index.js +25 -4
  214. package/build-module/components/rich-text/index.js.map +1 -1
  215. package/build-module/components/rich-text/split-value.js +12 -2
  216. package/build-module/components/rich-text/split-value.js.map +1 -1
  217. package/build-module/components/rich-text/use-firefox-compat.js +39 -0
  218. package/build-module/components/rich-text/use-firefox-compat.js.map +1 -0
  219. package/build-module/components/rich-text/use-input-rules.js +35 -4
  220. package/build-module/components/rich-text/use-input-rules.js.map +1 -1
  221. package/build-module/components/skip-to-selected-block/index.js +4 -0
  222. package/build-module/components/skip-to-selected-block/index.js.map +1 -1
  223. package/build-module/components/writing-flow/index.js +5 -1
  224. package/build-module/components/writing-flow/index.js.map +1 -1
  225. package/build-module/components/writing-flow/use-arrow-nav.js +4 -45
  226. package/build-module/components/writing-flow/use-arrow-nav.js.map +1 -1
  227. package/build-module/components/writing-flow/use-click-selection.js +57 -0
  228. package/build-module/components/writing-flow/use-click-selection.js.map +1 -0
  229. package/build-module/components/writing-flow/use-drag-selection.js +124 -0
  230. package/build-module/components/writing-flow/use-drag-selection.js.map +1 -0
  231. package/build-module/components/writing-flow/use-input.js +104 -0
  232. package/build-module/components/writing-flow/use-input.js.map +1 -0
  233. package/build-module/components/writing-flow/use-multi-selection.js +18 -37
  234. package/build-module/components/writing-flow/use-multi-selection.js.map +1 -1
  235. package/build-module/components/writing-flow/use-selection-observer.js +150 -0
  236. package/build-module/components/writing-flow/use-selection-observer.js.map +1 -0
  237. package/build-module/components/writing-flow/use-tab-nav.js +1 -9
  238. package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
  239. package/build-module/hooks/border-color.js +5 -5
  240. package/build-module/hooks/border-color.js.map +1 -1
  241. package/build-module/hooks/border.js +0 -12
  242. package/build-module/hooks/border.js.map +1 -1
  243. package/build-module/hooks/color.js +19 -18
  244. package/build-module/hooks/color.js.map +1 -1
  245. package/build-module/hooks/font-family.js +3 -1
  246. package/build-module/hooks/font-family.js.map +1 -1
  247. package/build-module/hooks/font-size.js +4 -3
  248. package/build-module/hooks/font-size.js.map +1 -1
  249. package/build-module/hooks/gap.js +22 -15
  250. package/build-module/hooks/gap.js.map +1 -1
  251. package/build-module/hooks/layout.js +7 -2
  252. package/build-module/hooks/layout.js.map +1 -1
  253. package/build-module/hooks/style.js +33 -3
  254. package/build-module/hooks/style.js.map +1 -1
  255. package/build-module/hooks/utils.js +26 -0
  256. package/build-module/hooks/utils.js.map +1 -1
  257. package/build-module/layouts/flex.js +76 -13
  258. package/build-module/layouts/flex.js.map +1 -1
  259. package/build-module/layouts/flow.js +9 -5
  260. package/build-module/layouts/flow.js.map +1 -1
  261. package/build-module/store/actions.js +286 -49
  262. package/build-module/store/actions.js.map +1 -1
  263. package/build-module/store/defaults.js +5 -2
  264. package/build-module/store/defaults.js.map +1 -1
  265. package/build-module/store/reducer.js +25 -13
  266. package/build-module/store/reducer.js.map +1 -1
  267. package/build-module/store/selectors.js +138 -19
  268. package/build-module/store/selectors.js.map +1 -1
  269. package/build-module/utils/dom.js +2 -1
  270. package/build-module/utils/dom.js.map +1 -1
  271. package/build-style/style-rtl.css +107 -74
  272. package/build-style/style.css +107 -74
  273. package/build-types/utils/dom.d.ts.map +1 -1
  274. package/package.json +28 -28
  275. package/src/components/alignment-control/index.js +9 -4
  276. package/src/components/block-alignment-control/index.js +9 -4
  277. package/src/components/block-draggable/index.js +2 -5
  278. package/src/components/block-icon/index.js +3 -0
  279. package/src/components/block-inspector/index.js +4 -0
  280. package/src/components/block-list/style.scss +4 -5
  281. package/src/components/block-list/use-block-props/index.js +0 -5
  282. package/src/components/block-list/use-block-props/use-focus-first-element.js +19 -26
  283. package/src/components/block-list/use-block-props/use-focus-handler.js +8 -0
  284. package/src/components/block-list-appender/index.js +5 -0
  285. package/src/components/block-lock/menu-item.js +8 -1
  286. package/src/components/block-lock/modal.js +18 -13
  287. package/src/components/block-lock/style.scss +6 -3
  288. package/src/components/block-lock/toolbar.js +12 -2
  289. package/src/components/block-mover/index.js +3 -0
  290. package/src/components/block-mover/style.scss +4 -0
  291. package/src/components/block-settings-menu/block-settings-dropdown.js +62 -4
  292. package/src/components/block-switcher/index.js +2 -2
  293. package/src/components/block-switcher/style.scss +8 -1
  294. package/src/components/block-switcher/test/index.js +2 -2
  295. package/src/components/block-title/index.js +2 -2
  296. package/src/components/block-title/use-block-display-title.js +1 -1
  297. package/src/components/block-toolbar/block-name-context.js +8 -0
  298. package/src/components/block-toolbar/block-toolbar-last-item.js +12 -0
  299. package/src/components/block-toolbar/index.js +18 -2
  300. package/src/components/block-toolbar/style.scss +6 -0
  301. package/src/components/block-tools/index.js +0 -19
  302. package/src/components/block-tools/style.scss +3 -5
  303. package/src/components/block-variation-transforms/index.js +105 -36
  304. package/src/components/block-variation-transforms/style.scss +1 -1
  305. package/src/components/block-vertical-alignment-control/index.js +9 -4
  306. package/src/components/button-block-appender/style.scss +5 -1
  307. package/src/components/contrast-checker/index.js +3 -0
  308. package/src/components/convert-to-group-buttons/index.js +6 -1
  309. package/src/components/convert-to-group-buttons/toolbar.js +87 -0
  310. package/src/components/copy-handler/index.js +3 -0
  311. package/src/components/font-sizes/font-size-picker.js +3 -0
  312. package/src/components/iframe/index.js +5 -7
  313. package/src/components/index.js +2 -0
  314. package/src/components/justify-content-control/index.js +9 -4
  315. package/src/components/keyboard-shortcuts/index.js +1 -1
  316. package/src/components/line-height-control/index.js +8 -3
  317. package/src/components/list-view/block-select-button.js +21 -3
  318. package/src/components/list-view/block.js +8 -1
  319. package/src/components/list-view/branch.js +1 -1
  320. package/src/components/list-view/style.scss +56 -14
  321. package/src/components/media-placeholder/README.md +8 -0
  322. package/src/components/media-replace-flow/index.js +3 -0
  323. package/src/components/multi-selection-inspector/index.js +2 -2
  324. package/src/components/rich-text/index.js +24 -1
  325. package/src/components/rich-text/split-value.js +5 -1
  326. package/src/components/rich-text/use-firefox-compat.js +39 -0
  327. package/src/components/rich-text/use-input-rules.js +40 -3
  328. package/src/components/skip-to-selected-block/index.js +3 -0
  329. package/src/components/url-input/style.scss +3 -2
  330. package/src/components/writing-flow/index.js +8 -0
  331. package/src/components/writing-flow/readme.md +28 -0
  332. package/src/components/writing-flow/use-arrow-nav.js +4 -53
  333. package/src/components/writing-flow/use-click-selection.js +65 -0
  334. package/src/components/writing-flow/use-drag-selection.js +126 -0
  335. package/src/components/writing-flow/use-input.js +112 -0
  336. package/src/components/writing-flow/use-multi-selection.js +13 -36
  337. package/src/components/writing-flow/use-selection-observer.js +153 -0
  338. package/src/components/writing-flow/use-tab-nav.js +1 -11
  339. package/src/hooks/border-color.js +5 -5
  340. package/src/hooks/border.js +0 -13
  341. package/src/hooks/color.js +51 -24
  342. package/src/hooks/font-family.js +5 -2
  343. package/src/hooks/font-size.js +10 -7
  344. package/src/hooks/gap.js +25 -17
  345. package/src/hooks/layout.js +11 -1
  346. package/src/hooks/style.js +40 -4
  347. package/src/hooks/test/gap.js +25 -1
  348. package/src/hooks/test/style.js +94 -0
  349. package/src/hooks/test/utils.js +1 -1
  350. package/src/hooks/utils.js +26 -0
  351. package/src/layouts/flex.js +89 -5
  352. package/src/layouts/flow.js +15 -4
  353. package/src/store/actions.js +349 -32
  354. package/src/store/defaults.js +7 -2
  355. package/src/store/reducer.js +25 -10
  356. package/src/store/selectors.js +181 -24
  357. package/src/store/test/selectors.js +242 -5
  358. package/src/utils/dom.js +2 -1
  359. package/tsconfig.tsbuildinfo +1 -1
  360. package/build/components/block-list/use-block-props/use-multi-selection.js +0 -205
  361. package/build/components/block-list/use-block-props/use-multi-selection.js.map +0 -1
  362. package/build/components/block-list/use-block-props/use-scroll-into-view.js +0 -77
  363. package/build/components/block-list/use-block-props/use-scroll-into-view.js.map +0 -1
  364. package/build-module/components/block-list/use-block-props/use-multi-selection.js +0 -192
  365. package/build-module/components/block-list/use-block-props/use-multi-selection.js.map +0 -1
  366. package/build-module/components/block-list/use-block-props/use-scroll-into-view.js +0 -63
  367. package/build-module/components/block-list/use-block-props/use-scroll-into-view.js.map +0 -1
  368. package/src/components/block-list/use-block-props/use-multi-selection.js +0 -227
  369. package/src/components/block-list/use-block-props/use-scroll-into-view.js +0 -73
@@ -7,7 +7,12 @@ import { first, last } from 'lodash';
7
7
  * WordPress dependencies
8
8
  */
9
9
  import { useEffect, useRef } from '@wordpress/element';
10
- import { focus, isTextField, placeCaretAtHorizontalEdge } from '@wordpress/dom';
10
+ import {
11
+ focus,
12
+ isFormElement,
13
+ isTextField,
14
+ placeCaretAtHorizontalEdge,
15
+ } from '@wordpress/dom';
11
16
  import { useSelect } from '@wordpress/data';
12
17
 
13
18
  /**
@@ -15,7 +20,6 @@ import { useSelect } from '@wordpress/data';
15
20
  */
16
21
  import { isInsideRootBlock } from '../../../utils/dom';
17
22
  import { store as blockEditorStore } from '../../../store';
18
- import { setContentEditableWrapper } from './use-multi-selection';
19
23
 
20
24
  /** @typedef {import('@wordpress/element').RefObject} RefObject */
21
25
 
@@ -32,7 +36,6 @@ function useInitialPosition( clientId ) {
32
36
  ( select ) => {
33
37
  const {
34
38
  getSelectedBlocksInitialCaretPosition,
35
- isMultiSelecting,
36
39
  isNavigationMode,
37
40
  isBlockSelected,
38
41
  } = select( blockEditorStore );
@@ -41,7 +44,7 @@ function useInitialPosition( clientId ) {
41
44
  return;
42
45
  }
43
46
 
44
- if ( isMultiSelecting() || isNavigationMode() ) {
47
+ if ( isNavigationMode() ) {
45
48
  return;
46
49
  }
47
50
 
@@ -52,16 +55,6 @@ function useInitialPosition( clientId ) {
52
55
  );
53
56
  }
54
57
 
55
- function isFormElement( element ) {
56
- const { tagName } = element;
57
- return (
58
- tagName === 'INPUT' ||
59
- tagName === 'BUTTON' ||
60
- tagName === 'SELECT' ||
61
- tagName === 'TEXTAREA'
62
- );
63
- }
64
-
65
58
  /**
66
59
  * Transitions focus to the block or inner tabbable when the block becomes
67
60
  * selected and an initial position is set.
@@ -73,8 +66,14 @@ function isFormElement( element ) {
73
66
  export function useFocusFirstElement( clientId ) {
74
67
  const ref = useRef();
75
68
  const initialPosition = useInitialPosition( clientId );
69
+ const { isBlockSelected, isMultiSelecting } = useSelect( blockEditorStore );
76
70
 
77
71
  useEffect( () => {
72
+ // Check if the block is still selected at the time this effect runs.
73
+ if ( ! isBlockSelected( clientId ) || isMultiSelecting() ) {
74
+ return;
75
+ }
76
+
78
77
  if ( initialPosition === undefined || initialPosition === null ) {
79
78
  return;
80
79
  }
@@ -107,27 +106,21 @@ export function useFocusFirstElement( clientId ) {
107
106
  }
108
107
 
109
108
  // Check to see if element is focussable before a generic caret insert.
110
- if ( ! target.getAttribute( 'contenteditable' ) ) {
111
- const focusElement = focus.tabbable.findNext( target );
112
- // Make sure focusElement is valid, form field, and within the current target element.
113
- // Ensure is not block inserter trigger, don't want to focus that in the event of the group block which doesn't contain any other focussable elements.
109
+ if ( ! ref.current.getAttribute( 'contenteditable' ) ) {
110
+ const focusElement = focus.tabbable.findNext( ref.current );
111
+ // Make sure focusElement is valid, contained in the same block, and a form field.
114
112
  if (
115
113
  focusElement &&
116
- isFormElement( focusElement ) &&
117
- target.contains( focusElement ) &&
118
- ! focusElement.classList.contains(
119
- 'block-editor-button-block-appender'
120
- )
114
+ isInsideRootBlock( ref.current, focusElement ) &&
115
+ isFormElement( focusElement )
121
116
  ) {
122
117
  focusElement.focus();
123
118
  return;
124
119
  }
125
120
  }
126
121
 
127
- setContentEditableWrapper( ref.current, false );
128
-
129
122
  placeCaretAtHorizontalEdge( target, isReverse );
130
- }, [ initialPosition ] );
123
+ }, [ initialPosition, clientId ] );
131
124
 
132
125
  return ref;
133
126
  }
@@ -30,6 +30,14 @@ export function useFocusHandler( clientId ) {
30
30
  * @param {FocusEvent} event Focus event.
31
31
  */
32
32
  function onFocus( event ) {
33
+ // When the whole editor is editable, let writing flow handle
34
+ // selection.
35
+ if (
36
+ node.parentElement.closest( '[contenteditable="true"]' )
37
+ ) {
38
+ return;
39
+ }
40
+
33
41
  // Check synchronously because a non-selected block might be
34
42
  // getting data through `useSelect` asynchronously.
35
43
  if ( isBlockSelected( clientId ) ) {
@@ -73,6 +73,11 @@ function BlockListAppender( {
73
73
  'block-list-appender wp-block',
74
74
  className
75
75
  ) }
76
+ // Needed in case the whole editor is content editable (for multi
77
+ // selection). It fixes an edge case where ArrowDown and ArrowRight
78
+ // should collapse the selection to the end of that selection and
79
+ // not into the appender.
80
+ contentEditable={ false }
76
81
  // The appender exists to let you add the first Paragraph before
77
82
  // any is inserted. To that end, this appender should visually be
78
83
  // presented as a block. That means theme CSS should style it as if
@@ -14,16 +14,19 @@ import BlockLockModal from './modal';
14
14
  import { store as blockEditorStore } from '../../store';
15
15
 
16
16
  export default function BlockLockMenuItem( { clientId } ) {
17
- const { isLocked } = useSelect(
17
+ const { canLockBlock, isLocked } = useSelect(
18
18
  ( select ) => {
19
19
  const {
20
20
  canMoveBlock,
21
21
  canRemoveBlock,
22
+ canLockBlockType,
23
+ getBlockName,
22
24
  getBlockRootClientId,
23
25
  } = select( blockEditorStore );
24
26
  const rootClientId = getBlockRootClientId( clientId );
25
27
 
26
28
  return {
29
+ canLockBlock: canLockBlockType( getBlockName( clientId ) ),
27
30
  isLocked:
28
31
  ! canMoveBlock( clientId, rootClientId ) ||
29
32
  ! canRemoveBlock( clientId, rootClientId ),
@@ -37,6 +40,10 @@ export default function BlockLockMenuItem( { clientId } ) {
37
40
  false
38
41
  );
39
42
 
43
+ if ( ! canLockBlock ) {
44
+ return null;
45
+ }
46
+
40
47
  const label = isLocked ? __( 'Unlock' ) : __( 'Lock' );
41
48
 
42
49
  return (
@@ -11,7 +11,7 @@ import {
11
11
  Icon,
12
12
  Modal,
13
13
  } from '@wordpress/components';
14
- import { dragHandle, trash } from '@wordpress/icons';
14
+ import { lock as lockIcon, unlock as unlockIcon } from '@wordpress/icons';
15
15
  import { useInstanceId } from '@wordpress/compose';
16
16
  import { useDispatch, useSelect } from '@wordpress/data';
17
17
 
@@ -54,15 +54,8 @@ export default function BlockLockModal( { clientId, onClose } ) {
54
54
  }, [ canMove, canRemove ] );
55
55
 
56
56
  const isAllChecked = Object.values( lock ).every( Boolean );
57
-
58
- let ariaChecked;
59
- if ( isAllChecked ) {
60
- ariaChecked = 'true';
61
- } else if ( Object.values( lock ).some( Boolean ) ) {
62
- ariaChecked = 'mixed';
63
- } else {
64
- ariaChecked = 'false';
65
- }
57
+ const isIndeterminate =
58
+ Object.values( lock ).some( Boolean ) && ! isAllChecked;
66
59
 
67
60
  return (
68
61
  <Modal
@@ -98,7 +91,7 @@ export default function BlockLockModal( { clientId, onClose } ) {
98
91
  <span id={ instanceId }>{ __( 'Lock all' ) }</span>
99
92
  }
100
93
  checked={ isAllChecked }
101
- aria-checked={ ariaChecked }
94
+ indeterminate={ isIndeterminate }
102
95
  onChange={ ( newValue ) =>
103
96
  setLock( {
104
97
  move: newValue,
@@ -112,7 +105,13 @@ export default function BlockLockModal( { clientId, onClose } ) {
112
105
  label={
113
106
  <>
114
107
  { __( 'Disable movement' ) }
115
- <Icon icon={ dragHandle } />
108
+ <Icon
109
+ icon={
110
+ lock.move
111
+ ? lockIcon
112
+ : unlockIcon
113
+ }
114
+ />
116
115
  </>
117
116
  }
118
117
  checked={ lock.move }
@@ -129,7 +128,13 @@ export default function BlockLockModal( { clientId, onClose } ) {
129
128
  label={
130
129
  <>
131
130
  { __( 'Prevent removal' ) }
132
- <Icon icon={ trash } />
131
+ <Icon
132
+ icon={
133
+ lock.remove
134
+ ? lockIcon
135
+ : unlockIcon
136
+ }
137
+ />
133
138
  </>
134
139
  }
135
140
  checked={ lock.remove }
@@ -13,7 +13,6 @@
13
13
  }
14
14
 
15
15
  .block-editor-block-lock-modal__options-title {
16
- border-bottom: 1px solid $gray-300;
17
16
  padding: $grid-unit-15 0;
18
17
 
19
18
  .components-checkbox-control__label {
@@ -27,9 +26,8 @@
27
26
  }
28
27
  }
29
28
  .block-editor-block-lock-modal__checklist-item {
30
- border-bottom: 1px solid $gray-300;
31
29
  margin-bottom: 0;
32
- padding: $grid-unit-15 0 $grid-unit-15 $grid-unit-15;
30
+ padding: $grid-unit-15 0 $grid-unit-15 $grid-unit-40;
33
31
 
34
32
  .components-base-control__field {
35
33
  align-items: center;
@@ -48,6 +46,11 @@
48
46
  fill: $gray-900;
49
47
  }
50
48
  }
49
+
50
+ &:hover {
51
+ background-color: $gray-100;
52
+ border-radius: $radius-block-ui;
53
+ }
51
54
  }
52
55
 
53
56
  .block-editor-block-lock-modal__actions {
@@ -16,13 +16,19 @@ import { store as blockEditorStore } from '../../store';
16
16
 
17
17
  export default function BlockLockToolbar( { clientId } ) {
18
18
  const blockInformation = useBlockDisplayInformation( clientId );
19
- const { canMove, canRemove } = useSelect(
19
+ const { canMove, canRemove, canLockBlock } = useSelect(
20
20
  ( select ) => {
21
- const { canMoveBlock, canRemoveBlock } = select( blockEditorStore );
21
+ const {
22
+ canMoveBlock,
23
+ canRemoveBlock,
24
+ canLockBlockType,
25
+ getBlockName,
26
+ } = select( blockEditorStore );
22
27
 
23
28
  return {
24
29
  canMove: canMoveBlock( clientId ),
25
30
  canRemove: canRemoveBlock( clientId ),
31
+ canLockBlock: canLockBlockType( getBlockName( clientId ) ),
26
32
  };
27
33
  },
28
34
  [ clientId ]
@@ -33,6 +39,10 @@ export default function BlockLockToolbar( { clientId } ) {
33
39
  false
34
40
  );
35
41
 
42
+ if ( ! canLockBlock ) {
43
+ return null;
44
+ }
45
+
36
46
  if ( canMove && canRemove ) {
37
47
  return null;
38
48
  }
@@ -95,6 +95,9 @@ function BlockMover( {
95
95
  );
96
96
  }
97
97
 
98
+ /**
99
+ * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-mover/README.md
100
+ */
98
101
  export default withSelect( ( select, { clientIds } ) => {
99
102
  const {
100
103
  getBlock,
@@ -22,6 +22,10 @@
22
22
  @include break-small() {
23
23
  flex-direction: column;
24
24
  }
25
+
26
+ // @todo: override toolbar group inherited paddings from components/block-tools/style.scss.
27
+ // This is best fixed by making the mover control area a proper single toolbar group.
28
+ padding: 0;
25
29
  }
26
30
 
27
31
  &.is-horizontal .block-editor-block-mover__move-button-container,
@@ -6,12 +6,17 @@ import { castArray, flow, noop } from 'lodash';
6
6
  /**
7
7
  * WordPress dependencies
8
8
  */
9
- import { __, sprintf } from '@wordpress/i18n';
9
+ import { getBlockType, serialize } from '@wordpress/blocks';
10
10
  import { DropdownMenu, MenuGroup, MenuItem } from '@wordpress/components';
11
- import { useSelect } from '@wordpress/data';
11
+ import { useDispatch, useSelect } from '@wordpress/data';
12
12
  import { moreVertical } from '@wordpress/icons';
13
- import { Children, cloneElement, useCallback } from '@wordpress/element';
14
- import { serialize } from '@wordpress/blocks';
13
+ import {
14
+ Children,
15
+ cloneElement,
16
+ useCallback,
17
+ useRef,
18
+ } from '@wordpress/element';
19
+ import { __, sprintf } from '@wordpress/i18n';
15
20
  import { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';
16
21
  import { useCopyToClipboard } from '@wordpress/compose';
17
22
 
@@ -19,12 +24,14 @@ import { useCopyToClipboard } from '@wordpress/compose';
19
24
  * Internal dependencies
20
25
  */
21
26
  import BlockActions from '../block-actions';
27
+ import BlockIcon from '../block-icon';
22
28
  import BlockModeToggle from './block-mode-toggle';
23
29
  import BlockHTMLConvertButton from './block-html-convert-button';
24
30
  import __unstableBlockSettingsMenuFirstItem from './block-settings-menu-first-item';
25
31
  import BlockSettingsMenuControls from '../block-settings-menu-controls';
26
32
  import { store as blockEditorStore } from '../../store';
27
33
  import useBlockDisplayTitle from '../block-title/use-block-display-title';
34
+ import { useShowMoversGestures } from '../block-toolbar/utils';
28
35
 
29
36
  const POPOVER_PROPS = {
30
37
  className: 'block-editor-block-settings-menu__popover',
@@ -47,7 +54,10 @@ export function BlockSettingsDropdown( {
47
54
  const count = blockClientIds.length;
48
55
  const firstBlockClientId = blockClientIds[ 0 ];
49
56
  const {
57
+ firstParentClientId,
58
+ hasReducedUI,
50
59
  onlyBlock,
60
+ parentBlockType,
51
61
  previousBlockClientId,
52
62
  nextBlockClientId,
53
63
  selectedBlockClientIds,
@@ -55,12 +65,23 @@ export function BlockSettingsDropdown( {
55
65
  ( select ) => {
56
66
  const {
57
67
  getBlockCount,
68
+ getBlockName,
69
+ getBlockParents,
58
70
  getPreviousBlockClientId,
59
71
  getNextBlockClientId,
60
72
  getSelectedBlockClientIds,
73
+ getSettings,
61
74
  } = select( blockEditorStore );
75
+
76
+ const parents = getBlockParents( firstBlockClientId );
77
+ const _firstParentClientId = parents[ parents.length - 1 ];
78
+ const parentBlockName = getBlockName( _firstParentClientId );
79
+
62
80
  return {
81
+ firstParentClientId: _firstParentClientId,
82
+ hasReducedUI: getSettings().hasReducedUI,
63
83
  onlyBlock: 1 === getBlockCount(),
84
+ parentBlockType: getBlockType( parentBlockName ),
64
85
  previousBlockClientId: getPreviousBlockClientId(
65
86
  firstBlockClientId
66
87
  ),
@@ -87,6 +108,10 @@ export function BlockSettingsDropdown( {
87
108
  };
88
109
  }, [] );
89
110
 
111
+ const { selectBlock, toggleBlockHighlight } = useDispatch(
112
+ blockEditorStore
113
+ );
114
+
90
115
  const updateSelectionAfterDuplicate = useCallback(
91
116
  __experimentalSelectBlock
92
117
  ? async ( clientIdsPromise ) => {
@@ -135,6 +160,19 @@ export function BlockSettingsDropdown( {
135
160
  );
136
161
  const removeBlockLabel = count === 1 ? label : __( 'Remove blocks' );
137
162
 
163
+ // Allows highlighting the parent block outline when focusing or hovering
164
+ // the parent block selector within the child.
165
+ const selectParentButtonRef = useRef();
166
+ const { gestures: showParentOutlineGestures } = useShowMoversGestures( {
167
+ ref: selectParentButtonRef,
168
+ onChange( isFocused ) {
169
+ if ( isFocused && hasReducedUI ) {
170
+ return;
171
+ }
172
+ toggleBlockHighlight( firstParentClientId, isFocused );
173
+ },
174
+ } );
175
+
138
176
  return (
139
177
  <BlockActions
140
178
  clientIds={ clientIds }
@@ -167,6 +205,26 @@ export function BlockSettingsDropdown( {
167
205
  <__unstableBlockSettingsMenuFirstItem.Slot
168
206
  fillProps={ { onClose } }
169
207
  />
208
+ { firstParentClientId !== undefined && (
209
+ <MenuItem
210
+ { ...showParentOutlineGestures }
211
+ ref={ selectParentButtonRef }
212
+ icon={
213
+ <BlockIcon
214
+ icon={ parentBlockType.icon }
215
+ />
216
+ }
217
+ onClick={ () =>
218
+ selectBlock( firstParentClientId )
219
+ }
220
+ >
221
+ { sprintf(
222
+ /* translators: %s: Name of the block's parent. */
223
+ __( 'Select parent block (%s)' ),
224
+ parentBlockType.title
225
+ ) }
226
+ </MenuItem>
227
+ ) }
170
228
  { count === 1 && (
171
229
  <BlockHTMLConvertButton
172
230
  clientId={ firstBlockClientId }
@@ -20,7 +20,7 @@ import {
20
20
  isTemplatePart,
21
21
  } from '@wordpress/blocks';
22
22
  import { useSelect, useDispatch } from '@wordpress/data';
23
- import { stack } from '@wordpress/icons';
23
+ import { copy } from '@wordpress/icons';
24
24
 
25
25
  /**
26
26
  * Internal dependencies
@@ -69,7 +69,7 @@ export const BlockSwitcherDropdownMenu = ( { clientIds, blocks } ) => {
69
69
  // appropriate icon to communicate the non-uniformity.
70
70
  _icon = isSelectionOfSameType
71
71
  ? getBlockType( firstBlockName )?.icon
72
- : stack;
72
+ : copy;
73
73
  }
74
74
  return {
75
75
  possibleBlockTransformations: getBlockTransformItems(
@@ -1,5 +1,13 @@
1
1
  .block-editor-block-switcher {
2
2
  position: relative;
3
+ padding: 0 ($grid-unit-15 * 0.5);
4
+
5
+ // @todo: override toolbar group inherited paddings from components/block-tools/style.scss.
6
+ // This is best fixed by making the mover control area a proper single toolbar group.
7
+ // It needs specificity due to style inherited from .components-accessible-toolbar .components-button.has-icon.has-icon.
8
+ .components-button.components-dropdown-menu__toggle.has-icon.has-icon {
9
+ min-width: $button-size;
10
+ }
3
11
  }
4
12
 
5
13
  // Show an indicator triangle.
@@ -8,7 +16,6 @@
8
16
  position: relative;
9
17
  }
10
18
 
11
-
12
19
  .components-button.block-editor-block-switcher__toggle,
13
20
  .components-button.block-editor-block-switcher__no-switcher-icon {
14
21
  margin: 0;
@@ -10,7 +10,7 @@ import { useSelect } from '@wordpress/data';
10
10
  import { registerBlockType, unregisterBlockType } from '@wordpress/blocks';
11
11
  import { DOWN } from '@wordpress/keycodes';
12
12
  import { Button } from '@wordpress/components';
13
- import { stack } from '@wordpress/icons';
13
+ import { copy } from '@wordpress/icons';
14
14
 
15
15
  /**
16
16
  * Internal dependencies
@@ -131,7 +131,7 @@ describe( 'BlockSwitcherDropdownMenu', () => {
131
131
  test( 'should render disabled block switcher with multi block of different types when no transforms', () => {
132
132
  useSelect.mockImplementation( () => ( {
133
133
  possibleBlockTransformations: [],
134
- icon: stack,
134
+ icon: copy,
135
135
  } ) );
136
136
  const wrapper = shallow(
137
137
  <BlockSwitcherDropdownMenu
@@ -14,8 +14,8 @@ import useBlockDisplayTitle from './use-block-display-title';
14
14
  * <BlockTitle clientId="afd1cb17-2c08-4e7a-91be-007ba7ddc3a1" maximumLength={ 17 }/>
15
15
  * ```
16
16
  *
17
- * @param {Object} props
18
- * @param {string} props.clientId Client ID of block.
17
+ * @param {Object} props
18
+ * @param {string} props.clientId Client ID of block.
19
19
  * @param {number|undefined} props.maximumLength The maximum length that the block title string may be before truncated.
20
20
  *
21
21
  * @return {JSX.Element} Block title.
@@ -29,7 +29,7 @@ import { store as blockEditorStore } from '../../store';
29
29
  * useBlockDisplayTitle( 'afd1cb17-2c08-4e7a-91be-007ba7ddc3a1', 17 );
30
30
  * ```
31
31
  *
32
- * @param {string} clientId Client ID of block.
32
+ * @param {string} clientId Client ID of block.
33
33
  * @param {number|undefined} maximumLength The maximum length that the block title string may be before truncated.
34
34
  * @return {?string} Block title.
35
35
  */
@@ -0,0 +1,8 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { createContext } from '@wordpress/element';
5
+
6
+ const __unstableBlockNameContext = createContext( '' );
7
+
8
+ export default __unstableBlockNameContext;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { createSlotFill } from '@wordpress/components';
5
+
6
+ const { Fill: __unstableBlockToolbarLastItem, Slot } = createSlotFill(
7
+ '__unstableBlockToolbarLastItem'
8
+ );
9
+
10
+ __unstableBlockToolbarLastItem.Slot = Slot;
11
+
12
+ export default __unstableBlockToolbarLastItem;
@@ -19,12 +19,15 @@ import BlockMover from '../block-mover';
19
19
  import BlockParentSelector from '../block-parent-selector';
20
20
  import BlockSwitcher from '../block-switcher';
21
21
  import BlockControls from '../block-controls';
22
+ import __unstableBlockToolbarLastItem from './block-toolbar-last-item';
22
23
  import BlockSettingsMenu from '../block-settings-menu';
23
24
  import { BlockLockToolbar } from '../block-lock';
25
+ import { BlockGroupToolbar } from '../convert-to-group-buttons';
24
26
  import { useShowMoversGestures } from './utils';
25
27
  import { store as blockEditorStore } from '../../store';
28
+ import __unstableBlockNameContext from './block-name-context';
26
29
 
27
- export default function BlockToolbar( { hideDragHandle } ) {
30
+ const BlockToolbar = ( { hideDragHandle } ) => {
28
31
  const {
29
32
  blockClientIds,
30
33
  blockClientId,
@@ -127,6 +130,9 @@ export default function BlockToolbar( { hideDragHandle } ) {
127
130
  </ToolbarGroup>
128
131
  ) }
129
132
  </div>
133
+ { shouldShowVisualToolbar && isMultiToolbar && (
134
+ <BlockGroupToolbar />
135
+ ) }
130
136
  { shouldShowVisualToolbar && (
131
137
  <>
132
138
  <BlockControls.Slot
@@ -146,9 +152,19 @@ export default function BlockToolbar( { hideDragHandle } ) {
146
152
  group="other"
147
153
  className="block-editor-block-toolbar__slot"
148
154
  />
155
+ <__unstableBlockNameContext.Provider
156
+ value={ blockType?.name }
157
+ >
158
+ <__unstableBlockToolbarLastItem.Slot />
159
+ </__unstableBlockNameContext.Provider>
149
160
  </>
150
161
  ) }
151
162
  <BlockSettingsMenu clientIds={ blockClientIds } />
152
163
  </div>
153
164
  );
154
- }
165
+ };
166
+
167
+ /**
168
+ * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-toolbar/README.md
169
+ */
170
+ export default BlockToolbar;
@@ -95,6 +95,12 @@
95
95
  .block-editor-block-lock-toolbar {
96
96
  margin-left: -$grid-unit-15 * 0.5 !important;
97
97
  }
98
+
99
+ // @todo: override toolbar group inherited paddings from components/block-tools/style.scss.
100
+ // This is best fixed by making the mover control area a proper single toolbar group.
101
+ .components-toolbar-group {
102
+ padding: 0;
103
+ }
98
104
  }
99
105
 
100
106
  .block-editor-block-toolbar,
@@ -92,25 +92,6 @@ export default function BlockTools( {
92
92
  event.preventDefault();
93
93
  insertBeforeBlock( first( clientIds ) );
94
94
  }
95
- } else if (
96
- isMatch( 'core/block-editor/delete-multi-selection', event )
97
- ) {
98
- /**
99
- * Check if the target element is a text area, input or
100
- * event.defaultPrevented and return early. In all these
101
- * cases backspace could be handled elsewhere.
102
- */
103
- if (
104
- [ 'INPUT', 'TEXTAREA' ].includes( event.target.nodeName ) ||
105
- event.defaultPrevented
106
- ) {
107
- return;
108
- }
109
- const clientIds = getSelectedBlockClientIds();
110
- if ( clientIds.length > 1 ) {
111
- event.preventDefault();
112
- removeBlocks( clientIds );
113
- }
114
95
  } else if ( isMatch( 'core/block-editor/unselect', event ) ) {
115
96
  const clientIds = getSelectedBlockClientIds();
116
97
  if ( clientIds.length > 1 ) {
@@ -312,16 +312,14 @@
312
312
  // Size multiple sequential buttons to be optically balanced.
313
313
  // Icons are 36px, as set by a 24px icon and 12px padding.
314
314
  .block-editor-block-toolbar > .components-toolbar > .block-editor-block-toolbar__slot, // When a plugin adds to a slot, the segment has a `components-toolbar` class.
315
- .block-editor-block-toolbar > .components-toolbar-group > .block-editor-block-toolbar__slot, // When no plugin adds to slots, the segment has a `components-toolbar-group` class.
316
315
  .block-editor-block-toolbar > .block-editor-block-toolbar__slot > .components-toolbar, // The nesting order is sometimes reversed.
317
316
  .block-editor-block-toolbar > .block-editor-block-toolbar__slot > .components-dropdown, // Targets unique markup for the "Replace" button.
318
- .block-editor-block-toolbar .block-editor-block-toolbar__slot .components-toolbar-group { // Inline formatting tools use this class.
317
+ .block-editor-block-toolbar .components-toolbar-group {
319
318
  padding-left: $grid-unit-15 * 0.5; // 6px.
320
319
  padding-right: $grid-unit-15 * 0.5;
321
320
 
322
- > .components-button,
323
- > div > .components-button,
324
- > .components-dropdown .components-button {
321
+ .components-button,
322
+ .components-button.has-icon.has-icon {
325
323
  min-width: $block-toolbar-height - $grid-unit-15;
326
324
  padding-left: $grid-unit-15 * 0.5; // 6px.
327
325
  padding-right: $grid-unit-15 * 0.5;