@zag-js/dismissable 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 +5 -4
- package/dist/index.mjs +5 -4
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -27,7 +27,7 @@ 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
|
|
30
|
+
return res != null ? res : void 0;
|
|
31
31
|
};
|
|
32
32
|
var hasProp = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);
|
|
33
33
|
function isDocument(el) {
|
|
@@ -37,15 +37,16 @@ function isWindow(value) {
|
|
|
37
37
|
return (value == null ? void 0 : value.toString()) === "[object Window]";
|
|
38
38
|
}
|
|
39
39
|
function getDocument(el) {
|
|
40
|
+
var _a;
|
|
40
41
|
if (isWindow(el))
|
|
41
42
|
return el.document;
|
|
42
43
|
if (isDocument(el))
|
|
43
44
|
return el;
|
|
44
|
-
return (el == null ? void 0 : el.ownerDocument)
|
|
45
|
+
return (_a = el == null ? void 0 : el.ownerDocument) != null ? _a : document;
|
|
45
46
|
}
|
|
46
47
|
function getEventTarget(event) {
|
|
47
|
-
var _a;
|
|
48
|
-
return ((_a = event.composedPath) == null ? void 0 : _a.call(event)[0])
|
|
48
|
+
var _a, _b;
|
|
49
|
+
return (_b = (_a = event.composedPath) == null ? void 0 : _a.call(event)[0]) != null ? _b : event.target;
|
|
49
50
|
}
|
|
50
51
|
function contains(parent, child) {
|
|
51
52
|
if (!parent)
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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
|
|
4
|
+
return res != null ? res : void 0;
|
|
5
5
|
};
|
|
6
6
|
var hasProp = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);
|
|
7
7
|
function isDocument(el) {
|
|
@@ -11,15 +11,16 @@ function isWindow(value) {
|
|
|
11
11
|
return (value == null ? void 0 : value.toString()) === "[object Window]";
|
|
12
12
|
}
|
|
13
13
|
function getDocument(el) {
|
|
14
|
+
var _a;
|
|
14
15
|
if (isWindow(el))
|
|
15
16
|
return el.document;
|
|
16
17
|
if (isDocument(el))
|
|
17
18
|
return el;
|
|
18
|
-
return (el == null ? void 0 : el.ownerDocument)
|
|
19
|
+
return (_a = el == null ? void 0 : el.ownerDocument) != null ? _a : document;
|
|
19
20
|
}
|
|
20
21
|
function getEventTarget(event) {
|
|
21
|
-
var _a;
|
|
22
|
-
return ((_a = event.composedPath) == null ? void 0 : _a.call(event)[0])
|
|
22
|
+
var _a, _b;
|
|
23
|
+
return (_b = (_a = event.composedPath) == null ? void 0 : _a.call(event)[0]) != null ? _b : event.target;
|
|
23
24
|
}
|
|
24
25
|
function contains(parent, child) {
|
|
25
26
|
if (!parent)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zag-js/dismissable",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Dismissable layer utilities for the DOM",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -26,11 +26,11 @@
|
|
|
26
26
|
"access": "public"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@zag-js/interact-outside": "0.
|
|
29
|
+
"@zag-js/interact-outside": "0.2.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@zag-js/dom-utils": "0.
|
|
33
|
-
"@zag-js/utils": "0.
|
|
32
|
+
"@zag-js/dom-utils": "0.2.0",
|
|
33
|
+
"@zag-js/utils": "0.2.0"
|
|
34
34
|
},
|
|
35
35
|
"bugs": {
|
|
36
36
|
"url": "https://github.com/chakra-ui/zag/issues"
|