@floegence/floe-webapp-core 0.60.0 → 0.60.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/ActivityAppsMain.d.ts +2 -0
- package/dist/app/ActivityAppsMain.js +15 -12
- package/dist/components/file-browser/Breadcrumb.js +6 -6
- package/dist/components/file-browser/FileGridView.js +29 -27
- package/dist/components/file-browser/FileListView.js +15 -13
- package/dist/components/layout/KeepAliveStack.d.ts +2 -0
- package/dist/components/layout/KeepAliveStack.js +118 -101
- package/dist/components/ui/DirectoryPicker.d.ts +1 -1
- package/dist/components/ui/DirectoryPicker.js +36 -52
- package/dist/components/ui/picker/PickerBase.d.ts +6 -0
- package/dist/components/ui/picker/PickerBase.js +345 -232
- package/dist/context/ViewActivationContext.d.ts +4 -1
- package/dist/context/ViewActivationContext.js +14 -11
- package/dist/hooks/useResizeObserver.d.ts +5 -1
- package/dist/hooks/useResizeObserver.js +13 -14
- package/dist/hooks/useVirtualWindow.js +13 -13
- package/dist/styles.css +1 -1
- package/package.json +1 -1
|
@@ -1,325 +1,438 @@
|
|
|
1
|
-
import { insert as
|
|
2
|
-
import { createEffect as
|
|
3
|
-
import { cn as
|
|
4
|
-
import { FileItemIcon as
|
|
5
|
-
import {
|
|
6
|
-
import { Button as
|
|
7
|
-
import { Input as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { insert as l, createComponent as s, use as M, setAttribute as g, effect as k, className as Q, spread as U, mergeProps as j, memo as L, template as h, delegateEvents as X } from "solid-js/web";
|
|
2
|
+
import { createEffect as q, on as Y, untrack as Z, createMemo as V, createUniqueId as ee, Show as m, For as F, createSignal as D } from "solid-js";
|
|
3
|
+
import { cn as N } from "../../../utils/cn.js";
|
|
4
|
+
import { FileItemIcon as te } from "../../file-browser/FileIcons.js";
|
|
5
|
+
import { FolderOpen as O, ChevronRight as H } from "../../icons/index.js";
|
|
6
|
+
import { Button as I } from "../Button.js";
|
|
7
|
+
import { Input as W } from "../Input.js";
|
|
8
|
+
import { resolveTabNavigationTargetId as re } from "../Tabs.js";
|
|
9
|
+
import { createFilesystemPickerDataSource as ne, defaultPickerCopy as ie, parsePickerPath as G, PickerNavigationError as ae } from "./PickerNavigation.js";
|
|
10
|
+
import { pickerParentPath as Se } from "./PickerNavigation.js";
|
|
11
|
+
var le = /* @__PURE__ */ h('<div role=tablist class="mb-1 flex min-w-0 items-center gap-4 border-b border-border">'), se = /* @__PURE__ */ h('<div class="flex min-w-0 items-start gap-1.5"><div class="min-w-0 flex-1">'), oe = /* @__PURE__ */ h('<div class="flex items-start gap-2 rounded border border-error/30 bg-error/5 px-2 py-1.5 text-xs"role=alert><span class="min-w-0 flex-1 break-words">'), S = /* @__PURE__ */ h("<div>"), ue = /* @__PURE__ */ h('<div class="flex min-w-0 flex-col gap-2"data-filesystem-picker><div class="flex min-w-0 flex-col gap-2">'), ce = /* @__PURE__ */ h('<div class="flex flex-wrap items-center gap-1">'), de = /* @__PURE__ */ h("<button type=button role=tab>"), ge = /* @__PURE__ */ h('<nav class="flex min-w-0 flex-wrap items-center gap-0.5 text-xs">'), he = /* @__PURE__ */ h("<span role=status>"), fe = /* @__PURE__ */ h('<div class="flex flex-wrap items-center justify-between gap-2 text-xs text-muted-foreground"><label class="flex cursor-pointer items-center gap-1.5"><input type=checkbox class=cursor-pointer>'), ve = /* @__PURE__ */ h('<button type=button class="max-w-full cursor-pointer truncate rounded px-1 py-0.5 hover:bg-muted focus-visible:ring-1 focus-visible:ring-ring">'), be = /* @__PURE__ */ h('<p class="px-3 py-6 text-center text-xs text-muted-foreground"role=status>'), me = /* @__PURE__ */ h('<p class="px-3 py-6 text-center text-xs text-muted-foreground">'), xe = /* @__PURE__ */ h('<button type=button class="flex min-h-8 w-full cursor-pointer items-center gap-2 px-2 py-1.5 text-left text-xs hover:bg-accent/60 focus:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50"><span class="min-w-0 flex-1 truncate">'), we = /* @__PURE__ */ h('<button type=button class="flex min-h-14 w-full cursor-pointer items-center gap-3 rounded-md px-2 py-2.5 text-left hover:bg-accent/60 focus:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50"><span class="flex min-w-0 flex-1 flex-col gap-0.5"><span class="truncate text-xs font-medium"></span><span class="truncate text-[11px] text-muted-foreground">'), ye = /* @__PURE__ */ h('<div class="flex items-center gap-1.5">'), pe = /* @__PURE__ */ h('<p role=alert class="text-xs text-error">');
|
|
12
|
+
function T(e) {
|
|
12
13
|
return {
|
|
13
|
-
...
|
|
14
|
-
...
|
|
14
|
+
...ie,
|
|
15
|
+
...e.copy
|
|
15
16
|
};
|
|
16
17
|
}
|
|
17
|
-
function
|
|
18
|
-
const
|
|
19
|
-
return
|
|
18
|
+
function J(e, u) {
|
|
19
|
+
const i = T(e);
|
|
20
|
+
return u instanceof ae ? i[u.kind] : e.formatError?.(u) || (u instanceof Error ? u.message : "") || i.loadFailed;
|
|
20
21
|
}
|
|
21
|
-
function
|
|
22
|
-
const v =
|
|
23
|
-
return
|
|
24
|
-
v.close(), x && (
|
|
25
|
-
})),
|
|
22
|
+
function Ve(e, u, i, y) {
|
|
23
|
+
const v = ne(() => e, i);
|
|
24
|
+
return q(Y(() => [u(), e.scopeKey], ([x]) => {
|
|
25
|
+
v.close(), x && (y?.(), v.open(e.initialPath));
|
|
26
|
+
})), q(() => e.onValidityChange?.(v.valid())), v;
|
|
26
27
|
}
|
|
27
|
-
function
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
function De(e) {
|
|
29
|
+
const u = () => T(e), i = Z(() => e.source), y = V(() => i.entries().filter((o) => o.type === "folder")), v = V(() => i.context()?.roots.filter((o) => !o.hidden) ?? []), x = ee();
|
|
30
|
+
let C;
|
|
31
|
+
const A = V(() => [{
|
|
32
|
+
id: "suggestions",
|
|
33
|
+
label: e.suggestions?.label ?? "",
|
|
34
|
+
disabled: e.disabled
|
|
35
|
+
}, ...v().map((o) => ({
|
|
36
|
+
id: `root:${o.id}`,
|
|
37
|
+
label: o.label,
|
|
38
|
+
path: o.pathAbs,
|
|
39
|
+
disabled: e.disabled || o.permissions?.read === !1
|
|
40
|
+
}))]), P = () => {
|
|
41
|
+
if (e.suggestions?.visible) return "suggestions";
|
|
42
|
+
const o = G(i.pathInput(), i.context()?.homePathAbs);
|
|
43
|
+
return `root:${v().filter((n) => o === n.pathAbs || o.startsWith(n.pathAbs.replace(/\/$/, "") + "/")).sort((n, t) => t.pathAbs.length - n.pathAbs.length)[0]?.id ?? i.context()?.defaultRootId ?? v()[0]?.id}`;
|
|
44
|
+
}, _ = /* @__PURE__ */ new Map(), z = [], p = (o, f, n, t) => {
|
|
45
|
+
let a;
|
|
46
|
+
o.key === "ArrowDown" && (a = Math.min(f + 1, t - 1)), o.key === "ArrowUp" && (a = Math.max(0, f - 1)), o.key === "Home" && (a = 0), o.key === "End" && (a = t - 1), a !== void 0 && (o.preventDefault(), o.stopPropagation(), n[a]?.focus());
|
|
47
|
+
}, w = V(() => {
|
|
48
|
+
const o = i.currentPath();
|
|
49
|
+
if (!o) return [];
|
|
50
|
+
let f = "";
|
|
32
51
|
return [{
|
|
33
52
|
path: "/",
|
|
34
|
-
name:
|
|
35
|
-
}, ...
|
|
36
|
-
path:
|
|
37
|
-
name:
|
|
53
|
+
name: u().root
|
|
54
|
+
}, ...o.split("/").filter(Boolean).map((n) => (f += `/${n}`, {
|
|
55
|
+
path: f,
|
|
56
|
+
name: n
|
|
38
57
|
}))];
|
|
39
|
-
}),
|
|
40
|
-
|
|
41
|
-
a.key === "ArrowDown" && (l = Math.min(g + 1, d().length - 1)), a.key === "ArrowUp" && (l = Math.max(0, g - 1)), a.key === "Home" && (l = 0), a.key === "End" && (l = d().length - 1), l !== void 0 && (a.preventDefault(), a.stopPropagation(), p[l]?.focus());
|
|
42
|
-
}, P = () => {
|
|
43
|
-
r.navigate(r.pathInput());
|
|
58
|
+
}), E = [], R = () => {
|
|
59
|
+
i.navigate(i.pathInput());
|
|
44
60
|
};
|
|
45
61
|
return (() => {
|
|
46
|
-
var
|
|
47
|
-
return
|
|
48
|
-
get
|
|
49
|
-
return
|
|
50
|
-
},
|
|
51
|
-
children: (e) => n(k, {
|
|
52
|
-
type: "button",
|
|
53
|
-
size: "sm",
|
|
54
|
-
get variant() {
|
|
55
|
-
return r.currentPath() === e.pathAbs ? "secondary" : "ghost";
|
|
56
|
-
},
|
|
57
|
-
get disabled() {
|
|
58
|
-
return t.disabled || e.permissions?.read === !1;
|
|
59
|
-
},
|
|
60
|
-
get title() {
|
|
61
|
-
return e.pathAbs;
|
|
62
|
-
},
|
|
63
|
-
onClick: () => {
|
|
64
|
-
r.navigate(e.pathAbs);
|
|
65
|
-
},
|
|
66
|
-
get children() {
|
|
67
|
-
return e.label;
|
|
68
|
-
}
|
|
69
|
-
})
|
|
70
|
-
})), i(h, n(T, {
|
|
71
|
-
size: "sm",
|
|
72
|
-
get "aria-label"() {
|
|
73
|
-
return s().path;
|
|
74
|
-
},
|
|
75
|
-
placeholder: "/",
|
|
76
|
-
get value() {
|
|
77
|
-
return r.pathInput();
|
|
62
|
+
var o = ue(), f = o.firstChild;
|
|
63
|
+
return l(o, s(m, {
|
|
64
|
+
get when() {
|
|
65
|
+
return e.suggestions?.paths.length;
|
|
78
66
|
},
|
|
79
|
-
get
|
|
80
|
-
return
|
|
67
|
+
get fallback() {
|
|
68
|
+
return (() => {
|
|
69
|
+
var n = ce();
|
|
70
|
+
return l(n, s(F, {
|
|
71
|
+
get each() {
|
|
72
|
+
return v();
|
|
73
|
+
},
|
|
74
|
+
children: (t) => s(I, {
|
|
75
|
+
type: "button",
|
|
76
|
+
size: "sm",
|
|
77
|
+
get variant() {
|
|
78
|
+
return i.currentPath() === t.pathAbs ? "secondary" : "ghost";
|
|
79
|
+
},
|
|
80
|
+
get disabled() {
|
|
81
|
+
return e.disabled || t.permissions?.read === !1;
|
|
82
|
+
},
|
|
83
|
+
get title() {
|
|
84
|
+
return t.pathAbs;
|
|
85
|
+
},
|
|
86
|
+
onClick: () => {
|
|
87
|
+
i.navigate(t.pathAbs);
|
|
88
|
+
},
|
|
89
|
+
get children() {
|
|
90
|
+
return t.label;
|
|
91
|
+
}
|
|
92
|
+
})
|
|
93
|
+
})), k(() => g(n, "aria-label", u().roots)), n;
|
|
94
|
+
})();
|
|
81
95
|
},
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
96
|
+
get children() {
|
|
97
|
+
var n = le();
|
|
98
|
+
return l(n, s(F, {
|
|
99
|
+
get each() {
|
|
100
|
+
return A();
|
|
101
|
+
},
|
|
102
|
+
children: (t) => (() => {
|
|
103
|
+
var a = de();
|
|
104
|
+
return a.$$keydown = (r) => {
|
|
105
|
+
const c = re(A(), t.id, r.key);
|
|
106
|
+
c && (r.preventDefault(), r.stopPropagation(), _.get(c)?.focus());
|
|
107
|
+
}, a.$$click = () => {
|
|
108
|
+
e.suggestions?.onVisibilityChange(t.id === "suggestions"), "path" in t && i.navigate(t.path);
|
|
109
|
+
}, M((r) => _.set(t.id, r), a), g(a, "aria-controls", x), l(a, () => t.label), k((r) => {
|
|
110
|
+
var c = `${x}-${t.id}`, d = P() === t.id, $ = P() === t.id ? 0 : -1, b = t.disabled, B = "path" in t ? t.path : t.label, K = N("min-w-0 cursor-pointer truncate border-b-2 px-0.5 py-2 text-xs font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50", P() === t.id ? "border-primary text-primary" : "border-transparent text-muted-foreground hover:text-foreground");
|
|
111
|
+
return c !== r.e && g(a, "id", r.e = c), d !== r.t && g(a, "aria-selected", r.t = d), $ !== r.a && g(a, "tabindex", r.a = $), b !== r.o && (a.disabled = r.o = b), B !== r.i && g(a, "title", r.i = B), K !== r.n && Q(a, r.n = K), r;
|
|
112
|
+
}, {
|
|
113
|
+
e: void 0,
|
|
114
|
+
t: void 0,
|
|
115
|
+
a: void 0,
|
|
116
|
+
o: void 0,
|
|
117
|
+
i: void 0,
|
|
118
|
+
n: void 0
|
|
119
|
+
}), a;
|
|
120
|
+
})()
|
|
121
|
+
})), k(() => g(n, "aria-label", u().roots)), n;
|
|
85
122
|
}
|
|
86
|
-
})),
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
onClick: P,
|
|
90
|
-
get disabled() {
|
|
91
|
-
return t.disabled || !r.context() || !r.pathInput();
|
|
123
|
+
}), f), g(f, "id", x), l(f, s(m, {
|
|
124
|
+
get when() {
|
|
125
|
+
return !e.suggestions?.visible;
|
|
92
126
|
},
|
|
93
127
|
get children() {
|
|
94
|
-
|
|
128
|
+
var n = se(), t = n.firstChild;
|
|
129
|
+
return l(t, s(W, {
|
|
130
|
+
ref(a) {
|
|
131
|
+
var r = C;
|
|
132
|
+
typeof r == "function" ? r(a) : C = a;
|
|
133
|
+
},
|
|
134
|
+
size: "sm",
|
|
135
|
+
get "aria-label"() {
|
|
136
|
+
return u().path;
|
|
137
|
+
},
|
|
138
|
+
placeholder: "/",
|
|
139
|
+
get value() {
|
|
140
|
+
return i.pathInput();
|
|
141
|
+
},
|
|
142
|
+
get disabled() {
|
|
143
|
+
return e.disabled || !i.context();
|
|
144
|
+
},
|
|
145
|
+
onInput: (a) => i.setPathInput(a.currentTarget.value),
|
|
146
|
+
onKeyDown: (a) => {
|
|
147
|
+
a.key === "Enter" && (a.preventDefault(), a.stopPropagation(), R());
|
|
148
|
+
}
|
|
149
|
+
})), l(n, s(I, {
|
|
150
|
+
size: "sm",
|
|
151
|
+
variant: "outline",
|
|
152
|
+
onClick: R,
|
|
153
|
+
get disabled() {
|
|
154
|
+
return e.disabled || !i.context() || !i.pathInput();
|
|
155
|
+
},
|
|
156
|
+
get children() {
|
|
157
|
+
return u().go;
|
|
158
|
+
}
|
|
159
|
+
}), null), n;
|
|
95
160
|
}
|
|
96
|
-
}), null),
|
|
161
|
+
}), null), l(f, s(m, {
|
|
97
162
|
get when() {
|
|
98
|
-
return
|
|
163
|
+
return i.error();
|
|
99
164
|
},
|
|
100
165
|
get children() {
|
|
101
|
-
var
|
|
102
|
-
return
|
|
166
|
+
var n = oe(), t = n.firstChild;
|
|
167
|
+
return l(t, () => J(e, i.error())), l(n, s(I, {
|
|
103
168
|
size: "sm",
|
|
104
169
|
variant: "ghost",
|
|
105
170
|
onClick: () => {
|
|
106
|
-
|
|
171
|
+
i.retry();
|
|
107
172
|
},
|
|
108
173
|
get disabled() {
|
|
109
|
-
return
|
|
174
|
+
return e.disabled || i.pending();
|
|
110
175
|
},
|
|
111
176
|
get children() {
|
|
112
|
-
return
|
|
177
|
+
return u().retry;
|
|
113
178
|
}
|
|
114
|
-
}), null),
|
|
179
|
+
}), null), n;
|
|
115
180
|
}
|
|
116
|
-
}),
|
|
117
|
-
get each() {
|
|
118
|
-
return x();
|
|
119
|
-
},
|
|
120
|
-
children: (e, m) => [n(b, {
|
|
121
|
-
get when() {
|
|
122
|
-
return m() > 0;
|
|
123
|
-
},
|
|
124
|
-
get children() {
|
|
125
|
-
return n(V, {
|
|
126
|
-
class: "h-3 w-3 shrink-0 text-muted-foreground"
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
}), (() => {
|
|
130
|
-
var o = ne();
|
|
131
|
-
return o.$$click = () => {
|
|
132
|
-
r.navigate(e.path);
|
|
133
|
-
}, i(o, () => e.name), F((u) => {
|
|
134
|
-
var c = e.path, $ = t.disabled, _ = e.path === r.currentPath() ? "location" : void 0;
|
|
135
|
-
return c !== u.e && y(o, "title", u.e = c), $ !== u.t && (o.disabled = u.t = $), _ !== u.a && y(o, "aria-current", u.a = _), u;
|
|
136
|
-
}, {
|
|
137
|
-
e: void 0,
|
|
138
|
-
t: void 0,
|
|
139
|
-
a: void 0
|
|
140
|
-
}), o;
|
|
141
|
-
})()]
|
|
142
|
-
})), j(E, L(() => t.scrollViewportProps, {
|
|
143
|
-
get class() {
|
|
144
|
-
return G("min-h-[120px] overflow-y-auto rounded border border-border", t.scrollViewportProps?.class);
|
|
145
|
-
},
|
|
146
|
-
get style() {
|
|
147
|
-
return {
|
|
148
|
-
"max-height": t.treeMaxHeight ?? "240px"
|
|
149
|
-
};
|
|
150
|
-
}
|
|
151
|
-
}), !1, !0), i(E, n(b, {
|
|
181
|
+
}), null), l(f, s(m, {
|
|
152
182
|
get when() {
|
|
153
|
-
return
|
|
183
|
+
return e.suggestions?.visible;
|
|
154
184
|
},
|
|
155
185
|
get fallback() {
|
|
156
|
-
return (() => {
|
|
157
|
-
var
|
|
158
|
-
return
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
get when() {
|
|
164
|
-
return d().length;
|
|
165
|
-
},
|
|
166
|
-
get fallback() {
|
|
167
|
-
return n(b, {
|
|
186
|
+
return [(() => {
|
|
187
|
+
var n = ge();
|
|
188
|
+
return l(n, s(F, {
|
|
189
|
+
get each() {
|
|
190
|
+
return w();
|
|
191
|
+
},
|
|
192
|
+
children: (t, a) => [s(m, {
|
|
168
193
|
get when() {
|
|
169
|
-
return
|
|
194
|
+
return a() > 0;
|
|
170
195
|
},
|
|
171
196
|
get children() {
|
|
172
|
-
|
|
173
|
-
|
|
197
|
+
return s(H, {
|
|
198
|
+
class: "h-3 w-3 shrink-0 text-muted-foreground"
|
|
199
|
+
});
|
|
174
200
|
}
|
|
175
|
-
})
|
|
201
|
+
}), (() => {
|
|
202
|
+
var r = ve();
|
|
203
|
+
return r.$$click = () => {
|
|
204
|
+
i.navigate(t.path);
|
|
205
|
+
}, l(r, () => t.name), k((c) => {
|
|
206
|
+
var d = t.path, $ = e.disabled, b = t.path === i.currentPath() ? "location" : void 0;
|
|
207
|
+
return d !== c.e && g(r, "title", c.e = d), $ !== c.t && (r.disabled = c.t = $), b !== c.a && g(r, "aria-current", c.a = b), c;
|
|
208
|
+
}, {
|
|
209
|
+
e: void 0,
|
|
210
|
+
t: void 0,
|
|
211
|
+
a: void 0
|
|
212
|
+
}), r;
|
|
213
|
+
})()]
|
|
214
|
+
})), k(() => g(n, "aria-label", u().currentDirectory)), n;
|
|
215
|
+
})(), (() => {
|
|
216
|
+
var n = S();
|
|
217
|
+
return U(n, j(() => e.scrollViewportProps, {
|
|
218
|
+
get class() {
|
|
219
|
+
return N("min-h-[120px] overflow-y-auto rounded border border-border", e.scrollViewportProps?.class);
|
|
220
|
+
},
|
|
221
|
+
get style() {
|
|
222
|
+
return {
|
|
223
|
+
"max-height": e.treeMaxHeight ?? "240px"
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
}), !1, !0), l(n, s(m, {
|
|
227
|
+
get when() {
|
|
228
|
+
return !i.pending() || i.currentPath();
|
|
229
|
+
},
|
|
230
|
+
get fallback() {
|
|
231
|
+
return (() => {
|
|
232
|
+
var t = be();
|
|
233
|
+
return l(t, () => u().loading), t;
|
|
234
|
+
})();
|
|
235
|
+
},
|
|
236
|
+
get children() {
|
|
237
|
+
return s(m, {
|
|
238
|
+
get when() {
|
|
239
|
+
return y().length;
|
|
240
|
+
},
|
|
241
|
+
get fallback() {
|
|
242
|
+
return s(m, {
|
|
243
|
+
get when() {
|
|
244
|
+
return i.currentPath();
|
|
245
|
+
},
|
|
246
|
+
get children() {
|
|
247
|
+
var t = me();
|
|
248
|
+
return l(t, () => u().empty), t;
|
|
249
|
+
}
|
|
250
|
+
});
|
|
251
|
+
},
|
|
252
|
+
get children() {
|
|
253
|
+
return s(F, {
|
|
254
|
+
get each() {
|
|
255
|
+
return y();
|
|
256
|
+
},
|
|
257
|
+
children: (t, a) => (() => {
|
|
258
|
+
var r = xe(), c = r.firstChild;
|
|
259
|
+
return r.$$keydown = (d) => p(d, a(), E, y().length), r.$$click = () => {
|
|
260
|
+
i.navigate(t.path);
|
|
261
|
+
}, M((d) => {
|
|
262
|
+
E[a()] = d;
|
|
263
|
+
}, r), l(r, s(te, {
|
|
264
|
+
item: t,
|
|
265
|
+
size: 16,
|
|
266
|
+
class: "h-4 w-4 shrink-0"
|
|
267
|
+
}), c), l(c, () => t.name), l(r, s(H, {
|
|
268
|
+
class: "h-3 w-3 shrink-0 text-muted-foreground"
|
|
269
|
+
}), null), k((d) => {
|
|
270
|
+
var $ = t.path, b = e.disabled || e.filter?.(t) === !1;
|
|
271
|
+
return $ !== d.e && g(r, "data-picker-row-path", d.e = $), b !== d.t && (r.disabled = d.t = b), d;
|
|
272
|
+
}, {
|
|
273
|
+
e: void 0,
|
|
274
|
+
t: void 0
|
|
275
|
+
}), r;
|
|
276
|
+
})()
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
})), n;
|
|
282
|
+
})(), (() => {
|
|
283
|
+
var n = fe(), t = n.firstChild, a = t.firstChild;
|
|
284
|
+
return a.addEventListener("change", (r) => {
|
|
285
|
+
i.setShowHidden(r.currentTarget.checked);
|
|
286
|
+
}), l(t, () => u().showHidden, null), l(n, s(m, {
|
|
287
|
+
get when() {
|
|
288
|
+
return L(() => !!i.pending())() && i.currentPath();
|
|
289
|
+
},
|
|
290
|
+
get children() {
|
|
291
|
+
var r = he();
|
|
292
|
+
return l(r, () => u().loading), r;
|
|
293
|
+
}
|
|
294
|
+
}), null), k(() => a.disabled = e.disabled || !i.context()), k(() => a.checked = i.showHidden()), n;
|
|
295
|
+
})(), s(m, {
|
|
296
|
+
get when() {
|
|
297
|
+
return e.onCreateFolder;
|
|
176
298
|
},
|
|
177
299
|
get children() {
|
|
178
|
-
return
|
|
179
|
-
get each() {
|
|
180
|
-
return d();
|
|
181
|
-
},
|
|
182
|
-
children: (e, m) => (() => {
|
|
183
|
-
var o = le(), u = o.firstChild;
|
|
184
|
-
return o.$$keydown = (c) => C(c, m()), o.$$click = () => {
|
|
185
|
-
r.navigate(e.path);
|
|
186
|
-
}, O((c) => {
|
|
187
|
-
p[m()] = c;
|
|
188
|
-
}, o), i(o, n(J, {
|
|
189
|
-
item: e,
|
|
190
|
-
size: 16,
|
|
191
|
-
class: "h-4 w-4 shrink-0"
|
|
192
|
-
}), u), i(u, () => e.name), i(o, n(V, {
|
|
193
|
-
class: "h-3 w-3 shrink-0 text-muted-foreground"
|
|
194
|
-
}), null), F((c) => {
|
|
195
|
-
var $ = e.path, _ = t.disabled || t.filter?.(e) === !1;
|
|
196
|
-
return $ !== c.e && y(o, "data-picker-row-path", c.e = $), _ !== c.t && (o.disabled = c.t = _), c;
|
|
197
|
-
}, {
|
|
198
|
-
e: void 0,
|
|
199
|
-
t: void 0
|
|
200
|
-
}), o;
|
|
201
|
-
})()
|
|
202
|
-
});
|
|
300
|
+
return s($e, e);
|
|
203
301
|
}
|
|
204
|
-
});
|
|
205
|
-
}
|
|
206
|
-
})), I.addEventListener("change", (e) => {
|
|
207
|
-
r.setShowHidden(e.currentTarget.checked);
|
|
208
|
-
}), i(M, () => s().showHidden, null), i(H, n(b, {
|
|
209
|
-
get when() {
|
|
210
|
-
return B(() => !!r.pending())() && r.currentPath();
|
|
302
|
+
})];
|
|
211
303
|
},
|
|
212
304
|
get children() {
|
|
213
|
-
var
|
|
214
|
-
return
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
305
|
+
var n = S();
|
|
306
|
+
return U(n, j(() => e.scrollViewportProps, {
|
|
307
|
+
"data-picker-suggestions": "",
|
|
308
|
+
get "aria-label"() {
|
|
309
|
+
return e.suggestions?.label;
|
|
310
|
+
},
|
|
311
|
+
get class() {
|
|
312
|
+
return N("min-h-[180px] min-w-0 overflow-y-auto", e.scrollViewportProps?.class);
|
|
313
|
+
},
|
|
314
|
+
get style() {
|
|
315
|
+
return {
|
|
316
|
+
"max-height": e.treeMaxHeight ?? "240px"
|
|
317
|
+
};
|
|
318
|
+
}
|
|
319
|
+
}), !1, !0), l(n, s(F, {
|
|
320
|
+
get each() {
|
|
321
|
+
return e.suggestions?.paths;
|
|
322
|
+
},
|
|
323
|
+
children: (t, a) => (() => {
|
|
324
|
+
var r = we(), c = r.firstChild, d = c.firstChild, $ = d.nextSibling;
|
|
325
|
+
return r.$$keydown = (b) => p(b, a(), z, e.suggestions?.paths.length ?? 0), r.$$click = () => {
|
|
326
|
+
e.suggestions?.onVisibilityChange(!1), i.navigate(t), C?.focus();
|
|
327
|
+
}, M((b) => {
|
|
328
|
+
z[a()] = b;
|
|
329
|
+
}, r), g(r, "data-picker-suggested-path", t), g(r, "title", t), g(r, "aria-label", t), l(r, s(O, {
|
|
330
|
+
class: "h-4 w-4 shrink-0 text-muted-foreground"
|
|
331
|
+
}), c), l(d, () => t.split("/").filter(Boolean).at(-1) ?? u().root), l($, t), l(r, s(H, {
|
|
332
|
+
class: "h-3 w-3 shrink-0 text-muted-foreground/60"
|
|
333
|
+
}), null), k(() => r.disabled = e.disabled || !i.context()), r;
|
|
334
|
+
})()
|
|
335
|
+
})), n;
|
|
222
336
|
}
|
|
223
|
-
}), null),
|
|
224
|
-
var
|
|
225
|
-
return
|
|
337
|
+
}), null), k((n) => {
|
|
338
|
+
var t = i.pending(), a = e.suggestions?.paths.length ? "tabpanel" : void 0, r = e.suggestions?.paths.length ? `${x}-${P()}` : void 0;
|
|
339
|
+
return t !== n.e && g(o, "aria-busy", n.e = t), a !== n.t && g(f, "role", n.t = a), r !== n.a && g(f, "aria-labelledby", n.a = r), n;
|
|
226
340
|
}, {
|
|
227
341
|
e: void 0,
|
|
228
342
|
t: void 0,
|
|
229
|
-
a: void 0
|
|
230
|
-
|
|
231
|
-
}), F(() => I.checked = r.showHidden()), a;
|
|
343
|
+
a: void 0
|
|
344
|
+
}), o;
|
|
232
345
|
})();
|
|
233
346
|
}
|
|
234
|
-
function
|
|
235
|
-
const [
|
|
236
|
-
if (!
|
|
237
|
-
const
|
|
238
|
-
|
|
347
|
+
function $e(e) {
|
|
348
|
+
const [u, i] = D(!1), [y, v] = D(""), [x, C] = D(!1), [A, P] = D(null), _ = () => T(e), z = async () => {
|
|
349
|
+
if (!y().trim() || !e.source.valid() || !e.onCreateFolder || x()) return;
|
|
350
|
+
const p = e.source.currentPath();
|
|
351
|
+
C(!0), P(null);
|
|
239
352
|
try {
|
|
240
|
-
await
|
|
241
|
-
} catch (
|
|
242
|
-
P(
|
|
353
|
+
await e.onCreateFolder(p, y().trim()), v(""), i(!1), e.source.active() && p === e.source.currentPath() && await e.source.navigate(p);
|
|
354
|
+
} catch (w) {
|
|
355
|
+
P(w);
|
|
243
356
|
} finally {
|
|
244
|
-
|
|
357
|
+
C(!1);
|
|
245
358
|
}
|
|
246
359
|
};
|
|
247
360
|
return (() => {
|
|
248
|
-
var
|
|
249
|
-
return
|
|
361
|
+
var p = S();
|
|
362
|
+
return l(p, s(m, {
|
|
250
363
|
get when() {
|
|
251
|
-
return
|
|
364
|
+
return u();
|
|
252
365
|
},
|
|
253
366
|
get fallback() {
|
|
254
|
-
return
|
|
367
|
+
return s(I, {
|
|
255
368
|
size: "sm",
|
|
256
369
|
variant: "ghost",
|
|
257
370
|
get disabled() {
|
|
258
|
-
return
|
|
371
|
+
return e.disabled || !e.source.valid();
|
|
259
372
|
},
|
|
260
|
-
onClick: () =>
|
|
373
|
+
onClick: () => i(!0),
|
|
261
374
|
get children() {
|
|
262
|
-
return [
|
|
375
|
+
return [s(O, {
|
|
263
376
|
class: "mr-1 h-3.5 w-3.5"
|
|
264
|
-
}),
|
|
377
|
+
}), L(() => _().newFolder)];
|
|
265
378
|
}
|
|
266
379
|
});
|
|
267
380
|
},
|
|
268
381
|
get children() {
|
|
269
|
-
var
|
|
270
|
-
return
|
|
382
|
+
var w = ye();
|
|
383
|
+
return l(w, s(W, {
|
|
271
384
|
size: "sm",
|
|
272
385
|
get "aria-label"() {
|
|
273
|
-
return
|
|
386
|
+
return _().folderName;
|
|
274
387
|
},
|
|
275
388
|
get value() {
|
|
276
|
-
return
|
|
389
|
+
return y();
|
|
277
390
|
},
|
|
278
|
-
onInput: (
|
|
391
|
+
onInput: (E) => v(E.currentTarget.value),
|
|
279
392
|
get disabled() {
|
|
280
|
-
return
|
|
393
|
+
return e.disabled || x();
|
|
281
394
|
}
|
|
282
|
-
}), null),
|
|
395
|
+
}), null), l(w, s(I, {
|
|
283
396
|
size: "sm",
|
|
284
397
|
get disabled() {
|
|
285
|
-
return
|
|
398
|
+
return e.disabled || x() || !y().trim() || !e.source.valid();
|
|
286
399
|
},
|
|
287
400
|
onClick: () => {
|
|
288
|
-
|
|
401
|
+
z();
|
|
289
402
|
},
|
|
290
403
|
get children() {
|
|
291
|
-
return
|
|
404
|
+
return _().create;
|
|
292
405
|
}
|
|
293
|
-
}), null),
|
|
406
|
+
}), null), l(w, s(I, {
|
|
294
407
|
size: "sm",
|
|
295
408
|
variant: "ghost-destructive",
|
|
296
409
|
get disabled() {
|
|
297
|
-
return
|
|
410
|
+
return e.disabled || x();
|
|
298
411
|
},
|
|
299
|
-
onClick: () =>
|
|
412
|
+
onClick: () => i(!1),
|
|
300
413
|
get children() {
|
|
301
|
-
return
|
|
414
|
+
return _().cancel;
|
|
302
415
|
}
|
|
303
|
-
}), null),
|
|
416
|
+
}), null), w;
|
|
304
417
|
}
|
|
305
|
-
}), null),
|
|
418
|
+
}), null), l(p, s(m, {
|
|
306
419
|
get when() {
|
|
307
|
-
return
|
|
420
|
+
return A();
|
|
308
421
|
},
|
|
309
422
|
get children() {
|
|
310
|
-
var
|
|
311
|
-
return
|
|
423
|
+
var w = pe();
|
|
424
|
+
return l(w, () => J(e, A())), w;
|
|
312
425
|
}
|
|
313
|
-
}), null),
|
|
426
|
+
}), null), p;
|
|
314
427
|
})();
|
|
315
428
|
}
|
|
316
|
-
const
|
|
317
|
-
|
|
429
|
+
const Me = G;
|
|
430
|
+
X(["click", "keydown"]);
|
|
318
431
|
export {
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
432
|
+
De as PickerPanel,
|
|
433
|
+
Se as getParentPath,
|
|
434
|
+
Me as normalizePath,
|
|
435
|
+
T as pickerCopy,
|
|
436
|
+
J as pickerErrorMessage,
|
|
437
|
+
Ve as usePickerNavigation
|
|
325
438
|
};
|