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