@wordpress/block-editor 15.23.0 → 16.0.1-next.v.202607070741.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 (363) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/build/autocompleters/block.cjs +10 -2
  3. package/build/autocompleters/block.cjs.map +2 -2
  4. package/build/components/background-image-control/index.cjs +0 -2
  5. package/build/components/background-image-control/index.cjs.map +2 -2
  6. package/build/components/block-inspector/edit-contents.cjs +3 -0
  7. package/build/components/block-inspector/edit-contents.cjs.map +3 -3
  8. package/build/components/block-inspector/index.cjs +2 -3
  9. package/build/components/block-inspector/index.cjs.map +2 -2
  10. package/build/components/block-list/block-invalid-warning.cjs +8 -19
  11. package/build/components/block-list/block-invalid-warning.cjs.map +2 -2
  12. package/build/components/block-styles/use-styles-for-block.cjs +2 -1
  13. package/build/components/block-styles/use-styles-for-block.cjs.map +2 -2
  14. package/build/components/block-title/use-block-display-title.cjs +7 -2
  15. package/build/components/block-title/use-block-display-title.cjs.map +2 -2
  16. package/build/components/block-toolbar/block-toolbar-icon.cjs +10 -14
  17. package/build/components/block-toolbar/block-toolbar-icon.cjs.map +2 -2
  18. package/build/components/block-variation-transforms/index.cjs +0 -1
  19. package/build/components/block-variation-transforms/index.cjs.map +2 -2
  20. package/build/components/child-layout-control/index.cjs +0 -2
  21. package/build/components/child-layout-control/index.cjs.map +2 -2
  22. package/build/components/colors-gradients/control.cjs +5 -5
  23. package/build/components/colors-gradients/control.cjs.map +2 -2
  24. package/build/components/date-format-picker/index.cjs +0 -1
  25. package/build/components/date-format-picker/index.cjs.map +2 -2
  26. package/build/components/dimensions-tool/aspect-ratio-tool.cjs +1 -2
  27. package/build/components/dimensions-tool/aspect-ratio-tool.cjs.map +2 -2
  28. package/build/components/dimensions-tool/scale-tool.cjs +0 -1
  29. package/build/components/dimensions-tool/scale-tool.cjs.map +2 -2
  30. package/build/components/dimensions-tool/width-height-tool.cjs +2 -4
  31. package/build/components/dimensions-tool/width-height-tool.cjs.map +2 -2
  32. package/build/components/font-appearance-control/index.cjs +6 -25
  33. package/build/components/font-appearance-control/index.cjs.map +3 -3
  34. package/build/components/font-family/index.cjs +6 -15
  35. package/build/components/font-family/index.cjs.map +3 -3
  36. package/build/components/font-sizes/font-size-picker.cjs +1 -2
  37. package/build/components/font-sizes/font-size-picker.cjs.map +2 -2
  38. package/build/components/global-styles/border-panel.cjs +0 -1
  39. package/build/components/global-styles/border-panel.cjs.map +2 -2
  40. package/build/components/global-styles/dimensions-panel.cjs +0 -3
  41. package/build/components/global-styles/dimensions-panel.cjs.map +2 -2
  42. package/build/components/global-styles/typography-panel.cjs +4 -10
  43. package/build/components/global-styles/typography-panel.cjs.map +2 -2
  44. package/build/components/height-control/index.cjs +0 -2
  45. package/build/components/height-control/index.cjs.map +2 -2
  46. package/build/components/html-element-control/index.cjs +0 -1
  47. package/build/components/html-element-control/index.cjs.map +2 -2
  48. package/build/components/image-editor/index.cjs +5 -0
  49. package/build/components/image-editor/index.cjs.map +3 -3
  50. package/build/components/image-editor/zoom-dropdown.cjs +0 -1
  51. package/build/components/image-editor/zoom-dropdown.cjs.map +2 -2
  52. package/build/components/image-size-control/index.cjs +1 -3
  53. package/build/components/image-size-control/index.cjs.map +2 -2
  54. package/build/components/inner-content/index.cjs +107 -0
  55. package/build/components/inner-content/index.cjs.map +7 -0
  56. package/build/components/inserter/hooks/use-block-types-state.cjs +10 -2
  57. package/build/components/inserter/hooks/use-block-types-state.cjs.map +2 -2
  58. package/build/components/inserter/media-tab/hooks.cjs +34 -6
  59. package/build/components/inserter/media-tab/hooks.cjs.map +2 -2
  60. package/build/components/inserter/media-tab/media-list.cjs +3 -1
  61. package/build/components/inserter/media-tab/media-list.cjs.map +2 -2
  62. package/build/components/inserter/media-tab/media-panel.cjs +224 -27
  63. package/build/components/inserter/media-tab/media-panel.cjs.map +3 -3
  64. package/build/components/inserter/media-tab/media-preview.cjs +32 -17
  65. package/build/components/inserter/media-tab/media-preview.cjs.map +2 -2
  66. package/build/components/inserter/media-tab/media-tab.cjs +26 -6
  67. package/build/components/inserter/media-tab/media-tab.cjs.map +2 -2
  68. package/build/components/inserter/mobile-tab-navigation.cjs +6 -1
  69. package/build/components/inserter/mobile-tab-navigation.cjs.map +2 -2
  70. package/build/components/inserter/no-results.cjs +2 -2
  71. package/build/components/inserter/no-results.cjs.map +2 -2
  72. package/build/components/inserter/preview-panel.cjs +2 -1
  73. package/build/components/inserter/preview-panel.cjs.map +2 -2
  74. package/build/components/inserter-list-item/index.cjs +8 -2
  75. package/build/components/inserter-list-item/index.cjs.map +2 -2
  76. package/build/components/letter-spacing-control/index.cjs +0 -24
  77. package/build/components/letter-spacing-control/index.cjs.map +3 -3
  78. package/build/components/line-height-control/index.cjs +7 -22
  79. package/build/components/line-height-control/index.cjs.map +3 -3
  80. package/build/components/list-view/block-select-button.cjs +90 -84
  81. package/build/components/list-view/block-select-button.cjs.map +2 -2
  82. package/build/components/list-view/block.cjs +51 -20
  83. package/build/components/list-view/block.cjs.map +2 -2
  84. package/build/components/list-view/expander.cjs +1 -1
  85. package/build/components/list-view/expander.cjs.map +2 -2
  86. package/build/components/list-view/use-list-view-client-ids.cjs +2 -2
  87. package/build/components/list-view/use-list-view-client-ids.cjs.map +2 -2
  88. package/build/components/observe-typing/index.cjs +4 -3
  89. package/build/components/observe-typing/index.cjs.map +2 -2
  90. package/build/components/preset-input-control/custom-value-controls.cjs +1 -3
  91. package/build/components/preset-input-control/custom-value-controls.cjs.map +2 -2
  92. package/build/components/preset-input-control/index.cjs +1 -3
  93. package/build/components/preset-input-control/index.cjs.map +2 -2
  94. package/build/components/resolution-tool/index.cjs +1 -2
  95. package/build/components/resolution-tool/index.cjs.map +2 -2
  96. package/build/components/text-alignment-control/index.cjs +0 -1
  97. package/build/components/text-alignment-control/index.cjs.map +2 -2
  98. package/build/components/text-decoration-control/index.cjs +0 -1
  99. package/build/components/text-decoration-control/index.cjs.map +2 -2
  100. package/build/components/text-indent-control/index.cjs +0 -8
  101. package/build/components/text-indent-control/index.cjs.map +2 -2
  102. package/build/components/text-transform-control/index.cjs +0 -1
  103. package/build/components/text-transform-control/index.cjs.map +2 -2
  104. package/build/components/use-block-display-information/index.cjs +10 -8
  105. package/build/components/use-block-display-information/index.cjs.map +2 -2
  106. package/build/components/use-on-block-drop/index.cjs +3 -7
  107. package/build/components/use-on-block-drop/index.cjs.map +2 -2
  108. package/build/components/writing-mode-control/index.cjs +0 -1
  109. package/build/components/writing-mode-control/index.cjs.map +2 -2
  110. package/build/hooks/font-size.cjs +1 -2
  111. package/build/hooks/font-size.cjs.map +2 -2
  112. package/build/hooks/layout.cjs +5 -3
  113. package/build/hooks/layout.cjs.map +2 -2
  114. package/build/hooks/position.cjs +36 -16
  115. package/build/hooks/position.cjs.map +2 -2
  116. package/build/hooks/states.cjs +6 -9
  117. package/build/hooks/states.cjs.map +2 -2
  118. package/build/layouts/constrained.cjs +21 -21
  119. package/build/layouts/constrained.cjs.map +2 -2
  120. package/build/layouts/flex.cjs +0 -3
  121. package/build/layouts/flex.cjs.map +2 -2
  122. package/build/layouts/grid.cjs +51 -9
  123. package/build/layouts/grid.cjs.map +2 -2
  124. package/build/private-apis.cjs +4 -1
  125. package/build/private-apis.cjs.map +3 -3
  126. package/build/store/actions.cjs.map +2 -2
  127. package/build/store/private-keys.cjs +3 -0
  128. package/build/store/private-keys.cjs.map +2 -2
  129. package/build/store/private-selectors.cjs +72 -4
  130. package/build/store/private-selectors.cjs.map +2 -2
  131. package/build/store/selectors.cjs +13 -0
  132. package/build/store/selectors.cjs.map +2 -2
  133. package/build-module/autocompleters/block.mjs +10 -2
  134. package/build-module/autocompleters/block.mjs.map +2 -2
  135. package/build-module/components/background-image-control/index.mjs +0 -2
  136. package/build-module/components/background-image-control/index.mjs.map +2 -2
  137. package/build-module/components/block-inspector/edit-contents.mjs +4 -1
  138. package/build-module/components/block-inspector/edit-contents.mjs.map +2 -2
  139. package/build-module/components/block-inspector/index.mjs +2 -3
  140. package/build-module/components/block-inspector/index.mjs.map +2 -2
  141. package/build-module/components/block-list/block-invalid-warning.mjs +8 -19
  142. package/build-module/components/block-list/block-invalid-warning.mjs.map +2 -2
  143. package/build-module/components/block-styles/use-styles-for-block.mjs +2 -1
  144. package/build-module/components/block-styles/use-styles-for-block.mjs.map +2 -2
  145. package/build-module/components/block-title/use-block-display-title.mjs +7 -2
  146. package/build-module/components/block-title/use-block-display-title.mjs.map +2 -2
  147. package/build-module/components/block-toolbar/block-toolbar-icon.mjs +10 -14
  148. package/build-module/components/block-toolbar/block-toolbar-icon.mjs.map +2 -2
  149. package/build-module/components/block-variation-transforms/index.mjs +0 -1
  150. package/build-module/components/block-variation-transforms/index.mjs.map +2 -2
  151. package/build-module/components/child-layout-control/index.mjs +0 -2
  152. package/build-module/components/child-layout-control/index.mjs.map +2 -2
  153. package/build-module/components/colors-gradients/control.mjs +5 -5
  154. package/build-module/components/colors-gradients/control.mjs.map +2 -2
  155. package/build-module/components/date-format-picker/index.mjs +0 -1
  156. package/build-module/components/date-format-picker/index.mjs.map +2 -2
  157. package/build-module/components/dimensions-tool/aspect-ratio-tool.mjs +1 -2
  158. package/build-module/components/dimensions-tool/aspect-ratio-tool.mjs.map +2 -2
  159. package/build-module/components/dimensions-tool/scale-tool.mjs +0 -1
  160. package/build-module/components/dimensions-tool/scale-tool.mjs.map +2 -2
  161. package/build-module/components/dimensions-tool/width-height-tool.mjs +2 -4
  162. package/build-module/components/dimensions-tool/width-height-tool.mjs.map +2 -2
  163. package/build-module/components/font-appearance-control/index.mjs +6 -15
  164. package/build-module/components/font-appearance-control/index.mjs.map +2 -2
  165. package/build-module/components/font-family/index.mjs +6 -15
  166. package/build-module/components/font-family/index.mjs.map +2 -2
  167. package/build-module/components/font-sizes/font-size-picker.mjs +1 -2
  168. package/build-module/components/font-sizes/font-size-picker.mjs.map +2 -2
  169. package/build-module/components/global-styles/border-panel.mjs +0 -1
  170. package/build-module/components/global-styles/border-panel.mjs.map +2 -2
  171. package/build-module/components/global-styles/dimensions-panel.mjs +0 -3
  172. package/build-module/components/global-styles/dimensions-panel.mjs.map +2 -2
  173. package/build-module/components/global-styles/typography-panel.mjs +4 -10
  174. package/build-module/components/global-styles/typography-panel.mjs.map +2 -2
  175. package/build-module/components/height-control/index.mjs +0 -2
  176. package/build-module/components/height-control/index.mjs.map +2 -2
  177. package/build-module/components/html-element-control/index.mjs +0 -1
  178. package/build-module/components/html-element-control/index.mjs.map +2 -2
  179. package/build-module/components/image-editor/index.mjs +5 -0
  180. package/build-module/components/image-editor/index.mjs.map +2 -2
  181. package/build-module/components/image-editor/zoom-dropdown.mjs +0 -1
  182. package/build-module/components/image-editor/zoom-dropdown.mjs.map +2 -2
  183. package/build-module/components/image-size-control/index.mjs +1 -3
  184. package/build-module/components/image-size-control/index.mjs.map +2 -2
  185. package/build-module/components/inner-content/index.mjs +82 -0
  186. package/build-module/components/inner-content/index.mjs.map +7 -0
  187. package/build-module/components/inserter/hooks/use-block-types-state.mjs +10 -2
  188. package/build-module/components/inserter/hooks/use-block-types-state.mjs.map +2 -2
  189. package/build-module/components/inserter/media-tab/hooks.mjs +33 -6
  190. package/build-module/components/inserter/media-tab/hooks.mjs.map +2 -2
  191. package/build-module/components/inserter/media-tab/media-list.mjs +3 -1
  192. package/build-module/components/inserter/media-tab/media-list.mjs.map +2 -2
  193. package/build-module/components/inserter/media-tab/media-panel.mjs +227 -30
  194. package/build-module/components/inserter/media-tab/media-panel.mjs.map +2 -2
  195. package/build-module/components/inserter/media-tab/media-preview.mjs +33 -18
  196. package/build-module/components/inserter/media-tab/media-preview.mjs.map +2 -2
  197. package/build-module/components/inserter/media-tab/media-tab.mjs +27 -7
  198. package/build-module/components/inserter/media-tab/media-tab.mjs.map +2 -2
  199. package/build-module/components/inserter/mobile-tab-navigation.mjs +6 -1
  200. package/build-module/components/inserter/mobile-tab-navigation.mjs.map +2 -2
  201. package/build-module/components/inserter/no-results.mjs +2 -2
  202. package/build-module/components/inserter/no-results.mjs.map +2 -2
  203. package/build-module/components/inserter/preview-panel.mjs +2 -1
  204. package/build-module/components/inserter/preview-panel.mjs.map +2 -2
  205. package/build-module/components/inserter-list-item/index.mjs +8 -2
  206. package/build-module/components/inserter-list-item/index.mjs.map +2 -2
  207. package/build-module/components/letter-spacing-control/index.mjs +0 -14
  208. package/build-module/components/letter-spacing-control/index.mjs.map +2 -2
  209. package/build-module/components/line-height-control/index.mjs +7 -12
  210. package/build-module/components/line-height-control/index.mjs.map +2 -2
  211. package/build-module/components/list-view/block-select-button.mjs +90 -84
  212. package/build-module/components/list-view/block-select-button.mjs.map +2 -2
  213. package/build-module/components/list-view/block.mjs +51 -20
  214. package/build-module/components/list-view/block.mjs.map +2 -2
  215. package/build-module/components/list-view/expander.mjs +1 -1
  216. package/build-module/components/list-view/expander.mjs.map +2 -2
  217. package/build-module/components/list-view/use-list-view-client-ids.mjs +2 -2
  218. package/build-module/components/list-view/use-list-view-client-ids.mjs.map +2 -2
  219. package/build-module/components/observe-typing/index.mjs +4 -3
  220. package/build-module/components/observe-typing/index.mjs.map +2 -2
  221. package/build-module/components/preset-input-control/custom-value-controls.mjs +1 -3
  222. package/build-module/components/preset-input-control/custom-value-controls.mjs.map +2 -2
  223. package/build-module/components/preset-input-control/index.mjs +1 -3
  224. package/build-module/components/preset-input-control/index.mjs.map +2 -2
  225. package/build-module/components/resolution-tool/index.mjs +1 -2
  226. package/build-module/components/resolution-tool/index.mjs.map +2 -2
  227. package/build-module/components/text-alignment-control/index.mjs +0 -1
  228. package/build-module/components/text-alignment-control/index.mjs.map +2 -2
  229. package/build-module/components/text-decoration-control/index.mjs +0 -1
  230. package/build-module/components/text-decoration-control/index.mjs.map +2 -2
  231. package/build-module/components/text-indent-control/index.mjs +0 -8
  232. package/build-module/components/text-indent-control/index.mjs.map +2 -2
  233. package/build-module/components/text-transform-control/index.mjs +0 -1
  234. package/build-module/components/text-transform-control/index.mjs.map +2 -2
  235. package/build-module/components/use-block-display-information/index.mjs +10 -8
  236. package/build-module/components/use-block-display-information/index.mjs.map +2 -2
  237. package/build-module/components/use-on-block-drop/index.mjs +4 -7
  238. package/build-module/components/use-on-block-drop/index.mjs.map +2 -2
  239. package/build-module/components/writing-mode-control/index.mjs +0 -1
  240. package/build-module/components/writing-mode-control/index.mjs.map +2 -2
  241. package/build-module/hooks/font-size.mjs +1 -2
  242. package/build-module/hooks/font-size.mjs.map +2 -2
  243. package/build-module/hooks/layout.mjs +4 -3
  244. package/build-module/hooks/layout.mjs.map +2 -2
  245. package/build-module/hooks/position.mjs +38 -18
  246. package/build-module/hooks/position.mjs.map +2 -2
  247. package/build-module/hooks/states.mjs +6 -9
  248. package/build-module/hooks/states.mjs.map +2 -2
  249. package/build-module/layouts/constrained.mjs +21 -21
  250. package/build-module/layouts/constrained.mjs.map +2 -2
  251. package/build-module/layouts/flex.mjs +0 -3
  252. package/build-module/layouts/flex.mjs.map +2 -2
  253. package/build-module/layouts/grid.mjs +52 -9
  254. package/build-module/layouts/grid.mjs.map +2 -2
  255. package/build-module/private-apis.mjs +5 -1
  256. package/build-module/private-apis.mjs.map +2 -2
  257. package/build-module/store/actions.mjs.map +2 -2
  258. package/build-module/store/private-keys.mjs +2 -0
  259. package/build-module/store/private-keys.mjs.map +2 -2
  260. package/build-module/store/private-selectors.mjs +71 -4
  261. package/build-module/store/private-selectors.mjs.map +2 -2
  262. package/build-module/store/selectors.mjs +13 -0
  263. package/build-module/store/selectors.mjs.map +2 -2
  264. package/build-style/content-rtl.css +11 -5
  265. package/build-style/content.css +11 -5
  266. package/build-style/style-rtl.css +113 -3
  267. package/build-style/style.css +113 -3
  268. package/package.json +43 -41
  269. package/src/autocompleters/block.js +10 -3
  270. package/src/autocompleters/test/block.js +53 -0
  271. package/src/components/background-image-control/index.js +0 -2
  272. package/src/components/block-inspector/edit-contents.js +5 -1
  273. package/src/components/block-inspector/index.js +3 -2
  274. package/src/components/block-list/block-invalid-warning.js +8 -19
  275. package/src/components/block-patterns-list/stories/index.story.jsx +1 -1
  276. package/src/components/block-styles/use-styles-for-block.js +1 -0
  277. package/src/components/block-title/use-block-display-title.js +7 -2
  278. package/src/components/block-toolbar/block-toolbar-icon.js +11 -16
  279. package/src/components/block-toolbar/test/block-toolbar-icon.js +32 -9
  280. package/src/components/block-variation-transforms/index.js +0 -1
  281. package/src/components/child-layout-control/index.js +0 -2
  282. package/src/components/color-palette/test/__snapshots__/control.js.snap +11 -106
  283. package/src/components/colors-gradients/control.js +4 -4
  284. package/src/components/colors-gradients/style.scss +2 -2
  285. package/src/components/date-format-picker/index.js +0 -1
  286. package/src/components/dimensions-tool/aspect-ratio-tool.js +0 -1
  287. package/src/components/dimensions-tool/scale-tool.js +0 -1
  288. package/src/components/dimensions-tool/width-height-tool.js +0 -2
  289. package/src/components/font-appearance-control/index.js +6 -19
  290. package/src/components/font-family/README.md +0 -9
  291. package/src/components/font-family/index.js +6 -19
  292. package/src/components/font-family/stories/index.story.jsx +0 -1
  293. package/src/components/font-sizes/font-size-picker.js +0 -1
  294. package/src/components/global-styles/border-panel.js +0 -1
  295. package/src/components/global-styles/dimensions-panel.js +0 -3
  296. package/src/components/global-styles/typography-panel.js +0 -6
  297. package/src/components/height-control/index.js +0 -2
  298. package/src/components/html-element-control/index.js +0 -1
  299. package/src/components/iframe/content.scss +3 -3
  300. package/src/components/image-editor/index.js +22 -0
  301. package/src/components/image-editor/zoom-dropdown.js +0 -1
  302. package/src/components/image-size-control/index.js +0 -2
  303. package/src/components/inner-content/index.js +119 -0
  304. package/src/components/inner-content/test/index.js +81 -0
  305. package/src/components/inserter/hooks/use-block-types-state.js +10 -2
  306. package/src/components/inserter/media-tab/hooks.js +59 -9
  307. package/src/components/inserter/media-tab/media-list.js +2 -0
  308. package/src/components/inserter/media-tab/media-panel.js +256 -17
  309. package/src/components/inserter/media-tab/media-preview.js +34 -17
  310. package/src/components/inserter/media-tab/media-tab.js +20 -2
  311. package/src/components/inserter/media-tab/test/hooks.js +204 -0
  312. package/src/components/inserter/mobile-tab-navigation.js +6 -1
  313. package/src/components/inserter/no-results.js +2 -2
  314. package/src/components/inserter/preview-panel.js +1 -0
  315. package/src/components/inserter/style.scss +110 -1
  316. package/src/components/inserter-list-item/index.js +8 -2
  317. package/src/components/letter-spacing-control/README.md +0 -8
  318. package/src/components/letter-spacing-control/index.js +5 -23
  319. package/src/components/letter-spacing-control/stories/index.story.jsx +0 -12
  320. package/src/components/line-height-control/README.md +0 -8
  321. package/src/components/line-height-control/index.js +7 -16
  322. package/src/components/line-height-control/stories/index.story.jsx +0 -1
  323. package/src/components/line-height-control/test/index.js +1 -7
  324. package/src/components/link-picker/test/index.js +3 -1
  325. package/src/components/list-view/block-select-button.js +5 -1
  326. package/src/components/list-view/block.js +57 -20
  327. package/src/components/list-view/expander.js +5 -1
  328. package/src/components/list-view/style.scss +19 -0
  329. package/src/components/list-view/use-list-view-client-ids.js +2 -2
  330. package/src/components/observe-typing/index.js +9 -4
  331. package/src/components/preset-input-control/custom-value-controls.js +0 -2
  332. package/src/components/preset-input-control/index.js +0 -2
  333. package/src/components/resolution-tool/index.js +0 -1
  334. package/src/components/responsive-block-control/test/index.js +1 -5
  335. package/src/components/text-alignment-control/index.js +0 -1
  336. package/src/components/text-decoration-control/index.js +0 -1
  337. package/src/components/text-indent-control/index.js +7 -16
  338. package/src/components/text-transform-control/index.js +0 -1
  339. package/src/components/use-block-display-information/index.js +9 -13
  340. package/src/components/use-block-display-information/test/index.js +47 -9
  341. package/src/components/use-on-block-drop/index.js +4 -7
  342. package/src/components/writing-mode-control/index.js +0 -1
  343. package/src/hooks/block-hooks.scss +15 -0
  344. package/src/hooks/font-size.js +0 -1
  345. package/src/hooks/layout.js +5 -4
  346. package/src/hooks/position.js +44 -23
  347. package/src/hooks/states.js +6 -12
  348. package/src/hooks/test/cross-origin-isolation.js +0 -4
  349. package/src/hooks/test/layout.js +75 -1
  350. package/src/layouts/constrained.js +51 -28
  351. package/src/layouts/flex.js +0 -3
  352. package/src/layouts/grid.js +59 -7
  353. package/src/layouts/test/constrained.js +91 -0
  354. package/src/layouts/test/grid.js +71 -0
  355. package/src/private-apis.js +4 -0
  356. package/src/store/actions.js +1 -0
  357. package/src/store/private-keys.js +1 -0
  358. package/src/store/private-selectors.js +141 -4
  359. package/src/store/selectors.js +41 -0
  360. package/src/store/test/private-selectors.js +422 -0
  361. package/src/store/test/reducer.js +11 -11
  362. package/src/store/test/selectors.js +133 -0
  363. package/src/style.scss +1 -0
