@zag-js/rect-utils 0.2.1 → 0.2.3

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 (34) hide show
  1. package/dist/{chunk-BPWQOPHU.mjs → chunk-25JXNQDO.mjs} +3 -3
  2. package/dist/{chunk-C2OCKGLJ.mjs → chunk-2FRM3R57.mjs} +3 -3
  3. package/dist/{chunk-2QYJISFU.mjs → chunk-62GE3RPG.mjs} +1 -1
  4. package/dist/{chunk-LCJDCPGN.mjs → chunk-BDA5H4ND.mjs} +9 -21
  5. package/dist/{chunk-S3HXSPS7.mjs → chunk-BRVYSREB.mjs} +1 -1
  6. package/dist/{chunk-TPU7B3ZS.mjs → chunk-D46YBNP3.mjs} +1 -1
  7. package/dist/{chunk-IFHTGH3H.mjs → chunk-GYYHT756.mjs} +1 -1
  8. package/dist/{chunk-NGMCS5TG.mjs → chunk-K4PDUEML.mjs} +1 -1
  9. package/dist/{chunk-T4IEPEZY.mjs → chunk-MM5LIN7D.mjs} +1 -1
  10. package/dist/{chunk-YDYJCJQZ.mjs → chunk-MNKJK37U.mjs} +1 -3
  11. package/dist/{chunk-AYR2YRSU.mjs → chunk-N5AQDOKZ.mjs} +1 -1
  12. package/dist/{chunk-DBR73IMM.mjs → chunk-Q4ND66B6.mjs} +1 -1
  13. package/dist/{chunk-BGAHRJ6S.mjs → chunk-W5IPBTYQ.mjs} +1 -1
  14. package/dist/closest.mjs +4 -4
  15. package/dist/contains.js +1 -3
  16. package/dist/contains.mjs +2 -2
  17. package/dist/distance.mjs +3 -3
  18. package/dist/from-element.js +9 -21
  19. package/dist/from-element.mjs +2 -2
  20. package/dist/from-points.mjs +2 -2
  21. package/dist/from-range.js +8 -20
  22. package/dist/from-range.mjs +5 -5
  23. package/dist/from-rotation.mjs +2 -2
  24. package/dist/from-window.js +2 -2
  25. package/dist/from-window.mjs +2 -2
  26. package/dist/get-polygon.mjs +2 -2
  27. package/dist/index.js +11 -25
  28. package/dist/index.mjs +13 -13
  29. package/dist/intersection.mjs +2 -2
  30. package/dist/operations.mjs +2 -2
  31. package/dist/rect.js +1 -5
  32. package/dist/rect.mjs +1 -1
  33. package/dist/union.mjs +3 -3
  34. package/package.json +2 -4
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  union
3
- } from "./chunk-NGMCS5TG.mjs";
3
+ } from "./chunk-K4PDUEML.mjs";
4
4
  import {
5
5
  getElementRect
6
- } from "./chunk-LCJDCPGN.mjs";
6
+ } from "./chunk-BDA5H4ND.mjs";
7
7
  import {
8
8
  createRect
9
- } from "./chunk-YDYJCJQZ.mjs";
9
+ } from "./chunk-MNKJK37U.mjs";
10
10
 
11
11
  // src/from-range.ts
12
12
  function fromRange(range) {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createRect
3
- } from "./chunk-YDYJCJQZ.mjs";
3
+ } from "./chunk-MNKJK37U.mjs";
4
4
 
5
5
  // src/from-window.ts
