@wordpress/block-editor 12.15.0 → 12.16.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 (500) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/README.md +9 -4
  3. package/build/components/block-canvas/index.js +22 -6
  4. package/build/components/block-canvas/index.js.map +1 -1
  5. package/build/components/block-card/index.js +1 -1
  6. package/build/components/block-card/index.js.map +1 -1
  7. package/build/components/block-controls/hook.js +3 -23
  8. package/build/components/block-controls/hook.js.map +1 -1
  9. package/build/components/block-edit/context.js +5 -1
  10. package/build/components/block-edit/context.js.map +1 -1
  11. package/build/components/block-edit/index.js +18 -9
  12. package/build/components/block-edit/index.js.map +1 -1
  13. package/build/components/block-info-slot-fill/index.js +3 -4
  14. package/build/components/block-info-slot-fill/index.js.map +1 -1
  15. package/build/components/block-list/block.js +28 -9
  16. package/build/components/block-list/block.js.map +1 -1
  17. package/build/components/block-list/block.native.js +14 -5
  18. package/build/components/block-list/block.native.js.map +1 -1
  19. package/build/components/block-list/use-block-props/index.js +61 -18
  20. package/build/components/block-list/use-block-props/index.js.map +1 -1
  21. package/build/components/block-list/use-block-props/use-focus-first-element.js +4 -29
  22. package/build/components/block-list/use-block-props/use-focus-first-element.js.map +1 -1
  23. package/build/components/block-list/use-block-props/use-is-hovered.js +4 -14
  24. package/build/components/block-list/use-block-props/use-is-hovered.js.map +1 -1
  25. package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js +4 -2
  26. package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
  27. package/build/components/block-patterns-list/index.js +1 -1
  28. package/build/components/block-patterns-list/index.js.map +1 -1
  29. package/build/components/block-removal-warning-modal/index.js +2 -9
  30. package/build/components/block-removal-warning-modal/index.js.map +1 -1
  31. package/build/components/block-rename/modal.js +3 -0
  32. package/build/components/block-rename/modal.js.map +1 -1
  33. package/build/components/block-settings/container.native.js +6 -4
  34. package/build/components/block-settings/container.native.js.map +1 -1
  35. package/build/components/block-styles/index.js +1 -1
  36. package/build/components/block-styles/index.js.map +1 -1
  37. package/build/components/block-styles/index.native.js +3 -2
  38. package/build/components/block-styles/index.native.js.map +1 -1
  39. package/build/components/block-toolbar/index.js +89 -27
  40. package/build/components/block-toolbar/index.js.map +1 -1
  41. package/build/components/block-tools/block-toolbar-breadcrumb.js +49 -0
  42. package/build/components/block-tools/block-toolbar-breadcrumb.js.map +1 -0
  43. package/build/components/block-tools/block-toolbar-popover.js +86 -0
  44. package/build/components/block-tools/block-toolbar-popover.js.map +1 -0
  45. package/build/components/block-tools/index.js +27 -24
  46. package/build/components/block-tools/index.js.map +1 -1
  47. package/build/components/block-types-list/index.native.js +4 -3
  48. package/build/components/block-types-list/index.native.js.map +1 -1
  49. package/build/components/block-variation-picker/index.native.js +2 -1
  50. package/build/components/block-variation-picker/index.native.js.map +1 -1
  51. package/build/components/colors-gradients/control.js +28 -17
  52. package/build/components/colors-gradients/control.js.map +1 -1
  53. package/build/components/duotone-control/index.js +1 -4
  54. package/build/components/duotone-control/index.js.map +1 -1
  55. package/build/components/global-styles/color-panel.js +22 -20
  56. package/build/components/global-styles/color-panel.js.map +1 -1
  57. package/build/components/global-styles/filters-panel.js +9 -3
  58. package/build/components/global-styles/filters-panel.js.map +1 -1
  59. package/build/components/global-styles/typography-panel.js +20 -31
  60. package/build/components/global-styles/typography-panel.js.map +1 -1
  61. package/build/components/image-link-destinations/index.native.js +118 -0
  62. package/build/components/image-link-destinations/index.native.js.map +1 -0
  63. package/build/components/index.native.js +8 -0
  64. package/build/components/index.native.js.map +1 -1
  65. package/build/components/inserter/media-tab/media-panel.js +2 -2
  66. package/build/components/inserter/media-tab/media-panel.js.map +1 -1
  67. package/build/components/inserter/menu.js +14 -7
  68. package/build/components/inserter/menu.js.map +1 -1
  69. package/build/components/inserter/preview-panel.js +2 -2
  70. package/build/components/inserter/preview-panel.js.map +1 -1
  71. package/build/components/inserter-button/index.native.js +98 -0
  72. package/build/components/inserter-button/index.native.js.map +1 -0
  73. package/build/components/inserter-button/sparkles.js +23 -0
  74. package/build/components/inserter-button/sparkles.js.map +1 -0
  75. package/build/components/inserter-draggable-blocks/index.js +8 -4
  76. package/build/components/inserter-draggable-blocks/index.js.map +1 -1
  77. package/build/components/inspector-controls/fill.js +3 -3
  78. package/build/components/inspector-controls/fill.js.map +1 -1
  79. package/build/components/inspector-controls/fill.native.js +3 -3
  80. package/build/components/inspector-controls/fill.native.js.map +1 -1
  81. package/build/components/navigable-toolbar/index.js +2 -2
  82. package/build/components/navigable-toolbar/index.js.map +1 -1
  83. package/build/components/preview-options/index.js +6 -62
  84. package/build/components/preview-options/index.js.map +1 -1
  85. package/build/components/rich-text/content.js +26 -23
  86. package/build/components/rich-text/content.js.map +1 -1
  87. package/build/components/rich-text/get-rich-text-values.js +2 -1
  88. package/build/components/rich-text/get-rich-text-values.js.map +1 -1
  89. package/build/components/rich-text/index.js +2 -30
  90. package/build/components/rich-text/index.js.map +1 -1
  91. package/build/components/rich-text/index.native.js +9 -16
  92. package/build/components/rich-text/index.native.js.map +1 -1
  93. package/build/components/rich-text/native/get-format-colors.native.js +22 -24
  94. package/build/components/rich-text/native/get-format-colors.native.js.map +1 -1
  95. package/build/components/rich-text/native/index.native.js +7 -34
  96. package/build/components/rich-text/native/index.native.js.map +1 -1
  97. package/build/components/rich-text/use-input-rules.js +5 -1
  98. package/build/components/rich-text/use-input-rules.js.map +1 -1
  99. package/build/components/rich-text/with-deprecations.js +50 -0
  100. package/build/components/rich-text/with-deprecations.js.map +1 -0
  101. package/build/components/use-block-drop-zone/index.js +70 -8
  102. package/build/components/use-block-drop-zone/index.js.map +1 -1
  103. package/build/components/use-on-block-drop/index.js +1 -1
  104. package/build/components/use-on-block-drop/index.js.map +1 -1
  105. package/build/components/use-resize-canvas/index.js +4 -1
  106. package/build/components/use-resize-canvas/index.js.map +1 -1
  107. package/build/components/use-settings/index.js +14 -0
  108. package/build/components/use-settings/index.js.map +1 -1
  109. package/build/hooks/align.js +20 -68
  110. package/build/hooks/align.js.map +1 -1
  111. package/build/hooks/align.native.js +11 -1
  112. package/build/hooks/align.native.js.map +1 -1
  113. package/build/hooks/anchor.js +13 -29
  114. package/build/hooks/anchor.js.map +1 -1
  115. package/build/hooks/background.js +28 -31
  116. package/build/hooks/background.js.map +1 -1
  117. package/build/hooks/block-hooks.js +24 -32
  118. package/build/hooks/block-hooks.js.map +1 -1
  119. package/build/hooks/block-renaming.js +18 -22
  120. package/build/hooks/block-renaming.js.map +1 -1
  121. package/build/hooks/border.js +58 -80
  122. package/build/hooks/border.js.map +1 -1
  123. package/build/hooks/color.js +76 -89
  124. package/build/hooks/color.js.map +1 -1
  125. package/build/hooks/content-lock-ui.js +29 -29
  126. package/build/hooks/content-lock-ui.js.map +1 -1
  127. package/build/hooks/custom-class-name.js +12 -29
  128. package/build/hooks/custom-class-name.js.map +1 -1
  129. package/build/hooks/custom-fields.js +24 -38
  130. package/build/hooks/custom-fields.js.map +1 -1
  131. package/build/hooks/dimensions.js +21 -17
  132. package/build/hooks/dimensions.js.map +1 -1
  133. package/build/hooks/duotone.js +31 -61
  134. package/build/hooks/duotone.js.map +1 -1
  135. package/build/hooks/font-family.js +16 -25
  136. package/build/hooks/font-family.js.map +1 -1
  137. package/build/hooks/font-size.js +51 -119
  138. package/build/hooks/font-size.js.map +1 -1
  139. package/build/hooks/index.js +25 -14
  140. package/build/hooks/index.js.map +1 -1
  141. package/build/hooks/index.native.js +10 -3
  142. package/build/hooks/index.native.js.map +1 -1
  143. package/build/hooks/layout-child.js +68 -0
  144. package/build/hooks/layout-child.js.map +1 -0
  145. package/build/hooks/layout.js +16 -101
  146. package/build/hooks/layout.js.map +1 -1
  147. package/build/hooks/padding.js +2 -2
  148. package/build/hooks/padding.js.map +1 -1
  149. package/build/hooks/position.js +40 -62
  150. package/build/hooks/position.js.map +1 -1
  151. package/build/hooks/style.js +51 -88
  152. package/build/hooks/style.js.map +1 -1
  153. package/build/hooks/typography.js +34 -14
  154. package/build/hooks/typography.js.map +1 -1
  155. package/build/hooks/utils.js +154 -7
  156. package/build/hooks/utils.js.map +1 -1
  157. package/build/private-apis.js +0 -2
  158. package/build/private-apis.js.map +1 -1
  159. package/build/store/private-actions.js +8 -0
  160. package/build/store/private-actions.js.map +1 -1
  161. package/build/store/private-selectors.js +34 -0
  162. package/build/store/private-selectors.js.map +1 -1
  163. package/build/store/reducer.js +8 -0
  164. package/build/store/reducer.js.map +1 -1
  165. package/build/store/selectors.js +10 -60
  166. package/build/store/selectors.js.map +1 -1
  167. package/build/store/utils.js +66 -0
  168. package/build/store/utils.js.map +1 -0
  169. package/build/utils/object.js +21 -61
  170. package/build/utils/object.js.map +1 -1
  171. package/build/utils/selection.js +9 -1
  172. package/build/utils/selection.js.map +1 -1
  173. package/build-module/components/block-canvas/index.js +23 -7
  174. package/build-module/components/block-canvas/index.js.map +1 -1
  175. package/build-module/components/block-card/index.js +1 -1
  176. package/build-module/components/block-card/index.js.map +1 -1
  177. package/build-module/components/block-controls/hook.js +4 -24
  178. package/build-module/components/block-controls/hook.js.map +1 -1
  179. package/build-module/components/block-edit/context.js +2 -0
  180. package/build-module/components/block-edit/context.js.map +1 -1
  181. package/build-module/components/block-edit/index.js +19 -10
  182. package/build-module/components/block-edit/index.js.map +1 -1
  183. package/build-module/components/block-info-slot-fill/index.js +3 -3
  184. package/build-module/components/block-info-slot-fill/index.js.map +1 -1
  185. package/build-module/components/block-list/block.js +29 -10
  186. package/build-module/components/block-list/block.js.map +1 -1
  187. package/build-module/components/block-list/block.native.js +14 -5
  188. package/build-module/components/block-list/block.native.js.map +1 -1
  189. package/build-module/components/block-list/use-block-props/index.js +62 -19
  190. package/build-module/components/block-list/use-block-props/index.js.map +1 -1
  191. package/build-module/components/block-list/use-block-props/use-focus-first-element.js +4 -29
  192. package/build-module/components/block-list/use-block-props/use-focus-first-element.js.map +1 -1
  193. package/build-module/components/block-list/use-block-props/use-is-hovered.js +4 -14
  194. package/build-module/components/block-list/use-block-props/use-is-hovered.js.map +1 -1
  195. package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js +4 -2
  196. package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
  197. package/build-module/components/block-patterns-list/index.js +1 -1
  198. package/build-module/components/block-patterns-list/index.js.map +1 -1
  199. package/build-module/components/block-removal-warning-modal/index.js +3 -10
  200. package/build-module/components/block-removal-warning-modal/index.js.map +1 -1
  201. package/build-module/components/block-rename/modal.js +3 -0
  202. package/build-module/components/block-rename/modal.js.map +1 -1
  203. package/build-module/components/block-settings/container.native.js +4 -2
  204. package/build-module/components/block-settings/container.native.js.map +1 -1
  205. package/build-module/components/block-styles/index.js +1 -1
  206. package/build-module/components/block-styles/index.js.map +1 -1
  207. package/build-module/components/block-styles/index.native.js +3 -2
  208. package/build-module/components/block-styles/index.native.js.map +1 -1
  209. package/build-module/components/block-toolbar/index.js +88 -25
  210. package/build-module/components/block-toolbar/index.js.map +1 -1
  211. package/build-module/components/block-tools/block-toolbar-breadcrumb.js +41 -0
  212. package/build-module/components/block-tools/block-toolbar-breadcrumb.js.map +1 -0
  213. package/build-module/components/block-tools/block-toolbar-popover.js +76 -0
  214. package/build-module/components/block-tools/block-toolbar-popover.js.map +1 -0
  215. package/build-module/components/block-tools/index.js +27 -24
  216. package/build-module/components/block-tools/index.js.map +1 -1
  217. package/build-module/components/block-types-list/index.native.js +2 -1
  218. package/build-module/components/block-types-list/index.native.js.map +1 -1
  219. package/build-module/components/block-variation-picker/index.native.js +2 -1
  220. package/build-module/components/block-variation-picker/index.native.js.map +1 -1
  221. package/build-module/components/colors-gradients/control.js +29 -18
  222. package/build-module/components/colors-gradients/control.js.map +1 -1
  223. package/build-module/components/duotone-control/index.js +1 -4
  224. package/build-module/components/duotone-control/index.js.map +1 -1
  225. package/build-module/components/global-styles/color-panel.js +23 -21
  226. package/build-module/components/global-styles/color-panel.js.map +1 -1
  227. package/build-module/components/global-styles/filters-panel.js +10 -4
  228. package/build-module/components/global-styles/filters-panel.js.map +1 -1
  229. package/build-module/components/global-styles/typography-panel.js +20 -31
  230. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  231. package/build-module/components/image-link-destinations/index.native.js +109 -0
  232. package/build-module/components/image-link-destinations/index.native.js.map +1 -0
  233. package/build-module/components/index.native.js +1 -0
  234. package/build-module/components/index.native.js.map +1 -1
  235. package/build-module/components/inserter/media-tab/media-panel.js +1 -1
  236. package/build-module/components/inserter/media-tab/media-panel.js.map +1 -1
  237. package/build-module/components/inserter/menu.js +14 -7
  238. package/build-module/components/inserter/menu.js.map +1 -1
  239. package/build-module/components/inserter/preview-panel.js +2 -2
  240. package/build-module/components/inserter/preview-panel.js.map +1 -1
  241. package/build-module/components/inserter-button/index.native.js +89 -0
  242. package/build-module/components/inserter-button/index.native.js.map +1 -0
  243. package/build-module/components/inserter-button/sparkles.js +15 -0
  244. package/build-module/components/inserter-button/sparkles.js.map +1 -0
  245. package/build-module/components/inserter-draggable-blocks/index.js +9 -5
  246. package/build-module/components/inserter-draggable-blocks/index.js.map +1 -1
  247. package/build-module/components/inspector-controls/fill.js +3 -3
  248. package/build-module/components/inspector-controls/fill.js.map +1 -1
  249. package/build-module/components/inspector-controls/fill.native.js +3 -3
  250. package/build-module/components/inspector-controls/fill.native.js.map +1 -1
  251. package/build-module/components/navigable-toolbar/index.js +2 -2
  252. package/build-module/components/navigable-toolbar/index.js.map +1 -1
  253. package/build-module/components/preview-options/index.js +6 -62
  254. package/build-module/components/preview-options/index.js.map +1 -1
  255. package/build-module/components/rich-text/content.js +25 -21
  256. package/build-module/components/rich-text/content.js.map +1 -1
  257. package/build-module/components/rich-text/get-rich-text-values.js +2 -1
  258. package/build-module/components/rich-text/get-rich-text-values.js.map +1 -1
  259. package/build-module/components/rich-text/index.js +4 -32
  260. package/build-module/components/rich-text/index.js.map +1 -1
  261. package/build-module/components/rich-text/index.native.js +10 -18
  262. package/build-module/components/rich-text/index.native.js.map +1 -1
  263. package/build-module/components/rich-text/native/get-format-colors.native.js +22 -24
  264. package/build-module/components/rich-text/native/get-format-colors.native.js.map +1 -1
  265. package/build-module/components/rich-text/native/index.native.js +7 -34
  266. package/build-module/components/rich-text/native/index.native.js.map +1 -1
  267. package/build-module/components/rich-text/use-input-rules.js +5 -1
  268. package/build-module/components/rich-text/use-input-rules.js.map +1 -1
  269. package/build-module/components/rich-text/with-deprecations.js +42 -0
  270. package/build-module/components/rich-text/with-deprecations.js.map +1 -0
  271. package/build-module/components/use-block-drop-zone/index.js +69 -8
  272. package/build-module/components/use-block-drop-zone/index.js.map +1 -1
  273. package/build-module/components/use-on-block-drop/index.js +1 -1
  274. package/build-module/components/use-on-block-drop/index.js.map +1 -1
  275. package/build-module/components/use-resize-canvas/index.js +4 -1
  276. package/build-module/components/use-resize-canvas/index.js.map +1 -1
  277. package/build-module/components/use-settings/index.js +13 -1
  278. package/build-module/components/use-settings/index.js.map +1 -1
  279. package/build-module/hooks/align.js +19 -66
  280. package/build-module/hooks/align.js.map +1 -1
  281. package/build-module/hooks/align.native.js +1 -0
  282. package/build-module/hooks/align.native.js.map +1 -1
  283. package/build-module/hooks/anchor.js +11 -26
  284. package/build-module/hooks/anchor.js.map +1 -1
  285. package/build-module/hooks/background.js +26 -28
  286. package/build-module/hooks/background.js.map +1 -1
  287. package/build-module/hooks/block-hooks.js +22 -30
  288. package/build-module/hooks/block-hooks.js.map +1 -1
  289. package/build-module/hooks/block-renaming.js +17 -21
  290. package/build-module/hooks/block-renaming.js.map +1 -1
  291. package/build-module/hooks/border.js +57 -78
  292. package/build-module/hooks/border.js.map +1 -1
  293. package/build-module/hooks/color.js +74 -86
  294. package/build-module/hooks/color.js.map +1 -1
  295. package/build-module/hooks/content-lock-ui.js +27 -27
  296. package/build-module/hooks/content-lock-ui.js.map +1 -1
  297. package/build-module/hooks/custom-class-name.js +11 -27
  298. package/build-module/hooks/custom-class-name.js.map +1 -1
  299. package/build-module/hooks/custom-fields.js +20 -39
  300. package/build-module/hooks/custom-fields.js.map +1 -1
  301. package/build-module/hooks/dimensions.js +21 -16
  302. package/build-module/hooks/dimensions.js.map +1 -1
  303. package/build-module/hooks/duotone.js +30 -61
  304. package/build-module/hooks/duotone.js.map +1 -1
  305. package/build-module/hooks/font-family.js +14 -23
  306. package/build-module/hooks/font-family.js.map +1 -1
  307. package/build-module/hooks/font-size.js +49 -119
  308. package/build-module/hooks/font-size.js.map +1 -1
  309. package/build-module/hooks/index.js +18 -14
  310. package/build-module/hooks/index.js.map +1 -1
  311. package/build-module/hooks/index.native.js +5 -3
  312. package/build-module/hooks/index.native.js.map +1 -1
  313. package/build-module/hooks/layout-child.js +60 -0
  314. package/build-module/hooks/layout-child.js.map +1 -0
  315. package/build-module/hooks/layout.js +13 -98
  316. package/build-module/hooks/layout.js.map +1 -1
  317. package/build-module/hooks/padding.js +2 -2
  318. package/build-module/hooks/padding.js.map +1 -1
  319. package/build-module/hooks/position.js +38 -59
  320. package/build-module/hooks/position.js.map +1 -1
  321. package/build-module/hooks/style.js +51 -84
  322. package/build-module/hooks/style.js.map +1 -1
  323. package/build-module/hooks/typography.js +33 -12
  324. package/build-module/hooks/typography.js.map +1 -1
  325. package/build-module/hooks/utils.js +149 -6
  326. package/build-module/hooks/utils.js.map +1 -1
  327. package/build-module/private-apis.js +0 -2
  328. package/build-module/private-apis.js.map +1 -1
  329. package/build-module/store/private-actions.js +7 -0
  330. package/build-module/store/private-actions.js.map +1 -1
  331. package/build-module/store/private-selectors.js +33 -1
  332. package/build-module/store/private-selectors.js.map +1 -1
  333. package/build-module/store/reducer.js +8 -0
  334. package/build-module/store/reducer.js.map +1 -1
  335. package/build-module/store/selectors.js +3 -53
  336. package/build-module/store/selectors.js.map +1 -1
  337. package/build-module/store/utils.js +56 -0
  338. package/build-module/store/utils.js.map +1 -0
  339. package/build-module/utils/object.js +21 -60
  340. package/build-module/utils/object.js.map +1 -1
  341. package/build-module/utils/selection.js +9 -1
  342. package/build-module/utils/selection.js.map +1 -1
  343. package/build-style/style-rtl.css +113 -293
  344. package/build-style/style.css +113 -293
  345. package/package.json +31 -31
  346. package/src/components/block-canvas/index.js +31 -17
  347. package/src/components/block-caption/README.md +2 -2
  348. package/src/components/block-card/index.js +5 -3
  349. package/src/components/block-card/style.scss +7 -3
  350. package/src/components/block-controls/hook.js +8 -30
  351. package/src/components/block-controls/test/index.js +3 -3
  352. package/src/components/block-edit/context.js +3 -0
  353. package/src/components/block-edit/index.js +36 -10
  354. package/src/components/block-info-slot-fill/index.js +6 -3
  355. package/src/components/block-inspector/style.scss +0 -4
  356. package/src/components/block-list/block.js +39 -5
  357. package/src/components/block-list/block.native.js +18 -4
  358. package/src/components/block-list/use-block-props/index.js +74 -21
  359. package/src/components/block-list/use-block-props/use-focus-first-element.js +1 -34
  360. package/src/components/block-list/use-block-props/use-is-hovered.js +2 -13
  361. package/src/components/block-list/use-block-props/use-selected-block-event-handlers.js +1 -5
  362. package/src/components/block-patterns-list/index.js +1 -1
  363. package/src/components/block-removal-warning-modal/index.js +7 -14
  364. package/src/components/block-rename/modal.js +7 -1
  365. package/src/components/block-settings/container.native.js +3 -5
  366. package/src/components/block-styles/index.js +1 -1
  367. package/src/components/block-styles/index.native.js +4 -2
  368. package/src/components/block-styles/style.scss +0 -11
  369. package/src/components/block-switcher/test/__snapshots__/index.js.snap +3 -1
  370. package/src/components/block-toolbar/index.js +180 -95
  371. package/src/components/block-toolbar/style.scss +50 -66
  372. package/src/components/block-tools/block-toolbar-breadcrumb.js +46 -0
  373. package/src/components/block-tools/block-toolbar-popover.js +90 -0
  374. package/src/components/block-tools/index.js +42 -29
  375. package/src/components/block-tools/style.scss +60 -172
  376. package/src/components/block-types-list/index.native.js +2 -1
  377. package/src/components/block-variation-picker/index.native.js +1 -1
  378. package/src/components/colors-gradients/control.js +49 -30
  379. package/src/components/colors-gradients/style.scss +0 -7
  380. package/src/components/duotone-control/index.js +2 -5
  381. package/src/components/duotone-control/style.scss +1 -6
  382. package/src/components/global-styles/color-panel.js +34 -25
  383. package/src/components/global-styles/filters-panel.js +8 -4
  384. package/src/components/global-styles/typography-panel.js +23 -43
  385. package/src/components/image-link-destinations/index.native.js +152 -0
  386. package/src/components/image-link-destinations/style.native.scss +16 -0
  387. package/src/components/index.native.js +1 -0
  388. package/src/components/inner-blocks/README.md +13 -2
  389. package/src/components/inserter/media-tab/media-panel.js +1 -1
  390. package/src/components/inserter/menu.js +16 -8
  391. package/src/components/inserter/preview-panel.js +2 -2
  392. package/src/components/inserter/style.scss +15 -17
  393. package/src/components/inserter-button/README.md +62 -0
  394. package/src/components/inserter-button/index.native.js +116 -0
  395. package/src/components/inserter-button/sparkles.js +15 -0
  396. package/src/components/inserter-button/style.native.scss +72 -0
  397. package/src/components/inserter-draggable-blocks/index.js +18 -5
  398. package/src/components/inspector-controls/fill.js +6 -3
  399. package/src/components/inspector-controls/fill.native.js +6 -3
  400. package/src/components/link-control/style.scss +1 -1
  401. package/src/components/link-control/test/index.js +1 -1
  402. package/src/components/navigable-toolbar/README.md +2 -0
  403. package/src/components/navigable-toolbar/index.js +2 -2
  404. package/src/components/preview-options/index.js +6 -86
  405. package/src/components/rich-text/content.js +27 -20
  406. package/src/components/rich-text/get-rich-text-values.js +6 -1
  407. package/src/components/rich-text/index.js +5 -46
  408. package/src/components/rich-text/index.native.js +8 -25
  409. package/src/components/rich-text/native/get-format-colors.native.js +33 -40
  410. package/src/components/rich-text/native/index.native.js +7 -48
  411. package/src/components/rich-text/use-input-rules.js +6 -1
  412. package/src/components/rich-text/with-deprecations.js +51 -0
  413. package/src/components/use-block-drop-zone/index.js +114 -14
  414. package/src/components/use-on-block-drop/index.js +2 -1
  415. package/src/components/use-resize-canvas/README.md +3 -3
  416. package/src/components/use-resize-canvas/index.js +4 -1
  417. package/src/components/use-settings/index.js +15 -1
  418. package/src/hooks/align.js +15 -76
  419. package/src/hooks/align.native.js +1 -0
  420. package/src/hooks/anchor.js +13 -33
  421. package/src/hooks/background.js +28 -23
  422. package/src/hooks/block-hooks.js +22 -51
  423. package/src/hooks/block-renaming.js +23 -37
  424. package/src/hooks/border.js +67 -118
  425. package/src/hooks/color.js +100 -132
  426. package/src/hooks/content-lock-ui.js +110 -122
  427. package/src/hooks/custom-class-name.js +8 -40
  428. package/src/hooks/custom-fields.js +20 -47
  429. package/src/hooks/dimensions.js +20 -16
  430. package/src/hooks/duotone.js +70 -127
  431. package/src/hooks/font-family.js +10 -29
  432. package/src/hooks/font-size.js +66 -162
  433. package/src/hooks/index.js +42 -14
  434. package/src/hooks/index.native.js +6 -3
  435. package/src/hooks/layout-child.js +53 -0
  436. package/src/hooks/layout.js +13 -102
  437. package/src/hooks/padding.js +2 -2
  438. package/src/hooks/position.js +50 -90
  439. package/src/hooks/style.js +117 -187
  440. package/src/hooks/test/align.js +1 -178
  441. package/src/hooks/typography.js +20 -16
  442. package/src/hooks/utils.js +187 -6
  443. package/src/private-apis.js +0 -2
  444. package/src/store/private-actions.js +8 -0
  445. package/src/store/private-selectors.js +45 -0
  446. package/src/store/reducer.js +8 -0
  447. package/src/store/selectors.js +5 -69
  448. package/src/store/utils.js +74 -0
  449. package/src/style.scss +0 -2
  450. package/src/utils/object.js +18 -69
  451. package/src/utils/selection.js +9 -2
  452. package/build/components/block-list/use-block-props/use-block-class-names.js +0 -67
  453. package/build/components/block-list/use-block-props/use-block-class-names.js.map +0 -1
  454. package/build/components/block-list/use-block-props/use-block-custom-class-name.js +0 -46
  455. package/build/components/block-list/use-block-props/use-block-custom-class-name.js.map +0 -1
  456. package/build/components/block-list/use-block-props/use-block-default-class-name.js +0 -37
  457. package/build/components/block-list/use-block-props/use-block-default-class-name.js.map +0 -1
  458. package/build/components/block-tools/back-compat.js +0 -45
  459. package/build/components/block-tools/back-compat.js.map +0 -1
  460. package/build/components/block-tools/block-contextual-toolbar.js +0 -91
  461. package/build/components/block-tools/block-contextual-toolbar.js.map +0 -1
  462. package/build/components/block-tools/selected-block-tools.js +0 -113
  463. package/build/components/block-tools/selected-block-tools.js.map +0 -1
  464. package/build/components/inserter/hooks/use-debounced-input.js +0 -22
  465. package/build/components/inserter/hooks/use-debounced-input.js.map +0 -1
  466. package/build/components/use-display-block-controls/index.js +0 -39
  467. package/build/components/use-display-block-controls/index.js.map +0 -1
  468. package/build/components/use-display-block-controls/index.native.js +0 -39
  469. package/build/components/use-display-block-controls/index.native.js.map +0 -1
  470. package/build-module/components/block-list/use-block-props/use-block-class-names.js +0 -60
  471. package/build-module/components/block-list/use-block-props/use-block-class-names.js.map +0 -1
  472. package/build-module/components/block-list/use-block-props/use-block-custom-class-name.js +0 -40
  473. package/build-module/components/block-list/use-block-props/use-block-custom-class-name.js.map +0 -1
  474. package/build-module/components/block-list/use-block-props/use-block-default-class-name.js +0 -31
  475. package/build-module/components/block-list/use-block-props/use-block-default-class-name.js.map +0 -1
  476. package/build-module/components/block-tools/back-compat.js +0 -35
  477. package/build-module/components/block-tools/back-compat.js.map +0 -1
  478. package/build-module/components/block-tools/block-contextual-toolbar.js +0 -83
  479. package/build-module/components/block-tools/block-contextual-toolbar.js.map +0 -1
  480. package/build-module/components/block-tools/selected-block-tools.js +0 -105
  481. package/build-module/components/block-tools/selected-block-tools.js.map +0 -1
  482. package/build-module/components/inserter/hooks/use-debounced-input.js +0 -15
  483. package/build-module/components/inserter/hooks/use-debounced-input.js.map +0 -1
  484. package/build-module/components/use-display-block-controls/index.js +0 -32
  485. package/build-module/components/use-display-block-controls/index.js.map +0 -1
  486. package/build-module/components/use-display-block-controls/index.native.js +0 -32
  487. package/build-module/components/use-display-block-controls/index.native.js.map +0 -1
  488. package/src/components/block-list/use-block-props/use-block-class-names.js +0 -66
  489. package/src/components/block-list/use-block-props/use-block-custom-class-name.js +0 -44
  490. package/src/components/block-list/use-block-props/use-block-default-class-name.js +0 -35
  491. package/src/components/block-parent-selector/style.scss +0 -11
  492. package/src/components/block-tools/back-compat.js +0 -35
  493. package/src/components/block-tools/block-contextual-toolbar.js +0 -100
  494. package/src/components/block-tools/selected-block-tools.js +0 -127
  495. package/src/components/inserter/hooks/use-debounced-input.js +0 -18
  496. package/src/components/preview-options/README.md +0 -94
  497. package/src/components/preview-options/style.scss +0 -64
  498. package/src/components/use-display-block-controls/index.js +0 -36
  499. package/src/components/use-display-block-controls/index.native.js +0 -37
  500. package/src/hooks/test/color.js +0 -112
