@ssgoi/core 2.2.0 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/animator.d.ts.map +1 -1
- package/dist/create-ssgoi-transition-context.d.ts.map +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.js +286 -250
- package/dist/transition-strategy.d.ts +1 -1
- package/dist/transition-strategy.d.ts.map +1 -1
- package/dist/transition.d.ts.map +1 -1
- package/dist/transitions/index.cjs +1 -1
- package/dist/transitions/index.js +78 -77
- package/dist/transitions/mask.d.ts.map +1 -1
- package/dist/transitions/none.d.ts +4 -4
- package/dist/transitions/none.d.ts.map +1 -1
- package/dist/types.d.ts +31 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/get-positioned-parent.d.ts +7 -0
- package/dist/utils/get-positioned-parent.d.ts.map +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/view-transitions/film.d.ts +8 -0
- package/dist/view-transitions/film.d.ts.map +1 -0
- package/dist/view-transitions/index.cjs +15 -10
- package/dist/view-transitions/index.d.ts +1 -0
- package/dist/view-transitions/index.d.ts.map +1 -1
- package/dist/view-transitions/index.js +370 -278
- package/package.json +10 -9
package/dist/index.js
CHANGED
|
@@ -1,108 +1,108 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { animate as
|
|
5
|
-
class
|
|
1
|
+
var U = Object.defineProperty;
|
|
2
|
+
var _ = (n, t, o) => t in n ? U(n, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : n[t] = o;
|
|
3
|
+
var y = (n, t, o) => _(n, typeof t != "symbol" ? t + "" : t, o);
|
|
4
|
+
import { animate as P } from "popmotion";
|
|
5
|
+
class C {
|
|
6
6
|
constructor(t) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
y(this, "options");
|
|
8
|
+
y(this, "currentValue");
|
|
9
|
+
y(this, "velocity");
|
|
10
|
+
y(this, "isAnimating", !1);
|
|
11
|
+
y(this, "controls", null);
|
|
12
12
|
// For object animations
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
y(this, "animationMap", null);
|
|
14
|
+
y(this, "activeAnimations", /* @__PURE__ */ new Set());
|
|
15
|
+
y(this, "completedAnimations", /* @__PURE__ */ new Set());
|
|
16
|
+
y(this, "updatedProperties", /* @__PURE__ */ new Set());
|
|
17
|
+
y(this, "animate", (t = !1) => {
|
|
18
18
|
!this.isAnimating && this.options.onStart && this.options.onStart(), this.isAnimating = !0;
|
|
19
19
|
const o = t ? this.options.from : this.options.to;
|
|
20
20
|
if (typeof this.currentValue == "object" && this.currentValue !== null) {
|
|
21
|
-
this.animateObject(o
|
|
21
|
+
this.animateObject(o);
|
|
22
22
|
return;
|
|
23
23
|
}
|
|
24
|
-
let
|
|
25
|
-
const
|
|
24
|
+
let i = this.currentValue, e = performance.now();
|
|
25
|
+
const m = {
|
|
26
26
|
from: this.currentValue,
|
|
27
27
|
to: o,
|
|
28
28
|
stiffness: this.options.spring.stiffness,
|
|
29
29
|
damping: this.options.spring.damping,
|
|
30
30
|
mass: 1
|
|
31
31
|
};
|
|
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
|
-
|
|
32
|
+
typeof this.velocity == "number" && (m.velocity = this.velocity * 1e3), this.controls = P({
|
|
33
|
+
...m,
|
|
34
|
+
onUpdate: (l) => {
|
|
35
|
+
const p = performance.now(), r = (p - e) / 1e3;
|
|
36
|
+
if (r > 0) {
|
|
37
|
+
if (typeof l == "number" && typeof i == "number") {
|
|
38
|
+
const u = (l - i) / r;
|
|
39
|
+
this.velocity = u / 1e3;
|
|
40
|
+
} else if (typeof l == "object" && l !== null) {
|
|
41
|
+
const u = {};
|
|
42
|
+
Object.keys(l).forEach((f) => {
|
|
43
|
+
const c = l[f], a = i[f];
|
|
44
|
+
if (typeof c == "number" && typeof a == "number") {
|
|
45
|
+
const h = (c - a) / r;
|
|
46
|
+
u[f] = h / 1e3;
|
|
47
47
|
}
|
|
48
|
-
}), this.velocity =
|
|
48
|
+
}), this.velocity = u;
|
|
49
49
|
}
|
|
50
|
-
|
|
50
|
+
i = l, e = p;
|
|
51
51
|
}
|
|
52
|
-
this.currentValue =
|
|
52
|
+
this.currentValue = l, this.options.onUpdate(l);
|
|
53
53
|
},
|
|
54
54
|
onComplete: () => {
|
|
55
|
-
this.currentValue = o, this.isAnimating = !1, this.controls = null, typeof this.velocity == "object" && this.velocity !== null ? Object.keys(this.velocity).forEach((
|
|
56
|
-
this.velocity[
|
|
55
|
+
this.currentValue = o, this.isAnimating = !1, this.controls = null, typeof this.velocity == "object" && this.velocity !== null ? Object.keys(this.velocity).forEach((l) => {
|
|
56
|
+
this.velocity[l] = 0;
|
|
57
57
|
}) : this.velocity = 0, this.options.onComplete();
|
|
58
58
|
}
|
|
59
59
|
});
|
|
60
60
|
});
|
|
61
|
-
|
|
62
|
-
const
|
|
61
|
+
y(this, "animateObject", (t) => {
|
|
62
|
+
const o = this.currentValue, i = Object.keys(o);
|
|
63
63
|
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
|
-
) &&
|
|
64
|
+
const e = { ...o }, m = {};
|
|
65
|
+
let l = !1;
|
|
66
|
+
const p = () => {
|
|
67
|
+
const r = i.filter((f) => !this.completedAnimations.has(f));
|
|
68
|
+
if (r.every(
|
|
69
|
+
(f) => this.updatedProperties.has(f)
|
|
70
|
+
) && r.length > 0) {
|
|
71
71
|
if (typeof this.velocity == "object" && this.velocity) {
|
|
72
|
-
const
|
|
73
|
-
Object.keys(
|
|
74
|
-
if (
|
|
75
|
-
const
|
|
76
|
-
typeof
|
|
72
|
+
const f = performance.now();
|
|
73
|
+
Object.keys(e).forEach((c) => {
|
|
74
|
+
if (m[c]) {
|
|
75
|
+
const a = (f - m[c]) / 1e3, h = this.currentValue[c], s = e[c];
|
|
76
|
+
typeof h == "number" && typeof s == "number" && a > 0 && (this.velocity[c] = (s - h) / a / 1e3);
|
|
77
77
|
}
|
|
78
|
-
|
|
78
|
+
m[c] = f;
|
|
79
79
|
});
|
|
80
80
|
}
|
|
81
|
-
this.currentValue = { ...
|
|
81
|
+
this.currentValue = { ...e }, this.options.onUpdate(this.currentValue), this.updatedProperties.clear(), !l && this.options.onStart && (l = !0, this.options.onStart());
|
|
82
82
|
}
|
|
83
83
|
};
|
|
84
|
-
|
|
85
|
-
this.activeAnimations.add(
|
|
86
|
-
const
|
|
87
|
-
from:
|
|
88
|
-
to: t[
|
|
84
|
+
i.forEach((r) => {
|
|
85
|
+
this.activeAnimations.add(r);
|
|
86
|
+
const u = {
|
|
87
|
+
from: o[r],
|
|
88
|
+
to: t[r],
|
|
89
89
|
stiffness: this.options.spring.stiffness,
|
|
90
90
|
damping: this.options.spring.damping,
|
|
91
91
|
mass: 1
|
|
92
92
|
};
|
|
93
|
-
typeof this.velocity == "object" && this.velocity &&
|
|
94
|
-
const
|
|
95
|
-
...
|
|
93
|
+
typeof this.velocity == "object" && this.velocity && r in this.velocity && (u.velocity = this.velocity[r] * 1e3);
|
|
94
|
+
const f = P({
|
|
95
|
+
...u,
|
|
96
96
|
onUpdate: (c) => {
|
|
97
|
-
|
|
97
|
+
e[r] = c, this.updatedProperties.add(r), p();
|
|
98
98
|
},
|
|
99
99
|
onComplete: () => {
|
|
100
|
-
this.completedAnimations.add(
|
|
100
|
+
this.completedAnimations.add(r), this.updatedProperties.delete(r), 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((c) => {
|
|
101
101
|
this.velocity[c] = 0;
|
|
102
102
|
}), this.options.onComplete());
|
|
103
103
|
}
|
|
104
104
|
});
|
|
105
|
-
this.animationMap.set(
|
|
105
|
+
this.animationMap.set(r, f);
|
|
106
106
|
});
|
|
107
107
|
});
|
|
108
108
|
if (this.options = {
|
|
@@ -116,8 +116,8 @@ class A {
|
|
|
116
116
|
onStart: t.onStart
|
|
117
117
|
}, this.currentValue = this.options.from, typeof this.options.from == "object" && this.options.from !== null) {
|
|
118
118
|
const o = {};
|
|
119
|
-
Object.keys(this.options.from).forEach((
|
|
120
|
-
o[
|
|
119
|
+
Object.keys(this.options.from).forEach((i) => {
|
|
120
|
+
o[i] = 0;
|
|
121
121
|
}), this.velocity = o;
|
|
122
122
|
} else
|
|
123
123
|
this.velocity = 0;
|
|
@@ -178,31 +178,31 @@ class A {
|
|
|
178
178
|
}
|
|
179
179
|
// Static factory method
|
|
180
180
|
static fromState(t, o) {
|
|
181
|
-
const
|
|
182
|
-
return
|
|
181
|
+
const i = new C(o);
|
|
182
|
+
return i.setValue(t.position), i.setVelocity(t.velocity), i;
|
|
183
183
|
}
|
|
184
184
|
}
|
|
185
|
-
const
|
|
185
|
+
const x = Symbol.for("TRANSITION_STRATEGY"), I = (n) => ({
|
|
186
186
|
runIn: async (t) => {
|
|
187
|
-
const { currentAnimation: o } =
|
|
187
|
+
const { currentAnimation: o } = n;
|
|
188
188
|
if (o && o.direction === "out") {
|
|
189
|
-
const
|
|
189
|
+
const l = o.animator.getCurrentState();
|
|
190
190
|
if (o.animator.stop(), t.out) {
|
|
191
|
-
const
|
|
191
|
+
const p = await t.out, { from: r = 1, to: u = 0 } = p;
|
|
192
192
|
return {
|
|
193
|
-
config:
|
|
194
|
-
state:
|
|
195
|
-
from:
|
|
193
|
+
config: p,
|
|
194
|
+
state: l,
|
|
195
|
+
from: r,
|
|
196
196
|
// OUT animation's from
|
|
197
|
-
to:
|
|
197
|
+
to: u,
|
|
198
198
|
// OUT animation's to
|
|
199
199
|
direction: "backward"
|
|
200
200
|
// Will actually go 0→1
|
|
201
201
|
};
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
|
-
const
|
|
205
|
-
if (!
|
|
204
|
+
const i = await t.in;
|
|
205
|
+
if (!i)
|
|
206
206
|
return {
|
|
207
207
|
state: {
|
|
208
208
|
position: 0,
|
|
@@ -212,41 +212,41 @@ const j = Symbol.for("TRANSITION_STRATEGY"), U = (i) => ({
|
|
|
212
212
|
to: 1,
|
|
213
213
|
direction: "forward"
|
|
214
214
|
};
|
|
215
|
-
const { from: e = 0, to:
|
|
215
|
+
const { from: e = 0, to: m = 1 } = i;
|
|
216
216
|
return {
|
|
217
|
-
config:
|
|
217
|
+
config: i,
|
|
218
218
|
state: {
|
|
219
219
|
position: e,
|
|
220
220
|
velocity: 0
|
|
221
221
|
},
|
|
222
222
|
from: e,
|
|
223
|
-
to:
|
|
223
|
+
to: m,
|
|
224
224
|
direction: "forward"
|
|
225
225
|
};
|
|
226
226
|
},
|
|
227
227
|
runOut: async (t) => {
|
|
228
|
-
const { currentAnimation: o } =
|
|
228
|
+
const { currentAnimation: o } = n;
|
|
229
229
|
if (o && o.direction === "in") {
|
|
230
|
-
const
|
|
230
|
+
const l = o.animator.getCurrentState();
|
|
231
231
|
if (o.animator.stop(), t.in) {
|
|
232
|
-
const
|
|
232
|
+
const p = await t.in, { from: r = 0, to: u = 1 } = p;
|
|
233
233
|
return {
|
|
234
|
-
config:
|
|
234
|
+
config: p,
|
|
235
235
|
state: {
|
|
236
|
-
position:
|
|
237
|
-
velocity:
|
|
236
|
+
position: l.position,
|
|
237
|
+
velocity: l.velocity
|
|
238
238
|
},
|
|
239
|
-
from:
|
|
239
|
+
from: r,
|
|
240
240
|
// IN animation's from
|
|
241
|
-
to:
|
|
241
|
+
to: u,
|
|
242
242
|
// IN animation's to
|
|
243
243
|
direction: "backward"
|
|
244
244
|
// Will actually go 1→0
|
|
245
245
|
};
|
|
246
246
|
}
|
|
247
247
|
}
|
|
248
|
-
const
|
|
249
|
-
if (!
|
|
248
|
+
const i = await t.out;
|
|
249
|
+
if (!i)
|
|
250
250
|
return {
|
|
251
251
|
state: {
|
|
252
252
|
position: 1,
|
|
@@ -256,22 +256,22 @@ const j = Symbol.for("TRANSITION_STRATEGY"), U = (i) => ({
|
|
|
256
256
|
to: 0,
|
|
257
257
|
direction: "forward"
|
|
258
258
|
};
|
|
259
|
-
const { from: e = 1, to:
|
|
259
|
+
const { from: e = 1, to: m = 0 } = i;
|
|
260
260
|
return {
|
|
261
|
-
config:
|
|
261
|
+
config: i,
|
|
262
262
|
state: {
|
|
263
263
|
position: e,
|
|
264
264
|
velocity: 0
|
|
265
265
|
},
|
|
266
266
|
from: e,
|
|
267
|
-
to:
|
|
267
|
+
to: m,
|
|
268
268
|
direction: "forward"
|
|
269
269
|
};
|
|
270
270
|
}
|
|
271
|
-
}),
|
|
272
|
-
runIn: async (
|
|
273
|
-
const
|
|
274
|
-
if (!
|
|
271
|
+
}), N = () => ({
|
|
272
|
+
runIn: async (n) => {
|
|
273
|
+
const t = await n.in;
|
|
274
|
+
if (!t)
|
|
275
275
|
return {
|
|
276
276
|
state: {
|
|
277
277
|
position: 0,
|
|
@@ -281,21 +281,21 @@ const j = Symbol.for("TRANSITION_STRATEGY"), U = (i) => ({
|
|
|
281
281
|
to: 1,
|
|
282
282
|
direction: "forward"
|
|
283
283
|
};
|
|
284
|
-
const { from:
|
|
284
|
+
const { from: o = 0, to: i = 1 } = t;
|
|
285
285
|
return {
|
|
286
|
-
config:
|
|
286
|
+
config: t,
|
|
287
287
|
state: {
|
|
288
|
-
position:
|
|
288
|
+
position: o,
|
|
289
289
|
velocity: 0
|
|
290
290
|
},
|
|
291
|
-
from:
|
|
292
|
-
to:
|
|
291
|
+
from: o,
|
|
292
|
+
to: i,
|
|
293
293
|
direction: "forward"
|
|
294
294
|
};
|
|
295
295
|
},
|
|
296
|
-
runOut: async (
|
|
297
|
-
const
|
|
298
|
-
if (!
|
|
296
|
+
runOut: async (n) => {
|
|
297
|
+
const t = await n.out;
|
|
298
|
+
if (!t)
|
|
299
299
|
return {
|
|
300
300
|
state: {
|
|
301
301
|
position: 1,
|
|
@@ -305,246 +305,282 @@ const j = Symbol.for("TRANSITION_STRATEGY"), U = (i) => ({
|
|
|
305
305
|
to: 0,
|
|
306
306
|
direction: "forward"
|
|
307
307
|
};
|
|
308
|
-
const { from:
|
|
308
|
+
const { from: o = 1, to: i = 0 } = t;
|
|
309
309
|
return {
|
|
310
|
-
config:
|
|
310
|
+
config: t,
|
|
311
311
|
state: {
|
|
312
|
-
position:
|
|
312
|
+
position: o,
|
|
313
313
|
velocity: 0
|
|
314
314
|
},
|
|
315
|
-
from:
|
|
316
|
-
to:
|
|
315
|
+
from: o,
|
|
316
|
+
to: i,
|
|
317
317
|
direction: "forward"
|
|
318
318
|
};
|
|
319
319
|
}
|
|
320
320
|
});
|
|
321
|
-
function
|
|
322
|
-
var
|
|
323
|
-
let o = null,
|
|
324
|
-
const
|
|
321
|
+
function k(n, t) {
|
|
322
|
+
var f;
|
|
323
|
+
let o = null, i = null, e = null, m = null;
|
|
324
|
+
const l = {
|
|
325
325
|
get currentAnimation() {
|
|
326
326
|
return o;
|
|
327
327
|
}
|
|
328
|
-
},
|
|
329
|
-
var
|
|
330
|
-
|
|
331
|
-
const
|
|
332
|
-
in:
|
|
333
|
-
out:
|
|
334
|
-
},
|
|
335
|
-
if (!
|
|
328
|
+
}, p = ((f = t == null ? void 0 : t.strategy) == null ? void 0 : f.call(t, l)) || I(l), r = async (c) => {
|
|
329
|
+
var w, S;
|
|
330
|
+
i && (i.remove(), i = null);
|
|
331
|
+
const a = n(), h = {
|
|
332
|
+
in: a.in && Promise.resolve(a.in(c)),
|
|
333
|
+
out: a.out && Promise.resolve(a.out(c))
|
|
334
|
+
}, s = await p.runIn(h);
|
|
335
|
+
if (!s.config)
|
|
336
336
|
return;
|
|
337
|
-
(S = (
|
|
338
|
-
const
|
|
339
|
-
from:
|
|
340
|
-
to:
|
|
341
|
-
spring:
|
|
342
|
-
onStart:
|
|
343
|
-
onUpdate:
|
|
337
|
+
(S = (w = s.config).prepare) == null || S.call(w, c), s.config.wait && await s.config.wait();
|
|
338
|
+
const g = C.fromState(s.state, {
|
|
339
|
+
from: s.from,
|
|
340
|
+
to: s.to,
|
|
341
|
+
spring: s.config.spring,
|
|
342
|
+
onStart: s.config.onStart,
|
|
343
|
+
onUpdate: s.config.tick,
|
|
344
344
|
onComplete: () => {
|
|
345
|
-
var v,
|
|
346
|
-
o = null, (
|
|
345
|
+
var v, d;
|
|
346
|
+
o = null, (d = (v = s.config) == null ? void 0 : v.onEnd) == null || d.call(v);
|
|
347
347
|
}
|
|
348
348
|
});
|
|
349
|
-
o = { animator:
|
|
350
|
-
},
|
|
349
|
+
o = { animator: g, direction: "in" }, s.direction === "forward" ? g.forward() : g.backward();
|
|
350
|
+
}, u = async (c) => {
|
|
351
351
|
var S, v;
|
|
352
|
-
|
|
353
|
-
const
|
|
354
|
-
in:
|
|
355
|
-
out:
|
|
356
|
-
},
|
|
357
|
-
if (!
|
|
352
|
+
i = c;
|
|
353
|
+
const a = n(), h = {
|
|
354
|
+
in: a.in && Promise.resolve(a.in(c)),
|
|
355
|
+
out: a.out && Promise.resolve(a.out(c))
|
|
356
|
+
}, s = await p.runOut(h);
|
|
357
|
+
if (!s.config)
|
|
358
358
|
return;
|
|
359
|
-
(v = (S =
|
|
360
|
-
const
|
|
361
|
-
from:
|
|
362
|
-
to:
|
|
363
|
-
spring:
|
|
364
|
-
onStart:
|
|
365
|
-
onUpdate:
|
|
359
|
+
(v = (S = s.config).prepare) == null || v.call(S, c), w(), s.config.wait && await s.config.wait();
|
|
360
|
+
const g = C.fromState(s.state, {
|
|
361
|
+
from: s.from,
|
|
362
|
+
to: s.to,
|
|
363
|
+
spring: s.config.spring,
|
|
364
|
+
onStart: s.config.onStart,
|
|
365
|
+
onUpdate: s.config.tick,
|
|
366
366
|
onComplete: () => {
|
|
367
|
-
var
|
|
368
|
-
(
|
|
367
|
+
var d, V, T;
|
|
368
|
+
(V = (d = s.config) == null ? void 0 : d.onEnd) == null || V.call(d), i && (i.remove(), i = null), o = null, (T = t == null ? void 0 : t.onCleanupEnd) == null || T.call(t);
|
|
369
369
|
}
|
|
370
370
|
});
|
|
371
|
-
o = { animator:
|
|
372
|
-
function
|
|
373
|
-
!e || !
|
|
371
|
+
o = { animator: g, direction: "out" }, s.direction === "forward" ? g.forward() : g.backward();
|
|
372
|
+
function w() {
|
|
373
|
+
!e || !i || (m && e.contains(m) ? e.insertBefore(i, m) : e.appendChild(i));
|
|
374
374
|
}
|
|
375
375
|
};
|
|
376
|
-
return (
|
|
377
|
-
if (
|
|
378
|
-
return e =
|
|
379
|
-
const
|
|
380
|
-
a
|
|
376
|
+
return (c) => {
|
|
377
|
+
if (c)
|
|
378
|
+
return e = c.parentElement, m = c.nextElementSibling, r(c), () => {
|
|
379
|
+
const a = c.cloneNode(!0);
|
|
380
|
+
u(a);
|
|
381
381
|
};
|
|
382
382
|
};
|
|
383
383
|
}
|
|
384
|
-
const D = 3,
|
|
385
|
-
if (!
|
|
386
|
-
const t =
|
|
384
|
+
const D = 3, $ = (n) => {
|
|
385
|
+
if (!n) return null;
|
|
386
|
+
const t = n.split(`
|
|
387
387
|
`).map((o) => o.trim());
|
|
388
388
|
for (let o = D; o < Math.min(t.length, 6); o++) {
|
|
389
|
-
const
|
|
389
|
+
const i = t[o], e = i == null ? void 0 : i.match(/\(?([^):]+):(\d+):(\d+)\)?$/);
|
|
390
390
|
if (!e)
|
|
391
391
|
continue;
|
|
392
|
-
const
|
|
393
|
-
return { file:
|
|
392
|
+
const m = e[1] ?? "", l = e[2] ?? "0", p = e[3] ?? "0";
|
|
393
|
+
return { file: m.split(/[\\/]/).pop() || m, line: l, column: p };
|
|
394
394
|
}
|
|
395
395
|
return null;
|
|
396
|
-
},
|
|
397
|
-
function
|
|
398
|
-
|
|
399
|
-
let
|
|
400
|
-
return
|
|
396
|
+
}, A = /* @__PURE__ */ new Map(), E = /* @__PURE__ */ new Map();
|
|
397
|
+
function F(n, t, o) {
|
|
398
|
+
A.set(n, t);
|
|
399
|
+
let i = E.get(n);
|
|
400
|
+
return i || (i = k(
|
|
401
401
|
() => {
|
|
402
|
-
const e =
|
|
403
|
-
return e || (console.warn(`Transition "${String(
|
|
402
|
+
const e = A.get(n);
|
|
403
|
+
return e || (console.warn(`Transition "${String(n)}" not found`), {});
|
|
404
404
|
},
|
|
405
405
|
{
|
|
406
406
|
strategy: o,
|
|
407
|
-
onCleanupEnd: () => M(
|
|
407
|
+
onCleanupEnd: () => M(n)
|
|
408
408
|
}
|
|
409
|
-
),
|
|
409
|
+
), E.set(n, i), i);
|
|
410
410
|
}
|
|
411
|
-
function M(
|
|
412
|
-
|
|
411
|
+
function M(n) {
|
|
412
|
+
A.delete(n), E.delete(n);
|
|
413
413
|
}
|
|
414
|
-
function
|
|
415
|
-
const
|
|
416
|
-
return
|
|
414
|
+
function K() {
|
|
415
|
+
const n = $(new Error().stack);
|
|
416
|
+
return n ? `auto_${n.file}_${n.line}_${n.column}` : Symbol(`ssgoi_auto_${Date.now()}`);
|
|
417
417
|
}
|
|
418
|
-
const R = globalThis.FinalizationRegistry,
|
|
418
|
+
const R = globalThis.FinalizationRegistry, O = R ? new R((n) => {
|
|
419
419
|
try {
|
|
420
|
-
M(
|
|
420
|
+
M(n);
|
|
421
421
|
} catch {
|
|
422
422
|
}
|
|
423
423
|
}) : void 0;
|
|
424
|
-
function
|
|
425
|
-
const t =
|
|
426
|
-
if (
|
|
424
|
+
function X(n) {
|
|
425
|
+
const t = n.key ?? K();
|
|
426
|
+
if (n.ref && O)
|
|
427
427
|
try {
|
|
428
|
-
|
|
428
|
+
O.register(n.ref, t);
|
|
429
429
|
} catch {
|
|
430
430
|
}
|
|
431
|
-
return
|
|
431
|
+
return F(
|
|
432
432
|
t,
|
|
433
433
|
{
|
|
434
|
-
in:
|
|
435
|
-
out:
|
|
434
|
+
in: n.in,
|
|
435
|
+
out: n.out
|
|
436
436
|
},
|
|
437
|
-
|
|
437
|
+
n[x]
|
|
438
438
|
);
|
|
439
439
|
}
|
|
440
|
-
const
|
|
441
|
-
let t =
|
|
440
|
+
const W = (n) => {
|
|
441
|
+
let t = n.parentElement;
|
|
442
442
|
for (; t && t !== document.body; ) {
|
|
443
|
-
const o = window.getComputedStyle(t),
|
|
444
|
-
if (
|
|
443
|
+
const o = window.getComputedStyle(t), i = o.overflow + o.overflowY + o.overflowX;
|
|
444
|
+
if (i.includes("auto") || i.includes("scroll") || t.scrollHeight > t.clientHeight || t.scrollWidth > t.clientWidth)
|
|
445
445
|
return t;
|
|
446
446
|
t = t.parentElement;
|
|
447
447
|
}
|
|
448
448
|
return document.documentElement;
|
|
449
|
+
}, j = (n) => {
|
|
450
|
+
let t = n.parentElement;
|
|
451
|
+
for (; t && t !== document.body; ) {
|
|
452
|
+
const o = window.getComputedStyle(t).position;
|
|
453
|
+
if (o === "relative" || o === "absolute" || o === "fixed" || o === "sticky")
|
|
454
|
+
return t;
|
|
455
|
+
t = t.parentElement;
|
|
456
|
+
}
|
|
457
|
+
return document.body;
|
|
449
458
|
};
|
|
450
|
-
function
|
|
451
|
-
const t =
|
|
459
|
+
function L(n) {
|
|
460
|
+
const t = n.filter((o) => o.symmetric).map((o) => ({
|
|
452
461
|
from: o.to,
|
|
453
462
|
to: o.from,
|
|
454
463
|
transition: o.transition
|
|
455
464
|
}));
|
|
456
|
-
return [...
|
|
465
|
+
return [...n, ...t];
|
|
457
466
|
}
|
|
458
|
-
function
|
|
459
|
-
let
|
|
467
|
+
function z() {
|
|
468
|
+
let n = null;
|
|
460
469
|
const t = /* @__PURE__ */ new Map();
|
|
461
470
|
let o = null;
|
|
462
|
-
const
|
|
463
|
-
|
|
464
|
-
x:
|
|
465
|
-
y:
|
|
471
|
+
const i = () => {
|
|
472
|
+
n && o && t.set(o, {
|
|
473
|
+
x: n.scrollLeft,
|
|
474
|
+
y: n.scrollTop
|
|
466
475
|
});
|
|
467
476
|
};
|
|
468
477
|
return {
|
|
469
|
-
startScrollTracking: (
|
|
470
|
-
|
|
478
|
+
startScrollTracking: (r, u) => {
|
|
479
|
+
n || (n = W(r), (n === document.documentElement ? window : n).addEventListener("scroll", i, {
|
|
471
480
|
passive: !0
|
|
472
|
-
})), o =
|
|
481
|
+
})), o = u;
|
|
473
482
|
},
|
|
474
|
-
calculateScrollOffset: (
|
|
475
|
-
const
|
|
483
|
+
calculateScrollOffset: (r, u) => {
|
|
484
|
+
const f = r && t.has(r) ? t.get(r) : { x: 0, y: 0 }, c = u && t.has(u) ? t.get(u) : { x: 0, y: 0 };
|
|
476
485
|
return {
|
|
477
|
-
x: -
|
|
478
|
-
y: -
|
|
486
|
+
x: -c.x + f.x,
|
|
487
|
+
y: -c.y + f.y
|
|
479
488
|
};
|
|
480
|
-
}
|
|
489
|
+
},
|
|
490
|
+
getScrollContainer: () => n,
|
|
491
|
+
getScrollPosition: (r) => r && t.has(r) ? t.get(r) : { x: 0, y: 0 }
|
|
481
492
|
};
|
|
482
493
|
}
|
|
483
|
-
function
|
|
494
|
+
function B(n) {
|
|
484
495
|
const {
|
|
485
496
|
transitions: t = [],
|
|
486
497
|
defaultTransition: o,
|
|
487
|
-
middleware:
|
|
498
|
+
middleware: i = (a, h) => ({ from: a, to: h })
|
|
488
499
|
// Identity function as default
|
|
489
|
-
} =
|
|
500
|
+
} = n;
|
|
490
501
|
let e = null;
|
|
491
|
-
const
|
|
492
|
-
|
|
502
|
+
const m = L(t), {
|
|
503
|
+
startScrollTracking: l,
|
|
504
|
+
calculateScrollOffset: p,
|
|
505
|
+
getScrollContainer: r,
|
|
506
|
+
getScrollPosition: u
|
|
507
|
+
} = z();
|
|
508
|
+
function f() {
|
|
493
509
|
if (e != null && e.from && (e != null && e.to)) {
|
|
494
|
-
const { from:
|
|
510
|
+
const { from: a, to: h } = i(
|
|
495
511
|
e.from,
|
|
496
512
|
e.to
|
|
497
|
-
),
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
) || o,
|
|
513
|
+
), g = Y(
|
|
514
|
+
a,
|
|
515
|
+
h,
|
|
516
|
+
m
|
|
517
|
+
) || o, w = p(
|
|
502
518
|
e.from,
|
|
503
519
|
e.to
|
|
504
|
-
)
|
|
505
|
-
|
|
506
|
-
(
|
|
507
|
-
|
|
508
|
-
|
|
520
|
+
), S = {
|
|
521
|
+
scrollOffset: w,
|
|
522
|
+
scroll: u(e.from),
|
|
523
|
+
get scrollingElement() {
|
|
524
|
+
return r() || document.documentElement;
|
|
525
|
+
},
|
|
526
|
+
get positionedParent() {
|
|
527
|
+
const d = r();
|
|
528
|
+
return d ? j(d) : document.body;
|
|
529
|
+
}
|
|
530
|
+
}, v = {
|
|
531
|
+
scrollOffset: w,
|
|
532
|
+
scroll: u(e.to),
|
|
533
|
+
get scrollingElement() {
|
|
534
|
+
return r() || document.documentElement;
|
|
535
|
+
},
|
|
536
|
+
get positionedParent() {
|
|
537
|
+
const d = r();
|
|
538
|
+
return d ? j(d) : document.body;
|
|
539
|
+
}
|
|
540
|
+
};
|
|
541
|
+
g && (g.out && e.outResolve && e.outResolve(
|
|
542
|
+
(d) => g.out(d, S)
|
|
543
|
+
), g.in && e.inResolve && e.inResolve(
|
|
544
|
+
(d) => g.in(d, v)
|
|
509
545
|
)), e = null;
|
|
510
546
|
}
|
|
511
547
|
}
|
|
512
|
-
const
|
|
513
|
-
e.outResolve =
|
|
514
|
-
})) : (e.to =
|
|
515
|
-
e.inResolve =
|
|
548
|
+
const c = async (a, h) => h === "in" && (!e || !e.from) ? () => ({}) : (e || (e = {}), h === "out" ? (e.from = a, new Promise((s) => {
|
|
549
|
+
e.outResolve = s, f();
|
|
550
|
+
})) : (e.to = a, new Promise((s) => {
|
|
551
|
+
e.inResolve = s, f();
|
|
516
552
|
})));
|
|
517
|
-
return (
|
|
518
|
-
key:
|
|
519
|
-
in: async (
|
|
520
|
-
out: async (
|
|
553
|
+
return (a) => ({
|
|
554
|
+
key: a,
|
|
555
|
+
in: async (h) => (l(h, a), (await c(a, "in"))(h)),
|
|
556
|
+
out: async (h) => (await c(a, "out"))(h),
|
|
521
557
|
// Add page transition strategy for page-level transitions
|
|
522
|
-
[
|
|
558
|
+
[x]: N
|
|
523
559
|
});
|
|
524
560
|
}
|
|
525
|
-
function
|
|
526
|
-
for (const
|
|
527
|
-
if (b(
|
|
528
|
-
return
|
|
529
|
-
for (const
|
|
530
|
-
if ((
|
|
531
|
-
return
|
|
561
|
+
function Y(n, t, o) {
|
|
562
|
+
for (const i of o)
|
|
563
|
+
if (b(n, i.from) && b(t, i.to))
|
|
564
|
+
return i.transition;
|
|
565
|
+
for (const i of o)
|
|
566
|
+
if ((i.from === "*" || b(n, i.from)) && (i.to === "*" || b(t, i.to)))
|
|
567
|
+
return i.transition;
|
|
532
568
|
return null;
|
|
533
569
|
}
|
|
534
|
-
function b(
|
|
570
|
+
function b(n, t) {
|
|
535
571
|
if (t === "*")
|
|
536
572
|
return !0;
|
|
537
573
|
if (t.endsWith("/*")) {
|
|
538
574
|
const o = t.slice(0, -2);
|
|
539
|
-
return
|
|
575
|
+
return n === o || n.startsWith(o + "/");
|
|
540
576
|
}
|
|
541
|
-
return
|
|
577
|
+
return n === t;
|
|
542
578
|
}
|
|
543
579
|
export {
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
580
|
+
x as TRANSITION_STRATEGY,
|
|
581
|
+
I as createDefaultStrategy,
|
|
582
|
+
N as createPageTransitionStrategy,
|
|
583
|
+
B as createSggoiTransitionContext,
|
|
584
|
+
K as generateAutoKey,
|
|
585
|
+
X as transition
|
|
550
586
|
};
|