6
6
  function getWindowRect(win, opts = {}) {
@@ -9,8 +9,8 @@ function getWindowRect(win, opts = {}) {
9
9
  function getViewportRect(win, opts) {
10
10
  const { excludeScrollbar = false } = opts;
11
11
  const { innerWidth, innerHeight, document: doc, visualViewport } = win;
12
- const width = (visualViewport == null ? void 0 : visualViewport.width) || innerWidth;
13
- const height = (visualViewport == null ? void 0 : visualViewport.height) || innerHeight;
12
+ const width = visualViewport?.width || innerWidth;
13
+ const height = visualViewport?.height || innerHeight;
14
14
  const rect = { x: 0, y: 0, width, height };
15
15
  if (excludeScrollbar) {
16
16
  const scrollbarWidth = innerWidth - doc.documentElement.clientWidth;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  getRectCorners,
3
3
  isRect
4
- } from "./chunk-YDYJCJQZ.mjs";
4
+ } from "./chunk-MNKJK37U.mjs";
5
5
 
6
6
  // src/contains.ts
7
7
  function containsPoint(r, p) {
@@ -1,28 +1,16 @@
1
1
  import {
2
2
  createRect
3
- } from "./chunk-YDYJCJQZ.mjs";
3
+ } from "./chunk-MNKJK37U.mjs";
4
4
 
5
- // ../dom/src/get-computed-style.ts
6
- function getCache() {
7
- const g = globalThis;
8
- g.__styleCache = g.__styleCache || /* @__PURE__ */ new WeakMap();
9
- return g.__styleCache;
10
- }
11
- function getComputedStyle(el) {
12
- var _a;
13
- if (!el)
14
- return {};
15
- const cache = getCache();
16
- let style = cache.get(el);
17
- if (!style) {
18
- const win = (_a = el == null ? void 0 : el.ownerDocument.defaultView) != null ? _a : window;
19
- style = win.getComputedStyle(el);
20
- cache.set(el, style);
5
+ // src/from-element.ts
6
+ var styleCache = /* @__PURE__ */ new WeakMap();
7
+ function getCacheComputedStyle(el) {
8
+ if (!styleCache.has(el)) {
9
+ const win = el.ownerDocument.defaultView || window;
10
+ styleCache.set(el, win.getComputedStyle(el));
21
11
  }
22
- return style;
12
+ return styleCache.get(el);
23
13
  }
24
-
25
- // src/from-element.ts
26
14
  function getElementRect(el, opts = {}) {
27
15
  return createRect(getClientRect(el, opts));
28
16
  }
@@ -30,7 +18,7 @@ function getClientRect(el, opts = {}) {
30
18
  const { excludeScrollbar = false, excludeBorders = false } = opts;
31
19
  const { x, y, width, height } = el.getBoundingClientRect();
32
20
  const r = { x, y, width, height };
33
- const style = getComputedStyle(el);
21
+ const style = getCacheComputedStyle(el);
34
22
  const { borderLeftWidth, borderTopWidth, borderRightWidth, borderBottomWidth } = style;
35
23
  const borderXWidth = sum(borderLeftWidth, borderRightWidth);
36
24
  const borderYWidth = sum(borderTopWidth, borderBottomWidth);
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createRect,
3
3
  getRectCorners
4
- } from "./chunk-YDYJCJQZ.mjs";
4
+ } from "./chunk-MNKJK37U.mjs";
5
5
 
6
6
  // src/get-polygon.ts
7
7
  function getElementPolygon(rectValue, placement) {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createRect
3
- } from "./chunk-YDYJCJQZ.mjs";
3
+ } from "./chunk-MNKJK37U.mjs";
4
4
 
5
5
  // src/from-points.ts
6
6
  function getRectFromPoints(...pts) {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createRect
3
- } from "./chunk-YDYJCJQZ.mjs";
3
+ } from "./chunk-MNKJK37U.mjs";
4
4
 
5
5
  // src/intersection.ts
6
6
  function intersects(a, b) {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getRectFromPoints
3
- } from "./chunk-TPU7B3ZS.mjs";
3
+ } from "./chunk-D46YBNP3.mjs";
4
4
 
5
5
  // src/union.ts
6
6
  var { min, max } = Math;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createRect
3
- } from "./chunk-YDYJCJQZ.mjs";
3
+ } from "./chunk-MNKJK37U.mjs";
4
4
 
5
5
  // src/operations.ts
6
6
  var isSymmetric = (v) => "dx" in v || "dy" in v;
@@ -1,6 +1,3 @@
1
- // ../core/src/guard.ts
2
- var hasProp = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);
3
-
4
1
  // src/rect.ts
5
2
  var point = (x, y) => ({ x, y });
6
3
  function createRect(r) {
@@ -21,6 +18,7 @@ function createRect(r) {
21
18
  center: point(midX, midY)
22
19
  };
23
20
  }
