@cloudlet/toast 1.3.0 → 1.4.0-rc.1
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/CHANGELOG.md +112 -0
- package/README.md +5 -1
- package/dist/agent.d.ts +334 -0
- package/dist/agent.d.ts.map +1 -0
- package/dist/agent.js +494 -0
- package/dist/agent.js.map +1 -0
- package/dist/contracts/events.d.ts +14 -0
- package/dist/contracts/events.d.ts.map +1 -1
- package/dist/contracts/internal.d.ts +16 -2
- package/dist/contracts/internal.d.ts.map +1 -1
- package/dist/contracts/notifications.d.ts +16 -0
- package/dist/contracts/notifications.d.ts.map +1 -1
- package/dist/contracts/snapshots.d.ts +8 -0
- package/dist/contracts/snapshots.d.ts.map +1 -1
- package/dist/core/actions.d.ts +69 -0
- package/dist/core/actions.d.ts.map +1 -0
- package/dist/core/actions.js +160 -0
- package/dist/core/actions.js.map +1 -0
- package/dist/core/agent-port.d.ts +116 -0
- package/dist/core/agent-port.d.ts.map +1 -0
- package/dist/core/agent-port.js +138 -0
- package/dist/core/agent-port.js.map +1 -0
- package/dist/core/bridge.d.ts.map +1 -1
- package/dist/core/bridge.js +120 -231
- package/dist/core/bridge.js.map +1 -1
- package/dist/core/controller.d.ts +44 -9
- package/dist/core/controller.d.ts.map +1 -1
- package/dist/core/controller.js +367 -292
- package/dist/core/controller.js.map +1 -1
- package/dist/core/validation.d.ts.map +1 -1
- package/dist/core/validation.js +103 -94
- package/dist/core/validation.js.map +1 -1
- package/dist/react/card.d.ts.map +1 -1
- package/dist/react/card.js +3 -3
- package/dist/react/card.js.map +1 -1
- package/dist/react/host.d.ts.map +1 -1
- package/dist/react/host.js +257 -246
- package/dist/react/host.js.map +1 -1
- package/dist/react.d.ts +7 -0
- package/dist/react.d.ts.map +1 -1
- package/package.json +3 -2
- package/src/agent.ts +879 -0
- package/src/contracts/events.ts +15 -0
- package/src/contracts/internal.ts +14 -1
- package/src/contracts/notifications.ts +16 -0
- package/src/contracts/snapshots.ts +8 -0
- package/src/core/actions.ts +149 -0
- package/src/core/agent-port.ts +237 -0
- package/src/core/bridge.ts +19 -105
- package/src/core/controller.ts +183 -56
- package/src/core/validation.ts +6 -3
- package/src/react/card.tsx +4 -3
- package/src/react/host.tsx +26 -3
- package/src/react.ts +7 -0
package/dist/react/host.js
CHANGED
|
@@ -52,29 +52,29 @@ function ae(e, t, n) {
|
|
|
52
52
|
return Number.isFinite(r) ? r : n;
|
|
53
53
|
}
|
|
54
54
|
function A(y) {
|
|
55
|
-
let { bridge: x, lease: S, document: E } = y.props, D = E.defaultView, A = b(), se = b(), ce = b(), M = b(), N = b(), le = b(), ue = b(),
|
|
55
|
+
let { bridge: x, lease: S, document: E } = y.props, D = E.defaultView, A = b(), se = b(), ce = b(), M = b(), N = b(), le = b(), ue = b(), de = b(), fe = b(), pe = b(), me = s(x, S, E, () => y.props.options.announcements), he = null, P = null, ge = null, _e = !1, ve = null, F = {}, ye = !1, I = null, be = !1, L = null, xe = y.props.options.motion?.overrides, R = u(xe), Se = () => {
|
|
56
56
|
let e = y.props.options.motion?.overrides;
|
|
57
|
-
e !==
|
|
58
|
-
},
|
|
57
|
+
e !== xe && (xe = e, R = u(e), L?.setConstants(R));
|
|
58
|
+
}, z = !1, Ce = null, we = !1, B = null, V = {
|
|
59
59
|
width: 0,
|
|
60
60
|
height: 0,
|
|
61
61
|
bodyTop: 0
|
|
62
|
-
},
|
|
62
|
+
}, Te = 0, Ee = -Infinity, H = {
|
|
63
63
|
tailOffset: 4,
|
|
64
64
|
tailScale: .9,
|
|
65
65
|
pillHeight: 44
|
|
66
|
-
},
|
|
67
|
-
function
|
|
66
|
+
}, U = !1, De = "instant", Oe = /* @__PURE__ */ new Set(), W = 0, ke = 2, G = null, Ae = null, je = !1, Me = null, K = null, Ne = !1, q = null, Pe = null, J = null, Y = !1, Fe, Ie = /* @__PURE__ */ new WeakSet(), Le = [];
|
|
67
|
+
function X(e, t, ...n) {
|
|
68
68
|
try {
|
|
69
69
|
let t = e(...n);
|
|
70
70
|
if (typeof t != "string") throw TypeError("Label formatter must return a string");
|
|
71
71
|
return t;
|
|
72
72
|
} catch (r) {
|
|
73
|
-
return
|
|
73
|
+
return Ie.has(e) || (Ie.add(e), Le.push(r)), t(...n);
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
|
-
function
|
|
77
|
-
for (let e of
|
|
76
|
+
function Re() {
|
|
77
|
+
for (let e of Le.splice(0)) x.reportDiagnostic(S, {
|
|
78
78
|
code: "formatter-error",
|
|
79
79
|
source: "Toaster.labels",
|
|
80
80
|
message: "A label formatter failed",
|
|
@@ -85,16 +85,16 @@ function A(y) {
|
|
|
85
85
|
scope: "host",
|
|
86
86
|
reason: e,
|
|
87
87
|
active: t
|
|
88
|
-
}),
|
|
89
|
-
|
|
90
|
-
},
|
|
91
|
-
if (
|
|
88
|
+
}), ze = (e) => {
|
|
89
|
+
we !== e && (we = e, Z("hover", e), L?.setHover(e));
|
|
90
|
+
}, Be = (e) => {
|
|
91
|
+
if (Ve(e), !(D && e instanceof D.HTMLElement && !e.closest(".cloudlet-slot") && Q(e)) && !Q(he)) {
|
|
92
92
|
let e = E.activeElement;
|
|
93
93
|
D && e instanceof D.HTMLElement && e.blur(), A.current?.focus({ preventScroll: !0 });
|
|
94
94
|
}
|
|
95
95
|
};
|
|
96
|
-
function
|
|
97
|
-
D && e instanceof D.HTMLElement && e !== E.body && !A.current?.contains(e) && (
|
|
96
|
+
function Ve(e) {
|
|
97
|
+
D && e instanceof D.HTMLElement && e !== E.body && !A.current?.contains(e) && (he = e);
|
|
98
98
|
}
|
|
99
99
|
function Q(e) {
|
|
100
100
|
if (!e?.isConnected || e.closest("[hidden],[inert],[aria-hidden=\"true\"]") || e.matches(":disabled")) return !1;
|
|
@@ -104,20 +104,20 @@ function A(y) {
|
|
|
104
104
|
}
|
|
105
105
|
return e.focus({ preventScroll: !0 }), E.activeElement === e;
|
|
106
106
|
}
|
|
107
|
-
function
|
|
108
|
-
if (Q(
|
|
107
|
+
function He() {
|
|
108
|
+
if (Q(he)) return !0;
|
|
109
109
|
for (let e of E.querySelectorAll("button,a[href],input,select,textarea,summary,[tabindex]")) if (e.tabIndex >= 0 && !e.closest(".cloudlet-host") && Q(e)) return !0;
|
|
110
110
|
let e = E.body.getAttribute("tabindex");
|
|
111
111
|
E.body.setAttribute("tabindex", "-1");
|
|
112
112
|
let t = Q(E.body);
|
|
113
113
|
return e === null ? E.body.removeAttribute("tabindex") : E.body.setAttribute("tabindex", e), t;
|
|
114
114
|
}
|
|
115
|
-
let
|
|
115
|
+
let Ue = (e) => {
|
|
116
116
|
let t = !!e && !!A.current?.contains(e);
|
|
117
117
|
Z("focus", t), x.setFocused(S, t ? x.getSnapshot().presentation?.handle ?? null : null);
|
|
118
118
|
};
|
|
119
|
-
function
|
|
120
|
-
if (!
|
|
119
|
+
function We() {
|
|
120
|
+
if (!ye || !D) return;
|
|
121
121
|
let e = E.documentElement.clientWidth || D.innerWidth, t = E.documentElement.clientHeight || D.innerHeight, n = v(e, t, D.visualViewport);
|
|
122
122
|
for (let e of [
|
|
123
123
|
"top",
|
|
@@ -126,18 +126,18 @@ function A(y) {
|
|
|
126
126
|
"left",
|
|
127
127
|
"width",
|
|
128
128
|
"height"
|
|
129
|
-
])
|
|
129
|
+
]) F.viewport?.setProperty(`--cloudlet-viewport-${e}`, `${n[e]}px`);
|
|
130
130
|
}
|
|
131
|
-
let
|
|
131
|
+
let Ge = () => A.current?.dataset.edge === "bottom", Ke = () => Ge() ? 1 : -1, qe = () => {
|
|
132
132
|
let e = A.current?.dataset.align;
|
|
133
133
|
return e === "left" ? 0 : e === "right" ? 1 : .5;
|
|
134
134
|
};
|
|
135
|
-
function
|
|
136
|
-
let t =
|
|
135
|
+
function Je(e) {
|
|
136
|
+
let t = F, { reduced: n } = e, r = Math.max(0, e.width), i = Math.max(0, e.height), a = Math.min(Math.max(0, e.radius), r / 2, i / 2), o = Ge(), s = o ? V.height - i : 0, c = qe(), l = `translateX(${-c * 100}%)`, u = (V.width - r) * c;
|
|
137
137
|
t.shell && (t.shell.opacity = String(O(e.opacity)), t.shell.transform = n ? "none" : `translate(${k(e.dragX)}, ${k(e.y + e.dragY)}) scale(${e.scale})`);
|
|
138
138
|
let d = le.current;
|
|
139
139
|
if (d && (d.setAttribute("width", String(r)), d.setAttribute("height", String(i)), ue.current?.setAttribute("d", m(r, i, a))), t.bg && (t.bg.borderRadius = k(a), t.bg.top = "0px", t.bg.bottom = "auto", t.bg.transform = `${l} translateY(${k(s)})`), t.clip && (t.clip.clipPath = `path("${m(r, i, a, u, s)}")`), t.badge) {
|
|
140
|
-
let i = n ? 1 :
|
|
140
|
+
let i = n ? 1 : R.badge.scale + (1 - R.badge.scale) * e.badge, a = (Ne ? u + 10 : u + r - 10) - V.width / 2;
|
|
141
141
|
t.badge.opacity = String(O(e.badge)), t.badge.transform = `translate(calc(${k(a)} - 50%), ${o ? "6px" : "-6px"}) scale(${i})`;
|
|
142
142
|
}
|
|
143
143
|
let f = o ? -1 : 1;
|
|
@@ -145,9 +145,9 @@ function A(y) {
|
|
|
145
145
|
let a = t[`tail${n}`];
|
|
146
146
|
if (!a) continue;
|
|
147
147
|
let o = e[`tail${n}`];
|
|
148
|
-
a.width = k(r), a.height = k(Math.min(i,
|
|
148
|
+
a.width = k(r), a.height = k(Math.min(i, H.pillHeight)), a.opacity = String(O(e[`tail${n}Opacity`])), a.transform = `${l} translateY(${k(f * o * (H.tailOffset + R.hoverLift * e.lift))}) scale(${H.tailScale ** +o})`;
|
|
149
149
|
}
|
|
150
|
-
t.slideOut && (t.slideOut.transform = n ? "none" : `translateX(${k(e.slide - e.slideDirection * e.slideWidth)})`, t.slideOut.opacity = String(O(e.slideOut))), t.peek && (t.peek.width = k(
|
|
150
|
+
t.slideOut && (t.slideOut.transform = n ? "none" : `translateX(${k(e.slide - e.slideDirection * e.slideWidth)})`, t.slideOut.opacity = String(O(e.slideOut))), t.peek && (t.peek.width = k(V.width), t.peek.top = k(V.bodyTop), t.peek.transform = `translateX(${k(e.slide + (q?.side ?? 0) * V.width)})`);
|
|
151
151
|
let p = n ? "none" : `translate(${k(e.headX)}, ${k(e.headY)})`;
|
|
152
152
|
t.headerIn && (t.headerIn.transform = p), t.headerOut && (t.headerOut.transform = p);
|
|
153
153
|
for (let [r, i] of [
|
|
@@ -157,38 +157,38 @@ function A(y) {
|
|
|
157
157
|
[t.badgeOut, e.badgeOut],
|
|
158
158
|
[t.pageIn, e.pageIn],
|
|
159
159
|
[t.pageOut, e.pageOut]
|
|
160
|
-
]) r && (r.opacity = String(O(i)), r.filter = ie((1 - O(i)) *
|
|
161
|
-
t.chrome && (t.chrome.opacity = String(O(e.chrome)), t.chrome.transform = n ? "none" : `translateY(${k((1 - O(e.chrome)) *
|
|
160
|
+
]) r && (r.opacity = String(O(i)), r.filter = ie((1 - O(i)) * R.blur, n));
|
|
161
|
+
t.chrome && (t.chrome.opacity = String(O(e.chrome)), t.chrome.transform = n ? "none" : `translateY(${k((1 - O(e.chrome)) * R.chromeOffset)})`), t.chromeOut && (t.chromeOut.opacity = String(O(e.chromeOut))), t.body && (t.body.opacity = String(O(e.chrome) * O(e.bodyIn) * O(e.slideIn)), t.body.transform = n ? "none" : `translateX(${k(e.slide)}) translateY(${k((1 - O(e.chrome)) * R.chromeOffset + (1 - O(e.bodyIn)) * R.bodyOffset)})`), t.bodyOut && (t.bodyOut.opacity = String(O(e.bodyOut))), t.exit && (t.exit.opacity = String(O(e.exitOpacity)), t.exit.transform = n ? l : `${l} translate(${k(e.exitX)}, ${k(e.exitY)}) scale(${e.exitScale})`), je && G?.isConnected && G.setAttribute("stroke-dasharray", `${Math.round(e.progress * 1e4) / 100} 100`);
|
|
162
162
|
}
|
|
163
|
-
function
|
|
163
|
+
function Ye() {
|
|
164
164
|
let e = ce.current, t = N.current, n = _(y.props.snapshot).presented;
|
|
165
|
-
if (!e || !t || !D || !
|
|
166
|
-
|
|
165
|
+
if (!e || !t || !D || !L || !n) {
|
|
166
|
+
U = !1;
|
|
167
167
|
return;
|
|
168
168
|
}
|
|
169
169
|
let r = e.getBoundingClientRect();
|
|
170
|
-
if (
|
|
170
|
+
if (U = r.width > 0 && r.height > 0, Ze(n), !U) return;
|
|
171
171
|
let i = D.getComputedStyle(A.current);
|
|
172
|
-
|
|
172
|
+
H = {
|
|
173
173
|
tailOffset: ae(i, "--cloudlet-tail-offset", 4),
|
|
174
174
|
tailScale: ae(i, "--cloudlet-tail-scale", .9),
|
|
175
175
|
pillHeight: ae(i, "--cloudlet-pill-height", 44)
|
|
176
176
|
};
|
|
177
177
|
let a = y.props.snapshot.island.open, o = parseFloat(D.getComputedStyle(t).borderTopLeftRadius), s = Math.min(Number.isFinite(o) ? o : a ? 24 : r.height / 2, r.height / 2, r.width / 2);
|
|
178
|
-
|
|
178
|
+
V = {
|
|
179
179
|
width: r.width,
|
|
180
180
|
height: r.height,
|
|
181
181
|
bodyTop: $()?.offsetTop ?? 0
|
|
182
|
-
},
|
|
182
|
+
}, L.setShape({
|
|
183
183
|
width: r.width,
|
|
184
184
|
height: r.height,
|
|
185
185
|
radius: s
|
|
186
|
-
},
|
|
186
|
+
}, De), De = "close", Xe();
|
|
187
187
|
}
|
|
188
|
-
function
|
|
188
|
+
function Xe() {
|
|
189
189
|
let e = $();
|
|
190
190
|
if (!e) return;
|
|
191
|
-
let t =
|
|
191
|
+
let t = it()?.querySelector("[data-cloudlet-title]")?.id;
|
|
192
192
|
if (e.scrollHeight - e.clientHeight > 1 && t) e.tabIndex = 0, e.setAttribute("role", "group"), e.setAttribute("aria-labelledby", t);
|
|
193
193
|
else for (let t of [
|
|
194
194
|
"tabindex",
|
|
@@ -196,185 +196,185 @@ function A(y) {
|
|
|
196
196
|
"aria-labelledby"
|
|
197
197
|
]) e.removeAttribute(t);
|
|
198
198
|
}
|
|
199
|
-
function
|
|
200
|
-
let t = e && !
|
|
201
|
-
t !==
|
|
199
|
+
function Ze(e) {
|
|
200
|
+
let t = e && !U && x.getSnapshot().presentation?.readable ? e.handle : null;
|
|
201
|
+
t !== Me && (Me && x.setPause(S, {
|
|
202
202
|
scope: "notification",
|
|
203
|
-
handle:
|
|
203
|
+
handle: Me,
|
|
204
204
|
reason: "content-transition",
|
|
205
205
|
active: !1
|
|
206
|
-
}),
|
|
206
|
+
}), Me = t, t && x.setPause(S, {
|
|
207
207
|
scope: "notification",
|
|
208
208
|
handle: t,
|
|
209
209
|
reason: "content-transition",
|
|
210
210
|
active: !0
|
|
211
211
|
}));
|
|
212
212
|
}
|
|
213
|
-
function
|
|
213
|
+
function Qe() {
|
|
214
214
|
let e = x.getSnapshot().presentation;
|
|
215
|
-
if (!e?.token || e.readable ||
|
|
215
|
+
if (!e?.token || e.readable || Oe.size) return;
|
|
216
216
|
let t = M.current?.querySelector(`[data-cloudlet-presented="${e.handle.generation}"]`), n = t?.getBoundingClientRect();
|
|
217
|
-
t &&
|
|
217
|
+
t && U && n?.width && n.height && D?.getComputedStyle(t).visibility !== "hidden" && x.acknowledgePresentation(S, e.handle, e.token);
|
|
218
218
|
}
|
|
219
|
-
let
|
|
220
|
-
|
|
221
|
-
}),
|
|
222
|
-
|
|
219
|
+
let $e = (e) => (Oe.add(e), () => {
|
|
220
|
+
Oe.delete(e), Qe();
|
|
221
|
+
}), et = () => {
|
|
222
|
+
We(), Ye(), Qe();
|
|
223
223
|
};
|
|
224
|
-
function
|
|
224
|
+
function tt() {
|
|
225
225
|
let e = A.current;
|
|
226
226
|
return (y.props.snapshot.island.open ? e?.querySelector(".cloudlet-slide [data-cloudlet-title]") : null) ?? e?.querySelector("[data-cloudlet-pill]") ?? null;
|
|
227
227
|
}
|
|
228
|
-
function
|
|
228
|
+
function nt() {
|
|
229
229
|
let e = y.props.snapshot.focusRequest;
|
|
230
230
|
if (!e || x.getSnapshot().focusRequest?.token !== e.token) return;
|
|
231
231
|
let t = A.current, n = e.target, r = null;
|
|
232
|
-
n.kind === "anchor" ? r = t : n.kind === "overflow" ? r = t?.querySelector("[data-cloudlet-overflow]") ?? t?.querySelector("[data-cloudlet-pill]") ?? null : n.kind === "notification" && (r = M.current?.querySelector(`[data-cloudlet-presented="${n.handle.generation}"]`) ? n.control ? M.current.querySelector(`[data-cloudlet-control="${n.control}"]`) :
|
|
232
|
+
n.kind === "anchor" ? r = t : n.kind === "overflow" ? r = t?.querySelector("[data-cloudlet-overflow]") ?? t?.querySelector("[data-cloudlet-pill]") ?? null : n.kind === "notification" && (r = M.current?.querySelector(`[data-cloudlet-presented="${n.handle.generation}"]`) ? n.control ? M.current.querySelector(`[data-cloudlet-control="${n.control}"]`) : tt() : null), Ve(E.activeElement);
|
|
233
233
|
let i = Q(r);
|
|
234
234
|
x.acknowledgeFocus(S, e.token, i ? "focused" : "unavailable");
|
|
235
235
|
}
|
|
236
|
-
function
|
|
236
|
+
function rt(e) {
|
|
237
237
|
e?.replaceChildren();
|
|
238
238
|
}
|
|
239
|
-
function
|
|
239
|
+
function it() {
|
|
240
240
|
return M.current?.querySelector(":scope > .cloudlet-clip > .cloudlet-slide > .cloudlet-header > .cloudlet-heading") ?? null;
|
|
241
241
|
}
|
|
242
242
|
function $() {
|
|
243
243
|
return M.current?.querySelector(":scope > .cloudlet-clip > .cloudlet-slide > .cloudlet-body") ?? null;
|
|
244
244
|
}
|
|
245
|
-
function
|
|
245
|
+
function at(e) {
|
|
246
246
|
let t = M.current, n = N.current;
|
|
247
|
-
if (!t || !n || !
|
|
247
|
+
if (!t || !n || !U) return {};
|
|
248
248
|
let r = {};
|
|
249
|
-
(e.presence === "exit" || e.presence === "rise" || e.presence === "replace") && (r.exit = T(t),
|
|
249
|
+
(e.presence === "exit" || e.presence === "rise" || e.presence === "replace") && (r.exit = T(t), F.exitClip && (F.exitClip.clipPath = F.clip?.clipPath ?? ""), F.exitBg && (F.exitBg.borderRadius = F.bg?.borderRadius ?? ""), F.exitBadge && (F.exitBadge.opacity = F.badge?.opacity ?? "", F.exitBadge.transform = F.badge?.transform ?? ""), F.exit && (F.exit.width = k(V.width)));
|
|
250
250
|
let i = $();
|
|
251
|
-
if (e.slide && i && (r.slide = T(i),
|
|
251
|
+
if (e.slide && i && (r.slide = T(i), Te = i.offsetTop, F.slideOut && (F.slideOut.width = k(V.width))), e.morph === "close") {
|
|
252
252
|
let e = T(n);
|
|
253
|
-
e.querySelector(".cloudlet-header")?.classList.add("cloudlet-ghost"), r.chrome = e,
|
|
253
|
+
e.querySelector(".cloudlet-header")?.classList.add("cloudlet-ghost"), r.chrome = e, F.chromeOut && (F.chromeOut.width = k(V.width));
|
|
254
254
|
}
|
|
255
|
-
let a =
|
|
255
|
+
let a = it();
|
|
256
256
|
e.header && a && (r.header = T(a));
|
|
257
|
-
let o = $(), s =
|
|
258
|
-
e.body && (
|
|
257
|
+
let o = $(), s = L?.now() ?? 0, c = e.body && s - Ee < (L?.constants.bodyQuiet ?? 0);
|
|
258
|
+
e.body && (Ee = s), e.body && !e.slide && o && !c && !L?.swapping("body") && (r.body = T(o), F.bodyOut && (F.bodyOut.top = k(o.offsetTop)));
|
|
259
259
|
let l = t.querySelector(":scope > .cloudlet-badge > .cloudlet-badge-value");
|
|
260
260
|
e.badge && l && (r.badge = T(l));
|
|
261
261
|
let u = n.querySelector(":scope > .cloudlet-indicator > .cloudlet-page > .cloudlet-page-value");
|
|
262
262
|
return e.page && u && (r.page = T(u)), r;
|
|
263
263
|
}
|
|
264
|
-
function
|
|
265
|
-
let n = M.current, r = e === "exit" ?
|
|
264
|
+
function ot(e, t) {
|
|
265
|
+
let n = M.current, r = e === "exit" ? de.current : e === "slide" ? fe.current : e === "chrome" ? pe.current : e === "header" ? n?.querySelector(":scope > .cloudlet-clip > .cloudlet-slide > .cloudlet-header > .cloudlet-heading-out") : e === "body" ? n?.querySelector(":scope > .cloudlet-clip > .cloudlet-slide > .cloudlet-body-out") : e === "badge" ? n?.querySelector(":scope > .cloudlet-badge > .cloudlet-badge-out") : n?.querySelector(":scope > .cloudlet-clip > .cloudlet-indicator > .cloudlet-page > .cloudlet-page-out");
|
|
266
266
|
return r ? (r.setAttribute("inert", ""), r.replaceChildren(t), r) : null;
|
|
267
267
|
}
|
|
268
|
-
function
|
|
269
|
-
if (!
|
|
268
|
+
function st(e, t, n) {
|
|
269
|
+
if (!L) return;
|
|
270
270
|
let r = n?.plan ?? g(e, t);
|
|
271
|
-
|
|
271
|
+
ct(t);
|
|
272
272
|
let i = {};
|
|
273
|
-
for (let [e, t] of Object.entries(n?.clones ?? {})) i[e] =
|
|
274
|
-
let a = (e) => () =>
|
|
275
|
-
|
|
276
|
-
}, s = () =>
|
|
277
|
-
r.presence === "enter" ?
|
|
278
|
-
let c = n?.heading, l = c && r.morph !== "none" ?
|
|
279
|
-
c && l &&
|
|
280
|
-
let u =
|
|
281
|
-
|
|
273
|
+
for (let [e, t] of Object.entries(n?.clones ?? {})) i[e] = ot(e, t);
|
|
274
|
+
let a = (e) => () => rt(i[e]), o = () => {
|
|
275
|
+
W && (W = 0, y.forceUpdate());
|
|
276
|
+
}, s = () => rt(de.current);
|
|
277
|
+
r.presence === "enter" ? De = "instant" : r.morph === "open" && (De = "open"), Ye();
|
|
278
|
+
let c = n?.heading, l = c && r.morph !== "none" ? it()?.getBoundingClientRect() : null;
|
|
279
|
+
c && l && L.shiftHeading(c.left - l.left, c.top - l.top, r.morph === "open" ? "open" : "close");
|
|
280
|
+
let u = Ke(), d = J && e.presented?.handle === J.handle && !t.stack.includes(J.handle) ? J : void 0;
|
|
281
|
+
J && !t.stack.includes(J.handle) && (J = null), (r.presence === "exit" || r.presence === "rise" || r.presence === "replace") && (i.exit ? L.exit(u, s, d) : d && L.release("dragX", 0), r.presence === "exit" && L.hide()), (r.presence === "enter" || r.presence === "replace") && (L.enter(u, $e("presence")), r.presence === "enter" && (L.setTails(t.depth, "settle", 0, o), t.open ? L.open() : L.setBadge(t.badge))), r.presence === "rise" && (L.rise(-u * H.tailOffset, H.tailScale, $e("presence")), L.swap("header", $e("header"), !0)), (r.tails === "arrival" || r.tails === "rise" || r.tails === "settle") && (t.depth < e.depth && (W = Math.max(W, e.depth)), L.setTails(t.depth, r.tails, e.depth, o)), r.morph === "open" ? (W = Math.max(W, e.depth), L.open(o)) : r.morph === "close" && L.collapse(t.depth, t.badge, {
|
|
282
282
|
chrome: a("chrome"),
|
|
283
283
|
tails: o
|
|
284
284
|
});
|
|
285
|
-
let f =
|
|
286
|
-
if (
|
|
287
|
-
let e =
|
|
288
|
-
|
|
289
|
-
|
|
285
|
+
let f = Ge() && n ? V.height - n.height : 0;
|
|
286
|
+
if (F.slideOut && (F.slideOut.top = k(f + Te)), F.chromeOut && i.chrome && (F.chromeOut.top = k(f)), r.slide) {
|
|
287
|
+
let e = $e("slide");
|
|
288
|
+
L.slide(Ne ? -r.slide : r.slide, V.width, () => {
|
|
289
|
+
rt(i.slide), e();
|
|
290
290
|
});
|
|
291
291
|
}
|
|
292
292
|
if (i.header) {
|
|
293
|
-
let e =
|
|
294
|
-
|
|
295
|
-
|
|
293
|
+
let e = $e("header");
|
|
294
|
+
L.swap("header", () => {
|
|
295
|
+
rt(i.header), e();
|
|
296
296
|
});
|
|
297
297
|
}
|
|
298
|
-
i.body &&
|
|
298
|
+
i.body && L.swap("body", a("body")), i.badge && L.swap("badge", a("badge")), i.page && L.swap("page", a("page")), !t.open && e.presented && t.presented && r.morph === "none" && L.setBadge(t.badge);
|
|
299
299
|
let p = x.getSnapshot().presentation;
|
|
300
300
|
r.begin && r.header && t.presented && p?.token && p.readable && p.handle === t.presented.handle && x.beginPresentation(S, t.presented.handle, p.token);
|
|
301
301
|
}
|
|
302
|
-
function st(e) {
|
|
303
|
-
let t = e.presented, n = t?.content.progress, r = rt()?.querySelector(":scope > .cloudlet-icon > .cloudlet-ring > .cloudlet-progress-fill") ?? null, i = n?.kind === "determinate", a = r !== De || t?.handle !== Oe || !ke;
|
|
304
|
-
De = r, Oe = t?.handle ?? null, ke = i && !!r, z?.setProgress(i ? n.value : null, a);
|
|
305
|
-
}
|
|
306
302
|
function ct(e) {
|
|
307
|
-
|
|
303
|
+
let t = e.presented, n = t?.content.progress, r = it()?.querySelector(":scope > .cloudlet-icon > .cloudlet-ring > .cloudlet-progress-fill") ?? null, i = n?.kind === "determinate", a = r !== G || t?.handle !== Ae || !je;
|
|
304
|
+
G = r, Ae = t?.handle ?? null, je = i && !!r, L?.setProgress(i ? n.value : null, a);
|
|
308
305
|
}
|
|
309
306
|
function lt(e) {
|
|
307
|
+
(q?.handle !== e?.handle || q?.side !== e?.side) && (q = e, y.forceUpdate());
|
|
308
|
+
}
|
|
309
|
+
function ut(e) {
|
|
310
310
|
return {
|
|
311
|
-
move: (e) =>
|
|
311
|
+
move: (e) => L?.drag("dragX", e),
|
|
312
312
|
end: (t, n) => {
|
|
313
|
-
let r = f(t, n,
|
|
313
|
+
let r = f(t, n, V.width, {
|
|
314
314
|
negative: !0,
|
|
315
315
|
positive: !0
|
|
316
316
|
});
|
|
317
317
|
if (r) {
|
|
318
|
-
if (
|
|
318
|
+
if (J = {
|
|
319
319
|
handle: e,
|
|
320
320
|
direction: r,
|
|
321
|
-
distance:
|
|
321
|
+
distance: V.width,
|
|
322
322
|
velocity: n * 1e3
|
|
323
323
|
}, x.dismiss(S, e, "swipe").status === "applied") return;
|
|
324
|
-
|
|
324
|
+
J = null;
|
|
325
325
|
}
|
|
326
|
-
|
|
326
|
+
L?.release("dragX", n * 1e3);
|
|
327
327
|
},
|
|
328
|
-
cancel: () =>
|
|
328
|
+
cancel: () => L?.release("dragX", 0)
|
|
329
329
|
};
|
|
330
330
|
}
|
|
331
|
-
function
|
|
331
|
+
function dt(e, t) {
|
|
332
332
|
let n = y.props.snapshot.stack, r = n.indexOf(e);
|
|
333
|
-
return r < 0 ? null : n[r + t * (
|
|
333
|
+
return r < 0 ? null : n[r + t * (Ne ? -1 : 1)] ?? null;
|
|
334
334
|
}
|
|
335
|
-
function
|
|
335
|
+
function ft(e) {
|
|
336
336
|
let t = (t) => {
|
|
337
|
-
let n = t < 0 ? 1 : -1, r = t ?
|
|
338
|
-
return
|
|
337
|
+
let n = t < 0 ? 1 : -1, r = t ? dt(e, n) : null;
|
|
338
|
+
return lt(r ? {
|
|
339
339
|
handle: r,
|
|
340
340
|
side: n
|
|
341
|
-
} : null), r ? Math.max(-
|
|
342
|
-
}, n = (e) =>
|
|
341
|
+
} : null), r ? Math.max(-V.width, Math.min(V.width, t)) : p(t, V.width);
|
|
342
|
+
}, n = (e) => L?.release("slide", e, () => lt(null));
|
|
343
343
|
return {
|
|
344
|
-
move: (e) =>
|
|
344
|
+
move: (e) => L?.drag("slide", t(e)),
|
|
345
345
|
end: (t, r) => {
|
|
346
|
-
let i = f(t, r,
|
|
347
|
-
negative: !!
|
|
348
|
-
positive: !!
|
|
349
|
-
}), a = i ?
|
|
346
|
+
let i = f(t, r, V.width, {
|
|
347
|
+
negative: !!dt(e, 1),
|
|
348
|
+
positive: !!dt(e, -1)
|
|
349
|
+
}), a = i ? dt(e, i < 0 ? 1 : -1) : null;
|
|
350
350
|
if (a) {
|
|
351
|
-
let e =
|
|
352
|
-
if (
|
|
353
|
-
|
|
351
|
+
let e = q;
|
|
352
|
+
if (q = null, L?.fling("slide", r * 1e3), x.navigate(S, a).status === "applied") return;
|
|
353
|
+
q = e;
|
|
354
354
|
}
|
|
355
|
-
n(
|
|
355
|
+
n(q ? r * 1e3 : 0);
|
|
356
356
|
},
|
|
357
357
|
cancel: () => n(0)
|
|
358
358
|
};
|
|
359
359
|
}
|
|
360
|
-
function
|
|
361
|
-
let e =
|
|
360
|
+
function pt() {
|
|
361
|
+
let e = Ge() ? 1 : -1, t = (t) => p(t, t * e > 0 ? V.height : c.swipe.minDistance);
|
|
362
362
|
return {
|
|
363
|
-
move: (e) =>
|
|
363
|
+
move: (e) => L?.drag("dragY", t(e)),
|
|
364
364
|
end: (t, n) => {
|
|
365
|
-
|
|
366
|
-
let r = Math.min(
|
|
365
|
+
L?.release("dragY", 0);
|
|
366
|
+
let r = Math.min(V.height, c.swipe.edge / c.swipe.distance);
|
|
367
367
|
f(t, n, r, {
|
|
368
368
|
negative: e < 0,
|
|
369
369
|
positive: e > 0
|
|
370
370
|
}) && x.collapseIsland(S);
|
|
371
371
|
},
|
|
372
|
-
cancel: () =>
|
|
372
|
+
cancel: () => L?.release("dragY", 0)
|
|
373
373
|
};
|
|
374
374
|
}
|
|
375
|
-
function
|
|
375
|
+
function mt(e, t) {
|
|
376
376
|
let n = M.current, r = N.current, { presented: i, open: a } = _(y.props.snapshot);
|
|
377
|
-
if (
|
|
377
|
+
if (z || !L || !U || !n || !r || !i || !n.contains(e)) return null;
|
|
378
378
|
let o, s = !1;
|
|
379
379
|
if (a ? (o = r.contains(e), s = o && t === "pointer" && !!e.closest(".cloudlet-clip > .cloudlet-slide > .cloudlet-header")) : o = t === "pointer" && !!e.closest("[data-cloudlet-pill]"), !o && !s) return null;
|
|
380
380
|
let { handle: c } = i;
|
|
@@ -384,7 +384,7 @@ function A(y) {
|
|
|
384
384
|
reason: "gesture",
|
|
385
385
|
active: !0
|
|
386
386
|
}).status === "rejected") return null;
|
|
387
|
-
|
|
387
|
+
Pe = {
|
|
388
388
|
handle: c,
|
|
389
389
|
open: a
|
|
390
390
|
};
|
|
@@ -392,9 +392,9 @@ function A(y) {
|
|
|
392
392
|
return {
|
|
393
393
|
x: o,
|
|
394
394
|
y: s,
|
|
395
|
-
start: (e) => a ? e === "x" ?
|
|
395
|
+
start: (e) => a ? e === "x" ? ft(c) : pt() : ut(c),
|
|
396
396
|
release() {
|
|
397
|
-
l || (l = !0,
|
|
397
|
+
l || (l = !0, Pe = null, x.setPause(S, {
|
|
398
398
|
scope: "notification",
|
|
399
399
|
handle: c,
|
|
400
400
|
reason: "gesture",
|
|
@@ -403,50 +403,60 @@ function A(y) {
|
|
|
403
403
|
}
|
|
404
404
|
};
|
|
405
405
|
}
|
|
406
|
-
function
|
|
406
|
+
function ht(e) {
|
|
407
407
|
let t = M.current;
|
|
408
408
|
return !!t && _(y.props.snapshot).open && t.contains(e);
|
|
409
409
|
}
|
|
410
|
-
function
|
|
410
|
+
function gt() {
|
|
411
411
|
let e = A.current, t = M.current;
|
|
412
412
|
if (!e || !D || !t) return;
|
|
413
|
-
|
|
413
|
+
ye = !0;
|
|
414
414
|
let n = se.current?.sheet, r = `[data-cloudlet-instance="${y.props.snapshot.controller}"]`;
|
|
415
415
|
if (n) for (let [e, t] of Object.entries(te)) {
|
|
416
416
|
let i = n.insertRule(`${r}${t} {}`, n.cssRules.length);
|
|
417
|
-
|
|
417
|
+
F[e] = n.cssRules[i].style;
|
|
418
418
|
}
|
|
419
419
|
for (let e of [
|
|
420
|
-
P.current,
|
|
421
420
|
de.current,
|
|
422
|
-
fe.current
|
|
421
|
+
fe.current,
|
|
422
|
+
pe.current
|
|
423
423
|
]) e?.setAttribute("inert", "");
|
|
424
|
-
|
|
425
|
-
begin:
|
|
426
|
-
claimsWheel:
|
|
424
|
+
me.mount(e), K = d(e, {
|
|
425
|
+
begin: mt,
|
|
426
|
+
claimsWheel: ht,
|
|
427
427
|
now: () => D.performance.now()
|
|
428
428
|
});
|
|
429
|
-
let i = D.matchMedia?.("(prefers-reduced-motion: reduce)");
|
|
430
|
-
|
|
429
|
+
let i = D.matchMedia?.("(prefers-reduced-motion: reduce)"), a = !!e.parentElement?.closest("[data-reduced-motion]"), o = () => (i?.matches ?? !1) || y.props.options.reducedMotion === !0 || a;
|
|
430
|
+
z = o(), e.dataset.reducedMotion = String(z), L = l({
|
|
431
431
|
now: () => D.performance.now(),
|
|
432
432
|
requestFrame: (e) => D.requestAnimationFrame(e),
|
|
433
433
|
cancelFrame: (e) => D.cancelAnimationFrame(e),
|
|
434
|
-
write:
|
|
435
|
-
reducedMotion:
|
|
434
|
+
write: Je,
|
|
435
|
+
reducedMotion: z,
|
|
436
436
|
timeScale: y.props.options.motion?.timeScale,
|
|
437
|
-
constants:
|
|
437
|
+
constants: R
|
|
438
|
+
});
|
|
439
|
+
let s = () => {
|
|
440
|
+
let t = o();
|
|
441
|
+
t !== z && (z = t, e.dataset.reducedMotion = String(z), z && K?.cancel(), L?.setReducedMotion(z));
|
|
442
|
+
};
|
|
443
|
+
Ce = s;
|
|
444
|
+
let c = D.MutationObserver ? new D.MutationObserver(() => {
|
|
445
|
+
a = !!e.parentElement?.closest("[data-reduced-motion]"), s();
|
|
446
|
+
}) : null;
|
|
447
|
+
for (let t = e.parentElement; t && c; t = t.parentElement) c.observe(t, {
|
|
448
|
+
attributes: !0,
|
|
449
|
+
attributeFilter: ["data-reduced-motion"]
|
|
438
450
|
});
|
|
439
|
-
let
|
|
440
|
-
V = i?.matches ?? !1, e.dataset.reducedMotion = String(V), V && q?.cancel(), z?.setReducedMotion(V);
|
|
441
|
-
}, o = D.matchMedia?.("(min-width: 48rem)"), s = D.matchMedia?.("(prefers-color-scheme: dark)"), c = () => {
|
|
451
|
+
let u = D.matchMedia?.("(min-width: 48rem)"), f = D.matchMedia?.("(prefers-color-scheme: dark)"), p = () => {
|
|
442
452
|
(y.props.options.theme ?? "system") === "system" && y.forceUpdate();
|
|
443
|
-
},
|
|
444
|
-
(y.props.options.position ?? "auto") === "auto" && (
|
|
445
|
-
},
|
|
453
|
+
}, m = () => {
|
|
454
|
+
(y.props.options.position ?? "auto") === "auto" && (K?.cancel(), y.forceUpdate());
|
|
455
|
+
}, g = () => Z("document-hidden", E.visibilityState === "hidden"), v = [
|
|
446
456
|
[
|
|
447
457
|
E,
|
|
448
458
|
"visibilitychange",
|
|
449
|
-
|
|
459
|
+
g
|
|
450
460
|
],
|
|
451
461
|
[
|
|
452
462
|
E,
|
|
@@ -461,7 +471,7 @@ function A(y) {
|
|
|
461
471
|
E,
|
|
462
472
|
"pointerover",
|
|
463
473
|
(t) => {
|
|
464
|
-
|
|
474
|
+
we && !(t.target instanceof D.Node && e.contains(t.target)) && ze(!1);
|
|
465
475
|
},
|
|
466
476
|
!0
|
|
467
477
|
],
|
|
@@ -478,81 +488,82 @@ function A(y) {
|
|
|
478
488
|
[
|
|
479
489
|
D,
|
|
480
490
|
"resize",
|
|
481
|
-
|
|
491
|
+
et
|
|
482
492
|
]
|
|
483
493
|
];
|
|
484
|
-
i &&
|
|
494
|
+
i && v.push([
|
|
485
495
|
i,
|
|
486
496
|
"change",
|
|
487
|
-
|
|
488
|
-
]),
|
|
489
|
-
|
|
497
|
+
s
|
|
498
|
+
]), u && v.push([
|
|
499
|
+
u,
|
|
490
500
|
"change",
|
|
491
|
-
|
|
492
|
-
]),
|
|
493
|
-
|
|
501
|
+
m
|
|
502
|
+
]), f && v.push([
|
|
503
|
+
f,
|
|
494
504
|
"change",
|
|
495
|
-
|
|
496
|
-
]), D.visualViewport &&
|
|
505
|
+
p
|
|
506
|
+
]), D.visualViewport && v.push([
|
|
497
507
|
D.visualViewport,
|
|
498
508
|
"resize",
|
|
499
|
-
|
|
509
|
+
et
|
|
500
510
|
], [
|
|
501
511
|
D.visualViewport,
|
|
502
512
|
"scroll",
|
|
503
|
-
|
|
513
|
+
We
|
|
504
514
|
]);
|
|
505
|
-
for (let [e, t, n, r] of
|
|
506
|
-
|
|
507
|
-
for (let [e, t, n, r] of
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
515
|
+
for (let [e, t, n, r] of v) e.addEventListener(t, n, r);
|
|
516
|
+
ve = () => {
|
|
517
|
+
for (let [e, t, n, r] of v) e.removeEventListener(t, n, r);
|
|
518
|
+
c?.disconnect(), Ce = null;
|
|
519
|
+
}, B = D.ResizeObserver ? new D.ResizeObserver(() => {
|
|
520
|
+
Ye(), Qe();
|
|
521
|
+
}) : null, N.current && B?.observe(N.current), B?.observe(e), g(), Z("window-blur", !E.hasFocus()), Ue(E.activeElement), We(), Re(), st(h, _(y.props.snapshot), null), Qe(), nt();
|
|
522
|
+
}
|
|
523
|
+
function _t(e) {
|
|
513
524
|
let t = _(e.snapshot), n = _(y.props.snapshot), r = g(t, n), i = {
|
|
514
525
|
plan: r,
|
|
515
|
-
clones:
|
|
516
|
-
heading: r.morph !== "none" &&
|
|
517
|
-
height:
|
|
518
|
-
}, a =
|
|
519
|
-
if (
|
|
526
|
+
clones: at(r),
|
|
527
|
+
heading: r.morph !== "none" && U ? it()?.getBoundingClientRect() ?? null : null,
|
|
528
|
+
height: V.height
|
|
529
|
+
}, a = P;
|
|
530
|
+
if (P = null, ge = null, a && e.snapshot.notifications.some((e) => e.handle === a) && !y.props.snapshot.notifications.some((e) => e.handle === a)) return i;
|
|
520
531
|
let o = A.current, s = E.activeElement;
|
|
521
|
-
if (!o || !D || !(s instanceof D.HTMLElement) || s === o || !o.contains(s) || j(e.snapshot) === j(y.props.snapshot) &&
|
|
522
|
-
|
|
532
|
+
if (!o || !D || !(s instanceof D.HTMLElement) || s === o || !o.contains(s) || j(e.snapshot) === j(y.props.snapshot) && St(e) === St(y.props)) return i;
|
|
533
|
+
ge = s;
|
|
523
534
|
let c = y.props.snapshot;
|
|
524
|
-
return
|
|
535
|
+
return _e = !c.notifications.length && !c.overflow.pending, (!_e || !He()) && o.focus({ preventScroll: !0 }), i;
|
|
525
536
|
}
|
|
526
|
-
function
|
|
527
|
-
let r =
|
|
528
|
-
|
|
537
|
+
function vt(e, t, n) {
|
|
538
|
+
let r = ge;
|
|
539
|
+
ge = null, _e ? (_e = !1, He()) : r && !Q(r) && (Q(tt() ?? A.current?.querySelector("[data-cloudlet-overflow]") ?? null) || A.current?.focus({ preventScroll: !0 })), Y && !St(y.props) && bt(!1), L?.setTimeScale(y.props.options.motion?.timeScale), Se(), Ce?.();
|
|
529
540
|
let i = _(y.props.snapshot);
|
|
530
|
-
|
|
541
|
+
Pe && (Pe.handle !== i.presented?.handle || Pe.open !== i.open) && K?.cancel(), q && (!i.open || !i.stack.includes(q.handle)) && (K?.cancel(), lt(null)), e.snapshot === y.props.snapshot ? Ye() : st(_(e.snapshot), i, n), Re(), Qe(), nt(), Ue(E.activeElement);
|
|
531
542
|
}
|
|
532
|
-
function
|
|
533
|
-
|
|
543
|
+
function yt() {
|
|
544
|
+
K?.dispose(), K = null, q = null, J = null, bt(!1), me.dispose(), ye = !1, ve?.(), ve = null, B?.disconnect(), B = null, L?.dispose(), L = null, Oe.clear();
|
|
534
545
|
let e = se.current?.sheet;
|
|
535
546
|
if (e) for (; e.cssRules.length;) e.deleteRule(0);
|
|
536
|
-
|
|
547
|
+
F = {};
|
|
537
548
|
for (let e of [
|
|
538
|
-
P.current,
|
|
539
549
|
de.current,
|
|
540
|
-
fe.current
|
|
541
|
-
|
|
542
|
-
|
|
550
|
+
fe.current,
|
|
551
|
+
pe.current
|
|
552
|
+
]) rt(e);
|
|
553
|
+
G = null;
|
|
543
554
|
let t = E.activeElement;
|
|
544
|
-
A.current?.contains(t) && !
|
|
555
|
+
A.current?.contains(t) && !He() && t?.blur();
|
|
545
556
|
}
|
|
546
|
-
function
|
|
547
|
-
D?.clearTimeout(
|
|
557
|
+
function bt(e = !0) {
|
|
558
|
+
D?.clearTimeout(Fe), Fe = void 0, Y && (Y = !1, e && ye && y.forceUpdate());
|
|
548
559
|
}
|
|
549
|
-
function
|
|
550
|
-
|
|
560
|
+
function xt() {
|
|
561
|
+
Y ? (bt(), x.clearAll(S)) : (Y = !0, Fe = D?.setTimeout(bt, ne), y.forceUpdate());
|
|
551
562
|
}
|
|
552
|
-
let
|
|
553
|
-
|
|
563
|
+
let St = (e) => e.options.clearAll !== !1 && _(e.snapshot).open && e.snapshot.stack.length > 1, Ct = (e) => {
|
|
564
|
+
P = e, x.dismiss(S, e, "navigation").status !== "applied" && (P = null);
|
|
554
565
|
};
|
|
555
|
-
function
|
|
566
|
+
function wt(e, t, n, r) {
|
|
556
567
|
if (e.defaultPrevented) return;
|
|
557
568
|
let i = null;
|
|
558
569
|
if (e.nativeEvent.isComposing) return;
|
|
@@ -565,22 +576,22 @@ function A(y) {
|
|
|
565
576
|
let a = i === null ? void 0 : t[i];
|
|
566
577
|
a && (e.preventDefault(), x.navigate(S, a));
|
|
567
578
|
}
|
|
568
|
-
function
|
|
579
|
+
function Tt() {
|
|
569
580
|
let { snapshot: s, options: c } = y.props, l = {
|
|
570
581
|
...i,
|
|
571
582
|
...c.labels
|
|
572
583
|
}, u = s.controller ?? "cloudlet", d = c.dir ?? (E.documentElement.dir === "rtl" ? "rtl" : "ltr"), f = c.theme ?? "system";
|
|
573
|
-
|
|
584
|
+
Ne = d === "rtl";
|
|
574
585
|
let p = `${u}-island`, m = _(s), { presented: h, open: g, total: v, index: b, missed: T } = m;
|
|
575
|
-
m.badge && (
|
|
576
|
-
let te = g &&
|
|
586
|
+
m.badge && (ke = m.count);
|
|
587
|
+
let te = g && q ? s.notifications.find((e) => e.handle === q.handle) : void 0, ne = c.position ?? "auto", O = String(ne), k = O.startsWith("bottom-") || ne === "auto" && D?.matchMedia?.("(min-width: 48rem)").matches === !1, ie = O.endsWith("-left") ? "left" : O.endsWith("-right") ? "right" : "center", ae = Math.min(2, Math.max(m.depth, W)), j = h ? o(x, S, h.handle, Be) : null, me = X(l.page, i.page, b + 1, v), he = X(l.clearAllConfirm, i.clearAllConfirm, v), P = a(c.classNames);
|
|
577
588
|
return /* @__PURE__ */ w(ee, { children: [c.offsets && /* @__PURE__ */ C(oe, {
|
|
578
589
|
instance: u,
|
|
579
590
|
offsets: c.offsets,
|
|
580
591
|
nonce: c.nonce
|
|
581
592
|
}, c.nonce ?? ""), /* @__PURE__ */ w("div", {
|
|
582
593
|
ref: A,
|
|
583
|
-
className:
|
|
594
|
+
className: P("host", "cloudlet-host"),
|
|
584
595
|
role: "region",
|
|
585
596
|
"aria-label": l.region,
|
|
586
597
|
tabIndex: -1,
|
|
@@ -596,45 +607,45 @@ function A(y) {
|
|
|
596
607
|
"data-overflow": s.overflow.pending,
|
|
597
608
|
dir: d,
|
|
598
609
|
onPointerDownCapture: (e) => {
|
|
599
|
-
|
|
610
|
+
I = e.target.closest("button");
|
|
600
611
|
},
|
|
601
612
|
onPointerCancelCapture: () => {
|
|
602
|
-
|
|
613
|
+
I = null;
|
|
603
614
|
},
|
|
604
615
|
onKeyDownCapture: (e) => {
|
|
605
|
-
(e.key === "Enter" || e.key === " ") && e.target.closest("button") && (
|
|
616
|
+
(e.key === "Enter" || e.key === " ") && e.target.closest("button") && (be = e.repeat, e.repeat ? e.preventDefault() : I = e.target.closest("button"));
|
|
606
617
|
},
|
|
607
618
|
onKeyUpCapture: () => {
|
|
608
|
-
|
|
619
|
+
be = !1;
|
|
609
620
|
},
|
|
610
621
|
onClickCapture: (e) => {
|
|
611
622
|
let t = e.target.closest("button"), n = !!t?.matches("[data-cloudlet-control=\"action\"], [data-cloudlet-control=\"retry\"], [data-cloudlet-control=\"cancel\"], [data-cloudlet-control=\"clear\"]");
|
|
612
|
-
t && (
|
|
623
|
+
t && (be || n && e.detail > 1 || I && I !== t) && (e.preventDefault(), e.stopPropagation()), I = null;
|
|
613
624
|
},
|
|
614
625
|
onFocus: (e) => {
|
|
615
|
-
|
|
626
|
+
Ve(e.relatedTarget), Ue(E.activeElement);
|
|
616
627
|
},
|
|
617
|
-
onBlur: (e) =>
|
|
618
|
-
onMouseEnter: () =>
|
|
619
|
-
onMouseLeave: () =>
|
|
628
|
+
onBlur: (e) => Ue(D && e.relatedTarget instanceof D.Element ? e.relatedTarget : null),
|
|
629
|
+
onMouseEnter: () => ze(!0),
|
|
630
|
+
onMouseLeave: () => ze(!1),
|
|
620
631
|
children: [/* @__PURE__ */ C("style", {
|
|
621
632
|
ref: se,
|
|
622
633
|
nonce: c.nonce,
|
|
623
634
|
"data-cloudlet-motion": ""
|
|
624
635
|
}), /* @__PURE__ */ w("div", {
|
|
625
636
|
ref: ce,
|
|
626
|
-
className:
|
|
637
|
+
className: P("stack", "cloudlet-stack"),
|
|
627
638
|
"data-empty": !h,
|
|
628
639
|
children: [
|
|
629
640
|
[1, 2].filter((e) => e <= ae).map((e) => /* @__PURE__ */ C("div", {
|
|
630
|
-
className:
|
|
641
|
+
className: P("tail", "cloudlet-tail"),
|
|
631
642
|
"data-cloudlet-tail": e,
|
|
632
643
|
"aria-hidden": "true"
|
|
633
644
|
}, e)),
|
|
634
645
|
/* @__PURE__ */ w("div", {
|
|
635
646
|
ref: M,
|
|
636
647
|
id: p,
|
|
637
|
-
className:
|
|
648
|
+
className: P("island", "cloudlet-shell"),
|
|
638
649
|
hidden: !h,
|
|
639
650
|
"data-state": g ? "island" : "stack",
|
|
640
651
|
"data-kind": h?.kind,
|
|
@@ -644,7 +655,7 @@ function A(y) {
|
|
|
644
655
|
"aria-label": l.island,
|
|
645
656
|
"aria-describedby": `${p}-hint`
|
|
646
657
|
} : {},
|
|
647
|
-
onKeyDown: g ? (e) =>
|
|
658
|
+
onKeyDown: g ? (e) => wt(e, s.stack, b, d === "rtl") : void 0,
|
|
648
659
|
children: [
|
|
649
660
|
/* @__PURE__ */ C("svg", {
|
|
650
661
|
ref: le,
|
|
@@ -658,7 +669,7 @@ function A(y) {
|
|
|
658
669
|
className: "cloudlet-clip",
|
|
659
670
|
children: [
|
|
660
671
|
/* @__PURE__ */ C("div", {
|
|
661
|
-
ref:
|
|
672
|
+
ref: fe,
|
|
662
673
|
className: "cloudlet-slide-out",
|
|
663
674
|
"aria-hidden": "true"
|
|
664
675
|
}),
|
|
@@ -670,16 +681,16 @@ function A(y) {
|
|
|
670
681
|
...g ? {
|
|
671
682
|
role: "group",
|
|
672
683
|
"aria-roledescription": l.slide,
|
|
673
|
-
"aria-label":
|
|
684
|
+
"aria-label": me
|
|
674
685
|
} : {},
|
|
675
686
|
children: [
|
|
676
687
|
/* @__PURE__ */ w("div", {
|
|
677
|
-
className:
|
|
688
|
+
className: P("header", "cloudlet-header"),
|
|
678
689
|
"aria-hidden": g ? void 0 : "true",
|
|
679
690
|
children: [/* @__PURE__ */ C(t, {
|
|
680
691
|
notification: h,
|
|
681
692
|
slot: j,
|
|
682
|
-
part:
|
|
693
|
+
part: P,
|
|
683
694
|
titleId: `${p}-title`
|
|
684
695
|
}), /* @__PURE__ */ C("div", {
|
|
685
696
|
className: "cloudlet-heading-out",
|
|
@@ -692,9 +703,9 @@ function A(y) {
|
|
|
692
703
|
bridge: x,
|
|
693
704
|
lease: S,
|
|
694
705
|
labels: l,
|
|
695
|
-
navigate:
|
|
706
|
+
navigate: Ct,
|
|
696
707
|
slot: j,
|
|
697
|
-
part:
|
|
708
|
+
part: P,
|
|
698
709
|
titleId: `${p}-title`
|
|
699
710
|
}),
|
|
700
711
|
/* @__PURE__ */ C("div", {
|
|
@@ -710,19 +721,19 @@ function A(y) {
|
|
|
710
721
|
children: /* @__PURE__ */ C(n, {
|
|
711
722
|
notification: te,
|
|
712
723
|
labels: l,
|
|
713
|
-
part:
|
|
724
|
+
part: P
|
|
714
725
|
})
|
|
715
726
|
}),
|
|
716
|
-
h && g && r(l,
|
|
727
|
+
h && g && r(l, P, () => x.dismiss(S, h.handle, "close-button")),
|
|
717
728
|
g && (v > 1 || T > 0) && /* @__PURE__ */ w("div", {
|
|
718
|
-
className:
|
|
729
|
+
className: P("indicator", "cloudlet-indicator"),
|
|
719
730
|
children: [
|
|
720
731
|
v > 5 ? /* @__PURE__ */ w("p", {
|
|
721
732
|
className: "cloudlet-page",
|
|
722
733
|
"aria-hidden": "true",
|
|
723
734
|
children: [/* @__PURE__ */ C("span", {
|
|
724
735
|
className: "cloudlet-page-value",
|
|
725
|
-
children:
|
|
736
|
+
children: me
|
|
726
737
|
}), /* @__PURE__ */ C("span", { className: "cloudlet-page-out" })]
|
|
727
738
|
}) : v > 1 && /* @__PURE__ */ C("div", {
|
|
728
739
|
className: "cloudlet-dots",
|
|
@@ -730,7 +741,7 @@ function A(y) {
|
|
|
730
741
|
type: "button",
|
|
731
742
|
className: "cloudlet-dot-button",
|
|
732
743
|
"aria-current": t === b ? "true" : void 0,
|
|
733
|
-
"aria-label":
|
|
744
|
+
"aria-label": X(l.page, i.page, t + 1, v),
|
|
734
745
|
onClick: () => x.navigate(S, e),
|
|
735
746
|
children: /* @__PURE__ */ C("span", {
|
|
736
747
|
className: "cloudlet-dot",
|
|
@@ -738,28 +749,28 @@ function A(y) {
|
|
|
738
749
|
})
|
|
739
750
|
}, e.generation))
|
|
740
751
|
}),
|
|
741
|
-
|
|
752
|
+
St(y.props) && /* @__PURE__ */ w(ee, { children: [/* @__PURE__ */ w("button", {
|
|
742
753
|
type: "button",
|
|
743
|
-
className:
|
|
754
|
+
className: P("clear", "cloudlet-clear"),
|
|
744
755
|
"data-cloudlet-control": "clear",
|
|
745
|
-
"data-armed":
|
|
746
|
-
onClick:
|
|
747
|
-
onBlur: () =>
|
|
756
|
+
"data-armed": Y,
|
|
757
|
+
onClick: xt,
|
|
758
|
+
onBlur: () => bt(),
|
|
748
759
|
children: [/* @__PURE__ */ C("span", {
|
|
749
|
-
"aria-hidden":
|
|
760
|
+
"aria-hidden": Y || void 0,
|
|
750
761
|
children: l.clearAll
|
|
751
762
|
}), /* @__PURE__ */ C("span", {
|
|
752
|
-
"aria-hidden": !
|
|
753
|
-
children:
|
|
763
|
+
"aria-hidden": !Y || void 0,
|
|
764
|
+
children: he
|
|
754
765
|
})]
|
|
755
766
|
}), /* @__PURE__ */ C("span", {
|
|
756
767
|
role: "status",
|
|
757
768
|
className: "cloudlet-live",
|
|
758
|
-
children:
|
|
769
|
+
children: Y ? he : ""
|
|
759
770
|
})] }),
|
|
760
771
|
T > 0 && /* @__PURE__ */ w("div", {
|
|
761
|
-
className:
|
|
762
|
-
children: [/* @__PURE__ */ C("p", { children:
|
|
772
|
+
className: P("overflow", "cloudlet-overflow"),
|
|
773
|
+
children: [/* @__PURE__ */ C("p", { children: X(l.overflowCount, i.overflowCount, T) }), /* @__PURE__ */ C("button", {
|
|
763
774
|
type: "button",
|
|
764
775
|
"data-cloudlet-overflow": "",
|
|
765
776
|
onClick: () => x.acknowledgeOverflow(S),
|
|
@@ -774,7 +785,7 @@ function A(y) {
|
|
|
774
785
|
children: l.collapse
|
|
775
786
|
}),
|
|
776
787
|
/* @__PURE__ */ C("div", {
|
|
777
|
-
ref:
|
|
788
|
+
ref: pe,
|
|
778
789
|
className: "cloudlet-chrome-out",
|
|
779
790
|
"aria-hidden": "true"
|
|
780
791
|
})
|
|
@@ -782,25 +793,25 @@ function A(y) {
|
|
|
782
793
|
}),
|
|
783
794
|
h && !g && /* @__PURE__ */ C("button", {
|
|
784
795
|
type: "button",
|
|
785
|
-
className:
|
|
796
|
+
className: P("pill", "cloudlet-pill"),
|
|
786
797
|
"data-cloudlet-pill": "",
|
|
787
798
|
"aria-expanded": "false",
|
|
788
799
|
"aria-controls": p,
|
|
789
800
|
onClick: () => x.openIsland(S, "user"),
|
|
790
|
-
"aria-label": [
|
|
801
|
+
"aria-label": [X(l.stackSummary, i.stackSummary, h.content.title, v, T), ...h.draft ? [l.draft] : []].join(", ")
|
|
791
802
|
}),
|
|
792
803
|
/* @__PURE__ */ w("span", {
|
|
793
|
-
className:
|
|
804
|
+
className: P("badge", "cloudlet-badge"),
|
|
794
805
|
"aria-hidden": "true",
|
|
795
806
|
children: [/* @__PURE__ */ C("span", {
|
|
796
807
|
className: "cloudlet-badge-value",
|
|
797
|
-
children:
|
|
808
|
+
children: ke
|
|
798
809
|
}), /* @__PURE__ */ C("span", { className: "cloudlet-badge-out" })]
|
|
799
810
|
})
|
|
800
811
|
]
|
|
801
812
|
}),
|
|
802
813
|
/* @__PURE__ */ C("div", {
|
|
803
|
-
ref:
|
|
814
|
+
ref: de,
|
|
804
815
|
className: "cloudlet-exit",
|
|
805
816
|
"aria-hidden": "true"
|
|
806
817
|
})
|
|
@@ -809,11 +820,11 @@ function A(y) {
|
|
|
809
820
|
})] });
|
|
810
821
|
}
|
|
811
822
|
return {
|
|
812
|
-
componentDidMount:
|
|
813
|
-
getSnapshotBeforeUpdate:
|
|
814
|
-
componentDidUpdate:
|
|
815
|
-
componentWillUnmount:
|
|
816
|
-
render:
|
|
823
|
+
componentDidMount: gt,
|
|
824
|
+
getSnapshotBeforeUpdate: _t,
|
|
825
|
+
componentDidUpdate: vt,
|
|
826
|
+
componentWillUnmount: yt,
|
|
827
|
+
render: Tt
|
|
817
828
|
};
|
|
818
829
|
}
|
|
819
830
|
function j(e) {
|