@wordpress/block-editor 12.18.2 → 12.19.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 (870) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/autocompleters/block.js +1 -2
  3. package/build/autocompleters/block.js.map +1 -1
  4. package/build/autocompleters/link.js +1 -2
  5. package/build/autocompleters/link.js.map +1 -1
  6. package/build/components/alignment-control/ui.js +1 -2
  7. package/build/components/alignment-control/ui.js.map +1 -1
  8. package/build/components/autocomplete/index.js +1 -2
  9. package/build/components/autocomplete/index.js.map +1 -1
  10. package/build/components/block-alignment-control/constants.js +2 -4
  11. package/build/components/block-alignment-control/constants.js.map +1 -1
  12. package/build/components/block-alignment-control/ui.js +1 -2
  13. package/build/components/block-alignment-control/ui.js.map +1 -1
  14. package/build/components/block-alignment-control/ui.native.js +1 -2
  15. package/build/components/block-alignment-control/ui.native.js.map +1 -1
  16. package/build/components/block-alignment-matrix-control/index.js +1 -2
  17. package/build/components/block-alignment-matrix-control/index.js.map +1 -1
  18. package/build/components/block-breadcrumb/index.js +1 -2
  19. package/build/components/block-breadcrumb/index.js.map +1 -1
  20. package/build/components/block-canvas/index.js +1 -2
  21. package/build/components/block-canvas/index.js.map +1 -1
  22. package/build/components/block-caption/index.native.js +1 -2
  23. package/build/components/block-caption/index.native.js.map +1 -1
  24. package/build/components/block-card/index.js +1 -2
  25. package/build/components/block-card/index.js.map +1 -1
  26. package/build/components/block-compare/index.js +1 -2
  27. package/build/components/block-compare/index.js.map +1 -1
  28. package/build/components/block-context/index.js +1 -2
  29. package/build/components/block-context/index.js.map +1 -1
  30. package/build/components/block-controls/groups.js +1 -2
  31. package/build/components/block-controls/groups.js.map +1 -1
  32. package/build/components/block-controls/index.js +1 -2
  33. package/build/components/block-controls/index.js.map +1 -1
  34. package/build/components/block-draggable/dropping-insertion-point.native.js +2 -2
  35. package/build/components/block-draggable/dropping-insertion-point.native.js.map +1 -1
  36. package/build/components/block-draggable/index.js +1 -2
  37. package/build/components/block-draggable/index.js.map +1 -1
  38. package/build/components/block-draggable/index.native.js +3 -4
  39. package/build/components/block-draggable/index.native.js.map +1 -1
  40. package/build/components/block-edit/context.js +4 -8
  41. package/build/components/block-edit/context.js.map +1 -1
  42. package/build/components/block-edit/edit.js +1 -2
  43. package/build/components/block-edit/edit.js.map +1 -1
  44. package/build/components/block-edit/edit.native.js +1 -2
  45. package/build/components/block-edit/edit.native.js.map +1 -1
  46. package/build/components/block-full-height-alignment-control/index.js +1 -2
  47. package/build/components/block-full-height-alignment-control/index.js.map +1 -1
  48. package/build/components/block-icon/index.js +1 -2
  49. package/build/components/block-icon/index.js.map +1 -1
  50. package/build/components/block-icon/index.native.js +1 -2
  51. package/build/components/block-icon/index.native.js.map +1 -1
  52. package/build/components/block-info-slot-fill/index.js +1 -2
  53. package/build/components/block-info-slot-fill/index.js.map +1 -1
  54. package/build/components/block-inspector/index.js +11 -9
  55. package/build/components/block-inspector/index.js.map +1 -1
  56. package/build/components/block-list/block-crash-boundary.js +1 -2
  57. package/build/components/block-list/block-crash-boundary.js.map +1 -1
  58. package/build/components/block-list/block-html.js +1 -2
  59. package/build/components/block-list/block-html.js.map +1 -1
  60. package/build/components/block-list/block-list-context.native.js +1 -2
  61. package/build/components/block-list/block-list-context.native.js.map +1 -1
  62. package/build/components/block-list/block-list-item-cell.native.js +1 -2
  63. package/build/components/block-list/block-list-item-cell.native.js.map +1 -1
  64. package/build/components/block-list/block-list-item.native.js +1 -2
  65. package/build/components/block-list/block-list-item.native.js.map +1 -1
  66. package/build/components/block-list/block-outline.native.js +1 -2
  67. package/build/components/block-list/block-outline.native.js.map +1 -1
  68. package/build/components/block-list/block-selection-button.native.js +1 -2
  69. package/build/components/block-list/block-selection-button.native.js.map +1 -1
  70. package/build/components/block-list/block.js +32 -21
  71. package/build/components/block-list/block.js.map +1 -1
  72. package/build/components/block-list/block.native.js +7 -6
  73. package/build/components/block-list/block.native.js.map +1 -1
  74. package/build/components/block-list/grid-item.native.js +1 -2
  75. package/build/components/block-list/grid-item.native.js.map +1 -1
  76. package/build/components/block-list/index.js +19 -9
  77. package/build/components/block-list/index.js.map +1 -1
  78. package/build/components/block-list/insertion-point.native.js +1 -2
  79. package/build/components/block-list/insertion-point.native.js.map +1 -1
  80. package/build/components/block-list/layout.js +2 -4
  81. package/build/components/block-list/layout.js.map +1 -1
  82. package/build/components/block-list/private-block-context.js +1 -2
  83. package/build/components/block-list/private-block-context.js.map +1 -1
  84. package/build/components/block-list/subdirectory-icon.js +1 -2
  85. package/build/components/block-list/subdirectory-icon.js.map +1 -1
  86. package/build/components/block-list/use-block-props/index.js +8 -1
  87. package/build/components/block-list/use-block-props/index.js.map +1 -1
  88. package/build/components/block-list/use-scroll-upon-insertion.native.js +1 -2
  89. package/build/components/block-list/use-scroll-upon-insertion.native.js.map +1 -1
  90. package/build/components/block-list-appender/index.js +5 -52
  91. package/build/components/block-list-appender/index.js.map +1 -1
  92. package/build/components/block-media-update-progress/index.native.js +11 -22
  93. package/build/components/block-media-update-progress/index.native.js.map +1 -1
  94. package/build/components/block-mover/button.js +2 -4
  95. package/build/components/block-mover/button.js.map +1 -1
  96. package/build/components/block-mover/index.js +1 -2
  97. package/build/components/block-mover/index.js.map +1 -1
  98. package/build/components/block-mover/index.native.js +3 -6
  99. package/build/components/block-mover/index.native.js.map +1 -1
  100. package/build/components/block-mover/mover-description.native.js +0 -2
  101. package/build/components/block-mover/mover-description.native.js.map +1 -1
  102. package/build/components/block-navigation/dropdown.js +1 -2
  103. package/build/components/block-navigation/dropdown.js.map +1 -1
  104. package/build/components/block-pattern-setup/constants.js +1 -2
  105. package/build/components/block-pattern-setup/constants.js.map +1 -1
  106. package/build/components/block-pattern-setup/index.js +1 -2
  107. package/build/components/block-pattern-setup/index.js.map +1 -1
  108. package/build/components/block-pattern-setup/setup-toolbar.js +1 -2
  109. package/build/components/block-pattern-setup/setup-toolbar.js.map +1 -1
  110. package/build/components/block-pattern-setup/use-patterns-setup.js +1 -2
  111. package/build/components/block-pattern-setup/use-patterns-setup.js.map +1 -1
  112. package/build/components/block-patterns-list/index.js +1 -2
  113. package/build/components/block-patterns-list/index.js.map +1 -1
  114. package/build/components/block-popover/drop-zone.js +1 -2
  115. package/build/components/block-popover/drop-zone.js.map +1 -1
  116. package/build/components/block-popover/inbetween.js +2 -4
  117. package/build/components/block-popover/inbetween.js.map +1 -1
  118. package/build/components/block-popover/index.js +1 -2
  119. package/build/components/block-popover/index.js.map +1 -1
  120. package/build/components/block-popover/use-popover-scroll.js +1 -2
  121. package/build/components/block-popover/use-popover-scroll.js.map +1 -1
  122. package/build/components/block-preview/auto.js +2 -1
  123. package/build/components/block-preview/auto.js.map +1 -1
  124. package/build/components/block-preview/index.js +1 -2
  125. package/build/components/block-preview/index.js.map +1 -1
  126. package/build/components/block-removal-warning-modal/index.js +4 -2
  127. package/build/components/block-removal-warning-modal/index.js.map +1 -1
  128. package/build/components/block-settings/button.native.js +1 -2
  129. package/build/components/block-settings/button.native.js.map +1 -1
  130. package/build/components/block-settings/container.native.js +1 -2
  131. package/build/components/block-settings/container.native.js.map +1 -1
  132. package/build/components/block-settings/index.native.js +2 -2
  133. package/build/components/block-settings/index.native.js.map +1 -1
  134. package/build/components/block-settings-menu/block-html-convert-button.js +1 -2
  135. package/build/components/block-settings-menu/block-html-convert-button.js.map +1 -1
  136. package/build/components/block-settings-menu/block-mode-toggle.js +1 -2
  137. package/build/components/block-settings-menu/block-mode-toggle.js.map +1 -1
  138. package/build/components/block-settings-menu/block-settings-dropdown.js +1 -2
  139. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  140. package/build/components/block-settings-menu/block-settings-menu-first-item.js +1 -2
  141. package/build/components/block-settings-menu/block-settings-menu-first-item.js.map +1 -1
  142. package/build/components/block-settings-menu/index.js +1 -2
  143. package/build/components/block-settings-menu/index.js.map +1 -1
  144. package/build/components/block-settings-menu-controls/index.js +1 -2
  145. package/build/components/block-settings-menu-controls/index.js.map +1 -1
  146. package/build/components/block-styles/index.js +1 -2
  147. package/build/components/block-styles/index.js.map +1 -1
  148. package/build/components/block-styles/index.native.js +1 -2
  149. package/build/components/block-styles/index.native.js.map +1 -1
  150. package/build/components/block-styles/preview.native.js +1 -2
  151. package/build/components/block-styles/preview.native.js.map +1 -1
  152. package/build/components/block-switcher/block-transformations-menu.js +1 -2
  153. package/build/components/block-switcher/block-transformations-menu.js.map +1 -1
  154. package/build/components/block-switcher/block-transformations-menu.native.js +1 -2
  155. package/build/components/block-switcher/block-transformations-menu.native.js.map +1 -1
  156. package/build/components/block-switcher/block-variation-transformations.js +1 -2
  157. package/build/components/block-switcher/block-variation-transformations.js.map +1 -1
  158. package/build/components/block-switcher/index.js +13 -11
  159. package/build/components/block-switcher/index.js.map +1 -1
  160. package/build/components/block-switcher/pattern-transformations-menu.js +1 -2
  161. package/build/components/block-switcher/pattern-transformations-menu.js.map +1 -1
  162. package/build/components/block-switcher/use-transformed-patterns.js +1 -2
  163. package/build/components/block-switcher/use-transformed-patterns.js.map +1 -1
  164. package/build/components/block-title/use-block-display-title.js +21 -28
  165. package/build/components/block-title/use-block-display-title.js.map +1 -1
  166. package/build/components/block-toolbar/block-name-context.js +1 -2
  167. package/build/components/block-toolbar/block-name-context.js.map +1 -1
  168. package/build/components/block-toolbar/block-toolbar-last-item.js +1 -2
  169. package/build/components/block-toolbar/block-toolbar-last-item.js.map +1 -1
  170. package/build/components/block-toolbar/block-toolbar-menu.native.js +1 -2
  171. package/build/components/block-toolbar/block-toolbar-menu.native.js.map +1 -1
  172. package/build/components/block-tools/block-selection-button.js +20 -18
  173. package/build/components/block-tools/block-selection-button.js.map +1 -1
  174. package/build/components/block-tools/index.js +4 -12
  175. package/build/components/block-tools/index.js.map +1 -1
  176. package/build/components/block-tools/insertion-point.js +1 -2
  177. package/build/components/block-tools/insertion-point.js.map +1 -1
  178. package/build/components/block-tools/zoom-out-mode-inserters.js +1 -2
  179. package/build/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
  180. package/build/components/block-types-list/index.js +1 -2
  181. package/build/components/block-types-list/index.js.map +1 -1
  182. package/build/components/block-variation-picker/index.js +1 -2
  183. package/build/components/block-variation-picker/index.js.map +1 -1
  184. package/build/components/block-variation-picker/index.native.js +1 -2
  185. package/build/components/block-variation-picker/index.native.js.map +1 -1
  186. package/build/components/block-variation-transforms/index.js +1 -2
  187. package/build/components/block-variation-transforms/index.js.map +1 -1
  188. package/build/components/block-vertical-alignment-control/icons.js +5 -10
  189. package/build/components/block-vertical-alignment-control/icons.js.map +1 -1
  190. package/build/components/block-vertical-alignment-control/ui.js +1 -2
  191. package/build/components/block-vertical-alignment-control/ui.js.map +1 -1
  192. package/build/components/button-block-appender/index.js +2 -4
  193. package/build/components/button-block-appender/index.js.map +1 -1
  194. package/build/components/button-block-appender/index.native.js +1 -2
  195. package/build/components/button-block-appender/index.native.js.map +1 -1
  196. package/build/components/caption/index.native.js +1 -2
  197. package/build/components/caption/index.native.js.map +1 -1
  198. package/build/components/color-palette/index.js +1 -2
  199. package/build/components/color-palette/index.js.map +1 -1
  200. package/build/components/color-palette/with-color-context.js +1 -2
  201. package/build/components/color-palette/with-color-context.js.map +1 -1
  202. package/build/components/color-style-selector/index.js +1 -2
  203. package/build/components/color-style-selector/index.js.map +1 -1
  204. package/build/components/colors/index.js +2 -2
  205. package/build/components/colors/index.js.map +1 -1
  206. package/build/components/colors-gradients/control.js +1 -3
  207. package/build/components/colors-gradients/control.js.map +1 -1
  208. package/build/components/colors-gradients/panel-color-gradient-settings.js +1 -2
  209. package/build/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
  210. package/build/components/contrast-checker/index.js +1 -2
  211. package/build/components/contrast-checker/index.js.map +1 -1
  212. package/build/components/contrast-checker/index.native.js +1 -2
  213. package/build/components/contrast-checker/index.native.js.map +1 -1
  214. package/build/components/convert-to-group-buttons/toolbar.js +1 -2
  215. package/build/components/convert-to-group-buttons/toolbar.js.map +1 -1
  216. package/build/components/default-block-appender/index.js +31 -40
  217. package/build/components/default-block-appender/index.js.map +1 -1
  218. package/build/components/default-block-appender/index.native.js +1 -2
  219. package/build/components/default-block-appender/index.native.js.map +1 -1
  220. package/build/components/dimensions-tool/aspect-ratio-tool.js +2 -2
  221. package/build/components/dimensions-tool/aspect-ratio-tool.js.map +1 -1
  222. package/build/components/dimensions-tool/index.js +1 -2
  223. package/build/components/dimensions-tool/index.js.map +1 -1
  224. package/build/components/duotone-control/index.js +1 -2
  225. package/build/components/duotone-control/index.js.map +1 -1
  226. package/build/components/editable-text/index.js +1 -2
  227. package/build/components/editable-text/index.js.map +1 -1
  228. package/build/components/floating-toolbar/index.native.js +1 -2
  229. package/build/components/floating-toolbar/index.native.js.map +1 -1
  230. package/build/components/floating-toolbar/nav-up-icon.js +1 -2
  231. package/build/components/floating-toolbar/nav-up-icon.js.map +1 -1
  232. package/build/components/font-sizes/font-size-picker.js +1 -2
  233. package/build/components/font-sizes/font-size-picker.js.map +1 -1
  234. package/build/components/global-styles/border-panel.js +56 -8
  235. package/build/components/global-styles/border-panel.js.map +1 -1
  236. package/build/components/global-styles/color-panel.native.js +1 -2
  237. package/build/components/global-styles/color-panel.native.js.map +1 -1
  238. package/build/components/global-styles/context.js +2 -4
  239. package/build/components/global-styles/context.js.map +1 -1
  240. package/build/components/global-styles/get-global-styles-changes.js +2 -4
  241. package/build/components/global-styles/get-global-styles-changes.js.map +1 -1
  242. package/build/components/global-styles/index.js +2 -15
  243. package/build/components/global-styles/index.js.map +1 -1
  244. package/build/components/global-styles/shadow-panel-components.js +133 -0
  245. package/build/components/global-styles/shadow-panel-components.js.map +1 -0
  246. package/build/components/global-styles/typography-panel.js +6 -7
  247. package/build/components/global-styles/typography-panel.js.map +1 -1
  248. package/build/components/global-styles/use-global-styles-output.js +1 -1
  249. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  250. package/build/components/global-styles/utils.js +38 -14
  251. package/build/components/global-styles/utils.js.map +1 -1
  252. package/build/components/iframe/index.js +1 -2
  253. package/build/components/iframe/index.js.map +1 -1
  254. package/build/components/image-editor/constants.js +3 -6
  255. package/build/components/image-editor/constants.js.map +1 -1
  256. package/build/components/image-link-destinations/index.native.js +1 -2
  257. package/build/components/image-link-destinations/index.native.js.map +1 -1
  258. package/build/components/index.js +2 -2
  259. package/build/components/index.js.map +1 -1
  260. package/build/components/index.native.js +2 -2
  261. package/build/components/index.native.js.map +1 -1
  262. package/build/components/inner-blocks/button-block-appender.js +1 -2
  263. package/build/components/inner-blocks/button-block-appender.js.map +1 -1
  264. package/build/components/inner-blocks/constants.native.js +1 -2
  265. package/build/components/inner-blocks/constants.native.js.map +1 -1
  266. package/build/components/inner-blocks/default-block-appender.js +1 -2
  267. package/build/components/inner-blocks/default-block-appender.js.map +1 -1
  268. package/build/components/inner-blocks/index.js +33 -30
  269. package/build/components/inner-blocks/index.js.map +1 -1
  270. package/build/components/inner-blocks/index.native.js +2 -6
  271. package/build/components/inner-blocks/index.native.js.map +1 -1
  272. package/build/components/inner-blocks/use-inner-block-template-sync.js +2 -3
  273. package/build/components/inner-blocks/use-inner-block-template-sync.js.map +1 -1
  274. package/build/components/inner-blocks/warning-max-depth-exceeded.native.js +1 -2
  275. package/build/components/inner-blocks/warning-max-depth-exceeded.native.js.map +1 -1
  276. package/build/components/inner-blocks/with-client-id.js +1 -2
  277. package/build/components/inner-blocks/with-client-id.js.map +1 -1
  278. package/build/components/inserter/block-patterns-explorer/index.js +1 -2
  279. package/build/components/inserter/block-patterns-explorer/index.js.map +1 -1
  280. package/build/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js +1 -2
  281. package/build/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js.map +1 -1
  282. package/build/components/inserter/block-patterns-explorer/pattern-list.js +1 -2
  283. package/build/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
  284. package/build/components/inserter/block-patterns-tab/index.js +1 -2
  285. package/build/components/inserter/block-patterns-tab/index.js.map +1 -1
  286. package/build/components/inserter/block-patterns-tab/patterns-filter.js +4 -4
  287. package/build/components/inserter/block-patterns-tab/patterns-filter.js.map +1 -1
  288. package/build/components/inserter/block-patterns-tab/utils.js +5 -9
  289. package/build/components/inserter/block-patterns-tab/utils.js.map +1 -1
  290. package/build/components/inserter/block-types-tab.js +1 -2
  291. package/build/components/inserter/block-types-tab.js.map +1 -1
  292. package/build/components/inserter/block-types-tab.native.js +1 -2
  293. package/build/components/inserter/block-types-tab.native.js.map +1 -1
  294. package/build/components/inserter/hooks/use-block-type-impressions.native.js +1 -2
  295. package/build/components/inserter/hooks/use-block-type-impressions.native.js.map +1 -1
  296. package/build/components/inserter/hooks/use-block-types-state.js +1 -2
  297. package/build/components/inserter/hooks/use-block-types-state.js.map +1 -1
  298. package/build/components/inserter/hooks/use-insertion-point.js +1 -2
  299. package/build/components/inserter/hooks/use-insertion-point.js.map +1 -1
  300. package/build/components/inserter/hooks/use-patterns-state.js +1 -2
  301. package/build/components/inserter/hooks/use-patterns-state.js.map +1 -1
  302. package/build/components/inserter/index.js +2 -4
  303. package/build/components/inserter/index.js.map +1 -1
  304. package/build/components/inserter/index.native.js +1 -2
  305. package/build/components/inserter/index.native.js.map +1 -1
  306. package/build/components/inserter/library.js +1 -2
  307. package/build/components/inserter/library.js.map +1 -1
  308. package/build/components/inserter/media-tab/media-list.js +1 -2
  309. package/build/components/inserter/media-tab/media-list.js.map +1 -1
  310. package/build/components/inserter/media-tab/media-tab.js +1 -2
  311. package/build/components/inserter/media-tab/media-tab.js.map +1 -1
  312. package/build/components/inserter/menu.js +1 -2
  313. package/build/components/inserter/menu.js.map +1 -1
  314. package/build/components/inserter/menu.native.js +1 -2
  315. package/build/components/inserter/menu.native.js.map +1 -1
  316. package/build/components/inserter/no-results.js +1 -2
  317. package/build/components/inserter/no-results.js.map +1 -1
  318. package/build/components/inserter/no-results.native.js +1 -2
  319. package/build/components/inserter/no-results.native.js.map +1 -1
  320. package/build/components/inserter/panel.js +1 -2
  321. package/build/components/inserter/panel.js.map +1 -1
  322. package/build/components/inserter/preview-panel.js +1 -2
  323. package/build/components/inserter/preview-panel.js.map +1 -1
  324. package/build/components/inserter/quick-inserter.js +3 -2
  325. package/build/components/inserter/quick-inserter.js.map +1 -1
  326. package/build/components/inserter/reusable-blocks-tab.native.js +1 -2
  327. package/build/components/inserter/reusable-blocks-tab.native.js.map +1 -1
  328. package/build/components/inserter/search-items.js +0 -1
  329. package/build/components/inserter/search-items.js.map +1 -1
  330. package/build/components/inserter/search-results.js +1 -2
  331. package/build/components/inserter/search-results.js.map +1 -1
  332. package/build/components/inserter/search-results.native.js +1 -2
  333. package/build/components/inserter/search-results.native.js.map +1 -1
  334. package/build/components/inserter/tabs.js +1 -2
  335. package/build/components/inserter/tabs.js.map +1 -1
  336. package/build/components/inserter/tabs.native.js +1 -2
  337. package/build/components/inserter/tabs.native.js.map +1 -1
  338. package/build/components/inserter/tips.js +1 -2
  339. package/build/components/inserter/tips.js.map +1 -1
  340. package/build/components/inserter-button/index.native.js +1 -2
  341. package/build/components/inserter-button/index.native.js.map +1 -1
  342. package/build/components/inserter-button/sparkles.js +1 -2
  343. package/build/components/inserter-button/sparkles.js.map +1 -1
  344. package/build/components/inserter-draggable-blocks/index.js +11 -2
  345. package/build/components/inserter-draggable-blocks/index.js.map +1 -1
  346. package/build/components/inserter-list-item/index.js +1 -2
  347. package/build/components/inserter-list-item/index.js.map +1 -1
  348. package/build/components/inserter-listbox/context.js +1 -2
  349. package/build/components/inserter-listbox/context.js.map +1 -1
  350. package/build/components/inserter-listbox/group.js +1 -2
  351. package/build/components/inserter-listbox/group.js.map +1 -1
  352. package/build/components/inserter-listbox/index.js +1 -2
  353. package/build/components/inserter-listbox/index.js.map +1 -1
  354. package/build/components/inserter-listbox/item.js +1 -2
  355. package/build/components/inserter-listbox/item.js.map +1 -1
  356. package/build/components/inserter-listbox/row.js +1 -2
  357. package/build/components/inserter-listbox/row.js.map +1 -1
  358. package/build/components/inserter-menu-extension/index.js +1 -2
  359. package/build/components/inserter-menu-extension/index.js.map +1 -1
  360. package/build/components/inspector-controls/groups.js +1 -2
  361. package/build/components/inspector-controls/groups.js.map +1 -1
  362. package/build/components/inspector-controls/index.js +1 -2
  363. package/build/components/inspector-controls/index.js.map +1 -1
  364. package/build/components/inspector-controls-tabs/advanced-controls-panel.js +3 -4
  365. package/build/components/inspector-controls-tabs/advanced-controls-panel.js.map +1 -1
  366. package/build/components/inspector-controls-tabs/position-controls-panel.js +1 -2
  367. package/build/components/inspector-controls-tabs/position-controls-panel.js.map +1 -1
  368. package/build/components/inspector-controls-tabs/settings-tab.js +1 -2
  369. package/build/components/inspector-controls-tabs/settings-tab.js.map +1 -1
  370. package/build/components/inspector-controls-tabs/styles-tab.js +6 -6
  371. package/build/components/inspector-controls-tabs/styles-tab.js.map +1 -1
  372. package/build/components/inspector-controls-tabs/use-is-list-view-tab-disabled.js +1 -2
  373. package/build/components/inspector-controls-tabs/use-is-list-view-tab-disabled.js.map +1 -1
  374. package/build/components/inspector-controls-tabs/utils.js +3 -6
  375. package/build/components/inspector-controls-tabs/utils.js.map +1 -1
  376. package/build/components/justify-content-control/ui.js +1 -2
  377. package/build/components/justify-content-control/ui.js.map +1 -1
  378. package/build/components/keyboard-shortcuts/index.js +1 -2
  379. package/build/components/keyboard-shortcuts/index.js.map +1 -1
  380. package/build/components/line-height-control/index.js +1 -2
  381. package/build/components/line-height-control/index.js.map +1 -1
  382. package/build/components/line-height-control/utils.js +4 -8
  383. package/build/components/line-height-control/utils.js.map +1 -1
  384. package/build/components/link-control/constants.js +7 -14
  385. package/build/components/link-control/constants.js.map +1 -1
  386. package/build/components/link-control/index.js +2 -16
  387. package/build/components/link-control/index.js.map +1 -1
  388. package/build/components/link-control/link-preview.js +13 -15
  389. package/build/components/link-control/link-preview.js.map +1 -1
  390. package/build/components/link-control/search-create-button.js +1 -2
  391. package/build/components/link-control/search-create-button.js.map +1 -1
  392. package/build/components/link-control/search-input.js +1 -2
  393. package/build/components/link-control/search-input.js.map +1 -1
  394. package/build/components/link-control/search-item.js +1 -2
  395. package/build/components/link-control/search-item.js.map +1 -1
  396. package/build/components/link-control/settings-drawer.js +1 -2
  397. package/build/components/link-control/settings-drawer.js.map +1 -1
  398. package/build/components/link-control/settings.js +1 -2
  399. package/build/components/link-control/settings.js.map +1 -1
  400. package/build/components/link-control/use-create-page.js +0 -1
  401. package/build/components/link-control/use-create-page.js.map +1 -1
  402. package/build/components/link-control/use-rich-url-data.js +1 -2
  403. package/build/components/link-control/use-rich-url-data.js.map +1 -1
  404. package/build/components/link-control/viewer-slot.js +1 -2
  405. package/build/components/link-control/viewer-slot.js.map +1 -1
  406. package/build/components/list-view/appender.js +1 -2
  407. package/build/components/list-view/appender.js.map +1 -1
  408. package/build/components/list-view/block-contents.js +1 -2
  409. package/build/components/list-view/block-contents.js.map +1 -1
  410. package/build/components/list-view/block-select-button.js +1 -2
  411. package/build/components/list-view/block-select-button.js.map +1 -1
  412. package/build/components/list-view/block.js +33 -28
  413. package/build/components/list-view/block.js.map +1 -1
  414. package/build/components/list-view/branch.js +1 -2
  415. package/build/components/list-view/branch.js.map +1 -1
  416. package/build/components/list-view/context.js +1 -2
  417. package/build/components/list-view/context.js.map +1 -1
  418. package/build/components/list-view/index.js +20 -17
  419. package/build/components/list-view/index.js.map +1 -1
  420. package/build/components/list-view/leaf.js +1 -2
  421. package/build/components/list-view/leaf.js.map +1 -1
  422. package/build/components/list-view/use-clipboard-handler.js +159 -0
  423. package/build/components/list-view/use-clipboard-handler.js.map +1 -0
  424. package/build/components/list-view/use-list-view-drop-zone.js +1 -2
  425. package/build/components/list-view/use-list-view-drop-zone.js.map +1 -1
  426. package/build/components/list-view/utils.js +4 -4
  427. package/build/components/list-view/utils.js.map +1 -1
  428. package/build/components/media-placeholder/index.js +1 -2
  429. package/build/components/media-placeholder/index.js.map +1 -1
  430. package/build/components/media-placeholder/index.native.js +1 -2
  431. package/build/components/media-placeholder/index.native.js.map +1 -1
  432. package/build/components/media-replace-flow/index.js +1 -2
  433. package/build/components/media-replace-flow/index.js.map +1 -1
  434. package/build/components/media-replace-flow/index.native.js +1 -2
  435. package/build/components/media-replace-flow/index.native.js.map +1 -1
  436. package/build/components/media-upload/check.js +1 -2
  437. package/build/components/media-upload/check.js.map +1 -1
  438. package/build/components/media-upload/constants.native.js +8 -16
  439. package/build/components/media-upload/constants.native.js.map +1 -1
  440. package/build/components/media-upload/index.js +1 -2
  441. package/build/components/media-upload/index.js.map +1 -1
  442. package/build/components/media-upload/index.native.js +1 -2
  443. package/build/components/media-upload/index.native.js.map +1 -1
  444. package/build/components/media-upload-progress/constants.js +6 -12
  445. package/build/components/media-upload-progress/constants.js.map +1 -1
  446. package/build/components/media-upload-progress/index.native.js +1 -2
  447. package/build/components/media-upload-progress/index.native.js.map +1 -1
  448. package/build/components/multi-selection-inspector/index.js +1 -2
  449. package/build/components/multi-selection-inspector/index.js.map +1 -1
  450. package/build/components/navigable-toolbar/index.js +5 -2
  451. package/build/components/navigable-toolbar/index.js.map +1 -1
  452. package/build/components/observe-typing/index.js +1 -2
  453. package/build/components/observe-typing/index.js.map +1 -1
  454. package/build/components/panel-color-settings/index.js +1 -2
  455. package/build/components/panel-color-settings/index.js.map +1 -1
  456. package/build/components/plain-text/index.js +1 -2
  457. package/build/components/plain-text/index.js.map +1 -1
  458. package/build/components/provider/block-refs-provider.js +1 -2
  459. package/build/components/provider/block-refs-provider.js.map +1 -1
  460. package/build/components/provider/index.js +3 -5
  461. package/build/components/provider/index.js.map +1 -1
  462. package/build/components/provider/index.native.js +2 -4
  463. package/build/components/provider/index.native.js.map +1 -1
  464. package/build/components/provider/with-registry-provider.js +1 -2
  465. package/build/components/provider/with-registry-provider.js.map +1 -1
  466. package/build/components/publish-date-time-picker/index.js +1 -2
  467. package/build/components/publish-date-time-picker/index.js.map +1 -1
  468. package/build/components/responsive-block-control/index.js +3 -7
  469. package/build/components/responsive-block-control/index.js.map +1 -1
  470. package/build/components/rich-text/embed-handler-picker.native.js +1 -2
  471. package/build/components/rich-text/embed-handler-picker.native.js.map +1 -1
  472. package/build/components/rich-text/format-edit.js +1 -2
  473. package/build/components/rich-text/format-edit.js.map +1 -1
  474. package/build/components/rich-text/format-toolbar/index.js +1 -2
  475. package/build/components/rich-text/format-toolbar/index.js.map +1 -1
  476. package/build/components/rich-text/format-toolbar/index.native.js +1 -2
  477. package/build/components/rich-text/format-toolbar/index.native.js.map +1 -1
  478. package/build/components/rich-text/format-toolbar-container.js +1 -2
  479. package/build/components/rich-text/format-toolbar-container.js.map +1 -1
  480. package/build/components/rich-text/format-toolbar-container.native.js +1 -2
  481. package/build/components/rich-text/format-toolbar-container.native.js.map +1 -1
  482. package/build/components/rich-text/index.js +6 -7
  483. package/build/components/rich-text/index.js.map +1 -1
  484. package/build/components/rich-text/index.native.js +1 -2
  485. package/build/components/rich-text/index.native.js.map +1 -1
  486. package/build/components/rich-text/multiline.js +1 -2
  487. package/build/components/rich-text/multiline.js.map +1 -1
  488. package/build/components/rich-text/native/index.native.js +1 -6
  489. package/build/components/rich-text/native/index.native.js.map +1 -1
  490. package/build/components/rich-text/native/toolbar-button-with-options.native.js +1 -2
  491. package/build/components/rich-text/native/toolbar-button-with-options.native.js.map +1 -1
  492. package/build/components/skip-to-selected-block/index.js +1 -2
  493. package/build/components/skip-to-selected-block/index.js.map +1 -1
  494. package/build/components/spacing-sizes-control/index.js +3 -1
  495. package/build/components/spacing-sizes-control/index.js.map +1 -1
  496. package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js +0 -1
  497. package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
  498. package/build/components/spacing-sizes-control/utils.js +5 -10
  499. package/build/components/spacing-sizes-control/utils.js.map +1 -1
  500. package/build/components/tool-selector/index.js +1 -2
  501. package/build/components/tool-selector/index.js.map +1 -1
  502. package/build/components/typewriter/index.js +1 -2
  503. package/build/components/typewriter/index.js.map +1 -1
  504. package/build/components/ungroup-button/index.native.js +1 -2
  505. package/build/components/ungroup-button/index.native.js.map +1 -1
  506. package/build/components/unsupported-block-details/index.native.js +1 -2
  507. package/build/components/unsupported-block-details/index.native.js.map +1 -1
  508. package/build/components/url-input/button.js +1 -2
  509. package/build/components/url-input/button.js.map +1 -1
  510. package/build/components/url-input/index.js +1 -2
  511. package/build/components/url-input/index.js.map +1 -1
  512. package/build/components/url-popover/image-url-input-ui.js +18 -8
  513. package/build/components/url-popover/image-url-input-ui.js.map +1 -1
  514. package/build/components/url-popover/index.js +5 -5
  515. package/build/components/url-popover/index.js.map +1 -1
  516. package/build/components/use-block-drop-zone/index.js +15 -5
  517. package/build/components/use-block-drop-zone/index.js.map +1 -1
  518. package/build/components/use-flash-editable-blocks/index.js +60 -0
  519. package/build/components/use-flash-editable-blocks/index.js.map +1 -0
  520. package/build/components/use-moving-animation/index.js +1 -2
  521. package/build/components/use-moving-animation/index.js.map +1 -1
  522. package/build/components/use-on-block-drop/index.js +4 -4
  523. package/build/components/use-on-block-drop/index.js.map +1 -1
  524. package/build/components/use-settings/index.js +3 -162
  525. package/build/components/use-settings/index.js.map +1 -1
  526. package/build/components/video-player/gridicon-play.native.js +1 -2
  527. package/build/components/video-player/gridicon-play.native.js.map +1 -1
  528. package/build/components/video-player/index.native.js +2 -4
  529. package/build/components/video-player/index.native.js.map +1 -1
  530. package/build/components/warning/index.js +1 -2
  531. package/build/components/warning/index.js.map +1 -1
  532. package/build/components/warning/index.native.js +1 -2
  533. package/build/components/warning/index.native.js.map +1 -1
  534. package/build/components/writing-flow/index.js +1 -2
  535. package/build/components/writing-flow/index.js.map +1 -1
  536. package/build/components/writing-flow/use-clipboard-handler.js +3 -48
  537. package/build/components/writing-flow/use-clipboard-handler.js.map +1 -1
  538. package/build/components/writing-flow/use-drag-selection.js +13 -2
  539. package/build/components/writing-flow/use-drag-selection.js.map +1 -1
  540. package/build/components/writing-flow/utils.js +86 -0
  541. package/build/components/writing-flow/utils.js.map +1 -0
  542. package/build/hooks/align.js +1 -2
  543. package/build/hooks/align.js.map +1 -1
  544. package/build/hooks/align.native.js +2 -2
  545. package/build/hooks/align.native.js.map +1 -1
  546. package/build/hooks/anchor.js +1 -2
  547. package/build/hooks/anchor.js.map +1 -1
  548. package/build/hooks/aria-label.js +1 -2
  549. package/build/hooks/aria-label.js.map +1 -1
  550. package/build/hooks/background.js +52 -14
  551. package/build/hooks/background.js.map +1 -1
  552. package/build/hooks/block-hooks.js +1 -2
  553. package/build/hooks/block-hooks.js.map +1 -1
  554. package/build/hooks/block-renaming.js +1 -2
  555. package/build/hooks/block-renaming.js.map +1 -1
  556. package/build/hooks/border.js +42 -7
  557. package/build/hooks/border.js.map +1 -1
  558. package/build/hooks/color.js +4 -6
  559. package/build/hooks/color.js.map +1 -1
  560. package/build/hooks/content-lock-ui.js +1 -2
  561. package/build/hooks/content-lock-ui.js.map +1 -1
  562. package/build/hooks/custom-class-name.js +1 -2
  563. package/build/hooks/custom-class-name.js.map +1 -1
  564. package/build/hooks/custom-class-name.native.js +1 -2
  565. package/build/hooks/custom-class-name.native.js.map +1 -1
  566. package/build/hooks/dimensions.js +5 -10
  567. package/build/hooks/dimensions.js.map +1 -1
  568. package/build/hooks/duotone.js +1 -3
  569. package/build/hooks/duotone.js.map +1 -1
  570. package/build/hooks/font-family.js +2 -4
  571. package/build/hooks/font-family.js.map +1 -1
  572. package/build/hooks/font-size.js +25 -31
  573. package/build/hooks/font-size.js.map +1 -1
  574. package/build/hooks/index.js +2 -2
  575. package/build/hooks/index.js.map +1 -1
  576. package/build/hooks/layout-child.js +1 -2
  577. package/build/hooks/layout-child.js.map +1 -1
  578. package/build/hooks/layout.js +2 -4
  579. package/build/hooks/layout.js.map +1 -1
  580. package/build/hooks/line-height.js +1 -2
  581. package/build/hooks/line-height.js.map +1 -1
  582. package/build/hooks/position.js +1 -2
  583. package/build/hooks/position.js.map +1 -1
  584. package/build/hooks/style.js +3 -8
  585. package/build/hooks/style.js.map +1 -1
  586. package/build/hooks/typography.js +4 -6
  587. package/build/hooks/typography.js.map +1 -1
  588. package/build/hooks/typography.native.js +3 -6
  589. package/build/hooks/typography.native.js.map +1 -1
  590. package/build/hooks/use-bindings-attributes.js +10 -9
  591. package/build/hooks/use-bindings-attributes.js.map +1 -1
  592. package/build/layouts/constrained.js +1 -2
  593. package/build/layouts/constrained.js.map +1 -1
  594. package/build/layouts/definitions.js +1 -2
  595. package/build/layouts/definitions.js.map +1 -1
  596. package/build/layouts/flex.js +1 -2
  597. package/build/layouts/flex.js.map +1 -1
  598. package/build/layouts/flow.js +1 -2
  599. package/build/layouts/flow.js.map +1 -1
  600. package/build/layouts/grid.js +1 -2
  601. package/build/layouts/grid.js.map +1 -1
  602. package/build/private-apis.js +8 -5
  603. package/build/private-apis.js.map +1 -1
  604. package/build/private-apis.native.js +3 -4
  605. package/build/private-apis.native.js.map +1 -1
  606. package/build/store/actions.js +2 -4
  607. package/build/store/actions.js.map +1 -1
  608. package/build/store/constants.js +1 -2
  609. package/build/store/constants.js.map +1 -1
  610. package/build/store/defaults.js +2 -4
  611. package/build/store/defaults.js.map +1 -1
  612. package/build/store/defaults.native.js +1 -2
  613. package/build/store/defaults.native.js.map +1 -1
  614. package/build/store/get-block-settings.js +180 -0
  615. package/build/store/get-block-settings.js.map +1 -0
  616. package/build/store/index.js +4 -6
  617. package/build/store/index.js.map +1 -1
  618. package/build/store/private-actions.js +37 -3
  619. package/build/store/private-actions.js.map +1 -1
  620. package/build/store/private-selectors.js +55 -29
  621. package/build/store/private-selectors.js.map +1 -1
  622. package/build/store/reducer.js +27 -6
  623. package/build/store/reducer.js.map +1 -1
  624. package/build/store/selectors.js +98 -102
  625. package/build/store/selectors.js.map +1 -1
  626. package/build/store/undo-ignore.js +1 -2
  627. package/build/store/undo-ignore.js.map +1 -1
  628. package/build/utils/selection.js +1 -2
  629. package/build/utils/selection.js.map +1 -1
  630. package/build/utils/transform-styles/index.js +3 -4
  631. package/build/utils/transform-styles/index.js.map +1 -1
  632. package/build-module/components/block-breadcrumb/index.js +0 -1
  633. package/build-module/components/block-breadcrumb/index.js.map +1 -1
  634. package/build-module/components/block-inspector/index.js +10 -7
  635. package/build-module/components/block-inspector/index.js.map +1 -1
  636. package/build-module/components/block-list/block.js +32 -20
  637. package/build-module/components/block-list/block.js.map +1 -1
  638. package/build-module/components/block-list/block.native.js +6 -4
  639. package/build-module/components/block-list/block.native.js.map +1 -1
  640. package/build-module/components/block-list/index.js +18 -7
  641. package/build-module/components/block-list/index.js.map +1 -1
  642. package/build-module/components/block-list/use-block-props/index.js +8 -1
  643. package/build-module/components/block-list/use-block-props/index.js.map +1 -1
  644. package/build-module/components/block-list-appender/index.js +5 -51
  645. package/build-module/components/block-list-appender/index.js.map +1 -1
  646. package/build-module/components/block-mover/mover-description.native.js +0 -2
  647. package/build-module/components/block-mover/mover-description.native.js.map +1 -1
  648. package/build-module/components/block-popover/inbetween.js +0 -1
  649. package/build-module/components/block-popover/inbetween.js.map +1 -1
  650. package/build-module/components/block-preview/auto.js +2 -1
  651. package/build-module/components/block-preview/auto.js.map +1 -1
  652. package/build-module/components/block-removal-warning-modal/index.js +4 -2
  653. package/build-module/components/block-removal-warning-modal/index.js.map +1 -1
  654. package/build-module/components/block-switcher/index.js +12 -9
  655. package/build-module/components/block-switcher/index.js.map +1 -1
  656. package/build-module/components/block-title/use-block-display-title.js +22 -28
  657. package/build-module/components/block-title/use-block-display-title.js.map +1 -1
  658. package/build-module/components/block-tools/block-selection-button.js +20 -17
  659. package/build-module/components/block-tools/block-selection-button.js.map +1 -1
  660. package/build-module/components/block-tools/index.js +2 -10
  661. package/build-module/components/block-tools/index.js.map +1 -1
  662. package/build-module/components/colors-gradients/control.js +0 -1
  663. package/build-module/components/colors-gradients/control.js.map +1 -1
  664. package/build-module/components/default-block-appender/index.js +30 -37
  665. package/build-module/components/default-block-appender/index.js.map +1 -1
  666. package/build-module/components/global-styles/border-panel.js +57 -9
  667. package/build-module/components/global-styles/border-panel.js.map +1 -1
  668. package/build-module/components/global-styles/get-global-styles-changes.js +2 -4
  669. package/build-module/components/global-styles/get-global-styles-changes.js.map +1 -1
  670. package/build-module/components/global-styles/index.js +0 -1
  671. package/build-module/components/global-styles/index.js.map +1 -1
  672. package/build-module/components/global-styles/shadow-panel-components.js +121 -0
  673. package/build-module/components/global-styles/shadow-panel-components.js.map +1 -0
  674. package/build-module/components/global-styles/typography-panel.js +2 -3
  675. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  676. package/build-module/components/global-styles/use-global-styles-output.js +2 -2
  677. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  678. package/build-module/components/global-styles/utils.js +30 -1
  679. package/build-module/components/global-styles/utils.js.map +1 -1
  680. package/build-module/components/inner-blocks/index.js +33 -29
  681. package/build-module/components/inner-blocks/index.js.map +1 -1
  682. package/build-module/components/inner-blocks/index.native.js +1 -4
  683. package/build-module/components/inner-blocks/index.native.js.map +1 -1
  684. package/build-module/components/inner-blocks/use-inner-block-template-sync.js +2 -3
  685. package/build-module/components/inner-blocks/use-inner-block-template-sync.js.map +1 -1
  686. package/build-module/components/inserter/block-patterns-tab/patterns-filter.js +4 -4
  687. package/build-module/components/inserter/block-patterns-tab/patterns-filter.js.map +1 -1
  688. package/build-module/components/inserter/block-patterns-tab/utils.js +2 -2
  689. package/build-module/components/inserter/block-patterns-tab/utils.js.map +1 -1
  690. package/build-module/components/inserter/quick-inserter.js +3 -2
  691. package/build-module/components/inserter/quick-inserter.js.map +1 -1
  692. package/build-module/components/inserter/search-items.js +0 -1
  693. package/build-module/components/inserter/search-items.js.map +1 -1
  694. package/build-module/components/inserter-draggable-blocks/index.js +12 -1
  695. package/build-module/components/inserter-draggable-blocks/index.js.map +1 -1
  696. package/build-module/components/inspector-controls-tabs/styles-tab.js +5 -4
  697. package/build-module/components/inspector-controls-tabs/styles-tab.js.map +1 -1
  698. package/build-module/components/link-control/index.js +1 -14
  699. package/build-module/components/link-control/index.js.map +1 -1
  700. package/build-module/components/link-control/link-preview.js +16 -18
  701. package/build-module/components/link-control/link-preview.js.map +1 -1
  702. package/build-module/components/link-control/use-create-page.js +0 -1
  703. package/build-module/components/link-control/use-create-page.js.map +1 -1
  704. package/build-module/components/list-view/block.js +32 -26
  705. package/build-module/components/list-view/block.js.map +1 -1
  706. package/build-module/components/list-view/index.js +17 -11
  707. package/build-module/components/list-view/index.js.map +1 -1
  708. package/build-module/components/list-view/use-clipboard-handler.js +153 -0
  709. package/build-module/components/list-view/use-clipboard-handler.js.map +1 -0
  710. package/build-module/components/list-view/utils.js +4 -4
  711. package/build-module/components/list-view/utils.js.map +1 -1
  712. package/build-module/components/navigable-toolbar/index.js +5 -2
  713. package/build-module/components/navigable-toolbar/index.js.map +1 -1
  714. package/build-module/components/provider/index.js +1 -1
  715. package/build-module/components/provider/index.js.map +1 -1
  716. package/build-module/components/responsive-block-control/index.js +3 -6
  717. package/build-module/components/responsive-block-control/index.js.map +1 -1
  718. package/build-module/components/rich-text/index.js +3 -1
  719. package/build-module/components/rich-text/index.js.map +1 -1
  720. package/build-module/components/rich-text/native/index.native.js +0 -4
  721. package/build-module/components/rich-text/native/index.native.js.map +1 -1
  722. package/build-module/components/spacing-sizes-control/index.js +4 -2
  723. package/build-module/components/spacing-sizes-control/index.js.map +1 -1
  724. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js +0 -1
  725. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
  726. package/build-module/components/url-popover/image-url-input-ui.js +21 -11
  727. package/build-module/components/url-popover/image-url-input-ui.js.map +1 -1
  728. package/build-module/components/url-popover/index.js +5 -4
  729. package/build-module/components/url-popover/index.js.map +1 -1
  730. package/build-module/components/use-block-drop-zone/index.js +15 -5
  731. package/build-module/components/use-block-drop-zone/index.js.map +1 -1
  732. package/build-module/components/use-flash-editable-blocks/index.js +53 -0
  733. package/build-module/components/use-flash-editable-blocks/index.js.map +1 -0
  734. package/build-module/components/use-on-block-drop/index.js +4 -4
  735. package/build-module/components/use-on-block-drop/index.js.map +1 -1
  736. package/build-module/components/use-settings/index.js +3 -159
  737. package/build-module/components/use-settings/index.js.map +1 -1
  738. package/build-module/components/writing-flow/use-clipboard-handler.js +4 -49
  739. package/build-module/components/writing-flow/use-clipboard-handler.js.map +1 -1
  740. package/build-module/components/writing-flow/use-drag-selection.js +13 -2
  741. package/build-module/components/writing-flow/use-drag-selection.js.map +1 -1
  742. package/build-module/components/writing-flow/utils.js +79 -0
  743. package/build-module/components/writing-flow/utils.js.map +1 -0
  744. package/build-module/hooks/background.js +48 -10
  745. package/build-module/hooks/background.js.map +1 -1
  746. package/build-module/hooks/border.js +38 -3
  747. package/build-module/hooks/border.js.map +1 -1
  748. package/build-module/hooks/duotone.js +0 -1
  749. package/build-module/hooks/duotone.js.map +1 -1
  750. package/build-module/hooks/font-size.js +23 -27
  751. package/build-module/hooks/font-size.js.map +1 -1
  752. package/build-module/hooks/style.js +3 -7
  753. package/build-module/hooks/style.js.map +1 -1
  754. package/build-module/hooks/use-bindings-attributes.js +8 -11
  755. package/build-module/hooks/use-bindings-attributes.js.map +1 -1
  756. package/build-module/private-apis.js +5 -1
  757. package/build-module/private-apis.js.map +1 -1
  758. package/build-module/store/get-block-settings.js +171 -0
  759. package/build-module/store/get-block-settings.js.map +1 -0
  760. package/build-module/store/private-actions.js +35 -3
  761. package/build-module/store/private-actions.js.map +1 -1
  762. package/build-module/store/private-selectors.js +42 -19
  763. package/build-module/store/private-selectors.js.map +1 -1
  764. package/build-module/store/reducer.js +24 -2
  765. package/build-module/store/reducer.js.map +1 -1
  766. package/build-module/store/selectors.js +65 -34
  767. package/build-module/store/selectors.js.map +1 -1
  768. package/build-style/content-rtl.css +23 -15
  769. package/build-style/content.css +23 -15
  770. package/build-style/style-rtl.css +66 -53
  771. package/build-style/style.css +66 -53
  772. package/package.json +31 -31
  773. package/src/components/block-canvas/style.scss +1 -1
  774. package/src/components/block-card/style.scss +3 -1
  775. package/src/components/block-controls/README.md +2 -2
  776. package/src/components/block-inspector/index.js +11 -9
  777. package/src/components/block-list/block.js +45 -20
  778. package/src/components/block-list/block.native.js +7 -4
  779. package/src/components/block-list/content.scss +23 -28
  780. package/src/components/block-list/index.js +49 -25
  781. package/src/components/block-list/use-block-props/index.js +8 -0
  782. package/src/components/block-list-appender/index.js +7 -74
  783. package/src/components/block-mover/style.scss +4 -3
  784. package/src/components/block-preview/auto.js +2 -1
  785. package/src/components/block-removal-warning-modal/index.js +17 -10
  786. package/src/components/block-switcher/index.js +22 -13
  787. package/src/components/block-title/test/index.js +86 -85
  788. package/src/components/block-title/use-block-display-title.js +25 -36
  789. package/src/components/block-toolbar/style.scss +8 -1
  790. package/src/components/block-tools/block-selection-button.js +23 -26
  791. package/src/components/block-tools/index.js +2 -12
  792. package/src/components/colors-gradients/control.js +0 -1
  793. package/src/components/default-block-appender/index.js +26 -38
  794. package/src/components/default-block-appender/test/index.js +24 -16
  795. package/src/components/font-sizes/README.MD +0 -9
  796. package/src/components/global-styles/border-panel.js +72 -1
  797. package/src/components/global-styles/get-global-styles-changes.js +2 -8
  798. package/src/components/global-styles/index.js +0 -1
  799. package/src/components/global-styles/shadow-panel-components.js +125 -0
  800. package/src/components/global-styles/style.scss +8 -9
  801. package/src/components/global-styles/test/get-global-styles-changes.js +3 -3
  802. package/src/components/global-styles/test/use-global-styles-output.js +1 -1
  803. package/src/components/global-styles/test/utils.js +86 -0
  804. package/src/components/global-styles/typography-panel.js +1 -2
  805. package/src/components/global-styles/use-global-styles-output.js +5 -1
  806. package/src/components/global-styles/utils.js +36 -0
  807. package/src/components/inner-blocks/index.js +31 -32
  808. package/src/components/inner-blocks/index.native.js +3 -9
  809. package/src/components/inner-blocks/use-inner-block-template-sync.js +1 -3
  810. package/src/components/inserter/block-patterns-tab/patterns-filter.js +4 -10
  811. package/src/components/inserter/block-patterns-tab/utils.js +2 -2
  812. package/src/components/inserter/quick-inserter.js +4 -2
  813. package/src/components/inserter/style.scss +3 -13
  814. package/src/components/inserter-draggable-blocks/index.js +12 -1
  815. package/src/components/inspector-controls-tabs/styles-tab.js +4 -2
  816. package/src/components/link-control/index.js +1 -20
  817. package/src/components/link-control/link-preview.js +19 -24
  818. package/src/components/link-control/style.scss +5 -11
  819. package/src/components/link-control/test/index.js +11 -90
  820. package/src/components/list-view/block.js +49 -41
  821. package/src/components/list-view/index.js +22 -9
  822. package/src/components/list-view/use-clipboard-handler.js +199 -0
  823. package/src/components/list-view/utils.js +4 -4
  824. package/src/components/media-replace-flow/style.scss +1 -1
  825. package/src/components/media-replace-flow/test/index.js +1 -1
  826. package/src/components/navigable-toolbar/index.js +8 -4
  827. package/src/components/provider/index.js +1 -1
  828. package/src/components/responsive-block-control/index.js +3 -5
  829. package/src/components/rich-text/index.js +3 -1
  830. package/src/components/spacing-sizes-control/index.js +2 -1
  831. package/src/components/url-input/style.scss +4 -2
  832. package/src/components/url-popover/image-url-input-ui.js +22 -10
  833. package/src/components/url-popover/index.js +75 -69
  834. package/src/components/url-popover/style.scss +12 -21
  835. package/src/components/use-block-drop-zone/index.js +17 -3
  836. package/src/components/use-flash-editable-blocks/index.js +62 -0
  837. package/src/components/use-on-block-drop/index.js +11 -4
  838. package/src/components/use-settings/index.js +9 -232
  839. package/src/components/writing-flow/use-clipboard-handler.js +6 -78
  840. package/src/components/writing-flow/use-drag-selection.js +12 -3
  841. package/src/components/writing-flow/utils.js +103 -0
  842. package/src/hooks/background.js +53 -8
  843. package/src/hooks/border.js +47 -6
  844. package/src/hooks/font-size.js +33 -33
  845. package/src/hooks/style.js +5 -9
  846. package/src/hooks/test/background.js +50 -0
  847. package/src/hooks/test/font-size.js +164 -0
  848. package/src/hooks/use-bindings-attributes.js +8 -18
  849. package/src/private-apis.js +4 -0
  850. package/src/store/get-block-settings.js +225 -0
  851. package/src/store/private-actions.js +44 -2
  852. package/src/store/private-selectors.js +53 -38
  853. package/src/store/reducer.js +29 -1
  854. package/src/store/selectors.js +74 -48
  855. package/src/store/test/get-block-settings.js +90 -0
  856. package/src/store/test/private-actions.js +18 -0
  857. package/src/store/test/private-selectors.js +19 -0
  858. package/src/store/test/reducer.js +19 -0
  859. package/build/components/global-styles/effects-panel.js +0 -219
  860. package/build/components/global-styles/effects-panel.js.map +0 -1
  861. package/build/hooks/effects.js +0 -66
  862. package/build/hooks/effects.js.map +0 -1
  863. package/build-module/components/global-styles/effects-panel.js +0 -210
  864. package/build-module/components/global-styles/effects-panel.js.map +0 -1
  865. package/build-module/hooks/effects.js +0 -51
  866. package/build-module/hooks/effects.js.map +0 -1
  867. package/src/components/global-styles/effects-panel.js +0 -244
  868. package/src/components/use-settings/test/index.js +0 -141
  869. package/src/hooks/effects.js +0 -57
  870. package/src/hooks/test/effects.js +0 -39
