@wordpress/block-editor 15.21.0 → 15.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (836) hide show
  1. package/CHANGELOG.md +23 -1
  2. package/README.md +2 -2
  3. package/build/components/block-card/index.cjs +4 -5
  4. package/build/components/block-card/index.cjs.map +2 -2
  5. package/build/components/block-compare/index.cjs +2 -2
  6. package/build/components/block-compare/index.cjs.map +2 -2
  7. package/build/components/block-editing-mode/index.cjs +13 -7
  8. package/build/components/block-editing-mode/index.cjs.map +2 -2
  9. package/build/components/block-inspector/index.cjs +35 -20
  10. package/build/components/block-inspector/index.cjs.map +2 -2
  11. package/build/components/block-mover/mover-description.cjs +6 -6
  12. package/build/components/block-mover/mover-description.cjs.map +1 -1
  13. package/build/components/block-patterns-list/index.cjs +1 -1
  14. package/build/components/block-patterns-list/index.cjs.map +2 -2
  15. package/build/components/block-patterns-paging/index.cjs +4 -4
  16. package/build/components/block-patterns-paging/index.cjs.map +2 -2
  17. package/build/components/block-popover/use-popover-scroll.cjs.map +1 -1
  18. package/build/components/block-quick-navigation/index.cjs +7 -5
  19. package/build/components/block-quick-navigation/index.cjs.map +2 -2
  20. package/build/components/block-rename/modal.cjs +0 -1
  21. package/build/components/block-rename/modal.cjs.map +2 -2
  22. package/build/components/block-switcher/block-transformations-menu.cjs +16 -15
  23. package/build/components/block-switcher/block-transformations-menu.cjs.map +2 -2
  24. package/build/components/block-switcher/index.cjs +4 -4
  25. package/build/components/block-switcher/index.cjs.map +2 -2
  26. package/build/components/block-toolbar/block-toolbar-icon.cjs +14 -6
  27. package/build/components/block-toolbar/block-toolbar-icon.cjs.map +2 -2
  28. package/build/components/block-toolbar/edit-section-button.cjs.map +1 -1
  29. package/build/components/block-tools/use-block-toolbar-popover-props.cjs +10 -4
  30. package/build/components/block-tools/use-block-toolbar-popover-props.cjs.map +2 -2
  31. package/build/components/child-layout-control/index.cjs +51 -19
  32. package/build/components/child-layout-control/index.cjs.map +2 -2
  33. package/build/components/colors-gradients/control.cjs +25 -14
  34. package/build/components/colors-gradients/control.cjs.map +2 -2
  35. package/build/components/colors-gradients/dropdown.cjs +4 -1
  36. package/build/components/colors-gradients/dropdown.cjs.map +3 -3
  37. package/build/components/contrast-checker/index.cjs +22 -4
  38. package/build/components/contrast-checker/index.cjs.map +2 -2
  39. package/build/components/date-format-picker/index.cjs +0 -1
  40. package/build/components/date-format-picker/index.cjs.map +2 -2
  41. package/build/components/dimensions-tool/index.cjs +4 -5
  42. package/build/components/dimensions-tool/index.cjs.map +2 -2
  43. package/build/components/dimensions-tool/scale-tool.cjs +1 -1
  44. package/build/components/dimensions-tool/scale-tool.cjs.map +2 -2
  45. package/build/components/global-styles/advanced-panel.cjs +23 -15
  46. package/build/components/global-styles/advanced-panel.cjs.map +2 -2
  47. package/build/components/global-styles/background-panel.cjs +154 -26
  48. package/build/components/global-styles/background-panel.cjs.map +3 -3
  49. package/build/components/global-styles/border-panel.cjs +2 -0
  50. package/build/components/global-styles/border-panel.cjs.map +2 -2
  51. package/build/components/global-styles/color-gradient-dropdown-item.cjs +227 -0
  52. package/build/components/global-styles/color-gradient-dropdown-item.cjs.map +7 -0
  53. package/build/components/global-styles/color-panel.cjs +98 -375
  54. package/build/components/global-styles/color-panel.cjs.map +3 -3
  55. package/build/components/global-styles/dimensions-panel.cjs +2 -5
  56. package/build/components/global-styles/dimensions-panel.cjs.map +2 -2
  57. package/build/components/global-styles/hooks.cjs +34 -0
  58. package/build/components/global-styles/hooks.cjs.map +2 -2
  59. package/build/components/global-styles/shadow-panel-components.cjs.map +2 -2
  60. package/build/components/global-styles/typography-panel.cjs +82 -10
  61. package/build/components/global-styles/typography-panel.cjs.map +3 -3
  62. package/build/components/grid/grid-item-resizer.cjs.map +1 -1
  63. package/build/components/grid/grid-visualizer.cjs.map +1 -1
  64. package/build/components/iframe/index.cjs +6 -3
  65. package/build/components/iframe/index.cjs.map +3 -3
  66. package/build/components/image-editor/use-transform-image.cjs.map +1 -1
  67. package/build/components/inner-blocks/use-inner-block-template-sync.cjs +3 -1
  68. package/build/components/inner-blocks/use-inner-block-template-sync.cjs.map +2 -2
  69. package/build/components/inserter/get-appender-label.cjs.map +1 -1
  70. package/build/components/inserter/hooks/use-patterns-state.cjs +1 -1
  71. package/build/components/inserter/hooks/use-patterns-state.cjs.map +2 -2
  72. package/build/components/inserter/index.cjs +179 -220
  73. package/build/components/inserter/index.cjs.map +3 -3
  74. package/build/components/inserter/media-tab/media-preview.cjs.map +2 -2
  75. package/build/components/inserter/search-items.cjs.map +1 -1
  76. package/build/components/inserter/search-results.cjs +1 -1
  77. package/build/components/inserter/search-results.cjs.map +2 -2
  78. package/build/components/inspector-controls/fill.cjs +1 -3
  79. package/build/components/inspector-controls/fill.cjs.map +2 -2
  80. package/build/components/inspector-controls/groups.cjs +2 -0
  81. package/build/components/inspector-controls/groups.cjs.map +2 -2
  82. package/build/components/inspector-controls-tabs/index.cjs.map +2 -2
  83. package/build/components/inspector-controls-tabs/styles-tab.cjs +76 -32
  84. package/build/components/inspector-controls-tabs/styles-tab.cjs.map +2 -2
  85. package/build/components/keyboard-shortcuts/index.cjs.map +1 -1
  86. package/build/components/line-height-control/index.cjs.map +1 -1
  87. package/build/components/link-control/index.cjs +2 -3
  88. package/build/components/link-control/index.cjs.map +2 -2
  89. package/build/components/link-control/normalize-url.cjs.map +1 -1
  90. package/build/components/list-view/block-select-button.cjs +9 -20
  91. package/build/components/list-view/block-select-button.cjs.map +3 -3
  92. package/build/components/list-view/block.cjs +2 -1
  93. package/build/components/list-view/block.cjs.map +2 -2
  94. package/build/components/list-view/utils.cjs.map +1 -1
  95. package/build/components/preset-input-control/custom-value-controls.cjs.map +2 -2
  96. package/build/components/provider/index.cjs.map +1 -1
  97. package/build/components/provider/use-block-sync.cjs +14 -3
  98. package/build/components/provider/use-block-sync.cjs.map +2 -2
  99. package/build/components/rich-text/event-listeners/before-input-rules.cjs +5 -5
  100. package/build/components/rich-text/event-listeners/before-input-rules.cjs.map +3 -3
  101. package/build/components/rich-text/event-listeners/delete.cjs +4 -4
  102. package/build/components/rich-text/event-listeners/delete.cjs.map +3 -3
  103. package/build/components/rich-text/event-listeners/enter.cjs +7 -2
  104. package/build/components/rich-text/event-listeners/enter.cjs.map +2 -2
  105. package/build/components/rich-text/event-listeners/input-events.cjs +4 -4
  106. package/build/components/rich-text/event-listeners/input-events.cjs.map +3 -3
  107. package/build/components/rich-text/event-listeners/input-rules.cjs +17 -4
  108. package/build/components/rich-text/event-listeners/input-rules.cjs.map +3 -3
  109. package/build/components/rich-text/event-listeners/insert-replacement-text.cjs +4 -4
  110. package/build/components/rich-text/event-listeners/insert-replacement-text.cjs.map +3 -3
  111. package/build/components/rich-text/event-listeners/paste-handler.cjs.map +1 -1
  112. package/build/components/rich-text/event-listeners/remove-browser-shortcuts.cjs +4 -4
  113. package/build/components/rich-text/event-listeners/remove-browser-shortcuts.cjs.map +3 -3
  114. package/build/components/rich-text/event-listeners/shortcuts.cjs +4 -4
  115. package/build/components/rich-text/event-listeners/shortcuts.cjs.map +3 -3
  116. package/build/components/rich-text/event-listeners/undo-automatic-change.cjs +4 -4
  117. package/build/components/rich-text/event-listeners/undo-automatic-change.cjs.map +3 -3
  118. package/build/components/rich-text/index.cjs +1 -23
  119. package/build/components/rich-text/index.cjs.map +2 -2
  120. package/build/components/rich-text/prevent-event-discovery.cjs +1 -1
  121. package/build/components/rich-text/prevent-event-discovery.cjs.map +1 -1
  122. package/build/components/url-popover/image-url-input-ui.cjs +0 -2
  123. package/build/components/url-popover/image-url-input-ui.cjs.map +2 -2
  124. package/build/components/use-block-commands/index.cjs +5 -5
  125. package/build/components/use-block-commands/index.cjs.map +2 -2
  126. package/build/components/use-block-display-information/index.cjs +10 -3
  127. package/build/components/use-block-display-information/index.cjs.map +2 -2
  128. package/build/components/writing-flow/use-tab-nav.cjs.map +1 -1
  129. package/build/hooks/anchor.cjs +12 -17
  130. package/build/hooks/anchor.cjs.map +2 -2
  131. package/build/hooks/background.cjs +124 -75
  132. package/build/hooks/background.cjs.map +3 -3
  133. package/build/hooks/block-fields/index.cjs +13 -2
  134. package/build/hooks/block-fields/index.cjs.map +2 -2
  135. package/build/hooks/border.cjs +0 -3
  136. package/build/hooks/border.cjs.map +2 -2
  137. package/build/hooks/color.cjs +0 -165
  138. package/build/hooks/color.cjs.map +3 -3
  139. package/build/hooks/contrast-checker.cjs +31 -28
  140. package/build/hooks/contrast-checker.cjs.map +3 -3
  141. package/build/hooks/custom-class-name.cjs +0 -1
  142. package/build/hooks/custom-class-name.cjs.map +2 -2
  143. package/build/hooks/dimensions.cjs +13 -5
  144. package/build/hooks/dimensions.cjs.map +2 -2
  145. package/build/hooks/elements.cjs +142 -0
  146. package/build/hooks/elements.cjs.map +7 -0
  147. package/build/hooks/fit-text.cjs +11 -0
  148. package/build/hooks/fit-text.cjs.map +2 -2
  149. package/build/hooks/grid-visualizer.cjs +21 -11
  150. package/build/hooks/grid-visualizer.cjs.map +2 -2
  151. package/build/hooks/layout-child.cjs +65 -10
  152. package/build/hooks/layout-child.cjs.map +2 -2
  153. package/build/hooks/layout.cjs +6 -3
  154. package/build/hooks/layout.cjs.map +2 -2
  155. package/build/hooks/list-view.cjs +10 -7
  156. package/build/hooks/list-view.cjs.map +2 -2
  157. package/build/hooks/position.cjs +19 -22
  158. package/build/hooks/position.cjs.map +2 -2
  159. package/build/hooks/spacing-visualizer.cjs.map +1 -1
  160. package/build/hooks/state-utils.cjs.map +1 -1
  161. package/build/hooks/states.cjs +2 -2
  162. package/build/hooks/states.cjs.map +2 -2
  163. package/build/hooks/style.cjs +50 -6
  164. package/build/hooks/style.cjs.map +2 -2
  165. package/build/hooks/supports.cjs +0 -7
  166. package/build/hooks/supports.cjs.map +2 -2
  167. package/build/hooks/typography.cjs +62 -10
  168. package/build/hooks/typography.cjs.map +3 -3
  169. package/build/layouts/flex.cjs +99 -6
  170. package/build/layouts/flex.cjs.map +2 -2
  171. package/build/private-apis.cjs +4 -0
  172. package/build/private-apis.cjs.map +2 -2
  173. package/build/store/actions.cjs +7 -3
  174. package/build/store/actions.cjs.map +2 -2
  175. package/build/store/private-actions.cjs +1 -2
  176. package/build/store/private-actions.cjs.map +2 -2
  177. package/build/store/private-selectors.cjs +42 -2
  178. package/build/store/private-selectors.cjs.map +2 -2
  179. package/build/store/reducer.cjs +14 -6
  180. package/build/store/reducer.cjs.map +2 -2
  181. package/build/store/selectors.cjs +60 -41
  182. package/build/store/selectors.cjs.map +2 -2
  183. package/build/utils/block-bindings.cjs +9 -9
  184. package/build/utils/block-bindings.cjs.map +3 -3
  185. package/build/utils/color-values.cjs +10 -1
  186. package/build/utils/color-values.cjs.map +3 -3
  187. package/build/utils/dom.cjs +2 -5
  188. package/build/utils/dom.cjs.map +3 -3
  189. package/build/utils/fit-text-frontend.cjs +6 -2
  190. package/build/utils/fit-text-frontend.cjs.map +3 -3
  191. package/build/utils/fit-text-utils.cjs +1 -1
  192. package/build/utils/fit-text-utils.cjs.map +3 -3
  193. package/build/utils/format-font-style.cjs +1 -1
  194. package/build/utils/format-font-style.cjs.map +3 -3
  195. package/build/utils/format-font-weight.cjs +1 -1
  196. package/build/utils/format-font-weight.cjs.map +3 -3
  197. package/build/utils/get-editor-region.cjs +4 -2
  198. package/build/utils/get-editor-region.cjs.map +3 -3
  199. package/build/utils/get-font-styles-and-weights.cjs +8 -12
  200. package/build/utils/get-font-styles-and-weights.cjs.map +3 -3
  201. package/build/utils/get-px-from-css-unit.cjs +1 -1
  202. package/build/utils/get-px-from-css-unit.cjs.map +1 -1
  203. package/build/utils/index.cjs +1 -1
  204. package/build/utils/index.cjs.map +1 -1
  205. package/build/utils/math.cjs +1 -1
  206. package/build/utils/math.cjs.map +3 -3
  207. package/build/utils/object.cjs +8 -8
  208. package/build/utils/object.cjs.map +3 -3
  209. package/build/utils/order-inserter-block-items.cjs +1 -1
  210. package/build/utils/order-inserter-block-items.cjs.map +3 -3
  211. package/build/utils/pasting.cjs +4 -2
  212. package/build/utils/pasting.cjs.map +3 -3
  213. package/build/utils/selection.cjs +3 -2
  214. package/build/utils/selection.cjs.map +3 -3
  215. package/build/utils/sorting.cjs +9 -3
  216. package/build/utils/sorting.cjs.map +3 -3
  217. package/build/utils/transform-styles/index.cjs +3 -2
  218. package/build/utils/transform-styles/index.cjs.map +3 -3
  219. package/build/utils/transform-styles/postcss-urlrebase.d.cjs +2 -0
  220. package/build/utils/transform-styles/postcss-urlrebase.d.cjs.map +7 -0
  221. package/build/{components/rich-text/native/index.cjs → utils/transform-styles/types.cjs} +4 -13
  222. package/build/utils/transform-styles/types.cjs.map +7 -0
  223. package/build/utils/types.cjs +19 -0
  224. package/build/utils/types.cjs.map +7 -0
  225. package/build-module/components/block-card/index.mjs +5 -6
  226. package/build-module/components/block-card/index.mjs.map +2 -2
  227. package/build-module/components/block-compare/index.mjs +1 -1
  228. package/build-module/components/block-compare/index.mjs.map +2 -2
  229. package/build-module/components/block-editing-mode/index.mjs +14 -8
  230. package/build-module/components/block-editing-mode/index.mjs.map +2 -2
  231. package/build-module/components/block-inspector/index.mjs +35 -21
  232. package/build-module/components/block-inspector/index.mjs.map +2 -2
  233. package/build-module/components/block-mover/mover-description.mjs +6 -6
  234. package/build-module/components/block-mover/mover-description.mjs.map +1 -1
  235. package/build-module/components/block-patterns-list/index.mjs +1 -1
  236. package/build-module/components/block-patterns-list/index.mjs.map +2 -2
  237. package/build-module/components/block-patterns-paging/index.mjs +4 -4
  238. package/build-module/components/block-patterns-paging/index.mjs.map +2 -2
  239. package/build-module/components/block-popover/use-popover-scroll.mjs.map +1 -1
  240. package/build-module/components/block-quick-navigation/index.mjs +8 -6
  241. package/build-module/components/block-quick-navigation/index.mjs.map +2 -2
  242. package/build-module/components/block-rename/modal.mjs +0 -1
  243. package/build-module/components/block-rename/modal.mjs.map +2 -2
  244. package/build-module/components/block-switcher/block-transformations-menu.mjs +16 -15
  245. package/build-module/components/block-switcher/block-transformations-menu.mjs.map +2 -2
  246. package/build-module/components/block-switcher/index.mjs +4 -4
  247. package/build-module/components/block-switcher/index.mjs.map +2 -2
  248. package/build-module/components/block-toolbar/block-toolbar-icon.mjs +14 -6
  249. package/build-module/components/block-toolbar/block-toolbar-icon.mjs.map +2 -2
  250. package/build-module/components/block-toolbar/edit-section-button.mjs.map +1 -1
  251. package/build-module/components/block-tools/use-block-toolbar-popover-props.mjs +10 -4
  252. package/build-module/components/block-tools/use-block-toolbar-popover-props.mjs.map +2 -2
  253. package/build-module/components/child-layout-control/index.mjs +51 -19
  254. package/build-module/components/child-layout-control/index.mjs.map +2 -2
  255. package/build-module/components/colors-gradients/control.mjs +27 -15
  256. package/build-module/components/colors-gradients/control.mjs.map +2 -2
  257. package/build-module/components/colors-gradients/dropdown.mjs +4 -1
  258. package/build-module/components/colors-gradients/dropdown.mjs.map +2 -2
  259. package/build-module/components/contrast-checker/index.mjs +18 -4
  260. package/build-module/components/contrast-checker/index.mjs.map +2 -2
  261. package/build-module/components/date-format-picker/index.mjs +0 -1
  262. package/build-module/components/date-format-picker/index.mjs.map +2 -2
  263. package/build-module/components/dimensions-tool/index.mjs +4 -5
  264. package/build-module/components/dimensions-tool/index.mjs.map +2 -2
  265. package/build-module/components/dimensions-tool/scale-tool.mjs +1 -1
  266. package/build-module/components/dimensions-tool/scale-tool.mjs.map +2 -2
  267. package/build-module/components/global-styles/advanced-panel.mjs +23 -15
  268. package/build-module/components/global-styles/advanced-panel.mjs.map +2 -2
  269. package/build-module/components/global-styles/background-panel.mjs +157 -29
  270. package/build-module/components/global-styles/background-panel.mjs.map +2 -2
  271. package/build-module/components/global-styles/border-panel.mjs +2 -0
  272. package/build-module/components/global-styles/border-panel.mjs.map +2 -2
  273. package/build-module/components/global-styles/color-gradient-dropdown-item.mjs +207 -0
  274. package/build-module/components/global-styles/color-gradient-dropdown-item.mjs.map +7 -0
  275. package/build-module/components/global-styles/color-panel.mjs +106 -387
  276. package/build-module/components/global-styles/color-panel.mjs.map +3 -3
  277. package/build-module/components/global-styles/dimensions-panel.mjs +3 -7
  278. package/build-module/components/global-styles/dimensions-panel.mjs.map +2 -2
  279. package/build-module/components/global-styles/hooks.mjs +33 -0
  280. package/build-module/components/global-styles/hooks.mjs.map +2 -2
  281. package/build-module/components/global-styles/shadow-panel-components.mjs.map +2 -2
  282. package/build-module/components/global-styles/typography-panel.mjs +84 -10
  283. package/build-module/components/global-styles/typography-panel.mjs.map +2 -2
  284. package/build-module/components/grid/grid-item-resizer.mjs.map +1 -1
  285. package/build-module/components/grid/grid-visualizer.mjs.map +1 -1
  286. package/build-module/components/iframe/index.mjs +6 -3
  287. package/build-module/components/iframe/index.mjs.map +2 -2
  288. package/build-module/components/image-editor/use-transform-image.mjs.map +1 -1
  289. package/build-module/components/inner-blocks/use-inner-block-template-sync.mjs +3 -1
  290. package/build-module/components/inner-blocks/use-inner-block-template-sync.mjs.map +2 -2
  291. package/build-module/components/inserter/get-appender-label.mjs.map +1 -1
  292. package/build-module/components/inserter/hooks/use-patterns-state.mjs +1 -1
  293. package/build-module/components/inserter/hooks/use-patterns-state.mjs.map +2 -2
  294. package/build-module/components/inserter/index.mjs +185 -222
  295. package/build-module/components/inserter/index.mjs.map +3 -3
  296. package/build-module/components/inserter/media-tab/media-preview.mjs.map +2 -2
  297. package/build-module/components/inserter/search-items.mjs.map +1 -1
  298. package/build-module/components/inserter/search-results.mjs +1 -1
  299. package/build-module/components/inserter/search-results.mjs.map +2 -2
  300. package/build-module/components/inspector-controls/fill.mjs +1 -3
  301. package/build-module/components/inspector-controls/fill.mjs.map +2 -2
  302. package/build-module/components/inspector-controls/groups.mjs +2 -0
  303. package/build-module/components/inspector-controls/groups.mjs.map +2 -2
  304. package/build-module/components/inspector-controls-tabs/index.mjs.map +2 -2
  305. package/build-module/components/inspector-controls-tabs/styles-tab.mjs +76 -32
  306. package/build-module/components/inspector-controls-tabs/styles-tab.mjs.map +2 -2
  307. package/build-module/components/keyboard-shortcuts/index.mjs.map +1 -1
  308. package/build-module/components/line-height-control/index.mjs.map +1 -1
  309. package/build-module/components/link-control/index.mjs +2 -3
  310. package/build-module/components/link-control/index.mjs.map +2 -2
  311. package/build-module/components/link-control/normalize-url.mjs.map +1 -1
  312. package/build-module/components/list-view/block-select-button.mjs +10 -27
  313. package/build-module/components/list-view/block-select-button.mjs.map +2 -2
  314. package/build-module/components/list-view/block.mjs +2 -1
  315. package/build-module/components/list-view/block.mjs.map +2 -2
  316. package/build-module/components/list-view/utils.mjs.map +1 -1
  317. package/build-module/components/preset-input-control/custom-value-controls.mjs.map +2 -2
  318. package/build-module/components/provider/index.mjs.map +1 -1
  319. package/build-module/components/provider/use-block-sync.mjs +14 -3
  320. package/build-module/components/provider/use-block-sync.mjs.map +2 -2
  321. package/build-module/components/rich-text/event-listeners/before-input-rules.mjs +5 -5
  322. package/build-module/components/rich-text/event-listeners/before-input-rules.mjs.map +2 -2
  323. package/build-module/components/rich-text/event-listeners/delete.mjs +4 -4
  324. package/build-module/components/rich-text/event-listeners/delete.mjs.map +2 -2
  325. package/build-module/components/rich-text/event-listeners/enter.mjs +7 -2
  326. package/build-module/components/rich-text/event-listeners/enter.mjs.map +2 -2
  327. package/build-module/components/rich-text/event-listeners/input-events.mjs +4 -4
  328. package/build-module/components/rich-text/event-listeners/input-events.mjs.map +2 -2
  329. package/build-module/components/rich-text/event-listeners/input-rules.mjs +17 -4
  330. package/build-module/components/rich-text/event-listeners/input-rules.mjs.map +2 -2
  331. package/build-module/components/rich-text/event-listeners/insert-replacement-text.mjs +4 -4
  332. package/build-module/components/rich-text/event-listeners/insert-replacement-text.mjs.map +2 -2
  333. package/build-module/components/rich-text/event-listeners/paste-handler.mjs.map +1 -1
  334. package/build-module/components/rich-text/event-listeners/remove-browser-shortcuts.mjs +4 -4
  335. package/build-module/components/rich-text/event-listeners/remove-browser-shortcuts.mjs.map +2 -2
  336. package/build-module/components/rich-text/event-listeners/shortcuts.mjs +4 -4
  337. package/build-module/components/rich-text/event-listeners/shortcuts.mjs.map +2 -2
  338. package/build-module/components/rich-text/event-listeners/undo-automatic-change.mjs +4 -4
  339. package/build-module/components/rich-text/event-listeners/undo-automatic-change.mjs.map +2 -2
  340. package/build-module/components/rich-text/index.mjs +1 -23
  341. package/build-module/components/rich-text/index.mjs.map +2 -2
  342. package/build-module/components/rich-text/prevent-event-discovery.mjs +1 -1
  343. package/build-module/components/rich-text/prevent-event-discovery.mjs.map +1 -1
  344. package/build-module/components/url-popover/image-url-input-ui.mjs +0 -2
  345. package/build-module/components/url-popover/image-url-input-ui.mjs.map +2 -2
  346. package/build-module/components/use-block-commands/index.mjs +5 -5
  347. package/build-module/components/use-block-commands/index.mjs.map +2 -2
  348. package/build-module/components/use-block-display-information/index.mjs +10 -3
  349. package/build-module/components/use-block-display-information/index.mjs.map +2 -2
  350. package/build-module/components/writing-flow/use-tab-nav.mjs.map +1 -1
  351. package/build-module/hooks/anchor.mjs +12 -17
  352. package/build-module/hooks/anchor.mjs.map +2 -2
  353. package/build-module/hooks/background.mjs +123 -75
  354. package/build-module/hooks/background.mjs.map +2 -2
  355. package/build-module/hooks/block-fields/index.mjs +13 -2
  356. package/build-module/hooks/block-fields/index.mjs.map +2 -2
  357. package/build-module/hooks/border.mjs +1 -4
  358. package/build-module/hooks/border.mjs.map +2 -2
  359. package/build-module/hooks/color.mjs +2 -178
  360. package/build-module/hooks/color.mjs.map +2 -2
  361. package/build-module/hooks/contrast-checker.mjs +32 -19
  362. package/build-module/hooks/contrast-checker.mjs.map +2 -2
  363. package/build-module/hooks/custom-class-name.mjs +0 -1
  364. package/build-module/hooks/custom-class-name.mjs.map +2 -2
  365. package/build-module/hooks/dimensions.mjs +13 -6
  366. package/build-module/hooks/dimensions.mjs.map +2 -2
  367. package/build-module/hooks/elements.mjs +115 -0
  368. package/build-module/hooks/elements.mjs.map +7 -0
  369. package/build-module/hooks/fit-text.mjs +11 -0
  370. package/build-module/hooks/fit-text.mjs.map +2 -2
  371. package/build-module/hooks/grid-visualizer.mjs +21 -11
  372. package/build-module/hooks/grid-visualizer.mjs.map +2 -2
  373. package/build-module/hooks/layout-child.mjs +68 -10
  374. package/build-module/hooks/layout-child.mjs.map +2 -2
  375. package/build-module/hooks/layout.mjs +6 -3
  376. package/build-module/hooks/layout.mjs.map +2 -2
  377. package/build-module/hooks/list-view.mjs +10 -7
  378. package/build-module/hooks/list-view.mjs.map +2 -2
  379. package/build-module/hooks/position.mjs +20 -23
  380. package/build-module/hooks/position.mjs.map +2 -2
  381. package/build-module/hooks/spacing-visualizer.mjs.map +1 -1
  382. package/build-module/hooks/state-utils.mjs.map +1 -1
  383. package/build-module/hooks/states.mjs +2 -2
  384. package/build-module/hooks/states.mjs.map +2 -2
  385. package/build-module/hooks/style.mjs +53 -8
  386. package/build-module/hooks/style.mjs.map +2 -2
  387. package/build-module/hooks/supports.mjs +0 -7
  388. package/build-module/hooks/supports.mjs.map +2 -2
  389. package/build-module/hooks/typography.mjs +62 -10
  390. package/build-module/hooks/typography.mjs.map +2 -2
  391. package/build-module/layouts/flex.mjs +105 -7
  392. package/build-module/layouts/flex.mjs.map +2 -2
  393. package/build-module/private-apis.mjs +8 -0
  394. package/build-module/private-apis.mjs.map +2 -2
  395. package/build-module/store/actions.mjs +7 -3
  396. package/build-module/store/actions.mjs.map +2 -2
  397. package/build-module/store/private-actions.mjs +1 -2
  398. package/build-module/store/private-actions.mjs.map +2 -2
  399. package/build-module/store/private-selectors.mjs +39 -1
  400. package/build-module/store/private-selectors.mjs.map +2 -2
  401. package/build-module/store/reducer.mjs +14 -6
  402. package/build-module/store/reducer.mjs.map +2 -2
  403. package/build-module/store/selectors.mjs +62 -42
  404. package/build-module/store/selectors.mjs.map +2 -2
  405. package/build-module/utils/block-bindings.mjs +9 -9
  406. package/build-module/utils/block-bindings.mjs.map +3 -3
  407. package/build-module/utils/color-values.mjs +9 -1
  408. package/build-module/utils/color-values.mjs.map +3 -3
  409. package/build-module/utils/dom.mjs +2 -5
  410. package/build-module/utils/dom.mjs.map +3 -3
  411. package/build-module/utils/fit-text-frontend.mjs +6 -2
  412. package/build-module/utils/fit-text-frontend.mjs.map +3 -3
  413. package/build-module/utils/fit-text-utils.mjs +1 -1
  414. package/build-module/utils/fit-text-utils.mjs.map +3 -3
  415. package/build-module/utils/format-font-style.mjs +1 -1
  416. package/build-module/utils/format-font-style.mjs.map +3 -3
  417. package/build-module/utils/format-font-weight.mjs +1 -1
  418. package/build-module/utils/format-font-weight.mjs.map +3 -3
  419. package/build-module/utils/get-editor-region.mjs +4 -2
  420. package/build-module/utils/get-editor-region.mjs.map +3 -3
  421. package/build-module/utils/get-font-styles-and-weights.mjs +8 -12
  422. package/build-module/utils/get-font-styles-and-weights.mjs.map +3 -3
  423. package/build-module/utils/get-px-from-css-unit.mjs +1 -1
  424. package/build-module/utils/get-px-from-css-unit.mjs.map +1 -1
  425. package/build-module/utils/index.mjs +1 -1
  426. package/build-module/utils/index.mjs.map +1 -1
  427. package/build-module/utils/math.mjs +1 -1
  428. package/build-module/utils/math.mjs.map +3 -3
  429. package/build-module/utils/object.mjs +8 -8
  430. package/build-module/utils/object.mjs.map +3 -3
  431. package/build-module/utils/order-inserter-block-items.mjs +1 -1
  432. package/build-module/utils/order-inserter-block-items.mjs.map +3 -3
  433. package/build-module/utils/pasting.mjs +4 -2
  434. package/build-module/utils/pasting.mjs.map +3 -3
  435. package/build-module/utils/selection.mjs +3 -2
  436. package/build-module/utils/selection.mjs.map +3 -3
  437. package/build-module/utils/sorting.mjs +9 -3
  438. package/build-module/utils/sorting.mjs.map +3 -3
  439. package/build-module/utils/transform-styles/index.mjs +3 -2
  440. package/build-module/utils/transform-styles/index.mjs.map +3 -3
  441. package/build-module/utils/transform-styles/postcss-urlrebase.d.mjs +1 -0
  442. package/build-module/utils/transform-styles/postcss-urlrebase.d.mjs.map +7 -0
  443. package/build-module/utils/transform-styles/types.mjs +1 -0
  444. package/build-module/utils/transform-styles/types.mjs.map +7 -0
  445. package/build-module/utils/types.mjs +1 -0
  446. package/build-module/utils/types.mjs.map +7 -0
  447. package/build-style/content-rtl.css +14 -0
  448. package/build-style/content.css +14 -0
  449. package/build-style/style-rtl.css +60 -49
  450. package/build-style/style.css +60 -49
  451. package/build-types/utils/block-bindings.d.ts +27 -0
  452. package/build-types/utils/block-bindings.d.ts.map +1 -0
  453. package/build-types/utils/color-values.d.ts +40 -0
  454. package/build-types/utils/color-values.d.ts.map +1 -0
  455. package/build-types/utils/dom.d.ts +19 -19
  456. package/build-types/utils/dom.d.ts.map +1 -1
  457. package/build-types/utils/fit-text-frontend.d.ts +7 -0
  458. package/build-types/utils/fit-text-frontend.d.ts.map +1 -0
  459. package/build-types/utils/fit-text-utils.d.ts +15 -0
  460. package/build-types/utils/fit-text-utils.d.ts.map +1 -0
  461. package/build-types/utils/format-font-style.d.ts +12 -0
  462. package/build-types/utils/format-font-style.d.ts.map +1 -0
  463. package/build-types/utils/format-font-weight.d.ts +12 -0
  464. package/build-types/utils/format-font-weight.d.ts.map +1 -0
  465. package/build-types/utils/get-editor-region.d.ts +9 -0
  466. package/build-types/utils/get-editor-region.d.ts.map +1 -0
  467. package/build-types/utils/get-font-styles-and-weights.d.ts +16 -0
  468. package/build-types/utils/get-font-styles-and-weights.d.ts.map +1 -0
  469. package/build-types/utils/get-px-from-css-unit.d.ts +10 -0
  470. package/build-types/utils/get-px-from-css-unit.d.ts.map +1 -0
  471. package/build-types/utils/index.d.ts +3 -0
  472. package/build-types/utils/index.d.ts.map +1 -0
  473. package/build-types/utils/math.d.ts +61 -0
  474. package/build-types/utils/math.d.ts.map +1 -0
  475. package/build-types/utils/object.d.ts +39 -0
  476. package/build-types/utils/object.d.ts.map +1 -0
  477. package/build-types/utils/order-inserter-block-items.d.ts +13 -0
  478. package/build-types/utils/order-inserter-block-items.d.ts.map +1 -0
  479. package/build-types/utils/pasting.d.ts +28 -0
  480. package/build-types/utils/pasting.d.ts.map +1 -0
  481. package/build-types/utils/selection.d.ts +21 -0
  482. package/build-types/utils/selection.d.ts.map +1 -0
  483. package/build-types/utils/sorting.d.ts +17 -0
  484. package/build-types/utils/sorting.d.ts.map +1 -0
  485. package/build-types/utils/transform-styles/index.d.ts +15 -0
  486. package/build-types/utils/transform-styles/index.d.ts.map +1 -0
  487. package/build-types/utils/transform-styles/types.d.ts +13 -0
  488. package/build-types/utils/transform-styles/types.d.ts.map +1 -0
  489. package/build-types/utils/types.d.ts +28 -0
  490. package/build-types/utils/types.d.ts.map +1 -0
  491. package/package.json +55 -46
  492. package/src/components/alignment-control/test/__snapshots__/index.js.snap +6 -0
  493. package/src/components/block-alignment-control/test/__snapshots__/index.js.snap +5 -0
  494. package/src/components/block-breadcrumb/README.md +2 -2
  495. package/src/components/block-card/index.js +7 -13
  496. package/src/components/block-compare/README.md +6 -6
  497. package/src/components/block-compare/index.js +1 -3
  498. package/src/components/block-editing-mode/index.js +17 -9
  499. package/src/components/block-icon/test/__snapshots__/index.js.snap +1 -0
  500. package/src/components/block-inspector/index.js +22 -20
  501. package/src/components/block-patterns-list/index.js +1 -2
  502. package/src/components/block-preview/README.md +1 -1
  503. package/src/components/block-quick-navigation/index.js +7 -7
  504. package/src/components/block-rename/modal.js +0 -1
  505. package/src/components/block-switcher/block-transformations-menu.js +16 -18
  506. package/src/components/block-switcher/index.js +4 -4
  507. package/src/components/block-toolbar/block-toolbar-icon.js +22 -6
  508. package/src/components/block-toolbar/test/block-toolbar-icon.js +99 -0
  509. package/src/components/block-tools/use-block-toolbar-popover-props.js +10 -4
  510. package/src/components/block-types-list/README.md +0 -19
  511. package/src/components/block-vertical-alignment-control/test/__snapshots__/index.js.snap +4 -0
  512. package/src/components/child-layout-control/index.js +65 -20
  513. package/src/components/child-layout-control/test/index.js +64 -0
  514. package/src/components/colors-gradients/control.js +29 -12
  515. package/src/components/colors-gradients/dropdown.js +4 -1
  516. package/src/components/colors-gradients/style.scss +39 -2
  517. package/src/components/contrast-checker/README.md +9 -0
  518. package/src/components/contrast-checker/index.js +42 -3
  519. package/src/components/date-format-picker/index.js +0 -1
  520. package/src/components/default-block-appender/content.scss +3 -0
  521. package/src/components/dimensions-tool/index.js +4 -9
  522. package/src/components/dimensions-tool/scale-tool.js +1 -2
  523. package/src/components/dimensions-tool/test/index.js +89 -11
  524. package/src/components/global-styles/advanced-panel.js +5 -1
  525. package/src/components/global-styles/background-panel.js +203 -36
  526. package/src/components/global-styles/border-panel.js +2 -0
  527. package/src/components/global-styles/color-gradient-dropdown-item.js +258 -0
  528. package/src/components/global-styles/color-panel.js +125 -487
  529. package/src/components/global-styles/dimensions-panel.js +13 -18
  530. package/src/components/global-styles/hooks.js +45 -0
  531. package/src/components/global-styles/shadow-panel-components.js +0 -1
  532. package/src/components/global-styles/test/background-panel.js +56 -0
  533. package/src/components/global-styles/test/color-panel.js +172 -118
  534. package/src/components/global-styles/test/typography-panel.js +167 -0
  535. package/src/components/global-styles/typography-panel.js +100 -11
  536. package/src/components/iframe/index.js +8 -3
  537. package/src/components/inner-blocks/use-inner-block-template-sync.js +3 -1
  538. package/src/components/inserter/hooks/use-patterns-state.js +1 -1
  539. package/src/components/inserter/index.js +257 -288
  540. package/src/components/inserter/media-tab/media-preview.js +0 -1
  541. package/src/components/inserter/search-results.js +1 -3
  542. package/src/components/inspector-controls/README.md +0 -2
  543. package/src/components/inspector-controls/fill.js +6 -8
  544. package/src/components/inspector-controls/groups.js +2 -0
  545. package/src/components/inspector-controls-tabs/index.js +0 -1
  546. package/src/components/inspector-controls-tabs/styles-tab.js +78 -28
  547. package/src/components/justify-content-control/README.md +1 -1
  548. package/src/components/link-control/index.js +0 -1
  549. package/src/components/link-control/test/index.js +2 -3
  550. package/src/components/list-view/block-select-button.js +9 -29
  551. package/src/components/list-view/block.js +1 -0
  552. package/src/components/media-placeholder/README.md +1 -29
  553. package/src/components/media-upload/README.md +0 -19
  554. package/src/components/preset-input-control/custom-value-controls.js +0 -1
  555. package/src/components/provider/test/use-block-sync.js +40 -0
  556. package/src/components/provider/use-block-sync.js +15 -3
  557. package/src/components/rich-text/content.scss +2 -0
  558. package/src/components/rich-text/event-listeners/before-input-rules.js +5 -4
  559. package/src/components/rich-text/event-listeners/delete.js +9 -4
  560. package/src/components/rich-text/event-listeners/enter.js +9 -2
  561. package/src/components/rich-text/event-listeners/input-events.js +13 -4
  562. package/src/components/rich-text/event-listeners/input-rules.js +20 -4
  563. package/src/components/rich-text/event-listeners/insert-replacement-text.js +9 -4
  564. package/src/components/rich-text/event-listeners/remove-browser-shortcuts.js +9 -4
  565. package/src/components/rich-text/event-listeners/shortcuts.js +13 -4
  566. package/src/components/rich-text/event-listeners/undo-automatic-change.js +5 -4
  567. package/src/components/rich-text/index.js +1 -33
  568. package/src/components/unit-control/README.md +1 -1
  569. package/src/components/url-popover/README.md +1 -1
  570. package/src/components/url-popover/image-url-input-ui.js +0 -2
  571. package/src/components/use-block-commands/index.js +5 -5
  572. package/src/components/use-block-display-information/index.js +15 -2
  573. package/src/components/use-block-display-information/test/index.js +140 -0
  574. package/src/hooks/anchor.js +9 -18
  575. package/src/hooks/background.js +210 -133
  576. package/src/hooks/background.scss +0 -35
  577. package/src/hooks/block-fields/index.js +27 -2
  578. package/src/hooks/border.js +1 -5
  579. package/src/hooks/color.js +2 -210
  580. package/src/hooks/color.scss +3 -9
  581. package/src/hooks/contrast-checker.js +60 -17
  582. package/src/hooks/custom-class-name.js +0 -1
  583. package/src/hooks/dimensions.js +15 -8
  584. package/src/hooks/elements.js +140 -0
  585. package/src/hooks/elements.scss +8 -0
  586. package/src/hooks/fit-text.js +16 -0
  587. package/src/hooks/grid-visualizer.js +59 -45
  588. package/src/hooks/layout-child.js +92 -14
  589. package/src/hooks/layout.js +6 -3
  590. package/src/hooks/list-view.js +10 -11
  591. package/src/hooks/position.js +23 -27
  592. package/src/hooks/states.js +2 -2
  593. package/src/hooks/style.js +91 -9
  594. package/src/hooks/supports.js +0 -9
  595. package/src/hooks/test/background.js +59 -0
  596. package/src/hooks/test/block-style-state.js +14 -14
  597. package/src/hooks/test/dimensions.js +71 -0
  598. package/src/hooks/test/layout-child.js +165 -0
  599. package/src/hooks/test/layout.js +6 -6
  600. package/src/hooks/test/style.js +133 -11
  601. package/src/hooks/typography.js +70 -6
  602. package/src/layouts/flex.js +118 -15
  603. package/src/private-apis.js +8 -0
  604. package/src/store/actions.js +13 -3
  605. package/src/store/private-actions.js +1 -4
  606. package/src/store/private-selectors.js +89 -0
  607. package/src/store/reducer.js +19 -7
  608. package/src/store/selectors.js +91 -53
  609. package/src/store/test/actions.js +21 -0
  610. package/src/store/test/private-selectors.js +166 -7
  611. package/src/store/test/reducer.js +107 -10
  612. package/src/store/test/selectors.js +77 -0
  613. package/src/style.scss +1 -0
  614. package/src/utils/block-bindings.ts +51 -0
  615. package/src/utils/color-values.ts +63 -0
  616. package/src/utils/{dom.js → dom.ts} +27 -27
  617. package/src/utils/{fit-text-frontend.js → fit-text-frontend.ts} +12 -4
  618. package/src/utils/{fit-text-utils.js → fit-text-utils.ts} +15 -7
  619. package/src/utils/{format-font-style.js → format-font-style.ts} +10 -3
  620. package/src/utils/{format-font-weight.js → format-font-weight.ts} +10 -3
  621. package/src/utils/{get-editor-region.js → get-editor-region.ts} +10 -6
  622. package/src/utils/{get-font-styles-and-weights.js → get-font-styles-and-weights.ts} +21 -17
  623. package/src/utils/{math.js → math.ts} +37 -30
  624. package/src/utils/object.ts +89 -0
  625. package/src/utils/{order-inserter-block-items.js → order-inserter-block-items.ts} +8 -5
  626. package/src/utils/{pasting.js → pasting.ts} +18 -11
  627. package/src/utils/{selection.js → selection.ts} +11 -4
  628. package/src/utils/sorting.ts +81 -0
  629. package/src/utils/test/color-values.js +44 -1
  630. package/src/utils/transform-styles/{index.js → index.ts} +25 -25
  631. package/src/utils/transform-styles/postcss-urlrebase.d.ts +15 -0
  632. package/src/utils/transform-styles/types.ts +13 -0
  633. package/src/utils/types.ts +29 -0
  634. package/build/components/media-upload-progress/constants.cjs +0 -46
  635. package/build/components/media-upload-progress/constants.cjs.map +0 -7
  636. package/build/components/rich-text/native/format-edit.cjs +0 -60
  637. package/build/components/rich-text/native/format-edit.cjs.map +0 -7
  638. package/build/components/rich-text/native/index.cjs.map +0 -7
  639. package/build/components/rich-text/native/use-format-types.cjs +0 -139
  640. package/build/components/rich-text/native/use-format-types.cjs.map +0 -7
  641. package/build-module/components/media-upload-progress/constants.mjs +0 -16
  642. package/build-module/components/media-upload-progress/constants.mjs.map +0 -7
  643. package/build-module/components/rich-text/native/format-edit.mjs +0 -39
  644. package/build-module/components/rich-text/native/format-edit.mjs.map +0 -7
  645. package/build-module/components/rich-text/native/index.mjs +0 -7
  646. package/build-module/components/rich-text/native/index.mjs.map +0 -7
  647. package/build-module/components/rich-text/native/use-format-types.mjs +0 -114
  648. package/build-module/components/rich-text/native/use-format-types.mjs.map +0 -7
  649. package/src/components/audio-player/audio-url-parser.native.js +0 -20
  650. package/src/components/audio-player/index.native.js +0 -225
  651. package/src/components/audio-player/styles.native.scss +0 -114
  652. package/src/components/audio-player/test/audio-url-parser.native.js +0 -53
  653. package/src/components/block-alignment-control/test/index.native.js +0 -37
  654. package/src/components/block-alignment-control/ui.native.js +0 -86
  655. package/src/components/block-caption/README.md +0 -104
  656. package/src/components/block-caption/index.native.js +0 -89
  657. package/src/components/block-caption/styles.native.scss +0 -7
  658. package/src/components/block-controls/slot.native.js +0 -33
  659. package/src/components/block-draggable/draggable-chip.native.js +0 -49
  660. package/src/components/block-draggable/dropping-insertion-point.native.js +0 -181
  661. package/src/components/block-draggable/dropping-insertion-point.native.scss +0 -8
  662. package/src/components/block-draggable/index.native.js +0 -467
  663. package/src/components/block-draggable/style.native.scss +0 -19
  664. package/src/components/block-draggable/test/__snapshots__/index.native.js.snap +0 -73
  665. package/src/components/block-draggable/test/helpers.native.js +0 -182
  666. package/src/components/block-draggable/test/index.native.js +0 -419
  667. package/src/components/block-draggable/use-scroll-when-dragging.native.js +0 -135
  668. package/src/components/block-edit/edit.native.js +0 -49
  669. package/src/components/block-edit/test/edit.native.js +0 -65
  670. package/src/components/block-heading-level-dropdown/index.native.js +0 -68
  671. package/src/components/block-icon/index.native.js +0 -47
  672. package/src/components/block-icon/style.native.scss +0 -7
  673. package/src/components/block-list/block-crash-boundary.native.js +0 -43
  674. package/src/components/block-list/block-crash-warning.native.js +0 -21
  675. package/src/components/block-list/block-invalid-warning.native.js +0 -70
  676. package/src/components/block-list/block-list-context.native.js +0 -172
  677. package/src/components/block-list/block-list-item-cell.native.js +0 -62
  678. package/src/components/block-list/block-list-item.native.js +0 -209
  679. package/src/components/block-list/block-list-item.native.scss +0 -16
  680. package/src/components/block-list/block-outline.native.js +0 -77
  681. package/src/components/block-list/block-selection-button.native.js +0 -100
  682. package/src/components/block-list/block-selection-button.native.scss +0 -34
  683. package/src/components/block-list/block.native.js +0 -716
  684. package/src/components/block-list/block.native.scss +0 -62
  685. package/src/components/block-list/grid-item.native.js +0 -58
  686. package/src/components/block-list/index.native.js +0 -437
  687. package/src/components/block-list/insertion-point.native.js +0 -36
  688. package/src/components/block-list/style.native.scss +0 -117
  689. package/src/components/block-list/test/block-invalid-warning.native.js +0 -62
  690. package/src/components/block-list/test/block-list-context.native.js +0 -243
  691. package/src/components/block-list/test/block-outline.native.js +0 -255
  692. package/src/components/block-list/test/fixtures/block-list-context.native.js +0 -79
  693. package/src/components/block-list/test/index.native.js +0 -205
  694. package/src/components/block-list/use-block-props/index.native.js +0 -10
  695. package/src/components/block-list/use-scroll-upon-insertion.native.js +0 -52
  696. package/src/components/block-list-appender/index.native.js +0 -70
  697. package/src/components/block-list-appender/style.native.scss +0 -8
  698. package/src/components/block-media-update-progress/README.md +0 -100
  699. package/src/components/block-media-update-progress/index.native.js +0 -299
  700. package/src/components/block-media-update-progress/styles.native.scss +0 -9
  701. package/src/components/block-media-update-progress/test/index.native.js +0 -543
  702. package/src/components/block-mover/index.native.js +0 -193
  703. package/src/components/block-mover/mover-description.native.js +0 -155
  704. package/src/components/block-mover/test/__snapshots__/index.native.js.snap +0 -218
  705. package/src/components/block-mover/test/index.native.js +0 -186
  706. package/src/components/block-settings/button.native.js +0 -41
  707. package/src/components/block-settings/container.native.js +0 -91
  708. package/src/components/block-settings/container.native.scss +0 -4
  709. package/src/components/block-settings/index.native.js +0 -5
  710. package/src/components/block-styles/index.native.js +0 -94
  711. package/src/components/block-styles/preview.native.js +0 -109
  712. package/src/components/block-styles/style.native.scss +0 -64
  713. package/src/components/block-switcher/block-transformations-menu.native.js +0 -91
  714. package/src/components/block-toolbar/block-toolbar-menu.native.js +0 -477
  715. package/src/components/block-toolbar/index.native.js +0 -126
  716. package/src/components/block-toolbar/test/__snapshots__/block-toolbar-menu.native.js.snap +0 -125
  717. package/src/components/block-toolbar/test/block-toolbar-menu.native.js +0 -405
  718. package/src/components/block-toolbar/test/index.native.js +0 -36
  719. package/src/components/block-types-list/index.native.js +0 -175
  720. package/src/components/block-types-list/style.native.scss +0 -25
  721. package/src/components/block-variation-picker/index.native.js +0 -107
  722. package/src/components/block-variation-picker/style.native.scss +0 -32
  723. package/src/components/button-block-appender/index.native.js +0 -92
  724. package/src/components/button-block-appender/styles.native.scss +0 -43
  725. package/src/components/caption/README.md +0 -44
  726. package/src/components/caption/index.native.js +0 -61
  727. package/src/components/colors-gradients/panel-color-gradient-settings.native.js +0 -59
  728. package/src/components/contrast-checker/index.native.js +0 -113
  729. package/src/components/contrast-checker/style.native.scss +0 -26
  730. package/src/components/convert-to-group-buttons/index.native.js +0 -79
  731. package/src/components/default-block-appender/index.native.js +0 -113
  732. package/src/components/default-block-appender/style.native.scss +0 -18
  733. package/src/components/floating-toolbar/floatingToolbar.android.scss +0 -4
  734. package/src/components/floating-toolbar/floatingToolbar.ios.scss +0 -3
  735. package/src/components/floating-toolbar/index.native.js +0 -141
  736. package/src/components/floating-toolbar/styles.native.scss +0 -43
  737. package/src/components/font-sizes/index.native.js +0 -7
  738. package/src/components/global-styles/color-panel.native.js +0 -207
  739. package/src/components/global-styles/test/use-global-styles-context.native.js +0 -435
  740. package/src/components/global-styles/use-global-styles-context.native.js +0 -592
  741. package/src/components/gradients/index.native.js +0 -2
  742. package/src/components/image-link-destinations/index.native.js +0 -152
  743. package/src/components/image-link-destinations/style.native.scss +0 -16
  744. package/src/components/index.native.js +0 -108
  745. package/src/components/inner-blocks/constants.native.js +0 -5
  746. package/src/components/inner-blocks/index.native.js +0 -221
  747. package/src/components/inner-blocks/warning-max-depth-exceeded.native.js +0 -124
  748. package/src/components/inserter/block-types-tab.native.js +0 -76
  749. package/src/components/inserter/hooks/use-block-type-impressions.native.js +0 -47
  750. package/src/components/inserter/hooks/use-clipboard-block.native.js +0 -40
  751. package/src/components/inserter/index.native.js +0 -424
  752. package/src/components/inserter/menu.native.js +0 -237
  753. package/src/components/inserter/no-results.native.js +0 -49
  754. package/src/components/inserter/reusable-blocks-tab.native.js +0 -45
  755. package/src/components/inserter/search-results.native.js +0 -67
  756. package/src/components/inserter/style.native.scss +0 -83
  757. package/src/components/inserter/tabs.native.js +0 -152
  758. package/src/components/inserter/test/__snapshots__/index.native.js.snap +0 -117
  759. package/src/components/inserter/test/fixtures/index.native.js +0 -12
  760. package/src/components/inserter/test/index.native.js +0 -273
  761. package/src/components/inserter/test/reusable-blocks-tab.native.js +0 -62
  762. package/src/components/inserter/test/utils.native.js +0 -37
  763. package/src/components/inserter/utils.native.js +0 -46
  764. package/src/components/inserter-button/index.native.js +0 -108
  765. package/src/components/inserter-button/style.native.scss +0 -72
  766. package/src/components/inspector-controls/fill.native.js +0 -62
  767. package/src/components/inspector-controls/slot.native.js +0 -35
  768. package/src/components/inspector-controls-tabs/advanced-controls-panel.native.js +0 -31
  769. package/src/components/line-height-control/index.native.js +0 -28
  770. package/src/components/media-placeholder/index.native.js +0 -258
  771. package/src/components/media-placeholder/styles.native.scss +0 -108
  772. package/src/components/media-replace-flow/index.native.js +0 -12
  773. package/src/components/media-upload/constants.native.js +0 -14
  774. package/src/components/media-upload/index.native.js +0 -356
  775. package/src/components/media-upload/style.native.scss +0 -4
  776. package/src/components/media-upload/test/index.native.js +0 -172
  777. package/src/components/media-upload-progress/README.md +0 -100
  778. package/src/components/media-upload-progress/constants.js +0 -6
  779. package/src/components/media-upload-progress/index.native.js +0 -233
  780. package/src/components/media-upload-progress/styles.native.scss +0 -15
  781. package/src/components/media-upload-progress/test/index.native.js +0 -220
  782. package/src/components/plain-text/index.native.js +0 -164
  783. package/src/components/plain-text/style.native.scss +0 -10
  784. package/src/components/provider/index.native.js +0 -32
  785. package/src/components/rich-text/embed-handler-picker.native.js +0 -65
  786. package/src/components/rich-text/file-paste-handler.native.js +0 -3
  787. package/src/components/rich-text/format-toolbar/index.native.js +0 -21
  788. package/src/components/rich-text/format-toolbar-container.native.js +0 -16
  789. package/src/components/rich-text/index.native.js +0 -701
  790. package/src/components/rich-text/input-event.native.js +0 -10
  791. package/src/components/rich-text/native/format-edit.js +0 -44
  792. package/src/components/rich-text/native/get-format-colors.native.js +0 -47
  793. package/src/components/rich-text/native/index.js +0 -1
  794. package/src/components/rich-text/native/index.native.js +0 -1389
  795. package/src/components/rich-text/native/style.native.scss +0 -28
  796. package/src/components/rich-text/native/test/__snapshots__/index.native.js.snap +0 -79
  797. package/src/components/rich-text/native/test/index.native.js +0 -345
  798. package/src/components/rich-text/native/test/performance/rich-text.native.js +0 -44
  799. package/src/components/rich-text/native/toolbar-button-with-options.native.js +0 -61
  800. package/src/components/rich-text/native/use-format-types.js +0 -146
  801. package/src/components/rich-text/remove-browser-shortcuts.native.js +0 -1
  802. package/src/components/rich-text/shortcut.native.js +0 -10
  803. package/src/components/ungroup-button/README.md +0 -23
  804. package/src/components/ungroup-button/index.native.js +0 -77
  805. package/src/components/unsupported-block-details/index.native.js +0 -187
  806. package/src/components/unsupported-block-details/style.native.scss +0 -56
  807. package/src/components/url-input/index.native.js +0 -33
  808. package/src/components/use-block-drop-zone/index.native.js +0 -207
  809. package/src/components/use-on-block-drop/index.native.js +0 -115
  810. package/src/components/use-unsupported-block-editor/index.native.js +0 -59
  811. package/src/components/video-player/gridicon-play.native.js +0 -13
  812. package/src/components/video-player/index.native.js +0 -133
  813. package/src/components/video-player/styles.native.scss +0 -29
  814. package/src/components/warning/index.native.js +0 -64
  815. package/src/components/warning/style.native.scss +0 -47
  816. package/src/hooks/align.native.js +0 -49
  817. package/src/hooks/custom-class-name.native.js +0 -70
  818. package/src/hooks/index.native.js +0 -36
  819. package/src/hooks/layout.native.js +0 -23
  820. package/src/hooks/test/__snapshots__/align.native.js.snap +0 -73
  821. package/src/hooks/test/__snapshots__/anchor.native.js.snap +0 -7
  822. package/src/hooks/test/align.native.js +0 -134
  823. package/src/hooks/test/anchor.native.js +0 -32
  824. package/src/hooks/test/use-editor-wrapper-styles.native.js +0 -282
  825. package/src/hooks/typography.native.js +0 -60
  826. package/src/hooks/use-editor-wrapper-styles.native.js +0 -250
  827. package/src/hooks/use-editor-wrapper-styles.native.scss +0 -12
  828. package/src/index.native.js +0 -6
  829. package/src/private-apis.native.js +0 -21
  830. package/src/store/defaults.native.js +0 -23
  831. package/src/utils/block-bindings.js +0 -46
  832. package/src/utils/color-values.js +0 -28
  833. package/src/utils/object.js +0 -67
  834. package/src/utils/sorting.js +0 -54
  835. /package/src/utils/{get-px-from-css-unit.js → get-px-from-css-unit.ts} +0 -0
  836. /package/src/utils/{index.js → index.ts} +0 -0
