@wordpress/block-editor 9.8.1-next.957ca95e4c.0 → 10.0.1

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 (511) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +13 -1
  3. package/build/components/alignment-control/ui.js +6 -5
  4. package/build/components/alignment-control/ui.js.map +1 -1
  5. package/build/components/autocomplete/index.js +2 -2
  6. package/build/components/autocomplete/index.js.map +1 -1
  7. package/build/components/block-actions/index.js +5 -9
  8. package/build/components/block-actions/index.js.map +1 -1
  9. package/build/components/block-alignment-control/ui.js +5 -5
  10. package/build/components/block-alignment-control/ui.js.map +1 -1
  11. package/build/components/block-content-overlay/index.js +2 -4
  12. package/build/components/block-content-overlay/index.js.map +1 -1
  13. package/build/components/block-draggable/draggable-chip.js +2 -1
  14. package/build/components/block-draggable/draggable-chip.js.map +1 -1
  15. package/build/components/block-edit/edit.js +1 -1
  16. package/build/components/block-edit/edit.js.map +1 -1
  17. package/build/components/block-inspector/index.js +125 -17
  18. package/build/components/block-inspector/index.js.map +1 -1
  19. package/build/components/block-list/block-list-compact.native.js +2 -1
  20. package/build/components/block-list/block-list-compact.native.js.map +1 -1
  21. package/build/components/block-list/block.js +40 -9
  22. package/build/components/block-list/block.js.map +1 -1
  23. package/build/components/block-list/index.js +4 -4
  24. package/build/components/block-list/index.js.map +1 -1
  25. package/build/components/block-list/use-block-props/index.js +14 -11
  26. package/build/components/block-list/use-block-props/index.js.map +1 -1
  27. package/build/components/block-list/use-block-props/use-block-class-names.js +3 -2
  28. package/build/components/block-list/use-block-props/use-block-class-names.js.map +1 -1
  29. package/build/components/block-list/use-block-props/use-focus-first-element.js +3 -9
  30. package/build/components/block-list/use-block-props/use-focus-first-element.js.map +1 -1
  31. package/build/components/block-list/use-block-props/use-is-hovered.js +1 -2
  32. package/build/components/block-list/use-block-props/use-is-hovered.js.map +1 -1
  33. package/build/components/block-list/use-in-between-inserter.js +7 -12
  34. package/build/components/block-list/use-in-between-inserter.js.map +1 -1
  35. package/build/components/block-list-appender/index.js +20 -21
  36. package/build/components/block-list-appender/index.js.map +1 -1
  37. package/build/components/block-list-appender/index.native.js +1 -7
  38. package/build/components/block-list-appender/index.native.js.map +1 -1
  39. package/build/components/block-lock/use-block-lock.js +3 -1
  40. package/build/components/block-lock/use-block-lock.js.map +1 -1
  41. package/build/components/block-mobile-toolbar/block-actions-menu.native.js +20 -10
  42. package/build/components/block-mobile-toolbar/block-actions-menu.native.js.map +1 -1
  43. package/build/components/block-mover/button.js +4 -6
  44. package/build/components/block-mover/button.js.map +1 -1
  45. package/build/components/block-mover/index.js +4 -6
  46. package/build/components/block-mover/index.js.map +1 -1
  47. package/build/components/block-mover/index.native.js +24 -8
  48. package/build/components/block-mover/index.native.js.map +1 -1
  49. package/build/components/block-popover/inbetween.js +82 -52
  50. package/build/components/block-popover/inbetween.js.map +1 -1
  51. package/build/components/block-popover/index.js +31 -7
  52. package/build/components/block-popover/index.js.map +1 -1
  53. package/build/components/block-preview/auto.js +4 -2
  54. package/build/components/block-preview/auto.js.map +1 -1
  55. package/build/components/block-settings-menu/block-settings-dropdown.js +3 -1
  56. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  57. package/build/components/block-settings-menu-controls/index.js +3 -1
  58. package/build/components/block-settings-menu-controls/index.js.map +1 -1
  59. package/build/components/block-styles/preview-panel.js +7 -1
  60. package/build/components/block-styles/preview-panel.js.map +1 -1
  61. package/build/components/block-switcher/block-transformations-menu.js +114 -25
  62. package/build/components/block-switcher/block-transformations-menu.js.map +1 -1
  63. package/build/components/block-toolbar/index.js +9 -8
  64. package/build/components/block-toolbar/index.js.map +1 -1
  65. package/build/components/block-tools/block-contextual-toolbar.js +3 -2
  66. package/build/components/block-tools/block-contextual-toolbar.js.map +1 -1
  67. package/build/components/block-tools/block-selection-button.js +13 -5
  68. package/build/components/block-tools/block-selection-button.js.map +1 -1
  69. package/build/components/block-tools/index.js +33 -15
  70. package/build/components/block-tools/index.js.map +1 -1
  71. package/build/components/block-tools/insertion-point.js +4 -9
  72. package/build/components/block-tools/insertion-point.js.map +1 -1
  73. package/build/components/block-tools/selected-block-popover.js +9 -8
  74. package/build/components/block-tools/selected-block-popover.js.map +1 -1
  75. package/build/components/block-tools/use-block-toolbar-popover-props.js +13 -8
  76. package/build/components/block-tools/use-block-toolbar-popover-props.js.map +1 -1
  77. package/build/components/block-tools/zoom-out-mode-inserters.js +71 -0
  78. package/build/components/block-tools/zoom-out-mode-inserters.js.map +1 -0
  79. package/build/components/block-vertical-alignment-control/ui.js +5 -2
  80. package/build/components/block-vertical-alignment-control/ui.js.map +1 -1
  81. package/build/components/border-radius-control/linked-button.js +5 -6
  82. package/build/components/border-radius-control/linked-button.js.map +1 -1
  83. package/build/components/colors-gradients/dropdown.js +1 -1
  84. package/build/components/colors-gradients/dropdown.js.map +1 -1
  85. package/build/components/convert-to-group-buttons/toolbar.js +8 -3
  86. package/build/components/convert-to-group-buttons/toolbar.js.map +1 -1
  87. package/build/components/iframe/index.js +31 -4
  88. package/build/components/iframe/index.js.map +1 -1
  89. package/build/components/inner-blocks/default-block-appender.js +1 -7
  90. package/build/components/inner-blocks/default-block-appender.js.map +1 -1
  91. package/build/components/inner-blocks/index.js +9 -3
  92. package/build/components/inner-blocks/index.js.map +1 -1
  93. package/build/components/inner-blocks/use-inner-block-template-sync.js +28 -17
  94. package/build/components/inner-blocks/use-inner-block-template-sync.js.map +1 -1
  95. package/build/components/inner-blocks/use-nested-settings-update.js +28 -4
  96. package/build/components/inner-blocks/use-nested-settings-update.js.map +1 -1
  97. package/build/components/inserter/index.js +3 -6
  98. package/build/components/inserter/index.js.map +1 -1
  99. package/build/components/inserter/library.js +14 -3
  100. package/build/components/inserter/library.js.map +1 -1
  101. package/build/components/inserter/menu.js +21 -8
  102. package/build/components/inserter/menu.js.map +1 -1
  103. package/build/components/inserter/preview-panel.js +1 -1
  104. package/build/components/inserter/preview-panel.js.map +1 -1
  105. package/build/components/inserter/tabs.js +11 -4
  106. package/build/components/inserter/tabs.js.map +1 -1
  107. package/build/components/link-control/link-preview.js +1 -1
  108. package/build/components/link-control/link-preview.js.map +1 -1
  109. package/build/components/link-control/search-input.js +6 -3
  110. package/build/components/link-control/search-input.js.map +1 -1
  111. package/build/components/link-control/search-item.js +36 -5
  112. package/build/components/link-control/search-item.js.map +1 -1
  113. package/build/components/list-view/block.js +23 -11
  114. package/build/components/list-view/block.js.map +1 -1
  115. package/build/components/list-view/branch.js +19 -2
  116. package/build/components/list-view/branch.js.map +1 -1
  117. package/build/components/list-view/drop-indicator.js +30 -28
  118. package/build/components/list-view/drop-indicator.js.map +1 -1
  119. package/build/components/list-view/index.js +8 -4
  120. package/build/components/list-view/index.js.map +1 -1
  121. package/build/components/list-view/use-block-selection.js +0 -1
  122. package/build/components/list-view/use-block-selection.js.map +1 -1
  123. package/build/components/provider/use-block-sync.js +1 -7
  124. package/build/components/provider/use-block-sync.js.map +1 -1
  125. package/build/components/publish-date-time-picker/index.js +1 -1
  126. package/build/components/publish-date-time-picker/index.js.map +1 -1
  127. package/build/components/rich-text/format-toolbar-container.js +9 -9
  128. package/build/components/rich-text/format-toolbar-container.js.map +1 -1
  129. package/build/components/rich-text/index.js +31 -21
  130. package/build/components/rich-text/index.js.map +1 -1
  131. package/build/components/rich-text/index.native.js +11 -20
  132. package/build/components/rich-text/index.native.js.map +1 -1
  133. package/build/components/spacing-sizes-control/linked-button.js +2 -3
  134. package/build/components/spacing-sizes-control/linked-button.js.map +1 -1
  135. package/build/components/spacing-sizes-control/utils.js +1 -4
  136. package/build/components/spacing-sizes-control/utils.js.map +1 -1
  137. package/build/components/text-decoration-control/index.js +19 -15
  138. package/build/components/text-decoration-control/index.js.map +1 -1
  139. package/build/components/text-transform-control/index.js +25 -17
  140. package/build/components/text-transform-control/index.js.map +1 -1
  141. package/build/components/tool-selector/index.js +6 -11
  142. package/build/components/tool-selector/index.js.map +1 -1
  143. package/build/components/url-popover/image-url-input-ui.js +6 -4
  144. package/build/components/url-popover/image-url-input-ui.js.map +1 -1
  145. package/build/components/url-popover/index.js +1 -1
  146. package/build/components/url-popover/index.js.map +1 -1
  147. package/build/components/use-block-drop-zone/index.js +7 -4
  148. package/build/components/use-block-drop-zone/index.js.map +1 -1
  149. package/build/components/use-moving-animation/index.js +9 -28
  150. package/build/components/use-moving-animation/index.js.map +1 -1
  151. package/build/components/writing-flow/use-select-all.js +1 -7
  152. package/build/components/writing-flow/use-select-all.js.map +1 -1
  153. package/build/hooks/align.js +14 -2
  154. package/build/hooks/align.js.map +1 -1
  155. package/build/hooks/color-panel.js +2 -1
  156. package/build/hooks/color-panel.js.map +1 -1
  157. package/build/hooks/content-lock-ui.js +145 -0
  158. package/build/hooks/content-lock-ui.js.map +1 -0
  159. package/build/hooks/duotone.js +8 -1
  160. package/build/hooks/duotone.js.map +1 -1
  161. package/build/hooks/index.js +14 -0
  162. package/build/hooks/index.js.map +1 -1
  163. package/build/hooks/layout.js +11 -9
  164. package/build/hooks/layout.js.map +1 -1
  165. package/build/hooks/metadata-name.js +55 -0
  166. package/build/hooks/metadata-name.js.map +1 -0
  167. package/build/hooks/metadata.js +65 -0
  168. package/build/hooks/metadata.js.map +1 -0
  169. package/build/hooks/typography.js +10 -11
  170. package/build/hooks/typography.js.map +1 -1
  171. package/build/hooks/use-typography-props.js +51 -0
  172. package/build/hooks/use-typography-props.js.map +1 -0
  173. package/build/hooks/utils.js +3 -1
  174. package/build/hooks/utils.js.map +1 -1
  175. package/build/index.js +7 -0
  176. package/build/index.js.map +1 -1
  177. package/build/layouts/constrained.js +59 -20
  178. package/build/layouts/constrained.js.map +1 -1
  179. package/build/store/actions.js +65 -21
  180. package/build/store/actions.js.map +1 -1
  181. package/build/store/reducer.js +43 -19
  182. package/build/store/reducer.js.map +1 -1
  183. package/build/store/selectors.js +96 -10
  184. package/build/store/selectors.js.map +1 -1
  185. package/build/utils/parse-css-unit-to-px.js +1 -1
  186. package/build/utils/parse-css-unit-to-px.js.map +1 -1
  187. package/build-module/components/alignment-control/ui.js +6 -5
  188. package/build-module/components/alignment-control/ui.js.map +1 -1
  189. package/build-module/components/autocomplete/index.js +2 -2
  190. package/build-module/components/autocomplete/index.js.map +1 -1
  191. package/build-module/components/block-actions/index.js +5 -8
  192. package/build-module/components/block-actions/index.js.map +1 -1
  193. package/build-module/components/block-alignment-control/ui.js +5 -5
  194. package/build-module/components/block-alignment-control/ui.js.map +1 -1
  195. package/build-module/components/block-content-overlay/index.js +2 -4
  196. package/build-module/components/block-content-overlay/index.js.map +1 -1
  197. package/build-module/components/block-draggable/draggable-chip.js +2 -1
  198. package/build-module/components/block-draggable/draggable-chip.js.map +1 -1
  199. package/build-module/components/block-edit/edit.js +1 -1
  200. package/build-module/components/block-edit/edit.js.map +1 -1
  201. package/build-module/components/block-inspector/index.js +127 -19
  202. package/build-module/components/block-inspector/index.js.map +1 -1
  203. package/build-module/components/block-list/block-list-compact.native.js +2 -1
  204. package/build-module/components/block-list/block-list-compact.native.js.map +1 -1
  205. package/build-module/components/block-list/block.js +41 -9
  206. package/build-module/components/block-list/block.js.map +1 -1
  207. package/build-module/components/block-list/index.js +4 -4
  208. package/build-module/components/block-list/index.js.map +1 -1
  209. package/build-module/components/block-list/use-block-props/index.js +13 -11
  210. package/build-module/components/block-list/use-block-props/index.js.map +1 -1
  211. package/build-module/components/block-list/use-block-props/use-block-class-names.js +3 -2
  212. package/build-module/components/block-list/use-block-props/use-block-class-names.js.map +1 -1
  213. package/build-module/components/block-list/use-block-props/use-focus-first-element.js +3 -8
  214. package/build-module/components/block-list/use-block-props/use-focus-first-element.js.map +1 -1
  215. package/build-module/components/block-list/use-block-props/use-is-hovered.js +1 -2
  216. package/build-module/components/block-list/use-block-props/use-is-hovered.js.map +1 -1
  217. package/build-module/components/block-list/use-in-between-inserter.js +7 -12
  218. package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
  219. package/build-module/components/block-list-appender/index.js +20 -20
  220. package/build-module/components/block-list-appender/index.js.map +1 -1
  221. package/build-module/components/block-list-appender/index.native.js +1 -6
  222. package/build-module/components/block-list-appender/index.native.js.map +1 -1
  223. package/build-module/components/block-lock/use-block-lock.js +3 -1
  224. package/build-module/components/block-lock/use-block-lock.js.map +1 -1
  225. package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js +20 -9
  226. package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js.map +1 -1
  227. package/build-module/components/block-mover/button.js +4 -5
  228. package/build-module/components/block-mover/button.js.map +1 -1
  229. package/build-module/components/block-mover/index.js +4 -5
  230. package/build-module/components/block-mover/index.js.map +1 -1
  231. package/build-module/components/block-mover/index.native.js +24 -7
  232. package/build-module/components/block-mover/index.native.js.map +1 -1
  233. package/build-module/components/block-popover/inbetween.js +83 -53
  234. package/build-module/components/block-popover/inbetween.js.map +1 -1
  235. package/build-module/components/block-popover/index.js +31 -7
  236. package/build-module/components/block-popover/index.js.map +1 -1
  237. package/build-module/components/block-preview/auto.js +4 -2
  238. package/build-module/components/block-preview/auto.js.map +1 -1
  239. package/build-module/components/block-settings-menu/block-settings-dropdown.js +3 -1
  240. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  241. package/build-module/components/block-settings-menu-controls/index.js +3 -1
  242. package/build-module/components/block-settings-menu-controls/index.js.map +1 -1
  243. package/build-module/components/block-styles/preview-panel.js +6 -1
  244. package/build-module/components/block-styles/preview-panel.js.map +1 -1
  245. package/build-module/components/block-switcher/block-transformations-menu.js +115 -27
  246. package/build-module/components/block-switcher/block-transformations-menu.js.map +1 -1
  247. package/build-module/components/block-toolbar/index.js +9 -8
  248. package/build-module/components/block-toolbar/index.js.map +1 -1
  249. package/build-module/components/block-tools/block-contextual-toolbar.js +3 -2
  250. package/build-module/components/block-tools/block-contextual-toolbar.js.map +1 -1
  251. package/build-module/components/block-tools/block-selection-button.js +12 -5
  252. package/build-module/components/block-tools/block-selection-button.js.map +1 -1
  253. package/build-module/components/block-tools/index.js +30 -15
  254. package/build-module/components/block-tools/index.js.map +1 -1
  255. package/build-module/components/block-tools/insertion-point.js +4 -9
  256. package/build-module/components/block-tools/insertion-point.js.map +1 -1
  257. package/build-module/components/block-tools/selected-block-popover.js +9 -8
  258. package/build-module/components/block-tools/selected-block-popover.js.map +1 -1
  259. package/build-module/components/block-tools/use-block-toolbar-popover-props.js +13 -8
  260. package/build-module/components/block-tools/use-block-toolbar-popover-props.js.map +1 -1
  261. package/build-module/components/block-tools/zoom-out-mode-inserters.js +59 -0
  262. package/build-module/components/block-tools/zoom-out-mode-inserters.js.map +1 -0
  263. package/build-module/components/block-vertical-alignment-control/ui.js +5 -2
  264. package/build-module/components/block-vertical-alignment-control/ui.js.map +1 -1
  265. package/build-module/components/border-radius-control/linked-button.js +5 -6
  266. package/build-module/components/border-radius-control/linked-button.js.map +1 -1
  267. package/build-module/components/colors-gradients/dropdown.js +1 -1
  268. package/build-module/components/colors-gradients/dropdown.js.map +1 -1
  269. package/build-module/components/convert-to-group-buttons/toolbar.js +8 -3
  270. package/build-module/components/convert-to-group-buttons/toolbar.js.map +1 -1
  271. package/build-module/components/iframe/index.js +32 -5
  272. package/build-module/components/iframe/index.js.map +1 -1
  273. package/build-module/components/inner-blocks/default-block-appender.js +1 -6
  274. package/build-module/components/inner-blocks/default-block-appender.js.map +1 -1
  275. package/build-module/components/inner-blocks/index.js +9 -3
  276. package/build-module/components/inner-blocks/index.js.map +1 -1
  277. package/build-module/components/inner-blocks/use-inner-block-template-sync.js +28 -17
  278. package/build-module/components/inner-blocks/use-inner-block-template-sync.js.map +1 -1
  279. package/build-module/components/inner-blocks/use-nested-settings-update.js +28 -4
  280. package/build-module/components/inner-blocks/use-nested-settings-update.js.map +1 -1
  281. package/build-module/components/inserter/index.js +3 -6
  282. package/build-module/components/inserter/index.js.map +1 -1
  283. package/build-module/components/inserter/library.js +14 -3
  284. package/build-module/components/inserter/library.js.map +1 -1
  285. package/build-module/components/inserter/menu.js +20 -8
  286. package/build-module/components/inserter/menu.js.map +1 -1
  287. package/build-module/components/inserter/preview-panel.js +1 -1
  288. package/build-module/components/inserter/preview-panel.js.map +1 -1
  289. package/build-module/components/inserter/tabs.js +11 -4
  290. package/build-module/components/inserter/tabs.js.map +1 -1
  291. package/build-module/components/link-control/link-preview.js +1 -1
  292. package/build-module/components/link-control/link-preview.js.map +1 -1
  293. package/build-module/components/link-control/search-input.js +6 -2
  294. package/build-module/components/link-control/search-input.js.map +1 -1
  295. package/build-module/components/link-control/search-item.js +37 -6
  296. package/build-module/components/link-control/search-item.js.map +1 -1
  297. package/build-module/components/list-view/block.js +23 -11
  298. package/build-module/components/list-view/block.js.map +1 -1
  299. package/build-module/components/list-view/branch.js +19 -3
  300. package/build-module/components/list-view/branch.js.map +1 -1
  301. package/build-module/components/list-view/drop-indicator.js +30 -28
  302. package/build-module/components/list-view/drop-indicator.js.map +1 -1
  303. package/build-module/components/list-view/index.js +8 -4
  304. package/build-module/components/list-view/index.js.map +1 -1
  305. package/build-module/components/list-view/use-block-selection.js +0 -1
  306. package/build-module/components/list-view/use-block-selection.js.map +1 -1
  307. package/build-module/components/provider/use-block-sync.js +1 -6
  308. package/build-module/components/provider/use-block-sync.js.map +1 -1
  309. package/build-module/components/publish-date-time-picker/index.js +1 -1
  310. package/build-module/components/publish-date-time-picker/index.js.map +1 -1
  311. package/build-module/components/rich-text/format-toolbar-container.js +10 -10
  312. package/build-module/components/rich-text/format-toolbar-container.js.map +1 -1
  313. package/build-module/components/rich-text/index.js +31 -20
  314. package/build-module/components/rich-text/index.js.map +1 -1
  315. package/build-module/components/rich-text/index.native.js +11 -18
  316. package/build-module/components/rich-text/index.native.js.map +1 -1
  317. package/build-module/components/spacing-sizes-control/linked-button.js +2 -3
  318. package/build-module/components/spacing-sizes-control/linked-button.js.map +1 -1
  319. package/build-module/components/spacing-sizes-control/utils.js +1 -4
  320. package/build-module/components/spacing-sizes-control/utils.js.map +1 -1
  321. package/build-module/components/text-decoration-control/index.js +21 -16
  322. package/build-module/components/text-decoration-control/index.js.map +1 -1
  323. package/build-module/components/text-transform-control/index.js +28 -20
  324. package/build-module/components/text-transform-control/index.js.map +1 -1
  325. package/build-module/components/tool-selector/index.js +6 -11
  326. package/build-module/components/tool-selector/index.js.map +1 -1
  327. package/build-module/components/url-popover/image-url-input-ui.js +6 -4
  328. package/build-module/components/url-popover/image-url-input-ui.js.map +1 -1
  329. package/build-module/components/url-popover/index.js +1 -1
  330. package/build-module/components/url-popover/index.js.map +1 -1
  331. package/build-module/components/use-block-drop-zone/index.js +7 -4
  332. package/build-module/components/use-block-drop-zone/index.js.map +1 -1
  333. package/build-module/components/use-moving-animation/index.js +9 -28
  334. package/build-module/components/use-moving-animation/index.js.map +1 -1
  335. package/build-module/components/writing-flow/use-select-all.js +1 -6
  336. package/build-module/components/writing-flow/use-select-all.js.map +1 -1
  337. package/build-module/hooks/align.js +12 -2
  338. package/build-module/hooks/align.js.map +1 -1
  339. package/build-module/hooks/color-panel.js +2 -1
  340. package/build-module/hooks/color-panel.js.map +1 -1
  341. package/build-module/hooks/content-lock-ui.js +128 -0
  342. package/build-module/hooks/content-lock-ui.js.map +1 -0
  343. package/build-module/hooks/duotone.js +6 -1
  344. package/build-module/hooks/duotone.js.map +1 -1
  345. package/build-module/hooks/index.js +4 -0
  346. package/build-module/hooks/index.js.map +1 -1
  347. package/build-module/hooks/layout.js +11 -9
  348. package/build-module/hooks/layout.js.map +1 -1
  349. package/build-module/hooks/metadata-name.js +45 -0
  350. package/build-module/hooks/metadata-name.js.map +1 -0
  351. package/build-module/hooks/metadata.js +50 -0
  352. package/build-module/hooks/metadata.js.map +1 -0
  353. package/build-module/hooks/typography.js +10 -11
  354. package/build-module/hooks/typography.js.map +1 -1
  355. package/build-module/hooks/use-typography-props.js +38 -0
  356. package/build-module/hooks/use-typography-props.js.map +1 -0
  357. package/build-module/hooks/utils.js +4 -2
  358. package/build-module/hooks/utils.js.map +1 -1
  359. package/build-module/index.js +1 -1
  360. package/build-module/index.js.map +1 -1
  361. package/build-module/layouts/constrained.js +61 -22
  362. package/build-module/layouts/constrained.js.map +1 -1
  363. package/build-module/store/actions.js +58 -20
  364. package/build-module/store/actions.js.map +1 -1
  365. package/build-module/store/reducer.js +41 -19
  366. package/build-module/store/reducer.js.map +1 -1
  367. package/build-module/store/selectors.js +81 -10
  368. package/build-module/store/selectors.js.map +1 -1
  369. package/build-module/utils/parse-css-unit-to-px.js +1 -1
  370. package/build-module/utils/parse-css-unit-to-px.js.map +1 -1
  371. package/build-style/style-rtl.css +142 -46
  372. package/build-style/style.css +142 -46
  373. package/package.json +28 -28
  374. package/src/components/alignment-control/test/__snapshots__/index.js.snap +137 -108
  375. package/src/components/alignment-control/test/index.js +124 -33
  376. package/src/components/alignment-control/ui.js +8 -3
  377. package/src/components/autocomplete/index.js +2 -5
  378. package/src/components/block-actions/index.js +9 -8
  379. package/src/components/block-alignment-control/test/__snapshots__/index.js.snap +108 -65
  380. package/src/components/block-alignment-control/test/index.js +95 -31
  381. package/src/components/block-alignment-control/ui.js +2 -2
  382. package/src/components/block-compare/test/__snapshots__/block-view.js.snap +28 -26
  383. package/src/components/block-compare/test/block-view.js +3 -3
  384. package/src/components/block-content-overlay/index.js +2 -6
  385. package/src/components/block-content-overlay/style.scss +24 -3
  386. package/src/components/block-draggable/draggable-chip.js +4 -1
  387. package/src/components/block-edit/edit.js +5 -1
  388. package/src/components/block-edit/test/edit.js +23 -21
  389. package/src/components/block-icon/test/__snapshots__/index.js.snap +22 -0
  390. package/src/components/block-icon/test/index.js +31 -16
  391. package/src/components/block-inspector/index.js +126 -12
  392. package/src/components/block-inspector/style.scss +7 -1
  393. package/src/components/block-list/block-list-compact.native.js +1 -1
  394. package/src/components/block-list/block.js +53 -13
  395. package/src/components/block-list/index.js +4 -4
  396. package/src/components/block-list/style.scss +57 -11
  397. package/src/components/block-list/test/block-list-context.native.js +11 -13
  398. package/src/components/block-list/use-block-props/index.js +10 -10
  399. package/src/components/block-list/use-block-props/use-block-class-names.js +4 -1
  400. package/src/components/block-list/use-block-props/use-focus-first-element.js +3 -8
  401. package/src/components/block-list/use-block-props/use-is-hovered.js +2 -2
  402. package/src/components/block-list/use-in-between-inserter.js +11 -13
  403. package/src/components/block-list-appender/index.js +27 -18
  404. package/src/components/block-list-appender/index.native.js +3 -6
  405. package/src/components/block-lock/use-block-lock.js +2 -0
  406. package/src/components/block-mobile-toolbar/block-actions-menu.native.js +15 -9
  407. package/src/components/block-mover/button.js +6 -5
  408. package/src/components/block-mover/index.js +8 -7
  409. package/src/components/block-mover/index.native.js +20 -13
  410. package/src/components/block-popover/inbetween.js +124 -62
  411. package/src/components/block-popover/index.js +47 -8
  412. package/src/components/block-popover/style.scss +3 -4
  413. package/src/components/block-preview/auto.js +4 -2
  414. package/src/components/block-settings-menu/block-settings-dropdown.js +4 -0
  415. package/src/components/block-settings-menu-controls/README.md +9 -0
  416. package/src/components/block-settings-menu-controls/index.js +13 -2
  417. package/src/components/block-styles/preview-panel.js +3 -0
  418. package/src/components/block-switcher/block-transformations-menu.js +127 -33
  419. package/src/components/block-switcher/style.scss +4 -2
  420. package/src/components/block-title/test/index.js +28 -25
  421. package/src/components/block-toolbar/index.js +27 -17
  422. package/src/components/block-tools/block-contextual-toolbar.js +10 -3
  423. package/src/components/block-tools/block-selection-button.js +35 -16
  424. package/src/components/block-tools/index.js +40 -24
  425. package/src/components/block-tools/insertion-point.js +3 -7
  426. package/src/components/block-tools/selected-block-popover.js +9 -7
  427. package/src/components/block-tools/style.scss +5 -0
  428. package/src/components/block-tools/use-block-toolbar-popover-props.js +19 -6
  429. package/src/components/block-tools/zoom-out-mode-inserters.js +57 -0
  430. package/src/components/block-vertical-alignment-control/test/__snapshots__/index.js.snap +91 -51
  431. package/src/components/block-vertical-alignment-control/test/index.js +92 -23
  432. package/src/components/block-vertical-alignment-control/ui.js +3 -2
  433. package/src/components/border-radius-control/linked-button.js +12 -11
  434. package/src/components/color-palette/test/__snapshots__/control.js.snap +3 -12
  435. package/src/components/colors/test/with-colors.js +37 -12
  436. package/src/components/colors-gradients/dropdown.js +1 -1
  437. package/src/components/contrast-checker/test/index.js +135 -116
  438. package/src/components/convert-to-group-buttons/toolbar.js +6 -2
  439. package/src/components/default-block-appender/test/__snapshots__/index.js.snap +39 -57
  440. package/src/components/default-block-appender/test/index.js +32 -18
  441. package/src/components/font-sizes/README.MD +9 -0
  442. package/src/components/iframe/index.js +64 -5
  443. package/src/components/inner-blocks/README.md +2 -1
  444. package/src/components/inner-blocks/default-block-appender.js +1 -6
  445. package/src/components/inner-blocks/index.js +10 -2
  446. package/src/components/inner-blocks/use-inner-block-template-sync.js +40 -25
  447. package/src/components/inner-blocks/use-nested-settings-update.js +32 -3
  448. package/src/components/inserter/index.js +2 -8
  449. package/src/components/inserter/library.js +11 -5
  450. package/src/components/inserter/menu.js +42 -29
  451. package/src/components/inserter/preview-panel.js +1 -1
  452. package/src/components/inserter/stories/fixtures.js +44 -0
  453. package/src/components/inserter/stories/index.js +90 -0
  454. package/src/components/inserter/style.scss +21 -27
  455. package/src/components/inserter/tabs.js +8 -4
  456. package/src/components/link-control/link-preview.js +5 -3
  457. package/src/components/link-control/search-input.js +2 -2
  458. package/src/components/link-control/search-item.js +39 -7
  459. package/src/components/list-view/block.js +29 -10
  460. package/src/components/list-view/branch.js +27 -4
  461. package/src/components/list-view/drop-indicator.js +33 -32
  462. package/src/components/list-view/index.js +8 -3
  463. package/src/components/list-view/use-block-selection.js +0 -1
  464. package/src/components/media-placeholder/test/index.js +2 -2
  465. package/src/components/media-replace-flow/README.md +1 -1
  466. package/src/components/provider/use-block-sync.js +3 -6
  467. package/src/components/publish-date-time-picker/index.js +1 -1
  468. package/src/components/rich-text/format-toolbar-container.js +18 -10
  469. package/src/components/rich-text/index.js +26 -37
  470. package/src/components/rich-text/index.native.js +8 -21
  471. package/src/components/spacing-sizes-control/linked-button.js +2 -3
  472. package/src/components/spacing-sizes-control/style.scss +4 -1
  473. package/src/components/spacing-sizes-control/utils.js +1 -8
  474. package/src/components/text-decoration-control/index.js +31 -23
  475. package/src/components/text-decoration-control/style.scss +18 -0
  476. package/src/components/text-transform-control/index.js +42 -26
  477. package/src/components/text-transform-control/style.scss +18 -0
  478. package/src/components/tool-selector/index.js +9 -11
  479. package/src/components/url-input/test/button.js +145 -71
  480. package/src/components/url-popover/image-url-input-ui.js +5 -3
  481. package/src/components/url-popover/index.js +1 -1
  482. package/src/components/url-popover/test/__snapshots__/index.js.snap +108 -80
  483. package/src/components/url-popover/test/index.js +14 -12
  484. package/src/components/use-block-drop-zone/index.js +15 -4
  485. package/src/components/use-moving-animation/index.js +9 -24
  486. package/src/components/warning/test/__snapshots__/index.js.snap +11 -14
  487. package/src/components/warning/test/index.js +32 -29
  488. package/src/components/writing-flow/use-select-all.js +4 -6
  489. package/src/hooks/align.js +22 -13
  490. package/src/hooks/color-panel.js +2 -1
  491. package/src/hooks/content-lock-ui.js +161 -0
  492. package/src/hooks/duotone.js +13 -1
  493. package/src/hooks/index.js +4 -0
  494. package/src/hooks/layout.js +25 -19
  495. package/src/hooks/layout.scss +7 -1
  496. package/src/hooks/metadata-name.js +48 -0
  497. package/src/hooks/metadata.js +64 -0
  498. package/src/hooks/test/use-typography-props.js +28 -0
  499. package/src/hooks/typography.js +13 -14
  500. package/src/hooks/use-typography-props.js +41 -0
  501. package/src/hooks/utils.js +2 -11
  502. package/src/index.js +1 -0
  503. package/src/layouts/constrained.js +73 -24
  504. package/src/store/actions.js +45 -4
  505. package/src/store/reducer.js +36 -21
  506. package/src/store/selectors.js +99 -20
  507. package/src/store/test/reducer.js +8 -5
  508. package/src/store/test/selectors.js +4 -4
  509. package/src/style.scss +2 -0
  510. package/src/utils/parse-css-unit-to-px.js +1 -1
  511. package/src/components/colors/test/__snapshots__/with-colors.js.snap +0 -23
