@mkbabb/keyframes.js 5.3.4 → 6.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/dist/keyframes.js CHANGED
@@ -1,4 +1,4 @@
1
- import { C as e, S as t, _ as n, a as r, b as i, c as a, d as o, f as s, g as c, h as l, l as u, m as d, o as f, p, s as m, t as h, u as g, v as _, x as v } from "./sequence-CES7o7hs.js";
1
+ import { C as e, S as t, _ as n, a as r, b as i, c as a, d as o, f as s, g as c, h as l, l as u, m as d, o as f, p, s as m, t as h, u as g, v as _, x as v } from "./sequence-BvpIpCGp.js";
2
2
  //#region src/animation/physics/numeric.ts
3
3
  var y = class {
4
4
  _out = new Float64Array();
@@ -27,12 +27,16 @@ var s = (e) => typeof e == "function" ? { fn: e } : e, c = /^(linear|ease|ease-i
27
27
  async function d(e) {
28
28
  let t;
29
29
  try {
30
- t = await import("./easing-registry-BAgudUsG.js");
30
+ t = await import("./easing-registry-Db7xwtXT.js");
31
31
  } catch (t) {
32
32
  throw Error(`keyframes: the easing-registry chunk failed to load while resolving easing "${e}" — the easing registry is unreachable.`, { cause: t });
33
33
  }
34
- let n = t.getTimingFunction(e);
35
- if (!n) throw new a(e);
34
+ let n;
35
+ try {
36
+ n = t.resolveTimingFunction(e);
37
+ } catch {
38
+ throw new a(e);
39
+ }
36
40
  let r = { fn: n }, i = u(e);
37
41
  return i && (r.css = i), r;
38
42
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mkbabb/keyframes.js",
3
- "version": "5.3.4",
3
+ "version": "6.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": [
@@ -43,6 +43,7 @@
43
43
  "gh-pages": "vite build --mode gh-pages",
44
44
  "lint": "depcruise src",
45
45
  "test": "vitest",
46
+ "test:lib": "vitest run --project library",
46
47
  "bench": "vitest bench",
47
48
  "bench:color-fidelity": "vitest run test/engine/color-fidelity.test.ts && node scripts/color-fidelity-harness.mjs",
48
49
  "gen:agent-surface": "node scripts/gen-agent-surface.mjs",
@@ -65,10 +66,7 @@
65
66
  },
66
67
  "homepage": "https://github.com/mkbabb/keyframes.js#readme",
67
68
  "dependencies": {
68
- "@mkbabb/value.js": "^3.1.0"
69
- },
70
- "optionalDependencies": {
71
- "@mkbabb/glass-ui": "5.0.0"
69
+ "@mkbabb/value.js": "4.0.0"
72
70
  },
73
71
  "devDependencies": {
74
72
  "@iconify-json/radix-icons": "^1.2.6",
@@ -1,2 +0,0 @@
1
- import { t as e } from "./easing-registry-BlbS88NR.js";
2
- export { e as getTimingFunction };
@@ -1,27 +0,0 @@
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
- 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
- if (l == null) return;
5
- if (typeof l != "string") return l;
6
- let u = l.match(o);
7
- if (u) {
8
- let t = u.slice(1, 5).map((e) => Number.parseFloat(e ?? ""));
9
- if (t.length === 4 && t.every((e) => Number.isFinite(e))) {
10
- let [n, r, i, a] = t;
11
- return e(n, r, i, a);
12
- }
13
- }
14
- if (s.test(l)) try {
15
- let { count: e, jumpTerm: t } = r(l);
16
- return i(e, t);
17
- } catch {}
18
- if (l === "step-start") return i(1, "jump-start");
19
- if (l === "step-end") return i(1, "jump-end");
20
- if (c.test(l)) try {
21
- return t(n(l));
22
- } catch {}
23
- let d = a[l];
24
- if (typeof d == "function" && d.length <= 1) return d;
25
- };
26
- //#endregion
27
- export { l as t };