@ssgoi/core 2.4.0 → 2.5.1
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/animate.d.ts +35 -0
- package/dist/animate.d.ts.map +1 -0
- package/dist/animation-scheduler.d.ts +47 -0
- package/dist/animation-scheduler.d.ts.map +1 -0
- package/dist/animator.d.ts +3 -8
- package/dist/animator.d.ts.map +1 -1
- package/dist/create-ssgoi-transition-context.d.ts.map +1 -1
- package/dist/create-transition-callback.d.ts.map +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +787 -306
- package/dist/jaemin-BAi8PTrj.js +130 -0
- package/dist/jaemin-DL1-g_B5.cjs +1 -0
- package/dist/test-utils.d.ts +46 -0
- package/dist/test-utils.d.ts.map +1 -0
- package/dist/ticker.d.ts +37 -0
- package/dist/ticker.d.ts.map +1 -0
- package/dist/transition-strategy.d.ts +2 -3
- package/dist/transition-strategy.d.ts.map +1 -1
- package/dist/types.cjs +1 -1
- package/dist/types.d.ts +164 -4
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +10 -1
- package/dist/view-transitions/blind.d.ts.map +1 -1
- package/dist/view-transitions/curtain-reveal.d.ts +19 -0
- package/dist/view-transitions/curtain-reveal.d.ts.map +1 -0
- package/dist/view-transitions/fade.d.ts.map +1 -1
- package/dist/view-transitions/film.d.ts.map +1 -1
- package/dist/view-transitions/hero.d.ts +1 -0
- package/dist/view-transitions/hero.d.ts.map +1 -1
- package/dist/view-transitions/index.cjs +19 -19
- package/dist/view-transitions/index.d.ts +3 -1
- package/dist/view-transitions/index.d.ts.map +1 -1
- package/dist/view-transitions/index.js +620 -547
- package/dist/view-transitions/jaemin.d.ts +4 -0
- package/dist/view-transitions/jaemin.d.ts.map +1 -1
- package/dist/view-transitions/strip.d.ts +3 -0
- package/dist/view-transitions/strip.d.ts.map +1 -0
- package/package.json +16 -13
- package/dist/view-transitions/hero-rotate.d.ts +0 -28
- package/dist/view-transitions/hero-rotate.d.ts.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,108 +1,207 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import {
|
|
5
|
-
|
|
1
|
+
var _ = Object.defineProperty;
|
|
2
|
+
var $ = (n, t, e) => t in n ? _(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
|
|
3
|
+
var d = (n, t, e) => $(n, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
import { isMultiSpring as R } from "./types.js";
|
|
5
|
+
import { isSingleSpring as at } from "./types.js";
|
|
6
|
+
import { j as lt } from "./jaemin-BAi8PTrj.js";
|
|
7
|
+
class F {
|
|
8
|
+
constructor() {
|
|
9
|
+
d(this, "listeners", /* @__PURE__ */ new Set());
|
|
10
|
+
d(this, "rafId", null);
|
|
11
|
+
d(this, "isRunning", !1);
|
|
12
|
+
// Timing
|
|
13
|
+
d(this, "startTime", Date.now());
|
|
14
|
+
d(this, "lastUpdate", this.startTime);
|
|
15
|
+
d(this, "elapsed", 0);
|
|
16
|
+
// Lag smoothing (mobile optimization)
|
|
17
|
+
d(this, "lagThreshold", 500);
|
|
18
|
+
// ms - detect tab switches, backgrounding
|
|
19
|
+
d(this, "adjustedLag", 33);
|
|
20
|
+
// ms - max time jump to prevent animation skip
|
|
21
|
+
// FPS throttling
|
|
22
|
+
d(this, "gap", 1e3 / 240);
|
|
23
|
+
// max 240fps
|
|
24
|
+
d(this, "nextTime", this.gap);
|
|
25
|
+
d(this, "tick", () => {
|
|
26
|
+
const t = Date.now();
|
|
27
|
+
let e = t - this.lastUpdate;
|
|
28
|
+
(e > this.lagThreshold || e < 0) && (this.startTime += e - this.adjustedLag, e = this.adjustedLag), this.lastUpdate = t;
|
|
29
|
+
const i = t - this.startTime, r = i - this.nextTime;
|
|
30
|
+
if (r > 0) {
|
|
31
|
+
const o = e / 1e3;
|
|
32
|
+
this.elapsed = i / 1e3, this.nextTime += r + (r >= this.gap ? 4 : this.gap - r), this.listeners.forEach((s) => {
|
|
33
|
+
s(o, this.elapsed);
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
this.listeners.size > 0 ? this.rafId = requestAnimationFrame(this.tick) : (this.isRunning = !1, this.rafId = null);
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
subscribe(t) {
|
|
40
|
+
return this.listeners.add(t), this.isRunning || (this.isRunning = !0, this.rafId = requestAnimationFrame(this.tick)), () => {
|
|
41
|
+
this.unsubscribe(t);
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
unsubscribe(t) {
|
|
45
|
+
this.listeners.delete(t), this.listeners.size === 0 && this.rafId !== null && (cancelAnimationFrame(this.rafId), this.isRunning = !1, this.rafId = null);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Configure lag smoothing behavior
|
|
49
|
+
* @param threshold - Time threshold to detect lag (default: 500ms)
|
|
50
|
+
* @param adjustedLag - Max time jump when lag detected (default: 33ms)
|
|
51
|
+
*/
|
|
52
|
+
lagSmoothing(t, e) {
|
|
53
|
+
this.lagThreshold = t, this.adjustedLag = Math.min(e, t);
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Set maximum FPS
|
|
57
|
+
* @param fps - Target FPS (default: 240)
|
|
58
|
+
*/
|
|
59
|
+
fps(t) {
|
|
60
|
+
this.gap = 1e3 / t, this.nextTime = this.elapsed * 1e3 + this.gap;
|
|
61
|
+
}
|
|
62
|
+
getListenerCount() {
|
|
63
|
+
return this.listeners.size;
|
|
64
|
+
}
|
|
65
|
+
getElapsed() {
|
|
66
|
+
return this.elapsed;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
const I = new F();
|
|
70
|
+
function k(n) {
|
|
71
|
+
const {
|
|
72
|
+
from: t,
|
|
73
|
+
to: e,
|
|
74
|
+
stiffness: i,
|
|
75
|
+
damping: r,
|
|
76
|
+
mass: o,
|
|
77
|
+
velocity: s = 0,
|
|
78
|
+
onUpdate: m,
|
|
79
|
+
onComplete: l
|
|
80
|
+
} = n;
|
|
81
|
+
let h = t, u = s, a = !0;
|
|
82
|
+
const p = Math.sqrt(i / o), c = r / (2 * Math.sqrt(i * o)), S = 0.01, w = 0.01;
|
|
83
|
+
let f = 0;
|
|
84
|
+
const g = 0.05, v = (A) => {
|
|
85
|
+
if (!a) return;
|
|
86
|
+
const C = Math.min(A, 0.033), y = -2 * C * c * p * u, b = C * p * p * (e - h);
|
|
87
|
+
u += y + b, h += C * u;
|
|
88
|
+
const E = Math.abs(e - h), T = Math.abs(u);
|
|
89
|
+
if (E < S && T < w) {
|
|
90
|
+
if (f += C, f >= g) {
|
|
91
|
+
h = e, u = 0, a = !1, m(h), I.unsubscribe(v), l();
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
} else
|
|
95
|
+
f = 0;
|
|
96
|
+
m(h);
|
|
97
|
+
};
|
|
98
|
+
return I.subscribe(v), {
|
|
99
|
+
stop: () => {
|
|
100
|
+
a && (a = !1, I.unsubscribe(v));
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
class O {
|
|
6
105
|
constructor(t) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
106
|
+
d(this, "options");
|
|
107
|
+
d(this, "currentValue");
|
|
108
|
+
d(this, "velocity");
|
|
109
|
+
d(this, "isAnimating", !1);
|
|
110
|
+
d(this, "controls", null);
|
|
12
111
|
// For object animations
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
112
|
+
d(this, "animationMap", null);
|
|
113
|
+
d(this, "activeAnimations", /* @__PURE__ */ new Set());
|
|
114
|
+
d(this, "completedAnimations", /* @__PURE__ */ new Set());
|
|
115
|
+
d(this, "updatedProperties", /* @__PURE__ */ new Set());
|
|
116
|
+
d(this, "animate", (t = !1) => {
|
|
18
117
|
!this.isAnimating && this.options.onStart && this.options.onStart(), this.isAnimating = !0;
|
|
19
|
-
const
|
|
118
|
+
const e = t ? this.options.from : this.options.to;
|
|
20
119
|
if (typeof this.currentValue == "object" && this.currentValue !== null) {
|
|
21
|
-
this.animateObject(
|
|
120
|
+
this.animateObject(e);
|
|
22
121
|
return;
|
|
23
122
|
}
|
|
24
|
-
let
|
|
25
|
-
const
|
|
123
|
+
let i = this.currentValue, r = performance.now();
|
|
124
|
+
const o = {
|
|
26
125
|
from: this.currentValue,
|
|
27
|
-
to:
|
|
126
|
+
to: e,
|
|
28
127
|
stiffness: this.options.spring.stiffness,
|
|
29
128
|
damping: this.options.spring.damping,
|
|
30
129
|
mass: 1
|
|
31
130
|
};
|
|
32
|
-
typeof this.velocity == "number" && (
|
|
33
|
-
...
|
|
34
|
-
onUpdate: (
|
|
35
|
-
const
|
|
36
|
-
if (
|
|
37
|
-
if (typeof
|
|
38
|
-
const
|
|
39
|
-
this.velocity =
|
|
40
|
-
} else if (typeof
|
|
41
|
-
const
|
|
42
|
-
Object.keys(
|
|
43
|
-
const
|
|
44
|
-
if (typeof
|
|
45
|
-
const
|
|
46
|
-
|
|
131
|
+
typeof this.velocity == "number" && (o.velocity = this.velocity * 1e3), this.controls = k({
|
|
132
|
+
...o,
|
|
133
|
+
onUpdate: (s) => {
|
|
134
|
+
const m = performance.now(), l = (m - r) / 1e3;
|
|
135
|
+
if (l > 0) {
|
|
136
|
+
if (typeof s == "number" && typeof i == "number") {
|
|
137
|
+
const h = (s - i) / l;
|
|
138
|
+
this.velocity = h / 1e3;
|
|
139
|
+
} else if (typeof s == "object" && s !== null) {
|
|
140
|
+
const h = {};
|
|
141
|
+
Object.keys(s).forEach((u) => {
|
|
142
|
+
const a = s[u], p = i[u];
|
|
143
|
+
if (typeof a == "number" && typeof p == "number") {
|
|
144
|
+
const c = (a - p) / l;
|
|
145
|
+
h[u] = c / 1e3;
|
|
47
146
|
}
|
|
48
|
-
}), this.velocity =
|
|
147
|
+
}), this.velocity = h;
|
|
49
148
|
}
|
|
50
|
-
|
|
149
|
+
i = s, r = m;
|
|
51
150
|
}
|
|
52
|
-
this.currentValue =
|
|
151
|
+
this.currentValue = s, this.options.onUpdate(s);
|
|
53
152
|
},
|
|
54
153
|
onComplete: () => {
|
|
55
|
-
this.currentValue =
|
|
56
|
-
this.velocity[
|
|
154
|
+
this.currentValue = e, this.isAnimating = !1, this.controls = null, typeof this.velocity == "object" && this.velocity !== null ? Object.keys(this.velocity).forEach((s) => {
|
|
155
|
+
this.velocity[s] = 0;
|
|
57
156
|
}) : this.velocity = 0, this.options.onComplete();
|
|
58
157
|
}
|
|
59
158
|
});
|
|
60
159
|
});
|
|
61
|
-
|
|
62
|
-
const
|
|
160
|
+
d(this, "animateObject", (t) => {
|
|
161
|
+
const e = this.currentValue, i = Object.keys(e);
|
|
63
162
|
this.animationMap = /* @__PURE__ */ new Map(), this.activeAnimations.clear(), this.completedAnimations.clear(), this.updatedProperties.clear();
|
|
64
|
-
const
|
|
65
|
-
let
|
|
66
|
-
const
|
|
67
|
-
const
|
|
68
|
-
if (
|
|
69
|
-
(
|
|
70
|
-
) &&
|
|
163
|
+
const r = { ...e }, o = {};
|
|
164
|
+
let s = !1;
|
|
165
|
+
const m = () => {
|
|
166
|
+
const l = i.filter((u) => !this.completedAnimations.has(u));
|
|
167
|
+
if (l.every(
|
|
168
|
+
(u) => this.updatedProperties.has(u)
|
|
169
|
+
) && l.length > 0) {
|
|
71
170
|
if (typeof this.velocity == "object" && this.velocity) {
|
|
72
|
-
const
|
|
73
|
-
Object.keys(
|
|
74
|
-
if (
|
|
75
|
-
const
|
|
76
|
-
typeof
|
|
171
|
+
const u = performance.now();
|
|
172
|
+
Object.keys(r).forEach((a) => {
|
|
173
|
+
if (o[a]) {
|
|
174
|
+
const p = (u - o[a]) / 1e3, c = this.currentValue[a], S = r[a];
|
|
175
|
+
typeof c == "number" && typeof S == "number" && p > 0 && (this.velocity[a] = (S - c) / p / 1e3);
|
|
77
176
|
}
|
|
78
|
-
|
|
177
|
+
o[a] = u;
|
|
79
178
|
});
|
|
80
179
|
}
|
|
81
|
-
this.currentValue = { ...
|
|
180
|
+
this.currentValue = { ...r }, this.options.onUpdate(this.currentValue), this.updatedProperties.clear(), !s && this.options.onStart && (s = !0, this.options.onStart());
|
|
82
181
|
}
|
|
83
182
|
};
|
|
84
|
-
|
|
85
|
-
this.activeAnimations.add(
|
|
86
|
-
const
|
|
87
|
-
from:
|
|
88
|
-
to: t[
|
|
183
|
+
i.forEach((l) => {
|
|
184
|
+
this.activeAnimations.add(l);
|
|
185
|
+
const h = {
|
|
186
|
+
from: e[l],
|
|
187
|
+
to: t[l],
|
|
89
188
|
stiffness: this.options.spring.stiffness,
|
|
90
189
|
damping: this.options.spring.damping,
|
|
91
190
|
mass: 1
|
|
92
191
|
};
|
|
93
|
-
typeof this.velocity == "object" && this.velocity &&
|
|
94
|
-
const
|
|
95
|
-
...
|
|
96
|
-
onUpdate: (
|
|
97
|
-
|
|
192
|
+
typeof this.velocity == "object" && this.velocity && l in this.velocity && (h.velocity = this.velocity[l] * 1e3);
|
|
193
|
+
const u = k({
|
|
194
|
+
...h,
|
|
195
|
+
onUpdate: (a) => {
|
|
196
|
+
r[l] = a, this.updatedProperties.add(l), m();
|
|
98
197
|
},
|
|
99
198
|
onComplete: () => {
|
|
100
|
-
this.completedAnimations.add(
|
|
101
|
-
this.velocity[
|
|
199
|
+
this.completedAnimations.add(l), this.updatedProperties.delete(l), this.completedAnimations.size === i.length && (this.currentValue = t, this.isAnimating = !1, this.animationMap = null, typeof this.velocity == "object" && this.velocity && Object.keys(this.velocity).forEach((a) => {
|
|
200
|
+
this.velocity[a] = 0;
|
|
102
201
|
}), this.options.onComplete());
|
|
103
202
|
}
|
|
104
203
|
});
|
|
105
|
-
this.animationMap.set(
|
|
204
|
+
this.animationMap.set(l, u);
|
|
106
205
|
});
|
|
107
206
|
});
|
|
108
207
|
if (this.options = {
|
|
@@ -115,10 +214,10 @@ class A {
|
|
|
115
214
|
}),
|
|
116
215
|
onStart: t.onStart
|
|
117
216
|
}, this.currentValue = this.options.from, typeof this.options.from == "object" && this.options.from !== null) {
|
|
118
|
-
const
|
|
119
|
-
Object.keys(this.options.from).forEach((
|
|
120
|
-
|
|
121
|
-
}), this.velocity =
|
|
217
|
+
const e = {};
|
|
218
|
+
Object.keys(this.options.from).forEach((i) => {
|
|
219
|
+
e[i] = 0;
|
|
220
|
+
}), this.velocity = e;
|
|
122
221
|
} else
|
|
123
222
|
this.velocity = 0;
|
|
124
223
|
}
|
|
@@ -132,8 +231,8 @@ class A {
|
|
|
132
231
|
reverse() {
|
|
133
232
|
const t = this.options.from;
|
|
134
233
|
if (this.options.from = this.options.to, this.options.to = t, this.isAnimating) {
|
|
135
|
-
const
|
|
136
|
-
this.stop(), this.animate(!
|
|
234
|
+
const e = this.shouldReverse();
|
|
235
|
+
this.stop(), this.animate(!e);
|
|
137
236
|
}
|
|
138
237
|
}
|
|
139
238
|
shouldReverse() {
|
|
@@ -156,6 +255,7 @@ class A {
|
|
|
156
255
|
}
|
|
157
256
|
getCurrentState() {
|
|
158
257
|
return {
|
|
258
|
+
type: "single",
|
|
159
259
|
position: this.currentValue,
|
|
160
260
|
velocity: this.velocity,
|
|
161
261
|
from: this.options.from,
|
|
@@ -172,37 +272,275 @@ class A {
|
|
|
172
272
|
// Configuration
|
|
173
273
|
updateOptions(t) {
|
|
174
274
|
if (this.options = { ...this.options, ...t }, this.isAnimating && this.controls) {
|
|
175
|
-
const
|
|
176
|
-
this.stop(), this.animate(!
|
|
275
|
+
const e = this.shouldReverse();
|
|
276
|
+
this.stop(), this.animate(!e);
|
|
177
277
|
}
|
|
178
278
|
}
|
|
179
279
|
// Static factory method
|
|
180
|
-
static fromState(t,
|
|
181
|
-
const
|
|
182
|
-
return
|
|
280
|
+
static fromState(t, e) {
|
|
281
|
+
const i = new O(e);
|
|
282
|
+
return i.setValue(t.position), i.setVelocity(t.velocity), i;
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
class j {
|
|
286
|
+
constructor(t) {
|
|
287
|
+
d(this, "config");
|
|
288
|
+
d(this, "animators", /* @__PURE__ */ new Map());
|
|
289
|
+
d(this, "springOrder", []);
|
|
290
|
+
d(this, "completedCount", 0);
|
|
291
|
+
d(this, "completedAnimators", /* @__PURE__ */ new Set());
|
|
292
|
+
d(this, "direction", "forward");
|
|
293
|
+
d(this, "idCounter", 0);
|
|
294
|
+
d(this, "timeoutIds", []);
|
|
295
|
+
this.config = t, this.initializeAnimators();
|
|
296
|
+
}
|
|
297
|
+
generateId() {
|
|
298
|
+
return `spring_${this.idCounter++}`;
|
|
299
|
+
}
|
|
300
|
+
initializeAnimators() {
|
|
301
|
+
this.config.springs.forEach((t) => {
|
|
302
|
+
const e = this.generateId(), i = new O({
|
|
303
|
+
from: t.from,
|
|
304
|
+
to: t.to,
|
|
305
|
+
spring: t.spring,
|
|
306
|
+
onUpdate: t.tick,
|
|
307
|
+
onComplete: () => this.onAnimatorComplete(e),
|
|
308
|
+
onStart: t.onStart
|
|
309
|
+
});
|
|
310
|
+
this.animators.set(e, {
|
|
311
|
+
id: e,
|
|
312
|
+
item: t,
|
|
313
|
+
animator: i,
|
|
314
|
+
startTime: null
|
|
315
|
+
}), this.springOrder.push(e);
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* Normalize schedule configuration to unified internal representation
|
|
320
|
+
* Uses discriminated union and early return pattern
|
|
321
|
+
*
|
|
322
|
+
* @param direction - "forward" or "backward" direction
|
|
323
|
+
*/
|
|
324
|
+
normalizeSchedule(t) {
|
|
325
|
+
const e = this.config.schedule ?? "overlap";
|
|
326
|
+
return this.springOrder.map((i, r) => {
|
|
327
|
+
const o = this.animators.get(i);
|
|
328
|
+
if (!o)
|
|
329
|
+
throw new Error(
|
|
330
|
+
`AnimationScheduler: animator with id "${i}" not found during normalization`
|
|
331
|
+
);
|
|
332
|
+
if (e === "overlap")
|
|
333
|
+
return {
|
|
334
|
+
type: "offset",
|
|
335
|
+
id: i,
|
|
336
|
+
delay: 0
|
|
337
|
+
};
|
|
338
|
+
if (e === "wait")
|
|
339
|
+
return t === "forward" && r === 0 ? {
|
|
340
|
+
type: "offset",
|
|
341
|
+
id: i,
|
|
342
|
+
delay: 0
|
|
343
|
+
} : t === "backward" && r === this.springOrder.length - 1 ? {
|
|
344
|
+
type: "offset",
|
|
345
|
+
id: i,
|
|
346
|
+
delay: 0
|
|
347
|
+
} : {
|
|
348
|
+
type: "wait",
|
|
349
|
+
id: i
|
|
350
|
+
};
|
|
351
|
+
const s = o.item.offset ?? 0;
|
|
352
|
+
if (t === "forward")
|
|
353
|
+
return {
|
|
354
|
+
type: "offset",
|
|
355
|
+
id: i,
|
|
356
|
+
delay: s
|
|
357
|
+
};
|
|
358
|
+
const m = this.animators.size === 0 ? 0 : Math.max(
|
|
359
|
+
...Array.from(this.animators.values()).map(
|
|
360
|
+
(l) => l.item.offset ?? 0
|
|
361
|
+
)
|
|
362
|
+
);
|
|
363
|
+
return {
|
|
364
|
+
type: "offset",
|
|
365
|
+
id: i,
|
|
366
|
+
delay: m - s
|
|
367
|
+
};
|
|
368
|
+
});
|
|
369
|
+
}
|
|
370
|
+
onAnimatorComplete(t) {
|
|
371
|
+
var i, r, o, s, m, l;
|
|
372
|
+
const e = this.animators.get(t);
|
|
373
|
+
if (!e) {
|
|
374
|
+
console.warn(
|
|
375
|
+
`AnimationScheduler: animator with id "${t}" not found on completion`
|
|
376
|
+
);
|
|
377
|
+
return;
|
|
378
|
+
}
|
|
379
|
+
this.completedAnimators.has(t) || (this.completedAnimators.add(t), this.completedCount++, (r = (i = e.item).onComplete) == null || r.call(i), (s = (o = this.config).onProgress) == null || s.call(o, this.completedCount, this.config.springs.length), this.handleWaitModeChaining(t), this.completedCount === this.config.springs.length && ((l = (m = this.config).onEnd) == null || l.call(m)));
|
|
380
|
+
}
|
|
381
|
+
/**
|
|
382
|
+
* Handle wait mode chaining: start next/previous spring after completion
|
|
383
|
+
*/
|
|
384
|
+
handleWaitModeChaining(t) {
|
|
385
|
+
if (this.config.schedule !== "wait")
|
|
386
|
+
return;
|
|
387
|
+
const e = this.springOrder.indexOf(t);
|
|
388
|
+
if (this.direction === "forward") {
|
|
389
|
+
const o = this.springOrder[e + 1];
|
|
390
|
+
if (!o)
|
|
391
|
+
return;
|
|
392
|
+
const s = this.animators.get(o);
|
|
393
|
+
s && s.startTime === null && this.startAnimator(o);
|
|
394
|
+
return;
|
|
395
|
+
}
|
|
396
|
+
const i = this.springOrder[e - 1];
|
|
397
|
+
if (!i)
|
|
398
|
+
return;
|
|
399
|
+
const r = this.animators.get(i);
|
|
400
|
+
r && r.startTime === null && this.startBackwardAnimator(i);
|
|
401
|
+
}
|
|
402
|
+
startAnimator(t) {
|
|
403
|
+
const e = this.animators.get(t);
|
|
404
|
+
if (!e) {
|
|
405
|
+
console.warn(
|
|
406
|
+
`AnimationScheduler: animator with id "${t}" not found on start`
|
|
407
|
+
);
|
|
408
|
+
return;
|
|
409
|
+
}
|
|
410
|
+
if (e.startTime !== null) {
|
|
411
|
+
console.warn(
|
|
412
|
+
`AnimationScheduler: animator with id "${t}" already started`
|
|
413
|
+
);
|
|
414
|
+
return;
|
|
415
|
+
}
|
|
416
|
+
e.startTime = Date.now(), e.animator.forward();
|
|
417
|
+
}
|
|
418
|
+
startBackwardAnimator(t) {
|
|
419
|
+
const e = this.animators.get(t);
|
|
420
|
+
if (!e) {
|
|
421
|
+
console.warn(
|
|
422
|
+
`AnimationScheduler: animator with id "${t}" not found on backward start`
|
|
423
|
+
);
|
|
424
|
+
return;
|
|
425
|
+
}
|
|
426
|
+
if (e.startTime !== null) {
|
|
427
|
+
console.warn(
|
|
428
|
+
`AnimationScheduler: animator with id "${t}" already started`
|
|
429
|
+
);
|
|
430
|
+
return;
|
|
431
|
+
}
|
|
432
|
+
e.startTime = Date.now(), e.animator.backward();
|
|
433
|
+
}
|
|
434
|
+
forward() {
|
|
435
|
+
var e, i;
|
|
436
|
+
this.stop(), this.direction = "forward", this.completedCount = 0, this.completedAnimators.clear(), (i = (e = this.config).onStart) == null || i.call(e), this.normalizeSchedule("forward").forEach((r) => {
|
|
437
|
+
if (r.type === "wait")
|
|
438
|
+
return;
|
|
439
|
+
if (r.delay === 0) {
|
|
440
|
+
this.startAnimator(r.id);
|
|
441
|
+
return;
|
|
442
|
+
}
|
|
443
|
+
const o = window.setTimeout(
|
|
444
|
+
() => this.startAnimator(r.id),
|
|
445
|
+
r.delay
|
|
446
|
+
);
|
|
447
|
+
this.timeoutIds.push(o);
|
|
448
|
+
});
|
|
449
|
+
}
|
|
450
|
+
backward() {
|
|
451
|
+
var e, i;
|
|
452
|
+
this.stop(), this.direction = "backward", this.completedCount = 0, this.completedAnimators.clear(), (i = (e = this.config).onStart) == null || i.call(e), this.normalizeSchedule("backward").forEach((r) => {
|
|
453
|
+
if (r.type === "wait")
|
|
454
|
+
return;
|
|
455
|
+
if (r.delay === 0) {
|
|
456
|
+
this.startBackwardAnimator(r.id);
|
|
457
|
+
return;
|
|
458
|
+
}
|
|
459
|
+
const o = window.setTimeout(
|
|
460
|
+
() => this.startBackwardAnimator(r.id),
|
|
461
|
+
r.delay
|
|
462
|
+
);
|
|
463
|
+
this.timeoutIds.push(o);
|
|
464
|
+
});
|
|
465
|
+
}
|
|
466
|
+
stop() {
|
|
467
|
+
this.timeoutIds.forEach((t) => clearTimeout(t)), this.timeoutIds = [], this.animators.forEach((t) => {
|
|
468
|
+
t.animator.stop(), t.startTime = null;
|
|
469
|
+
});
|
|
470
|
+
}
|
|
471
|
+
reverse(t) {
|
|
472
|
+
((t == null ? void 0 : t.offsetMode) ?? "immediate") !== "immediate" && console.warn(
|
|
473
|
+
'AnimationScheduler.reverse(): Only "immediate" offsetMode is currently supported. Falling back to "immediate".'
|
|
474
|
+
), this.direction = this.direction === "forward" ? "backward" : "forward", this.animators.forEach((i) => {
|
|
475
|
+
if (i.startTime === null)
|
|
476
|
+
return;
|
|
477
|
+
const r = i.animator.getCurrentState();
|
|
478
|
+
if (r.type !== "single")
|
|
479
|
+
return;
|
|
480
|
+
if (r.position === r.to) {
|
|
481
|
+
const s = O.fromState(
|
|
482
|
+
{
|
|
483
|
+
position: 1,
|
|
484
|
+
velocity: 0
|
|
485
|
+
},
|
|
486
|
+
{
|
|
487
|
+
from: i.item.to ?? 1,
|
|
488
|
+
to: i.item.from ?? 0,
|
|
489
|
+
spring: i.item.spring,
|
|
490
|
+
onUpdate: i.item.tick,
|
|
491
|
+
onComplete: () => this.onAnimatorComplete(i.id),
|
|
492
|
+
onStart: i.item.onStart
|
|
493
|
+
}
|
|
494
|
+
);
|
|
495
|
+
s.forward(), i.animator = s;
|
|
496
|
+
return;
|
|
497
|
+
}
|
|
498
|
+
i.animator.reverse();
|
|
499
|
+
});
|
|
500
|
+
}
|
|
501
|
+
getCurrentState() {
|
|
502
|
+
return {
|
|
503
|
+
type: "multi",
|
|
504
|
+
completed: this.completedCount,
|
|
505
|
+
total: this.config.springs.length,
|
|
506
|
+
direction: this.direction
|
|
507
|
+
};
|
|
183
508
|
}
|
|
184
509
|
}
|
|
185
|
-
const
|
|
510
|
+
const L = Symbol.for("TRANSITION_STRATEGY"), N = (n) => ({
|
|
186
511
|
runIn: async (t) => {
|
|
187
|
-
const { currentAnimation:
|
|
188
|
-
if (
|
|
189
|
-
const
|
|
190
|
-
if (
|
|
191
|
-
|
|
512
|
+
const { currentAnimation: e } = n;
|
|
513
|
+
if (e && e.direction === "out") {
|
|
514
|
+
const s = e.controller.getCurrentState();
|
|
515
|
+
if (e.controller.stop(), s.type === "multi")
|
|
516
|
+
return e.controller.reverse(), {
|
|
517
|
+
state: {
|
|
518
|
+
position: 0,
|
|
519
|
+
velocity: 0
|
|
520
|
+
},
|
|
521
|
+
from: 0,
|
|
522
|
+
to: 1,
|
|
523
|
+
direction: "forward"
|
|
524
|
+
};
|
|
525
|
+
if (t.out) {
|
|
526
|
+
const m = await t.out, { from: l = 1, to: h = 0 } = m;
|
|
192
527
|
return {
|
|
193
|
-
config:
|
|
194
|
-
state:
|
|
195
|
-
|
|
528
|
+
config: m,
|
|
529
|
+
state: {
|
|
530
|
+
position: s.position,
|
|
531
|
+
velocity: s.velocity
|
|
532
|
+
},
|
|
533
|
+
from: l,
|
|
196
534
|
// OUT animation's from
|
|
197
|
-
to:
|
|
535
|
+
to: h,
|
|
198
536
|
// OUT animation's to
|
|
199
537
|
direction: "backward"
|
|
200
538
|
// Will actually go 0→1
|
|
201
539
|
};
|
|
202
540
|
}
|
|
203
541
|
}
|
|
204
|
-
const
|
|
205
|
-
if (!
|
|
542
|
+
const i = await t.in;
|
|
543
|
+
if (!i)
|
|
206
544
|
return {
|
|
207
545
|
state: {
|
|
208
546
|
position: 0,
|
|
@@ -212,42 +550,74 @@ const O = Symbol.for("TRANSITION_STRATEGY"), _ = (o) => ({
|
|
|
212
550
|
to: 1,
|
|
213
551
|
direction: "forward"
|
|
214
552
|
};
|
|
215
|
-
|
|
553
|
+
if ("springs" in i)
|
|
554
|
+
return {
|
|
555
|
+
config: i,
|
|
556
|
+
state: {
|
|
557
|
+
position: 0,
|
|
558
|
+
velocity: 0
|
|
559
|
+
},
|
|
560
|
+
from: 0,
|
|
561
|
+
to: 1,
|
|
562
|
+
direction: "forward"
|
|
563
|
+
};
|
|
564
|
+
const { from: r = 0, to: o = 1 } = i;
|
|
216
565
|
return {
|
|
217
|
-
config:
|
|
566
|
+
config: i,
|
|
218
567
|
state: {
|
|
219
|
-
position:
|
|
568
|
+
position: r,
|
|
220
569
|
velocity: 0
|
|
221
570
|
},
|
|
222
|
-
from:
|
|
223
|
-
to:
|
|
571
|
+
from: r,
|
|
572
|
+
to: o,
|
|
224
573
|
direction: "forward"
|
|
225
574
|
};
|
|
226
575
|
},
|
|
227
576
|
runOut: async (t) => {
|
|
228
|
-
const { currentAnimation:
|
|
229
|
-
if (
|
|
230
|
-
const
|
|
231
|
-
if (
|
|
232
|
-
|
|
577
|
+
const { currentAnimation: e } = n;
|
|
578
|
+
if (e && e.direction === "in") {
|
|
579
|
+
const s = e.controller.getCurrentState();
|
|
580
|
+
if (e.controller.stop(), s.type === "multi")
|
|
581
|
+
return e.controller.reverse(), {
|
|
582
|
+
state: {
|
|
583
|
+
position: 1,
|
|
584
|
+
velocity: 0
|
|
585
|
+
},
|
|
586
|
+
from: 1,
|
|
587
|
+
to: 0,
|
|
588
|
+
direction: "forward"
|
|
589
|
+
};
|
|
590
|
+
if (t.in) {
|
|
591
|
+
const m = await t.in, { from: l = 0, to: h = 1 } = m;
|
|
233
592
|
return {
|
|
234
|
-
config:
|
|
593
|
+
config: m,
|
|
235
594
|
state: {
|
|
236
|
-
position:
|
|
237
|
-
velocity:
|
|
595
|
+
position: s.position,
|
|
596
|
+
velocity: s.velocity
|
|
238
597
|
},
|
|
239
|
-
from:
|
|
598
|
+
from: l,
|
|
240
599
|
// IN animation's from
|
|
241
|
-
to:
|
|
600
|
+
to: h,
|
|
242
601
|
// IN animation's to
|
|
243
602
|
direction: "backward"
|
|
244
603
|
// Will actually go 1→0
|
|
245
604
|
};
|
|
246
605
|
}
|
|
247
606
|
}
|
|
248
|
-
const
|
|
249
|
-
if (!
|
|
607
|
+
const i = await t.out;
|
|
608
|
+
if (!i)
|
|
609
|
+
return {
|
|
610
|
+
state: {
|
|
611
|
+
position: 1,
|
|
612
|
+
velocity: 0
|
|
613
|
+
},
|
|
614
|
+
from: 1,
|
|
615
|
+
to: 0,
|
|
616
|
+
direction: "forward"
|
|
617
|
+
};
|
|
618
|
+
if ("springs" in i)
|
|
250
619
|
return {
|
|
620
|
+
config: i,
|
|
251
621
|
state: {
|
|
252
622
|
position: 1,
|
|
253
623
|
velocity: 0
|
|
@@ -256,21 +626,21 @@ const O = Symbol.for("TRANSITION_STRATEGY"), _ = (o) => ({
|
|
|
256
626
|
to: 0,
|
|
257
627
|
direction: "forward"
|
|
258
628
|
};
|
|
259
|
-
const { from:
|
|
629
|
+
const { from: r = 1, to: o = 0 } = i;
|
|
260
630
|
return {
|
|
261
|
-
config:
|
|
631
|
+
config: i,
|
|
262
632
|
state: {
|
|
263
|
-
position:
|
|
633
|
+
position: r,
|
|
264
634
|
velocity: 0
|
|
265
635
|
},
|
|
266
|
-
from:
|
|
267
|
-
to:
|
|
636
|
+
from: r,
|
|
637
|
+
to: o,
|
|
268
638
|
direction: "forward"
|
|
269
639
|
};
|
|
270
640
|
}
|
|
271
|
-
}),
|
|
272
|
-
runIn: async (
|
|
273
|
-
const t = await
|
|
641
|
+
}), H = () => ({
|
|
642
|
+
runIn: async (n) => {
|
|
643
|
+
const t = await n.in;
|
|
274
644
|
if (!t)
|
|
275
645
|
return {
|
|
276
646
|
state: {
|
|
@@ -281,20 +651,31 @@ const O = Symbol.for("TRANSITION_STRATEGY"), _ = (o) => ({
|
|
|
281
651
|
to: 1,
|
|
282
652
|
direction: "forward"
|
|
283
653
|
};
|
|
284
|
-
|
|
654
|
+
if ("springs" in t)
|
|
655
|
+
return {
|
|
656
|
+
config: t,
|
|
657
|
+
state: {
|
|
658
|
+
position: 0,
|
|
659
|
+
velocity: 0
|
|
660
|
+
},
|
|
661
|
+
from: 0,
|
|
662
|
+
to: 1,
|
|
663
|
+
direction: "forward"
|
|
664
|
+
};
|
|
665
|
+
const { from: e = 0, to: i = 1 } = t;
|
|
285
666
|
return {
|
|
286
667
|
config: t,
|
|
287
668
|
state: {
|
|
288
|
-
position:
|
|
669
|
+
position: e,
|
|
289
670
|
velocity: 0
|
|
290
671
|
},
|
|
291
|
-
from:
|
|
292
|
-
to:
|
|
672
|
+
from: e,
|
|
673
|
+
to: i,
|
|
293
674
|
direction: "forward"
|
|
294
675
|
};
|
|
295
676
|
},
|
|
296
|
-
runOut: async (
|
|
297
|
-
const t = await
|
|
677
|
+
runOut: async (n) => {
|
|
678
|
+
const t = await n.out;
|
|
298
679
|
if (!t)
|
|
299
680
|
return {
|
|
300
681
|
state: {
|
|
@@ -305,284 +686,384 @@ const O = Symbol.for("TRANSITION_STRATEGY"), _ = (o) => ({
|
|
|
305
686
|
to: 0,
|
|
306
687
|
direction: "forward"
|
|
307
688
|
};
|
|
308
|
-
|
|
689
|
+
if ("springs" in t)
|
|
690
|
+
return {
|
|
691
|
+
config: t,
|
|
692
|
+
state: {
|
|
693
|
+
position: 1,
|
|
694
|
+
velocity: 0
|
|
695
|
+
},
|
|
696
|
+
from: 1,
|
|
697
|
+
to: 0,
|
|
698
|
+
direction: "forward"
|
|
699
|
+
};
|
|
700
|
+
const { from: e = 1, to: i = 0 } = t;
|
|
309
701
|
return {
|
|
310
702
|
config: t,
|
|
311
703
|
state: {
|
|
312
|
-
position:
|
|
704
|
+
position: e,
|
|
313
705
|
velocity: 0
|
|
314
706
|
},
|
|
315
|
-
from:
|
|
316
|
-
to:
|
|
707
|
+
from: e,
|
|
708
|
+
to: i,
|
|
317
709
|
direction: "forward"
|
|
318
710
|
};
|
|
319
711
|
}
|
|
320
712
|
});
|
|
321
|
-
function
|
|
322
|
-
var
|
|
323
|
-
let
|
|
324
|
-
const
|
|
713
|
+
function W(n, t) {
|
|
714
|
+
var u;
|
|
715
|
+
let e = null, i = null, r = null, o = null;
|
|
716
|
+
const s = {
|
|
325
717
|
get currentAnimation() {
|
|
326
|
-
return
|
|
718
|
+
return e;
|
|
327
719
|
}
|
|
328
|
-
},
|
|
329
|
-
var
|
|
330
|
-
|
|
331
|
-
const
|
|
332
|
-
|
|
333
|
-
out: u.out && Promise.resolve(u.out(s))
|
|
334
|
-
}, r = await h.runIn(d);
|
|
335
|
-
if (!r.config)
|
|
720
|
+
}, m = ((u = t == null ? void 0 : t.strategy) == null ? void 0 : u.call(t, s)) || N(s), l = async (a) => {
|
|
721
|
+
var v, A, C;
|
|
722
|
+
i && (i.remove(), i = null);
|
|
723
|
+
const p = n(), c = p.in && await p.in(a), S = !(t != null && t.strategy) && p.out ? await p.out(a) : void 0;
|
|
724
|
+
if (!c)
|
|
336
725
|
return;
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
726
|
+
if (R(c)) {
|
|
727
|
+
const y = {
|
|
728
|
+
in: Promise.resolve(c),
|
|
729
|
+
out: S && Promise.resolve(S)
|
|
730
|
+
};
|
|
731
|
+
if (!(await m.runIn(y)).config) {
|
|
732
|
+
e && (e.direction = "in");
|
|
733
|
+
return;
|
|
734
|
+
}
|
|
735
|
+
(v = c.prepare) == null || v.call(c, a), c.wait && await c.wait();
|
|
736
|
+
const E = new j({
|
|
737
|
+
...c,
|
|
738
|
+
onEnd: () => {
|
|
739
|
+
var T;
|
|
740
|
+
e = null, (T = c.onEnd) == null || T.call(c);
|
|
741
|
+
}
|
|
742
|
+
});
|
|
743
|
+
e = {
|
|
744
|
+
controller: E,
|
|
745
|
+
direction: "in"
|
|
746
|
+
}, E.forward();
|
|
747
|
+
return;
|
|
748
|
+
}
|
|
749
|
+
const w = {
|
|
750
|
+
in: Promise.resolve(c),
|
|
751
|
+
out: S && Promise.resolve(S)
|
|
752
|
+
}, f = await m.runIn(w);
|
|
753
|
+
if (!f.config)
|
|
754
|
+
return;
|
|
755
|
+
if ("springs" in f.config) {
|
|
756
|
+
console.error("Unexpected MultiSpringConfig in single-spring path");
|
|
757
|
+
return;
|
|
758
|
+
}
|
|
759
|
+
(C = (A = f.config).prepare) == null || C.call(A, a), f.config.wait && await f.config.wait();
|
|
760
|
+
const g = O.fromState(f.state, {
|
|
761
|
+
from: f.from,
|
|
762
|
+
to: f.to,
|
|
763
|
+
spring: f.config.spring,
|
|
764
|
+
onStart: f.config.onStart,
|
|
765
|
+
onUpdate: f.config.tick,
|
|
344
766
|
onComplete: () => {
|
|
345
|
-
var
|
|
346
|
-
|
|
767
|
+
var y, b;
|
|
768
|
+
e = null, (b = (y = f.config) == null ? void 0 : y.onEnd) == null || b.call(y);
|
|
347
769
|
}
|
|
348
770
|
});
|
|
349
|
-
|
|
350
|
-
},
|
|
351
|
-
var v,
|
|
352
|
-
|
|
353
|
-
const
|
|
354
|
-
|
|
355
|
-
out: u.out && Promise.resolve(u.out(s))
|
|
356
|
-
}, r = await h.runOut(d);
|
|
357
|
-
if (!r.config)
|
|
771
|
+
e = { controller: g, direction: "in" }, f.direction === "forward" ? g.forward() : g.backward();
|
|
772
|
+
}, h = async (a) => {
|
|
773
|
+
var v, A, C;
|
|
774
|
+
i = a;
|
|
775
|
+
const p = n(), c = p.out && await p.out(a);
|
|
776
|
+
if (!c)
|
|
358
777
|
return;
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
778
|
+
if (R(c)) {
|
|
779
|
+
const y = {
|
|
780
|
+
in: void 0,
|
|
781
|
+
// Don't fetch IN config for exit transitions
|
|
782
|
+
out: Promise.resolve(c)
|
|
783
|
+
};
|
|
784
|
+
if (!(await m.runOut(y)).config) {
|
|
785
|
+
e && (e.direction = "out"), i && (i.remove(), i = null);
|
|
786
|
+
return;
|
|
787
|
+
}
|
|
788
|
+
(v = c.prepare) == null || v.call(c, a), g(), c.wait && await c.wait();
|
|
789
|
+
const E = new j({
|
|
790
|
+
...c,
|
|
791
|
+
onEnd: () => {
|
|
792
|
+
var T, x;
|
|
793
|
+
(T = c.onEnd) == null || T.call(c), i && (i.remove(), i = null), e = null, (x = t == null ? void 0 : t.onCleanupEnd) == null || x.call(t);
|
|
794
|
+
}
|
|
795
|
+
});
|
|
796
|
+
e = {
|
|
797
|
+
controller: E,
|
|
798
|
+
direction: "out"
|
|
799
|
+
}, E.forward();
|
|
800
|
+
return;
|
|
801
|
+
}
|
|
802
|
+
const S = {
|
|
803
|
+
in: void 0,
|
|
804
|
+
// Don't fetch IN config for exit transitions
|
|
805
|
+
out: Promise.resolve(c)
|
|
806
|
+
}, w = await m.runOut(S);
|
|
807
|
+
if (!w.config)
|
|
808
|
+
return;
|
|
809
|
+
if ("springs" in w.config) {
|
|
810
|
+
console.error("Unexpected MultiSpringConfig in single-spring path");
|
|
811
|
+
return;
|
|
812
|
+
}
|
|
813
|
+
(C = (A = w.config).prepare) == null || C.call(A, a), g(), w.config.wait && await w.config.wait();
|
|
814
|
+
const f = O.fromState(w.state, {
|
|
815
|
+
from: w.from,
|
|
816
|
+
to: w.to,
|
|
817
|
+
spring: w.config.spring,
|
|
818
|
+
onStart: w.config.onStart,
|
|
819
|
+
onUpdate: w.config.tick,
|
|
366
820
|
onComplete: () => {
|
|
367
|
-
var
|
|
368
|
-
(
|
|
821
|
+
var y, b, E;
|
|
822
|
+
(b = (y = w.config) == null ? void 0 : y.onEnd) == null || b.call(y), i && (i.remove(), i = null), e = null, (E = t == null ? void 0 : t.onCleanupEnd) == null || E.call(t);
|
|
369
823
|
}
|
|
370
824
|
});
|
|
371
|
-
|
|
372
|
-
function
|
|
373
|
-
!
|
|
825
|
+
e = { controller: f, direction: "out" }, w.direction === "forward" ? f.forward() : f.backward();
|
|
826
|
+
function g() {
|
|
827
|
+
!r || !i || (o && r.contains(o) ? r.insertBefore(i, o) : r.appendChild(i));
|
|
374
828
|
}
|
|
375
829
|
};
|
|
376
|
-
return (
|
|
377
|
-
if (
|
|
378
|
-
return
|
|
379
|
-
const
|
|
380
|
-
p
|
|
830
|
+
return (a) => {
|
|
831
|
+
if (a)
|
|
832
|
+
return r = a.parentElement, o = a.nextElementSibling, l(a), () => {
|
|
833
|
+
const p = a.cloneNode(!0);
|
|
834
|
+
h(p);
|
|
381
835
|
};
|
|
382
836
|
};
|
|
383
837
|
}
|
|
384
|
-
const
|
|
385
|
-
if (!
|
|
386
|
-
const t =
|
|
387
|
-
`).map((
|
|
388
|
-
for (let
|
|
389
|
-
const
|
|
390
|
-
if (!
|
|
838
|
+
const B = 3, K = (n) => {
|
|
839
|
+
if (!n) return null;
|
|
840
|
+
const t = n.split(`
|
|
841
|
+
`).map((e) => e.trim());
|
|
842
|
+
for (let e = B; e < Math.min(t.length, 6); e++) {
|
|
843
|
+
const i = t[e], r = i == null ? void 0 : i.match(/\(?([^):]+):(\d+):(\d+)\)?$/);
|
|
844
|
+
if (!r)
|
|
391
845
|
continue;
|
|
392
|
-
const
|
|
393
|
-
return { file:
|
|
846
|
+
const o = r[1] ?? "", s = r[2] ?? "0", m = r[3] ?? "0";
|
|
847
|
+
return { file: o.split(/[\\/]/).pop() || o, line: s, column: m };
|
|
394
848
|
}
|
|
395
849
|
return null;
|
|
396
|
-
}, V = /* @__PURE__ */ new Map(),
|
|
397
|
-
function
|
|
398
|
-
V.set(
|
|
399
|
-
let
|
|
400
|
-
return
|
|
850
|
+
}, V = /* @__PURE__ */ new Map(), M = /* @__PURE__ */ new Map();
|
|
851
|
+
function q(n, t, e) {
|
|
852
|
+
V.set(n, t);
|
|
853
|
+
let i = M.get(n);
|
|
854
|
+
return i || (i = W(
|
|
401
855
|
() => {
|
|
402
|
-
const
|
|
403
|
-
return
|
|
856
|
+
const r = V.get(n);
|
|
857
|
+
return r || (console.warn(`Transition "${String(n)}" not found`), {});
|
|
404
858
|
},
|
|
405
859
|
{
|
|
406
|
-
strategy:
|
|
407
|
-
onCleanupEnd: () =>
|
|
860
|
+
strategy: e,
|
|
861
|
+
onCleanupEnd: () => D(n)
|
|
408
862
|
}
|
|
409
|
-
),
|
|
863
|
+
), M.set(n, i), i);
|
|
410
864
|
}
|
|
411
|
-
function
|
|
412
|
-
V.delete(
|
|
865
|
+
function D(n) {
|
|
866
|
+
V.delete(n), M.delete(n);
|
|
413
867
|
}
|
|
414
|
-
function
|
|
415
|
-
const
|
|
416
|
-
return
|
|
868
|
+
function Y() {
|
|
869
|
+
const n = K(new Error().stack);
|
|
870
|
+
return n ? `auto_${n.file}_${n.line}_${n.column}` : Symbol(`ssgoi_auto_${Date.now()}`);
|
|
417
871
|
}
|
|
418
|
-
const
|
|
872
|
+
const U = globalThis.FinalizationRegistry, z = U ? new U((n) => {
|
|
419
873
|
try {
|
|
420
|
-
|
|
874
|
+
D(n);
|
|
421
875
|
} catch {
|
|
422
876
|
}
|
|
423
877
|
}) : void 0;
|
|
424
|
-
function
|
|
425
|
-
const t =
|
|
426
|
-
if (
|
|
878
|
+
function nt(n) {
|
|
879
|
+
const t = n.key ?? Y();
|
|
880
|
+
if (n.ref && z)
|
|
427
881
|
try {
|
|
428
|
-
|
|
882
|
+
z.register(n.ref, t);
|
|
429
883
|
} catch {
|
|
430
884
|
}
|
|
431
|
-
return
|
|
885
|
+
return q(
|
|
432
886
|
t,
|
|
433
887
|
{
|
|
434
|
-
in:
|
|
435
|
-
out:
|
|
888
|
+
in: n.in,
|
|
889
|
+
out: n.out
|
|
436
890
|
},
|
|
437
|
-
|
|
891
|
+
n[L]
|
|
438
892
|
);
|
|
439
893
|
}
|
|
440
|
-
const
|
|
441
|
-
let t =
|
|
894
|
+
const X = (n) => {
|
|
895
|
+
let t = n.parentElement;
|
|
442
896
|
for (; t && t !== document.body; ) {
|
|
443
|
-
const
|
|
444
|
-
if (
|
|
897
|
+
const e = window.getComputedStyle(t), i = e.overflow + e.overflowY + e.overflowX;
|
|
898
|
+
if (i.includes("auto") || i.includes("scroll") || t.scrollHeight > t.clientHeight || t.scrollWidth > t.clientWidth)
|
|
445
899
|
return t;
|
|
446
900
|
t = t.parentElement;
|
|
447
901
|
}
|
|
448
902
|
return document.documentElement;
|
|
449
|
-
},
|
|
450
|
-
let t =
|
|
903
|
+
}, G = (n) => {
|
|
904
|
+
let t = n.parentElement;
|
|
451
905
|
for (; t && t !== document.body; ) {
|
|
452
|
-
const
|
|
453
|
-
if (
|
|
906
|
+
const e = window.getComputedStyle(t).position;
|
|
907
|
+
if (e === "relative" || e === "absolute" || e === "fixed" || e === "sticky")
|
|
454
908
|
return t;
|
|
455
909
|
t = t.parentElement;
|
|
456
910
|
}
|
|
457
911
|
return document.body;
|
|
458
912
|
};
|
|
459
|
-
function
|
|
460
|
-
const t =
|
|
461
|
-
from:
|
|
462
|
-
to:
|
|
463
|
-
transition:
|
|
913
|
+
function J(n) {
|
|
914
|
+
const t = n.filter((e) => e.symmetric).map((e) => ({
|
|
915
|
+
from: e.to,
|
|
916
|
+
to: e.from,
|
|
917
|
+
transition: e.transition
|
|
464
918
|
}));
|
|
465
|
-
return [...
|
|
919
|
+
return [...n, ...t];
|
|
466
920
|
}
|
|
467
|
-
function
|
|
468
|
-
let
|
|
469
|
-
const
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
921
|
+
function Q(n) {
|
|
922
|
+
let t = !1, e = !1;
|
|
923
|
+
const i = (l) => {
|
|
924
|
+
if (!n) return;
|
|
925
|
+
const h = l.touches[0];
|
|
926
|
+
h && (e = h.clientX < 50);
|
|
927
|
+
}, r = () => {
|
|
928
|
+
n && (e && (t = !0, setTimeout(() => {
|
|
929
|
+
t = !1;
|
|
930
|
+
}, 500)), e = !1);
|
|
931
|
+
};
|
|
932
|
+
return {
|
|
933
|
+
initialize: () => {
|
|
934
|
+
typeof window > "u" || n && (window.addEventListener("touchstart", i, { passive: !0 }), window.addEventListener("touchend", r, { passive: !0 }));
|
|
935
|
+
},
|
|
936
|
+
cleanup: () => {
|
|
937
|
+
typeof window > "u" || (window.removeEventListener("touchstart", i), window.removeEventListener("touchend", r));
|
|
938
|
+
},
|
|
939
|
+
isSwipePending: () => t
|
|
940
|
+
};
|
|
941
|
+
}
|
|
942
|
+
function Z() {
|
|
943
|
+
let n = null, t = null;
|
|
944
|
+
const e = /* @__PURE__ */ new Map();
|
|
945
|
+
let i = null;
|
|
946
|
+
const r = () => {
|
|
947
|
+
n && i && e.set(i, {
|
|
948
|
+
x: n.scrollLeft,
|
|
949
|
+
y: n.scrollTop
|
|
475
950
|
});
|
|
476
951
|
};
|
|
477
952
|
return {
|
|
478
|
-
initializeContext: (
|
|
479
|
-
t =
|
|
953
|
+
initializeContext: (u, a) => {
|
|
954
|
+
t = u, n || (n = X(u), (n === document.documentElement ? window : n).addEventListener("scroll", r, {
|
|
480
955
|
passive: !0
|
|
481
|
-
})),
|
|
956
|
+
})), i = a;
|
|
482
957
|
},
|
|
483
|
-
calculateScrollOffset: (
|
|
484
|
-
const
|
|
958
|
+
calculateScrollOffset: (u, a) => {
|
|
959
|
+
const p = u && e.has(u) ? e.get(u) : { x: 0, y: 0 }, c = a && e.has(a) ? e.get(a) : { x: 0, y: 0 };
|
|
485
960
|
return {
|
|
486
|
-
x: -
|
|
487
|
-
y: -
|
|
961
|
+
x: -c.x + p.x,
|
|
962
|
+
y: -c.y + p.y
|
|
488
963
|
};
|
|
489
964
|
},
|
|
490
|
-
getScrollContainer: () =>
|
|
491
|
-
getPositionedParentElement: () => t ?
|
|
492
|
-
getScrollPosition: (
|
|
965
|
+
getScrollContainer: () => n,
|
|
966
|
+
getPositionedParentElement: () => t ? G(t) : document.body,
|
|
967
|
+
getScrollPosition: (u) => u && e.has(u) ? e.get(u) : { x: 0, y: 0 }
|
|
493
968
|
};
|
|
494
969
|
}
|
|
495
|
-
function
|
|
970
|
+
function ot(n) {
|
|
496
971
|
const {
|
|
497
972
|
transitions: t = [],
|
|
498
|
-
defaultTransition:
|
|
499
|
-
middleware:
|
|
973
|
+
defaultTransition: e,
|
|
974
|
+
middleware: i = (f, g) => ({ from: f, to: g }),
|
|
500
975
|
// Identity function as default
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
),
|
|
523
|
-
|
|
524
|
-
|
|
976
|
+
skipOnIosSwipe: r = !1
|
|
977
|
+
// Default to true - skip animations on iOS swipe
|
|
978
|
+
} = n;
|
|
979
|
+
let o = null;
|
|
980
|
+
const s = J(t), {
|
|
981
|
+
initializeContext: m,
|
|
982
|
+
calculateScrollOffset: l,
|
|
983
|
+
getScrollContainer: h,
|
|
984
|
+
getPositionedParentElement: u,
|
|
985
|
+
getScrollPosition: a
|
|
986
|
+
} = Z(), p = Q(r);
|
|
987
|
+
p.initialize();
|
|
988
|
+
function c() {
|
|
989
|
+
if (o != null && o.from && (o != null && o.to)) {
|
|
990
|
+
const { from: f, to: g } = i(
|
|
991
|
+
o.from,
|
|
992
|
+
o.to
|
|
993
|
+
), A = tt(
|
|
994
|
+
f,
|
|
995
|
+
g,
|
|
996
|
+
s
|
|
997
|
+
) || e, C = l(
|
|
998
|
+
o.from,
|
|
999
|
+
o.to
|
|
1000
|
+
), y = {
|
|
1001
|
+
scrollOffset: C,
|
|
1002
|
+
scroll: a(o.from),
|
|
525
1003
|
get scrollingElement() {
|
|
526
|
-
return
|
|
1004
|
+
return h() || document.documentElement;
|
|
527
1005
|
},
|
|
528
1006
|
get positionedParent() {
|
|
529
|
-
return
|
|
1007
|
+
return u();
|
|
530
1008
|
}
|
|
531
|
-
},
|
|
532
|
-
scrollOffset:
|
|
1009
|
+
}, b = {
|
|
1010
|
+
scrollOffset: C,
|
|
533
1011
|
get scroll() {
|
|
534
|
-
return
|
|
1012
|
+
return o ? a(o.to) : { x: 0, y: 0 };
|
|
535
1013
|
},
|
|
536
1014
|
get scrollingElement() {
|
|
537
|
-
return
|
|
1015
|
+
return h() || document.documentElement;
|
|
538
1016
|
},
|
|
539
1017
|
get positionedParent() {
|
|
540
|
-
return
|
|
1018
|
+
return u();
|
|
541
1019
|
}
|
|
542
1020
|
};
|
|
543
|
-
|
|
544
|
-
(
|
|
545
|
-
),
|
|
546
|
-
(
|
|
547
|
-
)),
|
|
1021
|
+
A && (A.out && o.outResolve && o.outResolve(
|
|
1022
|
+
(E) => A.out(E, y)
|
|
1023
|
+
), A.in && o.inResolve && o.inResolve(
|
|
1024
|
+
(E) => A.in(E, b)
|
|
1025
|
+
)), o = null;
|
|
548
1026
|
}
|
|
549
1027
|
}
|
|
550
|
-
const
|
|
551
|
-
|
|
552
|
-
})) : (
|
|
553
|
-
|
|
1028
|
+
const S = async (f, g) => p.isSwipePending() ? () => ({}) : g === "in" && (!o || !o.from) ? () => ({}) : (o || (o = {}), g === "out" ? (o.from = f, new Promise((v) => {
|
|
1029
|
+
o.outResolve = v, c();
|
|
1030
|
+
})) : (o.to = f, new Promise((v) => {
|
|
1031
|
+
o.inResolve = v, c();
|
|
554
1032
|
})));
|
|
555
|
-
return (
|
|
556
|
-
key:
|
|
557
|
-
in: async (
|
|
558
|
-
out: async (
|
|
1033
|
+
return (f) => ({
|
|
1034
|
+
key: f,
|
|
1035
|
+
in: async (g) => (m(g, f), (await S(f, "in"))(g)),
|
|
1036
|
+
out: async (g) => (await S(f, "out"))(g),
|
|
559
1037
|
// Add page transition strategy for page-level transitions
|
|
560
|
-
[
|
|
1038
|
+
[L]: H
|
|
561
1039
|
});
|
|
562
1040
|
}
|
|
563
|
-
function
|
|
564
|
-
for (const
|
|
565
|
-
if (
|
|
566
|
-
return
|
|
567
|
-
for (const
|
|
568
|
-
if ((
|
|
569
|
-
return
|
|
1041
|
+
function tt(n, t, e) {
|
|
1042
|
+
for (const i of e)
|
|
1043
|
+
if (P(n, i.from) && P(t, i.to))
|
|
1044
|
+
return i.transition;
|
|
1045
|
+
for (const i of e)
|
|
1046
|
+
if ((i.from === "*" || P(n, i.from)) && (i.to === "*" || P(t, i.to)))
|
|
1047
|
+
return i.transition;
|
|
570
1048
|
return null;
|
|
571
1049
|
}
|
|
572
|
-
function
|
|
1050
|
+
function P(n, t) {
|
|
573
1051
|
if (t === "*")
|
|
574
1052
|
return !0;
|
|
575
1053
|
if (t.endsWith("/*")) {
|
|
576
|
-
const
|
|
577
|
-
return
|
|
1054
|
+
const e = t.slice(0, -2);
|
|
1055
|
+
return n === e || n.startsWith(e + "/");
|
|
578
1056
|
}
|
|
579
|
-
return
|
|
1057
|
+
return n === t;
|
|
580
1058
|
}
|
|
581
1059
|
export {
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
1060
|
+
L as TRANSITION_STRATEGY,
|
|
1061
|
+
N as createDefaultStrategy,
|
|
1062
|
+
H as createPageTransitionStrategy,
|
|
1063
|
+
ot as createSggoiTransitionContext,
|
|
1064
|
+
Y as generateAutoKey,
|
|
1065
|
+
R as isMultiSpring,
|
|
1066
|
+
at as isSingleSpring,
|
|
1067
|
+
lt as jaeminInternal,
|
|
1068
|
+
nt as transition
|
|
588
1069
|
};
|