@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.
- package/CHANGELOG.md +7 -1
- package/build/components/editor/use-editor-title.cjs +1 -1
- package/build/components/editor/use-editor-title.cjs.map +2 -2
- package/build/components/layout/index.cjs +47 -9
- package/build/components/layout/index.cjs.map +3 -3
- package/build/components/page-templates/index-legacy.cjs +12 -8
- package/build/components/page-templates/index-legacy.cjs.map +2 -2
- package/build/components/post-list/quick-edit-modal.cjs +0 -1
- package/build/components/post-list/quick-edit-modal.cjs.map +2 -2
- package/build/components/resizable-frame/index.cjs.map +2 -2
- package/build/components/routes/use-title.cjs +1 -1
- package/build/components/routes/use-title.cjs.map +2 -2
- package/build/components/save-button/index.cjs +2 -2
- package/build/components/save-button/index.cjs.map +1 -1
- package/build/components/save-hub/index.cjs +3 -3
- package/build/components/save-hub/index.cjs.map +3 -3
- package/build/components/sidebar-navigation-item/index.cjs +8 -3
- package/build/components/sidebar-navigation-item/index.cjs.map +3 -3
- package/build/components/sidebar-navigation-screen/index.cjs +0 -1
- package/build/components/sidebar-navigation-screen/index.cjs.map +2 -2
- package/build/components/sidebar-navigation-screen-global-styles/index.cjs +2 -18
- package/build/components/sidebar-navigation-screen-global-styles/index.cjs.map +3 -3
- package/build/components/sidebar-navigation-screen-identity/index.cjs +0 -19
- package/build/components/sidebar-navigation-screen-identity/index.cjs.map +3 -3
- package/build/components/sidebar-navigation-screen-main/index.cjs +25 -25
- package/build/components/sidebar-navigation-screen-main/index.cjs.map +2 -2
- package/build/components/sidebar-navigation-screen-patterns/index.cjs +1 -1
- package/build/components/sidebar-navigation-screen-patterns/index.cjs.map +2 -2
- package/build/components/site-editor-routes/home.cjs +1 -1
- package/build/components/site-editor-routes/home.cjs.map +2 -2
- package/build/components/site-editor-routes/identity.cjs +1 -12
- package/build/components/site-editor-routes/identity.cjs.map +3 -3
- package/build/components/site-editor-routes/navigation-item.cjs +2 -10
- package/build/components/site-editor-routes/navigation-item.cjs.map +3 -3
- package/build/components/site-editor-routes/navigation.cjs +2 -10
- package/build/components/site-editor-routes/navigation.cjs.map +3 -3
- package/build/components/site-editor-routes/notfound.cjs +1 -1
- package/build/components/site-editor-routes/notfound.cjs.map +2 -2
- package/build/components/site-editor-routes/page-item.cjs +1 -6
- package/build/components/site-editor-routes/page-item.cjs.map +2 -2
- package/build/components/site-editor-routes/pages.cjs +6 -9
- package/build/components/site-editor-routes/pages.cjs.map +3 -3
- package/build/components/site-editor-routes/pattern-item.cjs +1 -1
- package/build/components/site-editor-routes/pattern-item.cjs.map +2 -2
- package/build/components/site-editor-routes/patterns.cjs +8 -3
- package/build/components/site-editor-routes/patterns.cjs.map +2 -2
- package/build/components/site-editor-routes/stylebook.cjs +1 -1
- package/build/components/site-editor-routes/stylebook.cjs.map +2 -2
- package/build/components/site-editor-routes/styles.cjs +1 -9
- package/build/components/site-editor-routes/styles.cjs.map +2 -2
- package/build/components/site-editor-routes/template-item.cjs +1 -6
- package/build/components/site-editor-routes/template-item.cjs.map +2 -2
- package/build/components/site-editor-routes/template-part-item.cjs +1 -1
- package/build/components/site-editor-routes/template-part-item.cjs.map +2 -2
- package/build/components/site-editor-routes/templates.cjs +8 -1
- package/build/components/site-editor-routes/templates.cjs.map +2 -2
- package/build/components/welcome-guide/editor.cjs +1 -1
- package/build/components/welcome-guide/editor.cjs.map +1 -1
- package/build/components/welcome-guide/page.cjs +1 -1
- package/build/components/welcome-guide/page.cjs.map +1 -1
- package/build/components/welcome-guide/template.cjs +1 -1
- package/build/components/welcome-guide/template.cjs.map +1 -1
- package/build/store/selectors.cjs +2 -4
- package/build/store/selectors.cjs.map +2 -2
- package/build-module/components/editor/use-editor-title.mjs +1 -1
- package/build-module/components/editor/use-editor-title.mjs.map +2 -2
- package/build-module/components/layout/index.mjs +49 -11
- package/build-module/components/layout/index.mjs.map +2 -2
- package/build-module/components/page-templates/index-legacy.mjs +13 -9
- package/build-module/components/page-templates/index-legacy.mjs.map +2 -2
- package/build-module/components/post-list/quick-edit-modal.mjs +0 -1
- package/build-module/components/post-list/quick-edit-modal.mjs.map +2 -2
- package/build-module/components/resizable-frame/index.mjs.map +2 -2
- package/build-module/components/routes/use-title.mjs +1 -1
- package/build-module/components/routes/use-title.mjs.map +2 -2
- package/build-module/components/save-button/index.mjs +2 -2
- package/build-module/components/save-button/index.mjs.map +1 -1
- package/build-module/components/save-hub/index.mjs +3 -3
- package/build-module/components/save-hub/index.mjs.map +2 -2
- package/build-module/components/sidebar-navigation-item/index.mjs +9 -8
- package/build-module/components/sidebar-navigation-item/index.mjs.map +2 -2
- package/build-module/components/sidebar-navigation-screen/index.mjs +0 -1
- package/build-module/components/sidebar-navigation-screen/index.mjs.map +2 -2
- package/build-module/components/sidebar-navigation-screen-global-styles/index.mjs +2 -14
- package/build-module/components/sidebar-navigation-screen-global-styles/index.mjs.map +2 -2
- package/build-module/components/sidebar-navigation-screen-identity/index.mjs +0 -15
- package/build-module/components/sidebar-navigation-screen-identity/index.mjs.map +2 -2
- package/build-module/components/sidebar-navigation-screen-main/index.mjs +25 -25
- package/build-module/components/sidebar-navigation-screen-main/index.mjs.map +2 -2
- package/build-module/components/sidebar-navigation-screen-patterns/index.mjs +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/index.mjs.map +2 -2
- package/build-module/components/site-editor-routes/home.mjs +1 -1
- package/build-module/components/site-editor-routes/home.mjs.map +2 -2
- package/build-module/components/site-editor-routes/identity.mjs +1 -12
- package/build-module/components/site-editor-routes/identity.mjs.map +2 -2
- package/build-module/components/site-editor-routes/navigation-item.mjs +2 -10
- package/build-module/components/site-editor-routes/navigation-item.mjs.map +2 -2
- package/build-module/components/site-editor-routes/navigation.mjs +2 -10
- package/build-module/components/site-editor-routes/navigation.mjs.map +2 -2
- package/build-module/components/site-editor-routes/notfound.mjs +1 -1
- package/build-module/components/site-editor-routes/notfound.mjs.map +2 -2
- package/build-module/components/site-editor-routes/page-item.mjs +2 -7
- package/build-module/components/site-editor-routes/page-item.mjs.map +2 -2
- package/build-module/components/site-editor-routes/pages.mjs +6 -9
- package/build-module/components/site-editor-routes/pages.mjs.map +2 -2
- package/build-module/components/site-editor-routes/pattern-item.mjs +1 -1
- package/build-module/components/site-editor-routes/pattern-item.mjs.map +2 -2
- package/build-module/components/site-editor-routes/patterns.mjs +8 -3
- package/build-module/components/site-editor-routes/patterns.mjs.map +2 -2
- package/build-module/components/site-editor-routes/stylebook.mjs +1 -1
- package/build-module/components/site-editor-routes/stylebook.mjs.map +2 -2
- package/build-module/components/site-editor-routes/styles.mjs +1 -9
- package/build-module/components/site-editor-routes/styles.mjs.map +2 -2
- package/build-module/components/site-editor-routes/template-item.mjs +2 -7
- package/build-module/components/site-editor-routes/template-item.mjs.map +2 -2
- package/build-module/components/site-editor-routes/template-part-item.mjs +1 -1
- package/build-module/components/site-editor-routes/template-part-item.mjs.map +2 -2
- package/build-module/components/site-editor-routes/templates.mjs +8 -1
- package/build-module/components/site-editor-routes/templates.mjs.map +2 -2
- package/build-module/components/welcome-guide/editor.mjs +1 -1
- package/build-module/components/welcome-guide/editor.mjs.map +1 -1
- package/build-module/components/welcome-guide/page.mjs +1 -1
- package/build-module/components/welcome-guide/page.mjs.map +1 -1
- package/build-module/components/welcome-guide/template.mjs +1 -1
- package/build-module/components/welcome-guide/template.mjs.map +1 -1
- package/build-module/store/selectors.mjs +2 -4
- package/build-module/store/selectors.mjs.map +2 -2
- package/build-style/{experimental-admin-bar-in-editor-rtl.css → experimental-omnibar-rtl.css} +49 -2
- package/build-style/{experimental-admin-bar-in-editor.css → experimental-omnibar.css} +49 -2
- package/build-style/style-rtl.css +476 -248
- package/build-style/style.css +476 -249
- package/package.json +49 -49
- package/src/components/layout/index.js +64 -18
- package/src/components/layout/style.scss +28 -13
- package/src/components/page-patterns/style.scss +1 -2
- package/src/components/page-templates/index-legacy.js +17 -9
- package/src/components/page-templates/style.scss +0 -5
- package/src/components/post-list/quick-edit-modal.js +0 -1
- package/src/components/resizable-frame/index.js +0 -1
- package/src/components/save-hub/index.js +4 -4
- package/src/components/save-hub/style.scss +5 -5
- package/src/components/sidebar-button/style.scss +2 -4
- package/src/components/sidebar-dataviews/style.scss +0 -1
- package/src/components/sidebar-global-styles/style.scss +1 -2
- package/src/components/sidebar-navigation-item/index.js +11 -9
- package/src/components/sidebar-navigation-item/style.scss +6 -7
- package/src/components/sidebar-navigation-screen/index.js +0 -1
- package/src/components/sidebar-navigation-screen/style.scss +9 -9
- package/src/components/sidebar-navigation-screen-global-styles/index.js +2 -15
- package/src/components/sidebar-navigation-screen-identity/index.js +0 -15
- package/src/components/sidebar-navigation-screen-main/index.js +24 -22
- package/src/components/sidebar-navigation-screen-navigation-menu/style.scss +2 -4
- package/src/components/sidebar-navigation-screen-navigation-menus/style.scss +15 -5
- package/src/components/sidebar-navigation-screen-patterns/style.scss +2 -3
- package/src/components/site-editor-routes/README.md +4 -4
- package/src/components/site-editor-routes/home.js +1 -1
- package/src/components/site-editor-routes/identity.js +1 -20
- package/src/components/site-editor-routes/navigation-item.js +2 -21
- package/src/components/site-editor-routes/navigation.js +2 -21
- package/src/components/site-editor-routes/notfound.js +1 -1
- package/src/components/site-editor-routes/page-item.js +1 -10
- package/src/components/site-editor-routes/pages.js +6 -14
- package/src/components/site-editor-routes/pattern-item.js +1 -1
- package/src/components/site-editor-routes/patterns.js +8 -7
- package/src/components/site-editor-routes/stylebook.js +1 -1
- package/src/components/site-editor-routes/styles.js +1 -12
- package/src/components/site-editor-routes/template-item.js +1 -10
- package/src/components/site-editor-routes/template-part-item.js +1 -1
- package/src/components/site-editor-routes/templates.js +8 -1
- package/src/components/site-hub/style.scss +5 -6
- package/src/components/welcome-guide/page.js +1 -1
- package/src/{experimental-admin-bar-in-editor.scss → experimental-omnibar.scss} +6 -2
- package/src/store/selectors.js +3 -7
- 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
|
-
|
|
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
|
-
<
|
|
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
|
-
</
|
|
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:
|
|
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:
|
|
13
|
+
color: var(--wpds-color-foreground-interactive-neutral-active);
|
|
15
14
|
|
|
16
15
|
.edit-site-sidebar-navigation-item__drilldown-indicator {
|
|
17
|
-
fill:
|
|
16
|
+
fill: var(--wpds-color-foreground-interactive-neutral-active);
|
|
18
17
|
}
|
|
19
18
|
}
|
|
20
19
|
|
|
21
20
|
&[aria-current="true"] {
|
|
22
|
-
background:
|
|
23
|
-
color:
|
|
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:
|
|
32
|
+
fill: var(--wpds-color-foreground-interactive-neutral-weak);
|
|
34
33
|
}
|
|
35
34
|
|
|
36
35
|
&.with-suffix {
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
padding: 0 $grid-unit-20;
|
|
24
24
|
|
|
25
25
|
.components-text {
|
|
26
|
-
color:
|
|
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:
|
|
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:
|
|
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
|
|
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:
|
|
119
|
+
background: var(--wpds-color-background-interactive-neutral-weak);
|
|
120
120
|
|
|
121
121
|
.components-button {
|
|
122
|
-
color:
|
|
122
|
+
color: var(--wpds-color-foreground-interactive-neutral) !important;
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
.components-input-control__input {
|
|
126
|
-
color:
|
|
127
|
-
background:
|
|
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:
|
|
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
|
-
</
|
|
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="
|
|
62
|
-
to="/
|
|
53
|
+
uid="navigation-navigation-item"
|
|
54
|
+
to="/navigation"
|
|
63
55
|
withChevron
|
|
64
|
-
icon={
|
|
56
|
+
icon={ navigation }
|
|
65
57
|
>
|
|
66
|
-
{ __( '
|
|
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:
|
|
3
|
+
color: var(--wpds-color-foreground-interactive-neutral);
|
|
6
4
|
&:hover,
|
|
7
5
|
&:focus,
|
|
8
6
|
&[aria-current] {
|
|
9
|
-
color:
|
|
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:
|
|
26
|
+
color: var(--wpds-color-foreground-interactive-neutral-weak);
|
|
28
27
|
&:hover,
|
|
29
28
|
&:focus,
|
|
30
29
|
&[aria-current] {
|
|
31
|
-
color:
|
|
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:
|
|
35
|
+
color: var(--wpds-color-foreground-interactive-neutral-weak);
|
|
37
36
|
&:hover,
|
|
38
37
|
&:focus {
|
|
39
|
-
color:
|
|
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:
|
|
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
|
|
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
|
|
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
|
-
| `
|
|
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. |
|
|
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. |
|
|
@@ -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
|
-
|
|
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
|
-
|
|
33
|
+
mobileSidebar( { siteData } ) {
|
|
53
34
|
if ( ! isThemeDataLoaded( siteData ) ) {
|
|
54
35
|
return <></>;
|
|
55
36
|
}
|
|
56
37
|
return siteData.currentTheme.is_block_theme ? (
|
|
57
|
-
<
|
|
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
|
-
|
|
27
|
+
mobileSidebar( { siteData } ) {
|
|
47
28
|
if ( ! isThemeDataLoaded( siteData ) ) {
|
|
48
29
|
return <></>;
|
|
49
30
|
}
|
|
50
31
|
return siteData.currentTheme.is_block_theme ? (
|
|
51
|
-
<
|
|
32
|
+
<SidebarNavigationScreenNavigationMenus backPath="/" />
|
|
52
33
|
) : (
|
|
53
34
|
<SidebarNavigationScreenUnsupported />
|
|
54
35
|
);
|
|
@@ -30,16 +30,7 @@ export const pageItemRoute = {
|
|
|
30
30
|
<SidebarNavigationScreenUnsupported />
|
|
31
31
|
);
|
|
32
32
|
},
|
|
33
|
-
mobile
|
|
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
|
-
|
|
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
|
|
20
|
+
// Also rendered on mobile, where this route is only reached at canvas=edit.
|
|
21
21
|
preview: <Editor />,
|
|
22
22
|
},
|
|
23
23
|
};
|