@floegence/floe-webapp-core 0.86.65 → 0.86.67

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,91 +1,91 @@
1
- import { insert as s, createComponent as l, use as H, setAttribute as v, effect as P, className as ce, memo as C, spread as te, mergeProps as re, template as f, delegateEvents as de } from "solid-js/web";
2
- import { createSignal as E, createEffect as T, on as ae, untrack as ue, createMemo as V, createUniqueId as ve, Show as h, For as N } from "solid-js";
3
- import { cn as L } from "../../../utils/cn.js";
4
- import { FileItemIcon as ge } from "../../file-browser/FileIcons.js";
5
- import { FolderOpen as le, ChevronRight as q } from "../../icons/index.js";
6
- import { Button as z } from "../Button.js";
7
- import { Input as U } 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 j, 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-[var(--floe-line)]">'), 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-xs 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-[var(--floe-ink-soft)]"><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-xs px-1 py-0.5 hover:bg-[var(--floe-state-hover)] focus-visible:ring-1 focus-visible:ring-ring">'), ne = /* @__PURE__ */ f('<p class="px-3 py-6 text-center text-xs text-[var(--floe-ink-soft)]"role=status>'), ze = /* @__PURE__ */ f('<p class="px-3 py-6 text-center text-xs text-[var(--floe-ink-soft)]">'), 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-[var(--floe-state-selected)] 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-sm px-2 py-2.5 text-left hover:bg-[var(--floe-state-selected)] 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-caption text-[var(--floe-ink-soft)]">'), 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) {
1
+ import { insert as o, createComponent as l, use as O, setAttribute as f, effect as I, className as ce, memo as M, spread as re, mergeProps as ie, template as g, delegateEvents as ue } from "solid-js/web";
2
+ import { createSignal as N, createEffect as q, on as Y, untrack as de, createMemo as T, createUniqueId as fe, Show as m, For as j, onCleanup as ge } from "solid-js";
3
+ import { cn as W } from "../../../utils/cn.js";
4
+ import { FileItemIcon as ve } from "../../file-browser/FileIcons.js";
5
+ import { FolderOpen as oe, ChevronRight as J } from "../../icons/index.js";
6
+ import { Button as R } from "../Button.js";
7
+ import { Input as Q } from "../Input.js";
8
+ import { PickerDirectoryRow as ne, DirectoryFavoriteButton as he } from "./DirectoryFavorites.js";
9
+ import { resolveTabNavigationTargetId as be } from "../Tabs.js";
10
+ import { createFilesystemPickerDataSource as me, parsePickerPath as X, defaultPickerCopy as we, PickerNavigationError as xe } from "./PickerNavigation.js";
11
+ import { pickerParentPath as Ze } from "./PickerNavigation.js";
12
+ var ye = /* @__PURE__ */ g('<div role=tablist class="mb-1 flex min-w-0 items-center gap-4 border-b border-[var(--floe-line)]">'), ke = /* @__PURE__ */ g('<div class="flex min-w-0 items-start gap-1.5"><div class="min-w-0 flex-1">'), $e = /* @__PURE__ */ g('<div role=alert class="flex items-center gap-2 text-xs text-error"><span class="min-w-0 flex-1 break-words">'), pe = /* @__PURE__ */ g('<div class="flex items-start gap-2 rounded-xs 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">'), ae = /* @__PURE__ */ g("<div>"), _e = /* @__PURE__ */ g('<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__ */ g('<div class="flex flex-wrap items-center gap-1">'), Fe = /* @__PURE__ */ g("<button type=button role=tab>"), Ce = /* @__PURE__ */ g('<nav class="flex min-w-0 flex-wrap items-center gap-0.5 text-xs">'), Ie = /* @__PURE__ */ g("<span role=status>"), Ee = /* @__PURE__ */ g('<div class="flex flex-wrap items-center justify-between gap-2 text-xs text-[var(--floe-ink-soft)]"><label class="flex cursor-pointer items-center gap-1.5"><input type=checkbox class=cursor-pointer>'), ze = /* @__PURE__ */ g('<button type=button class="max-w-full cursor-pointer truncate rounded-xs px-1 py-0.5 hover:bg-[var(--floe-state-hover)] focus-visible:ring-1 focus-visible:ring-ring">'), le = /* @__PURE__ */ g('<p class="px-3 py-6 text-center text-xs text-[var(--floe-ink-soft)]"role=status>'), Ae = /* @__PURE__ */ g('<p class="px-3 py-6 text-center text-xs text-[var(--floe-ink-soft)]">'), Me = /* @__PURE__ */ g('<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-[var(--floe-state-selected)] 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">'), De = /* @__PURE__ */ g('<button type=button class="flex min-h-14 min-w-0 flex-1 cursor-pointer items-center gap-3 rounded-sm px-2 py-2.5 text-left hover:bg-[var(--floe-state-selected)] 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-caption text-[var(--floe-ink-soft)]">'), Ve = /* @__PURE__ */ g('<div class="flex flex-wrap items-center gap-1.5"><div class="flex shrink-0 items-center gap-1.5">'), Ne = /* @__PURE__ */ g('<p role=alert class="mt-1 break-words text-xs text-error">'), Re = /* @__PURE__ */ g("<div data-picker-create-folder>");
13
+ function Z(e) {
14
14
  return {
15
- ...me,
15
+ ...we,
16
16
  ...e.copy
17
17
  };
18
18
  }
19
- function se(e, o) {
20
- const n = W(e);
21
- return o instanceof we ? n[o.kind] : e.formatError?.(o) || (o instanceof Error ? o.message : "") || n.loadFailed;
19
+ function se(e, s) {
20
+ const n = Z(e);
21
+ return s instanceof xe ? n[s.kind] : e.formatError?.(s) || (s instanceof Error ? s.message : "") || n.loadFailed;
22
22
  }
23
- function Oe(e, o, n, y, _ = () => "browse") {
24
- const [m, F] = E("browse"), k = be(() => e, n);
25
- return T(ae(() => [o(), 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
23
+ function We(e, s, n, y, p = () => "browse") {
24
+ const [x, _] = N("browse"), P = me(() => e, n);
25
+ return q(Y(() => [s(), e.scopeKey], ([E]) => {
26
+ P.close(), E && (_(p()), e.directoryFavorites?.onRefresh?.(), y?.(), P.open(e.initialPath));
27
+ })), q(() => e.onValidityChange?.(P.valid() && x() === "browse")), {
28
+ ...P,
29
+ view: x,
30
+ setView: _
31
31
  };
32
32
  }
33
- function We(e) {
34
- const o = () => W(e), n = ue(() => e.source), y = V(() => n.entries().filter((c) => c.type === "folder")), _ = V(() => n.context()?.roots.filter((c) => !c.hidden) ?? []), m = ve(), [F, k] = E(""), [I, $] = E(""), A = () => n.view() !== "browse", w = () => !!(e.suggestions?.paths.length || e.directoryFavorites), x = V(() => [...new Set((e.directoryFavorites?.paths ?? []).map((c) => j(c)).filter(Boolean))]), D = V(() => n.view() === "suggestions" ? e.suggestions?.paths ?? [] : x().filter((c) => c.toLocaleLowerCase().includes(F().trim().toLocaleLowerCase())));
35
- T(ae(() => e.scopeKey, () => {
36
- k(""), $("");
33
+ function Je(e) {
34
+ const s = () => Z(e), n = de(() => e.source), y = T(() => n.entries().filter((c) => c.type === "folder")), p = T(() => n.context()?.roots.filter((c) => !c.hidden) ?? []), x = fe(), [_, P] = N(""), [E, F] = N(""), k = () => n.view() !== "browse", z = () => !!(e.suggestions?.paths.length || e.directoryFavorites), B = T(() => [...new Set((e.directoryFavorites?.paths ?? []).map((c) => X(c)).filter(Boolean))]), K = T(() => n.view() === "suggestions" ? e.suggestions?.paths ?? [] : B().filter((c) => c.toLocaleLowerCase().includes(_().trim().toLocaleLowerCase())));
35
+ q(Y(() => e.scopeKey, () => {
36
+ P(""), F("");
37
37
  }));
38
- let K;
39
- const G = V(() => [...e.suggestions?.paths.length ? [{
38
+ let S;
39
+ const H = T(() => [...e.suggestions?.paths.length ? [{
40
40
  id: "suggestions",
41
41
  label: e.suggestions.label,
42
42
  disabled: e.disabled
43
43
  }] : [], ...e.directoryFavorites ? [{
44
44
  id: "favorites",
45
- label: o().favorites,
45
+ label: s().favorites,
46
46
  disabled: e.disabled
47
- }] : [], ..._().map((c) => ({
47
+ }] : [], ...p().map((c) => ({
48
48
  id: `root:${c.id}`,
49
49
  label: c.label,
50
50
  path: c.pathAbs,
51
51
  disabled: e.disabled || c.permissions?.read === !1
52
- }))]), B = () => {
53
- if (A()) return n.view();
54
- const c = j(n.pathInput(), n.context()?.homePathAbs);
55
- return `root:${_().filter((i) => c === i.pathAbs || c.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 = (c, b, i, t) => {
52
+ }))]), D = () => {
53
+ if (k()) return n.view();
54
+ const c = X(n.pathInput(), n.context()?.homePathAbs);
55
+ return `root:${p().filter((i) => c === i.pathAbs || c.startsWith(i.pathAbs.replace(/\/$/, "") + "/")).sort((i, t) => t.pathAbs.length - i.pathAbs.length)[0]?.id ?? n.context()?.defaultRootId ?? p()[0]?.id}`;
56
+ }, A = /* @__PURE__ */ new Map(), b = [], $ = (c, w, i, t) => {
57
57
  let a;
58
- c.key === "ArrowDown" && (a = Math.min(b + 1, t - 1)), c.key === "ArrowUp" && (a = Math.max(0, b - 1)), c.key === "Home" && (a = 0), c.key === "End" && (a = t - 1), a !== void 0 && (c.preventDefault(), c.stopPropagation(), i[a]?.focus(), i[a]?.scrollIntoView?.({
58
+ c.key === "ArrowDown" && (a = Math.min(w + 1, t - 1)), c.key === "ArrowUp" && (a = Math.max(0, w - 1)), c.key === "Home" && (a = 0), c.key === "End" && (a = t - 1), a !== void 0 && (c.preventDefault(), c.stopPropagation(), i[a]?.focus(), i[a]?.scrollIntoView?.({
59
59
  block: "nearest"
60
60
  }));
61
- }, oe = V(() => {
61
+ }, v = T(() => {
62
62
  const c = n.currentPath();
63
63
  if (!c) return [];
64
- let b = "";
64
+ let w = "";
65
65
  return [{
66
66
  path: "/",
67
- name: o().root
68
- }, ...c.split("/").filter(Boolean).map((i) => (b += `/${i}`, {
69
- path: b,
67
+ name: s().root
68
+ }, ...c.split("/").filter(Boolean).map((i) => (w += `/${i}`, {
69
+ path: w,
70
70
  name: i
71
71
  }))];
72
- }), Y = [], S = (c) => {
73
- n.setView("browse"), n.navigate(c), K?.focus();
74
- }, Z = () => S(n.pathInput());
72
+ }), V = [], G = (c) => {
73
+ n.setView("browse"), n.navigate(c), S?.focus();
74
+ }, ee = () => G(n.pathInput());
75
75
  return (() => {
76
- var c = pe(), b = c.firstChild;
77
- return s(c, l(h, {
76
+ var c = _e(), w = c.firstChild;
77
+ return o(c, l(m, {
78
78
  get when() {
79
- return w();
79
+ return z();
80
80
  },
81
81
  get fallback() {
82
82
  return (() => {
83
83
  var i = Pe();
84
- return s(i, l(N, {
84
+ return o(i, l(j, {
85
85
  get each() {
86
- return _();
86
+ return p();
87
87
  },
88
- children: (t) => l(z, {
88
+ children: (t) => l(R, {
89
89
  type: "button",
90
90
  size: "sm",
91
91
  get variant() {
@@ -104,25 +104,25 @@ function We(e) {
104
104
  return t.label;
105
105
  }
106
106
  })
107
- })), P(() => v(i, "aria-label", o().roots)), i;
107
+ })), I(() => f(i, "aria-label", s().roots)), i;
108
108
  })();
109
109
  },
110
110
  get children() {
111
- var i = xe();
112
- return s(i, l(N, {
111
+ var i = ye();
112
+ return o(i, l(j, {
113
113
  get each() {
114
- return G();
114
+ return H();
115
115
  },
116
116
  children: (t) => (() => {
117
- var a = _e();
117
+ var a = Fe();
118
118
  return a.$$keydown = (r) => {
119
- const u = he(G(), t.id, r.key);
120
- u && (r.preventDefault(), r.stopPropagation(), J.get(u)?.focus());
119
+ const d = be(H(), t.id, r.key);
120
+ d && (r.preventDefault(), r.stopPropagation(), A.get(d)?.focus());
121
121
  }, a.$$click = () => {
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), v(a, "aria-controls", m), s(a, () => t.label), P((r) => {
124
- var u = `${m}-${t.id}`, g = B() === t.id, p = B() === t.id ? 0 : -1, d = 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-[var(--floe-accent-ink)]" : "border-transparent text-[var(--floe-ink-soft)] hover:text-foreground");
125
- return u !== r.e && v(a, "id", r.e = u), g !== r.t && v(a, "aria-selected", r.t = g), p !== r.a && v(a, "tabindex", r.a = p), d !== r.o && (a.disabled = r.o = d), R !== r.i && v(a, "title", r.i = R), M !== r.n && ce(a, r.n = M), r;
122
+ "path" in t ? G(t.path) : (n.setView(t.id), t.id === "favorites" && e.directoryFavorites?.onRefresh?.());
123
+ }, O((r) => A.set(t.id, r), a), f(a, "aria-controls", x), o(a, () => t.label), I((r) => {
124
+ var d = `${x}-${t.id}`, h = D() === t.id, C = D() === t.id ? 0 : -1, u = t.disabled, L = "path" in t ? t.path : t.label, U = W("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", D() === t.id ? "border-primary text-[var(--floe-accent-ink)]" : "border-transparent text-[var(--floe-ink-soft)] hover:text-foreground");
125
+ return d !== r.e && f(a, "id", r.e = d), h !== r.t && f(a, "aria-selected", r.t = h), C !== r.a && f(a, "tabindex", r.a = C), u !== r.o && (a.disabled = r.o = u), L !== r.i && f(a, "title", r.i = L), U !== r.n && ce(a, r.n = U), r;
126
126
  }, {
127
127
  e: void 0,
128
128
  t: void 0,
@@ -132,22 +132,22 @@ function We(e) {
132
132
  n: void 0
133
133
  }), a;
134
134
  })()
135
- })), P(() => v(i, "aria-label", o().roots)), i;
135
+ })), I(() => f(i, "aria-label", s().roots)), i;
136
136
  }
137
- }), b), v(b, "id", m), s(b, l(h, {
137
+ }), w), f(w, "id", x), o(w, l(m, {
138
138
  get when() {
139
- return !A();
139
+ return !k();
140
140
  },
141
141
  get children() {
142
- var i = ye(), t = i.firstChild;
143
- return s(t, l(U, {
142
+ var i = ke(), t = i.firstChild;
143
+ return o(t, l(Q, {
144
144
  ref(a) {
145
- var r = K;
146
- typeof r == "function" ? r(a) : K = a;
145
+ var r = S;
146
+ typeof r == "function" ? r(a) : S = a;
147
147
  },
148
148
  size: "sm",
149
149
  get "aria-label"() {
150
- return o().path;
150
+ return s().path;
151
151
  },
152
152
  placeholder: "/",
153
153
  get value() {
@@ -158,47 +158,47 @@ function We(e) {
158
158
  },
159
159
  onInput: (a) => n.setPathInput(a.currentTarget.value),
160
160
  onKeyDown: (a) => {
161
- a.key === "Enter" && (a.preventDefault(), a.stopPropagation(), Z());
161
+ a.key === "Enter" && (a.preventDefault(), a.stopPropagation(), ee());
162
162
  }
163
- })), s(i, l(z, {
163
+ })), o(i, l(R, {
164
164
  size: "sm",
165
165
  variant: "outline",
166
- onClick: Z,
166
+ onClick: ee,
167
167
  get disabled() {
168
168
  return e.disabled || !n.context() || !n.pathInput();
169
169
  },
170
170
  get children() {
171
- return o().go;
171
+ return s().go;
172
172
  }
173
173
  }), null), i;
174
174
  }
175
- }), null), s(b, l(h, {
175
+ }), null), o(w, l(m, {
176
176
  get when() {
177
- return I() || e.directoryFavorites?.error;
177
+ return E() || e.directoryFavorites?.error;
178
178
  },
179
179
  get children() {
180
- var i = ke(), t = i.firstChild;
181
- return s(t, () => I() || e.directoryFavorites?.error), s(i, l(z, {
180
+ var i = $e(), t = i.firstChild;
181
+ return o(t, () => E() || e.directoryFavorites?.error), o(i, l(R, {
182
182
  size: "sm",
183
183
  variant: "ghost",
184
184
  get disabled() {
185
185
  return e.directoryFavorites?.loading;
186
186
  },
187
187
  onClick: () => {
188
- $(""), e.directoryFavorites?.onRefresh?.();
188
+ F(""), e.directoryFavorites?.onRefresh?.();
189
189
  },
190
190
  get children() {
191
- return o().retry;
191
+ return s().retry;
192
192
  }
193
193
  }), null), i;
194
194
  }
195
- }), null), s(b, l(h, {
195
+ }), null), o(w, l(m, {
196
196
  get when() {
197
- return C(() => !!n.error())() && !A();
197
+ return M(() => !!n.error())() && !k();
198
198
  },
199
199
  get children() {
200
- var i = $e(), t = i.firstChild;
201
- return s(t, () => se(e, n.error())), s(i, l(z, {
200
+ var i = pe(), t = i.firstChild;
201
+ return o(t, () => se(e, n.error())), o(i, l(R, {
202
202
  size: "sm",
203
203
  variant: "ghost",
204
204
  onClick: () => {
@@ -208,49 +208,49 @@ function We(e) {
208
208
  return e.disabled || n.pending();
209
209
  },
210
210
  get children() {
211
- return o().retry;
211
+ return s().retry;
212
212
  }
213
213
  }), null), i;
214
214
  }
215
- }), null), s(b, l(h, {
215
+ }), null), o(w, l(m, {
216
216
  get when() {
217
- return A();
217
+ return k();
218
218
  },
219
219
  get fallback() {
220
220
  return [(() => {
221
- var i = Fe();
222
- return s(i, l(N, {
221
+ var i = Ce();
222
+ return o(i, l(j, {
223
223
  get each() {
224
- return oe();
224
+ return v();
225
225
  },
226
- children: (t, a) => [l(h, {
226
+ children: (t, a) => [l(m, {
227
227
  get when() {
228
228
  return a() > 0;
229
229
  },
230
230
  get children() {
231
- return l(q, {
231
+ return l(J, {
232
232
  class: "h-3 w-3 shrink-0 text-[var(--floe-ink-soft)]"
233
233
  });
234
234
  }
235
235
  }), (() => {
236
- var r = Ee();
236
+ var r = ze();
237
237
  return r.$$click = () => {
238
238
  n.navigate(t.path);
239
- }, s(r, () => t.name), P((u) => {
240
- var g = t.path, p = e.disabled, d = t.path === n.currentPath() ? "location" : void 0;
241
- return g !== u.e && v(r, "title", u.e = g), p !== u.t && (r.disabled = u.t = p), d !== u.a && v(r, "aria-current", u.a = d), u;
239
+ }, o(r, () => t.name), I((d) => {
240
+ var h = t.path, C = e.disabled, u = t.path === n.currentPath() ? "location" : void 0;
241
+ return h !== d.e && f(r, "title", d.e = h), C !== d.t && (r.disabled = d.t = C), u !== d.a && f(r, "aria-current", d.a = u), d;
242
242
  }, {
243
243
  e: void 0,
244
244
  t: void 0,
245
245
  a: void 0
246
246
  }), r;
247
247
  })()]
248
- }), null), s(i, l(h, {
248
+ }), null), o(i, l(m, {
249
249
  get when() {
250
250
  return e.directoryFavorites;
251
251
  },
252
252
  get children() {
253
- return l(fe, {
253
+ return l(he, {
254
254
  get path() {
255
255
  return n.currentPath();
256
256
  },
@@ -258,58 +258,58 @@ function We(e) {
258
258
  return e.directoryFavorites;
259
259
  },
260
260
  get copy() {
261
- return o();
261
+ return s();
262
262
  },
263
263
  get disabled() {
264
264
  return e.disabled || !n.valid();
265
265
  },
266
- onError: $
266
+ onError: F
267
267
  });
268
268
  }
269
- }), null), P(() => v(i, "aria-label", o().currentDirectory)), i;
269
+ }), null), I(() => f(i, "aria-label", s().currentDirectory)), i;
270
270
  })(), (() => {
271
- var i = O();
272
- return te(i, re(() => e.scrollViewportProps, {
271
+ var i = ae();
272
+ return re(i, ie(() => e.scrollViewportProps, {
273
273
  get class() {
274
- return L("min-h-[120px] overflow-y-auto rounded-xs border border-[var(--floe-line)]", e.scrollViewportProps?.class);
274
+ return W("min-h-[120px] overflow-y-auto rounded-xs border border-[var(--floe-line)]", e.scrollViewportProps?.class);
275
275
  },
276
276
  get style() {
277
277
  return {
278
278
  "max-height": e.treeMaxHeight ?? "240px"
279
279
  };
280
280
  }
281
- }), !1, !0), s(i, l(h, {
281
+ }), !1, !0), o(i, l(m, {
282
282
  get when() {
283
283
  return !n.pending() || n.currentPath();
284
284
  },
285
285
  get fallback() {
286
286
  return (() => {
287
- var t = ne();
288
- return s(t, () => o().loading), t;
287
+ var t = le();
288
+ return o(t, () => s().loading), t;
289
289
  })();
290
290
  },
291
291
  get children() {
292
- return l(h, {
292
+ return l(m, {
293
293
  get when() {
294
294
  return y().length;
295
295
  },
296
296
  get fallback() {
297
- return l(h, {
297
+ return l(m, {
298
298
  get when() {
299
299
  return n.currentPath();
300
300
  },
301
301
  get children() {
302
- var t = ze();
303
- return s(t, () => o().empty), t;
302
+ var t = Ae();
303
+ return o(t, () => s().empty), t;
304
304
  }
305
305
  });
306
306
  },
307
307
  get children() {
308
- return l(N, {
308
+ return l(j, {
309
309
  get each() {
310
310
  return y();
311
311
  },
312
- children: (t, a) => l(ie, {
312
+ children: (t, a) => l(ne, {
313
313
  get path() {
314
314
  return t.path;
315
315
  },
@@ -317,7 +317,7 @@ function We(e) {
317
317
  return e.directoryFavorites;
318
318
  },
319
319
  get copy() {
320
- return o();
320
+ return s();
321
321
  },
322
322
  get scopeKey() {
323
323
  return e.scopeKey;
@@ -325,24 +325,24 @@ function We(e) {
325
325
  get disabled() {
326
326
  return e.disabled || e.filter?.(t) === !1;
327
327
  },
328
- onError: $,
328
+ onError: F,
329
329
  get children() {
330
- var r = Ae(), u = r.firstChild;
331
- return r.$$keydown = (g) => X(g, a(), Y, y().length), r.$$click = () => {
330
+ var r = Me(), d = r.firstChild;
331
+ return r.$$keydown = (h) => $(h, a(), V, y().length), r.$$click = () => {
332
332
  n.navigate(t.path);
333
- }, H((g) => {
334
- T(() => {
335
- Y[a()] = g;
333
+ }, O((h) => {
334
+ q(() => {
335
+ V[a()] = h;
336
336
  });
337
- }, r), s(r, l(ge, {
337
+ }, r), o(r, l(ve, {
338
338
  item: t,
339
339
  size: 16,
340
340
  class: "h-4 w-4 shrink-0"
341
- }), u), s(u, () => t.name), s(r, l(q, {
341
+ }), d), o(d, () => t.name), o(r, l(J, {
342
342
  class: "h-3 w-3 shrink-0 text-[var(--floe-ink-soft)]"
343
- }), null), P((g) => {
344
- var p = t.path, d = e.disabled || e.filter?.(t) === !1;
345
- return p !== g.e && v(r, "data-picker-row-path", g.e = p), d !== g.t && (r.disabled = g.t = d), g;
343
+ }), null), I((h) => {
344
+ var C = t.path, u = e.disabled || e.filter?.(t) === !1;
345
+ return C !== h.e && f(r, "data-picker-row-path", h.e = C), u !== h.t && (r.disabled = h.t = u), h;
346
346
  }, {
347
347
  e: void 0,
348
348
  t: void 0
@@ -355,50 +355,50 @@ function We(e) {
355
355
  }
356
356
  })), i;
357
357
  })(), (() => {
358
- var i = Ie(), t = i.firstChild, a = t.firstChild;
358
+ var i = Ee(), t = i.firstChild, a = t.firstChild;
359
359
  return a.addEventListener("change", (r) => {
360
360
  n.setShowHidden(r.currentTarget.checked);
361
- }), s(t, () => o().showHidden, null), s(i, l(h, {
361
+ }), o(t, () => s().showHidden, null), o(i, l(m, {
362
362
  get when() {
363
- return C(() => !!n.pending())() && n.currentPath();
363
+ return M(() => !!n.pending())() && n.currentPath();
364
364
  },
365
365
  get children() {
366
- var r = Ce();
367
- return s(r, () => o().loading), r;
366
+ var r = Ie();
367
+ return o(r, () => s().loading), r;
368
368
  }
369
- }), null), P(() => a.disabled = e.disabled || !n.context()), P(() => a.checked = n.showHidden()), i;
370
- })(), l(h, {
369
+ }), null), I(() => a.disabled = e.disabled || !n.context()), I(() => a.checked = n.showHidden()), i;
370
+ })(), l(m, {
371
371
  get when() {
372
372
  return e.onCreateFolder;
373
373
  },
374
374
  get children() {
375
- return l(Me, e);
375
+ return l(Be, e);
376
376
  }
377
377
  })];
378
378
  },
379
379
  get children() {
380
- return [l(h, {
380
+ return [l(m, {
381
381
  get when() {
382
382
  return n.view() === "favorites";
383
383
  },
384
384
  get children() {
385
- return l(U, {
385
+ return l(Q, {
386
386
  size: "sm",
387
387
  get "aria-label"() {
388
- return o().favoritesFilter;
388
+ return s().favoritesFilter;
389
389
  },
390
390
  get placeholder() {
391
- return o().favoritesFilter;
391
+ return s().favoritesFilter;
392
392
  },
393
393
  get value() {
394
- return F();
394
+ return _();
395
395
  },
396
- onInput: (i) => k(i.currentTarget.value)
396
+ onInput: (i) => P(i.currentTarget.value)
397
397
  });
398
398
  }
399
399
  }), (() => {
400
- var i = O();
401
- return te(i, re(() => e.scrollViewportProps, {
400
+ var i = ae();
401
+ return re(i, ie(() => e.scrollViewportProps, {
402
402
  get "data-picker-suggestions"() {
403
403
  return n.view() === "suggestions" ? "" : void 0;
404
404
  },
@@ -406,44 +406,44 @@ function We(e) {
406
406
  return n.view() === "favorites" ? "" : void 0;
407
407
  },
408
408
  get "aria-label"() {
409
- return C(() => n.view() === "favorites")() ? o().favorites : e.suggestions?.label;
409
+ return M(() => n.view() === "favorites")() ? s().favorites : e.suggestions?.label;
410
410
  },
411
411
  get "aria-busy"() {
412
- return C(() => n.view() === "favorites")() && e.directoryFavorites?.loading;
412
+ return M(() => n.view() === "favorites")() && e.directoryFavorites?.loading;
413
413
  },
414
414
  get class() {
415
- return L("min-h-[180px] min-w-0 overflow-y-auto", e.scrollViewportProps?.class);
415
+ return W("min-h-[180px] min-w-0 overflow-y-auto", e.scrollViewportProps?.class);
416
416
  },
417
417
  get style() {
418
418
  return {
419
419
  "max-height": e.treeMaxHeight ?? "240px"
420
420
  };
421
421
  }
422
- }), !1, !0), s(i, l(h, {
422
+ }), !1, !0), o(i, l(m, {
423
423
  get when() {
424
- return D().length;
424
+ return K().length;
425
425
  },
426
426
  get fallback() {
427
427
  return (() => {
428
- var t = ne();
429
- return s(t, (() => {
430
- var a = C(() => !!e.directoryFavorites?.loading);
431
- return () => a() ? o().loading : C(() => !!e.directoryFavorites?.error)() ? o().favoritesLoadFailed : C(() => !!F().trim())() ? o().favoritesNoMatches : o().favoritesEmpty;
428
+ var t = le();
429
+ return o(t, (() => {
430
+ var a = M(() => !!e.directoryFavorites?.loading);
431
+ return () => a() ? s().loading : M(() => !!e.directoryFavorites?.error)() ? s().favoritesLoadFailed : M(() => !!_().trim())() ? s().favoritesNoMatches : s().favoritesEmpty;
432
432
  })()), t;
433
433
  })();
434
434
  },
435
435
  get children() {
436
- return l(N, {
436
+ return l(j, {
437
437
  get each() {
438
- return D();
438
+ return K();
439
439
  },
440
- children: (t, a) => l(ie, {
440
+ children: (t, a) => l(ne, {
441
441
  path: t,
442
442
  get favorites() {
443
443
  return e.directoryFavorites;
444
444
  },
445
445
  get copy() {
446
- return o();
446
+ return s();
447
447
  },
448
448
  get scopeKey() {
449
449
  return e.scopeKey;
@@ -451,22 +451,22 @@ function We(e) {
451
451
  get disabled() {
452
452
  return e.disabled;
453
453
  },
454
- onError: $,
454
+ onError: F,
455
455
  get children() {
456
- var r = Ve(), u = r.firstChild, g = u.firstChild, p = g.nextSibling;
457
- return r.$$keydown = (d) => X(d, a(), Q, D().length), r.$$click = () => {
458
- S(t);
459
- }, H((d) => {
460
- T(() => {
461
- Q[a()] = d;
456
+ var r = De(), d = r.firstChild, h = d.firstChild, C = h.nextSibling;
457
+ return r.$$keydown = (u) => $(u, a(), b, K().length), r.$$click = () => {
458
+ G(t);
459
+ }, O((u) => {
460
+ q(() => {
461
+ b[a()] = u;
462
462
  });
463
- }, r), v(r, "title", t), v(r, "aria-label", t), s(r, l(le, {
463
+ }, r), f(r, "title", t), f(r, "aria-label", t), o(r, l(oe, {
464
464
  class: "h-4 w-4 shrink-0 text-[var(--floe-ink-soft)]"
465
- }), u), s(g, () => t.split("/").filter(Boolean).at(-1) ?? o().root), s(p, t), s(r, l(q, {
465
+ }), d), o(h, () => t.split("/").filter(Boolean).at(-1) ?? s().root), o(C, t), o(r, l(J, {
466
466
  class: "h-3 w-3 shrink-0 text-[var(--floe-ink-quiet)]"
467
- }), null), P((d) => {
468
- var R = n.view() === "suggestions" ? t : void 0, M = n.view() === "favorites" ? t : void 0, ee = e.disabled || !n.context();
469
- return R !== d.e && v(r, "data-picker-suggested-path", d.e = R), M !== d.t && v(r, "data-picker-favorite-path", d.t = M), ee !== d.a && (r.disabled = d.a = ee), d;
467
+ }), null), I((u) => {
468
+ var L = n.view() === "suggestions" ? t : void 0, U = n.view() === "favorites" ? t : void 0, te = e.disabled || !n.context();
469
+ return L !== u.e && f(r, "data-picker-suggested-path", u.e = L), U !== u.t && f(r, "data-picker-favorite-path", u.t = U), te !== u.a && (r.disabled = u.a = te), u;
470
470
  }, {
471
471
  e: void 0,
472
472
  t: void 0,
@@ -479,9 +479,9 @@ function We(e) {
479
479
  })), i;
480
480
  })()];
481
481
  }
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 && v(c, "aria-busy", i.e = t), a !== i.t && v(b, "role", i.t = a), r !== i.a && v(b, "aria-labelledby", i.a = r), i;
482
+ }), null), I((i) => {
483
+ var t = n.pending(), a = z() ? "tabpanel" : void 0, r = z() ? `${x}-${D()}` : void 0;
484
+ return t !== i.e && f(c, "aria-busy", i.e = t), a !== i.t && f(w, "role", i.t = a), r !== i.a && f(w, "aria-labelledby", i.a = r), i;
485
485
  }, {
486
486
  e: void 0,
487
487
  t: void 0,
@@ -489,95 +489,124 @@ function We(e) {
489
489
  }), c;
490
490
  })();
491
491
  }
492
- function Me(e) {
493
- const [o, 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);
492
+ function Be(e) {
493
+ const [s, n] = N(!1), [y, p] = N(""), [x, _] = N(!1), [P, E] = N(null), F = () => Z(e);
494
+ let k = 0, z, B;
495
+ const K = () => !!y().trim() && ![".", ".."].includes(y().trim()) && !y().includes("/") && !y().includes("\0"), S = () => {
496
+ k++, n(!1), p(""), _(!1), E(null);
497
+ };
498
+ q(Y(() => [e.scopeKey, e.source.context(), e.source.active(), e.source.pathInput()], S)), ge(() => {
499
+ k++;
500
+ });
501
+ const H = () => {
502
+ S(), queueMicrotask(() => B?.focus());
503
+ }, D = async () => {
504
+ if (e.disabled || !K() || !e.source.valid() || !e.onCreateFolder || x()) return;
505
+ const A = e.source.currentPath(), b = k, $ = e.source.captureIntent(), v = () => k === b && $();
506
+ _(!0), E(null);
497
507
  try {
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);
508
+ if (await e.onCreateFolder(A, y().trim()), !v()) return;
509
+ p(""), n(!1), await e.source.navigate(A), k === b && e.source.active() && queueMicrotask(() => B?.focus());
510
+ } catch (V) {
511
+ v() && (E(V), queueMicrotask(() => z?.focus()));
501
512
  } finally {
502
- F(!1);
513
+ k === b && _(!1);
503
514
  }
504
515
  };
505
516
  return (() => {
506
- var w = O();
507
- return s(w, l(h, {
517
+ var A = Re();
518
+ return o(A, l(m, {
508
519
  get when() {
509
- return o();
520
+ return s();
510
521
  },
511
522
  get fallback() {
512
- return l(z, {
523
+ return l(R, {
524
+ ref(b) {
525
+ var $ = B;
526
+ typeof $ == "function" ? $(b) : B = b;
527
+ },
513
528
  size: "sm",
514
529
  variant: "ghost",
515
530
  get disabled() {
516
531
  return e.disabled || !e.source.valid();
517
532
  },
518
- onClick: () => n(!0),
533
+ onClick: () => {
534
+ n(!0), queueMicrotask(() => z?.focus());
535
+ },
519
536
  get children() {
520
- return [l(le, {
537
+ return [l(oe, {
521
538
  class: "mr-1 h-3.5 w-3.5"
522
- }), C(() => $().newFolder)];
539
+ }), M(() => F().newFolder)];
523
540
  }
524
541
  });
525
542
  },
526
543
  get children() {
527
- var x = De();
528
- return s(x, l(U, {
544
+ var b = Ve(), $ = b.firstChild;
545
+ return b.$$keydown = (v) => {
546
+ v.isComposing || (v.key === "Enter" && v.target === z && (v.preventDefault(), v.stopPropagation(), D()), v.key === "Escape" && (v.preventDefault(), v.stopPropagation(), x() || H()));
547
+ }, o(b, l(Q, {
548
+ ref(v) {
549
+ var V = z;
550
+ typeof V == "function" ? V(v) : z = v;
551
+ },
552
+ class: "min-w-0 flex-1 basis-32",
529
553
  size: "sm",
530
554
  get "aria-label"() {
531
- return $().folderName;
555
+ return F().folderName;
532
556
  },
533
557
  get value() {
534
558
  return y();
535
559
  },
536
- onInput: (D) => _(D.currentTarget.value),
560
+ onInput: (v) => {
561
+ p(v.currentTarget.value), E(null);
562
+ },
537
563
  get disabled() {
538
- return e.disabled || m();
564
+ return e.disabled || x();
539
565
  }
540
- }), null), s(x, l(z, {
566
+ }), $), o($, l(R, {
541
567
  size: "sm",
568
+ get loading() {
569
+ return x();
570
+ },
542
571
  get disabled() {
543
- return e.disabled || m() || !y().trim() || !e.source.valid();
572
+ return e.disabled || x() || !K() || !e.source.valid();
544
573
  },
545
574
  onClick: () => {
546
- A();
575
+ D();
547
576
  },
548
577
  get children() {
549
- return $().create;
578
+ return F().create;
550
579
  }
551
- }), null), s(x, l(z, {
580
+ }), null), o($, l(R, {
552
581
  size: "sm",
553
582
  variant: "ghost-destructive",
554
583
  get disabled() {
555
- return e.disabled || m();
584
+ return e.disabled || x();
556
585
  },
557
- onClick: () => n(!1),
586
+ onClick: H,
558
587
  get children() {
559
- return $().cancel;
588
+ return F().cancel;
560
589
  }
561
- }), null), x;
590
+ }), null), b;
562
591
  }
563
- }), null), s(w, l(h, {
592
+ }), null), o(A, l(m, {
564
593
  get when() {
565
- return k();
594
+ return P();
566
595
  },
567
596
  get children() {
568
- var x = Re();
569
- return s(x, () => se(e, k())), x;
597
+ var b = Ne();
598
+ return o(b, () => se(e, P())), b;
570
599
  }
571
- }), null), w;
600
+ }), null), A;
572
601
  })();
573
602
  }
574
- const Ge = j;
575
- de(["click", "keydown"]);
603
+ const Qe = X;
604
+ ue(["click", "keydown"]);
576
605
  export {
577
- We as PickerPanel,
578
- Xe as getParentPath,
579
- Ge as normalizePath,
580
- W as pickerCopy,
606
+ Je as PickerPanel,
607
+ Ze as getParentPath,
608
+ Qe as normalizePath,
609
+ Z as pickerCopy,
581
610
  se as pickerErrorMessage,
582
- Oe as usePickerNavigation
611
+ We as usePickerNavigation
583
612
  };