@wordpress/block-editor 12.24.0 → 12.26.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 (973) hide show
  1. package/CHANGELOG.md +11 -3
  2. package/README.md +7 -1
  3. package/build/components/alignment-control/ui.js +3 -1
  4. package/build/components/alignment-control/ui.js.map +1 -1
  5. package/build/components/block-actions/index.js +4 -2
  6. package/build/components/block-actions/index.js.map +1 -1
  7. package/build/components/block-alignment-control/ui.js +2 -2
  8. package/build/components/block-alignment-control/ui.js.map +1 -1
  9. package/build/components/block-card/index.js +2 -2
  10. package/build/components/block-card/index.js.map +1 -1
  11. package/build/components/block-compare/index.js +2 -2
  12. package/build/components/block-compare/index.js.map +1 -1
  13. package/build/components/block-edit/edit.js +2 -2
  14. package/build/components/block-edit/edit.js.map +1 -1
  15. package/build/components/block-icon/index.js +2 -2
  16. package/build/components/block-icon/index.js.map +1 -1
  17. package/build/components/block-list/block.js +4 -13
  18. package/build/components/block-list/block.js.map +1 -1
  19. package/build/components/block-list/block.native.js +2 -2
  20. package/build/components/block-list/block.native.js.map +1 -1
  21. package/build/components/block-list/index.js +6 -5
  22. package/build/components/block-list/index.js.map +1 -1
  23. package/build/components/block-list/index.native.js +1 -9
  24. package/build/components/block-list/index.native.js.map +1 -1
  25. package/build/components/block-list/use-block-props/index.js +11 -8
  26. package/build/components/block-list/use-block-props/index.js.map +1 -1
  27. package/build/components/block-list/use-block-props/use-block-refs.js +17 -46
  28. package/build/components/block-list/use-block-props/use-block-refs.js.map +1 -1
  29. package/build/components/block-list/use-block-props/use-is-hovered.js +10 -14
  30. package/build/components/block-list/use-block-props/use-is-hovered.js.map +1 -1
  31. package/build/components/block-list/use-block-props/use-scroll-into-view.js +44 -0
  32. package/build/components/block-list/use-block-props/use-scroll-into-view.js.map +1 -0
  33. package/build/components/block-list-appender/index.js +2 -2
  34. package/build/components/block-list-appender/index.js.map +1 -1
  35. package/build/components/block-mover/button.js +2 -2
  36. package/build/components/block-mover/button.js.map +1 -1
  37. package/build/components/block-mover/index.js +2 -2
  38. package/build/components/block-mover/index.js.map +1 -1
  39. package/build/components/block-mover/index.native.js +3 -1
  40. package/build/components/block-mover/index.native.js.map +1 -1
  41. package/build/components/block-patterns-list/index.js +26 -5
  42. package/build/components/block-patterns-list/index.js.map +1 -1
  43. package/build/components/block-popover/cover.js +9 -6
  44. package/build/components/block-popover/cover.js.map +1 -1
  45. package/build/components/block-popover/inbetween.js +2 -2
  46. package/build/components/block-popover/inbetween.js.map +1 -1
  47. package/build/components/block-popover/index.js +22 -4
  48. package/build/components/block-popover/index.js.map +1 -1
  49. package/build/components/block-preview/index.js +2 -2
  50. package/build/components/block-preview/index.js.map +1 -1
  51. package/build/components/block-settings-menu/block-settings-dropdown.js +8 -30
  52. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  53. package/build/components/block-settings-menu-controls/index.js +10 -7
  54. package/build/components/block-settings-menu-controls/index.js.map +1 -1
  55. package/build/components/block-styles/index.js +2 -2
  56. package/build/components/block-styles/index.js.map +1 -1
  57. package/build/components/block-switcher/pattern-transformations-menu.js +3 -1
  58. package/build/components/block-switcher/pattern-transformations-menu.js.map +1 -1
  59. package/build/components/block-switcher/use-transformed-patterns.js +6 -2
  60. package/build/components/block-switcher/use-transformed-patterns.js.map +1 -1
  61. package/build/components/block-switcher/utils.js +15 -5
  62. package/build/components/block-switcher/utils.js.map +1 -1
  63. package/build/components/block-toolbar/index.js +3 -3
  64. package/build/components/block-toolbar/index.js.map +1 -1
  65. package/build/components/block-toolbar/use-has-block-toolbar.js +14 -9
  66. package/build/components/block-toolbar/use-has-block-toolbar.js.map +1 -1
  67. package/build/components/block-tools/block-selection-button.js +2 -2
  68. package/build/components/block-tools/block-selection-button.js.map +1 -1
  69. package/build/components/block-tools/block-toolbar-breadcrumb.js +4 -4
  70. package/build/components/block-tools/block-toolbar-breadcrumb.js.map +1 -1
  71. package/build/components/block-tools/block-toolbar-popover.js +2 -2
  72. package/build/components/block-tools/block-toolbar-popover.js.map +1 -1
  73. package/build/components/block-tools/empty-block-inserter.js +2 -2
  74. package/build/components/block-tools/empty-block-inserter.js.map +1 -1
  75. package/build/components/block-tools/index.js +23 -2
  76. package/build/components/block-tools/index.js.map +1 -1
  77. package/build/components/block-tools/insertion-point.js +4 -4
  78. package/build/components/block-tools/insertion-point.js.map +1 -1
  79. package/build/components/block-tools/use-show-block-tools.js +2 -5
  80. package/build/components/block-tools/use-show-block-tools.js.map +1 -1
  81. package/build/components/block-tools/zoom-out-mode-inserters.js +68 -20
  82. package/build/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
  83. package/build/components/block-variation-picker/index.js +5 -4
  84. package/build/components/block-variation-picker/index.js.map +1 -1
  85. package/build/components/block-variation-transforms/index.js +3 -1
  86. package/build/components/block-variation-transforms/index.js.map +1 -1
  87. package/build/components/button-block-appender/index.js +2 -2
  88. package/build/components/button-block-appender/index.js.map +1 -1
  89. package/build/components/child-layout-control/index.js +2 -2
  90. package/build/components/child-layout-control/index.js.map +1 -1
  91. package/build/components/colors-gradients/control.js +3 -3
  92. package/build/components/colors-gradients/control.js.map +1 -1
  93. package/build/components/colors-gradients/dropdown.js +2 -2
  94. package/build/components/colors-gradients/dropdown.js.map +1 -1
  95. package/build/components/colors-gradients/panel-color-gradient-settings.js +2 -2
  96. package/build/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
  97. package/build/components/convert-to-group-buttons/index.js +6 -0
  98. package/build/components/convert-to-group-buttons/index.js.map +1 -1
  99. package/build/components/default-block-appender/index.js +2 -2
  100. package/build/components/default-block-appender/index.js.map +1 -1
  101. package/build/components/dimensions-tool/aspect-ratio-tool.js +30 -36
  102. package/build/components/dimensions-tool/aspect-ratio-tool.js.map +1 -1
  103. package/build/components/floating-toolbar/index.native.js +9 -5
  104. package/build/components/floating-toolbar/index.native.js.map +1 -1
  105. package/build/components/global-styles/background-panel.js +4 -4
  106. package/build/components/global-styles/background-panel.js.map +1 -1
  107. package/build/components/global-styles/color-panel.js +6 -4
  108. package/build/components/global-styles/color-panel.js.map +1 -1
  109. package/build/components/global-styles/dimensions-panel.js +20 -4
  110. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  111. package/build/components/global-styles/filters-panel.js +2 -2
  112. package/build/components/global-styles/filters-panel.js.map +1 -1
  113. package/build/components/global-styles/hooks.js +3 -2
  114. package/build/components/global-styles/hooks.js.map +1 -1
  115. package/build/components/global-styles/shadow-panel-components.js +4 -4
  116. package/build/components/global-styles/shadow-panel-components.js.map +1 -1
  117. package/build/components/global-styles/typography-panel.js +23 -23
  118. package/build/components/global-styles/typography-panel.js.map +1 -1
  119. package/build/components/global-styles/use-global-styles-output.js +149 -132
  120. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  121. package/build/components/global-styles/utils.js +45 -0
  122. package/build/components/global-styles/utils.js.map +1 -1
  123. package/build/components/grid-visualizer/grid-item-resizer.js +141 -24
  124. package/build/components/grid-visualizer/grid-item-resizer.js.map +1 -1
  125. package/build/components/grid-visualizer/grid-visualizer.js +11 -5
  126. package/build/components/grid-visualizer/grid-visualizer.js.map +1 -1
  127. package/build/components/iframe/index.js +69 -30
  128. package/build/components/iframe/index.js.map +1 -1
  129. package/build/components/image-editor/aspect-ratio-dropdown.js +53 -36
  130. package/build/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
  131. package/build/components/image-editor/cropper.js +2 -2
  132. package/build/components/image-editor/cropper.js.map +1 -1
  133. package/build/components/image-editor/index.js +1 -1
  134. package/build/components/image-editor/index.js.map +1 -1
  135. package/build/components/index.js +8 -0
  136. package/build/components/index.js.map +1 -1
  137. package/build/components/inner-blocks/button-block-appender.js +2 -2
  138. package/build/components/inner-blocks/button-block-appender.js.map +1 -1
  139. package/build/components/inner-blocks/index.js +25 -10
  140. package/build/components/inner-blocks/index.js.map +1 -1
  141. package/build/components/inserter/block-patterns-explorer/pattern-list.js +1 -1
  142. package/build/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
  143. package/build/components/inserter/block-patterns-tab/index.js +20 -30
  144. package/build/components/inserter/block-patterns-tab/index.js.map +1 -1
  145. package/build/components/inserter/block-patterns-tab/pattern-category-previews.js +1 -1
  146. package/build/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
  147. package/build/components/inserter/block-types-tab.js +9 -3
  148. package/build/components/inserter/block-types-tab.js.map +1 -1
  149. package/build/components/inserter/category-tabs/index.js +56 -0
  150. package/build/components/inserter/category-tabs/index.js.map +1 -0
  151. package/build/components/inserter/hooks/use-insertion-point.js +11 -2
  152. package/build/components/inserter/hooks/use-insertion-point.js.map +1 -1
  153. package/build/components/inserter/hooks/use-patterns-state.js +12 -5
  154. package/build/components/inserter/hooks/use-patterns-state.js.map +1 -1
  155. package/build/components/inserter/index.js +2 -2
  156. package/build/components/inserter/index.js.map +1 -1
  157. package/build/components/inserter/library.js +8 -2
  158. package/build/components/inserter/library.js.map +1 -1
  159. package/build/components/inserter/media-tab/index.js +2 -2
  160. package/build/components/inserter/media-tab/index.js.map +1 -1
  161. package/build/components/inserter/media-tab/media-panel.js +0 -25
  162. package/build/components/inserter/media-tab/media-panel.js.map +1 -1
  163. package/build/components/inserter/media-tab/media-preview.js +15 -5
  164. package/build/components/inserter/media-tab/media-preview.js.map +1 -1
  165. package/build/components/inserter/media-tab/media-tab.js +15 -29
  166. package/build/components/inserter/media-tab/media-tab.js.map +1 -1
  167. package/build/components/inserter/menu.js +115 -109
  168. package/build/components/inserter/menu.js.map +1 -1
  169. package/build/components/inserter/quick-inserter.js +2 -2
  170. package/build/components/inserter/quick-inserter.js.map +1 -1
  171. package/build/components/inserter/tabs.js +23 -11
  172. package/build/components/inserter/tabs.js.map +1 -1
  173. package/build/components/inserter-list-item/index.js +3 -3
  174. package/build/components/inserter-list-item/index.js.map +1 -1
  175. package/build/components/keyboard-shortcuts/index.js +9 -0
  176. package/build/components/keyboard-shortcuts/index.js.map +1 -1
  177. package/build/components/line-height-control/index.js +6 -2
  178. package/build/components/line-height-control/index.js.map +1 -1
  179. package/build/components/link-control/index.js +2 -2
  180. package/build/components/link-control/index.js.map +1 -1
  181. package/build/components/link-control/link-preview.js +3 -3
  182. package/build/components/link-control/link-preview.js.map +1 -1
  183. package/build/components/link-control/search-item.js +9 -3
  184. package/build/components/link-control/search-item.js.map +1 -1
  185. package/build/components/link-control/search-results.js +2 -2
  186. package/build/components/link-control/search-results.js.map +1 -1
  187. package/build/components/list-view/block-contents.js +2 -2
  188. package/build/components/list-view/block-contents.js.map +1 -1
  189. package/build/components/list-view/block-select-button.js +15 -172
  190. package/build/components/list-view/block-select-button.js.map +1 -1
  191. package/build/components/list-view/block.js +196 -21
  192. package/build/components/list-view/block.js.map +1 -1
  193. package/build/components/list-view/drop-indicator.js +3 -3
  194. package/build/components/list-view/drop-indicator.js.map +1 -1
  195. package/build/components/list-view/index.js +3 -3
  196. package/build/components/list-view/index.js.map +1 -1
  197. package/build/components/list-view/leaf.js +2 -2
  198. package/build/components/list-view/leaf.js.map +1 -1
  199. package/build/components/list-view/use-list-view-drop-zone.js +1 -1
  200. package/build/components/list-view/use-list-view-drop-zone.js.map +1 -1
  201. package/build/components/list-view/utils.js +3 -1
  202. package/build/components/list-view/utils.js.map +1 -1
  203. package/build/components/media-placeholder/index.js +7 -7
  204. package/build/components/media-placeholder/index.js.map +1 -1
  205. package/build/components/media-replace-flow/index.js +2 -2
  206. package/build/components/media-replace-flow/index.js.map +1 -1
  207. package/build/components/navigable-toolbar/index.js +3 -1
  208. package/build/components/navigable-toolbar/index.js.map +1 -1
  209. package/build/components/plain-text/index.js +2 -2
  210. package/build/components/plain-text/index.js.map +1 -1
  211. package/build/components/provider/block-refs-provider.js +3 -4
  212. package/build/components/provider/block-refs-provider.js.map +1 -1
  213. package/build/components/provider/use-block-sync.js +10 -1
  214. package/build/components/provider/use-block-sync.js.map +1 -1
  215. package/build/components/responsive-block-control/index.js +2 -2
  216. package/build/components/responsive-block-control/index.js.map +1 -1
  217. package/build/components/rich-text/event-listeners/before-input-rules.js +93 -0
  218. package/build/components/rich-text/event-listeners/before-input-rules.js.map +1 -0
  219. package/build/components/rich-text/event-listeners/delete.js +58 -0
  220. package/build/components/rich-text/event-listeners/delete.js.map +1 -0
  221. package/build/components/rich-text/event-listeners/enter.js +89 -0
  222. package/build/components/rich-text/event-listeners/enter.js.map +1 -0
  223. package/build/components/rich-text/event-listeners/firefox-compat.js +36 -0
  224. package/build/components/rich-text/event-listeners/firefox-compat.js.map +1 -0
  225. package/build/components/rich-text/event-listeners/index.js +44 -0
  226. package/build/components/rich-text/event-listeners/index.js.map +1 -0
  227. package/build/components/rich-text/event-listeners/input-events.js +22 -0
  228. package/build/components/rich-text/event-listeners/input-events.js.map +1 -0
  229. package/build/components/rich-text/event-listeners/input-rules.js +135 -0
  230. package/build/components/rich-text/event-listeners/input-rules.js.map +1 -0
  231. package/build/components/rich-text/event-listeners/insert-replacement-text.js +33 -0
  232. package/build/components/rich-text/event-listeners/insert-replacement-text.js.map +1 -0
  233. package/build/components/rich-text/event-listeners/paste-handler.js +126 -0
  234. package/build/components/rich-text/event-listeners/paste-handler.js.map +1 -0
  235. package/build/components/rich-text/event-listeners/remove-browser-shortcuts.js +27 -0
  236. package/build/components/rich-text/event-listeners/remove-browser-shortcuts.js.map +1 -0
  237. package/build/components/rich-text/event-listeners/shortcuts.js +22 -0
  238. package/build/components/rich-text/event-listeners/shortcuts.js.map +1 -0
  239. package/build/components/rich-text/event-listeners/undo-automatic-change.js +51 -0
  240. package/build/components/rich-text/event-listeners/undo-automatic-change.js.map +1 -0
  241. package/build/components/rich-text/format-toolbar/index.js +2 -2
  242. package/build/components/rich-text/format-toolbar/index.js.map +1 -1
  243. package/build/components/rich-text/index.js +20 -33
  244. package/build/components/rich-text/index.js.map +1 -1
  245. package/build/components/rich-text/index.native.js +15 -5
  246. package/build/components/rich-text/index.native.js.map +1 -1
  247. package/build/components/rich-text/multiline.js +36 -4
  248. package/build/components/rich-text/multiline.js.map +1 -1
  249. package/build/components/rich-text/native/index.native.js +12 -0
  250. package/build/components/rich-text/native/index.native.js.map +1 -1
  251. package/build/components/rich-text/use-format-types.js +8 -4
  252. package/build/components/rich-text/use-format-types.js.map +1 -1
  253. package/build/components/segmented-text-control/index.js +62 -0
  254. package/build/components/segmented-text-control/index.js.map +1 -0
  255. package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js +16 -2
  256. package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
  257. package/build/components/text-alignment-control/index.js +76 -0
  258. package/build/components/text-alignment-control/index.js.map +1 -0
  259. package/build/components/text-decoration-control/index.js +22 -26
  260. package/build/components/text-decoration-control/index.js.map +1 -1
  261. package/build/components/text-transform-control/index.js +19 -23
  262. package/build/components/text-transform-control/index.js.map +1 -1
  263. package/build/components/url-input/index.js +4 -4
  264. package/build/components/url-input/index.js.map +1 -1
  265. package/build/components/url-popover/link-editor.js +2 -2
  266. package/build/components/url-popover/link-editor.js.map +1 -1
  267. package/build/components/url-popover/link-viewer-url.js +2 -2
  268. package/build/components/url-popover/link-viewer-url.js.map +1 -1
  269. package/build/components/url-popover/link-viewer.js +2 -2
  270. package/build/components/url-popover/link-viewer.js.map +1 -1
  271. package/build/components/use-block-display-information/index.js +9 -3
  272. package/build/components/use-block-display-information/index.js.map +1 -1
  273. package/build/components/use-on-block-drop/index.js +3 -1
  274. package/build/components/use-on-block-drop/index.js.map +1 -1
  275. package/build/components/warning/index.js +2 -2
  276. package/build/components/warning/index.js.map +1 -1
  277. package/build/components/writing-flow/index.js +2 -2
  278. package/build/components/writing-flow/index.js.map +1 -1
  279. package/build/components/writing-flow/use-clipboard-handler.js +77 -30
  280. package/build/components/writing-flow/use-clipboard-handler.js.map +1 -1
  281. package/build/components/writing-flow/use-drag-selection.js +3 -1
  282. package/build/components/writing-flow/use-drag-selection.js.map +1 -1
  283. package/build/components/writing-flow/use-input.js +44 -2
  284. package/build/components/writing-flow/use-input.js.map +1 -1
  285. package/build/components/writing-flow/use-tab-nav.js +9 -2
  286. package/build/components/writing-flow/use-tab-nav.js.map +1 -1
  287. package/build/components/writing-mode-control/index.js +17 -21
  288. package/build/components/writing-mode-control/index.js.map +1 -1
  289. package/build/hooks/align.js +2 -2
  290. package/build/hooks/align.js.map +1 -1
  291. package/build/hooks/background.js +1 -1
  292. package/build/hooks/background.js.map +1 -1
  293. package/build/hooks/border.js +3 -3
  294. package/build/hooks/border.js.map +1 -1
  295. package/build/hooks/color.js +3 -3
  296. package/build/hooks/color.js.map +1 -1
  297. package/build/hooks/content-lock-ui.js +5 -28
  298. package/build/hooks/content-lock-ui.js.map +1 -1
  299. package/build/hooks/custom-class-name.js +2 -2
  300. package/build/hooks/custom-class-name.js.map +1 -1
  301. package/build/hooks/custom-class-name.native.js +2 -2
  302. package/build/hooks/custom-class-name.native.js.map +1 -1
  303. package/build/hooks/dimensions.js +2 -2
  304. package/build/hooks/dimensions.js.map +1 -1
  305. package/build/hooks/duotone.js +3 -1
  306. package/build/hooks/duotone.js.map +1 -1
  307. package/build/hooks/layout-child.js +16 -8
  308. package/build/hooks/layout-child.js.map +1 -1
  309. package/build/hooks/layout.js +2 -2
  310. package/build/hooks/layout.js.map +1 -1
  311. package/build/hooks/position.js +2 -2
  312. package/build/hooks/position.js.map +1 -1
  313. package/build/hooks/text-align.js +3 -3
  314. package/build/hooks/text-align.js.map +1 -1
  315. package/build/hooks/use-bindings-attributes.js +39 -13
  316. package/build/hooks/use-bindings-attributes.js.map +1 -1
  317. package/build/hooks/use-color-props.js +2 -2
  318. package/build/hooks/use-color-props.js.map +1 -1
  319. package/build/hooks/use-typography-props.js +2 -2
  320. package/build/hooks/use-typography-props.js.map +1 -1
  321. package/build/hooks/utils.js +13 -8
  322. package/build/hooks/utils.js.map +1 -1
  323. package/build/layouts/grid.js +7 -6
  324. package/build/layouts/grid.js.map +1 -1
  325. package/build/private-apis.js +8 -3
  326. package/build/private-apis.js.map +1 -1
  327. package/build/store/actions.js +143 -25
  328. package/build/store/actions.js.map +1 -1
  329. package/build/store/private-actions.js +26 -1
  330. package/build/store/private-actions.js.map +1 -1
  331. package/build/store/private-keys.js +2 -1
  332. package/build/store/private-keys.js.map +1 -1
  333. package/build/store/private-selectors.js +33 -6
  334. package/build/store/private-selectors.js.map +1 -1
  335. package/build/store/reducer.js +11 -8
  336. package/build/store/reducer.js.map +1 -1
  337. package/build/store/selectors.js +25 -8
  338. package/build/store/selectors.js.map +1 -1
  339. package/build/utils/object.js +17 -0
  340. package/build/utils/object.js.map +1 -1
  341. package/build/utils/order-inserter-block-items.js +6 -2
  342. package/build/utils/order-inserter-block-items.js.map +1 -1
  343. package/build/utils/pasting.js +6 -2
  344. package/build/utils/pasting.js.map +1 -1
  345. package/build/utils/selection.js +8 -0
  346. package/build/utils/selection.js.map +1 -1
  347. package/build/utils/transform-styles/index.js +12 -7
  348. package/build/utils/transform-styles/index.js.map +1 -1
  349. package/build-module/components/alignment-control/ui.js +3 -1
  350. package/build-module/components/alignment-control/ui.js.map +1 -1
  351. package/build-module/components/block-actions/index.js +4 -2
  352. package/build-module/components/block-actions/index.js.map +1 -1
  353. package/build-module/components/block-alignment-control/ui.js +2 -2
  354. package/build-module/components/block-alignment-control/ui.js.map +1 -1
  355. package/build-module/components/block-card/index.js +2 -2
  356. package/build-module/components/block-card/index.js.map +1 -1
  357. package/build-module/components/block-compare/index.js +2 -2
  358. package/build-module/components/block-compare/index.js.map +1 -1
  359. package/build-module/components/block-edit/edit.js +2 -2
  360. package/build-module/components/block-edit/edit.js.map +1 -1
  361. package/build-module/components/block-icon/index.js +2 -2
  362. package/build-module/components/block-icon/index.js.map +1 -1
  363. package/build-module/components/block-list/block.js +4 -13
  364. package/build-module/components/block-list/block.js.map +1 -1
  365. package/build-module/components/block-list/block.native.js +2 -2
  366. package/build-module/components/block-list/block.native.js.map +1 -1
  367. package/build-module/components/block-list/index.js +6 -5
  368. package/build-module/components/block-list/index.js.map +1 -1
  369. package/build-module/components/block-list/index.native.js +1 -9
  370. package/build-module/components/block-list/index.native.js.map +1 -1
  371. package/build-module/components/block-list/use-block-props/index.js +11 -8
  372. package/build-module/components/block-list/use-block-props/index.js.map +1 -1
  373. package/build-module/components/block-list/use-block-props/use-block-refs.js +19 -48
  374. package/build-module/components/block-list/use-block-props/use-block-refs.js.map +1 -1
  375. package/build-module/components/block-list/use-block-props/use-is-hovered.js +10 -14
  376. package/build-module/components/block-list/use-block-props/use-is-hovered.js.map +1 -1
  377. package/build-module/components/block-list/use-block-props/use-scroll-into-view.js +37 -0
  378. package/build-module/components/block-list/use-block-props/use-scroll-into-view.js.map +1 -0
  379. package/build-module/components/block-list-appender/index.js +2 -2
  380. package/build-module/components/block-list-appender/index.js.map +1 -1
  381. package/build-module/components/block-mover/button.js +2 -2
  382. package/build-module/components/block-mover/button.js.map +1 -1
  383. package/build-module/components/block-mover/index.js +2 -2
  384. package/build-module/components/block-mover/index.js.map +1 -1
  385. package/build-module/components/block-mover/index.native.js +3 -1
  386. package/build-module/components/block-mover/index.native.js.map +1 -1
  387. package/build-module/components/block-patterns-list/index.js +27 -6
  388. package/build-module/components/block-patterns-list/index.js.map +1 -1
  389. package/build-module/components/block-popover/cover.js +9 -5
  390. package/build-module/components/block-popover/cover.js.map +1 -1
  391. package/build-module/components/block-popover/inbetween.js +2 -2
  392. package/build-module/components/block-popover/inbetween.js.map +1 -1
  393. package/build-module/components/block-popover/index.js +21 -3
  394. package/build-module/components/block-popover/index.js.map +1 -1
  395. package/build-module/components/block-preview/index.js +2 -2
  396. package/build-module/components/block-preview/index.js.map +1 -1
  397. package/build-module/components/block-settings-menu/block-settings-dropdown.js +9 -31
  398. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  399. package/build-module/components/block-settings-menu-controls/index.js +10 -7
  400. package/build-module/components/block-settings-menu-controls/index.js.map +1 -1
  401. package/build-module/components/block-styles/index.js +2 -2
  402. package/build-module/components/block-styles/index.js.map +1 -1
  403. package/build-module/components/block-switcher/pattern-transformations-menu.js +3 -1
  404. package/build-module/components/block-switcher/pattern-transformations-menu.js.map +1 -1
  405. package/build-module/components/block-switcher/use-transformed-patterns.js +6 -2
  406. package/build-module/components/block-switcher/use-transformed-patterns.js.map +1 -1
  407. package/build-module/components/block-switcher/utils.js +15 -5
  408. package/build-module/components/block-switcher/utils.js.map +1 -1
  409. package/build-module/components/block-toolbar/index.js +3 -3
  410. package/build-module/components/block-toolbar/index.js.map +1 -1
  411. package/build-module/components/block-toolbar/use-has-block-toolbar.js +14 -9
  412. package/build-module/components/block-toolbar/use-has-block-toolbar.js.map +1 -1
  413. package/build-module/components/block-tools/block-selection-button.js +2 -2
  414. package/build-module/components/block-tools/block-selection-button.js.map +1 -1
  415. package/build-module/components/block-tools/block-toolbar-breadcrumb.js +4 -4
  416. package/build-module/components/block-tools/block-toolbar-breadcrumb.js.map +1 -1
  417. package/build-module/components/block-tools/block-toolbar-popover.js +2 -2
  418. package/build-module/components/block-tools/block-toolbar-popover.js.map +1 -1
  419. package/build-module/components/block-tools/empty-block-inserter.js +2 -2
  420. package/build-module/components/block-tools/empty-block-inserter.js.map +1 -1
  421. package/build-module/components/block-tools/index.js +23 -2
  422. package/build-module/components/block-tools/index.js.map +1 -1
  423. package/build-module/components/block-tools/insertion-point.js +4 -4
  424. package/build-module/components/block-tools/insertion-point.js.map +1 -1
  425. package/build-module/components/block-tools/use-show-block-tools.js +2 -5
  426. package/build-module/components/block-tools/use-show-block-tools.js.map +1 -1
  427. package/build-module/components/block-tools/zoom-out-mode-inserters.js +69 -21
  428. package/build-module/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
  429. package/build-module/components/block-variation-picker/index.js +5 -4
  430. package/build-module/components/block-variation-picker/index.js.map +1 -1
  431. package/build-module/components/block-variation-transforms/index.js +3 -1
  432. package/build-module/components/block-variation-transforms/index.js.map +1 -1
  433. package/build-module/components/button-block-appender/index.js +2 -2
  434. package/build-module/components/button-block-appender/index.js.map +1 -1
  435. package/build-module/components/child-layout-control/index.js +2 -2
  436. package/build-module/components/child-layout-control/index.js.map +1 -1
  437. package/build-module/components/colors-gradients/control.js +3 -3
  438. package/build-module/components/colors-gradients/control.js.map +1 -1
  439. package/build-module/components/colors-gradients/dropdown.js +2 -2
  440. package/build-module/components/colors-gradients/dropdown.js.map +1 -1
  441. package/build-module/components/colors-gradients/panel-color-gradient-settings.js +2 -2
  442. package/build-module/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
  443. package/build-module/components/convert-to-group-buttons/index.js +7 -1
  444. package/build-module/components/convert-to-group-buttons/index.js.map +1 -1
  445. package/build-module/components/default-block-appender/index.js +2 -2
  446. package/build-module/components/default-block-appender/index.js.map +1 -1
  447. package/build-module/components/dimensions-tool/aspect-ratio-tool.js +30 -36
  448. package/build-module/components/dimensions-tool/aspect-ratio-tool.js.map +1 -1
  449. package/build-module/components/floating-toolbar/index.native.js +9 -5
  450. package/build-module/components/floating-toolbar/index.native.js.map +1 -1
  451. package/build-module/components/global-styles/background-panel.js +4 -4
  452. package/build-module/components/global-styles/background-panel.js.map +1 -1
  453. package/build-module/components/global-styles/color-panel.js +6 -4
  454. package/build-module/components/global-styles/color-panel.js.map +1 -1
  455. package/build-module/components/global-styles/dimensions-panel.js +21 -5
  456. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  457. package/build-module/components/global-styles/filters-panel.js +2 -2
  458. package/build-module/components/global-styles/filters-panel.js.map +1 -1
  459. package/build-module/components/global-styles/hooks.js +3 -2
  460. package/build-module/components/global-styles/hooks.js.map +1 -1
  461. package/build-module/components/global-styles/shadow-panel-components.js +4 -4
  462. package/build-module/components/global-styles/shadow-panel-components.js.map +1 -1
  463. package/build-module/components/global-styles/typography-panel.js +24 -24
  464. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  465. package/build-module/components/global-styles/use-global-styles-output.js +149 -132
  466. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  467. package/build-module/components/global-styles/utils.js +44 -0
  468. package/build-module/components/global-styles/utils.js.map +1 -1
  469. package/build-module/components/grid-visualizer/grid-item-resizer.js +141 -24
  470. package/build-module/components/grid-visualizer/grid-item-resizer.js.map +1 -1
  471. package/build-module/components/grid-visualizer/grid-visualizer.js +12 -6
  472. package/build-module/components/grid-visualizer/grid-visualizer.js.map +1 -1
  473. package/build-module/components/iframe/index.js +70 -31
  474. package/build-module/components/iframe/index.js.map +1 -1
  475. package/build-module/components/image-editor/aspect-ratio-dropdown.js +52 -36
  476. package/build-module/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
  477. package/build-module/components/image-editor/cropper.js +2 -2
  478. package/build-module/components/image-editor/cropper.js.map +1 -1
  479. package/build-module/components/image-editor/index.js +1 -1
  480. package/build-module/components/image-editor/index.js.map +1 -1
  481. package/build-module/components/index.js +1 -0
  482. package/build-module/components/index.js.map +1 -1
  483. package/build-module/components/inner-blocks/button-block-appender.js +2 -2
  484. package/build-module/components/inner-blocks/button-block-appender.js.map +1 -1
  485. package/build-module/components/inner-blocks/index.js +25 -10
  486. package/build-module/components/inner-blocks/index.js.map +1 -1
  487. package/build-module/components/inserter/block-patterns-explorer/pattern-list.js +1 -1
  488. package/build-module/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
  489. package/build-module/components/inserter/block-patterns-tab/index.js +21 -31
  490. package/build-module/components/inserter/block-patterns-tab/index.js.map +1 -1
  491. package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js +1 -1
  492. package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
  493. package/build-module/components/inserter/block-types-tab.js +10 -4
  494. package/build-module/components/inserter/block-types-tab.js.map +1 -1
  495. package/build-module/components/inserter/category-tabs/index.js +49 -0
  496. package/build-module/components/inserter/category-tabs/index.js.map +1 -0
  497. package/build-module/components/inserter/hooks/use-insertion-point.js +11 -2
  498. package/build-module/components/inserter/hooks/use-insertion-point.js.map +1 -1
  499. package/build-module/components/inserter/hooks/use-patterns-state.js +12 -5
  500. package/build-module/components/inserter/hooks/use-patterns-state.js.map +1 -1
  501. package/build-module/components/inserter/index.js +2 -2
  502. package/build-module/components/inserter/index.js.map +1 -1
  503. package/build-module/components/inserter/library.js +8 -2
  504. package/build-module/components/inserter/library.js.map +1 -1
  505. package/build-module/components/inserter/media-tab/index.js +1 -1
  506. package/build-module/components/inserter/media-tab/index.js.map +1 -1
  507. package/build-module/components/inserter/media-tab/media-panel.js +0 -24
  508. package/build-module/components/inserter/media-tab/media-panel.js.map +1 -1
  509. package/build-module/components/inserter/media-tab/media-preview.js +15 -5
  510. package/build-module/components/inserter/media-tab/media-preview.js.map +1 -1
  511. package/build-module/components/inserter/media-tab/media-tab.js +17 -31
  512. package/build-module/components/inserter/media-tab/media-tab.js.map +1 -1
  513. package/build-module/components/inserter/menu.js +117 -111
  514. package/build-module/components/inserter/menu.js.map +1 -1
  515. package/build-module/components/inserter/quick-inserter.js +2 -2
  516. package/build-module/components/inserter/quick-inserter.js.map +1 -1
  517. package/build-module/components/inserter/tabs.js +24 -12
  518. package/build-module/components/inserter/tabs.js.map +1 -1
  519. package/build-module/components/inserter-list-item/index.js +3 -3
  520. package/build-module/components/inserter-list-item/index.js.map +1 -1
  521. package/build-module/components/keyboard-shortcuts/index.js +9 -0
  522. package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
  523. package/build-module/components/line-height-control/index.js +6 -2
  524. package/build-module/components/line-height-control/index.js.map +1 -1
  525. package/build-module/components/link-control/index.js +2 -2
  526. package/build-module/components/link-control/index.js.map +1 -1
  527. package/build-module/components/link-control/link-preview.js +3 -3
  528. package/build-module/components/link-control/link-preview.js.map +1 -1
  529. package/build-module/components/link-control/search-item.js +9 -3
  530. package/build-module/components/link-control/search-item.js.map +1 -1
  531. package/build-module/components/link-control/search-results.js +2 -2
  532. package/build-module/components/link-control/search-results.js.map +1 -1
  533. package/build-module/components/list-view/block-contents.js +2 -2
  534. package/build-module/components/list-view/block-contents.js.map +1 -1
  535. package/build-module/components/list-view/block-select-button.js +17 -174
  536. package/build-module/components/list-view/block-select-button.js.map +1 -1
  537. package/build-module/components/list-view/block.js +198 -23
  538. package/build-module/components/list-view/block.js.map +1 -1
  539. package/build-module/components/list-view/drop-indicator.js +3 -3
  540. package/build-module/components/list-view/drop-indicator.js.map +1 -1
  541. package/build-module/components/list-view/index.js +3 -3
  542. package/build-module/components/list-view/index.js.map +1 -1
  543. package/build-module/components/list-view/leaf.js +2 -2
  544. package/build-module/components/list-view/leaf.js.map +1 -1
  545. package/build-module/components/list-view/use-list-view-drop-zone.js +1 -1
  546. package/build-module/components/list-view/use-list-view-drop-zone.js.map +1 -1
  547. package/build-module/components/list-view/utils.js +3 -1
  548. package/build-module/components/list-view/utils.js.map +1 -1
  549. package/build-module/components/media-placeholder/index.js +7 -7
  550. package/build-module/components/media-placeholder/index.js.map +1 -1
  551. package/build-module/components/media-replace-flow/index.js +2 -2
  552. package/build-module/components/media-replace-flow/index.js.map +1 -1
  553. package/build-module/components/navigable-toolbar/index.js +3 -1
  554. package/build-module/components/navigable-toolbar/index.js.map +1 -1
  555. package/build-module/components/plain-text/index.js +2 -2
  556. package/build-module/components/plain-text/index.js.map +1 -1
  557. package/build-module/components/provider/block-refs-provider.js +3 -4
  558. package/build-module/components/provider/block-refs-provider.js.map +1 -1
  559. package/build-module/components/provider/use-block-sync.js +10 -1
  560. package/build-module/components/provider/use-block-sync.js.map +1 -1
  561. package/build-module/components/responsive-block-control/index.js +2 -2
  562. package/build-module/components/responsive-block-control/index.js.map +1 -1
  563. package/build-module/components/rich-text/event-listeners/before-input-rules.js +86 -0
  564. package/build-module/components/rich-text/event-listeners/before-input-rules.js.map +1 -0
  565. package/build-module/components/rich-text/event-listeners/delete.js +51 -0
  566. package/build-module/components/rich-text/event-listeners/delete.js.map +1 -0
  567. package/build-module/components/rich-text/event-listeners/enter.js +82 -0
  568. package/build-module/components/rich-text/event-listeners/enter.js.map +1 -0
  569. package/build-module/components/rich-text/event-listeners/firefox-compat.js +29 -0
  570. package/build-module/components/rich-text/event-listeners/firefox-compat.js.map +1 -0
  571. package/build-module/components/rich-text/event-listeners/index.js +36 -0
  572. package/build-module/components/rich-text/event-listeners/index.js.map +1 -0
  573. package/build-module/components/rich-text/event-listeners/input-events.js +15 -0
  574. package/build-module/components/rich-text/event-listeners/input-events.js.map +1 -0
  575. package/build-module/components/rich-text/event-listeners/input-rules.js +127 -0
  576. package/build-module/components/rich-text/event-listeners/input-rules.js.map +1 -0
  577. package/build-module/components/rich-text/event-listeners/insert-replacement-text.js +27 -0
  578. package/build-module/components/rich-text/event-listeners/insert-replacement-text.js.map +1 -0
  579. package/build-module/components/rich-text/event-listeners/paste-handler.js +122 -0
  580. package/build-module/components/rich-text/event-listeners/paste-handler.js.map +1 -0
  581. package/build-module/components/rich-text/event-listeners/remove-browser-shortcuts.js +21 -0
  582. package/build-module/components/rich-text/event-listeners/remove-browser-shortcuts.js.map +1 -0
  583. package/build-module/components/rich-text/event-listeners/shortcuts.js +15 -0
  584. package/build-module/components/rich-text/event-listeners/shortcuts.js.map +1 -0
  585. package/build-module/components/rich-text/event-listeners/undo-automatic-change.js +45 -0
  586. package/build-module/components/rich-text/event-listeners/undo-automatic-change.js.map +1 -0
  587. package/build-module/components/rich-text/format-toolbar/index.js +2 -2
  588. package/build-module/components/rich-text/format-toolbar/index.js.map +1 -1
  589. package/build-module/components/rich-text/index.js +21 -34
  590. package/build-module/components/rich-text/index.js.map +1 -1
  591. package/build-module/components/rich-text/index.native.js +15 -5
  592. package/build-module/components/rich-text/index.native.js.map +1 -1
  593. package/build-module/components/rich-text/multiline.js +37 -5
  594. package/build-module/components/rich-text/multiline.js.map +1 -1
  595. package/build-module/components/rich-text/native/index.native.js +12 -0
  596. package/build-module/components/rich-text/native/index.native.js.map +1 -1
  597. package/build-module/components/rich-text/use-format-types.js +8 -4
  598. package/build-module/components/rich-text/use-format-types.js.map +1 -1
  599. package/build-module/components/segmented-text-control/index.js +55 -0
  600. package/build-module/components/segmented-text-control/index.js.map +1 -0
  601. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js +16 -2
  602. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
  603. package/build-module/components/text-alignment-control/index.js +68 -0
  604. package/build-module/components/text-alignment-control/index.js.map +1 -0
  605. package/build-module/components/text-decoration-control/index.js +22 -26
  606. package/build-module/components/text-decoration-control/index.js.map +1 -1
  607. package/build-module/components/text-transform-control/index.js +19 -23
  608. package/build-module/components/text-transform-control/index.js.map +1 -1
  609. package/build-module/components/url-input/index.js +4 -4
  610. package/build-module/components/url-input/index.js.map +1 -1
  611. package/build-module/components/url-popover/link-editor.js +2 -2
  612. package/build-module/components/url-popover/link-editor.js.map +1 -1
  613. package/build-module/components/url-popover/link-viewer-url.js +2 -2
  614. package/build-module/components/url-popover/link-viewer-url.js.map +1 -1
  615. package/build-module/components/url-popover/link-viewer.js +2 -2
  616. package/build-module/components/url-popover/link-viewer.js.map +1 -1
  617. package/build-module/components/use-block-display-information/index.js +9 -3
  618. package/build-module/components/use-block-display-information/index.js.map +1 -1
  619. package/build-module/components/use-on-block-drop/index.js +3 -1
  620. package/build-module/components/use-on-block-drop/index.js.map +1 -1
  621. package/build-module/components/warning/index.js +2 -2
  622. package/build-module/components/warning/index.js.map +1 -1
  623. package/build-module/components/writing-flow/index.js +2 -2
  624. package/build-module/components/writing-flow/index.js.map +1 -1
  625. package/build-module/components/writing-flow/use-clipboard-handler.js +78 -31
  626. package/build-module/components/writing-flow/use-clipboard-handler.js.map +1 -1
  627. package/build-module/components/writing-flow/use-drag-selection.js +3 -1
  628. package/build-module/components/writing-flow/use-drag-selection.js.map +1 -1
  629. package/build-module/components/writing-flow/use-input.js +45 -3
  630. package/build-module/components/writing-flow/use-input.js.map +1 -1
  631. package/build-module/components/writing-flow/use-tab-nav.js +9 -2
  632. package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
  633. package/build-module/components/writing-mode-control/index.js +17 -21
  634. package/build-module/components/writing-mode-control/index.js.map +1 -1
  635. package/build-module/hooks/align.js +2 -2
  636. package/build-module/hooks/align.js.map +1 -1
  637. package/build-module/hooks/background.js +1 -1
  638. package/build-module/hooks/background.js.map +1 -1
  639. package/build-module/hooks/border.js +3 -3
  640. package/build-module/hooks/border.js.map +1 -1
  641. package/build-module/hooks/color.js +3 -3
  642. package/build-module/hooks/color.js.map +1 -1
  643. package/build-module/hooks/content-lock-ui.js +5 -28
  644. package/build-module/hooks/content-lock-ui.js.map +1 -1
  645. package/build-module/hooks/custom-class-name.js +2 -2
  646. package/build-module/hooks/custom-class-name.js.map +1 -1
  647. package/build-module/hooks/custom-class-name.native.js +2 -2
  648. package/build-module/hooks/custom-class-name.native.js.map +1 -1
  649. package/build-module/hooks/dimensions.js +2 -2
  650. package/build-module/hooks/dimensions.js.map +1 -1
  651. package/build-module/hooks/duotone.js +3 -1
  652. package/build-module/hooks/duotone.js.map +1 -1
  653. package/build-module/hooks/layout-child.js +16 -8
  654. package/build-module/hooks/layout-child.js.map +1 -1
  655. package/build-module/hooks/layout.js +2 -2
  656. package/build-module/hooks/layout.js.map +1 -1
  657. package/build-module/hooks/position.js +2 -2
  658. package/build-module/hooks/position.js.map +1 -1
  659. package/build-module/hooks/text-align.js +3 -3
  660. package/build-module/hooks/text-align.js.map +1 -1
  661. package/build-module/hooks/use-bindings-attributes.js +39 -13
  662. package/build-module/hooks/use-bindings-attributes.js.map +1 -1
  663. package/build-module/hooks/use-color-props.js +2 -2
  664. package/build-module/hooks/use-color-props.js.map +1 -1
  665. package/build-module/hooks/use-typography-props.js +2 -2
  666. package/build-module/hooks/use-typography-props.js.map +1 -1
  667. package/build-module/hooks/utils.js +13 -8
  668. package/build-module/hooks/utils.js.map +1 -1
  669. package/build-module/layouts/grid.js +7 -6
  670. package/build-module/layouts/grid.js.map +1 -1
  671. package/build-module/private-apis.js +9 -4
  672. package/build-module/private-apis.js.map +1 -1
  673. package/build-module/store/actions.js +145 -27
  674. package/build-module/store/actions.js.map +1 -1
  675. package/build-module/store/private-actions.js +24 -0
  676. package/build-module/store/private-actions.js.map +1 -1
  677. package/build-module/store/private-keys.js +1 -0
  678. package/build-module/store/private-keys.js.map +1 -1
  679. package/build-module/store/private-selectors.js +32 -5
  680. package/build-module/store/private-selectors.js.map +1 -1
  681. package/build-module/store/reducer.js +11 -8
  682. package/build-module/store/reducer.js.map +1 -1
  683. package/build-module/store/selectors.js +25 -8
  684. package/build-module/store/selectors.js.map +1 -1
  685. package/build-module/utils/object.js +16 -0
  686. package/build-module/utils/object.js.map +1 -1
  687. package/build-module/utils/order-inserter-block-items.js +6 -2
  688. package/build-module/utils/order-inserter-block-items.js.map +1 -1
  689. package/build-module/utils/pasting.js +6 -2
  690. package/build-module/utils/pasting.js.map +1 -1
  691. package/build-module/utils/selection.js +7 -0
  692. package/build-module/utils/selection.js.map +1 -1
  693. package/build-module/utils/transform-styles/index.js +12 -7
  694. package/build-module/utils/transform-styles/index.js.map +1 -1
  695. package/build-style/content-rtl.css +124 -158
  696. package/build-style/content.css +124 -158
  697. package/build-style/style-rtl.css +114 -203
  698. package/build-style/style.css +114 -203
  699. package/build-types/components/block-context/index.d.ts +1 -1
  700. package/build-types/components/block-context/index.d.ts.map +1 -1
  701. package/package.json +32 -32
  702. package/src/components/alignment-control/ui.js +3 -1
  703. package/src/components/block-actions/index.js +5 -1
  704. package/src/components/block-alignment-control/ui.js +2 -2
  705. package/src/components/block-bindings-toolbar-indicator/style.scss +1 -4
  706. package/src/components/block-canvas/style.scss +1 -3
  707. package/src/components/block-card/index.js +2 -2
  708. package/src/components/block-compare/index.js +2 -2
  709. package/src/components/block-content-overlay/content.scss +4 -37
  710. package/src/components/block-edit/edit.js +2 -2
  711. package/src/components/block-icon/index.js +2 -2
  712. package/src/components/block-list/block.js +6 -17
  713. package/src/components/block-list/block.native.js +2 -2
  714. package/src/components/block-list/content.scss +53 -72
  715. package/src/components/block-list/index.js +6 -6
  716. package/src/components/block-list/index.native.js +1 -6
  717. package/src/components/block-list/use-block-props/index.js +16 -6
  718. package/src/components/block-list/use-block-props/use-block-refs.js +17 -57
  719. package/src/components/block-list/use-block-props/use-is-hovered.js +11 -16
  720. package/src/components/block-list/use-block-props/use-scroll-into-view.js +38 -0
  721. package/src/components/block-list-appender/index.js +2 -2
  722. package/src/components/block-mover/button.js +2 -2
  723. package/src/components/block-mover/index.js +2 -2
  724. package/src/components/block-mover/index.native.js +3 -1
  725. package/src/components/block-patterns-list/index.js +29 -4
  726. package/src/components/block-patterns-list/style.scss +1 -3
  727. package/src/components/block-popover/README.md +1 -1
  728. package/src/components/block-popover/cover.js +22 -7
  729. package/src/components/block-popover/inbetween.js +2 -2
  730. package/src/components/block-popover/index.js +24 -6
  731. package/src/components/block-preview/index.js +2 -2
  732. package/src/components/block-preview/style.scss +13 -15
  733. package/src/components/block-settings-menu/block-settings-dropdown.js +15 -57
  734. package/src/components/block-settings-menu-controls/index.js +25 -16
  735. package/src/components/block-styles/index.js +2 -2
  736. package/src/components/block-switcher/pattern-transformations-menu.js +3 -1
  737. package/src/components/block-switcher/use-transformed-patterns.js +6 -2
  738. package/src/components/block-switcher/utils.js +14 -5
  739. package/src/components/block-toolbar/index.js +3 -3
  740. package/src/components/block-toolbar/style.scss +8 -11
  741. package/src/components/block-toolbar/use-has-block-toolbar.js +21 -16
  742. package/src/components/block-tools/block-selection-button.js +2 -2
  743. package/src/components/block-tools/block-toolbar-breadcrumb.js +5 -5
  744. package/src/components/block-tools/block-toolbar-popover.js +4 -7
  745. package/src/components/block-tools/empty-block-inserter.js +2 -2
  746. package/src/components/block-tools/index.js +27 -4
  747. package/src/components/block-tools/insertion-point.js +4 -4
  748. package/src/components/block-tools/style.scss +8 -0
  749. package/src/components/block-tools/use-show-block-tools.js +36 -48
  750. package/src/components/block-tools/zoom-out-mode-inserters.js +74 -18
  751. package/src/components/block-variation-picker/content.scss +22 -72
  752. package/src/components/block-variation-picker/index.js +5 -4
  753. package/src/components/block-variation-transforms/index.js +3 -1
  754. package/src/components/button-block-appender/index.js +2 -2
  755. package/src/components/child-layout-control/index.js +14 -2
  756. package/src/components/colors-gradients/control.js +3 -3
  757. package/src/components/colors-gradients/dropdown.js +2 -2
  758. package/src/components/colors-gradients/panel-color-gradient-settings.js +2 -2
  759. package/src/components/colors-gradients/test/control.js +3 -3
  760. package/src/components/convert-to-group-buttons/index.js +10 -1
  761. package/src/components/default-block-appender/index.js +2 -2
  762. package/src/components/dimensions-tool/aspect-ratio-tool.js +40 -67
  763. package/src/components/dimensions-tool/test/index.js +10 -0
  764. package/src/components/editable-text/README.md +0 -4
  765. package/src/components/floating-toolbar/index.native.js +5 -2
  766. package/src/components/global-styles/background-panel.js +4 -6
  767. package/src/components/global-styles/color-panel.js +6 -4
  768. package/src/components/global-styles/dimensions-panel.js +22 -5
  769. package/src/components/global-styles/filters-panel.js +2 -2
  770. package/src/components/global-styles/hooks.js +2 -0
  771. package/src/components/global-styles/shadow-panel-components.js +6 -9
  772. package/src/components/global-styles/test/get-global-styles-changes.js +0 -2
  773. package/src/components/global-styles/test/use-global-styles-output.js +5 -5
  774. package/src/components/global-styles/test/utils.js +21 -0
  775. package/src/components/global-styles/typography-panel.js +27 -23
  776. package/src/components/global-styles/use-global-styles-output.js +211 -187
  777. package/src/components/global-styles/utils.js +55 -0
  778. package/src/components/grid-visualizer/grid-item-resizer.js +169 -40
  779. package/src/components/grid-visualizer/grid-visualizer.js +19 -6
  780. package/src/components/iframe/content.scss +63 -0
  781. package/src/components/iframe/index.js +119 -39
  782. package/src/components/image-editor/aspect-ratio-dropdown.js +91 -59
  783. package/src/components/image-editor/cropper.js +2 -2
  784. package/src/components/image-editor/index.js +1 -1
  785. package/src/components/image-editor/test/index.js +22 -0
  786. package/src/components/index.js +1 -0
  787. package/src/components/inner-blocks/button-block-appender.js +2 -2
  788. package/src/components/inner-blocks/index.js +24 -9
  789. package/src/components/inserter/block-patterns-explorer/pattern-list.js +2 -1
  790. package/src/components/inserter/block-patterns-tab/index.js +30 -64
  791. package/src/components/inserter/block-patterns-tab/pattern-category-previews.js +2 -1
  792. package/src/components/inserter/block-types-tab.js +12 -9
  793. package/src/components/inserter/category-tabs/index.js +74 -0
  794. package/src/components/inserter/hooks/use-insertion-point.js +15 -1
  795. package/src/components/inserter/hooks/use-patterns-state.js +18 -5
  796. package/src/components/inserter/index.js +4 -5
  797. package/src/components/inserter/library.js +6 -0
  798. package/src/components/inserter/media-tab/index.js +1 -1
  799. package/src/components/inserter/media-tab/media-panel.js +0 -22
  800. package/src/components/inserter/media-tab/media-preview.js +17 -9
  801. package/src/components/inserter/media-tab/media-tab.js +44 -83
  802. package/src/components/inserter/menu.js +168 -140
  803. package/src/components/inserter/quick-inserter.js +2 -2
  804. package/src/components/inserter/style.scss +96 -178
  805. package/src/components/inserter/tabs.js +33 -27
  806. package/src/components/inserter-list-item/index.js +3 -3
  807. package/src/components/keyboard-shortcuts/index.js +12 -0
  808. package/src/components/line-height-control/index.js +6 -2
  809. package/src/components/line-height-control/test/index.js +16 -14
  810. package/src/components/link-control/index.js +2 -2
  811. package/src/components/link-control/link-preview.js +3 -3
  812. package/src/components/link-control/search-item.js +9 -3
  813. package/src/components/link-control/search-results.js +2 -2
  814. package/src/components/list-view/block-contents.js +2 -2
  815. package/src/components/list-view/block-select-button.js +85 -267
  816. package/src/components/list-view/block.js +240 -26
  817. package/src/components/list-view/drop-indicator.js +3 -3
  818. package/src/components/list-view/index.js +3 -3
  819. package/src/components/list-view/leaf.js +2 -5
  820. package/src/components/list-view/style.scss +20 -28
  821. package/src/components/list-view/use-list-view-drop-zone.js +1 -1
  822. package/src/components/list-view/utils.js +3 -1
  823. package/src/components/media-placeholder/content.scss +0 -11
  824. package/src/components/media-placeholder/index.js +7 -7
  825. package/src/components/media-replace-flow/index.js +2 -2
  826. package/src/components/navigable-toolbar/index.js +3 -1
  827. package/src/components/plain-text/index.js +2 -2
  828. package/src/components/provider/block-refs-provider.js +3 -8
  829. package/src/components/provider/test/use-block-sync.js +7 -0
  830. package/src/components/provider/use-block-sync.js +10 -1
  831. package/src/components/responsive-block-control/index.js +2 -2
  832. package/src/components/rich-text/README.md +0 -8
  833. package/src/components/rich-text/event-listeners/before-input-rules.js +92 -0
  834. package/src/components/rich-text/event-listeners/delete.js +53 -0
  835. package/src/components/rich-text/event-listeners/enter.js +84 -0
  836. package/src/components/rich-text/event-listeners/firefox-compat.js +31 -0
  837. package/src/components/rich-text/event-listeners/index.js +56 -0
  838. package/src/components/rich-text/event-listeners/input-events.js +13 -0
  839. package/src/components/rich-text/event-listeners/input-rules.js +146 -0
  840. package/src/components/rich-text/event-listeners/insert-replacement-text.js +28 -0
  841. package/src/components/rich-text/event-listeners/paste-handler.js +132 -0
  842. package/src/components/rich-text/event-listeners/remove-browser-shortcuts.js +24 -0
  843. package/src/components/rich-text/event-listeners/shortcuts.js +13 -0
  844. package/src/components/rich-text/event-listeners/undo-automatic-change.js +45 -0
  845. package/src/components/rich-text/format-toolbar/index.js +2 -2
  846. package/src/components/rich-text/index.js +17 -37
  847. package/src/components/rich-text/index.native.js +13 -2
  848. package/src/components/rich-text/multiline.js +37 -5
  849. package/src/components/rich-text/native/index.native.js +11 -0
  850. package/src/components/rich-text/use-format-types.js +6 -2
  851. package/src/components/segmented-text-control/index.js +63 -0
  852. package/src/components/{writing-mode-control → segmented-text-control}/style.scss +2 -5
  853. package/src/components/spacing-sizes-control/input-controls/spacing-input-control.js +16 -1
  854. package/src/components/text-alignment-control/index.js +91 -0
  855. package/src/components/text-alignment-control/stories/index.story.js +39 -0
  856. package/src/components/text-decoration-control/index.js +22 -35
  857. package/src/components/text-transform-control/index.js +19 -32
  858. package/src/components/url-input/index.js +4 -4
  859. package/src/components/url-popover/link-editor.js +2 -2
  860. package/src/components/url-popover/link-viewer-url.js +2 -2
  861. package/src/components/url-popover/link-viewer.js +2 -2
  862. package/src/components/use-block-display-information/index.js +9 -3
  863. package/src/components/use-on-block-drop/index.js +3 -1
  864. package/src/components/warning/index.js +2 -2
  865. package/src/components/writing-flow/index.js +2 -2
  866. package/src/components/writing-flow/use-clipboard-handler.js +107 -47
  867. package/src/components/writing-flow/use-drag-selection.js +3 -1
  868. package/src/components/writing-flow/use-input.js +75 -1
  869. package/src/components/writing-flow/use-tab-nav.js +13 -2
  870. package/src/components/writing-mode-control/index.js +17 -33
  871. package/src/content.scss +1 -0
  872. package/src/hooks/align.js +2 -2
  873. package/src/hooks/background.js +1 -1
  874. package/src/hooks/border.js +3 -3
  875. package/src/hooks/color.js +12 -19
  876. package/src/hooks/color.scss +1 -0
  877. package/src/hooks/content-lock-ui.js +16 -33
  878. package/src/hooks/custom-class-name.js +2 -2
  879. package/src/hooks/custom-class-name.native.js +2 -2
  880. package/src/hooks/dimensions.js +2 -2
  881. package/src/hooks/duotone.js +3 -1
  882. package/src/hooks/layout-child.js +34 -20
  883. package/src/hooks/layout.js +2 -2
  884. package/src/hooks/position.js +2 -2
  885. package/src/hooks/text-align.js +3 -3
  886. package/src/hooks/use-bindings-attributes.js +48 -16
  887. package/src/hooks/use-color-props.js +2 -2
  888. package/src/hooks/use-typography-props.js +2 -2
  889. package/src/hooks/utils.js +18 -4
  890. package/src/layouts/grid.js +3 -7
  891. package/src/private-apis.js +8 -2
  892. package/src/store/actions.js +233 -54
  893. package/src/store/private-actions.js +24 -0
  894. package/src/store/private-keys.js +1 -0
  895. package/src/store/private-selectors.js +43 -4
  896. package/src/store/reducer.js +13 -23
  897. package/src/store/selectors.js +24 -9
  898. package/src/style.scss +1 -2
  899. package/src/utils/object.js +16 -0
  900. package/src/utils/order-inserter-block-items.js +6 -2
  901. package/src/utils/pasting.js +6 -2
  902. package/src/utils/selection.js +8 -0
  903. package/src/utils/test/__snapshots__/transform-styles.js.snap +6 -0
  904. package/src/utils/test/transform-styles.js +14 -0
  905. package/src/utils/transform-styles/index.js +12 -9
  906. package/tsconfig.tsbuildinfo +1 -1
  907. package/build/components/block-list/use-block-props/use-block-moving-mode-class-names.js +0 -54
  908. package/build/components/block-list/use-block-props/use-block-moving-mode-class-names.js.map +0 -1
  909. package/build/components/rich-text/split-value.js +0 -81
  910. package/build/components/rich-text/split-value.js.map +0 -1
  911. package/build/components/rich-text/use-before-input-rules.js +0 -98
  912. package/build/components/rich-text/use-before-input-rules.js.map +0 -1
  913. package/build/components/rich-text/use-delete.js +0 -64
  914. package/build/components/rich-text/use-delete.js.map +0 -1
  915. package/build/components/rich-text/use-enter.js +0 -109
  916. package/build/components/rich-text/use-enter.js.map +0 -1
  917. package/build/components/rich-text/use-firefox-compat.js +0 -44
  918. package/build/components/rich-text/use-firefox-compat.js.map +0 -1
  919. package/build/components/rich-text/use-input-events.js +0 -25
  920. package/build/components/rich-text/use-input-events.js.map +0 -1
  921. package/build/components/rich-text/use-input-rules.js +0 -139
  922. package/build/components/rich-text/use-input-rules.js.map +0 -1
  923. package/build/components/rich-text/use-insert-replacement-text.js +0 -38
  924. package/build/components/rich-text/use-insert-replacement-text.js.map +0 -1
  925. package/build/components/rich-text/use-paste-handler.js +0 -158
  926. package/build/components/rich-text/use-paste-handler.js.map +0 -1
  927. package/build/components/rich-text/use-remove-browser-shortcuts.js +0 -32
  928. package/build/components/rich-text/use-remove-browser-shortcuts.js.map +0 -1
  929. package/build/components/rich-text/use-shortcuts.js +0 -25
  930. package/build/components/rich-text/use-shortcuts.js.map +0 -1
  931. package/build/components/rich-text/use-undo-automatic-change.js +0 -53
  932. package/build/components/rich-text/use-undo-automatic-change.js.map +0 -1
  933. package/build-module/components/block-list/use-block-props/use-block-moving-mode-class-names.js +0 -47
  934. package/build-module/components/block-list/use-block-props/use-block-moving-mode-class-names.js.map +0 -1
  935. package/build-module/components/rich-text/split-value.js +0 -75
  936. package/build-module/components/rich-text/split-value.js.map +0 -1
  937. package/build-module/components/rich-text/use-before-input-rules.js +0 -92
  938. package/build-module/components/rich-text/use-before-input-rules.js.map +0 -1
  939. package/build-module/components/rich-text/use-delete.js +0 -57
  940. package/build-module/components/rich-text/use-delete.js.map +0 -1
  941. package/build-module/components/rich-text/use-enter.js +0 -102
  942. package/build-module/components/rich-text/use-enter.js.map +0 -1
  943. package/build-module/components/rich-text/use-firefox-compat.js +0 -37
  944. package/build-module/components/rich-text/use-firefox-compat.js.map +0 -1
  945. package/build-module/components/rich-text/use-input-events.js +0 -18
  946. package/build-module/components/rich-text/use-input-events.js.map +0 -1
  947. package/build-module/components/rich-text/use-input-rules.js +0 -132
  948. package/build-module/components/rich-text/use-input-rules.js.map +0 -1
  949. package/build-module/components/rich-text/use-insert-replacement-text.js +0 -32
  950. package/build-module/components/rich-text/use-insert-replacement-text.js.map +0 -1
  951. package/build-module/components/rich-text/use-paste-handler.js +0 -152
  952. package/build-module/components/rich-text/use-paste-handler.js.map +0 -1
  953. package/build-module/components/rich-text/use-remove-browser-shortcuts.js +0 -26
  954. package/build-module/components/rich-text/use-remove-browser-shortcuts.js.map +0 -1
  955. package/build-module/components/rich-text/use-shortcuts.js +0 -18
  956. package/build-module/components/rich-text/use-shortcuts.js.map +0 -1
  957. package/build-module/components/rich-text/use-undo-automatic-change.js +0 -46
  958. package/build-module/components/rich-text/use-undo-automatic-change.js.map +0 -1
  959. package/src/components/block-list/use-block-props/use-block-moving-mode-class-names.js +0 -55
  960. package/src/components/rich-text/split-value.js +0 -64
  961. package/src/components/rich-text/use-before-input-rules.js +0 -99
  962. package/src/components/rich-text/use-delete.js +0 -59
  963. package/src/components/rich-text/use-enter.js +0 -110
  964. package/src/components/rich-text/use-firefox-compat.js +0 -39
  965. package/src/components/rich-text/use-input-events.js +0 -19
  966. package/src/components/rich-text/use-input-rules.js +0 -150
  967. package/src/components/rich-text/use-insert-replacement-text.js +0 -31
  968. package/src/components/rich-text/use-paste-handler.js +0 -180
  969. package/src/components/rich-text/use-remove-browser-shortcuts.js +0 -29
  970. package/src/components/rich-text/use-shortcuts.js +0 -19
  971. package/src/components/rich-text/use-undo-automatic-change.js +0 -46
  972. package/src/components/text-decoration-control/style.scss +0 -18
  973. package/src/components/text-transform-control/style.scss +0 -18