@@ -1,21 +1,29 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
6
7
  exports.cleanEmptyObject = void 0;
8
+ exports.createBlockEditFilter = createBlockEditFilter;
9
+ exports.createBlockListBlockFilter = createBlockListBlockFilter;
7
10
  exports.shouldSkipSerialization = shouldSkipSerialization;
8
11
  exports.transformStyles = transformStyles;
9
12
  exports.useBlockSettings = useBlockSettings;
10
13
  exports.useStyleOverride = useStyleOverride;
14
+ var _react = require("react");
11
15
  var _blocks = require("@wordpress/blocks");
12
16
  var _element = require("@wordpress/element");
13
17
  var _data = require("@wordpress/data");
18
+ var _compose = require("@wordpress/compose");
19
+ var _hooks = require("@wordpress/hooks");
20
+ var _context = require("../components/block-edit/context");
14
21
  var _components = require("../components");
15
- var _hooks = require("../components/global-styles/hooks");
22
+ var _hooks2 = require("../components/global-styles/hooks");
16
23
  var _object = require("../utils/object");
17
24
  var _store = require("../store");
18
25
  var _lockUnlock = require("../lock-unlock");
26
+ var _classnames = _interopRequireDefault(require("classnames"));
19
27
  /**
20
28
  * WordPress dependencies
21
29
  */
