@ssgoi/core 5.2.1 → 6.0.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/animation/animation.d.ts +50 -0
- package/dist/animation/animation.d.ts.map +1 -0
- package/dist/animation/host-animation.d.ts +43 -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 +39 -0
- package/dist/animation/multi-animation.d.ts.map +1 -0
- package/dist/animation/web-animation.d.ts +63 -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 +1271 -1192
- 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 +504 -0
- package/dist/multi-animation-B_Hl1HEU.cjs +1 -0
- package/dist/multi-animation-CST6aZ8y.js +276 -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/blind/index.d.ts +6 -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 +9 -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 +23 -0
- package/dist/transitions/drill/types.d.ts.map +1 -0
- package/dist/transitions/fade/index.d.ts +6 -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/film/index.d.ts +6 -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/hero/index.d.ts +6 -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/index.d.ts +10 -12
- package/dist/transitions/index.d.ts.map +1 -1
- package/dist/transitions/jaemin/index.d.ts +6 -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/rotate/index.d.ts +6 -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/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 +9 -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 +19 -0
- package/dist/transitions/sheet/types.d.ts.map +1 -0
- package/dist/transitions/slide/index.d.ts +6 -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/strip/index.d.ts +6 -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/utils.d.ts +11 -7
- package/dist/transitions/utils.d.ts.map +1 -1
- package/dist/transitions/zoom/index.d.ts +8 -0
- package/dist/transitions/zoom/index.d.ts.map +1 -0
- package/dist/transitions/zoom/provider/expand.d.ts +5 -0
- package/dist/transitions/zoom/provider/expand.d.ts.map +1 -0
- package/dist/transitions/zoom/provider/index.d.ts +3 -0
- package/dist/transitions/zoom/provider/index.d.ts.map +1 -0
- package/dist/transitions/zoom/provider/static.d.ts +5 -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 +34 -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 +175 -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-scrolling-element.d.ts.map +1 -1
- 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
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
var v = Object.defineProperty;
|
|
2
|
-
var E = (r, e, t) => e in r ? v(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
3
|
-
var n = (r, e, t) => E(r, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
-
import { P as M, V as O, a as b } from "./spring-integrator-BM4a-82c.js";
|
|
5
|
-
class F {
|
|
6
|
-
constructor(e) {
|
|
7
|
-
n(this, "leader");
|
|
8
|
-
n(this, "follower");
|
|
9
|
-
n(this, "restDelta");
|
|
10
|
-
n(this, "restSpeed");
|
|
11
|
-
this.restDelta = e.restDelta ?? M, this.restSpeed = e.restSpeed ?? O, this.leader = new b({
|
|
12
|
-
stiffness: e.stiffness,
|
|
13
|
-
damping: e.damping,
|
|
14
|
-
restDelta: this.restDelta,
|
|
15
|
-
restSpeed: this.restSpeed
|
|
16
|
-
});
|
|
17
|
-
let t, s, i, a;
|
|
18
|
-
typeof e.follower == "number" ? (t = e.stiffness * e.follower, s = e.damping) : e.follower ? (t = e.follower.stiffness, s = e.follower.damping, i = e.follower.restDelta, a = e.follower.restSpeed) : (t = e.stiffness, s = e.damping), this.follower = new b({
|
|
19
|
-
stiffness: t,
|
|
20
|
-
damping: s,
|
|
21
|
-
restDelta: i ?? this.restDelta,
|
|
22
|
-
restSpeed: a ?? this.restSpeed
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
step(e, t, s) {
|
|
26
|
-
const a = e._leader ?? {
|
|
27
|
-
position: e.position,
|
|
28
|
-
velocity: e.velocity
|
|
29
|
-
}, p = this.leader.step(a, t, s), m = this.follower.step(
|
|
30
|
-
e,
|
|
31
|
-
p.position,
|
|
32
|
-
s
|
|
33
|
-
);
|
|
34
|
-
return {
|
|
35
|
-
position: m.position,
|
|
36
|
-
velocity: m.velocity,
|
|
37
|
-
_leader: p
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
isSettled(e, t) {
|
|
41
|
-
const s = e, i = Math.abs(t - e.position) < this.restDelta && Math.abs(e.velocity) < this.restSpeed;
|
|
42
|
-
return s._leader ? Math.abs(t - s._leader.position) < this.restDelta && Math.abs(s._leader.velocity) < this.restSpeed && i : i;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
const x = 0.01, L = 500, H = 10;
|
|
46
|
-
class N {
|
|
47
|
-
constructor(e) {
|
|
48
|
-
n(this, "acceleration");
|
|
49
|
-
n(this, "resistance");
|
|
50
|
-
n(this, "resistanceType");
|
|
51
|
-
n(this, "min");
|
|
52
|
-
n(this, "max");
|
|
53
|
-
n(this, "bounceStiffness");
|
|
54
|
-
n(this, "bounceDamping");
|
|
55
|
-
n(this, "restDelta");
|
|
56
|
-
this.acceleration = e.acceleration, this.resistance = e.resistance, this.resistanceType = e.resistanceType ?? "quadratic", this.min = e.min, this.max = e.max, this.bounceStiffness = e.bounceStiffness ?? L, this.bounceDamping = e.bounceDamping ?? H, this.restDelta = e.restDelta ?? x;
|
|
57
|
-
}
|
|
58
|
-
step(e, t, s) {
|
|
59
|
-
const i = Math.min(s, 0.033), { acceleration: a, resistance: p, resistanceType: m, min: S, max: h } = this, { position: l, velocity: c } = e, D = S !== void 0 && l < S, w = h !== void 0 && l > h;
|
|
60
|
-
let u;
|
|
61
|
-
if (D || w) {
|
|
62
|
-
const f = l - (D ? S : h), I = -this.bounceStiffness * f, _ = -this.bounceDamping * c;
|
|
63
|
-
u = I + _;
|
|
64
|
-
} else {
|
|
65
|
-
const d = t > l ? 1 : -1;
|
|
66
|
-
let f;
|
|
67
|
-
m === "linear" ? f = p * c : f = p * c * Math.abs(c), u = d * a - f;
|
|
68
|
-
}
|
|
69
|
-
const y = c + u * i;
|
|
70
|
-
let o = l + y * i;
|
|
71
|
-
if (!D && !w) {
|
|
72
|
-
const d = t > l ? 1 : -1;
|
|
73
|
-
(d > 0 && o > t || d < 0 && o < t) && (o = t);
|
|
74
|
-
}
|
|
75
|
-
return {
|
|
76
|
-
position: o,
|
|
77
|
-
velocity: o === t ? 0 : y
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
isSettled(e, t) {
|
|
81
|
-
return Math.abs(t - e.position) < this.restDelta;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
class T {
|
|
85
|
-
/**
|
|
86
|
-
* Create an Integrator from physics config
|
|
87
|
-
*
|
|
88
|
-
* @param config Physics configuration (spring or inertia)
|
|
89
|
-
* @returns Appropriate Integrator instance
|
|
90
|
-
* @throws Error if both spring and inertia are provided
|
|
91
|
-
*/
|
|
92
|
-
static from(e) {
|
|
93
|
-
if (e.spring && e.inertia)
|
|
94
|
-
throw new Error(
|
|
95
|
-
"Cannot use both 'spring' and 'inertia' together. Choose one physics type."
|
|
96
|
-
);
|
|
97
|
-
if (e.inertia)
|
|
98
|
-
return new N({
|
|
99
|
-
acceleration: e.inertia.acceleration,
|
|
100
|
-
resistance: e.inertia.resistance,
|
|
101
|
-
resistanceType: e.inertia.resistanceType,
|
|
102
|
-
min: e.inertia.min,
|
|
103
|
-
max: e.inertia.max,
|
|
104
|
-
bounceStiffness: e.inertia.bounceStiffness,
|
|
105
|
-
bounceDamping: e.inertia.bounceDamping,
|
|
106
|
-
restDelta: e.inertia.restDelta
|
|
107
|
-
});
|
|
108
|
-
const t = e.spring ?? { stiffness: 300, damping: 30 };
|
|
109
|
-
if (t.doubleSpring) {
|
|
110
|
-
const s = t.doubleSpring;
|
|
111
|
-
let i;
|
|
112
|
-
return typeof s == "number" ? i = s : typeof s == "object" && (i = {
|
|
113
|
-
stiffness: s.stiffness,
|
|
114
|
-
damping: s.damping
|
|
115
|
-
}), new F({
|
|
116
|
-
stiffness: t.stiffness,
|
|
117
|
-
damping: t.damping,
|
|
118
|
-
follower: i,
|
|
119
|
-
restDelta: t.restDelta,
|
|
120
|
-
restSpeed: t.restSpeed
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
|
-
return new b({
|
|
124
|
-
stiffness: t.stiffness,
|
|
125
|
-
damping: t.damping,
|
|
126
|
-
restDelta: t.restDelta,
|
|
127
|
-
restSpeed: t.restSpeed
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
/**
|
|
131
|
-
* Create an Integrator from SpringConfig (legacy support)
|
|
132
|
-
* @deprecated Use from({ spring: config }) instead
|
|
133
|
-
*/
|
|
134
|
-
static fromSpring(e) {
|
|
135
|
-
return T.from({ spring: e });
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
export {
|
|
139
|
-
F as D,
|
|
140
|
-
T as I,
|
|
141
|
-
N as a
|
|
142
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var M=Object.defineProperty;var O=(n,e,t)=>e in n?M(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var i=(n,e,t)=>O(n,typeof e!="symbol"?e+"":e,t);const f=require("./spring-integrator-95Mh7mdw.cjs");class T{constructor(e){i(this,"leader");i(this,"follower");i(this,"restDelta");i(this,"restSpeed");this.restDelta=e.restDelta??f.POSITION_THRESHOLD,this.restSpeed=e.restSpeed??f.VELOCITY_THRESHOLD,this.leader=new f.SpringIntegrator({stiffness:e.stiffness,damping:e.damping,restDelta:this.restDelta,restSpeed:this.restSpeed});let t,s,r,a;typeof e.follower=="number"?(t=e.stiffness*e.follower,s=e.damping):e.follower?(t=e.follower.stiffness,s=e.follower.damping,r=e.follower.restDelta,a=e.follower.restSpeed):(t=e.stiffness,s=e.damping),this.follower=new f.SpringIntegrator({stiffness:t,damping:s,restDelta:r??this.restDelta,restSpeed:a??this.restSpeed})}step(e,t,s){const a=e._leader??{position:e.position,velocity:e.velocity},p=this.leader.step(a,t,s),m=this.follower.step(e,p.position,s);return{position:m.position,velocity:m.velocity,_leader:p}}isSettled(e,t){const s=e,r=Math.abs(t-e.position)<this.restDelta&&Math.abs(e.velocity)<this.restSpeed;return s._leader?Math.abs(t-s._leader.position)<this.restDelta&&Math.abs(s._leader.velocity)<this.restSpeed&&r:r}}const F=.01,g=500,L=10;class v{constructor(e){i(this,"acceleration");i(this,"resistance");i(this,"resistanceType");i(this,"min");i(this,"max");i(this,"bounceStiffness");i(this,"bounceDamping");i(this,"restDelta");this.acceleration=e.acceleration,this.resistance=e.resistance,this.resistanceType=e.resistanceType??"quadratic",this.min=e.min,this.max=e.max,this.bounceStiffness=e.bounceStiffness??g,this.bounceDamping=e.bounceDamping??L,this.restDelta=e.restDelta??F}step(e,t,s){const r=Math.min(s,.033),{acceleration:a,resistance:p,resistanceType:m,min:h,max:u}=this,{position:o,velocity:c}=e,D=h!==void 0&&o<h,y=u!==void 0&&o>u;let b;if(D||y){const S=o-(D?h:u),_=-this.bounceStiffness*S,E=-this.bounceDamping*c;b=_+E}else{const d=t>o?1:-1;let S;m==="linear"?S=p*c:S=p*c*Math.abs(c),b=d*a-S}const I=c+b*r;let l=o+I*r;if(!D&&!y){const d=t>o?1:-1;(d>0&&l>t||d<0&&l<t)&&(l=t)}return{position:l,velocity:l===t?0:I}}isSettled(e,t){return Math.abs(t-e.position)<this.restDelta}}class w{static from(e){if(e.spring&&e.inertia)throw new Error("Cannot use both 'spring' and 'inertia' together. Choose one physics type.");if(e.inertia)return new v({acceleration:e.inertia.acceleration,resistance:e.inertia.resistance,resistanceType:e.inertia.resistanceType,min:e.inertia.min,max:e.inertia.max,bounceStiffness:e.inertia.bounceStiffness,bounceDamping:e.inertia.bounceDamping,restDelta:e.inertia.restDelta});const t=e.spring??{stiffness:300,damping:30};if(t.doubleSpring){const s=t.doubleSpring;let r;return typeof s=="number"?r=s:typeof s=="object"&&(r={stiffness:s.stiffness,damping:s.damping}),new T({stiffness:t.stiffness,damping:t.damping,follower:r,restDelta:t.restDelta,restSpeed:t.restSpeed})}return new f.SpringIntegrator({stiffness:t.stiffness,damping:t.damping,restDelta:t.restDelta,restSpeed:t.restSpeed})}static fromSpring(e){return w.from({spring:e})}}exports.DoubleSpringIntegrator=T;exports.InertiaIntegrator=v;exports.IntegratorProvider=w;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var E=Object.defineProperty;var L=(o,t,s)=>t in o?E(o,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[t]=s;var i=(o,t,s)=>L(o,typeof t!="symbol"?t+"":t,s);class p{constructor(t){i(this,"omega");i(this,"zeta");i(this,"restDelta");i(this,"restSpeed");const{stiffness:s,damping:n}=t,e=1;this.omega=Math.sqrt(s/e),this.zeta=n/(2*Math.sqrt(s*e)),this.restDelta=t.restDelta??.01,this.restSpeed=t.restSpeed??.01}step(t,s,n){const e=Math.min(n,.033),{omega:r,zeta:c}=this,{position:S,velocity:T}=t,O=-2*e*c*r*T,H=e*r*r*(s-S),a=T+O+H;return{position:S+e*a,velocity:a}}isSettled(t,s){const n=Math.abs(s-t.position),e=Math.abs(t.velocity);return n<this.restDelta&&e<this.restSpeed}}exports.POSITION_THRESHOLD=.01;exports.SETTLE_THRESHOLD=.05;exports.SpringIntegrator=p;exports.VELOCITY_THRESHOLD=.01;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
var O = Object.defineProperty;
|
|
2
|
-
var T = (o, t, s) => t in o ? O(o, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : o[t] = s;
|
|
3
|
-
var a = (o, t, s) => T(o, typeof t != "symbol" ? t + "" : t, s);
|
|
4
|
-
const D = 0.01, E = 0.01, m = 0.05;
|
|
5
|
-
class L {
|
|
6
|
-
constructor(t) {
|
|
7
|
-
a(this, "omega");
|
|
8
|
-
// Angular frequency
|
|
9
|
-
a(this, "zeta");
|
|
10
|
-
// Damping ratio
|
|
11
|
-
a(this, "restDelta");
|
|
12
|
-
a(this, "restSpeed");
|
|
13
|
-
const { stiffness: s, damping: n } = t, e = 1;
|
|
14
|
-
this.omega = Math.sqrt(s / e), this.zeta = n / (2 * Math.sqrt(s * e)), this.restDelta = t.restDelta ?? 0.01, this.restSpeed = t.restSpeed ?? 0.01;
|
|
15
|
-
}
|
|
16
|
-
step(t, s, n) {
|
|
17
|
-
const e = Math.min(n, 0.033), { omega: i, zeta: S } = this, { position: r, velocity: c } = t, h = -2 * e * S * i * c, l = e * i * i * (s - r), p = c + h + l;
|
|
18
|
-
return {
|
|
19
|
-
position: r + e * p,
|
|
20
|
-
velocity: p
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
isSettled(t, s) {
|
|
24
|
-
const n = Math.abs(s - t.position), e = Math.abs(t.velocity);
|
|
25
|
-
return n < this.restDelta && e < this.restSpeed;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
export {
|
|
29
|
-
D as P,
|
|
30
|
-
m as S,
|
|
31
|
-
E as V,
|
|
32
|
-
L as a
|
|
33
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Transition, TransitionCallback, TransitionScope } from '../types';
|
|
2
|
-
import { StrategyContext, TransitionStrategy } from './transition-strategy';
|
|
3
|
-
export declare function createTransitionCallback(getTransition: () => Transition<undefined>, options?: {
|
|
4
|
-
onCleanupEnd?: () => void;
|
|
5
|
-
strategy?: (context: StrategyContext) => TransitionStrategy;
|
|
6
|
-
scope?: TransitionScope;
|
|
7
|
-
}): TransitionCallback;
|
|
8
|
-
//# sourceMappingURL=create-transition-callback.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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;AAI/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,CA4OpB"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { TransitionCallback } from '../types';
|
|
2
|
-
declare const SCOPE_ATTR = "data-ssgoi-scope";
|
|
3
|
-
declare const SCOPE_READY_ATTR = "data-ssgoi-scope-ready";
|
|
4
|
-
/**
|
|
5
|
-
* Creates a transition scope that controls child transition behavior.
|
|
6
|
-
*
|
|
7
|
-
* When a child transition has `scope: 'local'`:
|
|
8
|
-
* - If child mounts simultaneously with scope → skip IN animation
|
|
9
|
-
* - If child unmounts simultaneously with scope → skip OUT animation
|
|
10
|
-
* - If child mounts/unmounts while scope is stable → run animation
|
|
11
|
-
*
|
|
12
|
-
* @returns A ref callback to attach to the scope container element
|
|
13
|
-
*
|
|
14
|
-
* @example
|
|
15
|
-
* ```tsx
|
|
16
|
-
* // React
|
|
17
|
-
* <div ref={createTransitionScope()} style={{ display: 'contents' }}>
|
|
18
|
-
* <div ref={transition(fadeIn(), { scope: 'local' })}>
|
|
19
|
-
* Content
|
|
20
|
-
* </div>
|
|
21
|
-
* </div>
|
|
22
|
-
* ```
|
|
23
|
-
*/
|
|
24
|
-
export declare function createTransitionScope(): TransitionCallback;
|
|
25
|
-
/**
|
|
26
|
-
* Check if scope element is ready (mounted and initial render complete)
|
|
27
|
-
* @internal
|
|
28
|
-
*/
|
|
29
|
-
export declare function isScopeReady(scope: Element): boolean;
|
|
30
|
-
/**
|
|
31
|
-
* Find the closest transition scope element
|
|
32
|
-
* @internal
|
|
33
|
-
*/
|
|
34
|
-
export declare function findScope(element: Element): Element | null;
|
|
35
|
-
export { SCOPE_ATTR, SCOPE_READY_ATTR };
|
|
36
|
-
//# sourceMappingURL=transition-scope.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"transition-scope.d.ts","sourceRoot":"","sources":["../../src/lib/transition/transition-scope.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAEnD,QAAA,MAAM,UAAU,qBAAqB,CAAC;AACtC,QAAA,MAAM,gBAAgB,2BAA2B,CAAC;AAElD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,qBAAqB,IAAI,kBAAkB,CAkB1D;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAEpD;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,GAAG,IAAI,CAE1D;AAED,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { MultiAnimationConfig } from '../types';
|
|
2
|
-
import { Animator } from '../animator/types';
|
|
3
|
-
export declare const TRANSITION_STRATEGY: unique symbol;
|
|
4
|
-
export interface StrategyContext {
|
|
5
|
-
currentAnimation: {
|
|
6
|
-
controller: Animator;
|
|
7
|
-
direction: "in" | "out";
|
|
8
|
-
} | null;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Internal animation setup returned by strategy
|
|
12
|
-
* Always uses MultiAnimationConfig (normalized from user's Single/Multi config)
|
|
13
|
-
* @internal
|
|
14
|
-
*/
|
|
15
|
-
export interface InternalAnimationSetup {
|
|
16
|
-
config?: MultiAnimationConfig;
|
|
17
|
-
state: {
|
|
18
|
-
position: number;
|
|
19
|
-
velocity: number;
|
|
20
|
-
};
|
|
21
|
-
from: number;
|
|
22
|
-
to: number;
|
|
23
|
-
direction: "forward" | "backward";
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Internal transition configs passed to strategy
|
|
27
|
-
* Uses Promise<MultiAnimationConfig> to allow lazy evaluation
|
|
28
|
-
* @internal
|
|
29
|
-
*/
|
|
30
|
-
export interface InternalTransitionConfigs {
|
|
31
|
-
in?: Promise<MultiAnimationConfig>;
|
|
32
|
-
out?: Promise<MultiAnimationConfig>;
|
|
33
|
-
}
|
|
34
|
-
export interface TransitionStrategy {
|
|
35
|
-
runIn: (configs: InternalTransitionConfigs) => Promise<InternalAnimationSetup>;
|
|
36
|
-
runOut: (configs: InternalTransitionConfigs) => Promise<InternalAnimationSetup>;
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Creates a transition callback that can be used with framework-specific implementations
|
|
40
|
-
* This is the core logic that frameworks can wrap with their own APIs
|
|
41
|
-
*
|
|
42
|
-
* UX Animation Behavior - 4 Main Scenarios:
|
|
43
|
-
*
|
|
44
|
-
* 1. No animation running + IN trigger:
|
|
45
|
-
* - Start entrance animation (0 → 1)
|
|
46
|
-
* - Return cleanup function for exit
|
|
47
|
-
*
|
|
48
|
-
* 2. No animation running + OUT trigger:
|
|
49
|
-
* - Clone element, start exit animation (1 → 0)
|
|
50
|
-
* - Remove clone when complete
|
|
51
|
-
*
|
|
52
|
-
* 3. IN animation running + OUT trigger:
|
|
53
|
-
* - Stop current IN animation (DOM is disappearing)
|
|
54
|
-
* - Clone element for exit animation
|
|
55
|
-
* - Create REVERSED IN animation (not OUT animation) with current state
|
|
56
|
-
* - This gives natural backward motion instead of jumping to OUT definition
|
|
57
|
-
*
|
|
58
|
-
* 4. OUT animation running + IN trigger:
|
|
59
|
-
* - Stop current OUT animation (cleanup any cloned elements)
|
|
60
|
-
* - Create REVERSED OUT animation (not IN animation) with current state
|
|
61
|
-
* - This gives natural backward motion instead of jumping to IN definition
|
|
62
|
-
* - Switch to entrance mode
|
|
63
|
-
*
|
|
64
|
-
* Closure Structure:
|
|
65
|
-
* - Outer function: Returns entrance callback
|
|
66
|
-
* - Inner function (entrance callback): Returns cleanup callback (exit)
|
|
67
|
-
* - Cleanup callback: Handles exit transitions
|
|
68
|
-
*/
|
|
69
|
-
export declare const createDefaultStrategy: (context: StrategyContext) => TransitionStrategy;
|
|
70
|
-
/**
|
|
71
|
-
* Page transition strategy - Always starts fresh without checking current animations
|
|
72
|
-
* This is used for page-level transitions where each transition should be independent
|
|
73
|
-
*/
|
|
74
|
-
export declare const createPageTransitionStrategy: () => TransitionStrategy;
|
|
75
|
-
//# sourceMappingURL=transition-strategy.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"transition-strategy.d.ts","sourceRoot":"","sources":["../../src/lib/transition/transition-strategy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AACrD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAElD,eAAO,MAAM,mBAAmB,eAAoC,CAAC;AAErE,MAAM,WAAW,eAAe;IAE9B,gBAAgB,EAAE;QAChB,UAAU,EAAE,QAAQ,CAAC;QACrB,SAAS,EAAE,IAAI,GAAG,KAAK,CAAC;KACzB,GAAG,IAAI,CAAC;CACV;AAED;;;;GAIG;AACH,MAAM,WAAW,sBAAsB;IACrC,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,KAAK,EAAE;QACL,QAAQ,EAAE,MAAM,CAAC;QACjB,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,SAAS,GAAG,UAAU,CAAC;CACnC;AAED;;;;GAIG;AACH,MAAM,WAAW,yBAAyB;IACxC,EAAE,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC,CAAC;IACnC,GAAG,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC,CAAC;CACrC;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,CACL,OAAO,EAAE,yBAAyB,KAC/B,OAAO,CAAC,sBAAsB,CAAC,CAAC;IACrC,MAAM,EAAE,CACN,OAAO,EAAE,yBAAyB,KAC/B,OAAO,CAAC,sBAAsB,CAAC,CAAC;CACtC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,eAAO,MAAM,qBAAqB,GAChC,SAAS,eAAe,KACvB,kBA4GF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,4BAA4B,QAAO,kBA4D/C,CAAC"}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { StrategyContext, TRANSITION_STRATEGY, TransitionStrategy } from './transition-strategy';
|
|
2
|
-
import { RefCallback, TransitionCallback, TransitionOptions } from '../types';
|
|
3
|
-
type TransitionOptionsWithStrategy = TransitionOptions<undefined> & {
|
|
4
|
-
[TRANSITION_STRATEGY]?: (context: StrategyContext) => TransitionStrategy;
|
|
5
|
-
};
|
|
6
|
-
/**
|
|
7
|
-
* Framework-agnostic transition function that can be used as a ref
|
|
8
|
-
*
|
|
9
|
-
* @description
|
|
10
|
-
* Creates a transition that can be attached to DOM elements via ref.
|
|
11
|
-
* Manages entrance and exit animations with a complete lifecycle system.
|
|
12
|
-
*
|
|
13
|
-
* **IN Animation Lifecycle (Element Entering):**
|
|
14
|
-
* 1. `prepare` - Setup element's initial state (e.g., opacity: 0)
|
|
15
|
-
* 2. `wait` - Optional async delay before animation starts
|
|
16
|
-
* 3. `onStart` - Called when animation begins
|
|
17
|
-
* 4. `tick` - Called on each animation frame with progress value (0 → 1)
|
|
18
|
-
* 5. `onEnd` - Called when animation completes
|
|
19
|
-
*
|
|
20
|
-
* **OUT Animation Lifecycle (Element Exiting):**
|
|
21
|
-
* 1. `prepare` - Setup element's initial state for exit
|
|
22
|
-
* 2. `wait` - Optional async delay before animation starts
|
|
23
|
-
* 3. `onStart` - Called when animation begins
|
|
24
|
-
* 4. `tick` - Called on each animation frame with progress value (1 → 0)
|
|
25
|
-
* 5. `onEnd` - Called when animation completes and element is removed
|
|
26
|
-
*
|
|
27
|
-
* @param options - Transition configuration
|
|
28
|
-
* @param mode - 'manual' (default) returns cleanup, 'auto' handles unmount via MutationObserver
|
|
29
|
-
* @returns Callback function to be used as a ref
|
|
30
|
-
*
|
|
31
|
-
* @example
|
|
32
|
-
* ```tsx
|
|
33
|
-
* // Manual mode (default) - you handle cleanup
|
|
34
|
-
* <div ref={transition({
|
|
35
|
-
* key: 'hero-fade',
|
|
36
|
-
* in: (element) => ({ tick: (p) => element.style.opacity = String(p) }),
|
|
37
|
-
* out: (element) => ({ tick: (p) => element.style.opacity = String(p) }),
|
|
38
|
-
* })} />
|
|
39
|
-
*
|
|
40
|
-
* // Auto mode - automatic unmount detection via MutationObserver
|
|
41
|
-
* <div ref={transition({
|
|
42
|
-
* key: 'hero-fade',
|
|
43
|
-
* in: (element) => ({ tick: (p) => element.style.opacity = String(p) }),
|
|
44
|
-
* out: (element) => ({ tick: (p) => element.style.opacity = String(p) }),
|
|
45
|
-
* }, 'auto')} />
|
|
46
|
-
* ```
|
|
47
|
-
*/
|
|
48
|
-
export declare function transition(options: TransitionOptionsWithStrategy, mode?: "manual"): TransitionCallback;
|
|
49
|
-
export declare function transition(options: TransitionOptionsWithStrategy, mode: "auto"): RefCallback;
|
|
50
|
-
export {};
|
|
51
|
-
//# sourceMappingURL=transition.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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,EACV,WAAW,EAEX,kBAAkB,EAElB,iBAAiB,EAElB,MAAM,UAAU,CAAC;AA0ElB,KAAK,6BAA6B,GAAG,iBAAiB,CAAC,SAAS,CAAC,GAAG;IAClE,CAAC,mBAAmB,CAAC,CAAC,EAAE,CAAC,OAAO,EAAE,eAAe,KAAK,kBAAkB,CAAC;CAC1E,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,wBAAgB,UAAU,CACxB,OAAO,EAAE,6BAA6B,EACtC,IAAI,CAAC,EAAE,QAAQ,GACd,kBAAkB,CAAC;AACtB,wBAAgB,UAAU,CACxB,OAAO,EAAE,6BAA6B,EACtC,IAAI,EAAE,MAAM,GACX,WAAW,CAAC"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Global MutationObserver for detecting element unmount
|
|
3
|
-
*
|
|
4
|
-
* This module provides a shared observer that watches for DOM removals
|
|
5
|
-
* and triggers cleanup callbacks when watched elements are removed.
|
|
6
|
-
*
|
|
7
|
-
* Key features:
|
|
8
|
-
* - Single shared observer for all transitions (performance)
|
|
9
|
-
* - subtree: true to detect removals at any depth
|
|
10
|
-
* - Optimized: only checks removedNodes, not all watched elements
|
|
11
|
-
* - Framework agnostic: works with React 18/19, Svelte, Vue, etc.
|
|
12
|
-
*/
|
|
13
|
-
type UnmountCallback = () => void;
|
|
14
|
-
/**
|
|
15
|
-
* Register an element to watch for unmount
|
|
16
|
-
*
|
|
17
|
-
* When the element is removed from DOM, the callback is executed
|
|
18
|
-
* and the element is automatically unregistered.
|
|
19
|
-
*
|
|
20
|
-
* @param element - The element to watch
|
|
21
|
-
* @param callback - Callback to execute when element is removed from DOM
|
|
22
|
-
*/
|
|
23
|
-
export declare function watchUnmount(element: HTMLElement, callback: UnmountCallback): void;
|
|
24
|
-
/**
|
|
25
|
-
* Check if an element is being watched
|
|
26
|
-
*/
|
|
27
|
-
export declare function isWatched(element: HTMLElement): boolean;
|
|
28
|
-
/**
|
|
29
|
-
* Get the number of watched elements (for debugging)
|
|
30
|
-
*/
|
|
31
|
-
export declare function getWatchedCount(): number;
|
|
32
|
-
/**
|
|
33
|
-
* Manually trigger unmount for an element
|
|
34
|
-
* Useful when cleanup is called explicitly (React 19, Svelte destroy)
|
|
35
|
-
*/
|
|
36
|
-
export declare function triggerUnmount(element: HTMLElement): boolean;
|
|
37
|
-
/**
|
|
38
|
-
* Cleanup all watchers and disconnect observer
|
|
39
|
-
* Mainly for testing purposes
|
|
40
|
-
*/
|
|
41
|
-
export declare function resetObserver(): void;
|
|
42
|
-
export {};
|
|
43
|
-
//# sourceMappingURL=unmount-observer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"unmount-observer.d.ts","sourceRoot":"","sources":["../../src/lib/transition/unmount-observer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,KAAK,eAAe,GAAG,MAAM,IAAI,CAAC;AAgFlC;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,WAAW,EACpB,QAAQ,EAAE,eAAe,GACxB,IAAI,CAGN;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAEvD;AAED;;GAEG;AACH,wBAAgB,eAAe,IAAI,MAAM,CAExC;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAQ5D;AAED;;;GAGG;AACH,wBAAgB,aAAa,IAAI,IAAI,CAKpC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { PhysicsOptions, Transition, TransitionKey } from '../types';
|
|
2
|
-
type BlurOptions = {
|
|
3
|
-
amount?: number | string;
|
|
4
|
-
opacity?: number;
|
|
5
|
-
scale?: boolean;
|
|
6
|
-
fade?: boolean;
|
|
7
|
-
physics?: PhysicsOptions;
|
|
8
|
-
key?: TransitionKey;
|
|
9
|
-
};
|
|
10
|
-
export declare const blur: (options?: BlurOptions) => Transition;
|
|
11
|
-
export {};
|
|
12
|
-
//# sourceMappingURL=blur.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"blur.d.ts","sourceRoot":"","sources":["../../src/lib/transitions/blur.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EAEd,UAAU,EACV,aAAa,EACd,MAAM,UAAU,CAAC;AAGlB,KAAK,WAAW,GAAG;IACjB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,GAAG,CAAC,EAAE,aAAa,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,IAAI,GAAI,UAAS,WAAgB,KAAG,UAgChD,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { PhysicsOptions, Transition, TransitionKey } from '../types';
|
|
2
|
-
type BounceOptions = {
|
|
3
|
-
height?: number;
|
|
4
|
-
intensity?: number;
|
|
5
|
-
scale?: boolean;
|
|
6
|
-
fade?: boolean;
|
|
7
|
-
direction?: "up" | "down";
|
|
8
|
-
physics?: PhysicsOptions;
|
|
9
|
-
key?: TransitionKey;
|
|
10
|
-
};
|
|
11
|
-
export declare const bounce: (options?: BounceOptions) => Transition;
|
|
12
|
-
export {};
|
|
13
|
-
//# sourceMappingURL=bounce.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bounce.d.ts","sourceRoot":"","sources":["../../src/lib/transitions/bounce.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EAEd,UAAU,EACV,aAAa,EACd,MAAM,UAAU,CAAC;AAGlB,KAAK,aAAa,GAAG;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAC1B,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,GAAG,CAAC,EAAE,aAAa,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,MAAM,GAAI,UAAS,aAAkB,KAAG,UA+CpD,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { PhysicsOptions, Transition, TransitionKey } from '../types';
|
|
2
|
-
type FadeOptions = {
|
|
3
|
-
from?: number;
|
|
4
|
-
to?: number;
|
|
5
|
-
physics?: PhysicsOptions;
|
|
6
|
-
key?: TransitionKey;
|
|
7
|
-
};
|
|
8
|
-
export declare const fade: (options?: FadeOptions) => Transition;
|
|
9
|
-
export {};
|
|
10
|
-
//# sourceMappingURL=fade.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fade.d.ts","sourceRoot":"","sources":["../../src/lib/transitions/fade.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EAEd,UAAU,EACV,aAAa,EACd,MAAM,UAAU,CAAC;AAGlB,KAAK,WAAW,GAAG;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,GAAG,CAAC,EAAE,aAAa,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,IAAI,GAAI,UAAS,WAAgB,KAAG,UAqBhD,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { SpringConfig, Transition, TransitionKey } from '../types';
|
|
2
|
-
interface FlyOptions {
|
|
3
|
-
x?: number | string;
|
|
4
|
-
y?: number | string;
|
|
5
|
-
opacity?: number;
|
|
6
|
-
spring?: Partial<SpringConfig>;
|
|
7
|
-
key?: TransitionKey;
|
|
8
|
-
}
|
|
9
|
-
export declare const fly: (options?: FlyOptions) => Transition;
|
|
10
|
-
export {};
|
|
11
|
-
//# sourceMappingURL=fly.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fly.d.ts","sourceRoot":"","sources":["../../src/lib/transitions/fly.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EAEZ,UAAU,EACV,aAAa,EACd,MAAM,UAAU,CAAC;AAElB,UAAU,UAAU;IAClB,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IAC/B,GAAG,CAAC,EAAE,aAAa,CAAC;CACrB;AAED,eAAO,MAAM,GAAG,GAAI,UAAS,UAAe,KAAG,UA4C9C,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("../spring-integrator-95Mh7mdw.cjs"),x=require("../provider-BKaONTeg.cjs");function m(e,t){return e!=null&&e.spring||e!=null&&e.inertia||e!=null&&e.integrator?e:{spring:t.spring}}const I=(e={})=>{const{from:t=0,to:n=1,key:c}=e,r=m(e.physics,{spring:{stiffness:300,damping:30}});return{in:()=>({physics:r,css:s=>({opacity:t+(n-t)*s})}),out:()=>({physics:r,css:s=>({opacity:t+(n-t)*s})}),...c&&{key:c}}},w=(e={})=>{const{start:t=0,opacity:n=0,axis:c="both",key:r}=e,s=m(e.physics,{spring:{stiffness:300,damping:30}}),g=a=>{switch(c){case"x":return`scaleX(${a})`;case"y":return`scaleY(${a})`;case"both":default:return`scale(${a})`}},u=a=>{const o=t+(1-t)*a;return{transform:g(o),opacity:n+(1-n)*a}};return{in:()=>({physics:s,css:u}),out:()=>({physics:s,css:u}),...r&&{key:r}}},C=(e={})=>{const{direction:t,distance:n=100,opacity:c=0,fade:r=!0,axis:s,key:g}=e,u=m(e.physics,{spring:{stiffness:400,damping:35}}),o=t||(s==="x"?"left":s==="y"?"up":"left"),l=$=>{const i=1-$;if(typeof n=="number"){const d=i*n;switch(o){case"left":return`translate3d(${-d}px, 0, 0)`;case"right":return`translate3d(${d}px, 0, 0)`;case"up":return`translate3d(0, ${-d}px, 0)`;case"down":return`translate3d(0, ${d}px, 0)`}}else switch(o){case"left":return`translate3d(calc(-1 * ${n} * ${i}), 0, 0)`;case"right":return`translate3d(calc(${n} * ${i}), 0, 0)`;case"up":return`translate3d(0, calc(-1 * ${n} * ${i}), 0)`;case"down":return`translate3d(0, calc(${n} * ${i}), 0)`}},f=$=>{const i={transform:l($)};return r&&(i.opacity=c+(1-c)*$),i};return{in:()=>({physics:u,css:f}),out:()=>({physics:u,css:f}),...g&&{key:g}}},P=(e={})=>{const{degrees:t=360,clockwise:n=!0,scale:c=!1,fade:r=!0,origin:s="center",axis:g="2d",perspective:u=800,key:a}=e,o=m(e.physics,{spring:{stiffness:500,damping:25}}),l=n?t:-t,f=i=>{const d=(1-i)*l;switch(g){case"x":return`perspective(${u}px) rotateX(${d}deg)`;case"y":return`perspective(${u}px) rotateY(${d}deg)`;case"z":return`rotateZ(${d}deg)`;case"2d":default:return`rotate(${d}deg)`}},$=i=>{const d={},y=[f(i)];return c&&y.push(`scale(${i})`),d.transform=y.join(" "),d.transformOrigin=s,r&&(d.opacity=i),d};return{in:()=>({physics:o,css:$}),out:()=>({physics:o,css:$}),...a&&{key:a}}},v=(e={})=>{const{height:t=20,intensity:n=1,scale:c=!0,fade:r=!0,direction:s="up",key:g}=e,u=m(e.physics,{spring:{stiffness:800,damping:15}}),a=o=>{const l={},f=[],$=Math.sin(o*Math.PI*(1+n)),i=1-o,d=$*t*i;if(s==="up"?f.push(`translateY(${-Math.abs(d)}px)`):f.push(`translateY(${Math.abs(d)}px)`),c){const y=.8+o*.2+$*.05*i;f.push(`scale(${y})`)}return l.transform=f.join(" "),r&&(l.opacity=o),l};return{in:()=>({physics:u,css:a}),out:()=>({physics:u,css:a}),...g&&{key:g}}},M=(e={})=>{const{amount:t=10,opacity:n=0,scale:c=!1,fade:r=!0,key:s}=e,g=m(e.physics,{spring:{stiffness:300,damping:30}}),u=a=>{const o=1-a,l={};return typeof t=="number"?l.filter=`blur(${o*t}px)`:l.filter=`blur(calc(${t} * ${o}))`,c&&(l.transform=`scale(${.8+a*.2})`),r&&(l.opacity=n+(1-n)*a),l};return{in:()=>({physics:g,css:u}),out:()=>({physics:g,css:u}),...s&&{key:s}}},D=(e={})=>{const{x:t=0,y:n=-100,opacity:c=0,spring:r,key:s}=e,g={stiffness:(r==null?void 0:r.stiffness)??400,damping:(r==null?void 0:r.damping)??35,doubleSpring:(r==null?void 0:r.doubleSpring)??!1},u=a=>{const o=1-a;let l,f;return typeof t=="number"?l=`${o*t}px`:l=`calc(${t} * ${o})`,typeof n=="number"?f=`${o*n}px`:f=`calc(${n} * ${o})`,{transform:`translate3d(${l}, ${f}, 0)`,opacity:c+(1-c)*a}};return{in:()=>({spring:g,css:u}),out:()=>({spring:g,css:u}),...s&&{key:s}}},q=(e={})=>{const{shape:t="circle",origin:n="center",scale:c=1.5,fade:r=!1,spring:s,key:g}=e,u={stiffness:(s==null?void 0:s.stiffness)??300,damping:(s==null?void 0:s.damping)??30,doubleSpring:(s==null?void 0:s.doubleSpring)??!1},a=()=>{switch(n){case"top":return"50% 0%";case"bottom":return"50% 100%";case"left":return"0% 50%";case"right":return"100% 50%";case"top-left":return"0% 0%";case"top-right":return"100% 0%";case"bottom-left":return"0% 100%";case"bottom-right":return"100% 100%";case"center":default:return"50% 50%"}},o=f=>{const $=f*c*100,i=a();switch(t){case"ellipse":return`ellipse(${$}% ${$*.75}% at ${i})`;case"square":{const d=f*c*100,[y,S]=i.split(" "),b=parseFloat(y),h=parseFloat(S),p=d/2;return`polygon(${b-p}% ${h-p}%, ${b+p}% ${h-p}%, ${b+p}% ${h+p}%, ${b-p}% ${h+p}%)`}case"circle":default:return`circle(${$}% at ${i})`}},l=f=>{const $={clipPath:o(f)};return r&&($.opacity=f),$};return{in:()=>({spring:u,css:l}),out:()=>({spring:u,css:l}),...g&&{key:g}}},z=(e={})=>{const{spring:t,key:n}=e,c={stiffness:(t==null?void 0:t.stiffness)??1e3,damping:(t==null?void 0:t.damping)??100,doubleSpring:(t==null?void 0:t.doubleSpring)??!1};return{in:()=>({spring:c,css:()=>({})}),out:()=>({spring:c,css:()=>({})}),...n&&{key:n}}};exports.SpringIntegrator=k.SpringIntegrator;exports.DoubleSpringIntegrator=x.DoubleSpringIntegrator;exports.InertiaIntegrator=x.InertiaIntegrator;exports.IntegratorProvider=x.IntegratorProvider;exports.blur=M;exports.bounce=v;exports.fade=I;exports.fly=D;exports.mask=q;exports.none=z;exports.rotate=P;exports.scale=w;exports.slide=C;
|