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