@zag-js/rect-utils 0.1.3 → 0.1.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/dist/index.js CHANGED
@@ -499,7 +499,8 @@ function createPolygonElement() {
499
499
  height: "100%",
500
500
  opacity: "0.15",
501
501
  position: "fixed",
502
- pointerEvents: "none"
502
+ pointerEvents: "none",
503
+ fill: "red"
503
504
  });
504
505
  const polygon = document.createElementNS("http://www.w3.org/2000/svg", "polygon");
505
506
  polygon.setAttribute("id", id);
@@ -512,8 +513,7 @@ function debugPolygon(polygon) {
512
513
  const el = createPolygonElement();
513
514
  const points = polygon.map((point2) => `${point2.x},${point2.y}`).join(" ");
514
515
  el.setAttribute("points", points);
516
+ return () => {
517
+ el.remove();
518
+ };
515
519
  }
516
- debugPolygon.remove = () => {
517
- const el = document.getElementById("debug-polygon");
518
- el == null ? void 0 : el.remove();
519
- };
package/dist/index.mjs CHANGED
@@ -441,7 +441,8 @@ function createPolygonElement() {
441
441
  height: "100%",
442
442
  opacity: "0.15",
443
443
  position: "fixed",
444
- pointerEvents: "none"
444
+ pointerEvents: "none",
445
+ fill: "red"
445
446
  });
446
447
  const polygon = document.createElementNS("http://www.w3.org/2000/svg", "polygon");
447
448
  polygon.setAttribute("id", id);
@@ -454,11 +455,10 @@ function debugPolygon(polygon) {
454
455
  const el = createPolygonElement();
455
456
  const points = polygon.map((point2) => `${point2.x},${point2.y}`).join(" ");
456
457
  el.setAttribute("points", points);
458
+ return () => {
459
+ el.remove();
460
+ };
457
461
  }
458
- debugPolygon.remove = () => {
459
- const el = document.getElementById("debug-polygon");
460
- el == null ? void 0 : el.remove();
461
- };
462
462
  export {
463
463
  alignRect,
464
464
  closest,
package/dist/polygon.d.ts CHANGED
@@ -1,6 +1,3 @@
1
1
  import type { Point } from "./types";
2
2
  export declare function isPointInPolygon(polygon: Point[], point: Point): boolean;
3
- export declare function debugPolygon(polygon: Point[]): void;
4
- export declare namespace debugPolygon {
5
- var remove: () => void;
6
- }
3
+ export declare function debugPolygon(polygon: Point[]): () => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zag-js/rect-utils",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "js",
@@ -25,7 +25,7 @@
25
25
  "url": "https://github.com/chakra-ui/zag/issues"
26
26
  },
27
27
  "dependencies": {
28
- "@zag-js/dom-utils": "0.1.6",
28
+ "@zag-js/dom-utils": "0.1.7",
29
29
  "@zag-js/utils": "0.1.2"
30
30
  },
31
31
  "scripts": {