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