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