@wordpress/boot 0.20.0 → 0.21.2-next.v.202608281122.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 +38 -0
- package/README.md +4 -0
- package/build-module/components/app/router.mjs +100 -4
- package/build-module/components/app/router.mjs.map +3 -3
- package/build-module/components/canvas/index.mjs +72 -13
- package/build-module/components/canvas/index.mjs.map +2 -2
- package/build-module/components/canvas/site-preview.mjs +50 -0
- package/build-module/components/canvas/site-preview.mjs.map +7 -0
- package/build-module/components/canvas/use-navigate-to-entity-record.mjs +122 -0
- package/build-module/components/canvas/use-navigate-to-entity-record.mjs.map +7 -0
- package/build-module/components/canvas/viewport.mjs +18 -0
- package/build-module/components/canvas/viewport.mjs.map +7 -0
- package/build-module/components/error-boundary/index.mjs +129 -0
- package/build-module/components/error-boundary/index.mjs.map +7 -0
- package/build-module/components/navigation/drilldown-item/index.mjs +91 -1
- package/build-module/components/navigation/drilldown-item/index.mjs.map +3 -3
- package/build-module/components/navigation/dropdown-item/index.mjs +98 -11
- package/build-module/components/navigation/dropdown-item/index.mjs.map +4 -4
- package/build-module/components/navigation/index.mjs +0 -1
- package/build-module/components/navigation/index.mjs.map +2 -2
- package/build-module/components/navigation/navigation-item/index.mjs +88 -15
- package/build-module/components/navigation/navigation-item/index.mjs.map +3 -3
- package/build-module/components/navigation/navigation-screen/index.mjs +111 -38
- package/build-module/components/navigation/navigation-screen/index.mjs.map +3 -3
- package/build-module/components/plugin-area/index.mjs +29 -0
- package/build-module/components/plugin-area/index.mjs.map +7 -0
- package/build-module/components/root/index.mjs +220 -122
- package/build-module/components/root/index.mjs.map +3 -3
- package/build-module/components/root/single-page.mjs +139 -47
- package/build-module/components/root/single-page.mjs.map +3 -3
- package/build-module/components/root/use-sync-body-background.mjs.map +1 -1
- package/build-module/components/save-button/index.mjs +127 -16
- package/build-module/components/save-button/index.mjs.map +3 -3
- package/build-module/components/save-panel/index.mjs +91 -1
- package/build-module/components/save-panel/index.mjs.map +3 -3
- package/build-module/components/sidebar/index.mjs +90 -10
- package/build-module/components/sidebar/index.mjs.map +3 -3
- package/build-module/index.mjs +0 -16
- package/build-module/index.mjs.map +3 -3
- package/build-module/store/actions.mjs +8 -0
- package/build-module/store/actions.mjs.map +2 -2
- package/build-module/store/reducer.mjs +16 -1
- package/build-module/store/reducer.mjs.map +2 -2
- package/build-module/store/selectors.mjs +9 -0
- package/build-module/store/selectors.mjs.map +2 -2
- package/build-types/components/app/router.d.ts.map +1 -1
- package/build-types/components/canvas/index.d.ts.map +1 -1
- package/build-types/components/canvas/site-preview.d.ts +10 -0
- package/build-types/components/canvas/site-preview.d.ts.map +1 -0
- package/build-types/components/canvas/use-navigate-to-entity-record.d.ts +40 -0
- package/build-types/components/canvas/use-navigate-to-entity-record.d.ts.map +1 -0
- package/build-types/components/canvas/viewport.d.ts +15 -0
- package/build-types/components/canvas/viewport.d.ts.map +1 -0
- package/build-types/components/error-boundary/index.d.ts +22 -0
- package/build-types/components/error-boundary/index.d.ts.map +1 -0
- package/build-types/components/navigation/drilldown-item/index.d.ts.map +1 -1
- package/build-types/components/navigation/dropdown-item/index.d.ts +0 -1
- package/build-types/components/navigation/dropdown-item/index.d.ts.map +1 -1
- package/build-types/components/navigation/index.d.ts.map +1 -1
- package/build-types/components/navigation/navigation-item/index.d.ts +0 -1
- package/build-types/components/navigation/navigation-item/index.d.ts.map +1 -1
- package/build-types/components/navigation/navigation-screen/index.d.ts +0 -1
- package/build-types/components/navigation/navigation-screen/index.d.ts.map +1 -1
- package/build-types/components/plugin-area/index.d.ts +12 -0
- package/build-types/components/plugin-area/index.d.ts.map +1 -0
- package/build-types/components/root/index.d.ts +0 -1
- package/build-types/components/root/index.d.ts.map +1 -1
- package/build-types/components/root/single-page.d.ts +0 -1
- package/build-types/components/root/single-page.d.ts.map +1 -1
- package/build-types/components/root/use-sync-body-background.d.ts +1 -1
- package/build-types/components/save-button/index.d.ts +0 -1
- package/build-types/components/save-button/index.d.ts.map +1 -1
- package/build-types/components/save-panel/index.d.ts.map +1 -1
- package/build-types/components/sidebar/index.d.ts +0 -1
- package/build-types/components/sidebar/index.d.ts.map +1 -1
- package/build-types/index.d.ts +0 -2
- package/build-types/index.d.ts.map +1 -1
- package/build-types/store/actions.d.ts +15 -2
- package/build-types/store/actions.d.ts.map +1 -1
- package/build-types/store/reducer.d.ts.map +1 -1
- package/build-types/store/selectors.d.ts +12 -0
- package/build-types/store/selectors.d.ts.map +1 -1
- package/build-types/store/types.d.ts +34 -3
- package/build-types/store/types.d.ts.map +1 -1
- package/package.json +27 -25
- package/src/components/app/router.tsx +19 -7
- package/src/components/canvas/index.tsx +117 -15
- package/src/components/canvas/site-preview.tsx +64 -0
- package/src/components/canvas/use-navigate-to-entity-record.ts +220 -0
- package/src/components/canvas/viewport.ts +34 -0
- package/src/components/error-boundary/index.tsx +71 -0
- package/src/components/error-boundary/style.module.scss +13 -0
- package/src/components/navigation/drilldown-item/index.tsx +2 -1
- package/src/components/navigation/dropdown-item/index.tsx +10 -6
- package/src/components/navigation/dropdown-item/{style.scss → style.module.scss} +6 -2
- package/src/components/navigation/index.tsx +0 -1
- package/src/components/navigation/navigation-item/index.tsx +3 -6
- package/src/components/navigation/navigation-item/{style.scss → style.module.scss} +7 -14
- package/src/components/navigation/navigation-screen/index.tsx +6 -15
- package/src/components/navigation/navigation-screen/{style.scss → style.module.scss} +10 -9
- package/src/components/plugin-area/index.tsx +34 -0
- package/src/components/root/{style.scss → _layout.module.scss} +71 -40
- package/src/components/root/_view-transitions.module.scss +205 -0
- package/src/components/root/index.tsx +44 -24
- package/src/components/root/single-page.tsx +15 -7
- package/src/components/root/style.module.scss +2 -0
- package/src/components/root/use-sync-body-background.ts +1 -1
- package/src/components/save-button/index.tsx +36 -14
- package/src/components/save-button/style.module.scss +10 -0
- package/src/components/save-panel/index.tsx +2 -1
- package/src/components/save-panel/style.module.scss +7 -0
- package/src/components/sidebar/index.tsx +5 -5
- package/src/components/sidebar/style.module.scss +29 -0
- package/src/index.tsx +0 -2
- package/src/store/actions.ts +18 -1
- package/src/store/reducer.ts +19 -0
- package/src/store/selectors.ts +28 -0
- package/src/store/types.ts +37 -3
- package/build-style/style-rtl.css +0 -133
- package/build-style/style.css +0 -133
- package/build-style/view-transitions-rtl.css +0 -189
- package/build-style/view-transitions.css +0 -189
- package/src/components/save-button/style.scss +0 -9
- package/src/components/sidebar/style.scss +0 -23
- package/src/style.scss +0 -34
- package/src/view-transitions.scss +0 -221
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
@use "@wordpress/base-styles/variables";
|
|
3
3
|
@use "@wordpress/base-styles/mixins";
|
|
4
4
|
|
|
5
|
-
.
|
|
5
|
+
.layout {
|
|
6
6
|
height: 100%;
|
|
7
7
|
width: 100%;
|
|
8
8
|
display: flex;
|
|
@@ -10,20 +10,51 @@
|
|
|
10
10
|
color: var(--wpds-color-foreground-content-neutral);
|
|
11
11
|
isolation: isolate;
|
|
12
12
|
background: var(--wpds-color-background-surface-neutral-weak);
|
|
13
|
+
|
|
14
|
+
@include mixins.break-small {
|
|
15
|
+
position: absolute;
|
|
16
|
+
top: 0;
|
|
17
|
+
inset-inline-end: 0;
|
|
18
|
+
bottom: 0;
|
|
19
|
+
inset-inline-start: 0;
|
|
20
|
+
min-height: calc(100vh - #{variables.$admin-bar-height-big});
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@include mixins.break-medium {
|
|
24
|
+
min-height: calc(100vh - #{variables.$admin-bar-height});
|
|
25
|
+
|
|
26
|
+
body:has(.layout.has-full-canvas) & {
|
|
27
|
+
min-height: 100vh;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
:where(.layout) img {
|
|
33
|
+
max-width: 100%;
|
|
34
|
+
height: auto;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.layout .notices-snackbar {
|
|
38
|
+
@include mixins.snackbar-container();
|
|
39
|
+
|
|
40
|
+
// The mixin's descendant selector is local in this CSS Module.
|
|
41
|
+
:global(.components-snackbar) {
|
|
42
|
+
margin-inline: auto;
|
|
43
|
+
}
|
|
13
44
|
}
|
|
14
45
|
|
|
15
|
-
.
|
|
46
|
+
.sidebar-backdrop {
|
|
16
47
|
position: fixed;
|
|
17
48
|
top: 0;
|
|
18
|
-
|
|
19
|
-
|
|
49
|
+
inset-inline-start: 0;
|
|
50
|
+
inset-inline-end: 0;
|
|
20
51
|
bottom: 0;
|
|
21
52
|
background-color: rgba(0, 0, 0, 0.5);
|
|
22
53
|
z-index: 100002;
|
|
23
54
|
cursor: var(--wpds-cursor-control);
|
|
24
55
|
}
|
|
25
56
|
|
|
26
|
-
.
|
|
57
|
+
.sidebar {
|
|
27
58
|
height: 100%;
|
|
28
59
|
flex-shrink: 0;
|
|
29
60
|
width: 240px;
|
|
@@ -43,13 +74,13 @@
|
|
|
43
74
|
}
|
|
44
75
|
}
|
|
45
76
|
|
|
46
|
-
.
|
|
77
|
+
.mobile-sidebar-drawer {
|
|
47
78
|
position: fixed;
|
|
48
79
|
top: 0;
|
|
49
|
-
|
|
50
|
-
|
|
80
|
+
inset-inline-start: 0;
|
|
81
|
+
inset-inline-end: 0;
|
|
51
82
|
|
|
52
|
-
.
|
|
83
|
+
.layout-single-page & {
|
|
53
84
|
top: variables.$admin-bar-height-big;
|
|
54
85
|
}
|
|
55
86
|
|
|
@@ -62,12 +93,12 @@
|
|
|
62
93
|
align-items: center;
|
|
63
94
|
}
|
|
64
95
|
|
|
65
|
-
.
|
|
96
|
+
.canvas.has-mobile-drawer {
|
|
66
97
|
position: relative;
|
|
67
98
|
padding-top: 65px;
|
|
68
99
|
}
|
|
69
100
|
|
|
70
|
-
.
|
|
101
|
+
.surfaces {
|
|
71
102
|
display: flex;
|
|
72
103
|
flex-grow: 1;
|
|
73
104
|
margin: 0;
|
|
@@ -76,15 +107,15 @@
|
|
|
76
107
|
@include mixins.break-medium {
|
|
77
108
|
margin: variables.$grid-unit-10;
|
|
78
109
|
|
|
79
|
-
.
|
|
110
|
+
.layout-single-page & {
|
|
80
111
|
margin-top: 0;
|
|
81
112
|
margin-inline-start: 0;
|
|
82
113
|
}
|
|
83
114
|
}
|
|
84
115
|
}
|
|
85
116
|
|
|
86
|
-
.
|
|
87
|
-
.
|
|
117
|
+
.stage,
|
|
118
|
+
.inspector {
|
|
88
119
|
flex: 1;
|
|
89
120
|
overflow-y: auto;
|
|
90
121
|
background: var(--wpds-color-background-surface-neutral);
|
|
@@ -94,15 +125,15 @@
|
|
|
94
125
|
// Mobile-first: surfaces take full screen with fixed positioning
|
|
95
126
|
position: fixed;
|
|
96
127
|
top: 0;
|
|
97
|
-
|
|
98
|
-
|
|
128
|
+
inset-inline-start: 0;
|
|
129
|
+
inset-inline-end: 0;
|
|
99
130
|
bottom: 0;
|
|
100
131
|
width: 100vw;
|
|
101
132
|
height: 100vh;
|
|
102
133
|
border-radius: 0;
|
|
103
134
|
margin: 0;
|
|
104
135
|
|
|
105
|
-
.
|
|
136
|
+
.layout-single-page & {
|
|
106
137
|
top: variables.$admin-bar-height-big;
|
|
107
138
|
height: calc(100vh - variables.$admin-bar-height-big);
|
|
108
139
|
}
|
|
@@ -115,13 +146,13 @@
|
|
|
115
146
|
border-radius: var(--wpds-border-radius-xl);
|
|
116
147
|
margin: 0;
|
|
117
148
|
|
|
118
|
-
.
|
|
149
|
+
.layout-single-page & {
|
|
119
150
|
height: auto;
|
|
120
151
|
}
|
|
121
152
|
}
|
|
122
153
|
}
|
|
123
154
|
|
|
124
|
-
.
|
|
155
|
+
.stage {
|
|
125
156
|
z-index: 2; // Highest surface priority on mobile
|
|
126
157
|
|
|
127
158
|
@include mixins.break-medium {
|
|
@@ -129,7 +160,7 @@
|
|
|
129
160
|
}
|
|
130
161
|
}
|
|
131
162
|
|
|
132
|
-
.
|
|
163
|
+
.inspector {
|
|
133
164
|
z-index: 3; // Medium surface priority on mobile
|
|
134
165
|
|
|
135
166
|
@include mixins.break-medium {
|
|
@@ -137,7 +168,7 @@
|
|
|
137
168
|
}
|
|
138
169
|
}
|
|
139
170
|
|
|
140
|
-
.
|
|
171
|
+
.canvas {
|
|
141
172
|
flex: 1;
|
|
142
173
|
overflow-y: auto;
|
|
143
174
|
background: var(--wpds-color-background-surface-neutral);
|
|
@@ -149,8 +180,8 @@
|
|
|
149
180
|
// Mobile-first: full screen with lowest priority
|
|
150
181
|
position: fixed;
|
|
151
182
|
top: 0;
|
|
152
|
-
|
|
153
|
-
|
|
183
|
+
inset-inline-start: 0;
|
|
184
|
+
inset-inline-end: 0;
|
|
154
185
|
bottom: 0;
|
|
155
186
|
width: 100vw;
|
|
156
187
|
height: 100vh;
|
|
@@ -158,7 +189,7 @@
|
|
|
158
189
|
border-radius: 0;
|
|
159
190
|
margin: 0;
|
|
160
191
|
|
|
161
|
-
.
|
|
192
|
+
.layout-single-page & {
|
|
162
193
|
top: variables.$admin-bar-height-big;
|
|
163
194
|
height: calc(100vh - variables.$admin-bar-height-big);
|
|
164
195
|
}
|
|
@@ -171,42 +202,42 @@
|
|
|
171
202
|
border-radius: var(--wpds-border-radius-xl);
|
|
172
203
|
z-index: auto;
|
|
173
204
|
|
|
174
|
-
.
|
|
205
|
+
.layout-single-page & {
|
|
175
206
|
height: auto;
|
|
176
207
|
}
|
|
177
208
|
}
|
|
178
209
|
}
|
|
179
210
|
|
|
180
|
-
.
|
|
181
|
-
.
|
|
211
|
+
.layout.has-canvas .stage,
|
|
212
|
+
.inspector {
|
|
182
213
|
@include mixins.break-medium {
|
|
183
214
|
max-width: 400px;
|
|
184
215
|
}
|
|
185
216
|
}
|
|
186
217
|
|
|
187
|
-
.
|
|
218
|
+
.canvas :global(.interface-interface-skeleton) {
|
|
188
219
|
position: relative;
|
|
189
220
|
height: 100%;
|
|
190
221
|
top: 0 !important;
|
|
191
|
-
|
|
222
|
+
inset-inline-start: 0 !important;
|
|
192
223
|
}
|
|
193
224
|
|
|
194
225
|
// Full-screen canvas mode
|
|
195
|
-
.
|
|
226
|
+
.layout.has-full-canvas .surfaces {
|
|
196
227
|
margin: 0;
|
|
197
228
|
gap: 0;
|
|
198
229
|
}
|
|
199
230
|
|
|
200
|
-
.
|
|
201
|
-
.
|
|
231
|
+
.layout.has-full-canvas .stage,
|
|
232
|
+
.layout.has-full-canvas .inspector {
|
|
202
233
|
display: none;
|
|
203
234
|
}
|
|
204
235
|
|
|
205
|
-
.
|
|
236
|
+
.layout.has-full-canvas .canvas {
|
|
206
237
|
position: fixed;
|
|
207
238
|
top: var(--wp-admin--admin-bar--height, 0);
|
|
208
|
-
|
|
209
|
-
|
|
239
|
+
inset-inline-start: 0;
|
|
240
|
+
inset-inline-end: 0;
|
|
210
241
|
bottom: 0;
|
|
211
242
|
max-width: none;
|
|
212
243
|
margin: 0;
|
|
@@ -215,7 +246,7 @@
|
|
|
215
246
|
box-shadow: none;
|
|
216
247
|
overflow: hidden;
|
|
217
248
|
|
|
218
|
-
.
|
|
249
|
+
.layout-single-page & {
|
|
219
250
|
top: variables.$admin-bar-height-big;
|
|
220
251
|
|
|
221
252
|
@include mixins.break-medium {
|
|
@@ -226,14 +257,14 @@
|
|
|
226
257
|
}
|
|
227
258
|
|
|
228
259
|
@media (max-width: #{breakpoints.$break-medium}) {
|
|
229
|
-
.
|
|
230
|
-
.
|
|
231
|
-
.
|
|
260
|
+
.stage,
|
|
261
|
+
.inspector,
|
|
262
|
+
.canvas:not(.has-mobile-drawer) {
|
|
232
263
|
top: var(--wp-admin--admin-bar--height, 0);
|
|
233
264
|
height: calc(100vh - var(--wp-admin--admin-bar--height, 0px));
|
|
234
265
|
}
|
|
235
266
|
|
|
236
|
-
.
|
|
267
|
+
.mobile-sidebar-drawer {
|
|
237
268
|
top: var(--wp-admin--admin-bar--height, 0);
|
|
238
269
|
}
|
|
239
270
|
}
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
@use "@wordpress/base-styles/colors";
|
|
2
|
+
|
|
3
|
+
@media not (prefers-reduced-motion: reduce) {
|
|
4
|
+
.canvas :global(.interface-interface-skeleton__header) {
|
|
5
|
+
view-transition-name: boot--canvas-header;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.canvas :global(.interface-interface-skeleton__sidebar) {
|
|
9
|
+
view-transition-name: boot--canvas-sidebar;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.stage {
|
|
13
|
+
view-transition-name: boot--stage;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.inspector {
|
|
17
|
+
view-transition-name: boot--inspector;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.canvas {
|
|
21
|
+
view-transition-name: boot--canvas;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@supports (-webkit-hyphens:none) and (not (-moz-appearance:none)) {
|
|
25
|
+
.stage {
|
|
26
|
+
view-transition-name: boot-safari--stage;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.inspector {
|
|
30
|
+
view-transition-name: boot-safari--inspector;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.canvas {
|
|
34
|
+
view-transition-name: boot-safari--canvas;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// View transitions are scoped to documents that contain the Boot layout.
|
|
40
|
+
:root:has(.layout) {
|
|
41
|
+
@media (max-width: 782px) {
|
|
42
|
+
* {
|
|
43
|
+
view-transition-name: none !important;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
&::view-transition-old(root),
|
|
48
|
+
&::view-transition-new(root) {
|
|
49
|
+
animation-duration: 250ms;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
@media not (prefers-reduced-motion: reduce) {
|
|
53
|
+
:global(.components-popover):first-of-type {
|
|
54
|
+
view-transition-name: boot--components-popover;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
&::view-transition-group(boot--canvas-header),
|
|
59
|
+
&::view-transition-group(boot--canvas-sidebar),
|
|
60
|
+
&::view-transition-group(boot-safari--canvas),
|
|
61
|
+
&::view-transition-group(boot--canvas) {
|
|
62
|
+
z-index: 1;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
&::view-transition-new(boot-safari--canvas),
|
|
66
|
+
&::view-transition-old(boot-safari--canvas),
|
|
67
|
+
&::view-transition-new(boot-safari--stage),
|
|
68
|
+
&::view-transition-old(boot-safari--stage),
|
|
69
|
+
&::view-transition-old(boot-safari--inspector),
|
|
70
|
+
&::view-transition-new(boot-safari--inspector) {
|
|
71
|
+
width: auto;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
&::view-transition-new(boot--canvas),
|
|
75
|
+
&::view-transition-old(boot--canvas),
|
|
76
|
+
&::view-transition-new(boot--stage),
|
|
77
|
+
&::view-transition-old(boot--stage),
|
|
78
|
+
&::view-transition-new(boot--inspector),
|
|
79
|
+
&::view-transition-old(boot--inspector) {
|
|
80
|
+
background: colors.$white;
|
|
81
|
+
border-radius: var(--wpds-border-radius-xl);
|
|
82
|
+
width: 100%;
|
|
83
|
+
height: 100%;
|
|
84
|
+
object-fit: none;
|
|
85
|
+
object-position: left top;
|
|
86
|
+
overflow: hidden;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
&::view-transition-new(boot--canvas),
|
|
90
|
+
&::view-transition-old(boot--canvas) {
|
|
91
|
+
object-position: center top;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
&::view-transition-old(boot-safari--inspector):only-child,
|
|
95
|
+
&::view-transition-old(boot--inspector):only-child,
|
|
96
|
+
&::view-transition-old(boot-safari--stage):only-child,
|
|
97
|
+
&::view-transition-old(boot--stage):only-child {
|
|
98
|
+
animation-name: zoomOut;
|
|
99
|
+
will-change: transform, opacity;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
&::view-transition-new(boot-safari--inspector):only-child,
|
|
103
|
+
&::view-transition-new(boot--inspector):only-child,
|
|
104
|
+
&::view-transition-new(boot-safari--stage):only-child,
|
|
105
|
+
&::view-transition-new(boot--stage):only-child {
|
|
106
|
+
animation-name: zoomIn;
|
|
107
|
+
will-change: transform, opacity;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
&::view-transition-new(boot-safari--canvas):only-child,
|
|
111
|
+
&::view-transition-new(boot--canvas):only-child {
|
|
112
|
+
animation-name: slideFromRight;
|
|
113
|
+
will-change: transform;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
&::view-transition-old(boot-safari--canvas):only-child,
|
|
117
|
+
&::view-transition-old(boot--canvas):only-child {
|
|
118
|
+
animation-name: slideToRight;
|
|
119
|
+
will-change: transform;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
&::view-transition-new(boot--canvas-header):only-child {
|
|
123
|
+
animation-name: slideHeaderFromTop;
|
|
124
|
+
will-change: transform;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
&::view-transition-old(boot--canvas-header):only-child {
|
|
128
|
+
animation-name: slideHeaderToTop;
|
|
129
|
+
will-change: transform;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
&::view-transition-new(boot--canvas-sidebar):only-child {
|
|
133
|
+
animation-name: slideSidebarFromRight;
|
|
134
|
+
will-change: transform;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
&::view-transition-old(boot--canvas-sidebar):only-child {
|
|
138
|
+
animation-name: slideSidebarToRight;
|
|
139
|
+
will-change: transform;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
@keyframes zoomOut {
|
|
144
|
+
from {
|
|
145
|
+
transform: scale(1);
|
|
146
|
+
opacity: 1;
|
|
147
|
+
}
|
|
148
|
+
to {
|
|
149
|
+
transform: scale(0.9);
|
|
150
|
+
opacity: 0;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
@keyframes zoomIn {
|
|
155
|
+
from {
|
|
156
|
+
transform: scale(0.95);
|
|
157
|
+
opacity: 0;
|
|
158
|
+
}
|
|
159
|
+
to {
|
|
160
|
+
transform: scale(1);
|
|
161
|
+
opacity: 1;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
@keyframes slideFromRight {
|
|
166
|
+
from {
|
|
167
|
+
transform: translateX(100vw);
|
|
168
|
+
}
|
|
169
|
+
to {
|
|
170
|
+
transform: translateX(0);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
@keyframes slideToRight {
|
|
175
|
+
from {
|
|
176
|
+
transform: translateX(0);
|
|
177
|
+
}
|
|
178
|
+
to {
|
|
179
|
+
transform: translateX(100vw);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
@keyframes slideHeaderFromTop {
|
|
184
|
+
from {
|
|
185
|
+
transform: translateY(-100%);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
@keyframes slideHeaderToTop {
|
|
190
|
+
to {
|
|
191
|
+
transform: translateY(-100%);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
@keyframes slideSidebarFromRight {
|
|
196
|
+
from {
|
|
197
|
+
transform: translateX(100%);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
@keyframes slideSidebarToRight {
|
|
202
|
+
to {
|
|
203
|
+
transform: translateX(100%);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
@@ -11,17 +11,20 @@ import {
|
|
|
11
11
|
import { menu } from '@wordpress/icons';
|
|
12
12
|
import { useState, useEffect, useMemo } from '@wordpress/element';
|
|
13
13
|
import { __ } from '@wordpress/i18n';
|
|
14
|
+
import { UnsavedChangesWarning } from '@wordpress/editor';
|
|
14
15
|
import { Page, getAdminThemeColors } from '@wordpress/admin-ui';
|
|
15
16
|
import { Tooltip } from '@wordpress/ui';
|
|
16
17
|
import { ThemeProvider } from '@wordpress/theme';
|
|
17
18
|
import Sidebar from '../sidebar';
|
|
18
19
|
import SavePanel from '../save-panel';
|
|
19
20
|
import CanvasRenderer from '../canvas-renderer';
|
|
21
|
+
import ErrorBoundary from '../error-boundary';
|
|
22
|
+
import PluginArea from '../plugin-area';
|
|
20
23
|
import useRouteTitle from '../app/use-route-title';
|
|
21
24
|
import { unlock } from '../../lock-unlock';
|
|
22
25
|
import type { CanvasData } from '../../store/types';
|
|
23
26
|
import useSyncBodyBackground from './use-sync-body-background';
|
|
24
|
-
import './style.scss';
|
|
27
|
+
import styles from './style.module.scss';
|
|
25
28
|
|
|
26
29
|
const { useLocation, useMatches, Outlet } = unlock( routePrivateApis );
|
|
27
30
|
|
|
@@ -55,6 +58,7 @@ export default function Root() {
|
|
|
55
58
|
return (
|
|
56
59
|
<SlotFillProvider>
|
|
57
60
|
<Tooltip.Provider>
|
|
61
|
+
<PluginArea />
|
|
58
62
|
<ThemeProvider
|
|
59
63
|
isRoot
|
|
60
64
|
color={ { ...themeColors, background: '#f8f8f8' } }
|
|
@@ -62,13 +66,17 @@ export default function Root() {
|
|
|
62
66
|
<ThemeProvider color={ themeColors }>
|
|
63
67
|
<div
|
|
64
68
|
ref={ layoutRef }
|
|
65
|
-
className={ clsx(
|
|
66
|
-
'has-canvas'
|
|
67
|
-
|
|
69
|
+
className={ clsx( styles.layout, {
|
|
70
|
+
[ styles[ 'has-canvas' ] ]:
|
|
71
|
+
!! canvas || canvas === null,
|
|
72
|
+
[ styles[ 'has-full-canvas' ] ]: isFullScreen,
|
|
68
73
|
} ) }
|
|
69
74
|
>
|
|
75
|
+
<UnsavedChangesWarning />
|
|
70
76
|
<SavePanel />
|
|
71
|
-
<SnackbarNotices
|
|
77
|
+
<SnackbarNotices
|
|
78
|
+
className={ styles[ 'notices-snackbar' ] }
|
|
79
|
+
/>
|
|
72
80
|
{ isMobileViewport && (
|
|
73
81
|
<Page.SidebarToggleFill>
|
|
74
82
|
<Button
|
|
@@ -97,7 +105,9 @@ export default function Root() {
|
|
|
97
105
|
: 0.2,
|
|
98
106
|
ease: 'easeOut',
|
|
99
107
|
} }
|
|
100
|
-
className=
|
|
108
|
+
className={
|
|
109
|
+
styles[ 'sidebar-backdrop' ]
|
|
110
|
+
}
|
|
101
111
|
onClick={ () =>
|
|
102
112
|
setIsMobileSidebarOpen( false )
|
|
103
113
|
}
|
|
@@ -132,7 +142,10 @@ export default function Root() {
|
|
|
132
142
|
: 0.2,
|
|
133
143
|
ease: 'easeOut',
|
|
134
144
|
} }
|
|
135
|
-
className=
|
|
145
|
+
className={ clsx(
|
|
146
|
+
styles.sidebar,
|
|
147
|
+
styles[ 'is-mobile' ]
|
|
148
|
+
) }
|
|
136
149
|
>
|
|
137
150
|
<Sidebar />
|
|
138
151
|
</motion.div>
|
|
@@ -140,11 +153,11 @@ export default function Root() {
|
|
|
140
153
|
</AnimatePresence>
|
|
141
154
|
{ /* Desktop Sidebar */ }
|
|
142
155
|
{ ! isMobileViewport && ! isFullScreen && (
|
|
143
|
-
<div className=
|
|
156
|
+
<div className={ styles.sidebar }>
|
|
144
157
|
<Sidebar />
|
|
145
158
|
</div>
|
|
146
159
|
) }
|
|
147
|
-
<div className=
|
|
160
|
+
<div className={ styles.surfaces }>
|
|
148
161
|
<ThemeProvider
|
|
149
162
|
color={ {
|
|
150
163
|
...themeColors,
|
|
@@ -155,18 +168,23 @@ export default function Root() {
|
|
|
155
168
|
{ /* Render Canvas in Root to prevent remounting on route changes */ }
|
|
156
169
|
{ ( canvas || canvas === null ) && (
|
|
157
170
|
<div
|
|
158
|
-
className={ clsx(
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
) }
|
|
171
|
+
className={ clsx( styles.canvas, {
|
|
172
|
+
[ styles[
|
|
173
|
+
'has-mobile-drawer'
|
|
174
|
+
] ]:
|
|
175
|
+
canvas?.isPreview &&
|
|
176
|
+
isMobileViewport,
|
|
177
|
+
} ) }
|
|
166
178
|
>
|
|
167
179
|
{ canvas?.isPreview &&
|
|
168
180
|
isMobileViewport && (
|
|
169
|
-
<div
|
|
181
|
+
<div
|
|
182
|
+
className={
|
|
183
|
+
styles[
|
|
184
|
+
'mobile-sidebar-drawer'
|
|
185
|
+
]
|
|
186
|
+
}
|
|
187
|
+
>
|
|
170
188
|
<Button
|
|
171
189
|
icon={ menu }
|
|
172
190
|
onClick={ () =>
|
|
@@ -181,12 +199,14 @@ export default function Root() {
|
|
|
181
199
|
/>
|
|
182
200
|
</div>
|
|
183
201
|
) }
|
|
184
|
-
<
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
routeContentModule
|
|
188
|
-
|
|
189
|
-
|
|
202
|
+
<ErrorBoundary>
|
|
203
|
+
<CanvasRenderer
|
|
204
|
+
canvas={ canvas }
|
|
205
|
+
routeContentModule={
|
|
206
|
+
routeContentModule
|
|
207
|
+
}
|
|
208
|
+
/>
|
|
209
|
+
</ErrorBoundary>
|
|
190
210
|
</div>
|
|
191
211
|
) }
|
|
192
212
|
</ThemeProvider>
|
|
@@ -5,12 +5,14 @@ import { SlotFillProvider } from '@wordpress/components';
|
|
|
5
5
|
import { useMemo } from '@wordpress/element';
|
|
6
6
|
import { getAdminThemeColors } from '@wordpress/admin-ui';
|
|
7
7
|
import { ThemeProvider } from '@wordpress/theme';
|
|
8
|
+
import { UnsavedChangesWarning } from '@wordpress/editor';
|
|
8
9
|
import SavePanel from '../save-panel';
|
|
9
10
|
import CanvasRenderer from '../canvas-renderer';
|
|
11
|
+
import PluginArea from '../plugin-area';
|
|
10
12
|
import { unlock } from '../../lock-unlock';
|
|
11
13
|
import type { CanvasData } from '../../store/types';
|
|
12
14
|
import useSyncBodyBackground from './use-sync-body-background';
|
|
13
|
-
import './style.scss';
|
|
15
|
+
import styles from './style.module.scss';
|
|
14
16
|
import useRouteTitle from '../app/use-route-title';
|
|
15
17
|
|
|
16
18
|
const { useMatches, Outlet } = unlock( routePrivateApis );
|
|
@@ -38,6 +40,7 @@ export default function RootSinglePage() {
|
|
|
38
40
|
|
|
39
41
|
return (
|
|
40
42
|
<SlotFillProvider>
|
|
43
|
+
<PluginArea />
|
|
41
44
|
<ThemeProvider
|
|
42
45
|
isRoot
|
|
43
46
|
color={ { ...themeColors, background: '#f8f8f8' } }
|
|
@@ -46,16 +49,21 @@ export default function RootSinglePage() {
|
|
|
46
49
|
<div
|
|
47
50
|
ref={ layoutRef }
|
|
48
51
|
className={ clsx(
|
|
49
|
-
|
|
52
|
+
styles.layout,
|
|
53
|
+
styles[ 'layout-single-page' ],
|
|
50
54
|
{
|
|
51
|
-
'has-canvas'
|
|
52
|
-
|
|
55
|
+
[ styles[ 'has-canvas' ] ]:
|
|
56
|
+
!! canvas || canvas === null,
|
|
57
|
+
[ styles[ 'has-full-canvas' ] ]: isFullScreen,
|
|
53
58
|
}
|
|
54
59
|
) }
|
|
55
60
|
>
|
|
61
|
+
<UnsavedChangesWarning />
|
|
56
62
|
<SavePanel />
|
|
57
|
-
<SnackbarNotices
|
|
58
|
-
|
|
63
|
+
<SnackbarNotices
|
|
64
|
+
className={ styles[ 'notices-snackbar' ] }
|
|
65
|
+
/>
|
|
66
|
+
<div className={ styles.surfaces }>
|
|
59
67
|
<ThemeProvider
|
|
60
68
|
color={ {
|
|
61
69
|
...themeColors,
|
|
@@ -65,7 +73,7 @@ export default function RootSinglePage() {
|
|
|
65
73
|
<Outlet />
|
|
66
74
|
{ /* Render Canvas in Root to prevent remounting on route changes */ }
|
|
67
75
|
{ ( canvas || canvas === null ) && (
|
|
68
|
-
<div className=
|
|
76
|
+
<div className={ styles.canvas }>
|
|
69
77
|
<CanvasRenderer
|
|
70
78
|
canvas={ canvas }
|
|
71
79
|
routeContentModule={
|
|
@@ -10,7 +10,7 @@ import { useIsomorphicLayoutEffect } from '@wordpress/compose';
|
|
|
10
10
|
* hook can be replaced with a CSS rule on `<body>`.
|
|
11
11
|
* See https://github.com/WordPress/gutenberg/pull/78587#discussion_r3481698286
|
|
12
12
|
*
|
|
13
|
-
* @return Ref to attach to the
|
|
13
|
+
* @return Ref to attach to the layout root element.
|
|
14
14
|
*/
|
|
15
15
|
export default function useSyncBodyBackground() {
|
|
16
16
|
const layoutRef = useRef< HTMLDivElement | null >( null );
|