@@ -24,6 +32,10 @@ var _lockUnlock = require("../lock-unlock");
24
32
  * Internal dependencies
25
33
  */
26
34
 
35
+ /**
36
+ * External dependencies
37
+ */
38
+
27
39
  /**
28
40
  * Removed falsy values from nested object.
29
41
  *
@@ -84,14 +96,14 @@ function transformStyles(activeSupports, migrationPaths, result, source, index,
84
96
  * Check whether serialization of specific block support feature or set should
85
97
  * be skipped.
86
98
  *
87
- * @param {string|Object} blockType Block name or block type object.
88
- * @param {string} featureSet Name of block support feature set.
89
- * @param {string} feature Name of the individual feature to check.
99
+ * @param {string|Object} blockNameOrType Block name or block type object.
100
+ * @param {string} featureSet Name of block support feature set.
101
+ * @param {string} feature Name of the individual feature to check.
90
102
  *
91
103
  * @return {boolean} Whether serialization should occur.
92
104
  */
93
- function shouldSkipSerialization(blockType, featureSet, feature) {
94
- const support = (0, _blocks.getBlockSupport)(blockType, featureSet);
105
+ function shouldSkipSerialization(blockNameOrType, featureSet, feature) {
106
+ const support = (0, _blocks.getBlockSupport)(blockNameOrType, featureSet);
95
107
  const skipSerialization = support?.__experimentalSkipSerialization;
96
108
  if (Array.isArray(skipSerialization)) {
97
109
  return skipSerialization.includes(feature);
@@ -206,6 +218,141 @@ function useBlockSettings(name, parentLayout) {
206
218
  parentLayout
207
219
  };
208
220
  }, [fontFamilies, fontSizes, customFontSize, fontStyle, fontWeight, lineHeight, textColumns, textDecoration, textTransform, letterSpacing, writingMode, padding, margin, blockGap, spacingSizes, units, minHeight, layout, parentLayout, borderColor, borderRadius, borderStyle, borderWidth, customColorsEnabled, customColors, customDuotone, themeColors, defaultColors, defaultPalette, defaultDuotone, userDuotonePalette, themeDuotonePalette, defaultDuotonePalette, userGradientPalette, themeGradientPalette, defaultGradientPalette, defaultGradients, areCustomGradientsEnabled, isBackgroundEnabled, isLinkEnabled, isTextEnabled, isHeadingEnabled, isButtonEnabled]);
209
- return (0, _hooks.useSettingsForBlockElement)(rawSettings, name);
221
+ return (0, _hooks2.useSettingsForBlockElement)(rawSettings, name);
222
+ }
223
+ function createBlockEditFilter(features) {
224
+ // We don't want block controls to re-render when typing inside a block.
225
+ // `pure` will prevent re-renders unless props change, so only pass the
226
+ // needed props and not the whole attributes object.
227
+ features = features.map(settings => {
228
+ return {
229
+ ...settings,
230
+ Edit: (0, _compose.pure)(settings.edit)
231
+ };
232
+ });
233
+ const withBlockEditHooks = (0, _compose.createHigherOrderComponent)(OriginalBlockEdit => props => {
234
+ const context = (0, _context.useBlockEditContext)();
235
+ // CAUTION: code added before this line will be executed for all
236
+ // blocks, not just those that support the feature! Code added
237
+ // above this line should be carefully evaluated for its impact on
238
+ // performance.
239
+ return [...features.map((feature, i) => {
240
+ const {
241
+ Edit,
242
+ hasSupport,
243
+ attributeKeys = [],
244
+ shareWithChildBlocks
245
+ } = feature;
246
+ const shouldDisplayControls = context[_context.mayDisplayControlsKey] || context[_context.mayDisplayParentControlsKey] && shareWithChildBlocks;
247
+ if (!shouldDisplayControls || !hasSupport(props.name)) {
248
+ return null;
249
+ }
250
+ const neededProps = {};
251
+ for (const key of attributeKeys) {
252
+ if (props.attributes[key]) {
253
+ neededProps[key] = props.attributes[key];
254
+ }
255
+ }
256
+ return (0, _react.createElement)(Edit
257
+ // We can use the index because the array length
258
+ // is fixed per page load right now.
259
+ , {
260
+ key: i,
261
+ name: props.name,
262
+ clientId: props.clientId,
263
+ setAttributes: props.setAttributes,
264
+ __unstableParentLayout: props.__unstableParentLayout
265
+ // This component is pure, so only pass needed
266
+ // props!!!
267
+ ,
268
+ ...neededProps
269
+ });
270
+ }), (0, _react.createElement)(OriginalBlockEdit, {
271
+ key: "edit",
272
+ ...props
273
+ })];
274
+ }, 'withBlockEditHooks');
275
+ (0, _hooks.addFilter)('editor.BlockEdit', 'core/editor/hooks', withBlockEditHooks);
276
+ }
277
+ function BlockProps({
278
+ index,
279
+ useBlockProps,
280
+ setAllWrapperProps,
281
+ ...props
282
+ }) {
283
+ const wrapperProps = useBlockProps(props);
284
+ const setWrapperProps = next => setAllWrapperProps(prev => {
285
+ const nextAll = [...prev];
286
+ nextAll[index] = next;
287
+ return nextAll;
288
+ });
289
+ // Setting state after every render is fine because this component is
290
+ // pure and will only re-render when needed props change.
291
+ (0, _element.useEffect)(() => {
292
+ // We could shallow compare the props, but since this component only
293
+ // changes when needed attributes change, the benefit is probably small.
294
+ setWrapperProps(wrapperProps);
295
+ return () => {
296
+ setWrapperProps(undefined);
297
+ };
298
+ });
299
+ return null;
300
+ }
301
+ const BlockPropsPure = (0, _compose.pure)(BlockProps);
302
+ function createBlockListBlockFilter(features) {
303
+ const withBlockListBlockHooks = (0, _compose.createHigherOrderComponent)(BlockListBlock => props => {
304
+ const [allWrapperProps, setAllWrapperProps] = (0, _element.useState)(Array(features.length).fill(undefined));
305
+ return [...features.map((feature, i) => {
306
+ const {
307
+ hasSupport,
308
+ attributeKeys = [],
309
+ useBlockProps
310
+ } = feature;
311
+ const neededProps = {};
312
+ for (const key of attributeKeys) {
313
+ if (props.attributes[key]) {
314
+ neededProps[key] = props.attributes[key];
315
+ }
316
+ }
317
+ if (!hasSupport(props.name) ||
318
+ // Skip rendering if none of the needed attributes are
319
+ // set.
320
+ !Object.keys(neededProps).length) {
321
+ return null;
322
+ }
323
+ return (0, _react.createElement)(BlockPropsPure
324
+ // We can use the index because the array length
325
+ // is fixed per page load right now.
326
+ , {
327
+ key: i,
328
+ index: i,
329
+ useBlockProps: useBlockProps
330
+ // This component is pure, so we must pass a stable
331
+ // function reference.
332
+ ,
333
+ setAllWrapperProps: setAllWrapperProps,
334
+ name: props.name
335
+ // This component is pure, so only pass needed
336
+ // props!!!
337
+ ,
338
+ ...neededProps
339
+ });
340
+ }), (0, _react.createElement)(BlockListBlock, {
341
+ key: "edit",
342
+ ...props,
343
+ wrapperProps: allWrapperProps.filter(Boolean).reduce((acc, wrapperProps) => {
344
+ return {
345
+ ...acc,
346
+ ...wrapperProps,
347
+ className: (0, _classnames.default)(acc.className, wrapperProps.className),
348
+ style: {
349
+ ...acc.style,
350
+ ...wrapperProps.style
351
+ }
352
+ };
353
+ }, props.wrapperProps || {})
354
+ })];
355
+ }, 'withBlockListBlockHooks');
356
+ (0, _hooks.addFilter)('editor.BlockListBlock', 'core/editor/hooks', withBlockListBlockHooks);
210
357
  }