@@ -189,6 +189,19 @@ export function TypographyPanel( props ) {
189
189
  <LineHeightEdit { ...props } />
190
190
  </ToolsPanelItem>
191
191
  ) }
192
+ { ! isLetterSpacingDisabled && (
193
+ <ToolsPanelItem
194
+ className="single-column"
195
+ hasValue={ () => hasLetterSpacingValue( props ) }
196
+ label={ __( 'Letter spacing' ) }
197
+ onDeselect={ () => resetLetterSpacing( props ) }
198
+ isShownByDefault={ defaultControls?.letterSpacing }
199
+ resetAllFilter={ createResetAllFilter( 'letterSpacing' ) }
200
+ panelId={ clientId }
201
+ >
202
+ <LetterSpacingEdit { ...props } />
203
+ </ToolsPanelItem>
204
+ ) }
192
205
  { ! isTextDecorationDisabled && (
193
206
  <ToolsPanelItem
194
207
  className="single-column"
@@ -204,7 +217,6 @@ export function TypographyPanel( props ) {
204
217
  ) }
205
218
  { ! isTextTransformDisabled && (
206
219
  <ToolsPanelItem
207
- className="single-column"
208
220
  hasValue={ () => hasTextTransformValue( props ) }
209
221
  /* translators: Ensure translation is distinct from "Font size" */
210
222
  label={ __( 'Letter case' ) }
@@ -216,19 +228,6 @@ export function TypographyPanel( props ) {
216
228
  <TextTransformEdit { ...props } />
217
229
  </ToolsPanelItem>
218
230
  ) }
219
- { ! isLetterSpacingDisabled && (
220
- <ToolsPanelItem
221
- className="single-column"
222
- hasValue={ () => hasLetterSpacingValue( props ) }
223
- label={ __( 'Letter spacing' ) }
224
- onDeselect={ () => resetLetterSpacing( props ) }
225
- isShownByDefault={ defaultControls?.letterSpacing }
226
- resetAllFilter={ createResetAllFilter( 'letterSpacing' ) }
227
- panelId={ clientId }
228
- >
229
- <LetterSpacingEdit { ...props } />
230
- </ToolsPanelItem>
231
- ) }
232
231
  </InspectorControls>
233
232
  );
234
233
  }
