@wordpress/block-editor 16.0.1-next.v.202607070741.0 → 16.1.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 (679) hide show
  1. package/CHANGELOG.md +27 -1
  2. package/README.md +8 -0
  3. package/build/components/alignment-control/ui.cjs +2 -4
  4. package/build/components/alignment-control/ui.cjs.map +2 -2
  5. package/build/components/background-image-control/index.cjs +40 -10
  6. package/build/components/background-image-control/index.cjs.map +2 -2
  7. package/build/components/block-alignment-control/ui.cjs +5 -3
  8. package/build/components/block-alignment-control/ui.cjs.map +2 -2
  9. package/build/components/block-canvas/index.cjs +6 -1
  10. package/build/components/block-canvas/index.cjs.map +2 -2
  11. package/build/components/block-controls/groups.cjs +3 -1
  12. package/build/components/block-controls/groups.cjs.map +2 -2
  13. package/build/components/block-edit/edit.cjs +10 -18
  14. package/build/components/block-edit/edit.cjs.map +2 -2
  15. package/build/components/block-inspector/index.cjs +73 -46
  16. package/build/components/block-inspector/index.cjs.map +2 -2
  17. package/build/components/block-list/block-html.cjs +4 -1
  18. package/build/components/block-list/block-html.cjs.map +2 -2
  19. package/build/components/block-list/block.cjs +9 -3
  20. package/build/components/block-list/block.cjs.map +3 -3
  21. package/build/components/block-list/index.cjs +1 -3
  22. package/build/components/block-list/index.cjs.map +2 -2
  23. package/build/components/block-list/use-block-props/index.cjs +7 -2
  24. package/build/components/block-list/use-block-props/index.cjs.map +2 -2
  25. package/build/components/block-list/use-block-props/use-focus-first-element.cjs +9 -4
  26. package/build/components/block-list/use-block-props/use-focus-first-element.cjs.map +2 -2
  27. package/build/components/block-list/use-block-props/use-focus-handler.cjs +11 -4
  28. package/build/components/block-list/use-block-props/use-focus-handler.cjs.map +2 -2
  29. package/build/components/block-list/use-block-props/use-register-block-event-handlers.cjs +48 -0
  30. package/build/components/block-list/use-block-props/use-register-block-event-handlers.cjs.map +7 -0
  31. package/build/components/block-parent-selector/index.cjs +2 -2
  32. package/build/components/block-parent-selector/index.cjs.map +2 -2
  33. package/build/components/block-toolbar/index.cjs +43 -24
  34. package/build/components/block-toolbar/index.cjs.map +2 -2
  35. package/build/components/block-toolbar/switch-section-style.cjs +4 -2
  36. package/build/components/block-toolbar/switch-section-style.cjs.map +3 -3
  37. package/build/components/block-tools/empty-block-inserter.cjs +2 -7
  38. package/build/components/block-tools/empty-block-inserter.cjs.map +2 -2
  39. package/build/components/block-tools/index.cjs +7 -2
  40. package/build/components/block-tools/index.cjs.map +2 -2
  41. package/build/components/block-vertical-alignment-control/ui.cjs +3 -5
  42. package/build/components/block-vertical-alignment-control/ui.cjs.map +2 -2
  43. package/build/components/block-visibility/modal.cjs +20 -6
  44. package/build/components/block-visibility/modal.cjs.map +2 -2
  45. package/build/components/block-visibility/use-block-visibility.cjs +16 -6
  46. package/build/components/block-visibility/use-block-visibility.cjs.map +3 -3
  47. package/build/components/block-visibility/utils.cjs +15 -2
  48. package/build/components/block-visibility/utils.cjs.map +3 -3
  49. package/build/components/block-visibility/viewport-menu-item.cjs +7 -1
  50. package/build/components/block-visibility/viewport-menu-item.cjs.map +2 -2
  51. package/build/components/block-visibility/viewport-toolbar.cjs +5 -0
  52. package/build/components/block-visibility/viewport-toolbar.cjs.map +2 -2
  53. package/build/components/block-visibility/viewport-visibility-info.cjs +5 -1
  54. package/build/components/block-visibility/viewport-visibility-info.cjs.map +2 -2
  55. package/build/components/border-radius-control/utils.cjs +8 -58
  56. package/build/components/border-radius-control/utils.cjs.map +2 -2
  57. package/build/components/child-layout-control/index.cjs +0 -4
  58. package/build/components/child-layout-control/index.cjs.map +2 -2
  59. package/build/components/colors-gradients/control.cjs +5 -3
  60. package/build/components/colors-gradients/control.cjs.map +2 -2
  61. package/build/components/dimension-control/index.cjs +30 -20
  62. package/build/components/dimension-control/index.cjs.map +3 -3
  63. package/build/components/dimensions-tool/aspect-ratio-tool.cjs +9 -2
  64. package/build/components/dimensions-tool/aspect-ratio-tool.cjs.map +3 -3
  65. package/build/components/editor-styles/index.cjs +9 -1
  66. package/build/components/editor-styles/index.cjs.map +2 -2
  67. package/build/components/global-styles/background-panel.cjs +66 -25
  68. package/build/components/global-styles/background-panel.cjs.map +3 -3
  69. package/build/components/global-styles/border-panel.cjs +153 -55
  70. package/build/components/global-styles/border-panel.cjs.map +3 -3
  71. package/build/components/global-styles/color-gradient-dropdown-item.cjs +46 -14
  72. package/build/components/global-styles/color-gradient-dropdown-item.cjs.map +3 -3
  73. package/build/components/global-styles/color-panel.cjs +63 -17
  74. package/build/components/global-styles/color-panel.cjs.map +2 -2
  75. package/build/components/global-styles/dimensions-panel.cjs +242 -64
  76. package/build/components/global-styles/dimensions-panel.cjs.map +3 -3
  77. package/build/components/global-styles/filters-panel.cjs +59 -20
  78. package/build/components/global-styles/filters-panel.cjs.map +3 -3
  79. package/build/components/global-styles/hooks.cjs +4 -1
  80. package/build/components/global-styles/hooks.cjs.map +2 -2
  81. package/build/components/global-styles/inheritance/index.cjs +142 -0
  82. package/build/components/global-styles/inheritance/index.cjs.map +7 -0
  83. package/build/components/global-styles/inherited-value-context.cjs +173 -0
  84. package/build/components/global-styles/inherited-value-context.cjs.map +7 -0
  85. package/build/components/global-styles/shadow-panel-components.cjs +38 -20
  86. package/build/components/global-styles/shadow-panel-components.cjs.map +2 -2
  87. package/build/components/global-styles/state-control-badges.cjs +39 -3
  88. package/build/components/global-styles/state-control-badges.cjs.map +2 -2
  89. package/build/components/global-styles/state-control.cjs +1 -1
  90. package/build/components/global-styles/state-control.cjs.map +2 -2
  91. package/build/components/global-styles/typography-panel.cjs +271 -79
  92. package/build/components/global-styles/typography-panel.cjs.map +3 -3
  93. package/build/components/image-size-control/index.cjs +2 -4
  94. package/build/components/image-size-control/index.cjs.map +2 -2
  95. package/build/components/inserter/media-tab/hooks.cjs +33 -6
  96. package/build/components/inserter/media-tab/hooks.cjs.map +2 -2
  97. package/build/components/inserter/media-tab/media-panel.cjs +78 -16
  98. package/build/components/inserter/media-tab/media-panel.cjs.map +3 -3
  99. package/build/components/inspector-controls-tabs/styles-tab.cjs +10 -1
  100. package/build/components/inspector-controls-tabs/styles-tab.cjs.map +2 -2
  101. package/build/components/keyboard-shortcuts/index.cjs +19 -11
  102. package/build/components/keyboard-shortcuts/index.cjs.map +2 -2
  103. package/build/components/line-height-control/index.cjs +1 -2
  104. package/build/components/line-height-control/index.cjs.map +2 -2
  105. package/build/components/link-control/index.cjs +3 -1
  106. package/build/components/link-control/index.cjs.map +2 -2
  107. package/build/components/list-view/block.cjs +13 -4
  108. package/build/components/list-view/block.cjs.map +2 -2
  109. package/build/components/media-placeholder/index.cjs +0 -1
  110. package/build/components/media-placeholder/index.cjs.map +2 -2
  111. package/build/components/preset-input-control/index.cjs +2 -1
  112. package/build/components/preset-input-control/index.cjs.map +2 -2
  113. package/build/components/provider/block-refs-provider.cjs +8 -2
  114. package/build/components/provider/block-refs-provider.cjs.map +2 -2
  115. package/build/components/provider/index.cjs +1 -1
  116. package/build/components/provider/index.cjs.map +2 -2
  117. package/build/components/provider/use-block-sync.cjs +18 -6
  118. package/build/components/provider/use-block-sync.cjs.map +2 -2
  119. package/build/components/provider/use-media-upload-settings.cjs +3 -1
  120. package/build/components/provider/use-media-upload-settings.cjs.map +2 -2
  121. package/build/components/rich-text/event-listeners/before-input-rules.cjs +3 -4
  122. package/build/components/rich-text/event-listeners/before-input-rules.cjs.map +3 -3
  123. package/build/components/rich-text/event-listeners/delete.cjs +2 -3
  124. package/build/components/rich-text/event-listeners/delete.cjs.map +3 -3
  125. package/build/components/rich-text/event-listeners/enter.cjs +3 -2
  126. package/build/components/rich-text/event-listeners/enter.cjs.map +3 -3
  127. package/build/components/rich-text/event-listeners/input-events.cjs +3 -3
  128. package/build/components/rich-text/event-listeners/input-events.cjs.map +3 -3
  129. package/build/components/rich-text/event-listeners/input-rules.cjs +3 -4
  130. package/build/components/rich-text/event-listeners/input-rules.cjs.map +3 -3
  131. package/build/components/rich-text/event-listeners/insert-replacement-text.cjs +3 -3
  132. package/build/components/rich-text/event-listeners/insert-replacement-text.cjs.map +3 -3
  133. package/build/components/rich-text/event-listeners/paste-handler.cjs +2 -1
  134. package/build/components/rich-text/event-listeners/paste-handler.cjs.map +3 -3
  135. package/build/components/rich-text/event-listeners/remove-browser-shortcuts.cjs +3 -3
  136. package/build/components/rich-text/event-listeners/remove-browser-shortcuts.cjs.map +3 -3
  137. package/build/components/rich-text/event-listeners/shortcuts.cjs +3 -3
  138. package/build/components/rich-text/event-listeners/shortcuts.cjs.map +3 -3
  139. package/build/components/rich-text/event-listeners/undo-automatic-change.cjs +3 -3
  140. package/build/components/rich-text/event-listeners/undo-automatic-change.cjs.map +3 -3
  141. package/build/components/rich-text/index.cjs +76 -17
  142. package/build/components/rich-text/index.cjs.map +2 -2
  143. package/build/components/spacing-sizes-control/utils.cjs +6 -19
  144. package/build/components/spacing-sizes-control/utils.cjs.map +2 -2
  145. package/build/components/text-indent-control/index.cjs +8 -2
  146. package/build/components/text-indent-control/index.cjs.map +2 -2
  147. package/build/components/typewriter/index.cjs +129 -136
  148. package/build/components/typewriter/index.cjs.map +3 -3
  149. package/build/components/url-input/index.cjs +303 -344
  150. package/build/components/url-input/index.cjs.map +3 -3
  151. package/build/components/use-block-commands/index.cjs +21 -17
  152. package/build/components/use-block-commands/index.cjs.map +2 -2
  153. package/build/components/use-on-block-drop/index.cjs +1 -1
  154. package/build/components/use-on-block-drop/index.cjs.map +2 -2
  155. package/build/components/writing-flow/index.cjs +14 -1
  156. package/build/components/writing-flow/index.cjs.map +3 -3
  157. package/build/components/writing-flow/use-arrow-nav.cjs +42 -6
  158. package/build/components/writing-flow/use-arrow-nav.cjs.map +2 -2
  159. package/build/components/writing-flow/use-click-selection.cjs +29 -3
  160. package/build/components/writing-flow/use-click-selection.cjs.map +2 -2
  161. package/build/components/writing-flow/use-clipboard-handler.cjs +4 -1
  162. package/build/components/writing-flow/use-clipboard-handler.cjs.map +2 -2
  163. package/build/components/writing-flow/use-drag-selection.cjs +3 -8
  164. package/build/components/writing-flow/use-drag-selection.cjs.map +2 -2
  165. package/build/components/writing-flow/use-editable-root-event-handlers.cjs +179 -0
  166. package/build/components/writing-flow/use-editable-root-event-handlers.cjs.map +7 -0
  167. package/build/components/writing-flow/use-editable-root.cjs +75 -0
  168. package/build/components/writing-flow/use-editable-root.cjs.map +7 -0
  169. package/build/components/writing-flow/use-home-end.cjs +64 -0
  170. package/build/components/writing-flow/use-home-end.cjs.map +7 -0
  171. package/build/components/writing-flow/use-input.cjs +15 -5
  172. package/build/components/writing-flow/use-input.cjs.map +2 -2
  173. package/build/components/writing-flow/use-multi-selection.cjs +2 -2
  174. package/build/components/writing-flow/use-multi-selection.cjs.map +2 -2
  175. package/build/components/writing-flow/use-select-all.cjs +14 -2
  176. package/build/components/writing-flow/use-select-all.cjs.map +2 -2
  177. package/build/components/writing-flow/use-selection-observer.cjs +132 -22
  178. package/build/components/writing-flow/use-selection-observer.cjs.map +3 -3
  179. package/build/components/writing-flow/utils.cjs +28 -2
  180. package/build/components/writing-flow/utils.cjs.map +2 -2
  181. package/build/hooks/background.cjs +14 -10
  182. package/build/hooks/background.cjs.map +2 -2
  183. package/build/hooks/block-fields/rich-text/index.cjs +2 -3
  184. package/build/hooks/block-fields/rich-text/index.cjs.map +3 -3
  185. package/build/hooks/block-style-variation.cjs +4 -45
  186. package/build/hooks/block-style-variation.cjs.map +3 -3
  187. package/build/hooks/border.cjs +19 -4
  188. package/build/hooks/border.cjs.map +2 -2
  189. package/build/hooks/custom-css.cjs +6 -2
  190. package/build/hooks/custom-css.cjs.map +2 -2
  191. package/build/hooks/dimensions.cjs +15 -4
  192. package/build/hooks/dimensions.cjs.map +2 -2
  193. package/build/hooks/duotone.cjs +26 -14
  194. package/build/hooks/duotone.cjs.map +3 -3
  195. package/build/hooks/elements.cjs +15 -5
  196. package/build/hooks/elements.cjs.map +2 -2
  197. package/build/hooks/grid-visualizer.cjs +5 -3
  198. package/build/hooks/grid-visualizer.cjs.map +2 -2
  199. package/build/hooks/layout-child.cjs +22 -12
  200. package/build/hooks/layout-child.cjs.map +3 -3
  201. package/build/hooks/layout.cjs +28 -13
  202. package/build/hooks/layout.cjs.map +3 -3
  203. package/build/hooks/line-height.cjs +1 -2
  204. package/build/hooks/line-height.cjs.map +2 -2
  205. package/build/hooks/states.cjs +27 -7
  206. package/build/hooks/states.cjs.map +3 -3
  207. package/build/hooks/style.cjs +31 -9
  208. package/build/hooks/style.cjs.map +3 -3
  209. package/build/hooks/text-align.cjs +36 -6
  210. package/build/hooks/text-align.cjs.map +3 -3
  211. package/build/hooks/typography.cjs +14 -5
  212. package/build/hooks/typography.cjs.map +2 -2
  213. package/build/layouts/constrained.cjs +14 -6
  214. package/build/layouts/constrained.cjs.map +2 -2
  215. package/build/layouts/flex.cjs +27 -19
  216. package/build/layouts/flex.cjs.map +2 -2
  217. package/build/layouts/grid.cjs +0 -2
  218. package/build/layouts/grid.cjs.map +2 -2
  219. package/build/private-apis.cjs +9 -5
  220. package/build/private-apis.cjs.map +3 -3
  221. package/build/store/actions.cjs +11 -6
  222. package/build/store/actions.cjs.map +2 -2
  223. package/build/store/private-selectors.cjs +41 -3
  224. package/build/store/private-selectors.cjs.map +3 -3
  225. package/build/store/reducer.cjs +6 -6
  226. package/build/store/reducer.cjs.map +2 -2
  227. package/build/store/selectors.cjs +23 -0
  228. package/build/store/selectors.cjs.map +2 -2
  229. package/build/utils/block-bindings.cjs +29 -0
  230. package/build/utils/block-bindings.cjs.map +2 -2
  231. package/build/utils/dom.cjs +14 -0
  232. package/build/utils/dom.cjs.map +2 -2
  233. package/build/{components/rich-text/input-event.cjs → utils/native-undo.cjs} +29 -24
  234. package/build/utils/native-undo.cjs.map +7 -0
  235. package/build-module/components/alignment-control/ui.mjs +2 -4
  236. package/build-module/components/alignment-control/ui.mjs.map +2 -2
  237. package/build-module/components/background-image-control/index.mjs +43 -10
  238. package/build-module/components/background-image-control/index.mjs.map +2 -2
  239. package/build-module/components/block-alignment-control/ui.mjs +5 -3
  240. package/build-module/components/block-alignment-control/ui.mjs.map +2 -2
  241. package/build-module/components/block-canvas/index.mjs +7 -2
  242. package/build-module/components/block-canvas/index.mjs.map +2 -2
  243. package/build-module/components/block-controls/groups.mjs +3 -1
  244. package/build-module/components/block-controls/groups.mjs.map +2 -2
  245. package/build-module/components/block-edit/edit.mjs +11 -18
  246. package/build-module/components/block-edit/edit.mjs.map +2 -2
  247. package/build-module/components/block-inspector/index.mjs +74 -46
  248. package/build-module/components/block-inspector/index.mjs.map +2 -2
  249. package/build-module/components/block-list/block-html.mjs +4 -1
  250. package/build-module/components/block-list/block-html.mjs.map +2 -2
  251. package/build-module/components/block-list/block.mjs +9 -3
  252. package/build-module/components/block-list/block.mjs.map +3 -3
  253. package/build-module/components/block-list/index.mjs +1 -3
  254. package/build-module/components/block-list/index.mjs.map +2 -2
  255. package/build-module/components/block-list/use-block-props/index.mjs +7 -2
  256. package/build-module/components/block-list/use-block-props/index.mjs.map +2 -2
  257. package/build-module/components/block-list/use-block-props/use-focus-first-element.mjs +9 -4
  258. package/build-module/components/block-list/use-block-props/use-focus-first-element.mjs.map +2 -2
  259. package/build-module/components/block-list/use-block-props/use-focus-handler.mjs +11 -4
  260. package/build-module/components/block-list/use-block-props/use-focus-handler.mjs.map +2 -2
  261. package/build-module/components/block-list/use-block-props/use-register-block-event-handlers.mjs +28 -0
  262. package/build-module/components/block-list/use-block-props/use-register-block-event-handlers.mjs.map +7 -0
  263. package/build-module/components/block-parent-selector/index.mjs +2 -2
  264. package/build-module/components/block-parent-selector/index.mjs.map +2 -2
  265. package/build-module/components/block-toolbar/index.mjs +43 -24
  266. package/build-module/components/block-toolbar/index.mjs.map +2 -2
  267. package/build-module/components/block-toolbar/switch-section-style.mjs +4 -2
  268. package/build-module/components/block-toolbar/switch-section-style.mjs.map +2 -2
  269. package/build-module/components/block-tools/empty-block-inserter.mjs +2 -7
  270. package/build-module/components/block-tools/empty-block-inserter.mjs.map +2 -2
  271. package/build-module/components/block-tools/index.mjs +7 -2
  272. package/build-module/components/block-tools/index.mjs.map +2 -2
  273. package/build-module/components/block-vertical-alignment-control/ui.mjs +4 -6
  274. package/build-module/components/block-vertical-alignment-control/ui.mjs.map +2 -2
  275. package/build-module/components/block-visibility/modal.mjs +22 -10
  276. package/build-module/components/block-visibility/modal.mjs.map +2 -2
  277. package/build-module/components/block-visibility/use-block-visibility.mjs +17 -7
  278. package/build-module/components/block-visibility/use-block-visibility.mjs.map +2 -2
  279. package/build-module/components/block-visibility/utils.mjs +18 -3
  280. package/build-module/components/block-visibility/utils.mjs.map +2 -2
  281. package/build-module/components/block-visibility/viewport-menu-item.mjs +7 -1
  282. package/build-module/components/block-visibility/viewport-menu-item.mjs.map +2 -2
  283. package/build-module/components/block-visibility/viewport-toolbar.mjs +5 -0
  284. package/build-module/components/block-visibility/viewport-toolbar.mjs.map +2 -2
  285. package/build-module/components/block-visibility/viewport-visibility-info.mjs +5 -1
  286. package/build-module/components/block-visibility/viewport-visibility-info.mjs.map +2 -2
  287. package/build-module/components/border-radius-control/utils.mjs +11 -53
  288. package/build-module/components/border-radius-control/utils.mjs.map +2 -2
  289. package/build-module/components/child-layout-control/index.mjs +0 -4
  290. package/build-module/components/child-layout-control/index.mjs.map +2 -2
  291. package/build-module/components/colors-gradients/control.mjs +5 -3
  292. package/build-module/components/colors-gradients/control.mjs.map +2 -2
  293. package/build-module/components/dimension-control/index.mjs +30 -20
  294. package/build-module/components/dimension-control/index.mjs.map +2 -2
  295. package/build-module/components/dimensions-tool/aspect-ratio-tool.mjs +10 -6
  296. package/build-module/components/dimensions-tool/aspect-ratio-tool.mjs.map +2 -2
  297. package/build-module/components/editor-styles/index.mjs +9 -1
  298. package/build-module/components/editor-styles/index.mjs.map +2 -2
  299. package/build-module/components/global-styles/background-panel.mjs +71 -29
  300. package/build-module/components/global-styles/background-panel.mjs.map +2 -2
  301. package/build-module/components/global-styles/border-panel.mjs +157 -56
  302. package/build-module/components/global-styles/border-panel.mjs.map +2 -2
  303. package/build-module/components/global-styles/color-gradient-dropdown-item.mjs +51 -15
  304. package/build-module/components/global-styles/color-gradient-dropdown-item.mjs.map +2 -2
  305. package/build-module/components/global-styles/color-panel.mjs +63 -17
  306. package/build-module/components/global-styles/color-panel.mjs.map +2 -2
  307. package/build-module/components/global-styles/dimensions-panel.mjs +248 -66
  308. package/build-module/components/global-styles/dimensions-panel.mjs.map +2 -2
  309. package/build-module/components/global-styles/filters-panel.mjs +64 -21
  310. package/build-module/components/global-styles/filters-panel.mjs.map +2 -2
  311. package/build-module/components/global-styles/hooks.mjs +4 -1
  312. package/build-module/components/global-styles/hooks.mjs.map +2 -2
  313. package/build-module/components/global-styles/inheritance/index.mjs +108 -0
  314. package/build-module/components/global-styles/inheritance/index.mjs.map +7 -0
  315. package/build-module/components/global-styles/inherited-value-context.mjs +141 -0
  316. package/build-module/components/global-styles/inherited-value-context.mjs.map +7 -0
  317. package/build-module/components/global-styles/shadow-panel-components.mjs +38 -20
  318. package/build-module/components/global-styles/shadow-panel-components.mjs.map +2 -2
  319. package/build-module/components/global-styles/state-control-badges.mjs +41 -5
  320. package/build-module/components/global-styles/state-control-badges.mjs.map +2 -2
  321. package/build-module/components/global-styles/state-control.mjs +1 -1
  322. package/build-module/components/global-styles/state-control.mjs.map +2 -2
  323. package/build-module/components/global-styles/typography-panel.mjs +276 -80
  324. package/build-module/components/global-styles/typography-panel.mjs.map +2 -2
  325. package/build-module/components/image-size-control/index.mjs +2 -4
  326. package/build-module/components/image-size-control/index.mjs.map +2 -2
  327. package/build-module/components/inserter/media-tab/hooks.mjs +33 -6
  328. package/build-module/components/inserter/media-tab/hooks.mjs.map +2 -2
  329. package/build-module/components/inserter/media-tab/media-panel.mjs +86 -18
  330. package/build-module/components/inserter/media-tab/media-panel.mjs.map +2 -2
  331. package/build-module/components/inspector-controls-tabs/styles-tab.mjs +6 -1
  332. package/build-module/components/inspector-controls-tabs/styles-tab.mjs.map +2 -2
  333. package/build-module/components/keyboard-shortcuts/index.mjs +19 -11
  334. package/build-module/components/keyboard-shortcuts/index.mjs.map +2 -2
  335. package/build-module/components/line-height-control/index.mjs +1 -2
  336. package/build-module/components/line-height-control/index.mjs.map +2 -2
  337. package/build-module/components/link-control/index.mjs +4 -2
  338. package/build-module/components/link-control/index.mjs.map +2 -2
  339. package/build-module/components/list-view/block.mjs +13 -4
  340. package/build-module/components/list-view/block.mjs.map +2 -2
  341. package/build-module/components/media-placeholder/index.mjs +0 -1
  342. package/build-module/components/media-placeholder/index.mjs.map +2 -2
  343. package/build-module/components/preset-input-control/index.mjs +2 -1
  344. package/build-module/components/preset-input-control/index.mjs.map +2 -2
  345. package/build-module/components/provider/block-refs-provider.mjs +8 -2
  346. package/build-module/components/provider/block-refs-provider.mjs.map +2 -2
  347. package/build-module/components/provider/index.mjs +1 -1
  348. package/build-module/components/provider/index.mjs.map +2 -2
  349. package/build-module/components/provider/use-block-sync.mjs +18 -6
  350. package/build-module/components/provider/use-block-sync.mjs.map +2 -2
  351. package/build-module/components/provider/use-media-upload-settings.mjs +3 -1
  352. package/build-module/components/provider/use-media-upload-settings.mjs.map +2 -2
  353. package/build-module/components/rich-text/event-listeners/before-input-rules.mjs +8 -5
  354. package/build-module/components/rich-text/event-listeners/before-input-rules.mjs.map +2 -2
  355. package/build-module/components/rich-text/event-listeners/delete.mjs +7 -4
  356. package/build-module/components/rich-text/event-listeners/delete.mjs.map +2 -2
  357. package/build-module/components/rich-text/event-listeners/enter.mjs +8 -3
  358. package/build-module/components/rich-text/event-listeners/enter.mjs.map +2 -2
  359. package/build-module/components/rich-text/event-listeners/input-events.mjs +3 -3
  360. package/build-module/components/rich-text/event-listeners/input-events.mjs.map +2 -2
  361. package/build-module/components/rich-text/event-listeners/input-rules.mjs +8 -5
  362. package/build-module/components/rich-text/event-listeners/input-rules.mjs.map +2 -2
  363. package/build-module/components/rich-text/event-listeners/insert-replacement-text.mjs +3 -3
  364. package/build-module/components/rich-text/event-listeners/insert-replacement-text.mjs.map +2 -2
  365. package/build-module/components/rich-text/event-listeners/paste-handler.mjs +8 -2
  366. package/build-module/components/rich-text/event-listeners/paste-handler.mjs.map +2 -2
  367. package/build-module/components/rich-text/event-listeners/remove-browser-shortcuts.mjs +3 -3
  368. package/build-module/components/rich-text/event-listeners/remove-browser-shortcuts.mjs.map +2 -2
  369. package/build-module/components/rich-text/event-listeners/shortcuts.mjs +3 -3
  370. package/build-module/components/rich-text/event-listeners/shortcuts.mjs.map +2 -2
  371. package/build-module/components/rich-text/event-listeners/undo-automatic-change.mjs +3 -3
  372. package/build-module/components/rich-text/event-listeners/undo-automatic-change.mjs.map +2 -2
  373. package/build-module/components/rich-text/index.mjs +79 -14
  374. package/build-module/components/rich-text/index.mjs.map +2 -2
  375. package/build-module/components/spacing-sizes-control/utils.mjs +6 -18
  376. package/build-module/components/spacing-sizes-control/utils.mjs.map +2 -2
  377. package/build-module/components/text-indent-control/index.mjs +8 -2
  378. package/build-module/components/text-indent-control/index.mjs.map +2 -2
  379. package/build-module/components/typewriter/index.mjs +129 -136
  380. package/build-module/components/typewriter/index.mjs.map +2 -2
  381. package/build-module/components/url-input/index.mjs +306 -353
  382. package/build-module/components/url-input/index.mjs.map +2 -2
  383. package/build-module/components/use-block-commands/index.mjs +21 -17
  384. package/build-module/components/use-block-commands/index.mjs.map +2 -2
  385. package/build-module/components/use-on-block-drop/index.mjs +2 -2
  386. package/build-module/components/use-on-block-drop/index.mjs.map +2 -2
  387. package/build-module/components/writing-flow/index.mjs +14 -1
  388. package/build-module/components/writing-flow/index.mjs.map +2 -2
  389. package/build-module/components/writing-flow/use-arrow-nav.mjs +43 -7
  390. package/build-module/components/writing-flow/use-arrow-nav.mjs.map +2 -2
  391. package/build-module/components/writing-flow/use-click-selection.mjs +29 -3
  392. package/build-module/components/writing-flow/use-click-selection.mjs.map +2 -2
  393. package/build-module/components/writing-flow/use-clipboard-handler.mjs +5 -2
  394. package/build-module/components/writing-flow/use-clipboard-handler.mjs.map +2 -2
  395. package/build-module/components/writing-flow/use-drag-selection.mjs +1 -6
  396. package/build-module/components/writing-flow/use-drag-selection.mjs.map +2 -2
  397. package/build-module/components/writing-flow/use-editable-root-event-handlers.mjs +154 -0
  398. package/build-module/components/writing-flow/use-editable-root-event-handlers.mjs.map +7 -0
  399. package/build-module/components/writing-flow/use-editable-root.mjs +54 -0
  400. package/build-module/components/writing-flow/use-editable-root.mjs.map +7 -0
  401. package/build-module/components/writing-flow/use-home-end.mjs +43 -0
  402. package/build-module/components/writing-flow/use-home-end.mjs.map +7 -0
  403. package/build-module/components/writing-flow/use-input.mjs +15 -5
  404. package/build-module/components/writing-flow/use-input.mjs.map +2 -2
  405. package/build-module/components/writing-flow/use-multi-selection.mjs +2 -2
  406. package/build-module/components/writing-flow/use-multi-selection.mjs.map +2 -2
  407. package/build-module/components/writing-flow/use-select-all.mjs +19 -3
  408. package/build-module/components/writing-flow/use-select-all.mjs.map +2 -2
  409. package/build-module/components/writing-flow/use-selection-observer.mjs +134 -21
  410. package/build-module/components/writing-flow/use-selection-observer.mjs.map +2 -2
  411. package/build-module/components/writing-flow/utils.mjs +26 -1
  412. package/build-module/components/writing-flow/utils.mjs.map +2 -2
  413. package/build-module/hooks/background.mjs +14 -10
  414. package/build-module/hooks/background.mjs.map +2 -2
  415. package/build-module/hooks/block-fields/rich-text/index.mjs +2 -6
  416. package/build-module/hooks/block-fields/rich-text/index.mjs.map +2 -2
  417. package/build-module/hooks/block-style-variation.mjs +8 -44
  418. package/build-module/hooks/block-style-variation.mjs.map +2 -2
  419. package/build-module/hooks/border.mjs +19 -4
  420. package/build-module/hooks/border.mjs.map +2 -2
  421. package/build-module/hooks/custom-css.mjs +7 -3
  422. package/build-module/hooks/custom-css.mjs.map +2 -2
  423. package/build-module/hooks/dimensions.mjs +15 -4
  424. package/build-module/hooks/dimensions.mjs.map +2 -2
  425. package/build-module/hooks/duotone.mjs +20 -9
  426. package/build-module/hooks/duotone.mjs.map +2 -2
  427. package/build-module/hooks/elements.mjs +15 -5
  428. package/build-module/hooks/elements.mjs.map +2 -2
  429. package/build-module/hooks/grid-visualizer.mjs +5 -3
  430. package/build-module/hooks/grid-visualizer.mjs.map +2 -2
  431. package/build-module/hooks/layout-child.mjs +22 -12
  432. package/build-module/hooks/layout-child.mjs.map +2 -2
  433. package/build-module/hooks/layout.mjs +28 -13
  434. package/build-module/hooks/layout.mjs.map +2 -2
  435. package/build-module/hooks/line-height.mjs +1 -2
  436. package/build-module/hooks/line-height.mjs.map +2 -2
  437. package/build-module/hooks/states.mjs +27 -7
  438. package/build-module/hooks/states.mjs.map +2 -2
  439. package/build-module/hooks/style.mjs +40 -11
  440. package/build-module/hooks/style.mjs.map +2 -2
  441. package/build-module/hooks/text-align.mjs +39 -10
  442. package/build-module/hooks/text-align.mjs.map +2 -2
  443. package/build-module/hooks/typography.mjs +14 -5
  444. package/build-module/hooks/typography.mjs.map +2 -2
  445. package/build-module/layouts/constrained.mjs +14 -6
  446. package/build-module/layouts/constrained.mjs.map +2 -2
  447. package/build-module/layouts/flex.mjs +27 -19
  448. package/build-module/layouts/flex.mjs.map +2 -2
  449. package/build-module/layouts/grid.mjs +0 -2
  450. package/build-module/layouts/grid.mjs.map +2 -2
  451. package/build-module/private-apis.mjs +7 -3
  452. package/build-module/private-apis.mjs.map +2 -2
  453. package/build-module/store/actions.mjs +12 -7
  454. package/build-module/store/actions.mjs.map +2 -2
  455. package/build-module/store/private-selectors.mjs +42 -3
  456. package/build-module/store/private-selectors.mjs.map +2 -2
  457. package/build-module/store/reducer.mjs +6 -6
  458. package/build-module/store/reducer.mjs.map +2 -2
  459. package/build-module/store/selectors.mjs +23 -0
  460. package/build-module/store/selectors.mjs.map +2 -2
  461. package/build-module/utils/block-bindings.mjs +28 -0
  462. package/build-module/utils/block-bindings.mjs.map +2 -2
  463. package/build-module/utils/dom.mjs +13 -0
  464. package/build-module/utils/dom.mjs.map +2 -2
  465. package/build-module/utils/native-undo.mjs +29 -0
  466. package/build-module/utils/native-undo.mjs.map +7 -0
  467. package/build-style/content-rtl.css +14 -27
  468. package/build-style/content.css +14 -27
  469. package/build-style/default-editor-styles-rtl.css +1 -1
  470. package/build-style/default-editor-styles.css +1 -1
  471. package/build-style/style-rtl.css +191 -61
  472. package/build-style/style.css +191 -61
  473. package/build-types/components/block-context/index.d.ts +7 -0
  474. package/build-types/components/block-context/index.d.ts.map +1 -1
  475. package/build-types/utils/block-bindings.d.ts +19 -0
  476. package/build-types/utils/block-bindings.d.ts.map +1 -1
  477. package/build-types/utils/dom.d.ts +11 -0
  478. package/build-types/utils/dom.d.ts.map +1 -1
  479. package/build-types/utils/get-px-from-css-unit.d.ts +2 -2
  480. package/build-types/utils/get-px-from-css-unit.d.ts.map +1 -1
  481. package/build-types/utils/pasting.d.ts +1 -1
  482. package/build-types/utils/pasting.d.ts.map +1 -1
  483. package/package.json +43 -44
  484. package/src/components/alignment-control/test/__snapshots__/index.js.snap +1 -1
  485. package/src/components/alignment-control/ui.js +2 -4
  486. package/src/components/background-image-control/index.js +74 -37
  487. package/src/components/background-image-control/style.scss +13 -4
  488. package/src/components/block-alignment-control/test/__snapshots__/index.js.snap +3 -3
  489. package/src/components/block-alignment-control/test/index.js +1 -1
  490. package/src/components/block-alignment-control/ui.js +4 -2
  491. package/src/components/block-breadcrumb/test/__snapshots__/index.js.snap +1 -1
  492. package/src/components/block-canvas/index.js +9 -2
  493. package/src/components/block-card/style.scss +1 -1
  494. package/src/components/block-compare/test/__snapshots__/block-view.js.snap +1 -1
  495. package/src/components/block-controls/groups.js +2 -0
  496. package/src/components/block-edit/edit.js +13 -31
  497. package/src/components/block-icon/test/__snapshots__/index.js.snap +1 -1
  498. package/src/components/block-inspector/index.js +60 -31
  499. package/src/components/block-list/block-html.js +5 -0
  500. package/src/components/block-list/block.js +6 -0
  501. package/src/components/block-list/content.scss +1 -11
  502. package/src/components/block-list/index.js +0 -2
  503. package/src/components/block-list/use-block-props/index.js +7 -1
  504. package/src/components/block-list/use-block-props/use-focus-first-element.js +23 -4
  505. package/src/components/block-list/use-block-props/use-focus-handler.js +35 -9
  506. package/src/components/block-list/use-block-props/use-register-block-event-handlers.js +45 -0
  507. package/src/components/block-lock/style.scss +1 -1
  508. package/src/components/block-manager/style.scss +1 -1
  509. package/src/components/block-navigation/style.scss +1 -1
  510. package/src/components/block-parent-selector/index.js +5 -2
  511. package/src/components/block-quick-navigation/style.scss +1 -3
  512. package/src/components/block-styles/style.scss +2 -2
  513. package/src/components/block-toolbar/index.js +41 -18
  514. package/src/components/block-toolbar/switch-section-style.js +5 -2
  515. package/src/components/block-tools/empty-block-inserter.js +3 -7
  516. package/src/components/block-tools/index.js +7 -0
  517. package/src/components/block-types-list/style.scss +0 -1
  518. package/src/components/block-vertical-alignment-control/test/__snapshots__/index.js.snap +3 -3
  519. package/src/components/block-vertical-alignment-control/test/index.js +18 -2
  520. package/src/components/block-vertical-alignment-control/ui.js +3 -5
  521. package/src/components/block-visibility/modal.js +24 -10
  522. package/src/components/block-visibility/style.scss +1 -1
  523. package/src/components/block-visibility/test/use-block-visibility.js +128 -35
  524. package/src/components/block-visibility/test/utils.js +11 -0
  525. package/src/components/block-visibility/use-block-visibility.js +33 -11
  526. package/src/components/block-visibility/utils.js +31 -6
  527. package/src/components/block-visibility/viewport-menu-item.js +10 -1
  528. package/src/components/block-visibility/viewport-toolbar.js +6 -0
  529. package/src/components/block-visibility/viewport-visibility-info.js +5 -1
  530. package/src/components/border-radius-control/test/utils.js +0 -41
  531. package/src/components/border-radius-control/utils.js +16 -107
  532. package/src/components/button-block-appender/content.scss +7 -9
  533. package/src/components/child-layout-control/index.js +0 -4
  534. package/src/components/color-palette/test/__snapshots__/control.js.snap +3 -3
  535. package/src/components/colors-gradients/control.js +6 -3
  536. package/src/components/default-block-appender/test/__snapshots__/index.js.snap +1 -1
  537. package/src/components/dimension-control/index.js +13 -1
  538. package/src/components/dimensions-tool/aspect-ratio-tool.js +13 -6
  539. package/src/components/editor-styles/index.js +16 -1
  540. package/src/components/font-family/stories/index.story.jsx +1 -1
  541. package/src/components/global-styles/background-panel.js +107 -34
  542. package/src/components/global-styles/border-panel.js +219 -48
  543. package/src/components/global-styles/color-gradient-dropdown-item.js +93 -28
  544. package/src/components/global-styles/color-panel.js +92 -11
  545. package/src/components/global-styles/dimensions-panel.js +422 -71
  546. package/src/components/global-styles/filters-panel.js +88 -28
  547. package/src/components/global-styles/hooks.js +8 -1
  548. package/src/components/global-styles/inheritance/index.js +204 -0
  549. package/src/components/global-styles/inheritance/style.scss +184 -0
  550. package/src/components/global-styles/inheritance/test/index.js +281 -0
  551. package/src/components/global-styles/inherited-value-context.js +271 -0
  552. package/src/components/global-styles/shadow-panel-components.js +48 -26
  553. package/src/components/global-styles/state-control-badges.js +45 -6
  554. package/src/components/global-styles/state-control.js +2 -2
  555. package/src/components/global-styles/style.scss +5 -0
  556. package/src/components/global-styles/test/background-panel.js +338 -1
  557. package/src/components/global-styles/test/border-panel.js +441 -0
  558. package/src/components/global-styles/test/color-panel.js +182 -2
  559. package/src/components/global-styles/test/dimensions-panel.js +753 -0
  560. package/src/components/global-styles/test/filters-panel.js +194 -0
  561. package/src/components/global-styles/test/inherited-value-context-core.js +98 -0
  562. package/src/components/global-styles/test/inherited-value-context.js +454 -0
  563. package/src/components/global-styles/test/state-control-badges.js +65 -0
  564. package/src/components/global-styles/test/typography-panel-core.js +185 -0
  565. package/src/components/global-styles/test/typography-panel.js +849 -12
  566. package/src/components/global-styles/typography-panel.js +449 -101
  567. package/src/components/image-editor/style.scss +33 -0
  568. package/src/components/image-size-control/index.js +0 -2
  569. package/src/components/inner-blocks/test/__snapshots__/index.js.snap +1 -1
  570. package/src/components/inserter/media-tab/hooks.js +55 -7
  571. package/src/components/inserter/media-tab/media-panel.js +117 -21
  572. package/src/components/inserter/media-tab/test/hooks.js +63 -0
  573. package/src/components/inserter/media-tab/test/media-panel.js +127 -0
  574. package/src/components/inserter/style.scss +19 -16
  575. package/src/components/inserter-list-item/style.scss +0 -15
  576. package/src/components/inspector-controls-tabs/styles-tab.js +5 -1
  577. package/src/components/keyboard-shortcuts/index.js +28 -11
  578. package/src/components/line-height-control/index.js +1 -2
  579. package/src/components/link-control/index.js +7 -2
  580. package/src/components/link-control/style.scss +2 -2
  581. package/src/components/link-control/test/index.js +6 -6
  582. package/src/components/link-picker/style.scss +1 -2
  583. package/src/components/list-view/block.js +13 -4
  584. package/src/components/list-view/style.scss +4 -5
  585. package/src/components/media-placeholder/index.js +0 -1
  586. package/src/components/multi-selection-inspector/style.scss +1 -1
  587. package/src/components/preset-input-control/index.js +4 -1
  588. package/src/components/provider/block-refs-provider.js +12 -2
  589. package/src/components/provider/index.js +2 -2
  590. package/src/components/provider/use-block-sync.js +18 -6
  591. package/src/components/provider/use-media-upload-settings.js +2 -0
  592. package/src/components/responsive-block-control/style.scss +1 -1
  593. package/src/components/rich-text/event-listeners/before-input-rules.js +8 -5
  594. package/src/components/rich-text/event-listeners/delete.js +7 -4
  595. package/src/components/rich-text/event-listeners/enter.js +10 -4
  596. package/src/components/rich-text/event-listeners/input-events.js +4 -3
  597. package/src/components/rich-text/event-listeners/input-rules.js +8 -5
  598. package/src/components/rich-text/event-listeners/insert-replacement-text.js +4 -3
  599. package/src/components/rich-text/event-listeners/paste-handler.js +15 -3
  600. package/src/components/rich-text/event-listeners/remove-browser-shortcuts.js +4 -3
  601. package/src/components/rich-text/event-listeners/shortcuts.js +4 -3
  602. package/src/components/rich-text/event-listeners/undo-automatic-change.js +4 -3
  603. package/src/components/rich-text/index.js +116 -26
  604. package/src/components/skip-to-selected-block/style.scss +1 -1
  605. package/src/components/spacing-sizes-control/test/utils.js +16 -5
  606. package/src/components/spacing-sizes-control/utils.js +11 -28
  607. package/src/components/text-indent-control/index.js +8 -0
  608. package/src/components/typewriter/index.js +228 -224
  609. package/src/components/url-input/index.js +363 -431
  610. package/src/components/url-input/test/index.js +592 -0
  611. package/src/components/use-block-commands/index.js +27 -17
  612. package/src/components/use-on-block-drop/index.js +2 -2
  613. package/src/components/warning/test/__snapshots__/index.js.snap +1 -1
  614. package/src/components/writing-flow/index.js +17 -1
  615. package/src/components/writing-flow/use-arrow-nav.js +90 -13
  616. package/src/components/writing-flow/use-click-selection.js +55 -5
  617. package/src/components/writing-flow/use-clipboard-handler.js +5 -2
  618. package/src/components/writing-flow/use-drag-selection.js +1 -14
  619. package/src/components/writing-flow/use-editable-root-event-handlers.js +266 -0
  620. package/src/components/writing-flow/use-editable-root.js +112 -0
  621. package/src/components/writing-flow/use-home-end.js +71 -0
  622. package/src/components/writing-flow/use-input.js +25 -8
  623. package/src/components/writing-flow/use-multi-selection.js +2 -3
  624. package/src/components/writing-flow/use-select-all.js +33 -3
  625. package/src/components/writing-flow/use-selection-observer.js +218 -42
  626. package/src/components/writing-flow/utils.js +62 -0
  627. package/src/hooks/background.js +27 -24
  628. package/src/hooks/block-fields/link/styles.scss +1 -6
  629. package/src/hooks/block-fields/media/styles.scss +1 -6
  630. package/src/hooks/block-fields/rich-text/index.js +6 -9
  631. package/src/hooks/block-fields/rich-text/styles.scss +1 -1
  632. package/src/hooks/block-style-variation.js +8 -74
  633. package/src/hooks/border.js +19 -4
  634. package/src/hooks/custom-css.js +15 -6
  635. package/src/hooks/dimensions.js +17 -4
  636. package/src/hooks/duotone.js +26 -8
  637. package/src/hooks/elements.js +14 -4
  638. package/src/hooks/grid-visualizer.js +40 -36
  639. package/src/hooks/layout-child.js +19 -9
  640. package/src/hooks/layout.js +48 -31
  641. package/src/hooks/line-height.js +0 -1
  642. package/src/hooks/states.js +38 -9
  643. package/src/hooks/style.js +67 -17
  644. package/src/hooks/test/inherited-value-wiring.js +411 -0
  645. package/src/hooks/test/preset-round-trip.js +456 -0
  646. package/src/hooks/test/style.js +29 -0
  647. package/src/hooks/test/text-align.js +34 -1
  648. package/src/hooks/text-align.js +41 -10
  649. package/src/hooks/typography.js +35 -24
  650. package/src/layouts/constrained.js +5 -1
  651. package/src/layouts/flex.js +5 -1
  652. package/src/layouts/grid.js +0 -2
  653. package/src/private-apis.js +11 -2
  654. package/src/store/actions.js +53 -19
  655. package/src/store/private-selectors.js +82 -6
  656. package/src/store/reducer.js +9 -9
  657. package/src/store/selectors.js +56 -8
  658. package/src/store/test/actions.js +1 -1
  659. package/src/store/test/private-selectors.js +271 -1
  660. package/src/style.scss +2 -0
  661. package/src/utils/block-bindings.ts +50 -0
  662. package/src/utils/dom.ts +33 -0
  663. package/src/utils/native-undo.js +56 -0
  664. package/src/utils/test/block-bindings.js +181 -0
  665. package/build/components/duotone/utils.cjs +0 -87
  666. package/build/components/duotone/utils.cjs.map +0 -7
  667. package/build/components/rich-text/input-event.cjs.map +0 -7
  668. package/build/components/rich-text/shortcut.cjs +0 -51
  669. package/build/components/rich-text/shortcut.cjs.map +0 -7
  670. package/build-module/components/duotone/utils.mjs +0 -59
  671. package/build-module/components/duotone/utils.mjs.map +0 -7
  672. package/build-module/components/rich-text/input-event.mjs +0 -25
  673. package/build-module/components/rich-text/input-event.mjs.map +0 -7
  674. package/build-module/components/rich-text/shortcut.mjs +0 -26
  675. package/build-module/components/rich-text/shortcut.mjs.map +0 -7
  676. package/src/components/duotone/utils.js +0 -90
  677. package/src/components/rich-text/input-event.js +0 -31
  678. package/src/components/rich-text/shortcut.js +0 -32
  679. package/src/hooks/test/get-variation-styles-with-ref-values.js +0 -91
