@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,18 +1,18 @@
1
- import { createComponent as r, mergeProps as m, insert as a, effect as f, setAttribute as d, template as h } from "solid-js/web";
2
- import { createMemo as P, createSignal as b } from "solid-js";
3
- import { cn as v } from "../../utils/cn.js";
1
+ import { createComponent as n, mergeProps as s, insert as i, effect as g, setAttribute as u, template as m } from "solid-js/web";
2
+ import { createMemo as d } from "solid-js";
3
+ import { cn as f } from "../../utils/cn.js";
4
4
  import { Button as o } from "./Button.js";
5
- import { Dialog as C } from "./Dialog.js";
6
- import { usePickerNavigation as x, PickerPanel as S, pickerCopy as k } from "./picker/PickerBase.js";
5
+ import { Dialog as h } from "./Dialog.js";
6
+ import { usePickerNavigation as P, PickerPanel as v, pickerCopy as b } from "./picker/PickerBase.js";
7
7
  import { parsePickerPath as w } from "./picker/PickerNavigation.js";
8
- var y = /* @__PURE__ */ h('<div class="flex w-full items-center gap-2"><span class="min-w-0 flex-1 truncate text-[11px] text-muted-foreground">');
9
- function T(e) {
10
- const l = P(() => [...new Set((e.suggestedPaths ?? []).map((t) => w(t)).filter(Boolean))]), [g, s] = b(!0), i = () => l().length > 0 && g(), n = x(e, () => e.open, void 0, () => s(!0)), u = () => {
11
- if (e.disabled || i() || !n.valid()) return;
12
- const t = n.currentPath();
13
- e.onSelect(t), e.onOpenChange(!1);
8
+ var x = /* @__PURE__ */ m('<div class="flex w-full items-center gap-2"><span class="min-w-0 flex-1 truncate text-[11px] text-muted-foreground">');
9
+ function $(e) {
10
+ const a = d(() => [...new Set((e.suggestedPaths ?? []).map((r) => w(r)).filter(Boolean))]), t = P(e, () => e.open, void 0, void 0, () => a().length ? "suggestions" : "browse"), c = () => {
11
+ if (e.disabled || t.view() !== "browse" || !t.valid()) return;
12
+ const r = t.currentPath();
13
+ e.onSelect(r), e.onOpenChange(!1);
14
14
  };
15
- return r(C, {
15
+ return n(h, {
16
16
  get open() {
17
17
  return e.open;
18
18
  },
@@ -23,50 +23,46 @@ function T(e) {
23
23
  return e.title ?? "Select Directory";
24
24
  },
25
25
  get class() {
26
- return v("max-w-lg", e.class);
26
+ return f("max-w-lg", e.class);
27
27
  },
28
28
  get footer() {
29
29
  return (() => {
30
- var t = y(), c = t.firstChild;
31
- return a(c, () => n.currentPath()), a(t, r(o, {
30
+ var r = x(), l = r.firstChild;
31
+ return i(l, () => t.currentPath()), i(r, n(o, {
32
32
  variant: "ghost",
33
33
  size: "sm",
34
34
  onClick: () => e.onOpenChange(!1),
35
35
  get children() {
36
- return e.cancelText ?? k(e).cancel;
36
+ return e.cancelText ?? b(e).cancel;
37
37
  }
38
- }), null), a(t, r(o, {
38
+ }), null), i(r, n(o, {
39
39
  variant: "primary",
40
40
  size: "sm",
41
- onClick: u,
41
+ onClick: c,
42
42
  get disabled() {
43
- return e.disabled || i() || !n.valid();
43
+ return e.disabled || t.view() !== "browse" || !t.valid();
44
44
  },
45
45
  get children() {
46
46
  return e.confirmText ?? "Select";
47
47
  }
48
- }), null), f(() => d(c, "title", n.currentPath())), t;
48
+ }), null), g(() => u(l, "title", t.currentPath())), r;
49
49
  })();
50
50
  },
51
51
  get children() {
52
- return r(S, m(e, {
53
- source: n,
52
+ return n(v, s(e, {
53
+ source: t,
54
54
  suggestions: {
55
55
  get paths() {
56
- return l();
56
+ return a();
57
57
  },
58
58
  get label() {
59
59
  return e.suggestedPathsLabel ?? "Suggested directories";
60
- },
61
- get visible() {
62
- return i();
63
- },
64
- onVisibilityChange: s
60
+ }
65
61
  }
66
62
  }));
67
63
  }
68
64
  });
69
65
  }
70
66
  export {
71
- T as DirectoryPicker
67
+ $ as DirectoryPicker
72
68
  };
@@ -1,4 +1,4 @@
1
- import { createComponent as u, insert as m, mergeProps as z, spread as K, use as L, effect as j, setAttribute as M, className as V, memo as H, template as b, delegateEvents as R } from "solid-js/web";
1
+ import { createComponent as a, insert as c, mergeProps as z, spread as K, use as L, effect as j, setAttribute as M, className as V, memo as H, template as x, delegateEvents as R } from "solid-js/web";
2
2
  import { createSignal as U, mergeProps as Y, createMemo as q, Show as w, For as G } from "solid-js";
3
3
  import { cn as N } from "../../utils/cn.js";
4
4
  import { deferNonBlocking as J } from "../../utils/defer.js";
@@ -6,53 +6,53 @@ import { Check as Q } from "../icons/index.js";
6
6
  import { FileItemIcon as W } from "../file-browser/FileIcons.js";
7
7
  import { Button as D } from "./Button.js";
8
8
  import { Dialog as X } from "./Dialog.js";
9
- import { usePickerNavigation as Z, PickerPanel as ee, normalizePath as k, pickerCopy as v } from "./picker/PickerBase.js";
9
+ import { usePickerNavigation as Z, PickerPanel as ee, normalizePath as k, pickerCopy as b } from "./picker/PickerBase.js";
10
10
  import { pickerParentPath as te } from "./picker/PickerNavigation.js";
11
- var ne = /* @__PURE__ */ b('<div class="flex flex-col gap-2 -mt-1"><div class="flex min-h-[140px] overflow-hidden rounded border border-border"><div>'), ie = /* @__PURE__ */ b('<div class="flex items-center w-full gap-2"><span class="flex-1 text-[11px] text-muted-foreground truncate">'), le = /* @__PURE__ */ b('<div class="flex h-full items-center justify-center px-4 text-center text-xs text-muted-foreground">'), re = /* @__PURE__ */ b('<span class="ml-auto flex h-5 min-w-5 items-center justify-center rounded-full bg-primary px-1 text-[10px] text-primary-foreground">'), oe = /* @__PURE__ */ b("<button type=button role=option><span class=truncate>");
12
- function ae(e, o) {
13
- const a = y(o), f = /* @__PURE__ */ new Set(), c = [];
11
+ var ne = /* @__PURE__ */ x('<div class="flex min-h-[140px] overflow-hidden rounded border border-border"><div>'), ie = /* @__PURE__ */ x('<div class="flex flex-col gap-2 -mt-1">'), le = /* @__PURE__ */ x('<div class="flex items-center w-full gap-2"><span class="flex-1 text-[11px] text-muted-foreground truncate">'), re = /* @__PURE__ */ x('<div class="flex h-full items-center justify-center px-4 text-center text-xs text-muted-foreground">'), oe = /* @__PURE__ */ x('<span class="ml-auto flex h-5 min-w-5 items-center justify-center rounded-full bg-primary px-1 text-[10px] text-primary-foreground">'), ae = /* @__PURE__ */ x("<button type=button role=option><span class=truncate>");
12
+ function ce(e, s) {
13
+ const u = y(s), f = /* @__PURE__ */ new Set(), d = [];
14
14
  for (const g of e ?? []) {
15
- const s = k(g);
16
- if (!(s === "/" || f.has(s)) && (f.add(s), c.push(s), c.length >= a))
15
+ const i = k(g);
16
+ if (!(i === "/" || f.has(i)) && (f.add(i), d.push(i), d.length >= u))
17
17
  break;
18
18
  }
19
- return c;
19
+ return d;
20
20
  }
21
- function ce(e, o, a, f) {
22
- const c = k(o);
23
- if (c === "/") return [...e];
24
- if (a === "single") return [c];
25
- const g = e.indexOf(c);
26
- return g >= 0 ? e.filter((s, h) => h !== g) : e.length >= y(f) ? [...e] : [...e, c];
21
+ function se(e, s, u, f) {
22
+ const d = k(s);
23
+ if (d === "/") return [...e];
24
+ if (u === "single") return [d];
25
+ const g = e.indexOf(d);
26
+ return g >= 0 ? e.filter((i, h) => h !== g) : e.length >= y(f) ? [...e] : [...e, d];
27
27
  }
28
28
  function y(e) {
29
29
  return e == null || !Number.isFinite(e) ? Number.POSITIVE_INFINITY : Math.max(1, Math.floor(e));
30
30
  }
31
31
  function ke(e) {
32
- const o = () => e.selectionMode ?? "single", [a, f] = U([]), c = () => {
32
+ const s = () => e.selectionMode ?? "single", [u, f] = U([]), d = () => {
33
33
  if (e.initialPath) return e.initialPath;
34
34
  const t = e.initialSelectedPaths?.[0];
35
35
  return t ? te(t) : void 0;
36
36
  }, g = Y(e, {
37
37
  get initialPath() {
38
- return c();
38
+ return d();
39
39
  },
40
40
  get scopeKey() {
41
41
  return e.scopeKey;
42
42
  }
43
- }), s = Z(g, () => e.open, void 0, () => {
44
- f(ae(e.initialSelectedPaths, o() === "single" ? 1 : e.maxSelections));
45
- }), h = q(() => s.entries().filter((t) => t.type === "file" && (!e.fileFilter || e.fileFilter(t)))), T = (t) => a().indexOf(k(t)), A = () => o() === "multiple" && a().length >= y(e.maxSelections), B = (t) => {
46
- f((r) => ce(r, t.path, o(), e.maxSelections));
47
- }, P = (t = a()) => {
48
- if (t.length === 0 || !s.valid()) return;
49
- const r = e.onSelect;
50
- e.onOpenChange(!1), J(() => r([...t]));
51
- }, E = (t, r) => {
52
- let i;
53
- t.key === "ArrowDown" && (i = Math.min(r + 1, h().length - 1)), t.key === "ArrowUp" && (i = Math.max(r - 1, 0)), t.key === "Home" && (i = 0), t.key === "End" && (i = h().length - 1), !(i == null || i < 0) && (t.preventDefault(), S[i]?.focus());
54
- }, S = [];
55
- return u(X, {
43
+ }), i = Z(g, () => e.open, void 0, () => {
44
+ f(ce(e.initialSelectedPaths, s() === "single" ? 1 : e.maxSelections));
45
+ }), h = q(() => i.entries().filter((t) => t.type === "file" && (!e.fileFilter || e.fileFilter(t)))), T = (t) => u().indexOf(k(t)), A = () => s() === "multiple" && u().length >= y(e.maxSelections), B = (t) => {
46
+ f((o) => se(o, t.path, s(), e.maxSelections));
47
+ }, P = (t = u()) => {
48
+ if (e.disabled || t.length === 0 || i.view() !== "browse" || !i.valid()) return;
49
+ const o = e.onSelect;
50
+ e.onOpenChange(!1), J(() => o([...t]));
51
+ }, E = (t, o) => {
52
+ let l;
53
+ t.key === "ArrowDown" && (l = Math.min(o + 1, h().length - 1)), t.key === "ArrowUp" && (l = Math.max(o - 1, 0)), t.key === "Home" && (l = 0), t.key === "End" && (l = h().length - 1), !(l == null || l < 0) && (t.preventDefault(), $[l]?.focus());
54
+ }, $ = [];
55
+ return a(X, {
56
56
  get open() {
57
57
  return e.open;
58
58
  },
@@ -67,23 +67,23 @@ function ke(e) {
67
67
  },
68
68
  get footer() {
69
69
  return (() => {
70
- var t = ie(), r = t.firstChild;
71
- return m(r, (() => {
72
- var i = H(() => a().length === 0);
73
- return () => i() ? v(e).noFilesSelected : v(e).selectedCount(a().length);
74
- })()), m(t, u(D, {
70
+ var t = le(), o = t.firstChild;
71
+ return c(o, (() => {
72
+ var l = H(() => u().length === 0);
73
+ return () => l() ? b(e).noFilesSelected : b(e).selectedCount(u().length);
74
+ })()), c(t, a(D, {
75
75
  variant: "ghost",
76
76
  size: "sm",
77
77
  onClick: () => e.onOpenChange(!1),
78
78
  get children() {
79
- return e.cancelText ?? v(e).cancel;
79
+ return e.cancelText ?? b(e).cancel;
80
80
  }
81
- }), null), m(t, u(D, {
81
+ }), null), c(t, a(D, {
82
82
  variant: "primary",
83
83
  size: "sm",
84
84
  onClick: () => P(),
85
85
  get disabled() {
86
- return a().length === 0 || !s.valid();
86
+ return u().length === 0 || i.view() !== "browse" || !i.valid();
87
87
  },
88
88
  get children() {
89
89
  return e.confirmText ?? "Select";
@@ -92,82 +92,90 @@ function ke(e) {
92
92
  })();
93
93
  },
94
94
  get children() {
95
- var t = ne(), r = t.firstChild, i = r.firstChild;
96
- return m(t, u(ee, z(e, {
97
- source: s
98
- })), r), K(i, z(() => e.scrollViewportProps, {
99
- class: "max-h-[200px] min-h-[140px] min-w-0 flex-1 overflow-y-auto",
100
- role: "listbox",
101
- get "aria-multiselectable"() {
102
- return o() === "multiple" ? "true" : void 0;
103
- }
104
- }), !1, !0), m(i, u(w, {
95
+ var t = ie();
96
+ return c(t, a(ee, z(e, {
97
+ source: i
98
+ })), null), c(t, a(w, {
105
99
  get when() {
106
- return h().length > 0;
107
- },
108
- get fallback() {
109
- return (() => {
110
- var d = le();
111
- return m(d, () => e.emptyText ?? v(e).emptyFiles), d;
112
- })();
100
+ return i.view() === "browse";
113
101
  },
114
102
  get children() {
115
- return u(G, {
116
- get each() {
117
- return h();
103
+ var o = ne(), l = o.firstChild;
104
+ return K(l, z(() => e.scrollViewportProps, {
105
+ class: "max-h-[200px] min-h-[140px] min-w-0 flex-1 overflow-y-auto",
106
+ role: "listbox",
107
+ get "aria-multiselectable"() {
108
+ return s() === "multiple" ? "true" : void 0;
109
+ }
110
+ }), !1, !0), c(l, a(w, {
111
+ get when() {
112
+ return h().length > 0;
118
113
  },
119
- children: (d, $) => {
120
- const x = () => T(d.path), F = () => A() && x() < 0;
114
+ get fallback() {
121
115
  return (() => {
122
- var l = oe(), C = l.firstChild;
123
- return l.$$keydown = (n) => E(n, $()), l.$$dblclick = () => {
124
- o() === "single" && P([k(d.path)]);
125
- }, l.$$click = () => B(d), L((n) => {
126
- S[$()] = n;
127
- }, l), m(l, u(W, {
128
- item: d,
129
- size: 16,
130
- class: "w-4 h-4 flex-shrink-0"
131
- }), C), m(C, () => d.name), m(l, u(w, {
132
- get when() {
133
- return x() >= 0;
134
- },
135
- get children() {
136
- var n = re();
137
- return m(n, u(w, {
116
+ var m = re();
117
+ return c(m, () => e.emptyText ?? b(e).emptyFiles), m;
118
+ })();
119
+ },
120
+ get children() {
121
+ return a(G, {
122
+ get each() {
123
+ return h();
124
+ },
125
+ children: (m, S) => {
126
+ const v = () => T(m.path), F = () => A() && v() < 0;
127
+ return (() => {
128
+ var r = ae(), _ = r.firstChild;
129
+ return r.$$keydown = (n) => E(n, S()), r.$$dblclick = () => {
130
+ s() === "single" && P([k(m.path)]);
131
+ }, r.$$click = () => B(m), L((n) => {
132
+ $[S()] = n;
133
+ }, r), c(r, a(W, {
134
+ item: m,
135
+ size: 16,
136
+ class: "w-4 h-4 flex-shrink-0"
137
+ }), _), c(_, () => m.name), c(r, a(w, {
138
138
  get when() {
139
- return o() === "multiple";
140
- },
141
- get fallback() {
142
- return u(Q, {
143
- class: "h-3 w-3"
144
- });
139
+ return v() >= 0;
145
140
  },
146
141
  get children() {
147
- return x() + 1;
142
+ var n = oe();
143
+ return c(n, a(w, {
144
+ get when() {
145
+ return s() === "multiple";
146
+ },
147
+ get fallback() {
148
+ return a(Q, {
149
+ class: "h-3 w-3"
150
+ });
151
+ },
152
+ get children() {
153
+ return v() + 1;
154
+ }
155
+ })), n;
148
156
  }
149
- })), n;
150
- }
151
- }), null), j((n) => {
152
- var _ = x() >= 0, I = F(), O = F() ? v(e).selectionLimit : d.name, p = N("flex min-h-9 w-full cursor-pointer items-center gap-2 px-2 py-1.5 text-left text-xs", "transition-colors duration-100 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-45", x() >= 0 && "bg-accent text-accent-foreground font-medium");
153
- return _ !== n.e && M(l, "aria-selected", n.e = _), I !== n.t && (l.disabled = n.t = I), O !== n.a && M(l, "title", n.a = O), p !== n.o && V(l, n.o = p), n;
154
- }, {
155
- e: void 0,
156
- t: void 0,
157
- a: void 0,
158
- o: void 0
159
- }), l;
160
- })();
157
+ }), null), j((n) => {
158
+ var C = v() >= 0, I = F(), O = F() ? b(e).selectionLimit : m.name, p = N("flex min-h-9 w-full cursor-pointer items-center gap-2 px-2 py-1.5 text-left text-xs", "transition-colors duration-100 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-45", v() >= 0 && "bg-accent text-accent-foreground font-medium");
159
+ return C !== n.e && M(r, "aria-selected", n.e = C), I !== n.t && (r.disabled = n.t = I), O !== n.a && M(r, "title", n.a = O), p !== n.o && V(r, n.o = p), n;
160
+ }, {
161
+ e: void 0,
162
+ t: void 0,
163
+ a: void 0,
164
+ o: void 0
165
+ }), r;
166
+ })();
167
+ }
168
+ });
161
169
  }
162
- });
170
+ })), o;
163
171
  }
164
- })), t;
172
+ }), null), t;
165
173
  }
166
174
  });
167
175
  }
168
176
  R(["click", "dblclick", "keydown"]);
169
177
  export {
170
178
  ke as FileOpenPicker,
171
- ae as normalizeFileOpenSelection,
172
- ce as updateFileOpenSelection
179
+ ce as normalizeFileOpenSelection,
180
+ se as updateFileOpenSelection
173
181
  };
@@ -1,44 +1,44 @@
1
- import { createComponent as a, insert as n, mergeProps as _, spread as z, effect as F, className as B, setAttribute as E, template as m, delegateEvents as D } from "solid-js/web";
2
- import { createSignal as C, createMemo as k, createEffect as I, on as O, Show as w, For as K } from "solid-js";
3
- import { cn as N } from "../../utils/cn.js";
1
+ import { createComponent as a, insert as n, mergeProps as _, spread as z, effect as b, className as B, setAttribute as E, template as u, delegateEvents as D } from "solid-js/web";
2
+ import { createSignal as F, createMemo as k, createEffect as I, on as O, Show as x, For as K } from "solid-js";
3
+ import { cn as C } from "../../utils/cn.js";
4
4
  import { Dialog as T } from "./Dialog.js";
5
- import { Button as b } from "./Button.js";
5
+ import { Button as N } from "./Button.js";
6
6
  import { Input as M } from "./Input.js";
7
7
  import { FileItemIcon as j } from "../file-browser/FileIcons.js";
8
8
  import { deferNonBlocking as q } from "../../utils/defer.js";
9
9
  import { usePickerNavigation as A, PickerPanel as R, pickerCopy as g } from "./picker/PickerBase.js";
10
- var V = /* @__PURE__ */ m('<div class="flex flex-col gap-2 -mt-1"><div class="flex min-h-[100px] overflow-hidden rounded border border-border"><div>'), G = /* @__PURE__ */ m('<div class="flex flex-col w-full gap-2"><div class="flex items-center gap-1.5"><label class="text-xs text-muted-foreground flex-shrink-0"></label><div class=flex-1></div></div><div class="flex items-center gap-2"><span class="flex-1 text-[11px] text-muted-foreground truncate">'), H = /* @__PURE__ */ m('<div class="flex items-center justify-center h-full text-xs text-muted-foreground">'), J = /* @__PURE__ */ m('<span class="ml-auto text-[10px] text-muted-foreground/60 flex-shrink-0">'), L = /* @__PURE__ */ m("<button type=button><span class=truncate>");
11
- function le(e) {
12
- const [c, x] = C(e.initialFileName ?? ""), [p, u] = C(""), s = A(e, () => e.open, void 0, () => {
13
- x(e.initialFileName ?? ""), u("");
14
- }), h = k(() => s.entries().filter((t) => t.type === "file"));
15
- I(O(c, () => {
16
- u("");
10
+ var V = /* @__PURE__ */ u('<div class="flex min-h-[100px] overflow-hidden rounded border border-border"><div>'), G = /* @__PURE__ */ u('<div class="flex flex-col gap-2 -mt-1">'), H = /* @__PURE__ */ u('<div class="flex flex-col w-full gap-2"><div class="flex items-center gap-1.5"><label class="text-xs text-muted-foreground flex-shrink-0"></label><div class=flex-1></div></div><div class="flex items-center gap-2"><span class="flex-1 text-[11px] text-muted-foreground truncate">'), J = /* @__PURE__ */ u('<div class="flex items-center justify-center h-full text-xs text-muted-foreground">'), L = /* @__PURE__ */ u('<span class="ml-auto text-[10px] text-muted-foreground/60 flex-shrink-0">'), Q = /* @__PURE__ */ u("<button type=button><span class=truncate>");
11
+ function ie(e) {
12
+ const [s, v] = F(e.initialFileName ?? ""), [p, m] = F(""), o = A(e, () => e.open, void 0, () => {
13
+ v(e.initialFileName ?? ""), m("");
14
+ }), h = k(() => o.entries().filter((t) => t.type === "file"));
15
+ I(O(s, () => {
16
+ m("");
17
17
  }));
18
18
  const S = (t) => {
19
- x(t.name), u("");
20
- }, v = () => {
21
- if (!s.valid()) return;
22
- const t = c().trim();
19
+ v(t.name), m("");
20
+ }, $ = () => {
21
+ if (e.disabled || o.view() !== "browse" || !o.valid()) return;
22
+ const t = s().trim();
23
23
  if (!t) {
24
- u(g(e).fileNameRequired);
24
+ m(g(e).fileNameRequired);
25
25
  return;
26
26
  }
27
27
  if (e.validateFileName) {
28
28
  const r = e.validateFileName(t);
29
29
  if (r) {
30
- u(r);
30
+ m(r);
31
31
  return;
32
32
  }
33
33
  }
34
- const l = s.currentPath(), o = e.onSave;
35
- e.onOpenChange(!1), q(() => o(l, t));
34
+ const l = o.currentPath(), c = e.onSave;
35
+ e.onOpenChange(!1), q(() => c(l, t));
36
36
  }, P = () => {
37
37
  e.onOpenChange(!1);
38
38
  }, y = (t) => {
39
- t.key === "Enter" && (t.preventDefault(), v());
40
- }, $ = k(() => {
41
- const t = s.currentPath(), l = c().trim();
39
+ t.key === "Enter" && (t.preventDefault(), $());
40
+ }, w = k(() => {
41
+ const t = o.currentPath(), l = s().trim();
42
42
  return l ? t === "/" ? `/${l}` : `${t}/${l}` : t;
43
43
  });
44
44
  return a(T, {
@@ -52,89 +52,97 @@ function le(e) {
52
52
  return e.title ?? "Save File";
53
53
  },
54
54
  get class() {
55
- return N("max-w-2xl", e.class);
55
+ return C("max-w-2xl", e.class);
56
56
  },
57
57
  get footer() {
58
58
  return (() => {
59
- var t = G(), l = t.firstChild, o = l.firstChild, r = o.nextSibling, i = l.nextSibling, f = i.firstChild;
60
- return n(o, () => g(e).fileName), n(r, a(M, {
59
+ var t = H(), l = t.firstChild, c = l.firstChild, r = c.nextSibling, i = l.nextSibling, f = i.firstChild;
60
+ return n(c, () => g(e).fileName), n(r, a(M, {
61
61
  size: "sm",
62
62
  get value() {
63
- return c();
63
+ return s();
64
64
  },
65
- onInput: (d) => x(d.currentTarget.value),
65
+ onInput: (d) => v(d.currentTarget.value),
66
66
  onKeyDown: y,
67
67
  placeholder: "filename.ext",
68
68
  get error() {
69
69
  return p();
70
70
  }
71
- })), n(f, $), n(i, a(b, {
71
+ })), n(f, w), n(i, a(N, {
72
72
  variant: "ghost",
73
73
  size: "sm",
74
74
  onClick: P,
75
75
  get children() {
76
76
  return e.cancelText ?? g(e).cancel;
77
77
  }
78
- }), null), n(i, a(b, {
78
+ }), null), n(i, a(N, {
79
79
  variant: "primary",
80
80
  size: "sm",
81
- onClick: v,
81
+ onClick: $,
82
82
  get disabled() {
83
- return !c().trim() || !s.valid();
83
+ return !s().trim() || o.view() !== "browse" || !o.valid();
84
84
  },
85
85
  get children() {
86
86
  return e.confirmText ?? "Save";
87
87
  }
88
- }), null), F(() => E(f, "title", $())), t;
88
+ }), null), b(() => E(f, "title", w())), t;
89
89
  })();
90
90
  },
91
91
  get children() {
92
- var t = V(), l = t.firstChild, o = l.firstChild;
92
+ var t = G();
93
93
  return n(t, a(R, _(e, {
94
- source: s
95
- })), l), z(o, _(() => e.scrollViewportProps, {
96
- class: "max-h-[160px] w-full min-w-0 overflow-y-auto"
97
- }), !1, !0), n(o, a(w, {
94
+ source: o
95
+ })), null), n(t, a(x, {
98
96
  get when() {
99
- return h().length > 0;
100
- },
101
- get fallback() {
102
- return (() => {
103
- var r = H();
104
- return n(r, () => g(e).emptyFiles), r;
105
- })();
97
+ return o.view() === "browse";
106
98
  },
107
99
  get children() {
108
- return a(K, {
109
- get each() {
110
- return h();
100
+ var l = V(), c = l.firstChild;
101
+ return z(c, _(() => e.scrollViewportProps, {
102
+ class: "max-h-[160px] w-full min-w-0 overflow-y-auto"
103
+ }), !1, !0), n(c, a(x, {
104
+ get when() {
105
+ return h().length > 0;
106
+ },
107
+ get fallback() {
108
+ return (() => {
109
+ var r = J();
110
+ return n(r, () => g(e).emptyFiles), r;
111
+ })();
111
112
  },
112
- children: (r) => (() => {
113
- var i = L(), f = i.firstChild;
114
- return i.$$click = () => S(r), n(i, a(j, {
115
- item: r,
116
- size: 16,
117
- class: "w-4 h-4 flex-shrink-0"
118
- }), f), n(f, () => r.name), n(i, a(w, {
119
- get when() {
120
- return r.size != null;
113
+ get children() {
114
+ return a(K, {
115
+ get each() {
116
+ return h();
121
117
  },
122
- get children() {
123
- var d = J();
124
- return n(d, () => Q(r.size)), d;
125
- }
126
- }), null), F(() => B(i, N("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", c() === r.name && "bg-accent text-accent-foreground font-medium"))), i;
127
- })()
128
- });
118
+ children: (r) => (() => {
119
+ var i = Q(), f = i.firstChild;
120
+ return i.$$click = () => S(r), n(i, a(j, {
121
+ item: r,
122
+ size: 16,
123
+ class: "w-4 h-4 flex-shrink-0"
124
+ }), f), n(f, () => r.name), n(i, a(x, {
125
+ get when() {
126
+ return r.size != null;
127
+ },
128
+ get children() {
129
+ var d = L();
130
+ return n(d, () => U(r.size)), d;
131
+ }
132
+ }), null), b(() => B(i, C("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", s() === r.name && "bg-accent text-accent-foreground font-medium"))), i;
133
+ })()
134
+ });
135
+ }
136
+ })), l;
129
137
  }
130
- })), t;
138
+ }), null), t;
131
139
  }
132
140
  });
133
141
  }
134
- function Q(e) {
142
+ function U(e) {
135
143
  return e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : `${(e / (1024 * 1024)).toFixed(1)} MB`;
136
144
  }
137
145
  D(["click"]);
138
146
  export {
139
- le as FileSavePicker
147
+ ie as FileSavePicker
140
148
  };
@@ -47,3 +47,5 @@ export { SurfaceAnchoredLayer, type SurfaceAnchoredLayerProps } from './SurfaceA
47
47
  export { PersistentHorizontalScrollbar, type PersistentHorizontalScrollbarProps } from './PersistentHorizontalScrollbar';
48
48
  export { SettingsLayout, SettingsNavigation, SettingsSection, SettingsList, SettingRow, type SettingsNavigationItem, type SettingsNavigationGroup, type SettingsNavigationProps, type SettingsSectionProps, type SettingRowProps, } from './Settings';
49
49
  export { KeyedFor, type KeyedForProps } from './KeyedFor';
50
+ export { DirectoryFavoriteButton } from './picker/DirectoryFavorites';
51
+ export type { DirectoryFavorites } from './picker/DirectoryFavorites';
@@ -0,0 +1,29 @@
1
+ import { type JSX } from 'solid-js';
2
+ import type { PickerCopy } from './PickerNavigation';
3
+ /** Controlled navigation metadata. The host owns authentication, persistence and refresh. */
4
+ export interface DirectoryFavorites {
5
+ paths: readonly string[];
6
+ loading?: boolean;
7
+ error?: string;
8
+ editable?: boolean;
9
+ pendingPaths?: readonly string[];
10
+ onRefresh?: () => void | Promise<void>;
11
+ onSetFavorite?: (path: string, favorite: boolean) => Promise<void>;
12
+ }
13
+ export declare function DirectoryFavoriteButton(props: {
14
+ path: string;
15
+ favorites: DirectoryFavorites;
16
+ copy: PickerCopy;
17
+ disabled?: boolean;
18
+ onError?: (message: string) => void;
19
+ }): JSX.Element;
20
+ /** A navigation button and favorite action are siblings; the menu captures its target on open. */
21
+ export declare function PickerDirectoryRow(props: {
22
+ path: string;
23
+ favorites?: DirectoryFavorites;
24
+ copy: PickerCopy;
25
+ disabled?: boolean;
26
+ scopeKey?: string;
27
+ children: JSX.Element;
28
+ onError: (message: string) => void;
29
+ }): JSX.Element;