@wordpress/block-editor 12.3.0 → 12.3.2

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 (971) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/README.md +13 -0
  3. package/build/autocompleters/block.js +5 -3
  4. package/build/autocompleters/block.js.map +1 -1
  5. package/build/components/alignment-control/index.js +4 -6
  6. package/build/components/alignment-control/index.js.map +1 -1
  7. package/build/components/alignment-control/ui.js +5 -9
  8. package/build/components/alignment-control/ui.js.map +1 -1
  9. package/build/components/autocomplete/index.js +2 -4
  10. package/build/components/autocomplete/index.js.map +1 -1
  11. package/build/components/block-actions/index.js +4 -0
  12. package/build/components/block-actions/index.js.map +1 -1
  13. package/build/components/block-alignment-control/constants.js +1 -5
  14. package/build/components/block-alignment-control/constants.js.map +1 -1
  15. package/build/components/block-alignment-control/index.js +4 -6
  16. package/build/components/block-alignment-control/index.js.map +1 -1
  17. package/build/components/block-alignment-control/ui.js +3 -4
  18. package/build/components/block-alignment-control/ui.js.map +1 -1
  19. package/build/components/block-alignment-control/ui.native.js +3 -3
  20. package/build/components/block-alignment-control/ui.native.js.map +1 -1
  21. package/build/components/block-alignment-matrix-control/index.js +0 -1
  22. package/build/components/block-alignment-matrix-control/index.js.map +1 -1
  23. package/build/components/block-breadcrumb/index.js +2 -3
  24. package/build/components/block-breadcrumb/index.js.map +1 -1
  25. package/build/components/block-controls/fill.js +2 -1
  26. package/build/components/block-controls/fill.js.map +1 -1
  27. package/build/components/block-controls/index.js +8 -8
  28. package/build/components/block-controls/index.js.map +1 -1
  29. package/build/components/block-controls/slot.js +2 -4
  30. package/build/components/block-controls/slot.js.map +1 -1
  31. package/build/components/block-controls/slot.native.js +4 -2
  32. package/build/components/block-controls/slot.native.js.map +1 -1
  33. package/build/components/block-edit/edit.js +4 -6
  34. package/build/components/block-edit/edit.js.map +1 -1
  35. package/build/components/block-edit/edit.native.js +2 -4
  36. package/build/components/block-edit/edit.native.js.map +1 -1
  37. package/build/components/block-edit/index.js +3 -2
  38. package/build/components/block-edit/index.js.map +1 -1
  39. package/build/components/block-heading-level-dropdown/heading-level-icon.js +47 -0
  40. package/build/components/block-heading-level-dropdown/heading-level-icon.js.map +1 -0
  41. package/build/components/block-heading-level-dropdown/index.js +83 -0
  42. package/build/components/block-heading-level-dropdown/index.js.map +1 -0
  43. package/build/components/block-heading-level-dropdown/index.native.js +72 -0
  44. package/build/components/block-heading-level-dropdown/index.native.js.map +1 -0
  45. package/build/components/block-icon/index.native.js +6 -7
  46. package/build/components/block-icon/index.native.js.map +1 -1
  47. package/build/components/block-info-slot-fill/index.js +4 -2
  48. package/build/components/block-info-slot-fill/index.js.map +1 -1
  49. package/build/components/block-inspector/index.js +20 -87
  50. package/build/components/block-inspector/index.js.map +1 -1
  51. package/build/components/block-list/block-list-item.native.js +4 -2
  52. package/build/components/block-list/block-list-item.native.js.map +1 -1
  53. package/build/components/block-list/block.js +6 -4
  54. package/build/components/block-list/block.js.map +1 -1
  55. package/build/components/block-list/block.native.js +1 -0
  56. package/build/components/block-list/block.native.js.map +1 -1
  57. package/build/components/block-list/index.js +7 -4
  58. package/build/components/block-list/index.js.map +1 -1
  59. package/build/components/block-list/index.native.js +8 -9
  60. package/build/components/block-list/index.native.js.map +1 -1
  61. package/build/components/block-list/subdirectory-icon.js +4 -7
  62. package/build/components/block-list/subdirectory-icon.js.map +1 -1
  63. package/build/components/block-list/use-in-between-inserter.js +1 -3
  64. package/build/components/block-list/use-in-between-inserter.js.map +1 -1
  65. package/build/components/block-list-appender/index.js +21 -19
  66. package/build/components/block-list-appender/index.js.map +1 -1
  67. package/build/components/block-lock/toolbar.js +25 -6
  68. package/build/components/block-lock/toolbar.js.map +1 -1
  69. package/build/components/block-mobile-toolbar/block-actions-menu.native.js +1 -1
  70. package/build/components/block-mobile-toolbar/block-actions-menu.native.js.map +1 -1
  71. package/build/components/block-mover/button.js +12 -12
  72. package/build/components/block-mover/button.js.map +1 -1
  73. package/build/components/block-mover/index.js +11 -10
  74. package/build/components/block-mover/index.js.map +1 -1
  75. package/build/components/block-navigation/dropdown.js +4 -6
  76. package/build/components/block-navigation/dropdown.js.map +1 -1
  77. package/build/components/block-parent-selector/index.js +4 -5
  78. package/build/components/block-parent-selector/index.js.map +1 -1
  79. package/build/components/block-pattern-setup/index.js +6 -8
  80. package/build/components/block-pattern-setup/index.js.map +1 -1
  81. package/build/components/block-patterns-list/index.js +6 -8
  82. package/build/components/block-patterns-list/index.js.map +1 -1
  83. package/build/components/block-popover/inbetween.js +4 -6
  84. package/build/components/block-popover/inbetween.js.map +1 -1
  85. package/build/components/block-popover/index.js +4 -6
  86. package/build/components/block-popover/index.js.map +1 -1
  87. package/build/components/block-preview/auto.js +2 -4
  88. package/build/components/block-preview/auto.js.map +1 -1
  89. package/build/components/block-preview/index.js +7 -7
  90. package/build/components/block-preview/index.js.map +1 -1
  91. package/build/components/block-quick-navigation/index.js +83 -0
  92. package/build/components/block-quick-navigation/index.js.map +1 -0
  93. package/build/components/block-removal-warning-modal/index.js +90 -0
  94. package/build/components/block-removal-warning-modal/index.js.map +1 -0
  95. package/build/components/block-selection-clearer/index.js +4 -7
  96. package/build/components/block-selection-clearer/index.js.map +1 -1
  97. package/build/components/block-settings/button.native.js +2 -1
  98. package/build/components/block-settings/button.native.js.map +1 -1
  99. package/build/components/block-settings/container.native.js +6 -6
  100. package/build/components/block-settings/container.native.js.map +1 -1
  101. package/build/components/block-settings-menu/block-settings-dropdown.js +10 -11
  102. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  103. package/build/components/block-settings-menu/index.js +4 -5
  104. package/build/components/block-settings-menu/index.js.map +1 -1
  105. package/build/components/block-settings-menu-controls/index.js +4 -5
  106. package/build/components/block-settings-menu-controls/index.js.map +1 -1
  107. package/build/components/block-switcher/index.js +1 -2
  108. package/build/components/block-switcher/index.js.map +1 -1
  109. package/build/components/block-switcher/pattern-transformations-menu.js +6 -8
  110. package/build/components/block-switcher/pattern-transformations-menu.js.map +1 -1
  111. package/build/components/block-toolbar/index.js +10 -8
  112. package/build/components/block-toolbar/index.js.map +1 -1
  113. package/build/components/block-tools/block-contextual-toolbar.js +4 -5
  114. package/build/components/block-tools/block-contextual-toolbar.js.map +1 -1
  115. package/build/components/block-tools/block-selection-button.js +4 -5
  116. package/build/components/block-tools/block-selection-button.js.map +1 -1
  117. package/build/components/block-tools/index.js +13 -6
  118. package/build/components/block-tools/index.js.map +1 -1
  119. package/build/components/block-tools/insertion-point.js +5 -5
  120. package/build/components/block-tools/insertion-point.js.map +1 -1
  121. package/build/components/block-tools/selected-block-popover.js +8 -8
  122. package/build/components/block-tools/selected-block-popover.js.map +1 -1
  123. package/build/components/block-types-list/index.native.js +4 -6
  124. package/build/components/block-types-list/index.native.js.map +1 -1
  125. package/build/components/block-vertical-alignment-control/index.js +4 -6
  126. package/build/components/block-vertical-alignment-control/index.js.map +1 -1
  127. package/build/components/block-vertical-alignment-control/ui.js +5 -12
  128. package/build/components/block-vertical-alignment-control/ui.js.map +1 -1
  129. package/build/components/border-radius-control/all-input-control.js +2 -6
  130. package/build/components/border-radius-control/all-input-control.js.map +1 -1
  131. package/build/components/border-radius-control/input-controls.js +2 -6
  132. package/build/components/border-radius-control/input-controls.js.map +1 -1
  133. package/build/components/border-radius-control/linked-button.js +2 -6
  134. package/build/components/border-radius-control/linked-button.js.map +1 -1
  135. package/build/components/color-palette/control.js +2 -4
  136. package/build/components/color-palette/control.js.map +1 -1
  137. package/build/components/color-palette/with-color-context.js +2 -4
  138. package/build/components/color-palette/with-color-context.js.map +1 -1
  139. package/build/components/colors/utils.js +7 -3
  140. package/build/components/colors/utils.js.map +1 -1
  141. package/build/components/colors/with-colors.js +11 -16
  142. package/build/components/colors/with-colors.js.map +1 -1
  143. package/build/components/colors-gradients/control.js +7 -5
  144. package/build/components/colors-gradients/control.js.map +1 -1
  145. package/build/components/colors-gradients/dropdown.js +12 -11
  146. package/build/components/colors-gradients/dropdown.js.map +1 -1
  147. package/build/components/colors-gradients/panel-color-gradient-settings.js +7 -5
  148. package/build/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
  149. package/build/components/copy-handler/index.js +5 -6
  150. package/build/components/copy-handler/index.js.map +1 -1
  151. package/build/components/dimensions-tool/aspect-ratio-tool.js +99 -0
  152. package/build/components/dimensions-tool/aspect-ratio-tool.js.map +1 -0
  153. package/build/components/dimensions-tool/index.js +207 -0
  154. package/build/components/dimensions-tool/index.js.map +1 -0
  155. package/build/components/dimensions-tool/scale-tool.js +111 -0
  156. package/build/components/dimensions-tool/scale-tool.js.map +1 -0
  157. package/build/components/dimensions-tool/width-height-tool.js +125 -0
  158. package/build/components/dimensions-tool/width-height-tool.js.map +1 -0
  159. package/build/components/duotone-control/index.js +1 -2
  160. package/build/components/duotone-control/index.js.map +1 -1
  161. package/build/components/editable-text/index.js +6 -7
  162. package/build/components/editable-text/index.js.map +1 -1
  163. package/build/components/font-appearance-control/index.js +2 -6
  164. package/build/components/font-appearance-control/index.js.map +1 -1
  165. package/build/components/font-family/index.js +4 -5
  166. package/build/components/font-family/index.js.map +1 -1
  167. package/build/components/font-sizes/font-size-picker.js +2 -4
  168. package/build/components/font-sizes/font-size-picker.js.map +1 -1
  169. package/build/components/font-sizes/utils.js +3 -3
  170. package/build/components/font-sizes/utils.js.map +1 -1
  171. package/build/components/font-sizes/with-font-sizes.js +7 -7
  172. package/build/components/font-sizes/with-font-sizes.js.map +1 -1
  173. package/build/components/global-styles/color-panel.js +15 -16
  174. package/build/components/global-styles/color-panel.js.map +1 -1
  175. package/build/components/global-styles/effects-panel.js +2 -1
  176. package/build/components/global-styles/effects-panel.js.map +1 -1
  177. package/build/components/global-styles/filters-panel.js +2 -1
  178. package/build/components/global-styles/filters-panel.js.map +1 -1
  179. package/build/components/global-styles/index.js +6 -0
  180. package/build/components/global-styles/index.js.map +1 -1
  181. package/build/components/global-styles/typography-panel.js +7 -7
  182. package/build/components/global-styles/typography-panel.js.map +1 -1
  183. package/build/components/global-styles/use-global-styles-output.js +19 -16
  184. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  185. package/build/components/gradients/with-gradient.js +2 -6
  186. package/build/components/gradients/with-gradient.js.map +1 -1
  187. package/build/components/iframe/index.js +5 -7
  188. package/build/components/iframe/index.js.map +1 -1
  189. package/build/components/image-editor/aspect-ratio-dropdown.js +1 -1
  190. package/build/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
  191. package/build/components/image-editor/constants.js +1 -2
  192. package/build/components/image-editor/constants.js.map +1 -1
  193. package/build/components/image-editor/use-save-image.js +1 -2
  194. package/build/components/image-editor/use-save-image.js.map +1 -1
  195. package/build/components/image-size-control/index.js +6 -0
  196. package/build/components/image-size-control/index.js.map +1 -1
  197. package/build/components/index.js +9 -9
  198. package/build/components/index.js.map +1 -1
  199. package/build/components/index.native.js +9 -0
  200. package/build/components/index.native.js.map +1 -1
  201. package/build/components/inner-blocks/index.js +9 -8
  202. package/build/components/inner-blocks/index.js.map +1 -1
  203. package/build/components/inner-blocks/index.native.js +8 -7
  204. package/build/components/inner-blocks/index.native.js.map +1 -1
  205. package/build/components/inner-blocks/use-nested-settings-update.js +24 -30
  206. package/build/components/inner-blocks/use-nested-settings-update.js.map +1 -1
  207. package/build/components/inner-blocks/with-client-id.js +2 -6
  208. package/build/components/inner-blocks/with-client-id.js.map +1 -1
  209. package/build/components/inserter/block-patterns-explorer/explorer.js +2 -1
  210. package/build/components/inserter/block-patterns-explorer/explorer.js.map +1 -1
  211. package/build/components/inserter/block-patterns-tab.js +33 -5
  212. package/build/components/inserter/block-patterns-tab.js.map +1 -1
  213. package/build/components/inserter/hooks/use-block-types-state.js +4 -3
  214. package/build/components/inserter/hooks/use-block-types-state.js.map +1 -1
  215. package/build/components/inserter/hooks/use-insertion-point.js +1 -1
  216. package/build/components/inserter/hooks/use-insertion-point.js.map +1 -1
  217. package/build/components/inserter/index.js +8 -8
  218. package/build/components/inserter/index.js.map +1 -1
  219. package/build/components/inserter/index.native.js +4 -5
  220. package/build/components/inserter/index.native.js.map +1 -1
  221. package/build/components/inserter/library.js +1 -1
  222. package/build/components/inserter/library.js.map +1 -1
  223. package/build/components/inserter/media-tab/media-list.js +2 -6
  224. package/build/components/inserter/media-tab/media-list.js.map +1 -1
  225. package/build/components/inserter/media-tab/media-preview.js +4 -6
  226. package/build/components/inserter/media-tab/media-preview.js.map +1 -1
  227. package/build/components/inserter/media-tab/media-tab.js +1 -1
  228. package/build/components/inserter/media-tab/media-tab.js.map +1 -1
  229. package/build/components/inserter/reusable-blocks-tab.js +3 -3
  230. package/build/components/inserter/reusable-blocks-tab.js.map +1 -1
  231. package/build/components/inserter/tabs.js +3 -3
  232. package/build/components/inserter/tabs.js.map +1 -1
  233. package/build/components/inserter-list-item/index.js +4 -5
  234. package/build/components/inserter-list-item/index.js.map +1 -1
  235. package/build/components/inserter-listbox/group.js +4 -7
  236. package/build/components/inserter-listbox/group.js.map +1 -1
  237. package/build/components/inserter-listbox/item.js +8 -7
  238. package/build/components/inserter-listbox/item.js.map +1 -1
  239. package/build/components/inserter-listbox/row.js +4 -5
  240. package/build/components/inserter-listbox/row.js.map +1 -1
  241. package/build/components/inspector-controls/block-support-slot-container.js +2 -6
  242. package/build/components/inspector-controls/block-support-slot-container.js.map +1 -1
  243. package/build/components/inspector-controls/fill.native.js +2 -1
  244. package/build/components/inspector-controls/fill.native.js.map +1 -1
  245. package/build/components/inspector-controls/index.js +4 -6
  246. package/build/components/inspector-controls/index.js.map +1 -1
  247. package/build/components/inspector-controls/slot.js +4 -6
  248. package/build/components/inspector-controls/slot.js.map +1 -1
  249. package/build/components/inspector-controls/slot.native.js +2 -1
  250. package/build/components/inspector-controls/slot.native.js.map +1 -1
  251. package/build/components/justify-content-control/index.js +4 -6
  252. package/build/components/justify-content-control/index.js.map +1 -1
  253. package/build/components/justify-content-control/ui.js +4 -7
  254. package/build/components/justify-content-control/ui.js.map +1 -1
  255. package/build/components/letter-spacing-control/index.js +2 -4
  256. package/build/components/letter-spacing-control/index.js.map +1 -1
  257. package/build/components/line-height-control/index.js +2 -4
  258. package/build/components/line-height-control/index.js.map +1 -1
  259. package/build/components/link-control/index.js +20 -24
  260. package/build/components/link-control/index.js.map +1 -1
  261. package/build/components/link-control/search-create-button.js +2 -4
  262. package/build/components/link-control/search-create-button.js.map +1 -1
  263. package/build/components/link-control/search-input.js +7 -5
  264. package/build/components/link-control/search-input.js.map +1 -1
  265. package/build/components/link-control/search-item.js +2 -4
  266. package/build/components/link-control/search-item.js.map +1 -1
  267. package/build/components/link-control/search-results.js +2 -4
  268. package/build/components/link-control/search-results.js.map +1 -1
  269. package/build/components/link-control/settings-drawer.js +2 -3
  270. package/build/components/link-control/settings-drawer.js.map +1 -1
  271. package/build/components/list-view/appender.js +4 -6
  272. package/build/components/list-view/appender.js.map +1 -1
  273. package/build/components/list-view/aria-referenced-text.js +4 -8
  274. package/build/components/list-view/aria-referenced-text.js.map +1 -1
  275. package/build/components/list-view/block-contents.js +4 -5
  276. package/build/components/list-view/block-contents.js.map +1 -1
  277. package/build/components/list-view/block-select-button.js +13 -2
  278. package/build/components/list-view/block-select-button.js.map +1 -1
  279. package/build/components/list-view/branch.js +9 -8
  280. package/build/components/list-view/branch.js.map +1 -1
  281. package/build/components/list-view/drop-indicator.js +62 -11
  282. package/build/components/list-view/drop-indicator.js.map +1 -1
  283. package/build/components/list-view/index.js +4 -6
  284. package/build/components/list-view/index.js.map +1 -1
  285. package/build/components/list-view/leaf.js +4 -5
  286. package/build/components/list-view/leaf.js.map +1 -1
  287. package/build/components/list-view/use-list-view-client-ids.js +2 -22
  288. package/build/components/list-view/use-list-view-client-ids.js.map +1 -1
  289. package/build/components/list-view/use-list-view-drop-zone.js +46 -34
  290. package/build/components/list-view/use-list-view-drop-zone.js.map +1 -1
  291. package/build/components/media-placeholder/index.js +38 -13
  292. package/build/components/media-placeholder/index.js.map +1 -1
  293. package/build/components/media-replace-flow/index.js +1 -3
  294. package/build/components/media-replace-flow/index.js.map +1 -1
  295. package/build/components/navigable-toolbar/index.js +8 -8
  296. package/build/components/navigable-toolbar/index.js.map +1 -1
  297. package/build/components/panel-color-settings/index.js +4 -5
  298. package/build/components/panel-color-settings/index.js.map +1 -1
  299. package/build/components/plain-text/index.js +8 -8
  300. package/build/components/plain-text/index.js.map +1 -1
  301. package/build/components/plain-text/index.native.js +7 -6
  302. package/build/components/plain-text/index.native.js.map +1 -1
  303. package/build/components/preview-options/index.js +5 -4
  304. package/build/components/preview-options/index.js.map +1 -1
  305. package/build/components/provider/index.js +2 -4
  306. package/build/components/provider/index.js.map +1 -1
  307. package/build/components/provider/use-block-sync.js +21 -0
  308. package/build/components/provider/use-block-sync.js.map +1 -1
  309. package/build/components/provider/with-registry-provider.js +8 -10
  310. package/build/components/provider/with-registry-provider.js.map +1 -1
  311. package/build/components/publish-date-time-picker/index.js +4 -5
  312. package/build/components/publish-date-time-picker/index.js.map +1 -1
  313. package/build/components/resizable-box-popover/index.js +5 -5
  314. package/build/components/resizable-box-popover/index.js.map +1 -1
  315. package/build/components/resolution-tool/index.js +55 -0
  316. package/build/components/resolution-tool/index.js.map +1 -0
  317. package/build/components/rich-text/content.js +99 -0
  318. package/build/components/rich-text/content.js.map +1 -0
  319. package/build/components/rich-text/format-toolbar/index.js +1 -2
  320. package/build/components/rich-text/format-toolbar/index.js.map +1 -1
  321. package/build/components/rich-text/index.js +8 -42
  322. package/build/components/rich-text/index.js.map +1 -1
  323. package/build/components/rich-text/index.native.js +6 -34
  324. package/build/components/rich-text/index.native.js.map +1 -1
  325. package/build/components/rich-text/toolbar-button.js +2 -6
  326. package/build/components/rich-text/toolbar-button.js.map +1 -1
  327. package/build/components/spacing-sizes-control/index.js +8 -8
  328. package/build/components/spacing-sizes-control/index.js.map +1 -1
  329. package/build/components/tool-selector/index.js +2 -6
  330. package/build/components/tool-selector/index.js.map +1 -1
  331. package/build/components/unit-control/index.js +4 -5
  332. package/build/components/unit-control/index.js.map +1 -1
  333. package/build/components/url-input/index.js +12 -10
  334. package/build/components/url-input/index.js.map +1 -1
  335. package/build/components/url-input/index.native.js +4 -7
  336. package/build/components/url-input/index.native.js.map +1 -1
  337. package/build/components/url-popover/image-url-input-ui.js +21 -14
  338. package/build/components/url-popover/image-url-input-ui.js.map +1 -1
  339. package/build/components/url-popover/index.js +4 -5
  340. package/build/components/url-popover/index.js.map +1 -1
  341. package/build/components/url-popover/link-editor.js +4 -5
  342. package/build/components/url-popover/link-editor.js.map +1 -1
  343. package/build/components/url-popover/link-viewer.js +4 -5
  344. package/build/components/url-popover/link-viewer.js.map +1 -1
  345. package/build/components/use-block-display-information/index.js +30 -2
  346. package/build/components/use-block-display-information/index.js.map +1 -1
  347. package/build/components/video-player/index.native.js +2 -4
  348. package/build/components/video-player/index.native.js.map +1 -1
  349. package/build/components/warning/index.native.js +4 -5
  350. package/build/components/warning/index.native.js.map +1 -1
  351. package/build/components/writing-flow/index.js +2 -4
  352. package/build/components/writing-flow/index.js.map +1 -1
  353. package/build/components/writing-flow/use-drag-selection.js +1 -1
  354. package/build/components/writing-flow/use-drag-selection.js.map +1 -1
  355. package/build/components/writing-flow/use-tab-nav.js +32 -4
  356. package/build/components/writing-flow/use-tab-nav.js.map +1 -1
  357. package/build/hooks/align.js +8 -8
  358. package/build/hooks/align.js.map +1 -1
  359. package/build/hooks/anchor.js +4 -2
  360. package/build/hooks/anchor.js.map +1 -1
  361. package/build/hooks/behaviors.js +75 -37
  362. package/build/hooks/behaviors.js.map +1 -1
  363. package/build/hooks/border.js +4 -5
  364. package/build/hooks/border.js.map +1 -1
  365. package/build/hooks/color.js +4 -5
  366. package/build/hooks/color.js.map +1 -1
  367. package/build/hooks/content-lock-ui.js +8 -10
  368. package/build/hooks/content-lock-ui.js.map +1 -1
  369. package/build/hooks/custom-class-name.js +4 -2
  370. package/build/hooks/custom-class-name.js.map +1 -1
  371. package/build/hooks/dimensions.js +7 -7
  372. package/build/hooks/dimensions.js.map +1 -1
  373. package/build/hooks/duotone.js +5 -5
  374. package/build/hooks/duotone.js.map +1 -1
  375. package/build/hooks/font-family.js +2 -6
  376. package/build/hooks/font-family.js.map +1 -1
  377. package/build/hooks/font-size.js +10 -8
  378. package/build/hooks/font-size.js.map +1 -1
  379. package/build/hooks/layout.js +30 -28
  380. package/build/hooks/layout.js.map +1 -1
  381. package/build/hooks/position.js +24 -16
  382. package/build/hooks/position.js.map +1 -1
  383. package/build/hooks/style.js +8 -5
  384. package/build/hooks/style.js.map +1 -1
  385. package/build/hooks/supports.js +1 -1
  386. package/build/hooks/supports.js.map +1 -1
  387. package/build/hooks/typography.native.js +3 -1
  388. package/build/hooks/typography.native.js.map +1 -1
  389. package/build/hooks/use-typography-props.js +10 -17
  390. package/build/hooks/use-typography-props.js.map +1 -1
  391. package/build/index.js +0 -14
  392. package/build/index.js.map +1 -1
  393. package/build/layouts/constrained.js +3 -1
  394. package/build/layouts/constrained.js.map +1 -1
  395. package/build/layouts/definitions.js +154 -0
  396. package/build/layouts/definitions.js.map +1 -0
  397. package/build/layouts/flex.js +8 -5
  398. package/build/layouts/flex.js.map +1 -1
  399. package/build/layouts/flow.js +3 -1
  400. package/build/layouts/flow.js.map +1 -1
  401. package/build/layouts/grid.js +3 -1
  402. package/build/layouts/grid.js.map +1 -1
  403. package/build/layouts/utils.js +8 -2
  404. package/build/layouts/utils.js.map +1 -1
  405. package/build/private-apis.js +23 -1
  406. package/build/private-apis.js.map +1 -1
  407. package/build/store/actions.js +2 -62
  408. package/build/store/actions.js.map +1 -1
  409. package/build/store/defaults.js +1 -0
  410. package/build/store/defaults.js.map +1 -1
  411. package/build/store/private-actions.js +200 -0
  412. package/build/store/private-actions.js.map +1 -1
  413. package/build/store/private-selectors.js +72 -4
  414. package/build/store/private-selectors.js.map +1 -1
  415. package/build/store/reducer.js +52 -1
  416. package/build/store/reducer.js.map +1 -1
  417. package/build/store/selectors.js +42 -42
  418. package/build/store/selectors.js.map +1 -1
  419. package/build/utils/object.js +39 -0
  420. package/build/utils/object.js.map +1 -1
  421. package/build-module/autocompleters/block.js +5 -3
  422. package/build-module/autocompleters/block.js.map +1 -1
  423. package/build-module/components/alignment-control/index.js +4 -5
  424. package/build-module/components/alignment-control/index.js.map +1 -1
  425. package/build-module/components/alignment-control/ui.js +5 -6
  426. package/build-module/components/alignment-control/ui.js.map +1 -1
  427. package/build-module/components/autocomplete/index.js +2 -3
  428. package/build-module/components/autocomplete/index.js.map +1 -1
  429. package/build-module/components/block-actions/index.js +4 -0
  430. package/build-module/components/block-actions/index.js.map +1 -1
  431. package/build-module/components/block-alignment-control/constants.js +0 -3
  432. package/build-module/components/block-alignment-control/constants.js.map +1 -1
  433. package/build-module/components/block-alignment-control/index.js +4 -5
  434. package/build-module/components/block-alignment-control/index.js.map +1 -1
  435. package/build-module/components/block-alignment-control/ui.js +4 -4
  436. package/build-module/components/block-alignment-control/ui.js.map +1 -1
  437. package/build-module/components/block-alignment-control/ui.native.js +3 -2
  438. package/build-module/components/block-alignment-control/ui.native.js.map +1 -1
  439. package/build-module/components/block-alignment-matrix-control/index.js +0 -1
  440. package/build-module/components/block-alignment-matrix-control/index.js.map +1 -1
  441. package/build-module/components/block-breadcrumb/index.js +2 -3
  442. package/build-module/components/block-breadcrumb/index.js.map +1 -1
  443. package/build-module/components/block-controls/fill.js +2 -1
  444. package/build-module/components/block-controls/fill.js.map +1 -1
  445. package/build-module/components/block-controls/index.js +8 -7
  446. package/build-module/components/block-controls/index.js.map +1 -1
  447. package/build-module/components/block-controls/slot.js +2 -3
  448. package/build-module/components/block-controls/slot.js.map +1 -1
  449. package/build-module/components/block-controls/slot.native.js +4 -2
  450. package/build-module/components/block-controls/slot.native.js.map +1 -1
  451. package/build-module/components/block-edit/edit.js +4 -5
  452. package/build-module/components/block-edit/edit.js.map +1 -1
  453. package/build-module/components/block-edit/edit.native.js +2 -3
  454. package/build-module/components/block-edit/edit.native.js.map +1 -1
  455. package/build-module/components/block-edit/index.js +3 -2
  456. package/build-module/components/block-edit/index.js.map +1 -1
  457. package/build-module/components/block-heading-level-dropdown/heading-level-icon.js +39 -0
  458. package/build-module/components/block-heading-level-dropdown/heading-level-icon.js.map +1 -0
  459. package/build-module/components/block-heading-level-dropdown/index.js +71 -0
  460. package/build-module/components/block-heading-level-dropdown/index.js.map +1 -0
  461. package/build-module/components/block-heading-level-dropdown/index.native.js +60 -0
  462. package/build-module/components/block-heading-level-dropdown/index.native.js.map +1 -0
  463. package/build-module/components/block-icon/index.native.js +6 -6
  464. package/build-module/components/block-icon/index.native.js.map +1 -1
  465. package/build-module/components/block-info-slot-fill/index.js +4 -2
  466. package/build-module/components/block-info-slot-fill/index.js.map +1 -1
  467. package/build-module/components/block-inspector/index.js +20 -88
  468. package/build-module/components/block-inspector/index.js.map +1 -1
  469. package/build-module/components/block-list/block-list-item.native.js +4 -2
  470. package/build-module/components/block-list/block-list-item.native.js.map +1 -1
  471. package/build-module/components/block-list/block.js +6 -4
  472. package/build-module/components/block-list/block.js.map +1 -1
  473. package/build-module/components/block-list/block.native.js +1 -0
  474. package/build-module/components/block-list/block.native.js.map +1 -1
  475. package/build-module/components/block-list/index.js +7 -4
  476. package/build-module/components/block-list/index.js.map +1 -1
  477. package/build-module/components/block-list/index.native.js +8 -8
  478. package/build-module/components/block-list/index.native.js.map +1 -1
  479. package/build-module/components/block-list/subdirectory-icon.js +4 -4
  480. package/build-module/components/block-list/subdirectory-icon.js.map +1 -1
  481. package/build-module/components/block-list/use-in-between-inserter.js +1 -3
  482. package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
  483. package/build-module/components/block-list-appender/index.js +21 -19
  484. package/build-module/components/block-list-appender/index.js.map +1 -1
  485. package/build-module/components/block-lock/toolbar.js +25 -7
  486. package/build-module/components/block-lock/toolbar.js.map +1 -1
  487. package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js +1 -1
  488. package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js.map +1 -1
  489. package/build-module/components/block-mover/button.js +12 -11
  490. package/build-module/components/block-mover/button.js.map +1 -1
  491. package/build-module/components/block-mover/index.js +11 -9
  492. package/build-module/components/block-mover/index.js.map +1 -1
  493. package/build-module/components/block-navigation/dropdown.js +4 -5
  494. package/build-module/components/block-navigation/dropdown.js.map +1 -1
  495. package/build-module/components/block-parent-selector/index.js +4 -4
  496. package/build-module/components/block-parent-selector/index.js.map +1 -1
  497. package/build-module/components/block-pattern-setup/index.js +6 -7
  498. package/build-module/components/block-pattern-setup/index.js.map +1 -1
  499. package/build-module/components/block-patterns-list/index.js +6 -7
  500. package/build-module/components/block-patterns-list/index.js.map +1 -1
  501. package/build-module/components/block-popover/inbetween.js +4 -5
  502. package/build-module/components/block-popover/inbetween.js.map +1 -1
  503. package/build-module/components/block-popover/index.js +4 -5
  504. package/build-module/components/block-popover/index.js.map +1 -1
  505. package/build-module/components/block-preview/auto.js +2 -3
  506. package/build-module/components/block-preview/auto.js.map +1 -1
  507. package/build-module/components/block-preview/index.js +7 -7
  508. package/build-module/components/block-preview/index.js.map +1 -1
  509. package/build-module/components/block-quick-navigation/index.js +69 -0
  510. package/build-module/components/block-quick-navigation/index.js.map +1 -0
  511. package/build-module/components/block-removal-warning-modal/index.js +76 -0
  512. package/build-module/components/block-removal-warning-modal/index.js.map +1 -0
  513. package/build-module/components/block-selection-clearer/index.js +4 -4
  514. package/build-module/components/block-selection-clearer/index.js.map +1 -1
  515. package/build-module/components/block-settings/button.native.js +2 -1
  516. package/build-module/components/block-settings/button.native.js.map +1 -1
  517. package/build-module/components/block-settings/container.native.js +6 -5
  518. package/build-module/components/block-settings/container.native.js.map +1 -1
  519. package/build-module/components/block-settings-menu/block-settings-dropdown.js +10 -10
  520. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  521. package/build-module/components/block-settings-menu/index.js +4 -4
  522. package/build-module/components/block-settings-menu/index.js.map +1 -1
  523. package/build-module/components/block-settings-menu-controls/index.js +4 -4
  524. package/build-module/components/block-settings-menu-controls/index.js.map +1 -1
  525. package/build-module/components/block-switcher/index.js +1 -2
  526. package/build-module/components/block-switcher/index.js.map +1 -1
  527. package/build-module/components/block-switcher/pattern-transformations-menu.js +6 -7
  528. package/build-module/components/block-switcher/pattern-transformations-menu.js.map +1 -1
  529. package/build-module/components/block-toolbar/index.js +10 -7
  530. package/build-module/components/block-toolbar/index.js.map +1 -1
  531. package/build-module/components/block-tools/block-contextual-toolbar.js +4 -4
  532. package/build-module/components/block-tools/block-contextual-toolbar.js.map +1 -1
  533. package/build-module/components/block-tools/block-selection-button.js +4 -4
  534. package/build-module/components/block-tools/block-selection-button.js.map +1 -1
  535. package/build-module/components/block-tools/index.js +13 -5
  536. package/build-module/components/block-tools/index.js.map +1 -1
  537. package/build-module/components/block-tools/insertion-point.js +5 -4
  538. package/build-module/components/block-tools/insertion-point.js.map +1 -1
  539. package/build-module/components/block-tools/selected-block-popover.js +8 -7
  540. package/build-module/components/block-tools/selected-block-popover.js.map +1 -1
  541. package/build-module/components/block-types-list/index.native.js +4 -5
  542. package/build-module/components/block-types-list/index.native.js.map +1 -1
  543. package/build-module/components/block-vertical-alignment-control/index.js +4 -5
  544. package/build-module/components/block-vertical-alignment-control/index.js.map +1 -1
  545. package/build-module/components/block-vertical-alignment-control/ui.js +5 -9
  546. package/build-module/components/block-vertical-alignment-control/ui.js.map +1 -1
  547. package/build-module/components/border-radius-control/all-input-control.js +2 -3
  548. package/build-module/components/border-radius-control/all-input-control.js.map +1 -1
  549. package/build-module/components/border-radius-control/input-controls.js +2 -3
  550. package/build-module/components/border-radius-control/input-controls.js.map +1 -1
  551. package/build-module/components/border-radius-control/linked-button.js +2 -3
  552. package/build-module/components/border-radius-control/linked-button.js.map +1 -1
  553. package/build-module/components/color-palette/control.js +2 -3
  554. package/build-module/components/color-palette/control.js.map +1 -1
  555. package/build-module/components/color-palette/with-color-context.js +2 -3
  556. package/build-module/components/color-palette/with-color-context.js.map +1 -1
  557. package/build-module/components/colors/utils.js +5 -1
  558. package/build-module/components/colors/utils.js.map +1 -1
  559. package/build-module/components/colors/with-colors.js +10 -14
  560. package/build-module/components/colors/with-colors.js.map +1 -1
  561. package/build-module/components/colors-gradients/control.js +7 -4
  562. package/build-module/components/colors-gradients/control.js.map +1 -1
  563. package/build-module/components/colors-gradients/dropdown.js +12 -10
  564. package/build-module/components/colors-gradients/dropdown.js.map +1 -1
  565. package/build-module/components/colors-gradients/panel-color-gradient-settings.js +7 -4
  566. package/build-module/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
  567. package/build-module/components/copy-handler/index.js +5 -6
  568. package/build-module/components/copy-handler/index.js.map +1 -1
  569. package/build-module/components/dimensions-tool/aspect-ratio-tool.js +87 -0
  570. package/build-module/components/dimensions-tool/aspect-ratio-tool.js.map +1 -0
  571. package/build-module/components/dimensions-tool/index.js +195 -0
  572. package/build-module/components/dimensions-tool/index.js.map +1 -0
  573. package/build-module/components/dimensions-tool/scale-tool.js +103 -0
  574. package/build-module/components/dimensions-tool/scale-tool.js.map +1 -0
  575. package/build-module/components/dimensions-tool/width-height-tool.js +122 -0
  576. package/build-module/components/dimensions-tool/width-height-tool.js.map +1 -0
  577. package/build-module/components/duotone-control/index.js +1 -2
  578. package/build-module/components/duotone-control/index.js.map +1 -1
  579. package/build-module/components/editable-text/index.js +6 -6
  580. package/build-module/components/editable-text/index.js.map +1 -1
  581. package/build-module/components/font-appearance-control/index.js +2 -3
  582. package/build-module/components/font-appearance-control/index.js.map +1 -1
  583. package/build-module/components/font-family/index.js +4 -4
  584. package/build-module/components/font-family/index.js.map +1 -1
  585. package/build-module/components/font-sizes/font-size-picker.js +2 -3
  586. package/build-module/components/font-sizes/font-size-picker.js.map +1 -1
  587. package/build-module/components/font-sizes/utils.js +2 -2
  588. package/build-module/components/font-sizes/utils.js.map +1 -1
  589. package/build-module/components/font-sizes/with-font-sizes.js +7 -6
  590. package/build-module/components/font-sizes/with-font-sizes.js.map +1 -1
  591. package/build-module/components/global-styles/color-panel.js +15 -15
  592. package/build-module/components/global-styles/color-panel.js.map +1 -1
  593. package/build-module/components/global-styles/effects-panel.js +2 -1
  594. package/build-module/components/global-styles/effects-panel.js.map +1 -1
  595. package/build-module/components/global-styles/filters-panel.js +2 -1
  596. package/build-module/components/global-styles/filters-panel.js.map +1 -1
  597. package/build-module/components/global-styles/index.js +1 -1
  598. package/build-module/components/global-styles/index.js.map +1 -1
  599. package/build-module/components/global-styles/typography-panel.js +7 -7
  600. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  601. package/build-module/components/global-styles/use-global-styles-output.js +11 -10
  602. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  603. package/build-module/components/gradients/with-gradient.js +2 -3
  604. package/build-module/components/gradients/with-gradient.js.map +1 -1
  605. package/build-module/components/iframe/index.js +5 -6
  606. package/build-module/components/iframe/index.js.map +1 -1
  607. package/build-module/components/image-editor/aspect-ratio-dropdown.js +1 -1
  608. package/build-module/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
  609. package/build-module/components/image-editor/constants.js +1 -2
  610. package/build-module/components/image-editor/constants.js.map +1 -1
  611. package/build-module/components/image-editor/use-save-image.js +1 -2
  612. package/build-module/components/image-editor/use-save-image.js.map +1 -1
  613. package/build-module/components/image-size-control/index.js +5 -0
  614. package/build-module/components/image-size-control/index.js.map +1 -1
  615. package/build-module/components/index.js +1 -1
  616. package/build-module/components/index.js.map +1 -1
  617. package/build-module/components/index.native.js +1 -0
  618. package/build-module/components/index.native.js.map +1 -1
  619. package/build-module/components/inner-blocks/index.js +9 -7
  620. package/build-module/components/inner-blocks/index.js.map +1 -1
  621. package/build-module/components/inner-blocks/index.native.js +8 -6
  622. package/build-module/components/inner-blocks/index.native.js.map +1 -1
  623. package/build-module/components/inner-blocks/use-nested-settings-update.js +24 -27
  624. package/build-module/components/inner-blocks/use-nested-settings-update.js.map +1 -1
  625. package/build-module/components/inner-blocks/with-client-id.js +2 -3
  626. package/build-module/components/inner-blocks/with-client-id.js.map +1 -1
  627. package/build-module/components/inserter/block-patterns-explorer/explorer.js +2 -1
  628. package/build-module/components/inserter/block-patterns-explorer/explorer.js.map +1 -1
  629. package/build-module/components/inserter/block-patterns-tab.js +33 -7
  630. package/build-module/components/inserter/block-patterns-tab.js.map +1 -1
  631. package/build-module/components/inserter/hooks/use-block-types-state.js +4 -3
  632. package/build-module/components/inserter/hooks/use-block-types-state.js.map +1 -1
  633. package/build-module/components/inserter/hooks/use-insertion-point.js +1 -1
  634. package/build-module/components/inserter/hooks/use-insertion-point.js.map +1 -1
  635. package/build-module/components/inserter/index.js +8 -7
  636. package/build-module/components/inserter/index.js.map +1 -1
  637. package/build-module/components/inserter/index.native.js +4 -4
  638. package/build-module/components/inserter/index.native.js.map +1 -1
  639. package/build-module/components/inserter/library.js +1 -1
  640. package/build-module/components/inserter/library.js.map +1 -1
  641. package/build-module/components/inserter/media-tab/media-list.js +2 -3
  642. package/build-module/components/inserter/media-tab/media-list.js.map +1 -1
  643. package/build-module/components/inserter/media-tab/media-preview.js +4 -5
  644. package/build-module/components/inserter/media-tab/media-preview.js.map +1 -1
  645. package/build-module/components/inserter/media-tab/media-tab.js +3 -3
  646. package/build-module/components/inserter/media-tab/media-tab.js.map +1 -1
  647. package/build-module/components/inserter/reusable-blocks-tab.js +3 -3
  648. package/build-module/components/inserter/reusable-blocks-tab.js.map +1 -1
  649. package/build-module/components/inserter/tabs.js +3 -3
  650. package/build-module/components/inserter/tabs.js.map +1 -1
  651. package/build-module/components/inserter-list-item/index.js +4 -4
  652. package/build-module/components/inserter-list-item/index.js.map +1 -1
  653. package/build-module/components/inserter-listbox/group.js +4 -4
  654. package/build-module/components/inserter-listbox/group.js.map +1 -1
  655. package/build-module/components/inserter-listbox/item.js +8 -6
  656. package/build-module/components/inserter-listbox/item.js.map +1 -1
  657. package/build-module/components/inserter-listbox/row.js +4 -4
  658. package/build-module/components/inserter-listbox/row.js.map +1 -1
  659. package/build-module/components/inspector-controls/block-support-slot-container.js +2 -3
  660. package/build-module/components/inspector-controls/block-support-slot-container.js.map +1 -1
  661. package/build-module/components/inspector-controls/fill.native.js +2 -1
  662. package/build-module/components/inspector-controls/fill.native.js.map +1 -1
  663. package/build-module/components/inspector-controls/index.js +4 -5
  664. package/build-module/components/inspector-controls/index.js.map +1 -1
  665. package/build-module/components/inspector-controls/slot.js +4 -5
  666. package/build-module/components/inspector-controls/slot.js.map +1 -1
  667. package/build-module/components/inspector-controls/slot.native.js +2 -1
  668. package/build-module/components/inspector-controls/slot.native.js.map +1 -1
  669. package/build-module/components/justify-content-control/index.js +4 -5
  670. package/build-module/components/justify-content-control/index.js.map +1 -1
  671. package/build-module/components/justify-content-control/ui.js +4 -4
  672. package/build-module/components/justify-content-control/ui.js.map +1 -1
  673. package/build-module/components/letter-spacing-control/index.js +2 -3
  674. package/build-module/components/letter-spacing-control/index.js.map +1 -1
  675. package/build-module/components/line-height-control/index.js +2 -3
  676. package/build-module/components/line-height-control/index.js.map +1 -1
  677. package/build-module/components/link-control/index.js +20 -24
  678. package/build-module/components/link-control/index.js.map +1 -1
  679. package/build-module/components/link-control/search-create-button.js +2 -3
  680. package/build-module/components/link-control/search-create-button.js.map +1 -1
  681. package/build-module/components/link-control/search-input.js +7 -5
  682. package/build-module/components/link-control/search-input.js.map +1 -1
  683. package/build-module/components/link-control/search-item.js +2 -3
  684. package/build-module/components/link-control/search-item.js.map +1 -1
  685. package/build-module/components/link-control/search-results.js +2 -3
  686. package/build-module/components/link-control/search-results.js.map +1 -1
  687. package/build-module/components/link-control/settings-drawer.js +4 -5
  688. package/build-module/components/link-control/settings-drawer.js.map +1 -1
  689. package/build-module/components/list-view/appender.js +4 -5
  690. package/build-module/components/list-view/appender.js.map +1 -1
  691. package/build-module/components/list-view/aria-referenced-text.js +4 -5
  692. package/build-module/components/list-view/aria-referenced-text.js.map +1 -1
  693. package/build-module/components/list-view/block-contents.js +4 -4
  694. package/build-module/components/list-view/block-contents.js.map +1 -1
  695. package/build-module/components/list-view/block-select-button.js +14 -4
  696. package/build-module/components/list-view/block-select-button.js.map +1 -1
  697. package/build-module/components/list-view/branch.js +9 -7
  698. package/build-module/components/list-view/branch.js.map +1 -1
  699. package/build-module/components/list-view/drop-indicator.js +61 -11
  700. package/build-module/components/list-view/drop-indicator.js.map +1 -1
  701. package/build-module/components/list-view/index.js +4 -5
  702. package/build-module/components/list-view/index.js.map +1 -1
  703. package/build-module/components/list-view/leaf.js +4 -4
  704. package/build-module/components/list-view/leaf.js.map +1 -1
  705. package/build-module/components/list-view/use-list-view-client-ids.js +2 -22
  706. package/build-module/components/list-view/use-list-view-client-ids.js.map +1 -1
  707. package/build-module/components/list-view/use-list-view-drop-zone.js +45 -34
  708. package/build-module/components/list-view/use-list-view-drop-zone.js.map +1 -1
  709. package/build-module/components/media-placeholder/index.js +38 -13
  710. package/build-module/components/media-placeholder/index.js.map +1 -1
  711. package/build-module/components/media-replace-flow/index.js +1 -3
  712. package/build-module/components/media-replace-flow/index.js.map +1 -1
  713. package/build-module/components/navigable-toolbar/index.js +8 -7
  714. package/build-module/components/navigable-toolbar/index.js.map +1 -1
  715. package/build-module/components/panel-color-settings/index.js +4 -4
  716. package/build-module/components/panel-color-settings/index.js.map +1 -1
  717. package/build-module/components/plain-text/index.js +8 -7
  718. package/build-module/components/plain-text/index.js.map +1 -1
  719. package/build-module/components/plain-text/index.native.js +7 -5
  720. package/build-module/components/plain-text/index.native.js.map +1 -1
  721. package/build-module/components/preview-options/index.js +5 -4
  722. package/build-module/components/preview-options/index.js.map +1 -1
  723. package/build-module/components/provider/index.js +2 -3
  724. package/build-module/components/provider/index.js.map +1 -1
  725. package/build-module/components/provider/use-block-sync.js +21 -0
  726. package/build-module/components/provider/use-block-sync.js.map +1 -1
  727. package/build-module/components/provider/with-registry-provider.js +8 -7
  728. package/build-module/components/provider/with-registry-provider.js.map +1 -1
  729. package/build-module/components/publish-date-time-picker/index.js +4 -4
  730. package/build-module/components/publish-date-time-picker/index.js.map +1 -1
  731. package/build-module/components/resizable-box-popover/index.js +5 -4
  732. package/build-module/components/resizable-box-popover/index.js.map +1 -1
  733. package/build-module/components/resolution-tool/index.js +45 -0
  734. package/build-module/components/resolution-tool/index.js.map +1 -0
  735. package/build-module/components/rich-text/content.js +85 -0
  736. package/build-module/components/rich-text/content.js.map +1 -0
  737. package/build-module/components/rich-text/format-toolbar/index.js +1 -2
  738. package/build-module/components/rich-text/format-toolbar/index.js.map +1 -1
  739. package/build-module/components/rich-text/index.js +8 -42
  740. package/build-module/components/rich-text/index.js.map +1 -1
  741. package/build-module/components/rich-text/index.native.js +6 -34
  742. package/build-module/components/rich-text/index.native.js.map +1 -1
  743. package/build-module/components/rich-text/toolbar-button.js +2 -3
  744. package/build-module/components/rich-text/toolbar-button.js.map +1 -1
  745. package/build-module/components/spacing-sizes-control/index.js +8 -7
  746. package/build-module/components/spacing-sizes-control/index.js.map +1 -1
  747. package/build-module/components/tool-selector/index.js +2 -3
  748. package/build-module/components/tool-selector/index.js.map +1 -1
  749. package/build-module/components/unit-control/index.js +4 -4
  750. package/build-module/components/unit-control/index.js.map +1 -1
  751. package/build-module/components/url-input/index.js +12 -9
  752. package/build-module/components/url-input/index.js.map +1 -1
  753. package/build-module/components/url-input/index.native.js +4 -4
  754. package/build-module/components/url-input/index.native.js.map +1 -1
  755. package/build-module/components/url-popover/image-url-input-ui.js +22 -15
  756. package/build-module/components/url-popover/image-url-input-ui.js.map +1 -1
  757. package/build-module/components/url-popover/index.js +4 -4
  758. package/build-module/components/url-popover/index.js.map +1 -1
  759. package/build-module/components/url-popover/link-editor.js +4 -4
  760. package/build-module/components/url-popover/link-editor.js.map +1 -1
  761. package/build-module/components/url-popover/link-viewer.js +4 -4
  762. package/build-module/components/url-popover/link-viewer.js.map +1 -1
  763. package/build-module/components/use-block-display-information/index.js +29 -2
  764. package/build-module/components/use-block-display-information/index.js.map +1 -1
  765. package/build-module/components/video-player/index.native.js +2 -3
  766. package/build-module/components/video-player/index.native.js.map +1 -1
  767. package/build-module/components/warning/index.native.js +4 -4
  768. package/build-module/components/warning/index.native.js.map +1 -1
  769. package/build-module/components/writing-flow/index.js +2 -3
  770. package/build-module/components/writing-flow/index.js.map +1 -1
  771. package/build-module/components/writing-flow/use-drag-selection.js +1 -1
  772. package/build-module/components/writing-flow/use-drag-selection.js.map +1 -1
  773. package/build-module/components/writing-flow/use-tab-nav.js +32 -5
  774. package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
  775. package/build-module/hooks/align.js +8 -7
  776. package/build-module/hooks/align.js.map +1 -1
  777. package/build-module/hooks/anchor.js +4 -2
  778. package/build-module/hooks/anchor.js.map +1 -1
  779. package/build-module/hooks/behaviors.js +76 -34
  780. package/build-module/hooks/behaviors.js.map +1 -1
  781. package/build-module/hooks/border.js +4 -4
  782. package/build-module/hooks/border.js.map +1 -1
  783. package/build-module/hooks/color.js +4 -4
  784. package/build-module/hooks/color.js.map +1 -1
  785. package/build-module/hooks/content-lock-ui.js +8 -7
  786. package/build-module/hooks/content-lock-ui.js.map +1 -1
  787. package/build-module/hooks/custom-class-name.js +4 -2
  788. package/build-module/hooks/custom-class-name.js.map +1 -1
  789. package/build-module/hooks/dimensions.js +7 -6
  790. package/build-module/hooks/dimensions.js.map +1 -1
  791. package/build-module/hooks/duotone.js +5 -4
  792. package/build-module/hooks/duotone.js.map +1 -1
  793. package/build-module/hooks/font-family.js +1 -5
  794. package/build-module/hooks/font-family.js.map +1 -1
  795. package/build-module/hooks/font-size.js +10 -9
  796. package/build-module/hooks/font-size.js.map +1 -1
  797. package/build-module/hooks/layout.js +26 -24
  798. package/build-module/hooks/layout.js.map +1 -1
  799. package/build-module/hooks/position.js +23 -15
  800. package/build-module/hooks/position.js.map +1 -1
  801. package/build-module/hooks/style.js +8 -4
  802. package/build-module/hooks/style.js.map +1 -1
  803. package/build-module/hooks/supports.js +1 -1
  804. package/build-module/hooks/supports.js.map +1 -1
  805. package/build-module/hooks/typography.native.js +3 -1
  806. package/build-module/hooks/typography.native.js.map +1 -1
  807. package/build-module/hooks/use-typography-props.js +8 -15
  808. package/build-module/hooks/use-typography-props.js.map +1 -1
  809. package/build-module/index.js +1 -1
  810. package/build-module/index.js.map +1 -1
  811. package/build-module/layouts/constrained.js +2 -1
  812. package/build-module/layouts/constrained.js.map +1 -1
  813. package/build-module/layouts/definitions.js +147 -0
  814. package/build-module/layouts/definitions.js.map +1 -0
  815. package/build-module/layouts/flex.js +8 -6
  816. package/build-module/layouts/flex.js.map +1 -1
  817. package/build-module/layouts/flow.js +2 -1
  818. package/build-module/layouts/flow.js.map +1 -1
  819. package/build-module/layouts/grid.js +2 -1
  820. package/build-module/layouts/grid.js.map +1 -1
  821. package/build-module/layouts/utils.js +7 -2
  822. package/build-module/layouts/utils.js.map +1 -1
  823. package/build-module/private-apis.js +16 -1
  824. package/build-module/private-apis.js.map +1 -1
  825. package/build-module/store/actions.js +2 -62
  826. package/build-module/store/actions.js.map +1 -1
  827. package/build-module/store/defaults.js +1 -0
  828. package/build-module/store/defaults.js.map +1 -1
  829. package/build-module/store/private-actions.js +186 -0
  830. package/build-module/store/private-actions.js.map +1 -1
  831. package/build-module/store/private-selectors.js +63 -3
  832. package/build-module/store/private-selectors.js.map +1 -1
  833. package/build-module/store/reducer.js +52 -1
  834. package/build-module/store/reducer.js.map +1 -1
  835. package/build-module/store/selectors.js +42 -42
  836. package/build-module/store/selectors.js.map +1 -1
  837. package/build-module/utils/object.js +37 -1
  838. package/build-module/utils/object.js.map +1 -1
  839. package/build-style/style-rtl.css +58 -67
  840. package/build-style/style.css +58 -67
  841. package/package.json +32 -31
  842. package/src/autocompleters/block.js +4 -2
  843. package/src/components/alignment-control/test/__snapshots__/index.js.snap +6 -6
  844. package/src/components/alignment-control/ui.js +1 -2
  845. package/src/components/block-actions/index.js +10 -0
  846. package/src/components/block-alignment-control/constants.js +0 -4
  847. package/src/components/block-alignment-control/test/__snapshots__/index.js.snap +5 -5
  848. package/src/components/block-alignment-control/ui.js +1 -6
  849. package/src/components/block-alignment-matrix-control/index.js +1 -1
  850. package/src/components/block-breadcrumb/index.js +2 -6
  851. package/src/components/block-edit/index.js +3 -5
  852. package/src/components/block-heading-level-dropdown/README.md +52 -0
  853. package/src/components/block-heading-level-dropdown/heading-level-icon.js +43 -0
  854. package/src/components/block-heading-level-dropdown/index.js +77 -0
  855. package/src/components/block-heading-level-dropdown/index.native.js +63 -0
  856. package/src/components/block-inspector/index.js +18 -92
  857. package/src/components/block-inspector/style.scss +0 -5
  858. package/src/components/block-list/block.native.js +1 -0
  859. package/src/components/block-list/index.js +1 -1
  860. package/src/components/block-list/use-in-between-inserter.js +0 -4
  861. package/src/components/block-list-appender/index.js +29 -22
  862. package/src/components/block-lock/style.scss +11 -4
  863. package/src/components/block-lock/toolbar.js +34 -6
  864. package/src/components/block-mobile-toolbar/block-actions-menu.native.js +1 -1
  865. package/src/components/block-mobile-toolbar/test/block-actions-menu.native.js +2 -2
  866. package/src/components/block-mover/test/__snapshots__/index.native.js.snap +3 -3
  867. package/src/components/block-mover/test/index.native.js +1 -20
  868. package/src/components/block-preview/index.js +7 -14
  869. package/src/components/block-quick-navigation/index.js +81 -0
  870. package/src/components/block-removal-warning-modal/index.js +94 -0
  871. package/src/components/block-settings-menu/block-settings-dropdown.js +15 -13
  872. package/src/components/block-switcher/index.js +1 -2
  873. package/src/components/block-toolbar/index.js +9 -6
  874. package/src/components/block-toolbar/style.scss +0 -4
  875. package/src/components/block-tools/index.js +10 -1
  876. package/src/components/block-tools/style.scss +4 -0
  877. package/src/components/block-vertical-alignment-control/ui.js +1 -3
  878. package/src/components/colors/utils.js +5 -1
  879. package/src/components/colors/with-colors.js +1 -5
  880. package/src/components/copy-handler/index.js +5 -5
  881. package/src/components/dimensions-tool/aspect-ratio-tool.js +124 -0
  882. package/src/components/dimensions-tool/index.js +212 -0
  883. package/src/components/dimensions-tool/scale-tool.js +124 -0
  884. package/src/components/dimensions-tool/stories/aspect-ratio-tool.js +52 -0
  885. package/src/components/dimensions-tool/stories/index.js +54 -0
  886. package/src/components/dimensions-tool/stories/scale-tool.js +48 -0
  887. package/src/components/dimensions-tool/stories/width-height-tool.js +54 -0
  888. package/src/components/dimensions-tool/test/index.js +641 -0
  889. package/src/components/dimensions-tool/width-height-tool.js +113 -0
  890. package/src/components/duotone-control/index.js +0 -1
  891. package/src/components/font-sizes/test/fluid-utils.js +97 -76
  892. package/src/components/font-sizes/utils.js +2 -2
  893. package/src/components/global-styles/color-panel.js +3 -3
  894. package/src/components/global-styles/index.js +1 -0
  895. package/src/components/global-styles/test/use-global-styles-output.js +14 -9
  896. package/src/components/global-styles/typography-panel.js +19 -16
  897. package/src/components/global-styles/use-global-styles-output.js +12 -12
  898. package/src/components/iframe/index.js +1 -1
  899. package/src/components/image-editor/aspect-ratio-dropdown.js +1 -1
  900. package/src/components/image-editor/constants.js +0 -1
  901. package/src/components/image-editor/use-save-image.js +0 -1
  902. package/src/components/image-size-control/index.js +6 -0
  903. package/src/components/index.js +1 -1
  904. package/src/components/index.native.js +1 -0
  905. package/src/components/inner-blocks/index.js +4 -2
  906. package/src/components/inner-blocks/index.native.js +1 -1
  907. package/src/components/inner-blocks/use-nested-settings-update.js +31 -36
  908. package/src/components/inserter/block-patterns-tab.js +63 -8
  909. package/src/components/inserter/hooks/use-block-types-state.js +4 -3
  910. package/src/components/inserter/hooks/use-insertion-point.js +1 -0
  911. package/src/components/inserter/library.js +2 -1
  912. package/src/components/inserter/media-tab/media-tab.js +9 -3
  913. package/src/components/inserter/reusable-blocks-tab.js +3 -3
  914. package/src/components/inserter/tabs.js +3 -3
  915. package/src/components/link-control/index.js +34 -37
  916. package/src/components/link-control/search-input.js +5 -3
  917. package/src/components/link-control/settings-drawer.js +6 -5
  918. package/src/components/link-control/style.scss +33 -55
  919. package/src/components/link-control/test/index.js +161 -159
  920. package/src/components/list-view/block-select-button.js +19 -1
  921. package/src/components/list-view/branch.js +6 -3
  922. package/src/components/list-view/drop-indicator.js +94 -9
  923. package/src/components/list-view/style.scss +13 -12
  924. package/src/components/list-view/test/use-list-view-drop-zone.js +188 -93
  925. package/src/components/list-view/use-list-view-client-ids.js +3 -20
  926. package/src/components/list-view/use-list-view-drop-zone.js +97 -54
  927. package/src/components/media-placeholder/index.js +54 -20
  928. package/src/components/media-replace-flow/index.js +1 -3
  929. package/src/components/media-replace-flow/test/index.js +1 -1
  930. package/src/components/preview-options/index.js +3 -2
  931. package/src/components/provider/test/experimental-provider.js +9 -6
  932. package/src/components/provider/test/use-block-sync.js +21 -6
  933. package/src/components/provider/use-block-sync.js +19 -0
  934. package/src/components/resolution-tool/index.js +56 -0
  935. package/src/components/resolution-tool/stories/index.js +48 -0
  936. package/src/components/rich-text/content.js +85 -0
  937. package/src/components/rich-text/format-toolbar/index.js +1 -2
  938. package/src/components/rich-text/index.js +2 -35
  939. package/src/components/rich-text/index.native.js +3 -33
  940. package/src/components/url-input/index.js +2 -0
  941. package/src/components/url-popover/image-url-input-ui.js +15 -15
  942. package/src/components/url-popover/test/__snapshots__/index.js.snap +3 -3
  943. package/src/components/use-block-display-information/index.js +26 -0
  944. package/src/components/writing-flow/use-drag-selection.js +1 -1
  945. package/src/components/writing-flow/use-tab-nav.js +42 -6
  946. package/src/hooks/behaviors.js +82 -39
  947. package/src/hooks/font-family.js +1 -5
  948. package/src/hooks/font-size.js +12 -17
  949. package/src/hooks/layout.js +17 -25
  950. package/src/hooks/position.js +24 -12
  951. package/src/hooks/supports.js +1 -1
  952. package/src/hooks/use-typography-props.js +14 -19
  953. package/src/index.js +0 -2
  954. package/src/layouts/constrained.js +2 -1
  955. package/src/layouts/definitions.js +174 -0
  956. package/src/layouts/flex.js +7 -5
  957. package/src/layouts/flow.js +2 -1
  958. package/src/layouts/grid.js +2 -1
  959. package/src/layouts/test/utils.js +2 -7
  960. package/src/layouts/utils.js +7 -2
  961. package/src/private-apis.js +15 -0
  962. package/src/store/actions.js +7 -56
  963. package/src/store/defaults.js +1 -0
  964. package/src/store/private-actions.js +193 -0
  965. package/src/store/private-selectors.js +108 -35
  966. package/src/store/reducer.js +44 -0
  967. package/src/store/selectors.js +61 -39
  968. package/src/store/test/private-selectors.js +269 -1
  969. package/src/store/test/selectors.js +18 -17
  970. package/src/utils/object.js +35 -0
  971. package/src/utils/test/object.js +96 -1