@@ -0,0 +1,41 @@
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import { kebabCase } from 'lodash';
5
+ import classnames from 'classnames';
6
+
7
+ /**
8
+ * Internal dependencies
9
+ */
10
+ import { getInlineStyles } from './style';
11
+ import { getFontSizeClass } from '../components/font-sizes';
12
+
13
+ // This utility is intended to assist where the serialization of the typography
14
+ // block support is being skipped for a block but the typography related CSS
15
+ // styles still need to be generated so they can be applied to inner elements.
16
+
17
+ /**
18
+ * Provides the CSS class names and inline styles for a block's typography support
19
+ * attributes.
20
+ *
21
+ * @param {Object} attributes Block attributes.
22
+ *
23
+ * @return {Object} Typography block support derived CSS classes & styles.
24
+ */
25
+ export function getTypographyClassesAndStyles( attributes ) {
26
+ const typographyStyles = attributes?.style?.typography || {};
27
+ const style = getInlineStyles( { typography: typographyStyles } );
28
+ const fontFamilyClassName = !! attributes?.fontFamily
29
+ ? `has-${ kebabCase( attributes.fontFamily ) }-font-family`
30
+ : '';
31
+
32
+ const className = classnames(
33
+ fontFamilyClassName,
34
+ getFontSizeClass( attributes?.fontSize )
35
+ );
36
+
37
+ return {
38
+ className,
39
+ style,
40
+ };
41
+ }
@@ -1,16 +1,7 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- import {
5
- pickBy,
6
- isEmpty,
7
- mapValues,
8
- forEach,
9
- get,
10
- setWith,
11
- clone,
12
- every,
13
- } from 'lodash';
4
+ import { pickBy, isEmpty, mapValues, get, setWith, clone, every } from 'lodash';
14
5
 
