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