@@ -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 } 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": ";;;;;;;;;;;;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AAAA,YACD,CAAE;AAAA,UACH;AAAA,QACD;AAAA,MACD,CAAE;AAAA,IACH;AAAA,EACD,CAAE;AAEF,SAAO,MAAM,SAAS,IAAI,MAAM,KAAM,EAAG,IAAI;AAC9C;AAEA,SAAS,cAAe,EAAE,MAAM,MAAM,GAAI;AACzC,QAAM,uCAAmC;AAAA,IACxC;AAAA,IACA;AAAA,EACD;AAEA,QAAM,sBAAsB,IAAK,gCAAiC;AAClE,QAAM,qBAAqB,OAAO;AAElC,QAAM,aAAS,wBAAS,MAAM;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,qCAAkB,EAAE,KAAK,OAAO,CAAE;AAElC,SAAO;AAAA,IACN,EAAE,WAAW,iCAAiC;AAAA,IAC9C;AAAA,IACA,EAAE,MAAM;AAAA,IACR;AAAA,EACD;AACD;AAAA,IAEA;AAAA,EACC;AAAA,EACA;AAAA,EACA;AACD;",
6
- "names": ["import_utils", "blockEditorStore", "ELEMENTS"]
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { addFilter } from '@wordpress/hooks';\nimport { useSelect } from '@wordpress/data';\nimport {\n\tmergeGlobalStyles,\n\tprivateApis as globalStylesEnginePrivateApis,\n} 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 {\n\tgetCSSRules,\n\tcompileCSS,\n\tgetCSSValueFromRawStyle,\n} 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 { useSettings } from '../components/use-settings';\nimport { store as blockEditorStore } from '../store';\nimport { globalStylesDataKey } from '../store/private-keys';\nimport { unlock } from '../lock-unlock';\n\nconst { getResponsiveMediaQueries } = unlock( globalStylesEnginePrivateApis );\n\nconst BORDER_SIDES = [ 'Top', 'Right', 'Bottom', 'Left' ];\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 * Returns CSS for text alignment in a block instance state style object.\n *\n * Text alignment is not generated by the style engine because base block\n * alignment is serialized as a class name. State styles need a declaration\n * instead so viewport and pseudo-state values can override the default class.\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 the text alignment declaration.\n */\nfunction getStateTextAlignCSS( stateStyles, selector ) {\n\tconst textAlign = stateStyles?.typography?.textAlign;\n\n\tif ( typeof textAlign !== 'string' || ! textAlign ) {\n\t\treturn undefined;\n\t}\n\n\tconst declaration = `text-align: ${ getCSSValueFromRawStyle(\n\t\ttextAlign\n\t) } !important`;\n\treturn selector\n\t\t? `${ selector } { ${ declaration }; }`\n\t\t: `${ declaration };`;\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 textAlignCSS = getStateTextAlignCSS( stateStyles, selector );\n\tconst backgroundResetCSS = getStateBackgroundResetCSS(\n\t\tstateStyles,\n\t\tselector\n\t);\n\n\treturn [ importantCSS, textAlignCSS, 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 * @param {Object} viewportSettings Viewport breakpoint settings.\n * @return {string[]} Generated CSS rule strings.\n */\nexport function getResponsiveStateCSSRules(\n\tstyle,\n\tname,\n\tbaseSelector,\n\tviewportSettings\n) {\n\tconst cssRules = [];\n\tconst validPseudoStates = VALID_BLOCK_PSEUDO_STATES[ name ] ?? [];\n\tconst nestedStateKeys = [ 'elements', ...validPseudoStates ];\n\tconst responsiveMediaQueries =\n\t\tgetResponsiveMediaQueries( viewportSettings );\n\n\tObject.entries( responsiveMediaQueries ).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\tconst [ viewportSettings ] = useSettings( 'viewport' );\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(\n\t\t\t\tstyle,\n\t\t\t\tname,\n\t\t\t\tbaseElementSelector,\n\t\t\t\tviewportSettings\n\t\t\t)\n\t\t);\n\n\t\treturn cssRules.length > 0 ? cssRules.join( '' ) : undefined;\n\t}, [\n\t\tbaseElementSelector,\n\t\tblockElementStyles,\n\t\tname,\n\t\tstyle,\n\t\tviewportSettings,\n\t] );\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": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,qBAAwB;AACxB,mBAA0B;AAC1B,kBAA0B;AAC1B,kCAGO;AACP,oBAKO;AACP,qBAA8B;AAC9B,0BAIO;AAKP,wBAA6D;AAC7D,oBAAoE;AACpE,mBAAkC;AAClC,sBAA6B;AAC7B,wBAIO;AACP,wBAKO;AACP,mBAKO;AACP,+BAMO;AACP,oBAA0C;AAC1C,yBAAyC;AACzC,IAAAA,gBAA8B;AAC9B,gCAAoC;AACp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;AAAA,QACD;AAAA,MACD,CAAE;AAAA,IACH;AAAA,EACD,CAAE;AAEF,SAAO,MAAM,SAAS,IAAI,MAAM,KAAM,EAAG,IAAI;AAC9C;AAEA,SAAS,cAAe,EAAE,MAAM,MAAM,GAAI;AACzC,QAAM,uCAAmC;AAAA,IACxC;AAAA,IACA;AAAA,EACD;AAEA,QAAM,sBAAsB,IAAK,gCAAiC;AAClE,QAAM,qBAAqB,OAAO;AAClC,QAAM,CAAE,gBAAiB,QAAI,iCAAa,UAAW;AAErD,QAAM,aAAS,wBAAS,MAAM;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;AAAA,QACF;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACD;AAAA,IACD;AAEA,WAAO,SAAS,SAAS,IAAI,SAAS,KAAM,EAAG,IAAI;AAAA,EACpD,GAAG;AAAA,IACF;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,CAAE;AAEF,qCAAkB,EAAE,KAAK,OAAO,CAAE;AAElC,SAAO;AAAA,IACN,EAAE,WAAW,iCAAiC;AAAA,IAC9C;AAAA,IACA,EAAE,MAAM;AAAA,IACR;AAAA,EACD;AACD;AAAA,IAEA;AAAA,EACC;AAAA,EACA;AAAA,EACA;AACD;",
6
+ "names": ["import_utils", "globalStylesEnginePrivateApis", "blockEditorStore", "ELEMENTS"]
7
7
  }
