@zag-js/rect-utils 2.0.0-next.3 → 2.0.0-next.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.
Files changed (89) hide show
  1. package/dist/align.d.mts +2 -5
  2. package/dist/align.d.ts +2 -5
  3. package/dist/align.js +27 -44
  4. package/dist/align.mjs +23 -19
  5. package/dist/angle.d.mts +2 -5
  6. package/dist/angle.d.ts +2 -5
  7. package/dist/angle.js +8 -32
  8. package/dist/angle.mjs +4 -7
  9. package/dist/clamp.d.mts +8 -11
  10. package/dist/clamp.d.ts +8 -11
  11. package/dist/clamp.js +23 -46
  12. package/dist/clamp.mjs +18 -20
  13. package/dist/closest.d.mts +4 -7
  14. package/dist/closest.d.ts +4 -7
  15. package/dist/closest.js +35 -62
  16. package/dist/closest.mjs +29 -35
  17. package/dist/compass.d.mts +1 -3
  18. package/dist/compass.d.ts +1 -3
  19. package/dist/compass.js +4 -18
  20. package/dist/compass.mjs +1 -0
  21. package/dist/constrain.d.mts +2 -5
  22. package/dist/constrain.d.ts +2 -5
  23. package/dist/constrain.js +12 -37
  24. package/dist/constrain.mjs +8 -12
  25. package/dist/contains.d.mts +4 -7
  26. package/dist/contains.d.ts +4 -7
  27. package/dist/contains.js +11 -36
  28. package/dist/contains.mjs +5 -9
  29. package/dist/distance.d.mts +7 -10
  30. package/dist/distance.d.ts +7 -10
  31. package/dist/distance.js +55 -60
  32. package/dist/distance.mjs +48 -32
  33. package/dist/equality.d.mts +4 -7
  34. package/dist/equality.d.ts +4 -7
  35. package/dist/equality.js +13 -38
  36. package/dist/equality.mjs +7 -11
  37. package/dist/from-element.d.mts +12 -15
  38. package/dist/from-element.d.ts +12 -15
  39. package/dist/from-element.js +39 -58
  40. package/dist/from-element.mjs +35 -33
  41. package/dist/from-points.d.mts +2 -5
  42. package/dist/from-points.d.ts +2 -5
  43. package/dist/from-points.js +18 -36
  44. package/dist/from-points.mjs +14 -11
  45. package/dist/from-range.d.mts +2 -5
  46. package/dist/from-range.d.ts +2 -5
  47. package/dist/from-range.js +25 -46
  48. package/dist/from-range.mjs +19 -19
  49. package/dist/from-rotation.d.mts +4 -7
  50. package/dist/from-rotation.d.ts +4 -7
  51. package/dist/from-rotation.js +31 -56
  52. package/dist/from-rotation.mjs +25 -29
  53. package/dist/from-window.d.mts +13 -16
  54. package/dist/from-window.d.ts +13 -16
  55. package/dist/from-window.js +29 -44
  56. package/dist/from-window.mjs +24 -18
  57. package/dist/index.d.mts +21 -21
  58. package/dist/index.d.ts +21 -21
  59. package/dist/index.js +91 -61
  60. package/dist/index.mjs +20 -21
  61. package/dist/interact.d.mts +34 -37
  62. package/dist/interact.d.ts +34 -37
  63. package/dist/interact.js +414 -350
  64. package/dist/interact.mjs +396 -311
  65. package/dist/intersection.d.mts +4 -7
  66. package/dist/intersection.d.ts +4 -7
  67. package/dist/intersection.js +34 -45
  68. package/dist/intersection.mjs +28 -18
  69. package/dist/operations.d.mts +6 -9
  70. package/dist/operations.d.ts +6 -9
  71. package/dist/operations.js +38 -57
  72. package/dist/operations.mjs +30 -28
  73. package/dist/polygon.d.mts +6 -9
  74. package/dist/polygon.d.ts +6 -9
  75. package/dist/polygon.js +73 -82
  76. package/dist/polygon.mjs +67 -55
  77. package/dist/rect.d.mts +55 -58
  78. package/dist/rect.d.ts +55 -58
  79. package/dist/rect.js +88 -117
  80. package/dist/rect.mjs +70 -78
  81. package/dist/types.d.mts +42 -46
  82. package/dist/types.d.ts +42 -46
  83. package/dist/types.js +4 -18
  84. package/dist/types.mjs +1 -0
  85. package/dist/union.d.mts +2 -5
  86. package/dist/union.d.ts +2 -5
  87. package/dist/union.js +16 -39
  88. package/dist/union.mjs +12 -14
  89. package/package.json +2 -2