21
+ var hasProp = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);
24
22
  function isRect(v) {
25
23
  return hasProp(v, "x") && hasProp(v, "y") && hasProp(v, "width") && hasProp(v, "height");
26
24
  }
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  intersects
3
- } from "./chunk-IFHTGH3H.mjs";
3
+ } from "./chunk-GYYHT756.mjs";
4
4
 
5
5
  // src/distance.ts
6
6
  function distance(a, b = { x: 0, y: 0 }) {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  distance
3
- } from "./chunk-AYR2YRSU.mjs";
3
+ } from "./chunk-N5AQDOKZ.mjs";
4
4
 
5
5
  // src/closest.ts
6
6
  function closest(...pts) {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createRect,
3
3
  getRectCorners
4
- } from "./chunk-YDYJCJQZ.mjs";
4
+ } from "./chunk-MNKJK37U.mjs";
5
5
 
6
6
  // src/from-rotation.ts
7
7
  function toRad(d) {
package/dist/closest.mjs CHANGED
@@ -2,10 +2,10 @@ import {
2
2
  closest,
3
3
  closestSideToPoint,
4
4
  closestSideToRect
5
- } from "./chunk-DBR73IMM.mjs";
6
- import "./chunk-AYR2YRSU.mjs";
7
- import "./chunk-IFHTGH3H.mjs";
8
- import "./chunk-YDYJCJQZ.mjs";
5
+ } from "./chunk-Q4ND66B6.mjs";
6
+ import "./chunk-N5AQDOKZ.mjs";
7
+ import "./chunk-GYYHT756.mjs";
8
+ import "./chunk-MNKJK37U.mjs";
9
9
  export {
10
10
  closest,
11
11
  closestSideToPoint,
package/dist/contains.js CHANGED
@@ -26,11 +26,9 @@ __export(contains_exports, {
26
26
  });
27
27
  module.exports = __toCommonJS(contains_exports);
28
28
 
29
- // ../core/src/guard.ts
30
- var hasProp = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);
31
-
32
29
  // src/rect.ts
33
30
  var point = (x, y) => ({ x, y });
31
+ var hasProp = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);
34
32
  function isRect(v) {
35
33
  return hasProp(v, "x") && hasProp(v, "y") && hasProp(v, "width") && hasProp(v, "height");
36
34
  }