@@ -1 +1 @@
1
- {"version":3,"names":["_element","require","_undoIgnore","_index","_lockUnlock","castArray","maybeArray","Array","isArray","privateSettings","__experimentalUpdateSettings","settings","stripExperimentalSettings","reset","cleanSettings","Platform","OS","key","includes","type","hideBlockInterface","showBlockInterface","privateRemoveBlocks","clientIds","selectPrevious","forceRemove","select","dispatch","registry","length","rootClientId","getBlockRootClientId","canRemoveBlocks","rules","getBlockRemovalRules","flattenBlocks","blocks","result","stack","innerBlocks","block","shift","push","blockList","map","getBlock","flattenedBlocks","message","rule","callback","displayBlockRemovalPrompt","selectPreviousBlock","batch","ensureDefaultBlock","exports","count","getBlockCount","__unstableHasCustomAppender","getSettings","insertDefaultBlock","clearBlockRemovalPrompt","setBlockRemovalRules","setOpenedBlockSettingsMenu","clientId","setStyleOverride","id","style","deleteStyleOverride","syncDerivedUpdates","isPersistentChange","undefined","updatedBlocks","getBlocks","undoIgnoreBlocks","add","setLastFocus","lastFocus","stopEditingAsBlocks","focusModeToRevert","unlock","blockEditorStore","getTemporarilyEditingFocusModeToRevert","__unstableMarkNextChangeAsNotPersistent","updateBlockAttributes","templateLock","updateBlockListSettings","getBlockListSettings","updateSettings","focusMode","__unstableSetTemporarilyEditingAsBlocks","startDragging","stopDragging","expandBlock"],"sources":["@wordpress/block-editor/src/store/private-actions.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Platform } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { undoIgnoreBlocks } from './undo-ignore';\nimport { store as blockEditorStore } from './index';\nimport { unlock } from '../lock-unlock';\n\nconst castArray = ( maybeArray ) =>\n\tArray.isArray( maybeArray ) ? maybeArray : [ maybeArray ];\n\n/**\n * A list of private/experimental block editor settings that\n * should not become a part of the WordPress public API.\n * BlockEditorProvider will remove these settings from the\n * settings object it receives.\n *\n * @see https://github.com/WordPress/gutenberg/pull/46131\n */\nconst privateSettings = [\n\t'inserterMediaCategories',\n\t'blockInspectorAnimation',\n];\n\n/**\n * Action that updates the block editor settings and\n * conditionally preserves the experimental ones.\n *\n * @param {Object} settings Updated settings\n * @param {Object} options Options object.\n * @param {boolean} options.stripExperimentalSettings Whether to strip experimental settings.\n * @param {boolean} options.reset Whether to reset the settings.\n * @return {Object} Action object\n */\nexport function __experimentalUpdateSettings(\n\tsettings,\n\t{ stripExperimentalSettings = false, reset = false } = {}\n) {\n\tlet cleanSettings = settings;\n\t// There are no plugins in the mobile apps, so there is no\n\t// need to strip the experimental settings:\n\tif ( stripExperimentalSettings && Platform.OS === 'web' ) {\n\t\tcleanSettings = {};\n\t\tfor ( const key in settings ) {\n\t\t\tif ( ! privateSettings.includes( key ) ) {\n\t\t\t\tcleanSettings[ key ] = settings[ key ];\n\t\t\t}\n\t\t}\n\t}\n\treturn {\n\t\ttype: 'UPDATE_SETTINGS',\n\t\tsettings: cleanSettings,\n\t\treset,\n\t};\n}\n\n/**\n * Hides the block interface (eg. toolbar, outline, etc.)\n *\n * @return {Object} Action object.\n */\nexport function hideBlockInterface() {\n\treturn {\n\t\ttype: 'HIDE_BLOCK_INTERFACE',\n\t};\n}\n\n/**\n * Shows the block interface (eg. toolbar, outline, etc.)\n *\n * @return {Object} Action object.\n */\nexport function showBlockInterface() {\n\treturn {\n\t\ttype: 'SHOW_BLOCK_INTERFACE',\n\t};\n}\n\n/**\n * Yields action objects used in signalling that the blocks corresponding to\n * the set of specified client IDs are to be removed.\n *\n * Compared to `removeBlocks`, this private interface exposes an additional\n * parameter; see `forceRemove`.\n *\n * @param {string|string[]} clientIds Client IDs of blocks to remove.\n * @param {boolean} selectPrevious True if the previous block\n * or the immediate parent\n * (if no previous block exists)\n * should be selected\n * when a block is removed.\n * @param {boolean} forceRemove Whether to force the operation,\n * bypassing any checks for certain\n * block types.\n */\nexport const privateRemoveBlocks =\n\t( clientIds, selectPrevious = true, forceRemove = false ) =>\n\t( { select, dispatch, registry } ) => {\n\t\tif ( ! clientIds || ! clientIds.length ) {\n\t\t\treturn;\n\t\t}\n\n\t\tclientIds = castArray( clientIds );\n\t\tconst rootClientId = select.getBlockRootClientId( clientIds[ 0 ] );\n\t\tconst canRemoveBlocks = select.canRemoveBlocks(\n\t\t\tclientIds,\n\t\t\trootClientId\n\t\t);\n\n\t\tif ( ! canRemoveBlocks ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// In certain editing contexts, we'd like to prevent accidental removal\n\t\t// of important blocks. For example, in the site editor, the Query Loop\n\t\t// block is deemed important. In such cases, we'll ask the user for\n\t\t// confirmation that they intended to remove such block(s). However,\n\t\t// the editor instance is responsible for presenting those confirmation\n\t\t// prompts to the user. Any instance opting into removal prompts must\n\t\t// register using `setBlockRemovalRules()`.\n\t\t//\n\t\t// @see https://github.com/WordPress/gutenberg/pull/51145\n\t\tconst rules = ! forceRemove && select.getBlockRemovalRules();\n\n\t\tif ( rules ) {\n\t\t\tfunction flattenBlocks( blocks ) {\n\t\t\t\tconst result = [];\n\t\t\t\tconst stack = [ ...blocks ];\n\t\t\t\twhile ( stack.length ) {\n\t\t\t\t\tconst { innerBlocks, ...block } = stack.shift();\n\t\t\t\t\tstack.push( ...innerBlocks );\n\t\t\t\t\tresult.push( block );\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tconst blockList = clientIds.map( select.getBlock );\n\t\t\tconst flattenedBlocks = flattenBlocks( blockList );\n\n\t\t\t// Find the first message and use it.\n\t\t\tlet message;\n\t\t\tfor ( const rule of rules ) {\n\t\t\t\tmessage = rule.callback( flattenedBlocks );\n\t\t\t\tif ( message ) {\n\t\t\t\t\tdispatch(\n\t\t\t\t\t\tdisplayBlockRemovalPrompt(\n\t\t\t\t\t\t\tclientIds,\n\t\t\t\t\t\t\tselectPrevious,\n\t\t\t\t\t\t\tmessage\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( selectPrevious ) {\n\t\t\tdispatch.selectPreviousBlock( clientIds[ 0 ], selectPrevious );\n\t\t}\n\n\t\t// We're batching these two actions because an extra `undo/redo` step can\n\t\t// be created, based on whether we insert a default block or not.\n\t\tregistry.batch( () => {\n\t\t\tdispatch( { type: 'REMOVE_BLOCKS', clientIds } );\n\t\t\t// To avoid a focus loss when removing the last block, assure there is\n\t\t\t// always a default block if the last of the blocks have been removed.\n\t\t\tdispatch( ensureDefaultBlock() );\n\t\t} );\n\t};\n\n/**\n * Action which will insert a default block insert action if there\n * are no other blocks at the root of the editor. This action should be used\n * in actions which may result in no blocks remaining in the editor (removal,\n * replacement, etc).\n */\nexport const ensureDefaultBlock =\n\t() =>\n\t( { select, dispatch } ) => {\n\t\t// To avoid a focus loss when removing the last block, assure there is\n\t\t// always a default block if the last of the blocks have been removed.\n\t\tconst count = select.getBlockCount();\n\t\tif ( count > 0 ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If there's an custom appender, don't insert default block.\n\t\t// We have to remember to manually move the focus elsewhere to\n\t\t// prevent it from being lost though.\n\t\tconst { __unstableHasCustomAppender } = select.getSettings();\n\t\tif ( __unstableHasCustomAppender ) {\n\t\t\treturn;\n\t\t}\n\n\t\tdispatch.insertDefaultBlock();\n\t};\n\n/**\n * Returns an action object used in signalling that a block removal prompt must\n * be displayed.\n *\n * Contrast with `setBlockRemovalRules`.\n *\n * @param {string|string[]} clientIds Client IDs of blocks to remove.\n * @param {boolean} selectPrevious True if the previous block or the\n * immediate parent (if no previous\n * block exists) should be selected\n * when a block is removed.\n * @param {string} message Message to display in the prompt.\n *\n * @return {Object} Action object.\n */\nfunction displayBlockRemovalPrompt( clientIds, selectPrevious, message ) {\n\treturn {\n\t\ttype: 'DISPLAY_BLOCK_REMOVAL_PROMPT',\n\t\tclientIds,\n\t\tselectPrevious,\n\t\tmessage,\n\t};\n}\n\n/**\n * Returns an action object used in signalling that a block removal prompt must\n * be cleared, either be cause the user has confirmed or canceled the request\n * for removal.\n *\n * @return {Object} Action object.\n */\nexport function clearBlockRemovalPrompt() {\n\treturn {\n\t\ttype: 'CLEAR_BLOCK_REMOVAL_PROMPT',\n\t};\n}\n\n/**\n * Returns an action object used to set up any rules that a block editor may\n * provide in order to prevent a user from accidentally removing certain\n * blocks. These rules are then used to display a confirmation prompt to the\n * user. For instance, in the Site Editor, the Query Loop block is important\n * enough to warrant such confirmation.\n *\n * IMPORTANT: Registering rules implicitly signals to the `privateRemoveBlocks`\n * action that the editor will be responsible for displaying block removal\n * prompts and confirming deletions. This action is meant to be used by\n * component `BlockRemovalWarningModal` only.\n *\n * The data is a record whose keys are block types (e.g. 'core/query') and\n * whose values are the explanation to be shown to users (e.g. 'Query Loop\n * displays a list of posts or pages.').\n *\n * Contrast with `displayBlockRemovalPrompt`.\n *\n * @param {Record<string,string>|false} rules Block removal rules.\n * @return {Object} Action object.\n */\nexport function setBlockRemovalRules( rules = false ) {\n\treturn {\n\t\ttype: 'SET_BLOCK_REMOVAL_RULES',\n\t\trules,\n\t};\n}\n\n/**\n * Sets the client ID of the block settings menu that is currently open.\n *\n * @param {?string} clientId The block client ID.\n * @return {Object} Action object.\n */\nexport function setOpenedBlockSettingsMenu( clientId ) {\n\treturn {\n\t\ttype: 'SET_OPENED_BLOCK_SETTINGS_MENU',\n\t\tclientId,\n\t};\n}\n\nexport function setStyleOverride( id, style ) {\n\treturn {\n\t\ttype: 'SET_STYLE_OVERRIDE',\n\t\tid,\n\t\tstyle,\n\t};\n}\n\nexport function deleteStyleOverride( id ) {\n\treturn {\n\t\ttype: 'DELETE_STYLE_OVERRIDE',\n\t\tid,\n\t};\n}\n\n/**\n * A higher-order action that mark every change inside a callback as \"non-persistent\"\n * and ignore pushing to the undo history stack. It's primarily used for synchronized\n * derived updates from the block editor without affecting the undo history.\n *\n * @param {() => void} callback The synchronous callback to derive updates.\n */\nexport function syncDerivedUpdates( callback ) {\n\treturn ( { dispatch, select, registry } ) => {\n\t\tregistry.batch( () => {\n\t\t\t// Mark every change in the `callback` as non-persistent.\n\t\t\tdispatch( {\n\t\t\t\ttype: 'SET_EXPLICIT_PERSISTENT',\n\t\t\t\tisPersistentChange: false,\n\t\t\t} );\n\t\t\tcallback();\n\t\t\tdispatch( {\n\t\t\t\ttype: 'SET_EXPLICIT_PERSISTENT',\n\t\t\t\tisPersistentChange: undefined,\n\t\t\t} );\n\n\t\t\t// Ignore pushing undo stack for the updated blocks.\n\t\t\tconst updatedBlocks = select.getBlocks();\n\t\t\tundoIgnoreBlocks.add( updatedBlocks );\n\t\t} );\n\t};\n}\n\n/**\n * Action that sets the element that had focus when focus leaves the editor canvas.\n *\n * @param {Object} lastFocus The last focused element.\n *\n *\n * @return {Object} Action object.\n */\nexport function setLastFocus( lastFocus = null ) {\n\treturn {\n\t\ttype: 'LAST_FOCUS',\n\t\tlastFocus,\n\t};\n}\n\n/**\n * Action that stops temporarily editing as blocks.\n *\n * @param {string} clientId The block's clientId.\n */\nexport function stopEditingAsBlocks( clientId ) {\n\treturn ( { select, dispatch, registry } ) => {\n\t\tconst focusModeToRevert = unlock(\n\t\t\tregistry.select( blockEditorStore )\n\t\t).getTemporarilyEditingFocusModeToRevert();\n\t\tdispatch.__unstableMarkNextChangeAsNotPersistent();\n\t\tdispatch.updateBlockAttributes( clientId, {\n\t\t\ttemplateLock: 'contentOnly',\n\t\t} );\n\t\tdispatch.updateBlockListSettings( clientId, {\n\t\t\t...select.getBlockListSettings( clientId ),\n\t\t\ttemplateLock: 'contentOnly',\n\t\t} );\n\t\tdispatch.updateSettings( { focusMode: focusModeToRevert } );\n\t\tdispatch.__unstableSetTemporarilyEditingAsBlocks();\n\t};\n}\n\n/**\n * Returns an action object used in signalling that the user has begun to drag.\n *\n * @return {Object} Action object.\n */\nexport function startDragging() {\n\treturn {\n\t\ttype: 'START_DRAGGING',\n\t};\n}\n\n/**\n * Returns an action object used in signalling that the user has stopped dragging.\n *\n * @return {Object} Action object.\n */\nexport function stopDragging() {\n\treturn {\n\t\ttype: 'STOP_DRAGGING',\n\t};\n}\n\n/**\n * @param {string|null} clientId The block's clientId, or `null` to clear.\n *\n * @return {Object} Action object.\n */\nexport function expandBlock( clientId ) {\n\treturn {\n\t\ttype: 'SET_BLOCK_EXPANDED_IN_LIST_VI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AG;EACvC,OAAO;IACN5C,IAAI,EAAE,iCAAiC;IACvC4C;EACD,CAAC;AACF","ignoreList":[]}
1
+ {"version":3,"names":["_element","require","_undoIgnore","_index","_lockUnlock","castArray","maybeArray","Array","isArray","privateSettings","__experimentalUpdateSettings","settings","stripExperimentalSettings","reset","cleanSettings","Platform","OS","key","includes","type","hideBlockInterface","showBlockInterface","privateRemoveBlocks","clientIds","selectPrevious","forceRemove","select","dispatch","registry","length","rootClientId","getBlockRootClientId","canRemoveBlocks","rules","getBlockRemovalRules","flattenBlocks","blocks","result","stack","innerBlocks","block","shift","push","blockList","map","getBlock","flattenedBlocks","message","rule","callback","displayBlockRemovalPrompt","selectPreviousBlock","batch","ensureDefaultBlock","exports","count","getBlockCount","__unstableHasCustomAppender","getSettings","insertDefaultBlock","clearBlockRemovalPrompt","setBlockRemovalRules","setOpenedBlockSettingsMenu","clientId","setStyleOverride","id","style","deleteStyleOverride","syncDerivedUpdates","isPersistentChange","undefined","updatedBlocks","getBlocks","undoIgnoreBlocks","add","setLastFocus","lastFocus","stopEditingAsBlocks","focusModeToRevert","unlock","blockEditorStore","getTemporarilyEditingFocusModeToRevert","__unstableMarkNextChangeAsNotPersistent","updateBlockAttributes","templateLock","updateBlockListSettings","getBlockListSettings","updateSettings","focusMode","__unstableSetTemporarilyEditingAsBlocks","startDragging","stopDragging","expandBlock","modifyContentLockBlock"],"sources":["@wordpress/block-editor/src/store/private-actions.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Platform } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { undoIgnoreBlocks } from './undo-ignore';\nimport { store as blockEditorStore } from './index';\nimport { unlock } from '../lock-unlock';\n\nconst castArray = ( maybeArray ) =>\n\tArray.isArray( maybeArray ) ? maybeArray : [ maybeArray ];\n\n/**\n * A list of private/experimental block editor settings that\n * should not become a part of the WordPress public API.\n * BlockEditorProvider will remove these settings from the\n * settings object it receives.\n *\n * @see https://github.com/WordPress/gutenberg/pull/46131\n */\nconst privateSettings = [\n\t'inserterMediaCategories',\n\t'blockInspectorAnimation',\n];\n\n/**\n * Action that updates the block editor settings and\n * conditionally preserves the experimental ones.\n *\n * @param {Object} settings Updated settings\n * @param {Object} options Options object.\n * @param {boolean} options.stripExperimentalSettings Whether to strip experimental settings.\n * @param {boolean} options.reset Whether to reset the settings.\n * @return {Object} Action object\n */\nexport function __experimentalUpdateSettings(\n\tsettings,\n\t{ stripExperimentalSettings = false, reset = false } = {}\n) {\n\tlet cleanSettings = settings;\n\t// There are no plugins in the mobile apps, so there is no\n\t// need to strip the experimental settings:\n\tif ( stripExperimentalSettings && Platform.OS === 'web' ) {\n\t\tcleanSettings = {};\n\t\tfor ( const key in settings ) {\n\t\t\tif ( ! privateSettings.includes( key ) ) {\n\t\t\t\tcleanSettings[ key ] = settings[ key ];\n\t\t\t}\n\t\t}\n\t}\n\treturn {\n\t\ttype: 'UPDATE_SETTINGS',\n\t\tsettings: cleanSettings,\n\t\treset,\n\t};\n}\n\n/**\n * Hides the block interface (eg. toolbar, outline, etc.)\n *\n * @return {Object} Action object.\n */\nexport function hideBlockInterface() {\n\treturn {\n\t\ttype: 'HIDE_BLOCK_INTERFACE',\n\t};\n}\n\n/**\n * Shows the block interface (eg. toolbar, outline, etc.)\n *\n * @return {Object} Action object.\n */\nexport function showBlockInterface() {\n\treturn {\n\t\ttype: 'SHOW_BLOCK_INTERFACE',\n\t};\n}\n\n/**\n * Yields action objects used in signalling that the blocks corresponding to\n * the set of specified client IDs are to be removed.\n *\n * Compared to `removeBlocks`, this private interface exposes an additional\n * parameter; see `forceRemove`.\n *\n * @param {string|string[]} clientIds Client IDs of blocks to remove.\n * @param {boolean} selectPrevious True if the previous block\n * or the immediate parent\n * (if no previous block exists)\n * should be selected\n * when a block is removed.\n * @param {boolean} forceRemove Whether to force the operation,\n * bypassing any checks for certain\n * block types.\n */\nexport const privateRemoveBlocks =\n\t( clientIds, selectPrevious = true, forceRemove = false ) =>\n\t( { select, dispatch, registry } ) => {\n\t\tif ( ! clientIds || ! clientIds.length ) {\n\t\t\treturn;\n\t\t}\n\n\t\tclientIds = castArray( clientIds );\n\t\tconst rootClientId = select.getBlockRootClientId( clientIds[ 0 ] );\n\t\tconst canRemoveBlocks = select.canRemoveBlocks(\n\t\t\tclientIds,\n\t\t\trootClientId\n\t\t);\n\n\t\tif ( ! canRemoveBlocks ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// In certain editing contexts, we'd like to prevent accidental removal\n\t\t// of important blocks. For example, in the site editor, the Query Loop\n\t\t// block is deemed important. In such cases, we'll ask the user for\n\t\t// confirmation that they intended to remove such block(s). However,\n\t\t// the editor instance is responsible for presenting those confirmation\n\t\t// prompts to the user. Any instance opting into removal prompts must\n\t\t// register using `setBlockRemovalRules()`.\n\t\t//\n\t\t// @see https://github.com/WordPress/gutenberg/pull/51145\n\t\tconst rules = ! forceRemove && select.getBlockRemovalRules();\n\n\t\tif ( rules ) {\n\t\t\tfunction flattenBlocks( blocks ) {\n\t\t\t\tconst result = [];\n\t\t\t\tconst stack = [ ...blocks ];\n\t\t\t\twhile ( stack.length ) {\n\t\t\t\t\tconst { innerBlocks, ...block } = stack.shift();\n\t\t\t\t\tstack.push( ...innerBlocks );\n\t\t\t\t\tresult.push( block );\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tconst blockList = clientIds.map( select.getBlock );\n\t\t\tconst flattenedBlocks = flattenBlocks( blockList );\n\n\t\t\t// Find the first message and use it.\n\t\t\tlet message;\n\t\t\tfor ( const rule of rules ) {\n\t\t\t\tmessage = rule.callback( flattenedBlocks );\n\t\t\t\tif ( message ) {\n\t\t\t\t\tdispatch(\n\t\t\t\t\t\tdisplayBlockRemovalPrompt(\n\t\t\t\t\t\t\tclientIds,\n\t\t\t\t\t\t\tselectPrevious,\n\t\t\t\t\t\t\tmessage\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( selectPrevious ) {\n\t\t\tdispatch.selectPreviousBlock( clientIds[ 0 ], selectPrevious );\n\t\t}\n\n\t\t// We're batching these two actions because an extra `undo/redo` step can\n\t\t// be created, based on whether we insert a default block or not.\n\t\tregistry.batch( () => {\n\t\t\tdispatch( { type: 'REMOVE_BLOCKS', clientIds } );\n\t\t\t// To avoid a focus loss when removing the last block, assure there is\n\t\t\t// always a default block if the last of the blocks have been removed.\n\t\t\tdispatch( ensureDefaultBlock() );\n\t\t} );\n\t};\n\n/**\n * Action which will insert a default block insert action if there\n * are no other blocks at the root of the editor. This action should be used\n * in actions which may result in no blocks remaining in the editor (removal,\n * replacement, etc).\n */\nexport const ensureDefaultBlock =\n\t() =>\n\t( { select, dispatch } ) => {\n\t\t// To avoid a focus loss when removing the last block, assure there is\n\t\t// always a default block if the last of the blocks have been removed.\n\t\tconst count = select.getBlockCount();\n\t\tif ( count > 0 ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If there's an custom appender, don't insert default block.\n\t\t// We have to remember to manually move the focus elsewhere to\n\t\t// prevent it from being lost though.\n\t\tconst { __unstableHasCustomAppender } = select.getSettings();\n\t\tif ( __unstableHasCustomAppender ) {\n\t\t\treturn;\n\t\t}\n\n\t\tdispatch.insertDefaultBlock();\n\t};\n\n/**\n * Returns an action object used in signalling that a block removal prompt must\n * be displayed.\n *\n * Contrast with `setBlockRemovalRules`.\n *\n * @param {string|string[]} clientIds Client IDs of blocks to remove.\n * @param {boolean} selectPrevious True if the previous block or the\n * immediate parent (if no previous\n * block exists) should be selected\n * when a block is removed.\n * @param {string} message Message to display in the prompt.\n *\n * @return {Object} Action object.\n */\nfunction displayBlockRemovalPrompt( clientIds, selectPrevious, message ) {\n\treturn {\n\t\ttype: 'DISPLAY_BLOCK_REMOVAL_PROMPT',\n\t\tclientIds,\n\t\tselectPrevious,\n\t\tmessage,\n\t};\n}\n\n/**\n * Returns an action object used in signalling that a block removal prompt must\n * be cleared, either be cause the user has confirmed or canceled the request\n * for removal.\n *\n * @return {Object} Action object.\n */\nexport function clearBlockRemovalPrompt() {\n\treturn {\n\t\ttype: 'CLEAR_BLOCK_REMOVAL_PROMPT',\n\t};\n}\n\n/**\n * Returns an action object used to set up any rules that a block editor may\n * provide in order to prevent a user from accidentally removing certain\n * blocks. These rules are then used to display a confirmation prompt to the\n * user. For instance, in the Site Editor, the Query Loop block is important\n * enough to warrant such confirmation.\n *\n * IMPORTANT: Registering rules implicitly signals to the `privateRemoveBlocks`\n * action that the editor will be responsible for displaying block removal\n * prompts and confirming deletions. This action is meant to be used by\n * component `BlockRemovalWarningModal` only.\n *\n * The data is a record whose keys are block types (e.g. 'core/query') and\n * whose values are the explanation to be shown to users (e.g. 'Query Loop\n * displays a list of posts or pages.').\n *\n * Contrast with `displayBlockRemovalPrompt`.\n *\n * @param {Record<string,string>|false} rules Block removal rules.\n * @return {Object} Action object.\n */\nexport function setBlockRemovalRules( rules = false ) {\n\treturn {\n\t\ttype: 'SET_BLOCK_REMOVAL_RULES',\n\t\trules,\n\t};\n}\n\n/**\n * Sets the client ID of the block settings menu that is currently open.\n *\n * @param {?string} clientId The block client ID.\n * @return {Object} Action object.\n */\nexport function setOpenedBlockSettingsMenu( clientId ) {\n\treturn {\n\t\ttype: 'SET_OPENED_BLOCK_SETTINGS_MENU',\n\t\tclientId,\n\t};\n}\n\nexport function setStyleOverride( id, style ) {\n\treturn {\n\t\ttype: 'SET_STYLE_OVERRIDE',\n\t\tid,\n\t\tstyle,\n\t};\n}\n\nexport function deleteStyleOverride( id ) {\n\treturn {\n\t\ttype: 'DELETE_STYLE_OVERRIDE',\n\t\tid,\n\t};\n}\n\n/**\n * A higher-order action that mark every change inside a callback as \"non-persistent\"\n * and ignore pushing to the undo history stack. It's primarily used for synchronized\n * derived updates from the block editor without affecting the undo history.\n *\n * @param {() => void} callback The synchronous callback to derive updates.\n */\nexport function syncDerivedUpdates( callback ) {\n\treturn ( { dispatch, select, registry } ) => {\n\t\tregistry.batch( () => {\n\t\t\t// Mark every change in the `callback` as non-persistent.\n\t\t\tdispatch( {\n\t\t\t\ttype: 'SET_EXPLICIT_PERSISTENT',\n\t\t\t\tisPersistentChange: false,\n\t\t\t} );\n\t\t\tcallback();\n\t\t\tdispatch( {\n\t\t\t\ttype: 'SET_EXPLICIT_PERSISTENT',\n\t\t\t\tisPersistentChange: undefined,\n\t\t\t} );\n\n\t\t\t// Ignore pushing undo stack for the updated blocks.\n\t\t\tconst updatedBlocks = select.getBlocks();\n\t\t\tundoIgnoreBlocks.add( updatedBlocks );\n\t\t} );\n\t};\n}\n\n/**\n * Action that sets the element that had focus when focus leaves the editor canvas.\n *\n * @param {Object} lastFocus The last focused element.\n *\n *\n * @return {Object} Action object.\n */\nexport function setLastFocus( lastFocus = null ) {\n\treturn {\n\t\ttype: 'LAST_FOCUS',\n\t\tlastFocus,\n\t};\n}\n\n/**\n * Action that stops temporarily editing as blocks.\n *\n * @param {string} clientId The block's clientId.\n */\nexport function stopEditingAsBlocks( clientId ) {\n\treturn ( { select, dispatch, registry } ) => {\n\t\tconst focusModeToRevert = unlock(\n\t\t\tregistry.select( blockEditorStore )\n\t\t).getTemporarilyEditingFocusModeToRevert();\n\t\tdispatch.__unstableMarkNextChangeAsNotPersistent();\n\t\tdispatch.updateBlockAttributes( clientId, {\n\t\t\ttemplateLock: 'contentOnly',\n\t\t} );\n\t\tdispatch.updateBlockListSettings( clientId, {\n\t\t\t...select.getBlockListSettings( clientId ),\n\t\t\ttemplateLock: 'contentOnly',\n\t\t} );\n\t\tdispatch.updateSettings( { focusMode: focusModeToRevert } );\n\t\tdispatch.__unstableSetTemporarilyEditingAsBlocks();\n\t};\n}\n\n/**\n * Returns an action object used in signalling that the user has begun to drag.\n *\n * @return {Object} Action object.\n */\nexport function startDragging() {\n\treturn {\n\t\ttype: 'START_DRAGGING',\n\t};\n}\n\n/**\n * Returns an action object used in signalling that the user has stopped dragging.\n *\n * @return {Object} Action object.\n */\nexport function stopDragging() {\n\treturn {\n\t\ttype: 'STOP_DRAGGING',\n\t};\n}\n\n/**\n * @param {string|null} clientId The block's clientId, or `null` to clear.\n *\n * @return {Object} Action object.\n */\nexport function expandBlock( clientId ) {\n\treturn {\n\t\ttype: 'SET_BLOCK_EXPANDED_IN_LIST_VIEW',\n\t\tclientId,\n\t};\n}\n\n/**\n * Temporarily modify/unlock the content-only block for editions.\n *\n * @param {string} clientId The client id of the block.\n */\nexport const modifyContentLockBlock =\n\t( clientId ) =>\n\t( { select, dispatch } ) => {\n\t\tdispatch.__unstableMarkNextChangeAsNotPersistent();\n\t\tdispatch.updateBlockAttributes( clientId, {\n\t\t\ttemplateLock: undefined,\n\t\t} );\n\t\tdispatch.updateBlockListSettings( clientId, {\n\t\t\t...select.getBlockListSettings( clientId ),\n\t\t\ttemplateLock: false,\n\t\t} );\n\t\tconst focusModeToRevert = select.getSettings().focusMode;\n\t\tdispatch.updateSettings( { focusMode: true } );\n\t\tdispatch.__unstableSetTemporarilyEditingAsBlocks(\n\t\t\tclientId,\n\t\t\tfocusModeToRevert\n\t\t);\n\t};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AAVA;AACA;AACA;;AAGA;AACA;AACA;;AAKA,MAAMI,SAAS,GAAKC,UAAU,IAC7BC,KAAK,CAACC,OAAO,CAAEF,UAAW,CAAC,GAAGA,UAAU,GAAG,CAAEA,UAAU,CAAE;;AAE1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMG,eAAe,GAAG,CACvB,yBAAyB,EACzB,yBAAyB,CACzB;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,4BAA4BA,CAC3CC,QAAQ,EACR;EAAEC,yBAAyB,GAAG,KAAK;EAAEC,KAAK,GAAG;AAAM,CAAC,GAAG,C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AAK,CAAE,CAAC;EAC9C7D,QAAQ,CAAC8D,uCAAuC,CAC/C1B,QAAQ,EACRe,iBACD,CAAC;AACF,CAAC;AAACxB,OAAA,CAAAuC,sBAAA,GAAAA,sBAAA","ignoreList":[]}
@@ -3,7 +3,8 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.selectBlockPatternsKey = exports.reusableBlocksSelectKey = void 0;
6
+ exports.selectBlockPatternsKey = exports.reusableBlocksSelectKey = exports.globalStylesDataKey = void 0;
7
+ const globalStylesDataKey = exports.globalStylesDataKey = Symbol('globalStylesDataKey');
7
8
  const selectBlockPatternsKey = exports.selectBlockPatternsKey = Symbol('selectBlockPatternsKey');
8
9
  const reusableBlocksSelectKey = exports.reusableBlocksSelectKey = Symbol('reusableBlocksSelect');
9
10
  //# sourceMappingURL=private-keys.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["selectBlockPatternsKey","exports","Symbol","reusableBlocksSelectKey"],"sources":["@wordpress/block-editor/src/store/private-keys.js"],"sourcesContent":["export const selectBlockPatternsKey = Symbol( 'selectBlockPatternsKey' );\nexport const reusableBlocksSelectKey = Symbol( 'reusableBlocksSelect' );\n"],"mappings":";;;;;;AAAO,MAAMA,sBAAsB,GAAAC,OAAA,CAAAD,sBAAA,GAAGE,MAAM,CAAE,wBAAyB,CAAC;AACjE,MAAMC,uBAAuB,GAAAF,OAAA,CAAAE,uBAAA,GAAGD,MAAM,CAAE,sBAAuB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["globalStylesDataKey","exports","Symbol","selectBlockPatternsKey","reusableBlocksSelectKey"],"sources":["@wordpress/block-editor/src/store/private-keys.js"],"sourcesContent":["export const globalStylesDataKey = Symbol( 'globalStylesDataKey' );\nexport const selectBlockPatternsKey = Symbol( 'selectBlockPatternsKey' );\nexport const reusableBlocksSelectKey = Symbol( 'reusableBlocksSelect' );\n"],"mappings":";;;;;;AAAO,MAAMA,mBAAmB,GAAAC,OAAA,CAAAD,mBAAA,GAAGE,MAAM,CAAE,qBAAsB,CAAC;AAC3D,MAAMC,sBAAsB,GAAAF,OAAA,CAAAE,sBAAA,GAAGD,MAAM,CAAE,wBAAyB,CAAC;AACjE,MAAME,uBAAuB,GAAAH,OAAA,CAAAG,uBAAA,GAAGF,MAAM,CAAE,sBAAuB,CAAC","ignoreList":[]}
@@ -21,14 +21,14 @@ exports.getOpenedBlockSettingsMenu = getOpenedBlockSettingsMenu;
21
21
  exports.getPatternBySlug = void 0;
22
22
  exports.getRegisteredInserterMediaCategories = getRegisteredInserterMediaCategories;
23
23
  exports.getRemovalPromptData = getRemovalPromptData;
24
- exports.getReusableBlocks = void 0;
25
- exports.getStyleOverrides = getStyleOverrides;
24
+ exports.getStyleOverrides = exports.getReusableBlocks = void 0;
26
25
  exports.getTemporarilyEditingAsBlocks = getTemporarilyEditingAsBlocks;
27
26
  exports.getTemporarilyEditingFocusModeToRevert = getTemporarilyEditingFocusModeToRevert;
28
27
  exports.hasAllowedPatterns = void 0;
29
28
  exports.isBlockInterfaceHidden = isBlockInterfaceHidden;
30
29
  exports.isBlockSubtreeDisabled = void 0;
31
30
  exports.isDragging = isDragging;
31
+ exports.isResolvingPatterns = void 0;
32
32
  var _data = require("@wordpress/data");
33
33
  var _selectors = require("./selectors");
34
34
  var _utils = require("./utils");
@@ -164,13 +164,35 @@ function getOpenedBlockSettingsMenu(state) {
164
164
  /**
165
165
  * Returns all style overrides, intended to be merged with global editor styles.
166
166
  *
167
+ * Overrides are sorted to match the order of the blocks they relate to. This
168
+ * is useful to maintain correct CSS cascade order.
169
+ *
167
170
  * @param {Object} state Global application state.
168
171
  *
169
- * @return {Map} A map of style IDs to style overrides.
172
+ * @return {Array} An array of style ID to style override pairs.
170
173
  */
171
- function getStyleOverrides(state) {
172
- return state.styleOverrides;
173
- }
174
+ const getStyleOverrides = exports.getStyleOverrides = (0, _data.createSelector)(state => {
175
+ const clientIds = (0, _selectors.getClientIdsWithDescendants)(state);
176
+ const clientIdMap = clientIds.reduce((acc, clientId, index) => {
177
+ acc[clientId] = index;
178
+ return acc;
179
+ }, {});
180
+ return [...state.styleOverrides].sort((overrideA, overrideB) => {
181
+ var _clientIdMap$clientId, _clientIdMap$clientId2;
182
+ // Once the overrides Map is spread to an array, the first element
183
+ // is the key, while the second is the override itself including
184
+ // the clientId to sort by.
185
+ const [, {
186
+ clientId: clientIdA
187
+ }] = overrideA;
188
+ const [, {
189
+ clientId: clientIdB
190
+ }] = overrideB;
191
+ const aIndex = (_clientIdMap$clientId = clientIdMap[clientIdA]) !== null && _clientIdMap$clientId !== void 0 ? _clientIdMap$clientId : -1;
192
+ const bIndex = (_clientIdMap$clientId2 = clientIdMap[clientIdB]) !== null && _clientIdMap$clientId2 !== void 0 ? _clientIdMap$clientId2 : -1;
193
+ return aIndex - bIndex;
194
+ });
195
+ }, state => [state.blocks.order, state.styleOverrides]);
174
196
 
175
197
  /** @typedef {import('./actions').InserterMediaCategory} InserterMediaCategory */
176
198
  /**
@@ -299,6 +321,11 @@ const getAllPatterns = exports.getAllPatterns = (0, _data.createRegistrySelector
299
321
  // This setting is left for back compat.
300
322
  ...((_state$settings$__exp2 = state.settings.__experimentalBlockPatterns) !== null && _state$settings$__exp2 !== void 0 ? _state$settings$__exp2 : []), ...((_state$settings$selec2 = state.settings[_privateKeys.selectBlockPatternsKey]?.(select)) !== null && _state$settings$selec2 !== void 0 ? _state$settings$selec2 : [])].filter((x, index, arr) => index === arr.findIndex(y => x.name === y.name));
301
323
  }, (0, _utils.getAllPatternsDependants)(select)));
324
+ const isResolvingPatterns = exports.isResolvingPatterns = (0, _data.createRegistrySelector)(select => (0, _data.createSelector)(state => {
325
+ const blockPatternsSelect = state.settings[_privateKeys.selectBlockPatternsKey];
326
+ const reusableBlocksSelect = state.settings[_privateKeys.reusableBlocksSelectKey];
327
+ return (blockPatternsSelect ? blockPatternsSelect(select) === undefined : false) || (reusableBlocksSelect ? reusableBlocksSelect(select) === undefined : false);
328
+ }, (0, _utils.getAllPatternsDependants)(select)));
302
329
  const EMPTY_ARRAY = [];
303
330
  const getReusableBlocks = exports.getReusableBlocks = (0, _data.createRegistrySelector)(select => state => {
304
331
  var _state$settings$__exp3;
@@ -1 +1 @@
1
- {"version":3,"names":["_data","require","_selectors","_utils","_utils2","_constants","_lockUnlock","_privateKeys","_getBlockSettings","isBlockInterfaceHidden","state","getLastInsertedBlocksClientIds","lastBlockInserted","clientIds","getBlockWithoutAttributes","clientId","blocks","byClientId","get","isBlockSubtreeDisabled","isChildSubtreeDisabled","childClientId","getBlockEditingMode","getBlockOrder","every","exports","getEnabledClientIdsTreeUnmemoized","rootClientId","blockOrder","result","innerBlocks","push","getEnabledClientIdsTree","createSelector","order","blockEditingModes","settings","templateLock","blockListSettings","getEnabledBlockParents","ascending","getBlockParents","filter","parent","parents","getRemovalPromptData","removalPromptData","getBlockRemovalRules","blockRemovalRules","getOpenedBlockSettingsMenu","openedBlockSettingsMenu","getStyleOverrides","styleOverrides","getRegisteredInserterMediaCategories","registeredInserterMediaCategories","getInserterMediaCategories","inserterMediaCategories","allowedMimeTypes","enableOpenverseMediaCategory","length","coreInserterMediaCategoriesNames","map","name","mergedCategories","includes","category","Object","values","some","mimeType","startsWith","mediaType","hasAllowedPatterns","createRegistrySelector","select","getAllPatterns","__experimentalGetParsedPattern","unlock","STORE_NAME","patterns","allowedBlockTypes","getSettings","inserter","checkAllowListRecursive","blockName","canInsertBlockType","getAllPatternsDependants","getInsertBlockTypeDependants","mapUserPattern","userPattern","__experimentalUserPatternCategories","id","type","INSERTER_PATTERN_TYPES","user","title","raw","categories","wp_pattern_category","catId","find","slug","content","syncStatus","wp_pattern_sync_status","getPatternBySlug","patternName","_state$settings$__exp","_state$settings$selec","_id","parseInt","slice","block","getReusableBlocks","__experimentalBlockPatterns","selectBlockPatternsKey","__experimentalReusableBlocks","_state$settings$__exp2","_state$settings$selec2","x","index","arr","findIndex","y","EMPTY_ARRAY","_state$settings$__exp3","reusableBlocksSelect","reusableBlocksSelectKey","getLastFocus","lastFocus","isDragging","getExpandedBlock","expandedBlock","getContentLockingParent","current","getBlockName","getTemplateLock","getTemporarilyEditingAsBlocks","temporarilyEditingAsBlocks","getTemporarilyEditingFocusModeToRevert","temporarilyEditingFocusModeRevert"],"sources":["@wordpress/block-editor/src/store/private-selectors.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createSelector, createRegistrySelector } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport {\n\tgetBlockOrder,\n\tgetBlockParents,\n\tgetBlockEditingMode,\n\tgetSettings,\n\tcanInsertBlockType,\n\tgetBlockName,\n\tgetTemplateLock,\n} from './selectors';\nimport {\n\tcheckAllowListRecursive,\n\tgetAllPatternsDependants,\n\tgetInsertBlockTypeDependants,\n} from './utils';\nimport { INSERTER_PATTERN_TYPES } from '../components/inserter/block-patterns-tab/utils';\nimport { STORE_NAME } from './constants';\nimport { unlock } from '../lock-unlock';\nimport {\n\tselectBlockPatternsKey,\n\treusableBlocksSelectKey,\n} from './private-keys';\n\nexport { getBlockSettings } from './get-block-settings';\n\n/**\n * Returns true if the block interface is hidden, or false otherwise.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the block toolbar is hidden.\n */\nexport function isBlockInterfaceHidden( state ) {\n\treturn state.isBlockInterfaceHidden;\n}\n\n/**\n * Gets the client ids of the last inserted blocks.\n *\n * @param {Object} state Global application state.\n * @return {Array|undefined} Client Ids of the last inserted block(s).\n */\nexport function getLastInsertedBlocksClientIds( state ) {\n\treturn state?.lastBlockInserted?.clientIds;\n}\n\nexport function getBlockWithoutAttributes( state, clientId ) {\n\treturn state.blocks.byClientId.get( clientId );\n}\n\n/**\n * Returns true if all of the descendants of a block with the given client ID\n * have an editing mode of 'disabled', or false otherwise.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId The block client ID.\n *\n * @return {boolean} Whether the block descendants are disabled.\n */\nexport const isBlockSubtreeDisabled = ( state, clientId ) => {\n\tconst isChildSubtreeDisabled = ( childClientId ) => {\n\t\treturn (\n\t\t\tgetBlockEditingMode( state, childClientId ) === 'disabled' &&\n\t\t\tgetBlockOrder( state, childClientId ).every(\n\t\t\t\tisChildSubtreeDisabled\n\t\t\t)\n\t\t);\n\t};\n\treturn getBlockOrder( state, clientId ).every( isChildSubtreeDisabled );\n};\n\nfunction getEnabledClientIdsTreeUnmemoized( state, rootClientId ) {\n\tconst blockOrder = getBlockOrder( state, rootClientId );\n\tconst result = [];\n\n\tfor ( const clientId of blockOrder ) {\n\t\tconst innerBlocks = getEnabledClientIdsTreeUnmemoized(\n\t\t\tstate,\n\t\t\tclientId\n\t\t);\n\t\tif ( getBlockEditingMode( state, clientId ) !== 'disabled' ) {\n\t\t\tresult.push( { clientId, innerBlocks } );\n\t\t} else {\n\t\t\tresult.push( ...innerBlocks );\n\t\t}\n\t}\n\n\treturn result;\n}\n\n/**\n * Returns a tree of block objects with only clientID and innerBlocks set.\n * Blocks with a 'disabled' editing mode are not included.\n *\n * @param {Object} state Global application state.\n * @param {?string} rootClientId Optional root client ID of block list.\n *\n * @return {Object[]} Tree of block objects with only clientID and innerBlocks set.\n */\nexport const getEnabledClientIdsTree = createSelector(\n\tgetEnabledClientIdsTreeUnmemoized,\n\t( state ) => [\n\t\tstate.blocks.order,\n\t\tstate.blockEditingModes,\n\t\tstate.settings.templateLock,\n\t\tstate.blockListSettings,\n\t]\n);\n\n/**\n * Returns a list of a given block's ancestors, from top to bottom. Blocks with\n * a 'disabled' editing mode are excluded.\n *\n * @see getBlockParents\n *\n * @param {Object} state Global application state.\n * @param {string} clientId The block client ID.\n * @param {boolean} ascending Order results from bottom to top (true) or top\n * to bottom (false).\n */\nexport const getEnabledBlockParents = createSelector(\n\t( state, clientId, ascending = false ) => {\n\t\treturn getBlockParents( state, clientId, ascending ).filter(\n\t\t\t( parent ) => getBlockEditingMode( state, parent ) !== 'disabled'\n\t\t);\n\t},\n\t( state ) => [\n\t\tstate.blocks.parents,\n\t\tstate.blockEditingModes,\n\t\tstate.settings.templateLock,\n\t\tstate.blockListSettings,\n\t]\n);\n\n/**\n * Selector that returns the data needed to display a prompt when certain\n * blocks are removed, or `false` if no such prompt is requested.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object|false} Data for removal prompt display, if any.\n */\nexport function getRemovalPromptData( state ) {\n\treturn state.removalPromptData;\n}\n\n/**\n * Returns true if removal prompt exists, or false otherwise.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether removal prompt exists.\n */\nexport function getBlockRemovalRules( state ) {\n\treturn state.blockRemovalRules;\n}\n\n/**\n * Returns the client ID of the block settings menu that is currently open.\n *\n * @param {Object} state Global application state.\n * @return {string|null} The client ID of the block menu that is currently open.\n */\nexport function getOpenedBlockSettingsMenu( state ) {\n\treturn state.openedBlockSettingsMenu;\n}\n\n/**\n * Returns all style overrides, intended to be merged with global editor styles.\n *\n * @param {Object} state Global application state.\n *\n * @return {Map} A map of style IDs to style overrides.\n */\nexport function getStyleOverrides( state ) {\n\treturn 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, __experimentalGetParsedPattern } = unlock(\n\t\t\t\tselect( STORE_NAME )\n\t\t\t);\n\t\t\tconst patterns = getAllPatterns();\n\t\t\tconst { allowedBlockTypes } = getSettings( state );\n\t\t\treturn patterns.some( ( { name, inserter = true } ) => {\n\t\t\t\tif ( ! inserter ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tconst { blocks } = __experimentalGetParsedPattern( name );\n\t\t\t\treturn (\n\t\t\t\t\tcheckAllowListRecursive( blocks, allowedBlockTypes ) &&\n\t\t\t\t\tblocks.every( ( { name: blockName } ) =>\n\t\t\t\t\t\tcanInsertBlockType( state, blockName, rootClientId )\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t} );\n\t\t},\n\t\t( state, rootClientId ) => [\n\t\t\t...getAllPatternsDependants( select )( state ),\n\t\t\t...getInsertBlockTypeDependants( state, rootClientId ),\n\t\t]\n\t)\n);\n\nfunction mapUserPattern(\n\tuserPattern,\n\t__experimentalUserPatternCategories = []\n) {\n\treturn {\n\t\tname: `core/block/${ userPattern.id }`,\n\t\tid: userPattern.id,\n\t\ttype: INSERTER_PATTERN_TYPES.user,\n\t\ttitle: userPattern.title.raw,\n\t\tcategories: userPattern.wp_pattern_category.map( ( catId ) => {\n\t\t\tconst category = __experimentalUserPatternCategories.find(\n\t\t\t\t( { id } ) => id === catId\n\t\t\t);\n\t\t\treturn category ? category.slug : catId;\n\t\t} ),\n\t\tcontent: userPattern.content.raw,\n\t\tsyncStatus: userPattern.wp_pattern_sync_status,\n\t};\n}\n\nexport const getPatternBySlug = createRegistrySelector( ( select ) =>\n\tcreateSelector(\n\t\t( state, patternName ) => {\n\t\t\t// Only fetch reusable blocks if we know we need them. To do: maybe\n\t\t\t// use the entity record API to retrieve the block by slug.\n\t\t\tif ( patternName?.startsWith( 'core/block/' ) ) {\n\t\t\t\tconst _id = parseInt(\n\t\t\t\t\tpatternName.slice( 'core/block/'.length ),\n\t\t\t\t\t10\n\t\t\t\t);\n\t\t\t\tconst block = unlock( select( STORE_NAME ) )\n\t\t\t\t\t.getReusableBlocks()\n\t\t\t\t\t.find( ( { id } ) => id === _id );\n\n\t\t\t\tif ( ! block ) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\treturn mapUserPattern(\n\t\t\t\t\tblock,\n\t\t\t\t\tstate.settings.__experimentalUserPatternCategories\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn [\n\t\t\t\t// This setting is left for back compat.\n\t\t\t\t...( state.settings.__experimentalBlockPatterns ?? [] ),\n\t\t\t\t...( state.settings[ selectBlockPatternsKey ]?.( select ) ??\n\t\t\t\t\t[] ),\n\t\t\t].find( ( { name } ) => name === patternName );\n\t\t},\n\t\t( state, patternName ) =>\n\t\t\tpatternName?.startsWith( 'core/block/' )\n\t\t\t\t? [\n\t\t\t\t\t\tunlock( select( STORE_NAME ) ).getReusableBlocks(),\n\t\t\t\t\t\tstate.settings.__experimentalReusableBlocks,\n\t\t\t\t ]\n\t\t\t\t: [\n\t\t\t\t\t\tstate.settings.__experimentalBlockPatterns,\n\t\t\t\t\t\tstate.settings[ selectBlockPatternsKey ]?.( select ),\n\t\t\t\t ]\n\t)\n);\n\nexport const getAllPatterns = createRegistrySelector( ( select ) =>\n\tcreateSelector( ( state ) => {\n\t\treturn [\n\t\t\t...unlock( select( STORE_NAME ) )\n\t\t\t\t.getReusableBlocks()\n\t\t\t\t.map( ( userPattern ) =>\n\t\t\t\t\tmapUserPattern(\n\t\t\t\t\t\tuserPattern,\n\t\t\t\t\t\tstate.settings.__experimentalUserPatternCategories\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t// This setting is left for back compat.\n\t\t\t...( state.settings.__experimentalBlockPatterns ?? [] ),\n\t\t\t...( state.settings[ selectBlockPatternsKey ]?.( select ) ?? [] ),\n\t\t].filter(\n\t\t\t( x, index, arr ) =>\n\t\t\t\tindex === arr.findIndex( ( y ) => x.name === y.name )\n\t\t);\n\t}, getAllPatternsDependants( select ) )\n);\n\nconst EMPTY_ARRAY = [];\n\nexport const getReusableBlocks = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tconst reusableBlocksSelect = state.settings[ reusableBlocksSelectKey ];\n\t\treturn reusableBlocksSelect\n\t\t\t? reusableBlocksSelect( select )\n\t\t\t: state.settings.__experimentalReusableBlocks ?? EMPTY_ARRAY;\n\t}\n);\n\n/**\n * Returns the element of the last element that had focus when focus left the editor canvas.\n *\n * @param {Object} state Block editor state.\n *\n * @return {Object} Element.\n */\nexport function getLastFocus( state ) {\n\treturn state.lastFocus;\n}\n\n/**\n * Returns true if the user is dragging anything, or false otherwise. It is possible for a\n * user to be dragging data from outside of the editor, so this selector is separate from\n * the `isDraggingBlocks` selector which only returns true if the user is dragging blocks.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether user is dragging.\n */\nexport function isDragging( state ) {\n\treturn state.isDragging;\n}\n\n/**\n * Retrieves the expanded block from the state.\n *\n * @param {Object} state Block editor state.\n *\n * @return {string|null} The client ID of the expanded block, if set.\n */\nexport function getExpandedBlock( state ) {\n\treturn state.expandedBlock;\n}\n\n/**\n * Retrieves the client ID of the ancestor block that is content locking the block\n * with the provided client ID.\n *\n * @param {Object} state Global application state.\n * @param {Object} clientId Client Id of the block.\n *\n * @return {?string} Client ID of the ancestor block that is content locking the block.\n */\nexport const getContentLockingParent = createSelector(\n\t( state, clientId ) => {\n\t\tlet current = clientId;\n\t\tlet result;\n\t\twhile ( ( current = state.blocks.parents.get( current ) ) ) {\n\t\t\tif (\n\t\t\t\tgetBlockName( state, current ) === 'core/block' ||\n\t\t\t\tgetTemplateLock( state, current ) === 'contentOnly'\n\t\t\t) {\n\t\t\t\tresult = current;\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t},\n\t( state ) => [ state.blocks.parents, state.blockListSettings ]\n);\n\n/**\n * Retrieves the client ID of the block that is content locked but is\n * currently being temporarily edited as a non-locked block.\n *\n * @param {Object} state Global application state.\n *\n * @return {?string} The client ID of the block being temporarily edited as a non-locked block.\n */\nexport function getTemporarilyEditingAsBlocks( state ) {\n\treturn state.temporarilyEditingAsBlocks;\n}\n\n/**\n * Returns the focus mode that should be reapplied when the user stops editing\n * a content locked blocks as a block without locking.\n *\n * @param {Object} state Global application state.\n *\n * @return {?string} The focus mode that should be re-set when temporarily editing as blocks stops.\n */\nexport function getTemporarilyEditingFocusModeToRevert( state ) {\n\treturn state.temporarilyEditingFocusModeRevert;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAKA,IAAAC,UAAA,GAAAD,OAAA;AASA,IAAAE,MAAA,GAAAF,OAAA;AAKA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AAKA,IAAAO,iBAAA,GAAAP,OAAA;AA9BA;AACA;AACA;;AAGA;AACA;AACA;;AAyBA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASQ,sBAAsBA,CAAEC,KAAK,EAAG;EAC/C,OAAOA,KAAK,CAACD,sBAAsB;AACpC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,SAASE,8BAA8BA,CAAED,KAAK,EAAG;EACvD,OAAOA,KAAK,EAAEE,iBAAiB,EAAEC,SAAS;AAC3C;AAEO,SAASC,yBAAyBA,CAAEJ,KAAK,EAAEK,QAAQ,EAAG;EAC5D,OAAOL,KAAK,CAACM,MAAM,CAACC,UAAU,CAACC,GAAG,CAAEH,QAAS,CAAC;AAC/C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMI,sBAAsB,GAAGA,CAAET,KAAK,EAAEK,QAAQ,KAAM;EAC5D,MAAMK,sBAAsB,GAAKC,aAAa,IAAM;IACnD,OACC,IAAAC,8BAAmB,EAAEZ,KAAK,EAAEW,aAAc,CAAC,KAAK,UAAU,IAC1D,IAAAE,wBAAa,EAAEb,KAAK,EAAEW,aAAc,CAAC,CAACG,KAAK,CAC1CJ,sBACD,CAAC;EAEH,CAAC;EACD,OAAO,IAAAG,wBAAa,EAAEb,KAAK,EAAEK,QAAS,CAAC,CAACS,KAA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EACA,OAAOzG,MAAM;AACd,CAAC,EACCnB,KAAK,IAAM,CAAEA,KAAK,CAACM,MAAM,CAAC4B,OAAO,EAAElC,KAAK,CAAC4B,iBAAiB,CAC7D,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASmG,6BAA6BA,CAAE/H,KAAK,EAAG;EACtD,OAAOA,KAAK,CAACgI,0BAA0B;AACxC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,sCAAsCA,CAAEjI,KAAK,EAAG;EAC/D,OAAOA,KAAK,CAACkI,iCAAiC;AAC/C","ignoreList":[]}
1
+ {"version":3,"names":["_data","require","_selectors","_utils","_utils2","_constants","_lockUnlock","_privateKeys","_getBlockSettings","isBlockInterfaceHidden","state","getLastInsertedBlocksClientIds","lastBlockInserted","clientIds","getBlockWithoutAttributes","clientId","blocks","byClientId","get","isBlockSubtreeDisabled","isChildSubtreeDisabled","childClientId","getBlockEditingMode","getBlockOrder","every","exports","getEnabledClientIdsTreeUnmemoized","rootClientId","blockOrder","result","innerBlocks","push","getEnabledClientIdsTree","createSelector","order","blockEditingModes","settings","templateLock","blockListSettings","getEnabledBlockParents","ascending","getBlockParents","filter","parent","parents","getRemovalPromptData","removalPromptData","getBlockRemovalRules","blockRemovalRules","getOpenedBlockSettingsMenu","openedBlockSettingsMenu","getStyleOverrides","getClientIdsWithDescendants","clientIdMap","reduce","acc","index","styleOverrides","sort","overrideA","overrideB","_clientIdMap$clientId","_clientIdMap$clientId2","clientIdA","clientIdB","aIndex","bIndex","getRegisteredInserterMediaCategories","registeredInserterMediaCategories","getInserterMediaCategories","inserterMediaCategories","allowedMimeTypes","enableOpenverseMediaCategory","length","coreInserterMediaCategoriesNames","map","name","mergedCategories","includes","category","Object","values","some","mimeType","startsWith","mediaType","hasAllowedPatterns","createRegistrySelector","select","getAllPatterns","__experimentalGetParsedPattern","unlock","STORE_NAME","patterns","allowedBlockTypes","getSettings","inserter","checkAllowListRecursive","blockName","canInsertBlockType","getAllPatternsDependants","getInsertBlockTypeDependants","mapUserPattern","userPattern","__experimentalUserPatternCategories","id","type","INSERTER_PATTERN_TYPES","user","title","raw","categories","wp_pattern_category","catId","find","slug","content","syncStatus","wp_pattern_sync_status","getPatternBySlug","patternName","_state$settings$__exp","_state$settings$selec","_id","parseInt","slice","block","getReusableBlocks","__experimentalBlockPatterns","selectBlockPatternsKey","__experimentalReusableBlocks","_state$settings$__exp2","_state$settings$selec2","x","arr","findIndex","y","isResolvingPatterns","blockPatternsSelect","reusableBlocksSelect","reusableBlocksSelectKey","undefined","EMPTY_ARRAY","_state$settings$__exp3","getLastFocus","lastFocus","isDragging","getExpandedBlock","expandedBlock","getContentLockingParent","current","getBlockName","getTemplateLock","getTemporarilyEditingAsBlocks","temporarilyEditingAsBlocks","getTemporarilyEditingFocusModeToRevert","temporarilyEditingFocusModeRevert"],"sources":["@wordpress/block-editor/src/store/private-selectors.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createSelector, createRegistrySelector } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport {\n\tgetBlockOrder,\n\tgetBlockParents,\n\tgetBlockEditingMode,\n\tgetSettings,\n\tcanInsertBlockType,\n\tgetBlockName,\n\tgetTemplateLock,\n\tgetClientIdsWithDescendants,\n} from './selectors';\nimport {\n\tcheckAllowListRecursive,\n\tgetAllPatternsDependants,\n\tgetInsertBlockTypeDependants,\n} from './utils';\nimport { INSERTER_PATTERN_TYPES } from '../components/inserter/block-patterns-tab/utils';\nimport { STORE_NAME } from './constants';\nimport { unlock } from '../lock-unlock';\nimport {\n\tselectBlockPatternsKey,\n\treusableBlocksSelectKey,\n} from './private-keys';\n\nexport { getBlockSettings } from './get-block-settings';\n\n/**\n * Returns true if the block interface is hidden, or false otherwise.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the block toolbar is hidden.\n */\nexport function isBlockInterfaceHidden( state ) {\n\treturn state.isBlockInterfaceHidden;\n}\n\n/**\n * Gets the client ids of the last inserted blocks.\n *\n * @param {Object} state Global application state.\n * @return {Array|undefined} Client Ids of the last inserted block(s).\n */\nexport function getLastInsertedBlocksClientIds( state ) {\n\treturn state?.lastBlockInserted?.clientIds;\n}\n\nexport function getBlockWithoutAttributes( state, clientId ) {\n\treturn state.blocks.byClientId.get( clientId );\n}\n\n/**\n * Returns true if all of the descendants of a block with the given client ID\n * have an editing mode of 'disabled', or false otherwise.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId The block client ID.\n *\n * @return {boolean} Whether the block descendants are disabled.\n */\nexport const isBlockSubtreeDisabled = ( state, clientId ) => {\n\tconst isChildSubtreeDisabled = ( childClientId ) => {\n\t\treturn (\n\t\t\tgetBlockEditingMode( state, childClientId ) === 'disabled' &&\n\t\t\tgetBlockOrder( state, childClientId ).every(\n\t\t\t\tisChildSubtreeDisabled\n\t\t\t)\n\t\t);\n\t};\n\treturn getBlockOrder( state, clientId ).every( isChildSubtreeDisabled );\n};\n\nfunction getEnabledClientIdsTreeUnmemoized( state, rootClientId ) {\n\tconst blockOrder = getBlockOrder( state, rootClientId );\n\tconst result = [];\n\n\tfor ( const clientId of blockOrder ) {\n\t\tconst innerBlocks = getEnabledClientIdsTreeUnmemoized(\n\t\t\tstate,\n\t\t\tclientId\n\t\t);\n\t\tif ( getBlockEditingMode( state, clientId ) !== 'disabled' ) {\n\t\t\tresult.push( { clientId, innerBlocks } );\n\t\t} else {\n\t\t\tresult.push( ...innerBlocks );\n\t\t}\n\t}\n\n\treturn result;\n}\n\n/**\n * Returns a tree of block objects with only clientID and innerBlocks set.\n * Blocks with a 'disabled' editing mode are not included.\n *\n * @param {Object} state Global application state.\n * @param {?string} rootClientId Optional root client ID of block list.\n *\n * @return {Object[]} Tree of block objects with only clientID and innerBlocks set.\n */\nexport const getEnabledClientIdsTree = createSelector(\n\tgetEnabledClientIdsTreeUnmemoized,\n\t( state ) => [\n\t\tstate.blocks.order,\n\t\tstate.blockEditingModes,\n\t\tstate.settings.templateLock,\n\t\tstate.blockListSettings,\n\t]\n);\n\n/**\n * Returns a list of a given block's ancestors, from top to bottom. Blocks with\n * a 'disabled' editing mode are excluded.\n *\n * @see getBlockParents\n *\n * @param {Object} state Global application state.\n * @param {string} clientId The block client ID.\n * @param {boolean} ascending Order results from bottom to top (true) or top\n * to bottom (false).\n */\nexport const getEnabledBlockParents = createSelector(\n\t( state, clientId, ascending = false ) => {\n\t\treturn getBlockParents( state, clientId, ascending ).filter(\n\t\t\t( parent ) => getBlockEditingMode( state, parent ) !== 'disabled'\n\t\t);\n\t},\n\t( state ) => [\n\t\tstate.blocks.parents,\n\t\tstate.blockEditingModes,\n\t\tstate.settings.templateLock,\n\t\tstate.blockListSettings,\n\t]\n);\n\n/**\n * Selector that returns the data needed to display a prompt when certain\n * blocks are removed, or `false` if no such prompt is requested.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object|false} Data for removal prompt display, if any.\n */\nexport function getRemovalPromptData( state ) {\n\treturn state.removalPromptData;\n}\n\n/**\n * Returns true if removal prompt exists, or false otherwise.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether removal prompt exists.\n */\nexport function getBlockRemovalRules( state ) {\n\treturn state.blockRemovalRules;\n}\n\n/**\n * Returns the client ID of the block settings menu that is currently open.\n *\n * @param {Object} state Global application state.\n * @return {string|null} The client ID of the block menu that is currently open.\n */\nexport function getOpenedBlockSettingsMenu( state ) {\n\treturn state.openedBlockSettingsMenu;\n}\n\n/**\n * Returns all style overrides, intended to be merged with global editor styles.\n *\n * Overrides are sorted to match the order of the blocks they relate to. This\n * is useful to maintain correct CSS cascade order.\n *\n * @param {Object} state Global application state.\n *\n * @return {Array} An array of style ID to style override pairs.\n */\nexport const getStyleOverrides = createSelector(\n\t( state ) => {\n\t\tconst clientIds = getClientIdsWithDescendants( state );\n\t\tconst clientIdMap = clientIds.reduce( ( acc, clientId, index ) => {\n\t\t\tacc[ clientId ] = index;\n\t\t\treturn acc;\n\t\t}, {} );\n\n\t\treturn [ ...state.styleOverrides ].sort( ( overrideA, overrideB ) => {\n\t\t\t// Once the overrides Map is spread to an array, the first element\n\t\t\t// is the key, while the second is the override itself including\n\t\t\t// the clientId to sort by.\n\t\t\tconst [ , { clientId: clientIdA } ] = overrideA;\n\t\t\tconst [ , { clientId: clientIdB } ] = overrideB;\n\n\t\t\tconst aIndex = clientIdMap[ clientIdA ] ?? -1;\n\t\t\tconst bIndex = clientIdMap[ clientIdB ] ?? -1;\n\n\t\t\treturn aIndex - bIndex;\n\t\t} );\n\t},\n\t( state ) => [ state.blocks.order, state.styleOverrides ]\n);\n\n/** @typedef {import('./actions').InserterMediaCategory} InserterMediaCategory */\n/**\n * Returns the registered inserter media categories through the public API.\n *\n * @param {Object} state Editor state.\n *\n * @return {InserterMediaCategory[]} Inserter media categories.\n */\nexport function getRegisteredInserterMediaCategories( state ) {\n\treturn state.registeredInserterMediaCategories;\n}\n\n/**\n * Returns an array containing the allowed inserter media categories.\n * It merges the registered media categories from extenders with the\n * core ones. It also takes into account the allowed `mime_types`, which\n * can be altered by `upload_mimes` filter and restrict some of them.\n *\n * @param {Object} state Global application state.\n *\n * @return {InserterMediaCategory[]} Client IDs of descendants.\n */\nexport const getInserterMediaCategories = createSelector(\n\t( state ) => {\n\t\tconst {\n\t\t\tsettings: {\n\t\t\t\tinserterMediaCategories,\n\t\t\t\tallowedMimeTypes,\n\t\t\t\tenableOpenverseMediaCategory,\n\t\t\t},\n\t\t\tregisteredInserterMediaCategories,\n\t\t} = state;\n\t\t// The allowed `mime_types` can be altered by `upload_mimes` filter and restrict\n\t\t// some of them. In this case we shouldn't add the category to the available media\n\t\t// categories list in the inserter.\n\t\tif (\n\t\t\t( ! inserterMediaCategories &&\n\t\t\t\t! registeredInserterMediaCategories.length ) ||\n\t\t\t! allowedMimeTypes\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t\tconst coreInserterMediaCategoriesNames =\n\t\t\tinserterMediaCategories?.map( ( { name } ) => name ) || [];\n\t\tconst mergedCategories = [\n\t\t\t...( inserterMediaCategories || [] ),\n\t\t\t...( registeredInserterMediaCategories || [] ).filter(\n\t\t\t\t( { name } ) =>\n\t\t\t\t\t! coreInserterMediaCategoriesNames.includes( name )\n\t\t\t),\n\t\t];\n\t\treturn mergedCategories.filter( ( category ) => {\n\t\t\t// Check if Openverse category is enabled.\n\t\t\tif (\n\t\t\t\t! enableOpenverseMediaCategory &&\n\t\t\t\tcategory.name === 'openverse'\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn Object.values( allowedMimeTypes ).some( ( mimeType ) =>\n\t\t\t\tmimeType.startsWith( `${ category.mediaType }/` )\n\t\t\t);\n\t\t} );\n\t},\n\t( state ) => [\n\t\tstate.settings.inserterMediaCategories,\n\t\tstate.settings.allowedMimeTypes,\n\t\tstate.settings.enableOpenverseMediaCategory,\n\t\tstate.registeredInserterMediaCategories,\n\t]\n);\n\n/**\n * Returns whether there is at least one allowed pattern for inner blocks children.\n * This is useful for deferring the parsing of all patterns until needed.\n *\n * @param {Object} state Editor state.\n * @param {string} [rootClientId=null] Target root client ID.\n *\n * @return {boolean} If there is at least one allowed pattern.\n */\nexport const hasAllowedPatterns = createRegistrySelector( ( select ) =>\n\tcreateSelector(\n\t\t( state, rootClientId = null ) => {\n\t\t\tconst { getAllPatterns, __experimentalGetParsedPattern } = unlock(\n\t\t\t\tselect( STORE_NAME )\n\t\t\t);\n\t\t\tconst patterns = getAllPatterns();\n\t\t\tconst { allowedBlockTypes } = getSettings( state );\n\t\t\treturn patterns.some( ( { name, inserter = true } ) => {\n\t\t\t\tif ( ! inserter ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tconst { blocks } = __experimentalGetParsedPattern( name );\n\t\t\t\treturn (\n\t\t\t\t\tcheckAllowListRecursive( blocks, allowedBlockTypes ) &&\n\t\t\t\t\tblocks.every( ( { name: blockName } ) =>\n\t\t\t\t\t\tcanInsertBlockType( state, blockName, rootClientId )\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t} );\n\t\t},\n\t\t( state, rootClientId ) => [\n\t\t\t...getAllPatternsDependants( select )( state ),\n\t\t\t...getInsertBlockTypeDependants( state, rootClientId ),\n\t\t]\n\t)\n);\n\nfunction mapUserPattern(\n\tuserPattern,\n\t__experimentalUserPatternCategories = []\n) {\n\treturn {\n\t\tname: `core/block/${ userPattern.id }`,\n\t\tid: userPattern.id,\n\t\ttype: INSERTER_PATTERN_TYPES.user,\n\t\ttitle: userPattern.title.raw,\n\t\tcategories: userPattern.wp_pattern_category.map( ( catId ) => {\n\t\t\tconst category = __experimentalUserPatternCategories.find(\n\t\t\t\t( { id } ) => id === catId\n\t\t\t);\n\t\t\treturn category ? category.slug : catId;\n\t\t} ),\n\t\tcontent: userPattern.content.raw,\n\t\tsyncStatus: userPattern.wp_pattern_sync_status,\n\t};\n}\n\nexport const getPatternBySlug = createRegistrySelector( ( select ) =>\n\tcreateSelector(\n\t\t( state, patternName ) => {\n\t\t\t// Only fetch reusable blocks if we know we need them. To do: maybe\n\t\t\t// use the entity record API to retrieve the block by slug.\n\t\t\tif ( patternName?.startsWith( 'core/block/' ) ) {\n\t\t\t\tconst _id = parseInt(\n\t\t\t\t\tpatternName.slice( 'core/block/'.length ),\n\t\t\t\t\t10\n\t\t\t\t);\n\t\t\t\tconst block = unlock( select( STORE_NAME ) )\n\t\t\t\t\t.getReusableBlocks()\n\t\t\t\t\t.find( ( { id } ) => id === _id );\n\n\t\t\t\tif ( ! block ) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\treturn mapUserPattern(\n\t\t\t\t\tblock,\n\t\t\t\t\tstate.settings.__experimentalUserPatternCategories\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn [\n\t\t\t\t// This setting is left for back compat.\n\t\t\t\t...( state.settings.__experimentalBlockPatterns ?? [] ),\n\t\t\t\t...( state.settings[ selectBlockPatternsKey ]?.( select ) ??\n\t\t\t\t\t[] ),\n\t\t\t].find( ( { name } ) => name === patternName );\n\t\t},\n\t\t( state, patternName ) =>\n\t\t\tpatternName?.startsWith( 'core/block/' )\n\t\t\t\t? [\n\t\t\t\t\t\tunlock( select( STORE_NAME ) ).getReusableBlocks(),\n\t\t\t\t\t\tstate.settings.__experimentalReusableBlocks,\n\t\t\t\t ]\n\t\t\t\t: [\n\t\t\t\t\t\tstate.settings.__experimentalBlockPatterns,\n\t\t\t\t\t\tstate.settings[ selectBlockPatternsKey ]?.( select ),\n\t\t\t\t ]\n\t)\n);\n\nexport const getAllPatterns = createRegistrySelector( ( select ) =>\n\tcreateSelector( ( state ) => {\n\t\treturn [\n\t\t\t...unlock( select( STORE_NAME ) )\n\t\t\t\t.getReusableBlocks()\n\t\t\t\t.map( ( userPattern ) =>\n\t\t\t\t\tmapUserPattern(\n\t\t\t\t\t\tuserPattern,\n\t\t\t\t\t\tstate.settings.__experimentalUserPatternCategories\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t// This setting is left for back compat.\n\t\t\t...( state.settings.__experimentalBlockPatterns ?? [] ),\n\t\t\t...( state.settings[ selectBlockPatternsKey ]?.( select ) ?? [] ),\n\t\t].filter(\n\t\t\t( x, index, arr ) =>\n\t\t\t\tindex === arr.findIndex( ( y ) => x.name === y.name )\n\t\t);\n\t}, getAllPatternsDependants( select ) )\n);\n\nexport const isResolvingPatterns = createRegistrySelector( ( select ) =>\n\tcreateSelector( ( state ) => {\n\t\tconst blockPatternsSelect = state.settings[ selectBlockPatternsKey ];\n\t\tconst reusableBlocksSelect = state.settings[ reusableBlocksSelectKey ];\n\t\treturn (\n\t\t\t( blockPatternsSelect\n\t\t\t\t? blockPatternsSelect( select ) === undefined\n\t\t\t\t: false ) ||\n\t\t\t( reusableBlocksSelect\n\t\t\t\t? reusableBlocksSelect( select ) === undefined\n\t\t\t\t: false )\n\t\t);\n\t}, getAllPatternsDependants( select ) )\n);\n\nconst EMPTY_ARRAY = [];\n\nexport const getReusableBlocks = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tconst reusableBlocksSelect = state.settings[ reusableBlocksSelectKey ];\n\t\treturn reusableBlocksSelect\n\t\t\t? reusableBlocksSelect( select )\n\t\t\t: state.settings.__experimentalReusableBlocks ?? EMPTY_ARRAY;\n\t}\n);\n\n/**\n * Returns the element of the last element that had focus when focus left the editor canvas.\n *\n * @param {Object} state Block editor state.\n *\n * @return {Object} Element.\n */\nexport function getLastFocus( state ) {\n\treturn state.lastFocus;\n}\n\n/**\n * Returns true if the user is dragging anything, or false otherwise. It is possible for a\n * user to be dragging data from outside of the editor, so this selector is separate from\n * the `isDraggingBlocks` selector which only returns true if the user is dragging blocks.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether user is dragging.\n */\nexport function isDragging( state ) {\n\treturn state.isDragging;\n}\n\n/**\n * Retrieves the expanded block from the state.\n *\n * @param {Object} state Block editor state.\n *\n * @return {string|null} The client ID of the expanded block, if set.\n */\nexport function getExpandedBlock( state ) {\n\treturn state.expandedBlock;\n}\n\n/**\n * Retrieves the client ID of the ancestor block that is content locking the block\n * with the provided client ID.\n *\n * @param {Object} state Global application state.\n * @param {Object} clientId Client Id of the block.\n *\n * @return {?string} Client ID of the ancestor block that is content locking the block.\n */\nexport const getContentLockingParent = createSelector(\n\t( state, clientId ) => {\n\t\tlet current = clientId;\n\t\tlet result;\n\t\twhile ( ( current = state.blocks.parents.get( current ) ) ) {\n\t\t\tif (\n\t\t\t\tgetBlockName( state, current ) === 'core/block' ||\n\t\t\t\tgetTemplateLock( state, current ) === 'contentOnly'\n\t\t\t) {\n\t\t\t\tresult = current;\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t},\n\t( state ) => [ state.blocks.parents, state.blockListSettings ]\n);\n\n/**\n * Retrieves the client ID of the block that is content locked but is\n * currently being temporarily edited as a non-locked block.\n *\n * @param {Object} state Global application state.\n *\n * @return {?string} The client ID of the block being temporarily edited as a non-locked block.\n */\nexport function getTemporarilyEditingAsBlocks( state ) {\n\treturn state.temporarilyEditingAsBlocks;\n}\n\n/**\n * Returns the focus mode that should be reapplied when the user stops editing\n * a content locked blocks as a block without locking.\n *\n * @param {Object} state Global application state.\n *\n * @return {?string} The focus mode that should be re-set when temporarily editing as blocks stops.\n */\nexport function getTemporarilyEditingFocusModeToRevert( state ) {\n\treturn state.temporarilyEditingFocusModeRevert;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAKA,IAAAC,UAAA,GAAAD,OAAA;AAUA,IAAAE,MAAA,GAAAF,OAAA;AAKA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AAKA,IAAAO,iBAAA,GAAAP,OAAA;AA/BA;AACA;AACA;;AAGA;AACA;AACA;;AA0BA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASQ,sBAAsBA,CAAEC,KAAK,EAAG;EAC/C,OAAOA,KAAK,CAACD,sBAAsB;AACpC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,SAASE,8BAA8BA,CAAED,KAAK,EAAG;EACvD,OAAOA,KAAK,EAAEE,iBAAiB,EAAEC,SAAS;AAC3C;AAEO,SAASC,yBAAyBA,CAAEJ,KAAK,EAAEK,QAAQ,EAAG;EAC5D,OAAOL,KAAK,CAACM,MAAM,CAACC,UAAU,CAACC,GAAG,CAAEH,QAAS,CAAC;AAC/C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMI,sBAAsB,GAAGA,CAAET,KAAK,EAAEK,QAAQ,KAAM;EAC5D,MAAMK,sBAAsB,GAAKC,aAAa,IAAM;IACnD,OACC,IAAAC,8BAAmB,EAAEZ,KAAK,EAAEW,aAAc,CAAC,KAAK,UAAU,IAC1D,IAAAE,wBAAa,EAAEb,KAAK,EAAEW,aAAc,CAAC,CAACG,KAAK,CAC1CJ,sBAC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,KAAK,EAAEK,QAAQ,KAAM;EACtB,IAAIuI,OAAO,GAAGvI,QAAQ;EACtB,IAAIc,MAAM;EACV,OAAUyH,OAAO,GAAG5I,KAAK,CAACM,MAAM,CAAC4B,OAAO,CAAC1B,GAAG,CAAEoI,OAAQ,CAAC,EAAK;IAC3D,IACC,IAAAC,uBAAY,EAAE7I,KAAK,EAAE4I,OAAQ,CAAC,KAAK,YAAY,IAC/C,IAAAE,0BAAe,EAAE9I,KAAK,EAAE4I,OAAQ,CAAC,KAAK,aAAa,EAClD;MACDzH,MAAM,GAAGyH,OAAO;IACjB;EACD;EACA,OAAOzH,MAAM;AACd,CAAC,EACCnB,KAAK,IAAM,CAAEA,KAAK,CAACM,MAAM,CAAC4B,OAAO,EAAElC,KAAK,CAAC4B,iBAAiB,CAC7D,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASmH,6BAA6BA,CAAE/I,KAAK,EAAG;EACtD,OAAOA,KAAK,CAACgJ,0BAA0B;AACxC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,sCAAsCA,CAAEjJ,KAAK,EAAG;EAC/D,OAAOA,KAAK,CAACkJ,iCAAiC;AAC/C","ignoreList":[]}
@@ -316,12 +316,14 @@ const withBlockTree = reducer => (state = {}, action) => {
316
316
  {
317
317
  const inserterClientIds = getFlattenedClientIds(action.blocks);
318
318
  newState.tree = new Map(newState.tree);
319
- action.replacedClientIds.concat(
320
- // Controlled inner blocks are only removed
321
- // if the block doesn't move to another position
322
- // otherwise their content will be lost.
323
- action.replacedClientIds.filter(clientId => !inserterClientIds[clientId]).map(clientId => 'controlled||' + clientId)).forEach(key => {
324
- newState.tree.delete(key);
319
+ action.replacedClientIds.forEach(clientId => {
320
+ newState.tree.delete(clientId);
321
+ // Controlled inner blocks are only removed
322
+ // if the block doesn't move to another position
323
+ // otherwise their content will be lost.
324
+ if (!inserterClientIds[clientId]) {
325
+ newState.tree.delete('controlled||' + clientId);
326
+ }
325
327
  });
326
328
  updateBlockTreeForBlocks(newState, action.blocks);
327
329
  updateParentInnerBlocksInTree(newState, action.blocks.map(b => b.clientId), false);
@@ -346,8 +348,9 @@ const withBlockTree = reducer => (state = {}, action) => {
346
348
  }
347
349
  }
348
350
  newState.tree = new Map(newState.tree);
349
- action.removedClientIds.concat(action.removedClientIds.map(clientId => 'controlled||' + clientId)).forEach(key => {
350
- newState.tree.delete(key);
351
+ action.removedClientIds.forEach(clientId => {
352
+ newState.tree.delete(clientId);
353
+ newState.tree.delete('controlled||' + clientId);
351
354
  });
352
355
  updateParentInnerBlocksInTree(newState, parentsOfRemovedBlocks, true);
353
356
  break;