15
6
  /**
16
7
  * WordPress dependencies
@@ -77,7 +68,7 @@ export function transformStyles(
77
68
  }
78
69
  }
79
70
  let returnBlock = result;
80
- forEach( activeSupports, ( isActive, support ) => {
71
+ Object.entries( activeSupports ).forEach( ( [ support, isActive ] ) => {
81
72
  if ( isActive ) {
82
73
  migrationPaths[ support ].forEach( ( path ) => {
83
74
  const styleValue = get( referenceBlockAttributes, path );
package/src/index.js CHANGED
@@ -6,6 +6,7 @@ export {
6
6
  getBorderClassesAndStyles as __experimentalGetBorderClassesAndStyles,
7
7
  useBorderProps as __experimentalUseBorderProps,
8
8
  getColorClassesAndStyles as __experimentalGetColorClassesAndStyles,
9
+ getTypographyClassesAndStyles,
9
10
  useColorProps as __experimentalUseColorProps,
10
11
  useCustomSides as __experimentalUseCustomSides,
11
12
  getSpacingClassesAndStyles as __experimentalGetSpacingClassesAndStyles,
@@ -2,12 +2,20 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import {
5
- Button,
6
5
  __experimentalUseCustomUnits as useCustomUnits,
7
6
  __experimentalUnitControl as UnitControl,
7
+ __experimentalToggleGroupControl as ToggleGroupControl,
8
+ __experimentalToggleGroupControlOptionIcon as ToggleGroupControlOptionIcon,
8
9
  } from '@wordpress/components';
9
10
  import { __ } from '@wordpress/i18n';
10
- import { Icon, positionCenter, stretchWide } from '@wordpress/icons';
11
+ import {
12
+ Icon,
13
+ positionCenter,
14
+ stretchWide,
15
+ justifyLeft,
16
+ justifyCenter,
17
+ justifyRight,
18
+ } from '@wordpress/icons';
11
19
  import { getCSSRules } from '@wordpress/style-engine';
12
20
 
13
21
  /**
@@ -25,7 +33,30 @@ export default {
25
33
  layout,
26
34
  onChange,
27
35
  } ) {
28
- const { wideSize, contentSize } = layout;
36
+ const { wideSize, contentSize, justifyContent = 'center' } = layout;
37
+ const onJustificationChange = ( value ) => {
38
+ onChange( {
39
+ ...layout,
40
+ justifyContent: value,
41
+ } );
42
+ };
43
+ const justificationOptions = [
44
+ {
45
+ value: 'left',
46
+ icon: justifyLeft,
47
+ label: __( 'Justify items left' ),
48
+ },
49
+ {
50
+ value: 'center',
51
+ icon: justifyCenter,
52
+ label: __( 'Justify items center' ),
53
+ },
54
+ {
55
+ value: 'right',
56
+ icon: justifyRight,
57
+ label: __( 'Justify items right' ),
58
+ },
59
+ ];
29
60
  const units = useCustomUnits( {
30
61
  availableUnits: useSetting( 'spacing.units' ) || [
31
62
  '%',
@@ -35,7 +66,6 @@ export default {
35
66
  'vw',
36
67
  ],
37
68
  } );
38
-
39
69
  return (
40
70
  <>
41
71
  <div className="block-editor-hooks__layout-controls">
@@ -80,28 +110,28 @@ export default {
80
110
  <Icon icon={ stretchWide } />
81
111
  </div>
82
112
  </div>
83
- <div className="block-editor-hooks__layout-controls-reset">
84
- <Button
85
- variant="secondary"
86
- isSmall
87
- disabled={ ! contentSize && ! wideSize }
88
- onClick={ () =>
89
- onChange( {
90
- contentSize: undefined,
91
- wideSize: undefined,
92
- inherit: false,
93
- } )
94
- }
95
- >
96
- { __( 'Reset' ) }
97
- </Button>
98
- </div>
99
-
100
113
  <p className="block-editor-hooks__layout-controls-helptext">
101
114
  { __(
102
115
  'Customize the width for all elements that are assigned to the center or wide columns.'
103
116
  ) }
104
117
  </p>
118
+ <ToggleGroupControl
119
+ __experimentalIsBorderless
120
+ label={ __( 'Justification' ) }
121
+ value={ justifyContent }
122
+ onChange={ onJustificationChange }
123
+ >
124
+ { justificationOptions.map( ( { value, icon, label } ) => {
125
+ return (
126
+ <ToggleGroupControlOptionIcon
127
+ key={ value }
128
+ value={ value }
129
+ icon={ icon }
130
+ label={ label }
131
+ />
132
+ );
133
+ } ) }
134
+ </ToggleGroupControl>
105
135
  </>
106
136
  );
107
137
  },
@@ -116,7 +146,7 @@ export default {
116
146
  hasBlockGapSupport,
117
147
  layoutDefinitions,
118
148
  } ) {
119
- const { contentSize, wideSize } = layout;
149
+ const { contentSize, wideSize, justifyContent } = layout;
120
150
  const blockGapStyleValue = getGapCSSValue( style?.spacing?.blockGap );
121
151
 
122
152
  // If a block's block.json skips serialization for spacing or
@@ -131,6 +161,11 @@ export default {
131
161
  }
132
162
  }
133
163
 
164
+ const marginLeft =
165
+ justifyContent === 'left' ? '0 !important' : 'auto !important';
166
+ const marginRight =
167
+ justifyContent === 'right' ? '0 !important' : 'auto !important';
168
+
134
169
  let output =
135
170
  !! contentSize || !! wideSize
136
171
  ? `
@@ -139,8 +174,8 @@ export default {
139
174
  '> :where(:not(.alignleft):not(.alignright):not(.alignfull))'
140
175
  ) } {
141
176
  max-width: ${ contentSize ?? wideSize };
142
- margin-left: auto !important;
143
- margin-right: auto !important;
177
+ margin-left: ${ marginLeft };
178
+ margin-right: ${ marginRight };
144
179
  }
145
180
  ${ appendSelectors( selector, '> .alignwide' ) } {
146
181
  max-width: ${ wideSize ?? contentSize };
@@ -151,6 +186,20 @@ export default {
151
186
  `
152
187
  : '';
153
188
 
189
+ if ( justifyContent === 'left' ) {
190
+ output += `${ appendSelectors(
191
+ selector,
192
+ '> :where(:not(.alignleft):not(.alignright):not(.alignfull))'
193
+ ) }
194
+ { margin-left: ${ marginLeft }; }`;
195
+ } else if ( justifyContent === 'right' ) {
196
+ output += `${ appendSelectors(
197
+ selector,
198
+ '> :where(:not(.alignleft):not(.alignright):not(.alignfull))'
199
+ ) }
200
+ { margin-right: ${ marginRight }; }`;
201
+ }
202
+
154
203
  // If there is custom padding, add negative margins for alignfull blocks.
155
204
  if ( style?.spacing?.padding ) {
156
205
  // The style object might be storing a preset so we need to make sure we get a usable value.
@@ -1474,25 +1474,52 @@ export const __unstableMarkAutomaticChange =
1474
1474
  /**
1475
1475
  * Action that enables or disables the navigation mode.
1476
1476
  *
1477
- * @param {string} isNavigationMode Enable/Disable navigation mode.
1477
+ * @param {boolean} isNavigationMode Enable/Disable navigation mode.
1478
1478
  */
