@wordpress/boot 0.19.0 → 0.21.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 +38 -0
  2. package/README.md +4 -0
  3. package/build-module/components/app/index.mjs.map +2 -2
  4. package/build-module/components/app/router.mjs +100 -4
  5. package/build-module/components/app/router.mjs.map +3 -3
  6. package/build-module/components/app/use-route-title.mjs.map +2 -2
  7. package/build-module/components/canvas/back-button.mjs.map +2 -2
  8. package/build-module/components/canvas/index.mjs +72 -13
  9. package/build-module/components/canvas/index.mjs.map +2 -2
  10. package/build-module/components/canvas/site-preview.mjs +50 -0
  11. package/build-module/components/canvas/site-preview.mjs.map +7 -0
  12. package/build-module/components/canvas/use-navigate-to-entity-record.mjs +122 -0
  13. package/build-module/components/canvas/use-navigate-to-entity-record.mjs.map +7 -0
  14. package/build-module/components/canvas/viewport.mjs +18 -0
  15. package/build-module/components/canvas/viewport.mjs.map +7 -0
  16. package/build-module/components/canvas-renderer/index.mjs.map +2 -2
  17. package/build-module/components/error-boundary/index.mjs +129 -0
  18. package/build-module/components/error-boundary/index.mjs.map +7 -0
  19. package/build-module/components/navigation/drilldown-item/index.mjs +91 -1
  20. package/build-module/components/navigation/drilldown-item/index.mjs.map +3 -3
  21. package/build-module/components/navigation/dropdown-item/index.mjs +99 -12
  22. package/build-module/components/navigation/dropdown-item/index.mjs.map +4 -4
  23. package/build-module/components/navigation/index.mjs +1 -2
  24. package/build-module/components/navigation/index.mjs.map +2 -2
  25. package/build-module/components/navigation/items.mjs.map +2 -2
  26. package/build-module/components/navigation/navigation-item/index.mjs +88 -15
  27. package/build-module/components/navigation/navigation-item/index.mjs.map +3 -3
  28. package/build-module/components/navigation/navigation-screen/index.mjs +111 -38
  29. package/build-module/components/navigation/navigation-screen/index.mjs.map +3 -3
  30. package/build-module/components/navigation/path-matching.mjs.map +2 -2
  31. package/build-module/components/navigation/router-link-item.mjs.map +2 -2
  32. package/build-module/components/navigation/use-sidebar-parent.mjs +1 -1
  33. package/build-module/components/navigation/use-sidebar-parent.mjs.map +2 -2
  34. package/build-module/components/plugin-area/index.mjs +29 -0
  35. package/build-module/components/plugin-area/index.mjs.map +7 -0
  36. package/build-module/components/root/index.mjs +220 -122
  37. package/build-module/components/root/index.mjs.map +3 -3
  38. package/build-module/components/root/single-page.mjs +139 -47
  39. package/build-module/components/root/single-page.mjs.map +3 -3
  40. package/build-module/components/root/use-sync-body-background.mjs.map +2 -2
  41. package/build-module/components/save-button/index.mjs +127 -16
  42. package/build-module/components/save-button/index.mjs.map +3 -3
  43. package/build-module/components/save-panel/index.mjs +91 -1
  44. package/build-module/components/save-panel/index.mjs.map +3 -3
  45. package/build-module/components/save-panel/use-save-shortcut.mjs.map +2 -2
  46. package/build-module/components/sidebar/index.mjs +90 -10
  47. package/build-module/components/sidebar/index.mjs.map +3 -3
  48. package/build-module/index.mjs +0 -16
  49. package/build-module/index.mjs.map +3 -3
  50. package/build-module/lock-unlock.mjs.map +2 -2
  51. package/build-module/store/actions.mjs +8 -0
  52. package/build-module/store/actions.mjs.map +2 -2
  53. package/build-module/store/index.mjs.map +2 -2
  54. package/build-module/store/reducer.mjs +16 -1
  55. package/build-module/store/reducer.mjs.map +2 -2
  56. package/build-module/store/selectors.mjs +9 -0
  57. package/build-module/store/selectors.mjs.map +2 -2
  58. package/build-types/components/app/index.d.ts.map +1 -1
  59. package/build-types/components/app/router.d.ts +0 -3
  60. package/build-types/components/app/router.d.ts.map +1 -1
  61. package/build-types/components/app/use-route-title.d.ts.map +1 -1
  62. package/build-types/components/canvas/back-button.d.ts.map +1 -1
  63. package/build-types/components/canvas/index.d.ts +0 -3
  64. package/build-types/components/canvas/index.d.ts.map +1 -1
  65. package/build-types/components/canvas/site-preview.d.ts +10 -0
  66. package/build-types/components/canvas/site-preview.d.ts.map +1 -0
  67. package/build-types/components/canvas/use-navigate-to-entity-record.d.ts +40 -0
  68. package/build-types/components/canvas/use-navigate-to-entity-record.d.ts.map +1 -0
  69. package/build-types/components/canvas/viewport.d.ts +15 -0
  70. package/build-types/components/canvas/viewport.d.ts.map +1 -0
  71. package/build-types/components/canvas-renderer/index.d.ts.map +1 -1
  72. package/build-types/components/error-boundary/index.d.ts +22 -0
  73. package/build-types/components/error-boundary/index.d.ts.map +1 -0
  74. package/build-types/components/navigation/drilldown-item/index.d.ts.map +1 -1
  75. package/build-types/components/navigation/dropdown-item/index.d.ts +0 -1
  76. package/build-types/components/navigation/dropdown-item/index.d.ts.map +1 -1
  77. package/build-types/components/navigation/index.d.ts.map +1 -1
  78. package/build-types/components/navigation/items.d.ts +0 -3
  79. package/build-types/components/navigation/items.d.ts.map +1 -1
  80. package/build-types/components/navigation/navigation-item/index.d.ts +0 -1
  81. package/build-types/components/navigation/navigation-item/index.d.ts.map +1 -1
  82. package/build-types/components/navigation/navigation-screen/index.d.ts +0 -7
  83. package/build-types/components/navigation/navigation-screen/index.d.ts.map +1 -1
  84. package/build-types/components/navigation/path-matching.d.ts +0 -3
  85. package/build-types/components/navigation/path-matching.d.ts.map +1 -1
  86. package/build-types/components/navigation/router-link-item.d.ts.map +1 -1
  87. package/build-types/components/navigation/use-sidebar-parent.d.ts.map +1 -1
  88. package/build-types/components/plugin-area/index.d.ts +12 -0
  89. package/build-types/components/plugin-area/index.d.ts.map +1 -0
  90. package/build-types/components/root/index.d.ts +0 -1
  91. package/build-types/components/root/index.d.ts.map +1 -1
  92. package/build-types/components/root/single-page.d.ts +0 -1
  93. package/build-types/components/root/single-page.d.ts.map +1 -1
  94. package/build-types/components/root/use-sync-body-background.d.ts +1 -1
  95. package/build-types/components/root/use-sync-body-background.d.ts.map +1 -1
  96. package/build-types/components/save-button/index.d.ts +0 -4
  97. package/build-types/components/save-button/index.d.ts.map +1 -1
  98. package/build-types/components/save-panel/index.d.ts.map +1 -1
  99. package/build-types/components/save-panel/use-save-shortcut.d.ts.map +1 -1
  100. package/build-types/components/sidebar/index.d.ts +0 -1
  101. package/build-types/components/sidebar/index.d.ts.map +1 -1
  102. package/build-types/index.d.ts +0 -5
  103. package/build-types/index.d.ts.map +1 -1
  104. package/build-types/lock-unlock.d.ts.map +1 -1
  105. package/build-types/store/actions.d.ts +15 -5
  106. package/build-types/store/actions.d.ts.map +1 -1
  107. package/build-types/store/index.d.ts.map +1 -1
  108. package/build-types/store/reducer.d.ts +0 -3
  109. package/build-types/store/reducer.d.ts.map +1 -1
  110. package/build-types/store/selectors.d.ts +12 -3
  111. package/build-types/store/selectors.d.ts.map +1 -1
  112. package/build-types/store/types.d.ts +34 -6
  113. package/build-types/store/types.d.ts.map +1 -1
  114. package/package.json +28 -25
  115. package/src/components/app/index.tsx +0 -7
  116. package/src/components/app/router.tsx +19 -18
  117. package/src/components/app/use-route-title.ts +0 -7
  118. package/src/components/canvas/back-button.tsx +0 -3
  119. package/src/components/canvas/index.tsx +117 -22
  120. package/src/components/canvas/site-preview.tsx +64 -0
  121. package/src/components/canvas/use-navigate-to-entity-record.ts +220 -0
  122. package/src/components/canvas/viewport.ts +34 -0
  123. package/src/components/canvas-renderer/index.tsx +0 -7
  124. package/src/components/error-boundary/index.tsx +71 -0
  125. package/src/components/error-boundary/style.module.scss +13 -0
  126. package/src/components/navigation/drilldown-item/index.tsx +2 -13
  127. package/src/components/navigation/dropdown-item/index.tsx +11 -19
  128. package/src/components/navigation/dropdown-item/{style.scss → style.module.scss} +6 -2
  129. package/src/components/navigation/index.tsx +1 -9
  130. package/src/components/navigation/items.tsx +0 -7
  131. package/src/components/navigation/navigation-item/index.tsx +3 -18
  132. package/src/components/navigation/navigation-item/{style.scss → style.module.scss} +7 -14
  133. package/src/components/navigation/navigation-screen/index.tsx +6 -26
  134. package/src/components/navigation/navigation-screen/{style.scss → style.module.scss} +10 -9
  135. package/src/components/navigation/path-matching.ts +0 -3
  136. package/src/components/navigation/router-link-item.tsx +0 -11
  137. package/src/components/navigation/use-sidebar-parent.ts +1 -13
  138. package/src/components/plugin-area/index.tsx +34 -0
  139. package/src/components/root/{style.scss → _layout.module.scss} +71 -40
  140. package/src/components/root/_view-transitions.module.scss +205 -0
  141. package/src/components/root/index.tsx +44 -35
  142. package/src/components/root/single-page.tsx +15 -18
  143. package/src/components/root/style.module.scss +2 -0
  144. package/src/components/root/use-sync-body-background.ts +1 -4
  145. package/src/components/save-button/index.tsx +36 -21
  146. package/src/components/save-button/style.module.scss +10 -0
  147. package/src/components/save-panel/index.tsx +2 -8
  148. package/src/components/save-panel/style.module.scss +7 -0
  149. package/src/components/save-panel/use-save-shortcut.ts +0 -3
  150. package/src/components/sidebar/index.tsx +5 -12
  151. package/src/components/sidebar/style.module.scss +29 -0
  152. package/src/index.tsx +0 -5
  153. package/src/lock-unlock.ts +0 -3
  154. package/src/store/actions.ts +18 -4
  155. package/src/store/index.ts +0 -7
  156. package/src/store/reducer.ts +19 -3
  157. package/src/store/selectors.ts +28 -3
  158. package/src/store/types.ts +37 -6
  159. package/build-style/style-rtl.css +0 -132
  160. package/build-style/style.css +0 -132
  161. package/build-style/view-transitions-rtl.css +0 -189
  162. package/build-style/view-transitions.css +0 -189
  163. package/build-types/components/site-hub/index.d.ts +0 -4
  164. package/build-types/components/site-hub/index.d.ts.map +0 -1
  165. package/build-types/components/site-icon/index.d.ts +0 -9
  166. package/build-types/components/site-icon/index.d.ts.map +0 -1
  167. package/build-types/components/site-icon-link/index.d.ts +0 -8
  168. package/build-types/components/site-icon-link/index.d.ts.map +0 -1
  169. package/build-types/components/user-theme-provider/index.d.ts +0 -6
  170. package/build-types/components/user-theme-provider/index.d.ts.map +0 -1
  171. package/src/components/save-button/style.scss +0 -9
  172. package/src/components/sidebar/style.scss +0 -23
  173. package/src/style.scss +0 -33
  174. 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
