@synnaxlabs/x 0.44.3 → 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 +31 -35
- package/dist/base-BLNViP3D.cjs +1 -0
- package/dist/{base-DFq0vvGn.js → base-BORMP3mH.js} +14 -11
- package/dist/{bounds-8OC_obRs.js → bounds-BQqppNFf.js} +1 -1
- package/dist/{bounds-CRK04jp7.cjs → bounds-BXbqBINt.cjs} +1 -1
- 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/{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/index.cjs +3 -3
- package/dist/index.js +59 -61
- 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/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-C3fEtXxW.cjs → scale-76Azh2EE.cjs} +1 -1
- package/dist/{scale-Db1Gunj0.js → scale-BhIvACdB.js} +4 -4
- package/dist/scale.cjs +1 -1
- package/dist/scale.js +1 -1
- package/dist/{series-Cl3Vh_u-.js → series-kgnLXSDr.js} +55 -39
- package/dist/{series-BcF7A8Je.cjs → series-tAhThbnz.cjs} +3 -3
- 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/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/telem/telem.d.ts +8 -0
- package/dist/src/telem/telem.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/package.json +3 -8
- 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/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/telem/telem.spec.ts +50 -0
- package/src/telem/telem.ts +25 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/vite.config.ts +0 -1
- package/dist/base-BAM2mqCy.cjs +0 -1
- package/dist/box-Cxki783Y.cjs +0 -1
- package/dist/direction-386XDm2w.cjs +0 -1
- package/dist/direction-8etxfKaR.js +0 -17
- package/dist/location-DZi8ftXp.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/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
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
|
|
2
|
-
> @synnaxlabs/x@0.44.
|
|
2
|
+
> @synnaxlabs/x@0.44.4 build /home/runner/work/synnax/synnax/x/ts
|
|
3
3
|
> tsc --noEmit && vite build
|
|
4
4
|
|
|
5
5
|
[34m Synnax - Production mode[0m
|
|
6
6
|
[36mvite v7.0.4 [32mbuilding for production...[36m[39m
|
|
7
7
|
transforming...
|
|
8
|
-
[32m✓[39m
|
|
8
|
+
[32m✓[39m 145 modules transformed.
|
|
9
9
|
[33mGenerated an empty chunk: "destructor".[39m
|
|
10
10
|
rendering chunks...
|
|
11
11
|
|
|
@@ -28,45 +28,43 @@ computing gzip size...
|
|
|
28
28
|
[2mdist/[22m[36mcaseconv.js [39m[1m[2m 0.07 kB[22m[1m[22m[2m │ gzip: 0.09 kB[22m
|
|
29
29
|
[2mdist/[22m[36mruntime.js [39m[1m[2m 0.08 kB[22m[1m[22m[2m │ gzip: 0.09 kB[22m
|
|
30
30
|
[2mdist/[22m[36mdimensions.js [39m[1m[2m 0.08 kB[22m[1m[22m[2m │ gzip: 0.08 kB[22m
|
|
31
|
-
[2mdist/[22m[36mposition.js [39m[1m[2m 0.08 kB[22m[1m[22m[2m │ gzip: 0.09 kB[22m
|
|
32
31
|
[2mdist/[22m[36midentity.js [39m[1m[2m 0.10 kB[22m[1m[22m[2m │ gzip: 0.11 kB[22m
|
|
33
32
|
[2mdist/[22m[36marray.js [39m[1m[2m 0.24 kB[22m[1m[22m[2m │ gzip: 0.20 kB[22m
|
|
34
|
-
[2mdist/[22m[36mspatial-
|
|
33
|
+
[2mdist/[22m[36mspatial-QY891r0E.js [39m[1m[2m 0.28 kB[22m[1m[22m[2m │ gzip: 0.23 kB[22m
|
|
35
34
|
[2mdist/[22m[36mchange-DLl6DccR.js [39m[1m[2m 0.30 kB[22m[1m[22m[2m │ gzip: 0.23 kB[22m
|
|
36
35
|
[2mdist/[22m[36mdebounce.js [39m[1m[2m 0.36 kB[22m[1m[22m[2m │ gzip: 0.18 kB[22m
|
|
37
36
|
[2mdist/[22m[36mtelem.js [39m[1m[2m 0.41 kB[22m[1m[22m[2m │ gzip: 0.25 kB[22m
|
|
38
37
|
[2mdist/[22m[36mlink.js [39m[1m[2m 0.44 kB[22m[1m[22m[2m │ gzip: 0.34 kB[22m
|
|
39
38
|
[2mdist/[22m[36mindex-D4NCYiQB.js [39m[1m[2m 0.45 kB[22m[1m[22m[2m │ gzip: 0.30 kB[22m
|
|
40
|
-
[2mdist/[22m[
|
|
41
|
-
[2mdist/[22m[
|
|
42
|
-
[2mdist/[22m[36mdirection-
|
|
39
|
+
[2mdist/[22m[36mspatial.js [39m[1m[2m 0.51 kB[22m[1m[22m[2m │ gzip: 0.26 kB[22m
|
|
40
|
+
[2mdist/[22m[36mrecord-tSFQKmdG.js [39m[1m[2m 0.61 kB[22m[1m[22m[2m │ gzip: 0.37 kB[22m
|
|
41
|
+
[2mdist/[22m[36mdirection-DKdfJwj7.js [39m[1m[2m 0.76 kB[22m[1m[22m[2m │ gzip: 0.42 kB[22m
|
|
43
42
|
[2mdist/[22m[36mexternal-BYuXBYJh.js [39m[1m[2m 0.79 kB[22m[1m[22m[2m │ gzip: 0.34 kB[22m
|
|
44
43
|
[2mdist/[22m[36mworker.js [39m[1m[2m 0.87 kB[22m[1m[22m[2m │ gzip: 0.40 kB[22m
|
|
45
44
|
[2mdist/[22m[36mexternal-BM_NS5yM.js [39m[1m[2m 0.87 kB[22m[1m[22m[2m │ gzip: 0.52 kB[22m
|
|
46
45
|
[2mdist/[22m[36mexternal-BPgtxa8d.js [39m[1m[2m 0.99 kB[22m[1m[22m[2m │ gzip: 0.56 kB[22m
|
|
47
46
|
[2mdist/[22m[36mobserve.js [39m[1m[2m 1.10 kB[22m[1m[22m[2m │ gzip: 0.48 kB[22m
|
|
48
|
-
[2mdist/[22m[36mbase-
|
|
49
|
-
[2mdist/[22m[36mdimensions-
|
|
47
|
+
[2mdist/[22m[36mbase-BORMP3mH.js [39m[1m[2m 1.30 kB[22m[1m[22m[2m │ gzip: 0.54 kB[22m
|
|
48
|
+
[2mdist/[22m[36mdimensions-RaRkesPq.js [39m[1m[2m 1.49 kB[22m[1m[22m[2m │ gzip: 0.66 kB[22m
|
|
50
49
|
[2mdist/[22m[36murl.js [39m[1m[2m 1.70 kB[22m[1m[22m[2m │ gzip: 0.76 kB[22m
|
|
51
50
|
[2mdist/[22m[36mindex-D2xcvEO5.js [39m[1m[2m 1.86 kB[22m[1m[22m[2m │ gzip: 0.89 kB[22m
|
|
52
|
-
[2mdist/[22m[36mposition-PQ6op54I.js [39m[1m[2m 2.23 kB[22m[1m[22m[2m │ gzip: 1.06 kB[22m
|
|
53
51
|
[2mdist/[22m[36mindex-B5l_quQn.js [39m[1m[2m 2.56 kB[22m[1m[22m[2m │ gzip: 1.00 kB[22m
|
|
54
52
|
[2mdist/[22m[36mpath-Blh4wJuA.js [39m[1m[2m 2.72 kB[22m[1m[22m[2m │ gzip: 0.97 kB[22m
|
|
55
|
-
[2mdist/[22m[36mlocation-
|
|
53
|
+
[2mdist/[22m[36mlocation-CGLioInQ.js [39m[1m[2m 2.80 kB[22m[1m[22m[2m │ gzip: 1.16 kB[22m
|
|
56
54
|
[2mdist/[22m[36mindex-CBMHFqs4.js [39m[1m[2m 3.62 kB[22m[1m[22m[2m │ gzip: 1.37 kB[22m
|
|
57
55
|
[2mdist/[22m[36mdeep.js [39m[1m[2m 3.93 kB[22m[1m[22m[2m │ gzip: 1.52 kB[22m
|
|
58
|
-
[2mdist/[22m[36mxy-
|
|
59
|
-
[2mdist/[22m[36mbounds-
|
|
60
|
-
[2mdist/[22m[36mbox-
|
|
61
|
-
[2mdist/[22m[36mscale-
|
|
62
|
-
[2mdist/[22m[36mindex.js [39m[1m[2m27.
|
|
63
|
-
[2mdist/[22m[36mseries-
|
|
64
|
-
[vite:dts] Declaration files built in
|
|
56
|
+
[2mdist/[22m[36mxy-CBuhMaIo.js [39m[1m[2m 4.31 kB[22m[1m[22m[2m │ gzip: 1.59 kB[22m
|
|
57
|
+
[2mdist/[22m[36mbounds-BQqppNFf.js [39m[1m[2m 6.20 kB[22m[1m[22m[2m │ gzip: 2.09 kB[22m
|
|
58
|
+
[2mdist/[22m[36mbox-DRH5SOaY.js [39m[1m[2m 6.38 kB[22m[1m[22m[2m │ gzip: 2.23 kB[22m
|
|
59
|
+
[2mdist/[22m[36mscale-BhIvACdB.js [39m[1m[2m 6.49 kB[22m[1m[22m[2m │ gzip: 1.89 kB[22m
|
|
60
|
+
[2mdist/[22m[36mindex.js [39m[1m[2m27.11 kB[22m[1m[22m[2m │ gzip: 8.73 kB[22m
|
|
61
|
+
[2mdist/[22m[36mseries-kgnLXSDr.js [39m[1m[2m91.88 kB[22m[1m[22m[2m │ gzip: 19.48 kB[22m
|
|
62
|
+
[vite:dts] Declaration files built in 4552ms.
|
|
65
63
|
|
|
66
64
|
[33mGenerated an empty chunk: "destructor".[39m
|
|
67
65
|
[2mdist/[22m[36mdestructor.cjs [39m[1m[2m 0.01 kB[22m[1m[22m[2m │ gzip: 0.03 kB[22m
|
|
68
66
|
[2mdist/[22m[36mxy.cjs [39m[1m[2m 0.13 kB[22m[1m[22m[2m │ gzip: 0.14 kB[22m
|
|
69
|
-
[2mdist/[22m[36mbox.cjs [39m[1m[2m 0.14 kB[22m[1m[22m[2m │ gzip: 0.
|
|
67
|
+
[2mdist/[22m[36mbox.cjs [39m[1m[2m 0.14 kB[22m[1m[22m[2m │ gzip: 0.14 kB[22m
|
|
70
68
|
[2mdist/[22m[36mscale.cjs [39m[1m[2m 0.14 kB[22m[1m[22m[2m │ gzip: 0.15 kB[22m
|
|
71
69
|
[2mdist/[22m[36mbinary.cjs [39m[1m[2m 0.14 kB[22m[1m[22m[2m │ gzip: 0.15 kB[22m
|
|
72
70
|
[2mdist/[22m[36munique.cjs [39m[1m[2m 0.15 kB[22m[1m[22m[2m │ gzip: 0.15 kB[22m
|
|
@@ -79,39 +77,37 @@ computing gzip size...
|
|
|
79
77
|
[2mdist/[22m[36mcaseconv.cjs [39m[1m[2m 0.15 kB[22m[1m[22m[2m │ gzip: 0.15 kB[22m
|
|
80
78
|
[2mdist/[22m[36mruntime.cjs [39m[1m[2m 0.15 kB[22m[1m[22m[2m │ gzip: 0.15 kB[22m
|
|
81
79
|
[2mdist/[22m[36mlocation.cjs [39m[1m[2m 0.15 kB[22m[1m[22m[2m │ gzip: 0.15 kB[22m
|
|
82
|
-
[2mdist/[22m[36mposition.cjs [39m[1m[2m 0.15 kB[22m[1m[22m[2m │ gzip: 0.15 kB[22m
|
|
83
80
|
[2mdist/[22m[36mdirection.cjs [39m[1m[2m 0.16 kB[22m[1m[22m[2m │ gzip: 0.15 kB[22m
|
|
84
81
|
[2mdist/[22m[36mdimensions.cjs [39m[1m[2m 0.16 kB[22m[1m[22m[2m │ gzip: 0.15 kB[22m
|
|
85
82
|
[2mdist/[22m[36midentity.cjs [39m[1m[2m 0.16 kB[22m[1m[22m[2m │ gzip: 0.15 kB[22m
|
|
86
83
|
[2mdist/[22m[36mchange-C-YELKx6.cjs [39m[1m[2m 0.23 kB[22m[1m[22m[2m │ gzip: 0.20 kB[22m
|
|
87
|
-
[2mdist/[22m[36mspatial-
|
|
84
|
+
[2mdist/[22m[36mspatial-BsGadoUr.cjs [39m[1m[2m 0.24 kB[22m[1m[22m[2m │ gzip: 0.21 kB[22m
|
|
88
85
|
[2mdist/[22m[36marray.cjs [39m[1m[2m 0.25 kB[22m[1m[22m[2m │ gzip: 0.18 kB[22m
|
|
89
86
|
[2mdist/[22m[36mindex-udOjA9d-.cjs [39m[1m[2m 0.32 kB[22m[1m[22m[2m │ gzip: 0.25 kB[22m
|
|
90
87
|
[2mdist/[22m[36mdebounce.cjs [39m[1m[2m 0.33 kB[22m[1m[22m[2m │ gzip: 0.22 kB[22m
|
|
91
|
-
[2mdist/[22m[36mrecord-YvCh7bzB.cjs [39m[1m[2m 0.41 kB[22m[1m[22m[2m │ gzip: 0.28 kB[22m
|
|
92
88
|
[2mdist/[22m[36mlink.cjs [39m[1m[2m 0.42 kB[22m[1m[22m[2m │ gzip: 0.30 kB[22m
|
|
89
|
+
[2mdist/[22m[36mrecord-BwjIgrpU.cjs [39m[1m[2m 0.49 kB[22m[1m[22m[2m │ gzip: 0.33 kB[22m
|
|
93
90
|
[2mdist/[22m[36mtelem.cjs [39m[1m[2m 0.54 kB[22m[1m[22m[2m │ gzip: 0.27 kB[22m
|
|
94
|
-
[2mdist/[22m[
|
|
91
|
+
[2mdist/[22m[36mspatial.cjs [39m[1m[2m 0.57 kB[22m[1m[22m[2m │ gzip: 0.31 kB[22m
|
|
95
92
|
[2mdist/[22m[36mexternal-B9AAGv50.cjs [39m[1m[2m 0.58 kB[22m[1m[22m[2m │ gzip: 0.30 kB[22m
|
|
96
|
-
[2mdist/[22m[
|
|
93
|
+
[2mdist/[22m[36mdirection-XCdrc4is.cjs [39m[1m[2m 0.62 kB[22m[1m[22m[2m │ gzip: 0.38 kB[22m
|
|
97
94
|
[2mdist/[22m[36mexternal-E3ErJeeM.cjs [39m[1m[2m 0.68 kB[22m[1m[22m[2m │ gzip: 0.45 kB[22m
|
|
98
95
|
[2mdist/[22m[36mworker.cjs [39m[1m[2m 0.71 kB[22m[1m[22m[2m │ gzip: 0.39 kB[22m
|
|
99
96
|
[2mdist/[22m[36mobserve.cjs [39m[1m[2m 0.76 kB[22m[1m[22m[2m │ gzip: 0.36 kB[22m
|
|
100
97
|
[2mdist/[22m[36mexternal-uXk0Avrg.cjs [39m[1m[2m 0.79 kB[22m[1m[22m[2m │ gzip: 0.49 kB[22m
|
|
101
98
|
[2mdist/[22m[36murl.cjs [39m[1m[2m 0.88 kB[22m[1m[22m[2m │ gzip: 0.51 kB[22m
|
|
102
|
-
[2mdist/[22m[36mdimensions-
|
|
99
|
+
[2mdist/[22m[36mdimensions-qY12pyfC.cjs [39m[1m[2m 1.17 kB[22m[1m[22m[2m │ gzip: 0.58 kB[22m
|
|
103
100
|
[2mdist/[22m[36mindex-DdhM_E4k.cjs [39m[1m[2m 1.35 kB[22m[1m[22m[2m │ gzip: 0.72 kB[22m
|
|
104
|
-
[2mdist/[22m[36mbase-
|
|
105
|
-
[2mdist/[22m[36mposition-DSy2hONH.cjs [39m[1m[2m 1.70 kB[22m[1m[22m[2m │ gzip: 0.94 kB[22m
|
|
101
|
+
[2mdist/[22m[36mbase-BLNViP3D.cjs [39m[1m[2m 1.47 kB[22m[1m[22m[2m │ gzip: 0.59 kB[22m
|
|
106
102
|
[2mdist/[22m[36mindex-BQe8OIgm.cjs [39m[1m[2m 1.98 kB[22m[1m[22m[2m │ gzip: 0.90 kB[22m
|
|
107
103
|
[2mdist/[22m[36mpath-CPSfCjde.cjs [39m[1m[2m 2.00 kB[22m[1m[22m[2m │ gzip: 0.88 kB[22m
|
|
108
|
-
[2mdist/[22m[36mlocation-
|
|
104
|
+
[2mdist/[22m[36mlocation-DJ_K4SlP.cjs [39m[1m[2m 2.40 kB[22m[1m[22m[2m │ gzip: 1.04 kB[22m
|
|
109
105
|
[2mdist/[22m[36mindex-DOJlZHqJ.cjs [39m[1m[2m 2.54 kB[22m[1m[22m[2m │ gzip: 1.12 kB[22m
|
|
110
106
|
[2mdist/[22m[36mdeep.cjs [39m[1m[2m 2.79 kB[22m[1m[22m[2m │ gzip: 1.27 kB[22m
|
|
111
|
-
[2mdist/[22m[36mxy-
|
|
112
|
-
[2mdist/[22m[36mscale-
|
|
113
|
-
[2mdist/[22m[36mbounds-
|
|
114
|
-
[2mdist/[22m[36mbox-
|
|
115
|
-
[2mdist/[22m[36mindex.cjs [39m[1m[2m20.
|
|
116
|
-
[2mdist/[22m[36mseries-
|
|
117
|
-
[32m✓ built in 5.
|
|
107
|
+
[2mdist/[22m[36mxy-BKIJiLu_.cjs [39m[1m[2m 3.14 kB[22m[1m[22m[2m │ gzip: 1.41 kB[22m
|
|
108
|
+
[2mdist/[22m[36mscale-76Azh2EE.cjs [39m[1m[2m 4.11 kB[22m[1m[22m[2m │ gzip: 1.47 kB[22m
|
|
109
|
+
[2mdist/[22m[36mbounds-BXbqBINt.cjs [39m[1m[2m 4.67 kB[22m[1m[22m[2m │ gzip: 1.85 kB[22m
|
|
110
|
+
[2mdist/[22m[36mbox-qgxWXNhm.cjs [39m[1m[2m 4.87 kB[22m[1m[22m[2m │ gzip: 1.99 kB[22m
|
|
111
|
+
[2mdist/[22m[36mindex.cjs [39m[1m[2m20.56 kB[22m[1m[22m[2m │ gzip: 7.65 kB[22m
|
|
112
|
+
[2mdist/[22m[36mseries-tAhThbnz.cjs [39m[1m[2m39.15 kB[22m[1m[22m[2m │ gzip: 10.36 kB[22m
|
|
113
|
+
[32m✓ built in 5.33s[39m
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const n=require("zod"),t=n.z.tuple([n.z.number(),n.z.number()]);n.z.tuple([n.z.bigint(),n.z.bigint()]);const d=n.z.object({width:n.z.number(),height:n.z.number()}),O=n.z.object({signedWidth:n.z.number(),signedHeight:n.z.number()}),g=["width","height"];n.z.enum(g);const c=["start","center","end"],N=["signedWidth","signedHeight"];n.z.enum(N);const L=n.z.object({x:n.z.number(),y:n.z.number()}),S=n.z.object({clientX:n.z.number(),clientY:n.z.number()}),s=["x","y"],o=n.z.enum(s),u=["top","right","bottom","left"],I=n.z.enum(u),r=["left","right"],l=n.z.enum(r),z=["top","bottom"],a=n.z.enum(z),e=["center"],T=n.z.enum(e),C=[...u,...e],i=n.z.enum(C),E=n.z.enum(c),m=["first","last"],h=n.z.enum(m),b=n.z.object({lower:n.z.number(),upper:n.z.number()}),p=n.z.object({lower:n.z.bigint(),upper:n.z.bigint()});n.z.union([b,t]);n.z.union([p,t]);const D=n.z.enum([...o.options,...i.options]);n.z.enum(["x","left","right"]);n.z.enum(["y","top","bottom"]);const A=n.z.union([o,i,n.z.instanceof(String)]);exports.ALIGNMENTS=c;exports.CENTER_LOCATIONS=e;exports.DIRECTIONS=s;exports.ORDERS=m;exports.X_LOCATIONS=r;exports.Y_LOCATIONS=z;exports.alignment=E;exports.bounds=b;exports.centerLocation=T;exports.clientXY=S;exports.crudeDirection=D;exports.crudeLocation=A;exports.dimensions=d;exports.direction=o;exports.location=i;exports.numberCouple=t;exports.order=h;exports.outerLocation=I;exports.signedDimensions=O;exports.xLocation=l;exports.xy=L;exports.yLocation=a;
|
|
@@ -1,38 +1,41 @@
|
|
|
1
1
|
import { z as n } from "zod";
|
|
2
2
|
const t = n.tuple([n.number(), n.number()]);
|
|
3
3
|
n.tuple([n.bigint(), n.bigint()]);
|
|
4
|
-
const
|
|
4
|
+
const p = n.object({ width: n.number(), height: n.number() }), N = n.object({
|
|
5
5
|
signedWidth: n.number(),
|
|
6
6
|
signedHeight: n.number()
|
|
7
7
|
}), c = ["width", "height"];
|
|
8
8
|
n.enum(c);
|
|
9
9
|
const u = ["start", "center", "end"], r = ["signedWidth", "signedHeight"];
|
|
10
10
|
n.enum(r);
|
|
11
|
-
const
|
|
11
|
+
const S = n.object({ x: n.number(), y: n.number() }), I = n.object({ clientX: n.number(), clientY: n.number() }), m = ["x", "y"], o = n.enum(m), e = ["top", "right", "bottom", "left"], L = n.enum(e), a = ["left", "right"], C = n.enum(a), b = ["top", "bottom"], E = n.enum(b), s = ["center"], T = n.enum(s), g = [...e, ...s], i = n.enum(g), D = n.enum(u), d = ["first", "last"], f = n.enum(d), O = n.object({ lower: n.number(), upper: n.number() }), l = n.object({ lower: n.bigint(), upper: n.bigint() });
|
|
12
12
|
n.union([O, t]);
|
|
13
13
|
n.union([l, t]);
|
|
14
|
-
const
|
|
14
|
+
const j = n.enum([...o.options, ...i.options]);
|
|
15
|
+
n.enum(["x", "left", "right"]);
|
|
16
|
+
n.enum(["y", "top", "bottom"]);
|
|
17
|
+
const x = n.union([o, i, n.instanceof(String)]);
|
|
15
18
|
export {
|
|
16
19
|
u as A,
|
|
17
20
|
s as C,
|
|
18
|
-
|
|
21
|
+
m as D,
|
|
19
22
|
d as O,
|
|
20
|
-
|
|
23
|
+
a as X,
|
|
21
24
|
b as Y,
|
|
22
25
|
D as a,
|
|
23
26
|
o as b,
|
|
24
|
-
|
|
25
|
-
|
|
27
|
+
j as c,
|
|
28
|
+
p as d,
|
|
26
29
|
C as e,
|
|
27
30
|
T as f,
|
|
28
|
-
|
|
31
|
+
x as g,
|
|
29
32
|
L as h,
|
|
30
33
|
I as i,
|
|
31
34
|
O as j,
|
|
32
35
|
i as l,
|
|
33
36
|
t as n,
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
+
f as o,
|
|
38
|
+
N as s,
|
|
39
|
+
S as x,
|
|
37
40
|
E as y
|
|
38
41
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const O=require("./base-
|
|
1
|
+
"use strict";const O=require("./base-BLNViP3D.cjs"),d=r=>(e,n)=>{if(typeof e=="bigint"){if(b(n))return r(e,BigInt(n));const t=r(Number(e),Number(n));return typeof t=="number"?BigInt(Math.round(t)):t}return r(Number(e),Number(n))},m=d((r,e)=>r-e),h=d((r,e)=>r+e),j=(r,e,n=1e-4)=>Math.abs(r-e)<n,I=(r,e)=>{const n=typeof r=="bigint",t=typeof e=="bigint";return n&&t?r===e:n&&b(e)?r===BigInt(e):t&&b(r)?e===BigInt(r):r===e},P=r=>{const e=10**Math.floor(Math.log10(r));return Math.round(r/e)*e},x=d((r,e)=>r<=e?r:e),b=r=>typeof r=="bigint"?!0:Number.isInteger(r),T=d((r,e)=>r>=e?r:e),v=r=>typeof r=="bigint"?r<0n?-r:r:r<0?-r:r,z=d((r,e)=>r*e),E=d((r,e)=>r/e),u=(r,e,n)=>{const t={};if(typeof e=="object"&&(n=e,e=void 0),n={makeValid:!0,...n},typeof r=="number"||typeof r=="bigint")e!=null?(t.lower=r,t.upper=e):(t.lower=typeof r=="bigint"?0n:0,t.upper=r);else if(Array.isArray(r)){if(r.length!==2)throw new Error("bounds: expected array of length 2");[t.lower,t.upper]=r}else t.lower=r.lower,t.upper=r.upper;return n?.makeValid?B(t):t},q=Object.freeze({lower:0,upper:0}),D=Object.freeze({lower:-1/0,upper:1/0}),F=Object.freeze({lower:0,upper:1}),L=Object.freeze({lower:-1,upper:1}),Z=(r,e)=>{if(r==null&&e==null)return!0;if(r==null||e==null)return!1;const n=u(r),t=u(e);return n?.lower===t?.lower&&n?.upper===t?.upper},B=r=>r.lower>r.upper?{lower:r.upper,upper:r.lower}:r,_=(r,e)=>{const n=u(r);return e<n.lower?n.lower:e>=n.upper?n.upper-(typeof n.upper=="number"?1:1n):e},f=(r,e)=>{const n=u(r);if(typeof e=="number"||typeof e=="bigint")return e>=n.lower&&e<n.upper;const t=u(e);return t.lower>=n.lower&&t.upper<=n.upper},k=(r,e)=>{const n=u(r),t=u(e);return n.lower===t.lower?!0:t.upper===n.lower||t.lower===n.upper?!1:f(n,t.upper)||f(n,t.lower)||f(t,n.upper)||f(t,n.lower)},w=r=>{const e=u(r);return e.upper-e.lower},C=r=>{const e=u(r);return typeof e.lower=="bigint"?e.lower===0n&&e.upper===0n:e.lower===0&&e.upper===0},S=r=>{const e=w(r);return typeof e=="number"?e===0:e===0n},V=r=>{const e=u(r);return typeof e.lower=="bigint"?!0:Number.isFinite(e.lower)&&Number.isFinite(e.upper)},$=r=>{const e=u(r);return(e.upper+e.lower)/2},N=r=>({lower:Math.min(...r.map(e=>u(e).lower)),upper:Math.max(...r.map(e=>u(e).upper))}),R=r=>({lower:Math.max(...r.map(e=>u(e).lower)),upper:Math.min(...r.map(e=>u(e).upper))}),U=r=>{const e=u(r),n=typeof e.lower=="bigint";return Array.from({length:Number(w(r))},(t,o)=>n?e.lower+BigInt(o):e.lower+o)},y=(r,e)=>{const n=r.map(s=>u(s)),t=n.findIndex(s=>f(s,e)||e<s.lower);if(t===-1)return{index:r.length,position:0};const o=n[t];return f(o,e)?{index:t,position:Number(e-o.lower)}:{index:t,position:0}},g={removeBefore:0,removeAfter:0,insertInto:0,deleteInBetween:0},W=(r,e)=>{const n=r.map(l=>u(l)),t=u(e);if(n.length===0)return g;const o=y(n,t.lower),s=y(n,t.upper);if(o.index===r.length)return{...g,insertInto:r.length};if(s.index===0)return{...g,removeAfter:s.position};if(o.index===s.index)return o.position!==0&&s.position!==0?null:{removeAfter:s.position,removeBefore:o.position,insertInto:o.index,deleteInBetween:0};let i=s.index-o.index,c=o.index,p=m(Number(w(n[o.index])),o.position);return o.position!==0?(i-=1,c+=1):p=0,{removeBefore:p,removeAfter:s.position,insertInto:c,deleteInBetween:i}},M=(r,e,n)=>{const t=r.map(c=>u(c)),o=n>0?1:n<0?-1:0;if(o===0)return e;let s=n,i=e;for(;I(s,0)===!1;){const c=t.findIndex(p=>o>0?i>=p.lower&&i<p.upper:i>p.lower&&i<=p.upper);if(c!==-1){const p=t[c];let l;if(o>0?l=m(p.upper,i):l=m(i,p.lower),l>0){const a=x(v(s),l);if(i=h(i,o>0?a:-a),s=m(s,o>0?a:-a),I(s,0))return i;continue}}if(o>0){const p=t.filter(l=>l.lower>i);if(p.length>0)i=p[0].lower;else return i}else{const p=t.filter(l=>l.upper<i);if(p.length>0)i=p[p.length-1].upper;else return i}}return i},A=(r,e,n)=>{const t=r.map(i=>u(i));if(e===n)return typeof e=="bigint"?0n:0;const o=e<n?u([e,n]):u([n,e]);let s=typeof e=="bigint"?0n:0;for(const i of t){const c=i.lower>o.lower?i.lower:o.lower,p=i.upper<o.upper?i.upper:o.upper;if(c<p){const l=p-c;s=s+l}}return s},G=Object.freeze(Object.defineProperty({__proto__:null,CLIP:L,DECIMAL:F,INFINITE:D,ZERO:q,bounds:O.bounds,buildInsertionPlan:W,clamp:_,construct:u,contains:f,distance:A,equals:Z,findInsertPosition:y,isFinite:V,isZero:C,linspace:U,makeValid:B,max:N,mean:$,min:R,overlapsWith:k,span:w,spanIsZero:S,traverse:M},Symbol.toStringTag,{value:"Module"}));exports.abs=v;exports.add=h;exports.bounds=G;exports.clamp=_;exports.closeTo=j;exports.construct=u;exports.contains=f;exports.distance=A;exports.div=E;exports.equal=I;exports.isInteger=b;exports.max=N;exports.max$1=T;exports.min=x;exports.mult=z;exports.roundToNearestMagnitude=P;exports.span=w;exports.sub=m;exports.traverse=M;
|
package/dist/bounds.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./bounds-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./bounds-BXbqBINt.cjs");exports.bounds=e.bounds;
|
package/dist/bounds.js
CHANGED
|
@@ -1,75 +1,75 @@
|
|
|
1
1
|
import { z as x } from "zod";
|
|
2
|
-
import { c as O } from "./direction-
|
|
3
|
-
import { c as A, T as
|
|
4
|
-
import { Z as g, O as U, e as I, t as T, c as k, a as L, r as $ } from "./xy-
|
|
5
|
-
import { x as
|
|
6
|
-
const
|
|
7
|
-
top:
|
|
8
|
-
left:
|
|
9
|
-
width:
|
|
10
|
-
height:
|
|
2
|
+
import { c as O } from "./direction-DKdfJwj7.js";
|
|
3
|
+
import { c as A, T as C, B as j, x as S, a as Z, b as q, d as F, e as G, f as D, C as X, g as Y } from "./location-CGLioInQ.js";
|
|
4
|
+
import { Z as g, O as U, e as I, t as T, c as k, a as L, r as $ } from "./xy-CBuhMaIo.js";
|
|
5
|
+
import { x as N, X as H, Y as J } from "./base-BORMP3mH.js";
|
|
6
|
+
const _ = x.union([x.number(), x.string()]), K = x.object({
|
|
7
|
+
top: _,
|
|
8
|
+
left: _,
|
|
9
|
+
width: _,
|
|
10
|
+
height: _
|
|
11
11
|
}), Q = x.object({
|
|
12
12
|
left: x.number(),
|
|
13
13
|
top: x.number(),
|
|
14
14
|
right: x.number(),
|
|
15
15
|
bottom: x.number()
|
|
16
16
|
}), V = x.object({
|
|
17
|
-
one:
|
|
18
|
-
two:
|
|
17
|
+
one: N,
|
|
18
|
+
two: N,
|
|
19
19
|
root: A
|
|
20
|
-
}), P = { one: g, two: g, root:
|
|
20
|
+
}), P = { one: g, two: g, root: C }, oo = { one: g, two: U, root: j }, v = (o, t) => ({
|
|
21
21
|
one: o.one,
|
|
22
22
|
two: o.two,
|
|
23
23
|
root: t ?? o.root
|
|
24
|
-
}), c = (o, t, e = 0, n = 0,
|
|
25
|
-
const
|
|
24
|
+
}), c = (o, t, e = 0, n = 0, s) => {
|
|
25
|
+
const r = {
|
|
26
26
|
one: { ...g },
|
|
27
27
|
two: { ...g },
|
|
28
|
-
root:
|
|
28
|
+
root: s ?? C
|
|
29
29
|
};
|
|
30
30
|
if (typeof o == "number") {
|
|
31
31
|
if (typeof t != "number")
|
|
32
32
|
throw new Error("Box constructor called with invalid arguments");
|
|
33
|
-
return
|
|
33
|
+
return r.one = { x: o, y: t }, r.two = { x: r.one.x + e, y: r.one.y + n }, r;
|
|
34
34
|
}
|
|
35
|
-
return "one" in o && "two" in o && "root" in o ? { ...o, root:
|
|
36
|
-
x:
|
|
37
|
-
y:
|
|
38
|
-
} : "signedWidth" in t ?
|
|
39
|
-
x:
|
|
40
|
-
y:
|
|
41
|
-
} :
|
|
35
|
+
return "one" in o && "two" in o && "root" in o ? { ...o, root: s ?? o.root } : ("getBoundingClientRect" in o && (o = o.getBoundingClientRect()), "left" in o ? (r.one = { x: o.left, y: o.top }, r.two = { x: o.right, y: o.bottom }, r) : (r.one = o, t == null ? r.two = { x: r.one.x + e, y: r.one.y + n } : typeof t == "number" ? r.two = { x: r.one.x + t, y: r.one.y + e } : "width" in t ? r.two = {
|
|
36
|
+
x: r.one.x + t.width,
|
|
37
|
+
y: r.one.y + t.height
|
|
38
|
+
} : "signedWidth" in t ? r.two = {
|
|
39
|
+
x: r.one.x + t.signedWidth,
|
|
40
|
+
y: r.one.y + t.signedHeight
|
|
41
|
+
} : r.two = t, r));
|
|
42
42
|
}, to = (o, t, e) => {
|
|
43
43
|
const n = c(o);
|
|
44
44
|
if (typeof t == "string") {
|
|
45
45
|
if (e == null) throw new Error("Invalid arguments for resize");
|
|
46
|
-
const
|
|
46
|
+
const s = O(t);
|
|
47
47
|
return c(
|
|
48
48
|
n.one,
|
|
49
49
|
void 0,
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
s === "x" ? e : w(n),
|
|
51
|
+
s === "y" ? e : d(n),
|
|
52
52
|
n.root
|
|
53
53
|
);
|
|
54
54
|
}
|
|
55
55
|
return c(n.one, t, void 0, void 0, n.root);
|
|
56
56
|
}, no = (o, t, e = !0) => {
|
|
57
57
|
const n = c(o);
|
|
58
|
-
let
|
|
59
|
-
return e && (
|
|
58
|
+
let s = (r, i) => r < i;
|
|
59
|
+
return e && (s = (r, i) => r <= i), "one" in t ? s(u(n), u(t)) && s(f(t), f(n)) && s(a(n), a(t)) && s(l(t), l(n)) : s(u(n), t.x) && s(t.x, f(n)) && s(a(n), t.y) && s(t.y, l(n));
|
|
60
60
|
}, eo = (o, t) => I(o.one, t.one) && I(o.two, t.two) && S(o.root, t.root), W = (o) => ({
|
|
61
61
|
width: w(o),
|
|
62
62
|
height: d(o)
|
|
63
|
-
}), so = (o) => ({
|
|
64
|
-
signedWidth: _(o),
|
|
65
|
-
signedHeight: b(o)
|
|
66
63
|
}), ro = (o) => ({
|
|
67
|
-
|
|
68
|
-
|
|
64
|
+
signedWidth: h(o),
|
|
65
|
+
signedHeight: b(o)
|
|
66
|
+
}), so = (o) => ({
|
|
67
|
+
top: a(o),
|
|
68
|
+
left: u(o),
|
|
69
69
|
width: w(o),
|
|
70
70
|
height: d(o)
|
|
71
|
-
}),
|
|
72
|
-
const n = O(t) === "y" ? b(o) :
|
|
71
|
+
}), M = (o, t, e = !1) => {
|
|
72
|
+
const n = O(t) === "y" ? b(o) : h(o);
|
|
73
73
|
return e ? n : Math.abs(n);
|
|
74
74
|
}, y = (o, t) => {
|
|
75
75
|
const e = c(o);
|
|
@@ -80,40 +80,40 @@ const h = x.union([x.number(), x.string()]), K = x.object({
|
|
|
80
80
|
}, m = (o, t) => {
|
|
81
81
|
const e = c(o), n = Z(e.root).includes(t) ? Math.min : Math.max;
|
|
82
82
|
return H.includes(t) ? n(e.one.x, e.two.x) : n(e.one.y, e.two.y);
|
|
83
|
-
}, co = (o) => o.one.x === o.two.x && o.one.y === o.two.y, w = (o) =>
|
|
83
|
+
}, co = (o) => o.one.x === o.two.x && o.one.y === o.two.y, w = (o) => M(o, "x"), d = (o) => M(o, "y"), h = (o) => {
|
|
84
84
|
const t = c(o);
|
|
85
85
|
return t.two.x - t.one.x;
|
|
86
86
|
}, b = (o) => {
|
|
87
87
|
const t = c(o);
|
|
88
88
|
return t.two.y - t.one.y;
|
|
89
|
-
}, z = (o) => y(o,
|
|
90
|
-
x:
|
|
89
|
+
}, z = (o) => y(o, C), io = (o) => y(o, q), xo = (o) => y(o, F), yo = (o) => y(o, j), uo = (o) => y(o, G), ao = (o) => y(o, D), wo = (o) => y(o, X), fo = (o) => y(o, Y), f = (o) => m(o, "right"), l = (o) => m(o, "bottom"), u = (o) => m(o, "left"), a = (o) => m(o, "top"), E = (o) => T(z(o), {
|
|
90
|
+
x: h(o) / 2,
|
|
91
91
|
y: b(o) / 2
|
|
92
92
|
}), B = (o) => {
|
|
93
93
|
const t = c(o);
|
|
94
|
-
return t.root.x === "left" ?
|
|
94
|
+
return t.root.x === "left" ? u(t) : f(t);
|
|
95
95
|
}, R = (o) => {
|
|
96
96
|
const t = c(o);
|
|
97
|
-
return t.root.y === "top" ?
|
|
97
|
+
return t.root.y === "top" ? a(t) : l(t);
|
|
98
98
|
}, lo = (o) => ({ x: B(o), y: R(o) }), mo = (o) => {
|
|
99
99
|
const t = c(o);
|
|
100
100
|
return { lower: t.one.x, upper: t.two.x };
|
|
101
101
|
}, po = (o) => {
|
|
102
102
|
const t = c(o);
|
|
103
103
|
return { lower: t.one.y, upper: t.two.y };
|
|
104
|
-
}, go = (o, t) => v(o, t),
|
|
104
|
+
}, go = (o, t) => v(o, t), _o = (o, t) => {
|
|
105
105
|
const e = c(o), n = H.includes(t) ? "x" : J.includes(t) ? "y" : null;
|
|
106
106
|
if (n === null) throw new Error(`Invalid location: ${t}`);
|
|
107
|
-
const
|
|
108
|
-
return
|
|
109
|
-
},
|
|
110
|
-
const e = c(o), n = c(t),
|
|
111
|
-
return c({ x:
|
|
107
|
+
const s = t === "top" || t === "left" ? Math.min : Math.max, r = { ...e.one }, i = { ...e.two };
|
|
108
|
+
return r[n] = s(e.one[n], e.two[n]), i[n] = s(e.one[n], e.two[n]), [r, i];
|
|
109
|
+
}, ho = (o, t) => {
|
|
110
|
+
const e = c(o), n = c(t), s = B(n) + (w(n) - w(e)) / 2, r = R(n) + (d(n) - d(e)) / 2;
|
|
111
|
+
return c({ x: s, y: r }, W(e));
|
|
112
112
|
}, bo = (o) => typeof o != "object" || o == null ? !1 : "one" in o && "two" in o && "root" in o, To = (o) => w(o) / d(o), Eo = (o, t, e) => {
|
|
113
113
|
if (typeof t == "string") {
|
|
114
114
|
if (e == null) throw new Error("Undefined amount passed into box.translate");
|
|
115
|
-
const
|
|
116
|
-
t = k(
|
|
115
|
+
const s = O(t);
|
|
116
|
+
t = k(s, e);
|
|
117
117
|
}
|
|
118
118
|
const n = c(o);
|
|
119
119
|
return c(
|
|
@@ -124,9 +124,9 @@ const h = x.union([x.number(), x.string()]), K = x.object({
|
|
|
124
124
|
n.root
|
|
125
125
|
);
|
|
126
126
|
}, Oo = (o, t) => {
|
|
127
|
-
const e = Math.max(
|
|
128
|
-
return e >
|
|
129
|
-
},
|
|
127
|
+
const e = Math.max(u(o), u(t)), n = Math.max(a(o), a(t)), s = Math.min(f(o), f(t)), r = Math.min(l(o), l(t));
|
|
128
|
+
return e > s || n > r ? P : c({ x: e, y: n }, { x: s, y: r }, void 0, void 0, o.root);
|
|
129
|
+
}, Co = (o) => w(o) * d(o), Mo = (o, t) => {
|
|
130
130
|
const e = c(o);
|
|
131
131
|
return c(
|
|
132
132
|
L(e.one, t),
|
|
@@ -135,9 +135,9 @@ const h = x.union([x.number(), x.string()]), K = x.object({
|
|
|
135
135
|
void 0,
|
|
136
136
|
e.root
|
|
137
137
|
);
|
|
138
|
-
}, Bo = (o, t, e, n,
|
|
138
|
+
}, Bo = (o, t, e, n, s, r) => {
|
|
139
139
|
const i = { x: o, y: t }, p = { x: o + e, y: t + n };
|
|
140
|
-
return
|
|
140
|
+
return s.x !== r.x && (s.x === "center" ? (i.x -= e / 2, p.x -= e / 2) : (i.x -= e, p.x -= e)), s.y !== r.y && (s.y === "center" ? (i.y -= n / 2, p.y -= n / 2) : (i.y -= n, p.y -= n)), c(i, p, void 0, void 0, r);
|
|
141
141
|
}, Ro = (o) => {
|
|
142
142
|
const t = c(o);
|
|
143
143
|
return c($(t.one), $(t.two), void 0, void 0, t.root);
|
|
@@ -145,13 +145,13 @@ const h = x.union([x.number(), x.string()]), K = x.object({
|
|
|
145
145
|
__proto__: null,
|
|
146
146
|
DECIMAL: oo,
|
|
147
147
|
ZERO: P,
|
|
148
|
-
area:
|
|
148
|
+
area: Co,
|
|
149
149
|
areaIsZero: co,
|
|
150
150
|
aspect: To,
|
|
151
151
|
bottom: l,
|
|
152
|
-
bottomCenter:
|
|
152
|
+
bottomCenter: uo,
|
|
153
153
|
bottomLeft: yo,
|
|
154
|
-
bottomRight:
|
|
154
|
+
bottomRight: ao,
|
|
155
155
|
box: V,
|
|
156
156
|
center: E,
|
|
157
157
|
centerLeft: wo,
|
|
@@ -160,33 +160,33 @@ const h = x.union([x.number(), x.string()]), K = x.object({
|
|
|
160
160
|
constructWithAlternateRoot: Bo,
|
|
161
161
|
contains: no,
|
|
162
162
|
copy: v,
|
|
163
|
-
css:
|
|
163
|
+
css: so,
|
|
164
164
|
cssBox: K,
|
|
165
|
-
dim:
|
|
165
|
+
dim: M,
|
|
166
166
|
dims: W,
|
|
167
167
|
domRect: Q,
|
|
168
|
-
edgePoints:
|
|
168
|
+
edgePoints: _o,
|
|
169
169
|
equals: eo,
|
|
170
170
|
height: d,
|
|
171
171
|
intersection: Oo,
|
|
172
172
|
isBox: bo,
|
|
173
|
-
left:
|
|
173
|
+
left: u,
|
|
174
174
|
loc: m,
|
|
175
|
-
positionInCenter:
|
|
175
|
+
positionInCenter: ho,
|
|
176
176
|
reRoot: go,
|
|
177
177
|
resize: to,
|
|
178
178
|
right: f,
|
|
179
179
|
root: lo,
|
|
180
180
|
round: Ro,
|
|
181
|
-
signedDims:
|
|
181
|
+
signedDims: ro,
|
|
182
182
|
signedHeight: b,
|
|
183
|
-
signedWidth:
|
|
184
|
-
top:
|
|
183
|
+
signedWidth: h,
|
|
184
|
+
top: a,
|
|
185
185
|
topCenter: io,
|
|
186
186
|
topLeft: z,
|
|
187
187
|
topRight: xo,
|
|
188
188
|
translate: Eo,
|
|
189
|
-
truncate:
|
|
189
|
+
truncate: Mo,
|
|
190
190
|
width: w,
|
|
191
191
|
x: B,
|
|
192
192
|
xBounds: mo,
|
|
@@ -195,15 +195,9 @@ const h = x.union([x.number(), x.string()]), K = x.object({
|
|
|
195
195
|
yBounds: po
|
|
196
196
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
197
197
|
export {
|
|
198
|
-
Bo as a,
|
|
199
198
|
Ho as b,
|
|
200
199
|
c,
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
mo as f,
|
|
204
|
-
d as h,
|
|
205
|
-
Oo as i,
|
|
206
|
-
w,
|
|
207
|
-
y as x,
|
|
200
|
+
bo as i,
|
|
201
|
+
mo as x,
|
|
208
202
|
po as y
|
|
209
203
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const y=require("zod"),M=require("./direction-XCdrc4is.cjs"),u=require("./location-DJ_K4SlP.cjs"),i=require("./xy-BKIJiLu_.cjs"),m=require("./base-BLNViP3D.cjs"),p=y.z.union([y.z.number(),y.z.string()]),j=y.z.object({top:p,left:p,width:p,height:p}),F=y.z.object({left:y.z.number(),top:y.z.number(),right:y.z.number(),bottom:y.z.number()}),H=y.z.object({one:m.xy,two:m.xy,root:u.corner}),C={one:i.ZERO,two:i.ZERO,root:u.TOP_LEFT},v={one:i.ZERO,two:i.ONE,root:u.BOTTOM_LEFT},L=(t,o)=>({one:t.one,two:t.two,root:o??t.root}),c=(t,o,e=0,n=0,s)=>{const r={one:{...i.ZERO},two:{...i.ZERO},root:s??u.TOP_LEFT};if(typeof t=="number"){if(typeof o!="number")throw new Error("Box constructor called with invalid arguments");return r.one={x:t,y:o},r.two={x:r.one.x+e,y:r.one.y+n},r}return"one"in t&&"two"in t&&"root"in t?{...t,root:s??t.root}:("getBoundingClientRect"in t&&(t=t.getBoundingClientRect()),"left"in t?(r.one={x:t.left,y:t.top},r.two={x:t.right,y:t.bottom},r):(r.one=t,o==null?r.two={x:r.one.x+e,y:r.one.y+n}:typeof o=="number"?r.two={x:r.one.x+o,y:r.one.y+e}:"width"in o?r.two={x:r.one.x+o.width,y:r.one.y+o.height}:"signedWidth"in o?r.two={x:r.one.x+o.signedWidth,y:r.one.y+o.signedHeight}:r.two=o,r))},A=(t,o,e)=>{const n=c(t);if(typeof o=="string"){if(e==null)throw new Error("Invalid arguments for resize");const s=M.construct(o);return c(n.one,void 0,s==="x"?e:f(n),s==="y"?e:_(n),n.root)}return c(n.one,o,void 0,void 0,n.root)},S=(t,o,e=!0)=>{const n=c(t);let s=(r,x)=>r<x;return e&&(s=(r,x)=>r<=x),"one"in o?s(l(n),l(o))&&s(a(o),a(n))&&s(w(n),w(o))&&s(g(o),g(n)):s(l(n),o.x)&&s(o.x,a(n))&&s(w(n),o.y)&&s(o.y,g(n))},W=(t,o)=>i.equals(t.one,o.one)&&i.equals(t.two,o.two)&&u.xyEquals(t.root,o.root),I=t=>({width:f(t),height:_(t)}),G=t=>({signedWidth:O(t),signedHeight:E(t)}),D=t=>({top:w(t),left:l(t),width:f(t),height:_(t)}),R=(t,o,e=!1)=>{const n=M.construct(o)==="y"?E(t):O(t);return e?n:Math.abs(n)},d=(t,o)=>{const e=c(t);return{x:o.x==="center"?b(e).x:T(e,o.x),y:o.y==="center"?b(e).y:T(e,o.y)}},T=(t,o)=>{const e=c(t),n=u.xyCouple(e.root).includes(o)?Math.min:Math.max;return m.X_LOCATIONS.includes(o)?n(e.one.x,e.two.x):n(e.one.y,e.two.y)},X=t=>t.one.x===t.two.x&&t.one.y===t.two.y,f=t=>R(t,"x"),_=t=>R(t,"y"),O=t=>{const o=c(t);return o.two.x-o.one.x},E=t=>{const o=c(t);return o.two.y-o.one.y},q=t=>d(t,u.TOP_LEFT),$=t=>d(t,u.TOP_CENTER),U=t=>d(t,u.TOP_RIGHT),Y=t=>d(t,u.BOTTOM_LEFT),k=t=>d(t,u.BOTTOM_CENTER),J=t=>d(t,u.BOTTOM_RIGHT),K=t=>d(t,u.CENTER_LEFT),Q=t=>d(t,u.CENTER_RIGHT),a=t=>T(t,"right"),g=t=>T(t,"bottom"),l=t=>T(t,"left"),w=t=>T(t,"top"),b=t=>i.translate(q(t),{x:O(t)/2,y:E(t)/2}),z=t=>{const o=c(t);return o.root.x==="left"?l(o):a(o)},B=t=>{const o=c(t);return o.root.y==="top"?w(o):g(o)},V=t=>({x:z(t),y:B(t)}),N=t=>{const o=c(t);return{lower:o.one.x,upper:o.two.x}},P=t=>{const o=c(t);return{lower:o.one.y,upper:o.two.y}},tt=(t,o)=>L(t,o),ot=(t,o)=>{const e=c(t),n=m.X_LOCATIONS.includes(o)?"x":m.Y_LOCATIONS.includes(o)?"y":null;if(n===null)throw new Error(`Invalid location: ${o}`);const s=o==="top"||o==="left"?Math.min:Math.max,r={...e.one},x={...e.two};return r[n]=s(e.one[n],e.two[n]),x[n]=s(e.one[n],e.two[n]),[r,x]},nt=(t,o)=>{const e=c(t),n=c(o),s=z(n)+(f(n)-f(e))/2,r=B(n)+(_(n)-_(e))/2;return c({x:s,y:r},I(e))},Z=t=>typeof t!="object"||t==null?!1:"one"in t&&"two"in t&&"root"in t,et=t=>f(t)/_(t),rt=(t,o,e)=>{if(typeof o=="string"){if(e==null)throw new Error("Undefined amount passed into box.translate");const s=M.construct(o);o=i.construct(s,e)}const n=c(t);return c(i.translate(n.one,o),i.translate(n.two,o),void 0,void 0,n.root)},st=(t,o)=>{const e=Math.max(l(t),l(o)),n=Math.max(w(t),w(o)),s=Math.min(a(t),a(o)),r=Math.min(g(t),g(o));return e>s||n>r?C:c({x:e,y:n},{x:s,y:r},void 0,void 0,t.root)},ct=t=>f(t)*_(t),it=(t,o)=>{const e=c(t);return c(i.truncate(e.one,o),i.truncate(e.two,o),void 0,void 0,e.root)},ut=(t,o,e,n,s,r)=>{const x={x:t,y:o},h={x:t+e,y:o+n};return s.x!==r.x&&(s.x==="center"?(x.x-=e/2,h.x-=e/2):(x.x-=e,h.x-=e)),s.y!==r.y&&(s.y==="center"?(x.y-=n/2,h.y-=n/2):(x.y-=n,h.y-=n)),c(x,h,void 0,void 0,r)},xt=t=>{const o=c(t);return c(i.round(o.one),i.round(o.two),void 0,void 0,o.root)},yt=Object.freeze(Object.defineProperty({__proto__:null,DECIMAL:v,ZERO:C,area:ct,areaIsZero:X,aspect:et,bottom:g,bottomCenter:k,bottomLeft:Y,bottomRight:J,box:H,center:b,centerLeft:K,centerRight:Q,construct:c,constructWithAlternateRoot:ut,contains:S,copy:L,css:D,cssBox:j,dim:R,dims:I,domRect:F,edgePoints:ot,equals:W,height:_,intersection:st,isBox:Z,left:l,loc:T,positionInCenter:nt,reRoot:tt,resize:A,right:a,root:V,round:xt,signedDims:G,signedHeight:E,signedWidth:O,top:w,topCenter:$,topLeft:q,topRight:U,translate:rt,truncate:it,width:f,x:z,xBounds:N,xyLoc:d,y:B,yBounds:P},Symbol.toStringTag,{value:"Module"}));exports.box=yt;exports.construct=c;exports.isBox=Z;exports.xBounds=N;exports.yBounds=P;
|
package/dist/box.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./box-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./box-qgxWXNhm.cjs");exports.box=e.box;
|
package/dist/box.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z as h } from "zod";
|
|
2
|
-
import { d as o, x as g, n as a } from "./base-
|
|
2
|
+
import { d as o, x as g, n as a } from "./base-BORMP3mH.js";
|
|
3
3
|
const r = h.object({ signedWidth: h.number(), signedHeight: h.number() }), c = h.union([o, r, g, a]), u = { width: 0, height: 0 }, m = { width: 1, height: 1 }, n = (t, e) => typeof t == "number" ? { width: t, height: e ?? t } : Array.isArray(t) ? { width: t[0], height: t[1] } : "x" in t ? { width: t.x, height: t.y } : "signedWidth" in t ? { width: t.signedWidth, height: t.signedHeight } : { ...t }, d = (t, e) => {
|
|
4
4
|
if (e == null) return !1;
|
|
5
5
|
const i = n(t), s = n(e);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const h=require("zod"),s=require("./base-
|
|
1
|
+
"use strict";const h=require("zod"),s=require("./base-BLNViP3D.cjs"),o=h.z.object({signedWidth:h.z.number(),signedHeight:h.z.number()}),g=h.z.union([s.dimensions,o,s.xy,s.numberCouple]),c={width:0,height:0},u={width:1,height:1},n=(t,e)=>typeof t=="number"?{width:t,height:e??t}:Array.isArray(t)?{width:t[0],height:t[1]}:"x"in t?{width:t.x,height:t.y}:"signedWidth"in t?{width:t.signedWidth,height:t.signedHeight}:{...t},a=(t,e)=>{if(e==null)return!1;const i=n(t),r=n(e);return i.width===r.width&&i.height===r.height},d=t=>{const e=n(t);return{width:e.height,height:e.width}},m=t=>{const e=n(t);return`0 0 ${e.width} ${e.height}`},l=t=>{const e=n(t);return[e.width,e.height]},p=t=>({width:Math.max(...t.map(e=>n(e).width)),height:Math.max(...t.map(e=>n(e).height))}),b=t=>({width:Math.min(...t.map(e=>n(e).width)),height:Math.min(...t.map(e=>n(e).height))}),f=(t,e)=>{const i=n(t);return{width:i.width*e,height:i.height*e}},w=Object.freeze(Object.defineProperty({__proto__:null,DECIMAL:u,ZERO:c,construct:n,couple:l,crude:g,dimensions:s.dimensions,equals:a,max:p,min:b,scale:f,signed:o,svgViewBox:m,swap:d},Symbol.toStringTag,{value:"Module"}));exports.dimensions=w;
|
package/dist/dimensions.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./dimensions-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./dimensions-qY12pyfC.cjs");exports.dimensions=e.dimensions;
|
package/dist/dimensions.js
CHANGED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { c as i, D as n, Y as o, b as r } from "./base-BORMP3mH.js";
|
|
2
|
+
const s = i, t = (e) => n.includes(e) ? e : o.includes(e) ? "y" : "x", c = (e) => t(e) === "x" ? "y" : "x", d = (e) => t(e) === "x" ? "width" : "height", u = (e) => t(e) === "x" ? "left" : "top", a = (e) => s.safeParse(e).success, l = (e) => t(e) === "x" ? "signedWidth" : "signedHeight", f = (e) => e === "center" ? !1 : t(e) === "x", x = (e) => t(e) === "y", p = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3
|
+
__proto__: null,
|
|
4
|
+
DIRECTIONS: n,
|
|
5
|
+
construct: t,
|
|
6
|
+
crude: s,
|
|
7
|
+
dimension: d,
|
|
8
|
+
direction: r,
|
|
9
|
+
isDirection: a,
|
|
10
|
+
isX: f,
|
|
11
|
+
isY: x,
|
|
12
|
+
location: u,
|
|
13
|
+
signedDimension: l,
|
|
14
|
+
swap: c
|
|
15
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
16
|
+
export {
|
|
17
|
+
t as c,
|
|
18
|
+
p as d
|
|
19
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const n=require("./base-BLNViP3D.cjs"),i=n.crudeDirection,t=e=>n.DIRECTIONS.includes(e)?e:n.Y_LOCATIONS.includes(e)?"y":"x",s=e=>t(e)==="x"?"y":"x",c=e=>t(e)==="x"?"width":"height",o=e=>t(e)==="x"?"left":"top",r=e=>i.safeParse(e).success,u=e=>t(e)==="x"?"signedWidth":"signedHeight",d=e=>e==="center"?!1:t(e)==="x",l=e=>t(e)==="y",a=Object.freeze(Object.defineProperty({__proto__:null,DIRECTIONS:n.DIRECTIONS,construct:t,crude:i,dimension:c,direction:n.direction,isDirection:r,isX:d,isY:l,location:o,signedDimension:u,swap:s},Symbol.toStringTag,{value:"Module"}));exports.construct=t;exports.direction=a;
|
package/dist/direction.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./direction-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./direction-XCdrc4is.cjs");exports.direction=e.direction;
|
package/dist/direction.js
CHANGED