@@ -38,6 +38,7 @@ __export(private_selectors_exports, {
38
38
  getInsertionPoint: () => getInsertionPoint,
39
39
  getLastFocus: () => getLastFocus,
40
40
  getLastInsertedBlocksClientIds: () => getLastInsertedBlocksClientIds,
41
+ getListViewClientIdsTree: () => getListViewClientIdsTree,
41
42
  getListViewExpandRevision: () => getListViewExpandRevision,
42
43
  getParentSectionBlock: () => getParentSectionBlock,
43
44
  getPatternBySlug: () => getPatternBySlug,
@@ -130,15 +131,16 @@ var getClientIdsTree = (0, import_data.createSelector)(
130
131
  getClientIdsTreeUnmemoized,
131
132
  (state) => [state.blocks.order]
132
133
  );
133
- function getEnabledClientIdsTreeUnmemoized(state, rootClientId) {
134
+ function getFilteredClientIdsTreeUnmemoized(state, rootClientId, includesBlock) {
134
135
  const blockOrder = (0, import_selectors.getBlockOrder)(state, rootClientId);
135
136
  const result = [];
136
137
  for (const clientId of blockOrder) {
137
- const innerBlocks = getEnabledClientIdsTreeUnmemoized(
138
+ const innerBlocks = getFilteredClientIdsTreeUnmemoized(
138
139
  state,
139
- clientId
140
+ clientId,
141
+ includesBlock
140
142
  );
141
- if ((0, import_selectors.getBlockEditingMode)(state, clientId) !== "disabled") {
143
+ if (includesBlock(state, clientId)) {
142
144
  result.push({ clientId, innerBlocks });
143
145
  } else {
144
146
  result.push(...innerBlocks);
@@ -146,6 +148,58 @@ function getEnabledClientIdsTreeUnmemoized(state, rootClientId) {
146
148
  }
147
149
  return result;
148
150
  }
151
+ function getEnabledClientIdsTreeUnmemoized(state, rootClientId) {
152
+ return getFilteredClientIdsTreeUnmemoized(
153
+ state,
154
+ rootClientId,
155
+ (_state, clientId) => (0, import_selectors.getBlockEditingMode)(_state, clientId) !== "disabled"
156
+ );
157
+ }
158
+ function hasExplicitDisabledParent(state, clientId) {
159
+ let parent = state.blocks.parents.get(clientId);
160
+ while (parent !== void 0) {
161
+ const parentBlockEditingMode = state.blocks.blockEditingModes.get(parent);
162
+ if (parentBlockEditingMode) {
163
+ return parentBlockEditingMode === "disabled";
164
+ }
165
+ parent = state.blocks.parents.get(parent);
166
+ }
167
+ return false;
168
+ }
169
+ function getListViewClientIdsTreeUnmemoized(state, rootClientId) {
170
+ return getFilteredClientIdsTreeUnmemoized(
171
+ state,
172
+ rootClientId,
173
+ (_state, clientId) => {
174
+ if ((0, import_selectors.getBlockEditingMode)(_state, clientId) !== "disabled") {
175
+ return true;
176
+ }
177
+ const explicitBlockEditingMode = _state.blocks.blockEditingModes.get(clientId);
178
+ if (explicitBlockEditingMode) {
179
+ return explicitBlockEditingMode !== "disabled";
180
+ }
181
+ if (hasExplicitDisabledParent(_state, clientId)) {
182
+ return false;
183
+ }
184
+ if (_state.editedContentOnlySection) {
185
+ if (isWithinEditedContentOnlySection(_state, clientId)) {
186
+ return false;
187
+ }
188
+ const parentSectionBlock = getParentSectionBlock(
189
+ _state,
190
+ clientId
191
+ );
192
+ if (!parentSectionBlock) {
193
+ return true;
194
+ }
195
+ if (isContentBlock((0, import_selectors.getBlockName)(_state, clientId))) {
196
+ return true;
197
+ }
198
+ }
199
+ return false;
200
+ }
201
+ );
202
+ }
149
203
  var getEnabledClientIdsTree = (0, import_data.createRegistrySelector)(
150
204
  () => (0, import_data.createSelector)(getEnabledClientIdsTreeUnmemoized, (state) => [
151
205
  state.blocks.order,
@@ -153,6 +207,19 @@ var getEnabledClientIdsTree = (0, import_data.createRegistrySelector)(
153
207
  state.blocks.blockEditingModes
154
208
  ])
155
209
  );
210
+ var getListViewClientIdsTree = (0, import_data.createRegistrySelector)(
211
+ () => (0, import_data.createSelector)(getListViewClientIdsTreeUnmemoized, (state) => [
212
+ state.blocks.order,
213
+ state.derivedBlockEditingModes,
214
+ state.blocks.blockEditingModes,
215
+ state.blocks.parents,
216
+ state.blocks.byClientId,
217
+ state.blocks.attributes,
218
+ state.blockListSettings,
219
+ state.editedContentOnlySection,
220
+ state.settings
221
+ ])
222
+ );
156
223
  var getEnabledBlockParents = (0, import_data.createSelector)(
157
224
  (state, clientId, ascending = false) => {
158
225
  return (0, import_selectors.getBlockParents)(state, clientId, ascending).filter(
@@ -612,6 +679,7 @@ function isSelectedBlockStyleStateShownOnCanvas(state, clientId) {
612
679
  getInsertionPoint,
613
680
  getLastFocus,
614
681
  getLastInsertedBlocksClientIds,
682
+ getListViewClientIdsTree,
615
683
  getListViewExpandRevision,
616
684
  getParentSectionBlock,
617
685
  getPatternBySlug,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/store/private-selectors.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { createSelector, createRegistrySelector } from '@wordpress/data';\nimport {\n\thasBlockSupport,\n\tprivateApis as blocksPrivateApis,\n} from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport {\n\tgetBlockOrder,\n\tgetBlockParents,\n\tgetBlockEditingMode,\n\tgetBlockListSettings,\n\tgetSettings,\n\tcanInsertBlockType,\n\tgetBlockName,\n\tgetTemplateLock,\n\tgetClientIdsWithDescendants,\n\tgetBlockRootClientId,\n\tgetBlockAttributes,\n} from './selectors';\nimport {\n\tcheckAllowListRecursive,\n\tgetAllPatternsDependants,\n\tgetInsertBlockTypeDependants,\n\tgetGrammar,\n\tmapUserPattern,\n} from './utils';\nimport { STORE_NAME } from './constants';\nimport { unlock } from '../lock-unlock';\nimport {\n\tselectBlockPatternsKey,\n\treusableBlocksSelectKey,\n\tuserPatternCategoriesSelectKey,\n\tsectionRootClientIdKey,\n\tisIsolatedEditorKey,\n} from './private-keys';\nimport { BLOCK_VISIBILITY_VIEWPORTS } from '../components/block-visibility/constants';\n\nconst { isContentBlock } = unlock( blocksPrivateApis );\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\n/**\n * Determines if a container (clientId) allows insertion of blocks, considering contentOnly mode restrictions.\n *\n * @param {Object} state Editor state.\n * @param {string} blockName The block name to insert.\n * @param {string} rootClientId The client ID of the root container block.\n * @return {boolean} Whether the container allows insertion.\n */\nexport function isContainerInsertableToInContentOnlyMode(\n\tstate,\n\tblockName,\n\trootClientId\n) {\n\tconst isBlockContentBlock = isContentBlock( blockName );\n\tconst rootBlockName = getBlockName( state, rootClientId );\n\tconst isContainerContentBlock = isContentBlock( rootBlockName );\n\tconst isRootBlockMain = getSectionRootClientId( state ) === rootClientId;\n\n\t// In contentOnly mode, containers shouldn't be inserted into unless:\n\t// 1. they are a section root;\n\t// 2. they are a content block and the block to be inserted is also content.\n\treturn (\n\t\tisRootBlockMain || ( isContainerContentBlock && isBlockContentBlock )\n\t);\n}\n\nfunction getClientIdWithClientIdsTreeUnmemoized( state, clientId ) {\n\treturn {\n\t\tclientId,\n\t\tinnerBlocks: getClientIdsTreeUnmemoized( state, clientId ),\n\t};\n}\n\nfunction getClientIdsTreeUnmemoized( state, rootClientId = '' ) {\n\treturn getBlockOrder( state, rootClientId ).map( ( clientId ) =>\n\t\tgetClientIdWithClientIdsTreeUnmemoized( state, clientId )\n\t);\n}\n\n/**\n * Returns a stripped down block object containing only its client ID,\n * and its inner blocks' client IDs.\n *\n * @param {Object} state Editor state.\n * @param {string} clientId Client ID of the block to get.\n *\n * @return {Object} Client IDs of the post blocks.\n */\nexport const getClientIdWithClientIdsTree = createSelector(\n\tgetClientIdWithClientIdsTreeUnmemoized,\n\t( state ) => [ state.blocks.order ]\n);\n\n/**\n * Returns the block tree represented in the block-editor store from the\n * given root, consisting of stripped down block objects containing only\n * their client IDs, and their inner blocks' client IDs.\n *\n * @param {Object} state Editor state.\n * @param {?string} rootClientId Optional root client ID of block list.\n *\n * @return {Object[]} Client IDs of the post blocks.\n */\nexport const getClientIdsTree = createSelector(\n\tgetClientIdsTreeUnmemoized,\n\t( state ) => [ state.blocks.order ]\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( () =>\n\tcreateSelector( getEnabledClientIdsTreeUnmemoized, ( state ) => [\n\t\tstate.blocks.order,\n\t\tstate.derivedBlockEditingModes,\n\t\tstate.blocks.blockEditingModes,\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.blocks.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 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\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[ userPatternCategoriesSelectKey ]?.(\n\t\t\t\t\t\tselect\n\t\t\t\t\t) ?? state.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[ userPatternCategoriesSelectKey ]?.(\n\t\t\t\t\t\t\tselect\n\t\t\t\t\t\t) ?? state.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\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 * Checks whether a block meets the raw criteria to be a section block,\n * without considering contextual factors like nesting or the edited\n * content-only section. Used internally by `isSectionBlock` and\n * `getParentSectionBlock` to avoid circular calls between them.\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 candidate section block.\n */\nfunction isSectionBlockCandidate( state, clientId ) {\n\tconst blockName = getBlockName( state, clientId );\n\tif ( blockName === 'core/block' ) {\n\t\treturn true;\n\t}\n\n\tconst attributes = getBlockAttributes( state, clientId );\n\tconst isTemplatePart = blockName === 'core/template-part';\n\n\t// When in an isolated editing context (e.g., editing a template part or pattern directly),\n\t// don't treat nested unsynced patterns as section blocks.\n\tconst isIsolatedEditor = state.settings?.[ isIsolatedEditorKey ];\n\n\tconst disableContentOnlyForUnsyncedPatterns =\n\t\tstate.settings?.disableContentOnlyForUnsyncedPatterns;\n\n\tconst disableContentOnlyForTemplateParts =\n\t\tstate.settings?.disableContentOnlyForTemplateParts;\n\n\tif (\n\t\t( ( ! disableContentOnlyForUnsyncedPatterns &&\n\t\t\tattributes?.metadata?.patternName ) ||\n\t\t\t( isTemplatePart && ! disableContentOnlyForTemplateParts ) ) &&\n\t\t! isIsolatedEditor\n\t) {\n\t\treturn true;\n\t}\n\n\t// TemplateLock cascades to all inner parent blocks. Only the top-level\n\t// block that's contentOnly templateLocked is the true contentLocker,\n\t// all the others are mere imitators.\n\tconst hasContentOnlyTemplateLock =\n\t\tgetTemplateLock( state, clientId ) === 'contentOnly';\n\tconst rootClientId = getBlockRootClientId( state, clientId );\n\tconst hasRootContentOnlyTemplateLock =\n\t\tgetTemplateLock( state, rootClientId ) === 'contentOnly';\n\tif ( hasContentOnlyTemplateLock && ! hasRootContentOnlyTemplateLock ) {\n\t\treturn true;\n\t}\n\n\treturn false;\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 a contentOnly section.\n */\nexport const getParentSectionBlock = ( state, clientId ) => {\n\t// If this block is within the edited content-only section,\n\t// it has no parent section — it's temporarily fully editable.\n\tif ( isWithinEditedContentOnlySection( state, clientId ) ) {\n\t\treturn undefined;\n\t}\n\n\tlet current = clientId;\n\tlet result;\n\n\t// If sections are nested, return the top level section block.\n\t// Don't return early.\n\twhile ( ( current = state.blocks.parents.get( current ) ) ) {\n\t\tif ( isSectionBlockCandidate( state, current ) ) {\n\t\t\tresult = current;\n\t\t}\n\t}\n\treturn result;\n};\n\n/**\n * Returns whether the block is a contentOnly section.\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 contentOnly section.\n */\nexport function isSectionBlock( state, clientId ) {\n\t// isWithinEditedContentOnlySection -\n\t// If the section is being edited or a parent section is being edited,\n\t// this block is temporarily not considered a section.\n\t//\n\t// getParentSectionBlock -\n\t// Only the top level section is considered the section,\n\t// a nested section is managed by its parent section.\n\tif (\n\t\tisWithinEditedContentOnlySection( state, clientId ) ||\n\t\tgetParentSectionBlock( state, clientId )\n\t) {\n\t\treturn false;\n\t}\n\n\treturn isSectionBlockCandidate( state, clientId );\n}\n\n/**\n * Retrieves the client ID of the block that is a contentOnly section but is\n * currently being temporarily edited (contentOnly is deactivated).\n *\n * @param {Object} state Global application state.\n *\n * @return {?string} The client ID of the block being temporarily edited.\n */\nexport function getEditedContentOnlySection( state ) {\n\treturn state.editedContentOnlySection;\n}\n\nexport function isWithinEditedContentOnlySection( state, clientId ) {\n\tif ( ! state.editedContentOnlySection ) {\n\t\treturn false;\n\t}\n\n\tif ( state.editedContentOnlySection === clientId ) {\n\t\treturn true;\n\t}\n\n\tlet current = clientId;\n\twhile ( ( current = state.blocks.parents.get( current ) ) ) {\n\t\tif ( state.editedContentOnlySection === current ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\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\n/**\n * Returns true if the block is hidden anywhere, or false otherwise.\n *\n * This selector checks whether a block has visibility metadata set that would\n * hide it at any viewport or everywhere. It's useful for flagging blocks that\n * have visibility restrictions.\n *\n * A block is considered hidden anywhere if:\n * - blockVisibility is false (hidden everywhere)\n * - blockVisibility.viewport has any viewport set to false (hidden at specific screen sizes)\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 hidden anywhere.\n */\nexport const isBlockHiddenAnywhere = ( state, clientId ) => {\n\tconst blockName = getBlockName( state, clientId );\n\tif ( ! hasBlockSupport( blockName, 'visibility', true ) ) {\n\t\treturn false;\n\t}\n\tconst attributes = state.blocks.attributes.get( clientId );\n\tconst blockVisibility = attributes?.metadata?.blockVisibility;\n\n\tif ( blockVisibility === false ) {\n\t\treturn true;\n\t}\n\n\tif (\n\t\ttypeof blockVisibility?.viewport === 'object' &&\n\t\tblockVisibility?.viewport !== null\n\t) {\n\t\t// Check if the block is hidden at any viewport.\n\t\treturn Object.values( BLOCK_VISIBILITY_VIEWPORTS ).some(\n\t\t\t( viewport ) =>\n\t\t\t\tblockVisibility?.viewport?.[ viewport.key ] === false\n\t\t);\n\t}\n\treturn false;\n};\n\n/**\n * Returns true if the block is hidden everywhere (blockVisibility is false).\n *\n * A block is considered hidden everywhere when blockVisibility is explicitly\n * set to false, which means it's hidden on all viewports.\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 hidden everywhere.\n */\nexport const isBlockHiddenEverywhere = ( state, clientId ) => {\n\tconst blockName = getBlockName( state, clientId );\n\tif ( ! hasBlockSupport( blockName, 'visibility', true ) ) {\n\t\treturn false;\n\t}\n\tconst attributes = state.blocks.attributes.get( clientId );\n\tconst blockVisibility = attributes?.metadata?.blockVisibility;\n\n\tif ( blockVisibility === false ) {\n\t\treturn true;\n\t}\n\treturn false;\n};\n\n/**\n * Returns true if any parent block (immediate or further up the chain) is hidden everywhere.\n *\n * Checks all parent blocks in the hierarchy and returns true if any of them\n * is hidden everywhere.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId Client ID of the block.\n *\n * @return {boolean} Whether any parent block is hidden everywhere.\n */\nexport const isBlockParentHiddenEverywhere = ( state, clientId ) => {\n\tconst parents = getBlockParents( state, clientId );\n\treturn parents.some( ( parentId ) =>\n\t\tisBlockHiddenEverywhere( state, parentId )\n\t);\n};\n\n/**\n * Returns true if the block is hidden at the given viewport.\n *\n * A block is considered hidden at a viewport if:\n * - blockVisibility is false (hidden everywhere)\n * - blockVisibility is an object with the specified viewport set to false\n *\n * @param {Object} state Global application state.\n * @param {string} clientId Client ID of the block.\n * @param {string} viewport Viewport to check ('desktop', 'tablet', 'mobile').\n *\n * @return {boolean} Whether the block is hidden at the viewport.\n */\nexport const isBlockHiddenAtViewport = ( state, clientId, viewport ) => {\n\tif ( isBlockHiddenEverywhere( state, clientId ) ) {\n\t\treturn true;\n\t}\n\n\tconst attributes = state.blocks.attributes.get( clientId );\n\tconst blockVisibilityViewport =\n\t\tattributes?.metadata?.blockVisibility?.viewport;\n\tif (\n\t\ttypeof blockVisibilityViewport === 'object' &&\n\t\tblockVisibilityViewport !== null &&\n\t\ttypeof viewport === 'string'\n\t) {\n\t\treturn blockVisibilityViewport?.[ viewport.toLowerCase() ] === false;\n\t}\n\treturn false;\n};\n\n/**\n * Returns true if any parent block (immediate or further up the chain) is hidden at the given viewport.\n *\n * Checks all parent blocks in the hierarchy and returns true if any of them\n * is hidden at the specified viewport.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId Client ID of the block.\n * @param {string} viewport Viewport to check ('desktop', 'tablet', 'mobile').\n *\n * @return {boolean} Whether any parent block is hidden at the viewport.\n */\nexport const isBlockParentHiddenAtViewport = ( state, clientId, viewport ) => {\n\tconst parents = getBlockParents( state, clientId );\n\treturn parents.some( ( parentId ) =>\n\t\tisBlockHiddenAtViewport( state, parentId, viewport )\n\t);\n};\n\n/**\n * Returns true if there is a spotlighted block.\n *\n * The spotlight is also active when a contentOnly section is being edited, the selector\n * also returns true if this is the case.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the block is currently spotlighted.\n */\nexport function hasBlockSpotlight( state ) {\n\treturn !! state.hasBlockSpotlight || !! state.editedContentOnlySection;\n}\n\n/**\n * Returns whether a block is locked to prevent editing.\n *\n * This selector only reasons about block lock, not associated features\n * like `blockEditingMode` that might prevent user modifications to a block.\n * Currently there's also no way to prevent editing via `templateLock`.\n *\n * This distinction is important as this selector specifically drives the block lock UI\n * that a user interacts with. `blockEditingModes` aren't included as a user can't change\n * them.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId ClientId of the block.\n *\n * @return {boolean} Whether the block is currently locked.\n */\nexport function isEditLockedBlock( state, clientId ) {\n\tconst attributes = getBlockAttributes( state, clientId );\n\treturn !! attributes?.lock?.edit;\n}\n\n/**\n * Returns whether a block is locked to prevent moving.\n *\n * This selector only reasons about templateLock and block lock, not associated features\n * like `blockEditingMode` that might prevent user modifications to a block.\n *\n * This distinction is important as this selector specifically drives the block lock UI\n * that a user interacts with. `blockEditingModes` are excluded as a user can't change\n * them.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId ClientId of the block.\n *\n * @return {boolean} Whether the block is currently locked.\n */\nexport function isMoveLockedBlock( state, clientId ) {\n\tconst attributes = getBlockAttributes( state, clientId );\n\t// If a block explicitly has `move` set to `false`, it turns off\n\t// any locking that might be inherited from a parent.\n\tif ( attributes?.lock?.move !== undefined ) {\n\t\treturn !! attributes?.lock?.move;\n\t}\n\n\tconst rootClientId = getBlockRootClientId( state, clientId );\n\tconst templateLock = getTemplateLock( state, rootClientId );\n\n\t// While `contentOnly` templateLock does sometimes prevent moving, a user can't modify\n\t// this, so don't include it in this function. See the `canMoveBlock` selector\n\t// as an alternative.\n\treturn templateLock === 'all';\n}\n\n/**\n * Returns whether a block is locked to prevent removal.\n *\n * This selector only reasons about templateLock and block lock, not associated features\n * like `blockEditingMode` that might prevent user modifications to a block.\n *\n * This distinction is important as this selector specifically drives the block lock UI\n * that a user interacts with. `blockEditingModes` are excluded as a user can't change\n * them.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId ClientId of the block.\n *\n * @return {boolean} Whether the block is currently locked.\n */\nexport function isRemoveLockedBlock( state, clientId ) {\n\tconst attributes = getBlockAttributes( state, clientId );\n\tif ( attributes?.lock?.remove !== undefined ) {\n\t\treturn !! attributes?.lock?.remove;\n\t}\n\n\tconst rootClientId = getBlockRootClientId( state, clientId );\n\tconst templateLock = getTemplateLock( state, rootClientId );\n\n\t// While `contentOnly` templateLock does sometimes prevent removal, a user can't modify\n\t// this, so don't include it in this function. See the `canRemoveBlock` selector\n\t// as an alternative.\n\treturn templateLock === 'all' || templateLock === 'insert';\n}\n\n/**\n * Returns whether a block is locked.\n *\n * This selector only reasons about templateLock and block lock, not associated features\n * like `blockEditingMode` that might prevent user modifications to a block.\n *\n * This distinction is important as this selector specifically drives the block lock UI\n * that a user interacts with. `blockEditingModes` are excluded as a user can't change\n * them.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId ClientId of the block.\n *\n * @return {boolean} Whether the block is currently locked.\n */\nexport function isLockedBlock( state, clientId ) {\n\treturn (\n\t\tisEditLockedBlock( state, clientId ) ||\n\t\tisMoveLockedBlock( state, clientId ) ||\n\t\tisRemoveLockedBlock( state, clientId )\n\t);\n}\n\n/**\n * Returns whether the list view content panel popover is open.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the popover is open.\n */\nexport function isListViewContentPanelOpen( state ) {\n\treturn state.listViewContentPanelOpen;\n}\n\n/**\n * Returns whether a List View panel is opened.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId Client ID of the block.\n *\n * @return {boolean} Whether the panel is opened.\n */\nexport function isListViewPanelOpened( state, clientId ) {\n\t// If allOpen flag is set, all panels are open\n\tif ( state.openedListViewPanels?.allOpen ) {\n\t\treturn true;\n\t}\n\treturn state.openedListViewPanels?.panels?.[ clientId ] === true;\n}\n\n/**\n * Returns the List View expand revision number.\n *\n * This counter is used in the ListView component's key prop to force remounting.\n *\n * @param {Object} state Global application state.\n *\n * @return {number} The expand revision number.\n */\nexport function getListViewExpandRevision( state ) {\n\treturn state.listViewExpandRevision || 0;\n}\n\n/**\n * Returns whether a block instance participates in List View-specific UI for\n * its inner blocks.\n *\n * Intentionally private: this is the derived participation logic (block type\n * `listView` support and the `core/navigation` special case) shared by the List\n * View consumers. A `listView`-supporting block drops out when it has no inner\n * blocks and its `allowedBlocks` (`[]` or `false`) permits no block: the nested\n * List View panel would render no rows and no appender, so it is hidden rather\n * than shown empty. This is a signal, not a guarantee — a child naming this\n * block as its `parent` stays insertable regardless (see `canInsertBlockType`);\n * that edge case is accepted to keep the check cheap. Keeping the read internal\n * lets this computation evolve without a back-compat commitment.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId Client ID of the block.\n *\n * @return {boolean} Whether the block participates in List View-specific UI.\n */\nexport function shouldRenderBlockListView( state, clientId ) {\n\tconst blockName = getBlockName( state, clientId );\n\n\t// The navigation block always participates; its List View is core to how it\n\t// is edited, regardless of how its menu is locked or populated.\n\tif ( blockName === 'core/navigation' ) {\n\t\treturn true;\n\t}\n\n\tif ( ! hasBlockSupport( blockName, 'listView' ) ) {\n\t\treturn false;\n\t}\n\n\t// `allowedBlocks` permits no block when it is `[]` or `false`; an unset value\n\t// is unrestricted and is intentionally not matched.\n\tconst allowedBlocks = getBlockListSettings(\n\t\tstate,\n\t\tclientId\n\t)?.allowedBlocks;\n\tconst isEmptyAndNoAllowedBlocks =\n\t\tgetBlockOrder( state, clientId ).length === 0 &&\n\t\t( allowedBlocks === false ||\n\t\t\t( Array.isArray( allowedBlocks ) && allowedBlocks.length === 0 ) );\n\n\treturn ! isEmptyAndNoAllowedBlocks;\n}\n\n/**\n * Returns the client IDs for the viewport modal, or null if\n * the modal is not open.\n *\n * @param {Object} state Global application state.\n *\n * @return {string[]|null} Client IDs for the visibility modal, or null.\n */\nexport function getViewportModalClientIds( state ) {\n\treturn state.viewportModalClientIds;\n}\n\n/**\n * Returns the requested inspector tab state, if any.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object|null} The requested tab state with tabName and options, or null if no request is pending.\n */\nexport function getRequestedInspectorTab( state ) {\n\treturn state.requestedInspectorTab;\n}\n\nconst DEFAULT_BLOCK_STYLE_STATE = {\n\tviewport: 'default',\n\tpseudo: 'default',\n};\n\n/**\n * Returns the globally selected viewport style state. When set to a value other\n * than 'default', block style edits in the inspector apply to that viewport.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} The selected viewport style state.\n */\nexport function getStyleStateViewport( state ) {\n\treturn state.styleStateViewport ?? DEFAULT_BLOCK_STYLE_STATE.viewport;\n}\n\n/**\n * Returns whether Responsive editing is enabled. When enabled, the device\n * preview also drives which viewport block style edits are applied to.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether Responsive editing is enabled.\n */\nexport function isResponsiveEditing( state ) {\n\treturn state.isResponsiveEditing;\n}\n\n/**\n * Returns the selected style state for a block's style controls.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId The block client ID.\n *\n * @return {Object} The selected block style state.\n */\nexport const getSelectedBlockStyleState = createSelector(\n\t( state, clientId ) => {\n\t\tconst perBlockState =\n\t\t\tstate.selectedBlockStyleState?.clientId === clientId\n\t\t\t\t? state.selectedBlockStyleState.value ??\n\t\t\t\t DEFAULT_BLOCK_STYLE_STATE\n\t\t\t\t: DEFAULT_BLOCK_STYLE_STATE;\n\n\t\treturn {\n\t\t\t...perBlockState,\n\t\t\t// The viewport is tracked globally, so inject it here. This way\n\t\t\t// consumers receive a single combined state object instead of\n\t\t\t// merging the global viewport themselves, and selectors derived\n\t\t\t// from this stay consistent.\n\t\t\tviewport: getStyleStateViewport( state ),\n\t\t};\n\t},\n\t( state ) => [ state.styleStateViewport, state.selectedBlockStyleState ]\n);\n\n/**\n * Returns whether a non-default style state is selected for a block.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId The block client ID.\n *\n * @return {boolean} Whether a non-default block style state is selected.\n */\nexport function hasSelectedStyleState( state, clientId ) {\n\tconst selectedState = getSelectedBlockStyleState( state, clientId );\n\n\treturn (\n\t\tselectedState.viewport !== DEFAULT_BLOCK_STYLE_STATE.viewport ||\n\t\tselectedState.pseudo !== DEFAULT_BLOCK_STYLE_STATE.pseudo\n\t);\n}\n\n/**\n * Returns whether the selected style state is shown on the canvas.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId The block client ID.\n *\n * @return {boolean} Whether the selected style state is shown on the canvas.\n */\nexport function isSelectedBlockStyleStateShownOnCanvas( state, clientId ) {\n\tif ( state.selectedBlockStyleState?.clientId !== clientId ) {\n\t\treturn true;\n\t}\n\n\treturn state.selectedBlockStyleState.showStateOnCanvas ?? true;\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAuD;AACvD,oBAGO;AAKP,uBAYO;AACP,mBAMO;AACP,uBAA2B;AAC3B,yBAAuB;AACvB,0BAMO;AACP,IAAAA,oBAA2C;AAI3C,gCAAiC;AAFjC,IAAM,EAAE,eAAe,QAAI,2BAAQ,cAAAC,WAAkB;AAW9C,SAAS,uBAAwB,OAAQ;AAC/C,SAAO,MAAM;AACd;AAQO,SAAS,+BAAgC,OAAQ;AACvD,SAAO,OAAO,mBAAmB;AAClC;AAEO,SAAS,0BAA2B,OAAO,UAAW;AAC5D,SAAO,MAAM,OAAO,WAAW,IAAK,QAAS;AAC9C;AAWO,IAAM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AuB,OAAO,UAAW;AACxD,QAAM,gBAAgB,2BAA4B,OAAO,QAAS;AAElE,SACC,cAAc,aAAa,0BAA0B,YACrD,cAAc,WAAW,0BAA0B;AAErD;AAUO,SAAS,uCAAwC,OAAO,UAAW;AACzE,MAAK,MAAM,yBAAyB,aAAa,UAAW;AAC3D,WAAO;AAAA,EACR;AAEA,SAAO,MAAM,wBAAwB,qBAAqB;AAC3D;",
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { createSelector, createRegistrySelector } from '@wordpress/data';\nimport {\n\thasBlockSupport,\n\tprivateApis as blocksPrivateApis,\n} from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport {\n\tgetBlockOrder,\n\tgetBlockParents,\n\tgetBlockEditingMode,\n\tgetBlockListSettings,\n\tgetSettings,\n\tcanInsertBlockType,\n\tgetBlockName,\n\tgetTemplateLock,\n\tgetClientIdsWithDescendants,\n\tgetBlockRootClientId,\n\tgetBlockAttributes,\n} from './selectors';\nimport {\n\tcheckAllowListRecursive,\n\tgetAllPatternsDependants,\n\tgetInsertBlockTypeDependants,\n\tgetGrammar,\n\tmapUserPattern,\n} from './utils';\nimport { STORE_NAME } from './constants';\nimport { unlock } from '../lock-unlock';\nimport {\n\tselectBlockPatternsKey,\n\treusableBlocksSelectKey,\n\tuserPatternCategoriesSelectKey,\n\tsectionRootClientIdKey,\n\tisIsolatedEditorKey,\n} from './private-keys';\nimport { BLOCK_VISIBILITY_VIEWPORTS } from '../components/block-visibility/constants';\n\nconst { isContentBlock } = unlock( blocksPrivateApis );\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\n/**\n * Determines if a container (clientId) allows insertion of blocks, considering contentOnly mode restrictions.\n *\n * @param {Object} state Editor state.\n * @param {string} blockName The block name to insert.\n * @param {string} rootClientId The client ID of the root container block.\n * @return {boolean} Whether the container allows insertion.\n */\nexport function isContainerInsertableToInContentOnlyMode(\n\tstate,\n\tblockName,\n\trootClientId\n) {\n\tconst isBlockContentBlock = isContentBlock( blockName );\n\tconst rootBlockName = getBlockName( state, rootClientId );\n\tconst isContainerContentBlock = isContentBlock( rootBlockName );\n\tconst isRootBlockMain = getSectionRootClientId( state ) === rootClientId;\n\n\t// In contentOnly mode, containers shouldn't be inserted into unless:\n\t// 1. they are a section root;\n\t// 2. they are a content block and the block to be inserted is also content.\n\treturn (\n\t\tisRootBlockMain || ( isContainerContentBlock && isBlockContentBlock )\n\t);\n}\n\nfunction getClientIdWithClientIdsTreeUnmemoized( state, clientId ) {\n\treturn {\n\t\tclientId,\n\t\tinnerBlocks: getClientIdsTreeUnmemoized( state, clientId ),\n\t};\n}\n\nfunction getClientIdsTreeUnmemoized( state, rootClientId = '' ) {\n\treturn getBlockOrder( state, rootClientId ).map( ( clientId ) =>\n\t\tgetClientIdWithClientIdsTreeUnmemoized( state, clientId )\n\t);\n}\n\n/**\n * Returns a stripped down block object containing only its client ID,\n * and its inner blocks' client IDs.\n *\n * @param {Object} state Editor state.\n * @param {string} clientId Client ID of the block to get.\n *\n * @return {Object} Client IDs of the post blocks.\n */\nexport const getClientIdWithClientIdsTree = createSelector(\n\tgetClientIdWithClientIdsTreeUnmemoized,\n\t( state ) => [ state.blocks.order ]\n);\n\n/**\n * Returns the block tree represented in the block-editor store from the\n * given root, consisting of stripped down block objects containing only\n * their client IDs, and their inner blocks' client IDs.\n *\n * @param {Object} state Editor state.\n * @param {?string} rootClientId Optional root client ID of block list.\n *\n * @return {Object[]} Client IDs of the post blocks.\n */\nexport const getClientIdsTree = createSelector(\n\tgetClientIdsTreeUnmemoized,\n\t( state ) => [ state.blocks.order ]\n);\n\n/**\n * Returns a tree of block objects filtered by a block inclusion callback.\n * Excluded blocks are replaced by any included descendants.\n *\n * @param {Object} state Global application state.\n * @param {?string} rootClientId Optional root client ID of block list.\n * @param {Function} includesBlock Callback that returns whether to include a block.\n *\n * @return {Object[]} Tree of block objects with only clientID and innerBlocks set.\n */\nfunction getFilteredClientIdsTreeUnmemoized(\n\tstate,\n\trootClientId,\n\tincludesBlock\n) {\n\tconst blockOrder = getBlockOrder( state, rootClientId );\n\tconst result = [];\n\n\tfor ( const clientId of blockOrder ) {\n\t\tconst innerBlocks = getFilteredClientIdsTreeUnmemoized(\n\t\t\tstate,\n\t\t\tclientId,\n\t\t\tincludesBlock\n\t\t);\n\t\tif ( includesBlock( state, clientId ) ) {\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\nfunction getEnabledClientIdsTreeUnmemoized( state, rootClientId ) {\n\treturn getFilteredClientIdsTreeUnmemoized(\n\t\tstate,\n\t\trootClientId,\n\t\t( _state, clientId ) =>\n\t\t\tgetBlockEditingMode( _state, clientId ) !== 'disabled'\n\t);\n}\n\n/**\n * Returns whether the nearest explicit block editing mode in the block's\n * ancestry is disabled.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId The block client ID.\n *\n * @return {boolean} Whether an explicit parent block editing mode disables this\n * block.\n */\nfunction hasExplicitDisabledParent( state, clientId ) {\n\tlet parent = state.blocks.parents.get( clientId );\n\n\twhile ( parent !== undefined ) {\n\t\tconst parentBlockEditingMode =\n\t\t\tstate.blocks.blockEditingModes.get( parent );\n\n\t\tif ( parentBlockEditingMode ) {\n\t\t\treturn parentBlockEditingMode === 'disabled';\n\t\t}\n\n\t\tparent = state.blocks.parents.get( parent );\n\t}\n\n\treturn false;\n}\n\n/**\n * Returns the block tree displayed by List View.\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 */\nfunction getListViewClientIdsTreeUnmemoized( state, rootClientId ) {\n\treturn getFilteredClientIdsTreeUnmemoized(\n\t\tstate,\n\t\trootClientId,\n\t\t( _state, clientId ) => {\n\t\t\t// Non-disabled blocks are always shown in List view.\n\t\t\tif ( getBlockEditingMode( _state, clientId ) !== 'disabled' ) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tconst explicitBlockEditingMode =\n\t\t\t\t_state.blocks.blockEditingModes.get( clientId );\n\t\t\tif ( explicitBlockEditingMode ) {\n\t\t\t\treturn explicitBlockEditingMode !== 'disabled';\n\t\t\t}\n\n\t\t\tif ( hasExplicitDisabledParent( _state, clientId ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// When a contentOnly section is being edited, there's some special handling.\n\t\t\tif ( _state.editedContentOnlySection ) {\n\t\t\t\t// Blocks within the edited content only section generally have their block\n\t\t\t\t// editing mode flipped from disabled to default for editing, any disabled\n\t\t\t\t// blocks can still be excluded.\n\t\t\t\tif ( isWithinEditedContentOnlySection( _state, clientId ) ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\t// Blocks that are not in another section but are disabled are shown.\n\t\t\t\t// These are blocks that would usually be visible.\n\t\t\t\tconst parentSectionBlock = getParentSectionBlock(\n\t\t\t\t\t_state,\n\t\t\t\t\tclientId\n\t\t\t\t);\n\t\t\t\tif ( ! parentSectionBlock ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\t// If a block is in another section, then it is only visible if its a content block.\n\t\t\t\tif ( isContentBlock( getBlockName( _state, clientId ) ) ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\t);\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( () =>\n\tcreateSelector( getEnabledClientIdsTreeUnmemoized, ( state ) => [\n\t\tstate.blocks.order,\n\t\tstate.derivedBlockEditingModes,\n\t\tstate.blocks.blockEditingModes,\n\t] )\n);\n\n/**\n * Returns the block tree displayed by List View.\n *\n * Blocks with a 'disabled' editing mode are usually not included. When a\n * content-only section is being edited, List View keeps visible outside-section\n * context blocks in the tree so they can be faded. Blocks that were already\n * hidden because they are non-content blocks inside another content-only section\n * remain hidden.\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 getListViewClientIdsTree = createRegistrySelector( () =>\n\tcreateSelector( getListViewClientIdsTreeUnmemoized, ( state ) => [\n\t\tstate.blocks.order,\n\t\tstate.derivedBlockEditingModes,\n\t\tstate.blocks.blockEditingModes,\n\t\tstate.blocks.parents,\n\t\tstate.blocks.byClientId,\n\t\tstate.blocks.attributes,\n\t\tstate.blockListSettings,\n\t\tstate.editedContentOnlySection,\n\t\tstate.settings,\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.blocks.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 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\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[ userPatternCategoriesSelectKey ]?.(\n\t\t\t\t\t\tselect\n\t\t\t\t\t) ?? state.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[ userPatternCategoriesSelectKey ]?.(\n\t\t\t\t\t\t\tselect\n\t\t\t\t\t\t) ?? state.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\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 * Checks whether a block meets the raw criteria to be a section block,\n * without considering contextual factors like nesting or the edited\n * content-only section. Used internally by `isSectionBlock` and\n * `getParentSectionBlock` to avoid circular calls between them.\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 candidate section block.\n */\nfunction isSectionBlockCandidate( state, clientId ) {\n\tconst blockName = getBlockName( state, clientId );\n\tif ( blockName === 'core/block' ) {\n\t\treturn true;\n\t}\n\n\tconst attributes = getBlockAttributes( state, clientId );\n\tconst isTemplatePart = blockName === 'core/template-part';\n\n\t// When in an isolated editing context (e.g., editing a template part or pattern directly),\n\t// don't treat nested unsynced patterns as section blocks.\n\tconst isIsolatedEditor = state.settings?.[ isIsolatedEditorKey ];\n\n\tconst disableContentOnlyForUnsyncedPatterns =\n\t\tstate.settings?.disableContentOnlyForUnsyncedPatterns;\n\n\tconst disableContentOnlyForTemplateParts =\n\t\tstate.settings?.disableContentOnlyForTemplateParts;\n\n\tif (\n\t\t( ( ! disableContentOnlyForUnsyncedPatterns &&\n\t\t\tattributes?.metadata?.patternName ) ||\n\t\t\t( isTemplatePart && ! disableContentOnlyForTemplateParts ) ) &&\n\t\t! isIsolatedEditor\n\t) {\n\t\treturn true;\n\t}\n\n\t// TemplateLock cascades to all inner parent blocks. Only the top-level\n\t// block that's contentOnly templateLocked is the true contentLocker,\n\t// all the others are mere imitators.\n\tconst hasContentOnlyTemplateLock =\n\t\tgetTemplateLock( state, clientId ) === 'contentOnly';\n\tconst rootClientId = getBlockRootClientId( state, clientId );\n\tconst hasRootContentOnlyTemplateLock =\n\t\tgetTemplateLock( state, rootClientId ) === 'contentOnly';\n\tif ( hasContentOnlyTemplateLock && ! hasRootContentOnlyTemplateLock ) {\n\t\treturn true;\n\t}\n\n\treturn false;\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 a contentOnly section.\n */\nexport const getParentSectionBlock = ( state, clientId ) => {\n\t// If this block is within the edited content-only section,\n\t// it has no parent section — it's temporarily fully editable.\n\tif ( isWithinEditedContentOnlySection( state, clientId ) ) {\n\t\treturn undefined;\n\t}\n\n\tlet current = clientId;\n\tlet result;\n\n\t// If sections are nested, return the top level section block.\n\t// Don't return early.\n\twhile ( ( current = state.blocks.parents.get( current ) ) ) {\n\t\tif ( isSectionBlockCandidate( state, current ) ) {\n\t\t\tresult = current;\n\t\t}\n\t}\n\treturn result;\n};\n\n/**\n * Returns whether the block is a contentOnly section.\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 contentOnly section.\n */\nexport function isSectionBlock( state, clientId ) {\n\t// isWithinEditedContentOnlySection -\n\t// If the section is being edited or a parent section is being edited,\n\t// this block is temporarily not considered a section.\n\t//\n\t// getParentSectionBlock -\n\t// Only the top level section is considered the section,\n\t// a nested section is managed by its parent section.\n\tif (\n\t\tisWithinEditedContentOnlySection( state, clientId ) ||\n\t\tgetParentSectionBlock( state, clientId )\n\t) {\n\t\treturn false;\n\t}\n\n\treturn isSectionBlockCandidate( state, clientId );\n}\n\n/**\n * Retrieves the client ID of the block that is a contentOnly section but is\n * currently being temporarily edited (contentOnly is deactivated).\n *\n * @param {Object} state Global application state.\n *\n * @return {?string} The client ID of the block being temporarily edited.\n */\nexport function getEditedContentOnlySection( state ) {\n\treturn state.editedContentOnlySection;\n}\n\nexport function isWithinEditedContentOnlySection( state, clientId ) {\n\tif ( ! state.editedContentOnlySection ) {\n\t\treturn false;\n\t}\n\n\tif ( state.editedContentOnlySection === clientId ) {\n\t\treturn true;\n\t}\n\n\tlet current = clientId;\n\twhile ( ( current = state.blocks.parents.get( current ) ) ) {\n\t\tif ( state.editedContentOnlySection === current ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\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\n/**\n * Returns true if the block is hidden anywhere, or false otherwise.\n *\n * This selector checks whether a block has visibility metadata set that would\n * hide it at any viewport or everywhere. It's useful for flagging blocks that\n * have visibility restrictions.\n *\n * A block is considered hidden anywhere if:\n * - blockVisibility is false (hidden everywhere)\n * - blockVisibility.viewport has any viewport set to false (hidden at specific screen sizes)\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 hidden anywhere.\n */\nexport const isBlockHiddenAnywhere = ( state, clientId ) => {\n\tconst blockName = getBlockName( state, clientId );\n\tif ( ! hasBlockSupport( blockName, 'visibility', true ) ) {\n\t\treturn false;\n\t}\n\tconst attributes = state.blocks.attributes.get( clientId );\n\tconst blockVisibility = attributes?.metadata?.blockVisibility;\n\n\tif ( blockVisibility === false ) {\n\t\treturn true;\n\t}\n\n\tif (\n\t\ttypeof blockVisibility?.viewport === 'object' &&\n\t\tblockVisibility?.viewport !== null\n\t) {\n\t\t// Check if the block is hidden at any viewport.\n\t\treturn Object.values( BLOCK_VISIBILITY_VIEWPORTS ).some(\n\t\t\t( viewport ) =>\n\t\t\t\tblockVisibility?.viewport?.[ viewport.key ] === false\n\t\t);\n\t}\n\treturn false;\n};\n\n/**\n * Returns true if the block is hidden everywhere (blockVisibility is false).\n *\n * A block is considered hidden everywhere when blockVisibility is explicitly\n * set to false, which means it's hidden on all viewports.\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 hidden everywhere.\n */\nexport const isBlockHiddenEverywhere = ( state, clientId ) => {\n\tconst blockName = getBlockName( state, clientId );\n\tif ( ! hasBlockSupport( blockName, 'visibility', true ) ) {\n\t\treturn false;\n\t}\n\tconst attributes = state.blocks.attributes.get( clientId );\n\tconst blockVisibility = attributes?.metadata?.blockVisibility;\n\n\tif ( blockVisibility === false ) {\n\t\treturn true;\n\t}\n\treturn false;\n};\n\n/**\n * Returns true if any parent block (immediate or further up the chain) is hidden everywhere.\n *\n * Checks all parent blocks in the hierarchy and returns true if any of them\n * is hidden everywhere.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId Client ID of the block.\n *\n * @return {boolean} Whether any parent block is hidden everywhere.\n */\nexport const isBlockParentHiddenEverywhere = ( state, clientId ) => {\n\tconst parents = getBlockParents( state, clientId );\n\treturn parents.some( ( parentId ) =>\n\t\tisBlockHiddenEverywhere( state, parentId )\n\t);\n};\n\n/**\n * Returns true if the block is hidden at the given viewport.\n *\n * A block is considered hidden at a viewport if:\n * - blockVisibility is false (hidden everywhere)\n * - blockVisibility is an object with the specified viewport set to false\n *\n * @param {Object} state Global application state.\n * @param {string} clientId Client ID of the block.\n * @param {string} viewport Viewport to check ('desktop', 'tablet', 'mobile').\n *\n * @return {boolean} Whether the block is hidden at the viewport.\n */\nexport const isBlockHiddenAtViewport = ( state, clientId, viewport ) => {\n\tif ( isBlockHiddenEverywhere( state, clientId ) ) {\n\t\treturn true;\n\t}\n\n\tconst attributes = state.blocks.attributes.get( clientId );\n\tconst blockVisibilityViewport =\n\t\tattributes?.metadata?.blockVisibility?.viewport;\n\tif (\n\t\ttypeof blockVisibilityViewport === 'object' &&\n\t\tblockVisibilityViewport !== null &&\n\t\ttypeof viewport === 'string'\n\t) {\n\t\treturn blockVisibilityViewport?.[ viewport.toLowerCase() ] === false;\n\t}\n\treturn false;\n};\n\n/**\n * Returns true if any parent block (immediate or further up the chain) is hidden at the given viewport.\n *\n * Checks all parent blocks in the hierarchy and returns true if any of them\n * is hidden at the specified viewport.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId Client ID of the block.\n * @param {string} viewport Viewport to check ('desktop', 'tablet', 'mobile').\n *\n * @return {boolean} Whether any parent block is hidden at the viewport.\n */\nexport const isBlockParentHiddenAtViewport = ( state, clientId, viewport ) => {\n\tconst parents = getBlockParents( state, clientId );\n\treturn parents.some( ( parentId ) =>\n\t\tisBlockHiddenAtViewport( state, parentId, viewport )\n\t);\n};\n\n/**\n * Returns true if there is a spotlighted block.\n *\n * The spotlight is also active when a contentOnly section is being edited, the selector\n * also returns true if this is the case.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the block is currently spotlighted.\n */\nexport function hasBlockSpotlight( state ) {\n\treturn !! state.hasBlockSpotlight || !! state.editedContentOnlySection;\n}\n\n/**\n * Returns whether a block is locked to prevent editing.\n *\n * This selector only reasons about block lock, not associated features\n * like `blockEditingMode` that might prevent user modifications to a block.\n * Currently there's also no way to prevent editing via `templateLock`.\n *\n * This distinction is important as this selector specifically drives the block lock UI\n * that a user interacts with. `blockEditingModes` aren't included as a user can't change\n * them.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId ClientId of the block.\n *\n * @return {boolean} Whether the block is currently locked.\n */\nexport function isEditLockedBlock( state, clientId ) {\n\tconst attributes = getBlockAttributes( state, clientId );\n\treturn !! attributes?.lock?.edit;\n}\n\n/**\n * Returns whether a block is locked to prevent moving.\n *\n * This selector only reasons about templateLock and block lock, not associated features\n * like `blockEditingMode` that might prevent user modifications to a block.\n *\n * This distinction is important as this selector specifically drives the block lock UI\n * that a user interacts with. `blockEditingModes` are excluded as a user can't change\n * them.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId ClientId of the block.\n *\n * @return {boolean} Whether the block is currently locked.\n */\nexport function isMoveLockedBlock( state, clientId ) {\n\tconst attributes = getBlockAttributes( state, clientId );\n\t// If a block explicitly has `move` set to `false`, it turns off\n\t// any locking that might be inherited from a parent.\n\tif ( attributes?.lock?.move !== undefined ) {\n\t\treturn !! attributes?.lock?.move;\n\t}\n\n\tconst rootClientId = getBlockRootClientId( state, clientId );\n\tconst templateLock = getTemplateLock( state, rootClientId );\n\n\t// While `contentOnly` templateLock does sometimes prevent moving, a user can't modify\n\t// this, so don't include it in this function. See the `canMoveBlock` selector\n\t// as an alternative.\n\treturn templateLock === 'all';\n}\n\n/**\n * Returns whether a block is locked to prevent removal.\n *\n * This selector only reasons about templateLock and block lock, not associated features\n * like `blockEditingMode` that might prevent user modifications to a block.\n *\n * This distinction is important as this selector specifically drives the block lock UI\n * that a user interacts with. `blockEditingModes` are excluded as a user can't change\n * them.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId ClientId of the block.\n *\n * @return {boolean} Whether the block is currently locked.\n */\nexport function isRemoveLockedBlock( state, clientId ) {\n\tconst attributes = getBlockAttributes( state, clientId );\n\tif ( attributes?.lock?.remove !== undefined ) {\n\t\treturn !! attributes?.lock?.remove;\n\t}\n\n\tconst rootClientId = getBlockRootClientId( state, clientId );\n\tconst templateLock = getTemplateLock( state, rootClientId );\n\n\t// While `contentOnly` templateLock does sometimes prevent removal, a user can't modify\n\t// this, so don't include it in this function. See the `canRemoveBlock` selector\n\t// as an alternative.\n\treturn templateLock === 'all' || templateLock === 'insert';\n}\n\n/**\n * Returns whether a block is locked.\n *\n * This selector only reasons about templateLock and block lock, not associated features\n * like `blockEditingMode` that might prevent user modifications to a block.\n *\n * This distinction is important as this selector specifically drives the block lock UI\n * that a user interacts with. `blockEditingModes` are excluded as a user can't change\n * them.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId ClientId of the block.\n *\n * @return {boolean} Whether the block is currently locked.\n */\nexport function isLockedBlock( state, clientId ) {\n\treturn (\n\t\tisEditLockedBlock( state, clientId ) ||\n\t\tisMoveLockedBlock( state, clientId ) ||\n\t\tisRemoveLockedBlock( state, clientId )\n\t);\n}\n\n/**\n * Returns whether the list view content panel popover is open.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the popover is open.\n */\nexport function isListViewContentPanelOpen( state ) {\n\treturn state.listViewContentPanelOpen;\n}\n\n/**\n * Returns whether a List View panel is opened.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId Client ID of the block.\n *\n * @return {boolean} Whether the panel is opened.\n */\nexport function isListViewPanelOpened( state, clientId ) {\n\t// If allOpen flag is set, all panels are open\n\tif ( state.openedListViewPanels?.allOpen ) {\n\t\treturn true;\n\t}\n\treturn state.openedListViewPanels?.panels?.[ clientId ] === true;\n}\n\n/**\n * Returns the List View expand revision number.\n *\n * This counter is used in the ListView component's key prop to force remounting.\n *\n * @param {Object} state Global application state.\n *\n * @return {number} The expand revision number.\n */\nexport function getListViewExpandRevision( state ) {\n\treturn state.listViewExpandRevision || 0;\n}\n\n/**\n * Returns whether a block instance participates in List View-specific UI for\n * its inner blocks.\n *\n * Intentionally private: this is the derived participation logic (block type\n * `listView` support and the `core/navigation` special case) shared by the List\n * View consumers. A `listView`-supporting block drops out when it has no inner\n * blocks and its `allowedBlocks` (`[]` or `false`) permits no block: the nested\n * List View panel would render no rows and no appender, so it is hidden rather\n * than shown empty. This is a signal, not a guarantee — a child naming this\n * block as its `parent` stays insertable regardless (see `canInsertBlockType`);\n * that edge case is accepted to keep the check cheap. Keeping the read internal\n * lets this computation evolve without a back-compat commitment.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId Client ID of the block.\n *\n * @return {boolean} Whether the block participates in List View-specific UI.\n */\nexport function shouldRenderBlockListView( state, clientId ) {\n\tconst blockName = getBlockName( state, clientId );\n\n\t// The navigation block always participates; its List View is core to how it\n\t// is edited, regardless of how its menu is locked or populated.\n\tif ( blockName === 'core/navigation' ) {\n\t\treturn true;\n\t}\n\n\tif ( ! hasBlockSupport( blockName, 'listView' ) ) {\n\t\treturn false;\n\t}\n\n\t// `allowedBlocks` permits no block when it is `[]` or `false`; an unset value\n\t// is unrestricted and is intentionally not matched.\n\tconst allowedBlocks = getBlockListSettings(\n\t\tstate,\n\t\tclientId\n\t)?.allowedBlocks;\n\tconst isEmptyAndNoAllowedBlocks =\n\t\tgetBlockOrder( state, clientId ).length === 0 &&\n\t\t( allowedBlocks === false ||\n\t\t\t( Array.isArray( allowedBlocks ) && allowedBlocks.length === 0 ) );\n\n\treturn ! isEmptyAndNoAllowedBlocks;\n}\n\n/**\n * Returns the client IDs for the viewport modal, or null if\n * the modal is not open.\n *\n * @param {Object} state Global application state.\n *\n * @return {string[]|null} Client IDs for the visibility modal, or null.\n */\nexport function getViewportModalClientIds( state ) {\n\treturn state.viewportModalClientIds;\n}\n\n/**\n * Returns the requested inspector tab state, if any.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object|null} The requested tab state with tabName and options, or null if no request is pending.\n */\nexport function getRequestedInspectorTab( state ) {\n\treturn state.requestedInspectorTab;\n}\n\nconst DEFAULT_BLOCK_STYLE_STATE = {\n\tviewport: 'default',\n\tpseudo: 'default',\n};\n\n/**\n * Returns the globally selected viewport style state. When set to a value other\n * than 'default', block style edits in the inspector apply to that viewport.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} The selected viewport style state.\n */\nexport function getStyleStateViewport( state ) {\n\treturn state.styleStateViewport ?? DEFAULT_BLOCK_STYLE_STATE.viewport;\n}\n\n/**\n * Returns whether Responsive editing is enabled. When enabled, the device\n * preview also drives which viewport block style edits are applied to.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether Responsive editing is enabled.\n */\nexport function isResponsiveEditing( state ) {\n\treturn state.isResponsiveEditing;\n}\n\n/**\n * Returns the selected style state for a block's style controls.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId The block client ID.\n *\n * @return {Object} The selected block style state.\n */\nexport const getSelectedBlockStyleState = createSelector(\n\t( state, clientId ) => {\n\t\tconst perBlockState =\n\t\t\tstate.selectedBlockStyleState?.clientId === clientId\n\t\t\t\t? state.selectedBlockStyleState.value ??\n\t\t\t\t DEFAULT_BLOCK_STYLE_STATE\n\t\t\t\t: DEFAULT_BLOCK_STYLE_STATE;\n\n\t\treturn {\n\t\t\t...perBlockState,\n\t\t\t// The viewport is tracked globally, so inject it here. This way\n\t\t\t// consumers receive a single combined state object instead of\n\t\t\t// merging the global viewport themselves, and selectors derived\n\t\t\t// from this stay consistent.\n\t\t\tviewport: getStyleStateViewport( state ),\n\t\t};\n\t},\n\t( state ) => [ state.styleStateViewport, state.selectedBlockStyleState ]\n);\n\n/**\n * Returns whether a non-default style state is selected for a block.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId The block client ID.\n *\n * @return {boolean} Whether a non-default block style state is selected.\n */\nexport function hasSelectedStyleState( state, clientId ) {\n\tconst selectedState = getSelectedBlockStyleState( state, clientId );\n\n\treturn (\n\t\tselectedState.viewport !== DEFAULT_BLOCK_STYLE_STATE.viewport ||\n\t\tselectedState.pseudo !== DEFAULT_BLOCK_STYLE_STATE.pseudo\n\t);\n}\n\n/**\n * Returns whether the selected style state is shown on the canvas.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId The block client ID.\n *\n * @return {boolean} Whether the selected style state is shown on the canvas.\n */\nexport function isSelectedBlockStyleStateShownOnCanvas( state, clientId ) {\n\tif ( state.selectedBlockStyleState?.clientId !== clientId ) {\n\t\treturn true;\n\t}\n\n\treturn state.selectedBlockStyleState.showStateOnCanvas ?? true;\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAuD;AACvD,oBAGO;AAKP,uBAYO;AACP,mBAMO;AACP,uBAA2B;AAC3B,yBAAuB;AACvB,0BAMO;AACP,IAAAA,oBAA2C;AAI3C,gCAAiC;AAFjC,IAAM,EAAE,eAAe,QAAI,2BAAQ,cAAAC,WAAkB;AAW9C,SAAS,uBAAwB,OAAQ;AAC/C,SAAO,MAAM;AACd;AAQO,SAAS,+BAAgC,OAAQ;AACvD,SAAO,OAAO,mBAAmB;AAClC;AAEO,SAAS,0BAA2B,OAAO,UAAW;AAC5D,SAAO,MAAM,OAAO,WAAW,IAAK,QAAS;AAC9C;AAWO,IAAM,yBAAyB,CAAE,OAAO,aAAc;AAC5D,QAAM,yBAAyB,CAAE,kBAAmB;AACnD,eACC,sCAAqB,OAAO,aAAc,MAAM,kBAChD,gCAAe,OAAO,aAAc,EAAE;AAAA,MACrC;AAAA,IACD;AAAA,EAEF;AACA,aAAO,gCAAe,OAAO,QAAS,EAAE,MAAO,sBAAuB;AACvE;AAUO,SAAS,yCACf,OACA,WACA,cACC;AACD,QAAM,sBAAsB,eAAgB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AAW;AACzE,MAAK,MAAM,yBAAyB,aAAa,UAAW;AAC3D,WAAO;AAAA,EACR;AAEA,SAAO,MAAM,wBAAwB,qBAAqB;AAC3D;",
6
6
  "names": ["import_constants", "blocksPrivateApis", "getAllPatterns"]
7
7
  }
@@ -840,6 +840,9 @@ var canInsertBlockTypeUnmemoized = (state, blockName, rootClientId = null) => {
840
840
  if (rootTemplateLock && rootTemplateLock !== "contentOnly") {
841
841
  return false;
842
842
  }
843
+ if (isInnerContentRoot(state, rootClientId)) {
844
+ return false;
845
+ }
843
846
  const blockEditingMode = getBlockEditingMode(state, rootClientId ?? "");
844
847
  const isParentSectionBlock = !!(0, import_private_selectors.isSectionBlock)(state, rootClientId);
845
848
  const sectionClientId = isParentSectionBlock ? rootClientId : (0, import_private_selectors.getParentSectionBlock)(state, rootClientId);
@@ -944,10 +947,16 @@ function canInsertBlocks(state, clientIds, rootClientId = null) {
944
947
  (id) => canInsertBlockType(state, getBlockName(state, id), rootClientId)
945
948
  );
946
949
  }
950
+ function isInnerContentRoot(state, rootClientId) {
951
+ return !!rootClientId && getBlockName(state, rootClientId) === "core/html";
952
+ }
947
953
  function canRemoveBlock(state, clientId) {
948
954
  if (state.settings.isPreviewMode) {
949
955
  return false;
950
956
  }
957
+ if (isInnerContentRoot(state, getBlockRootClientId(state, clientId))) {
958
+ return false;
959
+ }
951
960
  const attributes = getBlockAttributes(state, clientId);
952
961
  if (attributes === null) {
953
962
  return true;
@@ -1001,6 +1010,9 @@ function canMoveBlock(state, clientId) {
1001
1010
  if (state.settings.isPreviewMode) {
1002
1011
  return false;
1003
1012
  }
1013
+ if (isInnerContentRoot(state, getBlockRootClientId(state, clientId))) {
1014
+ return false;
1015
+ }
1004
1016
  const attributes = getBlockAttributes(state, clientId);
1005
1017
  if (attributes === null) {
1006
1018
  return true;
@@ -1080,6 +1092,7 @@ var getItemFromVariation = (state, item) => (variation) => {
1080
1092
  ...variation.attributes
1081
1093
  },
1082
1094
  innerBlocks: variation.innerBlocks,
1095
+ innerContent: variation.innerContent,
1083
1096
  keywords: variation.keywords || item.keywords,
1084
1097
  frecency: calculateFrecency(time, count),
1085
1098
  // Pass through search-only flag for block-scope variations.