@zag-js/rect-utils 0.82.2 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +2 -2
- package/dist/index.mjs +2 -2
- package/package.json +9 -4
package/dist/index.d.mts
CHANGED
|
@@ -119,9 +119,9 @@ declare function distanceFromPoint(r: Rect, p: Point): DistanceValue;
|
|
|
119
119
|
declare function distanceFromRect(a: Rect, b: Rect): DistanceValue;
|
|
120
120
|
declare function distanceBtwEdges(a: Rect, b: Rect): Record<RectSide, number>;
|
|
121
121
|
|
|
122
|
-
declare const isSizeEqual: (a: Size, b: Size) => boolean;
|
|
123
|
-
declare const isPointEqual: (a: Point, b: Point) => boolean;
|
|
124
|
-
declare const isRectEqual: (a: RectInit, b: RectInit) => boolean;
|
|
122
|
+
declare const isSizeEqual: (a: Size, b: Size | undefined) => boolean;
|
|
123
|
+
declare const isPointEqual: (a: Point, b: Point | undefined) => boolean;
|
|
124
|
+
declare const isRectEqual: (a: RectInit, b: RectInit | undefined) => boolean;
|
|
125
125
|
|
|
126
126
|
declare function getElementRect(el: HTMLElement, opts?: ElementRectOptions): Rect;
|
|
127
127
|
type ElementRectOptions = {
|
package/dist/index.d.ts
CHANGED
|
@@ -119,9 +119,9 @@ declare function distanceFromPoint(r: Rect, p: Point): DistanceValue;
|
|
|
119
119
|
declare function distanceFromRect(a: Rect, b: Rect): DistanceValue;
|
|
120
120
|
declare function distanceBtwEdges(a: Rect, b: Rect): Record<RectSide, number>;
|
|
121
121
|
|
|
122
|
-
declare const isSizeEqual: (a: Size, b: Size) => boolean;
|
|
123
|
-
declare const isPointEqual: (a: Point, b: Point) => boolean;
|
|
124
|
-
declare const isRectEqual: (a: RectInit, b: RectInit) => boolean;
|
|
122
|
+
declare const isSizeEqual: (a: Size, b: Size | undefined) => boolean;
|
|
123
|
+
declare const isPointEqual: (a: Point, b: Point | undefined) => boolean;
|
|
124
|
+
declare const isRectEqual: (a: RectInit, b: RectInit | undefined) => boolean;
|
|
125
125
|
|
|
126
126
|
declare function getElementRect(el: HTMLElement, opts?: ElementRectOptions): Rect;
|
|
127
127
|
type ElementRectOptions = {
|
package/dist/index.js
CHANGED
|
@@ -385,10 +385,10 @@ function contains(r, v) {
|
|
|
385
385
|
|
|
386
386
|
// src/equality.ts
|
|
387
387
|
var isSizeEqual = (a, b) => {
|
|
388
|
-
return a.width === b
|
|
388
|
+
return a.width === b?.width && a.height === b?.height;
|
|
389
389
|
};
|
|
390
390
|
var isPointEqual = (a, b) => {
|
|
391
|
-
return a.x === b
|
|
391
|
+
return a.x === b?.x && a.y === b?.y;
|
|
392
392
|
};
|
|
393
393
|
var isRectEqual = (a, b) => {
|
|
394
394
|
return isPointEqual(a, b) && isSizeEqual(a, b);
|
package/dist/index.mjs
CHANGED
|
@@ -383,10 +383,10 @@ function contains(r, v) {
|
|
|
383
383
|
|
|
384
384
|
// src/equality.ts
|
|
385
385
|
var isSizeEqual = (a, b) => {
|
|
386
|
-
return a.width === b
|
|
386
|
+
return a.width === b?.width && a.height === b?.height;
|
|
387
387
|
};
|
|
388
388
|
var isPointEqual = (a, b) => {
|
|
389
|
-
return a.x === b
|
|
389
|
+
return a.x === b?.x && a.y === b?.y;
|
|
390
390
|
};
|
|
391
391
|
var isRectEqual = (a, b) => {
|
|
392
392
|
return isPointEqual(a, b) && isSizeEqual(a, b);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zag-js/rect-utils",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"js",
|
|
@@ -30,9 +30,14 @@
|
|
|
30
30
|
"types": "dist/index.d.ts",
|
|
31
31
|
"exports": {
|
|
32
32
|
".": {
|
|
33
|
-
"
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
"import": {
|
|
34
|
+
"types": "./dist/index.d.mts",
|
|
35
|
+
"default": "./dist/index.mjs"
|
|
36
|
+
},
|
|
37
|
+
"require": {
|
|
38
|
+
"types": "./dist/index.d.ts",
|
|
39
|
+
"default": "./dist/index.js"
|
|
40
|
+
}
|
|
36
41
|
},
|
|
37
42
|
"./package.json": "./package.json"
|
|
38
43
|
},
|