@mkbabb/keyframes.js 4.4.0 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -7
- package/dist/{animate-CuUJt2Tb.js → animate-CTWr6K7j.js} +3 -3
- package/dist/{animations-5nf2kBkv.js → animations-CZxf0rep.js} +2 -2
- package/dist/{compile-DgNRG6Lo.js → compile-YRJRdpKF.js} +2 -2
- package/dist/{draw-svg-DYRDxBlL.js → draw-svg-Dat9mHgi.js} +1 -1
- package/dist/{engine-CNHvTgpw.js → engine-DQcb7CLW.js} +516 -289
- package/dist/{ingest-CNM5xkQT.js → ingest-CU-kdYcM.js} +1 -1
- package/dist/keyframes.d.ts +178 -115
- package/dist/keyframes.js +39 -39
- package/dist/morph-svg-83uyYxoW.js +84 -0
- package/dist/{motion-path-J-RSNmRQ.js → motion-path-C0OHqcA3.js} +1 -1
- package/dist/{scroll-scene-CXEgM49Q.js → scroll-scene-DQxhxn9I.js} +2 -2
- package/dist/{sequence-CF5hazqz.js → sequence-cBr7thU8.js} +1 -1
- package/dist/{springTimingFunction-CDHZ00JQ.js → springTimingFunction-D26gPkAy.js} +1 -1
- package/dist/{timeline-B7SV3T_E.js → timeline-vY3eD3Ax.js} +27 -39
- package/dist/{utils-D7nuAND5.js → utils-BPRImVl5.js} +28 -25
- package/dist/{validate-8r6Yo-uc.js → validate-B1pE-Y_T.js} +3 -3
- package/dist/{waapi-D9MHMm_9.js → waapi-D0ssxKy1.js} +90 -28
- package/package.json +35 -5
- package/dist/morph-svg-DRjl9Hfz.js +0 -62
package/dist/keyframes.d.ts
CHANGED
|
@@ -147,12 +147,10 @@ export declare interface AnimateOptions extends Partial<InputAnimationOptions> {
|
|
|
147
147
|
export declare interface AnimationEngine {
|
|
148
148
|
/**
|
|
149
149
|
* The core engine constructor (PKG-3, L.W8 §S4) — renamed from `Animation`
|
|
150
|
-
* to clear the `globalThis.Animation` d.ts collision. `Animation`
|
|
151
|
-
*
|
|
150
|
+
* to clear the `globalThis.Animation` d.ts collision. The legacy `Animation`
|
|
151
|
+
* backward-compat alias was DROPPED in 5.0.0 (Q.WE1 — NO-LEGACY).
|
|
152
152
|
*/
|
|
153
153
|
KeyframesAnimation: typeof KeyframesAnimation;
|
|
154
|
-
/** @deprecated Use {@link KeyframesAnimation}. Backward-compat alias (PKG-3). */
|
|
155
|
-
Animation: typeof KeyframesAnimation;
|
|
156
154
|
CSSKeyframesAnimation: typeof CSSKeyframesAnimation;
|
|
157
155
|
AnimationGroup: typeof AnimationGroup;
|
|
158
156
|
getAnimationId: (animation: KeyframesAnimation | string) => string;
|
|
@@ -286,6 +284,16 @@ export declare interface AnimationFrame<V extends Vars> {
|
|
|
286
284
|
* on every interpFrames() call in the hot path.
|
|
287
285
|
*/
|
|
288
286
|
allInterpVars: Array<InterpolatedVar<V>>;
|
|
287
|
+
/**
|
|
288
|
+
* Q.WB3 S2 — the precomputed numeric SoA fold layout (built ONCE at `parse`
|
|
289
|
+
* over the stable `allInterpVars` set). `processFrame` folds the numeric subset
|
|
290
|
+
* through ONE `lerpArray` over the packed `Float64Array` buffers and strides
|
|
291
|
+
* the result back into the numeric leaves' `.value` slots; the boxed residual
|
|
292
|
+
* (color/computed/mixed) keeps the per-element `lerpValue`. Absent (undefined)
|
|
293
|
+
* for a frame with no numeric ivs, or before `parse` runs — `processFrame`
|
|
294
|
+
* falls back to the all-boxed walk. Bit-identical to the boxed path.
|
|
295
|
+
*/
|
|
296
|
+
_numericPlan?: NumericFoldPlan<V>;
|
|
289
297
|
transform: TransformFunction<V>;
|
|
290
298
|
timingFunction: Easing;
|
|
291
299
|
/**
|
|
@@ -357,19 +365,19 @@ export declare class AnimationGroup<V extends Vars> {
|
|
|
357
365
|
private _groupedKeysDirty;
|
|
358
366
|
/**
|
|
359
367
|
* P.W2 — the SoA composite layout for the `add`/`weighted` blend arms (the
|
|
360
|
-
* validated 3.7× — `scripts/
|
|
368
|
+
* validated 3.7× — `scripts/soa-composite-decision.json`, bit-identical
|
|
361
369
|
* `maxErr=0`). One {@link SoALayerPlan} per `add`/`weighted` entry: the FLAT
|
|
362
370
|
* list of pure-numeric `(carrier, incoming)` `ValueUnit<number>` pairs that
|
|
363
371
|
* blend would touch, hoisted out of the per-frame `for..in` + `Array.isArray`
|
|
364
372
|
* + per-element `isNumericUnit` dispatch into a contiguous {@link Float64Array}
|
|
365
|
-
* fold.
|
|
366
|
-
*
|
|
367
|
-
*
|
|
368
|
-
* per-element path. The
|
|
369
|
-
*
|
|
370
|
-
*
|
|
371
|
-
*
|
|
372
|
-
* `invalidateEntries`).
|
|
373
|
+
* fold. Built by {@link buildSoAPlans} (INTERNAL, `./group-soa`). Rebuilt ONLY
|
|
374
|
+
* on a structural change (alongside `_groupedKeys`), NEVER per frame. The
|
|
375
|
+
* `replace` default arm is dispatch-free and carries NO plan; the non-numeric
|
|
376
|
+
* (color/computed/string/mixed) tail keeps the boxed per-element path. The
|
|
377
|
+
* probe (`carrier-probe`) proved `interpFrames` MUTATES each leaf
|
|
378
|
+
* `ValueUnit.value` IN PLACE, so the carrier + incoming refs are STABLE across
|
|
379
|
+
* frames — the plan is valid until the entry set / a layer whitelist / a blend
|
|
380
|
+
* mode changes (every such mutation routes through `invalidateEntries`).
|
|
373
381
|
*/
|
|
374
382
|
private _soaPlans;
|
|
375
383
|
/**
|
|
@@ -426,35 +434,14 @@ export declare class AnimationGroup<V extends Vars> {
|
|
|
426
434
|
private boxedBlendArm;
|
|
427
435
|
/**
|
|
428
436
|
* P.W2 — the SoA fold for ONE `add`/`weighted` layer (the validated 3.7×,
|
|
429
|
-
* `scripts/
|
|
430
|
-
*
|
|
431
|
-
*
|
|
432
|
-
* plan
|
|
433
|
-
*
|
|
434
|
-
*
|
|
435
|
-
* are frame-stable — `interpFrames` mutates `.value` in place), so writing the
|
|
436
|
-
* folded result back to `carrier.value` mutates the live composite exactly as
|
|
437
|
-
* the boxed arm did. The `add` accumulate is naturally UN-CLAMPED; the
|
|
438
|
-
* `weighted` lerp reads ONE per-layer `w` (the K.W11 PHYS-C spring weight).
|
|
437
|
+
* `scripts/soa-composite-decision.json`, bit-identical `maxErr=0`). A thin
|
|
438
|
+
* delegating wrapper over {@link groupSoABlendLayer} (the fold body lives in
|
|
439
|
+
* `./group-soa`, Q.WF2): the wrapper forwards the group's `_compositeBuf`
|
|
440
|
+
* scratch + the plan. The instance METHOD is kept (not inlined at the call
|
|
441
|
+
* site) so `proof:soa-composite`'s `soa-path-taken` clause can monkey-patch
|
|
442
|
+
* `group.soaBlendLayer` on the instance to count fold invocations.
|
|
439
443
|
*/
|
|
440
444
|
private soaBlendLayer;
|
|
441
|
-
/**
|
|
442
|
-
* P.W2 — build the SoA fold layout for every `add`/`weighted` layer (rebuilt
|
|
443
|
-
* ONLY on a structural change, gated by the `_groupedKeys` dirty seam). A
|
|
444
|
-
* NON-destructive carrier-resolution walk in zIndex order mirrors the boxed
|
|
445
|
-
* blend's carrier semantics EXACTLY: `replace` (and the non-array first-touch
|
|
446
|
-
* fall-through) parks a key's leaf as its carrier; `add`/`weighted` over an
|
|
447
|
-
* array carrier blend the numeric elements in place. For each `add`/`weighted`
|
|
448
|
-
* layer, the pure-numeric `(carrier, incoming)` element pairs (carrier IS an
|
|
449
|
-
* array, both elements numeric) are extracted into the flat `carriers`/
|
|
450
|
-
* `incomings` arrays the fold loops; every other key it touches (non-array
|
|
451
|
-
* carrier, or ANY non-numeric / mixed element) is recorded in `boxedKeys` for
|
|
452
|
-
* the boxed residual. `_compositeBuf` is grown to the widest layer's numeric
|
|
453
|
-
* width ONCE (reused across layers and frames — zero per-frame alloc). The
|
|
454
|
-
* walk mutates NOTHING (it reads `.value` only to classify, never writes), so
|
|
455
|
-
* the building frame's already-computed composite is untouched.
|
|
456
|
-
*/
|
|
457
|
-
private buildSoAPlans;
|
|
458
445
|
/**
|
|
459
446
|
* Render the current composition as a static frame at each child's current
|
|
460
447
|
* `t`. Single-target groups go through the blended transform; multi-target
|
|
@@ -937,7 +924,33 @@ export declare function createNativeTimeline(spec: NativeTimelineSpec): Animatio
|
|
|
937
924
|
declare function createScrollScene(spec?: ScrollSceneOptions | CSSTimelineOptions): ScrollScene;
|
|
938
925
|
|
|
939
926
|
export declare class CSSKeyframesAnimation<V extends Vars> extends KeyframesAnimation<V> {
|
|
927
|
+
/**
|
|
928
|
+
* Q.WD1-bind S2 (DM-22) — the timeline a scroll-range named selector resolves
|
|
929
|
+
* its phase against. Stored by {@link bindTimeline} for the no-timeline guard's
|
|
930
|
+
* check; `undefined` until a timeline is bound. A scroll-context operation
|
|
931
|
+
* specific to CSS keyframes with named selectors (the base `Animation` class is
|
|
932
|
+
* value.js-/scroll-agnostic), so the field + method live here.
|
|
933
|
+
*/
|
|
934
|
+
private _boundTimeline?;
|
|
940
935
|
constructor(options?: Partial<InputAnimationOptions>, ...targets: HTMLElement[]);
|
|
936
|
+
/**
|
|
937
|
+
* Q.WD1-bind S2 (DM-22) — the attach-time deferred-resolution seam. A
|
|
938
|
+
* scroll-range named keyframe selector (`entry`/`exit`/`cover`/`contain`)
|
|
939
|
+
* ingests OPAQUELY (the L.W1 S4 floor) and is RESOLVABLE only under a timeline;
|
|
940
|
+
* `bindTimeline` is where that resolution happens. It walks `templateFrames`,
|
|
941
|
+
* resolves each named-selector start to a numeric `%` `ValueUnit` via
|
|
942
|
+
* {@link namedSelectorToFraction}, CLEARS the `NAMED_SELECTOR_SUPERTYPE` tag (so
|
|
943
|
+
* the resolved frame is indistinguishable from an author-written `%` at the sort
|
|
944
|
+
* step — no NaN), and re-compiles. The play-time guard
|
|
945
|
+
* (`assertNoUnresolvedNamedSelector`) then finds zero unresolved frames and
|
|
946
|
+
* passes silently — so this MUST land before the guard fires (the gate-enforced
|
|
947
|
+
* sub-wave ordering: the guard over-throws on a bound animation if the resolver
|
|
948
|
+
* is absent).
|
|
949
|
+
*
|
|
950
|
+
* Idempotent + safe to call before `fromString`: with no named frames the walk
|
|
951
|
+
* is a no-op; calling it after a NaN-producing `parse()` purges the NaN frames.
|
|
952
|
+
*/
|
|
953
|
+
bindTimeline(timeline: Timeline): this;
|
|
941
954
|
/**
|
|
942
955
|
* One transform-resolution seam for the three `from*` entry points:
|
|
943
956
|
* a supplied transform is the consumer's renderer (vars arrive
|
|
@@ -1481,8 +1494,6 @@ export declare interface ElementMorphOptions {
|
|
|
1481
1494
|
export declare interface EngineCore {
|
|
1482
1495
|
/** The core engine constructor (PKG-3, L.W8 §S4 — renamed from `Animation`). */
|
|
1483
1496
|
KeyframesAnimation: typeof KeyframesAnimation;
|
|
1484
|
-
/** @deprecated Use {@link KeyframesAnimation}. Backward-compat alias (PKG-3). */
|
|
1485
|
-
Animation: typeof KeyframesAnimation;
|
|
1486
1497
|
CSSKeyframesAnimation: typeof CSSKeyframesAnimation;
|
|
1487
1498
|
AnimationGroup: typeof AnimationGroup;
|
|
1488
1499
|
getAnimationId: (animation: KeyframesAnimation | string) => string;
|
|
@@ -1746,15 +1757,19 @@ declare const fromLiveAnimations: <V extends Vars = any>(target?: Document | Ele
|
|
|
1746
1757
|
*
|
|
1747
1758
|
* @param from the source SVG path `d` string.
|
|
1748
1759
|
* @param to the target SVG path `d` string (differing geometry).
|
|
1749
|
-
* @param options `{ samples?, target?, autoPlay?, ...animationOptions }`.
|
|
1760
|
+
* @param options `{ samples?, target?, orient?, autoPlay?, ...animationOptions }`.
|
|
1750
1761
|
*
|
|
1751
1762
|
* @example
|
|
1752
|
-
* // Morph a triangle into a square over 1s
|
|
1763
|
+
* // Morph a triangle into a square over 1s, RENDERING onto a live <path>:
|
|
1764
|
+
* const path = document.querySelector("path");
|
|
1753
1765
|
* const m = fromMorphSVG(
|
|
1754
1766
|
* "M 0 0 L 100 0 L 50 100 Z",
|
|
1755
1767
|
* "M 0 0 L 100 0 L 100 100 L 0 100 Z",
|
|
1756
|
-
* { duration: 1000 },
|
|
1768
|
+
* { duration: 1000, target: path },
|
|
1757
1769
|
* );
|
|
1770
|
+
* // each frame the engine writes path.style.d = path("…") + --morph-d so the
|
|
1771
|
+
* // morphing shape paints directly (no author-side reader needed on Chromium/
|
|
1772
|
+
* // Safari; `<path style="d: var(--morph-d)">` is the Firefox-lags fallback).
|
|
1758
1773
|
*/
|
|
1759
1774
|
declare function fromMorphSVG<V extends Record<string, any> = any>(from: string, to: string, options?: MorphSVGOptions): CSSKeyframesAnimation<V>;
|
|
1760
1775
|
|
|
@@ -1916,12 +1931,11 @@ export declare type KeyframeMap<V extends Vars> = Map<string, Partial<V>> | Reco
|
|
|
1916
1931
|
* ── PKG-3 RENAME (L.W8 §S4 · audit W126). Formerly `Animation`; renamed to
|
|
1917
1932
|
* `KeyframesAnimation` because the old name collided with the ambient
|
|
1918
1933
|
* `globalThis.Animation` (WAAPI), leaking a numeric-suffixed collision alias
|
|
1919
|
-
* into the d.ts roll-up (packaging-k.md:118-127). The
|
|
1920
|
-
*
|
|
1921
|
-
*
|
|
1922
|
-
* `proof:pkg3-clean`. The runtime constructor is `KeyframesAnimation`.
|
|
1934
|
+
* into the d.ts roll-up (packaging-k.md:118-127). The legacy `Animation`
|
|
1935
|
+
* backward-compat RE-EXPORT alias was DROPPED in 5.0.0 (Q.WE1 — NO-LEGACY).
|
|
1936
|
+
* Gated by `proof:pkg3-clean`. The runtime constructor is `KeyframesAnimation`.
|
|
1923
1937
|
*/
|
|
1924
|
-
declare class KeyframesAnimation<V extends Vars = any> {
|
|
1938
|
+
export declare class KeyframesAnimation<V extends Vars = any> {
|
|
1925
1939
|
id: number;
|
|
1926
1940
|
name: string | undefined;
|
|
1927
1941
|
superKey: string | undefined;
|
|
@@ -2143,6 +2157,22 @@ declare class KeyframesAnimation<V extends Vars = any> {
|
|
|
2143
2157
|
get restPosition(): "initial" | "final";
|
|
2144
2158
|
/** Paint the rest frame per the fill contract. */
|
|
2145
2159
|
paintRest(): void;
|
|
2160
|
+
/**
|
|
2161
|
+
* Q.WD1 S3 (DM-22) — the named-selector PLAY-TIME guard. A scroll-range named
|
|
2162
|
+
* selector (`entry`/`exit`/`cover`/`contain`) ingests + round-trips opaquely
|
|
2163
|
+
* (the L.W1 S4 floor — `fromString`/`parse()` NEVER throw); it is RESOLVABLE to
|
|
2164
|
+
* a numeric `%` only under a `ScrollTimeline`/`ManualTimeline` via
|
|
2165
|
+
* `bindTimeline`. If a numeric position is genuinely DEMANDED (`play()`/`at()`)
|
|
2166
|
+
* while a template frame still carries `NAMED_SELECTOR_SUPERTYPE` (unresolved —
|
|
2167
|
+
* `bindTimeline` was never called), refuse with the TYPED
|
|
2168
|
+
* `NAMED_SELECTOR_NO_TIMELINE` rather than silently producing NaN frames that
|
|
2169
|
+
* `binarySearchRange` treats as ALWAYS-ACTIVE. Fired ONLY at the genuinely-
|
|
2170
|
+
* demanded point — NEVER at parse/ingest (the reverted Path-A trap). A resolved
|
|
2171
|
+
* frame (the superType tag CLEARED by `bindTimeline`) passes silently — this is
|
|
2172
|
+
* a zero-cost `Array.find` over `templateFrames` whose starts are `%`/`from`/
|
|
2173
|
+
* `to` (no `superType`) on a non-named animation.
|
|
2174
|
+
*/
|
|
2175
|
+
private assertNoUnresolvedNamedSelector;
|
|
2146
2176
|
/**
|
|
2147
2177
|
* Stateless progress query. Maps [0,1] from first keyframe to last,
|
|
2148
2178
|
* regardless of playback direction. `apply=true` invokes transform callbacks.
|
|
@@ -2211,55 +2241,12 @@ declare class KeyframesAnimation<V extends Vars = any> {
|
|
|
2211
2241
|
* delay sleep. Ordering locked by proof:event-ordering.
|
|
2212
2242
|
*/
|
|
2213
2243
|
advanceTo(t: number): number | Promise<number>;
|
|
2214
|
-
|
|
2215
|
-
private _advance;
|
|
2244
|
+
private get _host();
|
|
2216
2245
|
/**
|
|
2217
2246
|
* One frame of the standalone rAF play path, driven by the shared
|
|
2218
2247
|
* `RAFPlayback.loop`. Returns whether the loop should continue.
|
|
2219
2248
|
*/
|
|
2220
2249
|
private _frame;
|
|
2221
|
-
/** The post-advance render half of `_frame` — paint, or settle on done. */
|
|
2222
|
-
private _renderFrame;
|
|
2223
|
-
private _resolvePlay;
|
|
2224
|
-
/** Internal rAF-based play loop — loop ownership rides `this.playback`. */
|
|
2225
|
-
private _playRAF;
|
|
2226
|
-
/**
|
|
2227
|
-
* Play via the Web Animations API. WAAPI handles visuals on the
|
|
2228
|
-
* compositor thread; a shadow loop in `playWAAPI` (riding
|
|
2229
|
-
* `this.playback`) drives `advanceTo()` so events, iteration count,
|
|
2230
|
-
* pause/resume, and other lifecycle state stay coherent with the
|
|
2231
|
-
* rAF path.
|
|
2232
|
-
*
|
|
2233
|
-
* No silent fallback — eligibility is decided once in `play()`
|
|
2234
|
-
* before this is invoked, and runtime errors propagate.
|
|
2235
|
-
*/
|
|
2236
|
-
private _playWAAPI;
|
|
2237
|
-
/**
|
|
2238
|
-
* Cancel the live WAAPI compositor animations (if any). Cancelling
|
|
2239
|
-
* rejects each `wa.finished`, which `playWAAPI` catches as a halt — so
|
|
2240
|
-
* this both stops the compositor paint AND unblocks the awaited play
|
|
2241
|
-
* promise. No-op on the rAF path.
|
|
2242
|
-
*/
|
|
2243
|
-
private _cancelWAAPI;
|
|
2244
|
-
/**
|
|
2245
|
-
* `prefers-reduced-motion` snap: rest = final, paint it, settle — the
|
|
2246
|
-
* SAME terminal path a `fillMode: forwards` completion takes, with the
|
|
2247
|
-
* motion elided. The lifecycle stays observable (`animationstart` →
|
|
2248
|
-
* final paint → `animationend`) so consumers' event wiring is identical
|
|
2249
|
-
* to a completed normal play.
|
|
2250
|
-
*/
|
|
2251
|
-
private _playReducedMotion;
|
|
2252
|
-
/**
|
|
2253
|
-
* Mid-flight reduced-motion snap (D-LIB-3). A running rAF loop detected a
|
|
2254
|
-
* live flip to `reduce`; converge to the rest frame and resolve the
|
|
2255
|
-
* in-flight `play()` exactly as a forwards completion would. Distinct from
|
|
2256
|
-
* `_playReducedMotion` (the up-front gate) only in that `animationstart`
|
|
2257
|
-
* already fired — so here we paint final, mark done, end, settle, and
|
|
2258
|
-
* release the awaiter. The WAAPI lane snaps via the same path: the up-front
|
|
2259
|
-
* gate already routes reduced-motion away from WAAPI, and a live flip on a
|
|
2260
|
-
* WAAPI animation cancels the compositor handles before settling.
|
|
2261
|
-
*/
|
|
2262
|
-
private _snapToReducedMotion;
|
|
2263
2250
|
/**
|
|
2264
2251
|
* The completion front-door (G.W13) — `await anim.finished` resolves once
|
|
2265
2252
|
* the in-flight play settles. It exposes the ONE held `_playingPromise`
|
|
@@ -2306,10 +2293,39 @@ declare class KeyframesAnimation<V extends Vars = any> {
|
|
|
2306
2293
|
*/
|
|
2307
2294
|
reset(): this;
|
|
2308
2295
|
setTargets(...targets: HTMLElement[]): this;
|
|
2296
|
+
/**
|
|
2297
|
+
* Q.WB1 — the emerging-CSS Phase-2 SECOND resolution pass (the gestalt P.W13
|
|
2298
|
+
* designed: ONE rewriter, a SECOND lifecycle point — element-populated env,
|
|
2299
|
+
* SAME `ResolveContext` shape). Runs over the PRE-FLATTEN
|
|
2300
|
+
* `compiler.templateFrames[i].vars` snapshot (the Phase-1-resolved, unflattened
|
|
2301
|
+
* `Record<string, ValueArray>` `parse()` re-flattens via
|
|
2302
|
+
* `parseAndFlattenObject`), so a Phase-1-resolved leaf — already a concrete
|
|
2303
|
+
* `ValueUnit` — is returned as-is by `resolveNode`, making the pass idempotent
|
|
2304
|
+
* over the Phase-1 result. Gated by `hasPhase2Node`: a declaration with NO
|
|
2305
|
+
* element-aware node is never re-resolved (zero second-pass cost).
|
|
2306
|
+
*
|
|
2307
|
+
* SSR-safe: with no bound target (or a target with no `parentElement`) the env
|
|
2308
|
+
* fields are OMITTED, so a residual node stays unresolved (never a throw on
|
|
2309
|
+
* `getComputedStyle(undefined)`) — the same posture Phase 1 holds for
|
|
2310
|
+
* `style(--p)` today.
|
|
2311
|
+
*
|
|
2312
|
+
* @returns `true` iff at least one template carried a Phase-2 node and the
|
|
2313
|
+
* compiler was re-`parse()`d (so `setTargets` skips its fast propagate).
|
|
2314
|
+
*/
|
|
2315
|
+
private _resolveElementAwareValues;
|
|
2316
|
+
/**
|
|
2317
|
+
* Q.WB1 — build the element-AWARE {@link ResolveEnv} from the bound target (the
|
|
2318
|
+
* precondition for the Phase-2 second pass). SSR-safe: with no target / no
|
|
2319
|
+
* `parentElement`, the relevant field is OMITTED (not assigned), so the residual
|
|
2320
|
+
* node stays unresolved rather than throwing. Built ONCE per `setTargets` — the
|
|
2321
|
+
* pass is a compile-time lowering, never on the hot path.
|
|
2322
|
+
*
|
|
2323
|
+
* @returns the populated env, or `undefined` when no target is bound at all
|
|
2324
|
+
* (the whole pass is skipped — nothing element-aware can resolve).
|
|
2325
|
+
*/
|
|
2326
|
+
private _buildElementAwareEnv;
|
|
2309
2327
|
group(...animations: KeyframesAnimation<V>[]): AnimationGroup<V>;
|
|
2310
2328
|
}
|
|
2311
|
-
export { KeyframesAnimation as Animation }
|
|
2312
|
-
export { KeyframesAnimation }
|
|
2313
2329
|
|
|
2314
2330
|
/**
|
|
2315
2331
|
* The JS scroll-progress sampler.
|
|
@@ -2320,24 +2336,19 @@ export { KeyframesAnimation }
|
|
|
2320
2336
|
* (the Houdini native scroll timeline): API Extractor renamed the colliding
|
|
2321
2337
|
* source class and re-exported it under a numeric-suffixed alias that leaked
|
|
2322
2338
|
* into IDE hover text. Naming the class `KeyframesScrollTimeline` (no ambient
|
|
2323
|
-
* collision) clears the rename; gated by `proof:pkg3-clean`. The
|
|
2324
|
-
* `ScrollTimeline`
|
|
2325
|
-
*
|
|
2326
|
-
* canonical name no longer collides, API Extractor emits the alias cleanly
|
|
2327
|
-
* (`KeyframesScrollTimeline` exported under the `ScrollTimeline` name, no
|
|
2328
|
-
* numeric suffix).
|
|
2339
|
+
* collision) clears the rename; gated by `proof:pkg3-clean`. The legacy
|
|
2340
|
+
* `ScrollTimeline` backward-compat RE-EXPORT alias was DROPPED in 5.0.0
|
|
2341
|
+
* (Q.WE1 — NO-LEGACY).
|
|
2329
2342
|
*/
|
|
2330
|
-
declare class KeyframesScrollTimeline extends Timeline {
|
|
2343
|
+
export declare class KeyframesScrollTimeline extends Timeline {
|
|
2331
2344
|
private threshold;
|
|
2332
2345
|
private getScrollY;
|
|
2333
2346
|
private getViewportHeight;
|
|
2334
2347
|
constructor(options?: KeyframesScrollTimelineOptions);
|
|
2335
2348
|
protected sample(): number;
|
|
2336
2349
|
}
|
|
2337
|
-
export { KeyframesScrollTimeline }
|
|
2338
|
-
export { KeyframesScrollTimeline as ScrollTimeline }
|
|
2339
2350
|
|
|
2340
|
-
declare interface KeyframesScrollTimelineOptions extends TimelineOptions {
|
|
2351
|
+
export declare interface KeyframesScrollTimelineOptions extends TimelineOptions {
|
|
2341
2352
|
/** Viewport fraction for full progress. Default 0.35. */
|
|
2342
2353
|
threshold?: number | undefined;
|
|
2343
2354
|
/** Custom scroll position supplier. Default: window.scrollY. */
|
|
@@ -2345,8 +2356,6 @@ declare interface KeyframesScrollTimelineOptions extends TimelineOptions {
|
|
|
2345
2356
|
/** Custom viewport height supplier. Default: window.innerHeight. */
|
|
2346
2357
|
getViewportHeight?: (() => number) | undefined;
|
|
2347
2358
|
}
|
|
2348
|
-
export { KeyframesScrollTimelineOptions }
|
|
2349
|
-
export { KeyframesScrollTimelineOptions as ScrollTimelineOptions }
|
|
2350
2359
|
|
|
2351
2360
|
/**
|
|
2352
2361
|
* Options for `AnimationGroup.transitionLayer` / `crossfade` (K.W11 PHYS-C).
|
|
@@ -2390,6 +2399,13 @@ export declare class ManualTimeline extends Timeline {
|
|
|
2390
2399
|
export declare interface MorphPoint {
|
|
2391
2400
|
x: number;
|
|
2392
2401
|
y: number;
|
|
2402
|
+
/**
|
|
2403
|
+
* The tangent angle (radians) of the source path at this point — populated
|
|
2404
|
+
* ONLY when the morph is built with `orient: true` (the
|
|
2405
|
+
* `PathGeometry.sampleAtLength` tangent, the `rotate: auto` value). Absent
|
|
2406
|
+
* (`undefined`) on a position-only morph (the default ~130-key floor).
|
|
2407
|
+
*/
|
|
2408
|
+
angle?: number;
|
|
2393
2409
|
}
|
|
2394
2410
|
|
|
2395
2411
|
export declare interface MorphRect {
|
|
@@ -2442,15 +2458,37 @@ export declare interface MorphSVGOptions extends Partial<InputAnimationOptions>
|
|
|
2442
2458
|
*/
|
|
2443
2459
|
samples?: number;
|
|
2444
2460
|
/**
|
|
2445
|
-
* Optional target the morph drives. When given, the morph
|
|
2446
|
-
* interpolated polyline `d`
|
|
2447
|
-
*
|
|
2448
|
-
*
|
|
2449
|
-
*
|
|
2450
|
-
*
|
|
2451
|
-
*
|
|
2461
|
+
* Optional target the morph drives. When given, the morph reassembles the
|
|
2462
|
+
* interpolated polyline into a `d` string EACH FRAME and writes it onto the
|
|
2463
|
+
* target's style as BOTH:
|
|
2464
|
+
* • the `d:` CSS property — `target.style.d = path("M … L …")` — which
|
|
2465
|
+
* Chromium and recent Safari render DIRECTLY on a `<path>`/`<svg>`
|
|
2466
|
+
* (no author wiring needed), and
|
|
2467
|
+
* • the `--morph-d` custom property — `var(--morph-d)` — the cross-browser
|
|
2468
|
+
* author channel + the Firefox-lags fallback (`<path style="d:
|
|
2469
|
+
* var(--morph-d)">`, or a JS reader via {@link MorphSVG.sampleD}).
|
|
2470
|
+
*
|
|
2471
|
+
* The render rides the engine's per-frame renderer seam (a custom
|
|
2472
|
+
* `transform` supplied to `fromKeyframes`), NOT the default DOM-style
|
|
2473
|
+
* renderer — so the morph is WAAPI-ineligible by construction and always
|
|
2474
|
+
* runs the rAF path where the renderer fires. The reassembly reuses an
|
|
2475
|
+
* instance-level scratch point-array, so the steady frame mints nothing.
|
|
2476
|
+
*
|
|
2477
|
+
* Default target-less: the returned handle IS the control surface, exactly
|
|
2478
|
+
* like `fromDrawSVG`'s target-less form — {@link MorphSVG.sampleD}(t) reads
|
|
2479
|
+
* the morphed `d` directly without a DOM write.
|
|
2452
2480
|
*/
|
|
2453
2481
|
target?: HTMLElement | SVGElement;
|
|
2482
|
+
/**
|
|
2483
|
+
* Orient-along-path: when `true`, the morph ALSO samples each point's
|
|
2484
|
+
* tangent angle (radians) from `PathGeometry.sampleAtLength` and emits a
|
|
2485
|
+
* per-point `--morph-{i}-angle` channel that interpolates the `from`→`to`
|
|
2486
|
+
* tangent across `t` — the `rotate: auto` value a consumer reads to bank a
|
|
2487
|
+
* glyph along the morphed outline. Default `false` (a position-only morph
|
|
2488
|
+
* stays at the ~130-key floor; orient adds ~65 angle keys ONLY when asked,
|
|
2489
|
+
* pre-empting a "morph is too heavy" perf concern).
|
|
2490
|
+
*/
|
|
2491
|
+
orient?: boolean;
|
|
2454
2492
|
/**
|
|
2455
2493
|
* Auto-start the play loop after construction + targeting. Default true.
|
|
2456
2494
|
* `false` returns a constructed, NOT-yet-playing handle so the caller can
|
|
@@ -2631,6 +2669,31 @@ export declare interface NumericAnimationOptions {
|
|
|
2631
2669
|
respectReducedMotion?: boolean | undefined;
|
|
2632
2670
|
}
|
|
2633
2671
|
|
|
2672
|
+
/**
|
|
2673
|
+
* Q.WB3 S2 — the precomputed SoA fold layout for ONE compiled frame's NUMERIC
|
|
2674
|
+
* interp subset (the single-animation `processFrame` analog of the compositor's
|
|
2675
|
+
* `SoALayerPlan`). Built ONCE at `parse` over the STABLE iv set (the F.W4
|
|
2676
|
+
* zero-alloc discipline — NO per-frame allocation):
|
|
2677
|
+
* - `numeric` — the numeric ivs (numeric start+stop, NOT computed, NOT color),
|
|
2678
|
+
* in slot order. Each iv's interp-carrier `value` is the `ValueUnit` slot the
|
|
2679
|
+
* strided write-back fills (the SAME slot `lerpValue` writes today).
|
|
2680
|
+
* - `from` / `to` — the packed endpoint `Float64Array`s (`start.value` /
|
|
2681
|
+
* `stop.value`), one slot per `numeric[s]`.
|
|
2682
|
+
* - `out` — the per-frame scratch the `lerpArray` fold writes into (reused
|
|
2683
|
+
* across every frame — zero per-frame alloc).
|
|
2684
|
+
* - `boxed` — the residual ivs (color / computed / mixed) the fold CANNOT cover
|
|
2685
|
+
* — walked by the existing per-element `lerpValue`, UNCHANGED.
|
|
2686
|
+
* The boxed-color tail is the GATED `ColorChannelPlan` consume's frontier (S4,
|
|
2687
|
+
* value.js 1.2.0) — NOT this NOW numeric arm.
|
|
2688
|
+
*/
|
|
2689
|
+
declare interface NumericFoldPlan<V extends Vars> {
|
|
2690
|
+
numeric: Array<InterpolatedVar<V>>;
|
|
2691
|
+
from: Float64Array;
|
|
2692
|
+
to: Float64Array;
|
|
2693
|
+
out: Float64Array;
|
|
2694
|
+
boxed: Array<InterpolatedVar<V>>;
|
|
2695
|
+
}
|
|
2696
|
+
|
|
2634
2697
|
/** Callback invoked each frame during `.play()` with the interpolated values. */
|
|
2635
2698
|
export declare type NumericFrameCallback<T extends Record<string, number>> = (values: T) => void;
|
|
2636
2699
|
|
package/dist/keyframes.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { n as e, t } from "./errors-W8zkvPw4.js";
|
|
2
|
-
import { _ as n, a as r, c as i, f as a, g as o, i as s, l as c, m as l, n as u, o as d, p as f, r as p, s as m, t as h, u as g } from "./timeline-
|
|
3
|
-
import { n as _, r as
|
|
4
|
-
import { n as
|
|
5
|
-
import { t as
|
|
2
|
+
import { _ as n, a as r, c as i, f as a, g as o, i as s, l as c, m as l, n as u, o as d, p as f, r as p, s as m, t as h, u as g } from "./timeline-vY3eD3Ax.js";
|
|
3
|
+
import { n as _, r as ee, t as v } from "./springTimingFunction-D26gPkAy.js";
|
|
4
|
+
import { n as y, t as b } from "./decay-BvNmFk51.js";
|
|
5
|
+
import { t as x } from "./sequence-cBr7thU8.js";
|
|
6
6
|
//#region src/animation/numeric.ts
|
|
7
|
-
var
|
|
7
|
+
var S = new Float64Array(), C = class {
|
|
8
8
|
keyframes;
|
|
9
9
|
segments;
|
|
10
10
|
positions;
|
|
@@ -45,12 +45,12 @@ var C = new Float64Array(), w = class {
|
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
47
|
at(e) {
|
|
48
|
-
let t = a(e, 0, 1) * 100, n =
|
|
48
|
+
let t = a(e, 0, 1) * 100, n = ee(this.segments, t, (e) => e.startPos, (e) => e.stopPos);
|
|
49
49
|
n === -1 && (n = this.segments.length - 1);
|
|
50
50
|
let r = this.segments[n], i = l(a(t, r.startPos, r.stopPos), r.startPos, r.stopPos, 0, 1), o = r.timingFunction(i), s = r.keys.length;
|
|
51
|
-
|
|
51
|
+
S.length < s && (S = new Float64Array(s)), f(r.from, r.to, o, S);
|
|
52
52
|
let c = this.result;
|
|
53
|
-
for (let e = 0; e < s; e++) c[r.keys[e]] =
|
|
53
|
+
for (let e = 0; e < s; e++) c[r.keys[e]] = S[e];
|
|
54
54
|
return this.result;
|
|
55
55
|
}
|
|
56
56
|
updateKeyframe(e, t) {
|
|
@@ -67,7 +67,7 @@ var C = new Float64Array(), w = class {
|
|
|
67
67
|
stop() {
|
|
68
68
|
this._playback.stop();
|
|
69
69
|
}
|
|
70
|
-
},
|
|
70
|
+
}, w = (e) => {
|
|
71
71
|
if (e instanceof HTMLElement) {
|
|
72
72
|
let t = e.getBoundingClientRect();
|
|
73
73
|
return {
|
|
@@ -78,7 +78,7 @@ var C = new Float64Array(), w = class {
|
|
|
78
78
|
};
|
|
79
79
|
}
|
|
80
80
|
return e;
|
|
81
|
-
},
|
|
81
|
+
}, T = class {
|
|
82
82
|
animation;
|
|
83
83
|
transformOrigin;
|
|
84
84
|
timingFunction;
|
|
@@ -87,8 +87,8 @@ var C = new Float64Array(), w = class {
|
|
|
87
87
|
this.transformOrigin = n?.transformOrigin ?? "top left", this.timingFunction = n?.timingFunction, this.duration = n?.duration ?? 0, this.measure(e, t);
|
|
88
88
|
}
|
|
89
89
|
measure(e, t) {
|
|
90
|
-
let n =
|
|
91
|
-
return this.animation = new
|
|
90
|
+
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;
|
|
91
|
+
return this.animation = new C([{
|
|
92
92
|
translateX: 0,
|
|
93
93
|
translateY: 0,
|
|
94
94
|
scaleX: 1,
|
|
@@ -122,17 +122,17 @@ var C = new Float64Array(), w = class {
|
|
|
122
122
|
stop() {
|
|
123
123
|
this.animation.stop();
|
|
124
124
|
}
|
|
125
|
-
},
|
|
126
|
-
function
|
|
125
|
+
}, E = 2 * Math.PI;
|
|
126
|
+
function D(e, t) {
|
|
127
127
|
let n = e - Math.floor(e);
|
|
128
128
|
switch (t) {
|
|
129
|
-
case "sine": return Math.sin(
|
|
129
|
+
case "sine": return Math.sin(E * n);
|
|
130
130
|
case "triangle": return n < .5 ? 4 * n - 1 : 3 - 4 * n;
|
|
131
131
|
case "square": return n < .5 ? 1 : -1;
|
|
132
132
|
case "sawtooth": return 2 * n - 1;
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
|
-
var
|
|
135
|
+
var O = class {
|
|
136
136
|
frequency;
|
|
137
137
|
waveform;
|
|
138
138
|
phase = 0;
|
|
@@ -144,15 +144,15 @@ var k = class {
|
|
|
144
144
|
return this.phase = t - Math.floor(t), this.phase;
|
|
145
145
|
}
|
|
146
146
|
get value() {
|
|
147
|
-
return
|
|
147
|
+
return D(this.phase, this.waveform);
|
|
148
148
|
}
|
|
149
149
|
sample(e) {
|
|
150
|
-
return
|
|
150
|
+
return D(e * this.frequency, this.waveform);
|
|
151
151
|
}
|
|
152
152
|
reset(e = 0) {
|
|
153
153
|
this.phase = e - Math.floor(e);
|
|
154
154
|
}
|
|
155
|
-
},
|
|
155
|
+
}, k = (e, t) => {
|
|
156
156
|
if (typeof e == "number") return a(e, 0, Math.max(0, t - 1));
|
|
157
157
|
switch (e) {
|
|
158
158
|
case "first": return 0;
|
|
@@ -160,10 +160,10 @@ var k = class {
|
|
|
160
160
|
case "center": return (t - 1) / 2;
|
|
161
161
|
case "edges": return -1;
|
|
162
162
|
}
|
|
163
|
-
},
|
|
163
|
+
}, A = (e, t, n) => n === "edges" ? Math.min(e, t - 1 - e) : Math.abs(e - k(n, t)), j = (e, t) => {
|
|
164
164
|
if (e <= 1) return 0;
|
|
165
165
|
if (t === "edges") return Math.floor((e - 1) / 2);
|
|
166
|
-
let n =
|
|
166
|
+
let n = k(t, e);
|
|
167
167
|
return Math.max(n, e - 1 - n);
|
|
168
168
|
};
|
|
169
169
|
function M(e, r = {}) {
|
|
@@ -173,7 +173,7 @@ function M(e, r = {}) {
|
|
|
173
173
|
if (t <= 1) return 0;
|
|
174
174
|
let n = j(t, a);
|
|
175
175
|
if (n === 0) return 0;
|
|
176
|
-
let r =
|
|
176
|
+
let r = A(e, t, a);
|
|
177
177
|
return s ? s(r / n) * i * n : r * i;
|
|
178
178
|
}, u = ((e, t = c) => l(e, t));
|
|
179
179
|
return u.delays = (e = c) => Array.from({ length: e }, (t, n) => l(n, e)), u;
|
|
@@ -196,13 +196,13 @@ var N = 300, P = (e) => {
|
|
|
196
196
|
}));
|
|
197
197
|
function L(e, t, n = {}) {
|
|
198
198
|
let { duration: r = N, timingFunction: i, transformOrigin: a = "top left" } = n, o = P(e);
|
|
199
|
-
return t(), I(e, new
|
|
199
|
+
return t(), I(e, new T(o, P(e), {
|
|
200
200
|
...i === void 0 ? {} : { timingFunction: i },
|
|
201
201
|
transformOrigin: a
|
|
202
202
|
}), r, a);
|
|
203
203
|
}
|
|
204
204
|
function R(e, t, n = {}) {
|
|
205
|
-
let { duration: r = N, timingFunction: i, transformOrigin: a = "top left" } = n, o = new
|
|
205
|
+
let { duration: r = N, timingFunction: i, transformOrigin: a = "top left" } = n, o = new T(P(e), P(t), {
|
|
206
206
|
...i === void 0 ? {} : { timingFunction: i },
|
|
207
207
|
duration: r,
|
|
208
208
|
transformOrigin: a
|
|
@@ -329,7 +329,7 @@ var B = 100, V = .4, H = 5, U = class {
|
|
|
329
329
|
this.pushSample(n, e.timeStamp);
|
|
330
330
|
let r = this.estimateVelocity();
|
|
331
331
|
if (t && this.endGesture(t), this.snap) {
|
|
332
|
-
let e =
|
|
332
|
+
let e = y({
|
|
333
333
|
initial: n,
|
|
334
334
|
velocity: r,
|
|
335
335
|
friction: H
|
|
@@ -375,10 +375,10 @@ function W(e, t) {
|
|
|
375
375
|
}
|
|
376
376
|
//#endregion
|
|
377
377
|
//#region src/animation/load-engine.ts
|
|
378
|
-
var G = null, K = null, q = null, J = null, Y = () => G ??= import("./engine-
|
|
378
|
+
var G = null, K = null, q = null, J = null, Y = () => G ??= import("./engine-DQcb7CLW.js"), X = null, Z = () => X ??= Y(), Q = null, te = () => Q ??= Promise.all([Y(), K ??= import("./compile-YRJRdpKF.js")]).then(([e, t]) => Object.assign({ compileToCSS: t.compileToCSS }, e)), ne = null, re = () => ne ??= Promise.all([
|
|
379
379
|
Y(),
|
|
380
|
-
q ??= import("./ingest-
|
|
381
|
-
J ??= import("./scroll-scene-
|
|
380
|
+
q ??= import("./ingest-CU-kdYcM.js"),
|
|
381
|
+
J ??= import("./scroll-scene-DQxhxn9I.js")
|
|
382
382
|
]).then(([e, t, n]) => Object.assign({
|
|
383
383
|
fromStyleSheets: t.fromStyleSheets,
|
|
384
384
|
fromLiveAnimations: t.fromLiveAnimations,
|
|
@@ -396,17 +396,17 @@ var G = null, K = null, q = null, J = null, Y = () => G ??= import("./engine-CNH
|
|
|
396
396
|
pinCSS: n.pinCSS
|
|
397
397
|
}, e)), ie = null, $ = () => ie ??= Promise.all([
|
|
398
398
|
Y(),
|
|
399
|
-
import("./animate-
|
|
400
|
-
import("./motion-path-
|
|
401
|
-
import("./draw-svg-
|
|
402
|
-
import("./morph-svg-
|
|
403
|
-
q ??= import("./ingest-
|
|
404
|
-
J ??= import("./scroll-scene-
|
|
405
|
-
K ??= import("./compile-
|
|
406
|
-
import("./validate-
|
|
407
|
-
import("./animations-
|
|
399
|
+
import("./animate-CTWr6K7j.js"),
|
|
400
|
+
import("./motion-path-C0OHqcA3.js"),
|
|
401
|
+
import("./draw-svg-Dat9mHgi.js"),
|
|
402
|
+
import("./morph-svg-83uyYxoW.js"),
|
|
403
|
+
q ??= import("./ingest-CU-kdYcM.js"),
|
|
404
|
+
J ??= import("./scroll-scene-DQxhxn9I.js"),
|
|
405
|
+
K ??= import("./compile-YRJRdpKF.js"),
|
|
406
|
+
import("./validate-B1pE-Y_T.js"),
|
|
407
|
+
import("./animations-CZxf0rep.js"),
|
|
408
408
|
import("./format-BUgCTjmr.js").then((e) => e.r),
|
|
409
|
-
import("./utils-
|
|
409
|
+
import("./utils-BPRImVl5.js").then((e) => e.o),
|
|
410
410
|
import("./scheduler-7eIr_q1g.js").then((e) => e.t)
|
|
411
411
|
]).then(([e, t, n, r, i, a, o, s, c, l, u, d, f]) => Object.assign({
|
|
412
412
|
animate: t.animate,
|
|
@@ -443,4 +443,4 @@ var G = null, K = null, q = null, J = null, Y = () => G ??= import("./engine-CNH
|
|
|
443
443
|
$();
|
|
444
444
|
};
|
|
445
445
|
//#endregion
|
|
446
|
-
export { t as AnimationOptionError, U as Draggable,
|
|
446
|
+
export { t as AnimationOptionError, U as Draggable, T as ElementMorph, h as KeyframesScrollTimeline, u as ManualTimeline, C as NumericAnimation, O as Oscillator, c as RAFPlayback, x as Sequence, i as SmoothProgress, r as SpringProgress, p as Timeline, e as UnknownEasingError, s as createNativeTimeline, b as decay, y as decayRest, W as drag, z as drag2D, L as flip, R as flipShared, $ as loadAnimationEngine, te as loadCompiler, Z as loadEngine, re as loadIngest, d as probeVelocity, g as reducedMotionScale, m as reseatToSpring, o as resolveEasing, _ as springLinearStops, v as springTimingFunction, M as stagger, n as toEasing, ae as warmEngine, D as waveformValue };
|