@ssgoi/core 3.1.1 → 3.1.3
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/multi-animator.d.ts +0 -2
- package/dist/animator/multi-animator.d.ts.map +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.js +136 -128
- package/dist/transition/create-transition-callback.d.ts.map +1 -1
- package/dist/transition/transition.d.ts.map +1 -1
- package/dist/types.cjs +1 -1
- package/dist/types.d.ts +35 -5
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +39 -36
- package/dist/view-transitions/hero.d.ts.map +1 -1
- package/dist/view-transitions/index.cjs +15 -15
- package/dist/view-transitions/index.js +547 -510
- package/dist/view-transitions/instagram.d.ts.map +1 -1
- package/dist/view-transitions/pinterest.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var K = Object.defineProperty;
|
|
2
2
|
var U = (n, e, t) => e in n ? K(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
3
3
|
var d = (n, e, t) => U(n, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
-
import { normalizeToMultiSpring as
|
|
5
|
-
import { isCssAnimation as
|
|
4
|
+
import { normalizeToMultiSpring as V, normalizeMultiSpringSchedule as F } from "./types.js";
|
|
5
|
+
import { isCssAnimation as Vt, isMultiSpring as bt, isSingleSpring as kt, isTickAnimation as Rt, validateAnimationMode as It, validateSpringItem as Pt } from "./types.js";
|
|
6
6
|
import { j as Mt } from "./jaemin-BWkrXq0V.js";
|
|
7
7
|
class G {
|
|
8
8
|
constructor() {
|
|
@@ -30,9 +30,9 @@ class G {
|
|
|
30
30
|
i > this.lagThreshold || i < 0 ? (this.startTime += i - this.adjustedLag, i = this.adjustedLag) : i > this.maxDeltaTime && (i = this.maxDeltaTime), this.lastUpdate = e;
|
|
31
31
|
const r = e - this.startTime, o = r - this.nextTime;
|
|
32
32
|
if (o > 0) {
|
|
33
|
-
const
|
|
33
|
+
const c = i / 1e3;
|
|
34
34
|
this.elapsed = r / 1e3, this.nextTime += o + (o >= this.gap ? 4 : this.gap - o), this.listeners.forEach((a) => {
|
|
35
|
-
a(
|
|
35
|
+
a(c, this.elapsed);
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
38
|
this.listeners.size > 0 ? this.rafId = requestAnimationFrame(this.tick) : (this.isRunning = !1, this.rafId = null);
|
|
@@ -68,15 +68,15 @@ class G {
|
|
|
68
68
|
return this.elapsed;
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
|
-
const
|
|
71
|
+
const x = new G();
|
|
72
72
|
function z(n) {
|
|
73
73
|
const e = n.stiffness, t = n.damping, i = 1, r = Math.sqrt(e / i), o = t / (2 * Math.sqrt(e * i));
|
|
74
74
|
return { omega: r, zeta: o };
|
|
75
75
|
}
|
|
76
76
|
function q(n, e, t, i) {
|
|
77
|
-
const { omega: r, zeta: o } = t, { position:
|
|
77
|
+
const { omega: r, zeta: o } = t, { position: c, velocity: a } = n, s = Math.min(i, 0.033), l = -2 * s * o * r * a, f = s * r * r * (e - c), w = a + l + f;
|
|
78
78
|
return {
|
|
79
|
-
position:
|
|
79
|
+
position: c + s * w,
|
|
80
80
|
velocity: w
|
|
81
81
|
};
|
|
82
82
|
}
|
|
@@ -92,46 +92,46 @@ function Q(n) {
|
|
|
92
92
|
spring: i,
|
|
93
93
|
velocity: r = 0,
|
|
94
94
|
onUpdate: o,
|
|
95
|
-
onComplete:
|
|
95
|
+
onComplete: c,
|
|
96
96
|
onStart: a
|
|
97
97
|
} = n;
|
|
98
|
-
let
|
|
98
|
+
let s = { position: e, velocity: r }, l = !0, f = 0, w = !1;
|
|
99
99
|
const u = z(i), h = (p) => {
|
|
100
100
|
if (l) {
|
|
101
|
-
if (w || (w = !0, a == null || a()),
|
|
101
|
+
if (w || (w = !0, a == null || a()), s = q(s, t, u, p), N(s, t)) {
|
|
102
102
|
if (f += Math.min(p, 0.033), f >= H) {
|
|
103
|
-
|
|
103
|
+
s = { position: t, velocity: 0 }, l = !1, o(s.position), x.unsubscribe(h), c();
|
|
104
104
|
return;
|
|
105
105
|
}
|
|
106
106
|
} else
|
|
107
107
|
f = 0;
|
|
108
|
-
o(
|
|
108
|
+
o(s.position);
|
|
109
109
|
}
|
|
110
110
|
};
|
|
111
|
-
return
|
|
111
|
+
return x.subscribe(h), {
|
|
112
112
|
stop: () => {
|
|
113
|
-
l && (l = !1,
|
|
113
|
+
l && (l = !1, x.unsubscribe(h));
|
|
114
114
|
},
|
|
115
|
-
getPosition: () =>
|
|
116
|
-
getVelocity: () =>
|
|
115
|
+
getPosition: () => s.position,
|
|
116
|
+
getVelocity: () => s.velocity,
|
|
117
117
|
isRunning: () => l
|
|
118
118
|
};
|
|
119
119
|
}
|
|
120
|
-
const
|
|
120
|
+
const b = 1e3 / 60;
|
|
121
121
|
function Z(n, e, t, i = 0) {
|
|
122
122
|
const r = z(t), o = 600;
|
|
123
|
-
let
|
|
124
|
-
const
|
|
123
|
+
let c = { position: n, velocity: i }, a = 0;
|
|
124
|
+
const s = [];
|
|
125
125
|
for (let l = 0; l < o; l++) {
|
|
126
|
-
const f = l *
|
|
127
|
-
if (
|
|
126
|
+
const f = l * b;
|
|
127
|
+
if (s.push({
|
|
128
128
|
time: f,
|
|
129
|
-
position:
|
|
130
|
-
velocity:
|
|
131
|
-
}),
|
|
132
|
-
if (a +=
|
|
133
|
-
|
|
134
|
-
time: (l + 1) *
|
|
129
|
+
position: c.position,
|
|
130
|
+
velocity: c.velocity
|
|
131
|
+
}), c = q(c, e, r, b / 1e3), N(c, e)) {
|
|
132
|
+
if (a += b / 1e3, a >= H) {
|
|
133
|
+
s.push({
|
|
134
|
+
time: (l + 1) * b,
|
|
135
135
|
position: e,
|
|
136
136
|
velocity: 0
|
|
137
137
|
});
|
|
@@ -140,7 +140,7 @@ function Z(n, e, t, i = 0) {
|
|
|
140
140
|
} else
|
|
141
141
|
a = 0;
|
|
142
142
|
}
|
|
143
|
-
return
|
|
143
|
+
return s;
|
|
144
144
|
}
|
|
145
145
|
function D(n, e) {
|
|
146
146
|
if (n.length === 0)
|
|
@@ -155,10 +155,10 @@ function D(n, e) {
|
|
|
155
155
|
const l = Math.floor((r + o) / 2);
|
|
156
156
|
n[l].time <= e ? r = l : o = l;
|
|
157
157
|
}
|
|
158
|
-
const
|
|
158
|
+
const c = n[r], a = n[o], s = (e - c.time) / (a.time - c.time);
|
|
159
159
|
return {
|
|
160
|
-
position:
|
|
161
|
-
velocity:
|
|
160
|
+
position: c.position + (a.position - c.position) * s,
|
|
161
|
+
velocity: c.velocity + (a.velocity - c.velocity) * s
|
|
162
162
|
};
|
|
163
163
|
}
|
|
164
164
|
function tt(n, e) {
|
|
@@ -171,27 +171,27 @@ function et(n) {
|
|
|
171
171
|
to: i,
|
|
172
172
|
spring: r,
|
|
173
173
|
velocity: o = 0,
|
|
174
|
-
style:
|
|
174
|
+
style: c,
|
|
175
175
|
onComplete: a,
|
|
176
|
-
onStart:
|
|
176
|
+
onStart: s
|
|
177
177
|
} = n, l = Z(t, i, r, o);
|
|
178
178
|
if (l.length === 0)
|
|
179
|
-
return
|
|
179
|
+
return s == null || s(), a(), {
|
|
180
180
|
stop: () => {
|
|
181
181
|
},
|
|
182
182
|
getPosition: () => i,
|
|
183
183
|
getVelocity: () => 0,
|
|
184
184
|
isRunning: () => !1
|
|
185
185
|
};
|
|
186
|
-
const f = tt(l,
|
|
186
|
+
const f = tt(l, c), w = l[l.length - 1], u = w.time, h = e.animate(f, {
|
|
187
187
|
duration: u,
|
|
188
188
|
fill: "forwards",
|
|
189
189
|
easing: "linear"
|
|
190
190
|
// Spring physics already applied in keyframes
|
|
191
191
|
});
|
|
192
192
|
let p = !0;
|
|
193
|
-
const
|
|
194
|
-
return
|
|
193
|
+
const S = performance.now();
|
|
194
|
+
return s == null || s(), h.onfinish = () => {
|
|
195
195
|
p && (p = !1, a());
|
|
196
196
|
}, {
|
|
197
197
|
stop: () => {
|
|
@@ -200,37 +200,37 @@ function et(n) {
|
|
|
200
200
|
getPosition: () => {
|
|
201
201
|
if (!p)
|
|
202
202
|
return w.position;
|
|
203
|
-
const y = performance.now() -
|
|
203
|
+
const y = performance.now() - S;
|
|
204
204
|
return D(l, y).position;
|
|
205
205
|
},
|
|
206
206
|
getVelocity: () => {
|
|
207
207
|
if (!p)
|
|
208
208
|
return 0;
|
|
209
|
-
const y = performance.now() -
|
|
209
|
+
const y = performance.now() - S;
|
|
210
210
|
return D(l, y).velocity;
|
|
211
211
|
},
|
|
212
212
|
isRunning: () => p
|
|
213
213
|
};
|
|
214
214
|
}
|
|
215
215
|
function it(n) {
|
|
216
|
-
const { from: e, to: t, spring: i, velocity: r, onComplete: o, onStart:
|
|
217
|
-
if (a &&
|
|
216
|
+
const { from: e, to: t, spring: i, velocity: r, onComplete: o, onStart: c, tick: a, css: s } = n;
|
|
217
|
+
if (a && s)
|
|
218
218
|
throw new Error("Cannot use both 'tick' and 'css' options together");
|
|
219
|
-
return !a && !
|
|
219
|
+
return !a && !s ? (c == null || c(), o(), {
|
|
220
220
|
stop: () => {
|
|
221
221
|
},
|
|
222
222
|
getPosition: () => t,
|
|
223
223
|
getVelocity: () => 0,
|
|
224
224
|
isRunning: () => !1
|
|
225
|
-
}) :
|
|
226
|
-
element:
|
|
225
|
+
}) : s ? et({
|
|
226
|
+
element: s.element,
|
|
227
227
|
from: e,
|
|
228
228
|
to: t,
|
|
229
229
|
spring: i,
|
|
230
230
|
velocity: r,
|
|
231
|
-
style:
|
|
231
|
+
style: s.style,
|
|
232
232
|
onComplete: o,
|
|
233
|
-
onStart:
|
|
233
|
+
onStart: c
|
|
234
234
|
}) : Q({
|
|
235
235
|
from: e,
|
|
236
236
|
to: t,
|
|
@@ -238,12 +238,12 @@ function it(n) {
|
|
|
238
238
|
velocity: r,
|
|
239
239
|
onUpdate: a,
|
|
240
240
|
onComplete: o,
|
|
241
|
-
onStart:
|
|
241
|
+
onStart: c
|
|
242
242
|
});
|
|
243
243
|
}
|
|
244
244
|
class Y {
|
|
245
245
|
}
|
|
246
|
-
class
|
|
246
|
+
class I extends Y {
|
|
247
247
|
constructor(t) {
|
|
248
248
|
super();
|
|
249
249
|
d(this, "options");
|
|
@@ -320,11 +320,11 @@ class R extends Y {
|
|
|
320
320
|
this.options = { ...this.options, ...t };
|
|
321
321
|
}
|
|
322
322
|
static fromState(t, i) {
|
|
323
|
-
const r = new
|
|
323
|
+
const r = new I(i);
|
|
324
324
|
return r.setValue(t.position), r.setVelocity(t.velocity), r;
|
|
325
325
|
}
|
|
326
326
|
}
|
|
327
|
-
class
|
|
327
|
+
class P extends Y {
|
|
328
328
|
constructor(t) {
|
|
329
329
|
super();
|
|
330
330
|
d(this, "config");
|
|
@@ -335,22 +335,21 @@ class I extends Y {
|
|
|
335
335
|
d(this, "direction", "forward");
|
|
336
336
|
d(this, "idCounter", 0);
|
|
337
337
|
d(this, "rafId", null);
|
|
338
|
-
d(this, "element");
|
|
339
338
|
d(this, "from");
|
|
340
339
|
d(this, "to");
|
|
341
|
-
this.config = t.config, this.from = t.from, this.to = t.to, this.
|
|
340
|
+
this.config = t.config, this.from = t.from, this.to = t.to, this.initializeAnimators();
|
|
342
341
|
}
|
|
343
342
|
generateId() {
|
|
344
343
|
return `spring_${this.idCounter++}`;
|
|
345
344
|
}
|
|
346
345
|
initializeAnimators() {
|
|
347
346
|
this.config.springs.forEach((t) => {
|
|
348
|
-
const i = this.generateId(), r = new
|
|
347
|
+
const i = this.generateId(), r = new I({
|
|
349
348
|
from: this.from,
|
|
350
349
|
to: this.to,
|
|
351
350
|
spring: t.spring,
|
|
352
351
|
tick: t.tick,
|
|
353
|
-
css: t.css
|
|
352
|
+
css: t.css,
|
|
354
353
|
onComplete: () => this.onAnimatorComplete(i),
|
|
355
354
|
onStart: t.onStart
|
|
356
355
|
});
|
|
@@ -379,9 +378,9 @@ class I extends Y {
|
|
|
379
378
|
return this.direction === "forward" ? this.springOrder : [...this.springOrder].reverse();
|
|
380
379
|
}
|
|
381
380
|
onAnimatorComplete(t) {
|
|
382
|
-
var r, o,
|
|
381
|
+
var r, o, c, a, s, l;
|
|
383
382
|
const i = this.animators.get(t);
|
|
384
|
-
!i || this.completedAnimators.has(t) || (this.completedAnimators.add(t), this.completedCount++, (o = (r = i.item).onComplete) == null || o.call(r), (a = (
|
|
383
|
+
!i || this.completedAnimators.has(t) || (this.completedAnimators.add(t), this.completedCount++, (o = (r = i.item).onComplete) == null || o.call(r), (a = (c = this.config).onProgress) == null || a.call(c, this.completedCount, this.config.springs.length), this.completedCount === this.config.springs.length && (this.stopScheduler(), (l = (s = this.config).onEnd) == null || l.call(s)));
|
|
385
384
|
}
|
|
386
385
|
/**
|
|
387
386
|
* Check and start springs based on previous spring's progress
|
|
@@ -396,10 +395,10 @@ class I extends Y {
|
|
|
396
395
|
this.startAnimator(r);
|
|
397
396
|
continue;
|
|
398
397
|
}
|
|
399
|
-
const
|
|
398
|
+
const c = t[i - 1], a = this.animators.get(c);
|
|
400
399
|
if (!a || !a.started) continue;
|
|
401
|
-
const
|
|
402
|
-
|
|
400
|
+
const s = this.getAnimatorProgress(a), l = o.item.normalizedOffset;
|
|
401
|
+
s >= l && this.startAnimator(r);
|
|
403
402
|
}
|
|
404
403
|
}
|
|
405
404
|
startAnimator(t) {
|
|
@@ -447,19 +446,19 @@ class I extends Y {
|
|
|
447
446
|
return;
|
|
448
447
|
const i = t.animator.getCurrentState();
|
|
449
448
|
if (i.position === i.to) {
|
|
450
|
-
const o =
|
|
449
|
+
const o = I.fromState(
|
|
451
450
|
{ position: this.to, velocity: 0 },
|
|
452
451
|
{
|
|
453
452
|
from: this.to,
|
|
454
453
|
to: this.from,
|
|
455
454
|
spring: t.item.spring,
|
|
456
455
|
tick: t.item.tick,
|
|
457
|
-
css:
|
|
456
|
+
css: t.item.css,
|
|
458
457
|
onComplete: () => this.onAnimatorComplete(t.id),
|
|
459
458
|
onStart: t.item.onStart
|
|
460
459
|
}
|
|
461
460
|
);
|
|
462
|
-
|
|
461
|
+
o.forward(), t.animator = o;
|
|
463
462
|
} else
|
|
464
463
|
t.animator.reverse();
|
|
465
464
|
});
|
|
@@ -517,7 +516,7 @@ class I extends Y {
|
|
|
517
516
|
* Uses first animator's state for initialization
|
|
518
517
|
*/
|
|
519
518
|
static fromState(t, i) {
|
|
520
|
-
const r = new
|
|
519
|
+
const r = new P(i);
|
|
521
520
|
return r.setValue(t.position), r.setVelocity(t.velocity), r;
|
|
522
521
|
}
|
|
523
522
|
}
|
|
@@ -626,7 +625,7 @@ const X = Symbol.for("TRANSITION_STRATEGY"), nt = (n) => ({
|
|
|
626
625
|
direction: "forward"
|
|
627
626
|
}
|
|
628
627
|
}), $ = "data-ssgoi-scope", j = "data-ssgoi-scope-ready";
|
|
629
|
-
function
|
|
628
|
+
function vt() {
|
|
630
629
|
return (n) => {
|
|
631
630
|
if (n)
|
|
632
631
|
return n.setAttribute($, ""), queueMicrotask(() => {
|
|
@@ -646,19 +645,19 @@ function st(n) {
|
|
|
646
645
|
function ct(n, e) {
|
|
647
646
|
var w;
|
|
648
647
|
let t = null, i = null, r = null, o = null;
|
|
649
|
-
const
|
|
648
|
+
const c = {
|
|
650
649
|
get currentAnimation() {
|
|
651
650
|
return t;
|
|
652
651
|
}
|
|
653
|
-
}, a = ((w = e == null ? void 0 : e.strategy) == null ? void 0 : w.call(e,
|
|
652
|
+
}, a = ((w = e == null ? void 0 : e.strategy) == null ? void 0 : w.call(e, c)) || nt(c), s = async (u) => {
|
|
654
653
|
var E;
|
|
655
654
|
i && (i.remove(), i = null);
|
|
656
|
-
const h = n(), p = h.in && h.in(u),
|
|
655
|
+
const h = n(), p = h.in && h.in(u), S = !(e != null && e.strategy) && h.out ? h.out(u) : void 0;
|
|
657
656
|
if (!p)
|
|
658
657
|
return;
|
|
659
658
|
const y = {
|
|
660
|
-
in:
|
|
661
|
-
out:
|
|
659
|
+
in: V(p),
|
|
660
|
+
out: S ? V(S) : void 0
|
|
662
661
|
}, m = await a.runIn(y);
|
|
663
662
|
if (!m.config) {
|
|
664
663
|
t && (t.direction = "in");
|
|
@@ -666,28 +665,30 @@ function ct(n, e) {
|
|
|
666
665
|
}
|
|
667
666
|
const g = m.config;
|
|
668
667
|
(E = g.prepare) == null || E.call(g, u), g.wait && await g.wait();
|
|
669
|
-
const C = F(
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
668
|
+
const C = F(
|
|
669
|
+
{
|
|
670
|
+
...g,
|
|
671
|
+
onEnd: () => {
|
|
672
|
+
var A;
|
|
673
|
+
t = null, (A = g.onEnd) == null || A.call(g);
|
|
674
|
+
}
|
|
675
|
+
},
|
|
676
|
+
u
|
|
677
|
+
), v = P.fromState(m.state, {
|
|
676
678
|
config: C,
|
|
677
679
|
from: m.from,
|
|
678
|
-
to: m.to
|
|
679
|
-
element: u
|
|
680
|
+
to: m.to
|
|
680
681
|
});
|
|
681
|
-
t = { controller:
|
|
682
|
+
t = { controller: v, direction: "in" }, m.direction === "forward" ? v.forward() : v.backward();
|
|
682
683
|
}, l = async (u) => {
|
|
683
684
|
var A;
|
|
684
685
|
i = u;
|
|
685
|
-
const h = n(), p = !(e != null && e.strategy) && h.in ? h.in(u) : void 0,
|
|
686
|
-
if (!
|
|
686
|
+
const h = n(), p = !(e != null && e.strategy) && h.in ? h.in(u) : void 0, S = h.out && h.out(u);
|
|
687
|
+
if (!S)
|
|
687
688
|
return;
|
|
688
689
|
const y = {
|
|
689
|
-
in: p ?
|
|
690
|
-
out:
|
|
690
|
+
in: p ? V(p) : void 0,
|
|
691
|
+
out: V(S)
|
|
691
692
|
}, m = await a.runOut(y);
|
|
692
693
|
if (!m.config) {
|
|
693
694
|
t && (t.direction = "out"), i && (i.remove(), i = null);
|
|
@@ -695,19 +696,21 @@ function ct(n, e) {
|
|
|
695
696
|
}
|
|
696
697
|
const g = m.config;
|
|
697
698
|
(A = g.prepare) == null || A.call(g, u), E(), g.wait && await g.wait();
|
|
698
|
-
const C = F(
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
699
|
+
const C = F(
|
|
700
|
+
{
|
|
701
|
+
...g,
|
|
702
|
+
onEnd: () => {
|
|
703
|
+
var T, O;
|
|
704
|
+
(T = g.onEnd) == null || T.call(g), i && (i.remove(), i = null), t = null, (O = e == null ? void 0 : e.onCleanupEnd) == null || O.call(e);
|
|
705
|
+
}
|
|
706
|
+
},
|
|
707
|
+
u
|
|
708
|
+
), v = P.fromState(m.state, {
|
|
705
709
|
config: C,
|
|
706
710
|
from: m.from,
|
|
707
|
-
to: m.to
|
|
708
|
-
element: u
|
|
711
|
+
to: m.to
|
|
709
712
|
});
|
|
710
|
-
t = { controller:
|
|
713
|
+
t = { controller: v, direction: "out" }, m.direction === "forward" ? v.forward() : v.backward();
|
|
711
714
|
function E() {
|
|
712
715
|
!r || !i || (o && r.contains(o) ? r.insertBefore(i, o) : r.appendChild(i));
|
|
713
716
|
}
|
|
@@ -716,8 +719,8 @@ function ct(n, e) {
|
|
|
716
719
|
return (u) => {
|
|
717
720
|
if (u)
|
|
718
721
|
return r = u.parentElement, o = u.nextElementSibling, (e == null ? void 0 : e.scope) === "local" ? queueMicrotask(() => {
|
|
719
|
-
f = st(u), !(f && !rt(f)) &&
|
|
720
|
-
}) :
|
|
722
|
+
f = st(u), !(f && !rt(f)) && s(u);
|
|
723
|
+
}) : s(u), () => {
|
|
721
724
|
const h = u.isConnected ? u.cloneNode(!0) : u;
|
|
722
725
|
f ? queueMicrotask(() => {
|
|
723
726
|
document.contains(f) && l(h);
|
|
@@ -733,28 +736,33 @@ const at = 3, lt = (n) => {
|
|
|
733
736
|
const i = e[t], r = i == null ? void 0 : i.match(/\(?([^):]+):(\d+):(\d+)\)?$/);
|
|
734
737
|
if (!r)
|
|
735
738
|
continue;
|
|
736
|
-
const o = r[1] ?? "",
|
|
737
|
-
return { file: o.split(/[\\/]/).pop() || o, line:
|
|
739
|
+
const o = r[1] ?? "", c = r[2] ?? "0", a = r[3] ?? "0";
|
|
740
|
+
return { file: o.split(/[\\/]/).pop() || o, line: c, column: a };
|
|
738
741
|
}
|
|
739
742
|
return null;
|
|
740
|
-
},
|
|
743
|
+
}, R = /* @__PURE__ */ new Map(), M = /* @__PURE__ */ new Map();
|
|
741
744
|
function ut(n, e, t) {
|
|
742
|
-
|
|
745
|
+
R.set(n, e);
|
|
743
746
|
let i = M.get(n);
|
|
744
|
-
|
|
747
|
+
if (i)
|
|
748
|
+
return i;
|
|
749
|
+
const r = e;
|
|
750
|
+
return i = ct(
|
|
745
751
|
() => {
|
|
746
|
-
const
|
|
747
|
-
return
|
|
752
|
+
const o = R.get(n);
|
|
753
|
+
return o || (console.warn(`Transition "${String(n)}" not found`), {});
|
|
748
754
|
},
|
|
749
755
|
{
|
|
750
756
|
strategy: t == null ? void 0 : t.strategy,
|
|
751
757
|
scope: t == null ? void 0 : t.scope,
|
|
752
|
-
onCleanupEnd: () =>
|
|
758
|
+
onCleanupEnd: () => {
|
|
759
|
+
R.get(n) === r && W(n);
|
|
760
|
+
}
|
|
753
761
|
}
|
|
754
|
-
), M.set(n, i), i
|
|
762
|
+
), M.set(n, i), i;
|
|
755
763
|
}
|
|
756
764
|
function W(n) {
|
|
757
|
-
|
|
765
|
+
R.delete(n), M.delete(n);
|
|
758
766
|
}
|
|
759
767
|
function ft() {
|
|
760
768
|
const n = lt(new Error().stack);
|
|
@@ -798,22 +806,22 @@ function dt(n) {
|
|
|
798
806
|
}
|
|
799
807
|
function mt(n) {
|
|
800
808
|
let e = !1, t = 0, i = 0, r = !1;
|
|
801
|
-
const o = 50,
|
|
809
|
+
const o = 50, c = (p) => {
|
|
802
810
|
if (!n) return;
|
|
803
|
-
const
|
|
804
|
-
|
|
811
|
+
const S = p.touches[0];
|
|
812
|
+
S && (r = S.clientX < o, r && (t = S.clientX, i = S.clientY));
|
|
805
813
|
}, a = (p) => {
|
|
806
814
|
if (!n || !r) return;
|
|
807
|
-
const
|
|
808
|
-
if (!
|
|
809
|
-
const y =
|
|
815
|
+
const S = p.touches[0];
|
|
816
|
+
if (!S) return;
|
|
817
|
+
const y = S.clientX - t, m = S.clientY - i;
|
|
810
818
|
y > window.outerWidth / 2 - 5 && Math.abs(y) > Math.abs(m) ? e = !0 : e = !1;
|
|
811
|
-
},
|
|
819
|
+
}, s = () => {
|
|
812
820
|
n && (r = !1, t = 0, i = 0);
|
|
813
821
|
}, l = () => e, f = () => {
|
|
814
|
-
typeof window > "u" || n && (window.addEventListener("touchstart",
|
|
822
|
+
typeof window > "u" || n && (window.addEventListener("touchstart", c, { passive: !0 }), window.addEventListener("touchmove", a, { passive: !0 }), window.addEventListener("touchend", s, { passive: !0 }));
|
|
815
823
|
}, w = () => {
|
|
816
|
-
typeof window > "u" || (window.removeEventListener("touchstart",
|
|
824
|
+
typeof window > "u" || (window.removeEventListener("touchstart", c), window.removeEventListener("touchmove", a), window.removeEventListener("touchend", s));
|
|
817
825
|
};
|
|
818
826
|
let u = 0;
|
|
819
827
|
return {
|
|
@@ -872,7 +880,7 @@ function pt() {
|
|
|
872
880
|
getScrollPosition: (f) => f && t.has(f) ? t.get(f) : { x: 0, y: 0 }
|
|
873
881
|
};
|
|
874
882
|
}
|
|
875
|
-
function
|
|
883
|
+
function k(n, e) {
|
|
876
884
|
if (e === "*")
|
|
877
885
|
return !0;
|
|
878
886
|
if (e.endsWith("/*")) {
|
|
@@ -883,10 +891,10 @@ function b(n, e) {
|
|
|
883
891
|
}
|
|
884
892
|
function wt(n, e, t) {
|
|
885
893
|
for (const i of t)
|
|
886
|
-
if (
|
|
894
|
+
if (k(n, i.from) && k(e, i.to))
|
|
887
895
|
return i.transition;
|
|
888
896
|
for (const i of t)
|
|
889
|
-
if ((i.from === "*" ||
|
|
897
|
+
if ((i.from === "*" || k(n, i.from)) && (i.to === "*" || k(e, i.to)))
|
|
890
898
|
return i.transition;
|
|
891
899
|
return null;
|
|
892
900
|
}
|
|
@@ -900,9 +908,9 @@ function At(n) {
|
|
|
900
908
|
// Default to true - skip animations on iOS swipe
|
|
901
909
|
} = n;
|
|
902
910
|
let o = null;
|
|
903
|
-
const
|
|
911
|
+
const c = dt(e), {
|
|
904
912
|
initializeContext: a,
|
|
905
|
-
calculateScrollOffset:
|
|
913
|
+
calculateScrollOffset: s,
|
|
906
914
|
getScrollContainer: l,
|
|
907
915
|
getPositionedParentElement: f,
|
|
908
916
|
getScrollPosition: w
|
|
@@ -916,12 +924,12 @@ function At(n) {
|
|
|
916
924
|
), C = wt(
|
|
917
925
|
y,
|
|
918
926
|
m,
|
|
919
|
-
|
|
920
|
-
) || t,
|
|
927
|
+
c
|
|
928
|
+
) || t, v = s(
|
|
921
929
|
o.from,
|
|
922
930
|
o.to
|
|
923
931
|
), E = {
|
|
924
|
-
scrollOffset:
|
|
932
|
+
scrollOffset: v,
|
|
925
933
|
scroll: w(o.from),
|
|
926
934
|
get scrollingElement() {
|
|
927
935
|
return l() || document.documentElement;
|
|
@@ -930,7 +938,7 @@ function At(n) {
|
|
|
930
938
|
return f();
|
|
931
939
|
}
|
|
932
940
|
}, A = {
|
|
933
|
-
scrollOffset:
|
|
941
|
+
scrollOffset: v,
|
|
934
942
|
get scroll() {
|
|
935
943
|
return o ? w(o.to) : { x: 0, y: 0 };
|
|
936
944
|
},
|
|
@@ -968,17 +976,17 @@ export {
|
|
|
968
976
|
nt as createDefaultStrategy,
|
|
969
977
|
ot as createPageTransitionStrategy,
|
|
970
978
|
At as createSggoiTransitionContext,
|
|
971
|
-
|
|
979
|
+
vt as createTransitionScope,
|
|
972
980
|
st as findScope,
|
|
973
981
|
ft as generateAutoKey,
|
|
974
|
-
|
|
975
|
-
|
|
982
|
+
Vt as isCssAnimation,
|
|
983
|
+
bt as isMultiSpring,
|
|
976
984
|
rt as isScopeReady,
|
|
977
|
-
|
|
985
|
+
kt as isSingleSpring,
|
|
978
986
|
Rt as isTickAnimation,
|
|
979
987
|
Mt as jaeminInternal,
|
|
980
988
|
F as normalizeMultiSpringSchedule,
|
|
981
|
-
|
|
989
|
+
V as normalizeToMultiSpring,
|
|
982
990
|
Ct as transition,
|
|
983
991
|
It as validateAnimationMode,
|
|
984
992
|
Pt as validateSpringItem
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-transition-callback.d.ts","sourceRoot":"","sources":["../../src/lib/transition/create-transition-callback.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAIhF,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,kBAAkB,EAExB,MAAM,uBAAuB,CAAC;AAG/B,wBAAgB,wBAAwB,CACtC,aAAa,EAAE,MAAM,UAAU,CAAC,SAAS,CAAC,EAC1C,OAAO,CAAC,EAAE;IACR,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,eAAe,KAAK,kBAAkB,CAAC;IAC5D,KAAK,CAAC,EAAE,eAAe,CAAC;CACzB,GACA,kBAAkB,
|
|
1
|
+
{"version":3,"file":"create-transition-callback.d.ts","sourceRoot":"","sources":["../../src/lib/transition/create-transition-callback.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAIhF,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,kBAAkB,EAExB,MAAM,uBAAuB,CAAC;AAG/B,wBAAgB,wBAAwB,CACtC,aAAa,EAAE,MAAM,UAAU,CAAC,SAAS,CAAC,EAC1C,OAAO,CAAC,EAAE;IACR,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,eAAe,KAAK,kBAAkB,CAAC;IAC5D,KAAK,CAAC,EAAE,eAAe,CAAC;CACzB,GACA,kBAAkB,CAiNpB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transition.d.ts","sourceRoot":"","sources":["../../src/lib/transition/transition.ts"],"names":[],"mappings":"AACA,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EACnB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAEV,kBAAkB,EAClB,iBAAiB,EAElB,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"transition.d.ts","sourceRoot":"","sources":["../../src/lib/transition/transition.ts"],"names":[],"mappings":"AACA,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EACnB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAEV,kBAAkB,EAClB,iBAAiB,EAElB,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAyE9C,wBAAgB,eAAe,IAAI,aAAa,CAU/C;AAoBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,wBAAgB,UAAU,CACxB,OAAO,EAAE,iBAAiB,CAAC,SAAS,CAAC,GAAG;IACtC,CAAC,mBAAmB,CAAC,CAAC,EAAE,CAAC,OAAO,EAAE,eAAe,KAAK,kBAAkB,CAAC;CAC1E,GACA,kBAAkB,CAsBpB"}
|
package/dist/types.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function S(n){return("tick"in n||"css"in n)&&!("springs"in n)}function r(n){return"springs"in n}function o(n){return"css"in n&&typeof n.css=="function"}function a(n){return"tick"in n&&typeof n.tick=="function"}function c(n){if(o(n)&&a(n))throw new Error("SingleSpringConfig cannot have both 'tick' and 'css' defined. Use one or the other.")}function l(n){if(n.tick&&n.css)throw new Error("SpringItem cannot have both 'tick' and 'css' defined. Use one or the other.")}async function h(n){const i=await n;return r(i)?(i.springs.forEach(l),i):(c(i),{prepare:i.prepare,wait:i.wait,onStart:i.onStart,onEnd:i.onEnd,springs:[{spring:i.spring,tick:i.tick,css:i.css}],schedule:"parallel"})}function m(n,i){const u=n.schedule??"parallel",p=n.springs.map(s=>{let e;switch(u){case"parallel":e=0;break;case"sequential":e=1;break;case"stagger":e=Math.max(0,Math.min(1,s.offset??0));break;default:e=0}const{css:t,offset:M,...f}=s,g=t?typeof t=="function"?i?{element:i,style:t}:void 0:{element:t.element,style:t.style}:void 0;return{...f,css:g,normalizedOffset:e}}),{schedule:k,...d}=n;return{...d,springs:p}}exports.isCssAnimation=o;exports.isMultiSpring=r;exports.isSingleSpring=S;exports.isTickAnimation=a;exports.normalizeMultiSpringSchedule=m;exports.normalizeToMultiSpring=h;exports.validateAnimationMode=c;exports.validateSpringItem=l;
|