@zag-js/interact-outside 0.1.6 → 0.2.0

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
@@ -27,13 +27,14 @@ module.exports = __toCommonJS(src_exports);
27
27
  // ../dom/dist/index.mjs
28
28
  var runIfFn = (v, ...a) => {
29
29
  const res = typeof v === "function" ? v(...a) : v;
30
- return res ?? void 0;
30
+ return res != null ? res : void 0;
31
31
  };
32
32
  var hasProp = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);
33
33
  var isDom = () => typeof window !== "undefined";
34
34
  function getPlatform() {
35
+ var _a;
35
36
  const agent = navigator.userAgentData;
36
- return (agent == null ? void 0 : agent.platform) ?? navigator.platform;
37
+ return (_a = agent == null ? void 0 : agent.platform) != null ? _a : navigator.platform;
37
38
  }
38
39
  var pt = (v) => isDom() && v.test(getPlatform());
39
40
  var isTouchDevice = () => isDom() && !!navigator.maxTouchPoints;
@@ -45,18 +46,20 @@ function isWindow(value) {
45
46
  return (value == null ? void 0 : value.toString()) === "[object Window]";
46
47
  }
47
48
  function getDocument(el) {
49
+ var _a;
48
50
  if (isWindow(el))
49
51
  return el.document;
50
52
  if (isDocument(el))
51
53
  return el;
52
- return (el == null ? void 0 : el.ownerDocument) ?? document;
54
+ return (_a = el == null ? void 0 : el.ownerDocument) != null ? _a : document;
53
55
  }
54
56
  function getWindow(el) {
55
- return (el == null ? void 0 : el.ownerDocument.defaultView) ?? window;
57
+ var _a;
58
+ return (_a = el == null ? void 0 : el.ownerDocument.defaultView) != null ? _a : window;
56
59
  }
57
60
  function getEventTarget(event) {
58
- var _a;
59
- return ((_a = event.composedPath) == null ? void 0 : _a.call(event)[0]) ?? event.target;
61
+ var _a, _b;
62
+ return (_b = (_a = event.composedPath) == null ? void 0 : _a.call(event)[0]) != null ? _b : event.target;
60
63
  }
61
64
  function contains(parent, child) {
62
65
  if (!parent)
package/dist/index.mjs CHANGED
@@ -1,13 +1,14 @@
1
1
  // ../dom/dist/index.mjs
2
2
  var runIfFn = (v, ...a) => {
3
3
  const res = typeof v === "function" ? v(...a) : v;
4
- return res ?? void 0;
4
+ return res != null ? res : void 0;
5
5
  };
6
6
  var hasProp = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);
7
7
  var isDom = () => typeof window !== "undefined";
8
8
  function getPlatform() {
9
+ var _a;
9
10
  const agent = navigator.userAgentData;
10
- return (agent == null ? void 0 : agent.platform) ?? navigator.platform;
11
+ return (_a = agent == null ? void 0 : agent.platform) != null ? _a : navigator.platform;
11
12
  }
12
13
  var pt = (v) => isDom() && v.test(getPlatform());
13
14
  var isTouchDevice = () => isDom() && !!navigator.maxTouchPoints;
@@ -19,18 +20,20 @@ function isWindow(value) {
19
20
  return (value == null ? void 0 : value.toString()) === "[object Window]";
20
21
  }
21
22
  function getDocument(el) {
23
+ var _a;
22
24
  if (isWindow(el))
23
25
  return el.document;
24
26
  if (isDocument(el))
25
27
  return el;
26
- return (el == null ? void 0 : el.ownerDocument) ?? document;
28
+ return (_a = el == null ? void 0 : el.ownerDocument) != null ? _a : document;
27
29
  }
28
30
  function getWindow(el) {
29
- return (el == null ? void 0 : el.ownerDocument.defaultView) ?? window;
31
+ var _a;
32
+ return (_a = el == null ? void 0 : el.ownerDocument.defaultView) != null ? _a : window;
30
33
  }
31
34
  function getEventTarget(event) {
32
- var _a;
33
- return ((_a = event.composedPath) == null ? void 0 : _a.call(event)[0]) ?? event.target;
35
+ var _a, _b;
36
+ return (_b = (_a = event.composedPath) == null ? void 0 : _a.call(event)[0]) != null ? _b : event.target;
34
37
  }
35
38
  function contains(parent, child) {
36
39
  if (!parent)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zag-js/interact-outside",
3
- "version": "0.1.6",
3
+ "version": "0.2.0",
4
4
  "description": "Track interations or focus outside an element",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -19,8 +19,8 @@
19
19
  "dist/**/*"
20
20
  ],
21
21
  "devDependencies": {
22
- "@zag-js/dom-utils": "0.1.13",
23
- "@zag-js/utils": "0.1.6"
22
+ "@zag-js/dom-utils": "0.2.0",
23
+ "@zag-js/utils": "0.2.0"
24
24
  },
25
25
  "publishConfig": {
26
26
  "access": "public"