@wordpress/block-editor 9.4.0 → 9.7.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 (483) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +1 -8
  3. package/build/components/block-list/block-invalid-warning.native.js +54 -6
  4. package/build/components/block-list/block-invalid-warning.native.js.map +1 -1
  5. package/build/components/block-list/block.js +14 -4
  6. package/build/components/block-list/block.js.map +1 -1
  7. package/build/components/block-list/block.native.js +2 -1
  8. package/build/components/block-list/block.native.js.map +1 -1
  9. package/build/components/block-list/index.native.js +5 -4
  10. package/build/components/block-list/index.native.js.map +1 -1
  11. package/build/components/block-list/layout.js +20 -5
  12. package/build/components/block-list/layout.js.map +1 -1
  13. package/build/components/block-list/use-block-props/use-block-class-names.js +5 -2
  14. package/build/components/block-list/use-block-props/use-block-class-names.js.map +1 -1
  15. package/build/components/block-lock/modal.js +37 -7
  16. package/build/components/block-lock/modal.js.map +1 -1
  17. package/build/components/block-mobile-toolbar/block-actions-menu.native.js +1 -1
  18. package/build/components/block-mobile-toolbar/block-actions-menu.native.js.map +1 -1
  19. package/build/components/block-mover/mover-description.js +95 -32
  20. package/build/components/block-mover/mover-description.js.map +1 -1
  21. package/build/components/block-pattern-setup/index.js +5 -17
  22. package/build/components/block-pattern-setup/index.js.map +1 -1
  23. package/build/components/block-popover/inbetween.js +2 -2
  24. package/build/components/block-popover/inbetween.js.map +1 -1
  25. package/build/components/block-popover/index.js +1 -1
  26. package/build/components/block-popover/index.js.map +1 -1
  27. package/build/components/block-settings-menu/block-mode-toggle.js +1 -1
  28. package/build/components/block-settings-menu/block-mode-toggle.js.map +1 -1
  29. package/build/components/block-settings-menu/block-settings-dropdown.js +4 -1
  30. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  31. package/build/components/block-settings-menu-controls/index.js +1 -1
  32. package/build/components/block-settings-menu-controls/index.js.map +1 -1
  33. package/build/components/block-styles/index.js +3 -6
  34. package/build/components/block-styles/index.js.map +1 -1
  35. package/build/components/block-styles/preview.native.js.map +1 -1
  36. package/build/components/block-switcher/index.js +7 -1
  37. package/build/components/block-switcher/index.js.map +1 -1
  38. package/build/components/block-title/index.js +8 -2
  39. package/build/components/block-title/index.js.map +1 -1
  40. package/build/components/block-title/use-block-display-title.js +12 -5
  41. package/build/components/block-title/use-block-display-title.js.map +1 -1
  42. package/build/components/block-tools/block-contextual-toolbar.js +1 -1
  43. package/build/components/block-tools/block-contextual-toolbar.js.map +1 -1
  44. package/build/components/block-tools/block-selection-button.js +1 -7
  45. package/build/components/block-tools/block-selection-button.js.map +1 -1
  46. package/build/components/block-tools/index.js +4 -1
  47. package/build/components/block-tools/index.js.map +1 -1
  48. package/build/components/block-types-list/index.js +1 -1
  49. package/build/components/block-types-list/index.js.map +1 -1
  50. package/build/components/block-types-list/index.native.js +65 -23
  51. package/build/components/block-types-list/index.native.js.map +1 -1
  52. package/build/components/border-radius-control/index.js +5 -1
  53. package/build/components/border-radius-control/index.js.map +1 -1
  54. package/build/components/colors/utils.js +6 -2
  55. package/build/components/colors/utils.js.map +1 -1
  56. package/build/components/colors/with-colors.js +1 -1
  57. package/build/components/colors/with-colors.js.map +1 -1
  58. package/build/components/colors-gradients/control.js +49 -39
  59. package/build/components/colors-gradients/control.js.map +1 -1
  60. package/build/components/colors-gradients/dropdown.js +9 -3
  61. package/build/components/colors-gradients/dropdown.js.map +1 -1
  62. package/build/components/date-format-picker/index.js +1 -1
  63. package/build/components/date-format-picker/index.js.map +1 -1
  64. package/build/components/font-appearance-control/index.js +10 -4
  65. package/build/components/font-appearance-control/index.js.map +1 -1
  66. package/build/components/iframe/index.js +19 -6
  67. package/build/components/iframe/index.js.map +1 -1
  68. package/build/components/image-editor/cropper.js +4 -3
  69. package/build/components/image-editor/cropper.js.map +1 -1
  70. package/build/components/image-editor/index.js +3 -1
  71. package/build/components/image-editor/index.js.map +1 -1
  72. package/build/components/image-size-control/index.js +3 -1
  73. package/build/components/image-size-control/index.js.map +1 -1
  74. package/build/components/index.js +13 -6
  75. package/build/components/index.js.map +1 -1
  76. package/build/components/index.native.js +11 -4
  77. package/build/components/index.native.js.map +1 -1
  78. package/build/components/inserter/block-types-tab.native.js +30 -16
  79. package/build/components/inserter/block-types-tab.native.js.map +1 -1
  80. package/build/components/inserter/index.native.js +8 -3
  81. package/build/components/inserter/index.native.js.map +1 -1
  82. package/build/components/inserter/preview-panel.js +8 -8
  83. package/build/components/inserter/preview-panel.js.map +1 -1
  84. package/build/components/inserter/reusable-blocks-tab.native.js +5 -1
  85. package/build/components/inserter/reusable-blocks-tab.native.js.map +1 -1
  86. package/build/components/inserter/search-results.native.js +5 -2
  87. package/build/components/inserter/search-results.native.js.map +1 -1
  88. package/build/components/inserter/utils.native.js +21 -0
  89. package/build/components/inserter/utils.native.js.map +1 -1
  90. package/build/components/inserter-list-item/index.js +7 -20
  91. package/build/components/inserter-list-item/index.js.map +1 -1
  92. package/build/components/letter-spacing-control/index.js +6 -3
  93. package/build/components/letter-spacing-control/index.js.map +1 -1
  94. package/build/components/line-height-control/index.js +6 -3
  95. package/build/components/line-height-control/index.js.map +1 -1
  96. package/build/components/link-control/index.js +1 -1
  97. package/build/components/link-control/index.js.map +1 -1
  98. package/build/components/link-control/is-url-like.js +1 -7
  99. package/build/components/link-control/is-url-like.js.map +1 -1
  100. package/build/components/link-control/use-search-handler.js +1 -7
  101. package/build/components/link-control/use-search-handler.js.map +1 -1
  102. package/build/components/list-view/block-select-button.js +15 -7
  103. package/build/components/list-view/block-select-button.js.map +1 -1
  104. package/build/components/list-view/branch.js +1 -7
  105. package/build/components/list-view/branch.js.map +1 -1
  106. package/build/components/list-view/drop-indicator.js +1 -1
  107. package/build/components/list-view/drop-indicator.js.map +1 -1
  108. package/build/components/list-view/expander.js +3 -1
  109. package/build/components/list-view/expander.js.map +1 -1
  110. package/build/components/media-placeholder/index.js +13 -2
  111. package/build/components/media-placeholder/index.js.map +1 -1
  112. package/build/components/media-replace-flow/index.js +3 -6
  113. package/build/components/media-replace-flow/index.js.map +1 -1
  114. package/build/components/media-upload/index.native.js +8 -3
  115. package/build/components/media-upload/index.native.js.map +1 -1
  116. package/build/components/observe-typing/index.js +22 -8
  117. package/build/components/observe-typing/index.js.map +1 -1
  118. package/build/components/preview-options/index.js +2 -2
  119. package/build/components/preview-options/index.js.map +1 -1
  120. package/build/components/{use-no-recursive-renders → recursion-provider}/index.js +40 -18
  121. package/build/components/recursion-provider/index.js.map +1 -0
  122. package/build/components/rich-text/format-toolbar-container.js +61 -12
  123. package/build/components/rich-text/format-toolbar-container.js.map +1 -1
  124. package/build/components/rich-text/index.js +8 -2
  125. package/build/components/rich-text/index.js.map +1 -1
  126. package/build/components/rich-text/index.native.js +3 -1
  127. package/build/components/rich-text/index.native.js.map +1 -1
  128. package/build/components/rich-text/use-before-input-rules.js +110 -0
  129. package/build/components/rich-text/use-before-input-rules.js.map +1 -0
  130. package/build/components/rich-text/use-format-types.js +36 -16
  131. package/build/components/rich-text/use-format-types.js.map +1 -1
  132. package/build/components/text-decoration-control/index.js +3 -1
  133. package/build/components/text-decoration-control/index.js.map +1 -1
  134. package/build/components/text-transform-control/index.js +3 -1
  135. package/build/components/text-transform-control/index.js.map +1 -1
  136. package/build/components/url-popover/image-url-input-ui.js +4 -1
  137. package/build/components/url-popover/image-url-input-ui.js.map +1 -1
  138. package/build/components/url-popover/index.js +2 -1
  139. package/build/components/url-popover/index.js.map +1 -1
  140. package/build/components/writing-flow/use-arrow-nav.js +38 -27
  141. package/build/components/writing-flow/use-arrow-nav.js.map +1 -1
  142. package/build/components/writing-flow/use-drag-selection.js +9 -2
  143. package/build/components/writing-flow/use-drag-selection.js.map +1 -1
  144. package/build/components/writing-flow/use-multi-selection.js +3 -47
  145. package/build/components/writing-flow/use-multi-selection.js.map +1 -1
  146. package/build/components/writing-flow/use-select-all.js +3 -1
  147. package/build/components/writing-flow/use-select-all.js.map +1 -1
  148. package/build/components/writing-flow/use-selection-observer.js +1 -3
  149. package/build/components/writing-flow/use-selection-observer.js.map +1 -1
  150. package/build/components/writing-flow/use-tab-nav.js +1 -1
  151. package/build/components/writing-flow/use-tab-nav.js.map +1 -1
  152. package/build/hooks/color.js +2 -4
  153. package/build/hooks/color.js.map +1 -1
  154. package/build/hooks/index.js +8 -0
  155. package/build/hooks/index.js.map +1 -1
  156. package/build/hooks/layout.js +61 -15
  157. package/build/hooks/layout.js.map +1 -1
  158. package/build/hooks/style.js +41 -31
  159. package/build/hooks/style.js.map +1 -1
  160. package/build/hooks/utils.js +5 -3
  161. package/build/hooks/utils.js.map +1 -1
  162. package/build/index.js +7 -0
  163. package/build/index.js.map +1 -1
  164. package/build/layouts/flex.js +40 -36
  165. package/build/layouts/flex.js.map +1 -1
  166. package/build/layouts/flow.js +35 -37
  167. package/build/layouts/flow.js.map +1 -1
  168. package/build/layouts/utils.js +35 -3
  169. package/build/layouts/utils.js.map +1 -1
  170. package/build/store/actions.js +15 -18
  171. package/build/store/actions.js.map +1 -1
  172. package/build/store/index.js +0 -4
  173. package/build/store/index.js.map +1 -1
  174. package/build/store/reducer.js +5 -3
  175. package/build/store/reducer.js.map +1 -1
  176. package/build/store/selectors.js +3 -3
  177. package/build/store/selectors.js.map +1 -1
  178. package/build/utils/block-variation-transforms.js +15 -9
  179. package/build/utils/block-variation-transforms.js.map +1 -1
  180. package/build/utils/pasting.js +9 -1
  181. package/build/utils/pasting.js.map +1 -1
  182. package/build-module/components/block-list/block-invalid-warning.native.js +50 -6
  183. package/build-module/components/block-list/block-invalid-warning.native.js.map +1 -1
  184. package/build-module/components/block-list/block.js +15 -5
  185. package/build-module/components/block-list/block.js.map +1 -1
  186. package/build-module/components/block-list/block.native.js +2 -1
  187. package/build-module/components/block-list/block.native.js.map +1 -1
  188. package/build-module/components/block-list/index.native.js +4 -2
  189. package/build-module/components/block-list/index.native.js.map +1 -1
  190. package/build-module/components/block-list/layout.js +19 -4
  191. package/build-module/components/block-list/layout.js.map +1 -1
  192. package/build-module/components/block-list/use-block-props/use-block-class-names.js +5 -2
  193. package/build-module/components/block-list/use-block-props/use-block-class-names.js.map +1 -1
  194. package/build-module/components/block-lock/modal.js +39 -8
  195. package/build-module/components/block-lock/modal.js.map +1 -1
  196. package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js +2 -2
  197. package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js.map +1 -1
  198. package/build-module/components/block-mover/mover-description.js +97 -33
  199. package/build-module/components/block-mover/mover-description.js.map +1 -1
  200. package/build-module/components/block-pattern-setup/index.js +6 -18
  201. package/build-module/components/block-pattern-setup/index.js.map +1 -1
  202. package/build-module/components/block-popover/inbetween.js +2 -2
  203. package/build-module/components/block-popover/inbetween.js.map +1 -1
  204. package/build-module/components/block-popover/index.js +1 -1
  205. package/build-module/components/block-popover/index.js.map +1 -1
  206. package/build-module/components/block-settings-menu/block-mode-toggle.js +1 -1
  207. package/build-module/components/block-settings-menu/block-mode-toggle.js.map +1 -1
  208. package/build-module/components/block-settings-menu/block-settings-dropdown.js +4 -1
  209. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  210. package/build-module/components/block-settings-menu-controls/index.js +2 -2
  211. package/build-module/components/block-settings-menu-controls/index.js.map +1 -1
  212. package/build-module/components/block-styles/index.js +4 -7
  213. package/build-module/components/block-styles/index.js.map +1 -1
  214. package/build-module/components/block-styles/preview.native.js.map +1 -1
  215. package/build-module/components/block-switcher/index.js +7 -1
  216. package/build-module/components/block-switcher/index.js.map +1 -1
  217. package/build-module/components/block-title/index.js +8 -2
  218. package/build-module/components/block-title/index.js.map +1 -1
  219. package/build-module/components/block-title/use-block-display-title.js +12 -5
  220. package/build-module/components/block-title/use-block-display-title.js.map +1 -1
  221. package/build-module/components/block-tools/block-contextual-toolbar.js +1 -1
  222. package/build-module/components/block-tools/block-contextual-toolbar.js.map +1 -1
  223. package/build-module/components/block-tools/block-selection-button.js +1 -7
  224. package/build-module/components/block-tools/block-selection-button.js.map +1 -1
  225. package/build-module/components/block-tools/index.js +4 -1
  226. package/build-module/components/block-tools/index.js.map +1 -1
  227. package/build-module/components/block-types-list/index.js +1 -1
  228. package/build-module/components/block-types-list/index.js.map +1 -1
  229. package/build-module/components/block-types-list/index.native.js +67 -25
  230. package/build-module/components/block-types-list/index.native.js.map +1 -1
  231. package/build-module/components/border-radius-control/index.js +6 -2
  232. package/build-module/components/border-radius-control/index.js.map +1 -1
  233. package/build-module/components/colors/utils.js +7 -3
  234. package/build-module/components/colors/utils.js.map +1 -1
  235. package/build-module/components/colors/with-colors.js +2 -2
  236. package/build-module/components/colors/with-colors.js.map +1 -1
  237. package/build-module/components/colors-gradients/control.js +50 -40
  238. package/build-module/components/colors-gradients/control.js.map +1 -1
  239. package/build-module/components/colors-gradients/dropdown.js +10 -4
  240. package/build-module/components/colors-gradients/dropdown.js.map +1 -1
  241. package/build-module/components/date-format-picker/index.js +1 -1
  242. package/build-module/components/date-format-picker/index.js.map +1 -1
  243. package/build-module/components/font-appearance-control/index.js +7 -4
  244. package/build-module/components/font-appearance-control/index.js.map +1 -1
  245. package/build-module/components/iframe/index.js +19 -6
  246. package/build-module/components/iframe/index.js.map +1 -1
  247. package/build-module/components/image-editor/cropper.js +4 -3
  248. package/build-module/components/image-editor/cropper.js.map +1 -1
  249. package/build-module/components/image-editor/index.js +3 -1
  250. package/build-module/components/image-editor/index.js.map +1 -1
  251. package/build-module/components/image-size-control/index.js +3 -1
  252. package/build-module/components/image-size-control/index.js.map +1 -1
  253. package/build-module/components/index.js +1 -1
  254. package/build-module/components/index.js.map +1 -1
  255. package/build-module/components/index.native.js +1 -1
  256. package/build-module/components/index.native.js.map +1 -1
  257. package/build-module/components/inserter/block-types-tab.native.js +31 -15
  258. package/build-module/components/inserter/block-types-tab.native.js.map +1 -1
  259. package/build-module/components/inserter/index.native.js +9 -2
  260. package/build-module/components/inserter/index.native.js.map +1 -1
  261. package/build-module/components/inserter/preview-panel.js +9 -9
  262. package/build-module/components/inserter/preview-panel.js.map +1 -1
  263. package/build-module/components/inserter/reusable-blocks-tab.native.js +6 -2
  264. package/build-module/components/inserter/reusable-blocks-tab.native.js.map +1 -1
  265. package/build-module/components/inserter/search-results.native.js +6 -3
  266. package/build-module/components/inserter/search-results.native.js.map +1 -1
  267. package/build-module/components/inserter/utils.native.js +19 -0
  268. package/build-module/components/inserter/utils.native.js.map +1 -1
  269. package/build-module/components/inserter-list-item/index.js +5 -18
  270. package/build-module/components/inserter-list-item/index.js.map +1 -1
  271. package/build-module/components/letter-spacing-control/index.js +5 -3
  272. package/build-module/components/letter-spacing-control/index.js.map +1 -1
  273. package/build-module/components/line-height-control/index.js +5 -3
  274. package/build-module/components/line-height-control/index.js.map +1 -1
  275. package/build-module/components/link-control/index.js +1 -1
  276. package/build-module/components/link-control/index.js.map +1 -1
  277. package/build-module/components/link-control/is-url-like.js +1 -6
  278. package/build-module/components/link-control/is-url-like.js.map +1 -1
  279. package/build-module/components/link-control/use-search-handler.js +1 -6
  280. package/build-module/components/link-control/use-search-handler.js.map +1 -1
  281. package/build-module/components/list-view/block-select-button.js +16 -8
  282. package/build-module/components/list-view/block-select-button.js.map +1 -1
  283. package/build-module/components/list-view/branch.js +1 -6
  284. package/build-module/components/list-view/branch.js.map +1 -1
  285. package/build-module/components/list-view/drop-indicator.js +1 -1
  286. package/build-module/components/list-view/drop-indicator.js.map +1 -1
  287. package/build-module/components/list-view/expander.js +3 -2
  288. package/build-module/components/list-view/expander.js.map +1 -1
  289. package/build-module/components/media-placeholder/index.js +13 -2
  290. package/build-module/components/media-placeholder/index.js.map +1 -1
  291. package/build-module/components/media-replace-flow/index.js +4 -7
  292. package/build-module/components/media-replace-flow/index.js.map +1 -1
  293. package/build-module/components/media-upload/index.native.js +9 -2
  294. package/build-module/components/media-upload/index.native.js.map +1 -1
  295. package/build-module/components/observe-typing/index.js +22 -8
  296. package/build-module/components/observe-typing/index.js.map +1 -1
  297. package/build-module/components/preview-options/index.js +2 -2
  298. package/build-module/components/preview-options/index.js.map +1 -1
  299. package/build-module/components/{use-no-recursive-renders → recursion-provider}/index.js +39 -19
  300. package/build-module/components/recursion-provider/index.js.map +1 -0
  301. package/build-module/components/rich-text/format-toolbar-container.js +58 -12
  302. package/build-module/components/rich-text/format-toolbar-container.js.map +1 -1
  303. package/build-module/components/rich-text/index.js +7 -2
  304. package/build-module/components/rich-text/index.js.map +1 -1
  305. package/build-module/components/rich-text/index.native.js +3 -1
  306. package/build-module/components/rich-text/index.native.js.map +1 -1
  307. package/build-module/components/rich-text/use-before-input-rules.js +96 -0
  308. package/build-module/components/rich-text/use-before-input-rules.js.map +1 -0
  309. package/build-module/components/rich-text/use-format-types.js +37 -18
  310. package/build-module/components/rich-text/use-format-types.js.map +1 -1
  311. package/build-module/components/text-decoration-control/index.js +4 -2
  312. package/build-module/components/text-decoration-control/index.js.map +1 -1
  313. package/build-module/components/text-transform-control/index.js +4 -2
  314. package/build-module/components/text-transform-control/index.js.map +1 -1
  315. package/build-module/components/url-popover/image-url-input-ui.js +4 -1
  316. package/build-module/components/url-popover/image-url-input-ui.js.map +1 -1
  317. package/build-module/components/url-popover/index.js +2 -1
  318. package/build-module/components/url-popover/index.js.map +1 -1
  319. package/build-module/components/writing-flow/use-arrow-nav.js +40 -29
  320. package/build-module/components/writing-flow/use-arrow-nav.js.map +1 -1
  321. package/build-module/components/writing-flow/use-drag-selection.js +9 -2
  322. package/build-module/components/writing-flow/use-drag-selection.js.map +1 -1
  323. package/build-module/components/writing-flow/use-multi-selection.js +3 -45
  324. package/build-module/components/writing-flow/use-multi-selection.js.map +1 -1
  325. package/build-module/components/writing-flow/use-select-all.js +3 -1
  326. package/build-module/components/writing-flow/use-select-all.js.map +1 -1
  327. package/build-module/components/writing-flow/use-selection-observer.js +1 -3
  328. package/build-module/components/writing-flow/use-selection-observer.js.map +1 -1
  329. package/build-module/components/writing-flow/use-tab-nav.js +1 -1
  330. package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
  331. package/build-module/hooks/color.js +2 -3
  332. package/build-module/hooks/color.js.map +1 -1
  333. package/build-module/hooks/index.js +1 -0
  334. package/build-module/hooks/index.js.map +1 -1
  335. package/build-module/hooks/layout.js +62 -16
  336. package/build-module/hooks/layout.js.map +1 -1
  337. package/build-module/hooks/style.js +44 -35
  338. package/build-module/hooks/style.js.map +1 -1
  339. package/build-module/hooks/utils.js +5 -2
  340. package/build-module/hooks/utils.js.map +1 -1
  341. package/build-module/index.js +1 -1
  342. package/build-module/index.js.map +1 -1
  343. package/build-module/layouts/flex.js +41 -33
  344. package/build-module/layouts/flex.js.map +1 -1
  345. package/build-module/layouts/flow.js +35 -38
  346. package/build-module/layouts/flow.js.map +1 -1
  347. package/build-module/layouts/utils.js +33 -3
  348. package/build-module/layouts/utils.js.map +1 -1
  349. package/build-module/store/actions.js +9 -10
  350. package/build-module/store/actions.js.map +1 -1
  351. package/build-module/store/index.js +0 -4
  352. package/build-module/store/index.js.map +1 -1
  353. package/build-module/store/reducer.js +5 -2
  354. package/build-module/store/reducer.js.map +1 -1
  355. package/build-module/store/selectors.js +4 -4
  356. package/build-module/store/selectors.js.map +1 -1
  357. package/build-module/utils/block-variation-transforms.js +14 -7
  358. package/build-module/utils/block-variation-transforms.js.map +1 -1
  359. package/build-module/utils/pasting.js +9 -1
  360. package/build-module/utils/pasting.js.map +1 -1
  361. package/build-style/style-rtl.css +72 -14
  362. package/build-style/style.css +72 -14
  363. package/package.json +28 -28
  364. package/src/components/block-list/block-invalid-warning.native.js +42 -7
  365. package/src/components/block-list/block.js +15 -4
  366. package/src/components/block-list/block.native.js +1 -0
  367. package/src/components/block-list/index.native.js +2 -2
  368. package/src/components/block-list/layout.js +15 -3
  369. package/src/components/block-list/style.scss +1 -1
  370. package/src/components/block-list/use-block-props/use-block-class-names.js +5 -1
  371. package/src/components/block-lock/modal.js +47 -9
  372. package/src/components/block-lock/style.scss +10 -0
  373. package/src/components/block-mobile-toolbar/block-actions-menu.native.js +3 -3
  374. package/src/components/block-mover/mover-description.js +131 -48
  375. package/src/components/block-mover/test/mover-description.js +55 -3
  376. package/src/components/block-pattern-setup/index.js +3 -15
  377. package/src/components/block-pattern-setup/style.scss +4 -2
  378. package/src/components/block-popover/inbetween.js +2 -1
  379. package/src/components/block-popover/index.js +1 -1
  380. package/src/components/block-popover/style.scss +25 -2
  381. package/src/components/block-settings-menu/block-mode-toggle.js +1 -0
  382. package/src/components/block-settings-menu/block-settings-dropdown.js +4 -1
  383. package/src/components/block-settings-menu-controls/index.js +2 -2
  384. package/src/components/block-styles/index.js +4 -7
  385. package/src/components/block-styles/preview.native.js +1 -0
  386. package/src/components/block-styles/style.scss +10 -0
  387. package/src/components/block-switcher/index.js +7 -1
  388. package/src/components/block-title/index.js +3 -2
  389. package/src/components/block-title/use-block-display-title.js +11 -5
  390. package/src/components/block-tools/block-contextual-toolbar.js +3 -1
  391. package/src/components/block-tools/block-selection-button.js +0 -5
  392. package/src/components/block-tools/index.js +4 -1
  393. package/src/components/block-types-list/index.js +1 -1
  394. package/src/components/block-types-list/index.native.js +76 -24
  395. package/src/components/block-types-list/style.native.scss +18 -0
  396. package/src/components/border-radius-control/index.js +6 -1
  397. package/src/components/color-palette/test/__snapshots__/control.js.snap +91 -79
  398. package/src/components/colors/test/__snapshots__/with-colors.js.snap +1 -1
  399. package/src/components/colors/test/with-colors.js +1 -1
  400. package/src/components/colors/utils.js +5 -2
  401. package/src/components/colors/with-colors.js +2 -2
  402. package/src/components/colors-gradients/control.js +82 -65
  403. package/src/components/colors-gradients/dropdown.js +14 -3
  404. package/src/components/colors-gradients/style.scss +34 -9
  405. package/src/components/colors-gradients/test/control.js +16 -23
  406. package/src/components/date-format-picker/index.js +1 -0
  407. package/src/components/font-appearance-control/index.js +3 -0
  408. package/src/components/iframe/index.js +25 -6
  409. package/src/components/image-editor/cropper.js +9 -3
  410. package/src/components/image-editor/index.js +2 -0
  411. package/src/components/image-size-control/README.md +7 -0
  412. package/src/components/image-size-control/index.js +2 -0
  413. package/src/components/index.js +4 -1
  414. package/src/components/index.native.js +4 -1
  415. package/src/components/inserter/block-types-tab.native.js +42 -21
  416. package/src/components/inserter/index.native.js +7 -2
  417. package/src/components/inserter/preview-panel.js +6 -14
  418. package/src/components/inserter/reusable-blocks-tab.native.js +4 -2
  419. package/src/components/inserter/search-results.native.js +4 -2
  420. package/src/components/inserter/style.scss +1 -1
  421. package/src/components/inserter/test/block-types-tab.native.js +2 -0
  422. package/src/components/inserter/test/utils.native.js +37 -0
  423. package/src/components/inserter/utils.native.js +11 -0
  424. package/src/components/inserter-list-item/index.js +5 -18
  425. package/src/components/letter-spacing-control/index.js +2 -0
  426. package/src/components/line-height-control/index.js +2 -0
  427. package/src/components/link-control/index.js +1 -0
  428. package/src/components/link-control/is-url-like.js +1 -6
  429. package/src/components/link-control/test/index.js +6 -4
  430. package/src/components/link-control/use-search-handler.js +1 -6
  431. package/src/components/list-view/block-select-button.js +29 -14
  432. package/src/components/list-view/branch.js +1 -6
  433. package/src/components/list-view/drop-indicator.js +1 -1
  434. package/src/components/list-view/expander.js +4 -2
  435. package/src/components/list-view/style.scss +18 -4
  436. package/src/components/media-placeholder/index.js +19 -0
  437. package/src/components/media-replace-flow/index.js +3 -6
  438. package/src/components/media-replace-flow/test/index.js +14 -4
  439. package/src/components/media-upload/index.native.js +7 -3
  440. package/src/components/observe-typing/index.js +17 -14
  441. package/src/components/preview-options/index.js +2 -2
  442. package/src/components/{use-no-recursive-renders → recursion-provider}/index.js +39 -28
  443. package/src/components/{use-no-recursive-renders/test/use-no-recursive-renders.js → recursion-provider/test/index.js} +5 -6
  444. package/src/components/rich-text/README.md +13 -1
  445. package/src/components/rich-text/format-toolbar-container.js +63 -14
  446. package/src/components/rich-text/index.js +3 -0
  447. package/src/components/rich-text/index.native.js +2 -0
  448. package/src/components/rich-text/use-before-input-rules.js +91 -0
  449. package/src/components/rich-text/use-format-types.js +38 -17
  450. package/src/components/text-decoration-control/index.js +4 -2
  451. package/src/components/text-transform-control/index.js +4 -2
  452. package/src/components/url-popover/image-url-input-ui.js +3 -0
  453. package/src/components/url-popover/index.js +1 -0
  454. package/src/components/url-popover/test/__snapshots__/index.js.snap +3 -0
  455. package/src/components/writing-flow/use-arrow-nav.js +36 -34
  456. package/src/components/writing-flow/use-drag-selection.js +7 -1
  457. package/src/components/writing-flow/use-multi-selection.js +1 -48
  458. package/src/components/writing-flow/use-select-all.js +2 -1
  459. package/src/components/writing-flow/use-selection-observer.js +2 -3
  460. package/src/components/writing-flow/use-tab-nav.js +1 -1
  461. package/src/hooks/color.js +10 -3
  462. package/src/hooks/index.js +1 -0
  463. package/src/hooks/layout.js +66 -23
  464. package/src/hooks/style.js +46 -39
  465. package/src/hooks/utils.js +7 -3
  466. package/src/index.js +1 -0
  467. package/src/layouts/flex.js +47 -41
  468. package/src/layouts/flow.js +35 -34
  469. package/src/layouts/test/flex.js +21 -0
  470. package/src/layouts/test/flow.js +21 -0
  471. package/src/layouts/test/utils.js +138 -0
  472. package/src/layouts/utils.js +44 -3
  473. package/src/store/actions.js +10 -11
  474. package/src/store/index.js +0 -4
  475. package/src/store/reducer.js +3 -2
  476. package/src/store/selectors.js +3 -4
  477. package/src/utils/block-variation-transforms.js +13 -6
  478. package/src/utils/pasting.js +10 -1
  479. package/src/utils/test/block-variation-transforms.js +24 -0
  480. package/src/utils/test/pasting.js +10 -0
  481. package/tsconfig.json +2 -1
  482. package/build/components/use-no-recursive-renders/index.js.map +0 -1
  483. package/build-module/components/use-no-recursive-renders/index.js.map +0 -1
