@harryy/react-file-browser 1.1.0 → 1.2.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/README.md +18 -1
- package/dist/components/file-browser.d.ts.map +1 -1
- package/dist/components/responsive.d.ts +26 -0
- package/dist/components/responsive.d.ts.map +1 -0
- package/dist/index.js +1766 -1308
- package/dist/index.js.map +1 -1
- package/dist/transfers/file-browser-provider.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4,15 +4,15 @@ import { t as d } from "./chunks/browser-4lIkMGbo.js";
|
|
|
4
4
|
import { createContext as f, createElement as p, forwardRef as m, useCallback as h, useContext as g, useEffect as _, useMemo as v, useRef as y, useState as b, useSyncExternalStore as x } from "react";
|
|
5
5
|
import S from "react-selecto";
|
|
6
6
|
import { createPortal as C } from "react-dom";
|
|
7
|
-
import { Fragment as
|
|
7
|
+
import { Fragment as ee, jsx as w, jsxs as T } from "react/jsx-runtime";
|
|
8
8
|
//#region src/core/use-file-browser.ts
|
|
9
|
-
function
|
|
10
|
-
let d = i === void 0 ? void 0 : a(i), [f, p] = b(() => a(o)), m = d ?? f, [g, x] = b("loading"), [S, C] = b([]), [
|
|
11
|
-
|
|
12
|
-
let
|
|
13
|
-
let t = typeof e == "function" ? e(
|
|
14
|
-
|
|
15
|
-
}, [c, u]),
|
|
9
|
+
function te({ adapter: n, path: i, initialPath: o = "/", onPathChange: s, searchQuery: c, initialSearchQuery: l = "", onSearchQueryChange: u }) {
|
|
10
|
+
let d = i === void 0 ? void 0 : a(i), [f, p] = b(() => a(o)), m = d ?? f, [g, x] = b("loading"), [S, C] = b([]), [ee, w] = b(), [T, te] = b(null), [D, O] = b(() => /* @__PURE__ */ new Set()), [oe, k] = b(null), [se, A] = b(null), [j, ce] = b(null), [le, M] = b("grid"), [ue, de] = b(l), fe = c ?? ue, [pe, N] = b("all"), [P, me] = b("name"), [he, ge] = b("asc"), _e = y(0), ve = y(m), ye = y(void 0), be = y(fe);
|
|
11
|
+
be.current = fe;
|
|
12
|
+
let xe = h((e) => {
|
|
13
|
+
let t = typeof e == "function" ? e(be.current) : e;
|
|
14
|
+
be.current = t, c === void 0 && de(t), u?.(t);
|
|
15
|
+
}, [c, u]), F = v(() => ({
|
|
16
16
|
createFolder: typeof n.createFolder == "function",
|
|
17
17
|
rename: typeof n.rename == "function",
|
|
18
18
|
move: typeof n.move == "function",
|
|
@@ -21,86 +21,86 @@ function ee({ adapter: n, path: i, initialPath: o = "/", onPathChange: s, search
|
|
|
21
21
|
exists: typeof n.exists == "function",
|
|
22
22
|
multipart: typeof n.createMultipartUpload == "function" && typeof n.uploadPart == "function" && typeof n.completeMultipartUpload == "function",
|
|
23
23
|
bulkDownload: typeof n.bulkDownloadUrl == "function"
|
|
24
|
-
}), [n]),
|
|
25
|
-
let e =
|
|
26
|
-
return [...S].filter((t) => e ? t.name.toLowerCase().includes(e) : !0).filter((e) =>
|
|
24
|
+
}), [n]), I = v(() => E(Array.from(D)), [D]), L = v(() => S.filter((e) => D.has(e.path)), [S, D]), Se = v(() => {
|
|
25
|
+
let e = fe.trim().toLowerCase();
|
|
26
|
+
return [...S].filter((t) => e ? t.name.toLowerCase().includes(e) : !0).filter((e) => pe === "all" ? !0 : e.kind === (pe === "files" ? "file" : "folder")).sort((e, t) => ie(e, t, P, he));
|
|
27
27
|
}, [
|
|
28
|
-
|
|
28
|
+
pe,
|
|
29
29
|
S,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
]),
|
|
34
|
-
let r = a(e), i = ++
|
|
35
|
-
x((e) => t === "replace" || e === "idle" ? "loading" : e),
|
|
30
|
+
fe,
|
|
31
|
+
P,
|
|
32
|
+
he
|
|
33
|
+
]), R = h(async (e, t) => {
|
|
34
|
+
let r = a(e), i = ++_e.current;
|
|
35
|
+
x((e) => t === "replace" || e === "idle" ? "loading" : e), te(null);
|
|
36
36
|
try {
|
|
37
|
-
let e = await n.list(r, { cursor: t === "append" ?
|
|
38
|
-
if (i !==
|
|
39
|
-
C((n) => t === "append" ?
|
|
37
|
+
let e = await n.list(r, { cursor: t === "append" ? ye.current : void 0 });
|
|
38
|
+
if (i !== _e.current) return;
|
|
39
|
+
C((n) => t === "append" ? ne(n, e.items) : e.items), ye.current = e.cursor, w(e.cursor), x("ready");
|
|
40
40
|
} catch (e) {
|
|
41
|
-
if (i !==
|
|
42
|
-
|
|
41
|
+
if (i !== _e.current) return;
|
|
42
|
+
te(ae(e)), x("error");
|
|
43
43
|
}
|
|
44
|
-
}, [n]),
|
|
45
|
-
await
|
|
46
|
-
}, [m,
|
|
44
|
+
}, [n]), z = h(async () => {
|
|
45
|
+
await R(m, "replace");
|
|
46
|
+
}, [m, R]), Ce = h(async (e, t = { source: "programmatic" }) => {
|
|
47
47
|
let n = a(e);
|
|
48
|
-
n !==
|
|
48
|
+
n !== ve.current && (s?.(n, t), d === void 0 && (ve.current = n, p(n), O(/* @__PURE__ */ new Set()), k(null), A(null), ye.current = void 0, w(void 0), await R(n, "replace")));
|
|
49
49
|
}, [
|
|
50
50
|
d,
|
|
51
|
-
|
|
51
|
+
R,
|
|
52
52
|
s
|
|
53
|
-
]),
|
|
54
|
-
!
|
|
53
|
+
]), we = h(async () => {
|
|
54
|
+
!ee || g === "loading" || await R(m, "append");
|
|
55
55
|
}, [
|
|
56
56
|
m,
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
ee,
|
|
58
|
+
R,
|
|
59
59
|
g
|
|
60
60
|
]);
|
|
61
61
|
_(() => {
|
|
62
62
|
let e = m;
|
|
63
|
-
e !==
|
|
63
|
+
e !== ve.current && (ve.current = e, O(/* @__PURE__ */ new Set()), k(null), A(null)), ye.current = void 0, w(void 0), Promise.resolve().then(() => R(e, "replace"));
|
|
64
64
|
}, [n, d]);
|
|
65
|
-
let
|
|
65
|
+
let B = h((e) => {
|
|
66
66
|
let t = a(e);
|
|
67
|
-
|
|
68
|
-
}, []),
|
|
67
|
+
O(/* @__PURE__ */ new Set([t])), k(t), A(t);
|
|
68
|
+
}, []), Te = h((e) => {
|
|
69
69
|
let t = a(e);
|
|
70
|
-
|
|
70
|
+
O((e) => {
|
|
71
71
|
let n = new Set(e);
|
|
72
72
|
return n.has(t) ? n.delete(t) : n.add(t), n;
|
|
73
|
-
}),
|
|
74
|
-
}, []),
|
|
75
|
-
let t = a(e), n =
|
|
73
|
+
}), k(t);
|
|
74
|
+
}, []), Ee = h((e) => {
|
|
75
|
+
let t = a(e), n = se ?? oe ?? t, r = Se.map((e) => e.path), i = r.indexOf(n), o = r.indexOf(t);
|
|
76
76
|
if (i === -1 || o === -1) {
|
|
77
|
-
|
|
77
|
+
B(t);
|
|
78
78
|
return;
|
|
79
79
|
}
|
|
80
80
|
let s = Math.min(i, o), c = Math.max(i, o);
|
|
81
|
-
|
|
81
|
+
O(new Set(r.slice(s, c + 1))), k(t);
|
|
82
82
|
}, [
|
|
83
|
-
|
|
84
|
-
ae,
|
|
83
|
+
Se,
|
|
85
84
|
oe,
|
|
86
|
-
|
|
87
|
-
|
|
85
|
+
se,
|
|
86
|
+
B
|
|
87
|
+
]), V = h((e, t = {}) => {
|
|
88
88
|
let n = e.map(a);
|
|
89
|
-
|
|
89
|
+
O((e) => {
|
|
90
90
|
let r = t.additive ? new Set(e) : /* @__PURE__ */ new Set();
|
|
91
91
|
for (let e of n) r.add(e);
|
|
92
92
|
return r;
|
|
93
|
-
}),
|
|
94
|
-
}, []),
|
|
95
|
-
|
|
96
|
-
}, [S]),
|
|
97
|
-
|
|
98
|
-
}, []),
|
|
99
|
-
e.kind === "folder" ? await
|
|
93
|
+
}), k(n.at(-1) ?? null), A(n.at(0) ?? null);
|
|
94
|
+
}, []), De = h(() => {
|
|
95
|
+
O(new Set(S.map((e) => e.path))), k(S.at(0)?.path ?? null), A(S.at(0)?.path ?? null);
|
|
96
|
+
}, [S]), Oe = h(() => {
|
|
97
|
+
O(/* @__PURE__ */ new Set()), k(null), A(null);
|
|
98
|
+
}, []), ke = h(async (e) => {
|
|
99
|
+
e.kind === "folder" ? await Ce(e.path, {
|
|
100
100
|
source: "item",
|
|
101
101
|
item: e
|
|
102
|
-
}) :
|
|
103
|
-
}, [
|
|
102
|
+
}) : B(e.path);
|
|
103
|
+
}, [Ce, B]), Ae = h(async (r) => {
|
|
104
104
|
if (!n.createFolder) throw new t("not_supported", "Folder creation is not supported by this adapter");
|
|
105
105
|
let i = e(m, r.trim()), a = {
|
|
106
106
|
path: i,
|
|
@@ -108,14 +108,14 @@ function ee({ adapter: n, path: i, initialPath: o = "/", onPathChange: s, search
|
|
|
108
108
|
kind: "folder",
|
|
109
109
|
modifiedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
110
110
|
};
|
|
111
|
-
C((e) =>
|
|
111
|
+
C((e) => ne(e, [a]));
|
|
112
112
|
try {
|
|
113
113
|
let e = await n.createFolder(i);
|
|
114
|
-
return C((t) =>
|
|
114
|
+
return C((t) => ne(re(t, [i]), [e])), e;
|
|
115
115
|
} catch (e) {
|
|
116
|
-
throw C((e) =>
|
|
116
|
+
throw C((e) => re(e, [i])), e;
|
|
117
117
|
}
|
|
118
|
-
}, [n, m]),
|
|
118
|
+
}, [n, m]), je = h(async (e, r) => {
|
|
119
119
|
if (!n.rename) throw new t("not_supported", "Rename is not supported by this adapter");
|
|
120
120
|
let i = a(e), o = S;
|
|
121
121
|
C((e) => e.map((e) => e.path === i ? {
|
|
@@ -128,9 +128,9 @@ function ee({ adapter: n, path: i, initialPath: o = "/", onPathChange: s, search
|
|
|
128
128
|
} catch (e) {
|
|
129
129
|
throw C(o), e;
|
|
130
130
|
}
|
|
131
|
-
}, [n, S]),
|
|
132
|
-
let t = e.map(a), i = S, o =
|
|
133
|
-
C((e) =>
|
|
131
|
+
}, [n, S]), Me = h(async (e) => {
|
|
132
|
+
let t = e.map(a), i = S, o = D;
|
|
133
|
+
C((e) => re(e, t)), O((e) => {
|
|
134
134
|
let n = new Set(e);
|
|
135
135
|
for (let e of t) n.delete(e);
|
|
136
136
|
return n;
|
|
@@ -140,17 +140,17 @@ function ee({ adapter: n, path: i, initialPath: o = "/", onPathChange: s, search
|
|
|
140
140
|
} catch (e) {
|
|
141
141
|
if (e instanceof r) {
|
|
142
142
|
let t = e.succeededPaths.map(a), n = e.failures.map((e) => a(e.path));
|
|
143
|
-
throw C(
|
|
143
|
+
throw C(re(i, t)), O(new Set(n)), k(n.at(0) ?? null), A(n.at(0) ?? null), e;
|
|
144
144
|
}
|
|
145
|
-
throw C(i),
|
|
145
|
+
throw C(i), O(o), e;
|
|
146
146
|
}
|
|
147
147
|
}, [
|
|
148
148
|
n,
|
|
149
149
|
S,
|
|
150
|
-
|
|
151
|
-
]),
|
|
152
|
-
await
|
|
153
|
-
}, [
|
|
150
|
+
D
|
|
151
|
+
]), Ne = h(async () => {
|
|
152
|
+
await Me(I);
|
|
153
|
+
}, [Me, I]), H = h(async (e, i) => {
|
|
154
154
|
if (!n.move) throw new t("not_supported", "Move is not supported by this adapter");
|
|
155
155
|
let o = e.map(a);
|
|
156
156
|
if (o.length === 0) return;
|
|
@@ -160,131 +160,131 @@ function ee({ adapter: n, path: i, initialPath: o = "/", onPathChange: s, search
|
|
|
160
160
|
} catch (e) {
|
|
161
161
|
if (e instanceof r) {
|
|
162
162
|
let t = e.succeededPaths.map(a), n = e.failures.map((e) => a(e.path));
|
|
163
|
-
throw s === m ? await
|
|
163
|
+
throw s === m ? await z() : C((e) => re(e, t)), O(new Set(n)), k(n.at(0) ?? null), A(n.at(0) ?? null), e;
|
|
164
164
|
}
|
|
165
165
|
throw e;
|
|
166
166
|
}
|
|
167
|
-
|
|
167
|
+
O((e) => {
|
|
168
168
|
let t = new Set(e);
|
|
169
169
|
for (let e of o) t.delete(e);
|
|
170
170
|
return t;
|
|
171
|
-
}),
|
|
171
|
+
}), k(null), A(null), s === m ? await z() : C((e) => re(e, o));
|
|
172
172
|
}, [
|
|
173
173
|
n,
|
|
174
174
|
m,
|
|
175
|
-
|
|
176
|
-
]),
|
|
177
|
-
await
|
|
178
|
-
}, [
|
|
179
|
-
|
|
175
|
+
z
|
|
176
|
+
]), Pe = h(async (e) => {
|
|
177
|
+
await H(I, e), ce((e) => e?.type === "cut" ? null : e);
|
|
178
|
+
}, [H, I]), Fe = h((e = I) => {
|
|
179
|
+
ce({
|
|
180
180
|
type: "copy",
|
|
181
181
|
paths: e.map(a)
|
|
182
182
|
});
|
|
183
|
-
}, [
|
|
184
|
-
|
|
183
|
+
}, [I]), Ie = h((e = I) => {
|
|
184
|
+
ce({
|
|
185
185
|
type: "cut",
|
|
186
186
|
paths: e.map(a)
|
|
187
187
|
});
|
|
188
|
-
}, [
|
|
189
|
-
if (!
|
|
188
|
+
}, [I]), Le = h(async (e) => {
|
|
189
|
+
if (!j || j.paths.length === 0) return;
|
|
190
190
|
let r = a(e);
|
|
191
|
-
if (
|
|
191
|
+
if (j.type === "copy") {
|
|
192
192
|
if (!n.copy) throw new t("not_supported", "Copy is not supported by this adapter");
|
|
193
|
-
await n.copy(
|
|
193
|
+
await n.copy(j.paths, r);
|
|
194
194
|
} else {
|
|
195
195
|
if (!n.move) throw new t("not_supported", "Move is not supported by this adapter");
|
|
196
|
-
await
|
|
196
|
+
await H(j.paths, r), ce(null);
|
|
197
197
|
return;
|
|
198
198
|
}
|
|
199
|
-
r === m && await
|
|
199
|
+
r === m && await z();
|
|
200
200
|
}, [
|
|
201
201
|
n,
|
|
202
|
-
|
|
202
|
+
j,
|
|
203
203
|
m,
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
]),
|
|
204
|
+
H,
|
|
205
|
+
z
|
|
206
|
+
]), Re = h(async (t, r = {}) => {
|
|
207
207
|
if (r.onConflict === "skip") return [];
|
|
208
208
|
let i = Array.from(t), a = [];
|
|
209
209
|
for (let t of i) {
|
|
210
|
-
let i = e(
|
|
211
|
-
a.push(o), C((e) =>
|
|
210
|
+
let i = e(ve.current, t.name), o = await n.upload(i, t, { onConflict: r.onConflict ?? "keep-both" });
|
|
211
|
+
a.push(o), C((e) => ne(e, [o]));
|
|
212
212
|
}
|
|
213
213
|
return a;
|
|
214
214
|
}, [n]);
|
|
215
215
|
return {
|
|
216
216
|
adapter: n,
|
|
217
|
-
capabilities:
|
|
217
|
+
capabilities: F,
|
|
218
218
|
currentPath: m,
|
|
219
219
|
status: g,
|
|
220
220
|
items: S,
|
|
221
|
-
error:
|
|
222
|
-
hasMore: !!
|
|
223
|
-
selectedPaths:
|
|
224
|
-
selectedItems:
|
|
225
|
-
focusedPath:
|
|
226
|
-
clipboard:
|
|
227
|
-
view:
|
|
228
|
-
searchQuery:
|
|
229
|
-
filterKind:
|
|
230
|
-
sortBy:
|
|
231
|
-
sortDirection:
|
|
232
|
-
filteredItems:
|
|
233
|
-
setView:
|
|
234
|
-
setSearchQuery:
|
|
235
|
-
setFilterKind:
|
|
236
|
-
setSortBy:
|
|
237
|
-
setSortDirection:
|
|
238
|
-
refresh:
|
|
239
|
-
loadMore:
|
|
240
|
-
navigate:
|
|
241
|
-
open:
|
|
242
|
-
selectOnly:
|
|
243
|
-
toggleSelection:
|
|
244
|
-
selectRange:
|
|
245
|
-
setSelection:
|
|
246
|
-
selectAllLoaded:
|
|
247
|
-
clearSelection:
|
|
248
|
-
createFolder:
|
|
249
|
-
rename:
|
|
250
|
-
deleteSelected:
|
|
251
|
-
deletePaths:
|
|
252
|
-
movePathsTo:
|
|
253
|
-
moveSelectedTo:
|
|
254
|
-
copySelection:
|
|
255
|
-
cutSelection:
|
|
256
|
-
pasteInto:
|
|
257
|
-
uploadFiles:
|
|
221
|
+
error: T,
|
|
222
|
+
hasMore: !!ee,
|
|
223
|
+
selectedPaths: I,
|
|
224
|
+
selectedItems: L,
|
|
225
|
+
focusedPath: oe,
|
|
226
|
+
clipboard: j,
|
|
227
|
+
view: le,
|
|
228
|
+
searchQuery: fe,
|
|
229
|
+
filterKind: pe,
|
|
230
|
+
sortBy: P,
|
|
231
|
+
sortDirection: he,
|
|
232
|
+
filteredItems: Se,
|
|
233
|
+
setView: M,
|
|
234
|
+
setSearchQuery: xe,
|
|
235
|
+
setFilterKind: N,
|
|
236
|
+
setSortBy: me,
|
|
237
|
+
setSortDirection: ge,
|
|
238
|
+
refresh: z,
|
|
239
|
+
loadMore: we,
|
|
240
|
+
navigate: Ce,
|
|
241
|
+
open: ke,
|
|
242
|
+
selectOnly: B,
|
|
243
|
+
toggleSelection: Te,
|
|
244
|
+
selectRange: Ee,
|
|
245
|
+
setSelection: V,
|
|
246
|
+
selectAllLoaded: De,
|
|
247
|
+
clearSelection: Oe,
|
|
248
|
+
createFolder: Ae,
|
|
249
|
+
rename: je,
|
|
250
|
+
deleteSelected: Ne,
|
|
251
|
+
deletePaths: Me,
|
|
252
|
+
movePathsTo: H,
|
|
253
|
+
moveSelectedTo: Pe,
|
|
254
|
+
copySelection: Fe,
|
|
255
|
+
cutSelection: Ie,
|
|
256
|
+
pasteInto: Le,
|
|
257
|
+
uploadFiles: Re
|
|
258
258
|
};
|
|
259
259
|
}
|
|
260
|
-
function
|
|
260
|
+
function ne(e, t) {
|
|
261
261
|
let n = new Map(e.map((e) => [e.path, e]));
|
|
262
262
|
for (let e of t) n.set(e.path, e);
|
|
263
|
-
return Array.from(n.values()).sort((e, t) =>
|
|
263
|
+
return Array.from(n.values()).sort((e, t) => ie(e, t, "name", "asc"));
|
|
264
264
|
}
|
|
265
|
-
function
|
|
265
|
+
function re(e, t) {
|
|
266
266
|
let n = new Set(t);
|
|
267
267
|
return e.filter((e) => !n.has(e.path));
|
|
268
268
|
}
|
|
269
|
-
function
|
|
269
|
+
function ie(e, t, n, r) {
|
|
270
270
|
let i = r === "asc" ? 1 : -1;
|
|
271
271
|
return e.kind === t.kind ? n === "size" ? ((e.size ?? 0) - (t.size ?? 0)) * i : n === "modifiedAt" ? String(e.modifiedAt ?? "").localeCompare(String(t.modifiedAt ?? "")) * i : e.name.localeCompare(t.name, void 0, {
|
|
272
272
|
numeric: !0,
|
|
273
273
|
sensitivity: "base"
|
|
274
274
|
}) * i : e.kind === "folder" ? -1 : 1;
|
|
275
275
|
}
|
|
276
|
-
function
|
|
276
|
+
function E(e) {
|
|
277
277
|
return [...e].sort((e, t) => e.localeCompare(t));
|
|
278
278
|
}
|
|
279
|
-
function
|
|
279
|
+
function ae(e) {
|
|
280
280
|
return e instanceof Error ? e : Error(String(e));
|
|
281
281
|
}
|
|
282
282
|
//#endregion
|
|
283
283
|
//#region node_modules/lucide-react/dist/esm/shared/src/utils/mergeClasses.mjs
|
|
284
|
-
var
|
|
285
|
-
let t =
|
|
284
|
+
var D = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) === t).join(" ").trim(), O = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), oe = (e) => e.replace(/^([A-Z])|[\s-_]+(\w)/g, (e, t, n) => n ? n.toUpperCase() : t.toLowerCase()), k = (e) => {
|
|
285
|
+
let t = oe(e);
|
|
286
286
|
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
287
|
-
},
|
|
287
|
+
}, se = {
|
|
288
288
|
xmlns: "http://www.w3.org/2000/svg",
|
|
289
289
|
width: 24,
|
|
290
290
|
height: 24,
|
|
@@ -294,37 +294,43 @@ var O = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) =
|
|
|
294
294
|
strokeWidth: 2,
|
|
295
295
|
strokeLinecap: "round",
|
|
296
296
|
strokeLinejoin: "round"
|
|
297
|
-
},
|
|
297
|
+
}, A = (e) => {
|
|
298
298
|
for (let t in e) if (t.startsWith("aria-") || t === "role" || t === "title") return !0;
|
|
299
299
|
return !1;
|
|
300
|
-
},
|
|
301
|
-
let { size: l = 24, strokeWidth: u = 2, absoluteStrokeWidth: d = !1, color: f = "currentColor", className: m = "" } =
|
|
300
|
+
}, j = f({}), ce = () => g(j), le = m(({ color: e, size: t, strokeWidth: n, absoluteStrokeWidth: r, className: i = "", children: a, iconNode: o, ...s }, c) => {
|
|
301
|
+
let { size: l = 24, strokeWidth: u = 2, absoluteStrokeWidth: d = !1, color: f = "currentColor", className: m = "" } = ce() ?? {}, h = r ?? d ? Number(n ?? u) * 24 / Number(t ?? l) : n ?? u;
|
|
302
302
|
return p("svg", {
|
|
303
303
|
ref: c,
|
|
304
|
-
...
|
|
305
|
-
width: t ?? l ??
|
|
306
|
-
height: t ?? l ??
|
|
304
|
+
...se,
|
|
305
|
+
width: t ?? l ?? se.width,
|
|
306
|
+
height: t ?? l ?? se.height,
|
|
307
307
|
stroke: e ?? f,
|
|
308
308
|
strokeWidth: h,
|
|
309
|
-
className:
|
|
310
|
-
...!a && !
|
|
309
|
+
className: D("lucide", m, i),
|
|
310
|
+
...!a && !A(s) && { "aria-hidden": "true" },
|
|
311
311
|
...s
|
|
312
312
|
}, [...o.map(([e, t]) => p(e, t)), ...Array.isArray(a) ? a : [a]]);
|
|
313
|
-
}),
|
|
314
|
-
let n = m(({ className: n, ...r }, i) => p(
|
|
313
|
+
}), M = (e, t) => {
|
|
314
|
+
let n = m(({ className: n, ...r }, i) => p(le, {
|
|
315
315
|
ref: i,
|
|
316
316
|
iconNode: t,
|
|
317
|
-
className:
|
|
317
|
+
className: D(`lucide-${O(k(e))}`, `lucide-${e}`, n),
|
|
318
318
|
...r
|
|
319
319
|
}));
|
|
320
|
-
return n.displayName =
|
|
321
|
-
},
|
|
320
|
+
return n.displayName = k(e), n;
|
|
321
|
+
}, ue = M("chevron-down", [["path", {
|
|
322
|
+
d: "m6 9 6 6 6-6",
|
|
323
|
+
key: "qrunsl"
|
|
324
|
+
}]]), de = M("chevron-left", [["path", {
|
|
322
325
|
d: "m15 18-6-6 6-6",
|
|
323
326
|
key: "1wnfg3"
|
|
324
|
-
}]]),
|
|
327
|
+
}]]), fe = M("chevron-right", [["path", {
|
|
325
328
|
d: "m9 18 6-6-6-6",
|
|
326
329
|
key: "mthhwq"
|
|
327
|
-
}]]),
|
|
330
|
+
}]]), pe = M("chevron-up", [["path", {
|
|
331
|
+
d: "m18 15-6-6-6 6",
|
|
332
|
+
key: "153udz"
|
|
333
|
+
}]]), N = M("copy", [["rect", {
|
|
328
334
|
width: "14",
|
|
329
335
|
height: "14",
|
|
330
336
|
x: "8",
|
|
@@ -335,7 +341,7 @@ var O = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) =
|
|
|
335
341
|
}], ["path", {
|
|
336
342
|
d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",
|
|
337
343
|
key: "zix9uf"
|
|
338
|
-
}]]),
|
|
344
|
+
}]]), P = M("download", [
|
|
339
345
|
["path", {
|
|
340
346
|
d: "M12 15V3",
|
|
341
347
|
key: "m9g1x1"
|
|
@@ -348,13 +354,32 @@ var O = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) =
|
|
|
348
354
|
d: "m7 10 5 5 5-5",
|
|
349
355
|
key: "brsn70"
|
|
350
356
|
}]
|
|
351
|
-
]),
|
|
357
|
+
]), me = M("ellipsis", [
|
|
358
|
+
["circle", {
|
|
359
|
+
cx: "12",
|
|
360
|
+
cy: "12",
|
|
361
|
+
r: "1",
|
|
362
|
+
key: "41hilf"
|
|
363
|
+
}],
|
|
364
|
+
["circle", {
|
|
365
|
+
cx: "19",
|
|
366
|
+
cy: "12",
|
|
367
|
+
r: "1",
|
|
368
|
+
key: "1wjl8i"
|
|
369
|
+
}],
|
|
370
|
+
["circle", {
|
|
371
|
+
cx: "5",
|
|
372
|
+
cy: "12",
|
|
373
|
+
r: "1",
|
|
374
|
+
key: "1pcz8c"
|
|
375
|
+
}]
|
|
376
|
+
]), he = M("file", [["path", {
|
|
352
377
|
d: "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",
|
|
353
378
|
key: "1oefj6"
|
|
354
379
|
}], ["path", {
|
|
355
380
|
d: "M14 2v5a1 1 0 0 0 1 1h5",
|
|
356
381
|
key: "wfsgrz"
|
|
357
|
-
}]]),
|
|
382
|
+
}]]), ge = M("folder-input", [
|
|
358
383
|
["path", {
|
|
359
384
|
d: "M2 9V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-1",
|
|
360
385
|
key: "fm4g5t"
|
|
@@ -367,10 +392,10 @@ var O = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) =
|
|
|
367
392
|
d: "m9 16 3-3-3-3",
|
|
368
393
|
key: "6m91ic"
|
|
369
394
|
}]
|
|
370
|
-
]),
|
|
395
|
+
]), _e = M("folder", [["path", {
|
|
371
396
|
d: "M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",
|
|
372
397
|
key: "1kt360"
|
|
373
|
-
}]]),
|
|
398
|
+
}]]), ve = M("grid-2x2", [
|
|
374
399
|
["path", {
|
|
375
400
|
d: "M12 3v18",
|
|
376
401
|
key: "108xh3"
|
|
@@ -387,7 +412,22 @@ var O = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) =
|
|
|
387
412
|
rx: "2",
|
|
388
413
|
key: "h1oib"
|
|
389
414
|
}]
|
|
390
|
-
]),
|
|
415
|
+
]), ye = M("info", [
|
|
416
|
+
["circle", {
|
|
417
|
+
cx: "12",
|
|
418
|
+
cy: "12",
|
|
419
|
+
r: "10",
|
|
420
|
+
key: "1mglay"
|
|
421
|
+
}],
|
|
422
|
+
["path", {
|
|
423
|
+
d: "M12 16v-4",
|
|
424
|
+
key: "1dtifu"
|
|
425
|
+
}],
|
|
426
|
+
["path", {
|
|
427
|
+
d: "M12 8h.01",
|
|
428
|
+
key: "e9boi3"
|
|
429
|
+
}]
|
|
430
|
+
]), be = M("list", [
|
|
391
431
|
["path", {
|
|
392
432
|
d: "M3 5h.01",
|
|
393
433
|
key: "18ugdj"
|
|
@@ -412,7 +452,7 @@ var O = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) =
|
|
|
412
452
|
d: "M8 19h13",
|
|
413
453
|
key: "m83p4d"
|
|
414
454
|
}]
|
|
415
|
-
]),
|
|
455
|
+
]), xe = M("pause", [["rect", {
|
|
416
456
|
x: "14",
|
|
417
457
|
y: "3",
|
|
418
458
|
width: "5",
|
|
@@ -426,16 +466,16 @@ var O = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) =
|
|
|
426
466
|
height: "18",
|
|
427
467
|
rx: "1",
|
|
428
468
|
key: "1wsw3u"
|
|
429
|
-
}]]),
|
|
469
|
+
}]]), F = M("pencil", [["path", {
|
|
430
470
|
d: "M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",
|
|
431
471
|
key: "1a8usu"
|
|
432
472
|
}], ["path", {
|
|
433
473
|
d: "m15 5 4 4",
|
|
434
474
|
key: "1mk7zo"
|
|
435
|
-
}]]),
|
|
475
|
+
}]]), I = M("play", [["path", {
|
|
436
476
|
d: "M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",
|
|
437
477
|
key: "10ikf1"
|
|
438
|
-
}]]),
|
|
478
|
+
}]]), L = M("scissors", [
|
|
439
479
|
["circle", {
|
|
440
480
|
cx: "6",
|
|
441
481
|
cy: "6",
|
|
@@ -460,7 +500,7 @@ var O = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) =
|
|
|
460
500
|
d: "M14.8 14.8 20 20",
|
|
461
501
|
key: "ptml3r"
|
|
462
502
|
}]
|
|
463
|
-
]),
|
|
503
|
+
]), Se = M("search", [["path", {
|
|
464
504
|
d: "m21 21-4.34-4.34",
|
|
465
505
|
key: "14j7rj"
|
|
466
506
|
}], ["circle", {
|
|
@@ -468,20 +508,20 @@ var O = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) =
|
|
|
468
508
|
cy: "11",
|
|
469
509
|
r: "8",
|
|
470
510
|
key: "4ej97u"
|
|
471
|
-
}]]),
|
|
511
|
+
}]]), R = M("square-check-big", [["path", {
|
|
472
512
|
d: "M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344",
|
|
473
513
|
key: "2acyp4"
|
|
474
514
|
}], ["path", {
|
|
475
515
|
d: "m9 11 3 3L22 4",
|
|
476
516
|
key: "1pflzl"
|
|
477
|
-
}]]),
|
|
517
|
+
}]]), z = M("square", [["rect", {
|
|
478
518
|
width: "18",
|
|
479
519
|
height: "18",
|
|
480
520
|
x: "3",
|
|
481
521
|
y: "3",
|
|
482
522
|
rx: "2",
|
|
483
523
|
key: "afitv7"
|
|
484
|
-
}]]),
|
|
524
|
+
}]]), Ce = M("trash-2", [
|
|
485
525
|
["path", {
|
|
486
526
|
d: "M10 11v6",
|
|
487
527
|
key: "nco0om"
|
|
@@ -502,7 +542,7 @@ var O = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) =
|
|
|
502
542
|
d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",
|
|
503
543
|
key: "e791ji"
|
|
504
544
|
}]
|
|
505
|
-
]),
|
|
545
|
+
]), we = M("upload", [
|
|
506
546
|
["path", {
|
|
507
547
|
d: "M12 3v12",
|
|
508
548
|
key: "1x0j5s"
|
|
@@ -515,7 +555,7 @@ var O = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) =
|
|
|
515
555
|
d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",
|
|
516
556
|
key: "ih7n3h"
|
|
517
557
|
}]
|
|
518
|
-
]),
|
|
558
|
+
]), B = M("x", [["path", {
|
|
519
559
|
d: "M18 6 6 18",
|
|
520
560
|
key: "1bl5f8"
|
|
521
561
|
}], ["path", {
|
|
@@ -524,37 +564,37 @@ var O = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) =
|
|
|
524
564
|
}]]);
|
|
525
565
|
//#endregion
|
|
526
566
|
//#region src/core/upload-drop.ts
|
|
527
|
-
async function
|
|
567
|
+
async function Te(e) {
|
|
528
568
|
let t = Array.from(e.items).map((e) => e.webkitGetAsEntry?.()).filter((e) => !!e);
|
|
529
|
-
if (t.length === 0) return
|
|
569
|
+
if (t.length === 0) return Ee(e.files);
|
|
530
570
|
let n = [];
|
|
531
|
-
for (let e of t) n.push(...await
|
|
571
|
+
for (let e of t) n.push(...await V(e));
|
|
532
572
|
return n;
|
|
533
573
|
}
|
|
534
|
-
function
|
|
574
|
+
function Ee(e) {
|
|
535
575
|
return Array.from(e).map((e) => ({
|
|
536
576
|
file: e,
|
|
537
|
-
relativePath:
|
|
577
|
+
relativePath: je(ke(e))
|
|
538
578
|
}));
|
|
539
579
|
}
|
|
540
|
-
async function
|
|
580
|
+
async function V(e, t = "") {
|
|
541
581
|
if (e.isFile) {
|
|
542
|
-
let n = await
|
|
582
|
+
let n = await De(e);
|
|
543
583
|
return [{
|
|
544
584
|
file: n,
|
|
545
|
-
relativePath:
|
|
585
|
+
relativePath: je(Ae(t, n.name))
|
|
546
586
|
}];
|
|
547
587
|
}
|
|
548
|
-
let n =
|
|
549
|
-
for (let e of r) i.push(...await
|
|
588
|
+
let n = Ae(t, e.name), r = await Oe(e), i = [];
|
|
589
|
+
for (let e of r) i.push(...await V(e, n));
|
|
550
590
|
return i;
|
|
551
591
|
}
|
|
552
|
-
function
|
|
592
|
+
function De(e) {
|
|
553
593
|
return new Promise((t, n) => {
|
|
554
594
|
e.file(t, n);
|
|
555
595
|
});
|
|
556
596
|
}
|
|
557
|
-
async function
|
|
597
|
+
async function Oe(e) {
|
|
558
598
|
let t = e.createReader(), n = [];
|
|
559
599
|
for (;;) {
|
|
560
600
|
let e = await new Promise((e, n) => {
|
|
@@ -565,18 +605,18 @@ async function Se(e) {
|
|
|
565
605
|
}
|
|
566
606
|
return n;
|
|
567
607
|
}
|
|
568
|
-
function
|
|
608
|
+
function ke(e) {
|
|
569
609
|
return e.webkitRelativePath || e.name;
|
|
570
610
|
}
|
|
571
|
-
function
|
|
611
|
+
function Ae(...e) {
|
|
572
612
|
return e.filter(Boolean).join("/");
|
|
573
613
|
}
|
|
574
|
-
function
|
|
614
|
+
function je(e) {
|
|
575
615
|
return e.replaceAll("\\", "/").split("/").filter((e) => e && e !== "." && e !== "..").join("/");
|
|
576
616
|
}
|
|
577
617
|
//#endregion
|
|
578
618
|
//#region src/transfers/transfer-manager.ts
|
|
579
|
-
var
|
|
619
|
+
var Me = "react-file-browser-transfers", Ne = 1440 * 60 * 1e3, H = class {
|
|
580
620
|
uploads = /* @__PURE__ */ new Map();
|
|
581
621
|
downloads = /* @__PURE__ */ new Map();
|
|
582
622
|
uploadSpeedSamples = /* @__PURE__ */ new Map();
|
|
@@ -590,7 +630,7 @@ var Ee = "react-file-browser-transfers", De = 1440 * 60 * 1e3, Oe = class {
|
|
|
590
630
|
maxConcurrentUploads;
|
|
591
631
|
snapshotCache;
|
|
592
632
|
constructor(e = {}) {
|
|
593
|
-
this.storage = e.storage ?? void 0, this.storageKey = e.storageKey ??
|
|
633
|
+
this.storage = e.storage ?? void 0, this.storageKey = e.storageKey ?? Me, this.idFactory = e.idFactory ?? W, this.now = e.now ?? (() => /* @__PURE__ */ new Date()), this.maxConcurrentUploads = Ue(e.maxConcurrentUploads), this.restorePersisted(), this.downloads.size > 0 && this.pruneExpiredDownloads();
|
|
594
634
|
}
|
|
595
635
|
subscribe(e) {
|
|
596
636
|
return this.subscribers.add(e), () => {
|
|
@@ -599,13 +639,13 @@ var Ee = "react-file-browser-transfers", De = 1440 * 60 * 1e3, Oe = class {
|
|
|
599
639
|
}
|
|
600
640
|
getSnapshot() {
|
|
601
641
|
return this.snapshotCache ??= {
|
|
602
|
-
uploads: Array.from(this.uploads.values()).map(
|
|
603
|
-
downloads: Array.from(this.downloads.values()).map((e) => ({ ...
|
|
642
|
+
uploads: Array.from(this.uploads.values()).map(Re),
|
|
643
|
+
downloads: Array.from(this.downloads.values()).map((e) => ({ ...U(e) }))
|
|
604
644
|
}, this.snapshotCache;
|
|
605
645
|
}
|
|
606
646
|
getUpload(e) {
|
|
607
647
|
let t = this.uploads.get(e);
|
|
608
|
-
return t ?
|
|
648
|
+
return t ? Re(t) : void 0;
|
|
609
649
|
}
|
|
610
650
|
getRestorableUploads() {
|
|
611
651
|
return Array.from(this.uploads.values()).filter((e) => [
|
|
@@ -613,7 +653,7 @@ var Ee = "react-file-browser-transfers", De = 1440 * 60 * 1e3, Oe = class {
|
|
|
613
653
|
"uploading",
|
|
614
654
|
"paused",
|
|
615
655
|
"failed"
|
|
616
|
-
].includes(e.status)).filter((e) => !e.file || !e.adapter).map(
|
|
656
|
+
].includes(e.status)).filter((e) => !e.file || !e.adapter).map(Re);
|
|
617
657
|
}
|
|
618
658
|
dismissRestoredUploads(e) {
|
|
619
659
|
for (let t of e) {
|
|
@@ -624,7 +664,7 @@ var Ee = "react-file-browser-transfers", De = 1440 * 60 * 1e3, Oe = class {
|
|
|
624
664
|
}
|
|
625
665
|
dismissDownload(e) {
|
|
626
666
|
let t = this.downloads.get(e);
|
|
627
|
-
t && (
|
|
667
|
+
t && (Ge(t.url), this.downloads.delete(e), this.persistAndNotify());
|
|
628
668
|
}
|
|
629
669
|
hasActiveTransfers() {
|
|
630
670
|
let e = this.getSnapshot();
|
|
@@ -686,12 +726,12 @@ var Ee = "react-file-browser-transfers", De = 1440 * 60 * 1e3, Oe = class {
|
|
|
686
726
|
if (e.bulkDownloadUrl) {
|
|
687
727
|
let n = await e.bulkDownloadUrl(t);
|
|
688
728
|
s.status = "ready", s.url = n.url, s.expiresAt = n.expiresAt;
|
|
689
|
-
} else if (i) n > r ? (s.status = "warning", s.warning = "client_zip_size") : (s.url = await
|
|
729
|
+
} else if (i) n > r ? (s.status = "warning", s.warning = "client_zip_size") : (s.url = await qe(e, t), s.status = "ready");
|
|
690
730
|
else throw Error("Client-side ZIP fallback is disabled.");
|
|
691
731
|
} catch (e) {
|
|
692
|
-
s.status = "failed", s.error =
|
|
732
|
+
s.status = "failed", s.error = Ke(e);
|
|
693
733
|
}
|
|
694
|
-
return s.updatedAt = this.timestamp(), this.persistAndNotify(),
|
|
734
|
+
return s.updatedAt = this.timestamp(), this.persistAndNotify(), U(s);
|
|
695
735
|
}
|
|
696
736
|
async prepareSingleDownload({ adapter: e, path: t, selectedBytes: n = 0 }) {
|
|
697
737
|
let r = this.idFactory(), i = this.timestamp(), a = {
|
|
@@ -709,22 +749,22 @@ var Ee = "react-file-browser-transfers", De = 1440 * 60 * 1e3, Oe = class {
|
|
|
709
749
|
try {
|
|
710
750
|
a.url = await e.signedUrl(t), a.status = "ready";
|
|
711
751
|
} catch (e) {
|
|
712
|
-
a.status = "failed", a.error =
|
|
752
|
+
a.status = "failed", a.error = Ke(e);
|
|
713
753
|
}
|
|
714
|
-
return a.updatedAt = this.timestamp(), this.persistAndNotify(),
|
|
754
|
+
return a.updatedAt = this.timestamp(), this.persistAndNotify(), U(a);
|
|
715
755
|
}
|
|
716
756
|
async confirmBulkDownload(e) {
|
|
717
757
|
let t = this.downloads.get(e);
|
|
718
758
|
if (t) {
|
|
719
|
-
if (t.status !== "warning") return
|
|
720
|
-
if (!t.adapter) return t.status = "failed", t.error = "This download can no longer continue in the current session.", t.updatedAt = this.timestamp(), this.persistAndNotify(),
|
|
759
|
+
if (t.status !== "warning") return U(t);
|
|
760
|
+
if (!t.adapter) return t.status = "failed", t.error = "This download can no longer continue in the current session.", t.updatedAt = this.timestamp(), this.persistAndNotify(), U(t);
|
|
721
761
|
t.status = "preparing", t.warning = void 0, t.updatedAt = this.timestamp(), this.persistAndNotify();
|
|
722
762
|
try {
|
|
723
|
-
t.url = await
|
|
763
|
+
t.url = await qe(t.adapter, t.paths), t.status = "ready";
|
|
724
764
|
} catch (e) {
|
|
725
|
-
t.status = "failed", t.error =
|
|
765
|
+
t.status = "failed", t.error = Ke(e);
|
|
726
766
|
}
|
|
727
|
-
return t.updatedAt = this.timestamp(), this.persistAndNotify(),
|
|
767
|
+
return t.updatedAt = this.timestamp(), this.persistAndNotify(), U(t);
|
|
728
768
|
}
|
|
729
769
|
}
|
|
730
770
|
async runUpload(e) {
|
|
@@ -732,7 +772,7 @@ var Ee = "react-file-browser-transfers", De = 1440 * 60 * 1e3, Oe = class {
|
|
|
732
772
|
if (!(!t?.adapter || !t.file || t.status !== "queued")) {
|
|
733
773
|
t.status = "uploading", t.updatedAt = this.timestamp(), this.persistAndNotify();
|
|
734
774
|
try {
|
|
735
|
-
let e =
|
|
775
|
+
let e = Pe(t.adapter) ? await this.runMultipartUpload(t) : await this.runSimpleUpload(t);
|
|
736
776
|
if (["paused", "cancelled"].includes(t.status)) {
|
|
737
777
|
this.uploadSpeedSamples.delete(t.id), this.persistAndNotify();
|
|
738
778
|
return;
|
|
@@ -743,7 +783,7 @@ var Ee = "react-file-browser-transfers", De = 1440 * 60 * 1e3, Oe = class {
|
|
|
743
783
|
this.uploadSpeedSamples.delete(t.id), this.persistAndNotify();
|
|
744
784
|
return;
|
|
745
785
|
}
|
|
746
|
-
t.status = "failed", t.error =
|
|
786
|
+
t.status = "failed", t.error = Ke(e), this.uploadSpeedSamples.delete(t.id), t.updatedAt = this.timestamp(), this.persistAndNotify();
|
|
747
787
|
}
|
|
748
788
|
}
|
|
749
789
|
}
|
|
@@ -759,16 +799,16 @@ var Ee = "react-file-browser-transfers", De = 1440 * 60 * 1e3, Oe = class {
|
|
|
759
799
|
}
|
|
760
800
|
async runMultipartUpload(e) {
|
|
761
801
|
let t = e.adapter, n = e.file;
|
|
762
|
-
if (!t || !n || !
|
|
802
|
+
if (!t || !n || !Pe(t)) throw Error("Multipart upload is not available");
|
|
763
803
|
if (!e.uploadId || !e.partSize) {
|
|
764
|
-
await
|
|
804
|
+
await Ie(e);
|
|
765
805
|
let r = await t.createMultipartUpload(e.path, n.size);
|
|
766
806
|
e.uploadId = r.uploadId, e.partSize = r.partSize, e.updatedAt = this.timestamp(), this.persistAndNotify();
|
|
767
807
|
}
|
|
768
808
|
let r = e.partSize, i = Math.ceil(n.size / r);
|
|
769
809
|
for (let a = 1; a <= i; a += 1) {
|
|
770
810
|
if (e.completedParts.some((e) => e.partNumber === a)) continue;
|
|
771
|
-
let i = (a - 1) * r, o = Math.min(i + r, n.size), s = n.slice(i, o), c =
|
|
811
|
+
let i = (a - 1) * r, o = Math.min(i + r, n.size), s = n.slice(i, o), c = Fe(e), l = await t.uploadPart({
|
|
772
812
|
uploadId: e.uploadId,
|
|
773
813
|
partNumber: a,
|
|
774
814
|
chunk: s,
|
|
@@ -780,7 +820,7 @@ var Ee = "react-file-browser-transfers", De = 1440 * 60 * 1e3, Oe = class {
|
|
|
780
820
|
e.completedParts = [...e.completedParts, {
|
|
781
821
|
partNumber: a,
|
|
782
822
|
etag: l.etag
|
|
783
|
-
}].sort((e, t) => e.partNumber - t.partNumber), e.loadedBytes =
|
|
823
|
+
}].sort((e, t) => e.partNumber - t.partNumber), e.loadedBytes = Fe(e), e.updatedAt = this.timestamp(), this.persistAndNotify();
|
|
784
824
|
}
|
|
785
825
|
return t.completeMultipartUpload({
|
|
786
826
|
uploadId: e.uploadId,
|
|
@@ -814,8 +854,8 @@ var Ee = "react-file-browser-transfers", De = 1440 * 60 * 1e3, Oe = class {
|
|
|
814
854
|
persist() {
|
|
815
855
|
if (!this.storage) return;
|
|
816
856
|
let e = {
|
|
817
|
-
uploads: Array.from(this.uploads.values()).map(
|
|
818
|
-
downloads: Array.from(this.downloads.values()).map(
|
|
857
|
+
uploads: Array.from(this.uploads.values()).map(ze),
|
|
858
|
+
downloads: Array.from(this.downloads.values()).map(Ve)
|
|
819
859
|
};
|
|
820
860
|
this.storage.setItem(this.storageKey, JSON.stringify(e));
|
|
821
861
|
}
|
|
@@ -825,11 +865,11 @@ var Ee = "react-file-browser-transfers", De = 1440 * 60 * 1e3, Oe = class {
|
|
|
825
865
|
if (e) try {
|
|
826
866
|
let t = JSON.parse(e);
|
|
827
867
|
for (let e of t.uploads ?? []) {
|
|
828
|
-
let t =
|
|
868
|
+
let t = Be(e);
|
|
829
869
|
this.uploads.set(t.id, t);
|
|
830
870
|
}
|
|
831
871
|
for (let e of t.downloads ?? []) {
|
|
832
|
-
let t =
|
|
872
|
+
let t = He(e);
|
|
833
873
|
this.downloads.set(t.id, t);
|
|
834
874
|
}
|
|
835
875
|
} catch {
|
|
@@ -841,33 +881,33 @@ var Ee = "react-file-browser-transfers", De = 1440 * 60 * 1e3, Oe = class {
|
|
|
841
881
|
}
|
|
842
882
|
pruneExpiredDownloads() {
|
|
843
883
|
let e = this.now().getTime(), t = !1;
|
|
844
|
-
for (let [n, r] of this.downloads)
|
|
884
|
+
for (let [n, r] of this.downloads) We(r, e) && (Ge(r.url), this.downloads.delete(n), t = !0);
|
|
845
885
|
t && (this.snapshotCache = void 0, this.persist());
|
|
846
886
|
}
|
|
847
887
|
};
|
|
848
|
-
function
|
|
888
|
+
function Pe(e) {
|
|
849
889
|
return typeof e.createMultipartUpload == "function" && typeof e.uploadPart == "function" && typeof e.completeMultipartUpload == "function";
|
|
850
890
|
}
|
|
851
|
-
function
|
|
891
|
+
function Fe(e) {
|
|
852
892
|
let t = e.partSize ?? e.totalBytes;
|
|
853
893
|
return e.completedParts.reduce((n, r) => {
|
|
854
894
|
let i = (r.partNumber - 1) * t;
|
|
855
895
|
return n + Math.min(t, e.totalBytes - i);
|
|
856
896
|
}, 0);
|
|
857
897
|
}
|
|
858
|
-
async function
|
|
898
|
+
async function Ie(e) {
|
|
859
899
|
let n = e.adapter;
|
|
860
900
|
if (!n?.exists) return;
|
|
861
901
|
let r = (e) => n.exists?.(e) ?? Promise.resolve({});
|
|
862
902
|
if ((await r([e.path]))[e.path]) {
|
|
863
903
|
if (e.onConflict === "keep-both") {
|
|
864
|
-
e.path = await
|
|
904
|
+
e.path = await Le(r, e.path);
|
|
865
905
|
return;
|
|
866
906
|
}
|
|
867
907
|
if (e.onConflict !== "replace") throw new t("conflict", `A file browser entry already exists at ${e.path}`);
|
|
868
908
|
}
|
|
869
909
|
}
|
|
870
|
-
async function
|
|
910
|
+
async function Le(n, r) {
|
|
871
911
|
let a = o(r), s = i(r), c = s.lastIndexOf("."), l = c > 0, u = l ? s.slice(0, c) : s, d = l ? s.slice(c) : "";
|
|
872
912
|
for (let t = 1; t < 2 ** 53 - 1; t += 1) {
|
|
873
913
|
let r = e(a, `${u} (${t})${d}`);
|
|
@@ -875,21 +915,21 @@ async function W(n, r) {
|
|
|
875
915
|
}
|
|
876
916
|
throw new t("conflict", `Could not allocate a unique file browser path for ${r}`);
|
|
877
917
|
}
|
|
878
|
-
function
|
|
918
|
+
function Re(e) {
|
|
879
919
|
return {
|
|
880
920
|
...e,
|
|
881
921
|
group: e.group ? { ...e.group } : void 0,
|
|
882
922
|
completedParts: e.completedParts.map((e) => ({ ...e }))
|
|
883
923
|
};
|
|
884
924
|
}
|
|
885
|
-
function
|
|
925
|
+
function U(e) {
|
|
886
926
|
let { adapter: t, ...n } = e;
|
|
887
927
|
return {
|
|
888
928
|
...n,
|
|
889
929
|
paths: [...e.paths]
|
|
890
930
|
};
|
|
891
931
|
}
|
|
892
|
-
function
|
|
932
|
+
function ze(e) {
|
|
893
933
|
return {
|
|
894
934
|
id: e.id,
|
|
895
935
|
kind: e.kind,
|
|
@@ -909,7 +949,7 @@ function Ne(e) {
|
|
|
909
949
|
group: e.group ? { ...e.group } : void 0
|
|
910
950
|
};
|
|
911
951
|
}
|
|
912
|
-
function
|
|
952
|
+
function Be(e) {
|
|
913
953
|
return {
|
|
914
954
|
id: e.id,
|
|
915
955
|
kind: "upload",
|
|
@@ -929,7 +969,7 @@ function Pe(e) {
|
|
|
929
969
|
group: e.group ? { ...e.group } : void 0
|
|
930
970
|
};
|
|
931
971
|
}
|
|
932
|
-
function
|
|
972
|
+
function Ve(e) {
|
|
933
973
|
return {
|
|
934
974
|
id: e.id,
|
|
935
975
|
kind: e.kind,
|
|
@@ -945,34 +985,34 @@ function Fe(e) {
|
|
|
945
985
|
error: e.error
|
|
946
986
|
};
|
|
947
987
|
}
|
|
948
|
-
function
|
|
949
|
-
return
|
|
988
|
+
function He(e) {
|
|
989
|
+
return Ve(e);
|
|
950
990
|
}
|
|
951
|
-
function
|
|
991
|
+
function Ue(e) {
|
|
952
992
|
if (e === void 0) return Infinity;
|
|
953
993
|
if (!Number.isInteger(e) || e < 1) throw RangeError("maxConcurrentUploads must be a positive integer");
|
|
954
994
|
return e;
|
|
955
995
|
}
|
|
956
|
-
function
|
|
996
|
+
function We(e, t) {
|
|
957
997
|
if (e.status === "preparing") return !1;
|
|
958
998
|
if (e.expiresAt) {
|
|
959
999
|
let n = Date.parse(e.expiresAt);
|
|
960
1000
|
if (Number.isFinite(n) && n <= t) return !0;
|
|
961
1001
|
}
|
|
962
1002
|
let n = Date.parse(e.updatedAt);
|
|
963
|
-
return Number.isFinite(n) && t - n >
|
|
1003
|
+
return Number.isFinite(n) && t - n > Ne;
|
|
964
1004
|
}
|
|
965
|
-
function
|
|
1005
|
+
function Ge(e) {
|
|
966
1006
|
!e?.startsWith("blob:") || typeof URL > "u" || typeof URL.revokeObjectURL != "function" || URL.revokeObjectURL(e);
|
|
967
1007
|
}
|
|
968
|
-
function
|
|
1008
|
+
function W() {
|
|
969
1009
|
return `transfer-${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`;
|
|
970
1010
|
}
|
|
971
|
-
function
|
|
1011
|
+
function Ke(e) {
|
|
972
1012
|
return e instanceof Error ? e.message : String(e);
|
|
973
1013
|
}
|
|
974
|
-
async function
|
|
975
|
-
let n = await
|
|
1014
|
+
async function qe(e, t) {
|
|
1015
|
+
let n = await G(e, t), r = {};
|
|
976
1016
|
for (let t of n) {
|
|
977
1017
|
let n = await e.signedUrl(t.path), i = await fetch(n);
|
|
978
1018
|
if (!i.ok) throw Error(`Could not fetch ${t.path} for the client zip`);
|
|
@@ -981,52 +1021,52 @@ async function Ve(e, t) {
|
|
|
981
1021
|
let i = d(r);
|
|
982
1022
|
return URL.createObjectURL(new Blob([i], { type: "application/zip" }));
|
|
983
1023
|
}
|
|
984
|
-
async function
|
|
1024
|
+
async function G(e, t) {
|
|
985
1025
|
let n = [], r = /* @__PURE__ */ new Set();
|
|
986
|
-
for (let i of t) await
|
|
1026
|
+
for (let i of t) await Je(e, i, n, r);
|
|
987
1027
|
return n;
|
|
988
1028
|
}
|
|
989
|
-
async function
|
|
1029
|
+
async function Je(e, t, n, r) {
|
|
990
1030
|
if (r.has(t)) return;
|
|
991
1031
|
r.add(t);
|
|
992
|
-
let i = await
|
|
1032
|
+
let i = await K(e, t);
|
|
993
1033
|
if (i?.kind === "file") {
|
|
994
1034
|
n.push({
|
|
995
1035
|
path: t,
|
|
996
|
-
archivePath:
|
|
1036
|
+
archivePath: Ze(t)
|
|
997
1037
|
});
|
|
998
1038
|
return;
|
|
999
1039
|
}
|
|
1000
1040
|
if (i?.kind === "folder") {
|
|
1001
|
-
await
|
|
1041
|
+
await Ye(e, t, n, r);
|
|
1002
1042
|
return;
|
|
1003
1043
|
}
|
|
1004
|
-
let a = await
|
|
1044
|
+
let a = await Xe(e, t);
|
|
1005
1045
|
if (a) {
|
|
1006
|
-
for (let t of a) await
|
|
1046
|
+
for (let t of a) await Je(e, t.path, n, r);
|
|
1007
1047
|
return;
|
|
1008
1048
|
}
|
|
1009
1049
|
n.push({
|
|
1010
1050
|
path: t,
|
|
1011
|
-
archivePath:
|
|
1051
|
+
archivePath: Ze(t)
|
|
1012
1052
|
});
|
|
1013
1053
|
}
|
|
1014
|
-
async function
|
|
1054
|
+
async function Ye(e, t, n, r) {
|
|
1015
1055
|
let i;
|
|
1016
1056
|
do {
|
|
1017
1057
|
let a = await e.list(t, { cursor: i });
|
|
1018
|
-
for (let t of a.items) await
|
|
1058
|
+
for (let t of a.items) await Je(e, t.path, n, r);
|
|
1019
1059
|
i = a.cursor;
|
|
1020
1060
|
} while (i);
|
|
1021
1061
|
}
|
|
1022
|
-
async function
|
|
1062
|
+
async function K(e, t) {
|
|
1023
1063
|
if (e.stat) try {
|
|
1024
1064
|
return await e.stat(t);
|
|
1025
1065
|
} catch {
|
|
1026
1066
|
return;
|
|
1027
1067
|
}
|
|
1028
1068
|
}
|
|
1029
|
-
async function
|
|
1069
|
+
async function Xe(e, t) {
|
|
1030
1070
|
try {
|
|
1031
1071
|
let n, r = [];
|
|
1032
1072
|
do {
|
|
@@ -1038,15 +1078,132 @@ async function Ge(e, t) {
|
|
|
1038
1078
|
return;
|
|
1039
1079
|
}
|
|
1040
1080
|
}
|
|
1041
|
-
function
|
|
1081
|
+
function Ze(e) {
|
|
1042
1082
|
return e.replace(/^\/+/, "") || "download";
|
|
1043
1083
|
}
|
|
1044
1084
|
//#endregion
|
|
1085
|
+
//#region src/components/responsive.tsx
|
|
1086
|
+
function Qe() {
|
|
1087
|
+
let [e, t] = b(!1);
|
|
1088
|
+
return _(() => {
|
|
1089
|
+
let e = window.matchMedia?.("(max-width: 39.999rem)");
|
|
1090
|
+
if (!e) return;
|
|
1091
|
+
let n = () => t(e.matches);
|
|
1092
|
+
return n(), e.addEventListener("change", n), () => e.removeEventListener("change", n);
|
|
1093
|
+
}, []), e;
|
|
1094
|
+
}
|
|
1095
|
+
function $e(e) {
|
|
1096
|
+
let [t, n] = b(null), [r, i] = b(16);
|
|
1097
|
+
return _(() => {
|
|
1098
|
+
let t = e.current;
|
|
1099
|
+
if (!t) return;
|
|
1100
|
+
let r = (e = t.clientWidth) => {
|
|
1101
|
+
i(Number.parseFloat(getComputedStyle(document.documentElement).fontSize) || 16), e > 0 && n(e);
|
|
1102
|
+
};
|
|
1103
|
+
r();
|
|
1104
|
+
let a = typeof ResizeObserver > "u" ? void 0 : new ResizeObserver(([e]) => r(e.contentRect.width));
|
|
1105
|
+
a?.observe(t);
|
|
1106
|
+
let o = () => r();
|
|
1107
|
+
return window.addEventListener("resize", o), () => {
|
|
1108
|
+
a?.disconnect(), window.removeEventListener("resize", o);
|
|
1109
|
+
};
|
|
1110
|
+
}, [e]), {
|
|
1111
|
+
isNarrow: t !== null && t < 40 * r,
|
|
1112
|
+
hasSidebar: t === null || t >= 64 * r
|
|
1113
|
+
};
|
|
1114
|
+
}
|
|
1115
|
+
function et(e) {
|
|
1116
|
+
let t = y(null), n = y(!1), r = y(e);
|
|
1117
|
+
r.current = e;
|
|
1118
|
+
function i() {
|
|
1119
|
+
t.current !== null && clearTimeout(t.current), t.current = null;
|
|
1120
|
+
}
|
|
1121
|
+
return _(() => i, []), {
|
|
1122
|
+
onTouchStart(e) {
|
|
1123
|
+
i(), n.current = !1, !(e.touches?.length > 1 || e.target.closest("input, [data-fb-touch-control]")) && (t.current = setTimeout(() => {
|
|
1124
|
+
t.current = null, n.current = !0, r.current();
|
|
1125
|
+
}, 500));
|
|
1126
|
+
},
|
|
1127
|
+
onTouchMove: i,
|
|
1128
|
+
onTouchCancel() {
|
|
1129
|
+
i(), n.current = !1;
|
|
1130
|
+
},
|
|
1131
|
+
onTouchEnd() {
|
|
1132
|
+
i(), n.current && (t.current = setTimeout(() => {
|
|
1133
|
+
t.current = null, n.current = !1;
|
|
1134
|
+
}, 350));
|
|
1135
|
+
},
|
|
1136
|
+
onClickCapture(e) {
|
|
1137
|
+
n.current && (i(), n.current = !1, e.preventDefault(), e.stopPropagation());
|
|
1138
|
+
},
|
|
1139
|
+
onContextMenuCapture(e) {
|
|
1140
|
+
n.current && (e.preventDefault(), e.stopPropagation());
|
|
1141
|
+
}
|
|
1142
|
+
};
|
|
1143
|
+
}
|
|
1144
|
+
var tt = "button:not(:disabled), a[href], input:not(:disabled):not([type=\"hidden\"]), select:not(:disabled), textarea:not(:disabled), [tabindex=\"0\"]";
|
|
1145
|
+
function nt({ children: e, label: t, narrow: n = !1, onClose: r }) {
|
|
1146
|
+
let i = y(null), a = y(r);
|
|
1147
|
+
return a.current = r, _(() => {
|
|
1148
|
+
let e = document.activeElement, t = i.current;
|
|
1149
|
+
return t?.contains(document.activeElement) || (t?.querySelector("input:not([type=\"hidden\"]):not([type=\"checkbox\"])") ?? t)?.focus({ preventScroll: !0 }), () => {
|
|
1150
|
+
e instanceof HTMLElement && e.isConnected && e.focus({ preventScroll: !0 });
|
|
1151
|
+
};
|
|
1152
|
+
}, []), /* @__PURE__ */ w("div", {
|
|
1153
|
+
"aria-label": t,
|
|
1154
|
+
"aria-modal": "true",
|
|
1155
|
+
className: `fixed inset-0 z-[60] flex min-w-0 justify-center overflow-y-auto overscroll-contain bg-[color-mix(in_oklch,var(--fb-text)_20%,transparent)] p-[calc(var(--fb-gap)*3)] text-[var(--fb-text)] outline-none [overflow-wrap:anywhere] ${n ? "items-end" : "items-center"}`,
|
|
1156
|
+
"data-fb-dialog": n ? "sheet" : "modal",
|
|
1157
|
+
onClick: (e) => {
|
|
1158
|
+
e.stopPropagation(), e.target === e.currentTarget && a.current();
|
|
1159
|
+
},
|
|
1160
|
+
onKeyDown: (e) => {
|
|
1161
|
+
if (e.stopPropagation(), e.key === "Escape" && (e.preventDefault(), a.current()), e.key !== "Tab") return;
|
|
1162
|
+
let t = Array.from(i.current?.querySelectorAll(tt) ?? []).filter((e) => !e.closest("[hidden]") && getComputedStyle(e).display !== "none"), n = t[0], r = t.at(-1);
|
|
1163
|
+
n ? e.shiftKey && (document.activeElement === n || document.activeElement === i.current) ? (e.preventDefault(), r?.focus()) : !e.shiftKey && document.activeElement === r && (e.preventDefault(), n.focus()) : (e.preventDefault(), i.current?.focus());
|
|
1164
|
+
},
|
|
1165
|
+
ref: i,
|
|
1166
|
+
role: "dialog",
|
|
1167
|
+
style: {
|
|
1168
|
+
paddingBottom: "max(calc(var(--fb-gap) * 3), env(safe-area-inset-bottom))",
|
|
1169
|
+
paddingTop: "max(calc(var(--fb-gap) * 3), env(safe-area-inset-top))"
|
|
1170
|
+
},
|
|
1171
|
+
tabIndex: -1,
|
|
1172
|
+
children: /* @__PURE__ */ w("div", {
|
|
1173
|
+
className: "flex max-h-[calc(100dvh-max(calc(var(--fb-gap)*6),env(safe-area-inset-bottom)+env(safe-area-inset-top)))] w-full min-w-0 max-w-[calc(var(--fb-gap)*180)] flex-col items-center overflow-y-auto overscroll-contain [scrollbar-gutter:stable] [&>*]:shrink-0",
|
|
1174
|
+
children: e
|
|
1175
|
+
})
|
|
1176
|
+
});
|
|
1177
|
+
}
|
|
1178
|
+
function rt({ children: e, label: t, onClose: n }) {
|
|
1179
|
+
return /* @__PURE__ */ w(nt, {
|
|
1180
|
+
label: t,
|
|
1181
|
+
narrow: !0,
|
|
1182
|
+
onClose: n,
|
|
1183
|
+
children: /* @__PURE__ */ T("section", {
|
|
1184
|
+
className: "w-full min-w-0 max-w-[calc(var(--fb-gap)*120)] rounded-[var(--fb-radius)] border border-[var(--fb-border)] bg-[var(--fb-surface)] p-[calc(var(--fb-gap)*4)]",
|
|
1185
|
+
children: [/* @__PURE__ */ T("header", {
|
|
1186
|
+
className: "mb-[calc(var(--fb-gap)*3)] flex items-center justify-between gap-[calc(var(--fb-gap)*2)]",
|
|
1187
|
+
children: [/* @__PURE__ */ w("h2", {
|
|
1188
|
+
className: "min-w-0 font-semibold",
|
|
1189
|
+
children: t
|
|
1190
|
+
}), /* @__PURE__ */ w("button", {
|
|
1191
|
+
"aria-label": `Close ${t}`,
|
|
1192
|
+
className: "min-h-[calc(var(--fb-gap)*11)] shrink-0 rounded-[var(--fb-radius)] px-[calc(var(--fb-gap)*3)] text-[var(--fb-accent)] focus-visible:outline-2 focus-visible:outline-[var(--fb-accent)]",
|
|
1193
|
+
onClick: n,
|
|
1194
|
+
type: "button",
|
|
1195
|
+
children: "Close"
|
|
1196
|
+
})]
|
|
1197
|
+
}), e]
|
|
1198
|
+
})
|
|
1199
|
+
});
|
|
1200
|
+
}
|
|
1201
|
+
//#endregion
|
|
1045
1202
|
//#region src/transfers/file-browser-provider.tsx
|
|
1046
|
-
var
|
|
1047
|
-
function
|
|
1048
|
-
let [a] = b(() => t ?? new
|
|
1049
|
-
|
|
1203
|
+
var it = f(null), at = "transition-[background-color,border-color,color,box-shadow,opacity] duration-150 ease-out motion-reduce:transition-none", ot = "transition-[background-color,border-color,box-shadow,opacity] duration-200 ease-out motion-reduce:transition-none", st = "min-h-[calc(var(--fb-gap)*11)] min-w-[calc(var(--fb-gap)*11)] shrink-0 whitespace-nowrap sm:min-h-7 sm:min-w-7 [@media(pointer:coarse)]:min-h-[calc(var(--fb-gap)*11)] [@media(pointer:coarse)]:min-w-[calc(var(--fb-gap)*11)]";
|
|
1204
|
+
function q({ children: e, manager: t, options: n, resolveRestoredUpload: r, showFloatingWidget: i = !0 }) {
|
|
1205
|
+
let [a] = b(() => t ?? new H(ft(n))), o = t ?? a, s = ut(o), [c, l] = b(!1), u = o.getRestorableUploads();
|
|
1206
|
+
dt(o);
|
|
1050
1207
|
async function d(e) {
|
|
1051
1208
|
for (let t of e) {
|
|
1052
1209
|
if (t.adapter && t.file) {
|
|
@@ -1061,15 +1218,15 @@ function Ye({ children: e, manager: t, options: n, resolveRestoredUpload: r, sho
|
|
|
1061
1218
|
}
|
|
1062
1219
|
l(!0);
|
|
1063
1220
|
}
|
|
1064
|
-
return /* @__PURE__ */
|
|
1221
|
+
return /* @__PURE__ */ T(it.Provider, {
|
|
1065
1222
|
value: o,
|
|
1066
1223
|
children: [
|
|
1067
1224
|
e,
|
|
1068
|
-
i ? /* @__PURE__ */
|
|
1225
|
+
i ? /* @__PURE__ */ w(pt, {
|
|
1069
1226
|
manager: o,
|
|
1070
1227
|
snapshot: s
|
|
1071
1228
|
}) : null,
|
|
1072
|
-
!c && u.length > 0 ? /* @__PURE__ */
|
|
1229
|
+
!c && u.length > 0 ? /* @__PURE__ */ w(gt, {
|
|
1073
1230
|
count: u.length,
|
|
1074
1231
|
onDismiss: () => {
|
|
1075
1232
|
o.dismissRestoredUploads(u.map((e) => e.id)), l(!0);
|
|
@@ -1081,19 +1238,19 @@ function Ye({ children: e, manager: t, options: n, resolveRestoredUpload: r, sho
|
|
|
1081
1238
|
]
|
|
1082
1239
|
});
|
|
1083
1240
|
}
|
|
1084
|
-
function
|
|
1085
|
-
return g(
|
|
1241
|
+
function ct() {
|
|
1242
|
+
return g(it) ?? _t;
|
|
1086
1243
|
}
|
|
1087
|
-
function
|
|
1088
|
-
return
|
|
1244
|
+
function lt() {
|
|
1245
|
+
return ut(ct());
|
|
1089
1246
|
}
|
|
1090
|
-
function
|
|
1247
|
+
function ut(e) {
|
|
1091
1248
|
return x((t) => e.subscribe(t), () => e.getSnapshot(), () => ({
|
|
1092
1249
|
uploads: [],
|
|
1093
1250
|
downloads: []
|
|
1094
1251
|
}));
|
|
1095
1252
|
}
|
|
1096
|
-
function
|
|
1253
|
+
function dt(e) {
|
|
1097
1254
|
_(() => {
|
|
1098
1255
|
let t = (t) => {
|
|
1099
1256
|
e.hasActiveTransfers() && (t.preventDefault(), t.returnValue = "");
|
|
@@ -1101,7 +1258,7 @@ function $e(e) {
|
|
|
1101
1258
|
return window.addEventListener("beforeunload", t), () => window.removeEventListener("beforeunload", t);
|
|
1102
1259
|
}, [e]);
|
|
1103
1260
|
}
|
|
1104
|
-
function
|
|
1261
|
+
function ft(e) {
|
|
1105
1262
|
if (e?.storage !== void 0) return e;
|
|
1106
1263
|
let t = typeof window > "u" ? void 0 : window.localStorage;
|
|
1107
1264
|
return t ? {
|
|
@@ -1109,115 +1266,129 @@ function et(e) {
|
|
|
1109
1266
|
storage: t
|
|
1110
1267
|
} : e ?? {};
|
|
1111
1268
|
}
|
|
1112
|
-
function
|
|
1113
|
-
let n = t.uploads.filter(
|
|
1269
|
+
function pt({ manager: e, snapshot: t }) {
|
|
1270
|
+
let n = Qe(), [r, i] = b(null), a = r ?? !n, o = t.uploads.filter(xt), s = J(t.uploads), c = new Set(s.flatMap((e) => e.activeUploads.map((e) => e.id))), l = o.filter((e) => !c.has(e.id)), u = t.downloads.filter((e) => [
|
|
1114
1271
|
"preparing",
|
|
1115
1272
|
"warning",
|
|
1116
1273
|
"ready",
|
|
1117
1274
|
"failed"
|
|
1118
1275
|
].includes(e.status));
|
|
1119
|
-
return
|
|
1276
|
+
return o.length === 0 && u.length === 0 ? null : C(/* @__PURE__ */ T("aside", {
|
|
1120
1277
|
"aria-label": "Transfers",
|
|
1121
|
-
className: `fixed bottom-
|
|
1122
|
-
children: [/* @__PURE__ */
|
|
1123
|
-
className: "
|
|
1124
|
-
children: [/* @__PURE__ */ T("div", {
|
|
1125
|
-
className: "font-semibold",
|
|
1126
|
-
children: "Transfers"
|
|
1127
|
-
}), /* @__PURE__ */ E("div", {
|
|
1128
|
-
className: "text-[11px] text-[var(--fb-muted)]",
|
|
1129
|
-
children: [n.length + o.length, " active"]
|
|
1130
|
-
})]
|
|
1131
|
-
}), /* @__PURE__ */ E("div", {
|
|
1132
|
-
className: "flex flex-col gap-2",
|
|
1278
|
+
className: `fixed bottom-[calc(env(safe-area-inset-bottom)+var(--fb-gap)*28)] right-[max(calc(var(--fb-gap)*3),env(safe-area-inset-right))] z-50 flex max-h-[50dvh] max-w-[calc(100%-var(--fb-gap)*6)] flex-col rounded-[var(--fb-radius)] border border-[var(--fb-border)] bg-[var(--fb-surface)] p-[calc(var(--fb-gap)*3)] text-[12px] text-[var(--fb-text)] shadow-[0_16px_44px_color-mix(in_oklch,var(--fb-text)_16%,transparent)] sm:bottom-[calc(env(safe-area-inset-bottom)+var(--fb-gap)*4)] ${a ? "w-[calc(var(--fb-gap)*90)]" : "w-auto"} ${ot}`,
|
|
1279
|
+
children: [/* @__PURE__ */ T("div", {
|
|
1280
|
+
className: "flex shrink-0 items-center justify-between gap-2",
|
|
1133
1281
|
children: [
|
|
1134
|
-
|
|
1282
|
+
/* @__PURE__ */ w("div", {
|
|
1283
|
+
className: "font-semibold",
|
|
1284
|
+
children: "Transfers"
|
|
1285
|
+
}),
|
|
1286
|
+
/* @__PURE__ */ T("div", {
|
|
1287
|
+
className: "text-[11px] text-[var(--fb-muted)]",
|
|
1288
|
+
children: [o.length + u.length, " active"]
|
|
1289
|
+
}),
|
|
1290
|
+
/* @__PURE__ */ w("button", {
|
|
1291
|
+
"aria-expanded": a,
|
|
1292
|
+
"aria-label": a ? "Collapse transfers" : "Expand transfers",
|
|
1293
|
+
className: vt(),
|
|
1294
|
+
onClick: () => i(!a),
|
|
1295
|
+
type: "button",
|
|
1296
|
+
children: w(a ? ue : pe, {
|
|
1297
|
+
"aria-hidden": "true",
|
|
1298
|
+
className: "size-4"
|
|
1299
|
+
})
|
|
1300
|
+
})
|
|
1301
|
+
]
|
|
1302
|
+
}), a ? /* @__PURE__ */ T("div", {
|
|
1303
|
+
className: "mt-2 flex min-h-0 min-w-0 flex-col gap-2 overflow-y-auto overscroll-contain [overflow-wrap:anywhere]",
|
|
1304
|
+
children: [
|
|
1305
|
+
s.map((t) => /* @__PURE__ */ w(mt, {
|
|
1135
1306
|
group: t,
|
|
1136
1307
|
manager: e
|
|
1137
1308
|
}, t.group.id)),
|
|
1138
|
-
|
|
1309
|
+
l.map((t) => /* @__PURE__ */ w(ht, {
|
|
1139
1310
|
manager: e,
|
|
1140
1311
|
upload: t
|
|
1141
1312
|
}, t.id)),
|
|
1142
|
-
|
|
1313
|
+
u.map((t) => /* @__PURE__ */ T("div", {
|
|
1143
1314
|
className: "text-[11px] text-[var(--fb-muted)]",
|
|
1144
1315
|
children: [
|
|
1145
|
-
t.status === "ready" && t.url ? /* @__PURE__ */
|
|
1316
|
+
t.status === "ready" && t.url ? /* @__PURE__ */ T("div", {
|
|
1146
1317
|
className: "flex items-center justify-between gap-2",
|
|
1147
|
-
children: [/* @__PURE__ */
|
|
1318
|
+
children: [/* @__PURE__ */ T("a", {
|
|
1148
1319
|
"aria-label": "Open prepared download",
|
|
1149
|
-
className: `inline-flex min-w-0 items-center gap-1 rounded-[calc(var(--fb-radius)-4px)] px-1.5 py-1 font-medium text-[var(--fb-accent)] hover:bg-[var(--fb-accent-soft)] ${
|
|
1320
|
+
className: `inline-flex min-h-[calc(var(--fb-gap)*11)] min-w-0 items-center gap-1 rounded-[calc(var(--fb-radius)-4px)] px-1.5 py-1 font-medium text-[var(--fb-accent)] hover:bg-[var(--fb-accent-soft)] sm:min-h-7 [@media(pointer:coarse)]:min-h-[calc(var(--fb-gap)*11)] ${at}`,
|
|
1150
1321
|
download: !0,
|
|
1151
1322
|
href: t.url,
|
|
1152
1323
|
onClick: () => e.dismissDownload(t.id),
|
|
1153
|
-
children: [/* @__PURE__ */
|
|
1324
|
+
children: [/* @__PURE__ */ w(P, {
|
|
1154
1325
|
"aria-hidden": "true",
|
|
1155
1326
|
className: "size-3.5 shrink-0"
|
|
1156
|
-
}), /* @__PURE__ */
|
|
1327
|
+
}), /* @__PURE__ */ w("span", {
|
|
1157
1328
|
className: "truncate",
|
|
1158
|
-
children:
|
|
1329
|
+
children: Tt(t)
|
|
1159
1330
|
})]
|
|
1160
|
-
}), /* @__PURE__ */
|
|
1331
|
+
}), /* @__PURE__ */ w("button", {
|
|
1161
1332
|
"aria-label": "Dismiss download",
|
|
1162
|
-
className:
|
|
1333
|
+
className: vt(),
|
|
1163
1334
|
onClick: () => e.dismissDownload(t.id),
|
|
1164
1335
|
type: "button",
|
|
1165
|
-
children: /* @__PURE__ */
|
|
1336
|
+
children: /* @__PURE__ */ w(B, {
|
|
1166
1337
|
"aria-hidden": "true",
|
|
1167
1338
|
className: "size-3.5"
|
|
1168
1339
|
})
|
|
1169
1340
|
})]
|
|
1170
1341
|
}) : null,
|
|
1171
|
-
t.status === "warning" ? /* @__PURE__ */
|
|
1342
|
+
t.status === "warning" ? /* @__PURE__ */ T("div", {
|
|
1172
1343
|
className: "flex items-center justify-between gap-2",
|
|
1173
|
-
children: [/* @__PURE__ */
|
|
1174
|
-
className:
|
|
1344
|
+
children: [/* @__PURE__ */ w("span", { children: "Large client zip" }), /* @__PURE__ */ w("button", {
|
|
1345
|
+
className: yt(),
|
|
1175
1346
|
onClick: () => void e.confirmBulkDownload(t.id),
|
|
1176
1347
|
type: "button",
|
|
1177
1348
|
children: "Continue"
|
|
1178
1349
|
})]
|
|
1179
1350
|
}) : null,
|
|
1180
|
-
t.status === "preparing" ? /* @__PURE__ */
|
|
1181
|
-
t.status === "failed" ? /* @__PURE__ */
|
|
1351
|
+
t.status === "preparing" ? /* @__PURE__ */ w("span", { children: "Preparing zip" }) : null,
|
|
1352
|
+
t.status === "failed" ? /* @__PURE__ */ w("span", {
|
|
1182
1353
|
className: "text-[var(--fb-danger)]",
|
|
1183
1354
|
children: t.error ?? "Download failed"
|
|
1184
1355
|
}) : null
|
|
1185
1356
|
]
|
|
1186
1357
|
}, t.id))
|
|
1187
1358
|
]
|
|
1188
|
-
})]
|
|
1359
|
+
}) : null]
|
|
1189
1360
|
}), document.body);
|
|
1190
1361
|
}
|
|
1191
|
-
function
|
|
1192
|
-
return /* @__PURE__ */
|
|
1193
|
-
className:
|
|
1194
|
-
children: [/* @__PURE__ */
|
|
1362
|
+
function mt({ group: e, manager: t }) {
|
|
1363
|
+
return /* @__PURE__ */ T("div", {
|
|
1364
|
+
className: ot,
|
|
1365
|
+
children: [/* @__PURE__ */ T("div", {
|
|
1195
1366
|
className: "flex items-center justify-between gap-2",
|
|
1196
|
-
children: [/* @__PURE__ */
|
|
1367
|
+
children: [/* @__PURE__ */ T("div", {
|
|
1197
1368
|
className: "min-w-0",
|
|
1198
|
-
children: [/* @__PURE__ */
|
|
1369
|
+
children: [/* @__PURE__ */ T("div", {
|
|
1199
1370
|
className: "truncate font-semibold",
|
|
1200
1371
|
children: ["Uploading ", e.group.name]
|
|
1201
|
-
}), /* @__PURE__ */
|
|
1372
|
+
}), /* @__PURE__ */ w("div", {
|
|
1202
1373
|
className: "text-[11px] text-[var(--fb-muted)]",
|
|
1203
|
-
children:
|
|
1374
|
+
children: St(e)
|
|
1204
1375
|
})]
|
|
1205
|
-
}), /* @__PURE__ */
|
|
1376
|
+
}), /* @__PURE__ */ w("button", {
|
|
1206
1377
|
"aria-label": `Cancel upload group ${e.group.name}`,
|
|
1207
|
-
className:
|
|
1378
|
+
className: vt(),
|
|
1208
1379
|
onClick: () => {
|
|
1209
1380
|
for (let n of e.activeUploads) t.cancelUpload(n.id);
|
|
1210
1381
|
},
|
|
1211
1382
|
title: "Cancel",
|
|
1212
1383
|
type: "button",
|
|
1213
|
-
children: /* @__PURE__ */
|
|
1384
|
+
children: /* @__PURE__ */ w(B, {
|
|
1214
1385
|
"aria-hidden": "true",
|
|
1215
1386
|
className: "size-3.5"
|
|
1216
1387
|
})
|
|
1217
1388
|
})]
|
|
1218
|
-
}), /* @__PURE__ */
|
|
1219
|
-
className: `mt-2 flex flex-col gap-1.5 border-l border-[var(--fb-border)] pl-3 ${
|
|
1220
|
-
children: e.activeUploads.map((e) => /* @__PURE__ */
|
|
1389
|
+
}), /* @__PURE__ */ w("div", {
|
|
1390
|
+
className: `mt-2 flex flex-col gap-1.5 border-l border-[var(--fb-border)] pl-3 ${ot}`,
|
|
1391
|
+
children: e.activeUploads.map((e) => /* @__PURE__ */ w(ht, {
|
|
1221
1392
|
compact: !0,
|
|
1222
1393
|
manager: t,
|
|
1223
1394
|
upload: e
|
|
@@ -1225,81 +1396,80 @@ function nt({ group: e, manager: t }) {
|
|
|
1225
1396
|
})]
|
|
1226
1397
|
});
|
|
1227
1398
|
}
|
|
1228
|
-
function
|
|
1229
|
-
return /* @__PURE__ */
|
|
1230
|
-
className:
|
|
1231
|
-
children: [/* @__PURE__ */
|
|
1399
|
+
function ht({ compact: e = !1, manager: t, upload: n }) {
|
|
1400
|
+
return /* @__PURE__ */ T("div", {
|
|
1401
|
+
className: ot,
|
|
1402
|
+
children: [/* @__PURE__ */ T("div", {
|
|
1232
1403
|
className: "flex items-center justify-between gap-2",
|
|
1233
|
-
children: [/* @__PURE__ */
|
|
1404
|
+
children: [/* @__PURE__ */ T("div", {
|
|
1234
1405
|
className: "min-w-0",
|
|
1235
|
-
children: [/* @__PURE__ */
|
|
1406
|
+
children: [/* @__PURE__ */ w("span", {
|
|
1236
1407
|
className: "block truncate font-medium",
|
|
1237
1408
|
children: n.name
|
|
1238
|
-
}), /* @__PURE__ */
|
|
1409
|
+
}), /* @__PURE__ */ w("span", {
|
|
1239
1410
|
className: "text-[11px] text-[var(--fb-muted)]",
|
|
1240
|
-
children:
|
|
1411
|
+
children: Ct(n)
|
|
1241
1412
|
})]
|
|
1242
|
-
}), /* @__PURE__ */
|
|
1413
|
+
}), /* @__PURE__ */ T("div", {
|
|
1243
1414
|
className: "flex shrink-0 items-center gap-1",
|
|
1244
1415
|
children: [
|
|
1245
|
-
["queued", "uploading"].includes(n.status) ? /* @__PURE__ */
|
|
1416
|
+
["queued", "uploading"].includes(n.status) ? /* @__PURE__ */ w("button", {
|
|
1246
1417
|
"aria-label": `Pause upload ${n.name}`,
|
|
1247
|
-
className:
|
|
1418
|
+
className: vt(),
|
|
1248
1419
|
onClick: () => t.pauseUpload(n.id),
|
|
1249
1420
|
title: "Pause",
|
|
1250
1421
|
type: "button",
|
|
1251
|
-
children: /* @__PURE__ */
|
|
1422
|
+
children: /* @__PURE__ */ w(xe, {
|
|
1252
1423
|
"aria-hidden": "true",
|
|
1253
1424
|
className: "size-3.5"
|
|
1254
1425
|
})
|
|
1255
1426
|
}) : null,
|
|
1256
|
-
["failed", "paused"].includes(n.status) ? /* @__PURE__ */
|
|
1427
|
+
["failed", "paused"].includes(n.status) ? /* @__PURE__ */ w("button", {
|
|
1257
1428
|
"aria-label": `Resume upload ${n.name}`,
|
|
1258
|
-
className:
|
|
1429
|
+
className: vt(),
|
|
1259
1430
|
onClick: () => void t.resumeUpload(n.id),
|
|
1260
1431
|
title: "Resume",
|
|
1261
1432
|
type: "button",
|
|
1262
|
-
children: /* @__PURE__ */
|
|
1433
|
+
children: /* @__PURE__ */ w(I, {
|
|
1263
1434
|
"aria-hidden": "true",
|
|
1264
1435
|
className: "size-3.5"
|
|
1265
1436
|
})
|
|
1266
1437
|
}) : null,
|
|
1267
|
-
/* @__PURE__ */
|
|
1438
|
+
/* @__PURE__ */ w("button", {
|
|
1268
1439
|
"aria-label": `Cancel upload ${n.name}`,
|
|
1269
|
-
className:
|
|
1440
|
+
className: vt(),
|
|
1270
1441
|
onClick: () => void t.cancelUpload(n.id),
|
|
1271
1442
|
title: "Cancel",
|
|
1272
1443
|
type: "button",
|
|
1273
|
-
children: /* @__PURE__ */
|
|
1444
|
+
children: /* @__PURE__ */ w(B, {
|
|
1274
1445
|
"aria-hidden": "true",
|
|
1275
1446
|
className: "size-3.5"
|
|
1276
1447
|
})
|
|
1277
1448
|
})
|
|
1278
1449
|
]
|
|
1279
1450
|
})]
|
|
1280
|
-
}), /* @__PURE__ */
|
|
1281
|
-
className: `h-1.5 overflow-hidden rounded-full bg-[var(--fb-surface-2)] ${
|
|
1282
|
-
children: /* @__PURE__ */
|
|
1451
|
+
}), /* @__PURE__ */ w("div", {
|
|
1452
|
+
className: `h-1.5 overflow-hidden rounded-full bg-[var(--fb-surface-2)] ${ot} ${e ? "mt-1" : "mt-1.5"}`,
|
|
1453
|
+
children: /* @__PURE__ */ w("div", {
|
|
1283
1454
|
className: "h-full rounded-full bg-[var(--fb-accent)] transition-[width] duration-300 ease-out motion-reduce:transition-none",
|
|
1284
1455
|
style: { width: `${Math.min(100, n.totalBytes ? n.loadedBytes / n.totalBytes * 100 : 0)}%` }
|
|
1285
1456
|
})
|
|
1286
1457
|
})]
|
|
1287
1458
|
});
|
|
1288
1459
|
}
|
|
1289
|
-
function
|
|
1290
|
-
return C(/* @__PURE__ */
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
className: `w-[min(380px,100%)] rounded-[var(--fb-radius)] border border-[var(--fb-border)] bg-[var(--fb-surface)] p-4 shadow-[0_18px_50px_color-mix(in_oklch,var(--fb-text)_18%,transparent)] ${J}`,
|
|
1460
|
+
function gt({ count: e, onDismiss: t, onResume: n }) {
|
|
1461
|
+
return C(/* @__PURE__ */ w(nt, {
|
|
1462
|
+
label: "Resume uploads",
|
|
1463
|
+
narrow: Qe(),
|
|
1464
|
+
onClose: t,
|
|
1465
|
+
children: /* @__PURE__ */ T("div", {
|
|
1466
|
+
className: `w-[min(380px,100%)] rounded-[var(--fb-radius)] border border-[var(--fb-border)] bg-[var(--fb-surface)] p-4 shadow-[0_18px_50px_color-mix(in_oklch,var(--fb-text)_18%,transparent)] ${ot}`,
|
|
1297
1467
|
children: [
|
|
1298
|
-
/* @__PURE__ */
|
|
1468
|
+
/* @__PURE__ */ w("h2", {
|
|
1299
1469
|
className: "m-0 text-[14px] font-semibold",
|
|
1300
1470
|
children: "Resume uploads"
|
|
1301
1471
|
}),
|
|
1302
|
-
/* @__PURE__ */
|
|
1472
|
+
/* @__PURE__ */ T("p", {
|
|
1303
1473
|
className: "mt-2 text-[12px] text-[var(--fb-muted)]",
|
|
1304
1474
|
children: [
|
|
1305
1475
|
"Resume ",
|
|
@@ -1308,15 +1478,15 @@ function rt({ count: e, onDismiss: t, onResume: n }) {
|
|
|
1308
1478
|
e === 1 ? "?" : "s?"
|
|
1309
1479
|
]
|
|
1310
1480
|
}),
|
|
1311
|
-
/* @__PURE__ */
|
|
1312
|
-
className: "mt-4 flex justify-end gap-2",
|
|
1313
|
-
children: [/* @__PURE__ */
|
|
1314
|
-
className:
|
|
1481
|
+
/* @__PURE__ */ T("div", {
|
|
1482
|
+
className: "mt-4 flex flex-wrap justify-end gap-2",
|
|
1483
|
+
children: [/* @__PURE__ */ w("button", {
|
|
1484
|
+
className: yt(),
|
|
1315
1485
|
onClick: t,
|
|
1316
1486
|
type: "button",
|
|
1317
1487
|
children: "Dismiss"
|
|
1318
|
-
}), /* @__PURE__ */
|
|
1319
|
-
className:
|
|
1488
|
+
}), /* @__PURE__ */ w("button", {
|
|
1489
|
+
className: bt(),
|
|
1320
1490
|
onClick: n,
|
|
1321
1491
|
type: "button",
|
|
1322
1492
|
children: "Resume uploads"
|
|
@@ -1326,17 +1496,17 @@ function rt({ count: e, onDismiss: t, onResume: n }) {
|
|
|
1326
1496
|
})
|
|
1327
1497
|
}), document.body);
|
|
1328
1498
|
}
|
|
1329
|
-
var
|
|
1330
|
-
function
|
|
1331
|
-
return `grid size-7 place-items-center rounded-[calc(var(--fb-radius)-4px)] border border-[var(--fb-border)] bg-[var(--fb-surface)] text-[var(--fb-muted)] outline-none hover:bg-[var(--fb-bg)] focus:ring-2 focus:ring-[var(--fb-accent-soft)] ${
|
|
1499
|
+
var _t = new H();
|
|
1500
|
+
function vt() {
|
|
1501
|
+
return `grid size-7 place-items-center rounded-[calc(var(--fb-radius)-4px)] border border-[var(--fb-border)] bg-[var(--fb-surface)] text-[var(--fb-muted)] outline-none hover:bg-[var(--fb-bg)] focus:ring-2 focus:ring-[var(--fb-accent-soft)] ${st} ${at}`;
|
|
1332
1502
|
}
|
|
1333
|
-
function
|
|
1334
|
-
return `inline-flex h-7 items-center rounded-[calc(var(--fb-radius)-4px)] border border-[var(--fb-border)] bg-[var(--fb-surface)] px-2 text-[11px] font-medium text-[var(--fb-text)] outline-none hover:bg-[var(--fb-bg)] focus:ring-2 focus:ring-[var(--fb-accent-soft)] ${
|
|
1503
|
+
function yt() {
|
|
1504
|
+
return `inline-flex h-7 items-center justify-center rounded-[calc(var(--fb-radius)-4px)] border border-[var(--fb-border)] bg-[var(--fb-surface)] px-2 text-[11px] font-medium text-[var(--fb-text)] outline-none hover:bg-[var(--fb-bg)] focus:ring-2 focus:ring-[var(--fb-accent-soft)] ${st} ${at}`;
|
|
1335
1505
|
}
|
|
1336
|
-
function
|
|
1337
|
-
return `inline-flex h-7 items-center rounded-[calc(var(--fb-radius)-4px)] border border-[var(--fb-accent)] bg-[var(--fb-accent)] px-2 text-[11px] font-semibold text-[var(--fb-surface)] outline-none hover:opacity-90 focus:ring-2 focus:ring-[var(--fb-accent-soft)] ${
|
|
1506
|
+
function bt() {
|
|
1507
|
+
return `inline-flex h-7 items-center justify-center rounded-[calc(var(--fb-radius)-4px)] border border-[var(--fb-accent)] bg-[var(--fb-accent)] px-2 text-[11px] font-semibold text-[var(--fb-surface)] outline-none hover:opacity-90 focus:ring-2 focus:ring-[var(--fb-accent-soft)] ${st} ${at}`;
|
|
1338
1508
|
}
|
|
1339
|
-
function
|
|
1509
|
+
function xt(e) {
|
|
1340
1510
|
return [
|
|
1341
1511
|
"queued",
|
|
1342
1512
|
"uploading",
|
|
@@ -1344,7 +1514,7 @@ function ct(e) {
|
|
|
1344
1514
|
"paused"
|
|
1345
1515
|
].includes(e.status);
|
|
1346
1516
|
}
|
|
1347
|
-
function
|
|
1517
|
+
function J(e) {
|
|
1348
1518
|
let t = /* @__PURE__ */ new Map();
|
|
1349
1519
|
for (let n of e) {
|
|
1350
1520
|
if (!n.group) continue;
|
|
@@ -1354,18 +1524,18 @@ function lt(e) {
|
|
|
1354
1524
|
activeUploads: [],
|
|
1355
1525
|
completedCount: 0
|
|
1356
1526
|
};
|
|
1357
|
-
e.uploads.push(n), n.status === "completed" && (e.completedCount += 1),
|
|
1527
|
+
e.uploads.push(n), n.status === "completed" && (e.completedCount += 1), xt(n) && e.activeUploads.push(n), t.set(n.group.id, e);
|
|
1358
1528
|
}
|
|
1359
1529
|
return Array.from(t.values()).filter((e) => e.activeUploads.length > 0);
|
|
1360
1530
|
}
|
|
1361
|
-
function
|
|
1531
|
+
function St(e) {
|
|
1362
1532
|
let t = e.group.createdFolders, n = `${e.completedCount} of ${e.group.totalFiles} files`;
|
|
1363
1533
|
return t <= 0 ? n : `${n}, ${t} folder${t === 1 ? "" : "s"} created`;
|
|
1364
1534
|
}
|
|
1365
|
-
function
|
|
1366
|
-
return e.status !== "uploading" || typeof e.bytesPerSecond != "number" || !Number.isFinite(e.bytesPerSecond) || e.bytesPerSecond <= 0 ? e.status : `${e.status}, ${
|
|
1535
|
+
function Ct(e) {
|
|
1536
|
+
return e.status !== "uploading" || typeof e.bytesPerSecond != "number" || !Number.isFinite(e.bytesPerSecond) || e.bytesPerSecond <= 0 ? e.status : `${e.status}, ${wt(e.bytesPerSecond)}/s`;
|
|
1367
1537
|
}
|
|
1368
|
-
function
|
|
1538
|
+
function wt(e) {
|
|
1369
1539
|
let t = [
|
|
1370
1540
|
"B",
|
|
1371
1541
|
"KB",
|
|
@@ -1376,21 +1546,21 @@ function ft(e) {
|
|
|
1376
1546
|
for (; n >= 1024 && r < t.length - 1;) n /= 1024, r += 1;
|
|
1377
1547
|
return `${r === 0 || n >= 10 ? Math.round(n).toString() : n.toFixed(1)} ${t[r]}`;
|
|
1378
1548
|
}
|
|
1379
|
-
function
|
|
1380
|
-
let t = e.expiresAt ?
|
|
1549
|
+
function Tt(e) {
|
|
1550
|
+
let t = e.expiresAt ? Et(e.expiresAt) : void 0;
|
|
1381
1551
|
return t ? `Download ready, expires in ${t}` : "Download ready";
|
|
1382
1552
|
}
|
|
1383
|
-
function
|
|
1553
|
+
function Et(e) {
|
|
1384
1554
|
let t = Date.parse(e) - Date.now();
|
|
1385
1555
|
if (!(!Number.isFinite(t) || t <= 0)) return t < 3600 * 1e3 ? `${Math.ceil(t / (60 * 1e3))}m` : t < 1440 * 60 * 1e3 ? `${Math.ceil(t / (3600 * 1e3))}h` : `${Math.ceil(t / (1440 * 60 * 1e3))}d`;
|
|
1386
1556
|
}
|
|
1387
1557
|
//#endregion
|
|
1388
1558
|
//#region src/components/file-browser.tsx
|
|
1389
|
-
var
|
|
1559
|
+
var Dt = "application/x.react-file-browser.paths", Ot = 220, kt = 5e3, Y = "transition-[background-color,border-color,color,box-shadow,opacity] duration-150 ease-out motion-reduce:transition-none", At = "shrink-0 whitespace-nowrap [@media(pointer:coarse)]:min-h-[calc(var(--fb-gap)*11)] [@media(pointer:coarse)]:min-w-[calc(var(--fb-gap)*11)]", X = "transition-[background-color,border-color,box-shadow,opacity] duration-200 ease-out motion-reduce:transition-none", jt = [
|
|
1390
1560
|
"skip",
|
|
1391
1561
|
"replace",
|
|
1392
1562
|
"keep-both"
|
|
1393
|
-
],
|
|
1563
|
+
], Mt = {
|
|
1394
1564
|
comfortable: {
|
|
1395
1565
|
"--fb-font": "13px",
|
|
1396
1566
|
"--fb-control-h": "32px",
|
|
@@ -1420,8 +1590,8 @@ var ht = "application/x.react-file-browser.paths", gt = 220, _t = 5e3, X = "tran
|
|
|
1420
1590
|
"--fb-panel-pad": "12px"
|
|
1421
1591
|
}
|
|
1422
1592
|
};
|
|
1423
|
-
function
|
|
1424
|
-
let
|
|
1593
|
+
function Nt({ adapter: e, className: n, emptyState: i, initialPath: a = "/", path: s, onPathChange: c, rootLabel: l = "Files", searchQuery: u, initialSearchQuery: d, onSearchQueryChange: f, density: p = "comfortable", readOnly: m = !1, showDetailsPanel: g = !0, uploadPolicy: x, uploadConflictResolutions: S, allowClientZipFallback: C = !0, renderItemMeta: ne, renderDetailsContent: re, warnZipSizeBytes: ie }) {
|
|
1594
|
+
let E = te({
|
|
1425
1595
|
adapter: e,
|
|
1426
1596
|
initialPath: a,
|
|
1427
1597
|
path: s,
|
|
@@ -1429,270 +1599,299 @@ function bt({ adapter: e, className: n, emptyState: i, initialPath: a = "/", pat
|
|
|
1429
1599
|
searchQuery: u,
|
|
1430
1600
|
initialSearchQuery: d,
|
|
1431
1601
|
onSearchQueryChange: f
|
|
1432
|
-
}),
|
|
1433
|
-
|
|
1602
|
+
}), ae = ct(), D = lt(), [O, oe] = b(!1), [k, se] = b(""), [A, j] = b(null), [ce, le] = b(null), [M, ue] = b(""), [pe, N] = b(null), [P, ge] = b(null), [xe, F] = b(""), [I, L] = b(null), [R, z] = b(!1), [Ce, V] = b(!1), [De, Oe] = b(null), [ke, Ae] = b(s ?? a), [je, Me] = b([]), [Ne, H] = b("idle"), [Pe, Fe] = b(null), [Ie, Le] = b(null), [Re, U] = b(null), [ze, Be] = b([]), [Ve, He] = b(!1), [Ue, We] = b(null), [Ge, W] = b(!1), [Ke, qe] = b(null), [G, Je] = b(null), Ye = y(null), { isNarrow: K, hasSidebar: Xe } = $e(Ye), [Ze, Qe] = b(null), [et, tt] = b(!1), [it, at] = b(!1), [ot, st] = b(!1), q = K && Ze === E.currentPath;
|
|
1603
|
+
_(() => {
|
|
1604
|
+
Qe(null), st(!1), at(!1), tt(!1);
|
|
1605
|
+
}, [E.currentPath, K]);
|
|
1606
|
+
let ut = y(null), dt = y([]), ft = y(null), pt = y(null), mt = y(null), ht = y(/* @__PURE__ */ new Set()), gt = E.selectedItems.at(0) ?? null, _t = v(() => bn(S ?? jt), [S]), vt = E.capabilities.bulkDownload || C, yt = Sn(E.selectedItems, vt), bt = v(() => E.filteredItems.filter((e) => e.kind === "file"), [E.filteredItems]), xt = h(async (t) => {
|
|
1607
|
+
Je({
|
|
1434
1608
|
item: t,
|
|
1435
1609
|
status: "loading"
|
|
1436
1610
|
});
|
|
1437
1611
|
try {
|
|
1438
1612
|
let n = await e.signedUrl(t.path);
|
|
1439
|
-
|
|
1613
|
+
Je((e) => e?.item.path === t.path ? {
|
|
1440
1614
|
item: t,
|
|
1441
1615
|
status: "ready",
|
|
1442
1616
|
url: n
|
|
1443
1617
|
} : e);
|
|
1444
1618
|
} catch (e) {
|
|
1445
|
-
|
|
1619
|
+
Je((n) => n?.item.path === t.path ? {
|
|
1446
1620
|
item: t,
|
|
1447
1621
|
status: "error",
|
|
1448
|
-
error:
|
|
1622
|
+
error: gn(e)
|
|
1449
1623
|
} : n);
|
|
1450
1624
|
}
|
|
1451
|
-
}, [e]),
|
|
1452
|
-
|
|
1453
|
-
}, []),
|
|
1454
|
-
|
|
1625
|
+
}, [e]), J = h(() => {
|
|
1626
|
+
ft.current &&= (clearTimeout(ft.current.timeoutId), null);
|
|
1627
|
+
}, []), St = h((e) => {
|
|
1628
|
+
J(), ft.current = {
|
|
1455
1629
|
path: e,
|
|
1456
1630
|
timeoutId: setTimeout(() => {
|
|
1457
|
-
|
|
1458
|
-
},
|
|
1631
|
+
ft.current?.path === e && (ft.current = null, E.clearSelection());
|
|
1632
|
+
}, Ot)
|
|
1459
1633
|
};
|
|
1460
|
-
}, [
|
|
1461
|
-
|
|
1634
|
+
}, [E, J]), Ct = h((e, t) => {
|
|
1635
|
+
if (K) {
|
|
1636
|
+
if (q) E.toggleSelection(e);
|
|
1637
|
+
else {
|
|
1638
|
+
let t = E.filteredItems.find((t) => t.path === e);
|
|
1639
|
+
t?.kind === "folder" ? E.open(t) : t && xt(t);
|
|
1640
|
+
}
|
|
1641
|
+
return;
|
|
1642
|
+
}
|
|
1643
|
+
let n = Date.now(), r = pt.current, i = r?.path === e && n - r.timeMs <= Ot;
|
|
1462
1644
|
if ("detail" in t && t.detail > 1) {
|
|
1463
|
-
i && (
|
|
1645
|
+
i && (J(), mt.current = e), pt.current = {
|
|
1464
1646
|
path: e,
|
|
1465
1647
|
timeMs: n
|
|
1466
1648
|
};
|
|
1467
1649
|
return;
|
|
1468
1650
|
}
|
|
1469
|
-
|
|
1651
|
+
mt.current = null, pt.current = {
|
|
1470
1652
|
path: e,
|
|
1471
1653
|
timeMs: n
|
|
1472
|
-
},
|
|
1473
|
-
cancelPendingSelectedItemUnselect:
|
|
1474
|
-
scheduleSelectedItemUnselect:
|
|
1654
|
+
}, cn(E, e, t, {
|
|
1655
|
+
cancelPendingSelectedItemUnselect: J,
|
|
1656
|
+
scheduleSelectedItemUnselect: St
|
|
1475
1657
|
});
|
|
1476
1658
|
}, [
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1659
|
+
E,
|
|
1660
|
+
J,
|
|
1661
|
+
K,
|
|
1662
|
+
q,
|
|
1663
|
+
xt,
|
|
1664
|
+
St
|
|
1665
|
+
]), wt = h((e) => {
|
|
1666
|
+
K || mt.current === e.path && (mt.current = null, J(), e.kind === "folder" ? E.open(e) : xt(e));
|
|
1482
1667
|
}, [
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1668
|
+
E,
|
|
1669
|
+
J,
|
|
1670
|
+
K,
|
|
1671
|
+
xt
|
|
1486
1672
|
]);
|
|
1487
1673
|
_(() => () => {
|
|
1488
|
-
|
|
1489
|
-
}, [
|
|
1490
|
-
let
|
|
1491
|
-
let n =
|
|
1674
|
+
J();
|
|
1675
|
+
}, [J]);
|
|
1676
|
+
let Tt = v(() => E.selectedItems.reduce((e, t) => e + (t.size ?? 0), 0), [E.selectedItems]), Et = h((e, t) => {
|
|
1677
|
+
let n = E.filteredItems;
|
|
1492
1678
|
if (n.length === 0) return;
|
|
1493
|
-
let r =
|
|
1494
|
-
t ?
|
|
1495
|
-
}, [
|
|
1496
|
-
e.length !== 0 && (
|
|
1497
|
-
}, [
|
|
1498
|
-
e.length !== 0 && (
|
|
1499
|
-
}, [
|
|
1500
|
-
e.length !== 0 && (await navigator.clipboard.writeText(e.join(", ")),
|
|
1501
|
-
}, []),
|
|
1502
|
-
let t =
|
|
1503
|
-
await
|
|
1504
|
-
}, [
|
|
1679
|
+
let r = E.focusedPath ?? E.selectedPaths.at(-1), i = n.findIndex((e) => e.path === r), a = e === "ArrowUp" || e === "ArrowLeft" || e === "End" ? n.length - 1 : 0, o = n[i === -1 ? a : dn(e, i, n.length)];
|
|
1680
|
+
t ? E.selectRange(o.path) : E.selectOnly(o.path);
|
|
1681
|
+
}, [E]), Nt = h((e = E.selectedPaths) => {
|
|
1682
|
+
e.length !== 0 && (E.copySelection(e), We(`Copied ${yn(e.length)}`));
|
|
1683
|
+
}, [E]), zt = h((e = E.selectedPaths) => {
|
|
1684
|
+
e.length !== 0 && (E.cutSelection(e), We(`Cut ${yn(e.length)}`));
|
|
1685
|
+
}, [E]), Vt = h(async (e) => {
|
|
1686
|
+
e.length !== 0 && (await navigator.clipboard.writeText(e.join(", ")), We(e.length === 1 ? "Copied path" : `Copied ${e.length} paths`));
|
|
1687
|
+
}, []), Ut = h(async (e) => {
|
|
1688
|
+
let t = E.clipboard?.paths.length ?? 0;
|
|
1689
|
+
await E.pasteInto(e), t > 0 && We(`Pasted ${yn(t)}`);
|
|
1690
|
+
}, [E]);
|
|
1505
1691
|
_(() => {
|
|
1506
1692
|
let e = (e) => {
|
|
1507
|
-
if (e.key === "Escape" && (
|
|
1508
|
-
if (
|
|
1509
|
-
e.preventDefault()
|
|
1693
|
+
if (!(e.defaultPrevented || e.target instanceof Element && e.target.closest("[role=\"dialog\"], [role=\"menu\"]")) && (e.key === "Escape" && (E.clearSelection(), Qe(null), tt(!1), at(!1), st(!1), ge(null), F(""), L(null), le(null), N(null), j(null), z(!1), V(!1), Oe(null), Le(null), U(null), Je(null)), !(_n(e.target) || e.target instanceof Element && (e.target.closest("[data-fb-touch-control]") || e.key === "Enter" && e.target.closest("button, a") && !e.target.closest("[data-fb-path]"))))) {
|
|
1694
|
+
if (e.key === "Enter" && K && q) {
|
|
1695
|
+
e.preventDefault();
|
|
1696
|
+
let t = e.target instanceof Element ? e.target.closest("[data-fb-path]")?.getAttribute("data-fb-path") : null;
|
|
1697
|
+
t && E.toggleSelection(t);
|
|
1510
1698
|
return;
|
|
1511
1699
|
}
|
|
1512
|
-
if (
|
|
1700
|
+
if (un(e.key)) {
|
|
1701
|
+
e.preventDefault(), Et(e.key, e.shiftKey);
|
|
1702
|
+
return;
|
|
1703
|
+
}
|
|
1704
|
+
if (!m && e.key === "F2" && E.capabilities.rename && E.selectedItems.length === 1) {
|
|
1513
1705
|
e.preventDefault();
|
|
1514
|
-
let t =
|
|
1515
|
-
|
|
1706
|
+
let t = E.selectedItems[0];
|
|
1707
|
+
le(null), N(null), ge(t), F(t.name), L(null);
|
|
1516
1708
|
return;
|
|
1517
1709
|
}
|
|
1518
|
-
if (!m && (e.key === "Delete" || e.key === "Backspace") &&
|
|
1519
|
-
e.preventDefault(),
|
|
1710
|
+
if (!m && (e.key === "Delete" || e.key === "Backspace") && E.selectedPaths.length > 0) {
|
|
1711
|
+
e.preventDefault(), z(!0);
|
|
1520
1712
|
return;
|
|
1521
1713
|
}
|
|
1522
1714
|
if ((e.metaKey || e.ctrlKey) && !m) {
|
|
1523
1715
|
let t = e.key.toLowerCase();
|
|
1524
|
-
if (t === "c" &&
|
|
1525
|
-
e.preventDefault(),
|
|
1716
|
+
if (t === "c" && E.capabilities.copy && E.selectedPaths.length > 0) {
|
|
1717
|
+
e.preventDefault(), Nt();
|
|
1526
1718
|
return;
|
|
1527
1719
|
}
|
|
1528
|
-
if (t === "x" &&
|
|
1529
|
-
e.preventDefault(),
|
|
1720
|
+
if (t === "x" && E.capabilities.move && E.selectedPaths.length > 0) {
|
|
1721
|
+
e.preventDefault(), zt();
|
|
1530
1722
|
return;
|
|
1531
1723
|
}
|
|
1532
|
-
if (t === "v" &&
|
|
1533
|
-
e.preventDefault(),
|
|
1724
|
+
if (t === "v" && E.clipboard) {
|
|
1725
|
+
e.preventDefault(), Ut(E.currentPath);
|
|
1534
1726
|
return;
|
|
1535
1727
|
}
|
|
1536
1728
|
}
|
|
1537
|
-
if (e.key === "Enter" &&
|
|
1538
|
-
let e =
|
|
1539
|
-
e.kind === "folder" ?
|
|
1729
|
+
if (e.key === "Enter" && E.selectedItems.length === 1) {
|
|
1730
|
+
let e = E.selectedItems[0];
|
|
1731
|
+
e.kind === "folder" ? E.open(e) : xt(e);
|
|
1540
1732
|
}
|
|
1541
|
-
(e.metaKey || e.ctrlKey) && e.key.toLowerCase() === "a" && (e.preventDefault(),
|
|
1733
|
+
(e.metaKey || e.ctrlKey) && e.key.toLowerCase() === "a" && (e.preventDefault(), E.selectAllLoaded());
|
|
1542
1734
|
}
|
|
1543
1735
|
};
|
|
1544
1736
|
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
1545
1737
|
}, [
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1738
|
+
E,
|
|
1739
|
+
Nt,
|
|
1740
|
+
zt,
|
|
1741
|
+
K,
|
|
1742
|
+
q,
|
|
1743
|
+
Et,
|
|
1744
|
+
xt,
|
|
1745
|
+
Ut,
|
|
1552
1746
|
m
|
|
1553
1747
|
]), _(() => {
|
|
1554
|
-
|
|
1748
|
+
!E.focusedPath || Ye.current?.querySelector("[role=\"dialog\"], [role=\"menu\"]") || (Ye.current?.querySelector(`[data-fb-path="${fn(E.focusedPath)}"]`))?.focus();
|
|
1555
1749
|
}, [
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1750
|
+
E.focusedPath,
|
|
1751
|
+
E.filteredItems,
|
|
1752
|
+
E.view
|
|
1559
1753
|
]), _(() => {
|
|
1560
|
-
if (!
|
|
1561
|
-
let e = () =>
|
|
1754
|
+
if (!Ie) return;
|
|
1755
|
+
let e = () => Le(null);
|
|
1562
1756
|
return document.addEventListener("click", e), () => document.removeEventListener("click", e);
|
|
1563
|
-
}, [
|
|
1564
|
-
if (!
|
|
1565
|
-
let e = setTimeout(() =>
|
|
1757
|
+
}, [Ie]), _(() => {
|
|
1758
|
+
if (!Ue) return;
|
|
1759
|
+
let e = setTimeout(() => We(null), kt);
|
|
1566
1760
|
return () => clearTimeout(e);
|
|
1567
|
-
}, [
|
|
1568
|
-
for (let e of
|
|
1569
|
-
}, [
|
|
1570
|
-
if (!
|
|
1761
|
+
}, [Ue]), _(() => {
|
|
1762
|
+
for (let e of D.uploads) e.status !== "completed" || !e.result || ht.current.has(e.id) || (ht.current.add(e.id), o(e.result.path) === E.currentPath && E.refresh());
|
|
1763
|
+
}, [E, D.uploads]), _(() => {
|
|
1764
|
+
if (!Ce) return;
|
|
1571
1765
|
let t = !1;
|
|
1572
|
-
return Promise.resolve().then(async () => t ? [] : (
|
|
1766
|
+
return Promise.resolve().then(async () => t ? [] : (H("loading"), Fe(null), Rt(e, E.selectedPaths))).then((e) => {
|
|
1573
1767
|
if (t || e.length === 0) {
|
|
1574
|
-
!t && e.length === 0 && (
|
|
1768
|
+
!t && e.length === 0 && (Me([]), H("ready"));
|
|
1575
1769
|
return;
|
|
1576
1770
|
}
|
|
1577
|
-
|
|
1771
|
+
Me(e), H("ready");
|
|
1578
1772
|
}).catch((e) => {
|
|
1579
|
-
t || (
|
|
1773
|
+
t || (Me([]), H("error"), Fe(gn(e)));
|
|
1580
1774
|
}), () => {
|
|
1581
1775
|
t = !0;
|
|
1582
1776
|
};
|
|
1583
1777
|
}, [
|
|
1584
1778
|
e,
|
|
1585
|
-
|
|
1586
|
-
|
|
1779
|
+
E.selectedPaths,
|
|
1780
|
+
Ce
|
|
1587
1781
|
]);
|
|
1588
|
-
async function
|
|
1589
|
-
if (
|
|
1782
|
+
async function Wt() {
|
|
1783
|
+
if (k.trim()) {
|
|
1590
1784
|
j(null);
|
|
1591
1785
|
try {
|
|
1592
|
-
await
|
|
1786
|
+
await E.createFolder(k), se(""), oe(!1);
|
|
1593
1787
|
} catch (e) {
|
|
1594
|
-
j(
|
|
1788
|
+
j(gn(e));
|
|
1595
1789
|
}
|
|
1596
1790
|
}
|
|
1597
1791
|
}
|
|
1598
|
-
function
|
|
1599
|
-
e && (
|
|
1792
|
+
function Gt(e = E.selectedItems.at(0)) {
|
|
1793
|
+
e && (ge(null), F(""), L(null), le(e), ue(e.name), N(null));
|
|
1600
1794
|
}
|
|
1601
|
-
async function
|
|
1602
|
-
let e =
|
|
1603
|
-
if (!(!
|
|
1604
|
-
|
|
1795
|
+
async function qt() {
|
|
1796
|
+
let e = M.trim();
|
|
1797
|
+
if (!(!ce || !e)) {
|
|
1798
|
+
N(null);
|
|
1605
1799
|
try {
|
|
1606
|
-
await
|
|
1800
|
+
await E.rename(ce.path, e), le(null), ue("");
|
|
1607
1801
|
} catch (e) {
|
|
1608
|
-
|
|
1802
|
+
N(gn(e));
|
|
1609
1803
|
}
|
|
1610
1804
|
}
|
|
1611
1805
|
}
|
|
1612
|
-
async function
|
|
1613
|
-
let e =
|
|
1614
|
-
if (
|
|
1615
|
-
|
|
1806
|
+
async function Z() {
|
|
1807
|
+
let e = P, t = xe.trim();
|
|
1808
|
+
if (L(null), !e || !t || t === e.name) {
|
|
1809
|
+
ge(null), F("");
|
|
1616
1810
|
return;
|
|
1617
1811
|
}
|
|
1618
1812
|
try {
|
|
1619
|
-
await
|
|
1813
|
+
await E.rename(e.path, t), ge(null), F("");
|
|
1620
1814
|
} catch (n) {
|
|
1621
|
-
|
|
1815
|
+
ge(e), F(t), L(gn(n));
|
|
1622
1816
|
}
|
|
1623
1817
|
}
|
|
1624
|
-
function
|
|
1625
|
-
|
|
1818
|
+
function Qt() {
|
|
1819
|
+
ge(null), F(""), L(null);
|
|
1626
1820
|
}
|
|
1627
|
-
async function
|
|
1821
|
+
async function tn() {
|
|
1822
|
+
z(!1);
|
|
1628
1823
|
try {
|
|
1629
|
-
await
|
|
1824
|
+
await E.deleteSelected();
|
|
1630
1825
|
} catch (e) {
|
|
1631
1826
|
if (e instanceof r) {
|
|
1632
|
-
|
|
1827
|
+
Oe(e);
|
|
1633
1828
|
return;
|
|
1634
1829
|
}
|
|
1635
|
-
throw e;
|
|
1830
|
+
throw z(!0), e;
|
|
1636
1831
|
}
|
|
1637
1832
|
}
|
|
1638
|
-
function
|
|
1639
|
-
|
|
1833
|
+
function hn() {
|
|
1834
|
+
E.selectedPaths.length !== 0 && (Ae(E.currentPath), V(!0));
|
|
1640
1835
|
}
|
|
1641
|
-
async function
|
|
1836
|
+
async function vn() {
|
|
1642
1837
|
try {
|
|
1643
|
-
await
|
|
1838
|
+
await E.moveSelectedTo(ke), V(!1);
|
|
1644
1839
|
} catch (e) {
|
|
1645
1840
|
if (e instanceof r) {
|
|
1646
|
-
|
|
1841
|
+
V(!1), Oe(e);
|
|
1647
1842
|
return;
|
|
1648
1843
|
}
|
|
1649
1844
|
throw e;
|
|
1650
1845
|
}
|
|
1651
1846
|
}
|
|
1652
|
-
function
|
|
1653
|
-
if (m || !
|
|
1654
|
-
let n =
|
|
1655
|
-
|
|
1847
|
+
function xn(e, t) {
|
|
1848
|
+
if (m || !E.capabilities.move) return;
|
|
1849
|
+
let n = E.selectedPaths.includes(e.path) ? E.selectedPaths : [e.path];
|
|
1850
|
+
dt.current = n, W(!1), qe(null), E.setSelection(n), t.dataTransfer.effectAllowed = "move", t.dataTransfer.setData(Dt, JSON.stringify(n));
|
|
1656
1851
|
}
|
|
1657
|
-
function
|
|
1658
|
-
|
|
1852
|
+
function Dn() {
|
|
1853
|
+
dt.current = [], W(!1), qe(null);
|
|
1659
1854
|
}
|
|
1660
|
-
function
|
|
1661
|
-
let t =
|
|
1662
|
-
return t.length > 0 ? t :
|
|
1855
|
+
function On(e) {
|
|
1856
|
+
let t = pn(e);
|
|
1857
|
+
return t.length > 0 ? t : dt.current;
|
|
1663
1858
|
}
|
|
1664
|
-
function
|
|
1665
|
-
if (m || !
|
|
1666
|
-
let n =
|
|
1667
|
-
n.length === 0 || n.some((t) => e.path === t || e.path.startsWith(`${t}/`)) || (t.preventDefault(), t.stopPropagation(), t.dataTransfer.dropEffect = "move",
|
|
1859
|
+
function kn(e, t) {
|
|
1860
|
+
if (m || !E.capabilities.move || e.kind !== "folder") return;
|
|
1861
|
+
let n = On(t.dataTransfer);
|
|
1862
|
+
n.length === 0 || n.some((t) => e.path === t || e.path.startsWith(`${t}/`)) || (t.preventDefault(), t.stopPropagation(), t.dataTransfer.dropEffect = "move", W(!1), qe(e.path));
|
|
1668
1863
|
}
|
|
1669
|
-
async function
|
|
1670
|
-
if (m || !
|
|
1671
|
-
let n =
|
|
1864
|
+
async function An(e, t) {
|
|
1865
|
+
if (m || !E.capabilities.move || e.kind !== "folder") return;
|
|
1866
|
+
let n = On(t.dataTransfer);
|
|
1672
1867
|
if (n.length !== 0) {
|
|
1673
|
-
t.preventDefault(), t.stopPropagation(),
|
|
1868
|
+
t.preventDefault(), t.stopPropagation(), Dn();
|
|
1674
1869
|
try {
|
|
1675
|
-
await
|
|
1870
|
+
await E.movePathsTo(n, e.path);
|
|
1676
1871
|
} catch (e) {
|
|
1677
1872
|
if (e instanceof r) {
|
|
1678
|
-
|
|
1873
|
+
Oe(e);
|
|
1679
1874
|
return;
|
|
1680
1875
|
}
|
|
1681
1876
|
throw e;
|
|
1682
1877
|
}
|
|
1683
1878
|
}
|
|
1684
1879
|
}
|
|
1685
|
-
function
|
|
1686
|
-
t.preventDefault(), t.stopPropagation(),
|
|
1880
|
+
function jn(e, t) {
|
|
1881
|
+
t.preventDefault(), t.stopPropagation(), E.selectedPaths.includes(e.path) || E.selectOnly(e.path), Le({
|
|
1687
1882
|
target: "item",
|
|
1688
1883
|
item: e,
|
|
1689
1884
|
x: t.clientX,
|
|
1690
1885
|
y: t.clientY,
|
|
1691
|
-
mode: "context"
|
|
1886
|
+
mode: K ? "sheet" : "context"
|
|
1692
1887
|
});
|
|
1693
1888
|
}
|
|
1694
|
-
function
|
|
1695
|
-
|
|
1889
|
+
function Mn(e) {
|
|
1890
|
+
if (E.selectedPaths.includes(e.path) || E.selectOnly(e.path), K) {
|
|
1891
|
+
Qe(E.currentPath);
|
|
1892
|
+
return;
|
|
1893
|
+
}
|
|
1894
|
+
Le({
|
|
1696
1895
|
target: "item",
|
|
1697
1896
|
item: e,
|
|
1698
1897
|
x: 0,
|
|
@@ -1700,120 +1899,120 @@ function bt({ adapter: e, className: n, emptyState: i, initialPath: a = "/", pat
|
|
|
1700
1899
|
mode: "sheet"
|
|
1701
1900
|
});
|
|
1702
1901
|
}
|
|
1703
|
-
function
|
|
1704
|
-
e.preventDefault(),
|
|
1902
|
+
function Nn(e) {
|
|
1903
|
+
e.preventDefault(), E.clearSelection(), Le({
|
|
1705
1904
|
target: "empty",
|
|
1706
1905
|
x: e.clientX,
|
|
1707
1906
|
y: e.clientY,
|
|
1708
|
-
mode: "context"
|
|
1907
|
+
mode: K ? "sheet" : "context"
|
|
1709
1908
|
});
|
|
1710
1909
|
}
|
|
1711
|
-
function
|
|
1712
|
-
e.target !== e.currentTarget ||
|
|
1910
|
+
function Pn(e) {
|
|
1911
|
+
q || e.target !== e.currentTarget || ln(e) || E.clearSelection();
|
|
1713
1912
|
}
|
|
1714
|
-
function
|
|
1715
|
-
if (!
|
|
1716
|
-
let t =
|
|
1717
|
-
|
|
1913
|
+
function Fn(e) {
|
|
1914
|
+
if (!G || bt.length === 0) return;
|
|
1915
|
+
let t = bt.findIndex((e) => e.path === G.item.path), n = ((t >= 0 ? t : 0) + e + bt.length) % bt.length, r = bt[n];
|
|
1916
|
+
xt(r), E.selectOnly(r.path);
|
|
1718
1917
|
}
|
|
1719
|
-
async function
|
|
1720
|
-
if (!
|
|
1721
|
-
if (
|
|
1722
|
-
await
|
|
1918
|
+
async function In() {
|
|
1919
|
+
if (!yt) return;
|
|
1920
|
+
if (E.selectedItems.length === 1 && E.selectedItems[0].kind === "file") {
|
|
1921
|
+
await Ln(E.selectedItems[0]);
|
|
1723
1922
|
return;
|
|
1724
1923
|
}
|
|
1725
|
-
let e =
|
|
1726
|
-
await
|
|
1924
|
+
let e = E.selectedPaths;
|
|
1925
|
+
await Rn(e, Tt);
|
|
1727
1926
|
}
|
|
1728
|
-
async function
|
|
1927
|
+
async function Ln(t) {
|
|
1729
1928
|
if (t.kind === "file") {
|
|
1730
|
-
await
|
|
1929
|
+
await ae.prepareSingleDownload({
|
|
1731
1930
|
adapter: e,
|
|
1732
1931
|
path: t.path,
|
|
1733
1932
|
selectedBytes: t.size ?? 0
|
|
1734
1933
|
});
|
|
1735
1934
|
return;
|
|
1736
1935
|
}
|
|
1737
|
-
|
|
1936
|
+
vt && await Rn([t.path], t.size ?? 0);
|
|
1738
1937
|
}
|
|
1739
|
-
async function
|
|
1740
|
-
t.length === 0 ||
|
|
1938
|
+
async function Rn(t, n) {
|
|
1939
|
+
t.length === 0 || !vt || await ae.prepareBulkDownload({
|
|
1741
1940
|
allowClientZipFallback: C,
|
|
1742
1941
|
adapter: e,
|
|
1743
1942
|
paths: t,
|
|
1744
1943
|
selectedBytes: n,
|
|
1745
|
-
warnZipSizeBytes:
|
|
1944
|
+
warnZipSizeBytes: ie
|
|
1746
1945
|
});
|
|
1747
1946
|
}
|
|
1748
|
-
async function
|
|
1749
|
-
!e || e.length === 0 || (await
|
|
1947
|
+
async function zn(e) {
|
|
1948
|
+
!e || e.length === 0 || (await Bn(e), ut.current && (ut.current.value = ""));
|
|
1750
1949
|
}
|
|
1751
|
-
async function
|
|
1752
|
-
await
|
|
1950
|
+
async function Bn(e) {
|
|
1951
|
+
await Hn(Ee(e));
|
|
1753
1952
|
}
|
|
1754
|
-
async function
|
|
1755
|
-
await
|
|
1953
|
+
async function Vn(e) {
|
|
1954
|
+
await Hn(await Te(e));
|
|
1756
1955
|
}
|
|
1757
|
-
async function
|
|
1956
|
+
async function Hn(e) {
|
|
1758
1957
|
if (e.length === 0) return;
|
|
1759
1958
|
if (x?.maxFilesPerBatch !== void 0 && e.length > x.maxFilesPerBatch) {
|
|
1760
|
-
|
|
1959
|
+
Be(e.map((t) => ({
|
|
1761
1960
|
fileName: t.file.name,
|
|
1762
1961
|
relativePath: t.relativePath,
|
|
1763
1962
|
reasons: [`Batch contains ${e.length} files; maximum is ${x.maxFilesPerBatch}`]
|
|
1764
1963
|
})));
|
|
1765
1964
|
return;
|
|
1766
1965
|
}
|
|
1767
|
-
let { acceptedCandidates: t, rejectedCandidates: n } =
|
|
1768
|
-
if (n.length > 0 &&
|
|
1769
|
-
let r =
|
|
1966
|
+
let { acceptedCandidates: t, rejectedCandidates: n } = Bt(e, x, E.currentPath);
|
|
1967
|
+
if (n.length > 0 && Be(n), t.length === 0) return;
|
|
1968
|
+
let r = Un(t);
|
|
1770
1969
|
if (r.length === 0) return;
|
|
1771
|
-
let i = await
|
|
1772
|
-
if (a.length > 0 &&
|
|
1773
|
-
let e = new Set(a), t = r.filter((t) => !e.has(
|
|
1774
|
-
|
|
1970
|
+
let i = await Wn(r), a = await Gn(r);
|
|
1971
|
+
if (a.length > 0 && _t.length === 0) {
|
|
1972
|
+
let e = new Set(a), t = r.filter((t) => !e.has(Pt(E.currentPath, t.relativePath))), n = r.filter((t) => e.has(Pt(E.currentPath, t.relativePath)));
|
|
1973
|
+
Be((e) => [...e, ...n.map((e) => ({
|
|
1775
1974
|
fileName: e.file.name,
|
|
1776
1975
|
relativePath: e.relativePath,
|
|
1777
1976
|
reasons: ["No upload conflict resolutions are enabled"]
|
|
1778
|
-
}))]), t.length > 0 &&
|
|
1977
|
+
}))]), t.length > 0 && qn(t, [], 0, void 0, Lt(E.currentPath, t, i));
|
|
1779
1978
|
return;
|
|
1780
1979
|
}
|
|
1781
|
-
|
|
1980
|
+
qn(r, a, 0, void 0, Lt(E.currentPath, r, i));
|
|
1782
1981
|
}
|
|
1783
|
-
function
|
|
1784
|
-
if (
|
|
1785
|
-
let [t, n] =
|
|
1786
|
-
return t.length > 0 &&
|
|
1982
|
+
function Un(e) {
|
|
1983
|
+
if (E.capabilities.createFolder) return e;
|
|
1984
|
+
let [t, n] = It(e, (e) => e.relativePath.includes("/"));
|
|
1985
|
+
return t.length > 0 && Be((e) => [...e, ...t.map((e) => ({
|
|
1787
1986
|
fileName: e.file.name,
|
|
1788
1987
|
relativePath: e.relativePath,
|
|
1789
1988
|
reasons: ["Folder uploads require folder creation support"]
|
|
1790
1989
|
}))]), n;
|
|
1791
1990
|
}
|
|
1792
|
-
async function
|
|
1793
|
-
let r =
|
|
1991
|
+
async function Wn(n) {
|
|
1992
|
+
let r = Ft(n), i = 0;
|
|
1794
1993
|
if (!e.createFolder) {
|
|
1795
1994
|
if (r.length > 0) throw new t("not_supported", "Folder uploads require folder creation support");
|
|
1796
1995
|
return 0;
|
|
1797
1996
|
}
|
|
1798
1997
|
for (let n of r) try {
|
|
1799
|
-
await e.createFolder(
|
|
1998
|
+
await e.createFolder(Pt(E.currentPath, n)), i += 1;
|
|
1800
1999
|
} catch (e) {
|
|
1801
2000
|
if (e instanceof t && e.code === "conflict") continue;
|
|
1802
2001
|
throw e;
|
|
1803
2002
|
}
|
|
1804
|
-
return i > 0 && await
|
|
2003
|
+
return i > 0 && await E.refresh(), i;
|
|
1805
2004
|
}
|
|
1806
|
-
async function
|
|
1807
|
-
let n = t.map((e) =>
|
|
2005
|
+
async function Gn(t) {
|
|
2006
|
+
let n = t.map((e) => Pt(E.currentPath, e.relativePath));
|
|
1808
2007
|
if (e.exists) try {
|
|
1809
2008
|
let t = await e.exists(n);
|
|
1810
2009
|
return n.filter((e) => t[e]);
|
|
1811
2010
|
} catch {}
|
|
1812
|
-
let r = new Set(
|
|
1813
|
-
for (let e of n) (r.has(e) || await
|
|
2011
|
+
let r = new Set(E.items.map((e) => e.path)), i = [];
|
|
2012
|
+
for (let e of n) (r.has(e) || await Kn(e)) && i.push(e);
|
|
1814
2013
|
return i;
|
|
1815
2014
|
}
|
|
1816
|
-
async function
|
|
2015
|
+
async function Kn(t) {
|
|
1817
2016
|
let n = o(t), r;
|
|
1818
2017
|
do {
|
|
1819
2018
|
let i = await e.list(n, { cursor: r });
|
|
@@ -1822,397 +2021,542 @@ function bt({ adapter: e, className: n, emptyState: i, initialPath: a = "/", pat
|
|
|
1822
2021
|
} while (r);
|
|
1823
2022
|
return !1;
|
|
1824
2023
|
}
|
|
1825
|
-
function
|
|
2024
|
+
function qn(e, t, n, r, i) {
|
|
1826
2025
|
let a = new Set(t);
|
|
1827
2026
|
for (let o = n; o < e.length; o += 1) {
|
|
1828
|
-
let n = e[o], s =
|
|
2027
|
+
let n = e[o], s = Pt(E.currentPath, n.relativePath);
|
|
1829
2028
|
if (a.has(s)) {
|
|
1830
2029
|
if (!r) {
|
|
1831
|
-
|
|
2030
|
+
U({
|
|
1832
2031
|
candidates: e,
|
|
1833
2032
|
conflictPaths: t,
|
|
1834
2033
|
group: i,
|
|
1835
2034
|
index: o
|
|
1836
|
-
}),
|
|
2035
|
+
}), He(!1);
|
|
1837
2036
|
return;
|
|
1838
2037
|
}
|
|
1839
|
-
r !== "skip" &&
|
|
1840
|
-
} else
|
|
2038
|
+
r !== "skip" && Yn(n, r, i);
|
|
2039
|
+
} else Yn(n, void 0, i);
|
|
1841
2040
|
}
|
|
1842
|
-
|
|
2041
|
+
U(null), He(!1);
|
|
1843
2042
|
}
|
|
1844
|
-
function
|
|
1845
|
-
if (!
|
|
1846
|
-
let { candidates: t, conflictPaths: n, group: r, index: i } =
|
|
1847
|
-
if (
|
|
1848
|
-
|
|
2043
|
+
function Jn(e) {
|
|
2044
|
+
if (!Re || !_t.includes(e)) return;
|
|
2045
|
+
let { candidates: t, conflictPaths: n, group: r, index: i } = Re;
|
|
2046
|
+
if (Ve) {
|
|
2047
|
+
qn(t, n, i, e, r);
|
|
1849
2048
|
return;
|
|
1850
2049
|
}
|
|
1851
2050
|
let a = t[i];
|
|
1852
|
-
e !== "skip" &&
|
|
2051
|
+
e !== "skip" && Yn(a, e, r), qn(t, n, i + 1, void 0, r);
|
|
1853
2052
|
}
|
|
1854
|
-
function
|
|
1855
|
-
|
|
2053
|
+
function Yn(t, n, r) {
|
|
2054
|
+
ae.enqueueUpload({
|
|
1856
2055
|
adapter: e,
|
|
1857
|
-
destinationPath:
|
|
2056
|
+
destinationPath: Pt(E.currentPath, t.relativePath),
|
|
1858
2057
|
file: t.file,
|
|
1859
2058
|
group: r,
|
|
1860
2059
|
onConflict: n === "skip" ? void 0 : n
|
|
1861
2060
|
});
|
|
1862
2061
|
}
|
|
1863
|
-
|
|
1864
|
-
|
|
2062
|
+
function Xn() {
|
|
2063
|
+
E.clearSelection(), Qe(null), st(!1);
|
|
2064
|
+
}
|
|
2065
|
+
let Zn = /* @__PURE__ */ T("div", {
|
|
2066
|
+
className: "flex min-w-0 flex-wrap items-center gap-[calc(var(--fb-gap)*2)]",
|
|
2067
|
+
children: [
|
|
2068
|
+
/* @__PURE__ */ T("select", {
|
|
2069
|
+
"aria-label": "Filter files",
|
|
2070
|
+
className: En(),
|
|
2071
|
+
onChange: (e) => E.setFilterKind(e.target.value),
|
|
2072
|
+
value: E.filterKind,
|
|
2073
|
+
children: [
|
|
2074
|
+
/* @__PURE__ */ w("option", {
|
|
2075
|
+
value: "all",
|
|
2076
|
+
children: "All"
|
|
2077
|
+
}),
|
|
2078
|
+
/* @__PURE__ */ w("option", {
|
|
2079
|
+
value: "folders",
|
|
2080
|
+
children: "Folders"
|
|
2081
|
+
}),
|
|
2082
|
+
/* @__PURE__ */ w("option", {
|
|
2083
|
+
value: "files",
|
|
2084
|
+
children: "Files"
|
|
2085
|
+
})
|
|
2086
|
+
]
|
|
2087
|
+
}),
|
|
2088
|
+
/* @__PURE__ */ T("select", {
|
|
2089
|
+
"aria-label": "Sort files",
|
|
2090
|
+
className: En(),
|
|
2091
|
+
onChange: (e) => E.setSortBy(e.target.value),
|
|
2092
|
+
value: E.sortBy,
|
|
2093
|
+
children: [
|
|
2094
|
+
/* @__PURE__ */ w("option", {
|
|
2095
|
+
value: "name",
|
|
2096
|
+
children: "Name"
|
|
2097
|
+
}),
|
|
2098
|
+
/* @__PURE__ */ w("option", {
|
|
2099
|
+
value: "modifiedAt",
|
|
2100
|
+
children: "Modified"
|
|
2101
|
+
}),
|
|
2102
|
+
/* @__PURE__ */ w("option", {
|
|
2103
|
+
value: "size",
|
|
2104
|
+
children: "Size"
|
|
2105
|
+
})
|
|
2106
|
+
]
|
|
2107
|
+
}),
|
|
2108
|
+
/* @__PURE__ */ w("button", {
|
|
2109
|
+
"aria-label": "Toggle sort direction",
|
|
2110
|
+
className: Q(!1),
|
|
2111
|
+
onClick: () => E.setSortDirection((e) => e === "asc" ? "desc" : "asc"),
|
|
2112
|
+
type: "button",
|
|
2113
|
+
children: E.sortDirection === "asc" ? "Asc" : "Desc"
|
|
2114
|
+
}),
|
|
2115
|
+
/* @__PURE__ */ w("button", {
|
|
2116
|
+
"aria-label": "Grid view",
|
|
2117
|
+
className: Q(E.view === "grid"),
|
|
2118
|
+
onClick: () => E.setView("grid"),
|
|
2119
|
+
type: "button",
|
|
2120
|
+
children: /* @__PURE__ */ w(ve, {
|
|
2121
|
+
"aria-hidden": "true",
|
|
2122
|
+
className: "size-4"
|
|
2123
|
+
})
|
|
2124
|
+
}),
|
|
2125
|
+
/* @__PURE__ */ w("button", {
|
|
2126
|
+
"aria-label": "List view",
|
|
2127
|
+
className: Q(E.view === "list"),
|
|
2128
|
+
onClick: () => E.setView("list"),
|
|
2129
|
+
type: "button",
|
|
2130
|
+
children: /* @__PURE__ */ w(be, {
|
|
2131
|
+
"aria-hidden": "true",
|
|
2132
|
+
className: "size-4"
|
|
2133
|
+
})
|
|
2134
|
+
}),
|
|
2135
|
+
!m && E.capabilities.createFolder ? /* @__PURE__ */ T("button", {
|
|
2136
|
+
className: $(!1),
|
|
2137
|
+
onClick: () => {
|
|
2138
|
+
tt(!1), j(null), oe(!0);
|
|
2139
|
+
},
|
|
2140
|
+
type: "button",
|
|
2141
|
+
children: [/* @__PURE__ */ w(_e, {
|
|
2142
|
+
"aria-hidden": "true",
|
|
2143
|
+
className: "size-4"
|
|
2144
|
+
}), "New folder"]
|
|
2145
|
+
}) : null,
|
|
2146
|
+
K ? /* @__PURE__ */ w("button", {
|
|
2147
|
+
className: $(!1),
|
|
2148
|
+
disabled: E.filteredItems.length === 0,
|
|
2149
|
+
onClick: () => {
|
|
2150
|
+
tt(!1), Qe(E.currentPath);
|
|
2151
|
+
},
|
|
2152
|
+
type: "button",
|
|
2153
|
+
children: "Select items"
|
|
2154
|
+
}) : null,
|
|
2155
|
+
K && !m && E.clipboard ? /* @__PURE__ */ w("button", {
|
|
2156
|
+
className: $(!1),
|
|
2157
|
+
onClick: () => {
|
|
2158
|
+
tt(!1), Ut(E.currentPath);
|
|
2159
|
+
},
|
|
2160
|
+
type: "button",
|
|
2161
|
+
children: "Paste here"
|
|
2162
|
+
}) : null
|
|
2163
|
+
]
|
|
2164
|
+
}), Qn = /* @__PURE__ */ w($t, {
|
|
2165
|
+
canCopy: !m && E.capabilities.copy,
|
|
2166
|
+
canCut: !m && E.capabilities.move,
|
|
2167
|
+
canDelete: !m,
|
|
2168
|
+
canMove: !m && E.capabilities.move,
|
|
2169
|
+
canRename: !m && E.capabilities.rename,
|
|
2170
|
+
canDownload: yt,
|
|
2171
|
+
itemCount: E.filteredItems.length,
|
|
2172
|
+
onCopy: () => Nt(),
|
|
2173
|
+
onCut: () => zt(),
|
|
2174
|
+
onDelete: () => z(!0),
|
|
2175
|
+
onDownload: () => void In(),
|
|
2176
|
+
onMove: hn,
|
|
2177
|
+
onRename: Gt,
|
|
2178
|
+
onSelectAll: E.selectAllLoaded,
|
|
2179
|
+
onSelectNone: E.clearSelection,
|
|
2180
|
+
selectedCount: E.selectedPaths.length
|
|
2181
|
+
}), $n = /* @__PURE__ */ w(nn, {
|
|
2182
|
+
canDownload: yt,
|
|
2183
|
+
item: gt,
|
|
2184
|
+
onCopyPath: () => void Vt(E.selectedPaths),
|
|
2185
|
+
onDownload: () => void In(),
|
|
2186
|
+
renderDetailsContent: re,
|
|
2187
|
+
selectedCount: E.selectedItems.length,
|
|
2188
|
+
totalBytes: Tt,
|
|
2189
|
+
sheet: !Xe
|
|
2190
|
+
});
|
|
2191
|
+
return /* @__PURE__ */ T("section", {
|
|
2192
|
+
className: `@container/fb relative flex min-h-[min(520px,100svh)] w-full min-w-0 max-w-full rounded-[var(--fb-radius)] border border-[var(--fb-border)] bg-[var(--fb-surface)] font-[inherit] text-[length:var(--fb-font)] text-[var(--fb-text)] ${X}${n ? ` ${n}` : ""}`,
|
|
1865
2193
|
"data-fb-density": p,
|
|
1866
|
-
|
|
1867
|
-
|
|
2194
|
+
"data-fb-layout": K ? "narrow" : Xe ? "wide" : "medium",
|
|
2195
|
+
ref: Ye,
|
|
2196
|
+
style: {
|
|
2197
|
+
...Mt[p],
|
|
2198
|
+
...K ? { "--fb-control-h": "calc(var(--fb-gap) * 11)" } : {}
|
|
2199
|
+
},
|
|
1868
2200
|
onDragEnter: (e) => {
|
|
1869
|
-
if (
|
|
1870
|
-
|
|
2201
|
+
if (On(e.dataTransfer).length > 0) {
|
|
2202
|
+
W(!1);
|
|
1871
2203
|
return;
|
|
1872
2204
|
}
|
|
1873
|
-
e.preventDefault(), m ||
|
|
2205
|
+
e.preventDefault(), m || W(!0);
|
|
1874
2206
|
},
|
|
1875
2207
|
onDragLeave: (e) => {
|
|
1876
|
-
e.currentTarget === e.target && (
|
|
2208
|
+
e.currentTarget === e.target && (W(!1), qe(null));
|
|
1877
2209
|
},
|
|
1878
2210
|
onDragOver: (e) => {
|
|
1879
|
-
if (
|
|
1880
|
-
|
|
2211
|
+
if (On(e.dataTransfer).length > 0) {
|
|
2212
|
+
W(!1), qe(null);
|
|
1881
2213
|
return;
|
|
1882
2214
|
}
|
|
1883
2215
|
e.preventDefault();
|
|
1884
2216
|
},
|
|
1885
2217
|
onDrop: (e) => {
|
|
1886
|
-
if (e.preventDefault(),
|
|
1887
|
-
|
|
2218
|
+
if (e.preventDefault(), On(e.dataTransfer).length > 0) {
|
|
2219
|
+
Dn();
|
|
1888
2220
|
return;
|
|
1889
2221
|
}
|
|
1890
|
-
|
|
2222
|
+
W(!1), !m && Vn(e.dataTransfer);
|
|
1891
2223
|
},
|
|
1892
2224
|
onPaste: (e) => {
|
|
1893
2225
|
if (m) return;
|
|
1894
2226
|
let t = Array.from(e.clipboardData.files).filter((e) => e.type.startsWith("image/"));
|
|
1895
|
-
t.length > 0 &&
|
|
2227
|
+
t.length > 0 && Bn(t);
|
|
1896
2228
|
},
|
|
1897
2229
|
children: [
|
|
1898
|
-
/* @__PURE__ */
|
|
2230
|
+
/* @__PURE__ */ w("div", {
|
|
1899
2231
|
"aria-atomic": "true",
|
|
1900
2232
|
"aria-live": "polite",
|
|
1901
2233
|
className: "sr-only",
|
|
1902
2234
|
role: "status",
|
|
1903
|
-
children:
|
|
1904
|
-
currentPath:
|
|
1905
|
-
itemCount:
|
|
2235
|
+
children: Cn({
|
|
2236
|
+
currentPath: E.currentPath,
|
|
2237
|
+
itemCount: E.filteredItems.length,
|
|
1906
2238
|
rootLabel: l,
|
|
1907
|
-
selectedCount:
|
|
1908
|
-
status:
|
|
2239
|
+
selectedCount: E.selectedPaths.length,
|
|
2240
|
+
status: E.status
|
|
1909
2241
|
})
|
|
1910
2242
|
}),
|
|
1911
|
-
/* @__PURE__ */
|
|
2243
|
+
/* @__PURE__ */ T("div", {
|
|
1912
2244
|
className: "flex min-w-0 flex-1 flex-col",
|
|
1913
2245
|
children: [
|
|
1914
|
-
/* @__PURE__ */
|
|
1915
|
-
|
|
2246
|
+
/* @__PURE__ */ w("input", {
|
|
2247
|
+
accept: x?.allowedMimeTypes?.length ? x.allowedMimeTypes.join(",") : void 0,
|
|
2248
|
+
"aria-label": "Upload files",
|
|
2249
|
+
multiple: !0,
|
|
2250
|
+
onChange: (e) => void zn(e.target.files),
|
|
2251
|
+
ref: ut,
|
|
2252
|
+
type: "file",
|
|
2253
|
+
className: "hidden"
|
|
2254
|
+
}),
|
|
2255
|
+
/* @__PURE__ */ T("header", {
|
|
2256
|
+
className: `flex min-w-0 flex-wrap items-center gap-[calc(var(--fb-gap)*2)] rounded-t-[var(--fb-radius)] border-b border-[var(--fb-border)] bg-[var(--fb-surface)] px-[var(--fb-pad)] py-[var(--fb-cell-y)] ${X}`,
|
|
1916
2257
|
children: [
|
|
1917
|
-
/* @__PURE__ */ T(
|
|
1918
|
-
|
|
1919
|
-
path: D.currentPath,
|
|
1920
|
-
rootLabel: l
|
|
1921
|
-
}),
|
|
1922
|
-
Le ? /* @__PURE__ */ T("span", {
|
|
1923
|
-
"aria-label": "Clipboard status",
|
|
1924
|
-
className: `rounded-[calc(var(--fb-radius)-4px)] bg-[var(--fb-accent-soft)] px-2 py-1 text-[12px] font-medium text-[var(--fb-accent)] ${X}`,
|
|
1925
|
-
role: "status",
|
|
1926
|
-
children: Le
|
|
1927
|
-
}) : null,
|
|
1928
|
-
/* @__PURE__ */ E("div", {
|
|
1929
|
-
className: "ml-auto flex min-w-0 items-center gap-1.5",
|
|
2258
|
+
q ? /* @__PURE__ */ T("div", {
|
|
2259
|
+
className: "flex w-full min-w-0 items-center gap-[calc(var(--fb-gap)*2)]",
|
|
1930
2260
|
children: [
|
|
1931
|
-
/* @__PURE__ */
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
className: "pointer-events-none absolute left-2 top-1/2 size-3.5 -translate-y-1/2 text-[var(--fb-muted)]"
|
|
1936
|
-
}), /* @__PURE__ */ T("input", {
|
|
1937
|
-
"aria-label": "Search files",
|
|
1938
|
-
className: `h-[var(--fb-control-h)] w-full rounded-[calc(var(--fb-radius)-3px)] border border-[var(--fb-border)] bg-[var(--fb-surface)] pl-7 pr-2 text-[12px] text-[var(--fb-text)] outline-none focus:border-[var(--fb-accent)] focus:ring-2 focus:ring-[var(--fb-accent-soft)] ${X}`,
|
|
1939
|
-
onChange: (e) => D.setSearchQuery(e.target.value),
|
|
1940
|
-
placeholder: "Search",
|
|
1941
|
-
type: "search",
|
|
1942
|
-
value: D.searchQuery
|
|
1943
|
-
})]
|
|
1944
|
-
}),
|
|
1945
|
-
/* @__PURE__ */ E("select", {
|
|
1946
|
-
"aria-label": "Filter files",
|
|
1947
|
-
className: pn(),
|
|
1948
|
-
onChange: (e) => D.setFilterKind(e.target.value),
|
|
1949
|
-
value: D.filterKind,
|
|
1950
|
-
children: [
|
|
1951
|
-
/* @__PURE__ */ T("option", {
|
|
1952
|
-
value: "all",
|
|
1953
|
-
children: "All"
|
|
1954
|
-
}),
|
|
1955
|
-
/* @__PURE__ */ T("option", {
|
|
1956
|
-
value: "folders",
|
|
1957
|
-
children: "Folders"
|
|
1958
|
-
}),
|
|
1959
|
-
/* @__PURE__ */ T("option", {
|
|
1960
|
-
value: "files",
|
|
1961
|
-
children: "Files"
|
|
1962
|
-
})
|
|
1963
|
-
]
|
|
1964
|
-
}),
|
|
1965
|
-
/* @__PURE__ */ E("select", {
|
|
1966
|
-
"aria-label": "Sort files",
|
|
1967
|
-
className: pn(),
|
|
1968
|
-
onChange: (e) => D.setSortBy(e.target.value),
|
|
1969
|
-
value: D.sortBy,
|
|
1970
|
-
children: [
|
|
1971
|
-
/* @__PURE__ */ T("option", {
|
|
1972
|
-
value: "name",
|
|
1973
|
-
children: "Name"
|
|
1974
|
-
}),
|
|
1975
|
-
/* @__PURE__ */ T("option", {
|
|
1976
|
-
value: "modifiedAt",
|
|
1977
|
-
children: "Modified"
|
|
1978
|
-
}),
|
|
1979
|
-
/* @__PURE__ */ T("option", {
|
|
1980
|
-
value: "size",
|
|
1981
|
-
children: "Size"
|
|
1982
|
-
})
|
|
1983
|
-
]
|
|
1984
|
-
}),
|
|
1985
|
-
/* @__PURE__ */ T("button", {
|
|
1986
|
-
"aria-label": "Toggle sort direction",
|
|
1987
|
-
className: un(!1),
|
|
1988
|
-
onClick: () => D.setSortDirection((e) => e === "asc" ? "desc" : "asc"),
|
|
2261
|
+
/* @__PURE__ */ w("button", {
|
|
2262
|
+
"aria-label": "Exit selection",
|
|
2263
|
+
className: Q(!1),
|
|
2264
|
+
onClick: Xn,
|
|
1989
2265
|
type: "button",
|
|
1990
|
-
children:
|
|
1991
|
-
}),
|
|
1992
|
-
/* @__PURE__ */ T("button", {
|
|
1993
|
-
"aria-label": "Grid view",
|
|
1994
|
-
className: un(D.view === "grid"),
|
|
1995
|
-
onClick: () => D.setView("grid"),
|
|
1996
|
-
type: "button",
|
|
1997
|
-
children: /* @__PURE__ */ T(fe, {
|
|
2266
|
+
children: /* @__PURE__ */ w(B, {
|
|
1998
2267
|
"aria-hidden": "true",
|
|
1999
2268
|
className: "size-4"
|
|
2000
2269
|
})
|
|
2001
2270
|
}),
|
|
2002
|
-
/* @__PURE__ */ T("
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
onClick: () => D.setView("list"),
|
|
2006
|
-
type: "button",
|
|
2007
|
-
children: /* @__PURE__ */ T(pe, {
|
|
2008
|
-
"aria-hidden": "true",
|
|
2009
|
-
className: "size-4"
|
|
2010
|
-
})
|
|
2271
|
+
/* @__PURE__ */ T("span", {
|
|
2272
|
+
className: "mr-auto whitespace-nowrap font-semibold",
|
|
2273
|
+
children: [E.selectedPaths.length, " selected"]
|
|
2011
2274
|
}),
|
|
2012
|
-
|
|
2275
|
+
/* @__PURE__ */ w("button", {
|
|
2013
2276
|
className: $(!1),
|
|
2014
|
-
onClick:
|
|
2015
|
-
j(null), k(!0);
|
|
2016
|
-
},
|
|
2277
|
+
onClick: E.selectAllLoaded,
|
|
2017
2278
|
type: "button",
|
|
2018
|
-
children:
|
|
2279
|
+
children: "Select all"
|
|
2280
|
+
})
|
|
2281
|
+
]
|
|
2282
|
+
}) : /* @__PURE__ */ T(ee, { children: [/* @__PURE__ */ w("div", {
|
|
2283
|
+
className: K ? "min-w-0 flex-1" : "min-w-0 max-w-full",
|
|
2284
|
+
children: /* @__PURE__ */ w(en, {
|
|
2285
|
+
narrow: K,
|
|
2286
|
+
onNavigate: (e) => E.navigate(e, { source: "breadcrumb" }),
|
|
2287
|
+
path: E.currentPath,
|
|
2288
|
+
rootLabel: l
|
|
2289
|
+
})
|
|
2290
|
+
}), K ? /* @__PURE__ */ w("button", {
|
|
2291
|
+
"aria-label": "Browser options",
|
|
2292
|
+
"aria-expanded": et,
|
|
2293
|
+
"aria-haspopup": "dialog",
|
|
2294
|
+
className: Q(!1),
|
|
2295
|
+
onClick: () => tt(!0),
|
|
2296
|
+
type: "button",
|
|
2297
|
+
children: /* @__PURE__ */ w(me, {
|
|
2298
|
+
"aria-hidden": "true",
|
|
2299
|
+
className: "size-5"
|
|
2300
|
+
})
|
|
2301
|
+
}) : null] }),
|
|
2302
|
+
Ue ? /* @__PURE__ */ w("span", {
|
|
2303
|
+
"aria-label": "Clipboard status",
|
|
2304
|
+
className: `rounded-[calc(var(--fb-radius)-4px)] bg-[var(--fb-accent-soft)] px-2 py-1 text-[12px] font-medium text-[var(--fb-accent)] ${Y}`,
|
|
2305
|
+
role: "status",
|
|
2306
|
+
children: Ue
|
|
2307
|
+
}) : null,
|
|
2308
|
+
q ? null : /* @__PURE__ */ T("div", {
|
|
2309
|
+
className: `flex min-w-0 flex-wrap items-center gap-[calc(var(--fb-gap)*2)] ${K ? "w-full" : "ml-auto max-w-full"}`,
|
|
2310
|
+
children: [
|
|
2311
|
+
/* @__PURE__ */ T("label", {
|
|
2312
|
+
className: `relative block min-w-0 ${K ? "w-full" : "w-[calc(var(--fb-gap)*44)] flex-1"}`,
|
|
2313
|
+
children: [/* @__PURE__ */ w(Se, {
|
|
2019
2314
|
"aria-hidden": "true",
|
|
2020
|
-
className: "size-
|
|
2021
|
-
}), "
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
className: "hidden"
|
|
2315
|
+
className: "pointer-events-none absolute left-2 top-1/2 size-3.5 -translate-y-1/2 text-[var(--fb-muted)]"
|
|
2316
|
+
}), /* @__PURE__ */ w("input", {
|
|
2317
|
+
"aria-label": "Search files",
|
|
2318
|
+
className: `h-[var(--fb-control-h)] min-h-[var(--fb-control-h)] w-full min-w-0 rounded-[calc(var(--fb-radius)-3px)] border border-[var(--fb-border)] bg-[var(--fb-surface)] pl-7 pr-2 text-[16px] text-[var(--fb-text)] outline-none focus:border-[var(--fb-accent)] focus:ring-2 focus:ring-[var(--fb-accent-soft)] @min-[40rem]/fb:text-[12px] [@media(pointer:coarse)]:min-h-[calc(var(--fb-gap)*11)] [@media(pointer:coarse)]:text-[16px] ${Y}`,
|
|
2319
|
+
onChange: (e) => E.setSearchQuery(e.target.value),
|
|
2320
|
+
placeholder: "Search",
|
|
2321
|
+
type: "search",
|
|
2322
|
+
value: E.searchQuery
|
|
2323
|
+
})]
|
|
2030
2324
|
}),
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2325
|
+
K ? null : Zn,
|
|
2326
|
+
!K && !m ? /* @__PURE__ */ T("button", {
|
|
2327
|
+
className: wn(),
|
|
2328
|
+
onClick: () => ut.current?.click(),
|
|
2034
2329
|
type: "button",
|
|
2035
|
-
children: [/* @__PURE__ */
|
|
2330
|
+
children: [/* @__PURE__ */ w(we, {
|
|
2036
2331
|
"aria-hidden": "true",
|
|
2037
2332
|
className: "size-4"
|
|
2038
2333
|
}), "Upload"]
|
|
2039
|
-
})
|
|
2334
|
+
}) : null
|
|
2040
2335
|
]
|
|
2041
2336
|
})
|
|
2042
2337
|
]
|
|
2043
2338
|
}),
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
selectedCount: D.selectedPaths.length
|
|
2061
|
-
}),
|
|
2062
|
-
Ne.length > 0 ? /* @__PURE__ */ T(Kt, {
|
|
2063
|
-
onDismiss: () => Pe([]),
|
|
2064
|
-
rejections: Ne
|
|
2339
|
+
K ? null : Qn,
|
|
2340
|
+
!Xe && !K && g ? /* @__PURE__ */ w("div", {
|
|
2341
|
+
className: "flex justify-end border-b border-[var(--fb-border)] px-[var(--fb-pad)] py-[var(--fb-cell-y)]",
|
|
2342
|
+
children: /* @__PURE__ */ T("button", {
|
|
2343
|
+
className: $(!1),
|
|
2344
|
+
onClick: () => at(!0),
|
|
2345
|
+
type: "button",
|
|
2346
|
+
children: [/* @__PURE__ */ w(ye, {
|
|
2347
|
+
"aria-hidden": "true",
|
|
2348
|
+
className: "size-4"
|
|
2349
|
+
}), "Details"]
|
|
2350
|
+
})
|
|
2351
|
+
}) : null,
|
|
2352
|
+
ze.length > 0 ? /* @__PURE__ */ w(sn, {
|
|
2353
|
+
onDismiss: () => Be([]),
|
|
2354
|
+
rejections: ze
|
|
2065
2355
|
}) : null,
|
|
2066
|
-
/* @__PURE__ */
|
|
2067
|
-
className: `relative min-h-0 flex-1 overflow-auto bg-[var(--fb-bg)] p-[var(--fb-pad)] ${
|
|
2068
|
-
onClick:
|
|
2069
|
-
onContextMenu:
|
|
2070
|
-
children: [
|
|
2071
|
-
title:
|
|
2356
|
+
/* @__PURE__ */ T("div", {
|
|
2357
|
+
className: `relative min-h-0 min-w-0 flex-1 overflow-auto bg-[var(--fb-bg)] p-[var(--fb-pad)] ${K && !m && !q ? "pb-[calc(var(--fb-gap)*20)]" : ""} ${X}`,
|
|
2358
|
+
onClick: Pn,
|
|
2359
|
+
onContextMenu: Nn,
|
|
2360
|
+
children: [E.status === "loading" && E.items.length === 0 ? /* @__PURE__ */ w(an, { rootLabel: l }) : E.status === "error" ? /* @__PURE__ */ w(on, {
|
|
2361
|
+
title: mn(E.error).title,
|
|
2072
2362
|
tone: "danger",
|
|
2073
|
-
value:
|
|
2074
|
-
}) :
|
|
2363
|
+
value: mn(E.error).value
|
|
2364
|
+
}) : E.filteredItems.length === 0 ? /* @__PURE__ */ w(on, {
|
|
2075
2365
|
title: i ? i.title : "This folder is empty",
|
|
2076
2366
|
value: i ? i.description : "Create a folder or upload files to start."
|
|
2077
|
-
}) :
|
|
2078
|
-
browser:
|
|
2079
|
-
canMove: !m &&
|
|
2080
|
-
folderDropTargetPath:
|
|
2081
|
-
inlineRenameError:
|
|
2082
|
-
inlineRenameLabel:
|
|
2083
|
-
inlineRenameItem:
|
|
2084
|
-
inlineRenameValue:
|
|
2085
|
-
onDragStart:
|
|
2086
|
-
onDragEnd:
|
|
2087
|
-
onFolderDragOver:
|
|
2088
|
-
onFolderDrop: (e, t) => void
|
|
2089
|
-
onEmptyClick: () =>
|
|
2090
|
-
onInlineRenameCancel:
|
|
2367
|
+
}) : E.view === "grid" ? /* @__PURE__ */ w(Ht, {
|
|
2368
|
+
browser: E,
|
|
2369
|
+
canMove: !m && E.capabilities.move,
|
|
2370
|
+
folderDropTargetPath: Ke,
|
|
2371
|
+
inlineRenameError: I,
|
|
2372
|
+
inlineRenameLabel: P?.name ?? "",
|
|
2373
|
+
inlineRenameItem: P,
|
|
2374
|
+
inlineRenameValue: xe,
|
|
2375
|
+
onDragStart: xn,
|
|
2376
|
+
onDragEnd: Dn,
|
|
2377
|
+
onFolderDragOver: kn,
|
|
2378
|
+
onFolderDrop: (e, t) => void An(e, t),
|
|
2379
|
+
onEmptyClick: () => E.clearSelection(),
|
|
2380
|
+
onInlineRenameCancel: Qt,
|
|
2091
2381
|
onInlineRenameChange: (e) => {
|
|
2092
|
-
|
|
2382
|
+
F(e), L(null);
|
|
2093
2383
|
},
|
|
2094
|
-
onInlineRenameCommit: () => void
|
|
2095
|
-
onContextMenu:
|
|
2096
|
-
onOpenItem:
|
|
2097
|
-
onSelectItem:
|
|
2098
|
-
onTouchMenu:
|
|
2099
|
-
|
|
2384
|
+
onInlineRenameCommit: () => void Z(),
|
|
2385
|
+
onContextMenu: jn,
|
|
2386
|
+
onOpenItem: wt,
|
|
2387
|
+
onSelectItem: Ct,
|
|
2388
|
+
onTouchMenu: Mn,
|
|
2389
|
+
narrow: K,
|
|
2390
|
+
selectionMode: q,
|
|
2391
|
+
onToggleItem: E.toggleSelection,
|
|
2392
|
+
renderItemMeta: ne,
|
|
2100
2393
|
rootLabel: l,
|
|
2101
|
-
selectedPaths:
|
|
2102
|
-
}) : /* @__PURE__ */
|
|
2103
|
-
browser:
|
|
2104
|
-
canMove: !m &&
|
|
2105
|
-
folderDropTargetPath:
|
|
2106
|
-
inlineRenameError:
|
|
2107
|
-
inlineRenameLabel:
|
|
2108
|
-
inlineRenameItem:
|
|
2109
|
-
inlineRenameValue:
|
|
2110
|
-
onDragStart:
|
|
2111
|
-
onDragEnd:
|
|
2112
|
-
onFolderDragOver:
|
|
2113
|
-
onFolderDrop: (e, t) => void
|
|
2114
|
-
onInlineRenameCancel:
|
|
2394
|
+
selectedPaths: E.selectedPaths
|
|
2395
|
+
}) : /* @__PURE__ */ w(Kt, {
|
|
2396
|
+
browser: E,
|
|
2397
|
+
canMove: !m && E.capabilities.move,
|
|
2398
|
+
folderDropTargetPath: Ke,
|
|
2399
|
+
inlineRenameError: I,
|
|
2400
|
+
inlineRenameLabel: P?.name ?? "",
|
|
2401
|
+
inlineRenameItem: P,
|
|
2402
|
+
inlineRenameValue: xe,
|
|
2403
|
+
onDragStart: xn,
|
|
2404
|
+
onDragEnd: Dn,
|
|
2405
|
+
onFolderDragOver: kn,
|
|
2406
|
+
onFolderDrop: (e, t) => void An(e, t),
|
|
2407
|
+
onInlineRenameCancel: Qt,
|
|
2115
2408
|
onInlineRenameChange: (e) => {
|
|
2116
|
-
|
|
2409
|
+
F(e), L(null);
|
|
2117
2410
|
},
|
|
2118
|
-
onInlineRenameCommit: () => void
|
|
2119
|
-
onContextMenu:
|
|
2120
|
-
onOpenItem:
|
|
2121
|
-
onSelectItem:
|
|
2122
|
-
|
|
2411
|
+
onInlineRenameCommit: () => void Z(),
|
|
2412
|
+
onContextMenu: jn,
|
|
2413
|
+
onOpenItem: wt,
|
|
2414
|
+
onSelectItem: Ct,
|
|
2415
|
+
onTouchMenu: Mn,
|
|
2416
|
+
narrow: K,
|
|
2417
|
+
selectionMode: q,
|
|
2418
|
+
onToggleItem: E.toggleSelection,
|
|
2419
|
+
renderItemMeta: ne,
|
|
2123
2420
|
rootLabel: l,
|
|
2124
|
-
selectedPaths:
|
|
2125
|
-
}),
|
|
2126
|
-
className: `pointer-events-none absolute inset-3 z-10 grid place-items-center rounded-[var(--fb-radius)] border-2 border-dashed border-[var(--fb-accent)] bg-[var(--fb-accent-soft)] text-[13px] font-semibold text-[var(--fb-accent)] ${
|
|
2421
|
+
selectedPaths: E.selectedPaths
|
|
2422
|
+
}), Ge ? /* @__PURE__ */ w("div", {
|
|
2423
|
+
className: `pointer-events-none absolute inset-3 z-10 grid place-items-center rounded-[var(--fb-radius)] border-2 border-dashed border-[var(--fb-accent)] bg-[var(--fb-accent-soft)] text-[13px] font-semibold text-[var(--fb-accent)] ${X}`,
|
|
2127
2424
|
children: "Drop files to upload"
|
|
2128
2425
|
}) : null]
|
|
2129
2426
|
}),
|
|
2130
|
-
/* @__PURE__ */
|
|
2131
|
-
className: `flex h-
|
|
2132
|
-
children: [
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2427
|
+
/* @__PURE__ */ T("footer", {
|
|
2428
|
+
className: `sticky bottom-0 flex min-h-[calc(var(--fb-gap)*11)] min-w-0 flex-wrap items-center justify-between gap-[var(--fb-gap)] rounded-b-[var(--fb-radius)] border-t border-[var(--fb-border)] bg-[var(--fb-surface)] px-[var(--fb-pad)] py-[var(--fb-gap)] text-[11px] text-[var(--fb-muted)] ${X}`,
|
|
2429
|
+
children: [
|
|
2430
|
+
q ? /* @__PURE__ */ T("div", {
|
|
2431
|
+
"aria-label": "Selection actions",
|
|
2432
|
+
className: "flex w-full flex-wrap items-center gap-[calc(var(--fb-gap)*2)]",
|
|
2433
|
+
role: "toolbar",
|
|
2434
|
+
children: [/* @__PURE__ */ T("button", {
|
|
2435
|
+
className: $(!1),
|
|
2436
|
+
disabled: !gt,
|
|
2437
|
+
onClick: () => st(!0),
|
|
2438
|
+
type: "button",
|
|
2439
|
+
children: [/* @__PURE__ */ w(me, {
|
|
2440
|
+
"aria-hidden": "true",
|
|
2441
|
+
className: "size-4"
|
|
2442
|
+
}), "Actions"]
|
|
2443
|
+
}), g ? /* @__PURE__ */ T("button", {
|
|
2444
|
+
className: $(!1),
|
|
2445
|
+
disabled: !gt,
|
|
2446
|
+
onClick: () => at(!0),
|
|
2447
|
+
type: "button",
|
|
2448
|
+
children: [/* @__PURE__ */ w(ye, {
|
|
2449
|
+
"aria-hidden": "true",
|
|
2450
|
+
className: "size-4"
|
|
2451
|
+
}), "Details"]
|
|
2452
|
+
}) : null]
|
|
2453
|
+
}) : null,
|
|
2454
|
+
/* @__PURE__ */ T("span", { children: [
|
|
2455
|
+
E.filteredItems.length,
|
|
2456
|
+
" items",
|
|
2457
|
+
E.selectedPaths.length ? ` · ${E.selectedPaths.length} selected` : ""
|
|
2458
|
+
] }),
|
|
2459
|
+
K && !m && !q ? /* @__PURE__ */ T("button", {
|
|
2460
|
+
"aria-label": "Upload",
|
|
2461
|
+
className: `${wn()} absolute bottom-[calc(var(--fb-gap)*14)] right-[var(--fb-pad)] shadow-lg`,
|
|
2462
|
+
onClick: () => ut.current?.click(),
|
|
2463
|
+
type: "button",
|
|
2464
|
+
children: [/* @__PURE__ */ w(we, {
|
|
2465
|
+
"aria-hidden": "true",
|
|
2466
|
+
className: "size-5"
|
|
2467
|
+
}), "Upload"]
|
|
2468
|
+
}) : null,
|
|
2469
|
+
E.hasMore ? /* @__PURE__ */ w("button", {
|
|
2470
|
+
className: `min-h-[var(--fb-control-h)] rounded-[calc(var(--fb-radius)-4px)] px-2 py-1 font-medium text-[var(--fb-accent)] hover:bg-[var(--fb-accent-soft)] ${At} ${Y}`,
|
|
2471
|
+
onClick: () => void E.loadMore(),
|
|
2472
|
+
type: "button",
|
|
2473
|
+
children: "Load more"
|
|
2474
|
+
}) : /* @__PURE__ */ w("span", {})
|
|
2475
|
+
]
|
|
2142
2476
|
})
|
|
2143
2477
|
]
|
|
2144
2478
|
}),
|
|
2145
|
-
g ?
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2479
|
+
g && Xe ? $n : null,
|
|
2480
|
+
g && !Xe && it ? /* @__PURE__ */ w(rt, {
|
|
2481
|
+
label: "Details",
|
|
2482
|
+
onClose: () => at(!1),
|
|
2483
|
+
children: $n
|
|
2484
|
+
}) : null,
|
|
2485
|
+
K && et ? /* @__PURE__ */ w(rt, {
|
|
2486
|
+
label: "Browser options",
|
|
2487
|
+
onClose: () => tt(!1),
|
|
2488
|
+
children: Zn
|
|
2153
2489
|
}) : null,
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2490
|
+
q && ot ? /* @__PURE__ */ w(rt, {
|
|
2491
|
+
label: "Selected item actions",
|
|
2492
|
+
onClose: () => st(!1),
|
|
2493
|
+
children: /* @__PURE__ */ w("div", {
|
|
2494
|
+
onClick: (e) => {
|
|
2495
|
+
e.target.closest("button:not(:disabled)") && st(!1);
|
|
2496
|
+
},
|
|
2497
|
+
children: Qn
|
|
2498
|
+
})
|
|
2499
|
+
}) : null,
|
|
2500
|
+
Ie ? /* @__PURE__ */ w(Jt, {
|
|
2501
|
+
browser: E,
|
|
2502
|
+
canDownload: yt,
|
|
2503
|
+
menu: Ie,
|
|
2504
|
+
onClose: () => Le(null),
|
|
2505
|
+
onDelete: () => z(!0),
|
|
2506
|
+
onDownload: () => void In(),
|
|
2507
|
+
onMove: hn,
|
|
2162
2508
|
onNewFolder: () => {
|
|
2163
|
-
j(null),
|
|
2509
|
+
j(null), oe(!0);
|
|
2164
2510
|
},
|
|
2165
|
-
onCopy: () =>
|
|
2166
|
-
onCopyPath: (e) => void
|
|
2167
|
-
onCut: () =>
|
|
2168
|
-
onPaste: () => void
|
|
2169
|
-
onRename:
|
|
2170
|
-
onUpload: () =>
|
|
2511
|
+
onCopy: () => Nt(),
|
|
2512
|
+
onCopyPath: (e) => void Vt(E.selectedPaths.includes(e.path) ? E.selectedPaths : [e.path]),
|
|
2513
|
+
onCut: () => zt(),
|
|
2514
|
+
onPaste: () => void Ut(E.currentPath),
|
|
2515
|
+
onRename: Gt,
|
|
2516
|
+
onUpload: () => ut.current?.click(),
|
|
2171
2517
|
readOnly: m
|
|
2172
2518
|
}) : null,
|
|
2173
|
-
O ? /* @__PURE__ */
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
className: `w-[min(360px,100%)] rounded-[var(--fb-radius)] border border-[var(--fb-border)] bg-[var(--fb-surface)] p-4 shadow-[0_18px_50px_color-mix(in_oklch,var(--fb-text)_18%,transparent)] ${Z}`,
|
|
2519
|
+
O ? /* @__PURE__ */ w(nt, {
|
|
2520
|
+
label: "New folder",
|
|
2521
|
+
narrow: K,
|
|
2522
|
+
onClose: () => oe(!1),
|
|
2523
|
+
children: /* @__PURE__ */ T("form", {
|
|
2524
|
+
className: `w-[min(360px,100%)] rounded-[var(--fb-radius)] border border-[var(--fb-border)] bg-[var(--fb-surface)] p-4 shadow-[0_18px_50px_color-mix(in_oklch,var(--fb-text)_18%,transparent)] ${X}`,
|
|
2180
2525
|
onSubmit: (e) => {
|
|
2181
|
-
e.preventDefault(),
|
|
2526
|
+
e.preventDefault(), Wt();
|
|
2182
2527
|
},
|
|
2183
2528
|
children: [
|
|
2184
|
-
/* @__PURE__ */
|
|
2529
|
+
/* @__PURE__ */ w("h2", {
|
|
2185
2530
|
className: "m-0 text-[14px] font-semibold",
|
|
2186
2531
|
children: "New folder"
|
|
2187
2532
|
}),
|
|
2188
|
-
/* @__PURE__ */
|
|
2533
|
+
/* @__PURE__ */ T("label", {
|
|
2189
2534
|
className: "mt-3 block text-[12px] font-medium text-[var(--fb-muted)]",
|
|
2190
|
-
children: ["Folder name", /* @__PURE__ */
|
|
2535
|
+
children: ["Folder name", /* @__PURE__ */ w("input", {
|
|
2191
2536
|
"aria-label": "Folder name",
|
|
2192
|
-
|
|
2193
|
-
className: `mt-1 h-9 w-full rounded-[calc(var(--fb-radius)-3px)] border border-[var(--fb-border)] bg-[var(--fb-surface)] px-2 text-[13px] text-[var(--fb-text)] outline-none focus:border-[var(--fb-accent)] focus:ring-2 focus:ring-[var(--fb-accent-soft)] ${X}`,
|
|
2537
|
+
className: `mt-1 h-[max(var(--fb-control-h),calc(var(--fb-gap)*9))] w-full min-w-0 rounded-[calc(var(--fb-radius)-3px)] border border-[var(--fb-border)] bg-[var(--fb-surface)] px-2 text-[16px] text-[var(--fb-text)] outline-none focus:border-[var(--fb-accent)] focus:ring-2 focus:ring-[var(--fb-accent-soft)] ${Y}`,
|
|
2194
2538
|
onChange: (e) => {
|
|
2195
|
-
|
|
2539
|
+
se(e.target.value), j(null);
|
|
2196
2540
|
},
|
|
2197
|
-
value:
|
|
2541
|
+
value: k
|
|
2198
2542
|
})]
|
|
2199
2543
|
}),
|
|
2200
|
-
|
|
2201
|
-
className: `mt-3 rounded-[calc(var(--fb-radius)-4px)] border border-[var(--fb-danger)] bg-[var(--fb-danger-soft)] px-2 py-1.5 text-[12px] text-[var(--fb-danger)] ${
|
|
2544
|
+
A ? /* @__PURE__ */ w("div", {
|
|
2545
|
+
className: `mt-3 rounded-[calc(var(--fb-radius)-4px)] border border-[var(--fb-danger)] bg-[var(--fb-danger-soft)] px-2 py-1.5 text-[12px] text-[var(--fb-danger)] ${X}`,
|
|
2202
2546
|
role: "alert",
|
|
2203
|
-
children:
|
|
2547
|
+
children: A
|
|
2204
2548
|
}) : null,
|
|
2205
|
-
/* @__PURE__ */
|
|
2206
|
-
className: "mt-4 flex justify-end gap-2",
|
|
2207
|
-
children: [/* @__PURE__ */
|
|
2549
|
+
/* @__PURE__ */ T("div", {
|
|
2550
|
+
className: "mt-4 flex flex-wrap justify-end gap-2",
|
|
2551
|
+
children: [/* @__PURE__ */ w("button", {
|
|
2208
2552
|
className: $(!1),
|
|
2209
2553
|
onClick: () => {
|
|
2210
|
-
j(null),
|
|
2554
|
+
j(null), oe(!1);
|
|
2211
2555
|
},
|
|
2212
2556
|
type: "button",
|
|
2213
2557
|
children: "Cancel"
|
|
2214
|
-
}), /* @__PURE__ */
|
|
2215
|
-
className:
|
|
2558
|
+
}), /* @__PURE__ */ w("button", {
|
|
2559
|
+
className: wn(),
|
|
2216
2560
|
type: "submit",
|
|
2217
2561
|
children: "Create folder"
|
|
2218
2562
|
})]
|
|
@@ -2220,49 +2564,47 @@ function bt({ adapter: e, className: n, emptyState: i, initialPath: a = "/", pat
|
|
|
2220
2564
|
]
|
|
2221
2565
|
})
|
|
2222
2566
|
}) : null,
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
className: `w-[min(360px,100%)] rounded-[var(--fb-radius)] border border-[var(--fb-border)] bg-[var(--fb-surface)] p-4 shadow-[0_18px_50px_color-mix(in_oklch,var(--fb-text)_18%,transparent)] ${Z}`,
|
|
2567
|
+
ce ? /* @__PURE__ */ w(nt, {
|
|
2568
|
+
label: "Rename item",
|
|
2569
|
+
narrow: K,
|
|
2570
|
+
onClose: () => le(null),
|
|
2571
|
+
children: /* @__PURE__ */ T("form", {
|
|
2572
|
+
className: `w-[min(360px,100%)] rounded-[var(--fb-radius)] border border-[var(--fb-border)] bg-[var(--fb-surface)] p-4 shadow-[0_18px_50px_color-mix(in_oklch,var(--fb-text)_18%,transparent)] ${X}`,
|
|
2230
2573
|
onSubmit: (e) => {
|
|
2231
|
-
e.preventDefault(),
|
|
2574
|
+
e.preventDefault(), qt();
|
|
2232
2575
|
},
|
|
2233
2576
|
children: [
|
|
2234
|
-
/* @__PURE__ */
|
|
2577
|
+
/* @__PURE__ */ w("h2", {
|
|
2235
2578
|
className: "m-0 text-[14px] font-semibold",
|
|
2236
2579
|
children: "Rename"
|
|
2237
2580
|
}),
|
|
2238
|
-
/* @__PURE__ */
|
|
2581
|
+
/* @__PURE__ */ T("label", {
|
|
2239
2582
|
className: "mt-3 block text-[12px] font-medium text-[var(--fb-muted)]",
|
|
2240
|
-
children: ["New name", /* @__PURE__ */
|
|
2583
|
+
children: ["New name", /* @__PURE__ */ w("input", {
|
|
2241
2584
|
"aria-label": "New name",
|
|
2242
|
-
|
|
2243
|
-
className: `mt-1 h-9 w-full rounded-[calc(var(--fb-radius)-3px)] border border-[var(--fb-border)] bg-[var(--fb-surface)] px-2 text-[13px] text-[var(--fb-text)] outline-none focus:border-[var(--fb-accent)] focus:ring-2 focus:ring-[var(--fb-accent-soft)] ${X}`,
|
|
2585
|
+
className: `mt-1 h-[max(var(--fb-control-h),calc(var(--fb-gap)*9))] w-full min-w-0 rounded-[calc(var(--fb-radius)-3px)] border border-[var(--fb-border)] bg-[var(--fb-surface)] px-2 text-[16px] text-[var(--fb-text)] outline-none focus:border-[var(--fb-accent)] focus:ring-2 focus:ring-[var(--fb-accent-soft)] ${Y}`,
|
|
2244
2586
|
onChange: (e) => {
|
|
2245
|
-
|
|
2587
|
+
ue(e.target.value), N(null);
|
|
2246
2588
|
},
|
|
2247
|
-
value:
|
|
2589
|
+
value: M
|
|
2248
2590
|
})]
|
|
2249
2591
|
}),
|
|
2250
|
-
|
|
2251
|
-
className: `mt-3 rounded-[calc(var(--fb-radius)-4px)] border border-[var(--fb-danger)] bg-[var(--fb-danger-soft)] px-2 py-1.5 text-[12px] text-[var(--fb-danger)] ${
|
|
2592
|
+
pe ? /* @__PURE__ */ w("div", {
|
|
2593
|
+
className: `mt-3 rounded-[calc(var(--fb-radius)-4px)] border border-[var(--fb-danger)] bg-[var(--fb-danger-soft)] px-2 py-1.5 text-[12px] text-[var(--fb-danger)] ${X}`,
|
|
2252
2594
|
role: "alert",
|
|
2253
|
-
children:
|
|
2595
|
+
children: pe
|
|
2254
2596
|
}) : null,
|
|
2255
|
-
/* @__PURE__ */
|
|
2256
|
-
className: "mt-4 flex justify-end gap-2",
|
|
2257
|
-
children: [/* @__PURE__ */
|
|
2597
|
+
/* @__PURE__ */ T("div", {
|
|
2598
|
+
className: "mt-4 flex flex-wrap justify-end gap-2",
|
|
2599
|
+
children: [/* @__PURE__ */ w("button", {
|
|
2258
2600
|
className: $(!1),
|
|
2259
2601
|
onClick: () => {
|
|
2260
|
-
|
|
2602
|
+
le(null), ue(""), N(null);
|
|
2261
2603
|
},
|
|
2262
2604
|
type: "button",
|
|
2263
2605
|
children: "Cancel"
|
|
2264
|
-
}), /* @__PURE__ */
|
|
2265
|
-
className:
|
|
2606
|
+
}), /* @__PURE__ */ w("button", {
|
|
2607
|
+
className: wn(),
|
|
2266
2608
|
type: "submit",
|
|
2267
2609
|
children: "Rename item"
|
|
2268
2610
|
})]
|
|
@@ -2270,41 +2612,40 @@ function bt({ adapter: e, className: n, emptyState: i, initialPath: a = "/", pat
|
|
|
2270
2612
|
]
|
|
2271
2613
|
})
|
|
2272
2614
|
}) : null,
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
className: `w-[min(400px,100%)] rounded-[var(--fb-radius)] border border-[var(--fb-border)] bg-[var(--fb-surface)] p-4 shadow-[0_18px_50px_color-mix(in_oklch,var(--fb-text)_18%,transparent)] ${Z}`,
|
|
2615
|
+
R ? /* @__PURE__ */ w(nt, {
|
|
2616
|
+
label: "Delete selected items",
|
|
2617
|
+
narrow: K,
|
|
2618
|
+
onClose: () => z(!1),
|
|
2619
|
+
children: /* @__PURE__ */ T("form", {
|
|
2620
|
+
className: `w-[min(400px,100%)] rounded-[var(--fb-radius)] border border-[var(--fb-border)] bg-[var(--fb-surface)] p-4 shadow-[0_18px_50px_color-mix(in_oklch,var(--fb-text)_18%,transparent)] ${X}`,
|
|
2280
2621
|
onSubmit: (e) => {
|
|
2281
|
-
e.preventDefault(),
|
|
2622
|
+
e.preventDefault(), tn();
|
|
2282
2623
|
},
|
|
2283
2624
|
children: [
|
|
2284
|
-
/* @__PURE__ */
|
|
2625
|
+
/* @__PURE__ */ w("h2", {
|
|
2285
2626
|
className: "m-0 text-[14px] font-semibold",
|
|
2286
2627
|
children: "Delete selected items"
|
|
2287
2628
|
}),
|
|
2288
|
-
/* @__PURE__ */
|
|
2629
|
+
/* @__PURE__ */ w("p", {
|
|
2289
2630
|
className: "mt-2 text-[12px] text-[var(--fb-muted)]",
|
|
2290
2631
|
children: "This removes the selected entries from storage."
|
|
2291
2632
|
}),
|
|
2292
|
-
/* @__PURE__ */
|
|
2293
|
-
className: `mt-3 max-h-32 overflow-auto rounded-[calc(var(--fb-radius)-3px)] border border-[var(--fb-border)] bg-[var(--fb-bg)] p-2 text-[12px] ${
|
|
2294
|
-
children:
|
|
2633
|
+
/* @__PURE__ */ w("ul", {
|
|
2634
|
+
className: `mt-3 max-h-32 overflow-auto rounded-[calc(var(--fb-radius)-3px)] border border-[var(--fb-border)] bg-[var(--fb-bg)] p-2 text-[12px] ${X}`,
|
|
2635
|
+
children: E.selectedItems.map((e) => /* @__PURE__ */ w("li", {
|
|
2295
2636
|
className: "truncate py-1",
|
|
2296
2637
|
children: e.name
|
|
2297
2638
|
}, e.path))
|
|
2298
2639
|
}),
|
|
2299
|
-
/* @__PURE__ */
|
|
2300
|
-
className: "mt-4 flex justify-end gap-2",
|
|
2301
|
-
children: [/* @__PURE__ */
|
|
2640
|
+
/* @__PURE__ */ T("div", {
|
|
2641
|
+
className: "mt-4 flex flex-wrap justify-end gap-2",
|
|
2642
|
+
children: [/* @__PURE__ */ w("button", {
|
|
2302
2643
|
className: $(!1),
|
|
2303
|
-
onClick: () =>
|
|
2644
|
+
onClick: () => z(!1),
|
|
2304
2645
|
type: "button",
|
|
2305
2646
|
children: "Cancel"
|
|
2306
|
-
}), /* @__PURE__ */
|
|
2307
|
-
className:
|
|
2647
|
+
}), /* @__PURE__ */ w("button", {
|
|
2648
|
+
className: Tn(),
|
|
2308
2649
|
type: "submit",
|
|
2309
2650
|
children: "Delete selected"
|
|
2310
2651
|
})]
|
|
@@ -2312,47 +2653,46 @@ function bt({ adapter: e, className: n, emptyState: i, initialPath: a = "/", pat
|
|
|
2312
2653
|
]
|
|
2313
2654
|
})
|
|
2314
2655
|
}) : null,
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
className: `w-[min(420px,100%)] rounded-[var(--fb-radius)] border border-[var(--fb-border)] bg-[var(--fb-surface)] p-4 shadow-[0_18px_50px_color-mix(in_oklch,var(--fb-text)_18%,transparent)] ${Z}`,
|
|
2656
|
+
Ce ? /* @__PURE__ */ w(nt, {
|
|
2657
|
+
label: "Move selected items",
|
|
2658
|
+
narrow: K,
|
|
2659
|
+
onClose: () => V(!1),
|
|
2660
|
+
children: /* @__PURE__ */ T("form", {
|
|
2661
|
+
className: `w-[min(420px,100%)] rounded-[var(--fb-radius)] border border-[var(--fb-border)] bg-[var(--fb-surface)] p-4 shadow-[0_18px_50px_color-mix(in_oklch,var(--fb-text)_18%,transparent)] ${X}`,
|
|
2322
2662
|
onSubmit: (e) => {
|
|
2323
|
-
e.preventDefault(),
|
|
2663
|
+
e.preventDefault(), vn();
|
|
2324
2664
|
},
|
|
2325
2665
|
children: [
|
|
2326
|
-
/* @__PURE__ */
|
|
2666
|
+
/* @__PURE__ */ w("h2", {
|
|
2327
2667
|
className: "m-0 text-[14px] font-semibold",
|
|
2328
2668
|
children: "Move selected items"
|
|
2329
2669
|
}),
|
|
2330
|
-
/* @__PURE__ */
|
|
2670
|
+
/* @__PURE__ */ w("p", {
|
|
2331
2671
|
className: "mt-2 text-[12px] text-[var(--fb-muted)]",
|
|
2332
2672
|
children: "Choose a destination folder from the folder tree."
|
|
2333
2673
|
}),
|
|
2334
|
-
/* @__PURE__ */
|
|
2335
|
-
currentPath:
|
|
2336
|
-
destinations:
|
|
2337
|
-
error:
|
|
2338
|
-
onSelect:
|
|
2674
|
+
/* @__PURE__ */ w(Zt, {
|
|
2675
|
+
currentPath: E.currentPath,
|
|
2676
|
+
destinations: je,
|
|
2677
|
+
error: Pe,
|
|
2678
|
+
onSelect: Ae,
|
|
2339
2679
|
rootLabel: l,
|
|
2340
|
-
selectedPath:
|
|
2341
|
-
status:
|
|
2680
|
+
selectedPath: ke,
|
|
2681
|
+
status: Ne
|
|
2342
2682
|
}),
|
|
2343
|
-
/* @__PURE__ */
|
|
2683
|
+
/* @__PURE__ */ T("div", {
|
|
2344
2684
|
className: "mt-3 truncate text-[11px] text-[var(--fb-muted)]",
|
|
2345
|
-
children: ["Destination: ",
|
|
2685
|
+
children: ["Destination: ", ke]
|
|
2346
2686
|
}),
|
|
2347
|
-
/* @__PURE__ */
|
|
2348
|
-
className: "mt-4 flex justify-end gap-2",
|
|
2349
|
-
children: [/* @__PURE__ */
|
|
2687
|
+
/* @__PURE__ */ T("div", {
|
|
2688
|
+
className: "mt-4 flex flex-wrap justify-end gap-2",
|
|
2689
|
+
children: [/* @__PURE__ */ w("button", {
|
|
2350
2690
|
className: $(!1),
|
|
2351
|
-
onClick: () =>
|
|
2691
|
+
onClick: () => V(!1),
|
|
2352
2692
|
type: "button",
|
|
2353
2693
|
children: "Cancel"
|
|
2354
|
-
}), /* @__PURE__ */
|
|
2355
|
-
className:
|
|
2694
|
+
}), /* @__PURE__ */ w("button", {
|
|
2695
|
+
className: wn(),
|
|
2356
2696
|
type: "submit",
|
|
2357
2697
|
children: "Move here"
|
|
2358
2698
|
})]
|
|
@@ -2360,96 +2700,97 @@ function bt({ adapter: e, className: n, emptyState: i, initialPath: a = "/", pat
|
|
|
2360
2700
|
]
|
|
2361
2701
|
})
|
|
2362
2702
|
}) : null,
|
|
2363
|
-
|
|
2364
|
-
error:
|
|
2365
|
-
|
|
2703
|
+
De ? /* @__PURE__ */ w(Xt, {
|
|
2704
|
+
error: De,
|
|
2705
|
+
narrow: K,
|
|
2706
|
+
onClose: () => Oe(null)
|
|
2366
2707
|
}) : null,
|
|
2367
|
-
|
|
2368
|
-
applyToAll:
|
|
2369
|
-
|
|
2370
|
-
|
|
2708
|
+
Re ? /* @__PURE__ */ w(Yt, {
|
|
2709
|
+
applyToAll: Ve,
|
|
2710
|
+
narrow: K,
|
|
2711
|
+
currentPath: E.currentPath,
|
|
2712
|
+
onApplyToAllChange: He,
|
|
2371
2713
|
onCancel: () => {
|
|
2372
|
-
|
|
2714
|
+
U(null), He(!1);
|
|
2373
2715
|
},
|
|
2374
|
-
onResolve: (e) =>
|
|
2375
|
-
queue:
|
|
2376
|
-
resolutions:
|
|
2716
|
+
onResolve: (e) => Jn(e),
|
|
2717
|
+
queue: Re,
|
|
2718
|
+
resolutions: _t
|
|
2377
2719
|
}) : null,
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
className: "flex items-center gap-1",
|
|
2720
|
+
G ? /* @__PURE__ */ w(nt, {
|
|
2721
|
+
label: `Preview ${G.item.name}`,
|
|
2722
|
+
narrow: K,
|
|
2723
|
+
onClose: () => Je(null),
|
|
2724
|
+
children: /* @__PURE__ */ T("div", {
|
|
2725
|
+
className: `w-[min(720px,100%)] overflow-hidden rounded-[var(--fb-radius)] border border-[var(--fb-border)] bg-[var(--fb-surface)] shadow-[0_22px_70px_color-mix(in_oklch,var(--fb-text)_24%,transparent)] ${X}`,
|
|
2726
|
+
children: [/* @__PURE__ */ T("div", {
|
|
2727
|
+
className: `flex min-h-[calc(var(--fb-gap)*12)] min-w-0 flex-wrap items-center justify-between gap-[calc(var(--fb-gap)*2)] border-b border-[var(--fb-border)] p-[calc(var(--fb-gap)*3)] ${X}`,
|
|
2728
|
+
children: [/* @__PURE__ */ T("div", {
|
|
2729
|
+
className: "min-w-0 max-w-full flex-1 basis-[calc(var(--fb-gap)*40)] truncate font-semibold",
|
|
2730
|
+
children: ["Preview ", G.item.name]
|
|
2731
|
+
}), /* @__PURE__ */ T("div", {
|
|
2732
|
+
className: "flex shrink-0 items-center gap-1",
|
|
2392
2733
|
children: [
|
|
2393
|
-
/* @__PURE__ */
|
|
2734
|
+
/* @__PURE__ */ w("button", {
|
|
2394
2735
|
"aria-label": "Previous file",
|
|
2395
|
-
className:
|
|
2396
|
-
disabled:
|
|
2397
|
-
onClick: () =>
|
|
2736
|
+
className: Q(!1),
|
|
2737
|
+
disabled: bt.length <= 1,
|
|
2738
|
+
onClick: () => Fn(-1),
|
|
2398
2739
|
type: "button",
|
|
2399
|
-
children: /* @__PURE__ */
|
|
2740
|
+
children: /* @__PURE__ */ w(de, {
|
|
2400
2741
|
"aria-hidden": "true",
|
|
2401
2742
|
className: "size-4"
|
|
2402
2743
|
})
|
|
2403
2744
|
}),
|
|
2404
|
-
/* @__PURE__ */
|
|
2745
|
+
/* @__PURE__ */ w("button", {
|
|
2405
2746
|
"aria-label": "Next file",
|
|
2406
|
-
className:
|
|
2407
|
-
disabled:
|
|
2408
|
-
onClick: () =>
|
|
2747
|
+
className: Q(!1),
|
|
2748
|
+
disabled: bt.length <= 1,
|
|
2749
|
+
onClick: () => Fn(1),
|
|
2409
2750
|
type: "button",
|
|
2410
|
-
children: /* @__PURE__ */
|
|
2751
|
+
children: /* @__PURE__ */ w(fe, {
|
|
2411
2752
|
"aria-hidden": "true",
|
|
2412
2753
|
className: "size-4"
|
|
2413
2754
|
})
|
|
2414
2755
|
}),
|
|
2415
|
-
/* @__PURE__ */
|
|
2416
|
-
className:
|
|
2417
|
-
onClick: () =>
|
|
2756
|
+
/* @__PURE__ */ w("button", {
|
|
2757
|
+
className: Q(!1),
|
|
2758
|
+
onClick: () => Je(null),
|
|
2418
2759
|
type: "button",
|
|
2419
2760
|
children: "Close"
|
|
2420
2761
|
})
|
|
2421
2762
|
]
|
|
2422
2763
|
})]
|
|
2423
|
-
}), /* @__PURE__ */
|
|
2424
|
-
className: `grid min-h-[260px] place-items-center bg-[var(--fb-bg)] p-
|
|
2425
|
-
children:
|
|
2426
|
-
className: "text-center",
|
|
2427
|
-
children: [/* @__PURE__ */
|
|
2428
|
-
alt:
|
|
2429
|
-
className: `max-h-[420px] max-w-full rounded-[calc(var(--fb-radius)-2px)] object-contain ${
|
|
2430
|
-
src:
|
|
2431
|
-
}), /* @__PURE__ */
|
|
2432
|
-
}) : /* @__PURE__ */
|
|
2433
|
-
className: "text-center",
|
|
2764
|
+
}), /* @__PURE__ */ w("div", {
|
|
2765
|
+
className: `grid min-h-[min(260px,40dvh)] min-w-0 place-items-center bg-[var(--fb-bg)] p-[var(--fb-pad)] ${X}`,
|
|
2766
|
+
children: G.item.mimeType?.startsWith("image/") && G.url || G.item.thumbnailUrl ? /* @__PURE__ */ T("div", {
|
|
2767
|
+
className: "min-w-0 max-w-full text-center",
|
|
2768
|
+
children: [/* @__PURE__ */ w("img", {
|
|
2769
|
+
alt: G.item.name,
|
|
2770
|
+
className: `max-h-[min(420px,55dvh)] max-w-full rounded-[calc(var(--fb-radius)-2px)] object-contain ${X}`,
|
|
2771
|
+
src: G.url ?? G.item.thumbnailUrl
|
|
2772
|
+
}), /* @__PURE__ */ w(rn, { preview: G })]
|
|
2773
|
+
}) : /* @__PURE__ */ T("div", {
|
|
2774
|
+
className: "min-w-0 max-w-full text-center",
|
|
2434
2775
|
children: [
|
|
2435
|
-
/* @__PURE__ */
|
|
2436
|
-
/* @__PURE__ */
|
|
2776
|
+
/* @__PURE__ */ w(he, { className: "mx-auto size-12 text-[var(--fb-muted)]" }),
|
|
2777
|
+
/* @__PURE__ */ w("div", {
|
|
2437
2778
|
className: "mt-3 font-semibold",
|
|
2438
|
-
children:
|
|
2779
|
+
children: G.item.name
|
|
2439
2780
|
}),
|
|
2440
|
-
/* @__PURE__ */
|
|
2781
|
+
/* @__PURE__ */ w("div", {
|
|
2441
2782
|
className: "mt-1 text-[12px] text-[var(--fb-muted)]",
|
|
2442
|
-
children:
|
|
2783
|
+
children: G.item.mimeType ?? "File"
|
|
2443
2784
|
}),
|
|
2444
|
-
|
|
2785
|
+
G.status === "loading" ? /* @__PURE__ */ w("div", {
|
|
2445
2786
|
className: "mt-3 text-[12px] text-[var(--fb-muted)]",
|
|
2446
2787
|
children: "Loading preview"
|
|
2447
2788
|
}) : null,
|
|
2448
|
-
|
|
2789
|
+
G.status === "error" ? /* @__PURE__ */ w("div", {
|
|
2449
2790
|
className: "mt-3 text-[12px] text-[var(--fb-danger)]",
|
|
2450
|
-
children:
|
|
2791
|
+
children: G.error ?? "Could not load preview"
|
|
2451
2792
|
}) : null,
|
|
2452
|
-
/* @__PURE__ */
|
|
2793
|
+
/* @__PURE__ */ w(rn, { preview: G })
|
|
2453
2794
|
]
|
|
2454
2795
|
})
|
|
2455
2796
|
})]
|
|
@@ -2458,10 +2799,10 @@ function bt({ adapter: e, className: n, emptyState: i, initialPath: a = "/", pat
|
|
|
2458
2799
|
]
|
|
2459
2800
|
});
|
|
2460
2801
|
}
|
|
2461
|
-
function
|
|
2802
|
+
function Pt(t, n) {
|
|
2462
2803
|
return n.split("/").filter(Boolean).reduce((t, n) => e(t, n), t);
|
|
2463
2804
|
}
|
|
2464
|
-
function
|
|
2805
|
+
function Ft(e) {
|
|
2465
2806
|
let t = /* @__PURE__ */ new Set();
|
|
2466
2807
|
for (let { relativePath: n } of e) {
|
|
2467
2808
|
let e = n.split("/").filter(Boolean);
|
|
@@ -2469,22 +2810,22 @@ function St(e) {
|
|
|
2469
2810
|
}
|
|
2470
2811
|
return Array.from(t).sort((e, t) => e.split("/").length - t.split("/").length || e.localeCompare(t));
|
|
2471
2812
|
}
|
|
2472
|
-
function
|
|
2813
|
+
function It(e, t) {
|
|
2473
2814
|
let n = [], r = [];
|
|
2474
2815
|
for (let i of e) t(i) ? n.push(i) : r.push(i);
|
|
2475
2816
|
return [n, r];
|
|
2476
2817
|
}
|
|
2477
|
-
function
|
|
2478
|
-
if (
|
|
2818
|
+
function Lt(e, t, n = 0) {
|
|
2819
|
+
if (Ft(t).length === 0) return;
|
|
2479
2820
|
let r = t.map((e) => e.relativePath.split("/").filter(Boolean)[0]).filter((e) => !!e), i = Array.from(new Set(r)), o = i.length === 1 ? i[0] : "Folder upload";
|
|
2480
2821
|
return {
|
|
2481
|
-
id: i.length === 1 ?
|
|
2822
|
+
id: i.length === 1 ? Pt(e, o) : `${a(e)}#folder-upload`,
|
|
2482
2823
|
name: o,
|
|
2483
2824
|
totalFiles: t.length,
|
|
2484
2825
|
createdFolders: n
|
|
2485
2826
|
};
|
|
2486
2827
|
}
|
|
2487
|
-
async function
|
|
2828
|
+
async function Rt(e, t) {
|
|
2488
2829
|
let n = [], r = t.map(a);
|
|
2489
2830
|
async function i(t, a) {
|
|
2490
2831
|
let o;
|
|
@@ -2493,7 +2834,7 @@ async function Tt(e, t) {
|
|
|
2493
2834
|
numeric: !0,
|
|
2494
2835
|
sensitivity: "base"
|
|
2495
2836
|
}));
|
|
2496
|
-
for (let e of c)
|
|
2837
|
+
for (let e of c) zt(e.path, r) || (n.push({
|
|
2497
2838
|
path: e.path,
|
|
2498
2839
|
name: e.name,
|
|
2499
2840
|
depth: a
|
|
@@ -2503,11 +2844,11 @@ async function Tt(e, t) {
|
|
|
2503
2844
|
}
|
|
2504
2845
|
return await i("/", 0), n;
|
|
2505
2846
|
}
|
|
2506
|
-
function
|
|
2847
|
+
function zt(e, t) {
|
|
2507
2848
|
let n = a(e);
|
|
2508
2849
|
return t.some((e) => n === e || n.startsWith(`${e}/`));
|
|
2509
2850
|
}
|
|
2510
|
-
function
|
|
2851
|
+
function Bt(e, t, n) {
|
|
2511
2852
|
if (!t) return {
|
|
2512
2853
|
acceptedCandidates: e,
|
|
2513
2854
|
rejectedCandidates: []
|
|
@@ -2515,7 +2856,7 @@ function Dt(e, t, n) {
|
|
|
2515
2856
|
let r = [], i = [], a = 0;
|
|
2516
2857
|
for (let o of e) {
|
|
2517
2858
|
let e = [];
|
|
2518
|
-
t.maxFileSizeBytes !== void 0 && o.file.size > t.maxFileSizeBytes && e.push(`File is larger than ${
|
|
2859
|
+
t.maxFileSizeBytes !== void 0 && o.file.size > t.maxFileSizeBytes && e.push(`File is larger than ${vn(t.maxFileSizeBytes)}`), t.allowedMimeTypes?.length && !Vt(o.file, t.allowedMimeTypes) && e.push(`File type ${o.file.type || "unknown"} is not allowed`), t.remainingQuotaBytes !== void 0 && a + o.file.size > t.remainingQuotaBytes && e.push(`Upload exceeds remaining quota of ${vn(t.remainingQuotaBytes)}`);
|
|
2519
2860
|
let s = t.validate?.(o, {
|
|
2520
2861
|
acceptedBytes: a,
|
|
2521
2862
|
currentPath: n
|
|
@@ -2535,34 +2876,37 @@ function Dt(e, t, n) {
|
|
|
2535
2876
|
rejectedCandidates: i
|
|
2536
2877
|
};
|
|
2537
2878
|
}
|
|
2538
|
-
function
|
|
2879
|
+
function Vt(e, t) {
|
|
2539
2880
|
return t.some((t) => t.endsWith("/*") ? e.type.startsWith(t.slice(0, -1)) : t.startsWith(".") ? e.name.toLowerCase().endsWith(t.toLowerCase()) : e.type === t);
|
|
2540
2881
|
}
|
|
2541
|
-
function
|
|
2542
|
-
let [
|
|
2543
|
-
function
|
|
2882
|
+
function Ht({ browser: e, canMove: t, folderDropTargetPath: n, inlineRenameError: r, inlineRenameLabel: i, inlineRenameItem: a, inlineRenameValue: o, selectedPaths: s, onContextMenu: c, onDragEnd: l, onDragStart: u, onEmptyClick: d, onFolderDragOver: f, onFolderDrop: p, onInlineRenameCancel: m, onInlineRenameChange: h, onInlineRenameCommit: g, onOpenItem: _, onSelectItem: v, onTouchMenu: y, narrow: x, selectionMode: C, onToggleItem: te, renderItemMeta: ne, rootLabel: re }) {
|
|
2883
|
+
let [ie, E] = b(null);
|
|
2884
|
+
function ae(t) {
|
|
2544
2885
|
let n = t.inputEvent, r = t.selected.map((e) => e.getAttribute("data-fb-path")).filter((e) => !!e);
|
|
2545
2886
|
e.setSelection(r, { additive: !!(n?.shiftKey || n?.metaKey || n?.ctrlKey) });
|
|
2546
2887
|
}
|
|
2547
|
-
return /* @__PURE__ */
|
|
2888
|
+
return /* @__PURE__ */ T(ee, { children: [ie && !x ? /* @__PURE__ */ w(S, {
|
|
2548
2889
|
className: "[background:var(--fb-accent-soft)!important] [border-color:var(--fb-accent)!important]",
|
|
2549
|
-
container:
|
|
2550
|
-
dragContainer:
|
|
2890
|
+
container: ie,
|
|
2891
|
+
dragContainer: ie,
|
|
2551
2892
|
hitRate: 10,
|
|
2552
|
-
onSelect:
|
|
2893
|
+
onSelect: ae,
|
|
2894
|
+
onDragStart: (e) => {
|
|
2895
|
+
e.inputEvent?.type?.startsWith("touch") && e.stop();
|
|
2896
|
+
},
|
|
2553
2897
|
preventClickEventOnDrag: !0,
|
|
2554
2898
|
selectByClick: !1,
|
|
2555
|
-
selectableTargets: [() => Array.from(
|
|
2899
|
+
selectableTargets: [() => Array.from(ie.querySelectorAll("[data-fb-selectable='true']"))],
|
|
2556
2900
|
selectFromInside: !1
|
|
2557
|
-
}) : null, /* @__PURE__ */
|
|
2558
|
-
"aria-label":
|
|
2559
|
-
className: "relative grid min-h-full content-start grid-cols-[repeat(
|
|
2901
|
+
}) : null, /* @__PURE__ */ w("div", {
|
|
2902
|
+
"aria-label": re,
|
|
2903
|
+
className: "relative grid min-h-full min-w-0 touch-pan-y content-start grid-cols-[repeat(2,minmax(0,1fr))] gap-[var(--fb-grid-gap)] @min-[40rem]/fb:grid-cols-[repeat(auto-fill,minmax(min(100%,var(--fb-card-min)),1fr))]",
|
|
2560
2904
|
onClick: (e) => {
|
|
2561
|
-
e.target === e.currentTarget && !
|
|
2905
|
+
!C && e.target === e.currentTarget && !ln(e) && d();
|
|
2562
2906
|
},
|
|
2563
|
-
ref:
|
|
2907
|
+
ref: E,
|
|
2564
2908
|
role: "grid",
|
|
2565
|
-
children: e.filteredItems.map((e) => /* @__PURE__ */
|
|
2909
|
+
children: e.filteredItems.map((e) => /* @__PURE__ */ w(Ut, {
|
|
2566
2910
|
canMove: t,
|
|
2567
2911
|
dropTarget: n === e.path,
|
|
2568
2912
|
item: e,
|
|
@@ -2581,28 +2925,23 @@ function kt({ browser: e, canMove: t, folderDropTargetPath: n, inlineRenameError
|
|
|
2581
2925
|
onInlineRenameCommit: g,
|
|
2582
2926
|
onSelect: (t) => v(e.path, t),
|
|
2583
2927
|
onTouchMenu: () => y(e),
|
|
2584
|
-
|
|
2928
|
+
narrow: x,
|
|
2929
|
+
selectionMode: C,
|
|
2930
|
+
onToggle: () => te(e.path),
|
|
2931
|
+
renderItemMeta: ne,
|
|
2585
2932
|
selected: s.includes(e.path)
|
|
2586
2933
|
}, e.path))
|
|
2587
2934
|
})] });
|
|
2588
2935
|
}
|
|
2589
|
-
function
|
|
2590
|
-
let
|
|
2591
|
-
|
|
2592
|
-
x.current &&= (clearTimeout(x.current), null);
|
|
2593
|
-
}
|
|
2594
|
-
function C() {
|
|
2595
|
-
S(), x.current = setTimeout(() => {
|
|
2596
|
-
x.current = null, v();
|
|
2597
|
-
}, 520);
|
|
2598
|
-
}
|
|
2599
|
-
return /* @__PURE__ */ E("article", {
|
|
2936
|
+
function Ut({ canMove: e, dropTarget: t, inlineRenameError: n, inlineRenameLabel: r, inlineRenameValue: i, isRenaming: a, item: o, selected: s, onSelect: c, onOpen: l, onContextMenu: u, onDragEnd: d, onDragStart: f, onFolderDragOver: p, onFolderDrop: m, onInlineRenameCancel: h, onInlineRenameChange: g, onInlineRenameCommit: _, onTouchMenu: v, narrow: y, selectionMode: b, onToggle: x, renderItemMeta: S }) {
|
|
2937
|
+
let C = et(v);
|
|
2938
|
+
return /* @__PURE__ */ T("article", {
|
|
2600
2939
|
"aria-selected": s,
|
|
2601
2940
|
"data-fb-drop-target": t ? "true" : void 0,
|
|
2602
2941
|
"data-fb-path": o.path,
|
|
2603
2942
|
"data-fb-selectable": "true",
|
|
2604
|
-
draggable: e,
|
|
2605
|
-
className: `group relative flex min-h-[var(--fb-card-minh)] cursor-default flex-col rounded-[calc(var(--fb-radius)-1px)] border p-[var(--fb-card-pad)] outline-none hover:shadow-[0_8px_22px_color-mix(in_oklch,var(--fb-text)_8%,transparent)] focus:ring-2 focus:ring-[var(--fb-accent-soft)] ${
|
|
2943
|
+
draggable: e && !y,
|
|
2944
|
+
className: `group relative flex min-h-[var(--fb-card-minh)] min-w-0 cursor-default flex-col rounded-[calc(var(--fb-radius)-1px)] border p-[var(--fb-card-pad)] outline-none hover:shadow-[0_8px_22px_color-mix(in_oklch,var(--fb-text)_8%,transparent)] focus:ring-2 focus:ring-[var(--fb-accent-soft)] ${X} ${t ? "border-[var(--fb-accent)] bg-[var(--fb-accent-soft)] ring-2 ring-[var(--fb-accent)] ring-offset-2 ring-offset-[var(--fb-surface)]" : s ? "border-[var(--fb-accent)] bg-[var(--fb-accent-soft)]" : "border-[var(--fb-border)] bg-[var(--fb-surface)] hover:border-[var(--fb-border-strong)]"}`,
|
|
2606
2945
|
onClick: c,
|
|
2607
2946
|
onContextMenu: u,
|
|
2608
2947
|
onDoubleClick: l,
|
|
@@ -2610,29 +2949,39 @@ function At({ canMove: e, dropTarget: t, inlineRenameError: n, inlineRenameLabel
|
|
|
2610
2949
|
onDragOver: o.kind === "folder" ? p : void 0,
|
|
2611
2950
|
onDragStart: e ? f : void 0,
|
|
2612
2951
|
onDrop: o.kind === "folder" ? m : void 0,
|
|
2613
|
-
|
|
2614
|
-
onTouchEnd: S,
|
|
2615
|
-
onTouchMove: S,
|
|
2616
|
-
onTouchStart: C,
|
|
2952
|
+
...C,
|
|
2617
2953
|
role: "gridcell",
|
|
2618
2954
|
tabIndex: 0,
|
|
2619
2955
|
children: [
|
|
2620
|
-
/* @__PURE__ */
|
|
2956
|
+
b ? /* @__PURE__ */ w("button", {
|
|
2957
|
+
"aria-label": `Select ${o.name}`,
|
|
2958
|
+
"aria-pressed": s,
|
|
2959
|
+
className: "absolute right-0 top-0 z-10 grid size-[calc(var(--fb-gap)*11)] place-items-center text-[var(--fb-accent)]",
|
|
2960
|
+
"data-fb-touch-control": !0,
|
|
2961
|
+
onClick: (e) => {
|
|
2962
|
+
e.stopPropagation(), x();
|
|
2963
|
+
},
|
|
2964
|
+
type: "button",
|
|
2965
|
+
children: w(s ? R : z, {
|
|
2966
|
+
"aria-hidden": "true",
|
|
2967
|
+
className: "size-5"
|
|
2968
|
+
})
|
|
2969
|
+
}) : /* @__PURE__ */ w("span", {
|
|
2621
2970
|
"aria-hidden": "true",
|
|
2622
|
-
className: `absolute right-2 top-2 grid size-4 place-items-center rounded border text-[10px] ${
|
|
2971
|
+
className: `absolute right-2 top-2 grid size-4 place-items-center rounded border text-[10px] ${Y} ${s ? "border-[var(--fb-accent)] bg-[var(--fb-accent)] text-[var(--fb-surface)]" : "border-[var(--fb-border)] bg-[var(--fb-surface)] opacity-0 group-hover:opacity-100"}`,
|
|
2623
2972
|
children: s ? "✓" : ""
|
|
2624
2973
|
}),
|
|
2625
|
-
/* @__PURE__ */
|
|
2626
|
-
className: `grid h-[var(--fb-thumb-h)] place-items-center rounded-[calc(var(--fb-radius)-3px)] bg-[var(--fb-surface-2)] group-hover:bg-[var(--fb-bg)] ${
|
|
2627
|
-
children: o.kind === "folder" ? /* @__PURE__ */
|
|
2974
|
+
/* @__PURE__ */ w("div", {
|
|
2975
|
+
className: `grid h-[var(--fb-thumb-h)] place-items-center rounded-[calc(var(--fb-radius)-3px)] bg-[var(--fb-surface-2)] group-hover:bg-[var(--fb-bg)] ${Y}`,
|
|
2976
|
+
children: o.kind === "folder" ? /* @__PURE__ */ w(_e, {
|
|
2628
2977
|
"aria-hidden": "true",
|
|
2629
2978
|
className: "size-9 text-[var(--fb-folder)]"
|
|
2630
|
-
}) : /* @__PURE__ */
|
|
2979
|
+
}) : /* @__PURE__ */ w(he, {
|
|
2631
2980
|
"aria-hidden": "true",
|
|
2632
2981
|
className: "size-9 text-[var(--fb-muted)]"
|
|
2633
2982
|
})
|
|
2634
2983
|
}),
|
|
2635
|
-
a ? /* @__PURE__ */
|
|
2984
|
+
a ? /* @__PURE__ */ w(Gt, {
|
|
2636
2985
|
item: o,
|
|
2637
2986
|
error: n,
|
|
2638
2987
|
label: r,
|
|
@@ -2640,42 +2989,42 @@ function At({ canMove: e, dropTarget: t, inlineRenameError: n, inlineRenameLabel
|
|
|
2640
2989
|
onChange: g,
|
|
2641
2990
|
onCommit: _,
|
|
2642
2991
|
value: i
|
|
2643
|
-
}) : /* @__PURE__ */
|
|
2644
|
-
className: `mt-2 min-w-0 truncate text-left text-[12.5px] font-semibold text-[var(--fb-text)] outline-none ${
|
|
2992
|
+
}) : /* @__PURE__ */ w("button", {
|
|
2993
|
+
className: `mt-2 min-w-0 truncate text-left text-[12.5px] font-semibold text-[var(--fb-text)] outline-none [@media(pointer:coarse)]:min-h-[calc(var(--fb-gap)*11)] ${y ? "min-h-[calc(var(--fb-gap)*11)]" : ""} ${Y}`,
|
|
2645
2994
|
onClick: (e) => {
|
|
2646
2995
|
e.stopPropagation(), c(e);
|
|
2647
2996
|
},
|
|
2648
2997
|
type: "button",
|
|
2649
2998
|
children: o.name
|
|
2650
2999
|
}),
|
|
2651
|
-
/* @__PURE__ */
|
|
3000
|
+
/* @__PURE__ */ w("div", {
|
|
2652
3001
|
className: "mt-1 text-[11px] text-[var(--fb-muted)]",
|
|
2653
|
-
children: o.kind === "folder" ? "Folder" :
|
|
3002
|
+
children: o.kind === "folder" ? "Folder" : vn(o.size ?? 0)
|
|
2654
3003
|
}),
|
|
2655
|
-
/* @__PURE__ */
|
|
3004
|
+
/* @__PURE__ */ w(Wt, {
|
|
2656
3005
|
item: o,
|
|
2657
|
-
renderItemMeta:
|
|
3006
|
+
renderItemMeta: S,
|
|
2658
3007
|
view: "grid"
|
|
2659
3008
|
})
|
|
2660
3009
|
]
|
|
2661
3010
|
});
|
|
2662
3011
|
}
|
|
2663
|
-
function
|
|
3012
|
+
function Wt({ item: e, renderItemMeta: t, view: n }) {
|
|
2664
3013
|
if (!t) return null;
|
|
2665
3014
|
let r = t(e, { view: n });
|
|
2666
|
-
return r == null || r === !1 ? null : /* @__PURE__ */
|
|
2667
|
-
className: "mt-1 min-w-0 text-[11px]",
|
|
3015
|
+
return r == null || r === !1 ? null : /* @__PURE__ */ w("div", {
|
|
3016
|
+
className: "mt-1 min-w-0 max-w-full text-[11px] [overflow-wrap:anywhere] [&_*]:max-w-full",
|
|
2668
3017
|
"data-fb-item-meta": n,
|
|
2669
3018
|
children: r
|
|
2670
3019
|
});
|
|
2671
3020
|
}
|
|
2672
|
-
function
|
|
2673
|
-
return /* @__PURE__ */
|
|
3021
|
+
function Gt({ error: e, item: t, label: n, onCancel: r, onChange: i, onCommit: a, value: o }) {
|
|
3022
|
+
return /* @__PURE__ */ T("div", {
|
|
2674
3023
|
className: "min-w-0",
|
|
2675
|
-
children: [/* @__PURE__ */
|
|
3024
|
+
children: [/* @__PURE__ */ w("input", {
|
|
2676
3025
|
"aria-label": `Rename ${n || t.name}`,
|
|
2677
3026
|
autoFocus: !0,
|
|
2678
|
-
className: `mt-2 min-w-0 rounded-[calc(var(--fb-radius)-4px)] border border-[var(--fb-accent)] bg-[var(--fb-surface)] px-1.5 py-1 text-[12.5px] font-semibold text-[var(--fb-text)] outline-none ring-2 ring-[var(--fb-accent-soft)] ${
|
|
3027
|
+
className: `mt-2 w-full min-w-0 rounded-[calc(var(--fb-radius)-4px)] border border-[var(--fb-accent)] bg-[var(--fb-surface)] px-1.5 py-1 text-[12.5px] font-semibold text-[var(--fb-text)] outline-none ring-2 ring-[var(--fb-accent-soft)] [@media(pointer:coarse)]:min-h-[calc(var(--fb-gap)*11)] [@media(pointer:coarse)]:text-[16px] ${Y}`,
|
|
2679
3028
|
onBlur: a,
|
|
2680
3029
|
onChange: (e) => i(e.target.value),
|
|
2681
3030
|
onClick: (e) => e.stopPropagation(),
|
|
@@ -2684,39 +3033,40 @@ function Mt({ error: e, item: t, label: n, onCancel: r, onChange: i, onCommit: a
|
|
|
2684
3033
|
e.key === "Enter" && (e.preventDefault(), a()), e.key === "Escape" && (e.preventDefault(), r());
|
|
2685
3034
|
},
|
|
2686
3035
|
value: o
|
|
2687
|
-
}), e ? /* @__PURE__ */
|
|
2688
|
-
className: `mt-1 rounded-[calc(var(--fb-radius)-5px)] border border-[var(--fb-danger)] bg-[var(--fb-danger-soft)] px-1.5 py-1 text-[11px] text-[var(--fb-danger)] ${
|
|
3036
|
+
}), e ? /* @__PURE__ */ w("div", {
|
|
3037
|
+
className: `mt-1 rounded-[calc(var(--fb-radius)-5px)] border border-[var(--fb-danger)] bg-[var(--fb-danger-soft)] px-1.5 py-1 text-[11px] text-[var(--fb-danger)] ${X}`,
|
|
2689
3038
|
role: "alert",
|
|
2690
3039
|
children: e
|
|
2691
3040
|
}) : null]
|
|
2692
3041
|
});
|
|
2693
3042
|
}
|
|
2694
|
-
function
|
|
2695
|
-
return /* @__PURE__ */
|
|
2696
|
-
"aria-label":
|
|
2697
|
-
className: `w-full border-separate border-spacing-0 overflow-hidden rounded-[var(--fb-radius)] border border-[var(--fb-border)] bg-[var(--fb-surface)] text-left ${
|
|
2698
|
-
children: [/* @__PURE__ */
|
|
3043
|
+
function Kt({ browser: e, canMove: t, folderDropTargetPath: n, inlineRenameError: r, inlineRenameLabel: i, inlineRenameItem: a, inlineRenameValue: o, selectedPaths: s, onContextMenu: c, onDragEnd: l, onDragStart: u, onFolderDragOver: d, onFolderDrop: f, onInlineRenameCancel: p, onInlineRenameChange: m, onInlineRenameCommit: h, onOpenItem: g, onSelectItem: _, onTouchMenu: v, narrow: y, selectionMode: b, onToggleItem: x, renderItemMeta: S, rootLabel: C }) {
|
|
3044
|
+
return /* @__PURE__ */ T("table", {
|
|
3045
|
+
"aria-label": C,
|
|
3046
|
+
className: `w-full table-fixed border-separate border-spacing-0 overflow-hidden rounded-[var(--fb-radius)] border border-[var(--fb-border)] bg-[var(--fb-surface)] text-left ${X}`,
|
|
3047
|
+
children: [/* @__PURE__ */ w("thead", {
|
|
2699
3048
|
className: "text-[11px] text-[var(--fb-muted)]",
|
|
2700
|
-
children: /* @__PURE__ */
|
|
2701
|
-
/* @__PURE__ */
|
|
3049
|
+
children: /* @__PURE__ */ T("tr", { children: [
|
|
3050
|
+
/* @__PURE__ */ w("th", {
|
|
2702
3051
|
className: "border-b border-[var(--fb-border)] px-[var(--fb-cell-x)] py-[var(--fb-cell-y)] font-medium",
|
|
2703
3052
|
children: "Name"
|
|
2704
3053
|
}),
|
|
2705
|
-
/* @__PURE__ */
|
|
2706
|
-
className: "border-b border-[var(--fb-border)] px-[var(--fb-cell-x)] py-[var(--fb-cell-y)] font-medium",
|
|
3054
|
+
y ? null : /* @__PURE__ */ w("th", {
|
|
3055
|
+
className: "w-[22%] border-b border-[var(--fb-border)] px-[var(--fb-cell-x)] py-[var(--fb-cell-y)] font-medium",
|
|
2707
3056
|
children: "Size"
|
|
2708
3057
|
}),
|
|
2709
|
-
/* @__PURE__ */
|
|
2710
|
-
className: "border-b border-[var(--fb-border)] px-[var(--fb-cell-x)] py-[var(--fb-cell-y)] font-medium",
|
|
3058
|
+
y ? null : /* @__PURE__ */ w("th", {
|
|
3059
|
+
className: "w-[26%] border-b border-[var(--fb-border)] px-[var(--fb-cell-x)] py-[var(--fb-cell-y)] font-medium",
|
|
2711
3060
|
children: "Modified"
|
|
2712
3061
|
})
|
|
2713
3062
|
] })
|
|
2714
|
-
}), /* @__PURE__ */
|
|
3063
|
+
}), /* @__PURE__ */ w("tbody", { children: e.filteredItems.map((e) => /* @__PURE__ */ T(qt, {
|
|
2715
3064
|
"aria-selected": s.includes(e.path),
|
|
2716
3065
|
"data-fb-drop-target": n === e.path ? "true" : void 0,
|
|
2717
3066
|
"data-fb-path": e.path,
|
|
2718
|
-
className: n === e.path ? `bg-[var(--fb-accent-soft)] ring-2 ring-inset ring-[var(--fb-accent)] ${
|
|
2719
|
-
draggable: t,
|
|
3067
|
+
className: n === e.path ? `bg-[var(--fb-accent-soft)] ring-2 ring-inset ring-[var(--fb-accent)] ${Y}` : s.includes(e.path) ? `bg-[var(--fb-accent-soft)] outline-none focus:ring-2 focus:ring-[var(--fb-accent-soft)] ${Y}` : `outline-none hover:bg-[var(--fb-bg)] focus:ring-2 focus:ring-[var(--fb-accent-soft)] ${Y}`,
|
|
3068
|
+
draggable: t && !y,
|
|
3069
|
+
onLongPress: () => v(e),
|
|
2720
3070
|
onClick: (t) => _(e.path, t),
|
|
2721
3071
|
onContextMenu: (t) => c(e, t),
|
|
2722
3072
|
onDragEnd: l,
|
|
@@ -2726,40 +3076,67 @@ function Nt({ browser: e, canMove: t, folderDropTargetPath: n, inlineRenameError
|
|
|
2726
3076
|
onDoubleClick: () => g(e),
|
|
2727
3077
|
tabIndex: 0,
|
|
2728
3078
|
children: [
|
|
2729
|
-
/* @__PURE__ */
|
|
3079
|
+
/* @__PURE__ */ w("td", {
|
|
2730
3080
|
className: "border-b border-[var(--fb-border)] px-[var(--fb-cell-x)] py-[var(--fb-cell-y)]",
|
|
2731
|
-
children: /* @__PURE__ */
|
|
3081
|
+
children: /* @__PURE__ */ T("div", {
|
|
2732
3082
|
className: "flex min-w-0 items-start gap-2",
|
|
2733
|
-
children: [
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
onCancel: p,
|
|
2740
|
-
onChange: m,
|
|
2741
|
-
onCommit: h,
|
|
2742
|
-
value: o
|
|
2743
|
-
}) : /* @__PURE__ */ T("button", {
|
|
2744
|
-
className: `block max-w-full truncate font-medium ${X}`,
|
|
3083
|
+
children: [
|
|
3084
|
+
b ? /* @__PURE__ */ w("button", {
|
|
3085
|
+
"aria-label": `Select ${e.name}`,
|
|
3086
|
+
"aria-pressed": s.includes(e.path),
|
|
3087
|
+
className: "grid size-[calc(var(--fb-gap)*11)] shrink-0 place-items-center text-[var(--fb-accent)]",
|
|
3088
|
+
"data-fb-touch-control": !0,
|
|
2745
3089
|
onClick: (t) => {
|
|
2746
|
-
t.stopPropagation(),
|
|
3090
|
+
t.stopPropagation(), x(e.path);
|
|
2747
3091
|
},
|
|
2748
3092
|
type: "button",
|
|
2749
|
-
children: e.
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
3093
|
+
children: s.includes(e.path) ? /* @__PURE__ */ w(R, {
|
|
3094
|
+
"aria-hidden": "true",
|
|
3095
|
+
className: "size-5"
|
|
3096
|
+
}) : /* @__PURE__ */ w(z, {
|
|
3097
|
+
"aria-hidden": "true",
|
|
3098
|
+
className: "size-5"
|
|
3099
|
+
})
|
|
3100
|
+
}) : null,
|
|
3101
|
+
e.kind === "folder" ? /* @__PURE__ */ w(_e, { className: "mt-0.5 size-4 shrink-0 text-[var(--fb-folder)]" }) : /* @__PURE__ */ w(he, { className: "mt-0.5 size-4 shrink-0 text-[var(--fb-muted)]" }),
|
|
3102
|
+
/* @__PURE__ */ T("div", {
|
|
3103
|
+
className: "min-w-0 flex-1",
|
|
3104
|
+
children: [
|
|
3105
|
+
a?.path === e.path ? /* @__PURE__ */ w(Gt, {
|
|
3106
|
+
item: e,
|
|
3107
|
+
error: r,
|
|
3108
|
+
label: i,
|
|
3109
|
+
onCancel: p,
|
|
3110
|
+
onChange: m,
|
|
3111
|
+
onCommit: h,
|
|
3112
|
+
value: o
|
|
3113
|
+
}) : /* @__PURE__ */ w("button", {
|
|
3114
|
+
className: `block max-w-full truncate text-left font-medium [@media(pointer:coarse)]:min-h-[calc(var(--fb-gap)*11)] ${y ? "min-h-[calc(var(--fb-gap)*11)]" : ""} ${Y}`,
|
|
3115
|
+
onClick: (t) => {
|
|
3116
|
+
t.stopPropagation(), _(e.path, t);
|
|
3117
|
+
},
|
|
3118
|
+
type: "button",
|
|
3119
|
+
children: e.name
|
|
3120
|
+
}),
|
|
3121
|
+
/* @__PURE__ */ w(Wt, {
|
|
3122
|
+
item: e,
|
|
3123
|
+
renderItemMeta: S,
|
|
3124
|
+
view: "list"
|
|
3125
|
+
}),
|
|
3126
|
+
y ? /* @__PURE__ */ T("div", {
|
|
3127
|
+
className: "mt-[var(--fb-gap)] flex flex-wrap gap-x-[calc(var(--fb-gap)*3)] text-[11px] text-[var(--fb-muted)]",
|
|
3128
|
+
children: [/* @__PURE__ */ w("span", { children: e.kind === "folder" ? "Folder" : vn(e.size ?? 0) }), e.modifiedAt ? /* @__PURE__ */ w("span", { children: new Date(e.modifiedAt).toLocaleDateString() }) : null]
|
|
3129
|
+
}) : null
|
|
3130
|
+
]
|
|
3131
|
+
})
|
|
3132
|
+
]
|
|
2756
3133
|
})
|
|
2757
3134
|
}),
|
|
2758
|
-
/* @__PURE__ */
|
|
3135
|
+
y ? null : /* @__PURE__ */ w("td", {
|
|
2759
3136
|
className: "border-b border-[var(--fb-border)] px-[var(--fb-cell-x)] py-[var(--fb-cell-y)] text-[12px] text-[var(--fb-muted)]",
|
|
2760
|
-
children: e.kind === "folder" ? "Folder" :
|
|
3137
|
+
children: e.kind === "folder" ? "Folder" : vn(e.size ?? 0)
|
|
2761
3138
|
}),
|
|
2762
|
-
/* @__PURE__ */
|
|
3139
|
+
y ? null : /* @__PURE__ */ w("td", {
|
|
2763
3140
|
className: "border-b border-[var(--fb-border)] px-[var(--fb-cell-x)] py-[var(--fb-cell-y)] text-[12px] text-[var(--fb-muted)]",
|
|
2764
3141
|
children: e.modifiedAt ? new Date(e.modifiedAt).toLocaleDateString() : "—"
|
|
2765
3142
|
})
|
|
@@ -2767,169 +3144,212 @@ function Nt({ browser: e, canMove: t, folderDropTargetPath: n, inlineRenameError
|
|
|
2767
3144
|
}, e.path)) })]
|
|
2768
3145
|
});
|
|
2769
3146
|
}
|
|
2770
|
-
function
|
|
2771
|
-
let
|
|
2772
|
-
|
|
3147
|
+
function qt({ onLongPress: e, ...t }) {
|
|
3148
|
+
let n = et(e);
|
|
3149
|
+
return /* @__PURE__ */ w("tr", {
|
|
3150
|
+
...t,
|
|
3151
|
+
...n
|
|
3152
|
+
});
|
|
3153
|
+
}
|
|
3154
|
+
function Jt({ browser: e, canDownload: t, menu: n, onClose: r, onDelete: i, onDownload: a, onCopy: o, onCopyPath: s, onCut: c, onMove: l, onNewFolder: u, onPaste: d, onRename: f, onUpload: p, readOnly: m }) {
|
|
3155
|
+
let h = n.target === "item", g = n.mode === "sheet", v = y(null), [x, S] = b({
|
|
3156
|
+
left: n.x,
|
|
3157
|
+
top: n.y
|
|
3158
|
+
});
|
|
3159
|
+
_(() => {
|
|
3160
|
+
if (g) return;
|
|
3161
|
+
let e = v.current, t = document.activeElement, r = () => {
|
|
3162
|
+
let t = e ? (Number.parseFloat(getComputedStyle(e).paddingLeft) || 0) * 2 : 0, r = e?.getBoundingClientRect();
|
|
3163
|
+
S({
|
|
3164
|
+
left: Math.max(t, Math.min(n.x, document.documentElement.clientWidth - (r?.width ?? 0) - t)),
|
|
3165
|
+
top: Math.max(t, Math.min(n.y, window.innerHeight - (r?.height ?? 0) - t))
|
|
3166
|
+
});
|
|
3167
|
+
};
|
|
3168
|
+
return r(), e?.querySelector("button")?.focus(), window.addEventListener("resize", r), () => {
|
|
3169
|
+
window.removeEventListener("resize", r), t instanceof HTMLElement && t.isConnected && t.focus({ preventScroll: !0 });
|
|
3170
|
+
};
|
|
3171
|
+
}, [
|
|
3172
|
+
n.x,
|
|
3173
|
+
n.y,
|
|
3174
|
+
g
|
|
3175
|
+
]);
|
|
3176
|
+
function C(e) {
|
|
2773
3177
|
e(), r();
|
|
2774
3178
|
}
|
|
2775
|
-
|
|
3179
|
+
let te = /* @__PURE__ */ T("div", {
|
|
2776
3180
|
"aria-label": h ? "Item actions" : "Folder actions",
|
|
2777
|
-
className: `
|
|
3181
|
+
className: `rounded-[calc(var(--fb-radius)-2px)] bg-[var(--fb-surface)] p-1 text-[12px] text-[var(--fb-text)] ${X} ${g ? "w-full" : "fixed z-[60] max-h-[calc(100dvh-var(--fb-gap)*4)] min-w-40 max-w-[calc(100%-var(--fb-gap)*4)] overflow-y-auto border border-[var(--fb-border)] shadow-[0_16px_44px_color-mix(in_oklch,var(--fb-text)_16%,transparent)]"}`,
|
|
2778
3182
|
"data-fb-menu": g ? "sheet" : "context",
|
|
2779
3183
|
role: "menu",
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
3184
|
+
ref: v,
|
|
3185
|
+
style: g ? void 0 : x,
|
|
3186
|
+
onKeyDown: (e) => {
|
|
3187
|
+
if (e.key === "Escape" || e.key === "Tab" && !g) {
|
|
3188
|
+
e.stopPropagation(), r();
|
|
3189
|
+
return;
|
|
3190
|
+
}
|
|
3191
|
+
if (![
|
|
3192
|
+
"ArrowDown",
|
|
3193
|
+
"ArrowUp",
|
|
3194
|
+
"Home",
|
|
3195
|
+
"End"
|
|
3196
|
+
].includes(e.key)) return;
|
|
3197
|
+
e.preventDefault(), e.stopPropagation();
|
|
3198
|
+
let t = Array.from(e.currentTarget.querySelectorAll("button")), n = t.indexOf(document.activeElement);
|
|
3199
|
+
t[e.key === "Home" ? 0 : e.key === "End" ? t.length - 1 : (n + (e.key === "ArrowDown" ? 1 : -1) + t.length) % t.length]?.focus();
|
|
2783
3200
|
},
|
|
2784
3201
|
children: [
|
|
2785
|
-
h && !m && e.capabilities.rename ? /* @__PURE__ */
|
|
2786
|
-
onClick: () =>
|
|
3202
|
+
h && !m && e.capabilities.rename ? /* @__PURE__ */ w(Z, {
|
|
3203
|
+
onClick: () => C(() => f(n.item)),
|
|
2787
3204
|
children: "Rename"
|
|
2788
3205
|
}) : null,
|
|
2789
|
-
h && !m && e.capabilities.move ? /* @__PURE__ */
|
|
2790
|
-
onClick: () =>
|
|
3206
|
+
h && !m && e.capabilities.move ? /* @__PURE__ */ w(Z, {
|
|
3207
|
+
onClick: () => C(l),
|
|
2791
3208
|
children: "Move"
|
|
2792
3209
|
}) : null,
|
|
2793
|
-
h && !m && e.capabilities.copy ? /* @__PURE__ */
|
|
2794
|
-
onClick: () =>
|
|
3210
|
+
h && !m && e.capabilities.copy ? /* @__PURE__ */ w(Z, {
|
|
3211
|
+
onClick: () => C(o),
|
|
2795
3212
|
children: "Copy"
|
|
2796
3213
|
}) : null,
|
|
2797
|
-
h && !m && e.capabilities.move ? /* @__PURE__ */
|
|
2798
|
-
onClick: () =>
|
|
3214
|
+
h && !m && e.capabilities.move ? /* @__PURE__ */ w(Z, {
|
|
3215
|
+
onClick: () => C(c),
|
|
2799
3216
|
children: "Cut"
|
|
2800
3217
|
}) : null,
|
|
2801
|
-
h ? /* @__PURE__ */
|
|
2802
|
-
/* @__PURE__ */
|
|
2803
|
-
onClick: () =>
|
|
3218
|
+
h ? /* @__PURE__ */ T(ee, { children: [
|
|
3219
|
+
/* @__PURE__ */ w(Z, {
|
|
3220
|
+
onClick: () => C(() => s(n.item)),
|
|
2804
3221
|
children: e.selectedPaths.includes(n.item.path) && e.selectedPaths.length > 1 ? "Copy paths" : "Copy path"
|
|
2805
3222
|
}),
|
|
2806
|
-
t ? /* @__PURE__ */
|
|
2807
|
-
onClick: () =>
|
|
3223
|
+
t ? /* @__PURE__ */ w(Z, {
|
|
3224
|
+
onClick: () => C(a),
|
|
2808
3225
|
children: "Download"
|
|
2809
3226
|
}) : null,
|
|
2810
|
-
m ? null : /* @__PURE__ */
|
|
3227
|
+
m ? null : /* @__PURE__ */ w(Z, {
|
|
2811
3228
|
danger: !0,
|
|
2812
3229
|
onClick: () => {
|
|
2813
3230
|
i(), r();
|
|
2814
3231
|
},
|
|
2815
3232
|
children: "Delete"
|
|
2816
3233
|
})
|
|
2817
|
-
] }) : /* @__PURE__ */
|
|
2818
|
-
onClick: () =>
|
|
3234
|
+
] }) : /* @__PURE__ */ T(ee, { children: [m ? null : /* @__PURE__ */ T(ee, { children: [e.capabilities.createFolder ? /* @__PURE__ */ w(Z, {
|
|
3235
|
+
onClick: () => C(u),
|
|
2819
3236
|
children: "New folder"
|
|
2820
|
-
}) : null, /* @__PURE__ */
|
|
2821
|
-
onClick: () =>
|
|
3237
|
+
}) : null, /* @__PURE__ */ w(Z, {
|
|
3238
|
+
onClick: () => C(p),
|
|
2822
3239
|
children: "Upload"
|
|
2823
|
-
})] }), !m && e.clipboard ? /* @__PURE__ */
|
|
2824
|
-
onClick: () =>
|
|
3240
|
+
})] }), !m && e.clipboard ? /* @__PURE__ */ w(Z, {
|
|
3241
|
+
onClick: () => C(d),
|
|
2825
3242
|
children: "Paste here"
|
|
2826
3243
|
}) : null] })
|
|
2827
3244
|
]
|
|
2828
3245
|
});
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
|
|
3246
|
+
return g ? /* @__PURE__ */ w(rt, {
|
|
3247
|
+
label: h ? "Item actions" : "Folder actions",
|
|
3248
|
+
onClose: r,
|
|
3249
|
+
children: te
|
|
3250
|
+
}) : te;
|
|
3251
|
+
}
|
|
3252
|
+
function Z({ children: e, danger: t, onClick: n }) {
|
|
3253
|
+
return /* @__PURE__ */ w("button", {
|
|
3254
|
+
className: `flex min-h-[var(--fb-control-h)] w-full items-center rounded-[calc(var(--fb-radius)-4px)] px-2 text-left font-medium outline-none hover:bg-[var(--fb-bg)] focus:bg-[var(--fb-bg)] ${At} ${Y} ${t ? "text-[var(--fb-danger)]" : ""}`,
|
|
2833
3255
|
onClick: n,
|
|
2834
3256
|
role: "menuitem",
|
|
2835
3257
|
type: "button",
|
|
2836
3258
|
children: e
|
|
2837
3259
|
});
|
|
2838
3260
|
}
|
|
2839
|
-
function
|
|
2840
|
-
let
|
|
2841
|
-
return /* @__PURE__ */
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
className: `w-[min(420px,100%)] rounded-[var(--fb-radius)] border border-[var(--fb-border)] bg-[var(--fb-surface)] p-4 shadow-[0_18px_50px_color-mix(in_oklch,var(--fb-text)_18%,transparent)] ${Z}`,
|
|
3261
|
+
function Yt({ applyToAll: e, narrow: t, currentPath: n, onApplyToAllChange: r, onCancel: i, onResolve: a, queue: o, resolutions: s }) {
|
|
3262
|
+
let c = o.candidates[o.index], l = Pt(n, c.relativePath), u = o.conflictPaths.indexOf(l) + 1;
|
|
3263
|
+
return /* @__PURE__ */ w(nt, {
|
|
3264
|
+
label: "File conflict",
|
|
3265
|
+
narrow: t,
|
|
3266
|
+
onClose: i,
|
|
3267
|
+
children: /* @__PURE__ */ T("div", {
|
|
3268
|
+
className: `w-[min(420px,100%)] rounded-[var(--fb-radius)] border border-[var(--fb-border)] bg-[var(--fb-surface)] p-4 shadow-[0_18px_50px_color-mix(in_oklch,var(--fb-text)_18%,transparent)] ${X}`,
|
|
2848
3269
|
children: [
|
|
2849
|
-
/* @__PURE__ */
|
|
3270
|
+
/* @__PURE__ */ w("h2", {
|
|
2850
3271
|
className: "m-0 text-[14px] font-semibold",
|
|
2851
3272
|
children: "File conflict"
|
|
2852
3273
|
}),
|
|
2853
|
-
/* @__PURE__ */
|
|
3274
|
+
/* @__PURE__ */ T("p", {
|
|
2854
3275
|
className: "mt-2 text-[12px] text-[var(--fb-muted)]",
|
|
2855
|
-
children: [
|
|
3276
|
+
children: [c.relativePath, " already exists in this folder."]
|
|
2856
3277
|
}),
|
|
2857
|
-
/* @__PURE__ */
|
|
2858
|
-
className: `mt-3 rounded-[calc(var(--fb-radius)-3px)] border border-[var(--fb-border)] bg-[var(--fb-bg)] p-2 text-[12px] ${
|
|
3278
|
+
/* @__PURE__ */ T("div", {
|
|
3279
|
+
className: `mt-3 rounded-[calc(var(--fb-radius)-3px)] border border-[var(--fb-border)] bg-[var(--fb-bg)] p-2 text-[12px] ${X}`,
|
|
2859
3280
|
children: [
|
|
2860
3281
|
"Conflict ",
|
|
2861
|
-
|
|
3282
|
+
u,
|
|
2862
3283
|
" of ",
|
|
2863
|
-
|
|
3284
|
+
o.conflictPaths.length
|
|
2864
3285
|
]
|
|
2865
3286
|
}),
|
|
2866
|
-
/* @__PURE__ */
|
|
2867
|
-
className: "mt-3 flex items-center gap-2 text-[12px] font-medium text-[var(--fb-muted)]",
|
|
2868
|
-
children: [/* @__PURE__ */
|
|
3287
|
+
/* @__PURE__ */ T("label", {
|
|
3288
|
+
className: "mt-3 flex min-h-[calc(var(--fb-gap)*11)] items-center gap-2 text-[12px] font-medium text-[var(--fb-muted)]",
|
|
3289
|
+
children: [/* @__PURE__ */ w("input", {
|
|
2869
3290
|
checked: e,
|
|
2870
|
-
onChange: (e) =>
|
|
3291
|
+
onChange: (e) => r(e.target.checked),
|
|
2871
3292
|
type: "checkbox"
|
|
2872
3293
|
}), "Apply to all conflicts"]
|
|
2873
3294
|
}),
|
|
2874
|
-
/* @__PURE__ */
|
|
2875
|
-
className:
|
|
2876
|
-
children: [/* @__PURE__ */
|
|
3295
|
+
/* @__PURE__ */ T("div", {
|
|
3296
|
+
className: `mt-4 flex flex-wrap justify-end gap-2 ${t ? "flex-col [&>button]:w-full [&>button]:justify-center" : ""}`,
|
|
3297
|
+
children: [/* @__PURE__ */ w("button", {
|
|
2877
3298
|
className: $(!1),
|
|
2878
|
-
onClick:
|
|
3299
|
+
onClick: i,
|
|
2879
3300
|
type: "button",
|
|
2880
3301
|
children: "Cancel"
|
|
2881
|
-
}),
|
|
2882
|
-
className: e === "keep-both" ?
|
|
2883
|
-
onClick: () =>
|
|
3302
|
+
}), s.map((e) => /* @__PURE__ */ w("button", {
|
|
3303
|
+
className: e === "keep-both" ? wn() : $(!1),
|
|
3304
|
+
onClick: () => a(e),
|
|
2884
3305
|
type: "button",
|
|
2885
|
-
children:
|
|
3306
|
+
children: xn(e)
|
|
2886
3307
|
}, e))]
|
|
2887
3308
|
})
|
|
2888
3309
|
]
|
|
2889
3310
|
})
|
|
2890
3311
|
});
|
|
2891
3312
|
}
|
|
2892
|
-
function
|
|
2893
|
-
let
|
|
2894
|
-
return /* @__PURE__ */
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
|
|
2900
|
-
className: `w-[min(440px,100%)] rounded-[var(--fb-radius)] border border-[var(--fb-border)] bg-[var(--fb-surface)] p-4 shadow-[0_18px_50px_color-mix(in_oklch,var(--fb-text)_18%,transparent)] ${Z}`,
|
|
3313
|
+
function Xt({ error: e, narrow: t, onClose: n }) {
|
|
3314
|
+
let r = e.succeededPaths.length;
|
|
3315
|
+
return /* @__PURE__ */ w(nt, {
|
|
3316
|
+
label: "Partial bulk failure",
|
|
3317
|
+
narrow: t,
|
|
3318
|
+
onClose: n,
|
|
3319
|
+
children: /* @__PURE__ */ T("div", {
|
|
3320
|
+
className: `w-[min(440px,100%)] rounded-[var(--fb-radius)] border border-[var(--fb-border)] bg-[var(--fb-surface)] p-4 shadow-[0_18px_50px_color-mix(in_oklch,var(--fb-text)_18%,transparent)] ${X}`,
|
|
2901
3321
|
children: [
|
|
2902
|
-
/* @__PURE__ */
|
|
3322
|
+
/* @__PURE__ */ w("h2", {
|
|
2903
3323
|
className: "m-0 text-[14px] font-semibold",
|
|
2904
3324
|
children: "Partial bulk failure"
|
|
2905
3325
|
}),
|
|
2906
|
-
/* @__PURE__ */
|
|
3326
|
+
/* @__PURE__ */ T("p", {
|
|
2907
3327
|
className: "mt-2 text-[12px] text-[var(--fb-muted)]",
|
|
2908
3328
|
children: [
|
|
2909
|
-
|
|
3329
|
+
r,
|
|
2910
3330
|
" of ",
|
|
2911
3331
|
e.totalCount,
|
|
2912
3332
|
" completed"
|
|
2913
3333
|
]
|
|
2914
3334
|
}),
|
|
2915
|
-
/* @__PURE__ */
|
|
2916
|
-
className: `mt-3 max-h-40 overflow-auto rounded-[calc(var(--fb-radius)-3px)] border border-[var(--fb-border)] bg-[var(--fb-bg)] p-2 text-[12px] ${
|
|
2917
|
-
children: e.failures.map((e) => /* @__PURE__ */
|
|
3335
|
+
/* @__PURE__ */ w("ul", {
|
|
3336
|
+
className: `mt-3 max-h-40 overflow-auto rounded-[calc(var(--fb-radius)-3px)] border border-[var(--fb-border)] bg-[var(--fb-bg)] p-2 text-[12px] ${X}`,
|
|
3337
|
+
children: e.failures.map((e) => /* @__PURE__ */ T("li", {
|
|
2918
3338
|
className: "py-1",
|
|
2919
|
-
children: [/* @__PURE__ */
|
|
3339
|
+
children: [/* @__PURE__ */ w("div", {
|
|
2920
3340
|
className: "truncate font-medium",
|
|
2921
3341
|
children: e.path.split("/").filter(Boolean).at(-1) ?? e.path
|
|
2922
|
-
}), /* @__PURE__ */
|
|
3342
|
+
}), /* @__PURE__ */ w("div", {
|
|
2923
3343
|
className: "text-[var(--fb-danger)]",
|
|
2924
3344
|
children: e.message
|
|
2925
3345
|
})]
|
|
2926
3346
|
}, e.path))
|
|
2927
3347
|
}),
|
|
2928
|
-
/* @__PURE__ */
|
|
3348
|
+
/* @__PURE__ */ w("div", {
|
|
2929
3349
|
className: "mt-4 flex justify-end",
|
|
2930
|
-
children: /* @__PURE__ */
|
|
2931
|
-
className:
|
|
2932
|
-
onClick:
|
|
3350
|
+
children: /* @__PURE__ */ w("button", {
|
|
3351
|
+
className: wn(),
|
|
3352
|
+
onClick: n,
|
|
2933
3353
|
type: "button",
|
|
2934
3354
|
children: "OK"
|
|
2935
3355
|
})
|
|
@@ -2938,35 +3358,35 @@ function It({ error: e, onClose: t }) {
|
|
|
2938
3358
|
})
|
|
2939
3359
|
});
|
|
2940
3360
|
}
|
|
2941
|
-
function
|
|
2942
|
-
return /* @__PURE__ */
|
|
2943
|
-
className: `mt-3 max-h-64 overflow-auto rounded-[calc(var(--fb-radius)-3px)] border border-[var(--fb-border)] bg-[var(--fb-bg)] p-2 ${
|
|
3361
|
+
function Zt({ currentPath: e, destinations: t, error: n, onSelect: r, rootLabel: i, selectedPath: a, status: o }) {
|
|
3362
|
+
return /* @__PURE__ */ T("div", {
|
|
3363
|
+
className: `mt-3 max-h-64 overflow-auto rounded-[calc(var(--fb-radius)-3px)] border border-[var(--fb-border)] bg-[var(--fb-bg)] p-2 ${X}`,
|
|
2944
3364
|
children: [
|
|
2945
|
-
/* @__PURE__ */
|
|
3365
|
+
/* @__PURE__ */ w(Qt, {
|
|
2946
3366
|
active: a === e,
|
|
2947
3367
|
label: "Current folder",
|
|
2948
3368
|
onClick: () => r(e),
|
|
2949
3369
|
path: e
|
|
2950
3370
|
}),
|
|
2951
|
-
/* @__PURE__ */
|
|
3371
|
+
/* @__PURE__ */ w(Qt, {
|
|
2952
3372
|
active: a === "/",
|
|
2953
3373
|
label: i,
|
|
2954
3374
|
onClick: () => r("/"),
|
|
2955
3375
|
path: "/"
|
|
2956
3376
|
}),
|
|
2957
|
-
o === "loading" ? /* @__PURE__ */
|
|
3377
|
+
o === "loading" ? /* @__PURE__ */ w("div", {
|
|
2958
3378
|
className: "px-2 py-3 text-[12px] text-[var(--fb-muted)]",
|
|
2959
3379
|
children: "Loading folders"
|
|
2960
3380
|
}) : null,
|
|
2961
|
-
o === "error" ? /* @__PURE__ */
|
|
3381
|
+
o === "error" ? /* @__PURE__ */ w("div", {
|
|
2962
3382
|
className: "px-2 py-3 text-[12px] text-[var(--fb-danger)]",
|
|
2963
3383
|
children: n ?? "Could not load folders"
|
|
2964
3384
|
}) : null,
|
|
2965
|
-
o === "ready" && t.length === 0 ? /* @__PURE__ */
|
|
3385
|
+
o === "ready" && t.length === 0 ? /* @__PURE__ */ w("div", {
|
|
2966
3386
|
className: "px-2 py-3 text-[12px] text-[var(--fb-muted)]",
|
|
2967
3387
|
children: "No folders available."
|
|
2968
3388
|
}) : null,
|
|
2969
|
-
t.map((e) => /* @__PURE__ */
|
|
3389
|
+
t.map((e) => /* @__PURE__ */ w(Qt, {
|
|
2970
3390
|
active: a === e.path,
|
|
2971
3391
|
depth: e.depth,
|
|
2972
3392
|
label: e.name,
|
|
@@ -2976,117 +3396,154 @@ function Lt({ currentPath: e, destinations: t, error: n, onSelect: r, rootLabel:
|
|
|
2976
3396
|
]
|
|
2977
3397
|
});
|
|
2978
3398
|
}
|
|
2979
|
-
function
|
|
2980
|
-
return /* @__PURE__ */
|
|
3399
|
+
function Qt({ active: e, depth: t = 0, label: n, onClick: r, path: i }) {
|
|
3400
|
+
return /* @__PURE__ */ T("button", {
|
|
2981
3401
|
"aria-label": `Move destination ${i}`,
|
|
2982
|
-
className: `mt-1 flex h-
|
|
3402
|
+
className: `mt-1 flex min-h-[var(--fb-control-h)] w-full min-w-0 items-center gap-2 rounded-[calc(var(--fb-radius)-4px)] px-2 text-left text-[12px] font-medium ${At} ${Y} ${e ? "bg-[var(--fb-accent-soft)] text-[var(--fb-accent)]" : "hover:bg-[var(--fb-surface)]"}`,
|
|
2983
3403
|
onClick: r,
|
|
2984
|
-
style: { paddingLeft: `calc((${t} * 6 + 2) * var(--fb-gap))` },
|
|
3404
|
+
style: { paddingLeft: `min(40%, calc((${t} * 6 + 2) * var(--fb-gap)))` },
|
|
2985
3405
|
type: "button",
|
|
2986
|
-
children: [/* @__PURE__ */
|
|
3406
|
+
children: [/* @__PURE__ */ w(_e, {
|
|
2987
3407
|
"aria-hidden": "true",
|
|
2988
3408
|
className: "size-4 shrink-0"
|
|
2989
|
-
}), /* @__PURE__ */
|
|
3409
|
+
}), /* @__PURE__ */ w("span", {
|
|
2990
3410
|
className: "truncate",
|
|
2991
3411
|
children: n
|
|
2992
3412
|
})]
|
|
2993
3413
|
});
|
|
2994
3414
|
}
|
|
2995
|
-
function
|
|
3415
|
+
function $t({ selectedCount: e, itemCount: t, canRename: n, canMove: r, canCopy: i, canCut: a, canDelete: o, canDownload: s, onRename: c, onMove: l, onCopy: u, onCut: d, onDelete: f, onDownload: p, onSelectAll: m, onSelectNone: h }) {
|
|
2996
3416
|
let g = e > 0;
|
|
2997
|
-
return /* @__PURE__ */
|
|
3417
|
+
return /* @__PURE__ */ T("div", {
|
|
2998
3418
|
"aria-label": "Selection actions",
|
|
2999
|
-
className: `flex min-h-11 flex-wrap items-center gap-2 border-b border-[var(--fb-border)] px-[var(--fb-pad)] py-1.5 ${
|
|
3419
|
+
className: `flex min-h-11 flex-wrap items-center gap-2 border-b border-[var(--fb-border)] px-[var(--fb-pad)] py-1.5 ${X} ${g ? "bg-[var(--fb-accent-soft)]" : "bg-[var(--fb-surface)]"}`,
|
|
3000
3420
|
role: "toolbar",
|
|
3001
3421
|
children: [
|
|
3002
|
-
/* @__PURE__ */
|
|
3422
|
+
/* @__PURE__ */ T("span", {
|
|
3003
3423
|
className: "mr-auto text-[12px] font-semibold",
|
|
3004
3424
|
children: [e, " selected"]
|
|
3005
3425
|
}),
|
|
3006
|
-
/* @__PURE__ */
|
|
3426
|
+
/* @__PURE__ */ T("button", {
|
|
3007
3427
|
className: $(!1),
|
|
3008
3428
|
disabled: t === 0,
|
|
3009
3429
|
onClick: m,
|
|
3010
3430
|
type: "button",
|
|
3011
|
-
children: [/* @__PURE__ */
|
|
3431
|
+
children: [/* @__PURE__ */ w(R, { className: "size-4" }), "Select all"]
|
|
3012
3432
|
}),
|
|
3013
|
-
/* @__PURE__ */
|
|
3433
|
+
/* @__PURE__ */ T("button", {
|
|
3014
3434
|
className: $(!1),
|
|
3015
3435
|
disabled: !g,
|
|
3016
3436
|
onClick: h,
|
|
3017
3437
|
type: "button",
|
|
3018
|
-
children: [/* @__PURE__ */
|
|
3438
|
+
children: [/* @__PURE__ */ w(B, { className: "size-4" }), "Select none"]
|
|
3019
3439
|
}),
|
|
3020
|
-
g && n && e === 1 ? /* @__PURE__ */
|
|
3440
|
+
g && n && e === 1 ? /* @__PURE__ */ T("button", {
|
|
3021
3441
|
className: $(!1),
|
|
3022
3442
|
onClick: () => c(),
|
|
3023
3443
|
type: "button",
|
|
3024
|
-
children: [/* @__PURE__ */
|
|
3444
|
+
children: [/* @__PURE__ */ w(F, { className: "size-4" }), "Rename"]
|
|
3025
3445
|
}) : null,
|
|
3026
|
-
g && r ? /* @__PURE__ */
|
|
3446
|
+
g && r ? /* @__PURE__ */ T("button", {
|
|
3027
3447
|
className: $(!1),
|
|
3028
3448
|
onClick: l,
|
|
3029
3449
|
type: "button",
|
|
3030
|
-
children: [/* @__PURE__ */
|
|
3450
|
+
children: [/* @__PURE__ */ w(ge, { className: "size-4" }), "Move"]
|
|
3031
3451
|
}) : null,
|
|
3032
|
-
g && i ? /* @__PURE__ */
|
|
3452
|
+
g && i ? /* @__PURE__ */ T("button", {
|
|
3033
3453
|
className: $(!1),
|
|
3034
3454
|
onClick: u,
|
|
3035
3455
|
type: "button",
|
|
3036
|
-
children: [/* @__PURE__ */
|
|
3456
|
+
children: [/* @__PURE__ */ w(N, { className: "size-4" }), "Copy"]
|
|
3037
3457
|
}) : null,
|
|
3038
|
-
g && a ? /* @__PURE__ */
|
|
3458
|
+
g && a ? /* @__PURE__ */ T("button", {
|
|
3039
3459
|
className: $(!1),
|
|
3040
3460
|
onClick: d,
|
|
3041
3461
|
type: "button",
|
|
3042
|
-
children: [/* @__PURE__ */
|
|
3462
|
+
children: [/* @__PURE__ */ w(L, { className: "size-4" }), "Cut"]
|
|
3043
3463
|
}) : null,
|
|
3044
|
-
g && s ? /* @__PURE__ */
|
|
3464
|
+
g && s ? /* @__PURE__ */ T("button", {
|
|
3045
3465
|
className: $(!1),
|
|
3046
3466
|
onClick: p,
|
|
3047
3467
|
type: "button",
|
|
3048
|
-
children: [/* @__PURE__ */
|
|
3468
|
+
children: [/* @__PURE__ */ w(P, { className: "size-4" }), "Download"]
|
|
3049
3469
|
}) : null,
|
|
3050
|
-
g && o ? /* @__PURE__ */
|
|
3051
|
-
className:
|
|
3470
|
+
g && o ? /* @__PURE__ */ T("button", {
|
|
3471
|
+
className: Tn(),
|
|
3052
3472
|
onClick: f,
|
|
3053
3473
|
type: "button",
|
|
3054
|
-
children: [/* @__PURE__ */
|
|
3474
|
+
children: [/* @__PURE__ */ w(Ce, { className: "size-4" }), "Delete"]
|
|
3055
3475
|
}) : null
|
|
3056
3476
|
]
|
|
3057
3477
|
});
|
|
3058
3478
|
}
|
|
3059
|
-
function
|
|
3060
|
-
let
|
|
3479
|
+
function en({ path: e, onNavigate: t, rootLabel: n, narrow: r }) {
|
|
3480
|
+
let [i, a] = b(!1), s = e.split("/").filter(Boolean), c = [{
|
|
3481
|
+
label: n,
|
|
3482
|
+
path: "/"
|
|
3483
|
+
}].concat(s.map((e, t) => ({
|
|
3484
|
+
label: e,
|
|
3485
|
+
path: `/${s.slice(0, t + 1).join("/")}`
|
|
3486
|
+
}))), l = r && c.length > 1 ? [{
|
|
3487
|
+
kind: "collapsed",
|
|
3488
|
+
key: "collapsed"
|
|
3489
|
+
}, {
|
|
3490
|
+
...c[c.length - 1],
|
|
3491
|
+
kind: "crumb",
|
|
3492
|
+
key: e
|
|
3493
|
+
}] : tn(c);
|
|
3061
3494
|
return /* @__PURE__ */ T("nav", {
|
|
3062
3495
|
"aria-label": "Breadcrumb",
|
|
3063
|
-
className: "flex min-w-0 items-center gap-1",
|
|
3064
|
-
children:
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
path: `/${r.slice(0, t + 1).join("/")}`
|
|
3070
|
-
})))).map((e, n) => /* @__PURE__ */ E("span", {
|
|
3071
|
-
className: "flex min-w-0 items-center gap-1",
|
|
3072
|
-
children: [n > 0 ? /* @__PURE__ */ T("span", {
|
|
3073
|
-
className: "text-[var(--fb-muted)]",
|
|
3074
|
-
"aria-hidden": "true",
|
|
3075
|
-
children: "/"
|
|
3076
|
-
}) : null, e.kind === "collapsed" ? /* @__PURE__ */ T("span", {
|
|
3077
|
-
"aria-label": "Collapsed breadcrumb",
|
|
3078
|
-
className: `rounded-[calc(var(--fb-radius)-4px)] px-1.5 py-1 text-[12px] font-semibold text-[var(--fb-muted)] ${X}`,
|
|
3079
|
-
children: "..."
|
|
3080
|
-
}) : /* @__PURE__ */ T("button", {
|
|
3081
|
-
className: `max-w-[160px] truncate rounded-[calc(var(--fb-radius)-4px)] px-1.5 py-1 text-[12px] font-semibold hover:bg-[var(--fb-bg)] ${X}`,
|
|
3082
|
-
onClick: () => void t(e.path),
|
|
3496
|
+
className: "flex min-w-0 max-w-full items-center gap-1",
|
|
3497
|
+
children: [
|
|
3498
|
+
r && s.length > 0 ? /* @__PURE__ */ w("button", {
|
|
3499
|
+
"aria-label": "Parent folder",
|
|
3500
|
+
className: Q(!1),
|
|
3501
|
+
onClick: () => void t(o(e)),
|
|
3083
3502
|
type: "button",
|
|
3084
|
-
children:
|
|
3085
|
-
|
|
3086
|
-
|
|
3503
|
+
children: /* @__PURE__ */ w(de, {
|
|
3504
|
+
"aria-hidden": "true",
|
|
3505
|
+
className: "size-4"
|
|
3506
|
+
})
|
|
3507
|
+
}) : null,
|
|
3508
|
+
l.map((e, n) => /* @__PURE__ */ T("span", {
|
|
3509
|
+
className: "flex min-w-0 items-center gap-1 last:flex-1",
|
|
3510
|
+
children: [n > 0 ? /* @__PURE__ */ w("span", {
|
|
3511
|
+
className: "text-[var(--fb-muted)]",
|
|
3512
|
+
"aria-hidden": "true",
|
|
3513
|
+
children: "/"
|
|
3514
|
+
}) : null, e.kind === "collapsed" ? /* @__PURE__ */ w("button", {
|
|
3515
|
+
"aria-label": "Collapsed breadcrumb",
|
|
3516
|
+
"aria-haspopup": "dialog",
|
|
3517
|
+
className: `${Q(!1)} border-0`,
|
|
3518
|
+
onClick: () => a(!0),
|
|
3519
|
+
type: "button",
|
|
3520
|
+
children: "..."
|
|
3521
|
+
}) : /* @__PURE__ */ w("button", {
|
|
3522
|
+
className: `min-h-[var(--fb-control-h)] min-w-[var(--fb-control-h)] max-w-[160px] truncate rounded-[calc(var(--fb-radius)-4px)] px-1.5 py-1 text-[12px] font-semibold hover:bg-[var(--fb-bg)] [@media(pointer:coarse)]:min-h-[calc(var(--fb-gap)*11)] [@media(pointer:coarse)]:min-w-[calc(var(--fb-gap)*11)] ${Y}`,
|
|
3523
|
+
onClick: () => void t(e.path),
|
|
3524
|
+
type: "button",
|
|
3525
|
+
children: e.label
|
|
3526
|
+
})]
|
|
3527
|
+
}, e.key)),
|
|
3528
|
+
i ? /* @__PURE__ */ w(rt, {
|
|
3529
|
+
label: "Folder path",
|
|
3530
|
+
onClose: () => a(!1),
|
|
3531
|
+
children: /* @__PURE__ */ w("div", {
|
|
3532
|
+
className: "flex min-w-0 flex-col",
|
|
3533
|
+
children: c.map((e) => /* @__PURE__ */ w("button", {
|
|
3534
|
+
className: `${$(!1)} my-[var(--fb-gap)] block w-full truncate text-left`,
|
|
3535
|
+
onClick: () => {
|
|
3536
|
+
a(!1), t(e.path);
|
|
3537
|
+
},
|
|
3538
|
+
type: "button",
|
|
3539
|
+
children: e.label
|
|
3540
|
+
}, e.path))
|
|
3541
|
+
})
|
|
3542
|
+
}) : null
|
|
3543
|
+
]
|
|
3087
3544
|
});
|
|
3088
3545
|
}
|
|
3089
|
-
function
|
|
3546
|
+
function tn(e) {
|
|
3090
3547
|
return e.length <= 4 ? e.map((e) => ({
|
|
3091
3548
|
...e,
|
|
3092
3549
|
kind: "crumb",
|
|
@@ -3113,178 +3570,179 @@ function Vt(e) {
|
|
|
3113
3570
|
}))
|
|
3114
3571
|
];
|
|
3115
3572
|
}
|
|
3116
|
-
function
|
|
3117
|
-
|
|
3573
|
+
function nn({ canDownload: e, item: t, onCopyPath: n, onDownload: r, renderDetailsContent: i, selectedCount: a, totalBytes: o, sheet: s }) {
|
|
3574
|
+
let c = `min-w-0 max-w-full shrink-0 bg-[var(--fb-surface)] [overflow-wrap:anywhere] [&_*]:max-w-full ${X} ${s ? "w-full" : "w-[var(--fb-panel-w)] rounded-r-[var(--fb-radius)] border-l border-[var(--fb-border)] p-[var(--fb-panel-pad)]"}`;
|
|
3575
|
+
if (!t) return /* @__PURE__ */ w("aside", {
|
|
3118
3576
|
"aria-label": "Details",
|
|
3119
|
-
className:
|
|
3120
|
-
children: /* @__PURE__ */
|
|
3577
|
+
className: `${c} flex`,
|
|
3578
|
+
children: /* @__PURE__ */ T("div", {
|
|
3121
3579
|
className: "flex min-h-full flex-1 flex-col items-center justify-center text-center",
|
|
3122
|
-
children: [/* @__PURE__ */
|
|
3123
|
-
className: `grid h-28 w-full place-items-center rounded-[var(--fb-radius)] bg-[var(--fb-bg)] ${
|
|
3124
|
-
children: /* @__PURE__ */
|
|
3125
|
-
}), /* @__PURE__ */
|
|
3580
|
+
children: [/* @__PURE__ */ w("div", {
|
|
3581
|
+
className: `grid h-28 w-full place-items-center rounded-[var(--fb-radius)] bg-[var(--fb-bg)] ${X}`,
|
|
3582
|
+
children: /* @__PURE__ */ w(z, { className: "size-12 text-[var(--fb-muted)]" })
|
|
3583
|
+
}), /* @__PURE__ */ w("h2", {
|
|
3126
3584
|
className: "mt-4 text-[14px] font-semibold",
|
|
3127
3585
|
children: "No item selected"
|
|
3128
3586
|
})]
|
|
3129
3587
|
})
|
|
3130
3588
|
});
|
|
3131
|
-
if (a > 1) return /* @__PURE__ */
|
|
3589
|
+
if (a > 1) return /* @__PURE__ */ T("aside", {
|
|
3132
3590
|
"aria-label": "Details",
|
|
3133
|
-
className:
|
|
3591
|
+
className: c,
|
|
3134
3592
|
children: [
|
|
3135
|
-
/* @__PURE__ */
|
|
3136
|
-
className: `grid h-28 place-items-center rounded-[var(--fb-radius)] bg-[var(--fb-bg)] ${
|
|
3137
|
-
children: /* @__PURE__ */
|
|
3593
|
+
/* @__PURE__ */ w("div", {
|
|
3594
|
+
className: `grid h-28 place-items-center rounded-[var(--fb-radius)] bg-[var(--fb-bg)] ${X}`,
|
|
3595
|
+
children: /* @__PURE__ */ w(N, { className: "size-12 text-[var(--fb-muted)]" })
|
|
3138
3596
|
}),
|
|
3139
|
-
/* @__PURE__ */
|
|
3597
|
+
/* @__PURE__ */ T("h2", {
|
|
3140
3598
|
className: "mt-4 text-[14px] font-semibold",
|
|
3141
|
-
children: [
|
|
3599
|
+
children: [yn(a), " selected"]
|
|
3142
3600
|
}),
|
|
3143
|
-
/* @__PURE__ */
|
|
3601
|
+
/* @__PURE__ */ w("dl", {
|
|
3144
3602
|
className: "mt-3 space-y-2 text-[12px]",
|
|
3145
|
-
children: /* @__PURE__ */
|
|
3603
|
+
children: /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("dt", {
|
|
3146
3604
|
className: "text-[var(--fb-muted)]",
|
|
3147
3605
|
children: "Total size"
|
|
3148
|
-
}), /* @__PURE__ */
|
|
3606
|
+
}), /* @__PURE__ */ w("dd", {
|
|
3149
3607
|
className: "font-medium",
|
|
3150
|
-
children:
|
|
3608
|
+
children: vn(o)
|
|
3151
3609
|
})] })
|
|
3152
3610
|
}),
|
|
3153
|
-
e ? /* @__PURE__ */
|
|
3154
|
-
"aria-label": `Download ${
|
|
3611
|
+
e ? /* @__PURE__ */ T("button", {
|
|
3612
|
+
"aria-label": `Download ${yn(a)}`,
|
|
3155
3613
|
className: `${$(!1)} mt-4 w-full justify-center`,
|
|
3156
3614
|
onClick: r,
|
|
3157
3615
|
type: "button",
|
|
3158
|
-
children: [/* @__PURE__ */
|
|
3616
|
+
children: [/* @__PURE__ */ w(P, { className: "size-4" }), "Download"]
|
|
3159
3617
|
}) : null,
|
|
3160
|
-
/* @__PURE__ */
|
|
3161
|
-
"aria-label": `Copy ${
|
|
3618
|
+
/* @__PURE__ */ T("button", {
|
|
3619
|
+
"aria-label": `Copy ${yn(a)} paths`,
|
|
3162
3620
|
className: `${$(!1)} mt-2 w-full justify-center`,
|
|
3163
3621
|
onClick: n,
|
|
3164
3622
|
type: "button",
|
|
3165
|
-
children: [/* @__PURE__ */
|
|
3623
|
+
children: [/* @__PURE__ */ w(N, { className: "size-4" }), "Copy paths"]
|
|
3166
3624
|
})
|
|
3167
3625
|
]
|
|
3168
3626
|
});
|
|
3169
|
-
let
|
|
3170
|
-
/* @__PURE__ */
|
|
3171
|
-
className: `grid h-28 place-items-center rounded-[var(--fb-radius)] bg-[var(--fb-bg)] ${
|
|
3172
|
-
children: t.kind === "folder" ? /* @__PURE__ */
|
|
3627
|
+
let l = /* @__PURE__ */ T(ee, { children: [
|
|
3628
|
+
/* @__PURE__ */ w("div", {
|
|
3629
|
+
className: `grid h-28 place-items-center rounded-[var(--fb-radius)] bg-[var(--fb-bg)] ${X}`,
|
|
3630
|
+
children: t.kind === "folder" ? /* @__PURE__ */ w(_e, { className: "size-12 text-[var(--fb-folder)]" }) : /* @__PURE__ */ w(he, { className: "size-12 text-[var(--fb-muted)]" })
|
|
3173
3631
|
}),
|
|
3174
|
-
/* @__PURE__ */
|
|
3632
|
+
/* @__PURE__ */ w("h2", {
|
|
3175
3633
|
className: "mt-4 truncate text-[14px] font-semibold",
|
|
3176
3634
|
children: t.name
|
|
3177
3635
|
}),
|
|
3178
|
-
/* @__PURE__ */
|
|
3636
|
+
/* @__PURE__ */ T("dl", {
|
|
3179
3637
|
className: "mt-3 space-y-2 text-[12px]",
|
|
3180
3638
|
children: [
|
|
3181
|
-
/* @__PURE__ */
|
|
3639
|
+
/* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("dt", {
|
|
3182
3640
|
className: "text-[var(--fb-muted)]",
|
|
3183
3641
|
children: "Path"
|
|
3184
|
-
}), /* @__PURE__ */
|
|
3642
|
+
}), /* @__PURE__ */ w("dd", {
|
|
3185
3643
|
className: "truncate font-medium",
|
|
3186
3644
|
children: t.path
|
|
3187
3645
|
})] }),
|
|
3188
|
-
/* @__PURE__ */
|
|
3646
|
+
/* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("dt", {
|
|
3189
3647
|
className: "text-[var(--fb-muted)]",
|
|
3190
3648
|
children: "Type"
|
|
3191
|
-
}), /* @__PURE__ */
|
|
3649
|
+
}), /* @__PURE__ */ w("dd", {
|
|
3192
3650
|
className: "font-medium",
|
|
3193
3651
|
children: t.kind
|
|
3194
3652
|
})] }),
|
|
3195
|
-
t.kind === "file" ? /* @__PURE__ */
|
|
3653
|
+
t.kind === "file" ? /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("dt", {
|
|
3196
3654
|
className: "text-[var(--fb-muted)]",
|
|
3197
3655
|
children: "Size"
|
|
3198
|
-
}), /* @__PURE__ */
|
|
3656
|
+
}), /* @__PURE__ */ w("dd", {
|
|
3199
3657
|
className: "font-medium",
|
|
3200
|
-
children:
|
|
3658
|
+
children: vn(t.size ?? 0)
|
|
3201
3659
|
})] }) : null
|
|
3202
3660
|
]
|
|
3203
3661
|
}),
|
|
3204
|
-
e ? /* @__PURE__ */
|
|
3662
|
+
e ? /* @__PURE__ */ T("button", {
|
|
3205
3663
|
"aria-label": `Download ${t.name}`,
|
|
3206
3664
|
className: `${$(!1)} mt-4 w-full justify-center`,
|
|
3207
3665
|
onClick: r,
|
|
3208
3666
|
type: "button",
|
|
3209
|
-
children: [/* @__PURE__ */
|
|
3667
|
+
children: [/* @__PURE__ */ w(P, { className: "size-4" }), "Download"]
|
|
3210
3668
|
}) : null,
|
|
3211
|
-
/* @__PURE__ */
|
|
3669
|
+
/* @__PURE__ */ T("button", {
|
|
3212
3670
|
"aria-label": `Copy path of ${t.name}`,
|
|
3213
3671
|
className: `${$(!1)} mt-2 w-full justify-center`,
|
|
3214
3672
|
onClick: n,
|
|
3215
3673
|
type: "button",
|
|
3216
|
-
children: [/* @__PURE__ */
|
|
3674
|
+
children: [/* @__PURE__ */ w(N, { className: "size-4" }), "Copy path"]
|
|
3217
3675
|
})
|
|
3218
3676
|
] });
|
|
3219
|
-
return /* @__PURE__ */
|
|
3677
|
+
return /* @__PURE__ */ w("aside", {
|
|
3220
3678
|
"aria-label": "Details",
|
|
3221
|
-
className:
|
|
3222
|
-
children: i ? i(t,
|
|
3679
|
+
className: c,
|
|
3680
|
+
children: i ? i(t, l) : l
|
|
3223
3681
|
});
|
|
3224
3682
|
}
|
|
3225
|
-
function
|
|
3226
|
-
return e.url ? /* @__PURE__ */
|
|
3683
|
+
function rn({ preview: e }) {
|
|
3684
|
+
return e.url ? /* @__PURE__ */ w("a", {
|
|
3227
3685
|
"aria-label": `Open original ${e.item.name}`,
|
|
3228
|
-
className: `mt-4 inline-flex h-
|
|
3686
|
+
className: `mt-4 inline-flex min-h-[var(--fb-control-h)] items-center rounded-[calc(var(--fb-radius)-3px)] border border-[var(--fb-border)] bg-[var(--fb-surface)] px-2.5 text-[12px] font-medium text-[var(--fb-accent)] outline-none hover:bg-[var(--fb-bg)] focus:ring-2 focus:ring-[var(--fb-accent-soft)] ${At} ${Y}`,
|
|
3229
3687
|
href: e.url,
|
|
3230
3688
|
rel: "noreferrer",
|
|
3231
3689
|
target: "_blank",
|
|
3232
3690
|
children: "Open original"
|
|
3233
3691
|
}) : null;
|
|
3234
3692
|
}
|
|
3235
|
-
function
|
|
3236
|
-
return /* @__PURE__ */
|
|
3693
|
+
function an({ rootLabel: e }) {
|
|
3694
|
+
return /* @__PURE__ */ w("div", {
|
|
3237
3695
|
"aria-label": e,
|
|
3238
|
-
className: "grid grid-cols-[repeat(
|
|
3696
|
+
className: "grid min-w-0 grid-cols-[repeat(2,minmax(0,1fr))] gap-[var(--fb-grid-gap)] @min-[40rem]/fb:grid-cols-[repeat(auto-fill,minmax(min(100%,var(--fb-card-min)),1fr))]",
|
|
3239
3697
|
role: "grid",
|
|
3240
|
-
children: Array.from({ length: 8 }, (e, t) => /* @__PURE__ */
|
|
3241
|
-
className: `min-h-[var(--fb-card-minh)] animate-pulse rounded-[calc(var(--fb-radius)-1px)] border border-[var(--fb-border)] bg-[var(--fb-surface)] p-[var(--fb-card-pad)] ${
|
|
3698
|
+
children: Array.from({ length: 8 }, (e, t) => /* @__PURE__ */ T("div", {
|
|
3699
|
+
className: `min-h-[var(--fb-card-minh)] animate-pulse rounded-[calc(var(--fb-radius)-1px)] border border-[var(--fb-border)] bg-[var(--fb-surface)] p-[var(--fb-card-pad)] ${X}`,
|
|
3242
3700
|
children: [
|
|
3243
|
-
/* @__PURE__ */
|
|
3244
|
-
/* @__PURE__ */
|
|
3245
|
-
/* @__PURE__ */
|
|
3701
|
+
/* @__PURE__ */ w("div", { className: "h-[var(--fb-thumb-h)] rounded-[calc(var(--fb-radius)-3px)] bg-[var(--fb-surface-2)]" }),
|
|
3702
|
+
/* @__PURE__ */ w("div", { className: "mt-3 h-3 w-3/4 rounded bg-[var(--fb-surface-2)]" }),
|
|
3703
|
+
/* @__PURE__ */ w("div", { className: "mt-2 h-3 w-1/2 rounded bg-[var(--fb-surface-2)]" })
|
|
3246
3704
|
]
|
|
3247
3705
|
}, t))
|
|
3248
3706
|
});
|
|
3249
3707
|
}
|
|
3250
|
-
function
|
|
3251
|
-
return /* @__PURE__ */
|
|
3252
|
-
className: `grid min-h-[280px] place-items-center rounded-[var(--fb-radius)] border border-dashed border-[var(--fb-border)] bg-[var(--fb-surface)] p-
|
|
3253
|
-
children: /* @__PURE__ */
|
|
3708
|
+
function on({ title: e, value: t, tone: n }) {
|
|
3709
|
+
return /* @__PURE__ */ w("div", {
|
|
3710
|
+
className: `grid min-h-[min(280px,50svh)] min-w-0 place-items-center rounded-[var(--fb-radius)] border border-dashed border-[var(--fb-border)] bg-[var(--fb-surface)] p-[var(--fb-pad)] text-center [overflow-wrap:anywhere] [&_*]:max-w-full ${X}`,
|
|
3711
|
+
children: /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("div", {
|
|
3254
3712
|
className: `font-semibold ${n === "danger" ? "text-[var(--fb-danger)]" : ""}`,
|
|
3255
3713
|
children: e
|
|
3256
|
-
}), t === void 0 ? null : /* @__PURE__ */
|
|
3714
|
+
}), t === void 0 ? null : /* @__PURE__ */ w("div", {
|
|
3257
3715
|
className: "mt-1 text-[12px] text-[var(--fb-muted)]",
|
|
3258
3716
|
children: t
|
|
3259
3717
|
})] })
|
|
3260
3718
|
});
|
|
3261
3719
|
}
|
|
3262
|
-
function
|
|
3263
|
-
return /* @__PURE__ */
|
|
3720
|
+
function sn({ onDismiss: e, rejections: t }) {
|
|
3721
|
+
return /* @__PURE__ */ w("div", {
|
|
3264
3722
|
"aria-label": "Upload rejected",
|
|
3265
|
-
className: "border-b border-[var(--fb-border)] bg-[var(--fb-danger-soft)] px-3 py-2 text-[12px] text-[var(--fb-text)]",
|
|
3723
|
+
className: "min-w-0 border-b border-[var(--fb-border)] bg-[var(--fb-danger-soft)] px-3 py-2 text-[12px] text-[var(--fb-text)] [overflow-wrap:anywhere]",
|
|
3266
3724
|
role: "alert",
|
|
3267
|
-
children: /* @__PURE__ */
|
|
3725
|
+
children: /* @__PURE__ */ T("div", {
|
|
3268
3726
|
className: "flex items-start gap-3",
|
|
3269
|
-
children: [/* @__PURE__ */
|
|
3727
|
+
children: [/* @__PURE__ */ T("div", {
|
|
3270
3728
|
className: "min-w-0 flex-1",
|
|
3271
|
-
children: [/* @__PURE__ */
|
|
3729
|
+
children: [/* @__PURE__ */ w("div", {
|
|
3272
3730
|
className: "font-semibold text-[var(--fb-danger)]",
|
|
3273
3731
|
children: "Upload rejected"
|
|
3274
|
-
}), /* @__PURE__ */
|
|
3732
|
+
}), /* @__PURE__ */ w("ul", {
|
|
3275
3733
|
className: "mt-1 space-y-1",
|
|
3276
|
-
children: t.map((e) => /* @__PURE__ */
|
|
3734
|
+
children: t.map((e) => /* @__PURE__ */ T("li", {
|
|
3277
3735
|
className: "min-w-0",
|
|
3278
|
-
children: [/* @__PURE__ */
|
|
3736
|
+
children: [/* @__PURE__ */ w("span", {
|
|
3279
3737
|
className: "font-medium",
|
|
3280
3738
|
children: e.relativePath
|
|
3281
|
-
}), /* @__PURE__ */
|
|
3739
|
+
}), /* @__PURE__ */ T("span", {
|
|
3282
3740
|
className: "text-[var(--fb-muted)]",
|
|
3283
3741
|
children: [" ", e.reasons.join("; ")]
|
|
3284
3742
|
})]
|
|
3285
3743
|
}, e.relativePath))
|
|
3286
3744
|
})]
|
|
3287
|
-
}), /* @__PURE__ */
|
|
3745
|
+
}), /* @__PURE__ */ w("button", {
|
|
3288
3746
|
"aria-label": "Dismiss upload rejection",
|
|
3289
3747
|
className: $(!1),
|
|
3290
3748
|
onClick: e,
|
|
@@ -3294,13 +3752,13 @@ function Kt({ onDismiss: e, rejections: t }) {
|
|
|
3294
3752
|
})
|
|
3295
3753
|
});
|
|
3296
3754
|
}
|
|
3297
|
-
function
|
|
3755
|
+
function cn(e, t, n, r) {
|
|
3298
3756
|
"shiftKey" in n && n.shiftKey ? (r.cancelPendingSelectedItemUnselect(), e.selectRange(t)) : "metaKey" in n && (n.metaKey || n.ctrlKey) ? (r.cancelPendingSelectedItemUnselect(), e.toggleSelection(t)) : e.selectedPaths.length === 1 && e.selectedPaths[0] === t ? r.scheduleSelectedItemUnselect(t) : (r.cancelPendingSelectedItemUnselect(), e.selectOnly(t));
|
|
3299
3757
|
}
|
|
3300
|
-
function
|
|
3758
|
+
function ln(e) {
|
|
3301
3759
|
return !!("shiftKey" in e && (e.shiftKey || e.metaKey || e.ctrlKey));
|
|
3302
3760
|
}
|
|
3303
|
-
function
|
|
3761
|
+
function un(e) {
|
|
3304
3762
|
return [
|
|
3305
3763
|
"ArrowDown",
|
|
3306
3764
|
"ArrowLeft",
|
|
@@ -3310,15 +3768,15 @@ function Yt(e) {
|
|
|
3310
3768
|
"Home"
|
|
3311
3769
|
].includes(e);
|
|
3312
3770
|
}
|
|
3313
|
-
function
|
|
3771
|
+
function dn(e, t, n) {
|
|
3314
3772
|
return e === "Home" ? 0 : e === "End" ? n - 1 : e === "ArrowUp" || e === "ArrowLeft" ? Math.max(0, t - 1) : Math.min(n - 1, t + 1);
|
|
3315
3773
|
}
|
|
3316
|
-
function
|
|
3774
|
+
function fn(e) {
|
|
3317
3775
|
return typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(e) : e.replace(/["\\]/g, "\\$&");
|
|
3318
3776
|
}
|
|
3319
|
-
function
|
|
3777
|
+
function pn(e) {
|
|
3320
3778
|
if (typeof e.getData != "function") return [];
|
|
3321
|
-
let t = e.getData(
|
|
3779
|
+
let t = e.getData(Dt);
|
|
3322
3780
|
if (!t) return [];
|
|
3323
3781
|
try {
|
|
3324
3782
|
let e = JSON.parse(t);
|
|
@@ -3327,8 +3785,8 @@ function Qt(e) {
|
|
|
3327
3785
|
return [];
|
|
3328
3786
|
}
|
|
3329
3787
|
}
|
|
3330
|
-
function
|
|
3331
|
-
return
|
|
3788
|
+
function mn(e) {
|
|
3789
|
+
return hn(e) ? {
|
|
3332
3790
|
title: "Access denied",
|
|
3333
3791
|
value: e?.message ?? "You do not have access to this folder."
|
|
3334
3792
|
} : {
|
|
@@ -3336,57 +3794,57 @@ function $t(e) {
|
|
|
3336
3794
|
value: e?.message ?? "Unknown error"
|
|
3337
3795
|
};
|
|
3338
3796
|
}
|
|
3339
|
-
function
|
|
3797
|
+
function hn(e) {
|
|
3340
3798
|
if (!e) return !1;
|
|
3341
3799
|
let t = e;
|
|
3342
3800
|
return t.status === 403 || t.statusCode === 403 || t.code === "access_denied" || t.code === "forbidden" || t.code === "permission_denied";
|
|
3343
3801
|
}
|
|
3344
|
-
function
|
|
3802
|
+
function gn(e) {
|
|
3345
3803
|
return e instanceof Error ? e.message : String(e);
|
|
3346
3804
|
}
|
|
3347
|
-
function
|
|
3805
|
+
function _n(e) {
|
|
3348
3806
|
return e instanceof HTMLElement ? e.isContentEditable || [
|
|
3349
3807
|
"INPUT",
|
|
3350
3808
|
"SELECT",
|
|
3351
3809
|
"TEXTAREA"
|
|
3352
3810
|
].includes(e.tagName) : !1;
|
|
3353
3811
|
}
|
|
3354
|
-
function
|
|
3812
|
+
function vn(e) {
|
|
3355
3813
|
if (e < 1024) return `${e} B`;
|
|
3356
3814
|
let t = e / 1024;
|
|
3357
3815
|
return t < 1024 ? `${t.toFixed(1)} KB` : `${(t / 1024).toFixed(1)} MB`;
|
|
3358
3816
|
}
|
|
3359
|
-
function
|
|
3817
|
+
function yn(e) {
|
|
3360
3818
|
return `${e} ${e === 1 ? "item" : "items"}`;
|
|
3361
3819
|
}
|
|
3362
|
-
function
|
|
3363
|
-
return Array.from(new Set(e.filter((e) =>
|
|
3820
|
+
function bn(e) {
|
|
3821
|
+
return Array.from(new Set(e.filter((e) => jt.includes(e))));
|
|
3364
3822
|
}
|
|
3365
|
-
function
|
|
3823
|
+
function xn(e) {
|
|
3366
3824
|
return e === "keep-both" ? "Keep both" : e === "replace" ? "Replace" : "Skip";
|
|
3367
3825
|
}
|
|
3368
|
-
function
|
|
3826
|
+
function Sn(e, t) {
|
|
3369
3827
|
return e.length === 1 && e[0].kind === "file" ? !0 : e.length > 0 && t;
|
|
3370
3828
|
}
|
|
3371
|
-
function
|
|
3829
|
+
function Cn({ currentPath: e, itemCount: t, rootLabel: n, selectedCount: r, status: i }) {
|
|
3372
3830
|
return `${e === "/" ? n : e.split("/").filter(Boolean).at(-1) ?? n} ${i}. ${t} ${t === 1 ? "item" : "items"}. ${r} selected.`;
|
|
3373
3831
|
}
|
|
3374
|
-
function
|
|
3375
|
-
return `inline-flex h-[var(--fb-control-h)] items-center justify-center gap-1 rounded-[calc(var(--fb-radius)-3px)] border px-2 text-[12px] font-medium outline-none focus:ring-2 focus:ring-[var(--fb-accent-soft)] ${
|
|
3832
|
+
function Q(e) {
|
|
3833
|
+
return `inline-flex h-[var(--fb-control-h)] min-w-[var(--fb-control-h)] items-center justify-center gap-1 rounded-[calc(var(--fb-radius)-3px)] border px-2 text-[12px] font-medium outline-none disabled:opacity-45 focus:ring-2 focus:ring-[var(--fb-accent-soft)] ${At} ${Y} ${e ? "border-[var(--fb-accent)] bg-[var(--fb-accent-soft)] text-[var(--fb-accent)]" : "border-[var(--fb-border)] bg-[var(--fb-surface)] text-[var(--fb-muted)] hover:bg-[var(--fb-bg)]"}`;
|
|
3376
3834
|
}
|
|
3377
3835
|
function $(e) {
|
|
3378
|
-
return `inline-flex h-[var(--fb-control-h)] items-center gap-1.5 rounded-[calc(var(--fb-radius)-3px)] border px-2.5 text-[12px] font-medium outline-none disabled:cursor-not-allowed disabled:opacity-45 focus:ring-2 focus:ring-[var(--fb-accent-soft)] ${
|
|
3836
|
+
return `inline-flex h-[var(--fb-control-h)] items-center gap-1.5 rounded-[calc(var(--fb-radius)-3px)] border px-2.5 text-[12px] font-medium outline-none disabled:cursor-not-allowed disabled:opacity-45 focus:ring-2 focus:ring-[var(--fb-accent-soft)] ${At} ${Y} ${e ? "border-[var(--fb-accent)] bg-[var(--fb-accent-soft)] text-[var(--fb-accent)]" : "border-[var(--fb-border)] bg-[var(--fb-surface)] text-[var(--fb-text)] hover:bg-[var(--fb-bg)]"}`;
|
|
3379
3837
|
}
|
|
3380
|
-
function
|
|
3381
|
-
return `inline-flex h-[var(--fb-control-h)] items-center gap-1.5 rounded-[calc(var(--fb-radius)-3px)] border border-[var(--fb-accent)] bg-[var(--fb-accent)] px-2.5 text-[12px] font-semibold text-[var(--fb-surface)] outline-none hover:opacity-90 focus:ring-2 focus:ring-[var(--fb-accent-soft)] ${
|
|
3838
|
+
function wn() {
|
|
3839
|
+
return `inline-flex h-[var(--fb-control-h)] items-center gap-1.5 rounded-[calc(var(--fb-radius)-3px)] border border-[var(--fb-accent)] bg-[var(--fb-accent)] px-2.5 text-[12px] font-semibold text-[var(--fb-surface)] outline-none hover:opacity-90 focus:ring-2 focus:ring-[var(--fb-accent-soft)] ${At} ${Y}`;
|
|
3382
3840
|
}
|
|
3383
|
-
function
|
|
3384
|
-
return `inline-flex h-[var(--fb-control-h)] items-center gap-1.5 rounded-[calc(var(--fb-radius)-3px)] border border-[var(--fb-danger)] bg-[var(--fb-danger-soft)] px-2.5 text-[12px] font-medium text-[var(--fb-danger)] outline-none hover:bg-[var(--fb-danger-soft)] focus:ring-2 focus:ring-[var(--fb-danger-soft)] ${
|
|
3841
|
+
function Tn() {
|
|
3842
|
+
return `inline-flex h-[var(--fb-control-h)] items-center gap-1.5 rounded-[calc(var(--fb-radius)-3px)] border border-[var(--fb-danger)] bg-[var(--fb-danger-soft)] px-2.5 text-[12px] font-medium text-[var(--fb-danger)] outline-none hover:bg-[var(--fb-danger-soft)] focus:ring-2 focus:ring-[var(--fb-danger-soft)] ${At} ${Y}`;
|
|
3385
3843
|
}
|
|
3386
|
-
function
|
|
3387
|
-
return `h-[var(--fb-control-h)] rounded-[calc(var(--fb-radius)-3px)] border border-[var(--fb-border)] bg-[var(--fb-surface)] px-2 text-[12px] font-medium text-[var(--fb-text)] outline-none focus:border-[var(--fb-accent)] focus:ring-2 focus:ring-[var(--fb-accent-soft)] ${
|
|
3844
|
+
function En() {
|
|
3845
|
+
return `h-[var(--fb-control-h)] min-w-0 max-w-full rounded-[calc(var(--fb-radius)-3px)] border border-[var(--fb-border)] bg-[var(--fb-surface)] px-2 text-[12px] font-medium text-[var(--fb-text)] outline-none focus:border-[var(--fb-accent)] focus:ring-2 focus:ring-[var(--fb-accent-soft)] [@media(pointer:coarse)]:text-[16px] ${At} ${Y}`;
|
|
3388
3846
|
}
|
|
3389
3847
|
//#endregion
|
|
3390
|
-
export { l as FILE_BROWSER_THEME_CONTRACT,
|
|
3848
|
+
export { l as FILE_BROWSER_THEME_CONTRACT, Nt as FileBrowser, t as FileBrowserAdapterError, r as FileBrowserBulkActionError, q as FileBrowserProvider, c as ROOT_PATH, H as TransferManager, i as getFileBrowserBasename, u as getFileBrowserDensityAttributes, o as getFileBrowserDirname, n as isFileBrowserDescendantOrSelf, e as joinFileBrowserPath, a as normalizeFileBrowserPath, s as replaceFileBrowserPathPrefix, te as useFileBrowser, lt as useTransferSnapshot, ct as useTransfers };
|
|
3391
3849
|
|
|
3392
3850
|
//# sourceMappingURL=index.js.map
|