@mkbabb/keyframes.js 6.2.0 → 6.2.2
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 +3 -1
- package/dist/engine/index.d.ts +17 -7
- package/dist/engine/index.js +764 -771
- package/dist/keyframes.d.ts +17 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -66,7 +66,7 @@ The `KeyframesAnimation` object drives `CSSKeyframesAnimation` and `AnimationGro
|
|
|
66
66
|
### `AnimationOptions`
|
|
67
67
|
|
|
68
68
|
- `duration`: time in milliseconds (default: 1000)
|
|
69
|
-
- `delay`: time in milliseconds before the animation begins (default: 0)
|
|
69
|
+
- `delay`: time in milliseconds before the animation begins (default: 0) — a phase on the driving clock, taken once per play. Until it elapses the animation is in its before-phase and `fillMode` decides what it paints (`backwards`/`both`: the 0% frame; otherwise nothing); `animationstart` fires when it ends. In an `AnimationGroup` each child's delay offsets it on the group's one clock, so `stagger` delays fed to the children stagger them
|
|
70
70
|
- `iterationCount`: number of repetitions (default: 1)
|
|
71
71
|
- `direction`: `normal`, `reverse`, `alternate`, `alternate-reverse`
|
|
72
72
|
- `fillMode`: `none`, `forwards`, `backwards`, `both`
|
|
@@ -247,6 +247,8 @@ anim.fromVars([{ opacity: 0 }, { opacity: 1 }]);
|
|
|
247
247
|
|
|
248
248
|
The default transform applies interpolated values to `element.style` for each target.
|
|
249
249
|
|
|
250
|
+
Each of the three is an ingest, and an ingest **replaces** the animation's frames: a second `fromString` (or `fromKeyframes`, or `fromVars`) on the same instance yields that call's frames alone, never a union with the last ones. `addFrame` is the incremental append.
|
|
251
|
+
|
|
250
252
|
### Parsing CSS keyframes
|
|
251
253
|
|
|
252
254
|
`keyframes.ts` covers most of the CSS spec:
|
package/dist/engine/index.d.ts
CHANGED
|
@@ -249,9 +249,9 @@ export declare class AnimationGroup<V extends Vars> {
|
|
|
249
249
|
/** The master elapsed time a child's current position sits at (its delay +
|
|
250
250
|
* its completed iterations + its `t`) — the read `seek` inverts. */
|
|
251
251
|
elapsedOf(nameOrAnim: string | KeyframesAnimation<V>): number;
|
|
252
|
-
/** Advance all child animations to absolute clock `t`. SYNC
|
|
253
|
-
*
|
|
254
|
-
*
|
|
252
|
+
/** Advance all child animations to absolute clock `t`. SYNC (J.W6 S1; 6.2.1:
|
|
253
|
+
* a child's delay is a phase on `t`, never a sleep): a thenable only on the
|
|
254
|
+
* over-`YIELD_BATCH` yield path. */
|
|
255
255
|
advanceTo(t: number): this | Promise<this>;
|
|
256
256
|
/** The completion front-door (G.W13) — `await group.finished` resolves once
|
|
257
257
|
* the in-flight composite play settles. Exposes the ONE held `_playingPromise`
|
|
@@ -666,7 +666,14 @@ export declare class CSSKeyframesAnimation<V extends Vars> extends KeyframesAnim
|
|
|
666
666
|
*/
|
|
667
667
|
bindTimeline(timeline: Timeline): this;
|
|
668
668
|
/**
|
|
669
|
-
*
|
|
669
|
+
* The one ingest head for the three `from*` entry points. An ingest
|
|
670
|
+
* REPLACES the animation's source (COHESION §0j.C KF-W5R4(1), G-FROMSTRING):
|
|
671
|
+
* the template set is reset here, so a second `fromString` / `fromKeyframes`
|
|
672
|
+
* / `fromVars` yields the parsed set alone, never a union with the last one.
|
|
673
|
+
* `addFrame` stays the incremental append. The setter re-marks the compiled
|
|
674
|
+
* set stale; `parse()` at the end of each entry recompiles it.
|
|
675
|
+
*
|
|
676
|
+
* It is also the one transform-resolution seam:
|
|
670
677
|
* a supplied transform is the consumer's renderer (vars arrive
|
|
671
678
|
* unflattened); genuine omission resolves to the instance's ONE
|
|
672
679
|
* default DOM-style renderer, which keeps WAAPI eligibility a
|
|
@@ -682,7 +689,7 @@ export declare class CSSKeyframesAnimation<V extends Vars> extends KeyframesAnim
|
|
|
682
689
|
* renderer with a foreign instance's default, and every frame then
|
|
683
690
|
* answered `usesDefaultRenderer` FALSE for a renderer nobody supplied.
|
|
684
691
|
*/
|
|
685
|
-
private
|
|
692
|
+
private beginIngest;
|
|
686
693
|
fromVars(vars: V[], transform?: TransformFunction<V>): this;
|
|
687
694
|
fromKeyframes(keyframes: Map<string, Partial<V>> | Record<string, Partial<V>>, transform?: TransformFunction<V>): this;
|
|
688
695
|
/**
|
|
@@ -1315,9 +1322,9 @@ export declare class KeyframesAnimation<V extends Vars = Vars> {
|
|
|
1315
1322
|
* allocation-free.
|
|
1316
1323
|
*/
|
|
1317
1324
|
interpFrames(t: number, transformFrames?: boolean, out?: FlatAuthoredValues): FlatAuthoredValues;
|
|
1318
|
-
onStart():
|
|
1325
|
+
onStart(): void;
|
|
1319
1326
|
onEnd(): void;
|
|
1320
|
-
advanceTo(t: number): number
|
|
1327
|
+
advanceTo(t: number): number;
|
|
1321
1328
|
/** One frame of the standalone rAF play path (driven by `RAFPlayback.loop`). */
|
|
1322
1329
|
private _frame;
|
|
1323
1330
|
/** The completion front-door (G.W13) — `await anim.finished` resolves once
|
|
@@ -1612,6 +1619,9 @@ declare class PlaybackState {
|
|
|
1612
1619
|
* next rAF tick re-anchors the play to the first presented frame
|
|
1613
1620
|
* (`presentAnchor`). Any external `startTime` write clears it. */
|
|
1614
1621
|
anchorTick: number | undefined;
|
|
1622
|
+
/** True from a delayed play's anchor until its clock reaches it: the CSS
|
|
1623
|
+
* before-phase, whose end opens the active phase (`animationstart`). */
|
|
1624
|
+
startOwed: boolean;
|
|
1615
1625
|
pausedTime: number;
|
|
1616
1626
|
t: number;
|
|
1617
1627
|
iteration: number;
|