@ssgoi/core 6.0.0 → 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 +18 -0
- package/dist/animation/animation.d.ts.map +1 -1
- package/dist/animation/host-animation.d.ts +2 -0
- package/dist/animation/host-animation.d.ts.map +1 -1
- package/dist/animation/multi-animation.d.ts +20 -4
- package/dist/animation/multi-animation.d.ts.map +1 -1
- package/dist/animation/web-animation.d.ts +2 -0
- package/dist/animation/web-animation.d.ts.map +1 -1
- package/dist/index.cjs +10 -10
- package/dist/index.js +998 -561
- package/dist/internal.cjs +1 -1
- package/dist/internal.js +208 -201
- package/dist/multi-animation-CnxqLEka.js +322 -0
- package/dist/multi-animation-Dw2JTJI2.cjs +1 -0
- package/dist/ssgoi-transition/create-ssgoi-transition-context.d.ts.map +1 -1
- 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 +10 -1
- package/dist/transitions/blind/index.d.ts.map +1 -1
- package/dist/transitions/drill/index.d.ts +37 -6
- package/dist/transitions/drill/index.d.ts.map +1 -1
- package/dist/transitions/drill/types.d.ts +10 -0
- package/dist/transitions/drill/types.d.ts.map +1 -1
- package/dist/transitions/fade/index.d.ts +13 -3
- package/dist/transitions/fade/index.d.ts.map +1 -1
- 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 +13 -3
- package/dist/transitions/film/index.d.ts.map +1 -1
- 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 +14 -3
- package/dist/transitions/hero/index.d.ts.map +1 -1
- 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 +1 -0
- package/dist/transitions/index.d.ts.map +1 -1
- package/dist/transitions/jaemin/index.d.ts +13 -3
- package/dist/transitions/jaemin/index.d.ts.map +1 -1
- 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 +12 -3
- package/dist/transitions/rotate/index.d.ts.map +1 -1
- 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 +7 -7
- package/dist/transitions/scroll/index.d.ts.map +1 -1
- package/dist/transitions/sheet/index.d.ts +38 -6
- package/dist/transitions/sheet/index.d.ts.map +1 -1
- package/dist/transitions/sheet/types.d.ts +10 -0
- package/dist/transitions/sheet/types.d.ts.map +1 -1
- package/dist/transitions/slide/index.d.ts +13 -3
- package/dist/transitions/slide/index.d.ts.map +1 -1
- 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 +13 -3
- package/dist/transitions/strip/index.d.ts.map +1 -1
- 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 +16 -0
- package/dist/transitions/utils.d.ts.map +1 -1
- package/dist/transitions/zoom/index.d.ts +17 -3
- package/dist/transitions/zoom/index.d.ts.map +1 -1
- 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 +6 -1
- package/dist/transitions/zoom/provider/expand.d.ts.map +1 -1
- package/dist/transitions/zoom/provider/index.d.ts +10 -1
- package/dist/transitions/zoom/provider/index.d.ts.map +1 -1
- package/dist/transitions/zoom/provider/static.d.ts +6 -1
- package/dist/transitions/zoom/provider/static.d.ts.map +1 -1
- package/dist/transitions/zoom/transition.d.ts +3 -3
- package/dist/transitions/zoom/transition.d.ts.map +1 -1
- package/dist/transitions/zoom/types.d.ts +78 -3
- package/dist/transitions/zoom/types.d.ts.map +1 -1
- package/dist/transitions/zoom/zoom-element.d.ts +2 -2
- package/dist/transitions/zoom/zoom-element.d.ts.map +1 -1
- package/dist/types/index.d.ts +3 -4
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/multi-animation-B_Hl1HEU.cjs +0 -1
- package/dist/multi-animation-CST6aZ8y.js +0 -276
|
@@ -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-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,
|
|
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"}
|
|
@@ -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"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { PhysicsOptions, StyleObject } from '../../types/index.ts';
|
|
2
|
+
import { MultiAnimationOptions } from '../../animation/multi-animation';
|
|
3
|
+
export type AxisType = "x" | "y" | "z";
|
|
4
|
+
export type AxisDirection = "forward" | "backward";
|
|
5
|
+
/**
|
|
6
|
+
* UX flavor *within* a single axis. Independent dimension from `AxisType`:
|
|
7
|
+
* - `snappy` — tight, decisive page swap. KakaoTalk-style on x.
|
|
8
|
+
* - `fluid` — relaxed, fade-through. Flutter SharedAxisTransition-style on x.
|
|
9
|
+
*
|
|
10
|
+
* Only `x` currently ships both flavors; `y` and `z` only have `snappy` and
|
|
11
|
+
* fall back to it when `fluid` is requested.
|
|
12
|
+
*/
|
|
13
|
+
export type AxisFeel = "snappy" | "fluid";
|
|
14
|
+
export interface AxisOptions {
|
|
15
|
+
type?: AxisType;
|
|
16
|
+
direction?: AxisDirection;
|
|
17
|
+
feel?: AxisFeel;
|
|
18
|
+
}
|
|
19
|
+
export type AxisAnimateFunc = (progress: number) => StyleObject;
|
|
20
|
+
export interface AxisSideConfig {
|
|
21
|
+
willChange: string;
|
|
22
|
+
startStyle: StyleObject;
|
|
23
|
+
animate: AxisAnimateFunc;
|
|
24
|
+
}
|
|
25
|
+
export interface AxisAnimationConfig {
|
|
26
|
+
out: AxisSideConfig;
|
|
27
|
+
in: AxisSideConfig;
|
|
28
|
+
}
|
|
29
|
+
export interface AxisProviderBuildArgs {
|
|
30
|
+
direction: AxisDirection;
|
|
31
|
+
}
|
|
32
|
+
export interface AxisProvider {
|
|
33
|
+
/**
|
|
34
|
+
* Physics for the outgoing side. Split from `inPhysics` so a provider can
|
|
35
|
+
* mix integrators (e.g. fluid's x uses inertia for out + spring for in, so
|
|
36
|
+
* the outgoing page falls away under acceleration while the incoming page
|
|
37
|
+
* springs into place).
|
|
38
|
+
*/
|
|
39
|
+
outPhysics: PhysicsOptions;
|
|
40
|
+
/** Physics for the incoming side. */
|
|
41
|
+
inPhysics: PhysicsOptions;
|
|
42
|
+
/**
|
|
43
|
+
* How the out/in animations compose. Each axis has its own timing (e.g. x/y
|
|
44
|
+
* use a slight startAt offset for cross-fade overlap, z runs both in place
|
|
45
|
+
* and typically starts together). Provider decides — transition.ts just
|
|
46
|
+
* forwards this to MultiAnimation.
|
|
47
|
+
*/
|
|
48
|
+
composition?: MultiAnimationOptions;
|
|
49
|
+
/** `direction` is only meaningful for the sided providers (x, y). */
|
|
50
|
+
build: (args: AxisProviderBuildArgs) => AxisAnimationConfig;
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/transitions/axis/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAC1D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAE7E,MAAM,MAAM,QAAQ,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;AACvC,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,UAAU,CAAC;AAEnD;;;;;;;GAOG;AACH,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;AAE1C,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,IAAI,CAAC,EAAE,QAAQ,CAAC;CACjB;AAED,MAAM,MAAM,eAAe,GAAG,CAAC,QAAQ,EAAE,MAAM,KAAK,WAAW,CAAC;AAEhE,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,WAAW,CAAC;IACxB,OAAO,EAAE,eAAe,CAAC;CAC1B;AAED,MAAM,WAAW,mBAAmB;IAClC,GAAG,EAAE,cAAc,CAAC;IACpB,EAAE,EAAE,cAAc,CAAC;CACpB;AAED,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,aAAa,CAAC;CAC1B;AAED,MAAM,WAAW,YAAY;IAC3B;;;;;OAKG;IACH,UAAU,EAAE,cAAc,CAAC;IAC3B,qCAAqC;IACrC,SAAS,EAAE,cAAc,CAAC;IAC1B;;;;;OAKG;IACH,WAAW,CAAC,EAAE,qBAAqB,CAAC;IACpC,qEAAqE;IACrE,KAAK,EAAE,CAAC,IAAI,EAAE,qBAAqB,KAAK,mBAAmB,CAAC;CAC7D"}
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import { SsgoiPathTransition } from '../../types/index.ts';
|
|
2
|
+
/**
|
|
3
|
+
* Public `type` values for `blind`. Maps to the internal `direction` axis:
|
|
4
|
+
* - `"horizontal"` (default) — blinds open along the horizontal axis.
|
|
5
|
+
* - `"vertical"` — blinds open along the vertical axis.
|
|
6
|
+
*/
|
|
7
|
+
export type BlindType = "horizontal" | "vertical";
|
|
2
8
|
export type BlindConfig = {
|
|
3
9
|
paths: readonly string[];
|
|
10
|
+
type?: BlindType;
|
|
11
|
+
variant?: "default";
|
|
12
|
+
options?: object;
|
|
4
13
|
};
|
|
5
|
-
export declare function blind(
|
|
14
|
+
export declare function blind(config: BlindConfig): SsgoiPathTransition[];
|
|
6
15
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/transitions/blind/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAC;AAIlD,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/transitions/blind/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAC;AAIlD;;;;GAIG;AACH,MAAM,MAAM,SAAS,GAAG,YAAY,GAAG,UAAU,CAAC;AAElD,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IACzB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,wBAAgB,KAAK,CAAC,MAAM,EAAE,WAAW,GAAG,mBAAmB,EAAE,CAQhE"}
|
|
@@ -1,9 +1,40 @@
|
|
|
1
1
|
import { SsgoiPathTransition } from '../../types/index.ts';
|
|
2
2
|
import { DirectionalTransitionPaths } from '../utils';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Public `type` values supported by `drill`.
|
|
5
|
+
*
|
|
6
|
+
* - `"parallax"` (default) — layered enter/exit with depth parallax.
|
|
7
|
+
* - `"slide"` — flat cross-faded slide. This is the new name for the legacy
|
|
8
|
+
* `"crossfade"` value; the underlying behavior is unchanged.
|
|
9
|
+
*/
|
|
10
|
+
export type DrillType = "parallax" | "slide";
|
|
11
|
+
/**
|
|
12
|
+
* Legacy public `type` value, kept for source compatibility only.
|
|
13
|
+
*
|
|
14
|
+
* @deprecated Do not use in new code. v6 only supports `{ type, variant, options }`.
|
|
15
|
+
* Migrate `type: "crossfade"` to `type: "slide"` — same behavior, new name.
|
|
16
|
+
* Example: `drill({ enter: "/list", exit: "/detail", type: "slide" })`.
|
|
17
|
+
* Kept here only for backward compatibility — will be removed in a future major.
|
|
18
|
+
*/
|
|
19
|
+
export type DrillTypeDeprecated = "crossfade";
|
|
20
|
+
export type DrillConfig = DirectionalTransitionPaths & ({
|
|
21
|
+
type?: "parallax";
|
|
22
|
+
variant?: "default";
|
|
23
|
+
options?: {};
|
|
24
|
+
} | {
|
|
25
|
+
type: "slide";
|
|
26
|
+
variant?: "default";
|
|
27
|
+
options?: {};
|
|
28
|
+
} | {
|
|
29
|
+
/**
|
|
30
|
+
* @deprecated Do not use in new code. v6 only supports `{ type, variant, options }`.
|
|
31
|
+
* Migrate `type: "crossfade"` to `type: "slide"` — same behavior, new name.
|
|
32
|
+
* Example: `drill({ enter: "/list", exit: "/detail", type: "slide" })`.
|
|
33
|
+
* Kept here only for backward compatibility — will be removed in a future major.
|
|
34
|
+
*/
|
|
35
|
+
type: "crossfade";
|
|
36
|
+
variant?: "default";
|
|
37
|
+
options?: {};
|
|
38
|
+
});
|
|
39
|
+
export declare function drill(config: DrillConfig): SsgoiPathTransition[];
|
|
9
40
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/transitions/drill/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAC;AAClD,OAAO,EAEL,KAAK,0BAA0B,EAChC,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/transitions/drill/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAC;AAClD,OAAO,EAEL,KAAK,0BAA0B,EAChC,MAAM,UAAU,CAAC;AAIlB;;;;;;GAMG;AACH,MAAM,MAAM,SAAS,GAAG,UAAU,GAAG,OAAO,CAAC;AAE7C;;;;;;;GAOG;AACH,MAAM,MAAM,mBAAmB,GAAG,WAAW,CAAC;AAE9C,MAAM,MAAM,WAAW,GAAG,0BAA0B,GAClD,CACI;IAAE,IAAI,CAAC,EAAE,UAAU,CAAC;IAAC,OAAO,CAAC,EAAE,SAAS,CAAC;IAAC,OAAO,CAAC,EAAE,EAAE,CAAA;CAAE,GACxD;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,SAAS,CAAC;IAAC,OAAO,CAAC,EAAE,EAAE,CAAA;CAAE,GACpD;IACE;;;;;OAKG;IACH,IAAI,EAAE,WAAW,CAAC;IAClB,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,OAAO,CAAC,EAAE,EAAE,CAAC;CACd,CACJ,CAAC;AAgBJ,wBAAgB,KAAK,CAAC,MAAM,EAAE,WAAW,GAAG,mBAAmB,EAAE,CAUhE"}
|
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
import { PhysicsOptions } from '../../types/index.ts';
|
|
2
|
+
/**
|
|
3
|
+
* Internal type union accepted by the underlying `drill` transition provider.
|
|
4
|
+
*
|
|
5
|
+
* Public API uses `"slide"` (the new name for the previous `"crossfade"`
|
|
6
|
+
* behavior). The `"crossfade"` key is retained here purely so the BC
|
|
7
|
+
* normalization in `index.ts` can keep routing through the same provider
|
|
8
|
+
* without touching the internal transition / provider code.
|
|
9
|
+
*
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
2
12
|
export type DrillType = "parallax" | "crossfade";
|
|
3
13
|
export type DrillDirection = "enter" | "exit";
|
|
4
14
|
export interface DrillOptions {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/transitions/drill/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAE7C,MAAM,MAAM,SAAS,GAAG,UAAU,GAAG,WAAW,CAAC;AACjD,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,MAAM,CAAC;AAE9C,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,SAAS,CAAC,EAAE,cAAc,CAAC;CAC5B;AAED,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;AACzD,MAAM,MAAM,gBAAgB,GAAG,CAAC,QAAQ,EAAE,MAAM,KAAK,UAAU,CAAC;AAEhE,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,UAAU,CAAC;IACvB,OAAO,EAAE,gBAAgB,CAAC;CAC3B;AAED,MAAM,WAAW,oBAAoB;IACnC,GAAG,EAAE,eAAe,CAAC;IACrB,EAAE,EAAE,eAAe,CAAC;CACrB;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,cAAc,CAAC;IACxB,KAAK,EAAE,CAAC,SAAS,EAAE,cAAc,KAAK,oBAAoB,CAAC;CAC5D"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/transitions/drill/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAE7C;;;;;;;;;GASG;AACH,MAAM,MAAM,SAAS,GAAG,UAAU,GAAG,WAAW,CAAC;AACjD,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,MAAM,CAAC;AAE9C,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,SAAS,CAAC,EAAE,cAAc,CAAC;CAC5B;AAED,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;AACzD,MAAM,MAAM,gBAAgB,GAAG,CAAC,QAAQ,EAAE,MAAM,KAAK,UAAU,CAAC;AAEhE,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,UAAU,CAAC;IACvB,OAAO,EAAE,gBAAgB,CAAC;CAC3B;AAED,MAAM,WAAW,oBAAoB;IACnC,GAAG,EAAE,eAAe,CAAC;IACrB,EAAE,EAAE,eAAe,CAAC;CACrB;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,cAAc,CAAC;IACxB,KAAK,EAAE,CAAC,SAAS,EAAE,cAAc,KAAK,oBAAoB,CAAC;CAC5D"}
|
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
import { SsgoiPathTransition } from '../../types/index.ts';
|
|
2
|
-
|
|
2
|
+
import { PresetConfig } from '../utils';
|
|
3
|
+
import { FadeOptions, FadeType, FadeVariant } from './types';
|
|
4
|
+
export type { FadeOptions, FadeType, FadeVariant } from './types';
|
|
5
|
+
/**
|
|
6
|
+
* Fade preset configuration.
|
|
7
|
+
*
|
|
8
|
+
* Default `type` is `"fade-through"` (sequential fade-out → fade-in).
|
|
9
|
+
* The `"cross-fade"` type and `"smooth"` variant are tracked on the TODO
|
|
10
|
+
* board and intentionally not part of the public type yet.
|
|
11
|
+
*/
|
|
12
|
+
export type FadeConfig = PresetConfig<{
|
|
3
13
|
paths: readonly string[];
|
|
4
|
-
}
|
|
5
|
-
export declare function fade(
|
|
14
|
+
}, FadeType, FadeVariant, FadeOptions>;
|
|
15
|
+
export declare function fade(config: FadeConfig): SsgoiPathTransition[];
|
|
6
16
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/transitions/fade/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/transitions/fade/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAC;AAClD,OAAO,EAAkC,KAAK,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7E,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAElE,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAElE;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,GAAG,YAAY,CACnC;IAAE,KAAK,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,EAC5B,QAAQ,EACR,WAAW,EACX,WAAW,CACZ,CAAC;AAEF,wBAAgB,IAAI,CAAC,MAAM,EAAE,UAAU,GAAG,mBAAmB,EAAE,CAG9D"}
|