@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.
Files changed (35) hide show
  1. package/README.md +83 -3
  2. package/dist/backward-color-BtbRcnna.js +108 -0
  3. package/dist/compile-BHCTPerD.js +30 -0
  4. package/dist/{delegation-DWwr4IXr.js → delegation-BQYCrP2p.js} +5 -9
  5. package/dist/{draw-svg-GURj9nin.js → draw-svg-CK9Qrly8.js} +13 -25
  6. package/dist/easing-serialize-D4LZCB6i.js +21 -0
  7. package/dist/engine/index.d.ts +422 -156
  8. package/dist/engine/index.js +16 -17
  9. package/dist/engine-CPK_udUQ.js +1172 -0
  10. package/dist/engine-DlpimZtM.js +3 -0
  11. package/dist/entry-D82NKUhP.js +148 -0
  12. package/dist/format-BdIvdLzG.js +114 -0
  13. package/dist/{group-vJcsHKN9.js → group-HM7N4uOE.js} +153 -123
  14. package/dist/handle-D4xrf_ya.js +21 -0
  15. package/dist/{ingest-S5hUe20K.js → ingest-_g6tfk2e.js} +2 -2
  16. package/dist/keyframes.d.ts +702 -178
  17. package/dist/keyframes.js +295 -74
  18. package/dist/morph-svg-KUrH9KnK.js +79 -0
  19. package/dist/motion-path-wM5tPfrY.js +26 -0
  20. package/dist/presets-DeDJYL4G.js +275 -0
  21. package/dist/{scheduler-CUtVnuoU.js → scheduler-CfGIC3GX.js} +1 -1
  22. package/dist/{scroll-CxpYFO4u.js → scroll-BEyCx0b_.js} +165 -58
  23. package/dist/{sequence-C_DCiOIQ.js → sequence-s0bL7Uul.js} +118 -90
  24. package/dist/{validate-DDeGnvSt.js → validate-xFZ_Ld1k.js} +7 -7
  25. package/dist/view-transition-BPJQxUTC.js +305 -0
  26. package/package.json +113 -83
  27. package/dist/animation-BGyzfzBq.js +0 -947
  28. package/dist/compile-CcSUwM8R.js +0 -276
  29. package/dist/engine-DEVgCTUy.js +0 -156
  30. package/dist/engine-DrBtsKaf.js +0 -4
  31. package/dist/format-C-Gi9r7L.js +0 -123
  32. package/dist/grammar-BLucehC4.js +0 -23
  33. package/dist/morph-svg-BToeumw5.js +0 -89
  34. package/dist/motion-path-pQVbamWT.js +0 -35
  35. package/dist/presets-BG2Fczzq.js +0 -275
@@ -1,5 +1,6 @@
1
1
  import { AnimationRangeValue } from '@mkbabb/value.js';
2
2
  import { AnimationTimelineValue } from '@mkbabb/value.js';
3
+ import { AnimationTriggerValue } from '@mkbabb/value.js';
3
4
  import { ColorSpace } from '@mkbabb/value.js';
4
5
  import { CSSTimelineOptions } from '@mkbabb/value.js';
5
6
  import { CustomFunctionDescriptor } from '@mkbabb/value.js';
@@ -12,6 +13,7 @@ import { RangeBoundary } from '@mkbabb/value.js';
12
13
  import { RangePhase } from '@mkbabb/value.js';
13
14
  import { Stylesheet } from '@mkbabb/value.js';
14
15
  import { timingFunctions } from '@mkbabb/value.js';
