@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.
- package/dist/{chunk-BPWQOPHU.mjs → chunk-25JXNQDO.mjs} +3 -3
- package/dist/{chunk-C2OCKGLJ.mjs → chunk-2FRM3R57.mjs} +3 -3
- package/dist/{chunk-2QYJISFU.mjs → chunk-62GE3RPG.mjs} +1 -1
- package/dist/{chunk-LCJDCPGN.mjs → chunk-BDA5H4ND.mjs} +9 -21
- package/dist/{chunk-S3HXSPS7.mjs → chunk-BRVYSREB.mjs} +1 -1
- package/dist/{chunk-TPU7B3ZS.mjs → chunk-D46YBNP3.mjs} +1 -1
- package/dist/{chunk-IFHTGH3H.mjs → chunk-GYYHT756.mjs} +1 -1
- package/dist/{chunk-NGMCS5TG.mjs → chunk-K4PDUEML.mjs} +1 -1
- package/dist/{chunk-T4IEPEZY.mjs → chunk-MM5LIN7D.mjs} +1 -1
- package/dist/{chunk-YDYJCJQZ.mjs → chunk-MNKJK37U.mjs} +1 -3
- package/dist/{chunk-AYR2YRSU.mjs → chunk-N5AQDOKZ.mjs} +1 -1
- package/dist/{chunk-DBR73IMM.mjs → chunk-Q4ND66B6.mjs} +1 -1
- package/dist/{chunk-BGAHRJ6S.mjs → chunk-W5IPBTYQ.mjs} +1 -1
- package/dist/closest.mjs +4 -4
- package/dist/contains.js +1 -3
- package/dist/contains.mjs +2 -2
- package/dist/distance.mjs +3 -3
- package/dist/from-element.js +9 -21
- package/dist/from-element.mjs +2 -2
- package/dist/from-points.mjs +2 -2
- package/dist/from-range.js +8 -20
- package/dist/from-range.mjs +5 -5
- package/dist/from-rotation.mjs +2 -2
- package/dist/from-window.js +2 -2
- package/dist/from-window.mjs +2 -2
- package/dist/get-polygon.mjs +2 -2
- package/dist/index.js +11 -25
- package/dist/index.mjs +13 -13
- package/dist/intersection.mjs +2 -2
- package/dist/operations.mjs +2 -2
- package/dist/rect.js +1 -5
- package/dist/rect.mjs +1 -1
- package/dist/union.mjs +3 -3
- package/package.json +2 -4
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
union
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-K4PDUEML.mjs";
|
|
4
4
|
import {
|
|
5
5
|
getElementRect
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-BDA5H4ND.mjs";
|
|
7
7
|
import {
|
|
8
8
|
createRect
|
|
9
|
-
} from "./chunk-
|
|
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-
|
|
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 =
|
|
13
|
-
const height =
|
|
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,28 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createRect
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-MNKJK37U.mjs";
|
|
4
4
|
|
|
5
|
-
//
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
|
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 =
|
|
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,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
|
}
|
package/dist/closest.mjs
CHANGED
|
@@ -2,10 +2,10 @@ import {
|
|
|
2
2
|
closest,
|
|
3
3
|
closestSideToPoint,
|
|
4
4
|
closestSideToRect
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
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
package/dist/distance.mjs
CHANGED
|
@@ -3,9 +3,9 @@ import {
|
|
|
3
3
|
distanceBtwEdges,
|
|
4
4
|
distanceFromPoint,
|
|
5
5
|
distanceFromRect
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-N5AQDOKZ.mjs";
|
|
7
|
+
import "./chunk-GYYHT756.mjs";
|
|
8
|
+
import "./chunk-MNKJK37U.mjs";
|
|
9
9
|
export {
|
|
10
10
|
distance,
|
|
11
11
|
distanceBtwEdges,
|
package/dist/from-element.js
CHANGED
|
@@ -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 =
|
|
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);
|
package/dist/from-element.mjs
CHANGED
package/dist/from-points.mjs
CHANGED
package/dist/from-range.js
CHANGED
|
@@ -45,27 +45,15 @@ function createRect(r) {
|
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
//
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
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
|
|
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 =
|
|
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);
|
package/dist/from-range.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
fromRange
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
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
|
};
|
package/dist/from-rotation.mjs
CHANGED
package/dist/from-window.js
CHANGED
|
@@ -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 =
|
|
57
|
-
const height =
|
|
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;
|
package/dist/from-window.mjs
CHANGED
package/dist/get-polygon.mjs
CHANGED
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
|
-
//
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
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
|
|
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 =
|
|
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 =
|
|
414
|
-
const height =
|
|
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-
|
|
4
|
+
} from "./chunk-2FRM3R57.mjs";
|
|
5
5
|
import {
|
|
6
6
|
getElementPolygon
|
|
7
|
-
} from "./chunk-
|
|
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-
|
|
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-
|
|
27
|
+
} from "./chunk-Q4ND66B6.mjs";
|
|
28
28
|
import {
|
|
29
29
|
contains,
|
|
30
30
|
containsPoint,
|
|
31
31
|
containsRect
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-62GE3RPG.mjs";
|
|
33
33
|
import {
|
|
34
34
|
distance,
|
|
35
35
|
distanceBtwEdges,
|
|
36
36
|
distanceFromPoint,
|
|
37
37
|
distanceFromRect
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-N5AQDOKZ.mjs";
|
|
39
39
|
import {
|
|
40
40
|
collisions,
|
|
41
41
|
intersection,
|
|
42
42
|
intersects
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-GYYHT756.mjs";
|
|
44
44
|
import {
|
|
45
45
|
fromRange
|
|
46
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-25JXNQDO.mjs";
|
|
47
47
|
import {
|
|
48
48
|
union
|
|
49
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-K4PDUEML.mjs";
|
|
50
50
|
import {
|
|
51
51
|
getElementRect
|
|
52
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-BDA5H4ND.mjs";
|
|
53
53
|
import {
|
|
54
54
|
getRectFromPoints
|
|
55
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-D46YBNP3.mjs";
|
|
56
56
|
import {
|
|
57
57
|
getRotationRect,
|
|
58
58
|
rotate,
|
|
59
59
|
toRad
|
|
60
|
-
} from "./chunk-
|
|
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-
|
|
67
|
+
} from "./chunk-MNKJK37U.mjs";
|
|
68
68
|
export {
|
|
69
69
|
alignRect,
|
|
70
70
|
closest,
|
package/dist/intersection.mjs
CHANGED
package/dist/operations.mjs
CHANGED
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
package/dist/union.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zag-js/rect-utils",
|
|
3
|
-
"version": "0.2.
|
|
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",
|