@wordpress/edit-site 6.48.0 → 6.48.2-next.v.202606191442.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 (174) hide show
  1. package/CHANGELOG.md +7 -1
  2. package/build/components/editor/use-editor-title.cjs +1 -1
  3. package/build/components/editor/use-editor-title.cjs.map +2 -2
  4. package/build/components/layout/index.cjs +47 -9
  5. package/build/components/layout/index.cjs.map +3 -3
  6. package/build/components/page-templates/index-legacy.cjs +12 -8
  7. package/build/components/page-templates/index-legacy.cjs.map +2 -2
  8. package/build/components/post-list/quick-edit-modal.cjs +0 -1
  9. package/build/components/post-list/quick-edit-modal.cjs.map +2 -2
  10. package/build/components/resizable-frame/index.cjs.map +2 -2
  11. package/build/components/routes/use-title.cjs +1 -1
  12. package/build/components/routes/use-title.cjs.map +2 -2
  13. package/build/components/save-button/index.cjs +2 -2
  14. package/build/components/save-button/index.cjs.map +1 -1
  15. package/build/components/save-hub/index.cjs +3 -3
  16. package/build/components/save-hub/index.cjs.map +3 -3
  17. package/build/components/sidebar-navigation-item/index.cjs +8 -3
  18. package/build/components/sidebar-navigation-item/index.cjs.map +3 -3
  19. package/build/components/sidebar-navigation-screen/index.cjs +0 -1
  20. package/build/components/sidebar-navigation-screen/index.cjs.map +2 -2
  21. package/build/components/sidebar-navigation-screen-global-styles/index.cjs +2 -18
  22. package/build/components/sidebar-navigation-screen-global-styles/index.cjs.map +3 -3
  23. package/build/components/sidebar-navigation-screen-identity/index.cjs +0 -19
  24. package/build/components/sidebar-navigation-screen-identity/index.cjs.map +3 -3
  25. package/build/components/sidebar-navigation-screen-main/index.cjs +25 -25
  26. package/build/components/sidebar-navigation-screen-main/index.cjs.map +2 -2
  27. package/build/components/sidebar-navigation-screen-patterns/index.cjs +1 -1
  28. package/build/components/sidebar-navigation-screen-patterns/index.cjs.map +2 -2
  29. package/build/components/site-editor-routes/home.cjs +1 -1
  30. package/build/components/site-editor-routes/home.cjs.map +2 -2
  31. package/build/components/site-editor-routes/identity.cjs +1 -12
  32. package/build/components/site-editor-routes/identity.cjs.map +3 -3
  33. package/build/components/site-editor-routes/navigation-item.cjs +2 -10
  34. package/build/components/site-editor-routes/navigation-item.cjs.map +3 -3
  35. package/build/components/site-editor-routes/navigation.cjs +2 -10
  36. package/build/components/site-editor-routes/navigation.cjs.map +3 -3
  37. package/build/components/site-editor-routes/notfound.cjs +1 -1
  38. package/build/components/site-editor-routes/notfound.cjs.map +2 -2
  39. package/build/components/site-editor-routes/page-item.cjs +1 -6
  40. package/build/components/site-editor-routes/page-item.cjs.map +2 -2
  41. package/build/components/site-editor-routes/pages.cjs +6 -9
  42. package/build/components/site-editor-routes/pages.cjs.map +3 -3
  43. package/build/components/site-editor-routes/pattern-item.cjs +1 -1
  44. package/build/components/site-editor-routes/pattern-item.cjs.map +2 -2
  45. package/build/components/site-editor-routes/patterns.cjs +8 -3
  46. package/build/components/site-editor-routes/patterns.cjs.map +2 -2
  47. package/build/components/site-editor-routes/stylebook.cjs +1 -1
  48. package/build/components/site-editor-routes/stylebook.cjs.map +2 -2
  49. package/build/components/site-editor-routes/styles.cjs +1 -9
  50. package/build/components/site-editor-routes/styles.cjs.map +2 -2
  51. package/build/components/site-editor-routes/template-item.cjs +1 -6
  52. package/build/components/site-editor-routes/template-item.cjs.map +2 -2
  53. package/build/components/site-editor-routes/template-part-item.cjs +1 -1
  54. package/build/components/site-editor-routes/template-part-item.cjs.map +2 -2
  55. package/build/components/site-editor-routes/templates.cjs +8 -1
  56. package/build/components/site-editor-routes/templates.cjs.map +2 -2
  57. package/build/components/welcome-guide/editor.cjs +1 -1
  58. package/build/components/welcome-guide/editor.cjs.map +1 -1
  59. package/build/components/welcome-guide/page.cjs +1 -1
  60. package/build/components/welcome-guide/page.cjs.map +1 -1
  61. package/build/components/welcome-guide/template.cjs +1 -1
  62. package/build/components/welcome-guide/template.cjs.map +1 -1
  63. package/build/store/selectors.cjs +2 -4
  64. package/build/store/selectors.cjs.map +2 -2
  65. package/build-module/components/editor/use-editor-title.mjs +1 -1
  66. package/build-module/components/editor/use-editor-title.mjs.map +2 -2
  67. package/build-module/components/layout/index.mjs +49 -11
  68. package/build-module/components/layout/index.mjs.map +2 -2
  69. package/build-module/components/page-templates/index-legacy.mjs +13 -9
  70. package/build-module/components/page-templates/index-legacy.mjs.map +2 -2
  71. package/build-module/components/post-list/quick-edit-modal.mjs +0 -1
  72. package/build-module/components/post-list/quick-edit-modal.mjs.map +2 -2
  73. package/build-module/components/resizable-frame/index.mjs.map +2 -2
  74. package/build-module/components/routes/use-title.mjs +1 -1
  75. package/build-module/components/routes/use-title.mjs.map +2 -2
  76. package/build-module/components/save-button/index.mjs +2 -2
  77. package/build-module/components/save-button/index.mjs.map +1 -1
  78. package/build-module/components/save-hub/index.mjs +3 -3
  79. package/build-module/components/save-hub/index.mjs.map +2 -2
  80. package/build-module/components/sidebar-navigation-item/index.mjs +9 -8
  81. package/build-module/components/sidebar-navigation-item/index.mjs.map +2 -2
  82. package/build-module/components/sidebar-navigation-screen/index.mjs +0 -1
  83. package/build-module/components/sidebar-navigation-screen/index.mjs.map +2 -2
  84. package/build-module/components/sidebar-navigation-screen-global-styles/index.mjs +2 -14
  85. package/build-module/components/sidebar-navigation-screen-global-styles/index.mjs.map +2 -2
  86. package/build-module/components/sidebar-navigation-screen-identity/index.mjs +0 -15
  87. package/build-module/components/sidebar-navigation-screen-identity/index.mjs.map +2 -2
  88. package/build-module/components/sidebar-navigation-screen-main/index.mjs +25 -25
  89. package/build-module/components/sidebar-navigation-screen-main/index.mjs.map +2 -2
  90. package/build-module/components/sidebar-navigation-screen-patterns/index.mjs +1 -1
  91. package/build-module/components/sidebar-navigation-screen-patterns/index.mjs.map +2 -2
  92. package/build-module/components/site-editor-routes/home.mjs +1 -1
  93. package/build-module/components/site-editor-routes/home.mjs.map +2 -2
  94. package/build-module/components/site-editor-routes/identity.mjs +1 -12
  95. package/build-module/components/site-editor-routes/identity.mjs.map +2 -2
  96. package/build-module/components/site-editor-routes/navigation-item.mjs +2 -10
  97. package/build-module/components/site-editor-routes/navigation-item.mjs.map +2 -2
  98. package/build-module/components/site-editor-routes/navigation.mjs +2 -10
  99. package/build-module/components/site-editor-routes/navigation.mjs.map +2 -2
  100. package/build-module/components/site-editor-routes/notfound.mjs +1 -1
  101. package/build-module/components/site-editor-routes/notfound.mjs.map +2 -2
  102. package/build-module/components/site-editor-routes/page-item.mjs +2 -7
  103. package/build-module/components/site-editor-routes/page-item.mjs.map +2 -2
  104. package/build-module/components/site-editor-routes/pages.mjs +6 -9
  105. package/build-module/components/site-editor-routes/pages.mjs.map +2 -2
  106. package/build-module/components/site-editor-routes/pattern-item.mjs +1 -1
  107. package/build-module/components/site-editor-routes/pattern-item.mjs.map +2 -2
  108. package/build-module/components/site-editor-routes/patterns.mjs +8 -3
  109. package/build-module/components/site-editor-routes/patterns.mjs.map +2 -2
  110. package/build-module/components/site-editor-routes/stylebook.mjs +1 -1
  111. package/build-module/components/site-editor-routes/stylebook.mjs.map +2 -2
  112. package/build-module/components/site-editor-routes/styles.mjs +1 -9
  113. package/build-module/components/site-editor-routes/styles.mjs.map +2 -2
  114. package/build-module/components/site-editor-routes/template-item.mjs +2 -7
  115. package/build-module/components/site-editor-routes/template-item.mjs.map +2 -2
  116. package/build-module/components/site-editor-routes/template-part-item.mjs +1 -1
  117. package/build-module/components/site-editor-routes/template-part-item.mjs.map +2 -2
  118. package/build-module/components/site-editor-routes/templates.mjs +8 -1
  119. package/build-module/components/site-editor-routes/templates.mjs.map +2 -2
  120. package/build-module/components/welcome-guide/editor.mjs +1 -1
  121. package/build-module/components/welcome-guide/editor.mjs.map +1 -1
  122. package/build-module/components/welcome-guide/page.mjs +1 -1
  123. package/build-module/components/welcome-guide/page.mjs.map +1 -1
  124. package/build-module/components/welcome-guide/template.mjs +1 -1
  125. package/build-module/components/welcome-guide/template.mjs.map +1 -1
  126. package/build-module/store/selectors.mjs +2 -4
  127. package/build-module/store/selectors.mjs.map +2 -2
  128. package/build-style/{experimental-admin-bar-in-editor-rtl.css → experimental-omnibar-rtl.css} +49 -2
  129. package/build-style/{experimental-admin-bar-in-editor.css → experimental-omnibar.css} +49 -2
  130. package/build-style/style-rtl.css +476 -248
  131. package/build-style/style.css +476 -249
  132. package/package.json +49 -49
  133. package/src/components/layout/index.js +64 -18
  134. package/src/components/layout/style.scss +28 -13
  135. package/src/components/page-patterns/style.scss +1 -2
  136. package/src/components/page-templates/index-legacy.js +17 -9
  137. package/src/components/page-templates/style.scss +0 -5
  138. package/src/components/post-list/quick-edit-modal.js +0 -1
  139. package/src/components/resizable-frame/index.js +0 -1
  140. package/src/components/save-hub/index.js +4 -4
  141. package/src/components/save-hub/style.scss +5 -5
  142. package/src/components/sidebar-button/style.scss +2 -4
  143. package/src/components/sidebar-dataviews/style.scss +0 -1
  144. package/src/components/sidebar-global-styles/style.scss +1 -2
  145. package/src/components/sidebar-navigation-item/index.js +11 -9
  146. package/src/components/sidebar-navigation-item/style.scss +6 -7
  147. package/src/components/sidebar-navigation-screen/index.js +0 -1
  148. package/src/components/sidebar-navigation-screen/style.scss +9 -9
  149. package/src/components/sidebar-navigation-screen-global-styles/index.js +2 -15
  150. package/src/components/sidebar-navigation-screen-identity/index.js +0 -15
  151. package/src/components/sidebar-navigation-screen-main/index.js +24 -22
  152. package/src/components/sidebar-navigation-screen-navigation-menu/style.scss +2 -4
  153. package/src/components/sidebar-navigation-screen-navigation-menus/style.scss +15 -5
  154. package/src/components/sidebar-navigation-screen-patterns/style.scss +2 -3
  155. package/src/components/site-editor-routes/README.md +4 -4
  156. package/src/components/site-editor-routes/home.js +1 -1
  157. package/src/components/site-editor-routes/identity.js +1 -20
  158. package/src/components/site-editor-routes/navigation-item.js +2 -21
  159. package/src/components/site-editor-routes/navigation.js +2 -21
  160. package/src/components/site-editor-routes/notfound.js +1 -1
  161. package/src/components/site-editor-routes/page-item.js +1 -10
  162. package/src/components/site-editor-routes/pages.js +6 -14
  163. package/src/components/site-editor-routes/pattern-item.js +1 -1
  164. package/src/components/site-editor-routes/patterns.js +8 -7
  165. package/src/components/site-editor-routes/stylebook.js +1 -1
  166. package/src/components/site-editor-routes/styles.js +1 -12
  167. package/src/components/site-editor-routes/template-item.js +1 -10
  168. package/src/components/site-editor-routes/template-part-item.js +1 -1
  169. package/src/components/site-editor-routes/templates.js +8 -1
  170. package/src/components/site-hub/style.scss +5 -6
  171. package/src/components/welcome-guide/page.js +1 -1
  172. package/src/{experimental-admin-bar-in-editor.scss → experimental-omnibar.scss} +6 -2
  173. package/src/store/selectors.js +3 -7
  174. package/src/style.scss +2 -3
