@wordpress/boot 0.3.0 → 0.3.1-next.6deb34194.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 (50) hide show
  1. package/build-module/components/app/router.js +18 -28
  2. package/build-module/components/app/router.js.map +2 -2
  3. package/build-module/components/canvas/back-button.js +7 -3
  4. package/build-module/components/canvas/back-button.js.map +2 -2
  5. package/build-module/components/canvas-renderer/index.js +35 -0
  6. package/build-module/components/canvas-renderer/index.js.map +7 -0
  7. package/build-module/components/navigation/navigation-item/index.js +2 -2
  8. package/build-module/components/navigation/navigation-item/index.js.map +1 -1
  9. package/build-module/components/root/index.js +288 -28
  10. package/build-module/components/root/index.js.map +2 -2
  11. package/build-module/components/root/single-page.js +177 -14
  12. package/build-module/components/root/single-page.js.map +2 -2
  13. package/build-module/components/site-hub/index.js +3 -3
  14. package/build-module/components/site-hub/index.js.map +1 -1
  15. package/build-module/components/site-icon/index.js +2 -2
  16. package/build-module/components/site-icon/index.js.map +1 -1
  17. package/build-module/components/site-icon-link/index.js +3 -3
  18. package/build-module/components/site-icon-link/index.js.map +1 -1
  19. package/build-module/index.js +263 -44
  20. package/build-module/index.js.map +4 -4
  21. package/build-style/style-rtl.css +59 -43
  22. package/build-style/style.css +59 -43
  23. package/build-style/view-transitions-rtl.css +199 -0
  24. package/build-style/view-transitions.css +199 -0
  25. package/build-types/components/app/router.d.ts.map +1 -1
  26. package/build-types/components/canvas-renderer/index.d.ts +27 -0
  27. package/build-types/components/canvas-renderer/index.d.ts.map +1 -0
  28. package/build-types/components/root/index.d.ts.map +1 -1
  29. package/build-types/components/root/single-page.d.ts.map +1 -1
  30. package/build-types/index.d.ts +1 -0
  31. package/build-types/index.d.ts.map +1 -1
  32. package/build-types/store/index.d.ts +1 -1
  33. package/build-types/store/index.d.ts.map +1 -1
  34. package/build-types/store/types.d.ts +41 -7
  35. package/build-types/store/types.d.ts.map +1 -1
  36. package/package.json +21 -21
  37. package/src/components/app/router.tsx +30 -61
  38. package/src/components/canvas/back-button.scss +7 -2
  39. package/src/components/canvas-renderer/index.tsx +72 -0
  40. package/src/components/navigation/navigation-item/style.scss +1 -1
  41. package/src/components/root/index.tsx +150 -24
  42. package/src/components/root/single-page.tsx +12 -0
  43. package/src/components/root/style.scss +118 -4
  44. package/src/components/site-hub/style.scss +2 -2
  45. package/src/components/site-icon/style.scss +1 -1
  46. package/src/components/site-icon-link/style.scss +2 -2
  47. package/src/index.tsx +1 -0
  48. package/src/store/types.ts +47 -7
  49. package/src/view-transitions.scss +239 -0
  50. package/tsconfig.tsbuildinfo +1 -1