@@ -12,8 +12,8 @@ var PSEUDO_STATE_LABELS = {
12
12
  ":active": __("Active")
13
13
  };
14
14
  var RESPONSIVE_STATE_LABELS = {
15
- tablet: __("Tablet"),
16
- mobile: __("Mobile")
15
+ "@tablet": __("Tablet"),
16
+ "@mobile": __("Mobile")
17
17
  };
18
18
  var VALID_BLOCK_PSEUDO_STATES = {
19
19
  "core/button": [":hover", ":focus", ":focus-visible", ":active"],
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/hooks/states.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { getBlockType } from '@wordpress/blocks';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport StateControl from '../components/global-styles/state-control';\nimport StateControlBadges from '../components/global-styles/state-control-badges';\nimport { useToolsPanelDropdownMenuProps } from '../components/global-styles/utils';\n\nexport const PSEUDO_STATE_LABELS = {\n\t':hover': __( 'Hover' ),\n\t':focus': __( 'Focus' ),\n\t':focus-visible': __( 'Focus-visible' ),\n\t':active': __( 'Active' ),\n};\n\nexport const RESPONSIVE_STATE_LABELS = {\n\ttablet: __( 'Tablet' ),\n\tmobile: __( 'Mobile' ),\n};\n\n// Keep in sync with WP_Theme_JSON_Gutenberg::VALID_BLOCK_PSEUDO_SELECTORS\n// and packages/global-styles-engine/src/core/render.tsx.\nexport const VALID_BLOCK_PSEUDO_STATES = {\n\t'core/button': [ ':hover', ':focus', ':focus-visible', ':active' ],\n\t'core/navigation-link': [ ':hover', ':focus', ':focus-visible', ':active' ],\n};\n\nfunction getPseudoStateOptions( name ) {\n\tconst validStates = VALID_BLOCK_PSEUDO_STATES[ name ] ?? [];\n\n\treturn validStates\n\t\t.filter( ( state ) => PSEUDO_STATE_LABELS[ state ] )\n\t\t.map( ( state ) => ( {\n\t\t\tvalue: state,\n\t\t\tlabel: PSEUDO_STATE_LABELS[ state ],\n\t\t} ) );\n}\n\nconst DEFAULT_STATE_VALUE = 'default';\n\nfunction getViewportStateOptions( name ) {\n\tif ( ! getBlockType( name )?.attributes?.style ) {\n\t\treturn [];\n\t}\n\n\treturn Object.entries( RESPONSIVE_STATE_LABELS ).map(\n\t\t( [ value, label ] ) => ( {\n\t\t\tvalue,\n\t\t\tlabel,\n\t\t} )\n\t);\n}\n\n/**\n * Renders a style-state selector in the block card header.\n * Viewport states are shown for blocks with a style attribute, while\n * pseudo-states are shown for blocks with configured pseudo-state support.\n *\n * @param {Object} props Component props.\n * @param {string} props.name Block name.\n * @param {Object} props.value Currently selected style-state value.\n * @param {Function} props.onChange Callback when style-state selection changes.\n * @return {Element|null} State control component, or null if not applicable.\n */\nexport function BlockStatesControl( { name, value, onChange } ) {\n\tconst viewportStateOptions = getViewportStateOptions( name );\n\tconst pseudoStateOptions = getPseudoStateOptions( name );\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\tif ( ! viewportStateOptions.length && ! pseudoStateOptions.length ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<StateControl\n\t\t\tviewportStates={ viewportStateOptions }\n\t\t\tpseudoStates={ pseudoStateOptions }\n\t\t\tviewportValue={ value?.viewport ?? DEFAULT_STATE_VALUE }\n\t\t\tpseudoStateValue={ value?.pseudo ?? DEFAULT_STATE_VALUE }\n\t\t\tonChangeViewport={ ( viewport ) => onChange( { viewport } ) }\n\t\t\tonChangePseudoState={ ( pseudo ) => onChange( { pseudo } ) }\n\t\t\tpopoverProps={ dropdownMenuProps.popoverProps }\n\t\t\tshowText={ false }\n\t\t/>\n\t);\n}\n\nexport function BlockStateBadges( { name, value } ) {\n\tconst viewportStateOptions = getViewportStateOptions( name );\n\tconst pseudoStateOptions = getPseudoStateOptions( name );\n\n\tif ( ! viewportStateOptions.length && ! pseudoStateOptions.length ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<StateControlBadges\n\t\t\tviewportStates={ viewportStateOptions }\n\t\t\tpseudoStates={ pseudoStateOptions }\n\t\t\tviewportValue={ value?.viewport ?? DEFAULT_STATE_VALUE }\n\t\t\tpseudoStateValue={ value?.pseudo ?? DEFAULT_STATE_VALUE }\n\t\t/>\n\t);\n}\n"],
5
- "mappings": ";AAGA,SAAS,oBAAoB;AAC7B,SAAS,UAAU;AAKnB,OAAO,kBAAkB;AACzB,OAAO,wBAAwB;AAC/B,SAAS,sCAAsC;AAoE7C;AAlEK,IAAM,sBAAsB;AAAA,EAClC,UAAU,GAAI,OAAQ;AAAA,EACtB,UAAU,GAAI,OAAQ;AAAA,EACtB,kBAAkB,GAAI,eAAgB;AAAA,EACtC,WAAW,GAAI,QAAS;AACzB;AAEO,IAAM,0BAA0B;AAAA,EACtC,QAAQ,GAAI,QAAS;AAAA,EACrB,QAAQ,GAAI,QAAS;AACtB;AAIO,IAAM,4BAA4B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B,sBAAuB,IAAK;AAEvD,MAAK,CAAE,qBAAqB,UAAU,CAAE,mBAAmB,QAAS;AACnE,WAAO;AAAA,EACR;AAEA,SACC;AAAA,IAAC;AAAA;AAAA,MACA,gBAAiB;AAAA,MACjB,cAAe;AAAA,MACf,eAAgB,OAAO,YAAY;AAAA,MACnC,kBAAmB,OAAO,UAAU;AAAA;AAAA,EACrC;AAEF;",
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { getBlockType } from '@wordpress/blocks';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport StateControl from '../components/global-styles/state-control';\nimport StateControlBadges from '../components/global-styles/state-control-badges';\nimport { useToolsPanelDropdownMenuProps } from '../components/global-styles/utils';\n\nexport const PSEUDO_STATE_LABELS = {\n\t':hover': __( 'Hover' ),\n\t':focus': __( 'Focus' ),\n\t':focus-visible': __( 'Focus-visible' ),\n\t':active': __( 'Active' ),\n};\n\nexport const RESPONSIVE_STATE_LABELS = {\n\t'@tablet': __( 'Tablet' ),\n\t'@mobile': __( 'Mobile' ),\n};\n\n// Keep in sync with WP_Theme_JSON_Gutenberg::VALID_BLOCK_PSEUDO_SELECTORS\n// and packages/global-styles-engine/src/core/render.tsx.\nexport const VALID_BLOCK_PSEUDO_STATES = {\n\t'core/button': [ ':hover', ':focus', ':focus-visible', ':active' ],\n\t'core/navigation-link': [ ':hover', ':focus', ':focus-visible', ':active' ],\n};\n\nfunction getPseudoStateOptions( name ) {\n\tconst validStates = VALID_BLOCK_PSEUDO_STATES[ name ] ?? [];\n\n\treturn validStates\n\t\t.filter( ( state ) => PSEUDO_STATE_LABELS[ state ] )\n\t\t.map( ( state ) => ( {\n\t\t\tvalue: state,\n\t\t\tlabel: PSEUDO_STATE_LABELS[ state ],\n\t\t} ) );\n}\n\nconst DEFAULT_STATE_VALUE = 'default';\n\nfunction getViewportStateOptions( name ) {\n\tif ( ! getBlockType( name )?.attributes?.style ) {\n\t\treturn [];\n\t}\n\n\treturn Object.entries( RESPONSIVE_STATE_LABELS ).map(\n\t\t( [ value, label ] ) => ( {\n\t\t\tvalue,\n\t\t\tlabel,\n\t\t} )\n\t);\n}\n\n/**\n * Renders a style-state selector in the block card header.\n * Viewport states are shown for blocks with a style attribute, while\n * pseudo-states are shown for blocks with configured pseudo-state support.\n *\n * @param {Object} props Component props.\n * @param {string} props.name Block name.\n * @param {Object} props.value Currently selected style-state value.\n * @param {Function} props.onChange Callback when style-state selection changes.\n * @return {Element|null} State control component, or null if not applicable.\n */\nexport function BlockStatesControl( { name, value, onChange } ) {\n\tconst viewportStateOptions = getViewportStateOptions( name );\n\tconst pseudoStateOptions = getPseudoStateOptions( name );\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\tif ( ! viewportStateOptions.length && ! pseudoStateOptions.length ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<StateControl\n\t\t\tviewportStates={ viewportStateOptions }\n\t\t\tpseudoStates={ pseudoStateOptions }\n\t\t\tviewportValue={ value?.viewport ?? DEFAULT_STATE_VALUE }\n\t\t\tpseudoStateValue={ value?.pseudo ?? DEFAULT_STATE_VALUE }\n\t\t\tonChangeViewport={ ( viewport ) => onChange( { viewport } ) }\n\t\t\tonChangePseudoState={ ( pseudo ) => onChange( { pseudo } ) }\n\t\t\tpopoverProps={ dropdownMenuProps.popoverProps }\n\t\t\tshowText={ false }\n\t\t/>\n\t);\n}\n\nexport function BlockStateBadges( { name, value } ) {\n\tconst viewportStateOptions = getViewportStateOptions( name );\n\tconst pseudoStateOptions = getPseudoStateOptions( name );\n\n\tif ( ! viewportStateOptions.length && ! pseudoStateOptions.length ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<StateControlBadges\n\t\t\tviewportStates={ viewportStateOptions }\n\t\t\tpseudoStates={ pseudoStateOptions }\n\t\t\tviewportValue={ value?.viewport ?? DEFAULT_STATE_VALUE }\n\t\t\tpseudoStateValue={ value?.pseudo ?? DEFAULT_STATE_VALUE }\n\t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,SACC;AAAA,IAAC;AAAA;AAAA,MACA,gBAAiB;AAAA,MACjB,cAAe;AAAA,MACf,eAAgB,OAAO,YAAY;AAAA,MACnC,kBAAmB,OAAO,UAAU;AAAA,MACpC,kBAAmB,CAAE,aAAc,SAAU,EAAE,SAAS,CAAE;AAAA,MAC1D,qBAAsB,CAAE,WAAY,SAAU,EAAE,OAAO,CAAE;AAAA,MACzD,cAAe,kBAAkB;AAAA,MACjC,UAAW;AAAA;AAAA,EACZ;AAEF;AAEO,SAAS,iBAAkB,EAAE,MAAM,MAAM,GAAI;AACnD,QAAM,uBAAuB,wBAAyB,IAAK;AAC3D,QAAM,qBAAqB,sBAAuB,IAAK;AAEvD,MAAK,CAAE,qBAAqB,UAAU,CAAE,mBAAmB,QAAS;AACnE,WAAO;AAAA,EACR;AAEA,SACC;AAAA,IAAC;AAAA;AAAA,MACA,gBAAiB;AAAA,MACjB,cAAe;AAAA,MACf,eAAgB,OAAO,YAAY;AAAA,MACnC,kBAAmB,OAAO,UAAU;AAAA;AAAA,EACrC;AAEF;",
6
6
  "names": []
7
7
  }
