@zag-js/tooltip 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-W5WZYXHV.mjs → chunk-DYQY5P2O.mjs} +7 -1
- package/dist/{chunk-V3RC3IDL.mjs → chunk-VTDFWXSY.mjs} +1 -1
- package/dist/{chunk-ILEFGJ44.mjs → chunk-YCQQKYLH.mjs} +1 -1
- package/dist/index.js +7 -1
- package/dist/index.mjs +3 -3
- package/dist/tooltip.connect.js +7 -1
- package/dist/tooltip.connect.mjs +2 -2
- package/dist/tooltip.dom.d.ts +3 -0
- package/dist/tooltip.dom.js +7 -1
- package/dist/tooltip.dom.mjs +1 -1
- package/dist/tooltip.machine.js +7 -1
- package/dist/tooltip.machine.mjs +2 -2
- package/package.json +3 -3
|
@@ -49,7 +49,13 @@ function defineDomHelpers(helpers) {
|
|
|
49
49
|
getDoc: (ctx) => getDocument(dom2.getRootNode(ctx)),
|
|
50
50
|
getWin: (ctx) => dom2.getDoc(ctx).defaultView ?? window,
|
|
51
51
|
getActiveElement: (ctx) => dom2.getDoc(ctx).activeElement,
|
|
52
|
-
getById: (ctx, id) => dom2.getRootNode(ctx).getElementById(id)
|
|
52
|
+
getById: (ctx, id) => dom2.getRootNode(ctx).getElementById(id),
|
|
53
|
+
queryById: (ctx, id) => {
|
|
54
|
+
const el = dom2.getById(ctx, id);
|
|
55
|
+
if (!el)
|
|
56
|
+
throw new Error(`Element with id "${id}" not found.`);
|
|
57
|
+
return el;
|
|
58
|
+
}
|
|
53
59
|
};
|
|
54
60
|
return {
|
|
55
61
|
...dom2,
|
package/dist/index.js
CHANGED
|
@@ -118,7 +118,13 @@ function defineDomHelpers(helpers) {
|
|
|
118
118
|
getDoc: (ctx) => getDocument(dom2.getRootNode(ctx)),
|
|
119
119
|
getWin: (ctx) => dom2.getDoc(ctx).defaultView ?? window,
|
|
120
120
|
getActiveElement: (ctx) => dom2.getDoc(ctx).activeElement,
|
|
121
|
-
getById: (ctx, id) => dom2.getRootNode(ctx).getElementById(id)
|
|
121
|
+
getById: (ctx, id) => dom2.getRootNode(ctx).getElementById(id),
|
|
122
|
+
queryById: (ctx, id) => {
|
|
123
|
+
const el = dom2.getById(ctx, id);
|
|
124
|
+
if (!el)
|
|
125
|
+
throw new Error(`Element with id "${id}" not found.`);
|
|
126
|
+
return el;
|
|
127
|
+
}
|
|
122
128
|
};
|
|
123
129
|
return {
|
|
124
130
|
...dom2,
|
package/dist/index.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
connect
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-VTDFWXSY.mjs";
|
|
4
4
|
import {
|
|
5
5
|
anatomy
|
|
6
6
|
} from "./chunk-RRQRIZBA.mjs";
|
|
7
7
|
import {
|
|
8
8
|
machine
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-YCQQKYLH.mjs";
|
|
10
|
+
import "./chunk-DYQY5P2O.mjs";
|
|
11
11
|
import "./chunk-GQYNO326.mjs";
|
|
12
12
|
export {
|
|
13
13
|
anatomy,
|
package/dist/tooltip.connect.js
CHANGED
|
@@ -77,7 +77,13 @@ function defineDomHelpers(helpers) {
|
|
|
77
77
|
getDoc: (ctx) => getDocument(dom2.getRootNode(ctx)),
|
|
78
78
|
getWin: (ctx) => dom2.getDoc(ctx).defaultView ?? window,
|
|
79
79
|
getActiveElement: (ctx) => dom2.getDoc(ctx).activeElement,
|
|
80
|
-
getById: (ctx, id) => dom2.getRootNode(ctx).getElementById(id)
|
|
80
|
+
getById: (ctx, id) => dom2.getRootNode(ctx).getElementById(id),
|
|
81
|
+
queryById: (ctx, id) => {
|
|
82
|
+
const el = dom2.getById(ctx, id);
|
|
83
|
+
if (!el)
|
|
84
|
+
throw new Error(`Element with id "${id}" not found.`);
|
|
85
|
+
return el;
|
|
86
|
+
}
|
|
81
87
|
};
|
|
82
88
|
return {
|
|
83
89
|
...dom2,
|
package/dist/tooltip.connect.mjs
CHANGED
package/dist/tooltip.dom.d.ts
CHANGED
|
@@ -19,6 +19,9 @@ declare const dom: {
|
|
|
19
19
|
getById: <T = HTMLElement>(ctx: {
|
|
20
20
|
getRootNode?: (() => Node | Document | ShadowRoot) | undefined;
|
|
21
21
|
}, id: string) => T | null;
|
|
22
|
+
queryById: <T_1 = HTMLElement>(ctx: {
|
|
23
|
+
getRootNode?: (() => Node | Document | ShadowRoot) | undefined;
|
|
24
|
+
}, id: string) => T_1;
|
|
22
25
|
} & {
|
|
23
26
|
getTriggerId: (ctx: MachineContext) => string;
|
|
24
27
|
getContentId: (ctx: MachineContext) => string;
|
package/dist/tooltip.dom.js
CHANGED
|
@@ -72,7 +72,13 @@ function defineDomHelpers(helpers) {
|
|
|
72
72
|
getDoc: (ctx) => getDocument(dom2.getRootNode(ctx)),
|
|
73
73
|
getWin: (ctx) => dom2.getDoc(ctx).defaultView ?? window,
|
|
74
74
|
getActiveElement: (ctx) => dom2.getDoc(ctx).activeElement,
|
|
75
|
-
getById: (ctx, id) => dom2.getRootNode(ctx).getElementById(id)
|
|
75
|
+
getById: (ctx, id) => dom2.getRootNode(ctx).getElementById(id),
|
|
76
|
+
queryById: (ctx, id) => {
|
|
77
|
+
const el = dom2.getById(ctx, id);
|
|
78
|
+
if (!el)
|
|
79
|
+
throw new Error(`Element with id "${id}" not found.`);
|
|
80
|
+
return el;
|
|
81
|
+
}
|
|
76
82
|
};
|
|
77
83
|
return {
|
|
78
84
|
...dom2,
|
package/dist/tooltip.dom.mjs
CHANGED
package/dist/tooltip.machine.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/tooltip.machine.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zag-js/tooltip",
|
|
3
|
-
"version": "0.0.0-dev-
|
|
3
|
+
"version": "0.0.0-dev-20230221113221",
|
|
4
4
|
"description": "Core logic for the tooltip widget implemented as a state machine",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"js",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@zag-js/anatomy": "0.1.4",
|
|
30
|
-
"@zag-js/core": "0.0.0-dev-
|
|
31
|
-
"@zag-js/popper": "0.0.0-dev-
|
|
30
|
+
"@zag-js/core": "0.0.0-dev-20230221113221",
|
|
31
|
+
"@zag-js/popper": "0.0.0-dev-20230221113221",
|
|
32
32
|
"@zag-js/types": "0.3.4"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|