@zag-js/interact-outside
Advanced tools
Comparing version 0.1.6 to 0.2.0
@@ -30,3 +30,3 @@ "use strict"; | ||
const res = typeof v === "function" ? v(...a) : v; | ||
return res ?? void 0; | ||
return res != null ? res : void 0; | ||
}; | ||
@@ -36,4 +36,5 @@ var hasProp = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop); | ||
function getPlatform() { | ||
var _a; | ||
const agent = navigator.userAgentData; | ||
return (agent == null ? void 0 : agent.platform) ?? navigator.platform; | ||
return (_a = agent == null ? void 0 : agent.platform) != null ? _a : navigator.platform; | ||
} | ||
@@ -50,2 +51,3 @@ var pt = (v) => isDom() && v.test(getPlatform()); | ||
function getDocument(el) { | ||
var _a; | ||
if (isWindow(el)) | ||
@@ -55,10 +57,11 @@ return el.document; | ||
return el; | ||
return (el == null ? void 0 : el.ownerDocument) ?? document; | ||
return (_a = el == null ? void 0 : el.ownerDocument) != null ? _a : document; | ||
} | ||
function getWindow(el) { | ||
return (el == null ? void 0 : el.ownerDocument.defaultView) ?? window; | ||
var _a; | ||
return (_a = el == null ? void 0 : el.ownerDocument.defaultView) != null ? _a : window; | ||
} | ||
function getEventTarget(event) { | ||
var _a; | ||
return ((_a = event.composedPath) == null ? void 0 : _a.call(event)[0]) ?? event.target; | ||
var _a, _b; | ||
return (_b = (_a = event.composedPath) == null ? void 0 : _a.call(event)[0]) != null ? _b : event.target; | ||
} | ||
@@ -65,0 +68,0 @@ function contains(parent, child) { |
{ | ||
"name": "@zag-js/interact-outside", | ||
"version": "0.1.6", | ||
"version": "0.2.0", | ||
"description": "Track interations or focus outside an element", | ||
@@ -22,4 +22,4 @@ "main": "dist/index.js", | ||
"devDependencies": { | ||
"@zag-js/dom-utils": "0.1.13", | ||
"@zag-js/utils": "0.1.6" | ||
"@zag-js/dom-utils": "0.2.0", | ||
"@zag-js/utils": "0.2.0" | ||
}, | ||
@@ -26,0 +26,0 @@ "publishConfig": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15789
369