1479
1479
  export const setNavigationMode =
1480
1480
  ( isNavigationMode = true ) =>
1481
1481
  ( { dispatch } ) => {
1482
- dispatch( { type: 'SET_NAVIGATION_MODE', isNavigationMode } );
1482
+ dispatch.__unstableSetEditorMode(
1483
+ isNavigationMode ? 'navigation' : 'edit'
1484
+ );
1485
+ };
1486
+
1487
+ /**
1488
+ * Action that sets the editor mode
1489
+ *
1490
+ * @param {string} mode Editor mode
1491
+ */
1492
+ export const __unstableSetEditorMode =
1493
+ ( mode ) =>
1494
+ ( { dispatch, select } ) => {
1495
+ // When switching to zoom-out mode, we need to select the root block
1496
+ if ( mode === 'zoom-out' ) {
1497
+ const firstSelectedClientId = select.getBlockSelectionStart();
1498
+ if ( firstSelectedClientId ) {
1499
+ dispatch.selectBlock(
1500
+ select.getBlockHierarchyRootClientId(
1501
+ firstSelectedClientId
1502
+ )
1503
+ );
1504
+ }
1505
+ }
1483
1506
 
1484
- if ( isNavigationMode ) {
1507
+ dispatch( { type: 'SET_EDITOR_MODE', mode } );
1508
+
1509
+ if ( mode === 'navigation' ) {
1485
1510
  speak(
1486
1511
  __(
1487
1512
  'You are currently in navigation mode. Navigate blocks using the Tab key and Arrow keys. Use Left and Right Arrow keys to move between nesting levels. To exit navigation mode and edit the selected block, press Enter.'
1488
1513
  )
1489
1514
  );
1490
- } else {
1515
+ } else if ( mode === 'edit' ) {
1491
1516
  speak(
1492
1517
  __(
1493
1518
  'You are currently in edit mode. To return to the navigation mode, press Escape.'
1494
1519
  )
1495
1520
  );
1521
+ } else if ( mode === 'zoom-out' ) {
1522
+ speak( __( 'You are currently in zoom-out mode.' ) );
1496
1523
  }
1497
1524
  };
1498
1525
 
@@ -1673,3 +1700,17 @@ export function setBlockVisibility( updates ) {
1673
1700
  updates,
1674
1701
  };
1675
1702
  }