@@ -38,6 +38,10 @@ var _gap = require("../../hooks/gap");
38
38
 
39
39
  var _store = require("../../store");
40
40
 
41
+ var _definitions = require("../../layouts/definitions");
42
+
43
+ var _object = require("../../utils/object");
44
+
41
45
  /**
42
46
  * External dependencies
43
47
  */
@@ -92,9 +96,9 @@ function getPresetsDeclarations(blockPresets = {}, mergedSettings) {
92
96
  if (presetByOrigin[origin]) {
93
97
  presetByOrigin[origin].forEach(value => {
94
98
  if (valueKey && !valueFunc) {
95
- declarations.push(`--wp--preset--${cssVarInfix}--${(0, _lodash.kebabCase)(value.slug)}: ${value[valueKey]}`);
99
+ declarations.push(`--wp--preset--${cssVarInfix}--${(0, _object.kebabCase)(value.slug)}: ${value[valueKey]}`);
96
100
  } else if (valueFunc && typeof valueFunc === 'function') {
97
- declarations.push(`--wp--preset--${cssVarInfix}--${(0, _lodash.kebabCase)(value.slug)}: ${valueFunc(value, mergedSettings)}`);
101
+ declarations.push(`--wp--preset--${cssVarInfix}--${(0, _object.kebabCase)(value.slug)}: ${valueFunc(value, mergedSettings)}`);
98
102
  }
99
103
  });
100
104
  }
@@ -131,10 +135,10 @@ function getPresetsClasses(blockSelector = '*', blockPresets = {}) {
131
135
  classSuffix,
132
136
  propertyName
133
137
  }) => {
134
- const classSelectorToUse = `.has-${(0, _lodash.kebabCase)(slug)}-${classSuffix}`;
138
+ const classSelectorToUse = `.has-${(0, _object.kebabCase)(slug)}-${classSuffix}`;
135
139
  const selectorToUse = blockSelector.split(',') // Selector can be "h1, h2, h3"
136
140
  .map(selector => `${selector}${classSelectorToUse}`).join(',');
137
- const value = `var(--wp--preset--${cssVarInfix}--${(0, _lodash.kebabCase)(slug)})`;
141
+ const value = `var(--wp--preset--${cssVarInfix}--${(0, _object.kebabCase)(slug)})`;
138
142
  declarations += `${selectorToUse}{${propertyName}: ${value} !important;}`;
139
143
  });