package/dist/contains.mjs CHANGED
@@ -2,8 +2,8 @@ import {
2
2
  contains,
3
3
  containsPoint,
4
4
  containsRect
5
- } from "./chunk-2QYJISFU.mjs";
6
- import "./chunk-YDYJCJQZ.mjs";
5
+ } from "./chunk-62GE3RPG.mjs";
6
+ import "./chunk-MNKJK37U.mjs";
7
7
  export {
8
8
  contains,
9
9
  containsPoint,
package/dist/distance.mjs CHANGED
@@ -3,9 +3,9 @@ import {
3
3
  distanceBtwEdges,
4
4
  distanceFromPoint,
5
5
  distanceFromRect
6
- } from "./chunk-AYR2YRSU.mjs";
7
- import "./chunk-IFHTGH3H.mjs";
8
- import "./chunk-YDYJCJQZ.mjs";
6
+ } from "./chunk-N5AQDOKZ.mjs";
7
+ import "./chunk-GYYHT756.mjs";
8
+ import "./chunk-MNKJK37U.mjs";
9
9
  export {
10
10
  distance,
11
11
  distanceBtwEdges,
@@ -24,26 +24,6 @@ __export(from_element_exports, {
24
24
  });
25
25
  module.exports = __toCommonJS(from_element_exports);
26
26
 
27
- // ../dom/src/get-computed-style.ts
28
- function getCache() {
29
- const g = globalThis;
30
- g.__styleCache = g.__styleCache || /* @__PURE__ */ new WeakMap();
31
- return g.__styleCache;
32
- }
33
- function getComputedStyle(el) {
34
- var _a;
35
- if (!el)
36
- return {};
37
- const cache = getCache();
38
- let style = cache.get(el);
39
- if (!style) {
40
- const win = (_a = el == null ? void 0 : el.ownerDocument.defaultView) != null ? _a : window;
41
- style = win.getComputedStyle(el);
42
- cache.set(el, style);
43
- }
44
- return style;
45
- }
46
-
47
27
  // src/rect.ts
48
28
  var point = (x, y) => ({ x, y });
49
29
  function createRect(r) {
@@ -66,6 +46,14 @@ function createRect(r) {
66
46
  }
67
47
 
68
48
  // src/from-element.ts
49
+ var styleCache = /* @__PURE__ */ new WeakMap();
50
+ function getCacheComputedStyle(el) {
51
+ if (!styleCache.has(el)) {
52
+ const win = el.ownerDocument.defaultView || window;
53
+ styleCache.set(el, win.getComputedStyle(el));
54
+ }
55
+ return styleCache.get(el);
56
+ }
69
57
  function getElementRect(el, opts = {}) {
70
58
  return createRect(getClientRect(el, opts));
71
59
  }
@@ -73,7 +61,7 @@ function getClientRect(el, opts = {}) {
73
61
  const { excludeScrollbar = false, excludeBorders = false } = opts;
74
62
  const { x, y, width, height } = el.getBoundingClientRect();
75
63
  const r = { x, y, width, height };
76
- const style = getComputedStyle(el);
64
+ const style = getCacheComputedStyle(el);
77
65
  const { borderLeftWidth, borderTopWidth, borderRightWidth, borderBottomWidth } = style;
78
66
  const borderXWidth = sum(borderLeftWidth, borderRightWidth);
79
67
  const borderYWidth = sum(borderTopWidth, borderBottomWidth);
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  getElementRect
3
- } from "./chunk-LCJDCPGN.mjs";
4
- import "./chunk-YDYJCJQZ.mjs";
3
+ } from "./chunk-BDA5H4ND.mjs";
4
+ import "./chunk-MNKJK37U.mjs";
5
5
  export {
6
6
  getElementRect
7
7
  };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  getRectFromPoints
3
- } from "./chunk-TPU7B3ZS.mjs";
4
- import "./chunk-YDYJCJQZ.mjs";
3
+ } from "./chunk-D46YBNP3.mjs";
4
+ import "./chunk-MNKJK37U.mjs";
5
5
  export {
6
6
  getRectFromPoints
7
7
  };
@@ -45,27 +45,15 @@ function createRect(r) {
45
45
  };
46
46
  }
47
47
 
