@zag-js/toast 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-HRZITBY3.mjs → chunk-2GSH3KLH.mjs} +1 -1
- package/dist/{chunk-AZ32UDL3.mjs → chunk-CUDYFIYR.mjs} +7 -1
- package/dist/{chunk-SSV22S55.mjs → chunk-FNDQ2PGP.mjs} +1 -1
- package/dist/{chunk-HDTOIF42.mjs → chunk-J4KJ6G3Z.mjs} +1 -1
- package/dist/{chunk-GKMHTDAP.mjs → chunk-T4OOXF4T.mjs} +1 -1
- package/dist/index.js +7 -1
- package/dist/index.mjs +5 -5
- package/dist/toast-group.connect.js +7 -1
- package/dist/toast-group.connect.mjs +2 -2
- package/dist/toast-group.machine.js +7 -1
- package/dist/toast-group.machine.mjs +3 -3
- package/dist/toast.connect.js +7 -1
- package/dist/toast.connect.mjs +2 -2
- package/dist/toast.dom.d.ts +3 -0
- package/dist/toast.dom.js +7 -1
- package/dist/toast.dom.mjs +1 -1
- package/dist/toast.machine.js +7 -1
- package/dist/toast.machine.mjs +2 -2
- package/package.json +2 -2
|
@@ -18,7 +18,13 @@ function defineDomHelpers(helpers) {
|
|
|
18
18
|
getDoc: (ctx) => getDocument(dom2.getRootNode(ctx)),
|
|
19
19
|
getWin: (ctx) => dom2.getDoc(ctx).defaultView ?? window,
|
|
20
20
|
getActiveElement: (ctx) => dom2.getDoc(ctx).activeElement,
|
|
21
|
-
getById: (ctx, id) => dom2.getRootNode(ctx).getElementById(id)
|
|
21
|
+
getById: (ctx, id) => dom2.getRootNode(ctx).getElementById(id),
|
|
22
|
+
queryById: (ctx, id) => {
|
|
23
|
+
const el = dom2.getById(ctx, id);
|
|
24
|
+
if (!el)
|
|
25
|
+
throw new Error(`Element with id "${id}" not found.`);
|
|
26
|
+
return el;
|
|
27
|
+
}
|
|
22
28
|
};
|
|
23
29
|
return {
|
|
24
30
|
...dom2,
|
package/dist/index.js
CHANGED
|
@@ -96,7 +96,13 @@ function defineDomHelpers(helpers) {
|
|
|
96
96
|
getDoc: (ctx) => getDocument(dom2.getRootNode(ctx)),
|
|
97
97
|
getWin: (ctx) => dom2.getDoc(ctx).defaultView ?? window,
|
|
98
98
|
getActiveElement: (ctx) => dom2.getDoc(ctx).activeElement,
|
|
99
|
-
getById: (ctx, id) => dom2.getRootNode(ctx).getElementById(id)
|
|
99
|
+
getById: (ctx, id) => dom2.getRootNode(ctx).getElementById(id),
|
|
100
|
+
queryById: (ctx, id) => {
|
|
101
|
+
const el = dom2.getById(ctx, id);
|
|
102
|
+
if (!el)
|
|
103
|
+
throw new Error(`Element with id "${id}" not found.`);
|
|
104
|
+
return el;
|
|
105
|
+
}
|
|
100
106
|
};
|
|
101
107
|
return {
|
|
102
108
|
...dom2,
|
package/dist/index.mjs
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import {
|
|
2
2
|
groupConnect,
|
|
3
3
|
toaster
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-2GSH3KLH.mjs";
|
|
5
5
|
import {
|
|
6
6
|
groupMachine
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-T4OOXF4T.mjs";
|
|
8
8
|
import {
|
|
9
9
|
connect
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-J4KJ6G3Z.mjs";
|
|
11
11
|
import {
|
|
12
12
|
anatomy
|
|
13
13
|
} from "./chunk-GQHI2OMI.mjs";
|
|
14
14
|
import {
|
|
15
15
|
createToastMachine
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-FNDQ2PGP.mjs";
|
|
17
17
|
import "./chunk-LHAZKBRJ.mjs";
|
|
18
18
|
import "./chunk-XQSCE3HI.mjs";
|
|
19
|
-
import "./chunk-
|
|
19
|
+
import "./chunk-CUDYFIYR.mjs";
|
|
20
20
|
|
|
21
21
|
// ../../utilities/core/src/warning.ts
|
|
22
22
|
function warn(...a) {
|
|
@@ -64,7 +64,13 @@ function defineDomHelpers(helpers) {
|
|
|
64
64
|
getDoc: (ctx) => getDocument(dom2.getRootNode(ctx)),
|
|
65
65
|
getWin: (ctx) => dom2.getDoc(ctx).defaultView ?? window,
|
|
66
66
|
getActiveElement: (ctx) => dom2.getDoc(ctx).activeElement,
|
|
67
|
-
getById: (ctx, id) => dom2.getRootNode(ctx).getElementById(id)
|
|
67
|
+
getById: (ctx, id) => dom2.getRootNode(ctx).getElementById(id),
|
|
68
|
+
queryById: (ctx, id) => {
|
|
69
|
+
const el = dom2.getById(ctx, id);
|
|
70
|
+
if (!el)
|
|
71
|
+
throw new Error(`Element with id "${id}" not found.`);
|
|
72
|
+
return el;
|
|
73
|
+
}
|
|
68
74
|
};
|
|
69
75
|
return {
|
|
70
76
|
...dom2,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
groupConnect,
|
|
3
3
|
toaster
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-2GSH3KLH.mjs";
|
|
5
5
|
import "./chunk-GQHI2OMI.mjs";
|
|
6
6
|
import "./chunk-LHAZKBRJ.mjs";
|
|
7
7
|
import "./chunk-XQSCE3HI.mjs";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-CUDYFIYR.mjs";
|
|
9
9
|
export {
|
|
10
10
|
groupConnect,
|
|
11
11
|
toaster
|
|
@@ -69,7 +69,13 @@ function defineDomHelpers(helpers) {
|
|
|
69
69
|
getDoc: (ctx) => getDocument(dom2.getRootNode(ctx)),
|
|
70
70
|
getWin: (ctx) => dom2.getDoc(ctx).defaultView ?? window,
|
|
71
71
|
getActiveElement: (ctx) => dom2.getDoc(ctx).activeElement,
|
|
72
|
-
getById: (ctx, id) => dom2.getRootNode(ctx).getElementById(id)
|
|
72
|
+
getById: (ctx, id) => dom2.getRootNode(ctx).getElementById(id),
|
|
73
|
+
queryById: (ctx, id) => {
|
|
74
|
+
const el = dom2.getById(ctx, id);
|
|
75
|
+
if (!el)
|
|
76
|
+
throw new Error(`Element with id "${id}" not found.`);
|
|
77
|
+
return el;
|
|
78
|
+
}
|
|
73
79
|
};
|
|
74
80
|
return {
|
|
75
81
|
...dom2,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
groupMachine
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-T4OOXF4T.mjs";
|
|
4
|
+
import "./chunk-FNDQ2PGP.mjs";
|
|
5
5
|
import "./chunk-LHAZKBRJ.mjs";
|
|
6
6
|
import "./chunk-XQSCE3HI.mjs";
|
|
7
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-CUDYFIYR.mjs";
|
|
8
8
|
export {
|
|
9
9
|
groupMachine
|
|
10
10
|
};
|
package/dist/toast.connect.js
CHANGED
|
@@ -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/toast.connect.mjs
CHANGED
package/dist/toast.dom.d.ts
CHANGED
|
@@ -18,6 +18,9 @@ declare const dom: {
|
|
|
18
18
|
getById: <T = HTMLElement>(ctx: {
|
|
19
19
|
getRootNode?: (() => Node | Document | ShadowRoot) | undefined;
|
|
20
20
|
}, id: string) => T | null;
|
|
21
|
+
queryById: <T_1 = HTMLElement>(ctx: {
|
|
22
|
+
getRootNode?: (() => Node | Document | ShadowRoot) | undefined;
|
|
23
|
+
}, id: string) => T_1;
|
|
21
24
|
} & {
|
|
22
25
|
getGroupId: (placement: Placement) => string;
|
|
23
26
|
getRootId: (ctx: MachineContext) => string;
|
package/dist/toast.dom.js
CHANGED
|
@@ -44,7 +44,13 @@ function defineDomHelpers(helpers) {
|
|
|
44
44
|
getDoc: (ctx) => getDocument(dom2.getRootNode(ctx)),
|
|
45
45
|
getWin: (ctx) => dom2.getDoc(ctx).defaultView ?? window,
|
|
46
46
|
getActiveElement: (ctx) => dom2.getDoc(ctx).activeElement,
|
|
47
|
-
getById: (ctx, id) => dom2.getRootNode(ctx).getElementById(id)
|
|
47
|
+
getById: (ctx, id) => dom2.getRootNode(ctx).getElementById(id),
|
|
48
|
+
queryById: (ctx, id) => {
|
|
49
|
+
const el = dom2.getById(ctx, id);
|
|
50
|
+
if (!el)
|
|
51
|
+
throw new Error(`Element with id "${id}" not found.`);
|
|
52
|
+
return el;
|
|
53
|
+
}
|
|
48
54
|
};
|
|
49
55
|
return {
|
|
50
56
|
...dom2,
|
package/dist/toast.dom.mjs
CHANGED
package/dist/toast.machine.js
CHANGED
|
@@ -66,7 +66,13 @@ function defineDomHelpers(helpers) {
|
|
|
66
66
|
getDoc: (ctx) => getDocument(dom2.getRootNode(ctx)),
|
|
67
67
|
getWin: (ctx) => dom2.getDoc(ctx).defaultView ?? window,
|
|
68
68
|
getActiveElement: (ctx) => dom2.getDoc(ctx).activeElement,
|
|
69
|
-
getById: (ctx, id) => dom2.getRootNode(ctx).getElementById(id)
|
|
69
|
+
getById: (ctx, id) => dom2.getRootNode(ctx).getElementById(id),
|
|
70
|
+
queryById: (ctx, id) => {
|
|
71
|
+
const el = dom2.getById(ctx, id);
|
|
72
|
+
if (!el)
|
|
73
|
+
throw new Error(`Element with id "${id}" not found.`);
|
|
74
|
+
return el;
|
|
75
|
+
}
|
|
70
76
|
};
|
|
71
77
|
return {
|
|
72
78
|
...dom2,
|
package/dist/toast.machine.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createToastMachine
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-FNDQ2PGP.mjs";
|
|
4
4
|
import "./chunk-LHAZKBRJ.mjs";
|
|
5
5
|
import "./chunk-XQSCE3HI.mjs";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-CUDYFIYR.mjs";
|
|
7
7
|
export {
|
|
8
8
|
createToastMachine
|
|
9
9
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zag-js/toast",
|
|
3
|
-
"version": "0.0.0-dev-
|
|
3
|
+
"version": "0.0.0-dev-20230221113221",
|
|
4
4
|
"description": "Core logic for the toast widget implemented as a state machine",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"js",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@zag-js/anatomy": "0.1.4",
|
|
30
|
-
"@zag-js/core": "0.0.0-dev-
|
|
30
|
+
"@zag-js/core": "0.0.0-dev-20230221113221",
|
|
31
31
|
"@zag-js/types": "0.3.4"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|