@mkbabb/keyframes.js 5.2.0 → 5.3.1

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
@@ -43,15 +43,16 @@ Works both in and out of the browser. Anything that touches the DOM (`getCompute
43
43
  ## Project Structure
44
44
 
45
45
  ```
46
- src/animation/ # THE library — engine + every primitive (see src/animation/CLAUDE.md)
47
- demo/ # Vue 3 demo apps (see demo/CLAUDE.md)
46
+ src/animation/ # THE library — engine + every primitive
47
+ demo/ # Vue 3 demo apps
48
48
  test/ # Vitest suites (jsdom)
49
49
  bench/ # Vitest benchmarks
50
50
  scripts/ # CI gates (proof:* scripts) + code generators
51
51
  docs/ # Migration guide, published surface manifest, architecture notes
52
52
  ```
53
53
 
54
- For the authoritative per-file inventory, see [`src/animation/CLAUDE.md`](src/animation/CLAUDE.md).
54
+ Each library zone documents its contract at its owning barrel; the published
55
+ surface and package manifests are the authorities for exports and build shape.
55
56
 
56
57
  ## Animation
57
58
 
@@ -255,7 +256,7 @@ The parser uses [`@mkbabb/parse-that`](https://github.com/mkbabb/parse-that) and
255
256
 
256
257
  ### Units
257
258
 
258
- Unit parsing and resolution (length, angle, time, percentage, color, and container-query units) are handled by [`@mkbabb/value.js`](https://github.com/mkbabb/value.js). `ValueUnit`, `FunctionValue`, and `ValueArray` are the three token shapes; all define `toString()`, `valueOf()`, and `lerp()`.
259
+ Unit parsing and resolution (length, angle, time, percentage, color, and container-query units) are handled by [`@mkbabb/value.js`](https://github.com/mkbabb/value.js). `ValueUnit`, `FunctionValue`, and `ValueArray` are the three token shapes; all define `toString()`, `valueOf()`, and `lerp()`. Computed container units are resolved against the measured layout epoch; consumers that change the containing layout must call `bumpLayoutEpoch()` before sampling again so cached conversions are invalidated.
259
260
 
260
261
  ## `AnimationGroup`
261
262
 
@@ -273,6 +274,10 @@ Three blend modes:
273
274
  - **`add`**: numeric values accumulate
274
275
  - **`weighted`**: linear interpolation by `weight` (0–1)
275
276
 
277
+ Managed children are paused and resumed by the group clock: pause captures the
278
+ last rAF timestamp, resume clears the managed pause directly (never by calling a
279
+ child's public `resume()`), and settling releases the child from group ownership.
280
+
276
281
  Layer configuration per animation: `zIndex`, `weight`, `blendMode`, `enabled`, `properties` (whitelist). Property whitelisting enables effect layering—one layer animates position, another animates opacity.
277
282
 
278
283
  The group manages its own `requestAnimationFrame` loop and marks child animations as `managed`.
@@ -339,7 +344,7 @@ const { animation } = await adoptRunning(element, { animationName: "spin" });
339
344
  The CSS `animation-timeline` / `animation-range` grammar, round-tripped through value.js's typed extractor, and driven by a JS `ScrollScene` where the platform's native scroll-driven timelines aren't available. value.js owns the scroll **values** (the grammar, parsed verbatim — `scroll(root block)`, `entry 0%`, `cover 100%`); the kf `ScrollScene` owns **time** (resolving the live scroller against the DOM).
340
345
 
341
346
  ```ts
342
- const { parseScrollCSS, roundTripScrollCSS, createScrollScene, pinCSS } =
347
+ const { parseScrollCSS, roundTripScrollCSS, createScrollScene, driveScrollCSS, pinCSS } =
343
348
  await loadAnimationEngine();
344
349
 
345
350
  // PARSE the author grammar into typed options — verbatim, no DOM resolution:
@@ -357,6 +362,11 @@ roundTripScrollCSS(`.hero { animation-timeline: scroll(root block); }`);
357
362
  const scene = createScrollScene({ range: opts.range, scrub: 0.2 });
358
363
  element.style.opacity = String(scene.progress);
359
364
 
365
+ // DRIVE the complete parsed value through the range scene, optional trigger,
366
+ // and conservative native-vs-JS backend decision in one symmetric entry:
367
+ const driven = driveScrollCSS(opts, element, { scrub: 0.2 });
368
+ driven.backend; // "native" or "js"
369
+
360
370
  // pinCSS — synthesize the position:sticky pin a scroll-pinned scene needs:
361
371
  pinCSS(); // => "position: sticky; top: 0px;"
362
372
  pinCSS({ top: 24 }); // => "position: sticky; top: 24px;"
@@ -0,0 +1,2 @@
1
+ import { t as e } from "./easing-registry-BlbS88NR.js";
2
+ export { e as getTimingFunction };
@@ -1,5 +1,5 @@
1
- import { CSSCubicBezier as e, cssLinear as t, parseLinearStops as n, parseSteps as r, steppedEase as i, timingFunctions as a } from "@mkbabb/value.js";
2
- //#region src/animation/compile/easing-registry.ts
1
+ import { CSSCubicBezier as e, cssLinear as t, parseLinearStops as n, parseSteps as r, steppedEase as i, timingFunctions as a } from "@mkbabb/value.js/easing";
2
+ //#region src/animation/compile/easing/easing-registry.ts
3
3
  var o = /^\s*cubic-bezier\s*\(\s*(-?[\d.]+)\s*,\s*(-?[\d.]+)\s*,\s*(-?[\d.]+)\s*,\s*(-?[\d.]+)\s*\)\s*$/i, s = /^\s*steps\s*\(/i, c = /^\s*linear\s*\(/i, l = (l) => {
4
4
  if (l == null) return;
5
5
  if (typeof l != "string") return l;