@floegence/floe-webapp-core 0.48.5 → 0.49.0
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/DirectoryInput.d.ts +6 -27
- package/dist/components/ui/DirectoryInput.js +41 -115
- package/dist/components/ui/DirectoryPicker.d.ts +1 -5
- package/dist/components/ui/DirectoryPicker.js +27 -116
- package/dist/components/ui/FileOpenPicker.js +95 -167
- package/dist/components/ui/FileSavePicker.js +73 -160
- package/dist/components/ui/index.d.ts +2 -1
- package/dist/components/ui/localInteractionSurface.js +8 -8
- package/dist/components/ui/picker/PickerBase.d.ts +58 -176
- package/dist/components/ui/picker/PickerBase.js +273 -490
- package/dist/components/ui/picker/PickerNavigation.d.ts +91 -0
- package/dist/components/ui/picker/PickerNavigation.js +160 -0
- package/dist/components/workbench/WorkbenchWidget.js +2 -2
- package/dist/components/workbench/types.d.ts +4 -1
- package/dist/full.js +346 -341
- package/dist/styles.css +1 -1
- package/dist/ui.js +120 -115
- package/package.json +1 -1
|
@@ -1,66 +1,58 @@
|
|
|
1
|
-
import { createComponent as
|
|
2
|
-
import { createSignal as
|
|
3
|
-
import { cn as
|
|
4
|
-
import { deferNonBlocking as
|
|
5
|
-
import { Check as
|
|
6
|
-
import { FileItemIcon as
|
|
7
|
-
import { Button as
|
|
8
|
-
import { Dialog as
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { createComponent as u, insert as m, mergeProps as z, spread as K, use as L, effect as j, setAttribute as M, className as V, memo as H, template as b, delegateEvents as R } from "solid-js/web";
|
|
2
|
+
import { createSignal as U, mergeProps as Y, createMemo as q, Show as w, For as G } from "solid-js";
|
|
3
|
+
import { cn as N } from "../../utils/cn.js";
|
|
4
|
+
import { deferNonBlocking as J } from "../../utils/defer.js";
|
|
5
|
+
import { Check as Q } from "../icons/index.js";
|
|
6
|
+
import { FileItemIcon as W } from "../file-browser/FileIcons.js";
|
|
7
|
+
import { Button as D } from "./Button.js";
|
|
8
|
+
import { Dialog as X } from "./Dialog.js";
|
|
9
|
+
import { usePickerNavigation as Z, PickerPanel as ee, normalizePath as k, pickerCopy as v } from "./picker/PickerBase.js";
|
|
10
|
+
import { pickerParentPath as te } from "./picker/PickerNavigation.js";
|
|
11
|
+
var ne = /* @__PURE__ */ b('<div class="flex flex-col gap-2 -mt-1"><div class="flex min-h-[140px] overflow-hidden rounded border border-border"><div>'), ie = /* @__PURE__ */ b('<div class="flex items-center w-full gap-2"><span class="flex-1 text-[11px] text-muted-foreground truncate">'), le = /* @__PURE__ */ b('<div class="flex h-full items-center justify-center px-4 text-center text-xs text-muted-foreground">'), re = /* @__PURE__ */ b('<span class="ml-auto flex h-5 min-w-5 items-center justify-center rounded-full bg-primary px-1 text-[10px] text-primary-foreground">'), oe = /* @__PURE__ */ b("<button type=button role=option><span class=truncate>");
|
|
12
|
+
function ae(e, o) {
|
|
13
|
+
const a = y(o), f = /* @__PURE__ */ new Set(), c = [];
|
|
14
|
+
for (const g of e ?? []) {
|
|
15
|
+
const s = k(g);
|
|
16
|
+
if (!(s === "/" || f.has(s)) && (f.add(s), c.push(s), c.length >= a))
|
|
16
17
|
break;
|
|
17
18
|
}
|
|
18
|
-
return
|
|
19
|
+
return c;
|
|
19
20
|
}
|
|
20
|
-
function
|
|
21
|
-
const
|
|
22
|
-
if (
|
|
23
|
-
if (
|
|
24
|
-
const
|
|
25
|
-
return
|
|
21
|
+
function ce(e, o, a, f) {
|
|
22
|
+
const c = k(o);
|
|
23
|
+
if (c === "/") return [...e];
|
|
24
|
+
if (a === "single") return [c];
|
|
25
|
+
const g = e.indexOf(c);
|
|
26
|
+
return g >= 0 ? e.filter((s, h) => h !== g) : e.length >= y(f) ? [...e] : [...e, c];
|
|
26
27
|
}
|
|
27
|
-
function
|
|
28
|
+
function y(e) {
|
|
28
29
|
return e == null || !Number.isFinite(e) ? Number.POSITIVE_INFINITY : Math.max(1, Math.floor(e));
|
|
29
30
|
}
|
|
30
|
-
function
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
function ke(e) {
|
|
32
|
+
const o = () => e.selectionMode ?? "single", [a, f] = U([]), c = () => {
|
|
33
|
+
if (e.initialPath) return e.initialPath;
|
|
34
|
+
const t = e.initialSelectedPaths?.[0];
|
|
35
|
+
return t ? te(t) : void 0;
|
|
36
|
+
}, g = Y(e, {
|
|
37
|
+
get initialPath() {
|
|
38
|
+
return c();
|
|
36
39
|
},
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
// eslint-disable-next-line solid/reactivity -- filter is a static callback
|
|
40
|
-
filter: e.filter ? (t) => e.filter(t) : void 0,
|
|
41
|
-
// eslint-disable-next-line solid/reactivity -- onExpand is a static callback
|
|
42
|
-
onExpand: e.onExpand,
|
|
43
|
-
// eslint-disable-next-line solid/reactivity -- ensurePath is a static callback
|
|
44
|
-
ensurePath: e.ensurePath,
|
|
45
|
-
homeLabel: () => e.homeLabel,
|
|
46
|
-
homePath: () => e.homePath,
|
|
47
|
-
onReset: () => {
|
|
48
|
-
f(ie(e.initialSelectedPaths, u() === "single" ? 1 : e.maxSelections));
|
|
40
|
+
get scopeKey() {
|
|
41
|
+
return e.scopeKey;
|
|
49
42
|
}
|
|
50
|
-
}),
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
return o(Y, {
|
|
43
|
+
}), s = Z(g, () => e.open, void 0, () => {
|
|
44
|
+
f(ae(e.initialSelectedPaths, o() === "single" ? 1 : e.maxSelections));
|
|
45
|
+
}), h = q(() => s.entries().filter((t) => t.type === "file" && (!e.fileFilter || e.fileFilter(t)))), T = (t) => a().indexOf(k(t)), A = () => o() === "multiple" && a().length >= y(e.maxSelections), B = (t) => {
|
|
46
|
+
f((r) => ce(r, t.path, o(), e.maxSelections));
|
|
47
|
+
}, P = (t = a()) => {
|
|
48
|
+
if (t.length === 0 || !s.valid()) return;
|
|
49
|
+
const r = e.onSelect;
|
|
50
|
+
e.onOpenChange(!1), J(() => r([...t]));
|
|
51
|
+
}, E = (t, r) => {
|
|
52
|
+
let i;
|
|
53
|
+
t.key === "ArrowDown" && (i = Math.min(r + 1, h().length - 1)), t.key === "ArrowUp" && (i = Math.max(r - 1, 0)), t.key === "Home" && (i = 0), t.key === "End" && (i = h().length - 1), !(i == null || i < 0) && (t.preventDefault(), S[i]?.focus());
|
|
54
|
+
}, S = [];
|
|
55
|
+
return u(X, {
|
|
64
56
|
get open() {
|
|
65
57
|
return e.open;
|
|
66
58
|
},
|
|
@@ -71,27 +63,27 @@ function xe(e) {
|
|
|
71
63
|
return e.title ?? "Select File";
|
|
72
64
|
},
|
|
73
65
|
get class() {
|
|
74
|
-
return
|
|
66
|
+
return N("max-w-2xl", e.class);
|
|
75
67
|
},
|
|
76
68
|
get footer() {
|
|
77
69
|
return (() => {
|
|
78
|
-
var t =
|
|
79
|
-
return
|
|
80
|
-
var
|
|
81
|
-
return () =>
|
|
82
|
-
})()),
|
|
70
|
+
var t = ie(), r = t.firstChild;
|
|
71
|
+
return m(r, (() => {
|
|
72
|
+
var i = H(() => a().length === 0);
|
|
73
|
+
return () => i() ? v(e).noFilesSelected : v(e).selectedCount(a().length);
|
|
74
|
+
})()), m(t, u(D, {
|
|
83
75
|
variant: "ghost",
|
|
84
76
|
size: "sm",
|
|
85
77
|
onClick: () => e.onOpenChange(!1),
|
|
86
78
|
get children() {
|
|
87
|
-
return e.cancelText ??
|
|
79
|
+
return e.cancelText ?? v(e).cancel;
|
|
88
80
|
}
|
|
89
|
-
}), null),
|
|
81
|
+
}), null), m(t, u(D, {
|
|
90
82
|
variant: "primary",
|
|
91
83
|
size: "sm",
|
|
92
|
-
onClick: () =>
|
|
84
|
+
onClick: () => P(),
|
|
93
85
|
get disabled() {
|
|
94
|
-
return
|
|
86
|
+
return a().length === 0 || !s.valid();
|
|
95
87
|
},
|
|
96
88
|
get children() {
|
|
97
89
|
return e.confirmText ?? "Select";
|
|
@@ -100,145 +92,81 @@ function xe(e) {
|
|
|
100
92
|
})();
|
|
101
93
|
},
|
|
102
94
|
get children() {
|
|
103
|
-
var t =
|
|
104
|
-
return
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
get pending() {
|
|
112
|
-
return n.pathPending;
|
|
113
|
-
},
|
|
114
|
-
get error() {
|
|
115
|
-
return n.pathInputError;
|
|
116
|
-
},
|
|
117
|
-
get onGo() {
|
|
118
|
-
return n.handlePathInputGo;
|
|
119
|
-
},
|
|
120
|
-
get onKeyDown() {
|
|
121
|
-
return n.handlePathInputKeyDown;
|
|
122
|
-
}
|
|
123
|
-
}), i), a(t, o(Q, {
|
|
124
|
-
get segments() {
|
|
125
|
-
return n.breadcrumbSegments;
|
|
126
|
-
},
|
|
127
|
-
get onClick() {
|
|
128
|
-
return n.handleBreadcrumbClick;
|
|
95
|
+
var t = ne(), r = t.firstChild, i = r.firstChild;
|
|
96
|
+
return m(t, u(ee, z(e, {
|
|
97
|
+
source: s
|
|
98
|
+
})), r), K(i, z(() => e.scrollViewportProps, {
|
|
99
|
+
class: "max-h-[200px] min-h-[140px] min-w-0 flex-1 overflow-y-auto",
|
|
100
|
+
role: "listbox",
|
|
101
|
+
get "aria-multiselectable"() {
|
|
102
|
+
return o() === "multiple" ? "true" : void 0;
|
|
129
103
|
}
|
|
130
|
-
}),
|
|
131
|
-
get rootFolders() {
|
|
132
|
-
return n.rootFolders;
|
|
133
|
-
},
|
|
134
|
-
get selectedPath() {
|
|
135
|
-
return n.selectedPath;
|
|
136
|
-
},
|
|
137
|
-
get expandedPaths() {
|
|
138
|
-
return n.expandedPaths;
|
|
139
|
-
},
|
|
140
|
-
get revealNonce() {
|
|
141
|
-
return n.revealNonce;
|
|
142
|
-
},
|
|
143
|
-
get onToggle() {
|
|
144
|
-
return n.toggleExpand;
|
|
145
|
-
},
|
|
146
|
-
get onSelect() {
|
|
147
|
-
return n.handleSelectFolder;
|
|
148
|
-
},
|
|
149
|
-
get onSelectRoot() {
|
|
150
|
-
return n.handleSelectRoot;
|
|
151
|
-
},
|
|
152
|
-
get isSelectable() {
|
|
153
|
-
return n.isSelectable;
|
|
154
|
-
},
|
|
155
|
-
get homeLabel() {
|
|
156
|
-
return n.homeLabel;
|
|
157
|
-
},
|
|
158
|
-
class: "min-h-[120px] min-w-0 border-0 border-b border-border rounded-none sm:h-full sm:w-1/2 sm:border-b-0 sm:border-r"
|
|
159
|
-
}), r), a(r, o(P, {
|
|
104
|
+
}), !1, !0), m(i, u(w, {
|
|
160
105
|
get when() {
|
|
161
106
|
return h().length > 0;
|
|
162
107
|
},
|
|
163
108
|
get fallback() {
|
|
164
109
|
return (() => {
|
|
165
|
-
var
|
|
166
|
-
return
|
|
110
|
+
var d = le();
|
|
111
|
+
return m(d, () => e.emptyText ?? v(e).emptyFiles), d;
|
|
167
112
|
})();
|
|
168
113
|
},
|
|
169
114
|
get children() {
|
|
170
|
-
return
|
|
115
|
+
return u(G, {
|
|
171
116
|
get each() {
|
|
172
117
|
return h();
|
|
173
118
|
},
|
|
174
|
-
children: (
|
|
175
|
-
const
|
|
119
|
+
children: (d, $) => {
|
|
120
|
+
const x = () => T(d.path), F = () => A() && x() < 0;
|
|
176
121
|
return (() => {
|
|
177
|
-
var
|
|
178
|
-
return
|
|
179
|
-
|
|
180
|
-
},
|
|
181
|
-
|
|
182
|
-
},
|
|
183
|
-
item:
|
|
122
|
+
var l = oe(), C = l.firstChild;
|
|
123
|
+
return l.$$keydown = (n) => E(n, $()), l.$$dblclick = () => {
|
|
124
|
+
o() === "single" && P([k(d.path)]);
|
|
125
|
+
}, l.$$click = () => B(d), L((n) => {
|
|
126
|
+
S[$()] = n;
|
|
127
|
+
}, l), m(l, u(W, {
|
|
128
|
+
item: d,
|
|
184
129
|
class: "w-4 h-4 flex-shrink-0"
|
|
185
|
-
}), C),
|
|
130
|
+
}), C), m(C, () => d.name), m(l, u(w, {
|
|
186
131
|
get when() {
|
|
187
|
-
return
|
|
132
|
+
return x() >= 0;
|
|
188
133
|
},
|
|
189
134
|
get children() {
|
|
190
|
-
var
|
|
191
|
-
return
|
|
135
|
+
var n = re();
|
|
136
|
+
return m(n, u(w, {
|
|
192
137
|
get when() {
|
|
193
|
-
return
|
|
138
|
+
return o() === "multiple";
|
|
194
139
|
},
|
|
195
140
|
get fallback() {
|
|
196
|
-
return
|
|
141
|
+
return u(Q, {
|
|
197
142
|
class: "h-3 w-3"
|
|
198
143
|
});
|
|
199
144
|
},
|
|
200
145
|
get children() {
|
|
201
|
-
return
|
|
146
|
+
return x() + 1;
|
|
202
147
|
}
|
|
203
|
-
})),
|
|
148
|
+
})), n;
|
|
204
149
|
}
|
|
205
|
-
}), null),
|
|
206
|
-
var
|
|
207
|
-
return
|
|
150
|
+
}), null), j((n) => {
|
|
151
|
+
var _ = x() >= 0, I = F(), O = F() ? v(e).selectionLimit : d.name, p = N("flex min-h-9 w-full cursor-pointer items-center gap-2 px-2 py-1.5 text-left text-xs", "transition-colors duration-100 hover:bg-accent/60", "focus:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-ring", "disabled:cursor-not-allowed disabled:opacity-45", x() >= 0 && "bg-accent text-accent-foreground font-medium");
|
|
152
|
+
return _ !== n.e && M(l, "aria-selected", n.e = _), I !== n.t && (l.disabled = n.t = I), O !== n.a && M(l, "title", n.a = O), p !== n.o && V(l, n.o = p), n;
|
|
208
153
|
}, {
|
|
209
154
|
e: void 0,
|
|
210
155
|
t: void 0,
|
|
211
156
|
a: void 0,
|
|
212
157
|
o: void 0
|
|
213
|
-
}),
|
|
158
|
+
}), l;
|
|
214
159
|
})();
|
|
215
160
|
}
|
|
216
161
|
});
|
|
217
162
|
}
|
|
218
|
-
})),
|
|
219
|
-
get when() {
|
|
220
|
-
return e.onCreateFolder;
|
|
221
|
-
},
|
|
222
|
-
get children() {
|
|
223
|
-
return o(X, {
|
|
224
|
-
get parentPath() {
|
|
225
|
-
return n.selectedPath;
|
|
226
|
-
},
|
|
227
|
-
get onCreateFolder() {
|
|
228
|
-
return e.onCreateFolder;
|
|
229
|
-
},
|
|
230
|
-
get toDisplayPath() {
|
|
231
|
-
return n.toDisplayPath;
|
|
232
|
-
}
|
|
233
|
-
});
|
|
234
|
-
}
|
|
235
|
-
}), null), D(() => w(r, "aria-multiselectable", u() === "multiple" ? "true" : void 0)), t;
|
|
163
|
+
})), t;
|
|
236
164
|
}
|
|
237
165
|
});
|
|
238
166
|
}
|
|
239
|
-
|
|
167
|
+
R(["click", "dblclick", "keydown"]);
|
|
240
168
|
export {
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
169
|
+
ke as FileOpenPicker,
|
|
170
|
+
ae as normalizeFileOpenSelection,
|
|
171
|
+
ce as updateFileOpenSelection
|
|
244
172
|
};
|
|
@@ -1,65 +1,47 @@
|
|
|
1
|
-
import { createComponent as
|
|
2
|
-
import { createSignal as
|
|
3
|
-
import { cn as
|
|
4
|
-
import { Dialog as
|
|
5
|
-
import { Button as
|
|
6
|
-
import { Input as
|
|
7
|
-
import { FileItemIcon as
|
|
8
|
-
import { deferNonBlocking as
|
|
9
|
-
import {
|
|
10
|
-
var
|
|
11
|
-
function
|
|
12
|
-
const [
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
filter: e.filter ? (r) => e.filter(r) : void 0,
|
|
18
|
-
// eslint-disable-next-line solid/reactivity -- onExpand is a static callback
|
|
19
|
-
onExpand: e.onExpand,
|
|
20
|
-
// eslint-disable-next-line solid/reactivity -- ensurePath is a static callback
|
|
21
|
-
ensurePath: e.ensurePath,
|
|
22
|
-
homeLabel: () => e.homeLabel,
|
|
23
|
-
homePath: () => e.homePath,
|
|
24
|
-
onReset: () => {
|
|
25
|
-
f(e.initialFileName ?? ""), s("");
|
|
26
|
-
}
|
|
27
|
-
}), x = $(() => {
|
|
28
|
-
const r = R(t.selectedPath());
|
|
29
|
-
if (r === "/")
|
|
30
|
-
return e.files.filter((o) => o.type === "file");
|
|
31
|
-
const n = t.folderIndex().get(r);
|
|
32
|
-
return n?.children ? n.children.filter((o) => o.type === "file") : [];
|
|
33
|
-
});
|
|
34
|
-
E(D(u, () => {
|
|
35
|
-
s("");
|
|
1
|
+
import { createComponent as a, insert as n, mergeProps as _, spread as z, effect as F, className as B, setAttribute as E, template as m, delegateEvents as D } from "solid-js/web";
|
|
2
|
+
import { createSignal as C, createMemo as k, createEffect as I, on as O, Show as w, For as K } from "solid-js";
|
|
3
|
+
import { cn as N } from "../../utils/cn.js";
|
|
4
|
+
import { Dialog as T } from "./Dialog.js";
|
|
5
|
+
import { Button as b } from "./Button.js";
|
|
6
|
+
import { Input as M } from "./Input.js";
|
|
7
|
+
import { FileItemIcon as j } from "../file-browser/FileIcons.js";
|
|
8
|
+
import { deferNonBlocking as q } from "../../utils/defer.js";
|
|
9
|
+
import { usePickerNavigation as A, PickerPanel as R, pickerCopy as g } from "./picker/PickerBase.js";
|
|
10
|
+
var V = /* @__PURE__ */ m('<div class="flex flex-col gap-2 -mt-1"><div class="flex min-h-[100px] overflow-hidden rounded border border-border"><div>'), G = /* @__PURE__ */ m('<div class="flex flex-col w-full gap-2"><div class="flex items-center gap-1.5"><label class="text-xs text-muted-foreground flex-shrink-0"></label><div class=flex-1></div></div><div class="flex items-center gap-2"><span class="flex-1 text-[11px] text-muted-foreground truncate">'), H = /* @__PURE__ */ m('<div class="flex items-center justify-center h-full text-xs text-muted-foreground">'), J = /* @__PURE__ */ m('<span class="ml-auto text-[10px] text-muted-foreground/60 flex-shrink-0">'), L = /* @__PURE__ */ m("<button type=button><span class=truncate>");
|
|
11
|
+
function le(e) {
|
|
12
|
+
const [c, x] = C(e.initialFileName ?? ""), [p, u] = C(""), s = A(e, () => e.open, void 0, () => {
|
|
13
|
+
x(e.initialFileName ?? ""), u("");
|
|
14
|
+
}), h = k(() => s.entries().filter((t) => t.type === "file"));
|
|
15
|
+
I(O(c, () => {
|
|
16
|
+
u("");
|
|
36
17
|
}));
|
|
37
|
-
const S = (
|
|
38
|
-
|
|
18
|
+
const S = (t) => {
|
|
19
|
+
x(t.name), u("");
|
|
39
20
|
}, v = () => {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
21
|
+
if (!s.valid()) return;
|
|
22
|
+
const t = c().trim();
|
|
23
|
+
if (!t) {
|
|
24
|
+
u(g(e).fileNameRequired);
|
|
43
25
|
return;
|
|
44
26
|
}
|
|
45
27
|
if (e.validateFileName) {
|
|
46
|
-
const
|
|
47
|
-
if (
|
|
48
|
-
|
|
28
|
+
const r = e.validateFileName(t);
|
|
29
|
+
if (r) {
|
|
30
|
+
u(r);
|
|
49
31
|
return;
|
|
50
32
|
}
|
|
51
33
|
}
|
|
52
|
-
const
|
|
53
|
-
e.onOpenChange(!1),
|
|
54
|
-
},
|
|
34
|
+
const l = s.currentPath(), o = e.onSave;
|
|
35
|
+
e.onOpenChange(!1), q(() => o(l, t));
|
|
36
|
+
}, P = () => {
|
|
55
37
|
e.onOpenChange(!1);
|
|
56
|
-
},
|
|
57
|
-
|
|
58
|
-
},
|
|
59
|
-
const
|
|
60
|
-
return
|
|
38
|
+
}, y = (t) => {
|
|
39
|
+
t.key === "Enter" && (t.preventDefault(), v());
|
|
40
|
+
}, $ = k(() => {
|
|
41
|
+
const t = s.currentPath(), l = c().trim();
|
|
42
|
+
return l ? t === "/" ? `/${l}` : `${t}/${l}` : t;
|
|
61
43
|
});
|
|
62
|
-
return
|
|
44
|
+
return a(T, {
|
|
63
45
|
get open() {
|
|
64
46
|
return e.open;
|
|
65
47
|
},
|
|
@@ -70,157 +52,88 @@ function ie(e) {
|
|
|
70
52
|
return e.title ?? "Save File";
|
|
71
53
|
},
|
|
72
54
|
get class() {
|
|
73
|
-
return
|
|
55
|
+
return N("max-w-2xl", e.class);
|
|
74
56
|
},
|
|
75
57
|
get footer() {
|
|
76
58
|
return (() => {
|
|
77
|
-
var
|
|
78
|
-
return
|
|
59
|
+
var t = G(), l = t.firstChild, o = l.firstChild, r = o.nextSibling, i = l.nextSibling, f = i.firstChild;
|
|
60
|
+
return n(o, () => g(e).fileName), n(r, a(M, {
|
|
79
61
|
size: "sm",
|
|
80
62
|
get value() {
|
|
81
|
-
return
|
|
63
|
+
return c();
|
|
82
64
|
},
|
|
83
|
-
onInput: (
|
|
84
|
-
onKeyDown:
|
|
65
|
+
onInput: (d) => x(d.currentTarget.value),
|
|
66
|
+
onKeyDown: y,
|
|
85
67
|
placeholder: "filename.ext",
|
|
86
68
|
get error() {
|
|
87
|
-
return
|
|
69
|
+
return p();
|
|
88
70
|
}
|
|
89
|
-
})),
|
|
71
|
+
})), n(f, $), n(i, a(b, {
|
|
90
72
|
variant: "ghost",
|
|
91
73
|
size: "sm",
|
|
92
|
-
onClick:
|
|
74
|
+
onClick: P,
|
|
93
75
|
get children() {
|
|
94
|
-
return e.cancelText ??
|
|
76
|
+
return e.cancelText ?? g(e).cancel;
|
|
95
77
|
}
|
|
96
|
-
}), null),
|
|
78
|
+
}), null), n(i, a(b, {
|
|
97
79
|
variant: "primary",
|
|
98
80
|
size: "sm",
|
|
99
81
|
onClick: v,
|
|
100
82
|
get disabled() {
|
|
101
|
-
return !
|
|
83
|
+
return !c().trim() || !s.valid();
|
|
102
84
|
},
|
|
103
85
|
get children() {
|
|
104
86
|
return e.confirmText ?? "Save";
|
|
105
87
|
}
|
|
106
|
-
}), null),
|
|
88
|
+
}), null), F(() => E(f, "title", $())), t;
|
|
107
89
|
})();
|
|
108
90
|
},
|
|
109
91
|
get children() {
|
|
110
|
-
var
|
|
111
|
-
return a(
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
t.setPathInput(l), t.setPathInputError("");
|
|
117
|
-
},
|
|
118
|
-
get pending() {
|
|
119
|
-
return t.pathPending;
|
|
120
|
-
},
|
|
121
|
-
get error() {
|
|
122
|
-
return t.pathInputError;
|
|
123
|
-
},
|
|
124
|
-
get onGo() {
|
|
125
|
-
return t.handlePathInputGo;
|
|
126
|
-
},
|
|
127
|
-
get onKeyDown() {
|
|
128
|
-
return t.handlePathInputKeyDown;
|
|
129
|
-
}
|
|
130
|
-
}), n), a(r, i(M, {
|
|
131
|
-
get segments() {
|
|
132
|
-
return t.breadcrumbSegments;
|
|
133
|
-
},
|
|
134
|
-
get onClick() {
|
|
135
|
-
return t.handleBreadcrumbClick;
|
|
136
|
-
}
|
|
137
|
-
}), n), a(n, i(j, {
|
|
138
|
-
get rootFolders() {
|
|
139
|
-
return t.rootFolders;
|
|
140
|
-
},
|
|
141
|
-
get selectedPath() {
|
|
142
|
-
return t.selectedPath;
|
|
143
|
-
},
|
|
144
|
-
get expandedPaths() {
|
|
145
|
-
return t.expandedPaths;
|
|
146
|
-
},
|
|
147
|
-
get revealNonce() {
|
|
148
|
-
return t.revealNonce;
|
|
149
|
-
},
|
|
150
|
-
get onToggle() {
|
|
151
|
-
return t.toggleExpand;
|
|
152
|
-
},
|
|
153
|
-
get onSelect() {
|
|
154
|
-
return t.handleSelectFolder;
|
|
155
|
-
},
|
|
156
|
-
get onSelectRoot() {
|
|
157
|
-
return t.handleSelectRoot;
|
|
158
|
-
},
|
|
159
|
-
get isSelectable() {
|
|
160
|
-
return t.isSelectable;
|
|
161
|
-
},
|
|
162
|
-
get homeLabel() {
|
|
163
|
-
return t.homeLabel;
|
|
164
|
-
},
|
|
165
|
-
class: "w-1/2 min-w-0 border-r border-border border-0 rounded-none",
|
|
166
|
-
style: {
|
|
167
|
-
"max-height": "none",
|
|
168
|
-
"min-height": "0"
|
|
169
|
-
}
|
|
170
|
-
}), o), a(o, i(g, {
|
|
92
|
+
var t = V(), l = t.firstChild, o = l.firstChild;
|
|
93
|
+
return n(t, a(R, _(e, {
|
|
94
|
+
source: s
|
|
95
|
+
})), l), z(o, _(() => e.scrollViewportProps, {
|
|
96
|
+
class: "max-h-[160px] w-full min-w-0 overflow-y-auto"
|
|
97
|
+
}), !1, !0), n(o, a(w, {
|
|
171
98
|
get when() {
|
|
172
|
-
return
|
|
99
|
+
return h().length > 0;
|
|
173
100
|
},
|
|
174
101
|
get fallback() {
|
|
175
|
-
return
|
|
102
|
+
return (() => {
|
|
103
|
+
var r = H();
|
|
104
|
+
return n(r, () => g(e).emptyFiles), r;
|
|
105
|
+
})();
|
|
176
106
|
},
|
|
177
107
|
get children() {
|
|
178
|
-
return
|
|
108
|
+
return a(K, {
|
|
179
109
|
get each() {
|
|
180
|
-
return
|
|
110
|
+
return h();
|
|
181
111
|
},
|
|
182
|
-
children: (
|
|
183
|
-
var
|
|
184
|
-
return
|
|
185
|
-
item:
|
|
112
|
+
children: (r) => (() => {
|
|
113
|
+
var i = L(), f = i.firstChild;
|
|
114
|
+
return i.$$click = () => S(r), n(i, a(j, {
|
|
115
|
+
item: r,
|
|
186
116
|
class: "w-4 h-4 flex-shrink-0"
|
|
187
|
-
}),
|
|
117
|
+
}), f), n(f, () => r.name), n(i, a(w, {
|
|
188
118
|
get when() {
|
|
189
|
-
return
|
|
119
|
+
return r.size != null;
|
|
190
120
|
},
|
|
191
121
|
get children() {
|
|
192
|
-
var
|
|
193
|
-
return
|
|
122
|
+
var d = J();
|
|
123
|
+
return n(d, () => Q(r.size)), d;
|
|
194
124
|
}
|
|
195
|
-
}), null),
|
|
125
|
+
}), null), F(() => B(i, N("flex items-center gap-1.5 w-full text-left text-xs py-1.5 px-2 cursor-pointer", "transition-colors duration-100", "hover:bg-accent/60", "focus:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-ring", c() === r.name && "bg-accent text-accent-foreground font-medium"))), i;
|
|
196
126
|
})()
|
|
197
127
|
});
|
|
198
128
|
}
|
|
199
|
-
})),
|
|
200
|
-
get when() {
|
|
201
|
-
return e.onCreateFolder;
|
|
202
|
-
},
|
|
203
|
-
get children() {
|
|
204
|
-
return i(q, {
|
|
205
|
-
get parentPath() {
|
|
206
|
-
return t.selectedPath;
|
|
207
|
-
},
|
|
208
|
-
get onCreateFolder() {
|
|
209
|
-
return e.onCreateFolder;
|
|
210
|
-
},
|
|
211
|
-
get toDisplayPath() {
|
|
212
|
-
return t.toDisplayPath;
|
|
213
|
-
}
|
|
214
|
-
});
|
|
215
|
-
}
|
|
216
|
-
}), null), r;
|
|
129
|
+
})), t;
|
|
217
130
|
}
|
|
218
131
|
});
|
|
219
132
|
}
|
|
220
|
-
function
|
|
133
|
+
function Q(e) {
|
|
221
134
|
return e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : `${(e / (1024 * 1024)).toFixed(1)} MB`;
|
|
222
135
|
}
|
|
223
|
-
|
|
136
|
+
D(["click"]);
|
|
224
137
|
export {
|
|
225
|
-
|
|
138
|
+
le as FileSavePicker
|
|
226
139
|
};
|