16
+ import { 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 = any> {
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
- declare const adoptRunning: <V extends Vars = any>(el: Element, options: AdoptRunningOptions) => Promise<AdoptResult<V>>;
65
+ 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 {
@@ -151,8 +153,18 @@ export declare interface AnimationEngine {
151
153
  resolveRange: typeof resolveRange;
152
154
  /** `position:sticky` pin synthesis. */
153
155
  pinCSS: typeof pinCSS;
156
+ /** The discrete `animation-trigger` lifecycle driver (idle→active→done). */
157
+ TriggerScene: typeof TriggerScene;
158
+ /** Construct a `TriggerScene` from a parsed trigger / scroll options. */
159
+ createTriggerScene: typeof createTriggerScene;
160
+ /** Feature-detect native `animation-trigger` (Chrome 145+; never UA-sniffed). */
161
+ supportsNativeTrigger: typeof supportsNativeTrigger;
154
162
  /** The round-trip's BACKWARD half: orchestration graph → zero-runtime CSS. */
155
163
  compileToCSS: typeof compileToCSS;
164
+ /** S.F1 — compile a name-keyed VT role spec → zero-runtime `::view-transition-*` CSS. */
165
+ compileToViewTransition: typeof compileToViewTransition;
166
+ /** S.F3 — compile a selector-keyed entry/exit spec → zero-runtime `@starting-style` CSS. */
167
+ compileToEntry: typeof compileToEntry;
156
168
  /** Read-only validation envelope over the compile/adapter/WAAPI channels. */
157
169
  validate: typeof validate;
158
170
  /** Format the `validate` verdict as deterministic human/LLM-readable text. */
@@ -201,6 +213,18 @@ export declare interface AnimationFrame<V extends Vars> {
201
213
  * falls back to the all-boxed walk. Bit-identical to the boxed path.
202
214
  */
203
215
  _numericPlan?: NumericFoldPlan<V>;
216
+ /**
217
+ * T.A6 — the nested PLAIN authored-shape projection a custom `transform`
218
+ * consumes (numbers where the author wrote numbers, strings where a unit or
219
+ * color demands one). Built lazily on the first apply — `undefined` for a
220
+ * DOM-style default-renderer frame (which consumes `flatVars` directly) and
221
+ * before the first `interpFrames(..., true)`. Invalidated at
222
+ * `finalizeFrameVars` so a color-space renormalize rebuilds it against the
223
+ * fresh interp carriers.
224
+ */
225
+ plainVars?: V;
226
+ /** T.A6 — the per-leaf refresh-writer plan backing {@link plainVars}. */
227
+ _plainProj?: PlainProjection | undefined;
204
228
  transform: TransformFunction<V>;
205
229
  timingFunction: Easing;
206
230
  /**
@@ -234,14 +258,29 @@ export declare class AnimationGroup<V extends Vars> {
234
258
  /** Children-per-slice before `advanceTo()` yields to the main thread; larger
235
259
  * groups batch with a `scheduler.yield()` between slices (INP relief). */
236
260
  static readonly YIELD_BATCH = 32;
261
+ /** Construct a group from a first animation + rest (S.B4 / a06 F1/F2 — the
262
+ * genuine-ownership replacement for the excised `KeyframesAnimation.group()`
263
+ * service locator; each input is a bare animation or `{ animation, layer }`). */
264
+ static of<V extends Vars>(first: KeyframesAnimation<V> | AnimationGroupInput<V>, ...rest: (KeyframesAnimation<V> | AnimationGroupInput<V>)[]): AnimationGroup<V>;
237
265
  singleTarget: boolean;
266
+ /**
267
+ * T.A6 — true when the group's composite `transform` is a CUSTOM (non-DOM)
268
+ * consumer that expects the nested PLAIN authored-shape projection (the
269
+ * "animate any object" seam), inherited from the first child's own
270
+ * `unflatten` flag alongside its transform. False (the default) keeps the
271
+ * DOM-style default renderer's FLAT `_grouped` map, byte-unchanged.
272
+ */
273
+ unflatten: boolean;
238
274
  lastTickTime: number;
239
275
  /** THE rAF owner for the group's draw loop. */
240
276
  readonly playback: RAFPlayback;
241
277
  resolvePromise: ((value: void | PromiseLike<void>) => void) | null;
242
- private _playingPromise;
243
- /** Pre-bound frame callback — allocated once to avoid a per-loop closure. */
244
- private _boundFrame;
278
+ /** The ONE held play promise the `finished` front-door exposes. INTERNAL
279
+ * (S.B5) — read/written by the transport free functions in `./lifecycle`. */
280
+ _playingPromise: Promise<void> | null;
281
+ /** Pre-bound frame callback — allocated once to avoid a per-loop closure.
282
+ * INTERNAL (S.B5) — read by `./lifecycle`'s `play`/`resume` loop start. */
283
+ _boundFrame: (t: number) => boolean | Promise<boolean>;
245
284
  /** Cached entries sorted by layer zIndex (see `getEntries`). */
246
285
  private _entries;
247
286
  private _entriesDirty;
@@ -259,6 +298,13 @@ export declare class AnimationGroup<V extends Vars> {
259
298
  * `buildSoAPlans` in `./soa`, rebuilt ONLY on a structural change). INTERNAL
260
299
  * (R.W2) — read/written by `./compositor`. */
261
300
  _soaPlans: SoALayerPlan[] | null;
301
+ /**
302
+ * T.A6 — the group's PLAIN authored-shape projection (built from the
303
+ * composite `_grouped` leaf map when `unflatten` is set), rebuilt lazily on a
304
+ * structural change (the SAME `_groupedKeysDirty` seam that drops the SoA
305
+ * plan). Null until the first composited frame populates `_grouped`. INTERNAL
306
+ * — read/written by `./compositor`. */
307
+ _plainProj: PlainProjection | null;
262
308
  /** The long-lived SoA fold scratch — the contiguous numeric accumulate buffer,
263
309
  * sized to the WIDEST single-layer pair count once per structural change
264
310
  * (reused, zero per-frame alloc). INTERNAL (R.W2) — read by `./compositor`. */
@@ -301,35 +347,31 @@ export declare class AnimationGroup<V extends Vars> {
301
347
  private _frame;
302
348
  /** The post-advance render half of `_frame` — composite, or settle on done. */
303
349
  private _renderFrame;
304
- private _resolvePlay;
305
350
  /** The completion front-door (G.W13) — `await group.finished` resolves once
306
351
  * the in-flight composite play settles. Exposes the ONE held `_playingPromise`
307
352
  * (a settled/never-played group resolves immediately). */
308
353
  get finished(): Promise<void>;
309
354
  /** Start the group. Resolves when all children complete (or on stop/reset).
310
- * Re-entrant: an in-flight `play()` returns the same promise. Under
311
- * `respectReducedMotion` + an active query, snaps to final (no rAF loop). */
355
+ * Re-entrant, and PRM-aware — body in `./lifecycle` (S.B5 / a19 F1). */
312
356
  play(): Promise<void>;
313
- /** `prefers-reduced-motion` snap: rest = final, paint it, settle — the SAME
314
- * terminal path a completed play takes, motion elided. */
315
- private _playReducedMotion;
316
- /** Pause the group — idempotent. Pausing an already-paused (or not-yet-started)
317
- * group is a no-op, NOT a resume. Cancels the rAF loop + renders a final-frame
318
- * snapshot so the visual matches the pause moment. */
357
+ /** Pause the group — idempotent. Cancels the rAF loop + renders a final-frame
358
+ * snapshot so the visual matches the pause moment; records each child's
359
+ * jump-free `pausedTime`. Body in `./lifecycle` (S.B5). */
319
360
  pause(): this;
320
- /** Resume the group — idempotent. Unpauses every child DIRECTLY (not via
321
- * `child.resume()` — the group's draw loop owns the ticking) + re-registers it. */
361
+ /** Resume the group — idempotent. Unpauses every child DIRECTLY (the group's
362
+ * draw loop owns the ticking). Body in `./lifecycle` (S.B5). */
322
363
  resume(): this;
323
364
  /** The explicit flip: pauses if playing, resumes if paused. */
324
365
  toggle(): this;
325
366
  /** Pure state teardown — never paints. Releases every child (`managed = false`,
326
- * `child.settle()`) and clears the group flags, leaving the rest frame painted. */
367
+ * `child.settle()`) and clears the group flags. Body in `./lifecycle` (S.B5). */
327
368
  settle(): this;
328
369
  /** Explicit rewind: paint every started child back to its INITIAL frame, then
329
- * settle — the user-facing "return to start" (completion does NOT come here). */
370
+ * settle — the user-facing "return to start". Body in `./lifecycle` (S.B5). */
330
371
  reset(): this;
331
372
  /** Halt the draw loop, rewind to the initial frame (the transport-stop
332
- * semantic the demo's controls expect), and resolve any pending `play()`. */
373
+ * semantic the demo's controls expect), and resolve any pending `play()`.
374
+ * Body in `./lifecycle` (S.B5). */
333
375
  stop(): this;
334
376
  playing(): boolean;
335
377
  /** Set layer config for an animation by name or reference. Chainable. */
@@ -582,8 +624,26 @@ export declare interface CompiledCSS {
582
624
  refusals: CompileRefusal[];
583
625
  }
584
626
 
627
+ /** The entry compile result — the artifact + the refusal report. */
628
+ export declare interface CompiledEntryCSS {
629
+ /** The zero-runtime CSS: base rule + open rule + `@starting-style` per selector. */
630
+ css: string;
631
+ /** True iff EVERY selector compiled faithfully. */
632
+ eligible: boolean;
633
+ /** One refusal per selector that could not compile as a two-endpoint transition. */
634
+ refusals: EntryRefusal[];
635
+ }
636
+
637
+ /** The VT compile result — the artifact + the widened refusal report + the names. */
638
+ export declare interface CompiledViewTransitionCSS extends Omit<CompiledCSS, "refusals"> {
639
+ /** One refusal per role that could not compile faithfully (CC-3 ∪ the VT four). */
640
+ refusals: VTCompileRefusal[];
641
+ /** The `view-transition-name` set the consumer assigns to its elements. */
642
+ names: string[];
643
+ }
644
+
585
645
  /** The input shapes `compileToCSS` accepts. */
586
- export declare type CompileInput<V extends Vars = any> = AnimationGroup<V> | Sequence<V> | ReadonlyArray<KeyframesAnimation<V> | {
646
+ export declare type CompileInput<V extends Vars = Vars> = AnimationGroup<V> | Sequence<V> | ReadonlyArray<KeyframesAnimation<V> | {
587
647
  animation: KeyframesAnimation<V>;
588
648
  }>;
589
649
 
@@ -647,6 +707,33 @@ export declare type CompileRefusalReason = "weighted-blend" | "custom-renderer"
647
707
  */
648
708
  declare function compileToCSS<V extends Vars>(input: CompileInput<V>, opts?: CompileOptions): Promise<CompiledCSS>;
649
709
 
710
+ /**
711
+ * THE ENTRY/EXIT EMITTER (C-22 revised, P2-2) — compile a selector-keyed
712
+ * entry/exit spec to zero-runtime `@starting-style` + `allow-discrete` CSS. Emits
713
+ * per selector: the base/closed rule (exit endpoint + `display:none` + the exit
714
+ * transition list), the open rule (enter endpoint + `display` + the entry list),
715
+ * and the `@starting-style` block (enter's FIRST frame). Asymmetric entry/exit
716
+ * timing rides the two lists; `linear()` springs ride verbatim; color endpoints
717
+ * canonicalize to `oklab()`. REFUSES with a NAMED reason (3 inherited + 6
718
+ * entry-specific) what cannot compile as a two-endpoint transition.
719
+ *
720
+ * @returns `{ css, eligible, refusals }`.
721
+ */
722
+ declare function compileToEntry<V extends Vars>(spec: Record<string, EntryRoleSpec<V>>, opts?: EntryCompileOptions): Promise<CompiledEntryCSS>;
723
+
724
+ /**
725
+ * THE VIEW-TRANSITIONS EMITTER (SF-1/SF-2/SF-3) — compile a name-keyed role spec
726
+ * to a zero-runtime `::view-transition-*` CSS artifact. Emits per name: the
727
+ * old/new `@keyframes` + shorthand, the MANDATORY timing-only group override, an
728
+ * optional class-cohort rule, wrapped in `:active-view-transition-type(...)` when
729
+ * `types` are given; prepends the cross-doc preamble under `crossDocument`; and
730
+ * appends the PRM `animation: none` degrade by default. REFUSES with a NAMED
731
+ * reason (the CC-3 four ∪ the VT four) what cannot round-trip faithfully.
732
+ *
733
+ * @returns `{ css, eligible, refusals, names }` — the artifact + the trust surface.
734
+ */
735
+ declare function compileToViewTransition<V extends Vars>(spec: Record<string, VTRoleSpec<V>>, opts?: ViewTransitionCompileOptions): Promise<CompiledViewTransitionCSS>;
736
+
650
737
  /**
651
738
  * The CSS `animation-composition` operator (K.W7). Distinct from
652
739
  * {@link BlendMode} (the GROUP's per-LAYER blend tier — `replace`/`add`/
@@ -692,6 +779,20 @@ export declare function createNativeTimeline(spec: NativeTimelineSpec): Animatio
692
779
  */
693
780
  declare function createScrollScene(spec?: ScrollSceneOptions | CSSTimelineOptions): ScrollScene;
694
781
 
782
+ /**
783
+ * Construct a `TriggerScene` from a parsed `AnimationTriggerValue` OR a full
784
+ * `CSSTimelineOptions` (the {@link parseScrollCSS} output — the `.trigger` field
785
+ * is used). The CSS-fed construction is the round-trip's driving half (parse →
786
+ * behavior); the value-fed construction is value.js-INDEPENDENT.
787
+ *
788
+ * @example
789
+ * // grammar → behavior (the round-trip):
790
+ * const opts = parseScrollCSS(stylesheet); // { …, trigger: { type: "repeat", range } }
791
+ * const scene = createTriggerScene(opts);
792
+ * scene.triggerProgress(0.5); // → "active"
793
+ */
794
+ declare function createTriggerScene(spec?: AnimationTriggerValue | CSSTimelineOptions): TriggerScene;
795
+
695
796
  export declare class CSSKeyframesAnimation<V extends Vars> extends KeyframesAnimation<V> {
696
797
  /**
697
798
  * Q.WD1-bind S2 (DM-22) — the timeline a scroll-range named selector resolves
@@ -750,7 +851,6 @@ export declare class CSSKeyframesAnimation<V extends Vars> extends KeyframesAnim
750
851
  */
751
852
  scrollOptions?: CSSTimelineOptions;
752
853
  fromString(keyframes: string, transform?: TransformFunction<V>): this;
753
- transform(vars: V): void;
754
854
  }
755
855
 
756
856
  declare function CSSKeyframesToString<V extends Vars>(animation: KeyframesAnimation<V>, name?: string, printWidth?: number | undefined): Promise<string>;
@@ -1155,18 +1255,8 @@ export declare type DragSubscriber = (value: number, velocity: number) => void;
1155
1255
  * is the factory: `new DrawSVG(target).animation` is the control handle. The
1156
1256
  * factory is the canonical entry; this is a thin ergonomic wrapper.
1157
1257
  */
1158
- declare class DrawSVG<V extends Record<string, any> = any> {
1159
- /** The underlying stroke-dashoffset animation — the control handle. */
1160
- readonly animation: CSSKeyframesAnimation<V>;
1258
+ declare class DrawSVG<V extends Vars = Vars> extends SVGAnimationHandle<V> {
1161
1259
  constructor(target: SVGDrawTarget, options?: DrawSVGOptions);
1162
- /** Start (or re-enter) the line-drawing play loop. */
1163
- play(): Promise<void>;
1164
- /** Pause the play loop, retaining the playhead. */
1165
- pause(): this;
1166
- /** Halt and rewind the play loop. */
1167
- stop(): this;
1168
- /** Resolve once the draw completes — the {@link Animation.finished} front-door. */
1169
- get finished(): Promise<void>;
1170
1260
  }
1171
1261
 
1172
1262
  export declare interface DrawSVGOptions extends Partial<InputAnimationOptions> {
@@ -1264,6 +1354,41 @@ declare const enterPresets: {
1264
1354
  readonly jumpUp: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1265
1355
  };
1266
1356
 
1357
+ /** Options for {@link compileToEntry}. */
1358
+ export declare interface EntryCompileOptions {
1359
+ /** The open-state selector suffix, concatenated onto the base selector. Default `".open"`. */
1360
+ openSelector?: ".open" | "[data-open]" | ":popover-open" | "[open]" | (string & {});
1361
+ /** The open `display` value (the base rule is always `display: none`). Default `"block"`. */
1362
+ display?: string;
1363
+ /**
1364
+ * Emit `overlay <dur> allow-discrete` on both lists (default `true`). Emitted
1365
+ * UNCONDITIONALLY — it materializes only for top-layer elements (popover/
1366
+ * dialog), inert-but-harmless elsewhere, so a caller rarely turns it off.
1367
+ */
1368
+ overlay?: boolean;
1369
+ /** Prettier print-width for the emitted artifact. Omit for the default. */
1370
+ printWidth?: number;
1371
+ }
1372
+
1373
+ /** A single entry refusal — the selector + a typed reason + a human message. */
1374
+ export declare interface EntryRefusal {
1375
+ /** The refused selector (spec key). */
1376
+ name: string;
1377
+ reason: EntryRefusalReason;
1378
+ message: string;
1379
+ }
1380
+
1381
+ /** The refusal taxonomy — 3 inherited + 6 entry-specific (P2-2.3). */
1382
+ 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";
1383
+
1384
+ /** The per-selector entry/exit role. Each animation is 2-stop (a transition endpoint pair). */
1385
+ export declare interface EntryRoleSpec<V extends Vars = Vars> {
1386
+ /** The ENTER animation: first frame → `@starting-style`, last frame → the open rule. */
1387
+ enter?: KeyframesAnimation<V>;
1388
+ /** The EXIT animation: last frame → the closed rule. Defaults to `enter` REVERSED. */
1389
+ exit?: KeyframesAnimation<V>;
1390
+ }
1391
+
1267
1392
  /** Exit animations — take an element OUT of view. */
1268
1393
  declare const exitPresets: {
1269
1394
  readonly fadeOut: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
@@ -1326,20 +1451,6 @@ export declare interface FlipOptions {
1326
1451
  transformOrigin?: string;
1327
1452
  }
1328
1453
 
1329
- /**
1330
- * The card-flip attention preset.
1331
- *
1332
- * ── PKG-3 RENAME (L.W8 §S4 · audit W126). Formerly the preset `flip`. Renamed
1333
- * `flip` → `flipPreset` because the rolled-up `dist/keyframes.d.ts` placed this
1334
- * preset (reachable as `presets.flip`) and the LIGHT top-level `flip` export
1335
- * (the FLIP-layout helper in `flip.ts`) under the same name `flip`, so API
1336
- * Extractor renamed this one with a numeric suffix and re-exported it under the
1337
- * `flip` name inside the `AnimationPresets` namespace — a numeric-suffixed alias
1338
- * `proof:pkg3-clean` greps for. Naming the preset `flipPreset` (distinct from the
1339
- * light `flip`) clears the collision. BREAKING (5.0.0): the access path is now
1340
- * `presets.flipPreset`; the nested taxonomy key `attentionPresets.flip` is
1341
- * unchanged (a property name, not a top-level declaration — no collision).
1342
- */
1343
1454
  declare const flipPreset: (options?: InputAnimationOptions) => CSSKeyframesAnimation< Vars>;
1344
1455
 
1345
1456
  /**
@@ -1360,7 +1471,7 @@ export declare function flipShared(a: HTMLElement, b: HTMLElement, options?: Fli
1360
1471
 
1361
1472
  declare function formatCSSKeyframeString(keyframe: string): string;
1362
1473
 
1363
- declare class FrameCompiler<V extends Vars = any> {
1474
+ declare class FrameCompiler<V extends Vars = Vars> {
1364
1475
  private readonly _options;
1365
1476
  templateFrames: TemplateAnimationFrame<V>[];
1366
1477
  parsedVars: ParsedVarMap[];
@@ -1446,7 +1557,7 @@ declare class FrameCompiler<V extends Vars = any> {
1446
1557
  * ONCE, set `stroke-dasharray` to that length (one solid full-length dash), and
1447
1558
  * sweep `stroke-dashoffset` from → to (default `0% → 100%` ⇒ offset `L → 0`,
1448
1559
  * the line draws in). Returns the constructed {@link CSSKeyframesAnimation} as
1449
- * the control handle (the `animate()` contract — `.play()` / `.pause()` /
1560
+ * the control handle (the control-handle contract — `.play()` / `.pause()` /
1450
1561
  * `.stop()` / `.finished`), consistent with the `from*` factory family.
1451
1562
  *
1452
1563
  * The returned animation passes the EXISTING WAAPI eligibility gate
@@ -1465,7 +1576,7 @@ declare class FrameCompiler<V extends Vars = any> {
1465
1576
  * // Draw a path stroke in over 2s:
1466
1577
  * fromDrawSVG(pathEl, { duration: 2000 });
1467
1578
  */
1468
- declare function fromDrawSVG<V extends Record<string, any> = any>(target: SVGDrawTarget, options?: DrawSVGOptions): CSSKeyframesAnimation<V>;
1579
+ declare function fromDrawSVG<V extends Vars = Vars>(target: SVGDrawTarget, options?: DrawSVGOptions): CSSKeyframesAnimation<V>;
1469
1580
 
1470
1581
  /**
1471
1582
  * K1 — `fromLiveAnimations`: adopt every RUNNING CSS animation on the document
@@ -1480,14 +1591,14 @@ declare function fromDrawSVG<V extends Record<string, any> = any>(target: SVGDra
1480
1591
  * rule, running or not): `fromLiveAnimations` narrows to the names currently
1481
1592
  * RUNNING on the page — the animations a user actually sees in motion.
1482
1593
  */
1483
- declare const fromLiveAnimations: <V extends Vars = any>(target?: Document | Element, options?: IngestOptions) => IngestResult<V>;
1594
+ declare const fromLiveAnimations: <V extends Vars = Vars>(target?: Document | Element, options?: IngestOptions) => IngestResult<V>;
1484
1595
 
1485
1596
  /**
1486
1597
  * Build an SVG path-shape morph: sample two `d` strings at `samples` uniform
1487
1598
  * arc-length steps each, pair the point sets, and interpolate the `(x, y)`
1488
1599
  * pairs from the `from`-polyline (`0%`) to the `to`-polyline (`100%`). Returns
1489
1600
  * the constructed {@link CSSKeyframesAnimation} as the control handle (the
1490
- * `animate()` contract — `.play()` / `.pause()` / `.stop()` / `.finished`),
1601
+ * control-handle contract — `.play()` / `.pause()` / `.stop()` / `.finished`),
1491
1602
  * consistent with the `from*` factory family.
1492
1603
  *
1493
1604
  * value.js's `PathGeometry` owns the geometry (the `d`-parse + arc-length
@@ -1517,13 +1628,13 @@ declare const fromLiveAnimations: <V extends Vars = any>(target?: Document | Ele
1517
1628
  * // morphing shape paints directly (no author-side reader needed on Chromium/
1518
1629
  * // Safari; `<path style="d: var(--morph-d)">` is the Firefox-lags fallback).
1519
1630
  */
1520
- declare function fromMorphSVG<V extends Record<string, any> = any>(from: string, to: string, options?: MorphSVGOptions): CSSKeyframesAnimation<V>;
1631
+ declare function fromMorphSVG<V extends Vars = Vars>(from: string, to: string, options?: MorphSVGOptions): CSSKeyframesAnimation<V>;
1521
1632
 
1522
1633
  /**
1523
1634
  * Build a CSS-native path-motion animation: set the author `offset-path` (and
1524
1635
  * optional `offset-rotate`) on the target(s), and sweep `offset-distance` from
1525
1636
  * → to. Returns the constructed {@link CSSKeyframesAnimation} as the control
1526
- * handle (the `animate()` contract — `.play()` / `.pause()` / `.stop()` / the
1637
+ * handle (the control-handle contract — `.play()` / `.pause()` / `.stop()` / the
1527
1638
  * awaitable play promise), consistent with the `from*` factory family.
1528
1639
  *
1529
1640
  * The returned animation passes the EXISTING WAAPI eligibility gate
@@ -1541,7 +1652,7 @@ declare function fromMorphSVG<V extends Record<string, any> = any>(from: string,
1541
1652
  * duration: 2000,
1542
1653
  * });
1543
1654
  */
1544
- declare function fromMotionPath<V extends Record<string, any> = any>(target: HTMLElement | HTMLElement[], options: MotionPathOptions): CSSKeyframesAnimation<V>;
1655
+ declare function fromMotionPath<V extends Vars = Vars>(target: HTMLElement | HTMLElement[], options: MotionPathOptions): CSSKeyframesAnimation<V>;
1545
1656
 
1546
1657
  /**
1547
1658
  * K1 — `fromStyleSheets`: the consumer-facing front door over
@@ -1556,7 +1667,7 @@ declare function fromMotionPath<V extends Record<string, any> = any>(target: HTM
1556
1667
  * pulse?.setTargets(el).play(); // re-drive the page's OWN animation
1557
1668
  * for (const d of diagnostics) console.warn(d.code, d.message); // honest skips
1558
1669
  */
1559
- declare const fromStyleSheets: <V extends Vars = any>(source?: Document | ShadowRoot | CSSStyleSheet[] | CSSStyleSheet, options?: IngestOptions) => IngestResult<V>;
1670
+ declare const fromStyleSheets: <V extends Vars = Vars>(source?: Document | ShadowRoot | CSSStyleSheet[] | CSSStyleSheet, options?: IngestOptions) => IngestResult<V>;
1560
1671
 
1561
1672
  declare const glow: (options?: InputAnimationOptions) => CSSKeyframesAnimation< Vars>;
1562
1673
 
@@ -1574,7 +1685,7 @@ declare const hover: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
1574
1685
  * rows for THIS rule (a malformed body → `PARSE_ERROR`, etc.); the walk-level
1575
1686
  * rows (`CORS_SKIP`) ride {@link IngestResult.diagnostics}.
1576
1687
  */
1577
- export declare interface IngestedAnimation<V extends Vars = any> {
1688
+ export declare interface IngestedAnimation<V extends Vars = Vars> {
1578
1689
  /** The `@keyframes` identifier (CSSOM `CSSKeyframesRule.name`). */
1579
1690
  name: string;
1580
1691
  /** The reconstructed kf animation — replay-equal to the source CSS. */
@@ -1607,7 +1718,7 @@ export declare interface IngestOptions {
1607
1718
  * `animations` for the recovered objects and `diagnostics` for the citable
1608
1719
  * reasons the walk could not complete a step faithfully — NEVER a silent drop.
1609
1720
  */
1610
- export declare interface IngestResult<V extends Vars = any> {
1721
+ export declare interface IngestResult<V extends Vars = Vars> {
1611
1722
  /** Every `@keyframes` rule reconstructed, keyed by its CSS name. */
1612
1723
  animations: Map<string, IngestedAnimation<V>>;
1613
1724
  /**
@@ -1650,7 +1761,7 @@ declare const jumpUp: (options?: InputAnimationOptions) => CSSKeyframesAnimation
1650
1761
  * leaking a suffixed collision alias into the d.ts. The legacy `Animation`
1651
1762
  * re-export alias was DROPPED in 5.0.0 (Q.WE1 — NO-LEGACY).
1652
1763
  */
1653
- export declare class KeyframesAnimation<V extends Vars = any> {
1764
+ export declare class KeyframesAnimation<V extends Vars = Vars> {
1654
1765
  id: number;
1655
1766
  name: string | undefined;
1656
1767
  superKey: string | undefined;
@@ -1674,10 +1785,22 @@ export declare class KeyframesAnimation<V extends Vars = any> {
1674
1785
  * the excised `PlaybackHost` interface; the `./playback` free functions now
1675
1786
  * own them via `this._playback` directly (no cast, no re-publication). */
1676
1787
  readonly _playback: PlaybackState;
1677
- startTime: number | undefined;
1678
- pausedTime: number;
1679
- t: number;
1680
- iteration: number;
1788
+ get startTime(): number | undefined;
1789
+ set startTime(v: number | undefined);
1790
+ get pausedTime(): number;
1791
+ set pausedTime(v: number);
1792
+ get t(): number;
1793
+ set t(v: number);
1794
+ get iteration(): number;
1795
+ set iteration(v: number);
1796
+ get started(): boolean;
1797
+ set started(v: boolean);
1798
+ get done(): boolean;
1799
+ set done(v: boolean);
1800
+ get reversed(): boolean;
1801
+ set reversed(v: boolean);
1802
+ get paused(): boolean;
1803
+ set paused(v: boolean);
1681
1804
  /** Structured parse/honoring diagnostics (K.W7 S4) — a FLAT additive array
1682
1805
  * of stable-coded {@link Diagnostic} rows surfaced from `resolveKeyframes` +
1683
1806
  * the engine's composition-fallback rows; empty on a clean parse. Every
@@ -1694,10 +1817,6 @@ export declare class KeyframesAnimation<V extends Vars = any> {
1694
1817
  /** True once a non-`replace` operator was seen — the hot path skips ALL
1695
1818
  * composition work when false. INTERNAL — read by `./interpolate` (R.W2). */
1696
1819
  _hasComposition: boolean;
1697
- started: boolean;
1698
- done: boolean;
1699
- reversed: boolean;
1700
- paused: boolean;
1701
1820
  /** True when an `AnimationGroup` drives this animation's `advanceTo()`/
1702
1821
  * `interpFrames()` from its own rAF loop. Standalone `.play()` throws when
1703
1822
  * set rather than racing the group. */
@@ -1811,7 +1930,6 @@ export declare class KeyframesAnimation<V extends Vars = any> {
1811
1930
  settle(): this;
1812
1931
  reset(): this;
1813
1932
  setTargets(...targets: HTMLElement[]): this;
1814
- group(...animations: KeyframesAnimation<V>[]): AnimationGroup<V>;
1815
1933
  }
1816
1934
 
1817
1935
  /**
@@ -1904,9 +2022,7 @@ export declare interface MorphRect {
1904
2022
  * that ALSO exposes {@link sampleD} — the morphed `d` string at a normalized
1905
2023
  * `t`, reassembled from the interpolated point coordinates.
1906
2024
  */
1907
- declare class MorphSVG<V extends Record<string, any> = any> {
1908
- /** The underlying coordinate-interpolating animation — the control handle. */
1909
- readonly animation: CSSKeyframesAnimation<V>;
2025
+ declare class MorphSVG<V extends Vars = Vars> extends SVGAnimationHandle<V> {
1910
2026
  /** The uniform-sample count (point pairs = samples + 1). */
1911
2027
  readonly samples: number;
1912
2028
  constructor(from: string, to: string, options?: MorphSVGOptions);
@@ -1918,14 +2034,6 @@ declare class MorphSVG<V extends Record<string, any> = any> {
1918
2034
  * from BOTH endpoint polylines at any interior `t`.
1919
2035
  */
1920
2036
  sampleD(t: number): string;
1921
- /** Start (or re-enter) the morph play loop. */
1922
- play(): Promise<void>;
1923
- /** Pause the play loop, retaining the playhead. */
1924
- pause(): this;
1925
- /** Halt and rewind the play loop. */
1926
- stop(): this;
1927
- /** Resolve once the morph completes — the {@link Animation.finished} front-door. */
1928
- get finished(): Promise<void>;
1929
2037
  }
1930
2038
 
1931
2039
  export declare interface MorphSVGOptions extends Partial<InputAnimationOptions> {
@@ -1992,16 +2100,8 @@ declare interface MorphValues {
1992
2100
  * the factory: `new MotionPath(target, { path }).animation` is the control
1993
2101
  * handle. The factory is the canonical entry; this is a thin ergonomic wrapper.
1994
2102
  */
1995
- declare class MotionPath<V extends Record<string, any> = any> {
1996
- /** The underlying offset-distance animation — the control handle. */
1997
- readonly animation: CSSKeyframesAnimation<V>;
2103
+ declare class MotionPath<V extends Vars = Vars> extends SVGAnimationHandle<V> {
1998
2104
  constructor(target: HTMLElement | HTMLElement[], options: MotionPathOptions);
1999
- /** Start (or re-enter) the path-motion play loop. */
2000
- play(): Promise<void>;
2001
- /** Pause the play loop, retaining the playhead. */
2002
- pause(): this;
2003
- /** Halt and rewind the play loop. */
2004
- stop(): this;
2005
2105
  }
2006
2106
 
2007
2107
  export declare interface MotionPathOptions extends Partial<InputAnimationOptions> {
@@ -2253,10 +2353,16 @@ export declare interface OscillatorConfig {
2253
2353
  * phase clock, NOT a CSS value parser, so it carries ZERO static edge to
2254
2354
  * `@mkbabb/value.js` (proof:boundary gates it as a value.js-free LIGHT entry).
2255
2355
  *
2256
- * The consume signal is glass-ui BB's `W-EASING-PRIMITIVE` wave — its speedtest
2257
- * idle-breath and the demo's `KF-OSCILLATOR` scene read the phase to drive a
2258
- * looping motion. glass-ui co-schedules; kf owns the phase math
2259
- * (`docs/tranches/L/waves/L.W9.md §S5`).
2356
+ * ── C-13 (S.G2 S12, fold row 56) — INTENTIONAL PUBLIC LEAF ─────────────────────
2357
+ * `Oscillator` is an intentional public LIGHT leaf: the phase math IS the product,
2358
+ * consumed EXTERNALLY (glass-ui BB's `W-EASING-PRIMITIVE` wave — its speedtest
2359
+ * idle-breath reads the phase to drive a looping motion; glass-ui co-schedules, kf
2360
+ * owns the phase math — `docs/tranches/L/waves/L.W9.md §S5`). It carries NO internal
2361
+ * demo scene: the former header claim of a "demo `KF-OSCILLATOR` scene" was fictional
2362
+ * (no such scene exists on disk), so the C-13 decision STRIPPED the claim rather than
2363
+ * build a scene disproportionate to a periodic phase clock — a published primitive
2364
+ * that stands on its own beside `SmoothProgress`/`SpringProgress`, gated LIGHT by
2365
+ * proof:boundary, needs no in-repo demo to justify its export.
2260
2366
  *
2261
2367
  * NO rAF ownership — the caller drives the loop. `tick(dt)` advances the phase
2262
2368
  * by `frequency × dt` (with `dt` in SECONDS from the caller's `RAFPlayback`
@@ -2323,12 +2429,36 @@ declare function pinCSS(opts?: {
2323
2429
  bottom?: number;
2324
2430
  }): string;
2325
2431
 
2432
+ declare interface PlainLeafWriter {
2433
+ /** The nested parent object the leaf lives on. */
2434
+ obj: Record<string, unknown>;
2435
+ /** The leaf's own (last dot-segment) key on `obj`. */
2436
+ key: string;
2437
+ /** The live `ValueUnit[]` whose `.value`(s) the interp stride mutates in place. */
2438
+ units: ValueUnit[];
2439
+ /**
2440
+ * True iff the leaf is a single unitless numeric unit → write `.value` (a
2441
+ * bare `number`, zero-alloc). False → a units/color/multi-component leaf,
2442
+ * projected to its authored STRING each refresh (the units/color residual).
2443
+ */
2444
+ numeric: boolean;
2445
+ }
2446
+
2447
+ declare interface PlainProjection {
2448
+ /** The nested plain object a custom `transform` consumes (`plainVars`). */
2449
+ root: Record<string, unknown>;
2450
+ /** The per-leaf refresh writers, in flat-key order. */
2451
+ writers: PlainLeafWriter[];
2452
+ }
2453
+
2326
2454
  /**
2327
- * The standalone-play machine's OWN run-state (R.W2 — replaces the
2328
- * `PlaybackHost` privacy-inversion interface). `KeyframesAnimation` composes
2329
- * ONE of these as a `readonly _playback` field, so the play-machine state has a
2330
- * single owner instead of being scattered as privates the class re-published
2331
- * through a cast:
2455
+ * `engine/playback-state.ts` — the `PlaybackState` run-state STORE, carved off
2456
+ * `engine/play-lifecycle.ts` at S.B2 on the STATE↔BEHAVIOR cohesion seam (the
2457
+ * play machine's free functions live in `./play-lifecycle`; the state they mutate lives
2458
+ * HERE). A value.js-free leaf struct: it owns the standalone-play machine's OWN
2459
+ * run-state so the state has a SINGLE owner instead of being scattered as
2460
+ * privates the class re-published through a cast (R.W2 dissolved the
2461
+ * `PlaybackHost` privacy-inversion).
2332
2462
  *
2333
2463
  * - `resolvePromise` — the standalone-loop deferred resolver (`playRAF`
2334
2464
  * arms it, `resolvePlay` fires it).
@@ -2340,6 +2470,20 @@ declare function pinCSS(opts?: {
2340
2470
  * re-bound per loop (the per-loop-closure-free idiom).
2341
2471
  * - `_interpOut` — the ONE hoisted interp buffer the play loop reuses
2342
2472
  * every frame (zero-alloc steady state).
2473
+ *
2474
+ * ── S.B2 (C-15) — PlaybackState is the SOLE STORAGE for the run-state FSM.
2475
+ * The eight transition fields (`started`/`done`/`paused`/`reversed`/`iteration`/
2476
+ * `t`/`startTime`/`pausedTime`) fold OFF the `KeyframesAnimation` class body and
2477
+ * live HERE as the single backing store; the class exposes them as accessor
2478
+ * delegates over `this._playback.*` (so the FSM stays a public, externally-written
2479
+ * surface — `group/`, `sequence/`, `ingest/`, `waapi/`, the tests, and the demo's
2480
+ * `contractAnim.t =` writes all keep working through the accessors). The
2481
+ * engine-INTERNAL hot path reads/writes `anim._playback.*` DIRECTLY (one extra
2482
+ * monomorphic load — a shape cost, not an allocation; proof:standalone-zero-alloc
2483
+ * / proof:interp-fastprops stay green). `managed` is deliberately NOT here — it is
2484
+ * loop-OWNERSHIP, not run-state, and never resets in `settle`. The literal
2485
+ * single-WRITER hard fold (a public `seek(ms)` verb + MIGRATION) is a future
2486
+ * BREAKING wave (§8-3), out of S scope.
2343
2487
  */
2344
2488
  declare class PlaybackState {
2345
2489
  resolvePromise: ((value: void | PromiseLike<void>) => void) | null;
@@ -2347,6 +2491,14 @@ declare class PlaybackState {
2347
2491
  _waAnimations: globalThis.Animation[];
2348
2492
  readonly _boundFrame: (t: number) => boolean | Promise<boolean>;
2349
2493
  readonly _interpOut: Record<string, unknown>;
2494
+ startTime: number | undefined;
2495
+ pausedTime: number;
2496
+ t: number;
2497
+ iteration: number;
2498
+ started: boolean;
2499
+ done: boolean;
2500
+ reversed: boolean;
2501
+ paused: boolean;
2350
2502
  constructor(frameCb: (t: number) => boolean | Promise<boolean>);
2351
2503
  }
2352
2504
 
@@ -2709,7 +2861,7 @@ export declare function resolveEasing(name: string): Promise<Easing>;
2709
2861
  * normalises a STRING of CSS, `resolveLiveKeyframes` normalises the LIVE CSSOM —
2710
2862
  * the parser pointed forward at the web the page already ships.
2711
2863
  */
2712
- declare const resolveLiveKeyframes: <V extends Vars = any>(source?: Document | ShadowRoot | CSSStyleSheet[] | CSSStyleSheet, options?: IngestOptions) => IngestResult<V>;
2864
+ declare const resolveLiveKeyframes: <V extends Vars = Vars>(source?: Document | ShadowRoot | CSSStyleSheet[] | CSSStyleSheet, options?: IngestOptions) => IngestResult<V>;
2713
2865
 
2714
2866
  /**
2715
2867
  * Resolve a parsed `AnimationRangeValue` (or `undefined` → the whole [0,1]
@@ -2896,7 +3048,7 @@ declare type ScrollTimelineAxis = "block" | "inline" | "x" | "y";
2896
3048
  * and drives them via `Animation.advanceTo`. See the module docstring for the
2897
3049
  * booked name + subsumption decision.
2898
3050
  */
2899
- export declare class Sequence<V extends Vars = any> implements SequencePlayContext<V> {
3051
+ export declare class Sequence<V extends Vars = Vars> implements SequencePlayContext<V> {
2900
3052
  /** Resolved segments, in insertion order. */
2901
3053
  readonly entries: SequenceEntry<V>[];
2902
3054
  /** Named positions on the master clock, registered via {@link label}. */
@@ -2916,13 +3068,13 @@ export declare class Sequence<V extends Vars = any> implements SequencePlayConte
2916
3068
  private cursor;
2917
3069
  /** Master clock (ms) of the current playhead. */
2918
3070
  _time: number;
2919
- private readonly respectReducedMotion;
3071
+ /* Excluded from this release type: respectReducedMotion */
2920
3072
  /** THE rAF owner for the sequence's play loop. */
2921
3073
  readonly playback: RAFPlayback;
2922
- private _boundFrame;
3074
+ /* Excluded from this release type: _boundFrame */
2923
3075
  _resolvePlay: (() => void) | null;
2924
3076
  _playOrigin: number | undefined;
2925
- private _playingPromise;
3077
+ /* Excluded from this release type: _playingPromise */
2926
3078
  /**
2927
3079
  * The scalar playback rate — the single field that drives `timeScale`
2928
3080
  * and `reverse`. `_rate = 1` is real-time forward (the existing
@@ -3012,17 +3164,6 @@ export declare class Sequence<V extends Vars = any> implements SequencePlayConte
3012
3164
  * set on each `animation` directly before `.add`. Chainable.
3013
3165
  */
3014
3166
  setTargets(...targets: HTMLElement[]): this;
3015
- /**
3016
- * Drive the sequence over real time via `RAFPlayback`. Each child is driven
3017
- * through the published `Animation.advanceTo(absoluteClock)` map: its
3018
- * `startTime` is seeded to its resolved `at`, so `advanceTo(masterClock)`
3019
- * yields the child's local clock as `masterClock − at` exactly. Resolves
3020
- * when the master playhead passes the sequence `duration`.
3021
- *
3022
- * Re-entrant: a `play()` while one is in flight returns the same promise.
3023
- * Under `respectReducedMotion` + an active query, snaps to the rest frame
3024
- * in one paint (a terminal `seek(duration)`), no draw loop.
3025
- */
3026
3167
  /**
3027
3168
  * The completion front-door (G.W13) — `await sequence.finished` resolves
3028
3169
  * once the in-flight transport settles. Exposes the ONE held
@@ -3032,55 +3173,34 @@ export declare class Sequence<V extends Vars = any> implements SequencePlayConte
3032
3173
  * sequence resolves immediately.
3033
3174
  */
3034
3175
  get finished(): Promise<void>;
3176
+ /** Drive the sequence over real time via `RAFPlayback` — re-entrant, and
3177
+ * PRM-aware. Body in `./lifecycle` (S.B5). */
3035
3178
  play(): Promise<void>;
3036
3179
  _frame(clock: number): Promise<boolean>;
3037
- private _reanchor;
3038
- private _settle;
3039
- /** Halt the play loop where it stands and resolve any pending `play()`. */
3180
+ /** Halt the play loop where it stands and resolve any pending `play()`.
3181
+ * Body in `./lifecycle` (S.B5). */
3040
3182
  stop(): this;
3041
- /**
3042
- * Halt the play loop where it stands WITHOUT releasing the playhead — the
3043
- * managed-pause contract. The rAF loop stops; `_time` and the play promise
3044
- * are RETAINED (children stay `managed`, unlike `stop()`/`_settle`), so a
3045
- * later {@link resume} continues from exactly here. No-op when not playing
3046
- * or already paused. Chainable.
3047
- */
3183
+ /** Halt the play loop WITHOUT releasing the playhead — the managed-pause
3184
+ * contract (`_time` + the play promise are retained for `resume`). No-op when
3185
+ * not playing or already paused. Body in `./lifecycle` (S.B5). */
3048
3186
  pause(): this;
3049
- /**
3050
- * Resume a paused sequence — restart the rAF loop with the origin
3051
- * re-anchored so the FIRST resumed frame's master clock equals the
3052
- * retained `_time` (the no-forward-jump re-anchor, the same `RAFPlayback`/
3053
- * `AnimationGroup` managed-pause contract — `src/animation/CLAUDE.md`
3054
- * §Managed-child lifecycle). No-op when not paused. Chainable.
3055
- */
3187
+ /** Resume a paused sequence — restart the rAF loop with the origin
3188
+ * re-anchored so the first resumed frame's master clock equals the retained
3189
+ * `_time` (no forward jump). No-op when not paused. Body in `./lifecycle`. */
3056
3190
  resume(): this;
3057
- /**
3058
- * Set the scalar playback rate — slow-mo (`< 1`), real-time (`1`),
3059
- * fast-forward (`> 1`), or backward (`< 0`, the {@link reverse} form). The
3060
- * master clock is re-anchored so the playhead is CONTINUOUS at the
3061
- * rate-change instant (no jump) — the same re-anchor as {@link resume}.
3062
- * Takes effect immediately whether or not the sequence is playing.
3063
- * Chainable.
3064
- */
3191
+ /** Set the scalar playback rate — slow-mo (`< 1`), real-time (`1`),
3192
+ * fast-forward (`> 1`), or backward (`< 0`, the {@link reverse} form); the
3193
+ * master clock is re-anchored so the playhead is C⁰-continuous at the flip.
3194
+ * Body in `./lifecycle` (S.B5). */
3065
3195
  timeScale(n: number): this;
3066
- /**
3067
- * Flip the playback direction — the playhead walks backward from where it
3068
- * stands (a negative rate) or forward again, preserving `|rate|`. C⁰-
3069
- * continuous: the re-anchor keeps the playhead exactly where it is at the
3070
- * flip instant (locked by the F.W9 seek↔play parity gate). Chainable.
3071
- */
3196
+ /** Flip the playback direction — the playhead walks backward (negative rate)
3197
+ * or forward again, preserving `|rate|`, C⁰-continuous. Body in `./lifecycle`. */
3072
3198
  reverse(): this;
3073
- /**
3074
- * Set how many cycles `play()` runs before settling — `1` is single-play,
3075
- * `n` runs `n` cycles, `Infinity` loops forever (until `stop()`). The
3076
- * master clock folds modulo `duration` per cycle. Chainable.
3077
- */
3199
+ /** Set how many cycles `play()` runs before settling — `1` single-play, `n`
3200
+ * cycles, `Infinity` loops forever. Body in `./lifecycle` (S.B5). */
3078
3201
  repeat(count: number): this;
3079
- /**
3080
- * Toggle yoyo (ping-pong) — when on, odd cycles run reflected
3081
- * (`duration − phase`) so the playhead bounces back and forth across the
3082
- * `repeat` cycles. Chainable.
3083
- */
3202
+ /** Toggle yoyo (ping-pong) — odd cycles run reflected across the `repeat`
3203
+ * cycles. Body in `./lifecycle` (S.B5). */
3084
3204
  yoyo(on?: boolean): this;
3085
3205
  }
3086
3206
 
@@ -3383,12 +3503,129 @@ declare interface SoALayerPlan {
3383
3503
  * `add`/`weighted` blend stays byte-identical on the non-numeric tail. EMPTY
3384
3504
  * for the dominant all-numeric transform shape (every leaf a numeric
3385
3505
  * `ValueUnit[]`), so the whole `for..in` collapses to the SoA fold.
3386
- */
3387
- boxedKeys: string[];
3506
+ *
3507
+ * S.F5a S1 — a precomputed `Set`, built ONCE here at `buildSoAPlans`
3508
+ * (structural-change time). The compositor's boxed residual (`boxedBlendArm`)
3509
+ * takes it DIRECTLY as its `only` membership test — killing the per-frame
3510
+ * `new Set(only)` the boxed arm rebuilt every frame on the mixed-leaf shape
3511
+ * (the allocation is hoisted to plan-build time, `proof:zero-alloc`
3512
+ * mixed-leaf clause).
3513
+ */
3514
+ boxedKeys: Set<string>;
3388
3515
  }
3389
3516
 
3390
3517
  declare const spinner: (options?: InputAnimationOptions) => CSSKeyframesAnimation< Vars>;
3391
3518
 
3519
+ /** The split granularity. `"word"`/`"grapheme"` are layout-independent; `"line"`
3520
+ * is measure-or-refuse (SF-10). */
3521
+ export declare type SplitBy = "word" | "grapheme" | "line";
3522
+
3523
+ /**
3524
+ * Split a text element into an animatable fragment cohort + a ready stagger,
3525
+ * a11y-first. See {@link SplitTextOptions} / {@link SplitTextResult}.
3526
+ *
3527
+ * @param el — the text element to split (its `textContent` is the pre-split
3528
+ * string). For `by: "line"` it must be laid out, else the split refuses.
3529
+ * @param options — `{ by, a11y, role, locale, stagger, fragmentClass, onRefuse }`.
3530
+ * @throws {SplitTextRefusalError} `by: "line"` on an unmeasurable container.
3531
+ */
3532
+ export declare function splitText(el: HTMLElement, options?: SplitTextOptions): SplitTextResult;
3533
+
3534
+ export declare interface SplitTextOptions {
3535
+ /** Granularity — `"word"` (default), `"grapheme"`, or `"line"`. */
3536
+ by?: SplitBy;
3537
+ /**
3538
+ * A11Y-FIRST (default `true`): consolidate the accessible name onto the
3539
+ * container (`aria-label` = the pre-split string, over a naming role) and
3540
+ * mark every fragment `aria-hidden`, so AT reads the whole text as one label.
3541
+ * `false` leaves the split fragments in the a11y tree (opt-out for callers
3542
+ * that own their own AT handling).
3543
+ */
3544
+ a11y?: boolean;
3545
+ /**
3546
+ * The container role applied under `a11y` **only when the element has no
3547
+ * role of its own** — a plain `<div>`/`<span>` maps to `role="generic"`,
3548
+ * which PROHIBITS an author name, so a bare `aria-label` would not compute.
3549
+ * Defaults to `"img"` (the canonical "graphical composite whose text
3550
+ * alternative is …" role). Pass a naming-capable role to override.
3551
+ */
3552
+ role?: string;
3553
+ /** Locale for `Intl.Segmenter` (word/grapheme boundaries). */
3554
+ locale?: string;
3555
+ /** Options for the ready {@link StaggerFn} built over the cohort. */
3556
+ stagger?: StaggerOptions;
3557
+ /** Class set on each fragment element. Defaults to `"kf-split"`. */
3558
+ fragmentClass?: string;
3559
+ /**
3560
+ * `by: "line"` only — invoked when a resize-driven RE-measure cannot hold
3561
+ * (the container became unmeasurable or a container-query loop kept the line
3562
+ * map from converging). The observer disconnects and the last good map is
3563
+ * left in place; the caller decides whether to fall back to `by: "word"`.
3564
+ */
3565
+ onRefuse?: (error: SplitTextRefusalError) => void;
3566
+ }
3567
+
3568
+ /**
3569
+ * Thrown by `splitText(el, { by: "line" })` when the line measurement cannot be
3570
+ * taken (or held) — the typed half of the measure-or-refuse posture. Never
3571
+ * thrown for `by: "word"`/`"grapheme"` (those are layout-independent).
3572
+ */
3573
+ export declare class SplitTextRefusalError extends Error {
3574
+ readonly name = "SplitTextRefusalError";
3575
+ /** The machine-readable refusal cause. */
3576
+ readonly reason: SplitTextRefusalReason;
3577
+ constructor(reason: SplitTextRefusalReason, detail?: string);
3578
+ }
3579
+
3580
+ /**
3581
+ * The typed REFUSAL for `splitText`'s `by: "line"` measure-or-refuse posture
3582
+ * (SF-10 / S.F2 §S2). A line-split is layout-DEPENDENT: it groups fragments by
3583
+ * their measured `getClientRects` line box. When the container is not laid out
3584
+ * (detached, `display:none`, zero-width), or when a container-query/resize
3585
+ * feedback loop makes the measurement unable to converge, the ONLY honest
3586
+ * outcome is to REFUSE — never to emit a stale line map that silently goes wrong
3587
+ * on the next reflow (the exact failure mode this posture forbids).
3588
+ *
3589
+ * It is a distinct named error (mirroring `AnimationOptionError`) so a caller can
3590
+ * `instanceof`-narrow the refusal and fall back to `by: "word"` (layout-
3591
+ * independent) rather than swallow a generic throw.
3592
+ */
3593
+ /**
3594
+ * Why a `by: "line"` split refused to produce a line map:
3595
+ *
3596
+ * - `"unmeasurable"` — the container yielded no usable client rects at split
3597
+ * time (detached / `display:none` / zero-area). Lines cannot be grouped
3598
+ * without a laid-out box, and emitting an ungrouped (or all-collapsed) map
3599
+ * would be the silent-stale failure the posture forbids.
3600
+ * - `"unstable"` — a re-measure (driven by the resize observer) could not
3601
+ * hold: the container's own size depends on its content flow (a
3602
+ * container-query / intrinsic-size feedback loop), so the line grouping
3603
+ * oscillates and never converges. Refused rather than latched to a stale map.
3604
+ * - `"empty"` — there is no text to split into lines.
3605
+ */
3606
+ export declare type SplitTextRefusalReason = "unmeasurable" | "unstable" | "empty";
3607
+
3608
+ export declare interface SplitTextResult {
3609
+ /** The split container (the element passed in). */
3610
+ container: HTMLElement;
3611
+ /** The animatable fragment cohort, in source order. */
3612
+ fragments: HTMLElement[];
3613
+ /** The granularity that produced {@link fragments}. */
3614
+ by: SplitBy;
3615
+ /** The pre-split string — the container's consolidated accessible name. */
3616
+ text: string;
3617
+ /** A ready per-index delay generator over the cohort (the ready stagger). */
3618
+ stagger: StaggerFn;
3619
+ /** The materialized stagger delays, one per fragment (convenience). */
3620
+ delays: number[];
3621
+ /** Restore the container's original markup + a11y attributes. */
3622
+ revert(): void;
3623
+ /** `by: "line"` — re-measure + re-group the lines now (no-op otherwise). */
3624
+ remeasure(): void;
3625
+ /** Tear down the resize observer (does not revert the DOM). */
3626
+ dispose(): void;
3627
+ }
3628
+
3392
3629
  /**
3393
3630
  * The modern, time-based spring surface — the idiom Motion now leads its
3394
3631
  * docs with, treating `(response, dampingFraction)` as the advanced
@@ -3471,6 +3708,34 @@ export declare interface SpringLinearStopsOptions {
3471
3708
  maxDuration?: number;
3472
3709
  }
3473
3710
 
3711
+ /**
3712
+ * The managed-playback surface a `SpringProgress` exposes to the colocated
3713
+ * `./managed-play` loop helpers (S.B5 — the progress.ts ceiling carve). Declared
3714
+ * HERE (the spring family's ring-break home) so `managed-play.ts` drives the
3715
+ * spring's rAF loop through a structural contract WITHOUT importing the
3716
+ * `SpringProgress` class module — keeping the progress→managed-play edge
3717
+ * one-directional (no import cycle under `tsPreCompilationDeps`). The stepper is
3718
+ * a `Tickable` (the `RAFPlayback.drive` loop steps `tickDt` until `settled`); the
3719
+ * helpers additionally read its current `(value, velocity)` for the per-frame
3720
+ * callback and route the reduced-motion snap through `snap()`.
3721
+ */
3722
+ declare interface SpringPlayback extends Tickable {
3723
+ /** THE managed rAF driver the loop rides. */
3724
+ readonly _playback: RAFPlayback;
3725
+ /** The bound per-frame callback (`play` sets it; `stop` clears it). */
3726
+ _onFrame: SpringFrameCallback | undefined;
3727
+ /** True once `dispose()` has torn the spring down (a disposed spring never plays). */
3728
+ readonly disposed: boolean;
3729
+ /** Current position — passed to the per-frame callback. */
3730
+ readonly value: number;
3731
+ /** Current velocity — passed to the per-frame callback. */
3732
+ readonly velocity: number;
3733
+ /** The reduced-motion policy routing `play` to snap vs. run. */
3734
+ readonly respectReducedMotion: ReducedMotionPolicy;
3735
+ /** The reduced-motion snap (jump to target at zero velocity, settle, emit). */
3736
+ snap(): void;
3737
+ }
3738
+
3474
3739
  /** Spring-eased attention "pop" — the bouncy spring drives the scale pulse. */
3475
3740
  declare const springPop: (options?: InputAnimationOptions) => CSSKeyframesAnimation< Vars>;
3476
3741
 
@@ -3492,8 +3757,11 @@ declare const springPop: (options?: InputAnimationOptions) => CSSKeyframesAnimat
3492
3757
  *
3493
3758
  * API mirrors SwiftUI's `.spring(response:dampingFraction:)`.
3494
3759
  */
3495
- export declare class SpringProgress {
3760
+ export declare class SpringProgress implements SpringPlayback {
3496
3761
  private options;
3762
+ /** The reduced-motion policy — read by `./managed-play`'s `springPlay` to
3763
+ * route the snap vs. run branch (the {@link SpringPlayback} contract). */
3764
+ get respectReducedMotion(): ReducedMotionPolicy;
3497
3765
  private targetValue;
3498
3766
  private currentValue;
3499
3767
  private currentVelocity;
@@ -3520,10 +3788,10 @@ export declare class SpringProgress {
3520
3788
  private zeta;
3521
3789
  private omegaD;
3522
3790
  private subscribers;
3523
- private disposed;
3791
+ /* Excluded from this release type: disposed */
3524
3792
  private vectorLanes;
3525
- private _playback;
3526
- private _onFrame;
3793
+ readonly _playback: RAFPlayback;
3794
+ /* Excluded from this release type: _onFrame */
3527
3795
  constructor(options?: Partial<SpringProgressOptions>);
3528
3796
  /**
3529
3797
  * Construct a spring from the modern time-based surface
@@ -3640,21 +3908,15 @@ export declare class SpringProgress {
3640
3908
  /** Tear down the spring. Cancels the rAF loop and clears subscribers. */
3641
3909
  dispose(): void;
3642
3910
  /**
3643
- * Start a managed rAF loop that calls `tick(dt)` each frame until
3644
- * `settled`, invoking `onFrame(value, velocity)` per tick. Idempotent
3645
- * — repeat calls re-bind the callback without spawning a second loop.
3646
- * Once settled the loop auto-stops; setting `target` while a callback
3647
- * is bound auto-resumes the loop without needing another `.play()`.
3911
+ * Start a managed rAF loop that calls `tickDt(dt)` each frame until
3912
+ * `settled`, invoking `onFrame(value, velocity)` per tick. Idempotent;
3913
+ * PRM-aware (snaps under an active reduced-motion query). Body in
3914
+ * `./managed-play` (S.B5).
3648
3915
  */
3649
3916
  play(onFrame?: SpringFrameCallback): void;
3650
- /** Cancel the managed rAF loop and detach the per-frame callback. */
3917
+ /** Cancel the managed rAF loop and detach the per-frame callback. Body in
3918
+ * `./managed-play` (S.B5). */
3651
3919
  stop(): void;
3652
- /**
3653
- * Arm the shared driver: it steps `tickDt(dt)` once per frame until
3654
- * `settled` flips true, emitting `onFrame` per step. Idempotent —
3655
- * the driver no-ops while already running.
3656
- */
3657
- private _startLoop;
3658
3920
  }
3659
3921
 
3660
3922
  /**
@@ -3798,14 +4060,20 @@ declare const springWobble: (options?: InputAnimationOptions) => CSSKeyframesAni
3798
4060
  export declare function stagger(countOrItems: number | ArrayLike<unknown>, options?: StaggerOptions): StaggerFn;
3799
4061
 
3800
4062
  /**
3801
- * A per-index delay function: `(i, total) => delayMs`. Carries a
3802
- * `.delays(total)` helper that materializes the whole distribution as an
3803
- * array — convenient when the count is known up front.
4063
+ * A per-index delay function: `(i, total?) => delayMs`. Carries a
4064
+ * `.delays(total?)` helper that materializes the whole distribution as an
4065
+ * array — convenient when the count is known up front. Both `total` args are
4066
+ * OPTIONAL: the implementation defaults them to the construction-time count
4067
+ * (`stagger(items, …)` / `stagger(count, …)`), so `fn(i)` and `fn.delays()`
4068
+ * are valid — the type must mirror that (it did not before S.B7, which is why
4069
+ * `test/stagger.test.ts`'s defaulting assertions RED'd once `test/` joined the
4070
+ * typecheck).
3804
4071
  */
3805
4072
  export declare interface StaggerFn {
3806
- (index: number, total: number): number;
3807
- /** Materialize the delays for a run of `total` indices. */
3808
- delays(total: number): number[];
4073
+ (index: number, total?: number): number;
4074
+ /** Materialize the delays for a run of `total` indices (defaults to the
4075
+ * construction-time count). */
4076
+ delays(total?: number): number[];
3809
4077
  }
3810
4078
 
3811
4079
  export declare interface StaggerOptions {
@@ -3839,6 +4107,32 @@ export declare interface StaggerOptions {
3839
4107
  */
3840
4108
  export declare type StaggerOrigin = "first" | "last" | "center" | "edges" | number;
3841
4109
 
4110
+ /**
4111
+ * Feature-detect native `animation-trigger` — Chrome 145+ ships it; nothing else
4112
+ * (yet) does. `CSS.supports` is the FEATURE probe (never a UA sniff — r5 / the
4113
+ * CE-1.0 precedent). Returns `false` where `CSS`/`CSS.supports` is absent (SSR,
4114
+ * jsdom) OR the property/keyword is unknown, so the caller keeps the kf driver.
4115
+ */
4116
+ declare function supportsNativeTrigger(): boolean;
4117
+
4118
+ declare abstract class SVGAnimationHandle<V extends Vars = Vars> {
4119
+ readonly animation: CSSKeyframesAnimation<V>;
4120
+ /**
4121
+ * The underlying animation — the control handle. Set by the subclass through
4122
+ * `super(fromX(...))` (the `fromX` factory is the canonical construction).
4123
+ */
4124
+ constructor(animation: CSSKeyframesAnimation<V>);
4125
+ /** Start (or re-enter) the play loop. Resolves when the animation completes. */
4126
+ play(): Promise<void>;
4127
+ /** Pause the play loop, retaining the playhead. Chainable. */
4128
+ pause(): this;
4129
+ /** Halt and rewind the play loop. Chainable. */
4130
+ stop(): this;
4131
+ /** Resolve once the animation completes — the {@link Animation.finished}
4132
+ * completion front-door, uniform across every SVG handle. */
4133
+ get finished(): Promise<void>;
4134
+ }
4135
+
3842
4136
  /**
3843
4137
  * The minimal geometry contract DrawSVG needs: any SVG element that exposes
3844
4138
  * `getTotalLength()` (`SVGGeometryElement` — `<path>`, `<line>`, `<circle>`,
@@ -3870,6 +4164,32 @@ export declare interface TemplateAnimationFrame<V extends Vars> {
3870
4164
 
3871
4165
  declare const textFocusBlur: (options?: InputAnimationOptions) => CSSKeyframesAnimation< Vars>;
3872
4166
 
4167
+ /**
4168
+ * The layout-INDEPENDENT segmenters for `splitText` — `by: "word"` and
4169
+ * `by: "grapheme"` (S.F2 §S2). Both ride the platform `Intl.Segmenter` (the SOTA
4170
+ * bar GSAP's 2025 rewrite set: grapheme-correct splitting handles emoji,
4171
+ * combining marks, and ZWJ sequences that a naive `text.split("")` shreds into
4172
+ * mojibake). A conservative regex fallback covers the (rare) no-`Intl.Segmenter`
4173
+ * runtime so the primitive never throws on capability alone.
4174
+ *
4175
+ * A segmenter emits an ordered run of {@link TextSegment}s: each is either a
4176
+ * `"unit"` (a word or grapheme — an animatable fragment) or `"space"` (inter-unit
4177
+ * whitespace — kept as a live text node so the browser can still wrap the run at
4178
+ * real break opportunities; the per-glyph inline-blocks otherwise defeat
4179
+ * `text-wrap: balance`, the AnimatedText X-5 lesson). Punctuation rides as its
4180
+ * own `"unit"` under word granularity (`isWordLike === false` but non-blank).
4181
+ */
4182
+ /** One ordered piece of the source text. */
4183
+ export declare interface TextSegment {
4184
+ /** The literal substring. */
4185
+ text: string;
4186
+ /**
4187
+ * `"unit"` — an animatable fragment (word or grapheme). `"space"` — inter-
4188
+ * unit whitespace, preserved as a text node (not wrapped, not in the cohort).
4189
+ */
4190
+ kind: "unit" | "space";
4191
+ }
4192
+
3873
4193
  /**
3874
4194
  * A dt-driven stepper the {@link RAFPlayback.drive} loop can own:
3875
4195
  * `SmoothProgress` and `SpringProgress` implement it directly. The driver
@@ -3931,7 +4251,7 @@ export declare interface TimelineOptions {
3931
4251
  *
3932
4252
  * ```ts
3933
4253
  * const easing = await resolveEasing("ease-out-cubic");
3934
- * new ScrollTimeline({ easing });
4254
+ * new KeyframesScrollTimeline({ easing });
3935
4255
  * ```
3936
4256
  */
3937
4257
  easing?: TimingFunction | Easing | undefined;
@@ -3968,6 +4288,89 @@ export declare type TransformFunction<V extends Vars> = (v: V, t: number) => voi
3968
4288
  */
3969
4289
  declare function transformTargetsStyle<V extends Vars>(vars: V, targets: HTMLElement[], flat?: boolean): void;
3970
4290
 
4291
+ /** The play direction a trigger cycle runs — `alternate` flips it each entry. */
4292
+ declare type TriggerDirection = "forward" | "backward";
4293
+
4294
+ /**
4295
+ * The kf `TriggerScene` — realizes a parsed `AnimationTriggerValue` as the
4296
+ * idle→active→done lifecycle over a raw scroll position. The caller drives the
4297
+ * loop (`triggerProgress(p)` per scroll event); the scene owns no rAF and no
4298
+ * DOM. The four `<trigger-type>`s differ ONLY in their crossing semantics:
4299
+ *
4300
+ * • `once` — fires once. `idle →enter→ active →exit→ done`; `done` LATCHES
4301
+ * (a re-entry never re-fires). The one-shot reveal.
4302
+ * • `repeat` — re-fires. `idle →enter→ active →exit→ idle` (RESET — the exit
4303
+ * returns to the pre-animation state); each re-entry re-plays
4304
+ * forward, `cycles` incrementing. Never permanently `done`.
4305
+ * • `alternate` — re-fires with a FLIPPED direction. `idle →enter→
4306
+ * active(forward) →exit→ done →enter→ active(backward) → …`;
4307
+ * `direction` alternates each entry (the backward semantics).
4308
+ * • `state` — the play state FOLLOWS presence. `inside ⇒ active`,
4309
+ * `outside ⇒ done` (after the first entry) — the playhead is
4310
+ * HELD across the boundary (pause/resume, NOT reset).
4311
+ *
4312
+ * The `playhead` (0..1) is the animation's own progress the consumer writes to
4313
+ * an engine; it advances with the within-range fraction while `active`. The gate
4314
+ * asserts the STATE sequence (scrub-based, C-10 — never a frame/ms threshold).
4315
+ */
4316
+ declare class TriggerScene {
4317
+ /** The parsed `<trigger-type>` (CSS initial value is `once`). */
4318
+ readonly type: TriggerType;
4319
+ private readonly triggerRange;
4320
+ private _state;
4321
+ private _direction;
4322
+ private _playhead;
4323
+ private _cycles;
4324
+ private wasInside;
4325
+ private everEntered;
4326
+ constructor(trigger?: AnimationTriggerValue);
4327
+ /** The current lifecycle state. */
4328
+ get state(): TriggerState;
4329
+ /** The current play direction (`alternate` flips it each entry). */
4330
+ get direction(): TriggerDirection;
4331
+ /** The animation's own progress (0..1) — the engine-write the driver tracks. */
4332
+ get playhead(): number;
4333
+ /** How many times the trigger has fired (entered `active` from idle/done). */
4334
+ get cycles(): number;
4335
+ /** The resolved [start,end] scroll-extent fractions of the trigger range. */
4336
+ get range(): ResolvedRange;
4337
+ /**
4338
+ * True when the platform will run this trigger NATIVELY (Chrome 145+). The
4339
+ * dispatch is the caller's: `usesNative` ⇒ author a native `animation-trigger`
4340
+ * declaration; else drive THIS scene. Feature-detected, never UA-sniffed.
4341
+ */
4342
+ get usesNative(): boolean;
4343
+ /**
4344
+ * Drive the trigger from a raw scroll position `p ∈ [0,1]` (the caller
4345
+ * resolves the live scroller; kf maps it over the trigger range). Advances
4346
+ * the idle→active→done state machine per the `<trigger-type>` semantics and
4347
+ * returns the new state.
4348
+ */
4349
+ triggerProgress(p: number): TriggerState;
4350
+ /** Rewind the lifecycle to `idle` (re-arm a `once`/`state` scene). */
4351
+ reset(): void;
4352
+ /** `once` — fire once, then LATCH `done` (a re-entry never re-fires). */
4353
+ private stepOnce;
4354
+ /** `repeat` — RESET to `idle` on exit; each re-entry re-plays forward. */
4355
+ private stepRepeat;
4356
+ /** `alternate` — exit `done`; each re-entry FLIPS the play direction. */
4357
+ private stepAlternate;
4358
+ /** `state` — play state FOLLOWS presence; the playhead is HELD across exits. */
4359
+ private stepState;
4360
+ private directedPlayhead;
4361
+ }
4362
+
4363
+ /**
4364
+ * The three lifecycle states a `<single-animation-trigger>` traverses:
4365
+ * • `idle` — the timeline has not (yet) triggered the animation.
4366
+ * • `active` — the trigger fired; the animation is playing.
4367
+ * • `done` — the trigger cycle completed (latched for `once`; transient for
4368
+ * the re-firing types).
4369
+ * The canonical `once` lifecycle is `idle → active → done`; the other three
4370
+ * types are variations over the SAME vocabulary (§`triggerProgress`).
4371
+ */
4372
+ declare type TriggerState = "idle" | "active" | "done";
4373
+
3971
4374
  declare const typewriter: (options?: InputAnimationOptions) => CSSKeyframesAnimation< Vars>;
3972
4375
 
3973
4376
  declare const typingCursor: (options?: InputAnimationOptions) => CSSKeyframesAnimation< Vars>;
@@ -4079,6 +4482,127 @@ export declare interface VelocityProbe {
4079
4482
  };
4080
4483
  }
4081
4484
 
4485
+ /**
4486
+ * Mutate the DOM behind a View Transition where the platform supports one, else
4487
+ * fall back to a `flipShared` shared-element morph (or a bare immediate
4488
+ * mutation). Returns a normalized {@link ViewTransitionHandle} whose `backend`
4489
+ * is queryable and whose promises never reject.
4490
+ *
4491
+ * @param mutate — the synchronous (or async) DOM mutation the transition captures.
4492
+ * @param opts — `{ types, duration, timingFunction, shared, fallback, respectReducedMotion }`.
4493
+ */
4494
+ export declare function viewTransition(mutate: ViewTransitionMutate, opts?: ViewTransitionOptions): ViewTransitionHandle;
4495
+
4496
+ /** Options for {@link compileToViewTransition}, extending {@link CompileOptions}. */
4497
+ export declare interface ViewTransitionCompileOptions extends CompileOptions {
4498
+ /** Typed same-doc VT — wraps every rule in `:root:active-view-transition-type(...)`. */
4499
+ types?: readonly string[];
4500
+ /** Prepend the cross-doc `@view-transition { navigation: auto }` preamble (opt-in). */
4501
+ crossDocument?: boolean;
4502
+ /** Append the PRM `animation: none` degrade block (default `true`). */
4503
+ reducedMotion?: boolean;
4504
+ /**
4505
+ * Emit the MANDATORY timing-only group pseudo (default `true`). Turning it
4506
+ * OFF ships the 250ms/ease temporal incoherence p09 observed — exposed only
4507
+ * so the born-RED gate's falsifiability clause can prove the omission REDs.
4508
+ */
4509
+ emitGroup?: boolean;
4510
+ }
4511
+
4512
+ /**
4513
+ * The normalized transition handle — settles cleanly whether a native View
4514
+ * Transition, a `flipShared` fallback, or a bare immediate mutation ran. Its
4515
+ * promises NEVER reject (a skipped/aborted transition settles), so a consumer's
4516
+ * `await handle.finished` is always safe.
4517
+ */
4518
+ export declare interface ViewTransitionHandle {
4519
+ /** Resolves once the transition's pseudo-tree is ready to animate (or immediately off-platform). */
4520
+ ready: Promise<void>;
4521
+ /** Resolves when the transition (or fallback) has fully settled. Never rejects. */
4522
+ finished: Promise<void>;
4523
+ /** Resolves once the DOM mutation callback has run. */
4524
+ updateCallbackDone: Promise<void>;
4525
+ /** Skip the running transition to its end state (no-op off-platform). */
4526
+ skip(): void;
4527
+ /**
4528
+ * Which path actually ran — set SYNCHRONOUSLY at dispatch so a caller can
4529
+ * branch immediately: `"view-transition"` (native), `"flip"` (the
4530
+ * `flipShared` fallback), `"immediate"` (bare mutate — no platform, PRM snap,
4531
+ * or `fallback: "none"`).
4532
+ */
4533
+ backend: "view-transition" | "flip" | "immediate";
4534
+ }
4535
+
4536
+ /** A synchronous DOM mutation the transition captures (may be async). */
4537
+ export declare type ViewTransitionMutate = () => void | Promise<void>;
4538
+
4539
+ /** Options for {@link viewTransition}. */
4540
+ export declare interface ViewTransitionOptions {
4541
+ /**
4542
+ * Typed same-doc View Transitions (`:active-view-transition-type(...)`).
4543
+ * Passed through the platform's typed-`update` object overload where the
4544
+ * browser supports it; DROPPED (the untyped cross-fade) where it does not —
4545
+ * conservative-correct, never a throw.
4546
+ */
4547
+ types?: readonly string[];
4548
+ /** Fallback play duration (ms) — the `flipShared` pairs. Defaults to `300`. */
4549
+ duration?: number;
4550
+ /**
4551
+ * Fallback easing — a callable {@link TimingFunction} or typed {@link Easing}
4552
+ * (e.g. `springTimingFunction(...)` for a springy fallback).
4553
+ */
4554
+ timingFunction?: TimingFunction | Easing;
4555
+ /**
4556
+ * The shared-element pairs the `flip` fallback morphs (`[from, to]`). When
4557
+ * the platform has no `startViewTransition`, each `from` morphs onto its
4558
+ * `to`'s rect via `flipShared` — the zero-peer visual-equivalence letter.
4559
+ */
4560
+ shared?: ReadonlyArray<readonly [HTMLElement, HTMLElement]>;
4561
+ /**
4562
+ * The fallback strategy when View Transitions are unavailable: `"flip"`
4563
+ * (default — run the `shared` pairs; a bare mutate when none are given),
4564
+ * `"none"` (mutate immediately, no motion), or a custom async runner.
4565
+ */
4566
+ fallback?: "flip" | "none" | ((mutate: ViewTransitionMutate) => Promise<void>);
4567
+ /**
4568
+ * Route through the ONE `withReducedMotion` gate (default `true`): under an
4569
+ * active `prefers-reduced-motion: reduce` the transition SNAPS — `mutate()`
4570
+ * runs directly and the handle settles (`backend: "immediate"`), skipping
4571
+ * `startViewTransition` entirely. The platform's own degrade, WCAG-aligned.
4572
+ */
4573
+ respectReducedMotion?: boolean;
4574
+ }
4575
+
4576
+ /** A VT refusal — the CC-3 shape widened to the VT reason union. */
4577
+ export declare interface VTCompileRefusal extends Omit<CompileRefusal, "reason"> {
4578
+ reason: VTCompileRefusalReason;
4579
+ }
4580
+
4581
+ /** The four VT refusals atop the inherited CC-3 {@link CompileRefusalReason}. */
4582
+ export declare type VTCompileRefusalReason = CompileRefusalReason | "vt-scroll-grammar" | "vt-element-scoped-computed" | "vt-snapshot-inapplicable" | "vt-name-collision";
4583
+
4584
+ /**
4585
+ * The per-name VT role mapping (SF-1). A group/Sequence has NO old/new axis (the
4586
+ * group-as-primary reading is REJECTED), so the emitter's PRIMARY input is this
4587
+ * name-keyed role spec. `old`/`new` are the same `KeyframesAnimation`s
4588
+ * `compileToCSS` walks; `group` is timing-only by design.
4589
+ */
4590
+ export declare type VTRoleSpec<V extends Vars = Vars> = {
4591
+ /** The outgoing snapshot's animation (`::view-transition-old(name)`). */
4592
+ old?: KeyframesAnimation<V>;
4593
+ /** The incoming snapshot's animation (`::view-transition-new(name)`). */
4594
+ new?: KeyframesAnimation<V>;
4595
+ /**
4596
+ * Timing-only for the group pseudo: duration + easing onto the UA geometry
4597
+ * morph (NEVER `animation-name`). A `KeyframesAnimation` contributes its
4598
+ * `options.duration`/`timingFunction`; a bare `{ duration, timingFunction }`
4599
+ * gives them directly. Omit → derived from `new ?? old` (the coherent default).
4600
+ */
4601
+ group?: Pick<AnimationOptions, "duration" | "timingFunction"> | KeyframesAnimation<V>;
4602
+ /** A `view-transition-class` cohort name — uniform cohorts ride one rule. */
4603
+ class?: string;
4604
+ };
4605
+
4082
4606
  declare type WAAPIEligibility = {
4083
4607
  eligible: true;
4084
4608
  } | {