211
358
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_blocks","require","_element","_data","_components","_hooks","_object","_store","_lockUnlock","cleanEmptyObject","object","Array","isArray","cleanedNestedObjects","Object","entries","map","key","value","filter","undefined","length","fromEntries","exports","transformStyles","activeSupports","migrationPaths","result","source","index","results","values","every","isActive","innerBlocks","referenceBlockAttributes","attributes","returnBlock","forEach","support","path","styleValue","getValueFromObjectPath","setImmutably","shouldSkipSerialization","blockType","featureSet","feature","getBlockSupport","skipSerialization","__experimentalSkipSerialization","includes","useStyleOverride","id","css","assets","__unstableType","setStyleOverride","deleteStyleOverride","unlock","useDispatch","blockEditorStore","fallbackId","useId","useEffect","_id","useBlockSettings","name","parentLayout","fontFamilies","fontSizes","customFontSize","fontStyle","fontWeight","lineHeight","textColumns","textDecoration","writingMode","textTransform","letterSpacing","padding","margin","blockGap","spacingSizes","units","minHeight","layout","borderColor","borderRadius","borderStyle","borderWidth","customColorsEnabled","customColors","customDuotone","themeColors","defaultColors","defaultPalette","defaultDuotone","userDuotonePalette","themeDuotonePalette","defaultDuotonePalette","userGradientPalette","themeGradientPalette","defaultGradientPalette","defaultGradients","areCustomGradientsEnabled","isBackgroundEnabled","isLinkEnabled","isTextEnabled","isHeadingEnabled","isButtonEnabled","useSettings","rawSettings","useMemo","color","palette","custom","theme","default","gradients","duotone","customGradient","background","link","heading","button","text","typography","spacing","border","radius","style","width","dimensions","useSettingsForBlockElement"],"sources":["@wordpress/block-editor/src/hooks/utils.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { getBlockSupport } from '@wordpress/blocks';\nimport { useMemo, useEffect, useId } from '@wordpress/element';\nimport { useDispatch } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { useSettings } from '../components';\nimport { useSettingsForBlockElement } from '../components/global-styles/hooks';\nimport { getValueFromObjectPath, setImmutably } from '../utils/object';\nimport { store as blockEditorStore } from '../store';\nimport { unlock } from '../lock-unlock';\n\n/**\n * Removed falsy values from nested object.\n *\n * @param {*} object\n * @return {*} Object cleaned from falsy values\n */\nexport const cleanEmptyObject = ( object ) => {\n\tif (\n\t\tobject === null ||\n\t\ttypeof object !== 'object' ||\n\t\tArray.isArray( object )\n\t) {\n\t\treturn object;\n\t}\n\n\tconst cleanedNestedObjects = Object.entries( object )\n\t\t.map( ( [ key, value ] ) => [ key, cleanEmptyObject( value ) ] )\n\t\t.filter( ( [ , value ] ) => value !== undefined );\n\treturn ! cleanedNestedObjects.length\n\t\t? undefined\n\t\t: Object.fromEntries( cleanedNestedObjects );\n};\n\nexport function transformStyles(\n\tactiveSupports,\n\tmigrationPaths,\n\tresult,\n\tsource,\n\tindex,\n\tresults\n) {\n\t// If there are no active supports return early.\n\tif (\n\t\tObject.values( activeSupports ?? {} ).every(\n\t\t\t( isActive ) => ! isActive\n\t\t)\n\t) {\n\t\treturn result;\n\t}\n\t// If the condition verifies we are probably in the presence of a wrapping transform\n\t// e.g: nesting paragraphs in a group or columns and in that case the styles should not be transformed.\n\tif ( results.length === 1 && result.innerBlocks.length === source.length ) {\n\t\treturn result;\n\t}\n\t// For cases where we have a transform from one block to multiple blocks\n\t// or multiple blocks to one block we apply the styles of the first source block\n\t// to the result(s).\n\tlet referenceBlockAttributes = source[ 0 ]?.attributes;\n\t// If we are in presence of transform between more than one block in the source\n\t// that has more than one block in the result\n\t// we apply the styles on source N to the result N,\n\t// if source N does not exists we do nothing.\n\tif ( results.length > 1 && source.length > 1 ) {\n\t\tif ( source[ index ] ) {\n\t\t\treferenceBlockAttributes = source[ index ]?.attributes;\n\t\t} else {\n\t\t\treturn result;\n\t\t}\n\t}\n\tlet returnBlock = result;\n\tObject.entries( activeSupports ).forEach( ( [ support, isActive ] ) => {\n\t\tif ( isActive ) {\n\t\t\tmigrationPaths[ support ].forEach( ( path ) => {\n\t\t\t\tconst styleValue = getValueFromObjectPath(\n\t\t\t\t\treferenceBlockAttributes,\n\t\t\t\t\tpath\n\t\t\t\t);\n\t\t\t\tif ( styleValue ) {\n\t\t\t\t\treturnBlock = {\n\t\t\t\t\t\t...returnBlock,\n\t\t\t\t\t\tattributes: setImmutably(\n\t\t\t\t\t\t\treturnBlock.attributes,\n\t\t\t\t\t\t\tpath,\n\t\t\t\t\t\t\tstyleValue\n\t\t\t\t\t\t),\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t} );\n\treturn returnBlock;\n}\n\n/**\n * Check whether serialization of specific block support feature or set should\n * be skipped.\n *\n * @param {string|Object} blockType Block name or block type object.\n * @param {string} featureSet Name of block support feature set.\n * @param {string} feature Name of the individual feature to check.\n *\n * @return {boolean} Whether serialization should occur.\n */\nexport function shouldSkipSerialization( blockType, featureSet, feature ) {\n\tconst support = getBlockSupport( blockType, featureSet );\n\tconst skipSerialization = support?.__experimentalSkipSerialization;\n\n\tif ( Array.isArray( skipSerialization ) ) {\n\t\treturn skipSerialization.includes( feature );\n\t}\n\n\treturn skipSerialization;\n}\n\nexport function useStyleOverride( { id, css, assets, __unstableType } = {} ) {\n\tconst { setStyleOverride, deleteStyleOverride } = unlock(\n\t\tuseDispatch( blockEditorStore )\n\t);\n\tconst fallbackId = useId();\n\tuseEffect( () => {\n\t\t// Unmount if there is CSS and assets are empty.\n\t\tif ( ! css && ! assets ) return;\n\t\tconst _id = id || fallbackId;\n\t\tsetStyleOverride( _id, {\n\t\t\tid,\n\t\t\tcss,\n\t\t\tassets,\n\t\t\t__unstableType,\n\t\t} );\n\t\treturn () => {\n\t\t\tdeleteStyleOverride( _id );\n\t\t};\n\t}, [\n\t\tid,\n\t\tcss,\n\t\tassets,\n\t\t__unstableType,\n\t\tfallbackId,\n\t\tsetStyleOverride,\n\t\tdeleteStyleOverride,\n\t] );\n}\n\n/**\n * Based on the block and its context, returns an object of all the block settings.\n * This object can be passed as a prop to all the Styles UI components\n * (TypographyPanel, DimensionsPanel...).\n *\n * @param {string} name Block name.\n * @param {*} parentLayout Parent layout.\n *\n * @return {Object} Settings object.\n */\nexport function useBlockSettings( name, parentLayout ) {\n\tconst [\n\t\tfontFamilies,\n\t\tfontSizes,\n\t\tcustomFontSize,\n\t\tfontStyle,\n\t\tfontWeight,\n\t\tlineHeight,\n\t\ttextColumns,\n\t\ttextDecoration,\n\t\twritingMode,\n\t\ttextTransform,\n\t\tletterSpacing,\n\t\tpadding,\n\t\tmargin,\n\t\tblockGap,\n\t\tspacingSizes,\n\t\tunits,\n\t\tminHeight,\n\t\tlayout,\n\t\tborderColor,\n\t\tborderRadius,\n\t\tborderStyle,\n\t\tborderWidth,\n\t\tcustomColorsEnabled,\n\t\tcustomColors,\n\t\tcustomDuotone,\n\t\tthemeColors,\n\t\tdefaultColors,\n\t\tdefaultPalette,\n\t\tdefaultDuotone,\n\t\tuserDuotonePalette,\n\t\tthemeDuotonePalette,\n\t\tdefaultDuotonePalette,\n\t\tuserGradientPalette,\n\t\tthemeGradientPalette,\n\t\tdefaultGradientPalette,\n\t\tdefaultGradients,\n\t\tareCustomGradientsEnabled,\n\t\tisBackgroundEnabled,\n\t\tisLinkEnabled,\n\t\tisTextEnabled,\n\t\tisHeadingEnabled,\n\t\tisButtonEnabled,\n\t] = useSettings(\n\t\t'typography.fontFamilies',\n\t\t'typography.fontSizes',\n\t\t'typography.customFontSize',\n\t\t'typography.fontStyle',\n\t\t'typography.fontWeight',\n\t\t'typography.lineHeight',\n\t\t'typography.textColumns',\n\t\t'typography.textDecoration',\n\t\t'typography.writingMode',\n\t\t'typography.textTransform',\n\t\t'typography.letterSpacing',\n\t\t'spacing.padding',\n\t\t'spacing.margin',\n\t\t'spacing.blockGap',\n\t\t'spacing.spacingSizes',\n\t\t'spacing.units',\n\t\t'dimensions.minHeight',\n\t\t'layout',\n\t\t'border.color',\n\t\t'border.radius',\n\t\t'border.style',\n\t\t'border.width',\n\t\t'color.custom',\n\t\t'color.palette.custom',\n\t\t'color.customDuotone',\n\t\t'color.palette.theme',\n\t\t'color.palette.default',\n\t\t'color.defaultPalette',\n\t\t'color.defaultDuotone',\n\t\t'color.duotone.custom',\n\t\t'color.duotone.theme',\n\t\t'color.duotone.default',\n\t\t'color.gradients.custom',\n\t\t'color.gradients.theme',\n\t\t'color.gradients.default',\n\t\t'color.defaultGradients',\n\t\t'color.customGradient',\n\t\t'color.background',\n\t\t'color.link',\n\t\t'color.text',\n\t\t'color.heading',\n\t\t'color.button'\n\t);\n\n\tconst rawSettings = useMemo( () => {\n\t\treturn {\n\t\t\tcolor: {\n\t\t\t\tpalette: {\n\t\t\t\t\tcustom: customColors,\n\t\t\t\t\ttheme: themeColors,\n\t\t\t\t\tdefault: defaultColors,\n\t\t\t\t},\n\t\t\t\tgradients: {\n\t\t\t\t\tcustom: userGradientPalette,\n\t\t\t\t\ttheme: themeGradientPalette,\n\t\t\t\t\tdefault: defaultGradientPalette,\n\t\t\t\t},\n\t\t\t\tduotone: {\n\t\t\t\t\tcustom: userDuotonePalette,\n\t\t\t\t\ttheme: themeDuotonePalette,\n\t\t\t\t\tdefault: defaultDuotonePalette,\n\t\t\t\t},\n\t\t\t\tdefaultGradients,\n\t\t\t\tdefaultPalette,\n\t\t\t\tdefaultDuotone,\n\t\t\t\tcustom: customColorsEnabled,\n\t\t\t\tcustomGradient: areCustomGradientsEnabled,\n\t\t\t\tcustomDuotone,\n\t\t\t\tbackground: isBackgroundEnabled,\n\t\t\t\tlink: isLinkEnabled,\n\t\t\t\theading: isHeadingEnabled,\n\t\t\t\tbutton: isButtonEnabled,\n\t\t\t\ttext: isTextEnabled,\n\t\t\t},\n\t\t\ttypography: {\n\t\t\t\tfontFamilies: {\n\t\t\t\t\tcustom: fontFamilies,\n\t\t\t\t},\n\t\t\t\tfontSizes: {\n\t\t\t\t\tcustom: fontSizes,\n\t\t\t\t},\n\t\t\t\tcustomFontSize,\n\t\t\t\tfontStyle,\n\t\t\t\tfontWeight,\n\t\t\t\tlineHeight,\n\t\t\t\ttextColumns,\n\t\t\t\ttextDecoration,\n\t\t\t\ttextTransform,\n\t\t\t\tletterSpacing,\n\t\t\t\twritingMode,\n\t\t\t},\n\t\t\tspacing: {\n\t\t\t\tspacingSizes: {\n\t\t\t\t\tcustom: spacingSizes,\n\t\t\t\t},\n\t\t\t\tpadding,\n\t\t\t\tmargin,\n\t\t\t\tblockGap,\n\t\t\t\tunits,\n\t\t\t},\n\t\t\tborder: {\n\t\t\t\tcolor: borderColor,\n\t\t\t\tradius: borderRadius,\n\t\t\t\tstyle: borderStyle,\n\t\t\t\twidth: borderWidth,\n\t\t\t},\n\t\t\tdimensions: {\n\t\t\t\tminHeight,\n\t\t\t},\n\t\t\tlayout,\n\t\t\tparentLayout,\n\t\t};\n\t}, [\n\t\tfontFamilies,\n\t\tfontSizes,\n\t\tcustomFontSize,\n\t\tfontStyle,\n\t\tfontWeight,\n\t\tlineHeight,\n\t\ttextColumns,\n\t\ttextDecoration,\n\t\ttextTransform,\n\t\tletterSpacing,\n\t\twritingMode,\n\t\tpadding,\n\t\tmargin,\n\t\tblockGap,\n\t\tspacingSizes,\n\t\tunits,\n\t\tminHeight,\n\t\tlayout,\n\t\tparentLayout,\n\t\tborderColor,\n\t\tborderRadius,\n\t\tborderStyle,\n\t\tborderWidth,\n\t\tcustomColorsEnabled,\n\t\tcustomColors,\n\t\tcustomDuotone,\n\t\tthemeColors,\n\t\tdefaultColors,\n\t\tdefaultPalette,\n\t\tdefaultDuotone,\n\t\tuserDuotonePalette,\n\t\tthemeDuotonePalette,\n\t\tdefaultDuotonePalette,\n\t\tuserGradientPalette,\n\t\tthemeGradientPalette,\n\t\tdefaultGradientPalette,\n\t\tdefaultGradients,\n\t\tareCustomGradientsEnabled,\n\t\tisBackgroundEnabled,\n\t\tisLinkEnabled,\n\t\tisTextEnabled,\n\t\tisHeadingEnabled,\n\t\tisButtonEnabled,\n\t] );\n\n\treturn useSettingsForBlockElement( rawSettings, name );\n}\n"],"mappings":";;;;;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAKA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAA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AAO,IAAAwB,iCAA0B,EAAEtB,WAAW,EAAE7C,IAAK,CAAC;AACvD"}
1
+ {"version":3,"names":["_blocks","require","_element","_data","_compose","_hooks","_context","_components","_hooks2","_object","_store","_lockUnlock","_classnames","_interopRequireDefault","cleanEmptyObject","object","Array","isArray","cleanedNestedObjects","Object","entries","map","key","value","filter","undefined","length","fromEntries","exports","transformStyles","activeSupports","migrationPaths","result","source","index","results","values","every","isActive","innerBlocks","referenceBlockAttributes","attributes","returnBlock","forEach","support","path","styleValue","getValueFromObjectPath","setImmutably","shouldSkipSerialization","blockNameOrType","featureSet","feature","getBlockSupport","skipSerialization","__experimentalSkipSerialization","includes","useStyleOverride","id","css","assets","__unstableType","setStyleOverride","deleteStyleOverride","unlock","useDispatch","blockEditorStore","fallbackId","useId","useEffect","_id","useBlockSettings","name","parentLayout","fontFamilies","fontSizes","customFontSize","fontStyle","fontWeight","lineHeight","textColumns","textDecoration","writingMode","textTransform","letterSpacing","padding","margin","blockGap","spacingSizes","units","minHeight","layout","borderColor","borderRadius","borderStyle","borderWidth","customColorsEnabled","customColors","customDuotone","themeColors","defaultColors","defaultPalette","defaultDuotone","userDuotonePalette","themeDuotonePalette","defaultDuotonePalette","userGradientPalette","themeGradientPalette","defaultGradientPalette","defaultGradients","areCustomGradientsEnabled","isBackgroundEnabled","isLinkEnabled","isTextEnabled","isHeadingEnabled","isButtonEnabled","useSettings","rawSettings","useMemo","color","palette","custom","theme","default","gradients","duotone","customGradient","background","link","heading","button","text","typography","spacing","border","radius","style","width","dimensions","useSettingsForBlockElement","createBlockEditFilter","features","settings","Edit","pure","edit","withBlockEditHooks","createHigherOrderComponent","OriginalBlockEdit","props","context","useBlockEditContext","i","hasSupport","attributeKeys","shareWithChildBlocks","shouldDisplayControls","mayDisplayControlsKey","mayDisplayParentControlsKey","neededProps","_react","createElement","clientId","setAttributes","__unstableParentLayout","addFilter","BlockProps","useBlockProps","setAllWrapperProps","wrapperProps","setWrapperProps","next","prev","nextAll","BlockPropsPure","createBlockListBlockFilter","withBlockListBlockHooks","BlockListBlock","allWrapperProps","useState","fill","keys","Boolean","reduce","acc","className","classnames"],"sources":["@wordpress/block-editor/src/hooks/utils.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { getBlockSupport } from '@wordpress/blocks';\nimport { useMemo, useEffect, useId, useState } from '@wordpress/element';\nimport { useDispatch } from '@wordpress/data';\nimport { createHigherOrderComponent, pure } from '@wordpress/compose';\nimport { addFilter } from '@wordpress/hooks';\n\n/**\n * Internal dependencies\n */\nimport {\n\tuseBlockEditContext,\n\tmayDisplayControlsKey,\n\tmayDisplayParentControlsKey,\n} from '../components/block-edit/context';\nimport { useSettings } from '../components';\nimport { useSettingsForBlockElement } from '../components/global-styles/hooks';\nimport { getValueFromObjectPath, setImmutably } from '../utils/object';\nimport { store as blockEditorStore } from '../store';\nimport { unlock } from '../lock-unlock';\n/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * Removed falsy values from nested object.\n *\n * @param {*} object\n * @return {*} Object cleaned from falsy values\n */\nexport const cleanEmptyObject = ( object ) => {\n\tif (\n\t\tobject === null ||\n\t\ttypeof object !== 'object' ||\n\t\tArray.isArray( object )\n\t) {\n\t\treturn object;\n\t}\n\n\tconst cleanedNestedObjects = Object.entries( object )\n\t\t.map( ( [ key, value ] ) => [ key, cleanEmptyObject( value ) ] )\n\t\t.filter( ( [ , value ] ) => value !== undefined );\n\treturn ! cleanedNestedObjects.length\n\t\t? undefined\n\t\t: Object.fromEntries( cleanedNestedObjects );\n};\n\nexport function transformStyles(\n\tactiveSupports,\n\tmigrationPaths,\n\tresult,\n\tsource,\n\tindex,\n\tresults\n) {\n\t// If there are no active supports return early.\n\tif (\n\t\tObject.values( activeSupports ?? {} ).every(\n\t\t\t( isActive ) => ! isActive\n\t\t)\n\t) {\n\t\treturn result;\n\t}\n\t// If the condition verifies we are probably in the presence of a wrapping transform\n\t// e.g: nesting paragraphs in a group or columns and in that case the styles should not be transformed.\n\tif ( results.length === 1 && result.innerBlocks.length === source.length ) {\n\t\treturn result;\n\t}\n\t// For cases where we have a transform from one block to multiple blocks\n\t// or multiple blocks to one block we apply the styles of the first source block\n\t// to the result(s).\n\tlet referenceBlockAttributes = source[ 0 ]?.attributes;\n\t// If we are in presence of transform between more than one block in the source\n\t// that has more than one block in the result\n\t// we apply the styles on source N to the result N,\n\t// if source N does not exists we do nothing.\n\tif ( results.length > 1 && source.length > 1 ) {\n\t\tif ( source[ index ] ) {\n\t\t\treferenceBlockAttributes = source[ index ]?.attributes;\n\t\t} else {\n\t\t\treturn result;\n\t\t}\n\t}\n\tlet returnBlock = result;\n\tObject.entries( activeSupports ).forEach( ( [ support, isActive ] ) => {\n\t\tif ( isActive ) {\n\t\t\tmigrationPaths[ support ].forEach( ( path ) => {\n\t\t\t\tconst styleValue = getValueFromObjectPath(\n\t\t\t\t\treferenceBlockAttributes,\n\t\t\t\t\tpath\n\t\t\t\t);\n\t\t\t\tif ( styleValue ) {\n\t\t\t\t\treturnBlock = {\n\t\t\t\t\t\t...returnBlock,\n\t\t\t\t\t\tattributes: setImmutably(\n\t\t\t\t\t\t\treturnBlock.attributes,\n\t\t\t\t\t\t\tpath,\n\t\t\t\t\t\t\tstyleValue\n\t\t\t\t\t\t),\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t} );\n\treturn returnBlock;\n}\n\n/**\n * Check whether serialization of specific block support feature or set should\n * be skipped.\n *\n * @param {string|Object} blockNameOrType Block name or block type object.\n * @param {string} featureSet Name of block support feature set.\n * @param {string} feature Name of the individual feature to check.\n *\n * @return {boolean} Whether serialization should occur.\n */\nexport function shouldSkipSerialization(\n\tblockNameOrType,\n\tfeatureSet,\n\tfeature\n) {\n\tconst support = getBlockSupport( blockNameOrType, featureSet );\n\tconst skipSerialization = support?.__experimentalSkipSerialization;\n\n\tif ( Array.isArray( skipSerialization ) ) {\n\t\treturn skipSerialization.includes( feature );\n\t}\n\n\treturn skipSerialization;\n}\n\nexport function useStyleOverride( { id, css, assets, __unstableType } = {} ) {\n\tconst { setStyleOverride, deleteStyleOverride } = unlock(\n\t\tuseDispatch( blockEditorStore )\n\t);\n\tconst fallbackId = useId();\n\tuseEffect( () => {\n\t\t// Unmount if there is CSS and assets are empty.\n\t\tif ( ! css && ! assets ) return;\n\t\tconst _id = id || fallbackId;\n\t\tsetStyleOverride( _id, {\n\t\t\tid,\n\t\t\tcss,\n\t\t\tassets,\n\t\t\t__unstableType,\n\t\t} );\n\t\treturn () => {\n\t\t\tdeleteStyleOverride( _id );\n\t\t};\n\t}, [\n\t\tid,\n\t\tcss,\n\t\tassets,\n\t\t__unstableType,\n\t\tfallbackId,\n\t\tsetStyleOverride,\n\t\tdeleteStyleOverride,\n\t] );\n}\n\n/**\n * Based on the block and its context, returns an object of all the block settings.\n * This object can be passed as a prop to all the Styles UI components\n * (TypographyPanel, DimensionsPanel...).\n *\n * @param {string} name Block name.\n * @param {*} parentLayout Parent layout.\n *\n * @return {Object} Settings object.\n */\nexport function useBlockSettings( name, parentLayout ) {\n\tconst [\n\t\tfontFamilies,\n\t\tfontSizes,\n\t\tcustomFontSize,\n\t\tfontStyle,\n\t\tfontWeight,\n\t\tlineHeight,\n\t\ttextColumns,\n\t\ttextDecoration,\n\t\twritingMode,\n\t\ttextTransform,\n\t\tletterSpacing,\n\t\tpadding,\n\t\tmargin,\n\t\tblockGap,\n\t\tspacingSizes,\n\t\tunits,\n\t\tminHeight,\n\t\tlayout,\n\t\tborderColor,\n\t\tborderRadius,\n\t\tborderStyle,\n\t\tborderWidth,\n\t\tcustomColorsEnabled,\n\t\tcustomColors,\n\t\tcustomDuotone,\n\t\tthemeColors,\n\t\tdefaultColors,\n\t\tdefaultPalette,\n\t\tdefaultDuotone,\n\t\tuserDuotonePalette,\n\t\tthemeDuotonePalette,\n\t\tdefaultDuotonePalette,\n\t\tuserGradientPalette,\n\t\tthemeGradientPalette,\n\t\tdefaultGradientPalette,\n\t\tdefaultGradients,\n\t\tareCustomGradientsEnabled,\n\t\tisBackgroundEnabled,\n\t\tisLinkEnabled,\n\t\tisTextEnabled,\n\t\tisHeadingEnabled,\n\t\tisButtonEnabled,\n\t] = useSettings(\n\t\t'typography.fontFamilies',\n\t\t'typography.fontSizes',\n\t\t'typography.customFontSize',\n\t\t'typography.fontStyle',\n\t\t'typography.fontWeight',\n\t\t'typography.lineHeight',\n\t\t'typography.textColumns',\n\t\t'typography.textDecoration',\n\t\t'typography.writingMode',\n\t\t'typography.textTransform',\n\t\t'typography.letterSpacing',\n\t\t'spacing.padding',\n\t\t'spacing.margin',\n\t\t'spacing.blockGap',\n\t\t'spacing.spacingSizes',\n\t\t'spacing.units',\n\t\t'dimensions.minHeight',\n\t\t'layout',\n\t\t'border.color',\n\t\t'border.radius',\n\t\t'border.style',\n\t\t'border.width',\n\t\t'color.custom',\n\t\t'color.palette.custom',\n\t\t'color.customDuotone',\n\t\t'color.palette.theme',\n\t\t'color.palette.default',\n\t\t'color.defaultPalette',\n\t\t'color.defaultDuotone',\n\t\t'color.duotone.custom',\n\t\t'color.duotone.theme',\n\t\t'color.duotone.default',\n\t\t'color.gradients.custom',\n\t\t'color.gradients.theme',\n\t\t'color.gradients.default',\n\t\t'color.defaultGradients',\n\t\t'color.customGradient',\n\t\t'color.background',\n\t\t'color.link',\n\t\t'color.text',\n\t\t'color.heading',\n\t\t'color.button'\n\t);\n\n\tconst rawSettings = useMemo( () => {\n\t\treturn {\n\t\t\tcolor: {\n\t\t\t\tpalette: {\n\t\t\t\t\tcustom: customColors,\n\t\t\t\t\ttheme: themeColors,\n\t\t\t\t\tdefault: defaultColors,\n\t\t\t\t},\n\t\t\t\tgradients: {\n\t\t\t\t\tcustom: userGradientPalette,\n\t\t\t\t\ttheme: themeGradientPalette,\n\t\t\t\t\tdefault: defaultGradientPalette,\n\t\t\t\t},\n\t\t\t\tduotone: {\n\t\t\t\t\tcustom: userDuotonePalette,\n\t\t\t\t\ttheme: themeDuotonePalette,\n\t\t\t\t\tdefault: defaultDuotonePalette,\n\t\t\t\t},\n\t\t\t\tdefaultGradients,\n\t\t\t\tdefaultPalette,\n\t\t\t\tdefaultDuotone,\n\t\t\t\tcustom: customColorsEnabled,\n\t\t\t\tcustomGradient: areCustomGradientsEnabled,\n\t\t\t\tcustomDuotone,\n\t\t\t\tbackground: isBackgroundEnabled,\n\t\t\t\tlink: isLinkEnabled,\n\t\t\t\theading: isHeadingEnabled,\n\t\t\t\tbutton: isButtonEnabled,\n\t\t\t\ttext: isTextEnabled,\n\t\t\t},\n\t\t\ttypography: {\n\t\t\t\tfontFamilies: {\n\t\t\t\t\tcustom: fontFamilies,\n\t\t\t\t},\n\t\t\t\tfontSizes: {\n\t\t\t\t\tcustom: fontSizes,\n\t\t\t\t},\n\t\t\t\tcustomFontSize,\n\t\t\t\tfontStyle,\n\t\t\t\tfontWeight,\n\t\t\t\tlineHeight,\n\t\t\t\ttextColumns,\n\t\t\t\ttextDecoration,\n\t\t\t\ttextTransform,\n\t\t\t\tletterSpacing,\n\t\t\t\twritingMode,\n\t\t\t},\n\t\t\tspacing: {\n\t\t\t\tspacingSizes: {\n\t\t\t\t\tcustom: spacingSizes,\n\t\t\t\t},\n\t\t\t\tpadding,\n\t\t\t\tmargin,\n\t\t\t\tblockGap,\n\t\t\t\tunits,\n\t\t\t},\n\t\t\tborder: {\n\t\t\t\tcolor: borderColor,\n\t\t\t\tradius: borderRadius,\n\t\t\t\tstyle: borderStyle,\n\t\t\t\twidth: borderWidth,\n\t\t\t},\n\t\t\tdimensions: {\n\t\t\t\tminHeight,\n\t\t\t},\n\t\t\tlayout,\n\t\t\tparentLayout,\n\t\t};\n\t}, [\n\t\tfontFamilies,\n\t\tfontSizes,\n\t\tcustomFontSize,\n\t\tfontStyle,\n\t\tfontWeight,\n\t\tlineHeight,\n\t\ttextColumns,\n\t\ttextDecoration,\n\t\ttextTransform,\n\t\tletterSpacing,\n\t\twritingMode,\n\t\tpadding,\n\t\tmargin,\n\t\tblockGap,\n\t\tspacingSizes,\n\t\tunits,\n\t\tminHeight,\n\t\tlayout,\n\t\tparentLayout,\n\t\tborderColor,\n\t\tborderRadius,\n\t\tborderStyle,\n\t\tborderWidth,\n\t\tcustomColorsEnabled,\n\t\tcustomColors,\n\t\tcustomDuotone,\n\t\tthemeColors,\n\t\tdefaultColors,\n\t\tdefaultPalette,\n\t\tdefaultDuotone,\n\t\tuserDuotonePalette,\n\t\tthemeDuotonePalette,\n\t\tdefaultDuotonePalette,\n\t\tuserGradientPalette,\n\t\tthemeGradientPalette,\n\t\tdefaultGradientPalette,\n\t\tdefaultGradients,\n\t\tareCustomGradientsEnabled,\n\t\tisBackgroundEnabled,\n\t\tisLinkEnabled,\n\t\tisTextEnabled,\n\t\tisHeadingEnabled,\n\t\tisButtonEnabled,\n\t] );\n\n\treturn useSettingsForBlockElement( rawSettings, name );\n}\n\nexport function createBlockEditFilter( features ) {\n\t// We don't want block controls to re-render when typing inside a block.\n\t// `pure` will prevent re-renders unless props change, so only pass the\n\t// needed props and not the whole attributes object.\n\tfeatures = features.map( ( settings ) => {\n\t\treturn { ...settings, Edit: pure( settings.edit ) };\n\t} );\n\tconst withBlockEditHooks = createHigherOrderComponent(\n\t\t( OriginalBlockEdit ) => ( props ) => {\n\t\t\tconst context = useBlockEditContext();\n\t\t\t// CAUTION: code added before this line will be executed for all\n\t\t\t// blocks, not just those that support the feature! Code added\n\t\t\t// above this line should be carefully evaluated for its impact on\n\t\t\t// performance.\n\t\t\treturn [\n\t\t\t\t...features.map( ( feature, i ) => {\n\t\t\t\t\tconst {\n\t\t\t\t\t\tEdit,\n\t\t\t\t\t\thasSupport,\n\t\t\t\t\t\tattributeKeys = [],\n\t\t\t\t\t\tshareWithChildBlocks,\n\t\t\t\t\t} = feature;\n\t\t\t\t\tconst shouldDisplayControls =\n\t\t\t\t\t\tcontext[ mayDisplayControlsKey ] ||\n\t\t\t\t\t\t( context[ mayDisplayParentControlsKey ] &&\n\t\t\t\t\t\t\tshareWithChildBlocks );\n\n\t\t\t\t\tif (\n\t\t\t\t\t\t! shouldDisplayControls ||\n\t\t\t\t\t\t! hasSupport( props.name )\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst neededProps = {};\n\t\t\t\t\tfor ( const key of attributeKeys ) {\n\t\t\t\t\t\tif ( props.attributes[ key ] ) {\n\t\t\t\t\t\t\tneededProps[ key ] = props.attributes[ key ];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<Edit\n\t\t\t\t\t\t\t// We can use the index because the array length\n\t\t\t\t\t\t\t// is fixed per page load right now.\n\t\t\t\t\t\t\tkey={ i }\n\t\t\t\t\t\t\tname={ props.name }\n\t\t\t\t\t\t\tclientId={ props.clientId }\n\t\t\t\t\t\t\tsetAttributes={ props.setAttributes }\n\t\t\t\t\t\t\t__unstableParentLayout={\n\t\t\t\t\t\t\t\tprops.__unstableParentLayout\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// This component is pure, so only pass needed\n\t\t\t\t\t\t\t// props!!!\n\t\t\t\t\t\t\t{ ...neededProps }\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t} ),\n\t\t\t\t<OriginalBlockEdit key=\"edit\" { ...props } />,\n\t\t\t];\n\t\t},\n\t\t'withBlockEditHooks'\n\t);\n\taddFilter( 'editor.BlockEdit', 'core/editor/hooks', withBlockEditHooks );\n}\n\nfunction BlockProps( { index, useBlockProps, setAllWrapperProps, ...props } ) {\n\tconst wrapperProps = useBlockProps( props );\n\tconst setWrapperProps = ( next ) =>\n\t\tsetAllWrapperProps( ( prev ) => {\n\t\t\tconst nextAll = [ ...prev ];\n\t\t\tnextAll[ index ] = next;\n\t\t\treturn nextAll;\n\t\t} );\n\t// Setting state after every render is fine because this component is\n\t// pure and will only re-render when needed props change.\n\tuseEffect( () => {\n\t\t// We could shallow compare the props, but since this component only\n\t\t// changes when needed attributes change, the benefit is probably small.\n\t\tsetWrapperProps( wrapperProps );\n\t\treturn () => {\n\t\t\tsetWrapperProps( undefined );\n\t\t};\n\t} );\n\treturn null;\n}\n\nconst BlockPropsPure = pure( BlockProps );\n\nexport function createBlockListBlockFilter( features ) {\n\tconst withBlockListBlockHooks = createHigherOrderComponent(\n\t\t( BlockListBlock ) => ( props ) => {\n\t\t\tconst [ allWrapperProps, setAllWrapperProps ] = useState(\n\t\t\t\tArray( features.length ).fill( undefined )\n\t\t\t);\n\t\t\treturn [\n\t\t\t\t...features.map( ( feature, i ) => {\n\t\t\t\t\tconst {\n\t\t\t\t\t\thasSupport,\n\t\t\t\t\t\tattributeKeys = [],\n\t\t\t\t\t\tuseBlockProps,\n\t\t\t\t\t} = feature;\n\n\t\t\t\t\tconst neededProps = {};\n\t\t\t\t\tfor ( const key of attributeKeys ) {\n\t\t\t\t\t\tif ( props.attributes[ key ] ) {\n\t\t\t\t\t\t\tneededProps[ key ] = props.attributes[ key ];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (\n\t\t\t\t\t\t! hasSupport( props.name ) ||\n\t\t\t\t\t\t// Skip rendering if none of the needed attributes are\n\t\t\t\t\t\t// set.\n\t\t\t\t\t\t! Object.keys( neededProps ).length\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<BlockPropsPure\n\t\t\t\t\t\t\t// We can use the index because the array length\n\t\t\t\t\t\t\t// is fixed per page load right now.\n\t\t\t\t\t\t\tkey={ i }\n\t\t\t\t\t\t\tindex={ i }\n\t\t\t\t\t\t\tuseBlockProps={ useBlockProps }\n\t\t\t\t\t\t\t// This component is pure, so we must pass a stable\n\t\t\t\t\t\t\t// function reference.\n\t\t\t\t\t\t\tsetAllWrapperProps={ setAllWrapperProps }\n\t\t\t\t\t\t\tname={ props.name }\n\t\t\t\t\t\t\t// This component is pure, so only pass needed\n\t\t\t\t\t\t\t// props!!!\n\t\t\t\t\t\t\t{ ...neededProps }\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t} ),\n\t\t\t\t<BlockListBlock\n\t\t\t\t\tkey=\"edit\"\n\t\t\t\t\t{ ...props }\n\t\t\t\t\twrapperProps={ allWrapperProps\n\t\t\t\t\t\t.filter( Boolean )\n\t\t\t\t\t\t.reduce( ( acc, wrapperProps ) => {\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t...acc,\n\t\t\t\t\t\t\t\t...wrapperProps,\n\t\t\t\t\t\t\t\tclassName: classnames(\n\t\t\t\t\t\t\t\t\tacc.className,\n\t\t\t\t\t\t\t\t\twrapperProps.className\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\t\t\t...acc.style,\n\t\t\t\t\t\t\t\t\t...wrapperProps.style,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}, props.wrapperProps || {} ) }\n\t\t\t\t/>,\n\t\t\t];\n\t\t},\n\t\t'withBlockListBlockHooks'\n\t);\n\taddFilter(\n\t\t'editor.BlockListBlock',\n\t\t'core/editor/hooks',\n\t\twithBlockListBlockHooks\n\t);\n}\n"],"mappings":";;;;;;;;;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AAKA,IAAAK,QAAA,GAAAL,OAAA;AAKA,IAAAM,WAAA,GAAAN,OAAA;AACA,IAAAO,OAAA,GAAAP,OAAA;AACA,IAAAQ,OAAA,GAAAR,OAAA;AACA,IAAAS,MAAA,GAAAT,OAAA;AACA,IAAAU,WAAA,GAAAV,OAAA;AAIA,IAAAW,WAAA,GAAAC,sBAAA,CAAAZ,OAAA;AAzBA;AACA;AACA;;AAOA;AACA;AACA;;AAWA;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DjD,KAAK,EAAE;YACN,GAAGgD,GAAG,CAAChD,KAAK;YACZ,GAAGiC,YAAY,CAACjC;UACjB;QACD,CAAC;MACF,CAAC,EAAEa,KAAK,CAACoB,YAAY,IAAI,CAAC,CAAE;IAAG,CAChC,CAAC,CACF;EACF,CAAC,EACD,yBACD,CAAC;EACD,IAAAJ,gBAAS,EACR,uBAAuB,EACvB,mBAAmB,EACnBW,uBACD,CAAC;AACF"}
@@ -14,7 +14,6 @@ var _resizableBoxPopover = _interopRequireDefault(require("./components/resizabl
14
14
  var _inserter = require("./components/inserter");
15
15
  var _listView = require("./components/list-view");
16
16
  var _blockInfoSlotFill = _interopRequireDefault(require("./components/block-info-slot-fill"));
17
- var _blockContextualToolbar = _interopRequireDefault(require("./components/block-tools/block-contextual-toolbar"));
18
17
  var _useShouldContextualToolbarShow = require("./utils/use-should-contextual-toolbar-show");
19
18
  var _utils = require("./hooks/utils");
20
19
  var _blockQuickNavigation = _interopRequireDefault(require("./components/block-quick-navigation"));
@@ -49,7 +48,6 @@ exports.privateApis = privateApis;
49
48
  PrivateListView: _listView.PrivateListView,
50
49
  ResizableBoxPopover: _resizableBoxPopover.default,
51
50
  BlockInfo: _blockInfoSlotFill.default,
52
- BlockContextualToolbar: _blockContextualToolbar.default,
53
51
  useShouldContextualToolbarShow: _useShouldContextualToolbarShow.useShouldContextualToolbarShow,
54
52
  cleanEmptyObject: _utils.cleanEmptyObject,
55
53
  useStyleOverride: _utils.useStyleOverride,
@@ -1 +1 @@
1
- {"version":3,"names":["globalStyles","_interopRequireWildcard","require","_provider","_lockUnlock","_getRichTextValues","_object","_resizableBoxPopover","_interopRequireDefault","_inserter","_listView","_blockInfoSlotFill","_blockContextualToolbar","_useShouldContextualToolbarShow","_utils","_blockQuickNavigation","_layout","_blockRemovalWarningModal","_hooks","_dimensionsTool","_resolutionTool","_reusableBlockRenameHint","_formatEdit","_blockCanvas","_utils2","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","privateApis","exports","lock","ExperimentalBlockCanvas","ExperimentalBlockEditorProvider","getDuotoneFilter","getRichTextValues","kebabCase","PrivateInserter","PrivateListView","ResizableBoxPopover","BlockInfo","BlockContextualToolbar","useShouldContextualToolbarShow","cleanEmptyObject","useStyleOverride","BlockQuickNavigation","LayoutStyle","BlockRemovalWarningModal","useLayoutClasses","useLayoutStyles","DimensionsTool","ResolutionTool","ReusableBlocksRenameHint","useReusableBlocksRenameHint","usesContextKey"],"sources":["@wordpress/block-editor/src/private-apis.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport * as globalStyles from './components/global-styles';\nimport { ExperimentalBlockEditorProvider } from './components/provider';\nimport { lock } from './lock-unlock';\nimport { getRichTextValues } from './components/rich-text/get-rich-text-values';\nimport { kebabCase } from './utils/object';\nimport ResizableBoxPopover from './components/resizable-box-popover';\nimport { ComposedPrivateInserter as PrivateInserter } from './components/inserter';\nimport { PrivateListView } from './components/list-view';\nimport BlockInfo from './components/block-info-slot-fill';\nimport BlockContextualToolbar from './components/block-tools/block-contextual-toolbar';\nimport { useShouldContextualToolbarShow } from './utils/use-should-contextual-toolbar-show';\nimport { cleanEmptyObject, useStyleOverride } from './hooks/utils';\nimport BlockQuickNavigation from './components/block-quick-navigation';\nimport { LayoutStyle } from './components/block-list/layout';\nimport { BlockRemovalWarningModal } from './components/block-removal-warning-modal';\nimport { useLayoutClasses, useLayoutStyles } from './hooks';\nimport DimensionsTool from './components/dimensions-tool';\nimport ResolutionTool from './components/resolution-tool';\nimport {\n\tdefault as ReusableBlocksRenameHint,\n\tuseReusableBlocksRenameHint,\n} from './components/inserter/reusable-block-rename-hint';\nimport { usesContextKey } from './components/rich-text/format-edit';\nimport { ExperimentalBlockCanvas } from './components/block-canvas';\nimport { getDuotoneFilter } from './components/duotone/utils';\n\n/**\n * Private @wordpress/block-editor APIs.\n */\nexport const privateApis = {};\nlock( privateApis, {\n\t...globalStyles,\n\tExperimentalBlockCanvas,\n\tExperimentalBlockEditorProvider,\n\tgetDuotoneFilter,\n\tgetRichTextValues,\n\tkebabCase,\n\tPrivateInserter,\n\tPrivateListView,\n\tResizableBoxPopover,\n\tBlockInfo,\n\tBlockContextualToolbar,\n\tuseShouldContextualToolbarShow,\n\tcleanEmptyObject,\n\tuseStyleOverride,\n\tBlockQuickNavigation,\n\tLayoutStyle,\n\tBlockRemovalWarningModal,\n\tuseLayoutClasses,\n\tuseLayoutStyles,\n\tDimensionsTool,\n\tResolutionTool,\n\tReusableBlocksRenameHint,\n\tuseReusableBlocksRenameHint,\n\tusesContextKey,\n} );\n"],"mappings":";;;;;;;AAGA,IAAAA,YAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,kBAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,oBAAA,GAAAC,sBAAA,CAAAN,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AACA,IAAAQ,SAAA,GAAAR,OAAA;AACA,IAAAS,kBAAA,GAAAH,sBAAA,CAAAN,OAAA;AACA,IAAAU,uBAAA,GAAAJ,sBAAA,CAAAN,OAAA;AACA,IAAAW,+BAAA,GAAAX,OAAA;AACA,IAAAY,MAAA,GAAAZ,OAAA;AACA,IAAAa,qBAAA,GAAAP,sBAAA,CAAAN,OAAA;AACA,IAAAc,OAAA,GAAAd,OAAA;AACA,IAAAe,yBAAA,GAAAf,OAAA;AACA,IAAAgB,MAAA,GAAAhB,OAAA;AACA,IAAAiB,eAAA,GAAAX,sBAAA,CAAAN,OAAA;AACA,IAAAkB,eAAA,GAAAZ,sBAAA,CAAAN,OAAA;AACA,IAAAmB,wBAAA,GAAApB,uBAAA,CAAAC,OAAA;AAIA,IAAAoB,WAAA,GAAApB,OA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CAAC;AAACC,OAAA,CAAAD,WAAA,GAAAA,WAAA;AAC9B,IAAAE,gBAAI,EAAEF,WAAW,EAAE;EAClB,GAAG/C,YAAY;EACfkD,uBAAuB,EAAvBA,oCAAuB;EACvBC,+BAA+B,EAA/BA,yCAA+B;EAC/BC,gBAAgB,EAAhBA,wBAAgB;EAChBC,iBAAiB,EAAjBA,oCAAiB;EACjBC,SAAS,EAATA,iBAAS;EACTC,eAAe,EAAfA,iCAAe;EACfC,eAAe,EAAfA,yBAAe;EACfC,mBAAmB,EAAnBA,4BAAmB;EACnBC,SAAS,EAATA,0BAAS;EACTC,sBAAsB,EAAtBA,+BAAsB;EACtBC,8BAA8B,EAA9BA,8DAA8B;EAC9BC,gBAAgB,EAAhBA,uBAAgB;EAChBC,gBAAgB,EAAhBA,uBAAgB;EAChBC,oBAAoB,EAApBA,6BAAoB;EACpBC,WAAW,EAAXA,mBAAW;EACXC,wBAAwB,EAAxBA,kDAAwB;EACxBC,gBAAgB,EAAhBA,uBAAgB;EAChBC,eAAe,EAAfA,sBAAe;EACfC,cAAc,EAAdA,uBAAc;EACdC,cAAc,EAAdA,uBAAc;EACdC,wBAAwB,EAAxBA,gCAAwB;EACxBC,2BAA2B,EAA3BA,oDAA2B;EAC3BC,cAAc,EAAdA;AACD,CAAE,CAAC"}
1
+ {"version":3,"names":["globalStyles","_interopRequireWildcard","require","_provider","_lockUnlock","_getRichTextValues","_object","_resizableBoxPopover","_interopRequireDefault","_inserter","_listView","_blockInfoSlotFill","_useShouldContextualToolbarShow","_utils","_blockQuickNavigation","_layout","_blockRemovalWarningModal","_hooks","_dimensionsTool","_resolutionTool","_reusableBlockRenameHint","_formatEdit","_blockCanvas","_utils2","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","privateApis","exports","lock","ExperimentalBlockCanvas","ExperimentalBlockEditorProvider","getDuotoneFilter","getRichTextValues","kebabCase","PrivateInserter","PrivateListView","ResizableBoxPopover","BlockInfo","useShouldContextualToolbarShow","cleanEmptyObject","useStyleOverride","BlockQuickNavigation","LayoutStyle","BlockRemovalWarningModal","useLayoutClasses","useLayoutStyles","DimensionsTool","ResolutionTool","ReusableBlocksRenameHint","useReusableBlocksRenameHint","usesContextKey"],"sources":["@wordpress/block-editor/src/private-apis.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport * as globalStyles from './components/global-styles';\nimport { ExperimentalBlockEditorProvider } from './components/provider';\nimport { lock } from './lock-unlock';\nimport { getRichTextValues } from './components/rich-text/get-rich-text-values';\nimport { kebabCase } from './utils/object';\nimport ResizableBoxPopover from './components/resizable-box-popover';\nimport { ComposedPrivateInserter as PrivateInserter } from './components/inserter';\nimport { PrivateListView } from './components/list-view';\nimport BlockInfo from './components/block-info-slot-fill';\nimport { useShouldContextualToolbarShow } from './utils/use-should-contextual-toolbar-show';\nimport { cleanEmptyObject, useStyleOverride } from './hooks/utils';\nimport BlockQuickNavigation from './components/block-quick-navigation';\nimport { LayoutStyle } from './components/block-list/layout';\nimport { BlockRemovalWarningModal } from './components/block-removal-warning-modal';\nimport { useLayoutClasses, useLayoutStyles } from './hooks';\nimport DimensionsTool from './components/dimensions-tool';\nimport ResolutionTool from './components/resolution-tool';\nimport {\n\tdefault as ReusableBlocksRenameHint,\n\tuseReusableBlocksRenameHint,\n} from './components/inserter/reusable-block-rename-hint';\nimport { usesContextKey } from './components/rich-text/format-edit';\nimport { ExperimentalBlockCanvas } from './components/block-canvas';\nimport { getDuotoneFilter } from './components/duotone/utils';\n\n/**\n * Private @wordpress/block-editor APIs.\n */\nexport const privateApis = {};\nlock( privateApis, {\n\t...globalStyles,\n\tExperimentalBlockCanvas,\n\tExperimentalBlockEditorProvider,\n\tgetDuotoneFilter,\n\tgetRichTextValues,\n\tkebabCase,\n\tPrivateInserter,\n\tPrivateListView,\n\tResizableBoxPopover,\n\tBlockInfo,\n\tuseShouldContextualToolbarShow,\n\tcleanEmptyObject,\n\tuseStyleOverride,\n\tBlockQuickNavigation,\n\tLayoutStyle,\n\tBlockRemovalWarningModal,\n\tuseLayoutClasses,\n\tuseLayoutStyles,\n\tDimensionsTool,\n\tResolutionTool,\n\tReusableBlocksRenameHint,\n\tuseReusableBlocksRenameHint,\n\tusesContextKey,\n} );\n"],"mappings":";;;;;;;AAGA,IAAAA,YAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,kBAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,oBAAA,GAAAC,sBAAA,CAAAN,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AACA,IAAAQ,SAAA,GAAAR,OAAA;AACA,IAAAS,kBAAA,GAAAH,sBAAA,CAAAN,OAAA;AACA,IAAAU,+BAAA,GAAAV,OAAA;AACA,IAAAW,MAAA,GAAAX,OAAA;AACA,IAAAY,qBAAA,GAAAN,sBAAA,CAAAN,OAAA;AACA,IAAAa,OAAA,GAAAb,OAAA;AACA,IAAAc,yBAAA,GAAAd,OAAA;AACA,IAAAe,MAAA,GAAAf,OAAA;AACA,IAAAgB,eAAA,GAAAV,sBAAA,CAAAN,OAAA;AACA,IAAAiB,eAAA,GAAAX,sBAAA,CAAAN,OAAA;AACA,IAAAkB,wBAAA,GAAAnB,uBAAA,CAAAC,OAAA;AAIA,IAAAmB,WAAA,GAAAnB,OAAA;AACA,IAAAoB,YAAA,GAAApB,OAAA;AACA,IAAAqB,OAAA,GAAArB,OAAA;AAA8D,SAAAsB,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,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A,iBAAS;EACTC,eAAe,EAAfA,iCAAe;EACfC,eAAe,EAAfA,yBAAe;EACfC,mBAAmB,EAAnBA,4BAAmB;EACnBC,SAAS,EAATA,0BAAS;EACTC,8BAA8B,EAA9BA,8DAA8B;EAC9BC,gBAAgB,EAAhBA,uBAAgB;EAChBC,gBAAgB,EAAhBA,uBAAgB;EAChBC,oBAAoB,EAApBA,6BAAoB;EACpBC,WAAW,EAAXA,mBAAW;EACXC,wBAAwB,EAAxBA,kDAAwB;EACxBC,gBAAgB,EAAhBA,uBAAgB;EAChBC,eAAe,EAAfA,sBAAe;EACfC,cAAc,EAAdA,uBAAc;EACdC,cAAc,EAAdA,uBAAc;EACdC,wBAAwB,EAAxBA,gCAAwB;EACxBC,2BAA2B,EAA3BA,oDAA2B;EAC3BC,cAAc,EAAdA;AACD,CAAE,CAAC"}
@@ -13,6 +13,7 @@ exports.setBlockRemovalRules = setBlockRemovalRules;
13
13
  exports.setOpenedBlockSettingsMenu = setOpenedBlockSettingsMenu;
14
14
  exports.setStyleOverride = setStyleOverride;
15
15
  exports.showBlockInterface = showBlockInterface;
16
+ exports.syncDerivedBlockAttributes = syncDerivedBlockAttributes;
16
17
  var _element = require("@wordpress/element");
17
18
  /**
18
19
  * WordPress dependencies
@@ -292,4 +293,11 @@ function deleteStyleOverride(id) {
292
293
  id
293
294
  };
294
295
  }
296
+ function syncDerivedBlockAttributes(clientId, attributes) {
297
+ return {
298
+ type: 'SYNC_DERIVED_BLOCK_ATTRIBUTES',
299
+ clientIds: [clientId],
300
+ attributes
301
+ };
302
+ }
295
303
  //# sourceMappingURL=private-actions.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_element","require","castArray","maybeArray","Array","isArray","privateSettings","__experimentalUpdateSettings","settings","stripExperimentalSettings","reset","cleanSettings","Platform","OS","key","includes","type","hideBlockInterface","showBlockInterface","privateRemoveBlocks","clientIds","selectPrevious","forceRemove","select","dispatch","registry","length","rootClientId","getBlockRootClientId","canRemoveBlocks","rules","getBlockRemovalRules","blockNamesForPrompt","Set","queue","clientId","shift","blockName","getBlockName","add","innerBlocks","getBlockOrder","push","size","displayBlockRemovalPrompt","from","selectPreviousBlock","batch","ensureDefaultBlock","exports","count","getBlockCount","__unstableHasCustomAppender","getSettings","insertDefaultBlock","clearBlockRemovalPrompt","setBlockRemovalRules","setOpenedBlockSettingsMenu","setStyleOverride","id","style","deleteStyleOverride"],"sources":["@wordpress/block-editor/src/store/private-actions.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Platform } from '@wordpress/element';\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"],"mappings":";;;;;;;;;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA,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;AACO,SAASC,4BAA4BA,CAC3CC,QAAQ,EACR;EAAEC,yBAAyB,GAAG,KAAK;EAAEC,KAAK,GAAG;AAAM,CAAC,GAAG,CAAC,CAAC,EACxD;EACD,IAAIC,aAAa,GAAGH,QAAQ;EAC5B;EACA;EACA,IAAKC,yBAAyB,IAAIG,iBAAQ,CAACC,EAAE,KAAK,KAAK,EAAG;IACzDF,aAAa,GAAG,CAAC,CAAC;IAClB,KAAM,MAAMG,GAAG,IAAIN,QAAQ,EAAG;MAC7B,IAAK,CAAEF,eAAe,CAACS,QAAQ,CAAED,GAAI,CAAC,EAAG;QACxCH,aAAa,CAAEG,GAAG,CAAE,GAAGN,QAAQ,C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D;EAEA5B,QAAQ,CAAC8B,kBAAkB,CAAC,CAAC;AAC9B,CAAC;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAjBAL,OAAA,CAAAD,kBAAA,GAAAA,kBAAA;AAkBA,SAASJ,yBAAyBA,CACjCxB,SAAS,EACTC,cAAc,EACdW,mBAAmB,EAClB;EACD,OAAO;IACNhB,IAAI,EAAE,8BAA8B;IACpCI,SAAS;IACTC,cAAc;IACdW;EACD,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASuB,uBAAuBA,CAAA,EAAG;EACzC,OAAO;IACNvC,IAAI,EAAE;EACP,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASwC,oBAAoBA,CAAE1B,KAAK,GAAG,KAAK,EAAG;EACrD,OAAO;IACNd,IAAI,EAAE,yBAAyB;IAC/Bc;EACD,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS2B,0BAA0BA,CAAEtB,QAAQ,EAAG;EACtD,OAAO;IACNnB,IAAI,EAAE,gCAAgC;IACtCmB;EACD,CAAC;AACF;AAEO,SAASuB,gBAAgBA,CAAEC,EAAE,EAAEC,KAAK,EAAG;EAC7C,OAAO;IACN5C,IAAI,EAAE,oBAAoB;IAC1B2C,EAAE;IACFC;EACD,CAAC;AACF;AAEO,SAASC,mBAAmBA,CAAEF,EAAE,EAAG;EACzC,OAAO;IACN3C,IAAI,EAAE,uBAAuB;IAC7B2C;EACD,CAAC;AACF"}
1
+ {"version":3,"names":["_element","require","castArray","maybeArray","Array","isArray","privateSettings","__experimentalUpdateSettings","settings","stripExperimentalSettings","reset","cleanSettings","Platform","OS","key","includes","type","hideBlockInterface","showBlockInterface","privateRemoveBlocks","clientIds","selectPrevious","forceRemove","select","dispatch","registry","length","rootClientId","getBlockRootClientId","canRemoveBlocks","rules","getBlockRemovalRules","blockNamesForPrompt","Set","queue","clientId","shift","blockName","getBlockName","add","innerBlocks","getBlockOrder","push","size","displayBlockRemovalPrompt","from","selectPreviousBlock","batch","ensureDefaultBlock","exports","count","getBlockCount","__unstableHasCustomAppender","getSettings","insertDefaultBlock","clearBlockRemovalPrompt","setBlockRemovalRules","setOpenedBlockSettingsMenu","setStyleOverride","id","style","deleteStyleOverride","syncDerivedBlockAttributes","attributes"],"sources":["@wordpress/block-editor/src/store/private-actions.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Platform } from '@wordpress/element';\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\nexport function syncDerivedBlockAttributes( clientId, attributes ) {\n\treturn {\n\t\ttype: 'SYNC_DERIVED_BLOCK_ATTRIBUTES',\n\t\tclientIds: [ clientId ],\n\t\tattributes,\n\t};\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA,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;AACO,SAASC,4BAA4BA,CAC3CC,QAAQ,EACR;EAAEC,yBAAyB,GAAG,KAAK;EAAEC,KAAK,GAAG;AAAM,CAAC,GAAG,CAAC,CAAC,EACxD;EACD,IAAIC,aAAa,GAAGH,QAAQ;EAC5B;EACA;EACA,IAAKC,yBAAyB,IAAIG,iBAAQ,CAACC,EA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AAI,EAAE,uBAAuB;IAC7B2C;EACD,CAAC;AACF;AAEO,SAASG,0BAA0BA,CAAE3B,QAAQ,EAAE4B,UAAU,EAAG;EAClE,OAAO;IACN/C,IAAI,EAAE,+BAA+B;IACrCI,SAAS,EAAE,CAAEe,QAAQ,CAAE;IACvB4B;EACD,CAAC;AACF"}
@@ -11,10 +11,12 @@ exports.getOpenedBlockSettingsMenu = getOpenedBlockSettingsMenu;
11
11
  exports.getRegisteredInserterMediaCategories = getRegisteredInserterMediaCategories;
12
12
  exports.getRemovalPromptData = getRemovalPromptData;
13
13
  exports.getStyleOverrides = getStyleOverrides;
14
+ exports.hasAllowedPatterns = void 0;
14
15
  exports.isBlockInterfaceHidden = isBlockInterfaceHidden;
15
16
  exports.isBlockSubtreeDisabled = void 0;
16
17
  var _rememo = _interopRequireDefault(require("rememo"));
17
18
  var _selectors = require("./selectors");
19
+ var _utils = require("./utils");
18
20
  /**
19
21
  * External dependencies
20
22
  */
@@ -194,5 +196,37 @@ const getInserterMediaCategories = (0, _rememo.default)(state => {
194
196
  return Object.values(allowedMimeTypes).some(mimeType => mimeType.startsWith(`${category.mediaType}/`));
195
197
  });
196
198
  }, state => [state.settings.inserterMediaCategories, state.settings.allowedMimeTypes, state.settings.enableOpenverseMediaCategory, state.registeredInserterMediaCategories]);
199
+
200
+ /**
201
+ * Returns whether there is at least one allowed pattern for inner blocks children.
202
+ * This is useful for deferring the parsing of all patterns until needed.
203
+ *
204
+ * @param {Object} state Editor state.
205
+ * @param {string} [rootClientId=null] Target root client ID.
206
+ *
207
+ * @return {boolean} If there is at least one allowed pattern.
208
+ */
197
209
  exports.getInserterMediaCategories = getInserterMediaCategories;
210
+ const hasAllowedPatterns = (0, _rememo.default)((state, rootClientId = null) => {
211
+ const patterns = state.settings.__experimentalBlockPatterns;
212
+ const userPatterns = (0, _utils.getUserPatterns)(state);
213
+ const {
214
+ allowedBlockTypes
215
+ } = (0, _selectors.getSettings)(state);
216
+ return [...userPatterns, ...patterns].some(({
217
+ name,
218
+ inserter = true
219
+ }) => {
220
+ if (!inserter) {
221
+ return false;
222
+ }
223
+ const {
224
+ blocks
225
+ } = (0, _selectors.__experimentalGetParsedPattern)(state, name);
226
+ return (0, _utils.checkAllowListRecursive)(blocks, allowedBlockTypes) && blocks.every(({
227
+ name: blockName
228
+ }) => (0, _selectors.canInsertBlockType)(state, blockName, rootClientId));
229
+ });
230
+ }, (state, rootClientId) => [..._selectors.__experimentalGetAllowedPatterns.getDependants(state, rootClientId)]);
231
+ exports.hasAllowedPatterns = hasAllowedPatterns;
198
232
  //# sourceMappingURL=private-selectors.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_rememo","_interopRequireDefault","require","_selectors","isBlockInterfaceHidden","state","getLastInsertedBlocksClientIds","lastBlockInserted","clientIds","isBlockSubtreeDisabled","createSelector","clientId","isChildSubtreeDisabled","childClientId","getBlockEditingMode","getBlockOrder","every","blocks","parents","order","blockEditingModes","blockListSettings","exports","getEnabledClientIdsTree","rootClientId","flatMap","innerBlocks","settings","templateLock","getEnabledBlockParents","ascending","getBlockParents","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"],"sources":["@wordpress/block-editor/src/store/private-selectors.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport createSelector from 'rememo';\n\n/**\n * Internal dependencies\n */\nimport {\n\tgetBlockOrder,\n\tgetBlockParents,\n\tgetBlockEditingMode,\n} from './selectors';\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"],"mappings":";;;;;;;;;;;;;;;AAGA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,UAAA,GAAAD,OAAA;AARA;AACA;AACA;;AAGA;AACA;AACA;;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASE,sBAAsBA,CAAEC,KAAK,EAAG;EAC/C,OAAOA,KAAK,CAACD,sBAAsB;AACpC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,SAASE,8BAA8BA,CAAED,KAAK,EAAG;EACvD,OAAOA,KAAK,EAAEE,iBAAiB,EAAEC,SAAS;AAC3C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,sBAAsB,GAAG,IAAAC,eAAc,EACnD,CAAEL,KAAK,EAAEM,QAAQ,KAAM;EACtB,MAAMC,sBAAsB,GAAKC,aAAa,IAAM;IACnD,OACC,IAAAC,8BAAmB,EAAET,KAAK,EAAEQ,aAAc,CAAC,KAAK,UAAU,IAC1D,IAAAE,wBAAa,EAAEV,KAAK,EAAEQ,aAAc,CAAC,CAACG,KAAK,CAC1CJ,sBACD,CAAC;EAEH,CAAC;EACD,OACC,IAAAE,8BAAmB,EAAET,KAAK,EAAEM,QAAS,CAAC,KAAK,UAAU,IACrD,IAAAI,wBAAa,EAAEV,KAAK,EAAEM,QAAS,CAAC,CAACK,KAAK,CAAEJ,sBAAuB,CAAC;AAElE,CAAC,EACCP,KAAK,IAAM,CACZA,KAAK,CAACY,MAAM,CAACC,OAAO,EACpBb,KAAK,CAACY,MAAM,CAACE,KAAK,EAClBd,KAAK,CAACe,iBAAiB,EACvBf,KAAK,CAACgB,iBAAiB,CAEzB,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AARAC,OAAA,CAAAb,sBAAA,GAAAA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,CAAEF,IAAK,CACpD,CAAC,CACD;EACD,OAAOC,gBAAgB,CAACpB,MAAM,CAAIsB,QAAQ,IAAM;IAC/C;IACA,IACC,CAAEP,4BAA4B,IAC9BO,QAAQ,CAACH,IAAI,KAAK,WAAW,EAC5B;MACD,OAAO,KAAK;IACb;IACA,OAAOI,MAAM,CAACC,MAAM,CAAEV,gBAAiB,CAAC,CAACW,IAAI,CAAIC,QAAQ,IACxDA,QAAQ,CAACC,UAAU,CAAG,GAAGL,QAAQ,CAACM,SAAW,GAAG,CACjD,CAAC;EACF,CAAE,CAAC;AACJ,CAAC,EACCvD,KAAK,IAAM,CACZA,KAAK,CAACsB,QAAQ,CAACkB,uBAAuB,EACtCxC,KAAK,CAACsB,QAAQ,CAACmB,gBAAgB,EAC/BzC,KAAK,CAACsB,QAAQ,CAACoB,4BAA4B,EAC3C1C,KAAK,CAACsC,iCAAiC,CAEzC,CAAC;AAACrB,OAAA,CAAAsB,0BAAA,GAAAA,0BAAA"}
1
+ {"version":3,"names":["_rememo","_interopRequireDefault","require","_selectors","_utils","isBlockInterfaceHidden","state","getLastInsertedBlocksClientIds","lastBlockInserted","clientIds","isBlockSubtreeDisabled","createSelector","clientId","isChildSubtreeDisabled","childClientId","getBlockEditingMode","getBlockOrder","every","blocks","parents","order","blockEditingModes","blockListSettings","exports","getEnabledClientIdsTree","rootClientId","flatMap","innerBlocks","settings","templateLock","getEnabledBlockParents","ascending","getBlockParents","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","hasAllowedPatterns","patterns","__experimentalBlockPatterns","userPatterns","getUserPatterns","allowedBlockTypes","getSettings","inserter","__experimentalGetParsedPattern","checkAllowListRecursive","blockName","canInsertBlockType","__experimentalGetAllowedPatterns","getDependants"],"sources":["@wordpress/block-editor/src/store/private-selectors.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport createSelector from 'rememo';\n\n/**\n * Internal dependencies\n */\nimport {\n\tgetBlockOrder,\n\tgetBlockParents,\n\tgetBlockEditingMode,\n\tgetSettings,\n\t__experimentalGetParsedPattern,\n\tcanInsertBlockType,\n\t__experimentalGetAllowedPatterns,\n} from './selectors';\nimport { getUserPatterns, checkAllowListRecursive } from './utils';\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\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 = createSelector(\n\t( state, rootClientId = null ) => {\n\t\tconst patterns = state.settings.__experimentalBlockPatterns;\n\t\tconst userPatterns = getUserPatterns( state );\n\t\tconst { allowedBlockTypes } = getSettings( state );\n\t\treturn [ ...userPatterns, ...patterns ].some(\n\t\t\t( { 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(\n\t\t\t\t\tstate,\n\t\t\t\t\tname\n\t\t\t\t);\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},\n\t( state, rootClientId ) => [\n\t\t...__experimentalGetAllowedPatterns.getDependants(\n\t\t\tstate,\n\t\t\trootClientId\n\t\t),\n\t]\n);\n"],"mappings":";;;;;;;;;;;;;;;;AAGA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,UAAA,GAAAD,OAAA;AASA,IAAAE,MAAA,GAAAF,OAAA;AAjBA;AACA;AACA;;AAGA;AACA;AACA;;AAYA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASG,sBAAsBA,CAAEC,KAAK,EAAG;EAC/C,OAAOA,KAAK,CAACD,sBAAsB;AACpC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,SAASE,8BAA8BA,CAAED,KAAK,EAAG;EACvD,OAAOA,KAAK,EAAEE,iBAAiB,EAAEC,SAAS;AAC3C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,sBAAsB,GAAG,IAAAC,eAAc,EACnD,CAAEL,KAAK,EAAEM,QAAQ,KAAM;EACtB,MAAMC,sBAAsB,GAAKC,aAAa,IAAM;IACnD,OACC,IAAAC,8BAAmB,EAAET,KAAK,EAAEQ,aAAc,CAAC,KAAK,UAAU,IAC1D,IAAAE,wBAAa,EAAEV,KAAK,EAAEQ,aAAc,CAAC,CAACG,KAAK,CAC1CJ,sBACD,CAAC;EAEH,CAAC;EACD,OACC,IAAAE,8BAAmB,EAAET,KAAK,EAAEM,QAAS,CAAC,KAAK,UAAU,IACrD,IAAAI,wBAAa,EAAEV,KAAK,EAAEM,QAAS,CAAC,CAACK,KAAK,CAAEJ,sBAAuB,CAAC;AAElE,CAAC,EACCP,KAAK,IAAM,CACZA,KAAK,CAACY,MAAM,CAACC,OAAO,EACpBb,KAAK,CAACY,MAAM,CAACE,KAAK,EAClBd,KAAK,CAACe,iBAAiB,EACvBf,KAAK,CAACgB,iBAAiB,CAEzB,CAA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AAM;MAAEnD;IAAO,CAAC,GAAG,IAAAoD,yCAA8B,EAChDhE,KAAK,EACL8C,IACD,CAAC;IACD,OACC,IAAAmB,8BAAuB,EAAErD,MAAM,EAAEiD,iBAAkB,CAAC,IACpDjD,MAAM,CAACD,KAAK,CAAE,CAAE;MAAEmC,IAAI,EAAEoB;IAAU,CAAC,KAClC,IAAAC,6BAAkB,EAAEnE,KAAK,EAAEkE,SAAS,EAAE/C,YAAa,CACpD,CAAC;EAEH,CACD,CAAC;AACF,CAAC,EACD,CAAEnB,KAAK,EAAEmB,YAAY,KAAM,CAC1B,GAAGiD,2CAAgC,CAACC,aAAa,CAChDrE,KAAK,EACLmB,YACD,CAAC,CAEH,CAAC;AAACF,OAAA,CAAAuC,kBAAA,GAAAA,kBAAA"}
@@ -296,6 +296,7 @@ const withBlockTree = reducer => (state = {}, action) => {
296
296
  });
