@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.
- package/dist/components/ui/DirectoryPicker.js +5 -4
- package/dist/components/ui/FileOpenPicker.js +27 -26
- package/dist/components/ui/FileSavePicker.js +29 -28
- package/dist/components/ui/picker/PickerBase.d.ts +1 -0
- package/dist/components/ui/picker/PickerBase.js +242 -213
- package/dist/components/ui/picker/PickerNavigation.d.ts +2 -0
- package/dist/components/ui/picker/PickerNavigation.js +84 -79
- package/dist/styles.css +1 -1
- package/package.json +1 -1
|
@@ -1,91 +1,91 @@
|
|
|
1
|
-
import { insert as
|
|
2
|
-
import { createSignal as
|
|
3
|
-
import { cn as
|
|
4
|
-
import { FileItemIcon as
|
|
5
|
-
import { FolderOpen as
|
|
6
|
-
import { Button as
|
|
7
|
-
import { Input as
|
|
8
|
-
import { PickerDirectoryRow as
|
|
9
|
-
import { resolveTabNavigationTargetId as
|
|
10
|
-
import { createFilesystemPickerDataSource as
|
|
11
|
-
import { pickerParentPath as
|
|
12
|
-
var
|
|
13
|
-
function
|
|
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
|
-
...
|
|
15
|
+
...we,
|
|
16
16
|
...e.copy
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
|
-
function se(e,
|
|
20
|
-
const n =
|
|
21
|
-
return
|
|
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
|
|
24
|
-
const [
|
|
25
|
-
return
|
|
26
|
-
|
|
27
|
-
})),
|
|
28
|
-
...
|
|
29
|
-
view:
|
|
30
|
-
setView:
|
|
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
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
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
|
|
39
|
-
const
|
|
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:
|
|
45
|
+
label: s().favorites,
|
|
46
46
|
disabled: e.disabled
|
|
47
|
-
}] : [], ...
|
|
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
|
-
}))]),
|
|
53
|
-
if (
|
|
54
|
-
const c =
|
|
55
|
-
return `root:${
|
|
56
|
-
},
|
|
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(
|
|
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
|
-
},
|
|
61
|
+
}, v = T(() => {
|
|
62
62
|
const c = n.currentPath();
|
|
63
63
|
if (!c) return [];
|
|
64
|
-
let
|
|
64
|
+
let w = "";
|
|
65
65
|
return [{
|
|
66
66
|
path: "/",
|
|
67
|
-
name:
|
|
68
|
-
}, ...c.split("/").filter(Boolean).map((i) => (
|
|
69
|
-
path:
|
|
67
|
+
name: s().root
|
|
68
|
+
}, ...c.split("/").filter(Boolean).map((i) => (w += `/${i}`, {
|
|
69
|
+
path: w,
|
|
70
70
|
name: i
|
|
71
71
|
}))];
|
|
72
|
-
}),
|
|
73
|
-
n.setView("browse"), n.navigate(c),
|
|
74
|
-
},
|
|
72
|
+
}), V = [], G = (c) => {
|
|
73
|
+
n.setView("browse"), n.navigate(c), S?.focus();
|
|
74
|
+
}, ee = () => G(n.pathInput());
|
|
75
75
|
return (() => {
|
|
76
|
-
var c =
|
|
77
|
-
return
|
|
76
|
+
var c = _e(), w = c.firstChild;
|
|
77
|
+
return o(c, l(m, {
|
|
78
78
|
get when() {
|
|
79
|
-
return
|
|
79
|
+
return z();
|
|
80
80
|
},
|
|
81
81
|
get fallback() {
|
|
82
82
|
return (() => {
|
|
83
83
|
var i = Pe();
|
|
84
|
-
return
|
|
84
|
+
return o(i, l(j, {
|
|
85
85
|
get each() {
|
|
86
|
-
return
|
|
86
|
+
return p();
|
|
87
87
|
},
|
|
88
|
-
children: (t) => l(
|
|
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
|
-
})),
|
|
107
|
+
})), I(() => f(i, "aria-label", s().roots)), i;
|
|
108
108
|
})();
|
|
109
109
|
},
|
|
110
110
|
get children() {
|
|
111
|
-
var i =
|
|
112
|
-
return
|
|
111
|
+
var i = ye();
|
|
112
|
+
return o(i, l(j, {
|
|
113
113
|
get each() {
|
|
114
|
-
return
|
|
114
|
+
return H();
|
|
115
115
|
},
|
|
116
116
|
children: (t) => (() => {
|
|
117
|
-
var a =
|
|
117
|
+
var a = Fe();
|
|
118
118
|
return a.$$keydown = (r) => {
|
|
119
|
-
const
|
|
120
|
-
|
|
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 ?
|
|
123
|
-
},
|
|
124
|
-
var
|
|
125
|
-
return
|
|
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
|
-
})),
|
|
135
|
+
})), I(() => f(i, "aria-label", s().roots)), i;
|
|
136
136
|
}
|
|
137
|
-
}),
|
|
137
|
+
}), w), f(w, "id", x), o(w, l(m, {
|
|
138
138
|
get when() {
|
|
139
|
-
return !
|
|
139
|
+
return !k();
|
|
140
140
|
},
|
|
141
141
|
get children() {
|
|
142
|
-
var i =
|
|
143
|
-
return
|
|
142
|
+
var i = ke(), t = i.firstChild;
|
|
143
|
+
return o(t, l(Q, {
|
|
144
144
|
ref(a) {
|
|
145
|
-
var r =
|
|
146
|
-
typeof r == "function" ? r(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
|
|
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(),
|
|
161
|
+
a.key === "Enter" && (a.preventDefault(), a.stopPropagation(), ee());
|
|
162
162
|
}
|
|
163
|
-
})),
|
|
163
|
+
})), o(i, l(R, {
|
|
164
164
|
size: "sm",
|
|
165
165
|
variant: "outline",
|
|
166
|
-
onClick:
|
|
166
|
+
onClick: ee,
|
|
167
167
|
get disabled() {
|
|
168
168
|
return e.disabled || !n.context() || !n.pathInput();
|
|
169
169
|
},
|
|
170
170
|
get children() {
|
|
171
|
-
return
|
|
171
|
+
return s().go;
|
|
172
172
|
}
|
|
173
173
|
}), null), i;
|
|
174
174
|
}
|
|
175
|
-
}), null),
|
|
175
|
+
}), null), o(w, l(m, {
|
|
176
176
|
get when() {
|
|
177
|
-
return
|
|
177
|
+
return E() || e.directoryFavorites?.error;
|
|
178
178
|
},
|
|
179
179
|
get children() {
|
|
180
|
-
var i =
|
|
181
|
-
return
|
|
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
|
-
|
|
188
|
+
F(""), e.directoryFavorites?.onRefresh?.();
|
|
189
189
|
},
|
|
190
190
|
get children() {
|
|
191
|
-
return
|
|
191
|
+
return s().retry;
|
|
192
192
|
}
|
|
193
193
|
}), null), i;
|
|
194
194
|
}
|
|
195
|
-
}), null),
|
|
195
|
+
}), null), o(w, l(m, {
|
|
196
196
|
get when() {
|
|
197
|
-
return
|
|
197
|
+
return M(() => !!n.error())() && !k();
|
|
198
198
|
},
|
|
199
199
|
get children() {
|
|
200
|
-
var i =
|
|
201
|
-
return
|
|
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
|
|
211
|
+
return s().retry;
|
|
212
212
|
}
|
|
213
213
|
}), null), i;
|
|
214
214
|
}
|
|
215
|
-
}), null),
|
|
215
|
+
}), null), o(w, l(m, {
|
|
216
216
|
get when() {
|
|
217
|
-
return
|
|
217
|
+
return k();
|
|
218
218
|
},
|
|
219
219
|
get fallback() {
|
|
220
220
|
return [(() => {
|
|
221
|
-
var i =
|
|
222
|
-
return
|
|
221
|
+
var i = Ce();
|
|
222
|
+
return o(i, l(j, {
|
|
223
223
|
get each() {
|
|
224
|
-
return
|
|
224
|
+
return v();
|
|
225
225
|
},
|
|
226
|
-
children: (t, a) => [l(
|
|
226
|
+
children: (t, a) => [l(m, {
|
|
227
227
|
get when() {
|
|
228
228
|
return a() > 0;
|
|
229
229
|
},
|
|
230
230
|
get children() {
|
|
231
|
-
return l(
|
|
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 =
|
|
236
|
+
var r = ze();
|
|
237
237
|
return r.$$click = () => {
|
|
238
238
|
n.navigate(t.path);
|
|
239
|
-
},
|
|
240
|
-
var
|
|
241
|
-
return
|
|
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),
|
|
248
|
+
}), null), o(i, l(m, {
|
|
249
249
|
get when() {
|
|
250
250
|
return e.directoryFavorites;
|
|
251
251
|
},
|
|
252
252
|
get children() {
|
|
253
|
-
return l(
|
|
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
|
|
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),
|
|
269
|
+
}), null), I(() => f(i, "aria-label", s().currentDirectory)), i;
|
|
270
270
|
})(), (() => {
|
|
271
|
-
var i =
|
|
272
|
-
return
|
|
271
|
+
var i = ae();
|
|
272
|
+
return re(i, ie(() => e.scrollViewportProps, {
|
|
273
273
|
get class() {
|
|
274
|
-
return
|
|
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),
|
|
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 =
|
|
288
|
-
return
|
|
287
|
+
var t = le();
|
|
288
|
+
return o(t, () => s().loading), t;
|
|
289
289
|
})();
|
|
290
290
|
},
|
|
291
291
|
get children() {
|
|
292
|
-
return l(
|
|
292
|
+
return l(m, {
|
|
293
293
|
get when() {
|
|
294
294
|
return y().length;
|
|
295
295
|
},
|
|
296
296
|
get fallback() {
|
|
297
|
-
return l(
|
|
297
|
+
return l(m, {
|
|
298
298
|
get when() {
|
|
299
299
|
return n.currentPath();
|
|
300
300
|
},
|
|
301
301
|
get children() {
|
|
302
|
-
var t =
|
|
303
|
-
return
|
|
302
|
+
var t = Ae();
|
|
303
|
+
return o(t, () => s().empty), t;
|
|
304
304
|
}
|
|
305
305
|
});
|
|
306
306
|
},
|
|
307
307
|
get children() {
|
|
308
|
-
return l(
|
|
308
|
+
return l(j, {
|
|
309
309
|
get each() {
|
|
310
310
|
return y();
|
|
311
311
|
},
|
|
312
|
-
children: (t, a) => l(
|
|
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
|
|
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 =
|
|
331
|
-
return r.$$keydown = (
|
|
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
|
-
},
|
|
334
|
-
|
|
335
|
-
|
|
333
|
+
}, O((h) => {
|
|
334
|
+
q(() => {
|
|
335
|
+
V[a()] = h;
|
|
336
336
|
});
|
|
337
|
-
}, r),
|
|
337
|
+
}, r), o(r, l(ve, {
|
|
338
338
|
item: t,
|
|
339
339
|
size: 16,
|
|
340
340
|
class: "h-4 w-4 shrink-0"
|
|
341
|
-
}),
|
|
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),
|
|
344
|
-
var
|
|
345
|
-
return
|
|
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 =
|
|
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
|
-
}),
|
|
361
|
+
}), o(t, () => s().showHidden, null), o(i, l(m, {
|
|
362
362
|
get when() {
|
|
363
|
-
return
|
|
363
|
+
return M(() => !!n.pending())() && n.currentPath();
|
|
364
364
|
},
|
|
365
365
|
get children() {
|
|
366
|
-
var r =
|
|
367
|
-
return
|
|
366
|
+
var r = Ie();
|
|
367
|
+
return o(r, () => s().loading), r;
|
|
368
368
|
}
|
|
369
|
-
}), null),
|
|
370
|
-
})(), l(
|
|
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(
|
|
375
|
+
return l(Be, e);
|
|
376
376
|
}
|
|
377
377
|
})];
|
|
378
378
|
},
|
|
379
379
|
get children() {
|
|
380
|
-
return [l(
|
|
380
|
+
return [l(m, {
|
|
381
381
|
get when() {
|
|
382
382
|
return n.view() === "favorites";
|
|
383
383
|
},
|
|
384
384
|
get children() {
|
|
385
|
-
return l(
|
|
385
|
+
return l(Q, {
|
|
386
386
|
size: "sm",
|
|
387
387
|
get "aria-label"() {
|
|
388
|
-
return
|
|
388
|
+
return s().favoritesFilter;
|
|
389
389
|
},
|
|
390
390
|
get placeholder() {
|
|
391
|
-
return
|
|
391
|
+
return s().favoritesFilter;
|
|
392
392
|
},
|
|
393
393
|
get value() {
|
|
394
|
-
return
|
|
394
|
+
return _();
|
|
395
395
|
},
|
|
396
|
-
onInput: (i) =>
|
|
396
|
+
onInput: (i) => P(i.currentTarget.value)
|
|
397
397
|
});
|
|
398
398
|
}
|
|
399
399
|
}), (() => {
|
|
400
|
-
var i =
|
|
401
|
-
return
|
|
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
|
|
409
|
+
return M(() => n.view() === "favorites")() ? s().favorites : e.suggestions?.label;
|
|
410
410
|
},
|
|
411
411
|
get "aria-busy"() {
|
|
412
|
-
return
|
|
412
|
+
return M(() => n.view() === "favorites")() && e.directoryFavorites?.loading;
|
|
413
413
|
},
|
|
414
414
|
get class() {
|
|
415
|
-
return
|
|
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),
|
|
422
|
+
}), !1, !0), o(i, l(m, {
|
|
423
423
|
get when() {
|
|
424
|
-
return
|
|
424
|
+
return K().length;
|
|
425
425
|
},
|
|
426
426
|
get fallback() {
|
|
427
427
|
return (() => {
|
|
428
|
-
var t =
|
|
429
|
-
return
|
|
430
|
-
var a =
|
|
431
|
-
return () => a() ?
|
|
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(
|
|
436
|
+
return l(j, {
|
|
437
437
|
get each() {
|
|
438
|
-
return
|
|
438
|
+
return K();
|
|
439
439
|
},
|
|
440
|
-
children: (t, a) => l(
|
|
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
|
|
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 =
|
|
457
|
-
return r.$$keydown = (
|
|
458
|
-
|
|
459
|
-
},
|
|
460
|
-
|
|
461
|
-
|
|
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),
|
|
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
|
-
}),
|
|
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),
|
|
468
|
-
var
|
|
469
|
-
return
|
|
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),
|
|
483
|
-
var t = n.pending(), a =
|
|
484
|
-
return t !== i.e &&
|
|
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
|
|
493
|
-
const [
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
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(
|
|
499
|
-
|
|
500
|
-
|
|
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
|
-
|
|
513
|
+
k === b && _(!1);
|
|
503
514
|
}
|
|
504
515
|
};
|
|
505
516
|
return (() => {
|
|
506
|
-
var
|
|
507
|
-
return
|
|
517
|
+
var A = Re();
|
|
518
|
+
return o(A, l(m, {
|
|
508
519
|
get when() {
|
|
509
|
-
return
|
|
520
|
+
return s();
|
|
510
521
|
},
|
|
511
522
|
get fallback() {
|
|
512
|
-
return l(
|
|
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: () =>
|
|
533
|
+
onClick: () => {
|
|
534
|
+
n(!0), queueMicrotask(() => z?.focus());
|
|
535
|
+
},
|
|
519
536
|
get children() {
|
|
520
|
-
return [l(
|
|
537
|
+
return [l(oe, {
|
|
521
538
|
class: "mr-1 h-3.5 w-3.5"
|
|
522
|
-
}),
|
|
539
|
+
}), M(() => F().newFolder)];
|
|
523
540
|
}
|
|
524
541
|
});
|
|
525
542
|
},
|
|
526
543
|
get children() {
|
|
527
|
-
var
|
|
528
|
-
return
|
|
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
|
|
555
|
+
return F().folderName;
|
|
532
556
|
},
|
|
533
557
|
get value() {
|
|
534
558
|
return y();
|
|
535
559
|
},
|
|
536
|
-
onInput: (
|
|
560
|
+
onInput: (v) => {
|
|
561
|
+
p(v.currentTarget.value), E(null);
|
|
562
|
+
},
|
|
537
563
|
get disabled() {
|
|
538
|
-
return e.disabled ||
|
|
564
|
+
return e.disabled || x();
|
|
539
565
|
}
|
|
540
|
-
}),
|
|
566
|
+
}), $), o($, l(R, {
|
|
541
567
|
size: "sm",
|
|
568
|
+
get loading() {
|
|
569
|
+
return x();
|
|
570
|
+
},
|
|
542
571
|
get disabled() {
|
|
543
|
-
return e.disabled ||
|
|
572
|
+
return e.disabled || x() || !K() || !e.source.valid();
|
|
544
573
|
},
|
|
545
574
|
onClick: () => {
|
|
546
|
-
|
|
575
|
+
D();
|
|
547
576
|
},
|
|
548
577
|
get children() {
|
|
549
|
-
return
|
|
578
|
+
return F().create;
|
|
550
579
|
}
|
|
551
|
-
}), null),
|
|
580
|
+
}), null), o($, l(R, {
|
|
552
581
|
size: "sm",
|
|
553
582
|
variant: "ghost-destructive",
|
|
554
583
|
get disabled() {
|
|
555
|
-
return e.disabled ||
|
|
584
|
+
return e.disabled || x();
|
|
556
585
|
},
|
|
557
|
-
onClick:
|
|
586
|
+
onClick: H,
|
|
558
587
|
get children() {
|
|
559
|
-
return
|
|
588
|
+
return F().cancel;
|
|
560
589
|
}
|
|
561
|
-
}), null),
|
|
590
|
+
}), null), b;
|
|
562
591
|
}
|
|
563
|
-
}), null),
|
|
592
|
+
}), null), o(A, l(m, {
|
|
564
593
|
get when() {
|
|
565
|
-
return
|
|
594
|
+
return P();
|
|
566
595
|
},
|
|
567
596
|
get children() {
|
|
568
|
-
var
|
|
569
|
-
return
|
|
597
|
+
var b = Ne();
|
|
598
|
+
return o(b, () => se(e, P())), b;
|
|
570
599
|
}
|
|
571
|
-
}), null),
|
|
600
|
+
}), null), A;
|
|
572
601
|
})();
|
|
573
602
|
}
|
|
574
|
-
const
|
|
575
|
-
|
|
603
|
+
const Qe = X;
|
|
604
|
+
ue(["click", "keydown"]);
|
|
576
605
|
export {
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
606
|
+
Je as PickerPanel,
|
|
607
|
+
Ze as getParentPath,
|
|
608
|
+
Qe as normalizePath,
|
|
609
|
+
Z as pickerCopy,
|
|
581
610
|
se as pickerErrorMessage,
|
|
582
|
-
|
|
611
|
+
We as usePickerNavigation
|
|
583
612
|
};
|