@wordpress/boot 0.15.0 → 0.15.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 +11 -0
- package/build-module/components/app/use-route-title.mjs +1 -1
- package/build-module/components/app/use-route-title.mjs.map +2 -2
- package/build-module/components/canvas/back-button.mjs +3 -3
- package/build-module/components/canvas/back-button.mjs.map +2 -2
- package/build-module/components/navigation/index.mjs +2 -2
- package/build-module/components/navigation/index.mjs.map +2 -2
- package/build-module/components/navigation/navigation-item/index.mjs +3 -3
- package/build-module/components/navigation/navigation-item/index.mjs.map +2 -2
- package/build-module/components/navigation/navigation-screen/index.mjs +3 -3
- package/build-module/components/navigation/navigation-screen/index.mjs.map +2 -2
- package/build-module/components/root/index.mjs +121 -100
- package/build-module/components/root/index.mjs.map +2 -2
- package/build-module/components/root/single-page.mjs +45 -25
- package/build-module/components/root/single-page.mjs.map +2 -2
- package/build-module/components/save-button/index.mjs +35 -29
- package/build-module/components/save-button/index.mjs.map +2 -2
- package/build-module/components/site-hub/index.mjs +3 -3
- package/build-module/components/site-hub/index.mjs.map +2 -2
- package/build-module/components/site-icon/index.mjs +3 -3
- package/build-module/components/site-icon/index.mjs.map +2 -2
- package/build-module/components/site-icon-link/index.mjs +28 -20
- package/build-module/components/site-icon-link/index.mjs.map +2 -2
- package/build-module/index.mjs +6 -6
- package/build-module/index.mjs.map +2 -2
- package/build-style/style-rtl.css +180 -187
- package/build-style/style.css +180 -187
- package/build-style/view-transitions-rtl.css +7 -4
- package/build-style/view-transitions.css +7 -4
- package/build-types/components/root/index.d.ts.map +1 -1
- package/build-types/components/root/single-page.d.ts.map +1 -1
- package/build-types/components/save-button/index.d.ts.map +1 -1
- package/build-types/components/site-icon-link/index.d.ts.map +1 -1
- package/package.json +31 -25
- package/src/components/canvas/back-button.scss +2 -2
- package/src/components/navigation/index.tsx +2 -2
- package/src/components/navigation/navigation-item/style.scss +3 -3
- package/src/components/navigation/navigation-screen/style.scss +2 -2
- package/src/components/root/index.tsx +140 -120
- package/src/components/root/single-page.tsx +20 -7
- package/src/components/root/style.scss +10 -10
- package/src/components/save-button/index.tsx +30 -20
- package/src/components/save-button/style.scss +6 -0
- package/src/components/site-hub/style.scss +4 -4
- package/src/components/site-icon/style.scss +1 -1
- package/src/components/site-icon-link/index.tsx +26 -18
- package/src/components/site-icon-link/style.scss +2 -2
- package/src/{experimental-admin-bar-in-editor.scss → experimental-omnibar.scss} +1 -1
- package/src/style.scss +1 -1
- package/src/view-transitions.scss +1 -1
- package/build-module/components/user-theme-provider/index.mjs +0 -33
- package/build-module/components/user-theme-provider/index.mjs.map +0 -7
- package/build-types/components/user-theme-provider/index.d.ts +0 -6
- package/build-types/components/user-theme-provider/index.d.ts.map +0 -1
- package/src/components/user-theme-provider/index.tsx +0 -35
- package/src/components/user-theme-provider/test/index.test.ts +0 -11
- /package/build-style/{experimental-admin-bar-in-editor-rtl.css → experimental-omnibar-rtl.css} +0 -0
- /package/build-style/{experimental-admin-bar-in-editor.css → experimental-omnibar.css} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/boot",
|
|
3
|
-
"version": "0.15.0",
|
|
3
|
+
"version": "0.15.2-next.v.202606191442.0+17fe7db8a",
|
|
4
4
|
"description": "Minimal boot package for WordPress admin pages.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -37,40 +37,46 @@
|
|
|
37
37
|
},
|
|
38
38
|
"./package.json": "./package.json"
|
|
39
39
|
},
|
|
40
|
-
"react-native": "src/index",
|
|
41
40
|
"wpScriptModuleExports": "./build-module/index.mjs",
|
|
42
41
|
"types": "build-types",
|
|
43
42
|
"dependencies": {
|
|
44
|
-
"@wordpress/a11y": "^4.48.0",
|
|
45
|
-
"@wordpress/admin-ui": "^2.3.0",
|
|
46
|
-
"@wordpress/base-styles": "^
|
|
47
|
-
"@wordpress/commands": "^1.48.0",
|
|
48
|
-
"@wordpress/components": "^35.
|
|
49
|
-
"@wordpress/compose": "^8.1.0",
|
|
50
|
-
"@wordpress/core-data": "^7.48.0",
|
|
51
|
-
"@wordpress/data": "^10.48.0",
|
|
52
|
-
"@wordpress/editor": "^14.48.0",
|
|
53
|
-
"@wordpress/element": "^8.0.0",
|
|
54
|
-
"@wordpress/html-entities": "^4.48.0",
|
|
55
|
-
"@wordpress/i18n": "^6.21.0",
|
|
56
|
-
"@wordpress/icons": "^
|
|
57
|
-
"@wordpress/keyboard-shortcuts": "^5.48.0",
|
|
58
|
-
"@wordpress/keycodes": "^4.48.0",
|
|
59
|
-
"@wordpress/lazy-editor": "^1.14.0",
|
|
60
|
-
"@wordpress/notices": "^5.48.0",
|
|
61
|
-
"@wordpress/primitives": "^4.48.0",
|
|
62
|
-
"@wordpress/private-apis": "^1.48.0",
|
|
63
|
-
"@wordpress/route": "^0.14.0",
|
|
64
|
-
"@wordpress/theme": "^0.
|
|
65
|
-
"@wordpress/
|
|
43
|
+
"@wordpress/a11y": "^4.48.2-next.v.202606191442.0+17fe7db8a",
|
|
44
|
+
"@wordpress/admin-ui": "^2.3.2-next.v.202606191442.0+17fe7db8a",
|
|
45
|
+
"@wordpress/base-styles": "^10.0.2-next.v.202606191442.0+17fe7db8a",
|
|
46
|
+
"@wordpress/commands": "^1.48.2-next.v.202606191442.0+17fe7db8a",
|
|
47
|
+
"@wordpress/components": "^35.1.1-next.v.202606191442.0+17fe7db8a",
|
|
48
|
+
"@wordpress/compose": "^8.1.2-next.v.202606191442.0+17fe7db8a",
|
|
49
|
+
"@wordpress/core-data": "^7.48.2-next.v.202606191442.0+17fe7db8a",
|
|
50
|
+
"@wordpress/data": "^10.48.2-next.v.202606191442.0+17fe7db8a",
|
|
51
|
+
"@wordpress/editor": "^14.48.2-next.v.202606191442.0+17fe7db8a",
|
|
52
|
+
"@wordpress/element": "^8.0.2-next.v.202606191442.0+17fe7db8a",
|
|
53
|
+
"@wordpress/html-entities": "^4.48.2-next.v.202606191442.0+17fe7db8a",
|
|
54
|
+
"@wordpress/i18n": "^6.21.2-next.v.202606191442.0+17fe7db8a",
|
|
55
|
+
"@wordpress/icons": "^14.0.2-next.v.202606191442.0+17fe7db8a",
|
|
56
|
+
"@wordpress/keyboard-shortcuts": "^5.48.2-next.v.202606191442.0+17fe7db8a",
|
|
57
|
+
"@wordpress/keycodes": "^4.48.2-next.v.202606191442.0+17fe7db8a",
|
|
58
|
+
"@wordpress/lazy-editor": "^1.14.2-next.v.202606191442.0+17fe7db8a",
|
|
59
|
+
"@wordpress/notices": "^5.48.2-next.v.202606191442.0+17fe7db8a",
|
|
60
|
+
"@wordpress/primitives": "^4.48.2-next.v.202606191442.0+17fe7db8a",
|
|
61
|
+
"@wordpress/private-apis": "^1.48.2-next.v.202606191442.0+17fe7db8a",
|
|
62
|
+
"@wordpress/route": "^0.14.2-next.v.202606191442.0+17fe7db8a",
|
|
63
|
+
"@wordpress/theme": "^0.16.1-next.v.202606191442.0+17fe7db8a",
|
|
64
|
+
"@wordpress/ui": "^0.16.1-next.v.202606191442.0+17fe7db8a",
|
|
65
|
+
"@wordpress/url": "^4.48.2-next.v.202606191442.0+17fe7db8a",
|
|
66
66
|
"clsx": "^2.1.1"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
|
+
"@types/react": "^18.3.27",
|
|
69
70
|
"react": "^18.0.0",
|
|
70
71
|
"react-dom": "^18.0.0"
|
|
71
72
|
},
|
|
73
|
+
"peerDependenciesMeta": {
|
|
74
|
+
"@types/react": {
|
|
75
|
+
"optional": true
|
|
76
|
+
}
|
|
77
|
+
},
|
|
72
78
|
"publishConfig": {
|
|
73
79
|
"access": "public"
|
|
74
80
|
},
|
|
75
|
-
"gitHead": "
|
|
81
|
+
"gitHead": "1b6a19222df5a88f161880b5789efb3171d8f425"
|
|
76
82
|
}
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
display: inline-flex;
|
|
22
22
|
align-items: center;
|
|
23
23
|
justify-content: center;
|
|
24
|
-
background: var(--wpds-color-
|
|
24
|
+
background: var(--wpds-color-background-surface-neutral-weak);
|
|
25
25
|
text-decoration: none;
|
|
26
26
|
padding: 0;
|
|
27
27
|
border-radius: 0;
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
&:focus:not(:active) {
|
|
34
34
|
outline:
|
|
35
35
|
var(--wpds-border-width-focus) solid
|
|
36
|
-
var(--wpds-color-stroke-focus
|
|
36
|
+
var(--wpds-color-stroke-focus);
|
|
37
37
|
outline-offset: calc(-1 * var(--wpds-border-width-focus));
|
|
38
38
|
}
|
|
39
39
|
}
|
|
@@ -72,7 +72,7 @@ function Navigation() {
|
|
|
72
72
|
navigationKey={ navigationKey }
|
|
73
73
|
onNavigate={ handleNavigate }
|
|
74
74
|
content={
|
|
75
|
-
|
|
75
|
+
<div role="list">
|
|
76
76
|
{ items.map( ( item: MenuItem ) => {
|
|
77
77
|
if ( item.parent_type === 'dropdown' ) {
|
|
78
78
|
return (
|
|
@@ -117,7 +117,7 @@ function Navigation() {
|
|
|
117
117
|
</NavigationItem>
|
|
118
118
|
);
|
|
119
119
|
} ) }
|
|
120
|
-
|
|
120
|
+
</div>
|
|
121
121
|
}
|
|
122
122
|
/>
|
|
123
123
|
);
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
@use "@wordpress/base-styles/mixins";
|
|
3
3
|
|
|
4
4
|
.boot-navigation-item.components-item {
|
|
5
|
-
color: var(--wpds-color-
|
|
5
|
+
color: var(--wpds-color-foreground-interactive-neutral);
|
|
6
6
|
padding-inline: variables.$grid-unit-05;
|
|
7
7
|
padding-block: 0;
|
|
8
8
|
margin-inline: variables.$grid-unit-15;
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
&:hover,
|
|
26
26
|
&:focus,
|
|
27
27
|
&[aria-current="true"] {
|
|
28
|
-
color: var(--wpds-color-
|
|
28
|
+
color: var(--wpds-color-foreground-interactive-brand-active);
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
&.active {
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
&[aria-current="true"] {
|
|
40
|
-
color: var(--wpds-color-
|
|
40
|
+
color: var(--wpds-color-foreground-interactive-brand-active);
|
|
41
41
|
font-weight: variables.$font-weight-medium;
|
|
42
42
|
}
|
|
43
43
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
.boot-navigation-screen .components-text {
|
|
9
|
-
color: var(--wpds-color-
|
|
9
|
+
color: var(--wpds-color-foreground-content-neutral);
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
.boot-navigation-screen__title-icon {
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
&#{&},
|
|
25
25
|
&#{&} .boot-navigation-screen__title {
|
|
26
26
|
line-height: variables.$font-line-height-x-large;
|
|
27
|
-
color: var(--wpds-color-
|
|
27
|
+
color: var(--wpds-color-foreground-content-neutral);
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
|
|
@@ -16,9 +16,11 @@ import {
|
|
|
16
16
|
SlotFillProvider,
|
|
17
17
|
} from '@wordpress/components';
|
|
18
18
|
import { menu } from '@wordpress/icons';
|
|
19
|
-
import { useState, useEffect } from '@wordpress/element';
|
|
19
|
+
import { useState, useEffect, useMemo } from '@wordpress/element';
|
|
20
20
|
import { __ } from '@wordpress/i18n';
|
|
21
|
-
import { Page } from '@wordpress/admin-ui';
|
|
21
|
+
import { Page, getAdminThemeColors } from '@wordpress/admin-ui';
|
|
22
|
+
import { Tooltip } from '@wordpress/ui';
|
|
23
|
+
import { privateApis as themePrivateApis } from '@wordpress/theme';
|
|
22
24
|
|
|
23
25
|
/**
|
|
24
26
|
* Internal dependencies
|
|
@@ -30,9 +32,9 @@ import useRouteTitle from '../app/use-route-title';
|
|
|
30
32
|
import { unlock } from '../../lock-unlock';
|
|
31
33
|
import type { CanvasData } from '../../store/types';
|
|
32
34
|
import './style.scss';
|
|
33
|
-
import { UserThemeProvider } from '../user-theme-provider';
|
|
34
35
|
|
|
35
36
|
const { useLocation, useMatches, Outlet } = unlock( routePrivateApis );
|
|
37
|
+
const { ThemeProvider } = unlock( themePrivateApis );
|
|
36
38
|
|
|
37
39
|
export default function Root() {
|
|
38
40
|
const matches = useMatches();
|
|
@@ -57,132 +59,150 @@ export default function Root() {
|
|
|
57
59
|
setIsMobileSidebarOpen( false );
|
|
58
60
|
}, [ location.pathname, isMobileViewport ] );
|
|
59
61
|
|
|
62
|
+
const themeColors = useMemo( getAdminThemeColors, [] );
|
|
63
|
+
|
|
60
64
|
return (
|
|
61
65
|
<SlotFillProvider>
|
|
62
|
-
<
|
|
63
|
-
<
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
size="compact"
|
|
81
|
-
/>
|
|
82
|
-
</Page.SidebarToggleFill>
|
|
83
|
-
) }
|
|
84
|
-
{ /* Mobile Sidebar Backdrop */ }
|
|
85
|
-
<AnimatePresence>
|
|
86
|
-
{ isMobileViewport &&
|
|
87
|
-
isMobileSidebarOpen &&
|
|
88
|
-
! isFullScreen && (
|
|
89
|
-
<motion.div
|
|
90
|
-
initial={ { opacity: 0 } }
|
|
91
|
-
animate={ { opacity: 1 } }
|
|
92
|
-
exit={ { opacity: 0 } }
|
|
93
|
-
transition={ {
|
|
94
|
-
type: 'tween',
|
|
95
|
-
duration: disableMotion ? 0 : 0.2,
|
|
96
|
-
ease: 'easeOut',
|
|
97
|
-
} }
|
|
98
|
-
className="boot-layout__sidebar-backdrop"
|
|
66
|
+
<Tooltip.Provider>
|
|
67
|
+
<ThemeProvider
|
|
68
|
+
isRoot
|
|
69
|
+
color={ { ...themeColors, background: '#f8f8f8' } }
|
|
70
|
+
>
|
|
71
|
+
<ThemeProvider color={ themeColors }>
|
|
72
|
+
<div
|
|
73
|
+
className={ clsx( 'boot-layout', {
|
|
74
|
+
'has-canvas': !! canvas || canvas === null,
|
|
75
|
+
'has-full-canvas': isFullScreen,
|
|
76
|
+
} ) }
|
|
77
|
+
>
|
|
78
|
+
<SavePanel />
|
|
79
|
+
<SnackbarNotices className="boot-notices__snackbar" />
|
|
80
|
+
{ isMobileViewport && (
|
|
81
|
+
<Page.SidebarToggleFill>
|
|
82
|
+
<Button
|
|
83
|
+
icon={ menu }
|
|
99
84
|
onClick={ () =>
|
|
100
|
-
setIsMobileSidebarOpen(
|
|
85
|
+
setIsMobileSidebarOpen( true )
|
|
101
86
|
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
setIsMobileSidebarOpen( false );
|
|
105
|
-
}
|
|
106
|
-
} }
|
|
107
|
-
role="button"
|
|
108
|
-
tabIndex={ -1 }
|
|
109
|
-
aria-label={ __(
|
|
110
|
-
'Close navigation panel'
|
|
111
|
-
) }
|
|
87
|
+
label={ __( 'Open navigation panel' ) }
|
|
88
|
+
size="compact"
|
|
112
89
|
/>
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
</AnimatePresence>
|
|
135
|
-
{ /* Desktop Sidebar */ }
|
|
136
|
-
{ ! isMobileViewport && ! isFullScreen && (
|
|
137
|
-
<div className="boot-layout__sidebar">
|
|
138
|
-
<Sidebar />
|
|
139
|
-
</div>
|
|
140
|
-
) }
|
|
141
|
-
<div className="boot-layout__surfaces">
|
|
142
|
-
<UserThemeProvider color={ { bg: '#ffffff' } }>
|
|
143
|
-
<Outlet />
|
|
144
|
-
{ /* Render Canvas in Root to prevent remounting on route changes */ }
|
|
145
|
-
{ ( canvas || canvas === null ) && (
|
|
146
|
-
<div
|
|
147
|
-
className={ clsx(
|
|
148
|
-
'boot-layout__canvas',
|
|
149
|
-
{
|
|
150
|
-
'has-mobile-drawer':
|
|
151
|
-
canvas?.isPreview &&
|
|
152
|
-
isMobileViewport,
|
|
90
|
+
</Page.SidebarToggleFill>
|
|
91
|
+
) }
|
|
92
|
+
{ /* Mobile Sidebar Backdrop */ }
|
|
93
|
+
<AnimatePresence>
|
|
94
|
+
{ isMobileViewport &&
|
|
95
|
+
isMobileSidebarOpen &&
|
|
96
|
+
! isFullScreen && (
|
|
97
|
+
<motion.div
|
|
98
|
+
initial={ { opacity: 0 } }
|
|
99
|
+
animate={ { opacity: 1 } }
|
|
100
|
+
exit={ { opacity: 0 } }
|
|
101
|
+
transition={ {
|
|
102
|
+
type: 'tween',
|
|
103
|
+
duration: disableMotion
|
|
104
|
+
? 0
|
|
105
|
+
: 0.2,
|
|
106
|
+
ease: 'easeOut',
|
|
107
|
+
} }
|
|
108
|
+
className="boot-layout__sidebar-backdrop"
|
|
109
|
+
onClick={ () =>
|
|
110
|
+
setIsMobileSidebarOpen( false )
|
|
153
111
|
}
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
}
|
|
166
|
-
label={ __(
|
|
167
|
-
'Open navigation panel'
|
|
168
|
-
) }
|
|
169
|
-
size="compact"
|
|
170
|
-
/>
|
|
171
|
-
</div>
|
|
112
|
+
onKeyDown={ ( event ) => {
|
|
113
|
+
if ( event.key === 'Escape' ) {
|
|
114
|
+
setIsMobileSidebarOpen(
|
|
115
|
+
false
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
} }
|
|
119
|
+
role="button"
|
|
120
|
+
tabIndex={ -1 }
|
|
121
|
+
aria-label={ __(
|
|
122
|
+
'Close navigation panel'
|
|
172
123
|
) }
|
|
173
|
-
<CanvasRenderer
|
|
174
|
-
canvas={ canvas }
|
|
175
|
-
routeContentModule={
|
|
176
|
-
routeContentModule
|
|
177
|
-
}
|
|
178
124
|
/>
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
125
|
+
) }
|
|
126
|
+
</AnimatePresence>
|
|
127
|
+
{ /* Mobile Sidebar */ }
|
|
128
|
+
<AnimatePresence>
|
|
129
|
+
{ isMobileViewport &&
|
|
130
|
+
isMobileSidebarOpen &&
|
|
131
|
+
! isFullScreen && (
|
|
132
|
+
<motion.div
|
|
133
|
+
initial={ { x: '-100%' } }
|
|
134
|
+
animate={ { x: 0 } }
|
|
135
|
+
exit={ { x: '-100%' } }
|
|
136
|
+
transition={ {
|
|
137
|
+
type: 'tween',
|
|
138
|
+
duration: disableMotion
|
|
139
|
+
? 0
|
|
140
|
+
: 0.2,
|
|
141
|
+
ease: 'easeOut',
|
|
142
|
+
} }
|
|
143
|
+
className="boot-layout__sidebar is-mobile"
|
|
144
|
+
>
|
|
145
|
+
<Sidebar />
|
|
146
|
+
</motion.div>
|
|
147
|
+
) }
|
|
148
|
+
</AnimatePresence>
|
|
149
|
+
{ /* Desktop Sidebar */ }
|
|
150
|
+
{ ! isMobileViewport && ! isFullScreen && (
|
|
151
|
+
<div className="boot-layout__sidebar">
|
|
152
|
+
<Sidebar />
|
|
153
|
+
</div>
|
|
154
|
+
) }
|
|
155
|
+
<div className="boot-layout__surfaces">
|
|
156
|
+
<ThemeProvider
|
|
157
|
+
color={ {
|
|
158
|
+
...themeColors,
|
|
159
|
+
background: '#ffffff',
|
|
160
|
+
} }
|
|
161
|
+
>
|
|
162
|
+
<Outlet />
|
|
163
|
+
{ /* Render Canvas in Root to prevent remounting on route changes */ }
|
|
164
|
+
{ ( canvas || canvas === null ) && (
|
|
165
|
+
<div
|
|
166
|
+
className={ clsx(
|
|
167
|
+
'boot-layout__canvas',
|
|
168
|
+
{
|
|
169
|
+
'has-mobile-drawer':
|
|
170
|
+
canvas?.isPreview &&
|
|
171
|
+
isMobileViewport,
|
|
172
|
+
}
|
|
173
|
+
) }
|
|
174
|
+
>
|
|
175
|
+
{ canvas?.isPreview &&
|
|
176
|
+
isMobileViewport && (
|
|
177
|
+
<div className="boot-layout__mobile-sidebar-drawer">
|
|
178
|
+
<Button
|
|
179
|
+
icon={ menu }
|
|
180
|
+
onClick={ () =>
|
|
181
|
+
setIsMobileSidebarOpen(
|
|
182
|
+
true
|
|
183
|
+
)
|
|
184
|
+
}
|
|
185
|
+
label={ __(
|
|
186
|
+
'Open navigation panel'
|
|
187
|
+
) }
|
|
188
|
+
size="compact"
|
|
189
|
+
/>
|
|
190
|
+
</div>
|
|
191
|
+
) }
|
|
192
|
+
<CanvasRenderer
|
|
193
|
+
canvas={ canvas }
|
|
194
|
+
routeContentModule={
|
|
195
|
+
routeContentModule
|
|
196
|
+
}
|
|
197
|
+
/>
|
|
198
|
+
</div>
|
|
199
|
+
) }
|
|
200
|
+
</ThemeProvider>
|
|
201
|
+
</div>
|
|
182
202
|
</div>
|
|
183
|
-
</
|
|
184
|
-
</
|
|
185
|
-
</
|
|
203
|
+
</ThemeProvider>
|
|
204
|
+
</ThemeProvider>
|
|
205
|
+
</Tooltip.Provider>
|
|
186
206
|
</SlotFillProvider>
|
|
187
207
|
);
|
|
188
208
|
}
|
|
@@ -9,6 +9,9 @@ import clsx from 'clsx';
|
|
|
9
9
|
import { privateApis as routePrivateApis } from '@wordpress/route';
|
|
10
10
|
import { SnackbarNotices } from '@wordpress/notices';
|
|
11
11
|
import { SlotFillProvider } from '@wordpress/components';
|
|
12
|
+
import { useMemo } from '@wordpress/element';
|
|
13
|
+
import { getAdminThemeColors } from '@wordpress/admin-ui';
|
|
14
|
+
import { privateApis as themePrivateApis } from '@wordpress/theme';
|
|
12
15
|
|
|
13
16
|
/**
|
|
14
17
|
* Internal dependencies
|
|
@@ -19,9 +22,9 @@ import { unlock } from '../../lock-unlock';
|
|
|
19
22
|
import type { CanvasData } from '../../store/types';
|
|
20
23
|
import './style.scss';
|
|
21
24
|
import useRouteTitle from '../app/use-route-title';
|
|
22
|
-
import { UserThemeProvider } from '../user-theme-provider';
|
|
23
25
|
|
|
24
26
|
const { useMatches, Outlet } = unlock( routePrivateApis );
|
|
27
|
+
const { ThemeProvider } = unlock( themePrivateApis );
|
|
25
28
|
|
|
26
29
|
/**
|
|
27
30
|
* Root component for single page mode (no sidebar).
|
|
@@ -40,10 +43,15 @@ export default function RootSinglePage() {
|
|
|
40
43
|
|
|
41
44
|
useRouteTitle();
|
|
42
45
|
|
|
46
|
+
const themeColors = useMemo( getAdminThemeColors, [] );
|
|
47
|
+
|
|
43
48
|
return (
|
|
44
49
|
<SlotFillProvider>
|
|
45
|
-
<
|
|
46
|
-
|
|
50
|
+
<ThemeProvider
|
|
51
|
+
isRoot
|
|
52
|
+
color={ { ...themeColors, background: '#f8f8f8' } }
|
|
53
|
+
>
|
|
54
|
+
<ThemeProvider color={ themeColors }>
|
|
47
55
|
<div
|
|
48
56
|
className={ clsx(
|
|
49
57
|
'boot-layout boot-layout--single-page',
|
|
@@ -56,7 +64,12 @@ export default function RootSinglePage() {
|
|
|
56
64
|
<SavePanel />
|
|
57
65
|
<SnackbarNotices className="boot-notices__snackbar" />
|
|
58
66
|
<div className="boot-layout__surfaces">
|
|
59
|
-
<
|
|
67
|
+
<ThemeProvider
|
|
68
|
+
color={ {
|
|
69
|
+
...themeColors,
|
|
70
|
+
background: '#ffffff',
|
|
71
|
+
} }
|
|
72
|
+
>
|
|
60
73
|
<Outlet />
|
|
61
74
|
{ /* Render Canvas in Root to prevent remounting on route changes */ }
|
|
62
75
|
{ ( canvas || canvas === null ) && (
|
|
@@ -69,11 +82,11 @@ export default function RootSinglePage() {
|
|
|
69
82
|
/>
|
|
70
83
|
</div>
|
|
71
84
|
) }
|
|
72
|
-
</
|
|
85
|
+
</ThemeProvider>
|
|
73
86
|
</div>
|
|
74
87
|
</div>
|
|
75
|
-
</
|
|
76
|
-
</
|
|
88
|
+
</ThemeProvider>
|
|
89
|
+
</ThemeProvider>
|
|
77
90
|
</SlotFillProvider>
|
|
78
91
|
);
|
|
79
92
|
}
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
width: 100%;
|
|
7
7
|
display: flex;
|
|
8
8
|
flex-direction: row;
|
|
9
|
-
color: var(--wpds-color-
|
|
9
|
+
color: var(--wpds-color-foreground-content-neutral);
|
|
10
10
|
isolation: isolate;
|
|
11
|
-
background: var(--wpds-color-
|
|
11
|
+
background: var(--wpds-color-background-surface-neutral-weak);
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
.boot-layout__sidebar-backdrop {
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
inset-inline-start: 0;
|
|
37
37
|
width: 300px;
|
|
38
38
|
max-width: 85vw;
|
|
39
|
-
background: var(--wpds-color-
|
|
39
|
+
background: var(--wpds-color-background-surface-neutral-weak);
|
|
40
40
|
z-index: 100003;
|
|
41
41
|
box-shadow: 2px 0 8px rgba(0, 0, 0, 0.2);
|
|
42
42
|
}
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
z-index: 3;
|
|
56
|
-
background: var(--wpds-color-
|
|
56
|
+
background: var(--wpds-color-background-surface-neutral);
|
|
57
57
|
padding: variables.$grid-unit-20;
|
|
58
58
|
border-bottom: 1px solid var(--wpds-color-stroke-surface-neutral-weak);
|
|
59
59
|
display: flex;
|
|
@@ -86,8 +86,8 @@
|
|
|
86
86
|
.boot-layout__inspector {
|
|
87
87
|
flex: 1;
|
|
88
88
|
overflow-y: auto;
|
|
89
|
-
background: var(--wpds-color-
|
|
90
|
-
color: var(--wpds-color-
|
|
89
|
+
background: var(--wpds-color-background-surface-neutral);
|
|
90
|
+
color: var(--wpds-color-foreground-content-neutral);
|
|
91
91
|
position: relative;
|
|
92
92
|
|
|
93
93
|
// Mobile-first: surfaces take full screen with fixed positioning
|
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
position: static;
|
|
112
112
|
width: auto;
|
|
113
113
|
height: auto;
|
|
114
|
-
border-radius:
|
|
114
|
+
border-radius: var(--wpds-border-radius-xl);
|
|
115
115
|
margin: 0;
|
|
116
116
|
|
|
117
117
|
.boot-layout--single-page & {
|
|
@@ -139,8 +139,8 @@
|
|
|
139
139
|
.boot-layout__canvas {
|
|
140
140
|
flex: 1;
|
|
141
141
|
overflow-y: auto;
|
|
142
|
-
background: var(--wpds-color-
|
|
143
|
-
color: var(--wpds-color-
|
|
142
|
+
background: var(--wpds-color-background-surface-neutral);
|
|
143
|
+
color: var(--wpds-color-foreground-content-neutral);
|
|
144
144
|
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
|
145
145
|
border: 1px solid var(--wpds-color-stroke-surface-neutral-weak);
|
|
146
146
|
position: relative;
|
|
@@ -167,7 +167,7 @@
|
|
|
167
167
|
position: static;
|
|
168
168
|
width: auto;
|
|
169
169
|
height: auto;
|
|
170
|
-
border-radius:
|
|
170
|
+
border-radius: var(--wpds-border-radius-xl);
|
|
171
171
|
z-index: auto;
|
|
172
172
|
|
|
173
173
|
.boot-layout--single-page & {
|
|
@@ -8,7 +8,8 @@ import { store as coreStore } from '@wordpress/core-data';
|
|
|
8
8
|
import { displayShortcut, rawShortcut } from '@wordpress/keycodes';
|
|
9
9
|
import { check } from '@wordpress/icons';
|
|
10
10
|
import { EntitiesSavedStates } from '@wordpress/editor';
|
|
11
|
-
import { Button, Modal
|
|
11
|
+
import { Button, Modal } from '@wordpress/components';
|
|
12
|
+
import { Tooltip } from '@wordpress/ui';
|
|
12
13
|
|
|
13
14
|
/**
|
|
14
15
|
* Internal dependencies
|
|
@@ -82,28 +83,37 @@ export default function SaveButton() {
|
|
|
82
83
|
);
|
|
83
84
|
};
|
|
84
85
|
const label = getLabel();
|
|
86
|
+
const shortcut = displayShortcut.primary( 's' );
|
|
85
87
|
|
|
86
88
|
return (
|
|
87
89
|
<>
|
|
88
|
-
<
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
90
|
+
<Tooltip.Root>
|
|
91
|
+
<Tooltip.Trigger
|
|
92
|
+
render={
|
|
93
|
+
<Button
|
|
94
|
+
variant="primary"
|
|
95
|
+
size="compact"
|
|
96
|
+
onClick={ () => setIsSaveViewOpened( true ) }
|
|
97
|
+
onBlur={ hideSavedState }
|
|
98
|
+
disabled={ disabled }
|
|
99
|
+
accessibleWhenDisabled
|
|
100
|
+
isBusy={ isSaving }
|
|
101
|
+
aria-keyshortcuts={ rawShortcut.primary( 's' ) }
|
|
102
|
+
className="boot-save-button"
|
|
103
|
+
icon={ isInSavedState ? check : undefined }
|
|
104
|
+
>
|
|
105
|
+
{ label }
|
|
106
|
+
</Button>
|
|
107
|
+
}
|
|
108
|
+
/>
|
|
109
|
+
<Tooltip.Popup>
|
|
110
|
+
{ hasChanges && <span>{ label }</span> }
|
|
111
|
+
{ /* TODO: replace with a future `@wordpress/ui` `Shortcut` primitive once available */ }
|
|
112
|
+
<span className="boot-save-button__shortcut">
|
|
113
|
+
{ shortcut }
|
|
114
|
+
</span>
|
|
115
|
+
</Tooltip.Popup>
|
|
116
|
+
</Tooltip.Root>
|
|
107
117
|
{ isSaveViewOpen && (
|
|
108
118
|
<Modal
|
|
109
119
|
title={ __( 'Review changes' ) }
|