@synnaxlabs/x 0.43.0 → 0.44.1
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 +105 -93
- package/dist/base-BAM2mqCy.cjs +1 -0
- package/dist/base-DFq0vvGn.js +38 -0
- package/dist/binary.cjs +1 -1
- package/dist/binary.js +1 -1
- package/dist/bounds-D6e9xoHt.cjs +1 -0
- package/dist/bounds-Dj9nG39I.js +174 -0
- package/dist/bounds.cjs +1 -1
- package/dist/bounds.js +2 -2
- package/dist/box-CO_2_DGG.js +209 -0
- package/dist/box-Cxki783Y.cjs +1 -0
- package/dist/box.cjs +1 -1
- package/dist/box.js +1 -1
- package/dist/caseconv.cjs +1 -1
- package/dist/caseconv.js +2 -2
- package/dist/change-C-YELKx6.cjs +1 -0
- package/dist/change-DLl6DccR.js +12 -0
- package/dist/change.cjs +1 -1
- package/dist/change.js +2 -10
- package/dist/compare.cjs +1 -1
- package/dist/compare.js +1 -1
- package/dist/deep.cjs +1 -1
- package/dist/deep.js +95 -96
- package/dist/dimensions-CRgergMS.js +43 -0
- package/dist/dimensions-D2QGoNXO.cjs +1 -0
- package/dist/dimensions.cjs +1 -1
- package/dist/dimensions.js +2 -41
- package/dist/direction-386XDm2w.cjs +1 -0
- package/dist/{index-DxU1zwsd.js → direction-8etxfKaR.js} +4 -3
- package/dist/direction.cjs +1 -1
- package/dist/direction.js +1 -1
- package/dist/external-B9AAGv50.cjs +1 -0
- package/dist/external-BFgJjMcS.js +23 -0
- package/dist/external-BPgtxa8d.js +29 -0
- package/dist/external-BYuXBYJh.js +40 -0
- package/dist/external-mffsMzJx.cjs +1 -0
- package/dist/external-uXk0Avrg.cjs +1 -0
- package/dist/index-B1m2qvBT.cjs +1 -0
- package/dist/{index-4GlOgZuh.js → index-B5l_quQn.js} +35 -42
- package/dist/index-BQe8OIgm.cjs +3 -0
- package/dist/index-D2xcvEO5.js +46 -0
- package/dist/index-DdhM_E4k.cjs +1 -0
- package/dist/index-PNh31WTW.js +125 -0
- package/dist/index.cjs +3 -5
- package/dist/index.js +685 -5363
- package/dist/kv.cjs +1 -1
- package/dist/kv.js +2 -45
- package/dist/{index-D6V-8SKw.js → location-Ar5y2DX2.js} +26 -26
- package/dist/location-DZi8ftXp.cjs +1 -0
- package/dist/location.cjs +1 -1
- package/dist/location.js +1 -1
- package/dist/observe.cjs +1 -1
- package/dist/observe.js +16 -20
- package/dist/path-BXdMenka.js +101 -0
- package/dist/path-st_E5-LJ.cjs +1 -0
- package/dist/position-DSy2hONH.cjs +1 -0
- package/dist/position-PQ6op54I.js +85 -0
- package/dist/position.cjs +1 -1
- package/dist/position.js +2 -83
- package/dist/record-CAcQ5PNX.js +14 -0
- package/dist/record-YvCh7bzB.cjs +1 -0
- package/dist/record.cjs +1 -1
- package/dist/record.js +2 -8
- package/dist/runtime.cjs +1 -1
- package/dist/runtime.js +2 -27
- package/dist/scale-C6qKDbRb.cjs +1 -0
- package/dist/{index-BUa-NXAX.js → scale-EWNUk-bn.js} +55 -59
- package/dist/scale.cjs +1 -1
- package/dist/scale.js +1 -1
- package/dist/{index-DBGAIs_7.js → series-Bn5y1tD1.js} +835 -759
- package/dist/series-CYAhDD6B.cjs +6 -0
- package/dist/spatial-BSWPzMkK.js +11 -0
- package/dist/spatial-DGpZ2sO3.cjs +1 -0
- package/dist/spatial.cjs +1 -1
- package/dist/spatial.js +18 -25
- package/dist/src/binary/codec.d.ts +1 -1
- package/dist/src/binary/codec.d.ts.map +1 -1
- package/dist/src/breaker/breaker.d.ts +2 -2
- package/dist/src/breaker/breaker.d.ts.map +1 -1
- package/dist/src/caseconv/caseconv.d.ts +0 -1
- package/dist/src/caseconv/caseconv.d.ts.map +1 -1
- package/dist/src/change/change.d.ts +1 -1
- package/dist/src/change/change.d.ts.map +1 -1
- package/dist/src/color/color.d.ts +2 -2
- package/dist/src/color/color.d.ts.map +1 -1
- package/dist/src/color/gradient.d.ts +1 -1
- package/dist/src/color/gradient.d.ts.map +1 -1
- package/dist/src/color/palette.d.ts +3 -3
- package/dist/src/color/palette.d.ts.map +1 -1
- package/dist/src/compare/compare.d.ts +4 -4
- package/dist/src/compare/compare.d.ts.map +1 -1
- package/dist/src/control/control.d.ts +9 -9
- package/dist/src/control/control.d.ts.map +1 -1
- package/dist/src/deep/merge.d.ts +1 -1
- package/dist/src/deep/merge.d.ts.map +1 -1
- package/dist/src/deep/path.d.ts +6 -6
- package/dist/src/deep/path.d.ts.map +1 -1
- package/dist/src/destructor.d.ts +6 -2
- package/dist/src/destructor.d.ts.map +1 -1
- package/dist/src/errors/errors.d.ts +5 -1
- package/dist/src/errors/errors.d.ts.map +1 -1
- package/dist/src/flush.d.ts +11 -0
- package/dist/src/flush.d.ts.map +1 -0
- package/dist/src/id/id.d.ts +1 -0
- package/dist/src/id/id.d.ts.map +1 -1
- package/dist/src/identity.d.ts +2 -2
- package/dist/src/identity.d.ts.map +1 -1
- package/dist/src/index.d.ts +3 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/jsonrpc/jsonrpc.d.ts +1 -1
- package/dist/src/jsonrpc/jsonrpc.d.ts.map +1 -1
- package/dist/src/kv/types.d.ts +1 -1
- package/dist/src/kv/types.d.ts.map +1 -1
- package/dist/src/map/index.d.ts +2 -0
- package/dist/src/map/index.d.ts.map +1 -0
- package/dist/src/map/map.d.ts +2 -0
- package/dist/src/map/map.d.ts.map +1 -0
- package/dist/src/map/map.spec.d.ts +2 -0
- package/dist/src/map/map.spec.d.ts.map +1 -0
- package/dist/src/math/math.d.ts +2 -4
- package/dist/src/math/math.d.ts.map +1 -1
- package/dist/src/migrate/migrate.d.ts +1 -1
- package/dist/src/migrate/migrate.d.ts.map +1 -1
- package/dist/src/notation/notation.d.ts +1 -1
- package/dist/src/notation/notation.d.ts.map +1 -1
- package/dist/src/optional.d.ts +0 -3
- package/dist/src/optional.d.ts.map +1 -1
- package/dist/src/record/index.d.ts +2 -0
- package/dist/src/record/index.d.ts.map +1 -0
- package/dist/src/record/record.d.ts +90 -0
- package/dist/src/record/record.d.ts.map +1 -0
- package/dist/src/record/record.spec.d.ts.map +1 -0
- package/dist/src/runtime/os.d.ts +1 -1
- package/dist/src/runtime/os.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/box/box.d.ts +2 -1
- package/dist/src/spatial/box/box.d.ts.map +1 -1
- package/dist/src/spatial/dimensions/dimensions.d.ts +1 -1
- package/dist/src/spatial/dimensions/dimensions.d.ts.map +1 -1
- package/dist/src/spatial/direction/direction.d.ts +3 -3
- package/dist/src/spatial/direction/direction.d.ts.map +1 -1
- package/dist/src/spatial/location/location.d.ts +1 -1
- package/dist/src/spatial/location/location.d.ts.map +1 -1
- package/dist/src/spatial/scale/scale.d.ts +1 -1
- package/dist/src/spatial/scale/scale.d.ts.map +1 -1
- package/dist/src/spatial/xy/xy.d.ts +2 -1
- package/dist/src/spatial/xy/xy.d.ts.map +1 -1
- package/dist/src/status/index.d.ts +1 -1
- package/dist/src/status/index.d.ts.map +1 -1
- package/dist/src/status/status.d.ts +42 -0
- package/dist/src/status/status.d.ts.map +1 -0
- package/dist/src/status/status.spec.d.ts +2 -0
- package/dist/src/status/status.spec.d.ts.map +1 -0
- package/dist/src/strings/strings.d.ts +16 -0
- package/dist/src/strings/strings.d.ts.map +1 -1
- package/dist/src/telem/gl.d.ts +1 -1
- package/dist/src/telem/gl.d.ts.map +1 -1
- package/dist/src/telem/series.d.ts +17 -16
- package/dist/src/telem/series.d.ts.map +1 -1
- package/dist/src/telem/telem.d.ts +42 -19
- package/dist/src/telem/telem.d.ts.map +1 -1
- package/dist/src/testutil/testutil.d.ts +1 -0
- package/dist/src/testutil/testutil.d.ts.map +1 -1
- package/dist/src/testutil/testutil.spec.d.ts +2 -0
- package/dist/src/testutil/testutil.spec.d.ts.map +1 -0
- package/dist/src/zod/external.d.ts +1 -0
- package/dist/src/zod/external.d.ts.map +1 -1
- package/dist/src/zod/nullToUndefined.d.ts +1 -1
- package/dist/src/zod/nullToUndefined.d.ts.map +1 -1
- package/dist/src/zod/toArray.d.ts +3 -0
- package/dist/src/zod/toArray.d.ts.map +1 -0
- package/dist/src/zod/toArray.spec.d.ts +2 -0
- package/dist/src/zod/toArray.spec.d.ts.map +1 -0
- package/dist/src/zod/util.d.ts +1 -1
- package/dist/src/zod/util.d.ts.map +1 -1
- package/dist/telem.cjs +1 -1
- package/dist/telem.js +10 -11
- package/dist/url.cjs +1 -1
- package/dist/url.js +16 -19
- package/dist/worker.cjs +1 -1
- package/dist/worker.js +18 -22
- package/dist/xy-CUE3QDNn.cjs +1 -0
- package/dist/{index-C-qYOegc.js → xy-C_-hb3Q2.js} +67 -62
- package/dist/xy.cjs +1 -1
- package/dist/xy.js +1 -1
- package/dist/zod.cjs +1 -1
- package/dist/zod.js +2 -19
- package/package.json +13 -18
- package/src/binary/codec.spec.ts +1 -1
- package/src/binary/codec.ts +1 -1
- package/src/breaker/breaker.ts +1 -1
- package/src/caseconv/caseconv.ts +10 -12
- package/src/change/change.ts +1 -1
- package/src/color/color.ts +1 -1
- package/src/color/gradient.ts +1 -1
- package/src/color/palette.ts +1 -1
- package/src/compare/compare.ts +5 -5
- package/src/control/control.ts +2 -2
- package/src/deep/merge.spec.ts +2 -15
- package/src/deep/merge.ts +1 -1
- package/src/deep/path.spec.ts +41 -0
- package/src/deep/path.ts +48 -17
- package/src/destructor.ts +6 -2
- package/src/errors/errors.spec.ts +20 -20
- package/src/errors/errors.ts +4 -1
- package/src/flush.ts +21 -0
- package/src/id/id.spec.ts +1 -1
- package/src/id/id.ts +3 -1
- package/src/identity.ts +2 -2
- package/src/index.ts +3 -1
- package/src/instance/matcher.spec.ts +7 -7
- package/src/jsonrpc/jsonrpc.ts +1 -1
- package/src/kv/types.ts +1 -1
- package/src/map/index.ts +10 -0
- package/src/map/map.spec.ts +132 -0
- package/src/map/map.ts +17 -0
- package/src/math/math.ts +19 -27
- package/src/migrate/migrate.spec.ts +2 -2
- package/src/migrate/migrate.ts +2 -2
- package/src/notation/notation.ts +1 -1
- package/src/optional.ts +0 -4
- package/src/primitive/primitive.spec.ts +1 -1
- package/src/record/index.ts +10 -0
- package/src/record/record.spec.ts +319 -0
- package/src/record/record.ts +118 -0
- package/src/runtime/os.ts +1 -1
- package/src/spatial/base.ts +1 -1
- package/src/spatial/box/box.ts +6 -1
- package/src/spatial/dimensions/dimensions.ts +1 -1
- package/src/spatial/direction/direction.ts +1 -1
- package/src/spatial/location/location.ts +1 -1
- package/src/spatial/scale/scale.ts +1 -1
- package/src/spatial/xy/xy.ts +6 -1
- package/src/status/index.ts +1 -1
- package/src/status/status.spec.ts +25 -0
- package/src/status/status.ts +91 -0
- package/src/strings/strings.spec.ts +51 -13
- package/src/strings/strings.ts +20 -0
- package/src/telem/gl.ts +1 -1
- package/src/telem/series.spec.ts +193 -53
- package/src/telem/series.ts +53 -18
- package/src/telem/telem.spec.ts +202 -83
- package/src/telem/telem.ts +53 -35
- package/src/testutil/testutil.spec.ts +161 -0
- package/src/testutil/testutil.ts +12 -0
- package/src/zod/external.ts +1 -0
- package/src/zod/nullToUndefined.spec.ts +1 -1
- package/src/zod/nullToUndefined.ts +1 -1
- package/src/zod/toArray.spec.ts +182 -0
- package/src/{status/types.ts → zod/toArray.ts} +3 -12
- package/src/zod/util.spec.ts +2 -2
- package/src/zod/util.ts +3 -3
- package/tsconfig.tsbuildinfo +1 -1
- package/vite.config.ts +1 -2
- package/dist/base-B5lQIJKc.js +0 -38
- package/dist/base-CTq-lhpU.cjs +0 -1
- package/dist/index-B58dnYRu.cjs +0 -1
- package/dist/index-BMGaoK93.cjs +0 -1
- package/dist/index-BTet04Hd.cjs +0 -6
- package/dist/index-C07SBJhr.js +0 -128
- package/dist/index-C9EdKeu1.js +0 -174
- package/dist/index-CM8ZDZ6s.cjs +0 -1
- package/dist/index-CV2JaHfw.cjs +0 -1
- package/dist/index-CeBvOwG8.cjs +0 -3
- package/dist/index-ClrGyGDp.js +0 -205
- package/dist/index-CqQXXeCI.cjs +0 -1
- package/dist/index-DEdq2tza.cjs +0 -1
- package/dist/index-DKMnHBGR.cjs +0 -1
- package/dist/index-Dql5FMcH.js +0 -47
- package/dist/index-WwMnwoLy.cjs +0 -1
- package/dist/path-1tZLZ4AN.cjs +0 -1
- package/dist/path-DD6ytXzr.js +0 -76
- package/dist/schemas-55Usj0Fg.js +0 -3998
- package/dist/schemas-DbXuI2Qr.cjs +0 -27
- package/dist/search.cjs +0 -1
- package/dist/search.js +0 -14
- package/dist/src/record.d.ts +0 -18
- package/dist/src/record.d.ts.map +0 -1
- package/dist/src/record.spec.d.ts.map +0 -1
- package/dist/src/search.d.ts +0 -18
- package/dist/src/search.d.ts.map +0 -1
- package/dist/src/status/types.d.ts +0 -11
- package/dist/src/status/types.d.ts.map +0 -1
- package/src/record.spec.ts +0 -38
- package/src/record.ts +0 -45
- package/src/search.ts +0 -42
- /package/dist/src/{record.spec.d.ts → record/record.spec.d.ts} +0 -0
package/dist/kv.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./external-B9AAGv50.cjs");exports.kv=e.external;
|
package/dist/kv.js
CHANGED
|
@@ -1,47 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
var l = (s, e, t) => e in s ? n(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
|
|
3
|
-
var r = (s, e, t) => l(s, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
-
import { o as a, s as o } from "./schemas-55Usj0Fg.js";
|
|
5
|
-
class c {
|
|
6
|
-
constructor() {
|
|
7
|
-
r(this, "store", /* @__PURE__ */ new Map());
|
|
8
|
-
}
|
|
9
|
-
async get(e) {
|
|
10
|
-
return this.store.get(e) ?? null;
|
|
11
|
-
}
|
|
12
|
-
async set(e, t) {
|
|
13
|
-
this.store.set(e, t);
|
|
14
|
-
}
|
|
15
|
-
async delete(e) {
|
|
16
|
-
this.store.delete(e);
|
|
17
|
-
}
|
|
18
|
-
async length() {
|
|
19
|
-
return this.store.size;
|
|
20
|
-
}
|
|
21
|
-
async clear() {
|
|
22
|
-
this.store.clear();
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
class i {
|
|
26
|
-
constructor() {
|
|
27
|
-
r(this, "store", /* @__PURE__ */ new Map());
|
|
28
|
-
}
|
|
29
|
-
get(e) {
|
|
30
|
-
return this.store.get(e) ?? null;
|
|
31
|
-
}
|
|
32
|
-
set(e, t) {
|
|
33
|
-
this.store.set(e, t);
|
|
34
|
-
}
|
|
35
|
-
delete(e) {
|
|
36
|
-
this.store.delete(e);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
const y = a({ key: o(), value: o() }), u = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
40
|
-
__proto__: null,
|
|
41
|
-
MockAsync: c,
|
|
42
|
-
MockSync: i,
|
|
43
|
-
stringPairZ: y
|
|
44
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
1
|
+
import { e as r } from "./external-BYuXBYJh.js";
|
|
45
2
|
export {
|
|
46
|
-
|
|
3
|
+
r as kv
|
|
47
4
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { z as O } from "zod";
|
|
2
|
+
import { c as m } from "./index-D2xcvEO5.js";
|
|
3
|
+
import { y as f, e as y, f as a, g, D as C, C as h, X as z, Y as L, l as S, h as d } from "./base-DFq0vvGn.js";
|
|
4
4
|
const N = y, R = f, I = a, X = {
|
|
5
5
|
top: "bottom",
|
|
6
6
|
right: "left",
|
|
@@ -13,13 +13,13 @@ const N = y, R = f, I = a, X = {
|
|
|
13
13
|
bottom: "right",
|
|
14
14
|
left: "bottom",
|
|
15
15
|
center: "center"
|
|
16
|
-
}, A = g,
|
|
17
|
-
const o =
|
|
16
|
+
}, A = g, r = (t) => t instanceof String || !C.includes(t) ? t : t === "x" ? "left" : "top", P = (t) => X[r(t)], k = (t) => Y[r(t)], s = (t) => {
|
|
17
|
+
const o = r(t);
|
|
18
18
|
return o === "top" || o === "bottom" ? "y" : "x";
|
|
19
|
-
}, w = O({
|
|
19
|
+
}, w = O.object({
|
|
20
20
|
x: y.or(a),
|
|
21
21
|
y: f.or(a)
|
|
22
|
-
}), M = O({ x: y, y: f }), 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([
|
|
22
|
+
}), M = O.object({ x: y, y: f }), 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,
|
|
@@ -35,14 +35,14 @@ const N = y, R = f, I = a, X = {
|
|
|
35
35
|
return "x" in o && (t.x === o.x || (e = !1)), "y" in o && (t.y === o.y || (e = !1)), e;
|
|
36
36
|
}
|
|
37
37
|
return t.x === o || t.y === o;
|
|
38
|
-
}, F = (t) => [t.x, t.y], i = (t) => s(
|
|
38
|
+
}, F = (t) => [t.x, t.y], i = (t) => s(r(t)) === "x", G = (t) => s(r(t)) === "y", H = (t) => `${t.x}${m(t.y)}`, q = (t, o) => {
|
|
39
39
|
let e, n;
|
|
40
|
-
if (typeof t == "object" && "x" in t ? (e = t.x, n = t.y) : (e =
|
|
40
|
+
if (typeof t == "object" && "x" in t ? (e = t.x, n = t.y) : (e = r(t), n = r(o ?? t)), s(e) === s(n) && e !== "center" && n !== "center")
|
|
41
41
|
throw new Error(
|
|
42
42
|
`[XYLocation] - encountered two locations with the same direction: ${e.toString()} - ${n.toString()}`
|
|
43
43
|
);
|
|
44
|
-
const
|
|
45
|
-
return e === "center" ? i(n) ? [
|
|
44
|
+
const c = { ...x };
|
|
45
|
+
return e === "center" ? i(n) ? [c.x, c.y] = [n, e] : [c.x, c.y] = [e, n] : n === "center" ? i(e) ? [c.x, c.y] = [e, n] : [c.x, c.y] = [n, e] : i(e) ? [c.x, c.y] = [e, n] : [c.x, c.y] = [n, e], c;
|
|
46
46
|
}, K = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
47
47
|
__proto__: null,
|
|
48
48
|
BOTTOM_CENTER: _,
|
|
@@ -50,16 +50,16 @@ 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: h,
|
|
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: z,
|
|
60
|
+
Y_LOCATIONS: L,
|
|
61
61
|
center: I,
|
|
62
|
-
construct:
|
|
62
|
+
construct: r,
|
|
63
63
|
constructXY: q,
|
|
64
64
|
corner: M,
|
|
65
65
|
crude: A,
|
|
@@ -80,20 +80,20 @@ const N = y, R = f, I = a, X = {
|
|
|
80
80
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
81
81
|
export {
|
|
82
82
|
l as B,
|
|
83
|
-
|
|
83
|
+
x as C,
|
|
84
84
|
T,
|
|
85
85
|
$ as X,
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
D as a,
|
|
87
|
+
B as b,
|
|
88
88
|
M as c,
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
89
|
+
F as d,
|
|
90
|
+
p as e,
|
|
91
|
+
b as f,
|
|
92
|
+
_ as g,
|
|
93
|
+
u as h,
|
|
94
|
+
j as i,
|
|
95
|
+
E as j,
|
|
96
96
|
K as l,
|
|
97
97
|
P as s,
|
|
98
|
-
|
|
98
|
+
w as x
|
|
99
99
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const L=require("zod"),S=require("./index-DdhM_E4k.cjs"),o=require("./base-BAM2mqCy.cjs"),z=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",b=t=>d[s(t)],M=t=>m[s(t)],i=t=>{const n=s(t);return n==="top"||n==="bottom"?"y":"x"},C=L.z.object({x:o.xLocation.or(o.centerLocation),y:o.yLocation.or(o.centerLocation)}),N=L.z.object({x:o.xLocation,y:o.yLocation}),y=Object.freeze({x:"left",y:"top"}),f=Object.freeze({x:"right",y:"top"}),x=Object.freeze({x:"left",y:"bottom"}),E=Object.freeze({x:"right",y:"bottom"}),O=Object.freeze({x:"center",y:"center"}),_=Object.freeze({x:"center",y:"top"}),a=Object.freeze({x:"center",y:"bottom"}),u=Object.freeze({x:"right",y:"center"}),l=Object.freeze({x:"left",y:"center"}),p=Object.freeze([l,u,_,a,y,f,x,E,O]),R=(t,n)=>t.x===n.x&&t.y===n.y,j=(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},I=t=>[t.x,t.y],T=t=>i(s(t))==="x",P=t=>i(s(t))==="y",X=t=>`${t.x}${S.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={...O};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},w=Object.freeze(Object.defineProperty({__proto__:null,BOTTOM_CENTER:a,BOTTOM_LEFT:x,BOTTOM_RIGHT:E,CENTER:O,CENTER_LEFT:l,CENTER_LOCATIONS:o.CENTER_LOCATIONS,CENTER_RIGHT:u,TOP_CENTER:_,TOP_LEFT:y,TOP_RIGHT:f,XY_LOCATIONS:p,X_LOCATIONS:o.X_LOCATIONS,Y_LOCATIONS:o.Y_LOCATIONS,center:h,construct:s,constructXY:Y,corner:N,crude:A,direction:i,isX:T,isY:P,location:o.location,outer:o.outerLocation,rotate90:M,swap:b,x:z,xy:C,xyCouple:I,xyEquals:R,xyMatches:j,xyToString:X,y:g},Symbol.toStringTag,{value:"Module"}));exports.BOTTOM_CENTER=a;exports.BOTTOM_LEFT=x;exports.BOTTOM_RIGHT=E;exports.CENTER=O;exports.CENTER_LEFT=l;exports.CENTER_RIGHT=u;exports.TOP_CENTER=_;exports.TOP_LEFT=y;exports.TOP_RIGHT=f;exports.XY_LOCATIONS=p;exports.corner=N;exports.location=w;exports.swap=b;exports.xy=C;exports.xyCouple=I;exports.xyEquals=R;exports.xyMatches=j;
|
package/dist/location.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./location-DZi8ftXp.cjs");exports.location=o.location;
|
package/dist/location.js
CHANGED
package/dist/observe.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class o{handlers;transform;closer;constructor(e,s){this.transform=e,this.handlers=s??new Map}onChange(e){return this.handlers.set(e,null),()=>this.handlers.delete(e)}notify(e){let s=e;if(this.transform!=null){const[r,t]=this.transform(e);if(!t)return;s=r}this.handlers.forEach((r,t)=>t(s))}setCloser(e){this.closer=e}async close(){return await this.closer?.()}}class l{handlers;constructor(e){this.handlers=e??new Map}onChange(e){return this.handlers.set(e,null),()=>this.handlers.delete(e)}notify(e){this.handlers.forEach((s,r)=>r(e))}}const a=Object.freeze(Object.defineProperty({__proto__:null,BaseObserver:l,Observer:o},Symbol.toStringTag,{value:"Module"}));exports.observe=a;
|
package/dist/observe.js
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
class l {
|
|
2
|
+
handlers;
|
|
3
|
+
transform;
|
|
4
|
+
closer;
|
|
5
5
|
constructor(e, s) {
|
|
6
|
-
t(this, "handlers");
|
|
7
|
-
t(this, "transform");
|
|
8
|
-
t(this, "closer");
|
|
9
6
|
this.transform = e, this.handlers = s ?? /* @__PURE__ */ new Map();
|
|
10
7
|
}
|
|
11
8
|
/** Implements the observable interface. */
|
|
@@ -16,37 +13,36 @@ class h {
|
|
|
16
13
|
notify(e) {
|
|
17
14
|
let s = e;
|
|
18
15
|
if (this.transform != null) {
|
|
19
|
-
const [
|
|
20
|
-
if (!
|
|
21
|
-
s =
|
|
16
|
+
const [r, t] = this.transform(e);
|
|
17
|
+
if (!t) return;
|
|
18
|
+
s = r;
|
|
22
19
|
}
|
|
23
|
-
this.handlers.forEach((
|
|
20
|
+
this.handlers.forEach((r, t) => t(s));
|
|
24
21
|
}
|
|
25
22
|
setCloser(e) {
|
|
26
23
|
this.closer = e;
|
|
27
24
|
}
|
|
28
25
|
async close() {
|
|
29
|
-
|
|
30
|
-
return await ((e = this.closer) == null ? void 0 : e.call(this));
|
|
26
|
+
return await this.closer?.();
|
|
31
27
|
}
|
|
32
28
|
}
|
|
33
|
-
class
|
|
29
|
+
class o {
|
|
30
|
+
handlers;
|
|
34
31
|
constructor(e) {
|
|
35
|
-
t(this, "handlers");
|
|
36
32
|
this.handlers = e ?? /* @__PURE__ */ new Map();
|
|
37
33
|
}
|
|
38
34
|
onChange(e) {
|
|
39
35
|
return this.handlers.set(e, null), () => this.handlers.delete(e);
|
|
40
36
|
}
|
|
41
37
|
notify(e) {
|
|
42
|
-
this.handlers.forEach((s,
|
|
38
|
+
this.handlers.forEach((s, r) => r(e));
|
|
43
39
|
}
|
|
44
40
|
}
|
|
45
|
-
const
|
|
41
|
+
const a = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
46
42
|
__proto__: null,
|
|
47
|
-
BaseObserver:
|
|
48
|
-
Observer:
|
|
43
|
+
BaseObserver: o,
|
|
44
|
+
Observer: l
|
|
49
45
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
50
46
|
export {
|
|
51
|
-
|
|
47
|
+
a as observe
|
|
52
48
|
};
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
const f = (s, e, t = ".") => {
|
|
2
|
+
const r = s.split(t);
|
|
3
|
+
return r.map((l, o) => {
|
|
4
|
+
const i = e(l, o, r);
|
|
5
|
+
return i == null ? null : typeof i == "string" ? i : i.join(t);
|
|
6
|
+
}).filter((l) => l != null).join(t);
|
|
7
|
+
}, u = (s, e) => {
|
|
8
|
+
if (!Array.isArray(s)) return s[e];
|
|
9
|
+
const t = s[e];
|
|
10
|
+
if (t != null || s.length == 0) return t;
|
|
11
|
+
const r = s[0];
|
|
12
|
+
if (typeof r == "object" && "key" in r)
|
|
13
|
+
return s.find((n) => n.key === e);
|
|
14
|
+
}, c = (s, e, t = { optional: !1, separator: "." }) => {
|
|
15
|
+
t.separator ??= ".";
|
|
16
|
+
const { optional: r, getter: n = u } = t, l = e.split(t.separator);
|
|
17
|
+
if (l.length === 1 && l[0] === "") return s;
|
|
18
|
+
let o = s;
|
|
19
|
+
for (const i of l) {
|
|
20
|
+
const a = n(o, i);
|
|
21
|
+
if (a == null) {
|
|
22
|
+
if (r) return null;
|
|
23
|
+
throw new Error(`Path ${e} does not exist. ${i} is null`);
|
|
24
|
+
}
|
|
25
|
+
o = a;
|
|
26
|
+
}
|
|
27
|
+
return o;
|
|
28
|
+
}, p = (s, e, t) => {
|
|
29
|
+
const r = e.split(".");
|
|
30
|
+
let n = s;
|
|
31
|
+
for (let l = 0; l < r.length - 1; l++) {
|
|
32
|
+
const o = r[l], i = u(n, o);
|
|
33
|
+
if (i == null) throw new Error(`Path ${e} does not exist. ${o} is null`);
|
|
34
|
+
n = i;
|
|
35
|
+
}
|
|
36
|
+
try {
|
|
37
|
+
if (!Array.isArray(n)) {
|
|
38
|
+
n[r[r.length - 1]] = t;
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
if (n.length === 0) return;
|
|
42
|
+
const l = parseInt(r[r.length - 1]);
|
|
43
|
+
if (isNaN(l)) {
|
|
44
|
+
const o = n[0];
|
|
45
|
+
if (typeof o == "object" && "key" in o) {
|
|
46
|
+
const i = n.findIndex((a) => a.key === r[r.length - 1]);
|
|
47
|
+
if (i !== -1) {
|
|
48
|
+
n[i] = t;
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
n[l] = t;
|
|
55
|
+
} catch (l) {
|
|
56
|
+
throw console.error("failed to set value", t, "at path", e, "on object", s), l;
|
|
57
|
+
}
|
|
58
|
+
}, h = (s, e) => {
|
|
59
|
+
const t = e.split(".");
|
|
60
|
+
let r = s;
|
|
61
|
+
for (let n = 0; n < t.length - 1; n++) {
|
|
62
|
+
const l = t[n];
|
|
63
|
+
if (r[l] == null) return;
|
|
64
|
+
r = r[l];
|
|
65
|
+
}
|
|
66
|
+
if (Array.isArray(r)) {
|
|
67
|
+
const n = parseInt(t[t.length - 1]);
|
|
68
|
+
if (isNaN(n)) return;
|
|
69
|
+
r.splice(n, 1);
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
delete r[t[t.length - 1]];
|
|
73
|
+
}, g = (s, e) => {
|
|
74
|
+
const t = s.split(".");
|
|
75
|
+
return e < 0 ? t[t.length + e] : t[e];
|
|
76
|
+
}, y = (s, e) => {
|
|
77
|
+
try {
|
|
78
|
+
return c(s, e), !0;
|
|
79
|
+
} catch {
|
|
80
|
+
return !1;
|
|
81
|
+
}
|
|
82
|
+
}, d = (s, e) => {
|
|
83
|
+
if (e.length === 0) return !0;
|
|
84
|
+
const t = s.split("."), r = e.split(".");
|
|
85
|
+
if (r.length > t.length) return !1;
|
|
86
|
+
for (let n = 0; n < r.length; n++) {
|
|
87
|
+
const l = t[n], o = r[n];
|
|
88
|
+
if (o !== "*" && l !== o)
|
|
89
|
+
return !1;
|
|
90
|
+
}
|
|
91
|
+
return !0;
|
|
92
|
+
};
|
|
93
|
+
export {
|
|
94
|
+
g as e,
|
|
95
|
+
c as g,
|
|
96
|
+
y as h,
|
|
97
|
+
d as p,
|
|
98
|
+
h as r,
|
|
99
|
+
p as s,
|
|
100
|
+
f as t
|
|
101
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const f=(s,n,t=".")=>{const r=s.split(t);return r.map((l,o)=>{const i=n(l,o,r);return i==null?null:typeof i=="string"?i:i.join(t)}).filter(l=>l!=null).join(t)},c=(s,n)=>{if(!Array.isArray(s))return s[n];const t=s[n];if(t!=null||s.length==0)return t;const r=s[0];if(typeof r=="object"&&"key"in r)return s.find(e=>e.key===n)},a=(s,n,t={optional:!1,separator:"."})=>{t.separator??=".";const{optional:r,getter:e=c}=t,l=n.split(t.separator);if(l.length===1&&l[0]==="")return s;let o=s;for(const i of l){const u=e(o,i);if(u==null){if(r)return null;throw new Error(`Path ${n} does not exist. ${i} is null`)}o=u}return o},h=(s,n,t)=>{const r=n.split(".");let e=s;for(let l=0;l<r.length-1;l++){const o=r[l],i=c(e,o);if(i==null)throw new Error(`Path ${n} does not exist. ${o} is null`);e=i}try{if(!Array.isArray(e)){e[r[r.length-1]]=t;return}if(e.length===0)return;const l=parseInt(r[r.length-1]);if(isNaN(l)){const o=e[0];if(typeof o=="object"&&"key"in o){const i=e.findIndex(u=>u.key===r[r.length-1]);if(i!==-1){e[i]=t;return}}return}e[l]=t}catch(l){throw console.error("failed to set value",t,"at path",n,"on object",s),l}},p=(s,n)=>{const t=n.split(".");let r=s;for(let e=0;e<t.length-1;e++){const l=t[e];if(r[l]==null)return;r=r[l]}if(Array.isArray(r)){const e=parseInt(t[t.length-1]);if(isNaN(e))return;r.splice(e,1);return}delete r[t[t.length-1]]},g=(s,n)=>{const t=s.split(".");return n<0?t[t.length+n]:t[n]},y=(s,n)=>{try{return a(s,n),!0}catch{return!1}},d=(s,n)=>{if(n.length===0)return!0;const t=s.split("."),r=n.split(".");if(r.length>t.length)return!1;for(let e=0;e<r.length;e++){const l=t[e],o=r[e];if(o!=="*"&&l!==o)return!1}return!0};exports.element=g;exports.get=a;exports.has=y;exports.pathsMatch=d;exports.remove=p;exports.set=h;exports.transformPath=f;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const c=require("./box-Cxki783Y.cjs"),T=require("./direction-386XDm2w.cjs"),s=require("./location-DZi8ftXp.cjs"),b=require("./base-BAM2mqCy.cjs"),P=t=>{if(t==null)return{x:void 0,y:void 0};const n=s.xy.safeParse(t);if(n.success)return n.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:n,dialog:e,initial:u,prefer:a,alignments:f=["start"],disable:x=[]})=>{const i=P(u);let l=s.XY_LOCATIONS;if(a!=null){const o=a.map(r=>P(r));l=l.slice().sort((r,p)=>{const d=o.findIndex(h=>s.xyMatches(r,h)),g=o.findIndex(h=>s.xyMatches(p,h));return d>-1&&g>-1?d-g:d>-1?-1:g>-1?1:0})}const O=l.filter(o=>!s.xyEquals(o,s.CENTER)&&(i.x==null||o.x===i.x)&&(i.y==null||o.y===i.y)&&!x.some(r=>s.xyMatches(o,r))).map(o=>f?.map(r=>[o,r])).flat(),A=c.construct(t),M=c.construct(n),_=c.construct(e);let E=-1/0;const y={location:s.CENTER,adjustedDialog:_};return O.forEach(([o,r])=>{const[p,d]=m({option:o,alignment:r,container:A,target:M,dialog:_});d>E&&(E=d,y.location=o,y.adjustedDialog=p)}),y},m=({option:t,alignment:n,container:e,target:u,dialog:a})=>{const f=L(t,n),x=c.xyLoc(u,t),i=c.constructWithAlternateRoot(x.x,x.y,c.width(a),c.height(a),f,s.TOP_LEFT),l=c.area(c.intersection(i,e));return[i,l]},v={start:"left",center:"center",end:"right"},I={start:"bottom",center:"center",end:"top"},L=(t,n)=>{const e={x:"center",y:"center"};if(t.y!=="center"){e.y=s.swap(t.y);const u=t.x==="left"?s.swap:a=>a;e.x=u(v[n])}else e.x=s.swap(t.x),e.y=I[n];return e},j=Object.freeze(Object.defineProperty({__proto__:null,dialog:N,getRoot:L,parseLocationOptions:P},Symbol.toStringTag,{value:"Module"}));exports.position=j;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { c as g, x as v, a as I, h as M, w as N, d as X, i as j } from "./box-CO_2_DGG.js";
|
|
2
|
+
import { c as w } from "./direction-8etxfKaR.js";
|
|
3
|
+
import { x as B, X as C, a as m, b as R, C as O, s as h, T as S } from "./location-Ar5y2DX2.js";
|
|
4
|
+
import { l as Y } from "./base-DFq0vvGn.js";
|
|
5
|
+
const P = (t) => {
|
|
6
|
+
if (t == null) return { x: void 0, y: void 0 };
|
|
7
|
+
const o = B.safeParse(t);
|
|
8
|
+
if (o.success) return o.data;
|
|
9
|
+
const e = Y.safeParse(t);
|
|
10
|
+
return e.success ? w(e.data) === "x" ? { x: e.data, y: void 0 } : { x: void 0, y: e.data } : t;
|
|
11
|
+
}, D = ({
|
|
12
|
+
container: t,
|
|
13
|
+
target: o,
|
|
14
|
+
dialog: e,
|
|
15
|
+
initial: c,
|
|
16
|
+
prefer: r,
|
|
17
|
+
alignments: u = ["start"],
|
|
18
|
+
disable: l = []
|
|
19
|
+
}) => {
|
|
20
|
+
const n = P(c);
|
|
21
|
+
let d = C;
|
|
22
|
+
if (r != null) {
|
|
23
|
+
const s = r.map((a) => P(a));
|
|
24
|
+
d = d.slice().sort((a, x) => {
|
|
25
|
+
const i = s.findIndex((y) => m(a, y)), p = s.findIndex((y) => m(x, y));
|
|
26
|
+
return i > -1 && p > -1 ? i - p : i > -1 ? -1 : p > -1 ? 1 : 0;
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
const T = d.filter(
|
|
30
|
+
(s) => !R(s, O) && (n.x == null || s.x === n.x) && (n.y == null || s.y === n.y) && !l.some((a) => m(s, a))
|
|
31
|
+
).map((s) => u?.map((a) => [s, a])).flat(), E = g(t), b = g(o), _ = g(e);
|
|
32
|
+
let L = -1 / 0;
|
|
33
|
+
const f = { location: O, adjustedDialog: _ };
|
|
34
|
+
return T.forEach(([s, a]) => {
|
|
35
|
+
const [x, i] = G({
|
|
36
|
+
option: s,
|
|
37
|
+
alignment: a,
|
|
38
|
+
container: E,
|
|
39
|
+
target: b,
|
|
40
|
+
dialog: _
|
|
41
|
+
});
|
|
42
|
+
i > L && (L = i, f.location = s, f.adjustedDialog = x);
|
|
43
|
+
}), f;
|
|
44
|
+
}, G = ({
|
|
45
|
+
option: t,
|
|
46
|
+
alignment: o,
|
|
47
|
+
container: e,
|
|
48
|
+
target: c,
|
|
49
|
+
dialog: r
|
|
50
|
+
}) => {
|
|
51
|
+
const u = A(t, o), l = v(c, t), n = I(
|
|
52
|
+
l.x,
|
|
53
|
+
l.y,
|
|
54
|
+
N(r),
|
|
55
|
+
M(r),
|
|
56
|
+
u,
|
|
57
|
+
S
|
|
58
|
+
), d = X(j(n, e));
|
|
59
|
+
return [n, d];
|
|
60
|
+
}, $ = {
|
|
61
|
+
start: "left",
|
|
62
|
+
center: "center",
|
|
63
|
+
end: "right"
|
|
64
|
+
}, q = {
|
|
65
|
+
start: "bottom",
|
|
66
|
+
center: "center",
|
|
67
|
+
end: "top"
|
|
68
|
+
}, A = (t, o) => {
|
|
69
|
+
const e = { x: "center", y: "center" };
|
|
70
|
+
if (t.y !== "center") {
|
|
71
|
+
e.y = h(t.y);
|
|
72
|
+
const c = t.x === "left" ? h : (r) => r;
|
|
73
|
+
e.x = c($[o]);
|
|
74
|
+
} else
|
|
75
|
+
e.x = h(t.x), e.y = q[o];
|
|
76
|
+
return e;
|
|
77
|
+
}, H = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
78
|
+
__proto__: null,
|
|
79
|
+
dialog: D,
|
|
80
|
+
getRoot: A,
|
|
81
|
+
parseLocationOptions: P
|
|
82
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
83
|
+
export {
|
|
84
|
+
H as p
|
|
85
|
+
};
|
package/dist/position.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./position-DSy2hONH.cjs");exports.position=o.position;
|
package/dist/position.js
CHANGED
|
@@ -1,85 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { c as w } from "./index-DxU1zwsd.js";
|
|
3
|
-
import { h as B, X as R, i as g, x as S, j as O, s as m, T as Y } from "./index-D6V-8SKw.js";
|
|
4
|
-
import { l as C } from "./base-B5lQIJKc.js";
|
|
5
|
-
const P = (t) => {
|
|
6
|
-
if (t == null) return { x: void 0, y: void 0 };
|
|
7
|
-
const s = B.safeParse(t);
|
|
8
|
-
if (s.success) return s.data;
|
|
9
|
-
const o = C.safeParse(t);
|
|
10
|
-
return o.success ? w(o.data) === "x" ? { x: o.data, y: void 0 } : { x: void 0, y: o.data } : t;
|
|
11
|
-
}, D = ({
|
|
12
|
-
container: t,
|
|
13
|
-
target: s,
|
|
14
|
-
dialog: o,
|
|
15
|
-
initial: c,
|
|
16
|
-
prefer: a,
|
|
17
|
-
alignments: d = ["start"],
|
|
18
|
-
disable: f = []
|
|
19
|
-
}) => {
|
|
20
|
-
const n = P(c);
|
|
21
|
-
let u = R;
|
|
22
|
-
if (a != null) {
|
|
23
|
-
const e = a.map((r) => P(r));
|
|
24
|
-
u = u.slice().sort((r, x) => {
|
|
25
|
-
const i = e.findIndex((y) => g(r, y)), p = e.findIndex((y) => g(x, y));
|
|
26
|
-
return i > -1 && p > -1 ? i - p : i > -1 ? -1 : p > -1 ? 1 : 0;
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
const T = u.filter(
|
|
30
|
-
(e) => !S(e, O) && (n.x == null || e.x === n.x) && (n.y == null || e.y === n.y) && !f.some((r) => g(e, r))
|
|
31
|
-
).map((e) => d == null ? void 0 : d.map((r) => [e, r])).flat(), E = h(t), j = h(s), _ = h(o);
|
|
32
|
-
let L = -1 / 0;
|
|
33
|
-
const l = { location: O, adjustedDialog: _ };
|
|
34
|
-
return T.forEach(([e, r]) => {
|
|
35
|
-
const [x, i] = G({
|
|
36
|
-
option: e,
|
|
37
|
-
alignment: r,
|
|
38
|
-
container: E,
|
|
39
|
-
target: j,
|
|
40
|
-
dialog: _
|
|
41
|
-
});
|
|
42
|
-
i > L && (L = i, l.location = e, l.adjustedDialog = x);
|
|
43
|
-
}), l;
|
|
44
|
-
}, G = ({
|
|
45
|
-
option: t,
|
|
46
|
-
alignment: s,
|
|
47
|
-
container: o,
|
|
48
|
-
target: c,
|
|
49
|
-
dialog: a
|
|
50
|
-
}) => {
|
|
51
|
-
const d = A(t, s), f = v(c, t), n = I(
|
|
52
|
-
f.x,
|
|
53
|
-
f.y,
|
|
54
|
-
N(a),
|
|
55
|
-
M(a),
|
|
56
|
-
d,
|
|
57
|
-
Y
|
|
58
|
-
), u = X(b(n, o));
|
|
59
|
-
return [n, u];
|
|
60
|
-
}, $ = {
|
|
61
|
-
start: "left",
|
|
62
|
-
center: "center",
|
|
63
|
-
end: "right"
|
|
64
|
-
}, q = {
|
|
65
|
-
start: "bottom",
|
|
66
|
-
center: "center",
|
|
67
|
-
end: "top"
|
|
68
|
-
}, A = (t, s) => {
|
|
69
|
-
const o = { x: "center", y: "center" };
|
|
70
|
-
if (t.y !== "center") {
|
|
71
|
-
o.y = m(t.y);
|
|
72
|
-
const c = t.x === "left" ? m : (a) => a;
|
|
73
|
-
o.x = c($[s]);
|
|
74
|
-
} else
|
|
75
|
-
o.x = m(t.x), o.y = q[s];
|
|
76
|
-
return o;
|
|
77
|
-
}, H = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
78
|
-
__proto__: null,
|
|
79
|
-
dialog: D,
|
|
80
|
-
getRoot: A,
|
|
81
|
-
parseLocationOptions: P
|
|
82
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
1
|
+
import { p as i } from "./position-PQ6op54I.js";
|
|
83
2
|
export {
|
|
84
|
-
|
|
3
|
+
i as position
|
|
85
4
|
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z as e } from "zod";
|
|
2
|
+
const i = e.record(
|
|
3
|
+
e.union([e.number(), e.string(), e.symbol()]),
|
|
4
|
+
e.unknown()
|
|
5
|
+
), r = (n) => Object.entries(n), s = (n, t) => Object.fromEntries(r(n).map(([o, c]) => [o, t(c, o)])), m = (n) => Object.fromEntries(r(n).filter(([t, o]) => o !== void 0)), u = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
6
|
+
__proto__: null,
|
|
7
|
+
entries: r,
|
|
8
|
+
map: s,
|
|
9
|
+
purgeUndefined: m,
|
|
10
|
+
unknownZ: i
|
|
11
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
12
|
+
export {
|
|
13
|
+
u as r
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("zod"),s=e.z.record(e.z.union([e.z.number(),e.z.string(),e.z.symbol()]),e.z.unknown()),t=n=>Object.entries(n),i=(n,o)=>Object.fromEntries(t(n).map(([r,c])=>[r,o(c,r)])),u=n=>Object.fromEntries(t(n).filter(([o,r])=>r!==void 0)),b=Object.freeze(Object.defineProperty({__proto__:null,entries:t,map:i,purgeUndefined:u,unknownZ:s},Symbol.toStringTag,{value:"Module"}));exports.record=b;
|
package/dist/record.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./record-YvCh7bzB.cjs");exports.record=e.record;
|
package/dist/record.js
CHANGED
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
import { r as
|
|
2
|
-
const p = t(
|
|
3
|
-
a([c(), m(), i()]),
|
|
4
|
-
e()
|
|
5
|
-
), u = (n) => Object.entries(n), d = (n, o) => Object.fromEntries(u(n).map(([s, r]) => [s, o(r, s)]));
|
|
1
|
+
import { r as e } from "./record-CAcQ5PNX.js";
|
|
6
2
|
export {
|
|
7
|
-
|
|
8
|
-
d as mapValues,
|
|
9
|
-
p as unknownRecordZ
|
|
3
|
+
e as record
|
|
10
4
|
};
|
package/dist/runtime.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./external-uXk0Avrg.cjs");exports.runtime=e.external;
|
package/dist/runtime.js
CHANGED
|
@@ -1,29 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
const t = () => typeof process < "u" && process.versions != null && process.versions.node != null ? "node" : typeof window > "u" || window.document === void 0 ? "webworker" : "browser", u = t(), i = ["macOS", "Windows", "Linux"], d = ["macos", "windows", "linux"], c = {
|
|
3
|
-
macos: "macOS",
|
|
4
|
-
windows: "Windows",
|
|
5
|
-
linux: "Linux"
|
|
6
|
-
}, l = r(i).or(
|
|
7
|
-
r(d).transform((n) => c[n])
|
|
8
|
-
), f = () => {
|
|
9
|
-
if (typeof window > "u") return;
|
|
10
|
-
const n = window.navigator.userAgent.toLowerCase();
|
|
11
|
-
if (n.includes("mac")) return "macOS";
|
|
12
|
-
if (n.includes("win")) return "Windows";
|
|
13
|
-
if (n.includes("linux")) return "Linux";
|
|
14
|
-
};
|
|
15
|
-
let e;
|
|
16
|
-
const w = (n = {}) => {
|
|
17
|
-
const { force: o, default: s } = n;
|
|
18
|
-
return o ?? e ?? (e = f(), e ?? s);
|
|
19
|
-
}, S = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
20
|
-
__proto__: null,
|
|
21
|
-
OPERATING_SYSTEMS: i,
|
|
22
|
-
RUNTIME: u,
|
|
23
|
-
detect: t,
|
|
24
|
-
getOS: w,
|
|
25
|
-
osZ: l
|
|
26
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
1
|
+
import { e as m } from "./external-BPgtxa8d.js";
|
|
27
2
|
export {
|
|
28
|
-
|
|
3
|
+
m as runtime
|
|
29
4
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const l=require("zod"),y=require("./bounds-D6e9xoHt.cjs"),u=require("./box-Cxki783Y.cjs"),m=require("./location-DZi8ftXp.cjs"),h=require("./xy-CUE3QDNn.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;
|