@mkbabb/keyframes.js 5.0.0 → 5.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 +31 -216
- package/dist/animation-BGyzfzBq.js +947 -0
- package/dist/compile-CcSUwM8R.js +276 -0
- package/dist/{waapi-D0ssxKy1.js → delegation-DWwr4IXr.js} +115 -93
- package/dist/{draw-svg-Dat9mHgi.js → draw-svg-GURj9nin.js} +17 -13
- package/dist/easing-registry-DHV2-5gA.js +27 -0
- package/dist/easing-registry-y1p9McFy.js +2 -0
- package/dist/engine/index.d.ts +2873 -0
- package/dist/engine/index.js +17 -0
- package/dist/engine-DEVgCTUy.js +156 -0
- package/dist/engine-DrBtsKaf.js +4 -0
- package/dist/{format-BUgCTjmr.js → format-C-Gi9r7L.js} +4 -4
- package/dist/{scroll-grammar-B4kPvGh5.js → grammar-BLucehC4.js} +1 -1
- package/dist/group-vJcsHKN9.js +360 -0
- package/dist/{ingest-CU-kdYcM.js → ingest-S5hUe20K.js} +62 -56
- package/dist/keyframes.d.ts +475 -942
- package/dist/keyframes.js +196 -137
- package/dist/morph-svg-BToeumw5.js +89 -0
- package/dist/{motion-path-C0OHqcA3.js → motion-path-pQVbamWT.js} +16 -12
- package/dist/parse-flatten-DRMHFytp.js +2 -0
- package/dist/parse-flatten-ZZUSEQEL.js +63 -0
- package/dist/{animations-CZxf0rep.js → presets-BG2Fczzq.js} +124 -73
- package/dist/{scheduler-7eIr_q1g.js → scheduler-CUtVnuoU.js} +1 -1
- package/dist/{scroll-scene-DQxhxn9I.js → scroll-CxpYFO4u.js} +50 -46
- package/dist/sequence-C_DCiOIQ.js +708 -0
- package/dist/validate-DDeGnvSt.js +39 -0
- package/package.json +12 -3
- package/dist/animate-CTWr6K7j.js +0 -26
- package/dist/compile-YRJRdpKF.js +0 -251
- package/dist/decay-BvNmFk51.js +0 -25
- package/dist/engine-DQcb7CLW.js +0 -1349
- package/dist/errors-W8zkvPw4.js +0 -21
- package/dist/morph-svg-83uyYxoW.js +0 -84
- package/dist/rolldown-runtime-Dy4uBu1J.js +0 -11
- package/dist/sequence-cBr7thU8.js +0 -198
- package/dist/springTimingFunction-D26gPkAy.js +0 -63
- package/dist/timeline-vY3eD3Ax.js +0 -430
- package/dist/utils-BPRImVl5.js +0 -100
- package/dist/validate-B1pE-Y_T.js +0 -35
package/dist/keyframes.d.ts
CHANGED
|
@@ -80,62 +80,6 @@ export declare interface AdoptRunningOptions extends IngestOptions {
|
|
|
80
80
|
commit?: boolean;
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
/**
|
|
84
|
-
* Construct, target, and play an animation in one call. Returns the
|
|
85
|
-
* `CSSKeyframesAnimation` as the control handle — `await animate(...)` is NOT
|
|
86
|
-
* the pattern (it would await the *construction*, which is synchronous); await
|
|
87
|
-
* the returned handle's play promise via the `.play()` it already kicked off,
|
|
88
|
-
* or pass `autoPlay: false` and drive it yourself.
|
|
89
|
-
*
|
|
90
|
-
* @param target one or more DOM elements (or a single element) to animate.
|
|
91
|
-
* @param input a CSS string, a keyframe map, a vars array, or a MotionPath
|
|
92
|
-
* spec (`{ path }`) — dispatched on its shape.
|
|
93
|
-
* @param options animation options + optional `transform` / `autoPlay`.
|
|
94
|
-
*
|
|
95
|
-
* @example
|
|
96
|
-
* // CSS string → fromString
|
|
97
|
-
* animate(box, `from { opacity: 0 } to { opacity: 1 }`, { duration: 400 });
|
|
98
|
-
* // keyframe map → fromKeyframes
|
|
99
|
-
* animate(box, { "0%": { opacity: 0 }, "100%": { opacity: 1 } });
|
|
100
|
-
* // vars array → fromVars
|
|
101
|
-
* animate(box, [{ opacity: 0 }, { opacity: 1 }], { duration: 400 });
|
|
102
|
-
* // MotionPath spec → fromMotionPath (F.W12 §S2)
|
|
103
|
-
* animate(box, { path: "path('M 0 0 Q 100 -100 200 0')", rotate: "auto" }, { duration: 2000 });
|
|
104
|
-
*/
|
|
105
|
-
declare function animate<V extends Vars = any>(target: HTMLElement | HTMLElement[], input: AnimateInput<V>, options?: AnimateOptions): CSSKeyframesAnimation<V> | AnimationGroup<V> | Sequence<V>;
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* The declarative input to {@link animate} — one of the six dispatch shapes:
|
|
109
|
-
*
|
|
110
|
-
* • `string` — a CSS `@keyframes` (or bare keyframe-block) source.
|
|
111
|
-
* • `KeyframeMap` — `{ "0%": {...}, "100%": {...} }` or the `Map` form.
|
|
112
|
-
* • `V[]` — an ordered vars array (the simplest `[from, to]`
|
|
113
|
-
* pair, or more stops), distributed evenly 0→100%.
|
|
114
|
-
* • `MotionPathInput` — `{ path, from?, to?, rotate? }` — an `offset-distance`
|
|
115
|
-
* sweep over an author `offset-path` (F.W12 §S2).
|
|
116
|
-
* • `AnimationGroup` — the SPATIAL per-frame blender (L.W8 §S3) — routed to
|
|
117
|
-
* its own `.play()`, NOT wrapped in a new animation.
|
|
118
|
-
* • `Sequence` — the TEMPORAL master-playhead orchestrator (L.W8 §S3)
|
|
119
|
-
* — routed to its own `.play()`.
|
|
120
|
-
*/
|
|
121
|
-
export declare type AnimateInput<V extends Vars> = string | KeyframeMap<V> | V[] | MotionPathInput | AnimationGroup<V> | Sequence<V>;
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* Options accepted by {@link animate}. The animation-options surface, plus an
|
|
125
|
-
* optional custom `transform` renderer (forwarded to the chosen `from*`
|
|
126
|
-
* factory) and `autoPlay` (default true — set false to construct + target
|
|
127
|
-
* without starting, when the caller wants to drive the returned handle).
|
|
128
|
-
*/
|
|
129
|
-
export declare interface AnimateOptions extends Partial<InputAnimationOptions> {
|
|
130
|
-
/** Custom renderer forwarded to the `from*` factory. */
|
|
131
|
-
transform?: TransformFunction<any>;
|
|
132
|
-
/**
|
|
133
|
-
* Auto-start the animation after construction + targeting. Default true.
|
|
134
|
-
* `false` returns a constructed, targeted, NOT-yet-playing handle.
|
|
135
|
-
*/
|
|
136
|
-
autoPlay?: boolean;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
83
|
/**
|
|
140
84
|
* The value.js-bearing engine surface, resolved through `loadAnimationEngine()`.
|
|
141
85
|
*
|
|
@@ -145,120 +89,83 @@ export declare interface AnimateOptions extends Partial<InputAnimationOptions> {
|
|
|
145
89
|
* with `./engine`'s runtime exports.
|
|
146
90
|
*/
|
|
147
91
|
export declare interface AnimationEngine {
|
|
148
|
-
/**
|
|
149
|
-
* The core engine constructor (PKG-3, L.W8 §S4) — renamed from `Animation`
|
|
150
|
-
* to clear the `globalThis.Animation` d.ts collision. The legacy `Animation`
|
|
151
|
-
* backward-compat alias was DROPPED in 5.0.0 (Q.WE1 — NO-LEGACY).
|
|
152
|
-
*/
|
|
92
|
+
/** The core engine base class (CSS-keyframe parsing + playback). */
|
|
153
93
|
KeyframesAnimation: typeof KeyframesAnimation;
|
|
94
|
+
/** The CSS-parsing `CSSKeyframesAnimation` subclass — the primary "in". */
|
|
154
95
|
CSSKeyframesAnimation: typeof CSSKeyframesAnimation;
|
|
96
|
+
/** Multi-animation compositor (replace/add/weighted layer blending). */
|
|
155
97
|
AnimationGroup: typeof AnimationGroup;
|
|
98
|
+
/** Stable string id for an animation (or string passthrough). */
|
|
156
99
|
getAnimationId: (animation: KeyframesAnimation | string) => string;
|
|
100
|
+
/** Easing name/literal → a typed `TimingFunction` (value.js registry). */
|
|
157
101
|
getTimingFunction: (timingFunction: TimingFunction | TimingFunctionNames | string | undefined) => TimingFunction | undefined;
|
|
102
|
+
/** CSS `@keyframes` text/stylesheet → resolved keyframes. */
|
|
158
103
|
resolveKeyframes: (input: string | Stylesheet) => ResolvedKeyframes;
|
|
159
|
-
/**
|
|
160
|
-
animate: typeof animate;
|
|
161
|
-
/** CSS-native MotionPath (F.W12) — offset-distance over an author offset-path. */
|
|
104
|
+
/** CSS-native MotionPath — offset-distance over an author offset-path. */
|
|
162
105
|
MotionPath: typeof MotionPath;
|
|
106
|
+
/** Construct a MotionPath sweep over a target. */
|
|
163
107
|
fromMotionPath: typeof fromMotionPath;
|
|
164
|
-
/** CSS-native DrawSVG
|
|
108
|
+
/** CSS-native DrawSVG — stroke-dashoffset sweep over the path length. */
|
|
165
109
|
DrawSVG: typeof DrawSVG;
|
|
110
|
+
/** Construct a DrawSVG line-draw over an SVG geometry target. */
|
|
166
111
|
fromDrawSVG: typeof fromDrawSVG;
|
|
167
|
-
/**
|
|
168
|
-
* MorphSVG (O.W6, the DM-3 7-tranche chronic terminal) — SVG path-shape
|
|
169
|
-
* morphing over value.js's `PathGeometry`. Samples two `d` strings at
|
|
170
|
-
* `samples` uniform arc-length steps, pairs the points, and interpolates the
|
|
171
|
-
* `(x, y)` pairs across `t`; `MorphSVG.sampleD(t)` reads the morphed `d`.
|
|
172
|
-
*/
|
|
112
|
+
/** SVG path-shape morphing over value.js's `PathGeometry`. */
|
|
173
113
|
MorphSVG: typeof MorphSVG;
|
|
114
|
+
/** Construct a MorphSVG between two `d` strings. */
|
|
174
115
|
fromMorphSVG: typeof fromMorphSVG;
|
|
175
|
-
/**
|
|
176
|
-
* The preset library (`fadeIn`, `bounce`, `shake`, …) — heavy (each returns
|
|
177
|
-
* a `CSSKeyframesAnimation`), so it rides the dynamic boundary as a namespace
|
|
178
|
-
* instead of the light static barrel: `const { presets } = await
|
|
179
|
-
* loadAnimationEngine(); presets.fadeIn({ duration: 500 })` (F.W11).
|
|
180
|
-
*/
|
|
116
|
+
/** The preset library (`fadeIn`, `bounce`, `shake`, …) as a namespace. */
|
|
181
117
|
presets: typeof AnimationPresets;
|
|
118
|
+
/** The valid `direction` values, as a const tuple. */
|
|
182
119
|
DIRECTIONS: readonly AnimationOptions["direction"][];
|
|
120
|
+
/** The valid `fillMode` values, as a const tuple. */
|
|
183
121
|
FILL_MODES: readonly AnimationOptions["fillMode"][];
|
|
122
|
+
/** The `AnimationOptions` defaults. */
|
|
184
123
|
defaultOptions: AnimationOptions;
|
|
124
|
+
/** The per-layer blend-config defaults. */
|
|
185
125
|
defaultLayerConfig: AnimationLayerConfig;
|
|
186
|
-
/**
|
|
187
|
-
* K.W8 INGEST (FLAGGED ADDITIVE) — the round-trip pointed FORWARD at the
|
|
188
|
-
* live web. `fromStyleSheets`/`fromLiveAnimations`/`resolveLiveKeyframes`
|
|
189
|
-
* walk the CSSOM into kf `CSSKeyframesAnimation` objects (per-sheet CORS
|
|
190
|
-
* `try/catch` → a `CORS_SKIP` diagnostic, never a silent drop); `adoptRunning`
|
|
191
|
-
* takes over a RUNNING CSS animation mid-flight via `getAnimations()`
|
|
192
|
-
* currentTime handoff (the continuity seed, NOT seed-at-zero). HEAVY (the
|
|
193
|
-
* ingest needs the value.js parser) — reached only here, never the LIGHT
|
|
194
|
-
* barrel. Named `adoptRunning` to disambiguate from `engine.adoptCompiled`.
|
|
195
|
-
*/
|
|
126
|
+
/** Walk the document's stylesheets → reconstructed kf animations + CORS diagnostics. */
|
|
196
127
|
fromStyleSheets: typeof fromStyleSheets;
|
|
128
|
+
/** Narrow to the names currently RUNNING via `getAnimations()`. */
|
|
197
129
|
fromLiveAnimations: typeof fromLiveAnimations;
|
|
130
|
+
/** The lowest-level live-CSSOM walk (live analogue of `resolveKeyframes`). */
|
|
198
131
|
resolveLiveKeyframes: typeof resolveLiveKeyframes;
|
|
132
|
+
/** Mid-flight takeover of a running CSS animation (currentTime handoff). */
|
|
199
133
|
adoptRunning: typeof adoptRunning;
|
|
200
|
-
/**
|
|
201
|
-
* K.W9 SCROLL-AS-CSS (FLAGGED ADDITIVE) — the scroll-grammar round-trip
|
|
202
|
-
* (`parseScrollCSS` / `serializeScrollOptions` / `roundTripScrollCSS`,
|
|
203
|
-
* consuming value.js 0.13.0's typed `CSSTimelineOptions` extractor +
|
|
204
|
-
* inverse serializer), the `ScrollScene` JS driver (`createScrollScene`),
|
|
205
|
-
* the conservative-correct backend dispatch (`dispatchScrollBackend`), and
|
|
206
|
-
* the `position:sticky` pin synthesis (`pinCSS`). HEAVY (static value.js
|
|
207
|
-
* edge) — reached only here, never the LIGHT barrel.
|
|
208
|
-
*/
|
|
134
|
+
/** Scroll-driven animation as CSS — the JS driver over a parsed scroll grammar. */
|
|
209
135
|
ScrollScene: typeof ScrollScene;
|
|
136
|
+
/** Construct a `ScrollScene` driver. */
|
|
210
137
|
createScrollScene: typeof createScrollScene;
|
|
138
|
+
/** Parse a scroll-as-CSS rule → typed scroll options. */
|
|
211
139
|
parseScrollCSS: typeof parseScrollCSS;
|
|
140
|
+
/** Parse an `animation-timeline` value. */
|
|
212
141
|
parseScrollTimeline: typeof parseScrollTimeline;
|
|
142
|
+
/** Parse an `animation-range` value. */
|
|
213
143
|
parseScrollRange: typeof parseScrollRange;
|
|
144
|
+
/** Serialize scroll options back to valid CSS. */
|
|
214
145
|
serializeScrollOptions: typeof serializeScrollOptions;
|
|
146
|
+
/** Round-trip scroll CSS (parse → serialize). */
|
|
215
147
|
roundTripScrollCSS: typeof roundTripScrollCSS;
|
|
148
|
+
/** Conservative-correct scroll backend dispatch. */
|
|
216
149
|
dispatchScrollBackend: typeof dispatchScrollBackend;
|
|
150
|
+
/** Resolve a scroll `animation-range` to concrete boundaries. */
|
|
217
151
|
resolveRange: typeof resolveRange;
|
|
152
|
+
/** `position:sticky` pin synthesis. */
|
|
218
153
|
pinCSS: typeof pinCSS;
|
|
219
|
-
/**
|
|
220
|
-
* K.W10 COMPILE (FLAGGED ADDITIVE) — the round-trip's BACKWARD half:
|
|
221
|
-
* `compileToCSS(group | sequence | childList)` → a ZERO-RUNTIME CSS artifact
|
|
222
|
-
* (`@keyframes` + `animation-*` longhands + `animation-composition` layering
|
|
223
|
-
* + `linear()` springs + materialized stagger delays + perceptual `oklab()`
|
|
224
|
-
* densify) PLUS the CC-3 ineligibility report (the four named refusals —
|
|
225
|
-
* `weighted` blend / custom renderers / perceptual oklab beyond densify /
|
|
226
|
-
* computed-unit drift). The compiler is the parser run BACKWARD over the SAME
|
|
227
|
-
* data model (`format.ts` is `keyframes.ts` run backward); a human pastes the
|
|
228
|
-
* result and ships with ZERO kf bytes on the page. HEAVY (value.js-bearing) —
|
|
229
|
-
* reached only here, never the LIGHT barrel.
|
|
230
|
-
*/
|
|
154
|
+
/** The round-trip's BACKWARD half: orchestration graph → zero-runtime CSS. */
|
|
231
155
|
compileToCSS: typeof compileToCSS;
|
|
232
|
-
/**
|
|
233
|
-
* L.W6 AGENT-AUTHORING VERB (FLAGGED ADDITIVE) — the round-trip's FORWARD
|
|
234
|
-
* half: the VALIDATION layer over the compile surface, the first question an
|
|
235
|
-
* LLM agent asks before it suggests kf ("will this `@keyframes` block ship
|
|
236
|
-
* faithfully?"). `validate(css, opts?)` is a READ-ONLY projection over three
|
|
237
|
-
* already-typed channels (the adapter `diagnostics`, the compile
|
|
238
|
-
* `{ eligible, refusals }`, the WAAPI `eligibility`) onto ONE agent-shaped
|
|
239
|
-
* `ValidateResult` envelope an LLM branches on WITHOUT scraping a message;
|
|
240
|
-
* `explain(css, opts?)` formats the SAME verdict deterministic human/LLM-
|
|
241
|
-
* readable. NO new engine code — a pure JOIN over the channels L.W1/L.W2 made
|
|
242
|
-
* honest. HEAVY (validate.ts imports the engine + compile + waapi) — reached
|
|
243
|
-
* only here, never the LIGHT barrel.
|
|
244
|
-
*/
|
|
156
|
+
/** Read-only validation envelope over the compile/adapter/WAAPI channels. */
|
|
245
157
|
validate: typeof validate;
|
|
158
|
+
/** Format the `validate` verdict as deterministic human/LLM-readable text. */
|
|
246
159
|
explain: typeof explain;
|
|
247
|
-
/**
|
|
248
|
-
* L.W8 S1 ED-3 DOGFOOD INVERSION (FLAGGED ADDITIVE) — the heavy
|
|
249
|
-
* serialization/painting/scheduler helpers over a parsed `Animation`.
|
|
250
|
-
* `CSSKeyframesToString`/`CSSKeyframesToStrings` re-serialize the parsed
|
|
251
|
-
* keyframes back to CSS (the FORWARD half of `fromString`, value.js-bearing);
|
|
252
|
-
* `formatCSSKeyframeString` trims one keyframe body for display;
|
|
253
|
-
* `transformTargetsStyle` paints a `Vars` snapshot onto DOM targets (the
|
|
254
|
-
* same painter the run loop drives); `yieldToMain` is the engine's ONE
|
|
255
|
-
* INP-relief yield ladder. HEAVY (they ride the engine chunk) — reached only
|
|
256
|
-
* here, never the LIGHT barrel.
|
|
257
|
-
*/
|
|
160
|
+
/** Re-serialize parsed keyframes back to a CSS string. */
|
|
258
161
|
CSSKeyframesToString: typeof CSSKeyframesToString;
|
|
162
|
+
/** Re-serialize parsed keyframes back to per-rule CSS strings. */
|
|
259
163
|
CSSKeyframesToStrings: typeof CSSKeyframesToStrings;
|
|
164
|
+
/** Trim one keyframe body for display. */
|
|
260
165
|
formatCSSKeyframeString: typeof formatCSSKeyframeString;
|
|
166
|
+
/** Paint a `Vars` snapshot onto DOM targets (the run-loop painter). */
|
|
261
167
|
transformTargetsStyle: typeof transformTargetsStyle;
|
|
168
|
+
/** The engine's INP-relief yield ladder. */
|
|
262
169
|
yieldToMain: typeof yieldToMain;
|
|
263
170
|
}
|
|
264
171
|
|
|
@@ -313,29 +220,19 @@ export declare interface AnimationFrame<V extends Vars> {
|
|
|
313
220
|
|
|
314
221
|
export declare class AnimationGroup<V extends Vars> {
|
|
315
222
|
animations: AnimationGroupObject<V>;
|
|
316
|
-
/**
|
|
317
|
-
*
|
|
318
|
-
*
|
|
319
|
-
* pre-`parse()` group composites nothing via a harmless no-op instead of
|
|
320
|
-
* throwing `this.transform is not a function`. The constructor overrides it
|
|
321
|
-
* with the first child's transform when one exists.
|
|
322
|
-
*/
|
|
223
|
+
/** The group's composite transform. Defaults to a real no-op at the FIELD
|
|
224
|
+
* (I.W0 S3) — a childless/pre-`parse()` group composites nothing instead of
|
|
225
|
+
* throwing; the constructor overrides it with the first child's transform. */
|
|
323
226
|
transform: TransformFunction<V>;
|
|
324
227
|
superKey: string | undefined;
|
|
325
228
|
paused: boolean;
|
|
326
229
|
started: boolean;
|
|
327
230
|
done: boolean;
|
|
328
|
-
/**
|
|
329
|
-
*
|
|
330
|
-
* every child to its final frame in a single composite instead of running
|
|
331
|
-
* the rAF draw loop. SSR-safe off-DOM. Default false.
|
|
332
|
-
*/
|
|
231
|
+
/** When true, `play()` honors `prefers-reduced-motion: reduce` by snapping
|
|
232
|
+
* every child to its final frame in one composite, no rAF loop. Default false. */
|
|
333
233
|
respectReducedMotion: boolean;
|
|
334
|
-
/**
|
|
335
|
-
*
|
|
336
|
-
* at or under this size tick in one slice (fast path); larger groups tick in
|
|
337
|
-
* batches with a `scheduler.yield()` between them (INP relief).
|
|
338
|
-
*/
|
|
234
|
+
/** Children-per-slice before `advanceTo()` yields to the main thread; larger
|
|
235
|
+
* groups batch with a `scheduler.yield()` between slices (INP relief). */
|
|
339
236
|
static readonly YIELD_BATCH = 32;
|
|
340
237
|
singleTarget: boolean;
|
|
341
238
|
lastTickTime: number;
|
|
@@ -348,229 +245,114 @@ export declare class AnimationGroup<V extends Vars> {
|
|
|
348
245
|
/** Cached entries sorted by layer zIndex (see `getEntries`). */
|
|
349
246
|
private _entries;
|
|
350
247
|
private _entriesDirty;
|
|
351
|
-
/**
|
|
352
|
-
*
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
*
|
|
361
|
-
*
|
|
362
|
-
* `
|
|
363
|
-
*/
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
*
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
*
|
|
371
|
-
*
|
|
372
|
-
|
|
373
|
-
* fold. Built by {@link buildSoAPlans} (INTERNAL, `./group-soa`). Rebuilt ONLY
|
|
374
|
-
* on a structural change (alongside `_groupedKeys`), NEVER per frame. The
|
|
375
|
-
* `replace` default arm is dispatch-free and carries NO plan; the non-numeric
|
|
376
|
-
* (color/computed/string/mixed) tail keeps the boxed per-element path. The
|
|
377
|
-
* probe (`carrier-probe`) proved `interpFrames` MUTATES each leaf
|
|
378
|
-
* `ValueUnit.value` IN PLACE, so the carrier + incoming refs are STABLE across
|
|
379
|
-
* frames — the plan is valid until the entry set / a layer whitelist / a blend
|
|
380
|
-
* mode changes (every such mutation routes through `invalidateEntries`).
|
|
381
|
-
*/
|
|
382
|
-
private _soaPlans;
|
|
383
|
-
/**
|
|
384
|
-
* The long-lived SoA fold scratch — the contiguous numeric accumulate buffer
|
|
385
|
-
* the `add`/`weighted` fold seeds, folds, and writes back through. Sized to
|
|
386
|
-
* the WIDEST single-layer numeric pair count once per structural change
|
|
387
|
-
* (reused across layers AND frames — zero per-frame alloc, the F.W4 zero-alloc
|
|
388
|
-
* discipline). `null` until the first plan with numeric pairs is built.
|
|
389
|
-
*/
|
|
390
|
-
private _compositeBuf;
|
|
391
|
-
/**
|
|
392
|
-
* K.W11 PHYS-C — true iff ANY layer currently carries a `weightSpring`. The
|
|
393
|
-
* fast-path guard: when false (the universal case) `advanceTo` skips the
|
|
394
|
-
* per-frame spring scan entirely, so the constant-weight blend hot path takes
|
|
395
|
-
* ZERO new work. Set true by `transitionLayer`; recomputed false once every
|
|
396
|
-
* driving spring has settled.
|
|
397
|
-
*/
|
|
398
|
-
private _hasLayerSprings;
|
|
248
|
+
/** Long-lived composite buffer, cleared in place each frame (zero-alloc).
|
|
249
|
+
* INTERNAL (R.W2) — read/written by `./compositor`. */
|
|
250
|
+
_grouped: Record<string, unknown>;
|
|
251
|
+
/** The compile-stable union of every child's contributed keys — what `_grouped`
|
|
252
|
+
* is null-filled to each frame so the composite clears WITHOUT `delete` (F.W4
|
|
253
|
+
* S2; fold in `./entries`). INTERNAL (R.W2) — the `./compositor` null-fill. */
|
|
254
|
+
_groupedKeys: string[];
|
|
255
|
+
_groupedKeysDirty: boolean;
|
|
256
|
+
/** P.W2 — the SoA composite layout for the `add`/`weighted` blend arms (the
|
|
257
|
+
* validated 3.7×, bit-identical): one {@link SoALayerPlan} per entry, the FLAT
|
|
258
|
+
* pure-numeric pairs hoisted into a {@link Float64Array} fold (built by
|
|
259
|
+
* `buildSoAPlans` in `./soa`, rebuilt ONLY on a structural change). INTERNAL
|
|
260
|
+
* (R.W2) — read/written by `./compositor`. */
|
|
261
|
+
_soaPlans: SoALayerPlan[] | null;
|
|
262
|
+
/** The long-lived SoA fold scratch — the contiguous numeric accumulate buffer,
|
|
263
|
+
* sized to the WIDEST single-layer pair count once per structural change
|
|
264
|
+
* (reused, zero per-frame alloc). INTERNAL (R.W2) — read by `./compositor`. */
|
|
265
|
+
_compositeBuf: Float64Array | null;
|
|
266
|
+
/** K.W11 PHYS-C — true iff ANY layer carries a `weightSpring`; when false (the
|
|
267
|
+
* universal case) `advanceTo` skips the per-frame spring scan (ZERO new work).
|
|
268
|
+
* INTERNAL (R.W2) — set by `./layer-api`'s `transitionLayer`. */
|
|
269
|
+
_hasLayerSprings: boolean;
|
|
399
270
|
constructor(...inputs: (KeyframesAnimation<V> | AnimationGroupInput<V>)[]);
|
|
400
|
-
/**
|
|
401
|
-
*
|
|
402
|
-
*
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
private invalidateEntries;
|
|
271
|
+
/** The animation entries sorted by layer zIndex, dirty-flag cached — rebuilt
|
|
272
|
+
* only on a mutation. INTERNAL (R.W2): read by the colocated `./compositor`/
|
|
273
|
+
* `./entries`/`./scheduler`/`./springs` helpers + all hot-path iteration. */
|
|
274
|
+
getEntries(): AnimationGroupEntry<V>[];
|
|
275
|
+
/** Mark entries cache stale. Called at all mutation boundaries.
|
|
276
|
+
* INTERNAL (R.W2) — also called by `./layer-api`. */
|
|
277
|
+
invalidateEntries(): void;
|
|
408
278
|
setSuperKey(superKey: string): this;
|
|
409
279
|
setTargets(...targets: HTMLElement[]): this;
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
*
|
|
416
|
-
*
|
|
417
|
-
*
|
|
418
|
-
* is
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
*
|
|
425
|
-
* `only === undefined`) — it establishes the carriers `buildSoAPlans` then
|
|
426
|
-
* captures; (2) the per-frame residual (the plan's `boxedKeys` — non-numeric /
|
|
427
|
-
* mixed / first-touch leaves the fold cannot cover, typically empty). Both
|
|
428
|
-
* arms guard on `Array.isArray(existing) && Array.isArray(incoming)` and loop
|
|
429
|
-
* `Math.min(existing.length, incoming.length)` elements with a per-element
|
|
430
|
-
* `isNumericUnit` guard — the byte-exact G.W17 leaf contract (proof:blend),
|
|
431
|
-
* un-clamped `add` (`+=`), spring-weighted `lerp`. A non-array carrier (or a
|
|
432
|
-
* skipped key) falls through to `groupedValues[key] = incoming`.
|
|
433
|
-
*/
|
|
434
|
-
private boxedBlendArm;
|
|
435
|
-
/**
|
|
436
|
-
* P.W2 — the SoA fold for ONE `add`/`weighted` layer (the validated 3.7×,
|
|
437
|
-
* `scripts/soa-composite-decision.json`, bit-identical `maxErr=0`). A thin
|
|
438
|
-
* delegating wrapper over {@link groupSoABlendLayer} (the fold body lives in
|
|
439
|
-
* `./group-soa`, Q.WF2): the wrapper forwards the group's `_compositeBuf`
|
|
440
|
-
* scratch + the plan. The instance METHOD is kept (not inlined at the call
|
|
441
|
-
* site) so `proof:soa-composite`'s `soa-path-taken` clause can monkey-patch
|
|
442
|
-
* `group.soaBlendLayer` on the instance to count fold invocations.
|
|
443
|
-
*/
|
|
444
|
-
private soaBlendLayer;
|
|
445
|
-
/**
|
|
446
|
-
* Render the current composition as a static frame at each child's current
|
|
447
|
-
* `t`. Single-target groups go through the blended transform; multi-target
|
|
448
|
-
* groups apply each child's interpolated vars to its own targets. The public
|
|
449
|
-
* entry point for state mutated outside the rAF loop (scrubbing, state
|
|
450
|
-
* restore, pause snapshots) that needs the visual to update immediately.
|
|
451
|
-
*/
|
|
452
|
-
render(): void;
|
|
453
|
-
/**
|
|
454
|
-
* Set a child animation's current time without touching its siblings.
|
|
455
|
-
* Updates `pausedTime` so the child resumes correctly from the scrub
|
|
456
|
-
* position. Chainable; call `render()` afterwards to reflect it visually.
|
|
457
|
-
*/
|
|
280
|
+
/** Composite all values into a single grouped transform (single-target,
|
|
281
|
+
* per-frame). R.W2 — `private` (lib-group F8): the PUBLIC single-frame-paint
|
|
282
|
+
* entry is `render(t?)`; the body lives in `./compositor`. Thin delegate. */
|
|
283
|
+
private transformFramesGrouped;
|
|
284
|
+
/**
|
|
285
|
+
* Render the current composition as a static frame — the public entry for
|
|
286
|
+
* state mutated outside the rAF loop (scrubbing, restore, pause snapshots).
|
|
287
|
+
* R.W2 — the silent `|| performance.now()` fabrication is EXCISED: the
|
|
288
|
+
* composite `t` is non-normative for a pure-CSS transform, so a caller with a
|
|
289
|
+
* clock passes it (`render(now)`); a scrub uses the group's REAL `lastTickTime`
|
|
290
|
+
* (0 for a never-ticked group), never a fabricated wall-clock.
|
|
291
|
+
*/
|
|
292
|
+
render(t?: number): void;
|
|
293
|
+
/** Set a child's current time without touching its siblings (updates
|
|
294
|
+
* `pausedTime` for a jump-free resume). Chainable; `render()` to reflect it. */
|
|
458
295
|
setChildTime(nameOrAnim: string | KeyframesAnimation<V>, t: number): this;
|
|
459
|
-
/**
|
|
460
|
-
*
|
|
461
|
-
*
|
|
462
|
-
* with no per-frame `Promise.all`/microtask hop; a thenable only on a
|
|
463
|
-
* genuinely-async child or the over-`YIELD_BATCH` yield path.
|
|
464
|
-
*/
|
|
296
|
+
/** Advance all child animations to absolute clock `t`. SYNC on the steady path
|
|
297
|
+
* (J.W6 S1): all-synchronous children advance with no per-frame microtask hop;
|
|
298
|
+
* a thenable only on an async child or the over-`YIELD_BATCH` yield path. */
|
|
465
299
|
advanceTo(t: number): this | Promise<this>;
|
|
466
|
-
/**
|
|
467
|
-
private _endAdvance;
|
|
468
|
-
/**
|
|
469
|
-
* One frame of the group's draw loop (driven by `RAFPlayback.loop`): ticks
|
|
470
|
-
* all children, then renders (single-target: grouped blending; multi-target:
|
|
471
|
-
* per-child). Returns whether the loop should continue.
|
|
472
|
-
*/
|
|
300
|
+
/** One frame of the group's draw loop: tick all children, then render. */
|
|
473
301
|
private _frame;
|
|
474
|
-
/** The post-advance render half of `_frame` — composite, or settle. */
|
|
302
|
+
/** The post-advance render half of `_frame` — composite, or settle on done. */
|
|
475
303
|
private _renderFrame;
|
|
476
304
|
private _resolvePlay;
|
|
477
|
-
/**
|
|
478
|
-
*
|
|
479
|
-
*
|
|
480
|
-
* `_playingPromise` `play()` constructs (the re-entrant guard returns it;
|
|
481
|
-
* the `finally`-clear nulls it on settle) — NOT a second completion
|
|
482
|
-
* lifecycle. A settled (or never-played) group resolves immediately.
|
|
483
|
-
*/
|
|
305
|
+
/** The completion front-door (G.W13) — `await group.finished` resolves once
|
|
306
|
+
* the in-flight composite play settles. Exposes the ONE held `_playingPromise`
|
|
307
|
+
* (a settled/never-played group resolves immediately). */
|
|
484
308
|
get finished(): Promise<void>;
|
|
485
|
-
/**
|
|
486
|
-
*
|
|
487
|
-
*
|
|
488
|
-
* returns the same promise rather than leaking a second draw loop. Under
|
|
489
|
-
* `respectReducedMotion` + an active query, snaps every child to its final
|
|
490
|
-
* frame in a single composite (no rAF loop), then settles as a completed
|
|
491
|
-
* play would.
|
|
492
|
-
*/
|
|
309
|
+
/** Start the group. Resolves when all children complete (or on stop/reset).
|
|
310
|
+
* Re-entrant: an in-flight `play()` returns the same promise. Under
|
|
311
|
+
* `respectReducedMotion` + an active query, snaps to final (no rAF loop). */
|
|
493
312
|
play(): Promise<void>;
|
|
494
|
-
/**
|
|
495
|
-
*
|
|
496
|
-
* terminal path a completed play takes, motion elided. Every child advances
|
|
497
|
-
* to its final frame, one composite paints, `settle()` readies the group for
|
|
498
|
-
* replay (final frame stays on the target(s), matching `Animation`'s snap).
|
|
499
|
-
*/
|
|
313
|
+
/** `prefers-reduced-motion` snap: rest = final, paint it, settle — the SAME
|
|
314
|
+
* terminal path a completed play takes, motion elided. */
|
|
500
315
|
private _playReducedMotion;
|
|
501
|
-
/**
|
|
502
|
-
*
|
|
503
|
-
*
|
|
504
|
-
* the explicit flip). Cancels the rAF loop immediately and renders a
|
|
505
|
-
* final-frame snapshot so the visual matches the exact pause moment.
|
|
506
|
-
*/
|
|
316
|
+
/** Pause the group — idempotent. Pausing an already-paused (or not-yet-started)
|
|
317
|
+
* group is a no-op, NOT a resume. Cancels the rAF loop + renders a final-frame
|
|
318
|
+
* snapshot so the visual matches the pause moment. */
|
|
507
319
|
pause(): this;
|
|
508
|
-
/**
|
|
509
|
-
*
|
|
510
|
-
* `child.resume()`, which would start each child's own rAF loop — the
|
|
511
|
-
* group's draw loop owns the ticking) and re-registers that loop.
|
|
512
|
-
*/
|
|
320
|
+
/** Resume the group — idempotent. Unpauses every child DIRECTLY (not via
|
|
321
|
+
* `child.resume()` — the group's draw loop owns the ticking) + re-registers it. */
|
|
513
322
|
resume(): this;
|
|
514
323
|
/** The explicit flip: pauses if playing, resumes if paused. */
|
|
515
324
|
toggle(): this;
|
|
516
|
-
/**
|
|
517
|
-
*
|
|
518
|
-
* (`managed = false`, `child.settle()`) and clears the group's playback
|
|
519
|
-
* flags. Completion and the reduced-motion snap both end here, leaving the
|
|
520
|
-
* rest frame on the target(s).
|
|
521
|
-
*/
|
|
325
|
+
/** Pure state teardown — never paints. Releases every child (`managed = false`,
|
|
326
|
+
* `child.settle()`) and clears the group flags, leaving the rest frame painted. */
|
|
522
327
|
settle(): this;
|
|
523
|
-
/**
|
|
524
|
-
*
|
|
525
|
-
* settle — the user-facing "return to start". Completion does NOT come here
|
|
526
|
-
* (it settles where the fill contract rested the pixels).
|
|
527
|
-
*/
|
|
328
|
+
/** Explicit rewind: paint every started child back to its INITIAL frame, then
|
|
329
|
+
* settle — the user-facing "return to start" (completion does NOT come here). */
|
|
528
330
|
reset(): this;
|
|
529
|
-
/**
|
|
530
|
-
*
|
|
531
|
-
* semantic the demo's controls expect), and resolve any pending `play()`.
|
|
532
|
-
*/
|
|
331
|
+
/** Halt the draw loop, rewind to the initial frame (the transport-stop
|
|
332
|
+
* semantic the demo's controls expect), and resolve any pending `play()`. */
|
|
533
333
|
stop(): this;
|
|
534
334
|
playing(): boolean;
|
|
535
|
-
|
|
536
|
-
forcePlay(): void;
|
|
537
|
-
/**
|
|
538
|
-
* Set layer config for an animation by name or reference. Chainable; throws
|
|
539
|
-
* on an unregistered key (silent no-ops were hiding consumer bugs).
|
|
540
|
-
*/
|
|
335
|
+
/** Set layer config for an animation by name or reference. Chainable. */
|
|
541
336
|
setLayerConfig(nameOrAnim: string | KeyframesAnimation<V>, config: Partial<AnimationLayerConfig>): this;
|
|
542
337
|
/** Convenience toggle for enabling/disabling a layer. Chainable. */
|
|
543
338
|
setLayerEnabled(nameOrAnim: string | KeyframesAnimation<V>, enabled: boolean): this;
|
|
544
339
|
/** Read the layer config for an animation by name or reference. */
|
|
545
340
|
getLayerConfig(nameOrAnim: string | KeyframesAnimation<V>): AnimationLayerConfig | undefined;
|
|
546
|
-
/**
|
|
547
|
-
*
|
|
548
|
-
* PHYS-C — the spring-driven crossfade). Seeds a `SpringProgress` (via
|
|
549
|
-
* `seedLayerSpring`), parks it on `layer.weightSpring`, and forces
|
|
550
|
-
* `blendMode` to `weighted`. A re-target mid-flight RE-SEATS the in-flight
|
|
551
|
-
* spring from its live `(value, velocity)` (`set target`) — no kink. Full
|
|
552
|
-
* trajectory documentation in `./group-layer-springs`. Chainable.
|
|
553
|
-
*/
|
|
341
|
+
/** Spring a layer's blend `weight` to `weight` (K.W11 PHYS-C — body in
|
|
342
|
+
* `./layer-api`; a mid-flight re-target re-seats velocity-continuously). */
|
|
554
343
|
transitionLayer(nameOrAnim: string | KeyframesAnimation<V>, target: {
|
|
555
344
|
weight: number;
|
|
556
345
|
spring?: LayerTransitionSpring;
|
|
557
346
|
}): this;
|
|
558
|
-
/**
|
|
559
|
-
*
|
|
560
|
-
* down to weight `0` and layer `b` up to weight `1`, each over its own
|
|
561
|
-
* `SpringProgress`. Two `transitionLayer` calls — the flagship demo moment, a
|
|
562
|
-
* crossfade that overshoots and settles. Chainable.
|
|
563
|
-
*/
|
|
347
|
+
/** Crossfade two layers (K.W11 PHYS-C — body in `./layer-api`): two spring
|
|
348
|
+
* `transitionLayer` calls, a→0 and b→1. Chainable. */
|
|
564
349
|
crossfade(a: string | KeyframesAnimation<V>, b: string | KeyframesAnimation<V>, options?: {
|
|
565
350
|
spring?: LayerTransitionSpring;
|
|
566
351
|
}): this;
|
|
567
|
-
/**
|
|
568
|
-
*
|
|
569
|
-
*
|
|
570
|
-
*
|
|
571
|
-
* commits to the constant `layer.weight` and the spring is CLEARED — the
|
|
572
|
-
* `weighted` leaf's `?? layer.weight` read then serves the constant.
|
|
573
|
-
*/
|
|
352
|
+
/** Advance every spring-driven layer weight by `dt` ms (K.W11 PHYS-C). Called
|
|
353
|
+
* from `advanceTo` ONLY when `_hasLayerSprings` is true. R.W2 (lib-group C2):
|
|
354
|
+
* the integrate BODY moved to `./springs`; this thin delegate updates
|
|
355
|
+
* `_hasLayerSprings` from its "any still active?" return. */
|
|
574
356
|
private advanceLayerSprings;
|
|
575
357
|
}
|
|
576
358
|
|
|
@@ -580,7 +362,7 @@ export declare interface AnimationGroupEntry<V extends Vars> {
|
|
|
580
362
|
layer: AnimationLayerConfig;
|
|
581
363
|
}
|
|
582
364
|
|
|
583
|
-
/** Input
|
|
365
|
+
/** Input — a bare Animation or one with a layer config. */
|
|
584
366
|
declare type AnimationGroupInput<V extends Vars> = KeyframesAnimation<V> | {
|
|
585
367
|
animation: KeyframesAnimation<V>;
|
|
586
368
|
layer?: Partial<AnimationLayerConfig>;
|
|
@@ -738,10 +520,8 @@ declare namespace AnimationPresets {
|
|
|
738
520
|
notificationBounce,
|
|
739
521
|
spinner,
|
|
740
522
|
parallaxScroll,
|
|
741
|
-
slideInLeftKeyframes,
|
|
742
523
|
slideInLeft,
|
|
743
524
|
slideOutLeft,
|
|
744
|
-
slideInRightKeyframes,
|
|
745
525
|
slideInRight,
|
|
746
526
|
slideOutRight,
|
|
747
527
|
hover,
|
|
@@ -765,13 +545,13 @@ export { AnimationTimelineValue }
|
|
|
765
545
|
|
|
766
546
|
/** Attention animations — a one-shot nudge to draw the eye. */
|
|
767
547
|
declare const attentionPresets: {
|
|
768
|
-
readonly pulse: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
769
|
-
readonly shake: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
770
|
-
readonly bounce: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
771
|
-
readonly flip: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
772
|
-
readonly notificationBounce: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
773
|
-
readonly springPop: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
774
|
-
readonly springWobble: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
548
|
+
readonly pulse: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
549
|
+
readonly shake: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
550
|
+
readonly bounce: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
551
|
+
readonly flip: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
552
|
+
readonly notificationBounce: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
553
|
+
readonly springPop: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
554
|
+
readonly springWobble: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
775
555
|
};
|
|
776
556
|
|
|
777
557
|
export declare type BlendMode = "replace" | "add" | "weighted";
|
|
@@ -853,16 +633,6 @@ export declare interface CompileRefusal {
|
|
|
853
633
|
*/
|
|
854
634
|
export declare type CompileRefusalReason = "weighted-blend" | "custom-renderer" | "perceptual-oklab" | "computed-unit-drift";
|
|
855
635
|
|
|
856
|
-
/**
|
|
857
|
-
* The COMPILER surface (L.W7 S3 `loadCompiler()`) — the engine core PLUS the
|
|
858
|
-
* round-trip's BACKWARD half, `compileToCSS`. A consumer compiling an
|
|
859
|
-
* orchestration graph to zero-runtime CSS pays for `engine` + `compile`, not
|
|
860
|
-
* the ingest / motion / draw / preset weight.
|
|
861
|
-
*/
|
|
862
|
-
export declare interface CompilerSurface extends EngineCore {
|
|
863
|
-
compileToCSS: typeof compileToCSS;
|
|
864
|
-
}
|
|
865
|
-
|
|
866
636
|
/**
|
|
867
637
|
* THE compiler (CC-1/CC-2/CC-3) — compile an orchestration graph to zero-runtime
|
|
868
638
|
* CSS. Walks the input (`AnimationGroup` / `Sequence` / child list), emits one
|
|
@@ -893,9 +663,8 @@ declare type CompositeOperator = "replace" | "add" | "accumulate";
|
|
|
893
663
|
* Feature-detect (`"ScrollTimeline" in window` / `"ViewTimeline" in window`)
|
|
894
664
|
* and construct a NATIVE `AnimationTimeline` for the additive WAAPI scroll
|
|
895
665
|
* bridge (D-LIB-2 / F-5). Returns `null` where the platform lacks the API
|
|
896
|
-
* (Firefox today, SSR, jsdom) — the caller then keeps the JS
|
|
897
|
-
*
|
|
898
|
-
* non-DOM targets.
|
|
666
|
+
* (Firefox today, SSR, jsdom) — the caller then keeps the JS Timeline sampler,
|
|
667
|
+
* which is the proven fallback AND the only general driver over non-DOM targets.
|
|
899
668
|
*
|
|
900
669
|
* CRITICAL — the ARCH-kill HOLDS: this does NOT replace the JS sampler. Native
|
|
901
670
|
* scroll-driven is Chromium-only / not-Baseline, and the JS `Timeline` is a
|
|
@@ -904,7 +673,7 @@ declare type CompositeOperator = "replace" | "add" | "accumulate";
|
|
|
904
673
|
* bridge is a pure additive fast lane where supported + eligible. No polyfill.
|
|
905
674
|
*
|
|
906
675
|
* Light: a runtime `in`-detect over the `window` globals — zero static
|
|
907
|
-
* value.js / engine edge, so importing this keeps
|
|
676
|
+
* value.js / engine edge, so importing this keeps the timeline zone light.
|
|
908
677
|
*/
|
|
909
678
|
export declare function createNativeTimeline(spec: NativeTimelineSpec): AnimationTimeline | null;
|
|
910
679
|
|
|
@@ -1100,7 +869,7 @@ declare interface Diagnostic extends Partial<ParseDiagnostic> {
|
|
|
1100
869
|
* WAAPI-reason rows are AUTHORED here but POPULATED by K.W8 (which owns the
|
|
1101
870
|
* CSSOM walk that produces them).
|
|
1102
871
|
*/
|
|
1103
|
-
declare type DiagnosticCode = "EMPTY_PARSE" | "UNKNOWN_TIMING_FN" | "COMPOSITION_FALLBACK" | "PARSE_ERROR" | "CORS_SKIP" | "WAAPI_INELIGIBLE" | "ADOPT_REFUSE";
|
|
872
|
+
declare type DiagnosticCode = "EMPTY_PARSE" | "UNKNOWN_TIMING_FN" | "COMPOSITION_FALLBACK" | "PARSE_ERROR" | "CORS_SKIP" | "WAAPI_INELIGIBLE" | "ADOPT_REFUSE" | "PROPERTY_REGISTER_REJECTED" | "CUSTOM_FN_ARG_DROP";
|
|
1104
873
|
|
|
1105
874
|
declare const DIRECTIONS: readonly ["normal", "reverse", "alternate", "alternate-reverse"];
|
|
1106
875
|
|
|
@@ -1148,14 +917,14 @@ export declare function drag2D(element: HTMLElement, options?: {
|
|
|
1148
917
|
|
|
1149
918
|
/**
|
|
1150
919
|
* The 2-D drag sugar — two one-axis {@link Draggable}s composed behind a
|
|
1151
|
-
* single `(x, y, vx, vy)` surface. Split out of `
|
|
920
|
+
* single `(x, y, vx, vy)` surface. Split out of `draggable.ts` (the 1-D engine)
|
|
1152
921
|
* as additive sugar: the engine stays one-dimensional (KISS); this module is
|
|
1153
922
|
* the front door that spares every 2-D consumer the two-`Draggable`
|
|
1154
923
|
* boilerplate. LIGHT — it imports only `Draggable` + `DragOptions` from
|
|
1155
|
-
* `./
|
|
924
|
+
* `./draggable`, so it carries zero static `@mkbabb/value.js` edge.
|
|
1156
925
|
*
|
|
1157
|
-
*
|
|
1158
|
-
*
|
|
926
|
+
* The `drag/index.ts` barrel re-exports `drag2D` + `Drag2DHandle` (R.W1 — the
|
|
927
|
+
* barrel owns the unified surface; no flat-sibling relay through `draggable.ts`).
|
|
1159
928
|
*/
|
|
1160
929
|
/**
|
|
1161
930
|
* The composite handle a {@link drag2D} returns — two one-axis `Draggable`s
|
|
@@ -1482,51 +1251,28 @@ export declare interface ElementMorphOptions {
|
|
|
1482
1251
|
transformOrigin?: string;
|
|
1483
1252
|
}
|
|
1484
1253
|
|
|
1485
|
-
/**
|
|
1486
|
-
* The engine CORE surface — `Animation` / `CSSKeyframesAnimation` /
|
|
1487
|
-
* `AnimationGroup` + the timing/keyframe helpers + the option constants. This
|
|
1488
|
-
* is `./engine`'s own runtime exports: parse + interpolate WITHOUT the
|
|
1489
|
-
* ingest / compile / motion-path / draw-svg / animate / preset front doors. The
|
|
1490
|
-
* granular `loadEngine()` (L.W7 S3) resolves exactly this — a consumer that
|
|
1491
|
-
* needs only `new CSSKeyframesAnimation(opts).fromString(css)` pays for the
|
|
1492
|
-
* `engine` chunk alone, not the eight-chunk full surface.
|
|
1493
|
-
*/
|
|
1494
|
-
export declare interface EngineCore {
|
|
1495
|
-
/** The core engine constructor (PKG-3, L.W8 §S4 — renamed from `Animation`). */
|
|
1496
|
-
KeyframesAnimation: typeof KeyframesAnimation;
|
|
1497
|
-
CSSKeyframesAnimation: typeof CSSKeyframesAnimation;
|
|
1498
|
-
AnimationGroup: typeof AnimationGroup;
|
|
1499
|
-
getAnimationId: (animation: KeyframesAnimation | string) => string;
|
|
1500
|
-
getTimingFunction: (timingFunction: TimingFunction | TimingFunctionNames | string | undefined) => TimingFunction | undefined;
|
|
1501
|
-
resolveKeyframes: (input: string | Stylesheet) => ResolvedKeyframes;
|
|
1502
|
-
DIRECTIONS: readonly AnimationOptions["direction"][];
|
|
1503
|
-
FILL_MODES: readonly AnimationOptions["fillMode"][];
|
|
1504
|
-
defaultOptions: AnimationOptions;
|
|
1505
|
-
defaultLayerConfig: AnimationLayerConfig;
|
|
1506
|
-
}
|
|
1507
|
-
|
|
1508
1254
|
/** Entrance animations — bring an element INTO view. */
|
|
1509
1255
|
declare const enterPresets: {
|
|
1510
|
-
readonly fadeIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
1511
|
-
readonly slideIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
1512
|
-
readonly slideInLeft: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
1513
|
-
readonly slideInRight: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
1514
|
-
readonly rotateIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
1515
|
-
readonly blurIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
1516
|
-
readonly springScaleIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
1517
|
-
readonly springSlideIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
1518
|
-
readonly jumpUp: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
1256
|
+
readonly fadeIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1257
|
+
readonly slideIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1258
|
+
readonly slideInLeft: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1259
|
+
readonly slideInRight: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1260
|
+
readonly rotateIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1261
|
+
readonly blurIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1262
|
+
readonly springScaleIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1263
|
+
readonly springSlideIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1264
|
+
readonly jumpUp: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1519
1265
|
};
|
|
1520
1266
|
|
|
1521
1267
|
/** Exit animations — take an element OUT of view. */
|
|
1522
1268
|
declare const exitPresets: {
|
|
1523
|
-
readonly fadeOut: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
1524
|
-
readonly slideOutLeft: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
1525
|
-
readonly slideOutRight: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
1526
|
-
readonly blurOut: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
1527
|
-
readonly warpLeft: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
1528
|
-
readonly warpRight: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
1529
|
-
readonly jumpDown: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
1269
|
+
readonly fadeOut: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1270
|
+
readonly slideOutLeft: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1271
|
+
readonly slideOutRight: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1272
|
+
readonly blurOut: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1273
|
+
readonly warpLeft: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1274
|
+
readonly warpRight: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1275
|
+
readonly jumpDown: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1530
1276
|
};
|
|
1531
1277
|
|
|
1532
1278
|
/**
|
|
@@ -1873,32 +1619,6 @@ export declare interface IngestResult<V extends Vars = any> {
|
|
|
1873
1619
|
diagnostics: Diagnostic[];
|
|
1874
1620
|
}
|
|
1875
1621
|
|
|
1876
|
-
/**
|
|
1877
|
-
* The INGEST surface (L.W7 S3 `loadIngest()`) — the engine core PLUS the
|
|
1878
|
-
* forward-pointed live-web walk (`fromStyleSheets` / `fromLiveAnimations` /
|
|
1879
|
-
* `resolveLiveKeyframes` / `adoptRunning`) and the scroll-grammar round-trip
|
|
1880
|
-
* (`ScrollScene` + `parseScrollCSS` / `serializeScrollOptions` / …). A
|
|
1881
|
-
* consumer ingesting CSSOM / adopting a running animation / driving a scroll
|
|
1882
|
-
* scene pays for `engine` + `ingest` + `scroll-scene`, not the compile /
|
|
1883
|
-
* motion / draw / preset weight.
|
|
1884
|
-
*/
|
|
1885
|
-
export declare interface IngestSurface extends EngineCore {
|
|
1886
|
-
fromStyleSheets: typeof fromStyleSheets;
|
|
1887
|
-
fromLiveAnimations: typeof fromLiveAnimations;
|
|
1888
|
-
resolveLiveKeyframes: typeof resolveLiveKeyframes;
|
|
1889
|
-
adoptRunning: typeof adoptRunning;
|
|
1890
|
-
ScrollScene: typeof ScrollScene;
|
|
1891
|
-
createScrollScene: typeof createScrollScene;
|
|
1892
|
-
parseScrollCSS: typeof parseScrollCSS;
|
|
1893
|
-
parseScrollTimeline: typeof parseScrollTimeline;
|
|
1894
|
-
parseScrollRange: typeof parseScrollRange;
|
|
1895
|
-
serializeScrollOptions: typeof serializeScrollOptions;
|
|
1896
|
-
roundTripScrollCSS: typeof roundTripScrollCSS;
|
|
1897
|
-
dispatchScrollBackend: typeof dispatchScrollBackend;
|
|
1898
|
-
resolveRange: typeof resolveRange;
|
|
1899
|
-
pinCSS: typeof pinCSS;
|
|
1900
|
-
}
|
|
1901
|
-
|
|
1902
1622
|
export declare type InputAnimationOptions = Partial<{
|
|
1903
1623
|
duration: number | string;
|
|
1904
1624
|
delay: number | string;
|
|
@@ -1922,18 +1642,13 @@ declare const jumpDown: (options?: InputAnimationOptions) => CSSKeyframesAnimati
|
|
|
1922
1642
|
|
|
1923
1643
|
declare const jumpUp: (options?: InputAnimationOptions) => CSSKeyframesAnimation< Vars>;
|
|
1924
1644
|
|
|
1925
|
-
/** A keyframe map: percent/keyword stops → partial var frames. */
|
|
1926
|
-
export declare type KeyframeMap<V extends Vars> = Map<string, Partial<V>> | Record<string, Partial<V>>;
|
|
1927
|
-
|
|
1928
1645
|
/**
|
|
1929
1646
|
* The core animation engine — keyframes, timing, interpolation, playback.
|
|
1930
1647
|
*
|
|
1931
|
-
*
|
|
1932
|
-
*
|
|
1933
|
-
*
|
|
1934
|
-
*
|
|
1935
|
-
* backward-compat RE-EXPORT alias was DROPPED in 5.0.0 (Q.WE1 — NO-LEGACY).
|
|
1936
|
-
* Gated by `proof:pkg3-clean`. The runtime constructor is `KeyframesAnimation`.
|
|
1648
|
+
* PKG-3 RENAME (L.W8): formerly `Animation`; renamed to `KeyframesAnimation`
|
|
1649
|
+
* because the old name collided with the ambient `globalThis.Animation` (WAAPI),
|
|
1650
|
+
* leaking a suffixed collision alias into the d.ts. The legacy `Animation`
|
|
1651
|
+
* re-export alias was DROPPED in 5.0.0 (Q.WE1 — NO-LEGACY).
|
|
1937
1652
|
*/
|
|
1938
1653
|
export declare class KeyframesAnimation<V extends Vars = any> {
|
|
1939
1654
|
id: number;
|
|
@@ -1941,130 +1656,83 @@ export declare class KeyframesAnimation<V extends Vars = any> {
|
|
|
1941
1656
|
superKey: string | undefined;
|
|
1942
1657
|
targets: HTMLElement[];
|
|
1943
1658
|
options: AnimationOptions;
|
|
1944
|
-
/**
|
|
1945
|
-
*
|
|
1946
|
-
*
|
|
1947
|
-
*
|
|
1948
|
-
*
|
|
1949
|
-
*
|
|
1950
|
-
*
|
|
1951
|
-
* READ-ONLY surface (G.W19): the backing `_compiler` is written ONLY by the
|
|
1952
|
-
* constructor and {@link adoptCompiled}. An external `animation.compiler = …`
|
|
1953
|
-
* write was the one cross-boundary reach-in vector that could desync the
|
|
1954
|
-
* live-options reference (`this.options !== this.compiler.options`); making
|
|
1955
|
-
* `compiler` a get-only accessor makes that reach-in a COMPILE error, not a
|
|
1956
|
-
* convention. Adopt a compiled state via `adoptCompiled(source)`.
|
|
1957
|
-
*/
|
|
1659
|
+
/** The frame-compilation half — template frames → sampled `frames[]`. The
|
|
1660
|
+
* class composes one and delegates `addFrame`/`parse` + the frame accessors
|
|
1661
|
+
* to it. READ-ONLY surface (G.W19): the backing `_compiler` is written ONLY
|
|
1662
|
+
* by the constructor + `adoptCompiled` (via `_setCompiler`); an external
|
|
1663
|
+
* `animation.compiler = …` reach-in is a COMPILE error (the live-options
|
|
1664
|
+
* desync lock). */
|
|
1958
1665
|
private _compiler;
|
|
1959
1666
|
get compiler(): FrameCompiler<V>;
|
|
1960
|
-
/**
|
|
1961
|
-
*
|
|
1962
|
-
* the WAAPI shadow tick both ride it, so `stop()` halts either
|
|
1963
|
-
* uniformly and no raw rAF handle leaks onto the instance.
|
|
1964
|
-
*/
|
|
1667
|
+
/** THE rAF owner for this animation — the standalone play loop and the WAAPI
|
|
1668
|
+
* shadow tick both ride it, so `stop()` halts either uniformly. */
|
|
1965
1669
|
readonly playback: RAFPlayback;
|
|
1966
|
-
/**
|
|
1967
|
-
*
|
|
1968
|
-
*
|
|
1969
|
-
*
|
|
1970
|
-
*
|
|
1971
|
-
*
|
|
1972
|
-
|
|
1973
|
-
_waAnimations: globalThis.Animation[];
|
|
1670
|
+
/** The standalone-play machine's OWN run-state (R.W2 — DI by composition):
|
|
1671
|
+
* the deferred play resolver, the held play promise, the live WAAPI handles,
|
|
1672
|
+
* the bound frame callback, the hoisted zero-alloc interp buffer. The five
|
|
1673
|
+
* fields formerly privacy-inverted onto the class body + re-published through
|
|
1674
|
+
* the excised `PlaybackHost` interface; the `./playback` free functions now
|
|
1675
|
+
* own them via `this._playback` directly (no cast, no re-publication). */
|
|
1676
|
+
readonly _playback: PlaybackState;
|
|
1974
1677
|
startTime: number | undefined;
|
|
1975
1678
|
pausedTime: number;
|
|
1976
1679
|
t: number;
|
|
1977
1680
|
iteration: number;
|
|
1978
|
-
/**
|
|
1979
|
-
*
|
|
1980
|
-
*
|
|
1981
|
-
*
|
|
1982
|
-
* array of stable-coded {@link Diagnostic} rows; empty on a clean parse with
|
|
1983
|
-
* no fallback. Every SILENT fallback site is mirrored here — the honesty
|
|
1984
|
-
* surface (`proof:diagnostics-channel`). Queryable; no console output.
|
|
1985
|
-
*/
|
|
1681
|
+
/** Structured parse/honoring diagnostics (K.W7 S4) — a FLAT additive array
|
|
1682
|
+
* of stable-coded {@link Diagnostic} rows surfaced from `resolveKeyframes` +
|
|
1683
|
+
* the engine's composition-fallback rows; empty on a clean parse. Every
|
|
1684
|
+
* SILENT fallback site is mirrored here (`proof:diagnostics-channel`). */
|
|
1986
1685
|
diagnostics: Diagnostic[];
|
|
1987
|
-
/**
|
|
1988
|
-
*
|
|
1989
|
-
*
|
|
1990
|
-
|
|
1991
|
-
* composited leaf is applied). Empty for a pure-`replace` animation (the
|
|
1992
|
-
* zero-overhead path). The capture/accumulate logic lives in
|
|
1993
|
-
* `./engine-composition` ({@link applyComposition}/`captureUnderlyingBase`).
|
|
1994
|
-
*/
|
|
1995
|
-
private _compositionBase;
|
|
1686
|
+
/** The captured UNDERLYING base value per composited leaf (K.W7 S1) — the
|
|
1687
|
+
* per-element numeric base `add`/`accumulate` accumulates ONTO; empty for a
|
|
1688
|
+
* pure-`replace` animation. INTERNAL — read by `./interpolate` (R.W2). */
|
|
1689
|
+
_compositionBase: Map<string, number[]>;
|
|
1996
1690
|
/** Properties whose non-numeric composite already emitted its
|
|
1997
|
-
* `COMPOSITION_FALLBACK` row
|
|
1998
|
-
*
|
|
1999
|
-
|
|
2000
|
-
/** True once
|
|
2001
|
-
*
|
|
2002
|
-
|
|
2003
|
-
private _hasComposition;
|
|
1691
|
+
* `COMPOSITION_FALLBACK` row (once per property, not per frame). INTERNAL —
|
|
1692
|
+
* read by `./interpolate` (R.W2). */
|
|
1693
|
+
_compositionFallbackSeen: Set<string>;
|
|
1694
|
+
/** True once a non-`replace` operator was seen — the hot path skips ALL
|
|
1695
|
+
* composition work when false. INTERNAL — read by `./interpolate` (R.W2). */
|
|
1696
|
+
_hasComposition: boolean;
|
|
2004
1697
|
started: boolean;
|
|
2005
1698
|
done: boolean;
|
|
2006
1699
|
reversed: boolean;
|
|
2007
1700
|
paused: boolean;
|
|
2008
|
-
/**
|
|
2009
|
-
*
|
|
2010
|
-
*
|
|
2011
|
-
* the group at construction; standalone `.play()` / `.draw()`
|
|
2012
|
-
* throw when this is true rather than racing the group.
|
|
2013
|
-
*/
|
|
1701
|
+
/** True when an `AnimationGroup` drives this animation's `advanceTo()`/
|
|
1702
|
+
* `interpFrames()` from its own rAF loop. Standalone `.play()` throws when
|
|
1703
|
+
* set rather than racing the group. */
|
|
2014
1704
|
managed: boolean;
|
|
2015
|
-
/**
|
|
2016
|
-
*
|
|
2017
|
-
* but `useWAAPI: true` was requested, this records the reason.
|
|
2018
|
-
* Queryable by debug builds — no console output is produced.
|
|
2019
|
-
*/
|
|
1705
|
+
/** If the most recent `play()` fell back from WAAPI to rAF despite
|
|
1706
|
+
* `useWAAPI: true`, this records the reason. Queryable; no console output. */
|
|
2020
1707
|
waapiIneligibleReason: string | undefined;
|
|
2021
1708
|
unflatten: boolean;
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
*
|
|
2026
|
-
*
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
/**
|
|
2030
|
-
* The ONE output buffer for the standalone play loop's `interpFrames`
|
|
2031
|
-
* calls — reused every frame so steady-state playback allocates no
|
|
2032
|
-
* per-frame result object (the primitive-level analogue of the group's
|
|
2033
|
-
* hoisted `_grouped` buffer, gated by `proof:standalone-zero-alloc`).
|
|
2034
|
-
* The play path (`_frame`) never returns this object to a consumer, so
|
|
2035
|
-
* reuse is safe; `at()` (a query whose result the caller keeps) still
|
|
2036
|
-
* allocates a fresh object.
|
|
2037
|
-
*/
|
|
2038
|
-
private _interpOut;
|
|
2039
|
-
/**
|
|
2040
|
-
* The compile-stable union of every frame's `flatVars` keys — the maximal
|
|
2041
|
-
* key-set any `interpFrames` call can write. Fixed at `parse` (the keys
|
|
2042
|
-
* never change across frames; a color-space renormalize re-derives the same
|
|
2043
|
-
* carriers under the same keys). It is what `clearBuffer` null-fills to keep
|
|
2044
|
-
* a reused buffer stale-free WITHOUT `delete` (F.W4 S1 — the V8 dictionary-
|
|
2045
|
-
* mode trap the delete-loop fell into). Exposed (read-only) as `flatKeys`
|
|
2046
|
-
* so the `AnimationGroup` can size its own composite buffer the same way.
|
|
2047
|
-
*/
|
|
2048
|
-
private _stableKeys;
|
|
2049
|
-
/**
|
|
2050
|
-
* The consumer's EXPLICIT constructor options (NOT merged with defaults) —
|
|
1709
|
+
/** The compile-stable union of every frame's `flatVars` keys, fixed at
|
|
1710
|
+
* `parse` — what `clearBuffer` null-fills to keep a reused buffer stale-free
|
|
1711
|
+
* WITHOUT `delete` (F.W4 S1, the V8 dictionary-mode trap). Exposed read-only
|
|
1712
|
+
* as `flatKeys` so the group sizes its composite buffer the same way.
|
|
1713
|
+
* INTERNAL — read by `./interpolate` (R.W2). */
|
|
1714
|
+
_stableKeys: string[];
|
|
1715
|
+
/** The consumer's EXPLICIT constructor options (NOT merged with defaults) —
|
|
2051
1716
|
* retained so `fromString` can layer a parsed style-rule `animation`
|
|
2052
|
-
* shorthand UNDER them (constructor-explicit wins
|
|
2053
|
-
*/
|
|
1717
|
+
* shorthand UNDER them (constructor-explicit wins, F.W8). */
|
|
2054
1718
|
protected _ctorOptions: Partial<InputAnimationOptions>;
|
|
2055
1719
|
/** The compile-stable union of this animation's interpolated keys. */
|
|
2056
1720
|
get flatKeys(): readonly string[];
|
|
2057
1721
|
/**
|
|
2058
|
-
* The instance's ONE default DOM-style renderer, allocated once.
|
|
2059
|
-
*
|
|
2060
|
-
*
|
|
2061
|
-
* typed and bind-proof, unlike a Symbol tag on a closure, which
|
|
2062
|
-
* `Function.prototype.bind` silently drops.
|
|
1722
|
+
* The instance's ONE default DOM-style renderer, allocated once. "Did the
|
|
1723
|
+
* consumer supply a custom transform?" is a reference comparison against this
|
|
1724
|
+
* single value ({@link usesDefaultRenderer}) — typed and bind-proof.
|
|
2063
1725
|
*/
|
|
2064
1726
|
protected readonly _defaultTransform: TransformFunction<V>;
|
|
2065
1727
|
/** True when `fn` is this instance's default DOM-style renderer. */
|
|
2066
1728
|
usesDefaultRenderer(fn: TransformFunction<V> | undefined): boolean;
|
|
2067
|
-
|
|
1729
|
+
/**
|
|
1730
|
+
* Fire a lifecycle `AnimationEvent` on each bound target (R.W2 — F-6, body in
|
|
1731
|
+
* `./playback`). INTERNAL: the play machine calls it on the concrete
|
|
1732
|
+
* animation — kept ON the class but NOT `private`, reached by direct field
|
|
1733
|
+
* access (the old `PlaybackHost` re-publication + cast are excised).
|
|
1734
|
+
*/
|
|
1735
|
+
dispatchAnimationEvent(type: string): void;
|
|
2068
1736
|
constructor(options?: Partial<InputAnimationOptions>, targets?: HTMLElement[] | HTMLElement | undefined, name?: string | undefined, superKey?: string | undefined);
|
|
2069
1737
|
get templateFrames(): TemplateAnimationFrame<V>[];
|
|
2070
1738
|
set templateFrames(value: TemplateAnimationFrame<V>[]);
|
|
@@ -2073,56 +1741,21 @@ export declare class KeyframesAnimation<V extends Vars = any> {
|
|
|
2073
1741
|
get frameId(): number;
|
|
2074
1742
|
/** Append a template frame (delegated to the compiler). Chainable. */
|
|
2075
1743
|
addFrame<K extends V>(start: number | string | ValueUnit<number>, vars: Partial<K>, transform?: TransformFunction<K>, timingFunction?: InputAnimationOptions["timingFunction"], composition?: CompositeOperator): KeyframesAnimation<K>;
|
|
2076
|
-
/** Compile the template frames into the sampled `frames[]
|
|
1744
|
+
/** Compile the template frames into the sampled `frames[]` (R.W2 body in
|
|
1745
|
+
* `./compile-bridge`). Chainable. */
|
|
2077
1746
|
parse(): this;
|
|
2078
|
-
/**
|
|
2079
|
-
* Set `_hasComposition` (K.W7 S1) — true iff ANY compiled frame carries a
|
|
2080
|
-
* non-`replace` `animation-composition` operator (the hot-path branch reads
|
|
2081
|
-
* this ONE per-animation constant; a pure-`replace` animation never pays for
|
|
2082
|
-
* the composition work) — and reset the per-run base/fallback caches so a
|
|
2083
|
-
* re-parse re-snapshots the underlying base. See `./engine-composition`.
|
|
2084
|
-
*/
|
|
2085
|
-
private computeHasComposition;
|
|
2086
1747
|
/**
|
|
2087
1748
|
* Adopt another animation's ALREADY-COMPILED state as ONE atomic motion
|
|
2088
|
-
* (G.W19
|
|
2089
|
-
*
|
|
2090
|
-
*
|
|
2091
|
-
* second compile.
|
|
2092
|
-
*
|
|
2093
|
-
* The transplant moves the `{ compiler, options, unflatten }` triad together
|
|
2094
|
-
* and re-binds the live-options reference BY CONSTRUCTION — `this.options` is
|
|
2095
|
-
* read OFF the adopted compiler, so `this.options === this.compiler.options`
|
|
2096
|
-
* holds without relying on the caller's assignment order. This is the
|
|
2097
|
-
* invariant the demo formerly held by a comment + three ordered field writes;
|
|
2098
|
-
* here it is the method's contract, enforced by `proof:adopt-compiled`. A
|
|
2099
|
-
* `compiler` adopted WITHOUT re-binding `options` would leave the setters
|
|
2100
|
-
* mutating one object while the compiler reads another — the exact desync
|
|
2101
|
-
* the `6e29236` live-options lock guards against.
|
|
2102
|
-
*
|
|
2103
|
-
* Recomputes `_stableKeys` so `flatKeys` (the buffer-sizing contract)
|
|
2104
|
-
* reflects the adopted compiled frames, not the pre-adopt key-set. Chainable.
|
|
2105
|
-
*
|
|
2106
|
-
* @param source an animation whose `compiler` is already compiled.
|
|
1749
|
+
* (G.W19 — body in `./compile-bridge`): moves the `{ compiler, options,
|
|
1750
|
+
* unflatten }` triad + re-binds the live-options reference BY CONSTRUCTION
|
|
1751
|
+
* (`proof:adopt-compiled`). Chainable.
|
|
2107
1752
|
*/
|
|
2108
1753
|
adoptCompiled(source: KeyframesAnimation<V>): this;
|
|
2109
|
-
/**
|
|
2110
|
-
*
|
|
2111
|
-
*
|
|
2112
|
-
*
|
|
2113
|
-
|
|
2114
|
-
*/
|
|
2115
|
-
private computeStableKeys;
|
|
2116
|
-
/**
|
|
2117
|
-
* Option setters — the fail-explicit contract.
|
|
2118
|
-
*
|
|
2119
|
-
* Genuine omission (`undefined`/`null`) means "use the default" and is
|
|
2120
|
-
* always accepted; present-but-malformed input THROWS a typed
|
|
2121
|
-
* `AnimationOptionError` naming the option and the offending value.
|
|
2122
|
-
* This is the same posture the layer API chose ("silent no-ops were
|
|
2123
|
-
* hiding consumer bugs") applied to the whole options surface — no
|
|
2124
|
-
* silent fallback, no silently-preserved previous value.
|
|
2125
|
-
*/
|
|
1754
|
+
/** INTERNAL (R.W2): the sanctioned backing-field write for `_compiler` (used
|
|
1755
|
+
* ONLY by `./compile-bridge`'s `adoptCompiled`). The `compiler` accessor
|
|
1756
|
+
* stays get-only — an external `animation.compiler = …` reach-in is a COMPILE
|
|
1757
|
+
* error (the G.W19 live-options-desync lock). */
|
|
1758
|
+
_setCompiler(compiler: FrameCompiler<V>): void;
|
|
2126
1759
|
setTimingFunction(timingFunction: InputAnimationOptions["timingFunction"]): this;
|
|
2127
1760
|
setIterationCount(iterationCount: InputAnimationOptions["iterationCount"]): this;
|
|
2128
1761
|
setDuration(duration: InputAnimationOptions["duration"]): this;
|
|
@@ -2133,197 +1766,51 @@ export declare class KeyframesAnimation<V extends Vars = any> {
|
|
|
2133
1766
|
setRespectReducedMotion(respectReducedMotion: InputAnimationOptions["respectReducedMotion"]): this;
|
|
2134
1767
|
setColorSpace(colorSpace: InputAnimationOptions["colorSpace"]): this;
|
|
2135
1768
|
setHueMethod(hueMethod: InputAnimationOptions["hueMethod"]): this;
|
|
2136
|
-
/**
|
|
2137
|
-
* Set the LAYER-level `animation-composition` operator (L.W1 S5, Band A).
|
|
2138
|
-
* Genuine omission (`undefined`) leaves the field unset — the serializer
|
|
2139
|
-
* treats it as the CSS default `replace` and omits the longhand. A present
|
|
2140
|
-
* value is stored verbatim (`replace` | `add` | `accumulate`), so a sibling
|
|
2141
|
-
* `.class { animation-composition: add }` ingested by `fromString`
|
|
2142
|
-
* round-trips on re-serialize.
|
|
2143
|
-
*/
|
|
2144
1769
|
setComposite(composite: InputAnimationOptions["composite"]): this;
|
|
2145
1770
|
setOptions(options: Partial<InputAnimationOptions>): this;
|
|
2146
1771
|
reverse(): this;
|
|
2147
1772
|
fillForwards(): void;
|
|
2148
1773
|
fillBackwards(): void;
|
|
2149
|
-
/**
|
|
2150
|
-
*
|
|
2151
|
-
* `fillMode` (forwards/both → final; none/backwards → initial). This is
|
|
2152
|
-
* the explicit rest-position contract: completion paints the rest frame
|
|
2153
|
-
* per this derivation, and the reduced-motion snap is "rest = final,
|
|
2154
|
-
* paint it, settle" — the same path a `fillMode: forwards` completion
|
|
2155
|
-
* takes, not a separate code path.
|
|
2156
|
-
*/
|
|
1774
|
+
/** Where the playhead rests after a completed play (forwards/both → final;
|
|
1775
|
+
* none/backwards → initial) — body in `./interpolate`. */
|
|
2157
1776
|
get restPosition(): "initial" | "final";
|
|
2158
|
-
/** Paint the rest frame per the fill contract. */
|
|
1777
|
+
/** Paint the rest frame per the fill contract (body in `./interpolate`). */
|
|
2159
1778
|
paintRest(): void;
|
|
2160
|
-
/**
|
|
2161
|
-
*
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
*
|
|
2165
|
-
*
|
|
2166
|
-
* while a template frame still carries `NAMED_SELECTOR_SUPERTYPE` (unresolved —
|
|
2167
|
-
* `bindTimeline` was never called), refuse with the TYPED
|
|
2168
|
-
* `NAMED_SELECTOR_NO_TIMELINE` rather than silently producing NaN frames that
|
|
2169
|
-
* `binarySearchRange` treats as ALWAYS-ACTIVE. Fired ONLY at the genuinely-
|
|
2170
|
-
* demanded point — NEVER at parse/ingest (the reverted Path-A trap). A resolved
|
|
2171
|
-
* frame (the superType tag CLEARED by `bindTimeline`) passes silently — this is
|
|
2172
|
-
* a zero-cost `Array.find` over `templateFrames` whose starts are `%`/`from`/
|
|
2173
|
-
* `to` (no `superType`) on a non-named animation.
|
|
2174
|
-
*/
|
|
2175
|
-
private assertNoUnresolvedNamedSelector;
|
|
2176
|
-
/**
|
|
2177
|
-
* Stateless progress query. Maps [0,1] from first keyframe to last,
|
|
2178
|
-
* regardless of playback direction. `apply=true` invokes transform callbacks.
|
|
2179
|
-
*/
|
|
1779
|
+
/** The named-selector PLAY-TIME guard (Q.WD1 S3 — body in `./interpolate`).
|
|
1780
|
+
* INTERNAL (R.W2): the play machine + `at()` call it; NOT `private`. */
|
|
1781
|
+
assertNoUnresolvedNamedSelector(): void;
|
|
1782
|
+
/** Stateless progress query — maps [0,1] from first to last keyframe,
|
|
1783
|
+
* direction-agnostic (`apply=true` invokes transforms). Body in
|
|
1784
|
+
* `./interpolate`. */
|
|
2180
1785
|
at(progress: number, apply?: boolean): Record<string, ValueUnit[]>;
|
|
2181
1786
|
/**
|
|
2182
|
-
* Interpolate all active frames at time `t
|
|
2183
|
-
*
|
|
2184
|
-
*
|
|
2185
|
-
*
|
|
2186
|
-
*
|
|
2187
|
-
* (multiple properties may share the same time range).
|
|
2188
|
-
*
|
|
2189
|
-
* @param t - Current animation time in milliseconds
|
|
2190
|
-
* @param transformFrames - If true, applies each frame's transform function to targets
|
|
2191
|
-
* @param out - Optional output object to write results into. When
|
|
2192
|
-
* provided, its keys are cleared first so no stale keys from a
|
|
2193
|
-
* previous call leak through. Pass this per-animation to achieve
|
|
2194
|
-
* zero-allocation steady-state playback.
|
|
2195
|
-
* @returns Merged flat vars from all active frames
|
|
1787
|
+
* Interpolate all active frames at time `t` — the hot path (once per rAF
|
|
1788
|
+
* frame). R.W2 body in `./interpolate`; this is the thin public sampling
|
|
1789
|
+
* delegate the group, sequence, WAAPI build, and `at()` all drive. Zero-alloc
|
|
1790
|
+
* + fast-properties contract preserved (proof:standalone-zero-alloc /
|
|
1791
|
+
* proof:interp-fastprops).
|
|
2196
1792
|
*/
|
|
2197
1793
|
interpFrames(t: number, transformFrames?: boolean, out?: Record<string, ValueUnit[]>): Record<string, ValueUnit[]>;
|
|
2198
|
-
/**
|
|
2199
|
-
* Clear a reused interpolation buffer to a stale-free state WITHOUT
|
|
2200
|
-
* `delete` — the V8-correct stable-key null-fill (F.W4 S1). The key-set is
|
|
2201
|
-
* compile-stable (`_stableKeys` is the union of every frame's `flatVars`
|
|
2202
|
-
* keys, fixed at `parse`), so null-filling it keeps the buffer in
|
|
2203
|
-
* fast-properties mode AND zero-alloc. Inactive keys read back `undefined`;
|
|
2204
|
-
* every consumer of a reused buffer (the group blend, the unused play-loop
|
|
2205
|
-
* `_interpOut`) skips them — only the standalone return path (which never
|
|
2206
|
-
* reuses a buffer) must be `undefined`-free, and it takes the alias / fresh
|
|
2207
|
-
* merge above.
|
|
2208
|
-
*/
|
|
2209
|
-
private clearBuffer;
|
|
2210
|
-
/**
|
|
2211
|
-
* Interpolate ONE active frame at time `t` in place (lerp + optional
|
|
2212
|
-
* transform). Lifted off the `interpFrames` hot loop so playback allocates
|
|
2213
|
-
* no per-frame closure. A zero-width frame (`start === stop`, a degenerate
|
|
2214
|
-
* keyframe pair) snaps to the endpoint instead of dividing by zero in
|
|
2215
|
-
* `scale` (E-RT-5). The merge into the result buffer is done by the caller
|
|
2216
|
-
* (F.W4 S3 — so the single-frame path can alias `flatVars` with no copy).
|
|
2217
|
-
*/
|
|
2218
|
-
private processFrame;
|
|
2219
|
-
/**
|
|
2220
|
-
* Composite ONE frame's lerped numeric leaves onto the captured underlying
|
|
2221
|
-
* base per its `animation-composition` operator (K.W7 S1) — the thin engine
|
|
2222
|
-
* seam threading the live per-run state into the pure `./engine-composition`
|
|
2223
|
-
* honoring (where the un-clamped add, repeat-aware accumulate, captured base,
|
|
2224
|
-
* and non-numeric `replace`-fallback + `COMPOSITION_FALLBACK` row live).
|
|
2225
|
-
*/
|
|
2226
|
-
private applyComposition;
|
|
2227
|
-
/** SYNC unless `delay > 0` — then a thenable resolving after the sleep. */
|
|
2228
1794
|
onStart(): Promise<void> | undefined;
|
|
2229
1795
|
onEnd(): void;
|
|
2230
|
-
/**
|
|
2231
|
-
* Advance the playhead to absolute clock `t` (a rAF timestamp, NOT a
|
|
2232
|
-
* delta). Lazily runs `onStart` on the first call, reconciles the
|
|
2233
|
-
* pause/resume clock, and ends the iteration once `t` reaches the
|
|
2234
|
-
* duration. This is the DRIVER-layer advance — the one meaning of the
|
|
2235
|
-
* absolute-clock step, distinct from the `tickDt(dt)` stepper surface
|
|
2236
|
-
* the rest of the engine canonicalized to.
|
|
2237
|
-
*
|
|
2238
|
-
* SYNC on the steady path (J.W6 S1 — the F.W5 held half, landed): every
|
|
2239
|
-
* post-start frame returns a plain number (no per-frame promise+microtask
|
|
2240
|
-
* hop); a thenable ONLY when the FIRST tick awaits the genuinely-async
|
|
2241
|
-
* delay sleep. Ordering locked by proof:event-ordering.
|
|
2242
|
-
*/
|
|
2243
1796
|
advanceTo(t: number): number | Promise<number>;
|
|
2244
|
-
|
|
2245
|
-
/**
|
|
2246
|
-
* One frame of the standalone rAF play path, driven by the shared
|
|
2247
|
-
* `RAFPlayback.loop`. Returns whether the loop should continue.
|
|
2248
|
-
*/
|
|
1797
|
+
/** One frame of the standalone rAF play path (driven by `RAFPlayback.loop`). */
|
|
2249
1798
|
private _frame;
|
|
2250
|
-
/**
|
|
2251
|
-
*
|
|
2252
|
-
* the
|
|
2253
|
-
* `play()` already constructs (the re-entrant guard returns it; the
|
|
2254
|
-
* `finally`-clear nulls it on settle) — NOT a second completion lifecycle.
|
|
2255
|
-
* Two reads mid-play return the SAME promise. A settled (or never-played)
|
|
2256
|
-
* animation reads `null` and resolves immediately: "not running" = "nothing
|
|
2257
|
-
* to await" — the honest semantics for a getter that reports current
|
|
2258
|
-
* settledness, not a pre-armed future run.
|
|
2259
|
-
*/
|
|
1799
|
+
/** The completion front-door (G.W13) — `await anim.finished` resolves once
|
|
1800
|
+
* the in-flight play settles (a settled/never-played animation resolves
|
|
1801
|
+
* immediately). Reads the ONE held promise off the composed `_playback`. */
|
|
2260
1802
|
get finished(): Promise<void>;
|
|
2261
1803
|
play(): Promise<void>;
|
|
2262
|
-
/**
|
|
2263
|
-
* Pause playback — idempotent. Pausing an already-paused (or
|
|
2264
|
-
* not-yet-started) animation is a no-op, never a resume: a method named
|
|
2265
|
-
* `pause` pauses. Use {@link resume} for the explicit resume.
|
|
2266
|
-
*/
|
|
2267
1804
|
pause(): this;
|
|
2268
1805
|
resume(): this;
|
|
2269
1806
|
/** The explicit flip: pauses if playing, resumes if paused. */
|
|
2270
1807
|
toggle(): this;
|
|
2271
|
-
/**
|
|
2272
|
-
* Halt playback where it stands: cancel the loop AND the WAAPI
|
|
2273
|
-
* compositor animations, settle state, and resolve any pending `play()`
|
|
2274
|
-
* promise. Never paints — `reset()` is the explicit rewind.
|
|
2275
|
-
*/
|
|
2276
1808
|
stop(): void;
|
|
2277
1809
|
playing(): boolean;
|
|
2278
|
-
/** Returns the effective time accounting for direction reversal. */
|
|
2279
1810
|
get effectiveT(): number;
|
|
2280
|
-
/**
|
|
2281
|
-
* Pure state teardown — flags, clocks, iteration. NEVER paints. This is
|
|
2282
|
-
* the terminal half of the rest-position contract: completion paints
|
|
2283
|
-
* the rest frame (via `onEnd` → `paintRest`) and then settles; the
|
|
2284
|
-
* reduced-motion snap paints final and then settles. Settling is
|
|
2285
|
-
* orthogonal to where the pixels rest.
|
|
2286
|
-
*/
|
|
2287
1811
|
settle(): this;
|
|
2288
|
-
/**
|
|
2289
|
-
* Explicit rewind: paint the INITIAL frame, then settle. This is the
|
|
2290
|
-
* user-facing "return to start" — rest position `initial`, painted
|
|
2291
|
-
* deliberately — distinct from `settle()`, which tears down state and
|
|
2292
|
-
* leaves the pixels where they rest.
|
|
2293
|
-
*/
|
|
2294
1812
|
reset(): this;
|
|
2295
1813
|
setTargets(...targets: HTMLElement[]): this;
|
|
2296
|
-
/**
|
|
2297
|
-
* Q.WB1 — the emerging-CSS Phase-2 SECOND resolution pass (the gestalt P.W13
|
|
2298
|
-
* designed: ONE rewriter, a SECOND lifecycle point — element-populated env,
|
|
2299
|
-
* SAME `ResolveContext` shape). Runs over the PRE-FLATTEN
|
|
2300
|
-
* `compiler.templateFrames[i].vars` snapshot (the Phase-1-resolved, unflattened
|
|
2301
|
-
* `Record<string, ValueArray>` `parse()` re-flattens via
|
|
2302
|
-
* `parseAndFlattenObject`), so a Phase-1-resolved leaf — already a concrete
|
|
2303
|
-
* `ValueUnit` — is returned as-is by `resolveNode`, making the pass idempotent
|
|
2304
|
-
* over the Phase-1 result. Gated by `hasPhase2Node`: a declaration with NO
|
|
2305
|
-
* element-aware node is never re-resolved (zero second-pass cost).
|
|
2306
|
-
*
|
|
2307
|
-
* SSR-safe: with no bound target (or a target with no `parentElement`) the env
|
|
2308
|
-
* fields are OMITTED, so a residual node stays unresolved (never a throw on
|
|
2309
|
-
* `getComputedStyle(undefined)`) — the same posture Phase 1 holds for
|
|
2310
|
-
* `style(--p)` today.
|
|
2311
|
-
*
|
|
2312
|
-
* @returns `true` iff at least one template carried a Phase-2 node and the
|
|
2313
|
-
* compiler was re-`parse()`d (so `setTargets` skips its fast propagate).
|
|
2314
|
-
*/
|
|
2315
|
-
private _resolveElementAwareValues;
|
|
2316
|
-
/**
|
|
2317
|
-
* Q.WB1 — build the element-AWARE {@link ResolveEnv} from the bound target (the
|
|
2318
|
-
* precondition for the Phase-2 second pass). SSR-safe: with no target / no
|
|
2319
|
-
* `parentElement`, the relevant field is OMITTED (not assigned), so the residual
|
|
2320
|
-
* node stays unresolved rather than throwing. Built ONCE per `setTargets` — the
|
|
2321
|
-
* pass is a compile-time lowering, never on the hot path.
|
|
2322
|
-
*
|
|
2323
|
-
* @returns the populated env, or `undefined` when no target is bound at all
|
|
2324
|
-
* (the whole pass is skipped — nothing element-aware can resolve).
|
|
2325
|
-
*/
|
|
2326
|
-
private _buildElementAwareEnv;
|
|
2327
1814
|
group(...animations: KeyframesAnimation<V>[]): AnimationGroup<V>;
|
|
2328
1815
|
}
|
|
2329
1816
|
|
|
@@ -2368,23 +1855,17 @@ declare type LayerTransitionSpring = Partial<Omit<SpringProgressOptions, "initia
|
|
|
2368
1855
|
|
|
2369
1856
|
export declare const loadAnimationEngine: () => Promise<AnimationEngine>;
|
|
2370
1857
|
|
|
2371
|
-
export declare const loadCompiler: () => Promise<CompilerSurface>;
|
|
2372
|
-
|
|
2373
|
-
export declare const loadEngine: () => Promise<EngineCore>;
|
|
2374
|
-
|
|
2375
|
-
export declare const loadIngest: () => Promise<IngestSurface>;
|
|
2376
|
-
|
|
2377
1858
|
/** Looping animations — run continuously (`iterationCount: Infinity`). */
|
|
2378
1859
|
declare const loopPresets: {
|
|
2379
|
-
readonly heartbeat: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2380
|
-
readonly glow: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2381
|
-
readonly spinner: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2382
|
-
readonly rainbowText: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2383
|
-
readonly skeletonLoading: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2384
|
-
readonly gradientBackground: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2385
|
-
readonly parallaxScroll: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2386
|
-
readonly hover: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2387
|
-
readonly typingCursor: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
1860
|
+
readonly heartbeat: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1861
|
+
readonly glow: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1862
|
+
readonly spinner: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1863
|
+
readonly rainbowText: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1864
|
+
readonly skeletonLoading: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1865
|
+
readonly gradientBackground: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1866
|
+
readonly parallaxScroll: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1867
|
+
readonly hover: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1868
|
+
readonly typingCursor: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
2388
1869
|
};
|
|
2389
1870
|
|
|
2390
1871
|
export declare class ManualTimeline extends Timeline {
|
|
@@ -2523,16 +2004,6 @@ declare class MotionPath<V extends Record<string, any> = any> {
|
|
|
2523
2004
|
stop(): this;
|
|
2524
2005
|
}
|
|
2525
2006
|
|
|
2526
|
-
/**
|
|
2527
|
-
* A MotionPath spec — the `{ path, ... }` shape that routes to
|
|
2528
|
-
* {@link fromMotionPath} (F.W12 §S2). It carries the author `offset-path`
|
|
2529
|
-
* (`path`) plus the optional `from`/`to`/`rotate` MotionPath knobs; the
|
|
2530
|
-
* animation-options + `autoPlay` ride {@link AnimateOptions} on the third
|
|
2531
|
-
* argument, exactly as every other `animate()` shape. The discriminating field
|
|
2532
|
-
* is `path` — a `string` no keyframe map / vars array carries.
|
|
2533
|
-
*/
|
|
2534
|
-
declare type MotionPathInput = Pick<MotionPathOptions, "path" | "from" | "to" | "rotate">;
|
|
2535
|
-
|
|
2536
2007
|
export declare interface MotionPathOptions extends Partial<InputAnimationOptions> {
|
|
2537
2008
|
/**
|
|
2538
2009
|
* The author `offset-path` (required) — set on the target so the browser
|
|
@@ -2579,11 +2050,11 @@ declare type NativeScrollAttachment = {
|
|
|
2579
2050
|
export declare type NativeTimelineSpec = {
|
|
2580
2051
|
kind: "scroll";
|
|
2581
2052
|
source?: Element | null;
|
|
2582
|
-
axis?:
|
|
2053
|
+
axis?: ScrollTimelineAxis;
|
|
2583
2054
|
} | {
|
|
2584
2055
|
kind: "view";
|
|
2585
2056
|
subject: Element;
|
|
2586
|
-
axis?:
|
|
2057
|
+
axis?: ScrollTimelineAxis;
|
|
2587
2058
|
inset?: string;
|
|
2588
2059
|
};
|
|
2589
2060
|
|
|
@@ -2852,6 +2323,33 @@ declare function pinCSS(opts?: {
|
|
|
2852
2323
|
bottom?: number;
|
|
2853
2324
|
}): string;
|
|
2854
2325
|
|
|
2326
|
+
/**
|
|
2327
|
+
* The standalone-play machine's OWN run-state (R.W2 — replaces the
|
|
2328
|
+
* `PlaybackHost` privacy-inversion interface). `KeyframesAnimation` composes
|
|
2329
|
+
* ONE of these as a `readonly _playback` field, so the play-machine state has a
|
|
2330
|
+
* single owner instead of being scattered as privates the class re-published
|
|
2331
|
+
* through a cast:
|
|
2332
|
+
*
|
|
2333
|
+
* - `resolvePromise` — the standalone-loop deferred resolver (`playRAF`
|
|
2334
|
+
* arms it, `resolvePlay` fires it).
|
|
2335
|
+
* - `_playingPromise` — the held in-flight play promise (`get finished`
|
|
2336
|
+
* exposes it; `play` arms it; the `finally` clears it).
|
|
2337
|
+
* - `_waAnimations` — the live WAAPI compositor animations during a WAAPI
|
|
2338
|
+
* delegation (one per target); cancelled on teardown.
|
|
2339
|
+
* - `_boundFrame` — the frame callback bound ONCE at construction, never
|
|
2340
|
+
* re-bound per loop (the per-loop-closure-free idiom).
|
|
2341
|
+
* - `_interpOut` — the ONE hoisted interp buffer the play loop reuses
|
|
2342
|
+
* every frame (zero-alloc steady state).
|
|
2343
|
+
*/
|
|
2344
|
+
declare class PlaybackState {
|
|
2345
|
+
resolvePromise: ((value: void | PromiseLike<void>) => void) | null;
|
|
2346
|
+
_playingPromise: Promise<void> | null;
|
|
2347
|
+
_waAnimations: globalThis.Animation[];
|
|
2348
|
+
readonly _boundFrame: (t: number) => boolean | Promise<boolean>;
|
|
2349
|
+
readonly _interpOut: Record<string, unknown>;
|
|
2350
|
+
constructor(frameCb: (t: number) => boolean | Promise<boolean>);
|
|
2351
|
+
}
|
|
2352
|
+
|
|
2855
2353
|
/**
|
|
2856
2354
|
* The full preset taxonomy, grouped by intent. Each leaf is one of the
|
|
2857
2355
|
* existing exported factory functions — the taxonomy is a discovery index over
|
|
@@ -2859,44 +2357,44 @@ declare function pinCSS(opts?: {
|
|
|
2859
2357
|
*/
|
|
2860
2358
|
declare const presetTaxonomy: {
|
|
2861
2359
|
readonly enter: {
|
|
2862
|
-
readonly fadeIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2863
|
-
readonly slideIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2864
|
-
readonly slideInLeft: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2865
|
-
readonly slideInRight: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2866
|
-
readonly rotateIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2867
|
-
readonly blurIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2868
|
-
readonly springScaleIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2869
|
-
readonly springSlideIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2870
|
-
readonly jumpUp: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2360
|
+
readonly fadeIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
2361
|
+
readonly slideIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
2362
|
+
readonly slideInLeft: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
2363
|
+
readonly slideInRight: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
2364
|
+
readonly rotateIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
2365
|
+
readonly blurIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
2366
|
+
readonly springScaleIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
2367
|
+
readonly springSlideIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
2368
|
+
readonly jumpUp: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
2871
2369
|
};
|
|
2872
2370
|
readonly exit: {
|
|
2873
|
-
readonly fadeOut: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2874
|
-
readonly slideOutLeft: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2875
|
-
readonly slideOutRight: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2876
|
-
readonly blurOut: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2877
|
-
readonly warpLeft: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2878
|
-
readonly warpRight: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2879
|
-
readonly jumpDown: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2371
|
+
readonly fadeOut: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
2372
|
+
readonly slideOutLeft: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
2373
|
+
readonly slideOutRight: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
2374
|
+
readonly blurOut: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
2375
|
+
readonly warpLeft: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
2376
|
+
readonly warpRight: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
2377
|
+
readonly jumpDown: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
2880
2378
|
};
|
|
2881
2379
|
readonly attention: {
|
|
2882
|
-
readonly pulse: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2883
|
-
readonly shake: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2884
|
-
readonly bounce: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2885
|
-
readonly flip: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2886
|
-
readonly notificationBounce: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2887
|
-
readonly springPop: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2888
|
-
readonly springWobble: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2380
|
+
readonly pulse: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
2381
|
+
readonly shake: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
2382
|
+
readonly bounce: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
2383
|
+
readonly flip: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
2384
|
+
readonly notificationBounce: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
2385
|
+
readonly springPop: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
2386
|
+
readonly springWobble: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
2889
2387
|
};
|
|
2890
2388
|
readonly loop: {
|
|
2891
|
-
readonly heartbeat: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2892
|
-
readonly glow: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2893
|
-
readonly spinner: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2894
|
-
readonly rainbowText: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2895
|
-
readonly skeletonLoading: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2896
|
-
readonly gradientBackground: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2897
|
-
readonly parallaxScroll: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2898
|
-
readonly hover: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2899
|
-
readonly typingCursor: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2389
|
+
readonly heartbeat: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
2390
|
+
readonly glow: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
2391
|
+
readonly spinner: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
2392
|
+
readonly rainbowText: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
2393
|
+
readonly skeletonLoading: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
2394
|
+
readonly gradientBackground: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
2395
|
+
readonly parallaxScroll: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
2396
|
+
readonly hover: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
2397
|
+
readonly typingCursor: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
2900
2398
|
};
|
|
2901
2399
|
};
|
|
2902
2400
|
|
|
@@ -3183,12 +2681,13 @@ export declare interface ResolvedRange {
|
|
|
3183
2681
|
* `"ease-out-cubic"`, … — or a CSS `cubic-bezier()` literal) to a typed
|
|
3184
2682
|
* {@link Easing}.
|
|
3185
2683
|
*
|
|
3186
|
-
* The lookup rides the dynamic
|
|
3187
|
-
* the value.js-bearing
|
|
3188
|
-
*
|
|
2684
|
+
* The lookup rides the dynamic boundary: `import("./compile/easing-registry")`
|
|
2685
|
+
* loads ONLY the value.js-bearing timing-function registry (R.W1 narrow — not the
|
|
2686
|
+
* full engine chunk; lib-support F7) when a named easing is actually used, so a
|
|
2687
|
+
* light-only consumer that never calls this stays value.js-free.
|
|
3189
2688
|
*
|
|
3190
2689
|
* Fail-explicit: an unresolvable name throws {@link UnknownEasingError};
|
|
3191
|
-
*
|
|
2690
|
+
* a chunk-load failure rethrows with the failing easing named —
|
|
3192
2691
|
* never an unhandled rejection, never a silent identity fallback.
|
|
3193
2692
|
*
|
|
3194
2693
|
* ```ts
|
|
@@ -3374,23 +2873,41 @@ export declare interface ScrollSceneOptions {
|
|
|
3374
2873
|
/** A `.on(event, cb)` subscriber. Receives the local progress at the crossing. */
|
|
3375
2874
|
export declare type ScrollSceneSubscriber = (progress: number) => void;
|
|
3376
2875
|
|
|
2876
|
+
/**
|
|
2877
|
+
* orchestration/timeline/native.ts — the platform native-timeline feature-detect
|
|
2878
|
+
* (R.W1; lib-light F-9). Split off the JS sampler family (`./index`) by the
|
|
2879
|
+
* consumer seam: `native.ts` is consumed by `waapi/` (the HEAVY native scroll
|
|
2880
|
+
* bridge) while the JS `Timeline` family is the general caller-polled sampler.
|
|
2881
|
+
* Both stay LIGHT (value.js-free — these are DOM globals + an `in`-detect).
|
|
2882
|
+
*/
|
|
2883
|
+
/**
|
|
2884
|
+
* The scroll/view timeline axis — the `block|inline|x|y` keyword set. A LOCAL
|
|
2885
|
+
* structural alias of the DOM lib's ambient `ScrollAxis` global (R.W4b): it is
|
|
2886
|
+
* byte-identical to `lib.dom.d.ts`'s `type ScrollAxis = "block" | "inline" | "x"
|
|
2887
|
+
* | "y"`, but as a NAMED module export it is FOLLOWABLE by the `./engine` subpath
|
|
2888
|
+
* dts roll-up (API Extractor cannot follow a bare ambient-global reference reached
|
|
2889
|
+
* transitively through `ScrollScene` — it throws "Unable to follow symbol for
|
|
2890
|
+
* ScrollAxis"). value.js-free (a string-literal union — these are DOM keywords).
|
|
2891
|
+
*/
|
|
2892
|
+
declare type ScrollTimelineAxis = "block" | "inline" | "x" | "y";
|
|
2893
|
+
|
|
3377
2894
|
/**
|
|
3378
2895
|
* The master-playhead orchestrator. Positions child animations along one clock
|
|
3379
2896
|
* and drives them via `Animation.advanceTo`. See the module docstring for the
|
|
3380
2897
|
* booked name + subsumption decision.
|
|
3381
2898
|
*/
|
|
3382
|
-
export declare class Sequence<V extends Vars = any> {
|
|
2899
|
+
export declare class Sequence<V extends Vars = any> implements SequencePlayContext<V> {
|
|
3383
2900
|
/** Resolved segments, in insertion order. */
|
|
3384
2901
|
readonly entries: SequenceEntry<V>[];
|
|
3385
2902
|
/** Named positions on the master clock, registered via {@link label}. */
|
|
3386
|
-
|
|
2903
|
+
readonly labels: Map<string, number>;
|
|
3387
2904
|
/**
|
|
3388
2905
|
* The transport-events bus — the per-event subscriber registry + the
|
|
3389
2906
|
* crossing detector (segment-lifecycle + label straddle). `on(...)` forwards
|
|
3390
|
-
* to `
|
|
3391
|
-
* `./
|
|
2907
|
+
* to `events.subscribe`; the transport's `fireSequenceCrossings` to
|
|
2908
|
+
* `events.fire`. See `./events` for the channel + detector body.
|
|
3392
2909
|
*/
|
|
3393
|
-
|
|
2910
|
+
readonly events: SequenceEventBus<V>;
|
|
3394
2911
|
/**
|
|
3395
2912
|
* The running insertion cursor (ms) — the end of the last-inserted
|
|
3396
2913
|
* segment. Relative `"+="`/`"-="` positions and auto-append (`at` omitted)
|
|
@@ -3398,13 +2915,13 @@ export declare class Sequence<V extends Vars = any> {
|
|
|
3398
2915
|
*/
|
|
3399
2916
|
private cursor;
|
|
3400
2917
|
/** Master clock (ms) of the current playhead. */
|
|
3401
|
-
|
|
2918
|
+
_time: number;
|
|
3402
2919
|
private readonly respectReducedMotion;
|
|
3403
2920
|
/** THE rAF owner for the sequence's play loop. */
|
|
3404
2921
|
readonly playback: RAFPlayback;
|
|
3405
2922
|
private _boundFrame;
|
|
3406
|
-
|
|
3407
|
-
|
|
2923
|
+
_resolvePlay: (() => void) | null;
|
|
2924
|
+
_playOrigin: number | undefined;
|
|
3408
2925
|
private _playingPromise;
|
|
3409
2926
|
/**
|
|
3410
2927
|
* The scalar playback rate — the single field that drives `timeScale`
|
|
@@ -3414,21 +2931,21 @@ export declare class Sequence<V extends Vars = any> {
|
|
|
3414
2931
|
* backward (`reverse`). It scales the master clock in {@link _frame}:
|
|
3415
2932
|
* `masterClock = (clock − _playOrigin) * _rate`.
|
|
3416
2933
|
*/
|
|
3417
|
-
|
|
2934
|
+
_rate: number;
|
|
3418
2935
|
/**
|
|
3419
2936
|
* How many master-clock cycles `play()` runs before settling. `1` is the
|
|
3420
2937
|
* existing single-play; `Infinity` never settles (the loop case);
|
|
3421
2938
|
* `n` runs `n` cycles. The master clock folds modulo `duration`
|
|
3422
2939
|
* (see {@link _fold}).
|
|
3423
2940
|
*/
|
|
3424
|
-
|
|
2941
|
+
_repeatCount: number;
|
|
3425
2942
|
/**
|
|
3426
2943
|
* When true, odd cycles reflect the folded phase (`duration − phase`) —
|
|
3427
2944
|
* the GSAP `yoyo` ping-pong. Default off (every cycle runs forward).
|
|
3428
2945
|
*/
|
|
3429
|
-
|
|
2946
|
+
_yoyoOn: boolean;
|
|
3430
2947
|
/** Whether `pause()` has halted the loop with the playhead retained. */
|
|
3431
|
-
|
|
2948
|
+
_paused: boolean;
|
|
3432
2949
|
/**
|
|
3433
2950
|
* The loop's last rAF timestamp — the re-anchor reference. The
|
|
3434
2951
|
* `RAFPlayback`/`AnimationGroup` managed-pause records the loop's LAST rAF
|
|
@@ -3436,7 +2953,7 @@ export declare class Sequence<V extends Vars = any> {
|
|
|
3436
2953
|
* the SAME clock the loop reads, with no forward jump. `Sequence` records
|
|
3437
2954
|
* it here per frame (the driver does not expose it) for that one re-anchor.
|
|
3438
2955
|
*/
|
|
3439
|
-
|
|
2956
|
+
_lastClock: number | undefined;
|
|
3440
2957
|
constructor(options?: SequenceOptions);
|
|
3441
2958
|
/** The full span of the sequence (ms): the latest segment end. */
|
|
3442
2959
|
get duration(): number;
|
|
@@ -3480,16 +2997,6 @@ export declare class Sequence<V extends Vars = any> {
|
|
|
3480
2997
|
* Chainable.
|
|
3481
2998
|
*/
|
|
3482
2999
|
add(animation: KeyframesAnimation<V>, at?: SequencePosition): this;
|
|
3483
|
-
/**
|
|
3484
|
-
* Resolve a {@link SequencePosition} to an absolute ms offset.
|
|
3485
|
-
*
|
|
3486
|
-
* - omitted → the running cursor (auto-append after the previous segment).
|
|
3487
|
-
* - `number` → itself.
|
|
3488
|
-
* - `"+=n"` / `"-=n"` → cursor ± n.
|
|
3489
|
-
* - any other string → the registered label (throws if unknown — labels
|
|
3490
|
-
* are an explicit contract, a typo is a bug, not a silent 0).
|
|
3491
|
-
*/
|
|
3492
|
-
private resolvePosition;
|
|
3493
3000
|
/**
|
|
3494
3001
|
* Map the master playhead to each child's LOCAL clock and paint it. This is
|
|
3495
3002
|
* the synchronous scrub form: for every segment, the local clock is
|
|
@@ -3499,40 +3006,6 @@ export declare class Sequence<V extends Vars = any> {
|
|
|
3499
3006
|
* Chainable.
|
|
3500
3007
|
*/
|
|
3501
3008
|
seek(masterClock: number): this;
|
|
3502
|
-
/**
|
|
3503
|
-
* THE master-playhead → child-clock map, applied as a pure synchronous
|
|
3504
|
-
* scrub. For every segment the local clock is `clamp(masterClock − at, 0,
|
|
3505
|
-
* duration)`, painted via `interpFrames(local, true)`. This is the ONE map
|
|
3506
|
-
* both `seek` (the public scrub) and `_frame` (the rAF play loop) drive —
|
|
3507
|
-
* so play is pixel-identical to seek BY CONSTRUCTION, forward AND reverse
|
|
3508
|
-
* (the C⁰-continuity the F.W9 parity gate locks). It carries no `onEnd`/
|
|
3509
|
-
* `startTime` machinery, so re-entering a finished segment under a negative
|
|
3510
|
-
* `rate` paints the same final-frame value `seek` would — there is no
|
|
3511
|
-
* forward-monotone re-anchor window to break (F.W9 §S3 MEASURE-FIRST).
|
|
3512
|
-
*/
|
|
3513
|
-
private _applyAt;
|
|
3514
|
-
/**
|
|
3515
|
-
* Detect and fire segment-lifecycle + label crossings between the previous
|
|
3516
|
-
* painted phase and `phase` — the ONE detector both `seek` (scrub) and
|
|
3517
|
-
* `_frame` (the rAF play loop) drive, so play fires the identical crossings a
|
|
3518
|
-
* scrub would. The detector + the per-event subscriber state live on the
|
|
3519
|
-
* `_events` bus (`./sequence-events`); this thin wrapper threads the segments
|
|
3520
|
-
* and labels the bus reads. The bus updates its own `_prevPhase` on EVERY
|
|
3521
|
-
* call (even the early-exit) so a subscriber registered mid-transport
|
|
3522
|
-
* straddles from the true prior playhead.
|
|
3523
|
-
*/
|
|
3524
|
-
private _fireCrossings;
|
|
3525
|
-
/**
|
|
3526
|
-
* Fold a raw, repeat-extended master clock down to an effective phase in
|
|
3527
|
-
* `[0, duration]` per the `repeat`/`yoyo` transport. With `repeat(1)` +
|
|
3528
|
-
* `yoyo(false)` (the defaults) this is the identity on `[0, duration]`
|
|
3529
|
-
* (the existing single-play). For `repeat`, the phase is `raw mod
|
|
3530
|
-
* duration`; for `yoyo`, odd cycles reflect (`duration − phase`) so the
|
|
3531
|
-
* playhead ping-pongs. The terminal clock of the LAST cycle resolves to
|
|
3532
|
-
* the rest phase (`duration` forward, `0` reflected) rather than wrapping
|
|
3533
|
-
* to `0` — so a settled `repeat`/`yoyo` run lands on its true end frame.
|
|
3534
|
-
*/
|
|
3535
|
-
private _fold;
|
|
3536
3009
|
/**
|
|
3537
3010
|
* Set targets on every child segment. Convenience for the common case
|
|
3538
3011
|
* where one target receives the whole sequence; per-segment targets can be
|
|
@@ -3560,32 +3033,8 @@ export declare class Sequence<V extends Vars = any> {
|
|
|
3560
3033
|
*/
|
|
3561
3034
|
get finished(): Promise<void>;
|
|
3562
3035
|
play(): Promise<void>;
|
|
3563
|
-
|
|
3564
|
-
/**
|
|
3565
|
-
* True for the byte-stable default transport — forward real-time, single
|
|
3566
|
-
* cycle, no yoyo. The event-dispatch path runs ONLY here, so an existing
|
|
3567
|
-
* caller's `play()` fires the same `animationstart`/`animationend` it
|
|
3568
|
-
* always did; any transport modifier opts into the scrub-paint authority.
|
|
3569
|
-
*/
|
|
3570
|
-
private _isForwardMonotone;
|
|
3571
|
-
/**
|
|
3572
|
-
* The terminal rest phase of a `repeat`/`yoyo` run — where the playhead
|
|
3573
|
-
* lands when the final cycle closes. A forward run rests at `duration`;
|
|
3574
|
-
* an odd-cycle yoyo run that closes reflected rests at `0`. Mirrors the
|
|
3575
|
-
* boundary `_fold` resolves at the terminal clock.
|
|
3576
|
-
*/
|
|
3577
|
-
private _restPhase;
|
|
3578
|
-
/**
|
|
3579
|
-
* Re-anchor `_playOrigin` against the loop's last rAF timestamp so the
|
|
3580
|
-
* master clock is CONTINUOUS across a transport edit — the
|
|
3581
|
-
* `RAFPlayback`/`AnimationGroup` managed-pause re-anchor (no forward jump).
|
|
3582
|
-
* The invariant restored: `(clock − _playOrigin) * rate === _time` at the
|
|
3583
|
-
* edit instant. Solving for the origin: `_playOrigin = clock − _time /
|
|
3584
|
-
* rate`. With `rate = 0` the playhead is frozen, so the origin collapses
|
|
3585
|
-
* to the bare timestamp (the next non-zero rate re-anchors again).
|
|
3586
|
-
*/
|
|
3036
|
+
_frame(clock: number): Promise<boolean>;
|
|
3587
3037
|
private _reanchor;
|
|
3588
|
-
/** Release every child back to standalone ownership and clear play flags. */
|
|
3589
3038
|
private _settle;
|
|
3590
3039
|
/** Halt the play loop where it stands and resolve any pending `play()`. */
|
|
3591
3040
|
stop(): this;
|
|
@@ -3662,6 +3111,58 @@ export declare interface SequenceEntry<V extends Vars> {
|
|
|
3662
3111
|
*/
|
|
3663
3112
|
export declare type SequenceEvent = "segment:enter" | "segment:leave" | "label";
|
|
3664
3113
|
|
|
3114
|
+
/**
|
|
3115
|
+
* The Sequence transport-events BUS — the per-event subscriber registry + the
|
|
3116
|
+
* crossing DETECTOR, owned beside `Sequence` (`sequence.ts`). `Sequence`
|
|
3117
|
+
* constructs ONE bus and forwards `.on(...)` to {@link subscribe} and every
|
|
3118
|
+
* paint to {@link fire}; the three event fields (`subscribers`,
|
|
3119
|
+
* `_activeSegments`, `_prevPhase`) live here, not on the class.
|
|
3120
|
+
*/
|
|
3121
|
+
declare class SequenceEventBus<V extends Vars> {
|
|
3122
|
+
/**
|
|
3123
|
+
* The per-event subscriber sets — the {@link subscribe} channel (three Sets
|
|
3124
|
+
* keyed by {@link SequenceEvent}). Empty by construction; {@link fire}
|
|
3125
|
+
* early-exits while all three stay empty (zero overhead for the common
|
|
3126
|
+
* no-subscriber transport). Mirror of `ScrollScene.subscribers`
|
|
3127
|
+
* (`scroll-scene.ts:360-366`).
|
|
3128
|
+
*/
|
|
3129
|
+
private readonly subscribers;
|
|
3130
|
+
/**
|
|
3131
|
+
* The `segment:enter`/`segment:leave` edge memory: the segments whose
|
|
3132
|
+
* `[at, at + duration)` span held the PREVIOUS painted phase. A segment in
|
|
3133
|
+
* the current active set but not here ENTERED; one here but not in the
|
|
3134
|
+
* current set LEFT. Maintained only while a segment subscriber is registered
|
|
3135
|
+
* (the detector early-exits otherwise).
|
|
3136
|
+
*/
|
|
3137
|
+
private readonly _activeSegments;
|
|
3138
|
+
/**
|
|
3139
|
+
* The previous painted phase (ms) — the `from` end of every crossing
|
|
3140
|
+
* straddle (`label`, and the directional `segment` edges). `undefined`
|
|
3141
|
+
* before the first paint; updated on EVERY {@link fire} so a subscriber
|
|
3142
|
+
* registered mid-transport straddles from the true prior playhead (not a
|
|
3143
|
+
* stale or zeroed origin).
|
|
3144
|
+
*/
|
|
3145
|
+
private _prevPhase;
|
|
3146
|
+
/**
|
|
3147
|
+
* Register a subscriber for `event`; returns an unsubscribe handle — the
|
|
3148
|
+
* `ScrollScene.on` idiom (`scroll-scene.ts:506-514`). The class's overloaded
|
|
3149
|
+
* `on(...)` forwards here.
|
|
3150
|
+
*/
|
|
3151
|
+
subscribe(event: SequenceEvent, cb: SequenceSubscriber): () => void;
|
|
3152
|
+
/**
|
|
3153
|
+
* Detect and fire segment-lifecycle + label crossings between the previous
|
|
3154
|
+
* painted phase (`_prevPhase`) and `phase` — the ONE detector both `seek`
|
|
3155
|
+
* (scrub) and `_frame` (the rAF play loop) drive, so play fires the identical
|
|
3156
|
+
* crossings a scrub would. Mirror of `ScrollScene.fire` (`scroll-scene.ts:513`).
|
|
3157
|
+
*
|
|
3158
|
+
* `_prevPhase` is updated on EVERY call (even the early-exit) so a subscriber
|
|
3159
|
+
* registered mid-transport straddles from the true prior playhead. The firing
|
|
3160
|
+
* loops run ONLY while at least one subscriber set is non-empty — the
|
|
3161
|
+
* zero-overhead path for the common no-subscriber transport.
|
|
3162
|
+
*/
|
|
3163
|
+
fire(entries: readonly SequenceEntry<V>[], labels: ReadonlyMap<string, number>, phase: number): void;
|
|
3164
|
+
}
|
|
3165
|
+
|
|
3665
3166
|
/**
|
|
3666
3167
|
* A `label` subscriber. Receives the crossed label's `name` and the
|
|
3667
3168
|
* master-clock position (ms) at the crossing.
|
|
@@ -3678,6 +3179,28 @@ export declare interface SequenceOptions {
|
|
|
3678
3179
|
respectReducedMotion?: boolean;
|
|
3679
3180
|
}
|
|
3680
3181
|
|
|
3182
|
+
/**
|
|
3183
|
+
* The play-machine view the rAF-loop driver reads + writes. `Sequence` IS this
|
|
3184
|
+
* shape (its fields), so the loop body lives here without copying state — the
|
|
3185
|
+
* class's `_frame`/`_settle` are thin delegates that pass `this`. Keeping the
|
|
3186
|
+
* fields on `Sequence` preserves the seek↔play parity test's direct reaches
|
|
3187
|
+
* (`seq._time` / `seq._rate` / `seq._frame(...)`); only the loop BODY moved.
|
|
3188
|
+
*/
|
|
3189
|
+
declare interface SequencePlayContext<V extends Vars> {
|
|
3190
|
+
readonly entries: SequenceEntry<V>[];
|
|
3191
|
+
readonly labels: ReadonlyMap<string, number>;
|
|
3192
|
+
readonly events: SequenceEventBus<V>;
|
|
3193
|
+
readonly duration: number;
|
|
3194
|
+
_time: number;
|
|
3195
|
+
_rate: number;
|
|
3196
|
+
_repeatCount: number;
|
|
3197
|
+
_yoyoOn: boolean;
|
|
3198
|
+
_paused: boolean;
|
|
3199
|
+
_playOrigin: number | undefined;
|
|
3200
|
+
_lastClock: number | undefined;
|
|
3201
|
+
_resolvePlay: (() => void) | null;
|
|
3202
|
+
}
|
|
3203
|
+
|
|
3681
3204
|
/**
|
|
3682
3205
|
* A position on the master clock for a sequence entry.
|
|
3683
3206
|
*
|
|
@@ -3685,7 +3208,7 @@ export declare interface SequenceOptions {
|
|
|
3685
3208
|
* - `` `+=${n}` `` / `` `-=${n}` `` — relative to the running insertion cursor
|
|
3686
3209
|
* (the end of the previously-inserted segment): `"+=200"` starts 200ms after
|
|
3687
3210
|
* the cursor, `"-=200"` overlaps the previous segment by 200ms.
|
|
3688
|
-
* - any other string — a label registered via
|
|
3211
|
+
* - any other string — a label registered via `Sequence.label`.
|
|
3689
3212
|
*/
|
|
3690
3213
|
export declare type SequencePosition = number | `+=${number}` | `-=${number}` | string;
|
|
3691
3214
|
|
|
@@ -3728,12 +3251,8 @@ declare const slideIn: (options?: InputAnimationOptions) => CSSKeyframesAnimatio
|
|
|
3728
3251
|
|
|
3729
3252
|
declare const slideInLeft: (options?: InputAnimationOptions) => CSSKeyframesAnimation< Vars>;
|
|
3730
3253
|
|
|
3731
|
-
declare const slideInLeftKeyframes = "\n0% {\n transform: translateX(-100%);\n opacity: 0;\n}\n100% {\n transform: translateX(0);\n opacity: 1;\n}\n";
|
|
3732
|
-
|
|
3733
3254
|
declare const slideInRight: (options?: InputAnimationOptions) => CSSKeyframesAnimation< Vars>;
|
|
3734
3255
|
|
|
3735
|
-
declare const slideInRightKeyframes = "\n0% {\n transform: translateX(100%);\n opacity: 0;\n}\n100% {\n transform: translateX(0);\n opacity: 1;\n}\n";
|
|
3736
|
-
|
|
3737
3256
|
declare const slideOutLeft: (options?: InputAnimationOptions) => CSSKeyframesAnimation< Vars>;
|
|
3738
3257
|
|
|
3739
3258
|
declare const slideOutRight: (options?: InputAnimationOptions) => CSSKeyframesAnimation< Vars>;
|
|
@@ -3828,6 +3347,46 @@ export declare interface SmoothProgressOptions {
|
|
|
3828
3347
|
/** A `.snap()` snap point — a local progress in [0,1] the scene settles to. */
|
|
3829
3348
|
export declare type SnapPoints = readonly number[];
|
|
3830
3349
|
|
|
3350
|
+
/**
|
|
3351
|
+
* P.W2 — the precomputed SoA fold layout for ONE `add`/`weighted` blend layer.
|
|
3352
|
+
* `carriers[s]`/`incomings[s]` are the stable `ValueUnit<number>` refs the boxed
|
|
3353
|
+
* inner loop would have touched at slot `s` (the carrier is the leaf a lower
|
|
3354
|
+
* layer parked in `_grouped`; the incoming is this layer's `entry.values` leaf —
|
|
3355
|
+
* both alias `frame.flatVars` units whose `.value` `interpFrames` mutates in
|
|
3356
|
+
* place, so the refs are frame-stable). The per-frame fold seeds the composite
|
|
3357
|
+
* buffer from each carrier, applies the layer's op (`+=` for `add`, `lerp(...,w)`
|
|
3358
|
+
* for `weighted`) against the incoming, and writes back — replacing the
|
|
3359
|
+
* per-frame `for..in` + `Array.isArray` + per-element `isNumericUnit` dispatch
|
|
3360
|
+
* with a contiguous numeric loop. The `entry` is carried for the `weighted`
|
|
3361
|
+
* arm's per-LAYER `w = layer.weightSpring?.value ?? layer.weight` read (K.W11
|
|
3362
|
+
* PHYS-C).
|
|
3363
|
+
*/
|
|
3364
|
+
declare interface SoALayerPlan {
|
|
3365
|
+
/**
|
|
3366
|
+
* The layer config — the `weighted` fold re-reads its per-frame `w =
|
|
3367
|
+
* weightSpring?.value ?? weight` LIVE (K.W11 PHYS-C, so a spring still drives
|
|
3368
|
+
* the blend), and the config is generic-independent so the plan holds it
|
|
3369
|
+
* without binding the group's `V`.
|
|
3370
|
+
*/
|
|
3371
|
+
layer: AnimationLayerConfig;
|
|
3372
|
+
weighted: boolean;
|
|
3373
|
+
/** The pure-numeric carrier units the fold seeds the composite buffer from + writes back to. */
|
|
3374
|
+
carriers: ValueUnit<number>[];
|
|
3375
|
+
/** The incoming numeric units folded against each carrier (parallel to `carriers`). */
|
|
3376
|
+
incomings: ValueUnit<number>[];
|
|
3377
|
+
/**
|
|
3378
|
+
* The keys this layer touches that the SoA fold does NOT cover — a non-array
|
|
3379
|
+
* carrier (first-touch of a key, or a scalar that a lower layer left
|
|
3380
|
+
* `undefined`), or a leaf with ANY non-numeric / mixed element. These keep
|
|
3381
|
+
* the boxed per-element path (the `Array.isArray` guard + the
|
|
3382
|
+
* `Math.min(existing.length, incoming.length)` element loop), so the
|
|
3383
|
+
* `add`/`weighted` blend stays byte-identical on the non-numeric tail. EMPTY
|
|
3384
|
+
* for the dominant all-numeric transform shape (every leaf a numeric
|
|
3385
|
+
* `ValueUnit[]`), so the whole `for..in` collapses to the SoA fold.
|
|
3386
|
+
*/
|
|
3387
|
+
boxedKeys: string[];
|
|
3388
|
+
}
|
|
3389
|
+
|
|
3831
3390
|
declare const spinner: (options?: InputAnimationOptions) => CSSKeyframesAnimation< Vars>;
|
|
3832
3391
|
|
|
3833
3392
|
/**
|
|
@@ -3845,7 +3404,7 @@ declare const spinner: (options?: InputAnimationOptions) => CSSKeyframesAnimatio
|
|
|
3845
3404
|
* (`initial`, `initialVelocity`, thresholds, `respectReducedMotion`)
|
|
3846
3405
|
* carry through unchanged.
|
|
3847
3406
|
*/
|
|
3848
|
-
declare interface SpringDurationOptions extends Partial<Pick<SpringProgressOptions, "initial" | "initialVelocity" | "settleThreshold" | "velocitySettleThreshold" | "respectReducedMotion">> {
|
|
3407
|
+
export declare interface SpringDurationOptions extends Partial<Pick<SpringProgressOptions, "initial" | "initialVelocity" | "settleThreshold" | "velocitySettleThreshold" | "respectReducedMotion">> {
|
|
3849
3408
|
/**
|
|
3850
3409
|
* The perceptual settle duration in seconds — mapped directly onto
|
|
3851
3410
|
* `response`. The designer-facing name for the same quantity.
|
|
@@ -3962,12 +3521,7 @@ export declare class SpringProgress {
|
|
|
3962
3521
|
private omegaD;
|
|
3963
3522
|
private subscribers;
|
|
3964
3523
|
private disposed;
|
|
3965
|
-
private
|
|
3966
|
-
private vecOriginVel;
|
|
3967
|
-
private vecTarget;
|
|
3968
|
-
private vecCurrent;
|
|
3969
|
-
private vecVelocity;
|
|
3970
|
-
private vecElapsed;
|
|
3524
|
+
private vectorLanes;
|
|
3971
3525
|
private _playback;
|
|
3972
3526
|
private _onFrame;
|
|
3973
3527
|
constructor(options?: Partial<SpringProgressOptions>);
|
|
@@ -4068,11 +3622,12 @@ export declare class SpringProgress {
|
|
|
4068
3622
|
get velocities(): Float64Array;
|
|
4069
3623
|
/**
|
|
4070
3624
|
* Advance EVERY lane by `dt` MILLISECONDS — one call, K channels, one buffer
|
|
4071
|
-
* write
|
|
4072
|
-
*
|
|
4073
|
-
* (`exp`/`cos`/`sin`)
|
|
4074
|
-
* amortization the W122 probe measured. No-op
|
|
4075
|
-
* before the first {@link setTargets}, when
|
|
3625
|
+
* write, delegated to the SoA {@link SpringVectorLanes} under this spring's
|
|
3626
|
+
* `(omega, zeta, omegaD)`. The analytic per-channel step is the same closed
|
|
3627
|
+
* form `evaluateAt` uses, with the transcendentals (`exp`/`cos`/`sin`)
|
|
3628
|
+
* hoisted once per tick — the amortization the W122 probe measured. No-op
|
|
3629
|
+
* (returns the same buffer) before the first {@link setTargets}, when
|
|
3630
|
+
* disposed, or for `dt <= 0`.
|
|
4076
3631
|
*/
|
|
4077
3632
|
tickVector(dt: number): Float64Array;
|
|
4078
3633
|
/**
|
|
@@ -4532,34 +4087,12 @@ declare type WAAPIEligibility = {
|
|
|
4532
4087
|
};
|
|
4533
4088
|
|
|
4534
4089
|
/**
|
|
4535
|
-
* Fire-and-forget idle-warmer for the heavy engine
|
|
4536
|
-
*
|
|
4537
|
-
*
|
|
4538
|
-
*
|
|
4539
|
-
*
|
|
4540
|
-
*
|
|
4541
|
-
* `requestIdleCallback`, `visibilitychange`, or `mouseenter` on the app shell:
|
|
4542
|
-
*
|
|
4543
|
-
* ```ts
|
|
4544
|
-
* requestIdleCallback(() => warmEngine());
|
|
4545
|
-
* ```
|
|
4546
|
-
*
|
|
4547
|
-
* Idempotent and value.js-free by construction: it shares the SAME
|
|
4548
|
-
* module-scope `_enginePromise` with `loadAnimationEngine()`, so a
|
|
4549
|
-
* `loadAnimationEngine()` after `warmEngine()` returns the same in-flight
|
|
4550
|
-
* Promise — no double import. It fires a DYNAMIC import only; it names no
|
|
4551
|
-
* static value.js specifier, so `proof:boundary` stays green.
|
|
4552
|
-
*
|
|
4553
|
-
* L.W7 S4 (MEASURE-FIRST — the `scheduler.postTask` adoption is DEFERRED, not
|
|
4554
|
-
* shipped). `scheduler.postTask("background", …)` would be the idiomatic home
|
|
4555
|
-
* for an idle warm, but the `proof:scheduler-posttask` probe only SKIPS in
|
|
4556
|
-
* jsdom (the API is absent there) — it has NOT positively MEASURED that the
|
|
4557
|
-
* `"background"` call does not degrade INP on a real engine. Per the wave's own
|
|
4558
|
-
* measure-first law (and inv ε — no claim without an observed oracle), warmEngine
|
|
4559
|
-
* stays on the PROVEN bare `void loadAnimationEngine()` path. The probe + gate are
|
|
4560
|
-
* ARMED: when a real-browser run (Playwright with `scheduler.postTask`) measures
|
|
4561
|
-
* the background dispatch safe, warmEngine adopts `postTask("background")` then —
|
|
4562
|
-
* a gated future change, not an unmeasured ship today.
|
|
4090
|
+
* Fire-and-forget idle-warmer for the heavy engine. Pre-flights
|
|
4091
|
+
* `loadAnimationEngine()`'s dynamic import during idle (`requestIdleCallback` /
|
|
4092
|
+
* `visibilitychange` / `mouseenter`) so the first `new CSSKeyframesAnimation()`
|
|
4093
|
+
* on a cold page resolves against an already-in-flight Promise. Idempotent and
|
|
4094
|
+
* value.js-free — it shares the one memoized `_enginePromise` (no double import)
|
|
4095
|
+
* and names only a dynamic import (`proof:boundary` stays green).
|
|
4563
4096
|
*/
|
|
4564
4097
|
export declare const warmEngine: () => void;
|
|
4565
4098
|
|