@ssgoi/core 4.1.0 → 4.2.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/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +548 -499
- package/dist/ssgoi-transition/create-ssgoi-transition-context.d.ts +4 -1
- package/dist/ssgoi-transition/create-ssgoi-transition-context.d.ts.map +1 -1
- package/dist/ssgoi-transition/navigation-detector-strategy.d.ts +42 -0
- package/dist/ssgoi-transition/navigation-detector-strategy.d.ts.map +1 -0
- package/dist/types.d.ts +19 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/ssgoi-transition/types.d.ts +0 -8
- package/dist/ssgoi-transition/types.d.ts.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { normalizeToMultiAnimation as
|
|
5
|
-
import { isCssAnimation as
|
|
6
|
-
import { S as
|
|
7
|
-
class
|
|
1
|
+
var tt = Object.defineProperty;
|
|
2
|
+
var et = (e, n, t) => n in e ? tt(e, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[n] = t;
|
|
3
|
+
var m = (e, n, t) => et(e, typeof n != "symbol" ? n + "" : n, t);
|
|
4
|
+
import { normalizeToMultiAnimation as F, normalizeSchedule as X } from "./types.js";
|
|
5
|
+
import { isCssAnimation as _t, isMultiAnimation as Nt, isSingleAnimation as Ut, isTickAnimation as Ht } from "./types.js";
|
|
6
|
+
import { S as $, I as it, a as nt } from "./provider-Cu4NSF1Q.js";
|
|
7
|
+
class rt {
|
|
8
8
|
constructor() {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
m(this, "listeners", /* @__PURE__ */ new Set());
|
|
10
|
+
m(this, "rafId", null);
|
|
11
|
+
m(this, "isRunning", !1);
|
|
12
12
|
// Timing
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
m(this, "startTime", Date.now());
|
|
14
|
+
m(this, "lastUpdate", this.startTime);
|
|
15
|
+
m(this, "elapsed", 0);
|
|
16
16
|
// Lag smoothing (mobile optimization)
|
|
17
|
-
|
|
17
|
+
m(this, "lagThreshold", 500);
|
|
18
18
|
// ms - detect tab switches, backgrounding
|
|
19
|
-
|
|
19
|
+
m(this, "adjustedLag", 33);
|
|
20
20
|
// ms - max time jump to prevent animation skip
|
|
21
|
-
|
|
21
|
+
m(this, "maxDeltaTime", 33);
|
|
22
22
|
// ms - clamp for physics stability (30fps minimum)
|
|
23
23
|
// FPS throttling
|
|
24
|
-
|
|
24
|
+
m(this, "gap", 1e3 / 240);
|
|
25
25
|
// max 240fps
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
const
|
|
29
|
-
let
|
|
30
|
-
|
|
31
|
-
const
|
|
32
|
-
if (
|
|
33
|
-
const c =
|
|
34
|
-
this.elapsed =
|
|
35
|
-
|
|
26
|
+
m(this, "nextTime", this.gap);
|
|
27
|
+
m(this, "tick", () => {
|
|
28
|
+
const n = Date.now();
|
|
29
|
+
let i = n - this.lastUpdate;
|
|
30
|
+
i > this.lagThreshold || i < 0 ? (this.startTime += i - this.adjustedLag, i = this.adjustedLag) : i > this.maxDeltaTime && (i = this.maxDeltaTime), this.lastUpdate = n;
|
|
31
|
+
const r = n - this.startTime, o = r - this.nextTime;
|
|
32
|
+
if (o > 0) {
|
|
33
|
+
const c = i / 1e3;
|
|
34
|
+
this.elapsed = r / 1e3, this.nextTime += o + (o >= this.gap ? 4 : this.gap - o), this.listeners.forEach((a) => {
|
|
35
|
+
a(c, this.elapsed);
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
38
|
this.listeners.size > 0 ? this.rafId = requestAnimationFrame(this.tick) : (this.isRunning = !1, this.rafId = null);
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
|
-
subscribe(
|
|
42
|
-
return this.listeners.add(
|
|
43
|
-
this.unsubscribe(
|
|
41
|
+
subscribe(n) {
|
|
42
|
+
return this.listeners.add(n), this.isRunning || (this.isRunning = !0, this.rafId = requestAnimationFrame(this.tick)), () => {
|
|
43
|
+
this.unsubscribe(n);
|
|
44
44
|
};
|
|
45
45
|
}
|
|
46
|
-
unsubscribe(
|
|
47
|
-
this.listeners.delete(
|
|
46
|
+
unsubscribe(n) {
|
|
47
|
+
this.listeners.delete(n), this.listeners.size === 0 && this.rafId !== null && (cancelAnimationFrame(this.rafId), this.isRunning = !1, this.rafId = null);
|
|
48
48
|
}
|
|
49
49
|
/**
|
|
50
50
|
* Configure lag smoothing behavior
|
|
51
51
|
* @param threshold - Time threshold to detect lag (default: 500ms)
|
|
52
52
|
* @param adjustedLag - Max time jump when lag detected (default: 33ms)
|
|
53
53
|
*/
|
|
54
|
-
lagSmoothing(
|
|
55
|
-
this.lagThreshold =
|
|
54
|
+
lagSmoothing(n, t) {
|
|
55
|
+
this.lagThreshold = n, this.adjustedLag = Math.min(t, n);
|
|
56
56
|
}
|
|
57
57
|
/**
|
|
58
58
|
* Set maximum FPS
|
|
59
59
|
* @param fps - Target FPS (default: 240)
|
|
60
60
|
*/
|
|
61
|
-
fps(
|
|
62
|
-
this.gap = 1e3 /
|
|
61
|
+
fps(n) {
|
|
62
|
+
this.gap = 1e3 / n, this.nextTime = this.elapsed * 1e3 + this.gap;
|
|
63
63
|
}
|
|
64
64
|
getListenerCount() {
|
|
65
65
|
return this.listeners.size;
|
|
@@ -68,53 +68,53 @@ class et {
|
|
|
68
68
|
return this.elapsed;
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
|
-
const
|
|
72
|
-
function
|
|
71
|
+
const _ = new rt();
|
|
72
|
+
function ot(e) {
|
|
73
73
|
const {
|
|
74
|
-
integrator:
|
|
74
|
+
integrator: n,
|
|
75
75
|
from: t,
|
|
76
|
-
to:
|
|
77
|
-
velocity:
|
|
78
|
-
onUpdate:
|
|
76
|
+
to: i,
|
|
77
|
+
velocity: r = 0,
|
|
78
|
+
onUpdate: o,
|
|
79
79
|
onComplete: c,
|
|
80
|
-
onStart:
|
|
81
|
-
} =
|
|
82
|
-
let
|
|
83
|
-
const
|
|
80
|
+
onStart: a
|
|
81
|
+
} = e;
|
|
82
|
+
let s = { position: t, velocity: r }, u = !0, h = 0, p = !1;
|
|
83
|
+
const w = (v) => {
|
|
84
84
|
if (u) {
|
|
85
|
-
if (
|
|
86
|
-
if (
|
|
87
|
-
|
|
85
|
+
if (p || (p = !0, a == null || a()), s = n.step(s, i, v), n.isSettled(s, i)) {
|
|
86
|
+
if (h += Math.min(v, 0.033), h >= $) {
|
|
87
|
+
s = { position: i, velocity: 0 }, u = !1, o(s.position), _.unsubscribe(w), c();
|
|
88
88
|
return;
|
|
89
89
|
}
|
|
90
90
|
} else
|
|
91
|
-
|
|
92
|
-
s
|
|
91
|
+
h = 0;
|
|
92
|
+
o(s.position);
|
|
93
93
|
}
|
|
94
94
|
};
|
|
95
|
-
return
|
|
95
|
+
return _.subscribe(w), {
|
|
96
96
|
stop: () => {
|
|
97
|
-
u && (u = !1,
|
|
97
|
+
u && (u = !1, _.unsubscribe(w));
|
|
98
98
|
},
|
|
99
|
-
getPosition: () =>
|
|
100
|
-
getVelocity: () =>
|
|
99
|
+
getPosition: () => s.position,
|
|
100
|
+
getVelocity: () => s.velocity,
|
|
101
101
|
isRunning: () => u
|
|
102
102
|
};
|
|
103
103
|
}
|
|
104
|
-
const
|
|
105
|
-
function
|
|
106
|
-
let
|
|
107
|
-
const
|
|
108
|
-
for (let
|
|
109
|
-
const u =
|
|
110
|
-
if (
|
|
104
|
+
const M = 1e3 / 60;
|
|
105
|
+
function st(e, n, t, i = 0) {
|
|
106
|
+
let o = { position: n, velocity: i }, c = 0;
|
|
107
|
+
const a = [];
|
|
108
|
+
for (let s = 0; s < 600; s++) {
|
|
109
|
+
const u = s * M;
|
|
110
|
+
if (a.push({
|
|
111
111
|
time: u,
|
|
112
|
-
position:
|
|
113
|
-
velocity:
|
|
114
|
-
}),
|
|
115
|
-
if (c +=
|
|
116
|
-
|
|
117
|
-
time: (
|
|
112
|
+
position: o.position,
|
|
113
|
+
velocity: o.velocity
|
|
114
|
+
}), o = e.step(o, t, M / 1e3), e.isSettled(o, t)) {
|
|
115
|
+
if (c += M / 1e3, c >= $) {
|
|
116
|
+
a.push({
|
|
117
|
+
time: (s + 1) * M,
|
|
118
118
|
position: t,
|
|
119
119
|
velocity: 0
|
|
120
120
|
});
|
|
@@ -123,83 +123,83 @@ function nt(n, i, t, e = 0) {
|
|
|
123
123
|
} else
|
|
124
124
|
c = 0;
|
|
125
125
|
}
|
|
126
|
-
return
|
|
126
|
+
return a;
|
|
127
127
|
}
|
|
128
|
-
function
|
|
129
|
-
if (
|
|
128
|
+
function Y(e, n) {
|
|
129
|
+
if (e.length === 0)
|
|
130
130
|
return { position: 0, velocity: 0 };
|
|
131
|
-
const t =
|
|
132
|
-
if (
|
|
131
|
+
const t = e[0], i = e[e.length - 1];
|
|
132
|
+
if (n <= 0)
|
|
133
133
|
return { position: t.position, velocity: t.velocity };
|
|
134
|
-
if (
|
|
135
|
-
return { position:
|
|
136
|
-
let
|
|
137
|
-
for (;
|
|
138
|
-
const u = Math.floor((
|
|
139
|
-
|
|
134
|
+
if (n >= i.time)
|
|
135
|
+
return { position: i.position, velocity: i.velocity };
|
|
136
|
+
let r = 0, o = e.length - 1;
|
|
137
|
+
for (; r < o - 1; ) {
|
|
138
|
+
const u = Math.floor((r + o) / 2);
|
|
139
|
+
e[u].time <= n ? r = u : o = u;
|
|
140
140
|
}
|
|
141
|
-
const c =
|
|
141
|
+
const c = e[r], a = e[o], s = (n - c.time) / (a.time - c.time);
|
|
142
142
|
return {
|
|
143
|
-
position: c.position + (
|
|
144
|
-
velocity: c.velocity + (
|
|
143
|
+
position: c.position + (a.position - c.position) * s,
|
|
144
|
+
velocity: c.velocity + (a.velocity - c.velocity) * s
|
|
145
145
|
};
|
|
146
146
|
}
|
|
147
|
-
function
|
|
148
|
-
return
|
|
147
|
+
function at(e, n) {
|
|
148
|
+
return e.map((t) => n(t.position));
|
|
149
149
|
}
|
|
150
|
-
function
|
|
150
|
+
function ct(e) {
|
|
151
151
|
const {
|
|
152
|
-
integrator:
|
|
152
|
+
integrator: n,
|
|
153
153
|
element: t,
|
|
154
|
-
from:
|
|
155
|
-
to:
|
|
156
|
-
velocity:
|
|
154
|
+
from: i,
|
|
155
|
+
to: r,
|
|
156
|
+
velocity: o = 0,
|
|
157
157
|
style: c,
|
|
158
|
-
onComplete:
|
|
159
|
-
onStart:
|
|
160
|
-
} =
|
|
158
|
+
onComplete: a,
|
|
159
|
+
onStart: s
|
|
160
|
+
} = e, u = st(n, i, r, o);
|
|
161
161
|
if (u.length === 0)
|
|
162
|
-
return
|
|
162
|
+
return s == null || s(), a(), {
|
|
163
163
|
stop: () => {
|
|
164
164
|
},
|
|
165
|
-
getPosition: () =>
|
|
165
|
+
getPosition: () => r,
|
|
166
166
|
getVelocity: () => 0,
|
|
167
167
|
isRunning: () => !1
|
|
168
168
|
};
|
|
169
|
-
const
|
|
170
|
-
if (
|
|
171
|
-
for (const
|
|
172
|
-
t.style[
|
|
173
|
-
const
|
|
174
|
-
duration:
|
|
169
|
+
const h = at(u, c), p = u[u.length - 1], w = p.time, v = h[0];
|
|
170
|
+
if (v)
|
|
171
|
+
for (const y of Object.keys(v))
|
|
172
|
+
t.style[y] = "";
|
|
173
|
+
const d = t.animate(h, {
|
|
174
|
+
duration: w,
|
|
175
175
|
fill: "forwards",
|
|
176
176
|
easing: "linear",
|
|
177
177
|
composite: "replace"
|
|
178
178
|
});
|
|
179
179
|
let l = !0;
|
|
180
|
-
const
|
|
181
|
-
return
|
|
182
|
-
l && (l = !1,
|
|
180
|
+
const C = performance.now();
|
|
181
|
+
return s == null || s(), d.onfinish = () => {
|
|
182
|
+
l && (l = !1, a());
|
|
183
183
|
}, {
|
|
184
184
|
stop: () => {
|
|
185
|
-
l && (l = !1,
|
|
185
|
+
l && (l = !1, d.cancel());
|
|
186
186
|
},
|
|
187
187
|
getPosition: () => {
|
|
188
188
|
if (!l)
|
|
189
|
-
return
|
|
190
|
-
const
|
|
191
|
-
return
|
|
189
|
+
return p.position;
|
|
190
|
+
const y = performance.now() - C;
|
|
191
|
+
return Y(u, y).position;
|
|
192
192
|
},
|
|
193
193
|
getVelocity: () => {
|
|
194
194
|
if (!l)
|
|
195
195
|
return 0;
|
|
196
|
-
const
|
|
197
|
-
return
|
|
196
|
+
const y = performance.now() - C;
|
|
197
|
+
return Y(u, y).velocity;
|
|
198
198
|
},
|
|
199
199
|
isRunning: () => l
|
|
200
200
|
};
|
|
201
201
|
}
|
|
202
|
-
class
|
|
202
|
+
class lt {
|
|
203
203
|
/**
|
|
204
204
|
* Get bound runner based on animation mode
|
|
205
205
|
*
|
|
@@ -207,33 +207,33 @@ class st {
|
|
|
207
207
|
* @returns Bound runner function or null if no animation mode specified
|
|
208
208
|
* @throws Error if both tick and css are provided
|
|
209
209
|
*/
|
|
210
|
-
static from(
|
|
211
|
-
const { tick: t, css:
|
|
212
|
-
if (t &&
|
|
210
|
+
static from(n) {
|
|
211
|
+
const { tick: t, css: i } = n;
|
|
212
|
+
if (t && i)
|
|
213
213
|
throw new Error("Cannot use both 'tick' and 'css' options together");
|
|
214
|
-
return
|
|
215
|
-
...
|
|
216
|
-
element:
|
|
217
|
-
style:
|
|
218
|
-
}) : t ? (
|
|
219
|
-
...
|
|
214
|
+
return i ? (r) => ct({
|
|
215
|
+
...r,
|
|
216
|
+
element: i.element,
|
|
217
|
+
style: i.style
|
|
218
|
+
}) : t ? (r) => ot({
|
|
219
|
+
...r,
|
|
220
220
|
onUpdate: t
|
|
221
221
|
}) : null;
|
|
222
222
|
}
|
|
223
223
|
}
|
|
224
|
-
class
|
|
224
|
+
class K {
|
|
225
225
|
}
|
|
226
|
-
const
|
|
227
|
-
class
|
|
226
|
+
const ut = { stiffness: 300, damping: 30 };
|
|
227
|
+
class j extends K {
|
|
228
228
|
constructor(t) {
|
|
229
229
|
super();
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
230
|
+
m(this, "options");
|
|
231
|
+
m(this, "runner");
|
|
232
|
+
m(this, "controls", null);
|
|
233
|
+
m(this, "isAnimating", !1);
|
|
234
|
+
m(this, "currentValue");
|
|
235
|
+
m(this, "currentVelocity", 0);
|
|
236
|
+
m(this, "updateFn");
|
|
237
237
|
if (this.options = {
|
|
238
238
|
from: t.from ?? 0,
|
|
239
239
|
to: t.to ?? 1,
|
|
@@ -242,21 +242,21 @@ class H extends j {
|
|
|
242
242
|
}),
|
|
243
243
|
onStart: t.onStart
|
|
244
244
|
}, this.currentValue = this.options.from, t.tick)
|
|
245
|
-
this.updateFn = (
|
|
246
|
-
var
|
|
247
|
-
return (
|
|
245
|
+
this.updateFn = (i) => {
|
|
246
|
+
var r;
|
|
247
|
+
return (r = t.tick) == null ? void 0 : r.call(t, i);
|
|
248
248
|
};
|
|
249
249
|
else if (t.css) {
|
|
250
|
-
const { element:
|
|
251
|
-
this.updateFn = (
|
|
252
|
-
const c = o
|
|
253
|
-
for (const [
|
|
254
|
-
|
|
250
|
+
const { element: i, style: r } = t.css;
|
|
251
|
+
this.updateFn = (o) => {
|
|
252
|
+
const c = r(o);
|
|
253
|
+
for (const [a, s] of Object.entries(c))
|
|
254
|
+
i.style[a] = typeof s == "number" ? String(s) : s;
|
|
255
255
|
};
|
|
256
256
|
} else
|
|
257
257
|
this.updateFn = () => {
|
|
258
258
|
};
|
|
259
|
-
this.runner =
|
|
259
|
+
this.runner = lt.from({
|
|
260
260
|
tick: t.tick,
|
|
261
261
|
css: t.css
|
|
262
262
|
});
|
|
@@ -275,15 +275,15 @@ class H extends j {
|
|
|
275
275
|
*/
|
|
276
276
|
createIntegrator() {
|
|
277
277
|
const t = this.options.physics;
|
|
278
|
-
return t != null && t.integrator ? t.integrator() : t != null && t.spring || t != null && t.inertia ?
|
|
278
|
+
return t != null && t.integrator ? t.integrator() : t != null && t.spring || t != null && t.inertia ? it.from({
|
|
279
279
|
spring: t.spring,
|
|
280
280
|
inertia: t.inertia
|
|
281
|
-
}) : new
|
|
281
|
+
}) : new nt(ut);
|
|
282
282
|
}
|
|
283
283
|
runAnimation(t) {
|
|
284
|
-
var
|
|
284
|
+
var i, r;
|
|
285
285
|
if (this.isAnimating = !0, !this.runner) {
|
|
286
|
-
(
|
|
286
|
+
(r = (i = this.options).onStart) == null || r.call(i), this.currentValue = t, this.currentVelocity = 0, this.isAnimating = !1, this.options.onComplete();
|
|
287
287
|
return;
|
|
288
288
|
}
|
|
289
289
|
this.controls = this.runner({
|
|
@@ -339,20 +339,20 @@ class H extends j {
|
|
|
339
339
|
this.options = { ...this.options, ...t };
|
|
340
340
|
}
|
|
341
341
|
}
|
|
342
|
-
class
|
|
342
|
+
class L extends K {
|
|
343
343
|
constructor(t) {
|
|
344
344
|
super();
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
345
|
+
m(this, "config");
|
|
346
|
+
m(this, "animators", /* @__PURE__ */ new Map());
|
|
347
|
+
m(this, "itemOrder", []);
|
|
348
|
+
m(this, "completedCount", 0);
|
|
349
|
+
m(this, "completedAnimators", /* @__PURE__ */ new Set());
|
|
350
|
+
m(this, "direction", "forward");
|
|
351
|
+
m(this, "idCounter", 0);
|
|
352
|
+
m(this, "rafId", null);
|
|
353
|
+
m(this, "from");
|
|
354
|
+
m(this, "to");
|
|
355
|
+
m(this, "initialState");
|
|
356
356
|
this.config = t.config, this.from = t.from, this.to = t.to, this.initialState = t.state ?? {
|
|
357
357
|
position: t.from,
|
|
358
358
|
velocity: 0
|
|
@@ -362,22 +362,22 @@ class M extends j {
|
|
|
362
362
|
return `spring_${this.idCounter++}`;
|
|
363
363
|
}
|
|
364
364
|
initializeAnimators() {
|
|
365
|
-
this.config.items.forEach((t,
|
|
366
|
-
const
|
|
365
|
+
this.config.items.forEach((t, i) => {
|
|
366
|
+
const r = this.generateId(), o = new j({
|
|
367
367
|
from: this.from,
|
|
368
368
|
to: this.to,
|
|
369
369
|
physics: t.physics,
|
|
370
370
|
tick: t.tick,
|
|
371
371
|
css: t.css,
|
|
372
|
-
onComplete: () => this.onAnimatorComplete(
|
|
372
|
+
onComplete: () => this.onAnimatorComplete(r),
|
|
373
373
|
onStart: t.onStart
|
|
374
374
|
});
|
|
375
|
-
(
|
|
376
|
-
id:
|
|
375
|
+
(i === 0 || t.normalizedOffset === 0) && (o.setValue(this.initialState.position), o.setVelocity(this.initialState.velocity), o.syncState()), this.animators.set(r, {
|
|
376
|
+
id: r,
|
|
377
377
|
item: t,
|
|
378
|
-
animator:
|
|
378
|
+
animator: o,
|
|
379
379
|
started: !1
|
|
380
|
-
}), this.itemOrder.push(
|
|
380
|
+
}), this.itemOrder.push(r);
|
|
381
381
|
});
|
|
382
382
|
}
|
|
383
383
|
/**
|
|
@@ -385,8 +385,8 @@ class M extends j {
|
|
|
385
385
|
* Progress = |position - from| / |to - from|
|
|
386
386
|
*/
|
|
387
387
|
getAnimatorProgress(t) {
|
|
388
|
-
const
|
|
389
|
-
return
|
|
388
|
+
const i = t.animator.getCurrentState(), r = Math.abs(i.to - i.from);
|
|
389
|
+
return r === 0 ? 1 : Math.abs(i.position - i.from) / r;
|
|
390
390
|
}
|
|
391
391
|
/**
|
|
392
392
|
* Get order of springs based on direction
|
|
@@ -397,9 +397,9 @@ class M extends j {
|
|
|
397
397
|
return this.direction === "forward" ? this.itemOrder : [...this.itemOrder].reverse();
|
|
398
398
|
}
|
|
399
399
|
onAnimatorComplete(t) {
|
|
400
|
-
var
|
|
401
|
-
const
|
|
402
|
-
!
|
|
400
|
+
var r, o, c, a, s, u;
|
|
401
|
+
const i = this.animators.get(t);
|
|
402
|
+
!i || this.completedAnimators.has(t) || (this.completedAnimators.add(t), this.completedCount++, (o = (r = i.item).onComplete) == null || o.call(r), (a = (c = this.config).onProgress) == null || a.call(c, this.completedCount, this.config.items.length), this.completedCount === this.config.items.length && (this.stopScheduler(), (u = (s = this.config).onEnd) == null || u.call(s)));
|
|
403
403
|
}
|
|
404
404
|
/**
|
|
405
405
|
* Check and start springs based on previous spring's progress
|
|
@@ -407,22 +407,22 @@ class M extends j {
|
|
|
407
407
|
*/
|
|
408
408
|
checkAndStartSprings() {
|
|
409
409
|
const t = this.getOrderedIds();
|
|
410
|
-
for (let
|
|
411
|
-
const
|
|
412
|
-
if (!
|
|
413
|
-
if (
|
|
414
|
-
this.startAnimator(
|
|
410
|
+
for (let i = 0; i < t.length; i++) {
|
|
411
|
+
const r = t[i], o = this.animators.get(r);
|
|
412
|
+
if (!o || o.started) continue;
|
|
413
|
+
if (i === 0) {
|
|
414
|
+
this.startAnimator(r);
|
|
415
415
|
continue;
|
|
416
416
|
}
|
|
417
|
-
const c = t[
|
|
418
|
-
if (!
|
|
419
|
-
const
|
|
420
|
-
|
|
417
|
+
const c = t[i - 1], a = this.animators.get(c);
|
|
418
|
+
if (!a || !a.started) continue;
|
|
419
|
+
const s = this.getAnimatorProgress(a), u = o.item.normalizedOffset;
|
|
420
|
+
s >= u && this.startAnimator(r);
|
|
421
421
|
}
|
|
422
422
|
}
|
|
423
423
|
startAnimator(t) {
|
|
424
|
-
const
|
|
425
|
-
!
|
|
424
|
+
const i = this.animators.get(t);
|
|
425
|
+
!i || i.started || (i.started = !0, this.direction === "forward" ? i.animator.forward() : i.animator.backward());
|
|
426
426
|
}
|
|
427
427
|
/**
|
|
428
428
|
* Start the scheduler loop that checks spring progress
|
|
@@ -437,17 +437,17 @@ class M extends j {
|
|
|
437
437
|
this.rafId !== null && (cancelAnimationFrame(this.rafId), this.rafId = null);
|
|
438
438
|
}
|
|
439
439
|
getFirstAnimator() {
|
|
440
|
-
var
|
|
440
|
+
var i;
|
|
441
441
|
const t = this.itemOrder[0];
|
|
442
|
-
return t ? ((
|
|
442
|
+
return t ? ((i = this.animators.get(t)) == null ? void 0 : i.animator) ?? null : null;
|
|
443
443
|
}
|
|
444
444
|
forward() {
|
|
445
|
-
var t,
|
|
446
|
-
this.stop(), this.direction = "forward", this.completedCount = 0, this.completedAnimators.clear(), this.resetStartedFlags(), (
|
|
445
|
+
var t, i;
|
|
446
|
+
this.stop(), this.direction = "forward", this.completedCount = 0, this.completedAnimators.clear(), this.resetStartedFlags(), (i = (t = this.config).onStart) == null || i.call(t), this.startScheduler();
|
|
447
447
|
}
|
|
448
448
|
backward() {
|
|
449
|
-
var t,
|
|
450
|
-
this.stop(), this.direction = "backward", this.completedCount = 0, this.completedAnimators.clear(), this.resetStartedFlags(), (
|
|
449
|
+
var t, i;
|
|
450
|
+
this.stop(), this.direction = "backward", this.completedCount = 0, this.completedAnimators.clear(), this.resetStartedFlags(), (i = (t = this.config).onStart) == null || i.call(t), this.startScheduler();
|
|
451
451
|
}
|
|
452
452
|
resetStartedFlags() {
|
|
453
453
|
this.animators.forEach((t) => {
|
|
@@ -463,9 +463,9 @@ class M extends j {
|
|
|
463
463
|
this.direction = this.direction === "forward" ? "backward" : "forward", this.animators.forEach((t) => {
|
|
464
464
|
if (!t.started)
|
|
465
465
|
return;
|
|
466
|
-
const
|
|
467
|
-
if (
|
|
468
|
-
const
|
|
466
|
+
const i = t.animator.getCurrentState();
|
|
467
|
+
if (i.position === i.to) {
|
|
468
|
+
const o = new j({
|
|
469
469
|
from: this.to,
|
|
470
470
|
to: this.from,
|
|
471
471
|
physics: t.item.physics,
|
|
@@ -474,7 +474,7 @@ class M extends j {
|
|
|
474
474
|
onComplete: () => this.onAnimatorComplete(t.id),
|
|
475
475
|
onStart: t.item.onStart
|
|
476
476
|
});
|
|
477
|
-
|
|
477
|
+
o.setValue(this.to), o.setVelocity(0), o.syncState(), o.forward(), t.animator = o;
|
|
478
478
|
} else
|
|
479
479
|
t.animator.reverse();
|
|
480
480
|
});
|
|
@@ -507,16 +507,16 @@ class M extends j {
|
|
|
507
507
|
* TODO: Support per-spring control
|
|
508
508
|
*/
|
|
509
509
|
setValue(t) {
|
|
510
|
-
const
|
|
511
|
-
|
|
510
|
+
const i = this.getFirstAnimator();
|
|
511
|
+
i == null || i.setValue(t);
|
|
512
512
|
}
|
|
513
513
|
/**
|
|
514
514
|
* Set velocity on first animator
|
|
515
515
|
* TODO: Support per-spring control
|
|
516
516
|
*/
|
|
517
517
|
setVelocity(t) {
|
|
518
|
-
const
|
|
519
|
-
|
|
518
|
+
const i = this.getFirstAnimator();
|
|
519
|
+
i == null || i.setVelocity(t);
|
|
520
520
|
}
|
|
521
521
|
/**
|
|
522
522
|
* Check if any animation is currently running
|
|
@@ -531,27 +531,27 @@ class M extends j {
|
|
|
531
531
|
* Create MultiAnimator from existing state
|
|
532
532
|
* Uses first animator's state for initialization
|
|
533
533
|
*/
|
|
534
|
-
static fromState(t,
|
|
535
|
-
return new
|
|
534
|
+
static fromState(t, i) {
|
|
535
|
+
return new L({ ...i, state: t });
|
|
536
536
|
}
|
|
537
537
|
}
|
|
538
|
-
const
|
|
539
|
-
runIn: async (
|
|
540
|
-
const { currentAnimation: t } =
|
|
538
|
+
const B = Symbol.for("TRANSITION_STRATEGY"), ft = (e) => ({
|
|
539
|
+
runIn: async (n) => {
|
|
540
|
+
const { currentAnimation: t } = e;
|
|
541
541
|
if (t && t.direction === "out") {
|
|
542
|
-
const
|
|
543
|
-
if (t.controller.stop(),
|
|
542
|
+
const r = t.controller.getCurrentValue(), o = t.controller.getVelocity();
|
|
543
|
+
if (t.controller.stop(), n.out)
|
|
544
544
|
return {
|
|
545
|
-
config: await
|
|
546
|
-
state: { position:
|
|
545
|
+
config: await n.out,
|
|
546
|
+
state: { position: r, velocity: o },
|
|
547
547
|
from: 1,
|
|
548
548
|
to: 0,
|
|
549
549
|
direction: "backward"
|
|
550
550
|
// Will actually go 0→1 (backward means toward 'from')
|
|
551
551
|
};
|
|
552
552
|
}
|
|
553
|
-
return
|
|
554
|
-
config: await
|
|
553
|
+
return n.in ? {
|
|
554
|
+
config: await n.in,
|
|
555
555
|
state: {
|
|
556
556
|
position: 0,
|
|
557
557
|
velocity: 0
|
|
@@ -569,22 +569,22 @@ const W = Symbol.for("TRANSITION_STRATEGY"), ct = (n) => ({
|
|
|
569
569
|
direction: "forward"
|
|
570
570
|
};
|
|
571
571
|
},
|
|
572
|
-
runOut: async (
|
|
573
|
-
const { currentAnimation: t } =
|
|
572
|
+
runOut: async (n) => {
|
|
573
|
+
const { currentAnimation: t } = e;
|
|
574
574
|
if (t && t.direction === "in") {
|
|
575
|
-
const
|
|
576
|
-
if (t.controller.stop(),
|
|
575
|
+
const r = t.controller.getCurrentValue(), o = t.controller.getVelocity();
|
|
576
|
+
if (t.controller.stop(), n.in)
|
|
577
577
|
return {
|
|
578
|
-
config: await
|
|
579
|
-
state: { position:
|
|
578
|
+
config: await n.in,
|
|
579
|
+
state: { position: r, velocity: o },
|
|
580
580
|
from: 0,
|
|
581
581
|
to: 1,
|
|
582
582
|
direction: "backward"
|
|
583
583
|
// Will actually go 1→0 (backward means toward 'from')
|
|
584
584
|
};
|
|
585
585
|
}
|
|
586
|
-
return
|
|
587
|
-
config: await
|
|
586
|
+
return n.out ? {
|
|
587
|
+
config: await n.out,
|
|
588
588
|
state: {
|
|
589
589
|
position: 1,
|
|
590
590
|
velocity: 0
|
|
@@ -602,9 +602,9 @@ const W = Symbol.for("TRANSITION_STRATEGY"), ct = (n) => ({
|
|
|
602
602
|
direction: "forward"
|
|
603
603
|
};
|
|
604
604
|
}
|
|
605
|
-
}),
|
|
606
|
-
runIn: async (
|
|
607
|
-
config: await
|
|
605
|
+
}), mt = () => ({
|
|
606
|
+
runIn: async (e) => e.in ? {
|
|
607
|
+
config: await e.in,
|
|
608
608
|
state: {
|
|
609
609
|
position: 0,
|
|
610
610
|
velocity: 0
|
|
@@ -621,8 +621,8 @@ const W = Symbol.for("TRANSITION_STRATEGY"), ct = (n) => ({
|
|
|
621
621
|
to: 1,
|
|
622
622
|
direction: "forward"
|
|
623
623
|
},
|
|
624
|
-
runOut: async (
|
|
625
|
-
config: await
|
|
624
|
+
runOut: async (e) => e.out ? {
|
|
625
|
+
config: await e.out,
|
|
626
626
|
state: {
|
|
627
627
|
position: 1,
|
|
628
628
|
velocity: 0
|
|
@@ -639,178 +639,178 @@ const W = Symbol.for("TRANSITION_STRATEGY"), ct = (n) => ({
|
|
|
639
639
|
to: 0,
|
|
640
640
|
direction: "forward"
|
|
641
641
|
}
|
|
642
|
-
}),
|
|
643
|
-
function
|
|
644
|
-
return (
|
|
645
|
-
if (
|
|
646
|
-
return
|
|
642
|
+
}), J = "data-ssgoi-scope", Q = "data-ssgoi-scope-ready";
|
|
643
|
+
function It() {
|
|
644
|
+
return (e) => {
|
|
645
|
+
if (e)
|
|
646
|
+
return e.setAttribute(J, ""), queueMicrotask(() => {
|
|
647
647
|
queueMicrotask(() => {
|
|
648
|
-
|
|
648
|
+
e.setAttribute(Q, "true");
|
|
649
649
|
});
|
|
650
650
|
}), () => {
|
|
651
651
|
};
|
|
652
652
|
};
|
|
653
653
|
}
|
|
654
|
-
function
|
|
655
|
-
return
|
|
654
|
+
function dt(e) {
|
|
655
|
+
return e.hasAttribute(Q);
|
|
656
656
|
}
|
|
657
|
-
function
|
|
658
|
-
return
|
|
657
|
+
function ht(e) {
|
|
658
|
+
return e.closest(`[${J}]`);
|
|
659
659
|
}
|
|
660
|
-
const
|
|
661
|
-
let
|
|
662
|
-
for (;
|
|
663
|
-
const t = window.getComputedStyle(
|
|
664
|
-
if (
|
|
665
|
-
return
|
|
666
|
-
|
|
660
|
+
const gt = (e) => {
|
|
661
|
+
let n = e.parentElement;
|
|
662
|
+
for (; n && n !== document.body; ) {
|
|
663
|
+
const t = window.getComputedStyle(n), i = t.overflow + t.overflowY + t.overflowX;
|
|
664
|
+
if (i.includes("auto") || i.includes("scroll") || n.scrollHeight > n.clientHeight || n.scrollWidth > n.clientWidth)
|
|
665
|
+
return n;
|
|
666
|
+
n = n.parentElement;
|
|
667
667
|
}
|
|
668
668
|
return document.documentElement;
|
|
669
|
-
},
|
|
670
|
-
let
|
|
671
|
-
for (;
|
|
672
|
-
const t = window.getComputedStyle(
|
|
669
|
+
}, pt = (e) => {
|
|
670
|
+
let n = e.parentElement;
|
|
671
|
+
for (; n && n !== document.body; ) {
|
|
672
|
+
const t = window.getComputedStyle(n).position;
|
|
673
673
|
if (t === "relative" || t === "absolute" || t === "fixed" || t === "sticky")
|
|
674
|
-
return
|
|
675
|
-
|
|
674
|
+
return n;
|
|
675
|
+
n = n.parentElement;
|
|
676
676
|
}
|
|
677
677
|
return document.body;
|
|
678
678
|
};
|
|
679
|
-
function
|
|
680
|
-
return new Promise((
|
|
679
|
+
function W(e) {
|
|
680
|
+
return new Promise((n) => {
|
|
681
681
|
requestAnimationFrame(() => {
|
|
682
682
|
requestAnimationFrame(() => {
|
|
683
|
-
|
|
683
|
+
n();
|
|
684
684
|
});
|
|
685
685
|
});
|
|
686
686
|
});
|
|
687
687
|
}
|
|
688
|
-
function
|
|
689
|
-
var
|
|
690
|
-
let t = null,
|
|
688
|
+
function wt(e, n) {
|
|
689
|
+
var v;
|
|
690
|
+
let t = null, i = null, r = null, o = null;
|
|
691
691
|
const c = {
|
|
692
692
|
get currentAnimation() {
|
|
693
693
|
return t;
|
|
694
694
|
}
|
|
695
|
-
},
|
|
696
|
-
var
|
|
697
|
-
|
|
698
|
-
const l =
|
|
699
|
-
if (!
|
|
695
|
+
}, a = ((v = n == null ? void 0 : n.strategy) == null ? void 0 : v.call(n, c)) || ft(c), s = async (d) => {
|
|
696
|
+
var b;
|
|
697
|
+
i && (i.remove(), i = null);
|
|
698
|
+
const l = e(), C = l.in && l.in(d), y = !(n != null && n.strategy) && l.out ? l.out(d) : void 0;
|
|
699
|
+
if (!C)
|
|
700
700
|
return;
|
|
701
|
-
const
|
|
702
|
-
in:
|
|
703
|
-
out:
|
|
704
|
-
},
|
|
705
|
-
if (!
|
|
701
|
+
const P = {
|
|
702
|
+
in: F(C),
|
|
703
|
+
out: y ? F(y) : void 0
|
|
704
|
+
}, g = await a.runIn(P);
|
|
705
|
+
if (!g.config) {
|
|
706
706
|
t && (t.direction = "in");
|
|
707
707
|
return;
|
|
708
708
|
}
|
|
709
|
-
const
|
|
710
|
-
(
|
|
711
|
-
const
|
|
709
|
+
const f = g.config;
|
|
710
|
+
(b = f.prepare) == null || b.call(f);
|
|
711
|
+
const S = X(
|
|
712
712
|
{
|
|
713
|
-
...
|
|
713
|
+
...f,
|
|
714
714
|
onEnd: () => {
|
|
715
|
-
var
|
|
716
|
-
t = null, (
|
|
715
|
+
var k;
|
|
716
|
+
t = null, (k = f.onEnd) == null || k.call(f);
|
|
717
717
|
}
|
|
718
718
|
},
|
|
719
|
-
|
|
719
|
+
d
|
|
720
720
|
);
|
|
721
|
-
|
|
722
|
-
const
|
|
723
|
-
config:
|
|
724
|
-
from:
|
|
725
|
-
to:
|
|
721
|
+
f.wait && await f.wait();
|
|
722
|
+
const A = L.fromState(g.state, {
|
|
723
|
+
config: S,
|
|
724
|
+
from: g.from,
|
|
725
|
+
to: g.to
|
|
726
726
|
});
|
|
727
|
-
t = { controller:
|
|
728
|
-
}, u = async (
|
|
729
|
-
var
|
|
730
|
-
|
|
731
|
-
const l =
|
|
732
|
-
if (!
|
|
727
|
+
t = { controller: A, direction: "in" }, await W(), g.direction === "forward" ? A.forward() : A.backward();
|
|
728
|
+
}, u = async (d) => {
|
|
729
|
+
var k;
|
|
730
|
+
i = d;
|
|
731
|
+
const l = e(), C = !(n != null && n.strategy) && l.in ? l.in(d) : void 0, y = l.out && l.out(d);
|
|
732
|
+
if (!y)
|
|
733
733
|
return;
|
|
734
|
-
const
|
|
735
|
-
in:
|
|
736
|
-
out:
|
|
737
|
-
},
|
|
738
|
-
if (!
|
|
739
|
-
t && (t.direction = "out"),
|
|
734
|
+
const P = {
|
|
735
|
+
in: C ? F(C) : void 0,
|
|
736
|
+
out: F(y)
|
|
737
|
+
}, g = await a.runOut(P);
|
|
738
|
+
if (!g.config) {
|
|
739
|
+
t && (t.direction = "out"), i && (i.remove(), i = null);
|
|
740
740
|
return;
|
|
741
741
|
}
|
|
742
|
-
const
|
|
743
|
-
|
|
744
|
-
const
|
|
742
|
+
const f = g.config;
|
|
743
|
+
b(), (k = f.prepare) == null || k.call(f);
|
|
744
|
+
const S = X(
|
|
745
745
|
{
|
|
746
|
-
...
|
|
746
|
+
...f,
|
|
747
747
|
onEnd: () => {
|
|
748
|
-
var V,
|
|
749
|
-
(V =
|
|
748
|
+
var V, R;
|
|
749
|
+
(V = f.onEnd) == null || V.call(f), i && (i.remove(), i = null), t = null, (R = n == null ? void 0 : n.onCleanupEnd) == null || R.call(n);
|
|
750
750
|
}
|
|
751
751
|
},
|
|
752
|
-
|
|
752
|
+
d
|
|
753
753
|
);
|
|
754
|
-
|
|
755
|
-
const
|
|
756
|
-
config:
|
|
757
|
-
from:
|
|
758
|
-
to:
|
|
754
|
+
f.wait && await f.wait();
|
|
755
|
+
const A = L.fromState(g.state, {
|
|
756
|
+
config: S,
|
|
757
|
+
from: g.from,
|
|
758
|
+
to: g.to
|
|
759
759
|
});
|
|
760
|
-
t = { controller:
|
|
761
|
-
function
|
|
762
|
-
!
|
|
760
|
+
t = { controller: A, direction: "out" }, await W(), g.direction === "forward" ? A.forward() : A.backward();
|
|
761
|
+
function b() {
|
|
762
|
+
!r || !i || (o && r.contains(o) ? r.insertBefore(i, o) : r.appendChild(i));
|
|
763
763
|
}
|
|
764
764
|
};
|
|
765
|
-
let
|
|
766
|
-
const
|
|
767
|
-
if (
|
|
768
|
-
|
|
769
|
-
const l =
|
|
770
|
-
|
|
771
|
-
document.contains(
|
|
765
|
+
let h = null, p = !1;
|
|
766
|
+
const w = (d) => () => {
|
|
767
|
+
if (p) return;
|
|
768
|
+
p = !0;
|
|
769
|
+
const l = d.cloneNode(!0);
|
|
770
|
+
h ? queueMicrotask(() => {
|
|
771
|
+
document.contains(h) && u(l);
|
|
772
772
|
}) : u(l);
|
|
773
773
|
};
|
|
774
|
-
return (
|
|
775
|
-
if (
|
|
774
|
+
return (d) => {
|
|
775
|
+
if (d)
|
|
776
776
|
return requestAnimationFrame(() => {
|
|
777
|
-
|
|
778
|
-
}),
|
|
779
|
-
|
|
780
|
-
}) :
|
|
777
|
+
r = d.parentElement, o = d.nextElementSibling;
|
|
778
|
+
}), p = !1, (n == null ? void 0 : n.scope) === "local" ? queueMicrotask(() => {
|
|
779
|
+
h = ht(d), !(h && !dt(h)) && s(d);
|
|
780
|
+
}) : s(d), w(d);
|
|
781
781
|
};
|
|
782
782
|
}
|
|
783
|
-
const
|
|
784
|
-
let
|
|
785
|
-
function
|
|
786
|
-
if (
|
|
787
|
-
const t =
|
|
788
|
-
|
|
783
|
+
const T = /* @__PURE__ */ new Map();
|
|
784
|
+
let E = null, N = !1;
|
|
785
|
+
function Z(e) {
|
|
786
|
+
if (e instanceof HTMLElement && T.has(e)) {
|
|
787
|
+
const t = T.get(e);
|
|
788
|
+
T.delete(e), queueMicrotask(() => {
|
|
789
789
|
t();
|
|
790
790
|
});
|
|
791
791
|
}
|
|
792
|
-
const
|
|
793
|
-
for (let t = 0; t <
|
|
794
|
-
const
|
|
795
|
-
|
|
792
|
+
const n = e.childNodes;
|
|
793
|
+
for (let t = 0; t < n.length; t++) {
|
|
794
|
+
const i = n[t];
|
|
795
|
+
i && Z(i);
|
|
796
796
|
}
|
|
797
797
|
}
|
|
798
|
-
function
|
|
799
|
-
|
|
800
|
-
for (const
|
|
801
|
-
const t =
|
|
802
|
-
for (let
|
|
803
|
-
const
|
|
804
|
-
|
|
798
|
+
function yt() {
|
|
799
|
+
N || typeof document > "u" || (N = !0, E = new MutationObserver((e) => {
|
|
800
|
+
for (const n of e) {
|
|
801
|
+
const t = n.removedNodes;
|
|
802
|
+
for (let i = 0; i < t.length; i++) {
|
|
803
|
+
const r = t[i];
|
|
804
|
+
r && Z(r);
|
|
805
805
|
}
|
|
806
806
|
}
|
|
807
|
-
}), document.body ?
|
|
807
|
+
}), document.body ? E.observe(document.body, {
|
|
808
808
|
childList: !0,
|
|
809
809
|
subtree: !0
|
|
810
810
|
}) : document.addEventListener(
|
|
811
811
|
"DOMContentLoaded",
|
|
812
812
|
() => {
|
|
813
|
-
|
|
813
|
+
E == null || E.observe(document.body, {
|
|
814
814
|
childList: !0,
|
|
815
815
|
subtree: !0
|
|
816
816
|
});
|
|
@@ -818,249 +818,298 @@ function gt() {
|
|
|
818
818
|
{ once: !0 }
|
|
819
819
|
));
|
|
820
820
|
}
|
|
821
|
-
function
|
|
822
|
-
|
|
821
|
+
function vt(e, n) {
|
|
822
|
+
yt(), T.set(e, n);
|
|
823
823
|
}
|
|
824
|
-
function
|
|
825
|
-
return
|
|
824
|
+
function Ft(e) {
|
|
825
|
+
return T.has(e);
|
|
826
826
|
}
|
|
827
|
-
function
|
|
828
|
-
return
|
|
827
|
+
function Mt() {
|
|
828
|
+
return T.size;
|
|
829
829
|
}
|
|
830
|
-
function
|
|
831
|
-
const
|
|
832
|
-
return
|
|
830
|
+
function xt(e) {
|
|
831
|
+
const n = T.get(e);
|
|
832
|
+
return n ? (T.delete(e), n(), !0) : !1;
|
|
833
833
|
}
|
|
834
|
-
function
|
|
835
|
-
|
|
834
|
+
function Ot() {
|
|
835
|
+
T.clear(), E == null || E.disconnect(), E = null, N = !1;
|
|
836
836
|
}
|
|
837
|
-
const O = /* @__PURE__ */ new Map(),
|
|
838
|
-
function
|
|
839
|
-
O.set(
|
|
840
|
-
let
|
|
841
|
-
if (
|
|
842
|
-
return
|
|
843
|
-
const
|
|
844
|
-
return
|
|
837
|
+
const O = /* @__PURE__ */ new Map(), U = /* @__PURE__ */ new Map(), H = /* @__PURE__ */ new Map();
|
|
838
|
+
function St(e, n, t) {
|
|
839
|
+
O.set(e, n);
|
|
840
|
+
let i = U.get(e);
|
|
841
|
+
if (i)
|
|
842
|
+
return i;
|
|
843
|
+
const r = n;
|
|
844
|
+
return i = wt(
|
|
845
845
|
() => {
|
|
846
|
-
const
|
|
847
|
-
return
|
|
846
|
+
const o = O.get(e);
|
|
847
|
+
return o || (console.warn(`Transition "${String(e)}" not found`), {});
|
|
848
848
|
},
|
|
849
849
|
{
|
|
850
850
|
strategy: t == null ? void 0 : t.strategy,
|
|
851
851
|
scope: t == null ? void 0 : t.scope,
|
|
852
852
|
onCleanupEnd: () => {
|
|
853
|
-
O.get(
|
|
853
|
+
O.get(e) === r && Ct(e);
|
|
854
854
|
}
|
|
855
855
|
}
|
|
856
|
-
),
|
|
856
|
+
), U.set(e, i), i;
|
|
857
857
|
}
|
|
858
|
-
function
|
|
859
|
-
O.delete(
|
|
858
|
+
function Ct(e) {
|
|
859
|
+
O.delete(e), U.delete(e), H.delete(e);
|
|
860
860
|
}
|
|
861
|
-
function
|
|
862
|
-
const t =
|
|
863
|
-
|
|
861
|
+
function Lt(e, n = "manual") {
|
|
862
|
+
const t = St(
|
|
863
|
+
e.key,
|
|
864
864
|
{
|
|
865
|
-
in:
|
|
866
|
-
out:
|
|
865
|
+
in: e.in,
|
|
866
|
+
out: e.out
|
|
867
867
|
},
|
|
868
868
|
{
|
|
869
|
-
strategy:
|
|
870
|
-
scope:
|
|
869
|
+
strategy: e[B],
|
|
870
|
+
scope: e.scope
|
|
871
871
|
}
|
|
872
872
|
);
|
|
873
|
-
if (
|
|
873
|
+
if (n === "manual")
|
|
874
874
|
return t;
|
|
875
|
-
let
|
|
876
|
-
return
|
|
877
|
-
if (
|
|
878
|
-
const
|
|
879
|
-
|
|
875
|
+
let i = H.get(e.key);
|
|
876
|
+
return i || (i = (r) => {
|
|
877
|
+
if (r) {
|
|
878
|
+
const o = t(r);
|
|
879
|
+
o && vt(r, o);
|
|
880
880
|
}
|
|
881
|
-
},
|
|
881
|
+
}, H.set(e.key, i), i);
|
|
882
882
|
}
|
|
883
|
-
function
|
|
884
|
-
const
|
|
883
|
+
function At(e) {
|
|
884
|
+
const n = e.filter((t) => t.symmetric).map((t) => ({
|
|
885
885
|
from: t.to,
|
|
886
886
|
to: t.from,
|
|
887
887
|
transition: t.transition
|
|
888
888
|
}));
|
|
889
|
-
return [...
|
|
889
|
+
return [...e, ...n];
|
|
890
890
|
}
|
|
891
|
-
function
|
|
892
|
-
let
|
|
893
|
-
const
|
|
894
|
-
if (!
|
|
895
|
-
const l =
|
|
896
|
-
l && (
|
|
897
|
-
},
|
|
898
|
-
if (!
|
|
899
|
-
const l =
|
|
891
|
+
function Et(e) {
|
|
892
|
+
let n = !1, t = 0, i = 0, r = !1;
|
|
893
|
+
const o = 50, c = (d) => {
|
|
894
|
+
if (!e) return;
|
|
895
|
+
const l = d.touches[0];
|
|
896
|
+
l && (r = l.clientX < o, r && (t = l.clientX, i = l.clientY));
|
|
897
|
+
}, a = (d) => {
|
|
898
|
+
if (!e || !r) return;
|
|
899
|
+
const l = d.touches[0];
|
|
900
900
|
if (!l) return;
|
|
901
|
-
const
|
|
902
|
-
|
|
903
|
-
},
|
|
904
|
-
|
|
905
|
-
}, u = () =>
|
|
906
|
-
typeof window > "u" ||
|
|
907
|
-
},
|
|
908
|
-
typeof window > "u" || (window.removeEventListener("touchstart", c), window.removeEventListener("touchmove",
|
|
901
|
+
const C = l.clientX - t, y = l.clientY - i;
|
|
902
|
+
C > window.outerWidth / 2 - 5 && Math.abs(C) > Math.abs(y) ? n = !0 : n = !1;
|
|
903
|
+
}, s = () => {
|
|
904
|
+
e && (r = !1, t = 0, i = 0);
|
|
905
|
+
}, u = () => n, h = () => {
|
|
906
|
+
typeof window > "u" || e && (window.addEventListener("touchstart", c, { passive: !0 }), window.addEventListener("touchmove", a, { passive: !0 }), window.addEventListener("touchend", s, { passive: !0 }));
|
|
907
|
+
}, p = () => {
|
|
908
|
+
typeof window > "u" || (window.removeEventListener("touchstart", c), window.removeEventListener("touchmove", a), window.removeEventListener("touchend", s));
|
|
909
909
|
};
|
|
910
|
-
let
|
|
910
|
+
let w = 0;
|
|
911
911
|
return {
|
|
912
|
-
initialize:
|
|
913
|
-
cleanup:
|
|
912
|
+
initialize: h,
|
|
913
|
+
cleanup: p,
|
|
914
914
|
isSwipePending: u,
|
|
915
915
|
resetSwipeDetection: () => {
|
|
916
|
-
|
|
916
|
+
w++, w > 1 && (w = 0, n = !1);
|
|
917
917
|
}
|
|
918
918
|
};
|
|
919
919
|
}
|
|
920
|
-
function
|
|
921
|
-
let
|
|
920
|
+
function Tt() {
|
|
921
|
+
let e = null, n = null;
|
|
922
922
|
const t = /* @__PURE__ */ new Map();
|
|
923
|
-
let
|
|
924
|
-
const
|
|
925
|
-
|
|
926
|
-
x:
|
|
927
|
-
y:
|
|
923
|
+
let i = null;
|
|
924
|
+
const r = () => {
|
|
925
|
+
e && i && t.set(i, {
|
|
926
|
+
x: e.scrollLeft,
|
|
927
|
+
y: e.scrollTop
|
|
928
928
|
});
|
|
929
929
|
};
|
|
930
930
|
return {
|
|
931
|
-
initializeContext: (
|
|
932
|
-
|
|
931
|
+
initializeContext: (h, p) => {
|
|
932
|
+
n = h, e || (e = gt(h), (e === document.documentElement ? window : e).addEventListener("scroll", r, {
|
|
933
933
|
passive: !0
|
|
934
|
-
})),
|
|
934
|
+
})), i = p;
|
|
935
935
|
},
|
|
936
|
-
calculateScrollOffset: (
|
|
937
|
-
const
|
|
936
|
+
calculateScrollOffset: (h, p) => {
|
|
937
|
+
const w = h && t.has(h) ? t.get(h) : { x: 0, y: 0 }, v = p && t.has(p) ? t.get(p) : { x: 0, y: 0 };
|
|
938
938
|
return {
|
|
939
|
-
x: -
|
|
940
|
-
y: -
|
|
939
|
+
x: -v.x + w.x,
|
|
940
|
+
y: -v.y + w.y
|
|
941
941
|
};
|
|
942
942
|
},
|
|
943
|
-
getScrollContainer: () =>
|
|
944
|
-
getPositionedParentElement: () =>
|
|
945
|
-
getScrollPosition: (
|
|
943
|
+
getScrollContainer: () => e,
|
|
944
|
+
getPositionedParentElement: () => n ? pt(n) : document.body,
|
|
945
|
+
getScrollPosition: (h) => h && t.has(h) ? t.get(h) : { x: 0, y: 0 }
|
|
946
946
|
};
|
|
947
947
|
}
|
|
948
|
-
function x(
|
|
949
|
-
if (
|
|
948
|
+
function x(e, n) {
|
|
949
|
+
if (n === "*")
|
|
950
950
|
return !0;
|
|
951
|
-
if (
|
|
952
|
-
const t =
|
|
953
|
-
return
|
|
951
|
+
if (n.endsWith("/*")) {
|
|
952
|
+
const t = n.slice(0, -2);
|
|
953
|
+
return e === t || e.startsWith(t + "/");
|
|
954
954
|
}
|
|
955
|
-
return
|
|
955
|
+
return e === n;
|
|
956
956
|
}
|
|
957
|
-
function
|
|
958
|
-
for (const
|
|
959
|
-
if (x(
|
|
960
|
-
return
|
|
961
|
-
for (const
|
|
962
|
-
if ((
|
|
963
|
-
return
|
|
957
|
+
function G(e, n, t) {
|
|
958
|
+
for (const i of t)
|
|
959
|
+
if (x(e, i.from) && x(n, i.to))
|
|
960
|
+
return i.transition;
|
|
961
|
+
for (const i of t)
|
|
962
|
+
if ((i.from === "*" || x(e, i.from)) && (i.to === "*" || x(n, i.to)))
|
|
963
|
+
return i.transition;
|
|
964
964
|
return null;
|
|
965
965
|
}
|
|
966
|
-
function
|
|
966
|
+
function bt() {
|
|
967
|
+
let e = null;
|
|
968
|
+
function n() {
|
|
969
|
+
if (e != null && e.from && (e != null && e.to) && (e != null && e.outResolve) && (e != null && e.inResolve)) {
|
|
970
|
+
const t = { from: e.from, to: e.to };
|
|
971
|
+
e.outResolve(t), e.inResolve(t), e = null;
|
|
972
|
+
}
|
|
973
|
+
}
|
|
974
|
+
return {
|
|
975
|
+
trigger(t, i) {
|
|
976
|
+
e || (e = {}), i === "out" ? e.from = t : e.to = t;
|
|
977
|
+
},
|
|
978
|
+
get(t) {
|
|
979
|
+
return t === "in" && (!e || !e.from) ? Promise.resolve(null) : new Promise((i) => {
|
|
980
|
+
e || (e = {}), t === "out" ? e.outResolve = i : e.inResolve = i, n();
|
|
981
|
+
});
|
|
982
|
+
}
|
|
983
|
+
};
|
|
984
|
+
}
|
|
985
|
+
function kt() {
|
|
986
|
+
let e = null;
|
|
987
|
+
function n() {
|
|
988
|
+
var i, r;
|
|
989
|
+
e && ((i = e.outResolve) == null || i.call(e, null), (r = e.inResolve) == null || r.call(e, null), e = null);
|
|
990
|
+
}
|
|
991
|
+
function t() {
|
|
992
|
+
if (e != null && e.from && (e != null && e.to) && (e != null && e.outResolve) && (e != null && e.inResolve)) {
|
|
993
|
+
const i = { from: e.from, to: e.to };
|
|
994
|
+
e.outResolve(i), e.inResolve(i), e = null;
|
|
995
|
+
}
|
|
996
|
+
}
|
|
997
|
+
return {
|
|
998
|
+
trigger(i, r) {
|
|
999
|
+
e && (r === "out" && e.from && e.from !== i || r === "in" && e.to && e.to !== i) && n(), e || (e = {}), r === "out" ? e.from = i : e.to = i;
|
|
1000
|
+
},
|
|
1001
|
+
get(i) {
|
|
1002
|
+
return new Promise((r) => {
|
|
1003
|
+
e || (e = {}), i === "out" ? e.outResolve = r : e.inResolve = r, t();
|
|
1004
|
+
});
|
|
1005
|
+
}
|
|
1006
|
+
};
|
|
1007
|
+
}
|
|
1008
|
+
function Dt(e, n) {
|
|
967
1009
|
const {
|
|
968
1010
|
transitions: t = [],
|
|
969
|
-
defaultTransition:
|
|
970
|
-
middleware:
|
|
1011
|
+
defaultTransition: i,
|
|
1012
|
+
middleware: r = (g, f) => ({ from: g, to: f }),
|
|
971
1013
|
// Identity function as default
|
|
972
|
-
skipOnIosSwipe:
|
|
1014
|
+
skipOnIosSwipe: o = !0
|
|
973
1015
|
// Default to true - skip animations on iOS swipe
|
|
974
|
-
} =
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
1016
|
+
} = e, { outFirst: c = !0, createNavigationDetector: a } = n || {}, s = (a == null ? void 0 : a()) ?? (c ? bt() : kt()), u = At(t), {
|
|
1017
|
+
initializeContext: h,
|
|
1018
|
+
calculateScrollOffset: p,
|
|
1019
|
+
getScrollContainer: w,
|
|
1020
|
+
getPositionedParentElement: v,
|
|
1021
|
+
getScrollPosition: d
|
|
1022
|
+
} = Tt(), l = Et(o);
|
|
1023
|
+
l.initialize();
|
|
1024
|
+
const C = async (g, f) => {
|
|
1025
|
+
if (l.isSwipePending())
|
|
1026
|
+
return l.resetSwipeDetection(), () => ({});
|
|
1027
|
+
s.trigger(g, f);
|
|
1028
|
+
const S = await s.get(f);
|
|
1029
|
+
if (!S) return () => ({});
|
|
1030
|
+
const { from: A, to: b } = r(
|
|
1031
|
+
S.from,
|
|
1032
|
+
S.to
|
|
1033
|
+
), V = G(
|
|
1034
|
+
A,
|
|
1035
|
+
b,
|
|
1036
|
+
u
|
|
1037
|
+
) || i;
|
|
1038
|
+
if (!V) return () => ({});
|
|
1039
|
+
const R = p(S.from, S.to);
|
|
1040
|
+
if (f === "out") {
|
|
1041
|
+
const D = {
|
|
1042
|
+
scrollOffset: R,
|
|
1043
|
+
scroll: d(S.from),
|
|
999
1044
|
get scrollingElement() {
|
|
1000
|
-
return
|
|
1045
|
+
return w() || document.documentElement;
|
|
1001
1046
|
},
|
|
1002
1047
|
get positionedParent() {
|
|
1003
|
-
return
|
|
1048
|
+
return v();
|
|
1004
1049
|
}
|
|
1005
|
-
}
|
|
1006
|
-
|
|
1050
|
+
};
|
|
1051
|
+
return (I) => V.out(I, D);
|
|
1052
|
+
} else {
|
|
1053
|
+
const D = {
|
|
1054
|
+
scrollOffset: R,
|
|
1007
1055
|
get scroll() {
|
|
1008
|
-
return
|
|
1056
|
+
return d(S.to);
|
|
1009
1057
|
},
|
|
1010
1058
|
get scrollingElement() {
|
|
1011
|
-
return
|
|
1059
|
+
return w() || document.documentElement;
|
|
1012
1060
|
},
|
|
1013
1061
|
get positionedParent() {
|
|
1014
|
-
return
|
|
1062
|
+
return v();
|
|
1015
1063
|
}
|
|
1016
1064
|
};
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1065
|
+
return async (I) => {
|
|
1066
|
+
const z = await Promise.resolve(V.in(I, D)), q = z.onStart;
|
|
1067
|
+
return z.onStart = () => {
|
|
1068
|
+
I.style.visibility = "visible", q == null || q();
|
|
1069
|
+
}, z;
|
|
1070
|
+
};
|
|
1022
1071
|
}
|
|
1023
|
-
}
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
const v = c ? async (w, h) => f.isSwipePending() ? (f.resetSwipeDetection(), () => ({})) : h === "in" && (!r || !r.from) ? () => ({}) : (r || (r = {}), h === "out" ? (r.from = w, new Promise((T) => {
|
|
1028
|
-
r.outResolve = T, l();
|
|
1029
|
-
})) : (r.to = w, new Promise((T) => {
|
|
1030
|
-
r.inResolve = T, l();
|
|
1031
|
-
}))) : async (w, h) => f.isSwipePending() ? (f.resetSwipeDetection(), () => ({})) : (r && (h === "out" && r.from && r.from !== w || h === "in" && r.to && r.to !== w) && E(), r || (r = {}), h === "out" ? (r.from = w, new Promise((C) => {
|
|
1032
|
-
r.outResolve = C, l();
|
|
1033
|
-
})) : (r.to = w, new Promise((C) => {
|
|
1034
|
-
r.inResolve = C, l();
|
|
1035
|
-
})));
|
|
1036
|
-
return (w) => ({
|
|
1037
|
-
key: w,
|
|
1038
|
-
in: async (h) => (u(h, w), (await v(w, "in"))(h)),
|
|
1039
|
-
out: async (h) => (await v(w, "out"))(h),
|
|
1072
|
+
}, y = (g) => ({
|
|
1073
|
+
key: g,
|
|
1074
|
+
in: async (f) => (h(f, g), (await C(g, "in"))(f)),
|
|
1075
|
+
out: async (f) => (await C(g, "out"))(f),
|
|
1040
1076
|
// Add page transition strategy for page-level transitions
|
|
1041
|
-
[
|
|
1042
|
-
})
|
|
1077
|
+
[B]: mt
|
|
1078
|
+
}), P = (g, f) => {
|
|
1079
|
+
const { from: S, to: A } = r(g, f);
|
|
1080
|
+
return !!(G(
|
|
1081
|
+
S,
|
|
1082
|
+
A,
|
|
1083
|
+
u
|
|
1084
|
+
) || i);
|
|
1085
|
+
};
|
|
1086
|
+
return a ? {
|
|
1087
|
+
getTransition: y,
|
|
1088
|
+
hasMatchingTransition: P
|
|
1089
|
+
} : y;
|
|
1043
1090
|
}
|
|
1044
1091
|
export {
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
It as
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1092
|
+
J as SCOPE_ATTR,
|
|
1093
|
+
Q as SCOPE_READY_ATTR,
|
|
1094
|
+
B as TRANSITION_STRATEGY,
|
|
1095
|
+
kt as createAnyOrderDetector,
|
|
1096
|
+
ft as createDefaultStrategy,
|
|
1097
|
+
bt as createOutFirstDetector,
|
|
1098
|
+
mt as createPageTransitionStrategy,
|
|
1099
|
+
Dt as createSggoiTransitionContext,
|
|
1100
|
+
It as createTransitionScope,
|
|
1101
|
+
ht as findScope,
|
|
1102
|
+
Mt as getWatchedCount,
|
|
1103
|
+
_t as isCssAnimation,
|
|
1104
|
+
Nt as isMultiAnimation,
|
|
1105
|
+
dt as isScopeReady,
|
|
1106
|
+
Ut as isSingleAnimation,
|
|
1107
|
+
Ht as isTickAnimation,
|
|
1108
|
+
Ft as isWatched,
|
|
1109
|
+
X as normalizeSchedule,
|
|
1110
|
+
F as normalizeToMultiAnimation,
|
|
1111
|
+
Ot as resetObserver,
|
|
1112
|
+
Lt as transition,
|
|
1113
|
+
xt as triggerUnmount,
|
|
1114
|
+
vt as watchUnmount
|
|
1066
1115
|
};
|