@mkbabb/keyframes.js 6.2.1 → 6.3.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 +2 -0
- package/dist/engine/index.d.ts +11 -2
- package/dist/engine/index.js +1004 -1004
- package/dist/keyframes.d.ts +15 -2
- package/dist/keyframes.js +114 -114
- package/dist/registry-8bG0FhGi.js +163 -0
- package/dist/{registry-Dd7GzvJm.js → registry-Bs7A0T_s.js} +1 -1
- package/dist/{sequence-BUgKKePR.js → sequence-CPGHHEVM.js} +72 -69
- package/package.json +1 -1
- package/dist/registry-CPtiwlwX.js +0 -162
package/dist/keyframes.d.ts
CHANGED
|
@@ -138,6 +138,8 @@ export declare interface AnimationEngine {
|
|
|
138
138
|
resolveTimingFunction: typeof resolveTimingFunction;
|
|
139
139
|
/** The registry roster behind it — `[name, fn]`, stable, not injective. */
|
|
140
140
|
timingFunctionEntries: typeof timingFunctionEntries;
|
|
141
|
+
/** Invalidate the resolver's layout-unit cache after a container re-layout. */
|
|
142
|
+
bumpLayoutEpoch: typeof bumpLayoutEpoch;
|
|
141
143
|
}
|
|
142
144
|
|
|
143
145
|
/** Consumer-observable data for one compiled keyframe segment. */
|
|
@@ -593,6 +595,8 @@ declare const blurOut: PresetFactory;
|
|
|
593
595
|
|
|
594
596
|
declare const bounce: PresetFactory;
|
|
595
597
|
|
|
598
|
+
export declare const bumpLayoutEpoch: () => number;
|
|
599
|
+
|
|
596
600
|
/** The compile result — the artifact + the CC-3 ineligibility report. */
|
|
597
601
|
export declare interface CompiledCSS {
|
|
598
602
|
/**
|
|
@@ -839,7 +843,14 @@ export declare class CSSKeyframesAnimation<V extends Vars> extends KeyframesAnim
|
|
|
839
843
|
*/
|
|
840
844
|
bindTimeline(timeline: Timeline): this;
|
|
841
845
|
/**
|
|
842
|
-
*
|
|
846
|
+
* The one ingest head for the three `from*` entry points. An ingest
|
|
847
|
+
* REPLACES the animation's source (COHESION §0j.C KF-W5R4(1), G-FROMSTRING):
|
|
848
|
+
* the template set is reset here, so a second `fromString` / `fromKeyframes`
|
|
849
|
+
* / `fromVars` yields the parsed set alone, never a union with the last one.
|
|
850
|
+
* `addFrame` stays the incremental append. The setter re-marks the compiled
|
|
851
|
+
* set stale; `parse()` at the end of each entry recompiles it.
|
|
852
|
+
*
|
|
853
|
+
* It is also the one transform-resolution seam:
|
|
843
854
|
* a supplied transform is the consumer's renderer (vars arrive
|
|
844
855
|
* unflattened); genuine omission resolves to the instance's ONE
|
|
845
856
|
* default DOM-style renderer, which keeps WAAPI eligibility a
|
|
@@ -855,7 +866,7 @@ export declare class CSSKeyframesAnimation<V extends Vars> extends KeyframesAnim
|
|
|
855
866
|
* renderer with a foreign instance's default, and every frame then
|
|
856
867
|
* answered `usesDefaultRenderer` FALSE for a renderer nobody supplied.
|
|
857
868
|
*/
|
|
858
|
-
private
|
|
869
|
+
private beginIngest;
|
|
859
870
|
fromVars(vars: V[], transform?: TransformFunction<V>): this;
|
|
860
871
|
fromKeyframes(keyframes: Map<string, Partial<V>> | Record<string, Partial<V>>, transform?: TransformFunction<V>): this;
|
|
861
872
|
/**
|
|
@@ -3474,6 +3485,8 @@ export declare function serializeScrollOptions(opts: CSSTimelineOptions): {
|
|
|
3474
3485
|
"animation-trigger"?: string;
|
|
3475
3486
|
};
|
|
3476
3487
|
|
|
3488
|
+
export declare const serializeSelector: (selector: KeyframeSelector) => string;
|
|
3489
|
+
|
|
3477
3490
|
export declare const serializeTimingFunction: (value: NonNullable<CSSAnimationOptions["timingFunction"]>) => CssEasingLiteral;
|
|
3478
3491
|
|
|
3479
3492
|
declare const shake: PresetFactory;
|
package/dist/keyframes.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { D as e, E as t, S as n, T as r, _ as i, a, b as o, c as s, d as c, f as l, g as u, h as d, l as f, m as p, o as m, p as h, s as g, t as _, u as v, w as y, x as b, y as x } from "./sequence-CPGHHEVM.js";
|
|
2
2
|
//#region src/animation/physics/numeric.ts
|
|
3
|
-
var
|
|
3
|
+
var S = class {
|
|
4
4
|
_out = new Float64Array();
|
|
5
5
|
keyframes;
|
|
6
6
|
segments;
|
|
@@ -10,14 +10,14 @@ var x = class {
|
|
|
10
10
|
_respectReducedMotion;
|
|
11
11
|
_easingFn;
|
|
12
12
|
_playback = new d();
|
|
13
|
-
constructor(e,
|
|
13
|
+
constructor(e, n) {
|
|
14
14
|
if (e.length < 2) throw Error("NumericAnimation requires at least 2 keyframes.");
|
|
15
|
-
this.keyframes = e.map((e) => ({ ...e })), this._duration =
|
|
16
|
-
let
|
|
17
|
-
if (typeof
|
|
18
|
-
if (this._easingFn =
|
|
19
|
-
if (
|
|
20
|
-
this.positions =
|
|
15
|
+
this.keyframes = e.map((e) => ({ ...e })), this._duration = n?.duration ?? 0, this._respectReducedMotion = n?.respectReducedMotion ?? !1;
|
|
16
|
+
let i = n?.timingFunction;
|
|
17
|
+
if (typeof i == "string") throw new t("timingFunction", i, "NumericAnimation accepts a callable TimingFunction or a typed Easing; resolve a string name first via `await resolveEasing(name)`.");
|
|
18
|
+
if (this._easingFn = i == null ? (e) => e : r(i).fn, n?.positions) {
|
|
19
|
+
if (n.positions.length !== e.length) throw Error("positions length must match keyframes length.");
|
|
20
|
+
this.positions = n.positions;
|
|
21
21
|
} else this.positions = e.map((t, n) => n / (e.length - 1) * 100);
|
|
22
22
|
this.result = { ...e[0] }, this.segments = this.buildSegments();
|
|
23
23
|
}
|
|
@@ -42,12 +42,12 @@ var x = class {
|
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
44
|
at(e) {
|
|
45
|
-
let t =
|
|
46
|
-
|
|
47
|
-
let
|
|
48
|
-
this._out.length <
|
|
49
|
-
let
|
|
50
|
-
for (let e = 0; e <
|
|
45
|
+
let t = x(e, 0, 1) * 100, r = n(this.segments, t, (e) => e.startPos, (e) => e.stopPos);
|
|
46
|
+
r === -1 && (r = this.segments.length - 1);
|
|
47
|
+
let i = this.segments[r], a = b(x(t, i.startPos, i.stopPos), i.startPos, i.stopPos, 0, 1), s = i.timingFunction(a), c = i.keys.length;
|
|
48
|
+
this._out.length < c && (this._out = new Float64Array(c)), o(i.from, i.to, s, this._out);
|
|
49
|
+
let l = this.result;
|
|
50
|
+
for (let e = 0; e < c; e++) l[i.keys[e]] = this._out[e];
|
|
51
51
|
return this.result;
|
|
52
52
|
}
|
|
53
53
|
updateKeyframe(e, t) {
|
|
@@ -67,12 +67,12 @@ var x = class {
|
|
|
67
67
|
};
|
|
68
68
|
//#endregion
|
|
69
69
|
//#region src/animation/physics/spring/solver/reseat.ts
|
|
70
|
-
function
|
|
70
|
+
function C(e) {
|
|
71
71
|
let t = e.curr.time - e.prev.time;
|
|
72
72
|
return t <= 0 ? 0 : (e.curr.value - e.prev.value) / (t / 1e3);
|
|
73
73
|
}
|
|
74
|
-
function
|
|
75
|
-
let r =
|
|
74
|
+
function ee(e, t, n) {
|
|
75
|
+
let r = C(e), i = new h({
|
|
76
76
|
...n,
|
|
77
77
|
initial: e.curr.value,
|
|
78
78
|
initialVelocity: r
|
|
@@ -102,7 +102,7 @@ var w = (e) => {
|
|
|
102
102
|
}
|
|
103
103
|
measure(e, t) {
|
|
104
104
|
let n = w(e), r = w(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
|
|
105
|
+
return this.animation = new S([{
|
|
106
106
|
translateX: 0,
|
|
107
107
|
translateY: 0,
|
|
108
108
|
scaleX: 1,
|
|
@@ -143,12 +143,12 @@ var w = (e) => {
|
|
|
143
143
|
boundaryEpsilon;
|
|
144
144
|
constructor(e) {
|
|
145
145
|
this.boundaryEpsilon = e?.boundaryEpsilon ?? .005;
|
|
146
|
-
let
|
|
147
|
-
if (typeof
|
|
148
|
-
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 : r(n).fn, e?.smoothing === !1 ? this.smoother = null : this.smoother = new p(e?.smoothing);
|
|
149
149
|
}
|
|
150
150
|
applyPipeline() {
|
|
151
|
-
let e =
|
|
151
|
+
let e = x(this.sample(), 0, 1);
|
|
152
152
|
e = this._easingFn(e);
|
|
153
153
|
let t = this.boundaryEpsilon;
|
|
154
154
|
return e <= t ? e = 0 : e >= 1 - t && (e = 1), e;
|
|
@@ -176,7 +176,7 @@ var w = (e) => {
|
|
|
176
176
|
let t = e ?? 0;
|
|
177
177
|
this.smoother && this.smoother.reset(t), this.currentProgress = t;
|
|
178
178
|
}
|
|
179
|
-
},
|
|
179
|
+
}, D = class extends E {
|
|
180
180
|
threshold;
|
|
181
181
|
getScrollY;
|
|
182
182
|
getViewportHeight;
|
|
@@ -187,7 +187,7 @@ var w = (e) => {
|
|
|
187
187
|
let e = this.getViewportHeight() * this.threshold;
|
|
188
188
|
return e <= 0 ? 0 : this.getScrollY() / e;
|
|
189
189
|
}
|
|
190
|
-
},
|
|
190
|
+
}, O = class extends E {
|
|
191
191
|
value = 0;
|
|
192
192
|
constructor(e) {
|
|
193
193
|
super({
|
|
@@ -201,17 +201,17 @@ var w = (e) => {
|
|
|
201
201
|
sample() {
|
|
202
202
|
return this.value;
|
|
203
203
|
}
|
|
204
|
-
},
|
|
205
|
-
function
|
|
204
|
+
}, te = 2 * Math.PI;
|
|
205
|
+
function k(e, t) {
|
|
206
206
|
let n = e - Math.floor(e);
|
|
207
207
|
switch (t) {
|
|
208
|
-
case "sine": return Math.sin(
|
|
208
|
+
case "sine": return Math.sin(te * n);
|
|
209
209
|
case "triangle": return n < .5 ? 4 * n - 1 : 3 - 4 * n;
|
|
210
210
|
case "square": return n < .5 ? 1 : -1;
|
|
211
211
|
case "sawtooth": return 2 * n - 1;
|
|
212
212
|
}
|
|
213
213
|
}
|
|
214
|
-
var
|
|
214
|
+
var A = class {
|
|
215
215
|
frequency;
|
|
216
216
|
waveform;
|
|
217
217
|
phase = 0;
|
|
@@ -223,43 +223,43 @@ var ne = class {
|
|
|
223
223
|
return this.phase = t - Math.floor(t), this.phase;
|
|
224
224
|
}
|
|
225
225
|
get value() {
|
|
226
|
-
return
|
|
226
|
+
return k(this.phase, this.waveform);
|
|
227
227
|
}
|
|
228
228
|
sample(e) {
|
|
229
|
-
return
|
|
229
|
+
return k(e * this.frequency, this.waveform);
|
|
230
230
|
}
|
|
231
231
|
reset(e = 0) {
|
|
232
232
|
this.phase = e - Math.floor(e);
|
|
233
233
|
}
|
|
234
|
-
},
|
|
235
|
-
if (typeof e == "number") return
|
|
234
|
+
}, j = (e, t) => {
|
|
235
|
+
if (typeof e == "number") return x(e, 0, Math.max(0, t - 1));
|
|
236
236
|
switch (e) {
|
|
237
237
|
case "first": return 0;
|
|
238
238
|
case "last": return t - 1;
|
|
239
239
|
case "center": return (t - 1) / 2;
|
|
240
240
|
case "edges": return -1;
|
|
241
241
|
}
|
|
242
|
-
},
|
|
242
|
+
}, ne = (e, t, n) => n === "edges" ? Math.min(e, t - 1 - e) : Math.abs(e - j(n, t)), re = (e, t) => {
|
|
243
243
|
if (e <= 1) return 0;
|
|
244
244
|
if (t === "edges") return Math.floor((e - 1) / 2);
|
|
245
|
-
let n =
|
|
245
|
+
let n = j(t, e);
|
|
246
246
|
return Math.max(n, e - 1 - n);
|
|
247
247
|
};
|
|
248
|
-
function
|
|
249
|
-
let { each:
|
|
250
|
-
if (typeof
|
|
251
|
-
let
|
|
248
|
+
function M(e, n = {}) {
|
|
249
|
+
let { each: i = 100, from: a = "first", ease: o } = n;
|
|
250
|
+
if (typeof o == "string") throw new t("ease", o, "stagger accepts a callable TimingFunction or a typed Easing; resolve a string name first via `await resolveEasing(name)`.");
|
|
251
|
+
let s = o ? r(o).fn : void 0, c = typeof e == "number" ? e : e.length, l = (e, t) => {
|
|
252
252
|
if (t <= 1) return 0;
|
|
253
|
-
let n =
|
|
253
|
+
let n = re(t, a);
|
|
254
254
|
if (n === 0) return 0;
|
|
255
|
-
let
|
|
256
|
-
return
|
|
257
|
-
},
|
|
258
|
-
return
|
|
255
|
+
let r = ne(e, t, a);
|
|
256
|
+
return s ? s(r / n) * i * n : r * i;
|
|
257
|
+
}, u = ((e, t = c) => l(e, t));
|
|
258
|
+
return u.delays = (e = c) => Array.from({ length: e }, (t, n) => l(n, e)), u;
|
|
259
259
|
}
|
|
260
260
|
//#endregion
|
|
261
261
|
//#region src/animation/orchestration/flip.ts
|
|
262
|
-
var
|
|
262
|
+
var ie = 300, ae = "translate(0px, 0px) scale(1, 1)", N = (e) => {
|
|
263
263
|
let t = e.getBoundingClientRect();
|
|
264
264
|
return {
|
|
265
265
|
x: t.x,
|
|
@@ -267,38 +267,38 @@ var ae = 300, j = "translate(0px, 0px) scale(1, 1)", M = (e) => {
|
|
|
267
267
|
width: t.width,
|
|
268
268
|
height: t.height
|
|
269
269
|
};
|
|
270
|
-
},
|
|
271
|
-
let t =
|
|
272
|
-
return t === void 0 ? !1 : (t(), e.style.transform =
|
|
273
|
-
},
|
|
270
|
+
}, P = /* @__PURE__ */ new WeakMap(), F = (e) => {
|
|
271
|
+
let t = P.get(e);
|
|
272
|
+
return t === void 0 ? !1 : (t(), e.style.transform = ae, !0);
|
|
273
|
+
}, I = (e, t, n, r) => {
|
|
274
274
|
let { translateX: i, translateY: a, scaleX: o, scaleY: s } = e.at(r);
|
|
275
275
|
return `translate(${t.x + i - n.x}px, ${t.y + a - n.y}px) scale(${n.width === 0 ? 1 : t.width * o / n.width}, ${n.height === 0 ? 1 : t.height * s / n.height})`;
|
|
276
|
-
},
|
|
277
|
-
let { duration: a =
|
|
276
|
+
}, L = (e, t, n, r, i) => {
|
|
277
|
+
let { duration: a = ie, timingFunction: o, transformOrigin: s = "top left" } = i, c = new T(t, r, {
|
|
278
278
|
...o === void 0 ? {} : { timingFunction: o },
|
|
279
279
|
transformOrigin: s
|
|
280
280
|
});
|
|
281
|
-
if (e.style.transformOrigin = s, e.style.transform =
|
|
281
|
+
if (e.style.transformOrigin = s, e.style.transform = I(c, t, n, 0), a <= 0) return e.style.transform = I(c, t, n, 1), Object.assign(Promise.resolve(), { cancel: () => {} });
|
|
282
282
|
let l = new d(), u = () => {
|
|
283
|
-
l.stop(),
|
|
283
|
+
l.stop(), P.get(e) === u && P.delete(e);
|
|
284
284
|
};
|
|
285
|
-
|
|
285
|
+
P.set(e, u);
|
|
286
286
|
let f = l.play(a, (r) => {
|
|
287
|
-
e.style.transform =
|
|
287
|
+
e.style.transform = I(c, t, n, r);
|
|
288
288
|
}).then(() => {
|
|
289
|
-
|
|
289
|
+
P.get(e) === u && P.delete(e);
|
|
290
290
|
});
|
|
291
291
|
return Object.assign(f, { cancel: u });
|
|
292
292
|
};
|
|
293
293
|
function oe(e, t, n = {}) {
|
|
294
|
-
let r =
|
|
295
|
-
|
|
296
|
-
let i =
|
|
297
|
-
return
|
|
294
|
+
let r = N(e);
|
|
295
|
+
F(e), t();
|
|
296
|
+
let i = N(e);
|
|
297
|
+
return L(e, r, i, i, n);
|
|
298
298
|
}
|
|
299
|
-
function
|
|
300
|
-
let r =
|
|
301
|
-
return
|
|
299
|
+
function R(e, t, n = {}) {
|
|
300
|
+
let r = N(e);
|
|
301
|
+
return L(e, r, F(e) ? N(e) : r, N(t), n);
|
|
302
302
|
}
|
|
303
303
|
//#endregion
|
|
304
304
|
//#region src/animation/orchestration/split-text/refuse.ts
|
|
@@ -306,17 +306,17 @@ var se = {
|
|
|
306
306
|
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.",
|
|
307
307
|
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.",
|
|
308
308
|
empty: "there is no text content to split into lines."
|
|
309
|
-
},
|
|
309
|
+
}, z = class e extends Error {
|
|
310
310
|
name = "SplitTextRefusalError";
|
|
311
311
|
reason;
|
|
312
312
|
constructor(t, n) {
|
|
313
313
|
super(`splitText refused a by:"line" split (${t}): ` + (n ?? se[t])), this.reason = t, Object.setPrototypeOf(this, e.prototype);
|
|
314
314
|
}
|
|
315
|
-
},
|
|
316
|
-
function
|
|
317
|
-
if (
|
|
315
|
+
}, B = (e) => e.length === 0 || /^\s+$/u.test(e), V = typeof Intl < "u" && typeof Intl.Segmenter == "function";
|
|
316
|
+
function H(e, t) {
|
|
317
|
+
if (V) {
|
|
318
318
|
let n = new Intl.Segmenter(t, { granularity: "word" }), r = [], i = "", a = !1;
|
|
319
|
-
for (let { segment: t, isWordLike: o } of n.segment(e))
|
|
319
|
+
for (let { segment: t, isWordLike: o } of n.segment(e)) B(t) ? (i && r.push({
|
|
320
320
|
text: i,
|
|
321
321
|
kind: "unit"
|
|
322
322
|
}), i = "", r.push({
|
|
@@ -333,42 +333,42 @@ function V(e, t) {
|
|
|
333
333
|
}
|
|
334
334
|
return e.split(/(\s+)/u).filter((e) => e.length > 0).map((e) => ({
|
|
335
335
|
text: e,
|
|
336
|
-
kind:
|
|
336
|
+
kind: B(e) ? "space" : "unit"
|
|
337
337
|
}));
|
|
338
338
|
}
|
|
339
|
-
function
|
|
340
|
-
if (
|
|
339
|
+
function U(e, t) {
|
|
340
|
+
if (V) {
|
|
341
341
|
let n = new Intl.Segmenter(t, { granularity: "grapheme" }), r = [];
|
|
342
342
|
for (let { segment: t } of n.segment(e)) r.push({
|
|
343
343
|
text: t,
|
|
344
|
-
kind:
|
|
344
|
+
kind: B(t) ? "space" : "unit"
|
|
345
345
|
});
|
|
346
346
|
return r;
|
|
347
347
|
}
|
|
348
348
|
return Array.from(e).map((e) => ({
|
|
349
349
|
text: e,
|
|
350
|
-
kind:
|
|
350
|
+
kind: B(e) ? "space" : "unit"
|
|
351
351
|
}));
|
|
352
352
|
}
|
|
353
353
|
//#endregion
|
|
354
354
|
//#region src/animation/orchestration/split-text/split-text.ts
|
|
355
|
-
var
|
|
355
|
+
var W = (e) => Math.round(e), G = (e) => e.some((e) => {
|
|
356
356
|
let t = e.getBoundingClientRect();
|
|
357
357
|
return t.width > 0 || t.height > 0;
|
|
358
|
-
}),
|
|
359
|
-
function
|
|
358
|
+
}), ce = new Set(/* @__PURE__ */ "article.aside.blockquote.button.details.dialog.fieldset.figure.footer.form.h1.h2.h3.h4.h5.h6.header.hgroup.img.input.li.main.menu.meter.nav.ol.optgroup.option.output.progress.search.section.select.summary.table.td.textarea.th.tr.ul".split("."));
|
|
359
|
+
function le(e) {
|
|
360
360
|
if (e.hasAttribute("role")) return !0;
|
|
361
361
|
let t = e.tagName.toLowerCase();
|
|
362
|
-
return t === "a" || t === "area" ? e.hasAttribute("href") :
|
|
362
|
+
return t === "a" || t === "area" ? e.hasAttribute("href") : ce.has(t);
|
|
363
363
|
}
|
|
364
|
-
function
|
|
365
|
-
if (!e.isConnected || !
|
|
364
|
+
function ue(e) {
|
|
365
|
+
if (!e.isConnected || !G([e])) return !1;
|
|
366
366
|
let t = e.ownerDocument.createElement("span");
|
|
367
367
|
t.textContent = "x", t.style.cssText = "position:absolute;visibility:hidden", e.appendChild(t);
|
|
368
|
-
let n =
|
|
368
|
+
let n = G([t]);
|
|
369
369
|
return t.remove(), n;
|
|
370
370
|
}
|
|
371
|
-
function
|
|
371
|
+
function de(e, t, n, r) {
|
|
372
372
|
let i = e.createDocumentFragment(), a = [];
|
|
373
373
|
for (let o of t) {
|
|
374
374
|
if (o.kind === "space") {
|
|
@@ -384,9 +384,9 @@ function ue(e, t, n, r) {
|
|
|
384
384
|
};
|
|
385
385
|
}
|
|
386
386
|
function K(e, t, n, r, i) {
|
|
387
|
-
if (t.trim().length === 0) throw new
|
|
388
|
-
if (!
|
|
389
|
-
let a = e.ownerDocument, o =
|
|
387
|
+
if (t.trim().length === 0) throw new z("empty");
|
|
388
|
+
if (!ue(e)) throw new z("unmeasurable");
|
|
389
|
+
let a = e.ownerDocument, o = H(t, n), s = [], c = [], l = /* @__PURE__ */ new Map();
|
|
390
390
|
for (let e of o) {
|
|
391
391
|
if (e.kind === "space") {
|
|
392
392
|
s.push(a.createTextNode(e.text));
|
|
@@ -404,7 +404,7 @@ function K(e, t, n, r, i) {
|
|
|
404
404
|
};
|
|
405
405
|
if (t) {
|
|
406
406
|
if (t.kind === "unit" && e instanceof HTMLElement) {
|
|
407
|
-
let t =
|
|
407
|
+
let t = W(e.getBoundingClientRect().top);
|
|
408
408
|
f === null ? f = t : t !== f && (d.length > 0 && u.push(d), d = [], f = t);
|
|
409
409
|
}
|
|
410
410
|
d.push(t);
|
|
@@ -419,31 +419,31 @@ function K(e, t, n, r, i) {
|
|
|
419
419
|
return e.replaceChildren(p), m;
|
|
420
420
|
}
|
|
421
421
|
function q(e, t, n) {
|
|
422
|
-
return e.setAttribute("aria-label", t), n === null ||
|
|
422
|
+
return e.setAttribute("aria-label", t), n === null || le(e) ? !1 : (e.setAttribute("role", n), !0);
|
|
423
423
|
}
|
|
424
|
-
function
|
|
424
|
+
function fe(e, t = {}) {
|
|
425
425
|
let { by: n = "word", a11y: r = !0, role: i = "img", locale: a, stagger: o, fragmentClass: s = "kf-split", onRefuse: c } = t, l = e.ownerDocument, u = e.textContent ?? "", d = e.innerHTML, f = e.getAttribute("aria-label"), p;
|
|
426
426
|
if (n === "line") p = K(e, u, a, s, r);
|
|
427
427
|
else {
|
|
428
|
-
let t =
|
|
428
|
+
let t = de(l, n === "grapheme" ? U(u, a) : H(u, a), s, r);
|
|
429
429
|
e.replaceChildren(t.frag), p = t.fragments;
|
|
430
430
|
}
|
|
431
|
-
let m = r ? q(e, u, i) : !1, h =
|
|
432
|
-
n === "line" && (p = K(e, u, a, s, r), r && q(e, u, i), h =
|
|
431
|
+
let m = r ? q(e, u, i) : !1, h = M(p.length, o), g = h.delays(p.length), _ = null, v = 0, y = 0, b = () => {
|
|
432
|
+
n === "line" && (p = K(e, u, a, s, r), r && q(e, u, i), h = M(p.length, o), g = h.delays(p.length));
|
|
433
433
|
}, x = () => {
|
|
434
434
|
_?.disconnect(), _ = null;
|
|
435
435
|
};
|
|
436
436
|
return n === "line" && typeof ResizeObserver < "u" && (_ = new ResizeObserver(() => {
|
|
437
437
|
let e = typeof performance < "u" ? performance.now() : Date.now();
|
|
438
438
|
if (e - y > 500 && (y = e, v = 0), ++v > 12) {
|
|
439
|
-
let e = new
|
|
439
|
+
let e = new z("unstable");
|
|
440
440
|
x(), c?.(e);
|
|
441
441
|
return;
|
|
442
442
|
}
|
|
443
443
|
try {
|
|
444
444
|
b();
|
|
445
445
|
} catch (e) {
|
|
446
|
-
if (e instanceof
|
|
446
|
+
if (e instanceof z) {
|
|
447
447
|
x(), c?.(e);
|
|
448
448
|
return;
|
|
449
449
|
}
|
|
@@ -471,7 +471,7 @@ function de(e, t = {}) {
|
|
|
471
471
|
}
|
|
472
472
|
//#endregion
|
|
473
473
|
//#region src/animation/orchestration/view-transition/view-transition.ts
|
|
474
|
-
var
|
|
474
|
+
var pe = 300, me = () => typeof document < "u" && typeof document.startViewTransition == "function", J = (e) => e.then(() => void 0, () => void 0);
|
|
475
475
|
function Y(e) {
|
|
476
476
|
let t = Promise.resolve(e()).then(() => void 0, () => void 0);
|
|
477
477
|
return {
|
|
@@ -482,7 +482,7 @@ function Y(e) {
|
|
|
482
482
|
backend: "immediate"
|
|
483
483
|
};
|
|
484
484
|
}
|
|
485
|
-
function
|
|
485
|
+
function he(e, t, n, r) {
|
|
486
486
|
if (t.length === 0) return Y(e);
|
|
487
487
|
let i = {
|
|
488
488
|
duration: n,
|
|
@@ -490,16 +490,16 @@ function me(e, t, n, r) {
|
|
|
490
490
|
}, a = Promise.resolve(e()).then(() => void 0, () => void 0);
|
|
491
491
|
return {
|
|
492
492
|
ready: a,
|
|
493
|
-
finished: a.then(() => Promise.all(t.map(([e, t]) =>
|
|
493
|
+
finished: a.then(() => Promise.all(t.map(([e, t]) => R(e, t, i)))).then(() => void 0, () => void 0),
|
|
494
494
|
updateCallbackDone: a,
|
|
495
495
|
skip: () => {},
|
|
496
496
|
backend: "flip"
|
|
497
497
|
};
|
|
498
498
|
}
|
|
499
|
-
function
|
|
500
|
-
let { types: n, duration: r =
|
|
501
|
-
if (typeof
|
|
502
|
-
let t =
|
|
499
|
+
function X(e, t = {}) {
|
|
500
|
+
let { types: n, duration: r = pe, timingFunction: a, shared: o = [], fallback: s = "flip", respectReducedMotion: c = !0 } = t, l = () => {
|
|
501
|
+
if (typeof s == "function") {
|
|
502
|
+
let t = s(e).then(() => void 0, () => void 0);
|
|
503
503
|
return {
|
|
504
504
|
ready: t,
|
|
505
505
|
finished: t,
|
|
@@ -508,10 +508,10 @@ function he(e, t = {}) {
|
|
|
508
508
|
backend: "flip"
|
|
509
509
|
};
|
|
510
510
|
}
|
|
511
|
-
return
|
|
511
|
+
return s === "none" ? Y(e) : he(e, o, r, a);
|
|
512
512
|
};
|
|
513
|
-
return c
|
|
514
|
-
if (!
|
|
513
|
+
return i(c, () => Y(e), () => {
|
|
514
|
+
if (!me()) return l();
|
|
515
515
|
let t = document, r = t.startViewTransition.bind(t), i;
|
|
516
516
|
try {
|
|
517
517
|
i = n && n.length > 0 ? r({
|
|
@@ -536,7 +536,7 @@ function he(e, t = {}) {
|
|
|
536
536
|
}
|
|
537
537
|
//#endregion
|
|
538
538
|
//#region src/animation/orchestration/drag/draggable.ts
|
|
539
|
-
var ge = 100, _e = .4, ve = 5,
|
|
539
|
+
var ge = 100, _e = .4, ve = 5, Z = class {
|
|
540
540
|
spring;
|
|
541
541
|
axis;
|
|
542
542
|
transform;
|
|
@@ -553,7 +553,7 @@ var ge = 100, _e = .4, ve = 5, X = class {
|
|
|
553
553
|
onPointerMove = (e) => this.handleMove(e);
|
|
554
554
|
onPointerUp = (e) => this.handleUp(e);
|
|
555
555
|
constructor(e) {
|
|
556
|
-
this.axis = e?.axis ?? "x", this.transform = e?.transform ?? ((e) => e), this.velocityWindow = e?.velocityWindow ?? ge, this.bounds = e?.bounds, this.rubberBand = e?.rubberBand ?? _e, this.snap = e?.snap !== void 0 && e.snap.length > 0 ? e.snap : void 0, this.spring = e?.spring ?? new
|
|
556
|
+
this.axis = e?.axis ?? "x", this.transform = e?.transform ?? ((e) => e), this.velocityWindow = e?.velocityWindow ?? ge, this.bounds = e?.bounds, this.rubberBand = e?.rubberBand ?? _e, this.snap = e?.snap !== void 0 && e.snap.length > 0 ? e.snap : void 0, this.spring = e?.spring ?? new h(e?.springOptions);
|
|
557
557
|
}
|
|
558
558
|
get dragging() {
|
|
559
559
|
return this.capturedPointerId !== void 0;
|
|
@@ -613,17 +613,17 @@ var ge = 100, _e = .4, ve = 5, X = class {
|
|
|
613
613
|
this.pushSample(n, e.timeStamp);
|
|
614
614
|
let r = this.estimateVelocity();
|
|
615
615
|
if (t && this.endGesture(t), this.snap) {
|
|
616
|
-
let e =
|
|
616
|
+
let e = m({
|
|
617
617
|
initial: n,
|
|
618
618
|
velocity: r,
|
|
619
619
|
friction: ve
|
|
620
620
|
}), t = this.nearestSnap(e);
|
|
621
|
-
this.bounds && (t =
|
|
621
|
+
this.bounds && (t = x(t, this.bounds.min, this.bounds.max)), this.spring.reset(n, r), this.spring.target = t;
|
|
622
622
|
return;
|
|
623
623
|
}
|
|
624
624
|
if (this.spring.reset(n, r), this.bounds) {
|
|
625
625
|
let e = this.spring.value;
|
|
626
|
-
(e < this.bounds.min || e > this.bounds.max) && (this.spring.target =
|
|
626
|
+
(e < this.bounds.min || e > this.bounds.max) && (this.spring.target = x(e, this.bounds.min, this.bounds.max));
|
|
627
627
|
}
|
|
628
628
|
}
|
|
629
629
|
nearestSnap(e) {
|
|
@@ -653,17 +653,17 @@ var ge = 100, _e = .4, ve = 5, X = class {
|
|
|
653
653
|
return r <= 0 ? 0 : (n.value - t.value) / r * 1e3;
|
|
654
654
|
}
|
|
655
655
|
};
|
|
656
|
-
function
|
|
657
|
-
let n = new
|
|
656
|
+
function ye(e, t) {
|
|
657
|
+
let n = new Z(t);
|
|
658
658
|
return n.attach(e), n;
|
|
659
659
|
}
|
|
660
660
|
//#endregion
|
|
661
661
|
//#region src/animation/orchestration/drag/2d.ts
|
|
662
|
-
function
|
|
663
|
-
let n = new
|
|
662
|
+
function be(e, t) {
|
|
663
|
+
let n = new Z({
|
|
664
664
|
...t?.x,
|
|
665
665
|
axis: "x"
|
|
666
|
-
}), r = new
|
|
666
|
+
}), r = new Z({
|
|
667
667
|
...t?.y,
|
|
668
668
|
axis: "y"
|
|
669
669
|
});
|
|
@@ -702,8 +702,8 @@ function ye(e, t) {
|
|
|
702
702
|
//#region src/animation/load-engine.ts
|
|
703
703
|
var Q, $ = () => Q ??= import("./engine/index.js").catch((e) => {
|
|
704
704
|
throw Q = void 0, e;
|
|
705
|
-
}),
|
|
705
|
+
}), xe = () => {
|
|
706
706
|
$();
|
|
707
707
|
};
|
|
708
708
|
//#endregion
|
|
709
|
-
export {
|
|
709
|
+
export { t as AnimationOptionError, Z as Draggable, T as ElementMorph, D as KeyframesScrollTimeline, O as ManualTimeline, S as NumericAnimation, A as Oscillator, d as RAFPlayback, _ as Sequence, p as SmoothProgress, z as SplitTextRefusalError, h as SpringProgress, E as Timeline, e as UnknownEasingError, g as createNativeTimeline, a as decay, m as decayRest, ye as drag, be as drag2D, oe as flip, R as flipShared, c as linearFromSamples, $ as loadAnimationEngine, C as probeVelocity, u as reducedMotionScale, ee as reseatToSpring, y as resolveEasing, s as serializeSelector, fe as splitText, l as springLinearStops, f as springTimingFunction, v as springTimingLUT, M as stagger, r as toEasing, X as viewTransition, xe as warmEngine, k as waveformValue };
|