@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":["_element","require","_index","_lockUnlock","castArray","maybeArray","Array","isArray","privateSettings","__experimentalUpdateSettings","settings","stripExperimentalSettings","reset","cleanSettings","Platform","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","exports","count","getBlockCount","__unstableHasCustomAppender","getSettings","insertDefaultBlock","clearBlockRemovalPrompt","setBlockRemovalRules","setOpenedBlockSettingsMenu","clientId","setStyleOverride","id","style","deleteStyleOverride","setLastFocus","lastFocus","stopEditingAsBlocks","focusModeToRevert","unlock","blockEditorStore","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":";;;;;;;;;;;;;;;;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAKA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AATA;AACA;AACA;;AAGA;AACA;AACA;;AAIA,MAAMG,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;AACO,SAASC,4BAA4BA,CAC3CC,QAAQ,EACR;EAAEC,yBAAyB,GAAG,KAAK;EAAEC,KAAK,GAAG;AAAM,CAAC,GAAG,CAAC,CAAC,EACxD;EACD,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I,EAAE,iCAAiC;IACvC0C;EACD,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACO,MAAMuB,sBAAsB,GAChCvB,QAAQ,IACV,CAAE;EAAEnC,MAAM;EAAEC;AAAS,CAAC,KAAM;EAC3BA,QAAQ,CAAC0D,WAAW,CAAExB,QAAS,CAAC;EAChClC,QAAQ,CAAC8C,uCAAuC,CAAC,CAAC;EAClD9C,QAAQ,CAAC+C,qBAAqB,CAAEb,QAAQ,EAAE;IACzCc,YAAY,EAAEW;EACf,CAAE,CAAC;EACH3D,QAAQ,CAACiD,uBAAuB,CAAEf,QAAQ,EAAE;IAC3C,GAAGnC,MAAM,CAACmD,oBAAoB,CAAEhB,QAAS,CAAC;IAC1Cc,YAAY,EAAE;EACf,CAAE,CAAC;EACH,MAAMN,iBAAiB,GAAG3C,MAAM,CAAC8B,WAAW,CAAC,CAAC,CAACuB,SAAS;EACxDpD,QAAQ,CAACmD,cAAc,CAAE;IAAEC,SAAS,EAAE;EAAK,CAAE,CAAC;EAC9CpD,QAAQ,CAACqD,uCAAuC,CAC/CnB,QAAQ,EACRQ,iBACD,CAAC;AACF,CAAC;;AAEF;AACA;AACA;AACA;AACA;AACA;AALAjB,OAAA,CAAAgC,sBAAA,GAAAA,sBAAA;AAMO,SAASG,YAAYA,CAAEC,IAAI,GAAG,GAAG,EAAG;EAC1C,OAAO;IACNrE,IAAI,EAAE,gBAAgB;IACtBqE;EACD,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACO,SAASC,cAAcA,CAAA,EAAG;EAChC,OAAO;IACNtE,IAAI,EAAE;EACP,CAAC;AACF","ignoreList":[]}
1
+ {"version":3,"names":["_element","require","_index","_lockUnlock","castArray","maybeArray","Array","isArray","privateSettings","__experimentalUpdateSettings","settings","stripExperimentalSettings","reset","cleanSettings","Platform","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","exports","count","getBlockCount","__unstableHasCustomAppender","getSettings","insertDefaultBlock","clearBlockRemovalPrompt","setBlockRemovalRules","setOpenedBlockSettingsMenu","clientId","setStyleOverride","id","style","deleteStyleOverride","setLastFocus","lastFocus","stopEditingAsBlocks","focusModeToRevert","unlock","blockEditorStore","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: 'RESET_ZOOM_LEVEL',\n\t};\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAKA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AATA;AACA;AACA;;AAGA;AACA;AACA;;AAIA,MAAMG,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;AACO,SAASC,4BAA4BA,CAC3CC,QAAQ,EACR;EAAEC,yBAAyB,GAAG,KAAK;EAAEC,KAAK,GAAG;AAAM,CAAC,GAAG,CAAC,CAAC,EACxD;EACD,IAAIC,aAAa,GAAGH,QAAQ;EAC5B;EACA;EACA,IAAKC,yBAAyB,IAAIG,iBAAQ,CAACC,EAAE,KAAK,KAAK,EAAG;IACzDF,aAAa,GAAG,CAAC,CAAC;IAClB,KAAM,MAAMG,GAAG,IAAIN,QAAQ,EAAG;MAC7B,IAAK,CAAEF,eAAe,CAACS,QAAQ,CAAED,GAAI,CAAC,EAAG;QACxCH,aAAa,CAAEG,GAAG,CAAE,GAAGN,QAAQ,CAAEM,GAAG,CAAE;MACvC;IACD;EACD;EACA,OAAO;IACNE,IAAI,EAAE,iBAAiB;IACvBR,QAAQ,EAAEG,aAAa;IACvBD;EACD,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACO,SAASO,kBAAkBA,CAAA,EAAG;EACpC,OAAO;IACND,IAAI,EAAE;EACP,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACO,SAASE,kBAAkB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AoB,CAAEhB,QAAS,CAAC;IAC1Cc,YAAY,EAAE;EACf,CAAE,CAAC;EACH,MAAMN,iBAAiB,GAAG3C,MAAM,CAAC8B,WAAW,CAAC,CAAC,CAACuB,SAAS;EACxDpD,QAAQ,CAACmD,cAAc,CAAE;IAAEC,SAAS,EAAE;EAAK,CAAE,CAAC;EAC9CpD,QAAQ,CAACqD,uCAAuC,CAC/CnB,QAAQ,EACRQ,iBACD,CAAC;AACF,CAAC;;AAEF;AACA;AACA;AACA;AACA;AACA;AALAjB,OAAA,CAAAkC,sBAAA,GAAAA,sBAAA;AAMO,SAASG,YAAYA,CAAEC,IAAI,GAAG,GAAG,EAAG;EAC1C,OAAO;IACNvE,IAAI,EAAE,gBAAgB;IACtBuE;EACD,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACO,SAASC,cAAcA,CAAA,EAAG;EAChC,OAAO;IACNxE,IAAI,EAAE;EACP,CAAC;AACF","ignoreList":[]}
@@ -13,13 +13,16 @@ Object.defineProperty(exports, "getBlockSettings", {
13
13
  });
14
14
  exports.getBlockStyles = void 0;
15
15
  exports.getBlockWithoutAttributes = getBlockWithoutAttributes;
16
+ exports.getClosestAllowedInsertionPoint = getClosestAllowedInsertionPoint;
17
+ exports.getClosestAllowedInsertionPointForPattern = getClosestAllowedInsertionPointForPattern;
16
18
  exports.getEnabledClientIdsTree = exports.getEnabledBlockParents = exports.getContentLockingParent = void 0;
17
19
  exports.getExpandedBlock = getExpandedBlock;
18
20
  exports.getInserterMediaCategories = void 0;
21
+ exports.getInsertionPoint = getInsertionPoint;
19
22
  exports.getLastFocus = getLastFocus;
20
23
  exports.getLastInsertedBlocksClientIds = getLastInsertedBlocksClientIds;
21
24
  exports.getOpenedBlockSettingsMenu = getOpenedBlockSettingsMenu;
22
- exports.getPatternBySlug = void 0;
25
+ exports.getPatternBySlug = exports.getParentSectionBlock = void 0;
23
26
  exports.getRegisteredInserterMediaCategories = getRegisteredInserterMediaCategories;
24
27
  exports.getRemovalPromptData = getRemovalPromptData;
25
28
  exports.getReusableBlocks = void 0;
@@ -33,6 +36,7 @@ exports.isBlockInterfaceHidden = isBlockInterfaceHidden;
33
36
  exports.isBlockSubtreeDisabled = void 0;
34
37
  exports.isDragging = isDragging;
35
38
  exports.isResolvingPatterns = void 0;
39
+ exports.isSectionBlock = isSectionBlock;
36
40
  exports.isZoomOut = isZoomOut;
37
41
  exports.isZoomOutMode = isZoomOutMode;
38
42
  var _data = require("@wordpress/data");
@@ -117,7 +121,7 @@ function getEnabledClientIdsTreeUnmemoized(state, rootClientId) {
117
121
  *
118
122
  * @return {Object[]} Tree of block objects with only clientID and innerBlocks set.
119
123
  */
120
- const getEnabledClientIdsTree = exports.getEnabledClientIdsTree = (0, _data.createSelector)(getEnabledClientIdsTreeUnmemoized, state => [state.blocks.order, state.blockEditingModes, state.settings.templateLock, state.blockListSettings, state.editorMode]);
124
+ const getEnabledClientIdsTree = exports.getEnabledClientIdsTree = (0, _data.createSelector)(getEnabledClientIdsTreeUnmemoized, state => [state.blocks.order, state.blockEditingModes, state.settings.templateLock, state.blockListSettings, state.editorMode, getSectionRootClientId(state)]);
121
125
 
122
126
  /**
123
127
  * Returns a list of a given block's ancestors, from top to bottom. Blocks with
@@ -376,20 +380,55 @@ function getExpandedBlock(state) {
376
380
  * with the provided client ID.
377
381
  *
378
382
  * @param {Object} state Global application state.
379
- * @param {Object} clientId Client Id of the block.
383
+ * @param {string} clientId Client Id of the block.
380
384
  *
381
385
  * @return {?string} Client ID of the ancestor block that is content locking the block.
382
386
  */
383
- const getContentLockingParent = exports.getContentLockingParent = (0, _data.createSelector)((state, clientId) => {
387
+ const getContentLockingParent = (state, clientId) => {
384
388
  let current = clientId;
385
389
  let result;
386
- while (current = state.blocks.parents.get(current)) {
387
- if ((0, _selectors.getBlockName)(state, current) === 'core/block' || (0, _selectors.getTemplateLock)(state, current) === 'contentOnly') {
390
+ while (!result && (current = state.blocks.parents.get(current))) {
391
+ if ((0, _selectors.getTemplateLock)(state, current) === 'contentOnly') {
388
392
  result = current;
389
393
  }
390
394
  }
391
395
  return result;
392
- }, state => [state.blocks.parents, state.blockListSettings]);
396
+ };
397
+
398
+ /**
399
+ * Retrieves the client ID of the parent section block.
400
+ *
401
+ * @param {Object} state Global application state.
402
+ * @param {string} clientId Client Id of the block.
403
+ *
404
+ * @return {?string} Client ID of the ancestor block that is content locking the block.
405
+ */
406
+ exports.getContentLockingParent = getContentLockingParent;
407
+ const getParentSectionBlock = (state, clientId) => {
408
+ let current = clientId;
409
+ let result;
410
+ while (!result && (current = state.blocks.parents.get(current))) {
411
+ if (isSectionBlock(state, current)) {
412
+ result = current;
413
+ }
414
+ }
415
+ return result;
416
+ };
417
+
418
+ /**
419
+ * Retrieves the client ID is a content locking parent
420
+ *
421
+ * @param {Object} state Global application state.
422
+ * @param {string} clientId Client Id of the block.
423
+ *
424
+ * @return {boolean} Whether the block is a content locking parent.
425
+ */
426
+ exports.getParentSectionBlock = getParentSectionBlock;
427
+ function isSectionBlock(state, clientId) {
428
+ const sectionRootClientId = getSectionRootClientId(state);
429
+ const sectionClientIds = (0, _selectors.getBlockOrder)(state, sectionRootClientId);
430
+ return (0, _selectors.getBlockName)(state, clientId) === 'core/block' || (0, _selectors.getTemplateLock)(state, clientId) === 'contentOnly' || (0, _selectors.isNavigationMode)(state) && sectionClientIds.includes(clientId);
431
+ }
393
432
 
394
433
  /**
395
434
  * Retrieves the client ID of the block that is content locked but is
@@ -471,4 +510,62 @@ function getZoomLevel(state) {
471
510
  function isZoomOut(state) {
472
511
  return getZoomLevel(state) < 100;
473
512
  }
513
+
514
+ /**
515
+ * Finds the closest block where the block is allowed to be inserted.
516
+ *
517
+ * @param {Object} state Editor state.
518
+ * @param {string[] | string} name Block name or names.
519
+ * @param {string} clientId Default insertion point.
520
+ *
521
+ * @return {string} clientID of the closest container when the block name can be inserted.
522
+ */
523
+ function getClosestAllowedInsertionPoint(state, name, clientId = '') {
524
+ const blockNames = Array.isArray(name) ? name : [name];
525
+ const areBlockNamesAllowedInClientId = id => blockNames.every(currentName => (0, _selectors.canInsertBlockType)(state, currentName, id));
526
+
527
+ // If we're trying to insert at the root level and it's not allowed
528
+ // Try the section root instead.
529
+ if (!clientId) {
530
+ if (areBlockNamesAllowedInClientId(clientId)) {
531
+ return clientId;
532
+ }
533
+ const sectionRootClientId = getSectionRootClientId(state);
534
+ if (sectionRootClientId && areBlockNamesAllowedInClientId(sectionRootClientId)) {
535
+ return sectionRootClientId;
536
+ }
537
+ return null;
538
+ }
539
+
540
+ // Traverse the block tree up until we find a place where we can insert.
541
+ let current = clientId;
542
+ while (current !== null && !areBlockNamesAllowedInClientId(current)) {
543
+ const parentClientId = (0, _selectors.getBlockRootClientId)(state, current);
544
+ current = parentClientId;
545
+ }
546
+ return current;
547
+ }
548
+ function getClosestAllowedInsertionPointForPattern(state, pattern, clientId) {
549
+ const {
550
+ allowedBlockTypes
551
+ } = (0, _selectors.getSettings)(state);
552
+ const isAllowed = (0, _utils.checkAllowListRecursive)((0, _utils.getGrammar)(pattern), allowedBlockTypes);
553
+ if (!isAllowed) {
554
+ return null;
555
+ }
556
+ const names = (0, _utils.getGrammar)(pattern).map(({
557
+ blockName: name
558
+ }) => name);
559
+ return getClosestAllowedInsertionPoint(state, names, clientId);
560
+ }
561
+
562
+ /**
563
+ * Where the point where the next block will be inserted into.
564
+ *
565
+ * @param {Object} state
566
+ * @return {Object} where the insertion point in the block editor is or null if none is set.
567
+ */
568
+ function getInsertionPoint(state) {
569
+ return state.insertionPoint;
570
+ }
474
571
  //# sourceMappingURL=private-selectors.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_data","require","_selectors","_utils","_utils2","_constants","_lockUnlock","_privateKeys","_getBlockSettings","isBlockInterfaceHidden","state","getLastInsertedBlocksClientIds","lastBlockInserted","clientIds","getBlockWithoutAttributes","clientId","blocks","byClientId","get","isBlockSubtreeDisabled","isChildSubtreeDisabled","childClientId","getBlockEditingMode","getBlockOrder","every","exports","getEnabledClientIdsTreeUnmemoized","rootClientId","blockOrder","result","innerBlocks","push","getEnabledClientIdsTree","createSelector","order","blockEditingModes","settings","templateLock","blockListSettings","editorMode","getEnabledBlockParents","ascending","getBlockParents","filter","parent","parents","getRemovalPromptData","removalPromptData","getBlockRemovalRules","blockRemovalRules","getOpenedBlockSettingsMenu","openedBlockSettingsMenu","getStyleOverrides","getClientIdsWithDescendants","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","createRegistrySelector","select","getAllPatterns","unlock","STORE_NAME","patterns","allowedBlockTypes","getSettings","pattern","inserter","grammar","getGrammar","checkAllowListRecursive","blockName","canInsertBlockType","getAllPatternsDependants","getInsertBlockTypeDependants","mapUserPattern","userPattern","__experimentalUserPatternCategories","id","type","INSERTER_PATTERN_TYPES","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","selectBlockPatternsKey","__experimentalReusableBlocks","_state$settings$__exp2","_state$settings$selec2","x","arr","findIndex","y","isResolvingPatterns","blockPatternsSelect","reusableBlocksSelect","reusableBlocksSelectKey","undefined","EMPTY_ARRAY","_ref","getLastFocus","lastFocus","isDragging","getExpandedBlock","expandedBlock","getContentLockingParent","current","getBlockName","getTemplateLock","getTemporarilyEditingAsBlocks","temporarilyEditingAsBlocks","getTemporarilyEditingFocusModeToRevert","temporarilyEditingFocusModeRevert","getBlockStyles","styles","attributes","style","isZoomOutMode","getSectionRootClientId","sectionRootClientIdKey","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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAKA,IAAAC,UAAA,GAAAD,OAAA;AAUA,IAAAE,MAAA,GAAAF,OAAA;AAMA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AAMA,IAAAO,iBAAA,GAAAP,OAAA;AAjCA;AACA;AACA;;AAGA;AACA;AACA;;AA4BA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASQ,sBAAsBA,CAAEC,KAAK,EAAG;EAC/C,OAAOA,KAAK,CAACD,sBAAsB;AACpC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,SAASE,8BAA8BA,CAAED,KAAK,EAAG;EACvD,OAAOA,KAAK,EAAEE,iBAAiB,EAAEC,S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;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,cAAc,GAAAvI,OAAA,CAAAuI,cAAA,GAAG,IAAA/H,oBAAc,EAC3C,CAAEvB,KAAK,EAAEG,SAAS,KACjBA,SAAS,CAAC0C,MAAM,CAAE,CAAE0G,MAAM,EAAElJ,QAAQ,KAAM;EACzCkJ,MAAM,CAAElJ,QAAQ,CAAE,GAAGL,KAAK,CAACM,MAAM,CAACkJ,UAAU,CAAChJ,GAAG,CAAEH,QAAS,CAAC,EAAEoJ,KAAK;EACnE,OAAOF,MAAM;AACd,CAAC,EAAE,CAAC,CAAE,CAAC,EACR,CAAEvJ,KAAK,EAAEG,SAAS,KAAM,CACvB,GAAGA,SAAS,CAAC+D,GAAG,CACb7D,QAAQ,IAAML,KAAK,CAACM,MAAM,CAACkJ,UAAU,CAAChJ,GAAG,CAAEH,QAAS,CAAC,EAAEoJ,KAC1D,CAAC,CAEH,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,aAAaA,CAAE1J,KAAK,EAAG;EACtC,OAAOA,KAAK,CAAC6B,UAAU,KAAK,UAAU;AACvC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS8H,sBAAsBA,CAAE3J,KAAK,EAAG;EAC/C,OAAOA,KAAK,CAAC0B,QAAQ,GAAIkI,mCAAsB,CAAE;AAClD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,YAAYA,CAAE7J,KAAK,EAAG;EACrC,OAAOA,KAAK,CAAC8J,SAAS;AACvB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,SAASA,CAAE/J,KAAK,EAAG;EAClC,OAAO6J,YAAY,CAAE7J,KAAM,CAAC,GAAG,GAAG;AACnC","ignoreList":[]}
1
+ {"version":3,"names":["_data","require","_selectors","_utils","_utils2","_constants","_lockUnlock","_privateKeys","_getBlockSettings","isBlockInterfaceHidden","state","getLastInsertedBlocksClientIds","lastBlockInserted","clientIds","getBlockWithoutAttributes","clientId","blocks","byClientId","get","isBlockSubtreeDisabled","isChildSubtreeDisabled","childClientId","getBlockEditingMode","getBlockOrder","every","exports","getEnabledClientIdsTreeUnmemoized","rootClientId","blockOrder","result","innerBlocks","push","getEnabledClientIdsTree","createSelector","order","blockEditingModes","settings","templateLock","blockListSettings","editorMode","getSectionRootClientId","getEnabledBlockParents","ascending","getBlockParents","filter","parent","parents","getRemovalPromptData","removalPromptData","getBlockRemovalRules","blockRemovalRules","getOpenedBlockSettingsMenu","openedBlockSettingsMenu","getStyleOverrides","getClientIdsWithDescendants","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","createRegistrySelector","select","getAllPatterns","unlock","STORE_NAME","patterns","allowedBlockTypes","getSettings","pattern","inserter","grammar","getGrammar","checkAllowListRecursive","blockName","canInsertBlockType","getAllPatternsDependants","getInsertBlockTypeDependants","mapUserPattern","userPattern","__experimentalUserPatternCategories","id","type","INSERTER_PATTERN_TYPES","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","selectBlockPatternsKey","__experimentalReusableBlocks","_state$settings$__exp2","_state$settings$selec2","x","arr","findIndex","y","isResolvingPatterns","blockPatternsSelect","reusableBlocksSelect","reusableBlocksSelectKey","undefined","EMPTY_ARRAY","_ref","getLastFocus","lastFocus","isDragging","getExpandedBlock","expandedBlock","getContentLockingParent","current","getTemplateLock","getParentSectionBlock","isSectionBlock","sectionRootClientId","sectionClientIds","getBlockName","isNavigationMode","getTemporarilyEditingAsBlocks","temporarilyEditingAsBlocks","getTemporarilyEditingFocusModeToRevert","temporarilyEditingFocusModeRevert","getBlockStyles","styles","attributes","style","isZoomOutMode","sectionRootClientIdKey","getZoomLevel","zoomLevel","isZoomOut","getClosestAllowedInsertionPoint","blockNames","Array","isArray","areBlockNamesAllowedInClientId","currentName","parentClientId","getBlockRootClientId","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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAKA,IAAAC,UAAA,GAAAD,OAAA;AAYA,IAAAE,MAAA,GAAAF,OAAA;AAMA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AAMA,IAAAO,iBAAA,GAAAP,OAAA;AAnCA;AACA;AACA;;AAGA;AACA;AACA;;AA8BA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASQ,sBAAsBA,CAAEC,KAAK,EAAG;EAC/C,OAAOA,KAAK,CAACD,sBAAsB;AACpC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,SAASE,8BAA8BA,CAAED,KAAK,EAAG;EACvD,OAAOA,KAAK,EAAEE,iBAAiB,EAAEC,SAAS;AAC3C;AAEO,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;AACO,MAAMI,sBAAsB,GAAGA,CAAET,KAAK,EAAEK,QAAQ,KAAM;EAC5D,MAAMK,sBAAsB,GAAKC,aAAa,IAAM;IACnD,OACC,IAAAC,8BAAmB,EAAEZ,KAAK,EAAEW,aAAc,CAAC,KAAK,UAAU,IAC1D,IAAAE,wBAAa,EAAEb,KAAK,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AAO3B,OAAO;AACf;AAEO,SAAS6B,yCAAyCA,CACxD7K,KAAK,EACLuF,OAAO,EACPlF,QAAQ,EACP;EACD,MAAM;IAAEgF;EAAkB,CAAC,GAAG,IAAAC,sBAAW,EAAEtF,KAAM,CAAC;EAClD,MAAM8K,SAAS,GAAG,IAAAnF,8BAAuB,EACxC,IAAAD,iBAAU,EAAEH,OAAQ,CAAC,EACrBF,iBACD,CAAC;EACD,IAAK,CAAEyF,SAAS,EAAG;IAClB,OAAO,IAAI;EACZ;EACA,MAAMC,KAAK,GAAG,IAAArF,iBAAU,EAAEH,OAAQ,CAAC,CAACpB,GAAG,CAAE,CAAE;IAAEyB,SAAS,EAAExB;EAAK,CAAC,KAAMA,IAAK,CAAC;EAC1E,OAAOiG,+BAA+B,CAAErK,KAAK,EAAE+K,KAAK,EAAE1K,QAAS,CAAC;AACjE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS2K,iBAAiBA,CAAEhL,KAAK,EAAG;EAC1C,OAAOA,KAAK,CAACiL,cAAc;AAC5B","ignoreList":[]}
@@ -13,11 +13,11 @@ exports.default = void 0;
13
13
  exports.draggedBlocks = draggedBlocks;
14
14
  exports.editorMode = editorMode;
15
15
  exports.expandedBlock = expandedBlock;
16
- exports.hasBlockMovingClientId = hasBlockMovingClientId;
17
16
  exports.hasSameKeys = hasSameKeys;
18
17
  exports.highlightedBlock = highlightedBlock;
19
18
  exports.hoveredBlockClientId = hoveredBlockClientId;
20
19
  exports.initialPosition = initialPosition;
20
+ exports.insertionCue = insertionCue;
21
21
  exports.insertionPoint = insertionPoint;
22
22
  exports.isBlockInterfaceHidden = isBlockInterfaceHidden;
23
23
  exports.isDragging = isDragging;
@@ -1440,7 +1440,7 @@ function blocksMode(state = {}, action) {
1440
1440
  *
1441
1441
  * @return {Object} Updated state.
1442
1442
  */
1443
- function insertionPoint(state = null, action) {
1443
+ function insertionCue(state = null, action) {
1444
1444
  switch (action.type) {
1445
1445
  case 'SHOW_INSERTION_POINT':
1446
1446
  {
@@ -1621,34 +1621,12 @@ const blockListSettings = (state = {}, action) => {
1621
1621
  */
1622
1622
  exports.blockListSettings = blockListSettings;
1623
1623
  function editorMode(state = 'edit', action) {
1624
- // Let inserting block in navigation mode always trigger Edit mode.
1625
- if (action.type === 'INSERT_BLOCKS' && state === 'navigation') {
1626
- return 'edit';
1627
- }
1628
1624
  if (action.type === 'SET_EDITOR_MODE') {
1629
1625
  return action.mode;
1630
1626
  }
1631
1627
  return state;
1632
1628
  }
1633
1629
 
1634
- /**
1635
- * Reducer returning whether the block moving mode is enabled or not.
1636
- *
1637
- * @param {string|null} state Current state.
1638
- * @param {Object} action Dispatched action.
1639
- *
1640
- * @return {string|null} Updated state.
1641
- */
1642
- function hasBlockMovingClientId(state = null, action) {
1643
- if (action.type === 'SET_BLOCK_MOVING_MODE') {
1644
- return action.hasBlockMovingClientId;
1645
- }
1646
- if (action.type === 'SET_EDITOR_MODE') {
1647
- return null;
1648
- }
1649
- return state;
1650
- }
1651
-
1652
1630
  /**
1653
1631
  * Reducer return an updated state representing the most recent block attribute
1654
1632
  * update. The state is structured as an object where the keys represent the
@@ -1905,7 +1883,7 @@ function hoveredBlockClientId(state = false, action) {
1905
1883
  * @param {boolean} state Current state.
1906
1884
  * @param {Object} action Dispatched action.
1907
1885
  *
1908
- * @return {boolean} Updated state.
1886
+ * @return {number} Updated state.
1909
1887
  */
1910
1888
  function zoomLevel(state = 100, action) {
1911
1889
  switch (action.type) {
@@ -1916,6 +1894,24 @@ function zoomLevel(state = 100, action) {
1916
1894
  }
1917
1895
  return state;
1918
1896
  }
1897
+
1898
+ /**
1899
+ * Reducer setting the insertion point
1900
+ *
1901
+ * @param {boolean} state Current state.
1902
+ * @param {Object} action Dispatched action.
1903
+ *
1904
+ * @return {Object} Updated state.
1905
+ */
1906
+ function insertionPoint(state = null, action) {
1907
+ switch (action.type) {
1908
+ case 'SET_INSERTION_POINT':
1909
+ return action.value;
1910
+ case 'SELECT_BLOCK':
1911
+ return null;
1912
+ }
1913
+ return state;
1914
+ }
1919
1915
  const combinedReducers = (0, _data.combineReducers)({
1920
1916
  blocks,
1921
1917
  isDragging,
@@ -1929,13 +1925,13 @@ const combinedReducers = (0, _data.combineReducers)({
1929
1925
  blocksMode,
1930
1926
  blockListSettings,
1931
1927
  insertionPoint,
1928
+ insertionCue,
1932
1929
  template,
1933
1930
  settings,
1934
1931
  preferences,
1935
1932
  lastBlockAttributesChange,
1936
1933
  lastFocus,
1937
1934
  editorMode,
1938
- hasBlockMovingClientId,
1939
1935
  expandedBlock,
1940
1936
  highlightedBlock,
1941
1937
  lastBlockInserted,