@@ -33,6 +33,7 @@ __export(text_align_exports, {
33
33
  TEXT_ALIGN_SUPPORT_KEY: () => TEXT_ALIGN_SUPPORT_KEY,
34
34
  addAssignedTextAlign: () => addAssignedTextAlign,
35
35
  default: () => text_align_default,
36
+ getTextAlignControlGroup: () => getTextAlignControlGroup,
36
37
  getValidTextAlignments: () => getValidTextAlignments
37
38
  });
38
39
  module.exports = __toCommonJS(text_align_exports);
@@ -40,10 +41,14 @@ var import_clsx = __toESM(require("clsx"));
40
41
  var import_i18n = require("@wordpress/i18n");
41
42
  var import_blocks = require("@wordpress/blocks");
42
43
  var import_icons = require("@wordpress/icons");
44
+ var import_data = require("@wordpress/data");
43
45
  var import_components = require("../components/index.cjs");
44
46
  var import_block_editing_mode = require("../components/block-editing-mode/index.cjs");
47
+ var import_block_style_state = require("./block-style-state.cjs");
45
48
  var import_utils = require("./utils.cjs");
46
49
  var import_typography = require("./typography.cjs");
50
+ var import_store = require("../store/index.cjs");
51
+ var import_lock_unlock = require("../lock-unlock.cjs");
47
52
  var import_jsx_runtime = require("react/jsx-runtime");
