@mkbabb/keyframes.js 5.2.0 → 5.3.1
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 +15 -5
- package/dist/easing-registry-BAgudUsG.js +2 -0
- package/dist/{easing-registry-DHV2-5gA.js → easing-registry-BlbS88NR.js} +2 -2
- package/dist/engine/index.d.ts +155 -174
- package/dist/engine/index.js +3710 -16
- package/dist/keyframes.d.ts +370 -305
- package/dist/keyframes.js +91 -142
- package/dist/{sequence-s0bL7Uul.js → sequence-CES7o7hs.js} +218 -170
- package/package.json +16 -42
- package/dist/backward-color-BtbRcnna.js +0 -108
- package/dist/compile-BHCTPerD.js +0 -30
- package/dist/delegation-BQYCrP2p.js +0 -259
- package/dist/draw-svg-CK9Qrly8.js +0 -33
- package/dist/easing-registry-y1p9McFy.js +0 -2
- package/dist/easing-serialize-D4LZCB6i.js +0 -21
- package/dist/engine-CPK_udUQ.js +0 -1172
- package/dist/engine-DlpimZtM.js +0 -3
- package/dist/entry-D82NKUhP.js +0 -148
- package/dist/format-BdIvdLzG.js +0 -114
- package/dist/group-HM7N4uOE.js +0 -390
- package/dist/handle-D4xrf_ya.js +0 -21
- package/dist/ingest-_g6tfk2e.js +0 -166
- package/dist/morph-svg-KUrH9KnK.js +0 -79
- package/dist/motion-path-wM5tPfrY.js +0 -26
- package/dist/parse-flatten-DRMHFytp.js +0 -2
- package/dist/parse-flatten-ZZUSEQEL.js +0 -63
- package/dist/presets-DeDJYL4G.js +0 -275
- package/dist/scheduler-CfGIC3GX.js +0 -14
- package/dist/scroll-BEyCx0b_.js +0 -287
- package/dist/validate-xFZ_Ld1k.js +0 -39
- package/dist/view-transition-BPJQxUTC.js +0 -305
package/dist/keyframes.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { C as e, S as t, _ as n, a as r, b as i, c as a, d as o, f as s, g as c, h as l, l as u, m as d, o as f, p, s as m, t as h, u as g, v as _, x as v } from "./sequence-CES7o7hs.js";
|
|
2
2
|
//#region src/animation/physics/numeric.ts
|
|
3
|
-
var y =
|
|
3
|
+
var y = class {
|
|
4
|
+
_out = new Float64Array();
|
|
4
5
|
keyframes;
|
|
5
6
|
segments;
|
|
6
7
|
positions;
|
|
@@ -8,15 +9,15 @@ var y = new Float64Array(), b = class {
|
|
|
8
9
|
_duration;
|
|
9
10
|
_respectReducedMotion;
|
|
10
11
|
_easingFn;
|
|
11
|
-
_playback = new
|
|
12
|
-
constructor(e,
|
|
12
|
+
_playback = new s();
|
|
13
|
+
constructor(e, n) {
|
|
13
14
|
if (e.length < 2) throw Error("NumericAnimation requires at least 2 keyframes.");
|
|
14
|
-
this.keyframes = e.map((e) => ({ ...e })), this._duration =
|
|
15
|
-
let
|
|
16
|
-
if (typeof
|
|
17
|
-
if (this._easingFn =
|
|
18
|
-
if (
|
|
19
|
-
this.positions =
|
|
15
|
+
this.keyframes = e.map((e) => ({ ...e })), this._duration = n?.duration ?? 0, this._respectReducedMotion = n?.respectReducedMotion ?? !1;
|
|
16
|
+
let r = n?.timingFunction;
|
|
17
|
+
if (typeof r == "string") throw new t("timingFunction", r, "NumericAnimation accepts a callable TimingFunction or a typed Easing; resolve a string name first via `await resolveEasing(name)`.");
|
|
18
|
+
if (this._easingFn = r == null ? (e) => e : v(r).fn, n?.positions) {
|
|
19
|
+
if (n.positions.length !== e.length) throw Error("positions length must match keyframes length.");
|
|
20
|
+
this.positions = n.positions;
|
|
20
21
|
} else this.positions = e.map((t, n) => n / (e.length - 1) * 100);
|
|
21
22
|
this.result = { ...e[0] }, this.segments = this.buildSegments();
|
|
22
23
|
}
|
|
@@ -41,12 +42,12 @@ var y = new Float64Array(), b = class {
|
|
|
41
42
|
};
|
|
42
43
|
}
|
|
43
44
|
at(e) {
|
|
44
|
-
let t =
|
|
45
|
-
|
|
46
|
-
let
|
|
47
|
-
|
|
45
|
+
let t = l(e, 0, 1) * 100, r = _(this.segments, t, (e) => e.startPos, (e) => e.stopPos);
|
|
46
|
+
r === -1 && (r = this.segments.length - 1);
|
|
47
|
+
let i = this.segments[r], a = n(l(t, i.startPos, i.stopPos), i.startPos, i.stopPos, 0, 1), o = i.timingFunction(a), s = i.keys.length;
|
|
48
|
+
this._out.length < s && (this._out = new Float64Array(s)), c(i.from, i.to, o, this._out);
|
|
48
49
|
let u = this.result;
|
|
49
|
-
for (let e = 0; e <
|
|
50
|
+
for (let e = 0; e < s; e++) u[i.keys[e]] = this._out[e];
|
|
50
51
|
return this.result;
|
|
51
52
|
}
|
|
52
53
|
updateKeyframe(e, t) {
|
|
@@ -65,13 +66,13 @@ var y = new Float64Array(), b = class {
|
|
|
65
66
|
}
|
|
66
67
|
};
|
|
67
68
|
//#endregion
|
|
68
|
-
//#region src/animation/physics/spring/reseat.ts
|
|
69
|
-
function
|
|
69
|
+
//#region src/animation/physics/spring/solver/reseat.ts
|
|
70
|
+
function b(e) {
|
|
70
71
|
let t = e.curr.time - e.prev.time;
|
|
71
72
|
return t <= 0 ? 0 : (e.curr.value - e.prev.value) / (t / 1e3);
|
|
72
73
|
}
|
|
73
|
-
function
|
|
74
|
-
let r =
|
|
74
|
+
function x(e, t, n) {
|
|
75
|
+
let r = b(e), i = new g({
|
|
75
76
|
...n,
|
|
76
77
|
initial: e.curr.value,
|
|
77
78
|
initialVelocity: r
|
|
@@ -80,7 +81,7 @@ function S(e, t, n) {
|
|
|
80
81
|
}
|
|
81
82
|
//#endregion
|
|
82
83
|
//#region src/animation/physics/morph.ts
|
|
83
|
-
var
|
|
84
|
+
var S = (e) => {
|
|
84
85
|
if (e instanceof HTMLElement) {
|
|
85
86
|
let t = e.getBoundingClientRect();
|
|
86
87
|
return {
|
|
@@ -91,7 +92,7 @@ var C = (e) => {
|
|
|
91
92
|
};
|
|
92
93
|
}
|
|
93
94
|
return e;
|
|
94
|
-
},
|
|
95
|
+
}, C = class {
|
|
95
96
|
animation;
|
|
96
97
|
transformOrigin;
|
|
97
98
|
timingFunction;
|
|
@@ -100,8 +101,8 @@ var C = (e) => {
|
|
|
100
101
|
this.transformOrigin = n?.transformOrigin ?? "top left", this.timingFunction = n?.timingFunction, this.duration = n?.duration ?? 0, this.measure(e, t);
|
|
101
102
|
}
|
|
102
103
|
measure(e, t) {
|
|
103
|
-
let n =
|
|
104
|
-
return this.animation = new
|
|
104
|
+
let n = S(e), r = S(t), i = r.x - n.x, a = r.y - n.y, o = n.width === 0 ? 1 : r.width / n.width, s = n.height === 0 ? 1 : r.height / n.height;
|
|
105
|
+
return this.animation = new y([{
|
|
105
106
|
translateX: 0,
|
|
106
107
|
translateY: 0,
|
|
107
108
|
scaleX: 1,
|
|
@@ -135,19 +136,19 @@ var C = (e) => {
|
|
|
135
136
|
stop() {
|
|
136
137
|
this.animation.stop();
|
|
137
138
|
}
|
|
138
|
-
},
|
|
139
|
+
}, w = class {
|
|
139
140
|
smoother;
|
|
140
141
|
_easingFn;
|
|
141
142
|
currentProgress = 0;
|
|
142
143
|
boundaryEpsilon;
|
|
143
144
|
constructor(e) {
|
|
144
145
|
this.boundaryEpsilon = e?.boundaryEpsilon ?? .005;
|
|
145
|
-
let
|
|
146
|
-
if (typeof
|
|
147
|
-
this._easingFn =
|
|
146
|
+
let n = e?.easing;
|
|
147
|
+
if (typeof n == "string") throw new t("easing", n, "Timeline accepts a callable TimingFunction or a typed Easing; resolve a string name first via `await resolveEasing(name)`.");
|
|
148
|
+
this._easingFn = n == null ? (e) => e : v(n).fn, e?.smoothing === !1 ? this.smoother = null : this.smoother = new o(e?.smoothing);
|
|
148
149
|
}
|
|
149
150
|
applyPipeline() {
|
|
150
|
-
let e =
|
|
151
|
+
let e = l(this.sample(), 0, 1);
|
|
151
152
|
e = this._easingFn(e);
|
|
152
153
|
let t = this.boundaryEpsilon;
|
|
153
154
|
return e <= t ? e = 0 : e >= 1 - t && (e = 1), e;
|
|
@@ -175,7 +176,7 @@ var C = (e) => {
|
|
|
175
176
|
let t = e ?? 0;
|
|
176
177
|
this.smoother && this.smoother.reset(t), this.currentProgress = t;
|
|
177
178
|
}
|
|
178
|
-
},
|
|
179
|
+
}, T = class extends w {
|
|
179
180
|
threshold;
|
|
180
181
|
getScrollY;
|
|
181
182
|
getViewportHeight;
|
|
@@ -186,7 +187,7 @@ var C = (e) => {
|
|
|
186
187
|
let e = this.getViewportHeight() * this.threshold;
|
|
187
188
|
return e <= 0 ? 0 : this.getScrollY() / e;
|
|
188
189
|
}
|
|
189
|
-
}, E = class extends
|
|
190
|
+
}, E = class extends w {
|
|
190
191
|
value = 0;
|
|
191
192
|
constructor(e) {
|
|
192
193
|
super({
|
|
@@ -200,17 +201,17 @@ var C = (e) => {
|
|
|
200
201
|
sample() {
|
|
201
202
|
return this.value;
|
|
202
203
|
}
|
|
203
|
-
},
|
|
204
|
-
function
|
|
204
|
+
}, ee = 2 * Math.PI;
|
|
205
|
+
function D(e, t) {
|
|
205
206
|
let n = e - Math.floor(e);
|
|
206
207
|
switch (t) {
|
|
207
|
-
case "sine": return Math.sin(
|
|
208
|
+
case "sine": return Math.sin(ee * n);
|
|
208
209
|
case "triangle": return n < .5 ? 4 * n - 1 : 3 - 4 * n;
|
|
209
210
|
case "square": return n < .5 ? 1 : -1;
|
|
210
211
|
case "sawtooth": return 2 * n - 1;
|
|
211
212
|
}
|
|
212
213
|
}
|
|
213
|
-
var
|
|
214
|
+
var O = class {
|
|
214
215
|
frequency;
|
|
215
216
|
waveform;
|
|
216
217
|
phase = 0;
|
|
@@ -222,43 +223,43 @@ var k = class {
|
|
|
222
223
|
return this.phase = t - Math.floor(t), this.phase;
|
|
223
224
|
}
|
|
224
225
|
get value() {
|
|
225
|
-
return
|
|
226
|
+
return D(this.phase, this.waveform);
|
|
226
227
|
}
|
|
227
228
|
sample(e) {
|
|
228
|
-
return
|
|
229
|
+
return D(e * this.frequency, this.waveform);
|
|
229
230
|
}
|
|
230
231
|
reset(e = 0) {
|
|
231
232
|
this.phase = e - Math.floor(e);
|
|
232
233
|
}
|
|
233
|
-
},
|
|
234
|
-
if (typeof e == "number") return
|
|
234
|
+
}, k = (e, t) => {
|
|
235
|
+
if (typeof e == "number") return l(e, 0, Math.max(0, t - 1));
|
|
235
236
|
switch (e) {
|
|
236
237
|
case "first": return 0;
|
|
237
238
|
case "last": return t - 1;
|
|
238
239
|
case "center": return (t - 1) / 2;
|
|
239
240
|
case "edges": return -1;
|
|
240
241
|
}
|
|
241
|
-
}, te = (e, t, n) => n === "edges" ? Math.min(e, t - 1 - e) : Math.abs(e -
|
|
242
|
+
}, te = (e, t, n) => n === "edges" ? Math.min(e, t - 1 - e) : Math.abs(e - k(n, t)), ne = (e, t) => {
|
|
242
243
|
if (e <= 1) return 0;
|
|
243
244
|
if (t === "edges") return Math.floor((e - 1) / 2);
|
|
244
|
-
let n =
|
|
245
|
+
let n = k(t, e);
|
|
245
246
|
return Math.max(n, e - 1 - n);
|
|
246
247
|
};
|
|
247
|
-
function
|
|
248
|
-
let { each:
|
|
249
|
-
if (typeof
|
|
250
|
-
let
|
|
248
|
+
function A(e, n = {}) {
|
|
249
|
+
let { each: r = 100, from: i = "first", ease: a } = n;
|
|
250
|
+
if (typeof a == "string") throw new t("ease", a, "stagger accepts a callable TimingFunction or a typed Easing; resolve a string name first via `await resolveEasing(name)`.");
|
|
251
|
+
let o = a ? v(a).fn : void 0, s = typeof e == "number" ? e : e.length, c = (e, t) => {
|
|
251
252
|
if (t <= 1) return 0;
|
|
252
|
-
let
|
|
253
|
-
if (
|
|
254
|
-
let
|
|
255
|
-
return
|
|
256
|
-
},
|
|
257
|
-
return
|
|
253
|
+
let n = ne(t, i);
|
|
254
|
+
if (n === 0) return 0;
|
|
255
|
+
let a = te(e, t, i);
|
|
256
|
+
return o ? o(a / n) * r * n : a * r;
|
|
257
|
+
}, l = ((e, t = s) => c(e, t));
|
|
258
|
+
return l.delays = (e = s) => Array.from({ length: e }, (t, n) => c(n, e)), l;
|
|
258
259
|
}
|
|
259
260
|
//#endregion
|
|
260
261
|
//#region src/animation/orchestration/flip.ts
|
|
261
|
-
var
|
|
262
|
+
var j = 300, M = (e) => {
|
|
262
263
|
let t = e.getBoundingClientRect();
|
|
263
264
|
return {
|
|
264
265
|
x: t.x,
|
|
@@ -266,21 +267,21 @@ var N = 300, P = (e) => {
|
|
|
266
267
|
width: t.width,
|
|
267
268
|
height: t.height
|
|
268
269
|
};
|
|
269
|
-
},
|
|
270
|
+
}, N = (e, t) => {
|
|
270
271
|
let n = e.at(1), r = n.translateX, i = n.translateY, a = n.scaleX, o = n.scaleY, s = e.at(t);
|
|
271
272
|
return `translate(${s.translateX - r}px, ${s.translateY - i}px) scale(${a === 0 ? 1 : s.scaleX / a}, ${o === 0 ? 1 : s.scaleY / o})`;
|
|
272
|
-
},
|
|
273
|
-
e.style.transform =
|
|
273
|
+
}, P = (e, t, n, r) => (e.style.transformOrigin = r, e.style.transform = N(t, 0), n <= 0 ? (e.style.transform = N(t, 1), Promise.resolve()) : new s().play(n, (n) => {
|
|
274
|
+
e.style.transform = N(t, n);
|
|
274
275
|
}));
|
|
275
|
-
function
|
|
276
|
-
let { duration: r =
|
|
277
|
-
return t(),
|
|
276
|
+
function F(e, t, n = {}) {
|
|
277
|
+
let { duration: r = j, timingFunction: i, transformOrigin: a = "top left" } = n, o = M(e);
|
|
278
|
+
return t(), P(e, new C(o, M(e), {
|
|
278
279
|
...i === void 0 ? {} : { timingFunction: i },
|
|
279
280
|
transformOrigin: a
|
|
280
281
|
}), r, a);
|
|
281
282
|
}
|
|
282
283
|
function I(e, t, n = {}) {
|
|
283
|
-
let { duration: r =
|
|
284
|
+
let { duration: r = j, timingFunction: i, transformOrigin: a = "top left" } = n, o = new C(M(e), M(t), {
|
|
284
285
|
...i === void 0 ? {} : { timingFunction: i },
|
|
285
286
|
duration: r,
|
|
286
287
|
transformOrigin: a
|
|
@@ -289,7 +290,7 @@ function I(e, t, n = {}) {
|
|
|
289
290
|
}
|
|
290
291
|
//#endregion
|
|
291
292
|
//#region src/animation/orchestration/split-text/refuse.ts
|
|
292
|
-
var
|
|
293
|
+
var re = {
|
|
293
294
|
unmeasurable: "the container yielded no laid-out client rects (detached, display:none, or zero-area) — a line-split cannot group fragments without a measured line box. Use by:\"word\" (layout-independent), or split after the element is laid out.",
|
|
294
295
|
unstable: "the line measurement could not converge — the container's size depends on its own content flow (a container-query / intrinsic-size feedback loop), so the line grouping oscillates on every reflow. Refused rather than latch a stale line map.",
|
|
295
296
|
empty: "there is no text content to split into lines."
|
|
@@ -297,7 +298,7 @@ var ie = {
|
|
|
297
298
|
name = "SplitTextRefusalError";
|
|
298
299
|
reason;
|
|
299
300
|
constructor(t, n) {
|
|
300
|
-
super(`splitText refused a by:"line" split (${t}): ` + (n ??
|
|
301
|
+
super(`splitText refused a by:"line" split (${t}): ` + (n ?? re[t])), this.reason = t, Object.setPrototypeOf(this, e.prototype);
|
|
301
302
|
}
|
|
302
303
|
}, R = (e) => e.length === 0 || /^\s+$/u.test(e), z = typeof Intl < "u" && typeof Intl.Segmenter == "function";
|
|
303
304
|
function B(e, t) {
|
|
@@ -395,8 +396,8 @@ function q(e, t = {}) {
|
|
|
395
396
|
let t = W(l, n === "grapheme" ? V(u, a) : B(u, a), s, r);
|
|
396
397
|
e.replaceChildren(t.frag), f = t.fragments;
|
|
397
398
|
}
|
|
398
|
-
let p = r ? K(e, u, i) : e.hasAttribute("role"), m =
|
|
399
|
-
n === "line" && (f = G(e, u, a, s, r), r && K(e, u, i), m =
|
|
399
|
+
let p = r ? K(e, u, i) : e.hasAttribute("role"), m = A(f.length, o), h = m.delays(f.length), g = null, _ = 0, v = 0, y = () => {
|
|
400
|
+
n === "line" && (f = G(e, u, a, s, r), r && K(e, u, i), m = A(f.length, o), h = m.delays(f.length));
|
|
400
401
|
}, b = () => {
|
|
401
402
|
g?.disconnect(), g = null;
|
|
402
403
|
};
|
|
@@ -438,8 +439,8 @@ function q(e, t = {}) {
|
|
|
438
439
|
}
|
|
439
440
|
//#endregion
|
|
440
441
|
//#region src/animation/orchestration/view-transition/view-transition.ts
|
|
441
|
-
var J = 300,
|
|
442
|
-
function
|
|
442
|
+
var J = 300, Y = () => typeof document < "u" && typeof document.startViewTransition == "function", X = (e) => e.then(() => void 0, () => void 0);
|
|
443
|
+
function Z(e) {
|
|
443
444
|
let t = Promise.resolve(e()).then(() => void 0, () => void 0);
|
|
444
445
|
return {
|
|
445
446
|
ready: t,
|
|
@@ -449,8 +450,8 @@ function X(e) {
|
|
|
449
450
|
backend: "immediate"
|
|
450
451
|
};
|
|
451
452
|
}
|
|
452
|
-
function
|
|
453
|
-
if (t.length === 0) return
|
|
453
|
+
function ie(e, t, n, r) {
|
|
454
|
+
if (t.length === 0) return Z(e);
|
|
454
455
|
let i = {
|
|
455
456
|
duration: n,
|
|
456
457
|
...r === void 0 ? {} : { timingFunction: r }
|
|
@@ -463,10 +464,10 @@ function oe(e, t, n, r) {
|
|
|
463
464
|
backend: "flip"
|
|
464
465
|
};
|
|
465
466
|
}
|
|
466
|
-
function
|
|
467
|
-
let { types: n, duration: r = J, timingFunction:
|
|
468
|
-
if (typeof
|
|
469
|
-
let t =
|
|
467
|
+
function ae(e, t = {}) {
|
|
468
|
+
let { types: n, duration: r = J, timingFunction: i, shared: a = [], fallback: o = "flip", respectReducedMotion: s = !0 } = t, c = () => {
|
|
469
|
+
if (typeof o == "function") {
|
|
470
|
+
let t = o(e).then(() => void 0, () => void 0);
|
|
470
471
|
return {
|
|
471
472
|
ready: t,
|
|
472
473
|
finished: t,
|
|
@@ -475,10 +476,10 @@ function se(e, t = {}) {
|
|
|
475
476
|
backend: "flip"
|
|
476
477
|
};
|
|
477
478
|
}
|
|
478
|
-
return
|
|
479
|
+
return o === "none" ? Z(e) : ie(e, a, r, i);
|
|
479
480
|
};
|
|
480
|
-
return
|
|
481
|
-
if (!
|
|
481
|
+
return d(s, () => Z(e), () => {
|
|
482
|
+
if (!Y()) return c();
|
|
482
483
|
let t = document.startViewTransition, r;
|
|
483
484
|
try {
|
|
484
485
|
r = n && n.length > 0 ? t({
|
|
@@ -489,13 +490,13 @@ function se(e, t = {}) {
|
|
|
489
490
|
try {
|
|
490
491
|
r = t(e);
|
|
491
492
|
} catch {
|
|
492
|
-
return
|
|
493
|
+
return c();
|
|
493
494
|
}
|
|
494
495
|
}
|
|
495
496
|
return {
|
|
496
|
-
ready:
|
|
497
|
-
finished:
|
|
498
|
-
updateCallbackDone:
|
|
497
|
+
ready: X(r.ready),
|
|
498
|
+
finished: X(r.finished),
|
|
499
|
+
updateCallbackDone: X(r.updateCallbackDone),
|
|
499
500
|
skip: () => r.skipTransition?.(),
|
|
500
501
|
backend: "view-transition"
|
|
501
502
|
};
|
|
@@ -503,7 +504,7 @@ function se(e, t = {}) {
|
|
|
503
504
|
}
|
|
504
505
|
//#endregion
|
|
505
506
|
//#region src/animation/orchestration/drag/draggable.ts
|
|
506
|
-
var
|
|
507
|
+
var oe = 100, se = .4, ce = 5, Q = class {
|
|
507
508
|
spring;
|
|
508
509
|
axis;
|
|
509
510
|
transform;
|
|
@@ -520,7 +521,7 @@ var ce = 100, le = .4, ue = 5, Z = class {
|
|
|
520
521
|
onPointerMove = (e) => this.handleMove(e);
|
|
521
522
|
onPointerUp = (e) => this.handleUp(e);
|
|
522
523
|
constructor(e) {
|
|
523
|
-
this.axis = e?.axis ?? "x", this.transform = e?.transform ?? ((e) => e), this.velocityWindow = e?.velocityWindow ??
|
|
524
|
+
this.axis = e?.axis ?? "x", this.transform = e?.transform ?? ((e) => e), this.velocityWindow = e?.velocityWindow ?? oe, this.bounds = e?.bounds, this.rubberBand = e?.rubberBand ?? se, this.snap = e?.snap !== void 0 && e.snap.length > 0 ? e.snap : void 0, this.spring = e?.spring ?? new g(e?.springOptions);
|
|
524
525
|
}
|
|
525
526
|
get dragging() {
|
|
526
527
|
return this.capturedPointerId !== void 0;
|
|
@@ -580,17 +581,17 @@ var ce = 100, le = .4, ue = 5, Z = class {
|
|
|
580
581
|
this.pushSample(n, e.timeStamp);
|
|
581
582
|
let r = this.estimateVelocity();
|
|
582
583
|
if (t && this.endGesture(t), this.snap) {
|
|
583
|
-
let e =
|
|
584
|
+
let e = f({
|
|
584
585
|
initial: n,
|
|
585
586
|
velocity: r,
|
|
586
|
-
friction:
|
|
587
|
+
friction: ce
|
|
587
588
|
}), t = this.nearestSnap(e);
|
|
588
|
-
this.bounds && (t =
|
|
589
|
+
this.bounds && (t = l(t, this.bounds.min, this.bounds.max)), this.spring.reset(n, r), this.spring.target = t;
|
|
589
590
|
return;
|
|
590
591
|
}
|
|
591
592
|
if (this.spring.reset(n, r), this.bounds) {
|
|
592
593
|
let e = this.spring.value;
|
|
593
|
-
(e < this.bounds.min || e > this.bounds.max) && (this.spring.target =
|
|
594
|
+
(e < this.bounds.min || e > this.bounds.max) && (this.spring.target = l(e, this.bounds.min, this.bounds.max));
|
|
594
595
|
}
|
|
595
596
|
}
|
|
596
597
|
nearestSnap(e) {
|
|
@@ -620,17 +621,17 @@ var ce = 100, le = .4, ue = 5, Z = class {
|
|
|
620
621
|
return r <= 0 ? 0 : (n.value - t.value) / r * 1e3;
|
|
621
622
|
}
|
|
622
623
|
};
|
|
623
|
-
function
|
|
624
|
-
let n = new
|
|
624
|
+
function le(e, t) {
|
|
625
|
+
let n = new Q(t);
|
|
625
626
|
return n.attach(e), n;
|
|
626
627
|
}
|
|
627
628
|
//#endregion
|
|
628
629
|
//#region src/animation/orchestration/drag/drag-2d.ts
|
|
629
|
-
function
|
|
630
|
-
let n = new
|
|
630
|
+
function ue(e, t) {
|
|
631
|
+
let n = new Q({
|
|
631
632
|
...t?.x,
|
|
632
633
|
axis: "x"
|
|
633
|
-
}), r = new
|
|
634
|
+
}), r = new Q({
|
|
634
635
|
...t?.y,
|
|
635
636
|
axis: "y"
|
|
636
637
|
});
|
|
@@ -667,60 +668,8 @@ function de(e, t) {
|
|
|
667
668
|
}
|
|
668
669
|
//#endregion
|
|
669
670
|
//#region src/animation/load-engine.ts
|
|
670
|
-
var
|
|
671
|
-
pe(),
|
|
672
|
-
import("./group-HM7N4uOE.js").then((e) => e.t),
|
|
673
|
-
import("./motion-path-wM5tPfrY.js").then((e) => e.r),
|
|
674
|
-
import("./draw-svg-CK9Qrly8.js").then((e) => e.n),
|
|
675
|
-
import("./morph-svg-KUrH9KnK.js").then((e) => e.r),
|
|
676
|
-
import("./ingest-_g6tfk2e.js").then((e) => e.t),
|
|
677
|
-
import("./scroll-BEyCx0b_.js").then((e) => e.t),
|
|
678
|
-
import("./compile-BHCTPerD.js").then((e) => e.t),
|
|
679
|
-
import("./view-transition-BPJQxUTC.js").then((e) => e.n),
|
|
680
|
-
import("./entry-D82NKUhP.js").then((e) => e.n),
|
|
681
|
-
import("./validate-xFZ_Ld1k.js").then((e) => e.r),
|
|
682
|
-
import("./presets-DeDJYL4G.js").then((e) => e.t),
|
|
683
|
-
import("./format-BdIvdLzG.js").then((e) => e.a),
|
|
684
|
-
import("./parse-flatten-DRMHFytp.js"),
|
|
685
|
-
import("./scheduler-CfGIC3GX.js").then((e) => e.t)
|
|
686
|
-
]).then(([e, t, n, r, i, a, o, s, c, l, u, d, f, p, m]) => Object.assign({
|
|
687
|
-
AnimationGroup: t.AnimationGroup,
|
|
688
|
-
MotionPath: n.MotionPath,
|
|
689
|
-
fromMotionPath: n.fromMotionPath,
|
|
690
|
-
DrawSVG: r.DrawSVG,
|
|
691
|
-
fromDrawSVG: r.fromDrawSVG,
|
|
692
|
-
MorphSVG: i.MorphSVG,
|
|
693
|
-
fromMorphSVG: i.fromMorphSVG,
|
|
694
|
-
fromStyleSheets: a.fromStyleSheets,
|
|
695
|
-
fromLiveAnimations: a.fromLiveAnimations,
|
|
696
|
-
resolveLiveKeyframes: a.resolveLiveKeyframes,
|
|
697
|
-
adoptRunning: a.adoptRunning,
|
|
698
|
-
ScrollScene: o.ScrollScene,
|
|
699
|
-
createScrollScene: o.createScrollScene,
|
|
700
|
-
parseScrollCSS: o.parseScrollCSS,
|
|
701
|
-
parseScrollTimeline: o.parseScrollTimeline,
|
|
702
|
-
parseScrollRange: o.parseScrollRange,
|
|
703
|
-
serializeScrollOptions: o.serializeScrollOptions,
|
|
704
|
-
roundTripScrollCSS: o.roundTripScrollCSS,
|
|
705
|
-
dispatchScrollBackend: o.dispatchScrollBackend,
|
|
706
|
-
resolveRange: o.resolveRange,
|
|
707
|
-
pinCSS: o.pinCSS,
|
|
708
|
-
TriggerScene: o.TriggerScene,
|
|
709
|
-
createTriggerScene: o.createTriggerScene,
|
|
710
|
-
supportsNativeTrigger: o.supportsNativeTrigger,
|
|
711
|
-
compileToCSS: s.compileToCSS,
|
|
712
|
-
compileToViewTransition: c.compileToViewTransition,
|
|
713
|
-
compileToEntry: l.compileToEntry,
|
|
714
|
-
validate: u.validate,
|
|
715
|
-
explain: u.explain,
|
|
716
|
-
presets: d,
|
|
717
|
-
CSSKeyframesToString: f.CSSKeyframesToString,
|
|
718
|
-
CSSKeyframesToStrings: f.CSSKeyframesToStrings,
|
|
719
|
-
formatCSSKeyframeString: f.formatCSSKeyframeString,
|
|
720
|
-
transformTargetsStyle: p.transformTargetsStyle,
|
|
721
|
-
yieldToMain: m.yieldToMain
|
|
722
|
-
}, e)), he = () => {
|
|
671
|
+
var de, $ = () => de ??= import("./engine/index.js"), fe = () => {
|
|
723
672
|
$();
|
|
724
673
|
};
|
|
725
674
|
//#endregion
|
|
726
|
-
export {
|
|
675
|
+
export { t as AnimationOptionError, Q as Draggable, C as ElementMorph, T as KeyframesScrollTimeline, E as ManualTimeline, y as NumericAnimation, O as Oscillator, s as RAFPlayback, h as Sequence, o as SmoothProgress, L as SplitTextRefusalError, g as SpringProgress, w as Timeline, e as UnknownEasingError, m as createNativeTimeline, r as decay, f as decayRest, le as drag, ue as drag2D, F as flip, I as flipShared, $ as loadAnimationEngine, b as probeVelocity, p as reducedMotionScale, x as reseatToSpring, i as resolveEasing, q as splitText, u as springLinearStops, a as springTimingFunction, A as stagger, v as toEasing, ae as viewTransition, fe as warmEngine, D as waveformValue };
|