@wordpress/block-editor 12.10.2 → 12.11.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 (1275) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/README.md +13 -11
  3. package/build/autocompleters/block.js +3 -2
  4. package/build/autocompleters/block.js.map +1 -1
  5. package/build/autocompleters/link.js +3 -3
  6. package/build/autocompleters/link.js.map +1 -1
  7. package/build/components/alignment-control/index.js +3 -3
  8. package/build/components/alignment-control/index.js.map +1 -1
  9. package/build/components/alignment-control/ui.js +2 -2
  10. package/build/components/alignment-control/ui.js.map +1 -1
  11. package/build/components/autocomplete/index.js +3 -2
  12. package/build/components/autocomplete/index.js.map +1 -1
  13. package/build/components/block-actions/index.js +2 -2
  14. package/build/components/block-actions/index.js.map +1 -1
  15. package/build/components/block-alignment-control/index.js +3 -3
  16. package/build/components/block-alignment-control/index.js.map +1 -1
  17. package/build/components/block-alignment-control/ui.js +4 -4
  18. package/build/components/block-alignment-control/ui.js.map +1 -1
  19. package/build/components/block-alignment-control/ui.native.js +2 -2
  20. package/build/components/block-alignment-control/ui.native.js.map +1 -1
  21. package/build/components/block-alignment-matrix-control/index.js +5 -5
  22. package/build/components/block-alignment-matrix-control/index.js.map +1 -1
  23. package/build/components/block-breadcrumb/index.js +12 -12
  24. package/build/components/block-breadcrumb/index.js.map +1 -1
  25. package/build/components/block-canvas/index.js +13 -15
  26. package/build/components/block-canvas/index.js.map +1 -1
  27. package/build/components/block-caption/index.native.js +3 -3
  28. package/build/components/block-caption/index.native.js.map +1 -1
  29. package/build/components/block-card/index.js +7 -7
  30. package/build/components/block-card/index.js.map +1 -1
  31. package/build/components/block-compare/block-view.js +9 -8
  32. package/build/components/block-compare/block-view.js.map +1 -1
  33. package/build/components/block-compare/index.js +5 -5
  34. package/build/components/block-compare/index.js.map +1 -1
  35. package/build/components/block-context/index.js +2 -1
  36. package/build/components/block-context/index.js.map +1 -1
  37. package/build/components/block-controls/fill.js +5 -5
  38. package/build/components/block-controls/fill.js.map +1 -1
  39. package/build/components/block-controls/index.js +3 -3
  40. package/build/components/block-controls/index.js.map +1 -1
  41. package/build/components/block-controls/slot.js +3 -2
  42. package/build/components/block-controls/slot.js.map +1 -1
  43. package/build/components/block-controls/slot.native.js +4 -4
  44. package/build/components/block-controls/slot.native.js.map +1 -1
  45. package/build/components/block-draggable/draggable-chip.js +6 -6
  46. package/build/components/block-draggable/draggable-chip.js.map +1 -1
  47. package/build/components/block-draggable/draggable-chip.native.js +4 -4
  48. package/build/components/block-draggable/draggable-chip.native.js.map +1 -1
  49. package/build/components/block-draggable/dropping-insertion-point.native.js +2 -2
  50. package/build/components/block-draggable/dropping-insertion-point.native.js.map +1 -1
  51. package/build/components/block-draggable/index.js +4 -3
  52. package/build/components/block-draggable/index.js.map +1 -1
  53. package/build/components/block-draggable/index.native.js +9 -8
  54. package/build/components/block-draggable/index.native.js.map +1 -1
  55. package/build/components/block-edit/edit.js +5 -4
  56. package/build/components/block-edit/edit.js.map +1 -1
  57. package/build/components/block-edit/edit.native.js +3 -2
  58. package/build/components/block-edit/edit.native.js.map +1 -1
  59. package/build/components/block-edit/index.js +3 -2
  60. package/build/components/block-edit/index.js.map +1 -1
  61. package/build/components/block-edit-visually-button/index.js +2 -2
  62. package/build/components/block-edit-visually-button/index.js.map +1 -1
  63. package/build/components/block-full-height-alignment-control/index.js +2 -2
  64. package/build/components/block-full-height-alignment-control/index.js.map +1 -1
  65. package/build/components/block-heading-level-dropdown/heading-level-icon.js +4 -4
  66. package/build/components/block-heading-level-dropdown/heading-level-icon.js.map +1 -1
  67. package/build/components/block-heading-level-dropdown/index.js +6 -6
  68. package/build/components/block-heading-level-dropdown/index.js.map +1 -1
  69. package/build/components/block-heading-level-dropdown/index.native.js +6 -6
  70. package/build/components/block-heading-level-dropdown/index.native.js.map +1 -1
  71. package/build/components/block-icon/index.js +4 -3
  72. package/build/components/block-icon/index.js.map +1 -1
  73. package/build/components/block-icon/index.native.js +3 -3
  74. package/build/components/block-icon/index.native.js.map +1 -1
  75. package/build/components/block-info-slot-fill/index.js +3 -3
  76. package/build/components/block-info-slot-fill/index.js.map +1 -1
  77. package/build/components/block-inspector/index.js +34 -34
  78. package/build/components/block-inspector/index.js.map +1 -1
  79. package/build/components/block-list/block-crash-warning.js +2 -2
  80. package/build/components/block-list/block-crash-warning.js.map +1 -1
  81. package/build/components/block-list/block-html.js +3 -2
  82. package/build/components/block-list/block-html.js.map +1 -1
  83. package/build/components/block-list/block-invalid-warning.js +6 -5
  84. package/build/components/block-list/block-invalid-warning.js.map +1 -1
  85. package/build/components/block-list/block-invalid-warning.native.js +3 -3
  86. package/build/components/block-list/block-invalid-warning.native.js.map +1 -1
  87. package/build/components/block-list/block-list-item-cell.native.js +3 -2
  88. package/build/components/block-list/block-list-item-cell.native.js.map +1 -1
  89. package/build/components/block-list/block-list-item.native.js +10 -10
  90. package/build/components/block-list/block-list-item.native.js.map +1 -1
  91. package/build/components/block-list/block-outline.native.js +2 -2
  92. package/build/components/block-list/block-outline.native.js.map +1 -1
  93. package/build/components/block-list/block-selection-button.native.js +9 -9
  94. package/build/components/block-list/block-selection-button.native.js.map +1 -1
  95. package/build/components/block-list/block.js +16 -15
  96. package/build/components/block-list/block.js.map +1 -1
  97. package/build/components/block-list/block.native.js +10 -9
  98. package/build/components/block-list/block.native.js.map +1 -1
  99. package/build/components/block-list/grid-item.native.js +2 -2
  100. package/build/components/block-list/grid-item.native.js.map +1 -1
  101. package/build/components/block-list/index.js +14 -13
  102. package/build/components/block-list/index.js.map +1 -1
  103. package/build/components/block-list/index.native.js +21 -20
  104. package/build/components/block-list/index.native.js.map +1 -1
  105. package/build/components/block-list/insertion-point.native.js +5 -5
  106. package/build/components/block-list/insertion-point.native.js.map +1 -1
  107. package/build/components/block-list/layout.js +3 -2
  108. package/build/components/block-list/layout.js.map +1 -1
  109. package/build/components/block-list/subdirectory-icon.js +3 -3
  110. package/build/components/block-list/subdirectory-icon.js.map +1 -1
  111. package/build/components/block-list-appender/index.js +5 -5
  112. package/build/components/block-list-appender/index.js.map +1 -1
  113. package/build/components/block-list-appender/index.native.js +4 -4
  114. package/build/components/block-list-appender/index.native.js.map +1 -1
  115. package/build/components/block-lock/menu-item.js +4 -3
  116. package/build/components/block-lock/menu-item.js.map +1 -1
  117. package/build/components/block-lock/modal.js +21 -20
  118. package/build/components/block-lock/modal.js.map +1 -1
  119. package/build/components/block-lock/toolbar.js +5 -4
  120. package/build/components/block-lock/toolbar.js.map +1 -1
  121. package/build/components/block-media-update-progress/index.native.js +5 -4
  122. package/build/components/block-media-update-progress/index.native.js.map +1 -1
  123. package/build/components/block-mover/button.js +6 -5
  124. package/build/components/block-mover/button.js.map +1 -1
  125. package/build/components/block-mover/index.js +7 -7
  126. package/build/components/block-mover/index.js.map +1 -1
  127. package/build/components/block-mover/index.native.js +5 -4
  128. package/build/components/block-mover/index.native.js.map +1 -1
  129. package/build/components/block-navigation/dropdown.js +8 -7
  130. package/build/components/block-navigation/dropdown.js.map +1 -1
  131. package/build/components/block-parent-selector/index.js +6 -5
  132. package/build/components/block-parent-selector/index.js.map +1 -1
  133. package/build/components/block-pattern-setup/index.js +20 -19
  134. package/build/components/block-pattern-setup/index.js.map +1 -1
  135. package/build/components/block-pattern-setup/setup-toolbar.js +12 -12
  136. package/build/components/block-pattern-setup/setup-toolbar.js.map +1 -1
  137. package/build/components/block-patterns-list/index.js +19 -18
  138. package/build/components/block-patterns-list/index.js.map +1 -1
  139. package/build/components/block-patterns-paging/index.js +12 -12
  140. package/build/components/block-patterns-paging/index.js.map +1 -1
  141. package/build/components/block-popover/drop-zone.js +3 -3
  142. package/build/components/block-popover/drop-zone.js.map +1 -1
  143. package/build/components/block-popover/inbetween.js +4 -3
  144. package/build/components/block-popover/inbetween.js.map +1 -1
  145. package/build/components/block-popover/index.js +4 -3
  146. package/build/components/block-popover/index.js.map +1 -1
  147. package/build/components/block-preview/auto.js +9 -8
  148. package/build/components/block-preview/auto.js.map +1 -1
  149. package/build/components/block-preview/index.js +7 -6
  150. package/build/components/block-preview/index.js.map +1 -1
  151. package/build/components/block-quick-navigation/index.js +7 -7
  152. package/build/components/block-quick-navigation/index.js.map +1 -1
  153. package/build/components/block-removal-warning-modal/index.js +7 -6
  154. package/build/components/block-removal-warning-modal/index.js.map +1 -1
  155. package/build/components/block-selection-clearer/index.js +2 -2
  156. package/build/components/block-selection-clearer/index.js.map +1 -1
  157. package/build/components/block-settings/button.native.js +3 -3
  158. package/build/components/block-settings/button.native.js.map +1 -1
  159. package/build/components/block-settings/container.native.js +12 -12
  160. package/build/components/block-settings/container.native.js.map +1 -1
  161. package/build/components/block-settings-menu/block-html-convert-button.js +21 -17
  162. package/build/components/block-settings-menu/block-html-convert-button.js.map +1 -1
  163. package/build/components/block-settings-menu/block-mode-toggle.js +2 -2
  164. package/build/components/block-settings-menu/block-mode-toggle.js.map +1 -1
  165. package/build/components/block-settings-menu/block-settings-dropdown.js +17 -16
  166. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  167. package/build/components/block-settings-menu/index.js +2 -2
  168. package/build/components/block-settings-menu/index.js.map +1 -1
  169. package/build/components/block-settings-menu-controls/index.js +9 -9
  170. package/build/components/block-settings-menu-controls/index.js.map +1 -1
  171. package/build/components/block-styles/index.js +9 -8
  172. package/build/components/block-styles/index.js.map +1 -1
  173. package/build/components/block-styles/index.native.js +4 -3
  174. package/build/components/block-styles/index.native.js.map +1 -1
  175. package/build/components/block-styles/menu-items.js +4 -4
  176. package/build/components/block-styles/menu-items.js.map +1 -1
  177. package/build/components/block-styles/preview-panel.js +3 -2
  178. package/build/components/block-styles/preview-panel.js.map +1 -1
  179. package/build/components/block-styles/preview.native.js +8 -7
  180. package/build/components/block-styles/preview.native.js.map +1 -1
  181. package/build/components/block-switcher/block-styles-menu.js +3 -3
  182. package/build/components/block-switcher/block-styles-menu.js.map +1 -1
  183. package/build/components/block-switcher/block-transformations-menu.js +11 -10
  184. package/build/components/block-switcher/block-transformations-menu.js.map +1 -1
  185. package/build/components/block-switcher/block-transformations-menu.native.js +2 -2
  186. package/build/components/block-switcher/block-transformations-menu.native.js.map +1 -1
  187. package/build/components/block-switcher/block-variation-transformations.js +6 -5
  188. package/build/components/block-switcher/block-variation-transformations.js.map +1 -1
  189. package/build/components/block-switcher/index.js +17 -17
  190. package/build/components/block-switcher/index.js.map +1 -1
  191. package/build/components/block-switcher/pattern-transformations-menu.js +18 -17
  192. package/build/components/block-switcher/pattern-transformations-menu.js.map +1 -1
  193. package/build/components/block-switcher/preview-block-popover.js +7 -7
  194. package/build/components/block-switcher/preview-block-popover.js.map +1 -1
  195. package/build/components/block-toolbar/block-toolbar-menu.native.js +6 -5
  196. package/build/components/block-toolbar/block-toolbar-menu.native.js.map +1 -1
  197. package/build/components/block-toolbar/index.js +16 -15
  198. package/build/components/block-toolbar/index.js.map +1 -1
  199. package/build/components/block-toolbar/index.native.js +8 -7
  200. package/build/components/block-toolbar/index.native.js.map +1 -1
  201. package/build/components/block-tools/back-compat.js +3 -2
  202. package/build/components/block-tools/back-compat.js.map +1 -1
  203. package/build/components/block-tools/block-contextual-toolbar.js +6 -5
  204. package/build/components/block-tools/block-contextual-toolbar.js.map +1 -1
  205. package/build/components/block-tools/block-selection-button.js +11 -10
  206. package/build/components/block-tools/block-selection-button.js.map +1 -1
  207. package/build/components/block-tools/index.js +10 -9
  208. package/build/components/block-tools/index.js.map +1 -1
  209. package/build/components/block-tools/insertion-point.js +9 -8
  210. package/build/components/block-tools/insertion-point.js.map +1 -1
  211. package/build/components/block-tools/selected-block-popover.js +9 -8
  212. package/build/components/block-tools/selected-block-popover.js.map +1 -1
  213. package/build/components/block-tools/zoom-out-mode-inserters.js +5 -4
  214. package/build/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
  215. package/build/components/block-types-list/index.js +4 -4
  216. package/build/components/block-types-list/index.js.map +1 -1
  217. package/build/components/block-types-list/index.native.js +11 -10
  218. package/build/components/block-types-list/index.native.js.map +1 -1
  219. package/build/components/block-variation-picker/index.js +8 -8
  220. package/build/components/block-variation-picker/index.js.map +1 -1
  221. package/build/components/block-variation-picker/index.native.js +8 -8
  222. package/build/components/block-variation-picker/index.native.js.map +1 -1
  223. package/build/components/block-variation-transforms/index.js +10 -9
  224. package/build/components/block-variation-transforms/index.js.map +1 -1
  225. package/build/components/block-vertical-alignment-control/icons.js +11 -11
  226. package/build/components/block-vertical-alignment-control/icons.js.map +1 -1
  227. package/build/components/block-vertical-alignment-control/index.js +3 -3
  228. package/build/components/block-vertical-alignment-control/index.js.map +1 -1
  229. package/build/components/block-vertical-alignment-control/ui.js +2 -2
  230. package/build/components/block-vertical-alignment-control/ui.js.map +1 -1
  231. package/build/components/border-radius-control/all-input-control.js +2 -2
  232. package/build/components/border-radius-control/all-input-control.js.map +1 -1
  233. package/build/components/border-radius-control/index.js +10 -9
  234. package/build/components/border-radius-control/index.js.map +1 -1
  235. package/build/components/border-radius-control/input-controls.js +5 -5
  236. package/build/components/border-radius-control/input-controls.js.map +1 -1
  237. package/build/components/border-radius-control/linked-button.js +3 -3
  238. package/build/components/border-radius-control/linked-button.js.map +1 -1
  239. package/build/components/button-block-appender/index.js +7 -6
  240. package/build/components/button-block-appender/index.js.map +1 -1
  241. package/build/components/button-block-appender/index.native.js +5 -5
  242. package/build/components/button-block-appender/index.native.js.map +1 -1
  243. package/build/components/caption/index.native.js +3 -3
  244. package/build/components/caption/index.native.js.map +1 -1
  245. package/build/components/child-layout-control/index.js +8 -7
  246. package/build/components/child-layout-control/index.js.map +1 -1
  247. package/build/components/color-palette/control.js +2 -2
  248. package/build/components/color-palette/control.js.map +1 -1
  249. package/build/components/color-palette/with-color-context.js +2 -2
  250. package/build/components/color-palette/with-color-context.js.map +1 -1
  251. package/build/components/color-style-selector/index.js +9 -9
  252. package/build/components/color-style-selector/index.js.map +1 -1
  253. package/build/components/colors/with-colors.js +5 -4
  254. package/build/components/colors/with-colors.js.map +1 -1
  255. package/build/components/colors-gradients/control.js +12 -12
  256. package/build/components/colors-gradients/control.js.map +1 -1
  257. package/build/components/colors-gradients/dropdown.js +13 -13
  258. package/build/components/colors-gradients/dropdown.js.map +1 -1
  259. package/build/components/colors-gradients/panel-color-gradient-settings.js +7 -7
  260. package/build/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
  261. package/build/components/colors-gradients/panel-color-gradient-settings.native.js +5 -4
  262. package/build/components/colors-gradients/panel-color-gradient-settings.native.js.map +1 -1
  263. package/build/components/contrast-checker/index.js +3 -3
  264. package/build/components/contrast-checker/index.js.map +1 -1
  265. package/build/components/contrast-checker/index.native.js +6 -5
  266. package/build/components/contrast-checker/index.native.js.map +1 -1
  267. package/build/components/convert-to-group-buttons/index.js +3 -3
  268. package/build/components/convert-to-group-buttons/index.js.map +1 -1
  269. package/build/components/convert-to-group-buttons/toolbar.js +4 -4
  270. package/build/components/convert-to-group-buttons/toolbar.js.map +1 -1
  271. package/build/components/copy-handler/index.js +29 -209
  272. package/build/components/copy-handler/index.js.map +1 -1
  273. package/build/components/date-format-picker/index.js +9 -8
  274. package/build/components/date-format-picker/index.js.map +1 -1
  275. package/build/components/default-block-appender/index.js +4 -4
  276. package/build/components/default-block-appender/index.js.map +1 -1
  277. package/build/components/default-block-appender/index.native.js +4 -4
  278. package/build/components/default-block-appender/index.native.js.map +1 -1
  279. package/build/components/default-style-picker/index.js +4 -3
  280. package/build/components/default-style-picker/index.js.map +1 -1
  281. package/build/components/dimensions-tool/aspect-ratio-tool.js +3 -3
  282. package/build/components/dimensions-tool/aspect-ratio-tool.js.map +1 -1
  283. package/build/components/dimensions-tool/index.js +5 -4
  284. package/build/components/dimensions-tool/index.js.map +1 -1
  285. package/build/components/dimensions-tool/scale-tool.js +6 -5
  286. package/build/components/dimensions-tool/scale-tool.js.map +1 -1
  287. package/build/components/dimensions-tool/width-height-tool.js +7 -7
  288. package/build/components/dimensions-tool/width-height-tool.js.map +1 -1
  289. package/build/components/duotone-control/index.js +18 -10
  290. package/build/components/duotone-control/index.js.map +1 -1
  291. package/build/components/editable-text/index.js +3 -2
  292. package/build/components/editable-text/index.js.map +1 -1
  293. package/build/components/editor-styles/index.js +5 -4
  294. package/build/components/editor-styles/index.js.map +1 -1
  295. package/build/components/floating-toolbar/index.native.js +8 -7
  296. package/build/components/floating-toolbar/index.native.js.map +1 -1
  297. package/build/components/floating-toolbar/nav-up-icon.js +4 -4
  298. package/build/components/floating-toolbar/nav-up-icon.js.map +1 -1
  299. package/build/components/font-appearance-control/index.js +4 -3
  300. package/build/components/font-appearance-control/index.js.map +1 -1
  301. package/build/components/font-family/index.js +2 -2
  302. package/build/components/font-family/index.js.map +1 -1
  303. package/build/components/font-sizes/font-size-picker.js +2 -2
  304. package/build/components/font-sizes/font-size-picker.js.map +1 -1
  305. package/build/components/font-sizes/with-font-sizes.js +4 -3
  306. package/build/components/font-sizes/with-font-sizes.js.map +1 -1
  307. package/build/components/global-styles/advanced-panel.js +7 -6
  308. package/build/components/global-styles/advanced-panel.js.map +1 -1
  309. package/build/components/global-styles/border-panel.js +8 -7
  310. package/build/components/global-styles/border-panel.js.map +1 -1
  311. package/build/components/global-styles/color-panel.js +21 -20
  312. package/build/components/global-styles/color-panel.js.map +1 -1
  313. package/build/components/global-styles/color-panel.native.js +4 -3
  314. package/build/components/global-styles/color-panel.native.js.map +1 -1
  315. package/build/components/global-styles/dimensions-panel.js +27 -26
  316. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  317. package/build/components/global-styles/effects-panel.js +23 -22
  318. package/build/components/global-styles/effects-panel.js.map +1 -1
  319. package/build/components/global-styles/filters-panel.js +17 -16
  320. package/build/components/global-styles/filters-panel.js.map +1 -1
  321. package/build/components/global-styles/hooks.js +1 -1
  322. package/build/components/global-styles/hooks.js.map +1 -1
  323. package/build/components/global-styles/image-settings-panel.js +4 -4
  324. package/build/components/global-styles/image-settings-panel.js.map +1 -1
  325. package/build/components/global-styles/typography-panel.js +22 -21
  326. package/build/components/global-styles/typography-panel.js.map +1 -1
  327. package/build/components/global-styles/use-global-styles-output.js +17 -5
  328. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  329. package/build/components/global-styles/utils.js +22 -0
  330. package/build/components/global-styles/utils.js.map +1 -1
  331. package/build/components/gradients/with-gradient.js +2 -2
  332. package/build/components/gradients/with-gradient.js.map +1 -1
  333. package/build/components/height-control/index.js +9 -8
  334. package/build/components/height-control/index.js.map +1 -1
  335. package/build/components/iframe/index.js +6 -5
  336. package/build/components/iframe/index.js.map +1 -1
  337. package/build/components/image-editor/aspect-ratio-dropdown.js +7 -7
  338. package/build/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
  339. package/build/components/image-editor/context.js +2 -1
  340. package/build/components/image-editor/context.js.map +1 -1
  341. package/build/components/image-editor/cropper.js +4 -4
  342. package/build/components/image-editor/cropper.js.map +1 -1
  343. package/build/components/image-editor/form-controls.js +3 -3
  344. package/build/components/image-editor/form-controls.js.map +1 -1
  345. package/build/components/image-editor/index.js +5 -5
  346. package/build/components/image-editor/index.js.map +1 -1
  347. package/build/components/image-editor/rotation-button.js +2 -2
  348. package/build/components/image-editor/rotation-button.js.map +1 -1
  349. package/build/components/image-editor/zoom-dropdown.js +4 -4
  350. package/build/components/image-editor/zoom-dropdown.js.map +1 -1
  351. package/build/components/image-size-control/index.js +9 -9
  352. package/build/components/image-size-control/index.js.map +1 -1
  353. package/build/components/index.js +1 -1
  354. package/build/components/index.js.map +1 -1
  355. package/build/components/inner-blocks/button-block-appender.js +2 -2
  356. package/build/components/inner-blocks/button-block-appender.js.map +1 -1
  357. package/build/components/inner-blocks/constants.native.js +13 -0
  358. package/build/components/inner-blocks/constants.native.js.map +1 -0
  359. package/build/components/inner-blocks/default-block-appender.js +2 -2
  360. package/build/components/inner-blocks/default-block-appender.js.map +1 -1
  361. package/build/components/inner-blocks/index.js +9 -8
  362. package/build/components/inner-blocks/index.js.map +1 -1
  363. package/build/components/inner-blocks/index.native.js +21 -8
  364. package/build/components/inner-blocks/index.native.js.map +1 -1
  365. package/build/components/inner-blocks/warning-max-depth-exceeded.native.js +95 -0
  366. package/build/components/inner-blocks/warning-max-depth-exceeded.native.js.map +1 -0
  367. package/build/components/inner-blocks/with-client-id.js +2 -2
  368. package/build/components/inner-blocks/with-client-id.js.map +1 -1
  369. package/build/components/inserter/block-patterns-explorer/explorer.js +7 -6
  370. package/build/components/inserter/block-patterns-explorer/explorer.js.map +1 -1
  371. package/build/components/inserter/block-patterns-explorer/patterns-list.js +6 -5
  372. package/build/components/inserter/block-patterns-explorer/patterns-list.js.map +1 -1
  373. package/build/components/inserter/block-patterns-explorer/sidebar.js +8 -8
  374. package/build/components/inserter/block-patterns-explorer/sidebar.js.map +1 -1
  375. package/build/components/inserter/block-patterns-filter.js +21 -19
  376. package/build/components/inserter/block-patterns-filter.js.map +1 -1
  377. package/build/components/inserter/block-patterns-tab.js +19 -18
  378. package/build/components/inserter/block-patterns-tab.js.map +1 -1
  379. package/build/components/inserter/block-types-tab.js +10 -9
  380. package/build/components/inserter/block-types-tab.js.map +1 -1
  381. package/build/components/inserter/block-types-tab.native.js +2 -1
  382. package/build/components/inserter/block-types-tab.native.js.map +1 -1
  383. package/build/components/inserter/index.js +9 -8
  384. package/build/components/inserter/index.js.map +1 -1
  385. package/build/components/inserter/index.native.js +11 -10
  386. package/build/components/inserter/index.native.js.map +1 -1
  387. package/build/components/inserter/library.js +3 -2
  388. package/build/components/inserter/library.js.map +1 -1
  389. package/build/components/inserter/media-tab/hooks.js +4 -33
  390. package/build/components/inserter/media-tab/hooks.js.map +1 -1
  391. package/build/components/inserter/media-tab/media-list.js +3 -3
  392. package/build/components/inserter/media-tab/media-list.js.map +1 -1
  393. package/build/components/inserter/media-tab/media-panel.js +7 -6
  394. package/build/components/inserter/media-tab/media-panel.js.map +1 -1
  395. package/build/components/inserter/media-tab/media-preview.js +18 -17
  396. package/build/components/inserter/media-tab/media-preview.js.map +1 -1
  397. package/build/components/inserter/media-tab/media-tab.js +12 -11
  398. package/build/components/inserter/media-tab/media-tab.js.map +1 -1
  399. package/build/components/inserter/media-tab/utils.js +2 -2
  400. package/build/components/inserter/media-tab/utils.js.map +1 -1
  401. package/build/components/inserter/menu.js +19 -18
  402. package/build/components/inserter/menu.js.map +1 -1
  403. package/build/components/inserter/menu.native.js +9 -8
  404. package/build/components/inserter/menu.native.js.map +1 -1
  405. package/build/components/inserter/mobile-tab-navigation.js +12 -12
  406. package/build/components/inserter/mobile-tab-navigation.js.map +1 -1
  407. package/build/components/inserter/no-results.js +4 -4
  408. package/build/components/inserter/no-results.js.map +1 -1
  409. package/build/components/inserter/no-results.native.js +4 -4
  410. package/build/components/inserter/no-results.native.js.map +1 -1
  411. package/build/components/inserter/panel.js +5 -5
  412. package/build/components/inserter/panel.js.map +1 -1
  413. package/build/components/inserter/preview-panel.js +8 -7
  414. package/build/components/inserter/preview-panel.js.map +1 -1
  415. package/build/components/inserter/quick-inserter.js +7 -6
  416. package/build/components/inserter/quick-inserter.js.map +1 -1
  417. package/build/components/inserter/reusable-block-rename-hint.js +5 -4
  418. package/build/components/inserter/reusable-block-rename-hint.js.map +1 -1
  419. package/build/components/inserter/reusable-blocks-tab.native.js +3 -2
  420. package/build/components/inserter/reusable-blocks-tab.native.js.map +1 -1
  421. package/build/components/inserter/search-results.js +11 -10
  422. package/build/components/inserter/search-results.js.map +1 -1
  423. package/build/components/inserter/search-results.native.js +4 -3
  424. package/build/components/inserter/search-results.native.js.map +1 -1
  425. package/build/components/inserter/tabs.js +2 -1
  426. package/build/components/inserter/tabs.js.map +1 -1
  427. package/build/components/inserter/tabs.native.js +7 -6
  428. package/build/components/inserter/tabs.native.js.map +1 -1
  429. package/build/components/inserter/tips.js +6 -5
  430. package/build/components/inserter/tips.js.map +1 -1
  431. package/build/components/inserter-draggable-blocks/index.js +3 -3
  432. package/build/components/inserter-draggable-blocks/index.js.map +1 -1
  433. package/build/components/inserter-list-item/index.js +9 -8
  434. package/build/components/inserter-list-item/index.js.map +1 -1
  435. package/build/components/inserter-listbox/group.js +2 -1
  436. package/build/components/inserter-listbox/group.js.map +1 -1
  437. package/build/components/inserter-listbox/index.js +2 -2
  438. package/build/components/inserter-listbox/index.js.map +1 -1
  439. package/build/components/inserter-listbox/item.js +5 -4
  440. package/build/components/inserter-listbox/item.js.map +1 -1
  441. package/build/components/inserter-listbox/row.js +2 -1
  442. package/build/components/inserter-listbox/row.js.map +1 -1
  443. package/build/components/inspector-controls/block-support-slot-container.js +3 -2
  444. package/build/components/inspector-controls/block-support-slot-container.js.map +1 -1
  445. package/build/components/inspector-controls/block-support-tools-panel.js +3 -2
  446. package/build/components/inspector-controls/block-support-tools-panel.js.map +1 -1
  447. package/build/components/inspector-controls/fill.js +7 -6
  448. package/build/components/inspector-controls/fill.js.map +1 -1
  449. package/build/components/inspector-controls/fill.native.js +4 -3
  450. package/build/components/inspector-controls/fill.native.js.map +1 -1
  451. package/build/components/inspector-controls/index.js +3 -3
  452. package/build/components/inspector-controls/index.js.map +1 -1
  453. package/build/components/inspector-controls/slot.js +5 -4
  454. package/build/components/inspector-controls/slot.js.map +1 -1
  455. package/build/components/inspector-controls/slot.native.js +2 -2
  456. package/build/components/inspector-controls/slot.native.js.map +1 -1
  457. package/build/components/inspector-controls-tabs/advanced-controls-panel.js +3 -3
  458. package/build/components/inspector-controls-tabs/advanced-controls-panel.js.map +1 -1
  459. package/build/components/inspector-controls-tabs/index.js +5 -5
  460. package/build/components/inspector-controls-tabs/index.js.map +1 -1
  461. package/build/components/inspector-controls-tabs/position-controls-panel.js +5 -4
  462. package/build/components/inspector-controls-tabs/position-controls-panel.js.map +1 -1
  463. package/build/components/inspector-controls-tabs/settings-tab-hint.js +5 -4
  464. package/build/components/inspector-controls-tabs/settings-tab-hint.js.map +1 -1
  465. package/build/components/inspector-controls-tabs/settings-tab.js +2 -2
  466. package/build/components/inspector-controls-tabs/settings-tab.js.map +1 -1
  467. package/build/components/inspector-controls-tabs/styles-tab.js +11 -11
  468. package/build/components/inspector-controls-tabs/styles-tab.js.map +1 -1
  469. package/build/components/inspector-popover-header/index.js +8 -8
  470. package/build/components/inspector-popover-header/index.js.map +1 -1
  471. package/build/components/justify-content-control/index.js +3 -3
  472. package/build/components/justify-content-control/index.js.map +1 -1
  473. package/build/components/justify-content-control/ui.js +2 -2
  474. package/build/components/justify-content-control/ui.js.map +1 -1
  475. package/build/components/letter-spacing-control/index.js +3 -3
  476. package/build/components/letter-spacing-control/index.js.map +1 -1
  477. package/build/components/line-height-control/index.js +3 -3
  478. package/build/components/line-height-control/index.js.map +1 -1
  479. package/build/components/line-height-control/index.native.js +2 -2
  480. package/build/components/line-height-control/index.native.js.map +1 -1
  481. package/build/components/link-control/index.js +18 -17
  482. package/build/components/link-control/index.js.map +1 -1
  483. package/build/components/link-control/link-preview.js +20 -20
  484. package/build/components/link-control/link-preview.js.map +1 -1
  485. package/build/components/link-control/search-create-button.js +4 -3
  486. package/build/components/link-control/search-create-button.js.map +1 -1
  487. package/build/components/link-control/search-input.js +5 -4
  488. package/build/components/link-control/search-input.js.map +1 -1
  489. package/build/components/link-control/search-item.js +41 -6
  490. package/build/components/link-control/search-item.js.map +1 -1
  491. package/build/components/link-control/search-results.js +7 -7
  492. package/build/components/link-control/search-results.js.map +1 -1
  493. package/build/components/link-control/settings-drawer.js +5 -4
  494. package/build/components/link-control/settings-drawer.js.map +1 -1
  495. package/build/components/link-control/settings.js +4 -4
  496. package/build/components/link-control/settings.js.map +1 -1
  497. package/build/components/list-view/appender.js +5 -4
  498. package/build/components/list-view/appender.js.map +1 -1
  499. package/build/components/list-view/aria-referenced-text.js +2 -1
  500. package/build/components/list-view/aria-referenced-text.js.map +1 -1
  501. package/build/components/list-view/block-contents.js +5 -4
  502. package/build/components/list-view/block-contents.js.map +1 -1
  503. package/build/components/list-view/block-select-button.js +16 -15
  504. package/build/components/list-view/block-select-button.js.map +1 -1
  505. package/build/components/list-view/block.js +15 -45
  506. package/build/components/list-view/block.js.map +1 -1
  507. package/build/components/list-view/branch.js +17 -9
  508. package/build/components/list-view/branch.js.map +1 -1
  509. package/build/components/list-view/drop-indicator.js +4 -3
  510. package/build/components/list-view/drop-indicator.js.map +1 -1
  511. package/build/components/list-view/expander.js +3 -3
  512. package/build/components/list-view/expander.js.map +1 -1
  513. package/build/components/list-view/index.js +16 -10
  514. package/build/components/list-view/index.js.map +1 -1
  515. package/build/components/list-view/leaf.js +3 -2
  516. package/build/components/list-view/leaf.js.map +1 -1
  517. package/build/components/list-view/utils.js +35 -0
  518. package/build/components/list-view/utils.js.map +1 -1
  519. package/build/components/media-placeholder/index.js +22 -21
  520. package/build/components/media-placeholder/index.js.map +1 -1
  521. package/build/components/media-placeholder/index.native.js +13 -12
  522. package/build/components/media-placeholder/index.native.js.map +1 -1
  523. package/build/components/media-replace-flow/index.js +14 -13
  524. package/build/components/media-replace-flow/index.js.map +1 -1
  525. package/build/components/media-replace-flow/index.native.js +2 -2
  526. package/build/components/media-replace-flow/index.native.js.map +1 -1
  527. package/build/components/media-upload/{constants.js → constants.native.js} +2 -4
  528. package/build/components/media-upload/constants.native.js.map +1 -0
  529. package/build/components/media-upload/index.js +1 -1
  530. package/build/components/media-upload/index.js.map +1 -1
  531. package/build/components/media-upload/index.native.js +12 -11
  532. package/build/components/media-upload/index.native.js.map +1 -1
  533. package/build/components/media-upload-progress/index.native.js +5 -4
  534. package/build/components/media-upload-progress/index.native.js.map +1 -1
  535. package/build/components/multi-selection-inspector/index.js +6 -6
  536. package/build/components/multi-selection-inspector/index.js.map +1 -1
  537. package/build/components/navigable-toolbar/index.js +4 -3
  538. package/build/components/navigable-toolbar/index.js.map +1 -1
  539. package/build/components/observe-typing/index.js +2 -2
  540. package/build/components/observe-typing/index.js.map +1 -1
  541. package/build/components/panel-color-settings/index.js +2 -2
  542. package/build/components/panel-color-settings/index.js.map +1 -1
  543. package/build/components/plain-text/index.js +4 -3
  544. package/build/components/plain-text/index.js.map +1 -1
  545. package/build/components/plain-text/index.native.js +4 -3
  546. package/build/components/plain-text/index.native.js.map +1 -1
  547. package/build/components/preview-options/index.js +5 -5
  548. package/build/components/preview-options/index.js.map +1 -1
  549. package/build/components/provider/block-refs-provider.js +2 -1
  550. package/build/components/provider/block-refs-provider.js.map +1 -1
  551. package/build/components/provider/index.js +4 -3
  552. package/build/components/provider/index.js.map +1 -1
  553. package/build/components/provider/index.native.js +3 -2
  554. package/build/components/provider/index.native.js.map +1 -1
  555. package/build/components/provider/use-block-sync.js +1 -1
  556. package/build/components/provider/use-block-sync.js.map +1 -1
  557. package/build/components/provider/with-registry-provider.js +4 -3
  558. package/build/components/provider/with-registry-provider.js.map +1 -1
  559. package/build/components/publish-date-time-picker/index.js +5 -4
  560. package/build/components/publish-date-time-picker/index.js.map +1 -1
  561. package/build/components/recursion-provider/index.js +2 -1
  562. package/build/components/recursion-provider/index.js.map +1 -1
  563. package/build/components/resizable-box-popover/index.js +3 -3
  564. package/build/components/resizable-box-popover/index.js.map +1 -1
  565. package/build/components/resolution-tool/index.js +3 -3
  566. package/build/components/resolution-tool/index.js.map +1 -1
  567. package/build/components/responsive-block-control/index.js +10 -9
  568. package/build/components/responsive-block-control/index.js.map +1 -1
  569. package/build/components/responsive-block-control/label.js +3 -3
  570. package/build/components/responsive-block-control/label.js.map +1 -1
  571. package/build/components/rich-text/content.js +3 -2
  572. package/build/components/rich-text/content.js.map +1 -1
  573. package/build/components/rich-text/embed-handler-picker.native.js +2 -1
  574. package/build/components/rich-text/embed-handler-picker.native.js.map +1 -1
  575. package/build/components/rich-text/format-edit.js +4 -3
  576. package/build/components/rich-text/format-edit.js.map +1 -1
  577. package/build/components/rich-text/format-toolbar/index.js +4 -4
  578. package/build/components/rich-text/format-toolbar/index.js.map +1 -1
  579. package/build/components/rich-text/format-toolbar/index.native.js +3 -3
  580. package/build/components/rich-text/format-toolbar/index.native.js.map +1 -1
  581. package/build/components/rich-text/format-toolbar-container.js +9 -9
  582. package/build/components/rich-text/format-toolbar-container.js.map +1 -1
  583. package/build/components/rich-text/format-toolbar-container.native.js +3 -3
  584. package/build/components/rich-text/format-toolbar-container.native.js.map +1 -1
  585. package/build/components/rich-text/get-rich-text-values.js +2 -1
  586. package/build/components/rich-text/get-rich-text-values.js.map +1 -1
  587. package/build/components/rich-text/index.js +9 -8
  588. package/build/components/rich-text/index.js.map +1 -1
  589. package/build/components/rich-text/index.native.js +8 -15
  590. package/build/components/rich-text/index.native.js.map +1 -1
  591. package/build/components/rich-text/multiline.js +3 -2
  592. package/build/components/rich-text/multiline.js.map +1 -1
  593. package/build/components/rich-text/toolbar-button.js +3 -3
  594. package/build/components/rich-text/toolbar-button.js.map +1 -1
  595. package/build/components/rich-text/use-paste-handler.js +5 -87
  596. package/build/components/rich-text/use-paste-handler.js.map +1 -1
  597. package/build/components/rich-text/utils.js +2 -5
  598. package/build/components/rich-text/utils.js.map +1 -1
  599. package/build/components/skip-to-selected-block/index.js +2 -2
  600. package/build/components/skip-to-selected-block/index.js.map +1 -1
  601. package/build/components/spacing-sizes-control/index.js +9 -8
  602. package/build/components/spacing-sizes-control/index.js.map +1 -1
  603. package/build/components/spacing-sizes-control/input-controls/axial.js +3 -3
  604. package/build/components/spacing-sizes-control/input-controls/axial.js.map +1 -1
  605. package/build/components/spacing-sizes-control/input-controls/separated.js +3 -3
  606. package/build/components/spacing-sizes-control/input-controls/separated.js.map +1 -1
  607. package/build/components/spacing-sizes-control/input-controls/single.js +2 -2
  608. package/build/components/spacing-sizes-control/input-controls/single.js.map +1 -1
  609. package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js +9 -8
  610. package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
  611. package/build/components/spacing-sizes-control/sides-dropdown/index.js +6 -6
  612. package/build/components/spacing-sizes-control/sides-dropdown/index.js.map +1 -1
  613. package/build/components/text-decoration-control/index.js +6 -6
  614. package/build/components/text-decoration-control/index.js.map +1 -1
  615. package/build/components/text-transform-control/index.js +6 -6
  616. package/build/components/text-transform-control/index.js.map +1 -1
  617. package/build/components/tool-selector/index.js +13 -11
  618. package/build/components/tool-selector/index.js.map +1 -1
  619. package/build/components/typewriter/index.js +3 -3
  620. package/build/components/typewriter/index.js.map +1 -1
  621. package/build/components/ungroup-button/index.native.js +2 -2
  622. package/build/components/ungroup-button/index.native.js.map +1 -1
  623. package/build/components/unit-control/index.js +2 -2
  624. package/build/components/unit-control/index.js.map +1 -1
  625. package/build/components/unsupported-block-details/index.native.js +127 -0
  626. package/build/components/unsupported-block-details/index.native.js.map +1 -0
  627. package/build/components/url-input/button.js +9 -8
  628. package/build/components/url-input/button.js.map +1 -1
  629. package/build/components/url-input/index.js +9 -8
  630. package/build/components/url-input/index.js.map +1 -1
  631. package/build/components/url-input/index.native.js +2 -2
  632. package/build/components/url-input/index.native.js.map +1 -1
  633. package/build/components/url-popover/image-url-input-ui.js +19 -18
  634. package/build/components/url-popover/image-url-input-ui.js.map +1 -1
  635. package/build/components/url-popover/index.js +8 -7
  636. package/build/components/url-popover/index.js.map +1 -1
  637. package/build/components/url-popover/link-editor.js +4 -4
  638. package/build/components/url-popover/link-editor.js.map +1 -1
  639. package/build/components/url-popover/link-viewer-url.js +3 -3
  640. package/build/components/url-popover/link-viewer-url.js.map +1 -1
  641. package/build/components/url-popover/link-viewer.js +4 -4
  642. package/build/components/url-popover/link-viewer.js.map +1 -1
  643. package/build/components/use-on-block-drop/index.js +2 -2
  644. package/build/components/use-on-block-drop/index.js.map +1 -1
  645. package/build/components/use-unsupported-block-editor/index.native.js +57 -0
  646. package/build/components/use-unsupported-block-editor/index.native.js.map +1 -0
  647. package/build/components/video-player/gridicon-play.native.js +3 -3
  648. package/build/components/video-player/gridicon-play.native.js.map +1 -1
  649. package/build/components/video-player/index.native.js +6 -5
  650. package/build/components/video-player/index.native.js.map +1 -1
  651. package/build/components/warning/index.js +10 -9
  652. package/build/components/warning/index.js.map +1 -1
  653. package/build/components/warning/index.native.js +6 -6
  654. package/build/components/warning/index.native.js.map +1 -1
  655. package/build/components/writing-flow/index.js +7 -5
  656. package/build/components/writing-flow/index.js.map +1 -1
  657. package/build/components/writing-flow/use-clipboard-handler.js +179 -0
  658. package/build/components/writing-flow/use-clipboard-handler.js.map +1 -0
  659. package/build/components/writing-flow/use-tab-nav.js +4 -3
  660. package/build/components/writing-flow/use-tab-nav.js.map +1 -1
  661. package/build/components/writing-mode-control/index.js +6 -6
  662. package/build/components/writing-mode-control/index.js.map +1 -1
  663. package/build/hooks/align.js +6 -6
  664. package/build/hooks/align.js.map +1 -1
  665. package/build/hooks/anchor.js +10 -9
  666. package/build/hooks/anchor.js.map +1 -1
  667. package/build/hooks/background.js +17 -16
  668. package/build/hooks/background.js.map +1 -1
  669. package/build/hooks/block-hooks.js +11 -10
  670. package/build/hooks/block-hooks.js.map +1 -1
  671. package/build/hooks/block-rename-ui.js +22 -18
  672. package/build/hooks/block-rename-ui.js.map +1 -1
  673. package/build/hooks/border.js +6 -5
  674. package/build/hooks/border.js.map +1 -1
  675. package/build/hooks/color.js +7 -6
  676. package/build/hooks/color.js.map +1 -1
  677. package/build/hooks/content-lock-ui.js +9 -8
  678. package/build/hooks/content-lock-ui.js.map +1 -1
  679. package/build/hooks/contrast-checker.js +2 -1
  680. package/build/hooks/contrast-checker.js.map +1 -1
  681. package/build/hooks/custom-class-name.js +7 -7
  682. package/build/hooks/custom-class-name.js.map +1 -1
  683. package/build/hooks/custom-fields.js +8 -8
  684. package/build/hooks/custom-fields.js.map +1 -1
  685. package/build/hooks/dimensions.js +5 -4
  686. package/build/hooks/dimensions.js.map +1 -1
  687. package/build/hooks/duotone.js +10 -9
  688. package/build/hooks/duotone.js.map +1 -1
  689. package/build/hooks/font-size.js +5 -5
  690. package/build/hooks/font-size.js.map +1 -1
  691. package/build/hooks/layout.js +14 -13
  692. package/build/hooks/layout.js.map +1 -1
  693. package/build/hooks/line-height.js +3 -3
  694. package/build/hooks/line-height.js.map +1 -1
  695. package/build/hooks/margin.js +3 -2
  696. package/build/hooks/margin.js.map +1 -1
  697. package/build/hooks/padding.js +3 -2
  698. package/build/hooks/padding.js.map +1 -1
  699. package/build/hooks/position.js +10 -9
  700. package/build/hooks/position.js.map +1 -1
  701. package/build/hooks/style.js +11 -10
  702. package/build/hooks/style.js.map +1 -1
  703. package/build/hooks/typography.js +4 -3
  704. package/build/hooks/typography.js.map +1 -1
  705. package/build/hooks/typography.native.js +4 -4
  706. package/build/hooks/typography.native.js.map +1 -1
  707. package/build/layouts/constrained.js +11 -11
  708. package/build/layouts/constrained.js.map +1 -1
  709. package/build/layouts/flex.js +18 -18
  710. package/build/layouts/flex.js.map +1 -1
  711. package/build/layouts/grid.js +10 -10
  712. package/build/layouts/grid.js.map +1 -1
  713. package/build/private-apis.js +2 -0
  714. package/build/private-apis.js.map +1 -1
  715. package/build/store/actions.js +8 -12
  716. package/build/store/actions.js.map +1 -1
  717. package/build/store/private-selectors.js +55 -1
  718. package/build/store/private-selectors.js.map +1 -1
  719. package/build/store/reducer.js +19 -1
  720. package/build/store/reducer.js.map +1 -1
  721. package/build/store/selectors.js +1 -1
  722. package/build/store/selectors.js.map +1 -1
  723. package/build/utils/pasting.js +46 -0
  724. package/build/utils/pasting.js.map +1 -1
  725. package/build/utils/transform-styles/transforms/wrap.js +5 -0
  726. package/build/utils/transform-styles/transforms/wrap.js.map +1 -1
  727. package/build/utils/use-notify-copy.js +53 -0
  728. package/build/utils/use-notify-copy.js.map +1 -0
  729. package/build-module/autocompleters/block.js +1 -1
  730. package/build-module/autocompleters/link.js +1 -1
  731. package/build-module/components/alignment-control/index.js +1 -1
  732. package/build-module/components/alignment-control/ui.js +1 -1
  733. package/build-module/components/autocomplete/index.js +1 -1
  734. package/build-module/components/block-actions/index.js +1 -1
  735. package/build-module/components/block-actions/index.js.map +1 -1
  736. package/build-module/components/block-alignment-control/index.js +1 -1
  737. package/build-module/components/block-alignment-control/ui.js +1 -1
  738. package/build-module/components/block-alignment-control/ui.native.js +1 -1
  739. package/build-module/components/block-alignment-matrix-control/index.js +1 -1
  740. package/build-module/components/block-breadcrumb/index.js +2 -2
  741. package/build-module/components/block-breadcrumb/index.js.map +1 -1
  742. package/build-module/components/block-canvas/index.js +7 -9
  743. package/build-module/components/block-canvas/index.js.map +1 -1
  744. package/build-module/components/block-caption/index.native.js +1 -1
  745. package/build-module/components/block-card/index.js +1 -1
  746. package/build-module/components/block-compare/block-view.js +1 -1
  747. package/build-module/components/block-compare/index.js +1 -1
  748. package/build-module/components/block-context/index.js +1 -1
  749. package/build-module/components/block-controls/fill.js +1 -1
  750. package/build-module/components/block-controls/index.js +1 -1
  751. package/build-module/components/block-controls/slot.js +1 -1
  752. package/build-module/components/block-controls/slot.native.js +1 -1
  753. package/build-module/components/block-draggable/draggable-chip.js +1 -1
  754. package/build-module/components/block-draggable/draggable-chip.native.js +1 -1
  755. package/build-module/components/block-draggable/dropping-insertion-point.native.js +1 -1
  756. package/build-module/components/block-draggable/index.js +1 -1
  757. package/build-module/components/block-draggable/index.native.js +1 -1
  758. package/build-module/components/block-edit/edit.js +1 -1
  759. package/build-module/components/block-edit/edit.native.js +1 -1
  760. package/build-module/components/block-edit/index.js +1 -1
  761. package/build-module/components/block-edit-visually-button/index.js +1 -1
  762. package/build-module/components/block-full-height-alignment-control/index.js +1 -1
  763. package/build-module/components/block-heading-level-dropdown/heading-level-icon.js +3 -3
  764. package/build-module/components/block-heading-level-dropdown/heading-level-icon.js.map +1 -1
  765. package/build-module/components/block-heading-level-dropdown/index.js +3 -3
  766. package/build-module/components/block-heading-level-dropdown/index.js.map +1 -1
  767. package/build-module/components/block-heading-level-dropdown/index.native.js +3 -3
  768. package/build-module/components/block-heading-level-dropdown/index.native.js.map +1 -1
  769. package/build-module/components/block-icon/index.js +1 -1
  770. package/build-module/components/block-icon/index.native.js +1 -1
  771. package/build-module/components/block-info-slot-fill/index.js +1 -1
  772. package/build-module/components/block-inspector/index.js +1 -1
  773. package/build-module/components/block-list/block-crash-warning.js +1 -1
  774. package/build-module/components/block-list/block-html.js +1 -1
  775. package/build-module/components/block-list/block-invalid-warning.js +1 -1
  776. package/build-module/components/block-list/block-invalid-warning.native.js +1 -1
  777. package/build-module/components/block-list/block-list-item-cell.native.js +1 -1
  778. package/build-module/components/block-list/block-list-item.native.js +3 -3
  779. package/build-module/components/block-list/block-list-item.native.js.map +1 -1
  780. package/build-module/components/block-list/block-outline.native.js +1 -1
  781. package/build-module/components/block-list/block-selection-button.native.js +1 -1
  782. package/build-module/components/block-list/block.js +1 -1
  783. package/build-module/components/block-list/block.native.js +1 -1
  784. package/build-module/components/block-list/grid-item.native.js +1 -1
  785. package/build-module/components/block-list/index.js +1 -1
  786. package/build-module/components/block-list/index.native.js +1 -1
  787. package/build-module/components/block-list/insertion-point.native.js +1 -1
  788. package/build-module/components/block-list/layout.js +1 -1
  789. package/build-module/components/block-list/subdirectory-icon.js +1 -1
  790. package/build-module/components/block-list-appender/index.js +1 -1
  791. package/build-module/components/block-list-appender/index.native.js +1 -1
  792. package/build-module/components/block-lock/menu-item.js +1 -1
  793. package/build-module/components/block-lock/modal.js +1 -1
  794. package/build-module/components/block-lock/toolbar.js +1 -1
  795. package/build-module/components/block-media-update-progress/index.native.js +1 -1
  796. package/build-module/components/block-mover/button.js +1 -1
  797. package/build-module/components/block-mover/index.js +1 -1
  798. package/build-module/components/block-mover/index.native.js +1 -1
  799. package/build-module/components/block-navigation/dropdown.js +1 -1
  800. package/build-module/components/block-parent-selector/index.js +2 -2
  801. package/build-module/components/block-parent-selector/index.js.map +1 -1
  802. package/build-module/components/block-pattern-setup/index.js +1 -1
  803. package/build-module/components/block-pattern-setup/setup-toolbar.js +1 -1
  804. package/build-module/components/block-patterns-list/index.js +1 -1
  805. package/build-module/components/block-patterns-paging/index.js +1 -1
  806. package/build-module/components/block-popover/drop-zone.js +1 -1
  807. package/build-module/components/block-popover/inbetween.js +1 -1
  808. package/build-module/components/block-popover/index.js +1 -1
  809. package/build-module/components/block-preview/auto.js +1 -1
  810. package/build-module/components/block-preview/index.js +2 -2
  811. package/build-module/components/block-preview/index.js.map +1 -1
  812. package/build-module/components/block-quick-navigation/index.js +1 -1
  813. package/build-module/components/block-removal-warning-modal/index.js +1 -1
  814. package/build-module/components/block-selection-clearer/index.js +1 -1
  815. package/build-module/components/block-settings/button.native.js +1 -1
  816. package/build-module/components/block-settings/container.native.js +1 -1
  817. package/build-module/components/block-settings-menu/block-html-convert-button.js +20 -17
  818. package/build-module/components/block-settings-menu/block-html-convert-button.js.map +1 -1
  819. package/build-module/components/block-settings-menu/block-mode-toggle.js +1 -1
  820. package/build-module/components/block-settings-menu/block-settings-dropdown.js +1 -1
  821. package/build-module/components/block-settings-menu/index.js +1 -1
  822. package/build-module/components/block-settings-menu-controls/index.js +2 -2
  823. package/build-module/components/block-settings-menu-controls/index.js.map +1 -1
  824. package/build-module/components/block-styles/index.js +1 -1
  825. package/build-module/components/block-styles/index.native.js +1 -1
  826. package/build-module/components/block-styles/menu-items.js +1 -1
  827. package/build-module/components/block-styles/preview-panel.js +1 -1
  828. package/build-module/components/block-styles/preview.native.js +1 -1
  829. package/build-module/components/block-switcher/block-styles-menu.js +1 -1
  830. package/build-module/components/block-switcher/block-transformations-menu.js +1 -1
  831. package/build-module/components/block-switcher/block-transformations-menu.native.js +1 -1
  832. package/build-module/components/block-switcher/block-variation-transformations.js +1 -1
  833. package/build-module/components/block-switcher/index.js +6 -6
  834. package/build-module/components/block-switcher/index.js.map +1 -1
  835. package/build-module/components/block-switcher/pattern-transformations-menu.js +1 -1
  836. package/build-module/components/block-switcher/preview-block-popover.js +1 -1
  837. package/build-module/components/block-toolbar/block-toolbar-menu.native.js +1 -1
  838. package/build-module/components/block-toolbar/index.js +1 -1
  839. package/build-module/components/block-toolbar/index.native.js +1 -1
  840. package/build-module/components/block-tools/back-compat.js +1 -1
  841. package/build-module/components/block-tools/block-contextual-toolbar.js +1 -1
  842. package/build-module/components/block-tools/block-selection-button.js +2 -2
  843. package/build-module/components/block-tools/block-selection-button.js.map +1 -1
  844. package/build-module/components/block-tools/index.js +1 -1
  845. package/build-module/components/block-tools/insertion-point.js +1 -1
  846. package/build-module/components/block-tools/selected-block-popover.js +1 -1
  847. package/build-module/components/block-tools/zoom-out-mode-inserters.js +1 -1
  848. package/build-module/components/block-types-list/index.js +1 -1
  849. package/build-module/components/block-types-list/index.native.js +1 -1
  850. package/build-module/components/block-variation-picker/index.js +1 -1
  851. package/build-module/components/block-variation-picker/index.native.js +1 -1
  852. package/build-module/components/block-variation-transforms/index.js +1 -1
  853. package/build-module/components/block-vertical-alignment-control/icons.js +1 -1
  854. package/build-module/components/block-vertical-alignment-control/index.js +1 -1
  855. package/build-module/components/block-vertical-alignment-control/ui.js +1 -1
  856. package/build-module/components/border-radius-control/all-input-control.js +1 -1
  857. package/build-module/components/border-radius-control/index.js +2 -2
  858. package/build-module/components/border-radius-control/index.js.map +1 -1
  859. package/build-module/components/border-radius-control/input-controls.js +1 -1
  860. package/build-module/components/border-radius-control/linked-button.js +1 -1
  861. package/build-module/components/button-block-appender/index.js +1 -1
  862. package/build-module/components/button-block-appender/index.native.js +1 -1
  863. package/build-module/components/caption/index.native.js +1 -1
  864. package/build-module/components/child-layout-control/index.js +2 -2
  865. package/build-module/components/child-layout-control/index.js.map +1 -1
  866. package/build-module/components/color-palette/control.js +1 -1
  867. package/build-module/components/color-palette/with-color-context.js +1 -1
  868. package/build-module/components/color-style-selector/index.js +1 -1
  869. package/build-module/components/colors/with-colors.js +2 -2
  870. package/build-module/components/colors/with-colors.js.map +1 -1
  871. package/build-module/components/colors-gradients/control.js +1 -1
  872. package/build-module/components/colors-gradients/dropdown.js +1 -1
  873. package/build-module/components/colors-gradients/panel-color-gradient-settings.js +1 -1
  874. package/build-module/components/colors-gradients/panel-color-gradient-settings.native.js +1 -1
  875. package/build-module/components/contrast-checker/index.js +1 -1
  876. package/build-module/components/contrast-checker/index.native.js +1 -1
  877. package/build-module/components/convert-to-group-buttons/index.js +1 -1
  878. package/build-module/components/convert-to-group-buttons/toolbar.js +1 -1
  879. package/build-module/components/copy-handler/index.js +25 -205
  880. package/build-module/components/copy-handler/index.js.map +1 -1
  881. package/build-module/components/date-format-picker/index.js +1 -1
  882. package/build-module/components/default-block-appender/index.js +1 -1
  883. package/build-module/components/default-block-appender/index.native.js +1 -1
  884. package/build-module/components/default-style-picker/index.js +1 -1
  885. package/build-module/components/dimensions-tool/aspect-ratio-tool.js +1 -1
  886. package/build-module/components/dimensions-tool/index.js +2 -2
  887. package/build-module/components/dimensions-tool/index.js.map +1 -1
  888. package/build-module/components/dimensions-tool/scale-tool.js +2 -2
  889. package/build-module/components/dimensions-tool/scale-tool.js.map +1 -1
  890. package/build-module/components/dimensions-tool/width-height-tool.js +3 -3
  891. package/build-module/components/dimensions-tool/width-height-tool.js.map +1 -1
  892. package/build-module/components/duotone-control/index.js +10 -2
  893. package/build-module/components/duotone-control/index.js.map +1 -1
  894. package/build-module/components/editable-text/index.js +1 -1
  895. package/build-module/components/editor-styles/index.js +1 -1
  896. package/build-module/components/floating-toolbar/index.native.js +1 -1
  897. package/build-module/components/floating-toolbar/nav-up-icon.js +1 -1
  898. package/build-module/components/font-appearance-control/index.js +2 -2
  899. package/build-module/components/font-appearance-control/index.js.map +1 -1
  900. package/build-module/components/font-family/index.js +1 -1
  901. package/build-module/components/font-sizes/font-size-picker.js +1 -1
  902. package/build-module/components/font-sizes/with-font-sizes.js +1 -1
  903. package/build-module/components/global-styles/advanced-panel.js +1 -1
  904. package/build-module/components/global-styles/border-panel.js +1 -1
  905. package/build-module/components/global-styles/color-panel.js +1 -1
  906. package/build-module/components/global-styles/color-panel.native.js +1 -1
  907. package/build-module/components/global-styles/dimensions-panel.js +1 -1
  908. package/build-module/components/global-styles/effects-panel.js +1 -1
  909. package/build-module/components/global-styles/filters-panel.js +1 -1
  910. package/build-module/components/global-styles/hooks.js +1 -1
  911. package/build-module/components/global-styles/hooks.js.map +1 -1
  912. package/build-module/components/global-styles/image-settings-panel.js +1 -1
  913. package/build-module/components/global-styles/typography-panel.js +1 -1
  914. package/build-module/components/global-styles/use-global-styles-output.js +17 -6
  915. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  916. package/build-module/components/global-styles/utils.js +21 -0
  917. package/build-module/components/global-styles/utils.js.map +1 -1
  918. package/build-module/components/gradients/with-gradient.js +1 -1
  919. package/build-module/components/height-control/index.js +2 -2
  920. package/build-module/components/height-control/index.js.map +1 -1
  921. package/build-module/components/iframe/index.js +1 -1
  922. package/build-module/components/image-editor/aspect-ratio-dropdown.js +1 -1
  923. package/build-module/components/image-editor/context.js +1 -1
  924. package/build-module/components/image-editor/cropper.js +1 -1
  925. package/build-module/components/image-editor/form-controls.js +1 -1
  926. package/build-module/components/image-editor/index.js +1 -1
  927. package/build-module/components/image-editor/rotation-button.js +1 -1
  928. package/build-module/components/image-editor/zoom-dropdown.js +1 -1
  929. package/build-module/components/image-size-control/index.js +1 -1
  930. package/build-module/components/index.js +1 -1
  931. package/build-module/components/index.js.map +1 -1
  932. package/build-module/components/inner-blocks/button-block-appender.js +1 -1
  933. package/build-module/components/inner-blocks/constants.native.js +6 -0
  934. package/build-module/components/inner-blocks/constants.native.js.map +1 -0
  935. package/build-module/components/inner-blocks/default-block-appender.js +1 -1
  936. package/build-module/components/inner-blocks/index.js +1 -1
  937. package/build-module/components/inner-blocks/index.native.js +13 -1
  938. package/build-module/components/inner-blocks/index.native.js.map +1 -1
  939. package/build-module/components/inner-blocks/warning-max-depth-exceeded.native.js +86 -0
  940. package/build-module/components/inner-blocks/warning-max-depth-exceeded.native.js.map +1 -0
  941. package/build-module/components/inner-blocks/with-client-id.js +1 -1
  942. package/build-module/components/inserter/block-patterns-explorer/explorer.js +1 -1
  943. package/build-module/components/inserter/block-patterns-explorer/patterns-list.js +1 -1
  944. package/build-module/components/inserter/block-patterns-explorer/sidebar.js +1 -1
  945. package/build-module/components/inserter/block-patterns-filter.js +14 -13
  946. package/build-module/components/inserter/block-patterns-filter.js.map +1 -1
  947. package/build-module/components/inserter/block-patterns-tab.js +2 -2
  948. package/build-module/components/inserter/block-patterns-tab.js.map +1 -1
  949. package/build-module/components/inserter/block-types-tab.js +1 -1
  950. package/build-module/components/inserter/block-types-tab.native.js +1 -1
  951. package/build-module/components/inserter/index.js +3 -3
  952. package/build-module/components/inserter/index.js.map +1 -1
  953. package/build-module/components/inserter/index.native.js +3 -3
  954. package/build-module/components/inserter/index.native.js.map +1 -1
  955. package/build-module/components/inserter/library.js +1 -1
  956. package/build-module/components/inserter/media-tab/hooks.js +5 -34
  957. package/build-module/components/inserter/media-tab/hooks.js.map +1 -1
  958. package/build-module/components/inserter/media-tab/media-list.js +1 -1
  959. package/build-module/components/inserter/media-tab/media-panel.js +1 -1
  960. package/build-module/components/inserter/media-tab/media-preview.js +1 -1
  961. package/build-module/components/inserter/media-tab/media-tab.js +1 -1
  962. package/build-module/components/inserter/media-tab/utils.js +1 -1
  963. package/build-module/components/inserter/menu.js +1 -1
  964. package/build-module/components/inserter/menu.native.js +1 -1
  965. package/build-module/components/inserter/mobile-tab-navigation.js +1 -1
  966. package/build-module/components/inserter/no-results.js +1 -1
  967. package/build-module/components/inserter/no-results.native.js +1 -1
  968. package/build-module/components/inserter/panel.js +1 -1
  969. package/build-module/components/inserter/preview-panel.js +1 -1
  970. package/build-module/components/inserter/quick-inserter.js +1 -1
  971. package/build-module/components/inserter/reusable-block-rename-hint.js +1 -1
  972. package/build-module/components/inserter/reusable-blocks-tab.native.js +1 -1
  973. package/build-module/components/inserter/search-results.js +1 -1
  974. package/build-module/components/inserter/search-results.native.js +1 -1
  975. package/build-module/components/inserter/tabs.js +1 -1
  976. package/build-module/components/inserter/tabs.native.js +1 -1
  977. package/build-module/components/inserter/tips.js +1 -1
  978. package/build-module/components/inserter-draggable-blocks/index.js +1 -1
  979. package/build-module/components/inserter-list-item/index.js +1 -1
  980. package/build-module/components/inserter-listbox/group.js +1 -1
  981. package/build-module/components/inserter-listbox/index.js +1 -1
  982. package/build-module/components/inserter-listbox/item.js +1 -1
  983. package/build-module/components/inserter-listbox/row.js +1 -1
  984. package/build-module/components/inspector-controls/block-support-slot-container.js +1 -1
  985. package/build-module/components/inspector-controls/block-support-tools-panel.js +1 -1
  986. package/build-module/components/inspector-controls/fill.js +1 -1
  987. package/build-module/components/inspector-controls/fill.native.js +1 -1
  988. package/build-module/components/inspector-controls/index.js +1 -1
  989. package/build-module/components/inspector-controls/slot.js +1 -1
  990. package/build-module/components/inspector-controls/slot.native.js +1 -1
  991. package/build-module/components/inspector-controls-tabs/advanced-controls-panel.js +1 -1
  992. package/build-module/components/inspector-controls-tabs/index.js +1 -1
  993. package/build-module/components/inspector-controls-tabs/position-controls-panel.js +1 -1
  994. package/build-module/components/inspector-controls-tabs/settings-tab-hint.js +1 -1
  995. package/build-module/components/inspector-controls-tabs/settings-tab.js +1 -1
  996. package/build-module/components/inspector-controls-tabs/styles-tab.js +1 -1
  997. package/build-module/components/inspector-popover-header/index.js +1 -1
  998. package/build-module/components/justify-content-control/index.js +1 -1
  999. package/build-module/components/justify-content-control/ui.js +1 -1
  1000. package/build-module/components/letter-spacing-control/index.js +2 -2
  1001. package/build-module/components/letter-spacing-control/index.js.map +1 -1
  1002. package/build-module/components/line-height-control/index.js +1 -1
  1003. package/build-module/components/line-height-control/index.native.js +1 -1
  1004. package/build-module/components/link-control/index.js +1 -1
  1005. package/build-module/components/link-control/link-preview.js +1 -1
  1006. package/build-module/components/link-control/search-create-button.js +1 -1
  1007. package/build-module/components/link-control/search-input.js +1 -1
  1008. package/build-module/components/link-control/search-item.js +38 -3
  1009. package/build-module/components/link-control/search-item.js.map +1 -1
  1010. package/build-module/components/link-control/search-results.js +1 -1
  1011. package/build-module/components/link-control/settings-drawer.js +1 -1
  1012. package/build-module/components/link-control/settings.js +1 -1
  1013. package/build-module/components/list-view/appender.js +1 -1
  1014. package/build-module/components/list-view/aria-referenced-text.js +1 -1
  1015. package/build-module/components/list-view/block-contents.js +1 -1
  1016. package/build-module/components/list-view/block-select-button.js +1 -1
  1017. package/build-module/components/list-view/block.js +4 -35
  1018. package/build-module/components/list-view/block.js.map +1 -1
  1019. package/build-module/components/list-view/branch.js +9 -2
  1020. package/build-module/components/list-view/branch.js.map +1 -1
  1021. package/build-module/components/list-view/drop-indicator.js +1 -1
  1022. package/build-module/components/list-view/expander.js +1 -1
  1023. package/build-module/components/list-view/index.js +9 -4
  1024. package/build-module/components/list-view/index.js.map +1 -1
  1025. package/build-module/components/list-view/leaf.js +1 -1
  1026. package/build-module/components/list-view/utils.js +34 -0
  1027. package/build-module/components/list-view/utils.js.map +1 -1
  1028. package/build-module/components/media-placeholder/index.js +1 -1
  1029. package/build-module/components/media-placeholder/index.native.js +1 -1
  1030. package/build-module/components/media-replace-flow/index.js +1 -1
  1031. package/build-module/components/media-replace-flow/index.native.js +1 -1
  1032. package/build-module/components/media-upload/{constants.js → constants.native.js} +1 -2
  1033. package/build-module/components/media-upload/constants.native.js.map +1 -0
  1034. package/build-module/components/media-upload/index.js +1 -1
  1035. package/build-module/components/media-upload/index.js.map +1 -1
  1036. package/build-module/components/media-upload/index.native.js +7 -7
  1037. package/build-module/components/media-upload/index.native.js.map +1 -1
  1038. package/build-module/components/media-upload-progress/index.native.js +1 -1
  1039. package/build-module/components/multi-selection-inspector/index.js +1 -1
  1040. package/build-module/components/navigable-toolbar/index.js +1 -1
  1041. package/build-module/components/observe-typing/index.js +1 -1
  1042. package/build-module/components/panel-color-settings/index.js +1 -1
  1043. package/build-module/components/plain-text/index.js +1 -1
  1044. package/build-module/components/plain-text/index.native.js +1 -1
  1045. package/build-module/components/preview-options/index.js +1 -1
  1046. package/build-module/components/provider/block-refs-provider.js +1 -1
  1047. package/build-module/components/provider/index.js +1 -1
  1048. package/build-module/components/provider/index.native.js +1 -1
  1049. package/build-module/components/provider/use-block-sync.js +1 -1
  1050. package/build-module/components/provider/use-block-sync.js.map +1 -1
  1051. package/build-module/components/provider/with-registry-provider.js +1 -1
  1052. package/build-module/components/publish-date-time-picker/index.js +1 -1
  1053. package/build-module/components/recursion-provider/index.js +1 -1
  1054. package/build-module/components/resizable-box-popover/index.js +1 -1
  1055. package/build-module/components/resolution-tool/index.js +1 -1
  1056. package/build-module/components/responsive-block-control/index.js +1 -1
  1057. package/build-module/components/responsive-block-control/label.js +1 -1
  1058. package/build-module/components/rich-text/content.js +1 -1
  1059. package/build-module/components/rich-text/embed-handler-picker.native.js +1 -1
  1060. package/build-module/components/rich-text/format-edit.js +1 -1
  1061. package/build-module/components/rich-text/format-toolbar/index.js +1 -1
  1062. package/build-module/components/rich-text/format-toolbar/index.native.js +1 -1
  1063. package/build-module/components/rich-text/format-toolbar-container.js +1 -1
  1064. package/build-module/components/rich-text/format-toolbar-container.native.js +1 -1
  1065. package/build-module/components/rich-text/get-rich-text-values.js +1 -1
  1066. package/build-module/components/rich-text/index.js +1 -1
  1067. package/build-module/components/rich-text/index.native.js +2 -10
  1068. package/build-module/components/rich-text/index.native.js.map +1 -1
  1069. package/build-module/components/rich-text/multiline.js +1 -1
  1070. package/build-module/components/rich-text/toolbar-button.js +1 -1
  1071. package/build-module/components/rich-text/use-paste-handler.js +7 -89
  1072. package/build-module/components/rich-text/use-paste-handler.js.map +1 -1
  1073. package/build-module/components/rich-text/utils.js +1 -3
  1074. package/build-module/components/rich-text/utils.js.map +1 -1
  1075. package/build-module/components/skip-to-selected-block/index.js +1 -1
  1076. package/build-module/components/spacing-sizes-control/index.js +1 -1
  1077. package/build-module/components/spacing-sizes-control/input-controls/axial.js +1 -1
  1078. package/build-module/components/spacing-sizes-control/input-controls/separated.js +1 -1
  1079. package/build-module/components/spacing-sizes-control/input-controls/single.js +1 -1
  1080. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js +1 -1
  1081. package/build-module/components/spacing-sizes-control/sides-dropdown/index.js +1 -1
  1082. package/build-module/components/text-decoration-control/index.js +2 -2
  1083. package/build-module/components/text-decoration-control/index.js.map +1 -1
  1084. package/build-module/components/text-transform-control/index.js +2 -2
  1085. package/build-module/components/text-transform-control/index.js.map +1 -1
  1086. package/build-module/components/tool-selector/index.js +3 -2
  1087. package/build-module/components/tool-selector/index.js.map +1 -1
  1088. package/build-module/components/typewriter/index.js +2 -2
  1089. package/build-module/components/typewriter/index.js.map +1 -1
  1090. package/build-module/components/ungroup-button/index.native.js +1 -1
  1091. package/build-module/components/unit-control/index.js +1 -1
  1092. package/build-module/components/unsupported-block-details/index.native.js +118 -0
  1093. package/build-module/components/unsupported-block-details/index.native.js.map +1 -0
  1094. package/build-module/components/url-input/button.js +1 -1
  1095. package/build-module/components/url-input/index.js +1 -1
  1096. package/build-module/components/url-input/index.native.js +1 -1
  1097. package/build-module/components/url-popover/image-url-input-ui.js +1 -1
  1098. package/build-module/components/url-popover/index.js +1 -1
  1099. package/build-module/components/url-popover/link-editor.js +1 -1
  1100. package/build-module/components/url-popover/link-viewer-url.js +1 -1
  1101. package/build-module/components/url-popover/link-viewer.js +1 -1
  1102. package/build-module/components/use-on-block-drop/index.js +2 -2
  1103. package/build-module/components/use-on-block-drop/index.js.map +1 -1
  1104. package/build-module/components/use-unsupported-block-editor/index.native.js +51 -0
  1105. package/build-module/components/use-unsupported-block-editor/index.native.js.map +1 -0
  1106. package/build-module/components/video-player/gridicon-play.native.js +1 -1
  1107. package/build-module/components/video-player/index.native.js +1 -1
  1108. package/build-module/components/warning/index.js +1 -1
  1109. package/build-module/components/warning/index.native.js +1 -1
  1110. package/build-module/components/writing-flow/index.js +5 -4
  1111. package/build-module/components/writing-flow/index.js.map +1 -1
  1112. package/build-module/components/writing-flow/use-clipboard-handler.js +172 -0
  1113. package/build-module/components/writing-flow/use-clipboard-handler.js.map +1 -0
  1114. package/build-module/components/writing-flow/use-tab-nav.js +1 -1
  1115. package/build-module/components/writing-mode-control/index.js +2 -2
  1116. package/build-module/components/writing-mode-control/index.js.map +1 -1
  1117. package/build-module/hooks/align.js +1 -1
  1118. package/build-module/hooks/anchor.js +3 -3
  1119. package/build-module/hooks/anchor.js.map +1 -1
  1120. package/build-module/hooks/background.js +1 -1
  1121. package/build-module/hooks/block-hooks.js +1 -1
  1122. package/build-module/hooks/block-rename-ui.js +6 -3
  1123. package/build-module/hooks/block-rename-ui.js.map +1 -1
  1124. package/build-module/hooks/border.js +1 -1
  1125. package/build-module/hooks/color.js +1 -1
  1126. package/build-module/hooks/content-lock-ui.js +1 -1
  1127. package/build-module/hooks/contrast-checker.js +1 -1
  1128. package/build-module/hooks/custom-class-name.js +3 -3
  1129. package/build-module/hooks/custom-class-name.js.map +1 -1
  1130. package/build-module/hooks/custom-fields.js +3 -3
  1131. package/build-module/hooks/custom-fields.js.map +1 -1
  1132. package/build-module/hooks/dimensions.js +1 -1
  1133. package/build-module/hooks/duotone.js +1 -1
  1134. package/build-module/hooks/font-size.js +2 -2
  1135. package/build-module/hooks/font-size.js.map +1 -1
  1136. package/build-module/hooks/layout.js +1 -1
  1137. package/build-module/hooks/line-height.js +2 -2
  1138. package/build-module/hooks/line-height.js.map +1 -1
  1139. package/build-module/hooks/margin.js +1 -1
  1140. package/build-module/hooks/padding.js +1 -1
  1141. package/build-module/hooks/position.js +3 -3
  1142. package/build-module/hooks/position.js.map +1 -1
  1143. package/build-module/hooks/style.js +1 -1
  1144. package/build-module/hooks/typography.js +1 -1
  1145. package/build-module/hooks/typography.native.js +1 -1
  1146. package/build-module/layouts/constrained.js +1 -1
  1147. package/build-module/layouts/flex.js +1 -1
  1148. package/build-module/layouts/grid.js +1 -1
  1149. package/build-module/private-apis.js +2 -0
  1150. package/build-module/private-apis.js.map +1 -1
  1151. package/build-module/store/actions.js +8 -12
  1152. package/build-module/store/actions.js.map +1 -1
  1153. package/build-module/store/private-selectors.js +52 -0
  1154. package/build-module/store/private-selectors.js.map +1 -1
  1155. package/build-module/store/reducer.js +18 -1
  1156. package/build-module/store/reducer.js.map +1 -1
  1157. package/build-module/store/selectors.js +1 -1
  1158. package/build-module/store/selectors.js.map +1 -1
  1159. package/build-module/utils/pasting.js +47 -0
  1160. package/build-module/utils/pasting.js.map +1 -1
  1161. package/build-module/utils/transform-styles/transforms/wrap.js +5 -0
  1162. package/build-module/utils/transform-styles/transforms/wrap.js.map +1 -1
  1163. package/build-module/utils/use-notify-copy.js +46 -0
  1164. package/build-module/utils/use-notify-copy.js.map +1 -0
  1165. package/build-style/content-rtl.css +10 -11
  1166. package/build-style/content.css +10 -11
  1167. package/build-style/default-editor-styles-rtl.css +1 -1
  1168. package/build-style/default-editor-styles.css +1 -1
  1169. package/build-style/style-rtl.css +11 -12
  1170. package/build-style/style.css +11 -12
  1171. package/package.json +31 -32
  1172. package/src/components/block-actions/index.js +1 -1
  1173. package/src/components/block-breadcrumb/index.js +1 -1
  1174. package/src/components/block-canvas/index.js +6 -12
  1175. package/src/components/block-context/README.md +1 -1
  1176. package/src/components/block-heading-level-dropdown/heading-level-icon.js +2 -2
  1177. package/src/components/block-heading-level-dropdown/index.js +2 -2
  1178. package/src/components/block-heading-level-dropdown/index.native.js +2 -2
  1179. package/src/components/block-list/block-list-item.native.js +2 -2
  1180. package/src/components/block-parent-selector/index.js +1 -1
  1181. package/src/components/block-preview/index.js +1 -1
  1182. package/src/components/block-settings-menu/block-html-convert-button.js +28 -19
  1183. package/src/components/block-settings-menu-controls/index.js +1 -1
  1184. package/src/components/block-switcher/index.js +17 -18
  1185. package/src/components/block-switcher/test/__snapshots__/index.js.snap +2 -2
  1186. package/src/components/block-tools/block-selection-button.js +1 -1
  1187. package/src/components/border-radius-control/index.js +1 -1
  1188. package/src/components/child-layout-control/index.js +1 -1
  1189. package/src/components/color-palette/test/__snapshots__/control.js.snap +1 -1
  1190. package/src/components/colors/with-colors.js +1 -1
  1191. package/src/components/copy-handler/README.md +2 -0
  1192. package/src/components/copy-handler/index.js +21 -291
  1193. package/src/components/dimensions-tool/index.js +1 -1
  1194. package/src/components/dimensions-tool/scale-tool.js +1 -1
  1195. package/src/components/dimensions-tool/width-height-tool.js +1 -1
  1196. package/src/components/duotone-control/index.js +14 -2
  1197. package/src/components/editable-text/README.md +2 -2
  1198. package/src/components/font-appearance-control/index.js +1 -1
  1199. package/src/components/font-family/README.md +1 -1
  1200. package/src/components/global-styles/hooks.js +1 -1
  1201. package/src/components/global-styles/test/use-global-styles-output.js +39 -0
  1202. package/src/components/global-styles/use-global-styles-output.js +26 -6
  1203. package/src/components/global-styles/utils.js +21 -0
  1204. package/src/components/height-control/README.md +1 -1
  1205. package/src/components/height-control/index.js +1 -1
  1206. package/src/components/image-size-control/README.md +2 -2
  1207. package/src/components/index.js +1 -1
  1208. package/src/components/inner-blocks/constants.native.js +5 -0
  1209. package/src/components/inner-blocks/index.native.js +15 -0
  1210. package/src/components/inner-blocks/warning-max-depth-exceeded.native.js +100 -0
  1211. package/src/components/inserter/block-patterns-filter.js +22 -10
  1212. package/src/components/inserter/block-patterns-tab.js +0 -3
  1213. package/src/components/inserter/index.js +2 -2
  1214. package/src/components/inserter/index.native.js +2 -2
  1215. package/src/components/inserter/media-tab/hooks.js +10 -44
  1216. package/src/components/inserter/style.scss +1 -1
  1217. package/src/components/letter-spacing-control/index.js +1 -1
  1218. package/src/components/link-control/search-item.js +55 -2
  1219. package/src/components/list-view/block.js +3 -43
  1220. package/src/components/list-view/branch.js +11 -1
  1221. package/src/components/list-view/index.js +8 -4
  1222. package/src/components/list-view/utils.js +37 -0
  1223. package/src/components/media-placeholder/README.md +3 -3
  1224. package/src/components/media-upload/{constants.js → constants.native.js} +0 -1
  1225. package/src/components/media-upload/index.js +1 -1
  1226. package/src/components/media-upload/index.native.js +9 -5
  1227. package/src/components/panel-color-settings/README.md +5 -1
  1228. package/src/components/plain-text/README.md +1 -1
  1229. package/src/components/provider/README.md +1 -1
  1230. package/src/components/provider/use-block-sync.js +1 -1
  1231. package/src/components/publish-date-time-picker/README.md +1 -1
  1232. package/src/components/responsive-block-control/README.md +1 -3
  1233. package/src/components/rich-text/README.md +3 -3
  1234. package/src/components/rich-text/index.native.js +0 -13
  1235. package/src/components/rich-text/use-paste-handler.js +5 -99
  1236. package/src/components/rich-text/utils.js +0 -3
  1237. package/src/components/text-decoration-control/index.js +1 -1
  1238. package/src/components/text-transform-control/index.js +1 -1
  1239. package/src/components/tool-selector/index.js +1 -1
  1240. package/src/components/typewriter/index.js +1 -1
  1241. package/src/components/unit-control/README.md +1 -1
  1242. package/src/components/unsupported-block-details/index.native.js +183 -0
  1243. package/src/components/unsupported-block-details/style.native.scss +56 -0
  1244. package/src/components/url-input/README.md +4 -4
  1245. package/src/components/use-on-block-drop/index.js +2 -2
  1246. package/src/components/use-unsupported-block-editor/index.native.js +59 -0
  1247. package/src/components/writing-flow/index.js +4 -2
  1248. package/src/components/writing-flow/use-clipboard-handler.js +242 -0
  1249. package/src/components/writing-mode-control/index.js +1 -1
  1250. package/src/hooks/anchor.js +2 -2
  1251. package/src/hooks/block-rename-ui.js +14 -10
  1252. package/src/hooks/custom-class-name.js +2 -2
  1253. package/src/hooks/custom-fields.js +2 -2
  1254. package/src/hooks/font-size.js +1 -1
  1255. package/src/hooks/line-height.js +1 -1
  1256. package/src/hooks/position.js +2 -2
  1257. package/src/private-apis.js +2 -0
  1258. package/src/store/actions.js +7 -11
  1259. package/src/store/private-selectors.js +72 -0
  1260. package/src/store/reducer.js +17 -0
  1261. package/src/store/selectors.js +1 -1
  1262. package/src/store/test/actions.js +10 -16
  1263. package/src/utils/pasting.js +51 -0
  1264. package/src/utils/transform-styles/transforms/test/__snapshots__/wrap.js.snap +13 -6
  1265. package/src/utils/transform-styles/transforms/test/wrap.js +9 -0
  1266. package/src/utils/transform-styles/transforms/wrap.js +5 -0
  1267. package/src/utils/use-notify-copy.js +63 -0
  1268. package/tsconfig.tsbuildinfo +1 -1
  1269. package/build/components/block-settings-menu/block-convert-button.js +0 -27
  1270. package/build/components/block-settings-menu/block-convert-button.js.map +0 -1
  1271. package/build/components/media-upload/constants.js.map +0 -1
  1272. package/build-module/components/block-settings-menu/block-convert-button.js +0 -20
  1273. package/build-module/components/block-settings-menu/block-convert-button.js.map +0 -1
  1274. package/build-module/components/media-upload/constants.js.map +0 -1
  1275. package/src/components/block-settings-menu/block-convert-button.js +0 -14