48
53
  var TEXT_ALIGN_SUPPORT_KEY = "typography.textAlign";
49
54
  var TEXT_ALIGNMENT_OPTIONS = [
@@ -73,7 +78,11 @@ function getValidTextAlignments(blockTextAlign) {
73
78
  }
74
79
  return blockTextAlign === true ? VALID_TEXT_ALIGNMENTS : NO_TEXT_ALIGNMENTS;
75
80
  }
81
+ function getTextAlignControlGroup(isResponsiveEditing, selectedState) {
82
+ return isResponsiveEditing && (0, import_block_style_state.hasViewportBlockStyleState)(selectedState) ? "style-state" : "block";
83
+ }
76
84
  function BlockEditTextAlignmentToolbarControlsPure({
85
+ clientId,
77
86
  style,
78
87
  name: blockName,
79
88
  setAttributes
@@ -81,6 +90,19 @@ function BlockEditTextAlignmentToolbarControlsPure({
81
90
  const settings = (0, import_utils.useBlockSettings)(blockName);
82
91
  const hasTextAlignControl = settings?.typography?.textAlign;
83
92
  const blockEditingMode = (0, import_block_editing_mode.useBlockEditingMode)();
93
+ const { selectedState, isResponsiveEditing } = (0, import_data.useSelect)(
94
+ (select) => {
95
+ const {
96
+ getSelectedBlockStyleState,
97
+ isResponsiveEditing: getIsResponsiveEditing
98
+ } = (0, import_lock_unlock.unlock)(select(import_store.store));
99
+ return {
100
+ selectedState: getSelectedBlockStyleState(clientId),
101
+ isResponsiveEditing: getIsResponsiveEditing()
102
+ };
103
+ },
104
+ [clientId]
105
+ );
84
106
  if (!hasTextAlignControl || blockEditingMode !== "default") {
85
107
  return null;
86
108
  }
@@ -93,20 +115,27 @@ function BlockEditTextAlignmentToolbarControlsPure({
93
115
  const textAlignmentControls = TEXT_ALIGNMENT_OPTIONS.filter(
94
116
  (control) => validTextAlignments.includes(control.align)
95
117
  );
118
+ const stateStyle = (0, import_block_style_state.getStyleForState)(style, selectedState);
119
+ const controlsGroup = getTextAlignControlGroup(
120
+ isResponsiveEditing,
121
+ selectedState
122
+ );
96
123
  const onChange = (newTextAlignValue) => {
97
- const newStyle = {
98
- ...style,
124
+ const newStateStyle = {
125
+ ...stateStyle,
99
126
  typography: {
100
- ...style?.typography,
127
+ ...stateStyle?.typography,
101
128
  textAlign: newTextAlignValue
102
129
  }
103
130
  };
104
- setAttributes({ style: (0, import_utils.cleanEmptyObject)(newStyle) });
131
+ setAttributes({
132
+ style: (0, import_block_style_state.setStyleForState)(style, selectedState, newStateStyle)
133
+ });
105
134
  };
106
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.BlockControls, { group: "block", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
135
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.BlockControls, { group: controlsGroup, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
107
136
  import_components.AlignmentControl,
108
137
  {
109
- value: style?.typography?.textAlign,
138
+ value: stateStyle?.typography?.textAlign,
110
139
  onChange,
111
140
  alignmentControls: textAlignmentControls
112
141
  }
@@ -163,6 +192,7 @@ function addAssignedTextAlign(props, blockType, attributes) {
163
192
  0 && (module.exports = {
164
193
  TEXT_ALIGN_SUPPORT_KEY,
165
194
  addAssignedTextAlign,
195
+ getTextAlignControlGroup,
166
196
  getValidTextAlignments
167
197
  });
168
198
  //# sourceMappingURL=text-align.cjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/hooks/text-align.js"],
4
- "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { getBlockSupport, hasBlockSupport } from '@wordpress/blocks';\nimport { alignLeft, alignRight, alignCenter } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { AlignmentControl, BlockControls } from '../components';\nimport { useBlockEditingMode } from '../components/block-editing-mode';\nimport {\n\tcleanEmptyObject,\n\tshouldSkipSerialization,\n\tuseBlockSettings,\n} from './utils';\nimport { TYPOGRAPHY_SUPPORT_KEY } from './typography';\n\nexport const TEXT_ALIGN_SUPPORT_KEY = 'typography.textAlign';\n\nconst TEXT_ALIGNMENT_OPTIONS = [\n\t{\n\t\ticon: alignLeft,\n\t\ttitle: __( 'Align text left' ),\n\t\talign: 'left',\n\t},\n\t{\n\t\ticon: alignCenter,\n\t\ttitle: __( 'Align text center' ),\n\t\talign: 'center',\n\t},\n\t{\n\t\ticon: alignRight,\n\t\ttitle: __( 'Align text right' ),\n\t\talign: 'right',\n\t},\n];\n\nconst VALID_TEXT_ALIGNMENTS = [ 'left', 'center', 'right' ];\nconst NO_TEXT_ALIGNMENTS = [];\n\n/**\n * Returns the valid text alignments.\n * Takes into consideration the text aligns supported by a block.\n * Exported just for testing purposes, not exported outside the module.\n *\n * @param {?boolean|string[]} blockTextAlign Text aligns supported by the block.\n *\n * @return {string[]} Valid text alignments.\n */\nexport function getValidTextAlignments( blockTextAlign ) {\n\tif ( Array.isArray( blockTextAlign ) ) {\n\t\treturn VALID_TEXT_ALIGNMENTS.filter( ( textAlign ) =>\n\t\t\tblockTextAlign.includes( textAlign )\n\t\t);\n\t}\n\n\treturn blockTextAlign === true ? VALID_TEXT_ALIGNMENTS : NO_TEXT_ALIGNMENTS;\n}\n\nfunction BlockEditTextAlignmentToolbarControlsPure( {\n\tstyle,\n\tname: blockName,\n\tsetAttributes,\n} ) {\n\tconst settings = useBlockSettings( blockName );\n\tconst hasTextAlignControl = settings?.typography?.textAlign;\n\tconst blockEditingMode = useBlockEditingMode();\n\n\tif ( ! hasTextAlignControl || blockEditingMode !== 'default' ) {\n\t\treturn null;\n\t}\n\n\tconst validTextAlignments = getValidTextAlignments(\n\t\tgetBlockSupport( blockName, TEXT_ALIGN_SUPPORT_KEY )\n\t);\n\tif ( ! validTextAlignments.length ) {\n\t\treturn null;\n\t}\n\n\tconst textAlignmentControls = TEXT_ALIGNMENT_OPTIONS.filter( ( control ) =>\n\t\tvalidTextAlignments.includes( control.align )\n\t);\n\n\tconst onChange = ( newTextAlignValue ) => {\n\t\tconst newStyle = {\n\t\t\t...style,\n\t\t\ttypography: {\n\t\t\t\t...style?.typography,\n\t\t\t\ttextAlign: newTextAlignValue,\n\t\t\t},\n\t\t};\n\n\t\tsetAttributes( { style: cleanEmptyObject( newStyle ) } );\n\t};\n\n\treturn (\n\t\t<BlockControls group=\"block\">\n\t\t\t<AlignmentControl\n\t\t\t\tvalue={ style?.typography?.textAlign }\n\t\t\t\tonChange={ onChange }\n\t\t\t\talignmentControls={ textAlignmentControls }\n\t\t\t/>\n\t\t</BlockControls>\n\t);\n}\n\nexport default {\n\tedit: BlockEditTextAlignmentToolbarControlsPure,\n\tuseBlockProps,\n\taddSaveProps: addAssignedTextAlign,\n\tattributeKeys: [ 'style' ],\n\thasSupport( name ) {\n\t\treturn hasBlockSupport( name, TEXT_ALIGN_SUPPORT_KEY, false );\n\t},\n};\n\nfunction useBlockProps( { name, style } ) {\n\tif ( ! style?.typography?.textAlign ) {\n\t\treturn null;\n\t}\n\n\tconst validTextAlignments = getValidTextAlignments(\n\t\tgetBlockSupport( name, TEXT_ALIGN_SUPPORT_KEY )\n\t);\n\n\tif ( ! validTextAlignments.length ) {\n\t\treturn null;\n\t}\n\n\tif (\n\t\tshouldSkipSerialization( name, TYPOGRAPHY_SUPPORT_KEY, 'textAlign' )\n\t) {\n\t\treturn null;\n\t}\n\n\tconst textAlign = style.typography.textAlign;\n\n\tconst className = clsx( {\n\t\t[ `has-text-align-${ textAlign }` ]: textAlign,\n\t} );\n\treturn { className };\n}\n\n/**\n * Override props assigned to save component to inject text alignment class\n * name if block supports it.\n *\n * @param {Object} props Additional props applied to save element.\n * @param {Object} blockType Block type.\n * @param {Object} attributes Block attributes.\n *\n * @return {Object} Filtered props applied to save element.\n */\nexport function addAssignedTextAlign( props, blockType, attributes ) {\n\tif ( ! attributes?.style?.typography?.textAlign ) {\n\t\treturn props;\n\t}\n\n\tconst { textAlign } = attributes.style.typography;\n\tconst blockTextAlign = getBlockSupport( blockType, TEXT_ALIGN_SUPPORT_KEY );\n\tconst isTextAlignValid =\n\t\tgetValidTextAlignments( blockTextAlign ).includes( textAlign );\n\tif (\n\t\tisTextAlignValid &&\n\t\t! shouldSkipSerialization(\n\t\t\tblockType,\n\t\t\tTYPOGRAPHY_SUPPORT_KEY,\n\t\t\t'textAlign'\n\t\t)\n\t) {\n\t\tprops.className = clsx(\n\t\t\t`has-text-align-${ textAlign }`,\n\t\t\tprops.className\n\t\t);\n\t}\n\treturn props;\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAiB;AAKjB,kBAAmB;AACnB,oBAAiD;AACjD,mBAAmD;AAKnD,wBAAgD;AAChD,gCAAoC;AACpC,mBAIO;AACP,wBAAuC;AAkFpC;AAhFI,IAAM,yBAAyB;AAEtC,IAAM,yBAAyB;AAAA,EAC9B;AAAA,IACC,MAAM;AAAA,IACN,WAAO,gBAAI,iBAAkB;AAAA,IAC7B,OAAO;AAAA,EACR;AAAA,EACA;AAAA,IACC,MAAM;AAAA,IACN,WAAO,gBAAI,mBAAoB;AAAA,IAC/B,OAAO;AAAA,EACR;AAAA,EACA;AAAA,IACC,MAAM;AAAA,IACN,WAAO,gBAAI,kBAAm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O;AAClB,eAAO,+BAAiB,MAAM,wBAAwB,KAAM;AAAA,EAC7D;AACD;AAEA,SAAS,cAAe,EAAE,MAAM,MAAM,GAAI;AACzC,MAAK,CAAE,OAAO,YAAY,WAAY;AACrC,WAAO;AAAA,EACR;AAEA,QAAM,sBAAsB;AAAA,QAC3B,+BAAiB,MAAM,sBAAuB;AAAA,EAC/C;AAEA,MAAK,CAAE,oBAAoB,QAAS;AACnC,WAAO;AAAA,EACR;AAEA,UACC,sCAAyB,MAAM,0CAAwB,WAAY,GAClE;AACD,WAAO;AAAA,EACR;AAEA,QAAM,YAAY,MAAM,WAAW;AAEnC,QAAM,gBAAY,YAAAA,SAAM;AAAA,IACvB,CAAE,kBAAmB,SAAU,EAAG,GAAG;AAAA,EACtC,CAAE;AACF,SAAO,EAAE,UAAU;AACpB;AAYO,SAAS,qBAAsB,OAAO,WAAW,YAAa;AACpE,MAAK,CAAE,YAAY,OAAO,YAAY,WAAY;AACjD,WAAO;AAAA,EACR;AAEA,QAAM,EAAE,UAAU,IAAI,WAAW,MAAM;AACvC,QAAM,qBAAiB,+BAAiB,WAAW,sBAAuB;AAC1E,QAAM,mBACL,uBAAwB,cAAe,EAAE,SAAU,SAAU;AAC9D,MACC,oBACA,KAAE;AAAA,IACD;AAAA,IACA;AAAA,IACA;AAAA,EACD,GACC;AACD,UAAM,gBAAY,YAAAA;AAAA,MACjB,kBAAmB,SAAU;AAAA,MAC7B,MAAM;AAAA,IACP;AAAA,EACD;AACA,SAAO;AACR;",
6
- "names": ["clsx"]
4
+ "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { getBlockSupport, hasBlockSupport } from '@wordpress/blocks';\nimport { alignLeft, alignRight, alignCenter } from '@wordpress/icons';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { AlignmentControl, BlockControls } from '../components';\nimport { useBlockEditingMode } from '../components/block-editing-mode';\nimport {\n\tgetStyleForState,\n\thasViewportBlockStyleState,\n\tsetStyleForState,\n} from './block-style-state';\nimport { shouldSkipSerialization, useBlockSettings } from './utils';\nimport { TYPOGRAPHY_SUPPORT_KEY } from './typography';\nimport { store as blockEditorStore } from '../store';\nimport { unlock } from '../lock-unlock';\n\nexport const TEXT_ALIGN_SUPPORT_KEY = 'typography.textAlign';\n\nconst TEXT_ALIGNMENT_OPTIONS = [\n\t{\n\t\ticon: alignLeft,\n\t\ttitle: __( 'Align text left' ),\n\t\talign: 'left',\n\t},\n\t{\n\t\ticon: alignCenter,\n\t\ttitle: __( 'Align text center' ),\n\t\talign: 'center',\n\t},\n\t{\n\t\ticon: alignRight,\n\t\ttitle: __( 'Align text right' ),\n\t\talign: 'right',\n\t},\n];\n\nconst VALID_TEXT_ALIGNMENTS = [ 'left', 'center', 'right' ];\nconst NO_TEXT_ALIGNMENTS = [];\n\n/**\n * Returns the valid text alignments.\n * Takes into consideration the text aligns supported by a block.\n * Exported just for testing purposes, not exported outside the module.\n *\n * @param {?boolean|string[]} blockTextAlign Text aligns supported by the block.\n *\n * @return {string[]} Valid text alignments.\n */\nexport function getValidTextAlignments( blockTextAlign ) {\n\tif ( Array.isArray( blockTextAlign ) ) {\n\t\treturn VALID_TEXT_ALIGNMENTS.filter( ( textAlign ) =>\n\t\t\tblockTextAlign.includes( textAlign )\n\t\t);\n\t}\n\n\treturn blockTextAlign === true ? VALID_TEXT_ALIGNMENTS : NO_TEXT_ALIGNMENTS;\n}\n\nexport function getTextAlignControlGroup( isResponsiveEditing, selectedState ) {\n\treturn isResponsiveEditing && hasViewportBlockStyleState( selectedState )\n\t\t? 'style-state'\n\t\t: 'block';\n}\n\nfunction BlockEditTextAlignmentToolbarControlsPure( {\n\tclientId,\n\tstyle,\n\tname: blockName,\n\tsetAttributes,\n} ) {\n\tconst settings = useBlockSettings( blockName );\n\tconst hasTextAlignControl = settings?.typography?.textAlign;\n\tconst blockEditingMode = useBlockEditingMode();\n\tconst { selectedState, isResponsiveEditing } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetSelectedBlockStyleState,\n\t\t\t\tisResponsiveEditing: getIsResponsiveEditing,\n\t\t\t} = unlock( select( blockEditorStore ) );\n\t\t\treturn {\n\t\t\t\tselectedState: getSelectedBlockStyleState( clientId ),\n\t\t\t\tisResponsiveEditing: getIsResponsiveEditing(),\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tif ( ! hasTextAlignControl || blockEditingMode !== 'default' ) {\n\t\treturn null;\n\t}\n\n\tconst validTextAlignments = getValidTextAlignments(\n\t\tgetBlockSupport( blockName, TEXT_ALIGN_SUPPORT_KEY )\n\t);\n\tif ( ! validTextAlignments.length ) {\n\t\treturn null;\n\t}\n\n\tconst textAlignmentControls = TEXT_ALIGNMENT_OPTIONS.filter( ( control ) =>\n\t\tvalidTextAlignments.includes( control.align )\n\t);\n\tconst stateStyle = getStyleForState( style, selectedState );\n\tconst controlsGroup = getTextAlignControlGroup(\n\t\tisResponsiveEditing,\n\t\tselectedState\n\t);\n\n\tconst onChange = ( newTextAlignValue ) => {\n\t\tconst newStateStyle = {\n\t\t\t...stateStyle,\n\t\t\ttypography: {\n\t\t\t\t...stateStyle?.typography,\n\t\t\t\ttextAlign: newTextAlignValue,\n\t\t\t},\n\t\t};\n\n\t\tsetAttributes( {\n\t\t\tstyle: setStyleForState( style, selectedState, newStateStyle ),\n\t\t} );\n\t};\n\n\treturn (\n\t\t<BlockControls group={ controlsGroup }>\n\t\t\t<AlignmentControl\n\t\t\t\tvalue={ stateStyle?.typography?.textAlign }\n\t\t\t\tonChange={ onChange }\n\t\t\t\talignmentControls={ textAlignmentControls }\n\t\t\t/>\n\t\t</BlockControls>\n\t);\n}\n\nexport default {\n\tedit: BlockEditTextAlignmentToolbarControlsPure,\n\tuseBlockProps,\n\taddSaveProps: addAssignedTextAlign,\n\tattributeKeys: [ 'style' ],\n\thasSupport( name ) {\n\t\treturn hasBlockSupport( name, TEXT_ALIGN_SUPPORT_KEY, false );\n\t},\n};\n\nfunction useBlockProps( { name, style } ) {\n\tif ( ! style?.typography?.textAlign ) {\n\t\treturn null;\n\t}\n\n\tconst validTextAlignments = getValidTextAlignments(\n\t\tgetBlockSupport( name, TEXT_ALIGN_SUPPORT_KEY )\n\t);\n\n\tif ( ! validTextAlignments.length ) {\n\t\treturn null;\n\t}\n\n\tif (\n\t\tshouldSkipSerialization( name, TYPOGRAPHY_SUPPORT_KEY, 'textAlign' )\n\t) {\n\t\treturn null;\n\t}\n\n\tconst textAlign = style.typography.textAlign;\n\n\tconst className = clsx( {\n\t\t[ `has-text-align-${ textAlign }` ]: textAlign,\n\t} );\n\treturn { className };\n}\n\n/**\n * Override props assigned to save component to inject text alignment class\n * name if block supports it.\n *\n * @param {Object} props Additional props applied to save element.\n * @param {Object} blockType Block type.\n * @param {Object} attributes Block attributes.\n *\n * @return {Object} Filtered props applied to save element.\n */\nexport function addAssignedTextAlign( props, blockType, attributes ) {\n\tif ( ! attributes?.style?.typography?.textAlign ) {\n\t\treturn props;\n\t}\n\n\tconst { textAlign } = attributes.style.typography;\n\tconst blockTextAlign = getBlockSupport( blockType, TEXT_ALIGN_SUPPORT_KEY );\n\tconst isTextAlignValid =\n\t\tgetValidTextAlignments( blockTextAlign ).includes( textAlign );\n\tif (\n\t\tisTextAlignValid &&\n\t\t! shouldSkipSerialization(\n\t\t\tblockType,\n\t\t\tTYPOGRAPHY_SUPPORT_KEY,\n\t\t\t'textAlign'\n\t\t)\n\t) {\n\t\tprops.className = clsx(\n\t\t\t`has-text-align-${ textAlign }`,\n\t\t\tprops.className\n\t\t);\n\t}\n\treturn props;\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAiB;AAKjB,kBAAmB;AACnB,oBAAiD;AACjD,mBAAmD;AACnD,kBAA0B;AAK1B,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ACD,WAAO;AAAA,EACR;AAEA,QAAM,YAAY,MAAM,WAAW;AAEnC,QAAM,gBAAY,YAAAC,SAAM;AAAA,IACvB,CAAE,kBAAmB,SAAU,EAAG,GAAG;AAAA,EACtC,CAAE;AACF,SAAO,EAAE,UAAU;AACpB;AAYO,SAAS,qBAAsB,OAAO,WAAW,YAAa;AACpE,MAAK,CAAE,YAAY,OAAO,YAAY,WAAY;AACjD,WAAO;AAAA,EACR;AAEA,QAAM,EAAE,UAAU,IAAI,WAAW,MAAM;AACvC,QAAM,qBAAiB,+BAAiB,WAAW,sBAAuB;AAC1E,QAAM,mBACL,uBAAwB,cAAe,EAAE,SAAU,SAAU;AAC9D,MACC,oBACA,KAAE;AAAA,IACD;AAAA,IACA;AAAA,IACA;AAAA,EACD,GACC;AACD,UAAM,gBAAY,YAAAA;AAAA,MACjB,kBAAmB,SAAU;AAAA,MAC7B,MAAM;AAAA,IACP;AAAA,EACD;AACA,SAAO;AACR;",
6
+ "names": ["blockEditorStore", "clsx"]
7
7
  }
@@ -42,6 +42,7 @@ var import_data = require("@wordpress/data");
42
42
  var import_i18n = require("@wordpress/i18n");
43
43
  var import_inspector_controls = __toESM(require("../components/inspector-controls/index.cjs"));
44
44
  var import_typography_panel = __toESM(require("../components/global-styles/typography-panel.cjs"));
45
+ var import_inherited_value_context = require("../components/global-styles/inherited-value-context.cjs");
45
46
  var import_line_height = require("./line-height.cjs");
46
47
  var import_font_family = require("./font-family.cjs");
47
48
  var import_font_size = require("./font-size.cjs");
@@ -154,7 +155,7 @@ function TypographyPanel({
154
155
  }) {
155
156
  const selectedState = (0, import_block_style_state.useBlockStyleState)();
156
157
  const isEnabled = (0, import_typography_panel.useHasTypographyPanel)(settings);
157
- const { style, fontFamily, fontSize, fitText, textColor } = (0, import_data.useSelect)(
158
+ const { style, fontFamily, fontSize, fitText, textColor, className } = (0, import_data.useSelect)(
158
159
  (select) => {
159
160
  if (!isEnabled) {
160
161
  return {};
@@ -164,19 +165,26 @@ function TypographyPanel({
164
165
  fontFamily: _fontFamily,
165
166
  fontSize: _fontSize,
166
167
  fitText: _fitText,
167
- textColor: _textColor
168
+ textColor: _textColor,
169
+ className: _className
168
170
  } = select(import_store.store).getBlockAttributes(clientId) || {};
169
171
  return {
170
172
  style: _style,
171
173
  fontFamily: _fontFamily,
172
174
  fontSize: _fontSize,
173
175
  fitText: _fitText,
174
- textColor: _textColor
176
+ textColor: _textColor,
177
+ className: _className
175
178
  };
176
179
  },
177
180
  [clientId, isEnabled]
178
181
  );
179
182
  const isStateSelected = !(0, import_block_style_state.isDefaultBlockStyleState)(selectedState);
183
+ const { value: inheritedValue } = (0, import_inherited_value_context.useResolvedStyle)(
184
+ name,
185
+ className,
186
+ selectedState
187
+ );
180
188
  const value = (0, import_element.useMemo)(() => {
181
189
  if (isStateSelected) {
182
190
  return (0, import_block_style_state.getStyleForState)(style, selectedState);
@@ -202,7 +210,7 @@ function TypographyPanel({
202
210
  }
203
211
  setAttributes(newAttributes);
204
212
  };
205
- const enableContrastChecking = !isStateSelected && !value?.color?.gradient && !!value?.color?.text && settings?.color?.text && false !== (0, import_blocks.getBlockSupport)(name, ["color", "enableContrastChecker"]);
213
+ const enableContrastChecking = !value?.color?.gradient && !!value?.color?.text && settings?.color?.text && false !== (0, import_blocks.getBlockSupport)(name, ["color", "enableContrastChecker"]);
206
214
  const contrastWarning = (0, import_contrast_checker.default)({
207
215
  clientId,
208
216
  name,
@@ -237,7 +245,8 @@ function TypographyPanel({
237
245
  value,
238
246
  onChange,
239
247
  defaultControls,
240
- contrastWarning
248
+ contrastWarning,
249
+ inheritedValue
241
250
  }
242
251
  );
243
252
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/hooks/typography.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { getBlockSupport, hasBlockSupport } from '@wordpress/blocks';\nimport { useMemo, useCallback } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport InspectorControls from '../components/inspector-controls';\nimport {\n\tdefault as StylesTypographyPanel,\n\tuseHasTypographyPanel,\n} from '../components/global-styles/typography-panel';\n\nimport { LINE_HEIGHT_SUPPORT_KEY } from './line-height';\nimport { FONT_FAMILY_SUPPORT_KEY } from './font-family';\nimport { FONT_SIZE_SUPPORT_KEY } from './font-size';\nimport { TEXT_ALIGN_SUPPORT_KEY } from './text-align';\nimport { FIT_TEXT_SUPPORT_KEY } from './fit-text';\nimport { cleanEmptyObject } from './utils';\nimport { extractPresetSlug } from '../utils/color-values';\nimport { store as blockEditorStore } from '../store';\nimport {\n\tgetStyleForState,\n\tisDefaultBlockStyleState,\n\tsetStyleForState,\n\tuseBlockStyleState,\n} from './block-style-state';\nimport useBlockColorContrastWarning from './contrast-checker';\n\nfunction omit( object, keys ) {\n\treturn Object.fromEntries(\n\t\tObject.entries( object ).filter( ( [ key ] ) => ! keys.includes( key ) )\n\t);\n}\n\nconst LETTER_SPACING_SUPPORT_KEY = 'typography.__experimentalLetterSpacing';\nconst TEXT_TRANSFORM_SUPPORT_KEY = 'typography.__experimentalTextTransform';\nconst TEXT_DECORATION_SUPPORT_KEY = 'typography.__experimentalTextDecoration';\nconst TEXT_INDENT_SUPPORT_KEY = 'typography.textIndent';\nconst TEXT_COLUMNS_SUPPORT_KEY = 'typography.textColumns';\nconst FONT_STYLE_SUPPORT_KEY = 'typography.__experimentalFontStyle';\nconst FONT_WEIGHT_SUPPORT_KEY = 'typography.__experimentalFontWeight';\nconst WRITING_MODE_SUPPORT_KEY = 'typography.__experimentalWritingMode';\nexport const TYPOGRAPHY_SUPPORT_KEY = 'typography';\nexport const 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_INDENT_SUPPORT_KEY,\n\tWRITING_MODE_SUPPORT_KEY,\n\tTEXT_TRANSFORM_SUPPORT_KEY,\n\tLETTER_SPACING_SUPPORT_KEY,\n\tFIT_TEXT_SUPPORT_KEY,\n];\n\nfunction styleToAttributes( style ) {\n\tconst updatedStyle = { ...omit( style, [ 'fontFamily' ] ) };\n\tconst fontSizeValue = style?.typography?.fontSize;\n\tconst fontFamilyValue = style?.typography?.fontFamily;\n\tconst textColorValue = style?.color?.text;\n\tconst fontSizeSlug =\n\t\ttypeof fontSizeValue === 'string' &&\n\t\tfontSizeValue?.startsWith( 'var:preset|font-size|' )\n\t\t\t? fontSizeValue.substring( 'var:preset|font-size|'.length )\n\t\t\t: undefined;\n\tconst fontFamilySlug = fontFamilyValue?.startsWith(\n\t\t'var:preset|font-family|'\n\t)\n\t\t? fontFamilyValue.substring( 'var:preset|font-family|'.length )\n\t\t: undefined;\n\tconst textColorSlug = extractPresetSlug( textColorValue, 'color' );\n\tupdatedStyle.typography = {\n\t\t...omit( updatedStyle.typography, [ 'fontFamily' ] ),\n\t\tfontSize: fontSizeSlug ? undefined : fontSizeValue,\n\t};\n\tupdatedStyle.color = {\n\t\t...updatedStyle.color,\n\t\ttext: textColorSlug ? undefined : textColorValue,\n\t};\n\treturn {\n\t\tstyle: cleanEmptyObject( updatedStyle ),\n\t\tfontFamily: fontFamilySlug,\n\t\tfontSize: fontSizeSlug,\n\t\ttextColor: textColorSlug,\n\t};\n}\n\nfunction attributesToStyle( attributes ) {\n\treturn {\n\t\t...attributes.style,\n\t\ttypography: {\n\t\t\t...attributes.style?.typography,\n\t\t\tfontFamily: attributes.fontFamily\n\t\t\t\t? 'var:preset|font-family|' + attributes.fontFamily\n\t\t\t\t: undefined,\n\t\t\tfontSize: attributes.fontSize\n\t\t\t\t? 'var:preset|font-size|' + attributes.fontSize\n\t\t\t\t: attributes.style?.typography?.fontSize,\n\t\t},\n\t\tcolor: {\n\t\t\t...attributes.style?.color,\n\t\t\ttext: attributes.textColor\n\t\t\t\t? 'var:preset|color|' + attributes.textColor\n\t\t\t\t: attributes.style?.color?.text,\n\t\t},\n\t};\n}\n\nfunction TypographyInspectorControl( { children, resetAllFilter } ) {\n\tconst attributesResetAllFilter = useCallback(\n\t\t( attributes ) => {\n\t\t\tconst existingStyle = attributesToStyle( attributes );\n\t\t\tconst updatedStyle = resetAllFilter( existingStyle );\n\t\t\treturn {\n\t\t\t\t...attributes,\n\t\t\t\t...styleToAttributes( updatedStyle ),\n\t\t\t};\n\t\t},\n\t\t[ resetAllFilter ]\n\t);\n\n\treturn (\n\t\t<InspectorControls\n\t\t\tgroup=\"typography\"\n\t\t\tresetAllFilter={ attributesResetAllFilter }\n\t\t>\n\t\t\t{ children }\n\t\t</InspectorControls>\n\t);\n}\n\nexport function TypographyPanel( {\n\tclientId,\n\tname,\n\tsetAttributes,\n\tsettings,\n\t// Allows rendering outside the `typography` inspector group (e.g. section\n\t// blocks direct-render this panel because their support fills are gated\n\t// off by editing mode). Defaults to the slot-based wrapper.\n\tasWrapper,\n} ) {\n\tconst selectedState = useBlockStyleState();\n\tconst isEnabled = useHasTypographyPanel( settings );\n\n\tconst { style, fontFamily, fontSize, fitText, textColor } = useSelect(\n\t\t( select ) => {\n\t\t\t// Early return to avoid subscription when disabled.\n\t\t\tif ( ! isEnabled ) {\n\t\t\t\treturn {};\n\t\t\t}\n\t\t\tconst {\n\t\t\t\tstyle: _style,\n\t\t\t\tfontFamily: _fontFamily,\n\t\t\t\tfontSize: _fontSize,\n\t\t\t\tfitText: _fitText,\n\t\t\t\ttextColor: _textColor,\n\t\t\t} = select( blockEditorStore ).getBlockAttributes( clientId ) || {};\n\t\t\treturn {\n\t\t\t\tstyle: _style,\n\t\t\t\tfontFamily: _fontFamily,\n\t\t\t\tfontSize: _fontSize,\n\t\t\t\tfitText: _fitText,\n\t\t\t\ttextColor: _textColor,\n\t\t\t};\n\t\t},\n\t\t[ clientId, isEnabled ]\n\t);\n\n\tconst isStateSelected = ! isDefaultBlockStyleState( selectedState );\n\n\tconst value = useMemo( () => {\n\t\tif ( isStateSelected ) {\n\t\t\treturn getStyleForState( style, selectedState );\n\t\t}\n\t\treturn attributesToStyle( { style, fontFamily, fontSize, textColor } );\n\t}, [\n\t\tisStateSelected,\n\t\tselectedState,\n\t\tstyle,\n\t\tfontSize,\n\t\tfontFamily,\n\t\ttextColor,\n\t] );\n\n\tconst onChange = isStateSelected\n\t\t? ( newStyle ) => {\n\t\t\t\tsetAttributes( {\n\t\t\t\t\tstyle: setStyleForState( style, selectedState, newStyle ),\n\t\t\t\t} );\n\t\t }\n\t\t: ( newStyle ) => {\n\t\t\t\tconst newAttributes = styleToAttributes( newStyle );\n\n\t\t\t\t// If setting a font size and fitText is currently enabled, disable it.\n\t\t\t\tconst hasFontSize =\n\t\t\t\t\tnewAttributes.fontSize ||\n\t\t\t\t\tnewAttributes.style?.typography?.fontSize;\n\t\t\t\tif ( hasFontSize && fitText ) {\n\t\t\t\t\tnewAttributes.fitText = undefined;\n\t\t\t\t}\n\n\t\t\t\tsetAttributes( newAttributes );\n\t\t };\n\n\t// Link color failures are reported by the Elements panel, which owns the\n\t// link color selection.\n\tconst enableContrastChecking =\n\t\t! isStateSelected &&\n\t\t! value?.color?.gradient &&\n\t\t!! value?.color?.text &&\n\t\tsettings?.color?.text &&\n\t\tfalse !== getBlockSupport( name, [ 'color', 'enableContrastChecker' ] );\n\n\tconst contrastWarning = useBlockColorContrastWarning( {\n\t\tclientId,\n\t\tname,\n\t\tenabled: !! enableContrastChecking,\n\t\tcheckLinkColor: false,\n\t\tmessageOverride: __(\n\t\t\t'This color has poor contrast against the background. Consider increasing contrast.'\n\t\t),\n\t} );\n\n\tif ( ! isEnabled ) {\n\t\treturn null;\n\t}\n\n\tconst typographyDefaultControls = getBlockSupport( name, [\n\t\tTYPOGRAPHY_SUPPORT_KEY,\n\t\t'__experimentalDefaultControls',\n\t] );\n\tconst colorDefaultControls = getBlockSupport( name, [\n\t\t'color',\n\t\t'__experimentalDefaultControls',\n\t] );\n\tconst defaultControls = {\n\t\t...typographyDefaultControls,\n\t\ttextColor: colorDefaultControls?.text,\n\t};\n\n\tconst Wrapper = asWrapper || TypographyInspectorControl;\n\n\treturn (\n\t\t<StylesTypographyPanel\n\t\t\tas={ Wrapper }\n\t\t\tpanelId={ clientId }\n\t\t\tsettings={ settings }\n\t\t\tvalue={ value }\n\t\t\tonChange={ onChange }\n\t\t\tdefaultControls={ defaultControls }\n\t\t\tcontrastWarning={ contrastWarning }\n\t\t/>\n\t);\n}\n\nexport const hasTypographySupport = ( blockName ) => {\n\treturn TYPOGRAPHY_SUPPORT_KEYS.some( ( key ) =>\n\t\thasBlockSupport( blockName, key )\n\t);\n};\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,oBAAiD;AACjD,qBAAqC;AACrC,kBAA0B;AAC1B,kBAAmB;AAKnB,gCAA8B;AAC9B,8BAGO;AAEP,yBAAwC;AACxC,yBAAwC;AACxC,uBAAsC;AACtC,wBAAuC;AACvC,sBAAqC;AACrC,mBAAiC;AACjC,0BAAkC;AAClC,mBAA0C;AAC1C,+BAKO;AACP,8BAAyC;AAoGvC;AAlGF,SAAS,KAAM,QAAQ,MAAO;AAC7B,SAAO,OAAO;AAAA,IACb,OAAO,QAAS,MAAO,EAAE,OAAQ,CAAE,CAAE,GAAI,MAAO,CAAE,KAAK,SAAU,GAAI,CAAE;AAAA,EACxE;AACD;AAEA,IAAM,6BAA6B;AACnC,IAAM,6BAA6B;AACnC,IAAM,8BAA8B;AACpC,IAAM,0BAA0B;AAChC,IAAM,2BAA2B;AACjC,IAAM,yBAAyB;AAC/B,IAAM,0BAA0B;AAChC,IAAM,2BAA2B;AAC1B,IAAM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AM,uBAAuB,CAAE,cAAe;AACpD,SAAO,wBAAwB;AAAA,IAAM,CAAE,YACtC,+BAAiB,WAAW,GAAI;AAAA,EACjC;AACD;",
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { getBlockSupport, hasBlockSupport } from '@wordpress/blocks';\nimport { useMemo, useCallback } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport InspectorControls from '../components/inspector-controls';\nimport {\n\tdefault as StylesTypographyPanel,\n\tuseHasTypographyPanel,\n} from '../components/global-styles/typography-panel';\nimport { useResolvedStyle } from '../components/global-styles/inherited-value-context';\n\nimport { LINE_HEIGHT_SUPPORT_KEY } from './line-height';\nimport { FONT_FAMILY_SUPPORT_KEY } from './font-family';\nimport { FONT_SIZE_SUPPORT_KEY } from './font-size';\nimport { TEXT_ALIGN_SUPPORT_KEY } from './text-align';\nimport { FIT_TEXT_SUPPORT_KEY } from './fit-text';\nimport { cleanEmptyObject } from './utils';\nimport { extractPresetSlug } from '../utils/color-values';\nimport { store as blockEditorStore } from '../store';\nimport {\n\tgetStyleForState,\n\tisDefaultBlockStyleState,\n\tsetStyleForState,\n\tuseBlockStyleState,\n} from './block-style-state';\nimport useBlockColorContrastWarning from './contrast-checker';\n\nfunction omit( object, keys ) {\n\treturn Object.fromEntries(\n\t\tObject.entries( object ).filter( ( [ key ] ) => ! keys.includes( key ) )\n\t);\n}\n\nconst LETTER_SPACING_SUPPORT_KEY = 'typography.__experimentalLetterSpacing';\nconst TEXT_TRANSFORM_SUPPORT_KEY = 'typography.__experimentalTextTransform';\nconst TEXT_DECORATION_SUPPORT_KEY = 'typography.__experimentalTextDecoration';\nconst TEXT_INDENT_SUPPORT_KEY = 'typography.textIndent';\nconst TEXT_COLUMNS_SUPPORT_KEY = 'typography.textColumns';\nconst FONT_STYLE_SUPPORT_KEY = 'typography.__experimentalFontStyle';\nconst FONT_WEIGHT_SUPPORT_KEY = 'typography.__experimentalFontWeight';\nconst WRITING_MODE_SUPPORT_KEY = 'typography.__experimentalWritingMode';\nexport const TYPOGRAPHY_SUPPORT_KEY = 'typography';\nexport const 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_INDENT_SUPPORT_KEY,\n\tWRITING_MODE_SUPPORT_KEY,\n\tTEXT_TRANSFORM_SUPPORT_KEY,\n\tLETTER_SPACING_SUPPORT_KEY,\n\tFIT_TEXT_SUPPORT_KEY,\n];\n\nfunction styleToAttributes( style ) {\n\tconst updatedStyle = { ...omit( style, [ 'fontFamily' ] ) };\n\tconst fontSizeValue = style?.typography?.fontSize;\n\tconst fontFamilyValue = style?.typography?.fontFamily;\n\tconst textColorValue = style?.color?.text;\n\tconst fontSizeSlug =\n\t\ttypeof fontSizeValue === 'string' &&\n\t\tfontSizeValue?.startsWith( 'var:preset|font-size|' )\n\t\t\t? fontSizeValue.substring( 'var:preset|font-size|'.length )\n\t\t\t: undefined;\n\tconst fontFamilySlug = fontFamilyValue?.startsWith(\n\t\t'var:preset|font-family|'\n\t)\n\t\t? fontFamilyValue.substring( 'var:preset|font-family|'.length )\n\t\t: undefined;\n\tconst textColorSlug = extractPresetSlug( textColorValue, 'color' );\n\tupdatedStyle.typography = {\n\t\t...omit( updatedStyle.typography, [ 'fontFamily' ] ),\n\t\tfontSize: fontSizeSlug ? undefined : fontSizeValue,\n\t};\n\tupdatedStyle.color = {\n\t\t...updatedStyle.color,\n\t\ttext: textColorSlug ? undefined : textColorValue,\n\t};\n\treturn {\n\t\tstyle: cleanEmptyObject( updatedStyle ),\n\t\tfontFamily: fontFamilySlug,\n\t\tfontSize: fontSizeSlug,\n\t\ttextColor: textColorSlug,\n\t};\n}\n\nfunction attributesToStyle( attributes ) {\n\treturn {\n\t\t...attributes.style,\n\t\ttypography: {\n\t\t\t...attributes.style?.typography,\n\t\t\tfontFamily: attributes.fontFamily\n\t\t\t\t? 'var:preset|font-family|' + attributes.fontFamily\n\t\t\t\t: undefined,\n\t\t\tfontSize: attributes.fontSize\n\t\t\t\t? 'var:preset|font-size|' + attributes.fontSize\n\t\t\t\t: attributes.style?.typography?.fontSize,\n\t\t},\n\t\tcolor: {\n\t\t\t...attributes.style?.color,\n\t\t\ttext: attributes.textColor\n\t\t\t\t? 'var:preset|color|' + attributes.textColor\n\t\t\t\t: attributes.style?.color?.text,\n\t\t},\n\t};\n}\n\nfunction TypographyInspectorControl( { children, resetAllFilter } ) {\n\tconst attributesResetAllFilter = useCallback(\n\t\t( attributes ) => {\n\t\t\tconst existingStyle = attributesToStyle( attributes );\n\t\t\tconst updatedStyle = resetAllFilter( existingStyle );\n\t\t\treturn {\n\t\t\t\t...attributes,\n\t\t\t\t...styleToAttributes( updatedStyle ),\n\t\t\t};\n\t\t},\n\t\t[ resetAllFilter ]\n\t);\n\n\treturn (\n\t\t<InspectorControls\n\t\t\tgroup=\"typography\"\n\t\t\tresetAllFilter={ attributesResetAllFilter }\n\t\t>\n\t\t\t{ children }\n\t\t</InspectorControls>\n\t);\n}\n\nexport function TypographyPanel( {\n\tclientId,\n\tname,\n\tsetAttributes,\n\tsettings,\n\t// Allows rendering outside the `typography` inspector group (e.g. section\n\t// blocks direct-render this panel because their support fills are gated\n\t// off by editing mode). Defaults to the slot-based wrapper.\n\tasWrapper,\n} ) {\n\tconst selectedState = useBlockStyleState();\n\tconst isEnabled = useHasTypographyPanel( settings );\n\n\tconst { style, fontFamily, fontSize, fitText, textColor, className } =\n\t\tuseSelect(\n\t\t\t( select ) => {\n\t\t\t\t// Early return to avoid subscription when disabled.\n\t\t\t\tif ( ! isEnabled ) {\n\t\t\t\t\treturn {};\n\t\t\t\t}\n\t\t\t\tconst {\n\t\t\t\t\tstyle: _style,\n\t\t\t\t\tfontFamily: _fontFamily,\n\t\t\t\t\tfontSize: _fontSize,\n\t\t\t\t\tfitText: _fitText,\n\t\t\t\t\ttextColor: _textColor,\n\t\t\t\t\tclassName: _className,\n\t\t\t\t} = select( blockEditorStore ).getBlockAttributes( clientId ) ||\n\t\t\t\t{};\n\t\t\t\treturn {\n\t\t\t\t\tstyle: _style,\n\t\t\t\t\tfontFamily: _fontFamily,\n\t\t\t\t\tfontSize: _fontSize,\n\t\t\t\t\tfitText: _fitText,\n\t\t\t\t\ttextColor: _textColor,\n\t\t\t\t\tclassName: _className,\n\t\t\t\t};\n\t\t\t},\n\t\t\t[ clientId, isEnabled ]\n\t\t);\n\n\tconst isStateSelected = ! isDefaultBlockStyleState( selectedState );\n\n\tconst { value: inheritedValue } = useResolvedStyle(\n\t\tname,\n\t\tclassName,\n\t\tselectedState\n\t);\n\n\tconst value = useMemo( () => {\n\t\tif ( isStateSelected ) {\n\t\t\treturn getStyleForState( style, selectedState );\n\t\t}\n\t\treturn attributesToStyle( { style, fontFamily, fontSize, textColor } );\n\t}, [\n\t\tisStateSelected,\n\t\tselectedState,\n\t\tstyle,\n\t\tfontSize,\n\t\tfontFamily,\n\t\ttextColor,\n\t] );\n\n\tconst onChange = isStateSelected\n\t\t? ( newStyle ) => {\n\t\t\t\tsetAttributes( {\n\t\t\t\t\tstyle: setStyleForState( style, selectedState, newStyle ),\n\t\t\t\t} );\n\t\t }\n\t\t: ( newStyle ) => {\n\t\t\t\tconst newAttributes = styleToAttributes( newStyle );\n\n\t\t\t\t// If setting a font size and fitText is currently enabled, disable it.\n\t\t\t\tconst hasFontSize =\n\t\t\t\t\tnewAttributes.fontSize ||\n\t\t\t\t\tnewAttributes.style?.typography?.fontSize;\n\t\t\t\tif ( hasFontSize && fitText ) {\n\t\t\t\t\tnewAttributes.fitText = undefined;\n\t\t\t\t}\n\n\t\t\t\tsetAttributes( newAttributes );\n\t\t };\n\n\t// Link color failures are reported by the Elements panel, which owns the\n\t// link color selection.\n\tconst enableContrastChecking =\n\t\t! value?.color?.gradient &&\n\t\t!! value?.color?.text &&\n\t\tsettings?.color?.text &&\n\t\tfalse !== getBlockSupport( name, [ 'color', 'enableContrastChecker' ] );\n\n\tconst contrastWarning = useBlockColorContrastWarning( {\n\t\tclientId,\n\t\tname,\n\t\tenabled: !! enableContrastChecking,\n\t\tcheckLinkColor: false,\n\t\tmessageOverride: __(\n\t\t\t'This color has poor contrast against the background. Consider increasing contrast.'\n\t\t),\n\t} );\n\n\tif ( ! isEnabled ) {\n\t\treturn null;\n\t}\n\n\tconst typographyDefaultControls = getBlockSupport( name, [\n\t\tTYPOGRAPHY_SUPPORT_KEY,\n\t\t'__experimentalDefaultControls',\n\t] );\n\tconst colorDefaultControls = getBlockSupport( name, [\n\t\t'color',\n\t\t'__experimentalDefaultControls',\n\t] );\n\tconst defaultControls = {\n\t\t...typographyDefaultControls,\n\t\ttextColor: colorDefaultControls?.text,\n\t};\n\n\tconst Wrapper = asWrapper || TypographyInspectorControl;\n\n\treturn (\n\t\t<StylesTypographyPanel\n\t\t\tas={ Wrapper }\n\t\t\tpanelId={ clientId }\n\t\t\tsettings={ settings }\n\t\t\tvalue={ value }\n\t\t\tonChange={ onChange }\n\t\t\tdefaultControls={ defaultControls }\n\t\t\tcontrastWarning={ contrastWarning }\n\t\t\tinheritedValue={ inheritedValue }\n\t\t/>\n\t);\n}\n\nexport const hasTypographySupport = ( blockName ) => {\n\treturn TYPOGRAPHY_SUPPORT_KEYS.some( ( key ) =>\n\t\thasBlockSupport( blockName, key )\n\t);\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,oBAAiD;AACjD,qBAAqC;AACrC,kBAA0B;AAC1B,kBAAmB;AAKnB,gCAA8B;AAC9B,8BAG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,sBAAkB,wBAAAC,SAA8B;AAAA,IACrD;AAAA,IACA;AAAA,IACA,SAAS,CAAC,CAAE;AAAA,IACZ,gBAAgB;AAAA,IAChB,qBAAiB;AAAA,MAChB;AAAA,IACD;AAAA,EACD,CAAE;AAEF,MAAK,CAAE,WAAY;AAClB,WAAO;AAAA,EACR;AAEA,QAAM,gCAA4B,+BAAiB,MAAM;AAAA,IACxD;AAAA,IACA;AAAA,EACD,CAAE;AACF,QAAM,2BAAuB,+BAAiB,MAAM;AAAA,IACnD;AAAA,IACA;AAAA,EACD,CAAE;AACF,QAAM,kBAAkB;AAAA,IACvB,GAAG;AAAA,IACH,WAAW,sBAAsB;AAAA,EAClC;AAEA,QAAM,UAAU,aAAa;AAE7B,SACC;AAAA,IAAC,wBAAAC;AAAA,IAAA;AAAA,MACA,IAAK;AAAA,MACL,SAAU;AAAA,MACV;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,EACD;AAEF;AAEO,IAAM,uBAAuB,CAAE,cAAe;AACpD,SAAO,wBAAwB;AAAA,IAAM,CAAE,YACtC,+BAAiB,WAAW,GAAI;AAAA,EACjC;AACD;",
6
6
  "names": ["InspectorControls", "blockEditorStore", "useBlockColorContrastWarning", "StylesTypographyPanel"]
7
7
  }
@@ -195,19 +195,27 @@ var constrained_default = {
195
195
  toolBarControls: function DefaultLayoutToolbarControls({
196
196
  layout = {},
197
197
  onChange,
198
- layoutBlockSupport
198
+ layoutBlockSupport,
199
+ controlsGroup = "block"
199
200
  }) {
200
201
  const { allowJustification = true } = layoutBlockSupport;
201
202
  if (!allowJustification) {
202
203
  return null;
203
204
  }
204
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components2.BlockControls, { group: "block", __experimentalShareWithChildBlocks: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
205
- DefaultLayoutJustifyContentControl,
205
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
206
+ import_components2.BlockControls,
206
207
  {
207
- layout,
208
- onChange
208
+ group: controlsGroup,
209
+ __experimentalShareWithChildBlocks: true,
210
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
211
+ DefaultLayoutJustifyContentControl,
212
+ {
213
+ layout,
214
+ onChange
215
+ }
216
+ )
209
217
  }
210
- ) });
218
+ );
211
219
  },
212
220
  getLayoutStyle: function getLayoutStyle({
213
221
  selector,