@wordpress/block-editor 7.0.1 → 8.0.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 (1017) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/README.md +47 -4
  3. package/build/components/autocomplete/index.js +1 -1
  4. package/build/components/autocomplete/index.js.map +1 -1
  5. package/build/components/block-actions/index.js +8 -4
  6. package/build/components/block-actions/index.js.map +1 -1
  7. package/build/components/block-alignment-control/ui.js +61 -14
  8. package/build/components/block-alignment-control/ui.js.map +1 -1
  9. package/build/components/block-alignment-control/use-available-alignments.js +25 -3
  10. package/build/components/block-alignment-control/use-available-alignments.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-controls/fill.js +6 -6
  14. package/build/components/block-controls/fill.js.map +1 -1
  15. package/build/components/block-controls/groups.js +3 -1
  16. package/build/components/block-controls/groups.js.map +1 -1
  17. package/build/components/block-controls/hook.js +57 -0
  18. package/build/components/block-controls/hook.js.map +1 -0
  19. package/build/components/block-edit/context.js +6 -5
  20. package/build/components/block-edit/context.js.map +1 -1
  21. package/build/components/block-edit/edit.js +1 -1
  22. package/build/components/block-edit/edit.js.map +1 -1
  23. package/build/components/block-icon/index.js +5 -1
  24. package/build/components/block-icon/index.js.map +1 -1
  25. package/build/components/block-icon/index.native.js +13 -9
  26. package/build/components/block-icon/index.native.js.map +1 -1
  27. package/build/components/block-inspector/index.js +14 -7
  28. package/build/components/block-inspector/index.js.map +1 -1
  29. package/build/components/block-list/block-html.js +5 -0
  30. package/build/components/block-list/block-html.js.map +1 -1
  31. package/build/components/block-list/block-list-item.native.js +31 -12
  32. package/build/components/block-list/block-list-item.native.js.map +1 -1
  33. package/build/components/block-list/block-selection-button.native.js +4 -4
  34. package/build/components/block-list/block-selection-button.native.js.map +1 -1
  35. package/build/components/block-list/block.js +15 -9
  36. package/build/components/block-list/block.js.map +1 -1
  37. package/build/components/block-list/block.native.js +6 -7
  38. package/build/components/block-list/block.native.js.map +1 -1
  39. package/build/components/block-list/grid-item.native.js +68 -0
  40. package/build/components/block-list/grid-item.native.js.map +1 -0
  41. package/build/components/block-list/index.js +19 -15
  42. package/build/components/block-list/index.js.map +1 -1
  43. package/build/components/block-list/index.native.js +13 -9
  44. package/build/components/block-list/index.native.js.map +1 -1
  45. package/build/components/block-list/use-block-props/index.js +6 -6
  46. package/build/components/block-list/use-block-props/index.js.map +1 -1
  47. package/build/components/block-list/use-block-props/use-block-custom-class-name.js +4 -6
  48. package/build/components/block-list/use-block-props/use-block-custom-class-name.js.map +1 -1
  49. package/build/components/block-list/use-block-props/use-block-default-class-name.js +1 -1
  50. package/build/components/block-list/use-block-props/use-block-default-class-name.js.map +1 -1
  51. package/build/components/block-list/use-block-props/use-multi-selection.js +21 -6
  52. package/build/components/block-list/use-block-props/use-multi-selection.js.map +1 -1
  53. package/build/components/block-list/use-in-between-inserter.js +9 -1
  54. package/build/components/block-list/use-in-between-inserter.js.map +1 -1
  55. package/build/components/block-list-appender/index.js +9 -1
  56. package/build/components/block-list-appender/index.js.map +1 -1
  57. package/build/components/block-mover/index.js +4 -4
  58. package/build/components/block-mover/index.js.map +1 -1
  59. package/build/components/block-mover/index.native.js +4 -4
  60. package/build/components/block-mover/index.native.js.map +1 -1
  61. package/build/components/block-navigation/dropdown.js +0 -1
  62. package/build/components/block-navigation/dropdown.js.map +1 -1
  63. package/build/components/block-patterns-list/index.js +1 -8
  64. package/build/components/block-patterns-list/index.js.map +1 -1
  65. package/build/components/block-preview/auto.js +42 -14
  66. package/build/components/block-preview/auto.js.map +1 -1
  67. package/build/components/block-settings/container.native.js +5 -2
  68. package/build/components/block-settings/container.native.js.map +1 -1
  69. package/build/components/block-settings-menu/block-settings-dropdown.js +26 -5
  70. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  71. package/build/components/block-settings-menu-controls/index.js +10 -3
  72. package/build/components/block-settings-menu-controls/index.js.map +1 -1
  73. package/build/components/block-styles/index.js +5 -1
  74. package/build/components/block-styles/index.js.map +1 -1
  75. package/build/components/block-styles/preview.native.js +2 -2
  76. package/build/components/block-styles/preview.native.js.map +1 -1
  77. package/build/components/block-switcher/block-styles-menu.js +1 -1
  78. package/build/components/block-switcher/block-styles-menu.js.map +1 -1
  79. package/build/components/block-switcher/index.js +10 -3
  80. package/build/components/block-switcher/index.js.map +1 -1
  81. package/build/components/block-title/index.js +3 -2
  82. package/build/components/block-title/index.js.map +1 -1
  83. package/build/components/block-toolbar/index.js +3 -0
  84. package/build/components/block-toolbar/index.js.map +1 -1
  85. package/build/components/block-tools/block-contextual-toolbar.js +1 -1
  86. package/build/components/block-tools/block-contextual-toolbar.js.map +1 -1
  87. package/build/components/block-tools/block-popover.js +8 -7
  88. package/build/components/block-tools/block-popover.js.map +1 -1
  89. package/build/components/block-tools/block-selection-button.js +2 -4
  90. package/build/components/block-tools/block-selection-button.js.map +1 -1
  91. package/build/components/block-tools/index.js +4 -1
  92. package/build/components/block-tools/index.js.map +1 -1
  93. package/build/components/block-tools/insertion-point.js +96 -7
  94. package/build/components/block-tools/insertion-point.js.map +1 -1
  95. package/build/components/block-types-list/index.native.js +3 -2
  96. package/build/components/block-types-list/index.native.js.map +1 -1
  97. package/build/components/border-radius-control/index.js.map +1 -1
  98. package/build/components/border-radius-control/utils.js +17 -8
  99. package/build/components/border-radius-control/utils.js.map +1 -1
  100. package/build/components/colors/utils.js +11 -3
  101. package/build/components/colors/utils.js.map +1 -1
  102. package/build/components/colors-gradients/control.js +22 -57
  103. package/build/components/colors-gradients/control.js.map +1 -1
  104. package/build/components/colors-gradients/panel-color-gradient-settings.js +83 -7
  105. package/build/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
  106. package/build/components/contrast-checker/index.js +18 -12
  107. package/build/components/contrast-checker/index.js.map +1 -1
  108. package/build/components/copy-handler/index.js +9 -3
  109. package/build/components/copy-handler/index.js.map +1 -1
  110. package/build/components/default-block-appender/index.js +2 -2
  111. package/build/components/default-block-appender/index.js.map +1 -1
  112. package/build/components/duotone-control/index.js +41 -39
  113. package/build/components/duotone-control/index.js.map +1 -1
  114. package/build/components/editor-styles/index.js +9 -3
  115. package/build/components/editor-styles/index.js.map +1 -1
  116. package/build/components/font-appearance-control/index.js +44 -12
  117. package/build/components/font-appearance-control/index.js.map +1 -1
  118. package/build/components/font-sizes/index.native.js +24 -0
  119. package/build/components/font-sizes/index.native.js.map +1 -1
  120. package/build/components/iframe/index.js +46 -63
  121. package/build/components/iframe/index.js.map +1 -1
  122. package/build/components/image-editor/aspect-ratio-dropdown.js +126 -0
  123. package/build/components/image-editor/aspect-ratio-dropdown.js.map +1 -0
  124. package/build/components/image-editor/constants.js +16 -0
  125. package/build/components/image-editor/constants.js.map +1 -0
  126. package/build/components/image-editor/context.js +59 -0
  127. package/build/components/image-editor/context.js.map +1 -0
  128. package/build/components/image-editor/cropper.js +83 -0
  129. package/build/components/image-editor/cropper.js.map +1 -0
  130. package/build/components/image-editor/form-controls.js +36 -0
  131. package/build/components/image-editor/form-controls.js.map +1 -0
  132. package/build/components/image-editor/index.js +60 -0
  133. package/build/components/image-editor/index.js.map +1 -0
  134. package/build/components/image-editor/rotation-button.js +37 -0
  135. package/build/components/image-editor/rotation-button.js.map +1 -0
  136. package/build/components/image-editor/use-save-image.js +84 -0
  137. package/build/components/image-editor/use-save-image.js.map +1 -0
  138. package/build/components/image-editor/use-transform-image.js +135 -0
  139. package/build/components/image-editor/use-transform-image.js.map +1 -0
  140. package/build/components/image-editor/zoom-dropdown.js +55 -0
  141. package/build/components/image-editor/zoom-dropdown.js.map +1 -0
  142. package/build/components/image-size-control/use-dimension-handler.js +14 -3
  143. package/build/components/image-size-control/use-dimension-handler.js.map +1 -1
  144. package/build/components/index.js +42 -37
  145. package/build/components/index.js.map +1 -1
  146. package/build/components/index.native.js +12 -7
  147. package/build/components/index.native.js.map +1 -1
  148. package/build/components/inner-blocks/button-block-appender.js +11 -1
  149. package/build/components/inner-blocks/button-block-appender.js.map +1 -1
  150. package/build/components/inner-blocks/index.js +28 -10
  151. package/build/components/inner-blocks/index.js.map +1 -1
  152. package/build/components/inner-blocks/index.native.js +42 -4
  153. package/build/components/inner-blocks/index.native.js.map +1 -1
  154. package/build/components/inner-blocks/use-nested-settings-update.js +24 -13
  155. package/build/components/inner-blocks/use-nested-settings-update.js.map +1 -1
  156. package/build/components/inserter/block-patterns-explorer/explorer.js +62 -0
  157. package/build/components/inserter/block-patterns-explorer/explorer.js.map +1 -0
  158. package/build/components/inserter/block-patterns-explorer/patterns-list.js +111 -0
  159. package/build/components/inserter/block-patterns-explorer/patterns-list.js.map +1 -0
  160. package/build/components/inserter/block-patterns-explorer/sidebar.js +78 -0
  161. package/build/components/inserter/block-patterns-explorer/sidebar.js.map +1 -0
  162. package/build/components/inserter/block-patterns-tab.js +74 -35
  163. package/build/components/inserter/block-patterns-tab.js.map +1 -1
  164. package/build/components/inserter/block-types-tab.native.js +3 -6
  165. package/build/components/inserter/block-types-tab.native.js.map +1 -1
  166. package/build/components/inserter/hooks/use-block-type-impressions.native.js +4 -7
  167. package/build/components/inserter/hooks/use-block-type-impressions.native.js.map +1 -1
  168. package/build/components/inserter/hooks/use-clipboard-block.native.js +5 -4
  169. package/build/components/inserter/hooks/use-clipboard-block.native.js.map +1 -1
  170. package/build/components/inserter/index.js +12 -4
  171. package/build/components/inserter/index.js.map +1 -1
  172. package/build/components/inserter/index.native.js +1 -7
  173. package/build/components/inserter/index.native.js.map +1 -1
  174. package/build/components/inserter/library.js +2 -0
  175. package/build/components/inserter/library.js.map +1 -1
  176. package/build/components/inserter/menu.js +2 -1
  177. package/build/components/inserter/menu.js.map +1 -1
  178. package/build/components/inserter/menu.native.js +18 -17
  179. package/build/components/inserter/menu.native.js.map +1 -1
  180. package/build/components/inserter/pattern-panel.js +19 -10
  181. package/build/components/inserter/pattern-panel.js.map +1 -1
  182. package/build/components/inserter/preview-panel.js +1 -1
  183. package/build/components/inserter/preview-panel.js.map +1 -1
  184. package/build/components/inserter/quick-inserter.js +2 -1
  185. package/build/components/inserter/quick-inserter.js.map +1 -1
  186. package/build/components/inserter/reusable-blocks-tab.native.js +5 -6
  187. package/build/components/inserter/reusable-blocks-tab.native.js.map +1 -1
  188. package/build/components/inserter/search-results.native.js +9 -2
  189. package/build/components/inserter/search-results.native.js.map +1 -1
  190. package/build/components/inserter/tabs.native.js +1 -4
  191. package/build/components/inserter/tabs.native.js.map +1 -1
  192. package/build/components/inserter/utils.native.js +44 -0
  193. package/build/components/inserter/utils.native.js.map +1 -0
  194. package/build/components/inspector-controls/block-support-slot-container.js +28 -0
  195. package/build/components/inspector-controls/block-support-slot-container.js.map +1 -0
  196. package/build/components/inspector-controls/block-support-tools-panel.js +78 -0
  197. package/build/components/inspector-controls/block-support-tools-panel.js.map +1 -0
  198. package/build/components/inspector-controls/fill.js +64 -0
  199. package/build/components/inspector-controls/fill.js.map +1 -0
  200. package/build/components/inspector-controls/{index.native.js → fill.native.js} +20 -19
  201. package/build/components/inspector-controls/fill.native.js.map +1 -0
  202. package/build/components/inspector-controls/groups.js +25 -0
  203. package/build/components/inspector-controls/groups.js.map +1 -0
  204. package/build/components/inspector-controls/index.js +22 -20
  205. package/build/components/inspector-controls/index.js.map +1 -1
  206. package/build/components/inspector-controls/slot.js +67 -0
  207. package/build/components/inspector-controls/slot.js.map +1 -0
  208. package/build/components/inspector-controls/slot.native.js +38 -0
  209. package/build/components/inspector-controls/slot.native.js.map +1 -0
  210. package/build/components/letter-spacing-control/index.js +9 -6
  211. package/build/components/letter-spacing-control/index.js.map +1 -1
  212. package/build/components/line-height-control/index.native.js +39 -0
  213. package/build/components/line-height-control/index.native.js.map +1 -0
  214. package/build/components/link-control/index.js +93 -34
  215. package/build/components/link-control/index.js.map +1 -1
  216. package/build/components/link-control/link-preview.js +45 -15
  217. package/build/components/link-control/link-preview.js.map +1 -1
  218. package/build/components/link-control/search-input.js +25 -7
  219. package/build/components/link-control/search-input.js.map +1 -1
  220. package/build/components/list-view/block-contents.js +1 -20
  221. package/build/components/list-view/block-contents.js.map +1 -1
  222. package/build/components/list-view/block.js +54 -69
  223. package/build/components/list-view/block.js.map +1 -1
  224. package/build/components/list-view/branch.js +102 -76
  225. package/build/components/list-view/branch.js.map +1 -1
  226. package/build/components/list-view/index.js +53 -23
  227. package/build/components/list-view/index.js.map +1 -1
  228. package/build/components/list-view/leaf.js +2 -2
  229. package/build/components/list-view/leaf.js.map +1 -1
  230. package/build/components/list-view/list-item.js +3 -2
  231. package/build/components/list-view/list-item.js.map +1 -1
  232. package/build/components/list-view/use-list-view-client-ids.js +13 -54
  233. package/build/components/list-view/use-list-view-client-ids.js.map +1 -1
  234. package/build/components/media-placeholder/index.js +35 -21
  235. package/build/components/media-placeholder/index.js.map +1 -1
  236. package/build/components/media-placeholder/index.native.js +2 -1
  237. package/build/components/media-placeholder/index.native.js.map +1 -1
  238. package/build/components/media-replace-flow/index.js +5 -3
  239. package/build/components/media-replace-flow/index.js.map +1 -1
  240. package/build/components/navigable-toolbar/index.js +1 -4
  241. package/build/components/navigable-toolbar/index.js.map +1 -1
  242. package/build/components/observe-typing/index.js +1 -1
  243. package/build/components/observe-typing/index.js.map +1 -1
  244. package/build/components/plain-text/index.native.js +30 -1
  245. package/build/components/plain-text/index.native.js.map +1 -1
  246. package/build/components/rich-text/embed-handler-picker.native.js +66 -0
  247. package/build/components/rich-text/embed-handler-picker.native.js.map +1 -0
  248. package/build/components/rich-text/format-edit.js +28 -2
  249. package/build/components/rich-text/format-edit.js.map +1 -1
  250. package/build/components/rich-text/format-toolbar/index.js +32 -11
  251. package/build/components/rich-text/format-toolbar/index.js.map +1 -1
  252. package/build/components/rich-text/index.js +29 -7
  253. package/build/components/rich-text/index.js.map +1 -1
  254. package/build/components/rich-text/index.native.js +43 -5
  255. package/build/components/rich-text/index.native.js.map +1 -1
  256. package/build/components/rich-text/input-event.js +25 -24
  257. package/build/components/rich-text/input-event.js.map +1 -1
  258. package/build/components/rich-text/shortcut.js +23 -9
  259. package/build/components/rich-text/shortcut.js.map +1 -1
  260. package/build/components/rich-text/use-input-events.js +27 -0
  261. package/build/components/rich-text/use-input-events.js.map +1 -0
  262. package/build/components/rich-text/use-paste-handler.js +45 -10
  263. package/build/components/rich-text/use-paste-handler.js.map +1 -1
  264. package/build/components/rich-text/use-shortcuts.js +27 -0
  265. package/build/components/rich-text/use-shortcuts.js.map +1 -0
  266. package/build/components/rich-text/utils.js +22 -0
  267. package/build/components/rich-text/utils.js.map +1 -1
  268. package/build/components/typewriter/index.js +1 -1
  269. package/build/components/typewriter/index.js.map +1 -1
  270. package/build/components/url-input/index.js +25 -11
  271. package/build/components/url-input/index.js.map +1 -1
  272. package/build/components/use-display-block-controls/index.js +5 -7
  273. package/build/components/use-display-block-controls/index.js.map +1 -1
  274. package/build/components/use-moving-animation/index.js +13 -10
  275. package/build/components/use-moving-animation/index.js.map +1 -1
  276. package/build/components/use-on-block-drop/index.js +2 -1
  277. package/build/components/use-on-block-drop/index.js.map +1 -1
  278. package/build/components/use-resize-canvas/index.js +2 -13
  279. package/build/components/use-resize-canvas/index.js.map +1 -1
  280. package/build/components/use-setting/index.js +49 -14
  281. package/build/components/use-setting/index.js.map +1 -1
  282. package/build/components/writing-flow/use-multi-selection.js +6 -0
  283. package/build/components/writing-flow/use-multi-selection.js.map +1 -1
  284. package/build/components/writing-flow/use-tab-nav.js +18 -3
  285. package/build/components/writing-flow/use-tab-nav.js.map +1 -1
  286. package/build/hooks/align.js +14 -14
  287. package/build/hooks/align.js.map +1 -1
  288. package/build/hooks/anchor.js +4 -2
  289. package/build/hooks/anchor.js.map +1 -1
  290. package/build/hooks/border-color.js +9 -5
  291. package/build/hooks/border-color.js.map +1 -1
  292. package/build/hooks/border.js +5 -5
  293. package/build/hooks/border.js.map +1 -1
  294. package/build/hooks/color-panel.js +5 -2
  295. package/build/hooks/color-panel.js.map +1 -1
  296. package/build/hooks/color.js +6 -4
  297. package/build/hooks/color.js.map +1 -1
  298. package/build/hooks/compat.js +23 -0
  299. package/build/hooks/compat.js.map +1 -0
  300. package/build/hooks/custom-class-name.js +3 -1
  301. package/build/hooks/custom-class-name.js.map +1 -1
  302. package/build/hooks/dimensions.js +63 -28
  303. package/build/hooks/dimensions.js.map +1 -1
  304. package/build/hooks/duotone.js +63 -18
  305. package/build/hooks/duotone.js.map +1 -1
  306. package/build/hooks/font-appearance.js +49 -6
  307. package/build/hooks/font-appearance.js.map +1 -1
  308. package/build/hooks/font-family.js +123 -32
  309. package/build/hooks/font-family.js.map +1 -1
  310. package/build/hooks/font-size.js +51 -9
  311. package/build/hooks/font-size.js.map +1 -1
  312. package/build/hooks/gap.js +163 -0
  313. package/build/hooks/gap.js.map +1 -0
  314. package/build/hooks/index.js +12 -0
  315. package/build/hooks/index.js.map +1 -1
  316. package/build/hooks/index.native.js +10 -0
  317. package/build/hooks/index.native.js.map +1 -1
  318. package/build/hooks/layout.js +47 -30
  319. package/build/hooks/layout.js.map +1 -1
  320. package/build/hooks/letter-spacing.js +45 -8
  321. package/build/hooks/letter-spacing.js.map +1 -1
  322. package/build/hooks/line-height.js +45 -8
  323. package/build/hooks/line-height.js.map +1 -1
  324. package/build/hooks/lock.js +43 -0
  325. package/build/hooks/lock.js.map +1 -0
  326. package/build/hooks/margin.js +6 -3
  327. package/build/hooks/margin.js.map +1 -1
  328. package/build/hooks/padding.js +6 -3
  329. package/build/hooks/padding.js.map +1 -1
  330. package/build/hooks/style.js +39 -11
  331. package/build/hooks/style.js.map +1 -1
  332. package/build/hooks/text-decoration.js +42 -6
  333. package/build/hooks/text-decoration.js.map +1 -1
  334. package/build/hooks/text-transform.js +42 -6
  335. package/build/hooks/text-transform.js.map +1 -1
  336. package/build/hooks/typography.js +109 -9
  337. package/build/hooks/typography.js.map +1 -1
  338. package/build/hooks/typography.native.js +60 -0
  339. package/build/hooks/typography.native.js.map +1 -0
  340. package/build/hooks/use-cached-truthy.js +29 -0
  341. package/build/hooks/use-cached-truthy.js.map +1 -0
  342. package/build/index.js +7 -0
  343. package/build/index.js.map +1 -1
  344. package/build/layouts/flex.js +215 -11
  345. package/build/layouts/flex.js.map +1 -1
  346. package/build/layouts/flow.js +99 -6
  347. package/build/layouts/flow.js.map +1 -1
  348. package/build/store/actions.js +331 -266
  349. package/build/store/actions.js.map +1 -1
  350. package/build/store/defaults.js +2 -0
  351. package/build/store/defaults.js.map +1 -1
  352. package/build/store/defaults.native.js +16 -1
  353. package/build/store/defaults.native.js.map +1 -1
  354. package/build/store/index.js +1 -3
  355. package/build/store/index.js.map +1 -1
  356. package/build/store/reducer.js +165 -114
  357. package/build/store/reducer.js.map +1 -1
  358. package/build/store/selectors.js +203 -115
  359. package/build/store/selectors.js.map +1 -1
  360. package/build/utils/index.js +10 -1
  361. package/build/utils/index.js.map +1 -1
  362. package/build/utils/parse-css-unit-to-px.js +295 -0
  363. package/build/utils/parse-css-unit-to-px.js.map +1 -0
  364. package/build/utils/transform-styles/transforms/wrap.js +16 -0
  365. package/build/utils/transform-styles/transforms/wrap.js.map +1 -1
  366. package/build-module/components/autocomplete/index.js +2 -2
  367. package/build-module/components/autocomplete/index.js.map +1 -1
  368. package/build-module/components/block-actions/index.js +8 -4
  369. package/build-module/components/block-actions/index.js.map +1 -1
  370. package/build-module/components/block-alignment-control/ui.js +64 -17
  371. package/build-module/components/block-alignment-control/ui.js.map +1 -1
  372. package/build-module/components/block-alignment-control/use-available-alignments.js +25 -3
  373. package/build-module/components/block-alignment-control/use-available-alignments.js.map +1 -1
  374. package/build-module/components/block-content-overlay/index.js +2 -4
  375. package/build-module/components/block-content-overlay/index.js.map +1 -1
  376. package/build-module/components/block-controls/fill.js +6 -5
  377. package/build-module/components/block-controls/fill.js.map +1 -1
  378. package/build-module/components/block-controls/groups.js +3 -1
  379. package/build-module/components/block-controls/groups.js.map +1 -1
  380. package/build-module/components/block-controls/hook.js +42 -0
  381. package/build-module/components/block-controls/hook.js.map +1 -0
  382. package/build-module/components/block-edit/context.js +4 -4
  383. package/build-module/components/block-edit/context.js.map +1 -1
  384. package/build-module/components/block-edit/edit.js +1 -1
  385. package/build-module/components/block-edit/edit.js.map +1 -1
  386. package/build-module/components/block-icon/index.js +5 -1
  387. package/build-module/components/block-icon/index.js.map +1 -1
  388. package/build-module/components/block-icon/index.native.js +14 -9
  389. package/build-module/components/block-icon/index.native.js.map +1 -1
  390. package/build-module/components/block-inspector/index.js +12 -6
  391. package/build-module/components/block-inspector/index.js.map +1 -1
  392. package/build-module/components/block-list/block-html.js +5 -0
  393. package/build-module/components/block-list/block-html.js.map +1 -1
  394. package/build-module/components/block-list/block-list-item.native.js +30 -12
  395. package/build-module/components/block-list/block-list-item.native.js.map +1 -1
  396. package/build-module/components/block-list/block-selection-button.native.js +3 -4
  397. package/build-module/components/block-list/block-selection-button.native.js.map +1 -1
  398. package/build-module/components/block-list/block.js +16 -10
  399. package/build-module/components/block-list/block.js.map +1 -1
  400. package/build-module/components/block-list/block.native.js +6 -7
  401. package/build-module/components/block-list/block.native.js.map +1 -1
  402. package/build-module/components/block-list/grid-item.native.js +57 -0
  403. package/build-module/components/block-list/grid-item.native.js.map +1 -0
  404. package/build-module/components/block-list/index.js +17 -14
  405. package/build-module/components/block-list/index.js.map +1 -1
  406. package/build-module/components/block-list/index.native.js +13 -9
  407. package/build-module/components/block-list/index.native.js.map +1 -1
  408. package/build-module/components/block-list/use-block-props/index.js +7 -7
  409. package/build-module/components/block-list/use-block-props/index.js.map +1 -1
  410. package/build-module/components/block-list/use-block-props/use-block-custom-class-name.js +5 -7
  411. package/build-module/components/block-list/use-block-props/use-block-custom-class-name.js.map +1 -1
  412. package/build-module/components/block-list/use-block-props/use-block-default-class-name.js +2 -2
  413. package/build-module/components/block-list/use-block-props/use-block-default-class-name.js.map +1 -1
  414. package/build-module/components/block-list/use-block-props/use-multi-selection.js +21 -6
  415. package/build-module/components/block-list/use-block-props/use-multi-selection.js.map +1 -1
  416. package/build-module/components/block-list/use-in-between-inserter.js +9 -1
  417. package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
  418. package/build-module/components/block-list-appender/index.js +9 -1
  419. package/build-module/components/block-list-appender/index.js.map +1 -1
  420. package/build-module/components/block-mover/index.js +4 -4
  421. package/build-module/components/block-mover/index.js.map +1 -1
  422. package/build-module/components/block-mover/index.native.js +4 -4
  423. package/build-module/components/block-mover/index.native.js.map +1 -1
  424. package/build-module/components/block-navigation/dropdown.js +0 -1
  425. package/build-module/components/block-navigation/dropdown.js.map +1 -1
  426. package/build-module/components/block-patterns-list/index.js +1 -6
  427. package/build-module/components/block-patterns-list/index.js.map +1 -1
  428. package/build-module/components/block-preview/auto.js +40 -16
  429. package/build-module/components/block-preview/auto.js.map +1 -1
  430. package/build-module/components/block-settings/container.native.js +6 -3
  431. package/build-module/components/block-settings/container.native.js.map +1 -1
  432. package/build-module/components/block-settings-menu/block-settings-dropdown.js +28 -7
  433. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  434. package/build-module/components/block-settings-menu-controls/index.js +10 -3
  435. package/build-module/components/block-settings-menu-controls/index.js.map +1 -1
  436. package/build-module/components/block-styles/index.js +5 -1
  437. package/build-module/components/block-styles/index.js.map +1 -1
  438. package/build-module/components/block-styles/preview.native.js +2 -2
  439. package/build-module/components/block-styles/preview.native.js.map +1 -1
  440. package/build-module/components/block-switcher/block-styles-menu.js +1 -1
  441. package/build-module/components/block-switcher/block-styles-menu.js.map +1 -1
  442. package/build-module/components/block-switcher/index.js +10 -3
  443. package/build-module/components/block-switcher/index.js.map +1 -1
  444. package/build-module/components/block-title/index.js +3 -2
  445. package/build-module/components/block-title/index.js.map +1 -1
  446. package/build-module/components/block-toolbar/index.js +3 -0
  447. package/build-module/components/block-toolbar/index.js.map +1 -1
  448. package/build-module/components/block-tools/block-contextual-toolbar.js +1 -1
  449. package/build-module/components/block-tools/block-contextual-toolbar.js.map +1 -1
  450. package/build-module/components/block-tools/block-popover.js +9 -8
  451. package/build-module/components/block-tools/block-popover.js.map +1 -1
  452. package/build-module/components/block-tools/block-selection-button.js +2 -4
  453. package/build-module/components/block-tools/block-selection-button.js.map +1 -1
  454. package/build-module/components/block-tools/index.js +4 -1
  455. package/build-module/components/block-tools/index.js.map +1 -1
  456. package/build-module/components/block-tools/insertion-point.js +96 -8
  457. package/build-module/components/block-tools/insertion-point.js.map +1 -1
  458. package/build-module/components/block-types-list/index.native.js +3 -2
  459. package/build-module/components/block-types-list/index.native.js.map +1 -1
  460. package/build-module/components/border-radius-control/index.js.map +1 -1
  461. package/build-module/components/border-radius-control/utils.js +16 -9
  462. package/build-module/components/border-radius-control/utils.js.map +1 -1
  463. package/build-module/components/colors/utils.js +9 -3
  464. package/build-module/components/colors/utils.js.map +1 -1
  465. package/build-module/components/colors-gradients/control.js +26 -63
  466. package/build-module/components/colors-gradients/control.js.map +1 -1
  467. package/build-module/components/colors-gradients/panel-color-gradient-settings.js +84 -7
  468. package/build-module/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
  469. package/build-module/components/contrast-checker/index.js +13 -10
  470. package/build-module/components/contrast-checker/index.js.map +1 -1
  471. package/build-module/components/copy-handler/index.js +9 -3
  472. package/build-module/components/copy-handler/index.js.map +1 -1
  473. package/build-module/components/default-block-appender/index.js +2 -2
  474. package/build-module/components/default-block-appender/index.js.map +1 -1
  475. package/build-module/components/duotone-control/index.js +43 -39
  476. package/build-module/components/duotone-control/index.js.map +1 -1
  477. package/build-module/components/editor-styles/index.js +7 -3
  478. package/build-module/components/editor-styles/index.js.map +1 -1
  479. package/build-module/components/font-appearance-control/index.js +40 -12
  480. package/build-module/components/font-appearance-control/index.js.map +1 -1
  481. package/build-module/components/font-sizes/index.native.js +3 -1
  482. package/build-module/components/font-sizes/index.native.js.map +1 -1
  483. package/build-module/components/iframe/index.js +47 -65
  484. package/build-module/components/iframe/index.js.map +1 -1
  485. package/build-module/components/image-editor/aspect-ratio-dropdown.js +115 -0
  486. package/build-module/components/image-editor/aspect-ratio-dropdown.js.map +1 -0
  487. package/build-module/components/image-editor/constants.js +7 -0
  488. package/build-module/components/image-editor/constants.js.map +1 -0
  489. package/build-module/components/image-editor/context.js +44 -0
  490. package/build-module/components/image-editor/context.js.map +1 -0
  491. package/build-module/components/image-editor/cropper.js +69 -0
  492. package/build-module/components/image-editor/cropper.js.map +1 -0
  493. package/build-module/components/image-editor/form-controls.js +26 -0
  494. package/build-module/components/image-editor/form-controls.js.map +1 -0
  495. package/build-module/components/image-editor/index.js +37 -0
  496. package/build-module/components/image-editor/index.js.map +1 -0
  497. package/build-module/components/image-editor/rotation-button.js +26 -0
  498. package/build-module/components/image-editor/rotation-button.js.map +1 -0
  499. package/build-module/components/image-editor/use-save-image.js +70 -0
  500. package/build-module/components/image-editor/use-save-image.js.map +1 -0
  501. package/build-module/components/image-editor/use-transform-image.js +127 -0
  502. package/build-module/components/image-editor/use-transform-image.js.map +1 -0
  503. package/build-module/components/image-editor/zoom-dropdown.js +43 -0
  504. package/build-module/components/image-editor/zoom-dropdown.js.map +1 -0
  505. package/build-module/components/image-size-control/use-dimension-handler.js +13 -2
  506. package/build-module/components/image-size-control/use-dimension-handler.js.map +1 -1
  507. package/build-module/components/index.js +5 -6
  508. package/build-module/components/index.js.map +1 -1
  509. package/build-module/components/index.native.js +2 -3
  510. package/build-module/components/index.native.js.map +1 -1
  511. package/build-module/components/inner-blocks/button-block-appender.js +10 -1
  512. package/build-module/components/inner-blocks/button-block-appender.js.map +1 -1
  513. package/build-module/components/inner-blocks/index.js +29 -11
  514. package/build-module/components/inner-blocks/index.js.map +1 -1
  515. package/build-module/components/inner-blocks/index.native.js +41 -5
  516. package/build-module/components/inner-blocks/index.native.js.map +1 -1
  517. package/build-module/components/inner-blocks/use-nested-settings-update.js +24 -13
  518. package/build-module/components/inner-blocks/use-nested-settings-update.js.map +1 -1
  519. package/build-module/components/inserter/block-patterns-explorer/explorer.js +50 -0
  520. package/build-module/components/inserter/block-patterns-explorer/explorer.js.map +1 -0
  521. package/build-module/components/inserter/block-patterns-explorer/patterns-list.js +92 -0
  522. package/build-module/components/inserter/block-patterns-explorer/patterns-list.js.map +1 -0
  523. package/build-module/components/inserter/block-patterns-explorer/sidebar.js +69 -0
  524. package/build-module/components/inserter/block-patterns-explorer/sidebar.js.map +1 -0
  525. package/build-module/components/inserter/block-patterns-tab.js +75 -36
  526. package/build-module/components/inserter/block-patterns-tab.js.map +1 -1
  527. package/build-module/components/inserter/block-types-tab.native.js +2 -5
  528. package/build-module/components/inserter/block-types-tab.native.js.map +1 -1
  529. package/build-module/components/inserter/hooks/use-block-type-impressions.native.js +4 -7
  530. package/build-module/components/inserter/hooks/use-block-type-impressions.native.js.map +1 -1
  531. package/build-module/components/inserter/hooks/use-clipboard-block.native.js +5 -4
  532. package/build-module/components/inserter/hooks/use-clipboard-block.native.js.map +1 -1
  533. package/build-module/components/inserter/index.js +12 -4
  534. package/build-module/components/inserter/index.js.map +1 -1
  535. package/build-module/components/inserter/index.native.js +1 -7
  536. package/build-module/components/inserter/index.native.js.map +1 -1
  537. package/build-module/components/inserter/library.js +2 -0
  538. package/build-module/components/inserter/library.js.map +1 -1
  539. package/build-module/components/inserter/menu.js +2 -1
  540. package/build-module/components/inserter/menu.js.map +1 -1
  541. package/build-module/components/inserter/menu.native.js +17 -17
  542. package/build-module/components/inserter/menu.native.js.map +1 -1
  543. package/build-module/components/inserter/pattern-panel.js +21 -13
  544. package/build-module/components/inserter/pattern-panel.js.map +1 -1
  545. package/build-module/components/inserter/preview-panel.js +1 -1
  546. package/build-module/components/inserter/preview-panel.js.map +1 -1
  547. package/build-module/components/inserter/quick-inserter.js +2 -1
  548. package/build-module/components/inserter/quick-inserter.js.map +1 -1
  549. package/build-module/components/inserter/reusable-blocks-tab.native.js +4 -5
  550. package/build-module/components/inserter/reusable-blocks-tab.native.js.map +1 -1
  551. package/build-module/components/inserter/search-results.native.js +8 -2
  552. package/build-module/components/inserter/search-results.native.js.map +1 -1
  553. package/build-module/components/inserter/tabs.native.js +1 -4
  554. package/build-module/components/inserter/tabs.native.js.map +1 -1
  555. package/build-module/components/inserter/utils.native.js +35 -0
  556. package/build-module/components/inserter/utils.native.js.map +1 -0
  557. package/build-module/components/inspector-controls/block-support-slot-container.js +18 -0
  558. package/build-module/components/inspector-controls/block-support-slot-container.js.map +1 -0
  559. package/build-module/components/inspector-controls/block-support-tools-panel.js +67 -0
  560. package/build-module/components/inspector-controls/block-support-tools-panel.js.map +1 -0
  561. package/build-module/components/inspector-controls/fill.js +50 -0
  562. package/build-module/components/inspector-controls/fill.js.map +1 -0
  563. package/build-module/components/inspector-controls/{index.native.js → fill.native.js} +16 -18
  564. package/build-module/components/inspector-controls/fill.native.js.map +1 -0
  565. package/build-module/components/inspector-controls/groups.js +16 -0
  566. package/build-module/components/inspector-controls/groups.js.map +1 -0
  567. package/build-module/components/inspector-controls/index.js +16 -17
  568. package/build-module/components/inspector-controls/index.js.map +1 -1
  569. package/build-module/components/inspector-controls/slot.js +52 -0
  570. package/build-module/components/inspector-controls/slot.js.map +1 -0
  571. package/build-module/components/inspector-controls/slot.native.js +27 -0
  572. package/build-module/components/inspector-controls/slot.native.js.map +1 -0
  573. package/build-module/components/letter-spacing-control/index.js +9 -6
  574. package/build-module/components/letter-spacing-control/index.js.map +1 -1
  575. package/build-module/components/line-height-control/index.native.js +29 -0
  576. package/build-module/components/line-height-control/index.native.js.map +1 -0
  577. package/build-module/components/link-control/index.js +93 -35
  578. package/build-module/components/link-control/index.js.map +1 -1
  579. package/build-module/components/link-control/link-preview.js +46 -17
  580. package/build-module/components/link-control/link-preview.js.map +1 -1
  581. package/build-module/components/link-control/search-input.js +24 -7
  582. package/build-module/components/link-control/search-input.js.map +1 -1
  583. package/build-module/components/list-view/block-contents.js +1 -18
  584. package/build-module/components/list-view/block-contents.js.map +1 -1
  585. package/build-module/components/list-view/block.js +56 -71
  586. package/build-module/components/list-view/block.js.map +1 -1
  587. package/build-module/components/list-view/branch.js +102 -78
  588. package/build-module/components/list-view/branch.js.map +1 -1
  589. package/build-module/components/list-view/index.js +55 -27
  590. package/build-module/components/list-view/index.js.map +1 -1
  591. package/build-module/components/list-view/leaf.js +2 -2
  592. package/build-module/components/list-view/leaf.js.map +1 -1
  593. package/build-module/components/list-view/list-item.js +3 -2
  594. package/build-module/components/list-view/list-item.js.map +1 -1
  595. package/build-module/components/list-view/use-list-view-client-ids.js +13 -54
  596. package/build-module/components/list-view/use-list-view-client-ids.js.map +1 -1
  597. package/build-module/components/media-placeholder/index.js +35 -21
  598. package/build-module/components/media-placeholder/index.js.map +1 -1
  599. package/build-module/components/media-placeholder/index.native.js +2 -1
  600. package/build-module/components/media-placeholder/index.native.js.map +1 -1
  601. package/build-module/components/media-replace-flow/index.js +5 -3
  602. package/build-module/components/media-replace-flow/index.js.map +1 -1
  603. package/build-module/components/navigable-toolbar/index.js +1 -4
  604. package/build-module/components/navigable-toolbar/index.js.map +1 -1
  605. package/build-module/components/observe-typing/index.js +1 -1
  606. package/build-module/components/observe-typing/index.js.map +1 -1
  607. package/build-module/components/plain-text/index.native.js +29 -2
  608. package/build-module/components/plain-text/index.native.js.map +1 -1
  609. package/build-module/components/rich-text/embed-handler-picker.native.js +54 -0
  610. package/build-module/components/rich-text/embed-handler-picker.native.js.map +1 -0
  611. package/build-module/components/rich-text/format-edit.js +28 -3
  612. package/build-module/components/rich-text/format-edit.js.map +1 -1
  613. package/build-module/components/rich-text/format-toolbar/index.js +29 -11
  614. package/build-module/components/rich-text/format-toolbar/index.js.map +1 -1
  615. package/build-module/components/rich-text/index.js +22 -6
  616. package/build-module/components/rich-text/index.js.map +1 -1
  617. package/build-module/components/rich-text/index.native.js +43 -6
  618. package/build-module/components/rich-text/index.native.js.map +1 -1
  619. package/build-module/components/rich-text/input-event.js +24 -22
  620. package/build-module/components/rich-text/input-event.js.map +1 -1
  621. package/build-module/components/rich-text/shortcut.js +22 -9
  622. package/build-module/components/rich-text/shortcut.js.map +1 -1
  623. package/build-module/components/rich-text/use-input-events.js +19 -0
  624. package/build-module/components/rich-text/use-input-events.js.map +1 -0
  625. package/build-module/components/rich-text/use-paste-handler.js +44 -10
  626. package/build-module/components/rich-text/use-paste-handler.js.map +1 -1
  627. package/build-module/components/rich-text/use-shortcuts.js +19 -0
  628. package/build-module/components/rich-text/use-shortcuts.js.map +1 -0
  629. package/build-module/components/rich-text/utils.js +20 -0
  630. package/build-module/components/rich-text/utils.js.map +1 -1
  631. package/build-module/components/typewriter/index.js +1 -1
  632. package/build-module/components/typewriter/index.js.map +1 -1
  633. package/build-module/components/url-input/index.js +25 -11
  634. package/build-module/components/url-input/index.js.map +1 -1
  635. package/build-module/components/use-display-block-controls/index.js +5 -7
  636. package/build-module/components/use-display-block-controls/index.js.map +1 -1
  637. package/build-module/components/use-moving-animation/index.js +13 -10
  638. package/build-module/components/use-moving-animation/index.js.map +1 -1
  639. package/build-module/components/use-on-block-drop/index.js +3 -2
  640. package/build-module/components/use-on-block-drop/index.js.map +1 -1
  641. package/build-module/components/use-resize-canvas/index.js +2 -10
  642. package/build-module/components/use-resize-canvas/index.js.map +1 -1
  643. package/build-module/components/use-setting/index.js +48 -14
  644. package/build-module/components/use-setting/index.js.map +1 -1
  645. package/build-module/components/writing-flow/use-multi-selection.js +6 -0
  646. package/build-module/components/writing-flow/use-multi-selection.js.map +1 -1
  647. package/build-module/components/writing-flow/use-tab-nav.js +18 -3
  648. package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
  649. package/build-module/hooks/align.js +15 -15
  650. package/build-module/hooks/align.js.map +1 -1
  651. package/build-module/hooks/anchor.js +5 -3
  652. package/build-module/hooks/anchor.js.map +1 -1
  653. package/build-module/hooks/border-color.js +10 -5
  654. package/build-module/hooks/border-color.js.map +1 -1
  655. package/build-module/hooks/border.js +5 -5
  656. package/build-module/hooks/border.js.map +1 -1
  657. package/build-module/hooks/color-panel.js +6 -3
  658. package/build-module/hooks/color-panel.js.map +1 -1
  659. package/build-module/hooks/color.js +6 -4
  660. package/build-module/hooks/color.js.map +1 -1
  661. package/build-module/hooks/compat.js +20 -0
  662. package/build-module/hooks/compat.js.map +1 -0
  663. package/build-module/hooks/custom-class-name.js +4 -2
  664. package/build-module/hooks/custom-class-name.js.map +1 -1
  665. package/build-module/hooks/dimensions.js +57 -26
  666. package/build-module/hooks/dimensions.js.map +1 -1
  667. package/build-module/hooks/duotone.js +62 -18
  668. package/build-module/hooks/duotone.js.map +1 -1
  669. package/build-module/hooks/font-appearance.js +45 -6
  670. package/build-module/hooks/font-appearance.js.map +1 -1
  671. package/build-module/hooks/font-family.js +117 -33
  672. package/build-module/hooks/font-family.js.map +1 -1
  673. package/build-module/hooks/font-size.js +47 -9
  674. package/build-module/hooks/font-size.js.map +1 -1
  675. package/build-module/hooks/gap.js +140 -0
  676. package/build-module/hooks/gap.js.map +1 -0
  677. package/build-module/hooks/index.js +3 -0
  678. package/build-module/hooks/index.js.map +1 -1
  679. package/build-module/hooks/index.native.js +2 -0
  680. package/build-module/hooks/index.native.js.map +1 -1
  681. package/build-module/hooks/layout.js +47 -30
  682. package/build-module/hooks/layout.js.map +1 -1
  683. package/build-module/hooks/letter-spacing.js +41 -8
  684. package/build-module/hooks/letter-spacing.js.map +1 -1
  685. package/build-module/hooks/line-height.js +41 -8
  686. package/build-module/hooks/line-height.js.map +1 -1
  687. package/build-module/hooks/lock.js +33 -0
  688. package/build-module/hooks/lock.js.map +1 -0
  689. package/build-module/hooks/margin.js +7 -4
  690. package/build-module/hooks/margin.js.map +1 -1
  691. package/build-module/hooks/padding.js +7 -4
  692. package/build-module/hooks/padding.js.map +1 -1
  693. package/build-module/hooks/style.js +39 -11
  694. package/build-module/hooks/style.js.map +1 -1
  695. package/build-module/hooks/text-decoration.js +38 -6
  696. package/build-module/hooks/text-decoration.js.map +1 -1
  697. package/build-module/hooks/text-transform.js +38 -6
  698. package/build-module/hooks/text-transform.js.map +1 -1
  699. package/build-module/hooks/typography.js +118 -19
  700. package/build-module/hooks/typography.js.map +1 -1
  701. package/build-module/hooks/typography.native.js +41 -0
  702. package/build-module/hooks/typography.native.js.map +1 -0
  703. package/build-module/hooks/use-cached-truthy.js +21 -0
  704. package/build-module/hooks/use-cached-truthy.js.map +1 -0
  705. package/build-module/index.js +1 -1
  706. package/build-module/index.js.map +1 -1
  707. package/build-module/layouts/flex.js +210 -12
  708. package/build-module/layouts/flex.js.map +1 -1
  709. package/build-module/layouts/flow.js +99 -7
  710. package/build-module/layouts/flow.js.map +1 -1
  711. package/build-module/store/actions.js +294 -242
  712. package/build-module/store/actions.js.map +1 -1
  713. package/build-module/store/defaults.js +2 -0
  714. package/build-module/store/defaults.js.map +1 -1
  715. package/build-module/store/defaults.native.js +15 -1
  716. package/build-module/store/defaults.native.js.map +1 -1
  717. package/build-module/store/index.js +1 -2
  718. package/build-module/store/index.js.map +1 -1
  719. package/build-module/store/reducer.js +167 -115
  720. package/build-module/store/reducer.js.map +1 -1
  721. package/build-module/store/selectors.js +189 -104
  722. package/build-module/store/selectors.js.map +1 -1
  723. package/build-module/utils/index.js +1 -0
  724. package/build-module/utils/index.js.map +1 -1
  725. package/build-module/utils/parse-css-unit-to-px.js +285 -0
  726. package/build-module/utils/parse-css-unit-to-px.js.map +1 -0
  727. package/build-module/utils/transform-styles/transforms/wrap.js +16 -0
  728. package/build-module/utils/transform-styles/transforms/wrap.js.map +1 -1
  729. package/build-style/default-editor-styles-rtl.css +114 -0
  730. package/build-style/default-editor-styles.css +114 -0
  731. package/build-style/style-rtl.css +292 -181
  732. package/build-style/style.css +292 -181
  733. package/build-types/components/block-context/index.d.ts +1 -1
  734. package/build-types/components/block-context/index.d.ts.map +1 -1
  735. package/package.json +28 -27
  736. package/src/components/autocomplete/index.js +5 -2
  737. package/src/components/block-actions/index.js +9 -5
  738. package/src/components/block-alignment-control/style.scss +5 -0
  739. package/src/components/block-alignment-control/test/__snapshots__/index.js.snap +15 -1
  740. package/src/components/block-alignment-control/test/index.native.js +37 -0
  741. package/src/components/block-alignment-control/ui.js +98 -27
  742. package/src/components/block-alignment-control/use-available-alignments.js +31 -10
  743. package/src/components/block-content-overlay/index.js +3 -6
  744. package/src/components/block-content-overlay/style.scss +9 -21
  745. package/src/components/block-controls/fill.js +7 -4
  746. package/src/components/block-controls/groups.js +2 -0
  747. package/src/components/block-controls/hook.js +44 -0
  748. package/src/components/block-draggable/style.scss +19 -4
  749. package/src/components/block-edit/context.js +4 -3
  750. package/src/components/block-edit/edit.js +1 -4
  751. package/src/components/block-icon/index.js +4 -1
  752. package/src/components/block-icon/index.native.js +11 -12
  753. package/src/components/block-inspector/index.js +19 -9
  754. package/src/components/block-list/block-html.js +5 -0
  755. package/src/components/block-list/block-list-item.native.js +34 -11
  756. package/src/components/block-list/block-list-item.native.scss +4 -0
  757. package/src/components/block-list/block-selection-button.native.js +8 -5
  758. package/src/components/block-list/block.js +13 -9
  759. package/src/components/block-list/block.native.js +7 -5
  760. package/src/components/block-list/grid-item.native.js +58 -0
  761. package/src/components/block-list/index.js +33 -27
  762. package/src/components/block-list/index.native.js +10 -4
  763. package/src/components/block-list/style.native.scss +0 -1
  764. package/src/components/block-list/style.scss +15 -0
  765. package/src/components/block-list/use-block-props/index.js +4 -7
  766. package/src/components/block-list/use-block-props/use-block-custom-class-name.js +5 -7
  767. package/src/components/block-list/use-block-props/use-block-default-class-name.js +2 -8
  768. package/src/components/block-list/use-block-props/use-multi-selection.js +30 -4
  769. package/src/components/block-list/use-in-between-inserter.js +9 -0
  770. package/src/components/block-list-appender/index.js +8 -0
  771. package/src/components/block-mover/index.js +4 -4
  772. package/src/components/block-mover/index.native.js +4 -4
  773. package/src/components/block-mover/test/__snapshots__/index.native.js.snap +10 -6
  774. package/src/components/block-mover/test/index.native.js +26 -28
  775. package/src/components/block-navigation/dropdown.js +0 -1
  776. package/src/components/block-patterns-list/index.js +1 -8
  777. package/src/components/block-patterns-list/style.scss +22 -12
  778. package/src/components/block-preview/README.md +1 -1
  779. package/src/components/block-preview/auto.js +36 -18
  780. package/src/components/block-preview/style.scss +0 -20
  781. package/src/components/block-settings/container.native.js +7 -0
  782. package/src/components/block-settings-menu/block-settings-dropdown.js +26 -13
  783. package/src/components/block-settings-menu-controls/index.js +9 -6
  784. package/src/components/block-styles/index.js +6 -1
  785. package/src/components/block-styles/preview.native.js +2 -2
  786. package/src/components/block-switcher/block-styles-menu.js +1 -1
  787. package/src/components/block-switcher/index.js +7 -3
  788. package/src/components/block-switcher/test/__snapshots__/index.js.snap +1 -1
  789. package/src/components/block-switcher/test/index.js +3 -0
  790. package/src/components/block-title/index.js +5 -2
  791. package/src/components/block-toolbar/index.js +4 -0
  792. package/src/components/block-tools/block-contextual-toolbar.js +7 -5
  793. package/src/components/block-tools/block-popover.js +8 -8
  794. package/src/components/block-tools/block-selection-button.js +2 -4
  795. package/src/components/block-tools/index.js +5 -2
  796. package/src/components/block-tools/insertion-point.js +97 -9
  797. package/src/components/block-tools/style.scss +4 -35
  798. package/src/components/block-types-list/index.native.js +8 -2
  799. package/src/components/block-types-list/style.scss +0 -3
  800. package/src/components/block-variation-picker/README.md +47 -14
  801. package/src/components/block-variation-picker/style.native.scss +4 -0
  802. package/src/components/border-radius-control/index.js +1 -0
  803. package/src/components/border-radius-control/test/utils.js +216 -0
  804. package/src/components/border-radius-control/utils.js +18 -10
  805. package/src/components/color-palette/test/__snapshots__/control.js.snap +128 -71
  806. package/src/components/colors/test/utils.js +41 -0
  807. package/src/components/colors/utils.js +9 -5
  808. package/src/components/colors-gradients/control.js +70 -110
  809. package/src/components/colors-gradients/panel-color-gradient-settings.js +79 -7
  810. package/src/components/colors-gradients/style.scss +10 -18
  811. package/src/components/colors-gradients/test/control.js +41 -66
  812. package/src/components/contrast-checker/index.js +14 -10
  813. package/src/components/copy-handler/index.js +6 -1
  814. package/src/components/default-block-appender/index.js +2 -2
  815. package/src/components/default-block-appender/test/__snapshots__/index.js.snap +3 -3
  816. package/src/components/duotone-control/index.js +49 -41
  817. package/src/components/duotone-control/style.scss +27 -12
  818. package/src/components/editor-styles/index.js +8 -4
  819. package/src/components/font-appearance-control/index.js +62 -24
  820. package/src/components/font-appearance-control/style.scss +1 -1
  821. package/src/components/font-sizes/index.native.js +7 -1
  822. package/src/components/iframe/index.js +64 -75
  823. package/src/components/image-editor/aspect-ratio-dropdown.js +129 -0
  824. package/src/components/image-editor/constants.js +6 -0
  825. package/src/components/image-editor/context.js +56 -0
  826. package/src/components/image-editor/cropper.js +74 -0
  827. package/src/components/image-editor/form-controls.js +22 -0
  828. package/src/components/image-editor/index.js +52 -0
  829. package/src/components/image-editor/rotation-button.js +24 -0
  830. package/src/components/image-editor/use-save-image.js +97 -0
  831. package/src/components/image-editor/use-transform-image.js +162 -0
  832. package/src/components/image-editor/zoom-dropdown.js +40 -0
  833. package/src/components/image-size-control/use-dimension-handler.js +18 -1
  834. package/src/components/index.js +10 -8
  835. package/src/components/index.native.js +5 -3
  836. package/src/components/inner-blocks/button-block-appender.js +9 -0
  837. package/src/components/inner-blocks/index.js +43 -14
  838. package/src/components/inner-blocks/index.native.js +48 -4
  839. package/src/components/inner-blocks/use-nested-settings-update.js +26 -11
  840. package/src/components/inserter/block-patterns-explorer/explorer.js +50 -0
  841. package/src/components/inserter/block-patterns-explorer/patterns-list.js +122 -0
  842. package/src/components/inserter/block-patterns-explorer/sidebar.js +73 -0
  843. package/src/components/inserter/block-patterns-tab.js +107 -73
  844. package/src/components/inserter/block-types-tab.native.js +3 -6
  845. package/src/components/inserter/hooks/use-block-type-impressions.native.js +14 -21
  846. package/src/components/inserter/hooks/use-clipboard-block.native.js +3 -2
  847. package/src/components/inserter/index.js +15 -3
  848. package/src/components/inserter/index.native.js +2 -19
  849. package/src/components/inserter/library.js +2 -0
  850. package/src/components/inserter/menu.js +4 -1
  851. package/src/components/inserter/menu.native.js +18 -15
  852. package/src/components/inserter/pattern-panel.js +33 -16
  853. package/src/components/inserter/preview-panel.js +1 -1
  854. package/src/components/inserter/quick-inserter.js +1 -1
  855. package/src/components/inserter/reusable-blocks-tab.native.js +4 -6
  856. package/src/components/inserter/search-results.native.js +8 -1
  857. package/src/components/inserter/style.native.scss +8 -5
  858. package/src/components/inserter/style.scss +80 -16
  859. package/src/components/inserter/tabs.native.js +1 -7
  860. package/src/components/inserter/test/block-types-tab.native.js +3 -2
  861. package/src/components/inserter/test/fixtures/index.native.js +12 -0
  862. package/src/components/inserter/utils.native.js +35 -0
  863. package/src/components/inserter-list-item/style.scss +4 -2
  864. package/src/components/inspector-controls/README.md +43 -198
  865. package/src/components/inspector-controls/block-support-slot-container.js +10 -0
  866. package/src/components/inspector-controls/block-support-tools-panel.js +60 -0
  867. package/src/components/inspector-controls/fill.js +53 -0
  868. package/src/components/inspector-controls/{index.native.js → fill.native.js} +14 -14
  869. package/src/components/inspector-controls/groups.js +22 -0
  870. package/src/components/inspector-controls/index.js +16 -18
  871. package/src/components/inspector-controls/slot.js +45 -0
  872. package/src/components/inspector-controls/slot.native.js +22 -0
  873. package/src/components/letter-spacing-control/index.js +12 -6
  874. package/src/components/line-height-control/index.native.js +25 -0
  875. package/src/components/link-control/README.md +47 -14
  876. package/src/components/link-control/index.js +102 -31
  877. package/src/components/link-control/link-preview.js +53 -20
  878. package/src/components/link-control/search-input.js +21 -7
  879. package/src/components/link-control/style.scss +66 -19
  880. package/src/components/link-control/test/index.js +311 -4
  881. package/src/components/list-view/block-contents.js +17 -38
  882. package/src/components/list-view/block.js +73 -84
  883. package/src/components/list-view/branch.js +123 -94
  884. package/src/components/list-view/index.js +95 -37
  885. package/src/components/list-view/leaf.js +2 -2
  886. package/src/components/list-view/list-item.js +5 -4
  887. package/src/components/list-view/style.scss +70 -33
  888. package/src/components/list-view/use-list-view-client-ids.js +9 -68
  889. package/src/components/media-placeholder/README.md +9 -0
  890. package/src/components/media-placeholder/index.js +31 -20
  891. package/src/components/media-placeholder/index.native.js +2 -1
  892. package/src/components/media-placeholder/style.scss +2 -0
  893. package/src/components/media-replace-flow/README.md +7 -0
  894. package/src/components/media-replace-flow/index.js +4 -1
  895. package/src/components/media-replace-flow/style.scss +11 -12
  896. package/src/components/media-upload/README.md +1 -1
  897. package/src/components/navigable-toolbar/index.js +1 -4
  898. package/src/components/observe-typing/index.js +3 -2
  899. package/src/components/plain-text/index.native.js +26 -4
  900. package/src/components/rich-text/embed-handler-picker.native.js +68 -0
  901. package/src/components/rich-text/format-edit.js +36 -2
  902. package/src/components/rich-text/format-toolbar/index.js +25 -6
  903. package/src/components/rich-text/index.js +38 -12
  904. package/src/components/rich-text/index.native.js +37 -4
  905. package/src/components/rich-text/input-event.js +21 -20
  906. package/src/components/rich-text/shortcut.js +24 -9
  907. package/src/components/rich-text/style.scss +7 -5
  908. package/src/components/rich-text/use-input-events.js +19 -0
  909. package/src/components/rich-text/use-paste-handler.js +47 -12
  910. package/src/components/rich-text/use-shortcuts.js +19 -0
  911. package/src/components/rich-text/utils.js +16 -0
  912. package/src/components/skip-to-selected-block/README.md +39 -0
  913. package/src/components/tool-selector/style.scss +5 -5
  914. package/src/components/typewriter/index.js +3 -2
  915. package/src/components/url-input/index.js +26 -10
  916. package/src/components/use-display-block-controls/index.js +7 -10
  917. package/src/components/use-moving-animation/index.js +9 -8
  918. package/src/components/use-on-block-drop/index.js +5 -1
  919. package/src/components/use-resize-canvas/index.js +2 -17
  920. package/src/components/use-setting/index.js +48 -16
  921. package/src/components/writing-flow/use-multi-selection.js +6 -0
  922. package/src/components/writing-flow/use-tab-nav.js +21 -11
  923. package/src/default-editor-styles.scss +24 -0
  924. package/src/hooks/align.js +28 -20
  925. package/src/hooks/anchor.js +5 -5
  926. package/src/hooks/border-color.js +12 -1
  927. package/src/hooks/border.js +8 -11
  928. package/src/hooks/color-panel.js +4 -1
  929. package/src/hooks/color.js +11 -4
  930. package/src/hooks/compat.js +23 -0
  931. package/src/hooks/custom-class-name.js +3 -3
  932. package/src/hooks/dimensions.js +94 -50
  933. package/src/hooks/duotone.js +70 -21
  934. package/src/hooks/font-appearance.js +38 -7
  935. package/src/hooks/font-family.js +129 -33
  936. package/src/hooks/font-size.js +42 -6
  937. package/src/hooks/gap.js +146 -0
  938. package/src/hooks/index.js +3 -0
  939. package/src/hooks/index.native.js +2 -0
  940. package/src/hooks/layout.js +82 -56
  941. package/src/hooks/layout.scss +8 -0
  942. package/src/hooks/letter-spacing.js +37 -8
  943. package/src/hooks/line-height.js +37 -9
  944. package/src/hooks/lock.js +34 -0
  945. package/src/hooks/margin.js +13 -3
  946. package/src/hooks/padding.js +13 -3
  947. package/src/hooks/style.js +57 -18
  948. package/src/hooks/test/style.js +4 -0
  949. package/src/hooks/text-decoration.js +34 -6
  950. package/src/hooks/text-transform.js +34 -6
  951. package/src/hooks/typography.js +167 -21
  952. package/src/hooks/typography.native.js +64 -0
  953. package/src/hooks/typography.scss +16 -0
  954. package/src/hooks/use-cached-truthy.js +20 -0
  955. package/src/index.js +1 -0
  956. package/src/layouts/flex.js +237 -14
  957. package/src/layouts/flow.js +81 -14
  958. package/src/store/actions.js +248 -378
  959. package/src/store/defaults.js +2 -0
  960. package/src/store/defaults.native.js +15 -0
  961. package/src/store/index.js +1 -2
  962. package/src/store/reducer.js +248 -145
  963. package/src/store/selectors.js +212 -158
  964. package/src/store/test/actions.js +407 -705
  965. package/src/store/test/reducer.js +184 -146
  966. package/src/store/test/selectors.js +197 -177
  967. package/src/style.scss +2 -15
  968. package/src/utils/index.js +1 -0
  969. package/src/utils/parse-css-unit-to-px.js +272 -0
  970. package/src/utils/test/parse-css-unit-to-px.js +166 -0
  971. package/src/utils/transform-styles/transforms/test/wrap.js +1 -1
  972. package/src/utils/transform-styles/transforms/wrap.js +16 -0
  973. package/tsconfig.tsbuildinfo +1 -466
  974. package/build/components/block-list/head.js +0 -27
  975. package/build/components/block-list/head.js.map +0 -1
  976. package/build/components/duotone-control/duotone-picker-popover.js +0 -44
  977. package/build/components/duotone-control/duotone-picker-popover.js.map +0 -1
  978. package/build/components/inspector-advanced-controls/index.js +0 -46
  979. package/build/components/inspector-advanced-controls/index.js.map +0 -1
  980. package/build/components/inspector-controls/index.native.js.map +0 -1
  981. package/build/components/list-view/block-slot.js +0 -121
  982. package/build/components/list-view/block-slot.js.map +0 -1
  983. package/build/components/list-view/editor.js +0 -35
  984. package/build/components/list-view/editor.js.map +0 -1
  985. package/build/components/text-decoration-and-transform/index.js +0 -39
  986. package/build/components/text-decoration-and-transform/index.js.map +0 -1
  987. package/build/components/use-simulated-media-query/index.js +0 -137
  988. package/build/components/use-simulated-media-query/index.js.map +0 -1
  989. package/build/store/controls.js +0 -44
  990. package/build/store/controls.js.map +0 -1
  991. package/build-module/components/block-list/head.js +0 -19
  992. package/build-module/components/block-list/head.js.map +0 -1
  993. package/build-module/components/duotone-control/duotone-picker-popover.js +0 -35
  994. package/build-module/components/duotone-control/duotone-picker-popover.js.map +0 -1
  995. package/build-module/components/inspector-advanced-controls/index.js +0 -36
  996. package/build-module/components/inspector-advanced-controls/index.js.map +0 -1
  997. package/build-module/components/inspector-controls/index.native.js.map +0 -1
  998. package/build-module/components/list-view/block-slot.js +0 -96
  999. package/build-module/components/list-view/block-slot.js.map +0 -1
  1000. package/build-module/components/list-view/editor.js +0 -25
  1001. package/build-module/components/list-view/editor.js.map +0 -1
  1002. package/build-module/components/text-decoration-and-transform/index.js +0 -30
  1003. package/build-module/components/text-decoration-and-transform/index.js.map +0 -1
  1004. package/build-module/components/use-simulated-media-query/index.js +0 -126
  1005. package/build-module/components/use-simulated-media-query/index.js.map +0 -1
  1006. package/build-module/store/controls.js +0 -32
  1007. package/build-module/store/controls.js.map +0 -1
  1008. package/src/components/block-list/head.js +0 -18
  1009. package/src/components/duotone-control/duotone-picker-popover.js +0 -36
  1010. package/src/components/inspector-advanced-controls/README.md +0 -72
  1011. package/src/components/inspector-advanced-controls/index.js +0 -32
  1012. package/src/components/list-view/block-slot.js +0 -120
  1013. package/src/components/list-view/editor.js +0 -29
  1014. package/src/components/text-decoration-and-transform/index.js +0 -36
  1015. package/src/components/text-decoration-and-transform/style.scss +0 -3
  1016. package/src/components/use-simulated-media-query/index.js +0 -144
  1017. package/src/store/controls.js +0 -39
