@wordpress/edit-site 5.3.6 → 5.5.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 (217) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/components/add-new-template/new-template.js +1 -20
  3. package/build/components/add-new-template/new-template.js.map +1 -1
  4. package/build/components/app/index.js.map +1 -1
  5. package/build/components/block-editor/editor-canvas.js +1 -0
  6. package/build/components/block-editor/editor-canvas.js.map +1 -1
  7. package/build/components/editor/index.js +3 -1
  8. package/build/components/editor/index.js.map +1 -1
  9. package/build/components/global-styles/border-panel.js +5 -5
  10. package/build/components/global-styles/border-panel.js.map +1 -1
  11. package/build/components/global-styles/color-palette-panel.js +5 -2
  12. package/build/components/global-styles/color-palette-panel.js.map +1 -1
  13. package/build/components/global-styles/color-utils.js +1 -1
  14. package/build/components/global-styles/color-utils.js.map +1 -1
  15. package/build/components/global-styles/context-menu.js +22 -6
  16. package/build/components/global-styles/context-menu.js.map +1 -1
  17. package/build/components/global-styles/custom-css.js +1 -1
  18. package/build/components/global-styles/custom-css.js.map +1 -1
  19. package/build/components/global-styles/dimensions-panel.js +41 -486
  20. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  21. package/build/components/global-styles/duotone-panel.js +78 -0
  22. package/build/components/global-styles/duotone-panel.js.map +1 -0
  23. package/build/components/global-styles/filter-utils.js +17 -0
  24. package/build/components/global-styles/filter-utils.js.map +1 -0
  25. package/build/components/global-styles/gradients-palette-panel.js +8 -3
  26. package/build/components/global-styles/gradients-palette-panel.js.map +1 -1
  27. package/build/components/global-styles/header.js +3 -1
  28. package/build/components/global-styles/header.js.map +1 -1
  29. package/build/components/global-styles/hooks.js +14 -51
  30. package/build/components/global-styles/hooks.js.map +1 -1
  31. package/build/components/global-styles/palette.js +3 -1
  32. package/build/components/global-styles/palette.js.map +1 -1
  33. package/build/components/global-styles/preview.js +9 -5
  34. package/build/components/global-styles/preview.js.map +1 -1
  35. package/build/components/global-styles/screen-background-color.js +3 -2
  36. package/build/components/global-styles/screen-background-color.js.map +1 -1
  37. package/build/components/global-styles/screen-block-list.js +13 -6
  38. package/build/components/global-styles/screen-block-list.js.map +1 -1
  39. package/build/components/global-styles/screen-button-color.js +7 -5
  40. package/build/components/global-styles/screen-button-color.js.map +1 -1
  41. package/build/components/global-styles/screen-colors.js +8 -6
  42. package/build/components/global-styles/screen-colors.js.map +1 -1
  43. package/build/components/global-styles/screen-filters.js +46 -0
  44. package/build/components/global-styles/screen-filters.js.map +1 -0
  45. package/build/components/global-styles/screen-heading-color.js +8 -6
  46. package/build/components/global-styles/screen-heading-color.js.map +1 -1
  47. package/build/components/global-styles/screen-layout.js +13 -5
  48. package/build/components/global-styles/screen-layout.js.map +1 -1
  49. package/build/components/global-styles/screen-link-color.js +3 -2
  50. package/build/components/global-styles/screen-link-color.js.map +1 -1
  51. package/build/components/global-styles/screen-text-color.js +3 -2
  52. package/build/components/global-styles/screen-text-color.js.map +1 -1
  53. package/build/components/global-styles/screen-typography.js +3 -1
  54. package/build/components/global-styles/screen-typography.js.map +1 -1
  55. package/build/components/global-styles/shadow-panel.js +2 -3
  56. package/build/components/global-styles/shadow-panel.js.map +1 -1
  57. package/build/components/global-styles/subtitle.js +3 -2
  58. package/build/components/global-styles/subtitle.js.map +1 -1
  59. package/build/components/global-styles/typography-panel.js +23 -303
  60. package/build/components/global-styles/typography-panel.js.map +1 -1
  61. package/build/components/global-styles/ui.js +6 -0
  62. package/build/components/global-styles/ui.js.map +1 -1
  63. package/build/components/keyboard-shortcut-help-modal/config.js +12 -0
  64. package/build/components/keyboard-shortcut-help-modal/config.js.map +1 -1
  65. package/build/components/keyboard-shortcuts/index.js +67 -0
  66. package/build/components/keyboard-shortcuts/index.js.map +1 -1
  67. package/build/components/navigation-inspector/index.js +0 -29
  68. package/build/components/navigation-inspector/index.js.map +1 -1
  69. package/build/components/navigation-inspector/navigation-menu.js +22 -5
  70. package/build/components/navigation-inspector/navigation-menu.js.map +1 -1
  71. package/build/components/sidebar-edit-mode/index.js +1 -1
  72. package/build/components/sidebar-edit-mode/index.js.map +1 -1
  73. package/build/components/sidebar-edit-mode/template-card/index.js +9 -2
  74. package/build/components/sidebar-edit-mode/template-card/index.js.map +1 -1
  75. package/build/components/sidebar-edit-mode/template-card/last-revision.js +84 -0
  76. package/build/components/sidebar-edit-mode/template-card/last-revision.js.map +1 -0
  77. package/build/components/sidebar-navigation-screen-navigation-menus/index.js +9 -1
  78. package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  79. package/build/components/start-template-options/index.js +175 -0
  80. package/build/components/start-template-options/index.js.map +1 -0
  81. package/build/hooks/push-changes-to-global-styles/index.js +5 -4
  82. package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
  83. package/build/store/actions.js +2 -2
  84. package/build/store/actions.js.map +1 -1
  85. package/build-module/components/add-new-template/new-template.js +1 -18
  86. package/build-module/components/add-new-template/new-template.js.map +1 -1
  87. package/build-module/components/app/index.js.map +1 -1
  88. package/build-module/components/block-editor/editor-canvas.js +1 -0
  89. package/build-module/components/block-editor/editor-canvas.js.map +1 -1
  90. package/build-module/components/editor/index.js +2 -1
  91. package/build-module/components/editor/index.js.map +1 -1
  92. package/build-module/components/global-styles/border-panel.js +6 -6
  93. package/build-module/components/global-styles/border-panel.js.map +1 -1
  94. package/build-module/components/global-styles/color-palette-panel.js +5 -2
  95. package/build-module/components/global-styles/color-palette-panel.js.map +1 -1
  96. package/build-module/components/global-styles/color-utils.js +2 -2
  97. package/build-module/components/global-styles/color-utils.js.map +1 -1
  98. package/build-module/components/global-styles/context-menu.js +20 -6
  99. package/build-module/components/global-styles/context-menu.js.map +1 -1
  100. package/build-module/components/global-styles/custom-css.js +1 -1
  101. package/build-module/components/global-styles/custom-css.js.map +1 -1
  102. package/build-module/components/global-styles/dimensions-panel.js +43 -479
  103. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  104. package/build-module/components/global-styles/duotone-panel.js +67 -0
  105. package/build-module/components/global-styles/duotone-panel.js.map +1 -0
  106. package/build-module/components/global-styles/filter-utils.js +9 -0
  107. package/build-module/components/global-styles/filter-utils.js.map +1 -0
  108. package/build-module/components/global-styles/gradients-palette-panel.js +8 -3
  109. package/build-module/components/global-styles/gradients-palette-panel.js.map +1 -1
  110. package/build-module/components/global-styles/header.js +3 -1
  111. package/build-module/components/global-styles/header.js.map +1 -1
  112. package/build-module/components/global-styles/hooks.js +12 -49
  113. package/build-module/components/global-styles/hooks.js.map +1 -1
  114. package/build-module/components/global-styles/palette.js +3 -1
  115. package/build-module/components/global-styles/palette.js.map +1 -1
  116. package/build-module/components/global-styles/preview.js +10 -6
  117. package/build-module/components/global-styles/preview.js.map +1 -1
  118. package/build-module/components/global-styles/screen-background-color.js +4 -3
  119. package/build-module/components/global-styles/screen-background-color.js.map +1 -1
  120. package/build-module/components/global-styles/screen-block-list.js +12 -5
  121. package/build-module/components/global-styles/screen-block-list.js.map +1 -1
  122. package/build-module/components/global-styles/screen-button-color.js +8 -6
  123. package/build-module/components/global-styles/screen-button-color.js.map +1 -1
  124. package/build-module/components/global-styles/screen-colors.js +9 -7
  125. package/build-module/components/global-styles/screen-colors.js.map +1 -1
  126. package/build-module/components/global-styles/screen-filters.js +33 -0
  127. package/build-module/components/global-styles/screen-filters.js.map +1 -0
  128. package/build-module/components/global-styles/screen-heading-color.js +9 -7
  129. package/build-module/components/global-styles/screen-heading-color.js.map +1 -1
  130. package/build-module/components/global-styles/screen-layout.js +11 -2
  131. package/build-module/components/global-styles/screen-layout.js.map +1 -1
  132. package/build-module/components/global-styles/screen-link-color.js +4 -3
  133. package/build-module/components/global-styles/screen-link-color.js.map +1 -1
  134. package/build-module/components/global-styles/screen-text-color.js +4 -3
  135. package/build-module/components/global-styles/screen-text-color.js.map +1 -1
  136. package/build-module/components/global-styles/screen-typography.js +3 -1
  137. package/build-module/components/global-styles/screen-typography.js.map +1 -1
  138. package/build-module/components/global-styles/shadow-panel.js +3 -4
  139. package/build-module/components/global-styles/shadow-panel.js.map +1 -1
  140. package/build-module/components/global-styles/subtitle.js +3 -2
  141. package/build-module/components/global-styles/subtitle.js.map +1 -1
  142. package/build-module/components/global-styles/typography-panel.js +24 -300
  143. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  144. package/build-module/components/global-styles/ui.js +5 -0
  145. package/build-module/components/global-styles/ui.js.map +1 -1
  146. package/build-module/components/keyboard-shortcut-help-modal/config.js +12 -0
  147. package/build-module/components/keyboard-shortcut-help-modal/config.js.map +1 -1
  148. package/build-module/components/keyboard-shortcuts/index.js +65 -0
  149. package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
  150. package/build-module/components/navigation-inspector/index.js +0 -27
  151. package/build-module/components/navigation-inspector/index.js.map +1 -1
  152. package/build-module/components/navigation-inspector/navigation-menu.js +25 -8
  153. package/build-module/components/navigation-inspector/navigation-menu.js.map +1 -1
  154. package/build-module/components/sidebar-edit-mode/index.js +1 -1
  155. package/build-module/components/sidebar-edit-mode/index.js.map +1 -1
  156. package/build-module/components/sidebar-edit-mode/template-card/index.js +9 -4
  157. package/build-module/components/sidebar-edit-mode/template-card/index.js.map +1 -1
  158. package/build-module/components/sidebar-edit-mode/template-card/last-revision.js +70 -0
  159. package/build-module/components/sidebar-edit-mode/template-card/last-revision.js.map +1 -0
  160. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +9 -1
  161. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  162. package/build-module/components/start-template-options/index.js +156 -0
  163. package/build-module/components/start-template-options/index.js.map +1 -0
  164. package/build-module/hooks/push-changes-to-global-styles/index.js +6 -5
  165. package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
  166. package/build-module/store/actions.js +2 -2
  167. package/build-module/store/actions.js.map +1 -1
  168. package/build-style/style-rtl.css +73 -4
  169. package/build-style/style.css +73 -4
  170. package/package.json +31 -31
  171. package/src/components/add-new-template/new-template.js +1 -16
  172. package/src/components/app/index.js +0 -1
  173. package/src/components/block-editor/editor-canvas.js +1 -0
  174. package/src/components/editor/index.js +2 -0
  175. package/src/components/global-styles/border-panel.js +6 -6
  176. package/src/components/global-styles/color-palette-panel.js +3 -0
  177. package/src/components/global-styles/color-utils.js +2 -3
  178. package/src/components/global-styles/context-menu.js +25 -4
  179. package/src/components/global-styles/custom-css.js +1 -1
  180. package/src/components/global-styles/dimensions-panel.js +43 -573
  181. package/src/components/global-styles/duotone-panel.js +82 -0
  182. package/src/components/global-styles/filter-utils.js +9 -0
  183. package/src/components/global-styles/gradients-palette-panel.js +4 -1
  184. package/src/components/global-styles/header.js +7 -1
  185. package/src/components/global-styles/hooks.js +17 -90
  186. package/src/components/global-styles/palette.js +1 -1
  187. package/src/components/global-styles/preview.js +155 -140
  188. package/src/components/global-styles/screen-background-color.js +3 -2
  189. package/src/components/global-styles/screen-block-list.js +16 -5
  190. package/src/components/global-styles/screen-button-color.js +8 -6
  191. package/src/components/global-styles/screen-colors.js +7 -7
  192. package/src/components/global-styles/screen-filters.js +27 -0
  193. package/src/components/global-styles/screen-heading-color.js +9 -7
  194. package/src/components/global-styles/screen-layout.js +9 -2
  195. package/src/components/global-styles/screen-link-color.js +3 -2
  196. package/src/components/global-styles/screen-text-color.js +3 -2
  197. package/src/components/global-styles/screen-typography.js +1 -1
  198. package/src/components/global-styles/shadow-panel.js +6 -3
  199. package/src/components/global-styles/style.scss +5 -0
  200. package/src/components/global-styles/subtitle.js +5 -2
  201. package/src/components/global-styles/typography-panel.js +29 -395
  202. package/src/components/global-styles/ui.js +5 -0
  203. package/src/components/keyboard-shortcut-help-modal/config.js +10 -0
  204. package/src/components/keyboard-shortcuts/index.js +70 -0
  205. package/src/components/navigation-inspector/index.js +0 -32
  206. package/src/components/navigation-inspector/navigation-menu.js +24 -6
  207. package/src/components/sidebar-edit-mode/index.js +1 -1
  208. package/src/components/sidebar-edit-mode/template-card/index.js +24 -14
  209. package/src/components/sidebar-edit-mode/template-card/last-revision.js +75 -0
  210. package/src/components/sidebar-edit-mode/template-card/style.scss +4 -0
  211. package/src/components/sidebar-navigation-screen-navigation-menus/index.js +7 -1
  212. package/src/components/sidebar-navigation-screen-navigation-menus/style.scss +0 -4
  213. package/src/components/start-template-options/index.js +171 -0
  214. package/src/components/start-template-options/style.scss +76 -0
  215. package/src/hooks/push-changes-to-global-styles/index.js +26 -21
  216. package/src/store/actions.js +2 -2
  217. package/src/style.scss +1 -0
