@wordpress/block-editor 15.19.1-next.v.202605131006.0 → 15.20.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 (352) hide show
  1. package/CHANGELOG.md +15 -1
  2. package/build/components/block-card/index.cjs +51 -41
  3. package/build/components/block-card/index.cjs.map +3 -3
  4. package/build/components/block-heading-level-dropdown/heading-level-icon.cjs.map +3 -3
  5. package/build/components/block-icon/index.cjs +7 -1
  6. package/build/components/block-icon/index.cjs.map +3 -3
  7. package/build/components/block-inspector/index.cjs +156 -11
  8. package/build/components/block-inspector/index.cjs.map +3 -3
  9. package/build/components/block-inspector/inspector-pre-tabs-slot-fill.cjs +38 -0
  10. package/build/components/block-inspector/inspector-pre-tabs-slot-fill.cjs.map +7 -0
  11. package/build/components/block-list/use-block-props/index.cjs +1 -1
  12. package/build/components/block-list/use-block-props/index.cjs.map +2 -2
  13. package/build/components/block-list/use-block-props/use-focus-handler.cjs +3 -4
  14. package/build/components/block-list/use-block-props/use-focus-handler.cjs.map +3 -3
  15. package/build/components/block-list/use-block-props/use-is-hovered.cjs +24 -14
  16. package/build/components/block-list/use-block-props/use-is-hovered.cjs.map +3 -3
  17. package/build/components/block-lock/modal.cjs.map +3 -3
  18. package/build/components/block-patterns-list/index.cjs +13 -2
  19. package/build/components/block-patterns-list/index.cjs.map +2 -2
  20. package/build/components/block-popover/index.cjs +13 -3
  21. package/build/components/block-popover/index.cjs.map +2 -2
  22. package/build/components/block-toolbar/switch-section-style.cjs.map +3 -3
  23. package/build/components/block-visibility/modal.cjs.map +3 -3
  24. package/build/components/block-visibility/viewport-visibility-info.cjs.map +3 -3
  25. package/build/components/colors-gradients/control.cjs +7 -4
  26. package/build/components/colors-gradients/control.cjs.map +2 -2
  27. package/build/components/global-styles/advanced-panel.cjs +24 -22
  28. package/build/components/global-styles/advanced-panel.cjs.map +3 -3
  29. package/build/components/global-styles/color-panel.cjs +95 -58
  30. package/build/components/global-styles/color-panel.cjs.map +2 -2
  31. package/build/components/global-styles/dimensions-panel.cjs +11 -5
  32. package/build/components/global-styles/dimensions-panel.cjs.map +2 -2
  33. package/build/components/global-styles/index.cjs +3 -0
  34. package/build/components/global-styles/index.cjs.map +2 -2
  35. package/build/components/global-styles/shadow-panel-components.cjs +38 -26
  36. package/build/components/global-styles/shadow-panel-components.cjs.map +2 -2
  37. package/build/components/global-styles/state-control-badges.cjs +69 -0
  38. package/build/components/global-styles/state-control-badges.cjs.map +7 -0
  39. package/build/components/global-styles/state-control.cjs +54 -63
  40. package/build/components/global-styles/state-control.cjs.map +3 -3
  41. package/build/components/iframe/index.cjs +0 -3
  42. package/build/components/iframe/index.cjs.map +2 -2
  43. package/build/components/iframe/use-scale-canvas.cjs +4 -1
  44. package/build/components/iframe/use-scale-canvas.cjs.map +2 -2
  45. package/build/components/inserter/hooks/use-patterns-state.cjs +4 -6
  46. package/build/components/inserter/hooks/use-patterns-state.cjs.map +2 -2
  47. package/build/components/inserter/index.cjs +1 -0
  48. package/build/components/inserter/index.cjs.map +2 -2
  49. package/build/components/inserter/media-tab/media-preview.cjs +27 -18
  50. package/build/components/inserter/media-tab/media-preview.cjs.map +2 -2
  51. package/build/components/inserter/media-tab/utils.cjs +1 -1
  52. package/build/components/inserter/media-tab/utils.cjs.map +2 -2
  53. package/build/components/inserter/panel.cjs.map +3 -3
  54. package/build/components/inspector-controls/block-support-tools-panel.cjs +10 -2
  55. package/build/components/inspector-controls/block-support-tools-panel.cjs.map +2 -2
  56. package/build/components/inspector-controls/fill.cjs +14 -4
  57. package/build/components/inspector-controls/fill.cjs.map +2 -2
  58. package/build/components/inspector-controls/groups.cjs +2 -0
  59. package/build/components/inspector-controls/groups.cjs.map +2 -2
  60. package/build/components/inspector-controls-tabs/index.cjs +13 -8
  61. package/build/components/inspector-controls-tabs/index.cjs.map +3 -3
  62. package/build/components/inspector-controls-tabs/settings-tab.cjs +1 -4
  63. package/build/components/inspector-controls-tabs/settings-tab.cjs.map +3 -3
  64. package/build/components/inspector-controls-tabs/styles-tab.cjs +9 -0
  65. package/build/components/inspector-controls-tabs/styles-tab.cjs.map +3 -3
  66. package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.cjs +11 -5
  67. package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.cjs.map +2 -2
  68. package/build/components/list-view/block-select-button.cjs +20 -8
  69. package/build/components/list-view/block-select-button.cjs.map +2 -2
  70. package/build/components/list-view/block.cjs +2 -1
  71. package/build/components/list-view/block.cjs.map +2 -2
  72. package/build/components/preset-input-control/custom-value-controls.cjs +10 -1
  73. package/build/components/preset-input-control/custom-value-controls.cjs.map +2 -2
  74. package/build/components/preset-input-control/index.cjs.map +3 -3
  75. package/build/components/provider/use-media-upload-settings.cjs +1 -0
  76. package/build/components/provider/use-media-upload-settings.cjs.map +2 -2
  77. package/build/components/rich-text/event-listeners/enter.cjs +9 -2
  78. package/build/components/rich-text/event-listeners/enter.cjs.map +3 -3
  79. package/build/components/rich-text/event-listeners/paste-handler.cjs +4 -4
  80. package/build/components/rich-text/event-listeners/paste-handler.cjs.map +3 -3
  81. package/build/hooks/background.cjs +13 -3
  82. package/build/hooks/background.cjs.map +2 -2
  83. package/build/hooks/block-fields/link/index.cjs.map +3 -3
  84. package/build/hooks/block-fields/media/index.cjs.map +3 -3
  85. package/build/hooks/block-style-state.cjs +112 -0
  86. package/build/hooks/block-style-state.cjs.map +7 -0
  87. package/build/hooks/border.cjs +13 -3
  88. package/build/hooks/border.cjs.map +2 -2
  89. package/build/hooks/color.cjs +28 -9
  90. package/build/hooks/color.cjs.map +2 -2
  91. package/build/hooks/dimensions.cjs +15 -6
  92. package/build/hooks/dimensions.cjs.map +2 -2
  93. package/build/hooks/layout-child.cjs +147 -61
  94. package/build/hooks/layout-child.cjs.map +2 -2
  95. package/build/hooks/layout.cjs +263 -56
  96. package/build/hooks/layout.cjs.map +3 -3
  97. package/build/hooks/state-utils.cjs +94 -0
  98. package/build/hooks/state-utils.cjs.map +7 -0
  99. package/build/hooks/states.cjs +124 -0
  100. package/build/hooks/states.cjs.map +7 -0
  101. package/build/hooks/style.cjs +304 -17
  102. package/build/hooks/style.cjs.map +3 -3
  103. package/build/hooks/typography.cjs +14 -5
  104. package/build/hooks/typography.cjs.map +2 -2
  105. package/build/layouts/constrained.cjs +128 -55
  106. package/build/layouts/constrained.cjs.map +3 -3
  107. package/build/layouts/flex.cjs +119 -31
  108. package/build/layouts/flex.cjs.map +3 -3
  109. package/build/layouts/grid.cjs +103 -40
  110. package/build/layouts/grid.cjs.map +3 -3
  111. package/build/private-apis.cjs +2 -0
  112. package/build/private-apis.cjs.map +2 -2
  113. package/build/store/private-actions.cjs +18 -0
  114. package/build/store/private-actions.cjs.map +2 -2
  115. package/build/store/private-keys.cjs +10 -2
  116. package/build/store/private-keys.cjs.map +2 -2
  117. package/build/store/private-selectors.cjs +26 -2
  118. package/build/store/private-selectors.cjs.map +2 -2
  119. package/build/store/reducer.cjs +70 -1
  120. package/build/store/reducer.cjs.map +2 -2
  121. package/build/store/utils.cjs +1 -1
  122. package/build/store/utils.cjs.map +2 -2
  123. package/build/utils/color-values.cjs +44 -0
  124. package/build/utils/color-values.cjs.map +7 -0
  125. package/build-module/components/block-card/index.mjs +52 -45
  126. package/build-module/components/block-card/index.mjs.map +2 -2
  127. package/build-module/components/block-heading-level-dropdown/heading-level-icon.mjs +2 -2
  128. package/build-module/components/block-heading-level-dropdown/heading-level-icon.mjs.map +2 -2
  129. package/build-module/components/block-icon/index.mjs +8 -2
  130. package/build-module/components/block-icon/index.mjs.map +2 -2
  131. package/build-module/components/block-inspector/index.mjs +166 -13
  132. package/build-module/components/block-inspector/index.mjs.map +2 -2
  133. package/build-module/components/block-inspector/inspector-pre-tabs-slot-fill.mjs +12 -0
  134. package/build-module/components/block-inspector/inspector-pre-tabs-slot-fill.mjs.map +7 -0
  135. package/build-module/components/block-list/use-block-props/index.mjs +1 -1
  136. package/build-module/components/block-list/use-block-props/index.mjs.map +2 -2
  137. package/build-module/components/block-list/use-block-props/use-focus-handler.mjs +7 -5
  138. package/build-module/components/block-list/use-block-props/use-focus-handler.mjs.map +2 -2
  139. package/build-module/components/block-list/use-block-props/use-is-hovered.mjs +28 -15
  140. package/build-module/components/block-list/use-block-props/use-is-hovered.mjs.map +2 -2
  141. package/build-module/components/block-lock/modal.mjs +4 -4
  142. package/build-module/components/block-lock/modal.mjs.map +2 -2
  143. package/build-module/components/block-patterns-list/index.mjs +14 -4
  144. package/build-module/components/block-patterns-list/index.mjs.map +2 -2
  145. package/build-module/components/block-popover/index.mjs +13 -3
  146. package/build-module/components/block-popover/index.mjs.map +2 -2
  147. package/build-module/components/block-toolbar/switch-section-style.mjs +2 -2
  148. package/build-module/components/block-toolbar/switch-section-style.mjs.map +2 -2
  149. package/build-module/components/block-visibility/modal.mjs +2 -2
  150. package/build-module/components/block-visibility/modal.mjs.map +2 -2
  151. package/build-module/components/block-visibility/viewport-visibility-info.mjs +2 -2
  152. package/build-module/components/block-visibility/viewport-visibility-info.mjs.map +2 -2
  153. package/build-module/components/colors-gradients/control.mjs +7 -4
  154. package/build-module/components/colors-gradients/control.mjs.map +2 -2
  155. package/build-module/components/global-styles/advanced-panel.mjs +25 -27
  156. package/build-module/components/global-styles/advanced-panel.mjs.map +2 -2
  157. package/build-module/components/global-styles/color-panel.mjs +96 -59
  158. package/build-module/components/global-styles/color-panel.mjs.map +2 -2
  159. package/build-module/components/global-styles/dimensions-panel.mjs +14 -5
  160. package/build-module/components/global-styles/dimensions-panel.mjs.map +2 -2
  161. package/build-module/components/global-styles/index.mjs +2 -0
  162. package/build-module/components/global-styles/index.mjs.map +2 -2
  163. package/build-module/components/global-styles/shadow-panel-components.mjs +39 -28
  164. package/build-module/components/global-styles/shadow-panel-components.mjs.map +2 -2
  165. package/build-module/components/global-styles/state-control-badges.mjs +48 -0
  166. package/build-module/components/global-styles/state-control-badges.mjs.map +7 -0
  167. package/build-module/components/global-styles/state-control.mjs +57 -71
  168. package/build-module/components/global-styles/state-control.mjs.map +2 -2
  169. package/build-module/components/iframe/index.mjs +0 -3
  170. package/build-module/components/iframe/index.mjs.map +2 -2
  171. package/build-module/components/iframe/use-scale-canvas.mjs +4 -1
  172. package/build-module/components/iframe/use-scale-canvas.mjs.map +2 -2
  173. package/build-module/components/inserter/hooks/use-patterns-state.mjs +8 -7
  174. package/build-module/components/inserter/hooks/use-patterns-state.mjs.map +2 -2
  175. package/build-module/components/inserter/index.mjs +1 -0
  176. package/build-module/components/inserter/index.mjs.map +2 -2
  177. package/build-module/components/inserter/media-tab/media-preview.mjs +27 -19
  178. package/build-module/components/inserter/media-tab/media-preview.mjs.map +2 -2
  179. package/build-module/components/inserter/media-tab/utils.mjs +1 -1
  180. package/build-module/components/inserter/media-tab/utils.mjs.map +2 -2
  181. package/build-module/components/inserter/panel.mjs +2 -2
  182. package/build-module/components/inserter/panel.mjs.map +2 -2
  183. package/build-module/components/inspector-controls/block-support-tools-panel.mjs +10 -2
  184. package/build-module/components/inspector-controls/block-support-tools-panel.mjs.map +2 -2
  185. package/build-module/components/inspector-controls/fill.mjs +18 -5
  186. package/build-module/components/inspector-controls/fill.mjs.map +2 -2
  187. package/build-module/components/inspector-controls/groups.mjs +2 -0
  188. package/build-module/components/inspector-controls/groups.mjs.map +2 -2
  189. package/build-module/components/inspector-controls-tabs/index.mjs +14 -10
  190. package/build-module/components/inspector-controls-tabs/index.mjs.map +2 -2
  191. package/build-module/components/inspector-controls-tabs/settings-tab.mjs +1 -4
  192. package/build-module/components/inspector-controls-tabs/settings-tab.mjs.map +2 -2
  193. package/build-module/components/inspector-controls-tabs/styles-tab.mjs +9 -0
  194. package/build-module/components/inspector-controls-tabs/styles-tab.mjs.map +2 -2
  195. package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.mjs +11 -5
  196. package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.mjs.map +2 -2
  197. package/build-module/components/list-view/block-select-button.mjs +20 -9
  198. package/build-module/components/list-view/block-select-button.mjs.map +2 -2
  199. package/build-module/components/list-view/block.mjs +2 -1
  200. package/build-module/components/list-view/block.mjs.map +2 -2
  201. package/build-module/components/preset-input-control/custom-value-controls.mjs +10 -2
  202. package/build-module/components/preset-input-control/custom-value-controls.mjs.map +2 -2
  203. package/build-module/components/preset-input-control/index.mjs +2 -2
  204. package/build-module/components/preset-input-control/index.mjs.map +2 -2
  205. package/build-module/components/provider/use-media-upload-settings.mjs +1 -0
  206. package/build-module/components/provider/use-media-upload-settings.mjs.map +2 -2
  207. package/build-module/components/rich-text/event-listeners/enter.mjs +9 -2
  208. package/build-module/components/rich-text/event-listeners/enter.mjs.map +2 -2
  209. package/build-module/components/rich-text/event-listeners/paste-handler.mjs +4 -4
  210. package/build-module/components/rich-text/event-listeners/paste-handler.mjs.map +2 -2
  211. package/build-module/hooks/background.mjs +18 -3
  212. package/build-module/hooks/background.mjs.map +2 -2
  213. package/build-module/hooks/block-fields/link/index.mjs +3 -3
  214. package/build-module/hooks/block-fields/link/index.mjs.map +2 -2
  215. package/build-module/hooks/block-fields/media/index.mjs +3 -3
  216. package/build-module/hooks/block-fields/media/index.mjs.map +2 -2
  217. package/build-module/hooks/block-style-state.mjs +79 -0
  218. package/build-module/hooks/block-style-state.mjs.map +7 -0
  219. package/build-module/hooks/border.mjs +18 -3
  220. package/build-module/hooks/border.mjs.map +2 -2
  221. package/build-module/hooks/color.mjs +33 -9
  222. package/build-module/hooks/color.mjs.map +2 -2
  223. package/build-module/hooks/dimensions.mjs +20 -6
  224. package/build-module/hooks/dimensions.mjs.map +2 -2
  225. package/build-module/hooks/layout-child.mjs +141 -61
  226. package/build-module/hooks/layout-child.mjs.map +2 -2
  227. package/build-module/hooks/layout.mjs +270 -58
  228. package/build-module/hooks/layout.mjs.map +2 -2
  229. package/build-module/hooks/state-utils.mjs +64 -0
  230. package/build-module/hooks/state-utils.mjs.map +7 -0
  231. package/build-module/hooks/states.mjs +85 -0
  232. package/build-module/hooks/states.mjs.map +7 -0
  233. package/build-module/hooks/style.mjs +309 -18
  234. package/build-module/hooks/style.mjs.map +2 -2
  235. package/build-module/hooks/typography.mjs +19 -5
  236. package/build-module/hooks/typography.mjs.map +2 -2
  237. package/build-module/layouts/constrained.mjs +130 -57
  238. package/build-module/layouts/constrained.mjs.map +2 -2
  239. package/build-module/layouts/flex.mjs +123 -35
  240. package/build-module/layouts/flex.mjs.map +2 -2
  241. package/build-module/layouts/grid.mjs +105 -42
  242. package/build-module/layouts/grid.mjs.map +2 -2
  243. package/build-module/private-apis.mjs +4 -0
  244. package/build-module/private-apis.mjs.map +2 -2
  245. package/build-module/store/private-actions.mjs +16 -0
  246. package/build-module/store/private-actions.mjs.map +2 -2
  247. package/build-module/store/private-keys.mjs +7 -1
  248. package/build-module/store/private-keys.mjs.map +2 -2
  249. package/build-module/store/private-selectors.mjs +25 -2
  250. package/build-module/store/private-selectors.mjs.map +2 -2
  251. package/build-module/store/reducer.mjs +69 -1
  252. package/build-module/store/reducer.mjs.map +2 -2
  253. package/build-module/store/utils.mjs +5 -2
  254. package/build-module/store/utils.mjs.map +2 -2
  255. package/build-module/utils/color-values.mjs +19 -0
  256. package/build-module/utils/color-values.mjs.map +7 -0
  257. package/build-style/content-rtl.css +18 -3
  258. package/build-style/content.css +18 -3
  259. package/build-style/style-rtl.css +14 -17
  260. package/build-style/style.css +14 -17
  261. package/package.json +41 -41
  262. package/src/components/audio-player/index.native.js +7 -3
  263. package/src/components/block-card/index.js +67 -60
  264. package/src/components/block-heading-level-dropdown/heading-level-icon.js +2 -2
  265. package/src/components/block-icon/index.js +5 -2
  266. package/src/components/block-icon/index.native.js +2 -2
  267. package/src/components/block-inspector/index.js +153 -7
  268. package/src/components/block-inspector/inspector-pre-tabs-slot-fill.js +11 -0
  269. package/src/components/block-list/block-selection-button.native.js +3 -3
  270. package/src/components/block-list/content.scss +0 -6
  271. package/src/components/block-list/use-block-props/index.js +1 -1
  272. package/src/components/block-list/use-block-props/use-focus-handler.js +8 -6
  273. package/src/components/block-list/use-block-props/use-is-hovered.js +32 -15
  274. package/src/components/block-lock/modal.js +4 -4
  275. package/src/components/block-patterns-list/index.js +14 -5
  276. package/src/components/block-patterns-list/stories/index.story.jsx +2 -0
  277. package/src/components/block-patterns-list/style.scss +0 -1
  278. package/src/components/block-popover/index.js +20 -10
  279. package/src/components/block-toolbar/switch-section-style.js +2 -2
  280. package/src/components/block-visibility/modal.js +2 -2
  281. package/src/components/block-visibility/viewport-visibility-info.js +2 -2
  282. package/src/components/colors/test/with-colors.js +1 -1
  283. package/src/components/colors-gradients/control.js +10 -8
  284. package/src/components/colors-gradients/test/control.js +98 -1
  285. package/src/components/global-styles/advanced-panel.js +44 -39
  286. package/src/components/global-styles/color-panel.js +133 -60
  287. package/src/components/global-styles/dimensions-panel.js +17 -4
  288. package/src/components/global-styles/index.js +1 -0
  289. package/src/components/global-styles/shadow-panel-components.js +29 -19
  290. package/src/components/global-styles/state-control-badges.js +58 -0
  291. package/src/components/global-styles/state-control.js +28 -36
  292. package/src/components/global-styles/test/color-panel.js +135 -0
  293. package/src/components/iframe/index.js +0 -3
  294. package/src/components/iframe/use-scale-canvas.js +8 -2
  295. package/src/components/inserter/hooks/use-patterns-state.js +12 -7
  296. package/src/components/inserter/index.js +1 -0
  297. package/src/components/inserter/media-tab/media-preview.js +29 -20
  298. package/src/components/inserter/media-tab/utils.js +1 -1
  299. package/src/components/inserter/panel.js +2 -2
  300. package/src/components/inserter/style.scss +1 -0
  301. package/src/components/inserter-button/index.native.js +5 -2
  302. package/src/components/inspector-controls/block-support-tools-panel.js +10 -2
  303. package/src/components/inspector-controls/fill.js +18 -5
  304. package/src/components/inspector-controls/groups.js +2 -0
  305. package/src/components/inspector-controls-tabs/index.js +9 -5
  306. package/src/components/inspector-controls-tabs/settings-tab.js +1 -7
  307. package/src/components/inspector-controls-tabs/styles-tab.js +6 -0
  308. package/src/components/inspector-controls-tabs/use-inspector-controls-tabs.js +13 -7
  309. package/src/components/list-view/block-select-button.js +19 -9
  310. package/src/components/list-view/block.js +6 -1
  311. package/src/components/media-replace-flow/style.scss +0 -18
  312. package/src/components/preset-input-control/custom-value-controls.js +13 -6
  313. package/src/components/preset-input-control/index.js +2 -2
  314. package/src/components/provider/use-media-upload-settings.js +1 -0
  315. package/src/components/rich-text/event-listeners/enter.js +14 -2
  316. package/src/components/rich-text/event-listeners/paste-handler.js +5 -4
  317. package/src/components/unsupported-block-details/index.native.js +6 -2
  318. package/src/components/video-player/index.native.js +2 -2
  319. package/src/components/warning/index.native.js +2 -2
  320. package/src/hooks/background.js +59 -37
  321. package/src/hooks/block-fields/link/index.js +3 -3
  322. package/src/hooks/block-fields/media/index.js +3 -3
  323. package/src/hooks/block-style-state.js +127 -0
  324. package/src/hooks/border.js +25 -6
  325. package/src/hooks/color.js +40 -18
  326. package/src/hooks/dimensions.js +32 -11
  327. package/src/hooks/layout-child.js +179 -62
  328. package/src/hooks/layout.js +349 -75
  329. package/src/hooks/layout.scss +6 -0
  330. package/src/hooks/state-utils.js +158 -0
  331. package/src/hooks/states.js +109 -0
  332. package/src/hooks/style.js +456 -19
  333. package/src/hooks/test/block-style-state.js +270 -0
  334. package/src/hooks/test/layout.js +185 -0
  335. package/src/hooks/test/state-utils.js +193 -0
  336. package/src/hooks/test/style.js +301 -1
  337. package/src/hooks/typography.js +33 -14
  338. package/src/layouts/constrained.js +182 -95
  339. package/src/layouts/flex.js +141 -36
  340. package/src/layouts/grid.js +122 -32
  341. package/src/layouts/test/flex.js +57 -20
  342. package/src/private-apis.js +4 -0
  343. package/src/store/private-actions.js +32 -0
  344. package/src/store/private-keys.js +4 -0
  345. package/src/store/private-selectors.js +44 -2
  346. package/src/store/reducer.js +105 -1
  347. package/src/store/test/private-actions.js +26 -0
  348. package/src/store/test/private-selectors.js +90 -0
  349. package/src/store/test/reducer.js +363 -0
  350. package/src/store/utils.js +6 -2
  351. package/src/utils/color-values.js +28 -0
  352. package/src/utils/test/color-values.js +78 -0
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/store/private-actions.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { Platform } from '@wordpress/element';\nimport deprecated from '@wordpress/deprecated';\nimport { speak } from '@wordpress/a11y';\nimport { __ } from '@wordpress/i18n';\n\nconst castArray = ( maybeArray ) =>\n\tArray.isArray( maybeArray ) ? maybeArray : [ maybeArray ];\n\n/**\n * A list of private/experimental block editor settings that\n * should not become a part of the WordPress public API.\n * BlockEditorProvider will remove these settings from the\n * settings object it receives.\n *\n * @see https://github.com/WordPress/gutenberg/pull/46131\n */\nconst privateSettings = [\n\t'inserterMediaCategories',\n\t'blockInspectorAnimation',\n\t'mediaSideload',\n];\n\n/**\n * Action that updates the block editor settings and\n * conditionally preserves the experimental ones.\n *\n * @param {Object} settings Updated settings\n * @param {Object} options Options object.\n * @param {boolean} options.stripExperimentalSettings Whether to strip experimental settings.\n * @param {boolean} options.reset Whether to reset the settings.\n * @return {Object} Action object\n */\nexport function __experimentalUpdateSettings(\n\tsettings,\n\t{ stripExperimentalSettings = false, reset = false } = {}\n) {\n\tlet incomingSettings = settings;\n\n\tif ( Object.hasOwn( incomingSettings, '__unstableIsPreviewMode' ) ) {\n\t\tdeprecated(\n\t\t\t\"__unstableIsPreviewMode argument in wp.data.dispatch('core/block-editor').updateSettings\",\n\t\t\t{\n\t\t\t\tsince: '6.8',\n\t\t\t\talternative: 'isPreviewMode',\n\t\t\t}\n\t\t);\n\n\t\tincomingSettings = { ...incomingSettings };\n\t\tincomingSettings.isPreviewMode =\n\t\t\tincomingSettings.__unstableIsPreviewMode;\n\t\tdelete incomingSettings.__unstableIsPreviewMode;\n\t}\n\n\tlet cleanSettings = incomingSettings;\n\n\t// There are no plugins in the mobile apps, so there is no\n\t// need to strip the experimental settings:\n\tif ( stripExperimentalSettings && Platform.OS === 'web' ) {\n\t\tcleanSettings = {};\n\t\tfor ( const key in incomingSettings ) {\n\t\t\tif ( ! privateSettings.includes( key ) ) {\n\t\t\t\tcleanSettings[ key ] = incomingSettings[ key ];\n\t\t\t}\n\t\t}\n\t}\n\treturn {\n\t\ttype: 'UPDATE_SETTINGS',\n\t\tsettings: cleanSettings,\n\t\treset,\n\t};\n}\n\n/**\n * Hides the block interface (eg. toolbar, outline, etc.)\n *\n * @return {Object} Action object.\n */\nexport function hideBlockInterface() {\n\treturn {\n\t\ttype: 'HIDE_BLOCK_INTERFACE',\n\t};\n}\n\n/**\n * Shows the block interface (eg. toolbar, outline, etc.)\n *\n * @return {Object} Action object.\n */\nexport function showBlockInterface() {\n\treturn {\n\t\ttype: 'SHOW_BLOCK_INTERFACE',\n\t};\n}\n\n/**\n * Yields action objects used in signalling that the blocks corresponding to\n * the set of specified client IDs are to be removed.\n *\n * Compared to `removeBlocks`, this private interface exposes an additional\n * parameter; see `forceRemove`.\n *\n * @param {string|string[]} clientIds Client IDs of blocks to remove.\n * @param {boolean} selectPrevious True if the previous block\n * or the immediate parent\n * (if no previous block exists)\n * should be selected\n * when a block is removed.\n * @param {boolean} forceRemove Whether to force the operation,\n * bypassing any checks for certain\n * block types.\n */\nexport const privateRemoveBlocks =\n\t( clientIds, selectPrevious = true, forceRemove = false ) =>\n\t( { select, dispatch, registry } ) => {\n\t\tif ( ! clientIds || ! clientIds.length ) {\n\t\t\treturn;\n\t\t}\n\n\t\tclientIds = castArray( clientIds );\n\t\tconst canRemoveBlocks = select.canRemoveBlocks( clientIds );\n\n\t\tif ( ! canRemoveBlocks ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// In certain editing contexts, we'd like to prevent accidental removal\n\t\t// of important blocks. For example, in the site editor, the Query Loop\n\t\t// block is deemed important. In such cases, we'll ask the user for\n\t\t// confirmation that they intended to remove such block(s). However,\n\t\t// the editor instance is responsible for presenting those confirmation\n\t\t// prompts to the user. Any instance opting into removal prompts must\n\t\t// register using `setBlockRemovalRules()`.\n\t\t//\n\t\t// @see https://github.com/WordPress/gutenberg/pull/51145\n\t\tconst rules = ! forceRemove && select.getBlockRemovalRules();\n\n\t\tif ( rules ) {\n\t\t\tfunction flattenBlocks( blocks ) {\n\t\t\t\tconst result = [];\n\t\t\t\tconst stack = [ ...blocks ];\n\t\t\t\twhile ( stack.length ) {\n\t\t\t\t\tconst { innerBlocks, ...block } = stack.shift();\n\t\t\t\t\tstack.push( ...innerBlocks );\n\t\t\t\t\tresult.push( block );\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tconst blockList = clientIds.map( select.getBlock );\n\t\t\tconst flattenedBlocks = flattenBlocks( blockList );\n\n\t\t\t// Find the first message and use it.\n\t\t\tlet message;\n\t\t\tfor ( const rule of rules ) {\n\t\t\t\tmessage = rule.callback( flattenedBlocks );\n\t\t\t\tif ( message ) {\n\t\t\t\t\tdispatch(\n\t\t\t\t\t\tdisplayBlockRemovalPrompt(\n\t\t\t\t\t\t\tclientIds,\n\t\t\t\t\t\t\tselectPrevious,\n\t\t\t\t\t\t\tmessage\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( selectPrevious ) {\n\t\t\tdispatch.selectPreviousBlock( clientIds[ 0 ], selectPrevious );\n\t\t}\n\n\t\t// We're batching these two actions because an extra `undo/redo` step can\n\t\t// be created, based on whether we insert a default block or not.\n\t\tregistry.batch( () => {\n\t\t\tdispatch( { type: 'REMOVE_BLOCKS', clientIds } );\n\t\t\t// To avoid a focus loss when removing the last block, assure there is\n\t\t\t// always a default block if the last of the blocks have been removed.\n\t\t\tdispatch( ensureDefaultBlock() );\n\t\t} );\n\t};\n\n/**\n * Action which will insert a default block insert action if there\n * are no other blocks at the root of the editor. This action should be used\n * in actions which may result in no blocks remaining in the editor (removal,\n * replacement, etc).\n */\nexport const ensureDefaultBlock =\n\t() =>\n\t( { select, dispatch } ) => {\n\t\t// To avoid a focus loss when removing the last block, assure there is\n\t\t// always a default block if the last of the blocks have been removed.\n\t\tconst count = select.getBlockCount();\n\t\tif ( count > 0 ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If there's an custom appender, don't insert default block.\n\t\t// We have to remember to manually move the focus elsewhere to\n\t\t// prevent it from being lost though.\n\t\tconst { __unstableHasCustomAppender } = select.getSettings();\n\t\tif ( __unstableHasCustomAppender ) {\n\t\t\treturn;\n\t\t}\n\n\t\tdispatch.insertDefaultBlock();\n\t};\n\n/**\n * Returns an action object used in signalling that a block removal prompt must\n * be displayed.\n *\n * Contrast with `setBlockRemovalRules`.\n *\n * @param {string|string[]} clientIds Client IDs of blocks to remove.\n * @param {boolean} selectPrevious True if the previous block or the\n * immediate parent (if no previous\n * block exists) should be selected\n * when a block is removed.\n * @param {string} message Message to display in the prompt.\n *\n * @return {Object} Action object.\n */\nfunction displayBlockRemovalPrompt( clientIds, selectPrevious, message ) {\n\treturn {\n\t\ttype: 'DISPLAY_BLOCK_REMOVAL_PROMPT',\n\t\tclientIds,\n\t\tselectPrevious,\n\t\tmessage,\n\t};\n}\n\n/**\n * Returns an action object used in signalling that a block removal prompt must\n * be cleared, either be cause the user has confirmed or canceled the request\n * for removal.\n *\n * @return {Object} Action object.\n */\nexport function clearBlockRemovalPrompt() {\n\treturn {\n\t\ttype: 'CLEAR_BLOCK_REMOVAL_PROMPT',\n\t};\n}\n\n/**\n * Returns an action object used to set up any rules that a block editor may\n * provide in order to prevent a user from accidentally removing certain\n * blocks. These rules are then used to display a confirmation prompt to the\n * user. For instance, in the Site Editor, the Query Loop block is important\n * enough to warrant such confirmation.\n *\n * IMPORTANT: Registering rules implicitly signals to the `privateRemoveBlocks`\n * action that the editor will be responsible for displaying block removal\n * prompts and confirming deletions. This action is meant to be used by\n * component `BlockRemovalWarningModal` only.\n *\n * The data is a record whose keys are block types (e.g. 'core/query') and\n * whose values are the explanation to be shown to users (e.g. 'Query Loop\n * displays a list of posts or pages.').\n *\n * Contrast with `displayBlockRemovalPrompt`.\n *\n * @param {Record<string,string>|false} rules Block removal rules.\n * @return {Object} Action object.\n */\nexport function setBlockRemovalRules( rules = false ) {\n\treturn {\n\t\ttype: 'SET_BLOCK_REMOVAL_RULES',\n\t\trules,\n\t};\n}\n\nexport function setStyleOverride( id, style ) {\n\treturn {\n\t\ttype: 'SET_STYLE_OVERRIDE',\n\t\tid,\n\t\tstyle,\n\t};\n}\n\nexport function deleteStyleOverride( id ) {\n\treturn {\n\t\ttype: 'DELETE_STYLE_OVERRIDE',\n\t\tid,\n\t};\n}\n\n/**\n * Action that sets the element that had focus when focus leaves the editor canvas.\n *\n * @param {Object} lastFocus The last focused element.\n *\n *\n * @return {Object} Action object.\n */\nexport function setLastFocus( lastFocus = null ) {\n\treturn {\n\t\ttype: 'LAST_FOCUS',\n\t\tlastFocus,\n\t};\n}\n\n/**\n * Returns an action object used in signalling that the user has begun to drag.\n *\n * @return {Object} Action object.\n */\nexport function startDragging() {\n\treturn {\n\t\ttype: 'START_DRAGGING',\n\t};\n}\n\n/**\n * Returns an action object used in signalling that the user has stopped dragging.\n *\n * @return {Object} Action object.\n */\nexport function stopDragging() {\n\treturn {\n\t\ttype: 'STOP_DRAGGING',\n\t};\n}\n\n/**\n * @param {string|null} clientId The block's clientId, or `null` to clear.\n *\n * @return {Object} Action object.\n */\nexport function expandBlock( clientId ) {\n\treturn {\n\t\ttype: 'SET_BLOCK_EXPANDED_IN_LIST_VIEW',\n\t\tclientId,\n\t};\n}\n\n/**\n * @param {Object} value\n * @param {string} value.rootClientId The root client ID to insert at.\n * @param {number} value.index The index to insert at.\n *\n * @return {Object} Action object.\n */\nexport function setInsertionPoint( value ) {\n\treturn {\n\t\ttype: 'SET_INSERTION_POINT',\n\t\tvalue,\n\t};\n}\n\n/**\n * Mark a contentOnly section as being edited.\n *\n * @param {string} clientId The client id of the block.\n */\nexport function editContentOnlySection( clientId ) {\n\treturn {\n\t\ttype: 'EDIT_CONTENT_ONLY_SECTION',\n\t\tclientId,\n\t};\n}\n\n/**\n * Action that stops editing a contentOnly section.\n */\nexport function stopEditingContentOnlySection() {\n\treturn {\n\t\ttype: 'EDIT_CONTENT_ONLY_SECTION',\n\t};\n}\n\n/**\n * Sets the zoom level.\n *\n * @param {number} zoom the new zoom level\n * @return {Object} Action object.\n */\nexport const setZoomLevel =\n\t( zoom = 100 ) =>\n\t( { select, dispatch } ) => {\n\t\t// When switching to zoom-out mode, we need to select the parent section\n\t\tif ( zoom !== 100 ) {\n\t\t\tconst firstSelectedClientId = select.getBlockSelectionStart();\n\t\t\tconst sectionRootClientId = select.getSectionRootClientId();\n\n\t\t\tif ( firstSelectedClientId ) {\n\t\t\t\tlet sectionClientId;\n\n\t\t\t\tif ( sectionRootClientId ) {\n\t\t\t\t\tconst sectionClientIds =\n\t\t\t\t\t\tselect.getBlockOrder( sectionRootClientId );\n\n\t\t\t\t\t// If the selected block is a section block, use it.\n\t\t\t\t\tif ( sectionClientIds?.includes( firstSelectedClientId ) ) {\n\t\t\t\t\t\tsectionClientId = firstSelectedClientId;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// If the selected block is not a section block, find\n\t\t\t\t\t\t// the parent section that contains the selected block.\n\t\t\t\t\t\tsectionClientId = select\n\t\t\t\t\t\t\t.getBlockParents( firstSelectedClientId )\n\t\t\t\t\t\t\t.find( ( parent ) =>\n\t\t\t\t\t\t\t\tsectionClientIds.includes( parent )\n\t\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tsectionClientId = select.getBlockHierarchyRootClientId(\n\t\t\t\t\t\tfirstSelectedClientId\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tif ( sectionClientId ) {\n\t\t\t\t\tdispatch.selectBlock( sectionClientId );\n\t\t\t\t} else {\n\t\t\t\t\tdispatch.clearSelectedBlock();\n\t\t\t\t}\n\n\t\t\t\tspeak( __( 'You are currently in zoom-out mode.' ) );\n\t\t\t}\n\t\t}\n\n\t\tdispatch( {\n\t\t\ttype: 'SET_ZOOM_LEVEL',\n\t\t\tzoom,\n\t\t} );\n\t};\n\n/**\n * Resets the Zoom state.\n * @return {Object} Action object.\n */\nexport function resetZoomLevel() {\n\treturn {\n\t\ttype: 'RESET_ZOOM_LEVEL',\n\t};\n}\n\n/**\n * Action that toggles the spotlighted block state.\n *\n * @param {string} clientId The block's clientId.\n * @param {boolean} hasBlockSpotlight The spotlight state.\n * @return {Object} Action object.\n */\nexport function toggleBlockSpotlight( clientId, hasBlockSpotlight ) {\n\treturn {\n\t\ttype: 'TOGGLE_BLOCK_SPOTLIGHT',\n\t\tclientId,\n\t\thasBlockSpotlight,\n\t};\n}\n\n/**\n * Opens the list view content panel popover.\n *\n * @return {Object} Action object.\n */\nexport function openListViewContentPanel() {\n\treturn {\n\t\ttype: 'OPEN_LIST_VIEW_CONTENT_PANEL',\n\t};\n}\n\n/**\n * Closes the list view content panel popover.\n *\n * @return {Object} Action object.\n */\nexport function closeListViewContentPanel() {\n\treturn {\n\t\ttype: 'CLOSE_LIST_VIEW_CONTENT_PANEL',\n\t};\n}\n\n/**\n * Returns an action object used to open the viewport modal\n * for the given client IDs.\n *\n * @param {string[]} clientIds Client IDs of blocks to configure viewport settings for.\n * @return {Object} Action object.\n */\nexport function showViewportModal( clientIds ) {\n\treturn {\n\t\ttype: 'SHOW_VIEWPORT_MODAL',\n\t\tclientIds,\n\t};\n}\n\n/**\n * Returns an action object used to close the viewport modal.\n *\n * @return {Object} Action object.\n */\nexport function hideViewportModal() {\n\treturn {\n\t\ttype: 'HIDE_VIEWPORT_MODAL',\n\t};\n}\n\n/**\n * Requests to open a specific inspector tab, optionally with additional options.\n * This action signals intent to switch to a particular tab in the block inspector.\n *\n * @param {string} tabName The name of the tab to open (e.g., 'list-view', 'settings', 'styles').\n * @param {Object} [options] Optional configuration.\n * @param {string} [options.openPanel] Client ID of a specific panel to open (for tabs that support panels).\n *\n * @return {Object} Action object.\n */\nexport function requestInspectorTab( tabName, options = {} ) {\n\treturn {\n\t\ttype: 'REQUEST_INSPECTOR_TAB',\n\t\ttabName,\n\t\toptions,\n\t};\n}\n\n/**\n * Clears the requested inspector tab state after it has been handled.\n *\n * @return {Object} Action object.\n */\nexport function clearRequestedInspectorTab() {\n\treturn {\n\t\ttype: 'CLEAR_REQUESTED_INSPECTOR_TAB',\n\t};\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;AAGA,qBAAyB;AACzB,wBAAuB;AACvB,kBAAsB;AACtB,kBAAmB;AAEnB,IAAM,YAAY,CAAE,eACnB,MAAM,QAAS,UAAW,IAAI,aAAa,CAAE,UAAW;AAUzD,IAAM,kBAAkB;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AACD;AAYO,SAAS,6BACf,UACA,EAAE,4BAA4B,OAAO,QAAQ,MAAM,IAAI,CAAC,GACvD;AACD,MAAI,mBAAmB;AAEvB,MAAK,OAAO,OAAQ,kBAAkB,yBAA0B,GAAI;AACnE,0BAAAA;AAAA,MACC;AAAA,MACA;AAAA,QACC,OAAO;AAAA,QACP,aAAa;AAAA,MACd;AAAA,IACD;AAEA,uBAAmB,EAAE,GAAG,iBAAiB;AACzC,qBAAiB,gBAChB,iBAAiB;AAClB,WAAO,iBAAiB;AAAA,EACzB;AAEA,MAAI,gBAAgB;AAIpB,MAAK,6BAA6B,wBAAS,OAAO,OAAQ;AACzD,oBAAgB,CAAC;AACjB,eAAY,OAAO,kBAAmB;AACrC,UAAK,CAAE,gBAAgB,SAAU,GAAI,GAAI;AACxC,sBAAe,GAAI,IAAI,iBAAkB,GAAI;AAAA,MAC9C;AAAA,IACD;AAAA,EACD;AACA,SAAO;AAAA,IACN,MAAM;AAAA,IACN,UAAU;AAAA,IACV;AAAA,EACD;AACD;AAOO,SAAS,qBAAqB;AACpC,SAAO;AAAA,IACN,MAAM;AA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,SAAO;AAAA,IACN,MAAM;AAAA,EACP;AACD;",
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { Platform } from '@wordpress/element';\nimport deprecated from '@wordpress/deprecated';\nimport { speak } from '@wordpress/a11y';\nimport { __ } from '@wordpress/i18n';\n\nconst castArray = ( maybeArray ) =>\n\tArray.isArray( maybeArray ) ? maybeArray : [ maybeArray ];\n\n/**\n * A list of private/experimental block editor settings that\n * should not become a part of the WordPress public API.\n * BlockEditorProvider will remove these settings from the\n * settings object it receives.\n *\n * @see https://github.com/WordPress/gutenberg/pull/46131\n */\nconst privateSettings = [\n\t'inserterMediaCategories',\n\t'blockInspectorAnimation',\n\t'mediaSideload',\n];\n\n/**\n * Action that updates the block editor settings and\n * conditionally preserves the experimental ones.\n *\n * @param {Object} settings Updated settings\n * @param {Object} options Options object.\n * @param {boolean} options.stripExperimentalSettings Whether to strip experimental settings.\n * @param {boolean} options.reset Whether to reset the settings.\n * @return {Object} Action object\n */\nexport function __experimentalUpdateSettings(\n\tsettings,\n\t{ stripExperimentalSettings = false, reset = false } = {}\n) {\n\tlet incomingSettings = settings;\n\n\tif ( Object.hasOwn( incomingSettings, '__unstableIsPreviewMode' ) ) {\n\t\tdeprecated(\n\t\t\t\"__unstableIsPreviewMode argument in wp.data.dispatch('core/block-editor').updateSettings\",\n\t\t\t{\n\t\t\t\tsince: '6.8',\n\t\t\t\talternative: 'isPreviewMode',\n\t\t\t}\n\t\t);\n\n\t\tincomingSettings = { ...incomingSettings };\n\t\tincomingSettings.isPreviewMode =\n\t\t\tincomingSettings.__unstableIsPreviewMode;\n\t\tdelete incomingSettings.__unstableIsPreviewMode;\n\t}\n\n\tlet cleanSettings = incomingSettings;\n\n\t// There are no plugins in the mobile apps, so there is no\n\t// need to strip the experimental settings:\n\tif ( stripExperimentalSettings && Platform.OS === 'web' ) {\n\t\tcleanSettings = {};\n\t\tfor ( const key in incomingSettings ) {\n\t\t\tif ( ! privateSettings.includes( key ) ) {\n\t\t\t\tcleanSettings[ key ] = incomingSettings[ key ];\n\t\t\t}\n\t\t}\n\t}\n\treturn {\n\t\ttype: 'UPDATE_SETTINGS',\n\t\tsettings: cleanSettings,\n\t\treset,\n\t};\n}\n\n/**\n * Hides the block interface (eg. toolbar, outline, etc.)\n *\n * @return {Object} Action object.\n */\nexport function hideBlockInterface() {\n\treturn {\n\t\ttype: 'HIDE_BLOCK_INTERFACE',\n\t};\n}\n\n/**\n * Shows the block interface (eg. toolbar, outline, etc.)\n *\n * @return {Object} Action object.\n */\nexport function showBlockInterface() {\n\treturn {\n\t\ttype: 'SHOW_BLOCK_INTERFACE',\n\t};\n}\n\n/**\n * Yields action objects used in signalling that the blocks corresponding to\n * the set of specified client IDs are to be removed.\n *\n * Compared to `removeBlocks`, this private interface exposes an additional\n * parameter; see `forceRemove`.\n *\n * @param {string|string[]} clientIds Client IDs of blocks to remove.\n * @param {boolean} selectPrevious True if the previous block\n * or the immediate parent\n * (if no previous block exists)\n * should be selected\n * when a block is removed.\n * @param {boolean} forceRemove Whether to force the operation,\n * bypassing any checks for certain\n * block types.\n */\nexport const privateRemoveBlocks =\n\t( clientIds, selectPrevious = true, forceRemove = false ) =>\n\t( { select, dispatch, registry } ) => {\n\t\tif ( ! clientIds || ! clientIds.length ) {\n\t\t\treturn;\n\t\t}\n\n\t\tclientIds = castArray( clientIds );\n\t\tconst canRemoveBlocks = select.canRemoveBlocks( clientIds );\n\n\t\tif ( ! canRemoveBlocks ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// In certain editing contexts, we'd like to prevent accidental removal\n\t\t// of important blocks. For example, in the site editor, the Query Loop\n\t\t// block is deemed important. In such cases, we'll ask the user for\n\t\t// confirmation that they intended to remove such block(s). However,\n\t\t// the editor instance is responsible for presenting those confirmation\n\t\t// prompts to the user. Any instance opting into removal prompts must\n\t\t// register using `setBlockRemovalRules()`.\n\t\t//\n\t\t// @see https://github.com/WordPress/gutenberg/pull/51145\n\t\tconst rules = ! forceRemove && select.getBlockRemovalRules();\n\n\t\tif ( rules ) {\n\t\t\tfunction flattenBlocks( blocks ) {\n\t\t\t\tconst result = [];\n\t\t\t\tconst stack = [ ...blocks ];\n\t\t\t\twhile ( stack.length ) {\n\t\t\t\t\tconst { innerBlocks, ...block } = stack.shift();\n\t\t\t\t\tstack.push( ...innerBlocks );\n\t\t\t\t\tresult.push( block );\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tconst blockList = clientIds.map( select.getBlock );\n\t\t\tconst flattenedBlocks = flattenBlocks( blockList );\n\n\t\t\t// Find the first message and use it.\n\t\t\tlet message;\n\t\t\tfor ( const rule of rules ) {\n\t\t\t\tmessage = rule.callback( flattenedBlocks );\n\t\t\t\tif ( message ) {\n\t\t\t\t\tdispatch(\n\t\t\t\t\t\tdisplayBlockRemovalPrompt(\n\t\t\t\t\t\t\tclientIds,\n\t\t\t\t\t\t\tselectPrevious,\n\t\t\t\t\t\t\tmessage\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( selectPrevious ) {\n\t\t\tdispatch.selectPreviousBlock( clientIds[ 0 ], selectPrevious );\n\t\t}\n\n\t\t// We're batching these two actions because an extra `undo/redo` step can\n\t\t// be created, based on whether we insert a default block or not.\n\t\tregistry.batch( () => {\n\t\t\tdispatch( { type: 'REMOVE_BLOCKS', clientIds } );\n\t\t\t// To avoid a focus loss when removing the last block, assure there is\n\t\t\t// always a default block if the last of the blocks have been removed.\n\t\t\tdispatch( ensureDefaultBlock() );\n\t\t} );\n\t};\n\n/**\n * Action which will insert a default block insert action if there\n * are no other blocks at the root of the editor. This action should be used\n * in actions which may result in no blocks remaining in the editor (removal,\n * replacement, etc).\n */\nexport const ensureDefaultBlock =\n\t() =>\n\t( { select, dispatch } ) => {\n\t\t// To avoid a focus loss when removing the last block, assure there is\n\t\t// always a default block if the last of the blocks have been removed.\n\t\tconst count = select.getBlockCount();\n\t\tif ( count > 0 ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If there's an custom appender, don't insert default block.\n\t\t// We have to remember to manually move the focus elsewhere to\n\t\t// prevent it from being lost though.\n\t\tconst { __unstableHasCustomAppender } = select.getSettings();\n\t\tif ( __unstableHasCustomAppender ) {\n\t\t\treturn;\n\t\t}\n\n\t\tdispatch.insertDefaultBlock();\n\t};\n\n/**\n * Returns an action object used in signalling that a block removal prompt must\n * be displayed.\n *\n * Contrast with `setBlockRemovalRules`.\n *\n * @param {string|string[]} clientIds Client IDs of blocks to remove.\n * @param {boolean} selectPrevious True if the previous block or the\n * immediate parent (if no previous\n * block exists) should be selected\n * when a block is removed.\n * @param {string} message Message to display in the prompt.\n *\n * @return {Object} Action object.\n */\nfunction displayBlockRemovalPrompt( clientIds, selectPrevious, message ) {\n\treturn {\n\t\ttype: 'DISPLAY_BLOCK_REMOVAL_PROMPT',\n\t\tclientIds,\n\t\tselectPrevious,\n\t\tmessage,\n\t};\n}\n\n/**\n * Returns an action object used in signalling that a block removal prompt must\n * be cleared, either be cause the user has confirmed or canceled the request\n * for removal.\n *\n * @return {Object} Action object.\n */\nexport function clearBlockRemovalPrompt() {\n\treturn {\n\t\ttype: 'CLEAR_BLOCK_REMOVAL_PROMPT',\n\t};\n}\n\n/**\n * Returns an action object used to set up any rules that a block editor may\n * provide in order to prevent a user from accidentally removing certain\n * blocks. These rules are then used to display a confirmation prompt to the\n * user. For instance, in the Site Editor, the Query Loop block is important\n * enough to warrant such confirmation.\n *\n * IMPORTANT: Registering rules implicitly signals to the `privateRemoveBlocks`\n * action that the editor will be responsible for displaying block removal\n * prompts and confirming deletions. This action is meant to be used by\n * component `BlockRemovalWarningModal` only.\n *\n * The data is a record whose keys are block types (e.g. 'core/query') and\n * whose values are the explanation to be shown to users (e.g. 'Query Loop\n * displays a list of posts or pages.').\n *\n * Contrast with `displayBlockRemovalPrompt`.\n *\n * @param {Record<string,string>|false} rules Block removal rules.\n * @return {Object} Action object.\n */\nexport function setBlockRemovalRules( rules = false ) {\n\treturn {\n\t\ttype: 'SET_BLOCK_REMOVAL_RULES',\n\t\trules,\n\t};\n}\n\nexport function setStyleOverride( id, style ) {\n\treturn {\n\t\ttype: 'SET_STYLE_OVERRIDE',\n\t\tid,\n\t\tstyle,\n\t};\n}\n\nexport function deleteStyleOverride( id ) {\n\treturn {\n\t\ttype: 'DELETE_STYLE_OVERRIDE',\n\t\tid,\n\t};\n}\n\n/**\n * Action that sets the element that had focus when focus leaves the editor canvas.\n *\n * @param {Object} lastFocus The last focused element.\n *\n *\n * @return {Object} Action object.\n */\nexport function setLastFocus( lastFocus = null ) {\n\treturn {\n\t\ttype: 'LAST_FOCUS',\n\t\tlastFocus,\n\t};\n}\n\n/**\n * Returns an action object used in signalling that the user has begun to drag.\n *\n * @return {Object} Action object.\n */\nexport function startDragging() {\n\treturn {\n\t\ttype: 'START_DRAGGING',\n\t};\n}\n\n/**\n * Returns an action object used in signalling that the user has stopped dragging.\n *\n * @return {Object} Action object.\n */\nexport function stopDragging() {\n\treturn {\n\t\ttype: 'STOP_DRAGGING',\n\t};\n}\n\n/**\n * @param {string|null} clientId The block's clientId, or `null` to clear.\n *\n * @return {Object} Action object.\n */\nexport function expandBlock( clientId ) {\n\treturn {\n\t\ttype: 'SET_BLOCK_EXPANDED_IN_LIST_VIEW',\n\t\tclientId,\n\t};\n}\n\n/**\n * @param {Object} value\n * @param {string} value.rootClientId The root client ID to insert at.\n * @param {number} value.index The index to insert at.\n *\n * @return {Object} Action object.\n */\nexport function setInsertionPoint( value ) {\n\treturn {\n\t\ttype: 'SET_INSERTION_POINT',\n\t\tvalue,\n\t};\n}\n\n/**\n * Mark a contentOnly section as being edited.\n *\n * @param {string} clientId The client id of the block.\n */\nexport function editContentOnlySection( clientId ) {\n\treturn {\n\t\ttype: 'EDIT_CONTENT_ONLY_SECTION',\n\t\tclientId,\n\t};\n}\n\n/**\n * Action that stops editing a contentOnly section.\n */\nexport function stopEditingContentOnlySection() {\n\treturn {\n\t\ttype: 'EDIT_CONTENT_ONLY_SECTION',\n\t};\n}\n\n/**\n * Sets the zoom level.\n *\n * @param {number} zoom the new zoom level\n * @return {Object} Action object.\n */\nexport const setZoomLevel =\n\t( zoom = 100 ) =>\n\t( { select, dispatch } ) => {\n\t\t// When switching to zoom-out mode, we need to select the parent section\n\t\tif ( zoom !== 100 ) {\n\t\t\tconst firstSelectedClientId = select.getBlockSelectionStart();\n\t\t\tconst sectionRootClientId = select.getSectionRootClientId();\n\n\t\t\tif ( firstSelectedClientId ) {\n\t\t\t\tlet sectionClientId;\n\n\t\t\t\tif ( sectionRootClientId ) {\n\t\t\t\t\tconst sectionClientIds =\n\t\t\t\t\t\tselect.getBlockOrder( sectionRootClientId );\n\n\t\t\t\t\t// If the selected block is a section block, use it.\n\t\t\t\t\tif ( sectionClientIds?.includes( firstSelectedClientId ) ) {\n\t\t\t\t\t\tsectionClientId = firstSelectedClientId;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// If the selected block is not a section block, find\n\t\t\t\t\t\t// the parent section that contains the selected block.\n\t\t\t\t\t\tsectionClientId = select\n\t\t\t\t\t\t\t.getBlockParents( firstSelectedClientId )\n\t\t\t\t\t\t\t.find( ( parent ) =>\n\t\t\t\t\t\t\t\tsectionClientIds.includes( parent )\n\t\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tsectionClientId = select.getBlockHierarchyRootClientId(\n\t\t\t\t\t\tfirstSelectedClientId\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tif ( sectionClientId ) {\n\t\t\t\t\tdispatch.selectBlock( sectionClientId );\n\t\t\t\t} else {\n\t\t\t\t\tdispatch.clearSelectedBlock();\n\t\t\t\t}\n\n\t\t\t\tspeak( __( 'You are currently in zoom-out mode.' ) );\n\t\t\t}\n\t\t}\n\n\t\tdispatch( {\n\t\t\ttype: 'SET_ZOOM_LEVEL',\n\t\t\tzoom,\n\t\t} );\n\t};\n\n/**\n * Resets the Zoom state.\n * @return {Object} Action object.\n */\nexport function resetZoomLevel() {\n\treturn {\n\t\ttype: 'RESET_ZOOM_LEVEL',\n\t};\n}\n\n/**\n * Action that toggles the spotlighted block state.\n *\n * @param {string} clientId The block's clientId.\n * @param {boolean} hasBlockSpotlight The spotlight state.\n * @return {Object} Action object.\n */\nexport function toggleBlockSpotlight( clientId, hasBlockSpotlight ) {\n\treturn {\n\t\ttype: 'TOGGLE_BLOCK_SPOTLIGHT',\n\t\tclientId,\n\t\thasBlockSpotlight,\n\t};\n}\n\n/**\n * Opens the list view content panel popover.\n *\n * @return {Object} Action object.\n */\nexport function openListViewContentPanel() {\n\treturn {\n\t\ttype: 'OPEN_LIST_VIEW_CONTENT_PANEL',\n\t};\n}\n\n/**\n * Closes the list view content panel popover.\n *\n * @return {Object} Action object.\n */\nexport function closeListViewContentPanel() {\n\treturn {\n\t\ttype: 'CLOSE_LIST_VIEW_CONTENT_PANEL',\n\t};\n}\n\n/**\n * Returns an action object used to open the viewport modal\n * for the given client IDs.\n *\n * @param {string[]} clientIds Client IDs of blocks to configure viewport settings for.\n * @return {Object} Action object.\n */\nexport function showViewportModal( clientIds ) {\n\treturn {\n\t\ttype: 'SHOW_VIEWPORT_MODAL',\n\t\tclientIds,\n\t};\n}\n\n/**\n * Returns an action object used to close the viewport modal.\n *\n * @return {Object} Action object.\n */\nexport function hideViewportModal() {\n\treturn {\n\t\ttype: 'HIDE_VIEWPORT_MODAL',\n\t};\n}\n\n/**\n * Requests to open a specific inspector tab, optionally with additional options.\n * This action signals intent to switch to a particular tab in the block inspector.\n *\n * @param {string} tabName The name of the tab to open (e.g., 'list-view', 'settings', 'styles').\n * @param {Object} [options] Optional configuration.\n * @param {string} [options.openPanel] Client ID of a specific panel to open (for tabs that support panels).\n *\n * @return {Object} Action object.\n */\nexport function requestInspectorTab( tabName, options = {} ) {\n\treturn {\n\t\ttype: 'REQUEST_INSPECTOR_TAB',\n\t\ttabName,\n\t\toptions,\n\t};\n}\n\n/**\n * Clears the requested inspector tab state after it has been handled.\n *\n * @return {Object} Action object.\n */\nexport function clearRequestedInspectorTab() {\n\treturn {\n\t\ttype: 'CLEAR_REQUESTED_INSPECTOR_TAB',\n\t};\n}\n\n/**\n * Sets the selected style state for a block's style controls.\n *\n * @param {string} clientId The block client ID.\n * @param {Object} value The selected state value.\n *\n * @return {Object} Action object.\n */\nexport function setSelectedBlockStyleState( clientId, value ) {\n\treturn {\n\t\ttype: 'SET_SELECTED_BLOCK_STYLE_STATE',\n\t\tclientId,\n\t\tvalue,\n\t};\n}\n\n/**\n * Sets whether the selected style state is shown on the canvas.\n *\n * @param {string} clientId The block client ID.\n * @param {boolean} value Whether to show the selected state on the canvas.\n *\n * @return {Object} Action object.\n */\nexport function setSelectedBlockStyleStateCanvasPreview( clientId, value ) {\n\treturn {\n\t\ttype: 'SET_SELECTED_BLOCK_STYLE_STATE_CANVAS_PREVIEW',\n\t\tclientId,\n\t\tvalue,\n\t};\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;AAGA,qBAAyB;AACzB,wBAAuB;AACvB,kBAAsB;AACtB,kBAAmB;AAEnB,IAAM,YAAY,CAAE,eACnB,MAAM,QAAS,UAAW,IAAI,aAAa,CAAE,UAAW;AAUzD,IAAM,kBAAkB;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AACD;AAYO,SAAS,6BACf,UACA,EAAE,4BAA4B,OAAO,QAAQ,MAAM,IAAI,CAAC,GACvD;AACD,MAAI,mBAAmB;AAEvB,MAAK,OAAO,OAAQ,kBAAkB,yBAA0B,GAAI;AACnE,0BAAAA;AAAA,MACC;AAAA,MACA;AAAA,QACC,OAAO;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oB;AACnE,SAAO;AAAA,IACN,MAAM;AAAA,IACN;AAAA,IACA;AAAA,EACD;AACD;AAOO,SAAS,2BAA2B;AAC1C,SAAO;AAAA,IACN,MAAM;AAAA,EACP;AACD;AAOO,SAAS,4BAA4B;AAC3C,SAAO;AAAA,IACN,MAAM;AAAA,EACP;AACD;AASO,SAAS,kBAAmB,WAAY;AAC9C,SAAO;AAAA,IACN,MAAM;AAAA,IACN;AAAA,EACD;AACD;AAOO,SAAS,oBAAoB;AACnC,SAAO;AAAA,IACN,MAAM;AAAA,EACP;AACD;AAYO,SAAS,oBAAqB,SAAS,UAAU,CAAC,GAAI;AAC5D,SAAO;AAAA,IACN,MAAM;AAAA,IACN;AAAA,IACA;AAAA,EACD;AACD;AAOO,SAAS,6BAA6B;AAC5C,SAAO;AAAA,IACN,MAAM;AAAA,EACP;AACD;AAUO,SAAS,2BAA4B,UAAU,OAAQ;AAC7D,SAAO;AAAA,IACN,MAAM;AAAA,IACN;AAAA,IACA;AAAA,EACD;AACD;AAUO,SAAS,wCAAyC,UAAU,OAAQ;AAC1E,SAAO;AAAA,IACN,MAAM;AAAA,IACN;AAAA,IACA;AAAA,EACD;AACD;",
6
6
  "names": ["deprecated", "flattenBlocks"]
7
7
  }
@@ -29,21 +29,27 @@ __export(private_keys_exports, {
29
29
  isNavigationPostEditorKey: () => isNavigationPostEditorKey,
30
30
  mediaEditKey: () => mediaEditKey,
31
31
  mediaUploadOnSuccessKey: () => mediaUploadOnSuccessKey,
32
+ onViewportStateChangeKey: () => onViewportStateChangeKey,
32
33
  openMediaEditorModalKey: () => openMediaEditorModalKey,
33
34
  reusableBlocksSelectKey: () => reusableBlocksSelectKey,
34
35
  sectionRootClientIdKey: () => sectionRootClientIdKey,
35
- selectBlockPatternsKey: () => selectBlockPatternsKey
36
+ selectBlockPatternsKey: () => selectBlockPatternsKey,
37
+ userPatternCategoriesSelectKey: () => userPatternCategoriesSelectKey
36
38
  });
37
39
  module.exports = __toCommonJS(private_keys_exports);
38
40
  var globalStylesDataKey = /* @__PURE__ */ Symbol("globalStylesDataKey");
39
41
  var globalStylesLinksDataKey = /* @__PURE__ */ Symbol("globalStylesLinks");
40
42
  var selectBlockPatternsKey = /* @__PURE__ */ Symbol("selectBlockPatternsKey");
41
43
  var reusableBlocksSelectKey = /* @__PURE__ */ Symbol("reusableBlocksSelect");
44
+ var userPatternCategoriesSelectKey = /* @__PURE__ */ Symbol(
45
+ "userPatternCategoriesSelect"
46
+ );
42
47
  var sectionRootClientIdKey = /* @__PURE__ */ Symbol("sectionRootClientIdKey");
43
48
  var mediaEditKey = /* @__PURE__ */ Symbol("mediaEditKey");
44
49
  var getMediaSelectKey = /* @__PURE__ */ Symbol("getMediaSelect");
45
50
  var isIsolatedEditorKey = /* @__PURE__ */ Symbol("isIsolatedEditor");
46
51
  var deviceTypeKey = /* @__PURE__ */ Symbol("deviceTypeKey");
52
+ var onViewportStateChangeKey = /* @__PURE__ */ Symbol("onViewportStateChangeKey");
47
53
  var isNavigationOverlayContextKey = /* @__PURE__ */ Symbol(
48
54
  "isNavigationOverlayContext"
49
55
  );
@@ -61,9 +67,11 @@ var openMediaEditorModalKey = /* @__PURE__ */ Symbol("openMediaEditorModal");
61
67
  isNavigationPostEditorKey,
62
68
  mediaEditKey,
63
69
  mediaUploadOnSuccessKey,
70
+ onViewportStateChangeKey,
64
71
  openMediaEditorModalKey,
65
72
  reusableBlocksSelectKey,
66
73
  sectionRootClientIdKey,
67
- selectBlockPatternsKey
74
+ selectBlockPatternsKey,
75
+ userPatternCategoriesSelectKey
68
76
  });
69
77
  //# sourceMappingURL=private-keys.cjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/store/private-keys.js"],
4
- "sourcesContent": ["export const globalStylesDataKey = Symbol( 'globalStylesDataKey' );\nexport const globalStylesLinksDataKey = Symbol( 'globalStylesLinks' );\nexport const selectBlockPatternsKey = Symbol( 'selectBlockPatternsKey' );\nexport const reusableBlocksSelectKey = Symbol( 'reusableBlocksSelect' );\nexport const sectionRootClientIdKey = Symbol( 'sectionRootClientIdKey' );\nexport const mediaEditKey = Symbol( 'mediaEditKey' );\nexport const getMediaSelectKey = Symbol( 'getMediaSelect' );\nexport const isIsolatedEditorKey = Symbol( 'isIsolatedEditor' );\nexport const deviceTypeKey = Symbol( 'deviceTypeKey' );\nexport const isNavigationOverlayContextKey = Symbol(\n\t'isNavigationOverlayContext'\n);\nexport const isNavigationPostEditorKey = Symbol( 'isNavigationPostEditor' );\nexport const mediaUploadOnSuccessKey = Symbol( 'mediaUploadOnSuccess' );\nexport const openMediaEditorModalKey = Symbol( 'openMediaEditorModal' );\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,IAAM,sBAAsB,uBAAQ,qBAAsB;AAC1D,IAAM,2BAA2B,uBAAQ,mBAAoB;AAC7D,IAAM,yBAAyB,uBAAQ,wBAAyB;AAChE,IAAM,0BAA0B,uBAAQ,sBAAuB;AAC/D,IAAM,yBAAyB,uBAAQ,wBAAyB;AAChE,IAAM,eAAe,uBAAQ,cAAe;AAC5C,IAAM,oBAAoB,uBAAQ,gBAAiB;AACnD,IAAM,sBAAsB,uBAAQ,kBAAmB;AACvD,IAAM,gBAAgB,uBAAQ,eAAgB;AAC9C,IAAM,gCAAgC;AAAA,EAC5C;AACD;AACO,IAAM,4BAA4B,uBAAQ,wBAAyB;AACnE,IAAM,0BAA0B,uBAAQ,sBAAuB;AAC/D,IAAM,0BAA0B,uBAAQ,sBAAuB;",
4
+ "sourcesContent": ["export const globalStylesDataKey = Symbol( 'globalStylesDataKey' );\nexport const globalStylesLinksDataKey = Symbol( 'globalStylesLinks' );\nexport const selectBlockPatternsKey = Symbol( 'selectBlockPatternsKey' );\nexport const reusableBlocksSelectKey = Symbol( 'reusableBlocksSelect' );\nexport const userPatternCategoriesSelectKey = Symbol(\n\t'userPatternCategoriesSelect'\n);\nexport const sectionRootClientIdKey = Symbol( 'sectionRootClientIdKey' );\nexport const mediaEditKey = Symbol( 'mediaEditKey' );\nexport const getMediaSelectKey = Symbol( 'getMediaSelect' );\nexport const isIsolatedEditorKey = Symbol( 'isIsolatedEditor' );\nexport const deviceTypeKey = Symbol( 'deviceTypeKey' );\nexport const onViewportStateChangeKey = Symbol( 'onViewportStateChangeKey' );\nexport const isNavigationOverlayContextKey = Symbol(\n\t'isNavigationOverlayContext'\n);\nexport const isNavigationPostEditorKey = Symbol( 'isNavigationPostEditor' );\nexport const mediaUploadOnSuccessKey = Symbol( 'mediaUploadOnSuccess' );\nexport const openMediaEditorModalKey = Symbol( 'openMediaEditorModal' );\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,IAAM,sBAAsB,uBAAQ,qBAAsB;AAC1D,IAAM,2BAA2B,uBAAQ,mBAAoB;AAC7D,IAAM,yBAAyB,uBAAQ,wBAAyB;AAChE,IAAM,0BAA0B,uBAAQ,sBAAuB;AAC/D,IAAM,iCAAiC;AAAA,EAC7C;AACD;AACO,IAAM,yBAAyB,uBAAQ,wBAAyB;AAChE,IAAM,eAAe,uBAAQ,cAAe;AAC5C,IAAM,oBAAoB,uBAAQ,gBAAiB;AACnD,IAAM,sBAAsB,uBAAQ,kBAAmB;AACvD,IAAM,gBAAgB,uBAAQ,eAAgB;AAC9C,IAAM,2BAA2B,uBAAQ,0BAA2B;AACpE,IAAM,gCAAgC;AAAA,EAC5C;AACD;AACO,IAAM,4BAA4B,uBAAQ,wBAAyB;AACnE,IAAM,0BAA0B,uBAAQ,sBAAuB;AAC/D,IAAM,0BAA0B,uBAAQ,sBAAuB;",
6
6
  "names": []
7
7
  }
@@ -44,6 +44,7 @@ __export(private_selectors_exports, {
44
44
  getRequestedInspectorTab: () => getRequestedInspectorTab,
45
45
  getReusableBlocks: () => getReusableBlocks,
46
46
  getSectionRootClientId: () => getSectionRootClientId,
47
+ getSelectedBlockStyleState: () => getSelectedBlockStyleState,
47
48
  getStyleOverrides: () => getStyleOverrides,
48
49
  getViewportModalClientIds: () => getViewportModalClientIds,
49
50
  getZoomLevel: () => getZoomLevel,
@@ -65,6 +66,7 @@ __export(private_selectors_exports, {
65
66
  isMoveLockedBlock: () => isMoveLockedBlock,
66
67
  isRemoveLockedBlock: () => isRemoveLockedBlock,
67
68
  isSectionBlock: () => isSectionBlock,
69
+ isSelectedBlockStyleStateShownOnCanvas: () => isSelectedBlockStyleStateShownOnCanvas,
68
70
  isWithinEditedContentOnlySection: () => isWithinEditedContentOnlySection,
69
71
  isZoomOut: () => isZoomOut
70
72
  });
@@ -238,7 +240,9 @@ var getPatternBySlug = (0, import_data.createRegistrySelector)(
238
240
  }
239
241
  return (0, import_utils.mapUserPattern)(
240
242
  block,
241
- state.settings.__experimentalUserPatternCategories
243
+ state.settings[import_private_keys.userPatternCategoriesSelectKey]?.(
244
+ select
245
+ ) ?? state.settings.__experimentalUserPatternCategories
242
246
  );
243
247
  }
244
248
  return [
@@ -262,7 +266,9 @@ var getAllPatterns = (0, import_data.createRegistrySelector)(
262
266
  ...(0, import_lock_unlock.unlock)(select(import_constants.STORE_NAME)).getReusableBlocks().map(
263
267
  (userPattern) => (0, import_utils.mapUserPattern)(
264
268
  userPattern,
265
- state.settings.__experimentalUserPatternCategories
269
+ state.settings[import_private_keys.userPatternCategoriesSelectKey]?.(
270
+ select
271
+ ) ?? state.settings.__experimentalUserPatternCategories
266
272
  )
267
273
  ),
268
274
  // This setting is left for back compat.
@@ -512,6 +518,22 @@ function getViewportModalClientIds(state) {
512
518
  function getRequestedInspectorTab(state) {
513
519
  return state.requestedInspectorTab;
514
520
  }
521
+ var DEFAULT_BLOCK_STYLE_STATE = {
522
+ viewport: "default",
523
+ pseudo: "default"
524
+ };
525
+ function getSelectedBlockStyleState(state, clientId) {
526
+ if (state.selectedBlockStyleState?.clientId !== clientId) {
527
+ return DEFAULT_BLOCK_STYLE_STATE;
528
+ }
529
+ return state.selectedBlockStyleState.value ?? DEFAULT_BLOCK_STYLE_STATE;
530
+ }
531
+ function isSelectedBlockStyleStateShownOnCanvas(state, clientId) {
532
+ if (state.selectedBlockStyleState?.clientId !== clientId) {
533
+ return true;
534
+ }
535
+ return state.selectedBlockStyleState.showStateOnCanvas ?? true;
536
+ }
515
537
  // Annotate the CommonJS export names for ESM import in node:
516
538
  0 && (module.exports = {
517
539
  getAllPatterns,
@@ -538,6 +560,7 @@ function getRequestedInspectorTab(state) {
538
560
  getRequestedInspectorTab,
539
561
  getReusableBlocks,
540
562
  getSectionRootClientId,
563
+ getSelectedBlockStyleState,
541
564
  getStyleOverrides,
542
565
  getViewportModalClientIds,
543
566
  getZoomLevel,
@@ -559,6 +582,7 @@ function getRequestedInspectorTab(state) {
559
582
  isMoveLockedBlock,
560
583
  isRemoveLockedBlock,
561
584
  isSectionBlock,
585
+ isSelectedBlockStyleStateShownOnCanvas,
562
586
  isWithinEditedContentOnlySection,
563
587
  isZoomOut
564
588
  });
@@ -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\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\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 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.__experimentalUserPatternCategories\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn [\n\t\t\t\t// This setting is left for back compat.\n\t\t\t\t...( state.settings.__experimentalBlockPatterns ?? [] ),\n\t\t\t\t...( state.settings[ selectBlockPatternsKey ]?.( select ) ??\n\t\t\t\t\t[] ),\n\t\t\t].find( ( { name } ) => name === patternName );\n\t\t},\n\t\t( state, patternName ) =>\n\t\t\tpatternName?.startsWith( 'core/block/' )\n\t\t\t\t? [\n\t\t\t\t\t\tunlock( select( STORE_NAME ) ).getReusableBlocks(),\n\t\t\t\t\t\tstate.settings.__experimentalReusableBlocks,\n\t\t\t\t ]\n\t\t\t\t: [\n\t\t\t\t\t\tstate.settings.__experimentalBlockPatterns,\n\t\t\t\t\t\tstate.settings[ selectBlockPatternsKey ]?.( select ),\n\t\t\t\t ]\n\t)\n);\n\nexport const getAllPatterns = createRegistrySelector( ( select ) =>\n\tcreateSelector( ( state ) => {\n\t\treturn [\n\t\t\t...unlock( select( STORE_NAME ) )\n\t\t\t\t.getReusableBlocks()\n\t\t\t\t.map( ( userPattern ) =>\n\t\t\t\t\tmapUserPattern(\n\t\t\t\t\t\tuserPattern,\n\t\t\t\t\t\tstate.settings.__experimentalUserPatternCategories\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t// This setting is left for back compat.\n\t\t\t...( state.settings.__experimentalBlockPatterns ?? [] ),\n\t\t\t...( state.settings[ selectBlockPatternsKey ]?.( select ) ?? [] ),\n\t\t].filter(\n\t\t\t( x, index, arr ) =>\n\t\t\t\tindex === arr.findIndex( ( y ) => x.name === y.name )\n\t\t);\n\t}, getAllPatternsDependants( select ) )\n);\n\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 \u2014 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 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"],
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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4B,OAAQ;AACnD,SAAO,MAAM;AACd;AAUO,SAAS,sBAAuB,OAAO,UAAW;AAExD,MAAK,MAAM,sBAAsB,SAAU;AAC1C,WAAO;AAAA,EACR;AACA,SAAO,MAAM,sBAAsB,SAAU,QAAS,MAAM;AAC7D;AAWO,SAAS,0BAA2B,OAAQ;AAClD,SAAO,MAAM,0BAA0B;AACxC;AAUO,SAAS,0BAA2B,OAAQ;AAClD,SAAO,MAAM;AACd;AASO,SAAS,yBAA0B,OAAQ;AACjD,SAAO,MAAM;AACd;",
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\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 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 \u2014 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 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 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 function getSelectedBlockStyleState( state, clientId ) {\n\tif ( state.selectedBlockStyleState?.clientId !== clientId ) {\n\t\treturn DEFAULT_BLOCK_STYLE_STATE;\n\t}\n\n\treturn state.selectedBlockStyleState.value ?? DEFAULT_BLOCK_STYLE_STATE;\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.selectedBlockStyle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iBAAa,qCAAoB,OAAO,QAAS;AACvD,MAAK,YAAY,MAAM,WAAW,QAAY;AAC7C,WAAO,CAAC,CAAE,YAAY,MAAM;AAAA,EAC7B;AAEA,QAAM,mBAAe,uCAAsB,OAAO,QAAS;AAC3D,QAAM,mBAAe,kCAAiB,OAAO,YAAa;AAK1D,SAAO,iBAAiB,SAAS,iBAAiB;AACnD;AAiBO,SAAS,cAAe,OAAO,UAAW;AAChD,SACC,kBAAmB,OAAO,QAAS,KACnC,kBAAmB,OAAO,QAAS,KACnC,oBAAqB,OAAO,QAAS;AAEvC;AASO,SAAS,2BAA4B,OAAQ;AACnD,SAAO,MAAM;AACd;AAUO,SAAS,sBAAuB,OAAO,UAAW;AAExD,MAAK,MAAM,sBAAsB,SAAU;AAC1C,WAAO;AAAA,EACR;AACA,SAAO,MAAM,sBAAsB,SAAU,QAAS,MAAM;AAC7D;AAWO,SAAS,0BAA2B,OAAQ;AAClD,SAAO,MAAM,0BAA0B;AACxC;AAUO,SAAS,0BAA2B,OAAQ;AAClD,SAAO,MAAM;AACd;AASO,SAAS,yBAA0B,OAAQ;AACjD,SAAO,MAAM;AACd;AAEA,IAAM,4BAA4B;AAAA,EACjC,UAAU;AAAA,EACV,QAAQ;AACT;AAUO,SAAS,2BAA4B,OAAO,UAAW;AAC7D,MAAK,MAAM,yBAAyB,aAAa,UAAW;AAC3D,WAAO;AAAA,EACR;AAEA,SAAO,MAAM,wBAAwB,SAAS;AAC/C;AAUO,SAAS,uCAAwC,OAAO,UAAW;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
  }
@@ -57,6 +57,7 @@ __export(reducer_exports, {
57
57
  preferences: () => preferences,
58
58
  registeredInserterMediaCategories: () => registeredInserterMediaCategories,
59
59
  requestedInspectorTab: () => requestedInspectorTab,
60
+ selectedBlockStyleState: () => selectedBlockStyleState,
60
61
  selection: () => selection,
61
62
  settings: () => settings,
62
63
  styleOverrides: () => styleOverrides,
@@ -1517,6 +1518,72 @@ function requestedInspectorTab(state = null, action) {
1517
1518
  }
1518
1519
  return state;
1519
1520
  }
1521
+ function selectedBlockStyleState(state = void 0, action) {
1522
+ switch (action.type) {
1523
+ case "SET_SELECTED_BLOCK_STYLE_STATE": {
1524
+ if (!action.clientId || !action.value) {
1525
+ return void 0;
1526
+ }
1527
+ const showStateOnCanvas = state?.clientId === action.clientId ? state.showStateOnCanvas ?? true : true;
1528
+ const previousValue = state?.clientId === action.clientId ? state.value : {};
1529
+ return {
1530
+ clientId: action.clientId,
1531
+ showStateOnCanvas,
1532
+ value: {
1533
+ viewport: "default",
1534
+ pseudo: "default",
1535
+ ...previousValue,
1536
+ ...action.value
1537
+ }
1538
+ };
1539
+ }
1540
+ case "SET_SELECTED_BLOCK_STYLE_STATE_CANVAS_PREVIEW": {
1541
+ if (!action.clientId || typeof action.value !== "boolean") {
1542
+ return state;
1543
+ }
1544
+ const previousValue = state?.clientId === action.clientId ? state.value : {};
1545
+ return {
1546
+ clientId: action.clientId,
1547
+ showStateOnCanvas: action.value,
1548
+ value: {
1549
+ viewport: "default",
1550
+ pseudo: "default",
1551
+ ...previousValue
1552
+ }
1553
+ };
1554
+ }
1555
+ case "SELECT_BLOCK":
1556
+ case "SELECTION_CHANGE": {
1557
+ if (state?.clientId && state.clientId !== action.clientId) {
1558
+ return void 0;
1559
+ }
1560
+ break;
1561
+ }
1562
+ case "RESET_SELECTION": {
1563
+ if (state?.clientId && state.clientId !== action.selectionStart?.clientId) {
1564
+ return void 0;
1565
+ }
1566
+ break;
1567
+ }
1568
+ case "CLEAR_SELECTED_BLOCK":
1569
+ case "MULTI_SELECT":
1570
+ return void 0;
1571
+ case "REMOVE_BLOCKS":
1572
+ case "REPLACE_BLOCKS": {
1573
+ if (state?.clientId && action.clientIds?.includes(state.clientId)) {
1574
+ return void 0;
1575
+ }
1576
+ break;
1577
+ }
1578
+ case "RESET_BLOCKS": {
1579
+ if (state?.clientId && !getFlattenedClientIds(action.blocks)[state.clientId]) {
1580
+ return void 0;
1581
+ }
1582
+ break;
1583
+ }
1584
+ }
1585
+ return state;
1586
+ }
1520
1587
  var combinedReducers = (0, import_data.combineReducers)({
1521
1588
  blocks,
1522
1589
  isDragging,
@@ -1551,7 +1618,8 @@ var combinedReducers = (0, import_data.combineReducers)({
1551
1618
  openedListViewPanels,
1552
1619
  listViewExpandRevision,
1553
1620
  listViewContentPanelOpen,
1554
- requestedInspectorTab
1621
+ requestedInspectorTab,
1622
+ selectedBlockStyleState
1555
1623
  });
1556
1624
  function getBlockTreeBlock(state, clientId) {
1557
1625
  if (clientId === "") {
@@ -2060,6 +2128,7 @@ var reducer_default = (0, import_compose.pipe)(
2060
2128
  preferences,
2061
2129
  registeredInserterMediaCategories,
2062
2130
  requestedInspectorTab,
2131
+ selectedBlockStyleState,
2063
2132
  selection,
2064
2133
  settings,
2065
2134
  styleOverrides,