@wordpress/block-editor 8.4.0 → 8.5.2

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 (421) 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-alignment-control/ui.js +1 -1
  8. package/build/components/block-alignment-control/ui.js.map +1 -1
  9. package/build/components/block-content-overlay/index.js +13 -4
  10. package/build/components/block-content-overlay/index.js.map +1 -1
  11. package/build/components/block-draggable/index.js +2 -3
  12. package/build/components/block-draggable/index.js.map +1 -1
  13. package/build/components/block-icon/index.js +4 -0
  14. package/build/components/block-icon/index.js.map +1 -1
  15. package/build/components/block-inspector/index.js +6 -1
  16. package/build/components/block-inspector/index.js.map +1 -1
  17. package/build/components/block-list/use-block-props/index.js +1 -6
  18. package/build/components/block-list/use-block-props/index.js.map +1 -1
  19. package/build/components/block-list/use-block-props/use-focus-first-element.js +14 -17
  20. package/build/components/block-list/use-block-props/use-focus-first-element.js.map +1 -1
  21. package/build/components/block-list/use-block-props/use-focus-handler.js +7 -1
  22. package/build/components/block-list/use-block-props/use-focus-handler.js.map +1 -1
  23. package/build/components/block-list-appender/index.js +6 -1
  24. package/build/components/block-list-appender/index.js.map +1 -1
  25. package/build/components/block-lock/index.js +8 -0
  26. package/build/components/block-lock/index.js.map +1 -1
  27. package/build/components/block-lock/menu-item.js +9 -15
  28. package/build/components/block-lock/menu-item.js.map +1 -1
  29. package/build/components/block-lock/modal.js +35 -23
  30. package/build/components/block-lock/modal.js.map +1 -1
  31. package/build/components/block-lock/toolbar.js +11 -16
  32. package/build/components/block-lock/toolbar.js.map +1 -1
  33. package/build/components/block-lock/use-block-lock.js +50 -0
  34. package/build/components/block-lock/use-block-lock.js.map +1 -0
  35. package/build/components/block-mover/index.js +4 -0
  36. package/build/components/block-mover/index.js.map +1 -1
  37. package/build/components/block-pattern-setup/index.js +37 -22
  38. package/build/components/block-pattern-setup/index.js.map +1 -1
  39. package/build/components/block-pattern-setup/setup-toolbar.js +1 -1
  40. package/build/components/block-pattern-setup/setup-toolbar.js.map +1 -1
  41. package/build/components/block-preview/auto.js +6 -3
  42. package/build/components/block-preview/auto.js.map +1 -1
  43. package/build/components/block-preview/index.js +4 -2
  44. package/build/components/block-preview/index.js.map +1 -1
  45. package/build/components/block-settings-menu/block-settings-dropdown.js +50 -5
  46. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  47. package/build/components/block-switcher/index.js +8 -3
  48. package/build/components/block-switcher/index.js.map +1 -1
  49. package/build/components/block-title/index.js +2 -2
  50. package/build/components/block-title/index.js.map +1 -1
  51. package/build/components/block-title/use-block-display-title.js +1 -1
  52. package/build/components/block-title/use-block-display-title.js.map +1 -1
  53. package/build/components/block-toolbar/block-name-context.js +17 -0
  54. package/build/components/block-toolbar/block-name-context.js.map +1 -0
  55. package/build/components/block-toolbar/block-toolbar-last-item.js +20 -0
  56. package/build/components/block-toolbar/block-toolbar-last-item.js.map +1 -0
  57. package/build/components/block-toolbar/index.js +20 -5
  58. package/build/components/block-toolbar/index.js.map +1 -1
  59. package/build/components/block-tools/index.js +0 -16
  60. package/build/components/block-tools/index.js.map +1 -1
  61. package/build/components/block-variation-transforms/index.js +92 -47
  62. package/build/components/block-variation-transforms/index.js.map +1 -1
  63. package/build/components/block-vertical-alignment-control/index.js +13 -6
  64. package/build/components/block-vertical-alignment-control/index.js.map +1 -1
  65. package/build/components/contrast-checker/index.js +4 -0
  66. package/build/components/contrast-checker/index.js.map +1 -1
  67. package/build/components/convert-to-group-buttons/index.js +8 -0
  68. package/build/components/convert-to-group-buttons/index.js.map +1 -1
  69. package/build/components/convert-to-group-buttons/toolbar.js +105 -0
  70. package/build/components/convert-to-group-buttons/toolbar.js.map +1 -0
  71. package/build/components/copy-handler/index.js +48 -9
  72. package/build/components/copy-handler/index.js.map +1 -1
  73. package/build/components/font-sizes/font-size-picker.js +4 -0
  74. package/build/components/font-sizes/font-size-picker.js.map +1 -1
  75. package/build/components/iframe/index.js +6 -9
  76. package/build/components/iframe/index.js.map +1 -1
  77. package/build/components/index.js +18 -0
  78. package/build/components/index.js.map +1 -1
  79. package/build/components/justify-content-control/index.js +13 -6
  80. package/build/components/justify-content-control/index.js.map +1 -1
  81. package/build/components/keyboard-shortcuts/index.js +1 -1
  82. package/build/components/keyboard-shortcuts/index.js.map +1 -1
  83. package/build/components/line-height-control/index.js +10 -3
  84. package/build/components/line-height-control/index.js.map +1 -1
  85. package/build/components/link-control/index.js +6 -7
  86. package/build/components/link-control/index.js.map +1 -1
  87. package/build/components/list-view/block-select-button.js +19 -6
  88. package/build/components/list-view/block-select-button.js.map +1 -1
  89. package/build/components/list-view/block.js +18 -3
  90. package/build/components/list-view/block.js.map +1 -1
  91. package/build/components/list-view/branch.js +1 -1
  92. package/build/components/list-view/branch.js.map +1 -1
  93. package/build/components/media-replace-flow/index.js +4 -0
  94. package/build/components/media-replace-flow/index.js.map +1 -1
  95. package/build/components/multi-selection-inspector/index.js +1 -1
  96. package/build/components/multi-selection-inspector/index.js.map +1 -1
  97. package/build/components/rich-text/index.js +26 -4
  98. package/build/components/rich-text/index.js.map +1 -1
  99. package/build/components/rich-text/split-value.js +12 -2
  100. package/build/components/rich-text/split-value.js.map +1 -1
  101. package/build/components/rich-text/use-firefox-compat.js +49 -0
  102. package/build/components/rich-text/use-firefox-compat.js.map +1 -0
  103. package/build/components/rich-text/use-input-rules.js +34 -2
  104. package/build/components/rich-text/use-input-rules.js.map +1 -1
  105. package/build/components/skip-to-selected-block/index.js +4 -0
  106. package/build/components/skip-to-selected-block/index.js.map +1 -1
  107. package/build/components/writing-flow/index.js +9 -1
  108. package/build/components/writing-flow/index.js.map +1 -1
  109. package/build/components/writing-flow/use-arrow-nav.js +3 -44
  110. package/build/components/writing-flow/use-arrow-nav.js.map +1 -1
  111. package/build/components/writing-flow/use-click-selection.js +68 -0
  112. package/build/components/writing-flow/use-click-selection.js.map +1 -0
  113. package/build/components/writing-flow/use-drag-selection.js +134 -0
  114. package/build/components/writing-flow/use-drag-selection.js.map +1 -0
  115. package/build/components/writing-flow/use-input.js +116 -0
  116. package/build/components/writing-flow/use-input.js.map +1 -0
  117. package/build/components/writing-flow/use-multi-selection.js +18 -38
  118. package/build/components/writing-flow/use-multi-selection.js.map +1 -1
  119. package/build/components/writing-flow/use-selection-observer.js +161 -0
  120. package/build/components/writing-flow/use-selection-observer.js.map +1 -0
  121. package/build/components/writing-flow/use-tab-nav.js +1 -8
  122. package/build/components/writing-flow/use-tab-nav.js.map +1 -1
  123. package/build/hooks/border-color.js +3 -3
  124. package/build/hooks/border-color.js.map +1 -1
  125. package/build/hooks/border.js +0 -14
  126. package/build/hooks/border.js.map +1 -1
  127. package/build/hooks/color.js +20 -17
  128. package/build/hooks/color.js.map +1 -1
  129. package/build/hooks/font-family.js +5 -1
  130. package/build/hooks/font-family.js.map +1 -1
  131. package/build/hooks/font-size.js +4 -2
  132. package/build/hooks/font-size.js.map +1 -1
  133. package/build/hooks/gap.js +23 -16
  134. package/build/hooks/gap.js.map +1 -1
  135. package/build/hooks/layout.js +7 -2
  136. package/build/hooks/layout.js.map +1 -1
  137. package/build/hooks/style.js +34 -3
  138. package/build/hooks/style.js.map +1 -1
  139. package/build/hooks/utils.js +29 -0
  140. package/build/hooks/utils.js.map +1 -1
  141. package/build/layouts/flex.js +76 -12
  142. package/build/layouts/flex.js.map +1 -1
  143. package/build/layouts/flow.js +9 -4
  144. package/build/layouts/flow.js.map +1 -1
  145. package/build/store/actions.js +290 -51
  146. package/build/store/actions.js.map +1 -1
  147. package/build/store/defaults.js +5 -2
  148. package/build/store/defaults.js.map +1 -1
  149. package/build/store/reducer.js +25 -13
  150. package/build/store/reducer.js.map +1 -1
  151. package/build/store/selectors.js +264 -21
  152. package/build/store/selectors.js.map +1 -1
  153. package/build/store/utils.js +27 -0
  154. package/build/store/utils.js.map +1 -0
  155. package/build/utils/dom.js +2 -1
  156. package/build/utils/dom.js.map +1 -1
  157. package/build-module/components/alignment-control/index.js +12 -4
  158. package/build-module/components/alignment-control/index.js.map +1 -1
  159. package/build-module/components/block-alignment-control/index.js +12 -4
  160. package/build-module/components/block-alignment-control/index.js.map +1 -1
  161. package/build-module/components/block-alignment-control/ui.js +2 -2
  162. package/build-module/components/block-alignment-control/ui.js.map +1 -1
  163. package/build-module/components/block-content-overlay/index.js +13 -4
  164. package/build-module/components/block-content-overlay/index.js.map +1 -1
  165. package/build-module/components/block-draggable/index.js +2 -3
  166. package/build-module/components/block-draggable/index.js.map +1 -1
  167. package/build-module/components/block-icon/index.js +4 -0
  168. package/build-module/components/block-icon/index.js.map +1 -1
  169. package/build-module/components/block-inspector/index.js +6 -1
  170. package/build-module/components/block-inspector/index.js.map +1 -1
  171. package/build-module/components/block-list/use-block-props/index.js +1 -4
  172. package/build-module/components/block-list/use-block-props/index.js.map +1 -1
  173. package/build-module/components/block-list/use-block-props/use-focus-first-element.js +15 -17
  174. package/build-module/components/block-list/use-block-props/use-focus-first-element.js.map +1 -1
  175. package/build-module/components/block-list/use-block-props/use-focus-handler.js +7 -1
  176. package/build-module/components/block-list/use-block-props/use-focus-handler.js.map +1 -1
  177. package/build-module/components/block-list-appender/index.js +6 -1
  178. package/build-module/components/block-list-appender/index.js.map +1 -1
  179. package/build-module/components/block-lock/index.js +1 -0
  180. package/build-module/components/block-lock/index.js.map +1 -1
  181. package/build-module/components/block-lock/menu-item.js +8 -13
  182. package/build-module/components/block-lock/menu-item.js.map +1 -1
  183. package/build-module/components/block-lock/modal.js +34 -24
  184. package/build-module/components/block-lock/modal.js.map +1 -1
  185. package/build-module/components/block-lock/toolbar.js +10 -14
  186. package/build-module/components/block-lock/toolbar.js.map +1 -1
  187. package/build-module/components/block-lock/use-block-lock.js +41 -0
  188. package/build-module/components/block-lock/use-block-lock.js.map +1 -0
  189. package/build-module/components/block-mover/index.js +4 -0
  190. package/build-module/components/block-mover/index.js.map +1 -1
  191. package/build-module/components/block-pattern-setup/index.js +39 -24
  192. package/build-module/components/block-pattern-setup/index.js.map +1 -1
  193. package/build-module/components/block-pattern-setup/setup-toolbar.js +1 -1
  194. package/build-module/components/block-pattern-setup/setup-toolbar.js.map +1 -1
  195. package/build-module/components/block-preview/auto.js +6 -3
  196. package/build-module/components/block-preview/auto.js.map +1 -1
  197. package/build-module/components/block-preview/index.js +4 -2
  198. package/build-module/components/block-preview/index.js.map +1 -1
  199. package/build-module/components/block-settings-menu/block-settings-dropdown.js +50 -7
  200. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  201. package/build-module/components/block-switcher/index.js +9 -4
  202. package/build-module/components/block-switcher/index.js.map +1 -1
  203. package/build-module/components/block-title/index.js +2 -2
  204. package/build-module/components/block-title/index.js.map +1 -1
  205. package/build-module/components/block-title/use-block-display-title.js +1 -1
  206. package/build-module/components/block-title/use-block-display-title.js.map +1 -1
  207. package/build-module/components/block-toolbar/block-name-context.js +9 -0
  208. package/build-module/components/block-toolbar/block-name-context.js.map +1 -0
  209. package/build-module/components/block-toolbar/block-toolbar-last-item.js +11 -0
  210. package/build-module/components/block-toolbar/block-toolbar-last-item.js.map +1 -0
  211. package/build-module/components/block-toolbar/index.js +16 -4
  212. package/build-module/components/block-toolbar/index.js.map +1 -1
  213. package/build-module/components/block-tools/index.js +0 -16
  214. package/build-module/components/block-tools/index.js.map +1 -1
  215. package/build-module/components/block-variation-transforms/index.js +95 -49
  216. package/build-module/components/block-variation-transforms/index.js.map +1 -1
  217. package/build-module/components/block-vertical-alignment-control/index.js +12 -4
  218. package/build-module/components/block-vertical-alignment-control/index.js.map +1 -1
  219. package/build-module/components/contrast-checker/index.js +4 -0
  220. package/build-module/components/contrast-checker/index.js.map +1 -1
  221. package/build-module/components/convert-to-group-buttons/index.js +2 -1
  222. package/build-module/components/convert-to-group-buttons/index.js.map +1 -1
  223. package/build-module/components/convert-to-group-buttons/toolbar.js +90 -0
  224. package/build-module/components/convert-to-group-buttons/toolbar.js.map +1 -0
  225. package/build-module/components/copy-handler/index.js +48 -9
  226. package/build-module/components/copy-handler/index.js.map +1 -1
  227. package/build-module/components/font-sizes/font-size-picker.js +4 -0
  228. package/build-module/components/font-sizes/font-size-picker.js.map +1 -1
  229. package/build-module/components/iframe/index.js +6 -9
  230. package/build-module/components/iframe/index.js.map +1 -1
  231. package/build-module/components/index.js +2 -0
  232. package/build-module/components/index.js.map +1 -1
  233. package/build-module/components/justify-content-control/index.js +12 -4
  234. package/build-module/components/justify-content-control/index.js.map +1 -1
  235. package/build-module/components/keyboard-shortcuts/index.js +1 -1
  236. package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
  237. package/build-module/components/line-height-control/index.js +9 -2
  238. package/build-module/components/line-height-control/index.js.map +1 -1
  239. package/build-module/components/link-control/index.js +6 -7
  240. package/build-module/components/link-control/index.js.map +1 -1
  241. package/build-module/components/list-view/block-select-button.js +17 -6
  242. package/build-module/components/list-view/block-select-button.js.map +1 -1
  243. package/build-module/components/list-view/block.js +18 -3
  244. package/build-module/components/list-view/block.js.map +1 -1
  245. package/build-module/components/list-view/branch.js +1 -1
  246. package/build-module/components/list-view/branch.js.map +1 -1
  247. package/build-module/components/media-replace-flow/index.js +4 -0
  248. package/build-module/components/media-replace-flow/index.js.map +1 -1
  249. package/build-module/components/multi-selection-inspector/index.js +2 -2
  250. package/build-module/components/multi-selection-inspector/index.js.map +1 -1
  251. package/build-module/components/rich-text/index.js +25 -4
  252. package/build-module/components/rich-text/index.js.map +1 -1
  253. package/build-module/components/rich-text/split-value.js +12 -2
  254. package/build-module/components/rich-text/split-value.js.map +1 -1
  255. package/build-module/components/rich-text/use-firefox-compat.js +39 -0
  256. package/build-module/components/rich-text/use-firefox-compat.js.map +1 -0
  257. package/build-module/components/rich-text/use-input-rules.js +35 -4
  258. package/build-module/components/rich-text/use-input-rules.js.map +1 -1
  259. package/build-module/components/skip-to-selected-block/index.js +4 -0
  260. package/build-module/components/skip-to-selected-block/index.js.map +1 -1
  261. package/build-module/components/writing-flow/index.js +5 -1
  262. package/build-module/components/writing-flow/index.js.map +1 -1
  263. package/build-module/components/writing-flow/use-arrow-nav.js +4 -45
  264. package/build-module/components/writing-flow/use-arrow-nav.js.map +1 -1
  265. package/build-module/components/writing-flow/use-click-selection.js +57 -0
  266. package/build-module/components/writing-flow/use-click-selection.js.map +1 -0
  267. package/build-module/components/writing-flow/use-drag-selection.js +124 -0
  268. package/build-module/components/writing-flow/use-drag-selection.js.map +1 -0
  269. package/build-module/components/writing-flow/use-input.js +104 -0
  270. package/build-module/components/writing-flow/use-input.js.map +1 -0
  271. package/build-module/components/writing-flow/use-multi-selection.js +18 -37
  272. package/build-module/components/writing-flow/use-multi-selection.js.map +1 -1
  273. package/build-module/components/writing-flow/use-selection-observer.js +150 -0
  274. package/build-module/components/writing-flow/use-selection-observer.js.map +1 -0
  275. package/build-module/components/writing-flow/use-tab-nav.js +1 -9
  276. package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
  277. package/build-module/hooks/border-color.js +5 -5
  278. package/build-module/hooks/border-color.js.map +1 -1
  279. package/build-module/hooks/border.js +0 -12
  280. package/build-module/hooks/border.js.map +1 -1
  281. package/build-module/hooks/color.js +19 -18
  282. package/build-module/hooks/color.js.map +1 -1
  283. package/build-module/hooks/font-family.js +3 -1
  284. package/build-module/hooks/font-family.js.map +1 -1
  285. package/build-module/hooks/font-size.js +4 -3
  286. package/build-module/hooks/font-size.js.map +1 -1
  287. package/build-module/hooks/gap.js +22 -15
  288. package/build-module/hooks/gap.js.map +1 -1
  289. package/build-module/hooks/layout.js +7 -2
  290. package/build-module/hooks/layout.js.map +1 -1
  291. package/build-module/hooks/style.js +33 -3
  292. package/build-module/hooks/style.js.map +1 -1
  293. package/build-module/hooks/utils.js +26 -0
  294. package/build-module/hooks/utils.js.map +1 -1
  295. package/build-module/layouts/flex.js +76 -13
  296. package/build-module/layouts/flex.js.map +1 -1
  297. package/build-module/layouts/flow.js +9 -5
  298. package/build-module/layouts/flow.js.map +1 -1
  299. package/build-module/store/actions.js +277 -49
  300. package/build-module/store/actions.js.map +1 -1
  301. package/build-module/store/defaults.js +5 -2
  302. package/build-module/store/defaults.js.map +1 -1
  303. package/build-module/store/reducer.js +25 -13
  304. package/build-module/store/reducer.js.map +1 -1
  305. package/build-module/store/selectors.js +250 -21
  306. package/build-module/store/selectors.js.map +1 -1
  307. package/build-module/store/utils.js +20 -0
  308. package/build-module/store/utils.js.map +1 -0
  309. package/build-module/utils/dom.js +2 -1
  310. package/build-module/utils/dom.js.map +1 -1
  311. package/build-style/style-rtl.css +142 -101
  312. package/build-style/style.css +142 -101
  313. package/build-types/utils/dom.d.ts.map +1 -1
  314. package/package.json +28 -28
  315. package/src/components/alignment-control/index.js +9 -4
  316. package/src/components/block-alignment-control/index.js +9 -4
  317. package/src/components/block-alignment-control/ui.js +2 -2
  318. package/src/components/block-content-overlay/index.js +19 -2
  319. package/src/components/block-draggable/index.js +2 -5
  320. package/src/components/block-icon/index.js +3 -0
  321. package/src/components/block-inspector/index.js +4 -0
  322. package/src/components/block-list/style.scss +4 -5
  323. package/src/components/block-list/use-block-props/index.js +0 -5
  324. package/src/components/block-list/use-block-props/use-focus-first-element.js +19 -26
  325. package/src/components/block-list/use-block-props/use-focus-handler.js +8 -0
  326. package/src/components/block-list-appender/index.js +5 -0
  327. package/src/components/block-lock/index.js +1 -0
  328. package/src/components/block-lock/menu-item.js +6 -19
  329. package/src/components/block-lock/modal.js +52 -23
  330. package/src/components/block-lock/style.scss +7 -5
  331. package/src/components/block-lock/toolbar.js +7 -14
  332. package/src/components/block-lock/use-block-lock.js +45 -0
  333. package/src/components/block-mover/index.js +3 -0
  334. package/src/components/block-mover/style.scss +4 -0
  335. package/src/components/block-pattern-setup/index.js +84 -59
  336. package/src/components/block-pattern-setup/setup-toolbar.js +3 -1
  337. package/src/components/block-pattern-setup/style.scss +32 -26
  338. package/src/components/block-preview/auto.js +10 -1
  339. package/src/components/block-preview/index.js +2 -0
  340. package/src/components/block-settings-menu/block-settings-dropdown.js +62 -4
  341. package/src/components/block-switcher/index.js +15 -3
  342. package/src/components/block-switcher/style.scss +15 -4
  343. package/src/components/block-switcher/test/__snapshots__/index.js.snap +15 -13
  344. package/src/components/block-switcher/test/index.js +2 -2
  345. package/src/components/block-title/index.js +2 -2
  346. package/src/components/block-title/use-block-display-title.js +1 -1
  347. package/src/components/block-toolbar/block-name-context.js +8 -0
  348. package/src/components/block-toolbar/block-toolbar-last-item.js +12 -0
  349. package/src/components/block-toolbar/index.js +18 -2
  350. package/src/components/block-toolbar/style.scss +6 -0
  351. package/src/components/block-tools/index.js +0 -19
  352. package/src/components/block-tools/style.scss +3 -5
  353. package/src/components/block-variation-transforms/index.js +105 -36
  354. package/src/components/block-variation-transforms/style.scss +1 -1
  355. package/src/components/block-vertical-alignment-control/index.js +9 -4
  356. package/src/components/button-block-appender/style.scss +5 -1
  357. package/src/components/contrast-checker/index.js +3 -0
  358. package/src/components/convert-to-group-buttons/index.js +6 -1
  359. package/src/components/convert-to-group-buttons/toolbar.js +87 -0
  360. package/src/components/copy-handler/index.js +55 -10
  361. package/src/components/font-sizes/font-size-picker.js +3 -0
  362. package/src/components/iframe/index.js +5 -7
  363. package/src/components/index.js +2 -0
  364. package/src/components/justify-content-control/index.js +9 -4
  365. package/src/components/keyboard-shortcuts/index.js +1 -1
  366. package/src/components/line-height-control/index.js +8 -3
  367. package/src/components/link-control/index.js +5 -5
  368. package/src/components/list-view/block-select-button.js +13 -3
  369. package/src/components/list-view/block.js +24 -8
  370. package/src/components/list-view/branch.js +1 -1
  371. package/src/components/list-view/style.scss +56 -14
  372. package/src/components/media-placeholder/README.md +8 -0
  373. package/src/components/media-replace-flow/index.js +3 -0
  374. package/src/components/multi-selection-inspector/index.js +2 -2
  375. package/src/components/rich-text/index.js +24 -1
  376. package/src/components/rich-text/split-value.js +5 -1
  377. package/src/components/rich-text/use-firefox-compat.js +39 -0
  378. package/src/components/rich-text/use-input-rules.js +40 -3
  379. package/src/components/skip-to-selected-block/index.js +3 -0
  380. package/src/components/url-input/style.scss +3 -2
  381. package/src/components/writing-flow/index.js +8 -0
  382. package/src/components/writing-flow/readme.md +28 -0
  383. package/src/components/writing-flow/use-arrow-nav.js +4 -53
  384. package/src/components/writing-flow/use-click-selection.js +65 -0
  385. package/src/components/writing-flow/use-drag-selection.js +126 -0
  386. package/src/components/writing-flow/use-input.js +112 -0
  387. package/src/components/writing-flow/use-multi-selection.js +13 -36
  388. package/src/components/writing-flow/use-selection-observer.js +153 -0
  389. package/src/components/writing-flow/use-tab-nav.js +1 -11
  390. package/src/hooks/border-color.js +5 -5
  391. package/src/hooks/border.js +0 -13
  392. package/src/hooks/color.js +51 -24
  393. package/src/hooks/font-family.js +5 -2
  394. package/src/hooks/font-size.js +10 -7
  395. package/src/hooks/gap.js +25 -17
  396. package/src/hooks/layout.js +11 -1
  397. package/src/hooks/style.js +40 -4
  398. package/src/hooks/test/gap.js +25 -1
  399. package/src/hooks/test/style.js +94 -0
  400. package/src/hooks/test/utils.js +1 -1
  401. package/src/hooks/utils.js +26 -0
  402. package/src/layouts/flex.js +89 -5
  403. package/src/layouts/flow.js +15 -4
  404. package/src/store/actions.js +341 -32
  405. package/src/store/defaults.js +7 -2
  406. package/src/store/reducer.js +25 -10
  407. package/src/store/selectors.js +329 -26
  408. package/src/store/test/selectors.js +242 -5
  409. package/src/store/utils.js +19 -0
  410. package/src/utils/dom.js +2 -1
  411. package/tsconfig.tsbuildinfo +1 -1
  412. package/build/components/block-list/use-block-props/use-multi-selection.js +0 -205
  413. package/build/components/block-list/use-block-props/use-multi-selection.js.map +0 -1
  414. package/build/components/block-list/use-block-props/use-scroll-into-view.js +0 -77
  415. package/build/components/block-list/use-block-props/use-scroll-into-view.js.map +0 -1
  416. package/build-module/components/block-list/use-block-props/use-multi-selection.js +0 -192
  417. package/build-module/components/block-list/use-block-props/use-multi-selection.js.map +0 -1
  418. package/build-module/components/block-list/use-block-props/use-scroll-into-view.js +0 -63
  419. package/build-module/components/block-list/use-block-props/use-scroll-into-view.js.map +0 -1
  420. package/src/components/block-list/use-block-props/use-multi-selection.js +0 -227
  421. package/src/components/block-list/use-block-props/use-scroll-into-view.js +0 -73
