@zag-js/interact-outside
Advanced tools
Comparing version 0.80.0 to 0.81.0
'use strict'; | ||
var domEvent = require('@zag-js/dom-event'); | ||
var domQuery = require('@zag-js/dom-query'); | ||
@@ -138,3 +137,3 @@ var utils = require('@zag-js/utils'); | ||
} | ||
domEvent.fireCustomEvent(node, POINTER_OUTSIDE_EVENT, { | ||
fireCustomEvent(node, POINTER_OUTSIDE_EVENT, { | ||
bubbles: false, | ||
@@ -144,3 +143,3 @@ cancelable: true, | ||
originalEvent: event, | ||
contextmenu: domEvent.isContextMenuEvent(event), | ||
contextmenu: domQuery.isContextMenuEvent(event), | ||
focusable: isComposedPathFocusable(composedPath) | ||
@@ -153,3 +152,3 @@ } | ||
pointerdownCleanups.forEach((fn) => fn()); | ||
pointerdownCleanups.add(domEvent.addDomEvent(doc, "click", handler, { once: true })); | ||
pointerdownCleanups.add(domQuery.addDomEvent(doc, "click", handler, { once: true })); | ||
pointerdownCleanups.add(parentWin.addEventListener("click", handler, { once: true })); | ||
@@ -163,3 +162,3 @@ pointerdownCleanups.add(frames.addEventListener("click", handler, { once: true })); | ||
const timer = setTimeout(() => { | ||
cleanups.add(domEvent.addDomEvent(doc, "pointerdown", onPointerDown, true)); | ||
cleanups.add(domQuery.addDomEvent(doc, "pointerdown", onPointerDown, true)); | ||
cleanups.add(parentWin.addEventListener("pointerdown", onPointerDown, true)); | ||
@@ -176,3 +175,3 @@ cleanups.add(frames.addEventListener("pointerdown", onPointerDown, true)); | ||
} | ||
domEvent.fireCustomEvent(node, FOCUS_OUTSIDE_EVENT, { | ||
fireCustomEvent(node, FOCUS_OUTSIDE_EVENT, { | ||
bubbles: false, | ||
@@ -188,3 +187,3 @@ cancelable: true, | ||
} | ||
cleanups.add(domEvent.addDomEvent(doc, "focusin", onFocusin, true)); | ||
cleanups.add(domQuery.addDomEvent(doc, "focusin", onFocusin, true)); | ||
cleanups.add(parentWin.addEventListener("focusin", onFocusin, true)); | ||
@@ -212,3 +211,8 @@ cleanups.add(frames.addEventListener("focusin", onFocusin, true)); | ||
} | ||
function fireCustomEvent(el, type, init) { | ||
const win = el.ownerDocument.defaultView || window; | ||
const event = new win.CustomEvent(type, init); | ||
return el.dispatchEvent(event); | ||
} | ||
exports.trackInteractOutside = trackInteractOutside; |
{ | ||
"name": "@zag-js/interact-outside", | ||
"version": "0.80.0", | ||
"version": "0.81.0", | ||
"description": "Track interactions or focus outside an element", | ||
@@ -19,5 +19,4 @@ "keywords": [ | ||
"dependencies": { | ||
"@zag-js/dom-query": "0.80.0", | ||
"@zag-js/dom-event": "0.80.0", | ||
"@zag-js/utils": "0.80.0" | ||
"@zag-js/dom-query": "0.81.0", | ||
"@zag-js/utils": "0.81.0" | ||
}, | ||
@@ -24,0 +23,0 @@ "devDependencies": { |
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
20439
2
441
+ Added@zag-js/dom-query@0.81.0(transitive)
+ Added@zag-js/types@0.81.0(transitive)
+ Added@zag-js/utils@0.81.0(transitive)
- Removed@zag-js/dom-event@0.80.0
- Removed@zag-js/dom-event@0.80.0(transitive)
- Removed@zag-js/dom-query@0.80.0(transitive)
- Removed@zag-js/text-selection@0.80.0(transitive)
- Removed@zag-js/types@0.80.0(transitive)
- Removed@zag-js/utils@0.80.0(transitive)
Updated@zag-js/dom-query@0.81.0
Updated@zag-js/utils@0.81.0