@wordpress/block-editor 14.6.0 → 14.7.1-next.082ed6819.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 (332) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/block-controls/slot.js +6 -3
  3. package/build/components/block-controls/slot.js.map +1 -1
  4. package/build/components/block-inspector/index.js +1 -2
  5. package/build/components/block-inspector/index.js.map +1 -1
  6. package/build/components/block-list/block.js +14 -28
  7. package/build/components/block-list/block.js.map +1 -1
  8. package/build/components/block-lock/modal.js +1 -1
  9. package/build/components/block-lock/modal.js.map +1 -1
  10. package/build/components/block-manager/category.js +79 -0
  11. package/build/components/block-manager/category.js.map +1 -0
  12. package/build/components/block-manager/checklist.js +40 -0
  13. package/build/components/block-manager/checklist.js.map +1 -0
  14. package/build/components/block-manager/index.js +108 -0
  15. package/build/components/block-manager/index.js.map +1 -0
  16. package/build/components/block-patterns-list/index.js +23 -26
  17. package/build/components/block-patterns-list/index.js.map +1 -1
  18. package/build/components/block-popover/index.js +1 -1
  19. package/build/components/block-popover/index.js.map +1 -1
  20. package/build/components/block-preview/async.js +51 -0
  21. package/build/components/block-preview/async.js.map +1 -0
  22. package/build/components/block-preview/index.js +4 -1
  23. package/build/components/block-preview/index.js.map +1 -1
  24. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  25. package/build/components/block-settings-menu/index.js.map +1 -1
  26. package/build/components/block-toolbar/change-design.js +1 -4
  27. package/build/components/block-toolbar/change-design.js.map +1 -1
  28. package/build/components/block-toolbar/index.js +7 -2
  29. package/build/components/block-toolbar/index.js.map +1 -1
  30. package/build/components/block-toolbar/switch-section-style.js +105 -0
  31. package/build/components/block-toolbar/switch-section-style.js.map +1 -0
  32. package/build/components/block-tools/index.js +12 -9
  33. package/build/components/block-tools/index.js.map +1 -1
  34. package/build/components/block-tools/use-block-toolbar-popover-props.js +1 -1
  35. package/build/components/block-tools/use-block-toolbar-popover-props.js.map +1 -1
  36. package/build/components/block-tools/use-show-block-tools.js +4 -1
  37. package/build/components/block-tools/use-show-block-tools.js.map +1 -1
  38. package/build/components/collab/block-comment-icon-slot.js +2 -6
  39. package/build/components/collab/block-comment-icon-slot.js.map +1 -1
  40. package/build/components/collab/block-comment-icon-toolbar-slot.js +2 -6
  41. package/build/components/collab/block-comment-icon-toolbar-slot.js.map +1 -1
  42. package/build/components/color-palette/with-color-context.js +4 -2
  43. package/build/components/color-palette/with-color-context.js.map +1 -1
  44. package/build/components/font-family/index.js +14 -13
  45. package/build/components/font-family/index.js.map +1 -1
  46. package/build/components/global-styles/dimensions-panel.js +26 -14
  47. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  48. package/build/components/global-styles/use-global-styles-output.js +1 -1
  49. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  50. package/build/components/iframe/get-compatibility-styles.js +4 -4
  51. package/build/components/iframe/get-compatibility-styles.js.map +1 -1
  52. package/build/components/iframe/index.js +156 -23
  53. package/build/components/iframe/index.js.map +1 -1
  54. package/build/components/inserter/block-patterns-explorer/pattern-list.js +2 -2
  55. package/build/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
  56. package/build/components/inserter/block-patterns-tab/index.js +1 -2
  57. package/build/components/inserter/block-patterns-tab/index.js.map +1 -1
  58. package/build/components/inserter/block-patterns-tab/pattern-category-previews.js +4 -6
  59. package/build/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
  60. package/build/components/inserter/block-patterns-tab/use-pattern-categories.js +3 -0
  61. package/build/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
  62. package/build/components/inserter/block-patterns-tab/utils.js +5 -1
  63. package/build/components/inserter/block-patterns-tab/utils.js.map +1 -1
  64. package/build/components/inserter/category-tabs/index.js +7 -8
  65. package/build/components/inserter/category-tabs/index.js.map +1 -1
  66. package/build/components/inserter/hooks/use-block-types-state.js +1 -1
  67. package/build/components/inserter/hooks/use-block-types-state.js.map +1 -1
  68. package/build/components/inserter/hooks/use-patterns-paging.js +0 -5
  69. package/build/components/inserter/hooks/use-patterns-paging.js.map +1 -1
  70. package/build/components/inserter/search-results.js +0 -2
  71. package/build/components/inserter/search-results.js.map +1 -1
  72. package/build/components/inserter-draggable-blocks/index.js +2 -1
  73. package/build/components/inserter-draggable-blocks/index.js.map +1 -1
  74. package/build/components/inspector-controls/slot.js +7 -4
  75. package/build/components/inspector-controls/slot.js.map +1 -1
  76. package/build/components/inspector-controls-tabs/position-controls-panel.js +1 -1
  77. package/build/components/inspector-controls-tabs/position-controls-panel.js.map +1 -1
  78. package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js +4 -4
  79. package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -1
  80. package/build/components/media-placeholder/index.js +33 -25
  81. package/build/components/media-placeholder/index.js.map +1 -1
  82. package/build/components/rich-text/index.js +1 -1
  83. package/build/components/rich-text/index.js.map +1 -1
  84. package/build/components/tabbed-sidebar/index.js +1 -1
  85. package/build/components/tabbed-sidebar/index.js.map +1 -1
  86. package/build/components/url-input/index.js +3 -1
  87. package/build/components/url-input/index.js.map +1 -1
  88. package/build/components/use-block-commands/index.js +5 -6
  89. package/build/components/use-block-commands/index.js.map +1 -1
  90. package/build/hooks/border.js +3 -3
  91. package/build/hooks/border.js.map +1 -1
  92. package/build/hooks/color.js +1 -1
  93. package/build/hooks/color.js.map +1 -1
  94. package/build/hooks/dimensions.js +2 -2
  95. package/build/hooks/dimensions.js.map +1 -1
  96. package/build/hooks/font-family.js +1 -1
  97. package/build/hooks/font-family.js.map +1 -1
  98. package/build/hooks/style.js +6 -6
  99. package/build/hooks/style.js.map +1 -1
  100. package/build/hooks/supports.js +7 -7
  101. package/build/hooks/supports.js.map +1 -1
  102. package/build/hooks/typography.js +6 -6
  103. package/build/hooks/typography.js.map +1 -1
  104. package/build/hooks/utils.js +3 -3
  105. package/build/hooks/utils.js.map +1 -1
  106. package/build/layouts/flex.js +11 -9
  107. package/build/layouts/flex.js.map +1 -1
  108. package/build/lock-unlock.js.map +1 -1
  109. package/build/private-apis.js +4 -4
  110. package/build/private-apis.js.map +1 -1
  111. package/build/store/private-selectors.js +3 -3
  112. package/build/store/private-selectors.js.map +1 -1
  113. package/build/store/selectors.js +12 -8
  114. package/build/store/selectors.js.map +1 -1
  115. package/build/store/utils.js +5 -4
  116. package/build/store/utils.js.map +1 -1
  117. package/build/utils/dom.js +27 -22
  118. package/build/utils/dom.js.map +1 -1
  119. package/build-module/components/block-controls/slot.js +6 -3
  120. package/build-module/components/block-controls/slot.js.map +1 -1
  121. package/build-module/components/block-inspector/index.js +1 -2
  122. package/build-module/components/block-inspector/index.js.map +1 -1
  123. package/build-module/components/block-list/block.js +15 -27
  124. package/build-module/components/block-list/block.js.map +1 -1
  125. package/build-module/components/block-lock/modal.js +1 -1
  126. package/build-module/components/block-lock/modal.js.map +1 -1
  127. package/build-module/components/block-manager/category.js +71 -0
  128. package/build-module/components/block-manager/category.js.map +1 -0
  129. package/build-module/components/block-manager/checklist.js +32 -0
  130. package/build-module/components/block-manager/checklist.js.map +1 -0
  131. package/build-module/components/block-manager/index.js +102 -0
  132. package/build-module/components/block-manager/index.js.map +1 -0
  133. package/build-module/components/block-patterns-list/index.js +23 -26
  134. package/build-module/components/block-patterns-list/index.js.map +1 -1
  135. package/build-module/components/block-popover/index.js +2 -2
  136. package/build-module/components/block-popover/index.js.map +1 -1
  137. package/build-module/components/block-preview/async.js +44 -0
  138. package/build-module/components/block-preview/async.js.map +1 -0
  139. package/build-module/components/block-preview/index.js +4 -1
  140. package/build-module/components/block-preview/index.js.map +1 -1
  141. package/build-module/components/block-settings-menu/block-settings-dropdown.js +2 -2
  142. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  143. package/build-module/components/block-settings-menu/index.js +2 -2
  144. package/build-module/components/block-settings-menu/index.js.map +1 -1
  145. package/build-module/components/block-toolbar/change-design.js +1 -4
  146. package/build-module/components/block-toolbar/change-design.js.map +1 -1
  147. package/build-module/components/block-toolbar/index.js +7 -2
  148. package/build-module/components/block-toolbar/index.js.map +1 -1
  149. package/build-module/components/block-toolbar/switch-section-style.js +97 -0
  150. package/build-module/components/block-toolbar/switch-section-style.js.map +1 -0
  151. package/build-module/components/block-tools/index.js +13 -10
  152. package/build-module/components/block-tools/index.js.map +1 -1
  153. package/build-module/components/block-tools/use-block-toolbar-popover-props.js +2 -2
  154. package/build-module/components/block-tools/use-block-toolbar-popover-props.js.map +1 -1
  155. package/build-module/components/block-tools/use-show-block-tools.js +4 -1
  156. package/build-module/components/block-tools/use-show-block-tools.js.map +1 -1
  157. package/build-module/components/collab/block-comment-icon-slot.js +2 -6
  158. package/build-module/components/collab/block-comment-icon-slot.js.map +1 -1
  159. package/build-module/components/collab/block-comment-icon-toolbar-slot.js +2 -6
  160. package/build-module/components/collab/block-comment-icon-toolbar-slot.js.map +1 -1
  161. package/build-module/components/color-palette/with-color-context.js +4 -2
  162. package/build-module/components/color-palette/with-color-context.js.map +1 -1
  163. package/build-module/components/font-family/index.js +15 -14
  164. package/build-module/components/font-family/index.js.map +1 -1
  165. package/build-module/components/global-styles/dimensions-panel.js +26 -14
  166. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  167. package/build-module/components/global-styles/use-global-styles-output.js +1 -1
  168. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  169. package/build-module/components/iframe/get-compatibility-styles.js +4 -4
  170. package/build-module/components/iframe/get-compatibility-styles.js.map +1 -1
  171. package/build-module/components/iframe/index.js +157 -24
  172. package/build-module/components/iframe/index.js.map +1 -1
  173. package/build-module/components/inserter/block-patterns-explorer/pattern-list.js +2 -2
  174. package/build-module/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
  175. package/build-module/components/inserter/block-patterns-tab/index.js +1 -2
  176. package/build-module/components/inserter/block-patterns-tab/index.js.map +1 -1
  177. package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js +5 -7
  178. package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
  179. package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js +4 -1
  180. package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
  181. package/build-module/components/inserter/block-patterns-tab/utils.js +4 -0
  182. package/build-module/components/inserter/block-patterns-tab/utils.js.map +1 -1
  183. package/build-module/components/inserter/category-tabs/index.js +8 -9
  184. package/build-module/components/inserter/category-tabs/index.js.map +1 -1
  185. package/build-module/components/inserter/hooks/use-block-types-state.js +1 -1
  186. package/build-module/components/inserter/hooks/use-block-types-state.js.map +1 -1
  187. package/build-module/components/inserter/hooks/use-patterns-paging.js +1 -6
  188. package/build-module/components/inserter/hooks/use-patterns-paging.js.map +1 -1
  189. package/build-module/components/inserter/search-results.js +0 -2
  190. package/build-module/components/inserter/search-results.js.map +1 -1
  191. package/build-module/components/inserter-draggable-blocks/index.js +2 -1
  192. package/build-module/components/inserter-draggable-blocks/index.js.map +1 -1
  193. package/build-module/components/inspector-controls/slot.js +7 -4
  194. package/build-module/components/inspector-controls/slot.js.map +1 -1
  195. package/build-module/components/inspector-controls-tabs/position-controls-panel.js +1 -1
  196. package/build-module/components/inspector-controls-tabs/position-controls-panel.js.map +1 -1
  197. package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js +4 -4
  198. package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -1
  199. package/build-module/components/media-placeholder/index.js +33 -25
  200. package/build-module/components/media-placeholder/index.js.map +1 -1
  201. package/build-module/components/rich-text/index.js +1 -1
  202. package/build-module/components/rich-text/index.js.map +1 -1
  203. package/build-module/components/tabbed-sidebar/index.js +1 -1
  204. package/build-module/components/tabbed-sidebar/index.js.map +1 -1
  205. package/build-module/components/url-input/index.js +3 -1
  206. package/build-module/components/url-input/index.js.map +1 -1
  207. package/build-module/components/use-block-commands/index.js +4 -4
  208. package/build-module/components/use-block-commands/index.js.map +1 -1
  209. package/build-module/hooks/border.js +3 -3
  210. package/build-module/hooks/border.js.map +1 -1
  211. package/build-module/hooks/color.js +1 -1
  212. package/build-module/hooks/color.js.map +1 -1
  213. package/build-module/hooks/dimensions.js +2 -2
  214. package/build-module/hooks/dimensions.js.map +1 -1
  215. package/build-module/hooks/font-family.js +1 -1
  216. package/build-module/hooks/font-family.js.map +1 -1
  217. package/build-module/hooks/style.js +6 -6
  218. package/build-module/hooks/style.js.map +1 -1
  219. package/build-module/hooks/supports.js +7 -7
  220. package/build-module/hooks/supports.js.map +1 -1
  221. package/build-module/hooks/typography.js +6 -6
  222. package/build-module/hooks/typography.js.map +1 -1
  223. package/build-module/hooks/utils.js +3 -3
  224. package/build-module/hooks/utils.js.map +1 -1
  225. package/build-module/layouts/flex.js +11 -9
  226. package/build-module/layouts/flex.js.map +1 -1
  227. package/build-module/lock-unlock.js.map +1 -1
  228. package/build-module/private-apis.js +6 -6
  229. package/build-module/private-apis.js.map +1 -1
  230. package/build-module/store/private-selectors.js +3 -3
  231. package/build-module/store/private-selectors.js.map +1 -1
  232. package/build-module/store/selectors.js +12 -8
  233. package/build-module/store/selectors.js.map +1 -1
  234. package/build-module/store/utils.js +3 -3
  235. package/build-module/store/utils.js.map +1 -1
  236. package/build-module/utils/dom.js +25 -21
  237. package/build-module/utils/dom.js.map +1 -1
  238. package/build-style/content-rtl.css +30 -15
  239. package/build-style/content.css +30 -15
  240. package/build-style/style-rtl.css +92 -3
  241. package/build-style/style.css +92 -3
  242. package/build-types/utils/dom.d.ts +7 -9
  243. package/build-types/utils/dom.d.ts.map +1 -1
  244. package/package.json +32 -31
  245. package/src/components/block-canvas/style.scss +1 -1
  246. package/src/components/block-controls/slot.js +5 -3
  247. package/src/components/block-inspector/index.js +0 -2
  248. package/src/components/block-inspector/style.scss +2 -1
  249. package/src/components/block-list/block.js +28 -48
  250. package/src/components/block-lock/modal.js +1 -1
  251. package/src/components/block-manager/category.js +102 -0
  252. package/src/components/block-manager/checklist.js +34 -0
  253. package/src/components/block-manager/index.js +127 -0
  254. package/src/components/block-manager/style.scss +82 -0
  255. package/src/components/block-mover/README.md +15 -8
  256. package/src/components/block-mover/stories/index.story.js +73 -71
  257. package/src/components/block-mover/style.scss +3 -0
  258. package/src/components/block-patterns-list/README.md +8 -8
  259. package/src/components/block-patterns-list/index.js +35 -51
  260. package/src/components/block-patterns-list/stories/index.story.js +2 -19
  261. package/src/components/block-popover/index.js +4 -4
  262. package/src/components/block-preview/async.js +43 -0
  263. package/src/components/block-preview/index.js +6 -1
  264. package/src/components/block-settings-menu/block-settings-dropdown.js +2 -2
  265. package/src/components/block-settings-menu/index.js +2 -2
  266. package/src/components/block-toolbar/change-design.js +1 -7
  267. package/src/components/block-toolbar/index.js +6 -0
  268. package/src/components/block-toolbar/switch-section-style.js +115 -0
  269. package/src/components/block-tools/index.js +26 -10
  270. package/src/components/block-tools/style.scss +12 -0
  271. package/src/components/block-tools/use-block-toolbar-popover-props.js +2 -2
  272. package/src/components/block-tools/use-show-block-tools.js +3 -1
  273. package/src/components/collab/block-comment-icon-slot.js +2 -6
  274. package/src/components/collab/block-comment-icon-toolbar-slot.js +3 -5
  275. package/src/components/color-palette/with-color-context.js +25 -7
  276. package/src/components/default-block-appender/content.scss +13 -19
  277. package/src/components/font-family/index.js +13 -13
  278. package/src/components/global-styles/dimensions-panel.js +22 -16
  279. package/src/components/global-styles/test/use-global-styles-output.js +1 -1
  280. package/src/components/global-styles/use-global-styles-output.js +1 -1
  281. package/src/components/iframe/content.scss +16 -3
  282. package/src/components/iframe/get-compatibility-styles.js +4 -9
  283. package/src/components/iframe/index.js +204 -44
  284. package/src/components/inserter/block-patterns-explorer/pattern-list.js +3 -6
  285. package/src/components/inserter/block-patterns-tab/index.js +0 -1
  286. package/src/components/inserter/block-patterns-tab/pattern-category-previews.js +15 -17
  287. package/src/components/inserter/block-patterns-tab/use-pattern-categories.js +8 -0
  288. package/src/components/inserter/block-patterns-tab/utils.js +5 -0
  289. package/src/components/inserter/category-tabs/index.js +8 -9
  290. package/src/components/inserter/hooks/use-block-types-state.js +6 -1
  291. package/src/components/inserter/hooks/use-patterns-paging.js +1 -6
  292. package/src/components/inserter/search-results.js +0 -6
  293. package/src/components/inserter-draggable-blocks/index.js +10 -1
  294. package/src/components/inspector-controls/README.md +2 -0
  295. package/src/components/inspector-controls/slot.js +6 -4
  296. package/src/components/inspector-controls-tabs/position-controls-panel.js +1 -3
  297. package/src/components/inspector-controls-tabs/use-inspector-controls-tabs.js +10 -10
  298. package/src/components/media-placeholder/index.js +41 -37
  299. package/src/components/provider/test/use-block-sync.js +3 -1
  300. package/src/components/rich-text/content.scss +15 -10
  301. package/src/components/rich-text/index.js +8 -1
  302. package/src/components/tabbed-sidebar/index.js +1 -1
  303. package/src/components/tabbed-sidebar/style.scss +1 -1
  304. package/src/components/url-input/index.js +3 -4
  305. package/src/components/use-block-commands/index.js +245 -234
  306. package/src/hooks/border.js +3 -9
  307. package/src/hooks/color.js +1 -1
  308. package/src/hooks/dimensions.js +2 -2
  309. package/src/hooks/font-family.js +1 -1
  310. package/src/hooks/style.js +6 -12
  311. package/src/hooks/supports.js +7 -7
  312. package/src/hooks/test/style.js +1 -2
  313. package/src/hooks/typography.js +6 -6
  314. package/src/hooks/utils.js +8 -3
  315. package/src/layouts/flex.js +26 -18
  316. package/src/private-apis.js +6 -6
  317. package/src/store/private-selectors.js +6 -7
  318. package/src/store/selectors.js +60 -45
  319. package/src/store/test/private-selectors.js +5 -0
  320. package/src/store/test/selectors.js +87 -58
  321. package/src/store/utils.js +12 -11
  322. package/src/style.scss +1 -0
  323. package/src/utils/dom.js +26 -21
  324. package/src/utils/test/dom.js +224 -0
  325. package/tsconfig.json +1 -0
  326. package/tsconfig.tsbuildinfo +1 -1
  327. package/build/components/block-info-slot-fill/index.js +0 -39
  328. package/build/components/block-info-slot-fill/index.js.map +0 -1
  329. package/build-module/components/block-info-slot-fill/index.js +0 -32
  330. package/build-module/components/block-info-slot-fill/index.js.map +0 -1
  331. package/src/components/block-info-slot-fill/index.js +0 -27
  332. /package/src/{lock-unlock.js → lock-unlock.ts} +0 -0
