@mkbabb/keyframes.js 5.3.5 → 6.1.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 +123 -67
- package/dist/engine/index.d.ts +354 -404
- package/dist/engine/index.js +2362 -1606
- package/dist/keyframes.d.ts +462 -470
- package/dist/keyframes.js +180 -146
- package/dist/registry-CPtiwlwX.js +162 -0
- package/dist/registry-Dd7GzvJm.js +2 -0
- package/dist/{sequence-CES7o7hs.js → sequence-BUgKKePR.js} +128 -98
- package/package.json +15 -12
- 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,22 @@
|
|
|
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 type { 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 { CssTimeUnit } from '@mkbabb/value.js/css';
|
|
9
|
+
import type { CssValue } from '@mkbabb/value.js/value';
|
|
10
|
+
import type { CustomFunctionDescriptor } from '@mkbabb/value.js/css';
|
|
11
|
+
import { EasingFunction } from '@mkbabb/value.js/easing';
|
|
8
12
|
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';
|
|
13
|
+
import type { KeyframeSelector } from '@mkbabb/value.js/css';
|
|
14
|
+
import type { ParseIssue } from '@mkbabb/value.js/css';
|
|
15
|
+
import { RangeBoundary } from '@mkbabb/value.js/css';
|
|
16
|
+
import { RangePhase } from '@mkbabb/value.js/css';
|
|
17
|
+
import type { SpaceId } from '@mkbabb/value.js/color';
|
|
18
|
+
import type { Stylesheet } from '@mkbabb/value.js/css';
|
|
19
|
+
import type { TriggerType } from '@mkbabb/value.js/css';
|
|
19
20
|
|
|
20
21
|
declare const accordionExpand: PresetFactory;
|
|
21
22
|
|
|
@@ -82,9 +83,10 @@ export declare interface AdoptRunningOptions extends IngestOptions {
|
|
|
82
83
|
commit?: boolean;
|
|
83
84
|
}
|
|
84
85
|
|
|
86
|
+
/** Consumer-observable data for one compiled keyframe segment. */
|
|
85
87
|
declare interface AnimationFrame<V extends Vars> {
|
|
86
88
|
id: number;
|
|
87
|
-
start:
|
|
89
|
+
start: KeyframeSelector;
|
|
88
90
|
ixs: {
|
|
89
91
|
start: number;
|
|
90
92
|
stop: number;
|
|
@@ -93,39 +95,8 @@ declare interface AnimationFrame<V extends Vars> {
|
|
|
93
95
|
start: number;
|
|
94
96
|
stop: number;
|
|
95
97
|
};
|
|
96
|
-
flatVars:
|
|
98
|
+
flatVars: FlatAuthoredValues;
|
|
97
99
|
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
100
|
transform: TransformFunction<V>;
|
|
130
101
|
timingFunction: Easing;
|
|
131
102
|
/**
|
|
@@ -153,8 +124,17 @@ export declare class AnimationGroup<V extends Vars> {
|
|
|
153
124
|
paused: boolean;
|
|
154
125
|
started: boolean;
|
|
155
126
|
done: boolean;
|
|
156
|
-
/**
|
|
157
|
-
*
|
|
127
|
+
/**
|
|
128
|
+
* When true, `play()` honors `prefers-reduced-motion: reduce` by snapping
|
|
129
|
+
* every child to its final frame in one composite, no rAF loop.
|
|
130
|
+
*
|
|
131
|
+
* **Default `true`** — X.KF.W5 ruling KF-W5R4(3) (COHESION §0j.C): the PRM
|
|
132
|
+
* default is INVERTED to honouring the preference, one honest default in one
|
|
133
|
+
* engine. Until that ruling the group defaulted `false` while its sibling
|
|
134
|
+
* organ `startViewTransition` defaulted `true`, so two organs of one engine
|
|
135
|
+
* disagreed and the honest default *"existed in-house and was used nowhere"*
|
|
136
|
+
* (KF-KC-27). Set `false` for the explicit opt-out.
|
|
137
|
+
*/
|
|
158
138
|
respectReducedMotion: boolean;
|
|
159
139
|
/** Children-per-slice before `advanceTo()` yields to the main thread; larger
|
|
160
140
|
* groups batch with a `scheduler.yield()` between slices (INP relief). */
|
|
@@ -163,13 +143,42 @@ export declare class AnimationGroup<V extends Vars> {
|
|
|
163
143
|
* genuine-ownership replacement for the excised `KeyframesAnimation.group()`
|
|
164
144
|
* service locator; each input is a bare animation or `{ animation, layer }`). */
|
|
165
145
|
static of<V extends Vars>(first: KeyframesAnimation<V> | AnimationGroupInput<V>, ...rest: (KeyframesAnimation<V> | AnimationGroupInput<V>)[]): AnimationGroup<V>;
|
|
166
|
-
|
|
146
|
+
/** The pre-ruling field default, unchanged; `_singleTargetDeclared` is set
|
|
147
|
+
* once a caller ASSIGNS the property (the supported opt-out). */
|
|
148
|
+
private _singleTarget;
|
|
149
|
+
private _singleTargetDeclared;
|
|
150
|
+
/**
|
|
151
|
+
* True when every child animates the SAME first target, so the group can
|
|
152
|
+
* composite one shared element per frame (the SoA blend + the group-WAAPI
|
|
153
|
+
* fast lane both gate on it).
|
|
154
|
+
*
|
|
155
|
+
* **Assigning it DECLARES it** — X.KF.W5 ruling KF-W5R4(4) (COHESION §0j.C):
|
|
156
|
+
* `singleTarget` gains a SUPPORTED opt-out. Before it, `group.singleTarget =
|
|
157
|
+
* false` was a raw poke the post-mount recompute in {@link setTargets}
|
|
158
|
+
* silently reverted (LP-1's rider; the demo's `CopyButton`/`SquareScene`
|
|
159
|
+
* pokes are the live witnesses), so the group disagreed with its own caller
|
|
160
|
+
* and the KF-CB-15 target-less derivation (`undefined === undefined → true`)
|
|
161
|
+
* could not be opted out of at all. Every recompute honours a declaration;
|
|
162
|
+
* {@link deriveSingleTarget} gives the derived mode back.
|
|
163
|
+
*/
|
|
164
|
+
get singleTarget(): boolean;
|
|
165
|
+
set singleTarget(value: boolean);
|
|
166
|
+
/**
|
|
167
|
+
* Drop a {@link singleTarget} declaration and return to derivation — the
|
|
168
|
+
* inverse of the supported opt-out, so a declaration is reversible without
|
|
169
|
+
* reconstructing the group. Re-derives immediately from the current entries.
|
|
170
|
+
*/
|
|
171
|
+
deriveSingleTarget(): this;
|
|
172
|
+
/** The ONE derivation of `singleTarget` — shared by the constructor and the
|
|
173
|
+
* `setTargets` recompute so they can never drift apart, and a NO-OP while a
|
|
174
|
+
* caller's declaration stands (KF-W5R4(4)). */
|
|
175
|
+
private _deriveSingleTarget;
|
|
167
176
|
/**
|
|
168
177
|
* T.A6 — true when the group's composite `transform` is a CUSTOM (non-DOM)
|
|
169
178
|
* consumer that expects the nested PLAIN authored-shape projection (the
|
|
170
179
|
* "animate any object" seam), inherited from the first child's own
|
|
171
180
|
* `unflatten` flag alongside its transform. False (the default) keeps the
|
|
172
|
-
* DOM-style default renderer's
|
|
181
|
+
* DOM-style default renderer's flat composite map, byte-unchanged.
|
|
173
182
|
*/
|
|
174
183
|
unflatten: boolean;
|
|
175
184
|
lastTickTime: number;
|
|
@@ -190,35 +199,13 @@ export declare class AnimationGroup<V extends Vars> {
|
|
|
190
199
|
/** Pre-bound frame callback — allocated once to avoid a per-loop closure.
|
|
191
200
|
* INTERNAL (S.B5) — read by `./lifecycle`'s `play`/`resume` loop start. */
|
|
192
201
|
_boundFrame: (t: number) => boolean | Promise<boolean>;
|
|
202
|
+
/** The `onRender` observers (KFA-31). */
|
|
203
|
+
private readonly _renders;
|
|
193
204
|
/** Cached entries sorted by layer zIndex (see `getEntries`). */
|
|
194
205
|
private _entries;
|
|
195
206
|
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;
|
|
207
|
+
/** Long-lived zero-allocation compositor state, absent from the public API. */
|
|
208
|
+
private readonly _composite;
|
|
222
209
|
/** K.W11 PHYS-C — true iff ANY layer carries a `weightSpring`; when false (the
|
|
223
210
|
* universal case) `advanceTo` skips the per-frame spring scan (ZERO new work).
|
|
224
211
|
* INTERNAL (R.W2) — set by `./layer-api`'s `transitionLayer`. */
|
|
@@ -226,7 +213,7 @@ export declare class AnimationGroup<V extends Vars> {
|
|
|
226
213
|
constructor(...inputs: (KeyframesAnimation<V> | AnimationGroupInput<V>)[]);
|
|
227
214
|
/** The animation entries sorted by layer zIndex, dirty-flag cached — rebuilt
|
|
228
215
|
* only on a mutation. INTERNAL (R.W2): read by the colocated `./compositor`/
|
|
229
|
-
* `./entries`/`./
|
|
216
|
+
* `./entries`/`./yield-batch`/`./springs` helpers + all hot-path iteration. */
|
|
230
217
|
getEntries(): AnimationGroupEntry<V>[];
|
|
231
218
|
/** Mark entries cache stale. Called at all mutation boundaries.
|
|
232
219
|
* INTERNAL (R.W2) — also called by `./layer-api`. */
|
|
@@ -246,17 +233,26 @@ export declare class AnimationGroup<V extends Vars> {
|
|
|
246
233
|
* (0 for a never-ticked group), never a fabricated wall-clock.
|
|
247
234
|
*/
|
|
248
235
|
render(t?: number): void;
|
|
236
|
+
/** Observe every frame the group paints (each draw-loop tick, `render()`,
|
|
237
|
+
* `reset()`) with its clock; returns the unsubscribe. A paused group
|
|
238
|
+
* notifies nothing. See `./render-observers` (KFA-31 · KFA-85). */
|
|
239
|
+
onRender(listener: (t: number) => void): () => void;
|
|
249
240
|
/** Set a child's current time without touching its siblings (updates
|
|
250
241
|
* `pausedTime` for a jump-free resume). Chainable; `render()` to reflect it. */
|
|
251
242
|
setChildTime(nameOrAnim: string | KeyframesAnimation<V>, t: number): this;
|
|
243
|
+
/** KFA-69 — the group-level seek: seat EVERY child at the group's one
|
|
244
|
+
* master elapsed time (ms since its start), each at its own phase of it
|
|
245
|
+
* (modulo its duration, within its iteration count), so phase-locked
|
|
246
|
+
* children stay locked under a scrub. Chainable; `render()` to reflect it.
|
|
247
|
+
* Body in `./seek`. */
|
|
248
|
+
seek(elapsed: number): this;
|
|
249
|
+
/** The master elapsed time a child's current position sits at (its delay +
|
|
250
|
+
* its completed iterations + its `t`) — the read `seek` inverts. */
|
|
251
|
+
elapsedOf(nameOrAnim: string | KeyframesAnimation<V>): number;
|
|
252
252
|
/** Advance all child animations to absolute clock `t`. SYNC on the steady path
|
|
253
253
|
* (J.W6 S1): all-synchronous children advance with no per-frame microtask hop;
|
|
254
254
|
* a thenable only on an async child or the over-`YIELD_BATCH` yield path. */
|
|
255
255
|
advanceTo(t: number): this | Promise<this>;
|
|
256
|
-
/** One frame of the group's draw loop: tick all children, then render. */
|
|
257
|
-
private _frame;
|
|
258
|
-
/** The post-advance render half of `_frame` — composite, or settle on done. */
|
|
259
|
-
private _renderFrame;
|
|
260
256
|
/** The completion front-door (G.W13) — `await group.finished` resolves once
|
|
261
257
|
* the in-flight composite play settles. Exposes the ONE held `_playingPromise`
|
|
262
258
|
* (a settled/never-played group resolves immediately). */
|
|
@@ -310,7 +306,7 @@ export declare class AnimationGroup<V extends Vars> {
|
|
|
310
306
|
|
|
311
307
|
export declare interface AnimationGroupEntry<V extends Vars> {
|
|
312
308
|
animation: KeyframesAnimation<V>;
|
|
313
|
-
values:
|
|
309
|
+
values: FlatAuthoredValues;
|
|
314
310
|
layer: AnimationLayerConfig;
|
|
315
311
|
}
|
|
316
312
|
|
|
@@ -349,15 +345,15 @@ declare interface AnimationIdentity {
|
|
|
349
345
|
declare interface AnimationLayerConfig {
|
|
350
346
|
/** Higher wins. Default: 0 */
|
|
351
347
|
zIndex: number;
|
|
352
|
-
/** 0–1
|
|
348
|
+
/** 0–1 replacement weight. Default: 1 */
|
|
353
349
|
weight: number;
|
|
354
350
|
/**
|
|
355
351
|
* Optional spring (or any {@link WeightStepper}) DRIVING this layer's
|
|
356
352
|
* blend `weight` (K.W11 PHYS-C — the spring-driven crossfade). When
|
|
357
|
-
* present the
|
|
353
|
+
* present the weight blend reads `weightSpring.value` in place of
|
|
358
354
|
* the constant `weight` (one nullish read; the per-frame lerp untouched),
|
|
359
355
|
* so a layer transition follows a PHYSICAL trajectory that can overshoot
|
|
360
|
-
* and settle — the flagship demo moment only kf's
|
|
356
|
+
* and settle — the flagship demo moment only kf's weight-blend substrate
|
|
361
357
|
* can hold. Constructed + advanced by `AnimationGroup.transitionLayer` /
|
|
362
358
|
* `crossfade`; cleared on settle, when the read falls back to the
|
|
363
359
|
* now-updated constant `weight`. Absent on a static-weight layer (the
|
|
@@ -365,14 +361,12 @@ declare interface AnimationLayerConfig {
|
|
|
365
361
|
*/
|
|
366
362
|
weightSpring?: WeightStepper;
|
|
367
363
|
/**
|
|
368
|
-
* Default: 'replace'. Defaulting on a genuinely-omitted
|
|
364
|
+
* Default: 'replace'. Defaulting on a genuinely-omitted operation is
|
|
369
365
|
* the sanctioned contract (the fail-explicit seam throws only on
|
|
370
366
|
* malformed PRESENT input, never on omission) — an unspecified layer
|
|
371
367
|
* blends by replacement, the least-surprising composite.
|
|
372
368
|
*/
|
|
373
|
-
|
|
374
|
-
/** Canonical composition operation. Omission preserves `blendMode` callers. */
|
|
375
|
-
op?: CompositeOperator;
|
|
369
|
+
op: CompositeOperator;
|
|
376
370
|
/** Layer toggle. Default: true */
|
|
377
371
|
enabled: boolean;
|
|
378
372
|
/** Optional property whitelist — only these properties will be output from this layer */
|
|
@@ -381,7 +375,16 @@ declare interface AnimationLayerConfig {
|
|
|
381
375
|
|
|
382
376
|
declare type AnimationOptions = {
|
|
383
377
|
duration: number;
|
|
378
|
+
/**
|
|
379
|
+
* The `<time>` unit the author wrote for `duration` (UIA-KF-177): set from
|
|
380
|
+
* value.js's `CSSAnimationOptions.durationUnit` at ingest, so every emit
|
|
381
|
+
* writes the number back in it. Absent for a programmatic number, which
|
|
382
|
+
* emits in its shortest exact spelling.
|
|
383
|
+
*/
|
|
384
|
+
durationUnit?: CssTimeUnit;
|
|
384
385
|
delay: number;
|
|
386
|
+
/** The `<time>` unit the author wrote for `delay` (UIA-KF-177); see `durationUnit`. */
|
|
387
|
+
delayUnit?: CssTimeUnit;
|
|
385
388
|
iterationCount: number;
|
|
386
389
|
direction: (typeof DIRECTIONS)[number];
|
|
387
390
|
fillMode: (typeof FILL_MODES)[number];
|
|
@@ -394,7 +397,7 @@ declare type AnimationOptions = {
|
|
|
394
397
|
* off-DOM. Default false (consumers opt in).
|
|
395
398
|
*/
|
|
396
399
|
respectReducedMotion: boolean;
|
|
397
|
-
colorSpace:
|
|
400
|
+
colorSpace: SpaceId;
|
|
398
401
|
hueMethod?: HueInterpolationMethod;
|
|
399
402
|
/**
|
|
400
403
|
* The LAYER-level `animation-composition` operator (L.W1 S5, Band A) — the
|
|
@@ -402,8 +405,8 @@ declare type AnimationOptions = {
|
|
|
402
405
|
* through a sibling `.class { animation: … }` shorthand/longhand ingest.
|
|
403
406
|
* Distinct from the per-KEYFRAME {@link TemplateAnimationFrame.composition}
|
|
404
407
|
* (the per-stop operator); this is the whole-animation composite the engine
|
|
405
|
-
* carries off `
|
|
406
|
-
* `replace` (the CSS default — the serializer omits it).
|
|
408
|
+
* carries off `collectAnimationOptions`'s `composition` field. Omission means
|
|
409
|
+
* `replace` (the CSS default — the serializer omits it). Value 4's
|
|
407
410
|
* `CSSAnimationOptions.composition` surfaces it; `fromString` reads it here.
|
|
408
411
|
*/
|
|
409
412
|
composite?: CompositeOperator;
|
|
@@ -425,12 +428,7 @@ export { AnimationTimelineValue }
|
|
|
425
428
|
|
|
426
429
|
declare const attentionPresets: Readonly<Record<string, PresetFactory>>;
|
|
427
430
|
|
|
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";
|
|
431
|
+
declare type AuthoredValue = number | string;
|
|
434
432
|
|
|
435
433
|
declare const blurIn: PresetFactory;
|
|
436
434
|
|
|
@@ -512,8 +510,6 @@ declare interface CompileOptions {
|
|
|
512
510
|
* honest refusal).
|
|
513
511
|
*/
|
|
514
512
|
deltaEEpsilon?: number;
|
|
515
|
-
/** Prettier print-width for the emitted artifact. Omit for the default. */
|
|
516
|
-
printWidth?: number;
|
|
517
513
|
}
|
|
518
514
|
|
|
519
515
|
declare interface CompileRefusal {
|
|
@@ -522,7 +518,7 @@ declare interface CompileRefusal {
|
|
|
522
518
|
message: string;
|
|
523
519
|
}
|
|
524
520
|
|
|
525
|
-
declare type CompileRefusalReason = "
|
|
521
|
+
declare type CompileRefusalReason = "weight-blend" | "custom-renderer" | "perceptual-oklab" | "computed-unit-drift";
|
|
526
522
|
|
|
527
523
|
/**
|
|
528
524
|
* THE compiler (CC-1/CC-2/CC-3) — compile an orchestration graph to zero-runtime
|
|
@@ -532,7 +528,7 @@ declare type CompileRefusalReason = "weighted-blend" | "custom-renderer" | "perc
|
|
|
532
528
|
* materialized, computed units verbatim, color tracks densified into perceptual
|
|
533
529
|
* `oklab()` stops under the ΔE-ε proof), and REFUSES with a NAMED reason what
|
|
534
530
|
* cannot compile faithfully (CC-3 — the replay-equality invariant's honest
|
|
535
|
-
* refusal). The
|
|
531
|
+
* refusal). The Promise signature is retained across deterministic serialization.
|
|
536
532
|
*
|
|
537
533
|
* @returns `{ css, eligible, refusals }` — the artifact + the trust surface.
|
|
538
534
|
*/
|
|
@@ -566,29 +562,14 @@ export declare function compileToEntry<V extends Vars>(spec: Record<string, Entr
|
|
|
566
562
|
export declare function compileToViewTransition<V extends Vars>(spec: Record<string, VTRoleSpec<V>>, opts?: ViewTransitionCompileOptions): Promise<CompiledViewTransitionCSS>;
|
|
567
563
|
|
|
568
564
|
/**
|
|
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.
|
|
565
|
+
* The CSS `animation-composition` operator (K.W7). A group layer uses this same
|
|
566
|
+
* grammar through `AnimationLayerConfig.op`; its orthogonal `weight` scalar can
|
|
567
|
+
* turn a replacement layer into a crossfade. The engine routes
|
|
568
|
+
* `add`/`accumulate` onto the SAME un-clamped numeric leaf the group layer runs,
|
|
569
|
+
* so keyframe and group composition share one accumulation semantic.
|
|
577
570
|
*/
|
|
578
571
|
declare type CompositeOperator = "replace" | "add" | "accumulate";
|
|
579
572
|
|
|
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
573
|
/**
|
|
593
574
|
* Construct a `ScrollScene` from a parsed `CSSTimelineOptions` (the SO-1 parse
|
|
594
575
|
* output) OR a direct `ScrollSceneOptions` spec. The CSS-fed construction is the
|
|
@@ -618,32 +599,70 @@ export declare function createScrollScene(spec?: ScrollSceneOptions | CSSTimelin
|
|
|
618
599
|
*/
|
|
619
600
|
export declare function createTriggerScene(spec?: AnimationTriggerValue | CSSTimelineOptions): TriggerScene;
|
|
620
601
|
|
|
602
|
+
/**
|
|
603
|
+
* A CSS `<easing-function>` written as TEXT — the second legitimate spelling of
|
|
604
|
+
* an easing at the option surface, beside a registry {@link TimingFunctionNames}
|
|
605
|
+
* name (X.KF.W4 KF-CB-29, COHESION §0m.1 candidate (ii)).
|
|
606
|
+
*
|
|
607
|
+
* This type exists because the arm it replaces — a bare `| string` on
|
|
608
|
+
* `InputAnimationOptions["timingFunction"]` — made `tsc` green on EVERY string,
|
|
609
|
+
* so the name union beside it was decorative at the only surface a consumer
|
|
610
|
+
* actually writes through. That arm is the mechanism by which a renamed easing
|
|
611
|
+
* shipped with a green typecheck over a name that had ceased to exist. Deleting
|
|
612
|
+
* it outright is the WRONG cure and the tree says so by measurement: at
|
|
613
|
+
* `3e81f500` a bare deletion reddens **14 library diagnostics** — 13 in the
|
|
614
|
+
* SHIPPED preset catalogue (`presets/catalog.ts`, every one a `cubic-bezier()`
|
|
615
|
+
* or `steps()` literal the library authors itself) and one at
|
|
616
|
+
* `engine/css/metadata.ts:63`. Those literals are not sloppiness; they are the
|
|
617
|
+
* grammar. So the arm is NARROWED to that grammar rather than removed.
|
|
618
|
+
*
|
|
619
|
+
* The members are CSS Easing L1/L2's own: the seven keywords, and the three
|
|
620
|
+
* functional forms. The functional arms are deliberately `${string}`-bodied — a
|
|
621
|
+
* template literal type cannot validate a numeric argument list, and pretending
|
|
622
|
+
* otherwise would trade one false claim for another. What it DOES buy is total:
|
|
623
|
+
* a string that is neither a registry name nor shaped like a CSS easing function
|
|
624
|
+
* no longer typechecks, which is the whole of KF-CB-29.
|
|
625
|
+
*
|
|
626
|
+
* `compile/emit/css-text.ts`'s `serializeTimingFunction` returns this type, so
|
|
627
|
+
* the library's own serializer output flows back into the option surface
|
|
628
|
+
* without widening it.
|
|
629
|
+
*/
|
|
630
|
+
declare type CssEasingLiteral = "linear" | "ease" | "ease-in" | "ease-out" | "ease-in-out" | "step-start" | "step-end" | `cubic-bezier(${string})` | `steps(${string})` | `linear(${string})`;
|
|
631
|
+
|
|
632
|
+
/**
|
|
633
|
+
* Normalize a child name to a CSS-safe ident (the `@keyframes`/class name). A
|
|
634
|
+
* bare numeric id (`getAnimationId` falls back to `String(id)`) gets an `a`
|
|
635
|
+
* prefix so the `@keyframes` name is a valid CSS identifier; collisions are
|
|
636
|
+
* de-duped by the walker via a `-2`/`-3` suffix.
|
|
637
|
+
*/
|
|
638
|
+
export declare function cssIdent(name: string): string;
|
|
639
|
+
|
|
621
640
|
export declare class CSSKeyframesAnimation<V extends Vars> extends KeyframesAnimation<V> {
|
|
622
|
-
/**
|
|
623
|
-
* Q.WD1-bind S2 (DM-22) — the timeline a scroll-range named selector resolves
|
|
624
|
-
* its phase against. Stored by {@link bindTimeline} for the no-timeline guard's
|
|
625
|
-
* check; `undefined` until a timeline is bound. A scroll-context operation
|
|
626
|
-
* specific to CSS keyframes with named selectors (the base `Animation` class is
|
|
627
|
-
* value.js-/scroll-agnostic), so the field + method live here.
|
|
628
|
-
*/
|
|
629
|
-
private _boundTimeline?;
|
|
630
641
|
constructor(options?: Partial<InputAnimationOptions>, ...targets: HTMLElement[]);
|
|
631
642
|
/**
|
|
632
643
|
* Q.WD1-bind S2 (DM-22) — the attach-time deferred-resolution seam. A
|
|
633
644
|
* scroll-range named keyframe selector (`entry`/`exit`/`cover`/`contain`)
|
|
634
645
|
* ingests OPAQUELY (the L.W1 S4 floor) and is RESOLVABLE only under a timeline;
|
|
635
646
|
* `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
|
|
647
|
+
* resolves each named selector to a normalized percent {@link KeyframeSelector}
|
|
648
|
+
* via {@link namedSelectorToFraction}, and re-compiles. The resolved selector is
|
|
649
|
+
* indistinguishable from an author-written percentage at the sort step, so
|
|
650
|
+
* the play-time guard (`assertNoUnresolvedNamedSelector`) finds zero unresolved frames and
|
|
641
651
|
* passes silently — so this MUST land before the guard fires (the gate-enforced
|
|
642
652
|
* sub-wave ordering: the guard over-throws on a bound animation if the resolver
|
|
643
653
|
* is absent).
|
|
644
654
|
*
|
|
645
655
|
* Idempotent + safe to call before `fromString`: with no named frames the walk
|
|
646
656
|
* is a no-op; calling it after a NaN-producing `parse()` purges the NaN frames.
|
|
657
|
+
*
|
|
658
|
+
* `timeline` is the BINDING the caller declares, and the resolution below does
|
|
659
|
+
* not read it: `namedSelectorToFraction` maps a phase NAME to a fraction, which
|
|
660
|
+
* is timeline-independent. It was formerly stashed on a private
|
|
661
|
+
* `_boundTimeline` field described as feeding "the no-timeline guard's check" —
|
|
662
|
+
* a consumer that does not exist (the guard is `engine/interpolate.ts` and
|
|
663
|
+
* reads the frames' own resolved state, never the field). The field and that
|
|
664
|
+
* prose are deleted together at X.KF.W4 K3 / R-9's else-branch; the parameter
|
|
665
|
+
* stays because it is this method's public contract.
|
|
647
666
|
*/
|
|
648
667
|
bindTimeline(timeline: Timeline): this;
|
|
649
668
|
/**
|
|
@@ -652,6 +671,16 @@ export declare class CSSKeyframesAnimation<V extends Vars> extends KeyframesAnim
|
|
|
652
671
|
* unflattened); genuine omission resolves to the instance's ONE
|
|
653
672
|
* default DOM-style renderer, which keeps WAAPI eligibility a
|
|
654
673
|
* reference comparison (`usesDefaultRenderer`).
|
|
674
|
+
*
|
|
675
|
+
* That reference comparison is per-INSTANCE, so it only survives a seam
|
|
676
|
+
* that respects instance ownership. `engine/compile-bridge.ts`'s
|
|
677
|
+
* `adoptCompiled` is the one seam that moves compiled frames between
|
|
678
|
+
* animations, and it upholds this contract there (X.KF.W5 C-1 /
|
|
679
|
+
* G-RENDERER): the renderer stays the RECEIVER's unless the source
|
|
680
|
+
* declared one of its own. Before that, adopting a throwaway compiled
|
|
681
|
+
* with no transform — the editor's own recompile — replaced a consumer's
|
|
682
|
+
* renderer with a foreign instance's default, and every frame then
|
|
683
|
+
* answered `usesDefaultRenderer` FALSE for a renderer nobody supplied.
|
|
655
684
|
*/
|
|
656
685
|
private resolveTransform;
|
|
657
686
|
fromVars(vars: V[], transform?: TransformFunction<V>): this;
|
|
@@ -663,7 +692,7 @@ export declare class CSSKeyframesAnimation<V extends Vars> extends KeyframesAnim
|
|
|
663
692
|
* custom properties (syntax string, initial value, inheritance
|
|
664
693
|
* flag) without re-parsing the source CSS.
|
|
665
694
|
*/
|
|
666
|
-
propertyRegistry: Map<string,
|
|
695
|
+
propertyRegistry: Map<string, CSSPropertyDescriptor>;
|
|
667
696
|
/**
|
|
668
697
|
* Parsed scroll-grammar (`animation-timeline` / `animation-range` /
|
|
669
698
|
* `timeline-scope` / `animation-trigger`) recovered from a sibling style rule
|
|
@@ -678,7 +707,7 @@ export declare class CSSKeyframesAnimation<V extends Vars> extends KeyframesAnim
|
|
|
678
707
|
fromString(keyframes: string, transform?: TransformFunction<V>): this;
|
|
679
708
|
}
|
|
680
709
|
|
|
681
|
-
export declare function CSSKeyframesToString<V extends Vars>(animation: KeyframesAnimation<V>, name?: string
|
|
710
|
+
export declare function CSSKeyframesToString<V extends Vars>(animation: KeyframesAnimation<V>, name?: string): Promise<string>;
|
|
682
711
|
|
|
683
712
|
/**
|
|
684
713
|
* Per-stop card serializer for the editor pane — ONE formatted keyframe
|
|
@@ -699,8 +728,8 @@ export declare const defaultLayerConfig: AnimationLayerConfig;
|
|
|
699
728
|
export declare const defaultOptions: AnimationOptions;
|
|
700
729
|
|
|
701
730
|
/**
|
|
702
|
-
* A structured parse/honoring diagnostic (K.W7 S4). Extends the
|
|
703
|
-
*
|
|
731
|
+
* A structured parse/honoring diagnostic (K.W7 S4). Extends the Value 4
|
|
732
|
+
* `ParseIssue` shape (the consumed shape — `message`/`offset`/`line`/
|
|
704
733
|
* `column`/`expected`/`input`) with a stable kf-side {@link DiagnosticCode} and
|
|
705
734
|
* an optional `property` (the leaf a `COMPOSITION_FALLBACK` names). The
|
|
706
735
|
* value.js half (`message`/`offset`/…) is `Partial` because the engine-internal
|
|
@@ -709,13 +738,15 @@ export declare const defaultOptions: AnimationOptions;
|
|
|
709
738
|
* ingest callers that attach source locations.
|
|
710
739
|
* widens it with the stable code (inv-16 published-only consumption holds).
|
|
711
740
|
*/
|
|
712
|
-
declare interface Diagnostic extends Partial<
|
|
741
|
+
declare interface Diagnostic extends Omit<Partial<ParseIssue>, "code"> {
|
|
713
742
|
/** A stable, branch-on-able code — never scrape `message`. */
|
|
714
743
|
code: DiagnosticCode;
|
|
715
744
|
/** The human-readable summary (always present; the producer's or kf's). */
|
|
716
745
|
message: string;
|
|
717
746
|
/** The CSS property a `COMPOSITION_FALLBACK` refuses to composite. */
|
|
718
747
|
property?: string;
|
|
748
|
+
/** Original source for a parser issue, when available. */
|
|
749
|
+
input?: string;
|
|
719
750
|
}
|
|
720
751
|
|
|
721
752
|
/**
|
|
@@ -818,8 +849,6 @@ export declare interface EntryCompileOptions {
|
|
|
818
849
|
* dialog), inert-but-harmless elsewhere, so a caller rarely turns it off.
|
|
819
850
|
*/
|
|
820
851
|
overlay?: boolean;
|
|
821
|
-
/** Prettier print-width for the emitted artifact. Omit for the default. */
|
|
822
|
-
printWidth?: number;
|
|
823
852
|
}
|
|
824
853
|
|
|
825
854
|
/** A single entry refusal — the selector + a typed reason + a human message. */
|
|
@@ -831,7 +860,7 @@ export declare interface EntryRefusal {
|
|
|
831
860
|
}
|
|
832
861
|
|
|
833
862
|
/** The refusal taxonomy — 3 inherited + 6 entry-specific (P2-2.3). */
|
|
834
|
-
export declare type EntryRefusalReason = "custom-renderer" | "
|
|
863
|
+
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
864
|
|
|
836
865
|
/** The per-selector entry/exit role. Each animation is 2-stop (a transition endpoint pair). */
|
|
837
866
|
export declare interface EntryRoleSpec<V extends Vars = Vars> {
|
|
@@ -871,91 +900,34 @@ declare const fadeOut: PresetFactory;
|
|
|
871
900
|
|
|
872
901
|
export declare const FILL_MODES: readonly ["none", "forwards", "backwards", "both"];
|
|
873
902
|
|
|
903
|
+
declare type FlatAuthoredValues = Record<string, AuthoredValue | undefined>;
|
|
904
|
+
|
|
874
905
|
declare const flipPreset: PresetFactory;
|
|
875
906
|
|
|
907
|
+
/**
|
|
908
|
+
* The editor card's presentation trim: given ONE per-stop string from
|
|
909
|
+
* {@link CSSKeyframesToStrings} (`"0%\n{\n opacity: 0;\n}\n"`), return the
|
|
910
|
+
* declarations alone, un-indented — the `<pre>` the card renders.
|
|
911
|
+
*
|
|
912
|
+
* X.KF.W2 (G-W2-3) — RE-IMPLEMENTED, not deleted. The symbol is published on
|
|
913
|
+
* four barrels (`emit/format/index.ts`, `emit/index.ts`, `compile/index.ts`,
|
|
914
|
+
* `public.ts`), declared on the lazy engine surface (`load-engine.ts`), and held
|
|
915
|
+
* live by the demo (`KeyframeCardList.vue` binds this function by reference), so
|
|
916
|
+
* the export, the signature and every one of those sites stand. What died is the
|
|
917
|
+
* BODY: four anonymous regexes (`/^[^{]*{/`, `/^ /gm`, `/}\s*$/`, `/^ /`) that
|
|
918
|
+
* re-read kf's own emission as if it were unknown text.
|
|
919
|
+
*
|
|
920
|
+
* This stays a pure string trim and adds NO grammar edge — deliberately. It is
|
|
921
|
+
* FORMATTING, not parsing: the card's own comment declares it "a value.js-free
|
|
922
|
+
* pure-string trim" and routing a presentation helper through the CSS grammar
|
|
923
|
+
* would falsify that at a call site this wave does not own. The cut points are
|
|
924
|
+
* therefore named as positions and the indent is stripped per line, which is
|
|
925
|
+
* what the regexes meant; measured byte-identical to the old body across the
|
|
926
|
+
* card shapes and the degenerate ones (no brace, empty, trailing text, an inner
|
|
927
|
+
* `{` inside a `url()`).
|
|
928
|
+
*/
|
|
876
929
|
export declare function formatCSSKeyframeString(keyframe: string): string;
|
|
877
930
|
|
|
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
931
|
/**
|
|
960
932
|
* Build a CSS-native SVG line-drawing animation: read the target's path length
|
|
961
933
|
* ONCE, set `stroke-dasharray` to that length (one solid full-length dash), and
|
|
@@ -1080,24 +1052,6 @@ export declare const fromStyleSheets: <V extends Vars = Vars>(source?: Document
|
|
|
1080
1052
|
*/
|
|
1081
1053
|
export declare const getAnimationId: (animation: AnimationIdentity | string) => string;
|
|
1082
1054
|
|
|
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
1055
|
declare const glow: PresetFactory;
|
|
1102
1056
|
|
|
1103
1057
|
declare const gradientBackground: PresetFactory;
|
|
@@ -1159,18 +1113,30 @@ export declare interface IngestResult<V extends Vars = Vars> {
|
|
|
1159
1113
|
diagnostics: Diagnostic[];
|
|
1160
1114
|
}
|
|
1161
1115
|
|
|
1116
|
+
/**
|
|
1117
|
+
* The AUTHORED option bag — every field already optional, because the type IS a
|
|
1118
|
+
* `Partial<…>`. **Never write `Partial<InputAnimationOptions>`**: it is a
|
|
1119
|
+
* tautology (X.KF.W5 B-20 ≡ KF-CB-35). The wrapper spread from the library's own
|
|
1120
|
+
* signatures into consumer code, where a reader reasonably concluded the bare
|
|
1121
|
+
* type must be required-by-default; the library's four in-bounds signatures drop
|
|
1122
|
+
* it at source so there is nothing left to copy.
|
|
1123
|
+
*/
|
|
1162
1124
|
declare type InputAnimationOptions = Partial<{
|
|
1163
1125
|
duration: number | string;
|
|
1126
|
+
/** The authored unit of `duration`; it pairs with the number it rides with. */
|
|
1127
|
+
durationUnit: CssTimeUnit;
|
|
1164
1128
|
delay: number | string;
|
|
1129
|
+
/** The authored unit of `delay`; it pairs with the number it rides with. */
|
|
1130
|
+
delayUnit: CssTimeUnit;
|
|
1165
1131
|
iterationCount: number | string | "infinite" | undefined;
|
|
1166
1132
|
direction: (typeof DIRECTIONS)[number];
|
|
1167
1133
|
fillMode: (typeof FILL_MODES)[number];
|
|
1168
|
-
timingFunction: TimingFunction | Easing | TimingFunctionNames |
|
|
1134
|
+
timingFunction: TimingFunction | Easing | TimingFunctionNames | CssEasingLiteral | undefined;
|
|
1169
1135
|
/** When true (default), eligible animations may use the Web Animations API for compositor-thread execution. Set to false to force rAF. */
|
|
1170
1136
|
useWAAPI: boolean;
|
|
1171
1137
|
/** When true, snap `play()` to the final frame under `prefers-reduced-motion: reduce`. Default false. */
|
|
1172
1138
|
respectReducedMotion: boolean;
|
|
1173
|
-
colorSpace?:
|
|
1139
|
+
colorSpace?: SpaceId;
|
|
1174
1140
|
hueMethod?: HueInterpolationMethod;
|
|
1175
1141
|
/** The LAYER-level `animation-composition` operator (L.W1 S5). Omission ⇒ `replace`. */
|
|
1176
1142
|
composite?: CompositeOperator;
|
|
@@ -1194,14 +1160,6 @@ export declare class KeyframesAnimation<V extends Vars = Vars> {
|
|
|
1194
1160
|
superKey: string | undefined;
|
|
1195
1161
|
targets: HTMLElement[];
|
|
1196
1162
|
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
1163
|
/** THE rAF owner for this animation — the standalone play loop and the WAAPI
|
|
1206
1164
|
* shadow tick both ride it, so `stop()` halts either uniformly. */
|
|
1207
1165
|
readonly playback: RAFPlayback;
|
|
@@ -1263,7 +1221,7 @@ export declare class KeyframesAnimation<V extends Vars = Vars> {
|
|
|
1263
1221
|
/** The consumer's EXPLICIT constructor options (NOT merged with defaults) —
|
|
1264
1222
|
* retained so `fromString` can layer a parsed style-rule `animation`
|
|
1265
1223
|
* shorthand UNDER them (constructor-explicit wins, F.W8). */
|
|
1266
|
-
protected _ctorOptions:
|
|
1224
|
+
protected _ctorOptions: InputAnimationOptions;
|
|
1267
1225
|
/** The compile-stable union of this animation's interpolated keys. */
|
|
1268
1226
|
get flatKeys(): readonly string[];
|
|
1269
1227
|
/**
|
|
@@ -1281,14 +1239,24 @@ export declare class KeyframesAnimation<V extends Vars = Vars> {
|
|
|
1281
1239
|
* access (the old `PlaybackHost` re-publication + cast are excised).
|
|
1282
1240
|
*/
|
|
1283
1241
|
dispatchAnimationEvent(type: string): void;
|
|
1284
|
-
constructor(options?:
|
|
1242
|
+
constructor(options?: InputAnimationOptions, targets?: HTMLElement[] | HTMLElement | undefined, name?: string | undefined, superKey?: string | undefined);
|
|
1285
1243
|
get templateFrames(): TemplateAnimationFrame<V>[];
|
|
1286
1244
|
set templateFrames(value: TemplateAnimationFrame<V>[]);
|
|
1287
1245
|
get parsedVars(): ParsedVarMap[];
|
|
1288
1246
|
get frames(): AnimationFrame<V>[];
|
|
1247
|
+
private _compiled;
|
|
1248
|
+
/**
|
|
1249
|
+
* True once `parse()` has compiled the CURRENT template set; false again the
|
|
1250
|
+
* moment that set changes. X.KF.W5 B-13 (KF-TFP-27, G-OPTSET): `frames`
|
|
1251
|
+
* yields `[]` both BEFORE a parse and for an animation with no segments, and
|
|
1252
|
+
* those are not the same fact — so a per-frame write could silently no-op
|
|
1253
|
+
* while REPORTING SUCCESS, on a precondition the caller *"neither asserts
|
|
1254
|
+
* nor can observe"*. It can observe it here.
|
|
1255
|
+
*/
|
|
1256
|
+
get compiled(): boolean;
|
|
1289
1257
|
get frameId(): number;
|
|
1290
1258
|
/** Append a template frame (delegated to the compiler). Chainable. */
|
|
1291
|
-
addFrame<K extends V>(start: number | string |
|
|
1259
|
+
addFrame<K extends V>(start: number | string | KeyframeSelector, vars: Partial<K>, transform?: TransformFunction<K>, timingFunction?: InputAnimationOptions["timingFunction"], composition?: CompositeOperator): KeyframesAnimation<K>;
|
|
1292
1260
|
/** Compile the template frames into the sampled `frames[]` (R.W2 body in
|
|
1293
1261
|
* `./compile-bridge`). Chainable. */
|
|
1294
1262
|
parse(): this;
|
|
@@ -1299,11 +1267,6 @@ export declare class KeyframesAnimation<V extends Vars = Vars> {
|
|
|
1299
1267
|
* (`proof:adopt-compiled`). Chainable.
|
|
1300
1268
|
*/
|
|
1301
1269
|
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
1270
|
setTimingFunction(timingFunction: InputAnimationOptions["timingFunction"]): this;
|
|
1308
1271
|
setIterationCount(iterationCount: InputAnimationOptions["iterationCount"]): this;
|
|
1309
1272
|
setDuration(duration: InputAnimationOptions["duration"]): this;
|
|
@@ -1315,7 +1278,7 @@ export declare class KeyframesAnimation<V extends Vars = Vars> {
|
|
|
1315
1278
|
setColorSpace(colorSpace: InputAnimationOptions["colorSpace"]): this;
|
|
1316
1279
|
setHueMethod(hueMethod: InputAnimationOptions["hueMethod"]): this;
|
|
1317
1280
|
setComposite(composite: InputAnimationOptions["composite"]): this;
|
|
1318
|
-
setOptions(options:
|
|
1281
|
+
setOptions(options: InputAnimationOptions): this;
|
|
1319
1282
|
reverse(): this;
|
|
1320
1283
|
fillForwards(): void;
|
|
1321
1284
|
fillBackwards(): void;
|
|
@@ -1327,18 +1290,29 @@ export declare class KeyframesAnimation<V extends Vars = Vars> {
|
|
|
1327
1290
|
/** The named-selector PLAY-TIME guard (Q.WD1 S3 — body in `./interpolate`).
|
|
1328
1291
|
* INTERNAL (R.W2): the play machine + `at()` call it; NOT `private`. */
|
|
1329
1292
|
assertNoUnresolvedNamedSelector(): void;
|
|
1330
|
-
/**
|
|
1331
|
-
*
|
|
1332
|
-
*
|
|
1333
|
-
|
|
1293
|
+
/**
|
|
1294
|
+
* Sample normalized progress from the first to last keyframe, independent
|
|
1295
|
+
* of playback direction. `apply=true` also invokes transforms.
|
|
1296
|
+
*
|
|
1297
|
+
* The returned map is a borrowed interpolation view, not a snapshot. On
|
|
1298
|
+
* the common single-segment path the engine reuses the frame's authored
|
|
1299
|
+
* value buffer, so a later sample may mutate an earlier reference. Copy the
|
|
1300
|
+
* result (`{ ...animation.at(p) }`) when retaining a historical value.
|
|
1301
|
+
*/
|
|
1302
|
+
at(progress: number, apply?: boolean): FlatAuthoredValues;
|
|
1334
1303
|
/**
|
|
1335
1304
|
* Interpolate all active frames at time `t` — the hot path (once per rAF
|
|
1336
1305
|
* 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
|
-
|
|
1306
|
+
* delegate the group, sequence, WAAPI build, and `at()` all drive.
|
|
1307
|
+
*
|
|
1308
|
+
* When `out` is supplied, it is cleared and rewritten in place and returned
|
|
1309
|
+
* by identity; callers own that buffer but must snapshot it before the next
|
|
1310
|
+
* write if they need history. Without `out`, the common single-segment path
|
|
1311
|
+
* may return the engine's borrowed frame buffer, which subsequent samples
|
|
1312
|
+
* mutate. This borrowed-buffer contract is what keeps steady-state sampling
|
|
1313
|
+
* allocation-free.
|
|
1314
|
+
*/
|
|
1315
|
+
interpFrames(t: number, transformFrames?: boolean, out?: FlatAuthoredValues): FlatAuthoredValues;
|
|
1342
1316
|
onStart(): Promise<void> | undefined;
|
|
1343
1317
|
onEnd(): void;
|
|
1344
1318
|
advanceTo(t: number): number | Promise<number>;
|
|
@@ -1523,31 +1497,6 @@ declare type NativeTimelineSpec = {
|
|
|
1523
1497
|
|
|
1524
1498
|
declare const notificationBounce: PresetFactory;
|
|
1525
1499
|
|
|
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
1500
|
/**
|
|
1552
1501
|
* The author's path geometry — the `offset-path` value set on the target. Any
|
|
1553
1502
|
* valid CSS `offset-path`: a `path()` data string, a `ray()`, a `url(#id)`
|
|
@@ -1558,13 +1507,13 @@ export declare type OffsetPath = string;
|
|
|
1558
1507
|
|
|
1559
1508
|
declare const parallaxScroll: PresetFactory;
|
|
1560
1509
|
|
|
1561
|
-
declare type ParsedVarMap = Record<string,
|
|
1510
|
+
declare type ParsedVarMap = Record<string, CssValue>;
|
|
1562
1511
|
|
|
1563
1512
|
/**
|
|
1564
1513
|
* SO-1 PARSE — extract the full scroll-grammar (`animation-timeline` /
|
|
1565
1514
|
* `animation-range` / `timeline-scope` / `animation-trigger`) from a scroll-
|
|
1566
1515
|
* driven stylesheet (string OR a pre-parsed `Stylesheet`) into a typed
|
|
1567
|
-
* `CSSTimelineOptions`. Consumes
|
|
1516
|
+
* `CSSTimelineOptions`. Consumes Value 4's `extractTimelineOptions` over
|
|
1568
1517
|
* the parsed stylesheet — the acyclic-spine consume edge (the grammar lives in
|
|
1569
1518
|
* value.js, where the `animation-*` parsing already lives; kf re-derives no
|
|
1570
1519
|
* parallel name table).
|
|
@@ -1611,28 +1560,6 @@ export declare function pinCSS(opts?: {
|
|
|
1611
1560
|
bottom?: number;
|
|
1612
1561
|
}): string;
|
|
1613
1562
|
|
|
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
1563
|
/**
|
|
1637
1564
|
* `engine/playback-state.ts` — the `PlaybackState` run-state STORE, carved off
|
|
1638
1565
|
* `engine/play-lifecycle.ts` at S.B2 on the STATE↔BEHAVIOR cohesion seam (the
|
|
@@ -1674,6 +1601,15 @@ declare class PlaybackState {
|
|
|
1674
1601
|
readonly _boundFrame: (t: number) => boolean | Promise<boolean>;
|
|
1675
1602
|
readonly _interpOut: Record<string, unknown>;
|
|
1676
1603
|
startTime: number | undefined;
|
|
1604
|
+
/** KFA-181 — the NEXT iteration's start on the absolute clock, carried
|
|
1605
|
+
* across a non-final wrap (`previous start + duration`) so the overshoot
|
|
1606
|
+
* past the boundary is kept, never re-based at the next frame's clock.
|
|
1607
|
+
* Any external `startTime` write (the class setter) clears it. */
|
|
1608
|
+
carriedStartTime: number | undefined;
|
|
1609
|
+
/** KFA-70 — the rAF clock of the tick that took a FRESH anchor, until the
|
|
1610
|
+
* next rAF tick re-anchors the play to the first presented frame
|
|
1611
|
+
* (`presentAnchor`). Any external `startTime` write clears it. */
|
|
1612
|
+
anchorTick: number | undefined;
|
|
1677
1613
|
pausedTime: number;
|
|
1678
1614
|
t: number;
|
|
1679
1615
|
iteration: number;
|
|
@@ -1812,6 +1748,18 @@ declare class RAFPlayback {
|
|
|
1812
1748
|
* restart's freshly-repopulated `_rafId`. On `false` (or a stale
|
|
1813
1749
|
* generation that finishes) the loop cleans up. `play`/`drive`/`loop`
|
|
1814
1750
|
* are the three thin entry shapes over this one core.
|
|
1751
|
+
*
|
|
1752
|
+
* A FRAME MAY FAIL, AND FAILING IS NOT WEDGING (X.KF.W5 C-2 / G-RAF).
|
|
1753
|
+
* `step` had no failure path at all: a synchronous throw skipped
|
|
1754
|
+
* `reschedule` outright and a rejected async result met a `.then` with no
|
|
1755
|
+
* rejection arm, so in both shapes `_cleanup` never ran, `_rafId` stayed
|
|
1756
|
+
* populated, `running` stayed TRUE for the lifetime of the driver, and a
|
|
1757
|
+
* pending `play()` promise never settled — every consumer guarding on
|
|
1758
|
+
* `!playback.running` was then a permanent no-op. A failed frame now winds
|
|
1759
|
+
* the loop down through the SAME generation-guarded path a finished one
|
|
1760
|
+
* takes, and then RE-RAISES the failure unchanged: loud (the host's
|
|
1761
|
+
* uncaught-error channel sees the original error, nothing is absorbed) and
|
|
1762
|
+
* recoverable (the next `play`/`drive`/`loop` re-arms).
|
|
1815
1763
|
*/
|
|
1816
1764
|
private _run;
|
|
1817
1765
|
/**
|
|
@@ -1874,8 +1822,14 @@ export { RangePhase }
|
|
|
1874
1822
|
* takes a SCALE, not just a boolean — WCAG 2.3.3-aligned ("shorten the
|
|
1875
1823
|
* travel, keep the meaning"):
|
|
1876
1824
|
*
|
|
1877
|
-
* - `false` / `undefined` — do not honor reduced motion
|
|
1878
|
-
*
|
|
1825
|
+
* - `false` / `undefined` — do not honor reduced motion: the animation runs at
|
|
1826
|
+
* full amplitude regardless of the OS query. This is the policy VALUE's
|
|
1827
|
+
* meaning, NOT the engine's default — X.KF.W5 ruling KF-W5R4(3) (COHESION
|
|
1828
|
+
* §0j.C) INVERTED the orchestrator defaults to `respectReducedMotion: true`
|
|
1829
|
+
* (`AnimationGroup`, `Sequence`, `startViewTransition`), so honouring the
|
|
1830
|
+
* preference is what a caller gets by omission and `false` is the explicit
|
|
1831
|
+
* opt-out. A surface that still seeds `false` by default is named in the
|
|
1832
|
+
* wave record's residual list, not described as "conservative" here.
|
|
1879
1833
|
* - `true` — the classic binary snap: under an active `prefers-reduced-motion:
|
|
1880
1834
|
* reduce` the surface jumps to its terminal state (amplitude scale `0`).
|
|
1881
1835
|
* - a `number` ∈ [0, 1] — the INTENSITY: under an active query the surface
|
|
@@ -1908,11 +1862,11 @@ export declare interface ResolvedKeyframes {
|
|
|
1908
1862
|
*/
|
|
1909
1863
|
composition: Map<string, string>;
|
|
1910
1864
|
/** `@property --foo { ... }` registry */
|
|
1911
|
-
properties: Map<string,
|
|
1865
|
+
properties: Map<string, CSSPropertyDescriptor>;
|
|
1912
1866
|
/**
|
|
1913
1867
|
* `@function --foo(...) { ... }` descriptor registry (P.W13 — the emerging-CSS
|
|
1914
|
-
* resolve seam). Collected via
|
|
1915
|
-
* `properties` is collected via `
|
|
1868
|
+
* resolve seam). Collected via Value's `collectCustomFunctions` exactly as
|
|
1869
|
+
* `properties` is collected via `collectPropertyDescriptors`. Threaded into the
|
|
1916
1870
|
* {@link resolveValues} pass's {@link ResolveContext} so the dashed-function
|
|
1917
1871
|
* `@function` CALL-inlining lands greenable the moment value.js-P publishes
|
|
1918
1872
|
* the call-parse arm; the descriptor is captured NOW (a read-only registry —
|
|
@@ -1925,12 +1879,12 @@ export declare interface ResolvedKeyframes {
|
|
|
1925
1879
|
* `animation` shorthand or longhand declarations (if any). Empty
|
|
1926
1880
|
* when the input has no matching style rule.
|
|
1927
1881
|
*/
|
|
1928
|
-
options:
|
|
1882
|
+
options: CSSAnimationOptions;
|
|
1929
1883
|
/**
|
|
1930
1884
|
* Structured parse/honoring diagnostics (K.W7 S4) — every SILENT fallback
|
|
1931
1885
|
* the resolve path used to swallow, now a citable row. CONSUMES the value.js
|
|
1932
|
-
*
|
|
1933
|
-
*
|
|
1886
|
+
* Value 4 `ParseIssue` producer: a failed parse lands here as a
|
|
1887
|
+
* `PARSE_ERROR` row,
|
|
1934
1888
|
* and the kf-side fallbacks (`EMPTY_PARSE`, and the engine's
|
|
1935
1889
|
* `COMPOSITION_FALLBACK`) join it. A FLAT additive array with stable
|
|
1936
1890
|
* {@link DiagnosticCode}s, NOT a logging framework. Empty on a clean parse.
|
|
@@ -1940,7 +1894,7 @@ export declare interface ResolvedKeyframes {
|
|
|
1940
1894
|
/**
|
|
1941
1895
|
* The parsed CSS `Stylesheet` AST the resolve walked (L.W2 S1). Surfaced so a
|
|
1942
1896
|
* caller can recover scroll-grammar (`animation-timeline`/`animation-range`)
|
|
1943
|
-
* from the SAME parse via `
|
|
1897
|
+
* from the SAME parse via `collectTimelineOptions(resolved.stylesheet)` —
|
|
1944
1898
|
* `CSSKeyframesAnimation.fromString` threads it onto `scrollOptions` so the
|
|
1945
1899
|
* compiler's EMIT half (CC-6) can serialize the scroll longhands back out. A
|
|
1946
1900
|
* read-only metadata field; the keyframe/option resolution is unchanged.
|
|
@@ -1985,8 +1939,7 @@ declare interface ResolveEnv {
|
|
|
1985
1939
|
/**
|
|
1986
1940
|
* Normalise a CSS string (or pre-parsed Stylesheet) into the shape
|
|
1987
1941
|
* `CSSKeyframesAnimation.fromString` consumes. The single entry
|
|
1988
|
-
* point
|
|
1989
|
-
* `parseCSSStyleBlock` / `parseCSSAnimationKeyframes` fork.
|
|
1942
|
+
* point, replacing the former multi-parser fork.
|
|
1990
1943
|
*
|
|
1991
1944
|
* Bare keyframe-stop lists (`from { … } to { … }`) historically work even
|
|
1992
1945
|
* though they are not valid top-level CSS. F.W8 decides that on the parsed
|
|
@@ -2028,6 +1981,22 @@ export declare const resolveLiveKeyframes: <V extends Vars = Vars>(source?: Docu
|
|
|
2028
1981
|
*/
|
|
2029
1982
|
export declare function resolveRange(range: AnimationRangeValue | undefined): ResolvedRange;
|
|
2030
1983
|
|
|
1984
|
+
/** Resolve a callable, canonical Value name, or CSS timing-function literal. */
|
|
1985
|
+
export declare const resolveTimingFunction: (timingFunction: TimingFunction | string) => TimingFunction;
|
|
1986
|
+
|
|
1987
|
+
/**
|
|
1988
|
+
* ms → a CSS time literal, in the unit the author wrote (UIA-KF-177).
|
|
1989
|
+
*
|
|
1990
|
+
* value.js 4.1.0's `CSSAnimationOptions` carries the authored `<time>` unit
|
|
1991
|
+
* beside the number (`durationUnit` / `delayUnit`), and kf's options keep it
|
|
1992
|
+
* from ingest, so an authored `500ms` emits `500ms` and an authored `0.05s`
|
|
1993
|
+
* emits `0.05s`. A time with no authored unit (a programmatic number, an
|
|
1994
|
+
* external stagger offset) has no spelling to keep, so it takes the shortest
|
|
1995
|
+
* exact literal, seconds on a tie (the CSSOM's canonical unit;
|
|
1996
|
+
* X.KF.W13X.r4lib). Every spelling parses back to the same milliseconds.
|
|
1997
|
+
*/
|
|
1998
|
+
export declare const reverseCSSTime: (milliseconds: number, unit?: CssTimeUnit) => string;
|
|
1999
|
+
|
|
2031
2000
|
declare const rotateIn: PresetFactory;
|
|
2032
2001
|
|
|
2033
2002
|
declare const rotateScale: PresetFactory;
|
|
@@ -2373,7 +2342,9 @@ declare class Sequence<V extends Vars = Vars> implements SequencePlayContext<V>
|
|
|
2373
2342
|
pause(): this;
|
|
2374
2343
|
/** Resume a paused sequence — restart the rAF loop with the origin
|
|
2375
2344
|
* re-anchored so the first resumed frame's master clock equals the retained
|
|
2376
|
-
* `_time` (no forward jump).
|
|
2345
|
+
* `_time` (no forward jump). A seeked-only sequence (no play in flight)
|
|
2346
|
+
* begins a play from its playhead (KFA-17); a live unpaused play is left
|
|
2347
|
+
* alone. Body in `./lifecycle`. */
|
|
2377
2348
|
resume(): this;
|
|
2378
2349
|
/** Set the scalar playback rate — slow-mo (`< 1`), real-time (`1`),
|
|
2379
2350
|
* fast-forward (`> 1`), or backward (`< 0`, the {@link reverse} form); the
|
|
@@ -2480,8 +2451,9 @@ declare interface SequenceOptions {
|
|
|
2480
2451
|
/**
|
|
2481
2452
|
* When true, `play()` honors `prefers-reduced-motion: reduce` by snapping
|
|
2482
2453
|
* every child to its rest frame in a single paint (delegated to each
|
|
2483
|
-
* child's own reduced-motion contract via a terminal `seek`). Default
|
|
2484
|
-
*
|
|
2454
|
+
* child's own reduced-motion contract via a terminal `seek`). **Default
|
|
2455
|
+
* `true`** — X.KF.W5 ruling KF-W5R4(3) (COHESION §0j.C), the engine-wide PRM
|
|
2456
|
+
* default inversion; `false` is the explicit opt-out. SSR-safe off-DOM.
|
|
2485
2457
|
*/
|
|
2486
2458
|
respectReducedMotion?: boolean;
|
|
2487
2459
|
}
|
|
@@ -2550,6 +2522,8 @@ export declare function serializeScrollOptions(opts: CSSTimelineOptions): {
|
|
|
2550
2522
|
"animation-trigger"?: string;
|
|
2551
2523
|
};
|
|
2552
2524
|
|
|
2525
|
+
export declare const serializeTimingFunction: (value: NonNullable<CSSAnimationOptions["timingFunction"]>) => CssEasingLiteral;
|
|
2526
|
+
|
|
2553
2527
|
declare const shake: PresetFactory;
|
|
2554
2528
|
|
|
2555
2529
|
declare const skeletonLoading: PresetFactory;
|
|
@@ -2595,57 +2569,6 @@ declare interface SmoothProgressOptions {
|
|
|
2595
2569
|
/** A `.snap()` snap point — a local progress in [0,1] the scene settles to. */
|
|
2596
2570
|
export declare type SnapPoints = readonly number[];
|
|
2597
2571
|
|
|
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
2572
|
declare const spinner: PresetFactory;
|
|
2650
2573
|
|
|
2651
2574
|
declare const springPop: PresetFactory;
|
|
@@ -2752,7 +2675,7 @@ export declare type SVGDrawTarget = SVGElement & {
|
|
|
2752
2675
|
|
|
2753
2676
|
declare interface TemplateAnimationFrame<V extends Vars> {
|
|
2754
2677
|
id: number;
|
|
2755
|
-
start:
|
|
2678
|
+
start: KeyframeSelector;
|
|
2756
2679
|
vars: V;
|
|
2757
2680
|
transform?: TransformFunction<V>;
|
|
2758
2681
|
timingFunction?: Easing;
|
|
@@ -2823,8 +2746,8 @@ declare abstract class Timeline {
|
|
|
2823
2746
|
declare interface TimelineOptions {
|
|
2824
2747
|
/**
|
|
2825
2748
|
* Easing as a callable `TimingFunction` or a typed `Easing` — both
|
|
2826
|
-
* synchronous and
|
|
2827
|
-
* the
|
|
2749
|
+
* synchronous and parser-free, so the `Timeline` family never touches the
|
|
2750
|
+
* heavy boundary; its only Value runtime edge is the shared `/math` leaf.
|
|
2828
2751
|
*
|
|
2829
2752
|
* A string easing *name* is NOT accepted here (fail-explicit: it
|
|
2830
2753
|
* throws). Resolve a name once, up front, through the async factory:
|
|
@@ -2849,18 +2772,45 @@ declare interface TimelineOptions {
|
|
|
2849
2772
|
|
|
2850
2773
|
declare type TimingFunction = (t: number) => number;
|
|
2851
2774
|
|
|
2852
|
-
|
|
2775
|
+
/**
|
|
2776
|
+
* The registry roster with each name's curve, evaluated at module top level —
|
|
2777
|
+
* THE BOOT FENCE (G-KF3-6): a `bezierPresets` key value stops accepting is a kf
|
|
2778
|
+
* boot `throw` here, and a key it adds silently widens this public roster.
|
|
2779
|
+
*
|
|
2780
|
+
* The references are value.js's memoised ones, so they are stable but NOT
|
|
2781
|
+
* injective: the 40 names resolve onto **31** distinct references, because nine
|
|
2782
|
+
* hyphen/camel twin pairs (`ease-out-cubic` ≡ `easeOutCubic`, `smooth-step-3` ≡
|
|
2783
|
+
* `smoothStep3`, …) share one value.js function. A reference therefore
|
|
2784
|
+
* identifies the CURVE and never the name that produced it — which is why
|
|
2785
|
+
* `easing-serialize.ts`'s reverse lookup can tell a registry curve from a
|
|
2786
|
+
* closure but cannot recover WHICH name was written, and why G-KFW4-5 proves
|
|
2787
|
+
* identity by sampled value-identity on the 33-point grid rather than by name
|
|
2788
|
+
* equality (COHESION §0j.C KF-SS3). `test/compile/easing-identity.test.ts`
|
|
2789
|
+
* asserts all three facts.
|
|
2790
|
+
*/
|
|
2791
|
+
export declare const timingFunctionEntries: readonly (readonly [
|
|
2792
|
+
string,
|
|
2793
|
+
EasingFunction
|
|
2794
|
+
])[];
|
|
2795
|
+
|
|
2796
|
+
/**
|
|
2797
|
+
* The registry's easing NAMES — exactly the roster
|
|
2798
|
+
* `compile/easing/registry.ts` builds at module evaluation (value.js's
|
|
2799
|
+
* `bezierPresets` keys + `"ease-in-bounce"` + the camel `DIRECT_NAMES`), and
|
|
2800
|
+
* nothing else.
|
|
2801
|
+
*
|
|
2802
|
+
* `"steps"` is NOT a member (X.KF.W4 KF-CB-24): bare `steps` carries no count
|
|
2803
|
+
* and no jump term, so it fails the CSS Easing L1 parse and is absent from
|
|
2804
|
+
* `registryNames` — `resolveTimingFunction("steps")` THROWS on it. The
|
|
2805
|
+
* parametric `steps(4, jump-end)` is a CSS LITERAL, resolved through the parser
|
|
2806
|
+
* branch, never a name. `test/compile/timing-function-names.test.ts`
|
|
2807
|
+
* (G-KFW4-13) asserts this union and the runtime roster are the same set.
|
|
2808
|
+
*/
|
|
2809
|
+
declare type TimingFunctionNames = BezierPresetName | "ease-in-bounce" | "easeOutCubic" | "easeInOutSine" | "easeInOutCubic" | "easeInOutQuad" | "easeInOutExpo" | "easeInOutCirc" | "easeOutExpo" | "smoothStep3" | "easeInBounce";
|
|
2853
2810
|
|
|
2854
2811
|
declare type TransformFunction<V extends Vars> = (v: V, t: number) => void;
|
|
2855
2812
|
|
|
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;
|
|
2813
|
+
export declare function transformTargetsStyle<V extends Vars>(vars: V, targets: HTMLElement[]): void;
|
|
2864
2814
|
|
|
2865
2815
|
/** The play direction a trigger cycle runs — `alternate` flips it each entry. */
|
|
2866
2816
|
export declare type TriggerDirection = "forward" | "backward";
|
|
@@ -2951,11 +2901,11 @@ declare const typingCursor: PresetFactory;
|
|
|
2951
2901
|
|
|
2952
2902
|
/**
|
|
2953
2903
|
* `validate(css, opts?)` — the READ-ONLY projection over the three typed channels
|
|
2954
|
-
* onto one {@link ValidateResult} envelope. Async because `compileToCSS`
|
|
2955
|
-
*
|
|
2904
|
+
* onto one {@link ValidateResult} envelope. Async because `compileToCSS` retains
|
|
2905
|
+
* its Promise contract while producing deterministic CSS directly.
|
|
2956
2906
|
*
|
|
2957
2907
|
* The pipeline:
|
|
2958
|
-
* 1. `
|
|
2908
|
+
* 1. `parseStylesheet(css)` → the AST; `parseable` is true when Value
|
|
2959
2909
|
* surfaced at least one recognized item and the resolve raised no
|
|
2960
2910
|
* `PARSE_ERROR` (the spec-faithful reality — a dropped `!important` decl is
|
|
2961
2911
|
* not a parse failure).
|
|
@@ -3091,7 +3041,7 @@ declare const warpRight: PresetFactory;
|
|
|
3091
3041
|
* `tickDt` + `settled`); typing it as this narrow shape — NOT importing
|
|
3092
3042
|
* `SpringProgress` — keeps `constants.ts` from gaining a class edge and lets
|
|
3093
3043
|
* 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
|
|
3044
|
+
* a custom `Tickable`). The read is one nullish access in the weight blend
|
|
3095
3045
|
* leaf; the group's managed loop advances it per frame via `tickDt`.
|
|
3096
3046
|
*/
|
|
3097
3047
|
declare interface WeightStepper {
|