@mkbabb/keyframes.js 4.4.0 → 5.0.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 +7 -7
- package/dist/{animate-CuUJt2Tb.js → animate-CTWr6K7j.js} +3 -3
- package/dist/{animations-5nf2kBkv.js → animations-CZxf0rep.js} +2 -2
- package/dist/{compile-DgNRG6Lo.js → compile-YRJRdpKF.js} +2 -2
- package/dist/{draw-svg-DYRDxBlL.js → draw-svg-Dat9mHgi.js} +1 -1
- package/dist/{engine-CNHvTgpw.js → engine-DQcb7CLW.js} +516 -289
- package/dist/{ingest-CNM5xkQT.js → ingest-CU-kdYcM.js} +1 -1
- package/dist/keyframes.d.ts +178 -115
- package/dist/keyframes.js +39 -39
- package/dist/morph-svg-83uyYxoW.js +84 -0
- package/dist/{motion-path-J-RSNmRQ.js → motion-path-C0OHqcA3.js} +1 -1
- package/dist/{scroll-scene-CXEgM49Q.js → scroll-scene-DQxhxn9I.js} +2 -2
- package/dist/{sequence-CF5hazqz.js → sequence-cBr7thU8.js} +1 -1
- package/dist/{springTimingFunction-CDHZ00JQ.js → springTimingFunction-D26gPkAy.js} +1 -1
- package/dist/{timeline-B7SV3T_E.js → timeline-vY3eD3Ax.js} +27 -39
- package/dist/{utils-D7nuAND5.js → utils-BPRImVl5.js} +28 -25
- package/dist/{validate-8r6Yo-uc.js → validate-B1pE-Y_T.js} +3 -3
- package/dist/{waapi-D9MHMm_9.js → waapi-D0ssxKy1.js} +90 -28
- package/package.json +35 -5
- package/dist/morph-svg-DRjl9Hfz.js +0 -62
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mkbabb/keyframes.js",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"description": "Create keyframe animations for anything in JavaScript; specify your keyframes in standards-complaint CSS.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
@@ -42,6 +42,8 @@
|
|
|
42
42
|
"gh-pages": "vite build --mode gh-pages",
|
|
43
43
|
"proof:boundary": "node scripts/proof-boundary.mjs",
|
|
44
44
|
"proof:published-surface": "node scripts/proof-published-surface.mjs",
|
|
45
|
+
"proof:alias-dropped": "node scripts/proof-alias-dropped.mjs",
|
|
46
|
+
"proof:changelog-5": "node scripts/proof-changelog-5.mjs",
|
|
45
47
|
"proof:agent-surface": "node scripts/proof-agent-surface.mjs",
|
|
46
48
|
"proof:agent-validate": "node scripts/proof-agent-validate.mjs && vitest run test/agent-validate.test.ts",
|
|
47
49
|
"proof:demo-on-published-surface": "node scripts/proof-demo-on-published-surface.mjs",
|
|
@@ -186,7 +188,6 @@
|
|
|
186
188
|
"proof:consume-bundle": "node scripts/proof-consume-bundle.mjs",
|
|
187
189
|
"proof:keyframes-vue-published": "node scripts/proof-keyframes-vue-published.mjs",
|
|
188
190
|
"proof:workaround-deletion": "node scripts/proof-workaround-deletion.mjs",
|
|
189
|
-
"proof:control-point-live": "node scripts/proof-control-point-live.mjs",
|
|
190
191
|
"proof:settle-is-predicate": "node scripts/proof-settle-is-predicate.mjs",
|
|
191
192
|
"proof:manifest-sourced": "node scripts/proof-manifest-sourced.mjs",
|
|
192
193
|
"proof:chronic-closure": "node scripts/proof-chronic-closure.mjs",
|
|
@@ -195,8 +196,35 @@
|
|
|
195
196
|
"proof:emerging-css-resolve-now": "node scripts/proof-emerging-css-resolve-now.mjs && vitest run test/emerging-css-resolve-now.test.ts",
|
|
196
197
|
"proof:morphsvg-consume": "node scripts/proof-morphsvg-consume.mjs && vitest run test/morph-svg.test.ts",
|
|
197
198
|
"proof:portable-perf": "node scripts/proof-portable-perf.mjs",
|
|
198
|
-
"proof:
|
|
199
|
-
"proof:
|
|
199
|
+
"proof:spring-heatmap": "node scripts/proof-spring-heatmap.mjs",
|
|
200
|
+
"proof:record-truth": "node scripts/proof-record-truth.mjs",
|
|
201
|
+
"proof:lint-clean": "node scripts/proof-lint-clean.mjs",
|
|
202
|
+
"lint": "depcruise src --ignore-known",
|
|
203
|
+
"proof:drag2d-light-certified": "node scripts/proof-drag2d-light-certified.mjs",
|
|
204
|
+
"proof:published-on-master": "node scripts/proof-published-on-master.mjs",
|
|
205
|
+
"proof:deploy-roundtrip": "node scripts/proof-deploy-roundtrip.mjs",
|
|
206
|
+
"proof:wave-charter": "node scripts/proof-wave-charter.mjs",
|
|
207
|
+
"proof:pin-ledger-current": "node scripts/proof-pin-ledger-current.mjs",
|
|
208
|
+
"proof:emerging-css-resolve-p2": "node scripts/proof-emerging-css-resolve-p2.mjs && vitest run test/emerging-css-resolve-p2.test.ts",
|
|
209
|
+
"proof:processframe-soa": "node scripts/proof-processframe-soa.mjs",
|
|
210
|
+
"proof:nan-frame": "node scripts/proof-nan-frame.mjs && vitest run test/nan-frame.test.ts",
|
|
211
|
+
"proof:waapi-adaptive-densify": "node scripts/proof-waapi-adaptive-densify.mjs",
|
|
212
|
+
"proof:grammar-fuzz": "node scripts/proof-grammar-fuzz.mjs && vitest run test/grammar-fuzz.test.ts",
|
|
213
|
+
"proof:kf-differential": "node scripts/proof-kf-differential.mjs",
|
|
214
|
+
"proof:demo-control-point": "node scripts/proof-demo-control-point.mjs",
|
|
215
|
+
"proof:easing-curve-editor": "node scripts/proof-easing-curve-editor.mjs",
|
|
216
|
+
"proof:scene-switcher-mobile": "node scripts/proof-scene-switcher-mobile.mjs",
|
|
217
|
+
"proof:amiga-decay-visible": "node scripts/proof-amiga-decay-visible.mjs",
|
|
218
|
+
"proof:morph-renders-d": "node scripts/proof-morph-renders-d.mjs && vitest run test/morph-svg.test.ts",
|
|
219
|
+
"proof:morph-orients": "node scripts/proof-morph-orients.mjs && vitest run test/morph-svg.test.ts",
|
|
220
|
+
"proof:morph-scene": "node scripts/proof-morph-scene.mjs",
|
|
221
|
+
"proof:emerging-css-resolve-fn": "node scripts/proof-emerging-css-resolve-fn.mjs && vitest run test/emerging-css-resolve-fn.test.ts",
|
|
222
|
+
"proof:no-cross-realm-cast": "node scripts/proof-no-cross-realm-cast.mjs",
|
|
223
|
+
"proof:color-soa": "node scripts/proof-color-soa.mjs",
|
|
224
|
+
"proof:glassui-aria-ask": "node scripts/proof-glassui-aria-ask.mjs",
|
|
225
|
+
"proof:correctness": "npm run proof:engine-no-throw-on-play && npm run proof:subject-animates && npm run proof:cold-entry && npm run proof:fsm-suspend-resume-live && npm run proof:easing-editor-live && npm run proof:amiga-subject-is-pivot && npm run proof:drag-gesture && npm run proof:control-surface-single-writer && npm run proof:sheet-reopen-scroll && npm run proof:perf-frame-budget && npm run proof:icon-paint-live && npm run proof:specular-absent-at-rest && npm run proof:demo-fonts && npm run proof:font-census && npm run proof:live-session && npm run proof:live-session-mobile && npm run proof:appearance-suffusion && npm run proof:spring-slider-continuous && npm run proof:emerging-css-resolve-now && npm run proof:spring-heatmap && npm run proof:demo-control-point && npm run proof:easing-curve-editor && npm run proof:scene-switcher-mobile && npm run proof:amiga-decay-visible && npm run proof:morph-scene",
|
|
226
|
+
"proof:hygiene": "node scripts/run-all.mjs --tier=proof:hygiene-chain",
|
|
227
|
+
"proof:hygiene-chain": "npm run proof:record-truth && npm run proof:deps-current && npm run proof:repin-witness && npm run proof:boundary && npm run proof:consume-bundle && npm run proof:css-parity && npm run proof:packrat-sound && npm run proof:workaround-deletion && npm run proof:dogfood && npm run proof:engine && npm run proof:decomposition && npm run proof:no-deprecated-guard && npm run proof:single-writer && npm run proof:composable-encapsulation && npm run proof:demo-no-oversize && npm run proof:no-brittle-selector && npm run proof:no-dup-utility && npm run proof:no-single-option-select && npm run proof:settle-is-predicate && npm run proof:demo-smoke && npm run proof:occlusion && npm run proof:cartoon-is-panel-depth && npm run proof:glass-and-cartoon && npm run proof:dock-popover-opens && npm run proof:single-toggle && npm run proof:darkmode-row-toggle && npm run proof:idle-fade && npm run proof:single-column-pack && npm run proof:label-subgrid && npm run proof:timeline-rail-width && npm run proof:demo-shell-grid && npm run proof:layout-cluster && npm run proof:stage-not-clipped && npm run proof:cartoon-shadow-unclipped && npm run proof:scene-machine-irrefragable && npm run proof:scene-control-dfa && npm run proof:scene-transition-perf && npm run proof:dock-zorder && npm run proof:drawer-spring && npm run proof:idioms && npm run proof:phi-leaf-zero && npm run proof:icon-idiom && npm run proof:styling-idioms && npm run proof:scene-parity && npm run proof:sequence-rows-draggable && npm run proof:motion-path-editable && npm run proof:motion-path-copy && npm run proof:easter-egg && npm run proof:crayon-preserved && npm run proof:design-refinement && npm run proof:typing-dots && npm run proof:dogfood-hero && npm run proof:easing-canvas-bounded && npm run proof:scene-uses-standard-ribbon && npm run proof:easing-sidebar-normalized && npm run proof:easing-sidebar-minimal && npm run proof:easing-stage-is-ball && npm run proof:scene-card-rounded && npm run proof:stage-glass-card && npm run proof:card-rounded-primitive && npm run proof:stage-within-docks && npm run proof:mobile-single-page && npm run proof:bezier-no-scroll && npm run proof:bezier-single-card && npm run proof:bezier-grown && npm run proof:pp-logo-svg && npm run proof:scene-perf-budget && npm run proof:hero-rung && npm run proof:hero-balance && npm run proof:hero-cls && npm run proof:brittleness && npm run proof:demo-elevate && npm run proof:modern-web && npm run proof:zero-alloc && npm run proof:engine-correctness && npm run proof:standalone-zero-alloc && npm run proof:compile-deterministic && npm run proof:compile-replay && npm run proof:replay-equality && npm run proof:platform-adopt && npm run proof:orchestration && npm run proof:transport-events && npm run proof:animate-orchestration && npm run proof:interp-fastprops && npm run proof:sync-step && npm run proof:roundtrip-easing && npm run proof:adapter-capture && npm run proof:composition-honored && npm run proof:diagnostics-channel && npm run proof:scroll-roundtrip && npm run proof:motion-path && npm run proof:blend && npm run proof:spring-blend-weight && npm run proof:drawsvg && npm run proof:finished && npm run proof:adopt-compiled && npm run proof:interpolate-anything && npm run proof:roundtrip-fidelity && npm run proof:ingest-replay && npm run proof:orbital-rotate3d && npm run proof:asset-store-singleton && npm run proof:scene-raf-leak && npm run proof:scene-contract-identity && npm run proof:group-snapshot-identity && npm run proof:resize-tracks && npm run proof:cohesion && npm run proof:visual-lock && npm run proof:demo-usability && npm run proof:computed-real-dom && npm run proof:lighthouse-a11y && npm run proof:lighthouse-mobile && npm run proof:published-surface && npm run proof:alias-dropped && npm run proof:changelog-5 && npm run proof:agent-surface && npm run proof:agent-validate && npm run proof:demo-on-published-surface && npm run proof:color-fidelity && npm run proof:readme-runs && npm run proof:event-ordering && npm run proof:manifest-sourced && npm run proof:bench-runs && npm run proof:bench-taxonomy && npm run proof:scheduler-posttask && npm run proof:epf1-measure && npm run proof:spring-vector && npm run proof:gate-is-runtime && npm run proof:chronic-closure && npm run proof:taste-packet && npm run proof:ci-coverage && npm run proof:no-foreign-symbol-stamp && npm run proof:soa-composite && npm run proof:morphsvg-consume && npm run proof:portable-perf && npm run proof:published-on-master && npm run proof:deploy-roundtrip && npm run proof:lint-clean && npm run proof:drag2d-light-certified && npm run proof:wave-charter && npm run proof:pin-ledger-current && npm run proof:emerging-css-resolve-p2 && npm run proof:processframe-soa && npm run proof:nan-frame && npm run proof:waapi-adaptive-densify && npm run proof:grammar-fuzz && npm run proof:kf-differential && npm run proof:morph-renders-d && npm run proof:morph-orients && npm run proof:emerging-css-resolve-fn && npm run proof:no-cross-realm-cast && npm run proof:color-soa && npm run proof:glassui-aria-ask && npm run proof:report-all && vitest run",
|
|
200
228
|
"proof:all": "node scripts/run-all.mjs --all",
|
|
201
229
|
"proof:all:demo": "npm run proof:demo-smoke && npm run proof:occlusion && npm run proof:peer-satisfied",
|
|
202
230
|
"test": "vitest",
|
|
@@ -217,7 +245,7 @@
|
|
|
217
245
|
},
|
|
218
246
|
"homepage": "https://github.com/mkbabb/keyframes.js#readme",
|
|
219
247
|
"dependencies": {
|
|
220
|
-
"@mkbabb/value.js": "^1.
|
|
248
|
+
"@mkbabb/value.js": "^1.2.0"
|
|
221
249
|
},
|
|
222
250
|
"optionalDependencies": {
|
|
223
251
|
"@mkbabb/glass-ui": "~4.0.0"
|
|
@@ -237,7 +265,9 @@
|
|
|
237
265
|
"@vueuse/core": "^14.3.0",
|
|
238
266
|
"class-variance-authority": "^0.7.1",
|
|
239
267
|
"clsx": "^2.1.1",
|
|
268
|
+
"dependency-cruiser": "^17.4.3",
|
|
240
269
|
"embla-carousel-vue": "^8.6.0",
|
|
270
|
+
"fast-check": "^3.23.2",
|
|
241
271
|
"highlight.js": "^11.11.1",
|
|
242
272
|
"html2canvas": "^1.4.1",
|
|
243
273
|
"jsdom": "^29.1.1",
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./errors-W8zkvPw4.js";
|
|
2
|
-
import { CSSKeyframesAnimation as t } from "./engine-CNHvTgpw.js";
|
|
3
|
-
import { PathGeometry as n } from "@mkbabb/value.js";
|
|
4
|
-
//#region src/animation/morph-svg.ts
|
|
5
|
-
var r = 64, i = (e) => `--morph-${e}-x`, a = (e) => `--morph-${e}-y`, o = (e, t) => {
|
|
6
|
-
let n = Array(t + 1);
|
|
7
|
-
for (let r = 0; r <= t; r++) n[r] = e.getPointAtT(r / t);
|
|
8
|
-
return n;
|
|
9
|
-
}, s = (e) => {
|
|
10
|
-
if (e.length === 0) return "";
|
|
11
|
-
let t = (e) => Number.isInteger(e) ? `${e}` : e.toFixed(3), n = `M ${t(e[0].x)} ${t(e[0].y)}`;
|
|
12
|
-
for (let r = 1; r < e.length; r++) n += ` L ${t(e[r].x)} ${t(e[r].y)}`;
|
|
13
|
-
return n;
|
|
14
|
-
};
|
|
15
|
-
function c(s, c, l = {}) {
|
|
16
|
-
let { samples: u = r, target: d, autoPlay: f = !0, ...p } = l;
|
|
17
|
-
if (typeof s != "string" || s.length === 0) throw new e("from", s, "fromMorphSVG(): `from` must be a non-empty SVG path `d` string.");
|
|
18
|
-
if (typeof c != "string" || c.length === 0) throw new e("to", c, "fromMorphSVG(): `to` must be a non-empty SVG path `d` string.");
|
|
19
|
-
if (!Number.isInteger(u) || u < 2) throw new e("samples", u, "fromMorphSVG(): `samples` must be an integer >= 2 (a 1-sample morph is just the two endpoints, with no body to interpolate).");
|
|
20
|
-
let m = new n(s), h = new n(c);
|
|
21
|
-
if (m.totalLength === 0) throw new e("from", s, "fromMorphSVG(): the `from` path has zero arc-length — a morph between a zero-length path and anything is malformed input, not an identity animation.");
|
|
22
|
-
if (h.totalLength === 0) throw new e("to", c, "fromMorphSVG(): the `to` path has zero arc-length — a morph between a zero-length path and anything is malformed input, not an identity animation.");
|
|
23
|
-
let g = o(m, u), _ = o(h, u), v = {}, y = {};
|
|
24
|
-
for (let e = 0; e <= u; e++) v[i(e)] = g[e].x, v[a(e)] = g[e].y, y[i(e)] = _[e].x, y[a(e)] = _[e].y;
|
|
25
|
-
let b = {
|
|
26
|
-
"0%": v,
|
|
27
|
-
"100%": y
|
|
28
|
-
}, x = new t(p).fromKeyframes(b);
|
|
29
|
-
return d != null && x.setTargets(d), f && x.play(), x;
|
|
30
|
-
}
|
|
31
|
-
var l = class {
|
|
32
|
-
animation;
|
|
33
|
-
samples;
|
|
34
|
-
constructor(e, t, n = {}) {
|
|
35
|
-
this.animation = c(e, t, n), this.samples = n.samples ?? r;
|
|
36
|
-
}
|
|
37
|
-
sampleD(e) {
|
|
38
|
-
let t = (e < 0 ? 0 : e > 1 ? 1 : e) * this.animation.options.duration, n = this.animation.interpFrames(t, !1), r = Array(this.samples + 1);
|
|
39
|
-
for (let e = 0; e <= this.samples; e++) {
|
|
40
|
-
let t = n[i(e)]?.[0]?.value, o = n[a(e)]?.[0]?.value;
|
|
41
|
-
r[e] = {
|
|
42
|
-
x: t ?? 0,
|
|
43
|
-
y: o ?? 0
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
return s(r);
|
|
47
|
-
}
|
|
48
|
-
play() {
|
|
49
|
-
return this.animation.play();
|
|
50
|
-
}
|
|
51
|
-
pause() {
|
|
52
|
-
return this.animation.pause(), this;
|
|
53
|
-
}
|
|
54
|
-
stop() {
|
|
55
|
-
return this.animation.stop(), this;
|
|
56
|
-
}
|
|
57
|
-
get finished() {
|
|
58
|
-
return this.animation.finished;
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
//#endregion
|
|
62
|
-
export { l as MorphSVG, c as fromMorphSVG };
|