@zag-js/popover 0.0.0-dev-20230220134212 → 0.0.0-dev-20230221113221
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/{chunk-NMCDKPIS.mjs → chunk-FRFRU5PG.mjs} +1 -1
- package/dist/{chunk-JNFEFPEH.mjs → chunk-JDSPKDIN.mjs} +1 -1
- package/dist/{chunk-2EVL5G6H.mjs → chunk-Z2WON7A5.mjs} +7 -1
- package/dist/index.js +7 -1
- package/dist/index.mjs +3 -3
- package/dist/popover.connect.js +7 -1
- package/dist/popover.connect.mjs +2 -2
- package/dist/popover.dom.d.ts +3 -0
- package/dist/popover.dom.js +7 -1
- package/dist/popover.dom.mjs +1 -1
- package/dist/popover.machine.js +7 -1
- package/dist/popover.machine.mjs +2 -2
- package/package.json +4 -4
|
@@ -27,7 +27,13 @@ function defineDomHelpers(helpers) {
|
|
|
27
27
|
getDoc: (ctx) => getDocument(dom2.getRootNode(ctx)),
|
|
28
28
|
getWin: (ctx) => dom2.getDoc(ctx).defaultView ?? window,
|
|
29
29
|
getActiveElement: (ctx) => dom2.getDoc(ctx).activeElement,
|
|
30
|
-
getById: (ctx, id) => dom2.getRootNode(ctx).getElementById(id)
|
|
30
|
+
getById: (ctx, id) => dom2.getRootNode(ctx).getElementById(id),
|
|
31
|
+
queryById: (ctx, id) => {
|
|
32
|
+
const el = dom2.getById(ctx, id);
|
|
33
|
+
if (!el)
|
|
34
|
+
throw new Error(`Element with id "${id}" not found.`);
|
|
35
|
+
return el;
|
|
36
|
+
}
|
|
31
37
|
};
|
|
32
38
|
return {
|
|
33
39
|
...dom2,
|
package/dist/index.js
CHANGED
|
@@ -107,7 +107,13 @@ function defineDomHelpers(helpers) {
|
|
|
107
107
|
getDoc: (ctx) => getDocument(dom2.getRootNode(ctx)),
|
|
108
108
|
getWin: (ctx) => dom2.getDoc(ctx).defaultView ?? window,
|
|
109
109
|
getActiveElement: (ctx) => dom2.getDoc(ctx).activeElement,
|
|
110
|
-
getById: (ctx, id) => dom2.getRootNode(ctx).getElementById(id)
|
|
110
|
+
getById: (ctx, id) => dom2.getRootNode(ctx).getElementById(id),
|
|
111
|
+
queryById: (ctx, id) => {
|
|
112
|
+
const el = dom2.getById(ctx, id);
|
|
113
|
+
if (!el)
|
|
114
|
+
throw new Error(`Element with id "${id}" not found.`);
|
|
115
|
+
return el;
|
|
116
|
+
}
|
|
111
117
|
};
|
|
112
118
|
return {
|
|
113
119
|
...dom2,
|
package/dist/index.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
connect
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-JDSPKDIN.mjs";
|
|
4
4
|
import {
|
|
5
5
|
anatomy
|
|
6
6
|
} from "./chunk-KTOPDXGV.mjs";
|
|
7
7
|
import {
|
|
8
8
|
machine
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-FRFRU5PG.mjs";
|
|
10
|
+
import "./chunk-Z2WON7A5.mjs";
|
|
11
11
|
export {
|
|
12
12
|
anatomy,
|
|
13
13
|
connect,
|
package/dist/popover.connect.js
CHANGED
|
@@ -58,7 +58,13 @@ function defineDomHelpers(helpers) {
|
|
|
58
58
|
getDoc: (ctx) => getDocument(dom2.getRootNode(ctx)),
|
|
59
59
|
getWin: (ctx) => dom2.getDoc(ctx).defaultView ?? window,
|
|
60
60
|
getActiveElement: (ctx) => dom2.getDoc(ctx).activeElement,
|
|
61
|
-
getById: (ctx, id) => dom2.getRootNode(ctx).getElementById(id)
|
|
61
|
+
getById: (ctx, id) => dom2.getRootNode(ctx).getElementById(id),
|
|
62
|
+
queryById: (ctx, id) => {
|
|
63
|
+
const el = dom2.getById(ctx, id);
|
|
64
|
+
if (!el)
|
|
65
|
+
throw new Error(`Element with id "${id}" not found.`);
|
|
66
|
+
return el;
|
|
67
|
+
}
|
|
62
68
|
};
|
|
63
69
|
return {
|
|
64
70
|
...dom2,
|
package/dist/popover.connect.mjs
CHANGED
package/dist/popover.dom.d.ts
CHANGED
|
@@ -20,6 +20,9 @@ declare const dom: {
|
|
|
20
20
|
getById: <T = HTMLElement>(ctx: {
|
|
21
21
|
getRootNode?: (() => Node | Document | ShadowRoot) | undefined;
|
|
22
22
|
}, id: string) => T | null;
|
|
23
|
+
queryById: <T_1 = HTMLElement>(ctx: {
|
|
24
|
+
getRootNode?: (() => Node | Document | ShadowRoot) | undefined;
|
|
25
|
+
}, id: string) => T_1;
|
|
23
26
|
} & {
|
|
24
27
|
getActiveEl: (ctx: MachineContext) => Element | null;
|
|
25
28
|
getAnchorId: (ctx: MachineContext) => string;
|
package/dist/popover.dom.js
CHANGED
|
@@ -53,7 +53,13 @@ function defineDomHelpers(helpers) {
|
|
|
53
53
|
getDoc: (ctx) => getDocument(dom2.getRootNode(ctx)),
|
|
54
54
|
getWin: (ctx) => dom2.getDoc(ctx).defaultView ?? window,
|
|
55
55
|
getActiveElement: (ctx) => dom2.getDoc(ctx).activeElement,
|
|
56
|
-
getById: (ctx, id) => dom2.getRootNode(ctx).getElementById(id)
|
|
56
|
+
getById: (ctx, id) => dom2.getRootNode(ctx).getElementById(id),
|
|
57
|
+
queryById: (ctx, id) => {
|
|
58
|
+
const el = dom2.getById(ctx, id);
|
|
59
|
+
if (!el)
|
|
60
|
+
throw new Error(`Element with id "${id}" not found.`);
|
|
61
|
+
return el;
|
|
62
|
+
}
|
|
57
63
|
};
|
|
58
64
|
return {
|
|
59
65
|
...dom2,
|
package/dist/popover.dom.mjs
CHANGED
package/dist/popover.machine.js
CHANGED
|
@@ -88,7 +88,13 @@ function defineDomHelpers(helpers) {
|
|
|
88
88
|
getDoc: (ctx) => getDocument(dom2.getRootNode(ctx)),
|
|
89
89
|
getWin: (ctx) => dom2.getDoc(ctx).defaultView ?? window,
|
|
90
90
|
getActiveElement: (ctx) => dom2.getDoc(ctx).activeElement,
|
|
91
|
-
getById: (ctx, id) => dom2.getRootNode(ctx).getElementById(id)
|
|
91
|
+
getById: (ctx, id) => dom2.getRootNode(ctx).getElementById(id),
|
|
92
|
+
queryById: (ctx, id) => {
|
|
93
|
+
const el = dom2.getById(ctx, id);
|
|
94
|
+
if (!el)
|
|
95
|
+
throw new Error(`Element with id "${id}" not found.`);
|
|
96
|
+
return el;
|
|
97
|
+
}
|
|
92
98
|
};
|
|
93
99
|
return {
|
|
94
100
|
...dom2,
|
package/dist/popover.machine.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zag-js/popover",
|
|
3
|
-
"version": "0.0.0-dev-
|
|
3
|
+
"version": "0.0.0-dev-20230221113221",
|
|
4
4
|
"description": "Core logic for the popover widget implemented as a state machine",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"js",
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
"focus-trap": "7.2.0",
|
|
30
30
|
"@zag-js/anatomy": "0.1.4",
|
|
31
31
|
"@zag-js/aria-hidden": "0.2.2",
|
|
32
|
-
"@zag-js/core": "0.0.0-dev-
|
|
33
|
-
"@zag-js/dismissable": "0.0.0-dev-
|
|
34
|
-
"@zag-js/popper": "0.0.0-dev-
|
|
32
|
+
"@zag-js/core": "0.0.0-dev-20230221113221",
|
|
33
|
+
"@zag-js/dismissable": "0.0.0-dev-20230221113221",
|
|
34
|
+
"@zag-js/popper": "0.0.0-dev-20230221113221",
|
|
35
35
|
"@zag-js/remove-scroll": "0.2.2",
|
|
36
36
|
"@zag-js/types": "0.3.4"
|
|
37
37
|
},
|