@mkbabb/keyframes.js 5.2.0 → 5.3.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 +15 -5
- package/dist/easing-registry-BAgudUsG.js +2 -0
- package/dist/{easing-registry-DHV2-5gA.js → easing-registry-BlbS88NR.js} +2 -2
- package/dist/engine/index.d.ts +155 -174
- package/dist/engine/index.js +3710 -16
- package/dist/keyframes.d.ts +370 -305
- package/dist/keyframes.js +91 -142
- package/dist/{sequence-s0bL7Uul.js → sequence-CES7o7hs.js} +218 -170
- package/package.json +16 -42
- package/dist/backward-color-BtbRcnna.js +0 -108
- package/dist/compile-BHCTPerD.js +0 -30
- package/dist/delegation-BQYCrP2p.js +0 -259
- package/dist/draw-svg-CK9Qrly8.js +0 -33
- package/dist/easing-registry-y1p9McFy.js +0 -2
- package/dist/easing-serialize-D4LZCB6i.js +0 -21
- package/dist/engine-CPK_udUQ.js +0 -1172
- package/dist/engine-DlpimZtM.js +0 -3
- package/dist/entry-D82NKUhP.js +0 -148
- package/dist/format-BdIvdLzG.js +0 -114
- package/dist/group-HM7N4uOE.js +0 -390
- package/dist/handle-D4xrf_ya.js +0 -21
- package/dist/ingest-_g6tfk2e.js +0 -166
- package/dist/morph-svg-KUrH9KnK.js +0 -79
- package/dist/motion-path-wM5tPfrY.js +0 -26
- package/dist/parse-flatten-DRMHFytp.js +0 -2
- package/dist/parse-flatten-ZZUSEQEL.js +0 -63
- package/dist/presets-DeDJYL4G.js +0 -275
- package/dist/scheduler-CfGIC3GX.js +0 -14
- package/dist/scroll-BEyCx0b_.js +0 -287
- package/dist/validate-xFZ_Ld1k.js +0 -39
- package/dist/view-transition-BPJQxUTC.js +0 -305
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
|
|
47
|
-
demo/ # Vue 3 demo apps
|
|
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
|
-
|
|
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;"
|
|
@@ -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;
|