@@ -19,61 +19,44 @@ import {
19
19
  } from '@wordpress/blocks';
20
20
  import { speak } from '@wordpress/a11y';
21
21
  import { __, _n, sprintf } from '@wordpress/i18n';
22
- import { controls } from '@wordpress/data';
23
22
  import { create, insert, remove, toHTMLString } from '@wordpress/rich-text';
24
23
  import deprecated from '@wordpress/deprecated';
25
24
 
26
25
  /**
27
- * Internal dependencies
28
- */
29
- import { __unstableMarkAutomaticChangeFinalControl } from '../store/controls';
30
- import { STORE_NAME as blockEditorStoreName } from './constants';
31
-
32
- /**
33
- * Generator which will yield a default block insert action if there
34
- * are no other blocks at the root of the editor. This generator should be used
26
+ * Action which will insert a default block insert action if there
27
+ * are no other blocks at the root of the editor. This action should be used
35
28
  * in actions which may result in no blocks remaining in the editor (removal,
36
29
  * replacement, etc).
37
30
  */
38
- function* ensureDefaultBlock() {
39
- const count = yield controls.select(
40
- blockEditorStoreName,
41
- 'getBlockCount'
42
- );
43
-
31
+ const ensureDefaultBlock = () => ( { select, dispatch } ) => {
44
32
  // To avoid a focus loss when removing the last block, assure there is
45
33
  // always a default block if the last of the blocks have been removed.
46
- if ( count === 0 ) {
47
- const { __unstableHasCustomAppender } = yield controls.select(
48
- blockEditorStoreName,
49
- 'getSettings'
50
- );
51
-
52
- // If there's an custom appender, don't insert default block.
53
- // We have to remember to manually move the focus elsewhere to
54
- // prevent it from being lost though.
55
- if ( __unstableHasCustomAppender ) {
56
- return;
57
- }
34
+ const count = select.getBlockCount();
35
+ if ( count > 0 ) {
36
+ return;
37
+ }
58
38
 
59
- return yield insertDefaultBlock();
39
+ // If there's an custom appender, don't insert default block.
40
+ // We have to remember to manually move the focus elsewhere to
41
+ // prevent it from being lost though.
42
+ const { __unstableHasCustomAppender } = select.getSettings();
43
+ if ( __unstableHasCustomAppender ) {
44
+ return;
60
45
  }
61
- }
46
+
47
+ dispatch.insertDefaultBlock();
48
+ };
62
49
 
63
50
  /**
64
- * Returns an action object used in signalling that blocks state should be
65
- * reset to the specified array of blocks, taking precedence over any other
66
- * content reflected as an edit in state.
51
+ * Action that resets blocks state to the specified array of blocks, taking precedence
52
+ * over any other content reflected as an edit in state.
67
53
  *
68
54
  * @param {Array} blocks Array of blocks.
69
55
  */
70
- export function* resetBlocks( blocks ) {
71
- yield {
72
- type: 'RESET_BLOCKS',
73
- blocks,
74
- };
75
- return yield* validateBlocksToTemplate( blocks );
76
- }
56
+ export const resetBlocks = ( blocks ) => ( { dispatch } ) => {
57
+ dispatch( { type: 'RESET_BLOCKS', blocks } );
58
+ dispatch( validateBlocksToTemplate( blocks ) );
59
+ };
77
60
 
78
61
  /**
79
62
  * Block validity is a function of blocks state (at the point of a
@@ -83,15 +66,12 @@ export function* resetBlocks( blocks ) {
83
66
  *
84
67
  * @param {Array} blocks Array of blocks.
85
68
  */
86
- export function* validateBlocksToTemplate( blocks ) {
87
- const template = yield controls.select(
88
- blockEditorStoreName,
89
- 'getTemplate'
90
- );
91
- const templateLock = yield controls.select(
92
- blockEditorStoreName,
93
- 'getTemplateLock'
94
- );
69
+ export const validateBlocksToTemplate = ( blocks ) => ( {
70
+ select,
71
+ dispatch,
72
+ } ) => {
73
+ const template = select.getTemplate();
74
+ const templateLock = select.getTemplateLock();
95
75
 
96
76
  // Unlocked templates are considered always valid because they act
97
77
  // as default values only.
@@ -101,16 +81,13 @@ export function* validateBlocksToTemplate( blocks ) {
101
81
  doBlocksMatchTemplate( blocks, template );
102
82
 
103
83
  // Update if validity has changed.
104
- const isValidTemplate = yield controls.select(
105
- blockEditorStoreName,
106
- 'isValidTemplate'
107
- );
84
+ const isValidTemplate = select.isValidTemplate();
108
85
 
109
86
  if ( isBlocksValidToTemplate !== isValidTemplate ) {
110
- yield setTemplateValidity( isBlocksValidToTemplate );
87
+ dispatch.setTemplateValidity( isBlocksValidToTemplate );
111
88
  return isBlocksValidToTemplate;
112
89
  }
113
- }
90
+ };
114
91
 
115
92
  /**
116
93
  * A block selection object.
@@ -123,6 +100,7 @@ export function* validateBlocksToTemplate( blocks ) {
123
100
  * text value. See `wp.richText.create`.
124
101
  */
125
102
 
103
+ /* eslint-disable jsdoc/valid-types */
126
104
  /**
127
105
  * Returns an action object used in signalling that selection state should be
128
106
  * reset to the specified selection.
@@ -138,6 +116,7 @@ export function resetSelection(
138
116
  selectionEnd,
139
117
  initialPosition
140
118
  ) {
119
+ /* eslint-enable jsdoc/valid-types */
141
120
  return {
142
121
  type: 'RESET_SELECTION',
143
122
  selectionStart,
@@ -151,11 +130,18 @@ export function resetSelection(
151
130
  * Unlike resetBlocks, these should be appended to the existing known set, not
152
131
  * replacing.
153
132
  *
133
+ * @deprecated
134
+ *
154
135
  * @param {Object[]} blocks Array of block objects.
155
136
  *
156
137
  * @return {Object} Action object.
157
138
  */
158
139
  export function receiveBlocks( blocks ) {
140
+ deprecated( 'wp.data.dispatch( "core/block-editor" ).receiveBlocks', {
141
+ since: '5.9',
142
+ alternative: 'resetBlocks or insertBlocks',
143
+ } );
144
+
159
145
  return {
160
146
  type: 'RECEIVE_BLOCKS',
161
147
  blocks,
@@ -163,8 +149,7 @@ export function receiveBlocks( blocks ) {
163
149
  }
164
150
 
165
151
  /**
166
- * Returns an action object used in signalling that the multiple blocks'
167
- * attributes with the specified client IDs have been updated.
152
+ * Action that updates attributes of multiple blocks with the specified client IDs.
168
153
  *
169
154
  * @param {string|string[]} clientIds Block client IDs.
170
155
  * @param {Object} attributes Block attributes to be merged. Should be keyed by clientIds if
@@ -186,8 +171,7 @@ export function updateBlockAttributes(
186
171
  }
187
172
 
188
173
  /**
189
- * Returns an action object used in signalling that the block with the
190
- * specified client ID has been updated.
174
+ * Action that updates the block with the specified client ID.
191
175
  *
192
176
  * @param {string} clientId Block client ID.
193
177
  * @param {Object} updates Block attributes to be merged.
@@ -202,6 +186,7 @@ export function updateBlock( clientId, updates ) {
202
186
  };
203
187
  }
204
188
 
189
+ /* eslint-disable jsdoc/valid-types */
205
190
  /**
206
191
  * Returns an action object used in signalling that the block with the
207
192
  * specified client ID has been selected, optionally accepting a position
@@ -215,6 +200,7 @@ export function updateBlock( clientId, updates ) {
215
200
  * @return {Object} Action object.
216
201
  */
217
202
  export function selectBlock( clientId, initialPosition = 0 ) {
203
+ /* eslint-enable jsdoc/valid-types */
218
204
  return {
219
205
  type: 'SELECT_BLOCK',
220
206
  initialPosition,
@@ -228,18 +214,12 @@ export function selectBlock( clientId, initialPosition = 0 ) {
228
214
  *
229
215
  * @param {string} clientId Block client ID.
230
216
  */
231
- export function* selectPreviousBlock( clientId ) {
232
- const previousBlockClientId = yield controls.select(
233
- blockEditorStoreName,
234
- 'getPreviousBlockClientId',
235
- clientId
236
- );
237
-
217
+ export const selectPreviousBlock = ( clientId ) => ( { select, dispatch } ) => {
218
+ const previousBlockClientId = select.getPreviousBlockClientId( clientId );
238
219
  if ( previousBlockClientId ) {
239
- yield selectBlock( previousBlockClientId, -1 );
240
- return [ previousBlockClientId ];
220
+ dispatch.selectBlock( previousBlockClientId, -1 );
241
221
  }
242
- }
222
+ };
243
223
 
244
224
  /**
245
225
  * Yields action objects used in signalling that the block following the given
@@ -247,21 +227,15 @@ export function* selectPreviousBlock( clientId ) {
247
227
  *
248
228
  * @param {string} clientId Block client ID.
249
229
  */
250
- export function* selectNextBlock( clientId ) {
251
- const nextBlockClientId = yield controls.select(
252
- blockEditorStoreName,
253
- 'getNextBlockClientId',
254
- clientId
255
- );
256
-
230
+ export const selectNextBlock = ( clientId ) => ( { select, dispatch } ) => {
231
+ const nextBlockClientId = select.getNextBlockClientId( clientId );
257
232
  if ( nextBlockClientId ) {
258
- yield selectBlock( nextBlockClientId );
259
- return [ nextBlockClientId ];
233
+ dispatch.selectBlock( nextBlockClientId );
260
234
  }
261
- }
235
+ };
262
236
 
263
237
  /**
264
- * Returns an action object used in signalling that a block multi-selection has started.
238
+ * Action that starts block multi-selection.
265
239
  *
266
240
  * @return {Object} Action object.
267
241
  */
@@ -272,7 +246,7 @@ export function startMultiSelect() {
272
246
  }
273
247
 
274
248
  /**
275
- * Returns an action object used in signalling that block multi-selection stopped.
249
+ * Action that stops block multi-selection.
276
250
  *
277
251
  * @return {Object} Action object.
278
252
  */
@@ -283,38 +257,23 @@ export function stopMultiSelect() {
283
257
  }
284
258
 
285
259
  /**
286
- * Returns an action object used in signalling that block multi-selection changed.
260
+ * Action that changes block multi-selection.
287
261
  *
288
262
  * @param {string} start First block of the multi selection.
289
263
  * @param {string} end Last block of the multiselection.
290
264
  */
291
- export function* multiSelect( start, end ) {
292
- const startBlockRootClientId = yield controls.select(
293
- blockEditorStoreName,
294
- 'getBlockRootClientId',
295
- start
296
- );
297
- const endBlockRootClientId = yield controls.select(
298
- blockEditorStoreName,
299
- 'getBlockRootClientId',
300
- end
301
- );
265
+ export const multiSelect = ( start, end ) => ( { select, dispatch } ) => {
266
+ const startBlockRootClientId = select.getBlockRootClientId( start );
267
+ const endBlockRootClientId = select.getBlockRootClientId( end );
302
268
 
303
269
  // Only allow block multi-selections at the same level.
304
270
  if ( startBlockRootClientId !== endBlockRootClientId ) {
305
271
  return;
306
272
  }
307
273
 
308
- yield {
309
- type: 'MULTI_SELECT',
310
- start,
311
- end,
312
- };
274
+ dispatch( { type: 'MULTI_SELECT', start, end } );
313
275
 
314
- const blockCount = yield controls.select(
315
- blockEditorStoreName,
316
- 'getSelectedBlockCount'
317
- );
276
+ const blockCount = select.getSelectedBlockCount();
318
277
 
319
278
  speak(
320
279
  sprintf(
@@ -324,10 +283,10 @@ export function* multiSelect( start, end ) {
324
283
  ),
325
284
  'assertive'
326
285
  );
327
- }
286
+ };
328
287
 
329
288
  /**
330
- * Returns an action object used in signalling that the block selection is cleared.
289
+ * Action that clears the block selection.
331
290
  *
332
291
  * @return {Object} Action object.
333
292
  */
@@ -338,7 +297,7 @@ export function clearSelectedBlock() {
338
297
  }
339
298
 
340
299
  /**
341
- * Returns an action object that enables or disables block selection.
300
+ * Action that enables or disables block selection.
342
301
  *
343
302
  * @param {boolean} [isSelectionEnabled=true] Whether block selection should
344
303
  * be enabled.
@@ -382,9 +341,9 @@ function getBlocksWithDefaultStylesApplied( blocks, blockEditorSettings ) {
382
341
  } );
383
342
  }
384
343
 
344
+ /* eslint-disable jsdoc/valid-types */
385
345
  /**
386
- * Returns an action object signalling that a blocks should be replaced with
387
- * one or more replacement blocks.
346
+ * Action that replaces given blocks with one or more replacement blocks.
388
347
  *
389
348
  * @param {(string|string[])} clientIds Block client ID(s) to replace.
390
349
  * @param {(Object|Object[])} blocks Replacement block(s).
@@ -392,31 +351,26 @@ function getBlocksWithDefaultStylesApplied( blocks, blockEditorSettings ) {
392
351
  * @param {0|-1|null} initialPosition Index of caret after in the selected block after the operation.
393
352
  * @param {?Object} meta Optional Meta values to be passed to the action object.
394
353
  *
395
- * @yield {Object} Action object.
354
+ * @return {Object} Action object.
396
355
  */
397
- export function* replaceBlocks(
356
+ export const replaceBlocks = (
398
357
  clientIds,
399
358
  blocks,
400
359
  indexToSelect,
401
360
  initialPosition = 0,
402
361
  meta
403
- ) {
362
+ ) => ( { select, dispatch } ) => {
363
+ /* eslint-enable jsdoc/valid-types */
404
364
  clientIds = castArray( clientIds );
405
365
  blocks = getBlocksWithDefaultStylesApplied(
406
366
  castArray( blocks ),
407
- yield controls.select( blockEditorStoreName, 'getSettings' )
408
- );
409
- const rootClientId = yield controls.select(
410
- blockEditorStoreName,
411
- 'getBlockRootClientId',
412
- first( clientIds )
367
+ select.getSettings()
413
368
  );
369
+ const rootClientId = select.getBlockRootClientId( first( clientIds ) );
414
370
  // Replace is valid if the new blocks can be inserted in the root block.
415
371
  for ( let index = 0; index < blocks.length; index++ ) {
416
372
  const block = blocks[ index ];
417
- const canInsertBlock = yield controls.select(
418
- blockEditorStoreName,
419
- 'canInsertBlockType',
373
+ const canInsertBlock = select.canInsertBlockType(
420
374
  block.name,
421
375
  rootClientId
422
376
  );
@@ -424,7 +378,7 @@ export function* replaceBlocks(
424
378
  return;
425
379
  }
426
380
  }
427
- yield {
381
+ dispatch( {
428
382
  type: 'REPLACE_BLOCKS',
429
383
  clientIds,
430
384
  blocks,
@@ -432,13 +386,12 @@ export function* replaceBlocks(
432
386
  indexToSelect,
433
387
  initialPosition,
434
388
  meta,
435
- };
436
- yield* ensureDefaultBlock();
437
- }
389
+ } );
390
+ dispatch( ensureDefaultBlock() );
391
+ };
438
392
 
439
393
  /**
440
- * Returns an action object signalling that a single block should be replaced
441
- * with one or more replacement blocks.
394
+ * Action that replaces a single block with one or more replacement blocks.
442
395
  *
443
396
  * @param {(string|string[])} clientId Block client ID to replace.
444
397
  * @param {(Object|Object[])} block Replacement block(s).
@@ -457,100 +410,91 @@ export function replaceBlock( clientId, block ) {
457
410
  *
458
411
  * @return {Function} Action creator.
459
412
  */
460
- function createOnMove( type ) {
461
- return ( clientIds, rootClientId ) => {
462
- return {
463
- clientIds: castArray( clientIds ),
464
- type,
465
- rootClientId,
466
- };
467
- };
468
- }
413
+ const createOnMove = ( type ) => ( clientIds, rootClientId ) => ( {
414
+ select,
415
+ dispatch,
416
+ } ) => {
417
+ // If one of the blocks is locked or the parent is locked, we cannot move any block.
418
+ const canMoveBlocks = select.canMoveBlocks( clientIds, rootClientId );
419
+ if ( ! canMoveBlocks ) {
420
+ return;
421
+ }
422
+
423
+ dispatch( { type, clientIds: castArray( clientIds ), rootClientId } );
424
+ };
469
425
 
470
426
  export const moveBlocksDown = createOnMove( 'MOVE_BLOCKS_DOWN' );
471
427
  export const moveBlocksUp = createOnMove( 'MOVE_BLOCKS_UP' );
472
428
 
473
429
  /**
474
- * Returns an action object signalling that the given blocks should be moved to
475
- * a new position.
430
+ * Action that moves given blocks to a new position.
476
431
  *
477
432
  * @param {?string} clientIds The client IDs of the blocks.
478
433
  * @param {?string} fromRootClientId Root client ID source.
479
434
  * @param {?string} toRootClientId Root client ID destination.
480
435
  * @param {number} index The index to move the blocks to.
481
- *
482
- * @yield {Object} Action object.
483
436
  */
484
- export function* moveBlocksToPosition(
437
+ export const moveBlocksToPosition = (
485
438
  clientIds,
486
439
  fromRootClientId = '',
487
440
  toRootClientId = '',
488
441
  index
489
- ) {
490
- const templateLock = yield controls.select(
491
- blockEditorStoreName,
492
- 'getTemplateLock',
493
- fromRootClientId
494
- );
442
+ ) => ( { select, dispatch } ) => {
443
+ const canMoveBlocks = select.canMoveBlocks( clientIds, fromRootClientId );
495
444
 
496
- // If locking is equal to all on the original clientId (fromRootClientId),
497
- // it is not possible to move the block to any other position.
498
- if ( templateLock === 'all' ) {
445
+ // If one of the blocks is locked or the parent is locked, we cannot move any block.
446
+ if ( ! canMoveBlocks ) {
499
447
  return;
500
448
  }
501
449
 
502
- const action = {
503
- type: 'MOVE_BLOCKS_TO_POSITION',
504
- fromRootClientId,
505
- toRootClientId,
506
- clientIds,
507
- index,
508
- };
509
-
510
450
  // If moving inside the same root block the move is always possible.
511
- if ( fromRootClientId === toRootClientId ) {
512
- yield action;
513
- return;
514
- }
451
+ if ( fromRootClientId !== toRootClientId ) {
452
+ const canRemoveBlocks = select.canRemoveBlocks(
453
+ clientIds,
454
+ fromRootClientId
455
+ );
515
456
 
516
- // If templateLock is insert we can not remove the block from the parent.
517
- // Given that here we know that we are moving the block to a different
518
- // parent, the move should not be possible if the condition is true.
519
- if ( templateLock === 'insert' ) {
520
- return;
521
- }
457
+ // If we're moving to another block, it means we're deleting blocks from
458
+ // the original block, so we need to check if removing is possible.
459
+ if ( ! canRemoveBlocks ) {
460
+ return;
461
+ }
522
462
 
523
- const canInsertBlocks = yield controls.select(
524
- blockEditorStoreName,
525
- 'canInsertBlocks',
526
- clientIds,
527
- toRootClientId
528
- );
463
+ const canInsertBlocks = select.canInsertBlocks(
464
+ clientIds,
465
+ toRootClientId
466
+ );
529
467
 
530
- // If moving to other parent block, the move is possible if we can insert a block of the same type inside the new parent block.
531
- if ( canInsertBlocks ) {
532
- yield action;
468
+ // If moving to other parent block, the move is possible if we can insert a block of the same type inside the new parent block.
469
+ if ( ! canInsertBlocks ) {
470
+ return;
471
+ }
533
472
  }
534
- }
473
+
474
+ dispatch( {
475
+ type: 'MOVE_BLOCKS_TO_POSITION',
476
+ fromRootClientId,
477
+ toRootClientId,
478
+ clientIds,
479
+ index,
480
+ } );
481
+ };
535
482
 
536
483
  /**
537
- * Returns an action object signalling that the given block should be moved to a
538
- * new position.
484
+ * Action that moves given block to a new position.
539
485
  *
540
486
  * @param {?string} clientId The client ID of the block.
541
487
  * @param {?string} fromRootClientId Root client ID source.
542
488
  * @param {?string} toRootClientId Root client ID destination.
543
489
  * @param {number} index The index to move the block to.
544
- *
545
- * @yield {Object} Action object.
546
490
  */
547
- export function* moveBlockToPosition(
491
+ export function moveBlockToPosition(
548
492
  clientId,
549
493
  fromRootClientId = '',
550
494
  toRootClientId = '',
551
495
  index
552
496
  ) {
553
- yield moveBlocksToPosition(
497
+ return moveBlocksToPosition(
554
498
  [ clientId ],
555
499
  fromRootClientId,
556
500
  toRootClientId,
@@ -559,8 +503,7 @@ export function* moveBlockToPosition(
559
503
  }
560
504
 
561
505
  /**
562
- * Returns an action object used in signalling that a single block should be
563
- * inserted, optionally at a specific index respective a root block list.
506
+ * Action that inserts a single block, optionally at a specific index respective a root block list.
564
507
  *
565
508
  * @param {Object} block Block object to insert.
566
509
  * @param {?number} index Index at which block should be inserted.
@@ -574,7 +517,7 @@ export function insertBlock(
574
517
  block,
575
518
  index,
576
519
  rootClientId,
577
- updateSelection = true,
520
+ updateSelection,
578
521
  meta
579
522
  ) {
580
523
  return insertBlocks(
@@ -587,9 +530,9 @@ export function insertBlock(
587
530
  );
588
531
  }
589
532
 
533
+ /* eslint-disable jsdoc/valid-types */
590
534
  /**
591
- * Returns an action object used in signalling that an array of blocks should
592
- * be inserted, optionally at a specific index respective a root block list.
535
+ * Action that inserts an array of blocks, optionally at a specific index respective a root block list.
593
536
  *
594
537
  * @param {Object[]} blocks Block objects to insert.
595
538
  * @param {?number} index Index at which block should be inserted.
@@ -599,14 +542,15 @@ export function insertBlock(
599
542
  * @param {?Object} meta Optional Meta values to be passed to the action object.
600
543
  * @return {Object} Action object.
601
544
  */
602
- export function* insertBlocks(
545
+ export const insertBlocks = (
603
546
  blocks,
604
547
  index,
605
548
  rootClientId,
606
549
  updateSelection = true,
607
550
  initialPosition = 0,
608
551
  meta
609
- ) {
552
+ ) => ( { select, dispatch } ) => {
553
+ /* eslint-enable jsdoc/valid-types */
610
554
  if ( isObject( initialPosition ) ) {
611
555
  meta = initialPosition;
612
556
  initialPosition = 0;
@@ -619,22 +563,17 @@ export function* insertBlocks(
619
563
 
620
564
  blocks = getBlocksWithDefaultStylesApplied(
621
565
  castArray( blocks ),
622
- yield controls.select( blockEditorStoreName, 'getSettings' )
566
+ select.getSettings()
623
567
  );
624
568
  const allowedBlocks = [];
625
569
  for ( const block of blocks ) {
626
- const isValid = yield controls.select(
627
- blockEditorStoreName,
628
- 'canInsertBlockType',
629
- block.name,
630
- rootClientId
631
- );
570
+ const isValid = select.canInsertBlockType( block.name, rootClientId );
632
571
  if ( isValid ) {
633
572
  allowedBlocks.push( block );
634
573
  }
635
574
  }
636
575
  if ( allowedBlocks.length ) {
637
- return {
576
+ dispatch( {
638
577
  type: 'INSERT_BLOCKS',
639
578
  blocks: allowedBlocks,
640
579
  index,
@@ -643,13 +582,12 @@ export function* insertBlocks(
643
582
  updateSelection,
644
583
  initialPosition: updateSelection ? initialPosition : null,
645
584
  meta,
646
- };
585
+ } );
647
586
  }
648
- }
587
+ };
649
588
 
650
589
  /**
651
- * Returns an action object used in signalling that the insertion point should
652
- * be shown.
590
+ * Action that shows the insertion point.
653
591
  *
654
592
  * @param {?string} rootClientId Optional root client ID of block list on
655
593
  * which to insert.
@@ -673,7 +611,7 @@ export function showInsertionPoint(
673
611
  }
674
612
 
675
613
  /**
676
- * Returns an action object hiding the insertion point.
614
+ * Action that hides the insertion point.
677
615
  *
678
616
  * @return {Object} Action object.
679
617
  */
@@ -684,7 +622,7 @@ export function hideInsertionPoint() {
684
622
  }
685
623
 
686
624
  /**
687
- * Returns an action object resetting the template validity.
625
+ * Action that resets the template validity.
688
626
  *
689
627
  * @param {boolean} isValid template validity flag.
690
628
  *
@@ -698,61 +636,45 @@ export function setTemplateValidity( isValid ) {
698
636
  }
699
637
 
700
638
  /**
701
- * Returns an action object synchronize the template with the list of blocks
639
+ * Action that synchronizes the template with the list of blocks.
702
640
  *
703
641
  * @return {Object} Action object.
704
642
  */
705
- export function* synchronizeTemplate() {
706
- yield {
707
- type: 'SYNCHRONIZE_TEMPLATE',
708
- };
709
- const blocks = yield controls.select( blockEditorStoreName, 'getBlocks' );
710
- const template = yield controls.select(
711
- blockEditorStoreName,
712
- 'getTemplate'
713
- );
643
+ export const synchronizeTemplate = () => ( { select, dispatch } ) => {
644
+ dispatch( { type: 'SYNCHRONIZE_TEMPLATE' } );
645
+ const blocks = select.getBlocks();
646
+ const template = select.getTemplate();
714
647
  const updatedBlockList = synchronizeBlocksWithTemplate( blocks, template );
715
648
 
716
- return yield resetBlocks( updatedBlockList );
717
- }
649
+ dispatch.resetBlocks( updatedBlockList );
650
+ };
718
651
 
719
652
  /**
720
- * Returns an action object used in signalling that two blocks should be merged
653
+ * Action that merges two blocks.
721
654
  *
722
655
  * @param {string} firstBlockClientId Client ID of the first block to merge.
723
656
  * @param {string} secondBlockClientId Client ID of the second block to merge.
724
657
  */
725
- export function* mergeBlocks( firstBlockClientId, secondBlockClientId ) {
658
+ export const mergeBlocks = ( firstBlockClientId, secondBlockClientId ) => ( {
659
+ select,
660
+ dispatch,
661
+ } ) => {
726
662
  const blocks = [ firstBlockClientId, secondBlockClientId ];
727
- yield {
728
- type: 'MERGE_BLOCKS',
729
- blocks,
730
- };
663
+ dispatch( { type: 'MERGE_BLOCKS', blocks } );
731
664
 
732
665
  const [ clientIdA, clientIdB ] = blocks;
733
- const blockA = yield controls.select(
734
- blockEditorStoreName,
735
- 'getBlock',
736
- clientIdA
737
- );
666
+ const blockA = select.getBlock( clientIdA );
738
667
  const blockAType = getBlockType( blockA.name );
739
668
 
740
669
  // Only focus the previous block if it's not mergeable
741
- if ( ! blockAType.merge ) {
742
- yield selectBlock( blockA.clientId );
670
+ if ( blockAType && ! blockAType.merge ) {
671
+ dispatch.selectBlock( blockA.clientId );
743
672
  return;
744
673
  }
745
674
 
746
- const blockB = yield controls.select(
747
- blockEditorStoreName,
748
- 'getBlock',
749
- clientIdB
750
- );
675
+ const blockB = select.getBlock( clientIdB );
751
676
  const blockBType = getBlockType( blockB.name );
752
- const { clientId, attributeKey, offset } = yield controls.select(
753
- blockEditorStoreName,
754
- 'getSelectionStart'
755
- );
677
+ const { clientId, attributeKey, offset } = select.getSelectionStart();
756
678
  const selectedBlockType = clientId === clientIdA ? blockAType : blockBType;
757
679
  const attributeDefinition = selectedBlockType.attributes[ attributeKey ];
758
680
  const canRestoreTextSelection =
@@ -859,7 +781,7 @@ export function* mergeBlocks( firstBlockClientId, secondBlockClientId ) {
859
781
 
860
782
  updatedAttributes[ newAttributeKey ] = newHtml;
861
783
 
862
- yield selectionChange(
784
+ dispatch.selectionChange(
863
785
  blockA.clientId,
864
786
  newAttributeKey,
865
787
  newOffset,
@@ -867,7 +789,7 @@ export function* mergeBlocks( firstBlockClientId, secondBlockClientId ) {
867
789
  );
868
790
  }
869
791
 
870
- yield* replaceBlocks(
792
+ dispatch.replaceBlocks(
871
793
  [ blockA.clientId, blockB.clientId ],
872
794
  [
873
795
  {
@@ -878,9 +800,10 @@ export function* mergeBlocks( firstBlockClientId, secondBlockClientId ) {
878
800
  },
879
801
  },
880
802
  ...blocksWithTheSameType.slice( 1 ),
881
- ]
803
+ ],
804
+ 0 // If we don't pass the `indexToSelect` it will default to the last block.
882
805
  );
883
- }
806
+ };
884
807
 
885
808
  /**
886
809
  * Yields action objects used in signalling that the blocks corresponding to
@@ -890,47 +813,32 @@ export function* mergeBlocks( firstBlockClientId, secondBlockClientId ) {
890
813
  * @param {boolean} selectPrevious True if the previous block should be
891
814
  * selected when a block is removed.
892
815
  */
893
- export function* removeBlocks( clientIds, selectPrevious = true ) {
816
+ export const removeBlocks = ( clientIds, selectPrevious = true ) => ( {
817
+ select,
818
+ dispatch,
819
+ } ) => {
894
820
  if ( ! clientIds || ! clientIds.length ) {
895
821
  return;
896
822
  }
897
823
 
898
824
  clientIds = castArray( clientIds );
899
- const rootClientId = yield controls.select(
900
- blockEditorStoreName,
901
- 'getBlockRootClientId',
902
- clientIds[ 0 ]
903
- );
904
- const isLocked = yield controls.select(
905
- blockEditorStoreName,
906
- 'getTemplateLock',
907
- rootClientId
908
- );
909
- if ( isLocked ) {
825
+ const rootClientId = select.getBlockRootClientId( clientIds[ 0 ] );
826
+ const canRemoveBlocks = select.canRemoveBlocks( clientIds, rootClientId );
827
+
828
+ if ( ! canRemoveBlocks ) {
910
829
  return;
911
830
  }
912
831
 
913
- let previousBlockId;
914
832
  if ( selectPrevious ) {
915
- previousBlockId = yield selectPreviousBlock( clientIds[ 0 ] );
916
- } else {
917
- previousBlockId = yield controls.select(
918
- blockEditorStoreName,
919
- 'getPreviousBlockClientId',
920
- clientIds[ 0 ]
921
- );
833
+ dispatch.selectPreviousBlock( clientIds[ 0 ] );
922
834
  }
923
835
 
924
- yield {
925
- type: 'REMOVE_BLOCKS',
926
- clientIds,
927
- };
836
+ dispatch( { type: 'REMOVE_BLOCKS', clientIds } );
928
837
 
929
838
  // To avoid a focus loss when removing the last block, assure there is
930
839
  // always a default block if the last of the blocks have been removed.
931
- const defaultBlockId = yield* ensureDefaultBlock();
932
- return [ previousBlockId || defaultBlockId ];
933
- }
840
+ dispatch( ensureDefaultBlock() );
841
+ };
934
842
 
935
843
  /**
936
844
  * Returns an action object used in signalling that the block with the
@@ -946,6 +854,7 @@ export function removeBlock( clientId, selectPrevious ) {
946
854
  return removeBlocks( [ clientId ], selectPrevious );
947
855
  }
948
856
 
857
+ /* eslint-disable jsdoc/valid-types */
949
858
  /**
950
859
  * Returns an action object used in signalling that the inner blocks with the
951
860
  * specified client ID should be replaced.
@@ -962,6 +871,7 @@ export function replaceInnerBlocks(
962
871
  updateSelection = false,
963
872
  initialPosition = 0
964
873
  ) {
874
+ /* eslint-enable jsdoc/valid-types */
965
875
  return {
966
876
  type: 'REPLACE_INNER_BLOCKS',
967
877
  rootClientId,
@@ -1057,8 +967,7 @@ export function exitFormattedText() {
1057
967
  }
1058
968
 
1059
969
  /**
1060
- * Returns an action object used in signalling that the user caret has changed
1061
- * position.
970
+ * Action that changes the position of the user caret.
1062
971
  *
1063
972
  * @param {string} clientId The selected block client ID.
1064
973
  * @param {string} attributeKey The selected block attribute key.
@@ -1083,8 +992,7 @@ export function selectionChange(
1083
992
  }
1084
993
 
1085
994
  /**
1086
- * Returns an action object used in signalling that a new block of the default
1087
- * type should be added to the block list.
995
+ * Action that adds a new block of the default type to the block list.
1088
996
  *
1089
997
  * @param {?Object} attributes Optional attributes of the block to assign.
1090
998
  * @param {?string} rootClientId Optional root client ID of block list on which
@@ -1106,7 +1014,7 @@ export function insertDefaultBlock( attributes, rootClientId, index ) {
1106
1014
  }
1107
1015
 
1108
1016
  /**
1109
- * Returns an action object that changes the nested settings of a given block.
1017
+ * Action that changes the nested settings of a given block.
1110
1018
  *
1111
1019
  * @param {string} clientId Client ID of the block whose nested setting are
1112
1020
  * being received.
@@ -1123,7 +1031,7 @@ export function updateBlockListSettings( clientId, settings ) {
1123
1031
  }
1124
1032
 
1125
1033
  /**
1126
- * Returns an action object used in signalling that the block editor settings have been updated.
1034
+ * Action that updates the block editor settings.
1127
1035
  *
1128
1036
  * @param {Object} settings Updated settings
1129
1037
  *
@@ -1137,7 +1045,7 @@ export function updateSettings( settings ) {
1137
1045
  }
1138
1046
 
1139
1047
  /**
1140
- * Returns an action object used in signalling that a temporary reusable blocks have been saved
1048
+ * Action that signals that a temporary reusable block has been saved
1141
1049
  * in order to switch its temporary id with the real id.
1142
1050
  *
1143
1051
  * @param {string} id Reusable block's id.
@@ -1154,7 +1062,7 @@ export function __unstableSaveReusableBlock( id, updatedId ) {
1154
1062
  }
1155
1063
 
1156
1064
  /**
1157
- * Returns an action object used in signalling that the last block change should be marked explicitly as persistent.
1065
+ * Action that marks the last block change explicitly as persistent.
1158
1066
  *
1159
1067
  * @return {Object} Action object.
1160
1068
  */
@@ -1163,7 +1071,7 @@ export function __unstableMarkLastChangeAsPersistent() {
1163
1071
  }
1164
1072
 
1165
1073
  /**
1166
- * Returns an action object used in signalling that the next block change should be marked explicitly as not persistent.
1074
+ * Action that signals that the next block change should be marked explicitly as not persistent.
1167
1075
  *
1168
1076
  * @return {Object} Action object.
1169
1077
  */
@@ -1172,34 +1080,29 @@ export function __unstableMarkNextChangeAsNotPersistent() {
1172
1080
  }
1173
1081
 
1174
1082
  /**
1175
- * Returns an action object used in signalling that the last block change is
1176
- * an automatic change, meaning it was not performed by the user, and can be
1177
- * undone using the `Escape` and `Backspace` keys. This action must be called
1178
- * after the change was made, and any actions that are a consequence of it, so
1179
- * it is recommended to be called at the next idle period to ensure all
1083
+ * Action that marks the last block change as an automatic change, meaning it was not
1084
+ * performed by the user, and can be undone using the `Escape` and `Backspace` keys.
1085
+ * This action must be called after the change was made, and any actions that are a
1086
+ * consequence of it, so it is recommended to be called at the next idle period to ensure all
1180
1087
  * selection changes have been recorded.
1181
1088
  */
1182
- export function* __unstableMarkAutomaticChange() {
1183
- yield { type: 'MARK_AUTOMATIC_CHANGE' };
1184
- yield __unstableMarkAutomaticChangeFinalControl();
1185
- }
1186
-
1187
- export function __unstableMarkAutomaticChangeFinal() {
1188
- return {
1189
- type: 'MARK_AUTOMATIC_CHANGE_FINAL',
1190
- };
1191
- }
1089
+ export const __unstableMarkAutomaticChange = () => ( { dispatch } ) => {
1090
+ dispatch( { type: 'MARK_AUTOMATIC_CHANGE' } );
1091
+ const { requestIdleCallback = ( cb ) => setTimeout( cb, 100 ) } = window;
1092
+ requestIdleCallback( () => {
1093
+ dispatch( { type: 'MARK_AUTOMATIC_CHANGE_FINAL' } );
1094
+ } );
1095
+ };
1192
1096
 
1193
1097
  /**
1194
- * Generators that triggers an action used to enable or disable the navigation mode.
1098
+ * Action that enables or disables the navigation mode.
1195
1099
  *
1196
1100
  * @param {string} isNavigationMode Enable/Disable navigation mode.
1197
1101
  */
1198
- export function* setNavigationMode( isNavigationMode = true ) {
1199
- yield {
1200
- type: 'SET_NAVIGATION_MODE',
1201
- isNavigationMode,
1202
- };
1102
+ export const setNavigationMode = ( isNavigationMode = true ) => ( {
1103
+ dispatch,
1104
+ } ) => {
1105
+ dispatch( { type: 'SET_NAVIGATION_MODE', isNavigationMode } );
1203
1106
 
1204
1107
  if ( isNavigationMode ) {
1205
1108
  speak(
@@ -1214,18 +1117,17 @@ export function* setNavigationMode( isNavigationMode = true ) {
1214
1117
  )
1215
1118
  );
1216
1119
  }
1217
- }
1120
+ };
1218
1121
 
1219
1122
  /**
1220
- * Generator that triggers an action used to enable or disable the block moving mode.
1123
+ * Action that enables or disables the block moving mode.
1221
1124
  *
1222
1125
  * @param {string|null} hasBlockMovingClientId Enable/Disable block moving mode.
1223
1126
  */
1224
- export function* setBlockMovingClientId( hasBlockMovingClientId = null ) {
1225
- yield {
1226
- type: 'SET_BLOCK_MOVING_MODE',
1227
- hasBlockMovingClientId,
1228
- };
1127
+ export const setBlockMovingClientId = ( hasBlockMovingClientId = null ) => ( {
1128
+ dispatch,
1129
+ } ) => {
1130
+ dispatch( { type: 'SET_BLOCK_MOVING_MODE', hasBlockMovingClientId } );
1229
1131
 
1230
1132
  if ( hasBlockMovingClientId ) {
1231
1133
  speak(
@@ -1234,133 +1136,105 @@ export function* setBlockMovingClientId( hasBlockMovingClientId = null ) {
1234
1136
  )
1235
1137
  );
1236
1138
  }
1237
- }
1139
+ };
1238
1140
 
1239
1141
  /**
1240
- * Generator that triggers an action used to duplicate a list of blocks.
1142
+ * Action that duplicates a list of blocks.
1241
1143
  *
1242
1144
  * @param {string[]} clientIds
1243
1145
  * @param {boolean} updateSelection
1244
1146
  */
1245
- export function* duplicateBlocks( clientIds, updateSelection = true ) {
1246
- if ( ! clientIds && ! clientIds.length ) {
1147
+ export const duplicateBlocks = ( clientIds, updateSelection = true ) => ( {
1148
+ select,
1149
+ dispatch,
1150
+ } ) => {
1151
+ if ( ! clientIds || ! clientIds.length ) {
1247
1152
  return;
1248
1153
  }
1249
- const blocks = yield controls.select(
1250
- blockEditorStoreName,
1251
- 'getBlocksByClientId',
1252
- clientIds
1253
- );
1254
- const rootClientId = yield controls.select(
1255
- blockEditorStoreName,
1256
- 'getBlockRootClientId',
1257
- clientIds[ 0 ]
1258
- );
1154
+
1259
1155
  // Return early if blocks don't exist.
1156
+ const blocks = select.getBlocksByClientId( clientIds );
1260
1157
  if ( some( blocks, ( block ) => ! block ) ) {
1261
1158
  return;
1262
1159
  }
1263
- const blockNames = blocks.map( ( block ) => block.name );
1160
+
1264
1161
  // Return early if blocks don't support multiple usage.
1162
+ const blockNames = blocks.map( ( block ) => block.name );
1265
1163
  if (
1266
- some(
1267
- blockNames,
1164
+ blockNames.some(
1268
1165
  ( blockName ) => ! hasBlockSupport( blockName, 'multiple', true )
1269
1166
  )
1270
1167
  ) {
1271
1168
  return;
1272
1169
  }
1273
1170
 
1274
- const lastSelectedIndex = yield controls.select(
1275
- blockEditorStoreName,
1276
- 'getBlockIndex',
1171
+ const rootClientId = select.getBlockRootClientId( clientIds[ 0 ] );
1172
+ const lastSelectedIndex = select.getBlockIndex(
1277
1173
  last( castArray( clientIds ) ),
1278
1174
  rootClientId
1279
1175
  );
1280
1176
  const clonedBlocks = blocks.map( ( block ) =>
1281
1177
  __experimentalCloneSanitizedBlock( block )
1282
1178
  );
1283
- yield insertBlocks(
1179
+ dispatch.insertBlocks(
1284
1180
  clonedBlocks,
1285
1181
  lastSelectedIndex + 1,
1286
1182
  rootClientId,
1287
1183
  updateSelection
1288
1184
  );
1289
1185
  if ( clonedBlocks.length > 1 && updateSelection ) {
1290
- yield multiSelect(
1186
+ dispatch.multiSelect(
1291
1187
  first( clonedBlocks ).clientId,
1292
1188
  last( clonedBlocks ).clientId
1293
1189
  );
1294
1190
  }
1295
1191
  return clonedBlocks.map( ( block ) => block.clientId );
1296
- }
1192
+ };
1297
1193
 
1298
1194
  /**
1299
- * Generator used to insert an empty block after a given block.
1195
+ * Action that inserts an empty block before a given block.
1300
1196
  *
1301
1197
  * @param {string} clientId
1302
1198
  */
1303
- export function* insertBeforeBlock( clientId ) {
1199
+ export const insertBeforeBlock = ( clientId ) => ( { select, dispatch } ) => {
1304
1200
  if ( ! clientId ) {
1305
1201
  return;
1306
1202
  }
1307
- const rootClientId = yield controls.select(
1308
- blockEditorStoreName,
1309
- 'getBlockRootClientId',
1310
- clientId
1311
- );
1312
- const isLocked = yield controls.select(
1313
- blockEditorStoreName,
1314
- 'getTemplateLock',
1315
- rootClientId
1316
- );
1203
+ const rootClientId = select.getBlockRootClientId( clientId );
1204
+ const isLocked = select.getTemplateLock( rootClientId );
1317
1205
  if ( isLocked ) {
1318
1206
  return;
1319
1207
  }
1320
1208
 
1321
- const firstSelectedIndex = yield controls.select(
1322
- blockEditorStoreName,
1323
- 'getBlockIndex',
1324
- clientId,
1325
- rootClientId
1326
- );
1327
- return yield insertDefaultBlock( {}, rootClientId, firstSelectedIndex );
1328
- }
1209
+ const firstSelectedIndex = select.getBlockIndex( clientId, rootClientId );
1210
+ return dispatch.insertDefaultBlock( {}, rootClientId, firstSelectedIndex );
1211
+ };
1329
1212
 
1330
1213
  /**
1331
- * Generator used to insert an empty block before a given block.
1214
+ * Action that inserts an empty block after a given block.
1332
1215
  *
1333
1216
  * @param {string} clientId
1334
1217
  */
1335
- export function* insertAfterBlock( clientId ) {
1218
+ export const insertAfterBlock = ( clientId ) => ( { select, dispatch } ) => {
1336
1219
  if ( ! clientId ) {
1337
1220
  return;
1338
1221
  }
1339
- const rootClientId = yield controls.select(
1340
- blockEditorStoreName,
1341
- 'getBlockRootClientId',
1342
- clientId
1343
- );
1344
- const isLocked = yield controls.select(
1345
- blockEditorStoreName,
1346
- 'getTemplateLock',
1347
- rootClientId
1348
- );
1222
+ const rootClientId = select.getBlockRootClientId( clientId );
1223
+ const isLocked = select.getTemplateLock( rootClientId );
1349
1224
  if ( isLocked ) {
1350
1225
  return;
1351
1226
  }
1352
1227
 
1353
- const firstSelectedIndex = yield controls.select(
1354
- blockEditorStoreName,
1355
- 'getBlockIndex',
1356
- clientId,
1357
- rootClientId
1228
+ const firstSelectedIndex = select.getBlockIndex( clientId, rootClientId );
1229
+ return dispatch.insertDefaultBlock(
1230
+ {},
1231
+ rootClientId,
1232
+ firstSelectedIndex + 1
1358
1233
  );
1359
- return yield insertDefaultBlock( {}, rootClientId, firstSelectedIndex + 1 );
1360
- }
1234
+ };
1361
1235
 
1362
1236
  /**
1363
- * Returns an action object that toggles the highlighted block state.
1237
+ * Action that toggles the highlighted block state.
1364
1238
  *
1365
1239
  * @param {string} clientId The block's clientId.
1366
1240
  * @param {boolean} isHighlighted The highlight state.
@@ -1374,22 +1248,18 @@ export function toggleBlockHighlight( clientId, isHighlighted ) {
1374
1248
  }
1375
1249
 
1376
1250
  /**
1377
- * Yields action objects used in signalling that the block corresponding to the
1378
- * given clientId should appear to "flash" by rhythmically highlighting it.
1251
+ * Action that "flashes" the block with a given `clientId` by rhythmically highlighting it.
1379
1252
  *
1380
1253
  * @param {string} clientId Target block client ID.
1381
1254
  */
1382
- export function* flashBlock( clientId ) {
1383
- yield toggleBlockHighlight( clientId, true );
1384
- yield {
1385
- type: 'SLEEP',
1386
- duration: 150,
1387
- };
1388
- yield toggleBlockHighlight( clientId, false );
1389
- }
1255
+ export const flashBlock = ( clientId ) => async ( { dispatch } ) => {
1256
+ dispatch( toggleBlockHighlight( clientId, true ) );
1257
+ await new Promise( ( resolve ) => setTimeout( resolve, 150 ) );
1258
+ dispatch( toggleBlockHighlight( clientId, false ) );
1259
+ };
1390
1260
 
1391
1261
  /**
1392
- * Returns an action object that sets whether the block has controlled innerblocks.
1262
+ * Action that sets whether a block has controlled inner blocks.
1393
1263
  *
1394
1264
  * @param {string} clientId The block's clientId.
1395
1265
  * @param {boolean} hasControlledInnerBlocks True if the block's inner blocks are controlled.