@floegence/floe-webapp-core 0.86.50 → 0.86.52
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/DirectoryPicker.js +25 -29
- package/dist/components/ui/FileOpenPicker.js +106 -98
- package/dist/components/ui/FileSavePicker.js +74 -66
- package/dist/components/ui/index.d.ts +2 -0
- package/dist/components/ui/picker/DirectoryFavorites.d.ts +29 -0
- package/dist/components/ui/picker/DirectoryFavorites.js +163 -0
- package/dist/components/ui/picker/PickerBase.d.ts +16 -5
- package/dist/components/ui/picker/PickerBase.js +370 -225
- package/dist/components/ui/picker/PickerNavigation.d.ts +7 -0
- package/dist/components/ui/picker/PickerNavigation.js +73 -66
- package/dist/full.js +465 -463
- package/dist/styles.css +1 -1
- package/dist/ui.js +128 -126
- package/package.json +1 -1
|
@@ -1,81 +1,95 @@
|
|
|
1
|
-
import { insert as
|
|
2
|
-
import { createEffect as
|
|
3
|
-
import { cn as
|
|
4
|
-
import { FileItemIcon as
|
|
5
|
-
import { FolderOpen as
|
|
6
|
-
import { Button as
|
|
7
|
-
import { Input as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { insert as o, createComponent as l, use as H, setAttribute as g, effect as P, className as de, memo as C, spread as te, mergeProps as re, template as f, delegateEvents as ce } from "solid-js/web";
|
|
2
|
+
import { createSignal as E, createEffect as T, on as ae, untrack as ue, createMemo as V, createUniqueId as ge, Show as h, For as N } from "solid-js";
|
|
3
|
+
import { cn as L } from "../../../utils/cn.js";
|
|
4
|
+
import { FileItemIcon as ve } from "../../file-browser/FileIcons.js";
|
|
5
|
+
import { FolderOpen as le, ChevronRight as U } from "../../icons/index.js";
|
|
6
|
+
import { Button as z } from "../Button.js";
|
|
7
|
+
import { Input as j } from "../Input.js";
|
|
8
|
+
import { PickerDirectoryRow as ie, DirectoryFavoriteButton as fe } from "./DirectoryFavorites.js";
|
|
9
|
+
import { resolveTabNavigationTargetId as he } from "../Tabs.js";
|
|
10
|
+
import { createFilesystemPickerDataSource as be, parsePickerPath as q, defaultPickerCopy as me, PickerNavigationError as we } from "./PickerNavigation.js";
|
|
11
|
+
import { pickerParentPath as Xe } from "./PickerNavigation.js";
|
|
12
|
+
var xe = /* @__PURE__ */ f('<div role=tablist class="mb-1 flex min-w-0 items-center gap-4 border-b border-border">'), ye = /* @__PURE__ */ f('<div class="flex min-w-0 items-start gap-1.5"><div class="min-w-0 flex-1">'), ke = /* @__PURE__ */ f('<div role=alert class="flex items-center gap-2 text-xs text-error"><span class="min-w-0 flex-1 break-words">'), $e = /* @__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">'), O = /* @__PURE__ */ f("<div>"), pe = /* @__PURE__ */ f('<div class="flex min-w-0 flex-col gap-2"data-filesystem-picker><div class="flex min-w-0 flex-col gap-2">'), Pe = /* @__PURE__ */ f('<div class="flex flex-wrap items-center gap-1">'), _e = /* @__PURE__ */ f("<button type=button role=tab>"), Fe = /* @__PURE__ */ f('<nav class="flex min-w-0 flex-wrap items-center gap-0.5 text-xs">'), Ce = /* @__PURE__ */ f("<span role=status>"), Ie = /* @__PURE__ */ f('<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>'), Ee = /* @__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">'), ne = /* @__PURE__ */ f('<p class="px-3 py-6 text-center text-xs text-muted-foreground"role=status>'), ze = /* @__PURE__ */ f('<p class="px-3 py-6 text-center text-xs text-muted-foreground">'), Ae = /* @__PURE__ */ f('<button type=button class="flex min-h-8 min-w-0 flex-1 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">'), Ve = /* @__PURE__ */ f('<button type=button class="flex min-h-14 min-w-0 flex-1 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">'), De = /* @__PURE__ */ f('<div class="flex items-center gap-1.5">'), Re = /* @__PURE__ */ f('<p role=alert class="text-xs text-error">');
|
|
13
|
+
function W(e) {
|
|
13
14
|
return {
|
|
14
|
-
...
|
|
15
|
+
...me,
|
|
15
16
|
...e.copy
|
|
16
17
|
};
|
|
17
18
|
}
|
|
18
|
-
function
|
|
19
|
-
const
|
|
20
|
-
return
|
|
19
|
+
function oe(e, s) {
|
|
20
|
+
const n = W(e);
|
|
21
|
+
return s instanceof we ? n[s.kind] : e.formatError?.(s) || (s instanceof Error ? s.message : "") || n.loadFailed;
|
|
21
22
|
}
|
|
22
|
-
function
|
|
23
|
-
const
|
|
24
|
-
return
|
|
25
|
-
|
|
26
|
-
})),
|
|
23
|
+
function Oe(e, s, n, y, _ = () => "browse") {
|
|
24
|
+
const [m, F] = E("browse"), k = be(() => e, n);
|
|
25
|
+
return T(ae(() => [s(), e.scopeKey], ([I]) => {
|
|
26
|
+
k.close(), I && (F(_()), e.directoryFavorites?.onRefresh?.(), y?.(), k.open(e.initialPath));
|
|
27
|
+
})), T(() => e.onValidityChange?.(k.valid() && m() === "browse")), {
|
|
28
|
+
...k,
|
|
29
|
+
view: m,
|
|
30
|
+
setView: F
|
|
31
|
+
};
|
|
27
32
|
}
|
|
28
|
-
function
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
33
|
+
function We(e) {
|
|
34
|
+
const s = () => W(e), n = ue(() => e.source), y = V(() => n.entries().filter((d) => d.type === "folder")), _ = V(() => n.context()?.roots.filter((d) => !d.hidden) ?? []), m = ge(), [F, k] = E(""), [I, $] = E(""), A = () => n.view() !== "browse", w = () => !!(e.suggestions?.paths.length || e.directoryFavorites), x = V(() => [...new Set((e.directoryFavorites?.paths ?? []).map((d) => q(d)).filter(Boolean))]), D = V(() => n.view() === "suggestions" ? e.suggestions?.paths ?? [] : x().filter((d) => d.toLocaleLowerCase().includes(F().trim().toLocaleLowerCase())));
|
|
35
|
+
T(ae(() => e.scopeKey, () => {
|
|
36
|
+
k(""), $("");
|
|
37
|
+
}));
|
|
38
|
+
let K;
|
|
39
|
+
const G = V(() => [...e.suggestions?.paths.length ? [{
|
|
32
40
|
id: "suggestions",
|
|
33
|
-
label: e.suggestions
|
|
41
|
+
label: e.suggestions.label,
|
|
42
|
+
disabled: e.disabled
|
|
43
|
+
}] : [], ...e.directoryFavorites ? [{
|
|
44
|
+
id: "favorites",
|
|
45
|
+
label: s().favorites,
|
|
34
46
|
disabled: e.disabled
|
|
35
|
-
}, ...
|
|
36
|
-
id: `root:${
|
|
37
|
-
label:
|
|
38
|
-
path:
|
|
39
|
-
disabled: e.disabled ||
|
|
40
|
-
}))]),
|
|
41
|
-
if (
|
|
42
|
-
const
|
|
43
|
-
return `root:${
|
|
44
|
-
},
|
|
47
|
+
}] : [], ..._().map((d) => ({
|
|
48
|
+
id: `root:${d.id}`,
|
|
49
|
+
label: d.label,
|
|
50
|
+
path: d.pathAbs,
|
|
51
|
+
disabled: e.disabled || d.permissions?.read === !1
|
|
52
|
+
}))]), B = () => {
|
|
53
|
+
if (A()) return n.view();
|
|
54
|
+
const d = q(n.pathInput(), n.context()?.homePathAbs);
|
|
55
|
+
return `root:${_().filter((i) => d === i.pathAbs || d.startsWith(i.pathAbs.replace(/\/$/, "") + "/")).sort((i, t) => t.pathAbs.length - i.pathAbs.length)[0]?.id ?? n.context()?.defaultRootId ?? _()[0]?.id}`;
|
|
56
|
+
}, J = /* @__PURE__ */ new Map(), Q = [], X = (d, b, i, t) => {
|
|
45
57
|
let a;
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
58
|
+
d.key === "ArrowDown" && (a = Math.min(b + 1, t - 1)), d.key === "ArrowUp" && (a = Math.max(0, b - 1)), d.key === "Home" && (a = 0), d.key === "End" && (a = t - 1), a !== void 0 && (d.preventDefault(), d.stopPropagation(), i[a]?.focus(), i[a]?.scrollIntoView?.({
|
|
59
|
+
block: "nearest"
|
|
60
|
+
}));
|
|
61
|
+
}, se = V(() => {
|
|
62
|
+
const d = n.currentPath();
|
|
63
|
+
if (!d) return [];
|
|
64
|
+
let b = "";
|
|
51
65
|
return [{
|
|
52
66
|
path: "/",
|
|
53
|
-
name:
|
|
54
|
-
}, ...
|
|
55
|
-
path:
|
|
56
|
-
name:
|
|
67
|
+
name: s().root
|
|
68
|
+
}, ...d.split("/").filter(Boolean).map((i) => (b += `/${i}`, {
|
|
69
|
+
path: b,
|
|
70
|
+
name: i
|
|
57
71
|
}))];
|
|
58
|
-
}),
|
|
59
|
-
|
|
60
|
-
};
|
|
72
|
+
}), Y = [], S = (d) => {
|
|
73
|
+
n.setView("browse"), n.navigate(d), K?.focus();
|
|
74
|
+
}, Z = () => S(n.pathInput());
|
|
61
75
|
return (() => {
|
|
62
|
-
var
|
|
63
|
-
return
|
|
76
|
+
var d = pe(), b = d.firstChild;
|
|
77
|
+
return o(d, l(h, {
|
|
64
78
|
get when() {
|
|
65
|
-
return
|
|
79
|
+
return w();
|
|
66
80
|
},
|
|
67
81
|
get fallback() {
|
|
68
82
|
return (() => {
|
|
69
|
-
var
|
|
70
|
-
return
|
|
83
|
+
var i = Pe();
|
|
84
|
+
return o(i, l(N, {
|
|
71
85
|
get each() {
|
|
72
|
-
return
|
|
86
|
+
return _();
|
|
73
87
|
},
|
|
74
|
-
children: (t) =>
|
|
88
|
+
children: (t) => l(z, {
|
|
75
89
|
type: "button",
|
|
76
90
|
size: "sm",
|
|
77
91
|
get variant() {
|
|
78
|
-
return
|
|
92
|
+
return n.currentPath() === t.pathAbs ? "secondary" : "ghost";
|
|
79
93
|
},
|
|
80
94
|
get disabled() {
|
|
81
95
|
return e.disabled || t.permissions?.read === !1;
|
|
@@ -84,31 +98,31 @@ function De(e) {
|
|
|
84
98
|
return t.pathAbs;
|
|
85
99
|
},
|
|
86
100
|
onClick: () => {
|
|
87
|
-
|
|
101
|
+
n.navigate(t.pathAbs);
|
|
88
102
|
},
|
|
89
103
|
get children() {
|
|
90
104
|
return t.label;
|
|
91
105
|
}
|
|
92
106
|
})
|
|
93
|
-
})),
|
|
107
|
+
})), P(() => g(i, "aria-label", s().roots)), i;
|
|
94
108
|
})();
|
|
95
109
|
},
|
|
96
110
|
get children() {
|
|
97
|
-
var
|
|
98
|
-
return
|
|
111
|
+
var i = xe();
|
|
112
|
+
return o(i, l(N, {
|
|
99
113
|
get each() {
|
|
100
|
-
return
|
|
114
|
+
return G();
|
|
101
115
|
},
|
|
102
116
|
children: (t) => (() => {
|
|
103
|
-
var a =
|
|
117
|
+
var a = _e();
|
|
104
118
|
return a.$$keydown = (r) => {
|
|
105
|
-
const
|
|
106
|
-
|
|
119
|
+
const u = he(G(), t.id, r.key);
|
|
120
|
+
u && (r.preventDefault(), r.stopPropagation(), J.get(u)?.focus());
|
|
107
121
|
}, a.$$click = () => {
|
|
108
|
-
|
|
109
|
-
},
|
|
110
|
-
var
|
|
111
|
-
return
|
|
122
|
+
"path" in t ? S(t.path) : (n.setView(t.id), t.id === "favorites" && e.directoryFavorites?.onRefresh?.());
|
|
123
|
+
}, H((r) => J.set(t.id, r), a), g(a, "aria-controls", m), o(a, () => t.label), P((r) => {
|
|
124
|
+
var u = `${m}-${t.id}`, v = B() === t.id, p = B() === t.id ? 0 : -1, c = t.disabled, R = "path" in t ? t.path : t.label, M = L("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", B() === t.id ? "border-primary text-primary" : "border-transparent text-muted-foreground hover:text-foreground");
|
|
125
|
+
return u !== r.e && g(a, "id", r.e = u), v !== r.t && g(a, "aria-selected", r.t = v), p !== r.a && g(a, "tabindex", r.a = p), c !== r.o && (a.disabled = r.o = c), R !== r.i && g(a, "title", r.i = R), M !== r.n && de(a, r.n = M), r;
|
|
112
126
|
}, {
|
|
113
127
|
e: void 0,
|
|
114
128
|
t: void 0,
|
|
@@ -118,321 +132,452 @@ function De(e) {
|
|
|
118
132
|
n: void 0
|
|
119
133
|
}), a;
|
|
120
134
|
})()
|
|
121
|
-
})),
|
|
135
|
+
})), P(() => g(i, "aria-label", s().roots)), i;
|
|
122
136
|
}
|
|
123
|
-
}),
|
|
137
|
+
}), b), g(b, "id", m), o(b, l(h, {
|
|
124
138
|
get when() {
|
|
125
|
-
return !
|
|
139
|
+
return !A();
|
|
126
140
|
},
|
|
127
141
|
get children() {
|
|
128
|
-
var
|
|
129
|
-
return
|
|
142
|
+
var i = ye(), t = i.firstChild;
|
|
143
|
+
return o(t, l(j, {
|
|
130
144
|
ref(a) {
|
|
131
|
-
var r =
|
|
132
|
-
typeof r == "function" ? r(a) :
|
|
145
|
+
var r = K;
|
|
146
|
+
typeof r == "function" ? r(a) : K = a;
|
|
133
147
|
},
|
|
134
148
|
size: "sm",
|
|
135
149
|
get "aria-label"() {
|
|
136
|
-
return
|
|
150
|
+
return s().path;
|
|
137
151
|
},
|
|
138
152
|
placeholder: "/",
|
|
139
153
|
get value() {
|
|
140
|
-
return
|
|
154
|
+
return n.pathInput();
|
|
141
155
|
},
|
|
142
156
|
get disabled() {
|
|
143
|
-
return e.disabled || !
|
|
157
|
+
return e.disabled || !n.context();
|
|
144
158
|
},
|
|
145
|
-
onInput: (a) =>
|
|
159
|
+
onInput: (a) => n.setPathInput(a.currentTarget.value),
|
|
146
160
|
onKeyDown: (a) => {
|
|
147
|
-
a.key === "Enter" && (a.preventDefault(), a.stopPropagation(),
|
|
161
|
+
a.key === "Enter" && (a.preventDefault(), a.stopPropagation(), Z());
|
|
148
162
|
}
|
|
149
|
-
})),
|
|
163
|
+
})), o(i, l(z, {
|
|
150
164
|
size: "sm",
|
|
151
165
|
variant: "outline",
|
|
152
|
-
onClick:
|
|
166
|
+
onClick: Z,
|
|
153
167
|
get disabled() {
|
|
154
|
-
return e.disabled || !
|
|
168
|
+
return e.disabled || !n.context() || !n.pathInput();
|
|
169
|
+
},
|
|
170
|
+
get children() {
|
|
171
|
+
return s().go;
|
|
172
|
+
}
|
|
173
|
+
}), null), i;
|
|
174
|
+
}
|
|
175
|
+
}), null), o(b, l(h, {
|
|
176
|
+
get when() {
|
|
177
|
+
return I() || e.directoryFavorites?.error;
|
|
178
|
+
},
|
|
179
|
+
get children() {
|
|
180
|
+
var i = ke(), t = i.firstChild;
|
|
181
|
+
return o(t, () => I() || e.directoryFavorites?.error), o(i, l(z, {
|
|
182
|
+
size: "sm",
|
|
183
|
+
variant: "ghost",
|
|
184
|
+
get disabled() {
|
|
185
|
+
return e.directoryFavorites?.loading;
|
|
186
|
+
},
|
|
187
|
+
onClick: () => {
|
|
188
|
+
$(""), e.directoryFavorites?.onRefresh?.();
|
|
155
189
|
},
|
|
156
190
|
get children() {
|
|
157
|
-
return
|
|
191
|
+
return s().retry;
|
|
158
192
|
}
|
|
159
|
-
}), null),
|
|
193
|
+
}), null), i;
|
|
160
194
|
}
|
|
161
|
-
}), null),
|
|
195
|
+
}), null), o(b, l(h, {
|
|
162
196
|
get when() {
|
|
163
|
-
return
|
|
197
|
+
return C(() => !!n.error())() && !A();
|
|
164
198
|
},
|
|
165
199
|
get children() {
|
|
166
|
-
var
|
|
167
|
-
return
|
|
200
|
+
var i = $e(), t = i.firstChild;
|
|
201
|
+
return o(t, () => oe(e, n.error())), o(i, l(z, {
|
|
168
202
|
size: "sm",
|
|
169
203
|
variant: "ghost",
|
|
170
204
|
onClick: () => {
|
|
171
|
-
|
|
205
|
+
n.retry();
|
|
172
206
|
},
|
|
173
207
|
get disabled() {
|
|
174
|
-
return e.disabled ||
|
|
208
|
+
return e.disabled || n.pending();
|
|
175
209
|
},
|
|
176
210
|
get children() {
|
|
177
|
-
return
|
|
211
|
+
return s().retry;
|
|
178
212
|
}
|
|
179
|
-
}), null),
|
|
213
|
+
}), null), i;
|
|
180
214
|
}
|
|
181
|
-
}), null),
|
|
215
|
+
}), null), o(b, l(h, {
|
|
182
216
|
get when() {
|
|
183
|
-
return
|
|
217
|
+
return A();
|
|
184
218
|
},
|
|
185
219
|
get fallback() {
|
|
186
220
|
return [(() => {
|
|
187
|
-
var
|
|
188
|
-
return
|
|
221
|
+
var i = Fe();
|
|
222
|
+
return o(i, l(N, {
|
|
189
223
|
get each() {
|
|
190
|
-
return
|
|
224
|
+
return se();
|
|
191
225
|
},
|
|
192
|
-
children: (t, a) => [
|
|
226
|
+
children: (t, a) => [l(h, {
|
|
193
227
|
get when() {
|
|
194
228
|
return a() > 0;
|
|
195
229
|
},
|
|
196
230
|
get children() {
|
|
197
|
-
return
|
|
231
|
+
return l(U, {
|
|
198
232
|
class: "h-3 w-3 shrink-0 text-muted-foreground"
|
|
199
233
|
});
|
|
200
234
|
}
|
|
201
235
|
}), (() => {
|
|
202
|
-
var r =
|
|
236
|
+
var r = Ee();
|
|
203
237
|
return r.$$click = () => {
|
|
204
|
-
|
|
205
|
-
},
|
|
206
|
-
var
|
|
207
|
-
return
|
|
238
|
+
n.navigate(t.path);
|
|
239
|
+
}, o(r, () => t.name), P((u) => {
|
|
240
|
+
var v = t.path, p = e.disabled, c = t.path === n.currentPath() ? "location" : void 0;
|
|
241
|
+
return v !== u.e && g(r, "title", u.e = v), p !== u.t && (r.disabled = u.t = p), c !== u.a && g(r, "aria-current", u.a = c), u;
|
|
208
242
|
}, {
|
|
209
243
|
e: void 0,
|
|
210
244
|
t: void 0,
|
|
211
245
|
a: void 0
|
|
212
246
|
}), r;
|
|
213
247
|
})()]
|
|
214
|
-
})
|
|
248
|
+
}), null), o(i, l(h, {
|
|
249
|
+
get when() {
|
|
250
|
+
return e.directoryFavorites;
|
|
251
|
+
},
|
|
252
|
+
get children() {
|
|
253
|
+
return l(fe, {
|
|
254
|
+
get path() {
|
|
255
|
+
return n.currentPath();
|
|
256
|
+
},
|
|
257
|
+
get favorites() {
|
|
258
|
+
return e.directoryFavorites;
|
|
259
|
+
},
|
|
260
|
+
get copy() {
|
|
261
|
+
return s();
|
|
262
|
+
},
|
|
263
|
+
get disabled() {
|
|
264
|
+
return e.disabled || !n.valid();
|
|
265
|
+
},
|
|
266
|
+
onError: $
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
}), null), P(() => g(i, "aria-label", s().currentDirectory)), i;
|
|
215
270
|
})(), (() => {
|
|
216
|
-
var
|
|
217
|
-
return
|
|
271
|
+
var i = O();
|
|
272
|
+
return te(i, re(() => e.scrollViewportProps, {
|
|
218
273
|
get class() {
|
|
219
|
-
return
|
|
274
|
+
return L("min-h-[120px] overflow-y-auto rounded border border-border", e.scrollViewportProps?.class);
|
|
220
275
|
},
|
|
221
276
|
get style() {
|
|
222
277
|
return {
|
|
223
278
|
"max-height": e.treeMaxHeight ?? "240px"
|
|
224
279
|
};
|
|
225
280
|
}
|
|
226
|
-
}), !1, !0),
|
|
281
|
+
}), !1, !0), o(i, l(h, {
|
|
227
282
|
get when() {
|
|
228
|
-
return !
|
|
283
|
+
return !n.pending() || n.currentPath();
|
|
229
284
|
},
|
|
230
285
|
get fallback() {
|
|
231
286
|
return (() => {
|
|
232
|
-
var t =
|
|
233
|
-
return
|
|
287
|
+
var t = ne();
|
|
288
|
+
return o(t, () => s().loading), t;
|
|
234
289
|
})();
|
|
235
290
|
},
|
|
236
291
|
get children() {
|
|
237
|
-
return
|
|
292
|
+
return l(h, {
|
|
238
293
|
get when() {
|
|
239
294
|
return y().length;
|
|
240
295
|
},
|
|
241
296
|
get fallback() {
|
|
242
|
-
return
|
|
297
|
+
return l(h, {
|
|
243
298
|
get when() {
|
|
244
|
-
return
|
|
299
|
+
return n.currentPath();
|
|
245
300
|
},
|
|
246
301
|
get children() {
|
|
247
|
-
var t =
|
|
248
|
-
return
|
|
302
|
+
var t = ze();
|
|
303
|
+
return o(t, () => s().empty), t;
|
|
249
304
|
}
|
|
250
305
|
});
|
|
251
306
|
},
|
|
252
307
|
get children() {
|
|
253
|
-
return
|
|
308
|
+
return l(N, {
|
|
254
309
|
get each() {
|
|
255
310
|
return y();
|
|
256
311
|
},
|
|
257
|
-
children: (t, a) => (
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
},
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
return
|
|
272
|
-
},
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
312
|
+
children: (t, a) => l(ie, {
|
|
313
|
+
get path() {
|
|
314
|
+
return t.path;
|
|
315
|
+
},
|
|
316
|
+
get favorites() {
|
|
317
|
+
return e.directoryFavorites;
|
|
318
|
+
},
|
|
319
|
+
get copy() {
|
|
320
|
+
return s();
|
|
321
|
+
},
|
|
322
|
+
get scopeKey() {
|
|
323
|
+
return e.scopeKey;
|
|
324
|
+
},
|
|
325
|
+
get disabled() {
|
|
326
|
+
return e.disabled || e.filter?.(t) === !1;
|
|
327
|
+
},
|
|
328
|
+
onError: $,
|
|
329
|
+
get children() {
|
|
330
|
+
var r = Ae(), u = r.firstChild;
|
|
331
|
+
return r.$$keydown = (v) => X(v, a(), Y, y().length), r.$$click = () => {
|
|
332
|
+
n.navigate(t.path);
|
|
333
|
+
}, H((v) => {
|
|
334
|
+
T(() => {
|
|
335
|
+
Y[a()] = v;
|
|
336
|
+
});
|
|
337
|
+
}, r), o(r, l(ve, {
|
|
338
|
+
item: t,
|
|
339
|
+
size: 16,
|
|
340
|
+
class: "h-4 w-4 shrink-0"
|
|
341
|
+
}), u), o(u, () => t.name), o(r, l(U, {
|
|
342
|
+
class: "h-3 w-3 shrink-0 text-muted-foreground"
|
|
343
|
+
}), null), P((v) => {
|
|
344
|
+
var p = t.path, c = e.disabled || e.filter?.(t) === !1;
|
|
345
|
+
return p !== v.e && g(r, "data-picker-row-path", v.e = p), c !== v.t && (r.disabled = v.t = c), v;
|
|
346
|
+
}, {
|
|
347
|
+
e: void 0,
|
|
348
|
+
t: void 0
|
|
349
|
+
}), r;
|
|
350
|
+
}
|
|
351
|
+
})
|
|
277
352
|
});
|
|
278
353
|
}
|
|
279
354
|
});
|
|
280
355
|
}
|
|
281
|
-
})),
|
|
356
|
+
})), i;
|
|
282
357
|
})(), (() => {
|
|
283
|
-
var
|
|
358
|
+
var i = Ie(), t = i.firstChild, a = t.firstChild;
|
|
284
359
|
return a.addEventListener("change", (r) => {
|
|
285
|
-
|
|
286
|
-
}),
|
|
360
|
+
n.setShowHidden(r.currentTarget.checked);
|
|
361
|
+
}), o(t, () => s().showHidden, null), o(i, l(h, {
|
|
287
362
|
get when() {
|
|
288
|
-
return
|
|
363
|
+
return C(() => !!n.pending())() && n.currentPath();
|
|
289
364
|
},
|
|
290
365
|
get children() {
|
|
291
|
-
var r =
|
|
292
|
-
return
|
|
366
|
+
var r = Ce();
|
|
367
|
+
return o(r, () => s().loading), r;
|
|
293
368
|
}
|
|
294
|
-
}), null),
|
|
295
|
-
})(),
|
|
369
|
+
}), null), P(() => a.disabled = e.disabled || !n.context()), P(() => a.checked = n.showHidden()), i;
|
|
370
|
+
})(), l(h, {
|
|
296
371
|
get when() {
|
|
297
372
|
return e.onCreateFolder;
|
|
298
373
|
},
|
|
299
374
|
get children() {
|
|
300
|
-
return
|
|
375
|
+
return l(Me, e);
|
|
301
376
|
}
|
|
302
377
|
})];
|
|
303
378
|
},
|
|
304
379
|
get children() {
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
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);
|
|
380
|
+
return [l(h, {
|
|
381
|
+
get when() {
|
|
382
|
+
return n.view() === "favorites";
|
|
313
383
|
},
|
|
314
|
-
get
|
|
315
|
-
return {
|
|
316
|
-
|
|
317
|
-
|
|
384
|
+
get children() {
|
|
385
|
+
return l(j, {
|
|
386
|
+
size: "sm",
|
|
387
|
+
get "aria-label"() {
|
|
388
|
+
return s().favoritesFilter;
|
|
389
|
+
},
|
|
390
|
+
get placeholder() {
|
|
391
|
+
return s().favoritesFilter;
|
|
392
|
+
},
|
|
393
|
+
get value() {
|
|
394
|
+
return F();
|
|
395
|
+
},
|
|
396
|
+
onInput: (i) => k(i.currentTarget.value)
|
|
397
|
+
});
|
|
318
398
|
}
|
|
319
|
-
}),
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
},
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
|
|
399
|
+
}), (() => {
|
|
400
|
+
var i = O();
|
|
401
|
+
return te(i, re(() => e.scrollViewportProps, {
|
|
402
|
+
get "data-picker-suggestions"() {
|
|
403
|
+
return n.view() === "suggestions" ? "" : void 0;
|
|
404
|
+
},
|
|
405
|
+
get "data-picker-favorites"() {
|
|
406
|
+
return n.view() === "favorites" ? "" : void 0;
|
|
407
|
+
},
|
|
408
|
+
get "aria-label"() {
|
|
409
|
+
return C(() => n.view() === "favorites")() ? s().favorites : e.suggestions?.label;
|
|
410
|
+
},
|
|
411
|
+
get "aria-busy"() {
|
|
412
|
+
return C(() => n.view() === "favorites")() && e.directoryFavorites?.loading;
|
|
413
|
+
},
|
|
414
|
+
get class() {
|
|
415
|
+
return L("min-h-[180px] min-w-0 overflow-y-auto", e.scrollViewportProps?.class);
|
|
416
|
+
},
|
|
417
|
+
get style() {
|
|
418
|
+
return {
|
|
419
|
+
"max-height": e.treeMaxHeight ?? "240px"
|
|
420
|
+
};
|
|
421
|
+
}
|
|
422
|
+
}), !1, !0), o(i, l(h, {
|
|
423
|
+
get when() {
|
|
424
|
+
return D().length;
|
|
425
|
+
},
|
|
426
|
+
get fallback() {
|
|
427
|
+
return (() => {
|
|
428
|
+
var t = ne();
|
|
429
|
+
return o(t, (() => {
|
|
430
|
+
var a = C(() => !!e.directoryFavorites?.loading);
|
|
431
|
+
return () => a() ? s().loading : C(() => !!e.directoryFavorites?.error)() ? s().favoritesLoadFailed : C(() => !!F().trim())() ? s().favoritesNoMatches : s().favoritesEmpty;
|
|
432
|
+
})()), t;
|
|
433
|
+
})();
|
|
434
|
+
},
|
|
435
|
+
get children() {
|
|
436
|
+
return l(N, {
|
|
437
|
+
get each() {
|
|
438
|
+
return D();
|
|
439
|
+
},
|
|
440
|
+
children: (t, a) => l(ie, {
|
|
441
|
+
path: t,
|
|
442
|
+
get favorites() {
|
|
443
|
+
return e.directoryFavorites;
|
|
444
|
+
},
|
|
445
|
+
get copy() {
|
|
446
|
+
return s();
|
|
447
|
+
},
|
|
448
|
+
get scopeKey() {
|
|
449
|
+
return e.scopeKey;
|
|
450
|
+
},
|
|
451
|
+
get disabled() {
|
|
452
|
+
return e.disabled;
|
|
453
|
+
},
|
|
454
|
+
onError: $,
|
|
455
|
+
get children() {
|
|
456
|
+
var r = Ve(), u = r.firstChild, v = u.firstChild, p = v.nextSibling;
|
|
457
|
+
return r.$$keydown = (c) => X(c, a(), Q, D().length), r.$$click = () => {
|
|
458
|
+
S(t);
|
|
459
|
+
}, H((c) => {
|
|
460
|
+
T(() => {
|
|
461
|
+
Q[a()] = c;
|
|
462
|
+
});
|
|
463
|
+
}, r), g(r, "title", t), g(r, "aria-label", t), o(r, l(le, {
|
|
464
|
+
class: "h-4 w-4 shrink-0 text-muted-foreground"
|
|
465
|
+
}), u), o(v, () => t.split("/").filter(Boolean).at(-1) ?? s().root), o(p, t), o(r, l(U, {
|
|
466
|
+
class: "h-3 w-3 shrink-0 text-muted-foreground/60"
|
|
467
|
+
}), null), P((c) => {
|
|
468
|
+
var R = n.view() === "suggestions" ? t : void 0, M = n.view() === "favorites" ? t : void 0, ee = e.disabled || !n.context();
|
|
469
|
+
return R !== c.e && g(r, "data-picker-suggested-path", c.e = R), M !== c.t && g(r, "data-picker-favorite-path", c.t = M), ee !== c.a && (r.disabled = c.a = ee), c;
|
|
470
|
+
}, {
|
|
471
|
+
e: void 0,
|
|
472
|
+
t: void 0,
|
|
473
|
+
a: void 0
|
|
474
|
+
}), r;
|
|
475
|
+
}
|
|
476
|
+
})
|
|
477
|
+
});
|
|
478
|
+
}
|
|
479
|
+
})), i;
|
|
480
|
+
})()];
|
|
336
481
|
}
|
|
337
|
-
}), null),
|
|
338
|
-
var t =
|
|
339
|
-
return t !==
|
|
482
|
+
}), null), P((i) => {
|
|
483
|
+
var t = n.pending(), a = w() ? "tabpanel" : void 0, r = w() ? `${m}-${B()}` : void 0;
|
|
484
|
+
return t !== i.e && g(d, "aria-busy", i.e = t), a !== i.t && g(b, "role", i.t = a), r !== i.a && g(b, "aria-labelledby", i.a = r), i;
|
|
340
485
|
}, {
|
|
341
486
|
e: void 0,
|
|
342
487
|
t: void 0,
|
|
343
488
|
a: void 0
|
|
344
|
-
}),
|
|
489
|
+
}), d;
|
|
345
490
|
})();
|
|
346
491
|
}
|
|
347
|
-
function
|
|
348
|
-
const [
|
|
349
|
-
if (!y().trim() || !e.source.valid() || !e.onCreateFolder ||
|
|
350
|
-
const
|
|
351
|
-
|
|
492
|
+
function Me(e) {
|
|
493
|
+
const [s, n] = E(!1), [y, _] = E(""), [m, F] = E(!1), [k, I] = E(null), $ = () => W(e), A = async () => {
|
|
494
|
+
if (!y().trim() || !e.source.valid() || !e.onCreateFolder || m()) return;
|
|
495
|
+
const w = e.source.currentPath();
|
|
496
|
+
F(!0), I(null);
|
|
352
497
|
try {
|
|
353
|
-
await e.onCreateFolder(
|
|
354
|
-
} catch (
|
|
355
|
-
|
|
498
|
+
await e.onCreateFolder(w, y().trim()), _(""), n(!1), e.source.active() && w === e.source.currentPath() && await e.source.navigate(w);
|
|
499
|
+
} catch (x) {
|
|
500
|
+
I(x);
|
|
356
501
|
} finally {
|
|
357
|
-
|
|
502
|
+
F(!1);
|
|
358
503
|
}
|
|
359
504
|
};
|
|
360
505
|
return (() => {
|
|
361
|
-
var
|
|
362
|
-
return
|
|
506
|
+
var w = O();
|
|
507
|
+
return o(w, l(h, {
|
|
363
508
|
get when() {
|
|
364
|
-
return
|
|
509
|
+
return s();
|
|
365
510
|
},
|
|
366
511
|
get fallback() {
|
|
367
|
-
return
|
|
512
|
+
return l(z, {
|
|
368
513
|
size: "sm",
|
|
369
514
|
variant: "ghost",
|
|
370
515
|
get disabled() {
|
|
371
516
|
return e.disabled || !e.source.valid();
|
|
372
517
|
},
|
|
373
|
-
onClick: () =>
|
|
518
|
+
onClick: () => n(!0),
|
|
374
519
|
get children() {
|
|
375
|
-
return [
|
|
520
|
+
return [l(le, {
|
|
376
521
|
class: "mr-1 h-3.5 w-3.5"
|
|
377
|
-
}),
|
|
522
|
+
}), C(() => $().newFolder)];
|
|
378
523
|
}
|
|
379
524
|
});
|
|
380
525
|
},
|
|
381
526
|
get children() {
|
|
382
|
-
var
|
|
383
|
-
return
|
|
527
|
+
var x = De();
|
|
528
|
+
return o(x, l(j, {
|
|
384
529
|
size: "sm",
|
|
385
530
|
get "aria-label"() {
|
|
386
|
-
return
|
|
531
|
+
return $().folderName;
|
|
387
532
|
},
|
|
388
533
|
get value() {
|
|
389
534
|
return y();
|
|
390
535
|
},
|
|
391
|
-
onInput: (
|
|
536
|
+
onInput: (D) => _(D.currentTarget.value),
|
|
392
537
|
get disabled() {
|
|
393
|
-
return e.disabled ||
|
|
538
|
+
return e.disabled || m();
|
|
394
539
|
}
|
|
395
|
-
}), null),
|
|
540
|
+
}), null), o(x, l(z, {
|
|
396
541
|
size: "sm",
|
|
397
542
|
get disabled() {
|
|
398
|
-
return e.disabled ||
|
|
543
|
+
return e.disabled || m() || !y().trim() || !e.source.valid();
|
|
399
544
|
},
|
|
400
545
|
onClick: () => {
|
|
401
|
-
|
|
546
|
+
A();
|
|
402
547
|
},
|
|
403
548
|
get children() {
|
|
404
|
-
return
|
|
549
|
+
return $().create;
|
|
405
550
|
}
|
|
406
|
-
}), null),
|
|
551
|
+
}), null), o(x, l(z, {
|
|
407
552
|
size: "sm",
|
|
408
553
|
variant: "ghost-destructive",
|
|
409
554
|
get disabled() {
|
|
410
|
-
return e.disabled ||
|
|
555
|
+
return e.disabled || m();
|
|
411
556
|
},
|
|
412
|
-
onClick: () =>
|
|
557
|
+
onClick: () => n(!1),
|
|
413
558
|
get children() {
|
|
414
|
-
return
|
|
559
|
+
return $().cancel;
|
|
415
560
|
}
|
|
416
|
-
}), null),
|
|
561
|
+
}), null), x;
|
|
417
562
|
}
|
|
418
|
-
}), null),
|
|
563
|
+
}), null), o(w, l(h, {
|
|
419
564
|
get when() {
|
|
420
|
-
return
|
|
565
|
+
return k();
|
|
421
566
|
},
|
|
422
567
|
get children() {
|
|
423
|
-
var
|
|
424
|
-
return
|
|
568
|
+
var x = Re();
|
|
569
|
+
return o(x, () => oe(e, k())), x;
|
|
425
570
|
}
|
|
426
|
-
}), null),
|
|
571
|
+
}), null), w;
|
|
427
572
|
})();
|
|
428
573
|
}
|
|
429
|
-
const
|
|
430
|
-
|
|
574
|
+
const Ge = q;
|
|
575
|
+
ce(["click", "keydown"]);
|
|
431
576
|
export {
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
577
|
+
We as PickerPanel,
|
|
578
|
+
Xe as getParentPath,
|
|
579
|
+
Ge as normalizePath,
|
|
580
|
+
W as pickerCopy,
|
|
581
|
+
oe as pickerErrorMessage,
|
|
582
|
+
Oe as usePickerNavigation
|
|
438
583
|
};
|