@mkbabb/keyframes.js 6.2.1 → 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 CHANGED
@@ -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:
@@ -666,7 +666,14 @@ export declare class CSSKeyframesAnimation<V extends Vars> extends KeyframesAnim
666
666
  */
667
667
  bindTimeline(timeline: Timeline): this;
668
668
  /**
669
- * One transform-resolution seam for the three `from*` entry points:
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 resolveTransform;
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
  /**
@@ -2120,11 +2120,11 @@ var pi = (e) => typeof e != "object" || !e ? !1 : typeof e.clone == "function",
2120
2120
  }, t = !0);
2121
2121
  return t && this.frames.length > 0 && this.parse(), this;
2122
2122
  }
2123
- resolveTransform(e) {
2124
- return this.unflatten = e != null, e ?? this._defaultTransform;
2123
+ beginIngest(e) {
2124
+ return this.templateFrames = [], this.unflatten = e != null, e ?? this._defaultTransform;
2125
2125
  }
2126
2126
  fromVars(e, t) {
2127
- t = this.resolveTransform(t);
2127
+ t = this.beginIngest(t);
2128
2128
  for (let n = 0; n < e.length; n++) {
2129
2129
  let r = e[n], i = Math.round(n / (e.length - 1) * 100);
2130
2130
  this.addFrame(i, r, t);
@@ -2132,7 +2132,7 @@ var pi = (e) => typeof e != "object" || !e ? !1 : typeof e.clone == "function",
2132
2132
  return this.parse(), this;
2133
2133
  }
2134
2134
  fromKeyframes(e, t) {
2135
- t = this.resolveTransform(t);
2135
+ t = this.beginIngest(t);
2136
2136
  let n = e instanceof Map ? e : Object.entries(e);
2137
2137
  for (let [e, r] of n) this.addFrame(e, r, t);
2138
2138
  return this.parse(), this;
@@ -2140,7 +2140,7 @@ var pi = (e) => typeof e != "object" || !e ? !1 : typeof e.clone == "function",
2140
2140
  propertyRegistry = /* @__PURE__ */ new Map();
2141
2141
  scrollOptions;
2142
2142
  fromString(e, n) {
2143
- n = this.resolveTransform(n);
2143
+ n = this.beginIngest(n);
2144
2144
  let r = ci(e);
2145
2145
  this.propertyRegistry = r.properties;
2146
2146
  let i = di(r.stylesheet);
@@ -839,7 +839,14 @@ export declare class CSSKeyframesAnimation<V extends Vars> extends KeyframesAnim
839
839
  */
840
840
  bindTimeline(timeline: Timeline): this;
841
841
  /**
842
- * One transform-resolution seam for the three `from*` entry points:
842
+ * The one ingest head for the three `from*` entry points. An ingest
843
+ * REPLACES the animation's source (COHESION §0j.C KF-W5R4(1), G-FROMSTRING):
844
+ * the template set is reset here, so a second `fromString` / `fromKeyframes`
845
+ * / `fromVars` yields the parsed set alone, never a union with the last one.
846
+ * `addFrame` stays the incremental append. The setter re-marks the compiled
847
+ * set stale; `parse()` at the end of each entry recompiles it.
848
+ *
849
+ * It is also the one transform-resolution seam:
843
850
  * a supplied transform is the consumer's renderer (vars arrive
844
851
  * unflattened); genuine omission resolves to the instance's ONE
845
852
  * default DOM-style renderer, which keeps WAAPI eligibility a
@@ -855,7 +862,7 @@ export declare class CSSKeyframesAnimation<V extends Vars> extends KeyframesAnim
855
862
  * renderer with a foreign instance's default, and every frame then
856
863
  * answered `usesDefaultRenderer` FALSE for a renderer nobody supplied.
857
864
  */
858
- private resolveTransform;
865
+ private beginIngest;
859
866
  fromVars(vars: V[], transform?: TransformFunction<V>): this;
860
867
  fromKeyframes(keyframes: Map<string, Partial<V>> | Record<string, Partial<V>>, transform?: TransformFunction<V>): this;
861
868
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mkbabb/keyframes.js",
3
- "version": "6.2.1",
3
+ "version": "6.2.2",
4
4
  "description": "Create keyframe animations for anything in JavaScript; specify your keyframes in standards-complaint CSS.",
5
5
  "license": "MIT",
6
6
  "keywords": [