@floegence/floe-webapp-core 0.48.6 → 0.49.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/dist/components/ui/DirectoryInput.d.ts +6 -27
- package/dist/components/ui/DirectoryInput.js +41 -115
- package/dist/components/ui/DirectoryPicker.d.ts +1 -5
- package/dist/components/ui/DirectoryPicker.js +27 -116
- package/dist/components/ui/FileOpenPicker.js +95 -167
- package/dist/components/ui/FileSavePicker.js +73 -160
- package/dist/components/ui/index.d.ts +2 -1
- package/dist/components/ui/picker/PickerBase.d.ts +58 -176
- package/dist/components/ui/picker/PickerBase.js +273 -490
- package/dist/components/ui/picker/PickerNavigation.d.ts +91 -0
- package/dist/components/ui/picker/PickerNavigation.js +160 -0
- package/dist/full.js +346 -341
- package/dist/styles.css +1 -1
- package/dist/ui.js +120 -115
- package/package.json +1 -1
|
@@ -1,541 +1,324 @@
|
|
|
1
|
-
import { insert as
|
|
2
|
-
import {
|
|
3
|
-
import { cn as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
function X(e) {
|
|
17
|
-
const a = e.split("/").filter(Boolean), n = [];
|
|
18
|
-
let l = "";
|
|
19
|
-
for (let i = 0; i < a.length - 1; i++)
|
|
20
|
-
l += "/" + a[i], n.push(l);
|
|
21
|
-
return n;
|
|
22
|
-
}
|
|
23
|
-
function Ae(e) {
|
|
24
|
-
const a = P(e);
|
|
25
|
-
if (a === "/") return "/";
|
|
26
|
-
const n = a.split("/").filter(Boolean);
|
|
27
|
-
return n.pop(), n.length ? "/" + n.join("/") : "/";
|
|
1
|
+
import { insert as i, createComponent as n, effect as F, setAttribute as y, spread as j, mergeProps as L, use as O, memo as B, template as f, delegateEvents as R } from "solid-js/web";
|
|
2
|
+
import { createEffect as N, on as U, untrack as q, createMemo as S, For as D, Show as b, createSignal as z } from "solid-js";
|
|
3
|
+
import { cn as G } from "../../../utils/cn.js";
|
|
4
|
+
import { FileItemIcon as J } from "../../file-browser/FileIcons.js";
|
|
5
|
+
import { ChevronRight as V, FolderOpen as Q } from "../../icons/index.js";
|
|
6
|
+
import { Button as k } from "../Button.js";
|
|
7
|
+
import { Input as T } from "../Input.js";
|
|
8
|
+
import { createFilesystemPickerDataSource as W, defaultPickerCopy as X, parsePickerPath as Y, PickerNavigationError as Z } from "./PickerNavigation.js";
|
|
9
|
+
import { pickerParentPath as $e } from "./PickerNavigation.js";
|
|
10
|
+
var ee = /* @__PURE__ */ f('<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">'), te = /* @__PURE__ */ f("<span role=status>"), re = /* @__PURE__ */ f('<div class="flex min-w-0 flex-col gap-2"data-filesystem-picker><div class="flex flex-wrap items-center gap-1"></div><div class="flex min-w-0 items-start gap-1.5"><div class="min-w-0 flex-1"></div></div><nav class="flex min-w-0 flex-wrap items-center gap-0.5 text-xs"></nav><div></div><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>'), ne = /* @__PURE__ */ f('<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">'), ae = /* @__PURE__ */ f('<p class="px-3 py-6 text-center text-xs text-muted-foreground"role=status>'), ie = /* @__PURE__ */ f('<p class="px-3 py-6 text-center text-xs text-muted-foreground">'), le = /* @__PURE__ */ f('<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">'), se = /* @__PURE__ */ f('<div class="flex items-center gap-1.5">'), oe = /* @__PURE__ */ f('<p role=alert class="text-xs text-error">'), ce = /* @__PURE__ */ f("<div>");
|
|
11
|
+
function A(t) {
|
|
12
|
+
return {
|
|
13
|
+
...X,
|
|
14
|
+
...t.copy
|
|
15
|
+
};
|
|
28
16
|
}
|
|
29
|
-
function
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
for (const i of l)
|
|
33
|
-
i.type === "folder" && (a.set(P(i.path), i), i.children?.length && n(i.children));
|
|
34
|
-
};
|
|
35
|
-
return n(e()), a;
|
|
36
|
-
});
|
|
17
|
+
function K(t, s) {
|
|
18
|
+
const r = A(t);
|
|
19
|
+
return s instanceof Z ? r[s.kind] : t.formatError?.(s) || (s instanceof Error ? s.message : "") || r.loadFailed;
|
|
37
20
|
}
|
|
38
|
-
function
|
|
39
|
-
const
|
|
40
|
-
return
|
|
21
|
+
function we(t, s, r, d) {
|
|
22
|
+
const v = W(() => t, r);
|
|
23
|
+
return N(U(() => [s(), t.scopeKey], ([x]) => {
|
|
24
|
+
v.close(), x && (d?.(), v.open(t.initialPath));
|
|
25
|
+
})), N(() => t.onValidityChange?.(v.valid())), v;
|
|
41
26
|
}
|
|
42
|
-
function
|
|
43
|
-
const
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
},
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}, [u, m] = C(l()), [b, s] = C(/* @__PURE__ */ new Set(["/"])), [w, r] = C(i(l())), [x, S] = C(!1), [d, g] = C(""), [I, _] = C(0);
|
|
60
|
-
let E = 0;
|
|
61
|
-
const T = Ne(e.files), ne = B(() => e.files().filter((t) => t.type === "folder"));
|
|
62
|
-
p(V(u, (t) => {
|
|
63
|
-
r(i(t)), g("");
|
|
64
|
-
}));
|
|
65
|
-
const K = (t) => {
|
|
66
|
-
const o = P(t);
|
|
67
|
-
return o === "/" || T().has(o);
|
|
68
|
-
}, M = (t) => e.filter ? e.filter(t) : !0, j = (t) => {
|
|
69
|
-
const o = X(t);
|
|
70
|
-
s((c) => {
|
|
71
|
-
const v = new Set(c);
|
|
72
|
-
for (const y of o) v.add(y);
|
|
73
|
-
return v.add(t), v;
|
|
74
|
-
});
|
|
75
|
-
}, G = () => {
|
|
76
|
-
_((t) => t + 1);
|
|
77
|
-
}, H = (t) => {
|
|
78
|
-
if (e.onExpand)
|
|
79
|
-
try {
|
|
80
|
-
const o = e.onExpand(t);
|
|
81
|
-
Promise.resolve(o).catch(() => {
|
|
82
|
-
});
|
|
83
|
-
} catch {
|
|
84
|
-
}
|
|
85
|
-
}, re = async (t, o) => {
|
|
86
|
-
const c = P(t);
|
|
87
|
-
if (c === "/")
|
|
88
|
-
return {
|
|
89
|
-
status: "ready",
|
|
90
|
-
resolvedPath: "/"
|
|
91
|
-
};
|
|
92
|
-
if (!e.ensurePath)
|
|
93
|
-
return K(c) ? {
|
|
94
|
-
status: "ready",
|
|
95
|
-
resolvedPath: c
|
|
96
|
-
} : {
|
|
97
|
-
status: "missing",
|
|
98
|
-
resolvedPath: c,
|
|
99
|
-
message: "Path not found"
|
|
100
|
-
};
|
|
101
|
-
try {
|
|
102
|
-
const v = await e.ensurePath(c, o);
|
|
103
|
-
return {
|
|
104
|
-
status: v.status,
|
|
105
|
-
resolvedPath: P(v.resolvedPath || c),
|
|
106
|
-
message: v.message?.trim() || void 0
|
|
107
|
-
};
|
|
108
|
-
} catch {
|
|
109
|
-
return {
|
|
110
|
-
status: "error",
|
|
111
|
-
resolvedPath: c,
|
|
112
|
-
message: "Could not load path"
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
|
-
}, F = async (t, o) => {
|
|
116
|
-
const c = P(t);
|
|
117
|
-
E += 1;
|
|
118
|
-
const v = E;
|
|
119
|
-
S(!0), o.reason !== "open" && g("");
|
|
120
|
-
try {
|
|
121
|
-
const y = await re(c, o);
|
|
122
|
-
if (v !== E) return y;
|
|
123
|
-
if (y.status === "ready") {
|
|
124
|
-
const D = P(y.resolvedPath);
|
|
125
|
-
m(D), j(D), g(""), G();
|
|
126
|
-
} else o.reason !== "open" && g(y.message || (y.status === "missing" ? "Path not found" : "Could not load path"));
|
|
127
|
-
return y;
|
|
128
|
-
} finally {
|
|
129
|
-
v === E && S(!1);
|
|
130
|
-
}
|
|
131
|
-
}, oe = (t) => {
|
|
132
|
-
const o = b().has(t);
|
|
133
|
-
s((c) => {
|
|
134
|
-
const v = new Set(c);
|
|
135
|
-
return v.has(t) ? v.delete(t) : v.add(t), v;
|
|
136
|
-
}), o || H(t);
|
|
137
|
-
}, ae = (t) => {
|
|
138
|
-
if (!M(t)) return;
|
|
139
|
-
const o = b().has(t.path);
|
|
140
|
-
F(t.path, {
|
|
141
|
-
reason: "tree-select"
|
|
142
|
-
}).then((c) => {
|
|
143
|
-
c.status !== "ready" || o || H(P(c.resolvedPath));
|
|
144
|
-
});
|
|
145
|
-
}, le = () => {
|
|
146
|
-
F("/", {
|
|
147
|
-
reason: "tree-select"
|
|
148
|
-
});
|
|
149
|
-
}, W = () => {
|
|
150
|
-
const t = k(w().trim());
|
|
151
|
-
F(t, {
|
|
152
|
-
reason: "path-input"
|
|
153
|
-
});
|
|
154
|
-
}, ie = (t) => {
|
|
155
|
-
t.key === "Enter" && (t.preventDefault(), W());
|
|
156
|
-
}, se = B(() => {
|
|
157
|
-
const t = u(), o = a();
|
|
158
|
-
if (t === "/" || t === "") return [{
|
|
159
|
-
name: o,
|
|
160
|
-
path: "/"
|
|
161
|
-
}];
|
|
162
|
-
const c = t.split("/").filter(Boolean), v = [{
|
|
163
|
-
name: o,
|
|
164
|
-
path: "/"
|
|
165
|
-
}];
|
|
166
|
-
let y = "";
|
|
167
|
-
for (const D of c)
|
|
168
|
-
y += "/" + D, v.push({
|
|
169
|
-
name: D,
|
|
170
|
-
path: y
|
|
171
|
-
});
|
|
172
|
-
return v;
|
|
173
|
-
}), ce = (t) => {
|
|
174
|
-
F(t, {
|
|
175
|
-
reason: "breadcrumb"
|
|
176
|
-
});
|
|
177
|
-
};
|
|
178
|
-
return p(V(e.open, (t) => {
|
|
179
|
-
if (t) {
|
|
180
|
-
const o = l();
|
|
181
|
-
m(o), r(i(o)), g("");
|
|
182
|
-
const c = X(o);
|
|
183
|
-
s(/* @__PURE__ */ new Set(["/", ...c])), G(), e.onReset?.(o), F(o, {
|
|
184
|
-
reason: "open"
|
|
185
|
-
});
|
|
186
|
-
}
|
|
187
|
-
})), {
|
|
188
|
-
selectedPath: u,
|
|
189
|
-
setSelectedPath: m,
|
|
190
|
-
expandedPaths: b,
|
|
191
|
-
toggleExpand: oe,
|
|
192
|
-
pathInput: w,
|
|
193
|
-
setPathInput: r,
|
|
194
|
-
pathPending: x,
|
|
195
|
-
pathInputError: d,
|
|
196
|
-
setPathInputError: g,
|
|
197
|
-
folderIndex: T,
|
|
198
|
-
rootFolders: ne,
|
|
199
|
-
isValidPath: K,
|
|
200
|
-
isSelectable: M,
|
|
201
|
-
handleSelectFolder: ae,
|
|
202
|
-
handleSelectRoot: le,
|
|
203
|
-
handlePathInputGo: W,
|
|
204
|
-
handlePathInputKeyDown: ie,
|
|
205
|
-
expandToPath: j,
|
|
206
|
-
navigateToPath: F,
|
|
207
|
-
breadcrumbSegments: se,
|
|
208
|
-
handleBreadcrumbClick: ce,
|
|
209
|
-
homeLabel: a,
|
|
210
|
-
toDisplayPath: i,
|
|
211
|
-
revealNonce: I
|
|
212
|
-
};
|
|
213
|
-
}
|
|
214
|
-
function Me(e) {
|
|
215
|
-
const [a, n] = C(!1), [l, i] = C(""), [k, u] = C(!1), m = () => {
|
|
216
|
-
n(!0), i("");
|
|
217
|
-
}, b = () => {
|
|
218
|
-
n(!1), i("");
|
|
219
|
-
}, s = () => {
|
|
220
|
-
const r = l().trim();
|
|
221
|
-
if (!r || k()) return;
|
|
222
|
-
u(!0);
|
|
223
|
-
const x = e.parentPath(), S = r, d = e.onCreateFolder;
|
|
224
|
-
me(() => {
|
|
225
|
-
d(x, S).then(() => {
|
|
226
|
-
n(!1), i("");
|
|
227
|
-
}).catch((g) => {
|
|
228
|
-
console.error("Failed to create folder:", g);
|
|
229
|
-
}).finally(() => {
|
|
230
|
-
u(!1);
|
|
231
|
-
});
|
|
232
|
-
});
|
|
233
|
-
}, w = (r) => {
|
|
234
|
-
r.key === "Enter" ? (r.preventDefault(), s()) : r.key === "Escape" && (r.preventDefault(), b());
|
|
27
|
+
function ye(t) {
|
|
28
|
+
const s = () => A(t), r = q(() => t.source), d = S(() => r.entries().filter((a) => a.type === "folder")), v = S(() => r.context()?.roots.filter((a) => !a.hidden) ?? []), x = S(() => {
|
|
29
|
+
const a = r.currentPath();
|
|
30
|
+
if (!a) return [];
|
|
31
|
+
let g = "";
|
|
32
|
+
return [{
|
|
33
|
+
path: "/",
|
|
34
|
+
name: s().root
|
|
35
|
+
}, ...a.split("/").filter(Boolean).map((l) => (g += `/${l}`, {
|
|
36
|
+
path: g,
|
|
37
|
+
name: l
|
|
38
|
+
}))];
|
|
39
|
+
}), p = [], C = (a, g) => {
|
|
40
|
+
let l;
|
|
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());
|
|
235
44
|
};
|
|
236
|
-
return h(L, {
|
|
237
|
-
get when() {
|
|
238
|
-
return a();
|
|
239
|
-
},
|
|
240
|
-
get fallback() {
|
|
241
|
-
return (() => {
|
|
242
|
-
var r = ke(), x = r.firstChild;
|
|
243
|
-
return r.$$click = m, f(r, h(xe, {
|
|
244
|
-
class: "w-3.5 h-3.5"
|
|
245
|
-
}), x), z(() => N(r, R("flex items-center gap-1 text-xs text-muted-foreground cursor-pointer", "hover:text-foreground transition-colors duration-100", "focus:outline-none focus-visible:ring-1 focus-visible:ring-ring rounded px-1 py-0.5"))), r;
|
|
246
|
-
})();
|
|
247
|
-
},
|
|
248
|
-
get children() {
|
|
249
|
-
return [(() => {
|
|
250
|
-
var r = Z(), x = r.firstChild;
|
|
251
|
-
return f(x, h(U, {
|
|
252
|
-
size: "sm",
|
|
253
|
-
get value() {
|
|
254
|
-
return l();
|
|
255
|
-
},
|
|
256
|
-
onInput: (S) => i(S.currentTarget.value),
|
|
257
|
-
onKeyDown: w,
|
|
258
|
-
placeholder: "Folder name",
|
|
259
|
-
get disabled() {
|
|
260
|
-
return k();
|
|
261
|
-
},
|
|
262
|
-
autofocus: !0
|
|
263
|
-
})), f(r, h(q, {
|
|
264
|
-
variant: "primary",
|
|
265
|
-
size: "sm",
|
|
266
|
-
onClick: s,
|
|
267
|
-
get loading() {
|
|
268
|
-
return k();
|
|
269
|
-
},
|
|
270
|
-
get disabled() {
|
|
271
|
-
return !l().trim();
|
|
272
|
-
},
|
|
273
|
-
get children() {
|
|
274
|
-
return h(ve, {
|
|
275
|
-
class: "w-3.5 h-3.5"
|
|
276
|
-
});
|
|
277
|
-
}
|
|
278
|
-
}), null), f(r, h(q, {
|
|
279
|
-
variant: "ghost-destructive",
|
|
280
|
-
size: "sm",
|
|
281
|
-
onClick: b,
|
|
282
|
-
get disabled() {
|
|
283
|
-
return k();
|
|
284
|
-
},
|
|
285
|
-
get children() {
|
|
286
|
-
return h(Pe, {
|
|
287
|
-
class: "w-3.5 h-3.5"
|
|
288
|
-
});
|
|
289
|
-
}
|
|
290
|
-
}), null), r;
|
|
291
|
-
})(), (() => {
|
|
292
|
-
var r = ye();
|
|
293
|
-
return r.firstChild, f(r, (() => {
|
|
294
|
-
var x = Q(() => !!e.toDisplayPath);
|
|
295
|
-
return () => x() ? e.toDisplayPath(e.parentPath()) : e.parentPath();
|
|
296
|
-
})(), null), r;
|
|
297
|
-
})()];
|
|
298
|
-
}
|
|
299
|
-
});
|
|
300
|
-
}
|
|
301
|
-
function je(e) {
|
|
302
45
|
return (() => {
|
|
303
|
-
var a =
|
|
304
|
-
return
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
return e.value();
|
|
46
|
+
var a = re(), g = a.firstChild, l = g.nextSibling, h = l.firstChild, w = l.nextSibling, E = w.nextSibling, H = E.nextSibling, M = H.firstChild, I = M.firstChild;
|
|
47
|
+
return i(g, n(D, {
|
|
48
|
+
get each() {
|
|
49
|
+
return v();
|
|
308
50
|
},
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
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;
|
|
312
74
|
},
|
|
313
|
-
|
|
314
|
-
|
|
75
|
+
placeholder: "/",
|
|
76
|
+
get value() {
|
|
77
|
+
return r.pathInput();
|
|
315
78
|
},
|
|
316
79
|
get disabled() {
|
|
317
|
-
return
|
|
80
|
+
return t.disabled || !r.context();
|
|
318
81
|
},
|
|
319
|
-
|
|
320
|
-
|
|
82
|
+
onInput: (e) => r.setPathInput(e.currentTarget.value),
|
|
83
|
+
onKeyDown: (e) => {
|
|
84
|
+
e.key === "Enter" && (e.preventDefault(), e.stopPropagation(), P());
|
|
321
85
|
}
|
|
322
|
-
})),
|
|
323
|
-
variant: "outline",
|
|
86
|
+
})), i(l, n(k, {
|
|
324
87
|
size: "sm",
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
},
|
|
88
|
+
variant: "outline",
|
|
89
|
+
onClick: P,
|
|
328
90
|
get disabled() {
|
|
329
|
-
return
|
|
91
|
+
return t.disabled || !r.context() || !r.pathInput();
|
|
330
92
|
},
|
|
331
93
|
get children() {
|
|
332
|
-
return
|
|
94
|
+
return s().go;
|
|
333
95
|
}
|
|
334
|
-
}), null), a
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
96
|
+
}), null), i(a, n(b, {
|
|
97
|
+
get when() {
|
|
98
|
+
return r.error();
|
|
99
|
+
},
|
|
100
|
+
get children() {
|
|
101
|
+
var e = ee(), m = e.firstChild;
|
|
102
|
+
return i(m, () => K(t, r.error())), i(e, n(k, {
|
|
103
|
+
size: "sm",
|
|
104
|
+
variant: "ghost",
|
|
105
|
+
onClick: () => {
|
|
106
|
+
r.retry();
|
|
107
|
+
},
|
|
108
|
+
get disabled() {
|
|
109
|
+
return t.disabled || r.pending();
|
|
110
|
+
},
|
|
111
|
+
get children() {
|
|
112
|
+
return s().retry;
|
|
113
|
+
}
|
|
114
|
+
}), null), e;
|
|
115
|
+
}
|
|
116
|
+
}), w), i(w, n(D, {
|
|
341
117
|
get each() {
|
|
342
|
-
return
|
|
118
|
+
return x();
|
|
343
119
|
},
|
|
344
|
-
children: (
|
|
120
|
+
children: (e, m) => [n(b, {
|
|
345
121
|
get when() {
|
|
346
|
-
return
|
|
122
|
+
return m() > 0;
|
|
347
123
|
},
|
|
348
124
|
get children() {
|
|
349
|
-
return
|
|
350
|
-
class: "
|
|
125
|
+
return n(V, {
|
|
126
|
+
class: "h-3 w-3 shrink-0 text-muted-foreground"
|
|
351
127
|
});
|
|
352
128
|
}
|
|
353
129
|
}), (() => {
|
|
354
|
-
var
|
|
355
|
-
return
|
|
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;
|
|
356
141
|
})()]
|
|
357
|
-
})),
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
const k = (u, m) => {
|
|
366
|
-
if (m) {
|
|
367
|
-
l.set(u, m);
|
|
368
|
-
return;
|
|
369
|
-
}
|
|
370
|
-
l.delete(u);
|
|
371
|
-
};
|
|
372
|
-
return p(() => {
|
|
373
|
-
const u = e.revealNonce?.() ?? 0, m = e.selectedPath();
|
|
374
|
-
e.expandedPaths(), e.rootFolders(), !(u <= i) && queueMicrotask(() => {
|
|
375
|
-
if (!n || !ge(() => (e.revealNonce?.() ?? 0) === u && u > i))
|
|
376
|
-
return;
|
|
377
|
-
if (m === "/") {
|
|
378
|
-
n.scrollTop = 0, i = u;
|
|
379
|
-
return;
|
|
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
|
+
};
|
|
380
150
|
}
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
inline: "nearest"
|
|
385
|
-
}), i = u);
|
|
386
|
-
});
|
|
387
|
-
}), (() => {
|
|
388
|
-
var u = Se(), m = u.firstChild, b = m.firstChild;
|
|
389
|
-
return J((s) => {
|
|
390
|
-
n = s;
|
|
391
|
-
}, u), m.$$click = () => e.onSelectRoot(), f(m, h(be, {
|
|
392
|
-
class: "w-4 h-4 flex-shrink-0"
|
|
393
|
-
}), b), f(b, a), f(u, h(A, {
|
|
394
|
-
get each() {
|
|
395
|
-
return e.rootFolders();
|
|
151
|
+
}), !1, !0), i(E, n(b, {
|
|
152
|
+
get when() {
|
|
153
|
+
return !r.pending() || r.currentPath();
|
|
396
154
|
},
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
155
|
+
get fallback() {
|
|
156
|
+
return (() => {
|
|
157
|
+
var e = ae();
|
|
158
|
+
return i(e, () => s().loading), e;
|
|
159
|
+
})();
|
|
160
|
+
},
|
|
161
|
+
get children() {
|
|
162
|
+
return n(b, {
|
|
163
|
+
get when() {
|
|
164
|
+
return d().length;
|
|
165
|
+
},
|
|
166
|
+
get fallback() {
|
|
167
|
+
return n(b, {
|
|
168
|
+
get when() {
|
|
169
|
+
return r.currentPath();
|
|
170
|
+
},
|
|
171
|
+
get children() {
|
|
172
|
+
var e = ie();
|
|
173
|
+
return i(e, () => s().empty), e;
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
},
|
|
177
|
+
get children() {
|
|
178
|
+
return n(D, {
|
|
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
|
+
class: "h-4 w-4 shrink-0"
|
|
191
|
+
}), u), i(u, () => e.name), i(o, n(V, {
|
|
192
|
+
class: "h-3 w-3 shrink-0 text-muted-foreground"
|
|
193
|
+
}), null), F((c) => {
|
|
194
|
+
var $ = e.path, _ = t.disabled || t.filter?.(e) === !1;
|
|
195
|
+
return $ !== c.e && y(o, "data-picker-row-path", c.e = $), _ !== c.t && (o.disabled = c.t = _), c;
|
|
196
|
+
}, {
|
|
197
|
+
e: void 0,
|
|
198
|
+
t: void 0
|
|
199
|
+
}), o;
|
|
200
|
+
})()
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
})), I.addEventListener("change", (e) => {
|
|
206
|
+
r.setShowHidden(e.currentTarget.checked);
|
|
207
|
+
}), i(M, () => s().showHidden, null), i(H, n(b, {
|
|
208
|
+
get when() {
|
|
209
|
+
return B(() => !!r.pending())() && r.currentPath();
|
|
210
|
+
},
|
|
211
|
+
get children() {
|
|
212
|
+
var e = te();
|
|
213
|
+
return i(e, () => s().loading), e;
|
|
214
|
+
}
|
|
215
|
+
}), null), i(a, n(b, {
|
|
421
216
|
get when() {
|
|
422
|
-
return
|
|
217
|
+
return t.onCreateFolder;
|
|
423
218
|
},
|
|
424
219
|
get children() {
|
|
425
|
-
|
|
426
|
-
return f(s, () => e.emptyText ?? "No directories available"), s;
|
|
220
|
+
return n(ue, t);
|
|
427
221
|
}
|
|
428
|
-
}), null),
|
|
429
|
-
var
|
|
430
|
-
return
|
|
222
|
+
}), null), F((e) => {
|
|
223
|
+
var m = r.pending(), o = s().roots, u = s().currentDirectory, c = t.disabled || !r.context();
|
|
224
|
+
return m !== e.e && y(a, "aria-busy", e.e = m), o !== e.t && y(g, "aria-label", e.t = o), u !== e.a && y(w, "aria-label", e.a = u), c !== e.o && (I.disabled = e.o = c), e;
|
|
431
225
|
}, {
|
|
432
226
|
e: void 0,
|
|
433
227
|
t: void 0,
|
|
434
|
-
a: void 0
|
|
435
|
-
|
|
228
|
+
a: void 0,
|
|
229
|
+
o: void 0
|
|
230
|
+
}), F(() => I.checked = r.showHidden()), a;
|
|
436
231
|
})();
|
|
437
232
|
}
|
|
438
|
-
function
|
|
439
|
-
const
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
233
|
+
function ue(t) {
|
|
234
|
+
const [s, r] = z(!1), [d, v] = z(""), [x, p] = z(!1), [C, P] = z(null), a = () => A(t), g = async () => {
|
|
235
|
+
if (!d().trim() || !t.source.valid() || !t.onCreateFolder || x()) return;
|
|
236
|
+
const l = t.source.currentPath();
|
|
237
|
+
p(!0), P(null);
|
|
238
|
+
try {
|
|
239
|
+
await t.onCreateFolder(l, d().trim()), v(""), r(!1), t.source.active() && l === t.source.currentPath() && await t.source.navigate(l);
|
|
240
|
+
} catch (h) {
|
|
241
|
+
P(h);
|
|
242
|
+
} finally {
|
|
243
|
+
p(!1);
|
|
244
|
+
}
|
|
443
245
|
};
|
|
444
|
-
return
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
var s = _e(), w = s.firstChild, r = w.firstChild, x = r.firstChild, S = x.nextSibling;
|
|
448
|
-
return f(w, h(L, {
|
|
246
|
+
return (() => {
|
|
247
|
+
var l = ce();
|
|
248
|
+
return i(l, n(b, {
|
|
449
249
|
get when() {
|
|
450
|
-
return
|
|
250
|
+
return s();
|
|
451
251
|
},
|
|
452
252
|
get fallback() {
|
|
453
|
-
return
|
|
253
|
+
return n(k, {
|
|
254
|
+
size: "sm",
|
|
255
|
+
variant: "ghost",
|
|
256
|
+
get disabled() {
|
|
257
|
+
return t.disabled || !t.source.valid();
|
|
258
|
+
},
|
|
259
|
+
onClick: () => r(!0),
|
|
260
|
+
get children() {
|
|
261
|
+
return [n(Q, {
|
|
262
|
+
class: "mr-1 h-3.5 w-3.5"
|
|
263
|
+
}), B(() => a().newFolder)];
|
|
264
|
+
}
|
|
265
|
+
});
|
|
454
266
|
},
|
|
455
267
|
get children() {
|
|
456
|
-
var
|
|
457
|
-
return
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
268
|
+
var h = se();
|
|
269
|
+
return i(h, n(T, {
|
|
270
|
+
size: "sm",
|
|
271
|
+
get "aria-label"() {
|
|
272
|
+
return a().folderName;
|
|
273
|
+
},
|
|
274
|
+
get value() {
|
|
275
|
+
return d();
|
|
276
|
+
},
|
|
277
|
+
onInput: (w) => v(w.currentTarget.value),
|
|
278
|
+
get disabled() {
|
|
279
|
+
return t.disabled || x();
|
|
280
|
+
}
|
|
281
|
+
}), null), i(h, n(k, {
|
|
282
|
+
size: "sm",
|
|
283
|
+
get disabled() {
|
|
284
|
+
return t.disabled || x() || !d().trim() || !t.source.valid();
|
|
285
|
+
},
|
|
286
|
+
onClick: () => {
|
|
287
|
+
g();
|
|
288
|
+
},
|
|
289
|
+
get children() {
|
|
290
|
+
return a().create;
|
|
291
|
+
}
|
|
292
|
+
}), null), i(h, n(k, {
|
|
293
|
+
size: "sm",
|
|
294
|
+
variant: "ghost-destructive",
|
|
295
|
+
get disabled() {
|
|
296
|
+
return t.disabled || x();
|
|
297
|
+
},
|
|
298
|
+
onClick: () => r(!1),
|
|
299
|
+
get children() {
|
|
300
|
+
return a().cancel;
|
|
301
|
+
}
|
|
302
|
+
}), null), h;
|
|
466
303
|
}
|
|
467
|
-
}),
|
|
468
|
-
e.registerRow(e.item.path, d);
|
|
469
|
-
}, r), f(x, h(we, {
|
|
470
|
-
get item() {
|
|
471
|
-
return e.item;
|
|
472
|
-
},
|
|
473
|
-
get open() {
|
|
474
|
-
return a();
|
|
475
|
-
},
|
|
476
|
-
class: "w-4 h-4"
|
|
477
|
-
})), f(S, () => e.item.name), f(s, h(L, {
|
|
304
|
+
}), null), i(l, n(b, {
|
|
478
305
|
get when() {
|
|
479
|
-
return
|
|
306
|
+
return C();
|
|
480
307
|
},
|
|
481
308
|
get children() {
|
|
482
|
-
var
|
|
483
|
-
return
|
|
484
|
-
get each() {
|
|
485
|
-
return i();
|
|
486
|
-
},
|
|
487
|
-
children: (g) => h(te, {
|
|
488
|
-
item: g,
|
|
489
|
-
get depth() {
|
|
490
|
-
return e.depth + 1;
|
|
491
|
-
},
|
|
492
|
-
get selectedPath() {
|
|
493
|
-
return e.selectedPath;
|
|
494
|
-
},
|
|
495
|
-
get expandedPaths() {
|
|
496
|
-
return e.expandedPaths;
|
|
497
|
-
},
|
|
498
|
-
get revealNonce() {
|
|
499
|
-
return e.revealNonce;
|
|
500
|
-
},
|
|
501
|
-
get onToggle() {
|
|
502
|
-
return e.onToggle;
|
|
503
|
-
},
|
|
504
|
-
get onSelect() {
|
|
505
|
-
return e.onSelect;
|
|
506
|
-
},
|
|
507
|
-
get isSelectable() {
|
|
508
|
-
return e.isSelectable;
|
|
509
|
-
},
|
|
510
|
-
get registerRow() {
|
|
511
|
-
return e.registerRow;
|
|
512
|
-
}
|
|
513
|
-
})
|
|
514
|
-
})), d;
|
|
309
|
+
var h = oe();
|
|
310
|
+
return i(h, () => K(t, C())), h;
|
|
515
311
|
}
|
|
516
|
-
}), null),
|
|
517
|
-
var g = R("group flex items-center w-full text-xs", "transition-colors duration-100", l() ? "hover:bg-accent/60" : "opacity-50", n() && l() && "bg-accent text-accent-foreground font-medium"), I = `${4 + e.depth * 14}px`, _ = e.item.path, E = !l(), T = R("flex items-center gap-1 flex-1 min-w-0 text-left py-1.5 pl-0.5 pr-2", l() ? "cursor-pointer" : "cursor-not-allowed", "focus:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-ring");
|
|
518
|
-
return g !== d.e && N(w, d.e = g), I !== d.t && de(w, "padding-left", d.t = I), _ !== d.a && O(r, "data-picker-row-path", d.a = _), E !== d.o && (r.disabled = d.o = E), T !== d.i && N(r, d.i = T), d;
|
|
519
|
-
}, {
|
|
520
|
-
e: void 0,
|
|
521
|
-
t: void 0,
|
|
522
|
-
a: void 0,
|
|
523
|
-
o: void 0,
|
|
524
|
-
i: void 0
|
|
525
|
-
}), s;
|
|
312
|
+
}), null), l;
|
|
526
313
|
})();
|
|
527
314
|
}
|
|
528
|
-
|
|
315
|
+
const ke = Y;
|
|
316
|
+
R(["click", "keydown"]);
|
|
529
317
|
export {
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
Ae as getParentPath,
|
|
537
|
-
P as normalizePath,
|
|
538
|
-
Re as resolvePickerInitialPath,
|
|
539
|
-
Ne as useFolderIndex,
|
|
540
|
-
Ke as usePickerTree
|
|
318
|
+
ye as PickerPanel,
|
|
319
|
+
$e as getParentPath,
|
|
320
|
+
ke as normalizePath,
|
|
321
|
+
A as pickerCopy,
|
|
322
|
+
K as pickerErrorMessage,
|
|
323
|
+
we as usePickerNavigation
|
|
541
324
|
};
|