@synnaxlabs/x 0.38.1 → 0.40.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/.turbo/turbo-build.log +40 -40
- package/dist/{base-B48bPNx5.cjs → base-BAM2mqCy.cjs} +1 -1
- package/dist/{base-DnZzEvvz.js → base-DFq0vvGn.js} +7 -7
- package/dist/{bounds-8aFLdbEj.cjs → bounds-Dwq6ZFHm.cjs} +1 -1
- package/dist/{bounds-BtccGJW0.js → bounds-azUOoVVR.js} +1 -1
- package/dist/bounds.cjs +1 -1
- package/dist/bounds.js +1 -1
- package/dist/box-Bzya27QS.cjs +1 -0
- package/dist/box-DrsrRNSe.js +201 -0
- package/dist/box.cjs +1 -1
- package/dist/box.js +1 -1
- package/dist/deep.cjs +1 -1
- package/dist/deep.js +77 -74
- package/dist/{dimensions-D-1PnJVI.js → dimensions-CRgergMS.js} +1 -1
- package/dist/{dimensions-zMcb9pMk.cjs → dimensions-PWy5QZoM.cjs} +1 -1
- package/dist/dimensions.cjs +1 -1
- package/dist/dimensions.js +1 -1
- package/dist/{direction-CScbfCdT.js → direction-BL0PhD1k.js} +1 -1
- package/dist/{direction-D7qoo_GJ.cjs → direction-C-b6XTeU.cjs} +1 -1
- package/dist/direction.cjs +1 -1
- package/dist/direction.js +1 -1
- package/dist/{external-CtAt3tnU.js → external-BPgtxa8d.js} +8 -8
- package/dist/external-C8TFju8Q.js +29 -0
- package/dist/external-CvWr1nhS.cjs +1 -0
- package/dist/external-uXk0Avrg.cjs +1 -0
- package/dist/index.cjs +4 -2
- package/dist/index.js +237 -197
- package/dist/{location-BIet4Mig.cjs → location-BgpQ3rN2.cjs} +1 -1
- package/dist/{location-BVkZhfQG.js → location-BuYbIFHD.js} +5 -5
- package/dist/location.cjs +1 -1
- package/dist/location.js +1 -1
- package/dist/position-DTrNGtrm.cjs +1 -0
- package/dist/position-DemzGvAY.js +85 -0
- package/dist/position.cjs +1 -1
- package/dist/position.js +1 -1
- package/dist/runtime.cjs +1 -1
- package/dist/runtime.js +1 -1
- package/dist/{scale-D_UMXSZN.js → scale-C0EllH-1.js} +4 -4
- package/dist/{scale-Bzjm1mhv.cjs → scale-DpJM6__6.cjs} +1 -1
- package/dist/scale.cjs +1 -1
- package/dist/scale.js +1 -1
- package/dist/series-BgoCtU71.cjs +11 -0
- package/dist/{series-Cwc_z2OS.js → series-CXnO-P0V.js} +335 -333
- package/dist/{spatial-DozyssiN.js → spatial-BSWPzMkK.js} +1 -1
- package/dist/{spatial-BOhaO8xN.cjs → spatial-DGpZ2sO3.cjs} +1 -1
- package/dist/spatial.cjs +1 -1
- package/dist/spatial.js +9 -9
- package/dist/src/breaker/breaker.d.ts.map +1 -1
- package/dist/src/caseconv/caseconv.d.ts.map +1 -1
- package/dist/src/change/change.d.ts.map +1 -1
- package/dist/src/clamp/clamp.d.ts.map +1 -1
- package/dist/src/compare/compare.d.ts.map +1 -1
- package/dist/src/control/control.d.ts +4 -2
- package/dist/src/control/control.d.ts.map +1 -1
- package/dist/src/debounce/debounce.d.ts.map +1 -1
- package/dist/src/deep/copy.d.ts.map +1 -1
- package/dist/src/deep/delete.d.ts +1 -1
- package/dist/src/deep/delete.d.ts.map +1 -1
- package/dist/src/deep/difference.d.ts.map +1 -1
- package/dist/src/deep/equal.d.ts.map +1 -1
- package/dist/src/deep/merge.d.ts.map +1 -1
- package/dist/src/deep/path.d.ts.map +1 -1
- package/dist/src/id/id.d.ts +6 -1
- package/dist/src/id/id.d.ts.map +1 -1
- package/dist/src/id/id.spec.d.ts +2 -0
- package/dist/src/id/id.spec.d.ts.map +1 -0
- package/dist/src/identity.d.ts.map +1 -1
- package/dist/src/index.d.ts +2 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/invert.d.ts.map +1 -1
- package/dist/src/jsonrpc/index.d.ts +2 -0
- package/dist/src/jsonrpc/index.d.ts.map +1 -0
- package/dist/src/jsonrpc/jsonrpc.d.ts +36 -0
- package/dist/src/jsonrpc/jsonrpc.d.ts.map +1 -0
- package/dist/src/jsonrpc/jsonrpc.spec.d.ts +2 -0
- package/dist/src/jsonrpc/jsonrpc.spec.d.ts.map +1 -0
- package/dist/src/link/link.d.ts.map +1 -1
- package/dist/src/math/math.d.ts.map +1 -1
- package/dist/src/migrate/migrate.d.ts.map +1 -1
- package/dist/src/primitive.d.ts.map +1 -1
- package/dist/src/record.d.ts.map +1 -1
- package/dist/src/renderable.d.ts.map +1 -1
- package/dist/src/shallowCopy.d.ts.map +1 -1
- package/dist/src/sleep/sleep.d.ts.map +1 -1
- package/dist/src/spatial/base.d.ts +1 -1
- package/dist/src/spatial/base.d.ts.map +1 -1
- package/dist/src/spatial/bounds/bounds.d.ts.map +1 -1
- package/dist/src/spatial/box/box.d.ts.map +1 -1
- package/dist/src/spatial/dimensions/dimensions.d.ts.map +1 -1
- package/dist/src/spatial/direction/direction.d.ts +1 -1
- package/dist/src/spatial/direction/direction.d.ts.map +1 -1
- package/dist/src/spatial/location/location.d.ts.map +1 -1
- package/dist/src/spatial/position/position.d.ts.map +1 -1
- package/dist/src/spatial/xy/xy.d.ts.map +1 -1
- package/dist/src/strings/strings.d.ts +6 -6
- package/dist/src/strings/strings.d.ts.map +1 -1
- package/dist/src/telem/generate.d.ts.map +1 -1
- package/dist/src/telem/series.d.ts +7 -8
- package/dist/src/telem/series.d.ts.map +1 -1
- package/dist/src/telem/telem.d.ts +1 -0
- package/dist/src/telem/telem.d.ts.map +1 -1
- package/dist/src/testutil/testutil.d.ts.map +1 -1
- package/dist/src/toArray.d.ts.map +1 -1
- package/dist/src/unique/unique.d.ts +2 -2
- package/dist/src/unique/unique.d.ts.map +1 -1
- package/dist/src/url/url.d.ts.map +1 -1
- package/dist/src/zod/external.d.ts +3 -0
- package/dist/src/zod/external.d.ts.map +1 -0
- package/dist/src/zod/index.d.ts +2 -0
- package/dist/src/zod/index.d.ts.map +1 -0
- package/dist/src/zod/integer.d.ts +10 -0
- package/dist/src/zod/integer.d.ts.map +1 -0
- package/dist/src/zod/integer.spec.d.ts +2 -0
- package/dist/src/zod/integer.spec.d.ts.map +1 -0
- package/dist/src/{zodutil/zodutil.d.ts → zod/util.d.ts} +1 -2
- package/dist/src/zod/util.d.ts.map +1 -0
- package/dist/src/zod/util.spec.d.ts +2 -0
- package/dist/src/zod/util.spec.d.ts.map +1 -0
- package/dist/telem.cjs +1 -1
- package/dist/telem.js +1 -1
- package/dist/url.cjs +1 -1
- package/dist/url.js +5 -5
- package/dist/{xy-DxjPL2DZ.js → xy-DHBO1dG_.js} +4 -4
- package/dist/{xy-Budz-qz-.cjs → xy-DyQSETQZ.cjs} +1 -1
- package/dist/xy.cjs +1 -1
- package/dist/xy.js +1 -1
- package/dist/zod.cjs +1 -0
- package/dist/zod.js +4 -0
- package/package.json +12 -10
- package/src/binary/rpc.txt +39 -0
- package/src/control/control.ts +10 -2
- package/src/deep/merge.spec.ts +27 -1
- package/src/deep/merge.ts +9 -3
- package/src/id/id.spec.ts +40 -0
- package/src/id/id.ts +9 -2
- package/src/index.ts +2 -1
- package/src/{zodutil → jsonrpc}/index.ts +1 -1
- package/src/jsonrpc/jsonrpc.spec.ts +125 -0
- package/src/jsonrpc/jsonrpc.ts +92 -0
- package/src/spatial/base.ts +1 -1
- package/src/spatial/bounds/bounds.spec.ts +1 -1
- package/src/strings/strings.spec.ts +14 -14
- package/src/strings/strings.ts +19 -17
- package/src/telem/generate.ts +1 -1
- package/src/telem/series.spec.ts +45 -3
- package/src/telem/series.ts +15 -16
- package/src/telem/telem.ts +8 -1
- package/src/unique/unique.ts +2 -2
- package/src/zod/external.ts +11 -0
- package/src/zod/index.ts +10 -0
- package/src/zod/integer.spec.ts +148 -0
- package/src/zod/integer.ts +38 -0
- package/src/{zodutil/zodutil.spec.ts → zod/util.spec.ts} +8 -8
- package/src/{zodutil/zodutil.ts → zod/util.ts} +1 -3
- package/tsconfig.tsbuildinfo +1 -1
- package/vite.config.ts +1 -1
- package/dist/box-DPJAbf32.js +0 -201
- package/dist/box-Daep7oxr.cjs +0 -1
- package/dist/external-DSKjMZ7J.cjs +0 -1
- package/dist/position-96CBRKEd.cjs +0 -1
- package/dist/position-uVDP52PM.js +0 -85
- package/dist/series-DuOxifEy.cjs +0 -11
- package/dist/src/zodutil/index.d.ts +0 -2
- package/dist/src/zodutil/index.d.ts.map +0 -1
- package/dist/src/zodutil/zodutil.d.ts.map +0 -1
- package/dist/src/zodutil/zodutil.spec.d.ts +0 -2
- package/dist/src/zodutil/zodutil.spec.d.ts.map +0 -1
- package/dist/zodutil-BfrF8jE3.js +0 -23
- package/dist/zodutil-DFJyyQd2.cjs +0 -1
- package/dist/zodutil.cjs +0 -1
- package/dist/zodutil.js +0 -4
package/dist/index.js
CHANGED
|
@@ -1,266 +1,306 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { c as
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import { d as
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
)
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
1
|
+
var T = Object.defineProperty;
|
|
2
|
+
var j = (e, t, r) => t in e ? T(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
|
+
var g = (e, t, r) => j(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
|
+
import { J as _ } from "./index-C3QzbIwt.js";
|
|
5
|
+
import { e as le } from "./index-C3QzbIwt.js";
|
|
6
|
+
import { z as l } from "zod";
|
|
7
|
+
import { a as b } from "./series-CXnO-P0V.js";
|
|
8
|
+
import { c as ue, D as me, M as de, R as ge, S as pe, d as he, b as be, T as xe, g as Se, f as ye, h as we, i as ve, e as Me, s as $e, t as Ee } from "./series-CXnO-P0V.js";
|
|
9
|
+
import { a as je } from "./index-DizUWH6z.js";
|
|
10
|
+
import { c as Oe } from "./change-DLl6DccR.js";
|
|
11
|
+
import { c as ke, s as Le } from "./scale-C0EllH-1.js";
|
|
12
|
+
import { i as O, a as A, b as k, L as y, G as w, E as L } from "./index-BVC_8Cg9.js";
|
|
13
|
+
import { c as Re, d as Ce, p as ze } from "./index-BVC_8Cg9.js";
|
|
14
|
+
import { debounce as Ue, throttle as Be } from "./debounce.js";
|
|
15
|
+
import { deep as Ie } from "./deep.js";
|
|
16
|
+
import { isObject as Ze } from "./identity.js";
|
|
17
|
+
import { e as Je } from "./external-DqPrWKvU.js";
|
|
18
|
+
import { link as qe } from "./link.js";
|
|
19
|
+
import { b as He, f as Qe } from "./bounds-azUOoVVR.js";
|
|
20
|
+
import { observe as Xe } from "./observe.js";
|
|
21
|
+
import { getEntries as er, mapValues as rr, unknownRecordZ as tr } from "./record.js";
|
|
22
|
+
import { e as nr } from "./external-BPgtxa8d.js";
|
|
23
|
+
import { Search as ar } from "./search.js";
|
|
24
|
+
import { b as cr } from "./box-DrsrRNSe.js";
|
|
25
|
+
import { d as fr } from "./dimensions-CRgergMS.js";
|
|
26
|
+
import { d as mr } from "./direction-BL0PhD1k.js";
|
|
27
|
+
import { l as gr } from "./location-BuYbIFHD.js";
|
|
28
|
+
import { p as hr } from "./position-DemzGvAY.js";
|
|
29
|
+
import { s as xr } from "./spatial-BSWPzMkK.js";
|
|
30
|
+
import { x as yr } from "./xy-DHBO1dG_.js";
|
|
31
|
+
import { nullToArr as vr, toArray as Mr } from "./toArray.js";
|
|
32
|
+
import { u as Er } from "./index-D4NCYiQB.js";
|
|
33
|
+
import { URL as jr, buildQueryString as _r } from "./url.js";
|
|
34
|
+
import { RoutedWorker as Ar, TypedWorker as kr, createMockWorkers as Lr } from "./worker.js";
|
|
35
|
+
import { e as Rr } from "./external-C8TFju8Q.js";
|
|
36
|
+
const N = async (e) => await new Promise(
|
|
37
|
+
(t) => setTimeout(t, b.fromMilliseconds(e).milliseconds)
|
|
38
|
+
), R = l.object({
|
|
39
|
+
interval: b.z.optional(),
|
|
40
|
+
maxRetries: l.number().optional(),
|
|
41
|
+
scale: l.number().optional()
|
|
42
|
+
}), C = (e = {}) => {
|
|
43
|
+
const t = e.sleepFn || N, r = e.maxRetries ?? 5, o = e.scale ?? 1;
|
|
44
|
+
let a = 0, i = new b(e.interval ?? b.milliseconds(1));
|
|
45
|
+
return async () => a >= r ? !1 : (await t(i), i = i.mult(o), a++, !0);
|
|
46
|
+
}, X = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
46
47
|
__proto__: null,
|
|
47
|
-
breakerConfig:
|
|
48
|
-
create:
|
|
48
|
+
breakerConfig: R,
|
|
49
|
+
create: C
|
|
49
50
|
}, Symbol.toStringTag, { value: "Module" })), u = class u extends Number {
|
|
50
51
|
};
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
g(u, "ABSOLUTE", 255), g(u, "MINIMUM", 0), g(u, "BOUNDS", {
|
|
53
|
+
lower: u.MINIMUM,
|
|
54
|
+
// upper bound is exclusive, so we add 1
|
|
55
|
+
upper: u.ABSOLUTE + 1
|
|
56
|
+
}), g(u, "z", l.union([
|
|
57
|
+
l.instanceof(u),
|
|
58
|
+
l.number().int().min(0).max(255).transform((t) => new u(t)),
|
|
59
|
+
l.instanceof(Number).transform((t) => new u(t))
|
|
55
60
|
]));
|
|
56
|
-
let
|
|
57
|
-
const
|
|
58
|
-
name:
|
|
59
|
-
key:
|
|
60
|
-
}),
|
|
61
|
-
subject:
|
|
61
|
+
let x = u;
|
|
62
|
+
const $ = l.object({
|
|
63
|
+
name: l.string(),
|
|
64
|
+
key: l.string()
|
|
65
|
+
}), z = (e) => l.object({
|
|
66
|
+
subject: $,
|
|
62
67
|
resource: e,
|
|
63
|
-
authority:
|
|
68
|
+
authority: x.z
|
|
64
69
|
}), P = (...e) => (t) => t.filter((r) => {
|
|
65
|
-
let
|
|
66
|
-
return r.to != null && (
|
|
67
|
-
}),
|
|
70
|
+
let o = !1;
|
|
71
|
+
return r.to != null && (o = e.includes(r.to.resource)), r.from != null && !o && (o = e.includes(r.from.resource)), o;
|
|
72
|
+
}), Y = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
68
73
|
__proto__: null,
|
|
69
|
-
Authority:
|
|
74
|
+
Authority: x,
|
|
70
75
|
filterTransfersByChannelKey: P,
|
|
71
|
-
stateZ:
|
|
72
|
-
subjectZ:
|
|
73
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
76
|
+
stateZ: z,
|
|
77
|
+
subjectZ: $
|
|
78
|
+
}, Symbol.toStringTag, { value: "Module" })), d = class d extends Error {
|
|
74
79
|
constructor() {
|
|
75
|
-
super(
|
|
80
|
+
super(d.MESSAGE);
|
|
76
81
|
}
|
|
77
82
|
/** Returns true if the error or message is a cancellation error" */
|
|
78
83
|
matches(t) {
|
|
79
|
-
return typeof t == "string" ? t.includes(
|
|
84
|
+
return typeof t == "string" ? t.includes(d.MESSAGE) : t instanceof d || t.message.includes(d.MESSAGE);
|
|
80
85
|
}
|
|
81
86
|
};
|
|
82
|
-
|
|
83
|
-
let v =
|
|
84
|
-
const
|
|
87
|
+
g(d, "MESSAGE", "canceled");
|
|
88
|
+
let v = d;
|
|
89
|
+
const U = new v(), ee = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
90
|
+
__proto__: null,
|
|
91
|
+
CANCELED: U
|
|
92
|
+
}, Symbol.toStringTag, { value: "Module" })), re = (e) => e ? -1 : 1, B = (e) => {
|
|
93
|
+
const t = new TextDecoder();
|
|
94
|
+
let r = new Uint8Array(0), o = null;
|
|
95
|
+
return (a) => {
|
|
96
|
+
let i;
|
|
97
|
+
typeof a == "string" ? i = new TextEncoder().encode(a) : a instanceof ArrayBuffer ? i = new Uint8Array(a) : i = a;
|
|
98
|
+
const f = new Uint8Array(r.length + i.length);
|
|
99
|
+
for (f.set(r), f.set(i, r.length), r = f; r.length > 0; ) {
|
|
100
|
+
if (o === null) {
|
|
101
|
+
const s = t.decode(r).match(/^Content-Length: (\d+)\r?\n\r?\n/);
|
|
102
|
+
if (!s) break;
|
|
103
|
+
o = parseInt(s[1]);
|
|
104
|
+
const n = new TextEncoder().encode(s[0]).length;
|
|
105
|
+
r = r.slice(n);
|
|
106
|
+
}
|
|
107
|
+
if (o !== null && r.length >= o) {
|
|
108
|
+
const m = r.slice(0, o);
|
|
109
|
+
r = r.slice(o), o = null;
|
|
110
|
+
const s = t.decode(m), n = _.decodeString(s);
|
|
111
|
+
e(n);
|
|
112
|
+
} else break;
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
}, D = (e) => {
|
|
116
|
+
const t = JSON.stringify(e);
|
|
117
|
+
return `Content-Length: ${new TextEncoder().encode(t).length}\r
|
|
118
|
+
\r
|
|
119
|
+
` + t;
|
|
120
|
+
}, te = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
85
121
|
__proto__: null,
|
|
86
|
-
|
|
87
|
-
|
|
122
|
+
encodeMessage: D,
|
|
123
|
+
streamDecodeChunks: B
|
|
124
|
+
}, Symbol.toStringTag, { value: "Module" })), M = l.string().regex(/^\d+\.\d+\.\d+$/), p = (e, t, r = {}) => {
|
|
88
125
|
r.checkMajor ?? (r.checkMajor = !0), r.checkMinor ?? (r.checkMinor = !0), r.checkPatch ?? (r.checkPatch = !0);
|
|
89
|
-
const
|
|
126
|
+
const o = M.parse(e), a = M.parse(t), [i, f, m] = o.split(".").map(Number), [s, n, c] = a.split(".").map(Number);
|
|
90
127
|
if (r.checkMajor) {
|
|
91
|
-
if (
|
|
92
|
-
if (
|
|
128
|
+
if (i < s) return y;
|
|
129
|
+
if (i > s) return w;
|
|
93
130
|
}
|
|
94
131
|
if (r.checkMinor) {
|
|
95
|
-
if (f <
|
|
96
|
-
if (f >
|
|
132
|
+
if (f < n) return y;
|
|
133
|
+
if (f > n) return w;
|
|
97
134
|
}
|
|
98
135
|
if (r.checkPatch) {
|
|
99
|
-
if (
|
|
100
|
-
if (
|
|
136
|
+
if (m < c) return y;
|
|
137
|
+
if (m > c) return w;
|
|
101
138
|
}
|
|
102
|
-
return
|
|
103
|
-
},
|
|
139
|
+
return L;
|
|
140
|
+
}, I = (e, t, r = {}) => O(p(e, t, r)), E = (e, t, r = {}) => A(p(e, t, r)), G = (e, t, r = {}) => k(p(e, t, r)), Z = ({
|
|
104
141
|
name: e,
|
|
105
142
|
migrate: t
|
|
106
143
|
}) => (r) => {
|
|
107
144
|
try {
|
|
108
|
-
const
|
|
109
|
-
return console.log(`${e} migrated: ${r.version} -> ${
|
|
110
|
-
} catch (
|
|
111
|
-
throw console.log(`${e} failed to migrate from ${r.version}`), console.error(
|
|
145
|
+
const o = t(r);
|
|
146
|
+
return console.log(`${e} migrated: ${r.version} -> ${o.version}`), o;
|
|
147
|
+
} catch (o) {
|
|
148
|
+
throw console.log(`${e} failed to migrate from ${r.version}`), console.error(o), o;
|
|
112
149
|
}
|
|
113
150
|
}, V = ({
|
|
114
151
|
name: e,
|
|
115
152
|
migrations: t,
|
|
116
153
|
targetSchema: r,
|
|
117
|
-
defaultVersion:
|
|
118
|
-
def:
|
|
154
|
+
defaultVersion: o,
|
|
155
|
+
def: a
|
|
119
156
|
}) => {
|
|
120
|
-
const
|
|
121
|
-
if (
|
|
122
|
-
return (
|
|
123
|
-
if (
|
|
157
|
+
const i = Object.keys(t).sort(p).pop();
|
|
158
|
+
if (i == null)
|
|
159
|
+
return (n) => {
|
|
160
|
+
if (n.version ?? (n.version = o), n.version !== a.version)
|
|
124
161
|
return console.log(
|
|
125
|
-
`${e} version ${
|
|
162
|
+
`${e} version ${n.version} is newer than latest version of ${a.version}.
|
|
126
163
|
Returning default instead.
|
|
127
164
|
`
|
|
128
|
-
),
|
|
165
|
+
), a;
|
|
129
166
|
try {
|
|
130
|
-
return r != null ? r.parse(
|
|
131
|
-
} catch (
|
|
132
|
-
return console.log(`${e} failed to parse default. Exiting with default`), console.error(
|
|
167
|
+
return r != null ? r.parse(n) : n;
|
|
168
|
+
} catch (c) {
|
|
169
|
+
return console.log(`${e} failed to parse default. Exiting with default`), console.error(c), a;
|
|
133
170
|
}
|
|
134
171
|
};
|
|
135
172
|
const f = Object.keys(t).length;
|
|
136
|
-
let
|
|
137
|
-
const
|
|
173
|
+
let m = !1;
|
|
174
|
+
const s = (n) => {
|
|
138
175
|
try {
|
|
139
|
-
if (f === 0 ||
|
|
140
|
-
return console.log(
|
|
141
|
-
const
|
|
142
|
-
return
|
|
143
|
-
} catch (
|
|
176
|
+
if (f === 0 || E(n.version, i))
|
|
177
|
+
return console.log(m ? `${e} ${n.version} now up to date` : `${e} version ${n.version} is up to date with target version ${a.version}`), n;
|
|
178
|
+
const c = n.version, h = t[c], S = h(n);
|
|
179
|
+
return m = !0, s(S);
|
|
180
|
+
} catch (c) {
|
|
144
181
|
return console.log(
|
|
145
|
-
`${e} failed to migrate from ${
|
|
146
|
-
), console.error(
|
|
182
|
+
`${e} failed to migrate from ${n.version} to ${i}`
|
|
183
|
+
), console.error(c), a;
|
|
147
184
|
}
|
|
148
185
|
};
|
|
149
|
-
return (
|
|
186
|
+
return (n) => {
|
|
150
187
|
try {
|
|
151
|
-
if (
|
|
152
|
-
if (
|
|
188
|
+
if (n.version == null)
|
|
189
|
+
if (o != null)
|
|
153
190
|
console.log(
|
|
154
|
-
`${e} version is null. Setting version to default of ${
|
|
155
|
-
),
|
|
191
|
+
`${e} version is null. Setting version to default of ${o}`
|
|
192
|
+
), n.version = o;
|
|
156
193
|
else
|
|
157
194
|
return console.log(
|
|
158
195
|
`${e} version is null and no default version set. Exiting with default`
|
|
159
|
-
),
|
|
160
|
-
return
|
|
161
|
-
} catch (
|
|
162
|
-
return console.log(`${e} failed to parse final result. Exiting with default`), console.error(
|
|
196
|
+
), a;
|
|
197
|
+
return s(n);
|
|
198
|
+
} catch (c) {
|
|
199
|
+
return console.log(`${e} failed to parse final result. Exiting with default`), console.error(c), a;
|
|
163
200
|
}
|
|
164
201
|
};
|
|
165
|
-
},
|
|
202
|
+
}, oe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
166
203
|
__proto__: null,
|
|
167
|
-
compareSemVer:
|
|
204
|
+
compareSemVer: p,
|
|
168
205
|
createMigration: Z,
|
|
169
206
|
migrator: V,
|
|
170
|
-
semVerNewer:
|
|
171
|
-
semVerOlder:
|
|
172
|
-
semVerZ:
|
|
173
|
-
versionsEqual:
|
|
174
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
207
|
+
semVerNewer: E,
|
|
208
|
+
semVerOlder: G,
|
|
209
|
+
semVerZ: M,
|
|
210
|
+
versionsEqual: I
|
|
211
|
+
}, Symbol.toStringTag, { value: "Module" })), ne = (e) => {
|
|
175
212
|
if (e === void 0 || typeof e == "string" || typeof e == "number")
|
|
176
213
|
return e;
|
|
177
214
|
if (e.toString === void 0) throw new Error("invalid renderer");
|
|
178
215
|
return e.toString();
|
|
179
|
-
},
|
|
216
|
+
}, se = (e) => Array.isArray(e) ? [...e] : typeof e == "object" && e !== null ? { ...e } : e, J = (e, t = "") => {
|
|
180
217
|
const r = e.length;
|
|
181
218
|
return r === 0 ? t : r === 1 ? e[0] : r === 2 ? `${e[0]} and ${e[1]}` : `${e.slice(0, -1).join(", ")}, and ${e[r - 1]}`;
|
|
182
219
|
}, W = (e) => {
|
|
183
|
-
const t = e.split(" "), r = /* @__PURE__ */ new Set(),
|
|
184
|
-
r.add(
|
|
185
|
-
const
|
|
186
|
-
e.match(
|
|
187
|
-
if (
|
|
188
|
-
const
|
|
189
|
-
r.add(
|
|
220
|
+
const t = e.split(" "), r = /* @__PURE__ */ new Set(), o = t.map((s) => s.charAt(0).toLowerCase()).join("");
|
|
221
|
+
r.add(o.replace(/-/g, "_")), r.add(o.replace(/(.)(.)/g, "$1_$2").replace(/-/g, "_"));
|
|
222
|
+
const a = /\d+/g;
|
|
223
|
+
e.match(a) && t.forEach((s, n) => {
|
|
224
|
+
if (a.test(s)) {
|
|
225
|
+
const c = t.map((h, S) => S !== n ? h.charAt(0).toLowerCase() : h).join("");
|
|
226
|
+
r.add(c.replace(/-/g, "_")), r.add(
|
|
227
|
+
c.replace(/(.)(.)/g, "$1_$2").replace(/-/g, "_")
|
|
228
|
+
);
|
|
190
229
|
}
|
|
191
230
|
});
|
|
192
231
|
const f = t.map(
|
|
193
|
-
(
|
|
232
|
+
(s) => (s.length > 3 ? s.substring(0, 3) : s).toLowerCase()
|
|
194
233
|
);
|
|
195
|
-
return r.add(f.join("")), r.add(f.join("_")), Array.from(r).filter(
|
|
196
|
-
(
|
|
234
|
+
return r.add(f.join("").replace(/-/g, "_")), r.add(f.join("_").replace(/-/g, "_")), Array.from(r).filter(
|
|
235
|
+
(s) => s.length >= 2 && s.length <= 12 && !/^\d/.test(s)
|
|
197
236
|
);
|
|
198
|
-
},
|
|
237
|
+
}, ae = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
199
238
|
__proto__: null,
|
|
200
|
-
|
|
201
|
-
naturalLanguageJoin:
|
|
239
|
+
createShortIdentifiers: W,
|
|
240
|
+
naturalLanguageJoin: J
|
|
202
241
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
203
242
|
export {
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
243
|
+
ue as DataType,
|
|
244
|
+
me as Density,
|
|
245
|
+
de as MultiSeries,
|
|
246
|
+
ge as Rate,
|
|
247
|
+
Ar as RoutedWorker,
|
|
248
|
+
ar as Search,
|
|
249
|
+
pe as Series,
|
|
250
|
+
he as Size,
|
|
251
|
+
be as TimeRange,
|
|
252
|
+
b as TimeSpan,
|
|
253
|
+
xe as TimeStamp,
|
|
254
|
+
kr as TypedWorker,
|
|
255
|
+
jr as URL,
|
|
256
|
+
Se as addSamples,
|
|
257
|
+
le as binary,
|
|
258
|
+
He as bounds,
|
|
259
|
+
cr as box,
|
|
260
|
+
X as breaker,
|
|
261
|
+
_r as buildQueryString,
|
|
262
|
+
je as caseconv,
|
|
263
|
+
Oe as change,
|
|
264
|
+
ke as clamp,
|
|
265
|
+
Re as compare,
|
|
266
|
+
Y as control,
|
|
267
|
+
ye as convertDataType,
|
|
268
|
+
ne as convertRenderV,
|
|
269
|
+
Lr as createMockWorkers,
|
|
270
|
+
Ue as debounce,
|
|
271
|
+
Ie as deep,
|
|
272
|
+
fr as dimensions,
|
|
273
|
+
mr as direction,
|
|
274
|
+
ee as errors,
|
|
275
|
+
er as getEntries,
|
|
276
|
+
we as id,
|
|
277
|
+
re as invert,
|
|
278
|
+
ve as isCrudeSeries,
|
|
279
|
+
Ze as isObject,
|
|
280
|
+
Ce as isStringer,
|
|
281
|
+
Me as isTelemValue,
|
|
282
|
+
te as jsonRPC,
|
|
283
|
+
Je as kv,
|
|
284
|
+
qe as link,
|
|
285
|
+
gr as location,
|
|
286
|
+
rr as mapValues,
|
|
287
|
+
Qe as math,
|
|
288
|
+
oe as migrate,
|
|
289
|
+
vr as nullToArr,
|
|
290
|
+
Xe as observe,
|
|
291
|
+
hr as position,
|
|
292
|
+
ze as primitiveIsZero,
|
|
293
|
+
nr as runtime,
|
|
294
|
+
Le as scale,
|
|
295
|
+
se as shallowCopy,
|
|
296
|
+
$e as sortTimeRange,
|
|
297
|
+
xr as spatial,
|
|
298
|
+
ae as strings,
|
|
299
|
+
Be as throttle,
|
|
300
|
+
Mr as toArray,
|
|
301
|
+
Ee as typedArrayZ,
|
|
302
|
+
Er as unique,
|
|
303
|
+
tr as unknownRecordZ,
|
|
304
|
+
yr as xy,
|
|
305
|
+
Rr as zod
|
|
266
306
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const u=require("zod"),I=require("./index-Dd8DLyMx.cjs"),o=require("./base-
|
|
1
|
+
"use strict";const u=require("zod"),I=require("./index-Dd8DLyMx.cjs"),o=require("./base-BAM2mqCy.cjs"),R=o.xLocation,g=o.yLocation,h=o.centerLocation,d={top:"bottom",right:"left",bottom:"top",left:"right",center:"center"},m={top:"left",right:"top",bottom:"right",left:"bottom",center:"center"},A=o.crudeLocation,s=t=>t instanceof String||!o.DIRECTIONS.includes(t)?t:t==="x"?"left":"top",_=t=>d[s(t)],M=t=>m[s(t)],i=t=>{const n=s(t);return n==="top"||n==="bottom"?"y":"x"},E=u.z.object({x:o.xLocation.or(o.centerLocation),y:o.yLocation.or(o.centerLocation)}),l=u.z.object({x:o.xLocation,y:o.yLocation}),O=Object.freeze({x:"left",y:"top"}),f=Object.freeze({x:"right",y:"top"}),x=Object.freeze({x:"left",y:"bottom"}),a=Object.freeze({x:"right",y:"bottom"}),T=Object.freeze({x:"center",y:"center"}),b=Object.freeze({x:"center",y:"top"}),L=Object.freeze({x:"center",y:"bottom"}),p=Object.freeze({x:"right",y:"center"}),C=Object.freeze({x:"left",y:"center"}),N=Object.freeze([C,p,b,L,O,f,x,a,T]),j=(t,n)=>t.x===n.x&&t.y===n.y,S=(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},z=t=>[t.x,t.y],y=t=>i(s(t))==="x",P=t=>i(s(t))==="y",X=t=>`${t.x}${I.capitalize(t.y)}`,Y=(t,n)=>{let e,c;if(typeof t=="object"&&"x"in t?(e=t.x,c=t.y):(e=s(t),c=s(n??t)),i(e)===i(c)&&e!=="center"&&c!=="center")throw new Error(`[XYLocation] - encountered two locations with the same direction: ${e.toString()} - ${c.toString()}`);const r={...T};return e==="center"?y(c)?[r.x,r.y]=[c,e]:[r.x,r.y]=[e,c]:c==="center"?y(e)?[r.x,r.y]=[e,c]:[r.x,r.y]=[c,e]:y(e)?[r.x,r.y]=[e,c]:[r.x,r.y]=[c,e],r},w=Object.freeze(Object.defineProperty({__proto__:null,BOTTOM_CENTER:L,BOTTOM_LEFT:x,BOTTOM_RIGHT:a,CENTER:T,CENTER_LOCATIONS:o.CENTER_LOCATIONS,LEFT_CENTER:C,RIGHT_CENTER:p,TOP_CENTER:b,TOP_LEFT:O,TOP_RIGHT:f,XY_LOCATIONS:N,X_LOCATIONS:o.X_LOCATIONS,Y_LOCATIONS:o.Y_LOCATIONS,center:h,construct:s,constructXY:Y,corner:l,crude:A,direction:i,isX:y,isY:P,location:o.location,outer:o.outerLocation,rotate90:M,swap:_,x:R,xy:E,xyCouple:z,xyEquals:j,xyMatches:S,xyToString:X,y:g},Symbol.toStringTag,{value:"Module"}));exports.BOTTOM_LEFT=x;exports.BOTTOM_RIGHT=a;exports.CENTER=T;exports.TOP_LEFT=O;exports.TOP_RIGHT=f;exports.XY_LOCATIONS=N;exports.corner=l;exports.location=w;exports.swap=_;exports.xy=E;exports.xyCouple=z;exports.xyEquals=j;exports.xyMatches=S;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z as O } from "zod";
|
|
2
2
|
import { c as m } from "./index-DizUWH6z.js";
|
|
3
|
-
import {
|
|
4
|
-
const N =
|
|
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-DFq0vvGn.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 = a, R = y, I = f, X = {
|
|
|
17
17
|
const o = r(t);
|
|
18
18
|
return o === "top" || o === "bottom" ? "y" : "x";
|
|
19
19
|
}, w = O.object({
|
|
20
|
-
x:
|
|
21
|
-
y:
|
|
22
|
-
}), M = O.object({ x:
|
|
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,
|
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-BgpQ3rN2.cjs");exports.location=o.location;
|
package/dist/location.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const n=require("./box-Bzya27QS.cjs"),T=require("./direction-C-b6XTeU.cjs"),r=require("./location-BgpQ3rN2.cjs"),b=require("./base-BAM2mqCy.cjs"),P=t=>{if(t==null)return{x:void 0,y:void 0};const s=r.xy.safeParse(t);if(s.success)return s.data;const e=b.location.safeParse(t);return e.success?T.construct(e.data)==="x"?{x:e.data,y:void 0}:{x:void 0,y:e.data}:t},N=({container:t,target:s,dialog:e,initial:u,prefer:a,alignments:l=["start"],disable:f=[]})=>{const i=P(u);let x=r.XY_LOCATIONS;if(a!=null){const o=a.map(c=>P(c));x=x.slice().sort((c,p)=>{const d=o.findIndex(g=>r.xyMatches(c,g)),h=o.findIndex(g=>r.xyMatches(p,g));return d>-1&&h>-1?d-h:d>-1?-1:h>-1?1:0})}const O=x.filter(o=>!r.xyEquals(o,r.CENTER)&&(i.x==null||o.x===i.x)&&(i.y==null||o.y===i.y)&&!f.some(c=>r.xyMatches(o,c))).map(o=>l==null?void 0:l.map(c=>[o,c])).flat(),A=n.construct(t),M=n.construct(s),_=n.construct(e);let E=-1/0;const y={location:r.CENTER,adjustedDialog:_};return O.forEach(([o,c])=>{const[p,d]=v({option:o,alignment:c,container:A,target:M,dialog:_});d>E&&(E=d,y.location=o,y.adjustedDialog=p)}),y},v=({option:t,alignment:s,container:e,target:u,dialog:a})=>{const l=L(t,s),f=n.xyLoc(u,t),i=n.constructWithAlternateRoot(f.x,f.y,n.width(a),n.height(a),l,r.TOP_LEFT),x=n.area(n.intersection(i,e));return[i,x]},I={start:"left",center:"center",end:"right"},j={start:"bottom",center:"center",end:"top"},L=(t,s)=>{const e={x:"center",y:"center"};if(t.y!=="center"){e.y=r.swap(t.y);const u=t.x==="left"?r.swap:a=>a;e.x=u(I[s])}else e.x=r.swap(t.x),e.y=j[s];return e},q=Object.freeze(Object.defineProperty({__proto__:null,dialog:N,getRoot:L,parseLocationOptions:P},Symbol.toStringTag,{value:"Module"}));exports.position=q;
|