@brett_lamy/ui 4.0.0 → 5.0.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/README.md +1 -1
- package/dist/components/animated-height.d.ts +3 -1
- package/dist/components/animated-height.d.ts.map +1 -1
- package/dist/components/animated-height.js +11 -11
- package/dist/components/artifact-chat-container.d.ts.map +1 -1
- package/dist/components/artifact-chat-container.js +81 -82
- package/dist/components/button.d.ts +4 -3
- package/dist/components/button.d.ts.map +1 -1
- package/dist/components/button.js +22 -9
- package/dist/components/canvas.d.ts +91 -0
- package/dist/components/canvas.d.ts.map +1 -0
- package/dist/components/canvas.js +296 -0
- package/dist/components/composer/composer-cards.d.ts +55 -0
- package/dist/components/composer/composer-cards.d.ts.map +1 -0
- package/dist/components/composer/composer-cards.js +351 -0
- package/dist/components/composer/composer.d.ts +9 -1
- package/dist/components/composer/composer.d.ts.map +1 -1
- package/dist/components/composer/composer.js +179 -154
- package/dist/components/context-menu.d.ts +25 -0
- package/dist/components/context-menu.d.ts.map +1 -0
- package/dist/components/context-menu.js +127 -0
- package/dist/components/credenza.d.ts.map +1 -1
- package/dist/components/credenza.js +52 -92
- package/dist/components/cron-editor.d.ts +47 -0
- package/dist/components/cron-editor.d.ts.map +1 -0
- package/dist/components/cron-editor.js +297 -0
- package/dist/components/dropdown-menu.d.ts +3 -1
- package/dist/components/dropdown-menu.d.ts.map +1 -1
- package/dist/components/dropdown-menu.js +5 -5
- package/dist/components/edge-drawer.d.ts.map +1 -1
- package/dist/components/edge-drawer.js +1 -0
- package/dist/components/file-upload.d.ts +121 -0
- package/dist/components/file-upload.d.ts.map +1 -0
- package/dist/components/file-upload.js +405 -0
- package/dist/components/filter-input.d.ts +22 -0
- package/dist/components/filter-input.d.ts.map +1 -0
- package/dist/components/filter-input.js +126 -0
- package/dist/components/filter.d.ts +154 -0
- package/dist/components/filter.d.ts.map +1 -0
- package/dist/components/filter.js +815 -0
- package/dist/components/floating-chat.d.ts.map +1 -1
- package/dist/components/floating-chat.js +71 -88
- package/dist/components/floating-sheet.d.ts.map +1 -1
- package/dist/components/floating-sheet.js +93 -104
- package/dist/components/markdown-editor.d.ts +2 -0
- package/dist/components/markdown-editor.d.ts.map +1 -1
- package/dist/components/markdown-editor.js +46 -45
- package/dist/components/markdown-view.d.ts +6 -1
- package/dist/components/markdown-view.d.ts.map +1 -1
- package/dist/components/markdown-view.js +13 -11
- package/dist/components/navigation-stack.d.ts +3 -5
- package/dist/components/navigation-stack.d.ts.map +1 -1
- package/dist/components/navigation-stack.js +212 -382
- package/dist/components/passkey-enroll-dialog.d.ts +36 -0
- package/dist/components/passkey-enroll-dialog.d.ts.map +1 -0
- package/dist/components/passkey-enroll-dialog.js +234 -0
- package/dist/components/result-table.d.ts +38 -0
- package/dist/components/result-table.d.ts.map +1 -0
- package/dist/components/result-table.js +161 -0
- package/dist/components/schema-tree.d.ts +19 -0
- package/dist/components/schema-tree.d.ts.map +1 -0
- package/dist/components/schema-tree.js +172 -0
- package/dist/components/side-drawer.d.ts.map +1 -1
- package/dist/components/side-drawer.js +117 -143
- package/dist/components/slider.d.ts.map +1 -1
- package/dist/components/slider.js +4 -1
- package/dist/components/spinner-shapes.d.ts +263 -0
- package/dist/components/spinner-shapes.d.ts.map +1 -0
- package/dist/components/spinner-shapes.js +771 -0
- package/dist/components/spinner.d.ts +133 -3
- package/dist/components/spinner.d.ts.map +1 -1
- package/dist/components/spinner.js +445 -29
- package/dist/components/sql-console.d.ts +28 -0
- package/dist/components/sql-console.d.ts.map +1 -0
- package/dist/components/sql-console.js +348 -0
- package/dist/components/sql-editor.d.ts +47 -0
- package/dist/components/sql-editor.d.ts.map +1 -0
- package/dist/components/sql-editor.js +170 -0
- package/dist/components/tab-view.d.ts +2 -2
- package/dist/components/tab-view.d.ts.map +1 -1
- package/dist/components/tab-view.js +63 -49
- package/dist/components/tailscale-login-button.d.ts +53 -0
- package/dist/components/tailscale-login-button.d.ts.map +1 -0
- package/dist/components/tailscale-login-button.js +197 -0
- package/dist/components/time-input.d.ts +46 -0
- package/dist/components/time-input.d.ts.map +1 -0
- package/dist/components/time-input.js +258 -0
- package/dist/components/toast.d.ts +5 -2
- package/dist/components/toast.d.ts.map +1 -1
- package/dist/components/toast.js +249 -125
- package/dist/components/vault-gate.d.ts +60 -0
- package/dist/components/vault-gate.d.ts.map +1 -0
- package/dist/components/vault-gate.js +382 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +85 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +129 -83
- package/dist/lib/back-history.d.ts +5 -0
- package/dist/lib/back-history.d.ts.map +1 -0
- package/dist/lib/back-history.js +44 -0
- package/dist/lib/canvas-math.d.ts +82 -0
- package/dist/lib/canvas-math.d.ts.map +1 -0
- package/dist/lib/canvas-math.js +226 -0
- package/dist/lib/controllable-state.d.ts +4 -0
- package/dist/lib/controllable-state.d.ts.map +1 -0
- package/dist/lib/controllable-state.js +11 -0
- package/dist/lib/cron.d.ts +55 -0
- package/dist/lib/cron.d.ts.map +1 -0
- package/dist/lib/cron.js +269 -0
- package/dist/lib/edge-swipe.d.ts +36 -0
- package/dist/lib/edge-swipe.d.ts.map +1 -0
- package/dist/lib/edge-swipe.js +73 -0
- package/dist/lib/file-upload.d.ts +187 -0
- package/dist/lib/file-upload.d.ts.map +1 -0
- package/dist/lib/file-upload.js +349 -0
- package/dist/lib/filter-query.d.ts +90 -0
- package/dist/lib/filter-query.d.ts.map +1 -0
- package/dist/lib/filter-query.js +459 -0
- package/dist/lib/filter.d.ts +120 -0
- package/dist/lib/filter.d.ts.map +1 -0
- package/dist/lib/filter.js +399 -0
- package/dist/lib/format-bytes.d.ts +3 -0
- package/dist/lib/format-bytes.d.ts.map +1 -0
- package/dist/lib/format-bytes.js +16 -0
- package/dist/lib/gpu-cron.d.ts +51 -0
- package/dist/lib/gpu-cron.d.ts.map +1 -0
- package/dist/lib/gpu-cron.js +81 -0
- package/dist/lib/gpu-query/featurize.d.ts +19 -0
- package/dist/lib/gpu-query/featurize.d.ts.map +1 -0
- package/dist/lib/gpu-query/featurize.js +88 -0
- package/dist/lib/gpu-query/index.d.ts +73 -0
- package/dist/lib/gpu-query/index.d.ts.map +1 -0
- package/dist/lib/gpu-query/index.js +117 -0
- package/dist/lib/gpu-query/kernel.wgsl.d.ts +30 -0
- package/dist/lib/gpu-query/kernel.wgsl.d.ts.map +1 -0
- package/dist/lib/gpu-query/model.d.ts +8 -0
- package/dist/lib/gpu-query/model.d.ts.map +1 -0
- package/dist/lib/gpu-query/model.js +91 -0
- package/dist/lib/gpu-query/schema.d.ts +40 -0
- package/dist/lib/gpu-query/schema.d.ts.map +1 -0
- package/dist/lib/gpu-query/schema.js +0 -0
- package/dist/lib/gpu-query/webgpu.d.ts +12 -0
- package/dist/lib/gpu-query/webgpu.d.ts.map +1 -0
- package/dist/lib/gpu-query/weights.d.ts +17 -0
- package/dist/lib/gpu-query/weights.d.ts.map +1 -0
- package/dist/lib/gpu-query/weights.js +40 -0
- package/dist/lib/gpu-query/weights.json.d.ts +3 -0
- package/dist/lib/gpu-query/weights2.js +25 -0
- package/dist/lib/gpu-time.d.ts +77 -0
- package/dist/lib/gpu-time.d.ts.map +1 -0
- package/dist/lib/gpu-time.js +260 -0
- package/dist/lib/morph-path.d.ts +22 -0
- package/dist/lib/morph-path.d.ts.map +1 -0
- package/dist/lib/morph-path.js +42 -0
- package/dist/lib/passkey.d.ts +120 -0
- package/dist/lib/passkey.d.ts.map +1 -0
- package/dist/lib/passkey.js +186 -0
- package/dist/lib/persistent-state.d.ts +9 -0
- package/dist/lib/persistent-state.d.ts.map +1 -0
- package/dist/lib/persistent-state.js +37 -0
- package/dist/lib/pglite-core.d.ts +219 -0
- package/dist/lib/pglite-core.d.ts.map +1 -0
- package/dist/lib/pglite-core.js +273 -0
- package/dist/lib/pglite-files.d.ts +7 -0
- package/dist/lib/pglite-files.d.ts.map +1 -0
- package/dist/lib/pglite-files.js +17 -0
- package/dist/lib/pglite-schema.d.ts +58 -0
- package/dist/lib/pglite-schema.d.ts.map +1 -0
- package/dist/lib/pglite-schema.js +105 -0
- package/dist/lib/pglite-storage.d.ts +33 -0
- package/dist/lib/pglite-storage.d.ts.map +1 -0
- package/dist/lib/pglite-storage.js +55 -0
- package/dist/lib/pglite-transfer.d.ts +53 -0
- package/dist/lib/pglite-transfer.d.ts.map +1 -0
- package/dist/lib/pglite-transfer.js +126 -0
- package/dist/lib/pglite.d.ts +106 -0
- package/dist/lib/pglite.d.ts.map +1 -0
- package/dist/lib/pglite.js +298 -0
- package/dist/lib/pull-to-refresh.d.ts +24 -0
- package/dist/lib/pull-to-refresh.d.ts.map +1 -0
- package/dist/lib/pull-to-refresh.js +74 -0
- package/dist/lib/scroll-hidden.d.ts +6 -0
- package/dist/lib/scroll-hidden.d.ts.map +1 -0
- package/dist/lib/scroll-hidden.js +21 -0
- package/dist/lib/sql-format.d.ts +62 -0
- package/dist/lib/sql-format.d.ts.map +1 -0
- package/dist/lib/sql-format.js +175 -0
- package/dist/lib/sql-lex.d.ts +25 -0
- package/dist/lib/sql-lex.d.ts.map +1 -0
- package/dist/lib/sql-lex.js +135 -0
- package/dist/lib/tab-lock.d.ts +28 -0
- package/dist/lib/tab-lock.d.ts.map +1 -0
- package/dist/lib/tab-lock.js +80 -0
- package/dist/lib/tailscale-connect.d.ts +56 -0
- package/dist/lib/tailscale-connect.d.ts.map +1 -0
- package/dist/lib/tailscale-connect.js +99 -0
- package/dist/lib/tailscale-fake.d.ts +33 -0
- package/dist/lib/tailscale-fake.d.ts.map +1 -0
- package/dist/lib/tailscale-fake.js +80 -0
- package/dist/lib/tailscale-policy.d.ts +71 -0
- package/dist/lib/tailscale-policy.d.ts.map +1 -0
- package/dist/lib/tailscale-policy.js +244 -0
- package/dist/lib/tailscale-react.d.ts +20 -0
- package/dist/lib/tailscale-react.d.ts.map +1 -0
- package/dist/lib/tailscale-react.js +37 -0
- package/dist/lib/tailscale-router/bridge.d.ts +60 -0
- package/dist/lib/tailscale-router/bridge.d.ts.map +1 -0
- package/dist/lib/tailscale-router/bridge.js +198 -0
- package/dist/lib/tailscale-router/react.d.ts +19 -0
- package/dist/lib/tailscale-router/react.d.ts.map +1 -0
- package/dist/lib/tailscale-router/react.js +52 -0
- package/dist/lib/tailscale.d.ts +204 -0
- package/dist/lib/tailscale.d.ts.map +1 -0
- package/dist/lib/tailscale.js +443 -0
- package/dist/lib/title-flight.d.ts +34 -0
- package/dist/lib/title-flight.d.ts.map +1 -0
- package/dist/lib/title-flight.js +123 -0
- package/dist/lib/vault-react.d.ts +49 -0
- package/dist/lib/vault-react.d.ts.map +1 -0
- package/dist/lib/vault-react.js +196 -0
- package/dist/lib/vault-storage.d.ts +30 -0
- package/dist/lib/vault-storage.d.ts.map +1 -0
- package/dist/lib/vault-storage.js +105 -0
- package/dist/lib/vault.d.ts +200 -0
- package/dist/lib/vault.d.ts.map +1 -0
- package/dist/lib/vault.js +641 -0
- package/dist/tailscale-sw.js +332 -0
- package/package.json +35 -5
- package/dist/components/icon-button.d.ts +0 -19
- package/dist/components/icon-button.d.ts.map +0 -1
- package/dist/components/icon-button.js +0 -31
- package/dist/components/measure-h.d.ts +0 -7
- package/dist/components/measure-h.d.ts.map +0 -1
- package/dist/components/measure-h.js +0 -20
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn as e } from "../lib/utils.js";
|
|
3
|
-
import { springCss as t
|
|
4
|
-
import { Icon as
|
|
5
|
-
import { BLSafeCtx as
|
|
3
|
+
import { springCss as t } from "../lib/motion.js";
|
|
4
|
+
import { Icon as n } from "../lib/icon.js";
|
|
5
|
+
import { BLSafeCtx as r, BLStickyCtx as i, chromeStore as a } from "../lib/theme.js";
|
|
6
|
+
import { useEdgeSwipe as o } from "../lib/edge-swipe.js";
|
|
6
7
|
import { Spinner as s } from "./spinner.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
8
|
+
import { armBackHistory as c, useBackHistory as l } from "../lib/back-history.js";
|
|
9
|
+
import { usePullToRefresh as u } from "../lib/pull-to-refresh.js";
|
|
10
|
+
import { backLabel as d, shownTitle as f, useTitleFlight as p } from "../lib/title-flight.js";
|
|
11
|
+
import { useSplitViewBack as m } from "./split-view.js";
|
|
12
|
+
import { use as h, useEffect as g, useLayoutEffect as _, useRef as v, useState as y } from "react";
|
|
13
|
+
import { jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
14
|
+
import { Button as S } from "react-aria-components";
|
|
12
15
|
//#region src/components/navigation-stack.tsx
|
|
13
|
-
var
|
|
16
|
+
var C = {
|
|
14
17
|
off: "103%",
|
|
15
18
|
under: "-28%",
|
|
16
19
|
underPct: -28,
|
|
@@ -20,17 +23,17 @@ var _ = {
|
|
|
20
23
|
flick: .55,
|
|
21
24
|
settleMs: 580
|
|
22
25
|
};
|
|
23
|
-
function
|
|
24
|
-
let
|
|
26
|
+
function w({ sc: t, depth: o, top: c, ghost: l, entering: d, nav: f, backTitle: p, reg: m, defIns: w, z: T, rootBack: E }) {
|
|
27
|
+
let D = o === 0 && !l ? E : null, O = D ? D.title ?? "Back" : p, k = v(!1), [A, j] = y(!d), [M, N] = y(!1), [P, F] = y(!1), [I, L] = y(!1), R = h(r), z = v(0), B = v(null), V = v(null), H = v(null), U = v(null), W = v(null), G = v(null), K = v(null), [q, J] = y({
|
|
25
28
|
mode: "title",
|
|
26
29
|
w: 160
|
|
27
|
-
}),
|
|
28
|
-
|
|
29
|
-
let e =
|
|
30
|
-
if (!
|
|
30
|
+
}), Y = o > 0 || l || !!D;
|
|
31
|
+
_(() => {
|
|
32
|
+
let e = U.current, n = W.current, r = G.current, i = K.current;
|
|
33
|
+
if (!Y || !e || !r || !i) return;
|
|
31
34
|
let a = () => {
|
|
32
|
-
let a =
|
|
33
|
-
|
|
35
|
+
let a = t.title != null && n ? n.offsetWidth : 0, o = Math.floor((e.clientWidth - a) / 2 - 40), s = r.offsetWidth, c = i.offsetWidth, l = s > 0 && (o >= s || o >= c + 14) ? "title" : o >= c ? "back" : "none";
|
|
36
|
+
J((e) => e.mode === l && e.w === o ? e : {
|
|
34
37
|
mode: l,
|
|
35
38
|
w: Math.max(0, o)
|
|
36
39
|
});
|
|
@@ -41,466 +44,293 @@ function v({ sc: n, depth: c, top: l, ghost: v, entering: y, nav: b, backTitle:
|
|
|
41
44
|
e,
|
|
42
45
|
r,
|
|
43
46
|
i
|
|
44
|
-
].forEach((e) => o.observe(e)),
|
|
47
|
+
].forEach((e) => o.observe(e)), n && o.observe(n), () => o.disconnect();
|
|
45
48
|
}, [
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
]),
|
|
50
|
-
|
|
51
|
-
}, [
|
|
52
|
-
|
|
53
|
-
}, [
|
|
54
|
-
let
|
|
55
|
-
|
|
56
|
-
let
|
|
57
|
-
let
|
|
58
|
-
if (r !==
|
|
59
|
-
let e =
|
|
60
|
-
|
|
49
|
+
Y,
|
|
50
|
+
O,
|
|
51
|
+
t.title
|
|
52
|
+
]), _(() => {
|
|
53
|
+
d && !k.current && (k.current = !0, j(!1), requestAnimationFrame(() => requestAnimationFrame(() => j(!0))));
|
|
54
|
+
}, [d]), g(() => {
|
|
55
|
+
l && requestAnimationFrame(() => N(!0));
|
|
56
|
+
}, [l]);
|
|
57
|
+
let X = !l && o < c, { off: Z, under: ee } = C, te = l ? M ? Z : "0%" : A ? X ? ee : "0%" : Z, ne = t.bottomInset == null ? w || 0 : t.bottomInset, Q = R + 52, re = t.hideChromeOnScroll !== !1;
|
|
58
|
+
g(() => () => a.set(!1), []);
|
|
59
|
+
let ie = (e) => {
|
|
60
|
+
let n = e.currentTarget.scrollTop, r = n > (t.largeTitle ? 44 : 8);
|
|
61
|
+
if (r !== P && F(r), re && !l) {
|
|
62
|
+
let e = n - z.current;
|
|
63
|
+
n < Q * .7 ? I && (L(!1), a.set(!1)) : e > 5 ? I || (L(!0), a.set(!0)) : e < -5 && I && (L(!1), a.set(!1));
|
|
61
64
|
}
|
|
62
|
-
|
|
63
|
-
},
|
|
64
|
-
if (e.key === "Escape" &&
|
|
65
|
-
|
|
65
|
+
z.current = n;
|
|
66
|
+
}, ae = t.titleOnScroll ? P : !t.largeTitle || P, oe = (e) => {
|
|
67
|
+
if (e.key === "Escape" && f.canPop && o > 0) {
|
|
68
|
+
f.pop();
|
|
66
69
|
return;
|
|
67
70
|
}
|
|
68
71
|
if (e.key === "ArrowDown" || e.key === "ArrowUp") {
|
|
69
72
|
let t = [...e.currentTarget.querySelectorAll("[data-tkrow]")].filter((e) => e.offsetParent), n = t.indexOf(document.activeElement), r = e.key === "ArrowDown" ? n < 0 ? 0 : Math.min(n + 1, t.length - 1) : n < 0 ? t.length - 1 : Math.max(n - 1, 0);
|
|
70
73
|
t[r] && (t[r].focus(), e.preventDefault());
|
|
71
74
|
}
|
|
72
|
-
},
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
let t = H.current;
|
|
81
|
-
if (!t) return;
|
|
82
|
-
let n = e.clientY - t.y0, r = e.clientX - t.x0;
|
|
83
|
-
if (!t.on) {
|
|
84
|
-
if (n > 10 && n > Math.abs(r) * 1.3 && z.current.scrollTop <= 1) {
|
|
85
|
-
t.on = !0;
|
|
86
|
-
try {
|
|
87
|
-
z.current.setPointerCapture(e.pointerId);
|
|
88
|
-
} catch {}
|
|
89
|
-
} else if (n < -6) {
|
|
90
|
-
H.current = null;
|
|
91
|
-
return;
|
|
92
|
-
} else return;
|
|
93
|
-
}
|
|
94
|
-
let i = Math.min(110, 56 * Math.log1p(Math.max(0, n - 10) / 40));
|
|
95
|
-
t.t = i;
|
|
96
|
-
let a = B.current, o = V.current;
|
|
97
|
-
a && (a.style.transition = "none", a.style.transform = `translateY(${i}px)`), o && (o.style.opacity = String(Math.min(1, i / 58)), o.style.transform = `translateX(-50%) rotate(${i * 3.2}deg) scale(${Math.min(1, .5 + i / 90)})`), t.armed = i > 54;
|
|
98
|
-
}, de = () => {
|
|
99
|
-
let e = H.current;
|
|
100
|
-
if (!e || (H.current = null, !e.on)) return;
|
|
101
|
-
let r = B.current, i = V.current;
|
|
102
|
-
e.armed ? (W(!0), r && (r.style.transition = t("transform", "snappy"), r.style.transform = "translateY(52px)"), i && (i.style.opacity = "1", i.style.transform = "translateX(-50%)"), setTimeout(() => {
|
|
103
|
-
W(!1), r && (r.style.transition = t("transform", "smooth"), r.style.transform = "translateY(0)"), i && (i.style.opacity = "0"), n.onRefresh && n.onRefresh(), setTimeout(() => {
|
|
104
|
-
r && (r.style.transition = "", r.style.transform = "");
|
|
105
|
-
}, 560);
|
|
106
|
-
}, 1100)) : (r && (r.style.transition = t("transform", "snappy"), r.style.transform = "translateY(0)", setTimeout(() => {
|
|
107
|
-
r && (r.style.transition = "", r.style.transform = "");
|
|
108
|
-
}, 400)), i && (i.style.opacity = "0"));
|
|
109
|
-
};
|
|
110
|
-
return /* @__PURE__ */ g("div", {
|
|
111
|
-
ref: (e) => S(n.key, { el: e }),
|
|
75
|
+
}, $ = u({
|
|
76
|
+
onRefresh: t.onRefresh,
|
|
77
|
+
scroller: B,
|
|
78
|
+
content: V,
|
|
79
|
+
spinner: H
|
|
80
|
+
});
|
|
81
|
+
return /* @__PURE__ */ x("div", {
|
|
82
|
+
ref: (e) => m(t.key, { el: e }),
|
|
112
83
|
"data-slot": "screen",
|
|
113
|
-
"data-screen-
|
|
114
|
-
|
|
115
|
-
|
|
84
|
+
"data-screen-key": t.key,
|
|
85
|
+
"data-screen-label": typeof t.title == "string" ? t.title : t.key,
|
|
86
|
+
tabIndex: -1,
|
|
87
|
+
inert: X || l || void 0,
|
|
88
|
+
onKeyDown: oe,
|
|
89
|
+
className: e("outline-none absolute inset-0 z-(--screen-z) overflow-hidden will-change-transform [transform:translateX(var(--screen-x))] transition-transform duration-spring-smooth ease-spring-smooth motion-reduce:transition-none", t.grouped ? "bg-muted" : "bg-background", o > 0 && "shadow-[-10px_0_30px_black] shadow-black/16", l ? "pointer-events-none" : "pointer-events-auto"),
|
|
90
|
+
"data-scrolled": P ? "" : void 0,
|
|
116
91
|
style: {
|
|
117
|
-
"--screen-z": 10 +
|
|
118
|
-
"--screen-x":
|
|
119
|
-
"--screen-bar-h":
|
|
120
|
-
"--screen-safe-top":
|
|
121
|
-
"--screen-max-w":
|
|
122
|
-
"--screen-inset":
|
|
92
|
+
"--screen-z": 10 + T,
|
|
93
|
+
"--screen-x": te,
|
|
94
|
+
"--screen-bar-h": Q + "px",
|
|
95
|
+
"--screen-safe-top": R + "px",
|
|
96
|
+
"--screen-max-w": t.maxW == null || t.maxW === 0 || t.maxW === "" ? "none" : typeof t.maxW == "number" ? t.maxW + "px" : t.maxW,
|
|
97
|
+
"--screen-inset": ne + 28 + "px"
|
|
123
98
|
},
|
|
124
99
|
children: [
|
|
125
|
-
/* @__PURE__ */
|
|
100
|
+
/* @__PURE__ */ b("div", {
|
|
126
101
|
ref: (e) => {
|
|
127
|
-
|
|
102
|
+
B.current = e, m(t.key, { scroller: e });
|
|
128
103
|
},
|
|
129
104
|
className: "bl-scroll absolute inset-0 overflow-x-hidden overflow-y-auto overscroll-contain [-webkit-overflow-scrolling:touch]",
|
|
130
|
-
onScroll:
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
onPointerUp: de,
|
|
135
|
-
onPointerCancel: de,
|
|
136
|
-
children: /* @__PURE__ */ g("div", {
|
|
137
|
-
ref: B,
|
|
105
|
+
onScroll: ie,
|
|
106
|
+
...$.bind,
|
|
107
|
+
children: /* @__PURE__ */ x("div", {
|
|
108
|
+
ref: V,
|
|
138
109
|
className: "mx-auto box-border w-full max-w-(--screen-max-w)",
|
|
139
110
|
children: [
|
|
140
|
-
|
|
111
|
+
t.largeTitle ? /* @__PURE__ */ x("div", {
|
|
141
112
|
className: "px-4 pt-[calc(var(--screen-bar-h)+2px)] pb-1.5",
|
|
142
|
-
children: [/* @__PURE__ */
|
|
113
|
+
children: [/* @__PURE__ */ b("div", {
|
|
143
114
|
className: "text-[34px] leading-[1.15] font-extrabold tracking-[-.5px]",
|
|
144
|
-
children: /* @__PURE__ */
|
|
145
|
-
ref: (e) =>
|
|
146
|
-
children:
|
|
115
|
+
children: /* @__PURE__ */ b("span", {
|
|
116
|
+
ref: (e) => m(t.key, { large: e }),
|
|
117
|
+
children: t.title
|
|
147
118
|
})
|
|
148
|
-
}),
|
|
119
|
+
}), t.subheader ? /* @__PURE__ */ b("div", {
|
|
149
120
|
className: "mt-2.5",
|
|
150
|
-
children:
|
|
121
|
+
children: t.subheader
|
|
151
122
|
}) : null]
|
|
152
|
-
}) : /* @__PURE__ */
|
|
153
|
-
/* @__PURE__ */
|
|
154
|
-
value:
|
|
155
|
-
children:
|
|
123
|
+
}) : /* @__PURE__ */ b("div", { className: "h-(--screen-bar-h)" }),
|
|
124
|
+
/* @__PURE__ */ b(i.Provider, {
|
|
125
|
+
value: Q,
|
|
126
|
+
children: t.content
|
|
156
127
|
}),
|
|
157
|
-
/* @__PURE__ */
|
|
128
|
+
/* @__PURE__ */ b("div", { className: "h-(--screen-inset)" })
|
|
158
129
|
]
|
|
159
130
|
})
|
|
160
131
|
}),
|
|
161
|
-
|
|
162
|
-
ref:
|
|
132
|
+
t.onRefresh ? /* @__PURE__ */ b("div", {
|
|
133
|
+
ref: H,
|
|
163
134
|
className: "pointer-events-none absolute top-[calc(var(--screen-bar-h)+8px)] left-1/2 z-5 [transform:translateX(-50%)] text-muted-foreground opacity-0 transition-opacity duration-spring-snappy ease-spring-snappy",
|
|
164
|
-
children: /* @__PURE__ */
|
|
135
|
+
children: /* @__PURE__ */ b(s, { spin: $.refreshing })
|
|
165
136
|
}) : null,
|
|
166
|
-
/* @__PURE__ */
|
|
167
|
-
className: e("absolute inset-x-0 top-0 z-30 box-border flex h-(--screen-bar-h) items-end px-1.5 pt-(--screen-safe-top) transition-transform duration-spring-smooth ease-spring-smooth",
|
|
137
|
+
/* @__PURE__ */ x("div", {
|
|
138
|
+
className: e("absolute inset-x-0 top-0 z-30 box-border flex h-(--screen-bar-h) items-end px-1.5 pt-(--screen-safe-top) transition-transform duration-spring-smooth ease-spring-smooth", I ? "[transform:translateY(calc(var(--screen-safe-top)-var(--screen-bar-h)))]" : "[transform:none]"),
|
|
168
139
|
children: [
|
|
169
|
-
/* @__PURE__ */
|
|
170
|
-
|
|
171
|
-
/* @__PURE__ */
|
|
172
|
-
ref:
|
|
173
|
-
className: e("flex h-toolbar w-full items-center transition-opacity duration-spring-snappy ease-spring-snappy",
|
|
140
|
+
/* @__PURE__ */ b("div", { className: e("absolute inset-0 [border-bottom:1px_solid_var(--border)] bg-bar backdrop-blur-[18px] backdrop-saturate-[1.7] transition-opacity duration-spring-snappy ease-spring-snappy", P ? "opacity-100" : "opacity-0") }),
|
|
141
|
+
R ? /* @__PURE__ */ b("div", { className: e("absolute inset-x-0 top-0 h-(--screen-safe-top) bg-bar backdrop-blur-[18px] backdrop-saturate-[1.7] transition-transform duration-spring-smooth ease-spring-smooth", P || I ? "opacity-100" : "opacity-0", I ? "[transform:translateY(calc(var(--screen-bar-h)-var(--screen-safe-top)))]" : "[transform:none]") }) : null,
|
|
142
|
+
/* @__PURE__ */ x("div", {
|
|
143
|
+
ref: U,
|
|
144
|
+
className: e("flex h-toolbar w-full items-center transition-opacity duration-spring-snappy ease-spring-snappy", I ? "opacity-0" : "opacity-100"),
|
|
174
145
|
children: [
|
|
175
|
-
/* @__PURE__ */
|
|
146
|
+
/* @__PURE__ */ x("div", {
|
|
176
147
|
className: "relative z-1 flex min-w-[44px] items-center",
|
|
177
|
-
children: [
|
|
148
|
+
children: [Y ? /* @__PURE__ */ x(S, {
|
|
178
149
|
className: "bl-btn flex cursor-pointer items-center border-0 bg-transparent py-1.5 pr-2 pl-0 [font-family:inherit] text-body text-primary",
|
|
179
|
-
"aria-label":
|
|
180
|
-
onPress:
|
|
181
|
-
children: [/* @__PURE__ */
|
|
150
|
+
"aria-label": q.mode === "none" ? "Back" : void 0,
|
|
151
|
+
onPress: D ? D.onPress : f.canPop ? f.pop : void 0,
|
|
152
|
+
children: [/* @__PURE__ */ b(n, {
|
|
182
153
|
name: "chevL",
|
|
183
154
|
size: 24,
|
|
184
155
|
sw: 2.4
|
|
185
|
-
}),
|
|
186
|
-
ref: (e) =>
|
|
187
|
-
"data-mode":
|
|
156
|
+
}), q.mode === "none" ? null : /* @__PURE__ */ b("span", {
|
|
157
|
+
ref: (e) => m(t.key, { back: e }),
|
|
158
|
+
"data-mode": q.mode,
|
|
188
159
|
className: "max-w-(--back-w) truncate",
|
|
189
|
-
style: { "--back-w":
|
|
190
|
-
children:
|
|
160
|
+
style: { "--back-w": q.w + "px" },
|
|
161
|
+
children: q.mode === "title" ? O : "Back"
|
|
191
162
|
})]
|
|
192
|
-
}) :
|
|
163
|
+
}) : t.leading || null, Y ? /* @__PURE__ */ x("span", {
|
|
193
164
|
"aria-hidden": "true",
|
|
194
165
|
className: "pointer-events-none invisible absolute top-0 left-0 flex text-body whitespace-nowrap",
|
|
195
|
-
children: [/* @__PURE__ */
|
|
196
|
-
ref:
|
|
197
|
-
children:
|
|
198
|
-
}), /* @__PURE__ */
|
|
199
|
-
ref:
|
|
166
|
+
children: [/* @__PURE__ */ b("span", {
|
|
167
|
+
ref: G,
|
|
168
|
+
children: O
|
|
169
|
+
}), /* @__PURE__ */ b("span", {
|
|
170
|
+
ref: K,
|
|
200
171
|
children: "Back"
|
|
201
172
|
})]
|
|
202
173
|
}) : null]
|
|
203
174
|
}),
|
|
204
|
-
/* @__PURE__ */
|
|
175
|
+
/* @__PURE__ */ b("div", {
|
|
205
176
|
ref: (e) => {
|
|
206
|
-
|
|
177
|
+
W.current = e, m(t.key, { inline: e });
|
|
207
178
|
},
|
|
208
|
-
className: e("pointer-events-none absolute left-1/2 max-w-[52%] -translate-x-1/2 truncate text-body font-semibold text-foreground transition-opacity duration-spring-snappy ease-spring-snappy",
|
|
209
|
-
children:
|
|
179
|
+
className: e("pointer-events-none absolute left-1/2 max-w-[52%] -translate-x-1/2 truncate text-body font-semibold text-foreground transition-opacity duration-spring-snappy ease-spring-snappy", ae ? "opacity-100" : "opacity-0"),
|
|
180
|
+
children: t.title
|
|
210
181
|
}),
|
|
211
|
-
/* @__PURE__ */
|
|
182
|
+
/* @__PURE__ */ b("div", {
|
|
212
183
|
className: "relative z-1 ml-auto flex items-center",
|
|
213
|
-
children:
|
|
184
|
+
children: t.trailing || null
|
|
214
185
|
})
|
|
215
186
|
]
|
|
216
187
|
})
|
|
217
188
|
]
|
|
218
189
|
}),
|
|
219
|
-
|
|
220
|
-
/* @__PURE__ */
|
|
221
|
-
ref: (e) =>
|
|
222
|
-
className: e("pointer-events-none absolute inset-0 z-200 bg-black transition-opacity duration-spring-smooth ease-spring-smooth",
|
|
190
|
+
t.overlay || null,
|
|
191
|
+
/* @__PURE__ */ b("div", {
|
|
192
|
+
ref: (e) => m(t.key, { dim: e }),
|
|
193
|
+
className: e("pointer-events-none absolute inset-0 z-200 bg-black transition-opacity duration-spring-smooth ease-spring-smooth", X ? "opacity-12" : "opacity-0")
|
|
223
194
|
})
|
|
224
195
|
]
|
|
225
196
|
});
|
|
226
197
|
}
|
|
227
|
-
var
|
|
228
|
-
function
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
let i = e.getBoundingClientRect(), a = t.getBoundingClientRect(), o = n.getBoundingClientRect();
|
|
236
|
-
if (!a.width || !o.width) return null;
|
|
237
|
-
let s = r ? r.getBoundingClientRect() : i, c = {
|
|
238
|
-
x: a.left - i.left,
|
|
239
|
-
y: a.top - i.top,
|
|
240
|
-
w: a.width,
|
|
241
|
-
h: a.height
|
|
242
|
-
}, l = {
|
|
243
|
-
x: o.left - s.left,
|
|
244
|
-
y: o.top - s.top,
|
|
245
|
-
w: o.width,
|
|
246
|
-
h: o.height
|
|
247
|
-
}, u = getComputedStyle(t), d = getComputedStyle(n), f = (parseFloat(d.fontSize) || 17) / (parseFloat(u.fontSize) || 17), p = document.createElement("div");
|
|
248
|
-
p.setAttribute("aria-hidden", "true"), p.dataset.slot = "navigation-title-flight", Object.assign(p.style, {
|
|
249
|
-
position: "absolute",
|
|
250
|
-
inset: "0",
|
|
251
|
-
pointerEvents: "none",
|
|
252
|
-
zIndex: "300",
|
|
253
|
-
overflow: "hidden"
|
|
254
|
-
});
|
|
255
|
-
let m = (e, t, n) => {
|
|
256
|
-
let r = document.createElement("div");
|
|
257
|
-
return r.innerHTML = e.innerHTML, Object.assign(r.style, {
|
|
258
|
-
position: "absolute",
|
|
259
|
-
left: "0",
|
|
260
|
-
top: "0",
|
|
261
|
-
width: n.w + "px",
|
|
262
|
-
height: n.h + "px",
|
|
263
|
-
whiteSpace: "nowrap",
|
|
264
|
-
overflow: "hidden",
|
|
265
|
-
textOverflow: "ellipsis",
|
|
266
|
-
transformOrigin: "0 50%",
|
|
267
|
-
willChange: "transform, opacity",
|
|
268
|
-
color: t.color,
|
|
269
|
-
fontFamily: t.fontFamily,
|
|
270
|
-
fontSize: t.fontSize,
|
|
271
|
-
fontWeight: t.fontWeight,
|
|
272
|
-
letterSpacing: t.letterSpacing,
|
|
273
|
-
lineHeight: n.h + "px"
|
|
274
|
-
}), p.appendChild(r), r;
|
|
275
|
-
}, h = m(t, u, c), g = m(n, d, l);
|
|
276
|
-
return e.appendChild(p), t.style.visibility = "hidden", n.style.visibility = "hidden", {
|
|
277
|
-
set(e) {
|
|
278
|
-
let t = y(c.x, l.x, e), n = y(c.y + c.h / 2, l.y + l.h / 2, e);
|
|
279
|
-
h.style.transform = `translate(${t}px, ${n - c.h / 2}px) scale(${y(1, f, e)})`, g.style.transform = `translate(${t}px, ${n - l.h / 2}px) scale(${y(1 / f, 1, e)})`, h.style.opacity = String(b(1 - e * 1.8)), g.style.opacity = String(b((e - .2) / .6));
|
|
280
|
-
},
|
|
281
|
-
done() {
|
|
282
|
-
t.style.visibility = "", n.style.visibility = "", p.remove();
|
|
283
|
-
}
|
|
284
|
-
};
|
|
285
|
-
}
|
|
286
|
-
var w = _.settleMs, T = /* @__PURE__ */ new Set(), E = !1, D = typeof matchMedia < "u" && matchMedia("(any-pointer: coarse)").matches;
|
|
287
|
-
function O() {
|
|
288
|
-
if (!(!D || E)) try {
|
|
289
|
-
history.pushState({ blNav: 1 }, ""), E = !0;
|
|
290
|
-
} catch {
|
|
291
|
-
D = !1;
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
typeof window < "u" && !window.__tkPopstate && (window.__tkPopstate = 1, window.addEventListener("popstate", () => {
|
|
295
|
-
if (!E) return;
|
|
296
|
-
E = !1;
|
|
297
|
-
let e = null;
|
|
298
|
-
T.forEach((t) => {
|
|
299
|
-
let n = t();
|
|
300
|
-
n.depth > 1 && (e = n);
|
|
301
|
-
}), e && (e.pop(), setTimeout(() => {
|
|
302
|
-
let e = !1;
|
|
303
|
-
T.forEach((t) => {
|
|
304
|
-
t().depth > 1 && (e = !0);
|
|
305
|
-
}), e && O();
|
|
306
|
-
}, 80));
|
|
307
|
-
}));
|
|
308
|
-
function k({ screens: r, onPop: a, defIns: o, safeTop: s, rootBack: u, className: g, style: ee }) {
|
|
309
|
-
let y = r[0]?.title, b = c(typeof y == "string" ? y : void 0), E = u === !1 ? null : u ?? (b ? {
|
|
310
|
-
title: b.title,
|
|
311
|
-
onPress: b.back
|
|
312
|
-
} : null), D = p(null), k = p({}), A = (e, t) => {
|
|
313
|
-
k.current[e] = {
|
|
314
|
-
...k.current[e],
|
|
198
|
+
var T = C.settleMs;
|
|
199
|
+
function E({ screens: n, onPop: i, defIns: a, safeTop: s, rootBack: u, className: h, style: g }) {
|
|
200
|
+
let x = n[0]?.title, S = m(typeof x == "string" ? x : void 0), E = u === !1 ? null : u ?? (S ? {
|
|
201
|
+
title: S.title,
|
|
202
|
+
onPress: S.back
|
|
203
|
+
} : null), D = v(null), O = v({}), k = (e, t) => {
|
|
204
|
+
O.current[e] = {
|
|
205
|
+
...O.current[e],
|
|
315
206
|
...t
|
|
316
207
|
};
|
|
317
|
-
}, [
|
|
208
|
+
}, [A, j] = y({
|
|
318
209
|
enter: null,
|
|
319
210
|
exit: null
|
|
320
|
-
}),
|
|
321
|
-
|
|
322
|
-
let
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
let a = C(D.current, t, r, i);
|
|
330
|
-
if (!a) return;
|
|
331
|
-
a.set(0);
|
|
332
|
-
let o = { f: a };
|
|
333
|
-
R.current = o, o.run = l(0, 1, {
|
|
334
|
-
...n.smooth,
|
|
335
|
-
onUpdate: a.set,
|
|
336
|
-
onComplete: () => {
|
|
337
|
-
R.current === o && z();
|
|
338
|
-
}
|
|
339
|
-
});
|
|
340
|
-
});
|
|
341
|
-
};
|
|
342
|
-
d(() => z, []);
|
|
343
|
-
let H = r.map((e) => e.key).join("¦");
|
|
344
|
-
f(() => {
|
|
345
|
-
let e = N.current;
|
|
346
|
-
N.current = r;
|
|
347
|
-
let t = e.map((e) => e.key), n = r.map((e) => e.key);
|
|
348
|
-
if (t.join("¦") === H) return;
|
|
349
|
-
clearTimeout(F.current);
|
|
211
|
+
}), M = v(n), N = v(!1), P = v(void 0), F = v(i);
|
|
212
|
+
F.current = i;
|
|
213
|
+
let I = p(D), L = v({}), R = () => !document.activeElement || document.activeElement === document.body || !!D.current?.contains(document.activeElement), z = n.map((e) => e.key).join("¦");
|
|
214
|
+
_(() => {
|
|
215
|
+
let e = M.current;
|
|
216
|
+
M.current = n;
|
|
217
|
+
let t = e.map((e) => e.key), r = n.map((e) => e.key);
|
|
218
|
+
if (t.join("¦") === z) return;
|
|
219
|
+
clearTimeout(P.current);
|
|
350
220
|
let i = (e, t) => e.every((e, n) => t[n] === e);
|
|
351
|
-
if (
|
|
352
|
-
|
|
353
|
-
enter:
|
|
221
|
+
if (r.length > t.length && i(t, r)) {
|
|
222
|
+
j({
|
|
223
|
+
enter: r[r.length - 1],
|
|
354
224
|
exit: null
|
|
355
225
|
});
|
|
356
|
-
let e = t[t.length - 1],
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
]), O(),
|
|
226
|
+
let e = t[t.length - 1], n = r[r.length - 1];
|
|
227
|
+
I.fly(() => [
|
|
228
|
+
f(O.current[e]),
|
|
229
|
+
d(O.current[n]),
|
|
230
|
+
O.current[n]?.el
|
|
231
|
+
]), c(), R() && requestAnimationFrame(() => O.current[n]?.el?.focus({ preventScroll: !0 })), P.current = setTimeout(() => j({
|
|
362
232
|
enter: null,
|
|
363
233
|
exit: null
|
|
364
|
-
}),
|
|
365
|
-
} else if (
|
|
366
|
-
if (
|
|
367
|
-
|
|
234
|
+
}), T);
|
|
235
|
+
} else if (r.length < t.length && i(r, t)) {
|
|
236
|
+
if (N.current) {
|
|
237
|
+
N.current = !1, j({
|
|
368
238
|
enter: null,
|
|
369
239
|
exit: null
|
|
370
240
|
});
|
|
371
241
|
return;
|
|
372
242
|
}
|
|
373
|
-
|
|
243
|
+
j({
|
|
374
244
|
enter: null,
|
|
375
|
-
exit: e.slice(
|
|
245
|
+
exit: e.slice(r.length)
|
|
376
246
|
});
|
|
377
|
-
let
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
]),
|
|
247
|
+
let n = t[t.length - 1], i = r[r.length - 1];
|
|
248
|
+
I.fly(() => [
|
|
249
|
+
d(O.current[n]),
|
|
250
|
+
f(O.current[i]),
|
|
251
|
+
O.current[i]?.el
|
|
252
|
+
]), R() && requestAnimationFrame(() => {
|
|
253
|
+
let e = L.current[i];
|
|
254
|
+
(e?.isConnected ? e : O.current[i]?.el)?.focus({ preventScroll: !0 });
|
|
255
|
+
}), P.current = setTimeout(() => j({
|
|
383
256
|
enter: null,
|
|
384
257
|
exit: null
|
|
385
|
-
}),
|
|
386
|
-
} else
|
|
258
|
+
}), T);
|
|
259
|
+
} else j({
|
|
387
260
|
enter: null,
|
|
388
261
|
exit: null
|
|
389
262
|
});
|
|
390
|
-
}, [
|
|
391
|
-
let
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
L.current = {
|
|
408
|
-
x0: e.clientX,
|
|
409
|
-
y0: e.clientY,
|
|
410
|
-
w: t.width,
|
|
411
|
-
topR: n,
|
|
412
|
-
undR: i,
|
|
413
|
-
last: e.clientX,
|
|
414
|
-
lt: performance.now(),
|
|
415
|
-
vel: 0,
|
|
416
|
-
moved: !1,
|
|
417
|
-
on: !1
|
|
263
|
+
}, [z]);
|
|
264
|
+
let B = A.exit || [], V = n.length > 1;
|
|
265
|
+
l(n.length, () => F.current?.());
|
|
266
|
+
let H = (e) => [e.top, e.under].forEach((e) => {
|
|
267
|
+
e.el.style.transition = "", e.el.style.transform = "", e.dim && (e.dim.style.transition = "", e.dim.style.opacity = "");
|
|
268
|
+
}), U = o({
|
|
269
|
+
target: () => D.current,
|
|
270
|
+
edge: C.edge,
|
|
271
|
+
commit: C.commit,
|
|
272
|
+
flick: C.flick,
|
|
273
|
+
begin: () => {
|
|
274
|
+
if (A.enter || A.exit || n.length < 2) return null;
|
|
275
|
+
let e = O.current[n[n.length - 1].key], t = O.current[n[n.length - 2].key];
|
|
276
|
+
return !e?.el || !t?.el ? null : {
|
|
277
|
+
top: e,
|
|
278
|
+
under: t,
|
|
279
|
+
flight: null
|
|
418
280
|
};
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
return;
|
|
435
|
-
}
|
|
436
|
-
}
|
|
437
|
-
let i = Math.max(0, n);
|
|
438
|
-
t.moved = !0, t.dx = i, t.vel = (e.clientX - t.last) / Math.max(1, performance.now() - t.lt), t.last = e.clientX, t.lt = performance.now();
|
|
439
|
-
let a = i / t.w;
|
|
440
|
-
try {
|
|
441
|
-
t.topR.el.style.transition = "none", t.topR.el.style.transform = `translateX(${i}px)`, t.undR.el.style.transition = "none", t.undR.el.style.transform = `translateX(${_.underPct * (1 - a)}%)`, t.undR.dim && (t.undR.dim.style.transition = "none", t.undR.dim.style.opacity = String(_.dim * (1 - a))), t.flight && R.current === t.flight && t.flight.f.set(a);
|
|
442
|
-
} catch {
|
|
443
|
-
L.current = null;
|
|
444
|
-
}
|
|
445
|
-
}, J = () => {
|
|
446
|
-
let e = L.current;
|
|
447
|
-
if (!e) return;
|
|
448
|
-
if (L.current = null, !e.moved || !e.on) {
|
|
449
|
-
Y(e);
|
|
450
|
-
return;
|
|
451
|
-
}
|
|
452
|
-
let r = (e.dx || 0) / e.w, i = r > _.commit || e.vel > _.flick, a = t("transform", "tray"), o = e.flight && R.current === e.flight ? e.flight : null;
|
|
453
|
-
o && (o.run = l(r, +!!i, {
|
|
454
|
-
...n.tray,
|
|
455
|
-
onUpdate: o.f.set,
|
|
456
|
-
onComplete: () => {
|
|
457
|
-
R.current === o && z();
|
|
458
|
-
}
|
|
459
|
-
})), i ? (e.topR.el.style.transition = a, e.topR.el.style.transform = "translateX(104%)", e.undR.el.style.transition = a, e.undR.el.style.transform = "translateX(0%)", e.undR.dim && (e.undR.dim.style.transition = t("opacity", "tray"), e.undR.dim.style.opacity = "0"), P.current = !0, setTimeout(() => {
|
|
460
|
-
I.current && I.current(), requestAnimationFrame(() => Y(e));
|
|
461
|
-
}, 380)) : (e.topR.el.style.transition = a, e.topR.el.style.transform = "translateX(0px)", e.undR.el.style.transition = a, e.undR.el.style.transform = `translateX(${_.under})`, e.undR.dim && (e.undR.dim.style.transition = t("opacity", "tray"), e.undR.dim.style.opacity = String(_.dim)), setTimeout(() => Y(e), 430));
|
|
462
|
-
}, Y = (e) => [e.topR, e.undR].forEach((e) => {
|
|
463
|
-
try {
|
|
464
|
-
e && e.el && (e.el.style.transition = "", e.el.style.transform = ""), e && e.dim && (e.dim.style.transition = "", e.dim.style.opacity = "");
|
|
465
|
-
} catch {}
|
|
466
|
-
}), X = r.length - 1, Z = N.current.map((e) => e.key), Q = r.length > Z.length && Z.every((e, t) => r[t] && r[t].key === e) ? r[X].key : null, $ = [...r.map((e, t) => ({
|
|
281
|
+
},
|
|
282
|
+
engage: (e) => {
|
|
283
|
+
e.flight = I.scrub(d(e.top), f(e.under), e.under.el);
|
|
284
|
+
},
|
|
285
|
+
move: (e, t, n) => {
|
|
286
|
+
e.top.el.style.transition = "none", e.top.el.style.transform = `translateX(${n}px)`, e.under.el.style.transition = "none", e.under.el.style.transform = `translateX(${C.underPct * (1 - t)}%)`, e.under.dim && (e.under.dim.style.transition = "none", e.under.dim.style.opacity = String(C.dim * (1 - t))), I.isCurrent(e.flight) && e.flight.f.set(t);
|
|
287
|
+
},
|
|
288
|
+
release: (e, { p: n, commit: r }) => {
|
|
289
|
+
let i = t("transform", "tray");
|
|
290
|
+
I.release(e.flight, n, +!!r), r ? (e.top.el.style.transition = i, e.top.el.style.transform = "translateX(104%)", e.under.el.style.transition = i, e.under.el.style.transform = "translateX(0%)", e.under.dim && (e.under.dim.style.transition = t("opacity", "tray"), e.under.dim.style.opacity = "0"), N.current = !0, setTimeout(() => {
|
|
291
|
+
F.current?.(), requestAnimationFrame(() => H(e));
|
|
292
|
+
}, 380)) : (e.top.el.style.transition = i, e.top.el.style.transform = "translateX(0px)", e.under.el.style.transition = i, e.under.el.style.transform = `translateX(${C.under})`, e.under.dim && (e.under.dim.style.transition = t("opacity", "tray"), e.under.dim.style.opacity = String(C.dim)), setTimeout(() => H(e), 430));
|
|
293
|
+
},
|
|
294
|
+
abort: H
|
|
295
|
+
}), W = n.length - 1, G = M.current.map((e) => e.key), K = n.length > G.length && G.every((e, t) => n[t] && n[t].key === e) ? n[W].key : null, q = [...n.map((e, t) => ({
|
|
467
296
|
sc: e,
|
|
468
297
|
i: t,
|
|
469
298
|
ghost: !1
|
|
470
|
-
})), ...
|
|
299
|
+
})), ...B.map((e, t) => ({
|
|
471
300
|
sc: e,
|
|
472
|
-
i:
|
|
301
|
+
i: n.length + t,
|
|
473
302
|
ghost: !0
|
|
474
|
-
}))],
|
|
303
|
+
}))], J = q.length - 1, Y = /* @__PURE__ */ b("div", {
|
|
475
304
|
ref: D,
|
|
476
305
|
"data-slot": "navigation-stack",
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
306
|
+
...U.bind,
|
|
307
|
+
onFocusCapture: (e) => {
|
|
308
|
+
let t = e.target.closest("[data-slot=screen]")?.getAttribute("data-screen-key");
|
|
309
|
+
t && e.target !== e.currentTarget && e.target.getAttribute("data-slot") !== "screen" && (L.current[t] = e.target);
|
|
310
|
+
},
|
|
311
|
+
className: e("absolute inset-0 touch-pan-y overflow-hidden", h),
|
|
312
|
+
style: g,
|
|
313
|
+
children: q.map((e) => /* @__PURE__ */ b(w, {
|
|
484
314
|
sc: e.sc,
|
|
485
315
|
depth: e.i,
|
|
486
|
-
top: e.ghost ?
|
|
316
|
+
top: e.ghost ? J : W,
|
|
487
317
|
ghost: e.ghost,
|
|
488
|
-
entering: !e.ghost && (
|
|
318
|
+
entering: !e.ghost && (A.enter === e.sc.key || K === e.sc.key) && e.i === W,
|
|
489
319
|
nav: {
|
|
490
|
-
pop: () =>
|
|
491
|
-
canPop:
|
|
320
|
+
pop: () => F.current?.(),
|
|
321
|
+
canPop: V && !e.ghost
|
|
492
322
|
},
|
|
493
|
-
backTitle: e.i > 0 ? e.ghost ?
|
|
494
|
-
reg:
|
|
495
|
-
defIns:
|
|
323
|
+
backTitle: e.i > 0 ? e.ghost ? n[n.length - 1] && n[n.length - 1].title : n[e.i - 1].title : null,
|
|
324
|
+
reg: k,
|
|
325
|
+
defIns: a,
|
|
496
326
|
z: e.i,
|
|
497
327
|
rootBack: E
|
|
498
328
|
}, e.sc.key))
|
|
499
329
|
});
|
|
500
|
-
return s == null ?
|
|
330
|
+
return s == null ? Y : /* @__PURE__ */ b(r.Provider, {
|
|
501
331
|
value: parseFloat(String(s)) || 0,
|
|
502
|
-
children:
|
|
332
|
+
children: Y
|
|
503
333
|
});
|
|
504
334
|
}
|
|
505
335
|
//#endregion
|
|
506
|
-
export {
|
|
336
|
+
export { E as NavigationStack, w as ScreenWrap, C as navigationPush };
|