@@ -1 +1 @@
1
- {"version":3,"names":["createSelector","createRegistrySelector","getBlockOrder","getBlockParents","getBlockEditingMode","getSettings","canInsertBlockType","getBlockName","getTemplateLock","getClientIdsWithDescendants","isNavigationMode","getBlockRootClientId","checkAllowListRecursive","getAllPatternsDependants","getInsertBlockTypeDependants","getGrammar","INSERTER_PATTERN_TYPES","STORE_NAME","unlock","selectBlockPatternsKey","reusableBlocksSelectKey","sectionRootClientIdKey","getBlockSettings","isBlockInterfaceHidden","state","getLastInsertedBlocksClientIds","lastBlockInserted","clientIds","getBlockWithoutAttributes","clientId","blocks","byClientId","get","isBlockSubtreeDisabled","isChildSubtreeDisabled","childClientId","every","getEnabledClientIdsTreeUnmemoized","rootClientId","blockOrder","result","innerBlocks","push","getEnabledClientIdsTree","order","blockEditingModes","settings","templateLock","blockListSettings","editorMode","zoomLevel","getSectionRootClientId","getEnabledBlockParents","ascending","filter","parent","parents","getRemovalPromptData","removalPromptData","getBlockRemovalRules","blockRemovalRules","getOpenedBlockSettingsMenu","openedBlockSettingsMenu","getStyleOverrides","clientIdMap","reduce","acc","index","styleOverrides","sort","overrideA","overrideB","_clientIdMap$clientId","_clientIdMap$clientId2","clientIdA","clientIdB","aIndex","bIndex","getRegisteredInserterMediaCategories","registeredInserterMediaCategories","getInserterMediaCategories","inserterMediaCategories","allowedMimeTypes","enableOpenverseMediaCategory","length","coreInserterMediaCategoriesNames","map","name","mergedCategories","includes","category","Object","values","some","mimeType","startsWith","mediaType","hasAllowedPatterns","select","getAllPatterns","patterns","allowedBlockTypes","pattern","inserter","grammar","blockName","mapUserPattern","userPattern","__experimentalUserPatternCategories","id","type","user","title","raw","categories","wp_pattern_category","catId","find","slug","content","syncStatus","wp_pattern_sync_status","getPatternBySlug","patternName","_state$settings$__exp","_state$settings$selec","_id","parseInt","slice","block","getReusableBlocks","__experimentalBlockPatterns","__experimentalReusableBlocks","_state$settings$__exp2","_state$settings$selec2","x","arr","findIndex","y","isResolvingPatterns","blockPatternsSelect","reusableBlocksSelect","undefined","EMPTY_ARRAY","_ref","getLastFocus","lastFocus","isDragging","getExpandedBlock","expandedBlock","getContentLockingParent","current","getParentSectionBlock","isSectionBlock","sectionRootClientId","sectionClientIds","getTemporarilyEditingAsBlocks","temporarilyEditingAsBlocks","getTemporarilyEditingFocusModeToRevert","temporarilyEditingFocusModeRevert","getBlockStyles","styles","attributes","style","isZoomOut","getZoomLevel","getClosestAllowedInsertionPoint","blockNames","Array","isArray","areBlockNamesAllowedInClientId","currentName","parentClientId","getClosestAllowedInsertionPointForPattern","isAllowed","names","getInsertionPoint","insertionPoint"],"sources":["@wordpress/block-editor/src/store/private-selectors.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createSelector, createRegistrySelector } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport {\n\tgetBlockOrder,\n\tgetBlockParents,\n\tgetBlockEditingMode,\n\tgetSettings,\n\tcanInsertBlockType,\n\tgetBlockName,\n\tgetTemplateLock,\n\tgetClientIdsWithDescendants,\n\tisNavigationMode,\n\tgetBlockRootClientId,\n} from './selectors';\nimport {\n\tcheckAllowListRecursive,\n\tgetAllPatternsDependants,\n\tgetInsertBlockTypeDependants,\n\tgetGrammar,\n} from './utils';\nimport { INSERTER_PATTERN_TYPES } from '../components/inserter/block-patterns-tab/utils';\nimport { STORE_NAME } from './constants';\nimport { unlock } from '../lock-unlock';\nimport {\n\tselectBlockPatternsKey,\n\treusableBlocksSelectKey,\n\tsectionRootClientIdKey,\n} from './private-keys';\n\nexport { getBlockSettings } from './get-block-settings';\n\n/**\n * Returns true if the block interface is hidden, or false otherwise.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the block toolbar is hidden.\n */\nexport function isBlockInterfaceHidden( state ) {\n\treturn state.isBlockInterfaceHidden;\n}\n\n/**\n * Gets the client ids of the last inserted blocks.\n *\n * @param {Object} state Global application state.\n * @return {Array|undefined} Client Ids of the last inserted block(s).\n */\nexport function getLastInsertedBlocksClientIds( state ) {\n\treturn state?.lastBlockInserted?.clientIds;\n}\n\nexport function getBlockWithoutAttributes( state, clientId ) {\n\treturn state.blocks.byClientId.get( clientId );\n}\n\n/**\n * Returns true if all of the descendants of a block with the given client ID\n * have an editing mode of 'disabled', or false otherwise.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId The block client ID.\n *\n * @return {boolean} Whether the block descendants are disabled.\n */\nexport const isBlockSubtreeDisabled = ( state, clientId ) => {\n\tconst isChildSubtreeDisabled = ( childClientId ) => {\n\t\treturn (\n\t\t\tgetBlockEditingMode( state, childClientId ) === 'disabled' &&\n\t\t\tgetBlockOrder( state, childClientId ).every(\n\t\t\t\tisChildSubtreeDisabled\n\t\t\t)\n\t\t);\n\t};\n\treturn getBlockOrder( state, clientId ).every( isChildSubtreeDisabled );\n};\n\nfunction getEnabledClientIdsTreeUnmemoized( state, rootClientId ) {\n\tconst blockOrder = getBlockOrder( state, rootClientId );\n\tconst result = [];\n\n\tfor ( const clientId of blockOrder ) {\n\t\tconst innerBlocks = getEnabledClientIdsTreeUnmemoized(\n\t\t\tstate,\n\t\t\tclientId\n\t\t);\n\t\tif ( getBlockEditingMode( state, clientId ) !== 'disabled' ) {\n\t\t\tresult.push( { clientId, innerBlocks } );\n\t\t} else {\n\t\t\tresult.push( ...innerBlocks );\n\t\t}\n\t}\n\n\treturn result;\n}\n\n/**\n * Returns a tree of block objects with only clientID and innerBlocks set.\n * Blocks with a 'disabled' editing mode are not included.\n *\n * @param {Object} state Global application state.\n * @param {?string} rootClientId Optional root client ID of block list.\n *\n * @return {Object[]} Tree of block objects with only clientID and innerBlocks set.\n */\nexport const getEnabledClientIdsTree = createSelector(\n\tgetEnabledClientIdsTreeUnmemoized,\n\t( state ) => [\n\t\tstate.blocks.order,\n\t\tstate.blockEditingModes,\n\t\tstate.settings.templateLock,\n\t\tstate.blockListSettings,\n\t\tstate.editorMode,\n\t\tstate.zoomLevel,\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 * 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 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 state.zoomLevel === 'auto-scaled' || state.zoomLevel < 100;\n}\n\n/**\n * Returns whether the zoom level.\n *\n * @param {Object} state Global application state.\n * @return {number|\"auto-scaled\"} Zoom level.\n */\nexport function getZoomLevel( state ) {\n\treturn state.zoomLevel;\n}\n\n/**\n * Finds the closest block where the block is allowed to be inserted.\n *\n * @param {Object} state Editor state.\n * @param {string[] | string} name Block name or names.\n * @param {string} clientId Default insertion point.\n *\n * @return {string} clientID of the closest container when the block name can be inserted.\n */\nexport function getClosestAllowedInsertionPoint( state, name, clientId = '' ) {\n\tconst blockNames = Array.isArray( name ) ? name : [ name ];\n\tconst areBlockNamesAllowedInClientId = ( id ) =>\n\t\tblockNames.every( ( currentName ) =>\n\t\t\tcanInsertBlockType( state, currentName, id )\n\t\t);\n\n\t// If we're trying to insert at the root level and it's not allowed\n\t// Try the section root instead.\n\tif ( ! clientId ) {\n\t\tif ( areBlockNamesAllowedInClientId( clientId ) ) {\n\t\t\treturn clientId;\n\t\t}\n\n\t\tconst sectionRootClientId = getSectionRootClientId( state );\n\t\tif (\n\t\t\tsectionRootClientId &&\n\t\t\tareBlockNamesAllowedInClientId( sectionRootClientId )\n\t\t) {\n\t\t\treturn sectionRootClientId;\n\t\t}\n\t\treturn null;\n\t}\n\n\t// Traverse the block tree up until we find a place where we can insert.\n\tlet current = clientId;\n\twhile ( current !== null && ! areBlockNamesAllowedInClientId( current ) ) {\n\t\tconst parentClientId = getBlockRootClientId( state, current );\n\t\tcurrent = parentClientId;\n\t}\n\n\treturn current;\n}\n\nexport function getClosestAllowedInsertionPointForPattern(\n\tstate,\n\tpattern,\n\tclientId\n) {\n\tconst { allowedBlockTypes } = getSettings( state );\n\tconst isAllowed = checkAllowListRecursive(\n\t\tgetGrammar( pattern ),\n\t\tallowedBlockTypes\n\t);\n\tif ( ! isAllowed ) {\n\t\treturn null;\n\t}\n\tconst names = getGrammar( pattern ).map( ( { blockName: name } ) => name );\n\treturn getClosestAllowedInsertionPoint( state, names, clientId );\n}\n\n/**\n * Where the point where the next block will be inserted into.\n *\n * @param {Object} state\n * @return {Object} where the insertion point in the block editor is or null if none is set.\n */\nexport function getInsertionPoint( state ) {\n\treturn state.insertionPoint;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,cAAc,EAAEC,sBAAsB,QAAQ,iBAAiB;;AAExE;AACA;AACA;AACA,SACCC,aAAa,EACbC,eAAe,EACfC,mBAAmB,EACnBC,WAAW,EACXC,kBAAkB,EAClBC,YAAY,EACZC,eAAe,EACfC,2BAA2B,EAC3BC,gBAAgB,EAChBC,oBAAoB,QACd,aAAa;AACpB,SACCC,uBAAuB,EACvBC,wBAAwB,EACxBC,4BAA4B,EAC5BC,UAAU,QACJ,SAAS;AAChB,SAASC,sBAAsB,QAAQ,iDAAiD;AACxF,SAASC,UAAU,QAAQ,aAAa;AACxC,SAASC,MAAM,QAAQ,gBAAgB;AACvC,SACCC,sBAAsB,EACtBC,uBAAuB,EACvBC,sBAAsB,QAChB,gBAAgB;AAEvB,SAASC,gBAAgB,QAAQ,sBAAsB;;AAEvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,sBAAsBA,CAAEC,KAAK,EAAG;EAC/C,OAAOA,KAAK,CAACD,sBAAsB;AACpC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASE,8BAA8BA,CAAED,KAAK,EAAG;EACvD,OAAOA,KAAK,EAAEE,iBAAiB,EAAEC,SAAS;AAC3C;AAEA,OAAO,SAASC,yBAAyBA,CAAEJ,KAAK,EAAEK,QAAQ,EAAG;EAC5D,OAAOL,KAAK,CAACM,MAAM,CAACC,UAAU,CAACC,GAAG,CAAEH,QAAS,CAAC;AAC/C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A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AAElB;EAAK,CAAC,KAAMA,IAAK,CAAC;EAC1E,OAAO+E,+BAA+B,CAAE9I,KAAK,EAAEuJ,KAAK,EAAElJ,QAAS,CAAC;AACjE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASmJ,iBAAiBA,CAAExJ,KAAK,EAAG;EAC1C,OAAOA,KAAK,CAACyJ,cAAc;AAC5B","ignoreList":[]}
1
+ {"version":3,"names":["createSelector","createRegistrySelector","getBlockOrder","getBlockParents","getBlockEditingMode","getSettings","canInsertBlockType","getBlockName","getTemplateLock","getClientIdsWithDescendants","isNavigationMode","getBlockRootClientId","checkAllowListRecursive","getAllPatternsDependants","getInsertBlockTypeDependants","getGrammar","INSERTER_PATTERN_TYPES","STORE_NAME","unlock","selectBlockPatternsKey","reusableBlocksSelectKey","sectionRootClientIdKey","getBlockSettings","isBlockInterfaceHidden","state","getLastInsertedBlocksClientIds","lastBlockInserted","clientIds","getBlockWithoutAttributes","clientId","blocks","byClientId","get","isBlockSubtreeDisabled","isChildSubtreeDisabled","childClientId","every","getEnabledClientIdsTreeUnmemoized","rootClientId","blockOrder","result","innerBlocks","push","getEnabledClientIdsTree","select","order","blockEditingModes","settings","templateLock","blockListSettings","__unstableGetEditorMode","zoomLevel","getSectionRootClientId","getEnabledBlockParents","ascending","filter","parent","parents","getRemovalPromptData","removalPromptData","getBlockRemovalRules","blockRemovalRules","getOpenedBlockSettingsMenu","openedBlockSettingsMenu","getStyleOverrides","clientIdMap","reduce","acc","index","styleOverrides","sort","overrideA","overrideB","_clientIdMap$clientId","_clientIdMap$clientId2","clientIdA","clientIdB","aIndex","bIndex","getRegisteredInserterMediaCategories","registeredInserterMediaCategories","getInserterMediaCategories","inserterMediaCategories","allowedMimeTypes","enableOpenverseMediaCategory","length","coreInserterMediaCategoriesNames","map","name","mergedCategories","includes","category","Object","values","some","mimeType","startsWith","mediaType","hasAllowedPatterns","getAllPatterns","patterns","allowedBlockTypes","pattern","inserter","grammar","blockName","mapUserPattern","userPattern","__experimentalUserPatternCategories","id","type","user","title","raw","categories","wp_pattern_category","catId","find","slug","content","syncStatus","wp_pattern_sync_status","getPatternBySlug","patternName","_state$settings$__exp","_state$settings$selec","_id","parseInt","slice","block","getReusableBlocks","__experimentalBlockPatterns","__experimentalReusableBlocks","_state$settings$__exp2","_state$settings$selec2","x","arr","findIndex","y","isResolvingPatterns","blockPatternsSelect","reusableBlocksSelect","undefined","EMPTY_ARRAY","_ref","getLastFocus","lastFocus","isDragging","getExpandedBlock","expandedBlock","getContentLockingParent","current","getParentSectionBlock","isSectionBlock","sectionRootClientId","sectionClientIds","getTemporarilyEditingAsBlocks","temporarilyEditingAsBlocks","getTemporarilyEditingFocusModeToRevert","temporarilyEditingFocusModeRevert","getBlockStyles","styles","attributes","style","isZoomOut","getZoomLevel","getClosestAllowedInsertionPoint","blockNames","Array","isArray","areBlockNamesAllowedInClientId","currentName","parentClientId","getClosestAllowedInsertionPointForPattern","isAllowed","names","getInsertionPoint","insertionPoint"],"sources":["@wordpress/block-editor/src/store/private-selectors.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createSelector, createRegistrySelector } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport {\n\tgetBlockOrder,\n\tgetBlockParents,\n\tgetBlockEditingMode,\n\tgetSettings,\n\tcanInsertBlockType,\n\tgetBlockName,\n\tgetTemplateLock,\n\tgetClientIdsWithDescendants,\n\tisNavigationMode,\n\tgetBlockRootClientId,\n} from './selectors';\nimport {\n\tcheckAllowListRecursive,\n\tgetAllPatternsDependants,\n\tgetInsertBlockTypeDependants,\n\tgetGrammar,\n} from './utils';\nimport { INSERTER_PATTERN_TYPES } from '../components/inserter/block-patterns-tab/utils';\nimport { STORE_NAME } from './constants';\nimport { unlock } from '../lock-unlock';\nimport {\n\tselectBlockPatternsKey,\n\treusableBlocksSelectKey,\n\tsectionRootClientIdKey,\n} from './private-keys';\n\nexport { getBlockSettings } from './get-block-settings';\n\n/**\n * Returns true if the block interface is hidden, or false otherwise.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the block toolbar is hidden.\n */\nexport function isBlockInterfaceHidden( state ) {\n\treturn state.isBlockInterfaceHidden;\n}\n\n/**\n * Gets the client ids of the last inserted blocks.\n *\n * @param {Object} state Global application state.\n * @return {Array|undefined} Client Ids of the last inserted block(s).\n */\nexport function getLastInsertedBlocksClientIds( state ) {\n\treturn state?.lastBlockInserted?.clientIds;\n}\n\nexport function getBlockWithoutAttributes( state, clientId ) {\n\treturn state.blocks.byClientId.get( clientId );\n}\n\n/**\n * Returns true if all of the descendants of a block with the given client ID\n * have an editing mode of 'disabled', or false otherwise.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId The block client ID.\n *\n * @return {boolean} Whether the block descendants are disabled.\n */\nexport const isBlockSubtreeDisabled = ( state, clientId ) => {\n\tconst isChildSubtreeDisabled = ( childClientId ) => {\n\t\treturn (\n\t\t\tgetBlockEditingMode( state, childClientId ) === 'disabled' &&\n\t\t\tgetBlockOrder( state, childClientId ).every(\n\t\t\t\tisChildSubtreeDisabled\n\t\t\t)\n\t\t);\n\t};\n\treturn getBlockOrder( state, clientId ).every( isChildSubtreeDisabled );\n};\n\nfunction getEnabledClientIdsTreeUnmemoized( state, rootClientId ) {\n\tconst blockOrder = getBlockOrder( state, rootClientId );\n\tconst result = [];\n\n\tfor ( const clientId of blockOrder ) {\n\t\tconst innerBlocks = getEnabledClientIdsTreeUnmemoized(\n\t\t\tstate,\n\t\t\tclientId\n\t\t);\n\t\tif ( getBlockEditingMode( state, clientId ) !== 'disabled' ) {\n\t\t\tresult.push( { clientId, innerBlocks } );\n\t\t} else {\n\t\t\tresult.push( ...innerBlocks );\n\t\t}\n\t}\n\n\treturn result;\n}\n\n/**\n * Returns a tree of block objects with only clientID and innerBlocks set.\n * Blocks with a 'disabled' editing mode are not included.\n *\n * @param {Object} state Global application state.\n * @param {?string} rootClientId Optional root client ID of block list.\n *\n * @return {Object[]} Tree of block objects with only clientID and innerBlocks set.\n */\nexport const getEnabledClientIdsTree = createRegistrySelector( ( select ) =>\n\tcreateSelector( getEnabledClientIdsTreeUnmemoized, ( state ) => [\n\t\tstate.blocks.order,\n\t\tstate.blockEditingModes,\n\t\tstate.settings.templateLock,\n\t\tstate.blockListSettings,\n\t\tselect( STORE_NAME ).__unstableGetEditorMode( state ),\n\t\tstate.zoomLevel,\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( select )( 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 * 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 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 state.zoomLevel === 'auto-scaled' || state.zoomLevel < 100;\n}\n\n/**\n * Returns whether the zoom level.\n *\n * @param {Object} state Global application state.\n * @return {number|\"auto-scaled\"} Zoom level.\n */\nexport function getZoomLevel( state ) {\n\treturn state.zoomLevel;\n}\n\n/**\n * Finds the closest block where the block is allowed to be inserted.\n *\n * @param {Object} state Editor state.\n * @param {string[] | string} name Block name or names.\n * @param {string} clientId Default insertion point.\n *\n * @return {string} clientID of the closest container when the block name can be inserted.\n */\nexport function getClosestAllowedInsertionPoint( state, name, clientId = '' ) {\n\tconst blockNames = Array.isArray( name ) ? name : [ name ];\n\tconst areBlockNamesAllowedInClientId = ( id ) =>\n\t\tblockNames.every( ( currentName ) =>\n\t\t\tcanInsertBlockType( state, currentName, id )\n\t\t);\n\n\t// If we're trying to insert at the root level and it's not allowed\n\t// Try the section root instead.\n\tif ( ! clientId ) {\n\t\tif ( areBlockNamesAllowedInClientId( clientId ) ) {\n\t\t\treturn clientId;\n\t\t}\n\n\t\tconst sectionRootClientId = getSectionRootClientId( state );\n\t\tif (\n\t\t\tsectionRootClientId &&\n\t\t\tareBlockNamesAllowedInClientId( sectionRootClientId )\n\t\t) {\n\t\t\treturn sectionRootClientId;\n\t\t}\n\t\treturn null;\n\t}\n\n\t// Traverse the block tree up until we find a place where we can insert.\n\tlet current = clientId;\n\twhile ( current !== null && ! areBlockNamesAllowedInClientId( current ) ) {\n\t\tconst parentClientId = getBlockRootClientId( state, current );\n\t\tcurrent = parentClientId;\n\t}\n\n\treturn current;\n}\n\nexport function getClosestAllowedInsertionPointForPattern(\n\tstate,\n\tpattern,\n\tclientId\n) {\n\tconst { allowedBlockTypes } = getSettings( state );\n\tconst isAllowed = checkAllowListRecursive(\n\t\tgetGrammar( pattern ),\n\t\tallowedBlockTypes\n\t);\n\tif ( ! isAllowed ) {\n\t\treturn null;\n\t}\n\tconst names = getGrammar( pattern ).map( ( { blockName: name } ) => name );\n\treturn getClosestAllowedInsertionPoint( state, names, clientId );\n}\n\n/**\n * Where the point where the next block will be inserted into.\n *\n * @param {Object} state\n * @return {Object} where the insertion point in the block editor is or null if none is set.\n */\nexport function getInsertionPoint( state ) {\n\treturn state.insertionPoint;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,cAAc,EAAEC,sBAAsB,QAAQ,iBAAiB;;AAExE;AACA;AACA;AACA,SACCC,aAAa,EACbC,eAAe,EACfC,mBAAmB,EACnBC,WAAW,EACXC,kBAAkB,EAClBC,YAAY,EACZC,eAAe,EACfC,2BAA2B,EAC3BC,gBAAgB,EAChBC,oBAAoB,QACd,aAAa;AACpB,SACCC,uBAAuB,EACvBC,wBAAwB,EACxBC,4BAA4B,EAC5BC,UAAU,QACJ,SAAS;AAChB,SAASC,sBAAsB,QAAQ,iDAAiD;AACxF,SAASC,UAAU,QAAQ,aAAa;AACxC,SAASC,MAAM,QAAQ,gBAAgB;AACvC,SACCC,sBAAsB,EACtBC,uBAAuB,EACvBC,sBAAsB,QAChB,gBAAgB;AAEvB,SAASC,gBAAgB,QAAQ,sBAAsB;;AAEvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,sBAAsBA,CAAEC,KAAK,EAAG;EAC/C,OAAOA,KAAK,CAACD,sBAAsB;AACpC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASE,8BAA8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B,yCAAyCA,CACxDrJ,KAAK,EACL8E,OAAO,EACPzE,QAAQ,EACP;EACD,MAAM;IAAEwE;EAAkB,CAAC,GAAGhG,WAAW,CAAEmB,KAAM,CAAC;EAClD,MAAMsJ,SAAS,GAAGlK,uBAAuB,CACxCG,UAAU,CAAEuF,OAAQ,CAAC,EACrBD,iBACD,CAAC;EACD,IAAK,CAAEyE,SAAS,EAAG;IAClB,OAAO,IAAI;EACZ;EACA,MAAMC,KAAK,GAAGhK,UAAU,CAAEuF,OAAQ,CAAC,CAACf,GAAG,CAAE,CAAE;IAAEkB,SAAS,EAAEjB;EAAK,CAAC,KAAMA,IAAK,CAAC;EAC1E,OAAO8E,+BAA+B,CAAE9I,KAAK,EAAEuJ,KAAK,EAAElJ,QAAS,CAAC;AACjE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASmJ,iBAAiBA,CAAExJ,KAAK,EAAG;EAC1C,OAAOA,KAAK,CAACyJ,cAAc;AAC5B","ignoreList":[]}
@@ -1526,7 +1526,7 @@ const canInsertBlockTypeUnmemoized = (state, blockName, rootClientId = null) =>
1526
1526
  *
1527
1527
  * @return {boolean} Whether the given block type is allowed to be inserted.
1528
1528
  */
1529
- export const canInsertBlockType = createSelector(canInsertBlockTypeUnmemoized, (state, blockName, rootClientId) => getInsertBlockTypeDependants(state, rootClientId));
1529
+ export const canInsertBlockType = createRegistrySelector(select => createSelector(canInsertBlockTypeUnmemoized, (state, blockName, rootClientId) => getInsertBlockTypeDependants(select)(state, rootClientId)));
1530
1530
 
1531
1531
  /**
1532
1532
  * Determines if the given blocks are allowed to be inserted into the block
@@ -1908,7 +1908,7 @@ export const getInserterItems = createRegistrySelector(select => createSelector(
1908
1908
  });
1909
1909
  const sortedBlockTypes = [...coreItems, ...nonCoreItems];
1910
1910
  return [...sortedBlockTypes, ...syncedPatternInserterItems];
1911
- }, (state, rootClientId) => [getBlockTypes(), unlock(select(STORE_NAME)).getReusableBlocks(), state.blocks.order, state.preferences.insertUsage, ...getInsertBlockTypeDependants(state, rootClientId)]));
1911
+ }, (state, rootClientId) => [getBlockTypes(), unlock(select(STORE_NAME)).getReusableBlocks(), state.blocks.order, state.preferences.insertUsage, ...getInsertBlockTypeDependants(select)(state, rootClientId)]));
1912
1912
 
1913
1913
  /**
1914
1914
  * Determines the items that appear in the available block transforms list.
@@ -1936,7 +1936,7 @@ export const getInserterItems = createRegistrySelector(select => createSelector(
1936
1936
  * this item.
1937
1937
  * @property {number} frecency Heuristic that combines frequency and recency.
1938
1938
  */
1939
- export const getBlockTransformItems = createSelector((state, blocks, rootClientId = null) => {
1939
+ export const getBlockTransformItems = createRegistrySelector(select => createSelector((state, blocks, rootClientId = null) => {
1940
1940
  const normalizedBlocks = Array.isArray(blocks) ? blocks : [blocks];
1941
1941
  const buildBlockTypeTransformItem = buildBlockTypeItem(state, {
1942
1942
  buildScope: 'transform'
@@ -1950,7 +1950,7 @@ export const getBlockTransformItems = createSelector((state, blocks, rootClientI
1950
1950
  return accumulator;
1951
1951
  }, []);
1952
1952
  return orderBy(possibleTransforms, block => itemsByName[block.name].frecency, 'desc');
1953
- }, (state, blocks, rootClientId) => [getBlockTypes(), state.preferences.insertUsage, ...getInsertBlockTypeDependants(state, rootClientId)]);
1953
+ }, (state, blocks, rootClientId) => [getBlockTypes(), state.preferences.insertUsage, ...getInsertBlockTypeDependants(select)(state, rootClientId)]));
1954
1954
 
1955
1955
  /**
1956
1956
  * Determines whether there are items to show in the inserter.
@@ -1987,7 +1987,7 @@ export const getAllowedBlocks = createRegistrySelector(select => createSelector(
1987
1987
  blockTypes.push('core/block');
1988
1988
  }
1989
1989
  return blockTypes;
1990
- }, (state, rootClientId) => [getBlockTypes(), unlock(select(STORE_NAME)).getReusableBlocks(), ...getInsertBlockTypeDependants(state, rootClientId)]));
1990
+ }, (state, rootClientId) => [getBlockTypes(), unlock(select(STORE_NAME)).getReusableBlocks(), ...getInsertBlockTypeDependants(select)(state, rootClientId)]));
1991
1991
  export const __experimentalGetAllowedBlocks = createSelector((state, rootClientId = null) => {
1992
1992
  deprecated('wp.data.select( "core/block-editor" ).__experimentalGetAllowedBlocks', {
1993
1993
  alternative: 'wp.data.select( "core/block-editor" ).getAllowedBlocks',
@@ -2036,7 +2036,7 @@ export const __experimentalGetParsedPattern = createRegistrySelector(select => (
2036
2036
  const pattern = unlock(select(STORE_NAME)).getPatternBySlug(patternName);
2037
2037
  return pattern ? getParsedPattern(pattern) : null;
2038
2038
  });
2039
- const getAllowedPatternsDependants = select => (state, rootClientId) => [...getAllPatternsDependants(select)(state), ...getInsertBlockTypeDependants(state, rootClientId)];
2039
+ const getAllowedPatternsDependants = select => (state, rootClientId) => [...getAllPatternsDependants(select)(state), ...getInsertBlockTypeDependants(select)(state, rootClientId)];
2040
2040
  const patternsWithParsedBlocks = new WeakMap();
2041
2041
  function enhancePatternWithParsedBlocks(pattern) {
2042
2042
  let enhancedPattern = patternsWithParsedBlocks.get(pattern);
@@ -2288,8 +2288,12 @@ export function isNavigationMode(state) {
2288
2288
  *
2289
2289
  * @return {string} the editor mode.
2290
2290
  */
2291
- export const __unstableGetEditorMode = createRegistrySelector(select => () => {
2292
- return select(preferencesStore).get('core', 'editorTool');
2291
+ export const __unstableGetEditorMode = createRegistrySelector(select => state => {
2292
+ var _state$settings$edito;
2293
+ if (!window?.__experimentalEditorWriteMode) {
2294
+ return 'edit';
2295
+ }
2296
+ return (_state$settings$edito = state.settings.editorTool) !== null && _state$settings$edito !== void 0 ? _state$settings$edito : select(preferencesStore).get('core', 'editorTool');
2293
2297
  });
2294
2298
 
2295
2299
  /**