package/dist/rect.mjs CHANGED
@@ -1,97 +1,89 @@
1
1
  // src/rect.ts
2
- var ZERO_POINT = Object.freeze({ x: 0, y: 0 });
3
- var createPoint = (x, y) => ({ x, y });
4
- var subtractPoints = (a, b) => {
5
- if (!b) return a;
6
- return createPoint(a.x - b.x, a.y - b.y);
2
+ const ZERO_POINT = Object.freeze({
3
+ x: 0,
4
+ y: 0
5
+ });
6
+ const createPoint = (x, y) => ({
7
+ x,
8
+ y
9
+ });
10
+ const subtractPoints = (a, b) => {
11
+ if (!b) return a;
12
+ return createPoint(a.x - b.x, a.y - b.y);
7
13
  };
8
- var addPoints = (a, b) => createPoint(a.x + b.x, a.y + b.y);
9
- var getMidpoint = (a, b, offset) => ({
10
- x: (a.x + b.x) / 2 - (offset?.x ?? 0),
11
- y: (a.y + b.y) / 2 - (offset?.y ?? 0)
14
+ const addPoints = (a, b) => createPoint(a.x + b.x, a.y + b.y);
15
+ const getMidpoint = (a, b, offset) => ({
16
+ x: (a.x + b.x) / 2 - (offset?.x ?? 0),
17
+ y: (a.y + b.y) / 2 - (offset?.y ?? 0)
12
18
  });
13
19
  function isPoint(v) {
14
- return Reflect.has(v, "x") && Reflect.has(v, "y");
20
+ return Reflect.has(v, "x") && Reflect.has(v, "y");
15
21
  }
16
22
  function createRect(r) {
17
- const { x, y, width, height } = r;
18
- const midX = x + width / 2;
19
- const midY = y + height / 2;
20
- return {
21
- x,
22
- y,
23
- width,
24
- height,
25
- minX: x,
26
- minY: y,
27
- maxX: x + width,
28
- maxY: y + height,
29
- midX,
30
- midY,
31
- center: createPoint(midX, midY)
32
- };
23
+ const { x, y, width, height } = r;
24
+ const midX = x + width / 2;
25
+ const midY = y + height / 2;
26
+ return {
27
+ x,
28
+ y,
29
+ width,
30
+ height,
31
+ minX: x,
32
+ minY: y,
33
+ maxX: x + width,
34
+ maxY: y + height,
35
+ midX,
36
+ midY,
37
+ center: createPoint(midX, midY)
38
+ };
33
39
  }
34
40
  function isRect(v) {
35
- return Reflect.has(v, "x") && Reflect.has(v, "y") && Reflect.has(v, "width") && Reflect.has(v, "height");
41
+ return Reflect.has(v, "x") && Reflect.has(v, "y") && Reflect.has(v, "width") && Reflect.has(v, "height");
36
42
  }
37
43
  function getRectCenters(v) {
38
- const top = createPoint(v.midX, v.minY);
39
- const right = createPoint(v.maxX, v.midY);
40
- const bottom = createPoint(v.midX, v.maxY);
41
- const left = createPoint(v.minX, v.midY);
42
- return { top, right, bottom, left };
44
+ return {
45
+ top: createPoint(v.midX, v.minY),
46
+ right: createPoint(v.maxX, v.midY),
47
+ bottom: createPoint(v.midX, v.maxY),
48
+ left: createPoint(v.minX, v.midY)
49
+ };
43
50
  }
44
51
  function getRectCorners(v) {
45
- const top = createPoint(v.minX, v.minY);
46
- const right = createPoint(v.maxX, v.minY);
47
- const bottom = createPoint(v.maxX, v.maxY);
48
- const left = createPoint(v.minX, v.maxY);
49
- return { top, right, bottom, left };
52
+ return {
53
+ top: createPoint(v.minX, v.minY),
54
+ right: createPoint(v.maxX, v.minY),
55
+ bottom: createPoint(v.maxX, v.maxY),
56
+ left: createPoint(v.minX, v.maxY)
57
+ };
50
58
  }
51
59
  function getRectEdges(v) {
52
- const c = getRectCorners(v);
53
- const top = [c.top, c.right];
54
- const right = [c.right, c.bottom];
55
- const bottom = [c.left, c.bottom];
56
- const left = [c.top, c.left];
57
- return { top, right, bottom, left };
60
+ const c = getRectCorners(v);
61
+ return {
62
+ top: [c.top, c.right],
63
+ right: [c.right, c.bottom],
64
+ bottom: [c.left, c.bottom],
65
+ left: [c.top, c.left]
66
+ };
58
67
  }
59
- var getCenterPoint = (rect) => ({
60
- x: rect.x + rect.width / 2,
61
- y: rect.y + rect.height / 2
68
+ const getCenterPoint = (rect) => ({
69
+ x: rect.x + rect.width / 2,
70
+ y: rect.y + rect.height / 2
62
71
  });
63
- var isVisibleSize = (size) => size.width > 0 && size.height > 0;
64
- var scaleSize = (size, factor) => ({
65
- width: size.width * factor,
66
- height: size.height * factor
72
+ const isVisibleSize = (size) => size.width > 0 && size.height > 0;
73
+ const scaleSize = (size, factor) => ({
74
+ width: size.width * factor,
75
+ height: size.height * factor
67
76
  });
68
- var scaleRect = (rect, scale) => ({
69
- x: rect.x * scale.x,
70
- y: rect.y * scale.y,
71
- width: rect.width * scale.x,
72
- height: rect.height * scale.y
77
+ const scaleRect = (rect, scale) => ({
78
+ x: rect.x * scale.x,
79
+ y: rect.y * scale.y,
80
+ width: rect.width * scale.x,
81
+ height: rect.height * scale.y
73
82
  });
74
- var roundRect = (rect) => ({
75
- x: Math.round(rect.x),
76
- y: Math.round(rect.y),
77
- width: Math.round(rect.width),
78
- height: Math.round(rect.height)
83
+ const roundRect = (rect) => ({
84
+ x: Math.round(rect.x),
85
+ y: Math.round(rect.y),
86
+ width: Math.round(rect.width),
87
+ height: Math.round(rect.height)
79
88
  });
80
- export {
81
- ZERO_POINT,
82
- addPoints,
83
- createPoint,
84
- createRect,
85
- getCenterPoint,
86
- getMidpoint,
87
- getRectCenters,
88
- getRectCorners,
89
- getRectEdges,
90
- isPoint,
91
- isRect,
92
- isVisibleSize,
93
- roundRect,
94
- scaleRect,
95
- scaleSize,
96
- subtractPoints
97
- };
89
+ export { ZERO_POINT, addPoints, createPoint, createRect, getCenterPoint, getMidpoint, getRectCenters, getRectCorners, getRectEdges, isPoint, isRect, isVisibleSize, roundRect, scaleRect, scaleSize, subtractPoints };
package/dist/types.d.mts CHANGED
@@ -1,51 +1,47 @@
1
- interface Point {
2
- x: number;
3
- y: number;
4
- }
5
- interface Size {
6
- width: number;
7
- height: number;
8
- }
9
- interface Bounds {
10
- minX: number;
11
- midX: number;
12
- maxX: number;
13
- minY: number;
14
- midY: number;
15
- maxY: number;
16
- }
17
- interface CenterPoint {
18
- center: Point;
19
- }
20
- interface RectInit extends Point, Size {
21
- }
22
- interface Rect extends Point, Size, Bounds, CenterPoint {
23
- }
24
- type RectSide = "top" | "right" | "bottom" | "left";
25
- type RectPoint = "top-left" | "top-center" | "top-right" | "right-center" | "left-center" | "bottom-left" | "bottom-right" | "bottom-center" | "center";
26
- type RectEdge = [Point, Point];
27
- type RectPoints = [Point, Point, Point, Point];
28
- type RectEdges = Record<RectSide, RectEdge> & {
29
- value: RectEdge[];
1
+ export interface Point {
2
+ x: number;
3
+ y: number;
4
+ }
5
+ export interface Size {
6
+ width: number;
7
+ height: number;
8
+ }
9
+ export interface Bounds {
10
+ minX: number;
11
+ midX: number;
12
+ maxX: number;
13
+ minY: number;
14
+ midY: number;
15
+ maxY: number;
16
+ }
17
+ export interface CenterPoint {
18
+ center: Point;
19
+ }
20
+ export interface RectInit extends Point, Size {}
21
+ export interface Rect extends Point, Size, Bounds, CenterPoint {}
22
+ export type RectSide = "top" | "right" | "bottom" | "left";
23
+ export type RectPoint = "top-left" | "top-center" | "top-right" | "right-center" | "left-center" | "bottom-left" | "bottom-right" | "bottom-center" | "center";
24
+ export type RectEdge = [Point, Point];
25
+ export type RectPoints = [Point, Point, Point, Point];
26
+ export type RectEdges = Record<RectSide, RectEdge> & {
27
+ value: RectEdge[];
30
28
  };
31
- type RectCorner = "topLeft" | "topRight" | "bottomLeft" | "bottomRight";
32
- type RectCorners = Record<RectCorner, Point> & {
33
- value: RectPoints;
29
+ export type RectCorner = "topLeft" | "topRight" | "bottomLeft" | "bottomRight";
30
+ export type RectCorners = Record<RectCorner, Point> & {
31
+ value: RectPoints;
34
32
  };
35
- type RectCenter = "topCenter" | "rightCenter" | "leftCenter" | "bottomCenter";
36
- type RectCenters = Record<RectCenter, Point> & {
37
- value: RectPoints;
33
+ export type RectCenter = "topCenter" | "rightCenter" | "leftCenter" | "bottomCenter";
34
+ export type RectCenters = Record<RectCenter, Point> & {
35
+ value: RectPoints;
38
36
  };
39
- type RectInset = Partial<Record<RectSide, number>>;
40
- interface SymmetricRectInset {
41
- dx?: number | undefined;
42
- dy?: number | undefined;
37
+ export type RectInset = Partial<Record<RectSide, number>>;
38
+ export interface SymmetricRectInset {
39
+ dx?: number | undefined;
40
+ dy?: number | undefined;
43
41
  }
44
- interface AlignOptions {
45
- h: HAlign;
46
- v: VAlign;
42
+ export interface AlignOptions {
43
+ h: HAlign;
44
+ v: VAlign;
47
45
  }
48
- type HAlign = "left-inside" | "left-outside" | "center" | "right-inside" | "right-outside";
49
- type VAlign = "top-inside" | "top-outside" | "center" | "bottom-inside" | "bottom-outside";
50
-
51
- export type { AlignOptions, Bounds, CenterPoint, HAlign, Point, Rect, RectCenter, RectCenters, RectCorner, RectCorners, RectEdge, RectEdges, RectInit, RectInset, RectPoint, RectPoints, RectSide, Size, SymmetricRectInset, VAlign };
46
+ export type HAlign = "left-inside" | "left-outside" | "center" | "right-inside" | "right-outside";
47
+ export type VAlign = "top-inside" | "top-outside" | "center" | "bottom-inside" | "bottom-outside";
package/dist/types.d.ts CHANGED
@@ -1,51 +1,47 @@
1
- interface Point {
2
- x: number;
3
- y: number;
4
- }
5
- interface Size {
6
- width: number;
7
- height: number;
8
- }
9
- interface Bounds {
10
- minX: number;
11
- midX: number;
12
- maxX: number;
13
- minY: number;
14
- midY: number;
15
- maxY: number;
16
- }
17
- interface CenterPoint {
18
- center: Point;
19
- }
20
- interface RectInit extends Point, Size {
21
- }
22
- interface Rect extends Point, Size, Bounds, CenterPoint {
23
- }
24
- type RectSide = "top" | "right" | "bottom" | "left";
25
- type RectPoint = "top-left" | "top-center" | "top-right" | "right-center" | "left-center" | "bottom-left" | "bottom-right" | "bottom-center" | "center";
26
- type RectEdge = [Point, Point];
27
- type RectPoints = [Point, Point, Point, Point];
28
- type RectEdges = Record<RectSide, RectEdge> & {
29
- value: RectEdge[];
1
+ export interface Point {
2
+ x: number;
3
+ y: number;
4
+ }
5
+ export interface Size {
6
+ width: number;
7
+ height: number;
8
+ }
9
+ export interface Bounds {
10
+ minX: number;
11
+ midX: number;
12
+ maxX: number;
13
+ minY: number;
14
+ midY: number;
15
+ maxY: number;
16
+ }
17
+ export interface CenterPoint {
18
+ center: Point;
19
+ }
20
+ export interface RectInit extends Point, Size {}
21
+ export interface Rect extends Point, Size, Bounds, CenterPoint {}
22
+ export type RectSide = "top" | "right" | "bottom" | "left";
23
+ export type RectPoint = "top-left" | "top-center" | "top-right" | "right-center" | "left-center" | "bottom-left" | "bottom-right" | "bottom-center" | "center";
24
+ export type RectEdge = [Point, Point];
25
+ export type RectPoints = [Point, Point, Point, Point];
26
+ export type RectEdges = Record<RectSide, RectEdge> & {
27
+ value: RectEdge[];
30
28
  };
31
- type RectCorner = "topLeft" | "topRight" | "bottomLeft" | "bottomRight";
32
- type RectCorners = Record<RectCorner, Point> & {
33
- value: RectPoints;
29
+ export type RectCorner = "topLeft" | "topRight" | "bottomLeft" | "bottomRight";
30
+ export type RectCorners = Record<RectCorner, Point> & {
31
+ value: RectPoints;
34
32
  };
35
- type RectCenter = "topCenter" | "rightCenter" | "leftCenter" | "bottomCenter";
36
- type RectCenters = Record<RectCenter, Point> & {
37
- value: RectPoints;
33
+ export type RectCenter = "topCenter" | "rightCenter" | "leftCenter" | "bottomCenter";
34
+ export type RectCenters = Record<RectCenter, Point> & {
35
+ value: RectPoints;
38
36
  };
39
- type RectInset = Partial<Record<RectSide, number>>;
40
- interface SymmetricRectInset {
41
- dx?: number | undefined;
42
- dy?: number | undefined;
37
+ export type RectInset = Partial<Record<RectSide, number>>;
38
+ export interface SymmetricRectInset {
39
+ dx?: number | undefined;
40
+ dy?: number | undefined;
43
41
  }
44
- interface AlignOptions {
45
- h: HAlign;
46
- v: VAlign;
42
+ export interface AlignOptions {
43
+ h: HAlign;
44
+ v: VAlign;
47
45
  }
48
- type HAlign = "left-inside" | "left-outside" | "center" | "right-inside" | "right-outside";
49
- type VAlign = "top-inside" | "top-outside" | "center" | "bottom-inside" | "bottom-outside";
50
-
51
- export type { AlignOptions, Bounds, CenterPoint, HAlign, Point, Rect, RectCenter, RectCenters, RectCorner, RectCorners, RectEdge, RectEdges, RectInit, RectInset, RectPoint, RectPoints, RectSide, Size, SymmetricRectInset, VAlign };
46
+ export type HAlign = "left-inside" | "left-outside" | "center" | "right-inside" | "right-outside";
47
+ export type VAlign = "top-inside" | "top-outside" | "center" | "bottom-inside" | "bottom-outside";
package/dist/types.js CHANGED
@@ -1,18 +1,4 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __copyProps = (to, from, except, desc) => {
7
- if (from && typeof from === "object" || typeof from === "function") {
8
- for (let key of __getOwnPropNames(from))
9
- if (!__hasOwnProp.call(to, key) && key !== except)
10
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
- }
12
- return to;
13
- };
14
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
-
16
- // src/types.ts
17
- var types_exports = {};
18
- module.exports = __toCommonJS(types_exports);
1
+ Object.defineProperties(exports, {
2
+ __esModule: { value: true },
3
+ [Symbol.toStringTag]: { value: "Module" }
4
+ });
package/dist/types.mjs CHANGED
@@ -0,0 +1 @@
1
+ export {};
package/dist/union.d.mts CHANGED
@@ -1,5 +1,2 @@
1
- import { Rect } from './types.mjs';
2
-
3
- declare function union(...rs: Rect[]): Rect;
4
-
5
- export { union };
1
+ import { Rect } from "./types.mjs";
2
+ export declare function union(...rs: Rect[]): Rect;
package/dist/union.d.ts CHANGED
@@ -1,5 +1,2 @@
1
- import { Rect } from './types.js';
2
-
3
- declare function union(...rs: Rect[]): Rect;
4
-
5
- export { union };
1
+ import { Rect } from "./types.js";
2
+ export declare function union(...rs: Rect[]): Rect;
package/dist/union.js CHANGED
@@ -1,42 +1,19 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // src/union.ts
21
- var union_exports = {};
22
- __export(union_exports, {
23
- union: () => union
1
+ Object.defineProperties(exports, {
2
+ __esModule: { value: true },
3
+ [Symbol.toStringTag]: { value: "Module" }
24
4
  });
25
- module.exports = __toCommonJS(union_exports);
26
- var import_from_points = require("./from-points.js");
27
- var { min, max } = Math;
5
+ const require_from_points = require("./from-points.js");
6
+ // src/union.ts
7
+ const { min, max } = Math;
28
8
  function union(...rs) {
29
- const pMin = {
30
- x: min(...rs.map((r) => r.minX)),
31
- y: min(...rs.map((r) => r.minY))
32
- };
33
- const pMax = {
34
- x: max(...rs.map((r) => r.maxX)),
35
- y: max(...rs.map((r) => r.maxY))
36
- };
37
- return (0, import_from_points.getRectFromPoints)(pMin, pMax);
9
+ const pMin = {
10
+ x: min(...rs.map((r) => r.minX)),
11
+ y: min(...rs.map((r) => r.minY))
12
+ };
13
+ const pMax = {
14
+ x: max(...rs.map((r) => r.maxX)),
15
+ y: max(...rs.map((r) => r.maxY))
16
+ };
17
+ return require_from_points.getRectFromPoints(pMin, pMax);
38
18
  }
39
- // Annotate the CommonJS export names for ESM import in node:
40
- 0 && (module.exports = {
41
- union
42
- });
19
+ exports.union = union;
package/dist/union.mjs CHANGED
@@ -1,17 +1,15 @@
1
- // src/union.ts
2
1
  import { getRectFromPoints } from "./from-points.mjs";
3
- var { min, max } = Math;
2
+ // src/union.ts
3
+ const { min, max } = Math;
4
4
  function union(...rs) {
5
- const pMin = {
6
- x: min(...rs.map((r) => r.minX)),
7
- y: min(...rs.map((r) => r.minY))
8
- };
9
- const pMax = {
10
- x: max(...rs.map((r) => r.maxX)),
11
- y: max(...rs.map((r) => r.maxY))
12
- };
13
- return getRectFromPoints(pMin, pMax);
5
+ const pMin = {
6
+ x: min(...rs.map((r) => r.minX)),
7
+ y: min(...rs.map((r) => r.minY))
8
+ };
9
+ const pMax = {
10
+ x: max(...rs.map((r) => r.maxX)),
11
+ y: max(...rs.map((r) => r.maxY))
12
+ };
13
+ return getRectFromPoints(pMin, pMax);
14
14
  }
15
- export {
16
- union
17
- };
15
+ export { union };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zag-js/rect-utils",
3
- "version": "2.0.0-next.3",
3
+ "version": "2.0.0-next.4",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "js",
@@ -45,7 +45,7 @@
45
45
  "./package.json": "./package.json"
46
46
  },
47
47
  "scripts": {
48
- "build": "tsup",
48
+ "build": "tsdown",
49
49
  "lint": "oxlint src",
50
50
  "typecheck": "tsc --noEmit"
51
51
  }