@@ -0,0 +1,239 @@
1
+ @use "@wordpress/base-styles/colors";
2
+
3
+ // Disable view transitions on mobile devices
4
+ // to avoid conflicts with sidebar navigation.
5
+ @media (max-width: 782px) {
6
+ * {
7
+ view-transition-name: none !important;
8
+ }
9
+ }
10
+
11
+ ::view-transition-old(root),
12
+ ::view-transition-new(root) {
13
+ animation-duration: 250ms;
14
+ }
15
+
16
+ @media not (prefers-reduced-motion: reduce) {
17
+ .boot-layout__canvas .interface-interface-skeleton__header {
18
+ view-transition-name: boot--canvas-header;
19
+ }
20
+
21
+ .boot-layout__canvas .interface-interface-skeleton__sidebar {
22
+ view-transition-name: boot--canvas-sidebar;
23
+ }
24
+
25
+ .boot-layout.has-full-canvas
26
+ .boot-layout__canvas
27
+ .boot-site-icon-link,
28
+ .boot-layout:not(.has-full-canvas)
29
+ .boot-site-hub
30
+ .boot-site-icon-link {
31
+ view-transition-name: boot--site-icon-link;
32
+ }
33
+
34
+ // Default (non-Safari) view transition names
35
+ .boot-layout__stage {
36
+ view-transition-name: boot--stage;
37
+ }
38
+
39
+ .boot-layout__inspector {
40
+ view-transition-name: boot--inspector;
41
+ }
42
+
43
+ .boot-layout__canvas:not(.is-full-canvas),
44
+ .boot-layout__canvas.is-full-canvas
45
+ .interface-interface-skeleton__content {
46
+ view-transition-name: boot--canvas;
47
+ }
48
+
49
+ // Safari-specific view transition names
50
+ // Uses CSS feature detection instead of .is-safari class
51
+ @supports (-webkit-hyphens:none) and (not (-moz-appearance:none)) {
52
+ .boot-layout__stage {
53
+ view-transition-name: boot-safari--stage;
54
+ }
55
+
56
+ .boot-layout__inspector {
57
+ view-transition-name: boot-safari--inspector;
58
+ }
59
+
60
+ .boot-layout__canvas:not(.is-full-canvas),
61
+ .boot-layout__canvas.is-full-canvas
62
+ .interface-interface-skeleton__content {
63
+ view-transition-name: boot-safari--canvas;
64
+ }
65
+ }
66
+
67
+ // For any popover that stays open across a query change.
68
+ // Naming it avoids the stage overlaying it.
69
+ .components-popover:first-of-type {
70
+ view-transition-name: boot--components-popover;
71
+ }
72
+ }
73
+
74
+ ::view-transition-group(boot--canvas-header),
75
+ ::view-transition-group(boot--canvas-sidebar),
76
+ ::view-transition-group(boot-safari--canvas),
77
+ ::view-transition-group(boot--canvas) {
78
+ z-index: 1;
79
+ }
80
+
81
+ ::view-transition-group(boot--site-icon-link) {
82
+ z-index: 2;
83
+ }
84
+
85
+ ::view-transition-new(boot--site-icon-link),
86
+ ::view-transition-old(boot--site-icon-link) {
87
+ animation: none;
88
+ }
89
+
90
+ // Safari-specific pseudo-element styles with width: auto fix
91
+ ::view-transition-new(boot-safari--canvas),
92
+ ::view-transition-old(boot-safari--canvas),
93
+ ::view-transition-new(boot-safari--stage),
94
+ ::view-transition-old(boot-safari--stage),
95
+ ::view-transition-old(boot-safari--inspector),
96
+ ::view-transition-new(boot-safari--inspector) {
97
+ width: auto;
98
+ }
99
+
100
+ // Safari trips up with using object fit on the pseudo images and filling out
101
+ // background.
102
+ ::view-transition-new(boot--canvas),
103
+ ::view-transition-old(boot--canvas),
104
+ ::view-transition-new(boot--stage),
105
+ ::view-transition-old(boot--stage),
106
+ ::view-transition-new(boot--inspector),
107
+ ::view-transition-old(boot--inspector) {
108
+ background: colors.$white;
109
+ border-radius: 8px;
110
+ width: 100%;
111
+ height: 100%;
112
+ object-fit: none;
113
+ object-position: left top;
114
+ overflow: hidden;
115
+ }
116
+
117
+ ::view-transition-new(boot--canvas),
118
+ ::view-transition-old(boot--canvas) {
119
+ object-position: center top;
120
+ }
121
+
122
+ ::view-transition-old(boot-safari--inspector):only-child,
123
+ ::view-transition-old(boot--inspector):only-child,
124
+ ::view-transition-old(boot-safari--stage):only-child,
125
+ ::view-transition-old(boot--stage):only-child {
126
+ animation-name: zoomOut;
127
+ will-change: transform, opacity;
128
+ }
129
+
130
+ ::view-transition-new(boot-safari--inspector):only-child,
131
+ ::view-transition-new(boot--inspector):only-child,
132
+ ::view-transition-new(boot-safari--stage):only-child,
133
+ ::view-transition-new(boot--stage):only-child {
134
+ animation-name: zoomIn;
135
+ will-change: transform, opacity;
136
+ }
137
+
138
+ @keyframes zoomOut {
139
+ from {
140
+ transform: scale(1);
141
+ opacity: 1;
142
+ }
143
+
144
+ to {
145
+ transform: scale(0.9);
146
+ opacity: 0;
147
+ }
148
+ }
149
+
150
+ @keyframes zoomIn {
151
+ from {
152
+ transform: scale(0.95);
153
+ opacity: 0;
154
+ }
155
+
156
+ to {
157
+ transform: scale(1);
158
+ opacity: 1;
159
+ }
160
+ }
161
+
162
+ ::view-transition-new(boot-safari--canvas):only-child,
163
+ ::view-transition-new(boot--canvas):only-child {
164
+ animation-name: slideFromRight;
165
+ will-change: transform;
166
+ }
167
+
168
+ ::view-transition-old(boot-safari--canvas):only-child,
169
+ ::view-transition-old(boot--canvas):only-child {
170
+ animation-name: slideToRight;
171
+ will-change: transform;
172
+ }
173
+
174
+ @keyframes slideFromRight {
175
+ from {
176
+ // Should ideally be 100% + 16px, but we also need to take into account
177
+ // that the canvas can be the editor-interface-skeleton__content, which
178
+ // not placed on the right side.
179
+ transform: translateX(100vw);
180
+ }
181
+
182
+ to {
183
+ transform: translateX(0);
184
+ }
185
+ }
186
+
187
+ @keyframes slideToRight {
188
+ from {
189
+ transform: translateX(0);
190
+ }
191
+
192
+ to {
193
+ transform: translateX(100vw);
194
+ }
195
+ }
196
+
197
+ ::view-transition-new(boot--canvas-header):only-child {
198
+ animation-name: slideHeaderFromTop;
199
+ will-change: transform;
200
+ }
201
+
202
+ ::view-transition-old(boot--canvas-header):only-child {
203
+ animation-name: slideHeaderToTop;
204
+ will-change: transform;
205
+ }
206
+
207
+ @keyframes slideHeaderFromTop {
208
+ from {
209
+ transform: translateY(-100%);
210
+ }
211
+ }
212
+
213
+ @keyframes slideHeaderToTop {
214
+ to {
215
+ transform: translateY(-100%);
216
+ }
217
+ }
218
+
219
+ ::view-transition-new(boot--canvas-sidebar):only-child {
220
+ animation-name: slideSidebarFromRight;
221
+ will-change: transform;
222
+ }
223
+
224
+ ::view-transition-old(boot--canvas-sidebar):only-child {
225
+ animation-name: slideSidebarToRight;
226
+ will-change: transform;
227
+ }
228
+
229
+ @keyframes slideSidebarFromRight {
230
+ from {
231
+ transform: translateX(100%);
232
+ }
233
+ }
234
+
235
+ @keyframes slideSidebarToRight {
236
+ to {
237
+ transform: translateX(100%);
238
+ }
239
+ }