@mkbabb/keyframes.js 5.1.0 → 5.2.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 +83 -3
- package/dist/backward-color-BtbRcnna.js +108 -0
- package/dist/compile-BHCTPerD.js +30 -0
- package/dist/{delegation-DWwr4IXr.js → delegation-BQYCrP2p.js} +5 -9
- package/dist/{draw-svg-GURj9nin.js → draw-svg-CK9Qrly8.js} +13 -25
- package/dist/easing-serialize-D4LZCB6i.js +21 -0
- package/dist/engine/index.d.ts +422 -156
- package/dist/engine/index.js +16 -17
- package/dist/engine-CPK_udUQ.js +1172 -0
- package/dist/engine-DlpimZtM.js +3 -0
- package/dist/entry-D82NKUhP.js +148 -0
- package/dist/format-BdIvdLzG.js +114 -0
- package/dist/{group-vJcsHKN9.js → group-HM7N4uOE.js} +153 -123
- package/dist/handle-D4xrf_ya.js +21 -0
- package/dist/{ingest-S5hUe20K.js → ingest-_g6tfk2e.js} +2 -2
- package/dist/keyframes.d.ts +702 -178
- package/dist/keyframes.js +295 -74
- package/dist/morph-svg-KUrH9KnK.js +79 -0
- package/dist/motion-path-wM5tPfrY.js +26 -0
- package/dist/presets-DeDJYL4G.js +275 -0
- package/dist/{scheduler-CUtVnuoU.js → scheduler-CfGIC3GX.js} +1 -1
- package/dist/{scroll-CxpYFO4u.js → scroll-BEyCx0b_.js} +165 -58
- package/dist/{sequence-C_DCiOIQ.js → sequence-s0bL7Uul.js} +118 -90
- package/dist/{validate-DDeGnvSt.js → validate-xFZ_Ld1k.js} +7 -7
- package/dist/view-transition-BPJQxUTC.js +305 -0
- package/package.json +113 -83
- package/dist/animation-BGyzfzBq.js +0 -947
- package/dist/compile-CcSUwM8R.js +0 -276
- package/dist/engine-DEVgCTUy.js +0 -156
- package/dist/engine-DrBtsKaf.js +0 -4
- package/dist/format-C-Gi9r7L.js +0 -123
- package/dist/grammar-BLucehC4.js +0 -23
- package/dist/morph-svg-BToeumw5.js +0 -89
- package/dist/motion-path-pQVbamWT.js +0 -35
- package/dist/presets-BG2Fczzq.js +0 -275
package/dist/engine/index.d.ts
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import { AnimationRangeValue } from '@mkbabb/value.js';
|
|
2
2
|
import { AnimationTimelineValue } from '@mkbabb/value.js';
|
|
3
|
-
import {
|
|
3
|
+
import type { AnimationTriggerValue } from '@mkbabb/value.js';
|
|
4
|
+
import type { ColorSpace } from '@mkbabb/value.js';
|
|
4
5
|
import { CSSTimelineOptions } from '@mkbabb/value.js';
|
|
5
6
|
import { CustomFunctionDescriptor } from '@mkbabb/value.js';
|
|
6
7
|
import { extractAnimationOptions } from '@mkbabb/value.js';
|
|
7
|
-
import { HueInterpolationMethod } from '@mkbabb/value.js';
|
|
8
|
-
import { InterpolatedVar } from '@mkbabb/value.js';
|
|
8
|
+
import type { HueInterpolationMethod } from '@mkbabb/value.js';
|
|
9
|
+
import type { InterpolatedVar } from '@mkbabb/value.js';
|
|
9
10
|
import { ParseDiagnostic } from '@mkbabb/value.js';
|
|
10
11
|
import { PropertyDescriptor as PropertyDescriptor_2 } from '@mkbabb/value.js';
|
|
11
12
|
import { RangeBoundary } from '@mkbabb/value.js';
|
|
12
13
|
import { RangePhase } from '@mkbabb/value.js';
|
|
13
14
|
import { Stylesheet } from '@mkbabb/value.js';
|
|
14
|
-
import { timingFunctions } from '@mkbabb/value.js';
|
|
15
|
+
import type { timingFunctions } from '@mkbabb/value.js';
|
|
16
|
+
import type { TriggerType } from '@mkbabb/value.js';
|
|
15
17
|
import { ValueArray } from '@mkbabb/value.js';
|
|
16
18
|
import { ValueUnit } from '@mkbabb/value.js';
|
|
17
19
|
|
|
@@ -24,7 +26,7 @@ declare const accordionExpand: (options?: InputAnimationOptions) => CSSKeyframes
|
|
|
24
26
|
* carries any honest refusal (no running animation by that name → a row, never
|
|
25
27
|
* a silent no-op).
|
|
26
28
|
*/
|
|
27
|
-
export declare interface AdoptResult<V extends Vars =
|
|
29
|
+
export declare interface AdoptResult<V extends Vars = Vars> {
|
|
28
30
|
/** The kf animation now driving the element (null on a refused adopt). */
|
|
29
31
|
animation: CSSKeyframesAnimation<V> | null;
|
|
30
32
|
/** The captured native `currentTime` (ms) the kf playhead seeded from. */
|
|
@@ -60,7 +62,7 @@ export declare interface AdoptResult<V extends Vars = any> {
|
|
|
60
62
|
* // the kf object now drives `el` from the exact playhead — no visible seam.
|
|
61
63
|
* animation?.pause(); // ...now scrub / spring-ify / re-color it.
|
|
62
64
|
*/
|
|
63
|
-
export declare const adoptRunning: <V extends Vars =
|
|
65
|
+
export declare const adoptRunning: <V extends Vars = Vars>(el: Element, options: AdoptRunningOptions) => Promise<AdoptResult<V>>;
|
|
64
66
|
|
|
65
67
|
/** Options for {@link adoptRunning}. */
|
|
66
68
|
export declare interface AdoptRunningOptions extends IngestOptions {
|
|
@@ -112,6 +114,18 @@ declare interface AnimationFrame<V extends Vars> {
|
|
|
112
114
|
* falls back to the all-boxed walk. Bit-identical to the boxed path.
|
|
113
115
|
*/
|
|
114
116
|
_numericPlan?: NumericFoldPlan<V>;
|
|
117
|
+
/**
|
|
118
|
+
* T.A6 — the nested PLAIN authored-shape projection a custom `transform`
|
|
119
|
+
* consumes (numbers where the author wrote numbers, strings where a unit or
|
|
120
|
+
* color demands one). Built lazily on the first apply — `undefined` for a
|
|
121
|
+
* DOM-style default-renderer frame (which consumes `flatVars` directly) and
|
|
122
|
+
* before the first `interpFrames(..., true)`. Invalidated at
|
|
123
|
+
* `finalizeFrameVars` so a color-space renormalize rebuilds it against the
|
|
124
|
+
* fresh interp carriers.
|
|
125
|
+
*/
|
|
126
|
+
plainVars?: V;
|
|
127
|
+
/** T.A6 — the per-leaf refresh-writer plan backing {@link plainVars}. */
|
|
128
|
+
_plainProj?: PlainProjection | undefined;
|
|
115
129
|
transform: TransformFunction<V>;
|
|
116
130
|
timingFunction: Easing;
|
|
117
131
|
/**
|
|
@@ -145,14 +159,29 @@ export declare class AnimationGroup<V extends Vars> {
|
|
|
145
159
|
/** Children-per-slice before `advanceTo()` yields to the main thread; larger
|
|
146
160
|
* groups batch with a `scheduler.yield()` between slices (INP relief). */
|
|
147
161
|
static readonly YIELD_BATCH = 32;
|
|
162
|
+
/** Construct a group from a first animation + rest (S.B4 / a06 F1/F2 — the
|
|
163
|
+
* genuine-ownership replacement for the excised `KeyframesAnimation.group()`
|
|
164
|
+
* service locator; each input is a bare animation or `{ animation, layer }`). */
|
|
165
|
+
static of<V extends Vars>(first: KeyframesAnimation<V> | AnimationGroupInput<V>, ...rest: (KeyframesAnimation<V> | AnimationGroupInput<V>)[]): AnimationGroup<V>;
|
|
148
166
|
singleTarget: boolean;
|
|
167
|
+
/**
|
|
168
|
+
* T.A6 — true when the group's composite `transform` is a CUSTOM (non-DOM)
|
|
169
|
+
* consumer that expects the nested PLAIN authored-shape projection (the
|
|
170
|
+
* "animate any object" seam), inherited from the first child's own
|
|
171
|
+
* `unflatten` flag alongside its transform. False (the default) keeps the
|
|
172
|
+
* DOM-style default renderer's FLAT `_grouped` map, byte-unchanged.
|
|
173
|
+
*/
|
|
174
|
+
unflatten: boolean;
|
|
149
175
|
lastTickTime: number;
|
|
150
176
|
/** THE rAF owner for the group's draw loop. */
|
|
151
177
|
readonly playback: RAFPlayback;
|
|
152
178
|
resolvePromise: ((value: void | PromiseLike<void>) => void) | null;
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
179
|
+
/** The ONE held play promise the `finished` front-door exposes. INTERNAL
|
|
180
|
+
* (S.B5) — read/written by the transport free functions in `./lifecycle`. */
|
|
181
|
+
_playingPromise: Promise<void> | null;
|
|
182
|
+
/** Pre-bound frame callback — allocated once to avoid a per-loop closure.
|
|
183
|
+
* INTERNAL (S.B5) — read by `./lifecycle`'s `play`/`resume` loop start. */
|
|
184
|
+
_boundFrame: (t: number) => boolean | Promise<boolean>;
|
|
156
185
|
/** Cached entries sorted by layer zIndex (see `getEntries`). */
|
|
157
186
|
private _entries;
|
|
158
187
|
private _entriesDirty;
|
|
@@ -170,6 +199,13 @@ export declare class AnimationGroup<V extends Vars> {
|
|
|
170
199
|
* `buildSoAPlans` in `./soa`, rebuilt ONLY on a structural change). INTERNAL
|
|
171
200
|
* (R.W2) — read/written by `./compositor`. */
|
|
172
201
|
_soaPlans: SoALayerPlan[] | null;
|
|
202
|
+
/**
|
|
203
|
+
* T.A6 — the group's PLAIN authored-shape projection (built from the
|
|
204
|
+
* composite `_grouped` leaf map when `unflatten` is set), rebuilt lazily on a
|
|
205
|
+
* structural change (the SAME `_groupedKeysDirty` seam that drops the SoA
|
|
206
|
+
* plan). Null until the first composited frame populates `_grouped`. INTERNAL
|
|
207
|
+
* — read/written by `./compositor`. */
|
|
208
|
+
_plainProj: PlainProjection | null;
|
|
173
209
|
/** The long-lived SoA fold scratch — the contiguous numeric accumulate buffer,
|
|
174
210
|
* sized to the WIDEST single-layer pair count once per structural change
|
|
175
211
|
* (reused, zero per-frame alloc). INTERNAL (R.W2) — read by `./compositor`. */
|
|
@@ -212,35 +248,31 @@ export declare class AnimationGroup<V extends Vars> {
|
|
|
212
248
|
private _frame;
|
|
213
249
|
/** The post-advance render half of `_frame` — composite, or settle on done. */
|
|
214
250
|
private _renderFrame;
|
|
215
|
-
private _resolvePlay;
|
|
216
251
|
/** The completion front-door (G.W13) — `await group.finished` resolves once
|
|
217
252
|
* the in-flight composite play settles. Exposes the ONE held `_playingPromise`
|
|
218
253
|
* (a settled/never-played group resolves immediately). */
|
|
219
254
|
get finished(): Promise<void>;
|
|
220
255
|
/** Start the group. Resolves when all children complete (or on stop/reset).
|
|
221
|
-
* Re-entrant
|
|
222
|
-
* `respectReducedMotion` + an active query, snaps to final (no rAF loop). */
|
|
256
|
+
* Re-entrant, and PRM-aware — body in `./lifecycle` (S.B5 / a19 F1). */
|
|
223
257
|
play(): Promise<void>;
|
|
224
|
-
/**
|
|
225
|
-
*
|
|
226
|
-
|
|
227
|
-
/** Pause the group — idempotent. Pausing an already-paused (or not-yet-started)
|
|
228
|
-
* group is a no-op, NOT a resume. Cancels the rAF loop + renders a final-frame
|
|
229
|
-
* snapshot so the visual matches the pause moment. */
|
|
258
|
+
/** Pause the group — idempotent. Cancels the rAF loop + renders a final-frame
|
|
259
|
+
* snapshot so the visual matches the pause moment; records each child's
|
|
260
|
+
* jump-free `pausedTime`. Body in `./lifecycle` (S.B5). */
|
|
230
261
|
pause(): this;
|
|
231
|
-
/** Resume the group — idempotent. Unpauses every child DIRECTLY (
|
|
232
|
-
*
|
|
262
|
+
/** Resume the group — idempotent. Unpauses every child DIRECTLY (the group's
|
|
263
|
+
* draw loop owns the ticking). Body in `./lifecycle` (S.B5). */
|
|
233
264
|
resume(): this;
|
|
234
265
|
/** The explicit flip: pauses if playing, resumes if paused. */
|
|
235
266
|
toggle(): this;
|
|
236
267
|
/** Pure state teardown — never paints. Releases every child (`managed = false`,
|
|
237
|
-
* `child.settle()`) and clears the group flags
|
|
268
|
+
* `child.settle()`) and clears the group flags. Body in `./lifecycle` (S.B5). */
|
|
238
269
|
settle(): this;
|
|
239
270
|
/** Explicit rewind: paint every started child back to its INITIAL frame, then
|
|
240
|
-
* settle — the user-facing "return to start"
|
|
271
|
+
* settle — the user-facing "return to start". Body in `./lifecycle` (S.B5). */
|
|
241
272
|
reset(): this;
|
|
242
273
|
/** Halt the draw loop, rewind to the initial frame (the transport-stop
|
|
243
|
-
* semantic the demo's controls expect), and resolve any pending `play()`.
|
|
274
|
+
* semantic the demo's controls expect), and resolve any pending `play()`.
|
|
275
|
+
* Body in `./lifecycle` (S.B5). */
|
|
244
276
|
stop(): this;
|
|
245
277
|
playing(): boolean;
|
|
246
278
|
/** Set layer config for an animation by name or reference. Chainable. */
|
|
@@ -419,8 +451,26 @@ declare interface CompiledCSS {
|
|
|
419
451
|
refusals: CompileRefusal[];
|
|
420
452
|
}
|
|
421
453
|
|
|
454
|
+
/** The entry compile result — the artifact + the refusal report. */
|
|
455
|
+
export declare interface CompiledEntryCSS {
|
|
456
|
+
/** The zero-runtime CSS: base rule + open rule + `@starting-style` per selector. */
|
|
457
|
+
css: string;
|
|
458
|
+
/** True iff EVERY selector compiled faithfully. */
|
|
459
|
+
eligible: boolean;
|
|
460
|
+
/** One refusal per selector that could not compile as a two-endpoint transition. */
|
|
461
|
+
refusals: EntryRefusal[];
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
/** The VT compile result — the artifact + the widened refusal report + the names. */
|
|
465
|
+
export declare interface CompiledViewTransitionCSS extends Omit<CompiledCSS, "refusals"> {
|
|
466
|
+
/** One refusal per role that could not compile faithfully (CC-3 ∪ the VT four). */
|
|
467
|
+
refusals: VTCompileRefusal[];
|
|
468
|
+
/** The `view-transition-name` set the consumer assigns to its elements. */
|
|
469
|
+
names: string[];
|
|
470
|
+
}
|
|
471
|
+
|
|
422
472
|
/** The input shapes `compileToCSS` accepts. */
|
|
423
|
-
declare type CompileInput<V extends Vars =
|
|
473
|
+
declare type CompileInput<V extends Vars = Vars> = AnimationGroup<V> | Sequence<V> | ReadonlyArray<KeyframesAnimation<V> | {
|
|
424
474
|
animation: KeyframesAnimation<V>;
|
|
425
475
|
}>;
|
|
426
476
|
|
|
@@ -484,6 +534,33 @@ declare type CompileRefusalReason = "weighted-blend" | "custom-renderer" | "perc
|
|
|
484
534
|
*/
|
|
485
535
|
export declare function compileToCSS<V extends Vars>(input: CompileInput<V>, opts?: CompileOptions): Promise<CompiledCSS>;
|
|
486
536
|
|
|
537
|
+
/**
|
|
538
|
+
* THE ENTRY/EXIT EMITTER (C-22 revised, P2-2) — compile a selector-keyed
|
|
539
|
+
* entry/exit spec to zero-runtime `@starting-style` + `allow-discrete` CSS. Emits
|
|
540
|
+
* per selector: the base/closed rule (exit endpoint + `display:none` + the exit
|
|
541
|
+
* transition list), the open rule (enter endpoint + `display` + the entry list),
|
|
542
|
+
* and the `@starting-style` block (enter's FIRST frame). Asymmetric entry/exit
|
|
543
|
+
* timing rides the two lists; `linear()` springs ride verbatim; color endpoints
|
|
544
|
+
* canonicalize to `oklab()`. REFUSES with a NAMED reason (3 inherited + 6
|
|
545
|
+
* entry-specific) what cannot compile as a two-endpoint transition.
|
|
546
|
+
*
|
|
547
|
+
* @returns `{ css, eligible, refusals }`.
|
|
548
|
+
*/
|
|
549
|
+
export declare function compileToEntry<V extends Vars>(spec: Record<string, EntryRoleSpec<V>>, opts?: EntryCompileOptions): Promise<CompiledEntryCSS>;
|
|
550
|
+
|
|
551
|
+
/**
|
|
552
|
+
* THE VIEW-TRANSITIONS EMITTER (SF-1/SF-2/SF-3) — compile a name-keyed role spec
|
|
553
|
+
* to a zero-runtime `::view-transition-*` CSS artifact. Emits per name: the
|
|
554
|
+
* old/new `@keyframes` + shorthand, the MANDATORY timing-only group override, an
|
|
555
|
+
* optional class-cohort rule, wrapped in `:active-view-transition-type(...)` when
|
|
556
|
+
* `types` are given; prepends the cross-doc preamble under `crossDocument`; and
|
|
557
|
+
* appends the PRM `animation: none` degrade by default. REFUSES with a NAMED
|
|
558
|
+
* reason (the CC-3 four ∪ the VT four) what cannot round-trip faithfully.
|
|
559
|
+
*
|
|
560
|
+
* @returns `{ css, eligible, refusals, names }` — the artifact + the trust surface.
|
|
561
|
+
*/
|
|
562
|
+
export declare function compileToViewTransition<V extends Vars>(spec: Record<string, VTRoleSpec<V>>, opts?: ViewTransitionCompileOptions): Promise<CompiledViewTransitionCSS>;
|
|
563
|
+
|
|
487
564
|
/**
|
|
488
565
|
* The CSS `animation-composition` operator (K.W7). Distinct from
|
|
489
566
|
* {@link BlendMode} (the GROUP's per-LAYER blend tier — `replace`/`add`/
|
|
@@ -511,6 +588,20 @@ declare type CompositeOperator = "replace" | "add" | "accumulate";
|
|
|
511
588
|
*/
|
|
512
589
|
export declare function createScrollScene(spec?: ScrollSceneOptions | CSSTimelineOptions): ScrollScene;
|
|
513
590
|
|
|
591
|
+
/**
|
|
592
|
+
* Construct a `TriggerScene` from a parsed `AnimationTriggerValue` OR a full
|
|
593
|
+
* `CSSTimelineOptions` (the {@link parseScrollCSS} output — the `.trigger` field
|
|
594
|
+
* is used). The CSS-fed construction is the round-trip's driving half (parse →
|
|
595
|
+
* behavior); the value-fed construction is value.js-INDEPENDENT.
|
|
596
|
+
*
|
|
597
|
+
* @example
|
|
598
|
+
* // grammar → behavior (the round-trip):
|
|
599
|
+
* const opts = parseScrollCSS(stylesheet); // { …, trigger: { type: "repeat", range } }
|
|
600
|
+
* const scene = createTriggerScene(opts);
|
|
601
|
+
* scene.triggerProgress(0.5); // → "active"
|
|
602
|
+
*/
|
|
603
|
+
export declare function createTriggerScene(spec?: AnimationTriggerValue | CSSTimelineOptions): TriggerScene;
|
|
604
|
+
|
|
514
605
|
export declare class CSSKeyframesAnimation<V extends Vars> extends KeyframesAnimation<V> {
|
|
515
606
|
/**
|
|
516
607
|
* Q.WD1-bind S2 (DM-22) — the timeline a scroll-range named selector resolves
|
|
@@ -569,7 +660,6 @@ export declare class CSSKeyframesAnimation<V extends Vars> extends KeyframesAnim
|
|
|
569
660
|
*/
|
|
570
661
|
scrollOptions?: CSSTimelineOptions;
|
|
571
662
|
fromString(keyframes: string, transform?: TransformFunction<V>): this;
|
|
572
|
-
transform(vars: V): void;
|
|
573
663
|
}
|
|
574
664
|
|
|
575
665
|
export declare function CSSKeyframesToString<V extends Vars>(animation: KeyframesAnimation<V>, name?: string, printWidth?: number | undefined): Promise<string>;
|
|
@@ -652,18 +742,8 @@ export declare function dispatchScrollBackend<V extends Vars>(request: ScrollDis
|
|
|
652
742
|
* is the factory: `new DrawSVG(target).animation` is the control handle. The
|
|
653
743
|
* factory is the canonical entry; this is a thin ergonomic wrapper.
|
|
654
744
|
*/
|
|
655
|
-
export declare class DrawSVG<V extends
|
|
656
|
-
/** The underlying stroke-dashoffset animation — the control handle. */
|
|
657
|
-
readonly animation: CSSKeyframesAnimation<V>;
|
|
745
|
+
export declare class DrawSVG<V extends Vars = Vars> extends SVGAnimationHandle<V> {
|
|
658
746
|
constructor(target: SVGDrawTarget, options?: DrawSVGOptions);
|
|
659
|
-
/** Start (or re-enter) the line-drawing play loop. */
|
|
660
|
-
play(): Promise<void>;
|
|
661
|
-
/** Pause the play loop, retaining the playhead. */
|
|
662
|
-
pause(): this;
|
|
663
|
-
/** Halt and rewind the play loop. */
|
|
664
|
-
stop(): this;
|
|
665
|
-
/** Resolve once the draw completes — the {@link Animation.finished} front-door. */
|
|
666
|
-
get finished(): Promise<void>;
|
|
667
747
|
}
|
|
668
748
|
|
|
669
749
|
export declare interface DrawSVGOptions extends Partial<InputAnimationOptions> {
|
|
@@ -715,6 +795,41 @@ declare const enterPresets: {
|
|
|
715
795
|
readonly jumpUp: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
716
796
|
};
|
|
717
797
|
|
|
798
|
+
/** Options for {@link compileToEntry}. */
|
|
799
|
+
export declare interface EntryCompileOptions {
|
|
800
|
+
/** The open-state selector suffix, concatenated onto the base selector. Default `".open"`. */
|
|
801
|
+
openSelector?: ".open" | "[data-open]" | ":popover-open" | "[open]" | (string & {});
|
|
802
|
+
/** The open `display` value (the base rule is always `display: none`). Default `"block"`. */
|
|
803
|
+
display?: string;
|
|
804
|
+
/**
|
|
805
|
+
* Emit `overlay <dur> allow-discrete` on both lists (default `true`). Emitted
|
|
806
|
+
* UNCONDITIONALLY — it materializes only for top-layer elements (popover/
|
|
807
|
+
* dialog), inert-but-harmless elsewhere, so a caller rarely turns it off.
|
|
808
|
+
*/
|
|
809
|
+
overlay?: boolean;
|
|
810
|
+
/** Prettier print-width for the emitted artifact. Omit for the default. */
|
|
811
|
+
printWidth?: number;
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
/** A single entry refusal — the selector + a typed reason + a human message. */
|
|
815
|
+
export declare interface EntryRefusal {
|
|
816
|
+
/** The refused selector (spec key). */
|
|
817
|
+
name: string;
|
|
818
|
+
reason: EntryRefusalReason;
|
|
819
|
+
message: string;
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
/** The refusal taxonomy — 3 inherited + 6 entry-specific (P2-2.3). */
|
|
823
|
+
export declare type EntryRefusalReason = "custom-renderer" | "weighted-blend" | "computed-unit-drift" | "entry-multi-keyframe" | "entry-iteration" | "entry-composition" | "entry-scroll-grammar" | "entry-color-space" | "entry-easing-twin";
|
|
824
|
+
|
|
825
|
+
/** The per-selector entry/exit role. Each animation is 2-stop (a transition endpoint pair). */
|
|
826
|
+
export declare interface EntryRoleSpec<V extends Vars = Vars> {
|
|
827
|
+
/** The ENTER animation: first frame → `@starting-style`, last frame → the open rule. */
|
|
828
|
+
enter?: KeyframesAnimation<V>;
|
|
829
|
+
/** The EXIT animation: last frame → the closed rule. Defaults to `enter` REVERSED. */
|
|
830
|
+
exit?: KeyframesAnimation<V>;
|
|
831
|
+
}
|
|
832
|
+
|
|
718
833
|
/** Exit animations — take an element OUT of view. */
|
|
719
834
|
declare const exitPresets: {
|
|
720
835
|
readonly fadeOut: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
@@ -754,25 +869,11 @@ declare const fadeOut: (options?: InputAnimationOptions) => CSSKeyframesAnimatio
|
|
|
754
869
|
|
|
755
870
|
export declare const FILL_MODES: readonly ["none", "forwards", "backwards", "both"];
|
|
756
871
|
|
|
757
|
-
/**
|
|
758
|
-
* The card-flip attention preset.
|
|
759
|
-
*
|
|
760
|
-
* ── PKG-3 RENAME (L.W8 §S4 · audit W126). Formerly the preset `flip`. Renamed
|
|
761
|
-
* `flip` → `flipPreset` because the rolled-up `dist/keyframes.d.ts` placed this
|
|
762
|
-
* preset (reachable as `presets.flip`) and the LIGHT top-level `flip` export
|
|
763
|
-
* (the FLIP-layout helper in `flip.ts`) under the same name `flip`, so API
|
|
764
|
-
* Extractor renamed this one with a numeric suffix and re-exported it under the
|
|
765
|
-
* `flip` name inside the `AnimationPresets` namespace — a numeric-suffixed alias
|
|
766
|
-
* `proof:pkg3-clean` greps for. Naming the preset `flipPreset` (distinct from the
|
|
767
|
-
* light `flip`) clears the collision. BREAKING (5.0.0): the access path is now
|
|
768
|
-
* `presets.flipPreset`; the nested taxonomy key `attentionPresets.flip` is
|
|
769
|
-
* unchanged (a property name, not a top-level declaration — no collision).
|
|
770
|
-
*/
|
|
771
872
|
declare const flipPreset: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
772
873
|
|
|
773
874
|
export declare function formatCSSKeyframeString(keyframe: string): string;
|
|
774
875
|
|
|
775
|
-
declare class FrameCompiler<V extends Vars =
|
|
876
|
+
declare class FrameCompiler<V extends Vars = Vars> {
|
|
776
877
|
private readonly _options;
|
|
777
878
|
templateFrames: TemplateAnimationFrame<V>[];
|
|
778
879
|
parsedVars: ParsedVarMap[];
|
|
@@ -858,7 +959,7 @@ declare class FrameCompiler<V extends Vars = any> {
|
|
|
858
959
|
* ONCE, set `stroke-dasharray` to that length (one solid full-length dash), and
|
|
859
960
|
* sweep `stroke-dashoffset` from → to (default `0% → 100%` ⇒ offset `L → 0`,
|
|
860
961
|
* the line draws in). Returns the constructed {@link CSSKeyframesAnimation} as
|
|
861
|
-
* the control handle (the
|
|
962
|
+
* the control handle (the control-handle contract — `.play()` / `.pause()` /
|
|
862
963
|
* `.stop()` / `.finished`), consistent with the `from*` factory family.
|
|
863
964
|
*
|
|
864
965
|
* The returned animation passes the EXISTING WAAPI eligibility gate
|
|
@@ -877,7 +978,7 @@ declare class FrameCompiler<V extends Vars = any> {
|
|
|
877
978
|
* // Draw a path stroke in over 2s:
|
|
878
979
|
* fromDrawSVG(pathEl, { duration: 2000 });
|
|
879
980
|
*/
|
|
880
|
-
export declare function fromDrawSVG<V extends
|
|
981
|
+
export declare function fromDrawSVG<V extends Vars = Vars>(target: SVGDrawTarget, options?: DrawSVGOptions): CSSKeyframesAnimation<V>;
|
|
881
982
|
|
|
882
983
|
/**
|
|
883
984
|
* K1 — `fromLiveAnimations`: adopt every RUNNING CSS animation on the document
|
|
@@ -892,14 +993,14 @@ export declare function fromDrawSVG<V extends Record<string, any> = any>(target:
|
|
|
892
993
|
* rule, running or not): `fromLiveAnimations` narrows to the names currently
|
|
893
994
|
* RUNNING on the page — the animations a user actually sees in motion.
|
|
894
995
|
*/
|
|
895
|
-
export declare const fromLiveAnimations: <V extends Vars =
|
|
996
|
+
export declare const fromLiveAnimations: <V extends Vars = Vars>(target?: Document | Element, options?: IngestOptions) => IngestResult<V>;
|
|
896
997
|
|
|
897
998
|
/**
|
|
898
999
|
* Build an SVG path-shape morph: sample two `d` strings at `samples` uniform
|
|
899
1000
|
* arc-length steps each, pair the point sets, and interpolate the `(x, y)`
|
|
900
1001
|
* pairs from the `from`-polyline (`0%`) to the `to`-polyline (`100%`). Returns
|
|
901
1002
|
* the constructed {@link CSSKeyframesAnimation} as the control handle (the
|
|
902
|
-
*
|
|
1003
|
+
* control-handle contract — `.play()` / `.pause()` / `.stop()` / `.finished`),
|
|
903
1004
|
* consistent with the `from*` factory family.
|
|
904
1005
|
*
|
|
905
1006
|
* value.js's `PathGeometry` owns the geometry (the `d`-parse + arc-length
|
|
@@ -929,13 +1030,13 @@ export declare const fromLiveAnimations: <V extends Vars = any>(target?: Documen
|
|
|
929
1030
|
* // morphing shape paints directly (no author-side reader needed on Chromium/
|
|
930
1031
|
* // Safari; `<path style="d: var(--morph-d)">` is the Firefox-lags fallback).
|
|
931
1032
|
*/
|
|
932
|
-
export declare function fromMorphSVG<V extends
|
|
1033
|
+
export declare function fromMorphSVG<V extends Vars = Vars>(from: string, to: string, options?: MorphSVGOptions): CSSKeyframesAnimation<V>;
|
|
933
1034
|
|
|
934
1035
|
/**
|
|
935
1036
|
* Build a CSS-native path-motion animation: set the author `offset-path` (and
|
|
936
1037
|
* optional `offset-rotate`) on the target(s), and sweep `offset-distance` from
|
|
937
1038
|
* → to. Returns the constructed {@link CSSKeyframesAnimation} as the control
|
|
938
|
-
* handle (the
|
|
1039
|
+
* handle (the control-handle contract — `.play()` / `.pause()` / `.stop()` / the
|
|
939
1040
|
* awaitable play promise), consistent with the `from*` factory family.
|
|
940
1041
|
*
|
|
941
1042
|
* The returned animation passes the EXISTING WAAPI eligibility gate
|
|
@@ -953,7 +1054,7 @@ export declare function fromMorphSVG<V extends Record<string, any> = any>(from:
|
|
|
953
1054
|
* duration: 2000,
|
|
954
1055
|
* });
|
|
955
1056
|
*/
|
|
956
|
-
export declare function fromMotionPath<V extends
|
|
1057
|
+
export declare function fromMotionPath<V extends Vars = Vars>(target: HTMLElement | HTMLElement[], options: MotionPathOptions): CSSKeyframesAnimation<V>;
|
|
957
1058
|
|
|
958
1059
|
/**
|
|
959
1060
|
* K1 — `fromStyleSheets`: the consumer-facing front door over
|
|
@@ -968,7 +1069,7 @@ export declare function fromMotionPath<V extends Record<string, any> = any>(targ
|
|
|
968
1069
|
* pulse?.setTargets(el).play(); // re-drive the page's OWN animation
|
|
969
1070
|
* for (const d of diagnostics) console.warn(d.code, d.message); // honest skips
|
|
970
1071
|
*/
|
|
971
|
-
export declare const fromStyleSheets: <V extends Vars =
|
|
1072
|
+
export declare const fromStyleSheets: <V extends Vars = Vars>(source?: Document | ShadowRoot | CSSStyleSheet[] | CSSStyleSheet, options?: IngestOptions) => IngestResult<V>;
|
|
972
1073
|
|
|
973
1074
|
/**
|
|
974
1075
|
* Resolve a stable name for an animation reference: the explicit `name` when
|
|
@@ -1011,7 +1112,7 @@ declare const hover: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
|
1011
1112
|
* rows for THIS rule (a malformed body → `PARSE_ERROR`, etc.); the walk-level
|
|
1012
1113
|
* rows (`CORS_SKIP`) ride {@link IngestResult.diagnostics}.
|
|
1013
1114
|
*/
|
|
1014
|
-
export declare interface IngestedAnimation<V extends Vars =
|
|
1115
|
+
export declare interface IngestedAnimation<V extends Vars = Vars> {
|
|
1015
1116
|
/** The `@keyframes` identifier (CSSOM `CSSKeyframesRule.name`). */
|
|
1016
1117
|
name: string;
|
|
1017
1118
|
/** The reconstructed kf animation — replay-equal to the source CSS. */
|
|
@@ -1044,7 +1145,7 @@ export declare interface IngestOptions {
|
|
|
1044
1145
|
* `animations` for the recovered objects and `diagnostics` for the citable
|
|
1045
1146
|
* reasons the walk could not complete a step faithfully — NEVER a silent drop.
|
|
1046
1147
|
*/
|
|
1047
|
-
export declare interface IngestResult<V extends Vars =
|
|
1148
|
+
export declare interface IngestResult<V extends Vars = Vars> {
|
|
1048
1149
|
/** Every `@keyframes` rule reconstructed, keyed by its CSS name. */
|
|
1049
1150
|
animations: Map<string, IngestedAnimation<V>>;
|
|
1050
1151
|
/**
|
|
@@ -1085,7 +1186,7 @@ declare const jumpUp: (options?: InputAnimationOptions) => CSSKeyframesAnimation
|
|
|
1085
1186
|
* leaking a suffixed collision alias into the d.ts. The legacy `Animation`
|
|
1086
1187
|
* re-export alias was DROPPED in 5.0.0 (Q.WE1 — NO-LEGACY).
|
|
1087
1188
|
*/
|
|
1088
|
-
export declare class KeyframesAnimation<V extends Vars =
|
|
1189
|
+
export declare class KeyframesAnimation<V extends Vars = Vars> {
|
|
1089
1190
|
id: number;
|
|
1090
1191
|
name: string | undefined;
|
|
1091
1192
|
superKey: string | undefined;
|
|
@@ -1109,10 +1210,22 @@ export declare class KeyframesAnimation<V extends Vars = any> {
|
|
|
1109
1210
|
* the excised `PlaybackHost` interface; the `./playback` free functions now
|
|
1110
1211
|
* own them via `this._playback` directly (no cast, no re-publication). */
|
|
1111
1212
|
readonly _playback: PlaybackState;
|
|
1112
|
-
startTime: number | undefined;
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1213
|
+
get startTime(): number | undefined;
|
|
1214
|
+
set startTime(v: number | undefined);
|
|
1215
|
+
get pausedTime(): number;
|
|
1216
|
+
set pausedTime(v: number);
|
|
1217
|
+
get t(): number;
|
|
1218
|
+
set t(v: number);
|
|
1219
|
+
get iteration(): number;
|
|
1220
|
+
set iteration(v: number);
|
|
1221
|
+
get started(): boolean;
|
|
1222
|
+
set started(v: boolean);
|
|
1223
|
+
get done(): boolean;
|
|
1224
|
+
set done(v: boolean);
|
|
1225
|
+
get reversed(): boolean;
|
|
1226
|
+
set reversed(v: boolean);
|
|
1227
|
+
get paused(): boolean;
|
|
1228
|
+
set paused(v: boolean);
|
|
1116
1229
|
/** Structured parse/honoring diagnostics (K.W7 S4) — a FLAT additive array
|
|
1117
1230
|
* of stable-coded {@link Diagnostic} rows surfaced from `resolveKeyframes` +
|
|
1118
1231
|
* the engine's composition-fallback rows; empty on a clean parse. Every
|
|
@@ -1129,10 +1242,6 @@ export declare class KeyframesAnimation<V extends Vars = any> {
|
|
|
1129
1242
|
/** True once a non-`replace` operator was seen — the hot path skips ALL
|
|
1130
1243
|
* composition work when false. INTERNAL — read by `./interpolate` (R.W2). */
|
|
1131
1244
|
_hasComposition: boolean;
|
|
1132
|
-
started: boolean;
|
|
1133
|
-
done: boolean;
|
|
1134
|
-
reversed: boolean;
|
|
1135
|
-
paused: boolean;
|
|
1136
1245
|
/** True when an `AnimationGroup` drives this animation's `advanceTo()`/
|
|
1137
1246
|
* `interpFrames()` from its own rAF loop. Standalone `.play()` throws when
|
|
1138
1247
|
* set rather than racing the group. */
|
|
@@ -1246,7 +1355,6 @@ export declare class KeyframesAnimation<V extends Vars = any> {
|
|
|
1246
1355
|
settle(): this;
|
|
1247
1356
|
reset(): this;
|
|
1248
1357
|
setTargets(...targets: HTMLElement[]): this;
|
|
1249
|
-
group(...animations: KeyframesAnimation<V>[]): AnimationGroup<V>;
|
|
1250
1358
|
}
|
|
1251
1359
|
|
|
1252
1360
|
/**
|
|
@@ -1292,9 +1400,7 @@ export declare interface MorphPoint {
|
|
|
1292
1400
|
* that ALSO exposes {@link sampleD} — the morphed `d` string at a normalized
|
|
1293
1401
|
* `t`, reassembled from the interpolated point coordinates.
|
|
1294
1402
|
*/
|
|
1295
|
-
export declare class MorphSVG<V extends
|
|
1296
|
-
/** The underlying coordinate-interpolating animation — the control handle. */
|
|
1297
|
-
readonly animation: CSSKeyframesAnimation<V>;
|
|
1403
|
+
export declare class MorphSVG<V extends Vars = Vars> extends SVGAnimationHandle<V> {
|
|
1298
1404
|
/** The uniform-sample count (point pairs = samples + 1). */
|
|
1299
1405
|
readonly samples: number;
|
|
1300
1406
|
constructor(from: string, to: string, options?: MorphSVGOptions);
|
|
@@ -1306,14 +1412,6 @@ export declare class MorphSVG<V extends Record<string, any> = any> {
|
|
|
1306
1412
|
* from BOTH endpoint polylines at any interior `t`.
|
|
1307
1413
|
*/
|
|
1308
1414
|
sampleD(t: number): string;
|
|
1309
|
-
/** Start (or re-enter) the morph play loop. */
|
|
1310
|
-
play(): Promise<void>;
|
|
1311
|
-
/** Pause the play loop, retaining the playhead. */
|
|
1312
|
-
pause(): this;
|
|
1313
|
-
/** Halt and rewind the play loop. */
|
|
1314
|
-
stop(): this;
|
|
1315
|
-
/** Resolve once the morph completes — the {@link Animation.finished} front-door. */
|
|
1316
|
-
get finished(): Promise<void>;
|
|
1317
1415
|
}
|
|
1318
1416
|
|
|
1319
1417
|
export declare interface MorphSVGOptions extends Partial<InputAnimationOptions> {
|
|
@@ -1372,16 +1470,8 @@ export declare interface MorphSVGOptions extends Partial<InputAnimationOptions>
|
|
|
1372
1470
|
* the factory: `new MotionPath(target, { path }).animation` is the control
|
|
1373
1471
|
* handle. The factory is the canonical entry; this is a thin ergonomic wrapper.
|
|
1374
1472
|
*/
|
|
1375
|
-
export declare class MotionPath<V extends
|
|
1376
|
-
/** The underlying offset-distance animation — the control handle. */
|
|
1377
|
-
readonly animation: CSSKeyframesAnimation<V>;
|
|
1473
|
+
export declare class MotionPath<V extends Vars = Vars> extends SVGAnimationHandle<V> {
|
|
1378
1474
|
constructor(target: HTMLElement | HTMLElement[], options: MotionPathOptions);
|
|
1379
|
-
/** Start (or re-enter) the path-motion play loop. */
|
|
1380
|
-
play(): Promise<void>;
|
|
1381
|
-
/** Pause the play loop, retaining the playhead. */
|
|
1382
|
-
pause(): this;
|
|
1383
|
-
/** Halt and rewind the play loop. */
|
|
1384
|
-
stop(): this;
|
|
1385
1475
|
}
|
|
1386
1476
|
|
|
1387
1477
|
export declare interface MotionPathOptions extends Partial<InputAnimationOptions> {
|
|
@@ -1528,12 +1618,36 @@ export declare function pinCSS(opts?: {
|
|
|
1528
1618
|
bottom?: number;
|
|
1529
1619
|
}): string;
|
|
1530
1620
|
|
|
1621
|
+
declare interface PlainLeafWriter {
|
|
1622
|
+
/** The nested parent object the leaf lives on. */
|
|
1623
|
+
obj: Record<string, unknown>;
|
|
1624
|
+
/** The leaf's own (last dot-segment) key on `obj`. */
|
|
1625
|
+
key: string;
|
|
1626
|
+
/** The live `ValueUnit[]` whose `.value`(s) the interp stride mutates in place. */
|
|
1627
|
+
units: ValueUnit[];
|
|
1628
|
+
/**
|
|
1629
|
+
* True iff the leaf is a single unitless numeric unit → write `.value` (a
|
|
1630
|
+
* bare `number`, zero-alloc). False → a units/color/multi-component leaf,
|
|
1631
|
+
* projected to its authored STRING each refresh (the units/color residual).
|
|
1632
|
+
*/
|
|
1633
|
+
numeric: boolean;
|
|
1634
|
+
}
|
|
1635
|
+
|
|
1636
|
+
declare interface PlainProjection {
|
|
1637
|
+
/** The nested plain object a custom `transform` consumes (`plainVars`). */
|
|
1638
|
+
root: Record<string, unknown>;
|
|
1639
|
+
/** The per-leaf refresh writers, in flat-key order. */
|
|
1640
|
+
writers: PlainLeafWriter[];
|
|
1641
|
+
}
|
|
1642
|
+
|
|
1531
1643
|
/**
|
|
1532
|
-
*
|
|
1533
|
-
* `
|
|
1534
|
-
*
|
|
1535
|
-
*
|
|
1536
|
-
*
|
|
1644
|
+
* `engine/playback-state.ts` — the `PlaybackState` run-state STORE, carved off
|
|
1645
|
+
* `engine/play-lifecycle.ts` at S.B2 on the STATE↔BEHAVIOR cohesion seam (the
|
|
1646
|
+
* play machine's free functions live in `./play-lifecycle`; the state they mutate lives
|
|
1647
|
+
* HERE). A value.js-free leaf struct: it owns the standalone-play machine's OWN
|
|
1648
|
+
* run-state so the state has a SINGLE owner instead of being scattered as
|
|
1649
|
+
* privates the class re-published through a cast (R.W2 dissolved the
|
|
1650
|
+
* `PlaybackHost` privacy-inversion).
|
|
1537
1651
|
*
|
|
1538
1652
|
* - `resolvePromise` — the standalone-loop deferred resolver (`playRAF`
|
|
1539
1653
|
* arms it, `resolvePlay` fires it).
|
|
@@ -1545,6 +1659,20 @@ export declare function pinCSS(opts?: {
|
|
|
1545
1659
|
* re-bound per loop (the per-loop-closure-free idiom).
|
|
1546
1660
|
* - `_interpOut` — the ONE hoisted interp buffer the play loop reuses
|
|
1547
1661
|
* every frame (zero-alloc steady state).
|
|
1662
|
+
*
|
|
1663
|
+
* ── S.B2 (C-15) — PlaybackState is the SOLE STORAGE for the run-state FSM.
|
|
1664
|
+
* The eight transition fields (`started`/`done`/`paused`/`reversed`/`iteration`/
|
|
1665
|
+
* `t`/`startTime`/`pausedTime`) fold OFF the `KeyframesAnimation` class body and
|
|
1666
|
+
* live HERE as the single backing store; the class exposes them as accessor
|
|
1667
|
+
* delegates over `this._playback.*` (so the FSM stays a public, externally-written
|
|
1668
|
+
* surface — `group/`, `sequence/`, `ingest/`, `waapi/`, the tests, and the demo's
|
|
1669
|
+
* `contractAnim.t =` writes all keep working through the accessors). The
|
|
1670
|
+
* engine-INTERNAL hot path reads/writes `anim._playback.*` DIRECTLY (one extra
|
|
1671
|
+
* monomorphic load — a shape cost, not an allocation; proof:standalone-zero-alloc
|
|
1672
|
+
* / proof:interp-fastprops stay green). `managed` is deliberately NOT here — it is
|
|
1673
|
+
* loop-OWNERSHIP, not run-state, and never resets in `settle`. The literal
|
|
1674
|
+
* single-WRITER hard fold (a public `seek(ms)` verb + MIGRATION) is a future
|
|
1675
|
+
* BREAKING wave (§8-3), out of S scope.
|
|
1548
1676
|
*/
|
|
1549
1677
|
declare class PlaybackState {
|
|
1550
1678
|
resolvePromise: ((value: void | PromiseLike<void>) => void) | null;
|
|
@@ -1552,6 +1680,14 @@ declare class PlaybackState {
|
|
|
1552
1680
|
_waAnimations: globalThis.Animation[];
|
|
1553
1681
|
readonly _boundFrame: (t: number) => boolean | Promise<boolean>;
|
|
1554
1682
|
readonly _interpOut: Record<string, unknown>;
|
|
1683
|
+
startTime: number | undefined;
|
|
1684
|
+
pausedTime: number;
|
|
1685
|
+
t: number;
|
|
1686
|
+
iteration: number;
|
|
1687
|
+
started: boolean;
|
|
1688
|
+
done: boolean;
|
|
1689
|
+
reversed: boolean;
|
|
1690
|
+
paused: boolean;
|
|
1555
1691
|
constructor(frameCb: (t: number) => boolean | Promise<boolean>);
|
|
1556
1692
|
}
|
|
1557
1693
|
|
|
@@ -1928,7 +2064,7 @@ export declare const resolveKeyframes: (input: string | Stylesheet, env?: Resolv
|
|
|
1928
2064
|
* normalises a STRING of CSS, `resolveLiveKeyframes` normalises the LIVE CSSOM —
|
|
1929
2065
|
* the parser pointed forward at the web the page already ships.
|
|
1930
2066
|
*/
|
|
1931
|
-
export declare const resolveLiveKeyframes: <V extends Vars =
|
|
2067
|
+
export declare const resolveLiveKeyframes: <V extends Vars = Vars>(source?: Document | ShadowRoot | CSSStyleSheet[] | CSSStyleSheet, options?: IngestOptions) => IngestResult<V>;
|
|
1932
2068
|
|
|
1933
2069
|
/**
|
|
1934
2070
|
* Resolve a parsed `AnimationRangeValue` (or `undefined` → the whole [0,1]
|
|
@@ -2115,7 +2251,7 @@ declare type ScrollTimelineAxis = "block" | "inline" | "x" | "y";
|
|
|
2115
2251
|
* and drives them via `Animation.advanceTo`. See the module docstring for the
|
|
2116
2252
|
* booked name + subsumption decision.
|
|
2117
2253
|
*/
|
|
2118
|
-
declare class Sequence<V extends Vars =
|
|
2254
|
+
declare class Sequence<V extends Vars = Vars> implements SequencePlayContext<V> {
|
|
2119
2255
|
/** Resolved segments, in insertion order. */
|
|
2120
2256
|
readonly entries: SequenceEntry<V>[];
|
|
2121
2257
|
/** Named positions on the master clock, registered via {@link label}. */
|
|
@@ -2135,13 +2271,13 @@ declare class Sequence<V extends Vars = any> implements SequencePlayContext<V> {
|
|
|
2135
2271
|
private cursor;
|
|
2136
2272
|
/** Master clock (ms) of the current playhead. */
|
|
2137
2273
|
_time: number;
|
|
2138
|
-
|
|
2274
|
+
/* Excluded from this release type: respectReducedMotion */
|
|
2139
2275
|
/** THE rAF owner for the sequence's play loop. */
|
|
2140
2276
|
readonly playback: RAFPlayback;
|
|
2141
|
-
|
|
2277
|
+
/* Excluded from this release type: _boundFrame */
|
|
2142
2278
|
_resolvePlay: (() => void) | null;
|
|
2143
2279
|
_playOrigin: number | undefined;
|
|
2144
|
-
|
|
2280
|
+
/* Excluded from this release type: _playingPromise */
|
|
2145
2281
|
/**
|
|
2146
2282
|
* The scalar playback rate — the single field that drives `timeScale`
|
|
2147
2283
|
* and `reverse`. `_rate = 1` is real-time forward (the existing
|
|
@@ -2231,17 +2367,6 @@ declare class Sequence<V extends Vars = any> implements SequencePlayContext<V> {
|
|
|
2231
2367
|
* set on each `animation` directly before `.add`. Chainable.
|
|
2232
2368
|
*/
|
|
2233
2369
|
setTargets(...targets: HTMLElement[]): this;
|
|
2234
|
-
/**
|
|
2235
|
-
* Drive the sequence over real time via `RAFPlayback`. Each child is driven
|
|
2236
|
-
* through the published `Animation.advanceTo(absoluteClock)` map: its
|
|
2237
|
-
* `startTime` is seeded to its resolved `at`, so `advanceTo(masterClock)`
|
|
2238
|
-
* yields the child's local clock as `masterClock − at` exactly. Resolves
|
|
2239
|
-
* when the master playhead passes the sequence `duration`.
|
|
2240
|
-
*
|
|
2241
|
-
* Re-entrant: a `play()` while one is in flight returns the same promise.
|
|
2242
|
-
* Under `respectReducedMotion` + an active query, snaps to the rest frame
|
|
2243
|
-
* in one paint (a terminal `seek(duration)`), no draw loop.
|
|
2244
|
-
*/
|
|
2245
2370
|
/**
|
|
2246
2371
|
* The completion front-door (G.W13) — `await sequence.finished` resolves
|
|
2247
2372
|
* once the in-flight transport settles. Exposes the ONE held
|
|
@@ -2251,55 +2376,34 @@ declare class Sequence<V extends Vars = any> implements SequencePlayContext<V> {
|
|
|
2251
2376
|
* sequence resolves immediately.
|
|
2252
2377
|
*/
|
|
2253
2378
|
get finished(): Promise<void>;
|
|
2379
|
+
/** Drive the sequence over real time via `RAFPlayback` — re-entrant, and
|
|
2380
|
+
* PRM-aware. Body in `./lifecycle` (S.B5). */
|
|
2254
2381
|
play(): Promise<void>;
|
|
2255
2382
|
_frame(clock: number): Promise<boolean>;
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
/** Halt the play loop where it stands and resolve any pending `play()`. */
|
|
2383
|
+
/** Halt the play loop where it stands and resolve any pending `play()`.
|
|
2384
|
+
* Body in `./lifecycle` (S.B5). */
|
|
2259
2385
|
stop(): this;
|
|
2260
|
-
/**
|
|
2261
|
-
*
|
|
2262
|
-
*
|
|
2263
|
-
* are RETAINED (children stay `managed`, unlike `stop()`/`_settle`), so a
|
|
2264
|
-
* later {@link resume} continues from exactly here. No-op when not playing
|
|
2265
|
-
* or already paused. Chainable.
|
|
2266
|
-
*/
|
|
2386
|
+
/** Halt the play loop WITHOUT releasing the playhead — the managed-pause
|
|
2387
|
+
* contract (`_time` + the play promise are retained for `resume`). No-op when
|
|
2388
|
+
* not playing or already paused. Body in `./lifecycle` (S.B5). */
|
|
2267
2389
|
pause(): this;
|
|
2268
|
-
/**
|
|
2269
|
-
*
|
|
2270
|
-
*
|
|
2271
|
-
* retained `_time` (the no-forward-jump re-anchor, the same `RAFPlayback`/
|
|
2272
|
-
* `AnimationGroup` managed-pause contract — `src/animation/CLAUDE.md`
|
|
2273
|
-
* §Managed-child lifecycle). No-op when not paused. Chainable.
|
|
2274
|
-
*/
|
|
2390
|
+
/** Resume a paused sequence — restart the rAF loop with the origin
|
|
2391
|
+
* re-anchored so the first resumed frame's master clock equals the retained
|
|
2392
|
+
* `_time` (no forward jump). No-op when not paused. Body in `./lifecycle`. */
|
|
2275
2393
|
resume(): this;
|
|
2276
|
-
/**
|
|
2277
|
-
*
|
|
2278
|
-
*
|
|
2279
|
-
*
|
|
2280
|
-
* rate-change instant (no jump) — the same re-anchor as {@link resume}.
|
|
2281
|
-
* Takes effect immediately whether or not the sequence is playing.
|
|
2282
|
-
* Chainable.
|
|
2283
|
-
*/
|
|
2394
|
+
/** Set the scalar playback rate — slow-mo (`< 1`), real-time (`1`),
|
|
2395
|
+
* fast-forward (`> 1`), or backward (`< 0`, the {@link reverse} form); the
|
|
2396
|
+
* master clock is re-anchored so the playhead is C⁰-continuous at the flip.
|
|
2397
|
+
* Body in `./lifecycle` (S.B5). */
|
|
2284
2398
|
timeScale(n: number): this;
|
|
2285
|
-
/**
|
|
2286
|
-
*
|
|
2287
|
-
* stands (a negative rate) or forward again, preserving `|rate|`. C⁰-
|
|
2288
|
-
* continuous: the re-anchor keeps the playhead exactly where it is at the
|
|
2289
|
-
* flip instant (locked by the F.W9 seek↔play parity gate). Chainable.
|
|
2290
|
-
*/
|
|
2399
|
+
/** Flip the playback direction — the playhead walks backward (negative rate)
|
|
2400
|
+
* or forward again, preserving `|rate|`, C⁰-continuous. Body in `./lifecycle`. */
|
|
2291
2401
|
reverse(): this;
|
|
2292
|
-
/**
|
|
2293
|
-
*
|
|
2294
|
-
* `n` runs `n` cycles, `Infinity` loops forever (until `stop()`). The
|
|
2295
|
-
* master clock folds modulo `duration` per cycle. Chainable.
|
|
2296
|
-
*/
|
|
2402
|
+
/** Set how many cycles `play()` runs before settling — `1` single-play, `n`
|
|
2403
|
+
* cycles, `Infinity` loops forever. Body in `./lifecycle` (S.B5). */
|
|
2297
2404
|
repeat(count: number): this;
|
|
2298
|
-
/**
|
|
2299
|
-
*
|
|
2300
|
-
* (`duration − phase`) so the playhead bounces back and forth across the
|
|
2301
|
-
* `repeat` cycles. Chainable.
|
|
2302
|
-
*/
|
|
2405
|
+
/** Toggle yoyo (ping-pong) — odd cycles run reflected across the `repeat`
|
|
2406
|
+
* cycles. Body in `./lifecycle` (S.B5). */
|
|
2303
2407
|
yoyo(on?: boolean): this;
|
|
2304
2408
|
}
|
|
2305
2409
|
|
|
@@ -2543,8 +2647,15 @@ declare interface SoALayerPlan {
|
|
|
2543
2647
|
* `add`/`weighted` blend stays byte-identical on the non-numeric tail. EMPTY
|
|
2544
2648
|
* for the dominant all-numeric transform shape (every leaf a numeric
|
|
2545
2649
|
* `ValueUnit[]`), so the whole `for..in` collapses to the SoA fold.
|
|
2546
|
-
|
|
2547
|
-
|
|
2650
|
+
*
|
|
2651
|
+
* S.F5a S1 — a precomputed `Set`, built ONCE here at `buildSoAPlans`
|
|
2652
|
+
* (structural-change time). The compositor's boxed residual (`boxedBlendArm`)
|
|
2653
|
+
* takes it DIRECTLY as its `only` membership test — killing the per-frame
|
|
2654
|
+
* `new Set(only)` the boxed arm rebuilt every frame on the mixed-leaf shape
|
|
2655
|
+
* (the allocation is hoisted to plan-build time, `proof:zero-alloc`
|
|
2656
|
+
* mixed-leaf clause).
|
|
2657
|
+
*/
|
|
2658
|
+
boxedKeys: Set<string>;
|
|
2548
2659
|
}
|
|
2549
2660
|
|
|
2550
2661
|
declare const spinner: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
@@ -2621,6 +2732,32 @@ declare const springSlideIn: (options?: InputAnimationOptions) => CSSKeyframesAn
|
|
|
2621
2732
|
/** Spring-eased wobble — gentle spring (ζ 0.95) for a soft attention nudge. */
|
|
2622
2733
|
declare const springWobble: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
2623
2734
|
|
|
2735
|
+
/**
|
|
2736
|
+
* Feature-detect native `animation-trigger` — Chrome 145+ ships it; nothing else
|
|
2737
|
+
* (yet) does. `CSS.supports` is the FEATURE probe (never a UA sniff — r5 / the
|
|
2738
|
+
* CE-1.0 precedent). Returns `false` where `CSS`/`CSS.supports` is absent (SSR,
|
|
2739
|
+
* jsdom) OR the property/keyword is unknown, so the caller keeps the kf driver.
|
|
2740
|
+
*/
|
|
2741
|
+
export declare function supportsNativeTrigger(): boolean;
|
|
2742
|
+
|
|
2743
|
+
declare abstract class SVGAnimationHandle<V extends Vars = Vars> {
|
|
2744
|
+
readonly animation: CSSKeyframesAnimation<V>;
|
|
2745
|
+
/**
|
|
2746
|
+
* The underlying animation — the control handle. Set by the subclass through
|
|
2747
|
+
* `super(fromX(...))` (the `fromX` factory is the canonical construction).
|
|
2748
|
+
*/
|
|
2749
|
+
constructor(animation: CSSKeyframesAnimation<V>);
|
|
2750
|
+
/** Start (or re-enter) the play loop. Resolves when the animation completes. */
|
|
2751
|
+
play(): Promise<void>;
|
|
2752
|
+
/** Pause the play loop, retaining the playhead. Chainable. */
|
|
2753
|
+
pause(): this;
|
|
2754
|
+
/** Halt and rewind the play loop. Chainable. */
|
|
2755
|
+
stop(): this;
|
|
2756
|
+
/** Resolve once the animation completes — the {@link Animation.finished}
|
|
2757
|
+
* completion front-door, uniform across every SVG handle. */
|
|
2758
|
+
get finished(): Promise<void>;
|
|
2759
|
+
}
|
|
2760
|
+
|
|
2624
2761
|
/**
|
|
2625
2762
|
* The minimal geometry contract DrawSVG needs: any SVG element that exposes
|
|
2626
2763
|
* `getTotalLength()` (`SVGGeometryElement` — `<path>`, `<line>`, `<circle>`,
|
|
@@ -2713,7 +2850,7 @@ declare interface TimelineOptions {
|
|
|
2713
2850
|
*
|
|
2714
2851
|
* ```ts
|
|
2715
2852
|
* const easing = await resolveEasing("ease-out-cubic");
|
|
2716
|
-
* new
|
|
2853
|
+
* new KeyframesScrollTimeline({ easing });
|
|
2717
2854
|
* ```
|
|
2718
2855
|
*/
|
|
2719
2856
|
easing?: TimingFunction | Easing | undefined;
|
|
@@ -2744,6 +2881,89 @@ declare type TransformFunction<V extends Vars> = (v: V, t: number) => void;
|
|
|
2744
2881
|
*/
|
|
2745
2882
|
export declare function transformTargetsStyle<V extends Vars>(vars: V, targets: HTMLElement[], flat?: boolean): void;
|
|
2746
2883
|
|
|
2884
|
+
/** The play direction a trigger cycle runs — `alternate` flips it each entry. */
|
|
2885
|
+
export declare type TriggerDirection = "forward" | "backward";
|
|
2886
|
+
|
|
2887
|
+
/**
|
|
2888
|
+
* The kf `TriggerScene` — realizes a parsed `AnimationTriggerValue` as the
|
|
2889
|
+
* idle→active→done lifecycle over a raw scroll position. The caller drives the
|
|
2890
|
+
* loop (`triggerProgress(p)` per scroll event); the scene owns no rAF and no
|
|
2891
|
+
* DOM. The four `<trigger-type>`s differ ONLY in their crossing semantics:
|
|
2892
|
+
*
|
|
2893
|
+
* • `once` — fires once. `idle →enter→ active →exit→ done`; `done` LATCHES
|
|
2894
|
+
* (a re-entry never re-fires). The one-shot reveal.
|
|
2895
|
+
* • `repeat` — re-fires. `idle →enter→ active →exit→ idle` (RESET — the exit
|
|
2896
|
+
* returns to the pre-animation state); each re-entry re-plays
|
|
2897
|
+
* forward, `cycles` incrementing. Never permanently `done`.
|
|
2898
|
+
* • `alternate` — re-fires with a FLIPPED direction. `idle →enter→
|
|
2899
|
+
* active(forward) →exit→ done →enter→ active(backward) → …`;
|
|
2900
|
+
* `direction` alternates each entry (the backward semantics).
|
|
2901
|
+
* • `state` — the play state FOLLOWS presence. `inside ⇒ active`,
|
|
2902
|
+
* `outside ⇒ done` (after the first entry) — the playhead is
|
|
2903
|
+
* HELD across the boundary (pause/resume, NOT reset).
|
|
2904
|
+
*
|
|
2905
|
+
* The `playhead` (0..1) is the animation's own progress the consumer writes to
|
|
2906
|
+
* an engine; it advances with the within-range fraction while `active`. The gate
|
|
2907
|
+
* asserts the STATE sequence (scrub-based, C-10 — never a frame/ms threshold).
|
|
2908
|
+
*/
|
|
2909
|
+
export declare class TriggerScene {
|
|
2910
|
+
/** The parsed `<trigger-type>` (CSS initial value is `once`). */
|
|
2911
|
+
readonly type: TriggerType;
|
|
2912
|
+
private readonly triggerRange;
|
|
2913
|
+
private _state;
|
|
2914
|
+
private _direction;
|
|
2915
|
+
private _playhead;
|
|
2916
|
+
private _cycles;
|
|
2917
|
+
private wasInside;
|
|
2918
|
+
private everEntered;
|
|
2919
|
+
constructor(trigger?: AnimationTriggerValue);
|
|
2920
|
+
/** The current lifecycle state. */
|
|
2921
|
+
get state(): TriggerState;
|
|
2922
|
+
/** The current play direction (`alternate` flips it each entry). */
|
|
2923
|
+
get direction(): TriggerDirection;
|
|
2924
|
+
/** The animation's own progress (0..1) — the engine-write the driver tracks. */
|
|
2925
|
+
get playhead(): number;
|
|
2926
|
+
/** How many times the trigger has fired (entered `active` from idle/done). */
|
|
2927
|
+
get cycles(): number;
|
|
2928
|
+
/** The resolved [start,end] scroll-extent fractions of the trigger range. */
|
|
2929
|
+
get range(): ResolvedRange;
|
|
2930
|
+
/**
|
|
2931
|
+
* True when the platform will run this trigger NATIVELY (Chrome 145+). The
|
|
2932
|
+
* dispatch is the caller's: `usesNative` ⇒ author a native `animation-trigger`
|
|
2933
|
+
* declaration; else drive THIS scene. Feature-detected, never UA-sniffed.
|
|
2934
|
+
*/
|
|
2935
|
+
get usesNative(): boolean;
|
|
2936
|
+
/**
|
|
2937
|
+
* Drive the trigger from a raw scroll position `p ∈ [0,1]` (the caller
|
|
2938
|
+
* resolves the live scroller; kf maps it over the trigger range). Advances
|
|
2939
|
+
* the idle→active→done state machine per the `<trigger-type>` semantics and
|
|
2940
|
+
* returns the new state.
|
|
2941
|
+
*/
|
|
2942
|
+
triggerProgress(p: number): TriggerState;
|
|
2943
|
+
/** Rewind the lifecycle to `idle` (re-arm a `once`/`state` scene). */
|
|
2944
|
+
reset(): void;
|
|
2945
|
+
/** `once` — fire once, then LATCH `done` (a re-entry never re-fires). */
|
|
2946
|
+
private stepOnce;
|
|
2947
|
+
/** `repeat` — RESET to `idle` on exit; each re-entry re-plays forward. */
|
|
2948
|
+
private stepRepeat;
|
|
2949
|
+
/** `alternate` — exit `done`; each re-entry FLIPS the play direction. */
|
|
2950
|
+
private stepAlternate;
|
|
2951
|
+
/** `state` — play state FOLLOWS presence; the playhead is HELD across exits. */
|
|
2952
|
+
private stepState;
|
|
2953
|
+
private directedPlayhead;
|
|
2954
|
+
}
|
|
2955
|
+
|
|
2956
|
+
/**
|
|
2957
|
+
* The three lifecycle states a `<single-animation-trigger>` traverses:
|
|
2958
|
+
* • `idle` — the timeline has not (yet) triggered the animation.
|
|
2959
|
+
* • `active` — the trigger fired; the animation is playing.
|
|
2960
|
+
* • `done` — the trigger cycle completed (latched for `once`; transient for
|
|
2961
|
+
* the re-firing types).
|
|
2962
|
+
* The canonical `once` lifecycle is `idle → active → done`; the other three
|
|
2963
|
+
* types are variations over the SAME vocabulary (§`triggerProgress`).
|
|
2964
|
+
*/
|
|
2965
|
+
export declare type TriggerState = "idle" | "active" | "done";
|
|
2966
|
+
|
|
2747
2967
|
declare const typewriter: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
2748
2968
|
|
|
2749
2969
|
declare const typingCursor: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
@@ -2827,6 +3047,52 @@ declare type Vars<T = any> = {
|
|
|
2827
3047
|
[arg: string]: number | string | T;
|
|
2828
3048
|
};
|
|
2829
3049
|
|
|
3050
|
+
/** Options for {@link compileToViewTransition}, extending {@link CompileOptions}. */
|
|
3051
|
+
export declare interface ViewTransitionCompileOptions extends CompileOptions {
|
|
3052
|
+
/** Typed same-doc VT — wraps every rule in `:root:active-view-transition-type(...)`. */
|
|
3053
|
+
types?: readonly string[];
|
|
3054
|
+
/** Prepend the cross-doc `@view-transition { navigation: auto }` preamble (opt-in). */
|
|
3055
|
+
crossDocument?: boolean;
|
|
3056
|
+
/** Append the PRM `animation: none` degrade block (default `true`). */
|
|
3057
|
+
reducedMotion?: boolean;
|
|
3058
|
+
/**
|
|
3059
|
+
* Emit the MANDATORY timing-only group pseudo (default `true`). Turning it
|
|
3060
|
+
* OFF ships the 250ms/ease temporal incoherence p09 observed — exposed only
|
|
3061
|
+
* so the born-RED gate's falsifiability clause can prove the omission REDs.
|
|
3062
|
+
*/
|
|
3063
|
+
emitGroup?: boolean;
|
|
3064
|
+
}
|
|
3065
|
+
|
|
3066
|
+
/** A VT refusal — the CC-3 shape widened to the VT reason union. */
|
|
3067
|
+
export declare interface VTCompileRefusal extends Omit<CompileRefusal, "reason"> {
|
|
3068
|
+
reason: VTCompileRefusalReason;
|
|
3069
|
+
}
|
|
3070
|
+
|
|
3071
|
+
/** The four VT refusals atop the inherited CC-3 {@link CompileRefusalReason}. */
|
|
3072
|
+
export declare type VTCompileRefusalReason = CompileRefusalReason | "vt-scroll-grammar" | "vt-element-scoped-computed" | "vt-snapshot-inapplicable" | "vt-name-collision";
|
|
3073
|
+
|
|
3074
|
+
/**
|
|
3075
|
+
* The per-name VT role mapping (SF-1). A group/Sequence has NO old/new axis (the
|
|
3076
|
+
* group-as-primary reading is REJECTED), so the emitter's PRIMARY input is this
|
|
3077
|
+
* name-keyed role spec. `old`/`new` are the same `KeyframesAnimation`s
|
|
3078
|
+
* `compileToCSS` walks; `group` is timing-only by design.
|
|
3079
|
+
*/
|
|
3080
|
+
export declare type VTRoleSpec<V extends Vars = Vars> = {
|
|
3081
|
+
/** The outgoing snapshot's animation (`::view-transition-old(name)`). */
|
|
3082
|
+
old?: KeyframesAnimation<V>;
|
|
3083
|
+
/** The incoming snapshot's animation (`::view-transition-new(name)`). */
|
|
3084
|
+
new?: KeyframesAnimation<V>;
|
|
3085
|
+
/**
|
|
3086
|
+
* Timing-only for the group pseudo: duration + easing onto the UA geometry
|
|
3087
|
+
* morph (NEVER `animation-name`). A `KeyframesAnimation` contributes its
|
|
3088
|
+
* `options.duration`/`timingFunction`; a bare `{ duration, timingFunction }`
|
|
3089
|
+
* gives them directly. Omit → derived from `new ?? old` (the coherent default).
|
|
3090
|
+
*/
|
|
3091
|
+
group?: Pick<AnimationOptions, "duration" | "timingFunction"> | KeyframesAnimation<V>;
|
|
3092
|
+
/** A `view-transition-class` cohort name — uniform cohorts ride one rule. */
|
|
3093
|
+
class?: string;
|
|
3094
|
+
};
|
|
3095
|
+
|
|
2830
3096
|
declare type WAAPIEligibility = {
|
|
2831
3097
|
eligible: true;
|
|
2832
3098
|
} | {
|