297
297
  updateParentInnerBlocksInTree(newState, [action.clientId], false);
298
298
  break;
299
+ case 'SYNC_DERIVED_BLOCK_ATTRIBUTES':
299
300
  case 'UPDATE_BLOCK_ATTRIBUTES':
300
301
  {
301
302
  newState.tree = new Map(newState.tree);
@@ -405,6 +406,12 @@ function withPersistentBlockChange(reducer) {
405
406
  let markNextChangeAsNotPersistent = false;
406
407
  return (state, action) => {
407
408
  let nextState = reducer(state, action);
409
+ if (action.type === 'SYNC_DERIVED_BLOCK_ATTRIBUTES') {
410
+ return nextState.isPersistentChange ? {
411
+ ...nextState,
412
+ isPersistentChange: false
413
+ } : nextState;
414
+ }
408
415
  const isExplicitPersistentChange = action.type === 'MARK_LAST_CHANGE_AS_PERSISTENT' || markNextChangeAsNotPersistent;
409
416
 
410
417
  // Defer to previous state value (or default) unless changing or
@@ -775,6 +782,7 @@ withBlockReset, withPersistentBlockChange, withIgnoredBlockChange, withResetCont
775
782
  });
776
783
  return newState;
777
784
  }
785
+ case 'SYNC_DERIVED_BLOCK_ATTRIBUTES':
778
786
  case 'UPDATE_BLOCK_ATTRIBUTES':
779
787
  {
780
788
  // Avoid a state change if none of the block IDs are known.