1703
+
1704
+ /**
1705
+ * Action that sets whether a block is being temporaritly edited as blocks.
1706
+ *
1707
+ * @param {?string} temporarilyEditingAsBlocks The block's clientId being temporaritly edited as blocks.
1708
+ */
1709
+ export function __unstableSetTemporarilyEditingAsBlocks(
1710
+ temporarilyEditingAsBlocks
1711
+ ) {
1712
+ return {
1713
+ type: 'SET_TEMPORARILY_EDITING_AS_BLOCKS',
1714
+ temporarilyEditingAsBlocks,
1715
+ };
1716
+ }
@@ -4,8 +4,6 @@
4
4
  import {
5
5
  flow,
6
6
  reduce,
7
- first,
8
- last,
9
7
  omit,
10
8
  without,
11
9
  mapValues,
@@ -1004,13 +1002,10 @@ export const blocks = flow(
1004
1002
 
1005
1003
  case 'MOVE_BLOCKS_UP': {
1006
1004
  const { clientIds, rootClientId = '' } = action;
1007
- const firstClientId = first( clientIds );
1005
+ const firstClientId = clientIds[ 0 ];
1008
1006
  const subState = state[ rootClientId ];
1009
1007
 
1010
- if (
1011
- ! subState.length ||
1012
- firstClientId === first( subState )
1013
- ) {
1008
+ if ( ! subState.length || firstClientId === subState[ 0 ] ) {
1014
1009
  return state;
1015
1010
  }
1016
1011
 
@@ -1029,11 +1024,14 @@ export const blocks = flow(
1029
1024
 
1030
1025
  case 'MOVE_BLOCKS_DOWN': {
1031
1026
  const { clientIds, rootClientId = '' } = action;
1032
- const firstClientId = first( clientIds );
1033
- const lastClientId = last( clientIds );
1027
+ const firstClientId = clientIds[ 0 ];
1028
+ const lastClientId = clientIds[ clientIds.length - 1 ];
1034
1029
  const subState = state[ rootClientId ];
1035
1030
 
1036
- if ( ! subState.length || lastClientId === last( subState ) ) {
1031
+ if (
1032
+ ! subState.length ||
1033
+ lastClientId === subState[ subState.length - 1 ]
1034
+ ) {
1037
1035
  return state;
1038
1036
  }
1039
1037
 
@@ -1610,21 +1608,21 @@ export const blockListSettings = ( state = {}, action ) => {
1610
1608
  };
1611
1609
 
1612
1610
  /**
1613
- * Reducer returning whether the navigation mode is enabled or not.
1611
+ * Reducer returning which mode is enabled.
1614
1612
  *
1615
1613
  * @param {string} state Current state.
1616
1614
  * @param {Object} action Dispatched action.
1617
1615
  *
1618
1616
  * @return {string} Updated state.
1619
1617
  */
1620
- export function isNavigationMode( state = false, action ) {
1621
- // Let inserting block always trigger Edit mode.
1622
- if ( action.type === 'INSERT_BLOCKS' ) {
1623
- return false;
1618
+ export function editorMode( state = 'edit', action ) {
1619
+ // Let inserting block in navigation mode always trigger Edit mode.
1620
+ if ( action.type === 'INSERT_BLOCKS' && state === 'navigation' ) {
1621
+ return 'edit';
1624
1622
  }
1625
1623
 
1626
- if ( action.type === 'SET_NAVIGATION_MODE' ) {
1627
- return action.isNavigationMode;
1624
+ if ( action.type === 'SET_EDITOR_MODE' ) {
1625
+ return action.mode;
1628
1626
  }
1629
1627
 
1630
1628
  return state;
@@ -1639,13 +1637,11 @@ export function isNavigationMode( state = false, action ) {
1639
1637
  * @return {string|null} Updated state.
1640
1638
  */
1641
1639
  export function hasBlockMovingClientId( state = null, action ) {
1642
- // Let inserting block always trigger Edit mode.
1643
-
1644
1640
  if ( action.type === 'SET_BLOCK_MOVING_MODE' ) {
1645
1641
  return action.hasBlockMovingClientId;
1646
1642
  }
1647
1643
 
1648
- if ( action.type === 'SET_NAVIGATION_MODE' ) {
1644
+ if ( action.type === 'SET_EDITOR_MODE' ) {
1649
1645
  return null;
1650
1646
  }
1651
1647
 
@@ -1718,9 +1714,12 @@ export function automaticChangeStatus( state, action ) {
1718
1714
  case 'SET_BLOCK_VISIBILITY':
1719
1715
  case 'START_TYPING':
1720
1716
  case 'STOP_TYPING':
1717
+ case 'UPDATE_BLOCK_LIST_SETTINGS':
1721
1718
  return state;
1722
1719
  }
1723
1720
 
1721
+ // TODO: This is a source of bug, as each time there's a change in timing,
1722
+ // or a new action is added, this could break.
1724
1723
  // Reset the state by default (for any action not handled).
1725
1724
  }
1726
1725
 
@@ -1778,6 +1777,21 @@ export function lastBlockInserted( state = {}, action ) {
1778
1777
  return state;
1779
1778
  }
1780
1779
 
1780
+ /**
1781
+ * Reducer returning the block that is eding temporarily edited as blocks.
1782
+ *
1783
+ * @param {Object} state Current state.
1784
+ * @param {Object} action Dispatched action.
1785
+ *
1786
+ * @return {Object} Updated state.
1787
+ */
1788
+ export function temporarilyEditingAsBlocks( state = '', action ) {
1789
+ if ( action.type === 'SET_TEMPORARILY_EDITING_AS_BLOCKS' ) {
1790
+ return action.temporarilyEditingAsBlocks;
1791
+ }
1792
+ return state;
1793
+ }
1794
+
1781
1795
  export default combineReducers( {
1782
1796
  blocks,
1783
1797
  isTyping,
@@ -1793,9 +1807,10 @@ export default combineReducers( {
1793
1807
  settings,
1794
1808
  preferences,
1795
1809
  lastBlockAttributesChange,
1796
- isNavigationMode,
1810
+ editorMode,
1797
1811
  hasBlockMovingClientId,
1798
1812
  automaticChangeStatus,
1799
1813
  highlightedBlock,
1800
1814
  lastBlockInserted,
1815
+ temporarilyEditingAsBlocks,
1801
1816
  } );
@@ -1,17 +1,7 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- import {
5
- castArray,
6
- first,
7
- last,
8
- map,
9
- reduce,
10
- some,
11
- find,
12
- filter,
13
- orderBy,
14
- } from 'lodash';
4
+ import { castArray, map, reduce, some, find, filter, orderBy } from 'lodash';
15
5
  import createSelector from 'rememo';
16
6
 
17
7
  /**
@@ -798,7 +788,7 @@ export const getMultiSelectedBlocks = createSelector(
798
788
  * @return {?string} First block client ID in the multi-selection set.
799
789
  */
800
790
  export function getFirstMultiSelectedBlockClientId( state ) {
801
- return first( getMultiSelectedBlockClientIds( state ) ) || null;
791
+ return getMultiSelectedBlockClientIds( state )[ 0 ] || null;
802
792
  }
803
793
 
804
794
  /**
@@ -810,7 +800,8 @@ export function getFirstMultiSelectedBlockClientId( state ) {
810
800
  * @return {?string} Last block client ID in the multi-selection set.
811
801
  */
812
802
  export function getLastMultiSelectedBlockClientId( state ) {
813
- return last( getMultiSelectedBlockClientIds( state ) ) || null;
803
+ const selectedClientIds = getMultiSelectedBlockClientIds( state );
804
+ return selectedClientIds[ selectedClientIds.length - 1 ] || null;
814
805
  }
815
806
 
816
807
  /**
@@ -948,6 +939,14 @@ export function __unstableIsSelectionCollapsed( state ) {
948
939
  );
949
940
  }
950
941
 
942
+ export function __unstableSelectionHasUnmergeableBlock( state ) {
943
+ return getSelectedBlockClientIds( state ).some( ( clientId ) => {
944
+ const blockName = getBlockName( state, clientId );
945
+ const blockType = getBlockType( blockName );
946
+ return ! blockType.merge;
947
+ } );
948
+ }
949
+
951
950
  /**
952
951
  * Check whether the selection is mergeable.
953
952
  *
@@ -1009,19 +1008,19 @@ export function __unstableIsSelectionMergeable( state, isForward ) {
1009
1008
  ? selectionStart.clientId
1010
1009
  : selectionEnd.clientId;
1011
1010
 
1012
- const targetBlock = getBlock( state, targetBlockClientId );
1013
- const targetBlockType = getBlockType( targetBlock.name );
1011
+ const targetBlockName = getBlockName( state, targetBlockClientId );
1012
+ const targetBlockType = getBlockType( targetBlockName );
1014
1013
 
1015
1014
  if ( ! targetBlockType.merge ) return false;
1016
1015
 
1017
1016
  const blockToMerge = getBlock( state, blockToMergeClientId );
1018
1017
 
1019
1018
  // It's mergeable if the blocks are of the same type.
1020
- if ( blockToMerge.name === targetBlock.name ) return true;
1019
+ if ( blockToMerge.name === targetBlockName ) return true;
1021
1020
 
1022
1021
  // If the blocks are of a different type, try to transform the block being
1023
1022
  // merged into the same type of block.
1024
- const blocksToMerge = switchToBlockType( blockToMerge, targetBlock.name );
1023
+ const blocksToMerge = switchToBlockType( blockToMerge, targetBlockName );
1025
1024
 
1026
1025
  return blocksToMerge && blocksToMerge.length;
1027
1026
  }
@@ -1436,7 +1435,7 @@ export function getTemplateLock( state, rootClientId ) {
1436
1435
 
1437
1436
  const blockListSettings = getBlockListSettings( state, rootClientId );
1438
1437
  if ( ! blockListSettings ) {
1439
- return null;
1438
+ return undefined;
1440
1439
  }
1441
1440
 
1442
1441
  return blockListSettings.templateLock;
@@ -2542,7 +2541,18 @@ function getReusableBlocks( state ) {
2542
2541
  * @return {boolean} Is navigation mode enabled.
2543
2542
  */
2544
2543
  export function isNavigationMode( state ) {
2545
- return state.isNavigationMode;
2544
+ return state.editorMode === 'navigation';
2545
+ }
2546
+
2547
+ /**
2548
+ * Returns the current editor mode.
2549
+ *
2550
+ * @param {Object} state Editor state.
2551
+ *
2552
+ * @return {string} the editor mode.
2553
+ */
2554
+ export function __unstableGetEditorMode( state ) {
2555
+ return state.editorMode;
2546
2556
  }
2547
2557
 
2548
2558
  /**
@@ -2625,7 +2635,7 @@ export const __experimentalGetActiveBlockIdByBlockNames = createSelector(
2625
2635
  );
2626
2636
  if ( entityAreaParents ) {
2627
2637
  // Last parent closest/most interior.
2628
- return last( entityAreaParents );
2638
+ return entityAreaParents[ entityAreaParents.length - 1 ];
2629
2639
  }
2630
2640
  return null;
2631
2641
  },
@@ -2679,3 +2689,72 @@ export const __unstableGetVisibleBlocks = createSelector(
2679
2689
  },
2680
2690
  ( state ) => [ state.blocks.visibility ]
2681
2691
  );
2692
+
2693
+ export const __unstableGetContentLockingParent = createSelector(
2694
+ ( state, clientId ) => {
2695
+ let current = clientId;
2696
+ let result;
2697
+ while ( !! state.blocks.parents[ current ] ) {
2698
+ current = state.blocks.parents[ current ];
2699
+ if ( getTemplateLock( state, current ) === 'contentOnly' ) {
2700
+ result = current;
2701
+ }
2702
+ }
2703
+ return result;
2704
+ },
2705
+ ( state ) => [ state.blocks.parents, state.blockListSettings ]
2706
+ );
2707
+
2708
+ export function __unstableGetTemporarilyEditingAsBlocks( state ) {
2709
+ return state.temporarilyEditingAsBlocks;
2710
+ }
2711
+
2712
+ export function __unstableHasActiveBlockOverlayActive( state, clientId ) {
2713
+ // If the block editing is locked, the block overlay is always active.
2714
+ if ( ! canEditBlock( state, clientId ) ) {
2715
+ return true;
2716
+ }
2717
+
2718
+ const editorMode = __unstableGetEditorMode( state );
2719
+
2720
+ // In zoom-out mode, the block overlay is always active for top level blocks.
2721
+ if (
2722
+ editorMode === 'zoom-out' &&
2723
+ ! getBlockRootClientId( state, clientId )
2724
+ ) {
2725
+ return true;
2726
+ }
2727
+
2728
+ // In navigation mode, the block overlay is active when the block is not
2729
+ // selected (and doesn't contain a selected child). The same behavior is
2730
+ // also enabled in all modes for blocks that have controlled children
2731
+ // (reusable block, template part, navigation), unless explicitly disabled
2732
+ // with `supports.__experimentalDisableBlockOverlay`.
2733
+ const blockSupportDisable = hasBlockSupport(
2734
+ getBlockName( state, clientId ),
2735
+ '__experimentalDisableBlockOverlay',
2736
+ false
2737
+ );
2738
+ const shouldEnableIfUnselected =
2739
+ editorMode === 'navigation' ||
2740
+ ( blockSupportDisable
2741
+ ? false
2742
+ : areInnerBlocksControlled( state, clientId ) );
2743
+
2744
+ return (
2745
+ shouldEnableIfUnselected &&
2746
+ ! isBlockSelected( state, clientId ) &&
2747
+ ! hasSelectedInnerBlock( state, clientId, true )
2748
+ );
2749
+ }
2750
+
2751
+ export function __unstableIsWithinBlockOverlay( state, clientId ) {
2752
+ let parent = state.blocks.parents[ clientId ];
2753
+ while ( !! parent ) {
2754
+ if ( __unstableHasActiveBlockOverlayActive( state, parent ) ) {
2755
+ return true;
2756
+ }
2757
+ parent = state.blocks.parents[ parent ];
2758
+ }
2759
+ return false;
2760
+ }