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