@wordpress/block-editor 14.3.3 → 14.4.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 (418) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/README.md +46 -0
  3. package/build/autocompleters/link.js +2 -1
  4. package/build/autocompleters/link.js.map +1 -1
  5. package/build/components/block-actions/index.js +1 -13
  6. package/build/components/block-actions/index.js.map +1 -1
  7. package/build/components/block-inspector/index.js +56 -75
  8. package/build/components/block-inspector/index.js.map +1 -1
  9. package/build/components/block-list/block.js +5 -19
  10. package/build/components/block-list/block.js.map +1 -1
  11. package/build/components/block-list/index.js +5 -8
  12. package/build/components/block-list/index.js.map +1 -1
  13. package/build/components/block-list/use-block-props/index.js +3 -11
  14. package/build/components/block-list/use-block-props/index.js.map +1 -1
  15. package/build/components/block-list/use-block-props/use-zoom-out-mode-exit.js +9 -12
  16. package/build/components/block-list/use-block-props/use-zoom-out-mode-exit.js.map +1 -1
  17. package/build/components/block-list/use-in-between-inserter.js +5 -3
  18. package/build/components/block-list/use-in-between-inserter.js.map +1 -1
  19. package/build/components/block-list/zoom-out-separator.js +14 -6
  20. package/build/components/block-list/zoom-out-separator.js.map +1 -1
  21. package/build/components/block-navigation/dropdown.js +2 -4
  22. package/build/components/block-navigation/dropdown.js.map +1 -1
  23. package/build/components/block-parent-selector/index.js +13 -10
  24. package/build/components/block-parent-selector/index.js.map +1 -1
  25. package/build/components/block-pattern-setup/setup-toolbar.js +10 -20
  26. package/build/components/block-pattern-setup/setup-toolbar.js.map +1 -1
  27. package/build/components/block-patterns-paging/index.js +11 -13
  28. package/build/components/block-patterns-paging/index.js.map +1 -1
  29. package/build/components/block-quick-navigation/index.js +2 -4
  30. package/build/components/block-quick-navigation/index.js.map +1 -1
  31. package/build/components/block-settings-menu/block-settings-dropdown.js +79 -76
  32. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  33. package/build/components/block-settings-menu-controls/index.js +1 -6
  34. package/build/components/block-settings-menu-controls/index.js.map +1 -1
  35. package/build/components/block-switcher/index.js +17 -14
  36. package/build/components/block-switcher/index.js.map +1 -1
  37. package/build/components/block-toolbar/index.js +16 -19
  38. package/build/components/block-toolbar/index.js.map +1 -1
  39. package/build/components/block-toolbar/use-has-block-toolbar.js +3 -5
  40. package/build/components/block-toolbar/use-has-block-toolbar.js.map +1 -1
  41. package/build/components/block-tools/index.js +8 -11
  42. package/build/components/block-tools/index.js.map +1 -1
  43. package/build/components/block-tools/insertion-point.js +1 -4
  44. package/build/components/block-tools/insertion-point.js.map +1 -1
  45. package/build/components/block-tools/use-show-block-tools.js +2 -5
  46. package/build/components/block-tools/use-show-block-tools.js.map +1 -1
  47. package/build/components/block-tools/zoom-out-mode-inserter-button.js +1 -12
  48. package/build/components/block-tools/zoom-out-mode-inserter-button.js.map +1 -1
  49. package/build/components/block-tools/zoom-out-mode-inserters.js +14 -17
  50. package/build/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
  51. package/build/components/block-tools/zoom-out-toolbar.js +2 -12
  52. package/build/components/block-tools/zoom-out-toolbar.js.map +1 -1
  53. package/build/components/block-variation-picker/index.js +2 -4
  54. package/build/components/block-variation-picker/index.js.map +1 -1
  55. package/build/components/block-variation-transforms/index.js +3 -4
  56. package/build/components/block-variation-transforms/index.js.map +1 -1
  57. package/build/components/button-block-appender/index.js +2 -4
  58. package/build/components/button-block-appender/index.js.map +1 -1
  59. package/build/components/colors-gradients/dropdown.js +2 -4
  60. package/build/components/colors-gradients/dropdown.js.map +1 -1
  61. package/build/components/global-styles/border-panel.js +1 -1
  62. package/build/components/global-styles/border-panel.js.map +1 -1
  63. package/build/components/global-styles/color-panel.js +2 -4
  64. package/build/components/global-styles/color-panel.js.map +1 -1
  65. package/build/components/global-styles/dimensions-panel.js +3 -3
  66. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  67. package/build/components/global-styles/filters-panel.js +2 -4
  68. package/build/components/global-styles/filters-panel.js.map +1 -1
  69. package/build/components/global-styles/shadow-panel-components.js +24 -29
  70. package/build/components/global-styles/shadow-panel-components.js.map +1 -1
  71. package/build/components/inner-blocks/index.js +1 -9
  72. package/build/components/inner-blocks/index.js.map +1 -1
  73. package/build/components/inserter/block-types-tab.js +1 -1
  74. package/build/components/inserter/block-types-tab.js.map +1 -1
  75. package/build/components/inserter/hooks/use-block-types-state.js +24 -5
  76. package/build/components/inserter/hooks/use-block-types-state.js.map +1 -1
  77. package/build/components/inserter/hooks/use-insertion-point.js +22 -12
  78. package/build/components/inserter/hooks/use-insertion-point.js.map +1 -1
  79. package/build/components/inserter/hooks/use-patterns-state.js +23 -10
  80. package/build/components/inserter/hooks/use-patterns-state.js.map +1 -1
  81. package/build/components/inserter/media-tab/media-preview.js +35 -13
  82. package/build/components/inserter/media-tab/media-preview.js.map +1 -1
  83. package/build/components/inserter/menu.js +2 -2
  84. package/build/components/inserter/menu.js.map +1 -1
  85. package/build/components/inserter/mobile-tab-navigation.js +5 -5
  86. package/build/components/inserter/mobile-tab-navigation.js.map +1 -1
  87. package/build/components/inserter/quick-inserter.js +4 -4
  88. package/build/components/inserter/quick-inserter.js.map +1 -1
  89. package/build/components/inspector-controls-tabs/index.js +11 -8
  90. package/build/components/inspector-controls-tabs/index.js.map +1 -1
  91. package/build/components/inspector-popover-header/index.js +4 -8
  92. package/build/components/inspector-popover-header/index.js.map +1 -1
  93. package/build/components/link-control/index.js +5 -10
  94. package/build/components/link-control/index.js.map +1 -1
  95. package/build/components/link-control/settings-drawer.js +2 -4
  96. package/build/components/link-control/settings-drawer.js.map +1 -1
  97. package/build/components/list-view/block-contents.js +1 -25
  98. package/build/components/list-view/block-contents.js.map +1 -1
  99. package/build/components/list-view/block-select-button.js +1 -4
  100. package/build/components/list-view/block-select-button.js.map +1 -1
  101. package/build/components/media-placeholder/index.js +29 -43
  102. package/build/components/media-placeholder/index.js.map +1 -1
  103. package/build/components/rich-text/index.js +4 -8
  104. package/build/components/rich-text/index.js.map +1 -1
  105. package/build/components/skip-to-selected-block/index.js +2 -4
  106. package/build/components/skip-to-selected-block/index.js.map +1 -1
  107. package/build/components/tool-selector/index.js +13 -12
  108. package/build/components/tool-selector/index.js.map +1 -1
  109. package/build/components/url-input/button.js +14 -16
  110. package/build/components/url-input/button.js.map +1 -1
  111. package/build/components/url-input/index.js +2 -4
  112. package/build/components/url-input/index.js.map +1 -1
  113. package/build/components/use-block-commands/index.js +0 -61
  114. package/build/components/use-block-commands/index.js.map +1 -1
  115. package/build/components/writing-flow/use-tab-nav.js +2 -25
  116. package/build/components/writing-flow/use-tab-nav.js.map +1 -1
  117. package/build/hooks/block-bindings.js +6 -13
  118. package/build/hooks/block-bindings.js.map +1 -1
  119. package/build/hooks/duotone.js +4 -1
  120. package/build/hooks/duotone.js.map +1 -1
  121. package/build/hooks/layout-child.js +3 -1
  122. package/build/hooks/layout-child.js.map +1 -1
  123. package/build/hooks/position.js +3 -2
  124. package/build/hooks/position.js.map +1 -1
  125. package/build/hooks/use-bindings-attributes.js +5 -4
  126. package/build/hooks/use-bindings-attributes.js.map +1 -1
  127. package/build/layouts/flex.js +6 -38
  128. package/build/layouts/flex.js.map +1 -1
  129. package/build/private-apis.js +0 -2
  130. package/build/private-apis.js.map +1 -1
  131. package/build/store/actions.js +13 -14
  132. package/build/store/actions.js.map +1 -1
  133. package/build/store/private-actions.js +15 -0
  134. package/build/store/private-actions.js.map +1 -1
  135. package/build/store/private-selectors.js +104 -7
  136. package/build/store/private-selectors.js.map +1 -1
  137. package/build/store/reducer.js +22 -26
  138. package/build/store/reducer.js.map +1 -1
  139. package/build/store/selectors.js +127 -56
  140. package/build/store/selectors.js.map +1 -1
  141. package/build/store/utils.js +4 -3
  142. package/build/store/utils.js.map +1 -1
  143. package/build/utils/block-bindings.js +50 -0
  144. package/build/utils/block-bindings.js.map +1 -1
  145. package/build/utils/index.js +7 -0
  146. package/build/utils/index.js.map +1 -1
  147. package/build-module/autocompleters/link.js +2 -1
  148. package/build-module/autocompleters/link.js.map +1 -1
  149. package/build-module/components/block-actions/index.js +1 -13
  150. package/build-module/components/block-actions/index.js.map +1 -1
  151. package/build-module/components/block-inspector/index.js +57 -76
  152. package/build-module/components/block-inspector/index.js.map +1 -1
  153. package/build-module/components/block-list/block.js +5 -19
  154. package/build-module/components/block-list/block.js.map +1 -1
  155. package/build-module/components/block-list/index.js +5 -8
  156. package/build-module/components/block-list/index.js.map +1 -1
  157. package/build-module/components/block-list/use-block-props/index.js +3 -11
  158. package/build-module/components/block-list/use-block-props/index.js.map +1 -1
  159. package/build-module/components/block-list/use-block-props/use-zoom-out-mode-exit.js +9 -12
  160. package/build-module/components/block-list/use-block-props/use-zoom-out-mode-exit.js.map +1 -1
  161. package/build-module/components/block-list/use-in-between-inserter.js +5 -3
  162. package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
  163. package/build-module/components/block-list/zoom-out-separator.js +14 -6
  164. package/build-module/components/block-list/zoom-out-separator.js.map +1 -1
  165. package/build-module/components/block-navigation/dropdown.js +2 -4
  166. package/build-module/components/block-navigation/dropdown.js.map +1 -1
  167. package/build-module/components/block-parent-selector/index.js +13 -10
  168. package/build-module/components/block-parent-selector/index.js.map +1 -1
  169. package/build-module/components/block-pattern-setup/setup-toolbar.js +10 -20
  170. package/build-module/components/block-pattern-setup/setup-toolbar.js.map +1 -1
  171. package/build-module/components/block-patterns-paging/index.js +11 -13
  172. package/build-module/components/block-patterns-paging/index.js.map +1 -1
  173. package/build-module/components/block-quick-navigation/index.js +2 -4
  174. package/build-module/components/block-quick-navigation/index.js.map +1 -1
  175. package/build-module/components/block-settings-menu/block-settings-dropdown.js +79 -76
  176. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  177. package/build-module/components/block-settings-menu-controls/index.js +2 -7
  178. package/build-module/components/block-settings-menu-controls/index.js.map +1 -1
  179. package/build-module/components/block-switcher/index.js +17 -14
  180. package/build-module/components/block-switcher/index.js.map +1 -1
  181. package/build-module/components/block-toolbar/index.js +17 -20
  182. package/build-module/components/block-toolbar/index.js.map +1 -1
  183. package/build-module/components/block-toolbar/use-has-block-toolbar.js +3 -5
  184. package/build-module/components/block-toolbar/use-has-block-toolbar.js.map +1 -1
  185. package/build-module/components/block-tools/index.js +8 -11
  186. package/build-module/components/block-tools/index.js.map +1 -1
  187. package/build-module/components/block-tools/insertion-point.js +1 -4
  188. package/build-module/components/block-tools/insertion-point.js.map +1 -1
  189. package/build-module/components/block-tools/use-show-block-tools.js +2 -5
  190. package/build-module/components/block-tools/use-show-block-tools.js.map +1 -1
  191. package/build-module/components/block-tools/zoom-out-mode-inserter-button.js +1 -12
  192. package/build-module/components/block-tools/zoom-out-mode-inserter-button.js.map +1 -1
  193. package/build-module/components/block-tools/zoom-out-mode-inserters.js +14 -17
  194. package/build-module/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
  195. package/build-module/components/block-tools/zoom-out-toolbar.js +2 -12
  196. package/build-module/components/block-tools/zoom-out-toolbar.js.map +1 -1
  197. package/build-module/components/block-variation-picker/index.js +2 -4
  198. package/build-module/components/block-variation-picker/index.js.map +1 -1
  199. package/build-module/components/block-variation-transforms/index.js +3 -4
  200. package/build-module/components/block-variation-transforms/index.js.map +1 -1
  201. package/build-module/components/button-block-appender/index.js +2 -4
  202. package/build-module/components/button-block-appender/index.js.map +1 -1
  203. package/build-module/components/colors-gradients/dropdown.js +2 -4
  204. package/build-module/components/colors-gradients/dropdown.js.map +1 -1
  205. package/build-module/components/global-styles/border-panel.js +1 -1
  206. package/build-module/components/global-styles/border-panel.js.map +1 -1
  207. package/build-module/components/global-styles/color-panel.js +2 -4
  208. package/build-module/components/global-styles/color-panel.js.map +1 -1
  209. package/build-module/components/global-styles/dimensions-panel.js +1 -1
  210. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  211. package/build-module/components/global-styles/filters-panel.js +2 -4
  212. package/build-module/components/global-styles/filters-panel.js.map +1 -1
  213. package/build-module/components/global-styles/shadow-panel-components.js +25 -30
  214. package/build-module/components/global-styles/shadow-panel-components.js.map +1 -1
  215. package/build-module/components/inner-blocks/index.js +1 -9
  216. package/build-module/components/inner-blocks/index.js.map +1 -1
  217. package/build-module/components/inserter/block-types-tab.js +1 -1
  218. package/build-module/components/inserter/block-types-tab.js.map +1 -1
  219. package/build-module/components/inserter/hooks/use-block-types-state.js +27 -8
  220. package/build-module/components/inserter/hooks/use-block-types-state.js.map +1 -1
  221. package/build-module/components/inserter/hooks/use-insertion-point.js +22 -12
  222. package/build-module/components/inserter/hooks/use-insertion-point.js.map +1 -1
  223. package/build-module/components/inserter/hooks/use-patterns-state.js +23 -10
  224. package/build-module/components/inserter/hooks/use-patterns-state.js.map +1 -1
  225. package/build-module/components/inserter/media-tab/media-preview.js +35 -13
  226. package/build-module/components/inserter/media-tab/media-preview.js.map +1 -1
  227. package/build-module/components/inserter/menu.js +2 -2
  228. package/build-module/components/inserter/menu.js.map +1 -1
  229. package/build-module/components/inserter/mobile-tab-navigation.js +6 -6
  230. package/build-module/components/inserter/mobile-tab-navigation.js.map +1 -1
  231. package/build-module/components/inserter/quick-inserter.js +4 -4
  232. package/build-module/components/inserter/quick-inserter.js.map +1 -1
  233. package/build-module/components/inspector-controls-tabs/index.js +12 -9
  234. package/build-module/components/inspector-controls-tabs/index.js.map +1 -1
  235. package/build-module/components/inspector-popover-header/index.js +4 -8
  236. package/build-module/components/inspector-popover-header/index.js.map +1 -1
  237. package/build-module/components/link-control/index.js +5 -10
  238. package/build-module/components/link-control/index.js.map +1 -1
  239. package/build-module/components/link-control/settings-drawer.js +2 -4
  240. package/build-module/components/link-control/settings-drawer.js.map +1 -1
  241. package/build-module/components/list-view/block-contents.js +1 -25
  242. package/build-module/components/list-view/block-contents.js.map +1 -1
  243. package/build-module/components/list-view/block-select-button.js +2 -5
  244. package/build-module/components/list-view/block-select-button.js.map +1 -1
  245. package/build-module/components/media-placeholder/index.js +30 -44
  246. package/build-module/components/media-placeholder/index.js.map +1 -1
  247. package/build-module/components/rich-text/index.js +4 -8
  248. package/build-module/components/rich-text/index.js.map +1 -1
  249. package/build-module/components/skip-to-selected-block/index.js +2 -4
  250. package/build-module/components/skip-to-selected-block/index.js.map +1 -1
  251. package/build-module/components/tool-selector/index.js +13 -12
  252. package/build-module/components/tool-selector/index.js.map +1 -1
  253. package/build-module/components/url-input/button.js +15 -17
  254. package/build-module/components/url-input/button.js.map +1 -1
  255. package/build-module/components/url-input/index.js +2 -4
  256. package/build-module/components/url-input/index.js.map +1 -1
  257. package/build-module/components/use-block-commands/index.js +1 -62
  258. package/build-module/components/use-block-commands/index.js.map +1 -1
  259. package/build-module/components/writing-flow/use-tab-nav.js +3 -26
  260. package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
  261. package/build-module/hooks/block-bindings.js +6 -13
  262. package/build-module/hooks/block-bindings.js.map +1 -1
  263. package/build-module/hooks/duotone.js +4 -1
  264. package/build-module/hooks/duotone.js.map +1 -1
  265. package/build-module/hooks/layout-child.js +4 -1
  266. package/build-module/hooks/layout-child.js.map +1 -1
  267. package/build-module/hooks/position.js +4 -1
  268. package/build-module/hooks/position.js.map +1 -1
  269. package/build-module/hooks/use-bindings-attributes.js +5 -4
  270. package/build-module/hooks/use-bindings-attributes.js.map +1 -1
  271. package/build-module/layouts/flex.js +7 -39
  272. package/build-module/layouts/flex.js.map +1 -1
  273. package/build-module/private-apis.js +0 -2
  274. package/build-module/private-apis.js.map +1 -1
  275. package/build-module/store/actions.js +12 -12
  276. package/build-module/store/actions.js.map +1 -1
  277. package/build-module/store/private-actions.js +14 -0
  278. package/build-module/store/private-actions.js.map +1 -1
  279. package/build-module/store/private-selectors.js +98 -7
  280. package/build-module/store/private-selectors.js.map +1 -1
  281. package/build-module/store/reducer.js +21 -25
  282. package/build-module/store/reducer.js.map +1 -1
  283. package/build-module/store/selectors.js +129 -58
  284. package/build-module/store/selectors.js.map +1 -1
  285. package/build-module/store/utils.js +3 -2
  286. package/build-module/store/utils.js.map +1 -1
  287. package/build-module/utils/block-bindings.js +50 -0
  288. package/build-module/utils/block-bindings.js.map +1 -1
  289. package/build-module/utils/index.js +1 -0
  290. package/build-module/utils/index.js.map +1 -1
  291. package/build-style/content-rtl.css +16 -70
  292. package/build-style/content.css +16 -70
  293. package/build-style/default-editor-styles-rtl.css +10 -1
  294. package/build-style/default-editor-styles.css +10 -1
  295. package/build-style/style-rtl.css +51 -149
  296. package/build-style/style.css +51 -149
  297. package/package.json +32 -32
  298. package/src/autocompleters/link.js +2 -1
  299. package/src/components/block-actions/index.js +1 -13
  300. package/src/components/block-draggable/style.scss +2 -2
  301. package/src/components/block-inspector/index.js +79 -95
  302. package/src/components/block-inspector/style.scss +2 -0
  303. package/src/components/block-list/block.js +7 -28
  304. package/src/components/block-list/content.scss +1 -61
  305. package/src/components/block-list/index.js +21 -29
  306. package/src/components/block-list/use-block-props/index.js +3 -10
  307. package/src/components/block-list/use-block-props/use-zoom-out-mode-exit.js +19 -11
  308. package/src/components/block-list/use-in-between-inserter.js +5 -2
  309. package/src/components/block-list/zoom-out-separator.js +24 -8
  310. package/src/components/block-navigation/dropdown.js +1 -2
  311. package/src/components/block-parent-selector/index.js +13 -10
  312. package/src/components/block-pattern-setup/setup-toolbar.js +5 -10
  313. package/src/components/block-patterns-paging/index.js +8 -7
  314. package/src/components/block-patterns-paging/style.scss +10 -27
  315. package/src/components/block-quick-navigation/index.js +1 -2
  316. package/src/components/block-settings-menu/block-settings-dropdown.js +120 -106
  317. package/src/components/block-settings-menu-controls/index.js +0 -15
  318. package/src/components/block-switcher/index.js +37 -30
  319. package/src/components/block-toolbar/index.js +22 -34
  320. package/src/components/block-toolbar/style.scss +10 -1
  321. package/src/components/block-toolbar/use-has-block-toolbar.js +19 -31
  322. package/src/components/block-tools/index.js +7 -16
  323. package/src/components/block-tools/insertion-point.js +1 -4
  324. package/src/components/block-tools/style.scss +3 -88
  325. package/src/components/block-tools/use-show-block-tools.js +2 -12
  326. package/src/components/block-tools/zoom-out-mode-inserter-button.js +2 -17
  327. package/src/components/block-tools/zoom-out-mode-inserters.js +11 -19
  328. package/src/components/block-tools/zoom-out-toolbar.js +2 -13
  329. package/src/components/block-variation-picker/index.js +1 -2
  330. package/src/components/block-variation-transforms/index.js +2 -2
  331. package/src/components/button-block-appender/content.scss +0 -5
  332. package/src/components/button-block-appender/index.js +1 -2
  333. package/src/components/colors-gradients/dropdown.js +1 -5
  334. package/src/components/font-family/README.md +5 -1
  335. package/src/components/global-styles/border-panel.js +1 -1
  336. package/src/components/global-styles/color-panel.js +1 -5
  337. package/src/components/global-styles/dimensions-panel.js +1 -1
  338. package/src/components/global-styles/filters-panel.js +1 -2
  339. package/src/components/global-styles/shadow-panel-components.js +28 -33
  340. package/src/components/global-styles/style.scss +5 -0
  341. package/src/components/inner-blocks/index.js +1 -16
  342. package/src/components/inserter/block-types-tab.js +1 -1
  343. package/src/components/inserter/hooks/use-block-types-state.js +34 -14
  344. package/src/components/inserter/hooks/use-insertion-point.js +35 -13
  345. package/src/components/inserter/hooks/use-patterns-state.js +46 -9
  346. package/src/components/inserter/media-tab/media-preview.js +38 -12
  347. package/src/components/inserter/menu.js +2 -2
  348. package/src/components/inserter/mobile-tab-navigation.js +10 -13
  349. package/src/components/inserter/quick-inserter.js +5 -4
  350. package/src/components/inserter/style.scss +0 -28
  351. package/src/components/inspector-controls-tabs/index.js +21 -20
  352. package/src/components/inspector-controls-tabs/style.scss +2 -6
  353. package/src/components/inspector-popover-header/index.js +2 -4
  354. package/src/components/inspector-popover-header/style.scss +0 -13
  355. package/src/components/link-control/index.js +2 -5
  356. package/src/components/link-control/settings-drawer.js +1 -2
  357. package/src/components/list-view/block-contents.js +1 -28
  358. package/src/components/list-view/block-select-button.js +2 -5
  359. package/src/components/list-view/style.scss +18 -14
  360. package/src/components/media-placeholder/content.scss +3 -19
  361. package/src/components/media-placeholder/index.js +23 -29
  362. package/src/components/rich-text/index.js +4 -13
  363. package/src/components/skip-to-selected-block/index.js +1 -2
  364. package/src/components/skip-to-selected-block/style.scss +0 -9
  365. package/src/components/tool-selector/index.js +14 -9
  366. package/src/components/tool-selector/style.scss +5 -0
  367. package/src/components/url-input/button.js +16 -12
  368. package/src/components/url-input/index.js +1 -2
  369. package/src/components/url-input/style.scss +0 -6
  370. package/src/components/use-block-commands/index.js +0 -58
  371. package/src/components/writing-flow/use-tab-nav.js +4 -36
  372. package/src/content.scss +0 -1
  373. package/src/hooks/block-bindings.js +9 -10
  374. package/src/hooks/duotone.js +4 -1
  375. package/src/hooks/layout-child.js +4 -1
  376. package/src/hooks/position.js +4 -1
  377. package/src/hooks/use-bindings-attributes.js +66 -63
  378. package/src/layouts/flex.js +10 -53
  379. package/src/private-apis.js +0 -2
  380. package/src/store/actions.js +14 -13
  381. package/src/store/private-actions.js +14 -0
  382. package/src/store/private-selectors.js +120 -16
  383. package/src/store/reducer.js +22 -28
  384. package/src/store/selectors.js +203 -114
  385. package/src/store/test/private-actions.js +15 -0
  386. package/src/store/test/private-selectors.js +34 -0
  387. package/src/store/test/reducer.js +40 -4
  388. package/src/store/test/selectors.js +183 -20
  389. package/src/store/utils.js +4 -2
  390. package/src/utils/block-bindings.js +49 -0
  391. package/src/utils/index.js +1 -0
  392. package/build/components/block-controls/use-has-block-controls.js +0 -43
  393. package/build/components/block-controls/use-has-block-controls.js.map +0 -1
  394. package/build/components/block-list/use-block-props/use-nav-mode-exit.js +0 -54
  395. package/build/components/block-list/use-block-props/use-nav-mode-exit.js.map +0 -1
  396. package/build/components/block-tools/block-selection-button.js +0 -259
  397. package/build/components/block-tools/block-selection-button.js.map +0 -1
  398. package/build/components/block-tools/block-toolbar-breadcrumb.js +0 -57
  399. package/build/components/block-tools/block-toolbar-breadcrumb.js.map +0 -1
  400. package/build/components/inserter/tabs.js +0 -78
  401. package/build/components/inserter/tabs.js.map +0 -1
  402. package/build-module/components/block-controls/use-has-block-controls.js +0 -34
  403. package/build-module/components/block-controls/use-has-block-controls.js.map +0 -1
  404. package/build-module/components/block-list/use-block-props/use-nav-mode-exit.js +0 -48
  405. package/build-module/components/block-list/use-block-props/use-nav-mode-exit.js.map +0 -1
  406. package/build-module/components/block-tools/block-selection-button.js +0 -254
  407. package/build-module/components/block-tools/block-selection-button.js.map +0 -1
  408. package/build-module/components/block-tools/block-toolbar-breadcrumb.js +0 -49
  409. package/build-module/components/block-tools/block-toolbar-breadcrumb.js.map +0 -1
  410. package/build-module/components/inserter/tabs.js +0 -72
  411. package/build-module/components/inserter/tabs.js.map +0 -1
  412. package/src/components/block-controls/use-has-block-controls.js +0 -35
  413. package/src/components/block-list/use-block-props/use-nav-mode-exit.js +0 -46
  414. package/src/components/block-tools/block-selection-button.js +0 -302
  415. package/src/components/block-tools/block-toolbar-breadcrumb.js +0 -51
  416. package/src/components/inner-blocks/content.scss +0 -13
  417. package/src/components/inserter/tabs.js +0 -78
  418. package/src/components/inserter/test/block-types-tab.native.js +0 -67