@@ -18,6 +18,7 @@ import {
18
18
  getSaveContent,
19
19
  isUnmodifiedDefaultBlock,
20
20
  serializeRawBlock,
21
+ switchToBlockType,
21
22
  } from '@wordpress/blocks';
22
23
  import { withFilters } from '@wordpress/components';
23
24
  import {
@@ -56,10 +57,10 @@ function mergeWrapperProps( propsA, propsB ) {
56
57
  ...propsB,
57
58
  };
58
59
 
59
- if ( propsA && propsB && propsA.className && propsB.className ) {
60
+ if ( propsA?.className && propsB?.className ) {
60
61
  newProps.className = classnames( propsA.className, propsB.className );
61
62
  }
62
- if ( propsA && propsB && propsA.style && propsB.style ) {
63
+ if ( propsA?.style && propsB?.style ) {
63
64
  newProps.style = { ...propsA.style, ...propsB.style };
64
65
  }
65
66
 
@@ -291,8 +292,8 @@ const applyWithDispatch = withDispatch( ( dispatch, ownProps, { select } ) => {
291
292
  insertBlocks( blocks, index + 1, rootClientId );
292
293
  },
293
294
  onMerge( forward ) {
294
- const { clientId } = ownProps;
295
- const { getPreviousBlockClientId, getNextBlockClientId } =
295
+ const { clientId, rootClientId } = ownProps;
296
+ const { getPreviousBlockClientId, getNextBlockClientId, getBlock } =
296
297
  select( blockEditorStore );
297
298
 
298
299
  if ( forward ) {
@@ -305,6 +306,16 @@ const applyWithDispatch = withDispatch( ( dispatch, ownProps, { select } ) => {
305
306
  getPreviousBlockClientId( clientId );
306
307
  if ( previousBlockClientId ) {
307
308
  mergeBlocks( previousBlockClientId, clientId );
309
+ } else if ( rootClientId ) {
310
+ // Attempt to "unwrap" the block contents when there's no
311
+ // preceding block to merge with.
312
+ const replacement = switchToBlockType(
313
+ getBlock( rootClientId ),
314
+ '*'
315
+ );
316
+ if ( replacement && replacement.length ) {
317
+ replaceBlocks( rootClientId, replacement, 0 );
318
+ }
308
319
  }
309
320
  }
310
321
  },
@@ -272,6 +272,7 @@ class BlockListBlock extends Component {
272
272
  <BlockInvalidWarning
273
273
  blockTitle={ title }
274
274
  icon={ icon }
275
+ clientId={ clientId }
275
276
  />
276
277
  )
277
278
  }
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- import { identity } from 'lodash';
5
4
  import { View, Platform, TouchableWithoutFeedback } from 'react-native';
6
5
 
7
6
  /**
@@ -35,6 +34,7 @@ import { BlockDraggableWrapper } from '../block-draggable';
35
34
  import { store as blockEditorStore } from '../../store';
36
35
 
37
36
  export const OnCaretVerticalPositionChange = createContext();
37
+ const identity = ( x ) => x;
38
38
 
39
39
  const stylesMemo = {};
40
40
  const getStyles = (
@@ -469,7 +469,7 @@ class EmptyListComponent extends Component {
469
469
  renderFooterAppender,
470
470
  } = this.props;
471
471
 
472
- if ( renderFooterAppender ) {
472
+ if ( renderFooterAppender || renderAppender === false ) {
473
473
  return null;
474
474
  }
475
475
 
@@ -7,6 +7,7 @@ import { createContext, useContext } from '@wordpress/element';
7
7
  * Internal dependencies
8
8
  */
9
9
  import { getLayoutType } from '../../layouts';
10
+ import useSetting from '../use-setting';
10
11
 
11
12
  export const defaultLayout = { type: 'default' };
12
13
 
@@ -24,12 +25,23 @@ export function useLayout() {
24
25
  return useContext( Layout );
25
26
  }
26
27
 
27
- export function LayoutStyle( { layout = {}, ...props } ) {
28
+ export function LayoutStyle( { layout = {}, css, ...props } ) {
28
29
  const layoutType = getLayoutType( layout.type );
30
+ const blockGapSupport = useSetting( 'spacing.blockGap' );
31
+ const hasBlockGapSupport = blockGapSupport !== null;
29
32
 
30
33
  if ( layoutType ) {
31
- return <layoutType.save layout={ layout } { ...props } />;
34
+ if ( css ) {
35
+ return <style>{ css }</style>;
36
+ }
37
+ const layoutStyle = layoutType.getLayoutStyle?.( {
38
+ hasBlockGapSupport,
39
+ layout,
40
+ ...props,
41
+ } );
42
+ if ( layoutStyle ) {
43
+ return <style>{ layoutStyle }</style>;
44
+ }
32
45
  }
33
-
34
46
  return null;
35
47
  }
@@ -26,7 +26,7 @@
26
26
  // When selecting multiple blocks, we provide an additional selection indicator.
27
27
  &.is-navigate-mode .block-editor-block-list__block.is-selected,
28
28
  &.is-navigate-mode .block-editor-block-list__block.is-hovered,
29
- .block-editor-block-list__block.is-multi-selected:not([contenteditable]),
29
+ .block-editor-block-list__block.is-multi-selected:not(.is-partially-selected),
30
30
  .block-editor-block-list__block.is-highlighted,
31
31
  .block-editor-block-list__block.is-highlighted ~ .is-multi-selected {
32
32
  &::after {
@@ -33,6 +33,7 @@ export function useBlockClassNames( clientId ) {
33
33
  getSettings,
34
34
  hasSelectedInnerBlock,
35
35
  isTyping,
36
+ __unstableIsFullySelected,
36
37
  } = select( blockEditorStore );
37
38
  const { outlineMode } = getSettings();
38
39
  const isDragging = isBlockBeingDragged( clientId );
@@ -44,10 +45,13 @@ export function useBlockClassNames( clientId ) {
44
45
  clientId,
45
46
  checkDeep
46
47
  );
48
+ const isMultiSelected = isBlockMultiSelected( clientId );
47
49
  return classnames( {
48
50
  'is-selected': isSelected,
49
51
  'is-highlighted': isBlockHighlighted( clientId ),
50
- 'is-multi-selected': isBlockMultiSelected( clientId ),
52
+ 'is-multi-selected': isMultiSelected,
53
+ 'is-partially-selected':
54
+ isMultiSelected && ! __unstableIsFullySelected(),
51
55
  'is-reusable': isReusableBlock( getBlockType( name ) ),
52
56
  'is-dragging': isDragging,
53
57
  'has-child-selected': isAncestorOfSelectedBlock,
@@ -10,6 +10,7 @@ import {
10
10
  FlexItem,
11
11
  Icon,
12
12
  Modal,
13
+ ToggleControl,
13
14
  } from '@wordpress/components';
14
15
  import { lock as lockIcon, unlock as unlockIcon } from '@wordpress/icons';
15
16
  import { useInstanceId } from '@wordpress/compose';
@@ -23,20 +24,41 @@ import useBlockLock from './use-block-lock';
23
24
  import useBlockDisplayInformation from '../use-block-display-information';
24
25
  import { store as blockEditorStore } from '../../store';
25
26
 
27
+ function getTemplateLockValue( lock ) {
28
+ // Prevents all operations.
29
+ if ( lock.remove && lock.move ) {
30
+ return 'all';
31
+ }
32
+
33
+ // Prevents inserting or removing blocks, but allows moving existing blocks.
34
+ if ( lock.remove && ! lock.move ) {
35
+ return 'insert';
36
+ }
37
+
38
+ return false;
39
+ }
40
+
26
41
  export default function BlockLockModal( { clientId, onClose } ) {
27
42
  const [ lock, setLock ] = useState( { move: false, remove: false } );
28
43
  const { canEdit, canMove, canRemove } = useBlockLock( clientId );
29
- const { isReusable } = useSelect(
44
+ const { isReusable, templateLock, hasTemplateLock } = useSelect(
30
45
  ( select ) => {
31
- const { getBlockName } = select( blockEditorStore );
46
+ const { getBlockName, getBlockAttributes } =
47
+ select( blockEditorStore );
32
48
  const blockName = getBlockName( clientId );
49
+ const blockType = getBlockType( blockName );
33
50
 
34
51
  return {
35
- isReusable: isReusableBlock( getBlockType( blockName ) ),
52
+ isReusable: isReusableBlock( blockType ),
53
+ templateLock: getBlockAttributes( clientId )?.templateLock,
54
+ hasTemplateLock: !! blockType?.attributes?.templateLock,
36
55
  };
37
56
  },
38
57
  [ clientId ]
39
58
  );
59
+ const [ applyTemplateLock, setApplyTemplateLock ] = useState(
60
+ !! templateLock
61
+ );
40
62
  const { updateBlockAttributes } = useDispatch( blockEditorStore );
41
63
  const blockInformation = useBlockDisplayInformation( clientId );
42
64
  const instanceId = useInstanceId(
@@ -66,18 +88,23 @@ export default function BlockLockModal( { clientId, onClose } ) {
66
88
  closeLabel={ __( 'Close' ) }
67
89
  onRequestClose={ onClose }
68
90
  >
91
+ <p>
92
+ { __(
93
+ 'Choose specific attributes to restrict or lock all available options.'
94
+ ) }
95
+ </p>
69
96
  <form
70
97
  onSubmit={ ( event ) => {
71
98
  event.preventDefault();
72
- updateBlockAttributes( [ clientId ], { lock } );
99
+ updateBlockAttributes( [ clientId ], {
100
+ lock,
101
+ templateLock: applyTemplateLock
102
+ ? getTemplateLockValue( lock )
103
+ : undefined,
104
+ } );
73
105
  onClose();
74
106
  } }
75
107
  >
76
- <p>
77
- { __(
78
- 'Choose specific attributes to restrict or lock all available options.'
79
- ) }
80
- </p>
81
108
  <div
82
109
  role="group"
83
110
  aria-labelledby={ instanceId }
@@ -171,6 +198,17 @@ export default function BlockLockModal( { clientId, onClose } ) {
171
198
  />
172
199
  </li>
173
200
  </ul>
201
+ { hasTemplateLock && (
202
+ <ToggleControl
203
+ className="block-editor-block-lock-modal__template-lock"
204
+ label={ __( 'Apply to all blocks inside' ) }
205
+ checked={ applyTemplateLock }
206
+ disabled={ lock.move && ! lock.remove }
207
+ onChange={ () =>
208
+ setApplyTemplateLock( ! applyTemplateLock )
209
+ }
210
+ />
211
+ ) }
174
212
  </div>
175
213
  <Flex
176
214
  className="block-editor-block-lock-modal__actions"
@@ -53,6 +53,16 @@
53
53
  }
54
54
  }
55
55
 
56
+ .block-editor-block-lock-modal__template-lock {
57
+ border-top: $border-width solid $gray-300;
58
+ margin-top: $grid-unit-20;
59
+ padding: $grid-unit-15 0;
60
+
61
+ .components-base-control__field {
62
+ margin: 0;
63
+ }
64
+ }
65
+
56
66
  .block-editor-block-lock-modal__actions {
57
67
  margin-top: $grid-unit-30;
58
68
  }
@@ -2,7 +2,7 @@
2
2
  * External dependencies
3
3
  */
4
4
  import { Platform, findNodeHandle } from 'react-native';
5
- import { partial, first, castArray, last, compact, every } from 'lodash';
5
+ import { partial, first, castArray, last, every } from 'lodash';
6
6
  /**
7
7
  * WordPress dependencies
8
8
  */
@@ -202,7 +202,7 @@ const BlockActionsMenu = ( {
202
202
  },
203
203
  };
204
204
 
205
- const options = compact( [
205
+ const options = [
206
206
  wrapBlockMover && allOptions.backwardButton,
207
207
  wrapBlockMover && allOptions.forwardButton,
208
208
  wrapBlockSettings && allOptions.settings,
@@ -215,7 +215,7 @@ const BlockActionsMenu = ( {
215
215
  canDuplicate && allOptions.duplicateButton,
216
216
  isReusableBlockType && allOptions.convertToRegularBlocks,
217
217
  ! isLocked && allOptions.delete,
218
- ] );
218
+ ].filter( Boolean );
219
219
 
220
220
  // End early if there are no options to show.
221
221
  if ( ! options.length ) {
@@ -1,7 +1,22 @@
1
1
  /**
2
2
  * WordPress dependencies
3
3
  */
4
- import { __, _n, sprintf, isRTL } from '@wordpress/i18n';
4
+ import { __, sprintf, isRTL } from '@wordpress/i18n';
5
+
6
+ const getMovementDirection = ( moveDirection, orientation ) => {
7
+ if ( moveDirection === 'up' ) {
8
+ if ( orientation === 'horizontal' ) {
9
+ return isRTL() ? 'right' : 'left';
10
+ }
11
+ return 'up';
12
+ } else if ( moveDirection === 'down' ) {
13
+ if ( orientation === 'horizontal' ) {
14
+ return isRTL() ? 'left' : 'right';
15
+ }
16
+ return 'down';
17
+ }
18
+ return null;
19
+ };
5
20
 
6
21
  /**
7
22
  * Return a label for the block movement controls depending on block position.
@@ -30,28 +45,14 @@ export function getBlockMoverDescription(
30
45
  ) {
31
46
  const position = firstIndex + 1;
32
47
 
33
- const getMovementDirection = ( moveDirection ) => {
34
- if ( moveDirection === 'up' ) {
35
- if ( orientation === 'horizontal' ) {
36
- return isRTL() ? 'right' : 'left';
37
- }
38
- return 'up';
39
- } else if ( moveDirection === 'down' ) {
40
- if ( orientation === 'horizontal' ) {
41
- return isRTL() ? 'left' : 'right';
42
- }
43
- return 'down';
44
- }
45
- return null;
46
- };
47
-
48
48
  if ( selectedCount > 1 ) {
49
49
  return getMultiBlockMoverDescription(
50
50
  selectedCount,
51
51
  firstIndex,
52
52
  isFirst,
53
53
  isLast,
54
- dir
54
+ dir,
55
+ orientation
55
56
  );
56
57
  }
57
58
 
@@ -65,7 +66,7 @@ export function getBlockMoverDescription(
65
66
 
66
67
  if ( dir > 0 && ! isLast ) {
67
68
  // Moving down.
68
- const movementDirection = getMovementDirection( 'down' );
69
+ const movementDirection = getMovementDirection( 'down', orientation );
69
70
 
70
71
  if ( movementDirection === 'down' ) {
71
72
  return sprintf(
@@ -106,7 +107,7 @@ export function getBlockMoverDescription(
106
107
 
107
108
  if ( dir > 0 && isLast ) {
108
109
  // Moving down, and is the last item.
109
- const movementDirection = getMovementDirection( 'down' );
110
+ const movementDirection = getMovementDirection( 'down', orientation );
110
111
 
111
112
  if ( movementDirection === 'down' ) {
112
113
  return sprintf(
@@ -141,7 +142,7 @@ export function getBlockMoverDescription(
141
142
 
142
143
  if ( dir < 0 && ! isFirst ) {
143
144
  // Moving up.
144
- const movementDirection = getMovementDirection( 'up' );
145
+ const movementDirection = getMovementDirection( 'up', orientation );
145
146
 
146
147
  if ( movementDirection === 'up' ) {
147
148
  return sprintf(
@@ -180,7 +181,7 @@ export function getBlockMoverDescription(
180
181
 
181
182
  if ( dir < 0 && isFirst ) {
182
183
  // Moving up, and is the first item.
183
- const movementDirection = getMovementDirection( 'up' );
184
+ const movementDirection = getMovementDirection( 'up', orientation );
184
185
 
185
186
  if ( movementDirection === 'up' ) {
186
187
  return sprintf(
@@ -223,6 +224,8 @@ export function getBlockMoverDescription(
223
224
  * @param {boolean} isLast This is the last block.
224
225
  * @param {number} dir Direction of movement (> 0 is considered to be going
225
226
  * down, < 0 is up).
227
+ * @param {string} orientation The orientation of the block movers, vertical or
228
+ * horizontal.
226
229
  *
227
230
  * @return {string} Label for the block movement controls.
228
231
  */
@@ -231,43 +234,123 @@ export function getMultiBlockMoverDescription(
231
234
  firstIndex,
232
235
  isFirst,
233
236
  isLast,
234
- dir
237
+ dir,
238
+ orientation
235
239
  ) {
236
240
  const position = firstIndex + 1;
237
241
 
238
- if ( dir < 0 && isFirst ) {
239
- return __( 'Blocks cannot be moved up as they are already at the top' );
242
+ if ( isFirst && isLast ) {
243
+ // All blocks are selected
244
+ return __( 'All blocks are selected, and cannot be moved' );
245
+ }
246
+
247
+ if ( dir > 0 && ! isLast ) {
248
+ // moving down
249
+ const movementDirection = getMovementDirection( 'down', orientation );
250
+
251
+ if ( movementDirection === 'down' ) {
252
+ return sprintf(
253
+ // translators: 1: Number of selected blocks, 2: Position of selected blocks
254
+ __( 'Move %1$d blocks from position %2$d down by one place' ),
255
+ selectedCount,
256
+ position
257
+ );
258
+ }
259
+
260
+ if ( movementDirection === 'left' ) {
261
+ return sprintf(
262
+ // translators: 1: Number of selected blocks, 2: Position of selected blocks
263
+ __( 'Move %1$d blocks from position %2$d left by one place' ),
264
+ selectedCount,
265
+ position
266
+ );
267
+ }
268
+
269
+ if ( movementDirection === 'right' ) {
270
+ return sprintf(
271
+ // translators: 1: Number of selected blocks, 2: Position of selected blocks
272
+ __( 'Move %1$d blocks from position %2$d right by one place' ),
273
+ selectedCount,
274
+ position
275
+ );
276
+ }
240
277
  }
241
278
 
242
279
  if ( dir > 0 && isLast ) {
243
- return __(
244
- 'Blocks cannot be moved down as they are already at the bottom'
245
- );
280
+ // moving down, and the selected blocks are the last item
281
+ const movementDirection = getMovementDirection( 'down', orientation );
282
+
283
+ if ( movementDirection === 'down' ) {
284
+ return __(
285
+ 'Blocks cannot be moved down as they are already at the bottom'
286
+ );
287
+ }
288
+
289
+ if ( movementDirection === 'left' ) {
290
+ return __(
291
+ 'Blocks cannot be moved left as they are already are at the leftmost position'
292
+ );
293
+ }
294
+
295
+ if ( movementDirection === 'right' ) {
296
+ return __(
297
+ 'Blocks cannot be moved right as they are already are at the rightmost position'
298
+ );
299
+ }
246
300
  }
247
301
 
248
302
  if ( dir < 0 && ! isFirst ) {
249
- return sprintf(
250
- // translators: 1: Number of selected blocks, 2: Position of selected blocks
251
- _n(
252
- 'Move %1$d block from position %2$d up by one place',
253
- 'Move %1$d blocks from position %2$d up by one place',
254
- selectedCount
255
- ),
256
- selectedCount,
257
- position
258
- );
303
+ // moving up
304
+ const movementDirection = getMovementDirection( 'up', orientation );
305
+
306
+ if ( movementDirection === 'up' ) {
307
+ return sprintf(
308
+ // translators: 1: Number of selected blocks, 2: Position of selected blocks
309
+ __( 'Move %1$d blocks from position %2$d up by one place' ),
310
+ selectedCount,
311
+ position
312
+ );
313
+ }
314
+
315
+ if ( movementDirection === 'left' ) {
316
+ return sprintf(
317
+ // translators: 1: Number of selected blocks, 2: Position of selected blocks
318
+ __( 'Move %1$d blocks from position %2$d left by one place' ),
319
+ selectedCount,
320
+ position
321
+ );
322
+ }
323
+
324
+ if ( movementDirection === 'right' ) {
325
+ return sprintf(
326
+ // translators: 1: Number of selected blocks, 2: Position of selected blocks
327
+ __( 'Move %1$d blocks from position %2$d right by one place' ),
328
+ selectedCount,
329
+ position
330
+ );
331
+ }
259
332
  }
260
333
 
261
- if ( dir > 0 && ! isLast ) {
262
- return sprintf(
263
- // translators: 1: Number of selected blocks, 2: Position of selected blocks
264
- _n(
265
- 'Move %1$d block from position %2$d down by one place',
266
- 'Move %1$d blocks from position %2$d down by one place',
267
- selectedCount
268
- ),
269
- selectedCount,
270
- position
271
- );
334
+ if ( dir < 0 && isFirst ) {
335
+ // moving up, and the selected blocks are the first item
336
+ const movementDirection = getMovementDirection( 'up', orientation );
337
+
338
+ if ( movementDirection === 'up' ) {
339
+ return __(
340
+ 'Blocks cannot be moved up as they are already at the top'
341
+ );
342
+ }
343
+
344
+ if ( movementDirection === 'left' ) {
345
+ return __(
346
+ 'Blocks cannot be moved left as they are already are at the leftmost position'
347
+ );
348
+ }
349
+
350
+ if ( movementDirection === 'right' ) {
351
+ return __(
352
+ 'Blocks cannot be moved right as they are already are at the rightmost position'
353
+ );
354
+ }
272
355
  }
273
356
  }
@@ -183,9 +183,7 @@ describe( 'block mover', () => {
183
183
  true,
184
184
  negativeDirection
185
185
  )
186
- ).toBe(
187
- 'Blocks cannot be moved up as they are already at the top'
188
- );
186
+ ).toBe( 'All blocks are selected, and cannot be moved' );
189
187
  } );
190
188
 
191
189
  it( 'generates a title for a selection of blocks at the bottom', () => {
@@ -201,5 +199,59 @@ describe( 'block mover', () => {
201
199
  'Blocks cannot be moved down as they are already at the bottom'
202
200
  );
203
201
  } );
202
+
203
+ it( 'indicates that blocks can be moved left when the orientation is horizontal and the direction is negative', () => {
204
+ expect(
205
+ getMultiBlockMoverDescription(
206
+ 4,
207
+ 1,
208
+ false,
209
+ true,
210
+ negativeDirection,
211
+ 'horizontal'
212
+ )
213
+ ).toBe( 'Move 4 blocks from position 2 left by one place' );
214
+ } );
215
+
216
+ it( 'indicates that blocks can be moved right when the orientation is horizontal and the direction is positive', () => {
217
+ expect(
218
+ getMultiBlockMoverDescription(
219
+ 4,
220
+ 0,
221
+ true,
222
+ false,
223
+ positiveDirection,
224
+ 'horizontal'
225
+ )
226
+ ).toBe( 'Move 4 blocks from position 1 right by one place' );
227
+ } );
228
+
229
+ it( 'indicates that blocks cannot be moved left when the orientation is horizontal and a selection of blocks at the left', () => {
230
+ expect(
231
+ getMultiBlockMoverDescription(
232
+ 4,
233
+ 1,
234
+ true,
235
+ true,
236
+ negativeDirection,
237
+ 'horizontal'
238
+ )
239
+ ).toBe( 'All blocks are selected, and cannot be moved' );
240
+ } );
241
+
242
+ it( 'indicates that blocks cannot be moved right when the orientation is horizontal and the block is the last block', () => {
243
+ expect(
244
+ getMultiBlockMoverDescription(
245
+ 4,
246
+ 2,
247
+ false,
248
+ true,
249
+ positiveDirection,
250
+ 'horizontal'
251
+ )
252
+ ).toBe(
253
+ 'Blocks cannot be moved right as they are already are at the rightmost position'
254
+ );
255
+ } );
204
256
  } );
205
257
  } );
@@ -11,7 +11,7 @@ import {
11
11
  } from '@wordpress/components';
12
12
 
13
13
  import { useState } from '@wordpress/element';
14
- import { useInstanceId, useResizeObserver } from '@wordpress/compose';
14
+ import { useInstanceId } from '@wordpress/compose';
15
15
  import { __ } from '@wordpress/i18n';
16
16
 
17
17
  /**
@@ -28,7 +28,6 @@ const SetupContent = ( {
28
28
  activeSlide,
29
29
  patterns,
30
30
  onBlockPatternSelect,
31
- height,
32
31
  } ) => {
33
32
  const composite = useCompositeState();
34
33
  const containerClass = 'block-editor-block-pattern-setup__container';
@@ -39,10 +38,7 @@ const SetupContent = ( {
39
38
  [ activeSlide + 1, 'next-slide' ],
40
39
  ] );
41
40
  return (
42
- <div
43
- className="block-editor-block-pattern-setup__carousel"
44
- style={ { height } }
45
- >
41
+ <div className="block-editor-block-pattern-setup__carousel">
46
42
  <div className={ containerClass }>
47
43
  <ul className="carousel-container">
48
44
  { patterns.map( ( pattern, index ) => (
@@ -50,7 +46,6 @@ const SetupContent = ( {
50
46
  className={ slideClass.get( index ) || '' }
51
47
  key={ pattern.name }
52
48
  pattern={ pattern }
53
- minHeight={ height }
54
49
  />
55
50
  ) ) }
56
51
  </ul>
@@ -59,10 +54,7 @@ const SetupContent = ( {
59
54
  );
60
55
  }
61
56
  return (
62
- <div
63
- style={ { height } }
64
- className="block-editor-block-pattern-setup__grid"
65
- >
57
+ <div className="block-editor-block-pattern-setup__grid">
66
58
  <Composite
67
59
  { ...composite }
68
60
  role="listbox"
@@ -151,8 +143,6 @@ const BlockPatternSetup = ( {
151
143
  const [ activeSlide, setActiveSlide ] = useState( 0 );
152
144
  const { replaceBlock } = useDispatch( blockEditorStore );
153
145
  const patterns = usePatternsSetup( clientId, blockName, filterPatternsFn );
154
- const [ contentResizeListener, { height: contentHeight } ] =
155
- useResizeObserver();
156
146
 
157
147
  if ( ! patterns?.length ) {
158
148
  return null;
@@ -166,7 +156,6 @@ const BlockPatternSetup = ( {
166
156
  onBlockPatternSelect || onBlockPatternSelectDefault;
167
157
  return (
168
158
  <>
169
- { contentResizeListener }
170
159
  <div
171
160
  className={ `block-editor-block-pattern-setup view-mode-${ viewMode }` }
172
161
  >
@@ -175,7 +164,6 @@ const BlockPatternSetup = ( {
175
164
  activeSlide={ activeSlide }
176
165
  patterns={ patterns }
177
166
  onBlockPatternSelect={ onPatternSelectCallback }
178
- height={ contentHeight - 2 * 60 }
179
167
  />
180
168
  <SetupToolbar
181
169
  viewMode={ viewMode }