@mkbabb/keyframes.js 5.3.5 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +112 -65
- package/dist/easing-registry-B0rLmOtw.js +79 -0
- package/dist/easing-registry-Db7xwtXT.js +2 -0
- package/dist/engine/index.d.ts +94 -379
- package/dist/engine/index.js +1954 -1292
- package/dist/keyframes.d.ts +103 -424
- package/dist/keyframes.js +1 -1
- package/dist/{sequence-CES7o7hs.js → sequence-BvpIpCGp.js} +7 -3
- package/package.json +3 -5
- package/dist/easing-registry-BAgudUsG.js +0 -2
- package/dist/easing-registry-BlbS88NR.js +0 -27
package/dist/engine/index.d.ts
CHANGED
|
@@ -1,21 +1,20 @@
|
|
|
1
|
-
import { AnimationRangeValue } from '@mkbabb/value.js/
|
|
2
|
-
import { AnimationTimelineValue } from '@mkbabb/value.js/
|
|
3
|
-
import type { AnimationTriggerValue } from '@mkbabb/value.js/
|
|
4
|
-
import type {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
1
|
+
import { AnimationRangeValue } from '@mkbabb/value.js/css';
|
|
2
|
+
import { AnimationTimelineValue } from '@mkbabb/value.js/css';
|
|
3
|
+
import type { AnimationTriggerValue } from '@mkbabb/value.js/css';
|
|
4
|
+
import type { BezierPresetName } from '@mkbabb/value.js/easing';
|
|
5
|
+
import { CSSAnimationOptions } from '@mkbabb/value.js/css';
|
|
6
|
+
import { CSSPropertyDescriptor } from '@mkbabb/value.js/css';
|
|
7
|
+
import { CSSTimelineOptions } from '@mkbabb/value.js/css';
|
|
8
|
+
import type { CssValue } from '@mkbabb/value.js/value';
|
|
9
|
+
import { CustomFunctionDescriptor } from '@mkbabb/value.js/css';
|
|
8
10
|
import type { HueInterpolationMethod } from '@mkbabb/value.js/color';
|
|
9
|
-
import type {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import { Stylesheet } from '@mkbabb/value.js/
|
|
15
|
-
import type {
|
|
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';
|
|
11
|
+
import type { KeyframeSelector } from '@mkbabb/value.js/css';
|
|
12
|
+
import { ParseIssue } from '@mkbabb/value.js/css';
|
|
13
|
+
import { RangeBoundary } from '@mkbabb/value.js/css';
|
|
14
|
+
import { RangePhase } from '@mkbabb/value.js/css';
|
|
15
|
+
import type { SpaceId } from '@mkbabb/value.js/color';
|
|
16
|
+
import { Stylesheet } from '@mkbabb/value.js/css';
|
|
17
|
+
import type { TriggerType } from '@mkbabb/value.js/css';
|
|
19
18
|
|
|
20
19
|
declare const accordionExpand: PresetFactory;
|
|
21
20
|
|
|
@@ -82,9 +81,10 @@ export declare interface AdoptRunningOptions extends IngestOptions {
|
|
|
82
81
|
commit?: boolean;
|
|
83
82
|
}
|
|
84
83
|
|
|
84
|
+
/** Consumer-observable data for one compiled keyframe segment. */
|
|
85
85
|
declare interface AnimationFrame<V extends Vars> {
|
|
86
86
|
id: number;
|
|
87
|
-
start:
|
|
87
|
+
start: KeyframeSelector;
|
|
88
88
|
ixs: {
|
|
89
89
|
start: number;
|
|
90
90
|
stop: number;
|
|
@@ -93,39 +93,8 @@ declare interface AnimationFrame<V extends Vars> {
|
|
|
93
93
|
start: number;
|
|
94
94
|
stop: number;
|
|
95
95
|
};
|
|
96
|
-
flatVars:
|
|
96
|
+
flatVars: FlatAuthoredValues;
|
|
97
97
|
vars: V;
|
|
98
|
-
interpVars: {
|
|
99
|
-
[arg: string]: Array<InterpolatedVar<V>>;
|
|
100
|
-
};
|
|
101
|
-
/**
|
|
102
|
-
* Pre-flattened array of all interpolation variables across all properties.
|
|
103
|
-
* Built once during parse() to avoid Object.values().flat() allocation
|
|
104
|
-
* on every interpFrames() call in the hot path.
|
|
105
|
-
*/
|
|
106
|
-
allInterpVars: Array<InterpolatedVar<V>>;
|
|
107
|
-
/**
|
|
108
|
-
* Q.WB3 S2 — the precomputed numeric SoA fold layout (built ONCE at `parse`
|
|
109
|
-
* over the stable `allInterpVars` set). `processFrame` folds the numeric subset
|
|
110
|
-
* through ONE `lerpArray` over the packed `Float64Array` buffers and strides
|
|
111
|
-
* the result back into the numeric leaves' `.value` slots; the boxed residual
|
|
112
|
-
* (color/computed/mixed) keeps the per-element `lerpValue`. Absent (undefined)
|
|
113
|
-
* for a frame with no numeric ivs, or before `parse` runs — `processFrame`
|
|
114
|
-
* falls back to the all-boxed walk. Bit-identical to the boxed path.
|
|
115
|
-
*/
|
|
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;
|
|
129
98
|
transform: TransformFunction<V>;
|
|
130
99
|
timingFunction: Easing;
|
|
131
100
|
/**
|
|
@@ -169,7 +138,7 @@ export declare class AnimationGroup<V extends Vars> {
|
|
|
169
138
|
* consumer that expects the nested PLAIN authored-shape projection (the
|
|
170
139
|
* "animate any object" seam), inherited from the first child's own
|
|
171
140
|
* `unflatten` flag alongside its transform. False (the default) keeps the
|
|
172
|
-
* DOM-style default renderer's
|
|
141
|
+
* DOM-style default renderer's flat composite map, byte-unchanged.
|
|
173
142
|
*/
|
|
174
143
|
unflatten: boolean;
|
|
175
144
|
lastTickTime: number;
|
|
@@ -193,32 +162,8 @@ export declare class AnimationGroup<V extends Vars> {
|
|
|
193
162
|
/** Cached entries sorted by layer zIndex (see `getEntries`). */
|
|
194
163
|
private _entries;
|
|
195
164
|
private _entriesDirty;
|
|
196
|
-
/** Long-lived
|
|
197
|
-
|
|
198
|
-
readonly _compositeState: CompositeState;
|
|
199
|
-
_grouped: Record<string, unknown>;
|
|
200
|
-
/** The compile-stable union of every child's contributed keys — what `_grouped`
|
|
201
|
-
* is null-filled to each frame so the composite clears WITHOUT `delete` (F.W4
|
|
202
|
-
* S2; fold in `./entries`). INTERNAL (R.W2) — the `./compositor` null-fill. */
|
|
203
|
-
_groupedKeys: string[];
|
|
204
|
-
_groupedKeysDirty: boolean;
|
|
205
|
-
/** P.W2 — the SoA composite layout for the `add`/`weighted` blend arms (the
|
|
206
|
-
* validated 3.7×, bit-identical): one {@link SoALayerPlan} per entry, the FLAT
|
|
207
|
-
* pure-numeric pairs hoisted into a {@link Float64Array} fold (built by
|
|
208
|
-
* `buildSoAPlans` in `./soa`, rebuilt ONLY on a structural change). INTERNAL
|
|
209
|
-
* (R.W2) — read/written by `./compositor`. */
|
|
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;
|
|
218
|
-
/** The long-lived SoA fold scratch — the contiguous numeric accumulate buffer,
|
|
219
|
-
* sized to the WIDEST single-layer pair count once per structural change
|
|
220
|
-
* (reused, zero per-frame alloc). INTERNAL (R.W2) — read by `./compositor`. */
|
|
221
|
-
_compositeBuf: Float64Array | null;
|
|
165
|
+
/** Long-lived zero-allocation compositor state, absent from the public API. */
|
|
166
|
+
private readonly _composite;
|
|
222
167
|
/** K.W11 PHYS-C — true iff ANY layer carries a `weightSpring`; when false (the
|
|
223
168
|
* universal case) `advanceTo` skips the per-frame spring scan (ZERO new work).
|
|
224
169
|
* INTERNAL (R.W2) — set by `./layer-api`'s `transitionLayer`. */
|
|
@@ -310,7 +255,7 @@ export declare class AnimationGroup<V extends Vars> {
|
|
|
310
255
|
|
|
311
256
|
export declare interface AnimationGroupEntry<V extends Vars> {
|
|
312
257
|
animation: KeyframesAnimation<V>;
|
|
313
|
-
values:
|
|
258
|
+
values: FlatAuthoredValues;
|
|
314
259
|
layer: AnimationLayerConfig;
|
|
315
260
|
}
|
|
316
261
|
|
|
@@ -349,15 +294,15 @@ declare interface AnimationIdentity {
|
|
|
349
294
|
declare interface AnimationLayerConfig {
|
|
350
295
|
/** Higher wins. Default: 0 */
|
|
351
296
|
zIndex: number;
|
|
352
|
-
/** 0–1
|
|
297
|
+
/** 0–1 replacement weight. Default: 1 */
|
|
353
298
|
weight: number;
|
|
354
299
|
/**
|
|
355
300
|
* Optional spring (or any {@link WeightStepper}) DRIVING this layer's
|
|
356
301
|
* blend `weight` (K.W11 PHYS-C — the spring-driven crossfade). When
|
|
357
|
-
* present the
|
|
302
|
+
* present the weight blend reads `weightSpring.value` in place of
|
|
358
303
|
* the constant `weight` (one nullish read; the per-frame lerp untouched),
|
|
359
304
|
* so a layer transition follows a PHYSICAL trajectory that can overshoot
|
|
360
|
-
* and settle — the flagship demo moment only kf's
|
|
305
|
+
* and settle — the flagship demo moment only kf's weight-blend substrate
|
|
361
306
|
* can hold. Constructed + advanced by `AnimationGroup.transitionLayer` /
|
|
362
307
|
* `crossfade`; cleared on settle, when the read falls back to the
|
|
363
308
|
* now-updated constant `weight`. Absent on a static-weight layer (the
|
|
@@ -365,14 +310,12 @@ declare interface AnimationLayerConfig {
|
|
|
365
310
|
*/
|
|
366
311
|
weightSpring?: WeightStepper;
|
|
367
312
|
/**
|
|
368
|
-
* Default: 'replace'. Defaulting on a genuinely-omitted
|
|
313
|
+
* Default: 'replace'. Defaulting on a genuinely-omitted operation is
|
|
369
314
|
* the sanctioned contract (the fail-explicit seam throws only on
|
|
370
315
|
* malformed PRESENT input, never on omission) — an unspecified layer
|
|
371
316
|
* blends by replacement, the least-surprising composite.
|
|
372
317
|
*/
|
|
373
|
-
|
|
374
|
-
/** Canonical composition operation. Omission preserves `blendMode` callers. */
|
|
375
|
-
op?: CompositeOperator;
|
|
318
|
+
op: CompositeOperator;
|
|
376
319
|
/** Layer toggle. Default: true */
|
|
377
320
|
enabled: boolean;
|
|
378
321
|
/** Optional property whitelist — only these properties will be output from this layer */
|
|
@@ -394,7 +337,7 @@ declare type AnimationOptions = {
|
|
|
394
337
|
* off-DOM. Default false (consumers opt in).
|
|
395
338
|
*/
|
|
396
339
|
respectReducedMotion: boolean;
|
|
397
|
-
colorSpace:
|
|
340
|
+
colorSpace: SpaceId;
|
|
398
341
|
hueMethod?: HueInterpolationMethod;
|
|
399
342
|
/**
|
|
400
343
|
* The LAYER-level `animation-composition` operator (L.W1 S5, Band A) — the
|
|
@@ -402,8 +345,8 @@ declare type AnimationOptions = {
|
|
|
402
345
|
* through a sibling `.class { animation: … }` shorthand/longhand ingest.
|
|
403
346
|
* Distinct from the per-KEYFRAME {@link TemplateAnimationFrame.composition}
|
|
404
347
|
* (the per-stop operator); this is the whole-animation composite the engine
|
|
405
|
-
* carries off `
|
|
406
|
-
* `replace` (the CSS default — the serializer omits it).
|
|
348
|
+
* carries off `collectAnimationOptions`'s `composition` field. Omission means
|
|
349
|
+
* `replace` (the CSS default — the serializer omits it). Value 4's
|
|
407
350
|
* `CSSAnimationOptions.composition` surfaces it; `fromString` reads it here.
|
|
408
351
|
*/
|
|
409
352
|
composite?: CompositeOperator;
|
|
@@ -425,12 +368,7 @@ export { AnimationTimelineValue }
|
|
|
425
368
|
|
|
426
369
|
declare const attentionPresets: Readonly<Record<string, PresetFactory>>;
|
|
427
370
|
|
|
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";
|
|
371
|
+
declare type AuthoredValue = number | string;
|
|
434
372
|
|
|
435
373
|
declare const blurIn: PresetFactory;
|
|
436
374
|
|
|
@@ -512,8 +450,6 @@ declare interface CompileOptions {
|
|
|
512
450
|
* honest refusal).
|
|
513
451
|
*/
|
|
514
452
|
deltaEEpsilon?: number;
|
|
515
|
-
/** Prettier print-width for the emitted artifact. Omit for the default. */
|
|
516
|
-
printWidth?: number;
|
|
517
453
|
}
|
|
518
454
|
|
|
519
455
|
declare interface CompileRefusal {
|
|
@@ -522,7 +458,7 @@ declare interface CompileRefusal {
|
|
|
522
458
|
message: string;
|
|
523
459
|
}
|
|
524
460
|
|
|
525
|
-
declare type CompileRefusalReason = "
|
|
461
|
+
declare type CompileRefusalReason = "weight-blend" | "custom-renderer" | "perceptual-oklab" | "computed-unit-drift";
|
|
526
462
|
|
|
527
463
|
/**
|
|
528
464
|
* THE compiler (CC-1/CC-2/CC-3) — compile an orchestration graph to zero-runtime
|
|
@@ -532,7 +468,7 @@ declare type CompileRefusalReason = "weighted-blend" | "custom-renderer" | "perc
|
|
|
532
468
|
* materialized, computed units verbatim, color tracks densified into perceptual
|
|
533
469
|
* `oklab()` stops under the ΔE-ε proof), and REFUSES with a NAMED reason what
|
|
534
470
|
* cannot compile faithfully (CC-3 — the replay-equality invariant's honest
|
|
535
|
-
* refusal). The
|
|
471
|
+
* refusal). The Promise signature is retained across deterministic serialization.
|
|
536
472
|
*
|
|
537
473
|
* @returns `{ css, eligible, refusals }` — the artifact + the trust surface.
|
|
538
474
|
*/
|
|
@@ -566,29 +502,14 @@ export declare function compileToEntry<V extends Vars>(spec: Record<string, Entr
|
|
|
566
502
|
export declare function compileToViewTransition<V extends Vars>(spec: Record<string, VTRoleSpec<V>>, opts?: ViewTransitionCompileOptions): Promise<CompiledViewTransitionCSS>;
|
|
567
503
|
|
|
568
504
|
/**
|
|
569
|
-
* The CSS `animation-composition` operator (K.W7).
|
|
570
|
-
*
|
|
571
|
-
*
|
|
572
|
-
*
|
|
573
|
-
*
|
|
574
|
-
* routes `add`/`accumulate` onto the SAME un-clamped numeric leaf the group's
|
|
575
|
-
* `add` layer runs (`group.ts`), so the two tiers share one accumulation
|
|
576
|
-
* semantic without sharing a type.
|
|
505
|
+
* The CSS `animation-composition` operator (K.W7). A group layer uses this same
|
|
506
|
+
* grammar through `AnimationLayerConfig.op`; its orthogonal `weight` scalar can
|
|
507
|
+
* turn a replacement layer into a crossfade. The engine routes
|
|
508
|
+
* `add`/`accumulate` onto the SAME un-clamped numeric leaf the group layer runs,
|
|
509
|
+
* so keyframe and group composition share one accumulation semantic.
|
|
577
510
|
*/
|
|
578
511
|
declare type CompositeOperator = "replace" | "add" | "accumulate";
|
|
579
512
|
|
|
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
|
-
|
|
592
513
|
/**
|
|
593
514
|
* Construct a `ScrollScene` from a parsed `CSSTimelineOptions` (the SO-1 parse
|
|
594
515
|
* output) OR a direct `ScrollSceneOptions` spec. The CSS-fed construction is the
|
|
@@ -633,11 +554,10 @@ export declare class CSSKeyframesAnimation<V extends Vars> extends KeyframesAnim
|
|
|
633
554
|
* scroll-range named keyframe selector (`entry`/`exit`/`cover`/`contain`)
|
|
634
555
|
* ingests OPAQUELY (the L.W1 S4 floor) and is RESOLVABLE only under a timeline;
|
|
635
556
|
* `bindTimeline` is where that resolution happens. It walks `templateFrames`,
|
|
636
|
-
* resolves each named
|
|
637
|
-
* {@link namedSelectorToFraction},
|
|
638
|
-
*
|
|
639
|
-
*
|
|
640
|
-
* (`assertNoUnresolvedNamedSelector`) then finds zero unresolved frames and
|
|
557
|
+
* resolves each named selector to a normalized percent {@link KeyframeSelector}
|
|
558
|
+
* via {@link namedSelectorToFraction}, and re-compiles. The resolved selector is
|
|
559
|
+
* indistinguishable from an author-written percentage at the sort step, so
|
|
560
|
+
* the play-time guard (`assertNoUnresolvedNamedSelector`) finds zero unresolved frames and
|
|
641
561
|
* passes silently — so this MUST land before the guard fires (the gate-enforced
|
|
642
562
|
* sub-wave ordering: the guard over-throws on a bound animation if the resolver
|
|
643
563
|
* is absent).
|
|
@@ -663,7 +583,7 @@ export declare class CSSKeyframesAnimation<V extends Vars> extends KeyframesAnim
|
|
|
663
583
|
* custom properties (syntax string, initial value, inheritance
|
|
664
584
|
* flag) without re-parsing the source CSS.
|
|
665
585
|
*/
|
|
666
|
-
propertyRegistry: Map<string,
|
|
586
|
+
propertyRegistry: Map<string, CSSPropertyDescriptor>;
|
|
667
587
|
/**
|
|
668
588
|
* Parsed scroll-grammar (`animation-timeline` / `animation-range` /
|
|
669
589
|
* `timeline-scope` / `animation-trigger`) recovered from a sibling style rule
|
|
@@ -678,7 +598,7 @@ export declare class CSSKeyframesAnimation<V extends Vars> extends KeyframesAnim
|
|
|
678
598
|
fromString(keyframes: string, transform?: TransformFunction<V>): this;
|
|
679
599
|
}
|
|
680
600
|
|
|
681
|
-
export declare function CSSKeyframesToString<V extends Vars>(animation: KeyframesAnimation<V>, name?: string
|
|
601
|
+
export declare function CSSKeyframesToString<V extends Vars>(animation: KeyframesAnimation<V>, name?: string): Promise<string>;
|
|
682
602
|
|
|
683
603
|
/**
|
|
684
604
|
* Per-stop card serializer for the editor pane — ONE formatted keyframe
|
|
@@ -699,8 +619,8 @@ export declare const defaultLayerConfig: AnimationLayerConfig;
|
|
|
699
619
|
export declare const defaultOptions: AnimationOptions;
|
|
700
620
|
|
|
701
621
|
/**
|
|
702
|
-
* A structured parse/honoring diagnostic (K.W7 S4). Extends the
|
|
703
|
-
*
|
|
622
|
+
* A structured parse/honoring diagnostic (K.W7 S4). Extends the Value 4
|
|
623
|
+
* `ParseIssue` shape (the consumed shape — `message`/`offset`/`line`/
|
|
704
624
|
* `column`/`expected`/`input`) with a stable kf-side {@link DiagnosticCode} and
|
|
705
625
|
* an optional `property` (the leaf a `COMPOSITION_FALLBACK` names). The
|
|
706
626
|
* value.js half (`message`/`offset`/…) is `Partial` because the engine-internal
|
|
@@ -709,13 +629,15 @@ export declare const defaultOptions: AnimationOptions;
|
|
|
709
629
|
* ingest callers that attach source locations.
|
|
710
630
|
* widens it with the stable code (inv-16 published-only consumption holds).
|
|
711
631
|
*/
|
|
712
|
-
declare interface Diagnostic extends Partial<
|
|
632
|
+
declare interface Diagnostic extends Omit<Partial<ParseIssue>, "code"> {
|
|
713
633
|
/** A stable, branch-on-able code — never scrape `message`. */
|
|
714
634
|
code: DiagnosticCode;
|
|
715
635
|
/** The human-readable summary (always present; the producer's or kf's). */
|
|
716
636
|
message: string;
|
|
717
637
|
/** The CSS property a `COMPOSITION_FALLBACK` refuses to composite. */
|
|
718
638
|
property?: string;
|
|
639
|
+
/** Original source for a parser issue, when available. */
|
|
640
|
+
input?: string;
|
|
719
641
|
}
|
|
720
642
|
|
|
721
643
|
/**
|
|
@@ -818,8 +740,6 @@ export declare interface EntryCompileOptions {
|
|
|
818
740
|
* dialog), inert-but-harmless elsewhere, so a caller rarely turns it off.
|
|
819
741
|
*/
|
|
820
742
|
overlay?: boolean;
|
|
821
|
-
/** Prettier print-width for the emitted artifact. Omit for the default. */
|
|
822
|
-
printWidth?: number;
|
|
823
743
|
}
|
|
824
744
|
|
|
825
745
|
/** A single entry refusal — the selector + a typed reason + a human message. */
|
|
@@ -831,7 +751,7 @@ export declare interface EntryRefusal {
|
|
|
831
751
|
}
|
|
832
752
|
|
|
833
753
|
/** The refusal taxonomy — 3 inherited + 6 entry-specific (P2-2.3). */
|
|
834
|
-
export declare type EntryRefusalReason = "custom-renderer" | "
|
|
754
|
+
export declare type EntryRefusalReason = "custom-renderer" | "weight-blend" | "computed-unit-drift" | "entry-multi-keyframe" | "entry-iteration" | "entry-composition" | "entry-scroll-grammar" | "entry-color-space" | "entry-easing-twin";
|
|
835
755
|
|
|
836
756
|
/** The per-selector entry/exit role. Each animation is 2-stop (a transition endpoint pair). */
|
|
837
757
|
export declare interface EntryRoleSpec<V extends Vars = Vars> {
|
|
@@ -871,91 +791,12 @@ declare const fadeOut: PresetFactory;
|
|
|
871
791
|
|
|
872
792
|
export declare const FILL_MODES: readonly ["none", "forwards", "backwards", "both"];
|
|
873
793
|
|
|
794
|
+
declare type FlatAuthoredValues = Record<string, AuthoredValue | undefined>;
|
|
795
|
+
|
|
874
796
|
declare const flipPreset: PresetFactory;
|
|
875
797
|
|
|
876
798
|
export declare function formatCSSKeyframeString(keyframe: string): string;
|
|
877
799
|
|
|
878
|
-
declare class FrameCompiler<V extends Vars = Vars> {
|
|
879
|
-
private readonly _options;
|
|
880
|
-
templateFrames: TemplateAnimationFrame<V>[];
|
|
881
|
-
parsedVars: ParsedVarMap[];
|
|
882
|
-
frames: AnimationFrame<V>[];
|
|
883
|
-
/**
|
|
884
|
-
* Next TEMPLATE frame id — a monotonic handle assigned in `addFrame`
|
|
885
|
-
* (stable across re-parse, since `parse` does not re-add templates).
|
|
886
|
-
* Compiled-frame ids are content-derived from `(startIx, stopIx)`
|
|
887
|
-
* (see `createFrame`), NOT this counter, so `parse()` is idempotent.
|
|
888
|
-
*/
|
|
889
|
-
frameId: number;
|
|
890
|
-
/**
|
|
891
|
-
* The compile inputs live on the owning `Animation`'s `options` object.
|
|
892
|
-
* The compiler holds a REFERENCE to it (the setters mutate it in place,
|
|
893
|
-
* never replace it), so the NEXT compile always reads the current
|
|
894
|
-
* `duration`/`easing`/`colorSpace` without re-linking. For values baked
|
|
895
|
-
* into already-compiled frames, the setter triggers a targeted re-derive:
|
|
896
|
-
* `setDuration` rescales `frame.time` in place; `setColorSpace`/
|
|
897
|
-
* `setHueMethod` call {@link renormalizeColors} (the color resolution is
|
|
898
|
-
* the only baked state that depends on them). No setter silently no-ops a
|
|
899
|
-
* change to compiled state.
|
|
900
|
-
*/
|
|
901
|
-
constructor(_options: AnimationOptions);
|
|
902
|
-
/**
|
|
903
|
-
* The live options object the compiler reads (a REFERENCE to the owning
|
|
904
|
-
* `Animation`'s `options` — the setters mutate it in place). Read-only:
|
|
905
|
-
* the compiler never replaces it. Exposed so `Animation.adoptCompiled`
|
|
906
|
-
* can re-bind `Animation.options` to the adopted compiler's options object
|
|
907
|
-
* BY CONSTRUCTION (`this.options === this.compiler.options`, the live-options
|
|
908
|
-
* invariant — G.W19 / the `6e29236` lock), without poking a private field.
|
|
909
|
-
*/
|
|
910
|
-
get options(): AnimationOptions;
|
|
911
|
-
addFrame<K extends V>(start: number | string | ValueUnit<number>, vars: Partial<K>, transform?: TransformFunction<K>, timingFunction?: InputAnimationOptions["timingFunction"], composition?: CompositeOperator): void;
|
|
912
|
-
createFrame(startIx: number, endIx: number): AnimationFrame<V>;
|
|
913
|
-
/**
|
|
914
|
-
* Build an index mapping each variable name to the frame indices where
|
|
915
|
-
* it appears. Used by reconcileVars() for O(1) "next occurrence" lookups
|
|
916
|
-
* instead of O(N) findIndex scans per variable.
|
|
917
|
-
*/
|
|
918
|
-
private buildVarIndex;
|
|
919
|
-
/**
|
|
920
|
-
* Reconcile interpolation variables across non-adjacent keyframes.
|
|
921
|
-
* For each variable at frame `ix`, find the next frame that also
|
|
922
|
-
* defines that variable and create an interpolation segment between them.
|
|
923
|
-
*
|
|
924
|
-
* Uses a pre-built variable index (from buildVarIndex) to avoid
|
|
925
|
-
* O(frames²) findIndex scans.
|
|
926
|
-
*/
|
|
927
|
-
reconcileVars(ix: number, varIndex: Map<string, number[]>): void;
|
|
928
|
-
/**
|
|
929
|
-
* Compile `templateFrames` into the sampled `frames[]`. `targets` is the
|
|
930
|
-
* one DOM input — each parsed var is bound to it so computed-unit
|
|
931
|
-
* resolution can read the live box. Pure otherwise.
|
|
932
|
-
*/
|
|
933
|
-
parse(targets: HTMLElement[]): void;
|
|
934
|
-
/**
|
|
935
|
-
* Derive a frame's `flatVars`/`vars`/`allInterpVars` from its
|
|
936
|
-
* `interpVars` — the pre-flattened forms the hot path
|
|
937
|
-
* (`interpFrames`) iterates without re-walking. Called once per frame
|
|
938
|
-
* at the tail of `parse`, and again by `renormalizeColors` after a
|
|
939
|
-
* color-space change re-derives the interp carriers in place.
|
|
940
|
-
*/
|
|
941
|
-
private finalizeFrameVars;
|
|
942
|
-
/**
|
|
943
|
-
* Re-derive the color-resolved interpolation carriers in place after a
|
|
944
|
-
* `colorSpace`/`hueMethod` change on already-compiled frames. Only the
|
|
945
|
-
* per-`InterpolatedVar` color resolution depends on the color space —
|
|
946
|
-
* the flatten/sort/reconcile structure does not — so this re-runs
|
|
947
|
-
* `createInterpVarValue` over the existing `frames`/`parsedVars` and
|
|
948
|
-
* rebuilds the hot-path arrays, with NO re-flatten and NO re-sort. The
|
|
949
|
-
* new carriers derive from the already-target-bound `parsedVars`, the
|
|
950
|
-
* same provenance `parse` gives them, so DOM binding is preserved.
|
|
951
|
-
*
|
|
952
|
-
* The owning `Animation`'s `setColorSpace`/`setHueMethod` call this when
|
|
953
|
-
* frames already exist; before `parse`, the option is simply read by the
|
|
954
|
-
* next compile.
|
|
955
|
-
*/
|
|
956
|
-
renormalizeColors(): void;
|
|
957
|
-
}
|
|
958
|
-
|
|
959
800
|
/**
|
|
960
801
|
* Build a CSS-native SVG line-drawing animation: read the target's path length
|
|
961
802
|
* ONCE, set `stroke-dasharray` to that length (one solid full-length dash), and
|
|
@@ -1080,24 +921,6 @@ export declare const fromStyleSheets: <V extends Vars = Vars>(source?: Document
|
|
|
1080
921
|
*/
|
|
1081
922
|
export declare const getAnimationId: (animation: AnimationIdentity | string) => string;
|
|
1082
923
|
|
|
1083
|
-
/**
|
|
1084
|
-
* Resolve a timing-function input to a callable `TimingFunction`.
|
|
1085
|
-
*
|
|
1086
|
-
* Accepts:
|
|
1087
|
-
* - a `TimingFunction` — returned as-is
|
|
1088
|
-
* - a named entry in `timingFunctions` (`ease-out-cubic`,
|
|
1089
|
-
* `easeOutCubic`, `linear`, etc.) — looked up in the registry
|
|
1090
|
-
* - a CSS `cubic-bezier(x1, y1, x2, y2)` literal string —
|
|
1091
|
-
* parsed to control points and resolved via `CSSCubicBezier`
|
|
1092
|
-
* - a CSS `steps(n[, position])` literal plus the `step-start` /
|
|
1093
|
-
* `step-end` keywords — resolved via `steppedEase`, so the full
|
|
1094
|
-
* CSS Easing Level 1 vocabulary round-trips through `fromString`
|
|
1095
|
-
* - `undefined` or a name/literal the registry can't find —
|
|
1096
|
-
* returns `undefined` so callers can decide (the option setters
|
|
1097
|
-
* throw a typed `AnimationOptionError`, fail-explicit)
|
|
1098
|
-
*/
|
|
1099
|
-
export declare const getTimingFunction: (timingFunction: TimingFunction | TimingFunctionNames | string | undefined) => TimingFunction | undefined;
|
|
1100
|
-
|
|
1101
924
|
declare const glow: PresetFactory;
|
|
1102
925
|
|
|
1103
926
|
declare const gradientBackground: PresetFactory;
|
|
@@ -1170,7 +993,7 @@ declare type InputAnimationOptions = Partial<{
|
|
|
1170
993
|
useWAAPI: boolean;
|
|
1171
994
|
/** When true, snap `play()` to the final frame under `prefers-reduced-motion: reduce`. Default false. */
|
|
1172
995
|
respectReducedMotion: boolean;
|
|
1173
|
-
colorSpace?:
|
|
996
|
+
colorSpace?: SpaceId;
|
|
1174
997
|
hueMethod?: HueInterpolationMethod;
|
|
1175
998
|
/** The LAYER-level `animation-composition` operator (L.W1 S5). Omission ⇒ `replace`. */
|
|
1176
999
|
composite?: CompositeOperator;
|
|
@@ -1194,14 +1017,6 @@ export declare class KeyframesAnimation<V extends Vars = Vars> {
|
|
|
1194
1017
|
superKey: string | undefined;
|
|
1195
1018
|
targets: HTMLElement[];
|
|
1196
1019
|
options: AnimationOptions;
|
|
1197
|
-
/** The frame-compilation half — template frames → sampled `frames[]`. The
|
|
1198
|
-
* class composes one and delegates `addFrame`/`parse` + the frame accessors
|
|
1199
|
-
* to it. READ-ONLY surface (G.W19): the backing `_compiler` is written ONLY
|
|
1200
|
-
* by the constructor + `adoptCompiled` (via `_setCompiler`); an external
|
|
1201
|
-
* `animation.compiler = …` reach-in is a COMPILE error (the live-options
|
|
1202
|
-
* desync lock). */
|
|
1203
|
-
private _compiler;
|
|
1204
|
-
get compiler(): FrameCompiler<V>;
|
|
1205
1020
|
/** THE rAF owner for this animation — the standalone play loop and the WAAPI
|
|
1206
1021
|
* shadow tick both ride it, so `stop()` halts either uniformly. */
|
|
1207
1022
|
readonly playback: RAFPlayback;
|
|
@@ -1288,7 +1103,7 @@ export declare class KeyframesAnimation<V extends Vars = Vars> {
|
|
|
1288
1103
|
get frames(): AnimationFrame<V>[];
|
|
1289
1104
|
get frameId(): number;
|
|
1290
1105
|
/** Append a template frame (delegated to the compiler). Chainable. */
|
|
1291
|
-
addFrame<K extends V>(start: number | string |
|
|
1106
|
+
addFrame<K extends V>(start: number | string | KeyframeSelector, vars: Partial<K>, transform?: TransformFunction<K>, timingFunction?: InputAnimationOptions["timingFunction"], composition?: CompositeOperator): KeyframesAnimation<K>;
|
|
1292
1107
|
/** Compile the template frames into the sampled `frames[]` (R.W2 body in
|
|
1293
1108
|
* `./compile-bridge`). Chainable. */
|
|
1294
1109
|
parse(): this;
|
|
@@ -1299,11 +1114,6 @@ export declare class KeyframesAnimation<V extends Vars = Vars> {
|
|
|
1299
1114
|
* (`proof:adopt-compiled`). Chainable.
|
|
1300
1115
|
*/
|
|
1301
1116
|
adoptCompiled(source: KeyframesAnimation<V>): this;
|
|
1302
|
-
/** INTERNAL (R.W2): the sanctioned backing-field write for `_compiler` (used
|
|
1303
|
-
* ONLY by `./compile-bridge`'s `adoptCompiled`). The `compiler` accessor
|
|
1304
|
-
* stays get-only — an external `animation.compiler = …` reach-in is a COMPILE
|
|
1305
|
-
* error (the G.W19 live-options-desync lock). */
|
|
1306
|
-
_setCompiler(compiler: FrameCompiler<V>): void;
|
|
1307
1117
|
setTimingFunction(timingFunction: InputAnimationOptions["timingFunction"]): this;
|
|
1308
1118
|
setIterationCount(iterationCount: InputAnimationOptions["iterationCount"]): this;
|
|
1309
1119
|
setDuration(duration: InputAnimationOptions["duration"]): this;
|
|
@@ -1327,18 +1137,29 @@ export declare class KeyframesAnimation<V extends Vars = Vars> {
|
|
|
1327
1137
|
/** The named-selector PLAY-TIME guard (Q.WD1 S3 — body in `./interpolate`).
|
|
1328
1138
|
* INTERNAL (R.W2): the play machine + `at()` call it; NOT `private`. */
|
|
1329
1139
|
assertNoUnresolvedNamedSelector(): void;
|
|
1330
|
-
/**
|
|
1331
|
-
*
|
|
1332
|
-
*
|
|
1333
|
-
|
|
1140
|
+
/**
|
|
1141
|
+
* Sample normalized progress from the first to last keyframe, independent
|
|
1142
|
+
* of playback direction. `apply=true` also invokes transforms.
|
|
1143
|
+
*
|
|
1144
|
+
* The returned map is a borrowed interpolation view, not a snapshot. On
|
|
1145
|
+
* the common single-segment path the engine reuses the frame's authored
|
|
1146
|
+
* value buffer, so a later sample may mutate an earlier reference. Copy the
|
|
1147
|
+
* result (`{ ...animation.at(p) }`) when retaining a historical value.
|
|
1148
|
+
*/
|
|
1149
|
+
at(progress: number, apply?: boolean): FlatAuthoredValues;
|
|
1334
1150
|
/**
|
|
1335
1151
|
* Interpolate all active frames at time `t` — the hot path (once per rAF
|
|
1336
1152
|
* frame). R.W2 body in `./interpolate`; this is the thin public sampling
|
|
1337
|
-
* delegate the group, sequence, WAAPI build, and `at()` all drive.
|
|
1338
|
-
*
|
|
1339
|
-
*
|
|
1340
|
-
|
|
1341
|
-
|
|
1153
|
+
* delegate the group, sequence, WAAPI build, and `at()` all drive.
|
|
1154
|
+
*
|
|
1155
|
+
* When `out` is supplied, it is cleared and rewritten in place and returned
|
|
1156
|
+
* by identity; callers own that buffer but must snapshot it before the next
|
|
1157
|
+
* write if they need history. Without `out`, the common single-segment path
|
|
1158
|
+
* may return the engine's borrowed frame buffer, which subsequent samples
|
|
1159
|
+
* mutate. This borrowed-buffer contract is what keeps steady-state sampling
|
|
1160
|
+
* allocation-free.
|
|
1161
|
+
*/
|
|
1162
|
+
interpFrames(t: number, transformFrames?: boolean, out?: FlatAuthoredValues): FlatAuthoredValues;
|
|
1342
1163
|
onStart(): Promise<void> | undefined;
|
|
1343
1164
|
onEnd(): void;
|
|
1344
1165
|
advanceTo(t: number): number | Promise<number>;
|
|
@@ -1523,31 +1344,6 @@ declare type NativeTimelineSpec = {
|
|
|
1523
1344
|
|
|
1524
1345
|
declare const notificationBounce: PresetFactory;
|
|
1525
1346
|
|
|
1526
|
-
/**
|
|
1527
|
-
* Q.WB3 S2 — the precomputed SoA fold layout for ONE compiled frame's NUMERIC
|
|
1528
|
-
* interp subset (the single-animation `processFrame` analog of the compositor's
|
|
1529
|
-
* `SoALayerPlan`). Built ONCE at `parse` over the STABLE iv set (the F.W4
|
|
1530
|
-
* zero-alloc discipline — NO per-frame allocation):
|
|
1531
|
-
* - `numeric` — the numeric ivs (numeric start+stop, NOT computed, NOT color),
|
|
1532
|
-
* in slot order. Each iv's interp-carrier `value` is the `ValueUnit` slot the
|
|
1533
|
-
* strided write-back fills (the SAME slot `lerpValue` writes today).
|
|
1534
|
-
* - `from` / `to` — the packed endpoint `Float64Array`s (`start.value` /
|
|
1535
|
-
* `stop.value`), one slot per `numeric[s]`.
|
|
1536
|
-
* - `out` — the per-frame scratch the `lerpArray` fold writes into (reused
|
|
1537
|
-
* across every frame — zero per-frame alloc).
|
|
1538
|
-
* - `boxed` — the residual ivs (color / computed / mixed) the fold CANNOT cover
|
|
1539
|
-
* — walked by the existing per-element `lerpValue`, UNCHANGED.
|
|
1540
|
-
* The boxed-color tail is the GATED `ColorChannelPlan` consume's frontier (S4,
|
|
1541
|
-
* value.js 1.2.0) — NOT this NOW numeric arm.
|
|
1542
|
-
*/
|
|
1543
|
-
declare interface NumericFoldPlan<V extends Vars> {
|
|
1544
|
-
numeric: Array<InterpolatedVar<V>>;
|
|
1545
|
-
from: Float64Array;
|
|
1546
|
-
to: Float64Array;
|
|
1547
|
-
out: Float64Array;
|
|
1548
|
-
boxed: Array<InterpolatedVar<V>>;
|
|
1549
|
-
}
|
|
1550
|
-
|
|
1551
1347
|
/**
|
|
1552
1348
|
* The author's path geometry — the `offset-path` value set on the target. Any
|
|
1553
1349
|
* valid CSS `offset-path`: a `path()` data string, a `ray()`, a `url(#id)`
|
|
@@ -1558,13 +1354,13 @@ export declare type OffsetPath = string;
|
|
|
1558
1354
|
|
|
1559
1355
|
declare const parallaxScroll: PresetFactory;
|
|
1560
1356
|
|
|
1561
|
-
declare type ParsedVarMap = Record<string,
|
|
1357
|
+
declare type ParsedVarMap = Record<string, CssValue>;
|
|
1562
1358
|
|
|
1563
1359
|
/**
|
|
1564
1360
|
* SO-1 PARSE — extract the full scroll-grammar (`animation-timeline` /
|
|
1565
1361
|
* `animation-range` / `timeline-scope` / `animation-trigger`) from a scroll-
|
|
1566
1362
|
* driven stylesheet (string OR a pre-parsed `Stylesheet`) into a typed
|
|
1567
|
-
* `CSSTimelineOptions`. Consumes
|
|
1363
|
+
* `CSSTimelineOptions`. Consumes Value 4's `extractTimelineOptions` over
|
|
1568
1364
|
* the parsed stylesheet — the acyclic-spine consume edge (the grammar lives in
|
|
1569
1365
|
* value.js, where the `animation-*` parsing already lives; kf re-derives no
|
|
1570
1366
|
* parallel name table).
|
|
@@ -1611,28 +1407,6 @@ export declare function pinCSS(opts?: {
|
|
|
1611
1407
|
bottom?: number;
|
|
1612
1408
|
}): string;
|
|
1613
1409
|
|
|
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
|
-
|
|
1636
1410
|
/**
|
|
1637
1411
|
* `engine/playback-state.ts` — the `PlaybackState` run-state STORE, carved off
|
|
1638
1412
|
* `engine/play-lifecycle.ts` at S.B2 on the STATE↔BEHAVIOR cohesion seam (the
|
|
@@ -1908,11 +1682,11 @@ export declare interface ResolvedKeyframes {
|
|
|
1908
1682
|
*/
|
|
1909
1683
|
composition: Map<string, string>;
|
|
1910
1684
|
/** `@property --foo { ... }` registry */
|
|
1911
|
-
properties: Map<string,
|
|
1685
|
+
properties: Map<string, CSSPropertyDescriptor>;
|
|
1912
1686
|
/**
|
|
1913
1687
|
* `@function --foo(...) { ... }` descriptor registry (P.W13 — the emerging-CSS
|
|
1914
|
-
* resolve seam). Collected via
|
|
1915
|
-
* `properties` is collected via `
|
|
1688
|
+
* resolve seam). Collected via Value's `collectCustomFunctions` exactly as
|
|
1689
|
+
* `properties` is collected via `collectPropertyDescriptors`. Threaded into the
|
|
1916
1690
|
* {@link resolveValues} pass's {@link ResolveContext} so the dashed-function
|
|
1917
1691
|
* `@function` CALL-inlining lands greenable the moment value.js-P publishes
|
|
1918
1692
|
* the call-parse arm; the descriptor is captured NOW (a read-only registry —
|
|
@@ -1925,12 +1699,12 @@ export declare interface ResolvedKeyframes {
|
|
|
1925
1699
|
* `animation` shorthand or longhand declarations (if any). Empty
|
|
1926
1700
|
* when the input has no matching style rule.
|
|
1927
1701
|
*/
|
|
1928
|
-
options:
|
|
1702
|
+
options: CSSAnimationOptions;
|
|
1929
1703
|
/**
|
|
1930
1704
|
* Structured parse/honoring diagnostics (K.W7 S4) — every SILENT fallback
|
|
1931
1705
|
* the resolve path used to swallow, now a citable row. CONSUMES the value.js
|
|
1932
|
-
*
|
|
1933
|
-
*
|
|
1706
|
+
* Value 4 `ParseIssue` producer: a failed parse lands here as a
|
|
1707
|
+
* `PARSE_ERROR` row,
|
|
1934
1708
|
* and the kf-side fallbacks (`EMPTY_PARSE`, and the engine's
|
|
1935
1709
|
* `COMPOSITION_FALLBACK`) join it. A FLAT additive array with stable
|
|
1936
1710
|
* {@link DiagnosticCode}s, NOT a logging framework. Empty on a clean parse.
|
|
@@ -1940,7 +1714,7 @@ export declare interface ResolvedKeyframes {
|
|
|
1940
1714
|
/**
|
|
1941
1715
|
* The parsed CSS `Stylesheet` AST the resolve walked (L.W2 S1). Surfaced so a
|
|
1942
1716
|
* caller can recover scroll-grammar (`animation-timeline`/`animation-range`)
|
|
1943
|
-
* from the SAME parse via `
|
|
1717
|
+
* from the SAME parse via `collectTimelineOptions(resolved.stylesheet)` —
|
|
1944
1718
|
* `CSSKeyframesAnimation.fromString` threads it onto `scrollOptions` so the
|
|
1945
1719
|
* compiler's EMIT half (CC-6) can serialize the scroll longhands back out. A
|
|
1946
1720
|
* read-only metadata field; the keyframe/option resolution is unchanged.
|
|
@@ -1985,8 +1759,7 @@ declare interface ResolveEnv {
|
|
|
1985
1759
|
/**
|
|
1986
1760
|
* Normalise a CSS string (or pre-parsed Stylesheet) into the shape
|
|
1987
1761
|
* `CSSKeyframesAnimation.fromString` consumes. The single entry
|
|
1988
|
-
* point
|
|
1989
|
-
* `parseCSSStyleBlock` / `parseCSSAnimationKeyframes` fork.
|
|
1762
|
+
* point, replacing the former multi-parser fork.
|
|
1990
1763
|
*
|
|
1991
1764
|
* Bare keyframe-stop lists (`from { … } to { … }`) historically work even
|
|
1992
1765
|
* though they are not valid top-level CSS. F.W8 decides that on the parsed
|
|
@@ -2595,57 +2368,6 @@ declare interface SmoothProgressOptions {
|
|
|
2595
2368
|
/** A `.snap()` snap point — a local progress in [0,1] the scene settles to. */
|
|
2596
2369
|
export declare type SnapPoints = readonly number[];
|
|
2597
2370
|
|
|
2598
|
-
/**
|
|
2599
|
-
* P.W2 — the precomputed SoA fold layout for ONE `add`/`weighted` blend layer.
|
|
2600
|
-
* `carriers[s]`/`incomings[s]` are the stable `ValueUnit<number>` refs the boxed
|
|
2601
|
-
* inner loop would have touched at slot `s` (the carrier is the leaf a lower
|
|
2602
|
-
* layer parked in `_grouped`; the incoming is this layer's `entry.values` leaf —
|
|
2603
|
-
* both alias `frame.flatVars` units whose `.value` `interpFrames` mutates in
|
|
2604
|
-
* place, so the refs are frame-stable). The per-frame fold seeds the composite
|
|
2605
|
-
* buffer from each carrier, applies the layer's op (`+=` for `add`, `lerp(...,w)`
|
|
2606
|
-
* for `weighted`) against the incoming, and writes back — replacing the
|
|
2607
|
-
* per-frame `for..in` + `Array.isArray` + per-element `isNumericUnit` dispatch
|
|
2608
|
-
* with a contiguous numeric loop. The `entry` is carried for the `weighted`
|
|
2609
|
-
* arm's per-LAYER `w = layer.weightSpring?.value ?? layer.weight` read (K.W11
|
|
2610
|
-
* PHYS-C).
|
|
2611
|
-
*/
|
|
2612
|
-
declare interface SoALayerPlan {
|
|
2613
|
-
/**
|
|
2614
|
-
* The layer config — the `weighted` fold re-reads its per-frame `w =
|
|
2615
|
-
* weightSpring?.value ?? weight` LIVE (K.W11 PHYS-C, so a spring still drives
|
|
2616
|
-
* the blend), and the config is generic-independent so the plan holds it
|
|
2617
|
-
* without binding the group's `V`.
|
|
2618
|
-
*/
|
|
2619
|
-
layer: AnimationLayerConfig;
|
|
2620
|
-
weighted: boolean;
|
|
2621
|
-
/** The pure-numeric carrier units the fold seeds the composite buffer from + writes back to. */
|
|
2622
|
-
carriers: ValueUnit<number>[];
|
|
2623
|
-
/** The incoming numeric units folded against each carrier (parallel to `carriers`). */
|
|
2624
|
-
incomingSlots: Array<{
|
|
2625
|
-
values: Record<string, unknown>;
|
|
2626
|
-
key: string;
|
|
2627
|
-
index: number;
|
|
2628
|
-
}>;
|
|
2629
|
-
/**
|
|
2630
|
-
* The keys this layer touches that the SoA fold does NOT cover — a non-array
|
|
2631
|
-
* carrier (first-touch of a key, or a scalar that a lower layer left
|
|
2632
|
-
* `undefined`), or a leaf with ANY non-numeric / mixed element. These keep
|
|
2633
|
-
* the boxed per-element path (the `Array.isArray` guard + the
|
|
2634
|
-
* `Math.min(existing.length, incoming.length)` element loop), so the
|
|
2635
|
-
* `add`/`weighted` blend stays byte-identical on the non-numeric tail. EMPTY
|
|
2636
|
-
* for the dominant all-numeric transform shape (every leaf a numeric
|
|
2637
|
-
* `ValueUnit[]`), so the whole `for..in` collapses to the SoA fold.
|
|
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>;
|
|
2647
|
-
}
|
|
2648
|
-
|
|
2649
2371
|
declare const spinner: PresetFactory;
|
|
2650
2372
|
|
|
2651
2373
|
declare const springPop: PresetFactory;
|
|
@@ -2752,7 +2474,7 @@ export declare type SVGDrawTarget = SVGElement & {
|
|
|
2752
2474
|
|
|
2753
2475
|
declare interface TemplateAnimationFrame<V extends Vars> {
|
|
2754
2476
|
id: number;
|
|
2755
|
-
start:
|
|
2477
|
+
start: KeyframeSelector;
|
|
2756
2478
|
vars: V;
|
|
2757
2479
|
transform?: TransformFunction<V>;
|
|
2758
2480
|
timingFunction?: Easing;
|
|
@@ -2823,8 +2545,8 @@ declare abstract class Timeline {
|
|
|
2823
2545
|
declare interface TimelineOptions {
|
|
2824
2546
|
/**
|
|
2825
2547
|
* Easing as a callable `TimingFunction` or a typed `Easing` — both
|
|
2826
|
-
* synchronous and
|
|
2827
|
-
* the
|
|
2548
|
+
* synchronous and parser-free, so the `Timeline` family never touches the
|
|
2549
|
+
* heavy boundary; its only Value runtime edge is the shared `/math` leaf.
|
|
2828
2550
|
*
|
|
2829
2551
|
* A string easing *name* is NOT accepted here (fail-explicit: it
|
|
2830
2552
|
* throws). Resolve a name once, up front, through the async factory:
|
|
@@ -2849,18 +2571,11 @@ declare interface TimelineOptions {
|
|
|
2849
2571
|
|
|
2850
2572
|
declare type TimingFunction = (t: number) => number;
|
|
2851
2573
|
|
|
2852
|
-
declare type TimingFunctionNames =
|
|
2574
|
+
declare type TimingFunctionNames = BezierPresetName | "steps" | "ease-in-bounce" | "easeOutCubic" | "easeInOutSine" | "easeInOutCubic" | "easeInOutQuad" | "easeInOutExpo" | "easeInOutCirc" | "easeOutExpo" | "smoothStep3" | "easeInBounce";
|
|
2853
2575
|
|
|
2854
2576
|
declare type TransformFunction<V extends Vars> = (v: V, t: number) => void;
|
|
2855
2577
|
|
|
2856
|
-
|
|
2857
|
-
* Default DOM-style renderer used by `Animation.transform` when no
|
|
2858
|
-
* user-supplied transform is provided. "Is this the default renderer?"
|
|
2859
|
-
* is decided by reference comparison against the Animation instance's
|
|
2860
|
-
* one `_defaultTransform` (`usesDefaultRenderer`) — typed and
|
|
2861
|
-
* bind-proof, not a Symbol tag a wrapper would silently drop.
|
|
2862
|
-
*/
|
|
2863
|
-
export declare function transformTargetsStyle<V extends Vars>(vars: V, targets: HTMLElement[], flat?: boolean): void;
|
|
2578
|
+
export declare function transformTargetsStyle<V extends Vars>(vars: V, targets: HTMLElement[]): void;
|
|
2864
2579
|
|
|
2865
2580
|
/** The play direction a trigger cycle runs — `alternate` flips it each entry. */
|
|
2866
2581
|
export declare type TriggerDirection = "forward" | "backward";
|
|
@@ -2951,11 +2666,11 @@ declare const typingCursor: PresetFactory;
|
|
|
2951
2666
|
|
|
2952
2667
|
/**
|
|
2953
2668
|
* `validate(css, opts?)` — the READ-ONLY projection over the three typed channels
|
|
2954
|
-
* onto one {@link ValidateResult} envelope. Async because `compileToCSS`
|
|
2955
|
-
*
|
|
2669
|
+
* onto one {@link ValidateResult} envelope. Async because `compileToCSS` retains
|
|
2670
|
+
* its Promise contract while producing deterministic CSS directly.
|
|
2956
2671
|
*
|
|
2957
2672
|
* The pipeline:
|
|
2958
|
-
* 1. `
|
|
2673
|
+
* 1. `parseStylesheet(css)` → the AST; `parseable` is true when Value
|
|
2959
2674
|
* surfaced at least one recognized item and the resolve raised no
|
|
2960
2675
|
* `PARSE_ERROR` (the spec-faithful reality — a dropped `!important` decl is
|
|
2961
2676
|
* not a parse failure).
|
|
@@ -3091,7 +2806,7 @@ declare const warpRight: PresetFactory;
|
|
|
3091
2806
|
* `tickDt` + `settled`); typing it as this narrow shape — NOT importing
|
|
3092
2807
|
* `SpringProgress` — keeps `constants.ts` from gaining a class edge and lets
|
|
3093
2808
|
* a consumer drive a layer's weight with ANY analytic stepper (a decay glide,
|
|
3094
|
-
* a custom `Tickable`). The read is one nullish access in the
|
|
2809
|
+
* a custom `Tickable`). The read is one nullish access in the weight blend
|
|
3095
2810
|
* leaf; the group's managed loop advances it per frame via `tickDt`.
|
|
3096
2811
|
*/
|
|
3097
2812
|
declare interface WeightStepper {
|