@@ -1 +1 @@
1
- {"version":3,"names":["Platform","store","blockEditorStore","unlock","castArray","maybeArray","Array","isArray","privateSettings","__experimentalUpdateSettings","settings","stripExperimentalSettings","reset","cleanSettings","OS","key","includes","type","hideBlockInterface","showBlockInterface","privateRemoveBlocks","clientIds","selectPrevious","forceRemove","select","dispatch","registry","length","canRemoveBlocks","rules","getBlockRemovalRules","flattenBlocks","blocks","result","stack","innerBlocks","block","shift","push","blockList","map","getBlock","flattenedBlocks","message","rule","callback","displayBlockRemovalPrompt","selectPreviousBlock","batch","ensureDefaultBlock","count","getBlockCount","__unstableHasCustomAppender","getSettings","insertDefaultBlock","clearBlockRemovalPrompt","setBlockRemovalRules","setOpenedBlockSettingsMenu","clientId","setStyleOverride","id","style","deleteStyleOverride","setLastFocus","lastFocus","stopEditingAsBlocks","focusModeToRevert","getTemporarilyEditingFocusModeToRevert","__unstableMarkNextChangeAsNotPersistent","updateBlockAttributes","templateLock","updateBlockListSettings","getBlockListSettings","updateSettings","focusMode","__unstableSetTemporarilyEditingAsBlocks","startDragging","stopDragging","expandBlock","modifyContentLockBlock","selectBlock","undefined","setZoomLevel","zoom","resetZoomLevel"],"sources":["@wordpress/block-editor/src/store/private-actions.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Platform } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from './index';\nimport { unlock } from '../lock-unlock';\n\nconst castArray = ( maybeArray ) =>\n\tArray.isArray( maybeArray ) ? maybeArray : [ maybeArray ];\n\n/**\n * A list of private/experimental block editor settings that\n * should not become a part of the WordPress public API.\n * BlockEditorProvider will remove these settings from the\n * settings object it receives.\n *\n * @see https://github.com/WordPress/gutenberg/pull/46131\n */\nconst privateSettings = [\n\t'inserterMediaCategories',\n\t'blockInspectorAnimation',\n];\n\n/**\n * Action that updates the block editor settings and\n * conditionally preserves the experimental ones.\n *\n * @param {Object} settings Updated settings\n * @param {Object} options Options object.\n * @param {boolean} options.stripExperimentalSettings Whether to strip experimental settings.\n * @param {boolean} options.reset Whether to reset the settings.\n * @return {Object} Action object\n */\nexport function __experimentalUpdateSettings(\n\tsettings,\n\t{ stripExperimentalSettings = false, reset = false } = {}\n) {\n\tlet cleanSettings = settings;\n\t// There are no plugins in the mobile apps, so there is no\n\t// need to strip the experimental settings:\n\tif ( stripExperimentalSettings && Platform.OS === 'web' ) {\n\t\tcleanSettings = {};\n\t\tfor ( const key in settings ) {\n\t\t\tif ( ! privateSettings.includes( key ) ) {\n\t\t\t\tcleanSettings[ key ] = settings[ key ];\n\t\t\t}\n\t\t}\n\t}\n\treturn {\n\t\ttype: 'UPDATE_SETTINGS',\n\t\tsettings: cleanSettings,\n\t\treset,\n\t};\n}\n\n/**\n * Hides the block interface (eg. toolbar, outline, etc.)\n *\n * @return {Object} Action object.\n */\nexport function hideBlockInterface() {\n\treturn {\n\t\ttype: 'HIDE_BLOCK_INTERFACE',\n\t};\n}\n\n/**\n * Shows the block interface (eg. toolbar, outline, etc.)\n *\n * @return {Object} Action object.\n */\nexport function showBlockInterface() {\n\treturn {\n\t\ttype: 'SHOW_BLOCK_INTERFACE',\n\t};\n}\n\n/**\n * Yields action objects used in signalling that the blocks corresponding to\n * the set of specified client IDs are to be removed.\n *\n * Compared to `removeBlocks`, this private interface exposes an additional\n * parameter; see `forceRemove`.\n *\n * @param {string|string[]} clientIds Client IDs of blocks to remove.\n * @param {boolean} selectPrevious True if the previous block\n * or the immediate parent\n * (if no previous block exists)\n * should be selected\n * when a block is removed.\n * @param {boolean} forceRemove Whether to force the operation,\n * bypassing any checks for certain\n * block types.\n */\nexport const privateRemoveBlocks =\n\t( clientIds, selectPrevious = true, forceRemove = false ) =>\n\t( { select, dispatch, registry } ) => {\n\t\tif ( ! clientIds || ! clientIds.length ) {\n\t\t\treturn;\n\t\t}\n\n\t\tclientIds = castArray( clientIds );\n\t\tconst canRemoveBlocks = select.canRemoveBlocks( clientIds );\n\n\t\tif ( ! canRemoveBlocks ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// In certain editing contexts, we'd like to prevent accidental removal\n\t\t// of important blocks. For example, in the site editor, the Query Loop\n\t\t// block is deemed important. In such cases, we'll ask the user for\n\t\t// confirmation that they intended to remove such block(s). However,\n\t\t// the editor instance is responsible for presenting those confirmation\n\t\t// prompts to the user. Any instance opting into removal prompts must\n\t\t// register using `setBlockRemovalRules()`.\n\t\t//\n\t\t// @see https://github.com/WordPress/gutenberg/pull/51145\n\t\tconst rules = ! forceRemove && select.getBlockRemovalRules();\n\n\t\tif ( rules ) {\n\t\t\tfunction flattenBlocks( blocks ) {\n\t\t\t\tconst result = [];\n\t\t\t\tconst stack = [ ...blocks ];\n\t\t\t\twhile ( stack.length ) {\n\t\t\t\t\tconst { innerBlocks, ...block } = stack.shift();\n\t\t\t\t\tstack.push( ...innerBlocks );\n\t\t\t\t\tresult.push( block );\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tconst blockList = clientIds.map( select.getBlock );\n\t\t\tconst flattenedBlocks = flattenBlocks( blockList );\n\n\t\t\t// Find the first message and use it.\n\t\t\tlet message;\n\t\t\tfor ( const rule of rules ) {\n\t\t\t\tmessage = rule.callback( flattenedBlocks );\n\t\t\t\tif ( message ) {\n\t\t\t\t\tdispatch(\n\t\t\t\t\t\tdisplayBlockRemovalPrompt(\n\t\t\t\t\t\t\tclientIds,\n\t\t\t\t\t\t\tselectPrevious,\n\t\t\t\t\t\t\tmessage\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( selectPrevious ) {\n\t\t\tdispatch.selectPreviousBlock( clientIds[ 0 ], selectPrevious );\n\t\t}\n\n\t\t// We're batching these two actions because an extra `undo/redo` step can\n\t\t// be created, based on whether we insert a default block or not.\n\t\tregistry.batch( () => {\n\t\t\tdispatch( { type: 'REMOVE_BLOCKS', clientIds } );\n\t\t\t// To avoid a focus loss when removing the last block, assure there is\n\t\t\t// always a default block if the last of the blocks have been removed.\n\t\t\tdispatch( ensureDefaultBlock() );\n\t\t} );\n\t};\n\n/**\n * Action which will insert a default block insert action if there\n * are no other blocks at the root of the editor. This action should be used\n * in actions which may result in no blocks remaining in the editor (removal,\n * replacement, etc).\n */\nexport const ensureDefaultBlock =\n\t() =>\n\t( { select, dispatch } ) => {\n\t\t// To avoid a focus loss when removing the last block, assure there is\n\t\t// always a default block if the last of the blocks have been removed.\n\t\tconst count = select.getBlockCount();\n\t\tif ( count > 0 ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If there's an custom appender, don't insert default block.\n\t\t// We have to remember to manually move the focus elsewhere to\n\t\t// prevent it from being lost though.\n\t\tconst { __unstableHasCustomAppender } = select.getSettings();\n\t\tif ( __unstableHasCustomAppender ) {\n\t\t\treturn;\n\t\t}\n\n\t\tdispatch.insertDefaultBlock();\n\t};\n\n/**\n * Returns an action object used in signalling that a block removal prompt must\n * be displayed.\n *\n * Contrast with `setBlockRemovalRules`.\n *\n * @param {string|string[]} clientIds Client IDs of blocks to remove.\n * @param {boolean} selectPrevious True if the previous block or the\n * immediate parent (if no previous\n * block exists) should be selected\n * when a block is removed.\n * @param {string} message Message to display in the prompt.\n *\n * @return {Object} Action object.\n */\nfunction displayBlockRemovalPrompt( clientIds, selectPrevious, message ) {\n\treturn {\n\t\ttype: 'DISPLAY_BLOCK_REMOVAL_PROMPT',\n\t\tclientIds,\n\t\tselectPrevious,\n\t\tmessage,\n\t};\n}\n\n/**\n * Returns an action object used in signalling that a block removal prompt must\n * be cleared, either be cause the user has confirmed or canceled the request\n * for removal.\n *\n * @return {Object} Action object.\n */\nexport function clearBlockRemovalPrompt() {\n\treturn {\n\t\ttype: 'CLEAR_BLOCK_REMOVAL_PROMPT',\n\t};\n}\n\n/**\n * Returns an action object used to set up any rules that a block editor may\n * provide in order to prevent a user from accidentally removing certain\n * blocks. These rules are then used to display a confirmation prompt to the\n * user. For instance, in the Site Editor, the Query Loop block is important\n * enough to warrant such confirmation.\n *\n * IMPORTANT: Registering rules implicitly signals to the `privateRemoveBlocks`\n * action that the editor will be responsible for displaying block removal\n * prompts and confirming deletions. This action is meant to be used by\n * component `BlockRemovalWarningModal` only.\n *\n * The data is a record whose keys are block types (e.g. 'core/query') and\n * whose values are the explanation to be shown to users (e.g. 'Query Loop\n * displays a list of posts or pages.').\n *\n * Contrast with `displayBlockRemovalPrompt`.\n *\n * @param {Record<string,string>|false} rules Block removal rules.\n * @return {Object} Action object.\n */\nexport function setBlockRemovalRules( rules = false ) {\n\treturn {\n\t\ttype: 'SET_BLOCK_REMOVAL_RULES',\n\t\trules,\n\t};\n}\n\n/**\n * Sets the client ID of the block settings menu that is currently open.\n *\n * @param {?string} clientId The block client ID.\n * @return {Object} Action object.\n */\nexport function setOpenedBlockSettingsMenu( clientId ) {\n\treturn {\n\t\ttype: 'SET_OPENED_BLOCK_SETTINGS_MENU',\n\t\tclientId,\n\t};\n}\n\nexport function setStyleOverride( id, style ) {\n\treturn {\n\t\ttype: 'SET_STYLE_OVERRIDE',\n\t\tid,\n\t\tstyle,\n\t};\n}\n\nexport function deleteStyleOverride( id ) {\n\treturn {\n\t\ttype: 'DELETE_STYLE_OVERRIDE',\n\t\tid,\n\t};\n}\n\n/**\n * Action that sets the element that had focus when focus leaves the editor canvas.\n *\n * @param {Object} lastFocus The last focused element.\n *\n *\n * @return {Object} Action object.\n */\nexport function setLastFocus( lastFocus = null ) {\n\treturn {\n\t\ttype: 'LAST_FOCUS',\n\t\tlastFocus,\n\t};\n}\n\n/**\n * Action that stops temporarily editing as blocks.\n *\n * @param {string} clientId The block's clientId.\n */\nexport function stopEditingAsBlocks( clientId ) {\n\treturn ( { select, dispatch, registry } ) => {\n\t\tconst focusModeToRevert = unlock(\n\t\t\tregistry.select( blockEditorStore )\n\t\t).getTemporarilyEditingFocusModeToRevert();\n\t\tdispatch.__unstableMarkNextChangeAsNotPersistent();\n\t\tdispatch.updateBlockAttributes( clientId, {\n\t\t\ttemplateLock: 'contentOnly',\n\t\t} );\n\t\tdispatch.updateBlockListSettings( clientId, {\n\t\t\t...select.getBlockListSettings( clientId ),\n\t\t\ttemplateLock: 'contentOnly',\n\t\t} );\n\t\tdispatch.updateSettings( { focusMode: focusModeToRevert } );\n\t\tdispatch.__unstableSetTemporarilyEditingAsBlocks();\n\t};\n}\n\n/**\n * Returns an action object used in signalling that the user has begun to drag.\n *\n * @return {Object} Action object.\n */\nexport function startDragging() {\n\treturn {\n\t\ttype: 'START_DRAGGING',\n\t};\n}\n\n/**\n * Returns an action object used in signalling that the user has stopped dragging.\n *\n * @return {Object} Action object.\n */\nexport function stopDragging() {\n\treturn {\n\t\ttype: 'STOP_DRAGGING',\n\t};\n}\n\n/**\n * @param {string|null} clientId The block's clientId, or `null` to clear.\n *\n * @return {Object} Action object.\n */\nexport function expandBlock( clientId ) {\n\treturn {\n\t\ttype: 'SET_BLOCK_EXPANDED_IN_LIST_VIEW',\n\t\tclientId,\n\t};\n}\n\n/**\n * Temporarily modify/unlock the content-only block for editions.\n *\n * @param {string} clientId The client id of the block.\n */\nexport const modifyContentLockBlock =\n\t( clientId ) =>\n\t( { select, dispatch } ) => {\n\t\tdispatch.selectBlock( clientId );\n\t\tdispatch.__unstableMarkNextChangeAsNotPersistent();\n\t\tdispatch.updateBlockAttributes( clientId, {\n\t\t\ttemplateLock: undefined,\n\t\t} );\n\t\tdispatch.updateBlockListSettings( clientId, {\n\t\t\t...select.getBlockListSettings( clientId ),\n\t\t\ttemplateLock: false,\n\t\t} );\n\t\tconst focusModeToRevert = select.getSettings().focusMode;\n\t\tdispatch.updateSettings( { focusMode: true } );\n\t\tdispatch.__unstableSetTemporarilyEditingAsBlocks(\n\t\t\tclientId,\n\t\t\tfocusModeToRevert\n\t\t);\n\t};\n\n/**\n * Sets the zoom level.\n *\n * @param {number} zoom the new zoom level\n * @return {Object} Action object.\n */\nexport function setZoomLevel( zoom = 100 ) {\n\treturn {\n\t\ttype: 'SET_ZOOM_LEVEL',\n\t\tzoom,\n\t};\n}\n\n/**\n * Resets the Zoom state.\n * @return {Object} Action object.\n */\nexport function resetZoomLevel() {\n\treturn {\n\t\ttype: 'RESET_ZOOM_LEVEL',\n\t};\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,QAAQ,QAAQ,oBAAoB;;AAE7C;AACA;AACA;AACA,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,SAAS;AACnD,SAASC,MAAM,QAAQ,gBAAgB;AAEvC,MAAMC,SAAS,GAAKC,UAAU,IAC7BC,KAAK,CAACC,OAAO,CAAEF,UAAW,CAAC,GAAGA,UAAU,GAAG,CAAEA,UAAU,CAAE;;AAE1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMG,eAAe,GAAG,CACvB,yBAAyB,EACzB,yBAAyB,CACzB;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,4BAA4BA,CAC3CC,QAAQ,EACR;EAAEC,yBAAyB,GAAG,KAAK;EAAEC,KAAK,GAAG;AAAM,CAAC,GAAG,CAAC,CAAC,EACxD;EACD,IAAIC,aAAa,GAAGH,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AAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMqB,sBAAsB,GAChCrB,QAAQ,IACV,CAAE;EAAElC,MAAM;EAAEC;AAAS,CAAC,KAAM;EAC3BA,QAAQ,CAACuD,WAAW,CAAEtB,QAAS,CAAC;EAChCjC,QAAQ,CAAC2C,uCAAuC,CAAC,CAAC;EAClD3C,QAAQ,CAAC4C,qBAAqB,CAAEX,QAAQ,EAAE;IACzCY,YAAY,EAAEW;EACf,CAAE,CAAC;EACHxD,QAAQ,CAAC8C,uBAAuB,CAAEb,QAAQ,EAAE;IAC3C,GAAGlC,MAAM,CAACgD,oBAAoB,CAAEd,QAAS,CAAC;IAC1CY,YAAY,EAAE;EACf,CAAE,CAAC;EACH,MAAMJ,iBAAiB,GAAG1C,MAAM,CAAC6B,WAAW,CAAC,CAAC,CAACqB,SAAS;EACxDjD,QAAQ,CAACgD,cAAc,CAAE;IAAEC,SAAS,EAAE;EAAK,CAAE,CAAC;EAC9CjD,QAAQ,CAACkD,uCAAuC,CAC/CjB,QAAQ,EACRQ,iBACD,CAAC;AACF,CAAC;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASgB,YAAYA,CAAEC,IAAI,GAAG,GAAG,EAAG;EAC1C,OAAO;IACNlE,IAAI,EAAE,gBAAgB;IACtBkE;EACD,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASC,cAAcA,CAAA,EAAG;EAChC,OAAO;IACNnE,IAAI,EAAE;EACP,CAAC;AACF","ignoreList":[]}
1
+ {"version":3,"names":["Platform","store","blockEditorStore","unlock","castArray","maybeArray","Array","isArray","privateSettings","__experimentalUpdateSettings","settings","stripExperimentalSettings","reset","cleanSettings","OS","key","includes","type","hideBlockInterface","showBlockInterface","privateRemoveBlocks","clientIds","selectPrevious","forceRemove","select","dispatch","registry","length","canRemoveBlocks","rules","getBlockRemovalRules","flattenBlocks","blocks","result","stack","innerBlocks","block","shift","push","blockList","map","getBlock","flattenedBlocks","message","rule","callback","displayBlockRemovalPrompt","selectPreviousBlock","batch","ensureDefaultBlock","count","getBlockCount","__unstableHasCustomAppender","getSettings","insertDefaultBlock","clearBlockRemovalPrompt","setBlockRemovalRules","setOpenedBlockSettingsMenu","clientId","setStyleOverride","id","style","deleteStyleOverride","setLastFocus","lastFocus","stopEditingAsBlocks","focusModeToRevert","getTemporarilyEditingFocusModeToRevert","__unstableMarkNextChangeAsNotPersistent","updateBlockAttributes","templateLock","updateBlockListSettings","getBlockListSettings","updateSettings","focusMode","__unstableSetTemporarilyEditingAsBlocks","startDragging","stopDragging","expandBlock","setInsertionPoint","value","modifyContentLockBlock","selectBlock","undefined","setZoomLevel","zoom","resetZoomLevel"],"sources":["@wordpress/block-editor/src/store/private-actions.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Platform } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from './index';\nimport { unlock } from '../lock-unlock';\n\nconst castArray = ( maybeArray ) =>\n\tArray.isArray( maybeArray ) ? maybeArray : [ maybeArray ];\n\n/**\n * A list of private/experimental block editor settings that\n * should not become a part of the WordPress public API.\n * BlockEditorProvider will remove these settings from the\n * settings object it receives.\n *\n * @see https://github.com/WordPress/gutenberg/pull/46131\n */\nconst privateSettings = [\n\t'inserterMediaCategories',\n\t'blockInspectorAnimation',\n];\n\n/**\n * Action that updates the block editor settings and\n * conditionally preserves the experimental ones.\n *\n * @param {Object} settings Updated settings\n * @param {Object} options Options object.\n * @param {boolean} options.stripExperimentalSettings Whether to strip experimental settings.\n * @param {boolean} options.reset Whether to reset the settings.\n * @return {Object} Action object\n */\nexport function __experimentalUpdateSettings(\n\tsettings,\n\t{ stripExperimentalSettings = false, reset = false } = {}\n) {\n\tlet cleanSettings = settings;\n\t// There are no plugins in the mobile apps, so there is no\n\t// need to strip the experimental settings:\n\tif ( stripExperimentalSettings && Platform.OS === 'web' ) {\n\t\tcleanSettings = {};\n\t\tfor ( const key in settings ) {\n\t\t\tif ( ! privateSettings.includes( key ) ) {\n\t\t\t\tcleanSettings[ key ] = settings[ key ];\n\t\t\t}\n\t\t}\n\t}\n\treturn {\n\t\ttype: 'UPDATE_SETTINGS',\n\t\tsettings: cleanSettings,\n\t\treset,\n\t};\n}\n\n/**\n * Hides the block interface (eg. toolbar, outline, etc.)\n *\n * @return {Object} Action object.\n */\nexport function hideBlockInterface() {\n\treturn {\n\t\ttype: 'HIDE_BLOCK_INTERFACE',\n\t};\n}\n\n/**\n * Shows the block interface (eg. toolbar, outline, etc.)\n *\n * @return {Object} Action object.\n */\nexport function showBlockInterface() {\n\treturn {\n\t\ttype: 'SHOW_BLOCK_INTERFACE',\n\t};\n}\n\n/**\n * Yields action objects used in signalling that the blocks corresponding to\n * the set of specified client IDs are to be removed.\n *\n * Compared to `removeBlocks`, this private interface exposes an additional\n * parameter; see `forceRemove`.\n *\n * @param {string|string[]} clientIds Client IDs of blocks to remove.\n * @param {boolean} selectPrevious True if the previous block\n * or the immediate parent\n * (if no previous block exists)\n * should be selected\n * when a block is removed.\n * @param {boolean} forceRemove Whether to force the operation,\n * bypassing any checks for certain\n * block types.\n */\nexport const privateRemoveBlocks =\n\t( clientIds, selectPrevious = true, forceRemove = false ) =>\n\t( { select, dispatch, registry } ) => {\n\t\tif ( ! clientIds || ! clientIds.length ) {\n\t\t\treturn;\n\t\t}\n\n\t\tclientIds = castArray( clientIds );\n\t\tconst canRemoveBlocks = select.canRemoveBlocks( clientIds );\n\n\t\tif ( ! canRemoveBlocks ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// In certain editing contexts, we'd like to prevent accidental removal\n\t\t// of important blocks. For example, in the site editor, the Query Loop\n\t\t// block is deemed important. In such cases, we'll ask the user for\n\t\t// confirmation that they intended to remove such block(s). However,\n\t\t// the editor instance is responsible for presenting those confirmation\n\t\t// prompts to the user. Any instance opting into removal prompts must\n\t\t// register using `setBlockRemovalRules()`.\n\t\t//\n\t\t// @see https://github.com/WordPress/gutenberg/pull/51145\n\t\tconst rules = ! forceRemove && select.getBlockRemovalRules();\n\n\t\tif ( rules ) {\n\t\t\tfunction flattenBlocks( blocks ) {\n\t\t\t\tconst result = [];\n\t\t\t\tconst stack = [ ...blocks ];\n\t\t\t\twhile ( stack.length ) {\n\t\t\t\t\tconst { innerBlocks, ...block } = stack.shift();\n\t\t\t\t\tstack.push( ...innerBlocks );\n\t\t\t\t\tresult.push( block );\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tconst blockList = clientIds.map( select.getBlock );\n\t\t\tconst flattenedBlocks = flattenBlocks( blockList );\n\n\t\t\t// Find the first message and use it.\n\t\t\tlet message;\n\t\t\tfor ( const rule of rules ) {\n\t\t\t\tmessage = rule.callback( flattenedBlocks );\n\t\t\t\tif ( message ) {\n\t\t\t\t\tdispatch(\n\t\t\t\t\t\tdisplayBlockRemovalPrompt(\n\t\t\t\t\t\t\tclientIds,\n\t\t\t\t\t\t\tselectPrevious,\n\t\t\t\t\t\t\tmessage\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( selectPrevious ) {\n\t\t\tdispatch.selectPreviousBlock( clientIds[ 0 ], selectPrevious );\n\t\t}\n\n\t\t// We're batching these two actions because an extra `undo/redo` step can\n\t\t// be created, based on whether we insert a default block or not.\n\t\tregistry.batch( () => {\n\t\t\tdispatch( { type: 'REMOVE_BLOCKS', clientIds } );\n\t\t\t// To avoid a focus loss when removing the last block, assure there is\n\t\t\t// always a default block if the last of the blocks have been removed.\n\t\t\tdispatch( ensureDefaultBlock() );\n\t\t} );\n\t};\n\n/**\n * Action which will insert a default block insert action if there\n * are no other blocks at the root of the editor. This action should be used\n * in actions which may result in no blocks remaining in the editor (removal,\n * replacement, etc).\n */\nexport const ensureDefaultBlock =\n\t() =>\n\t( { select, dispatch } ) => {\n\t\t// To avoid a focus loss when removing the last block, assure there is\n\t\t// always a default block if the last of the blocks have been removed.\n\t\tconst count = select.getBlockCount();\n\t\tif ( count > 0 ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If there's an custom appender, don't insert default block.\n\t\t// We have to remember to manually move the focus elsewhere to\n\t\t// prevent it from being lost though.\n\t\tconst { __unstableHasCustomAppender } = select.getSettings();\n\t\tif ( __unstableHasCustomAppender ) {\n\t\t\treturn;\n\t\t}\n\n\t\tdispatch.insertDefaultBlock();\n\t};\n\n/**\n * Returns an action object used in signalling that a block removal prompt must\n * be displayed.\n *\n * Contrast with `setBlockRemovalRules`.\n *\n * @param {string|string[]} clientIds Client IDs of blocks to remove.\n * @param {boolean} selectPrevious True if the previous block or the\n * immediate parent (if no previous\n * block exists) should be selected\n * when a block is removed.\n * @param {string} message Message to display in the prompt.\n *\n * @return {Object} Action object.\n */\nfunction displayBlockRemovalPrompt( clientIds, selectPrevious, message ) {\n\treturn {\n\t\ttype: 'DISPLAY_BLOCK_REMOVAL_PROMPT',\n\t\tclientIds,\n\t\tselectPrevious,\n\t\tmessage,\n\t};\n}\n\n/**\n * Returns an action object used in signalling that a block removal prompt must\n * be cleared, either be cause the user has confirmed or canceled the request\n * for removal.\n *\n * @return {Object} Action object.\n */\nexport function clearBlockRemovalPrompt() {\n\treturn {\n\t\ttype: 'CLEAR_BLOCK_REMOVAL_PROMPT',\n\t};\n}\n\n/**\n * Returns an action object used to set up any rules that a block editor may\n * provide in order to prevent a user from accidentally removing certain\n * blocks. These rules are then used to display a confirmation prompt to the\n * user. For instance, in the Site Editor, the Query Loop block is important\n * enough to warrant such confirmation.\n *\n * IMPORTANT: Registering rules implicitly signals to the `privateRemoveBlocks`\n * action that the editor will be responsible for displaying block removal\n * prompts and confirming deletions. This action is meant to be used by\n * component `BlockRemovalWarningModal` only.\n *\n * The data is a record whose keys are block types (e.g. 'core/query') and\n * whose values are the explanation to be shown to users (e.g. 'Query Loop\n * displays a list of posts or pages.').\n *\n * Contrast with `displayBlockRemovalPrompt`.\n *\n * @param {Record<string,string>|false} rules Block removal rules.\n * @return {Object} Action object.\n */\nexport function setBlockRemovalRules( rules = false ) {\n\treturn {\n\t\ttype: 'SET_BLOCK_REMOVAL_RULES',\n\t\trules,\n\t};\n}\n\n/**\n * Sets the client ID of the block settings menu that is currently open.\n *\n * @param {?string} clientId The block client ID.\n * @return {Object} Action object.\n */\nexport function setOpenedBlockSettingsMenu( clientId ) {\n\treturn {\n\t\ttype: 'SET_OPENED_BLOCK_SETTINGS_MENU',\n\t\tclientId,\n\t};\n}\n\nexport function setStyleOverride( id, style ) {\n\treturn {\n\t\ttype: 'SET_STYLE_OVERRIDE',\n\t\tid,\n\t\tstyle,\n\t};\n}\n\nexport function deleteStyleOverride( id ) {\n\treturn {\n\t\ttype: 'DELETE_STYLE_OVERRIDE',\n\t\tid,\n\t};\n}\n\n/**\n * Action that sets the element that had focus when focus leaves the editor canvas.\n *\n * @param {Object} lastFocus The last focused element.\n *\n *\n * @return {Object} Action object.\n */\nexport function setLastFocus( lastFocus = null ) {\n\treturn {\n\t\ttype: 'LAST_FOCUS',\n\t\tlastFocus,\n\t};\n}\n\n/**\n * Action that stops temporarily editing as blocks.\n *\n * @param {string} clientId The block's clientId.\n */\nexport function stopEditingAsBlocks( clientId ) {\n\treturn ( { select, dispatch, registry } ) => {\n\t\tconst focusModeToRevert = unlock(\n\t\t\tregistry.select( blockEditorStore )\n\t\t).getTemporarilyEditingFocusModeToRevert();\n\t\tdispatch.__unstableMarkNextChangeAsNotPersistent();\n\t\tdispatch.updateBlockAttributes( clientId, {\n\t\t\ttemplateLock: 'contentOnly',\n\t\t} );\n\t\tdispatch.updateBlockListSettings( clientId, {\n\t\t\t...select.getBlockListSettings( clientId ),\n\t\t\ttemplateLock: 'contentOnly',\n\t\t} );\n\t\tdispatch.updateSettings( { focusMode: focusModeToRevert } );\n\t\tdispatch.__unstableSetTemporarilyEditingAsBlocks();\n\t};\n}\n\n/**\n * Returns an action object used in signalling that the user has begun to drag.\n *\n * @return {Object} Action object.\n */\nexport function startDragging() {\n\treturn {\n\t\ttype: 'START_DRAGGING',\n\t};\n}\n\n/**\n * Returns an action object used in signalling that the user has stopped dragging.\n *\n * @return {Object} Action object.\n */\nexport function stopDragging() {\n\treturn {\n\t\ttype: 'STOP_DRAGGING',\n\t};\n}\n\n/**\n * @param {string|null} clientId The block's clientId, or `null` to clear.\n *\n * @return {Object} Action object.\n */\nexport function expandBlock( clientId ) {\n\treturn {\n\t\ttype: 'SET_BLOCK_EXPANDED_IN_LIST_VIEW',\n\t\tclientId,\n\t};\n}\n\n/**\n * @param {Object} value\n * @param {string} value.rootClientId The root client ID to insert at.\n * @param {number} value.index The index to insert at.\n *\n * @return {Object} Action object.\n */\nexport function setInsertionPoint( value ) {\n\treturn {\n\t\ttype: 'SET_INSERTION_POINT',\n\t\tvalue,\n\t};\n}\n\n/**\n * Temporarily modify/unlock the content-only block for editions.\n *\n * @param {string} clientId The client id of the block.\n */\nexport const modifyContentLockBlock =\n\t( clientId ) =>\n\t( { select, dispatch } ) => {\n\t\tdispatch.selectBlock( clientId );\n\t\tdispatch.__unstableMarkNextChangeAsNotPersistent();\n\t\tdispatch.updateBlockAttributes( clientId, {\n\t\t\ttemplateLock: undefined,\n\t\t} );\n\t\tdispatch.updateBlockListSettings( clientId, {\n\t\t\t...select.getBlockListSettings( clientId ),\n\t\t\ttemplateLock: false,\n\t\t} );\n\t\tconst focusModeToRevert = select.getSettings().focusMode;\n\t\tdispatch.updateSettings( { focusMode: true } );\n\t\tdispatch.__unstableSetTemporarilyEditingAsBlocks(\n\t\t\tclientId,\n\t\t\tfocusModeToRevert\n\t\t);\n\t};\n\n/**\n * Sets the zoom level.\n *\n * @param {number} zoom the new zoom level\n * @return {Object} Action object.\n */\nexport function setZoomLevel( zoom = 100 ) {\n\treturn {\n\t\ttype: 'SET_ZOOM_LEVEL',\n\t\tzoom,\n\t};\n}\n\n/**\n * Resets the Zoom state.\n * @return {Object} Action object.\n */\nexport function resetZoomLevel() {\n\treturn {\n\t\ttype: 'R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AiB,GAAG1C,MAAM,CAAC6B,WAAW,CAAC,CAAC,CAACqB,SAAS;EACxDjD,QAAQ,CAACgD,cAAc,CAAE;IAAEC,SAAS,EAAE;EAAK,CAAE,CAAC;EAC9CjD,QAAQ,CAACkD,uCAAuC,CAC/CjB,QAAQ,EACRQ,iBACD,CAAC;AACF,CAAC;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASkB,YAAYA,CAAEC,IAAI,GAAG,GAAG,EAAG;EAC1C,OAAO;IACNpE,IAAI,EAAE,gBAAgB;IACtBoE;EACD,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASC,cAAcA,CAAA,EAAG;EAChC,OAAO;IACNrE,IAAI,EAAE;EACP,CAAC;AACF","ignoreList":[]}
@@ -6,7 +6,7 @@ import { createSelector, createRegistrySelector } from '@wordpress/data';
6
6
  /**
7
7
  * Internal dependencies
8
8
  */
9
- import { getBlockOrder, getBlockParents, getBlockEditingMode, getSettings, canInsertBlockType, getBlockName, getTemplateLock, getClientIdsWithDescendants } from './selectors';
9
+ import { getBlockOrder, getBlockParents, getBlockEditingMode, getSettings, canInsertBlockType, getBlockName, getTemplateLock, getClientIdsWithDescendants, isNavigationMode, getBlockRootClientId } from './selectors';
10
10
  import { checkAllowListRecursive, getAllPatternsDependants, getInsertBlockTypeDependants, getGrammar } from './utils';
11
11
  import { INSERTER_PATTERN_TYPES } from '../components/inserter/block-patterns-tab/utils';
12
12
  import { STORE_NAME } from './constants';
@@ -79,7 +79,7 @@ function getEnabledClientIdsTreeUnmemoized(state, rootClientId) {
79
79
  *
80
80
  * @return {Object[]} Tree of block objects with only clientID and innerBlocks set.
81
81
  */
82
- export const getEnabledClientIdsTree = createSelector(getEnabledClientIdsTreeUnmemoized, state => [state.blocks.order, state.blockEditingModes, state.settings.templateLock, state.blockListSettings, state.editorMode]);
82
+ export const getEnabledClientIdsTree = createSelector(getEnabledClientIdsTreeUnmemoized, state => [state.blocks.order, state.blockEditingModes, state.settings.templateLock, state.blockListSettings, state.editorMode, getSectionRootClientId(state)]);
83
83
 
84
84
  /**
85
85
  * Returns a list of a given block's ancestors, from top to bottom. Blocks with
@@ -338,20 +338,53 @@ export function getExpandedBlock(state) {
338
338
  * with the provided client ID.
339
339
  *
340
340
  * @param {Object} state Global application state.
341
- * @param {Object} clientId Client Id of the block.
341
+ * @param {string} clientId Client Id of the block.
342
342
  *
343
343
  * @return {?string} Client ID of the ancestor block that is content locking the block.
344
344
  */
345
- export const getContentLockingParent = createSelector((state, clientId) => {
345
+ export const getContentLockingParent = (state, clientId) => {
346
346
  let current = clientId;
347
347
  let result;
348
- while (current = state.blocks.parents.get(current)) {
349
- if (getBlockName(state, current) === 'core/block' || getTemplateLock(state, current) === 'contentOnly') {
348
+ while (!result && (current = state.blocks.parents.get(current))) {
349
+ if (getTemplateLock(state, current) === 'contentOnly') {
350
350
  result = current;
351
351
  }
352
352
  }
353
353
  return result;
354
- }, state => [state.blocks.parents, state.blockListSettings]);
354
+ };
355
+
356
+ /**
357
+ * Retrieves the client ID of the parent section block.
358
+ *
359
+ * @param {Object} state Global application state.
360
+ * @param {string} clientId Client Id of the block.
361
+ *
362
+ * @return {?string} Client ID of the ancestor block that is content locking the block.
363
+ */
364
+ export const getParentSectionBlock = (state, clientId) => {
365
+ let current = clientId;
366
+ let result;
367
+ while (!result && (current = state.blocks.parents.get(current))) {
368
+ if (isSectionBlock(state, current)) {
369
+ result = current;
370
+ }
371
+ }
372
+ return result;
373
+ };
374
+
375
+ /**
376
+ * Retrieves the client ID is a content locking parent
377
+ *
378
+ * @param {Object} state Global application state.
379
+ * @param {string} clientId Client Id of the block.
380
+ *
381
+ * @return {boolean} Whether the block is a content locking parent.
382
+ */
383
+ export function isSectionBlock(state, clientId) {
384
+ const sectionRootClientId = getSectionRootClientId(state);
385
+ const sectionClientIds = getBlockOrder(state, sectionRootClientId);
386
+ return getBlockName(state, clientId) === 'core/block' || getTemplateLock(state, clientId) === 'contentOnly' || isNavigationMode(state) && sectionClientIds.includes(clientId);
387
+ }
355
388
 
356
389
  /**
357
390
  * Retrieves the client ID of the block that is content locked but is
@@ -433,4 +466,62 @@ export function getZoomLevel(state) {
433
466
  export function isZoomOut(state) {
434
467
  return getZoomLevel(state) < 100;
435
468
  }
469
+
470
+ /**
471
+ * Finds the closest block where the block is allowed to be inserted.
472
+ *
473
+ * @param {Object} state Editor state.
474
+ * @param {string[] | string} name Block name or names.
475
+ * @param {string} clientId Default insertion point.
476
+ *
477
+ * @return {string} clientID of the closest container when the block name can be inserted.
478
+ */
479
+ export function getClosestAllowedInsertionPoint(state, name, clientId = '') {
480
+ const blockNames = Array.isArray(name) ? name : [name];
481
+ const areBlockNamesAllowedInClientId = id => blockNames.every(currentName => canInsertBlockType(state, currentName, id));
482
+
483
+ // If we're trying to insert at the root level and it's not allowed
484
+ // Try the section root instead.
485
+ if (!clientId) {
486
+ if (areBlockNamesAllowedInClientId(clientId)) {
487
+ return clientId;
488
+ }
489
+ const sectionRootClientId = getSectionRootClientId(state);
490
+ if (sectionRootClientId && areBlockNamesAllowedInClientId(sectionRootClientId)) {
491
+ return sectionRootClientId;
492
+ }
493
+ return null;
494
+ }
495
+
496
+ // Traverse the block tree up until we find a place where we can insert.
497
+ let current = clientId;
498
+ while (current !== null && !areBlockNamesAllowedInClientId(current)) {
499
+ const parentClientId = getBlockRootClientId(state, current);
500
+ current = parentClientId;
501
+ }
502
+ return current;
503
+ }
504
+ export function getClosestAllowedInsertionPointForPattern(state, pattern, clientId) {
505
+ const {
506
+ allowedBlockTypes
507
+ } = getSettings(state);
508
+ const isAllowed = checkAllowListRecursive(getGrammar(pattern), allowedBlockTypes);
509
+ if (!isAllowed) {
510
+ return null;
511
+ }
512
+ const names = getGrammar(pattern).map(({
513
+ blockName: name
514
+ }) => name);
515
+ return getClosestAllowedInsertionPoint(state, names, clientId);
516
+ }
517
+
518
+ /**
519
+ * Where the point where the next block will be inserted into.
520
+ *
521
+ * @param {Object} state
522
+ * @return {Object} where the insertion point in the block editor is or null if none is set.
523
+ */
524
+ export function getInsertionPoint(state) {
525
+ return state.insertionPoint;
526
+ }
436
527
  //# sourceMappingURL=private-selectors.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createSelector","createRegistrySelector","getBlockOrder","getBlockParents","getBlockEditingMode","getSettings","canInsertBlockType","getBlockName","getTemplateLock","getClientIdsWithDescendants","checkAllowListRecursive","getAllPatternsDependants","getInsertBlockTypeDependants","getGrammar","INSERTER_PATTERN_TYPES","STORE_NAME","unlock","selectBlockPatternsKey","reusableBlocksSelectKey","sectionRootClientIdKey","getBlockSettings","isBlockInterfaceHidden","state","getLastInsertedBlocksClientIds","lastBlockInserted","clientIds","getBlockWithoutAttributes","clientId","blocks","byClientId","get","isBlockSubtreeDisabled","isChildSubtreeDisabled","childClientId","every","getEnabledClientIdsTreeUnmemoized","rootClientId","blockOrder","result","innerBlocks","push","getEnabledClientIdsTree","order","blockEditingModes","settings","templateLock","blockListSettings","editorMode","getEnabledBlockParents","ascending","filter","parent","parents","getRemovalPromptData","removalPromptData","getBlockRemovalRules","blockRemovalRules","getOpenedBlockSettingsMenu","openedBlockSettingsMenu","getStyleOverrides","clientIdMap","reduce","acc","index","styleOverrides","sort","overrideA","overrideB","_clientIdMap$clientId","_clientIdMap$clientId2","clientIdA","clientIdB","aIndex","bIndex","getRegisteredInserterMediaCategories","registeredInserterMediaCategories","getInserterMediaCategories","inserterMediaCategories","allowedMimeTypes","enableOpenverseMediaCategory","length","coreInserterMediaCategoriesNames","map","name","mergedCategories","includes","category","Object","values","some","mimeType","startsWith","mediaType","hasAllowedPatterns","select","getAllPatterns","patterns","allowedBlockTypes","pattern","inserter","grammar","blockName","mapUserPattern","userPattern","__experimentalUserPatternCategories","id","type","user","title","raw","categories","wp_pattern_category","catId","find","slug","content","syncStatus","wp_pattern_sync_status","getPatternBySlug","patternName","_state$settings$__exp","_state$settings$selec","_id","parseInt","slice","block","getReusableBlocks","__experimentalBlockPatterns","__experimentalReusableBlocks","_state$settings$__exp2","_state$settings$selec2","x","arr","findIndex","y","isResolvingPatterns","blockPatternsSelect","reusableBlocksSelect","undefined","EMPTY_ARRAY","_ref","getLastFocus","lastFocus","isDragging","getExpandedBlock","expandedBlock","getContentLockingParent","current","getTemporarilyEditingAsBlocks","temporarilyEditingAsBlocks","getTemporarilyEditingFocusModeToRevert","temporarilyEditingFocusModeRevert","getBlockStyles","styles","attributes","style","isZoomOutMode","getSectionRootClientId","getZoomLevel","zoomLevel","isZoomOut"],"sources":["@wordpress/block-editor/src/store/private-selectors.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createSelector, createRegistrySelector } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport {\n\tgetBlockOrder,\n\tgetBlockParents,\n\tgetBlockEditingMode,\n\tgetSettings,\n\tcanInsertBlockType,\n\tgetBlockName,\n\tgetTemplateLock,\n\tgetClientIdsWithDescendants,\n} from './selectors';\nimport {\n\tcheckAllowListRecursive,\n\tgetAllPatternsDependants,\n\tgetInsertBlockTypeDependants,\n\tgetGrammar,\n} from './utils';\nimport { INSERTER_PATTERN_TYPES } from '../components/inserter/block-patterns-tab/utils';\nimport { STORE_NAME } from './constants';\nimport { unlock } from '../lock-unlock';\nimport {\n\tselectBlockPatternsKey,\n\treusableBlocksSelectKey,\n\tsectionRootClientIdKey,\n} from './private-keys';\n\nexport { getBlockSettings } from './get-block-settings';\n\n/**\n * Returns true if the block interface is hidden, or false otherwise.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the block toolbar is hidden.\n */\nexport function isBlockInterfaceHidden( state ) {\n\treturn state.isBlockInterfaceHidden;\n}\n\n/**\n * Gets the client ids of the last inserted blocks.\n *\n * @param {Object} state Global application state.\n * @return {Array|undefined} Client Ids of the last inserted block(s).\n */\nexport function getLastInsertedBlocksClientIds( state ) {\n\treturn state?.lastBlockInserted?.clientIds;\n}\n\nexport function getBlockWithoutAttributes( state, clientId ) {\n\treturn state.blocks.byClientId.get( clientId );\n}\n\n/**\n * Returns true if all of the descendants of a block with the given client ID\n * have an editing mode of 'disabled', or false otherwise.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId The block client ID.\n *\n * @return {boolean} Whether the block descendants are disabled.\n */\nexport const isBlockSubtreeDisabled = ( state, clientId ) => {\n\tconst isChildSubtreeDisabled = ( childClientId ) => {\n\t\treturn (\n\t\t\tgetBlockEditingMode( state, childClientId ) === 'disabled' &&\n\t\t\tgetBlockOrder( state, childClientId ).every(\n\t\t\t\tisChildSubtreeDisabled\n\t\t\t)\n\t\t);\n\t};\n\treturn getBlockOrder( state, clientId ).every( isChildSubtreeDisabled );\n};\n\nfunction getEnabledClientIdsTreeUnmemoized( state, rootClientId ) {\n\tconst blockOrder = getBlockOrder( state, rootClientId );\n\tconst result = [];\n\n\tfor ( const clientId of blockOrder ) {\n\t\tconst innerBlocks = getEnabledClientIdsTreeUnmemoized(\n\t\t\tstate,\n\t\t\tclientId\n\t\t);\n\t\tif ( getBlockEditingMode( state, clientId ) !== 'disabled' ) {\n\t\t\tresult.push( { clientId, innerBlocks } );\n\t\t} else {\n\t\t\tresult.push( ...innerBlocks );\n\t\t}\n\t}\n\n\treturn result;\n}\n\n/**\n * Returns a tree of block objects with only clientID and innerBlocks set.\n * Blocks with a 'disabled' editing mode are not included.\n *\n * @param {Object} state Global application state.\n * @param {?string} rootClientId Optional root client ID of block list.\n *\n * @return {Object[]} Tree of block objects with only clientID and innerBlocks set.\n */\nexport const getEnabledClientIdsTree = createSelector(\n\tgetEnabledClientIdsTreeUnmemoized,\n\t( state ) => [\n\t\tstate.blocks.order,\n\t\tstate.blockEditingModes,\n\t\tstate.settings.templateLock,\n\t\tstate.blockListSettings,\n\t\tstate.editorMode,\n\t]\n);\n\n/**\n * Returns a list of a given block's ancestors, from top to bottom. Blocks with\n * a 'disabled' editing mode are excluded.\n *\n * @see getBlockParents\n *\n * @param {Object} state Global application state.\n * @param {string} clientId The block client ID.\n * @param {boolean} ascending Order results from bottom to top (true) or top\n * to bottom (false).\n */\nexport const getEnabledBlockParents = createSelector(\n\t( state, clientId, ascending = false ) => {\n\t\treturn getBlockParents( state, clientId, ascending ).filter(\n\t\t\t( parent ) => getBlockEditingMode( state, parent ) !== 'disabled'\n\t\t);\n\t},\n\t( state ) => [\n\t\tstate.blocks.parents,\n\t\tstate.blockEditingModes,\n\t\tstate.settings.templateLock,\n\t\tstate.blockListSettings,\n\t]\n);\n\n/**\n * Selector that returns the data needed to display a prompt when certain\n * blocks are removed, or `false` if no such prompt is requested.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object|false} Data for removal prompt display, if any.\n */\nexport function getRemovalPromptData( state ) {\n\treturn state.removalPromptData;\n}\n\n/**\n * Returns true if removal prompt exists, or false otherwise.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether removal prompt exists.\n */\nexport function getBlockRemovalRules( state ) {\n\treturn state.blockRemovalRules;\n}\n\n/**\n * Returns the client ID of the block settings menu that is currently open.\n *\n * @param {Object} state Global application state.\n * @return {string|null} The client ID of the block menu that is currently open.\n */\nexport function getOpenedBlockSettingsMenu( state ) {\n\treturn state.openedBlockSettingsMenu;\n}\n\n/**\n * Returns all style overrides, intended to be merged with global editor styles.\n *\n * Overrides are sorted to match the order of the blocks they relate to. This\n * is useful to maintain correct CSS cascade order.\n *\n * @param {Object} state Global application state.\n *\n * @return {Array} An array of style ID to style override pairs.\n */\nexport const getStyleOverrides = createSelector(\n\t( state ) => {\n\t\tconst clientIds = getClientIdsWithDescendants( state );\n\t\tconst clientIdMap = clientIds.reduce( ( acc, clientId, index ) => {\n\t\t\tacc[ clientId ] = index;\n\t\t\treturn acc;\n\t\t}, {} );\n\n\t\treturn [ ...state.styleOverrides ].sort( ( overrideA, overrideB ) => {\n\t\t\t// Once the overrides Map is spread to an array, the first element\n\t\t\t// is the key, while the second is the override itself including\n\t\t\t// the clientId to sort by.\n\t\t\tconst [ , { clientId: clientIdA } ] = overrideA;\n\t\t\tconst [ , { clientId: clientIdB } ] = overrideB;\n\n\t\t\tconst aIndex = clientIdMap[ clientIdA ] ?? -1;\n\t\t\tconst bIndex = clientIdMap[ clientIdB ] ?? -1;\n\n\t\t\treturn aIndex - bIndex;\n\t\t} );\n\t},\n\t( state ) => [ state.blocks.order, state.styleOverrides ]\n);\n\n/** @typedef {import('./actions').InserterMediaCategory} InserterMediaCategory */\n/**\n * Returns the registered inserter media categories through the public API.\n *\n * @param {Object} state Editor state.\n *\n * @return {InserterMediaCategory[]} Inserter media categories.\n */\nexport function getRegisteredInserterMediaCategories( state ) {\n\treturn state.registeredInserterMediaCategories;\n}\n\n/**\n * Returns an array containing the allowed inserter media categories.\n * It merges the registered media categories from extenders with the\n * core ones. It also takes into account the allowed `mime_types`, which\n * can be altered by `upload_mimes` filter and restrict some of them.\n *\n * @param {Object} state Global application state.\n *\n * @return {InserterMediaCategory[]} Client IDs of descendants.\n */\nexport const getInserterMediaCategories = createSelector(\n\t( state ) => {\n\t\tconst {\n\t\t\tsettings: {\n\t\t\t\tinserterMediaCategories,\n\t\t\t\tallowedMimeTypes,\n\t\t\t\tenableOpenverseMediaCategory,\n\t\t\t},\n\t\t\tregisteredInserterMediaCategories,\n\t\t} = state;\n\t\t// The allowed `mime_types` can be altered by `upload_mimes` filter and restrict\n\t\t// some of them. In this case we shouldn't add the category to the available media\n\t\t// categories list in the inserter.\n\t\tif (\n\t\t\t( ! inserterMediaCategories &&\n\t\t\t\t! registeredInserterMediaCategories.length ) ||\n\t\t\t! allowedMimeTypes\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t\tconst coreInserterMediaCategoriesNames =\n\t\t\tinserterMediaCategories?.map( ( { name } ) => name ) || [];\n\t\tconst mergedCategories = [\n\t\t\t...( inserterMediaCategories || [] ),\n\t\t\t...( registeredInserterMediaCategories || [] ).filter(\n\t\t\t\t( { name } ) =>\n\t\t\t\t\t! coreInserterMediaCategoriesNames.includes( name )\n\t\t\t),\n\t\t];\n\t\treturn mergedCategories.filter( ( category ) => {\n\t\t\t// Check if Openverse category is enabled.\n\t\t\tif (\n\t\t\t\t! enableOpenverseMediaCategory &&\n\t\t\t\tcategory.name === 'openverse'\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn Object.values( allowedMimeTypes ).some( ( mimeType ) =>\n\t\t\t\tmimeType.startsWith( `${ category.mediaType }/` )\n\t\t\t);\n\t\t} );\n\t},\n\t( state ) => [\n\t\tstate.settings.inserterMediaCategories,\n\t\tstate.settings.allowedMimeTypes,\n\t\tstate.settings.enableOpenverseMediaCategory,\n\t\tstate.registeredInserterMediaCategories,\n\t]\n);\n\n/**\n * Returns whether there is at least one allowed pattern for inner blocks children.\n * This is useful for deferring the parsing of all patterns until needed.\n *\n * @param {Object} state Editor state.\n * @param {string} [rootClientId=null] Target root client ID.\n *\n * @return {boolean} If there is at least one allowed pattern.\n */\nexport const hasAllowedPatterns = createRegistrySelector( ( select ) =>\n\tcreateSelector(\n\t\t( state, rootClientId = null ) => {\n\t\t\tconst { getAllPatterns } = unlock( select( STORE_NAME ) );\n\t\t\tconst patterns = getAllPatterns();\n\t\t\tconst { allowedBlockTypes } = getSettings( state );\n\t\t\treturn patterns.some( ( pattern ) => {\n\t\t\t\tconst { inserter = true } = pattern;\n\t\t\t\tif ( ! inserter ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tconst grammar = getGrammar( pattern );\n\t\t\t\treturn (\n\t\t\t\t\tcheckAllowListRecursive( grammar, allowedBlockTypes ) &&\n\t\t\t\t\tgrammar.every( ( { name: blockName } ) =>\n\t\t\t\t\t\tcanInsertBlockType( state, blockName, rootClientId )\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t} );\n\t\t},\n\t\t( state, rootClientId ) => [\n\t\t\t...getAllPatternsDependants( select )( state ),\n\t\t\t...getInsertBlockTypeDependants( state, rootClientId ),\n\t\t]\n\t)\n);\n\nfunction mapUserPattern(\n\tuserPattern,\n\t__experimentalUserPatternCategories = []\n) {\n\treturn {\n\t\tname: `core/block/${ userPattern.id }`,\n\t\tid: userPattern.id,\n\t\ttype: INSERTER_PATTERN_TYPES.user,\n\t\ttitle: userPattern.title.raw,\n\t\tcategories: userPattern.wp_pattern_category.map( ( catId ) => {\n\t\t\tconst category = __experimentalUserPatternCategories.find(\n\t\t\t\t( { id } ) => id === catId\n\t\t\t);\n\t\t\treturn category ? category.slug : catId;\n\t\t} ),\n\t\tcontent: userPattern.content.raw,\n\t\tsyncStatus: userPattern.wp_pattern_sync_status,\n\t};\n}\n\nexport const getPatternBySlug = createRegistrySelector( ( select ) =>\n\tcreateSelector(\n\t\t( state, patternName ) => {\n\t\t\t// Only fetch reusable blocks if we know we need them. To do: maybe\n\t\t\t// use the entity record API to retrieve the block by slug.\n\t\t\tif ( patternName?.startsWith( 'core/block/' ) ) {\n\t\t\t\tconst _id = parseInt(\n\t\t\t\t\tpatternName.slice( 'core/block/'.length ),\n\t\t\t\t\t10\n\t\t\t\t);\n\t\t\t\tconst block = unlock( select( STORE_NAME ) )\n\t\t\t\t\t.getReusableBlocks()\n\t\t\t\t\t.find( ( { id } ) => id === _id );\n\n\t\t\t\tif ( ! block ) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\treturn mapUserPattern(\n\t\t\t\t\tblock,\n\t\t\t\t\tstate.settings.__experimentalUserPatternCategories\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn [\n\t\t\t\t// This setting is left for back compat.\n\t\t\t\t...( state.settings.__experimentalBlockPatterns ?? [] ),\n\t\t\t\t...( state.settings[ selectBlockPatternsKey ]?.( select ) ??\n\t\t\t\t\t[] ),\n\t\t\t].find( ( { name } ) => name === patternName );\n\t\t},\n\t\t( state, patternName ) =>\n\t\t\tpatternName?.startsWith( 'core/block/' )\n\t\t\t\t? [\n\t\t\t\t\t\tunlock( select( STORE_NAME ) ).getReusableBlocks(),\n\t\t\t\t\t\tstate.settings.__experimentalReusableBlocks,\n\t\t\t\t ]\n\t\t\t\t: [\n\t\t\t\t\t\tstate.settings.__experimentalBlockPatterns,\n\t\t\t\t\t\tstate.settings[ selectBlockPatternsKey ]?.( select ),\n\t\t\t\t ]\n\t)\n);\n\nexport const getAllPatterns = createRegistrySelector( ( select ) =>\n\tcreateSelector( ( state ) => {\n\t\treturn [\n\t\t\t...unlock( select( STORE_NAME ) )\n\t\t\t\t.getReusableBlocks()\n\t\t\t\t.map( ( userPattern ) =>\n\t\t\t\t\tmapUserPattern(\n\t\t\t\t\t\tuserPattern,\n\t\t\t\t\t\tstate.settings.__experimentalUserPatternCategories\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t// This setting is left for back compat.\n\t\t\t...( state.settings.__experimentalBlockPatterns ?? [] ),\n\t\t\t...( state.settings[ selectBlockPatternsKey ]?.( select ) ?? [] ),\n\t\t].filter(\n\t\t\t( x, index, arr ) =>\n\t\t\t\tindex === arr.findIndex( ( y ) => x.name === y.name )\n\t\t);\n\t}, getAllPatternsDependants( select ) )\n);\n\nexport const isResolvingPatterns = createRegistrySelector( ( select ) =>\n\tcreateSelector( ( state ) => {\n\t\tconst blockPatternsSelect = state.settings[ selectBlockPatternsKey ];\n\t\tconst reusableBlocksSelect = state.settings[ reusableBlocksSelectKey ];\n\t\treturn (\n\t\t\t( blockPatternsSelect\n\t\t\t\t? blockPatternsSelect( select ) === undefined\n\t\t\t\t: false ) ||\n\t\t\t( reusableBlocksSelect\n\t\t\t\t? reusableBlocksSelect( select ) === undefined\n\t\t\t\t: false )\n\t\t);\n\t}, getAllPatternsDependants( select ) )\n);\n\nconst EMPTY_ARRAY = [];\n\nexport const getReusableBlocks = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tconst reusableBlocksSelect = state.settings[ reusableBlocksSelectKey ];\n\t\treturn (\n\t\t\t( reusableBlocksSelect\n\t\t\t\t? reusableBlocksSelect( select )\n\t\t\t\t: state.settings.__experimentalReusableBlocks ) ?? EMPTY_ARRAY\n\t\t);\n\t}\n);\n\n/**\n * Returns the element of the last element that had focus when focus left the editor canvas.\n *\n * @param {Object} state Block editor state.\n *\n * @return {Object} Element.\n */\nexport function getLastFocus( state ) {\n\treturn state.lastFocus;\n}\n\n/**\n * Returns true if the user is dragging anything, or false otherwise. It is possible for a\n * user to be dragging data from outside of the editor, so this selector is separate from\n * the `isDraggingBlocks` selector which only returns true if the user is dragging blocks.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether user is dragging.\n */\nexport function isDragging( state ) {\n\treturn state.isDragging;\n}\n\n/**\n * Retrieves the expanded block from the state.\n *\n * @param {Object} state Block editor state.\n *\n * @return {string|null} The client ID of the expanded block, if set.\n */\nexport function getExpandedBlock( state ) {\n\treturn state.expandedBlock;\n}\n\n/**\n * Retrieves the client ID of the ancestor block that is content locking the block\n * with the provided client ID.\n *\n * @param {Object} state Global application state.\n * @param {Object} clientId Client Id of the block.\n *\n * @return {?string} Client ID of the ancestor block that is content locking the block.\n */\nexport const getContentLockingParent = createSelector(\n\t( state, clientId ) => {\n\t\tlet current = clientId;\n\t\tlet result;\n\t\twhile ( ( current = state.blocks.parents.get( current ) ) ) {\n\t\t\tif (\n\t\t\t\tgetBlockName( state, current ) === 'core/block' ||\n\t\t\t\tgetTemplateLock( state, current ) === 'contentOnly'\n\t\t\t) {\n\t\t\t\tresult = current;\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t},\n\t( state ) => [ state.blocks.parents, state.blockListSettings ]\n);\n\n/**\n * Retrieves the client ID of the block that is content locked but is\n * currently being temporarily edited as a non-locked block.\n *\n * @param {Object} state Global application state.\n *\n * @return {?string} The client ID of the block being temporarily edited as a non-locked block.\n */\nexport function getTemporarilyEditingAsBlocks( state ) {\n\treturn state.temporarilyEditingAsBlocks;\n}\n\n/**\n * Returns the focus mode that should be reapplied when the user stops editing\n * a content locked blocks as a block without locking.\n *\n * @param {Object} state Global application state.\n *\n * @return {?string} The focus mode that should be re-set when temporarily editing as blocks stops.\n */\nexport function getTemporarilyEditingFocusModeToRevert( state ) {\n\treturn state.temporarilyEditingFocusModeRevert;\n}\n\n/**\n * Returns the style attributes of multiple blocks.\n *\n * @param {Object} state Global application state.\n * @param {string[]} clientIds An array of block client IDs.\n *\n * @return {Object} An object where keys are client IDs and values are the corresponding block styles or undefined.\n */\nexport const getBlockStyles = createSelector(\n\t( state, clientIds ) =>\n\t\tclientIds.reduce( ( styles, clientId ) => {\n\t\t\tstyles[ clientId ] = state.blocks.attributes.get( clientId )?.style;\n\t\t\treturn styles;\n\t\t}, {} ),\n\t( state, clientIds ) => [\n\t\t...clientIds.map(\n\t\t\t( clientId ) => state.blocks.attributes.get( clientId )?.style\n\t\t),\n\t]\n);\n\n/**\n * Returns whether zoom out mode is enabled.\n *\n * @param {Object} state Editor state.\n *\n * @return {boolean} Is zoom out mode enabled.\n */\nexport function isZoomOutMode( state ) {\n\treturn state.editorMode === 'zoom-out';\n}\n\n/**\n * Retrieves the client ID of the block which contains the blocks\n * acting as \"sections\" in the editor. This is typically the \"main content\"\n * of the template/post.\n *\n * @param {Object} state Editor state.\n *\n * @return {string|undefined} The section root client ID or undefined if not set.\n */\nexport function getSectionRootClientId( state ) {\n\treturn state.settings?.[ sectionRootClientIdKey ];\n}\n\n/**\n * Returns the zoom out state.\n *\n * @param {Object} state Global application state.\n * @return {boolean} The zoom out state.\n */\nexport function getZoomLevel( state ) {\n\treturn state.zoomLevel;\n}\n\n/**\n * Returns whether the editor is considered zoomed out.\n *\n * @param {Object} state Global application state.\n * @return {boolean} Whether the editor is zoomed.\n */\nexport function isZoomOut( state ) {\n\treturn getZoomLevel( state ) < 100;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,cAAc,EAAEC,sBAAsB,QAAQ,iBAAiB;;AAExE;AACA;AACA;AACA,SACCC,aAAa,EACbC,eAAe,EACfC,mBAAmB,EACnBC,WAAW,EACXC,kBAAkB,EAClBC,YAAY,EACZC,eAAe,EACfC,2BAA2B,QACrB,aAAa;AACpB,SACCC,uBAAuB,EACvBC,wBAAwB,EACxBC,4BAA4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C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,cAAc,GAAGxJ,cAAc,CAC3C,CAAEsB,KAAK,EAAEG,SAAS,KACjBA,SAAS,CAACoC,MAAM,CAAE,CAAE4F,MAAM,EAAE9H,QAAQ,KAAM;EACzC8H,MAAM,CAAE9H,QAAQ,CAAE,GAAGL,KAAK,CAACM,MAAM,CAAC8H,UAAU,CAAC5H,GAAG,CAAEH,QAAS,CAAC,EAAEgI,KAAK;EACnE,OAAOF,MAAM;AACd,CAAC,EAAE,CAAC,CAAE,CAAC,EACR,CAAEnI,KAAK,EAAEG,SAAS,KAAM,CACvB,GAAGA,SAAS,CAACyD,GAAG,CACbvD,QAAQ,IAAML,KAAK,CAACM,MAAM,CAAC8H,UAAU,CAAC5H,GAAG,CAAEH,QAAS,CAAC,EAAEgI,KAC1D,CAAC,CAEH,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,aAAaA,CAAEtI,KAAK,EAAG;EACtC,OAAOA,KAAK,CAACyB,UAAU,KAAK,UAAU;AACvC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAAS8G,sBAAsBA,CAAEvI,KAAK,EAAG;EAC/C,OAAOA,KAAK,CAACsB,QAAQ,GAAIzB,sBAAsB,CAAE;AAClD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAAS2I,YAAYA,CAAExI,KAAK,EAAG;EACrC,OAAOA,KAAK,CAACyI,SAAS;AACvB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,SAASA,CAAE1I,KAAK,EAAG;EAClC,OAAOwI,YAAY,CAAExI,KAAM,CAAC,GAAG,GAAG;AACnC","ignoreList":[]}
1
+ {"version":3,"names":["createSelector","createRegistrySelector","getBlockOrder","getBlockParents","getBlockEditingMode","getSettings","canInsertBlockType","getBlockName","getTemplateLock","getClientIdsWithDescendants","isNavigationMode","getBlockRootClientId","checkAllowListRecursive","getAllPatternsDependants","getInsertBlockTypeDependants","getGrammar","INSERTER_PATTERN_TYPES","STORE_NAME","unlock","selectBlockPatternsKey","reusableBlocksSelectKey","sectionRootClientIdKey","getBlockSettings","isBlockInterfaceHidden","state","getLastInsertedBlocksClientIds","lastBlockInserted","clientIds","getBlockWithoutAttributes","clientId","blocks","byClientId","get","isBlockSubtreeDisabled","isChildSubtreeDisabled","childClientId","every","getEnabledClientIdsTreeUnmemoized","rootClientId","blockOrder","result","innerBlocks","push","getEnabledClientIdsTree","order","blockEditingModes","settings","templateLock","blockListSettings","editorMode","getSectionRootClientId","getEnabledBlockParents","ascending","filter","parent","parents","getRemovalPromptData","removalPromptData","getBlockRemovalRules","blockRemovalRules","getOpenedBlockSettingsMenu","openedBlockSettingsMenu","getStyleOverrides","clientIdMap","reduce","acc","index","styleOverrides","sort","overrideA","overrideB","_clientIdMap$clientId","_clientIdMap$clientId2","clientIdA","clientIdB","aIndex","bIndex","getRegisteredInserterMediaCategories","registeredInserterMediaCategories","getInserterMediaCategories","inserterMediaCategories","allowedMimeTypes","enableOpenverseMediaCategory","length","coreInserterMediaCategoriesNames","map","name","mergedCategories","includes","category","Object","values","some","mimeType","startsWith","mediaType","hasAllowedPatterns","select","getAllPatterns","patterns","allowedBlockTypes","pattern","inserter","grammar","blockName","mapUserPattern","userPattern","__experimentalUserPatternCategories","id","type","user","title","raw","categories","wp_pattern_category","catId","find","slug","content","syncStatus","wp_pattern_sync_status","getPatternBySlug","patternName","_state$settings$__exp","_state$settings$selec","_id","parseInt","slice","block","getReusableBlocks","__experimentalBlockPatterns","__experimentalReusableBlocks","_state$settings$__exp2","_state$settings$selec2","x","arr","findIndex","y","isResolvingPatterns","blockPatternsSelect","reusableBlocksSelect","undefined","EMPTY_ARRAY","_ref","getLastFocus","lastFocus","isDragging","getExpandedBlock","expandedBlock","getContentLockingParent","current","getParentSectionBlock","isSectionBlock","sectionRootClientId","sectionClientIds","getTemporarilyEditingAsBlocks","temporarilyEditingAsBlocks","getTemporarilyEditingFocusModeToRevert","temporarilyEditingFocusModeRevert","getBlockStyles","styles","attributes","style","isZoomOutMode","getZoomLevel","zoomLevel","isZoomOut","getClosestAllowedInsertionPoint","blockNames","Array","isArray","areBlockNamesAllowedInClientId","currentName","parentClientId","getClosestAllowedInsertionPointForPattern","isAllowed","names","getInsertionPoint","insertionPoint"],"sources":["@wordpress/block-editor/src/store/private-selectors.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createSelector, createRegistrySelector } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport {\n\tgetBlockOrder,\n\tgetBlockParents,\n\tgetBlockEditingMode,\n\tgetSettings,\n\tcanInsertBlockType,\n\tgetBlockName,\n\tgetTemplateLock,\n\tgetClientIdsWithDescendants,\n\tisNavigationMode,\n\tgetBlockRootClientId,\n} from './selectors';\nimport {\n\tcheckAllowListRecursive,\n\tgetAllPatternsDependants,\n\tgetInsertBlockTypeDependants,\n\tgetGrammar,\n} from './utils';\nimport { INSERTER_PATTERN_TYPES } from '../components/inserter/block-patterns-tab/utils';\nimport { STORE_NAME } from './constants';\nimport { unlock } from '../lock-unlock';\nimport {\n\tselectBlockPatternsKey,\n\treusableBlocksSelectKey,\n\tsectionRootClientIdKey,\n} from './private-keys';\n\nexport { getBlockSettings } from './get-block-settings';\n\n/**\n * Returns true if the block interface is hidden, or false otherwise.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the block toolbar is hidden.\n */\nexport function isBlockInterfaceHidden( state ) {\n\treturn state.isBlockInterfaceHidden;\n}\n\n/**\n * Gets the client ids of the last inserted blocks.\n *\n * @param {Object} state Global application state.\n * @return {Array|undefined} Client Ids of the last inserted block(s).\n */\nexport function getLastInsertedBlocksClientIds( state ) {\n\treturn state?.lastBlockInserted?.clientIds;\n}\n\nexport function getBlockWithoutAttributes( state, clientId ) {\n\treturn state.blocks.byClientId.get( clientId );\n}\n\n/**\n * Returns true if all of the descendants of a block with the given client ID\n * have an editing mode of 'disabled', or false otherwise.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId The block client ID.\n *\n * @return {boolean} Whether the block descendants are disabled.\n */\nexport const isBlockSubtreeDisabled = ( state, clientId ) => {\n\tconst isChildSubtreeDisabled = ( childClientId ) => {\n\t\treturn (\n\t\t\tgetBlockEditingMode( state, childClientId ) === 'disabled' &&\n\t\t\tgetBlockOrder( state, childClientId ).every(\n\t\t\t\tisChildSubtreeDisabled\n\t\t\t)\n\t\t);\n\t};\n\treturn getBlockOrder( state, clientId ).every( isChildSubtreeDisabled );\n};\n\nfunction getEnabledClientIdsTreeUnmemoized( state, rootClientId ) {\n\tconst blockOrder = getBlockOrder( state, rootClientId );\n\tconst result = [];\n\n\tfor ( const clientId of blockOrder ) {\n\t\tconst innerBlocks = getEnabledClientIdsTreeUnmemoized(\n\t\t\tstate,\n\t\t\tclientId\n\t\t);\n\t\tif ( getBlockEditingMode( state, clientId ) !== 'disabled' ) {\n\t\t\tresult.push( { clientId, innerBlocks } );\n\t\t} else {\n\t\t\tresult.push( ...innerBlocks );\n\t\t}\n\t}\n\n\treturn result;\n}\n\n/**\n * Returns a tree of block objects with only clientID and innerBlocks set.\n * Blocks with a 'disabled' editing mode are not included.\n *\n * @param {Object} state Global application state.\n * @param {?string} rootClientId Optional root client ID of block list.\n *\n * @return {Object[]} Tree of block objects with only clientID and innerBlocks set.\n */\nexport const getEnabledClientIdsTree = createSelector(\n\tgetEnabledClientIdsTreeUnmemoized,\n\t( state ) => [\n\t\tstate.blocks.order,\n\t\tstate.blockEditingModes,\n\t\tstate.settings.templateLock,\n\t\tstate.blockListSettings,\n\t\tstate.editorMode,\n\t\tgetSectionRootClientId( state ),\n\t]\n);\n\n/**\n * Returns a list of a given block's ancestors, from top to bottom. Blocks with\n * a 'disabled' editing mode are excluded.\n *\n * @see getBlockParents\n *\n * @param {Object} state Global application state.\n * @param {string} clientId The block client ID.\n * @param {boolean} ascending Order results from bottom to top (true) or top\n * to bottom (false).\n */\nexport const getEnabledBlockParents = createSelector(\n\t( state, clientId, ascending = false ) => {\n\t\treturn getBlockParents( state, clientId, ascending ).filter(\n\t\t\t( parent ) => getBlockEditingMode( state, parent ) !== 'disabled'\n\t\t);\n\t},\n\t( state ) => [\n\t\tstate.blocks.parents,\n\t\tstate.blockEditingModes,\n\t\tstate.settings.templateLock,\n\t\tstate.blockListSettings,\n\t]\n);\n\n/**\n * Selector that returns the data needed to display a prompt when certain\n * blocks are removed, or `false` if no such prompt is requested.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object|false} Data for removal prompt display, if any.\n */\nexport function getRemovalPromptData( state ) {\n\treturn state.removalPromptData;\n}\n\n/**\n * Returns true if removal prompt exists, or false otherwise.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether removal prompt exists.\n */\nexport function getBlockRemovalRules( state ) {\n\treturn state.blockRemovalRules;\n}\n\n/**\n * Returns the client ID of the block settings menu that is currently open.\n *\n * @param {Object} state Global application state.\n * @return {string|null} The client ID of the block menu that is currently open.\n */\nexport function getOpenedBlockSettingsMenu( state ) {\n\treturn state.openedBlockSettingsMenu;\n}\n\n/**\n * Returns all style overrides, intended to be merged with global editor styles.\n *\n * Overrides are sorted to match the order of the blocks they relate to. This\n * is useful to maintain correct CSS cascade order.\n *\n * @param {Object} state Global application state.\n *\n * @return {Array} An array of style ID to style override pairs.\n */\nexport const getStyleOverrides = createSelector(\n\t( state ) => {\n\t\tconst clientIds = getClientIdsWithDescendants( state );\n\t\tconst clientIdMap = clientIds.reduce( ( acc, clientId, index ) => {\n\t\t\tacc[ clientId ] = index;\n\t\t\treturn acc;\n\t\t}, {} );\n\n\t\treturn [ ...state.styleOverrides ].sort( ( overrideA, overrideB ) => {\n\t\t\t// Once the overrides Map is spread to an array, the first element\n\t\t\t// is the key, while the second is the override itself including\n\t\t\t// the clientId to sort by.\n\t\t\tconst [ , { clientId: clientIdA } ] = overrideA;\n\t\t\tconst [ , { clientId: clientIdB } ] = overrideB;\n\n\t\t\tconst aIndex = clientIdMap[ clientIdA ] ?? -1;\n\t\t\tconst bIndex = clientIdMap[ clientIdB ] ?? -1;\n\n\t\t\treturn aIndex - bIndex;\n\t\t} );\n\t},\n\t( state ) => [ state.blocks.order, state.styleOverrides ]\n);\n\n/** @typedef {import('./actions').InserterMediaCategory} InserterMediaCategory */\n/**\n * Returns the registered inserter media categories through the public API.\n *\n * @param {Object} state Editor state.\n *\n * @return {InserterMediaCategory[]} Inserter media categories.\n */\nexport function getRegisteredInserterMediaCategories( state ) {\n\treturn state.registeredInserterMediaCategories;\n}\n\n/**\n * Returns an array containing the allowed inserter media categories.\n * It merges the registered media categories from extenders with the\n * core ones. It also takes into account the allowed `mime_types`, which\n * can be altered by `upload_mimes` filter and restrict some of them.\n *\n * @param {Object} state Global application state.\n *\n * @return {InserterMediaCategory[]} Client IDs of descendants.\n */\nexport const getInserterMediaCategories = createSelector(\n\t( state ) => {\n\t\tconst {\n\t\t\tsettings: {\n\t\t\t\tinserterMediaCategories,\n\t\t\t\tallowedMimeTypes,\n\t\t\t\tenableOpenverseMediaCategory,\n\t\t\t},\n\t\t\tregisteredInserterMediaCategories,\n\t\t} = state;\n\t\t// The allowed `mime_types` can be altered by `upload_mimes` filter and restrict\n\t\t// some of them. In this case we shouldn't add the category to the available media\n\t\t// categories list in the inserter.\n\t\tif (\n\t\t\t( ! inserterMediaCategories &&\n\t\t\t\t! registeredInserterMediaCategories.length ) ||\n\t\t\t! allowedMimeTypes\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t\tconst coreInserterMediaCategoriesNames =\n\t\t\tinserterMediaCategories?.map( ( { name } ) => name ) || [];\n\t\tconst mergedCategories = [\n\t\t\t...( inserterMediaCategories || [] ),\n\t\t\t...( registeredInserterMediaCategories || [] ).filter(\n\t\t\t\t( { name } ) =>\n\t\t\t\t\t! coreInserterMediaCategoriesNames.includes( name )\n\t\t\t),\n\t\t];\n\t\treturn mergedCategories.filter( ( category ) => {\n\t\t\t// Check if Openverse category is enabled.\n\t\t\tif (\n\t\t\t\t! enableOpenverseMediaCategory &&\n\t\t\t\tcategory.name === 'openverse'\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn Object.values( allowedMimeTypes ).some( ( mimeType ) =>\n\t\t\t\tmimeType.startsWith( `${ category.mediaType }/` )\n\t\t\t);\n\t\t} );\n\t},\n\t( state ) => [\n\t\tstate.settings.inserterMediaCategories,\n\t\tstate.settings.allowedMimeTypes,\n\t\tstate.settings.enableOpenverseMediaCategory,\n\t\tstate.registeredInserterMediaCategories,\n\t]\n);\n\n/**\n * Returns whether there is at least one allowed pattern for inner blocks children.\n * This is useful for deferring the parsing of all patterns until needed.\n *\n * @param {Object} state Editor state.\n * @param {string} [rootClientId=null] Target root client ID.\n *\n * @return {boolean} If there is at least one allowed pattern.\n */\nexport const hasAllowedPatterns = createRegistrySelector( ( select ) =>\n\tcreateSelector(\n\t\t( state, rootClientId = null ) => {\n\t\t\tconst { getAllPatterns } = unlock( select( STORE_NAME ) );\n\t\t\tconst patterns = getAllPatterns();\n\t\t\tconst { allowedBlockTypes } = getSettings( state );\n\t\t\treturn patterns.some( ( pattern ) => {\n\t\t\t\tconst { inserter = true } = pattern;\n\t\t\t\tif ( ! inserter ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tconst grammar = getGrammar( pattern );\n\t\t\t\treturn (\n\t\t\t\t\tcheckAllowListRecursive( grammar, allowedBlockTypes ) &&\n\t\t\t\t\tgrammar.every( ( { name: blockName } ) =>\n\t\t\t\t\t\tcanInsertBlockType( state, blockName, rootClientId )\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t} );\n\t\t},\n\t\t( state, rootClientId ) => [\n\t\t\t...getAllPatternsDependants( select )( state ),\n\t\t\t...getInsertBlockTypeDependants( state, rootClientId ),\n\t\t]\n\t)\n);\n\nfunction mapUserPattern(\n\tuserPattern,\n\t__experimentalUserPatternCategories = []\n) {\n\treturn {\n\t\tname: `core/block/${ userPattern.id }`,\n\t\tid: userPattern.id,\n\t\ttype: INSERTER_PATTERN_TYPES.user,\n\t\ttitle: userPattern.title.raw,\n\t\tcategories: userPattern.wp_pattern_category.map( ( catId ) => {\n\t\t\tconst category = __experimentalUserPatternCategories.find(\n\t\t\t\t( { id } ) => id === catId\n\t\t\t);\n\t\t\treturn category ? category.slug : catId;\n\t\t} ),\n\t\tcontent: userPattern.content.raw,\n\t\tsyncStatus: userPattern.wp_pattern_sync_status,\n\t};\n}\n\nexport const getPatternBySlug = createRegistrySelector( ( select ) =>\n\tcreateSelector(\n\t\t( state, patternName ) => {\n\t\t\t// Only fetch reusable blocks if we know we need them. To do: maybe\n\t\t\t// use the entity record API to retrieve the block by slug.\n\t\t\tif ( patternName?.startsWith( 'core/block/' ) ) {\n\t\t\t\tconst _id = parseInt(\n\t\t\t\t\tpatternName.slice( 'core/block/'.length ),\n\t\t\t\t\t10\n\t\t\t\t);\n\t\t\t\tconst block = unlock( select( STORE_NAME ) )\n\t\t\t\t\t.getReusableBlocks()\n\t\t\t\t\t.find( ( { id } ) => id === _id );\n\n\t\t\t\tif ( ! block ) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\treturn mapUserPattern(\n\t\t\t\t\tblock,\n\t\t\t\t\tstate.settings.__experimentalUserPatternCategories\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn [\n\t\t\t\t// This setting is left for back compat.\n\t\t\t\t...( state.settings.__experimentalBlockPatterns ?? [] ),\n\t\t\t\t...( state.settings[ selectBlockPatternsKey ]?.( select ) ??\n\t\t\t\t\t[] ),\n\t\t\t].find( ( { name } ) => name === patternName );\n\t\t},\n\t\t( state, patternName ) =>\n\t\t\tpatternName?.startsWith( 'core/block/' )\n\t\t\t\t? [\n\t\t\t\t\t\tunlock( select( STORE_NAME ) ).getReusableBlocks(),\n\t\t\t\t\t\tstate.settings.__experimentalReusableBlocks,\n\t\t\t\t ]\n\t\t\t\t: [\n\t\t\t\t\t\tstate.settings.__experimentalBlockPatterns,\n\t\t\t\t\t\tstate.settings[ selectBlockPatternsKey ]?.( select ),\n\t\t\t\t ]\n\t)\n);\n\nexport const getAllPatterns = createRegistrySelector( ( select ) =>\n\tcreateSelector( ( state ) => {\n\t\treturn [\n\t\t\t...unlock( select( STORE_NAME ) )\n\t\t\t\t.getReusableBlocks()\n\t\t\t\t.map( ( userPattern ) =>\n\t\t\t\t\tmapUserPattern(\n\t\t\t\t\t\tuserPattern,\n\t\t\t\t\t\tstate.settings.__experimentalUserPatternCategories\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t// This setting is left for back compat.\n\t\t\t...( state.settings.__experimentalBlockPatterns ?? [] ),\n\t\t\t...( state.settings[ selectBlockPatternsKey ]?.( select ) ?? [] ),\n\t\t].filter(\n\t\t\t( x, index, arr ) =>\n\t\t\t\tindex === arr.findIndex( ( y ) => x.name === y.name )\n\t\t);\n\t}, getAllPatternsDependants( select ) )\n);\n\nexport const isResolvingPatterns = createRegistrySelector( ( select ) =>\n\tcreateSelector( ( state ) => {\n\t\tconst blockPatternsSelect = state.settings[ selectBlockPatternsKey ];\n\t\tconst reusableBlocksSelect = state.settings[ reusableBlocksSelectKey ];\n\t\treturn (\n\t\t\t( blockPatternsSelect\n\t\t\t\t? blockPatternsSelect( select ) === undefined\n\t\t\t\t: false ) ||\n\t\t\t( reusableBlocksSelect\n\t\t\t\t? reusableBlocksSelect( select ) === undefined\n\t\t\t\t: false )\n\t\t);\n\t}, getAllPatternsDependants( select ) )\n);\n\nconst EMPTY_ARRAY = [];\n\nexport const getReusableBlocks = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tconst reusableBlocksSelect = state.settings[ reusableBlocksSelectKey ];\n\t\treturn (\n\t\t\t( reusableBlocksSelect\n\t\t\t\t? reusableBlocksSelect( select )\n\t\t\t\t: state.settings.__experimentalReusableBlocks ) ?? EMPTY_ARRAY\n\t\t);\n\t}\n);\n\n/**\n * Returns the element of the last element that had focus when focus left the editor canvas.\n *\n * @param {Object} state Block editor state.\n *\n * @return {Object} Element.\n */\nexport function getLastFocus( state ) {\n\treturn state.lastFocus;\n}\n\n/**\n * Returns true if the user is dragging anything, or false otherwise. It is possible for a\n * user to be dragging data from outside of the editor, so this selector is separate from\n * the `isDraggingBlocks` selector which only returns true if the user is dragging blocks.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether user is dragging.\n */\nexport function isDragging( state ) {\n\treturn state.isDragging;\n}\n\n/**\n * Retrieves the expanded block from the state.\n *\n * @param {Object} state Block editor state.\n *\n * @return {string|null} The client ID of the expanded block, if set.\n */\nexport function getExpandedBlock( state ) {\n\treturn state.expandedBlock;\n}\n\n/**\n * Retrieves the client ID of the ancestor block that is content locking the block\n * with the provided client ID.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId Client Id of the block.\n *\n * @return {?string} Client ID of the ancestor block that is content locking the block.\n */\nexport const getContentLockingParent = ( state, clientId ) => {\n\tlet current = clientId;\n\tlet result;\n\twhile ( ! result && ( current = state.blocks.parents.get( current ) ) ) {\n\t\tif ( getTemplateLock( state, current ) === 'contentOnly' ) {\n\t\t\tresult = current;\n\t\t}\n\t}\n\treturn result;\n};\n\n/**\n * Retrieves the client ID of the parent section block.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId Client Id of the block.\n *\n * @return {?string} Client ID of the ancestor block that is content locking the block.\n */\nexport const getParentSectionBlock = ( state, clientId ) => {\n\tlet current = clientId;\n\tlet result;\n\twhile ( ! result && ( current = state.blocks.parents.get( current ) ) ) {\n\t\tif ( isSectionBlock( state, current ) ) {\n\t\t\tresult = current;\n\t\t}\n\t}\n\treturn result;\n};\n\n/**\n * Retrieves the client ID is a content locking parent\n *\n * @param {Object} state Global application state.\n * @param {string} clientId Client Id of the block.\n *\n * @return {boolean} Whether the block is a content locking parent.\n */\nexport function isSectionBlock( state, clientId ) {\n\tconst sectionRootClientId = getSectionRootClientId( state );\n\tconst sectionClientIds = getBlockOrder( state, sectionRootClientId );\n\treturn (\n\t\tgetBlockName( state, clientId ) === 'core/block' ||\n\t\tgetTemplateLock( state, clientId ) === 'contentOnly' ||\n\t\t( isNavigationMode( state ) && sectionClientIds.includes( clientId ) )\n\t);\n}\n\n/**\n * Retrieves the client ID of the block that is content locked but is\n * currently being temporarily edited as a non-locked block.\n *\n * @param {Object} state Global application state.\n *\n * @return {?string} The client ID of the block being temporarily edited as a non-locked block.\n */\nexport function getTemporarilyEditingAsBlocks( state ) {\n\treturn state.temporarilyEditingAsBlocks;\n}\n\n/**\n * Returns the focus mode that should be reapplied when the user stops editing\n * a content locked blocks as a block without locking.\n *\n * @param {Object} state Global application state.\n *\n * @return {?string} The focus mode that should be re-set when temporarily editing as blocks stops.\n */\nexport function getTemporarilyEditingFocusModeToRevert( state ) {\n\treturn state.temporarilyEditingFocusModeRevert;\n}\n\n/**\n * Returns the style attributes of multiple blocks.\n *\n * @param {Object} state Global application state.\n * @param {string[]} clientIds An array of block client IDs.\n *\n * @return {Object} An object where keys are client IDs and values are the corresponding block styles or undefined.\n */\nexport const getBlockStyles = createSelector(\n\t( state, clientIds ) =>\n\t\tclientIds.reduce( ( styles, clientId ) => {\n\t\t\tstyles[ clientId ] = state.blocks.attributes.get( clientId )?.style;\n\t\t\treturn styles;\n\t\t}, {} ),\n\t( state, clientIds ) => [\n\t\t...clientIds.map(\n\t\t\t( clientId ) => state.blocks.attributes.get( clientId )?.style\n\t\t),\n\t]\n);\n\n/**\n * Returns whether zoom out mode is enabled.\n *\n * @param {Object} state Editor state.\n *\n * @return {boolean} Is zoom out mode enabled.\n */\nexport function isZoomOutMode( state ) {\n\treturn state.editorMode === 'zoom-out';\n}\n\n/**\n * Retrieves the client ID of the block which contains the blocks\n * acting as \"sections\" in the editor. This is typically the \"main content\"\n * of the template/post.\n *\n * @param {Object} state Editor state.\n *\n * @return {string|undefined} The section root client ID or undefined if not set.\n */\nexport function getSectionRootClientId( state ) {\n\treturn state.settings?.[ sectionRootClientIdKey ];\n}\n\n/**\n * Returns the zoom out state.\n *\n * @param {Object} state Global application state.\n * @return {boolean} The zoom out state.\n */\nexport function getZoomLevel( state ) {\n\treturn state.zoomLevel;\n}\n\n/**\n * Returns whether the editor is considered zoomed out.\n *\n * @param {Object} state Global application state.\n * @return {boolean} Whether the editor is zoomed.\n */\nexport function isZoomOut( state ) {\n\treturn getZoomLevel( state ) < 100;\n}\n\n/**\n * Finds the closest block where the block is allowed to be inserted.\n *\n * @param {Object} state Editor state.\n * @param {string[] | string} name Block name or names.\n * @param {string} clientId Default insertion point.\n *\n * @return {string} clientID of the closest container when the block name can be inserted.\n */\nexport function getClosestAllowedInsertionPoint( state, name, clientId = '' ) {\n\tconst blockNames = Array.isArray( name ) ? name : [ name ];\n\tconst areBlockNamesAllowedInClientId = ( id ) =>\n\t\tblockNames.every( ( currentName ) =>\n\t\t\tcanInsertBlockType( state, currentName, id )\n\t\t);\n\n\t// If we're trying to insert at the root level and it's not allowed\n\t// Try the section root instead.\n\tif ( ! clientId ) {\n\t\tif ( areBlockNamesAllowedInClientId( clientId ) ) {\n\t\t\treturn clientId;\n\t\t}\n\n\t\tconst sectionRootClientId = getSectionRootClientId( state );\n\t\tif (\n\t\t\tsectionRootClientId &&\n\t\t\tareBlockNamesAllowedInClientId( sectionRootClientId )\n\t\t) {\n\t\t\treturn sectionRootClientId;\n\t\t}\n\t\treturn null;\n\t}\n\n\t// Traverse the block tree up until we find a place where we can insert.\n\tlet current = clientId;\n\twhile ( current !== null && ! areBlockNamesAllowedInClientId( current ) ) {\n\t\tconst parentClientId = getBlockRootClientId( state, current );\n\t\tcurrent = parentClientId;\n\t}\n\n\treturn current;\n}\n\nexport function getClosestAllowedInsertionPointForPattern(\n\tstate,\n\tpattern,\n\tclientId\n) {\n\tconst { allowedBlockTypes } = getSettings( state );\n\tconst isAllowed = checkAllowListRecursive(\n\t\tgetGrammar( pattern ),\n\t\tallowedBlockTypes\n\t);\n\tif ( ! isAllowed ) {\n\t\treturn null;\n\t}\n\tconst names = getGrammar( pattern ).map( ( { blockName: name } ) => name );\n\treturn getClosestAllowedInsertionPoint( state, names, clientId );\n}\n\n/**\n * Where the point where the next block will be inserted into.\n *\n * @param {Object} state\n * @return {Object} where the insertion point in the block editor is or null if none is set.\n */\nexport function getInsertionPoint( state ) {\n\treturn state.insertionPoint;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,cAAc,EAAEC,sBAAsB,QAAQ,iBAAiB;;AAExE;AACA;AACA;AACA,SACCC,aAAa,EACbC,eAAe,EACfC,mBAAmB,EACnBC,WAAW,EACXC,kBAAkB,EAClBC,YAAY,EACZC,eAAe,EACfC,2BAA2B,EAC3BC,gBAAgB,EAChBC,oBAAoB,QACd,aAAa;AACpB,SACCC,uBAAuB,EACvBC,wBAAwB,EACxBC,4BAA4B,EAC5BC,UAAU,QACJ,SAAS;AAChB,SAASC,sBAAsB,QAAQ,iDAAiD;AACxF,SAASC,UAAU,QAAQ,aAAa;AACxC,SAASC,MAAM,QAAQ,gBAAgB;AACvC,SACCC,sBAAsB,EACtBC,uBAAuB,EACvBC,sBAAsB,QAChB,gBAAgB;AAEvB,SAASC,gBAAgB,QAAQ,sBAAsB;;AAEvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,sBAAsBA,CAAEC,KAAK,EAAG;EAC/C,OAAOA,KAAK,CAACD,sBAAsB;AACpC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASE,8BAA8BA,CAAED,KAAK,EAAG;EACvD,OAAOA,KAAK,EAAEE,iBAAiB,EAAEC,SAAS;AAC3C;AAEA,OAAO,SAASC,yBAAyBA,CAAEJ,KAAK,EAAEK,QAAQ,EAAG;EAC5D,OAAOL,KAAK,CAACM,MAAM,CAACC,UAAU,CAACC,GAAG,CAAEH,QAAS,CAAC;AAC/C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMI,sBAAsB,GAAGA,CAAET,KAAK,EAAEK,QAAQ,KAAM;EA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C,KAAMA,IAAK,CAAC;EAC1E,OAAOiF,+BAA+B,CAAE/I,KAAK,EAAEwJ,KAAK,EAAEnJ,QAAS,CAAC;AACjE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASoJ,iBAAiBA,CAAEzJ,KAAK,EAAG;EAC1C,OAAOA,KAAK,CAAC0J,cAAc;AAC5B","ignoreList":[]}
@@ -1398,7 +1398,7 @@ export function blocksMode(state = {}, action) {
1398
1398
  *
1399
1399
  * @return {Object} Updated state.
1400
1400
  */
1401
- export function insertionPoint(state = null, action) {
1401
+ export function insertionCue(state = null, action) {
1402
1402
  switch (action.type) {
1403
1403
  case 'SHOW_INSERTION_POINT':
1404
1404
  {
@@ -1578,34 +1578,12 @@ export const blockListSettings = (state = {}, action) => {
1578
1578
  * @return {string} Updated state.
1579
1579
  */
1580
1580
  export function editorMode(state = 'edit', action) {
1581
- // Let inserting block in navigation mode always trigger Edit mode.
1582
- if (action.type === 'INSERT_BLOCKS' && state === 'navigation') {
1583
- return 'edit';
1584
- }
1585
1581
  if (action.type === 'SET_EDITOR_MODE') {
1586
1582
  return action.mode;
1587
1583
  }
1588
1584
  return state;
1589
1585
  }
1590
1586
 
1591
- /**
1592
- * Reducer returning whether the block moving mode is enabled or not.
1593
- *
1594
- * @param {string|null} state Current state.
1595
- * @param {Object} action Dispatched action.
1596
- *
1597
- * @return {string|null} Updated state.
1598
- */
1599
- export function hasBlockMovingClientId(state = null, action) {
1600
- if (action.type === 'SET_BLOCK_MOVING_MODE') {
1601
- return action.hasBlockMovingClientId;
1602
- }
1603
- if (action.type === 'SET_EDITOR_MODE') {
1604
- return null;
1605
- }
1606
- return state;
1607
- }
1608
-
1609
1587
  /**
1610
1588
  * Reducer return an updated state representing the most recent block attribute
1611
1589
  * update. The state is structured as an object where the keys represent the
@@ -1862,7 +1840,7 @@ export function hoveredBlockClientId(state = false, action) {
1862
1840
  * @param {boolean} state Current state.
1863
1841
  * @param {Object} action Dispatched action.
1864
1842
  *
1865
- * @return {boolean} Updated state.
1843
+ * @return {number} Updated state.
1866
1844
  */
1867
1845
  export function zoomLevel(state = 100, action) {
1868
1846
  switch (action.type) {
@@ -1873,6 +1851,24 @@ export function zoomLevel(state = 100, action) {
1873
1851
  }
1874
1852
  return state;
1875
1853
  }
1854
+
1855
+ /**
1856
+ * Reducer setting the insertion point
1857
+ *
1858
+ * @param {boolean} state Current state.
1859
+ * @param {Object} action Dispatched action.
1860
+ *
1861
+ * @return {Object} Updated state.
1862
+ */
1863
+ export function insertionPoint(state = null, action) {
1864
+ switch (action.type) {
1865
+ case 'SET_INSERTION_POINT':
1866
+ return action.value;
1867
+ case 'SELECT_BLOCK':
1868
+ return null;
1869
+ }
1870
+ return state;
1871
+ }
1876
1872
  const combinedReducers = combineReducers({
1877
1873
  blocks,
1878
1874
  isDragging,
@@ -1886,13 +1882,13 @@ const combinedReducers = combineReducers({
1886
1882
  blocksMode,
1887
1883
  blockListSettings,
1888
1884
  insertionPoint,
1885
+ insertionCue,
1889
1886
  template,
1890
1887
  settings,
1891
1888
  preferences,
1892
1889
  lastBlockAttributesChange,
1893
1890
  lastFocus,
1894
1891
  editorMode,
1895
- hasBlockMovingClientId,
1896
1892
  expandedBlock,
1897
1893
  highlightedBlock,
1898
1894
  lastBlockInserted,