@ssgoi/core 3.0.0 → 3.1.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/index.cjs +2 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +405 -385
- package/dist/transition/create-transition-callback.d.ts +2 -1
- package/dist/transition/create-transition-callback.d.ts.map +1 -1
- package/dist/transition/transition-scope.d.ts +36 -0
- package/dist/transition/transition-scope.d.ts.map +1 -0
- package/dist/transition/transition-strategy.d.ts +3 -3
- package/dist/transition/transition-strategy.d.ts.map +1 -1
- package/dist/transition/transition.d.ts.map +1 -1
- package/dist/types.cjs +1 -1
- package/dist/types.d.ts +14 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +30 -29
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var d = (
|
|
4
|
-
import { normalizeToMultiSpring as
|
|
5
|
-
import { isCssAnimation as
|
|
6
|
-
import { j as
|
|
7
|
-
class
|
|
1
|
+
var K = Object.defineProperty;
|
|
2
|
+
var U = (n, e, t) => e in n ? K(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
3
|
+
var d = (n, e, t) => U(n, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { normalizeToMultiSpring as k, normalizeMultiSpringSchedule as F } from "./types.js";
|
|
5
|
+
import { isCssAnimation as kt, isMultiSpring as Vt, isSingleSpring as bt, isTickAnimation as Rt, validateAnimationMode as It, validateSpringItem as Pt } from "./types.js";
|
|
6
|
+
import { j as Mt } from "./jaemin-BWkrXq0V.js";
|
|
7
|
+
class G {
|
|
8
8
|
constructor() {
|
|
9
9
|
d(this, "listeners", /* @__PURE__ */ new Set());
|
|
10
10
|
d(this, "rafId", null);
|
|
@@ -25,12 +25,12 @@ class W {
|
|
|
25
25
|
// max 240fps
|
|
26
26
|
d(this, "nextTime", this.gap);
|
|
27
27
|
d(this, "tick", () => {
|
|
28
|
-
const
|
|
29
|
-
let
|
|
30
|
-
|
|
31
|
-
const r =
|
|
28
|
+
const e = Date.now();
|
|
29
|
+
let i = e - this.lastUpdate;
|
|
30
|
+
i > this.lagThreshold || i < 0 ? (this.startTime += i - this.adjustedLag, i = this.adjustedLag) : i > this.maxDeltaTime && (i = this.maxDeltaTime), this.lastUpdate = e;
|
|
31
|
+
const r = e - this.startTime, o = r - this.nextTime;
|
|
32
32
|
if (o > 0) {
|
|
33
|
-
const s =
|
|
33
|
+
const s = i / 1e3;
|
|
34
34
|
this.elapsed = r / 1e3, this.nextTime += o + (o >= this.gap ? 4 : this.gap - o), this.listeners.forEach((a) => {
|
|
35
35
|
a(s, this.elapsed);
|
|
36
36
|
});
|
|
@@ -38,28 +38,28 @@ class W {
|
|
|
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(e) {
|
|
42
|
+
return this.listeners.add(e), this.isRunning || (this.isRunning = !0, this.rafId = requestAnimationFrame(this.tick)), () => {
|
|
43
|
+
this.unsubscribe(e);
|
|
44
44
|
};
|
|
45
45
|
}
|
|
46
|
-
unsubscribe(
|
|
47
|
-
this.listeners.delete(
|
|
46
|
+
unsubscribe(e) {
|
|
47
|
+
this.listeners.delete(e), 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(e, t) {
|
|
55
|
+
this.lagThreshold = e, this.adjustedLag = Math.min(t, e);
|
|
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(e) {
|
|
62
|
+
this.gap = 1e3 / e, this.nextTime = this.elapsed * 1e3 + this.gap;
|
|
63
63
|
}
|
|
64
64
|
getListenerCount() {
|
|
65
65
|
return this.listeners.size;
|
|
@@ -68,71 +68,71 @@ class W {
|
|
|
68
68
|
return this.elapsed;
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
|
-
const P = new
|
|
72
|
-
function z(
|
|
73
|
-
const
|
|
71
|
+
const P = new G();
|
|
72
|
+
function z(n) {
|
|
73
|
+
const e = n.stiffness, t = n.damping, i = 1, r = Math.sqrt(e / i), o = t / (2 * Math.sqrt(e * i));
|
|
74
74
|
return { omega: r, zeta: o };
|
|
75
75
|
}
|
|
76
|
-
function
|
|
77
|
-
const { omega: r, zeta: o } = t, { position: s, velocity: a } =
|
|
76
|
+
function q(n, e, t, i) {
|
|
77
|
+
const { omega: r, zeta: o } = t, { position: s, velocity: a } = n, c = Math.min(i, 0.033), l = -2 * c * o * r * a, f = c * r * r * (e - s), w = a + l + f;
|
|
78
78
|
return {
|
|
79
|
-
position: s + c *
|
|
80
|
-
velocity:
|
|
79
|
+
position: s + c * w,
|
|
80
|
+
velocity: w
|
|
81
81
|
};
|
|
82
82
|
}
|
|
83
|
-
const
|
|
84
|
-
function N(
|
|
85
|
-
const t = Math.abs(
|
|
86
|
-
return t <
|
|
83
|
+
const B = 0.01, J = 0.01, H = 0.05;
|
|
84
|
+
function N(n, e) {
|
|
85
|
+
const t = Math.abs(e - n.position), i = Math.abs(n.velocity);
|
|
86
|
+
return t < B && i < J;
|
|
87
87
|
}
|
|
88
|
-
function
|
|
88
|
+
function Q(n) {
|
|
89
89
|
const {
|
|
90
|
-
from:
|
|
90
|
+
from: e,
|
|
91
91
|
to: t,
|
|
92
|
-
spring:
|
|
92
|
+
spring: i,
|
|
93
93
|
velocity: r = 0,
|
|
94
94
|
onUpdate: o,
|
|
95
95
|
onComplete: s,
|
|
96
96
|
onStart: a
|
|
97
|
-
} =
|
|
98
|
-
let c = { position:
|
|
99
|
-
const
|
|
100
|
-
if (
|
|
101
|
-
if (
|
|
102
|
-
if (
|
|
103
|
-
c = { position: t, velocity: 0 },
|
|
97
|
+
} = n;
|
|
98
|
+
let c = { position: e, velocity: r }, l = !0, f = 0, w = !1;
|
|
99
|
+
const u = z(i), h = (p) => {
|
|
100
|
+
if (l) {
|
|
101
|
+
if (w || (w = !0, a == null || a()), c = q(c, t, u, p), N(c, t)) {
|
|
102
|
+
if (f += Math.min(p, 0.033), f >= H) {
|
|
103
|
+
c = { position: t, velocity: 0 }, l = !1, o(c.position), P.unsubscribe(h), s();
|
|
104
104
|
return;
|
|
105
105
|
}
|
|
106
106
|
} else
|
|
107
|
-
|
|
107
|
+
f = 0;
|
|
108
108
|
o(c.position);
|
|
109
109
|
}
|
|
110
110
|
};
|
|
111
|
-
return P.subscribe(
|
|
111
|
+
return P.subscribe(h), {
|
|
112
112
|
stop: () => {
|
|
113
|
-
|
|
113
|
+
l && (l = !1, P.unsubscribe(h));
|
|
114
114
|
},
|
|
115
115
|
getPosition: () => c.position,
|
|
116
116
|
getVelocity: () => c.velocity,
|
|
117
|
-
isRunning: () =>
|
|
117
|
+
isRunning: () => l
|
|
118
118
|
};
|
|
119
119
|
}
|
|
120
|
-
const
|
|
121
|
-
function
|
|
120
|
+
const V = 1e3 / 60;
|
|
121
|
+
function Z(n, e, t, i = 0) {
|
|
122
122
|
const r = z(t), o = 600;
|
|
123
|
-
let s = { position:
|
|
123
|
+
let s = { position: n, velocity: i }, a = 0;
|
|
124
124
|
const c = [];
|
|
125
|
-
for (let
|
|
126
|
-
const
|
|
125
|
+
for (let l = 0; l < o; l++) {
|
|
126
|
+
const f = l * V;
|
|
127
127
|
if (c.push({
|
|
128
|
-
time:
|
|
128
|
+
time: f,
|
|
129
129
|
position: s.position,
|
|
130
130
|
velocity: s.velocity
|
|
131
|
-
}), s =
|
|
132
|
-
if (a +=
|
|
131
|
+
}), s = q(s, e, r, V / 1e3), N(s, e)) {
|
|
132
|
+
if (a += V / 1e3, a >= H) {
|
|
133
133
|
c.push({
|
|
134
|
-
time: (
|
|
135
|
-
position:
|
|
134
|
+
time: (l + 1) * V,
|
|
135
|
+
position: e,
|
|
136
136
|
velocity: 0
|
|
137
137
|
});
|
|
138
138
|
break;
|
|
@@ -142,78 +142,78 @@ function B(i, n, t, e = 0) {
|
|
|
142
142
|
}
|
|
143
143
|
return c;
|
|
144
144
|
}
|
|
145
|
-
function
|
|
146
|
-
if (
|
|
145
|
+
function D(n, e) {
|
|
146
|
+
if (n.length === 0)
|
|
147
147
|
return { position: 0, velocity: 0 };
|
|
148
|
-
const t =
|
|
149
|
-
if (
|
|
148
|
+
const t = n[0], i = n[n.length - 1];
|
|
149
|
+
if (e <= 0)
|
|
150
150
|
return { position: t.position, velocity: t.velocity };
|
|
151
|
-
if (
|
|
152
|
-
return { position:
|
|
153
|
-
let r = 0, o =
|
|
151
|
+
if (e >= i.time)
|
|
152
|
+
return { position: i.position, velocity: i.velocity };
|
|
153
|
+
let r = 0, o = n.length - 1;
|
|
154
154
|
for (; r < o - 1; ) {
|
|
155
|
-
const
|
|
156
|
-
|
|
155
|
+
const l = Math.floor((r + o) / 2);
|
|
156
|
+
n[l].time <= e ? r = l : o = l;
|
|
157
157
|
}
|
|
158
|
-
const s =
|
|
158
|
+
const s = n[r], a = n[o], c = (e - s.time) / (a.time - s.time);
|
|
159
159
|
return {
|
|
160
160
|
position: s.position + (a.position - s.position) * c,
|
|
161
161
|
velocity: s.velocity + (a.velocity - s.velocity) * c
|
|
162
162
|
};
|
|
163
163
|
}
|
|
164
|
-
function
|
|
165
|
-
return
|
|
164
|
+
function tt(n, e) {
|
|
165
|
+
return n.map((t) => e(t.position));
|
|
166
166
|
}
|
|
167
|
-
function
|
|
167
|
+
function et(n) {
|
|
168
168
|
const {
|
|
169
|
-
element:
|
|
169
|
+
element: e,
|
|
170
170
|
from: t,
|
|
171
|
-
to:
|
|
171
|
+
to: i,
|
|
172
172
|
spring: r,
|
|
173
173
|
velocity: o = 0,
|
|
174
174
|
style: s,
|
|
175
175
|
onComplete: a,
|
|
176
176
|
onStart: c
|
|
177
|
-
} =
|
|
178
|
-
if (
|
|
177
|
+
} = n, l = Z(t, i, r, o);
|
|
178
|
+
if (l.length === 0)
|
|
179
179
|
return c == null || c(), a(), {
|
|
180
180
|
stop: () => {
|
|
181
181
|
},
|
|
182
|
-
getPosition: () =>
|
|
182
|
+
getPosition: () => i,
|
|
183
183
|
getVelocity: () => 0,
|
|
184
184
|
isRunning: () => !1
|
|
185
185
|
};
|
|
186
|
-
const
|
|
187
|
-
duration:
|
|
186
|
+
const f = tt(l, s), w = l[l.length - 1], u = w.time, h = e.animate(f, {
|
|
187
|
+
duration: u,
|
|
188
188
|
fill: "forwards",
|
|
189
189
|
easing: "linear"
|
|
190
190
|
// Spring physics already applied in keyframes
|
|
191
191
|
});
|
|
192
192
|
let p = !0;
|
|
193
|
-
const
|
|
194
|
-
return c == null || c(),
|
|
193
|
+
const v = performance.now();
|
|
194
|
+
return c == null || c(), h.onfinish = () => {
|
|
195
195
|
p && (p = !1, a());
|
|
196
196
|
}, {
|
|
197
197
|
stop: () => {
|
|
198
|
-
p && (p = !1,
|
|
198
|
+
p && (p = !1, h.cancel());
|
|
199
199
|
},
|
|
200
200
|
getPosition: () => {
|
|
201
201
|
if (!p)
|
|
202
|
-
return
|
|
203
|
-
const
|
|
204
|
-
return
|
|
202
|
+
return w.position;
|
|
203
|
+
const y = performance.now() - v;
|
|
204
|
+
return D(l, y).position;
|
|
205
205
|
},
|
|
206
206
|
getVelocity: () => {
|
|
207
207
|
if (!p)
|
|
208
208
|
return 0;
|
|
209
|
-
const
|
|
210
|
-
return
|
|
209
|
+
const y = performance.now() - v;
|
|
210
|
+
return D(l, y).velocity;
|
|
211
211
|
},
|
|
212
212
|
isRunning: () => p
|
|
213
213
|
};
|
|
214
214
|
}
|
|
215
|
-
function
|
|
216
|
-
const { from:
|
|
215
|
+
function it(n) {
|
|
216
|
+
const { from: e, to: t, spring: i, velocity: r, onComplete: o, onStart: s, tick: a, css: c } = n;
|
|
217
217
|
if (a && c)
|
|
218
218
|
throw new Error("Cannot use both 'tick' and 'css' options together");
|
|
219
219
|
return !a && !c ? (s == null || s(), o(), {
|
|
@@ -222,28 +222,28 @@ function Z(i) {
|
|
|
222
222
|
getPosition: () => t,
|
|
223
223
|
getVelocity: () => 0,
|
|
224
224
|
isRunning: () => !1
|
|
225
|
-
}) : c ?
|
|
225
|
+
}) : c ? et({
|
|
226
226
|
element: c.element,
|
|
227
|
-
from:
|
|
227
|
+
from: e,
|
|
228
228
|
to: t,
|
|
229
|
-
spring:
|
|
229
|
+
spring: i,
|
|
230
230
|
velocity: r,
|
|
231
231
|
style: c.style,
|
|
232
232
|
onComplete: o,
|
|
233
233
|
onStart: s
|
|
234
|
-
}) :
|
|
235
|
-
from:
|
|
234
|
+
}) : Q({
|
|
235
|
+
from: e,
|
|
236
236
|
to: t,
|
|
237
|
-
spring:
|
|
237
|
+
spring: i,
|
|
238
238
|
velocity: r,
|
|
239
239
|
onUpdate: a,
|
|
240
240
|
onComplete: o,
|
|
241
241
|
onStart: s
|
|
242
242
|
});
|
|
243
243
|
}
|
|
244
|
-
class
|
|
244
|
+
class Y {
|
|
245
245
|
}
|
|
246
|
-
class
|
|
246
|
+
class R extends Y {
|
|
247
247
|
constructor(t) {
|
|
248
248
|
super();
|
|
249
249
|
d(this, "options");
|
|
@@ -265,7 +265,7 @@ class I extends X {
|
|
|
265
265
|
}, this.currentValue = this.options.from;
|
|
266
266
|
}
|
|
267
267
|
runAnimation(t) {
|
|
268
|
-
this.isAnimating = !0, this.controls =
|
|
268
|
+
this.isAnimating = !0, this.controls = it({
|
|
269
269
|
from: this.currentValue,
|
|
270
270
|
to: t,
|
|
271
271
|
spring: this.options.spring,
|
|
@@ -319,12 +319,12 @@ class I extends X {
|
|
|
319
319
|
updateOptions(t) {
|
|
320
320
|
this.options = { ...this.options, ...t };
|
|
321
321
|
}
|
|
322
|
-
static fromState(t,
|
|
323
|
-
const r = new
|
|
322
|
+
static fromState(t, i) {
|
|
323
|
+
const r = new R(i);
|
|
324
324
|
return r.setValue(t.position), r.setVelocity(t.velocity), r;
|
|
325
325
|
}
|
|
326
326
|
}
|
|
327
|
-
class
|
|
327
|
+
class I extends Y {
|
|
328
328
|
constructor(t) {
|
|
329
329
|
super();
|
|
330
330
|
d(this, "config");
|
|
@@ -345,21 +345,21 @@ class x extends X {
|
|
|
345
345
|
}
|
|
346
346
|
initializeAnimators() {
|
|
347
347
|
this.config.springs.forEach((t) => {
|
|
348
|
-
const
|
|
348
|
+
const i = this.generateId(), r = new R({
|
|
349
349
|
from: this.from,
|
|
350
350
|
to: this.to,
|
|
351
351
|
spring: t.spring,
|
|
352
352
|
tick: t.tick,
|
|
353
353
|
css: t.css && this.element ? { element: this.element, style: t.css } : void 0,
|
|
354
|
-
onComplete: () => this.onAnimatorComplete(
|
|
354
|
+
onComplete: () => this.onAnimatorComplete(i),
|
|
355
355
|
onStart: t.onStart
|
|
356
356
|
});
|
|
357
|
-
this.animators.set(
|
|
358
|
-
id:
|
|
357
|
+
this.animators.set(i, {
|
|
358
|
+
id: i,
|
|
359
359
|
item: t,
|
|
360
360
|
animator: r,
|
|
361
361
|
started: !1
|
|
362
|
-
}), this.springOrder.push(
|
|
362
|
+
}), this.springOrder.push(i);
|
|
363
363
|
});
|
|
364
364
|
}
|
|
365
365
|
/**
|
|
@@ -367,8 +367,8 @@ class x extends X {
|
|
|
367
367
|
* Progress = |position - from| / |to - from|
|
|
368
368
|
*/
|
|
369
369
|
getAnimatorProgress(t) {
|
|
370
|
-
const
|
|
371
|
-
return r === 0 ? 1 : Math.abs(
|
|
370
|
+
const i = t.animator.getCurrentState(), r = Math.abs(i.to - i.from);
|
|
371
|
+
return r === 0 ? 1 : Math.abs(i.position - i.from) / r;
|
|
372
372
|
}
|
|
373
373
|
/**
|
|
374
374
|
* Get order of springs based on direction
|
|
@@ -379,9 +379,9 @@ class x extends X {
|
|
|
379
379
|
return this.direction === "forward" ? this.springOrder : [...this.springOrder].reverse();
|
|
380
380
|
}
|
|
381
381
|
onAnimatorComplete(t) {
|
|
382
|
-
var r, o, s, a, c,
|
|
383
|
-
const
|
|
384
|
-
!
|
|
382
|
+
var r, o, s, a, c, l;
|
|
383
|
+
const i = this.animators.get(t);
|
|
384
|
+
!i || this.completedAnimators.has(t) || (this.completedAnimators.add(t), this.completedCount++, (o = (r = i.item).onComplete) == null || o.call(r), (a = (s = this.config).onProgress) == null || a.call(s, this.completedCount, this.config.springs.length), this.completedCount === this.config.springs.length && (this.stopScheduler(), (l = (c = this.config).onEnd) == null || l.call(c)));
|
|
385
385
|
}
|
|
386
386
|
/**
|
|
387
387
|
* Check and start springs based on previous spring's progress
|
|
@@ -389,22 +389,22 @@ class x extends X {
|
|
|
389
389
|
*/
|
|
390
390
|
checkAndStartSprings() {
|
|
391
391
|
const t = this.getOrderedIds();
|
|
392
|
-
for (let
|
|
393
|
-
const r = t[
|
|
392
|
+
for (let i = 0; i < t.length; i++) {
|
|
393
|
+
const r = t[i], o = this.animators.get(r);
|
|
394
394
|
if (!o || o.started) continue;
|
|
395
|
-
if (
|
|
395
|
+
if (i === 0) {
|
|
396
396
|
this.startAnimator(r);
|
|
397
397
|
continue;
|
|
398
398
|
}
|
|
399
|
-
const s = t[
|
|
399
|
+
const s = t[i - 1], a = this.animators.get(s);
|
|
400
400
|
if (!a || !a.started) continue;
|
|
401
|
-
const c = this.getAnimatorProgress(a),
|
|
402
|
-
c >=
|
|
401
|
+
const c = this.getAnimatorProgress(a), l = o.item.normalizedOffset;
|
|
402
|
+
c >= l && this.startAnimator(r);
|
|
403
403
|
}
|
|
404
404
|
}
|
|
405
405
|
startAnimator(t) {
|
|
406
|
-
const
|
|
407
|
-
!
|
|
406
|
+
const i = this.animators.get(t);
|
|
407
|
+
!i || i.started || (i.started = !0, this.direction === "forward" ? i.animator.forward() : i.animator.backward());
|
|
408
408
|
}
|
|
409
409
|
/**
|
|
410
410
|
* Start the scheduler loop that checks spring progress
|
|
@@ -413,23 +413,23 @@ class x extends X {
|
|
|
413
413
|
const t = () => {
|
|
414
414
|
this.checkAndStartSprings(), this.getIsAnimating() && (this.rafId = requestAnimationFrame(t));
|
|
415
415
|
};
|
|
416
|
-
|
|
416
|
+
t();
|
|
417
417
|
}
|
|
418
418
|
stopScheduler() {
|
|
419
419
|
this.rafId !== null && (cancelAnimationFrame(this.rafId), this.rafId = null);
|
|
420
420
|
}
|
|
421
421
|
getFirstAnimator() {
|
|
422
|
-
var
|
|
422
|
+
var i;
|
|
423
423
|
const t = this.springOrder[0];
|
|
424
|
-
return t ? ((
|
|
424
|
+
return t ? ((i = this.animators.get(t)) == null ? void 0 : i.animator) ?? null : null;
|
|
425
425
|
}
|
|
426
426
|
forward() {
|
|
427
|
-
var t,
|
|
428
|
-
this.stop(), this.direction = "forward", this.completedCount = 0, this.completedAnimators.clear(), this.resetStartedFlags(), (
|
|
427
|
+
var t, i;
|
|
428
|
+
this.stop(), this.direction = "forward", this.completedCount = 0, this.completedAnimators.clear(), this.resetStartedFlags(), (i = (t = this.config).onStart) == null || i.call(t), this.startScheduler();
|
|
429
429
|
}
|
|
430
430
|
backward() {
|
|
431
|
-
var t,
|
|
432
|
-
this.stop(), this.direction = "backward", this.completedCount = 0, this.completedAnimators.clear(), this.resetStartedFlags(), (
|
|
431
|
+
var t, i;
|
|
432
|
+
this.stop(), this.direction = "backward", this.completedCount = 0, this.completedAnimators.clear(), this.resetStartedFlags(), (i = (t = this.config).onStart) == null || i.call(t), this.startScheduler();
|
|
433
433
|
}
|
|
434
434
|
resetStartedFlags() {
|
|
435
435
|
this.animators.forEach((t) => {
|
|
@@ -445,9 +445,9 @@ class x extends X {
|
|
|
445
445
|
this.direction = this.direction === "forward" ? "backward" : "forward", this.animators.forEach((t) => {
|
|
446
446
|
if (!t.started)
|
|
447
447
|
return;
|
|
448
|
-
const
|
|
449
|
-
if (
|
|
450
|
-
const o = t.item.css && this.element ? { element: this.element, style: t.item.css } : void 0, s =
|
|
448
|
+
const i = t.animator.getCurrentState();
|
|
449
|
+
if (i.position === i.to) {
|
|
450
|
+
const o = t.item.css && this.element ? { element: this.element, style: t.item.css } : void 0, s = R.fromState(
|
|
451
451
|
{ position: this.to, velocity: 0 },
|
|
452
452
|
{
|
|
453
453
|
from: this.to,
|
|
@@ -492,16 +492,16 @@ class x extends X {
|
|
|
492
492
|
* TODO: Support per-spring control
|
|
493
493
|
*/
|
|
494
494
|
setValue(t) {
|
|
495
|
-
const
|
|
496
|
-
|
|
495
|
+
const i = this.getFirstAnimator();
|
|
496
|
+
i == null || i.setValue(t);
|
|
497
497
|
}
|
|
498
498
|
/**
|
|
499
499
|
* Set velocity on first animator
|
|
500
500
|
* TODO: Support per-spring control
|
|
501
501
|
*/
|
|
502
502
|
setVelocity(t) {
|
|
503
|
-
const
|
|
504
|
-
|
|
503
|
+
const i = this.getFirstAnimator();
|
|
504
|
+
i == null || i.setVelocity(t);
|
|
505
505
|
}
|
|
506
506
|
/**
|
|
507
507
|
* Check if any animation is currently running
|
|
@@ -516,19 +516,19 @@ class x extends X {
|
|
|
516
516
|
* Create MultiAnimator from existing state
|
|
517
517
|
* Uses first animator's state for initialization
|
|
518
518
|
*/
|
|
519
|
-
static fromState(t,
|
|
520
|
-
const r = new
|
|
519
|
+
static fromState(t, i) {
|
|
520
|
+
const r = new I(i);
|
|
521
521
|
return r.setValue(t.position), r.setVelocity(t.velocity), r;
|
|
522
522
|
}
|
|
523
523
|
}
|
|
524
|
-
const
|
|
525
|
-
runIn: async (
|
|
526
|
-
const { currentAnimation: t } =
|
|
524
|
+
const X = Symbol.for("TRANSITION_STRATEGY"), nt = (n) => ({
|
|
525
|
+
runIn: async (e) => {
|
|
526
|
+
const { currentAnimation: t } = n;
|
|
527
527
|
if (t && t.direction === "out") {
|
|
528
528
|
const r = t.controller.getCurrentValue(), o = t.controller.getVelocity();
|
|
529
|
-
if (t.controller.stop(),
|
|
529
|
+
if (t.controller.stop(), e.out)
|
|
530
530
|
return {
|
|
531
|
-
config:
|
|
531
|
+
config: await e.out,
|
|
532
532
|
state: { position: r, velocity: o },
|
|
533
533
|
from: 1,
|
|
534
534
|
to: 0,
|
|
@@ -536,9 +536,8 @@ const Y = Symbol.for("TRANSITION_STRATEGY"), tt = (i) => ({
|
|
|
536
536
|
// Will actually go 0→1 (backward means toward 'from')
|
|
537
537
|
};
|
|
538
538
|
}
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
config: e,
|
|
539
|
+
return e.in ? {
|
|
540
|
+
config: await e.in,
|
|
542
541
|
state: {
|
|
543
542
|
position: 0,
|
|
544
543
|
velocity: 0
|
|
@@ -556,13 +555,13 @@ const Y = Symbol.for("TRANSITION_STRATEGY"), tt = (i) => ({
|
|
|
556
555
|
direction: "forward"
|
|
557
556
|
};
|
|
558
557
|
},
|
|
559
|
-
runOut: async (
|
|
560
|
-
const { currentAnimation: t } =
|
|
558
|
+
runOut: async (e) => {
|
|
559
|
+
const { currentAnimation: t } = n;
|
|
561
560
|
if (t && t.direction === "in") {
|
|
562
561
|
const r = t.controller.getCurrentValue(), o = t.controller.getVelocity();
|
|
563
|
-
if (t.controller.stop(),
|
|
562
|
+
if (t.controller.stop(), e.in)
|
|
564
563
|
return {
|
|
565
|
-
config:
|
|
564
|
+
config: await e.in,
|
|
566
565
|
state: { position: r, velocity: o },
|
|
567
566
|
from: 0,
|
|
568
567
|
to: 1,
|
|
@@ -570,9 +569,8 @@ const Y = Symbol.for("TRANSITION_STRATEGY"), tt = (i) => ({
|
|
|
570
569
|
// Will actually go 1→0 (backward means toward 'from')
|
|
571
570
|
};
|
|
572
571
|
}
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
config: e,
|
|
572
|
+
return e.out ? {
|
|
573
|
+
config: await e.out,
|
|
576
574
|
state: {
|
|
577
575
|
position: 1,
|
|
578
576
|
velocity: 0
|
|
@@ -590,376 +588,398 @@ const Y = Symbol.for("TRANSITION_STRATEGY"), tt = (i) => ({
|
|
|
590
588
|
direction: "forward"
|
|
591
589
|
};
|
|
592
590
|
}
|
|
593
|
-
}),
|
|
594
|
-
runIn: async (
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
to: 1,
|
|
612
|
-
direction: "forward"
|
|
613
|
-
};
|
|
591
|
+
}), ot = () => ({
|
|
592
|
+
runIn: async (n) => n.in ? {
|
|
593
|
+
config: await n.in,
|
|
594
|
+
state: {
|
|
595
|
+
position: 0,
|
|
596
|
+
velocity: 0
|
|
597
|
+
},
|
|
598
|
+
from: 0,
|
|
599
|
+
to: 1,
|
|
600
|
+
direction: "forward"
|
|
601
|
+
} : {
|
|
602
|
+
state: {
|
|
603
|
+
position: 0,
|
|
604
|
+
velocity: 0
|
|
605
|
+
},
|
|
606
|
+
from: 0,
|
|
607
|
+
to: 1,
|
|
608
|
+
direction: "forward"
|
|
614
609
|
},
|
|
615
|
-
runOut: async (
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
610
|
+
runOut: async (n) => n.out ? {
|
|
611
|
+
config: await n.out,
|
|
612
|
+
state: {
|
|
613
|
+
position: 1,
|
|
614
|
+
velocity: 0
|
|
615
|
+
},
|
|
616
|
+
from: 1,
|
|
617
|
+
to: 0,
|
|
618
|
+
direction: "forward"
|
|
619
|
+
} : {
|
|
620
|
+
state: {
|
|
621
|
+
position: 1,
|
|
622
|
+
velocity: 0
|
|
623
|
+
},
|
|
624
|
+
from: 1,
|
|
625
|
+
to: 0,
|
|
626
|
+
direction: "forward"
|
|
627
|
+
}
|
|
628
|
+
}), $ = "data-ssgoi-scope", j = "data-ssgoi-scope-ready";
|
|
629
|
+
function St() {
|
|
630
|
+
return (n) => {
|
|
631
|
+
if (n)
|
|
632
|
+
return n.setAttribute($, ""), queueMicrotask(() => {
|
|
633
|
+
queueMicrotask(() => {
|
|
634
|
+
n.setAttribute(j, "true");
|
|
635
|
+
});
|
|
636
|
+
}), () => {
|
|
637
|
+
};
|
|
638
|
+
};
|
|
639
|
+
}
|
|
640
|
+
function rt(n) {
|
|
641
|
+
return n.hasAttribute(j);
|
|
642
|
+
}
|
|
643
|
+
function st(n) {
|
|
644
|
+
return n.closest(`[${$}]`);
|
|
645
|
+
}
|
|
646
|
+
function ct(n, e) {
|
|
647
|
+
var w;
|
|
648
|
+
let t = null, i = null, r = null, o = null;
|
|
640
649
|
const s = {
|
|
641
650
|
get currentAnimation() {
|
|
642
651
|
return t;
|
|
643
652
|
}
|
|
644
|
-
}, a = ((
|
|
645
|
-
var
|
|
646
|
-
|
|
647
|
-
const
|
|
648
|
-
if (!
|
|
653
|
+
}, a = ((w = e == null ? void 0 : e.strategy) == null ? void 0 : w.call(e, s)) || nt(s), c = async (u) => {
|
|
654
|
+
var E;
|
|
655
|
+
i && (i.remove(), i = null);
|
|
656
|
+
const h = n(), p = h.in && h.in(u), v = !(e != null && e.strategy) && h.out ? h.out(u) : void 0;
|
|
657
|
+
if (!p)
|
|
649
658
|
return;
|
|
650
659
|
const y = {
|
|
651
|
-
in:
|
|
652
|
-
out:
|
|
660
|
+
in: k(p),
|
|
661
|
+
out: v ? k(v) : void 0
|
|
653
662
|
}, m = await a.runIn(y);
|
|
654
663
|
if (!m.config) {
|
|
655
664
|
t && (t.direction = "in");
|
|
656
665
|
return;
|
|
657
666
|
}
|
|
658
|
-
const
|
|
659
|
-
(
|
|
660
|
-
const
|
|
661
|
-
...
|
|
667
|
+
const g = m.config;
|
|
668
|
+
(E = g.prepare) == null || E.call(g, u), g.wait && await g.wait();
|
|
669
|
+
const C = F({
|
|
670
|
+
...g,
|
|
662
671
|
onEnd: () => {
|
|
663
672
|
var A;
|
|
664
|
-
t = null, (A =
|
|
673
|
+
t = null, (A = g.onEnd) == null || A.call(g);
|
|
665
674
|
}
|
|
666
|
-
}),
|
|
667
|
-
config:
|
|
675
|
+
}), S = I.fromState(m.state, {
|
|
676
|
+
config: C,
|
|
668
677
|
from: m.from,
|
|
669
678
|
to: m.to,
|
|
670
|
-
element:
|
|
679
|
+
element: u
|
|
671
680
|
});
|
|
672
|
-
t = { controller:
|
|
673
|
-
},
|
|
681
|
+
t = { controller: S, direction: "in" }, m.direction === "forward" ? S.forward() : S.backward();
|
|
682
|
+
}, l = async (u) => {
|
|
674
683
|
var A;
|
|
675
|
-
|
|
676
|
-
const
|
|
677
|
-
if (!
|
|
684
|
+
i = u;
|
|
685
|
+
const h = n(), p = !(e != null && e.strategy) && h.in ? h.in(u) : void 0, v = h.out && h.out(u);
|
|
686
|
+
if (!v)
|
|
678
687
|
return;
|
|
679
688
|
const y = {
|
|
680
|
-
in:
|
|
681
|
-
out:
|
|
689
|
+
in: p ? k(p) : void 0,
|
|
690
|
+
out: k(v)
|
|
682
691
|
}, m = await a.runOut(y);
|
|
683
692
|
if (!m.config) {
|
|
684
|
-
t && (t.direction = "out"),
|
|
693
|
+
t && (t.direction = "out"), i && (i.remove(), i = null);
|
|
685
694
|
return;
|
|
686
695
|
}
|
|
687
|
-
const
|
|
688
|
-
(A =
|
|
689
|
-
const
|
|
690
|
-
...
|
|
696
|
+
const g = m.config;
|
|
697
|
+
(A = g.prepare) == null || A.call(g, u), E(), g.wait && await g.wait();
|
|
698
|
+
const C = F({
|
|
699
|
+
...g,
|
|
691
700
|
onEnd: () => {
|
|
692
|
-
var T,
|
|
693
|
-
(T =
|
|
701
|
+
var T, O;
|
|
702
|
+
(T = g.onEnd) == null || T.call(g), i && (i.remove(), i = null), t = null, (O = e == null ? void 0 : e.onCleanupEnd) == null || O.call(e);
|
|
694
703
|
}
|
|
695
|
-
}),
|
|
696
|
-
config:
|
|
704
|
+
}), S = I.fromState(m.state, {
|
|
705
|
+
config: C,
|
|
697
706
|
from: m.from,
|
|
698
707
|
to: m.to,
|
|
699
|
-
element:
|
|
708
|
+
element: u
|
|
700
709
|
});
|
|
701
|
-
t = { controller:
|
|
702
|
-
function
|
|
703
|
-
!r || !
|
|
710
|
+
t = { controller: S, direction: "out" }, m.direction === "forward" ? S.forward() : S.backward();
|
|
711
|
+
function E() {
|
|
712
|
+
!r || !i || (o && r.contains(o) ? r.insertBefore(i, o) : r.appendChild(i));
|
|
704
713
|
}
|
|
705
714
|
};
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
715
|
+
let f = null;
|
|
716
|
+
return (u) => {
|
|
717
|
+
if (u)
|
|
718
|
+
return r = u.parentElement, o = u.nextElementSibling, (e == null ? void 0 : e.scope) === "local" ? queueMicrotask(() => {
|
|
719
|
+
f = st(u), !(f && !rt(f)) && c(u);
|
|
720
|
+
}) : c(u), () => {
|
|
721
|
+
const h = u.isConnected ? u.cloneNode(!0) : u;
|
|
722
|
+
f ? queueMicrotask(() => {
|
|
723
|
+
document.contains(f) && l(h);
|
|
724
|
+
}) : l(h);
|
|
714
725
|
};
|
|
715
726
|
};
|
|
716
727
|
}
|
|
717
|
-
const
|
|
718
|
-
if (!
|
|
719
|
-
const
|
|
728
|
+
const at = 3, lt = (n) => {
|
|
729
|
+
if (!n) return null;
|
|
730
|
+
const e = n.split(`
|
|
720
731
|
`).map((t) => t.trim());
|
|
721
|
-
for (let t =
|
|
722
|
-
const
|
|
732
|
+
for (let t = at; t < Math.min(e.length, 6); t++) {
|
|
733
|
+
const i = e[t], r = i == null ? void 0 : i.match(/\(?([^):]+):(\d+):(\d+)\)?$/);
|
|
723
734
|
if (!r)
|
|
724
735
|
continue;
|
|
725
736
|
const o = r[1] ?? "", s = r[2] ?? "0", a = r[3] ?? "0";
|
|
726
737
|
return { file: o.split(/[\\/]/).pop() || o, line: s, column: a };
|
|
727
738
|
}
|
|
728
739
|
return null;
|
|
729
|
-
},
|
|
730
|
-
function
|
|
731
|
-
|
|
732
|
-
let
|
|
733
|
-
return
|
|
740
|
+
}, x = /* @__PURE__ */ new Map(), M = /* @__PURE__ */ new Map();
|
|
741
|
+
function ut(n, e, t) {
|
|
742
|
+
x.set(n, e);
|
|
743
|
+
let i = M.get(n);
|
|
744
|
+
return i || (i = ct(
|
|
734
745
|
() => {
|
|
735
|
-
const r =
|
|
736
|
-
return r || (console.warn(`Transition "${String(
|
|
746
|
+
const r = x.get(n);
|
|
747
|
+
return r || (console.warn(`Transition "${String(n)}" not found`), {});
|
|
737
748
|
},
|
|
738
749
|
{
|
|
739
|
-
strategy: t,
|
|
740
|
-
|
|
750
|
+
strategy: t == null ? void 0 : t.strategy,
|
|
751
|
+
scope: t == null ? void 0 : t.scope,
|
|
752
|
+
onCleanupEnd: () => W(n)
|
|
741
753
|
}
|
|
742
|
-
),
|
|
754
|
+
), M.set(n, i), i);
|
|
743
755
|
}
|
|
744
|
-
function
|
|
745
|
-
|
|
756
|
+
function W(n) {
|
|
757
|
+
x.delete(n), M.delete(n);
|
|
746
758
|
}
|
|
747
|
-
function
|
|
748
|
-
const
|
|
749
|
-
return
|
|
759
|
+
function ft() {
|
|
760
|
+
const n = lt(new Error().stack);
|
|
761
|
+
return n ? `auto_${n.file}_${n.line}_${n.column}` : Symbol(`ssgoi_auto_${Date.now()}`);
|
|
750
762
|
}
|
|
751
|
-
const L = globalThis.FinalizationRegistry,
|
|
763
|
+
const L = globalThis.FinalizationRegistry, _ = L ? (
|
|
752
764
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
753
|
-
new L((
|
|
765
|
+
new L((n) => {
|
|
754
766
|
try {
|
|
755
|
-
|
|
767
|
+
W(n);
|
|
756
768
|
} catch {
|
|
757
769
|
}
|
|
758
770
|
})
|
|
759
771
|
) : void 0;
|
|
760
|
-
function
|
|
761
|
-
const
|
|
762
|
-
if (
|
|
772
|
+
function Ct(n) {
|
|
773
|
+
const e = n.key ?? ft();
|
|
774
|
+
if (n.ref && _)
|
|
763
775
|
try {
|
|
764
|
-
|
|
776
|
+
_.register(n.ref, e);
|
|
765
777
|
} catch {
|
|
766
778
|
}
|
|
767
|
-
return
|
|
768
|
-
|
|
779
|
+
return ut(
|
|
780
|
+
e,
|
|
769
781
|
{
|
|
770
|
-
in:
|
|
771
|
-
out:
|
|
782
|
+
in: n.in,
|
|
783
|
+
out: n.out
|
|
772
784
|
},
|
|
773
|
-
|
|
785
|
+
{
|
|
786
|
+
strategy: n[X],
|
|
787
|
+
scope: n.scope
|
|
788
|
+
}
|
|
774
789
|
);
|
|
775
790
|
}
|
|
776
|
-
function
|
|
777
|
-
const
|
|
791
|
+
function dt(n) {
|
|
792
|
+
const e = n.filter((t) => t.symmetric).map((t) => ({
|
|
778
793
|
from: t.to,
|
|
779
794
|
to: t.from,
|
|
780
795
|
transition: t.transition
|
|
781
796
|
}));
|
|
782
|
-
return [...
|
|
797
|
+
return [...n, ...e];
|
|
783
798
|
}
|
|
784
|
-
function
|
|
785
|
-
let
|
|
799
|
+
function mt(n) {
|
|
800
|
+
let e = !1, t = 0, i = 0, r = !1;
|
|
786
801
|
const o = 50, s = (p) => {
|
|
787
|
-
if (!
|
|
788
|
-
const
|
|
789
|
-
|
|
802
|
+
if (!n) return;
|
|
803
|
+
const v = p.touches[0];
|
|
804
|
+
v && (r = v.clientX < o, r && (t = v.clientX, i = v.clientY));
|
|
790
805
|
}, a = (p) => {
|
|
791
|
-
if (!
|
|
792
|
-
const
|
|
793
|
-
if (!
|
|
794
|
-
const
|
|
795
|
-
|
|
806
|
+
if (!n || !r) return;
|
|
807
|
+
const v = p.touches[0];
|
|
808
|
+
if (!v) return;
|
|
809
|
+
const y = v.clientX - t, m = v.clientY - i;
|
|
810
|
+
y > window.outerWidth / 2 - 5 && Math.abs(y) > Math.abs(m) ? e = !0 : e = !1;
|
|
796
811
|
}, c = () => {
|
|
797
|
-
|
|
798
|
-
},
|
|
799
|
-
typeof window > "u" ||
|
|
800
|
-
},
|
|
812
|
+
n && (r = !1, t = 0, i = 0);
|
|
813
|
+
}, l = () => e, f = () => {
|
|
814
|
+
typeof window > "u" || n && (window.addEventListener("touchstart", s, { passive: !0 }), window.addEventListener("touchmove", a, { passive: !0 }), window.addEventListener("touchend", c, { passive: !0 }));
|
|
815
|
+
}, w = () => {
|
|
801
816
|
typeof window > "u" || (window.removeEventListener("touchstart", s), window.removeEventListener("touchmove", a), window.removeEventListener("touchend", c));
|
|
802
817
|
};
|
|
803
|
-
let
|
|
818
|
+
let u = 0;
|
|
804
819
|
return {
|
|
805
|
-
initialize:
|
|
806
|
-
cleanup:
|
|
807
|
-
isSwipePending:
|
|
820
|
+
initialize: f,
|
|
821
|
+
cleanup: w,
|
|
822
|
+
isSwipePending: l,
|
|
808
823
|
resetSwipeDetection: () => {
|
|
809
|
-
|
|
824
|
+
u++, u > 1 && (u = 0, e = !1);
|
|
810
825
|
}
|
|
811
826
|
};
|
|
812
827
|
}
|
|
813
|
-
const
|
|
814
|
-
let
|
|
815
|
-
for (;
|
|
816
|
-
const t = window.getComputedStyle(
|
|
817
|
-
if (
|
|
818
|
-
return
|
|
819
|
-
|
|
828
|
+
const ht = (n) => {
|
|
829
|
+
let e = n.parentElement;
|
|
830
|
+
for (; e && e !== document.body; ) {
|
|
831
|
+
const t = window.getComputedStyle(e), i = t.overflow + t.overflowY + t.overflowX;
|
|
832
|
+
if (i.includes("auto") || i.includes("scroll") || e.scrollHeight > e.clientHeight || e.scrollWidth > e.clientWidth)
|
|
833
|
+
return e;
|
|
834
|
+
e = e.parentElement;
|
|
820
835
|
}
|
|
821
836
|
return document.documentElement;
|
|
822
|
-
},
|
|
823
|
-
let
|
|
824
|
-
for (;
|
|
825
|
-
const t = window.getComputedStyle(
|
|
837
|
+
}, gt = (n) => {
|
|
838
|
+
let e = n.parentElement;
|
|
839
|
+
for (; e && e !== document.body; ) {
|
|
840
|
+
const t = window.getComputedStyle(e).position;
|
|
826
841
|
if (t === "relative" || t === "absolute" || t === "fixed" || t === "sticky")
|
|
827
|
-
return
|
|
828
|
-
|
|
842
|
+
return e;
|
|
843
|
+
e = e.parentElement;
|
|
829
844
|
}
|
|
830
845
|
return document.body;
|
|
831
846
|
};
|
|
832
|
-
function
|
|
833
|
-
let
|
|
847
|
+
function pt() {
|
|
848
|
+
let n = null, e = null;
|
|
834
849
|
const t = /* @__PURE__ */ new Map();
|
|
835
|
-
let
|
|
850
|
+
let i = null;
|
|
836
851
|
const r = () => {
|
|
837
|
-
|
|
838
|
-
x:
|
|
839
|
-
y:
|
|
852
|
+
n && i && t.set(i, {
|
|
853
|
+
x: n.scrollLeft,
|
|
854
|
+
y: n.scrollTop
|
|
840
855
|
});
|
|
841
856
|
};
|
|
842
857
|
return {
|
|
843
|
-
initializeContext: (
|
|
844
|
-
|
|
858
|
+
initializeContext: (f, w) => {
|
|
859
|
+
e = f, n || (n = ht(f), (n === document.documentElement ? window : n).addEventListener("scroll", r, {
|
|
845
860
|
passive: !0
|
|
846
|
-
})),
|
|
861
|
+
})), i = w;
|
|
847
862
|
},
|
|
848
|
-
calculateScrollOffset: (
|
|
849
|
-
const
|
|
863
|
+
calculateScrollOffset: (f, w) => {
|
|
864
|
+
const u = f && t.has(f) ? t.get(f) : { x: 0, y: 0 }, h = w && t.has(w) ? t.get(w) : { x: 0, y: 0 };
|
|
850
865
|
return {
|
|
851
|
-
x: -
|
|
852
|
-
y: -
|
|
866
|
+
x: -h.x + u.x,
|
|
867
|
+
y: -h.y + u.y
|
|
853
868
|
};
|
|
854
869
|
},
|
|
855
|
-
getScrollContainer: () =>
|
|
856
|
-
getPositionedParentElement: () =>
|
|
857
|
-
getScrollPosition: (
|
|
870
|
+
getScrollContainer: () => n,
|
|
871
|
+
getPositionedParentElement: () => e ? gt(e) : document.body,
|
|
872
|
+
getScrollPosition: (f) => f && t.has(f) ? t.get(f) : { x: 0, y: 0 }
|
|
858
873
|
};
|
|
859
874
|
}
|
|
860
|
-
function
|
|
861
|
-
if (
|
|
875
|
+
function b(n, e) {
|
|
876
|
+
if (e === "*")
|
|
862
877
|
return !0;
|
|
863
|
-
if (
|
|
864
|
-
const t =
|
|
865
|
-
return
|
|
878
|
+
if (e.endsWith("/*")) {
|
|
879
|
+
const t = e.slice(0, -2);
|
|
880
|
+
return n === t || n.startsWith(t + "/");
|
|
866
881
|
}
|
|
867
|
-
return
|
|
882
|
+
return n === e;
|
|
868
883
|
}
|
|
869
|
-
function
|
|
870
|
-
for (const
|
|
871
|
-
if (
|
|
872
|
-
return
|
|
873
|
-
for (const
|
|
874
|
-
if ((
|
|
875
|
-
return
|
|
884
|
+
function wt(n, e, t) {
|
|
885
|
+
for (const i of t)
|
|
886
|
+
if (b(n, i.from) && b(e, i.to))
|
|
887
|
+
return i.transition;
|
|
888
|
+
for (const i of t)
|
|
889
|
+
if ((i.from === "*" || b(n, i.from)) && (i.to === "*" || b(e, i.to)))
|
|
890
|
+
return i.transition;
|
|
876
891
|
return null;
|
|
877
892
|
}
|
|
878
|
-
function
|
|
893
|
+
function At(n) {
|
|
879
894
|
const {
|
|
880
|
-
transitions:
|
|
895
|
+
transitions: e = [],
|
|
881
896
|
defaultTransition: t,
|
|
882
|
-
middleware:
|
|
897
|
+
middleware: i = (y, m) => ({ from: y, to: m }),
|
|
883
898
|
// Identity function as default
|
|
884
899
|
skipOnIosSwipe: r = !0
|
|
885
900
|
// Default to true - skip animations on iOS swipe
|
|
886
|
-
} =
|
|
901
|
+
} = n;
|
|
887
902
|
let o = null;
|
|
888
|
-
const s =
|
|
903
|
+
const s = dt(e), {
|
|
889
904
|
initializeContext: a,
|
|
890
905
|
calculateScrollOffset: c,
|
|
891
|
-
getScrollContainer:
|
|
892
|
-
getPositionedParentElement:
|
|
893
|
-
getScrollPosition:
|
|
894
|
-
} =
|
|
895
|
-
|
|
896
|
-
function
|
|
906
|
+
getScrollContainer: l,
|
|
907
|
+
getPositionedParentElement: f,
|
|
908
|
+
getScrollPosition: w
|
|
909
|
+
} = pt(), u = mt(r);
|
|
910
|
+
u.initialize();
|
|
911
|
+
function h() {
|
|
897
912
|
if (o != null && o.from && (o != null && o.to)) {
|
|
898
|
-
const { from:
|
|
913
|
+
const { from: y, to: m } = i(
|
|
899
914
|
o.from,
|
|
900
915
|
o.to
|
|
901
|
-
),
|
|
916
|
+
), C = wt(
|
|
917
|
+
y,
|
|
902
918
|
m,
|
|
903
|
-
f,
|
|
904
919
|
s
|
|
905
|
-
) || t,
|
|
920
|
+
) || t, S = c(
|
|
906
921
|
o.from,
|
|
907
922
|
o.to
|
|
908
|
-
),
|
|
909
|
-
scrollOffset:
|
|
910
|
-
scroll:
|
|
923
|
+
), E = {
|
|
924
|
+
scrollOffset: S,
|
|
925
|
+
scroll: w(o.from),
|
|
911
926
|
get scrollingElement() {
|
|
912
|
-
return
|
|
927
|
+
return l() || document.documentElement;
|
|
913
928
|
},
|
|
914
929
|
get positionedParent() {
|
|
915
|
-
return
|
|
930
|
+
return f();
|
|
916
931
|
}
|
|
917
|
-
},
|
|
918
|
-
scrollOffset:
|
|
932
|
+
}, A = {
|
|
933
|
+
scrollOffset: S,
|
|
919
934
|
get scroll() {
|
|
920
|
-
return o ?
|
|
935
|
+
return o ? w(o.to) : { x: 0, y: 0 };
|
|
921
936
|
},
|
|
922
937
|
get scrollingElement() {
|
|
923
|
-
return
|
|
938
|
+
return l() || document.documentElement;
|
|
924
939
|
},
|
|
925
940
|
get positionedParent() {
|
|
926
|
-
return
|
|
941
|
+
return f();
|
|
927
942
|
}
|
|
928
943
|
};
|
|
929
|
-
|
|
930
|
-
(
|
|
931
|
-
),
|
|
932
|
-
(
|
|
944
|
+
C && (C.out && o.outResolve && o.outResolve(
|
|
945
|
+
(T) => C.out(T, E)
|
|
946
|
+
), C.in && o.inResolve && o.inResolve(
|
|
947
|
+
(T) => C.in(T, A)
|
|
933
948
|
)), o = null;
|
|
934
949
|
}
|
|
935
950
|
}
|
|
936
|
-
const p = async (
|
|
937
|
-
o.outResolve =
|
|
938
|
-
})) : (o.to =
|
|
939
|
-
o.inResolve =
|
|
951
|
+
const p = async (y, m) => u.isSwipePending() ? (u.resetSwipeDetection(), () => ({})) : m === "in" && (!o || !o.from) ? () => ({}) : (o || (o = {}), m === "out" ? (o.from = y, new Promise((g) => {
|
|
952
|
+
o.outResolve = g, h();
|
|
953
|
+
})) : (o.to = y, new Promise((g) => {
|
|
954
|
+
o.inResolve = g, h();
|
|
940
955
|
})));
|
|
941
|
-
return (
|
|
942
|
-
key:
|
|
943
|
-
in: async (
|
|
944
|
-
out: async (
|
|
956
|
+
return (y) => ({
|
|
957
|
+
key: y,
|
|
958
|
+
in: async (m) => (a(m, y), (await p(y, "in"))(m)),
|
|
959
|
+
out: async (m) => (await p(y, "out"))(m),
|
|
945
960
|
// Add page transition strategy for page-level transitions
|
|
946
|
-
[
|
|
961
|
+
[X]: ot
|
|
947
962
|
});
|
|
948
963
|
}
|
|
949
964
|
export {
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
St as
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
+
$ as SCOPE_ATTR,
|
|
966
|
+
j as SCOPE_READY_ATTR,
|
|
967
|
+
X as TRANSITION_STRATEGY,
|
|
968
|
+
nt as createDefaultStrategy,
|
|
969
|
+
ot as createPageTransitionStrategy,
|
|
970
|
+
At as createSggoiTransitionContext,
|
|
971
|
+
St as createTransitionScope,
|
|
972
|
+
st as findScope,
|
|
973
|
+
ft as generateAutoKey,
|
|
974
|
+
kt as isCssAnimation,
|
|
975
|
+
Vt as isMultiSpring,
|
|
976
|
+
rt as isScopeReady,
|
|
977
|
+
bt as isSingleSpring,
|
|
978
|
+
Rt as isTickAnimation,
|
|
979
|
+
Mt as jaeminInternal,
|
|
980
|
+
F as normalizeMultiSpringSchedule,
|
|
981
|
+
k as normalizeToMultiSpring,
|
|
982
|
+
Ct as transition,
|
|
983
|
+
It as validateAnimationMode,
|
|
984
|
+
Pt as validateSpringItem
|
|
965
985
|
};
|