@wordpress/edit-site 3.0.18-next.33ec3857e2.0 → 3.0.18

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 (73) hide show
  1. package/build/components/block-editor/resizable-editor.js +0 -1
  2. package/build/components/block-editor/resizable-editor.js.map +1 -1
  3. package/build/components/global-styles/border-panel.js +22 -81
  4. package/build/components/global-styles/border-panel.js.map +1 -1
  5. package/build/components/global-styles/gradients-palette-panel.js +7 -3
  6. package/build/components/global-styles/gradients-palette-panel.js.map +1 -1
  7. package/build/components/global-styles/screen-background-color.js +10 -9
  8. package/build/components/global-styles/screen-background-color.js.map +1 -1
  9. package/build/components/global-styles/screen-colors.js +1 -1
  10. package/build/components/global-styles/screen-colors.js.map +1 -1
  11. package/build/components/global-styles/screen-link-color.js +10 -6
  12. package/build/components/global-styles/screen-link-color.js.map +1 -1
  13. package/build/components/global-styles/screen-text-color.js +10 -6
  14. package/build/components/global-styles/screen-text-color.js.map +1 -1
  15. package/build/components/global-styles/ui.js +14 -27
  16. package/build/components/global-styles/ui.js.map +1 -1
  17. package/build/components/list/actions/index.js +0 -1
  18. package/build/components/list/actions/index.js.map +1 -1
  19. package/build/components/list/added-by.js +9 -3
  20. package/build/components/list/added-by.js.map +1 -1
  21. package/build/components/navigation-sidebar/navigation-toggle/index.js +10 -1
  22. package/build/components/navigation-sidebar/navigation-toggle/index.js.map +1 -1
  23. package/build/components/sidebar/default-sidebar.js +2 -4
  24. package/build/components/sidebar/default-sidebar.js.map +1 -1
  25. package/build/components/sidebar/global-styles-sidebar.js +0 -1
  26. package/build/components/sidebar/global-styles-sidebar.js.map +1 -1
  27. package/build-module/components/block-editor/resizable-editor.js +0 -1
  28. package/build-module/components/block-editor/resizable-editor.js.map +1 -1
  29. package/build-module/components/global-styles/border-panel.js +23 -82
  30. package/build-module/components/global-styles/border-panel.js.map +1 -1
  31. package/build-module/components/global-styles/gradients-palette-panel.js +5 -4
  32. package/build-module/components/global-styles/gradients-palette-panel.js.map +1 -1
  33. package/build-module/components/global-styles/screen-background-color.js +11 -9
  34. package/build-module/components/global-styles/screen-background-color.js.map +1 -1
  35. package/build-module/components/global-styles/screen-colors.js +1 -1
  36. package/build-module/components/global-styles/screen-colors.js.map +1 -1
  37. package/build-module/components/global-styles/screen-link-color.js +11 -7
  38. package/build-module/components/global-styles/screen-link-color.js.map +1 -1
  39. package/build-module/components/global-styles/screen-text-color.js +11 -7
  40. package/build-module/components/global-styles/screen-text-color.js.map +1 -1
  41. package/build-module/components/global-styles/ui.js +14 -26
  42. package/build-module/components/global-styles/ui.js.map +1 -1
  43. package/build-module/components/list/actions/index.js +0 -1
  44. package/build-module/components/list/actions/index.js.map +1 -1
  45. package/build-module/components/list/added-by.js +10 -4
  46. package/build-module/components/list/added-by.js.map +1 -1
  47. package/build-module/components/navigation-sidebar/navigation-toggle/index.js +11 -1
  48. package/build-module/components/navigation-sidebar/navigation-toggle/index.js.map +1 -1
  49. package/build-module/components/sidebar/default-sidebar.js +2 -4
  50. package/build-module/components/sidebar/default-sidebar.js.map +1 -1
  51. package/build-module/components/sidebar/global-styles-sidebar.js +0 -1
  52. package/build-module/components/sidebar/global-styles-sidebar.js.map +1 -1
  53. package/build-style/style-rtl.css +55 -29
  54. package/build-style/style.css +55 -29
  55. package/package.json +28 -28
  56. package/src/components/block-editor/resizable-editor.js +0 -1
  57. package/src/components/block-editor/style.scss +18 -10
  58. package/src/components/global-styles/border-panel.js +42 -106
  59. package/src/components/global-styles/gradients-palette-panel.js +4 -4
  60. package/src/components/global-styles/screen-background-color.js +10 -7
  61. package/src/components/global-styles/screen-colors.js +1 -1
  62. package/src/components/global-styles/screen-link-color.js +14 -6
  63. package/src/components/global-styles/screen-text-color.js +14 -6
  64. package/src/components/global-styles/style.scss +17 -0
  65. package/src/components/global-styles/ui.js +25 -50
  66. package/src/components/header/document-actions/style.scss +9 -1
  67. package/src/components/header/style.scss +1 -2
  68. package/src/components/list/actions/index.js +0 -1
  69. package/src/components/list/added-by.js +25 -9
  70. package/src/components/navigation-sidebar/navigation-toggle/index.js +12 -0
  71. package/src/components/sidebar/default-sidebar.js +0 -2
  72. package/src/components/sidebar/global-styles-sidebar.js +0 -1
  73. package/src/components/sidebar/style.scss +14 -21