140
144
  });
@@ -158,7 +162,7 @@ function getPresetsSvgFilters(blockPresets = {}) {
158
162
  function flattenTree(input = {}, prefix, token) {
159
163
  let result = [];
160
164
  Object.keys(input).forEach(key => {
161
- const newKey = prefix + (0, _lodash.kebabCase)(key.replace('/', '-'));
165
+ const newKey = prefix + (0, _object.kebabCase)(key.replace('/', '-'));
162
166
  const newLeaf = input[key];
163
167
 
164
168
  if (newLeaf instanceof Object) {
@@ -305,11 +309,11 @@ function getStylesDeclarations(blockStyles = {}, selector = '', useRootPaddingAl
305
309
  return;
306
310
  }
307
311
 
308
- const cssProperty = name.startsWith('--') ? name : (0, _lodash.kebabCase)(name);
312
+ const cssProperty = name.startsWith('--') ? name : (0, _object.kebabCase)(name);
309
313
  declarations.push(`${cssProperty}: ${compileStyleValue((0, _lodash.get)(styleValue, [prop]))}`);
310
314
  });
311
315
  } else if ((0, _lodash.get)(blockStyles, pathToValue, false)) {
312
- const cssProperty = key.startsWith('--') ? key : (0, _lodash.kebabCase)(key);
316
+ const cssProperty = key.startsWith('--') ? key : (0, _object.kebabCase)(key);
313
317
  declarations.push(`${cssProperty}: ${compileStyleValue((0, _lodash.get)(blockStyles, pathToValue))}`);
314
318
  }
315
319
 
@@ -324,7 +328,7 @@ function getStylesDeclarations(blockStyles = {}, selector = '', useRootPaddingAl
324
328
  return;
325
329
  }
326
330
 
327
- const cssProperty = rule.key.startsWith('--') ? rule.key : (0, _lodash.kebabCase)(rule.key);
331
+ const cssProperty = rule.key.startsWith('--') ? rule.key : (0, _object.kebabCase)(rule.key);
328
332
  let ruleValue = rule.value;
329
333
 
330
334
  if (typeof ruleValue !== 'string' && ruleValue?.ref) {
@@ -360,7 +364,7 @@ function getStylesDeclarations(blockStyles = {}, selector = '', useRootPaddingAl
360
364
  * in theme.json, and outputting common layout styles, and specific blockGap values.
361
365
  *
362
366
  * @param {Object} props
363
- * @param {Object} props.tree A theme.json tree containing layout definitions.
367
+ * @param {Object} props.layoutDefinitions Layout definitions, keyed by layout type.
364
368
  * @param {Object} props.style A style object containing spacing values.
365
369
  * @param {string} props.selector Selector used to group together layout styling rules.
366
370
  * @param {boolean} props.hasBlockGapSupport Whether or not the theme opts-in to blockGap support.
@@ -371,7 +375,7 @@ function getStylesDeclarations(blockStyles = {}, selector = '', useRootPaddingAl
371
375
 
372
376
 
373
377
  function getLayoutStyles({
374
- tree,
378
+ layoutDefinitions = _definitions.LAYOUT_DEFINITIONS,
375
379
  style,
376
380
  selector,
377
381
  hasBlockGapSupport,
@@ -390,8 +394,8 @@ function getLayoutStyles({
390
394
  }
391
395
  }
392
396
 
393
- if (gapValue && tree?.settings?.layout?.definitions) {
394
- Object.values(tree.settings.layout.definitions).forEach(({
397
+ if (gapValue && layoutDefinitions) {
398
+ Object.values(layoutDefinitions).forEach(({
395
399
  className,
396
400
  name,
397
401
  spacingStyles
@@ -433,9 +437,9 @@ function getLayoutStyles({
433
437
  } // Output base styles
434
438
 
435
439
 
436
- if (selector === _utils.ROOT_BLOCK_SELECTOR && tree?.settings?.layout?.definitions) {
440
+ if (selector === _utils.ROOT_BLOCK_SELECTOR && layoutDefinitions) {
437
441
  const validDisplayModes = ['block', 'flex', 'grid'];
438
- Object.values(tree.settings.layout.definitions).forEach(({
442
+ Object.values(layoutDefinitions).forEach(({
439
443
  className,
440
444
  displayMode,
441
445
  baseStyles
@@ -739,7 +743,6 @@ const toStyles = (tree, blockSelectors, hasBlockGapSupport, hasFallbackGapSuppor
739
743
 
740
744
  if (!disableLayoutStyles && (_utils.ROOT_BLOCK_SELECTOR === selector || hasLayoutSupport)) {
741
745
  ruleset += getLayoutStyles({
742
- tree,
743
746
  style: styles,
744
747
  selector,
745
748
  hasBlockGapSupport,
@@ -854,7 +857,7 @@ const getBlockSelectors = (blockTypes, getBlockStyles) => {
854
857
  duotoneSelector = duotoneSupport && (0, _utils.scopeSelector)(rootSelector, duotoneSupport);
855
858
  }
856
859
 
857
- const hasLayoutSupport = !!blockType?.supports?.__experimentalLayout;
860
+ const hasLayoutSupport = !!blockType?.supports?.layout || !!blockType?.supports?.__experimentalLayout;
858
861
  const fallbackGapValue = blockType?.supports?.spacing?.blockGap?.__experimentalDefault;
859
862
  const blockStyleVariations = getBlockStyles(name);
860
863
  const styleVariationSelectors = {};
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/global-styles/use-global-styles-output.js"],"names":["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","forEach","origin","value","push","slug","getPresetsClasses","blockSelector","classes","classSuffix","propertyName","classSelectorToUse","selectorToUse","map","selector","getPresetsSvgFilters","filter","metadata","at","flatMap","preset","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","isRoot","ROOT_BLOCK_SELECTOR","output","STYLE_PROPERTY","properties","useEngine","rootOnly","pathToValue","styleValue","entry","name","prop","cssProperty","extraRules","rule","ruleValue","ref","refPath","size","settings","getLayoutStyles","style","hasBlockGapSupport","hasFallbackGapSupport","fallbackGapValue","ruleset","gapValue","blockGap","layout","definitions","values","className","spacingStyles","spacingStyle","rules","cssValue","combinedSelector","validDisplayModes","displayMode","baseStyles","includes","baseStyle","STYLE_KEYS","pickStyleKeys","treeToPickFrom","pickedEntries","clonedEntries","JSON","parse","stringify","fromEntries","getNodesWithStyles","blockSelectors","nodes","ELEMENTS","elements","blocks","blockName","node","variations","variation","duotoneSelector","hasLayoutSupport","styleVariationSelectors","elementName","sel","elementSelectors","elementSelector","getNodesWithSettings","pickPresets","presets","custom","blockCustom","toCustomProperties","customProps","toStyles","disableLayoutStyles","nodesWithStyles","nodesWithSettings","useRootPaddingAwareAlignments","contentSize","wideSize","featureDeclarations","cssSelector","styleVariationName","styleVariations","baseSelector","styleVariationDeclarations","duotoneStyles","duotoneDeclarations","pseudoSelectorStyles","pseudoKey","pseudoStyle","pseudoDeclarations","_selector","pseudoRule","toSvgFilters","getSelectorsConfig","blockType","rootSelector","config","featureKey","featureName","getBlockSelectors","blockTypes","getBlockStyles","duotoneSupport","supports","__experimentalLayout","__experimentalDefault","blockStyleVariations","undefined","updateConfigWithSeparator","needsSeparatorStyleUpdate","background","text","border","processCSSNesting","css","processedCSS","parts","part","useGlobalStylesOutputWithConfig","mergedConfig","select","getSettings","blockEditorStore","blocksStore","customProperties","globalStyles","svgs","isGlobalStyles","assets","__unstableType","useGlobalStylesOutput","merged","GlobalStylesContext"],"mappings":";;;;;;;;;;;;;;AAgBA;;AAbA;;AAKA;;AAOA;;AAEA;;AAKA;;AACA;;AACA;;AAIA;;AACA;;AACA;;AACA;;AACA;;AAhCA;AACA;AACA;;AAGA;AACA;AACA;;AAYA;AACA;AACA;AAaA;AACA;AACA,MAAMA,qCAAqC,GAAG;AAC7CC,EAAAA,oBAAoB,EAAE,QADuB;AAE7CC,EAAAA,KAAK,EAAE,OAFsC;AAG7CC,EAAAA,OAAO,EAAE,SAHoC;AAI7CC,EAAAA,UAAU,EAAE;AAJiC,CAA9C;;AAOA,SAASC,iBAAT,CAA4BC,eAA5B,EAA8C;AAC7C,QAAMC,yBAAyB,GAAG,MAAlC;AACA,QAAMC,uCAAuC,GAAG,GAAhD;AACA,QAAMC,mCAAmC,GAAG,IAA5C;;AAEA,MAAKH,eAAe,EAAEI,UAAjB,GAA+BH,yBAA/B,CAAL,EAAkE;AACjE,UAAMI,QAAQ,GAAGL,eAAe,CAC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EFC,qBAFE,EAGFoG,YAHE,EAIF/C,mBAJE,CA9DI,CAAP;AAoEA;AAED;AACA;AACA;AACA;AACA;;;AACO,SAAS0D,qBAAT,GAAiC;AACvC,QAAM;AAAEC,IAAAA,MAAM,EAAEZ;AAAV,MAA2B,yBAAYa,4BAAZ,CAAjC;AACA,SAAOd,+BAA+B,CAAEC,YAAF,CAAtC;AACA","sourcesContent":["/**\n * External dependencies\n */\nimport { get, kebabCase, set } from 'lodash';\n\n/**\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 { renderToString, 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 { PresetDuotoneFilter } from '../duotone/components';\nimport { getGapCSSValue } from '../../hooks/gap';\nimport { store as blockEditorStore } from '../../store';\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 = get( blockPresets, path, [] );\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 = get( blockPresets, path, [] );\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 = get( blockPresets, metadata.path, {} );\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\trenderToString(\n\t\t\t\t\t\t<PresetDuotoneFilter\n\t\t\t\t\t\t\tpreset={ preset }\n\t\t\t\t\t\t\tkey={ preset.slug }\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\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 *\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 * @return {Array} An array of style declarations.\n */\nexport function getStylesDeclarations(\n\tblockStyles = {},\n\tselector = '',\n\tuseRootPaddingAlign,\n\ttree = {}\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 = get( blockStyles, pathToValue );\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 ( ! get( styleValue, [ prop ], false ) ) {\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\tget( 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 ( get( blockStyles, pathToValue, false ) ) {\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\tget( 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.\n\t\tif (\n\t\t\tisRoot &&\n\t\t\tuseRootPaddingAlign &&\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 = get( 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.tree A theme.json tree containing layout definitions.\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\ttree,\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 && tree?.settings?.layout?.definitions ) {\n\t\tObject.values( tree.settings.layout.definitions ).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 (\n\t\tselector === ROOT_BLOCK_SELECTOR &&\n\t\ttree?.settings?.layout?.definitions\n\t) {\n\t\tconst validDisplayModes = [ 'block', 'flex', 'grid' ];\n\t\tObject.values( tree.settings.layout.definitions ).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\tconst presets = {};\n\t\tPRESET_METADATA.forEach( ( { path } ) => {\n\t\t\tconst value = get( treeToPickFrom, path, false );\n\t\t\tif ( value !== false ) {\n\t\t\t\tset( 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) => {\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\tif ( useRootPaddingAlign ) {\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) { 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) > .alignfull { margin-right: 0; margin-left: 0; }\n\t\t\t.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: 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\ttree,\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);\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 = !! 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 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);\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"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/global-styles/use-global-styles-output.js"],"names":["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","forEach","origin","value","push","slug","getPresetsClasses","blockSelector","classes","classSuffix","propertyName","classSelectorToUse","selectorToUse","map","selector","getPresetsSvgFilters","filter","metadata","at","flatMap","preset","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","isRoot","ROOT_BLOCK_SELECTOR","output","STYLE_PROPERTY","properties","useEngine","rootOnly","pathToValue","styleValue","entry","name","prop","cssProperty","extraRules","rule","ruleValue","ref","refPath","size","settings","getLayoutStyles","layoutDefinitions","LAYOUT_DEFINITIONS","style","hasBlockGapSupport","hasFallbackGapSupport","fallbackGapValue","ruleset","gapValue","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","nodes","ELEMENTS","elements","blocks","blockName","node","variations","variation","duotoneSelector","hasLayoutSupport","styleVariationSelectors","elementName","sel","elementSelectors","elementSelector","getNodesWithSettings","pickPresets","presets","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","getBlockSelectors","blockTypes","getBlockStyles","duotoneSupport","supports","__experimentalLayout","__experimentalDefault","blockStyleVariations","undefined","updateConfigWithSeparator","needsSeparatorStyleUpdate","background","text","border","processCSSNesting","css","processedCSS","parts","part","useGlobalStylesOutputWithConfig","mergedConfig","select","getSettings","blockEditorStore","blocksStore","customProperties","globalStyles","svgs","isGlobalStyles","assets","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UAAKyB,YAAY,CAAC1I,MAAb,CAAoBsE,MAApB,CAA4B2C,SAAS,CAACzF,IAAtC,GAA8C6G,GAAnD,EAAyD;AACxD,cAAMhK,QAAQ,GAAG6F,cAAc,CAAE+C,SAAS,CAACzF,IAAZ,CAAd,CAAiCnD,QAAlD;AACA2B,QAAAA,MAAM,CAACrC,IAAP,CAAa;AACZ0K,UAAAA,GAAG,EAAED,iBAAiB,CACrBM,YAAY,CAAC1I,MAAb,CAAoBsE,MAApB,CAA4B2C,SAAS,CAACzF,IAAtC,GAA8C6G,GADzB,EAErBhK,QAFqB,CADV;AAKZ6K,UAAAA,cAAc,EAAE;AALJ,SAAb;AAOA;AACD,KAXD;AAaA,WAAO,CAAElJ,MAAF,EAAU0I,YAAY,CAACzG,QAAvB,CAAP;AACA,GA9DM,EA8DJ,CACFK,kBADE,EAEFC,qBAFE,EAGFmG,YAHE,EAIFhD,mBAJE,CA9DI,CAAP;AAoEA;AAED;AACA;AACA;AACA;AACA;;;AACO,SAAS2D,qBAAT,GAAiC;AACvC,QAAM;AAAEC,IAAAA,MAAM,EAAEZ;AAAV,MAA2B,yBAAYa,4BAAZ,CAAjC;AACA,SAAOd,+BAA+B,CAAEC,YAAF,CAAtC;AACA","sourcesContent":["/**\n * External dependencies\n */\nimport { get, set } from 'lodash';\n\n/**\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 { renderToString, 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 { PresetDuotoneFilter } from '../duotone/components';\nimport { getGapCSSValue } from '../../hooks/gap';\nimport { store as blockEditorStore } from '../../store';\nimport { LAYOUT_DEFINITIONS } from '../../layouts/definitions';\nimport { kebabCase } from '../../utils/object';\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 = get( blockPresets, path, [] );\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 = get( blockPresets, path, [] );\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 = get( blockPresets, metadata.path, {} );\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\trenderToString(\n\t\t\t\t\t\t<PresetDuotoneFilter\n\t\t\t\t\t\t\tpreset={ preset }\n\t\t\t\t\t\t\tkey={ preset.slug }\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\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 *\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 * @return {Array} An array of style declarations.\n */\nexport function getStylesDeclarations(\n\tblockStyles = {},\n\tselector = '',\n\tuseRootPaddingAlign,\n\ttree = {}\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 = get( blockStyles, pathToValue );\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 ( ! get( styleValue, [ prop ], false ) ) {\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\tget( 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 ( get( blockStyles, pathToValue, false ) ) {\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\tget( 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.\n\t\tif (\n\t\t\tisRoot &&\n\t\t\tuseRootPaddingAlign &&\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 = get( 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\tconst presets = {};\n\t\tPRESET_METADATA.forEach( ( { path } ) => {\n\t\t\tconst value = get( treeToPickFrom, path, false );\n\t\t\tif ( value !== false ) {\n\t\t\t\tset( 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) => {\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\tif ( useRootPaddingAlign ) {\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) { 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) > .alignfull { margin-right: 0; margin-left: 0; }\n\t\t\t.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: 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);\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 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);\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"]}
@@ -1,7 +1,5 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
3
  Object.defineProperty(exports, "__esModule", {
6
4
  value: true
7
5
  });
@@ -9,8 +7,6 @@ exports.withGradient = void 0;
9
7
 
10
8
  var _element = require("@wordpress/element");
11
9
 
12
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
13
-
14
10
  var _useGradient = require("./use-gradient");
15
11
 
16
12
  /**
@@ -20,9 +16,9 @@ const withGradient = WrappedComponent => props => {
20
16
  const {
21
17
  gradientValue
22
18
  } = (0, _useGradient.__experimentalUseGradient)();
23
- return (0, _element.createElement)(WrappedComponent, (0, _extends2.default)({}, props, {
19
+ return (0, _element.createElement)(WrappedComponent, { ...props,
24
20
  gradientValue: gradientValue
25
- }));
21
+ });
26
22
  };
27
23
 
28
24
  exports.withGradient = withGradient;
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/gradients/with-gradient.js"],"names":["withGradient","WrappedComponent","props","gradientValue"],"mappings":";;;;;;;;;;;;;AAGA;;AAHA;AACA;AACA;AAGO,MAAMA,YAAY,GAAKC,gBAAF,IAA0BC,KAAF,IAAa;AAChE,QAAM;AAAEC,IAAAA;AAAF,MAAoB,6CAA1B;AACA,SAAO,4BAAC,gBAAD,6BAAuBD,KAAvB;AAA+B,IAAA,aAAa,EAAGC;AAA/C,KAAP;AACA,CAHM","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"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/gradients/with-gradient.js"],"names":["withGradient","WrappedComponent","props","gradientValue"],"mappings":";;;;;;;;;AAGA;;AAHA;AACA;AACA;AAGO,MAAMA,YAAY,GAAKC,gBAAF,IAA0BC,KAAF,IAAa;AAChE,QAAM;AAAEC,IAAAA;AAAF,MAAoB,6CAA1B;AACA,SAAO,4BAAC,gBAAD,OAAuBD,KAAvB;AAA+B,IAAA,aAAa,EAAGC;AAA/C,IAAP;AACA,CAHM","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"]}
@@ -9,8 +9,6 @@ exports.default = void 0;
9
9
 
10
10
  var _element = require("@wordpress/element");
11
11
 
12
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
13
-
14
12
  var _classnames = _interopRequireDefault(require("classnames"));
15
13
 
16
14
  var _i18n = require("@wordpress/i18n");
@@ -205,7 +203,7 @@ function Iframe({
205
203
  // mode. Also preload the styles to avoid a flash of unstyled
206
204
  // content.
207
205
 
208
- const html = '<!doctype html>' + '<style>html{height:auto!important;}body{margin:0}</style>' + ((_assets$styles = assets?.styles) !== null && _assets$styles !== void 0 ? _assets$styles : '');
206
+ const html = '<!doctype html>' + '<style>html{height:auto!important;min-height:100%;}body{margin:0}</style>' + ((_assets$styles = assets?.styles) !== null && _assets$styles !== void 0 ? _assets$styles : '');
209
207
  const [src, cleanup] = (0, _element.useMemo)(() => {
210
208
  const _src = URL.createObjectURL(new window.Blob([html], {
211
209
  type: 'text/html'
@@ -218,7 +216,7 @@ function Iframe({
218
216
  // top or bottom margin is 0.55 / 2 ((1 - scale) / 2).
219
217
 
220
218
  const marginFromScaling = contentHeight * (1 - scale) / 2;
221
- return (0, _element.createElement)(_element.Fragment, null, tabIndex >= 0 && before, (0, _element.createElement)("iframe", (0, _extends2.default)({}, props, {
219
+ return (0, _element.createElement)(_element.Fragment, null, tabIndex >= 0 && before, (0, _element.createElement)("iframe", { ...props,
222
220
  style: { ...props.style,
223
221
  height: expand ? contentHeight : props.style?.height,
224
222
  marginTop: scale !== 1 ? -marginFromScaling + frameSize : props.style?.marginTop,
@@ -233,7 +231,7 @@ function Iframe({
233
231
  ,
234
232
  src: src,
235
233
  title: (0, _i18n.__)('Editor canvas')
236
- }), iframeDocument && (0, _element.createPortal)((0, _element.createElement)("body", {
234
+ }, iframeDocument && (0, _element.createPortal)((0, _element.createElement)("body", {
237
235
  ref: bodyRef,
238
236
  className: (0, _classnames.default)('block-editor-iframe__body', 'editor-styles-wrapper', ...bodyClasses)
239
237
  }, contentResizeListener, (0, _element.createElement)(_components.__experimentalStyleProvider, {
@@ -252,9 +250,9 @@ function IframeIfReady(props, ref) {
252
250
  return null;
253
251
  }
254
252
 
255
- return (0, _element.createElement)(Iframe, (0, _extends2.default)({}, props, {
253
+ return (0, _element.createElement)(Iframe, { ...props,
256
254
  forwardedRef: ref
257
- }));
255
+ });
258
256
  }
259
257
 
260
258
  var _default = (0, _element.forwardRef)(IframeIfReady);