@@ -1 +1 @@
1
- {"version":3,"names":["_blocks","require","_data","_element","_styleEngine","_utils","_getBlockCssSelector","_typographyUtils","_context","_hooks","_utils2","_gap","_store","_definitions","_object","_blockContext","_interopRequireDefault","BLOCK_SUPPORT_FEATURE_LEVEL_SELECTORS","__experimentalBorder","color","spacing","typography","compileStyleValue","uncompiledValue","VARIABLE_REFERENCE_PREFIX","VARIABLE_PATH_SEPARATOR_TOKEN_ATTRIBUTE","VARIABLE_PATH_SEPARATOR_TOKEN_STYLE","startsWith","variable","slice","length","split","join","getPresetsDeclarations","blockPresets","mergedSettings","PRESET_METADATA","reduce","declarations","path","valueKey","valueFunc","cssVarInfix","presetByOrigin","getValueFromObjectPath","forEach","origin","value","push","kebabCase","slug","getPresetsClasses","blockSelector","classes","classSuffix","propertyName","classSelectorToUse","selectorToUse","map","selector","getPresetsSvgFilters","filter","metadata","at","flatMap","preset","getDuotoneFilter","colors","flattenTree","input","prefix","token","result","Object","keys","key","newKey","replace","newLeaf","newPrefix","concatFeatureVariationSelectorString","featureSelector","styleVariationSelector","featureSelectors","combinedSelectors","trim","getFeatureDeclarations","selectors","styles","entries","feature","isShorthand","subfeature","subfeatureSelector","subfeatureStyles","newDeclarations","getStylesDeclarations","root","featureStyles","blockStyles","useRootPaddingAlign","tree","isTemplate","isRoot","ROOT_BLOCK_SELECTOR","output","STYLE_PROPERTY","properties","useEngine","rootOnly","pathToValue","styleValue","entry","name","prop","cssProperty","extraRules","getCSSRules","rule","ruleValue","ref","refPath","getTypographyFontSizeValue","size","getFluidTypographyOptionsFromSettings","settings","getLayoutStyles","layoutDefinitions","LAYOUT_DEFINITIONS","style","hasBlockGapSupport","hasFallbackGapSupport","fallbackGapValue","ruleset","gapValue","getGapCSSValue","blockGap","values","className","spacingStyles","spacingStyle","rules","cssValue","combinedSelector","validDisplayModes","displayMode","baseStyles","includes","baseStyle","STYLE_KEYS","pickStyleKeys","treeToPickFrom","pickedEntries","clonedEntries","JSON","parse","stringify","fromEntries","getNodesWithStyles","blockSelectors","_tree$styles$blocks","nodes","ELEMENTS","elements","blocks","blockName","node","_node$elements","variations","variation","duotoneSelector","hasLayoutSupport","styleVariationSelectors","elementName","sel","elementSelectors","elementSelector","exports","getNodesWithSettings","_tree$settings$blocks","pickPresets","presets","setImmutably","custom","blockCustom","toCustomProperties","customProps","toStyles","disableLayoutStyles","nodesWithStyles","nodesWithSettings","useRootPaddingAwareAlignments","contentSize","wideSize","layout","featureDeclarations","cssSelector","styleVariationName","styleVariations","baseSelector","styleVariationDeclarations","duotoneStyles","duotoneDeclarations","pseudoSelectorStyles","pseudoKey","pseudoStyle","pseudoDeclarations","_selector","pseudoRule","toSvgFilters","getSelectorsConfig","blockType","rootSelector","config","featureKey","featureName","getBlockCSSSelector","getBlockSelectors","blockTypes","getBlockStyles","duotoneSupport","getBlockSupport","scopeSelector","supports","__experimentalLayout","__experimentalDefault","blockStyleVariations","undefined","updateConfigWithSeparator","needsSeparatorStyleUpdate","background","text","border","processCSSNesting","css","processedCSS","parts","part","useGlobalStylesOutputWithConfig","mergedConfig","useGlobalSetting","useSelect","select","getSettings","blockEditorStore","blockContext","useContext","BlockContext","templateSlug","blocksStore","useMemo","_mergedConfig$styles$","getBlockTypes","customProperties","globalStyles","svgs","isGlobalStyles","assets","__unstableType","useGlobalStylesOutput","merged","GlobalStylesContext"],"sources":["@wordpress/block-editor/src/components/global-styles/use-global-styles-output.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__EXPERIMENTAL_STYLE_PROPERTY as STYLE_PROPERTY,\n\t__EXPERIMENTAL_ELEMENTS as ELEMENTS,\n\tgetBlockSupport,\n\tgetBlockTypes,\n\tstore as blocksStore,\n} from '@wordpress/blocks';\nimport { useSelect } from '@wordpress/data';\nimport { useContext, useMemo } from '@wordpress/element';\nimport { getCSSRules } from '@wordpress/style-engine';\n\n/**\n * Internal dependencies\n */\nimport { PRESET_METADATA, ROOT_BLOCK_SELECTOR, scopeSelector } from './utils';\nimport { getBlockCSSSelector } from './get-block-css-selector';\nimport {\n\tgetTypographyFontSizeValue,\n\tgetFluidTypographyOptionsFromSettings,\n} from './typography-utils';\nimport { GlobalStylesContext } from './context';\nimport { useGlobalSetting } from './hooks';\nimport { getDuotoneFilter } from '../duotone/utils';\nimport { getGapCSSValue } from '../../hooks/gap';\nimport { store as blockEditorStore } from '../../store';\nimport { LAYOUT_DEFINITIONS } from '../../layouts/definitions';\nimport {\n\tgetValueFromObjectPath,\n\tkebabCase,\n\tsetImmutably,\n} from '../../utils/object';\nimport BlockContext from '../block-context';\n\n// List of block support features that can have their related styles\n// generated under their own feature level selector rather than the block's.\nconst BLOCK_SUPPORT_FEATURE_LEVEL_SELECTORS = {\n\t__experimentalBorder: 'border',\n\tcolor: 'color',\n\tspacing: 'spacing',\n\ttypography: 'typography',\n};\n\nfunction compileStyleValue( uncompiledValue ) {\n\tconst VARIABLE_REFERENCE_PREFIX = 'var:';\n\tconst VARIABLE_PATH_SEPARATOR_TOKEN_ATTRIBUTE = '|';\n\tconst VARIABLE_PATH_SEPARATOR_TOKEN_STYLE = '--';\n\n\tif ( uncompiledValue?.startsWith?.( VARIABLE_REFERENCE_PREFIX ) ) {\n\t\tconst variable = uncompiledValue\n\t\t\t.slice( VARIABLE_REFERENCE_PREFIX.length )\n\t\t\t.split( VARIABLE_PATH_SEPARATOR_TOKEN_ATTRIBUTE )\n\t\t\t.join( VARIABLE_PATH_SEPARATOR_TOKEN_STYLE );\n\t\treturn `var(--wp--${ variable })`;\n\t}\n\treturn uncompiledValue;\n}\n\n/**\n * Transform given preset tree into a set of style declarations.\n *\n * @param {Object} blockPresets\n * @param {Object} mergedSettings Merged theme.json settings.\n *\n * @return {Array<Object>} An array of style declarations.\n */\nfunction getPresetsDeclarations( blockPresets = {}, mergedSettings ) {\n\treturn PRESET_METADATA.reduce(\n\t\t( declarations, { path, valueKey, valueFunc, cssVarInfix } ) => {\n\t\t\tconst presetByOrigin = getValueFromObjectPath(\n\t\t\t\tblockPresets,\n\t\t\t\tpath,\n\t\t\t\t[]\n\t\t\t);\n\t\t\t[ 'default', 'theme', 'custom' ].forEach( ( origin ) => {\n\t\t\t\tif ( presetByOrigin[ origin ] ) {\n\t\t\t\t\tpresetByOrigin[ origin ].forEach( ( value ) => {\n\t\t\t\t\t\tif ( valueKey && ! valueFunc ) {\n\t\t\t\t\t\t\tdeclarations.push(\n\t\t\t\t\t\t\t\t`--wp--preset--${ cssVarInfix }--${ kebabCase(\n\t\t\t\t\t\t\t\t\tvalue.slug\n\t\t\t\t\t\t\t\t) }: ${ value[ valueKey ] }`\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else if (\n\t\t\t\t\t\t\tvalueFunc &&\n\t\t\t\t\t\t\ttypeof valueFunc === 'function'\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tdeclarations.push(\n\t\t\t\t\t\t\t\t`--wp--preset--${ cssVarInfix }--${ kebabCase(\n\t\t\t\t\t\t\t\t\tvalue.slug\n\t\t\t\t\t\t\t\t) }: ${ valueFunc( value, mergedSettings ) }`\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\treturn declarations;\n\t\t},\n\t\t[]\n\t);\n}\n\n/**\n * Transform given preset tree into a set of preset class declarations.\n *\n * @param {?string} blockSelector\n * @param {Object} blockPresets\n * @return {string} CSS declarations for the preset classes.\n */\nfunction getPresetsClasses( blockSelector = '*', blockPresets = {} ) {\n\treturn PRESET_METADATA.reduce(\n\t\t( declarations, { path, cssVarInfix, classes } ) => {\n\t\t\tif ( ! classes ) {\n\t\t\t\treturn declarations;\n\t\t\t}\n\n\t\t\tconst presetByOrigin = getValueFromObjectPath(\n\t\t\t\tblockPresets,\n\t\t\t\tpath,\n\t\t\t\t[]\n\t\t\t);\n\t\t\t[ 'default', 'theme', 'custom' ].forEach( ( origin ) => {\n\t\t\t\tif ( presetByOrigin[ origin ] ) {\n\t\t\t\t\tpresetByOrigin[ origin ].forEach( ( { slug } ) => {\n\t\t\t\t\t\tclasses.forEach( ( { classSuffix, propertyName } ) => {\n\t\t\t\t\t\t\tconst classSelectorToUse = `.has-${ kebabCase(\n\t\t\t\t\t\t\t\tslug\n\t\t\t\t\t\t\t) }-${ classSuffix }`;\n\t\t\t\t\t\t\tconst selectorToUse = blockSelector\n\t\t\t\t\t\t\t\t.split( ',' ) // Selector can be \"h1, h2, h3\"\n\t\t\t\t\t\t\t\t.map(\n\t\t\t\t\t\t\t\t\t( selector ) =>\n\t\t\t\t\t\t\t\t\t\t`${ selector }${ classSelectorToUse }`\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t.join( ',' );\n\t\t\t\t\t\t\tconst value = `var(--wp--preset--${ cssVarInfix }--${ kebabCase(\n\t\t\t\t\t\t\t\tslug\n\t\t\t\t\t\t\t) })`;\n\t\t\t\t\t\t\tdeclarations += `${ selectorToUse }{${ propertyName }: ${ value } !important;}`;\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\treturn declarations;\n\t\t},\n\t\t''\n\t);\n}\n\nfunction getPresetsSvgFilters( blockPresets = {} ) {\n\treturn PRESET_METADATA.filter(\n\t\t// Duotone are the only type of filters for now.\n\t\t( metadata ) => metadata.path.at( -1 ) === 'duotone'\n\t).flatMap( ( metadata ) => {\n\t\tconst presetByOrigin = getValueFromObjectPath(\n\t\t\tblockPresets,\n\t\t\tmetadata.path,\n\t\t\t{}\n\t\t);\n\t\treturn [ 'default', 'theme' ]\n\t\t\t.filter( ( origin ) => presetByOrigin[ origin ] )\n\t\t\t.flatMap( ( origin ) =>\n\t\t\t\tpresetByOrigin[ origin ].map( ( preset ) =>\n\t\t\t\t\tgetDuotoneFilter(\n\t\t\t\t\t\t`wp-duotone-${ preset.slug }`,\n\t\t\t\t\t\tpreset.colors\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t)\n\t\t\t.join( '' );\n\t} );\n}\n\nfunction flattenTree( input = {}, prefix, token ) {\n\tlet result = [];\n\tObject.keys( input ).forEach( ( key ) => {\n\t\tconst newKey = prefix + kebabCase( key.replace( '/', '-' ) );\n\t\tconst newLeaf = input[ key ];\n\n\t\tif ( newLeaf instanceof Object ) {\n\t\t\tconst newPrefix = newKey + token;\n\t\t\tresult = [ ...result, ...flattenTree( newLeaf, newPrefix, token ) ];\n\t\t} else {\n\t\t\tresult.push( `${ newKey }: ${ newLeaf }` );\n\t\t}\n\t} );\n\treturn result;\n}\n\n/**\n * Gets variation selector string from feature selector.\n *\n * @param {string} featureSelector The feature selector.\n *\n * @param {string} styleVariationSelector The style variation selector.\n * @return {string} Combined selector string.\n */\nfunction concatFeatureVariationSelectorString(\n\tfeatureSelector,\n\tstyleVariationSelector\n) {\n\tconst featureSelectors = featureSelector.split( ',' );\n\tconst combinedSelectors = [];\n\tfeatureSelectors.forEach( ( selector ) => {\n\t\tcombinedSelectors.push(\n\t\t\t`${ styleVariationSelector.trim() }${ selector.trim() }`\n\t\t);\n\t} );\n\treturn combinedSelectors.join( ', ' );\n}\n\n/**\n * Generate style declarations for a block's custom feature and subfeature\n * selectors.\n *\n * NOTE: The passed `styles` object will be mutated by this function.\n *\n * @param {Object} selectors Custom selectors object for a block.\n * @param {Object} styles A block's styles object.\n *\n * @return {Object} Style declarations.\n */\nconst getFeatureDeclarations = ( selectors, styles ) => {\n\tconst declarations = {};\n\n\tObject.entries( selectors ).forEach( ( [ feature, selector ] ) => {\n\t\t// We're only processing features/subfeatures that have styles.\n\t\tif ( feature === 'root' || ! styles?.[ feature ] ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst isShorthand = typeof selector === 'string';\n\n\t\t// If we have a selector object instead of shorthand process it.\n\t\tif ( ! isShorthand ) {\n\t\t\tObject.entries( selector ).forEach(\n\t\t\t\t( [ subfeature, subfeatureSelector ] ) => {\n\t\t\t\t\t// Don't process root feature selector yet or any\n\t\t\t\t\t// subfeature that doesn't have a style.\n\t\t\t\t\tif (\n\t\t\t\t\t\tsubfeature === 'root' ||\n\t\t\t\t\t\t! styles?.[ feature ][ subfeature ]\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Create a temporary styles object and build\n\t\t\t\t\t// declarations for subfeature.\n\t\t\t\t\tconst subfeatureStyles = {\n\t\t\t\t\t\t[ feature ]: {\n\t\t\t\t\t\t\t[ subfeature ]: styles[ feature ][ subfeature ],\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\t\tconst newDeclarations =\n\t\t\t\t\t\tgetStylesDeclarations( subfeatureStyles );\n\n\t\t\t\t\t// Merge new declarations in with any others that\n\t\t\t\t\t// share the same selector.\n\t\t\t\t\tdeclarations[ subfeatureSelector ] = [\n\t\t\t\t\t\t...( declarations[ subfeatureSelector ] || [] ),\n\t\t\t\t\t\t...newDeclarations,\n\t\t\t\t\t];\n\n\t\t\t\t\t// Remove the subfeature's style now it will be\n\t\t\t\t\t// included under its own selector not the block's.\n\t\t\t\t\tdelete styles[ feature ][ subfeature ];\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\n\t\t// Now subfeatures have been processed and removed, we can\n\t\t// process root, or shorthand, feature selectors.\n\t\tif ( isShorthand || selector.root ) {\n\t\t\tconst featureSelector = isShorthand ? selector : selector.root;\n\n\t\t\t// Create temporary style object and build declarations for feature.\n\t\t\tconst featureStyles = { [ feature ]: styles[ feature ] };\n\t\t\tconst newDeclarations = getStylesDeclarations( featureStyles );\n\n\t\t\t// Merge new declarations with any others that share the selector.\n\t\t\tdeclarations[ featureSelector ] = [\n\t\t\t\t...( declarations[ featureSelector ] || [] ),\n\t\t\t\t...newDeclarations,\n\t\t\t];\n\n\t\t\t// Remove the feature from the block's styles now as it will be\n\t\t\t// included under its own selector not the block's.\n\t\t\tdelete styles[ feature ];\n\t\t}\n\t} );\n\n\treturn declarations;\n};\n\n/**\n * Transform given style tree into a set of style declarations.\n *\n * @param {Object} blockStyles Block styles.\n *\n * @param {string} selector The selector these declarations should attach to.\n *\n * @param {boolean} useRootPaddingAlign Whether to use CSS custom properties in root selector.\n *\n * @param {Object} tree A theme.json tree containing layout definitions.\n *\n * @param {boolean} isTemplate Whether the entity being edited is a full template or a pattern.\n * @return {Array} An array of style declarations.\n */\nexport function getStylesDeclarations(\n\tblockStyles = {},\n\tselector = '',\n\tuseRootPaddingAlign,\n\ttree = {},\n\tisTemplate = true\n) {\n\tconst isRoot = ROOT_BLOCK_SELECTOR === selector;\n\tconst output = Object.entries( STYLE_PROPERTY ).reduce(\n\t\t(\n\t\t\tdeclarations,\n\t\t\t[ key, { value, properties, useEngine, rootOnly } ]\n\t\t) => {\n\t\t\tif ( rootOnly && ! isRoot ) {\n\t\t\t\treturn declarations;\n\t\t\t}\n\t\t\tconst pathToValue = value;\n\t\t\tif ( pathToValue[ 0 ] === 'elements' || useEngine ) {\n\t\t\t\treturn declarations;\n\t\t\t}\n\n\t\t\tconst styleValue = getValueFromObjectPath(\n\t\t\t\tblockStyles,\n\t\t\t\tpathToValue\n\t\t\t);\n\n\t\t\t// Root-level padding styles don't currently support strings with CSS shorthand values.\n\t\t\t// This may change: https://github.com/WordPress/gutenberg/issues/40132.\n\t\t\tif (\n\t\t\t\tkey === '--wp--style--root--padding' &&\n\t\t\t\t( typeof styleValue === 'string' || ! useRootPaddingAlign )\n\t\t\t) {\n\t\t\t\treturn declarations;\n\t\t\t}\n\n\t\t\tif ( properties && typeof styleValue !== 'string' ) {\n\t\t\t\tObject.entries( properties ).forEach( ( entry ) => {\n\t\t\t\t\tconst [ name, prop ] = entry;\n\n\t\t\t\t\tif (\n\t\t\t\t\t\t! getValueFromObjectPath( styleValue, [ prop ], false )\n\t\t\t\t\t) {\n\t\t\t\t\t\t// Do not create a declaration\n\t\t\t\t\t\t// for sub-properties that don't have any value.\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst cssProperty = name.startsWith( '--' )\n\t\t\t\t\t\t? name\n\t\t\t\t\t\t: kebabCase( name );\n\t\t\t\t\tdeclarations.push(\n\t\t\t\t\t\t`${ cssProperty }: ${ compileStyleValue(\n\t\t\t\t\t\t\tgetValueFromObjectPath( styleValue, [ prop ] )\n\t\t\t\t\t\t) }`\n\t\t\t\t\t);\n\t\t\t\t} );\n\t\t\t} else if (\n\t\t\t\tgetValueFromObjectPath( blockStyles, pathToValue, false )\n\t\t\t) {\n\t\t\t\tconst cssProperty = key.startsWith( '--' )\n\t\t\t\t\t? key\n\t\t\t\t\t: kebabCase( key );\n\t\t\t\tdeclarations.push(\n\t\t\t\t\t`${ cssProperty }: ${ compileStyleValue(\n\t\t\t\t\t\tgetValueFromObjectPath( blockStyles, pathToValue )\n\t\t\t\t\t) }`\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn declarations;\n\t\t},\n\t\t[]\n\t);\n\n\t// The goal is to move everything to server side generated engine styles\n\t// This is temporary as we absorb more and more styles into the engine.\n\tconst extraRules = getCSSRules( blockStyles );\n\textraRules.forEach( ( rule ) => {\n\t\t// Don't output padding properties if padding variables are set or if we're not editing a full template.\n\t\tif (\n\t\t\tisRoot &&\n\t\t\t( useRootPaddingAlign || ! isTemplate ) &&\n\t\t\trule.key.startsWith( 'padding' )\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t\tconst cssProperty = rule.key.startsWith( '--' )\n\t\t\t? rule.key\n\t\t\t: kebabCase( rule.key );\n\n\t\tlet ruleValue = rule.value;\n\t\tif ( typeof ruleValue !== 'string' && ruleValue?.ref ) {\n\t\t\tconst refPath = ruleValue.ref.split( '.' );\n\t\t\truleValue = getValueFromObjectPath( tree, refPath );\n\t\t\t// Presence of another ref indicates a reference to another dynamic value.\n\t\t\t// Pointing to another dynamic value is not supported.\n\t\t\tif ( ! ruleValue || ruleValue?.ref ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t// Calculate fluid typography rules where available.\n\t\tif ( cssProperty === 'font-size' ) {\n\t\t\t/*\n\t\t\t * getTypographyFontSizeValue() will check\n\t\t\t * if fluid typography has been activated and also\n\t\t\t * whether the incoming value can be converted to a fluid value.\n\t\t\t * Values that already have a \"clamp()\" function will not pass the test,\n\t\t\t * and therefore the original $value will be returned.\n\t\t\t */\n\t\t\truleValue = getTypographyFontSizeValue(\n\t\t\t\t{ size: ruleValue },\n\t\t\t\tgetFluidTypographyOptionsFromSettings( tree?.settings )\n\t\t\t);\n\t\t}\n\n\t\toutput.push( `${ cssProperty }: ${ ruleValue }` );\n\t} );\n\n\treturn output;\n}\n\n/**\n * Get generated CSS for layout styles by looking up layout definitions provided\n * in theme.json, and outputting common layout styles, and specific blockGap values.\n *\n * @param {Object} props\n * @param {Object} props.layoutDefinitions Layout definitions, keyed by layout type.\n * @param {Object} props.style A style object containing spacing values.\n * @param {string} props.selector Selector used to group together layout styling rules.\n * @param {boolean} props.hasBlockGapSupport Whether or not the theme opts-in to blockGap support.\n * @param {boolean} props.hasFallbackGapSupport Whether or not the theme allows fallback gap styles.\n * @param {?string} props.fallbackGapValue An optional fallback gap value if no real gap value is available.\n * @return {string} Generated CSS rules for the layout styles.\n */\nexport function getLayoutStyles( {\n\tlayoutDefinitions = LAYOUT_DEFINITIONS,\n\tstyle,\n\tselector,\n\thasBlockGapSupport,\n\thasFallbackGapSupport,\n\tfallbackGapValue,\n} ) {\n\tlet ruleset = '';\n\tlet gapValue = hasBlockGapSupport\n\t\t? getGapCSSValue( style?.spacing?.blockGap )\n\t\t: '';\n\n\t// Ensure a fallback gap value for the root layout definitions,\n\t// and use a fallback value if one is provided for the current block.\n\tif ( hasFallbackGapSupport ) {\n\t\tif ( selector === ROOT_BLOCK_SELECTOR ) {\n\t\t\tgapValue = ! gapValue ? '0.5em' : gapValue;\n\t\t} else if ( ! hasBlockGapSupport && fallbackGapValue ) {\n\t\t\tgapValue = fallbackGapValue;\n\t\t}\n\t}\n\n\tif ( gapValue && layoutDefinitions ) {\n\t\tObject.values( layoutDefinitions ).forEach(\n\t\t\t( { className, name, spacingStyles } ) => {\n\t\t\t\t// Allow outputting fallback gap styles for flex layout type when block gap support isn't available.\n\t\t\t\tif (\n\t\t\t\t\t! hasBlockGapSupport &&\n\t\t\t\t\t'flex' !== name &&\n\t\t\t\t\t'grid' !== name\n\t\t\t\t) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ( spacingStyles?.length ) {\n\t\t\t\t\tspacingStyles.forEach( ( spacingStyle ) => {\n\t\t\t\t\t\tconst declarations = [];\n\n\t\t\t\t\t\tif ( spacingStyle.rules ) {\n\t\t\t\t\t\t\tObject.entries( spacingStyle.rules ).forEach(\n\t\t\t\t\t\t\t\t( [ cssProperty, cssValue ] ) => {\n\t\t\t\t\t\t\t\t\tdeclarations.push(\n\t\t\t\t\t\t\t\t\t\t`${ cssProperty }: ${\n\t\t\t\t\t\t\t\t\t\t\tcssValue ? cssValue : gapValue\n\t\t\t\t\t\t\t\t\t\t}`\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( declarations.length ) {\n\t\t\t\t\t\t\tlet combinedSelector = '';\n\n\t\t\t\t\t\t\tif ( ! hasBlockGapSupport ) {\n\t\t\t\t\t\t\t\t// For fallback gap styles, use lower specificity, to ensure styles do not unintentionally override theme styles.\n\t\t\t\t\t\t\t\tcombinedSelector =\n\t\t\t\t\t\t\t\t\tselector === ROOT_BLOCK_SELECTOR\n\t\t\t\t\t\t\t\t\t\t? `:where(.${ className }${\n\t\t\t\t\t\t\t\t\t\t\t\tspacingStyle?.selector || ''\n\t\t\t\t\t\t\t\t\t\t })`\n\t\t\t\t\t\t\t\t\t\t: `:where(${ selector }.${ className }${\n\t\t\t\t\t\t\t\t\t\t\t\tspacingStyle?.selector || ''\n\t\t\t\t\t\t\t\t\t\t })`;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tcombinedSelector =\n\t\t\t\t\t\t\t\t\tselector === ROOT_BLOCK_SELECTOR\n\t\t\t\t\t\t\t\t\t\t? `:where(${ selector } .${ className })${\n\t\t\t\t\t\t\t\t\t\t\t\tspacingStyle?.selector || ''\n\t\t\t\t\t\t\t\t\t\t }`\n\t\t\t\t\t\t\t\t\t\t: `${ selector }-${ className }${\n\t\t\t\t\t\t\t\t\t\t\t\tspacingStyle?.selector || ''\n\t\t\t\t\t\t\t\t\t\t }`;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\truleset += `${ combinedSelector } { ${ declarations.join(\n\t\t\t\t\t\t\t\t'; '\n\t\t\t\t\t\t\t) }; }`;\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\t// For backwards compatibility, ensure the legacy block gap CSS variable is still available.\n\t\tif ( selector === ROOT_BLOCK_SELECTOR && hasBlockGapSupport ) {\n\t\t\truleset += `${ selector } { --wp--style--block-gap: ${ gapValue }; }`;\n\t\t}\n\t}\n\n\t// Output base styles\n\tif ( selector === ROOT_BLOCK_SELECTOR && layoutDefinitions ) {\n\t\tconst validDisplayModes = [ 'block', 'flex', 'grid' ];\n\t\tObject.values( layoutDefinitions ).forEach(\n\t\t\t( { className, displayMode, baseStyles } ) => {\n\t\t\t\tif (\n\t\t\t\t\tdisplayMode &&\n\t\t\t\t\tvalidDisplayModes.includes( displayMode )\n\t\t\t\t) {\n\t\t\t\t\truleset += `${ selector } .${ className } { display:${ displayMode }; }`;\n\t\t\t\t}\n\n\t\t\t\tif ( baseStyles?.length ) {\n\t\t\t\t\tbaseStyles.forEach( ( baseStyle ) => {\n\t\t\t\t\t\tconst declarations = [];\n\n\t\t\t\t\t\tif ( baseStyle.rules ) {\n\t\t\t\t\t\t\tObject.entries( baseStyle.rules ).forEach(\n\t\t\t\t\t\t\t\t( [ cssProperty, cssValue ] ) => {\n\t\t\t\t\t\t\t\t\tdeclarations.push(\n\t\t\t\t\t\t\t\t\t\t`${ cssProperty }: ${ cssValue }`\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( declarations.length ) {\n\t\t\t\t\t\t\tconst combinedSelector = `${ selector } .${ className }${\n\t\t\t\t\t\t\t\tbaseStyle?.selector || ''\n\t\t\t\t\t\t\t}`;\n\t\t\t\t\t\t\truleset += `${ combinedSelector } { ${ declarations.join(\n\t\t\t\t\t\t\t\t'; '\n\t\t\t\t\t\t\t) }; }`;\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\n\treturn ruleset;\n}\n\nconst STYLE_KEYS = [\n\t'border',\n\t'color',\n\t'dimensions',\n\t'spacing',\n\t'typography',\n\t'filter',\n\t'outline',\n\t'shadow',\n];\n\nfunction pickStyleKeys( treeToPickFrom ) {\n\tif ( ! treeToPickFrom ) {\n\t\treturn {};\n\t}\n\tconst entries = Object.entries( treeToPickFrom );\n\tconst pickedEntries = entries.filter( ( [ key ] ) =>\n\t\tSTYLE_KEYS.includes( key )\n\t);\n\t// clone the style objects so that `getFeatureDeclarations` can remove consumed keys from it\n\tconst clonedEntries = pickedEntries.map( ( [ key, style ] ) => [\n\t\tkey,\n\t\tJSON.parse( JSON.stringify( style ) ),\n\t] );\n\treturn Object.fromEntries( clonedEntries );\n}\n\nexport const getNodesWithStyles = ( tree, blockSelectors ) => {\n\tconst nodes = [];\n\n\tif ( ! tree?.styles ) {\n\t\treturn nodes;\n\t}\n\n\t// Top-level.\n\tconst styles = pickStyleKeys( tree.styles );\n\tif ( styles ) {\n\t\tnodes.push( {\n\t\t\tstyles,\n\t\t\tselector: ROOT_BLOCK_SELECTOR,\n\t\t} );\n\t}\n\n\tObject.entries( ELEMENTS ).forEach( ( [ name, selector ] ) => {\n\t\tif ( tree.styles?.elements?.[ name ] ) {\n\t\t\tnodes.push( {\n\t\t\t\tstyles: tree.styles?.elements?.[ name ],\n\t\t\t\tselector,\n\t\t\t} );\n\t\t}\n\t} );\n\n\t// Iterate over blocks: they can have styles & elements.\n\tObject.entries( tree.styles?.blocks ?? {} ).forEach(\n\t\t( [ blockName, node ] ) => {\n\t\t\tconst blockStyles = pickStyleKeys( node );\n\n\t\t\tif ( node?.variations ) {\n\t\t\t\tconst variations = {};\n\t\t\t\tObject.keys( node.variations ).forEach( ( variation ) => {\n\t\t\t\t\tvariations[ variation ] = pickStyleKeys(\n\t\t\t\t\t\tnode.variations[ variation ]\n\t\t\t\t\t);\n\t\t\t\t} );\n\t\t\t\tblockStyles.variations = variations;\n\t\t\t}\n\t\t\tif ( blockStyles && blockSelectors?.[ blockName ]?.selector ) {\n\t\t\t\tnodes.push( {\n\t\t\t\t\tduotoneSelector:\n\t\t\t\t\t\tblockSelectors[ blockName ].duotoneSelector,\n\t\t\t\t\tfallbackGapValue:\n\t\t\t\t\t\tblockSelectors[ blockName ].fallbackGapValue,\n\t\t\t\t\thasLayoutSupport:\n\t\t\t\t\t\tblockSelectors[ blockName ].hasLayoutSupport,\n\t\t\t\t\tselector: blockSelectors[ blockName ].selector,\n\t\t\t\t\tstyles: blockStyles,\n\t\t\t\t\tfeatureSelectors:\n\t\t\t\t\t\tblockSelectors[ blockName ].featureSelectors,\n\t\t\t\t\tstyleVariationSelectors:\n\t\t\t\t\t\tblockSelectors[ blockName ].styleVariationSelectors,\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\tObject.entries( node?.elements ?? {} ).forEach(\n\t\t\t\t( [ elementName, value ] ) => {\n\t\t\t\t\tif (\n\t\t\t\t\t\tvalue &&\n\t\t\t\t\t\tblockSelectors?.[ blockName ] &&\n\t\t\t\t\t\tELEMENTS[ elementName ]\n\t\t\t\t\t) {\n\t\t\t\t\t\tnodes.push( {\n\t\t\t\t\t\t\tstyles: value,\n\t\t\t\t\t\t\tselector: blockSelectors[ blockName ]?.selector\n\t\t\t\t\t\t\t\t.split( ',' )\n\t\t\t\t\t\t\t\t.map( ( sel ) => {\n\t\t\t\t\t\t\t\t\tconst elementSelectors =\n\t\t\t\t\t\t\t\t\t\tELEMENTS[ elementName ].split( ',' );\n\t\t\t\t\t\t\t\t\treturn elementSelectors.map(\n\t\t\t\t\t\t\t\t\t\t( elementSelector ) =>\n\t\t\t\t\t\t\t\t\t\t\tsel + ' ' + elementSelector\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t.join( ',' ),\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\n\treturn nodes;\n};\n\nexport const getNodesWithSettings = ( tree, blockSelectors ) => {\n\tconst nodes = [];\n\n\tif ( ! tree?.settings ) {\n\t\treturn nodes;\n\t}\n\n\tconst pickPresets = ( treeToPickFrom ) => {\n\t\tlet presets = {};\n\t\tPRESET_METADATA.forEach( ( { path } ) => {\n\t\t\tconst value = getValueFromObjectPath( treeToPickFrom, path, false );\n\t\t\tif ( value !== false ) {\n\t\t\t\tpresets = setImmutably( presets, path, value );\n\t\t\t}\n\t\t} );\n\t\treturn presets;\n\t};\n\n\t// Top-level.\n\tconst presets = pickPresets( tree.settings );\n\tconst custom = tree.settings?.custom;\n\tif ( Object.keys( presets ).length > 0 || custom ) {\n\t\tnodes.push( {\n\t\t\tpresets,\n\t\t\tcustom,\n\t\t\tselector: ROOT_BLOCK_SELECTOR,\n\t\t} );\n\t}\n\n\t// Blocks.\n\tObject.entries( tree.settings?.blocks ?? {} ).forEach(\n\t\t( [ blockName, node ] ) => {\n\t\t\tconst blockPresets = pickPresets( node );\n\t\t\tconst blockCustom = node.custom;\n\t\t\tif ( Object.keys( blockPresets ).length > 0 || blockCustom ) {\n\t\t\t\tnodes.push( {\n\t\t\t\t\tpresets: blockPresets,\n\t\t\t\t\tcustom: blockCustom,\n\t\t\t\t\tselector: blockSelectors[ blockName ]?.selector,\n\t\t\t\t} );\n\t\t\t}\n\t\t}\n\t);\n\n\treturn nodes;\n};\n\nexport const toCustomProperties = ( tree, blockSelectors ) => {\n\tconst settings = getNodesWithSettings( tree, blockSelectors );\n\tlet ruleset = '';\n\tsettings.forEach( ( { presets, custom, selector } ) => {\n\t\tconst declarations = getPresetsDeclarations( presets, tree?.settings );\n\t\tconst customProps = flattenTree( custom, '--wp--custom--', '--' );\n\t\tif ( customProps.length > 0 ) {\n\t\t\tdeclarations.push( ...customProps );\n\t\t}\n\n\t\tif ( declarations.length > 0 ) {\n\t\t\truleset += `${ selector }{${ declarations.join( ';' ) };}`;\n\t\t}\n\t} );\n\n\treturn ruleset;\n};\n\nexport const toStyles = (\n\ttree,\n\tblockSelectors,\n\thasBlockGapSupport,\n\thasFallbackGapSupport,\n\tdisableLayoutStyles = false,\n\tisTemplate = true\n) => {\n\tconst nodesWithStyles = getNodesWithStyles( tree, blockSelectors );\n\tconst nodesWithSettings = getNodesWithSettings( tree, blockSelectors );\n\tconst useRootPaddingAlign = tree?.settings?.useRootPaddingAwareAlignments;\n\tconst { contentSize, wideSize } = tree?.settings?.layout || {};\n\n\t/*\n\t * Reset default browser margin on the root body element.\n\t * This is set on the root selector **before** generating the ruleset\n\t * from the `theme.json`. This is to ensure that if the `theme.json` declares\n\t * `margin` in its `spacing` declaration for the `body` element then these\n\t * user-generated values take precedence in the CSS cascade.\n\t * @link https://github.com/WordPress/gutenberg/issues/36147.\n\t */\n\tlet ruleset = 'body {margin: 0;';\n\n\tif ( contentSize ) {\n\t\truleset += ` --wp--style--global--content-size: ${ contentSize };`;\n\t}\n\n\tif ( wideSize ) {\n\t\truleset += ` --wp--style--global--wide-size: ${ wideSize };`;\n\t}\n\n\t// Root padding styles should only be output for full templates, not patterns or template parts.\n\tif ( useRootPaddingAlign && isTemplate ) {\n\t\t/*\n\t\t * These rules reproduce the ones from https://github.com/WordPress/gutenberg/blob/79103f124925d1f457f627e154f52a56228ed5ad/lib/class-wp-theme-json-gutenberg.php#L2508\n\t\t * almost exactly, but for the selectors that target block wrappers in the front end. This code only runs in the editor, so it doesn't need those selectors.\n\t\t */\n\t\truleset += `padding-right: 0; padding-left: 0; padding-top: var(--wp--style--root--padding-top); padding-bottom: var(--wp--style--root--padding-bottom) }\n\t\t\t.has-global-padding { padding-right: var(--wp--style--root--padding-right); padding-left: var(--wp--style--root--padding-left); }\n\t\t\t.has-global-padding :where(.has-global-padding:not(.wp-block-block)) { padding-right: 0; padding-left: 0; }\n\t\t\t.has-global-padding > .alignfull { margin-right: calc(var(--wp--style--root--padding-right) * -1); margin-left: calc(var(--wp--style--root--padding-left) * -1); }\n\t\t\t.has-global-padding :where(.has-global-padding:not(.wp-block-block)) > .alignfull { margin-right: 0; margin-left: 0; }\n\t\t\t.has-global-padding > .alignfull:where(:not(.has-global-padding):not(.is-layout-flex):not(.is-layout-grid)) > :where(.wp-block:not(.alignfull),p,h1,h2,h3,h4,h5,h6,ul,ol) { padding-right: var(--wp--style--root--padding-right); padding-left: var(--wp--style--root--padding-left); }\n\t\t\t.has-global-padding :where(.has-global-padding) > .alignfull:where(:not(.has-global-padding)) > :where(.wp-block:not(.alignfull),p,h1,h2,h3,h4,h5,h6,ul,ol) { padding-right: 0; padding-left: 0;`;\n\t}\n\n\truleset += '}';\n\n\tnodesWithStyles.forEach(\n\t\t( {\n\t\t\tselector,\n\t\t\tduotoneSelector,\n\t\t\tstyles,\n\t\t\tfallbackGapValue,\n\t\t\thasLayoutSupport,\n\t\t\tfeatureSelectors,\n\t\t\tstyleVariationSelectors,\n\t\t} ) => {\n\t\t\t// Process styles for block support features with custom feature level\n\t\t\t// CSS selectors set.\n\t\t\tif ( featureSelectors ) {\n\t\t\t\tconst featureDeclarations = getFeatureDeclarations(\n\t\t\t\t\tfeatureSelectors,\n\t\t\t\t\tstyles\n\t\t\t\t);\n\n\t\t\t\tObject.entries( featureDeclarations ).forEach(\n\t\t\t\t\t( [ cssSelector, declarations ] ) => {\n\t\t\t\t\t\tif ( declarations.length ) {\n\t\t\t\t\t\t\tconst rules = declarations.join( ';' );\n\t\t\t\t\t\t\truleset += `${ cssSelector }{${ rules };}`;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif ( styleVariationSelectors ) {\n\t\t\t\tObject.entries( styleVariationSelectors ).forEach(\n\t\t\t\t\t( [ styleVariationName, styleVariationSelector ] ) => {\n\t\t\t\t\t\tconst styleVariations =\n\t\t\t\t\t\t\tstyles?.variations?.[ styleVariationName ];\n\t\t\t\t\t\tif ( styleVariations ) {\n\t\t\t\t\t\t\t// If the block uses any custom selectors for block support, add those first.\n\t\t\t\t\t\t\tif ( featureSelectors ) {\n\t\t\t\t\t\t\t\tconst featureDeclarations =\n\t\t\t\t\t\t\t\t\tgetFeatureDeclarations(\n\t\t\t\t\t\t\t\t\t\tfeatureSelectors,\n\t\t\t\t\t\t\t\t\t\tstyleVariations\n\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\tObject.entries( featureDeclarations ).forEach(\n\t\t\t\t\t\t\t\t\t( [ baseSelector, declarations ] ) => {\n\t\t\t\t\t\t\t\t\t\tif ( declarations.length ) {\n\t\t\t\t\t\t\t\t\t\t\tconst cssSelector =\n\t\t\t\t\t\t\t\t\t\t\t\tconcatFeatureVariationSelectorString(\n\t\t\t\t\t\t\t\t\t\t\t\t\tbaseSelector,\n\t\t\t\t\t\t\t\t\t\t\t\t\tstyleVariationSelector\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\tconst rules =\n\t\t\t\t\t\t\t\t\t\t\t\tdeclarations.join( ';' );\n\t\t\t\t\t\t\t\t\t\t\truleset += `${ cssSelector }{${ rules };}`;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Otherwise add regular selectors.\n\t\t\t\t\t\t\tconst styleVariationDeclarations =\n\t\t\t\t\t\t\t\tgetStylesDeclarations(\n\t\t\t\t\t\t\t\t\tstyleVariations,\n\t\t\t\t\t\t\t\t\tstyleVariationSelector,\n\t\t\t\t\t\t\t\t\tuseRootPaddingAlign,\n\t\t\t\t\t\t\t\t\ttree\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tif ( styleVariationDeclarations.length ) {\n\t\t\t\t\t\t\t\truleset += `${ styleVariationSelector }{${ styleVariationDeclarations.join(\n\t\t\t\t\t\t\t\t\t';'\n\t\t\t\t\t\t\t\t) };}`;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Process duotone styles.\n\t\t\tif ( duotoneSelector ) {\n\t\t\t\tconst duotoneStyles = {};\n\t\t\t\tif ( styles?.filter ) {\n\t\t\t\t\tduotoneStyles.filter = styles.filter;\n\t\t\t\t\tdelete styles.filter;\n\t\t\t\t}\n\t\t\t\tconst duotoneDeclarations =\n\t\t\t\t\tgetStylesDeclarations( duotoneStyles );\n\t\t\t\tif ( duotoneDeclarations.length ) {\n\t\t\t\t\truleset += `${ duotoneSelector }{${ duotoneDeclarations.join(\n\t\t\t\t\t\t';'\n\t\t\t\t\t) };}`;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Process blockGap and layout styles.\n\t\t\tif (\n\t\t\t\t! disableLayoutStyles &&\n\t\t\t\t( ROOT_BLOCK_SELECTOR === selector || hasLayoutSupport )\n\t\t\t) {\n\t\t\t\truleset += getLayoutStyles( {\n\t\t\t\t\tstyle: styles,\n\t\t\t\t\tselector,\n\t\t\t\t\thasBlockGapSupport,\n\t\t\t\t\thasFallbackGapSupport,\n\t\t\t\t\tfallbackGapValue,\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\t// Process the remaining block styles (they use either normal block class or __experimentalSelector).\n\t\t\tconst declarations = getStylesDeclarations(\n\t\t\t\tstyles,\n\t\t\t\tselector,\n\t\t\t\tuseRootPaddingAlign,\n\t\t\t\ttree,\n\t\t\t\tisTemplate\n\t\t\t);\n\t\t\tif ( declarations?.length ) {\n\t\t\t\truleset += `${ selector }{${ declarations.join( ';' ) };}`;\n\t\t\t}\n\n\t\t\t// Check for pseudo selector in `styles` and handle separately.\n\t\t\tconst pseudoSelectorStyles = Object.entries( styles ).filter(\n\t\t\t\t( [ key ] ) => key.startsWith( ':' )\n\t\t\t);\n\n\t\t\tif ( pseudoSelectorStyles?.length ) {\n\t\t\t\tpseudoSelectorStyles.forEach(\n\t\t\t\t\t( [ pseudoKey, pseudoStyle ] ) => {\n\t\t\t\t\t\tconst pseudoDeclarations =\n\t\t\t\t\t\t\tgetStylesDeclarations( pseudoStyle );\n\n\t\t\t\t\t\tif ( ! pseudoDeclarations?.length ) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// `selector` maybe provided in a form\n\t\t\t\t\t\t// where block level selectors have sub element\n\t\t\t\t\t\t// selectors appended to them as a comma separated\n\t\t\t\t\t\t// string.\n\t\t\t\t\t\t// e.g. `h1 a,h2 a,h3 a,h4 a,h5 a,h6 a`;\n\t\t\t\t\t\t// Split and append pseudo selector to create\n\t\t\t\t\t\t// the proper rules to target the elements.\n\t\t\t\t\t\tconst _selector = selector\n\t\t\t\t\t\t\t.split( ',' )\n\t\t\t\t\t\t\t.map( ( sel ) => sel + pseudoKey )\n\t\t\t\t\t\t\t.join( ',' );\n\n\t\t\t\t\t\tconst pseudoRule = `${ _selector }{${ pseudoDeclarations.join(\n\t\t\t\t\t\t\t';'\n\t\t\t\t\t\t) };}`;\n\n\t\t\t\t\t\truleset += pseudoRule;\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t);\n\n\t/* Add alignment / layout styles */\n\truleset =\n\t\truleset +\n\t\t'.wp-site-blocks > .alignleft { float: left; margin-right: 2em; }';\n\truleset =\n\t\truleset +\n\t\t'.wp-site-blocks > .alignright { float: right; margin-left: 2em; }';\n\truleset =\n\t\truleset +\n\t\t'.wp-site-blocks > .aligncenter { justify-content: center; margin-left: auto; margin-right: auto; }';\n\n\tif ( hasBlockGapSupport ) {\n\t\t// Use fallback of `0.5em` just in case, however if there is blockGap support, there should nearly always be a real value.\n\t\tconst gapValue =\n\t\t\tgetGapCSSValue( tree?.styles?.spacing?.blockGap ) || '0.5em';\n\t\truleset =\n\t\t\truleset +\n\t\t\t`:where(.wp-site-blocks) > * { margin-block-start: ${ gapValue }; margin-block-end: 0; }`;\n\t\truleset =\n\t\t\truleset +\n\t\t\t':where(.wp-site-blocks) > :first-child:first-child { margin-block-start: 0; }';\n\t\truleset =\n\t\t\truleset +\n\t\t\t':where(.wp-site-blocks) > :last-child:last-child { margin-block-end: 0; }';\n\t}\n\n\tnodesWithSettings.forEach( ( { selector, presets } ) => {\n\t\tif ( ROOT_BLOCK_SELECTOR === selector ) {\n\t\t\t// Do not add extra specificity for top-level classes.\n\t\t\tselector = '';\n\t\t}\n\n\t\tconst classes = getPresetsClasses( selector, presets );\n\t\tif ( classes.length > 0 ) {\n\t\t\truleset += classes;\n\t\t}\n\t} );\n\n\treturn ruleset;\n};\n\nexport function toSvgFilters( tree, blockSelectors ) {\n\tconst nodesWithSettings = getNodesWithSettings( tree, blockSelectors );\n\treturn nodesWithSettings.flatMap( ( { presets } ) => {\n\t\treturn getPresetsSvgFilters( presets );\n\t} );\n}\n\nconst getSelectorsConfig = ( blockType, rootSelector ) => {\n\tif (\n\t\tblockType?.selectors &&\n\t\tObject.keys( blockType.selectors ).length > 0\n\t) {\n\t\treturn blockType.selectors;\n\t}\n\n\tconst config = { root: rootSelector };\n\tObject.entries( BLOCK_SUPPORT_FEATURE_LEVEL_SELECTORS ).forEach(\n\t\t( [ featureKey, featureName ] ) => {\n\t\t\tconst featureSelector = getBlockCSSSelector(\n\t\t\t\tblockType,\n\t\t\t\tfeatureKey\n\t\t\t);\n\n\t\t\tif ( featureSelector ) {\n\t\t\t\tconfig[ featureName ] = featureSelector;\n\t\t\t}\n\t\t}\n\t);\n\n\treturn config;\n};\n\nexport const getBlockSelectors = ( blockTypes, getBlockStyles ) => {\n\tconst result = {};\n\tblockTypes.forEach( ( blockType ) => {\n\t\tconst name = blockType.name;\n\t\tconst selector = getBlockCSSSelector( blockType );\n\t\tlet duotoneSelector = getBlockCSSSelector(\n\t\t\tblockType,\n\t\t\t'filter.duotone'\n\t\t);\n\n\t\t// Keep backwards compatibility for support.color.__experimentalDuotone.\n\t\tif ( ! duotoneSelector ) {\n\t\t\tconst rootSelector = getBlockCSSSelector( blockType );\n\t\t\tconst duotoneSupport = getBlockSupport(\n\t\t\t\tblockType,\n\t\t\t\t'color.__experimentalDuotone',\n\t\t\t\tfalse\n\t\t\t);\n\t\t\tduotoneSelector =\n\t\t\t\tduotoneSupport && scopeSelector( rootSelector, duotoneSupport );\n\t\t}\n\n\t\tconst hasLayoutSupport =\n\t\t\t!! blockType?.supports?.layout ||\n\t\t\t!! blockType?.supports?.__experimentalLayout;\n\t\tconst fallbackGapValue =\n\t\t\tblockType?.supports?.spacing?.blockGap?.__experimentalDefault;\n\n\t\tconst blockStyleVariations = getBlockStyles( name );\n\t\tconst styleVariationSelectors = {};\n\t\tif ( blockStyleVariations?.length ) {\n\t\t\tblockStyleVariations.forEach( ( variation ) => {\n\t\t\t\tconst styleVariationSelector = `.is-style-${ variation.name }${ selector }`;\n\t\t\t\tstyleVariationSelectors[ variation.name ] =\n\t\t\t\t\tstyleVariationSelector;\n\t\t\t} );\n\t\t}\n\t\t// For each block support feature add any custom selectors.\n\t\tconst featureSelectors = getSelectorsConfig( blockType, selector );\n\n\t\tresult[ name ] = {\n\t\t\tduotoneSelector,\n\t\t\tfallbackGapValue,\n\t\t\tfeatureSelectors: Object.keys( featureSelectors ).length\n\t\t\t\t? featureSelectors\n\t\t\t\t: undefined,\n\t\t\thasLayoutSupport,\n\t\t\tname,\n\t\t\tselector,\n\t\t\tstyleVariationSelectors: Object.keys( styleVariationSelectors )\n\t\t\t\t.length\n\t\t\t\t? styleVariationSelectors\n\t\t\t\t: undefined,\n\t\t};\n\t} );\n\n\treturn result;\n};\n\n/**\n * If there is a separator block whose color is defined in theme.json via background,\n * update the separator color to the same value by using border color.\n *\n * @param {Object} config Theme.json configuration file object.\n * @return {Object} configTheme.json configuration file object updated.\n */\nfunction updateConfigWithSeparator( config ) {\n\tconst needsSeparatorStyleUpdate =\n\t\tconfig.styles?.blocks?.[ 'core/separator' ] &&\n\t\tconfig.styles?.blocks?.[ 'core/separator' ].color?.background &&\n\t\t! config.styles?.blocks?.[ 'core/separator' ].color?.text &&\n\t\t! config.styles?.blocks?.[ 'core/separator' ].border?.color;\n\tif ( needsSeparatorStyleUpdate ) {\n\t\treturn {\n\t\t\t...config,\n\t\t\tstyles: {\n\t\t\t\t...config.styles,\n\t\t\t\tblocks: {\n\t\t\t\t\t...config.styles.blocks,\n\t\t\t\t\t'core/separator': {\n\t\t\t\t\t\t...config.styles.blocks[ 'core/separator' ],\n\t\t\t\t\t\tcolor: {\n\t\t\t\t\t\t\t...config.styles.blocks[ 'core/separator' ].color,\n\t\t\t\t\t\t\ttext: config.styles?.blocks[ 'core/separator' ]\n\t\t\t\t\t\t\t\t.color.background,\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 config;\n}\n\nconst processCSSNesting = ( css, blockSelector ) => {\n\tlet processedCSS = '';\n\n\t// Split CSS nested rules.\n\tconst parts = css.split( '&' );\n\tparts.forEach( ( part ) => {\n\t\tprocessedCSS += ! part.includes( '{' )\n\t\t\t? blockSelector + '{' + part + '}' // If the part doesn't contain braces, it applies to the root level.\n\t\t\t: blockSelector + part; // Prepend the selector, which effectively replaces the \"&\" character.\n\t} );\n\treturn processedCSS;\n};\n\n/**\n * Returns the global styles output using a global styles configuration.\n * If wishing to generate global styles and settings based on the\n * global styles config loaded in the editor context, use `useGlobalStylesOutput()`.\n * The use case for a custom config is to generate bespoke styles\n * and settings for previews, or other out-of-editor experiences.\n *\n * @param {Object} mergedConfig Global styles configuration.\n * @return {Array} Array of stylesheets and settings.\n */\nexport function useGlobalStylesOutputWithConfig( mergedConfig = {} ) {\n\tconst [ blockGap ] = useGlobalSetting( 'spacing.blockGap' );\n\tconst hasBlockGapSupport = blockGap !== null;\n\tconst hasFallbackGapSupport = ! hasBlockGapSupport; // This setting isn't useful yet: it exists as a placeholder for a future explicit fallback styles support.\n\tconst disableLayoutStyles = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\treturn !! getSettings().disableLayoutStyles;\n\t} );\n\n\tconst blockContext = useContext( BlockContext );\n\n\tconst isTemplate = blockContext?.templateSlug !== undefined;\n\n\tconst getBlockStyles = useSelect( ( select ) => {\n\t\treturn select( blocksStore ).getBlockStyles;\n\t}, [] );\n\n\treturn useMemo( () => {\n\t\tif ( ! mergedConfig?.styles || ! mergedConfig?.settings ) {\n\t\t\treturn [];\n\t\t}\n\t\tmergedConfig = updateConfigWithSeparator( mergedConfig );\n\n\t\tconst blockSelectors = getBlockSelectors(\n\t\t\tgetBlockTypes(),\n\t\t\tgetBlockStyles\n\t\t);\n\n\t\tconst customProperties = toCustomProperties(\n\t\t\tmergedConfig,\n\t\t\tblockSelectors\n\t\t);\n\t\tconst globalStyles = toStyles(\n\t\t\tmergedConfig,\n\t\t\tblockSelectors,\n\t\t\thasBlockGapSupport,\n\t\t\thasFallbackGapSupport,\n\t\t\tdisableLayoutStyles,\n\t\t\tisTemplate\n\t\t);\n\t\tconst svgs = toSvgFilters( mergedConfig, blockSelectors );\n\n\t\tconst styles = [\n\t\t\t{\n\t\t\t\tcss: customProperties,\n\t\t\t\tisGlobalStyles: true,\n\t\t\t},\n\t\t\t{\n\t\t\t\tcss: globalStyles,\n\t\t\t\tisGlobalStyles: true,\n\t\t\t},\n\t\t\t// Load custom CSS in own stylesheet so that any invalid CSS entered in the input won't break all the global styles in the editor.\n\t\t\t{\n\t\t\t\tcss: mergedConfig.styles.css ?? '',\n\t\t\t\tisGlobalStyles: true,\n\t\t\t},\n\t\t\t{\n\t\t\t\tassets: svgs,\n\t\t\t\t__unstableType: 'svg',\n\t\t\t\tisGlobalStyles: true,\n\t\t\t},\n\t\t];\n\n\t\t// Loop through the blocks to check if there are custom CSS values.\n\t\t// If there are, get the block selector and push the selector together with\n\t\t// the CSS value to the 'stylesheets' array.\n\t\tgetBlockTypes().forEach( ( blockType ) => {\n\t\t\tif ( mergedConfig.styles.blocks[ blockType.name ]?.css ) {\n\t\t\t\tconst selector = blockSelectors[ blockType.name ].selector;\n\t\t\t\tstyles.push( {\n\t\t\t\t\tcss: processCSSNesting(\n\t\t\t\t\t\tmergedConfig.styles.blocks[ blockType.name ]?.css,\n\t\t\t\t\t\tselector\n\t\t\t\t\t),\n\t\t\t\t\tisGlobalStyles: true,\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\n\t\treturn [ styles, mergedConfig.settings ];\n\t}, [\n\t\thasBlockGapSupport,\n\t\thasFallbackGapSupport,\n\t\tmergedConfig,\n\t\tdisableLayoutStyles,\n\t] );\n}\n\n/**\n * Returns the global styles output based on the current state of global styles config loaded in the editor context.\n *\n * @return {Array} Array of stylesheets and settings.\n */\nexport function useGlobalStylesOutput() {\n\tconst { merged: mergedConfig } = useContext( GlobalStylesContext );\n\treturn useGlobalStylesOutputWithConfig( mergedConfig );\n}\n"],"mappings":";;;;;;;;;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AAOA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AAKA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,oBAAA,GAAAL,OAAA;AACA,IAAAM,gBAAA,GAAAN,OAAA;AAIA,IAAAO,QAAA,GAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,OAAA,GAAAT,OAAA;AACA,IAAAU,IAAA,GAAAV,OAAA;AACA,IAAAW,MAAA,GAAAX,OAAA;AACA,IAAAY,YAAA,GAAAZ,OAAA;AACA,IAAAa,O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O,CAAExK,MAAM,EAAEuJ,YAAY,CAAClH,QAAQ,CAAE;EACzC,CAAC,EAAE,CACFK,kBAAkB,EAClBC,qBAAqB,EACrB4G,YAAY,EACZnD,mBAAmB,CAClB,CAAC;AACJ;;AAEA;AACA;AACA;AACA;AACA;AACO,SAASuE,qBAAqBA,CAAA,EAAG;EACvC,MAAM;IAAEC,MAAM,EAAErB;EAAa,CAAC,GAAG,IAAAO,mBAAU,EAAEe,4BAAoB,CAAC;EAClE,OAAOvB,+BAA+B,CAAEC,YAAa,CAAC;AACvD"}
1
+ {"version":3,"names":["_blocks","require","_data","_element","_styleEngine","_utils","_getBlockCssSelector","_typographyUtils","_context","_hooks","_utils2","_gap","_store","_definitions","_object","_blockContext","_interopRequireDefault","BLOCK_SUPPORT_FEATURE_LEVEL_SELECTORS","__experimentalBorder","color","spacing","typography","compileStyleValue","uncompiledValue","VARIABLE_REFERENCE_PREFIX","VARIABLE_PATH_SEPARATOR_TOKEN_ATTRIBUTE","VARIABLE_PATH_SEPARATOR_TOKEN_STYLE","startsWith","variable","slice","length","split","join","getPresetsDeclarations","blockPresets","mergedSettings","PRESET_METADATA","reduce","declarations","path","valueKey","valueFunc","cssVarInfix","presetByOrigin","getValueFromObjectPath","forEach","origin","value","push","kebabCase","slug","getPresetsClasses","blockSelector","classes","classSuffix","propertyName","classSelectorToUse","selectorToUse","map","selector","getPresetsSvgFilters","filter","metadata","at","flatMap","preset","getDuotoneFilter","colors","flattenTree","input","prefix","token","result","Object","keys","key","newKey","replace","newLeaf","newPrefix","concatFeatureVariationSelectorString","featureSelector","styleVariationSelector","featureSelectors","combinedSelectors","trim","getFeatureDeclarations","selectors","styles","entries","feature","isShorthand","subfeature","subfeatureSelector","subfeatureStyles","newDeclarations","getStylesDeclarations","root","featureStyles","blockStyles","useRootPaddingAlign","tree","isTemplate","isRoot","ROOT_BLOCK_SELECTOR","output","STYLE_PROPERTY","properties","useEngine","rootOnly","pathToValue","styleValue","entry","name","prop","cssProperty","extraRules","getCSSRules","rule","ruleValue","ref","refPath","getTypographyFontSizeValue","size","getFluidTypographyOptionsFromSettings","settings","getLayoutStyles","layoutDefinitions","LAYOUT_DEFINITIONS","style","hasBlockGapSupport","hasFallbackGapSupport","fallbackGapValue","ruleset","gapValue","getGapCSSValue","blockGap","values","className","spacingStyles","spacingStyle","rules","cssValue","combinedSelector","validDisplayModes","displayMode","baseStyles","includes","baseStyle","STYLE_KEYS","pickStyleKeys","treeToPickFrom","pickedEntries","clonedEntries","JSON","parse","stringify","fromEntries","getNodesWithStyles","blockSelectors","_tree$styles$blocks","nodes","ELEMENTS","elements","blocks","blockName","node","_node$elements","variations","variation","duotoneSelector","hasLayoutSupport","styleVariationSelectors","elementName","sel","elementSelectors","elementSelector","exports","getNodesWithSettings","_tree$settings$blocks","pickPresets","presets","setImmutably","custom","blockCustom","toCustomProperties","customProps","toStyles","disableLayoutStyles","nodesWithStyles","nodesWithSettings","useRootPaddingAwareAlignments","contentSize","wideSize","layout","featureDeclarations","cssSelector","styleVariationName","styleVariations","baseSelector","styleVariationDeclarations","duotoneStyles","duotoneDeclarations","pseudoSelectorStyles","pseudoKey","pseudoStyle","pseudoDeclarations","_selector","pseudoRule","toSvgFilters","getSelectorsConfig","blockType","rootSelector","config","featureKey","featureName","getBlockCSSSelector","getBlockSelectors","blockTypes","getBlockStyles","duotoneSupport","getBlockSupport","scopeSelector","supports","__experimentalLayout","__experimentalDefault","blockStyleVariations","undefined","updateConfigWithSeparator","needsSeparatorStyleUpdate","background","text","border","processCSSNesting","css","processedCSS","parts","part","isRootCss","splittedPart","nestedSelector","appendToSelector","useGlobalStylesOutputWithConfig","mergedConfig","useGlobalSetting","useSelect","select","getSettings","blockEditorStore","blockContext","useContext","BlockContext","templateSlug","blocksStore","useMemo","_mergedConfig$styles$","getBlockTypes","customProperties","globalStyles","svgs","isGlobalStyles","assets","__unstableType","useGlobalStylesOutput","merged","GlobalStylesContext"],"sources":["@wordpress/block-editor/src/components/global-styles/use-global-styles-output.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__EXPERIMENTAL_STYLE_PROPERTY as STYLE_PROPERTY,\n\t__EXPERIMENTAL_ELEMENTS as ELEMENTS,\n\tgetBlockSupport,\n\tgetBlockTypes,\n\tstore as blocksStore,\n} from '@wordpress/blocks';\nimport { useSelect } from '@wordpress/data';\nimport { useContext, useMemo } from '@wordpress/element';\nimport { getCSSRules } from '@wordpress/style-engine';\n\n/**\n * Internal dependencies\n */\nimport {\n\tPRESET_METADATA,\n\tROOT_BLOCK_SELECTOR,\n\tscopeSelector,\n\tappendToSelector,\n} from './utils';\nimport { getBlockCSSSelector } from './get-block-css-selector';\nimport {\n\tgetTypographyFontSizeValue,\n\tgetFluidTypographyOptionsFromSettings,\n} from './typography-utils';\nimport { GlobalStylesContext } from './context';\nimport { useGlobalSetting } from './hooks';\nimport { getDuotoneFilter } from '../duotone/utils';\nimport { getGapCSSValue } from '../../hooks/gap';\nimport { store as blockEditorStore } from '../../store';\nimport { LAYOUT_DEFINITIONS } from '../../layouts/definitions';\nimport {\n\tgetValueFromObjectPath,\n\tkebabCase,\n\tsetImmutably,\n} from '../../utils/object';\nimport BlockContext from '../block-context';\n\n// List of block support features that can have their related styles\n// generated under their own feature level selector rather than the block's.\nconst BLOCK_SUPPORT_FEATURE_LEVEL_SELECTORS = {\n\t__experimentalBorder: 'border',\n\tcolor: 'color',\n\tspacing: 'spacing',\n\ttypography: 'typography',\n};\n\nfunction compileStyleValue( uncompiledValue ) {\n\tconst VARIABLE_REFERENCE_PREFIX = 'var:';\n\tconst VARIABLE_PATH_SEPARATOR_TOKEN_ATTRIBUTE = '|';\n\tconst VARIABLE_PATH_SEPARATOR_TOKEN_STYLE = '--';\n\n\tif ( uncompiledValue?.startsWith?.( VARIABLE_REFERENCE_PREFIX ) ) {\n\t\tconst variable = uncompiledValue\n\t\t\t.slice( VARIABLE_REFERENCE_PREFIX.length )\n\t\t\t.split( VARIABLE_PATH_SEPARATOR_TOKEN_ATTRIBUTE )\n\t\t\t.join( VARIABLE_PATH_SEPARATOR_TOKEN_STYLE );\n\t\treturn `var(--wp--${ variable })`;\n\t}\n\treturn uncompiledValue;\n}\n\n/**\n * Transform given preset tree into a set of style declarations.\n *\n * @param {Object} blockPresets\n * @param {Object} mergedSettings Merged theme.json settings.\n *\n * @return {Array<Object>} An array of style declarations.\n */\nfunction getPresetsDeclarations( blockPresets = {}, mergedSettings ) {\n\treturn PRESET_METADATA.reduce(\n\t\t( declarations, { path, valueKey, valueFunc, cssVarInfix } ) => {\n\t\t\tconst presetByOrigin = getValueFromObjectPath(\n\t\t\t\tblockPresets,\n\t\t\t\tpath,\n\t\t\t\t[]\n\t\t\t);\n\t\t\t[ 'default', 'theme', 'custom' ].forEach( ( origin ) => {\n\t\t\t\tif ( presetByOrigin[ origin ] ) {\n\t\t\t\t\tpresetByOrigin[ origin ].forEach( ( value ) => {\n\t\t\t\t\t\tif ( valueKey && ! valueFunc ) {\n\t\t\t\t\t\t\tdeclarations.push(\n\t\t\t\t\t\t\t\t`--wp--preset--${ cssVarInfix }--${ kebabCase(\n\t\t\t\t\t\t\t\t\tvalue.slug\n\t\t\t\t\t\t\t\t) }: ${ value[ valueKey ] }`\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else if (\n\t\t\t\t\t\t\tvalueFunc &&\n\t\t\t\t\t\t\ttypeof valueFunc === 'function'\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tdeclarations.push(\n\t\t\t\t\t\t\t\t`--wp--preset--${ cssVarInfix }--${ kebabCase(\n\t\t\t\t\t\t\t\t\tvalue.slug\n\t\t\t\t\t\t\t\t) }: ${ valueFunc( value, mergedSettings ) }`\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\treturn declarations;\n\t\t},\n\t\t[]\n\t);\n}\n\n/**\n * Transform given preset tree into a set of preset class declarations.\n *\n * @param {?string} blockSelector\n * @param {Object} blockPresets\n * @return {string} CSS declarations for the preset classes.\n */\nfunction getPresetsClasses( blockSelector = '*', blockPresets = {} ) {\n\treturn PRESET_METADATA.reduce(\n\t\t( declarations, { path, cssVarInfix, classes } ) => {\n\t\t\tif ( ! classes ) {\n\t\t\t\treturn declarations;\n\t\t\t}\n\n\t\t\tconst presetByOrigin = getValueFromObjectPath(\n\t\t\t\tblockPresets,\n\t\t\t\tpath,\n\t\t\t\t[]\n\t\t\t);\n\t\t\t[ 'default', 'theme', 'custom' ].forEach( ( origin ) => {\n\t\t\t\tif ( presetByOrigin[ origin ] ) {\n\t\t\t\t\tpresetByOrigin[ origin ].forEach( ( { slug } ) => {\n\t\t\t\t\t\tclasses.forEach( ( { classSuffix, propertyName } ) => {\n\t\t\t\t\t\t\tconst classSelectorToUse = `.has-${ kebabCase(\n\t\t\t\t\t\t\t\tslug\n\t\t\t\t\t\t\t) }-${ classSuffix }`;\n\t\t\t\t\t\t\tconst selectorToUse = blockSelector\n\t\t\t\t\t\t\t\t.split( ',' ) // Selector can be \"h1, h2, h3\"\n\t\t\t\t\t\t\t\t.map(\n\t\t\t\t\t\t\t\t\t( selector ) =>\n\t\t\t\t\t\t\t\t\t\t`${ selector }${ classSelectorToUse }`\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t.join( ',' );\n\t\t\t\t\t\t\tconst value = `var(--wp--preset--${ cssVarInfix }--${ kebabCase(\n\t\t\t\t\t\t\t\tslug\n\t\t\t\t\t\t\t) })`;\n\t\t\t\t\t\t\tdeclarations += `${ selectorToUse }{${ propertyName }: ${ value } !important;}`;\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\treturn declarations;\n\t\t},\n\t\t''\n\t);\n}\n\nfunction getPresetsSvgFilters( blockPresets = {} ) {\n\treturn PRESET_METADATA.filter(\n\t\t// Duotone are the only type of filters for now.\n\t\t( metadata ) => metadata.path.at( -1 ) === 'duotone'\n\t).flatMap( ( metadata ) => {\n\t\tconst presetByOrigin = getValueFromObjectPath(\n\t\t\tblockPresets,\n\t\t\tmetadata.path,\n\t\t\t{}\n\t\t);\n\t\treturn [ 'default', 'theme' ]\n\t\t\t.filter( ( origin ) => presetByOrigin[ origin ] )\n\t\t\t.flatMap( ( origin ) =>\n\t\t\t\tpresetByOrigin[ origin ].map( ( preset ) =>\n\t\t\t\t\tgetDuotoneFilter(\n\t\t\t\t\t\t`wp-duotone-${ preset.slug }`,\n\t\t\t\t\t\tpreset.colors\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t)\n\t\t\t.join( '' );\n\t} );\n}\n\nfunction flattenTree( input = {}, prefix, token ) {\n\tlet result = [];\n\tObject.keys( input ).forEach( ( key ) => {\n\t\tconst newKey = prefix + kebabCase( key.replace( '/', '-' ) );\n\t\tconst newLeaf = input[ key ];\n\n\t\tif ( newLeaf instanceof Object ) {\n\t\t\tconst newPrefix = newKey + token;\n\t\t\tresult = [ ...result, ...flattenTree( newLeaf, newPrefix, token ) ];\n\t\t} else {\n\t\t\tresult.push( `${ newKey }: ${ newLeaf }` );\n\t\t}\n\t} );\n\treturn result;\n}\n\n/**\n * Gets variation selector string from feature selector.\n *\n * @param {string} featureSelector The feature selector.\n *\n * @param {string} styleVariationSelector The style variation selector.\n * @return {string} Combined selector string.\n */\nfunction concatFeatureVariationSelectorString(\n\tfeatureSelector,\n\tstyleVariationSelector\n) {\n\tconst featureSelectors = featureSelector.split( ',' );\n\tconst combinedSelectors = [];\n\tfeatureSelectors.forEach( ( selector ) => {\n\t\tcombinedSelectors.push(\n\t\t\t`${ styleVariationSelector.trim() }${ selector.trim() }`\n\t\t);\n\t} );\n\treturn combinedSelectors.join( ', ' );\n}\n\n/**\n * Generate style declarations for a block's custom feature and subfeature\n * selectors.\n *\n * NOTE: The passed `styles` object will be mutated by this function.\n *\n * @param {Object} selectors Custom selectors object for a block.\n * @param {Object} styles A block's styles object.\n *\n * @return {Object} Style declarations.\n */\nconst getFeatureDeclarations = ( selectors, styles ) => {\n\tconst declarations = {};\n\n\tObject.entries( selectors ).forEach( ( [ feature, selector ] ) => {\n\t\t// We're only processing features/subfeatures that have styles.\n\t\tif ( feature === 'root' || ! styles?.[ feature ] ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst isShorthand = typeof selector === 'string';\n\n\t\t// If we have a selector object instead of shorthand process it.\n\t\tif ( ! isShorthand ) {\n\t\t\tObject.entries( selector ).forEach(\n\t\t\t\t( [ subfeature, subfeatureSelector ] ) => {\n\t\t\t\t\t// Don't process root feature selector yet or any\n\t\t\t\t\t// subfeature that doesn't have a style.\n\t\t\t\t\tif (\n\t\t\t\t\t\tsubfeature === 'root' ||\n\t\t\t\t\t\t! styles?.[ feature ][ subfeature ]\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Create a temporary styles object and build\n\t\t\t\t\t// declarations for subfeature.\n\t\t\t\t\tconst subfeatureStyles = {\n\t\t\t\t\t\t[ feature ]: {\n\t\t\t\t\t\t\t[ subfeature ]: styles[ feature ][ subfeature ],\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\t\tconst newDeclarations =\n\t\t\t\t\t\tgetStylesDeclarations( subfeatureStyles );\n\n\t\t\t\t\t// Merge new declarations in with any others that\n\t\t\t\t\t// share the same selector.\n\t\t\t\t\tdeclarations[ subfeatureSelector ] = [\n\t\t\t\t\t\t...( declarations[ subfeatureSelector ] || [] ),\n\t\t\t\t\t\t...newDeclarations,\n\t\t\t\t\t];\n\n\t\t\t\t\t// Remove the subfeature's style now it will be\n\t\t\t\t\t// included under its own selector not the block's.\n\t\t\t\t\tdelete styles[ feature ][ subfeature ];\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\n\t\t// Now subfeatures have been processed and removed, we can\n\t\t// process root, or shorthand, feature selectors.\n\t\tif ( isShorthand || selector.root ) {\n\t\t\tconst featureSelector = isShorthand ? selector : selector.root;\n\n\t\t\t// Create temporary style object and build declarations for feature.\n\t\t\tconst featureStyles = { [ feature ]: styles[ feature ] };\n\t\t\tconst newDeclarations = getStylesDeclarations( featureStyles );\n\n\t\t\t// Merge new declarations with any others that share the selector.\n\t\t\tdeclarations[ featureSelector ] = [\n\t\t\t\t...( declarations[ featureSelector ] || [] ),\n\t\t\t\t...newDeclarations,\n\t\t\t];\n\n\t\t\t// Remove the feature from the block's styles now as it will be\n\t\t\t// included under its own selector not the block's.\n\t\t\tdelete styles[ feature ];\n\t\t}\n\t} );\n\n\treturn declarations;\n};\n\n/**\n * Transform given style tree into a set of style declarations.\n *\n * @param {Object} blockStyles Block styles.\n *\n * @param {string} selector The selector these declarations should attach to.\n *\n * @param {boolean} useRootPaddingAlign Whether to use CSS custom properties in root selector.\n *\n * @param {Object} tree A theme.json tree containing layout definitions.\n *\n * @param {boolean} isTemplate Whether the entity being edited is a full template or a pattern.\n * @return {Array} An array of style declarations.\n */\nexport function getStylesDeclarations(\n\tblockStyles = {},\n\tselector = '',\n\tuseRootPaddingAlign,\n\ttree = {},\n\tisTemplate = true\n) {\n\tconst isRoot = ROOT_BLOCK_SELECTOR === selector;\n\tconst output = Object.entries( STYLE_PROPERTY ).reduce(\n\t\t(\n\t\t\tdeclarations,\n\t\t\t[ key, { value, properties, useEngine, rootOnly } ]\n\t\t) => {\n\t\t\tif ( rootOnly && ! isRoot ) {\n\t\t\t\treturn declarations;\n\t\t\t}\n\t\t\tconst pathToValue = value;\n\t\t\tif ( pathToValue[ 0 ] === 'elements' || useEngine ) {\n\t\t\t\treturn declarations;\n\t\t\t}\n\n\t\t\tconst styleValue = getValueFromObjectPath(\n\t\t\t\tblockStyles,\n\t\t\t\tpathToValue\n\t\t\t);\n\n\t\t\t// Root-level padding styles don't currently support strings with CSS shorthand values.\n\t\t\t// This may change: https://github.com/WordPress/gutenberg/issues/40132.\n\t\t\tif (\n\t\t\t\tkey === '--wp--style--root--padding' &&\n\t\t\t\t( typeof styleValue === 'string' || ! useRootPaddingAlign )\n\t\t\t) {\n\t\t\t\treturn declarations;\n\t\t\t}\n\n\t\t\tif ( properties && typeof styleValue !== 'string' ) {\n\t\t\t\tObject.entries( properties ).forEach( ( entry ) => {\n\t\t\t\t\tconst [ name, prop ] = entry;\n\n\t\t\t\t\tif (\n\t\t\t\t\t\t! getValueFromObjectPath( styleValue, [ prop ], false )\n\t\t\t\t\t) {\n\t\t\t\t\t\t// Do not create a declaration\n\t\t\t\t\t\t// for sub-properties that don't have any value.\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst cssProperty = name.startsWith( '--' )\n\t\t\t\t\t\t? name\n\t\t\t\t\t\t: kebabCase( name );\n\t\t\t\t\tdeclarations.push(\n\t\t\t\t\t\t`${ cssProperty }: ${ compileStyleValue(\n\t\t\t\t\t\t\tgetValueFromObjectPath( styleValue, [ prop ] )\n\t\t\t\t\t\t) }`\n\t\t\t\t\t);\n\t\t\t\t} );\n\t\t\t} else if (\n\t\t\t\tgetValueFromObjectPath( blockStyles, pathToValue, false )\n\t\t\t) {\n\t\t\t\tconst cssProperty = key.startsWith( '--' )\n\t\t\t\t\t? key\n\t\t\t\t\t: kebabCase( key );\n\t\t\t\tdeclarations.push(\n\t\t\t\t\t`${ cssProperty }: ${ compileStyleValue(\n\t\t\t\t\t\tgetValueFromObjectPath( blockStyles, pathToValue )\n\t\t\t\t\t) }`\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn declarations;\n\t\t},\n\t\t[]\n\t);\n\n\t// The goal is to move everything to server side generated engine styles\n\t// This is temporary as we absorb more and more styles into the engine.\n\tconst extraRules = getCSSRules( blockStyles );\n\textraRules.forEach( ( rule ) => {\n\t\t// Don't output padding properties if padding variables are set or if we're not editing a full template.\n\t\tif (\n\t\t\tisRoot &&\n\t\t\t( useRootPaddingAlign || ! isTemplate ) &&\n\t\t\trule.key.startsWith( 'padding' )\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t\tconst cssProperty = rule.key.startsWith( '--' )\n\t\t\t? rule.key\n\t\t\t: kebabCase( rule.key );\n\n\t\tlet ruleValue = rule.value;\n\t\tif ( typeof ruleValue !== 'string' && ruleValue?.ref ) {\n\t\t\tconst refPath = ruleValue.ref.split( '.' );\n\t\t\truleValue = getValueFromObjectPath( tree, refPath );\n\t\t\t// Presence of another ref indicates a reference to another dynamic value.\n\t\t\t// Pointing to another dynamic value is not supported.\n\t\t\tif ( ! ruleValue || ruleValue?.ref ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t// Calculate fluid typography rules where available.\n\t\tif ( cssProperty === 'font-size' ) {\n\t\t\t/*\n\t\t\t * getTypographyFontSizeValue() will check\n\t\t\t * if fluid typography has been activated and also\n\t\t\t * whether the incoming value can be converted to a fluid value.\n\t\t\t * Values that already have a \"clamp()\" function will not pass the test,\n\t\t\t * and therefore the original $value will be returned.\n\t\t\t */\n\t\t\truleValue = getTypographyFontSizeValue(\n\t\t\t\t{ size: ruleValue },\n\t\t\t\tgetFluidTypographyOptionsFromSettings( tree?.settings )\n\t\t\t);\n\t\t}\n\n\t\toutput.push( `${ cssProperty }: ${ ruleValue }` );\n\t} );\n\n\treturn output;\n}\n\n/**\n * Get generated CSS for layout styles by looking up layout definitions provided\n * in theme.json, and outputting common layout styles, and specific blockGap values.\n *\n * @param {Object} props\n * @param {Object} props.layoutDefinitions Layout definitions, keyed by layout type.\n * @param {Object} props.style A style object containing spacing values.\n * @param {string} props.selector Selector used to group together layout styling rules.\n * @param {boolean} props.hasBlockGapSupport Whether or not the theme opts-in to blockGap support.\n * @param {boolean} props.hasFallbackGapSupport Whether or not the theme allows fallback gap styles.\n * @param {?string} props.fallbackGapValue An optional fallback gap value if no real gap value is available.\n * @return {string} Generated CSS rules for the layout styles.\n */\nexport function getLayoutStyles( {\n\tlayoutDefinitions = LAYOUT_DEFINITIONS,\n\tstyle,\n\tselector,\n\thasBlockGapSupport,\n\thasFallbackGapSupport,\n\tfallbackGapValue,\n} ) {\n\tlet ruleset = '';\n\tlet gapValue = hasBlockGapSupport\n\t\t? getGapCSSValue( style?.spacing?.blockGap )\n\t\t: '';\n\n\t// Ensure a fallback gap value for the root layout definitions,\n\t// and use a fallback value if one is provided for the current block.\n\tif ( hasFallbackGapSupport ) {\n\t\tif ( selector === ROOT_BLOCK_SELECTOR ) {\n\t\t\tgapValue = ! gapValue ? '0.5em' : gapValue;\n\t\t} else if ( ! hasBlockGapSupport && fallbackGapValue ) {\n\t\t\tgapValue = fallbackGapValue;\n\t\t}\n\t}\n\n\tif ( gapValue && layoutDefinitions ) {\n\t\tObject.values( layoutDefinitions ).forEach(\n\t\t\t( { className, name, spacingStyles } ) => {\n\t\t\t\t// Allow outputting fallback gap styles for flex layout type when block gap support isn't available.\n\t\t\t\tif (\n\t\t\t\t\t! hasBlockGapSupport &&\n\t\t\t\t\t'flex' !== name &&\n\t\t\t\t\t'grid' !== name\n\t\t\t\t) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ( spacingStyles?.length ) {\n\t\t\t\t\tspacingStyles.forEach( ( spacingStyle ) => {\n\t\t\t\t\t\tconst declarations = [];\n\n\t\t\t\t\t\tif ( spacingStyle.rules ) {\n\t\t\t\t\t\t\tObject.entries( spacingStyle.rules ).forEach(\n\t\t\t\t\t\t\t\t( [ cssProperty, cssValue ] ) => {\n\t\t\t\t\t\t\t\t\tdeclarations.push(\n\t\t\t\t\t\t\t\t\t\t`${ cssProperty }: ${\n\t\t\t\t\t\t\t\t\t\t\tcssValue ? cssValue : gapValue\n\t\t\t\t\t\t\t\t\t\t}`\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( declarations.length ) {\n\t\t\t\t\t\t\tlet combinedSelector = '';\n\n\t\t\t\t\t\t\tif ( ! hasBlockGapSupport ) {\n\t\t\t\t\t\t\t\t// For fallback gap styles, use lower specificity, to ensure styles do not unintentionally override theme styles.\n\t\t\t\t\t\t\t\tcombinedSelector =\n\t\t\t\t\t\t\t\t\tselector === ROOT_BLOCK_SELECTOR\n\t\t\t\t\t\t\t\t\t\t? `:where(.${ className }${\n\t\t\t\t\t\t\t\t\t\t\t\tspacingStyle?.selector || ''\n\t\t\t\t\t\t\t\t\t\t })`\n\t\t\t\t\t\t\t\t\t\t: `:where(${ selector }.${ className }${\n\t\t\t\t\t\t\t\t\t\t\t\tspacingStyle?.selector || ''\n\t\t\t\t\t\t\t\t\t\t })`;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tcombinedSelector =\n\t\t\t\t\t\t\t\t\tselector === ROOT_BLOCK_SELECTOR\n\t\t\t\t\t\t\t\t\t\t? `:where(${ selector } .${ className })${\n\t\t\t\t\t\t\t\t\t\t\t\tspacingStyle?.selector || ''\n\t\t\t\t\t\t\t\t\t\t }`\n\t\t\t\t\t\t\t\t\t\t: `${ selector }-${ className }${\n\t\t\t\t\t\t\t\t\t\t\t\tspacingStyle?.selector || ''\n\t\t\t\t\t\t\t\t\t\t }`;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\truleset += `${ combinedSelector } { ${ declarations.join(\n\t\t\t\t\t\t\t\t'; '\n\t\t\t\t\t\t\t) }; }`;\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\t// For backwards compatibility, ensure the legacy block gap CSS variable is still available.\n\t\tif ( selector === ROOT_BLOCK_SELECTOR && hasBlockGapSupport ) {\n\t\t\truleset += `${ selector } { --wp--style--block-gap: ${ gapValue }; }`;\n\t\t}\n\t}\n\n\t// Output base styles\n\tif ( selector === ROOT_BLOCK_SELECTOR && layoutDefinitions ) {\n\t\tconst validDisplayModes = [ 'block', 'flex', 'grid' ];\n\t\tObject.values( layoutDefinitions ).forEach(\n\t\t\t( { className, displayMode, baseStyles } ) => {\n\t\t\t\tif (\n\t\t\t\t\tdisplayMode &&\n\t\t\t\t\tvalidDisplayModes.includes( displayMode )\n\t\t\t\t) {\n\t\t\t\t\truleset += `${ selector } .${ className } { display:${ displayMode }; }`;\n\t\t\t\t}\n\n\t\t\t\tif ( baseStyles?.length ) {\n\t\t\t\t\tbaseStyles.forEach( ( baseStyle ) => {\n\t\t\t\t\t\tconst declarations = [];\n\n\t\t\t\t\t\tif ( baseStyle.rules ) {\n\t\t\t\t\t\t\tObject.entries( baseStyle.rules ).forEach(\n\t\t\t\t\t\t\t\t( [ cssProperty, cssValue ] ) => {\n\t\t\t\t\t\t\t\t\tdeclarations.push(\n\t\t\t\t\t\t\t\t\t\t`${ cssProperty }: ${ cssValue }`\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( declarations.length ) {\n\t\t\t\t\t\t\tconst combinedSelector = `${ selector } .${ className }${\n\t\t\t\t\t\t\t\tbaseStyle?.selector || ''\n\t\t\t\t\t\t\t}`;\n\t\t\t\t\t\t\truleset += `${ combinedSelector } { ${ declarations.join(\n\t\t\t\t\t\t\t\t'; '\n\t\t\t\t\t\t\t) }; }`;\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\n\treturn ruleset;\n}\n\nconst STYLE_KEYS = [\n\t'border',\n\t'color',\n\t'dimensions',\n\t'spacing',\n\t'typography',\n\t'filter',\n\t'outline',\n\t'shadow',\n];\n\nfunction pickStyleKeys( treeToPickFrom ) {\n\tif ( ! treeToPickFrom ) {\n\t\treturn {};\n\t}\n\tconst entries = Object.entries( treeToPickFrom );\n\tconst pickedEntries = entries.filter( ( [ key ] ) =>\n\t\tSTYLE_KEYS.includes( key )\n\t);\n\t// clone the style objects so that `getFeatureDeclarations` can remove consumed keys from it\n\tconst clonedEntries = pickedEntries.map( ( [ key, style ] ) => [\n\t\tkey,\n\t\tJSON.parse( JSON.stringify( style ) ),\n\t] );\n\treturn Object.fromEntries( clonedEntries );\n}\n\nexport const getNodesWithStyles = ( tree, blockSelectors ) => {\n\tconst nodes = [];\n\n\tif ( ! tree?.styles ) {\n\t\treturn nodes;\n\t}\n\n\t// Top-level.\n\tconst styles = pickStyleKeys( tree.styles );\n\tif ( styles ) {\n\t\tnodes.push( {\n\t\t\tstyles,\n\t\t\tselector: ROOT_BLOCK_SELECTOR,\n\t\t} );\n\t}\n\n\tObject.entries( ELEMENTS ).forEach( ( [ name, selector ] ) => {\n\t\tif ( tree.styles?.elements?.[ name ] ) {\n\t\t\tnodes.push( {\n\t\t\t\tstyles: tree.styles?.elements?.[ name ],\n\t\t\t\tselector,\n\t\t\t} );\n\t\t}\n\t} );\n\n\t// Iterate over blocks: they can have styles & elements.\n\tObject.entries( tree.styles?.blocks ?? {} ).forEach(\n\t\t( [ blockName, node ] ) => {\n\t\t\tconst blockStyles = pickStyleKeys( node );\n\n\t\t\tif ( node?.variations ) {\n\t\t\t\tconst variations = {};\n\t\t\t\tObject.keys( node.variations ).forEach( ( variation ) => {\n\t\t\t\t\tvariations[ variation ] = pickStyleKeys(\n\t\t\t\t\t\tnode.variations[ variation ]\n\t\t\t\t\t);\n\t\t\t\t} );\n\t\t\t\tblockStyles.variations = variations;\n\t\t\t}\n\t\t\tif ( blockStyles && blockSelectors?.[ blockName ]?.selector ) {\n\t\t\t\tnodes.push( {\n\t\t\t\t\tduotoneSelector:\n\t\t\t\t\t\tblockSelectors[ blockName ].duotoneSelector,\n\t\t\t\t\tfallbackGapValue:\n\t\t\t\t\t\tblockSelectors[ blockName ].fallbackGapValue,\n\t\t\t\t\thasLayoutSupport:\n\t\t\t\t\t\tblockSelectors[ blockName ].hasLayoutSupport,\n\t\t\t\t\tselector: blockSelectors[ blockName ].selector,\n\t\t\t\t\tstyles: blockStyles,\n\t\t\t\t\tfeatureSelectors:\n\t\t\t\t\t\tblockSelectors[ blockName ].featureSelectors,\n\t\t\t\t\tstyleVariationSelectors:\n\t\t\t\t\t\tblockSelectors[ blockName ].styleVariationSelectors,\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\tObject.entries( node?.elements ?? {} ).forEach(\n\t\t\t\t( [ elementName, value ] ) => {\n\t\t\t\t\tif (\n\t\t\t\t\t\tvalue &&\n\t\t\t\t\t\tblockSelectors?.[ blockName ] &&\n\t\t\t\t\t\tELEMENTS[ elementName ]\n\t\t\t\t\t) {\n\t\t\t\t\t\tnodes.push( {\n\t\t\t\t\t\t\tstyles: value,\n\t\t\t\t\t\t\tselector: blockSelectors[ blockName ]?.selector\n\t\t\t\t\t\t\t\t.split( ',' )\n\t\t\t\t\t\t\t\t.map( ( sel ) => {\n\t\t\t\t\t\t\t\t\tconst elementSelectors =\n\t\t\t\t\t\t\t\t\t\tELEMENTS[ elementName ].split( ',' );\n\t\t\t\t\t\t\t\t\treturn elementSelectors.map(\n\t\t\t\t\t\t\t\t\t\t( elementSelector ) =>\n\t\t\t\t\t\t\t\t\t\t\tsel + ' ' + elementSelector\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t.join( ',' ),\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\n\treturn nodes;\n};\n\nexport const getNodesWithSettings = ( tree, blockSelectors ) => {\n\tconst nodes = [];\n\n\tif ( ! tree?.settings ) {\n\t\treturn nodes;\n\t}\n\n\tconst pickPresets = ( treeToPickFrom ) => {\n\t\tlet presets = {};\n\t\tPRESET_METADATA.forEach( ( { path } ) => {\n\t\t\tconst value = getValueFromObjectPath( treeToPickFrom, path, false );\n\t\t\tif ( value !== false ) {\n\t\t\t\tpresets = setImmutably( presets, path, value );\n\t\t\t}\n\t\t} );\n\t\treturn presets;\n\t};\n\n\t// Top-level.\n\tconst presets = pickPresets( tree.settings );\n\tconst custom = tree.settings?.custom;\n\tif ( Object.keys( presets ).length > 0 || custom ) {\n\t\tnodes.push( {\n\t\t\tpresets,\n\t\t\tcustom,\n\t\t\tselector: ROOT_BLOCK_SELECTOR,\n\t\t} );\n\t}\n\n\t// Blocks.\n\tObject.entries( tree.settings?.blocks ?? {} ).forEach(\n\t\t( [ blockName, node ] ) => {\n\t\t\tconst blockPresets = pickPresets( node );\n\t\t\tconst blockCustom = node.custom;\n\t\t\tif ( Object.keys( blockPresets ).length > 0 || blockCustom ) {\n\t\t\t\tnodes.push( {\n\t\t\t\t\tpresets: blockPresets,\n\t\t\t\t\tcustom: blockCustom,\n\t\t\t\t\tselector: blockSelectors[ blockName ]?.selector,\n\t\t\t\t} );\n\t\t\t}\n\t\t}\n\t);\n\n\treturn nodes;\n};\n\nexport const toCustomProperties = ( tree, blockSelectors ) => {\n\tconst settings = getNodesWithSettings( tree, blockSelectors );\n\tlet ruleset = '';\n\tsettings.forEach( ( { presets, custom, selector } ) => {\n\t\tconst declarations = getPresetsDeclarations( presets, tree?.settings );\n\t\tconst customProps = flattenTree( custom, '--wp--custom--', '--' );\n\t\tif ( customProps.length > 0 ) {\n\t\t\tdeclarations.push( ...customProps );\n\t\t}\n\n\t\tif ( declarations.length > 0 ) {\n\t\t\truleset += `${ selector }{${ declarations.join( ';' ) };}`;\n\t\t}\n\t} );\n\n\treturn ruleset;\n};\n\nexport const toStyles = (\n\ttree,\n\tblockSelectors,\n\thasBlockGapSupport,\n\thasFallbackGapSupport,\n\tdisableLayoutStyles = false,\n\tisTemplate = true\n) => {\n\tconst nodesWithStyles = getNodesWithStyles( tree, blockSelectors );\n\tconst nodesWithSettings = getNodesWithSettings( tree, blockSelectors );\n\tconst useRootPaddingAlign = tree?.settings?.useRootPaddingAwareAlignments;\n\tconst { contentSize, wideSize } = tree?.settings?.layout || {};\n\n\t/*\n\t * Reset default browser margin on the root body element.\n\t * This is set on the root selector **before** generating the ruleset\n\t * from the `theme.json`. This is to ensure that if the `theme.json` declares\n\t * `margin` in its `spacing` declaration for the `body` element then these\n\t * user-generated values take precedence in the CSS cascade.\n\t * @link https://github.com/WordPress/gutenberg/issues/36147.\n\t */\n\tlet ruleset = 'body {margin: 0;';\n\n\tif ( contentSize ) {\n\t\truleset += ` --wp--style--global--content-size: ${ contentSize };`;\n\t}\n\n\tif ( wideSize ) {\n\t\truleset += ` --wp--style--global--wide-size: ${ wideSize };`;\n\t}\n\n\t// Root padding styles should only be output for full templates, not patterns or template parts.\n\tif ( useRootPaddingAlign && isTemplate ) {\n\t\t/*\n\t\t * These rules reproduce the ones from https://github.com/WordPress/gutenberg/blob/79103f124925d1f457f627e154f52a56228ed5ad/lib/class-wp-theme-json-gutenberg.php#L2508\n\t\t * almost exactly, but for the selectors that target block wrappers in the front end. This code only runs in the editor, so it doesn't need those selectors.\n\t\t */\n\t\truleset += `padding-right: 0; padding-left: 0; padding-top: var(--wp--style--root--padding-top); padding-bottom: var(--wp--style--root--padding-bottom) }\n\t\t\t.has-global-padding { padding-right: var(--wp--style--root--padding-right); padding-left: var(--wp--style--root--padding-left); }\n\t\t\t.has-global-padding :where(.has-global-padding:not(.wp-block-block)) { padding-right: 0; padding-left: 0; }\n\t\t\t.has-global-padding > .alignfull { margin-right: calc(var(--wp--style--root--padding-right) * -1); margin-left: calc(var(--wp--style--root--padding-left) * -1); }\n\t\t\t.has-global-padding :where(.has-global-padding:not(.wp-block-block)) > .alignfull { margin-right: 0; margin-left: 0; }\n\t\t\t.has-global-padding > .alignfull:where(:not(.has-global-padding):not(.is-layout-flex):not(.is-layout-grid)) > :where(.wp-block:not(.alignfull),p,h1,h2,h3,h4,h5,h6,ul,ol) { padding-right: var(--wp--style--root--padding-right); padding-left: var(--wp--style--root--padding-left); }\n\t\t\t.has-global-padding :where(.has-global-padding) > .alignfull:where(:not(.has-global-padding)) > :where(.wp-block:not(.alignfull),p,h1,h2,h3,h4,h5,h6,ul,ol) { padding-right: 0; padding-left: 0;`;\n\t}\n\n\truleset += '}';\n\n\tnodesWithStyles.forEach(\n\t\t( {\n\t\t\tselector,\n\t\t\tduotoneSelector,\n\t\t\tstyles,\n\t\t\tfallbackGapValue,\n\t\t\thasLayoutSupport,\n\t\t\tfeatureSelectors,\n\t\t\tstyleVariationSelectors,\n\t\t} ) => {\n\t\t\t// Process styles for block support features with custom feature level\n\t\t\t// CSS selectors set.\n\t\t\tif ( featureSelectors ) {\n\t\t\t\tconst featureDeclarations = getFeatureDeclarations(\n\t\t\t\t\tfeatureSelectors,\n\t\t\t\t\tstyles\n\t\t\t\t);\n\n\t\t\t\tObject.entries( featureDeclarations ).forEach(\n\t\t\t\t\t( [ cssSelector, declarations ] ) => {\n\t\t\t\t\t\tif ( declarations.length ) {\n\t\t\t\t\t\t\tconst rules = declarations.join( ';' );\n\t\t\t\t\t\t\truleset += `${ cssSelector }{${ rules };}`;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif ( styleVariationSelectors ) {\n\t\t\t\tObject.entries( styleVariationSelectors ).forEach(\n\t\t\t\t\t( [ styleVariationName, styleVariationSelector ] ) => {\n\t\t\t\t\t\tconst styleVariations =\n\t\t\t\t\t\t\tstyles?.variations?.[ styleVariationName ];\n\t\t\t\t\t\tif ( styleVariations ) {\n\t\t\t\t\t\t\t// If the block uses any custom selectors for block support, add those first.\n\t\t\t\t\t\t\tif ( featureSelectors ) {\n\t\t\t\t\t\t\t\tconst featureDeclarations =\n\t\t\t\t\t\t\t\t\tgetFeatureDeclarations(\n\t\t\t\t\t\t\t\t\t\tfeatureSelectors,\n\t\t\t\t\t\t\t\t\t\tstyleVariations\n\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\tObject.entries( featureDeclarations ).forEach(\n\t\t\t\t\t\t\t\t\t( [ baseSelector, declarations ] ) => {\n\t\t\t\t\t\t\t\t\t\tif ( declarations.length ) {\n\t\t\t\t\t\t\t\t\t\t\tconst cssSelector =\n\t\t\t\t\t\t\t\t\t\t\t\tconcatFeatureVariationSelectorString(\n\t\t\t\t\t\t\t\t\t\t\t\t\tbaseSelector,\n\t\t\t\t\t\t\t\t\t\t\t\t\tstyleVariationSelector\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\tconst rules =\n\t\t\t\t\t\t\t\t\t\t\t\tdeclarations.join( ';' );\n\t\t\t\t\t\t\t\t\t\t\truleset += `${ cssSelector }{${ rules };}`;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Otherwise add regular selectors.\n\t\t\t\t\t\t\tconst styleVariationDeclarations =\n\t\t\t\t\t\t\t\tgetStylesDeclarations(\n\t\t\t\t\t\t\t\t\tstyleVariations,\n\t\t\t\t\t\t\t\t\tstyleVariationSelector,\n\t\t\t\t\t\t\t\t\tuseRootPaddingAlign,\n\t\t\t\t\t\t\t\t\ttree\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tif ( styleVariationDeclarations.length ) {\n\t\t\t\t\t\t\t\truleset += `${ styleVariationSelector }{${ styleVariationDeclarations.join(\n\t\t\t\t\t\t\t\t\t';'\n\t\t\t\t\t\t\t\t) };}`;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Process duotone styles.\n\t\t\tif ( duotoneSelector ) {\n\t\t\t\tconst duotoneStyles = {};\n\t\t\t\tif ( styles?.filter ) {\n\t\t\t\t\tduotoneStyles.filter = styles.filter;\n\t\t\t\t\tdelete styles.filter;\n\t\t\t\t}\n\t\t\t\tconst duotoneDeclarations =\n\t\t\t\t\tgetStylesDeclarations( duotoneStyles );\n\t\t\t\tif ( duotoneDeclarations.length ) {\n\t\t\t\t\truleset += `${ duotoneSelector }{${ duotoneDeclarations.join(\n\t\t\t\t\t\t';'\n\t\t\t\t\t) };}`;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Process blockGap and layout styles.\n\t\t\tif (\n\t\t\t\t! disableLayoutStyles &&\n\t\t\t\t( ROOT_BLOCK_SELECTOR === selector || hasLayoutSupport )\n\t\t\t) {\n\t\t\t\truleset += getLayoutStyles( {\n\t\t\t\t\tstyle: styles,\n\t\t\t\t\tselector,\n\t\t\t\t\thasBlockGapSupport,\n\t\t\t\t\thasFallbackGapSupport,\n\t\t\t\t\tfallbackGapValue,\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\t// Process the remaining block styles (they use either normal block class or __experimentalSelector).\n\t\t\tconst declarations = getStylesDeclarations(\n\t\t\t\tstyles,\n\t\t\t\tselector,\n\t\t\t\tuseRootPaddingAlign,\n\t\t\t\ttree,\n\t\t\t\tisTemplate\n\t\t\t);\n\t\t\tif ( declarations?.length ) {\n\t\t\t\truleset += `${ selector }{${ declarations.join( ';' ) };}`;\n\t\t\t}\n\n\t\t\t// Check for pseudo selector in `styles` and handle separately.\n\t\t\tconst pseudoSelectorStyles = Object.entries( styles ).filter(\n\t\t\t\t( [ key ] ) => key.startsWith( ':' )\n\t\t\t);\n\n\t\t\tif ( pseudoSelectorStyles?.length ) {\n\t\t\t\tpseudoSelectorStyles.forEach(\n\t\t\t\t\t( [ pseudoKey, pseudoStyle ] ) => {\n\t\t\t\t\t\tconst pseudoDeclarations =\n\t\t\t\t\t\t\tgetStylesDeclarations( pseudoStyle );\n\n\t\t\t\t\t\tif ( ! pseudoDeclarations?.length ) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// `selector` maybe provided in a form\n\t\t\t\t\t\t// where block level selectors have sub element\n\t\t\t\t\t\t// selectors appended to them as a comma separated\n\t\t\t\t\t\t// string.\n\t\t\t\t\t\t// e.g. `h1 a,h2 a,h3 a,h4 a,h5 a,h6 a`;\n\t\t\t\t\t\t// Split and append pseudo selector to create\n\t\t\t\t\t\t// the proper rules to target the elements.\n\t\t\t\t\t\tconst _selector = selector\n\t\t\t\t\t\t\t.split( ',' )\n\t\t\t\t\t\t\t.map( ( sel ) => sel + pseudoKey )\n\t\t\t\t\t\t\t.join( ',' );\n\n\t\t\t\t\t\tconst pseudoRule = `${ _selector }{${ pseudoDeclarations.join(\n\t\t\t\t\t\t\t';'\n\t\t\t\t\t\t) };}`;\n\n\t\t\t\t\t\truleset += pseudoRule;\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t);\n\n\t/* Add alignment / layout styles */\n\truleset =\n\t\truleset +\n\t\t'.wp-site-blocks > .alignleft { float: left; margin-right: 2em; }';\n\truleset =\n\t\truleset +\n\t\t'.wp-site-blocks > .alignright { float: right; margin-left: 2em; }';\n\truleset =\n\t\truleset +\n\t\t'.wp-site-blocks > .aligncenter { justify-content: center; margin-left: auto; margin-right: auto; }';\n\n\tif ( hasBlockGapSupport ) {\n\t\t// Use fallback of `0.5em` just in case, however if there is blockGap support, there should nearly always be a real value.\n\t\tconst gapValue =\n\t\t\tgetGapCSSValue( tree?.styles?.spacing?.blockGap ) || '0.5em';\n\t\truleset =\n\t\t\truleset +\n\t\t\t`:where(.wp-site-blocks) > * { margin-block-start: ${ gapValue }; margin-block-end: 0; }`;\n\t\truleset =\n\t\t\truleset +\n\t\t\t':where(.wp-site-blocks) > :first-child:first-child { margin-block-start: 0; }';\n\t\truleset =\n\t\t\truleset +\n\t\t\t':where(.wp-site-blocks) > :last-child:last-child { margin-block-end: 0; }';\n\t}\n\n\tnodesWithSettings.forEach( ( { selector, presets } ) => {\n\t\tif ( ROOT_BLOCK_SELECTOR === selector ) {\n\t\t\t// Do not add extra specificity for top-level classes.\n\t\t\tselector = '';\n\t\t}\n\n\t\tconst classes = getPresetsClasses( selector, presets );\n\t\tif ( classes.length > 0 ) {\n\t\t\truleset += classes;\n\t\t}\n\t} );\n\n\treturn ruleset;\n};\n\nexport function toSvgFilters( tree, blockSelectors ) {\n\tconst nodesWithSettings = getNodesWithSettings( tree, blockSelectors );\n\treturn nodesWithSettings.flatMap( ( { presets } ) => {\n\t\treturn getPresetsSvgFilters( presets );\n\t} );\n}\n\nconst getSelectorsConfig = ( blockType, rootSelector ) => {\n\tif (\n\t\tblockType?.selectors &&\n\t\tObject.keys( blockType.selectors ).length > 0\n\t) {\n\t\treturn blockType.selectors;\n\t}\n\n\tconst config = { root: rootSelector };\n\tObject.entries( BLOCK_SUPPORT_FEATURE_LEVEL_SELECTORS ).forEach(\n\t\t( [ featureKey, featureName ] ) => {\n\t\t\tconst featureSelector = getBlockCSSSelector(\n\t\t\t\tblockType,\n\t\t\t\tfeatureKey\n\t\t\t);\n\n\t\t\tif ( featureSelector ) {\n\t\t\t\tconfig[ featureName ] = featureSelector;\n\t\t\t}\n\t\t}\n\t);\n\n\treturn config;\n};\n\nexport const getBlockSelectors = ( blockTypes, getBlockStyles ) => {\n\tconst result = {};\n\tblockTypes.forEach( ( blockType ) => {\n\t\tconst name = blockType.name;\n\t\tconst selector = getBlockCSSSelector( blockType );\n\t\tlet duotoneSelector = getBlockCSSSelector(\n\t\t\tblockType,\n\t\t\t'filter.duotone'\n\t\t);\n\n\t\t// Keep backwards compatibility for support.color.__experimentalDuotone.\n\t\tif ( ! duotoneSelector ) {\n\t\t\tconst rootSelector = getBlockCSSSelector( blockType );\n\t\t\tconst duotoneSupport = getBlockSupport(\n\t\t\t\tblockType,\n\t\t\t\t'color.__experimentalDuotone',\n\t\t\t\tfalse\n\t\t\t);\n\t\t\tduotoneSelector =\n\t\t\t\tduotoneSupport && scopeSelector( rootSelector, duotoneSupport );\n\t\t}\n\n\t\tconst hasLayoutSupport =\n\t\t\t!! blockType?.supports?.layout ||\n\t\t\t!! blockType?.supports?.__experimentalLayout;\n\t\tconst fallbackGapValue =\n\t\t\tblockType?.supports?.spacing?.blockGap?.__experimentalDefault;\n\n\t\tconst blockStyleVariations = getBlockStyles( name );\n\t\tconst styleVariationSelectors = {};\n\t\tif ( blockStyleVariations?.length ) {\n\t\t\tblockStyleVariations.forEach( ( variation ) => {\n\t\t\t\tconst styleVariationSelector = `.is-style-${ variation.name }${ selector }`;\n\t\t\t\tstyleVariationSelectors[ variation.name ] =\n\t\t\t\t\tstyleVariationSelector;\n\t\t\t} );\n\t\t}\n\t\t// For each block support feature add any custom selectors.\n\t\tconst featureSelectors = getSelectorsConfig( blockType, selector );\n\n\t\tresult[ name ] = {\n\t\t\tduotoneSelector,\n\t\t\tfallbackGapValue,\n\t\t\tfeatureSelectors: Object.keys( featureSelectors ).length\n\t\t\t\t? featureSelectors\n\t\t\t\t: undefined,\n\t\t\thasLayoutSupport,\n\t\t\tname,\n\t\t\tselector,\n\t\t\tstyleVariationSelectors: Object.keys( styleVariationSelectors )\n\t\t\t\t.length\n\t\t\t\t? styleVariationSelectors\n\t\t\t\t: undefined,\n\t\t};\n\t} );\n\n\treturn result;\n};\n\n/**\n * If there is a separator block whose color is defined in theme.json via background,\n * update the separator color to the same value by using border color.\n *\n * @param {Object} config Theme.json configuration file object.\n * @return {Object} configTheme.json configuration file object updated.\n */\nfunction updateConfigWithSeparator( config ) {\n\tconst needsSeparatorStyleUpdate =\n\t\tconfig.styles?.blocks?.[ 'core/separator' ] &&\n\t\tconfig.styles?.blocks?.[ 'core/separator' ].color?.background &&\n\t\t! config.styles?.blocks?.[ 'core/separator' ].color?.text &&\n\t\t! config.styles?.blocks?.[ 'core/separator' ].border?.color;\n\tif ( needsSeparatorStyleUpdate ) {\n\t\treturn {\n\t\t\t...config,\n\t\t\tstyles: {\n\t\t\t\t...config.styles,\n\t\t\t\tblocks: {\n\t\t\t\t\t...config.styles.blocks,\n\t\t\t\t\t'core/separator': {\n\t\t\t\t\t\t...config.styles.blocks[ 'core/separator' ],\n\t\t\t\t\t\tcolor: {\n\t\t\t\t\t\t\t...config.styles.blocks[ 'core/separator' ].color,\n\t\t\t\t\t\t\ttext: config.styles?.blocks[ 'core/separator' ]\n\t\t\t\t\t\t\t\t.color.background,\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 config;\n}\n\nexport function processCSSNesting( css, blockSelector ) {\n\tlet processedCSS = '';\n\n\t// Split CSS nested rules.\n\tconst parts = css.split( '&' );\n\tparts.forEach( ( part ) => {\n\t\tconst isRootCss = ! part.includes( '{' );\n\t\tif ( isRootCss ) {\n\t\t\t// If the part doesn't contain braces, it applies to the root level.\n\t\t\tprocessedCSS += `${ blockSelector }{${ part.trim() }}`;\n\t\t} else {\n\t\t\t// If the part contains braces, it's a nested CSS rule.\n\t\t\tconst splittedPart = part.replace( '}', '' ).split( '{' );\n\t\t\tif ( splittedPart.length !== 2 ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst [ nestedSelector, cssValue ] = splittedPart;\n\t\t\tconst combinedSelector = nestedSelector.startsWith( ' ' )\n\t\t\t\t? scopeSelector( blockSelector, nestedSelector )\n\t\t\t\t: appendToSelector( blockSelector, nestedSelector );\n\n\t\t\tprocessedCSS += `${ combinedSelector }{${ cssValue.trim() }}`;\n\t\t}\n\t} );\n\treturn processedCSS;\n}\n\n/**\n * Returns the global styles output using a global styles configuration.\n * If wishing to generate global styles and settings based on the\n * global styles config loaded in the editor context, use `useGlobalStylesOutput()`.\n * The use case for a custom config is to generate bespoke styles\n * and settings for previews, or other out-of-editor experiences.\n *\n * @param {Object} mergedConfig Global styles configuration.\n * @return {Array} Array of stylesheets and settings.\n */\nexport function useGlobalStylesOutputWithConfig( mergedConfig = {} ) {\n\tconst [ blockGap ] = useGlobalSetting( 'spacing.blockGap' );\n\tconst hasBlockGapSupport = blockGap !== null;\n\tconst hasFallbackGapSupport = ! hasBlockGapSupport; // This setting isn't useful yet: it exists as a placeholder for a future explicit fallback styles support.\n\tconst disableLayoutStyles = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\treturn !! getSettings().disableLayoutStyles;\n\t} );\n\n\tconst blockContext = useContext( BlockContext );\n\n\tconst isTemplate = blockContext?.templateSlug !== undefined;\n\n\tconst getBlockStyles = useSelect( ( select ) => {\n\t\treturn select( blocksStore ).getBlockStyles;\n\t}, [] );\n\n\treturn useMemo( () => {\n\t\tif ( ! mergedConfig?.styles || ! mergedConfig?.settings ) {\n\t\t\treturn [];\n\t\t}\n\t\tmergedConfig = updateConfigWithSeparator( mergedConfig );\n\n\t\tconst blockSelectors = getBlockSelectors(\n\t\t\tgetBlockTypes(),\n\t\t\tgetBlockStyles\n\t\t);\n\n\t\tconst customProperties = toCustomProperties(\n\t\t\tmergedConfig,\n\t\t\tblockSelectors\n\t\t);\n\t\tconst globalStyles = toStyles(\n\t\t\tmergedConfig,\n\t\t\tblockSelectors,\n\t\t\thasBlockGapSupport,\n\t\t\thasFallbackGapSupport,\n\t\t\tdisableLayoutStyles,\n\t\t\tisTemplate\n\t\t);\n\t\tconst svgs = toSvgFilters( mergedConfig, blockSelectors );\n\n\t\tconst styles = [\n\t\t\t{\n\t\t\t\tcss: customProperties,\n\t\t\t\tisGlobalStyles: true,\n\t\t\t},\n\t\t\t{\n\t\t\t\tcss: globalStyles,\n\t\t\t\tisGlobalStyles: true,\n\t\t\t},\n\t\t\t// Load custom CSS in own stylesheet so that any invalid CSS entered in the input won't break all the global styles in the editor.\n\t\t\t{\n\t\t\t\tcss: mergedConfig.styles.css ?? '',\n\t\t\t\tisGlobalStyles: true,\n\t\t\t},\n\t\t\t{\n\t\t\t\tassets: svgs,\n\t\t\t\t__unstableType: 'svg',\n\t\t\t\tisGlobalStyles: true,\n\t\t\t},\n\t\t];\n\n\t\t// Loop through the blocks to check if there are custom CSS values.\n\t\t// If there are, get the block selector and push the selector together with\n\t\t// the CSS value to the 'stylesheets' array.\n\t\tgetBlockTypes().forEach( ( blockType ) => {\n\t\t\tif ( mergedConfig.styles.blocks[ blockType.name ]?.css ) {\n\t\t\t\tconst selector = blockSelectors[ blockType.name ].selector;\n\t\t\t\tstyles.push( {\n\t\t\t\t\tcss: processCSSNesting(\n\t\t\t\t\t\tmergedConfig.styles.blocks[ blockType.name ]?.css,\n\t\t\t\t\t\tselector\n\t\t\t\t\t),\n\t\t\t\t\tisGlobalStyles: true,\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\n\t\treturn [ styles, mergedConfig.settings ];\n\t}, [\n\t\thasBlockGapSupport,\n\t\thasFallbackGapSupport,\n\t\tmergedConfig,\n\t\tdisableLayoutStyles,\n\t] );\n}\n\n/**\n * Returns the global styles output based on the current state of global styles config loaded in the editor context.\n *\n * @return {Array} Array of stylesheets and settings.\n */\nexport function useGlobalStylesOutput() {\n\tconst { merged: mergedConfig } = useContext( GlobalStylesContext );\n\treturn useGlobalStylesOutputWithConfig( mergedConfig );\n}\n"],"mappings":";;;;;;;;;;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AAOA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AAKA,IAAAI,MAAA,GAAAJ,OAAA;AAMA,IAAAK,oBAAA,GAAAL,OAAA;AACA,IAAAM,gBAAA,GAAAN,OAAA;AAIA,IAAAO,QAAA,GAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,OAAA,GAAAT,OAAA;AACA,IAAAU,IAAA,GAAAV,OAAA;AACA,IAAAW,MAAA,GAAAX,OAAA;AACA,IAAAY,YAAA,GAAAZ,OAAA;AACA,IAAAa,OAAA,GAAAb,OAAA;AAKA,IAAAc,aAAA,GAAAC,sBAAA,CAAAf,OAAA;AAvCA;AACA;AACA;;AAYA;AACA;AACA;;AAyBA;AACA;AACA,MAAMgB,qCAAqC,GAAG;EAC7CC,oBAAoB,EAAE,QAAQ;EAC9BC,KAAK,EAAE,OAAO;EACdC,OAAO,EAAE,SAAS;EAClBC,UAAU,EAAE;AACb,CAAC;AAED,SAASC,iBAAiBA,CAAEC,eAAe,EAAG;EAC7C,MAAMC,yBAAyB,GAAG,MAAM;EACxC,MAAMC,uCAAuC,GAAG,GAAG;EACnD,MAAMC,mCAAmC,GAAG,IAAI;EAEhD,IAAKH,eAAe,EAAEI,UAAU,GAAIH,yBAA0B,CA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D,CAAC;UACDyM,cAAc,EAAE;QACjB,CAAE,CAAC;MACJ;IACD,CAAE,CAAC;IAEH,OAAO,CAAE5K,MAAM,EAAE2J,YAAY,CAACtH,QAAQ,CAAE;EACzC,CAAC,EAAE,CACFK,kBAAkB,EAClBC,qBAAqB,EACrBgH,YAAY,EACZvD,mBAAmB,CAClB,CAAC;AACJ;;AAEA;AACA;AACA;AACA;AACA;AACO,SAAS2E,qBAAqBA,CAAA,EAAG;EACvC,MAAM;IAAEC,MAAM,EAAErB;EAAa,CAAC,GAAG,IAAAO,mBAAU,EAAEe,4BAAoB,CAAC;EAClE,OAAOvB,+BAA+B,CAAEC,YAAa,CAAC;AACvD"}
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.STYLE_PATH_TO_PRESET_BLOCK_ATTRIBUTE = exports.STYLE_PATH_TO_CSS_VAR_INFIX = exports.ROOT_BLOCK_SUPPORTS = exports.ROOT_BLOCK_SELECTOR = exports.ROOT_BLOCK_NAME = exports.PRESET_METADATA = void 0;
8
+ exports.appendToSelector = appendToSelector;
8
9
  exports.areGlobalStyleConfigsEqual = areGlobalStyleConfigsEqual;
