@synnaxlabs/x 0.44.2 → 0.44.4
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/.turbo/turbo-build.log +35 -39
- package/dist/base-BLNViP3D.cjs +1 -0
- package/dist/{base-DFq0vvGn.js → base-BORMP3mH.js} +14 -11
- package/dist/bounds-BQqppNFf.js +186 -0
- package/dist/bounds-BXbqBINt.cjs +1 -0
- package/dist/bounds.cjs +1 -1
- package/dist/bounds.js +1 -1
- package/dist/{box-CO_2_DGG.js → box-DRH5SOaY.js} +67 -73
- package/dist/box-qgxWXNhm.cjs +1 -0
- package/dist/box.cjs +1 -1
- package/dist/box.js +1 -1
- package/dist/deep.cjs +1 -1
- package/dist/deep.js +1 -1
- package/dist/{dimensions-CRgergMS.js → dimensions-RaRkesPq.js} +1 -1
- package/dist/{dimensions-D2QGoNXO.cjs → dimensions-qY12pyfC.cjs} +1 -1
- package/dist/dimensions.cjs +1 -1
- package/dist/dimensions.js +1 -1
- package/dist/direction-DKdfJwj7.js +19 -0
- package/dist/direction-XCdrc4is.cjs +1 -0
- package/dist/direction.cjs +1 -1
- package/dist/direction.js +1 -1
- package/dist/{external-Birv9jaY.js → external-BM_NS5yM.js} +6 -6
- package/dist/external-E3ErJeeM.cjs +1 -0
- package/dist/index.cjs +3 -3
- package/dist/index.js +244 -240
- package/dist/{location-Ar5y2DX2.js → location-CGLioInQ.js} +16 -21
- package/dist/location-DJ_K4SlP.cjs +1 -0
- package/dist/location.cjs +1 -1
- package/dist/location.js +1 -1
- package/dist/{path-DVFrKaNI.js → path-Blh4wJuA.js} +24 -21
- package/dist/path-CPSfCjde.cjs +1 -0
- package/dist/record-BwjIgrpU.cjs +1 -0
- package/dist/record-tSFQKmdG.js +19 -0
- package/dist/record.cjs +1 -1
- package/dist/record.js +1 -1
- package/dist/{scale-C6qKDbRb.cjs → scale-76Azh2EE.cjs} +1 -1
- package/dist/{scale-EWNUk-bn.js → scale-BhIvACdB.js} +4 -4
- package/dist/scale.cjs +1 -1
- package/dist/scale.js +1 -1
- package/dist/{series-EA1uaEDj.js → series-kgnLXSDr.js} +622 -489
- package/dist/series-tAhThbnz.cjs +6 -0
- package/dist/{spatial-DGpZ2sO3.cjs → spatial-BsGadoUr.cjs} +1 -1
- package/dist/{spatial-BSWPzMkK.js → spatial-QY891r0E.js} +1 -1
- package/dist/spatial.cjs +1 -1
- package/dist/spatial.js +14 -16
- package/dist/src/breaker/breaker.d.ts +2 -1
- package/dist/src/breaker/breaker.d.ts.map +1 -1
- package/dist/src/deep/path.d.ts.map +1 -1
- package/dist/src/id/id.d.ts +3 -1
- package/dist/src/id/id.d.ts.map +1 -1
- package/dist/src/math/math.d.ts +2 -1
- package/dist/src/math/math.d.ts.map +1 -1
- package/dist/src/record/record.d.ts +18 -0
- package/dist/src/record/record.d.ts.map +1 -1
- package/dist/src/spatial/base.d.ts +12 -0
- package/dist/src/spatial/base.d.ts.map +1 -1
- package/dist/src/spatial/direction/direction.d.ts +5 -1
- package/dist/src/spatial/direction/direction.d.ts.map +1 -1
- package/dist/src/spatial/external.d.ts +0 -1
- package/dist/src/spatial/external.d.ts.map +1 -1
- package/dist/src/spatial/xy/xy.d.ts +3 -0
- package/dist/src/spatial/xy/xy.d.ts.map +1 -1
- package/dist/src/status/status.d.ts +1 -0
- package/dist/src/status/status.d.ts.map +1 -1
- package/dist/src/strings/strings.d.ts +1 -1
- package/dist/src/strings/strings.d.ts.map +1 -1
- package/dist/src/telem/series.d.ts +7 -0
- package/dist/src/telem/series.d.ts.map +1 -1
- package/dist/src/telem/telem.d.ts +86 -1
- package/dist/src/telem/telem.d.ts.map +1 -1
- package/dist/src/zod/util.d.ts.map +1 -1
- package/dist/telem.cjs +1 -1
- package/dist/telem.js +1 -1
- package/dist/xy-BKIJiLu_.cjs +1 -0
- package/dist/{xy-C_-hb3Q2.js → xy-CBuhMaIo.js} +41 -31
- package/dist/xy.cjs +1 -1
- package/dist/xy.js +1 -1
- package/dist/zod.cjs +1 -1
- package/dist/zod.js +1 -1
- package/package.json +3 -8
- package/src/breaker/breaker.ts +4 -0
- package/src/deep/path.spec.ts +14 -0
- package/src/deep/path.ts +9 -2
- package/src/id/id.ts +8 -4
- package/src/math/math.spec.ts +20 -0
- package/src/math/math.ts +32 -29
- package/src/record/record.spec.ts +31 -0
- package/src/record/record.ts +23 -0
- package/src/spatial/base.ts +4 -0
- package/src/spatial/bounds/bounds.ts +1 -1
- package/src/spatial/direction/direction.spec.ts +35 -1
- package/src/spatial/direction/direction.ts +12 -0
- package/src/spatial/external.ts +0 -1
- package/src/spatial/xy/xy.spec.ts +124 -7
- package/src/spatial/xy/xy.ts +15 -2
- package/src/status/status.ts +11 -0
- package/src/strings/strings.spec.ts +3 -0
- package/src/strings/strings.ts +2 -1
- package/src/telem/series.spec.ts +543 -2
- package/src/telem/series.ts +28 -9
- package/src/telem/telem.spec.ts +606 -0
- package/src/telem/telem.ts +143 -5
- package/src/zod/util.ts +5 -3
- package/tsconfig.tsbuildinfo +1 -1
- package/vite.config.ts +0 -1
- package/dist/base-BAM2mqCy.cjs +0 -1
- package/dist/bounds-D6e9xoHt.cjs +0 -1
- package/dist/bounds-Dj9nG39I.js +0 -174
- package/dist/box-Cxki783Y.cjs +0 -1
- package/dist/direction-386XDm2w.cjs +0 -1
- package/dist/direction-8etxfKaR.js +0 -17
- package/dist/external-DsmsSN1Y.cjs +0 -1
- package/dist/location-DZi8ftXp.cjs +0 -1
- package/dist/path-BeMr8xWN.cjs +0 -1
- package/dist/position-DSy2hONH.cjs +0 -1
- package/dist/position-PQ6op54I.js +0 -85
- package/dist/position.cjs +0 -1
- package/dist/position.js +0 -4
- package/dist/record-CAcQ5PNX.js +0 -14
- package/dist/record-YvCh7bzB.cjs +0 -1
- package/dist/series-CcA_WjbJ.cjs +0 -6
- package/dist/src/spatial/position/index.d.ts +0 -2
- package/dist/src/spatial/position/index.d.ts.map +0 -1
- package/dist/src/spatial/position/position.d.ts +0 -20
- package/dist/src/spatial/position/position.d.ts.map +0 -1
- package/dist/src/spatial/position/position.spec.d.ts +0 -2
- package/dist/src/spatial/position/position.spec.d.ts.map +0 -1
- package/dist/xy-CUE3QDNn.cjs +0 -1
- package/src/spatial/position/index.ts +0 -10
- package/src/spatial/position/position.spec.ts +0 -211
- package/src/spatial/position/position.ts +0 -157
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z as O } from "zod";
|
|
2
2
|
import { c as m } from "./index-D2xcvEO5.js";
|
|
3
|
-
import { y as
|
|
4
|
-
const N = y, R =
|
|
3
|
+
import { y as a, e as y, f, g, D as C, C as z, X as L, Y as h, l as S, h as d } from "./base-BORMP3mH.js";
|
|
4
|
+
const N = y, R = a, I = f, X = {
|
|
5
5
|
top: "bottom",
|
|
6
6
|
right: "left",
|
|
7
7
|
bottom: "top",
|
|
@@ -17,9 +17,9 @@ const N = y, R = f, I = a, X = {
|
|
|
17
17
|
const o = r(t);
|
|
18
18
|
return o === "top" || o === "bottom" ? "y" : "x";
|
|
19
19
|
}, w = O.object({
|
|
20
|
-
x: y.or(
|
|
21
|
-
y:
|
|
22
|
-
}), M = O.object({ x: y, y:
|
|
20
|
+
x: y.or(f),
|
|
21
|
+
y: a.or(f)
|
|
22
|
+
}), M = O.object({ x: y, y: a }), T = Object.freeze({ x: "left", y: "top" }), b = Object.freeze({ x: "right", y: "top" }), l = Object.freeze({ x: "left", y: "bottom" }), u = Object.freeze({ x: "right", y: "bottom" }), x = Object.freeze({ x: "center", y: "center" }), p = Object.freeze({ x: "center", y: "top" }), _ = Object.freeze({ x: "center", y: "bottom" }), E = Object.freeze({ x: "right", y: "center" }), j = Object.freeze({ x: "left", y: "center" }), $ = Object.freeze([
|
|
23
23
|
j,
|
|
24
24
|
E,
|
|
25
25
|
p,
|
|
@@ -50,14 +50,14 @@ const N = y, R = f, I = a, X = {
|
|
|
50
50
|
BOTTOM_RIGHT: u,
|
|
51
51
|
CENTER: x,
|
|
52
52
|
CENTER_LEFT: j,
|
|
53
|
-
CENTER_LOCATIONS:
|
|
53
|
+
CENTER_LOCATIONS: z,
|
|
54
54
|
CENTER_RIGHT: E,
|
|
55
55
|
TOP_CENTER: p,
|
|
56
56
|
TOP_LEFT: T,
|
|
57
57
|
TOP_RIGHT: b,
|
|
58
58
|
XY_LOCATIONS: $,
|
|
59
|
-
X_LOCATIONS:
|
|
60
|
-
Y_LOCATIONS:
|
|
59
|
+
X_LOCATIONS: L,
|
|
60
|
+
Y_LOCATIONS: h,
|
|
61
61
|
center: I,
|
|
62
62
|
construct: r,
|
|
63
63
|
constructXY: q,
|
|
@@ -80,20 +80,15 @@ const N = y, R = f, I = a, X = {
|
|
|
80
80
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
81
81
|
export {
|
|
82
82
|
l as B,
|
|
83
|
-
|
|
83
|
+
j as C,
|
|
84
84
|
T,
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
B as b,
|
|
85
|
+
F as a,
|
|
86
|
+
p as b,
|
|
88
87
|
M as c,
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
u as h,
|
|
94
|
-
j as i,
|
|
95
|
-
E as j,
|
|
88
|
+
b as d,
|
|
89
|
+
_ as e,
|
|
90
|
+
u as f,
|
|
91
|
+
E as g,
|
|
96
92
|
K as l,
|
|
97
|
-
|
|
98
|
-
w as x
|
|
93
|
+
B as x
|
|
99
94
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const b=require("zod"),N=require("./index-DdhM_E4k.cjs"),o=require("./base-BLNViP3D.cjs"),R=o.xLocation,j=o.yLocation,z=o.centerLocation,I={top:"bottom",right:"left",bottom:"top",left:"right",center:"center"},S={top:"left",right:"top",bottom:"right",left:"bottom",center:"center"},g=o.crudeLocation,i=t=>t instanceof String||!o.DIRECTIONS.includes(t)?t:t==="x"?"left":"top",h=t=>I[i(t)],d=t=>S[i(t)],s=t=>{const n=i(t);return n==="top"||n==="bottom"?"y":"x"},m=b.z.object({x:o.xLocation.or(o.centerLocation),y:o.yLocation.or(o.centerLocation)}),L=b.z.object({x:o.xLocation,y:o.yLocation}),O=Object.freeze({x:"left",y:"top"}),y=Object.freeze({x:"right",y:"top"}),f=Object.freeze({x:"left",y:"bottom"}),x=Object.freeze({x:"right",y:"bottom"}),E=Object.freeze({x:"center",y:"center"}),_=Object.freeze({x:"center",y:"top"}),u=Object.freeze({x:"center",y:"bottom"}),a=Object.freeze({x:"right",y:"center"}),l=Object.freeze({x:"left",y:"center"}),A=Object.freeze([l,a,_,u,O,y,f,x,E]),C=(t,n)=>t.x===n.x&&t.y===n.y,P=(t,n)=>{if(typeof n=="object"){let e=!0;return"x"in n&&(t.x===n.x||(e=!1)),"y"in n&&(t.y===n.y||(e=!1)),e}return t.x===n||t.y===n},p=t=>[t.x,t.y],T=t=>s(i(t))==="x",M=t=>s(i(t))==="y",X=t=>`${t.x}${N.capitalize(t.y)}`,Y=(t,n)=>{let e,c;if(typeof t=="object"&&"x"in t?(e=t.x,c=t.y):(e=i(t),c=i(n??t)),s(e)===s(c)&&e!=="center"&&c!=="center")throw new Error(`[XYLocation] - encountered two locations with the same direction: ${e.toString()} - ${c.toString()}`);const r={...E};return e==="center"?T(c)?[r.x,r.y]=[c,e]:[r.x,r.y]=[e,c]:c==="center"?T(e)?[r.x,r.y]=[e,c]:[r.x,r.y]=[c,e]:T(e)?[r.x,r.y]=[e,c]:[r.x,r.y]=[c,e],r},B=Object.freeze(Object.defineProperty({__proto__:null,BOTTOM_CENTER:u,BOTTOM_LEFT:f,BOTTOM_RIGHT:x,CENTER:E,CENTER_LEFT:l,CENTER_LOCATIONS:o.CENTER_LOCATIONS,CENTER_RIGHT:a,TOP_CENTER:_,TOP_LEFT:O,TOP_RIGHT:y,XY_LOCATIONS:A,X_LOCATIONS:o.X_LOCATIONS,Y_LOCATIONS:o.Y_LOCATIONS,center:z,construct:i,constructXY:Y,corner:L,crude:g,direction:s,isX:T,isY:M,location:o.location,outer:o.outerLocation,rotate90:d,swap:h,x:R,xy:m,xyCouple:p,xyEquals:C,xyMatches:P,xyToString:X,y:j},Symbol.toStringTag,{value:"Module"}));exports.BOTTOM_CENTER=u;exports.BOTTOM_LEFT=f;exports.BOTTOM_RIGHT=x;exports.CENTER_LEFT=l;exports.CENTER_RIGHT=a;exports.TOP_CENTER=_;exports.TOP_LEFT=O;exports.TOP_RIGHT=y;exports.corner=L;exports.location=B;exports.xyCouple=p;exports.xyEquals=C;
|
package/dist/location.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./location-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./location-DJ_K4SlP.cjs");exports.location=o.location;
|
package/dist/location.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
const
|
|
1
|
+
const p = (s, r, t = ".") => {
|
|
2
2
|
const n = s.split(t);
|
|
3
3
|
return n.map((l, o) => {
|
|
4
4
|
const i = r(l, o, n);
|
|
5
5
|
return i == null ? null : typeof i == "string" ? i : i.join(t);
|
|
6
6
|
}).filter((l) => l != null).join(t);
|
|
7
|
-
},
|
|
7
|
+
}, u = (s, r) => {
|
|
8
8
|
if (!Array.isArray(s)) return s[r];
|
|
9
9
|
const t = s[r];
|
|
10
10
|
if (t != null || s.length == 0) return t;
|
|
11
11
|
const n = s[0];
|
|
12
12
|
if (typeof n == "object" && "key" in n)
|
|
13
13
|
return s.find((e) => e.key === r);
|
|
14
|
-
},
|
|
14
|
+
}, h = (s, r) => {
|
|
15
15
|
const t = s.split(".");
|
|
16
16
|
return t.forEach((n, e) => {
|
|
17
|
-
r =
|
|
17
|
+
r = u(r, n), r != null && typeof r == "object" && "key" in r && (t[e] = r.key);
|
|
18
18
|
}), t.join(".");
|
|
19
|
-
},
|
|
19
|
+
}, c = (s, r, t = { optional: !1, separator: "." }) => {
|
|
20
20
|
t.separator ??= ".";
|
|
21
|
-
const { optional: n, getter: e =
|
|
21
|
+
const { optional: n, getter: e = u } = t, l = r.split(t.separator);
|
|
22
22
|
if (l.length === 1 && l[0] === "") return s;
|
|
23
23
|
let o = s;
|
|
24
24
|
for (const i of l) {
|
|
@@ -30,11 +30,14 @@ const f = (s, r, t = ".") => {
|
|
|
30
30
|
o = a;
|
|
31
31
|
}
|
|
32
32
|
return o;
|
|
33
|
-
},
|
|
33
|
+
}, f = (s) => {
|
|
34
|
+
for (const r of s) if (isNaN(parseInt(r))) return null;
|
|
35
|
+
return parseInt(s);
|
|
36
|
+
}, g = (s, r, t) => {
|
|
34
37
|
const n = r.split(".");
|
|
35
38
|
let e = s;
|
|
36
39
|
for (let l = 0; l < n.length - 1; l++) {
|
|
37
|
-
const o = n[l], i =
|
|
40
|
+
const o = n[l], i = u(e, o);
|
|
38
41
|
if (i == null) throw new Error(`Path ${r} does not exist. ${o} is null`);
|
|
39
42
|
e = i;
|
|
40
43
|
}
|
|
@@ -44,8 +47,8 @@ const f = (s, r, t = ".") => {
|
|
|
44
47
|
return;
|
|
45
48
|
}
|
|
46
49
|
if (e.length === 0) return;
|
|
47
|
-
const l =
|
|
48
|
-
if (
|
|
50
|
+
const l = f(n[n.length - 1]);
|
|
51
|
+
if (l == null) {
|
|
49
52
|
const o = e[0];
|
|
50
53
|
if (typeof o == "object" && "key" in o) {
|
|
51
54
|
const i = e.findIndex((a) => a.key === n[n.length - 1]);
|
|
@@ -60,7 +63,7 @@ const f = (s, r, t = ".") => {
|
|
|
60
63
|
} catch (l) {
|
|
61
64
|
throw console.error("failed to set value", t, "at path", r, "on object", s), l;
|
|
62
65
|
}
|
|
63
|
-
},
|
|
66
|
+
}, y = (s, r) => {
|
|
64
67
|
const t = r.split(".");
|
|
65
68
|
let n = s;
|
|
66
69
|
for (let e = 0; e < t.length - 1; e++) {
|
|
@@ -75,12 +78,12 @@ const f = (s, r, t = ".") => {
|
|
|
75
78
|
return;
|
|
76
79
|
}
|
|
77
80
|
delete n[t[t.length - 1]];
|
|
78
|
-
},
|
|
81
|
+
}, d = (s, r) => {
|
|
79
82
|
const t = s.split(".");
|
|
80
83
|
return r < 0 ? t[t.length + r] : t[r];
|
|
81
|
-
},
|
|
84
|
+
}, x = (s, r) => {
|
|
82
85
|
try {
|
|
83
|
-
return
|
|
86
|
+
return c(s, r), !0;
|
|
84
87
|
} catch {
|
|
85
88
|
return !1;
|
|
86
89
|
}
|
|
@@ -96,12 +99,12 @@ const f = (s, r, t = ".") => {
|
|
|
96
99
|
return !0;
|
|
97
100
|
};
|
|
98
101
|
export {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
102
|
+
h as a,
|
|
103
|
+
d as e,
|
|
104
|
+
c as g,
|
|
105
|
+
x as h,
|
|
103
106
|
A as p,
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
+
y as r,
|
|
108
|
+
g as s,
|
|
109
|
+
p as t
|
|
107
110
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const a=(s,r,t=".")=>{const e=s.split(t);return e.map((l,o)=>{const i=r(l,o,e);return i==null?null:typeof i=="string"?i:i.join(t)}).filter(l=>l!=null).join(t)},u=(s,r)=>{if(!Array.isArray(s))return s[r];const t=s[r];if(t!=null||s.length==0)return t;const e=s[0];if(typeof e=="object"&&"key"in e)return s.find(n=>n.key===r)},h=(s,r)=>{const t=s.split(".");return t.forEach((e,n)=>{r=u(r,e),r!=null&&typeof r=="object"&&"key"in r&&(t[n]=r.key)}),t.join(".")},f=(s,r,t={optional:!1,separator:"."})=>{t.separator??=".";const{optional:e,getter:n=u}=t,l=r.split(t.separator);if(l.length===1&&l[0]==="")return s;let o=s;for(const i of l){const c=n(o,i);if(c==null){if(e)return null;throw new Error(`Path ${r} does not exist. ${i} is null`)}o=c}return o},p=s=>{for(const r of s)if(isNaN(parseInt(r)))return null;return parseInt(s)},g=(s,r,t)=>{const e=r.split(".");let n=s;for(let l=0;l<e.length-1;l++){const o=e[l],i=u(n,o);if(i==null)throw new Error(`Path ${r} does not exist. ${o} is null`);n=i}try{if(!Array.isArray(n)){n[e[e.length-1]]=t;return}if(n.length===0)return;const l=p(e[e.length-1]);if(l==null){const o=n[0];if(typeof o=="object"&&"key"in o){const i=n.findIndex(c=>c.key===e[e.length-1]);if(i!==-1){n[i]=t;return}}return}n[l]=t}catch(l){throw console.error("failed to set value",t,"at path",r,"on object",s),l}},y=(s,r)=>{const t=r.split(".");let e=s;for(let n=0;n<t.length-1;n++){const l=t[n];if(e[l]==null)return;e=e[l]}if(Array.isArray(e)){const n=parseInt(t[t.length-1]);if(isNaN(n))return;e.splice(n,1);return}delete e[t[t.length-1]]},d=(s,r)=>{const t=s.split(".");return r<0?t[t.length+r]:t[r]},m=(s,r)=>{try{return f(s,r),!0}catch{return!1}},A=(s,r)=>{if(r.length===0)return!0;const t=s.split("."),e=r.split(".");if(e.length>t.length)return!1;for(let n=0;n<e.length;n++){const l=t[n],o=e[n];if(o!=="*"&&l!==o)return!1}return!0};exports.element=d;exports.get=f;exports.has=m;exports.pathsMatch=A;exports.remove=y;exports.resolvePath=h;exports.set=g;exports.transformPath=a;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const n=require("zod"),s=n.z.record(n.z.union([n.z.number(),n.z.string(),n.z.symbol()]),n.z.unknown()),c=e=>Object.entries(e),i=(e,o)=>Object.fromEntries(c(e).map(([t,r])=>[t,o(r,t)])),u=e=>Object.fromEntries(c(e).filter(([o,t])=>t!==void 0)),d=(e,...o)=>{const t={...e};for(const r of o)delete t[r];return t},l=Object.freeze(Object.defineProperty({__proto__:null,entries:c,map:i,omit:d,purgeUndefined:u,unknownZ:s},Symbol.toStringTag,{value:"Module"}));exports.record=l;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z as t } from "zod";
|
|
2
|
+
const c = t.record(
|
|
3
|
+
t.union([t.number(), t.string(), t.symbol()]),
|
|
4
|
+
t.unknown()
|
|
5
|
+
), s = (e) => Object.entries(e), i = (e, n) => Object.fromEntries(s(e).map(([o, r]) => [o, n(r, o)])), m = (e) => Object.fromEntries(s(e).filter(([n, o]) => o !== void 0)), u = (e, ...n) => {
|
|
6
|
+
const o = { ...e };
|
|
7
|
+
for (const r of n) delete o[r];
|
|
8
|
+
return o;
|
|
9
|
+
}, l = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
10
|
+
__proto__: null,
|
|
11
|
+
entries: s,
|
|
12
|
+
map: i,
|
|
13
|
+
omit: u,
|
|
14
|
+
purgeUndefined: m,
|
|
15
|
+
unknownZ: c
|
|
16
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
17
|
+
export {
|
|
18
|
+
l as r
|
|
19
|
+
};
|
package/dist/record.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./record-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./record-BwjIgrpU.cjs");exports.record=e.record;
|
package/dist/record.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const l=require("zod"),y=require("./bounds-
|
|
1
|
+
"use strict";const l=require("zod"),y=require("./bounds-BXbqBINt.cjs"),u=require("./box-qgxWXNhm.cjs"),m=require("./location-DJ_K4SlP.cjs"),h=require("./xy-BKIJiLu_.cjs"),f=(n,t,e)=>t!==void 0&&n<t?t:e!==void 0&&n>e?e:n,B=l.z.object({offset:h.crudeZ,scale:h.crudeZ}),g=l.z.object({offset:l.z.number(),scale:l.z.number()}),v=n=>(t,e,s,r)=>e==="dimension"?[t,s]:[t,r?s-n:s+n],R=n=>(t,e,s,r)=>[t,r?s/n:s*n],T=n=>(t,e,s)=>{if(t===null)return[n,s];const{lower:r,upper:o}=t,{lower:a,upper:p}=n,x=o-r,d=p-a;if(e==="dimension")return[n,s*(d/x)];const w=(s-r)*(d/x)+a;return[n,w]},q=n=>(t,e,s)=>[n,s],z=()=>(n,t,e)=>{if(n===null)throw new Error("cannot invert without bounds");if(t==="dimension")return[n,e];const{lower:s,upper:r}=n;return[n,r-(e-s)]},E=n=>(t,e,s)=>{const{lower:r,upper:o}=n;return s=f(s,r,o),[t,s]};class i{ops=[];currBounds=null;currType=null;reversed=!1;constructor(){this.ops=[]}static translate(t){return new i().translate(t)}static magnify(t){return new i().magnify(t)}static scale(t,e){return new i().scale(t,e)}translate(t){const e=this.new(),s=v(t);return s.type="translate",e.ops.push(s),e}magnify(t){const e=this.new(),s=R(t);return s.type="magnify",e.ops.push(s),e}scale(t,e){const s=y.construct(t,e),r=this.new(),o=T(s);return o.type="scale",r.ops.push(o),r}clamp(t,e){const s=y.construct(t,e),r=this.new(),o=E(s);return o.type="clamp",r.ops.push(o),r}reBound(t,e){const s=y.construct(t,e),r=this.new(),o=q(s);return o.type="re-bound",r.ops.push(o),r}invert(){const t=z();t.type="invert";const e=this.new();return e.ops.push(t),e}pos(t){return this.exec("position",t)}dim(t){return this.exec("dimension",t)}new(){const t=new i;return t.ops=this.ops.slice(),t.reversed=this.reversed,t}exec(t,e){return this.currBounds=null,this.ops.reduce(([s,r],o)=>o(s,t,r,this.reversed),[null,e])[1]}reverse(){const t=this.new();t.ops.reverse();const e=[];return t.ops.forEach((s,r)=>{if(s.type==="scale"||e.some(([a,p])=>r>=a&&r<=p))return;const o=t.ops.findIndex((a,p)=>a.type==="scale"&&p>r);o!==-1&&e.push([r,o])}),e.forEach(([s,r])=>{const o=t.ops.slice(s,r);o.unshift(t.ops[r]),t.ops.splice(s,r-s+1,...o)}),t.reversed=!t.reversed,t}get transform(){return{scale:this.dim(1),offset:this.pos(0)}}static IDENTITY=new i}class c{x;y;currRoot;constructor(t=new i,e=new i,s=null){this.x=t,this.y=e,this.currRoot=s}static translate(t,e){return new c().translate(t,e)}static translateX(t){return new c().translateX(t)}static translateY(t){return new c().translateY(t)}static clamp(t){return new c().clamp(t)}static magnify(t){return new c().magnify(t)}static scale(t){return new c().scale(t)}static reBound(t){return new c().reBound(t)}translate(t,e){const s=h.construct(t,e),r=this.copy();return r.x=this.x.translate(s.x),r.y=this.y.translate(s.y),r}translateX(t){const e=this.copy();return e.x=this.x.translate(t),e}translateY(t){const e=this.copy();return e.y=this.y.translate(t),e}magnify(t){const e=this.copy();return e.x=this.x.magnify(t.x),e.y=this.y.magnify(t.y),e}scale(t){const e=this.copy();if(u.isBox(t)){const s=this.currRoot;return e.currRoot=t.root,s!=null&&!m.xyEquals(s,t.root)&&(s.x!==t.root.x&&(e.x=e.x.invert()),s.y!==t.root.y&&(e.y=e.y.invert())),e.x=e.x.scale(u.xBounds(t)),e.y=e.y.scale(u.yBounds(t)),e}return e.x=e.x.scale(t.width),e.y=e.y.scale(t.height),e}reBound(t){const e=this.copy();return e.x=this.x.reBound(u.xBounds(t)),e.y=this.y.reBound(u.yBounds(t)),e}clamp(t){const e=this.copy();return e.x=this.x.clamp(u.xBounds(t)),e.y=this.y.clamp(u.yBounds(t)),e}copy(){const t=new c;return t.currRoot=this.currRoot,t.x=this.x,t.y=this.y,t}reverse(){const t=this.copy();return t.x=this.x.reverse(),t.y=this.y.reverse(),t}pos(t){return{x:this.x.pos(t.x),y:this.y.pos(t.y)}}dim(t){return{x:this.x.dim(t.x),y:this.y.dim(t.y)}}box(t){return u.construct(this.pos(t.one),this.pos(t.two),0,0,this.currRoot??t.root)}get transform(){return{scale:this.dim({x:1,y:1}),offset:this.pos({x:0,y:0})}}static IDENTITY=new c}const I=Object.freeze(Object.defineProperty({__proto__:null,Scale:i,XY:c,crudeXYTransform:B,transform:g},Symbol.toStringTag,{value:"Module"}));exports.clamp=f;exports.scale=I;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { z as p } from "zod";
|
|
2
|
-
import { c as l } from "./bounds-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { b as d, c as B } from "./xy-
|
|
2
|
+
import { c as l } from "./bounds-BQqppNFf.js";
|
|
3
|
+
import { i as w, x as y, y as h, c as g } from "./box-DRH5SOaY.js";
|
|
4
|
+
import { x as v } from "./location-CGLioInQ.js";
|
|
5
|
+
import { b as d, c as B } from "./xy-CBuhMaIo.js";
|
|
6
6
|
const R = (n, t, e) => t !== void 0 && n < t ? t : e !== void 0 && n > e ? e : n, T = p.object({ offset: d, scale: d }), E = p.object({ offset: p.number(), scale: p.number() }), I = (n) => (t, e, s, r) => e === "dimension" ? [t, s] : [
|
|
7
7
|
t,
|
|
8
8
|
r ? s - n : s + n
|
package/dist/scale.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./scale-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./scale-76Azh2EE.cjs");exports.scale=e.scale;
|
package/dist/scale.js
CHANGED