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