@@ -6,11 +6,8 @@ import clsx from 'clsx';
6
6
  /**
7
7
  * WordPress dependencies
8
8
  */
9
- import {
10
- __experimentalItem as Item,
11
- __experimentalHStack as HStack,
12
- FlexBlock,
13
- } from '@wordpress/components';
9
+ import { __experimentalItem as Item, FlexBlock } from '@wordpress/components';
10
+ import { Stack } from '@wordpress/ui';
14
11
  import { isRTL } from '@wordpress/i18n';
15
12
  import { chevronRightSmall, chevronLeftSmall, Icon } from '@wordpress/icons';
16
13
  import { privateApis as routerPrivateApis } from '@wordpress/router';
@@ -22,7 +19,7 @@ import { useContext } from '@wordpress/element';
22
19
  import { unlock } from '../../lock-unlock';
23
20
  import { SidebarNavigationContext } from '../sidebar';
24
21
 
25
- const { useHistory, useLink } = unlock( routerPrivateApis );
22
+ const { useHistory, useLink, useLocation } = unlock( routerPrivateApis );
26
23
 
27
24
  export default function SidebarNavigationItem( {
28
25
  className,
@@ -32,11 +29,16 @@ export default function SidebarNavigationItem( {
32
29
  uid,
33
30
  to,
34
31
  onClick,
32
+ activeOnRouteName,
35
33
  children,
36
34
  ...props
37
35
  } ) {
38
36
  const history = useHistory();
37
+ const linkProps = useLink( to );
38
+ const { name } = useLocation();
39
39
  const { navigate } = useContext( SidebarNavigationContext );
40
+
41
+ const isActive = activeOnRouteName && name === activeOnRouteName;
40
42
  // If there is no custom click handler, create one that navigates to `params`.
41
43
  function handleClick( e ) {
42
44
  if ( onClick ) {
@@ -48,7 +50,6 @@ export default function SidebarNavigationItem( {
48
50
  navigate( 'forward', `[id="${ uid }"]` );
49
51
  }
50
52
  }
51
- const linkProps = useLink( to );
52
53
 
53
54
  return (
54
55
  <Item
@@ -60,9 +61,10 @@ export default function SidebarNavigationItem( {
60
61
  id={ uid }
61
62
  onClick={ handleClick }
62
63
  href={ to ? linkProps.href : undefined }
64
+ aria-current={ isActive ? true : undefined }
63
65
  { ...props }
64
66
  >
65
- <HStack justify="flex-start">
67
+ <Stack direction="row" align="center" justify="start" gap="sm">
66
68
  { icon && (
67
69
  <Icon
68
70
  style={ { fill: 'currentcolor' } }
@@ -79,7 +81,7 @@ export default function SidebarNavigationItem( {
79
81
  />
80
82
  ) }
81
83
  { ! withChevron && suffix }
82
- </HStack>
84
+ </Stack>
83
85
  </Item>
84
86
  );
85
87
  }
@@ -1,8 +1,7 @@
1
- @use "@wordpress/base-styles/colors" as *;
2
1
  @use "@wordpress/base-styles/variables" as *;
3
2
 
4
3
  .edit-site-sidebar-navigation-item.components-item {
5
- color: $gray-600;
4
+ color: var(--wpds-color-foreground-interactive-neutral-weak);
6
5
  // 6px right padding to align with + button
7
6
  padding: $grid-unit-10 6px $grid-unit-10 $grid-unit-20;
8
7
  border: none;
@@ -11,16 +10,16 @@
11
10
  &:hover,
12
11
  &:focus,
13
12
  &[aria-current="true"] {
14
- color: $gray-200;
13
+ color: var(--wpds-color-foreground-interactive-neutral-active);
15
14
 
16
15
  .edit-site-sidebar-navigation-item__drilldown-indicator {
17
- fill: $gray-200;
16
+ fill: var(--wpds-color-foreground-interactive-neutral-active);
18
17
  }
19
18
  }
20
19
 
21
20
  &[aria-current="true"] {
22
- background: $gray-800;
23
- color: $white;
21
+ background: var(--wpds-color-background-interactive-neutral-weak-active);
22
+ color: var(--wpds-color-foreground-interactive-neutral-active);
24
23
  font-weight: $font-weight-medium;
25
24
  }
26
25
 
@@ -30,7 +29,7 @@
30
29
  }
31
30
 
32
31
  .edit-site-sidebar-navigation-item__drilldown-indicator {
33
- fill: $gray-600;
32
+ fill: var(--wpds-color-foreground-interactive-neutral-weak);
34
33
  }
35
34
 
36
35
  &.with-suffix {
@@ -101,7 +101,6 @@ export default function SidebarNavigationScreen( {
101
101
  ) }
102
102
  <Heading
103
103
  className="edit-site-sidebar-navigation-screen__title"
104
- color={ '#e0e0e0' /* $gray-200 */ }
105
104
  level={ 1 }
106
105
  size={ 20 }
107
106
  >
@@ -23,7 +23,7 @@
23
23
  padding: 0 $grid-unit-20;
24
24
 
25
25
  .components-text {
26
- color: $gray-400;
26
+ color: var(--wpds-color-foreground-content-neutral);
27
27
  }
28
28
 
29
29
  .components-heading {
@@ -34,7 +34,7 @@
34
34
  .edit-site-sidebar-navigation-screen__title-icon {
35
35
  position: sticky;
36
36
  top: 0;
37
- background: $gray-900;
37
+ background: var(--wpds-color-background-surface-neutral-weak);
38
38
  padding-top: $grid-unit-60;
39
39
  margin-bottom: $grid-unit-10;
40
40
  padding-bottom: $grid-unit-10;
@@ -95,11 +95,11 @@
95
95
  .edit-site-sidebar-navigation-screen__footer {
96
96
  position: sticky;
97
97
  bottom: 0;
98
- background-color: $gray-900;
98
+ background-color: var(--wpds-color-background-surface-neutral-weak);
99
99
  gap: 0;
100
100
  padding: $grid-unit-10 $grid-unit-20;
101
101
  margin: $grid-unit-20 0 0;
102
- border-top: 1px solid $gray-800;
102
+ border-top: 1px solid var(--wpds-color-stroke-surface-neutral);
103
103
 
104
104
  .edit-site-sidebar-navigation-screen-details-footer {
105
105
  margin-left: -$grid-unit-20;
@@ -116,20 +116,20 @@
116
116
  .edit-site-sidebar-navigation-screen__input-control {
117
117
  width: 100%;
118
118
  .components-input-control__container {
119
- background: $gray-800;
119
+ background: var(--wpds-color-background-interactive-neutral-weak);
120
120
 
121
121
  .components-button {
122
- color: $gray-200 !important;
122
+ color: var(--wpds-color-foreground-interactive-neutral) !important;
123
123
  }
124
124
  }
125
125
  .components-input-control__input {
126
- color: $gray-200 !important;
127
- background: $gray-800 !important;
126
+ color: var(--wpds-color-foreground-interactive-neutral) !important;
127
+ background: var(--wpds-color-background-interactive-neutral-weak) !important;
128
128
  }
129
129
  .components-input-control__backdrop {
130
130
  border: 4px !important;
131
131
  }
132
132
  .components-base-control__help {
133
- color: $gray-600;
133
+ color: var(--wpds-color-foreground-content-neutral-weak);
134
134
  }
135
135
  }
@@ -8,6 +8,7 @@ import { store as preferencesStore } from '@wordpress/preferences';
8
8
  import { store as editorStore } from '@wordpress/editor';
9
9
  import { privateApis as routerPrivateApis } from '@wordpress/router';
10
10
  import { addQueryArgs } from '@wordpress/url';
11
+ import { useGlobalStylesRevisions } from '@wordpress/global-styles-ui';
11
12
 
12
13
  /**
13
14
  * Internal dependencies
@@ -15,23 +16,11 @@ import { addQueryArgs } from '@wordpress/url';
15
16
  import SidebarNavigationScreen from '../sidebar-navigation-screen';
16
17
  import { unlock } from '../../lock-unlock';
17
18
  import { store as editSiteStore } from '../../store';
18
- import SidebarNavigationItem from '../sidebar-navigation-item';
19
- import { useGlobalStylesRevisions } from '@wordpress/global-styles-ui';
20
19
  import SidebarNavigationScreenDetailsFooter from '../sidebar-navigation-screen-details-footer';
21
20
  import { MainSidebarNavigationContent } from '../sidebar-navigation-screen-main';
22
21
 
23
22
  const { useLocation, useHistory } = unlock( routerPrivateApis );
24
23
 
25
- export function SidebarNavigationItemGlobalStyles( props ) {
26
- const { name } = useLocation();
27
- return (
28
- <SidebarNavigationItem
29
- { ...props }
30
- aria-current={ name === 'styles' }
31
- />
32
- );
33
- }
34
-
35
24
  export default function SidebarNavigationScreenGlobalStyles() {
36
25
  const history = useHistory();
37
26
  const { path } = useLocation();
@@ -73,9 +62,7 @@ export default function SidebarNavigationScreenGlobalStyles() {
73
62
  description={ __(
74
63
  'Customize the appearance of your website using the block editor.'
75
64
  ) }
76
- content={
77
- <MainSidebarNavigationContent activeItem="styles-navigation-item" />
78
- }
65
+ content={ <MainSidebarNavigationContent /> }
79
66
  footer={
80
67
  shouldShowGlobalStylesFooter && (
81
68
  <SidebarNavigationScreenDetailsFooter
@@ -2,28 +2,13 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import { __ } from '@wordpress/i18n';
5
- import { privateApis as routerPrivateApis } from '@wordpress/router';
6
5
 
7
6
  /**
8
7
  * Internal dependencies
9
8
  */
10
9
  import SidebarNavigationScreen from '../sidebar-navigation-screen';
11
- import { unlock } from '../../lock-unlock';
12
- import SidebarNavigationItem from '../sidebar-navigation-item';
13
10
  import { MainSidebarNavigationContent } from '../sidebar-navigation-screen-main';
14
11
 
15
- const { useLocation } = unlock( routerPrivateApis );
16
-
17
- export function SidebarNavigationItemIdentity( props ) {
18
- const { name } = useLocation();
19
- return (
20
- <SidebarNavigationItem
21
- { ...props }
22
- aria-current={ name === 'identity' }
23
- />
24
- );
25
- }
26
-
27
12
  export default function SidebarNavigationScreenIdentity() {
28
13
  return (
29
14
  <SidebarNavigationScreen
@@ -19,36 +19,28 @@ import { store as coreStore } from '@wordpress/core-data';
19
19
  */
20
20
  import SidebarNavigationScreen from '../sidebar-navigation-screen';
21
21
  import SidebarNavigationItem from '../sidebar-navigation-item';
22
- import { SidebarNavigationItemGlobalStyles } from '../sidebar-navigation-screen-global-styles';
23
- import { SidebarNavigationItemIdentity } from '../sidebar-navigation-screen-identity';
24
22
 
25
23
  export function MainSidebarNavigationContent( { isBlockBasedTheme = true } ) {
26
24
  return (
27
25
  <ItemGroup className="edit-site-sidebar-navigation-screen-main">
28
26
  { isBlockBasedTheme && (
29
27
  <>
30
- <SidebarNavigationItemGlobalStyles
31
- to="/styles"
32
- uid="global-styles-navigation-item"
33
- icon={ styles }
34
- >
35
- { __( 'Styles' ) }
36
- </SidebarNavigationItemGlobalStyles>
37
28
  <SidebarNavigationItem
38
- uid="navigation-navigation-item"
39
- to="/navigation"
40
- withChevron
41
- icon={ navigation }
42
- >
43
- { __( 'Navigation' ) }
44
- </SidebarNavigationItem>
45
- <SidebarNavigationItemIdentity
46
29
  to="/identity"
47
30
  uid="identity-navigation-item"
48
31
  icon={ siteLogo }
32
+ activeOnRouteName="identity"
49
33
  >
50
34
  { _x( 'Identity', 'site identity' ) }
51
- </SidebarNavigationItemIdentity>
35
+ </SidebarNavigationItem>
36
+ <SidebarNavigationItem
37
+ to="/styles"
38
+ uid="global-styles-navigation-item"
39
+ icon={ styles }
40
+ activeOnRouteName="styles"
41
+ >
42
+ { __( 'Styles' ) }
43
+ </SidebarNavigationItem>
52
44
  <SidebarNavigationItem
53
45
  uid="page-navigation-item"
54
46
  to="/page"
@@ -58,12 +50,12 @@ export function MainSidebarNavigationContent( { isBlockBasedTheme = true } ) {
58
50
  { __( 'Pages' ) }
59
51
  </SidebarNavigationItem>
60
52
  <SidebarNavigationItem
61
- uid="template-navigation-item"
62
- to="/template"
53
+ uid="navigation-navigation-item"
54
+ to="/navigation"
63
55
  withChevron
64
- icon={ layout }
56
+ icon={ navigation }
65
57
  >
66
- { __( 'Templates' ) }
58
+ { __( 'Navigation' ) }
67
59
  </SidebarNavigationItem>
68
60
  </>
69
61
  ) }
@@ -85,6 +77,16 @@ export function MainSidebarNavigationContent( { isBlockBasedTheme = true } ) {
85
77
  >
86
78
  { __( 'Patterns' ) }
87
79
  </SidebarNavigationItem>
80
+ { isBlockBasedTheme && (
81
+ <SidebarNavigationItem
82
+ uid="template-navigation-item"
83
+ to="/template"
84
+ withChevron
85
+ icon={ layout }
86
+ >
87
+ { __( 'Templates' ) }
88
+ </SidebarNavigationItem>
89
+ ) }
88
90
  </ItemGroup>
89
91
  );
90
92
  }
@@ -1,12 +1,10 @@
1
- @use "@wordpress/base-styles/colors" as *;
2
-
3
1
  .sidebar-navigation__more-menu {
4
2
  .components-button {
5
- color: $gray-200;
3
+ color: var(--wpds-color-foreground-interactive-neutral);
6
4
  &:hover,
7
5
  &:focus,
8
6
  &[aria-current] {
9
- color: $gray-100;
7
+ color: var(--wpds-color-foreground-interactive-neutral);
10
8
  }
11
9
  }
12
10
  }
@@ -1,4 +1,3 @@
1
- @use "@wordpress/base-styles/colors" as *;
2
1
  @use "@wordpress/base-styles/variables" as *;
3
2
 
4
3
  .edit-site-sidebar-navigation-screen__description {
@@ -24,19 +23,30 @@
24
23
  }
25
24
 
26
25
  .block-editor-list-view-block-select-button {
27
- color: $gray-600;
26
+ color: var(--wpds-color-foreground-interactive-neutral-weak);
28
27
  &:hover,
29
28
  &:focus,
30
29
  &[aria-current] {
31
- color: $white;
30
+ color: var(--wpds-color-foreground-interactive-neutral-active);
32
31
  }
33
32
  }
34
33
 
35
34
  .block-editor-list-view-block__menu {
36
- color: $gray-600;
35
+ color: var(--wpds-color-foreground-interactive-neutral-weak);
37
36
  &:hover,
38
37
  &:focus {
39
- color: $white;
38
+ color: var(--wpds-color-foreground-interactive-neutral-active);
39
+ }
40
+ }
41
+
42
+ .block-editor-inserter__toggle {
43
+ background: var(--wpds-color-background-interactive-brand-strong);
44
+ color: var(--wpds-color-foreground-interactive-brand-strong);
45
+
46
+ &:hover,
47
+ &:focus {
48
+ background: var(--wpds-color-background-interactive-brand-strong-active);
49
+ color: var(--wpds-color-foreground-interactive-brand-strong-active);
40
50
  }
41
51
  }
42
52
  }
@@ -1,4 +1,3 @@
1
- @use "@wordpress/base-styles/colors" as *;
2
1
  @use "@wordpress/base-styles/variables" as *;
3
2
 
4
3
  .edit-site-sidebar-navigation-screen-patterns__group {
@@ -17,7 +16,7 @@
17
16
  margin-top: $grid-unit-20;
18
17
 
19
18
  p {
20
- color: $gray-600;
19
+ color: var(--wpds-color-foreground-content-neutral-weak);
21
20
  }
22
21
 
23
22
  h2 {
@@ -28,6 +27,6 @@
28
27
  }
29
28
 
30
29
  .edit-site-sidebar-navigation-screen-patterns__divider {
31
- border-top: 1px solid $gray-800;
30
+ border-top: 1px solid var(--wpds-color-stroke-surface-neutral);
32
31
  margin: $grid-unit-20 0;
33
32
  }
@@ -6,15 +6,15 @@ When `canvasMode` is not `edit`, the areas available to use are:
6
6
 
7
7
  | Area | Non-mobile viewport | Mobile viewport |
8
8
  | --- | --- | --- |
9
- | `sidebar` | Always rendered. | Only if `mobile` is not provided. |
9
+ | `sidebar` | Always rendered. | Only if no mobile area (`mobileSidebar`, `mobileContent`, or `preview`) is provided. |
10
10
  | `content` | Rendered if provided. | Not rendered. |
11
11
  | `preview` | Rendered if provided. | Not rendered. |
12
12
  | `edit` | Rendered if provided. | Not rendered. |
13
- | `mobile` | Not rendered | Rendered as full-screen, if provided. |
13
+ | `mobileSidebar` | Not rendered | Rendered as full-screen (with the themed sidebar background), if provided and `mobileContent` is not provided. |
14
+ | `mobileContent` | Not rendered | Rendered as full-screen (with the white content background), if provided. |
14
15
 
15
16
  When `canvasMode` is `edit`, the areas available to use are:
16
17
 
17
18
  | Area | Non-mobile viewport | Mobile viewport |
18
19
  | --- | --- | --- |
19
- | `preview` | Rendered as full-screen, if provided. Otherwise, it'll display an empty blank sidebar. | Not rendered. |
20
- | `mobile` | Not rendered | Rendered as full-screen, if provided. Otherwise, it'll display an empty blank sidebar. |
20
+ | `preview` | Rendered as full-screen, if provided. Otherwise, it'll display an empty blank sidebar. | Rendered as full-screen, if provided. Otherwise, it'll display an empty blank sidebar. |
@@ -28,7 +28,7 @@ export const homeRoute = {
28
28
  <Editor isHomeRoute />
29
29
  ) : undefined;
30
30
  },
31
- mobile( { siteData } ) {
31
+ mobileSidebar( { siteData } ) {
32
32
  if ( ! isThemeDataLoaded( siteData ) ) {
33
33
  return <></>;
34
34
  }
@@ -1,29 +1,10 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { privateApis as routerPrivateApis } from '@wordpress/router';
5
-
6
1
  /**
7
2
  * Internal dependencies
8
3
  */
9
4
  import Editor from '../editor';
10
- import { unlock } from '../../lock-unlock';
11
5
  import SidebarNavigationScreenIdentity from '../sidebar-navigation-screen-identity';
12
6
  import SidebarIdentity from '../sidebar-identity';
13
7
 
14
- const { useLocation } = unlock( routerPrivateApis );
15
-
16
- function MobileIdentityView() {
17
- const { query = {} } = useLocation();
18
- const { canvas } = query;
19
-
20
- if ( canvas === 'edit' ) {
21
- return <Editor />;
22
- }
23
-
24
- return <SidebarIdentity />;
25
- }
26
-
27
8
  export const identityRoute = {
28
9
  name: 'identity',
29
10
  path: '/identity',
@@ -31,7 +12,7 @@ export const identityRoute = {
31
12
  sidebar: <SidebarNavigationScreenIdentity />,
32
13
  content: <SidebarIdentity />,
33
14
  preview: <Editor />,
34
- mobile: <MobileIdentityView />,
15
+ mobileContent: <SidebarIdentity />,
35
16
  },
36
17
  widths: {
37
18
  content: 380,
@@ -1,30 +1,11 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { privateApis as routerPrivateApis } from '@wordpress/router';
5
-
6
1
  /**
7
2
  * Internal dependencies
8
3
  */
9
4
  import Editor from '../editor';
10
5
  import SidebarNavigationScreenNavigationMenu from '../sidebar-navigation-screen-navigation-menu';
11
6
  import SidebarNavigationScreenUnsupported from '../sidebar-navigation-screen-unsupported';
12
- import { unlock } from '../../lock-unlock';
13
7
  import { isThemeDataLoaded } from './utils';
14
8
 
15
- const { useLocation } = unlock( routerPrivateApis );
16
-
17
- function MobileNavigationItemView() {
18
- const { query = {} } = useLocation();
19
- const { canvas = 'view' } = query;
20
-
21
- return canvas === 'edit' ? (
22
- <Editor />
23
- ) : (
24
- <SidebarNavigationScreenNavigationMenu backPath="/navigation" />
25
- );
26
- }
27
-
28
9
  export const navigationItemRoute = {
29
10
  name: 'navigation-item',
30
11
  path: '/wp_navigation/:postId',
@@ -49,12 +30,12 @@ export const navigationItemRoute = {
49
30
  <SidebarNavigationScreenUnsupported />
50
31
  );
51
32
  },
52
- mobile( { siteData } ) {
33
+ mobileSidebar( { siteData } ) {
53
34
  if ( ! isThemeDataLoaded( siteData ) ) {
54
35
  return <></>;
55
36
  }
56
37
  return siteData.currentTheme.is_block_theme ? (
57
- <MobileNavigationItemView />
38
+ <SidebarNavigationScreenNavigationMenu backPath="/navigation" />
58
39
  ) : (
59
40
  <SidebarNavigationScreenUnsupported />
60
41
  );
@@ -1,30 +1,11 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { privateApis as routerPrivateApis } from '@wordpress/router';
5
-
6
1
  /**
7
2
  * Internal dependencies
8
3
  */
9
4
  import Editor from '../editor';
10
5
  import SidebarNavigationScreenNavigationMenus from '../sidebar-navigation-screen-navigation-menus';
11
6
  import SidebarNavigationScreenUnsupported from '../sidebar-navigation-screen-unsupported';
12
- import { unlock } from '../../lock-unlock';
13
7
  import { isThemeDataLoaded } from './utils';
14
8
 
15
- const { useLocation } = unlock( routerPrivateApis );
16
-
17
- function MobileNavigationView() {
18
- const { query = {} } = useLocation();
19
- const { canvas = 'view' } = query;
20
-
21
- return canvas === 'edit' ? (
22
- <Editor />
23
- ) : (
24
- <SidebarNavigationScreenNavigationMenus backPath="/" />
25
- );
26
- }
27
-
28
9
  export const navigationRoute = {
29
10
  name: 'navigation',
30
11
  path: '/navigation',
@@ -43,12 +24,12 @@ export const navigationRoute = {
43
24
  const isBlockTheme = siteData.currentTheme?.is_block_theme;
44
25
  return isBlockTheme ? <Editor /> : undefined;
45
26
  },
46
- mobile( { siteData } ) {
27
+ mobileSidebar( { siteData } ) {
47
28
  if ( ! isThemeDataLoaded( siteData ) ) {
48
29
  return <></>;
49
30
  }
50
31
  return siteData.currentTheme.is_block_theme ? (
51
- <MobileNavigationView />
32
+ <SidebarNavigationScreenNavigationMenus backPath="/" />
52
33
  ) : (
53
34
  <SidebarNavigationScreenUnsupported />
54
35
  );
@@ -24,7 +24,7 @@ export const notFoundRoute = {
24
24
  path: '*',
25
25
  areas: {
26
26
  sidebar: <SidebarNavigationScreenMain />,
27
- mobile: (
27
+ mobileSidebar: (
28
28
  <SidebarNavigationScreenMain
29
29
  customDescription={ <NotFoundError /> }
30
30
  />
@@ -30,16 +30,7 @@ export const pageItemRoute = {
30
30
  <SidebarNavigationScreenUnsupported />
31
31
  );
32
32
  },
33
- mobile( { siteData } ) {
34
- if ( ! isThemeDataLoaded( siteData ) ) {
35
- return <></>;
36
- }
37
- return siteData.currentTheme.is_block_theme ? (
38
- <Editor />
39
- ) : (
40
- <SidebarNavigationScreenUnsupported />
41
- );
42
- },
33
+ // Also rendered on mobile, where this route is only reached at canvas=edit.
43
34
  preview( { siteData } ) {
44
35
  if ( ! isThemeDataLoaded( siteData ) ) {
45
36
  return null;
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * WordPress dependencies
3
3
  */
4
- import { privateApis as routerPrivateApis } from '@wordpress/router';
5
4
  import { __ } from '@wordpress/i18n';
6
5
  import { resolveSelect } from '@wordpress/data';
7
6
  import { store as coreStore } from '@wordpress/core-data';
@@ -18,8 +17,6 @@ import PostList from '../post-list';
18
17
  import { unlock } from '../../lock-unlock';
19
18
  import { isThemeDataLoaded } from './utils';
20
19
 
21
- const { useLocation } = unlock( routerPrivateApis );
22
-
23
20
  async function isListView( query ) {
24
21
  const { activeView = 'all' } = query;
25
22
  const config = await unlock( resolveSelect( coreStore ) ).getViewConfig(
@@ -40,13 +37,6 @@ async function isListView( query ) {
40
37
  return view.type === 'list';
41
38
  }
42
39
 
43
- function MobilePagesView() {
44
- const { query = {} } = useLocation();
45
- const { canvas = 'view' } = query;
46
-
47
- return canvas === 'edit' ? <Editor /> : <PostList postType="page" />;
48
- }
49
-
50
40
  export const pagesRoute = {
51
41
  name: 'pages',
52
42
  path: '/page',
@@ -77,16 +67,18 @@ export const pagesRoute = {
77
67
  const isList = await isListView( query );
78
68
  return isList ? <Editor /> : undefined;
79
69
  },
80
- mobile( { siteData } ) {
70
+ mobileSidebar( { siteData } ) {
81
71
  if ( ! isThemeDataLoaded( siteData ) ) {
82
72
  return <></>;
83
73
  }
84
- return siteData.currentTheme.is_block_theme ? (
85
- <MobilePagesView />
86
- ) : (
74
+ return siteData.currentTheme.is_block_theme ? undefined : (
87
75
  <SidebarNavigationScreenUnsupported />
88
76
  );
89
77
  },
78
+ mobileContent( { siteData } ) {
79
+ const isBlockTheme = siteData.currentTheme?.is_block_theme;
80
+ return isBlockTheme ? <PostList postType="page" /> : undefined;
81
+ },
90
82
  },
91
83
  widths: {
92
84
  async content( { query } ) {
@@ -17,7 +17,7 @@ export const patternItemRoute = {
17
17
  : undefined;
18
18
  return <SidebarNavigationScreenPatterns backPath={ backPath } />;
19
19
  },
20
- mobile: <Editor />,
20
+ // Also rendered on mobile, where this route is only reached at canvas=edit.
21
21
  preview: <Editor />,
22
22
  },
23
23
  };