@zag-js/toast 1.47.0 → 1.49.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.d.mts +10 -17
- package/dist/index.d.ts +10 -17
- package/dist/index.js +18 -45
- package/dist/index.mjs +5 -11
- package/dist/toast-group.connect.d.mts +4 -8
- package/dist/toast-group.connect.d.ts +4 -8
- package/dist/toast-group.connect.js +73 -97
- package/dist/toast-group.connect.mjs +67 -60
- package/dist/toast-group.machine.d.mts +2 -8
- package/dist/toast-group.machine.d.ts +2 -8
- package/dist/toast-group.machine.js +292 -346
- package/dist/toast-group.machine.mjs +286 -309
- package/dist/toast.anatomy.d.mts +2 -6
- package/dist/toast.anatomy.d.ts +2 -6
- package/dist/toast.anatomy.js +8 -40
- package/dist/toast.anatomy.mjs +4 -14
- package/dist/toast.connect.d.mts +4 -8
- package/dist/toast.connect.d.ts +4 -8
- package/dist/toast.connect.js +133 -158
- package/dist/toast.connect.mjs +126 -120
- package/dist/toast.dom.d.mts +19 -23
- package/dist/toast.dom.d.ts +19 -23
- package/dist/toast.dom.js +54 -83
- package/dist/toast.dom.mjs +39 -47
- package/dist/toast.machine.d.mts +2 -8
- package/dist/toast.machine.d.ts +2 -8
- package/dist/toast.machine.js +272 -300
- package/dist/toast.machine.mjs +265 -262
- package/dist/toast.store.d.mts +2 -8
- package/dist/toast.store.d.ts +2 -8
- package/dist/toast.store.js +344 -306
- package/dist/toast.store.mjs +340 -281
- package/dist/toast.types.d.mts +372 -374
- package/dist/toast.types.d.ts +372 -374
- package/dist/toast.types.js +4 -18
- package/dist/toast.types.mjs +1 -0
- package/dist/toast.utils.d.mts +10 -14
- package/dist/toast.utils.d.ts +10 -14
- package/dist/toast.utils.js +167 -217
- package/dist/toast.utils.mjs +157 -186
- package/package.json +9 -9
package/dist/toast.machine.js
CHANGED
|
@@ -1,304 +1,276 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
|
|
30
|
-
// src/toast.machine.ts
|
|
31
|
-
var toast_machine_exports = {};
|
|
32
|
-
__export(toast_machine_exports, {
|
|
33
|
-
machine: () => machine
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
34
4
|
});
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
5
|
+
let _zag_js_core = require("@zag-js/core");
|
|
6
|
+
let _zag_js_dom_query = require("@zag-js/dom-query");
|
|
7
|
+
let _zag_js_utils = require("@zag-js/utils");
|
|
8
|
+
const require_toast_dom = require("./toast.dom.js");
|
|
9
|
+
const require_toast_utils = require("./toast.utils.js");
|
|
10
|
+
// src/toast.machine.ts
|
|
11
|
+
const { not, and } = (0, _zag_js_core.createGuards)();
|
|
12
|
+
const machine = (0, _zag_js_core.createMachine)({
|
|
13
|
+
props({ props }) {
|
|
14
|
+
(0, _zag_js_utils.ensureProps)(props, [
|
|
15
|
+
"id",
|
|
16
|
+
"type",
|
|
17
|
+
"parent",
|
|
18
|
+
"removeDelay"
|
|
19
|
+
], "toast");
|
|
20
|
+
return {
|
|
21
|
+
closable: true,
|
|
22
|
+
...props,
|
|
23
|
+
duration: require_toast_utils.getToastDuration(props.duration, props.type)
|
|
24
|
+
};
|
|
25
|
+
},
|
|
26
|
+
initialState({ prop }) {
|
|
27
|
+
if (prop("message") === "DISMISS") return "dismissing";
|
|
28
|
+
return prop("type") === "loading" || prop("duration") === 1e400 || prop("paused") ? "visible:persist" : "visible";
|
|
29
|
+
},
|
|
30
|
+
context({ prop, bindable }) {
|
|
31
|
+
return {
|
|
32
|
+
remainingTime: bindable(() => ({ defaultValue: require_toast_utils.getToastDuration(prop("duration"), prop("type")) })),
|
|
33
|
+
createdAt: bindable(() => ({ defaultValue: Date.now() })),
|
|
34
|
+
mounted: bindable(() => ({ defaultValue: false })),
|
|
35
|
+
initialHeight: bindable(() => ({ defaultValue: 0 })),
|
|
36
|
+
rendered: bindable(() => ({ defaultValue: {
|
|
37
|
+
title: true,
|
|
38
|
+
description: true
|
|
39
|
+
} }))
|
|
40
|
+
};
|
|
41
|
+
},
|
|
42
|
+
refs() {
|
|
43
|
+
return {
|
|
44
|
+
closeTimerStartTime: Date.now(),
|
|
45
|
+
lastCloseStartTimerStartTime: 0
|
|
46
|
+
};
|
|
47
|
+
},
|
|
48
|
+
computed: {
|
|
49
|
+
zIndex: ({ prop }) => {
|
|
50
|
+
const toasts = prop("parent").context.get("toasts");
|
|
51
|
+
const index = toasts.findIndex((toast) => toast.id === prop("id"));
|
|
52
|
+
return toasts.length - index;
|
|
53
|
+
},
|
|
54
|
+
height: ({ prop }) => {
|
|
55
|
+
return prop("parent").context.get("heights").find((height) => height.id === prop("id"))?.height ?? 0;
|
|
56
|
+
},
|
|
57
|
+
heightIndex: ({ prop }) => {
|
|
58
|
+
return prop("parent").context.get("heights").findIndex((height) => height.id === prop("id"));
|
|
59
|
+
},
|
|
60
|
+
frontmost: ({ prop }) => prop("index") === 0,
|
|
61
|
+
heightBefore: ({ prop }) => {
|
|
62
|
+
const heights = prop("parent").context.get("heights");
|
|
63
|
+
const heightIndex = heights.findIndex((height) => height.id === prop("id"));
|
|
64
|
+
return heights.reduce((prev, curr, reducerIndex) => {
|
|
65
|
+
if (reducerIndex >= heightIndex) return prev;
|
|
66
|
+
return prev + curr.height;
|
|
67
|
+
}, 0);
|
|
68
|
+
},
|
|
69
|
+
shouldPersist: ({ prop }) => prop("type") === "loading" || prop("duration") === 1e400
|
|
70
|
+
},
|
|
71
|
+
watch({ track, prop, send }) {
|
|
72
|
+
track([() => prop("message")], () => {
|
|
73
|
+
const message = prop("message");
|
|
74
|
+
if (message) send({
|
|
75
|
+
type: message,
|
|
76
|
+
src: "programmatic"
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
track([() => prop("paused")], () => {
|
|
80
|
+
send({ type: prop("paused") ? "PAUSE" : "RESUME" });
|
|
81
|
+
});
|
|
82
|
+
track([() => prop("type"), () => prop("duration")], () => {
|
|
83
|
+
send({ type: "UPDATE" });
|
|
84
|
+
});
|
|
85
|
+
},
|
|
86
|
+
on: {
|
|
87
|
+
UPDATE: [{
|
|
88
|
+
guard: and("isVisible", "shouldPause"),
|
|
89
|
+
target: "visible:persist",
|
|
90
|
+
actions: ["resetCloseTimer"]
|
|
91
|
+
}, {
|
|
92
|
+
guard: "isVisible",
|
|
93
|
+
target: "visible:updating",
|
|
94
|
+
actions: ["resetCloseTimer"]
|
|
95
|
+
}],
|
|
96
|
+
MEASURE: { actions: ["measureHeight"] }
|
|
97
|
+
},
|
|
98
|
+
entry: [
|
|
99
|
+
"setMounted",
|
|
100
|
+
"measureHeight",
|
|
101
|
+
"invokeOnVisible"
|
|
102
|
+
],
|
|
103
|
+
effects: ["trackContent"],
|
|
104
|
+
states: {
|
|
105
|
+
"visible:updating": {
|
|
106
|
+
tags: ["visible", "updating"],
|
|
107
|
+
effects: ["waitForNextTick"],
|
|
108
|
+
on: {
|
|
109
|
+
DISMISS: { target: "dismissing" },
|
|
110
|
+
PAUSE: { target: "visible:persist" },
|
|
111
|
+
SHOW: { target: "visible" }
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
"visible:persist": {
|
|
115
|
+
tags: ["visible", "paused"],
|
|
116
|
+
on: {
|
|
117
|
+
RESUME: {
|
|
118
|
+
guard: not("shouldPause"),
|
|
119
|
+
target: "visible",
|
|
120
|
+
actions: ["setCloseTimer"]
|
|
121
|
+
},
|
|
122
|
+
DISMISS: { target: "dismissing" }
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
visible: {
|
|
126
|
+
tags: ["visible"],
|
|
127
|
+
effects: ["waitForDuration"],
|
|
128
|
+
on: {
|
|
129
|
+
DISMISS: { target: "dismissing" },
|
|
130
|
+
PAUSE: {
|
|
131
|
+
target: "visible:persist",
|
|
132
|
+
actions: ["syncRemainingTime"]
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
dismissing: {
|
|
137
|
+
entry: ["notifyParentOfDismiss", "invokeOnDismiss"],
|
|
138
|
+
effects: ["waitForRemoveDelay"],
|
|
139
|
+
on: { REMOVE: {
|
|
140
|
+
target: "unmounted",
|
|
141
|
+
actions: ["notifyParentToRemove"]
|
|
142
|
+
} }
|
|
143
|
+
},
|
|
144
|
+
unmounted: { entry: ["invokeOnUnmount"] }
|
|
145
|
+
},
|
|
146
|
+
implementations: {
|
|
147
|
+
effects: {
|
|
148
|
+
waitForRemoveDelay({ prop, send }) {
|
|
149
|
+
return (0, _zag_js_utils.setRafTimeout)(() => {
|
|
150
|
+
send({
|
|
151
|
+
type: "REMOVE",
|
|
152
|
+
src: "timer"
|
|
153
|
+
});
|
|
154
|
+
}, prop("removeDelay"));
|
|
155
|
+
},
|
|
156
|
+
waitForDuration({ send, context, computed }) {
|
|
157
|
+
if (computed("shouldPersist")) return;
|
|
158
|
+
return (0, _zag_js_utils.setRafTimeout)(() => {
|
|
159
|
+
send({
|
|
160
|
+
type: "DISMISS",
|
|
161
|
+
src: "timer"
|
|
162
|
+
});
|
|
163
|
+
}, context.get("remainingTime"));
|
|
164
|
+
},
|
|
165
|
+
waitForNextTick({ send }) {
|
|
166
|
+
return (0, _zag_js_utils.setRafTimeout)(() => {
|
|
167
|
+
send({
|
|
168
|
+
type: "SHOW",
|
|
169
|
+
src: "timer"
|
|
170
|
+
});
|
|
171
|
+
}, 0);
|
|
172
|
+
},
|
|
173
|
+
trackContent({ scope, prop, context, state }) {
|
|
174
|
+
return (0, _zag_js_dom_query.raf)(() => {
|
|
175
|
+
const rootEl = require_toast_dom.getRootEl(scope);
|
|
176
|
+
if (!rootEl) return;
|
|
177
|
+
const syncHeight = () => {
|
|
178
|
+
if (!state.hasTag("visible") || !rootEl.isConnected) return;
|
|
179
|
+
const height = measureLayoutHeight(rootEl);
|
|
180
|
+
require_toast_utils.setHeight(prop("parent"), {
|
|
181
|
+
id: prop("id"),
|
|
182
|
+
height
|
|
183
|
+
});
|
|
184
|
+
};
|
|
185
|
+
const syncRenderedElements = () => {
|
|
186
|
+
context.set("rendered", {
|
|
187
|
+
title: !!require_toast_dom.getTitleEl(scope),
|
|
188
|
+
description: !!require_toast_dom.getDescriptionEl(scope)
|
|
189
|
+
});
|
|
190
|
+
};
|
|
191
|
+
syncRenderedElements();
|
|
192
|
+
return require_toast_dom.observeContent(rootEl, {
|
|
193
|
+
filter: (el) => !el.hasAttribute("data-ghost"),
|
|
194
|
+
onChange: syncHeight,
|
|
195
|
+
onMutate: syncRenderedElements
|
|
196
|
+
});
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
},
|
|
200
|
+
guards: {
|
|
201
|
+
isVisible: ({ state }) => state.hasTag("visible"),
|
|
202
|
+
shouldPause: ({ computed, prop }) => computed("shouldPersist") || !!prop("paused")
|
|
203
|
+
},
|
|
204
|
+
actions: {
|
|
205
|
+
setMounted({ context }) {
|
|
206
|
+
(0, _zag_js_dom_query.raf)(() => {
|
|
207
|
+
context.set("mounted", true);
|
|
208
|
+
});
|
|
209
|
+
},
|
|
210
|
+
measureHeight({ scope, prop, context }) {
|
|
211
|
+
queueMicrotask(() => {
|
|
212
|
+
const rootEl = require_toast_dom.getRootEl(scope);
|
|
213
|
+
if (!rootEl) return;
|
|
214
|
+
const height = measureLayoutHeight(rootEl);
|
|
215
|
+
context.set("initialHeight", height);
|
|
216
|
+
const item = {
|
|
217
|
+
id: prop("id"),
|
|
218
|
+
height
|
|
219
|
+
};
|
|
220
|
+
require_toast_utils.setHeight(prop("parent"), item);
|
|
221
|
+
});
|
|
222
|
+
},
|
|
223
|
+
setCloseTimer({ refs }) {
|
|
224
|
+
refs.set("closeTimerStartTime", Date.now());
|
|
225
|
+
},
|
|
226
|
+
resetCloseTimer({ context, refs, prop }) {
|
|
227
|
+
refs.set("closeTimerStartTime", Date.now());
|
|
228
|
+
context.set("remainingTime", require_toast_utils.getToastDuration(prop("duration"), prop("type")));
|
|
229
|
+
},
|
|
230
|
+
syncRemainingTime({ context, refs }) {
|
|
231
|
+
context.set("remainingTime", (prev) => {
|
|
232
|
+
const closeTimerStartTime = refs.get("closeTimerStartTime");
|
|
233
|
+
const elapsedTime = Date.now() - closeTimerStartTime;
|
|
234
|
+
refs.set("lastCloseStartTimerStartTime", Date.now());
|
|
235
|
+
return prev - elapsedTime;
|
|
236
|
+
});
|
|
237
|
+
},
|
|
238
|
+
notifyParentToRemove({ prop }) {
|
|
239
|
+
prop("parent").send({
|
|
240
|
+
type: "TOAST.REMOVE",
|
|
241
|
+
id: prop("id")
|
|
242
|
+
});
|
|
243
|
+
},
|
|
244
|
+
notifyParentOfDismiss({ prop, scope }) {
|
|
245
|
+
const activeEl = scope.getActiveElement();
|
|
246
|
+
if (!(0, _zag_js_dom_query.contains)(require_toast_dom.getRootEl(scope), activeEl)) return;
|
|
247
|
+
const focusVisible = !!activeEl?.matches(":focus-visible");
|
|
248
|
+
prop("parent").send({
|
|
249
|
+
type: "TOAST.DISMISS",
|
|
250
|
+
focusVisible
|
|
251
|
+
});
|
|
252
|
+
},
|
|
253
|
+
invokeOnDismiss({ prop, event }) {
|
|
254
|
+
prop("parent").prop("store").dismiss(prop("id"));
|
|
255
|
+
prop("onStatusChange")?.({
|
|
256
|
+
status: "dismissing",
|
|
257
|
+
src: event.src
|
|
258
|
+
});
|
|
259
|
+
},
|
|
260
|
+
invokeOnUnmount({ prop }) {
|
|
261
|
+
prop("onStatusChange")?.({ status: "unmounted" });
|
|
262
|
+
},
|
|
263
|
+
invokeOnVisible({ prop }) {
|
|
264
|
+
prop("onStatusChange")?.({ status: "visible" });
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
}
|
|
293
268
|
});
|
|
294
269
|
function measureLayoutHeight(el) {
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
270
|
+
const prevHeight = el.style.height;
|
|
271
|
+
el.style.height = "auto";
|
|
272
|
+
const height = el.offsetHeight;
|
|
273
|
+
el.style.height = prevHeight;
|
|
274
|
+
return height;
|
|
300
275
|
}
|
|
301
|
-
|
|
302
|
-
0 && (module.exports = {
|
|
303
|
-
machine
|
|
304
|
-
});
|
|
276
|
+
exports.machine = machine;
|