48
- // ../dom/src/get-computed-style.ts
49
- function getCache() {
50
- const g = globalThis;
51
- g.__styleCache = g.__styleCache || /* @__PURE__ */ new WeakMap();
52
- return g.__styleCache;
53
- }
54
- function getComputedStyle(el) {
55
- var _a;
56
- if (!el)
57
- return {};
58
- const cache = getCache();
59
- let style = cache.get(el);
60
- if (!style) {
61
- const win = (_a = el == null ? void 0 : el.ownerDocument.defaultView) != null ? _a : window;
62
- style = win.getComputedStyle(el);
63
- cache.set(el, style);
48
+ // src/from-element.ts
49
+ var styleCache = /* @__PURE__ */ new WeakMap();
50
+ function getCacheComputedStyle(el) {
51
+ if (!styleCache.has(el)) {
52
+ const win = el.ownerDocument.defaultView || window;
53
+ styleCache.set(el, win.getComputedStyle(el));
64
54
  }
65
- return style;
55
+ return styleCache.get(el);
66
56
  }
67
-
68
- // src/from-element.ts
69
57
  function getElementRect(el, opts = {}) {
70
58
  return createRect(getClientRect(el, opts));
71
59
  }
@@ -73,7 +61,7 @@ function getClientRect(el, opts = {}) {
73
61
  const { excludeScrollbar = false, excludeBorders = false } = opts;
74
62
  const { x, y, width, height } = el.getBoundingClientRect();
75
63
  const r = { x, y, width, height };
76
- const style = getComputedStyle(el);
64
+ const style = getCacheComputedStyle(el);
77
65
  const { borderLeftWidth, borderTopWidth, borderRightWidth, borderBottomWidth } = style;
78
66
  const borderXWidth = sum(borderLeftWidth, borderRightWidth);
79
67
  const borderYWidth = sum(borderTopWidth, borderBottomWidth);
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  fromRange
3
- } from "./chunk-BPWQOPHU.mjs";
4
- import "./chunk-NGMCS5TG.mjs";
5
- import "./chunk-LCJDCPGN.mjs";
6
- import "./chunk-TPU7B3ZS.mjs";
7
- import "./chunk-YDYJCJQZ.mjs";
3
+ } from "./chunk-25JXNQDO.mjs";
4
+ import "./chunk-K4PDUEML.mjs";
5
+ import "./chunk-BDA5H4ND.mjs";
6
+ import "./chunk-D46YBNP3.mjs";
7
+ import "./chunk-MNKJK37U.mjs";
8
8
  export {
9
9
  fromRange
10
10
  };
@@ -2,8 +2,8 @@ import {
2
2
  getRotationRect,
3
3
  rotate,
4
4
  toRad
5
- } from "./chunk-BGAHRJ6S.mjs";
6
- import "./chunk-YDYJCJQZ.mjs";
5
+ } from "./chunk-W5IPBTYQ.mjs";
6
+ import "./chunk-MNKJK37U.mjs";
7
7
  export {
8
8
  getRotationRect,
9
9
  rotate,
@@ -53,8 +53,8 @@ function getWindowRect(win, opts = {}) {
53
53
  function getViewportRect(win, opts) {
54
54
  const { excludeScrollbar = false } = opts;
55
55
  const { innerWidth, innerHeight, document: doc, visualViewport } = win;
56
- const width = (visualViewport == null ? void 0 : visualViewport.width) || innerWidth;
57
- const height = (visualViewport == null ? void 0 : visualViewport.height) || innerHeight;
56
+ const width = visualViewport?.width || innerWidth;
57
+ const height = visualViewport?.height || innerHeight;
58
58
  const rect = { x: 0, y: 0, width, height };
59
59
  if (excludeScrollbar) {
60
60
  const scrollbarWidth = innerWidth - doc.documentElement.clientWidth;
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  getViewportRect,
3
3
  getWindowRect
4
- } from "./chunk-C2OCKGLJ.mjs";
5
- import "./chunk-YDYJCJQZ.mjs";
4
+ } from "./chunk-2FRM3R57.mjs";
5
+ import "./chunk-MNKJK37U.mjs";
6
6
  export {
7
7
  getViewportRect,
8
8
  getWindowRect
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  getElementPolygon
3
- } from "./chunk-S3HXSPS7.mjs";
4
- import "./chunk-YDYJCJQZ.mjs";
3
+ } from "./chunk-BRVYSREB.mjs";
4
+ import "./chunk-MNKJK37U.mjs";
5
5
  export {
6
6
  getElementPolygon
7
7
  };
package/dist/index.js CHANGED
@@ -103,9 +103,6 @@ function alignRect(a, ref, options) {
103
103
  return vAlign(hAlign(a, ref, h), ref, v);
104
104
  }
105
105
 
106
- // ../core/src/guard.ts
107
- var hasProp = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);
108
-
109
106
  // src/rect.ts
110
107
  var point = (x, y) => ({ x, y });
111
108
  function createRect(r) {
@@ -126,6 +123,7 @@ function createRect(r) {
126
123
  center: point(midX, midY)
127
124
  };
128
125
  }
126
+ var hasProp = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);
129
127
  function isRect(v) {
130
128
  return hasProp(v, "x") && hasProp(v, "y") && hasProp(v, "width") && hasProp(v, "height");
131
129
  }
@@ -267,27 +265,15 @@ function contains(r, v) {
267
265
  return isRect(v) ? containsRect(r, v) : containsPoint(r, v);
268
266
  }
269
267
 
