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