@revikornmann/muka-ui 0.64.0 → 0.64.2
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/dist/cjs/components/Tabs/Tabs.js +32 -11
- package/dist/cjs/components/Tabs/Tabs.js.map +1 -1
- package/dist/cjs/components/View/View.css +16 -30
- package/dist/cjs/components/View/View.js +10 -1
- package/dist/cjs/components/View/View.js.map +1 -1
- package/dist/cjs/components/View/viewNavigation.js +38 -49
- package/dist/cjs/components/View/viewNavigation.js.map +1 -1
- package/dist/esm/components/Tabs/Tabs.js +33 -12
- package/dist/esm/components/Tabs/Tabs.js.map +1 -1
- package/dist/esm/components/View/View.css +16 -30
- package/dist/esm/components/View/View.js +11 -2
- package/dist/esm/components/View/View.js.map +1 -1
- package/dist/esm/components/View/viewNavigation.js +38 -49
- package/dist/esm/components/View/viewNavigation.js.map +1 -1
- package/dist/styles/components/View.css +16 -30
- package/dist/styles/index.css +1927 -1941
- package/dist/styles/muka-dark.css +1927 -1941
- package/dist/styles/muka-light.css +1927 -1941
- package/dist/styles/wireframe-dark.css +1927 -1941
- package/dist/styles/wireframe-light.css +1927 -1941
- package/dist/types/components/Tabs/Tabs.d.ts.map +1 -1
- package/dist/types/components/View/View.d.ts.map +1 -1
- package/dist/types/components/View/viewNavigation.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"View.js","sourceRoot":"","sources":["../../../../components/View/View.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,EAAE,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"View.js","sourceRoot":"","sources":["../../../../components/View/View.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,EAAE,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,EAAE,MAAM,EAA4B,MAAM,WA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AAE,eAAe,CAAC,iBAAiB,EAAE,OAAO,CAAC,EAC9D,UAAU,EAAE,UAAU,EACtB,IAAI,EAAE,IAAI,GACV,EAEF,gBAAM,SAAS,EAAC,iBAAiB,eAAY,OAAO,IAAI,SAAS,aAC/D,cAAK,SAAS,EAAC,uBAAuB,YACnC,OAAO,CAAC,CAAC,CAAC,KAAC,eAAe,KAAG,CAAC,CAAC,CAAC,QAAQ,GACrC,EAEL,MAAM,IAAI,CACT,cAAK,SAAS,EAAC,mBAAmB,YAC/B,MAAM,GACH,CACP,IACI,IACH,CACP,CAAC;IAEF,IAAI,CAAC,mBAAmB;QAAE,OAAO,IAAI,CAAC;IAEtC,2EAA2E;IAC3E,0EAA0E;IAC1E,OAAO,CACL,KAAC,mBAAmB,IAAC,KAAK,EAAC,iBAAiB,EAAC,IAAI,EAAC,gBAAgB,EAAC,MAAM,EAAC,MAAM,EAAC,KAAK,EAAC,MAAM,EAAC,OAAO,EAAC,MAAM,YACzG,IAAI,GACe,CACvB,CAAC;AACJ,CAAC,CAAC;AAEF,SAAS,eAAe;IACtB,OAAO,CACL,eAAK,SAAS,EAAC,oBAAoB,aACjC,KAAC,QAAQ,IAAC,OAAO,EAAC,MAAM,EAAC,KAAK,EAAC,KAAK,EAAC,MAAM,EAAE,EAAE,GAAI,EAClD,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CACnC,KAAC,QAAQ,IAAS,OAAO,EAAC,aAAa,EAAC,MAAM,EAAE,EAAE,EAAE,SAAS,EAAC,SAAS,IAAxD,CAAC,CAA0D,CAC3E,CAAC,IACE,CACP,CAAC;AACJ,CAAC;AAED,eAAe,IAAI,CAAC"}
|
|
@@ -22,10 +22,6 @@
|
|
|
22
22
|
* View.css can pick the animation before the browser starts it.
|
|
23
23
|
*/
|
|
24
24
|
const ATTRIBUTE = 'data-muka-nav';
|
|
25
|
-
/** Set when the leaving View is only in the root snapshot; see setDirection. */
|
|
26
|
-
const ROOT_ATTRIBUTE = 'data-muka-nav-root';
|
|
27
|
-
/** Where View.css slides; keep in sync with its media query. */
|
|
28
|
-
const SLIDE_MEDIA = '(max-width: 1023px) and (prefers-reduced-motion: no-preference)';
|
|
29
25
|
/** Strip a trailing slash so `/a/` and `/a` are the same entry. */
|
|
30
26
|
function normalize(path) {
|
|
31
27
|
return path.length > 1 ? path.replace(/\/+$/, '') : path;
|
|
@@ -62,6 +58,13 @@ let stack = [];
|
|
|
62
58
|
let pending = null;
|
|
63
59
|
let clearTimer;
|
|
64
60
|
let lastPopState = null;
|
|
61
|
+
/**
|
|
62
|
+
* A direction whose view transition was skipped before it animated. Next.js
|
|
63
|
+
* can start a transition for a navigation and abort it for the next commit of
|
|
64
|
+
* the same navigation (iOS Safari, back to a top View): that commit mounts the
|
|
65
|
+
* same path again, so on its own it would resolve to none and lose the slide.
|
|
66
|
+
*/
|
|
67
|
+
let unplayed = null;
|
|
65
68
|
let listening = false;
|
|
66
69
|
function listenForSystemBack() {
|
|
67
70
|
if (listening || typeof window === 'undefined')
|
|
@@ -81,58 +84,41 @@ function runningViewTransition() {
|
|
|
81
84
|
const doc = document;
|
|
82
85
|
return doc.activeViewTransition ?? doc.__reactViewTransition ?? undefined;
|
|
83
86
|
}
|
|
84
|
-
/**
|
|
85
|
-
* React hides the root snapshot (zero opacity, and a zero-size
|
|
86
|
-
* ::view-transition) when it thinks only ViewTransition boundaries changed.
|
|
87
|
-
* When the leaving View is in the root snapshot, that hides it: undo it.
|
|
88
|
-
*/
|
|
89
|
-
function revealRootSnapshot() {
|
|
90
|
-
for (const animation of document.getAnimations()) {
|
|
91
|
-
const pseudo = animation.effect?.pseudoElement;
|
|
92
|
-
if (pseudo === '::view-transition-group(root)' || pseudo === '::view-transition') {
|
|
93
|
-
if (!animation.animationName)
|
|
94
|
-
animation.cancel();
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
/** True when the leaving View got its own exit animation. */
|
|
99
|
-
function leavingViewAnimates() {
|
|
100
|
-
return document.getAnimations().some((animation) => {
|
|
101
|
-
const name = animation.animationName;
|
|
102
|
-
return name === 'muka-view-to-right' || name === 'muka-view-to-behind';
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
87
|
function setDirection(direction) {
|
|
106
88
|
const root = document.documentElement;
|
|
107
89
|
root.setAttribute(ATTRIBUTE, direction);
|
|
108
|
-
root.removeAttribute(ROOT_ATTRIBUTE);
|
|
109
90
|
clearTimeout(clearTimer);
|
|
91
|
+
unplayed = null;
|
|
110
92
|
const clear = () => {
|
|
111
|
-
if (root.getAttribute(ATTRIBUTE) === direction)
|
|
93
|
+
if (root.getAttribute(ATTRIBUTE) === direction)
|
|
112
94
|
root.removeAttribute(ATTRIBUTE);
|
|
113
|
-
root.removeAttribute(ROOT_ATTRIBUTE);
|
|
114
|
-
}
|
|
115
95
|
};
|
|
116
96
|
const transition = runningViewTransition();
|
|
117
97
|
if (!transition) {
|
|
118
98
|
clearTimer = setTimeout(clear, 1000);
|
|
119
99
|
return;
|
|
120
100
|
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
101
|
+
let skipped = false;
|
|
102
|
+
transition.ready.then(undefined, () => {
|
|
103
|
+
// Skipped before it animated: keep the direction for the transition that
|
|
104
|
+
// replaces it; the timer clears it if none comes.
|
|
105
|
+
skipped = true;
|
|
106
|
+
if (direction !== 'none')
|
|
107
|
+
unplayed = { direction, at: Date.now() };
|
|
108
|
+
clearTimer = setTimeout(clear, 1000);
|
|
109
|
+
});
|
|
110
|
+
transition.finished.then(() => {
|
|
111
|
+
if (!skipped)
|
|
112
|
+
clear();
|
|
113
|
+
}, () => {
|
|
114
|
+
if (!skipped)
|
|
115
|
+
clear();
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
function takeUnplayed() {
|
|
119
|
+
const carried = unplayed && Date.now() - unplayed.at < 1000 ? unplayed.direction : undefined;
|
|
120
|
+
unplayed = null;
|
|
121
|
+
return carried;
|
|
136
122
|
}
|
|
137
123
|
/**
|
|
138
124
|
* Called from a View's layout effect when it mounts. Every View that mounts in
|
|
@@ -153,11 +139,15 @@ export function registerViewMount(level, navigationKey) {
|
|
|
153
139
|
pending = null;
|
|
154
140
|
if (!next)
|
|
155
141
|
return;
|
|
142
|
+
const samePath = stack[stack.length - 1]?.path === normalize(next.path);
|
|
156
143
|
const result = resolveNavigation(stack, next);
|
|
157
144
|
stack = result.stack;
|
|
145
|
+
// The same View again after a skipped transition: play what was skipped.
|
|
146
|
+
const carried = takeUnplayed();
|
|
147
|
+
const direction = samePath && carried ? carried : result.direction;
|
|
158
148
|
const systemBack = lastPopState !== null && lastPopState.uaTransition && Date.now() - lastPopState.at < 1000;
|
|
159
|
-
if (
|
|
160
|
-
setDirection(systemBack ? 'none' :
|
|
149
|
+
if (direction !== 'none' || document.documentElement.hasAttribute(ATTRIBUTE)) {
|
|
150
|
+
setDirection(systemBack ? 'none' : direction);
|
|
161
151
|
}
|
|
162
152
|
});
|
|
163
153
|
}
|
|
@@ -166,10 +156,9 @@ export function resetViewNavigation() {
|
|
|
166
156
|
stack = [];
|
|
167
157
|
pending = null;
|
|
168
158
|
lastPopState = null;
|
|
159
|
+
unplayed = null;
|
|
169
160
|
clearTimeout(clearTimer);
|
|
170
|
-
if (typeof document !== 'undefined')
|
|
161
|
+
if (typeof document !== 'undefined')
|
|
171
162
|
document.documentElement.removeAttribute(ATTRIBUTE);
|
|
172
|
-
document.documentElement.removeAttribute(ROOT_ATTRIBUTE);
|
|
173
|
-
}
|
|
174
163
|
}
|
|
175
164
|
//# sourceMappingURL=viewNavigation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"viewNavigation.js","sourceRoot":"","sources":["../../../../components/View/viewNavigation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AASH,MAAM,SAAS,GAAG,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"viewNavigation.js","sourceRoot":"","sources":["../../../../components/View/viewNavigation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AASH,MAAM,SAAS,GAAG,eAAe,CAAC;AAElC,mEAAmE;AACnE,SAAS,SAAS,CAAC,IAAY;IAC7B,OAAO,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAC3D,CAAC;AAED,SAAS,YAAY,CAAC,MAAc,EAAE,KAAa;IACjD,OAAO,MAAM,KAAK,KAAK,IAAI,KAAK,CAAC,UAAU,CAAC,MAAM,KAAK,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,MAAM,GAAG,CAAC,CAAC;AACnF,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAC/B,KAA0B,EAC1B,IAAc;IAEd,MAAM,KAAK,GAAG,EAAE,GAAG,IAAI,EAAE,IAAI,EAAE,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;IACtD,MAAM,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAExC,IAAI,CAAC,OAAO;QAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC;IAC3D,IAAI,OAAO,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI,EAAE,CAAC;QAChC,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,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ClB,MAAM,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,EAAE,IAAI,KAAK,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACxE,MAAM,MAAM,GAAG,iBAAiB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QAC9C,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;QACrB,yEAAyE;QACzE,MAAM,OAAO,GAAG,YAAY,EAAE,CAAC;QAC/B,MAAM,SAAS,GAAG,QAAQ,IAAI,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC;QACnE,MAAM,UAAU,GACd,YAAY,KAAK,IAAI,IAAI,YAAY,CAAC,YAAY,IAAI,IAAI,CAAC,GAAG,EAAE,GAAG,YAAY,CAAC,EAAE,GAAG,IAAI,CAAC;QAC5F,IAAI,SAAS,KAAK,MAAM,IAAI,QAAQ,CAAC,eAAe,CAAC,YAAY,CAAC,SAAS,CAAC,EAAE,CAAC;YAC7E,YAAY,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;QAChD,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AAED,qCAAqC;AACrC,MAAM,UAAU,mBAAmB;IACjC,KAAK,GAAG,EAAE,CAAC;IACX,OAAO,GAAG,IAAI,CAAC;IACf,YAAY,GAAG,IAAI,CAAC;IACpB,QAAQ,GAAG,IAAI,CAAC;IAChB,YAAY,CAAC,UAAU,CAAC,CAAC;IACzB,IAAI,OAAO,QAAQ,KAAK,WAAW;QAAE,QAAQ,CAAC,eAAe,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;AAC3F,CAAC"}
|
|
@@ -127,6 +127,14 @@
|
|
|
127
127
|
padding: var(--spacing-4);
|
|
128
128
|
}
|
|
129
129
|
|
|
130
|
+
/* Every View carries its own view-transition-name (see View.tsx), with this
|
|
131
|
+
class, so a View React didn't mark as leaving is still its own layer. A View
|
|
132
|
+
that stays (old and new image) doesn't move; one that leaves has only an old
|
|
133
|
+
image (:only-child) and gets the exit motion below. */
|
|
134
|
+
.muka-view {
|
|
135
|
+
view-transition-class: muka-view-exit;
|
|
136
|
+
}
|
|
137
|
+
|
|
130
138
|
/* ─── Navigation motion (push / pop) ──────────────────────
|
|
131
139
|
React wraps each View in <ViewTransition enter="muka-view-enter"
|
|
132
140
|
exit="muka-view-exit">; viewNavigation.ts writes the direction to
|
|
@@ -139,6 +147,7 @@
|
|
|
139
147
|
|
|
140
148
|
/* No direction, or the large tier: swap without the browser's default crossfade. */
|
|
141
149
|
::view-transition-old(.muka-view-exit),
|
|
150
|
+
::view-transition-new(.muka-view-exit),
|
|
142
151
|
::view-transition-new(.muka-view-enter) {
|
|
143
152
|
animation: none;
|
|
144
153
|
}
|
|
@@ -163,11 +172,11 @@
|
|
|
163
172
|
animation: muka-view-from-right var(--motion-duration-view) var(--motion-easing-enter) both;
|
|
164
173
|
}
|
|
165
174
|
|
|
166
|
-
:root[data-muka-nav='push']::view-transition-old(.muka-view-exit) {
|
|
175
|
+
:root[data-muka-nav='push']::view-transition-old(.muka-view-exit):only-child {
|
|
167
176
|
animation: muka-view-to-behind var(--motion-duration-view) var(--motion-easing-enter) both;
|
|
168
177
|
}
|
|
169
178
|
|
|
170
|
-
:root[data-muka-nav='pop']::view-transition-old(.muka-view-exit) {
|
|
179
|
+
:root[data-muka-nav='pop']::view-transition-old(.muka-view-exit):only-child {
|
|
171
180
|
animation: muka-view-to-right var(--motion-duration-view) var(--motion-easing-enter) both;
|
|
172
181
|
}
|
|
173
182
|
|
|
@@ -175,34 +184,11 @@
|
|
|
175
184
|
animation: muka-view-from-behind var(--motion-duration-view) var(--motion-easing-enter) both;
|
|
176
185
|
}
|
|
177
186
|
|
|
178
|
-
/* The leaving View without an exit of its own (React drops it for a View
|
|
179
|
-
that first appeared through a Suspense reveal) is in the root snapshot:
|
|
180
|
-
move that instead, and hide the new root, which is only the page behind
|
|
181
|
-
the entering View. On a pop the old root goes above the entering View. */
|
|
182
|
-
:root[data-muka-nav][data-muka-nav-root]::view-transition-new(root) {
|
|
183
|
-
animation: none;
|
|
184
|
-
opacity: 0;
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
:root[data-muka-nav='push'][data-muka-nav-root]::view-transition-old(root) {
|
|
188
|
-
animation: muka-view-to-behind var(--motion-duration-view) var(--motion-easing-enter) both;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
:root[data-muka-nav='pop'][data-muka-nav-root]::view-transition-group(root) {
|
|
192
|
-
z-index: 2;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
:root[data-muka-nav='pop'][data-muka-nav-root]::view-transition-old(root) {
|
|
196
|
-
animation: muka-view-to-right var(--motion-duration-view) var(--motion-easing-enter) both;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
187
|
}
|
|
200
188
|
|
|
201
189
|
/* Large tier: the same direction, quietly. The sidebar and app bar stay put,
|
|
202
190
|
so only a short fade with a 16px shift says deeper or back: the new View
|
|
203
|
-
fades in from the side it comes from, the old one fades out the other way.
|
|
204
|
-
A leaving View without an exit of its own (see above) just goes; moving the
|
|
205
|
-
root snapshot here would move the sidebar with it. */
|
|
191
|
+
fades in from the side it comes from, the old one fades out the other way. */
|
|
206
192
|
@media (min-width: 1024px) {
|
|
207
193
|
:root[data-muka-nav]::view-transition {
|
|
208
194
|
pointer-events: none;
|
|
@@ -213,18 +199,18 @@
|
|
|
213
199
|
animation: muka-view-shift-in var(--motion-duration-micro) var(--motion-easing-enter) both;
|
|
214
200
|
}
|
|
215
201
|
|
|
216
|
-
:root[data-muka-nav='push']::view-transition-old(.muka-view-exit),
|
|
217
|
-
:root[data-muka-nav='pop']::view-transition-old(.muka-view-exit) {
|
|
202
|
+
:root[data-muka-nav='push']::view-transition-old(.muka-view-exit):only-child,
|
|
203
|
+
:root[data-muka-nav='pop']::view-transition-old(.muka-view-exit):only-child {
|
|
218
204
|
animation: muka-view-shift-out var(--motion-duration-exit) var(--motion-easing-exit) both;
|
|
219
205
|
}
|
|
220
206
|
|
|
221
207
|
:root[data-muka-nav='push']::view-transition-new(.muka-view-enter),
|
|
222
|
-
:root[data-muka-nav='pop']::view-transition-old(.muka-view-exit) {
|
|
208
|
+
:root[data-muka-nav='pop']::view-transition-old(.muka-view-exit):only-child {
|
|
223
209
|
--muka-view-shift: var(--spacing-4);
|
|
224
210
|
}
|
|
225
211
|
|
|
226
212
|
:root[data-muka-nav='pop']::view-transition-new(.muka-view-enter),
|
|
227
|
-
:root[data-muka-nav='push']::view-transition-old(.muka-view-exit) {
|
|
213
|
+
:root[data-muka-nav='push']::view-transition-old(.muka-view-exit):only-child {
|
|
228
214
|
--muka-view-shift: calc(-1 * var(--spacing-4));
|
|
229
215
|
}
|
|
230
216
|
}
|