- .boot-layout {
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
- .boot-layout__sidebar-backdrop {
46
+ .sidebar-backdrop {
16
47
  position: fixed;
17
48
  top: 0;
18
- left: 0;
19
- right: 0;
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
- .boot-layout__sidebar {
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
- .boot-layout__mobile-sidebar-drawer {
77
+ .mobile-sidebar-drawer {
47
78
  position: fixed;
48
79
  top: 0;
49
- left: 0;
50
- right: 0;
80
+ inset-inline-start: 0;
81
+ inset-inline-end: 0;
51
82
 
52
- .boot-layout--single-page & {
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
- .boot-layout__canvas.has-mobile-drawer {
96
+ .canvas.has-mobile-drawer {
66
97
  position: relative;
67
98
  padding-top: 65px;
68
99
  }
69
100
 
70
- .boot-layout__surfaces {
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
- .boot-layout--single-page & {
110
+ .layout-single-page & {
80
111
  margin-top: 0;
81
112
  margin-inline-start: 0;
82
113
  }
83
114
  }
84
115
  }
85
116
 
86
- .boot-layout__stage,
87
- .boot-layout__inspector {
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
- left: 0;
98
- right: 0;
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
- .boot-layout--single-page & {
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
- .boot-layout--single-page & {
149
+ .layout-single-page & {
119
150
  height: auto;
120
151
  }
121
152
  }
122
153
  }
123
154
 
124
- .boot-layout__stage {
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
- .boot-layout__inspector {
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
- .boot-layout__canvas {
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
- left: 0;
153
- right: 0;
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
- .boot-layout--single-page & {
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
- .boot-layout--single-page & {
205
+ .layout-single-page & {
175
206
  height: auto;
176
207
  }
177
208
  }
178
209
  }
179
210
 
180
- .boot-layout.has-canvas .boot-layout__stage,
181
- .boot-layout__inspector {
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
- .boot-layout__canvas .interface-interface-skeleton {
218
+ .canvas :global(.interface-interface-skeleton) {
188
219
  position: relative;
189
220
  height: 100%;
190
221
  top: 0 !important;
191
- left: 0 !important;
222
+ inset-inline-start: 0 !important;
192
223
  }
193
224
 
194
225
  // Full-screen canvas mode
195
- .boot-layout.has-full-canvas .boot-layout__surfaces {
226
+ .layout.has-full-canvas .surfaces {
196
227
  margin: 0;
197
228
  gap: 0;
198
229
  }
199
230
 
200
- .boot-layout.has-full-canvas .boot-layout__stage,
201
- .boot-layout.has-full-canvas .boot-layout__inspector {
231
+ .layout.has-full-canvas .stage,
232
+ .layout.has-full-canvas .inspector {
202
233
  display: none;
203
234
  }
204
235
 
205
- .boot-layout.has-full-canvas .boot-layout__canvas {
236
+ .layout.has-full-canvas .canvas {
206
237
  position: fixed;
207
238
  top: var(--wp-admin--admin-bar--height, 0);
208
- left: 0;
209
- right: 0;
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
- .boot-layout--single-page & {
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
- .boot-layout__stage,
230
- .boot-layout__inspector,
231
- .boot-layout__canvas:not(.has-mobile-drawer) {
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
- .boot-layout__mobile-sidebar-drawer {
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
+ }
@@ -1,11 +1,4 @@
1
- /**
2
- * External dependencies
3
- */
4
1
  import clsx from 'clsx';
5
-
6
- /**
7
- * WordPress dependencies
8
- */
9
2
  import { privateApis as routePrivateApis } from '@wordpress/route';
10
3
  import { SnackbarNotices } from '@wordpress/notices';
11
4
  import { useViewportMatch, useReducedMotion } from '@wordpress/compose';
@@ -18,21 +11,20 @@ import {
18
11
  import { menu } from '@wordpress/icons';
19
12
  import { useState, useEffect, useMemo } from '@wordpress/element';
20
13
  import { __ } from '@wordpress/i18n';
14
+ import { UnsavedChangesWarning } from '@wordpress/editor';
21
15
  import { Page, getAdminThemeColors } from '@wordpress/admin-ui';
22
16
  import { Tooltip } from '@wordpress/ui';
23
17
  import { ThemeProvider } from '@wordpress/theme';
24
-
25
- /**
26
- * Internal dependencies
27
- */
28
18
  import Sidebar from '../sidebar';
29
19
  import SavePanel from '../save-panel';
30
20
  import CanvasRenderer from '../canvas-renderer';
21
+ import ErrorBoundary from '../error-boundary';
22
+ import PluginArea from '../plugin-area';
31
23
  import useRouteTitle from '../app/use-route-title';
32
24
  import { unlock } from '../../lock-unlock';
33
25
  import type { CanvasData } from '../../store/types';
34
26
  import useSyncBodyBackground from './use-sync-body-background';
35
- import './style.scss';
27
+ import styles from './style.module.scss';
36
28
 
37
29
  const { useLocation, useMatches, Outlet } = unlock( routePrivateApis );
38
30
 
@@ -66,6 +58,7 @@ export default function Root() {
66
58
  return (
67
59
  <SlotFillProvider>
68
60
  <Tooltip.Provider>
61
+ <PluginArea />
69
62
  <ThemeProvider
70
63
  isRoot
71
64
  color={ { ...themeColors, background: '#f8f8f8' } }
@@ -73,13 +66,17 @@ export default function Root() {
73
66
  <ThemeProvider color={ themeColors }>
74
67
  <div
75
68
  ref={ layoutRef }
76
- className={ clsx( 'boot-layout', {
77
- 'has-canvas': !! canvas || canvas === null,
78
- 'has-full-canvas': isFullScreen,
69
+ className={ clsx( styles.layout, {
70
+ [ styles[ 'has-canvas' ] ]:
71
+ !! canvas || canvas === null,
72
+ [ styles[ 'has-full-canvas' ] ]: isFullScreen,
79
73
  } ) }
80
74
  >
75
+ <UnsavedChangesWarning />
81
76
  <SavePanel />
82
- <SnackbarNotices className="boot-notices__snackbar" />
77
+ <SnackbarNotices
78
+ className={ styles[ 'notices-snackbar' ] }
79
+ />
83
80
  { isMobileViewport && (
84
81
  <Page.SidebarToggleFill>
85
82
  <Button
@@ -108,7 +105,9 @@ export default function Root() {
108
105
  : 0.2,
109
106
  ease: 'easeOut',
110
107
  } }
111
- className="boot-layout__sidebar-backdrop"
108
+ className={
109
+ styles[ 'sidebar-backdrop' ]
110
+ }
112
111
  onClick={ () =>
113
112
  setIsMobileSidebarOpen( false )
114
113
  }
@@ -143,7 +142,10 @@ export default function Root() {
143
142
  : 0.2,
144
143
  ease: 'easeOut',
145
144
  } }
146
- className="boot-layout__sidebar is-mobile"
145
+ className={ clsx(
146
+ styles.sidebar,
147
+ styles[ 'is-mobile' ]
148
+ ) }
147
149
  >
148
150
  <Sidebar />
149
151
  </motion.div>
@@ -151,11 +153,11 @@ export default function Root() {
151
153
  </AnimatePresence>
152
154
  { /* Desktop Sidebar */ }
153
155
  { ! isMobileViewport && ! isFullScreen && (
154
- <div className="boot-layout__sidebar">
156
+ <div className={ styles.sidebar }>
155
157
  <Sidebar />
156
158
  </div>
157
159
  ) }
158
- <div className="boot-layout__surfaces">
160
+ <div className={ styles.surfaces }>
159
161
  <ThemeProvider
160
162
  color={ {
161
163
  ...themeColors,
@@ -166,18 +168,23 @@ export default function Root() {
166
168
  { /* Render Canvas in Root to prevent remounting on route changes */ }
167
169
  { ( canvas || canvas === null ) && (
168
170
  <div
169
- className={ clsx(
170
- 'boot-layout__canvas',
171
- {
172
- 'has-mobile-drawer':
173
- canvas?.isPreview &&
174
- isMobileViewport,
175
- }
176
- ) }
171
+ className={ clsx( styles.canvas, {
172
+ [ styles[
173
+ 'has-mobile-drawer'
174
+ ] ]:
175
+ canvas?.isPreview &&
176
+ isMobileViewport,
177
+ } ) }
177
178
  >
178
179
  { canvas?.isPreview &&
179
180
  isMobileViewport && (
180
- <div className="boot-layout__mobile-sidebar-drawer">
181
+ <div
182
+ className={
183
+ styles[
184
+ 'mobile-sidebar-drawer'
185
+ ]
186
+ }
187
+ >
181
188
  <Button
182
189
  icon={ menu }
183
190
  onClick={ () =>
@@ -192,12 +199,14 @@ export default function Root() {
192
199
  />
193
200
  </div>
194
201
  ) }
195
- <CanvasRenderer
196
- canvas={ canvas }
197
- routeContentModule={
198
- routeContentModule
199
- }
200
- />
202
+ <ErrorBoundary>
203
+ <CanvasRenderer
204
+ canvas={ canvas }
205
+ routeContentModule={
206
+ routeContentModule
207
+ }
208
+ />
209
+ </ErrorBoundary>
201
210
  </div>
202
211
  ) }
203
212
  </ThemeProvider>
@@ -1,27 +1,18 @@
1
- /**
2
- * External dependencies
3
- */
4
1
  import clsx from 'clsx';
5
-
6
- /**
7
- * WordPress dependencies
8
- */
9
2
  import { privateApis as routePrivateApis } from '@wordpress/route';
10
3
  import { SnackbarNotices } from '@wordpress/notices';
11
4
  import { SlotFillProvider } from '@wordpress/components';
12
5
  import { useMemo } from '@wordpress/element';
13
6
  import { getAdminThemeColors } from '@wordpress/admin-ui';
14
7
  import { ThemeProvider } from '@wordpress/theme';
15
-
16
- /**
17
- * Internal dependencies
18
- */
8
+ import { UnsavedChangesWarning } from '@wordpress/editor';
19
9
  import SavePanel from '../save-panel';
20
10
  import CanvasRenderer from '../canvas-renderer';
11
+ import PluginArea from '../plugin-area';
21
12
  import { unlock } from '../../lock-unlock';
22
13
  import type { CanvasData } from '../../store/types';
23
14
  import useSyncBodyBackground from './use-sync-body-background';
24
- import './style.scss';
15
+ import styles from './style.module.scss';
25
16
  import useRouteTitle from '../app/use-route-title';
26
17
 
27
18
  const { useMatches, Outlet } = unlock( routePrivateApis );
@@ -49,6 +40,7 @@ export default function RootSinglePage() {
49
40
 
50
41
  return (
51
42
  <SlotFillProvider>
43
+ <PluginArea />
52
44
  <ThemeProvider
53
45
  isRoot
54
46
  color={ { ...themeColors, background: '#f8f8f8' } }
@@ -57,16 +49,21 @@ export default function RootSinglePage() {
57
49
  <div
58
50
  ref={ layoutRef }
59
51
  className={ clsx(
60
- 'boot-layout boot-layout--single-page',
52
+ styles.layout,
53
+ styles[ 'layout-single-page' ],
61
54
  {
62
- 'has-canvas': !! canvas || canvas === null,
63
- 'has-full-canvas': isFullScreen,
55
+ [ styles[ 'has-canvas' ] ]:
56
+ !! canvas || canvas === null,
57
+ [ styles[ 'has-full-canvas' ] ]: isFullScreen,
64
58
  }
65
59
  ) }
66
60
  >
61
+ <UnsavedChangesWarning />
67
62
  <SavePanel />
68
- <SnackbarNotices className="boot-notices__snackbar" />
69
- <div className="boot-layout__surfaces">
63
+ <SnackbarNotices
64
+ className={ styles[ 'notices-snackbar' ] }
65
+ />
66
+ <div className={ styles.surfaces }>
70
67
  <ThemeProvider
71
68
  color={ {
72
69
  ...themeColors,
@@ -76,7 +73,7 @@ export default function RootSinglePage() {
76
73
  <Outlet />
77
74
  { /* Render Canvas in Root to prevent remounting on route changes */ }
78
75
  { ( canvas || canvas === null ) && (
79
- <div className="boot-layout__canvas">
76
+ <div className={ styles.canvas }>
80
77
  <CanvasRenderer
81
78
  canvas={ canvas }
82
79
  routeContentModule={
@@ -0,0 +1,2 @@
1
+ @use "./layout.module";
2
+ @use "./view-transitions.module";