@@ -13,7 +13,8 @@ import { useInstanceId } from "@wordpress/compose";
13
13
  import { getCSSRules, compileCSS } from "@wordpress/style-engine";
14
14
  import { BACKGROUND_SUPPORT_KEY, BackgroundImagePanel } from "./background.mjs";
15
15
  import { BORDER_SUPPORT_KEY, BorderPanel, SHADOW_SUPPORT_KEY } from "./border.mjs";
16
- import { COLOR_SUPPORT_KEY, ColorEdit } from "./color.mjs";
16
+ import { COLOR_SUPPORT_KEY } from "./color.mjs";
17
+ import { ElementsEdit } from "./elements.mjs";
17
18
  import {
18
19
  TypographyPanel,
19
20
  TYPOGRAPHY_SUPPORT_KEY,
@@ -22,7 +23,8 @@ import {
22
23
  import {
23
24
  DIMENSIONS_SUPPORT_KEY,
24
25
  SPACING_SUPPORT_KEY,
25
- DimensionsPanel
26
+ DimensionsPanel,
27
+ isExplicitAspectRatio
26
28
  } from "./dimensions.mjs";
27
29
  import {
28
30
  cleanEmptyObject,
@@ -47,8 +49,8 @@ import { unlock } from "../lock-unlock.mjs";
47
49
  import { jsx, jsxs } from "react/jsx-runtime";
48
50
  var BORDER_SIDES = ["Top", "Right", "Bottom", "Left"];
49
51
  var RESPONSIVE_BREAKPOINTS = {
50
- mobile: "@media (width <= 480px)",
51
- tablet: "@media (480px < width <= 782px)"
52
+ "@mobile": "@media (width <= 480px)",
53
+ "@tablet": "@media (480px < width <= 782px)"
52
54
  };
53
55
  var styleSupportKeys = [
54
56
  ...TYPOGRAPHY_SUPPORT_KEYS,
@@ -91,12 +93,52 @@ function getStateFallbackBorderStyles(stateStyles) {
91
93
  });
92
94
  return cleanEmptyObject({ border: cleanEmptyObject(fallbackBorder) });
93
95
  }
96
+ function getStateBackgroundResetCSS(stateStyles, selector) {
97
+ const hasSolidBackground = !!stateStyles?.color?.background;
98
+ if (!hasSolidBackground) {
99
+ return void 0;
100
+ }
101
+ const hasColorGradient = !!stateStyles?.color?.gradient;
102
+ const hasBackgroundGradient = !!stateStyles?.background?.gradient || !!stateStyles?.background?.backgroundImage;
103
+ if (hasColorGradient || hasBackgroundGradient) {
104
+ return void 0;
105
+ }
106
+ const declaration = "background-image: unset !important";
107
+ return selector ? `${selector} { ${declaration}; }` : `${declaration};`;
108
+ }
109
+ function getStateFallbackDimensionStyles(stateStyles) {
110
+ const dimensions = stateStyles?.dimensions;
111
+ if (!dimensions) {
112
+ return void 0;
113
+ }
114
+ if (isExplicitAspectRatio(dimensions.aspectRatio)) {
115
+ return {
116
+ dimensions: {
117
+ minHeight: "unset",
118
+ height: "unset"
119
+ }
120
+ };
121
+ }
122
+ if (dimensions.minHeight || dimensions.height) {
123
+ return {
124
+ dimensions: {
125
+ aspectRatio: "unset"
126
+ }
127
+ };
128
+ }
129
+ }
94
130
  function getStateStylesCSS(stateStyles, selector) {
95
- const css = compileCSS(stateStyles, { selector });
131
+ const fallbackDimensionStyles = getStateFallbackDimensionStyles(stateStyles);
132
+ const stylesWithDimensionFallbacks = fallbackDimensionStyles ? mergeStyleObjects(stateStyles, fallbackDimensionStyles) : stateStyles;
133
+ const css = compileCSS(stylesWithDimensionFallbacks, { selector });
96
134
  const importantCSS = css ? css.replace(/;/g, " !important;") : void 0;
97
135
  const fallbackBorderStyles = getStateFallbackBorderStyles(stateStyles);
98
136
  const fallbackCSS = fallbackBorderStyles ? compileCSS(fallbackBorderStyles, { selector }) : void 0;
99
- return [importantCSS, fallbackCSS].filter(Boolean).join("\n");
137
+ const backgroundResetCSS = getStateBackgroundResetCSS(
138
+ stateStyles,
139
+ selector
140
+ );
141
+ return [importantCSS, fallbackCSS, backgroundResetCSS].filter(Boolean).join("\n");
100
142
  }
101
143
  function isPlainObject(value) {
102
144
  return !!value && typeof value === "object" && !Array.isArray(value);
@@ -208,7 +250,10 @@ function getResponsiveStateCSSRules(style, name, baseSelector) {
208
250
  const nestedStateKeys = ["elements", ...validPseudoStates];
209
251
  Object.entries(RESPONSIVE_BREAKPOINTS).forEach(
210
252
  ([viewport, mediaQuery]) => {
211
- const viewportStyles = style?.[viewport];
253
+ const viewportStyles = getStyleForState(style, {
254
+ viewport,
255
+ pseudo: DEFAULT_BLOCK_STYLE_STATE.pseudo
256
+ });
212
257
  if (!viewportStyles) {
213
258
  return;
214
259
  }
@@ -437,7 +482,7 @@ function BlockStyleControls({
437
482
  settings: panelSettings
438
483
  };
439
484
  return /* @__PURE__ */ jsxs(BlockStyleStateProvider, { value: selectedState, children: [
440
- /* @__PURE__ */ jsx(ColorEdit, { ...passedProps }),
485
+ /* @__PURE__ */ jsx(ElementsEdit, { ...passedProps }),
441
486
  /* @__PURE__ */ jsx(BackgroundImagePanel, { ...passedProps }),
442
487
  /* @__PURE__ */ jsx(TypographyPanel, { ...passedProps }),
443
488
  /* @__PURE__ */ jsx(BorderPanel, { ...passedProps }),
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/hooks/style.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { addFilter } from '@wordpress/hooks';\nimport { useSelect } from '@wordpress/data';\nimport { mergeGlobalStyles } from '@wordpress/global-styles-engine';\nimport {\n\tgetBlockSupport,\n\tgetBlockType,\n\thasBlockSupport,\n\t__EXPERIMENTAL_ELEMENTS as ELEMENTS,\n} from '@wordpress/blocks';\nimport { useInstanceId } from '@wordpress/compose';\nimport { getCSSRules, compileCSS } from '@wordpress/style-engine';\n\n/**\n * Internal dependencies\n */\nimport { BACKGROUND_SUPPORT_KEY, BackgroundImagePanel } from './background';\nimport { BORDER_SUPPORT_KEY, BorderPanel, SHADOW_SUPPORT_KEY } from './border';\nimport { COLOR_SUPPORT_KEY, ColorEdit } from './color';\nimport {\n\tTypographyPanel,\n\tTYPOGRAPHY_SUPPORT_KEY,\n\tTYPOGRAPHY_SUPPORT_KEYS,\n} from './typography';\nimport {\n\tDIMENSIONS_SUPPORT_KEY,\n\tSPACING_SUPPORT_KEY,\n\tDimensionsPanel,\n} from './dimensions';\nimport {\n\tcleanEmptyObject,\n\tshouldSkipSerialization,\n\tuseStyleOverride,\n\tuseBlockSettings,\n} from './utils';\nimport {\n\tBlockStyleStateProvider,\n\tDEFAULT_BLOCK_STYLE_STATE,\n\tgetStyleForState,\n\thasViewportBlockStyleState,\n\thasPseudoBlockStyleState,\n} from './block-style-state';\nimport { VALID_BLOCK_PSEUDO_STATES } from './states';\nimport { buildScopedBlockSelector } from './state-utils';\nimport { scopeSelector } from '../components/global-styles/utils';\nimport { useBlockEditingMode } from '../components/block-editing-mode';\nimport { store as blockEditorStore } from '../store';\nimport { globalStylesDataKey } from '../store/private-keys';\nimport { unlock } from '../lock-unlock';\n\nconst BORDER_SIDES = [ 'Top', 'Right', 'Bottom', 'Left' ];\n\n// Keep in sync with WP_Theme_JSON_Gutenberg::RESPONSIVE_BREAKPOINTS and\n// packages/global-styles-engine/src/core/render.tsx.\nconst RESPONSIVE_BREAKPOINTS = {\n\tmobile: '@media (width <= 480px)',\n\ttablet: '@media (480px < width <= 782px)',\n};\n\nconst styleSupportKeys = [\n\t...TYPOGRAPHY_SUPPORT_KEYS,\n\tBORDER_SUPPORT_KEY,\n\tCOLOR_SUPPORT_KEY,\n\tDIMENSIONS_SUPPORT_KEY,\n\tBACKGROUND_SUPPORT_KEY,\n\tSPACING_SUPPORT_KEY,\n\tSHADOW_SUPPORT_KEY,\n];\n\nconst hasStyleSupport = ( nameOrType ) =>\n\tstyleSupportKeys.some( ( key ) => hasBlockSupport( nameOrType, key ) );\n\n/**\n * Returns the inline styles to add depending on the style object\n *\n * @param {Object} styles Styles configuration.\n *\n * @return {Object} Flattened CSS variables declaration.\n */\nexport function getInlineStyles( styles = {} ) {\n\tconst output = {};\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\tgetCSSRules( styles ).forEach( ( rule ) => {\n\t\toutput[ rule.key ] = rule.value;\n\t} );\n\n\treturn output;\n}\n\n/**\n * Returns fallback border styles for visible state border styles.\n *\n * State styles are emitted as stylesheet rules rather than inline styles, so\n * they cannot rely on the block-library inline-style attribute fallback rules.\n *\n * @param {Object} stateStyles State style object.\n * @return {Object|undefined} Style object containing fallback border styles.\n */\nfunction getStateFallbackBorderStyles( stateStyles ) {\n\tconst border = stateStyles?.border;\n\tif ( ! border ) {\n\t\treturn undefined;\n\t}\n\n\tconst hasBorderStyle = !! border.style;\n\tconst hasBorderColor = !! border.color;\n\tconst hasBorderWidth = !! border.width;\n\tconst fallbackBorder = {};\n\n\tif ( ! hasBorderStyle && ( hasBorderColor || hasBorderWidth ) ) {\n\t\tfallbackBorder.style = 'solid';\n\t}\n\n\tBORDER_SIDES.forEach( ( side ) => {\n\t\tconst sideKey = side.toLowerCase();\n\t\tconst sideBorder = border[ sideKey ];\n\t\tconst hasSideStyle = !! sideBorder?.style;\n\t\tconst hasSideColor = !! sideBorder?.color;\n\t\tconst hasSideWidth = !! sideBorder?.width;\n\n\t\tif (\n\t\t\t! hasBorderStyle &&\n\t\t\t! hasSideStyle &&\n\t\t\t( hasSideColor || hasSideWidth )\n\t\t) {\n\t\t\tfallbackBorder[ sideKey ] = { style: 'solid' };\n\t\t}\n\t} );\n\n\treturn cleanEmptyObject( { border: cleanEmptyObject( fallbackBorder ) } );\n}\n\n/**\n * Generates CSS for a block instance state style object.\n *\n * State declarations need to win over preset utility classes, but fallback\n * border styles should not become important because they must not override\n * explicitly authored default border styles.\n *\n * @param {Object} stateStyles State style object.\n * @param {string} selector CSS selector for the generated style.\n * @return {string} Generated stylesheet.\n */\nexport function getStateStylesCSS( stateStyles, selector ) {\n\tconst css = compileCSS( stateStyles, { selector } );\n\tconst importantCSS = css ? css.replace( /;/g, ' !important;' ) : undefined;\n\tconst fallbackBorderStyles = getStateFallbackBorderStyles( stateStyles );\n\tconst fallbackCSS = fallbackBorderStyles\n\t\t? compileCSS( fallbackBorderStyles, { selector } )\n\t\t: undefined;\n\n\treturn [ importantCSS, fallbackCSS ].filter( Boolean ).join( '\\n' );\n}\n\nfunction isPlainObject( value ) {\n\treturn !! value && typeof value === 'object' && ! Array.isArray( value );\n}\n\nfunction mergeStyleObjects( target = {}, source = {} ) {\n\tconst merged = { ...target };\n\n\tObject.entries( source ).forEach( ( [ key, value ] ) => {\n\t\tmerged[ key ] =\n\t\t\tisPlainObject( value ) && isPlainObject( merged[ key ] )\n\t\t\t\t? mergeStyleObjects( merged[ key ], value )\n\t\t\t\t: value;\n\t} );\n\n\treturn merged;\n}\n\nfunction addStyleGroup( groups, selector, style ) {\n\tconst key = selector || '';\n\tconst existing = groups.get( key ) || { selector, style: {} };\n\n\tgroups.set( key, {\n\t\tselector,\n\t\tstyle: mergeStyleObjects( existing.style, style ),\n\t} );\n}\n\nfunction getStateStyleGroups( stateStyles, name ) {\n\tconst blockSelectors = getBlockType( name )?.selectors || {};\n\tconst groups = new Map();\n\n\tObject.entries( stateStyles || {} ).forEach(\n\t\t( [ feature, featureStyles ] ) => {\n\t\t\tconst featureSelectors = blockSelectors[ feature ];\n\n\t\t\tif ( typeof featureSelectors === 'string' ) {\n\t\t\t\taddStyleGroup( groups, featureSelectors, {\n\t\t\t\t\t[ feature ]: featureStyles,\n\t\t\t\t} );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\tisPlainObject( featureSelectors ) &&\n\t\t\t\tisPlainObject( featureStyles )\n\t\t\t) {\n\t\t\t\tconst remainingStyles = { ...featureStyles };\n\n\t\t\t\tObject.entries( featureSelectors ).forEach(\n\t\t\t\t\t( [ subfeature, subfeatureSelector ] ) => {\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tsubfeature === 'root' ||\n\t\t\t\t\t\t\ttypeof subfeatureSelector !== 'string' ||\n\t\t\t\t\t\t\t! Object.hasOwn( featureStyles, subfeature )\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\taddStyleGroup( groups, subfeatureSelector, {\n\t\t\t\t\t\t\t[ feature ]: {\n\t\t\t\t\t\t\t\t[ subfeature ]: featureStyles[ subfeature ],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t} );\n\t\t\t\t\t\tdelete remainingStyles[ subfeature ];\n\t\t\t\t\t}\n\t\t\t\t);\n\n\t\t\t\tif ( Object.keys( remainingStyles ).length ) {\n\t\t\t\t\taddStyleGroup(\n\t\t\t\t\t\tgroups,\n\t\t\t\t\t\tfeatureSelectors.root || blockSelectors.root,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t[ feature ]: remainingStyles,\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\taddStyleGroup( groups, blockSelectors.root, {\n\t\t\t\t[ feature ]: featureStyles,\n\t\t\t} );\n\t\t}\n\t);\n\n\treturn Array.from( groups.values() );\n}\n\n/**\n * Generates CSS for block instance state styles, honoring feature selectors.\n *\n * @param {Object} stateStyles State style object.\n * @param {Object} options Generation options.\n * @param {string} options.name Block name.\n * @param {string} options.baseSelector Block-instance scoping selector.\n * @param {string=} options.state Optional pseudo-state, e.g. \":hover\".\n * @return {string|undefined} Generated stylesheet.\n */\nexport function getBlockStateStylesCSS( stateStyles, options ) {\n\tconst { name, baseSelector, state = '' } = options;\n\tconst rules = getStateStyleGroups( stateStyles, name )\n\t\t.map( ( { selector: blockSelector, style } ) =>\n\t\t\tgetStateStylesCSS(\n\t\t\t\tstyle,\n\t\t\t\tbuildScopedBlockSelector( baseSelector, blockSelector, state )\n\t\t\t)\n\t\t)\n\t\t.filter( Boolean );\n\n\treturn rules.length ? rules.join( '\\n' ) : undefined;\n}\n\n/**\n * Returns a style object with nested state/element keys removed.\n *\n * Viewport state objects can contain root declarations alongside nested\n * `elements` and pseudo-state styles. Only root declarations should be passed\n * to the style engine for the viewport root selector.\n *\n * @param {Object} stateStyles Style object for a selected state.\n * @param {string[]} nestedKeys Keys to remove from the root style object.\n * @return {Object|undefined} Root-only style object.\n */\nfunction getRootStateStyles( stateStyles, nestedKeys ) {\n\tif ( ! stateStyles ) {\n\t\treturn stateStyles;\n\t}\n\n\tconst rootStyles = { ...stateStyles };\n\tnestedKeys.forEach( ( key ) => {\n\t\tdelete rootStyles[ key ];\n\t} );\n\treturn rootStyles;\n}\n\n/**\n * Generates CSS rules for supported pseudo-state styles.\n *\n * @param {Object} style Block style object containing pseudo-state styles.\n * @param {string} name Block name.\n * @param {string} baseSelector Base selector used to scope generated CSS.\n * @return {string[]} Generated CSS rule strings.\n */\nfunction getPseudoStateCSSRules( style, name, baseSelector ) {\n\tconst validPseudoStates = VALID_BLOCK_PSEUDO_STATES[ name ];\n\tif ( ! validPseudoStates ) {\n\t\treturn [];\n\t}\n\n\tconst cssRules = [];\n\tvalidPseudoStates.forEach( ( pseudoState ) => {\n\t\tconst stateStyles = style?.[ pseudoState ];\n\t\tif ( stateStyles ) {\n\t\t\tconst css = getBlockStateStylesCSS( stateStyles, {\n\t\t\t\tname,\n\t\t\t\tbaseSelector,\n\t\t\t\tstate: pseudoState,\n\t\t\t} );\n\t\t\tif ( css ) {\n\t\t\t\tcssRules.push( css );\n\t\t\t}\n\t\t}\n\t} );\n\treturn cssRules;\n}\n\n/**\n * Generates CSS rules for responsive block instance style states.\n *\n * Each responsive state can contain root styles, element styles, and nested\n * pseudo-state styles. Generated rules are wrapped in the matching breakpoint\n * media query.\n *\n * @param {Object} style Block style object containing responsive states.\n * @param {string} name Block name.\n * @param {string} baseSelector Base selector used to scope generated CSS.\n * @return {string[]} Generated CSS rule strings.\n */\nexport function getResponsiveStateCSSRules( style, name, baseSelector ) {\n\tconst cssRules = [];\n\tconst validPseudoStates = VALID_BLOCK_PSEUDO_STATES[ name ] ?? [];\n\tconst nestedStateKeys = [ 'elements', ...validPseudoStates ];\n\n\tObject.entries( RESPONSIVE_BREAKPOINTS ).forEach(\n\t\t( [ viewport, mediaQuery ] ) => {\n\t\t\tconst viewportStyles = style?.[ viewport ];\n\t\t\tif ( ! viewportStyles ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst viewportCSSRules = [];\n\t\t\tconst rootCSS = getBlockStateStylesCSS(\n\t\t\t\tgetRootStateStyles( viewportStyles, nestedStateKeys ),\n\t\t\t\t{\n\t\t\t\t\tname,\n\t\t\t\t\tbaseSelector,\n\t\t\t\t}\n\t\t\t);\n\t\t\tif ( rootCSS ) {\n\t\t\t\tviewportCSSRules.push( rootCSS );\n\t\t\t}\n\n\t\t\tconst elementCSS = getElementCSSRules(\n\t\t\t\tviewportStyles.elements,\n\t\t\t\tname,\n\t\t\t\tbaseSelector\n\t\t\t);\n\t\t\tif ( elementCSS ) {\n\t\t\t\tviewportCSSRules.push( elementCSS );\n\t\t\t}\n\n\t\t\tviewportCSSRules.push(\n\t\t\t\t...getPseudoStateCSSRules( viewportStyles, name, baseSelector )\n\t\t\t);\n\n\t\t\tif ( viewportCSSRules.length ) {\n\t\t\t\tcssRules.push(\n\t\t\t\t\t`${ mediaQuery }{${ viewportCSSRules.join( '' ) }}`\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t);\n\n\treturn cssRules;\n}\n\n/**\n * Returns the style value used to force-preview a selected state on canvas.\n *\n * Responsive pseudo states inherit from their default-viewport pseudo state.\n * For example, selecting `mobile + :hover` should preview styles from\n * `:hover`, with `mobile.:hover` values layered on top when present.\n *\n * @param {Object} style Block style object.\n * @param {Object} selectedState Selected block style state.\n * @return {Object|undefined} Style value for the canvas preview.\n */\nexport function getCanvasStateStyleValue( style, selectedState ) {\n\tconst stateValue = getStyleForState( style, selectedState );\n\tif ( ! hasViewportBlockStyleState( selectedState ) ) {\n\t\treturn stateValue;\n\t}\n\n\tconst defaultViewportState = {\n\t\t...selectedState,\n\t\tviewport: DEFAULT_BLOCK_STYLE_STATE.viewport,\n\t};\n\tconst defaultViewportStateValue = getStyleForState(\n\t\tstyle,\n\t\tdefaultViewportState\n\t);\n\n\tif ( defaultViewportStateValue && stateValue ) {\n\t\treturn mergeGlobalStyles( defaultViewportStateValue, stateValue );\n\t}\n\treturn stateValue || defaultViewportStateValue;\n}\n\n/**\n * Filters registered block settings, extending attributes to include `style` attribute.\n *\n * @param {Object} settings Original block settings.\n *\n * @return {Object} Filtered block settings.\n */\nfunction addAttribute( settings ) {\n\tif (\n\t\t! hasStyleSupport( settings ) &&\n\t\t! hasBlockSupport( settings, 'customCSS', true )\n\t) {\n\t\treturn settings;\n\t}\n\n\t// Allow blocks to specify their own attribute definition with default values if needed.\n\tif ( ! settings.attributes.style ) {\n\t\tObject.assign( settings.attributes, {\n\t\t\tstyle: {\n\t\t\t\ttype: 'object',\n\t\t\t},\n\t\t} );\n\t}\n\n\treturn settings;\n}\n\n/**\n * A dictionary of paths to flag skipping block support serialization as the key,\n * with values providing the style paths to be omitted from serialization.\n *\n * @constant\n * @type {Record<string, string[]>}\n */\nconst skipSerializationPathsEdit = {\n\t[ `${ BORDER_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [ 'border' ],\n\t[ `${ COLOR_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [\n\t\tCOLOR_SUPPORT_KEY,\n\t],\n\t[ `${ TYPOGRAPHY_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [\n\t\tTYPOGRAPHY_SUPPORT_KEY,\n\t],\n\t[ `${ DIMENSIONS_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [\n\t\tDIMENSIONS_SUPPORT_KEY,\n\t],\n\t[ `${ SPACING_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [\n\t\tSPACING_SUPPORT_KEY,\n\t],\n\t[ `${ SHADOW_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [\n\t\tSHADOW_SUPPORT_KEY,\n\t],\n};\n\n/**\n * A dictionary of paths to flag skipping block support serialization as the key,\n * with values providing the style paths to be omitted from serialization.\n *\n * Extends the Edit skip paths to enable skipping additional paths in just\n * the Save component. This allows a block support to be serialized within the\n * editor, while using an alternate approach, such as server-side rendering, when\n * the support is saved.\n *\n * @constant\n * @type {Record<string, string[]>}\n */\nconst skipSerializationPathsSave = {\n\t...skipSerializationPathsEdit,\n\t[ `${ DIMENSIONS_SUPPORT_KEY }.aspectRatio` ]: [\n\t\t`${ DIMENSIONS_SUPPORT_KEY }.aspectRatio`,\n\t], // Skip serialization of aspect ratio in save mode.\n\t[ `${ BACKGROUND_SUPPORT_KEY }` ]: [ BACKGROUND_SUPPORT_KEY ], // Skip serialization of background support in save mode.\n};\n\nconst skipSerializationPathsSaveChecks = {\n\t[ `${ DIMENSIONS_SUPPORT_KEY }.aspectRatio` ]: true,\n\t[ `${ BACKGROUND_SUPPORT_KEY }` ]: true,\n};\n\n/**\n * A dictionary used to normalize feature names between support flags, style\n * object properties and __experimentSkipSerialization configuration arrays.\n *\n * This allows not having to provide a migration for a support flag and possible\n * backwards compatibility bridges, while still achieving consistency between\n * the support flag and the skip serialization array.\n *\n * @constant\n * @type {Record<string, string>}\n */\nconst renamedFeatures = { gradients: 'gradient' };\n\n/**\n * A utility function used to remove one or more paths from a style object.\n * Works in a way similar to Lodash's `omit()`. See unit tests and examples below.\n *\n * It supports a single string path:\n *\n * ```\n * omitStyle( { color: 'red' }, 'color' ); // {}\n * ```\n *\n * or an array of paths:\n *\n * ```\n * omitStyle( { color: 'red', background: '#fff' }, [ 'color', 'background' ] ); // {}\n * ```\n *\n * It also allows you to specify paths at multiple levels in a string.\n *\n * ```\n * omitStyle( { typography: { textDecoration: 'underline' } }, 'typography.textDecoration' ); // {}\n * ```\n *\n * You can remove multiple paths at the same time:\n *\n * ```\n * omitStyle(\n * \t\t{\n * \t\t\ttypography: {\n * \t\t\t\ttextDecoration: 'underline',\n * \t\t\t\ttextTransform: 'uppercase',\n * \t\t\t}\n *\t\t},\n *\t\t[\n * \t\t\t'typography.textDecoration',\n * \t\t\t'typography.textTransform',\n *\t\t]\n * );\n * // {}\n * ```\n *\n * You can also specify nested paths as arrays:\n *\n * ```\n * omitStyle(\n * \t\t{\n * \t\t\ttypography: {\n * \t\t\t\ttextDecoration: 'underline',\n * \t\t\t\ttextTransform: 'uppercase',\n * \t\t\t}\n *\t\t},\n *\t\t[\n * \t\t\t[ 'typography', 'textDecoration' ],\n * \t\t\t[ 'typography', 'textTransform' ],\n *\t\t]\n * );\n * // {}\n * ```\n *\n * With regards to nesting of styles, infinite depth is supported:\n *\n * ```\n * omitStyle(\n * \t\t{\n * \t\t\tborder: {\n * \t\t\t\tradius: {\n * \t\t\t\t\ttopLeft: '10px',\n * \t\t\t\t\ttopRight: '0.5rem',\n * \t\t\t\t}\n * \t\t\t}\n *\t\t},\n *\t\t[\n * \t\t\t[ 'border', 'radius', 'topRight' ],\n *\t\t]\n * );\n * // { border: { radius: { topLeft: '10px' } } }\n * ```\n *\n * The third argument, `preserveReference`, defines how to treat the input style object.\n * It is mostly necessary to properly handle mutation when recursively handling the style object.\n * Defaulting to `false`, this will always create a new object, avoiding to mutate `style`.\n * However, when recursing, we change that value to `true` in order to work with a single copy\n * of the original style object.\n *\n * @see https://lodash.com/docs/4.17.15#omit\n *\n * @param {Object} style Styles object.\n * @param {Array|string} paths Paths to remove.\n * @param {boolean} preserveReference True to mutate the `style` object, false otherwise.\n * @return {Object} Styles object with the specified paths removed.\n */\nexport function omitStyle( style, paths, preserveReference = false ) {\n\tif ( ! style ) {\n\t\treturn style;\n\t}\n\n\tlet newStyle = style;\n\tif ( ! preserveReference ) {\n\t\tnewStyle = JSON.parse( JSON.stringify( style ) );\n\t}\n\n\tif ( ! Array.isArray( paths ) ) {\n\t\tpaths = [ paths ];\n\t}\n\n\tpaths.forEach( ( path ) => {\n\t\tif ( ! Array.isArray( path ) ) {\n\t\t\tpath = path.split( '.' );\n\t\t}\n\n\t\tif ( path.length > 1 ) {\n\t\t\tconst [ firstSubpath, ...restPath ] = path;\n\t\t\tomitStyle( newStyle[ firstSubpath ], [ restPath ], true );\n\t\t} else if ( path.length === 1 ) {\n\t\t\tdelete newStyle[ path[ 0 ] ];\n\t\t}\n\t} );\n\n\treturn newStyle;\n}\n\n/**\n * Override props assigned to save component to inject the CSS variables definition.\n *\n * @param {Object} props Additional props applied to save element.\n * @param {Object|string} blockNameOrType Block type.\n * @param {Object} attributes Block attributes.\n * @param {?Record<string, string[]>} skipPaths An object of keys and paths to skip serialization.\n *\n * @return {Object} Filtered props applied to save element.\n */\nexport function addSaveProps(\n\tprops,\n\tblockNameOrType,\n\tattributes,\n\tskipPaths = skipSerializationPathsSave\n) {\n\tif ( ! hasStyleSupport( blockNameOrType ) ) {\n\t\treturn props;\n\t}\n\n\tlet { style } = attributes;\n\tObject.entries( skipPaths ).forEach( ( [ indicator, path ] ) => {\n\t\tconst skipSerialization =\n\t\t\tskipSerializationPathsSaveChecks[ indicator ] ||\n\t\t\tgetBlockSupport( blockNameOrType, indicator );\n\n\t\tif ( skipSerialization === true ) {\n\t\t\tstyle = omitStyle( style, path );\n\t\t}\n\n\t\tif ( Array.isArray( skipSerialization ) ) {\n\t\t\tskipSerialization.forEach( ( featureName ) => {\n\t\t\t\tconst feature = renamedFeatures[ featureName ] || featureName;\n\t\t\t\tstyle = omitStyle( style, [ [ ...path, feature ] ] );\n\t\t\t} );\n\t\t}\n\t} );\n\n\tprops.style = {\n\t\t...getInlineStyles( style ),\n\t\t...props.style,\n\t};\n\n\treturn props;\n}\n\nfunction BlockStyleControls( {\n\tclientId,\n\tname,\n\tsetAttributes,\n\tstyle,\n\t__unstableParentLayout,\n} ) {\n\tconst settings = useBlockSettings( name, __unstableParentLayout );\n\tconst blockEditingMode = useBlockEditingMode();\n\tconst { globalBlockStyles, selectedState, showStateOnCanvas } = useSelect(\n\t\t( select ) => {\n\t\t\tconst blockEditorSelect = select( blockEditorStore );\n\t\t\tconst {\n\t\t\t\tgetSelectedBlockStyleState,\n\t\t\t\tisSelectedBlockStyleStateShownOnCanvas,\n\t\t\t} = unlock( blockEditorSelect );\n\t\t\tconst editorSettings = blockEditorSelect.getSettings();\n\t\t\treturn {\n\t\t\t\tglobalBlockStyles:\n\t\t\t\t\teditorSettings?.[ globalStylesDataKey ]?.blocks?.[ name ],\n\t\t\t\tselectedState: getSelectedBlockStyleState( clientId ),\n\t\t\t\tshowStateOnCanvas:\n\t\t\t\t\tisSelectedBlockStyleStateShownOnCanvas( clientId ),\n\t\t\t};\n\t\t},\n\t\t[ clientId, name ]\n\t);\n\tconst isPseudoSelectorState = hasPseudoBlockStyleState( selectedState );\n\n\t// Inject state styles onto the editor canvas so the selected state is\n\t// visible while editing. Scoped to this block instance via data-block so\n\t// other blocks of the same type are not affected. Must be called before\n\t// any early returns because it is a hook.\n\tconst canvasStateCSS = useMemo( () => {\n\t\tif ( ! showStateOnCanvas || ! isPseudoSelectorState ) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst globalStateValue = getCanvasStateStyleValue(\n\t\t\tglobalBlockStyles,\n\t\t\tselectedState\n\t\t);\n\t\tconst instanceStateValue = getCanvasStateStyleValue(\n\t\t\tstyle,\n\t\t\tselectedState\n\t\t);\n\t\tlet stateValue;\n\n\t\tif ( globalStateValue && instanceStateValue ) {\n\t\t\tstateValue = mergeGlobalStyles(\n\t\t\t\tglobalStateValue,\n\t\t\t\tinstanceStateValue\n\t\t\t);\n\t\t} else if ( instanceStateValue ) {\n\t\t\tstateValue = instanceStateValue;\n\t\t} else if ( globalStateValue ) {\n\t\t\tstateValue = globalStateValue;\n\t\t} else {\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn getBlockStateStylesCSS( stateValue, {\n\t\t\tname,\n\t\t\tbaseSelector: `[data-block=\"${ clientId }\"]`,\n\t\t} );\n\t}, [\n\t\tshowStateOnCanvas,\n\t\tisPseudoSelectorState,\n\t\tglobalBlockStyles,\n\t\tstyle,\n\t\tselectedState,\n\t\tclientId,\n\t\tname,\n\t] );\n\tuseStyleOverride( { css: canvasStateCSS } );\n\n\tif ( blockEditingMode !== 'default' ) {\n\t\treturn null;\n\t}\n\n\tconst panelSettings = {\n\t\t...settings,\n\t\ttypography: {\n\t\t\t...settings.typography,\n\t\t\t// The text alignment UI for individual blocks is rendered in\n\t\t\t// the block toolbar, so disable it here.\n\t\t\ttextAlign: false,\n\t\t},\n\t};\n\n\tconst passedProps = {\n\t\tclientId,\n\t\tname,\n\t\tsetAttributes,\n\t\tsettings: panelSettings,\n\t};\n\n\treturn (\n\t\t<BlockStyleStateProvider value={ selectedState }>\n\t\t\t<ColorEdit { ...passedProps } />\n\t\t\t<BackgroundImagePanel { ...passedProps } />\n\t\t\t<TypographyPanel { ...passedProps } />\n\t\t\t<BorderPanel { ...passedProps } />\n\t\t\t<DimensionsPanel { ...passedProps } />\n\t\t</BlockStyleStateProvider>\n\t);\n}\n\nexport default {\n\tedit: BlockStyleControls,\n\thasSupport: hasStyleSupport,\n\taddSaveProps,\n\tattributeKeys: [ 'style' ],\n\tuseBlockProps,\n};\n\n// Defines which element types are supported, including their hover styles or\n// any other elements that have been included under a single element type\n// e.g. heading and h1-h6.\nconst elementTypes = [\n\t{ elementType: 'button' },\n\t{ elementType: 'link', pseudo: [ ':hover' ] },\n\t{\n\t\telementType: 'heading',\n\t\telements: [ 'h1', 'h2', 'h3', 'h4', 'h5', 'h6' ],\n\t},\n];\n\n// Used for generating the instance ID\nconst STYLE_BLOCK_PROPS_REFERENCE = {};\n\n/**\n * Generates CSS rules for block element styles (buttons, links, headings, etc.).\n *\n * Iterates over supported element types and compiles their styles, including\n * pseudo-selectors (e.g. :hover) and related sub-elements (e.g. h1-h6 for headings),\n * into scoped CSS rule strings.\n *\n * @param {Object} blockElementStyles The block's `style.elements` object.\n * @param {string} blockName The block name, used for skip-serialization checks.\n * @param {string} baseSelector The base CSS selector to scope rules under.\n * @return {string|undefined} Concatenated CSS rules string, or undefined if none.\n */\nfunction getElementCSSRules( blockElementStyles, blockName, baseSelector ) {\n\tif ( ! blockElementStyles ) {\n\t\treturn;\n\t}\n\n\tconst rules = [];\n\n\telementTypes.forEach( ( { elementType, pseudo, elements } ) => {\n\t\tconst skipSerialization = shouldSkipSerialization(\n\t\t\tblockName,\n\t\t\tCOLOR_SUPPORT_KEY,\n\t\t\telementType\n\t\t);\n\n\t\tif ( skipSerialization ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst elementStyles = blockElementStyles?.[ elementType ];\n\n\t\t// Process primary element type styles.\n\t\tif ( elementStyles ) {\n\t\t\tconst selector = scopeSelector(\n\t\t\t\tbaseSelector,\n\t\t\t\tELEMENTS[ elementType ]\n\t\t\t);\n\n\t\t\trules.push( compileCSS( elementStyles, { selector } ) );\n\n\t\t\t// Process any interactive states for the element type.\n\t\t\tif ( pseudo ) {\n\t\t\t\tpseudo.forEach( ( pseudoSelector ) => {\n\t\t\t\t\tif ( elementStyles[ pseudoSelector ] ) {\n\t\t\t\t\t\trules.push(\n\t\t\t\t\t\t\tcompileCSS( elementStyles[ pseudoSelector ], {\n\t\t\t\t\t\t\t\tselector: scopeSelector(\n\t\t\t\t\t\t\t\t\tbaseSelector,\n\t\t\t\t\t\t\t\t\t`${ ELEMENTS[ elementType ] }${ pseudoSelector }`\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\n\t\t// Process related elements e.g. h1-h6 for headings\n\t\tif ( elements ) {\n\t\t\telements.forEach( ( element ) => {\n\t\t\t\tif ( blockElementStyles[ element ] ) {\n\t\t\t\t\trules.push(\n\t\t\t\t\t\tcompileCSS( blockElementStyles[ element ], {\n\t\t\t\t\t\t\tselector: scopeSelector(\n\t\t\t\t\t\t\t\tbaseSelector,\n\t\t\t\t\t\t\t\tELEMENTS[ element ]\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 rules.length > 0 ? rules.join( '' ) : undefined;\n}\n\nfunction useBlockProps( { name, style } ) {\n\tconst blockElementsContainerIdentifier = useInstanceId(\n\t\tSTYLE_BLOCK_PROPS_REFERENCE,\n\t\t'wp-elements'\n\t);\n\n\tconst baseElementSelector = `.${ blockElementsContainerIdentifier }`;\n\tconst blockElementStyles = style?.elements;\n\n\tconst styles = useMemo( () => {\n\t\tconst cssRules = [];\n\n\t\tconst elementCSS = getElementCSSRules(\n\t\t\tblockElementStyles,\n\t\t\tname,\n\t\t\tbaseElementSelector\n\t\t);\n\t\tif ( elementCSS ) {\n\t\t\tcssRules.push( elementCSS );\n\t\t}\n\n\t\tcssRules.push(\n\t\t\t...getPseudoStateCSSRules( style, name, baseElementSelector )\n\t\t);\n\n\t\tcssRules.push(\n\t\t\t...getResponsiveStateCSSRules( style, name, baseElementSelector )\n\t\t);\n\n\t\treturn cssRules.length > 0 ? cssRules.join( '' ) : undefined;\n\t}, [ baseElementSelector, blockElementStyles, name, style ] );\n\n\tuseStyleOverride( { css: styles } );\n\n\treturn addSaveProps(\n\t\t{ className: blockElementsContainerIdentifier },\n\t\tname,\n\t\t{ style },\n\t\tskipSerializationPathsEdit\n\t);\n}\n\naddFil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SAAS,KAAM,EAAG,IAAI;AAAA,EACpD,GAAG,CAAE,qBAAqB,oBAAoB,MAAM,KAAM,CAAE;AAE5D,mBAAkB,EAAE,KAAK,OAAO,CAAE;AAElC,SAAO;AAAA,IACN,EAAE,WAAW,iCAAiC;AAAA,IAC9C;AAAA,IACA,EAAE,MAAM;AAAA,IACR;AAAA,EACD;AACD;AAEA;AAAA,EACC;AAAA,EACA;AAAA,EACA;AACD;",
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { addFilter } from '@wordpress/hooks';\nimport { useSelect } from '@wordpress/data';\nimport { mergeGlobalStyles } from '@wordpress/global-styles-engine';\nimport {\n\tgetBlockSupport,\n\tgetBlockType,\n\thasBlockSupport,\n\t__EXPERIMENTAL_ELEMENTS as ELEMENTS,\n} from '@wordpress/blocks';\nimport { useInstanceId } from '@wordpress/compose';\nimport { getCSSRules, compileCSS } from '@wordpress/style-engine';\n\n/**\n * Internal dependencies\n */\nimport { BACKGROUND_SUPPORT_KEY, BackgroundImagePanel } from './background';\nimport { BORDER_SUPPORT_KEY, BorderPanel, SHADOW_SUPPORT_KEY } from './border';\nimport { COLOR_SUPPORT_KEY } from './color';\nimport { ElementsEdit } from './elements';\nimport {\n\tTypographyPanel,\n\tTYPOGRAPHY_SUPPORT_KEY,\n\tTYPOGRAPHY_SUPPORT_KEYS,\n} from './typography';\nimport {\n\tDIMENSIONS_SUPPORT_KEY,\n\tSPACING_SUPPORT_KEY,\n\tDimensionsPanel,\n\tisExplicitAspectRatio,\n} from './dimensions';\nimport {\n\tcleanEmptyObject,\n\tshouldSkipSerialization,\n\tuseStyleOverride,\n\tuseBlockSettings,\n} from './utils';\nimport {\n\tBlockStyleStateProvider,\n\tDEFAULT_BLOCK_STYLE_STATE,\n\tgetStyleForState,\n\thasViewportBlockStyleState,\n\thasPseudoBlockStyleState,\n} from './block-style-state';\nimport { VALID_BLOCK_PSEUDO_STATES } from './states';\nimport { buildScopedBlockSelector } from './state-utils';\nimport { scopeSelector } from '../components/global-styles/utils';\nimport { useBlockEditingMode } from '../components/block-editing-mode';\nimport { store as blockEditorStore } from '../store';\nimport { globalStylesDataKey } from '../store/private-keys';\nimport { unlock } from '../lock-unlock';\n\nconst BORDER_SIDES = [ 'Top', 'Right', 'Bottom', 'Left' ];\n\n// Keep in sync with WP_Theme_JSON_Gutenberg::RESPONSIVE_BREAKPOINTS and\n// packages/global-styles-engine/src/core/render.tsx.\nconst RESPONSIVE_BREAKPOINTS = {\n\t'@mobile': '@media (width <= 480px)',\n\t'@tablet': '@media (480px < width <= 782px)',\n};\n\nconst styleSupportKeys = [\n\t...TYPOGRAPHY_SUPPORT_KEYS,\n\tBORDER_SUPPORT_KEY,\n\tCOLOR_SUPPORT_KEY,\n\tDIMENSIONS_SUPPORT_KEY,\n\tBACKGROUND_SUPPORT_KEY,\n\tSPACING_SUPPORT_KEY,\n\tSHADOW_SUPPORT_KEY,\n];\n\nconst hasStyleSupport = ( nameOrType ) =>\n\tstyleSupportKeys.some( ( key ) => hasBlockSupport( nameOrType, key ) );\n\n/**\n * Returns the inline styles to add depending on the style object\n *\n * @param {Object} styles Styles configuration.\n *\n * @return {Object} Flattened CSS variables declaration.\n */\nexport function getInlineStyles( styles = {} ) {\n\tconst output = {};\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\tgetCSSRules( styles ).forEach( ( rule ) => {\n\t\toutput[ rule.key ] = rule.value;\n\t} );\n\n\treturn output;\n}\n\n/**\n * Returns fallback border styles for visible state border styles.\n *\n * State styles are emitted as stylesheet rules rather than inline styles, so\n * they cannot rely on the block-library inline-style attribute fallback rules.\n *\n * @param {Object} stateStyles State style object.\n * @return {Object|undefined} Style object containing fallback border styles.\n */\nfunction getStateFallbackBorderStyles( stateStyles ) {\n\tconst border = stateStyles?.border;\n\tif ( ! border ) {\n\t\treturn undefined;\n\t}\n\n\tconst hasBorderStyle = !! border.style;\n\tconst hasBorderColor = !! border.color;\n\tconst hasBorderWidth = !! border.width;\n\tconst fallbackBorder = {};\n\n\tif ( ! hasBorderStyle && ( hasBorderColor || hasBorderWidth ) ) {\n\t\tfallbackBorder.style = 'solid';\n\t}\n\n\tBORDER_SIDES.forEach( ( side ) => {\n\t\tconst sideKey = side.toLowerCase();\n\t\tconst sideBorder = border[ sideKey ];\n\t\tconst hasSideStyle = !! sideBorder?.style;\n\t\tconst hasSideColor = !! sideBorder?.color;\n\t\tconst hasSideWidth = !! sideBorder?.width;\n\n\t\tif (\n\t\t\t! hasBorderStyle &&\n\t\t\t! hasSideStyle &&\n\t\t\t( hasSideColor || hasSideWidth )\n\t\t) {\n\t\t\tfallbackBorder[ sideKey ] = { style: 'solid' };\n\t\t}\n\t} );\n\n\treturn cleanEmptyObject( { border: cleanEmptyObject( fallbackBorder ) } );\n}\n\n/**\n * Returns background reset CSS for a state that sets a solid background color.\n *\n * When a state sets `color.background` (a solid color) without also setting a\n * gradient (`color.gradient` or `background.gradient`), any gradient applied to\n * the default state via an inline `background` shorthand or `background-image`\n * declaration must be explicitly cleared. Without this, the gradient image layer\n * remains visible even though the solid hover color wins `background-color`.\n *\n * @param {Object} stateStyles State style object.\n * @param {string} selector CSS selector for the generated style.\n * @return {string|undefined} CSS string with background-image reset, or undefined.\n */\nfunction getStateBackgroundResetCSS( stateStyles, selector ) {\n\tconst hasSolidBackground = !! stateStyles?.color?.background;\n\n\tif ( ! hasSolidBackground ) {\n\t\treturn undefined;\n\t}\n\n\tconst hasColorGradient = !! stateStyles?.color?.gradient;\n\tconst hasBackgroundGradient =\n\t\t!! stateStyles?.background?.gradient ||\n\t\t!! stateStyles?.background?.backgroundImage;\n\n\tif ( hasColorGradient || hasBackgroundGradient ) {\n\t\treturn undefined;\n\t}\n\n\tconst declaration = 'background-image: unset !important';\n\treturn selector\n\t\t? `${ selector } { ${ declaration }; }`\n\t\t: `${ declaration };`;\n}\n\n/**\n * Returns fallback dimension styles that keep state styles aligned with the\n * default dimensions block-support output.\n *\n * @param {Object} stateStyles State style object.\n * @return {Object|undefined} Style object containing fallback dimension styles.\n */\nfunction getStateFallbackDimensionStyles( stateStyles ) {\n\tconst dimensions = stateStyles?.dimensions;\n\tif ( ! dimensions ) {\n\t\treturn undefined;\n\t}\n\n\tif ( isExplicitAspectRatio( dimensions.aspectRatio ) ) {\n\t\treturn {\n\t\t\tdimensions: {\n\t\t\t\tminHeight: 'unset',\n\t\t\t\theight: 'unset',\n\t\t\t},\n\t\t};\n\t}\n\n\tif ( dimensions.minHeight || dimensions.height ) {\n\t\treturn {\n\t\t\tdimensions: {\n\t\t\t\taspectRatio: 'unset',\n\t\t\t},\n\t\t};\n\t}\n}\n\n/**\n * Generates CSS for a block instance state style object.\n *\n * State declarations need to win over preset utility classes, but fallback\n * border styles should not become important because they must not override\n * explicitly authored default border styles.\n *\n * @param {Object} stateStyles State style object.\n * @param {string} selector CSS selector for the generated style.\n * @return {string} Generated stylesheet.\n */\nexport function getStateStylesCSS( stateStyles, selector ) {\n\tconst fallbackDimensionStyles =\n\t\tgetStateFallbackDimensionStyles( stateStyles );\n\tconst stylesWithDimensionFallbacks = fallbackDimensionStyles\n\t\t? mergeStyleObjects( stateStyles, fallbackDimensionStyles )\n\t\t: stateStyles;\n\tconst css = compileCSS( stylesWithDimensionFallbacks, { selector } );\n\tconst importantCSS = css ? css.replace( /;/g, ' !important;' ) : undefined;\n\tconst fallbackBorderStyles = getStateFallbackBorderStyles( stateStyles );\n\tconst fallbackCSS = fallbackBorderStyles\n\t\t? compileCSS( fallbackBorderStyles, { selector } )\n\t\t: undefined;\n\tconst backgroundResetCSS = getStateBackgroundResetCSS(\n\t\tstateStyles,\n\t\tselector\n\t);\n\n\treturn [ importantCSS, fallbackCSS, backgroundResetCSS ]\n\t\t.filter( Boolean )\n\t\t.join( '\\n' );\n}\n\nfunction isPlainObject( value ) {\n\treturn !! value && typeof value === 'object' && ! Array.isArray( value );\n}\n\nfunction mergeStyleObjects( target = {}, source = {} ) {\n\tconst merged = { ...target };\n\n\tObject.entries( source ).forEach( ( [ key, value ] ) => {\n\t\tmerged[ key ] =\n\t\t\tisPlainObject( value ) && isPlainObject( merged[ key ] )\n\t\t\t\t? mergeStyleObjects( merged[ key ], value )\n\t\t\t\t: value;\n\t} );\n\n\treturn merged;\n}\n\nfunction addStyleGroup( groups, selector, style ) {\n\tconst key = selector || '';\n\tconst existing = groups.get( key ) || { selector, style: {} };\n\n\tgroups.set( key, {\n\t\tselector,\n\t\tstyle: mergeStyleObjects( existing.style, style ),\n\t} );\n}\n\nfunction getStateStyleGroups( stateStyles, name ) {\n\tconst blockSelectors = getBlockType( name )?.selectors || {};\n\tconst groups = new Map();\n\n\tObject.entries( stateStyles || {} ).forEach(\n\t\t( [ feature, featureStyles ] ) => {\n\t\t\tconst featureSelectors = blockSelectors[ feature ];\n\n\t\t\tif ( typeof featureSelectors === 'string' ) {\n\t\t\t\taddStyleGroup( groups, featureSelectors, {\n\t\t\t\t\t[ feature ]: featureStyles,\n\t\t\t\t} );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\tisPlainObject( featureSelectors ) &&\n\t\t\t\tisPlainObject( featureStyles )\n\t\t\t) {\n\t\t\t\tconst remainingStyles = { ...featureStyles };\n\n\t\t\t\tObject.entries( featureSelectors ).forEach(\n\t\t\t\t\t( [ subfeature, subfeatureSelector ] ) => {\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tsubfeature === 'root' ||\n\t\t\t\t\t\t\ttypeof subfeatureSelector !== 'string' ||\n\t\t\t\t\t\t\t! Object.hasOwn( featureStyles, subfeature )\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\taddStyleGroup( groups, subfeatureSelector, {\n\t\t\t\t\t\t\t[ feature ]: {\n\t\t\t\t\t\t\t\t[ subfeature ]: featureStyles[ subfeature ],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t} );\n\t\t\t\t\t\tdelete remainingStyles[ subfeature ];\n\t\t\t\t\t}\n\t\t\t\t);\n\n\t\t\t\tif ( Object.keys( remainingStyles ).length ) {\n\t\t\t\t\taddStyleGroup(\n\t\t\t\t\t\tgroups,\n\t\t\t\t\t\tfeatureSelectors.root || blockSelectors.root,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t[ feature ]: remainingStyles,\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\taddStyleGroup( groups, blockSelectors.root, {\n\t\t\t\t[ feature ]: featureStyles,\n\t\t\t} );\n\t\t}\n\t);\n\n\treturn Array.from( groups.values() );\n}\n\n/**\n * Generates CSS for block instance state styles, honoring feature selectors.\n *\n * @param {Object} stateStyles State style object.\n * @param {Object} options Generation options.\n * @param {string} options.name Block name.\n * @param {string} options.baseSelector Block-instance scoping selector.\n * @param {string=} options.state Optional pseudo-state, e.g. \":hover\".\n * @return {string|undefined} Generated stylesheet.\n */\nexport function getBlockStateStylesCSS( stateStyles, options ) {\n\tconst { name, baseSelector, state = '' } = options;\n\tconst rules = getStateStyleGroups( stateStyles, name )\n\t\t.map( ( { selector: blockSelector, style } ) =>\n\t\t\tgetStateStylesCSS(\n\t\t\t\tstyle,\n\t\t\t\tbuildScopedBlockSelector( baseSelector, blockSelector, state )\n\t\t\t)\n\t\t)\n\t\t.filter( Boolean );\n\n\treturn rules.length ? rules.join( '\\n' ) : undefined;\n}\n\n/**\n * Returns a style object with nested state/element keys removed.\n *\n * Viewport state objects can contain root declarations alongside nested\n * `elements` and pseudo-state styles. Only root declarations should be passed\n * to the style engine for the viewport root selector.\n *\n * @param {Object} stateStyles Style object for a selected state.\n * @param {string[]} nestedKeys Keys to remove from the root style object.\n * @return {Object|undefined} Root-only style object.\n */\nfunction getRootStateStyles( stateStyles, nestedKeys ) {\n\tif ( ! stateStyles ) {\n\t\treturn stateStyles;\n\t}\n\n\tconst rootStyles = { ...stateStyles };\n\tnestedKeys.forEach( ( key ) => {\n\t\tdelete rootStyles[ key ];\n\t} );\n\treturn rootStyles;\n}\n\n/**\n * Generates CSS rules for supported pseudo-state styles.\n *\n * @param {Object} style Block style object containing pseudo-state styles.\n * @param {string} name Block name.\n * @param {string} baseSelector Base selector used to scope generated CSS.\n * @return {string[]} Generated CSS rule strings.\n */\nfunction getPseudoStateCSSRules( style, name, baseSelector ) {\n\tconst validPseudoStates = VALID_BLOCK_PSEUDO_STATES[ name ];\n\tif ( ! validPseudoStates ) {\n\t\treturn [];\n\t}\n\n\tconst cssRules = [];\n\tvalidPseudoStates.forEach( ( pseudoState ) => {\n\t\tconst stateStyles = style?.[ pseudoState ];\n\t\tif ( stateStyles ) {\n\t\t\tconst css = getBlockStateStylesCSS( stateStyles, {\n\t\t\t\tname,\n\t\t\t\tbaseSelector,\n\t\t\t\tstate: pseudoState,\n\t\t\t} );\n\t\t\tif ( css ) {\n\t\t\t\tcssRules.push( css );\n\t\t\t}\n\t\t}\n\t} );\n\treturn cssRules;\n}\n\n/**\n * Generates CSS rules for responsive block instance style states.\n *\n * Each responsive state can contain root styles, element styles, and nested\n * pseudo-state styles. Generated rules are wrapped in the matching breakpoint\n * media query.\n *\n * @param {Object} style Block style object containing responsive states.\n * @param {string} name Block name.\n * @param {string} baseSelector Base selector used to scope generated CSS.\n * @return {string[]} Generated CSS rule strings.\n */\nexport function getResponsiveStateCSSRules( style, name, baseSelector ) {\n\tconst cssRules = [];\n\tconst validPseudoStates = VALID_BLOCK_PSEUDO_STATES[ name ] ?? [];\n\tconst nestedStateKeys = [ 'elements', ...validPseudoStates ];\n\n\tObject.entries( RESPONSIVE_BREAKPOINTS ).forEach(\n\t\t( [ viewport, mediaQuery ] ) => {\n\t\t\tconst viewportStyles = getStyleForState( style, {\n\t\t\t\tviewport,\n\t\t\t\tpseudo: DEFAULT_BLOCK_STYLE_STATE.pseudo,\n\t\t\t} );\n\t\t\tif ( ! viewportStyles ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst viewportCSSRules = [];\n\t\t\tconst rootCSS = getBlockStateStylesCSS(\n\t\t\t\tgetRootStateStyles( viewportStyles, nestedStateKeys ),\n\t\t\t\t{\n\t\t\t\t\tname,\n\t\t\t\t\tbaseSelector,\n\t\t\t\t}\n\t\t\t);\n\t\t\tif ( rootCSS ) {\n\t\t\t\tviewportCSSRules.push( rootCSS );\n\t\t\t}\n\n\t\t\tconst elementCSS = getElementCSSRules(\n\t\t\t\tviewportStyles.elements,\n\t\t\t\tname,\n\t\t\t\tbaseSelector\n\t\t\t);\n\t\t\tif ( elementCSS ) {\n\t\t\t\tviewportCSSRules.push( elementCSS );\n\t\t\t}\n\n\t\t\tviewportCSSRules.push(\n\t\t\t\t...getPseudoStateCSSRules( viewportStyles, name, baseSelector )\n\t\t\t);\n\n\t\t\tif ( viewportCSSRules.length ) {\n\t\t\t\tcssRules.push(\n\t\t\t\t\t`${ mediaQuery }{${ viewportCSSRules.join( '' ) }}`\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t);\n\n\treturn cssRules;\n}\n\n/**\n * Returns the style value used to force-preview a selected state on canvas.\n *\n * Responsive pseudo states inherit from their default-viewport pseudo state.\n * For example, selecting `@mobile + :hover` should preview styles from\n * `:hover`, with `@mobile.:hover` values layered on top when present.\n *\n * @param {Object} style Block style object.\n * @param {Object} selectedState Selected block style state.\n * @return {Object|undefined} Style value for the canvas preview.\n */\nexport function getCanvasStateStyleValue( style, selectedState ) {\n\tconst stateValue = getStyleForState( style, selectedState );\n\tif ( ! hasViewportBlockStyleState( selectedState ) ) {\n\t\treturn stateValue;\n\t}\n\n\tconst defaultViewportState = {\n\t\t...selectedState,\n\t\tviewport: DEFAULT_BLOCK_STYLE_STATE.viewport,\n\t};\n\tconst defaultViewportStateValue = getStyleForState(\n\t\tstyle,\n\t\tdefaultViewportState\n\t);\n\n\tif ( defaultViewportStateValue && stateValue ) {\n\t\treturn mergeGlobalStyles( defaultViewportStateValue, stateValue );\n\t}\n\treturn stateValue || defaultViewportStateValue;\n}\n\n/**\n * Filters registered block settings, extending attributes to include `style` attribute.\n *\n * @param {Object} settings Original block settings.\n *\n * @return {Object} Filtered block settings.\n */\nfunction addAttribute( settings ) {\n\tif (\n\t\t! hasStyleSupport( settings ) &&\n\t\t! hasBlockSupport( settings, 'customCSS', true )\n\t) {\n\t\treturn settings;\n\t}\n\n\t// Allow blocks to specify their own attribute definition with default values if needed.\n\tif ( ! settings.attributes.style ) {\n\t\tObject.assign( settings.attributes, {\n\t\t\tstyle: {\n\t\t\t\ttype: 'object',\n\t\t\t},\n\t\t} );\n\t}\n\n\treturn settings;\n}\n\n/**\n * A dictionary of paths to flag skipping block support serialization as the key,\n * with values providing the style paths to be omitted from serialization.\n *\n * @constant\n * @type {Record<string, string[]>}\n */\nconst skipSerializationPathsEdit = {\n\t[ `${ BORDER_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [ 'border' ],\n\t[ `${ COLOR_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [\n\t\tCOLOR_SUPPORT_KEY,\n\t],\n\t[ `${ TYPOGRAPHY_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [\n\t\tTYPOGRAPHY_SUPPORT_KEY,\n\t],\n\t[ `${ DIMENSIONS_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [\n\t\tDIMENSIONS_SUPPORT_KEY,\n\t],\n\t[ `${ SPACING_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [\n\t\tSPACING_SUPPORT_KEY,\n\t],\n\t[ `${ SHADOW_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [\n\t\tSHADOW_SUPPORT_KEY,\n\t],\n};\n\n/**\n * A dictionary of paths to flag skipping block support serialization as the key,\n * with values providing the style paths to be omitted from serialization.\n *\n * Extends the Edit skip paths to enable skipping additional paths in just\n * the Save component. This allows a block support to be serialized within the\n * editor, while using an alternate approach, such as server-side rendering, when\n * the support is saved.\n *\n * @constant\n * @type {Record<string, string[]>}\n */\nconst skipSerializationPathsSave = {\n\t...skipSerializationPathsEdit,\n\t[ `${ DIMENSIONS_SUPPORT_KEY }.aspectRatio` ]: [\n\t\t`${ DIMENSIONS_SUPPORT_KEY }.aspectRatio`,\n\t], // Skip serialization of aspect ratio in save mode.\n\t[ `${ BACKGROUND_SUPPORT_KEY }` ]: [ BACKGROUND_SUPPORT_KEY ], // Skip serialization of background support in save mode.\n};\n\nconst skipSerializationPathsSaveChecks = {\n\t[ `${ DIMENSIONS_SUPPORT_KEY }.aspectRatio` ]: true,\n\t[ `${ BACKGROUND_SUPPORT_KEY }` ]: true,\n};\n\n/**\n * A dictionary used to normalize feature names between support flags, style\n * object properties and __experimentSkipSerialization configuration arrays.\n *\n * This allows not having to provide a migration for a support flag and possible\n * backwards compatibility bridges, while still achieving consistency between\n * the support flag and the skip serialization array.\n *\n * @constant\n * @type {Record<string, string>}\n */\nconst renamedFeatures = { gradients: 'gradient' };\n\n/**\n * A utility function used to remove one or more paths from a style object.\n * Works in a way similar to Lodash's `omit()`. See unit tests and examples below.\n *\n * It supports a single string path:\n *\n * ```\n * omitStyle( { color: 'red' }, 'color' ); // {}\n * ```\n *\n * or an array of paths:\n *\n * ```\n * omitStyle( { color: 'red', background: '#fff' }, [ 'color', 'background' ] ); // {}\n * ```\n *\n * It also allows you to specify paths at multiple levels in a string.\n *\n * ```\n * omitStyle( { typography: { textDecoration: 'underline' } }, 'typography.textDecoration' ); // {}\n * ```\n *\n * You can remove multiple paths at the same time:\n *\n * ```\n * omitStyle(\n * \t\t{\n * \t\t\ttypography: {\n * \t\t\t\ttextDecoration: 'underline',\n * \t\t\t\ttextTransform: 'uppercase',\n * \t\t\t}\n *\t\t},\n *\t\t[\n * \t\t\t'typography.textDecoration',\n * \t\t\t'typography.textTransform',\n *\t\t]\n * );\n * // {}\n * ```\n *\n * You can also specify nested paths as arrays:\n *\n * ```\n * omitStyle(\n * \t\t{\n * \t\t\ttypography: {\n * \t\t\t\ttextDecoration: 'underline',\n * \t\t\t\ttextTransform: 'uppercase',\n * \t\t\t}\n *\t\t},\n *\t\t[\n * \t\t\t[ 'typography', 'textDecoration' ],\n * \t\t\t[ 'typography', 'textTransform' ],\n *\t\t]\n * );\n * // {}\n * ```\n *\n * With regards to nesting of styles, infinite depth is supported:\n *\n * ```\n * omitStyle(\n * \t\t{\n * \t\t\tborder: {\n * \t\t\t\tradius: {\n * \t\t\t\t\ttopLeft: '10px',\n * \t\t\t\t\ttopRight: '0.5rem',\n * \t\t\t\t}\n * \t\t\t}\n *\t\t},\n *\t\t[\n * \t\t\t[ 'border', 'radius', 'topRight' ],\n *\t\t]\n * );\n * // { border: { radius: { topLeft: '10px' } } }\n * ```\n *\n * The third argument, `preserveReference`, defines how to treat the input style object.\n * It is mostly necessary to properly handle mutation when recursively handling the style object.\n * Defaulting to `false`, this will always create a new object, avoiding to mutate `style`.\n * However, when recursing, we change that value to `true` in order to work with a single copy\n * of the original style object.\n *\n * @see https://lodash.com/docs/4.17.15#omit\n *\n * @param {Object} style Styles object.\n * @param {Array|string} paths Paths to remove.\n * @param {boolean} preserveReference True to mutate the `style` object, false otherwise.\n * @return {Object} Styles object with the specified paths removed.\n */\nexport function omitStyle( style, paths, preserveReference = false ) {\n\tif ( ! style ) {\n\t\treturn style;\n\t}\n\n\tlet newStyle = style;\n\tif ( ! preserveReference ) {\n\t\tnewStyle = JSON.parse( JSON.stringify( style ) );\n\t}\n\n\tif ( ! Array.isArray( paths ) ) {\n\t\tpaths = [ paths ];\n\t}\n\n\tpaths.forEach( ( path ) => {\n\t\tif ( ! Array.isArray( path ) ) {\n\t\t\tpath = path.split( '.' );\n\t\t}\n\n\t\tif ( path.length > 1 ) {\n\t\t\tconst [ firstSubpath, ...restPath ] = path;\n\t\t\tomitStyle( newStyle[ firstSubpath ], [ restPath ], true );\n\t\t} else if ( path.length === 1 ) {\n\t\t\tdelete newStyle[ path[ 0 ] ];\n\t\t}\n\t} );\n\n\treturn newStyle;\n}\n\n/**\n * Override props assigned to save component to inject the CSS variables definition.\n *\n * @param {Object} props Additional props applied to save element.\n * @param {Object|string} blockNameOrType Block type.\n * @param {Object} attributes Block attributes.\n * @param {?Record<string, string[]>} skipPaths An object of keys and paths to skip serialization.\n *\n * @return {Object} Filtered props applied to save element.\n */\nexport function addSaveProps(\n\tprops,\n\tblockNameOrType,\n\tattributes,\n\tskipPaths = skipSerializationPathsSave\n) {\n\tif ( ! hasStyleSupport( blockNameOrType ) ) {\n\t\treturn props;\n\t}\n\n\tlet { style } = attributes;\n\tObject.entries( skipPaths ).forEach( ( [ indicator, path ] ) => {\n\t\tconst skipSerialization =\n\t\t\tskipSerializationPathsSaveChecks[ indicator ] ||\n\t\t\tgetBlockSupport( blockNameOrType, indicator );\n\n\t\tif ( skipSerialization === true ) {\n\t\t\tstyle = omitStyle( style, path );\n\t\t}\n\n\t\tif ( Array.isArray( skipSerialization ) ) {\n\t\t\tskipSerialization.forEach( ( featureName ) => {\n\t\t\t\tconst feature = renamedFeatures[ featureName ] || featureName;\n\t\t\t\tstyle = omitStyle( style, [ [ ...path, feature ] ] );\n\t\t\t} );\n\t\t}\n\t} );\n\n\tprops.style = {\n\t\t...getInlineStyles( style ),\n\t\t...props.style,\n\t};\n\n\treturn props;\n}\n\nfunction BlockStyleControls( {\n\tclientId,\n\tname,\n\tsetAttributes,\n\tstyle,\n\t__unstableParentLayout,\n} ) {\n\tconst settings = useBlockSettings( name, __unstableParentLayout );\n\tconst blockEditingMode = useBlockEditingMode();\n\tconst { globalBlockStyles, selectedState, showStateOnCanvas } = useSelect(\n\t\t( select ) => {\n\t\t\tconst blockEditorSelect = select( blockEditorStore );\n\t\t\tconst {\n\t\t\t\tgetSelectedBlockStyleState,\n\t\t\t\tisSelectedBlockStyleStateShownOnCanvas,\n\t\t\t} = unlock( blockEditorSelect );\n\t\t\tconst editorSettings = blockEditorSelect.getSettings();\n\t\t\treturn {\n\t\t\t\tglobalBlockStyles:\n\t\t\t\t\teditorSettings?.[ globalStylesDataKey ]?.blocks?.[ name ],\n\t\t\t\tselectedState: getSelectedBlockStyleState( clientId ),\n\t\t\t\tshowStateOnCanvas:\n\t\t\t\t\tisSelectedBlockStyleStateShownOnCanvas( clientId ),\n\t\t\t};\n\t\t},\n\t\t[ clientId, name ]\n\t);\n\tconst isPseudoSelectorState = hasPseudoBlockStyleState( selectedState );\n\n\t// Inject state styles onto the editor canvas so the selected state is\n\t// visible while editing. Scoped to this block instance via data-block so\n\t// other blocks of the same type are not affected. Must be called before\n\t// any early returns because it is a hook.\n\tconst canvasStateCSS = useMemo( () => {\n\t\tif ( ! showStateOnCanvas || ! isPseudoSelectorState ) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst globalStateValue = getCanvasStateStyleValue(\n\t\t\tglobalBlockStyles,\n\t\t\tselectedState\n\t\t);\n\t\tconst instanceStateValue = getCanvasStateStyleValue(\n\t\t\tstyle,\n\t\t\tselectedState\n\t\t);\n\t\tlet stateValue;\n\n\t\tif ( globalStateValue && instanceStateValue ) {\n\t\t\tstateValue = mergeGlobalStyles(\n\t\t\t\tglobalStateValue,\n\t\t\t\tinstanceStateValue\n\t\t\t);\n\t\t} else if ( instanceStateValue ) {\n\t\t\tstateValue = instanceStateValue;\n\t\t} else if ( globalStateValue ) {\n\t\t\tstateValue = globalStateValue;\n\t\t} else {\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn getBlockStateStylesCSS( stateValue, {\n\t\t\tname,\n\t\t\tbaseSelector: `[data-block=\"${ clientId }\"]`,\n\t\t} );\n\t}, [\n\t\tshowStateOnCanvas,\n\t\tisPseudoSelectorState,\n\t\tglobalBlockStyles,\n\t\tstyle,\n\t\tselectedState,\n\t\tclientId,\n\t\tname,\n\t] );\n\tuseStyleOverride( { css: canvasStateCSS } );\n\n\tif ( blockEditingMode !== 'default' ) {\n\t\treturn null;\n\t}\n\n\tconst panelSettings = {\n\t\t...settings,\n\t\ttypography: {\n\t\t\t...settings.typography,\n\t\t\t// The text alignment UI for individual blocks is rendered in\n\t\t\t// the block toolbar, so disable it here.\n\t\t\ttextAlign: false,\n\t\t},\n\t};\n\n\tconst passedProps = {\n\t\tclientId,\n\t\tname,\n\t\tsetAttributes,\n\t\tsettings: panelSettings,\n\t};\n\n\treturn (\n\t\t<BlockStyleStateProvider value={ selectedState }>\n\t\t\t<ElementsEdit { ...passedProps } />\n\t\t\t<BackgroundImagePanel { ...passedProps } />\n\t\t\t<TypographyPanel { ...passedProps } />\n\t\t\t<BorderPanel { ...passedProps } />\n\t\t\t<DimensionsPanel { ...passedProps } />\n\t\t</BlockStyleStateProvider>\n\t);\n}\n\nexport default {\n\tedit: BlockStyleControls,\n\thasSupport: hasStyleSupport,\n\taddSaveProps,\n\tattributeKeys: [ 'style' ],\n\tuseBlockProps,\n};\n\n// Defines which element types are supported, including their hover styles or\n// any other elements that have been included under a single element type\n// e.g. heading and h1-h6.\nconst elementTypes = [\n\t{ elementType: 'button' },\n\t{ elementType: 'link', pseudo: [ ':hover' ] },\n\t{\n\t\telementType: 'heading',\n\t\telements: [ 'h1', 'h2', 'h3', 'h4', 'h5', 'h6' ],\n\t},\n];\n\n// Used for generating the instance ID\nconst STYLE_BLOCK_PROPS_REFERENCE = {};\n\n/**\n * Generates CSS rules for block element styles (buttons, links, headings, etc.).\n *\n * Iterates over supported element types and compiles their styles, including\n * pseudo-selectors (e.g. :hover) and related sub-elements (e.g. h1-h6 for headings),\n * into scoped CSS rule strings.\n *\n * @param {Object} blockElementStyles The block's `style.elements` object.\n * @param {string} blockName The block name, used for skip-serialization checks.\n * @param {string} baseSelector The base CSS selector to scope rules under.\n * @return {string|undefined} Concatenated CSS rules string, or undefined if none.\n */\nfunction getElementCSSRules( blockElementStyles, blockName, baseSelector ) {\n\tif ( ! blockElementStyles ) {\n\t\treturn;\n\t}\n\n\tconst rules = [];\n\n\telementTypes.forEach( ( { elementType, pseudo, elements } ) => {\n\t\tconst skipSerialization = shouldSkipSerialization(\n\t\t\tblockName,\n\t\t\tCOLOR_SUPPORT_KEY,\n\t\t\telementType\n\t\t);\n\n\t\tif ( skipSerialization ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst elementStyles = blockElementStyles?.[ elementType ];\n\n\t\t// Process primary element type styles.\n\t\tif ( elementStyles ) {\n\t\t\tconst selector = scopeSelector(\n\t\t\t\tbaseSelector,\n\t\t\t\tELEMENTS[ elementType ]\n\t\t\t);\n\n\t\t\trules.push( compileCSS( elementStyles, { selector } ) );\n\n\t\t\t// Process any interactive states for the element type.\n\t\t\tif ( pseudo ) {\n\t\t\t\tpseudo.forEach( ( pseudoSelector ) => {\n\t\t\t\t\tif ( elementStyles[ pseudoSelector ] ) {\n\t\t\t\t\t\trules.push(\n\t\t\t\t\t\t\tcompileCSS( elementStyles[ pseudoSelector ], {\n\t\t\t\t\t\t\t\tselector: scopeSelector(\n\t\t\t\t\t\t\t\t\tbaseSelector,\n\t\t\t\t\t\t\t\t\t`${ ELEMENTS[ elementType ] }${ pseudoSelector }`\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\n\t\t// Process related elements e.g. h1-h6 for headings\n\t\tif ( elements ) {\n\t\t\telements.forEach( ( element ) => {\n\t\t\t\tif ( blockElementStyles[ element ] ) {\n\t\t\t\t\trules.push(\n\t\t\t\t\t\tcompileCSS( blockElementStyles[ element ], {\n\t\t\t\t\t\t\tselector: scopeSelector(\n\t\t\t\t\t\t\t\tbaseSelector,\n\t\t\t\t\t\t\t\tELEMENTS[ element ]\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 rules.length > 0 ? rules.join( '' ) : undefined;\n}\n\nfunction useBlockProps( { name, style } ) {\n\tconst blockElementsContainerIdentifier = useInstanceId(\n\t\tSTYLE_BLOCK_PROPS_REFERENCE,\n\t\t'wp-elements'\n\t);\n\n\tconst baseElementSelector = `.${ blockElementsContainerIdentifier }`;\n\tconst blockElementStyles = style?.elements;\n\n\tconst styles = useMemo( () => {\n\t\tconst cssRules = [];\n\n\t\tconst elementCSS = getElementCSSRules(\n\t\t\tblockElementStyles,\n\t\t\tname,\n\t\t\tbaseElementSelector\n\t\t);\n\t\tif ( elementCSS ) {\n\t\t\tcssRules.push( elementCSS );\n\t\t}\n\n\t\tcssRules.push(\n\t\t\t...getPseudoStateCSSRules( style, name, baseElementSelector )\n\t\t);\n\n\t\tcssRules.push(\n\t\t\t...getResponsiveStateCSSRules( style, name, baseElementSelector )\n\t\t);\n\n\t\treturn cssRules.length > 0 ? cssRules.join( '' ) : undefined;\n\t}, [ baseElementSelector, blockElementStyles, name, style ] );\n\n\tuseStyleOverride( { css: styles } );\n\n\treturn addSaveProps(\n\t\t{ className: blockElementsContainerIdentifier },\n\t\tname,\n\t\t{ style },\n\t\tskipSerializationPathsEdit\n\t);\n}\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/style/addAttribute',\n\taddAttribute\n);\n"],
5
+ "mappings": ";AAGA,SAAS,eAAe;AACxB,SAAS,iBAAiB;AAC1B,SAAS,iBAAiB;AAC1B,SAAS,yBAAyB;AAClC;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA,2BAA2B;AAAA,OACrB;AACP,SAAS,qBAAqB;AAC9B,SAAS,aAAa,kBAAkB;AAKxC,SAAS,wBAAwB,4BAA4B;AAC7D,SAAS,oBAAoB,aAAa,0BAA0B;AACpE,SAAS,yBAAyB;AAClC,SAAS,oBAAoB;AAC7B;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,SAAS,iCAAiC;AAC1C,SAAS,g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AAM;AAC7B,UAAM,WAAW,CAAC;AAElB,UAAM,aAAa;AAAA,MAClB;AAAA,MACA;AAAA,MACA;AAAA,IACD;AACA,QAAK,YAAa;AACjB,eAAS,KAAM,UAAW;AAAA,IAC3B;AAEA,aAAS;AAAA,MACR,GAAG,uBAAwB,OAAO,MAAM,mBAAoB;AAAA,IAC7D;AAEA,aAAS;AAAA,MACR,GAAG,2BAA4B,OAAO,MAAM,mBAAoB;AAAA,IACjE;AAEA,WAAO,SAAS,SAAS,IAAI,SAAS,KAAM,EAAG,IAAI;AAAA,EACpD,GAAG,CAAE,qBAAqB,oBAAoB,MAAM,KAAM,CAAE;AAE5D,mBAAkB,EAAE,KAAK,OAAO,CAAE;AAElC,SAAO;AAAA,IACN,EAAE,WAAW,iCAAiC;AAAA,IAC9C;AAAA,IACA,EAAE,MAAM;AAAA,IACR;AAAA,EACD;AACD;AAEA;AAAA,EACC;AAAA,EACA;AAAA,EACA;AACD;",
6
6
  "names": []
7
7
  }
@@ -1,6 +1,5 @@
1
1
  // packages/block-editor/src/hooks/supports.js
2
2
  import { getBlockSupport, hasBlockSupport } from "@wordpress/blocks";
3
- import { Platform } from "@wordpress/element";
4
3
  var ALIGN_SUPPORT_KEY = "align";
5
4
  var ALIGN_WIDE_SUPPORT_KEY = "alignWide";
6
5
  var BORDER_SUPPORT_KEY = "__experimentalBorder";
@@ -45,9 +44,6 @@ var getAlignSupport = (nameOrType) => getBlockSupport(nameOrType, ALIGN_SUPPORT_
45
44
  var hasAlignWideSupport = (nameOrType) => hasBlockSupport(nameOrType, ALIGN_WIDE_SUPPORT_KEY);
46
45
  var getAlignWideSupport = (nameOrType) => getBlockSupport(nameOrType, ALIGN_WIDE_SUPPORT_KEY);
47
46
  function hasBorderSupport(nameOrType, feature = "any") {
48
- if (Platform.OS !== "web") {
49
- return false;
50
- }
51
47
  const support = getBlockSupport(nameOrType, BORDER_SUPPORT_KEY);
52
48
  if (support === true) {
53
49
  return true;
@@ -63,9 +59,6 @@ var hasColorSupport = (nameOrType) => {
63
59
  return colorSupport && (colorSupport.link === true || colorSupport.gradient === true || colorSupport.background !== false || colorSupport.text !== false);
64
60
  };
65
61
  var hasLinkColorSupport = (nameOrType) => {
66
- if (Platform.OS !== "web") {
67
- return false;
68
- }
69
62
  const colorSupport = getBlockSupport(nameOrType, COLOR_SUPPORT_KEY);
70
63
  return colorSupport !== null && typeof colorSupport === "object" && !!colorSupport.link;
71
64
  };
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/hooks/supports.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { getBlockSupport, hasBlockSupport } from '@wordpress/blocks';\nimport { Platform } from '@wordpress/element';\n\nconst ALIGN_SUPPORT_KEY = 'align';\nconst ALIGN_WIDE_SUPPORT_KEY = 'alignWide';\nconst BORDER_SUPPORT_KEY = '__experimentalBorder';\nconst COLOR_SUPPORT_KEY = 'color';\nconst CUSTOM_CLASS_NAME_SUPPORT_KEY = 'customClassName';\nconst FONT_FAMILY_SUPPORT_KEY = 'typography.__experimentalFontFamily';\nconst FONT_SIZE_SUPPORT_KEY = 'typography.fontSize';\nconst LINE_HEIGHT_SUPPORT_KEY = 'typography.lineHeight';\n/**\n * Key within block settings' support array indicating support for font style.\n */\nconst FONT_STYLE_SUPPORT_KEY = 'typography.__experimentalFontStyle';\n/**\n * Key within block settings' support array indicating support for font weight.\n */\nconst FONT_WEIGHT_SUPPORT_KEY = 'typography.__experimentalFontWeight';\n/**\n * Key within block settings' supports array indicating support for text\n * align e.g. settings found in `block.json`.\n */\nconst TEXT_ALIGN_SUPPORT_KEY = 'typography.textAlign';\n/**\n * Key within block settings' supports array indicating support for text\n * columns e.g. settings found in `block.json`.\n */\nconst TEXT_COLUMNS_SUPPORT_KEY = 'typography.textColumns';\n/**\n * Key within block settings' supports array indicating support for text\n * decorations e.g. settings found in `block.json`.\n */\nconst TEXT_DECORATION_SUPPORT_KEY = 'typography.__experimentalTextDecoration';\n/**\n * Key within block settings' supports array indicating support for writing mode\n * e.g. settings found in `block.json`.\n */\nconst WRITING_MODE_SUPPORT_KEY = 'typography.__experimentalWritingMode';\n/**\n * Key within block settings' supports array indicating support for text\n * transforms e.g. settings found in `block.json`.\n */\nconst TEXT_TRANSFORM_SUPPORT_KEY = 'typography.__experimentalTextTransform';\n\n/**\n * Key within block settings' supports array indicating support for letter-spacing\n * e.g. settings found in `block.json`.\n */\nconst LETTER_SPACING_SUPPORT_KEY = 'typography.__experimentalLetterSpacing';\nconst LAYOUT_SUPPORT_KEY = 'layout';\nconst TYPOGRAPHY_SUPPORT_KEYS = [\n\tLINE_HEIGHT_SUPPORT_KEY,\n\tFONT_SIZE_SUPPORT_KEY,\n\tFONT_STYLE_SUPPORT_KEY,\n\tFONT_WEIGHT_SUPPORT_KEY,\n\tFONT_FAMILY_SUPPORT_KEY,\n\tTEXT_ALIGN_SUPPORT_KEY,\n\tTEXT_COLUMNS_SUPPORT_KEY,\n\tTEXT_DECORATION_SUPPORT_KEY,\n\tTEXT_TRANSFORM_SUPPORT_KEY,\n\tWRITING_MODE_SUPPORT_KEY,\n\tLETTER_SPACING_SUPPORT_KEY,\n];\nconst EFFECTS_SUPPORT_KEYS = [ 'shadow' ];\nconst SPACING_SUPPORT_KEY = 'spacing';\nconst styleSupportKeys = [\n\t...EFFECTS_SUPPORT_KEYS,\n\t...TYPOGRAPHY_SUPPORT_KEYS,\n\tBORDER_SUPPORT_KEY,\n\tCOLOR_SUPPORT_KEY,\n\tSPACING_SUPPORT_KEY,\n];\n\n/**\n * Returns true if the block defines support for align.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasAlignSupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, ALIGN_SUPPORT_KEY );\n\n/**\n * Returns the block support value for align, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getAlignSupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, ALIGN_SUPPORT_KEY );\n\n/**\n * Returns true if the block defines support for align wide.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasAlignWideSupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, ALIGN_WIDE_SUPPORT_KEY );\n\n/**\n * Returns the block support value for align wide, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getAlignWideSupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, ALIGN_WIDE_SUPPORT_KEY );\n\n/**\n * Determine whether there is block support for border properties.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @param {string} feature Border feature to check support for.\n *\n * @return {boolean} Whether there is support.\n */\nexport function hasBorderSupport( nameOrType, feature = 'any' ) {\n\tif ( Platform.OS !== 'web' ) {\n\t\treturn false;\n\t}\n\n\tconst support = getBlockSupport( nameOrType, BORDER_SUPPORT_KEY );\n\n\tif ( support === true ) {\n\t\treturn true;\n\t}\n\n\tif ( feature === 'any' ) {\n\t\treturn !! (\n\t\t\tsupport?.color ||\n\t\t\tsupport?.radius ||\n\t\t\tsupport?.width ||\n\t\t\tsupport?.style\n\t\t);\n\t}\n\n\treturn !! support?.[ feature ];\n}\n\n/**\n * Get block support for border properties.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @param {string} feature Border feature to get.\n *\n * @return {unknown} The block support.\n */\nexport const getBorderSupport = ( nameOrType, feature ) =>\n\tgetBlockSupport( nameOrType, [ BORDER_SUPPORT_KEY, feature ] );\n\n/**\n * Returns true if the block defines support for color.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasColorSupport = ( nameOrType ) => {\n\tconst colorSupport = getBlockSupport( nameOrType, COLOR_SUPPORT_KEY );\n\treturn (\n\t\tcolorSupport &&\n\t\t( colorSupport.link === true ||\n\t\t\tcolorSupport.gradient === true ||\n\t\t\tcolorSupport.background !== false ||\n\t\t\tcolorSupport.text !== false )\n\t);\n};\n\n/**\n * Returns true if the block defines support for link color.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasLinkColorSupport = ( nameOrType ) => {\n\tif ( Platform.OS !== 'web' ) {\n\t\treturn false;\n\t}\n\n\tconst colorSupport = getBlockSupport( nameOrType, COLOR_SUPPORT_KEY );\n\n\treturn (\n\t\tcolorSupport !== null &&\n\t\ttypeof colorSupport === 'object' &&\n\t\t!! colorSupport.link\n\t);\n};\n\n/**\n * Returns true if the block defines support for gradient color.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasGradientSupport = ( nameOrType ) => {\n\tconst colorSupport = getBlockSupport( nameOrType, COLOR_SUPPORT_KEY );\n\n\treturn (\n\t\tcolorSupport !== null &&\n\t\ttypeof colorSupport === 'object' &&\n\t\t!! colorSupport.gradients\n\t);\n};\n\n/**\n * Returns true if the block defines support for background color.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasBackgroundColorSupport = ( nameOrType ) => {\n\tconst colorSupport = getBlockSupport( nameOrType, COLOR_SUPPORT_KEY );\n\n\treturn colorSupport && colorSupport.background !== false;\n};\n\n/**\n * Returns true if the block defines support for text-align.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasTextAlignSupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, TEXT_ALIGN_SUPPORT_KEY );\n\n/**\n * Returns the block support value for text-align, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getTextAlignSupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, TEXT_ALIGN_SUPPORT_KEY );\n\n/**\n * Returns true if the block defines support for background color.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasTextColorSupport = ( nameOrType ) => {\n\tconst colorSupport = getBlockSupport( nameOrType, COLOR_SUPPORT_KEY );\n\n\treturn colorSupport && colorSupport.text !== false;\n};\n\n/**\n * Get block support for color properties.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @param {string} feature Color feature to get.\n *\n * @return {unknown} The block support.\n */\nexport const getColorSupport = ( nameOrType, feature ) =>\n\tgetBlockSupport( nameOrType, [ COLOR_SUPPORT_KEY, feature ] );\n\n/**\n * Returns true if the block defines support for custom class name.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasCustomClassNameSupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, CUSTOM_CLASS_NAME_SUPPORT_KEY, true );\n\n/**\n * Returns the block support value for custom class name, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getCustomClassNameSupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, CUSTOM_CLASS_NAME_SUPPORT_KEY, true );\n\n/**\n * Returns true if the block defines support for font family.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasFontFamilySupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, FONT_FAMILY_SUPPORT_KEY );\n\n/**\n * Returns the block support value for font family, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getFontFamilySupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, FONT_FAMILY_SUPPORT_KEY );\n\n/**\n * Returns true if the block defines support for font size.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasFontSizeSupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, FONT_SIZE_SUPPORT_KEY );\n\n/**\n * Returns the block support value for font size, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getFontSizeSupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, FONT_SIZE_SUPPORT_KEY );\n\n/**\n * Returns true if the block defines support for layout.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasLayoutSupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, LAYOUT_SUPPORT_KEY );\n\n/**\n * Returns the block support value for layout, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getLayoutSupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, LAYOUT_SUPPORT_KEY );\n\n/**\n * Returns true if the block defines support for style.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasStyleSupport = ( nameOrType ) =>\n\tstyleSupportKeys.some( ( key ) => hasBlockSupport( nameOrType, key ) );\n"],
5
- "mappings": ";AAGA,SAAS,iBAAiB,uBAAuB;AACjD,SAAS,gBAAgB;AAEzB,IAAM,oBAAoB;AAC1B,IAAM,yBAAyB;AAC/B,IAAM,qBAAqB;AAC3B,IAAM,oBAAoB;AAC1B,IAAM,gCAAgC;AACtC,IAAM,0BAA0B;AAChC,IAAM,wBAAwB;AAC9B,IAAM,0BAA0B;AAIhC,IAAM,yBAAyB;AAI/B,IAAM,0BAA0B;AAKhC,IAAM,yBAAyB;AAK/B,IAAM,2BAA2B;AAKjC,IAAM,8BAA8B;AAKpC,IAAM,2BAA2B;AAKjC,IAAM,6BAA6B;AAMnC,IAAM,6BAA6B;AACnC,IAAM,qBAAqB;AAC3B,IAAM,0BAA0B;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD;AACA,IAAM,uBAAuB,CAAE,QAAS;AACxC,IAAM,sBAAsB;AAC5B,IAAM,mBAAmB;AAAA,EACxB,GAA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AE,eAAgB;AAC1D,QAAM,eAAe,gBAAiB,YAAY,iBAAkB;AAEpE,SAAO,gBAAgB,aAAa,eAAe;AACpD;AAQO,IAAM,sBAAsB,CAAE,eACpC,gBAAiB,YAAY,sBAAuB;AAQ9C,IAAM,sBAAsB,CAAE,eACpC,gBAAiB,YAAY,sBAAuB;AAQ9C,IAAM,sBAAsB,CAAE,eAAgB;AACpD,QAAM,eAAe,gBAAiB,YAAY,iBAAkB;AAEpE,SAAO,gBAAgB,aAAa,SAAS;AAC9C;AAUO,IAAM,kBAAkB,CAAE,YAAY,YAC5C,gBAAiB,YAAY,CAAE,mBAAmB,OAAQ,CAAE;AAQtD,IAAM,4BAA4B,CAAE,eAC1C,gBAAiB,YAAY,+BAA+B,IAAK;AAQ3D,IAAM,4BAA4B,CAAE,eAC1C,gBAAiB,YAAY,+BAA+B,IAAK;AAQ3D,IAAM,uBAAuB,CAAE,eACrC,gBAAiB,YAAY,uBAAwB;AAQ/C,IAAM,uBAAuB,CAAE,eACrC,gBAAiB,YAAY,uBAAwB;AAQ/C,IAAM,qBAAqB,CAAE,eACnC,gBAAiB,YAAY,qBAAsB;AAQ7C,IAAM,qBAAqB,CAAE,eACnC,gBAAiB,YAAY,qBAAsB;AAQ7C,IAAM,mBAAmB,CAAE,eACjC,gBAAiB,YAAY,kBAAmB;AAQ1C,IAAM,mBAAmB,CAAE,eACjC,gBAAiB,YAAY,kBAAmB;AAQ1C,IAAM,kBAAkB,CAAE,eAChC,iBAAiB,KAAM,CAAE,QAAS,gBAAiB,YAAY,GAAI,CAAE;",
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { getBlockSupport, hasBlockSupport } from '@wordpress/blocks';\n\nconst ALIGN_SUPPORT_KEY = 'align';\nconst ALIGN_WIDE_SUPPORT_KEY = 'alignWide';\nconst BORDER_SUPPORT_KEY = '__experimentalBorder';\nconst COLOR_SUPPORT_KEY = 'color';\nconst CUSTOM_CLASS_NAME_SUPPORT_KEY = 'customClassName';\nconst FONT_FAMILY_SUPPORT_KEY = 'typography.__experimentalFontFamily';\nconst FONT_SIZE_SUPPORT_KEY = 'typography.fontSize';\nconst LINE_HEIGHT_SUPPORT_KEY = 'typography.lineHeight';\n/**\n * Key within block settings' support array indicating support for font style.\n */\nconst FONT_STYLE_SUPPORT_KEY = 'typography.__experimentalFontStyle';\n/**\n * Key within block settings' support array indicating support for font weight.\n */\nconst FONT_WEIGHT_SUPPORT_KEY = 'typography.__experimentalFontWeight';\n/**\n * Key within block settings' supports array indicating support for text\n * align e.g. settings found in `block.json`.\n */\nconst TEXT_ALIGN_SUPPORT_KEY = 'typography.textAlign';\n/**\n * Key within block settings' supports array indicating support for text\n * columns e.g. settings found in `block.json`.\n */\nconst TEXT_COLUMNS_SUPPORT_KEY = 'typography.textColumns';\n/**\n * Key within block settings' supports array indicating support for text\n * decorations e.g. settings found in `block.json`.\n */\nconst TEXT_DECORATION_SUPPORT_KEY = 'typography.__experimentalTextDecoration';\n/**\n * Key within block settings' supports array indicating support for writing mode\n * e.g. settings found in `block.json`.\n */\nconst WRITING_MODE_SUPPORT_KEY = 'typography.__experimentalWritingMode';\n/**\n * Key within block settings' supports array indicating support for text\n * transforms e.g. settings found in `block.json`.\n */\nconst TEXT_TRANSFORM_SUPPORT_KEY = 'typography.__experimentalTextTransform';\n\n/**\n * Key within block settings' supports array indicating support for letter-spacing\n * e.g. settings found in `block.json`.\n */\nconst LETTER_SPACING_SUPPORT_KEY = 'typography.__experimentalLetterSpacing';\nconst LAYOUT_SUPPORT_KEY = 'layout';\nconst TYPOGRAPHY_SUPPORT_KEYS = [\n\tLINE_HEIGHT_SUPPORT_KEY,\n\tFONT_SIZE_SUPPORT_KEY,\n\tFONT_STYLE_SUPPORT_KEY,\n\tFONT_WEIGHT_SUPPORT_KEY,\n\tFONT_FAMILY_SUPPORT_KEY,\n\tTEXT_ALIGN_SUPPORT_KEY,\n\tTEXT_COLUMNS_SUPPORT_KEY,\n\tTEXT_DECORATION_SUPPORT_KEY,\n\tTEXT_TRANSFORM_SUPPORT_KEY,\n\tWRITING_MODE_SUPPORT_KEY,\n\tLETTER_SPACING_SUPPORT_KEY,\n];\nconst EFFECTS_SUPPORT_KEYS = [ 'shadow' ];\nconst SPACING_SUPPORT_KEY = 'spacing';\nconst styleSupportKeys = [\n\t...EFFECTS_SUPPORT_KEYS,\n\t...TYPOGRAPHY_SUPPORT_KEYS,\n\tBORDER_SUPPORT_KEY,\n\tCOLOR_SUPPORT_KEY,\n\tSPACING_SUPPORT_KEY,\n];\n\n/**\n * Returns true if the block defines support for align.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasAlignSupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, ALIGN_SUPPORT_KEY );\n\n/**\n * Returns the block support value for align, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getAlignSupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, ALIGN_SUPPORT_KEY );\n\n/**\n * Returns true if the block defines support for align wide.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasAlignWideSupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, ALIGN_WIDE_SUPPORT_KEY );\n\n/**\n * Returns the block support value for align wide, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getAlignWideSupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, ALIGN_WIDE_SUPPORT_KEY );\n\n/**\n * Determine whether there is block support for border properties.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @param {string} feature Border feature to check support for.\n *\n * @return {boolean} Whether there is support.\n */\nexport function hasBorderSupport( nameOrType, feature = 'any' ) {\n\tconst support = getBlockSupport( nameOrType, BORDER_SUPPORT_KEY );\n\n\tif ( support === true ) {\n\t\treturn true;\n\t}\n\n\tif ( feature === 'any' ) {\n\t\treturn !! (\n\t\t\tsupport?.color ||\n\t\t\tsupport?.radius ||\n\t\t\tsupport?.width ||\n\t\t\tsupport?.style\n\t\t);\n\t}\n\n\treturn !! support?.[ feature ];\n}\n\n/**\n * Get block support for border properties.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @param {string} feature Border feature to get.\n *\n * @return {unknown} The block support.\n */\nexport const getBorderSupport = ( nameOrType, feature ) =>\n\tgetBlockSupport( nameOrType, [ BORDER_SUPPORT_KEY, feature ] );\n\n/**\n * Returns true if the block defines support for color.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasColorSupport = ( nameOrType ) => {\n\tconst colorSupport = getBlockSupport( nameOrType, COLOR_SUPPORT_KEY );\n\treturn (\n\t\tcolorSupport &&\n\t\t( colorSupport.link === true ||\n\t\t\tcolorSupport.gradient === true ||\n\t\t\tcolorSupport.background !== false ||\n\t\t\tcolorSupport.text !== false )\n\t);\n};\n\n/**\n * Returns true if the block defines support for link color.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasLinkColorSupport = ( nameOrType ) => {\n\tconst colorSupport = getBlockSupport( nameOrType, COLOR_SUPPORT_KEY );\n\n\treturn (\n\t\tcolorSupport !== null &&\n\t\ttypeof colorSupport === 'object' &&\n\t\t!! colorSupport.link\n\t);\n};\n\n/**\n * Returns true if the block defines support for gradient color.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasGradientSupport = ( nameOrType ) => {\n\tconst colorSupport = getBlockSupport( nameOrType, COLOR_SUPPORT_KEY );\n\n\treturn (\n\t\tcolorSupport !== null &&\n\t\ttypeof colorSupport === 'object' &&\n\t\t!! colorSupport.gradients\n\t);\n};\n\n/**\n * Returns true if the block defines support for background color.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasBackgroundColorSupport = ( nameOrType ) => {\n\tconst colorSupport = getBlockSupport( nameOrType, COLOR_SUPPORT_KEY );\n\n\treturn colorSupport && colorSupport.background !== false;\n};\n\n/**\n * Returns true if the block defines support for text-align.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasTextAlignSupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, TEXT_ALIGN_SUPPORT_KEY );\n\n/**\n * Returns the block support value for text-align, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getTextAlignSupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, TEXT_ALIGN_SUPPORT_KEY );\n\n/**\n * Returns true if the block defines support for background color.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasTextColorSupport = ( nameOrType ) => {\n\tconst colorSupport = getBlockSupport( nameOrType, COLOR_SUPPORT_KEY );\n\n\treturn colorSupport && colorSupport.text !== false;\n};\n\n/**\n * Get block support for color properties.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @param {string} feature Color feature to get.\n *\n * @return {unknown} The block support.\n */\nexport const getColorSupport = ( nameOrType, feature ) =>\n\tgetBlockSupport( nameOrType, [ COLOR_SUPPORT_KEY, feature ] );\n\n/**\n * Returns true if the block defines support for custom class name.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasCustomClassNameSupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, CUSTOM_CLASS_NAME_SUPPORT_KEY, true );\n\n/**\n * Returns the block support value for custom class name, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getCustomClassNameSupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, CUSTOM_CLASS_NAME_SUPPORT_KEY, true );\n\n/**\n * Returns true if the block defines support for font family.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasFontFamilySupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, FONT_FAMILY_SUPPORT_KEY );\n\n/**\n * Returns the block support value for font family, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getFontFamilySupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, FONT_FAMILY_SUPPORT_KEY );\n\n/**\n * Returns true if the block defines support for font size.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasFontSizeSupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, FONT_SIZE_SUPPORT_KEY );\n\n/**\n * Returns the block support value for font size, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getFontSizeSupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, FONT_SIZE_SUPPORT_KEY );\n\n/**\n * Returns true if the block defines support for layout.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasLayoutSupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, LAYOUT_SUPPORT_KEY );\n\n/**\n * Returns the block support value for layout, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getLayoutSupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, LAYOUT_SUPPORT_KEY );\n\n/**\n * Returns true if the block defines support for style.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasStyleSupport = ( nameOrType ) =>\n\tstyleSupportKeys.some( ( key ) => hasBlockSupport( nameOrType, key ) );\n"],
5
+ "mappings": ";AAGA,SAAS,iBAAiB,uBAAuB;AAEjD,IAAM,oBAAoB;AAC1B,IAAM,yBAAyB;AAC/B,IAAM,qBAAqB;AAC3B,IAAM,oBAAoB;AAC1B,IAAM,gCAAgC;AACtC,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C,gBAAiB,YAAY,kBAAmB;AAQ1C,IAAM,kBAAkB,CAAE,eAChC,iBAAiB,KAAM,CAAE,QAAS,gBAAiB,YAAY,GAAI,CAAE;",
6
6
  "names": []
7
7
  }
@@ -2,6 +2,7 @@
2
2
  import { getBlockSupport, hasBlockSupport } from "@wordpress/blocks";
3
3
  import { useMemo, useCallback } from "@wordpress/element";
4
4
  import { useSelect } from "@wordpress/data";
5
+ import { __ } from "@wordpress/i18n";
5
6
  import InspectorControls from "../components/inspector-controls/index.mjs";
6
7
  import {
7
8
  default as StylesTypographyPanel,
@@ -13,6 +14,7 @@ import { FONT_SIZE_SUPPORT_KEY } from "./font-size.mjs";
13
14
  import { TEXT_ALIGN_SUPPORT_KEY } from "./text-align.mjs";
14
15
  import { FIT_TEXT_SUPPORT_KEY } from "./fit-text.mjs";
15
16
  import { cleanEmptyObject } from "./utils.mjs";
17
+ import { extractPresetSlug } from "../utils/color-values.mjs";
16
18
  import { store as blockEditorStore } from "../store/index.mjs";
17
19
  import {
18
20
  getStyleForState,
@@ -20,6 +22,7 @@ import {
20
22
  setStyleForState,
21
23
  useBlockStyleState
22
24
  } from "./block-style-state.mjs";
25
+ import useBlockColorContrastWarning from "./contrast-checker.mjs";
23
26
  import { jsx } from "react/jsx-runtime";
24
27
  function omit(object, keys) {
25
28
  return Object.fromEntries(
@@ -54,18 +57,25 @@ function styleToAttributes(style) {
54
57
  const updatedStyle = { ...omit(style, ["fontFamily"]) };
55
58
  const fontSizeValue = style?.typography?.fontSize;
56
59
  const fontFamilyValue = style?.typography?.fontFamily;
60
+ const textColorValue = style?.color?.text;
57
61
  const fontSizeSlug = typeof fontSizeValue === "string" && fontSizeValue?.startsWith("var:preset|font-size|") ? fontSizeValue.substring("var:preset|font-size|".length) : void 0;
58
62
  const fontFamilySlug = fontFamilyValue?.startsWith(
59
63
  "var:preset|font-family|"
60
64
  ) ? fontFamilyValue.substring("var:preset|font-family|".length) : void 0;
65
+ const textColorSlug = extractPresetSlug(textColorValue, "color");
61
66
  updatedStyle.typography = {
62
67
  ...omit(updatedStyle.typography, ["fontFamily"]),
63
68
  fontSize: fontSizeSlug ? void 0 : fontSizeValue
64
69
  };
70
+ updatedStyle.color = {
71
+ ...updatedStyle.color,
72
+ text: textColorSlug ? void 0 : textColorValue
73
+ };
65
74
  return {
66
75
  style: cleanEmptyObject(updatedStyle),
67
76
  fontFamily: fontFamilySlug,
68
- fontSize: fontSizeSlug
77
+ fontSize: fontSizeSlug,
78
+ textColor: textColorSlug
69
79
  };
70
80
  }
71
81
  function attributesToStyle(attributes) {
@@ -75,6 +85,10 @@ function attributesToStyle(attributes) {
75
85
  ...attributes.style?.typography,
76
86
  fontFamily: attributes.fontFamily ? "var:preset|font-family|" + attributes.fontFamily : void 0,
77
87
  fontSize: attributes.fontSize ? "var:preset|font-size|" + attributes.fontSize : attributes.style?.typography?.fontSize
88
+ },
89
+ color: {
90
+ ...attributes.style?.color,
91
+ text: attributes.textColor ? "var:preset|color|" + attributes.textColor : attributes.style?.color?.text
78
92
  }
79
93
  };
80
94
  }
@@ -99,10 +113,19 @@ function TypographyInspectorControl({ children, resetAllFilter }) {
99
113
  }
100
114
  );
101
115
  }
102
- function TypographyPanel({ clientId, name, setAttributes, settings }) {
116
+ function TypographyPanel({
117
+ clientId,
118
+ name,
119
+ setAttributes,
120
+ settings,
121
+ // Allows rendering outside the `typography` inspector group (e.g. section
122
+ // blocks direct-render this panel because their support fills are gated
123
+ // off by editing mode). Defaults to the slot-based wrapper.
124
+ asWrapper
125
+ }) {
103
126
  const selectedState = useBlockStyleState();
104
127
  const isEnabled = useHasTypographyPanel(settings);
105
- const { style, fontFamily, fontSize, fitText } = useSelect(
128
+ const { style, fontFamily, fontSize, fitText, textColor } = useSelect(
106
129
  (select) => {
107
130
  if (!isEnabled) {
108
131
  return {};
@@ -111,13 +134,15 @@ function TypographyPanel({ clientId, name, setAttributes, settings }) {
111
134
  style: _style,
112
135
  fontFamily: _fontFamily,
113
136
  fontSize: _fontSize,
114
- fitText: _fitText
137
+ fitText: _fitText,
138
+ textColor: _textColor
115
139
  } = select(blockEditorStore).getBlockAttributes(clientId) || {};
116
140
  return {
117
141
  style: _style,
118
142
  fontFamily: _fontFamily,
119
143
  fontSize: _fontSize,
120
- fitText: _fitText
144
+ fitText: _fitText,
145
+ textColor: _textColor
121
146
  };
122
147
  },
123
148
  [clientId, isEnabled]
@@ -127,8 +152,15 @@ function TypographyPanel({ clientId, name, setAttributes, settings }) {
127
152
  if (isStateSelected) {
128
153
  return getStyleForState(style, selectedState);
129
154
  }
130
- return attributesToStyle({ style, fontFamily, fontSize });
131
- }, [isStateSelected, selectedState, style, fontSize, fontFamily]);
155
+ return attributesToStyle({ style, fontFamily, fontSize, textColor });
156
+ }, [
157
+ isStateSelected,
158
+ selectedState,
159
+ style,
160
+ fontSize,
161
+ fontFamily,
162
+ textColor
163
+ ]);
132
164
  const onChange = isStateSelected ? (newStyle) => {
133
165
  setAttributes({
134
166
  style: setStyleForState(style, selectedState, newStyle)
@@ -141,22 +173,42 @@ function TypographyPanel({ clientId, name, setAttributes, settings }) {
141
173
  }
142
174
  setAttributes(newAttributes);
143
175
  };
176
+ const enableContrastChecking = !isStateSelected && !value?.color?.gradient && !!value?.color?.text && settings?.color?.text && false !== getBlockSupport(name, ["color", "enableContrastChecker"]);
177
+ const contrastWarning = useBlockColorContrastWarning({
178
+ clientId,
179
+ name,
180
+ enabled: !!enableContrastChecking,
181
+ checkLinkColor: false,
182
+ messageOverride: __(
183
+ "This color has poor contrast against the background. Consider increasing contrast."
184
+ )
185
+ });
144
186
  if (!isEnabled) {
145
187
  return null;
146
188
  }
147
- const defaultControls = getBlockSupport(name, [
189
+ const typographyDefaultControls = getBlockSupport(name, [
148
190
  TYPOGRAPHY_SUPPORT_KEY,
149
191
  "__experimentalDefaultControls"
150
192
  ]);
193
+ const colorDefaultControls = getBlockSupport(name, [
194
+ "color",
195
+ "__experimentalDefaultControls"
196
+ ]);
197
+ const defaultControls = {
198
+ ...typographyDefaultControls,
199
+ textColor: colorDefaultControls?.text
200
+ };
201
+ const Wrapper = asWrapper || TypographyInspectorControl;
151
202
  return /* @__PURE__ */ jsx(
152
203
  StylesTypographyPanel,
153
204
  {
154
- as: TypographyInspectorControl,
205
+ as: Wrapper,
155
206
  panelId: clientId,
156
207
  settings,
157
208
  value,
158
209
  onChange,
159
- defaultControls
210
+ defaultControls,
211
+ contrastWarning
160
212
  }
161
213
  );
162
214
  }