@@ -0,0 +1,171 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { __EXPERIMENTAL_PATHS_WITH_MERGE as PATHS_WITH_MERGE, hasBlockSupport } from '@wordpress/blocks';
5
+ import { applyFilters } from '@wordpress/hooks';
6
+
7
+ /**
8
+ * Internal dependencies
9
+ */
10
+ import { getValueFromObjectPath } from '../utils/object';
11
+ import { getBlockName, getSettings, getBlockAttributes } from './selectors';
12
+ const blockedPaths = ['color', 'border', 'dimensions', 'typography', 'spacing'];
13
+ const deprecatedFlags = {
14
+ 'color.palette': settings => settings.colors,
15
+ 'color.gradients': settings => settings.gradients,
16
+ 'color.custom': settings => settings.disableCustomColors === undefined ? undefined : !settings.disableCustomColors,
17
+ 'color.customGradient': settings => settings.disableCustomGradients === undefined ? undefined : !settings.disableCustomGradients,
18
+ 'typography.fontSizes': settings => settings.fontSizes,
19
+ 'typography.customFontSize': settings => settings.disableCustomFontSizes === undefined ? undefined : !settings.disableCustomFontSizes,
20
+ 'typography.lineHeight': settings => settings.enableCustomLineHeight,
21
+ 'spacing.units': settings => {
22
+ if (settings.enableCustomUnits === undefined) {
23
+ return;
24
+ }
25
+ if (settings.enableCustomUnits === true) {
26
+ return ['px', 'em', 'rem', 'vh', 'vw', '%'];
27
+ }
28
+ return settings.enableCustomUnits;
29
+ },
30
+ 'spacing.padding': settings => settings.enableCustomSpacing
31
+ };
32
+ const prefixedFlags = {
33
+ /*
34
+ * These were only available in the plugin
35
+ * and can be removed when the minimum WordPress version
36
+ * for the plugin is 5.9.
37
+ */
38
+ 'border.customColor': 'border.color',
39
+ 'border.customStyle': 'border.style',
40
+ 'border.customWidth': 'border.width',
41
+ 'typography.customFontStyle': 'typography.fontStyle',
42
+ 'typography.customFontWeight': 'typography.fontWeight',
43
+ 'typography.customLetterSpacing': 'typography.letterSpacing',
44
+ 'typography.customTextDecorations': 'typography.textDecoration',
45
+ 'typography.customTextTransforms': 'typography.textTransform',
46
+ /*
47
+ * These were part of WordPress 5.8 and we need to keep them.
48
+ */
49
+ 'border.customRadius': 'border.radius',
50
+ 'spacing.customMargin': 'spacing.margin',
51
+ 'spacing.customPadding': 'spacing.padding',
52
+ 'typography.customLineHeight': 'typography.lineHeight'
53
+ };
54
+
55
+ /**
56
+ * Remove `custom` prefixes for flags that did not land in 5.8.
57
+ *
58
+ * This provides continued support for `custom` prefixed properties. It will
59
+ * be removed once third party devs have had sufficient time to update themes,
60
+ * plugins, etc.
61
+ *
62
+ * @see https://github.com/WordPress/gutenberg/pull/34485
63
+ *
64
+ * @param {string} path Path to desired value in settings.
65
+ * @return {string} The value for defined setting.
66
+ */
67
+ const removeCustomPrefixes = path => {
68
+ return prefixedFlags[path] || path;
69
+ };
70
+
71
+ /**
72
+ * For settings like `color.palette`, which have a value that is an object
73
+ * with `default`, `theme`, `custom`, with field values that are arrays of
74
+ * items, merge these three arrays into one and return it. The calculation
75
+ * is memoized so that identical input values produce identical output.
76
+ * @param {Object} value Object to merge
77
+ * @return {Array} Array of merged items
78
+ */
79
+ export function mergeOrigins(value) {
80
+ let result = mergeCache.get(value);
81
+ if (!result) {
82
+ result = ['default', 'theme', 'custom'].flatMap(key => {
83
+ var _value$key;
84
+ return (_value$key = value[key]) !== null && _value$key !== void 0 ? _value$key : [];
85
+ });
86
+ mergeCache.set(value, result);
87
+ }
88
+ return result;
89
+ }
90
+ const mergeCache = new WeakMap();
91
+
92
+ /**
93
+ * For settings like `color.palette`, which have a value that is an object
94
+ * with `default`, `theme`, `custom`, with field values that are arrays of
95
+ * items, see if any of the three origins have values.
96
+ *
97
+ * @param {Object} value Object to check
98
+ * @return {boolean} Whether the object has values in any of the three origins
99
+ */
100
+ export function hasMergedOrigins(value) {
101
+ return ['default', 'theme', 'custom'].some(key => value?.[key]?.length);
102
+ }
103
+ export function getBlockSettings(state, clientId, ...paths) {
104
+ const blockName = getBlockName(state, clientId);
105
+ const candidates = [];
106
+ if (clientId) {
107
+ let id = clientId;
108
+ do {
109
+ const name = getBlockName(state, id);
110
+ if (hasBlockSupport(name, '__experimentalSettings', false)) {
111
+ candidates.push(id);
112
+ }
113
+ } while (id = state.blocks.parents.get(id));
114
+ }
115
+ return paths.map(path => {
116
+ if (blockedPaths.includes(path)) {
117
+ // eslint-disable-next-line no-console
118
+ console.warn('Top level useSetting paths are disabled. Please use a subpath to query the information needed.');
119
+ return undefined;
120
+ }
121
+
122
+ // 0. Allow third parties to filter the block's settings at runtime.
123
+ let result = applyFilters('blockEditor.useSetting.before', undefined, path, clientId, blockName);
124
+ if (undefined !== result) {
125
+ return result;
126
+ }
127
+ const normalizedPath = removeCustomPrefixes(path);
128
+
129
+ // 1. Take settings from the block instance or its ancestors.
130
+ // Start from the current block and work our way up the ancestors.
131
+ for (const candidateClientId of candidates) {
132
+ var _getValueFromObjectPa;
133
+ const candidateAtts = getBlockAttributes(state, candidateClientId);
134
+ result = (_getValueFromObjectPa = getValueFromObjectPath(candidateAtts.settings?.blocks?.[blockName], normalizedPath)) !== null && _getValueFromObjectPa !== void 0 ? _getValueFromObjectPa : getValueFromObjectPath(candidateAtts.settings, normalizedPath);
135
+ if (result !== undefined) {
136
+ // Stop the search for more distant ancestors and move on.
137
+ break;
138
+ }
139
+ }
140
+
141
+ // 2. Fall back to the settings from the block editor store (__experimentalFeatures).
142
+ const settings = getSettings(state);
143
+ if (result === undefined && blockName) {
144
+ result = getValueFromObjectPath(settings.__experimentalFeatures?.blocks?.[blockName], normalizedPath);
145
+ }
146
+ if (result === undefined) {
147
+ result = getValueFromObjectPath(settings.__experimentalFeatures, normalizedPath);
148
+ }
149
+
150
+ // Return if the setting was found in either the block instance or the store.
151
+ if (result !== undefined) {
152
+ if (PATHS_WITH_MERGE[normalizedPath]) {
153
+ return mergeOrigins(result);
154
+ }
155
+ return result;
156
+ }
157
+
158
+ // 3. Otherwise, use deprecated settings.
159
+ const deprecatedSettingsValue = deprecatedFlags[normalizedPath]?.(settings);
160
+ if (deprecatedSettingsValue !== undefined) {
161
+ return deprecatedSettingsValue;
162
+ }
163
+
164
+ // 4. Fallback for typography.dropCap:
165
+ // This is only necessary to support typography.dropCap.
166
+ // when __experimentalFeatures are not present (core without plugin).
167
+ // To remove when __experimentalFeatures are ported to core.
168
+ return normalizedPath === 'typography.dropCap' ? true : undefined;
169
+ });
170
+ }
171
+ //# sourceMappingURL=get-block-settings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["__EXPERIMENTAL_PATHS_WITH_MERGE","PATHS_WITH_MERGE","hasBlockSupport","applyFilters","getValueFromObjectPath","getBlockName","getSettings","getBlockAttributes","blockedPaths","deprecatedFlags","settings","colors","gradients","disableCustomColors","undefined","disableCustomGradients","fontSizes","disableCustomFontSizes","enableCustomLineHeight","enableCustomUnits","enableCustomSpacing","prefixedFlags","removeCustomPrefixes","path","mergeOrigins","value","result","mergeCache","get","flatMap","key","_value$key","set","WeakMap","hasMergedOrigins","some","length","getBlockSettings","state","clientId","paths","blockName","candidates","id","name","push","blocks","parents","map","includes","console","warn","normalizedPath","candidateClientId","_getValueFromObjectPa","candidateAtts","__experimentalFeatures","deprecatedSettingsValue"],"sources":["@wordpress/block-editor/src/store/get-block-settings.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__EXPERIMENTAL_PATHS_WITH_MERGE as PATHS_WITH_MERGE,\n\thasBlockSupport,\n} from '@wordpress/blocks';\nimport { applyFilters } from '@wordpress/hooks';\n\n/**\n * Internal dependencies\n */\nimport { getValueFromObjectPath } from '../utils/object';\nimport { getBlockName, getSettings, getBlockAttributes } from './selectors';\n\nconst blockedPaths = [\n\t'color',\n\t'border',\n\t'dimensions',\n\t'typography',\n\t'spacing',\n];\n\nconst deprecatedFlags = {\n\t'color.palette': ( settings ) => settings.colors,\n\t'color.gradients': ( settings ) => settings.gradients,\n\t'color.custom': ( settings ) =>\n\t\tsettings.disableCustomColors === undefined\n\t\t\t? undefined\n\t\t\t: ! settings.disableCustomColors,\n\t'color.customGradient': ( settings ) =>\n\t\tsettings.disableCustomGradients === undefined\n\t\t\t? undefined\n\t\t\t: ! settings.disableCustomGradients,\n\t'typography.fontSizes': ( settings ) => settings.fontSizes,\n\t'typography.customFontSize': ( settings ) =>\n\t\tsettings.disableCustomFontSizes === undefined\n\t\t\t? undefined\n\t\t\t: ! settings.disableCustomFontSizes,\n\t'typography.lineHeight': ( settings ) => settings.enableCustomLineHeight,\n\t'spacing.units': ( settings ) => {\n\t\tif ( settings.enableCustomUnits === undefined ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( settings.enableCustomUnits === true ) {\n\t\t\treturn [ 'px', 'em', 'rem', 'vh', 'vw', '%' ];\n\t\t}\n\n\t\treturn settings.enableCustomUnits;\n\t},\n\t'spacing.padding': ( settings ) => settings.enableCustomSpacing,\n};\n\nconst prefixedFlags = {\n\t/*\n\t * These were only available in the plugin\n\t * and can be removed when the minimum WordPress version\n\t * for the plugin is 5.9.\n\t */\n\t'border.customColor': 'border.color',\n\t'border.customStyle': 'border.style',\n\t'border.customWidth': 'border.width',\n\t'typography.customFontStyle': 'typography.fontStyle',\n\t'typography.customFontWeight': 'typography.fontWeight',\n\t'typography.customLetterSpacing': 'typography.letterSpacing',\n\t'typography.customTextDecorations': 'typography.textDecoration',\n\t'typography.customTextTransforms': 'typography.textTransform',\n\t/*\n\t * These were part of WordPress 5.8 and we need to keep them.\n\t */\n\t'border.customRadius': 'border.radius',\n\t'spacing.customMargin': 'spacing.margin',\n\t'spacing.customPadding': 'spacing.padding',\n\t'typography.customLineHeight': 'typography.lineHeight',\n};\n\n/**\n * Remove `custom` prefixes for flags that did not land in 5.8.\n *\n * This provides continued support for `custom` prefixed properties. It will\n * be removed once third party devs have had sufficient time to update themes,\n * plugins, etc.\n *\n * @see https://github.com/WordPress/gutenberg/pull/34485\n *\n * @param {string} path Path to desired value in settings.\n * @return {string} The value for defined setting.\n */\nconst removeCustomPrefixes = ( path ) => {\n\treturn prefixedFlags[ path ] || path;\n};\n\n/**\n * For settings like `color.palette`, which have a value that is an object\n * with `default`, `theme`, `custom`, with field values that are arrays of\n * items, merge these three arrays into one and return it. The calculation\n * is memoized so that identical input values produce identical output.\n * @param {Object} value Object to merge\n * @return {Array} Array of merged items\n */\nexport function mergeOrigins( value ) {\n\tlet result = mergeCache.get( value );\n\tif ( ! result ) {\n\t\tresult = [ 'default', 'theme', 'custom' ].flatMap(\n\t\t\t( key ) => value[ key ] ?? []\n\t\t);\n\t\tmergeCache.set( value, result );\n\t}\n\treturn result;\n}\nconst mergeCache = new WeakMap();\n\n/**\n * For settings like `color.palette`, which have a value that is an object\n * with `default`, `theme`, `custom`, with field values that are arrays of\n * items, see if any of the three origins have values.\n *\n * @param {Object} value Object to check\n * @return {boolean} Whether the object has values in any of the three origins\n */\nexport function hasMergedOrigins( value ) {\n\treturn [ 'default', 'theme', 'custom' ].some(\n\t\t( key ) => value?.[ key ]?.length\n\t);\n}\n\nexport function getBlockSettings( state, clientId, ...paths ) {\n\tconst blockName = getBlockName( state, clientId );\n\tconst candidates = [];\n\n\tif ( clientId ) {\n\t\tlet id = clientId;\n\t\tdo {\n\t\t\tconst name = getBlockName( state, id );\n\t\t\tif ( hasBlockSupport( name, '__experimentalSettings', false ) ) {\n\t\t\t\tcandidates.push( id );\n\t\t\t}\n\t\t} while ( ( id = state.blocks.parents.get( id ) ) );\n\t}\n\n\treturn paths.map( ( path ) => {\n\t\tif ( blockedPaths.includes( path ) ) {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.warn(\n\t\t\t\t'Top level useSetting paths are disabled. Please use a subpath to query the information needed.'\n\t\t\t);\n\t\t\treturn undefined;\n\t\t}\n\n\t\t// 0. Allow third parties to filter the block's settings at runtime.\n\t\tlet result = applyFilters(\n\t\t\t'blockEditor.useSetting.before',\n\t\t\tundefined,\n\t\t\tpath,\n\t\t\tclientId,\n\t\t\tblockName\n\t\t);\n\n\t\tif ( undefined !== result ) {\n\t\t\treturn result;\n\t\t}\n\n\t\tconst normalizedPath = removeCustomPrefixes( path );\n\n\t\t// 1. Take settings from the block instance or its ancestors.\n\t\t// Start from the current block and work our way up the ancestors.\n\t\tfor ( const candidateClientId of candidates ) {\n\t\t\tconst candidateAtts = getBlockAttributes(\n\t\t\t\tstate,\n\t\t\t\tcandidateClientId\n\t\t\t);\n\t\t\tresult =\n\t\t\t\tgetValueFromObjectPath(\n\t\t\t\t\tcandidateAtts.settings?.blocks?.[ blockName ],\n\t\t\t\t\tnormalizedPath\n\t\t\t\t) ??\n\t\t\t\tgetValueFromObjectPath(\n\t\t\t\t\tcandidateAtts.settings,\n\t\t\t\t\tnormalizedPath\n\t\t\t\t);\n\t\t\tif ( result !== undefined ) {\n\t\t\t\t// Stop the search for more distant ancestors and move on.\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// 2. Fall back to the settings from the block editor store (__experimentalFeatures).\n\t\tconst settings = getSettings( state );\n\t\tif ( result === undefined && blockName ) {\n\t\t\tresult = getValueFromObjectPath(\n\t\t\t\tsettings.__experimentalFeatures?.blocks?.[ blockName ],\n\t\t\t\tnormalizedPath\n\t\t\t);\n\t\t}\n\n\t\tif ( result === undefined ) {\n\t\t\tresult = getValueFromObjectPath(\n\t\t\t\tsettings.__experimentalFeatures,\n\t\t\t\tnormalizedPath\n\t\t\t);\n\t\t}\n\n\t\t// Return if the setting was found in either the block instance or the store.\n\t\tif ( result !== undefined ) {\n\t\t\tif ( PATHS_WITH_MERGE[ normalizedPath ] ) {\n\t\t\t\treturn mergeOrigins( result );\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\t\t// 3. Otherwise, use deprecated settings.\n\t\tconst deprecatedSettingsValue =\n\t\t\tdeprecatedFlags[ normalizedPath ]?.( settings );\n\t\tif ( deprecatedSettingsValue !== undefined ) {\n\t\t\treturn deprecatedSettingsValue;\n\t\t}\n\n\t\t// 4. Fallback for typography.dropCap:\n\t\t// This is only necessary to support typography.dropCap.\n\t\t// when __experimentalFeatures are not present (core without plugin).\n\t\t// To remove when __experimentalFeatures are ported to core.\n\t\treturn normalizedPath === 'typography.dropCap' ? true : undefined;\n\t} );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SACCA,+BAA+B,IAAIC,gBAAgB,EACnDC,eAAe,QACT,mBAAmB;AAC1B,SAASC,YAAY,QAAQ,kBAAkB;;AAE/C;AACA;AACA;AACA,SAASC,sBAAsB,QAAQ,iBAAiB;AACxD,SAASC,YAAY,EAAEC,WAAW,EAAEC,kBAAkB,QAAQ,aAAa;AAE3E,MAAMC,YAAY,GAAG,CACpB,OAAO,EACP,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,SAAS,CACT;AAED,MAAMC,eAAe,GAAG;EACvB,eAAe,EAAIC,QAAQ,IAAMA,QAAQ,CAACC,MAAM;EAChD,iBAAiB,EAAID,QAAQ,IAAMA,QAAQ,CAACE,SAAS;EACrD,cAAc,EAAIF,QAAQ,IACzBA,QAAQ,CAACG,mBAAmB,KAAKC,SAAS,GACvCA,SAAS,GACT,CAAEJ,QAAQ,CAACG,mBAAmB;EAClC,sBAAsB,EAAIH,QAAQ,IACjCA,QAAQ,CAACK,sBAAsB,KAAKD,SAAS,GAC1CA,SAAS,GACT,CAAEJ,QAAQ,CAACK,sBAAsB;EACrC,sBAAsB,EAAIL,QAAQ,IAAMA,QAAQ,CAACM,SAAS;EAC1D,2BAA2B,EAAIN,QAAQ,IACtCA,QAAQ,CAACO,sBAAsB,KAAK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AC;MAC9B;MACA,OAAOA,MAAM;IACd;;IAEA;IACA,MAAM+B,uBAAuB,GAC5BhD,eAAe,CAAE2C,cAAc,CAAE,GAAI1C,QAAS,CAAC;IAChD,IAAK+C,uBAAuB,KAAK3C,SAAS,EAAG;MAC5C,OAAO2C,uBAAuB;IAC/B;;IAEA;IACA;IACA;IACA;IACA,OAAOL,cAAc,KAAK,oBAAoB,GAAG,IAAI,GAAGtC,SAAS;EAClE,CAAE,CAAC;AACJ"}
@@ -123,12 +123,20 @@ export const privateRemoveBlocks = (clientIds, selectPrevious = true, forceRemov
123
123
  // corresponding to "important" blocks, i.e. blocks that require a
124
124
  // removal prompt.
125
125
  const queue = [...clientIds];
126
+ let messageType = 'templates';
126
127
  while (queue.length) {
127
128
  const clientId = queue.shift();
128
129
  const blockName = select.getBlockName(clientId);
129
130
  if (rules[blockName]) {
130
131
  blockNamesForPrompt.add(blockName);
131
132
  }
133
+ if (rules['bindings/core/pattern-overrides']) {
134
+ const blockAttributes = select.getBlockAttributes(clientId);
135
+ if (blockAttributes?.metadata?.bindings && JSON.stringify(blockAttributes.metadata.bindings).includes('core/pattern-overrides')) {
136
+ blockNamesForPrompt.add(blockName);
137
+ messageType = 'patternOverrides';
138
+ }
139
+ }
132
140
  const innerBlocks = select.getBlockOrder(clientId);
133
141
  queue.push(...innerBlocks);
134
142
  }
@@ -136,7 +144,7 @@ export const privateRemoveBlocks = (clientIds, selectPrevious = true, forceRemov
136
144
  // If any such blocks were found, trigger the removal prompt and
137
145
  // skip any other steps (thus postponing actual removal).
138
146
  if (blockNamesForPrompt.size) {
139
- dispatch(displayBlockRemovalPrompt(clientIds, selectPrevious, Array.from(blockNamesForPrompt)));
147
+ dispatch(displayBlockRemovalPrompt(clientIds, selectPrevious, Array.from(blockNamesForPrompt), messageType));
140
148
  return;
141
149
  }
142
150
  }
@@ -201,15 +209,17 @@ export const ensureDefaultBlock = () => ({
201
209
  * @param {string[]} blockNamesForPrompt Names of the blocks that
202
210
  * triggered the need for
203
211
  * confirmation before removal.
212
+ * @param {string} messageType The type of message to display.
204
213
  *
205
214
  * @return {Object} Action object.
206
215
  */
207
- function displayBlockRemovalPrompt(clientIds, selectPrevious, blockNamesForPrompt) {
216
+ function displayBlockRemovalPrompt(clientIds, selectPrevious, blockNamesForPrompt, messageType) {
208
217
  return {
209
218
  type: 'DISPLAY_BLOCK_REMOVAL_PROMPT',
210
219
  clientIds,
211
220
  selectPrevious,
212
- blockNamesForPrompt
221
+ blockNamesForPrompt,
222
+ messageType
213
223
  };
214
224
  }
215
225
 
@@ -361,4 +371,26 @@ export function registerBlockBindingsSource(source) {
361
371
  lockAttributesEditing: source.lockAttributesEditing
362
372
  };
363
373
  }
374
+
375
+ /**
376
+ * Returns an action object used in signalling that the user has begun to drag.
377
+ *
378
+ * @return {Object} Action object.
379
+ */
380
+ export function startDragging() {
381
+ return {
382
+ type: 'START_DRAGGING'
383
+ };
384
+ }
385
+
386
+ /**
387
+ * Returns an action object used in signalling that the user has stopped dragging.
388
+ *
389
+ * @return {Object} Action object.
390
+ */
391
+ export function stopDragging() {
392
+ return {
393
+ type: 'STOP_DRAGGING'
394
+ };
395
+ }
364
396
  //# sourceMappingURL=private-actions.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["Platform","undoIgnoreBlocks","castArray","maybeArray","Array","isArray","privateSettings","__experimentalUpdateSettings","settings","stripExperimentalSettings","reset","cleanSettings","OS","key","includes","type","hideBlockInterface","showBlockInterface","privateRemoveBlocks","clientIds","selectPrevious","forceRemove","select","dispatch","registry","length","rootClientId","getBlockRootClientId","canRemoveBlocks","rules","getBlockRemovalRules","blockNamesForPrompt","Set","queue","clientId","shift","blockName","getBlockName","add","innerBlocks","getBlockOrder","push","size","displayBlockRemovalPrompt","from","selectPreviousBlock","batch","ensureDefaultBlock","count","getBlockCount","__unstableHasCustomAppender","getSettings","insertDefaultBlock","clearBlockRemovalPrompt","setBlockRemovalRules","setOpenedBlockSettingsMenu","setStyleOverride","id","style","deleteStyleOverride","syncDerivedUpdates","callback","isPersistentChange","undefined","updatedBlocks","getBlocks","setLastFocus","lastFocus","stopEditingAsBlocks","focusModeToRevert","__unstableGetTemporarilyEditingFocusModeToRevert","__unstableMarkNextChangeAsNotPersistent","updateBlockAttributes","templateLock","updateBlockListSettings","getBlockListSettings","updateSettings","focusMode","__unstableSetTemporarilyEditingAsBlocks","registerBlockBindingsSource","source","sourceName","name","sourceLabel","label","useSource","lockAttributesEditing"],"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';\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\t\tif ( rules ) {\n\t\t\tconst blockNamesForPrompt = new Set();\n\n\t\t\t// Given a list of client IDs of blocks that the user intended to\n\t\t\t// remove, perform a tree search (BFS) to find all block names\n\t\t\t// corresponding to \"important\" blocks, i.e. blocks that require a\n\t\t\t// removal prompt.\n\t\t\tconst queue = [ ...clientIds ];\n\t\t\twhile ( queue.length ) {\n\t\t\t\tconst clientId = queue.shift();\n\t\t\t\tconst blockName = select.getBlockName( clientId );\n\t\t\t\tif ( rules[ blockName ] ) {\n\t\t\t\t\tblockNamesForPrompt.add( blockName );\n\t\t\t\t}\n\t\t\t\tconst innerBlocks = select.getBlockOrder( clientId );\n\t\t\t\tqueue.push( ...innerBlocks );\n\t\t\t}\n\n\t\t\t// If any such blocks were found, trigger the removal prompt and\n\t\t\t// skip any other steps (thus postponing actual removal).\n\t\t\tif ( blockNamesForPrompt.size ) {\n\t\t\t\tdispatch(\n\t\t\t\t\tdisplayBlockRemovalPrompt(\n\t\t\t\t\t\tclientIds,\n\t\t\t\t\t\tselectPrevious,\n\t\t\t\t\t\tArray.from( blockNamesForPrompt )\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\treturn;\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\n * or the immediate parent\n * (if no previous block exists)\n * should be selected\n * when a block is removed.\n * @param {string[]} blockNamesForPrompt Names of the blocks that\n * triggered the need for\n * confirmation before removal.\n *\n * @return {Object} Action object.\n */\nfunction displayBlockRemovalPrompt(\n\tclientIds,\n\tselectPrevious,\n\tblockNamesForPrompt\n) {\n\treturn {\n\t\ttype: 'DISPLAY_BLOCK_REMOVAL_PROMPT',\n\t\tclientIds,\n\t\tselectPrevious,\n\t\tblockNamesForPrompt,\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 } ) => {\n\t\tconst focusModeToRevert =\n\t\t\tselect.__unstableGetTemporarilyEditingFocusModeToRevert();\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\nexport function registerBlockBindingsSource( source ) {\n\treturn {\n\t\ttype: 'REGISTER_BLOCK_BINDINGS_SOURCE',\n\t\tsourceName: source.name,\n\t\tsourceLabel: source.label,\n\t\tuseSource: source.useSource,\n\t\tlockAttributesEditing: source.lockAttributesEditing,\n\t};\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,QAAQ,QAAQ,oBAAoB;;AAE7C;AACA;AACA;AACA,SAASC,gBAAgB,QAAQ,eAAe;AAEhD,MAAMC,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;AACA,OAAO,SAASC,4BAA4BA,CAC3CC,QAAQ,EACR;EAAEC,yBAAyB,GAAG,KAAK;EAAEC,KAAK,GAAG;AAAM,CAAC,GAAG,CAAC,CAAC,EACxD;EACD,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QAAS,CAAC;MAC1CuC,YAAY,EAAE;IACf,CAAE,CAAC;IACHlD,QAAQ,CAACqD,cAAc,CAAE;MAAEC,SAAS,EAAER;IAAkB,CAAE,CAAC;IAC3D9C,QAAQ,CAACuD,uCAAuC,CAAC,CAAC;EACnD,CAAC;AACF;AAEA,OAAO,SAASC,2BAA2BA,CAAEC,MAAM,EAAG;EACrD,OAAO;IACNjE,IAAI,EAAE,gCAAgC;IACtCkE,UAAU,EAAED,MAAM,CAACE,IAAI;IACvBC,WAAW,EAAEH,MAAM,CAACI,KAAK;IACzBC,SAAS,EAAEL,MAAM,CAACK,SAAS;IAC3BC,qBAAqB,EAAEN,MAAM,CAACM;EAC/B,CAAC;AACF"}
1
+ {"version":3,"names":["Platform","undoIgnoreBlocks","castArray","maybeArray","Array","isArray","privateSettings","__experimentalUpdateSettings","settings","stripExperimentalSettings","reset","cleanSettings","OS","key","includes","type","hideBlockInterface","showBlockInterface","privateRemoveBlocks","clientIds","selectPrevious","forceRemove","select","dispatch","registry","length","rootClientId","getBlockRootClientId","canRemoveBlocks","rules","getBlockRemovalRules","blockNamesForPrompt","Set","queue","messageType","clientId","shift","blockName","getBlockName","add","blockAttributes","getBlockAttributes","metadata","bindings","JSON","stringify","innerBlocks","getBlockOrder","push","size","displayBlockRemovalPrompt","from","selectPreviousBlock","batch","ensureDefaultBlock","count","getBlockCount","__unstableHasCustomAppender","getSettings","insertDefaultBlock","clearBlockRemovalPrompt","setBlockRemovalRules","setOpenedBlockSettingsMenu","setStyleOverride","id","style","deleteStyleOverride","syncDerivedUpdates","callback","isPersistentChange","undefined","updatedBlocks","getBlocks","setLastFocus","lastFocus","stopEditingAsBlocks","focusModeToRevert","__unstableGetTemporarilyEditingFocusModeToRevert","__unstableMarkNextChangeAsNotPersistent","updateBlockAttributes","templateLock","updateBlockListSettings","getBlockListSettings","updateSettings","focusMode","__unstableSetTemporarilyEditingAsBlocks","registerBlockBindingsSource","source","sourceName","name","sourceLabel","label","useSource","lockAttributesEditing","startDragging","stopDragging"],"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';\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\t\tif ( rules ) {\n\t\t\tconst blockNamesForPrompt = new Set();\n\n\t\t\t// Given a list of client IDs of blocks that the user intended to\n\t\t\t// remove, perform a tree search (BFS) to find all block names\n\t\t\t// corresponding to \"important\" blocks, i.e. blocks that require a\n\t\t\t// removal prompt.\n\t\t\tconst queue = [ ...clientIds ];\n\t\t\tlet messageType = 'templates';\n\t\t\twhile ( queue.length ) {\n\t\t\t\tconst clientId = queue.shift();\n\t\t\t\tconst blockName = select.getBlockName( clientId );\n\t\t\t\tif ( rules[ blockName ] ) {\n\t\t\t\t\tblockNamesForPrompt.add( blockName );\n\t\t\t\t}\n\n\t\t\t\tif ( rules[ 'bindings/core/pattern-overrides' ] ) {\n\t\t\t\t\tconst blockAttributes =\n\t\t\t\t\t\tselect.getBlockAttributes( clientId );\n\t\t\t\t\tif (\n\t\t\t\t\t\tblockAttributes?.metadata?.bindings &&\n\t\t\t\t\t\tJSON.stringify(\n\t\t\t\t\t\t\tblockAttributes.metadata.bindings\n\t\t\t\t\t\t).includes( 'core/pattern-overrides' )\n\t\t\t\t\t) {\n\t\t\t\t\t\tblockNamesForPrompt.add( blockName );\n\t\t\t\t\t\tmessageType = 'patternOverrides';\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst innerBlocks = select.getBlockOrder( clientId );\n\t\t\t\tqueue.push( ...innerBlocks );\n\t\t\t}\n\n\t\t\t// If any such blocks were found, trigger the removal prompt and\n\t\t\t// skip any other steps (thus postponing actual removal).\n\t\t\tif ( blockNamesForPrompt.size ) {\n\t\t\t\tdispatch(\n\t\t\t\t\tdisplayBlockRemovalPrompt(\n\t\t\t\t\t\tclientIds,\n\t\t\t\t\t\tselectPrevious,\n\t\t\t\t\t\tArray.from( blockNamesForPrompt ),\n\t\t\t\t\t\tmessageType\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\treturn;\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\n * or the immediate parent\n * (if no previous block exists)\n * should be selected\n * when a block is removed.\n * @param {string[]} blockNamesForPrompt Names of the blocks that\n * triggered the need for\n * confirmation before removal.\n * @param {string} messageType The type of message to display.\n *\n * @return {Object} Action object.\n */\nfunction displayBlockRemovalPrompt(\n\tclientIds,\n\tselectPrevious,\n\tblockNamesForPrompt,\n\tmessageType\n) {\n\treturn {\n\t\ttype: 'DISPLAY_BLOCK_REMOVAL_PROMPT',\n\t\tclientIds,\n\t\tselectPrevious,\n\t\tblockNamesForPrompt,\n\t\tmessageType,\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 } ) => {\n\t\tconst focusModeToRevert =\n\t\t\tselect.__unstableGetTemporarilyEditingFocusModeToRevert();\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\nexport function registerBlockBindingsSource( source ) {\n\treturn {\n\t\ttype: 'REGISTER_BLOCK_BINDINGS_SOURCE',\n\t\tsourceName: source.name,\n\t\tsourceLabel: source.label,\n\t\tuseSource: source.useSource,\n\t\tlockAttributesEditing: source.lockAttributesEditing,\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"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,QAAQ,QAAQ,oBAAoB;;AAE7C;A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CAACI,KAAK;IACzBC,SAAS,EAAEL,MAAM,CAACK,SAAS;IAC3BC,qBAAqB,EAAEN,MAAM,CAACM;EAC/B,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,aAAaA,CAAA,EAAG;EAC/B,OAAO;IACN/E,IAAI,EAAE;EACP,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASgF,YAAYA,CAAA,EAAG;EAC9B,OAAO;IACNhF,IAAI,EAAE;EACP,CAAC;AACF"}
@@ -14,8 +14,9 @@ import { createRegistrySelector } from '@wordpress/data';
14
14
  import { getBlockOrder, getBlockParents, getBlockEditingMode, getSettings, canInsertBlockType } from './selectors';
15
15
  import { checkAllowListRecursive, getAllPatternsDependants } from './utils';
16
16
  import { INSERTER_PATTERN_TYPES } from '../components/inserter/block-patterns-tab/utils';
17
- import { store } from './';
17
+ import { STORE_NAME } from './constants';
18
18
  import { unlock } from '../lock-unlock';
19
+ export { getBlockSettings } from './get-block-settings';
19
20
 
20
21
  /**
21
22
  * Returns true if the block interface is hidden, or false otherwise.
@@ -37,22 +38,41 @@ export function isBlockInterfaceHidden(state) {
37
38
  export function getLastInsertedBlocksClientIds(state) {
38
39
  return state?.lastBlockInserted?.clientIds;
39
40
  }
41
+ export function getBlockWithoutAttributes(state, clientId) {
42
+ return state.blocks.byClientId.get(clientId);
43
+ }
40
44
 
41
45
  /**
42
- * Returns true if the block with the given client ID and all of its descendants
46
+ * Returns true if all of the descendants of a block with the given client ID
43
47
  * have an editing mode of 'disabled', or false otherwise.
44
48
  *
45
49
  * @param {Object} state Global application state.
46
50
  * @param {string} clientId The block client ID.
47
51
  *
48
- * @return {boolean} Whether the block and its descendants are disabled.
52
+ * @return {boolean} Whether the block descendants are disabled.
49
53
  */
50
- export const isBlockSubtreeDisabled = createSelector((state, clientId) => {
54
+ export const isBlockSubtreeDisabled = (state, clientId) => {
51
55
  const isChildSubtreeDisabled = childClientId => {
52
56
  return getBlockEditingMode(state, childClientId) === 'disabled' && getBlockOrder(state, childClientId).every(isChildSubtreeDisabled);
53
57
  };
54
- return getBlockEditingMode(state, clientId) === 'disabled' && getBlockOrder(state, clientId).every(isChildSubtreeDisabled);
55
- }, state => [state.blocks.parents, state.blocks.order, state.blockEditingModes, state.blockListSettings]);
58
+ return getBlockOrder(state, clientId).every(isChildSubtreeDisabled);
59
+ };
60
+ function getEnabledClientIdsTreeUnmemoized(state, rootClientId) {
61
+ const blockOrder = getBlockOrder(state, rootClientId);
62
+ const result = [];
63
+ for (const clientId of blockOrder) {
64
+ const innerBlocks = getEnabledClientIdsTreeUnmemoized(state, clientId);
65
+ if (getBlockEditingMode(state, clientId) !== 'disabled') {
66
+ result.push({
67
+ clientId,
68
+ innerBlocks
69
+ });
70
+ } else {
71
+ result.push(...innerBlocks);
72
+ }
73
+ }
74
+ return result;
75
+ }
56
76
 
57
77
  /**
58
78
  * Returns a tree of block objects with only clientID and innerBlocks set.
@@ -63,17 +83,7 @@ export const isBlockSubtreeDisabled = createSelector((state, clientId) => {
63
83
  *
64
84
  * @return {Object[]} Tree of block objects with only clientID and innerBlocks set.
65
85
  */
66
- export const getEnabledClientIdsTree = createSelector((state, rootClientId = '') => {
67
- return getBlockOrder(state, rootClientId).flatMap(clientId => {
68
- if (getBlockEditingMode(state, clientId) !== 'disabled') {
69
- return [{
70
- clientId,
71
- innerBlocks: getEnabledClientIdsTree(state, clientId)
72
- }];
73
- }
74
- return getEnabledClientIdsTree(state, clientId);
75
- });
76
- }, state => [state.blocks.order, state.blockEditingModes, state.settings.templateLock, state.blockListSettings]);
86
+ export const getEnabledClientIdsTree = createSelector(getEnabledClientIdsTreeUnmemoized, state => [state.blocks.order, state.blockEditingModes, state.settings.templateLock, state.blockListSettings]);
77
87
 
78
88
  /**
79
89
  * Returns a list of a given block's ancestors, from top to bottom. Blocks with
@@ -202,7 +212,7 @@ export const hasAllowedPatterns = createRegistrySelector(select => createSelecto
202
212
  const {
203
213
  getAllPatterns,
204
214
  __experimentalGetParsedPattern
205
- } = unlock(select(store));
215
+ } = unlock(select(STORE_NAME));
206
216
  const patterns = getAllPatterns();
207
217
  const {
208
218
  allowedBlockTypes
@@ -245,7 +255,7 @@ export const getAllPatterns = createRegistrySelector(select => createSelector(st
245
255
  syncStatus: userPattern.wp_pattern_sync_status
246
256
  };
247
257
  });
248
- return [...userPatterns, ...__experimentalBlockPatterns, ...unlock(select(store)).getFetchedPatterns()].filter((x, index, arr) => index === arr.findIndex(y => x.name === y.name));
258
+ return [...userPatterns, ...__experimentalBlockPatterns, ...unlock(select(STORE_NAME)).getFetchedPatterns()].filter((x, index, arr) => index === arr.findIndex(y => x.name === y.name));
249
259
  }, getAllPatternsDependants));
250
260
 
251
261
  /**
@@ -264,4 +274,17 @@ export function getAllBlockBindingsSources(state) {
264
274
  export function getBlockBindingsSource(state, sourceName) {
265
275
  return state.blockBindingsSources[sourceName];
266
276
  }
277
+
278
+ /**
279
+ * Returns true if the user is dragging anything, or false otherwise. It is possible for a
280
+ * user to be dragging data from outside of the editor, so this selector is separate from
281
+ * the `isDraggingBlocks` selector which only returns true if the user is dragging blocks.
282
+ *
283
+ * @param {Object} state Global application state.
284
+ *
285
+ * @return {boolean} Whether user is dragging.
286
+ */
287
+ export function isDragging(state) {
288
+ return state.isDragging;
289
+ }
267
290
  //# sourceMappingURL=private-selectors.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createSelector","createRegistrySelector","getBlockOrder","getBlockParents","getBlockEditingMode","getSettings","canInsertBlockType","checkAllowListRecursive","getAllPatternsDependants","INSERTER_PATTERN_TYPES","store","unlock","isBlockInterfaceHidden","state","getLastInsertedBlocksClientIds","lastBlockInserted","clientIds","isBlockSubtreeDisabled","clientId","isChildSubtreeDisabled","childClientId","every","blocks","parents","order","blockEditingModes","blockListSettings","getEnabledClientIdsTree","rootClientId","flatMap","innerBlocks","settings","templateLock","getEnabledBlockParents","ascending","filter","parent","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","getFetchedPatterns","blockPatterns","hasAllowedPatterns","select","getAllPatterns","__experimentalGetParsedPattern","patterns","allowedBlockTypes","inserter","blockName","byClientId","get","__experimentalBlockPatterns","__experimentalUserPatternCategories","__experimentalReusableBlocks","userPatterns","userPattern","id","type","user","title","raw","categories","wp_pattern_category","catId","find","slug","content","syncStatus","wp_pattern_sync_status","x","index","arr","findIndex","y","getLastFocus","lastFocus","getAllBlockBindingsSources","blockBindingsSources","getBlockBindingsSource","sourceName"],"sources":["@wordpress/block-editor/src/store/private-selectors.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport createSelector from 'rememo';\n\n/**\n * WordPress dependencies\n */\nimport { createRegistrySelector } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport {\n\tgetBlockOrder,\n\tgetBlockParents,\n\tgetBlockEditingMode,\n\tgetSettings,\n\tcanInsertBlockType,\n} from './selectors';\nimport { checkAllowListRecursive, getAllPatternsDependants } from './utils';\nimport { INSERTER_PATTERN_TYPES } from '../components/inserter/block-patterns-tab/utils';\nimport { store } from './';\nimport { unlock } from '../lock-unlock';\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\n/**\n * Returns true if the block with the given client ID and all of its descendants\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 and its descendants are disabled.\n */\nexport const isBlockSubtreeDisabled = createSelector(\n\t( state, clientId ) => {\n\t\tconst isChildSubtreeDisabled = ( childClientId ) => {\n\t\t\treturn (\n\t\t\t\tgetBlockEditingMode( state, childClientId ) === 'disabled' &&\n\t\t\t\tgetBlockOrder( state, childClientId ).every(\n\t\t\t\t\tisChildSubtreeDisabled\n\t\t\t\t)\n\t\t\t);\n\t\t};\n\t\treturn (\n\t\t\tgetBlockEditingMode( state, clientId ) === 'disabled' &&\n\t\t\tgetBlockOrder( state, clientId ).every( isChildSubtreeDisabled )\n\t\t);\n\t},\n\t( state ) => [\n\t\tstate.blocks.parents,\n\t\tstate.blocks.order,\n\t\tstate.blockEditingModes,\n\t\tstate.blockListSettings,\n\t]\n);\n\n/**\n * Returns a tree of block objects with only clientID and innerBlocks set.\n * Blocks with a 'disabled' editing mode are not included.\n *\n * @param {Object} state Global application state.\n * @param {?string} rootClientId Optional root client ID of block list.\n *\n * @return {Object[]} Tree of block objects with only clientID and innerBlocks set.\n */\nexport const getEnabledClientIdsTree = createSelector(\n\t( state, rootClientId = '' ) => {\n\t\treturn getBlockOrder( state, rootClientId ).flatMap( ( clientId ) => {\n\t\t\tif ( getBlockEditingMode( state, clientId ) !== 'disabled' ) {\n\t\t\t\treturn [\n\t\t\t\t\t{\n\t\t\t\t\t\tclientId,\n\t\t\t\t\t\tinnerBlocks: getEnabledClientIdsTree( state, clientId ),\n\t\t\t\t\t},\n\t\t\t\t];\n\t\t\t}\n\t\t\treturn getEnabledClientIdsTree( state, clientId );\n\t\t} );\n\t},\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\nexport function getFetchedPatterns( state ) {\n\treturn state.blockPatterns;\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 )\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\tgetAllPatternsDependants( state ),\n\t\t\tstate.settings.allowedBlockTypes,\n\t\t\tstate.settings.templateLock,\n\t\t\tstate.blockListSettings[ rootClientId ],\n\t\t\tstate.blocks.byClientId.get( rootClientId ),\n\t\t]\n\t)\n);\n\nexport const getAllPatterns = createRegistrySelector( ( select ) =>\n\tcreateSelector( ( state ) => {\n\t\t// This setting is left for back compat.\n\t\tconst {\n\t\t\t__experimentalBlockPatterns = [],\n\t\t\t__experimentalUserPatternCategories = [],\n\t\t\t__experimentalReusableBlocks = [],\n\t\t} = state.settings;\n\t\tconst userPatterns = ( __experimentalReusableBlocks ?? [] ).map(\n\t\t\t( userPattern ) => {\n\t\t\t\treturn {\n\t\t\t\t\tname: `core/block/${ userPattern.id }`,\n\t\t\t\t\tid: userPattern.id,\n\t\t\t\t\ttype: INSERTER_PATTERN_TYPES.user,\n\t\t\t\t\ttitle: userPattern.title.raw,\n\t\t\t\t\tcategories: userPattern.wp_pattern_category.map(\n\t\t\t\t\t\t( catId ) => {\n\t\t\t\t\t\t\tconst category = (\n\t\t\t\t\t\t\t\t__experimentalUserPatternCategories ?? []\n\t\t\t\t\t\t\t).find( ( { id } ) => id === catId );\n\t\t\t\t\t\t\treturn category ? category.slug : catId;\n\t\t\t\t\t\t}\n\t\t\t\t\t),\n\t\t\t\t\tcontent: userPattern.content.raw,\n\t\t\t\t\tsyncStatus: userPattern.wp_pattern_sync_status,\n\t\t\t\t};\n\t\t\t}\n\t\t);\n\t\treturn [\n\t\t\t...userPatterns,\n\t\t\t...__experimentalBlockPatterns,\n\t\t\t...unlock( select( store ) ).getFetchedPatterns(),\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 )\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\nexport function getAllBlockBindingsSources( state ) {\n\treturn state.blockBindingsSources;\n}\n\nexport function getBlockBindingsSource( state, sourceName ) {\n\treturn state.blockBindingsSources[ sourceName ];\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,cAAc,MAAM,QAAQ;;AAEnC;AACA;AACA;AACA,SAASC,sBAAsB,QAAQ,iBAAiB;;AAExD;AACA;AACA;AACA,SACCC,aAAa,EACbC,eAAe,EACfC,mBAAmB,EACnBC,WAAW,EACXC,kBAAkB,QACZ,aAAa;AACpB,SAASC,uBAAuB,EAAEC,wBAAwB,QAAQ,SAAS;AAC3E,SAASC,sBAAsB,QAAQ,iDAAiD;AACxF,SAASC,KAAK,QAAQ,IAAI;AAC1B,SAASC,MAAM,QAAQ,gBAAgB;;AAEvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,sBAAsBA,CAAEC,KAAK,EAAG;EA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ACP,CAAE2D,CAAC,EAAEC,KAAK,EAAEC,GAAG,KACdD,KAAK,KAAKC,GAAG,CAACC,SAAS,CAAIC,CAAC,IAAMJ,CAAC,CAACxC,IAAI,KAAK4C,CAAC,CAAC5C,IAAK,CACtD,CAAC;AACF,CAAC,EAAE9C,wBAAyB,CAC7B,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAAS2F,YAAYA,CAAEtF,KAAK,EAAG;EACrC,OAAOA,KAAK,CAACuF,SAAS;AACvB;AAEA,OAAO,SAASC,0BAA0BA,CAAExF,KAAK,EAAG;EACnD,OAAOA,KAAK,CAACyF,oBAAoB;AAClC;AAEA,OAAO,SAASC,sBAAsBA,CAAE1F,KAAK,EAAE2F,UAAU,EAAG;EAC3D,OAAO3F,KAAK,CAACyF,oBAAoB,CAAEE,UAAU,CAAE;AAChD"}
1
+ {"version":3,"names":["createSelector","createRegistrySelector","getBlockOrder","getBlockParents","getBlockEditingMode","getSettings","canInsertBlockType","checkAllowListRecursive","getAllPatternsDependants","INSERTER_PATTERN_TYPES","STORE_NAME","unlock","getBlockSettings","isBlockInterfaceHidden","state","getLastInsertedBlocksClientIds","lastBlockInserted","clientIds","getBlockWithoutAttributes","clientId","blocks","byClientId","get","isBlockSubtreeDisabled","isChildSubtreeDisabled","childClientId","every","getEnabledClientIdsTreeUnmemoized","rootClientId","blockOrder","result","innerBlocks","push","getEnabledClientIdsTree","order","blockEditingModes","settings","templateLock","blockListSettings","getEnabledBlockParents","ascending","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","getFetchedPatterns","blockPatterns","hasAllowedPatterns","select","getAllPatterns","__experimentalGetParsedPattern","patterns","allowedBlockTypes","inserter","blockName","__experimentalBlockPatterns","__experimentalUserPatternCategories","__experimentalReusableBlocks","userPatterns","userPattern","id","type","user","title","raw","categories","wp_pattern_category","catId","find","slug","content","syncStatus","wp_pattern_sync_status","x","index","arr","findIndex","y","getLastFocus","lastFocus","getAllBlockBindingsSources","blockBindingsSources","getBlockBindingsSource","sourceName","isDragging"],"sources":["@wordpress/block-editor/src/store/private-selectors.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport createSelector from 'rememo';\n\n/**\n * WordPress dependencies\n */\nimport { createRegistrySelector } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport {\n\tgetBlockOrder,\n\tgetBlockParents,\n\tgetBlockEditingMode,\n\tgetSettings,\n\tcanInsertBlockType,\n} from './selectors';\nimport { checkAllowListRecursive, getAllPatternsDependants } from './utils';\nimport { INSERTER_PATTERN_TYPES } from '../components/inserter/block-patterns-tab/utils';\nimport { STORE_NAME } from './constants';\nimport { unlock } from '../lock-unlock';\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\nexport function getFetchedPatterns( state ) {\n\treturn state.blockPatterns;\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\tgetAllPatternsDependants( state ),\n\t\t\tstate.settings.allowedBlockTypes,\n\t\t\tstate.settings.templateLock,\n\t\t\tstate.blockListSettings[ rootClientId ],\n\t\t\tstate.blocks.byClientId.get( rootClientId ),\n\t\t]\n\t)\n);\n\nexport const getAllPatterns = createRegistrySelector( ( select ) =>\n\tcreateSelector( ( state ) => {\n\t\t// This setting is left for back compat.\n\t\tconst {\n\t\t\t__experimentalBlockPatterns = [],\n\t\t\t__experimentalUserPatternCategories = [],\n\t\t\t__experimentalReusableBlocks = [],\n\t\t} = state.settings;\n\t\tconst userPatterns = ( __experimentalReusableBlocks ?? [] ).map(\n\t\t\t( userPattern ) => {\n\t\t\t\treturn {\n\t\t\t\t\tname: `core/block/${ userPattern.id }`,\n\t\t\t\t\tid: userPattern.id,\n\t\t\t\t\ttype: INSERTER_PATTERN_TYPES.user,\n\t\t\t\t\ttitle: userPattern.title.raw,\n\t\t\t\t\tcategories: userPattern.wp_pattern_category.map(\n\t\t\t\t\t\t( catId ) => {\n\t\t\t\t\t\t\tconst category = (\n\t\t\t\t\t\t\t\t__experimentalUserPatternCategories ?? []\n\t\t\t\t\t\t\t).find( ( { id } ) => id === catId );\n\t\t\t\t\t\t\treturn category ? category.slug : catId;\n\t\t\t\t\t\t}\n\t\t\t\t\t),\n\t\t\t\t\tcontent: userPattern.content.raw,\n\t\t\t\t\tsyncStatus: userPattern.wp_pattern_sync_status,\n\t\t\t\t};\n\t\t\t}\n\t\t);\n\t\treturn [\n\t\t\t...userPatterns,\n\t\t\t...__experimentalBlockPatterns,\n\t\t\t...unlock( select( STORE_NAME ) ).getFetchedPatterns(),\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 )\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\nexport function getAllBlockBindingsSources( state ) {\n\treturn state.blockBindingsSources;\n}\n\nexport function getBlockBindingsSource( state, sourceName ) {\n\treturn state.blockBindingsSources[ sourceName ];\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"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,cAAc,MAAM,QAAQ;;AAEnC;AACA;AACA;AACA,SAASC,sBAAsB,QAAQ,iBAAiB;;AAExD;AACA;AACA;AACA,SACCC,aAAa,EACbC,eAAe,EACfC,mBAAmB,EACnBC,WAAW,EACXC,kBAAkB,QACZ,aAAa;AACpB,SAASC,uBAAuB,EAAEC,wBAAwB,QAAQ,SAAS;AAC3E,SAASC,sBAAsB,QAAQ,iDAAiD;AACxF,SAASC,UAAU,QAAQ,aAAa;AACxC,SAASC,MAAM,QAAQ,gBAAgB;AAEvC,SAASC,gBAAgB,QAAQ,sBAAsB;;AAEvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,sBAAsBA,CAAEC,KAAK,EAAG;EAC/C,OAAOA,KAAK,CAACD,sBAAsB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CAAC,CACtD,CAAC9B,MAAM,CACP,CAAE0D,CAAC,EAAEC,KAAK,EAAEC,GAAG,KACdD,KAAK,KAAKC,GAAG,CAACC,SAAS,CAAIC,CAAC,IAAMJ,CAAC,CAACtC,IAAI,KAAK0C,CAAC,CAAC1C,IAAK,CACtD,CAAC;AACF,CAAC,EAAErD,wBAAyB,CAC7B,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASgG,YAAYA,CAAE1F,KAAK,EAAG;EACrC,OAAOA,KAAK,CAAC2F,SAAS;AACvB;AAEA,OAAO,SAASC,0BAA0BA,CAAE5F,KAAK,EAAG;EACnD,OAAOA,KAAK,CAAC6F,oBAAoB;AAClC;AAEA,OAAO,SAASC,sBAAsBA,CAAE9F,KAAK,EAAE+F,UAAU,EAAG;EAC3D,OAAO/F,KAAK,CAAC6F,oBAAoB,CAAEE,UAAU,CAAE;AAChD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,UAAUA,CAAEhG,KAAK,EAAG;EACnC,OAAOA,KAAK,CAACgG,UAAU;AACxB"}
@@ -1059,6 +1059,25 @@ export function isTyping(state = false, action) {
1059
1059
  return state;
1060
1060
  }
1061
1061
 
1062
+ /**
1063
+ * Reducer returning dragging state. It is possible for a user to be dragging
1064
+ * data from outside of the editor, so this state is separate from `draggedBlocks`.
1065
+ *
1066
+ * @param {boolean} state Current state.
1067
+ * @param {Object} action Dispatched action.
1068
+ *
1069
+ * @return {boolean} Updated state.
1070
+ */
1071
+ export function isDragging(state = false, action) {
1072
+ switch (action.type) {
1073
+ case 'START_DRAGGING':
1074
+ return true;
1075
+ case 'STOP_DRAGGING':
1076
+ return false;
1077
+ }
1078
+ return state;
1079
+ }
1080
+
1062
1081
  /**
1063
1082
  * Reducer returning dragged block client id.
1064
1083
  *
@@ -1294,12 +1313,14 @@ function removalPromptData(state = false, action) {
1294
1313
  const {
1295
1314
  clientIds,
1296
1315
  selectPrevious,
1297
- blockNamesForPrompt
1316
+ blockNamesForPrompt,
1317
+ messageType
1298
1318
  } = action;
1299
1319
  return {
1300
1320
  clientIds,
1301
1321
  selectPrevious,
1302
- blockNamesForPrompt
1322
+ blockNamesForPrompt,
1323
+ messageType
1303
1324
  };
1304
1325
  case 'CLEAR_BLOCK_REMOVAL_PROMPT':
1305
1326
  return false;
@@ -1807,6 +1828,7 @@ function blockPatterns(state = [], action) {
1807
1828
  }
1808
1829
  const combinedReducers = combineReducers({
1809
1830
  blocks,
1831
+ isDragging,
1810
1832
  isTyping,
1811
1833
  isBlockInterfaceHidden,
1812
1834
  draggedBlocks,