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