@@ -7,8 +7,7 @@ import {
7
7
  __experimentalColorGradientControl as ColorGradientControl,
8
8
  } from '@wordpress/block-editor';
9
9
  import {
10
- __experimentalToolsPanel as ToolsPanel,
11
- __experimentalToolsPanelItem as ToolsPanelItem,
10
+ PanelBody,
12
11
  __experimentalUnitControl as UnitControl,
13
12
  __experimentalUseCustomUnits as useCustomUnits,
14
13
  } from '@wordpress/components';
@@ -69,18 +68,6 @@ function useHasBorderWidthControl( name ) {
69
68
  }
70
69
 
71
70
  export default function BorderPanel( { name } ) {
72
- // To better reflect if the user has customized a value we need to
73
- // ensure the style value being checked is from the `user` origin.
74
- const [ userBorderStyles ] = useStyle( 'border', name, 'user' );
75
- const createHasValueCallback = ( feature ) => () =>
76
- !! userBorderStyles?.[ feature ];
77
-
78
- const createResetCallback = ( setStyle ) => () => setStyle( undefined );
79
-
80
- const handleOnChange = ( setStyle ) => ( value ) => {
81
- setStyle( value || undefined );
82
- };
83
-
84
71
  const units = useCustomUnits( {
85
72
  availableUnits: useSetting( 'spacing.units' )[ 0 ] || [
86
73
  'px',
@@ -90,121 +77,70 @@ export default function BorderPanel( { name } ) {
90
77
  } );
91
78
 
92
79
  // Border width.
93
- const showBorderWidth = useHasBorderWidthControl( name );
80
+ const hasBorderWidth = useHasBorderWidthControl( name );
94
81
  const [ borderWidthValue, setBorderWidth ] = useStyle(
95
82
  'border.width',
96
83
  name
97
84
  );
98
85
 
99
86
  // Border style.
100
- const showBorderStyle = useHasBorderStyleControl( name );
87
+ const hasBorderStyle = useHasBorderStyleControl( name );
101
88
  const [ borderStyle, setBorderStyle ] = useStyle( 'border.style', name );
102
89
 
103
90
  // Border color.
104
- const showBorderColor = useHasBorderColorControl( name );
105
- const [ borderColor, setBorderColor ] = useStyle( 'border.color', name );
106
91
  const [ colors = EMPTY_ARRAY ] = useSetting( 'color.palette' );
107
92
  const disableCustomColors = ! useSetting( 'color.custom' )[ 0 ];
108
93
  const disableCustomGradients = ! useSetting( 'color.customGradient' )[ 0 ];
94
+ const hasBorderColor = useHasBorderColorControl( name );
95
+ const [ borderColor, setBorderColor ] = useStyle( 'border.color', name );
109
96
 
110
97
  // Border radius.
111
- const showBorderRadius = useHasBorderRadiusControl( name );
98
+ const hasBorderRadius = useHasBorderRadiusControl( name );
112
99
  const [ borderRadiusValues, setBorderRadius ] = useStyle(
113
100
  'border.radius',
114
101
  name
115
102
  );
116
- const hasBorderRadius = () => {
117
- const borderValues = userBorderStyles?.radius;
118
- if ( typeof borderValues === 'object' ) {
119
- return Object.entries( borderValues ).some( Boolean );
120
- }
121
- return !! borderValues;
122
- };
123
-
124
- const resetAll = () => {
125
- setBorderColor( undefined );
126
- setBorderRadius( undefined );
127
- setBorderStyle( undefined );
128
- setBorderWidth( undefined );
129
- };
130
-
131
- // When we set a border color or width ensure we have a style so the user
132
- // can see a visible border.
133
- const handleOnChangeWithStyle = ( setStyle ) => ( value ) => {
134
- if ( !! value && ! borderStyle ) {
135
- setBorderStyle( 'solid' );
136
- }
137
-
138
- setStyle( value || undefined );
139
- };
140
103
 
141
104
  return (
142
- <ToolsPanel label={ __( 'Border' ) } resetAll={ resetAll }>
143
- { showBorderWidth && (
144
- <ToolsPanelItem
145
- className="single-column"
146
- hasValue={ createHasValueCallback( 'width' ) }
147
- label={ __( 'Width' ) }
148
- onDeselect={ createResetCallback( setBorderWidth ) }
149
- isShownByDefault={ true }
150
- >
151
- <UnitControl
152
- value={ borderWidthValue }
153
- label={ __( 'Width' ) }
154
- min={ MIN_BORDER_WIDTH }
155
- onChange={ handleOnChangeWithStyle( setBorderWidth ) }
156
- units={ units }
157
- />
158
- </ToolsPanelItem>
159
- ) }
160
- { showBorderStyle && (
161
- <ToolsPanelItem
162
- className="single-column"
163
- hasValue={ createHasValueCallback( 'style' ) }
164
- label={ __( 'Style' ) }
165
- onDeselect={ createResetCallback( setBorderStyle ) }
166
- isShownByDefault={ true }
167
- >
168
- <BorderStyleControl
169
- value={ borderStyle }
170
- onChange={ handleOnChange( setBorderStyle ) }
171
- />
172
- </ToolsPanelItem>
105
+ <PanelBody title={ __( 'Border' ) } initialOpen={ true }>
106
+ { ( hasBorderWidth || hasBorderStyle ) && (
107
+ <div className="edit-site-global-styles-sidebar__border-controls-row">
108
+ { hasBorderWidth && (
109
+ <UnitControl
110
+ value={ borderWidthValue }
111
+ label={ __( 'Width' ) }
112
+ min={ MIN_BORDER_WIDTH }
113
+ onChange={ ( value ) => {
114
+ setBorderWidth( value || undefined );
115
+ } }
116
+ units={ units }
117
+ />
118
+ ) }
119
+ { hasBorderStyle && (
120
+ <BorderStyleControl
121
+ value={ borderStyle }
122
+ onChange={ setBorderStyle }
123
+ />
124
+ ) }
125
+ </div>
173
126
  ) }
174
- { showBorderColor && (
175
- <ToolsPanelItem
176
- hasValue={ createHasValueCallback( 'color' ) }
127
+ { hasBorderColor && (
128
+ <ColorGradientControl
177
129
  label={ __( 'Color' ) }
178
- onDeselect={ createResetCallback( setBorderColor ) }
179
- isShownByDefault={ true }
180
- >
181
- <ColorGradientControl
182
- label={ __( 'Color' ) }
183
- colorValue={ borderColor }
184
- colors={ colors }
185
- gradients={ undefined }
186
- disableCustomColors={ disableCustomColors }
187
- disableCustomGradients={ disableCustomGradients }
188
- onColorChange={ handleOnChangeWithStyle(
189
- setBorderColor
190
- ) }
191
- clearable={ false }
192
- />
193
- </ToolsPanelItem>
130
+ colorValue={ borderColor }
131
+ colors={ colors }
132
+ gradients={ undefined }
133
+ disableCustomColors={ disableCustomColors }
134
+ disableCustomGradients={ disableCustomGradients }
135
+ onColorChange={ setBorderColor }
136
+ />
194
137
  ) }
195
- { showBorderRadius && (
196
- <ToolsPanelItem
197
- hasValue={ hasBorderRadius }
198
- label={ __( 'Radius' ) }
199
- onDeselect={ createResetCallback( setBorderRadius ) }
200
- isShownByDefault={ true }
201
- >
202
- <BorderRadiusControl
203
- values={ borderRadiusValues }
204
- onChange={ handleOnChange( setBorderRadius ) }
205
- />
206
- </ToolsPanelItem>
138
+ { hasBorderRadius && (
139
+ <BorderRadiusControl
140
+ values={ borderRadiusValues }
141
+ onChange={ setBorderRadius }
142
+ />
207
143
  ) }
208
- </ToolsPanel>
144
+ </PanelBody>
209
145
  );
210
146
  }
@@ -9,8 +9,8 @@ import { noop } from 'lodash';
9
9
  import {
10
10
  __experimentalVStack as VStack,
11
11
  __experimentalPaletteEdit as PaletteEdit,
12
+ __experimentalSpacer as Spacer,
12
13
  DuotonePicker,
13
- __experimentalHeading as Heading,
14
14
  } from '@wordpress/components';
15
15
  import { __ } from '@wordpress/i18n';
16
16
 
@@ -18,6 +18,7 @@ import { __ } from '@wordpress/i18n';
18
18
  * Internal dependencies
19
19
  */
20
20
  import { useSetting } from './hooks';
21
+ import Subtitle from './subtitle';
21
22
 
22
23
  export default function GradientPalettePanel( { name } ) {
23
24
  const [ themeGradients, setThemeGradients ] = useSetting(
@@ -83,9 +84,8 @@ export default function GradientPalettePanel( { name } ) {
83
84
  slugPrefix="custom-"
84
85
  />
85
86
  <div>
86
- <Heading className="edit-site-global-styles-gradient-palette-panel__duotone-heading">
87
- { __( 'Duotone' ) }
88
- </Heading>
87
+ <Subtitle>{ __( 'Duotone' ) }</Subtitle>
88
+ <Spacer margin={ 3 } />
89
89
  <DuotonePicker
90
90
  duotonePalette={ duotonePalette }
91
91
  disableCustomDuotone={ true }
@@ -2,7 +2,7 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import { __ } from '@wordpress/i18n';
5
- import { __experimentalColorGradientControl as ColorGradientControl } from '@wordpress/block-editor';
5
+ import { __experimentalPanelColorGradientSettings as PanelColorGradientSettings } from '@wordpress/block-editor';
6
6
 
7
7
  /**
8
8
  * Internal dependencies
@@ -55,6 +55,7 @@ function ScreenBackgroundColor( { name } ) {
55
55
  return null;
56
56
  }
57
57
 
58
+ const settings = [];
58
59
  let backgroundSettings = {};
59
60
  if ( hasBackgroundColor ) {
60
61
  backgroundSettings = {
@@ -78,10 +79,11 @@ function ScreenBackgroundColor( { name } ) {
78
79
  }
79
80
  }
80
81
 
81
- const controlProps = {
82
+ settings.push( {
82
83
  ...backgroundSettings,
83
84
  ...gradientSettings,
84
- };
85
+ label: __( 'Background color' ),
86
+ } );
85
87
 
86
88
  return (
87
89
  <>
@@ -89,11 +91,13 @@ function ScreenBackgroundColor( { name } ) {
89
91
  back={ parentMenu + '/colors' }
90
92
  title={ __( 'Background' ) }
91
93
  description={ __(
92
- 'Set a background color or gradient for the whole site.'
94
+ 'Set a background color or gradient for the whole website.'
93
95
  ) }
94
96
  />
95
- <ColorGradientControl
96
- className="edit-site-screen-background-color__control"
97
+
98
+ <PanelColorGradientSettings
99
+ title={ __( 'Color' ) }
100
+ settings={ settings }
97
101
  colors={ colorsPerOrigin }
98
102
  gradients={ gradientsPerOrigin }
99
103
  disableCustomColors={ ! areCustomSolidsEnabled }
@@ -102,7 +106,6 @@ function ScreenBackgroundColor( { name } ) {
102
106
  showTitle={ false }
103
107
  enableAlpha
104
108
  __experimentalIsRenderedInSidebar
105
- { ...controlProps }
106
109
  />
107
110
  </>
108
111
  );
@@ -96,7 +96,7 @@ function ScreenColors( { name } ) {
96
96
  back={ parentMenu ? parentMenu : '/' }
97
97
  title={ __( 'Colors' ) }
98
98
  description={ __(
99
- 'Manage palettes and the default color of different global elements on the site.'
99
+ 'Manage palettes and the default color of different global elements on the website.'
100
100
  ) }
101
101
  />
102
102
 
@@ -2,7 +2,7 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import { __ } from '@wordpress/i18n';
5
- import { __experimentalColorGradientControl as ColorGradientControl } from '@wordpress/block-editor';
5
+ import { __experimentalPanelColorGradientSettings as PanelColorGradientSettings } from '@wordpress/block-editor';
6
6
 
7
7
  /**
8
8
  * Internal dependencies
@@ -44,6 +44,15 @@ function ScreenLinkColor( { name } ) {
44
44
  return null;
45
45
  }
46
46
 
47
+ const settings = [
48
+ {
49
+ colorValue: linkColor,
50
+ onColorChange: setLinkColor,
51
+ label: __( 'Link color' ),
52
+ clearable: linkColor === userLinkColor,
53
+ },
54
+ ];
55
+
47
56
  return (
48
57
  <>
49
58
  <ScreenHeader
@@ -53,17 +62,16 @@ function ScreenLinkColor( { name } ) {
53
62
  'Set the default color used for links across the site.'
54
63
  ) }
55
64
  />
56
- <ColorGradientControl
57
- className="edit-site-screen-link-color__control"
65
+
66
+ <PanelColorGradientSettings
67
+ title={ __( 'Color' ) }
68
+ settings={ settings }
58
69
  colors={ colorsPerOrigin }
59
70
  disableCustomColors={ ! areCustomSolidsEnabled }
60
71
  __experimentalHasMultipleOrigins
61
72
  showTitle={ false }
62
73
  enableAlpha
63
74
  __experimentalIsRenderedInSidebar
64
- colorValue={ linkColor }
65
- onColorChange={ setLinkColor }
66
- clearable={ linkColor === userLinkColor }
67
75
  />
68
76
  </>
69
77
  );
@@ -2,7 +2,7 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import { __ } from '@wordpress/i18n';
5
- import { __experimentalColorGradientControl as ColorGradientControl } from '@wordpress/block-editor';
5
+ import { __experimentalPanelColorGradientSettings as PanelColorGradientSettings } from '@wordpress/block-editor';
6
6
 
7
7
  /**
8
8
  * Internal dependencies
@@ -36,6 +36,15 @@ function ScreenTextColor( { name } ) {
36
36
  return null;
37
37
  }
38
38
 
39
+ const settings = [
40
+ {
41
+ colorValue: color,
42
+ onColorChange: setColor,
43
+ label: __( 'Text color' ),
44
+ clearable: color === userColor,
45
+ },
46
+ ];
47
+
39
48
  return (
40
49
  <>
41
50
  <ScreenHeader
@@ -45,17 +54,16 @@ function ScreenTextColor( { name } ) {
45
54
  'Set the default color used for text across the site.'
46
55
  ) }
47
56
  />
48
- <ColorGradientControl
49
- className="edit-site-screen-text-color__control"
57
+
58
+ <PanelColorGradientSettings
59
+ title={ __( 'Color' ) }
60
+ settings={ settings }
50
61
  colors={ colorsPerOrigin }
51
62
  disableCustomColors={ ! areCustomSolidsEnabled }
52
63
  __experimentalHasMultipleOrigins
53
64
  showTitle={ false }
54
65
  enableAlpha
55
66
  __experimentalIsRenderedInSidebar
56
- colorValue={ color }
57
- onColorChange={ setColor }
58
- clearable={ color === userColor }
59
67
  />
60
68
  </>
61
69
  );
@@ -4,6 +4,15 @@
4
4
  justify-content: center;
5
5
  min-height: 152px;
6
6
  line-height: 1;
7
+
8
+ .component-color-indicator {
9
+ border-radius: 50%;
10
+ border: 0;
11
+ height: 36px;
12
+ width: 36px;
13
+ margin-left: 0;
14
+ padding: 0;
15
+ }
7
16
  }
8
17
 
9
18
  .edit-site-typography-panel__preview {
@@ -34,6 +43,14 @@
34
43
  margin: $grid-unit-20;
35
44
 
36
45
  .component-color-indicator {
46
+ margin-left: 0;
47
+ display: block;
48
+ border-radius: 50%;
49
+ height: 24px;
50
+ width: 24px;
51
+ padding: 0;
52
+ border: $border-width solid $gray-300;
53
+
37
54
  // Show a diagonal line (crossed out) for empty swatches.
38
55
  background: linear-gradient(-45deg, transparent 48%, $gray-300 48%, $gray-300 52%, transparent 52%);
39
56
  }
@@ -22,68 +22,46 @@ import ScreenTextColor from './screen-text-color';
22
22
  import ScreenLinkColor from './screen-link-color';
23
23
  import ScreenLayout from './screen-layout';
24
24
 
25
- function GlobalStylesNavigationScreen( { className, ...props } ) {
26
- return (
27
- <NavigatorScreen
28
- className={ [
29
- 'edit-site-global-styles-sidebar__navigator-screen',
30
- className,
31
- ]
32
- .filter( Boolean )
33
- .join( ' ' ) }
34
- { ...props }
35
- />
36
- );
37
- }
38
-
39
25
  function ContextScreens( { name } ) {
40
26
  const parentMenu = name === undefined ? '' : '/blocks/' + name;
41
27
 
42
28
  return (
43
29
  <>
44
- <GlobalStylesNavigationScreen path={ parentMenu + '/typography' }>
30
+ <NavigatorScreen path={ parentMenu + '/typography' }>
45
31
  <ScreenTypography name={ name } />
46
- </GlobalStylesNavigationScreen>
32
+ </NavigatorScreen>
47
33
 
48
- <GlobalStylesNavigationScreen
49
- path={ parentMenu + '/typography/text' }
50
- >
34
+ <NavigatorScreen path={ parentMenu + '/typography/text' }>
51
35
  <ScreenTypographyElement name={ name } element="text" />
52
- </GlobalStylesNavigationScreen>
36
+ </NavigatorScreen>
53
37
 
54
- <GlobalStylesNavigationScreen
55
- path={ parentMenu + '/typography/link' }
56
- >
38
+ <NavigatorScreen path={ parentMenu + '/typography/link' }>
57
39
  <ScreenTypographyElement name={ name } element="link" />
58
- </GlobalStylesNavigationScreen>
40
+ </NavigatorScreen>
59
41
 
60
- <GlobalStylesNavigationScreen path={ parentMenu + '/colors' }>
42
+ <NavigatorScreen path={ parentMenu + '/colors' }>
61
43
  <ScreenColors name={ name } />
62
- </GlobalStylesNavigationScreen>
44
+ </NavigatorScreen>
63
45
 
64
- <GlobalStylesNavigationScreen
65
- path={ parentMenu + '/colors/palette' }
66
- >
46
+ <NavigatorScreen path={ parentMenu + '/colors/palette' }>
67
47
  <ScreenColorPalette name={ name } />
68
- </GlobalStylesNavigationScreen>
48
+ </NavigatorScreen>
69
49
 
70
- <GlobalStylesNavigationScreen
71
- path={ parentMenu + '/colors/background' }
72
- >
50
+ <NavigatorScreen path={ parentMenu + '/colors/background' }>
73
51
  <ScreenBackgroundColor name={ name } />
74
- </GlobalStylesNavigationScreen>
52
+ </NavigatorScreen>
75
53
 
76
- <GlobalStylesNavigationScreen path={ parentMenu + '/colors/text' }>
54
+ <NavigatorScreen path={ parentMenu + '/colors/text' }>
77
55
  <ScreenTextColor name={ name } />
78
- </GlobalStylesNavigationScreen>
56
+ </NavigatorScreen>
79
57
 
80
- <GlobalStylesNavigationScreen path={ parentMenu + '/colors/link' }>
58
+ <NavigatorScreen path={ parentMenu + '/colors/link' }>
81
59
  <ScreenLinkColor name={ name } />
82
- </GlobalStylesNavigationScreen>
60
+ </NavigatorScreen>
83
61
 
84
- <GlobalStylesNavigationScreen path={ parentMenu + '/layout' }>
62
+ <NavigatorScreen path={ parentMenu + '/layout' }>
85
63
  <ScreenLayout name={ name } />
86
- </GlobalStylesNavigationScreen>
64
+ </NavigatorScreen>
87
65
  </>
88
66
  );
89
67
  }
@@ -92,25 +70,22 @@ function GlobalStylesUI() {
92
70
  const blocks = getBlockTypes();
93
71
 
94
72
  return (
95
- <NavigatorProvider
96
- className="edit-site-global-styles-sidebar__navigator-provider"
97
- initialPath="/"
98
- >
99
- <GlobalStylesNavigationScreen path="/">
73
+ <NavigatorProvider initialPath="/">
74
+ <NavigatorScreen path="/">
100
75
  <ScreenRoot />
101
- </GlobalStylesNavigationScreen>
76
+ </NavigatorScreen>
102
77
 
103
- <GlobalStylesNavigationScreen path="/blocks">
78
+ <NavigatorScreen path="/blocks">
104
79
  <ScreenBlockList />
105
- </GlobalStylesNavigationScreen>
80
+ </NavigatorScreen>
106
81
 
107
82
  { blocks.map( ( block ) => (
108
- <GlobalStylesNavigationScreen
83
+ <NavigatorScreen
109
84
  key={ 'menu-block-' + block.name }
110
85
  path={ '/blocks/' + block.name }
111
86
  >
112
87
  <ScreenBlock name={ block.name } />
113
- </GlobalStylesNavigationScreen>
88
+ </NavigatorScreen>
114
89
  ) ) }
115
90
 
116
91
  <ContextScreens />
@@ -2,7 +2,6 @@
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  justify-content: center;
5
- padding: 0 $grid-unit;
6
5
  height: 100%;
7
6
  // Flex items will, by default, refuse to shrink below a minimum
8
7
  // intrinsic width. In order to shrink this flexbox item, and
@@ -41,6 +40,15 @@
41
40
  white-space: nowrap;
42
41
  overflow: hidden;
43
42
  text-overflow: ellipsis;
43
+ max-width: 120px;
44
+
45
+ @include break-medium() {
46
+ max-width: 75px;
47
+ }
48
+
49
+ @include break-xlarge() {
50
+ max-width: 180px;
51
+ }
44
52
  }
45
53
 
46
54
  .edit-site-document-actions__secondary-item {
@@ -25,8 +25,6 @@ $header-toolbar-min-width: 335px;
25
25
  display: flex;
26
26
  align-items: center;
27
27
  height: 100%;
28
- flex-grow: 1;
29
- justify-content: center;
30
28
  // Flex items will, by default, refuse to shrink below a minimum
31
29
  // intrinsic width. In order to shrink this flexbox item, and
32
30
  // subsequently truncate child text, we set an explicit min-width.
@@ -111,6 +109,7 @@ body.is-navigation-sidebar-open {
111
109
  .edit-site-header__actions {
112
110
  display: inline-flex;
113
111
  align-items: center;
112
+ flex-wrap: wrap;
114
113
  padding-right: $grid-unit-05;
115
114
 
116
115
  .interface-pinned-items {
@@ -68,7 +68,6 @@ export default function Actions( { template } ) {
68
68
  />
69
69
  <MenuItem
70
70
  isDestructive
71
- isTertiary
72
71
  onClick={ () => {
73
72
  removeTemplate( template );
74
73
  onClose();
@@ -14,7 +14,11 @@ import {
14
14
  import { store as coreStore } from '@wordpress/core-data';
15
15
  import { useSelect } from '@wordpress/data';
16
16
  import { useState } from '@wordpress/element';
17
- import { layout as themeIcon, plugins as pluginIcon } from '@wordpress/icons';
17
+ import {
18
+ commentAuthorAvatar as authorIcon,
19
+ layout as themeIcon,
20
+ plugins as pluginIcon,
21
+ } from '@wordpress/icons';
18
22
  import { __ } from '@wordpress/i18n';
19
23
 
20
24
  const TEMPLATE_POST_TYPE_NAMES = [ 'wp_template', 'wp_template_part' ];
@@ -77,18 +81,30 @@ function AddedByAuthor( { id } ) {
77
81
  ] );
78
82
  const [ isImageLoaded, setIsImageLoaded ] = useState( false );
79
83
 
84
+ const avatarURL = user?.avatar_urls?.[ 48 ];
85
+ const hasAvatar = !! avatarURL;
86
+
80
87
  return (
81
88
  <HStack alignment="left">
82
89
  <div
83
- className={ classnames( 'edit-site-list-added-by__avatar', {
84
- 'is-loaded': isImageLoaded,
85
- } ) }
90
+ className={ classnames(
91
+ hasAvatar
92
+ ? 'edit-site-list-added-by__avatar'
93
+ : 'edit-site-list-added-by__icon',
94
+ {
95
+ 'is-loaded': isImageLoaded,
96
+ }
97
+ ) }
86
98
  >
87
- <img
88
- onLoad={ () => setIsImageLoaded( true ) }
89
- alt=""
90
- src={ user?.avatar_urls[ 48 ] }
91
- />
99
+ { hasAvatar ? (
100
+ <img
101
+ onLoad={ () => setIsImageLoaded( true ) }
102
+ alt=""
103
+ src={ avatarURL }
104
+ />
105
+ ) : (
106
+ <Icon icon={ authorIcon } />
107
+ ) }
92
108
  </div>
93
109
  <span>{ user?.nickname }</span>
94
110
  </HStack>
@@ -2,6 +2,7 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import { useSelect, useDispatch } from '@wordpress/data';
5
+ import { useEffect, useRef } from '@wordpress/element';
5
6
  import {
6
7
  Button,
7
8
  Icon,
@@ -40,6 +41,16 @@ function NavigationToggle( { icon } ) {
40
41
 
41
42
  const disableMotion = useReducedMotion();
42
43
 
44
+ const navigationToggleRef = useRef();
45
+
46
+ useEffect( () => {
47
+ // TODO: Remove this effect when alternative solution is merged.
48
+ // See: https://github.com/WordPress/gutenberg/pull/37314
49
+ if ( ! isNavigationOpen ) {
50
+ navigationToggleRef.current.focus();
51
+ }
52
+ }, [ isNavigationOpen ] );
53
+
43
54
  const toggleNavigationPanel = () =>
44
55
  setIsNavigationPanelOpened( ! isNavigationOpen );
45
56
 
@@ -79,6 +90,7 @@ function NavigationToggle( { icon } ) {
79
90
  <Button
80
91
  className="edit-site-navigation-toggle__button has-icon"
81
92
  label={ __( 'Toggle navigation' ) }
93
+ ref={ navigationToggleRef }
82
94
  // isPressed will add unwanted styles.
83
95
  aria-pressed={ isNavigationOpen }
84
96
  onClick={ toggleNavigationPanel }
@@ -15,7 +15,6 @@ export default function DefaultSidebar( {
15
15
  closeLabel,
16
16
  header,
17
17
  headerClassName,
18
- panelClassName,
19
18
  } ) {
20
19
  return (
21
20
  <>
@@ -28,7 +27,6 @@ export default function DefaultSidebar( {
28
27
  closeLabel={ closeLabel }
29
28
  header={ header }
30
29
  headerClassName={ headerClassName }
31
- panelClassName={ panelClassName }
32
30
  >
33
31
  { children }
34
32
  </ComplementaryArea>