270
- // ../dom/src/get-computed-style.ts
271
- function getCache() {
272
- const g = globalThis;
273
- g.__styleCache = g.__styleCache || /* @__PURE__ */ new WeakMap();
274
- return g.__styleCache;
275
- }
276
- function getComputedStyle(el) {
277
- var _a;
278
- if (!el)
279
- return {};
280
- const cache = getCache();
281
- let style = cache.get(el);
282
- if (!style) {
283
- const win = (_a = el == null ? void 0 : el.ownerDocument.defaultView) != null ? _a : window;
284
- style = win.getComputedStyle(el);
285
- cache.set(el, style);
268
+ // src/from-element.ts
269
+ var styleCache = /* @__PURE__ */ new WeakMap();
270
+ function getCacheComputedStyle(el) {
271
+ if (!styleCache.has(el)) {
272
+ const win = el.ownerDocument.defaultView || window;
273
+ styleCache.set(el, win.getComputedStyle(el));
286
274
  }
287
- return style;
275
+ return styleCache.get(el);
288
276
  }
289
-
290
- // src/from-element.ts
291
277
  function getElementRect(el, opts = {}) {
292
278
  return createRect(getClientRect(el, opts));
293
279
  }
@@ -295,7 +281,7 @@ function getClientRect(el, opts = {}) {
295
281
  const { excludeScrollbar = false, excludeBorders = false } = opts;
296
282
  const { x, y, width, height } = el.getBoundingClientRect();
297
283
  const r = { x, y, width, height };
298
- const style = getComputedStyle(el);
284
+ const style = getCacheComputedStyle(el);
299
285
  const { borderLeftWidth, borderTopWidth, borderRightWidth, borderBottomWidth } = style;
300
286
  const borderXWidth = sum(borderLeftWidth, borderRightWidth);
301
287
  const borderYWidth = sum(borderTopWidth, borderBottomWidth);
@@ -410,8 +396,8 @@ function getWindowRect(win, opts = {}) {
410
396
  function getViewportRect(win, opts) {
411
397
  const { excludeScrollbar = false } = opts;
412
398
  const { innerWidth, innerHeight, document: doc, visualViewport } = win;
413
- const width = (visualViewport == null ? void 0 : visualViewport.width) || innerWidth;
414
- const height = (visualViewport == null ? void 0 : visualViewport.height) || innerHeight;
399
+ const width = visualViewport?.width || innerWidth;
400
+ const height = visualViewport?.height || innerHeight;
415
401
  const rect = { x: 0, y: 0, width, height };
416
402
  if (excludeScrollbar) {
417
403
  const scrollbarWidth = innerWidth - doc.documentElement.clientWidth;
package/dist/index.mjs CHANGED
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  getViewportRect,
3
3
  getWindowRect
4
- } from "./chunk-C2OCKGLJ.mjs";
4
+ } from "./chunk-2FRM3R57.mjs";
5
5
  import {
6
6
  getElementPolygon
7
- } from "./chunk-S3HXSPS7.mjs";
7
+ } from "./chunk-BRVYSREB.mjs";
8
8
  import {
9
9
  expand,
10
10
  inset,
11
11
  isSymmetric,
12
12
  shift,
13
13
  shrink
14
- } from "./chunk-T4IEPEZY.mjs";
14
+ } from "./chunk-MM5LIN7D.mjs";
15
15
  import {
16
16
  debugPolygon,
17
17
  isPointInPolygon
@@ -24,47 +24,47 @@ import {
24
24
  closest,
25
25
  closestSideToPoint,
26
26
  closestSideToRect
27
- } from "./chunk-DBR73IMM.mjs";
27
+ } from "./chunk-Q4ND66B6.mjs";
28
28
  import {
29
29
  contains,
30
30
  containsPoint,
31
31
  containsRect
32
- } from "./chunk-2QYJISFU.mjs";
32
+ } from "./chunk-62GE3RPG.mjs";
33
33
  import {
34
34
  distance,
35
35
  distanceBtwEdges,
36
36
  distanceFromPoint,
37
37
  distanceFromRect
38
- } from "./chunk-AYR2YRSU.mjs";
38
+ } from "./chunk-N5AQDOKZ.mjs";
39
39
  import {
40
40
  collisions,
41
41
  intersection,
42
42
  intersects
43
- } from "./chunk-IFHTGH3H.mjs";
43
+ } from "./chunk-GYYHT756.mjs";
44
44
  import {
45
45
  fromRange
46
- } from "./chunk-BPWQOPHU.mjs";
46
+ } from "./chunk-25JXNQDO.mjs";
47
47
  import {
48
48
  union
49
- } from "./chunk-NGMCS5TG.mjs";
49
+ } from "./chunk-K4PDUEML.mjs";
50
50
  import {
51
51
  getElementRect
52
- } from "./chunk-LCJDCPGN.mjs";
52
+ } from "./chunk-BDA5H4ND.mjs";
53
53
  import {
54
54
  getRectFromPoints
55
- } from "./chunk-TPU7B3ZS.mjs";
55
+ } from "./chunk-D46YBNP3.mjs";
56
56
  import {
57
57
  getRotationRect,
58
58
  rotate,
59
59
  toRad
60
- } from "./chunk-BGAHRJ6S.mjs";
60
+ } from "./chunk-W5IPBTYQ.mjs";
61
61
  import {
62
62
  createRect,
63
63
  getRectCenters,
64
64
  getRectCorners,
65
65
  getRectEdges,
66
66
  isRect
67
- } from "./chunk-YDYJCJQZ.mjs";
67
+ } from "./chunk-MNKJK37U.mjs";
68
68
  export {
69
69
  alignRect,
70
70
  closest,
@@ -2,8 +2,8 @@ import {
2
2
  collisions,
3
3
  intersection,
4
4
  intersects
5
- } from "./chunk-IFHTGH3H.mjs";
6
- import "./chunk-YDYJCJQZ.mjs";
5
+ } from "./chunk-GYYHT756.mjs";
6
+ import "./chunk-MNKJK37U.mjs";
7
7
  export {
8
8
  collisions,
9
9
  intersection,
@@ -4,8 +4,8 @@ import {
4
4
  isSymmetric,
5
5
  shift,
6
6
  shrink
7
- } from "./chunk-T4IEPEZY.mjs";
8
- import "./chunk-YDYJCJQZ.mjs";
7
+ } from "./chunk-MM5LIN7D.mjs";
8
+ import "./chunk-MNKJK37U.mjs";
9
9
  export {
10
10
  expand,
11
11
  inset,
package/dist/rect.js CHANGED
@@ -27,11 +27,6 @@ __export(rect_exports, {
27
27
  isRect: () => isRect
28
28
  });
29
29
  module.exports = __toCommonJS(rect_exports);
30
-
31
- // ../core/src/guard.ts
32
- var hasProp = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);
33
-
34
- // src/rect.ts
35
30
  var point = (x, y) => ({ x, y });
