@mkbabb/keyframes.js 5.1.0 → 5.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +98 -8
- package/dist/easing-registry-BAgudUsG.js +2 -0
- package/dist/{easing-registry-DHV2-5gA.js → easing-registry-BlbS88NR.js} +2 -2
- package/dist/engine/index.d.ts +570 -323
- package/dist/engine/index.js +3710 -17
- package/dist/keyframes.d.ts +1043 -454
- package/dist/keyframes.js +277 -107
- package/dist/{sequence-C_DCiOIQ.js → sequence-CES7o7hs.js} +258 -182
- package/package.json +104 -100
- package/dist/animation-BGyzfzBq.js +0 -947
- package/dist/compile-CcSUwM8R.js +0 -276
- package/dist/delegation-DWwr4IXr.js +0 -263
- package/dist/draw-svg-GURj9nin.js +0 -45
- package/dist/easing-registry-y1p9McFy.js +0 -2
- 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/group-vJcsHKN9.js +0 -360
- package/dist/ingest-S5hUe20K.js +0 -166
- package/dist/morph-svg-BToeumw5.js +0 -89
- package/dist/motion-path-pQVbamWT.js +0 -35
- package/dist/parse-flatten-DRMHFytp.js +0 -2
- package/dist/parse-flatten-ZZUSEQEL.js +0 -63
- package/dist/presets-BG2Fczzq.js +0 -275
- package/dist/scheduler-CUtVnuoU.js +0 -14
- package/dist/scroll-CxpYFO4u.js +0 -180
- package/dist/validate-DDeGnvSt.js +0 -39
package/dist/engine/index.d.ts
CHANGED
|
@@ -1,21 +1,23 @@
|
|
|
1
|
-
import { AnimationRangeValue } from '@mkbabb/value.js';
|
|
2
|
-
import { AnimationTimelineValue } from '@mkbabb/value.js';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
import { AnimationRangeValue } from '@mkbabb/value.js/parsing';
|
|
2
|
+
import { AnimationTimelineValue } from '@mkbabb/value.js/parsing';
|
|
3
|
+
import type { AnimationTriggerValue } from '@mkbabb/value.js/parsing';
|
|
4
|
+
import type { ColorSpace } from '@mkbabb/value.js/color';
|
|
5
|
+
import { CSSTimelineOptions } from '@mkbabb/value.js/parsing';
|
|
6
|
+
import { CustomFunctionDescriptor } from '@mkbabb/value.js/parsing';
|
|
7
|
+
import { extractAnimationOptions } from '@mkbabb/value.js/parsing';
|
|
8
|
+
import type { HueInterpolationMethod } from '@mkbabb/value.js/color';
|
|
9
|
+
import type { InterpolatedVar } from '@mkbabb/value.js/units';
|
|
10
|
+
import { ParseDiagnostic } from '@mkbabb/value.js/parsing';
|
|
11
|
+
import { PropertyDescriptor as PropertyDescriptor_2 } from '@mkbabb/value.js/parsing';
|
|
12
|
+
import { RangeBoundary } from '@mkbabb/value.js/parsing';
|
|
13
|
+
import { RangePhase } from '@mkbabb/value.js/parsing';
|
|
14
|
+
import { Stylesheet } from '@mkbabb/value.js/parsing';
|
|
15
|
+
import type { timingFunctions } from '@mkbabb/value.js/easing';
|
|
16
|
+
import type { TriggerType } from '@mkbabb/value.js/parsing';
|
|
17
|
+
import { ValueArray } from '@mkbabb/value.js/units';
|
|
18
|
+
import { ValueUnit } from '@mkbabb/value.js/units';
|
|
19
|
+
|
|
20
|
+
declare const accordionExpand: PresetFactory;
|
|
19
21
|
|
|
20
22
|
/**
|
|
21
23
|
* The outcome of an {@link adoptRunning} takeover. `animation` is the kf object
|
|
@@ -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,19 +159,43 @@ 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;
|
|
178
|
+
/** Native effects installed by the additive group-WAAPI fast lane.
|
|
179
|
+
* INTERNAL: lifecycle owns pause/resume/cancel; an empty array means the
|
|
180
|
+
* group is on its ordinary rAF compositor path. */
|
|
181
|
+
readonly _waAnimations: globalThis.Animation[];
|
|
182
|
+
/** True while the current play is delegated to native effects. The group
|
|
183
|
+
* still runs its shadow transport loop so events and completion retain the
|
|
184
|
+
* rAF contract, but it does not overwrite native compositor output. */
|
|
185
|
+
_waapiDelegated: boolean;
|
|
152
186
|
resolvePromise: ((value: void | PromiseLike<void>) => void) | null;
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
187
|
+
/** The ONE held play promise the `finished` front-door exposes. INTERNAL
|
|
188
|
+
* (S.B5) — read/written by the transport free functions in `./lifecycle`. */
|
|
189
|
+
_playingPromise: Promise<void> | null;
|
|
190
|
+
/** Pre-bound frame callback — allocated once to avoid a per-loop closure.
|
|
191
|
+
* INTERNAL (S.B5) — read by `./lifecycle`'s `play`/`resume` loop start. */
|
|
192
|
+
_boundFrame: (t: number) => boolean | Promise<boolean>;
|
|
156
193
|
/** Cached entries sorted by layer zIndex (see `getEntries`). */
|
|
157
194
|
private _entries;
|
|
158
195
|
private _entriesDirty;
|
|
159
196
|
/** Long-lived composite buffer, cleared in place each frame (zero-alloc).
|
|
160
197
|
* INTERNAL (R.W2) — read/written by `./compositor`. */
|
|
198
|
+
readonly _compositeState: CompositeState;
|
|
161
199
|
_grouped: Record<string, unknown>;
|
|
162
200
|
/** The compile-stable union of every child's contributed keys — what `_grouped`
|
|
163
201
|
* is null-filled to each frame so the composite clears WITHOUT `delete` (F.W4
|
|
@@ -170,6 +208,13 @@ export declare class AnimationGroup<V extends Vars> {
|
|
|
170
208
|
* `buildSoAPlans` in `./soa`, rebuilt ONLY on a structural change). INTERNAL
|
|
171
209
|
* (R.W2) — read/written by `./compositor`. */
|
|
172
210
|
_soaPlans: SoALayerPlan[] | null;
|
|
211
|
+
/**
|
|
212
|
+
* T.A6 — the group's PLAIN authored-shape projection (built from the
|
|
213
|
+
* composite `_grouped` leaf map when `unflatten` is set), rebuilt lazily on a
|
|
214
|
+
* structural change (the SAME `_groupedKeysDirty` seam that drops the SoA
|
|
215
|
+
* plan). Null until the first composited frame populates `_grouped`. INTERNAL
|
|
216
|
+
* — read/written by `./compositor`. */
|
|
217
|
+
_plainProj: PlainProjection | null;
|
|
173
218
|
/** The long-lived SoA fold scratch — the contiguous numeric accumulate buffer,
|
|
174
219
|
* sized to the WIDEST single-layer pair count once per structural change
|
|
175
220
|
* (reused, zero per-frame alloc). INTERNAL (R.W2) — read by `./compositor`. */
|
|
@@ -212,35 +257,31 @@ export declare class AnimationGroup<V extends Vars> {
|
|
|
212
257
|
private _frame;
|
|
213
258
|
/** The post-advance render half of `_frame` — composite, or settle on done. */
|
|
214
259
|
private _renderFrame;
|
|
215
|
-
private _resolvePlay;
|
|
216
260
|
/** The completion front-door (G.W13) — `await group.finished` resolves once
|
|
217
261
|
* the in-flight composite play settles. Exposes the ONE held `_playingPromise`
|
|
218
262
|
* (a settled/never-played group resolves immediately). */
|
|
219
263
|
get finished(): Promise<void>;
|
|
220
264
|
/** 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). */
|
|
265
|
+
* Re-entrant, and PRM-aware — body in `./lifecycle` (S.B5 / a19 F1). */
|
|
223
266
|
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. */
|
|
267
|
+
/** Pause the group — idempotent. Cancels the rAF loop + renders a final-frame
|
|
268
|
+
* snapshot so the visual matches the pause moment; records each child's
|
|
269
|
+
* jump-free `pausedTime`. Body in `./lifecycle` (S.B5). */
|
|
230
270
|
pause(): this;
|
|
231
|
-
/** Resume the group — idempotent. Unpauses every child DIRECTLY (
|
|
232
|
-
*
|
|
271
|
+
/** Resume the group — idempotent. Unpauses every child DIRECTLY (the group's
|
|
272
|
+
* draw loop owns the ticking). Body in `./lifecycle` (S.B5). */
|
|
233
273
|
resume(): this;
|
|
234
274
|
/** The explicit flip: pauses if playing, resumes if paused. */
|
|
235
|
-
toggle():
|
|
275
|
+
toggle(): void;
|
|
236
276
|
/** Pure state teardown — never paints. Releases every child (`managed = false`,
|
|
237
|
-
* `child.settle()`) and clears the group flags
|
|
277
|
+
* `child.settle()`) and clears the group flags. Body in `./lifecycle` (S.B5). */
|
|
238
278
|
settle(): this;
|
|
239
279
|
/** Explicit rewind: paint every started child back to its INITIAL frame, then
|
|
240
|
-
* settle — the user-facing "return to start"
|
|
280
|
+
* settle — the user-facing "return to start". Body in `./lifecycle` (S.B5). */
|
|
241
281
|
reset(): this;
|
|
242
282
|
/** Halt the draw loop, rewind to the initial frame (the transport-stop
|
|
243
|
-
* semantic the demo's controls expect), and resolve any pending `play()`.
|
|
283
|
+
* semantic the demo's controls expect), and resolve any pending `play()`.
|
|
284
|
+
* Body in `./lifecycle` (S.B5). */
|
|
244
285
|
stop(): this;
|
|
245
286
|
playing(): boolean;
|
|
246
287
|
/** Set layer config for an animation by name or reference. Chainable. */
|
|
@@ -330,6 +371,8 @@ declare interface AnimationLayerConfig {
|
|
|
330
371
|
* blends by replacement, the least-surprising composite.
|
|
331
372
|
*/
|
|
332
373
|
blendMode: BlendMode;
|
|
374
|
+
/** Canonical composition operation. Omission preserves `blendMode` callers. */
|
|
375
|
+
op?: CompositeOperator;
|
|
333
376
|
/** Layer toggle. Default: true */
|
|
334
377
|
enabled: boolean;
|
|
335
378
|
/** Optional property whitelist — only these properties will be output from this layer */
|
|
@@ -380,26 +423,22 @@ export { AnimationRangeValue }
|
|
|
380
423
|
|
|
381
424
|
export { AnimationTimelineValue }
|
|
382
425
|
|
|
383
|
-
|
|
384
|
-
declare const attentionPresets: {
|
|
385
|
-
readonly pulse: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
386
|
-
readonly shake: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
387
|
-
readonly bounce: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
388
|
-
readonly flip: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
389
|
-
readonly notificationBounce: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
390
|
-
readonly springPop: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
391
|
-
readonly springWobble: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
392
|
-
};
|
|
426
|
+
declare const attentionPresets: Readonly<Record<string, PresetFactory>>;
|
|
393
427
|
|
|
394
|
-
|
|
428
|
+
/**
|
|
429
|
+
* Public layer vocabulary. `weighted` is retained as a compatibility alias;
|
|
430
|
+
* the canonical operation axis is {@link CompositeOperator}. `accumulate` is
|
|
431
|
+
* additive and maps to the same un-clamped fold as `add` at group scope.
|
|
432
|
+
*/
|
|
433
|
+
declare type BlendMode = CompositeOperator | "weighted";
|
|
395
434
|
|
|
396
|
-
declare const blurIn:
|
|
435
|
+
declare const blurIn: PresetFactory;
|
|
397
436
|
|
|
398
|
-
declare const blurInOut:
|
|
437
|
+
declare const blurInOut: PresetFactory;
|
|
399
438
|
|
|
400
|
-
declare const blurOut:
|
|
439
|
+
declare const blurOut: PresetFactory;
|
|
401
440
|
|
|
402
|
-
declare const bounce:
|
|
441
|
+
declare const bounce: PresetFactory;
|
|
403
442
|
|
|
404
443
|
/** The compile result — the artifact + the CC-3 ineligibility report. */
|
|
405
444
|
declare interface CompiledCSS {
|
|
@@ -419,11 +458,35 @@ declare interface CompiledCSS {
|
|
|
419
458
|
refusals: CompileRefusal[];
|
|
420
459
|
}
|
|
421
460
|
|
|
461
|
+
/** The entry compile result — the artifact + the refusal report. */
|
|
462
|
+
export declare interface CompiledEntryCSS {
|
|
463
|
+
/** The zero-runtime CSS: base rule + open rule + `@starting-style` per selector. */
|
|
464
|
+
css: string;
|
|
465
|
+
/** True iff EVERY selector compiled faithfully. */
|
|
466
|
+
eligible: boolean;
|
|
467
|
+
/** One refusal per selector that could not compile as a two-endpoint transition. */
|
|
468
|
+
refusals: EntryRefusal[];
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
/** The VT compile result — the artifact + the widened refusal report + the names. */
|
|
472
|
+
export declare interface CompiledViewTransitionCSS extends Omit<CompiledCSS, "refusals"> {
|
|
473
|
+
/** One refusal per role that could not compile faithfully (CC-3 ∪ the VT four). */
|
|
474
|
+
refusals: VTCompileRefusal[];
|
|
475
|
+
/** The `view-transition-name` set the consumer assigns to its elements. */
|
|
476
|
+
names: string[];
|
|
477
|
+
}
|
|
478
|
+
|
|
422
479
|
/** The input shapes `compileToCSS` accepts. */
|
|
423
|
-
declare type CompileInput<V extends Vars =
|
|
480
|
+
declare type CompileInput<V extends Vars = Vars> = AnimationGroup<V> | Sequence<V> | ReadonlyArray<KeyframesAnimation<V> | {
|
|
424
481
|
animation: KeyframesAnimation<V>;
|
|
425
482
|
}>;
|
|
426
483
|
|
|
484
|
+
/**
|
|
485
|
+
* The reason a child could not compile faithfully. Generalizes
|
|
486
|
+
* `waapiIneligibleReason` to the CSS-compile domain — the trust surface. Each
|
|
487
|
+
* names the kf axis that exceeds pure CSS (the refusal is marketing for the
|
|
488
|
+
* moat). A refused child's JS playback is the only faithful path.
|
|
489
|
+
*/
|
|
427
490
|
/** Options for {@link compileToCSS}. */
|
|
428
491
|
declare interface CompileOptions {
|
|
429
492
|
/**
|
|
@@ -453,21 +516,12 @@ declare interface CompileOptions {
|
|
|
453
516
|
printWidth?: number;
|
|
454
517
|
}
|
|
455
518
|
|
|
456
|
-
/** A single refusal — the child name + a typed reason + a human message. */
|
|
457
519
|
declare interface CompileRefusal {
|
|
458
|
-
/** The compiled child's class/animation name. */
|
|
459
520
|
name: string;
|
|
460
521
|
reason: CompileRefusalReason;
|
|
461
|
-
/** The verbatim message the demo's ineligibility UI shows (CC-4). */
|
|
462
522
|
message: string;
|
|
463
523
|
}
|
|
464
524
|
|
|
465
|
-
/**
|
|
466
|
-
* The reason a child could not compile faithfully. Generalizes
|
|
467
|
-
* `waapiIneligibleReason` to the CSS-compile domain — the trust surface. Each
|
|
468
|
-
* names the kf axis that exceeds pure CSS (the refusal is marketing for the
|
|
469
|
-
* moat). A refused child's JS playback is the only faithful path.
|
|
470
|
-
*/
|
|
471
525
|
declare type CompileRefusalReason = "weighted-blend" | "custom-renderer" | "perceptual-oklab" | "computed-unit-drift";
|
|
472
526
|
|
|
473
527
|
/**
|
|
@@ -484,6 +538,33 @@ declare type CompileRefusalReason = "weighted-blend" | "custom-renderer" | "perc
|
|
|
484
538
|
*/
|
|
485
539
|
export declare function compileToCSS<V extends Vars>(input: CompileInput<V>, opts?: CompileOptions): Promise<CompiledCSS>;
|
|
486
540
|
|
|
541
|
+
/**
|
|
542
|
+
* THE ENTRY/EXIT EMITTER (C-22 revised, P2-2) — compile a selector-keyed
|
|
543
|
+
* entry/exit spec to zero-runtime `@starting-style` + `allow-discrete` CSS. Emits
|
|
544
|
+
* per selector: the base/closed rule (exit endpoint + `display:none` + the exit
|
|
545
|
+
* transition list), the open rule (enter endpoint + `display` + the entry list),
|
|
546
|
+
* and the `@starting-style` block (enter's FIRST frame). Asymmetric entry/exit
|
|
547
|
+
* timing rides the two lists; `linear()` springs ride verbatim; color endpoints
|
|
548
|
+
* canonicalize to `oklab()`. REFUSES with a NAMED reason (3 inherited + 6
|
|
549
|
+
* entry-specific) what cannot compile as a two-endpoint transition.
|
|
550
|
+
*
|
|
551
|
+
* @returns `{ css, eligible, refusals }`.
|
|
552
|
+
*/
|
|
553
|
+
export declare function compileToEntry<V extends Vars>(spec: Record<string, EntryRoleSpec<V>>, opts?: EntryCompileOptions): Promise<CompiledEntryCSS>;
|
|
554
|
+
|
|
555
|
+
/**
|
|
556
|
+
* THE VIEW-TRANSITIONS EMITTER (SF-1/SF-2/SF-3) — compile a name-keyed role spec
|
|
557
|
+
* to a zero-runtime `::view-transition-*` CSS artifact. Emits per name: the
|
|
558
|
+
* old/new `@keyframes` + shorthand, the MANDATORY timing-only group override, an
|
|
559
|
+
* optional class-cohort rule, wrapped in `:active-view-transition-type(...)` when
|
|
560
|
+
* `types` are given; prepends the cross-doc preamble under `crossDocument`; and
|
|
561
|
+
* appends the PRM `animation: none` degrade by default. REFUSES with a NAMED
|
|
562
|
+
* reason (the CC-3 four ∪ the VT four) what cannot round-trip faithfully.
|
|
563
|
+
*
|
|
564
|
+
* @returns `{ css, eligible, refusals, names }` — the artifact + the trust surface.
|
|
565
|
+
*/
|
|
566
|
+
export declare function compileToViewTransition<V extends Vars>(spec: Record<string, VTRoleSpec<V>>, opts?: ViewTransitionCompileOptions): Promise<CompiledViewTransitionCSS>;
|
|
567
|
+
|
|
487
568
|
/**
|
|
488
569
|
* The CSS `animation-composition` operator (K.W7). Distinct from
|
|
489
570
|
* {@link BlendMode} (the GROUP's per-LAYER blend tier — `replace`/`add`/
|
|
@@ -496,6 +577,18 @@ export declare function compileToCSS<V extends Vars>(input: CompileInput<V>, opt
|
|
|
496
577
|
*/
|
|
497
578
|
declare type CompositeOperator = "replace" | "add" | "accumulate";
|
|
498
579
|
|
|
580
|
+
/** Stable, compositor-owned leaves. Foreign frame arrays are copied, never retained. */
|
|
581
|
+
declare class CompositeState {
|
|
582
|
+
readonly values: Record<string, unknown>;
|
|
583
|
+
private keys;
|
|
584
|
+
private readonly epochs;
|
|
585
|
+
private epoch;
|
|
586
|
+
configure(keys: string[]): void;
|
|
587
|
+
clear(): void;
|
|
588
|
+
copy(key: string, incoming: unknown): unknown;
|
|
589
|
+
pruneInactive(): void;
|
|
590
|
+
}
|
|
591
|
+
|
|
499
592
|
/**
|
|
500
593
|
* Construct a `ScrollScene` from a parsed `CSSTimelineOptions` (the SO-1 parse
|
|
501
594
|
* output) OR a direct `ScrollSceneOptions` spec. The CSS-fed construction is the
|
|
@@ -511,6 +604,20 @@ declare type CompositeOperator = "replace" | "add" | "accumulate";
|
|
|
511
604
|
*/
|
|
512
605
|
export declare function createScrollScene(spec?: ScrollSceneOptions | CSSTimelineOptions): ScrollScene;
|
|
513
606
|
|
|
607
|
+
/**
|
|
608
|
+
* Construct a `TriggerScene` from a parsed `AnimationTriggerValue` OR a full
|
|
609
|
+
* `CSSTimelineOptions` (the {@link parseScrollCSS} output — the `.trigger` field
|
|
610
|
+
* is used). The CSS-fed construction is the round-trip's driving half (parse →
|
|
611
|
+
* behavior); the value-fed construction is value.js-INDEPENDENT.
|
|
612
|
+
*
|
|
613
|
+
* @example
|
|
614
|
+
* // grammar → behavior (the round-trip):
|
|
615
|
+
* const opts = parseScrollCSS(stylesheet); // { …, trigger: { type: "repeat", range } }
|
|
616
|
+
* const scene = createTriggerScene(opts);
|
|
617
|
+
* scene.triggerProgress(0.5); // → "active"
|
|
618
|
+
*/
|
|
619
|
+
export declare function createTriggerScene(spec?: AnimationTriggerValue | CSSTimelineOptions): TriggerScene;
|
|
620
|
+
|
|
514
621
|
export declare class CSSKeyframesAnimation<V extends Vars> extends KeyframesAnimation<V> {
|
|
515
622
|
/**
|
|
516
623
|
* Q.WD1-bind S2 (DM-22) — the timeline a scroll-range named selector resolves
|
|
@@ -569,7 +676,6 @@ export declare class CSSKeyframesAnimation<V extends Vars> extends KeyframesAnim
|
|
|
569
676
|
*/
|
|
570
677
|
scrollOptions?: CSSTimelineOptions;
|
|
571
678
|
fromString(keyframes: string, transform?: TransformFunction<V>): this;
|
|
572
|
-
transform(vars: V): void;
|
|
573
679
|
}
|
|
574
680
|
|
|
575
681
|
export declare function CSSKeyframesToString<V extends Vars>(animation: KeyframesAnimation<V>, name?: string, printWidth?: number | undefined): Promise<string>;
|
|
@@ -594,14 +700,13 @@ export declare const defaultOptions: AnimationOptions;
|
|
|
594
700
|
|
|
595
701
|
/**
|
|
596
702
|
* A structured parse/honoring diagnostic (K.W7 S4). Extends the value.js
|
|
597
|
-
*
|
|
703
|
+
* parser diagnostic shape (the consumed shape — `message`/`offset`/`line`/
|
|
598
704
|
* `column`/`expected`/`input`) with a stable kf-side {@link DiagnosticCode} and
|
|
599
705
|
* an optional `property` (the leaf a `COMPOSITION_FALLBACK` names). The
|
|
600
706
|
* value.js half (`message`/`offset`/…) is `Partial` because the engine-internal
|
|
601
707
|
* rows (EMPTY_PARSE, COMPOSITION_FALLBACK) are NOT byte-offset parse failures —
|
|
602
|
-
* they carry a `message` + `code` only
|
|
603
|
-
*
|
|
604
|
-
* re-author of the producer: it CONSUMES `ParseDiagnostic`'s field shape and
|
|
708
|
+
* they carry a `message` + `code` only. Positional fields are retained for
|
|
709
|
+
* ingest callers that attach source locations.
|
|
605
710
|
* widens it with the stable code (inv-16 published-only consumption holds).
|
|
606
711
|
*/
|
|
607
712
|
declare interface Diagnostic extends Partial<ParseDiagnostic> {
|
|
@@ -620,8 +725,7 @@ declare interface Diagnostic extends Partial<ParseDiagnostic> {
|
|
|
620
725
|
* lifted onto the structured field). The engine-internal rows
|
|
621
726
|
* (`EMPTY_PARSE`/`UNKNOWN_TIMING_FN`) were J.W1-landed as typed throws; W7 lifts
|
|
622
727
|
* them onto this field. `COMPOSITION_FALLBACK` is the K.W7 honesty row (the
|
|
623
|
-
* non-numeric composite leaf's refusal).
|
|
624
|
-
* `OnParseError` producer's structured diagnostic verbatim. The CORS-skip /
|
|
728
|
+
* non-numeric composite leaf's refusal). The CORS-skip /
|
|
625
729
|
* WAAPI-reason rows are AUTHORED here but POPULATED by K.W8 (which owns the
|
|
626
730
|
* CSSOM walk that produces them).
|
|
627
731
|
*/
|
|
@@ -652,18 +756,8 @@ export declare function dispatchScrollBackend<V extends Vars>(request: ScrollDis
|
|
|
652
756
|
* is the factory: `new DrawSVG(target).animation` is the control handle. The
|
|
653
757
|
* factory is the canonical entry; this is a thin ergonomic wrapper.
|
|
654
758
|
*/
|
|
655
|
-
export declare class DrawSVG<V extends
|
|
656
|
-
/** The underlying stroke-dashoffset animation — the control handle. */
|
|
657
|
-
readonly animation: CSSKeyframesAnimation<V>;
|
|
759
|
+
export declare class DrawSVG<V extends Vars = Vars> extends SVGAnimationHandle<V> {
|
|
658
760
|
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
761
|
}
|
|
668
762
|
|
|
669
763
|
export declare interface DrawSVGOptions extends Partial<InputAnimationOptions> {
|
|
@@ -685,6 +779,14 @@ export declare interface DrawSVGOptions extends Partial<InputAnimationOptions> {
|
|
|
685
779
|
autoPlay?: boolean;
|
|
686
780
|
}
|
|
687
781
|
|
|
782
|
+
/**
|
|
783
|
+
* Compose the parsed scroll CSS into its range scene, optional trigger scene,
|
|
784
|
+
* and conservative native/JS backend decision. No declaration is reparsed:
|
|
785
|
+
* the exact `CSSTimelineOptions` returned by `parseScrollCSS` is fanned out to
|
|
786
|
+
* every lane, preserving parse→drive symmetry.
|
|
787
|
+
*/
|
|
788
|
+
export declare function driveScrollCSS<V extends Vars = Vars>(options: CSSTimelineOptions, target?: ScrollDriveTarget<V>, driverOptions?: ScrollDriveOptions<V>): ScrollCSSDrive<V>;
|
|
789
|
+
|
|
688
790
|
/**
|
|
689
791
|
* The typed easing value — a callable curve plus, when one exists, the CSS
|
|
690
792
|
* easing string that reproduces it (e.g. a spring's `linear()` stops).
|
|
@@ -702,29 +804,44 @@ declare interface Easing {
|
|
|
702
804
|
css?: string;
|
|
703
805
|
}
|
|
704
806
|
|
|
705
|
-
|
|
706
|
-
declare const enterPresets: {
|
|
707
|
-
readonly fadeIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
708
|
-
readonly slideIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
709
|
-
readonly slideInLeft: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
710
|
-
readonly slideInRight: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
711
|
-
readonly rotateIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
712
|
-
readonly blurIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
713
|
-
readonly springScaleIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
714
|
-
readonly springSlideIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
715
|
-
readonly jumpUp: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
716
|
-
};
|
|
807
|
+
declare const enterPresets: Readonly<Record<string, PresetFactory>>;
|
|
717
808
|
|
|
718
|
-
/**
|
|
719
|
-
declare
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
809
|
+
/** Options for {@link compileToEntry}. */
|
|
810
|
+
export declare interface EntryCompileOptions {
|
|
811
|
+
/** The open-state selector suffix, concatenated onto the base selector. Default `".open"`. */
|
|
812
|
+
openSelector?: ".open" | "[data-open]" | ":popover-open" | "[open]" | (string & {});
|
|
813
|
+
/** The open `display` value (the base rule is always `display: none`). Default `"block"`. */
|
|
814
|
+
display?: string;
|
|
815
|
+
/**
|
|
816
|
+
* Emit `overlay <dur> allow-discrete` on both lists (default `true`). Emitted
|
|
817
|
+
* UNCONDITIONALLY — it materializes only for top-layer elements (popover/
|
|
818
|
+
* dialog), inert-but-harmless elsewhere, so a caller rarely turns it off.
|
|
819
|
+
*/
|
|
820
|
+
overlay?: boolean;
|
|
821
|
+
/** Prettier print-width for the emitted artifact. Omit for the default. */
|
|
822
|
+
printWidth?: number;
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
/** A single entry refusal — the selector + a typed reason + a human message. */
|
|
826
|
+
export declare interface EntryRefusal {
|
|
827
|
+
/** The refused selector (spec key). */
|
|
828
|
+
name: string;
|
|
829
|
+
reason: EntryRefusalReason;
|
|
830
|
+
message: string;
|
|
831
|
+
}
|
|
832
|
+
|
|
833
|
+
/** The refusal taxonomy — 3 inherited + 6 entry-specific (P2-2.3). */
|
|
834
|
+
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";
|
|
835
|
+
|
|
836
|
+
/** The per-selector entry/exit role. Each animation is 2-stop (a transition endpoint pair). */
|
|
837
|
+
export declare interface EntryRoleSpec<V extends Vars = Vars> {
|
|
838
|
+
/** The ENTER animation: first frame → `@starting-style`, last frame → the open rule. */
|
|
839
|
+
enter?: KeyframesAnimation<V>;
|
|
840
|
+
/** The EXIT animation: last frame → the closed rule. Defaults to `enter` REVERSED. */
|
|
841
|
+
exit?: KeyframesAnimation<V>;
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
declare const exitPresets: Readonly<Record<string, PresetFactory>>;
|
|
728
845
|
|
|
729
846
|
/**
|
|
730
847
|
* `explain(css, opts?)` — the human/LLM-readable companion. Calls
|
|
@@ -748,31 +865,17 @@ declare const exitPresets: {
|
|
|
748
865
|
*/
|
|
749
866
|
export declare function explain(css: string, opts?: ValidateOptions): Promise<string>;
|
|
750
867
|
|
|
751
|
-
declare const fadeIn:
|
|
868
|
+
declare const fadeIn: PresetFactory;
|
|
752
869
|
|
|
753
|
-
declare const fadeOut:
|
|
870
|
+
declare const fadeOut: PresetFactory;
|
|
754
871
|
|
|
755
872
|
export declare const FILL_MODES: readonly ["none", "forwards", "backwards", "both"];
|
|
756
873
|
|
|
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
|
-
declare const flipPreset: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
874
|
+
declare const flipPreset: PresetFactory;
|
|
772
875
|
|
|
773
876
|
export declare function formatCSSKeyframeString(keyframe: string): string;
|
|
774
877
|
|
|
775
|
-
declare class FrameCompiler<V extends Vars =
|
|
878
|
+
declare class FrameCompiler<V extends Vars = Vars> {
|
|
776
879
|
private readonly _options;
|
|
777
880
|
templateFrames: TemplateAnimationFrame<V>[];
|
|
778
881
|
parsedVars: ParsedVarMap[];
|
|
@@ -858,7 +961,7 @@ declare class FrameCompiler<V extends Vars = any> {
|
|
|
858
961
|
* ONCE, set `stroke-dasharray` to that length (one solid full-length dash), and
|
|
859
962
|
* sweep `stroke-dashoffset` from → to (default `0% → 100%` ⇒ offset `L → 0`,
|
|
860
963
|
* the line draws in). Returns the constructed {@link CSSKeyframesAnimation} as
|
|
861
|
-
* the control handle (the
|
|
964
|
+
* the control handle (the control-handle contract — `.play()` / `.pause()` /
|
|
862
965
|
* `.stop()` / `.finished`), consistent with the `from*` factory family.
|
|
863
966
|
*
|
|
864
967
|
* The returned animation passes the EXISTING WAAPI eligibility gate
|
|
@@ -877,7 +980,7 @@ declare class FrameCompiler<V extends Vars = any> {
|
|
|
877
980
|
* // Draw a path stroke in over 2s:
|
|
878
981
|
* fromDrawSVG(pathEl, { duration: 2000 });
|
|
879
982
|
*/
|
|
880
|
-
export declare function fromDrawSVG<V extends
|
|
983
|
+
export declare function fromDrawSVG<V extends Vars = Vars>(target: SVGDrawTarget, options?: DrawSVGOptions): CSSKeyframesAnimation<V>;
|
|
881
984
|
|
|
882
985
|
/**
|
|
883
986
|
* K1 — `fromLiveAnimations`: adopt every RUNNING CSS animation on the document
|
|
@@ -892,14 +995,14 @@ export declare function fromDrawSVG<V extends Record<string, any> = any>(target:
|
|
|
892
995
|
* rule, running or not): `fromLiveAnimations` narrows to the names currently
|
|
893
996
|
* RUNNING on the page — the animations a user actually sees in motion.
|
|
894
997
|
*/
|
|
895
|
-
export declare const fromLiveAnimations: <V extends Vars =
|
|
998
|
+
export declare const fromLiveAnimations: <V extends Vars = Vars>(target?: Document | Element, options?: IngestOptions) => IngestResult<V>;
|
|
896
999
|
|
|
897
1000
|
/**
|
|
898
1001
|
* Build an SVG path-shape morph: sample two `d` strings at `samples` uniform
|
|
899
1002
|
* arc-length steps each, pair the point sets, and interpolate the `(x, y)`
|
|
900
1003
|
* pairs from the `from`-polyline (`0%`) to the `to`-polyline (`100%`). Returns
|
|
901
1004
|
* the constructed {@link CSSKeyframesAnimation} as the control handle (the
|
|
902
|
-
*
|
|
1005
|
+
* control-handle contract — `.play()` / `.pause()` / `.stop()` / `.finished`),
|
|
903
1006
|
* consistent with the `from*` factory family.
|
|
904
1007
|
*
|
|
905
1008
|
* value.js's `PathGeometry` owns the geometry (the `d`-parse + arc-length
|
|
@@ -929,13 +1032,13 @@ export declare const fromLiveAnimations: <V extends Vars = any>(target?: Documen
|
|
|
929
1032
|
* // morphing shape paints directly (no author-side reader needed on Chromium/
|
|
930
1033
|
* // Safari; `<path style="d: var(--morph-d)">` is the Firefox-lags fallback).
|
|
931
1034
|
*/
|
|
932
|
-
export declare function fromMorphSVG<V extends
|
|
1035
|
+
export declare function fromMorphSVG<V extends Vars = Vars>(from: string, to: string, options?: MorphSVGOptions): CSSKeyframesAnimation<V>;
|
|
933
1036
|
|
|
934
1037
|
/**
|
|
935
1038
|
* Build a CSS-native path-motion animation: set the author `offset-path` (and
|
|
936
1039
|
* optional `offset-rotate`) on the target(s), and sweep `offset-distance` from
|
|
937
1040
|
* → to. Returns the constructed {@link CSSKeyframesAnimation} as the control
|
|
938
|
-
* handle (the
|
|
1041
|
+
* handle (the control-handle contract — `.play()` / `.pause()` / `.stop()` / the
|
|
939
1042
|
* awaitable play promise), consistent with the `from*` factory family.
|
|
940
1043
|
*
|
|
941
1044
|
* The returned animation passes the EXISTING WAAPI eligibility gate
|
|
@@ -953,7 +1056,7 @@ export declare function fromMorphSVG<V extends Record<string, any> = any>(from:
|
|
|
953
1056
|
* duration: 2000,
|
|
954
1057
|
* });
|
|
955
1058
|
*/
|
|
956
|
-
export declare function fromMotionPath<V extends
|
|
1059
|
+
export declare function fromMotionPath<V extends Vars = Vars>(target: HTMLElement | HTMLElement[], options: MotionPathOptions): CSSKeyframesAnimation<V>;
|
|
957
1060
|
|
|
958
1061
|
/**
|
|
959
1062
|
* K1 — `fromStyleSheets`: the consumer-facing front door over
|
|
@@ -968,7 +1071,7 @@ export declare function fromMotionPath<V extends Record<string, any> = any>(targ
|
|
|
968
1071
|
* pulse?.setTargets(el).play(); // re-drive the page's OWN animation
|
|
969
1072
|
* for (const d of diagnostics) console.warn(d.code, d.message); // honest skips
|
|
970
1073
|
*/
|
|
971
|
-
export declare const fromStyleSheets: <V extends Vars =
|
|
1074
|
+
export declare const fromStyleSheets: <V extends Vars = Vars>(source?: Document | ShadowRoot | CSSStyleSheet[] | CSSStyleSheet, options?: IngestOptions) => IngestResult<V>;
|
|
972
1075
|
|
|
973
1076
|
/**
|
|
974
1077
|
* Resolve a stable name for an animation reference: the explicit `name` when
|
|
@@ -995,13 +1098,13 @@ export declare const getAnimationId: (animation: AnimationIdentity | string) =>
|
|
|
995
1098
|
*/
|
|
996
1099
|
export declare const getTimingFunction: (timingFunction: TimingFunction | TimingFunctionNames | string | undefined) => TimingFunction | undefined;
|
|
997
1100
|
|
|
998
|
-
declare const glow:
|
|
1101
|
+
declare const glow: PresetFactory;
|
|
999
1102
|
|
|
1000
|
-
declare const gradientBackground:
|
|
1103
|
+
declare const gradientBackground: PresetFactory;
|
|
1001
1104
|
|
|
1002
|
-
declare const heartbeat:
|
|
1105
|
+
declare const heartbeat: PresetFactory;
|
|
1003
1106
|
|
|
1004
|
-
declare const hover:
|
|
1107
|
+
declare const hover: PresetFactory;
|
|
1005
1108
|
|
|
1006
1109
|
/**
|
|
1007
1110
|
* One ingested animation + the diagnostics its reconstruction produced. The
|
|
@@ -1011,7 +1114,7 @@ declare const hover: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
|
1011
1114
|
* rows for THIS rule (a malformed body → `PARSE_ERROR`, etc.); the walk-level
|
|
1012
1115
|
* rows (`CORS_SKIP`) ride {@link IngestResult.diagnostics}.
|
|
1013
1116
|
*/
|
|
1014
|
-
export declare interface IngestedAnimation<V extends Vars =
|
|
1117
|
+
export declare interface IngestedAnimation<V extends Vars = Vars> {
|
|
1015
1118
|
/** The `@keyframes` identifier (CSSOM `CSSKeyframesRule.name`). */
|
|
1016
1119
|
name: string;
|
|
1017
1120
|
/** The reconstructed kf animation — replay-equal to the source CSS. */
|
|
@@ -1044,7 +1147,7 @@ export declare interface IngestOptions {
|
|
|
1044
1147
|
* `animations` for the recovered objects and `diagnostics` for the citable
|
|
1045
1148
|
* reasons the walk could not complete a step faithfully — NEVER a silent drop.
|
|
1046
1149
|
*/
|
|
1047
|
-
export declare interface IngestResult<V extends Vars =
|
|
1150
|
+
export declare interface IngestResult<V extends Vars = Vars> {
|
|
1048
1151
|
/** Every `@keyframes` rule reconstructed, keyed by its CSS name. */
|
|
1049
1152
|
animations: Map<string, IngestedAnimation<V>>;
|
|
1050
1153
|
/**
|
|
@@ -1073,9 +1176,9 @@ declare type InputAnimationOptions = Partial<{
|
|
|
1073
1176
|
composite?: CompositeOperator;
|
|
1074
1177
|
}>;
|
|
1075
1178
|
|
|
1076
|
-
declare const jumpDown:
|
|
1179
|
+
declare const jumpDown: PresetFactory;
|
|
1077
1180
|
|
|
1078
|
-
declare const jumpUp:
|
|
1181
|
+
declare const jumpUp: PresetFactory;
|
|
1079
1182
|
|
|
1080
1183
|
/**
|
|
1081
1184
|
* The core animation engine — keyframes, timing, interpolation, playback.
|
|
@@ -1085,7 +1188,7 @@ declare const jumpUp: (options?: InputAnimationOptions) => CSSKeyframesAnimation
|
|
|
1085
1188
|
* leaking a suffixed collision alias into the d.ts. The legacy `Animation`
|
|
1086
1189
|
* re-export alias was DROPPED in 5.0.0 (Q.WE1 — NO-LEGACY).
|
|
1087
1190
|
*/
|
|
1088
|
-
export declare class KeyframesAnimation<V extends Vars =
|
|
1191
|
+
export declare class KeyframesAnimation<V extends Vars = Vars> {
|
|
1089
1192
|
id: number;
|
|
1090
1193
|
name: string | undefined;
|
|
1091
1194
|
superKey: string | undefined;
|
|
@@ -1109,10 +1212,22 @@ export declare class KeyframesAnimation<V extends Vars = any> {
|
|
|
1109
1212
|
* the excised `PlaybackHost` interface; the `./playback` free functions now
|
|
1110
1213
|
* own them via `this._playback` directly (no cast, no re-publication). */
|
|
1111
1214
|
readonly _playback: PlaybackState;
|
|
1112
|
-
startTime: number | undefined;
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1215
|
+
get startTime(): number | undefined;
|
|
1216
|
+
set startTime(v: number | undefined);
|
|
1217
|
+
get pausedTime(): number;
|
|
1218
|
+
set pausedTime(v: number);
|
|
1219
|
+
get t(): number;
|
|
1220
|
+
set t(v: number);
|
|
1221
|
+
get iteration(): number;
|
|
1222
|
+
set iteration(v: number);
|
|
1223
|
+
get started(): boolean;
|
|
1224
|
+
set started(v: boolean);
|
|
1225
|
+
get done(): boolean;
|
|
1226
|
+
set done(v: boolean);
|
|
1227
|
+
get reversed(): boolean;
|
|
1228
|
+
set reversed(v: boolean);
|
|
1229
|
+
get paused(): boolean;
|
|
1230
|
+
set paused(v: boolean);
|
|
1116
1231
|
/** Structured parse/honoring diagnostics (K.W7 S4) — a FLAT additive array
|
|
1117
1232
|
* of stable-coded {@link Diagnostic} rows surfaced from `resolveKeyframes` +
|
|
1118
1233
|
* the engine's composition-fallback rows; empty on a clean parse. Every
|
|
@@ -1122,6 +1237,8 @@ export declare class KeyframesAnimation<V extends Vars = any> {
|
|
|
1122
1237
|
* per-element numeric base `add`/`accumulate` accumulates ONTO; empty for a
|
|
1123
1238
|
* pure-`replace` animation. INTERNAL — read by `./interpolate` (R.W2). */
|
|
1124
1239
|
_compositionBase: Map<string, number[]>;
|
|
1240
|
+
/** Parsed underlying CSS pose, cached once per property for a capture run. */
|
|
1241
|
+
_compositionPose: Map<string, number[]>;
|
|
1125
1242
|
/** Properties whose non-numeric composite already emitted its
|
|
1126
1243
|
* `COMPOSITION_FALLBACK` row (once per property, not per frame). INTERNAL —
|
|
1127
1244
|
* read by `./interpolate` (R.W2). */
|
|
@@ -1129,10 +1246,6 @@ export declare class KeyframesAnimation<V extends Vars = any> {
|
|
|
1129
1246
|
/** True once a non-`replace` operator was seen — the hot path skips ALL
|
|
1130
1247
|
* composition work when false. INTERNAL — read by `./interpolate` (R.W2). */
|
|
1131
1248
|
_hasComposition: boolean;
|
|
1132
|
-
started: boolean;
|
|
1133
|
-
done: boolean;
|
|
1134
|
-
reversed: boolean;
|
|
1135
|
-
paused: boolean;
|
|
1136
1249
|
/** True when an `AnimationGroup` drives this animation's `advanceTo()`/
|
|
1137
1250
|
* `interpFrames()` from its own rAF loop. Standalone `.play()` throws when
|
|
1138
1251
|
* set rather than racing the group. */
|
|
@@ -1239,14 +1352,13 @@ export declare class KeyframesAnimation<V extends Vars = any> {
|
|
|
1239
1352
|
pause(): this;
|
|
1240
1353
|
resume(): this;
|
|
1241
1354
|
/** The explicit flip: pauses if playing, resumes if paused. */
|
|
1242
|
-
toggle():
|
|
1355
|
+
toggle(): void;
|
|
1243
1356
|
stop(): void;
|
|
1244
1357
|
playing(): boolean;
|
|
1245
1358
|
get effectiveT(): number;
|
|
1246
1359
|
settle(): this;
|
|
1247
1360
|
reset(): this;
|
|
1248
1361
|
setTargets(...targets: HTMLElement[]): this;
|
|
1249
|
-
group(...animations: KeyframesAnimation<V>[]): AnimationGroup<V>;
|
|
1250
1362
|
}
|
|
1251
1363
|
|
|
1252
1364
|
/**
|
|
@@ -1258,18 +1370,7 @@ export declare class KeyframesAnimation<V extends Vars = any> {
|
|
|
1258
1370
|
*/
|
|
1259
1371
|
declare type LayerTransitionSpring = Partial<Omit<SpringProgressOptions, "initial" | "initialVelocity">>;
|
|
1260
1372
|
|
|
1261
|
-
|
|
1262
|
-
declare const loopPresets: {
|
|
1263
|
-
readonly heartbeat: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1264
|
-
readonly glow: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1265
|
-
readonly spinner: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1266
|
-
readonly rainbowText: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1267
|
-
readonly skeletonLoading: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1268
|
-
readonly gradientBackground: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1269
|
-
readonly parallaxScroll: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1270
|
-
readonly hover: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1271
|
-
readonly typingCursor: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1272
|
-
};
|
|
1373
|
+
declare const loopPresets: Readonly<Record<string, PresetFactory>>;
|
|
1273
1374
|
|
|
1274
1375
|
/** A sampled point on a path polyline. */
|
|
1275
1376
|
export declare interface MorphPoint {
|
|
@@ -1292,9 +1393,7 @@ export declare interface MorphPoint {
|
|
|
1292
1393
|
* that ALSO exposes {@link sampleD} — the morphed `d` string at a normalized
|
|
1293
1394
|
* `t`, reassembled from the interpolated point coordinates.
|
|
1294
1395
|
*/
|
|
1295
|
-
export declare class MorphSVG<V extends
|
|
1296
|
-
/** The underlying coordinate-interpolating animation — the control handle. */
|
|
1297
|
-
readonly animation: CSSKeyframesAnimation<V>;
|
|
1396
|
+
export declare class MorphSVG<V extends Vars = Vars> extends SVGAnimationHandle<V> {
|
|
1298
1397
|
/** The uniform-sample count (point pairs = samples + 1). */
|
|
1299
1398
|
readonly samples: number;
|
|
1300
1399
|
constructor(from: string, to: string, options?: MorphSVGOptions);
|
|
@@ -1306,14 +1405,6 @@ export declare class MorphSVG<V extends Record<string, any> = any> {
|
|
|
1306
1405
|
* from BOTH endpoint polylines at any interior `t`.
|
|
1307
1406
|
*/
|
|
1308
1407
|
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
1408
|
}
|
|
1318
1409
|
|
|
1319
1410
|
export declare interface MorphSVGOptions extends Partial<InputAnimationOptions> {
|
|
@@ -1372,16 +1463,8 @@ export declare interface MorphSVGOptions extends Partial<InputAnimationOptions>
|
|
|
1372
1463
|
* the factory: `new MotionPath(target, { path }).animation` is the control
|
|
1373
1464
|
* handle. The factory is the canonical entry; this is a thin ergonomic wrapper.
|
|
1374
1465
|
*/
|
|
1375
|
-
export declare class MotionPath<V extends
|
|
1376
|
-
/** The underlying offset-distance animation — the control handle. */
|
|
1377
|
-
readonly animation: CSSKeyframesAnimation<V>;
|
|
1466
|
+
export declare class MotionPath<V extends Vars = Vars> extends SVGAnimationHandle<V> {
|
|
1378
1467
|
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
1468
|
}
|
|
1386
1469
|
|
|
1387
1470
|
export declare interface MotionPathOptions extends Partial<InputAnimationOptions> {
|
|
@@ -1438,7 +1521,7 @@ declare type NativeTimelineSpec = {
|
|
|
1438
1521
|
inset?: string;
|
|
1439
1522
|
};
|
|
1440
1523
|
|
|
1441
|
-
declare const notificationBounce:
|
|
1524
|
+
declare const notificationBounce: PresetFactory;
|
|
1442
1525
|
|
|
1443
1526
|
/**
|
|
1444
1527
|
* Q.WB3 S2 — the precomputed SoA fold layout for ONE compiled frame's NUMERIC
|
|
@@ -1473,7 +1556,7 @@ declare interface NumericFoldPlan<V extends Vars> {
|
|
|
1473
1556
|
*/
|
|
1474
1557
|
export declare type OffsetPath = string;
|
|
1475
1558
|
|
|
1476
|
-
declare const parallaxScroll:
|
|
1559
|
+
declare const parallaxScroll: PresetFactory;
|
|
1477
1560
|
|
|
1478
1561
|
declare type ParsedVarMap = Record<string, ValueArray>;
|
|
1479
1562
|
|
|
@@ -1528,12 +1611,36 @@ export declare function pinCSS(opts?: {
|
|
|
1528
1611
|
bottom?: number;
|
|
1529
1612
|
}): string;
|
|
1530
1613
|
|
|
1614
|
+
declare interface PlainLeafWriter {
|
|
1615
|
+
/** The nested parent object the leaf lives on. */
|
|
1616
|
+
obj: Record<string, unknown>;
|
|
1617
|
+
/** The leaf's own (last dot-segment) key on `obj`. */
|
|
1618
|
+
key: string;
|
|
1619
|
+
/** The live `ValueUnit[]` whose `.value`(s) the interp stride mutates in place. */
|
|
1620
|
+
units: ValueUnit[];
|
|
1621
|
+
/**
|
|
1622
|
+
* True iff the leaf is a single unitless numeric unit → write `.value` (a
|
|
1623
|
+
* bare `number`, zero-alloc). False → a units/color/multi-component leaf,
|
|
1624
|
+
* projected to its authored STRING each refresh (the units/color residual).
|
|
1625
|
+
*/
|
|
1626
|
+
numeric: boolean;
|
|
1627
|
+
}
|
|
1628
|
+
|
|
1629
|
+
declare interface PlainProjection {
|
|
1630
|
+
/** The nested plain object a custom `transform` consumes (`plainVars`). */
|
|
1631
|
+
root: Record<string, unknown>;
|
|
1632
|
+
/** The per-leaf refresh writers, in flat-key order. */
|
|
1633
|
+
writers: PlainLeafWriter[];
|
|
1634
|
+
}
|
|
1635
|
+
|
|
1531
1636
|
/**
|
|
1532
|
-
*
|
|
1533
|
-
* `
|
|
1534
|
-
*
|
|
1535
|
-
*
|
|
1536
|
-
*
|
|
1637
|
+
* `engine/playback-state.ts` — the `PlaybackState` run-state STORE, carved off
|
|
1638
|
+
* `engine/play-lifecycle.ts` at S.B2 on the STATE↔BEHAVIOR cohesion seam (the
|
|
1639
|
+
* play machine's free functions live in `./play-lifecycle`; the state they mutate lives
|
|
1640
|
+
* HERE). A value.js-free leaf struct: it owns the standalone-play machine's OWN
|
|
1641
|
+
* run-state so the state has a SINGLE owner instead of being scattered as
|
|
1642
|
+
* privates the class re-published through a cast (R.W2 dissolved the
|
|
1643
|
+
* `PlaybackHost` privacy-inversion).
|
|
1537
1644
|
*
|
|
1538
1645
|
* - `resolvePromise` — the standalone-loop deferred resolver (`playRAF`
|
|
1539
1646
|
* arms it, `resolvePlay` fires it).
|
|
@@ -1545,6 +1652,20 @@ export declare function pinCSS(opts?: {
|
|
|
1545
1652
|
* re-bound per loop (the per-loop-closure-free idiom).
|
|
1546
1653
|
* - `_interpOut` — the ONE hoisted interp buffer the play loop reuses
|
|
1547
1654
|
* every frame (zero-alloc steady state).
|
|
1655
|
+
*
|
|
1656
|
+
* ── S.B2 (C-15) — PlaybackState is the SOLE STORAGE for the run-state FSM.
|
|
1657
|
+
* The eight transition fields (`started`/`done`/`paused`/`reversed`/`iteration`/
|
|
1658
|
+
* `t`/`startTime`/`pausedTime`) fold OFF the `KeyframesAnimation` class body and
|
|
1659
|
+
* live HERE as the single backing store; the class exposes them as accessor
|
|
1660
|
+
* delegates over `this._playback.*` (so the FSM stays a public, externally-written
|
|
1661
|
+
* surface — `group/`, `sequence/`, `ingest/`, `waapi/`, the tests, and the demo's
|
|
1662
|
+
* `contractAnim.t =` writes all keep working through the accessors). The
|
|
1663
|
+
* engine-INTERNAL hot path reads/writes `anim._playback.*` DIRECTLY (one extra
|
|
1664
|
+
* monomorphic load — a shape cost, not an allocation; proof:standalone-zero-alloc
|
|
1665
|
+
* / proof:interp-fastprops stay green). `managed` is deliberately NOT here — it is
|
|
1666
|
+
* loop-OWNERSHIP, not run-state, and never resets in `settle`. The literal
|
|
1667
|
+
* single-WRITER hard fold (a public `seek(ms)` verb + MIGRATION) is a future
|
|
1668
|
+
* BREAKING wave (§8-3), out of S scope.
|
|
1548
1669
|
*/
|
|
1549
1670
|
declare class PlaybackState {
|
|
1550
1671
|
resolvePromise: ((value: void | PromiseLike<void>) => void) | null;
|
|
@@ -1552,9 +1673,19 @@ declare class PlaybackState {
|
|
|
1552
1673
|
_waAnimations: globalThis.Animation[];
|
|
1553
1674
|
readonly _boundFrame: (t: number) => boolean | Promise<boolean>;
|
|
1554
1675
|
readonly _interpOut: Record<string, unknown>;
|
|
1676
|
+
startTime: number | undefined;
|
|
1677
|
+
pausedTime: number;
|
|
1678
|
+
t: number;
|
|
1679
|
+
iteration: number;
|
|
1680
|
+
started: boolean;
|
|
1681
|
+
done: boolean;
|
|
1682
|
+
reversed: boolean;
|
|
1683
|
+
paused: boolean;
|
|
1555
1684
|
constructor(frameCb: (t: number) => boolean | Promise<boolean>);
|
|
1556
1685
|
}
|
|
1557
1686
|
|
|
1687
|
+
declare type PresetFactory = (options?: InputAnimationOptions) => CSSKeyframesAnimation<any>;
|
|
1688
|
+
|
|
1558
1689
|
export declare namespace presets {
|
|
1559
1690
|
export {
|
|
1560
1691
|
fadeIn,
|
|
@@ -1603,57 +1734,16 @@ export declare namespace presets {
|
|
|
1603
1734
|
}
|
|
1604
1735
|
}
|
|
1605
1736
|
|
|
1606
|
-
/**
|
|
1607
|
-
* The full preset taxonomy, grouped by intent. Each leaf is one of the
|
|
1608
|
-
* existing exported factory functions — the taxonomy is a discovery index over
|
|
1609
|
-
* the library, not a second copy of it.
|
|
1610
|
-
*/
|
|
1611
1737
|
declare const presetTaxonomy: {
|
|
1612
|
-
readonly enter:
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
readonly slideInRight: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1617
|
-
readonly rotateIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1618
|
-
readonly blurIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1619
|
-
readonly springScaleIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1620
|
-
readonly springSlideIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1621
|
-
readonly jumpUp: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1622
|
-
};
|
|
1623
|
-
readonly exit: {
|
|
1624
|
-
readonly fadeOut: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1625
|
-
readonly slideOutLeft: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1626
|
-
readonly slideOutRight: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1627
|
-
readonly blurOut: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1628
|
-
readonly warpLeft: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1629
|
-
readonly warpRight: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1630
|
-
readonly jumpDown: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1631
|
-
};
|
|
1632
|
-
readonly attention: {
|
|
1633
|
-
readonly pulse: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1634
|
-
readonly shake: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1635
|
-
readonly bounce: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1636
|
-
readonly flip: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1637
|
-
readonly notificationBounce: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1638
|
-
readonly springPop: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1639
|
-
readonly springWobble: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1640
|
-
};
|
|
1641
|
-
readonly loop: {
|
|
1642
|
-
readonly heartbeat: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1643
|
-
readonly glow: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1644
|
-
readonly spinner: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1645
|
-
readonly rainbowText: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1646
|
-
readonly skeletonLoading: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1647
|
-
readonly gradientBackground: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1648
|
-
readonly parallaxScroll: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1649
|
-
readonly hover: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1650
|
-
readonly typingCursor: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1651
|
-
};
|
|
1738
|
+
readonly enter: Readonly<Record<string, PresetFactory>>;
|
|
1739
|
+
readonly exit: Readonly<Record<string, PresetFactory>>;
|
|
1740
|
+
readonly attention: Readonly<Record<string, PresetFactory>>;
|
|
1741
|
+
readonly loop: Readonly<Record<string, PresetFactory>>;
|
|
1652
1742
|
};
|
|
1653
1743
|
|
|
1654
|
-
declare const progressBar:
|
|
1744
|
+
declare const progressBar: PresetFactory;
|
|
1655
1745
|
|
|
1656
|
-
declare const pulse:
|
|
1746
|
+
declare const pulse: PresetFactory;
|
|
1657
1747
|
|
|
1658
1748
|
/**
|
|
1659
1749
|
* THE managed rAF driver. Owns the rAF handle, start timestamp, dt clock,
|
|
@@ -1773,7 +1863,7 @@ declare interface RAFPlaybackOptions {
|
|
|
1773
1863
|
respectReducedMotion?: boolean | undefined;
|
|
1774
1864
|
}
|
|
1775
1865
|
|
|
1776
|
-
declare const rainbowText:
|
|
1866
|
+
declare const rainbowText: PresetFactory;
|
|
1777
1867
|
|
|
1778
1868
|
export { RangeBoundary }
|
|
1779
1869
|
|
|
@@ -1928,7 +2018,7 @@ export declare const resolveKeyframes: (input: string | Stylesheet, env?: Resolv
|
|
|
1928
2018
|
* normalises a STRING of CSS, `resolveLiveKeyframes` normalises the LIVE CSSOM —
|
|
1929
2019
|
* the parser pointed forward at the web the page already ships.
|
|
1930
2020
|
*/
|
|
1931
|
-
export declare const resolveLiveKeyframes: <V extends Vars =
|
|
2021
|
+
export declare const resolveLiveKeyframes: <V extends Vars = Vars>(source?: Document | ShadowRoot | CSSStyleSheet[] | CSSStyleSheet, options?: IngestOptions) => IngestResult<V>;
|
|
1932
2022
|
|
|
1933
2023
|
/**
|
|
1934
2024
|
* Resolve a parsed `AnimationRangeValue` (or `undefined` → the whole [0,1]
|
|
@@ -1938,9 +2028,9 @@ export declare const resolveLiveKeyframes: <V extends Vars = any>(source?: Docum
|
|
|
1938
2028
|
*/
|
|
1939
2029
|
export declare function resolveRange(range: AnimationRangeValue | undefined): ResolvedRange;
|
|
1940
2030
|
|
|
1941
|
-
declare const rotateIn:
|
|
2031
|
+
declare const rotateIn: PresetFactory;
|
|
1942
2032
|
|
|
1943
|
-
declare const rotateScale:
|
|
2033
|
+
declare const rotateScale: PresetFactory;
|
|
1944
2034
|
|
|
1945
2035
|
/**
|
|
1946
2036
|
* The full SO-1 round-trip in one call: `parse → serialize`. Returns the typed
|
|
@@ -1953,9 +2043,17 @@ export declare function roundTripScrollCSS(input: string | Stylesheet): {
|
|
|
1953
2043
|
declarations: ReturnType<typeof serializeScrollOptions>;
|
|
1954
2044
|
};
|
|
1955
2045
|
|
|
1956
|
-
/**
|
|
2046
|
+
/** The backend selected for a scroll-driven animation. */
|
|
1957
2047
|
export declare type ScrollBackend = "native" | "js";
|
|
1958
2048
|
|
|
2049
|
+
/** The single handle returned by `driveScrollCSS`. */
|
|
2050
|
+
export declare interface ScrollCSSDrive<V extends Vars = Vars> {
|
|
2051
|
+
readonly scene: ScrollScene;
|
|
2052
|
+
readonly trigger?: TriggerScene;
|
|
2053
|
+
readonly backend: ScrollBackend;
|
|
2054
|
+
readonly reason?: string;
|
|
2055
|
+
}
|
|
2056
|
+
|
|
1959
2057
|
/** The dispatch verdict — which backend, and (for JS) the human-readable reason. */
|
|
1960
2058
|
export declare type ScrollDispatch = {
|
|
1961
2059
|
backend: "native";
|
|
@@ -1983,6 +2081,27 @@ export declare interface ScrollDispatchRequest<V extends Vars> {
|
|
|
1983
2081
|
velocity?: boolean | undefined;
|
|
1984
2082
|
}
|
|
1985
2083
|
|
|
2084
|
+
/** Options for the composed `driveScrollCSS` entry. */
|
|
2085
|
+
export declare interface ScrollDriveOptions<V extends Vars = Vars> extends Omit<ScrollSceneOptions, "range"> {
|
|
2086
|
+
/** Explicit native timeline mapping; otherwise it is derived from CSS. */
|
|
2087
|
+
nativeSpec?: NativeTimelineSpec;
|
|
2088
|
+
/** Animation to offer to the native eligibility/attachment lane. */
|
|
2089
|
+
animation?: KeyframesAnimation<V>;
|
|
2090
|
+
/** Force the JS backend for a velocity/non-DOM driver. */
|
|
2091
|
+
velocity?: boolean;
|
|
2092
|
+
/** Native scroll source when the parsed timeline is `scroll()`. */
|
|
2093
|
+
source?: Element | null;
|
|
2094
|
+
/** Native view subject when the parsed timeline is `view()`. */
|
|
2095
|
+
subject?: Element;
|
|
2096
|
+
/** Native timeline axis override (CSS's parsed axis remains the default). */
|
|
2097
|
+
axis?: ScrollTimelineAxis;
|
|
2098
|
+
/** Native view inset override. */
|
|
2099
|
+
inset?: string;
|
|
2100
|
+
}
|
|
2101
|
+
|
|
2102
|
+
/** A positional target may be an animation (for WAAPI) or a view subject. */
|
|
2103
|
+
export declare type ScrollDriveTarget<V extends Vars = Vars> = KeyframesAnimation<V> | Element | null | undefined;
|
|
2104
|
+
|
|
1986
2105
|
/**
|
|
1987
2106
|
* The kf `ScrollScene` JS DRIVER (SO-2). Drives an engine's progress from a raw
|
|
1988
2107
|
* scroll position through the parsed `animation-range`, composing the SHIPPED
|
|
@@ -2115,7 +2234,7 @@ declare type ScrollTimelineAxis = "block" | "inline" | "x" | "y";
|
|
|
2115
2234
|
* and drives them via `Animation.advanceTo`. See the module docstring for the
|
|
2116
2235
|
* booked name + subsumption decision.
|
|
2117
2236
|
*/
|
|
2118
|
-
declare class Sequence<V extends Vars =
|
|
2237
|
+
declare class Sequence<V extends Vars = Vars> implements SequencePlayContext<V> {
|
|
2119
2238
|
/** Resolved segments, in insertion order. */
|
|
2120
2239
|
readonly entries: SequenceEntry<V>[];
|
|
2121
2240
|
/** Named positions on the master clock, registered via {@link label}. */
|
|
@@ -2135,13 +2254,14 @@ declare class Sequence<V extends Vars = any> implements SequencePlayContext<V> {
|
|
|
2135
2254
|
private cursor;
|
|
2136
2255
|
/** Master clock (ms) of the current playhead. */
|
|
2137
2256
|
_time: number;
|
|
2138
|
-
|
|
2257
|
+
/* Excluded from this release type: respectReducedMotion */
|
|
2139
2258
|
/** THE rAF owner for the sequence's play loop. */
|
|
2140
2259
|
readonly playback: RAFPlayback;
|
|
2141
|
-
|
|
2260
|
+
/* Excluded from this release type: _boundFrame */
|
|
2142
2261
|
_resolvePlay: (() => void) | null;
|
|
2143
2262
|
_playOrigin: number | undefined;
|
|
2144
|
-
|
|
2263
|
+
/* Excluded from this release type: _playingPromise */
|
|
2264
|
+
private _duration;
|
|
2145
2265
|
/**
|
|
2146
2266
|
* The scalar playback rate — the single field that drives `timeScale`
|
|
2147
2267
|
* and `reverse`. `_rate = 1` is real-time forward (the existing
|
|
@@ -2231,17 +2351,6 @@ declare class Sequence<V extends Vars = any> implements SequencePlayContext<V> {
|
|
|
2231
2351
|
* set on each `animation` directly before `.add`. Chainable.
|
|
2232
2352
|
*/
|
|
2233
2353
|
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
2354
|
/**
|
|
2246
2355
|
* The completion front-door (G.W13) — `await sequence.finished` resolves
|
|
2247
2356
|
* once the in-flight transport settles. Exposes the ONE held
|
|
@@ -2251,55 +2360,34 @@ declare class Sequence<V extends Vars = any> implements SequencePlayContext<V> {
|
|
|
2251
2360
|
* sequence resolves immediately.
|
|
2252
2361
|
*/
|
|
2253
2362
|
get finished(): Promise<void>;
|
|
2363
|
+
/** Drive the sequence over real time via `RAFPlayback` — re-entrant, and
|
|
2364
|
+
* PRM-aware. Body in `./lifecycle` (S.B5). */
|
|
2254
2365
|
play(): Promise<void>;
|
|
2255
2366
|
_frame(clock: number): Promise<boolean>;
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
/** Halt the play loop where it stands and resolve any pending `play()`. */
|
|
2367
|
+
/** Halt the play loop where it stands and resolve any pending `play()`.
|
|
2368
|
+
* Body in `./lifecycle` (S.B5). */
|
|
2259
2369
|
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
|
-
*/
|
|
2370
|
+
/** Halt the play loop WITHOUT releasing the playhead — the managed-pause
|
|
2371
|
+
* contract (`_time` + the play promise are retained for `resume`). No-op when
|
|
2372
|
+
* not playing or already paused. Body in `./lifecycle` (S.B5). */
|
|
2267
2373
|
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
|
-
*/
|
|
2374
|
+
/** Resume a paused sequence — restart the rAF loop with the origin
|
|
2375
|
+
* re-anchored so the first resumed frame's master clock equals the retained
|
|
2376
|
+
* `_time` (no forward jump). No-op when not paused. Body in `./lifecycle`. */
|
|
2275
2377
|
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
|
-
*/
|
|
2378
|
+
/** Set the scalar playback rate — slow-mo (`< 1`), real-time (`1`),
|
|
2379
|
+
* fast-forward (`> 1`), or backward (`< 0`, the {@link reverse} form); the
|
|
2380
|
+
* master clock is re-anchored so the playhead is C⁰-continuous at the flip.
|
|
2381
|
+
* Body in `./lifecycle` (S.B5). */
|
|
2284
2382
|
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
|
-
*/
|
|
2383
|
+
/** Flip the playback direction — the playhead walks backward (negative rate)
|
|
2384
|
+
* or forward again, preserving `|rate|`, C⁰-continuous. Body in `./lifecycle`. */
|
|
2291
2385
|
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
|
-
*/
|
|
2386
|
+
/** Set how many cycles `play()` runs before settling — `1` single-play, `n`
|
|
2387
|
+
* cycles, `Infinity` loops forever. Body in `./lifecycle` (S.B5). */
|
|
2297
2388
|
repeat(count: number): this;
|
|
2298
|
-
/**
|
|
2299
|
-
*
|
|
2300
|
-
* (`duration − phase`) so the playhead bounces back and forth across the
|
|
2301
|
-
* `repeat` cycles. Chainable.
|
|
2302
|
-
*/
|
|
2389
|
+
/** Toggle yoyo (ping-pong) — odd cycles run reflected across the `repeat`
|
|
2390
|
+
* cycles. Body in `./lifecycle` (S.B5). */
|
|
2303
2391
|
yoyo(on?: boolean): this;
|
|
2304
2392
|
}
|
|
2305
2393
|
|
|
@@ -2462,19 +2550,19 @@ export declare function serializeScrollOptions(opts: CSSTimelineOptions): {
|
|
|
2462
2550
|
"animation-trigger"?: string;
|
|
2463
2551
|
};
|
|
2464
2552
|
|
|
2465
|
-
declare const shake:
|
|
2553
|
+
declare const shake: PresetFactory;
|
|
2466
2554
|
|
|
2467
|
-
declare const skeletonLoading:
|
|
2555
|
+
declare const skeletonLoading: PresetFactory;
|
|
2468
2556
|
|
|
2469
|
-
declare const slideIn:
|
|
2557
|
+
declare const slideIn: PresetFactory;
|
|
2470
2558
|
|
|
2471
|
-
declare const slideInLeft:
|
|
2559
|
+
declare const slideInLeft: PresetFactory;
|
|
2472
2560
|
|
|
2473
|
-
declare const slideInRight:
|
|
2561
|
+
declare const slideInRight: PresetFactory;
|
|
2474
2562
|
|
|
2475
|
-
declare const slideOutLeft:
|
|
2563
|
+
declare const slideOutLeft: PresetFactory;
|
|
2476
2564
|
|
|
2477
|
-
declare const slideOutRight:
|
|
2565
|
+
declare const slideOutRight: PresetFactory;
|
|
2478
2566
|
|
|
2479
2567
|
declare interface SmoothProgressOptions {
|
|
2480
2568
|
/** Damping factor (0, 1]. Higher = faster convergence. Default 0.1 */
|
|
@@ -2533,7 +2621,11 @@ declare interface SoALayerPlan {
|
|
|
2533
2621
|
/** The pure-numeric carrier units the fold seeds the composite buffer from + writes back to. */
|
|
2534
2622
|
carriers: ValueUnit<number>[];
|
|
2535
2623
|
/** The incoming numeric units folded against each carrier (parallel to `carriers`). */
|
|
2536
|
-
|
|
2624
|
+
incomingSlots: Array<{
|
|
2625
|
+
values: Record<string, unknown>;
|
|
2626
|
+
key: string;
|
|
2627
|
+
index: number;
|
|
2628
|
+
}>;
|
|
2537
2629
|
/**
|
|
2538
2630
|
* The keys this layer touches that the SoA fold does NOT cover — a non-array
|
|
2539
2631
|
* carrier (first-touch of a key, or a scalar that a lower layer left
|
|
@@ -2543,14 +2635,20 @@ declare interface SoALayerPlan {
|
|
|
2543
2635
|
* `add`/`weighted` blend stays byte-identical on the non-numeric tail. EMPTY
|
|
2544
2636
|
* for the dominant all-numeric transform shape (every leaf a numeric
|
|
2545
2637
|
* `ValueUnit[]`), so the whole `for..in` collapses to the SoA fold.
|
|
2546
|
-
|
|
2547
|
-
|
|
2638
|
+
*
|
|
2639
|
+
* S.F5a S1 — a precomputed `Set`, built ONCE here at `buildSoAPlans`
|
|
2640
|
+
* (structural-change time). The compositor's boxed residual (`boxedBlendArm`)
|
|
2641
|
+
* takes it DIRECTLY as its `only` membership test — killing the per-frame
|
|
2642
|
+
* `new Set(only)` the boxed arm rebuilt every frame on the mixed-leaf shape
|
|
2643
|
+
* (the allocation is hoisted to plan-build time, `proof:zero-alloc`
|
|
2644
|
+
* mixed-leaf clause).
|
|
2645
|
+
*/
|
|
2646
|
+
boxedKeys: Set<string>;
|
|
2548
2647
|
}
|
|
2549
2648
|
|
|
2550
|
-
declare const spinner:
|
|
2649
|
+
declare const spinner: PresetFactory;
|
|
2551
2650
|
|
|
2552
|
-
|
|
2553
|
-
declare const springPop: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
2651
|
+
declare const springPop: PresetFactory;
|
|
2554
2652
|
|
|
2555
2653
|
/**
|
|
2556
2654
|
* iOS-style spring physics options. The pair `(response, dampingFraction)`
|
|
@@ -2609,17 +2707,37 @@ declare interface SpringProgressOptions {
|
|
|
2609
2707
|
respectReducedMotion: ReducedMotionPolicy;
|
|
2610
2708
|
}
|
|
2611
2709
|
|
|
2710
|
+
declare const springScaleIn: PresetFactory;
|
|
2711
|
+
|
|
2712
|
+
declare const springSlideIn: PresetFactory;
|
|
2713
|
+
|
|
2714
|
+
declare const springWobble: PresetFactory;
|
|
2715
|
+
|
|
2612
2716
|
/**
|
|
2613
|
-
*
|
|
2614
|
-
*
|
|
2717
|
+
* Feature-detect native `animation-trigger` — Chrome 145+ ships it; nothing else
|
|
2718
|
+
* (yet) does. `CSS.supports` is the FEATURE probe (never a UA sniff — r5 / the
|
|
2719
|
+
* CE-1.0 precedent). Returns `false` where `CSS`/`CSS.supports` is absent (SSR,
|
|
2720
|
+
* jsdom) OR the property/keyword is unknown, so the caller keeps the kf driver.
|
|
2615
2721
|
*/
|
|
2616
|
-
declare
|
|
2617
|
-
|
|
2618
|
-
/** Spring-eased slide-up entrance — the snappy spring (ζ 0.78). */
|
|
2619
|
-
declare const springSlideIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
2722
|
+
export declare function supportsNativeTrigger(): boolean;
|
|
2620
2723
|
|
|
2621
|
-
|
|
2622
|
-
|
|
2724
|
+
declare abstract class SVGAnimationHandle<V extends Vars = Vars> {
|
|
2725
|
+
readonly animation: CSSKeyframesAnimation<V>;
|
|
2726
|
+
/**
|
|
2727
|
+
* The underlying animation — the control handle. Set by the subclass through
|
|
2728
|
+
* `super(fromX(...))` (the `fromX` factory is the canonical construction).
|
|
2729
|
+
*/
|
|
2730
|
+
constructor(animation: CSSKeyframesAnimation<V>);
|
|
2731
|
+
/** Start (or re-enter) the play loop. Resolves when the animation completes. */
|
|
2732
|
+
play(): Promise<void>;
|
|
2733
|
+
/** Pause the play loop, retaining the playhead. Chainable. */
|
|
2734
|
+
pause(): this;
|
|
2735
|
+
/** Halt and rewind the play loop. Chainable. */
|
|
2736
|
+
stop(): this;
|
|
2737
|
+
/** Resolve once the animation completes — the {@link Animation.finished}
|
|
2738
|
+
* completion front-door, uniform across every SVG handle. */
|
|
2739
|
+
get finished(): Promise<void>;
|
|
2740
|
+
}
|
|
2623
2741
|
|
|
2624
2742
|
/**
|
|
2625
2743
|
* The minimal geometry contract DrawSVG needs: any SVG element that exposes
|
|
@@ -2650,7 +2768,7 @@ declare interface TemplateAnimationFrame<V extends Vars> {
|
|
|
2650
2768
|
composition?: CompositeOperator;
|
|
2651
2769
|
}
|
|
2652
2770
|
|
|
2653
|
-
declare const textFocusBlur:
|
|
2771
|
+
declare const textFocusBlur: PresetFactory;
|
|
2654
2772
|
|
|
2655
2773
|
/**
|
|
2656
2774
|
* A dt-driven stepper the {@link RAFPlayback.drive} loop can own:
|
|
@@ -2713,7 +2831,7 @@ declare interface TimelineOptions {
|
|
|
2713
2831
|
*
|
|
2714
2832
|
* ```ts
|
|
2715
2833
|
* const easing = await resolveEasing("ease-out-cubic");
|
|
2716
|
-
* new
|
|
2834
|
+
* new KeyframesScrollTimeline({ easing });
|
|
2717
2835
|
* ```
|
|
2718
2836
|
*/
|
|
2719
2837
|
easing?: TimingFunction | Easing | undefined;
|
|
@@ -2744,9 +2862,92 @@ declare type TransformFunction<V extends Vars> = (v: V, t: number) => void;
|
|
|
2744
2862
|
*/
|
|
2745
2863
|
export declare function transformTargetsStyle<V extends Vars>(vars: V, targets: HTMLElement[], flat?: boolean): void;
|
|
2746
2864
|
|
|
2747
|
-
|
|
2865
|
+
/** The play direction a trigger cycle runs — `alternate` flips it each entry. */
|
|
2866
|
+
export declare type TriggerDirection = "forward" | "backward";
|
|
2867
|
+
|
|
2868
|
+
/**
|
|
2869
|
+
* The kf `TriggerScene` — realizes a parsed `AnimationTriggerValue` as the
|
|
2870
|
+
* idle→active→done lifecycle over a raw scroll position. The caller drives the
|
|
2871
|
+
* loop (`triggerProgress(p)` per scroll event); the scene owns no rAF and no
|
|
2872
|
+
* DOM. The four `<trigger-type>`s differ ONLY in their crossing semantics:
|
|
2873
|
+
*
|
|
2874
|
+
* • `once` — fires once. `idle →enter→ active →exit→ done`; `done` LATCHES
|
|
2875
|
+
* (a re-entry never re-fires). The one-shot reveal.
|
|
2876
|
+
* • `repeat` — re-fires. `idle →enter→ active →exit→ idle` (RESET — the exit
|
|
2877
|
+
* returns to the pre-animation state); each re-entry re-plays
|
|
2878
|
+
* forward, `cycles` incrementing. Never permanently `done`.
|
|
2879
|
+
* • `alternate` — re-fires with a FLIPPED direction. `idle →enter→
|
|
2880
|
+
* active(forward) →exit→ done →enter→ active(backward) → …`;
|
|
2881
|
+
* `direction` alternates each entry (the backward semantics).
|
|
2882
|
+
* • `state` — the play state FOLLOWS presence. `inside ⇒ active`,
|
|
2883
|
+
* `outside ⇒ done` (after the first entry) — the playhead is
|
|
2884
|
+
* HELD across the boundary (pause/resume, NOT reset).
|
|
2885
|
+
*
|
|
2886
|
+
* The `playhead` (0..1) is the animation's own progress the consumer writes to
|
|
2887
|
+
* an engine; it advances with the within-range fraction while `active`. The gate
|
|
2888
|
+
* asserts the STATE sequence (scrub-based, C-10 — never a frame/ms threshold).
|
|
2889
|
+
*/
|
|
2890
|
+
export declare class TriggerScene {
|
|
2891
|
+
/** The parsed `<trigger-type>` (CSS initial value is `once`). */
|
|
2892
|
+
readonly type: TriggerType;
|
|
2893
|
+
private readonly triggerRange;
|
|
2894
|
+
private _state;
|
|
2895
|
+
private _direction;
|
|
2896
|
+
private _playhead;
|
|
2897
|
+
private _cycles;
|
|
2898
|
+
private wasInside;
|
|
2899
|
+
private everEntered;
|
|
2900
|
+
constructor(trigger?: AnimationTriggerValue);
|
|
2901
|
+
/** The current lifecycle state. */
|
|
2902
|
+
get state(): TriggerState;
|
|
2903
|
+
/** The current play direction (`alternate` flips it each entry). */
|
|
2904
|
+
get direction(): TriggerDirection;
|
|
2905
|
+
/** The animation's own progress (0..1) — the engine-write the driver tracks. */
|
|
2906
|
+
get playhead(): number;
|
|
2907
|
+
/** How many times the trigger has fired (entered `active` from idle/done). */
|
|
2908
|
+
get cycles(): number;
|
|
2909
|
+
/** The resolved [start,end] scroll-extent fractions of the trigger range. */
|
|
2910
|
+
get range(): ResolvedRange;
|
|
2911
|
+
/**
|
|
2912
|
+
* True when the platform will run this trigger NATIVELY (Chrome 145+). The
|
|
2913
|
+
* dispatch is the caller's: `usesNative` ⇒ author a native `animation-trigger`
|
|
2914
|
+
* declaration; else drive THIS scene. Feature-detected, never UA-sniffed.
|
|
2915
|
+
*/
|
|
2916
|
+
get usesNative(): boolean;
|
|
2917
|
+
/**
|
|
2918
|
+
* Drive the trigger from a raw scroll position `p ∈ [0,1]` (the caller
|
|
2919
|
+
* resolves the live scroller; kf maps it over the trigger range). Advances
|
|
2920
|
+
* the idle→active→done state machine per the `<trigger-type>` semantics and
|
|
2921
|
+
* returns the new state.
|
|
2922
|
+
*/
|
|
2923
|
+
triggerProgress(p: number): TriggerState;
|
|
2924
|
+
/** Rewind the lifecycle to `idle` (re-arm a `once`/`state` scene). */
|
|
2925
|
+
reset(): void;
|
|
2926
|
+
/** `once` — fire once, then LATCH `done` (a re-entry never re-fires). */
|
|
2927
|
+
private stepOnce;
|
|
2928
|
+
/** `repeat` — RESET to `idle` on exit; each re-entry re-plays forward. */
|
|
2929
|
+
private stepRepeat;
|
|
2930
|
+
/** `alternate` — exit `done`; each re-entry FLIPS the play direction. */
|
|
2931
|
+
private stepAlternate;
|
|
2932
|
+
/** `state` — play state FOLLOWS presence; the playhead is HELD across exits. */
|
|
2933
|
+
private stepState;
|
|
2934
|
+
private directedPlayhead;
|
|
2935
|
+
}
|
|
2936
|
+
|
|
2937
|
+
/**
|
|
2938
|
+
* The three lifecycle states a `<single-animation-trigger>` traverses:
|
|
2939
|
+
* • `idle` — the timeline has not (yet) triggered the animation.
|
|
2940
|
+
* • `active` — the trigger fired; the animation is playing.
|
|
2941
|
+
* • `done` — the trigger cycle completed (latched for `once`; transient for
|
|
2942
|
+
* the re-firing types).
|
|
2943
|
+
* The canonical `once` lifecycle is `idle → active → done`; the other three
|
|
2944
|
+
* types are variations over the SAME vocabulary (§`triggerProgress`).
|
|
2945
|
+
*/
|
|
2946
|
+
export declare type TriggerState = "idle" | "active" | "done";
|
|
2947
|
+
|
|
2948
|
+
declare const typewriter: PresetFactory;
|
|
2748
2949
|
|
|
2749
|
-
declare const typingCursor:
|
|
2950
|
+
declare const typingCursor: PresetFactory;
|
|
2750
2951
|
|
|
2751
2952
|
/**
|
|
2752
2953
|
* `validate(css, opts?)` — the READ-ONLY projection over the three typed channels
|
|
@@ -2788,7 +2989,7 @@ export declare interface ValidateOptions {
|
|
|
2788
2989
|
*/
|
|
2789
2990
|
export declare interface ValidateResult {
|
|
2790
2991
|
/**
|
|
2791
|
-
* True iff
|
|
2992
|
+
* True iff the adapter produced no `EMPTY_PARSE` diagnostic — the
|
|
2792
2993
|
* block surfaced at least one recognized stylesheet item (a `@keyframes` /
|
|
2793
2994
|
* `@property` / style rule). A spec-invalid keyframe `!important` declaration
|
|
2794
2995
|
* is SILENTLY dropped at the AST by value.js (the L.W1 S1 reality) — that drop
|
|
@@ -2827,6 +3028,52 @@ declare type Vars<T = any> = {
|
|
|
2827
3028
|
[arg: string]: number | string | T;
|
|
2828
3029
|
};
|
|
2829
3030
|
|
|
3031
|
+
/** Options for {@link compileToViewTransition}, extending {@link CompileOptions}. */
|
|
3032
|
+
export declare interface ViewTransitionCompileOptions extends CompileOptions {
|
|
3033
|
+
/** Typed same-doc VT — wraps every rule in `:root:active-view-transition-type(...)`. */
|
|
3034
|
+
types?: readonly string[];
|
|
3035
|
+
/** Prepend the cross-doc `@view-transition { navigation: auto }` preamble (opt-in). */
|
|
3036
|
+
crossDocument?: boolean;
|
|
3037
|
+
/** Append the PRM `animation: none` degrade block (default `true`). */
|
|
3038
|
+
reducedMotion?: boolean;
|
|
3039
|
+
/**
|
|
3040
|
+
* Emit the MANDATORY timing-only group pseudo (default `true`). Turning it
|
|
3041
|
+
* OFF ships the 250ms/ease temporal incoherence p09 observed — exposed only
|
|
3042
|
+
* so the born-RED gate's falsifiability clause can prove the omission REDs.
|
|
3043
|
+
*/
|
|
3044
|
+
emitGroup?: boolean;
|
|
3045
|
+
}
|
|
3046
|
+
|
|
3047
|
+
/** A VT refusal — the CC-3 shape widened to the VT reason union. */
|
|
3048
|
+
export declare interface VTCompileRefusal extends Omit<CompileRefusal, "reason"> {
|
|
3049
|
+
reason: VTCompileRefusalReason;
|
|
3050
|
+
}
|
|
3051
|
+
|
|
3052
|
+
/** The four VT refusals atop the inherited CC-3 {@link CompileRefusalReason}. */
|
|
3053
|
+
export declare type VTCompileRefusalReason = CompileRefusalReason | "vt-scroll-grammar" | "vt-element-scoped-computed" | "vt-snapshot-inapplicable" | "vt-name-collision";
|
|
3054
|
+
|
|
3055
|
+
/**
|
|
3056
|
+
* The per-name VT role mapping (SF-1). A group/Sequence has NO old/new axis (the
|
|
3057
|
+
* group-as-primary reading is REJECTED), so the emitter's PRIMARY input is this
|
|
3058
|
+
* name-keyed role spec. `old`/`new` are the same `KeyframesAnimation`s
|
|
3059
|
+
* `compileToCSS` walks; `group` is timing-only by design.
|
|
3060
|
+
*/
|
|
3061
|
+
export declare type VTRoleSpec<V extends Vars = Vars> = {
|
|
3062
|
+
/** The outgoing snapshot's animation (`::view-transition-old(name)`). */
|
|
3063
|
+
old?: KeyframesAnimation<V>;
|
|
3064
|
+
/** The incoming snapshot's animation (`::view-transition-new(name)`). */
|
|
3065
|
+
new?: KeyframesAnimation<V>;
|
|
3066
|
+
/**
|
|
3067
|
+
* Timing-only for the group pseudo: duration + easing onto the UA geometry
|
|
3068
|
+
* morph (NEVER `animation-name`). A `KeyframesAnimation` contributes its
|
|
3069
|
+
* `options.duration`/`timingFunction`; a bare `{ duration, timingFunction }`
|
|
3070
|
+
* gives them directly. Omit → derived from `new ?? old` (the coherent default).
|
|
3071
|
+
*/
|
|
3072
|
+
group?: Pick<AnimationOptions, "duration" | "timingFunction"> | KeyframesAnimation<V>;
|
|
3073
|
+
/** A `view-transition-class` cohort name — uniform cohorts ride one rule. */
|
|
3074
|
+
class?: string;
|
|
3075
|
+
};
|
|
3076
|
+
|
|
2830
3077
|
declare type WAAPIEligibility = {
|
|
2831
3078
|
eligible: true;
|
|
2832
3079
|
} | {
|
|
@@ -2834,9 +3081,9 @@ declare type WAAPIEligibility = {
|
|
|
2834
3081
|
reason: string;
|
|
2835
3082
|
};
|
|
2836
3083
|
|
|
2837
|
-
declare const warpLeft:
|
|
3084
|
+
declare const warpLeft: PresetFactory;
|
|
2838
3085
|
|
|
2839
|
-
declare const warpRight:
|
|
3086
|
+
declare const warpRight: PresetFactory;
|
|
2840
3087
|
|
|
2841
3088
|
/**
|
|
2842
3089
|
* The minimal stepper surface a spring-driven blend weight reads (K.W11
|