@@ -11,14 +11,14 @@ import {
11
11
  * Internal dependencies
12
12
  */
13
13
  import ScreenHeader from './header';
14
- import { getSupportedGlobalStylesPanels, useColorsPerOrigin } from './hooks';
14
+ import { useSupportedStyles, useColorsPerOrigin } from './hooks';
15
15
  import { unlock } from '../../private-apis';
16
16
 
17
17
  const { useGlobalSetting, useGlobalStyle } = unlock( blockEditorPrivateApis );
18
18
 
19
19
  function ScreenButtonColor( { name, variation = '' } ) {
20
20
  const prefix = variation ? `variations.${ variation }.` : '';
21
- const supports = getSupportedGlobalStylesPanels( name );
21
+ const supports = useSupportedStyles( name );
22
22
  const colorsPerOrigin = useColorsPerOrigin( name );
23
23
  const [ areCustomSolidsEnabled ] = useGlobalSetting( 'color.custom', name );
24
24
  const [ isBackgroundEnabled ] = useGlobalSetting(
@@ -64,9 +64,9 @@ function ScreenButtonColor( { name, variation = '' } ) {
64
64
  ) }
65
65
  />
66
66
 
67
- <h4 className="edit-site-global-styles-section-title">
67
+ <h3 className="edit-site-global-styles-section-title">
68
68
  { __( 'Text color' ) }
69
- </h4>
69
+ </h3>
70
70
 
71
71
  <ColorGradientControl
72
72
  className="edit-site-screen-button-color__control"
@@ -78,11 +78,12 @@ function ScreenButtonColor( { name, variation = '' } ) {
78
78
  colorValue={ buttonTextColor }
79
79
  onColorChange={ setButtonTextColor }
80
80
  clearable={ buttonTextColor === userButtonTextColor }
81
+ headingLevel={ 4 }
81
82
  />
82
83
 
83
- <h4 className="edit-site-global-styles-section-title">
84
+ <h3 className="edit-site-global-styles-section-title">
84
85
  { __( 'Background color' ) }
85
- </h4>
86
+ </h3>
86
87
 
87
88
  <ColorGradientControl
88
89
  className="edit-site-screen-button-color__control"
@@ -94,6 +95,7 @@ function ScreenButtonColor( { name, variation = '' } ) {
94
95
  colorValue={ buttonBgColor }
95
96
  onColorChange={ setButtonBgColor }
96
97
  clearable={ buttonBgColor === userButtonBgColor }
98
+ headingLevel={ 4 }
97
99
  />
98
100
  </>
99
101
  );
@@ -18,7 +18,7 @@ import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
18
18
  import ScreenHeader from './header';
19
19
  import Palette from './palette';
20
20
  import { NavigationButtonAsItem } from './navigation-button';
21
- import { getSupportedGlobalStylesPanels } from './hooks';
21
+ import { useSupportedStyles } from './hooks';
22
22
  import Subtitle from './subtitle';
23
23
  import ColorIndicatorWrapper from './color-indicator-wrapper';
24
24
  import BlockPreviewPanel from './block-preview-panel';
@@ -30,7 +30,7 @@ const { useGlobalStyle } = unlock( blockEditorPrivateApis );
30
30
  function BackgroundColorItem( { name, parentMenu, variation = '' } ) {
31
31
  const prefix = variation ? `variations.${ variation }.` : '';
32
32
  const urlPrefix = variation ? `/variations/${ variation }` : '';
33
- const supports = getSupportedGlobalStylesPanels( name );
33
+ const supports = useSupportedStyles( name );
34
34
  const hasSupport =
35
35
  supports.includes( 'backgroundColor' ) ||
36
36
  supports.includes( 'background' );
@@ -67,7 +67,7 @@ function BackgroundColorItem( { name, parentMenu, variation = '' } ) {
67
67
  function TextColorItem( { name, parentMenu, variation = '' } ) {
68
68
  const prefix = variation ? `variations.${ variation }.` : '';
69
69
  const urlPrefix = variation ? `/variations/${ variation }` : '';
70
- const supports = getSupportedGlobalStylesPanels( name );
70
+ const supports = useSupportedStyles( name );
71
71
  const hasSupport = supports.includes( 'color' );
72
72
  const [ color ] = useGlobalStyle( prefix + 'color.text', name );
73
73
 
@@ -98,7 +98,7 @@ function TextColorItem( { name, parentMenu, variation = '' } ) {
98
98
  function LinkColorItem( { name, parentMenu, variation = '' } ) {
99
99
  const prefix = variation ? `variations.${ variation }.` : '';
100
100
  const urlPrefix = variation ? `/variations/${ variation }` : '';
101
- const supports = getSupportedGlobalStylesPanels( name );
101
+ const supports = useSupportedStyles( name );
102
102
  const hasSupport = supports.includes( 'linkColor' );
103
103
  const [ color ] = useGlobalStyle(
104
104
  prefix + 'elements.link.color.text',
@@ -138,7 +138,7 @@ function LinkColorItem( { name, parentMenu, variation = '' } ) {
138
138
  function HeadingColorItem( { name, parentMenu, variation = '' } ) {
139
139
  const prefix = variation ? `variations.${ variation }.` : '';
140
140
  const urlPrefix = variation ? `/variations/${ variation }` : '';
141
- const supports = getSupportedGlobalStylesPanels( name );
141
+ const supports = useSupportedStyles( name );
142
142
  const hasSupport = supports.includes( 'color' );
143
143
  const [ color ] = useGlobalStyle(
144
144
  prefix + 'elements.heading.color.text',
@@ -176,7 +176,7 @@ function HeadingColorItem( { name, parentMenu, variation = '' } ) {
176
176
  function ButtonColorItem( { name, parentMenu, variation = '' } ) {
177
177
  const prefix = variation ? `variations.${ variation }.` : '';
178
178
  const urlPrefix = variation ? `/variations/${ variation }` : '';
179
- const supports = getSupportedGlobalStylesPanels( name );
179
+ const supports = useSupportedStyles( name );
180
180
  const hasSupport = supports.includes( 'buttonColor' );
181
181
  const [ color ] = useGlobalStyle(
182
182
  prefix + 'elements.button.color.text',
@@ -233,7 +233,7 @@ function ScreenColors( { name, variation = '' } ) {
233
233
  <Palette name={ name } />
234
234
 
235
235
  <VStack spacing={ 3 }>
236
- <Subtitle>{ __( 'Elements' ) }</Subtitle>
236
+ <Subtitle level={ 3 }>{ __( 'Elements' ) }</Subtitle>
237
237
  <ItemGroup isBordered isSeparated>
238
238
  <BackgroundColorItem
239
239
  name={ name }
@@ -0,0 +1,27 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { __ } from '@wordpress/i18n';
5
+
6
+ /**
7
+ * Internal dependencies
8
+ */
9
+ import DuotonePanel from './duotone-panel';
10
+ import BlockPreviewPanel from './block-preview-panel';
11
+
12
+ /**
13
+ * Internal dependencies
14
+ */
15
+ import ScreenHeader from './header';
16
+
17
+ function ScreenFilters( { name } ) {
18
+ return (
19
+ <>
20
+ <ScreenHeader title={ __( 'Filters' ) } />
21
+ <BlockPreviewPanel name={ name } />
22
+ <DuotonePanel name={ name } />
23
+ </>
24
+ );
25
+ }
26
+
27
+ export default ScreenFilters;
@@ -17,7 +17,7 @@ import { useState } from '@wordpress/element';
17
17
  */
18
18
  import ScreenHeader from './header';
19
19
  import {
20
- getSupportedGlobalStylesPanels,
20
+ useSupportedStyles,
21
21
  useColorsPerOrigin,
22
22
  useGradientsPerOrigin,
23
23
  } from './hooks';
@@ -28,7 +28,7 @@ const { useGlobalSetting, useGlobalStyle } = unlock( blockEditorPrivateApis );
28
28
  function ScreenHeadingColor( { name, variation = '' } ) {
29
29
  const prefix = variation ? `variations.${ variation }.` : '';
30
30
  const [ selectedLevel, setCurrentTab ] = useState( 'heading' );
31
- const supports = getSupportedGlobalStylesPanels( name );
31
+ const supports = useSupportedStyles( name );
32
32
  const [ areCustomSolidsEnabled ] = useGlobalSetting( 'color.custom', name );
33
33
  const [ areCustomGradientsEnabled ] = useGlobalSetting(
34
34
  'color.customGradient',
@@ -125,7 +125,7 @@ function ScreenHeadingColor( { name, variation = '' } ) {
125
125
  ) }
126
126
  />
127
127
  <div className="edit-site-global-styles-screen-heading-color">
128
- <h4>{ __( 'Select heading level' ) }</h4>
128
+ <h3>{ __( 'Select heading level' ) }</h3>
129
129
 
130
130
  <ToggleGroupControl
131
131
  __nextHasNoMarginBottom
@@ -151,7 +151,7 @@ function ScreenHeadingColor( { name, variation = '' } ) {
151
151
  </div>
152
152
  { hasTextColor && (
153
153
  <div className="edit-site-global-styles-screen-heading-color">
154
- <h4>
154
+ <h3>
155
155
  { selectedLevel === 'heading'
156
156
  ? __( 'Text color for all heading levels' )
157
157
  : sprintf(
@@ -159,7 +159,7 @@ function ScreenHeadingColor( { name, variation = '' } ) {
159
159
  __( 'Text color for %s' ),
160
160
  selectedLevel.toUpperCase()
161
161
  ) }
162
- </h4>
162
+ </h3>
163
163
  <ColorGradientControl
164
164
  className="edit-site-screen-heading-text-color__control"
165
165
  colors={ colorsPerOrigin }
@@ -170,12 +170,13 @@ function ScreenHeadingColor( { name, variation = '' } ) {
170
170
  colorValue={ color }
171
171
  onColorChange={ setColor }
172
172
  clearable={ color === userColor }
173
+ headingLevel={ 4 }
173
174
  />
174
175
  </div>
175
176
  ) }
176
177
  { hasBackgroundColor && (
177
178
  <div className="edit-site-global-styles-screen-heading-color">
178
- <h4>
179
+ <h3>
179
180
  { selectedLevel === 'heading'
180
181
  ? __( 'Background color for all heading levels' )
181
182
  : sprintf(
@@ -183,7 +184,7 @@ function ScreenHeadingColor( { name, variation = '' } ) {
183
184
  __( 'Background color for %s' ),
184
185
  selectedLevel.toUpperCase()
185
186
  ) }
186
- </h4>
187
+ </h3>
187
188
  <ColorGradientControl
188
189
  className="edit-site-screen-heading-background-color__control"
189
190
  colors={ colorsPerOrigin }
@@ -193,6 +194,7 @@ function ScreenHeadingColor( { name, variation = '' } ) {
193
194
  showTitle={ false }
194
195
  enableAlpha
195
196
  __experimentalIsRenderedInSidebar
197
+ headingLevel={ 4 }
196
198
  { ...controlProps }
197
199
  />
198
200
  </div>
@@ -2,17 +2,24 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import { __ } from '@wordpress/i18n';
5
+ import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
5
6
 
6
7
  /**
7
8
  * Internal dependencies
8
9
  */
9
- import DimensionsPanel, { useHasDimensionsPanel } from './dimensions-panel';
10
+ import DimensionsPanel from './dimensions-panel';
10
11
  import ScreenHeader from './header';
11
12
  import BlockPreviewPanel from './block-preview-panel';
12
13
  import { getVariationClassName } from './utils';
14
+ import { unlock } from '../../private-apis';
15
+
16
+ const { useHasDimensionsPanel, useGlobalSetting, useSettingsForBlockElement } =
17
+ unlock( blockEditorPrivateApis );
13
18
 
14
19
  function ScreenLayout( { name, variation = '' } ) {
15
- const hasDimensionsPanel = useHasDimensionsPanel( name );
20
+ const [ rawSettings ] = useGlobalSetting( '', name );
21
+ const settings = useSettingsForBlockElement( rawSettings, name );
22
+ const hasDimensionsPanel = useHasDimensionsPanel( settings );
16
23
  const variationClassName = getVariationClassName( variation );
17
24
  return (
18
25
  <>
@@ -12,14 +12,14 @@ import { TabPanel } from '@wordpress/components';
12
12
  * Internal dependencies
13
13
  */
14
14
  import ScreenHeader from './header';
15
- import { getSupportedGlobalStylesPanels, useColorsPerOrigin } from './hooks';
15
+ import { useSupportedStyles, useColorsPerOrigin } from './hooks';
16
16
  import { unlock } from '../../private-apis';
17
17
 
18
18
  const { useGlobalSetting, useGlobalStyle } = unlock( blockEditorPrivateApis );
19
19
 
20
20
  function ScreenLinkColor( { name, variation = '' } ) {
21
21
  const prefix = variation ? `variations.${ variation }.` : '';
22
- const supports = getSupportedGlobalStylesPanels( name );
22
+ const supports = useSupportedStyles( name );
23
23
  const [ areCustomSolidsEnabled ] = useGlobalSetting( 'color.custom', name );
24
24
  const colorsPerOrigin = useColorsPerOrigin( name );
25
25
  const [ isLinkEnabled ] = useGlobalSetting( 'color.link', name );
@@ -111,6 +111,7 @@ function ScreenLinkColor( { name, variation = '' } ) {
111
111
  pseudoSelectorConfig.value ===
112
112
  pseudoSelectorConfig.userValue
113
113
  }
114
+ headingLevel={ 3 }
114
115
  />
115
116
  </>
116
117
  );
@@ -11,14 +11,14 @@ import {
11
11
  * Internal dependencies
12
12
  */
13
13
  import ScreenHeader from './header';
14
- import { getSupportedGlobalStylesPanels, useColorsPerOrigin } from './hooks';
14
+ import { useSupportedStyles, useColorsPerOrigin } from './hooks';
15
15
  import { unlock } from '../../private-apis';
16
16
 
17
17
  const { useGlobalSetting, useGlobalStyle } = unlock( blockEditorPrivateApis );
18
18
 
19
19
  function ScreenTextColor( { name, variation = '' } ) {
20
20
  const prefix = variation ? `variations.${ variation }.` : '';
21
- const supports = getSupportedGlobalStylesPanels( name );
21
+ const supports = useSupportedStyles( name );
22
22
  const [ areCustomSolidsEnabled ] = useGlobalSetting( 'color.custom', name );
23
23
  const [ isTextEnabled ] = useGlobalSetting( 'color.text', name );
24
24
  const colorsPerOrigin = useColorsPerOrigin( name );
@@ -53,6 +53,7 @@ function ScreenTextColor( { name, variation = '' } ) {
53
53
  colorValue={ color }
54
54
  onColorChange={ setColor }
55
55
  clearable={ color === userColor }
56
+ headingLevel={ 3 }
56
57
  />
57
58
  </>
58
59
  );
@@ -109,7 +109,7 @@ function ScreenTypography( { name, variation = '' } ) {
109
109
  { ! name && (
110
110
  <div className="edit-site-global-styles-screen-typography">
111
111
  <VStack spacing={ 3 }>
112
- <Subtitle>{ __( 'Elements' ) }</Subtitle>
112
+ <Subtitle level={ 3 }>{ __( 'Elements' ) }</Subtitle>
113
113
  <ItemGroup isBordered isSeparated>
114
114
  <Item
115
115
  name={ name }
@@ -27,14 +27,14 @@ import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
27
27
  /**
28
28
  * Internal dependencies
29
29
  */
30
- import { getSupportedGlobalStylesPanels } from './hooks';
30
+ import { useSupportedStyles } from './hooks';
31
31
  import { IconWithCurrentColor } from './icon-with-current-color';
32
32
  import { unlock } from '../../private-apis';
33
33
 
34
34
  const { useGlobalSetting, useGlobalStyle } = unlock( blockEditorPrivateApis );
35
35
 
36
36
  export function useHasShadowControl( name ) {
37
- const supports = getSupportedGlobalStylesPanels( name );
37
+ const supports = useSupportedStyles( name );
38
38
  return supports.includes( 'shadow' );
39
39
  }
40
40
 
@@ -44,7 +44,10 @@ export default function ShadowPanel( { name, variation = '' } ) {
44
44
  const [ userShadow ] = useGlobalStyle( `${ prefix }shadow`, name, 'user' );
45
45
  const hasShadow = () => !! userShadow;
46
46
 
47
- const resetShadow = () => setShadow( undefined );
47
+ const resetShadow = useCallback(
48
+ () => setShadow( undefined ),
49
+ [ setShadow ]
50
+ );
48
51
  const resetAll = useCallback(
49
52
  () => resetShadow( undefined ),
50
53
  [ resetShadow ]
@@ -62,6 +62,11 @@
62
62
  padding: 0 $grid-unit-20;
63
63
  }
64
64
 
65
+ .edit-site-global-styles-header {
66
+ // Need to override the too specific bottom margin for complementary areas.
67
+ margin-bottom: 0 !important;
68
+ }
69
+
65
70
  .edit-site-global-styles-subtitle {
66
71
  // Need to override the too specific styles for complementary areas.
67
72
  margin-bottom: 0 !important;
@@ -3,9 +3,12 @@
3
3
  */
4
4
  import { __experimentalHeading as Heading } from '@wordpress/components';
5
5
 
6
- function Subtitle( { children } ) {
6
+ function Subtitle( { children, level } ) {
7
7
  return (
8
- <Heading className="edit-site-global-styles-subtitle" level={ 2 }>
8
+ <Heading
9
+ className="edit-site-global-styles-subtitle"
10
+ level={ level ?? 2 }
11
+ >
9
12
  { children }
10
13
  </Heading>
11
14
  );