36
31
  function createRect(r) {
37
32
  const { x, y, width, height } = r;
@@ -51,6 +46,7 @@ function createRect(r) {
51
46
  center: point(midX, midY)
52
47
  };
53
48
  }
49
+ var hasProp = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);
54
50
  function isRect(v) {
55
51
  return hasProp(v, "x") && hasProp(v, "y") && hasProp(v, "width") && hasProp(v, "height");
56
52
  }
package/dist/rect.mjs CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  getRectCorners,
5
5
  getRectEdges,
6
6
  isRect
7
- } from "./chunk-YDYJCJQZ.mjs";
7
+ } from "./chunk-MNKJK37U.mjs";
8
8
  export {
9
9
  createRect,
10
10
  getRectCenters,
package/dist/union.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  union
3
- } from "./chunk-NGMCS5TG.mjs";
4
- import "./chunk-TPU7B3ZS.mjs";
5
- import "./chunk-YDYJCJQZ.mjs";
3
+ } from "./chunk-K4PDUEML.mjs";
4
+ import "./chunk-D46YBNP3.mjs";
5
+ import "./chunk-MNKJK37U.mjs";
6
6
  export {
7
7
  union
8
8
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zag-js/rect-utils",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "js",
@@ -22,9 +22,7 @@
22
22
  "url": "https://github.com/chakra-ui/zag/issues"
23
23
  },
24
24
  "devDependencies": {
25
- "clean-package": "2.2.0",
26
- "@zag-js/dom-utils": "0.2.2",
27
- "@zag-js/utils": "0.3.2"
25
+ "clean-package": "2.2.0"
28
26
  },
29
27
  "clean-package": "../../../clean-package.config.json",
30
28
  "main": "dist/index.js",