@ssgoi/core 5.2.2 → 6.1.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/README.md +5 -6
- package/dist/animation/animation.d.ts +68 -0
- package/dist/animation/animation.d.ts.map +1 -0
- package/dist/animation/host-animation.d.ts +45 -0
- package/dist/animation/host-animation.d.ts.map +1 -0
- package/dist/animation/index.d.ts +6 -0
- package/dist/animation/index.d.ts.map +1 -0
- package/dist/animation/integrator/double-spring-integrator.d.ts.map +1 -0
- package/dist/{animator → animation}/integrator/index.d.ts +1 -0
- package/dist/animation/integrator/index.d.ts.map +1 -0
- package/dist/animation/integrator/inertia-integrator.d.ts.map +1 -0
- package/dist/animation/integrator/linear-integrator.d.ts +23 -0
- package/dist/animation/integrator/linear-integrator.d.ts.map +1 -0
- package/dist/{animator → animation}/integrator/provider.d.ts +1 -1
- package/dist/animation/integrator/provider.d.ts.map +1 -0
- package/dist/animation/integrator/spring-integrator.d.ts.map +1 -0
- package/dist/animation/integrator/types.d.ts.map +1 -0
- package/dist/animation/multi-animation.d.ts +55 -0
- package/dist/animation/multi-animation.d.ts.map +1 -0
- package/dist/animation/web-animation.d.ts +65 -0
- package/dist/animation/web-animation.d.ts.map +1 -0
- package/dist/index.cjs +35 -1
- package/dist/index.d.ts +4 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1702 -1186
- package/dist/internal.cjs +1 -0
- package/dist/internal.d.ts +4 -0
- package/dist/internal.d.ts.map +1 -0
- package/dist/internal.js +511 -0
- package/dist/multi-animation-CnxqLEka.js +322 -0
- package/dist/multi-animation-Dw2JTJI2.cjs +1 -0
- package/dist/ssgoi-transition/create-context-manager.d.ts +1 -1
- package/dist/ssgoi-transition/create-context-manager.d.ts.map +1 -1
- package/dist/ssgoi-transition/create-ssgoi-transition-context.d.ts +18 -31
- package/dist/ssgoi-transition/create-ssgoi-transition-context.d.ts.map +1 -1
- package/dist/ssgoi-transition/find-matching-transition.d.ts +4 -4
- package/dist/ssgoi-transition/find-matching-transition.d.ts.map +1 -1
- package/dist/ssgoi-transition/navigation-detector-strategy.d.ts +5 -15
- package/dist/ssgoi-transition/navigation-detector-strategy.d.ts.map +1 -1
- package/dist/ssgoi-transition/process-symmetric-transitions.d.ts +2 -2
- package/dist/ssgoi-transition/process-symmetric-transitions.d.ts.map +1 -1
- package/dist/ssgoi-transition/unmount-observer.d.ts +17 -0
- package/dist/ssgoi-transition/unmount-observer.d.ts.map +1 -0
- package/dist/transitions/axis/index.d.ts +43 -0
- package/dist/transitions/axis/index.d.ts.map +1 -0
- package/dist/transitions/axis/provider/index.d.ts +8 -0
- package/dist/transitions/axis/provider/index.d.ts.map +1 -0
- package/dist/transitions/axis/provider/x/fluid.d.ts +3 -0
- package/dist/transitions/axis/provider/x/fluid.d.ts.map +1 -0
- package/dist/transitions/axis/provider/x/index.d.ts +3 -0
- package/dist/transitions/axis/provider/x/index.d.ts.map +1 -0
- package/dist/transitions/axis/provider/x/snappy.d.ts +3 -0
- package/dist/transitions/axis/provider/x/snappy.d.ts.map +1 -0
- package/dist/transitions/axis/provider/y.d.ts +3 -0
- package/dist/transitions/axis/provider/y.d.ts.map +1 -0
- package/dist/transitions/axis/provider/z.d.ts +3 -0
- package/dist/transitions/axis/provider/z.d.ts.map +1 -0
- package/dist/transitions/axis/transition.d.ts +5 -0
- package/dist/transitions/axis/transition.d.ts.map +1 -0
- package/dist/transitions/axis/types.d.ts +52 -0
- package/dist/transitions/axis/types.d.ts.map +1 -0
- package/dist/transitions/blind/index.d.ts +15 -0
- package/dist/transitions/blind/index.d.ts.map +1 -0
- package/dist/transitions/blind/transition.d.ts +16 -0
- package/dist/transitions/blind/transition.d.ts.map +1 -0
- package/dist/transitions/drill/index.d.ts +40 -0
- package/dist/transitions/drill/index.d.ts.map +1 -0
- package/dist/transitions/drill/provider/crossfade.d.ts +3 -0
- package/dist/transitions/drill/provider/crossfade.d.ts.map +1 -0
- package/dist/transitions/drill/provider/index.d.ts +3 -0
- package/dist/transitions/drill/provider/index.d.ts.map +1 -0
- package/dist/transitions/drill/provider/parallax.d.ts +3 -0
- package/dist/transitions/drill/provider/parallax.d.ts.map +1 -0
- package/dist/transitions/drill/transition.d.ts +5 -0
- package/dist/transitions/drill/transition.d.ts.map +1 -0
- package/dist/transitions/drill/types.d.ts +33 -0
- package/dist/transitions/drill/types.d.ts.map +1 -0
- package/dist/transitions/fade/index.d.ts +16 -0
- package/dist/transitions/fade/index.d.ts.map +1 -0
- package/dist/transitions/fade/transition.d.ts +6 -0
- package/dist/transitions/fade/transition.d.ts.map +1 -0
- package/dist/transitions/fade/types.d.ts +14 -0
- package/dist/transitions/fade/types.d.ts.map +1 -0
- package/dist/transitions/film/index.d.ts +16 -0
- package/dist/transitions/film/index.d.ts.map +1 -0
- package/dist/transitions/film/transition.d.ts +27 -0
- package/dist/transitions/film/transition.d.ts.map +1 -0
- package/dist/transitions/film/types.d.ts +16 -0
- package/dist/transitions/film/types.d.ts.map +1 -0
- package/dist/transitions/hero/index.d.ts +17 -0
- package/dist/transitions/hero/index.d.ts.map +1 -0
- package/dist/transitions/hero/transition.d.ts +7 -0
- package/dist/transitions/hero/transition.d.ts.map +1 -0
- package/dist/transitions/hero/types.d.ts +12 -0
- package/dist/transitions/hero/types.d.ts.map +1 -0
- package/dist/transitions/index.d.ts +11 -12
- package/dist/transitions/index.d.ts.map +1 -1
- package/dist/transitions/jaemin/index.d.ts +16 -0
- package/dist/transitions/jaemin/index.d.ts.map +1 -0
- package/dist/transitions/jaemin/transition.d.ts +18 -0
- package/dist/transitions/jaemin/transition.d.ts.map +1 -0
- package/dist/transitions/jaemin/types.d.ts +9 -0
- package/dist/transitions/jaemin/types.d.ts.map +1 -0
- package/dist/transitions/rotate/index.d.ts +15 -0
- package/dist/transitions/rotate/index.d.ts.map +1 -0
- package/dist/transitions/rotate/transition.d.ts +6 -0
- package/dist/transitions/rotate/transition.d.ts.map +1 -0
- package/dist/transitions/rotate/types.d.ts +9 -0
- package/dist/transitions/rotate/types.d.ts.map +1 -0
- package/dist/transitions/scroll/index.d.ts +15 -0
- package/dist/transitions/scroll/index.d.ts.map +1 -0
- package/dist/transitions/scroll/transition.d.ts +7 -0
- package/dist/transitions/scroll/transition.d.ts.map +1 -0
- package/dist/transitions/sheet/index.d.ts +41 -0
- package/dist/transitions/sheet/index.d.ts.map +1 -0
- package/dist/transitions/sheet/provider/background-scale.d.ts +3 -0
- package/dist/transitions/sheet/provider/background-scale.d.ts.map +1 -0
- package/dist/transitions/sheet/provider/index.d.ts +3 -0
- package/dist/transitions/sheet/provider/index.d.ts.map +1 -0
- package/dist/transitions/sheet/provider/static.d.ts +3 -0
- package/dist/transitions/sheet/provider/static.d.ts.map +1 -0
- package/dist/transitions/sheet/transition.d.ts +5 -0
- package/dist/transitions/sheet/transition.d.ts.map +1 -0
- package/dist/transitions/sheet/types.d.ts +29 -0
- package/dist/transitions/sheet/types.d.ts.map +1 -0
- package/dist/transitions/slide/index.d.ts +16 -0
- package/dist/transitions/slide/index.d.ts.map +1 -0
- package/dist/transitions/slide/transition.d.ts +7 -0
- package/dist/transitions/slide/transition.d.ts.map +1 -0
- package/dist/transitions/slide/types.d.ts +10 -0
- package/dist/transitions/slide/types.d.ts.map +1 -0
- package/dist/transitions/strip/index.d.ts +16 -0
- package/dist/transitions/strip/index.d.ts.map +1 -0
- package/dist/transitions/strip/transition.d.ts +6 -0
- package/dist/transitions/strip/transition.d.ts.map +1 -0
- package/dist/transitions/strip/types.d.ts +9 -0
- package/dist/transitions/strip/types.d.ts.map +1 -0
- package/dist/transitions/utils.d.ts +25 -5
- package/dist/transitions/utils.d.ts.map +1 -1
- package/dist/transitions/zoom/index.d.ts +22 -0
- package/dist/transitions/zoom/index.d.ts.map +1 -0
- package/dist/transitions/zoom/provider/blur.d.ts +14 -0
- package/dist/transitions/zoom/provider/blur.d.ts.map +1 -0
- package/dist/transitions/zoom/provider/expand.d.ts +10 -0
- package/dist/transitions/zoom/provider/expand.d.ts.map +1 -0
- package/dist/transitions/zoom/provider/index.d.ts +12 -0
- package/dist/transitions/zoom/provider/index.d.ts.map +1 -0
- package/dist/transitions/zoom/provider/static.d.ts +10 -0
- package/dist/transitions/zoom/provider/static.d.ts.map +1 -0
- package/dist/transitions/zoom/transition.d.ts +5 -0
- package/dist/transitions/zoom/transition.d.ts.map +1 -0
- package/dist/transitions/zoom/types.d.ts +109 -0
- package/dist/transitions/zoom/types.d.ts.map +1 -0
- package/dist/transitions/zoom/zoom-element.d.ts +4 -0
- package/dist/transitions/zoom/zoom-element.d.ts.map +1 -0
- package/dist/types/index.d.ts +174 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types.cjs +1 -1
- package/dist/types.d.ts +2 -504
- package/dist/types.js +3 -77
- package/dist/utils/get-viewport-rect.d.ts +17 -0
- package/dist/utils/get-viewport-rect.d.ts.map +1 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/prepare-outgoing.d.ts +2 -2
- package/dist/utils/prepare-outgoing.d.ts.map +1 -1
- package/dist/utils/promise-all.d.ts +18 -0
- package/dist/utils/promise-all.d.ts.map +1 -0
- package/package.json +7 -19
- package/dist/animator/integrator/double-spring-integrator.d.ts.map +0 -1
- package/dist/animator/integrator/index.d.ts.map +0 -1
- package/dist/animator/integrator/inertia-integrator.d.ts.map +0 -1
- package/dist/animator/integrator/provider.d.ts.map +0 -1
- package/dist/animator/integrator/spring-integrator.d.ts.map +0 -1
- package/dist/animator/integrator/types.d.ts.map +0 -1
- package/dist/animator/multi-animator.d.ts +0 -101
- package/dist/animator/multi-animator.d.ts.map +0 -1
- package/dist/animator/runner/css-runner.d.ts +0 -17
- package/dist/animator/runner/css-runner.d.ts.map +0 -1
- package/dist/animator/runner/keyframes-runner.d.ts +0 -14
- package/dist/animator/runner/keyframes-runner.d.ts.map +0 -1
- package/dist/animator/runner/provider.d.ts +0 -44
- package/dist/animator/runner/provider.d.ts.map +0 -1
- package/dist/animator/runner/tick-runner.d.ts +0 -16
- package/dist/animator/runner/tick-runner.d.ts.map +0 -1
- package/dist/animator/runner/ticker.d.ts +0 -38
- package/dist/animator/runner/ticker.d.ts.map +0 -1
- package/dist/animator/runner/types.d.ts +0 -34
- package/dist/animator/runner/types.d.ts.map +0 -1
- package/dist/animator/single-animator.d.ts +0 -65
- package/dist/animator/single-animator.d.ts.map +0 -1
- package/dist/animator/types.d.ts +0 -57
- package/dist/animator/types.d.ts.map +0 -1
- package/dist/presets/index.cjs +0 -1
- package/dist/presets/index.d.ts +0 -22
- package/dist/presets/index.d.ts.map +0 -1
- package/dist/presets/index.js +0 -50
- package/dist/provider-B2B8CK6H.js +0 -142
- package/dist/provider-BKaONTeg.cjs +0 -1
- package/dist/spring-integrator-95Mh7mdw.cjs +0 -1
- package/dist/spring-integrator-BM4a-82c.js +0 -33
- package/dist/transition/create-transition-callback.d.ts +0 -8
- package/dist/transition/create-transition-callback.d.ts.map +0 -1
- package/dist/transition/transition-scope.d.ts +0 -36
- package/dist/transition/transition-scope.d.ts.map +0 -1
- package/dist/transition/transition-strategy.d.ts +0 -75
- package/dist/transition/transition-strategy.d.ts.map +0 -1
- package/dist/transition/transition.d.ts +0 -51
- package/dist/transition/transition.d.ts.map +0 -1
- package/dist/transition/unmount-observer.d.ts +0 -43
- package/dist/transition/unmount-observer.d.ts.map +0 -1
- package/dist/transitions/blur.d.ts +0 -12
- package/dist/transitions/blur.d.ts.map +0 -1
- package/dist/transitions/bounce.d.ts +0 -13
- package/dist/transitions/bounce.d.ts.map +0 -1
- package/dist/transitions/fade.d.ts +0 -10
- package/dist/transitions/fade.d.ts.map +0 -1
- package/dist/transitions/fly.d.ts +0 -11
- package/dist/transitions/fly.d.ts.map +0 -1
- package/dist/transitions/index.cjs +0 -1
- package/dist/transitions/index.js +0 -285
- package/dist/transitions/mask.d.ts +0 -12
- package/dist/transitions/mask.d.ts.map +0 -1
- package/dist/transitions/none.d.ts +0 -8
- package/dist/transitions/none.d.ts.map +0 -1
- package/dist/transitions/rotate.d.ts +0 -15
- package/dist/transitions/rotate.d.ts.map +0 -1
- package/dist/transitions/scale.d.ts +0 -11
- package/dist/transitions/scale.d.ts.map +0 -1
- package/dist/transitions/slide.d.ts +0 -13
- package/dist/transitions/slide.d.ts.map +0 -1
- package/dist/types.d.ts.map +0 -1
- package/dist/view-transitions/blind.d.ts +0 -11
- package/dist/view-transitions/blind.d.ts.map +0 -1
- package/dist/view-transitions/curtain-reveal.d.ts +0 -18
- package/dist/view-transitions/curtain-reveal.d.ts.map +0 -1
- package/dist/view-transitions/depth.d.ts +0 -21
- package/dist/view-transitions/depth.d.ts.map +0 -1
- package/dist/view-transitions/drill.d.ts +0 -9
- package/dist/view-transitions/drill.d.ts.map +0 -1
- package/dist/view-transitions/fade.d.ts +0 -8
- package/dist/view-transitions/fade.d.ts.map +0 -1
- package/dist/view-transitions/film.d.ts +0 -10
- package/dist/view-transitions/film.d.ts.map +0 -1
- package/dist/view-transitions/hero.d.ts +0 -9
- package/dist/view-transitions/hero.d.ts.map +0 -1
- package/dist/view-transitions/index.cjs +0 -35
- package/dist/view-transitions/index.d.ts +0 -18
- package/dist/view-transitions/index.d.ts.map +0 -1
- package/dist/view-transitions/index.js +0 -1614
- package/dist/view-transitions/instagram.d.ts +0 -8
- package/dist/view-transitions/instagram.d.ts.map +0 -1
- package/dist/view-transitions/jaemin.d.ts +0 -21
- package/dist/view-transitions/jaemin.d.ts.map +0 -1
- package/dist/view-transitions/pinterest.d.ts +0 -8
- package/dist/view-transitions/pinterest.d.ts.map +0 -1
- package/dist/view-transitions/rotate.d.ts +0 -6
- package/dist/view-transitions/rotate.d.ts.map +0 -1
- package/dist/view-transitions/scroll.d.ts +0 -8
- package/dist/view-transitions/scroll.d.ts.map +0 -1
- package/dist/view-transitions/sheet.d.ts +0 -21
- package/dist/view-transitions/sheet.d.ts.map +0 -1
- package/dist/view-transitions/slide.d.ts +0 -8
- package/dist/view-transitions/slide.d.ts.map +0 -1
- package/dist/view-transitions/snap.d.ts +0 -16
- package/dist/view-transitions/snap.d.ts.map +0 -1
- package/dist/view-transitions/strip.d.ts +0 -7
- package/dist/view-transitions/strip.d.ts.map +0 -1
- package/dist/view-transitions/swap.d.ts +0 -15
- package/dist/view-transitions/swap.d.ts.map +0 -1
- /package/dist/{animator → animation}/integrator/double-spring-integrator.d.ts +0 -0
- /package/dist/{animator → animation}/integrator/inertia-integrator.d.ts +0 -0
- /package/dist/{animator → animation}/integrator/spring-integrator.d.ts +0 -0
- /package/dist/{animator → animation}/integrator/types.d.ts +0 -0
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
var m = Object.defineProperty;
|
|
2
|
+
var f = (r, a, t) => a in r ? m(r, a, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[a] = t;
|
|
3
|
+
var n = (r, a, t) => f(r, typeof a != "symbol" ? a + "" : a, t);
|
|
4
|
+
class d {
|
|
5
|
+
constructor() {
|
|
6
|
+
/** Current playback rate (1 = realtime, 0 = paused, negative = backwards) */
|
|
7
|
+
n(this, "_playbackRate", 1);
|
|
8
|
+
/** Fired every frame with the most recent value. Optional. */
|
|
9
|
+
n(this, "onUpdate");
|
|
10
|
+
/** Fired once when the animation settles. */
|
|
11
|
+
n(this, "onComplete");
|
|
12
|
+
}
|
|
13
|
+
get playbackRate() {
|
|
14
|
+
return this._playbackRate;
|
|
15
|
+
}
|
|
16
|
+
set playbackRate(a) {
|
|
17
|
+
this._playbackRate = a;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
const S = 0.01, w = 0.01, g = 0.05, c = 1e3 / 60;
|
|
21
|
+
class R extends d {
|
|
22
|
+
constructor(t) {
|
|
23
|
+
super();
|
|
24
|
+
n(this, "element");
|
|
25
|
+
n(this, "integrator");
|
|
26
|
+
n(this, "styleFn");
|
|
27
|
+
n(this, "lowerBound");
|
|
28
|
+
n(this, "upperBound");
|
|
29
|
+
n(this, "currentValue");
|
|
30
|
+
n(this, "currentVelocity", 0);
|
|
31
|
+
n(this, "frames", []);
|
|
32
|
+
n(this, "waapi", null);
|
|
33
|
+
n(this, "startTime", 0);
|
|
34
|
+
n(this, "running", !1);
|
|
35
|
+
n(this, "paused", !1);
|
|
36
|
+
n(this, "settled", !1);
|
|
37
|
+
n(this, "reversing", !1);
|
|
38
|
+
this.element = t.element, this.integrator = t.integrator, this.styleFn = t.style, this.lowerBound = t.lowerBound ?? 0, this.upperBound = t.upperBound ?? 1, this.currentValue = this.lowerBound, this.onUpdate = t.onUpdate, this.onComplete = t.onComplete;
|
|
39
|
+
}
|
|
40
|
+
play() {
|
|
41
|
+
if (this.reversing = !1, this.paused && this.waapi) {
|
|
42
|
+
this.paused = !1, this.running = !0, this.waapi.play();
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
this.runToward(this.upperBound);
|
|
46
|
+
}
|
|
47
|
+
reverse() {
|
|
48
|
+
this.reversing = !0, this.runToward(this.lowerBound);
|
|
49
|
+
}
|
|
50
|
+
pause() {
|
|
51
|
+
var t;
|
|
52
|
+
this.running && (this.captureLiveState(), (t = this.waapi) == null || t.pause(), this.running = !1, this.paused = !0);
|
|
53
|
+
}
|
|
54
|
+
complete() {
|
|
55
|
+
var t;
|
|
56
|
+
this.clearWaapi(), this.running = !1, this.paused = !1, this.currentValue = this.upperBound, this.currentVelocity = 0, this.applyStyleAt(this.currentValue), this.settled = !0, (t = this.onComplete) == null || t.call(this);
|
|
57
|
+
}
|
|
58
|
+
get isAnimating() {
|
|
59
|
+
return this.running;
|
|
60
|
+
}
|
|
61
|
+
get isPaused() {
|
|
62
|
+
return this.paused;
|
|
63
|
+
}
|
|
64
|
+
get isComplete() {
|
|
65
|
+
return this.settled;
|
|
66
|
+
}
|
|
67
|
+
get isReversing() {
|
|
68
|
+
return this.reversing;
|
|
69
|
+
}
|
|
70
|
+
get progress() {
|
|
71
|
+
this.running && this.captureLiveState();
|
|
72
|
+
const t = this.upperBound - this.lowerBound;
|
|
73
|
+
if (t === 0) return 0;
|
|
74
|
+
const e = (this.currentValue - this.lowerBound) / t;
|
|
75
|
+
return e < 0 ? 0 : e > 1 ? 1 : e;
|
|
76
|
+
}
|
|
77
|
+
findTimeForProgress(t) {
|
|
78
|
+
if (this.frames.length < 2) return null;
|
|
79
|
+
const e = this.upperBound - this.lowerBound;
|
|
80
|
+
if (e === 0) return 0;
|
|
81
|
+
for (const i of this.frames)
|
|
82
|
+
if ((i.position - this.lowerBound) / e >= t) return i.time;
|
|
83
|
+
return this.frames[this.frames.length - 1].time;
|
|
84
|
+
}
|
|
85
|
+
get playbackRate() {
|
|
86
|
+
return super.playbackRate;
|
|
87
|
+
}
|
|
88
|
+
set playbackRate(t) {
|
|
89
|
+
super.playbackRate = t, this.waapi && (this.waapi.playbackRate = t);
|
|
90
|
+
}
|
|
91
|
+
getPose() {
|
|
92
|
+
return this.running && this.captureLiveState(), [
|
|
93
|
+
{
|
|
94
|
+
element: this.element,
|
|
95
|
+
value: this.currentValue,
|
|
96
|
+
velocity: this.currentVelocity
|
|
97
|
+
}
|
|
98
|
+
];
|
|
99
|
+
}
|
|
100
|
+
getTimeline() {
|
|
101
|
+
const t = this.frames.map((e) => {
|
|
102
|
+
const i = e.position, s = this.lowerBound + this.upperBound - i;
|
|
103
|
+
return {
|
|
104
|
+
time: e.time,
|
|
105
|
+
value: e.position,
|
|
106
|
+
velocity: e.velocity,
|
|
107
|
+
style: this.styleFn(i, s)
|
|
108
|
+
};
|
|
109
|
+
});
|
|
110
|
+
return [{ element: this.element, frames: t }];
|
|
111
|
+
}
|
|
112
|
+
matchInto(t) {
|
|
113
|
+
const e = t.find((i) => i.element === this.element);
|
|
114
|
+
e && (this.currentValue = e.value, this.currentVelocity = e.velocity);
|
|
115
|
+
}
|
|
116
|
+
/* ───────────────────────────────────────────────────────── private */
|
|
117
|
+
runToward(t) {
|
|
118
|
+
var h;
|
|
119
|
+
if (this.running && this.captureLiveState(), this.clearWaapi(), this.running = !1, this.paused = !1, this.settled = !1, this.frames = y(
|
|
120
|
+
this.integrator,
|
|
121
|
+
this.currentValue,
|
|
122
|
+
t,
|
|
123
|
+
this.currentVelocity
|
|
124
|
+
), this.frames.length === 0) {
|
|
125
|
+
this.currentValue = t, this.currentVelocity = 0, this.applyStyleAt(t), this.settled = !0, (h = this.onComplete) == null || h.call(this);
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
const e = this.frames.map((o) => {
|
|
129
|
+
const u = o.position, p = this.lowerBound + this.upperBound - u;
|
|
130
|
+
return this.styleFn(u, p);
|
|
131
|
+
}), i = e[0];
|
|
132
|
+
if (i)
|
|
133
|
+
for (const o of Object.keys(i))
|
|
134
|
+
this.element.style[o] = "";
|
|
135
|
+
const s = this.frames[this.frames.length - 1], l = s.time;
|
|
136
|
+
this.waapi = this.element.animate(e, {
|
|
137
|
+
duration: l,
|
|
138
|
+
fill: "forwards",
|
|
139
|
+
easing: "linear",
|
|
140
|
+
composite: "replace"
|
|
141
|
+
}), this.waapi.playbackRate = this.playbackRate, this.startTime = performance.now(), this.running = !0, this.waapi.onfinish = () => {
|
|
142
|
+
var o;
|
|
143
|
+
this.running && (this.running = !1, this.settled = !0, this.currentValue = s.position, this.currentVelocity = 0, (o = this.onComplete) == null || o.call(this));
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
clearWaapi() {
|
|
147
|
+
var t;
|
|
148
|
+
(t = this.waapi) == null || t.cancel(), this.waapi = null;
|
|
149
|
+
}
|
|
150
|
+
captureLiveState() {
|
|
151
|
+
if (this.frames.length === 0) return;
|
|
152
|
+
const t = performance.now() - this.startTime, { position: e, velocity: i } = v(this.frames, t);
|
|
153
|
+
this.currentValue = e, this.currentVelocity = i;
|
|
154
|
+
}
|
|
155
|
+
applyStyleAt(t) {
|
|
156
|
+
const e = this.lowerBound + this.upperBound - t, i = this.styleFn(t, e);
|
|
157
|
+
for (const [s, l] of Object.entries(i))
|
|
158
|
+
this.element.style[s] = typeof l == "number" ? String(l) : l;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
function y(r, a, t, e) {
|
|
162
|
+
if (a === t && e === 0) return [];
|
|
163
|
+
const i = 600;
|
|
164
|
+
let s = { position: a, velocity: e }, l = 0;
|
|
165
|
+
const h = [];
|
|
166
|
+
for (let o = 0; o < i; o++) {
|
|
167
|
+
const u = o * c;
|
|
168
|
+
if (h.push({ time: u, position: s.position, velocity: s.velocity }), s = r.step(s, t, c / 1e3), r.isSettled(s, t)) {
|
|
169
|
+
if (l += c / 1e3, l >= g) {
|
|
170
|
+
h.push({
|
|
171
|
+
time: (o + 1) * c,
|
|
172
|
+
position: t,
|
|
173
|
+
velocity: 0
|
|
174
|
+
});
|
|
175
|
+
break;
|
|
176
|
+
}
|
|
177
|
+
} else
|
|
178
|
+
l = 0;
|
|
179
|
+
}
|
|
180
|
+
return h;
|
|
181
|
+
}
|
|
182
|
+
function v(r, a) {
|
|
183
|
+
if (r.length === 0) return { position: 0, velocity: 0 };
|
|
184
|
+
const t = r[0], e = r[r.length - 1];
|
|
185
|
+
if (a <= 0)
|
|
186
|
+
return { position: t.position, velocity: t.velocity };
|
|
187
|
+
if (a >= e.time)
|
|
188
|
+
return { position: e.position, velocity: e.velocity };
|
|
189
|
+
let i = 0, s = r.length - 1;
|
|
190
|
+
for (; i < s - 1; ) {
|
|
191
|
+
const u = i + s >> 1;
|
|
192
|
+
r[u].time <= a ? i = u : s = u;
|
|
193
|
+
}
|
|
194
|
+
const l = r[i], h = r[s], o = (a - l.time) / (h.time - l.time);
|
|
195
|
+
return {
|
|
196
|
+
position: l.position + (h.position - l.position) * o,
|
|
197
|
+
velocity: l.velocity + (h.velocity - l.velocity) * o
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
class b extends d {
|
|
201
|
+
constructor(t, e = {}) {
|
|
202
|
+
super();
|
|
203
|
+
n(this, "children");
|
|
204
|
+
n(this, "startAt");
|
|
205
|
+
n(this, "pendingComplete", 0);
|
|
206
|
+
n(this, "running", !1);
|
|
207
|
+
n(this, "pendingStartTimers", []);
|
|
208
|
+
this.children = t, (e.mode ?? "parallel") === "sequence" ? this.startAt = t.map((i, s) => s === 0 ? 0 : 1) : this.startAt = e.startAt ?? [];
|
|
209
|
+
}
|
|
210
|
+
play() {
|
|
211
|
+
this.startRun("play");
|
|
212
|
+
}
|
|
213
|
+
reverse() {
|
|
214
|
+
this.startRun("reverse");
|
|
215
|
+
}
|
|
216
|
+
pause() {
|
|
217
|
+
this.running = !1, this.clearPendingStartTimers();
|
|
218
|
+
for (const t of this.children) t.pause();
|
|
219
|
+
}
|
|
220
|
+
complete() {
|
|
221
|
+
var t;
|
|
222
|
+
this.running = !1, this.clearPendingStartTimers();
|
|
223
|
+
for (const e of this.children) e.complete();
|
|
224
|
+
(t = this.onComplete) == null || t.call(this);
|
|
225
|
+
}
|
|
226
|
+
get progress() {
|
|
227
|
+
if (this.children.length === 0) return 0;
|
|
228
|
+
let t = 0;
|
|
229
|
+
for (const e of this.children) t += e.progress;
|
|
230
|
+
return t / this.children.length;
|
|
231
|
+
}
|
|
232
|
+
getPose() {
|
|
233
|
+
return this.children.flatMap((t) => t.getPose());
|
|
234
|
+
}
|
|
235
|
+
getTimeline() {
|
|
236
|
+
return this.children.flatMap((t) => t.getTimeline());
|
|
237
|
+
}
|
|
238
|
+
matchInto(t) {
|
|
239
|
+
}
|
|
240
|
+
get isAnimating() {
|
|
241
|
+
return this.children.some((t) => t.isAnimating);
|
|
242
|
+
}
|
|
243
|
+
get isPaused() {
|
|
244
|
+
return this.children.some((t) => t.isPaused) && this.children.every((t) => t.isPaused || t.isComplete);
|
|
245
|
+
}
|
|
246
|
+
get isComplete() {
|
|
247
|
+
return this.children.every((t) => t.isComplete);
|
|
248
|
+
}
|
|
249
|
+
get isReversing() {
|
|
250
|
+
return this.children.some((t) => t.isReversing);
|
|
251
|
+
}
|
|
252
|
+
get playbackRate() {
|
|
253
|
+
return super.playbackRate;
|
|
254
|
+
}
|
|
255
|
+
set playbackRate(t) {
|
|
256
|
+
super.playbackRate = t;
|
|
257
|
+
for (const e of this.children) e.playbackRate = t;
|
|
258
|
+
}
|
|
259
|
+
/* ───────────────────────────────────────────────────────── private */
|
|
260
|
+
startRun(t) {
|
|
261
|
+
if (this.running && this.pause(), this.running = !0, this.pendingComplete = this.children.length, this.pendingComplete === 0) {
|
|
262
|
+
this.handleFinished();
|
|
263
|
+
return;
|
|
264
|
+
}
|
|
265
|
+
for (const e of this.children) {
|
|
266
|
+
const i = e.onComplete;
|
|
267
|
+
e.onComplete = () => {
|
|
268
|
+
i == null || i(), this.handleChildComplete();
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
this.scheduleStart(0, t);
|
|
272
|
+
}
|
|
273
|
+
// Chained start: play child `index`, then schedule the next one based on
|
|
274
|
+
// *this* child's freshly computed timeline. Doing this lazily (rather than
|
|
275
|
+
// up-front for the whole chain) is what makes it correct for >2 children —
|
|
276
|
+
// child[i+1]'s trigger ms is only knowable after child[i].play() has run
|
|
277
|
+
// `simulate()`. Single setTimeout per gap, no polling.
|
|
278
|
+
scheduleStart(t, e) {
|
|
279
|
+
if (!this.running || t >= this.children.length) return;
|
|
280
|
+
this.children[t][e]();
|
|
281
|
+
const i = t + 1;
|
|
282
|
+
if (i >= this.children.length) return;
|
|
283
|
+
const s = this.startAt[i];
|
|
284
|
+
if (s === void 0 || s <= 0) {
|
|
285
|
+
this.scheduleStart(i, e);
|
|
286
|
+
return;
|
|
287
|
+
}
|
|
288
|
+
const l = this.children[t].findTimeForProgress(s);
|
|
289
|
+
if (l === null || l <= 0) {
|
|
290
|
+
this.scheduleStart(i, e);
|
|
291
|
+
return;
|
|
292
|
+
}
|
|
293
|
+
const h = Math.abs(this.playbackRate) || 1, o = l / h, u = setTimeout(() => {
|
|
294
|
+
this.pendingStartTimers = this.pendingStartTimers.filter(
|
|
295
|
+
(p) => p !== u
|
|
296
|
+
), this.running && this.scheduleStart(i, e);
|
|
297
|
+
}, o);
|
|
298
|
+
this.pendingStartTimers.push(u);
|
|
299
|
+
}
|
|
300
|
+
clearPendingStartTimers() {
|
|
301
|
+
for (const t of this.pendingStartTimers) clearTimeout(t);
|
|
302
|
+
this.pendingStartTimers = [];
|
|
303
|
+
}
|
|
304
|
+
handleChildComplete() {
|
|
305
|
+
this.pendingComplete--, this.pendingComplete <= 0 && this.handleFinished();
|
|
306
|
+
}
|
|
307
|
+
handleFinished() {
|
|
308
|
+
var t;
|
|
309
|
+
this.running = !1, this.clearPendingStartTimers(), (t = this.onComplete) == null || t.call(this);
|
|
310
|
+
}
|
|
311
|
+
findTimeForProgress(t) {
|
|
312
|
+
return null;
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
export {
|
|
316
|
+
d as A,
|
|
317
|
+
b as M,
|
|
318
|
+
S as P,
|
|
319
|
+
g as S,
|
|
320
|
+
w as V,
|
|
321
|
+
R as W
|
|
322
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var f=Object.defineProperty;var g=(r,a,t)=>a in r?f(r,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[a]=t;var n=(r,a,t)=>g(r,typeof a!="symbol"?a+"":a,t);class d{constructor(){n(this,"_playbackRate",1);n(this,"onUpdate");n(this,"onComplete")}get playbackRate(){return this._playbackRate}set playbackRate(a){this._playbackRate=a}}const y=.01,T=.01,m=.05,c=1e3/60;class v extends d{constructor(t){super();n(this,"element");n(this,"integrator");n(this,"styleFn");n(this,"lowerBound");n(this,"upperBound");n(this,"currentValue");n(this,"currentVelocity",0);n(this,"frames",[]);n(this,"waapi",null);n(this,"startTime",0);n(this,"running",!1);n(this,"paused",!1);n(this,"settled",!1);n(this,"reversing",!1);this.element=t.element,this.integrator=t.integrator,this.styleFn=t.style,this.lowerBound=t.lowerBound??0,this.upperBound=t.upperBound??1,this.currentValue=this.lowerBound,this.onUpdate=t.onUpdate,this.onComplete=t.onComplete}play(){if(this.reversing=!1,this.paused&&this.waapi){this.paused=!1,this.running=!0,this.waapi.play();return}this.runToward(this.upperBound)}reverse(){this.reversing=!0,this.runToward(this.lowerBound)}pause(){var t;this.running&&(this.captureLiveState(),(t=this.waapi)==null||t.pause(),this.running=!1,this.paused=!0)}complete(){var t;this.clearWaapi(),this.running=!1,this.paused=!1,this.currentValue=this.upperBound,this.currentVelocity=0,this.applyStyleAt(this.currentValue),this.settled=!0,(t=this.onComplete)==null||t.call(this)}get isAnimating(){return this.running}get isPaused(){return this.paused}get isComplete(){return this.settled}get isReversing(){return this.reversing}get progress(){this.running&&this.captureLiveState();const t=this.upperBound-this.lowerBound;if(t===0)return 0;const e=(this.currentValue-this.lowerBound)/t;return e<0?0:e>1?1:e}findTimeForProgress(t){if(this.frames.length<2)return null;const e=this.upperBound-this.lowerBound;if(e===0)return 0;for(const i of this.frames)if((i.position-this.lowerBound)/e>=t)return i.time;return this.frames[this.frames.length-1].time}get playbackRate(){return super.playbackRate}set playbackRate(t){super.playbackRate=t,this.waapi&&(this.waapi.playbackRate=t)}getPose(){return this.running&&this.captureLiveState(),[{element:this.element,value:this.currentValue,velocity:this.currentVelocity}]}getTimeline(){const t=this.frames.map(e=>{const i=e.position,s=this.lowerBound+this.upperBound-i;return{time:e.time,value:e.position,velocity:e.velocity,style:this.styleFn(i,s)}});return[{element:this.element,frames:t}]}matchInto(t){const e=t.find(i=>i.element===this.element);e&&(this.currentValue=e.value,this.currentVelocity=e.velocity)}runToward(t){var h;if(this.running&&this.captureLiveState(),this.clearWaapi(),this.running=!1,this.paused=!1,this.settled=!1,this.frames=S(this.integrator,this.currentValue,t,this.currentVelocity),this.frames.length===0){this.currentValue=t,this.currentVelocity=0,this.applyStyleAt(t),this.settled=!0,(h=this.onComplete)==null||h.call(this);return}const e=this.frames.map(o=>{const u=o.position,p=this.lowerBound+this.upperBound-u;return this.styleFn(u,p)}),i=e[0];if(i)for(const o of Object.keys(i))this.element.style[o]="";const s=this.frames[this.frames.length-1],l=s.time;this.waapi=this.element.animate(e,{duration:l,fill:"forwards",easing:"linear",composite:"replace"}),this.waapi.playbackRate=this.playbackRate,this.startTime=performance.now(),this.running=!0,this.waapi.onfinish=()=>{var o;this.running&&(this.running=!1,this.settled=!0,this.currentValue=s.position,this.currentVelocity=0,(o=this.onComplete)==null||o.call(this))}}clearWaapi(){var t;(t=this.waapi)==null||t.cancel(),this.waapi=null}captureLiveState(){if(this.frames.length===0)return;const t=performance.now()-this.startTime,{position:e,velocity:i}=R(this.frames,t);this.currentValue=e,this.currentVelocity=i}applyStyleAt(t){const e=this.lowerBound+this.upperBound-t,i=this.styleFn(t,e);for(const[s,l]of Object.entries(i))this.element.style[s]=typeof l=="number"?String(l):l}}function S(r,a,t,e){if(a===t&&e===0)return[];const i=600;let s={position:a,velocity:e},l=0;const h=[];for(let o=0;o<i;o++){const u=o*c;if(h.push({time:u,position:s.position,velocity:s.velocity}),s=r.step(s,t,c/1e3),r.isSettled(s,t)){if(l+=c/1e3,l>=m){h.push({time:(o+1)*c,position:t,velocity:0});break}}else l=0}return h}function R(r,a){if(r.length===0)return{position:0,velocity:0};const t=r[0],e=r[r.length-1];if(a<=0)return{position:t.position,velocity:t.velocity};if(a>=e.time)return{position:e.position,velocity:e.velocity};let i=0,s=r.length-1;for(;i<s-1;){const u=i+s>>1;r[u].time<=a?i=u:s=u}const l=r[i],h=r[s],o=(a-l.time)/(h.time-l.time);return{position:l.position+(h.position-l.position)*o,velocity:l.velocity+(h.velocity-l.velocity)*o}}class w extends d{constructor(t,e={}){super();n(this,"children");n(this,"startAt");n(this,"pendingComplete",0);n(this,"running",!1);n(this,"pendingStartTimers",[]);this.children=t,(e.mode??"parallel")==="sequence"?this.startAt=t.map((i,s)=>s===0?0:1):this.startAt=e.startAt??[]}play(){this.startRun("play")}reverse(){this.startRun("reverse")}pause(){this.running=!1,this.clearPendingStartTimers();for(const t of this.children)t.pause()}complete(){var t;this.running=!1,this.clearPendingStartTimers();for(const e of this.children)e.complete();(t=this.onComplete)==null||t.call(this)}get progress(){if(this.children.length===0)return 0;let t=0;for(const e of this.children)t+=e.progress;return t/this.children.length}getPose(){return this.children.flatMap(t=>t.getPose())}getTimeline(){return this.children.flatMap(t=>t.getTimeline())}matchInto(t){}get isAnimating(){return this.children.some(t=>t.isAnimating)}get isPaused(){return this.children.some(t=>t.isPaused)&&this.children.every(t=>t.isPaused||t.isComplete)}get isComplete(){return this.children.every(t=>t.isComplete)}get isReversing(){return this.children.some(t=>t.isReversing)}get playbackRate(){return super.playbackRate}set playbackRate(t){super.playbackRate=t;for(const e of this.children)e.playbackRate=t}startRun(t){if(this.running&&this.pause(),this.running=!0,this.pendingComplete=this.children.length,this.pendingComplete===0){this.handleFinished();return}for(const e of this.children){const i=e.onComplete;e.onComplete=()=>{i==null||i(),this.handleChildComplete()}}this.scheduleStart(0,t)}scheduleStart(t,e){if(!this.running||t>=this.children.length)return;this.children[t][e]();const i=t+1;if(i>=this.children.length)return;const s=this.startAt[i];if(s===void 0||s<=0){this.scheduleStart(i,e);return}const l=this.children[t].findTimeForProgress(s);if(l===null||l<=0){this.scheduleStart(i,e);return}const h=Math.abs(this.playbackRate)||1,o=l/h,u=setTimeout(()=>{this.pendingStartTimers=this.pendingStartTimers.filter(p=>p!==u),this.running&&this.scheduleStart(i,e)},o);this.pendingStartTimers.push(u)}clearPendingStartTimers(){for(const t of this.pendingStartTimers)clearTimeout(t);this.pendingStartTimers=[]}handleChildComplete(){this.pendingComplete--,this.pendingComplete<=0&&this.handleFinished()}handleFinished(){var t;this.running=!1,this.clearPendingStartTimers(),(t=this.onComplete)==null||t.call(this)}findTimeForProgress(t){return null}}exports.Animation=d;exports.MultiAnimation=w;exports.POSITION_THRESHOLD=y;exports.SETTLE_THRESHOLD=m;exports.VELOCITY_THRESHOLD=T;exports.WebAnimation=v;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-context-manager.d.ts","sourceRoot":"","sources":["../../src/lib/ssgoi-transition/create-context-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAoB,MAAM,
|
|
1
|
+
{"version":3,"file":"create-context-manager.d.ts","sourceRoot":"","sources":["../../src/lib/ssgoi-transition/create-context-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAoB,MAAM,QAAQ,CAAC;AAgBrE,MAAM,MAAM,qBAAqB,GAAG;IAClC;;;OAGG;IACH,cAAc,CAAC,EAAE,oBAAoB,CAAC;CACvC,CAAC;AAEF,wBAAgB,oBAAoB,CAAC,OAAO,GAAE,qBAA0B;iCAqIlC,WAAW,QAAQ,MAAM;mCAwDpD,MAAM,OACR,MAAM,KACV;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE;gCAuBQ,MAAM;2BAxJX,MAAM,KAAG,OAAO;;;+BAmKZ,MAAM,KAAG;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE;EAgBpE"}
|
|
@@ -1,35 +1,22 @@
|
|
|
1
|
-
import { SsgoiConfig, SsgoiContext
|
|
1
|
+
import { SsgoiConfig, SsgoiContext } from '../types/index.ts';
|
|
2
|
+
import { HostAnimation } from '../animation/host-animation';
|
|
2
3
|
/**
|
|
3
|
-
*
|
|
4
|
+
* Page-level transition context.
|
|
4
5
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* **Observer mode (outFirst: false)**: OUT and IN can arrive in any order
|
|
13
|
-
* - Best for frameworks using MutationObserver (React, Vue, Solid)
|
|
14
|
-
* - Either OUT or IN can arrive first
|
|
15
|
-
* - Both wait indefinitely for the other to complete the pair
|
|
16
|
-
*
|
|
17
|
-
* Flow:
|
|
18
|
-
* 1. First transition arrives → Creates pendingTransition
|
|
19
|
-
* 2. Second transition arrives → Completes the pair
|
|
20
|
-
* 3. checkAndResolve → Finds matching transition and resolves both
|
|
21
|
-
*/
|
|
22
|
-
/**
|
|
23
|
-
* Creates a transition configuration
|
|
24
|
-
*
|
|
25
|
-
* @example
|
|
26
|
-
* const config = createSggoiTransitionConfig({
|
|
27
|
-
* transitions: [
|
|
28
|
-
* { from: '/home', to: '/about', transition: fade() },
|
|
29
|
-
* { from: '/products', to: '/products/*', transition: slide() }
|
|
30
|
-
* ],
|
|
31
|
-
* defaultTransition: fade()
|
|
32
|
-
* });
|
|
6
|
+
* Pure promise plumbing: the framework adapter calls `in(element)` on mount
|
|
7
|
+
* and `out(element)` on unmount; the dispatcher pairs them by path via
|
|
8
|
+
* NavigationDetector, then `.then`-chains the prepare result, the cloned
|
|
9
|
+
* `from` element, and the `to` element. `animation()` runs once the chain
|
|
10
|
+
* resolves — never via blocking `await` — so a follow-up navigation can
|
|
11
|
+
* start its own pair while a prior one is still building.
|
|
33
12
|
*/
|
|
34
|
-
export
|
|
13
|
+
export interface CreateSsgoiTransitionContextOptions {
|
|
14
|
+
/**
|
|
15
|
+
* Long-lived host that owns playback state across consecutive transitions.
|
|
16
|
+
* Pass one in to drive play/pause/rate from the outside (e.g. dev tools).
|
|
17
|
+
* Omit it and the context spins up its own internal host.
|
|
18
|
+
*/
|
|
19
|
+
host?: HostAnimation;
|
|
20
|
+
}
|
|
21
|
+
export declare function createSggoiTransitionContext(options: SsgoiConfig, contextOptions?: CreateSsgoiTransitionContextOptions): SsgoiContext;
|
|
35
22
|
//# sourceMappingURL=create-ssgoi-transition-context.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-ssgoi-transition-context.d.ts","sourceRoot":"","sources":["../../src/lib/ssgoi-transition/create-ssgoi-transition-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"create-ssgoi-transition-context.d.ts","sourceRoot":"","sources":["../../src/lib/ssgoi-transition/create-ssgoi-transition-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,WAAW,EACX,YAAY,EAMb,MAAM,QAAQ,CAAC;AAQhB,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAiC5D;;;;;;;;;GASG;AACH,MAAM,WAAW,mCAAmC;IAClD;;;;OAIG;IACH,IAAI,CAAC,EAAE,aAAa,CAAC;CACtB;AAED,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,WAAW,EACpB,cAAc,GAAE,mCAAwC,GACvD,YAAY,CAuPd"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TransitionConfig } from '../types/index.ts';
|
|
2
2
|
/**
|
|
3
3
|
* Matches a path against a pattern
|
|
4
4
|
* Supports exact matches and wildcard patterns
|
|
@@ -16,9 +16,9 @@ export declare function matchPath(path: string, pattern: string): boolean;
|
|
|
16
16
|
* First tries to find exact match for both from and to paths,
|
|
17
17
|
* then falls back to wildcard matches if no exact match is found.
|
|
18
18
|
*/
|
|
19
|
-
export declare function findMatchingTransition
|
|
19
|
+
export declare function findMatchingTransition(from: string, to: string, transitions: Array<{
|
|
20
20
|
from: string;
|
|
21
21
|
to: string;
|
|
22
|
-
transition:
|
|
23
|
-
}>):
|
|
22
|
+
transition: TransitionConfig;
|
|
23
|
+
}>): TransitionConfig | null;
|
|
24
24
|
//# sourceMappingURL=find-matching-transition.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"find-matching-transition.d.ts","sourceRoot":"","sources":["../../src/lib/ssgoi-transition/find-matching-transition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"find-matching-transition.d.ts","sourceRoot":"","sources":["../../src/lib/ssgoi-transition/find-matching-transition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAE/C;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAehE;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,MAAM,EACV,WAAW,EAAE,KAAK,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,gBAAgB,CAAC;CAC9B,CAAC,GACD,gBAAgB,GAAG,IAAI,CAmBzB"}
|
|
@@ -2,9 +2,7 @@
|
|
|
2
2
|
* Navigation Detector Strategy
|
|
3
3
|
*
|
|
4
4
|
* Collects out/in navigation events and provides navigation pairs.
|
|
5
|
-
*
|
|
6
|
-
* - OutFirst: OUT must arrive before IN (for Svelte)
|
|
7
|
-
* - AnyOrder: OUT and IN can arrive in any order (for React, Vue, Solid)
|
|
5
|
+
* OUT and IN can arrive in any order.
|
|
8
6
|
*/
|
|
9
7
|
export type NavigationPair = {
|
|
10
8
|
from: string;
|
|
@@ -17,26 +15,18 @@ export interface NavigationDetector {
|
|
|
17
15
|
trigger(path: string, type: "out" | "in"): void;
|
|
18
16
|
/**
|
|
19
17
|
* Get navigation pair when ready
|
|
20
|
-
* Returns null if
|
|
18
|
+
* Returns null if a pending transition is cancelled.
|
|
21
19
|
*/
|
|
22
20
|
get(type: "out" | "in"): Promise<NavigationPair | null>;
|
|
23
21
|
}
|
|
24
22
|
export type CreateNavigationDetector = () => NavigationDetector;
|
|
25
23
|
/**
|
|
26
|
-
*
|
|
24
|
+
* Navigation detector
|
|
27
25
|
*
|
|
28
|
-
* OUT
|
|
29
|
-
* - OUT triggers first, then IN completes the pair
|
|
30
|
-
* - If IN arrives without OUT, returns null (page refresh case)
|
|
31
|
-
*/
|
|
32
|
-
export declare function createOutFirstDetector(): NavigationDetector;
|
|
33
|
-
/**
|
|
34
|
-
* AnyOrder Strategy
|
|
35
|
-
*
|
|
36
|
-
* OUT and IN can arrive in any order. Best for frameworks using MutationObserver.
|
|
26
|
+
* OUT and IN can arrive in any order.
|
|
37
27
|
* - Either OUT or IN can arrive first
|
|
38
28
|
* - Both wait indefinitely for the other to complete the pair
|
|
39
29
|
* - If a new path arrives, cancels the previous pending transition
|
|
40
30
|
*/
|
|
41
|
-
export declare function
|
|
31
|
+
export declare function createNavigationDetector(): NavigationDetector;
|
|
42
32
|
//# sourceMappingURL=navigation-detector-strategy.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation-detector-strategy.d.ts","sourceRoot":"","sources":["../../src/lib/ssgoi-transition/navigation-detector-strategy.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"navigation-detector-strategy.d.ts","sourceRoot":"","sources":["../../src/lib/ssgoi-transition/navigation-detector-strategy.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAEF,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,GAAG,IAAI,GAAG,IAAI,CAAC;IAEhD;;;OAGG;IACH,GAAG,CAAC,IAAI,EAAE,KAAK,GAAG,IAAI,GAAG,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;CACzD;AAED,MAAM,MAAM,wBAAwB,GAAG,MAAM,kBAAkB,CAAC;AAShE;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,IAAI,kBAAkB,CA+E7D"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SsgoiPathTransition } from '../types/index.ts';
|
|
2
2
|
/**
|
|
3
3
|
* Processes symmetric transitions to create bidirectional navigation
|
|
4
4
|
* For each symmetric transition, creates a reverse transition automatically
|
|
5
5
|
*/
|
|
6
|
-
export declare function processSymmetricTransitions(transitions:
|
|
6
|
+
export declare function processSymmetricTransitions(transitions: readonly SsgoiPathTransition[]): Omit<SsgoiPathTransition, "symmetric">[];
|
|
7
7
|
//# sourceMappingURL=process-symmetric-transitions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"process-symmetric-transitions.d.ts","sourceRoot":"","sources":["../../src/lib/ssgoi-transition/process-symmetric-transitions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"process-symmetric-transitions.d.ts","sourceRoot":"","sources":["../../src/lib/ssgoi-transition/process-symmetric-transitions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAC;AAElD;;;GAGG;AACH,wBAAgB,2BAA2B,CACzC,WAAW,EAAE,SAAS,mBAAmB,EAAE,GAC1C,IAAI,CAAC,mBAAmB,EAAE,WAAW,CAAC,EAAE,CAU1C"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared MutationObserver for detecting element unmount.
|
|
3
|
+
*
|
|
4
|
+
* One observer watches `document.body` with `subtree: true`. Each watched
|
|
5
|
+
* element registers a callback; when ANY DOM removal happens, the observer
|
|
6
|
+
* walks the removed subtree and fires the callback for any tracked element
|
|
7
|
+
* it finds (including descendants of the actually-removed node).
|
|
8
|
+
*
|
|
9
|
+
* One shared observer beats per-element observers for two reasons:
|
|
10
|
+
* - parent re-mounts that detach the watched node also fire
|
|
11
|
+
* - lower memory / browser overhead than dozens of observers
|
|
12
|
+
*/
|
|
13
|
+
type UnmountCallback = () => void;
|
|
14
|
+
/** Register `cb` to fire when `element` is removed from the DOM. */
|
|
15
|
+
export declare function watchUnmount(element: HTMLElement, cb: UnmountCallback): () => void;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=unmount-observer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unmount-observer.d.ts","sourceRoot":"","sources":["../../src/lib/ssgoi-transition/unmount-observer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,KAAK,eAAe,GAAG,MAAM,IAAI,CAAC;AA2ClC,oEAAoE;AACpE,wBAAgB,YAAY,CAC1B,OAAO,EAAE,WAAW,EACpB,EAAE,EAAE,eAAe,GAClB,MAAM,IAAI,CAMZ"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { SsgoiPathTransition } from '../../types/index.ts';
|
|
2
|
+
/**
|
|
3
|
+
* Public `variant` value for `axis({ type: "x" })`.
|
|
4
|
+
*
|
|
5
|
+
* - `"default"` — relaxed, fluid feel (Flutter SharedAxisTransition style).
|
|
6
|
+
* - `"snappy"` — tight, decisive page swap (KakaoTalk style).
|
|
7
|
+
*/
|
|
8
|
+
export type AxisXVariant = "default" | "snappy";
|
|
9
|
+
/**
|
|
10
|
+
* Legacy `feel` axis. Kept for source compatibility only.
|
|
11
|
+
*
|
|
12
|
+
* @deprecated Do not use in new code. v6 only supports `{ type, variant, options }`.
|
|
13
|
+
* Migrate `feel: "fluid"` → omit `variant` (default tone),
|
|
14
|
+
* `feel: "snappy"` → `variant: "snappy"`.
|
|
15
|
+
* Example: `axis({ paths, type: "x", variant: "snappy" })`.
|
|
16
|
+
* Kept here only for backward compatibility — will be removed in a future major.
|
|
17
|
+
*/
|
|
18
|
+
export type AxisFeelDeprecated = "snappy" | "fluid";
|
|
19
|
+
export type AxisConfig = {
|
|
20
|
+
paths: readonly string[];
|
|
21
|
+
} & ({
|
|
22
|
+
type?: "x";
|
|
23
|
+
variant?: AxisXVariant;
|
|
24
|
+
options?: {};
|
|
25
|
+
/**
|
|
26
|
+
* @deprecated Do not use in new code. v6 only supports `{ type, variant, options }`.
|
|
27
|
+
* Migrate `feel: "fluid"` → omit `variant` (default tone),
|
|
28
|
+
* `feel: "snappy"` → `variant: "snappy"`.
|
|
29
|
+
* Example: `axis({ paths, type: "x", variant: "snappy" })`.
|
|
30
|
+
* Kept here only for backward compatibility — will be removed in a future major.
|
|
31
|
+
*/
|
|
32
|
+
feel?: AxisFeelDeprecated;
|
|
33
|
+
} | {
|
|
34
|
+
type: "y";
|
|
35
|
+
variant?: "default";
|
|
36
|
+
options?: {};
|
|
37
|
+
} | {
|
|
38
|
+
type: "z";
|
|
39
|
+
variant?: "default";
|
|
40
|
+
options?: {};
|
|
41
|
+
});
|
|
42
|
+
export declare function axis(config: AxisConfig): SsgoiPathTransition[];
|
|
43
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/transitions/axis/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAC;AAiBlD;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,QAAQ,CAAC;AAEhD;;;;;;;;GAQG;AACH,MAAM,MAAM,kBAAkB,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEpD,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;CAC1B,GAAG,CACA;IACE,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,OAAO,CAAC,EAAE,EAAE,CAAC;IACb;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,kBAAkB,CAAC;CAC3B,GACD;IAAE,IAAI,EAAE,GAAG,CAAC;IAAC,OAAO,CAAC,EAAE,SAAS,CAAC;IAAC,OAAO,CAAC,EAAE,EAAE,CAAA;CAAE,GAChD;IAAE,IAAI,EAAE,GAAG,CAAC;IAAC,OAAO,CAAC,EAAE,SAAS,CAAC;IAAC,OAAO,CAAC,EAAE,EAAE,CAAA;CAAE,CACnD,CAAC;AA4BF,wBAAgB,IAAI,CAAC,MAAM,EAAE,UAAU,GAAG,mBAAmB,EAAE,CAY9D"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AxisFeel, AxisProvider, AxisType } from '../types';
|
|
2
|
+
type AxisProviderMap = {
|
|
3
|
+
snappy: AxisProvider;
|
|
4
|
+
} & Partial<Record<AxisFeel, AxisProvider>>;
|
|
5
|
+
export declare const AXIS_PROVIDERS: Record<AxisType, AxisProviderMap>;
|
|
6
|
+
export declare function resolveAxisProvider(type: AxisType, feel: AxisFeel): AxisProvider;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/transitions/axis/provider/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAKjE,KAAK,eAAe,GAAG;IAAE,MAAM,EAAE,YAAY,CAAA;CAAE,GAAG,OAAO,CACvD,MAAM,CAAC,QAAQ,EAAE,YAAY,CAAC,CAC/B,CAAC;AAKF,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,QAAQ,EAAE,eAAe,CAM5D,CAAC;AAEF,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,QAAQ,EACd,IAAI,EAAE,QAAQ,GACb,YAAY,CAGd"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fluid.d.ts","sourceRoot":"","sources":["../../../../../src/lib/transitions/axis/provider/x/fluid.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,YAAY,EAEb,MAAM,aAAa,CAAC;AAyDrB,wBAAgB,oBAAoB,IAAI,YAAY,CAUnD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/transitions/axis/provider/x/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAK1D,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,QAAQ,EAAE,YAAY,CAGtD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snappy.d.ts","sourceRoot":"","sources":["../../../../../src/lib/transitions/axis/provider/x/snappy.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,YAAY,EAEb,MAAM,aAAa,CAAC;AAmDrB,wBAAgB,qBAAqB,IAAI,YAAY,CASpD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"y.d.ts","sourceRoot":"","sources":["../../../../src/lib/transitions/axis/provider/y.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,YAAY,EAEb,MAAM,UAAU,CAAC;AAuClB,wBAAgB,eAAe,IAAI,YAAY,CAO9C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"z.d.ts","sourceRoot":"","sources":["../../../../src/lib/transitions/axis/provider/z.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAuB,YAAY,EAAE,MAAM,UAAU,CAAC;AAqClE,wBAAgB,eAAe,IAAI,YAAY,CAU9C"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { TransitionConfig } from '../../types/index.ts';
|
|
2
|
+
import { AxisOptions } from './types';
|
|
3
|
+
export type { AxisFeel, AxisOptions, AxisType } from './types';
|
|
4
|
+
export declare const axis: (options?: AxisOptions) => TransitionConfig;
|
|
5
|
+
//# sourceMappingURL=transition.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transition.d.ts","sourceRoot":"","sources":["../../../src/lib/transitions/axis/transition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAO/C,OAAO,KAAK,EAAY,WAAW,EAA4B,MAAM,SAAS,CAAC;AAE/E,YAAY,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAuB/D,eAAO,MAAM,IAAI,GAAI,UAAS,WAAgB,KAAG,gBAsChD,CAAC"}
|