9
10
  exports.getPresetVariableFromValue = getPresetVariableFromValue;
10
11
  exports.getValueFromVariable = getValueFromVariable;
@@ -295,6 +296,27 @@ function scopeSelector(scope, selector) {
295
296
  return selectorsScoped.join(', ');
296
297
  }
297
298
 
299
+ /**
300
+ * Appends a sub-selector to an existing one.
301
+ *
302
+ * Given the compounded `selector` "h1, h2, h3"
303
+ * and the `toAppend` selector ".some-class" the result will be
304
+ * "h1.some-class, h2.some-class, h3.some-class".
305
+ *
306
+ * @param {string} selector Original selector.
307
+ * @param {string} toAppend Selector to append.
308
+ *
309
+ * @return {string} The new selector.
310
+ */
311
+ function appendToSelector(selector, toAppend) {
312
+ if (!selector.includes(',')) {
313
+ return selector + toAppend;
314
+ }
315
+ const selectors = selector.split(',');
316
+ const newSelectors = selectors.map(sel => sel + toAppend);
317
+ return newSelectors.join(',');
318
+ }
319
+
298
320
  /**
299
321
  * Compares global style variations according to their styles and settings properties.
300
322
  *
@@ -1 +1 @@
1
- {"version":3,"names":["_es","_interopRequireDefault","require","_typographyUtils","_object","ROOT_BLOCK_NAME","exports","ROOT_BLOCK_SELECTOR","ROOT_BLOCK_SUPPORTS","PRESET_METADATA","path","valueKey","cssVarInfix","classes","classSuffix","propertyName","valueFunc","slug","preset","settings","getTypographyFontSizeValue","getFluidTypographyOptionsFromSettings","size","STYLE_PATH_TO_CSS_VAR_INFIX","shadow","STYLE_PATH_TO_PRESET_BLOCK_ATTRIBUTE","findInPresetsBy","features","blockName","presetPath","presetProperty","presetValueValue","orderedPresetsByOrigin","getValueFromObjectPath","presetByOrigin","origins","origin","presets","presetObject","find","highestPresetObjectWithSameSlug","undefined","getPresetVariableFromValue","variableStylePath","presetPropertyValue","metadata","data","getValueFromPresetVariable","variable","presetType","result","getValueFromVariable","getValueFromCustomVariable","_getValueFromObjectPa","ref","refPath","split","USER_VALUE_PREFIX","THEME_VALUE_PREFIX","THEME_VALUE_SUFFIX","parsedVar","startsWith","slice","length","endsWith","type","scopeSelector","scope","selector","scopes","selectors","selectorsScoped","forEach","outer","inner","push","trim","join","areGlobalStyleConfigsEqual","original","variation","fastDeepEqual","styles"],"sources":["@wordpress/block-editor/src/components/global-styles/utils.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport fastDeepEqual from 'fast-deep-equal/es6';\n\n/**\n * Internal dependencies\n */\nimport {\n\tgetTypographyFontSizeValue,\n\tgetFluidTypographyOptionsFromSettings,\n} from './typography-utils';\nimport { getValueFromObjectPath } from '../../utils/object';\n\n/* Supporting data. */\nexport const ROOT_BLOCK_NAME = 'root';\nexport const ROOT_BLOCK_SELECTOR = 'body';\nexport const ROOT_BLOCK_SUPPORTS = [\n\t'background',\n\t'backgroundColor',\n\t'color',\n\t'linkColor',\n\t'captionColor',\n\t'buttonColor',\n\t'headingColor',\n\t'fontFamily',\n\t'fontSize',\n\t'fontStyle',\n\t'fontWeight',\n\t'lineHeight',\n\t'textDecoration',\n\t'textTransform',\n\t'padding',\n];\n\nexport const PRESET_METADATA = [\n\t{\n\t\tpath: [ 'color', 'palette' ],\n\t\tvalueKey: 'color',\n\t\tcssVarInfix: 'color',\n\t\tclasses: [\n\t\t\t{ classSuffix: 'color', propertyName: 'color' },\n\t\t\t{\n\t\t\t\tclassSuffix: 'background-color',\n\t\t\t\tpropertyName: 'background-color',\n\t\t\t},\n\t\t\t{\n\t\t\t\tclassSuffix: 'border-color',\n\t\t\t\tpropertyName: 'border-color',\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\tpath: [ 'color', 'gradients' ],\n\t\tvalueKey: 'gradient',\n\t\tcssVarInfix: 'gradient',\n\t\tclasses: [\n\t\t\t{\n\t\t\t\tclassSuffix: 'gradient-background',\n\t\t\t\tpropertyName: 'background',\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\tpath: [ 'color', 'duotone' ],\n\t\tvalueKey: 'colors',\n\t\tcssVarInfix: 'duotone',\n\t\tvalueFunc: ( { slug } ) => `url( '#wp-duotone-${ slug }' )`,\n\t\tclasses: [],\n\t},\n\t{\n\t\tpath: [ 'shadow', 'presets' ],\n\t\tvalueKey: 'shadow',\n\t\tcssVarInfix: 'shadow',\n\t\tclasses: [],\n\t},\n\t{\n\t\tpath: [ 'typography', 'fontSizes' ],\n\t\tvalueFunc: ( preset, settings ) =>\n\t\t\tgetTypographyFontSizeValue(\n\t\t\t\tpreset,\n\t\t\t\tgetFluidTypographyOptionsFromSettings( settings )\n\t\t\t),\n\t\tvalueKey: 'size',\n\t\tcssVarInfix: 'font-size',\n\t\tclasses: [ { classSuffix: 'font-size', propertyName: 'font-size' } ],\n\t},\n\t{\n\t\tpath: [ 'typography', 'fontFamilies' ],\n\t\tvalueKey: 'fontFamily',\n\t\tcssVarInfix: 'font-family',\n\t\tclasses: [\n\t\t\t{ classSuffix: 'font-family', propertyName: 'font-family' },\n\t\t],\n\t},\n\t{\n\t\tpath: [ 'spacing', 'spacingSizes' ],\n\t\tvalueKey: 'size',\n\t\tcssVarInfix: 'spacing',\n\t\tvalueFunc: ( { size } ) => size,\n\t\tclasses: [],\n\t},\n];\n\nexport const STYLE_PATH_TO_CSS_VAR_INFIX = {\n\t'color.background': 'color',\n\t'color.text': 'color',\n\t'filter.duotone': 'duotone',\n\t'elements.link.color.text': 'color',\n\t'elements.link.:hover.color.text': 'color',\n\t'elements.link.typography.fontFamily': 'font-family',\n\t'elements.link.typography.fontSize': 'font-size',\n\t'elements.button.color.text': 'color',\n\t'elements.button.color.background': 'color',\n\t'elements.caption.color.text': 'color',\n\t'elements.button.typography.fontFamily': 'font-family',\n\t'elements.button.typography.fontSize': 'font-size',\n\t'elements.heading.color': 'color',\n\t'elements.heading.color.background': 'color',\n\t'elements.heading.typography.fontFamily': 'font-family',\n\t'elements.heading.gradient': 'gradient',\n\t'elements.heading.color.gradient': 'gradient',\n\t'elements.h1.color': 'color',\n\t'elements.h1.color.background': 'color',\n\t'elements.h1.typography.fontFamily': 'font-family',\n\t'elements.h1.color.gradient': 'gradient',\n\t'elements.h2.color': 'color',\n\t'elements.h2.color.background': 'color',\n\t'elements.h2.typography.fontFamily': 'font-family',\n\t'elements.h2.color.gradient': 'gradient',\n\t'elements.h3.color': 'color',\n\t'elements.h3.color.background': 'color',\n\t'elements.h3.typography.fontFamily': 'font-family',\n\t'elements.h3.color.gradient': 'gradient',\n\t'elements.h4.color': 'color',\n\t'elements.h4.color.background': 'color',\n\t'elements.h4.typography.fontFamily': 'font-family',\n\t'elements.h4.color.gradient': 'gradient',\n\t'elements.h5.color': 'color',\n\t'elements.h5.color.background': 'color',\n\t'elements.h5.typography.fontFamily': 'font-family',\n\t'elements.h5.color.gradient': 'gradient',\n\t'elements.h6.color': 'color',\n\t'elements.h6.color.background': 'color',\n\t'elements.h6.typography.fontFamily': 'font-family',\n\t'elements.h6.color.gradient': 'gradient',\n\t'color.gradient': 'gradient',\n\tshadow: 'shadow',\n\t'typography.fontSize': 'font-size',\n\t'typography.fontFamily': 'font-family',\n};\n\n// A static list of block attributes that store global style preset slugs.\nexport const STYLE_PATH_TO_PRESET_BLOCK_ATTRIBUTE = {\n\t'color.background': 'backgroundColor',\n\t'color.text': 'textColor',\n\t'color.gradient': 'gradient',\n\t'typography.fontSize': 'fontSize',\n\t'typography.fontFamily': 'fontFamily',\n};\n\nfunction findInPresetsBy(\n\tfeatures,\n\tblockName,\n\tpresetPath,\n\tpresetProperty,\n\tpresetValueValue\n) {\n\t// Block presets take priority above root level presets.\n\tconst orderedPresetsByOrigin = [\n\t\tgetValueFromObjectPath( features, [\n\t\t\t'blocks',\n\t\t\tblockName,\n\t\t\t...presetPath,\n\t\t] ),\n\t\tgetValueFromObjectPath( features, presetPath ),\n\t];\n\n\tfor ( const presetByOrigin of orderedPresetsByOrigin ) {\n\t\tif ( presetByOrigin ) {\n\t\t\t// Preset origins ordered by priority.\n\t\t\tconst origins = [ 'custom', 'theme', 'default' ];\n\t\t\tfor ( const origin of origins ) {\n\t\t\t\tconst presets = presetByOrigin[ origin ];\n\t\t\t\tif ( presets ) {\n\t\t\t\t\tconst presetObject = presets.find(\n\t\t\t\t\t\t( preset ) =>\n\t\t\t\t\t\t\tpreset[ presetProperty ] === presetValueValue\n\t\t\t\t\t);\n\t\t\t\t\tif ( presetObject ) {\n\t\t\t\t\t\tif ( presetProperty === 'slug' ) {\n\t\t\t\t\t\t\treturn presetObject;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// If there is a highest priority preset with the same slug but different value the preset we found was overwritten and should be ignored.\n\t\t\t\t\t\tconst highestPresetObjectWithSameSlug = findInPresetsBy(\n\t\t\t\t\t\t\tfeatures,\n\t\t\t\t\t\t\tblockName,\n\t\t\t\t\t\t\tpresetPath,\n\t\t\t\t\t\t\t'slug',\n\t\t\t\t\t\t\tpresetObject.slug\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\thighestPresetObjectWithSameSlug[\n\t\t\t\t\t\t\t\tpresetProperty\n\t\t\t\t\t\t\t] === presetObject[ presetProperty ]\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\treturn presetObject;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport function getPresetVariableFromValue(\n\tfeatures,\n\tblockName,\n\tvariableStylePath,\n\tpresetPropertyValue\n) {\n\tif ( ! presetPropertyValue ) {\n\t\treturn presetPropertyValue;\n\t}\n\n\tconst cssVarInfix = STYLE_PATH_TO_CSS_VAR_INFIX[ variableStylePath ];\n\n\tconst metadata = PRESET_METADATA.find(\n\t\t( data ) => data.cssVarInfix === cssVarInfix\n\t);\n\n\tif ( ! metadata ) {\n\t\t// The property doesn't have preset data\n\t\t// so the value should be returned as it is.\n\t\treturn presetPropertyValue;\n\t}\n\tconst { valueKey, path } = metadata;\n\n\tconst presetObject = findInPresetsBy(\n\t\tfeatures,\n\t\tblockName,\n\t\tpath,\n\t\tvalueKey,\n\t\tpresetPropertyValue\n\t);\n\n\tif ( ! presetObject ) {\n\t\t// Value wasn't found in the presets,\n\t\t// so it must be a custom value.\n\t\treturn presetPropertyValue;\n\t}\n\n\treturn `var:preset|${ cssVarInfix }|${ presetObject.slug }`;\n}\n\nfunction getValueFromPresetVariable(\n\tfeatures,\n\tblockName,\n\tvariable,\n\t[ presetType, slug ]\n) {\n\tconst metadata = PRESET_METADATA.find(\n\t\t( data ) => data.cssVarInfix === presetType\n\t);\n\tif ( ! metadata ) {\n\t\treturn variable;\n\t}\n\n\tconst presetObject = findInPresetsBy(\n\t\tfeatures.settings,\n\t\tblockName,\n\t\tmetadata.path,\n\t\t'slug',\n\t\tslug\n\t);\n\n\tif ( presetObject ) {\n\t\tconst { valueKey } = metadata;\n\t\tconst result = presetObject[ valueKey ];\n\t\treturn getValueFromVariable( features, blockName, result );\n\t}\n\n\treturn variable;\n}\n\nfunction getValueFromCustomVariable( features, blockName, variable, path ) {\n\tconst result =\n\t\tgetValueFromObjectPath( features.settings, [\n\t\t\t'blocks',\n\t\t\tblockName,\n\t\t\t'custom',\n\t\t\t...path,\n\t\t] ) ??\n\t\tgetValueFromObjectPath( features.settings, [ 'custom', ...path ] );\n\tif ( ! result ) {\n\t\treturn variable;\n\t}\n\t// A variable may reference another variable so we need recursion until we find the value.\n\treturn getValueFromVariable( features, blockName, result );\n}\n\n/**\n * Attempts to fetch the value of a theme.json CSS variable.\n *\n * @param {Object} features GlobalStylesContext config, e.g., user, base or merged. Represents the theme.json tree.\n * @param {string} blockName The name of a block as represented in the styles property. E.g., 'root' for root-level, and 'core/${blockName}' for blocks.\n * @param {string|*} variable An incoming style value. A CSS var value is expected, but it could be any value.\n * @return {string|*|{ref}} The value of the CSS var, if found. If not found, the passed variable argument.\n */\nexport function getValueFromVariable( features, blockName, variable ) {\n\tif ( ! variable || typeof variable !== 'string' ) {\n\t\tif ( variable?.ref && typeof variable?.ref === 'string' ) {\n\t\t\tconst refPath = variable.ref.split( '.' );\n\t\t\tvariable = getValueFromObjectPath( features, refPath );\n\t\t\t// Presence of another ref indicates a reference to another dynamic value.\n\t\t\t// Pointing to another dynamic value is not supported.\n\t\t\tif ( ! variable || !! variable?.ref ) {\n\t\t\t\treturn variable;\n\t\t\t}\n\t\t} else {\n\t\t\treturn variable;\n\t\t}\n\t}\n\tconst USER_VALUE_PREFIX = 'var:';\n\tconst THEME_VALUE_PREFIX = 'var(--wp--';\n\tconst THEME_VALUE_SUFFIX = ')';\n\n\tlet parsedVar;\n\n\tif ( variable.startsWith( USER_VALUE_PREFIX ) ) {\n\t\tparsedVar = variable.slice( USER_VALUE_PREFIX.length ).split( '|' );\n\t} else if (\n\t\tvariable.startsWith( THEME_VALUE_PREFIX ) &&\n\t\tvariable.endsWith( THEME_VALUE_SUFFIX )\n\t) {\n\t\tparsedVar = variable\n\t\t\t.slice( THEME_VALUE_PREFIX.length, -THEME_VALUE_SUFFIX.length )\n\t\t\t.split( '--' );\n\t} else {\n\t\t// We don't know how to parse the value: either is raw of uses complex CSS such as `calc(1px * var(--wp--variable) )`\n\t\treturn variable;\n\t}\n\n\tconst [ type, ...path ] = parsedVar;\n\tif ( type === 'preset' ) {\n\t\treturn getValueFromPresetVariable(\n\t\t\tfeatures,\n\t\t\tblockName,\n\t\t\tvariable,\n\t\t\tpath\n\t\t);\n\t}\n\tif ( type === 'custom' ) {\n\t\treturn getValueFromCustomVariable(\n\t\t\tfeatures,\n\t\t\tblockName,\n\t\t\tvariable,\n\t\t\tpath\n\t\t);\n\t}\n\treturn variable;\n}\n\n/**\n * Function that scopes a selector with another one. This works a bit like\n * SCSS nesting except the `&` operator isn't supported.\n *\n * @example\n * ```js\n * const scope = '.a, .b .c';\n * const selector = '> .x, .y';\n * const merged = scopeSelector( scope, selector );\n * // merged is '.a > .x, .a .y, .b .c > .x, .b .c .y'\n * ```\n *\n * @param {string} scope Selector to scope to.\n * @param {string} selector Original selector.\n *\n * @return {string} Scoped selector.\n */\nexport function scopeSelector( scope, selector ) {\n\tconst scopes = scope.split( ',' );\n\tconst selectors = selector.split( ',' );\n\n\tconst selectorsScoped = [];\n\tscopes.forEach( ( outer ) => {\n\t\tselectors.forEach( ( inner ) => {\n\t\t\tselectorsScoped.push( `${ outer.trim() } ${ inner.trim() }` );\n\t\t} );\n\t} );\n\n\treturn selectorsScoped.join( ', ' );\n}\n\n/**\n * Compares global style variations according to their styles and settings properties.\n *\n * @example\n * ```js\n * const globalStyles = { styles: { typography: { fontSize: '10px' } }, settings: {} };\n * const variation = { styles: { typography: { fontSize: '10000px' } }, settings: {} };\n * const isEqual = areGlobalStyleConfigsEqual( globalStyles, variation );\n * // false\n * ```\n *\n * @param {Object} original A global styles object.\n * @param {Object} variation A global styles object.\n *\n * @return {boolean} Whether `original` and `variation` match.\n */\nexport function areGlobalStyleConfigsEqual( original, variation ) {\n\tif ( typeof original !== 'object' || typeof variation !== 'object' ) {\n\t\treturn original === variation;\n\t}\n\treturn (\n\t\tfastDeepEqual( original?.styles, variation?.styles ) &&\n\t\tfastDeepEqual( original?.settings, variation?.settings )\n\t);\n}\n"],"mappings":";;;;;;;;;;;AAGA,IAAAA,GAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,gBAAA,GAAAD,OAAA;AAIA,IAAAE,OAAA,GAAAF,OAAA;AAZA;AACA;AACA;;AAGA;AACA;AACA;;AAOA;AACO,MAAMG,eAAe,GAAG,MAAM;AAACC,OAAA,CAAAD,eAAA,GAAAA,eAAA;AAC/B,MAAME,mBAAmB,GAAG,MAAM;AAACD,OAAA,CAAAC,mBAAA,GAAAA,mBAAA;AACnC,MAAMC,mBAAmB,GAAG,CAClC,YAAY,EACZ,iBAAiB,EACjB,OAAO,EACP,WAAW,EACX,cAAc,EACd,aAAa,EACb,cAAc,EACd,YAAY,EACZ,UAAU,EACV,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,SAAS,CACT;AAACF,OAAA,CAAAE,mBAAA,GAAAA,mBAAA;AAEK,MAAMC,eAAe,GAAG,CAC9B;EACCC,IAAI,EAAE,CAAE,OAAO,EAAE,SAAS,CAAE;EAC5BC,QAAQ,EAAE,OAAO;EACjBC,WAAW,EAAE,OAAO;EACpBC,OAAO,EAAE,CACR;IAAEC,WAAW,EAAE,OAAO;IAAEC,YAAY,EAAE;EAAQ,CAAC,EAC/C;IACCD,WAAW,EAAE,kBAAkB;IAC/BC,YAAY,EAAE;EACf,CAAC,EACD;IACCD,WAAW,EAAE,cAAc;IAC3BC,YAAY,EAAE;EACf,CAAC;AAEH,CAAC,EACD;EACCL,IAAI,EAAE,CAAE,OAAO,EAAE,WAAW,CAAE;EAC9BC,QAAQ,EAAE,UAAU;EACpBC,WAAW,EAAE,UAAU;EACvBC,OAAO,EAAE,CACR;IACCC,WAAW,EAAE,qBAAqB;IAClCC,YAAY,EAAE;EACf,CAAC;AAEH,CAAC,E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C/BH,eAAe,CAACI,IAAI,CAAG,GAAGF,KAAK,CAACG,IAAI,CAAC,CAAG,IAAIF,KAAK,CAACE,IAAI,CAAC,CAAG,EAAE,CAAC;IAC9D,CAAE,CAAC;EACJ,CAAE,CAAC;EAEH,OAAOL,eAAe,CAACM,IAAI,CAAE,IAAK,CAAC;AACpC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,0BAA0BA,CAAEC,QAAQ,EAAEC,SAAS,EAAG;EACjE,IAAK,OAAOD,QAAQ,KAAK,QAAQ,IAAI,OAAOC,SAAS,KAAK,QAAQ,EAAG;IACpE,OAAOD,QAAQ,KAAKC,SAAS;EAC9B;EACA,OACC,IAAAC,WAAa,EAAEF,QAAQ,EAAEG,MAAM,EAAEF,SAAS,EAAEE,MAAO,CAAC,IACpD,IAAAD,WAAa,EAAEF,QAAQ,EAAE5D,QAAQ,EAAE6D,SAAS,EAAE7D,QAAS,CAAC;AAE1D"}
1
+ {"version":3,"names":["_es","_interopRequireDefault","require","_typographyUtils","_object","ROOT_BLOCK_NAME","exports","ROOT_BLOCK_SELECTOR","ROOT_BLOCK_SUPPORTS","PRESET_METADATA","path","valueKey","cssVarInfix","classes","classSuffix","propertyName","valueFunc","slug","preset","settings","getTypographyFontSizeValue","getFluidTypographyOptionsFromSettings","size","STYLE_PATH_TO_CSS_VAR_INFIX","shadow","STYLE_PATH_TO_PRESET_BLOCK_ATTRIBUTE","findInPresetsBy","features","blockName","presetPath","presetProperty","presetValueValue","orderedPresetsByOrigin","getValueFromObjectPath","presetByOrigin","origins","origin","presets","presetObject","find","highestPresetObjectWithSameSlug","undefined","getPresetVariableFromValue","variableStylePath","presetPropertyValue","metadata","data","getValueFromPresetVariable","variable","presetType","result","getValueFromVariable","getValueFromCustomVariable","_getValueFromObjectPa","ref","refPath","split","USER_VALUE_PREFIX","THEME_VALUE_PREFIX","THEME_VALUE_SUFFIX","parsedVar","startsWith","slice","length","endsWith","type","scopeSelector","scope","selector","scopes","selectors","selectorsScoped","forEach","outer","inner","push","trim","join","appendToSelector","toAppend","includes","newSelectors","map","sel","areGlobalStyleConfigsEqual","original","variation","fastDeepEqual","styles"],"sources":["@wordpress/block-editor/src/components/global-styles/utils.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport fastDeepEqual from 'fast-deep-equal/es6';\n\n/**\n * Internal dependencies\n */\nimport {\n\tgetTypographyFontSizeValue,\n\tgetFluidTypographyOptionsFromSettings,\n} from './typography-utils';\nimport { getValueFromObjectPath } from '../../utils/object';\n\n/* Supporting data. */\nexport const ROOT_BLOCK_NAME = 'root';\nexport const ROOT_BLOCK_SELECTOR = 'body';\nexport const ROOT_BLOCK_SUPPORTS = [\n\t'background',\n\t'backgroundColor',\n\t'color',\n\t'linkColor',\n\t'captionColor',\n\t'buttonColor',\n\t'headingColor',\n\t'fontFamily',\n\t'fontSize',\n\t'fontStyle',\n\t'fontWeight',\n\t'lineHeight',\n\t'textDecoration',\n\t'textTransform',\n\t'padding',\n];\n\nexport const PRESET_METADATA = [\n\t{\n\t\tpath: [ 'color', 'palette' ],\n\t\tvalueKey: 'color',\n\t\tcssVarInfix: 'color',\n\t\tclasses: [\n\t\t\t{ classSuffix: 'color', propertyName: 'color' },\n\t\t\t{\n\t\t\t\tclassSuffix: 'background-color',\n\t\t\t\tpropertyName: 'background-color',\n\t\t\t},\n\t\t\t{\n\t\t\t\tclassSuffix: 'border-color',\n\t\t\t\tpropertyName: 'border-color',\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\tpath: [ 'color', 'gradients' ],\n\t\tvalueKey: 'gradient',\n\t\tcssVarInfix: 'gradient',\n\t\tclasses: [\n\t\t\t{\n\t\t\t\tclassSuffix: 'gradient-background',\n\t\t\t\tpropertyName: 'background',\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\tpath: [ 'color', 'duotone' ],\n\t\tvalueKey: 'colors',\n\t\tcssVarInfix: 'duotone',\n\t\tvalueFunc: ( { slug } ) => `url( '#wp-duotone-${ slug }' )`,\n\t\tclasses: [],\n\t},\n\t{\n\t\tpath: [ 'shadow', 'presets' ],\n\t\tvalueKey: 'shadow',\n\t\tcssVarInfix: 'shadow',\n\t\tclasses: [],\n\t},\n\t{\n\t\tpath: [ 'typography', 'fontSizes' ],\n\t\tvalueFunc: ( preset, settings ) =>\n\t\t\tgetTypographyFontSizeValue(\n\t\t\t\tpreset,\n\t\t\t\tgetFluidTypographyOptionsFromSettings( settings )\n\t\t\t),\n\t\tvalueKey: 'size',\n\t\tcssVarInfix: 'font-size',\n\t\tclasses: [ { classSuffix: 'font-size', propertyName: 'font-size' } ],\n\t},\n\t{\n\t\tpath: [ 'typography', 'fontFamilies' ],\n\t\tvalueKey: 'fontFamily',\n\t\tcssVarInfix: 'font-family',\n\t\tclasses: [\n\t\t\t{ classSuffix: 'font-family', propertyName: 'font-family' },\n\t\t],\n\t},\n\t{\n\t\tpath: [ 'spacing', 'spacingSizes' ],\n\t\tvalueKey: 'size',\n\t\tcssVarInfix: 'spacing',\n\t\tvalueFunc: ( { size } ) => size,\n\t\tclasses: [],\n\t},\n];\n\nexport const STYLE_PATH_TO_CSS_VAR_INFIX = {\n\t'color.background': 'color',\n\t'color.text': 'color',\n\t'filter.duotone': 'duotone',\n\t'elements.link.color.text': 'color',\n\t'elements.link.:hover.color.text': 'color',\n\t'elements.link.typography.fontFamily': 'font-family',\n\t'elements.link.typography.fontSize': 'font-size',\n\t'elements.button.color.text': 'color',\n\t'elements.button.color.background': 'color',\n\t'elements.caption.color.text': 'color',\n\t'elements.button.typography.fontFamily': 'font-family',\n\t'elements.button.typography.fontSize': 'font-size',\n\t'elements.heading.color': 'color',\n\t'elements.heading.color.background': 'color',\n\t'elements.heading.typography.fontFamily': 'font-family',\n\t'elements.heading.gradient': 'gradient',\n\t'elements.heading.color.gradient': 'gradient',\n\t'elements.h1.color': 'color',\n\t'elements.h1.color.background': 'color',\n\t'elements.h1.typography.fontFamily': 'font-family',\n\t'elements.h1.color.gradient': 'gradient',\n\t'elements.h2.color': 'color',\n\t'elements.h2.color.background': 'color',\n\t'elements.h2.typography.fontFamily': 'font-family',\n\t'elements.h2.color.gradient': 'gradient',\n\t'elements.h3.color': 'color',\n\t'elements.h3.color.background': 'color',\n\t'elements.h3.typography.fontFamily': 'font-family',\n\t'elements.h3.color.gradient': 'gradient',\n\t'elements.h4.color': 'color',\n\t'elements.h4.color.background': 'color',\n\t'elements.h4.typography.fontFamily': 'font-family',\n\t'elements.h4.color.gradient': 'gradient',\n\t'elements.h5.color': 'color',\n\t'elements.h5.color.background': 'color',\n\t'elements.h5.typography.fontFamily': 'font-family',\n\t'elements.h5.color.gradient': 'gradient',\n\t'elements.h6.color': 'color',\n\t'elements.h6.color.background': 'color',\n\t'elements.h6.typography.fontFamily': 'font-family',\n\t'elements.h6.color.gradient': 'gradient',\n\t'color.gradient': 'gradient',\n\tshadow: 'shadow',\n\t'typography.fontSize': 'font-size',\n\t'typography.fontFamily': 'font-family',\n};\n\n// A static list of block attributes that store global style preset slugs.\nexport const STYLE_PATH_TO_PRESET_BLOCK_ATTRIBUTE = {\n\t'color.background': 'backgroundColor',\n\t'color.text': 'textColor',\n\t'color.gradient': 'gradient',\n\t'typography.fontSize': 'fontSize',\n\t'typography.fontFamily': 'fontFamily',\n};\n\nfunction findInPresetsBy(\n\tfeatures,\n\tblockName,\n\tpresetPath,\n\tpresetProperty,\n\tpresetValueValue\n) {\n\t// Block presets take priority above root level presets.\n\tconst orderedPresetsByOrigin = [\n\t\tgetValueFromObjectPath( features, [\n\t\t\t'blocks',\n\t\t\tblockName,\n\t\t\t...presetPath,\n\t\t] ),\n\t\tgetValueFromObjectPath( features, presetPath ),\n\t];\n\n\tfor ( const presetByOrigin of orderedPresetsByOrigin ) {\n\t\tif ( presetByOrigin ) {\n\t\t\t// Preset origins ordered by priority.\n\t\t\tconst origins = [ 'custom', 'theme', 'default' ];\n\t\t\tfor ( const origin of origins ) {\n\t\t\t\tconst presets = presetByOrigin[ origin ];\n\t\t\t\tif ( presets ) {\n\t\t\t\t\tconst presetObject = presets.find(\n\t\t\t\t\t\t( preset ) =>\n\t\t\t\t\t\t\tpreset[ presetProperty ] === presetValueValue\n\t\t\t\t\t);\n\t\t\t\t\tif ( presetObject ) {\n\t\t\t\t\t\tif ( presetProperty === 'slug' ) {\n\t\t\t\t\t\t\treturn presetObject;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// If there is a highest priority preset with the same slug but different value the preset we found was overwritten and should be ignored.\n\t\t\t\t\t\tconst highestPresetObjectWithSameSlug = findInPresetsBy(\n\t\t\t\t\t\t\tfeatures,\n\t\t\t\t\t\t\tblockName,\n\t\t\t\t\t\t\tpresetPath,\n\t\t\t\t\t\t\t'slug',\n\t\t\t\t\t\t\tpresetObject.slug\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\thighestPresetObjectWithSameSlug[\n\t\t\t\t\t\t\t\tpresetProperty\n\t\t\t\t\t\t\t] === presetObject[ presetProperty ]\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\treturn presetObject;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport function getPresetVariableFromValue(\n\tfeatures,\n\tblockName,\n\tvariableStylePath,\n\tpresetPropertyValue\n) {\n\tif ( ! presetPropertyValue ) {\n\t\treturn presetPropertyValue;\n\t}\n\n\tconst cssVarInfix = STYLE_PATH_TO_CSS_VAR_INFIX[ variableStylePath ];\n\n\tconst metadata = PRESET_METADATA.find(\n\t\t( data ) => data.cssVarInfix === cssVarInfix\n\t);\n\n\tif ( ! metadata ) {\n\t\t// The property doesn't have preset data\n\t\t// so the value should be returned as it is.\n\t\treturn presetPropertyValue;\n\t}\n\tconst { valueKey, path } = metadata;\n\n\tconst presetObject = findInPresetsBy(\n\t\tfeatures,\n\t\tblockName,\n\t\tpath,\n\t\tvalueKey,\n\t\tpresetPropertyValue\n\t);\n\n\tif ( ! presetObject ) {\n\t\t// Value wasn't found in the presets,\n\t\t// so it must be a custom value.\n\t\treturn presetPropertyValue;\n\t}\n\n\treturn `var:preset|${ cssVarInfix }|${ presetObject.slug }`;\n}\n\nfunction getValueFromPresetVariable(\n\tfeatures,\n\tblockName,\n\tvariable,\n\t[ presetType, slug ]\n) {\n\tconst metadata = PRESET_METADATA.find(\n\t\t( data ) => data.cssVarInfix === presetType\n\t);\n\tif ( ! metadata ) {\n\t\treturn variable;\n\t}\n\n\tconst presetObject = findInPresetsBy(\n\t\tfeatures.settings,\n\t\tblockName,\n\t\tmetadata.path,\n\t\t'slug',\n\t\tslug\n\t);\n\n\tif ( presetObject ) {\n\t\tconst { valueKey } = metadata;\n\t\tconst result = presetObject[ valueKey ];\n\t\treturn getValueFromVariable( features, blockName, result );\n\t}\n\n\treturn variable;\n}\n\nfunction getValueFromCustomVariable( features, blockName, variable, path ) {\n\tconst result =\n\t\tgetValueFromObjectPath( features.settings, [\n\t\t\t'blocks',\n\t\t\tblockName,\n\t\t\t'custom',\n\t\t\t...path,\n\t\t] ) ??\n\t\tgetValueFromObjectPath( features.settings, [ 'custom', ...path ] );\n\tif ( ! result ) {\n\t\treturn variable;\n\t}\n\t// A variable may reference another variable so we need recursion until we find the value.\n\treturn getValueFromVariable( features, blockName, result );\n}\n\n/**\n * Attempts to fetch the value of a theme.json CSS variable.\n *\n * @param {Object} features GlobalStylesContext config, e.g., user, base or merged. Represents the theme.json tree.\n * @param {string} blockName The name of a block as represented in the styles property. E.g., 'root' for root-level, and 'core/${blockName}' for blocks.\n * @param {string|*} variable An incoming style value. A CSS var value is expected, but it could be any value.\n * @return {string|*|{ref}} The value of the CSS var, if found. If not found, the passed variable argument.\n */\nexport function getValueFromVariable( features, blockName, variable ) {\n\tif ( ! variable || typeof variable !== 'string' ) {\n\t\tif ( variable?.ref && typeof variable?.ref === 'string' ) {\n\t\t\tconst refPath = variable.ref.split( '.' );\n\t\t\tvariable = getValueFromObjectPath( features, refPath );\n\t\t\t// Presence of another ref indicates a reference to another dynamic value.\n\t\t\t// Pointing to another dynamic value is not supported.\n\t\t\tif ( ! variable || !! variable?.ref ) {\n\t\t\t\treturn variable;\n\t\t\t}\n\t\t} else {\n\t\t\treturn variable;\n\t\t}\n\t}\n\tconst USER_VALUE_PREFIX = 'var:';\n\tconst THEME_VALUE_PREFIX = 'var(--wp--';\n\tconst THEME_VALUE_SUFFIX = ')';\n\n\tlet parsedVar;\n\n\tif ( variable.startsWith( USER_VALUE_PREFIX ) ) {\n\t\tparsedVar = variable.slice( USER_VALUE_PREFIX.length ).split( '|' );\n\t} else if (\n\t\tvariable.startsWith( THEME_VALUE_PREFIX ) &&\n\t\tvariable.endsWith( THEME_VALUE_SUFFIX )\n\t) {\n\t\tparsedVar = variable\n\t\t\t.slice( THEME_VALUE_PREFIX.length, -THEME_VALUE_SUFFIX.length )\n\t\t\t.split( '--' );\n\t} else {\n\t\t// We don't know how to parse the value: either is raw of uses complex CSS such as `calc(1px * var(--wp--variable) )`\n\t\treturn variable;\n\t}\n\n\tconst [ type, ...path ] = parsedVar;\n\tif ( type === 'preset' ) {\n\t\treturn getValueFromPresetVariable(\n\t\t\tfeatures,\n\t\t\tblockName,\n\t\t\tvariable,\n\t\t\tpath\n\t\t);\n\t}\n\tif ( type === 'custom' ) {\n\t\treturn getValueFromCustomVariable(\n\t\t\tfeatures,\n\t\t\tblockName,\n\t\t\tvariable,\n\t\t\tpath\n\t\t);\n\t}\n\treturn variable;\n}\n\n/**\n * Function that scopes a selector with another one. This works a bit like\n * SCSS nesting except the `&` operator isn't supported.\n *\n * @example\n * ```js\n * const scope = '.a, .b .c';\n * const selector = '> .x, .y';\n * const merged = scopeSelector( scope, selector );\n * // merged is '.a > .x, .a .y, .b .c > .x, .b .c .y'\n * ```\n *\n * @param {string} scope Selector to scope to.\n * @param {string} selector Original selector.\n *\n * @return {string} Scoped selector.\n */\nexport function scopeSelector( scope, selector ) {\n\tconst scopes = scope.split( ',' );\n\tconst selectors = selector.split( ',' );\n\n\tconst selectorsScoped = [];\n\tscopes.forEach( ( outer ) => {\n\t\tselectors.forEach( ( inner ) => {\n\t\t\tselectorsScoped.push( `${ outer.trim() } ${ inner.trim() }` );\n\t\t} );\n\t} );\n\n\treturn selectorsScoped.join( ', ' );\n}\n\n/**\n * Appends a sub-selector to an existing one.\n *\n * Given the compounded `selector` \"h1, h2, h3\"\n * and the `toAppend` selector \".some-class\" the result will be\n * \"h1.some-class, h2.some-class, h3.some-class\".\n *\n * @param {string} selector Original selector.\n * @param {string} toAppend Selector to append.\n *\n * @return {string} The new selector.\n */\nexport function appendToSelector( selector, toAppend ) {\n\tif ( ! selector.includes( ',' ) ) {\n\t\treturn selector + toAppend;\n\t}\n\tconst selectors = selector.split( ',' );\n\tconst newSelectors = selectors.map( ( sel ) => sel + toAppend );\n\treturn newSelectors.join( ',' );\n}\n\n/**\n * Compares global style variations according to their styles and settings properties.\n *\n * @example\n * ```js\n * const globalStyles = { styles: { typography: { fontSize: '10px' } }, settings: {} };\n * const variation = { styles: { typography: { fontSize: '10000px' } }, settings: {} };\n * const isEqual = areGlobalStyleConfigsEqual( globalStyles, variation );\n * // false\n * ```\n *\n * @param {Object} original A global styles object.\n * @param {Object} variation A global styles object.\n *\n * @return {boolean} Whether `original` and `variation` match.\n */\nexport function areGlobalStyleConfigsEqual( original, variation ) {\n\tif ( typeof original !== 'object' || typeof variation !== 'object' ) {\n\t\treturn original === variation;\n\t}\n\treturn (\n\t\tfastDeepEqual( original?.styles, variation?.styles ) &&\n\t\tfastDeepEqual( original?.settings, variation?.settings )\n\t);\n}\n"],"mappings":";;;;;;;;;;;;AAGA,IAAAA,GAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,gBAAA,GAAAD,OAAA;AAIA,IAAAE,OAAA,GAAAF,OAAA;AAZA;AACA;AACA;;AAGA;AACA;AACA;;AAOA;AACO,MAAMG,eAAe,GA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EW,QAAQ,EAAG;EACtD,IAAK,CAAEX,QAAQ,CAACY,QAAQ,CAAE,GAAI,CAAC,EAAG;IACjC,OAAOZ,QAAQ,GAAGW,QAAQ;EAC3B;EACA,MAAMT,SAAS,GAAGF,QAAQ,CAACZ,KAAK,CAAE,GAAI,CAAC;EACvC,MAAMyB,YAAY,GAAGX,SAAS,CAACY,GAAG,CAAIC,GAAG,IAAMA,GAAG,GAAGJ,QAAS,CAAC;EAC/D,OAAOE,YAAY,CAACJ,IAAI,CAAE,GAAI,CAAC;AAChC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASO,0BAA0BA,CAAEC,QAAQ,EAAEC,SAAS,EAAG;EACjE,IAAK,OAAOD,QAAQ,KAAK,QAAQ,IAAI,OAAOC,SAAS,KAAK,QAAQ,EAAG;IACpE,OAAOD,QAAQ,KAAKC,SAAS;EAC9B;EACA,OACC,IAAAC,WAAa,EAAEF,QAAQ,EAAEG,MAAM,EAAEF,SAAS,EAAEE,MAAO,CAAC,IACpD,IAAAD,WAAa,EAAEF,QAAQ,EAAElE,QAAQ,EAAEmE,SAAS,EAAEnE,QAAS,CAAC;AAE1D"}
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.withGradient = void 0;
7
- var _element = require("@wordpress/element");
7
+ var _react = require("react");
8
8
  var _useGradient = require("./use-gradient");
9
9
  /**
10
10
  * Internal dependencies
@@ -14,7 +14,7 @@ const withGradient = WrappedComponent => props => {
14
14
  const {
15
15
  gradientValue
16
16
  } = (0, _useGradient.__experimentalUseGradient)();
17
- return (0, _element.createElement)(WrappedComponent, {
17
+ return (0, _react.createElement)(WrappedComponent, {
18
18
  ...props,
19
19
  gradientValue: gradientValue
20
20
  });
@@ -1 +1 @@
1
- {"version":3,"names":["_useGradient","require","withGradient","WrappedComponent","props","gradientValue","__experimentalUseGradient","_element","createElement","exports"],"sources":["@wordpress/block-editor/src/components/gradients/with-gradient.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { __experimentalUseGradient } from './use-gradient';\n\nexport const withGradient = ( WrappedComponent ) => ( props ) => {\n\tconst { gradientValue } = __experimentalUseGradient();\n\treturn <WrappedComponent { ...props } gradientValue={ gradientValue } />;\n};\n"],"mappings":";;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGO,MAAMC,YAAY,GAAKC,gBAAgB,IAAQC,KAAK,IAAM;EAChE,MAAM;IAAEC;EAAc,CAAC,GAAG,IAAAC,sCAAyB,EAAC,CAAC;EACrD,OAAO,IAAAC,QAAA,CAAAC,aAAA,EAACL,gBAAgB;IAAA,GAAMC,KAAK;IAAGC,aAAa,EAAGA;EAAe,CAAE,CAAC;AACzE,CAAC;AAACI,OAAA,CAAAP,YAAA,GAAAA,YAAA"}
1
+ {"version":3,"names":["_useGradient","require","withGradient","WrappedComponent","props","gradientValue","__experimentalUseGradient","_react","createElement","exports"],"sources":["@wordpress/block-editor/src/components/gradients/with-gradient.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { __experimentalUseGradient } from './use-gradient';\n\nexport const withGradient = ( WrappedComponent ) => ( props ) => {\n\tconst { gradientValue } = __experimentalUseGradient();\n\treturn <WrappedComponent { ...props } gradientValue={ gradientValue } />;\n};\n"],"mappings":";;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGO,MAAMC,YAAY,GAAKC,gBAAgB,IAAQC,KAAK,IAAM;EAChE,MAAM;IAAEC;EAAc,CAAC,GAAG,IAAAC,sCAAyB,EAAC,CAAC;EACrD,OAAO,IAAAC,MAAA,CAAAC,aAAA,EAACL,gBAAgB;IAAA,GAAMC,KAAK;IAAGC,aAAa,EAAGA;EAAe,CAAE,CAAC;AACzE,CAAC;AAACI,OAAA,CAAAP,YAAA,GAAAA,YAAA"}
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.default = HeightControl;
8
+ var _react = require("react");
8
9
  var _element = require("@wordpress/element");
9
10
  var _components = require("@wordpress/components");
10
11
  var _i18n = require("@wordpress/i18n");
@@ -54,7 +55,7 @@ const RANGE_CONTROL_CUSTOM_SETTINGS = {
54
55
  * @param {( value: string ) => void } props.onChange Called when the height changes.
55
56
  * @param {string} props.value The current height value.
56
57
  *
57
- * @return {WPComponent} The component to be rendered.
58
+ * @return {Component} The component to be rendered.
58
59
  */
59
60
  function HeightControl({
60
61
  label = (0, _i18n.__)('Height'),
@@ -85,25 +86,25 @@ function HeightControl({
85
86
  onChange(100 + newUnit);
86
87
  }
87
88
  };
88
- return (0, _element.createElement)("fieldset", {
89
+ return (0, _react.createElement)("fieldset", {
89
90
  className: "block-editor-height-control"
90
- }, (0, _element.createElement)(_components.BaseControl.VisualLabel, {
91
+ }, (0, _react.createElement)(_components.BaseControl.VisualLabel, {
91
92
  as: "legend"
92
- }, label), (0, _element.createElement)(_components.Flex, null, (0, _element.createElement)(_components.FlexItem, {
93
+ }, label), (0, _react.createElement)(_components.Flex, null, (0, _react.createElement)(_components.FlexItem, {
93
94
  isBlock: true
94
- }, (0, _element.createElement)(_components.__experimentalUnitControl, {
95
+ }, (0, _react.createElement)(_components.__experimentalUnitControl, {
95
96
  value: value,
96
97
  units: units,
97
98
  onChange: onChange,
98
99
  onUnitChange: handleUnitChange,
99
100
  min: 0,
100
101
  size: '__unstable-large'
101
- })), (0, _element.createElement)(_components.FlexItem, {
102
+ })), (0, _react.createElement)(_components.FlexItem, {
102
103
  isBlock: true
103
- }, (0, _element.createElement)(_components.__experimentalSpacer, {
104
+ }, (0, _react.createElement)(_components.__experimentalSpacer, {
104
105
  marginX: 2,
105
106
  marginBottom: 0
106
- }, (0, _element.createElement)(_components.RangeControl, {
107
+ }, (0, _react.createElement)(_components.RangeControl, {
107
108
  value: customRangeValue,
108
109
  min: 0,
109
110
  max: (_RANGE_CONTROL_CUSTOM = RANGE_CONTROL_CUSTOM_SETTINGS[selectedUnit]?.max) !== null && _RANGE_CONTROL_CUSTOM !== void 0 ? _RANGE_CONTROL_CUSTOM : 100,