@wordpress/boot 0.3.0 → 0.3.1-next.738bb1424.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 (76) hide show
  1. package/build-module/components/app/index.js +3 -3
  2. package/build-module/components/app/router.js +68 -67
  3. package/build-module/components/app/router.js.map +2 -2
  4. package/build-module/components/app/use-route-title.js +50 -0
  5. package/build-module/components/app/use-route-title.js.map +7 -0
  6. package/build-module/components/canvas/back-button.js +8 -4
  7. package/build-module/components/canvas/back-button.js.map +2 -2
  8. package/build-module/components/canvas/index.js +1 -1
  9. package/build-module/components/canvas-renderer/index.js +35 -0
  10. package/build-module/components/canvas-renderer/index.js.map +7 -0
  11. package/build-module/components/navigation/drilldown-item/index.js +1 -1
  12. package/build-module/components/navigation/dropdown-item/index.js +3 -3
  13. package/build-module/components/navigation/index.js +6 -6
  14. package/build-module/components/navigation/navigation-item/index.js +4 -4
  15. package/build-module/components/navigation/navigation-item/index.js.map +1 -1
  16. package/build-module/components/navigation/router-link-item.js +1 -1
  17. package/build-module/components/navigation/use-sidebar-parent.js +3 -3
  18. package/build-module/components/root/index.js +276 -21
  19. package/build-module/components/root/index.js.map +2 -2
  20. package/build-module/components/root/single-page.js +181 -19
  21. package/build-module/components/root/single-page.js.map +2 -2
  22. package/build-module/components/save-button/index.js +1 -1
  23. package/build-module/components/save-panel/index.js +1 -1
  24. package/build-module/components/sidebar/index.js +3 -3
  25. package/build-module/components/site-hub/index.js +30 -12
  26. package/build-module/components/site-hub/index.js.map +2 -2
  27. package/build-module/components/site-icon/index.js +2 -2
  28. package/build-module/components/site-icon/index.js.map +1 -1
  29. package/build-module/components/site-icon-link/index.js +5 -5
  30. package/build-module/components/site-icon-link/index.js.map +1 -1
  31. package/build-module/components/user-theme-provider/index.js +33 -0
  32. package/build-module/components/user-theme-provider/index.js.map +7 -0
  33. package/build-module/index.js +298 -75
  34. package/build-module/index.js.map +4 -4
  35. package/build-module/store/index.js +3 -3
  36. package/build-style/style-rtl.css +95 -75
  37. package/build-style/style.css +95 -75
  38. package/build-style/view-transitions-rtl.css +199 -0
  39. package/build-style/view-transitions.css +199 -0
  40. package/build-types/components/app/router.d.ts.map +1 -1
  41. package/build-types/components/app/use-route-title.d.ts +8 -0
  42. package/build-types/components/app/use-route-title.d.ts.map +1 -0
  43. package/build-types/components/canvas-renderer/index.d.ts +27 -0
  44. package/build-types/components/canvas-renderer/index.d.ts.map +1 -0
  45. package/build-types/components/root/index.d.ts.map +1 -1
  46. package/build-types/components/root/single-page.d.ts.map +1 -1
  47. package/build-types/components/site-hub/index.d.ts.map +1 -1
  48. package/build-types/components/user-theme-provider/index.d.ts +6 -0
  49. package/build-types/components/user-theme-provider/index.d.ts.map +1 -0
  50. package/build-types/index.d.ts +1 -0
  51. package/build-types/index.d.ts.map +1 -1
  52. package/build-types/store/index.d.ts +1 -1
  53. package/build-types/store/index.d.ts.map +1 -1
  54. package/build-types/store/types.d.ts +64 -7
  55. package/build-types/store/types.d.ts.map +1 -1
  56. package/package.json +30 -21
  57. package/src/components/app/router.tsx +93 -111
  58. package/src/components/app/use-route-title.ts +80 -0
  59. package/src/components/canvas/back-button.scss +7 -2
  60. package/src/components/canvas-renderer/index.tsx +72 -0
  61. package/src/components/navigation/navigation-item/style.scss +1 -1
  62. package/src/components/root/index.tsx +154 -27
  63. package/src/components/root/single-page.tsx +24 -10
  64. package/src/components/root/style.scss +123 -4
  65. package/src/components/site-hub/index.tsx +6 -1
  66. package/src/components/site-hub/style.scss +23 -8
  67. package/src/components/site-icon/style.scss +1 -1
  68. package/src/components/site-icon-link/style.scss +2 -2
  69. package/src/components/user-theme-provider/index.tsx +35 -0
  70. package/src/components/user-theme-provider/test/index.test.ts +11 -0
  71. package/src/index.tsx +1 -0
  72. package/src/store/types.ts +71 -7
  73. package/src/style.scss +19 -33
  74. package/src/view-transitions.scss +239 -0
  75. package/tsconfig.json +0 -26
  76. package/tsconfig.tsbuildinfo +0 -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
+ }
package/tsconfig.json DELETED
@@ -1,26 +0,0 @@
1
- {
2
- "$schema": "https://json.schemastore.org/tsconfig.json",
3
- "extends": "../../tsconfig.base.json",
4
- "compilerOptions": {
5
- "checkJs": false
6
- },
7
- "references": [
8
- { "path": "../admin-ui" },
9
- { "path": "../components" },
10
- { "path": "../compose" },
11
- { "path": "../core-data" },
12
- { "path": "../data" },
13
- { "path": "../editor" },
14
- { "path": "../element" },
15
- { "path": "../html-entities" },
16
- { "path": "../i18n" },
17
- { "path": "../icons" },
18
- { "path": "../keycodes" },
19
- { "path": "../lazy-editor" },
20
- { "path": "../primitives" },
21
- { "path": "../private-apis" },
22
- { "path": "../route" },
23
- { "path": "../theme" },
24
- { "path": "../url" }
25
- ]
26
- }