@@ -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;
@@ -2,47 +2,63 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import { store as blocksStore } from '@wordpress/blocks';
5
- import { __ } from '@wordpress/i18n';
5
+ import { __, sprintf } from '@wordpress/i18n';
6
6
  import {
7
+ Button,
7
8
  DropdownMenu,
8
9
  MenuGroup,
9
10
  MenuItemsChoice,
11
+ VisuallyHidden,
10
12
  } from '@wordpress/components';
11
13
  import { useSelect, useDispatch } from '@wordpress/data';
12
- import { useState, useEffect } from '@wordpress/element';
14
+ import { useMemo } from '@wordpress/element';
13
15
  import { chevronDown } from '@wordpress/icons';
14
16
 
15
17
  /**
16
18
  * Internal dependencies
17
19
  */
18
- import { __experimentalGetMatchingVariation as getMatchingVariation } from '../../utils';
19
20
  import { store as blockEditorStore } from '../../store';
20
21
 
21
- function __experimentalBlockVariationTransforms( { blockClientId } ) {
22
- const [ selectedValue, setSelectedValue ] = useState();
23
- const { updateBlockAttributes } = useDispatch( blockEditorStore );
24
- const { variations, blockAttributes } = useSelect(
25
- ( select ) => {
26
- const { getBlockVariations } = select( blocksStore );
27
- const { getBlockName, getBlockAttributes } = select(
28
- blockEditorStore
29
- );
30
- const blockName = blockClientId && getBlockName( blockClientId );
31
- return {
32
- variations:
33
- blockName && getBlockVariations( blockName, 'transform' ),
34
- blockAttributes: getBlockAttributes( blockClientId ),
35
- };
36
- },
37
- [ blockClientId ]
22
+ function VariationsButtons( {
23
+ className,
24
+ onSelectVariation,
25
+ selectedValue,
26
+ variations,
27
+ } ) {
28
+ return (
29
+ <fieldset className={ className }>
30
+ <VisuallyHidden as="legend">
31
+ { __( 'Transform to variation' ) }
32
+ </VisuallyHidden>
33
+ { variations.map( ( variation ) => (
34
+ <Button
35
+ key={ variation.name }
36
+ icon={ variation.icon }
37
+ isPressed={ selectedValue === variation.name }
38
+ label={
39
+ selectedValue === variation.name
40
+ ? variation.title
41
+ : sprintf(
42
+ /* translators: %s: Name of the block variation */
43
+ __( 'Transform to %s' ),
44
+ variation.title
45
+ )
46
+ }
47
+ onClick={ () => onSelectVariation( variation.name ) }
48
+ aria-label={ variation.title }
49
+ showTooltip
50
+ />
51
+ ) ) }
52
+ </fieldset>
38
53
  );
39
- useEffect( () => {
40
- setSelectedValue(
41
- getMatchingVariation( blockAttributes, variations )?.name
42
- );
43
- }, [ blockAttributes, variations ] );
44
- if ( ! variations?.length ) return null;
54
+ }
45
55
 
56
+ function VariationsDropdown( {
57
+ className,
58
+ onSelectVariation,
59
+ selectedValue,
60
+ variations,
61
+ } ) {
46
62
  const selectOptions = variations.map(
47
63
  ( { name, title, description } ) => ( {
48
64
  value: name,
@@ -50,27 +66,21 @@ function __experimentalBlockVariationTransforms( { blockClientId } ) {
50
66
  info: description,
51
67
  } )
52
68
  );
53
- const onSelectVariation = ( variationName ) => {
54
- updateBlockAttributes( blockClientId, {
55
- ...variations.find( ( { name } ) => name === variationName )
56
- .attributes,
57
- } );
58
- };
59
- const baseClass = 'block-editor-block-variation-transforms';
69
+
60
70
  return (
61
71
  <DropdownMenu
62
- className={ baseClass }
72
+ className={ className }
63
73
  label={ __( 'Transform to variation' ) }
64
74
  text={ __( 'Transform to variation' ) }
65
75
  popoverProps={ {
66
76
  position: 'bottom center',
67
- className: `${ baseClass }__popover`,
77
+ className: `${ className }__popover`,
68
78
  } }
69
79
  icon={ chevronDown }
70
80
  toggleProps={ { iconPosition: 'right' } }
71
81
  >
72
82
  { () => (
73
- <div className={ `${ baseClass }__container` }>
83
+ <div className={ `${ className }__container` }>
74
84
  <MenuGroup>
75
85
  <MenuItemsChoice
76
86
  choices={ selectOptions }
@@ -84,4 +94,63 @@ function __experimentalBlockVariationTransforms( { blockClientId } ) {
84
94
  );
85
95
  }
86
96
 
97
+ function __experimentalBlockVariationTransforms( { blockClientId } ) {
98
+ const { updateBlockAttributes } = useDispatch( blockEditorStore );
99
+ const { activeBlockVariation, variations } = useSelect(
100
+ ( select ) => {
101
+ const { getActiveBlockVariation, getBlockVariations } = select(
102
+ blocksStore
103
+ );
104
+ const { getBlockName, getBlockAttributes } = select(
105
+ blockEditorStore
106
+ );
107
+ const name = blockClientId && getBlockName( blockClientId );
108
+ return {
109
+ activeBlockVariation: getActiveBlockVariation(
110
+ name,
111
+ getBlockAttributes( blockClientId )
112
+ ),
113
+ variations: name && getBlockVariations( name, 'transform' ),
114
+ };
115
+ },
116
+ [ blockClientId ]
117
+ );
118
+
119
+ const selectedValue = activeBlockVariation?.name;
120
+
121
+ // Check if each variation has a unique icon.
122
+ const hasUniqueIcons = useMemo( () => {
123
+ const variationIcons = new Set();
124
+ variations.forEach( ( variation ) => {
125
+ if ( variation.icon ) {
126
+ variationIcons.add( variation.icon );
127
+ }
128
+ } );
129
+ return variationIcons.size === variations.length;
130
+ }, [ variations ] );
131
+
132
+ const onSelectVariation = ( variationName ) => {
133
+ updateBlockAttributes( blockClientId, {
134
+ ...variations.find( ( { name } ) => name === variationName )
135
+ .attributes,
136
+ } );
137
+ };
138
+
139
+ const baseClass = 'block-editor-block-variation-transforms';
140
+
141
+ // Skip rendering if there are no variations
142
+ if ( ! variations?.length ) return null;
143
+
144
+ const Component = hasUniqueIcons ? VariationsButtons : VariationsDropdown;
145
+
146
+ return (
147
+ <Component
148
+ className={ baseClass }
149
+ onSelectVariation={ onSelectVariation }
150
+ selectedValue={ selectedValue }
151
+ variations={ variations }
152
+ />
153
+ );
154
+ }
155
+
87
156
  export default __experimentalBlockVariationTransforms;
@@ -1,5 +1,5 @@
1
1
  .block-editor-block-variation-transforms {
2
- padding: 0 $grid-unit-20 $grid-unit-20 56px;
2
+ padding: 0 $grid-unit-20 $grid-unit-20 52px;
3
3
  width: 100%;
4
4
 
5
5
  .components-dropdown-menu__toggle {
@@ -3,10 +3,15 @@
3
3
  */
4
4
  import BlockVerticalAlignmentUI from './ui';
5
5
 
6
- export function BlockVerticalAlignmentControl( props ) {
6
+ const BlockVerticalAlignmentControl = ( props ) => {
7
7
  return <BlockVerticalAlignmentUI { ...props } isToolbar={ false } />;
8
- }
8
+ };
9
9
 
10
- export function BlockVerticalAlignmentToolbar( props ) {
10
+ const BlockVerticalAlignmentToolbar = ( props ) => {
11
11
  return <BlockVerticalAlignmentUI { ...props } isToolbar />;
12
- }
12
+ };
13
+
14
+ /**
15
+ * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-vertical-alignment-control/README.md
16
+ */
17
+ export { BlockVerticalAlignmentControl, BlockVerticalAlignmentToolbar };
@@ -3,12 +3,16 @@
3
3
  flex-direction: column;
4
4
  align-items: center;
5
5
  justify-content: center;
6
- padding: $grid-unit-10;
7
6
  width: 100%;
8
7
  height: auto;
9
8
  color: $gray-900;
10
9
  box-shadow: inset 0 0 0 $border-width $gray-900;
11
10
 
11
+ // Needs specificity to override button styles.
12
+ &.components-button.components-button {
13
+ padding: $grid-unit-15;
14
+ }
15
+
12
16
  .is-dark-theme & {
13
17
  color: $light-gray-placeholder;
14
18
  box-shadow: inset 0 0 0 $border-width $light-gray-placeholder;
@@ -138,4 +138,7 @@ function ContrastChecker( {
138
138
  );
139
139
  }
140
140
 
141
+ /**
142
+ * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/contrast-checker/README.md
143
+ */
141
144
  export default ContrastChecker;
@@ -11,6 +11,7 @@ import { useDispatch } from '@wordpress/data';
11
11
  */
12
12
  import { store as blockEditorStore } from '../../store';
13
13
  import useConvertToGroupButtonProps from './use-convert-to-group-button-props';
14
+ import BlockGroupToolbar from './toolbar';
14
15
 
15
16
  function ConvertToGroupButton( {
16
17
  clientIds,
@@ -73,4 +74,8 @@ function ConvertToGroupButton( {
73
74
  );
74
75
  }
75
76
 
76
- export { useConvertToGroupButtonProps, ConvertToGroupButton };
77
+ export {
78
+ BlockGroupToolbar,
79
+ ConvertToGroupButton,
80
+ useConvertToGroupButtonProps,
81
+ };
@@ -0,0 +1,87 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { useDispatch, useSelect } from '@wordpress/data';
5
+ import { switchToBlockType } from '@wordpress/blocks';
6
+ import { ToolbarButton, ToolbarGroup } from '@wordpress/components';
7
+ import { group, row, stack } from '@wordpress/icons';
8
+ import { _x } from '@wordpress/i18n';
9
+
10
+ /**
11
+ * Internal dependencies
12
+ */
13
+ import { useConvertToGroupButtonProps } from '../convert-to-group-buttons';
14
+ import { store as blockEditorStore } from '../../store';
15
+
16
+ const layouts = {
17
+ group: undefined,
18
+ row: { type: 'flex', flexWrap: 'nowrap' },
19
+ stack: { type: 'flex', orientation: 'vertical' },
20
+ };
21
+
22
+ function BlockGroupToolbar() {
23
+ const {
24
+ blocksSelection,
25
+ clientIds,
26
+ groupingBlockName,
27
+ isGroupable,
28
+ } = useConvertToGroupButtonProps();
29
+ const { replaceBlocks } = useDispatch( blockEditorStore );
30
+
31
+ const { canRemove } = useSelect(
32
+ ( select ) => {
33
+ const { canRemoveBlocks } = select( blockEditorStore );
34
+ return {
35
+ canRemove: canRemoveBlocks( clientIds ),
36
+ };
37
+ },
38
+ [ clientIds ]
39
+ );
40
+
41
+ const onConvertToGroup = ( layout = 'group' ) => {
42
+ const newBlocks = switchToBlockType(
43
+ blocksSelection,
44
+ groupingBlockName
45
+ );
46
+
47
+ if ( newBlocks && newBlocks.length > 0 ) {
48
+ // Because the block is not in the store yet we can't use
49
+ // updateBlockAttributes so need to manually update attributes.
50
+ newBlocks[ 0 ].attributes.layout = layouts[ layout ];
51
+ replaceBlocks( clientIds, newBlocks );
52
+ }
53
+ };
54
+
55
+ const onConvertToRow = () => onConvertToGroup( 'row' );
56
+ const onConvertToStack = () => onConvertToGroup( 'stack' );
57
+
58
+ // Don't render the button if the current selection cannot be grouped.
59
+ // A good example is selecting multiple button blocks within a Buttons block:
60
+ // The group block is not a valid child of Buttons, so we should not show the button.
61
+ // Any blocks that are locked against removal also cannot be grouped.
62
+ if ( ! isGroupable || ! canRemove ) {
63
+ return null;
64
+ }
65
+
66
+ return (
67
+ <ToolbarGroup>
68
+ <ToolbarButton
69
+ icon={ group }
70
+ label={ _x( 'Group', 'verb' ) }
71
+ onClick={ onConvertToGroup }
72
+ />
73
+ <ToolbarButton
74
+ icon={ row }
75
+ label={ _x( 'Row', 'single horizontal line' ) }
76
+ onClick={ onConvertToRow }
77
+ />
78
+ <ToolbarButton
79
+ icon={ stack }
80
+ label={ _x( 'Stack', 'verb' ) }
81
+ onClick={ onConvertToStack }
82
+ />
83
+ </ToolbarGroup>
84
+ );
85
+ }
86
+
87
+ export default BlockGroupToolbar;
@@ -78,10 +78,18 @@ export function useClipboardHandler() {
78
78
  getSelectedBlockClientIds,
79
79
  hasMultiSelection,
80
80
  getSettings,
81
+ __unstableIsFullySelected,
82
+ __unstableIsSelectionCollapsed,
83
+ __unstableIsSelectionMergeable,
84
+ __unstableGetSelectedBlocksWithPartialSelection,
81
85
  } = useSelect( blockEditorStore );
82
- const { flashBlock, removeBlocks, replaceBlocks } = useDispatch(
83
- blockEditorStore
84
- );
86
+ const {
87
+ flashBlock,
88
+ removeBlocks,
89
+ replaceBlocks,
90
+ __unstableDeleteSelection,
91
+ __unstableExpandSelection,
92
+ } = useDispatch( blockEditorStore );
85
93
  const notifyCopy = useNotifyCopy();
86
94
 
87
95
  return useRefEffect( ( node ) => {
@@ -116,20 +124,54 @@ export function useClipboardHandler() {
116
124
  const eventDefaultPrevented = event.defaultPrevented;
117
125
  event.preventDefault();
118
126
 
127
+ const isSelectionMergeable = __unstableIsSelectionMergeable();
128
+ const shouldHandleWholeBlocks =
129
+ __unstableIsSelectionCollapsed() || __unstableIsFullySelected();
130
+ const expandSelectionIsNeeded =
131
+ ! shouldHandleWholeBlocks && ! isSelectionMergeable;
119
132
  if ( event.type === 'copy' || event.type === 'cut' ) {
120
133
  if ( selectedBlockClientIds.length === 1 ) {
121
134
  flashBlock( selectedBlockClientIds[ 0 ] );
122
135
  }
123
- notifyCopy( event.type, selectedBlockClientIds );
124
- const blocks = getBlocksByClientId( selectedBlockClientIds );
125
- const serialized = serialize( blocks );
126
-
127
- event.clipboardData.setData( 'text/plain', serialized );
128
- event.clipboardData.setData( 'text/html', serialized );
136
+ // If we have a partial selection that is not mergeable, just
137
+ // expand the selection to the whole blocks.
138
+ if ( expandSelectionIsNeeded ) {
139
+ __unstableExpandSelection();
140
+ } else {
141
+ notifyCopy( event.type, selectedBlockClientIds );
142
+ let blocks;
143
+ // Check if we have partial selection.
144
+ if ( shouldHandleWholeBlocks ) {
145
+ blocks = getBlocksByClientId( selectedBlockClientIds );
146
+ } else {
147
+ const [
148
+ head,
149
+ tail,
150
+ ] = __unstableGetSelectedBlocksWithPartialSelection();
151
+ const inBetweenBlocks = getBlocksByClientId(
152
+ selectedBlockClientIds.slice(
153
+ 1,
154
+ selectedBlockClientIds.length - 1
155
+ )
156
+ );
157
+ blocks = [ head, ...inBetweenBlocks, tail ];
158
+ }
159
+ const serialized = serialize( blocks );
160
+
161
+ event.clipboardData.setData( 'text/plain', serialized );
162
+ event.clipboardData.setData( 'text/html', serialized );
163
+ }
129
164
  }
130
165
 
131
166
  if ( event.type === 'cut' ) {
132
- removeBlocks( selectedBlockClientIds );
167
+ // We need to also check if at the start we needed to
168
+ // expand the selection, as in this point we might have
169
+ // programmatically fully selected the blocks above.
170
+ if ( shouldHandleWholeBlocks && ! expandSelectionIsNeeded ) {
171
+ removeBlocks( selectedBlockClientIds );
172
+ } else {
173
+ __unstableDeleteSelection();
174
+ }
133
175
  } else if ( event.type === 'paste' ) {
134
176
  if ( eventDefaultPrevented ) {
135
177
  // This was likely already handled in rich-text/use-paste-handler.js.
@@ -171,4 +213,7 @@ function CopyHandler( { children } ) {
171
213
  return <div ref={ useClipboardHandler() }>{ children }</div>;
172
214
  }
173
215
 
216
+ /**
217
+ * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/copy-handler/README.md
218
+ */
174
219
  export default CopyHandler;
@@ -21,4 +21,7 @@ function FontSizePicker( props ) {
21
21
  );
22
22
  }
23
23
 
24
+ /**
25
+ * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/font-sizes/README.md
26
+ */
24
27
  export default FontSizePicker;
@@ -203,14 +203,10 @@ function Iframe(
203
203
  return true;
204
204
  }
205
205
 
206
- if ( setDocumentIfReady() ) {
207
- return;
208
- }
206
+ // Document set with srcDoc is not immediately ready.
207
+ node.addEventListener( 'load', setDocumentIfReady );
209
208
 
210
- // Document is not immediately loaded in Firefox.
211
- node.addEventListener( 'load', () => {
212
- setDocumentIfReady();
213
- } );
209
+ return () => node.removeEventListener( 'load', setDocumentIfReady );
214
210
  }, [] );
215
211
  const headRef = useRefEffect( ( element ) => {
216
212
  scripts
@@ -264,6 +260,8 @@ function Iframe(
264
260
  { ...props }
265
261
  ref={ useMergeRefs( [ ref, setRef ] ) }
266
262
  tabIndex={ tabIndex }
263
+ // Correct doctype is required to enable rendering in standards mode
264
+ srcDoc="<!doctype html>"
267
265
  title={ __( 'Editor canvas' ) }
268
266
  >
269
267
  { iframeDocument &&
@@ -99,6 +99,8 @@ export { default as withColorContext } from './color-palette/with-color-context'
99
99
  */
100
100
 
101
101
  export { default as __unstableBlockSettingsMenuFirstItem } from './block-settings-menu/block-settings-menu-first-item';
102
+ export { default as __unstableBlockToolbarLastItem } from './block-toolbar/block-toolbar-last-item';
103
+ export { default as __unstableBlockNameContext } from './block-toolbar/block-name-context';
102
104
  export { default as __unstableInserterMenuExtension } from './inserter-menu-extension';
103
105
  export { default as __experimentalPreviewOptions } from './preview-options';
104
106
  export { default as __experimentalUseResizeCanvas } from './use-resize-canvas';
@@ -3,10 +3,15 @@
3
3
  */
4
4
  import JustifyContentUI from './ui';
5
5
 
6
- export function JustifyContentControl( props ) {
6
+ const JustifyContentControl = ( props ) => {
7
7
  return <JustifyContentUI { ...props } isToolbar={ false } />;
8
- }
8
+ };
9
9
 
10
- export function JustifyToolbar( props ) {
10
+ const JustifyToolbar = ( props ) => {
11
11
  return <JustifyContentUI { ...props } isToolbar />;
12
- }
12
+ };
13
+
14
+ /**
15
+ * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/justify-content-control/README.md
16
+ */
17
+ export { JustifyContentControl, JustifyToolbar };
@@ -61,7 +61,7 @@ function KeyboardShortcutsRegister() {
61
61
  registerShortcut( {
62
62
  name: 'core/block-editor/delete-multi-selection',
63
63
  category: 'block',
64
- description: __( 'Remove multiple selected blocks.' ),
64
+ description: __( 'Delete selection.' ),
65
65
  keyCombination: {
66
66
  character: 'del',
67
67
  },
@@ -15,13 +15,13 @@ import {
15
15
  isLineHeightDefined,
16
16
  } from './utils';
17
17
 
18
- export default function LineHeightControl( {
18
+ const LineHeightControl = ( {
19
19
  value: lineHeight,
20
20
  onChange,
21
21
  /** Start opting into the new margin-free styles that will become the default in a future version. */
22
22
  __nextHasNoMarginBottom = false,
23
23
  __unstableInputWidth = '60px',
24
- } ) {
24
+ } ) => {
25
25
  const isDefined = isLineHeightDefined( lineHeight );
26
26
 
27
27
  const adjustNextValue = ( nextValue, wasTypedOrPasted ) => {
@@ -101,4 +101,9 @@ export default function LineHeightControl( {
101
101
  />
102
102
  </div>
103
103
  );
104
- }
104
+ };
105
+
106
+ /**
107
+ * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/line-height-control/README.md
108
+ */
109
+ export default LineHeightControl;