@zag-js/interact-outside
Advanced tools
Comparing version 0.0.0-dev-20220704151659 to 0.0.0-dev-20220704163406
@@ -28,2 +28,16 @@ "use strict"; | ||
// ../dom/dist/index.mjs | ||
var runIfFn = (v, ...a) => { | ||
const res = typeof v === "function" ? v(...a) : v; | ||
return res != null ? res : void 0; | ||
}; | ||
var hasProp = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop); | ||
var isDom = () => typeof window !== "undefined"; | ||
function getPlatform() { | ||
var _a; | ||
const agent = navigator.userAgentData; | ||
return (_a = agent == null ? void 0 : agent.platform) != null ? _a : navigator.platform; | ||
} | ||
var pt = (v) => isDom() && v.test(getPlatform()); | ||
var isTouchDevice = () => isDom() && !!navigator.maxTouchPoints; | ||
var isMac = () => pt(/^Mac/) && !isTouchDevice; | ||
function isWindow(value) { | ||
@@ -59,2 +73,6 @@ return (value == null ? void 0 : value.toString()) === "[object Window]"; | ||
} | ||
var isContextMenuEvent = (e) => { | ||
return e.button === 2 || isCtrlKey(e) && e.button === 0; | ||
}; | ||
var isCtrlKey = (v) => isMac() ? v.metaKey && !v.ctrlKey : v.ctrlKey && !v.metaKey; | ||
function fireCustomEvent(el, type, init) { | ||
@@ -72,7 +90,2 @@ if (!el) | ||
} | ||
var hasProp = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop); | ||
var runIfFn = (v, ...a) => { | ||
const res = typeof v === "function" ? v(...a) : v; | ||
return res != null ? res : void 0; | ||
}; | ||
var isRef = (v) => hasProp(v, "current"); | ||
@@ -87,17 +100,2 @@ function addDomEvent(target, eventName, handler, options) { | ||
// ../core/dist/index.mjs | ||
var isDom = () => typeof window !== "undefined"; | ||
function getPlatform() { | ||
var _a; | ||
const agent = navigator.userAgentData; | ||
return (_a = agent == null ? void 0 : agent.platform) != null ? _a : navigator.platform; | ||
} | ||
var pt = (v) => isDom() && v.test(getPlatform()); | ||
var isTouchDevice = () => isDom() && !!navigator.maxTouchPoints; | ||
var isMac = () => pt(/^Mac/) && !isTouchDevice; | ||
var isContextMenuEvent = (e) => { | ||
return e.button === 2 || isCtrlKey(e) && e.button === 0; | ||
}; | ||
var isCtrlKey = (v) => isMac() ? v.metaKey && !v.ctrlKey : v.ctrlKey && !v.metaKey; | ||
// src/index.ts | ||
@@ -104,0 +102,0 @@ var POINTER_OUTSIDE_EVENT = "pointerdown.outside"; |
{ | ||
"name": "@zag-js/interact-outside", | ||
"version": "0.0.0-dev-20220704151659", | ||
"version": "0.0.0-dev-20220704163406", | ||
"description": "Track interations or focus outside an element", | ||
@@ -31,3 +31,3 @@ "keywords": [ | ||
"dependencies": { | ||
"@zag-js/dom-utils": "0.0.0-dev-20220704151659" | ||
"@zag-js/dom-utils": "0.0.0-dev-20220704163406" | ||
}, | ||
@@ -34,0 +34,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
13491
336
+ Added@zag-js/dom-utils@0.0.0-dev-20220704163406(transitive)
+ Added@zag-js/types@0.0.0-dev-20220704163406(transitive)
- Removed@zag-js/dom-utils@0.0.0-dev-20220704151659(transitive)
- Removed@zag-js/types@0.0.0-dev-20220704151659(transitive)