@floegence/floe-webapp-core 0.35.37 → 0.35.39

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.
@@ -1,291 +1,395 @@
1
- import { insert as d, createComponent as s, effect as F, className as I, style as Y, memo as H, template as $, setAttribute as Z, setStyleProperty as ee, delegateEvents as te } from "solid-js/web";
2
- import { createSignal as _, createMemo as L, createEffect as A, on as K, For as B, Show as T } from "solid-js";
3
- import { cn as p } from "../../../utils/cn.js";
4
- import { deferAfterPaint as ne } from "../../../utils/defer.js";
5
- import { Button as z } from "../Button.js";
6
- import { Input as W } from "../Input.js";
7
- import { ChevronRight as j, Check as re, X as oe, Plus as le } from "../../icons/index.js";
8
- import { FolderOpenIcon as ie, FileItemIcon as ae } from "../../file-browser/FileIcons.js";
9
- var M = /* @__PURE__ */ $('<div class="flex items-center gap-1.5"><div class=flex-1>'), ce = /* @__PURE__ */ $('<p class="text-[11px] text-muted-foreground -mt-1">Creating in: '), se = /* @__PURE__ */ $("<button type=button><span>New Folder"), ue = /* @__PURE__ */ $('<nav class="flex items-center gap-0.5 min-w-0 overflow-x-auto py-0.5"aria-label="Selected path">'), O = /* @__PURE__ */ $("<button type=button>"), de = /* @__PURE__ */ $('<div class="flex items-center justify-center py-6 text-xs text-muted-foreground">'), he = /* @__PURE__ */ $("<div><button type=button><span>"), fe = /* @__PURE__ */ $("<div class=overflow-hidden>"), ge = /* @__PURE__ */ $('<div class="flex flex-col"><div><button type=button><span class="flex-shrink-0 w-4 h-4"></span><span class=truncate>'), me = /* @__PURE__ */ $('<span class="flex-shrink-0 w-4 h-4">');
10
- function y(e) {
11
- const l = (e ?? "").trim();
12
- if (l === "" || l === "/") return "/";
13
- const n = l.replace(/\/+$/, "");
14
- return n.startsWith("/") ? n : "/" + n;
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 G(e) {
17
- const l = e.split("/").filter(Boolean), n = [];
18
- let r = "";
19
- for (let i = 0; i < l.length - 1; i++)
20
- r += "/" + l[i], n.push(r);
21
- return n;
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 ve(e) {
24
- return L(() => {
25
- const l = /* @__PURE__ */ new Map(), n = (r) => {
26
- for (const i of r)
27
- i.type === "folder" && (l.set(y(i.path), i), i.children?.length && n(i.children));
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 n(e()), l;
29
+ return o(e()), s;
30
30
  });
31
31
  }
32
- function xe(e, l) {
33
- const n = y(e ?? "/"), r = l ? y(l) : void 0;
34
- return !r || r === "/" ? n : n === r ? "/" : n.startsWith(r + "/") ? y(n.slice(r.length)) : n;
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 Ie(e) {
37
- const l = () => (typeof e.homeLabel == "function" ? e.homeLabel() : e.homeLabel) ?? "Root", n = () => {
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 ? y(t) : void 0;
40
- }, r = () => {
39
+ return t ? x(t) : void 0;
40
+ }, a = () => {
41
41
  const t = typeof e.initialPath == "function" ? e.initialPath() : e.initialPath;
42
- return xe(t, n());
43
- }, i = (t) => {
44
- const a = n();
45
- if (!a) return t;
46
- const h = y(t);
47
- return h === "/" ? a : a === "/" ? h : a + h;
48
- }, u = (t) => {
49
- const a = n();
50
- if (!a) return y(t);
51
- const h = y(t);
52
- return h === a ? "/" : a !== "/" && h.startsWith(a + "/") ? h.slice(a.length) || "/" : y(t);
53
- }, [b, v] = _(r()), [P, f] = _(/* @__PURE__ */ new Set(["/"])), [k, o] = _(i(r())), [x, w] = _(""), c = ve(e.files), g = L(() => e.files().filter((t) => t.type === "folder"));
54
- A(K(e.open, (t) => {
55
- if (t) {
56
- const a = r();
57
- v(a), o(i(a)), w("");
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 S = (t) => {
65
- const a = y(t);
66
- return a === "/" || c().has(a);
67
- }, C = (t) => e.filter ? e.filter(t) : !0, E = (t) => {
68
- const a = G(t);
69
- f((h) => {
70
- const m = new Set(h);
71
- for (const D of a) m.add(D);
72
- return m.add(t), m;
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
- }, X = (t) => {
75
- const a = P().has(t);
76
- f((h) => {
77
- const m = new Set(h);
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: a,
153
+ name: r,
99
154
  path: "/"
100
155
  }];
101
- const h = t.split("/").filter(Boolean), m = [{
102
- name: a,
156
+ const c = t.split("/").filter(Boolean), v = [{
157
+ name: r,
103
158
  path: "/"
104
159
  }];
105
- let D = "";
106
- for (const R of h)
107
- D += "/" + R, m.push({
108
- name: R,
109
- path: D
160
+ let y = "";
161
+ for (const D of c)
162
+ y += "/" + D, v.push({
163
+ name: D,
164
+ path: y
110
165
  });
111
- return m;
112
- });
113
- return {
114
- selectedPath: b,
115
- setSelectedPath: v,
116
- expandedPaths: P,
117
- toggleExpand: X,
118
- pathInput: k,
119
- setPathInput: o,
120
- pathInputError: x,
121
- setPathInputError: w,
122
- folderIndex: c,
123
- rootFolders: g,
124
- isValidPath: S,
125
- isSelectable: C,
126
- handleSelectFolder: q,
127
- handleSelectRoot: J,
128
- handlePathInputGo: N,
129
- handlePathInputKeyDown: Q,
130
- expandToPath: E,
131
- breadcrumbSegments: U,
132
- handleBreadcrumbClick: (t) => {
133
- v(t), E(t);
134
- },
135
- homeLabel: l,
136
- toDisplayPath: i
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 pe(e) {
140
- const [l, n] = _(!1), [r, i] = _(""), [u, b] = _(!1), v = () => {
141
- n(!0), i("");
142
- }, P = () => {
143
- n(!1), i("");
144
- }, f = () => {
145
- const o = r().trim();
146
- if (!o || u()) return;
147
- b(!0);
148
- const x = e.parentPath(), w = o, c = e.onCreateFolder;
149
- ne(() => {
150
- c(x, w).then(() => {
151
- n(!1), i("");
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
- b(!1);
224
+ u(!1);
156
225
  });
157
226
  });
158
- }, k = (o) => {
159
- o.key === "Enter" ? (o.preventDefault(), f()) : o.key === "Escape" && (o.preventDefault(), P());
227
+ }, w = (n) => {
228
+ n.key === "Enter" ? (n.preventDefault(), i()) : n.key === "Escape" && (n.preventDefault(), b());
160
229
  };
161
- return s(T, {
230
+ return h(L, {
162
231
  get when() {
163
- return l();
232
+ return s();
164
233
  },
165
234
  get fallback() {
166
235
  return (() => {
167
- var o = se(), x = o.firstChild;
168
- return o.$$click = v, d(o, s(le, {
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
- }), x), F(() => I(o, p("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"))), o;
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 o = M(), x = o.firstChild;
176
- return d(x, s(W, {
244
+ var n = Z(), P = n.firstChild;
245
+ return f(P, h(U, {
177
246
  size: "sm",
178
247
  get value() {
179
- return r();
248
+ return a();
180
249
  },
181
- onInput: (w) => i(w.currentTarget.value),
182
- onKeyDown: k,
250
+ onInput: (S) => l(S.currentTarget.value),
251
+ onKeyDown: w,
183
252
  placeholder: "Folder name",
184
253
  get disabled() {
185
- return u();
254
+ return k();
186
255
  },
187
256
  autofocus: !0
188
- })), d(o, s(z, {
257
+ })), f(n, h(A, {
189
258
  variant: "primary",
190
259
  size: "sm",
191
- onClick: f,
260
+ onClick: i,
192
261
  get loading() {
193
- return u();
262
+ return k();
194
263
  },
195
264
  get disabled() {
196
- return !r().trim();
265
+ return !a().trim();
197
266
  },
198
267
  get children() {
199
- return s(re, {
268
+ return h(ve, {
200
269
  class: "w-3.5 h-3.5"
201
270
  });
202
271
  }
203
- }), null), d(o, s(z, {
272
+ }), null), f(n, h(A, {
204
273
  variant: "ghost-destructive",
205
274
  size: "sm",
206
- onClick: P,
275
+ onClick: b,
207
276
  get disabled() {
208
- return u();
277
+ return k();
209
278
  },
210
279
  get children() {
211
- return s(oe, {
280
+ return h(Pe, {
212
281
  class: "w-3.5 h-3.5"
213
282
  });
214
283
  }
215
- }), null), o;
284
+ }), null), n;
216
285
  })(), (() => {
217
- var o = ce();
218
- return o.firstChild, d(o, (() => {
219
- var x = H(() => !!e.toDisplayPath);
220
- return () => x() ? e.toDisplayPath(e.parentPath()) : e.parentPath();
221
- })(), null), o;
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 Ee(e) {
295
+ function Ge(e) {
227
296
  return (() => {
228
- var l = M(), n = l.firstChild;
229
- return d(n, s(W, {
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: (r) => e.onInput(r.currentTarget.value),
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
- })), d(l, s(z, {
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
- children: "Go"
251
- }), null), l;
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 Fe(e) {
331
+ function He(e) {
255
332
  return (() => {
256
- var l = ue();
257
- return d(l, s(B, {
333
+ var s = $e();
334
+ return f(s, h(K, {
258
335
  get each() {
259
336
  return e.segments();
260
337
  },
261
- children: (n, r) => [s(T, {
338
+ children: (o, a) => [h(L, {
262
339
  get when() {
263
- return r() > 0;
340
+ return a() > 0;
264
341
  },
265
342
  get children() {
266
- return s(j, {
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 i = O();
272
- return i.$$click = () => e.onClick(n.path), d(i, () => n.name), F(() => I(i, p("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", r() === e.segments().length - 1 ? "font-medium text-foreground" : "text-muted-foreground hover:text-foreground hover:bg-muted/50"))), i;
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
- })), l;
351
+ })), s;
275
352
  })();
276
353
  }
277
- function Te(e) {
278
- const l = () => (typeof e.homeLabel == "function" ? e.homeLabel() : e.homeLabel) ?? "Root";
279
- return (() => {
280
- var n = he(), r = n.firstChild, i = r.firstChild;
281
- return r.$$click = () => e.onSelectRoot(), d(r, s(ie, {
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
- }), i), d(i, l), d(n, s(B, {
387
+ }), b), f(b, s), f(u, h(K, {
284
388
  get each() {
285
389
  return e.rootFolders();
286
390
  },
287
- children: (u) => s(V, {
288
- item: u,
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), d(n, s(T, {
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 u = de();
312
- return d(u, () => e.emptyText ?? "No directories available"), u;
419
+ var i = Ce();
420
+ return f(i, () => e.emptyText ?? "No directories available"), i;
313
421
  }
314
- }), null), F((u) => {
315
- var b = p("border border-border rounded overflow-y-auto", e.class), v = e.style, P = p("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");
316
- return b !== u.e && I(n, u.e = b), u.t = Y(n, v, u.t), P !== u.a && I(r, u.a = P), u;
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
- }), n;
429
+ }), u;
322
430
  })();
323
431
  }
324
- function V(e) {
325
- const l = () => e.expandedPaths().has(e.item.path), n = () => e.selectedPath() === e.item.path, r = () => e.isSelectable(e.item), i = L(() => e.item.children?.filter((f) => f.type === "folder") ?? []), u = () => i().length > 0, b = () => e.item.type === "folder", v = (f) => {
326
- f.stopPropagation(), e.onToggle(e.item.path);
327
- }, P = () => {
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
- var f = ge(), k = f.firstChild, o = k.firstChild, x = o.firstChild, w = x.nextSibling;
332
- return d(k, s(T, {
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 b();
444
+ return u();
335
445
  },
336
446
  get fallback() {
337
- return me();
447
+ return Ee();
338
448
  },
339
449
  get children() {
340
- var c = O();
341
- return c.$$click = v, d(c, s(j, {
450
+ var d = ee();
451
+ return d.$$click = m, f(d, h(Y, {
342
452
  class: "w-3 h-3 opacity-60"
343
- })), F((g) => {
344
- var S = p("flex-shrink-0 w-4 h-4 flex items-center justify-center cursor-pointer", "transition-transform duration-150", l() && "rotate-90", "focus:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-ring"), C = l() ? "Collapse folder" : "Expand folder";
345
- return S !== g.e && I(c, g.e = S), C !== g.t && Z(c, "aria-label", g.t = C), g;
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
- }), c;
459
+ }), d;
350
460
  }
351
- }), o), o.$$click = P, d(x, s(ae, {
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 l();
468
+ return s();
357
469
  },
358
470
  class: "w-4 h-4"
359
- })), d(w, () => e.item.name), d(f, s(T, {
471
+ })), f(S, () => e.item.name), f(i, h(L, {
360
472
  get when() {
361
- return H(() => !!l())() && u();
473
+ return Q(() => !!s())() && k();
362
474
  },
363
475
  get children() {
364
- var c = fe();
365
- return d(c, s(B, {
476
+ var d = Ie();
477
+ return f(d, h(K, {
366
478
  get each() {
367
- return i();
479
+ return l();
368
480
  },
369
- children: (g) => s(V, {
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
- })), c;
508
+ })), d;
391
509
  }
392
- }), null), F((c) => {
393
- var g = p("group flex items-center w-full text-xs", "transition-colors duration-100", r() ? "hover:bg-accent/60" : "opacity-50", n() && r() && "bg-accent text-accent-foreground font-medium"), S = `${4 + e.depth * 14}px`, C = !r(), E = p("flex items-center gap-1 flex-1 min-w-0 text-left py-1.5 pl-0.5 pr-2", r() ? "cursor-pointer" : "cursor-not-allowed", "focus:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-ring");
394
- return g !== c.e && I(k, c.e = g), S !== c.t && ee(k, "padding-left", c.t = S), C !== c.a && (o.disabled = c.a = C), E !== c.o && I(o, c.o = E), c;
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
- }), f;
517
+ o: void 0,
518
+ i: void 0
519
+ }), i;
401
520
  })();
402
521
  }
403
- te(["click"]);
522
+ he(["click"]);
404
523
  export {
405
- pe as NewFolderSection,
406
- Ee as PathInputBar,
407
- Fe as PickerBreadcrumb,
408
- Te as PickerFolderTree,
409
- V as PickerTreeNode,
410
- G as getAncestorPaths,
411
- y as normalizePath,
412
- xe as resolvePickerInitialPath,
413
- ve as useFolderIndex,
414
- Ie as usePickerTree
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
  };