@zag-js/interact-outside 0.0.0-dev-20220703123907 → 0.0.0-dev-20220703125047

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
@@ -25,19 +25,6 @@ __export(src_exports, {
25
25
  module.exports = __toCommonJS(src_exports);
26
26
 
27
27
  // ../dom/dist/index.mjs
28
- var hasProp = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);
29
- var runIfFn = (v, ...a) => {
30
- const res = typeof v === "function" ? v(...a) : v;
31
- return res != null ? res : void 0;
32
- };
33
- var isRef = (v) => hasProp(v, "current");
34
- function addDomEvent(target, eventName, handler, options) {
35
- const node = isRef(target) ? target.current : runIfFn(target);
36
- node == null ? void 0 : node.addEventListener(eventName, handler, options);
37
- return () => {
38
- node == null ? void 0 : node.removeEventListener(eventName, handler, options);
39
- };
40
- }
41
28
  function isWindow(value) {
42
29
  return (value == null ? void 0 : value.toString()) === "[object Window]";
43
30
  }
@@ -80,6 +67,19 @@ function isFocusable(element) {
80
67
  return false;
81
68
  return element.matches(focusableSelector) && isVisible(element);
82
69
  }
70
+ var hasProp = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);
71
+ var runIfFn = (v, ...a) => {
72
+ const res = typeof v === "function" ? v(...a) : v;
73
+ return res != null ? res : void 0;
74
+ };
75
+ var isRef = (v) => hasProp(v, "current");
76
+ function addDomEvent(target, eventName, handler, options) {
77
+ const node = isRef(target) ? target.current : runIfFn(target);
78
+ node == null ? void 0 : node.addEventListener(eventName, handler, options);
79
+ return () => {
80
+ node == null ? void 0 : node.removeEventListener(eventName, handler, options);
81
+ };
82
+ }
83
83
 
84
84
  // ../core/dist/index.mjs
85
85
  var isDom = () => typeof window !== "undefined";
package/dist/index.mjs CHANGED
@@ -1,19 +1,6 @@
1
1
  "use strict";
2
2
 
3
3
  // ../dom/dist/index.mjs
4
- var hasProp = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);
5
- var runIfFn = (v, ...a) => {
6
- const res = typeof v === "function" ? v(...a) : v;
7
- return res != null ? res : void 0;
8
- };
9
- var isRef = (v) => hasProp(v, "current");
10
- function addDomEvent(target, eventName, handler, options) {
11
- const node = isRef(target) ? target.current : runIfFn(target);
12
- node == null ? void 0 : node.addEventListener(eventName, handler, options);
13
- return () => {
14
- node == null ? void 0 : node.removeEventListener(eventName, handler, options);
15
- };
16
- }
17
4
  function isWindow(value) {
18
5
  return (value == null ? void 0 : value.toString()) === "[object Window]";
19
6
  }
@@ -56,6 +43,19 @@ function isFocusable(element) {
56
43
  return false;
57
44
  return element.matches(focusableSelector) && isVisible(element);
58
45
  }
46
+ var hasProp = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);
47
+ var runIfFn = (v, ...a) => {
48
+ const res = typeof v === "function" ? v(...a) : v;
49
+ return res != null ? res : void 0;
50
+ };
51
+ var isRef = (v) => hasProp(v, "current");
52
+ function addDomEvent(target, eventName, handler, options) {
53
+ const node = isRef(target) ? target.current : runIfFn(target);
54
+ node == null ? void 0 : node.addEventListener(eventName, handler, options);
55
+ return () => {
56
+ node == null ? void 0 : node.removeEventListener(eventName, handler, options);
57
+ };
58
+ }
59
59
 
60
60
  // ../core/dist/index.mjs
61
61
  var isDom = () => typeof window !== "undefined";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zag-js/interact-outside",
3
- "version": "0.0.0-dev-20220703123907",
3
+ "version": "0.0.0-dev-20220703125047",
4
4
  "description": "Track interations or focus outside an element",
5
5
  "keywords": [
6
6
  "js",
@@ -28,7 +28,7 @@
28
28
  "test:watch": "yarn test --watchAll"
29
29
  },
30
30
  "dependencies": {
31
- "@zag-js/dom-utils": "0.0.0-dev-20220703123907"
31
+ "@zag-js/dom-utils": "0.0.0-dev-20220703125047"
32
32
  },
33
33
  "publishConfig": {
34
34
  "access": "public"