@burdenoff/microfe-files 2026.625.2 → 2026.625.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/files/components/EmptyState.js +31 -34
- package/dist/files/components/EmptyState.js.map +1 -1
- package/dist/files/components/FileBrowser.js +49 -43
- package/dist/files/components/FileBrowser.js.map +1 -1
- package/dist/files/components/TabBar.js.map +1 -1
- package/dist/files/components/UploadQueue.js +27 -20
- package/dist/files/components/UploadQueue.js.map +1 -1
- package/dist/files/pages/BrowserPage.js +310 -275
- package/dist/files/pages/BrowserPage.js.map +1 -1
- package/dist/files/pages/ShareAccessPage.js +42 -42
- package/dist/files/pages/ShareAccessPage.js.map +1 -1
- package/package.json +2 -2
|
@@ -45,30 +45,30 @@ import { isQuotaExhaustedError as Ie } from "../utils/quotaUtils.js";
|
|
|
45
45
|
import { nativeImpact as Le, nativeNotify as Re, nativeOpenUrl as ze } from "../../utils/nativeBridge.js";
|
|
46
46
|
import { emitFilesEvent as Be } from "../utils/events.js";
|
|
47
47
|
import { useEffect as Ve, useMemo as He, useState as o } from "react";
|
|
48
|
-
import { FolderPlus as Ue, FolderUp as We, FolderX as Ge, Grid3x3 as Ke, Home as qe, List as Je, Loader2 as s,
|
|
48
|
+
import { FolderPlus as Ue, FolderUp as We, FolderX as Ge, Grid3x3 as Ke, Home as qe, List as Je, Loader2 as s, Star as Ye, Trash2 as Xe, Upload as Ze, X as Qe } from "lucide-react";
|
|
49
49
|
import { Fragment as $e, jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
50
50
|
import { useNavigate as et, useParams as tt } from "react-router-dom";
|
|
51
51
|
import { useI18n as nt } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
52
|
-
import { Button as u, CTAOverflowMenu as
|
|
52
|
+
import { AuroraBackground as rt, Button as u, CTAOverflowMenu as it, EmphasisPanel as at, GradientText as ot, IllustratedEmptyState as st, Input as ct, NextSteps as lt, PagePurpose as ut, ResponsiveDialog as dt, ResponsiveDialogContent as ft, ResponsiveDialogFooter as pt, ResponsiveDialogHeader as mt, ResponsiveDialogTitle as ht } from "@burdenoff/fe-libs/ui";
|
|
53
53
|
//#region src/files/pages/BrowserPage.tsx
|
|
54
54
|
function d() {
|
|
55
|
-
let { t: d } = nt(), { folderId: f } = tt(),
|
|
55
|
+
let { t: d } = nt(), { folderId: f } = tt(), gt = et(), _t = e(), { workspaceId: p } = _t, vt = Fe(p ?? ""), { viewMode: yt, setViewMode: bt, breadcrumbs: xt, selectedFiles: St, selectedFolders: m, clearSelection: h } = t(), [g, _] = o("all"), Ct = He(() => [
|
|
56
56
|
"all",
|
|
57
57
|
"recent",
|
|
58
58
|
"starred",
|
|
59
59
|
"bin"
|
|
60
60
|
], []);
|
|
61
61
|
Ve(() => {
|
|
62
|
-
|
|
63
|
-
}, [
|
|
64
|
-
let [
|
|
62
|
+
Ct.includes(g) || _("all");
|
|
63
|
+
}, [Ct, g]);
|
|
64
|
+
let [v, wt] = o(""), [Tt, Et] = o(), y = v.trim().length >= 2, [Dt, Ot] = o(null), [b, kt] = o(null), x = be(), S = r({
|
|
65
65
|
folderId: f || void 0,
|
|
66
66
|
pageSize: 100,
|
|
67
|
-
skip:
|
|
68
|
-
}),
|
|
67
|
+
skip: g !== "all" || y
|
|
68
|
+
}), At = i({ skip: g !== "recent" || y }), jt = ee({ skip: g !== "starred" || y }), C = te({ skip: g !== "bin" || y }), w = ye(v, y, Tt);
|
|
69
69
|
Ve(() => {
|
|
70
|
-
if (f &&
|
|
71
|
-
let e =
|
|
70
|
+
if (f && S.data?.folderPath && S.data?.currentFolder) {
|
|
71
|
+
let e = S.data.folderPath.folders || [], n = S.data.currentFolder, r = [...e.map((e) => ({
|
|
72
72
|
id: e.id,
|
|
73
73
|
name: e.name
|
|
74
74
|
})), {
|
|
@@ -77,26 +77,26 @@ function d() {
|
|
|
77
77
|
}];
|
|
78
78
|
t.getState().setBreadcrumbs(r);
|
|
79
79
|
} else t.getState().setBreadcrumbs([]);
|
|
80
|
-
}, [f,
|
|
80
|
+
}, [f, S.data]);
|
|
81
81
|
let T = [], E = [], D = !1, O = null, k = !1;
|
|
82
|
-
if (
|
|
83
|
-
else switch (
|
|
82
|
+
if (y && w.data) T = w.data.files || [], E = w.data.folders || [], D = w.isLoading, O = w.error;
|
|
83
|
+
else switch (g) {
|
|
84
84
|
case "all":
|
|
85
|
-
T =
|
|
85
|
+
T = S.data?.filesList?.files || [], E = S.data?.foldersList?.folders || [], D = S.loading, O = S.error || null, k = !1;
|
|
86
86
|
break;
|
|
87
87
|
case "recent":
|
|
88
|
-
T =
|
|
88
|
+
T = At.files || [], E = At.folders || [], D = At.isLoading, O = At.error || null, k = !0;
|
|
89
89
|
break;
|
|
90
90
|
case "starred":
|
|
91
|
-
T =
|
|
91
|
+
T = jt.files, E = jt.folders, D = jt.isLoading, O = jt.error || null, k = !0;
|
|
92
92
|
break;
|
|
93
93
|
case "bin":
|
|
94
|
-
T =
|
|
94
|
+
T = C.files, E = C.folders, D = C.isLoading, O = C.error || null, k = !0;
|
|
95
95
|
break;
|
|
96
96
|
}
|
|
97
|
-
let
|
|
98
|
-
Be(
|
|
99
|
-
},
|
|
97
|
+
let Mt = g === "all" ? (S.data?.filesList?.total ?? T.length) + (S.data?.foldersList?.total ?? E.length) : null, A = St.size + m.size, [Nt, j] = o(!1), [Pt, Ft] = o(!1), [It, M] = o(!1), [Lt, Rt] = o(!1), [zt, N] = o(!1), [Bt, Vt] = o(!1), [Ht, P] = o(null), [F, I] = o(null), [L, Ut] = o(null), [R, z] = o(null), [B, V] = o(""), [H, U] = o(""), [W, G] = o(!1), [Wt, K] = o([]), [Gt, q] = o(!1), [J, Y] = o(null), X = (e, t) => {
|
|
98
|
+
Be(_t, e, t);
|
|
99
|
+
}, Kt = async () => {
|
|
100
100
|
if (!J || J.loading) return;
|
|
101
101
|
let e = J.onConfirm;
|
|
102
102
|
Y({
|
|
@@ -114,7 +114,7 @@ function d() {
|
|
|
114
114
|
loading: !1
|
|
115
115
|
});
|
|
116
116
|
}
|
|
117
|
-
}, Z = ne(),
|
|
117
|
+
}, Z = ne(), qt = re(), Jt = ie(), Yt = ae(), Xt = oe(), Zt = se(), Qt = ce(), $t = le(), en = ue(), Q = de(), $ = fe(), tn = pe(), nn = me(), rn = he(), an = ge(), on = _e(), sn = ve(), cn = () => {
|
|
118
118
|
let e = document.createElement("input");
|
|
119
119
|
e.type = "file", e.multiple = !0, e.onchange = async (e) => {
|
|
120
120
|
let t = e.target.files;
|
|
@@ -131,11 +131,11 @@ function d() {
|
|
|
131
131
|
};
|
|
132
132
|
}));
|
|
133
133
|
K((t) => [...t, ...e]), q(!0), G(!0);
|
|
134
|
-
for (let t of e) await
|
|
134
|
+
for (let t of e) await ln(t);
|
|
135
135
|
G(!1);
|
|
136
136
|
}
|
|
137
137
|
}, e.click();
|
|
138
|
-
},
|
|
138
|
+
}, ln = async (e) => {
|
|
139
139
|
let t = (t) => {
|
|
140
140
|
K((n) => n.map((n) => n.id === e.id ? {
|
|
141
141
|
...n,
|
|
@@ -144,7 +144,7 @@ function d() {
|
|
|
144
144
|
};
|
|
145
145
|
t({ status: "uploading" });
|
|
146
146
|
try {
|
|
147
|
-
let n = await
|
|
147
|
+
let n = await qt.mutateAsync({
|
|
148
148
|
file: e.file,
|
|
149
149
|
folderId: e.folderId,
|
|
150
150
|
onProgress: (e) => {
|
|
@@ -164,7 +164,7 @@ function d() {
|
|
|
164
164
|
r === "Upload paused" ? t({ status: "paused" }) : r === "QUOTA_EXHAUSTED" ? (t({
|
|
165
165
|
status: "failed",
|
|
166
166
|
error: a(d, "files.upload.errors.quotaExceeded", "Storage quota exceeded")
|
|
167
|
-
}),
|
|
167
|
+
}), x.error(a(d, "files.upload.errors.quotaExceeded", "Storage quota exceeded. Please upgrade your plan or delete files."))) : (t({
|
|
168
168
|
status: "failed",
|
|
169
169
|
error: r
|
|
170
170
|
}), X("files.api.failed", {
|
|
@@ -173,30 +173,30 @@ function d() {
|
|
|
173
173
|
message: r
|
|
174
174
|
}));
|
|
175
175
|
}
|
|
176
|
-
},
|
|
177
|
-
|
|
176
|
+
}, un = (e) => {
|
|
177
|
+
qt.pause(), K((t) => t.map((t) => t.id === e ? {
|
|
178
178
|
...t,
|
|
179
179
|
status: "paused"
|
|
180
180
|
} : t));
|
|
181
|
-
},
|
|
182
|
-
let t =
|
|
183
|
-
t &&
|
|
184
|
-
},
|
|
185
|
-
let t =
|
|
181
|
+
}, dn = (e) => {
|
|
182
|
+
let t = Wt.find((t) => t.id === e);
|
|
183
|
+
t && ln(t);
|
|
184
|
+
}, fn = (e) => {
|
|
185
|
+
let t = Wt.find((t) => t.id === e);
|
|
186
186
|
t && (K((t) => t.map((t) => t.id === e ? {
|
|
187
187
|
...t,
|
|
188
188
|
status: "pending",
|
|
189
189
|
progress: 0,
|
|
190
190
|
error: void 0
|
|
191
|
-
} : t)),
|
|
192
|
-
},
|
|
191
|
+
} : t)), ln(t));
|
|
192
|
+
}, pn = (e) => {
|
|
193
193
|
K((t) => {
|
|
194
194
|
let n = t.filter((t) => t.id !== e);
|
|
195
195
|
return n.length === 0 && (q(!1), G(!1)), n;
|
|
196
196
|
});
|
|
197
|
-
},
|
|
198
|
-
if (!
|
|
199
|
-
|
|
197
|
+
}, mn = () => {
|
|
198
|
+
if (!p) {
|
|
199
|
+
x.error(a(d, "files.workspace.errors.notSelected", "Workspace not selected"));
|
|
200
200
|
return;
|
|
201
201
|
}
|
|
202
202
|
let e = document.createElement("input");
|
|
@@ -237,23 +237,23 @@ function d() {
|
|
|
237
237
|
}
|
|
238
238
|
}
|
|
239
239
|
K((e) => [...e, ...i]), q(!0), G(!0);
|
|
240
|
-
for (let e of i) await
|
|
241
|
-
G(!1),
|
|
240
|
+
for (let e of i) await ln(e);
|
|
241
|
+
G(!1), x.success(a(d, "files.upload.folder.success", "Uploaded {{count}} file{{plural}} from folder", {
|
|
242
242
|
count: i.length,
|
|
243
243
|
plural: i.length > 1 ? "s" : ""
|
|
244
244
|
}));
|
|
245
245
|
}
|
|
246
246
|
}, e.click();
|
|
247
|
-
},
|
|
247
|
+
}, hn = () => {
|
|
248
248
|
j(!0);
|
|
249
|
-
},
|
|
250
|
-
if (H.trim() &&
|
|
249
|
+
}, gn = async () => {
|
|
250
|
+
if (H.trim() && p) {
|
|
251
251
|
let { data: e, error: t } = await Z.mutateAsync({
|
|
252
252
|
name: H,
|
|
253
253
|
parentFolderId: f
|
|
254
254
|
});
|
|
255
255
|
if (t) {
|
|
256
|
-
Ie(t) ? (j(!1), U(""),
|
|
256
|
+
Ie(t) ? (j(!1), U(""), Ft(!0)) : (x.error(t instanceof Error ? t.message : a(d, "files.folder.errors.createFailed", "Folder creation failed")), X("files.api.failed", {
|
|
257
257
|
action: "createFolder",
|
|
258
258
|
message: t instanceof Error ? t.message : "Folder creation failed"
|
|
259
259
|
}));
|
|
@@ -264,13 +264,13 @@ function d() {
|
|
|
264
264
|
parentFolderId: f
|
|
265
265
|
}));
|
|
266
266
|
}
|
|
267
|
-
},
|
|
268
|
-
|
|
269
|
-
},
|
|
270
|
-
P(e),
|
|
271
|
-
},
|
|
272
|
-
P(e),
|
|
273
|
-
},
|
|
267
|
+
}, _n = (e) => {
|
|
268
|
+
kt(e);
|
|
269
|
+
}, vn = (e) => {
|
|
270
|
+
P(e), Rt(!0);
|
|
271
|
+
}, yn = (e) => {
|
|
272
|
+
P(e), Rt(!0);
|
|
273
|
+
}, bn = async (e) => {
|
|
274
274
|
if (!e.fileId && !e.folderId) throw Error(a(d, "files.share.errors.targetRequired", "Share requires a file id or folder id"));
|
|
275
275
|
let t = e.invitedEmail ? "EMAIL_INVITE" : "PUBLIC_LINK", n = "";
|
|
276
276
|
if (e.fileId) {
|
|
@@ -283,7 +283,7 @@ function d() {
|
|
|
283
283
|
shareType: t,
|
|
284
284
|
accessLevel: "DOWNLOAD"
|
|
285
285
|
};
|
|
286
|
-
n = (await
|
|
286
|
+
n = (await tn.mutateAsync(r))?.token ?? "", X("files.share.created", {
|
|
287
287
|
entityType: "file",
|
|
288
288
|
fileId: e.fileId,
|
|
289
289
|
shareType: t
|
|
@@ -298,7 +298,7 @@ function d() {
|
|
|
298
298
|
shareType: t,
|
|
299
299
|
accessLevel: "DOWNLOAD"
|
|
300
300
|
};
|
|
301
|
-
n = (await
|
|
301
|
+
n = (await nn.mutateAsync(r))?.createFolderShare?.token ?? "", X("files.share.created", {
|
|
302
302
|
entityType: "folder",
|
|
303
303
|
folderId: e.folderId,
|
|
304
304
|
shareType: t
|
|
@@ -308,7 +308,7 @@ function d() {
|
|
|
308
308
|
publicUrl: n ? `${window.location.origin}/files/share/${n}` : "",
|
|
309
309
|
token: n
|
|
310
310
|
};
|
|
311
|
-
},
|
|
311
|
+
}, xn = async (e) => {
|
|
312
312
|
Le("medium"), Y({
|
|
313
313
|
title: a(d, "files.confirm.deleteFile.title", "Delete file"),
|
|
314
314
|
description: a(d, "files.confirm.deleteFile.description", "Move \"{{name}}\" to the bin?", { name: e.name }),
|
|
@@ -316,13 +316,13 @@ function d() {
|
|
|
316
316
|
variant: "danger",
|
|
317
317
|
onConfirm: async () => {
|
|
318
318
|
try {
|
|
319
|
-
await
|
|
319
|
+
await Jt.mutateAsync({ id: e.id }), Re("success"), x.success(a(d, "files.file.delete.success", "\"{{name}}\" moved to bin", { name: e.name })), X("files.file.deleted", {
|
|
320
320
|
fileId: e.id,
|
|
321
321
|
fileName: e.name,
|
|
322
322
|
permanent: !1
|
|
323
323
|
});
|
|
324
324
|
} catch (t) {
|
|
325
|
-
|
|
325
|
+
x.error(t instanceof Error ? t.message : a(d, "files.file.errors.deleteFailed", "Failed to delete \"{{name}}\"", { name: e.name })), Re("error"), X("files.api.failed", {
|
|
326
326
|
action: "deleteFile",
|
|
327
327
|
fileId: e.id,
|
|
328
328
|
message: t instanceof Error ? t.message : "Failed to delete file"
|
|
@@ -330,16 +330,16 @@ function d() {
|
|
|
330
330
|
}
|
|
331
331
|
}
|
|
332
332
|
});
|
|
333
|
-
},
|
|
333
|
+
}, Sn = async (e) => {
|
|
334
334
|
try {
|
|
335
|
-
await
|
|
335
|
+
await Xt.mutateAsync({ id: e.id }), x.success(a(d, "files.file.restore.success", "\"{{name}}\" restored", { name: e.name })), X("files.file.restored", {
|
|
336
336
|
fileId: e.id,
|
|
337
337
|
fileName: e.name
|
|
338
338
|
});
|
|
339
339
|
} catch (e) {
|
|
340
|
-
|
|
340
|
+
x.error(e instanceof Error ? e.message : a(d, "files.file.errors.restoreFailed", "Failed to restore file"));
|
|
341
341
|
}
|
|
342
|
-
},
|
|
342
|
+
}, Cn = async (e) => {
|
|
343
343
|
Le("heavy"), Y({
|
|
344
344
|
title: a(d, "files.confirm.permanentDeleteFile.title", "Permanently delete file"),
|
|
345
345
|
description: a(d, "files.confirm.permanentDeleteFile.description", "Permanently delete \"{{name}}\"? This cannot be undone.", { name: e.name }),
|
|
@@ -347,19 +347,19 @@ function d() {
|
|
|
347
347
|
variant: "danger",
|
|
348
348
|
onConfirm: async () => {
|
|
349
349
|
try {
|
|
350
|
-
await
|
|
350
|
+
await Qt.mutateAsync({ id: e.id }), x.success(a(d, "files.file.permanentDelete.success", "\"{{name}}\" deleted permanently", { name: e.name })), X("files.file.deleted", {
|
|
351
351
|
fileId: e.id,
|
|
352
352
|
fileName: e.name,
|
|
353
353
|
permanent: !0
|
|
354
354
|
});
|
|
355
355
|
} catch (e) {
|
|
356
|
-
|
|
356
|
+
x.error(e instanceof Error ? e.message : a(d, "files.file.errors.permanentDeleteFailed", "Failed to permanently delete file"));
|
|
357
357
|
}
|
|
358
358
|
}
|
|
359
359
|
});
|
|
360
|
-
},
|
|
360
|
+
}, wn = async (e) => {
|
|
361
361
|
try {
|
|
362
|
-
await
|
|
362
|
+
await en.mutateAsync({
|
|
363
363
|
id: e.id,
|
|
364
364
|
type: "file"
|
|
365
365
|
}), X("files.file.starred", {
|
|
@@ -368,47 +368,47 @@ function d() {
|
|
|
368
368
|
starred: !e.starred
|
|
369
369
|
});
|
|
370
370
|
} catch {
|
|
371
|
-
|
|
371
|
+
x.error(a(d, "files.file.errors.starFailed", "Failed to update starred state")), X("files.api.failed", {
|
|
372
372
|
action: "toggleFileStar",
|
|
373
373
|
fileId: e.id
|
|
374
374
|
});
|
|
375
375
|
}
|
|
376
|
-
},
|
|
376
|
+
}, Tn = (e) => {
|
|
377
377
|
z({
|
|
378
378
|
id: e.id,
|
|
379
379
|
name: e.name,
|
|
380
380
|
type: "file"
|
|
381
381
|
}), V(e.name), M(!0);
|
|
382
|
-
},
|
|
382
|
+
}, En = async (e) => {
|
|
383
383
|
try {
|
|
384
384
|
let t = e.downloadUrl || e.url;
|
|
385
385
|
if (!t) throw Error(a(d, "files.file.errors.downloadUrlUnavailable", "Download URL is unavailable"));
|
|
386
386
|
let n = document.createElement("a");
|
|
387
|
-
n.style.display = "none", n.href = t, n.download = e.name, n.rel = "noopener noreferrer", document.body.appendChild(n), n.click(), document.body.removeChild(n),
|
|
387
|
+
n.style.display = "none", n.href = t, n.download = e.name, n.rel = "noopener noreferrer", document.body.appendChild(n), n.click(), document.body.removeChild(n), x.success(a(d, "files.file.download.success", "Downloaded {{name}}", { name: e.name })), X("files.file.downloaded", {
|
|
388
388
|
fileId: e.id,
|
|
389
389
|
fileName: e.name
|
|
390
390
|
});
|
|
391
391
|
} catch (e) {
|
|
392
|
-
|
|
392
|
+
x.error(e instanceof Error ? e.message : a(d, "files.file.errors.downloadFailed", "Failed to download file"));
|
|
393
393
|
}
|
|
394
|
-
},
|
|
395
|
-
|
|
394
|
+
}, Dn = (e) => {
|
|
395
|
+
Ut({
|
|
396
396
|
item: e,
|
|
397
397
|
type: "file"
|
|
398
|
-
}),
|
|
399
|
-
},
|
|
398
|
+
}), Vt(!0);
|
|
399
|
+
}, On = (e) => {
|
|
400
400
|
I({
|
|
401
401
|
item: e,
|
|
402
402
|
type: "file"
|
|
403
|
-
}),
|
|
404
|
-
},
|
|
405
|
-
|
|
403
|
+
}), N(!0);
|
|
404
|
+
}, kn = (e) => {
|
|
405
|
+
Ot({
|
|
406
406
|
item: e,
|
|
407
407
|
type: "file"
|
|
408
408
|
});
|
|
409
|
-
},
|
|
410
|
-
|
|
411
|
-
},
|
|
409
|
+
}, An = (e) => {
|
|
410
|
+
gt(`/files/browse/${e.id}`);
|
|
411
|
+
}, jn = async (e) => {
|
|
412
412
|
Le("medium"), Y({
|
|
413
413
|
title: a(d, "files.confirm.deleteFolder.title", "Delete folder"),
|
|
414
414
|
description: a(d, "files.confirm.deleteFolder.description", "Move folder \"{{name}}\" and all its contents to the bin?", { name: e.name }),
|
|
@@ -416,29 +416,29 @@ function d() {
|
|
|
416
416
|
variant: "danger",
|
|
417
417
|
onConfirm: async () => {
|
|
418
418
|
try {
|
|
419
|
-
await
|
|
419
|
+
await Yt.mutateAsync({
|
|
420
420
|
id: e.id,
|
|
421
421
|
recursive: !0
|
|
422
|
-
}),
|
|
422
|
+
}), x.success(a(d, "files.folder.delete.success", "\"{{name}}\" moved to bin", { name: e.name })), X("files.folder.deleted", {
|
|
423
423
|
folderId: e.id,
|
|
424
424
|
folderName: e.name,
|
|
425
425
|
permanent: !1
|
|
426
426
|
});
|
|
427
427
|
} catch (e) {
|
|
428
|
-
|
|
428
|
+
x.error(e instanceof Error ? e.message : a(d, "files.folder.errors.deleteFailed", "Failed to delete folder"));
|
|
429
429
|
}
|
|
430
430
|
}
|
|
431
431
|
});
|
|
432
|
-
},
|
|
432
|
+
}, Mn = async (e) => {
|
|
433
433
|
try {
|
|
434
|
-
await
|
|
434
|
+
await Zt.mutateAsync({ id: e.id }), x.success(a(d, "files.folder.restore.success", "\"{{name}}\" restored", { name: e.name })), X("files.folder.restored", {
|
|
435
435
|
folderId: e.id,
|
|
436
436
|
folderName: e.name
|
|
437
437
|
});
|
|
438
438
|
} catch (e) {
|
|
439
|
-
|
|
439
|
+
x.error(e instanceof Error ? e.message : a(d, "files.folder.errors.restoreFailed", "Failed to restore folder"));
|
|
440
440
|
}
|
|
441
|
-
},
|
|
441
|
+
}, Nn = async (e) => {
|
|
442
442
|
Y({
|
|
443
443
|
title: a(d, "files.confirm.permanentDeleteFolder.title", "Permanently delete folder"),
|
|
444
444
|
description: a(d, "files.confirm.permanentDeleteFolder.description", "Permanently delete folder \"{{name}}\" and its contents? This cannot be undone.", { name: e.name }),
|
|
@@ -446,30 +446,30 @@ function d() {
|
|
|
446
446
|
variant: "danger",
|
|
447
447
|
onConfirm: async () => {
|
|
448
448
|
try {
|
|
449
|
-
await
|
|
449
|
+
await $t.mutateAsync({ id: e.id }), x.success(a(d, "files.folder.permanentDelete.success", "\"{{name}}\" deleted permanently", { name: e.name })), X("files.folder.deleted", {
|
|
450
450
|
folderId: e.id,
|
|
451
451
|
folderName: e.name,
|
|
452
452
|
permanent: !0
|
|
453
453
|
});
|
|
454
454
|
} catch (e) {
|
|
455
|
-
|
|
455
|
+
x.error(e instanceof Error ? e.message : a(d, "files.folder.errors.permanentDeleteFailed", "Failed to permanently delete folder"));
|
|
456
456
|
}
|
|
457
457
|
}
|
|
458
458
|
});
|
|
459
|
-
},
|
|
459
|
+
}, Pn = (e) => {
|
|
460
460
|
z({
|
|
461
461
|
id: e.id,
|
|
462
462
|
name: e.name,
|
|
463
463
|
type: "folder"
|
|
464
464
|
}), V(e.name), M(!0);
|
|
465
|
-
},
|
|
465
|
+
}, Fn = (e) => {
|
|
466
466
|
I({
|
|
467
467
|
item: e,
|
|
468
468
|
type: "folder"
|
|
469
|
-
}),
|
|
470
|
-
},
|
|
469
|
+
}), N(!0);
|
|
470
|
+
}, In = async (e) => {
|
|
471
471
|
try {
|
|
472
|
-
await
|
|
472
|
+
await en.mutateAsync({
|
|
473
473
|
id: e.id,
|
|
474
474
|
type: "folder"
|
|
475
475
|
}), X("files.folder.starred", {
|
|
@@ -478,80 +478,80 @@ function d() {
|
|
|
478
478
|
starred: !e.starred
|
|
479
479
|
});
|
|
480
480
|
} catch {
|
|
481
|
-
|
|
481
|
+
x.error(a(d, "files.folder.errors.starFailed", "Failed to update starred state")), X("files.api.failed", {
|
|
482
482
|
action: "toggleFolderStar",
|
|
483
483
|
folderId: e.id
|
|
484
484
|
});
|
|
485
485
|
}
|
|
486
|
-
},
|
|
487
|
-
|
|
486
|
+
}, Ln = (e) => {
|
|
487
|
+
Ot({
|
|
488
488
|
item: e,
|
|
489
489
|
type: "folder"
|
|
490
490
|
});
|
|
491
|
-
},
|
|
491
|
+
}, Rn = async (e) => {
|
|
492
492
|
if (F) try {
|
|
493
|
-
F.type === "file" ? (await
|
|
493
|
+
F.type === "file" ? (await an.mutateAsync({
|
|
494
494
|
fileId: F.item.id,
|
|
495
495
|
targetFolderId: e || null
|
|
496
|
-
}),
|
|
496
|
+
}), x.success(a(d, "files.file.move.success", "\"{{name}}\" moved", { name: F.item.name })), X("files.file.moved", {
|
|
497
497
|
fileId: F.item.id,
|
|
498
498
|
fileName: F.item.name,
|
|
499
499
|
destinationFolderId: e
|
|
500
|
-
})) : (await
|
|
500
|
+
})) : (await on.mutateAsync({
|
|
501
501
|
folderId: F.item.id,
|
|
502
502
|
targetParentFolderId: e
|
|
503
|
-
}),
|
|
503
|
+
}), x.success(a(d, "files.folder.move.success", "\"{{name}}\" moved", { name: F.item.name })), X("files.folder.moved", {
|
|
504
504
|
folderId: F.item.id,
|
|
505
505
|
folderName: F.item.name,
|
|
506
506
|
destinationFolderId: e
|
|
507
|
-
})),
|
|
507
|
+
})), N(!1), I(null);
|
|
508
508
|
} catch (e) {
|
|
509
|
-
|
|
509
|
+
x.error(e instanceof Error ? e.message : a(d, "files.item.errors.moveFailed", "Failed to move \"{{name}}\"", { name: F.item.name })), X("files.api.failed", {
|
|
510
510
|
action: F.type === "file" ? "moveFile" : "moveFolder",
|
|
511
511
|
itemId: F.item.id,
|
|
512
512
|
itemType: F.type,
|
|
513
513
|
message: e instanceof Error ? e.message : void 0
|
|
514
514
|
});
|
|
515
515
|
}
|
|
516
|
-
},
|
|
516
|
+
}, zn = async (e, t) => {
|
|
517
517
|
if (L) try {
|
|
518
518
|
if (L.type !== "file") throw Error(a(d, "files.folder.errors.copyUnsupported", "Folder copy is not supported"));
|
|
519
|
-
await
|
|
519
|
+
await rn.mutateAsync({
|
|
520
520
|
id: L.item.id,
|
|
521
521
|
newName: t || `Copy of ${L.item.name}`,
|
|
522
522
|
targetFolderId: e || void 0
|
|
523
|
-
}),
|
|
523
|
+
}), x.success(a(d, "files.file.copy.success", "\"{{name}}\" copied", { name: L.item.name })), X("files.file.copied", {
|
|
524
524
|
fileId: L.item.id,
|
|
525
525
|
fileName: L.item.name,
|
|
526
526
|
destinationFolderId: e
|
|
527
|
-
}),
|
|
527
|
+
}), Vt(!1), Ut(null);
|
|
528
528
|
} catch (e) {
|
|
529
|
-
|
|
529
|
+
x.error(e instanceof Error ? e.message : a(d, "files.file.errors.copyFailed", "Failed to copy \"{{name}}\"", { name: L.item.name })), X("files.api.failed", {
|
|
530
530
|
action: "copyFile",
|
|
531
531
|
fileId: L.item.id,
|
|
532
532
|
message: e instanceof Error ? e.message : void 0
|
|
533
533
|
});
|
|
534
534
|
}
|
|
535
|
-
},
|
|
535
|
+
}, Bn = async () => {
|
|
536
536
|
if (!(!R || !B.trim())) try {
|
|
537
537
|
let e = R.name, t = B.trim();
|
|
538
538
|
R.type === "file" ? (await Q.mutateAsync({
|
|
539
539
|
fileId: R.id,
|
|
540
540
|
newName: t
|
|
541
|
-
}),
|
|
541
|
+
}), x.success(a(d, "files.file.rename.success", "Renamed \"{{name}}\"", { name: t })), X("files.file.renamed", {
|
|
542
542
|
fileId: R.id,
|
|
543
543
|
previousName: e,
|
|
544
544
|
name: t
|
|
545
545
|
})) : (await $.mutateAsync({
|
|
546
546
|
folderId: R.id,
|
|
547
547
|
newName: t
|
|
548
|
-
}),
|
|
548
|
+
}), x.success(a(d, "files.folder.rename.success", "Renamed \"{{name}}\"", { name: t })), X("files.folder.renamed", {
|
|
549
549
|
folderId: R.id,
|
|
550
550
|
previousName: e,
|
|
551
551
|
name: t
|
|
552
552
|
})), M(!1), z(null), V("");
|
|
553
553
|
} catch (e) {
|
|
554
|
-
|
|
554
|
+
x.error(e instanceof Error ? e.message : a(d, "files.item.errors.renameFailed", "Failed to rename {{type}}", { type: R.type })), X("files.api.failed", {
|
|
555
555
|
action: R.type === "file" ? "renameFile" : "renameFolder",
|
|
556
556
|
itemId: R.id,
|
|
557
557
|
itemType: R.type,
|
|
@@ -562,18 +562,18 @@ function d() {
|
|
|
562
562
|
return n({
|
|
563
563
|
files: T,
|
|
564
564
|
folders: E,
|
|
565
|
-
onFilePreview:
|
|
566
|
-
onFileDelete:
|
|
567
|
-
onFolderOpen:
|
|
568
|
-
onFolderDelete:
|
|
569
|
-
activeTab:
|
|
570
|
-
}),
|
|
565
|
+
onFilePreview: _n,
|
|
566
|
+
onFileDelete: xn,
|
|
567
|
+
onFolderOpen: An,
|
|
568
|
+
onFolderDelete: jn,
|
|
569
|
+
activeTab: g
|
|
570
|
+
}), p === void 0 ? /* @__PURE__ */ l("div", {
|
|
571
571
|
className: "flex flex-col items-center justify-center min-h-[60vh] gap-3 text-center px-6",
|
|
572
572
|
children: [/* @__PURE__ */ c(s, { className: "size-8 animate-spin text-text-tertiary" }), /* @__PURE__ */ c("p", {
|
|
573
573
|
className: "text-sm text-text-secondary max-w-md",
|
|
574
574
|
children: a(d, "files.browser.workspace.waiting", "Waiting for workspace context. If this persists, the app shell may not have provided a workspaceId to the Files module. Try reloading the page or switching workspaces.")
|
|
575
575
|
})]
|
|
576
|
-
}) :
|
|
576
|
+
}) : p === "" ? /* @__PURE__ */ l("div", {
|
|
577
577
|
className: "flex flex-col items-center justify-center min-h-[60vh] gap-3 text-center px-6",
|
|
578
578
|
children: [/* @__PURE__ */ c(Ge, { className: "size-8 text-text-tertiary" }), /* @__PURE__ */ c("p", {
|
|
579
579
|
className: "text-sm text-text-secondary max-w-md",
|
|
@@ -582,44 +582,92 @@ function d() {
|
|
|
582
582
|
}) : /* @__PURE__ */ l("div", {
|
|
583
583
|
className: "min-h-screen bg-bg-surface",
|
|
584
584
|
children: [
|
|
585
|
-
/* @__PURE__ */
|
|
586
|
-
className: "bg-bg-surface border-b border-border-seam px-4 py-3 sm:px-6 sm:py-4",
|
|
585
|
+
/* @__PURE__ */ l("div", {
|
|
586
|
+
className: "relative overflow-hidden bg-bg-surface border-b border-border-seam px-4 py-3 sm:px-6 sm:py-4",
|
|
587
587
|
"data-tour": "files-breadcrumb-nav",
|
|
588
|
-
children:
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
className: "
|
|
592
|
-
children:
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
children: a(d, "files.browser.rootLabel", "My Drive")
|
|
600
|
-
})]
|
|
601
|
-
}), ht.map((e, t) => /* @__PURE__ */ l("div", {
|
|
602
|
-
className: "flex items-center gap-1 sm:gap-2",
|
|
603
|
-
children: [/* @__PURE__ */ c("span", {
|
|
604
|
-
className: "text-text-tertiary",
|
|
605
|
-
children: "/"
|
|
606
|
-
}), /* @__PURE__ */ c("button", {
|
|
588
|
+
children: [
|
|
589
|
+
/* @__PURE__ */ c(rt, { intensity: "subtle" }),
|
|
590
|
+
/* @__PURE__ */ c("h1", {
|
|
591
|
+
className: "mb-2 text-lg font-semibold tracking-tight sm:text-xl",
|
|
592
|
+
children: /* @__PURE__ */ c(ot, { children: a(d, "files.browser.rootLabel", "My Drive") })
|
|
593
|
+
}),
|
|
594
|
+
/* @__PURE__ */ c("div", {
|
|
595
|
+
className: "flex items-center gap-2 sm:gap-4",
|
|
596
|
+
children: /* @__PURE__ */ l("div", {
|
|
597
|
+
className: "flex items-center gap-1 sm:gap-2 text-sm overflow-x-auto",
|
|
598
|
+
children: [/* @__PURE__ */ l("button", {
|
|
607
599
|
type: "button",
|
|
608
|
-
onClick: () =>
|
|
609
|
-
className:
|
|
610
|
-
title:
|
|
611
|
-
children:
|
|
612
|
-
|
|
613
|
-
|
|
600
|
+
onClick: () => gt("/files/browse"),
|
|
601
|
+
className: "flex items-center gap-1 text-text-primary hover:bg-action-ghost-bg-hover px-2 py-1 rounded transition-colors duration-200 whitespace-nowrap",
|
|
602
|
+
title: a(d, "files.browser.actions.goToRoot", "Go to root"),
|
|
603
|
+
children: [/* @__PURE__ */ c(qe, { className: "size-4" }), /* @__PURE__ */ c("span", {
|
|
604
|
+
className: "hidden sm:inline",
|
|
605
|
+
children: a(d, "files.browser.rootLabel", "My Drive")
|
|
606
|
+
})]
|
|
607
|
+
}), xt.map((e, t) => /* @__PURE__ */ l("div", {
|
|
608
|
+
className: "flex items-center gap-1 sm:gap-2",
|
|
609
|
+
children: [/* @__PURE__ */ c("span", {
|
|
610
|
+
className: "text-text-tertiary",
|
|
611
|
+
children: "/"
|
|
612
|
+
}), /* @__PURE__ */ c("button", {
|
|
613
|
+
type: "button",
|
|
614
|
+
onClick: () => gt(`/files/browse/${e.id}`),
|
|
615
|
+
className: `hover:bg-action-ghost-bg-hover px-2 py-1 rounded transition-colors duration-200 whitespace-nowrap ${t === xt.length - 1 ? "text-text-primary font-medium" : "text-text-secondary"}`,
|
|
616
|
+
title: `Go to ${e.name}`,
|
|
617
|
+
children: e.name
|
|
618
|
+
})]
|
|
619
|
+
}, e.id))]
|
|
620
|
+
})
|
|
621
|
+
}),
|
|
622
|
+
/* @__PURE__ */ c(ut, {
|
|
623
|
+
className: "relative mt-2 max-w-3xl",
|
|
624
|
+
children: a(d, "files.browser.purpose", "Your workspace drive: upload, organise and share documents, images, videos and more with your team. Browse folders, star what you use often, search across everything, and recover deleted items from the Bin.")
|
|
614
625
|
})
|
|
626
|
+
]
|
|
627
|
+
}),
|
|
628
|
+
!y && /* @__PURE__ */ c("div", {
|
|
629
|
+
className: "px-4 pt-3 sm:px-6",
|
|
630
|
+
children: /* @__PURE__ */ c(lt, {
|
|
631
|
+
storageKey: "files-browser",
|
|
632
|
+
title: a(d, "files.browser.nextSteps.title", "Get started with Files"),
|
|
633
|
+
steps: [
|
|
634
|
+
{
|
|
635
|
+
id: "upload",
|
|
636
|
+
label: a(d, "files.browser.nextSteps.upload.label", "Upload your first files"),
|
|
637
|
+
description: a(d, "files.browser.nextSteps.upload.description", "Add documents, images or videos to this drive."),
|
|
638
|
+
icon: /* @__PURE__ */ c(Ze, { className: "size-4" }),
|
|
639
|
+
onClick: cn
|
|
640
|
+
},
|
|
641
|
+
{
|
|
642
|
+
id: "new-folder",
|
|
643
|
+
label: a(d, "files.browser.nextSteps.newFolder.label", "Create a folder to organise"),
|
|
644
|
+
description: a(d, "files.browser.nextSteps.newFolder.description", "Group related files so they are easy to find later."),
|
|
645
|
+
icon: /* @__PURE__ */ c(Ue, { className: "size-4" }),
|
|
646
|
+
onClick: hn
|
|
647
|
+
},
|
|
648
|
+
{
|
|
649
|
+
id: "starred",
|
|
650
|
+
label: a(d, "files.browser.nextSteps.starred.label", "Star items you use often"),
|
|
651
|
+
description: a(d, "files.browser.nextSteps.starred.description", "Starred files and folders show up under the Starred tab."),
|
|
652
|
+
icon: /* @__PURE__ */ c(Ye, { className: "size-4" }),
|
|
653
|
+
onClick: () => _("starred")
|
|
654
|
+
},
|
|
655
|
+
{
|
|
656
|
+
id: "bin",
|
|
657
|
+
label: a(d, "files.browser.nextSteps.bin.label", "Recover deleted items from the Bin"),
|
|
658
|
+
description: a(d, "files.browser.nextSteps.bin.description", "Deleted files stay in the Bin so you can restore them."),
|
|
659
|
+
icon: /* @__PURE__ */ c(Xe, { className: "size-4" }),
|
|
660
|
+
onClick: () => _("bin")
|
|
661
|
+
}
|
|
662
|
+
]
|
|
615
663
|
})
|
|
616
664
|
}),
|
|
617
665
|
/* @__PURE__ */ c("div", {
|
|
618
666
|
"data-tour": "files-tab-bar",
|
|
619
667
|
children: /* @__PURE__ */ c(Ce, {
|
|
620
|
-
activeTab:
|
|
621
|
-
onTabChange:
|
|
622
|
-
tabs:
|
|
668
|
+
activeTab: g,
|
|
669
|
+
onTabChange: _,
|
|
670
|
+
tabs: Ct
|
|
623
671
|
})
|
|
624
672
|
}),
|
|
625
673
|
/* @__PURE__ */ l("div", {
|
|
@@ -634,21 +682,21 @@ function d() {
|
|
|
634
682
|
className: "relative w-full max-w-2xl",
|
|
635
683
|
children: /* @__PURE__ */ c(ke, {
|
|
636
684
|
onSearch: (e, t) => {
|
|
637
|
-
|
|
685
|
+
wt(e), Et(t);
|
|
638
686
|
},
|
|
639
687
|
placeholder: a(d, "files.search.input.placeholder", "Search files and folders..."),
|
|
640
|
-
initialQuery:
|
|
688
|
+
initialQuery: v,
|
|
641
689
|
showFilters: !0
|
|
642
690
|
})
|
|
643
691
|
})
|
|
644
692
|
}), /* @__PURE__ */ l("div", {
|
|
645
693
|
className: "flex items-center gap-2 order-1 sm:order-2 w-full sm:w-auto justify-between sm:justify-end",
|
|
646
|
-
children: [!
|
|
694
|
+
children: [!y && /* @__PURE__ */ c("div", {
|
|
647
695
|
"data-tour": "files-upload-files-button",
|
|
648
|
-
children: /* @__PURE__ */ c(
|
|
696
|
+
children: /* @__PURE__ */ c(it, {
|
|
649
697
|
primary: {
|
|
650
698
|
label: W ? a(d, "files.browser.upload.uploading", "Uploading...") : a(d, "files.browser.actions.uploadFiles", "Upload Files"),
|
|
651
|
-
onSelect:
|
|
699
|
+
onSelect: cn,
|
|
652
700
|
disabled: W,
|
|
653
701
|
icon: W ? /* @__PURE__ */ c(s, { className: "size-4 animate-spin" }) : /* @__PURE__ */ c(Ze, { className: "size-4" })
|
|
654
702
|
},
|
|
@@ -656,12 +704,12 @@ function d() {
|
|
|
656
704
|
{
|
|
657
705
|
label: a(d, "files.browser.actions.newFolder", "New Folder"),
|
|
658
706
|
icon: /* @__PURE__ */ c(Ue, { className: "size-4" }),
|
|
659
|
-
onSelect:
|
|
707
|
+
onSelect: hn
|
|
660
708
|
},
|
|
661
709
|
{
|
|
662
710
|
label: a(d, "files.browser.actions.uploadFolder", "Upload Folder"),
|
|
663
711
|
icon: /* @__PURE__ */ c(We, { className: "size-4" }),
|
|
664
|
-
onSelect:
|
|
712
|
+
onSelect: mn,
|
|
665
713
|
disabled: W
|
|
666
714
|
},
|
|
667
715
|
...T.length > 0 || E.length > 0 ? [{
|
|
@@ -678,33 +726,33 @@ function d() {
|
|
|
678
726
|
"data-tour": "files-view-mode-toggle",
|
|
679
727
|
children: [/* @__PURE__ */ c("button", {
|
|
680
728
|
type: "button",
|
|
681
|
-
onClick: () =>
|
|
682
|
-
className: `p-2 transition-colors duration-200 ${
|
|
729
|
+
onClick: () => bt("grid"),
|
|
730
|
+
className: `p-2 transition-colors duration-200 ${yt === "grid" ? "bg-bg-accent text-text-link" : "text-text-secondary hover:bg-action-ghost-bg-hover"}`,
|
|
683
731
|
"aria-label": a(d, "files.browser.view.grid", "Grid view"),
|
|
684
732
|
children: /* @__PURE__ */ c(Ke, { className: "size-5" })
|
|
685
733
|
}), /* @__PURE__ */ c("button", {
|
|
686
734
|
type: "button",
|
|
687
|
-
onClick: () =>
|
|
688
|
-
className: `p-2 transition-colors duration-200 ${
|
|
735
|
+
onClick: () => bt("list"),
|
|
736
|
+
className: `p-2 transition-colors duration-200 ${yt === "list" ? "bg-bg-accent text-text-link" : "text-text-secondary hover:bg-action-ghost-bg-hover"}`,
|
|
689
737
|
"aria-label": a(d, "files.browser.view.list", "List view"),
|
|
690
738
|
children: /* @__PURE__ */ c(Je, { className: "size-5" })
|
|
691
739
|
})]
|
|
692
740
|
})]
|
|
693
741
|
})]
|
|
694
742
|
}),
|
|
695
|
-
|
|
743
|
+
y && /* @__PURE__ */ l("div", {
|
|
696
744
|
className: "mt-3 flex items-center justify-between p-3 bg-status-success-bg-subtle rounded-lg border border-status-success-border transition-all duration-200",
|
|
697
745
|
children: [/* @__PURE__ */ l("span", {
|
|
698
746
|
className: "text-sm font-medium text-status-success-text",
|
|
699
|
-
children: [a(d, "files.browser.search.showingResults", "Showing search results for \"{{query}}\"", { query:
|
|
747
|
+
children: [a(d, "files.browser.search.showingResults", "Showing search results for \"{{query}}\"", { query: v }), w.data && ` (${(w.data.files?.length || 0) + (w.data.folders?.length || 0)} items)`]
|
|
700
748
|
}), /* @__PURE__ */ l("button", {
|
|
701
749
|
type: "button",
|
|
702
|
-
onClick: () =>
|
|
750
|
+
onClick: () => wt(""),
|
|
703
751
|
className: "flex items-center gap-2 text-status-success-text hover:text-status-success-text/80 text-sm font-medium transition-colors duration-200",
|
|
704
752
|
children: [/* @__PURE__ */ c(Qe, { className: "size-4" }), a(d, "files.browser.search.clear", "Clear search")]
|
|
705
753
|
})]
|
|
706
754
|
}),
|
|
707
|
-
A > 0 && /* @__PURE__ */ l(
|
|
755
|
+
A > 0 && /* @__PURE__ */ l(at, {
|
|
708
756
|
className: "mt-3 flex items-center justify-between p-3",
|
|
709
757
|
children: [/* @__PURE__ */ l("div", {
|
|
710
758
|
className: "flex items-center gap-4",
|
|
@@ -716,13 +764,13 @@ function d() {
|
|
|
716
764
|
})
|
|
717
765
|
}), /* @__PURE__ */ c("div", {
|
|
718
766
|
className: "flex items-center gap-2",
|
|
719
|
-
children:
|
|
767
|
+
children: g === "bin" ? /* @__PURE__ */ l($e, { children: [/* @__PURE__ */ c("button", {
|
|
720
768
|
type: "button",
|
|
721
769
|
onClick: async () => {
|
|
722
770
|
try {
|
|
723
|
-
await Promise.all([...Array.from(
|
|
771
|
+
await Promise.all([...Array.from(St).map((e) => Xt.mutateAsync({ id: e })), ...Array.from(m).map((e) => Zt.mutateAsync({ id: e }))]), h(), x.success(`${A} item${A > 1 ? "s" : ""} restored`);
|
|
724
772
|
} catch (e) {
|
|
725
|
-
|
|
773
|
+
x.error(e instanceof Error ? e.message : "Failed to restore some items");
|
|
726
774
|
}
|
|
727
775
|
},
|
|
728
776
|
className: "flex items-center gap-1.5 rounded-lg border border-status-success-border bg-bg-surface px-3 py-1.5 text-sm font-medium text-status-success-text transition-colors duration-200 hover:bg-status-success-bg-subtle",
|
|
@@ -740,12 +788,12 @@ function d() {
|
|
|
740
788
|
variant: "danger",
|
|
741
789
|
onConfirm: async () => {
|
|
742
790
|
try {
|
|
743
|
-
await Promise.all([...Array.from(
|
|
791
|
+
await Promise.all([...Array.from(St).map((e) => Qt.mutateAsync({ id: e })), ...Array.from(m).map((e) => $t.mutateAsync({ id: e }))]), h(), x.success(a(d, "files.bulk.permanentDelete.success", "{{count}} item{{plural}} deleted permanently", {
|
|
744
792
|
count: A,
|
|
745
793
|
plural: A > 1 ? "s" : ""
|
|
746
794
|
}));
|
|
747
795
|
} catch (e) {
|
|
748
|
-
|
|
796
|
+
x.error(e instanceof Error ? e.message : a(d, "files.bulk.errors.permanentDeleteFailed", "Failed to permanently delete some items"));
|
|
749
797
|
}
|
|
750
798
|
}
|
|
751
799
|
});
|
|
@@ -765,16 +813,16 @@ function d() {
|
|
|
765
813
|
variant: "danger",
|
|
766
814
|
onConfirm: async () => {
|
|
767
815
|
try {
|
|
768
|
-
let e = Array.from(
|
|
769
|
-
e.length > 0 && await
|
|
816
|
+
let e = Array.from(St), t = Array.from(m);
|
|
817
|
+
e.length > 0 && await sn.mutateAsync(e), await Promise.all(t.map((e) => Yt.mutateAsync({
|
|
770
818
|
id: e,
|
|
771
819
|
recursive: !0
|
|
772
|
-
}))),
|
|
820
|
+
}))), h(), x.success(a(d, "files.bulk.delete.success", "{{count}} item{{plural}} moved to bin", {
|
|
773
821
|
count: A,
|
|
774
822
|
plural: A > 1 ? "s" : ""
|
|
775
823
|
}));
|
|
776
824
|
} catch (e) {
|
|
777
|
-
|
|
825
|
+
x.error(e instanceof Error ? e.message : a(d, "files.bulk.errors.deleteFailed", "Failed to delete some items"));
|
|
778
826
|
}
|
|
779
827
|
}
|
|
780
828
|
});
|
|
@@ -785,16 +833,16 @@ function d() {
|
|
|
785
833
|
})]
|
|
786
834
|
}), /* @__PURE__ */ l("button", {
|
|
787
835
|
type: "button",
|
|
788
|
-
onClick:
|
|
836
|
+
onClick: h,
|
|
789
837
|
className: "flex items-center gap-2 text-text-link hover:text-action-primary-bg-hover text-sm font-medium transition-colors duration-200",
|
|
790
838
|
children: [/* @__PURE__ */ c(Qe, { className: "size-4" }), a(d, "files.common.actions.clear", "Clear")]
|
|
791
839
|
})]
|
|
792
840
|
})
|
|
793
841
|
]
|
|
794
842
|
}),
|
|
795
|
-
(
|
|
843
|
+
(vt.isExhausted || vt.isNearLimit) && /* @__PURE__ */ c("div", {
|
|
796
844
|
className: "px-4 sm:px-6 pt-3",
|
|
797
|
-
children: /* @__PURE__ */ c(Pe, { quota:
|
|
845
|
+
children: /* @__PURE__ */ c(Pe, { quota: vt })
|
|
798
846
|
}),
|
|
799
847
|
/* @__PURE__ */ l("div", {
|
|
800
848
|
className: "px-2 sm:px-4 md:px-6 py-3 sm:py-4",
|
|
@@ -805,56 +853,56 @@ function d() {
|
|
|
805
853
|
loading: D,
|
|
806
854
|
error: O,
|
|
807
855
|
preserveSortOrder: k,
|
|
808
|
-
onFilePreview:
|
|
809
|
-
onFileShare:
|
|
810
|
-
onFileDelete:
|
|
811
|
-
onFileRestore:
|
|
812
|
-
onFileFavorite:
|
|
813
|
-
onFileRename:
|
|
814
|
-
onFileDownload:
|
|
815
|
-
onFileCopy:
|
|
816
|
-
onFileMove:
|
|
817
|
-
onFileInfo:
|
|
818
|
-
onFolderOpen:
|
|
819
|
-
onFolderShare:
|
|
820
|
-
onFolderDelete:
|
|
821
|
-
onFolderRestore:
|
|
822
|
-
onFolderRename:
|
|
823
|
-
onFolderFavorite:
|
|
824
|
-
onFolderMove:
|
|
825
|
-
onFolderInfo:
|
|
856
|
+
onFilePreview: _n,
|
|
857
|
+
onFileShare: g === "bin" ? void 0 : vn,
|
|
858
|
+
onFileDelete: g === "bin" ? Cn : xn,
|
|
859
|
+
onFileRestore: g === "bin" ? Sn : void 0,
|
|
860
|
+
onFileFavorite: g === "bin" ? void 0 : wn,
|
|
861
|
+
onFileRename: g === "bin" ? void 0 : Tn,
|
|
862
|
+
onFileDownload: En,
|
|
863
|
+
onFileCopy: g === "bin" ? void 0 : Dn,
|
|
864
|
+
onFileMove: g === "bin" ? void 0 : On,
|
|
865
|
+
onFileInfo: kn,
|
|
866
|
+
onFolderOpen: An,
|
|
867
|
+
onFolderShare: g === "bin" ? void 0 : yn,
|
|
868
|
+
onFolderDelete: g === "bin" ? Nn : jn,
|
|
869
|
+
onFolderRestore: g === "bin" ? Mn : void 0,
|
|
870
|
+
onFolderRename: g === "bin" ? void 0 : Pn,
|
|
871
|
+
onFolderFavorite: g === "bin" ? void 0 : In,
|
|
872
|
+
onFolderMove: g === "bin" ? void 0 : Fn,
|
|
873
|
+
onFolderInfo: Ln
|
|
826
874
|
}), !D && (T.length > 0 || E.length > 0) && /* @__PURE__ */ l("div", {
|
|
827
875
|
className: "mt-4 px-2 text-sm text-text-secondary",
|
|
828
|
-
children: [a(d, "files.browser.results.showingItems", "Showing {{count}} items", { count: T.length + E.length }), !
|
|
876
|
+
children: [a(d, "files.browser.results.showingItems", "Showing {{count}} items", { count: T.length + E.length }), !y && g === "all" && Mt !== null && ` ${a(d, "files.browser.results.ofItems", "of {{count}} items", { count: Mt })}`]
|
|
829
877
|
})]
|
|
830
878
|
}),
|
|
831
|
-
|
|
879
|
+
Nt && /* @__PURE__ */ c(dt, {
|
|
832
880
|
open: !0,
|
|
833
881
|
onOpenChange: (e) => {
|
|
834
882
|
!e && !Z.isPending && (j(!1), U(""));
|
|
835
883
|
},
|
|
836
|
-
children: /* @__PURE__ */ l(
|
|
884
|
+
children: /* @__PURE__ */ l(ft, {
|
|
837
885
|
className: "w-full max-w-xs",
|
|
838
886
|
children: [
|
|
839
|
-
/* @__PURE__ */ c(
|
|
887
|
+
/* @__PURE__ */ c(mt, {
|
|
840
888
|
className: "text-left",
|
|
841
|
-
children: /* @__PURE__ */ c(
|
|
889
|
+
children: /* @__PURE__ */ c(ht, {
|
|
842
890
|
id: "files-new-folder-title",
|
|
843
891
|
className: "text-base font-semibold text-text-primary",
|
|
844
892
|
children: a(d, "files.browser.newFolderDialog.title", "New folder")
|
|
845
893
|
})
|
|
846
894
|
}),
|
|
847
|
-
/* @__PURE__ */ c(
|
|
895
|
+
/* @__PURE__ */ c(ct, {
|
|
848
896
|
type: "text",
|
|
849
897
|
value: H,
|
|
850
898
|
onChange: (e) => U(e.target.value),
|
|
851
899
|
onKeyDown: (e) => {
|
|
852
|
-
e.key === "Enter" &&
|
|
900
|
+
e.key === "Enter" && gn();
|
|
853
901
|
},
|
|
854
902
|
"aria-label": a(d, "files.browser.newFolderDialog.title", "New folder"),
|
|
855
903
|
placeholder: a(d, "files.browser.newFolderDialog.placeholder", "Folder name")
|
|
856
904
|
}),
|
|
857
|
-
/* @__PURE__ */ l(
|
|
905
|
+
/* @__PURE__ */ l(pt, { children: [/* @__PURE__ */ c(u, {
|
|
858
906
|
type: "button",
|
|
859
907
|
variant: "outline",
|
|
860
908
|
onClick: () => {
|
|
@@ -863,40 +911,40 @@ function d() {
|
|
|
863
911
|
children: a(d, "files.common.actions.cancel", "Cancel")
|
|
864
912
|
}), /* @__PURE__ */ l(u, {
|
|
865
913
|
type: "button",
|
|
866
|
-
onClick:
|
|
914
|
+
onClick: gn,
|
|
867
915
|
disabled: !H.trim() || Z.isPending,
|
|
868
916
|
children: [Z.isPending && /* @__PURE__ */ c(s, { className: "size-4 animate-spin" }), Z.isPending ? a(d, "files.browser.newFolderDialog.actions.creating", "Creating...") : a(d, "files.common.actions.create", "Create")]
|
|
869
917
|
})] })
|
|
870
918
|
]
|
|
871
919
|
})
|
|
872
920
|
}),
|
|
873
|
-
|
|
921
|
+
It && R && /* @__PURE__ */ c(dt, {
|
|
874
922
|
open: !0,
|
|
875
923
|
onOpenChange: (e) => {
|
|
876
924
|
!e && !Q.isPending && !$.isPending && (M(!1), z(null), V(""));
|
|
877
925
|
},
|
|
878
|
-
children: /* @__PURE__ */ l(
|
|
926
|
+
children: /* @__PURE__ */ l(ft, {
|
|
879
927
|
className: "w-full max-w-xs",
|
|
880
928
|
children: [
|
|
881
|
-
/* @__PURE__ */ c(
|
|
929
|
+
/* @__PURE__ */ c(mt, {
|
|
882
930
|
className: "text-left",
|
|
883
|
-
children: /* @__PURE__ */ c(
|
|
931
|
+
children: /* @__PURE__ */ c(ht, {
|
|
884
932
|
id: "files-rename-title",
|
|
885
933
|
className: "text-base font-semibold text-text-primary",
|
|
886
934
|
children: a(d, "files.browser.renameDialog.title", "Rename {{type}}", { type: R.type })
|
|
887
935
|
})
|
|
888
936
|
}),
|
|
889
|
-
/* @__PURE__ */ c(
|
|
937
|
+
/* @__PURE__ */ c(ct, {
|
|
890
938
|
type: "text",
|
|
891
939
|
value: B,
|
|
892
940
|
onChange: (e) => V(e.target.value),
|
|
893
941
|
onKeyDown: (e) => {
|
|
894
|
-
e.key === "Enter" &&
|
|
942
|
+
e.key === "Enter" && Bn();
|
|
895
943
|
},
|
|
896
944
|
"aria-label": a(d, "files.browser.renameDialog.title", "Rename"),
|
|
897
945
|
placeholder: a(d, "files.browser.renameDialog.placeholder", "New name")
|
|
898
946
|
}),
|
|
899
|
-
/* @__PURE__ */ l(
|
|
947
|
+
/* @__PURE__ */ l(pt, { children: [/* @__PURE__ */ c(u, {
|
|
900
948
|
type: "button",
|
|
901
949
|
variant: "outline",
|
|
902
950
|
onClick: () => {
|
|
@@ -905,21 +953,21 @@ function d() {
|
|
|
905
953
|
children: a(d, "files.common.actions.cancel", "Cancel")
|
|
906
954
|
}), /* @__PURE__ */ l(u, {
|
|
907
955
|
type: "button",
|
|
908
|
-
onClick:
|
|
956
|
+
onClick: Bn,
|
|
909
957
|
disabled: !B.trim() || B.trim() === R.name || Q.isPending || $.isPending,
|
|
910
958
|
children: [(Q.isPending || $.isPending) && /* @__PURE__ */ c(s, { className: "size-4 animate-spin" }), Q.isPending || $.isPending ? a(d, "files.browser.renameDialog.actions.renaming", "Renaming...") : a(d, "files.common.actions.rename", "Rename")]
|
|
911
959
|
})] })
|
|
912
960
|
]
|
|
913
961
|
})
|
|
914
962
|
}),
|
|
915
|
-
|
|
916
|
-
item:
|
|
917
|
-
itemType: "mimeType" in
|
|
963
|
+
Lt && Ht && /* @__PURE__ */ c(we, {
|
|
964
|
+
item: Ht,
|
|
965
|
+
itemType: "mimeType" in Ht ? "file" : "folder",
|
|
918
966
|
onClose: () => {
|
|
919
|
-
|
|
967
|
+
Rt(!1), P(null);
|
|
920
968
|
},
|
|
921
|
-
onCreateShare:
|
|
922
|
-
isLoading:
|
|
969
|
+
onCreateShare: bn,
|
|
970
|
+
isLoading: tn.isPending
|
|
923
971
|
}),
|
|
924
972
|
J && /* @__PURE__ */ c(Me, {
|
|
925
973
|
title: J.title,
|
|
@@ -928,99 +976,86 @@ function d() {
|
|
|
928
976
|
cancelLabel: a(d, "files.common.actions.cancel", "Cancel"),
|
|
929
977
|
variant: J.variant,
|
|
930
978
|
loading: J.loading,
|
|
931
|
-
onConfirm:
|
|
979
|
+
onConfirm: Kt,
|
|
932
980
|
onCancel: () => {
|
|
933
981
|
J.loading || Y(null);
|
|
934
982
|
}
|
|
935
983
|
}),
|
|
936
|
-
|
|
984
|
+
Pt && /* @__PURE__ */ c(Me, {
|
|
937
985
|
title: a(d, "files.folder.quota.title", "Folder Limit Reached"),
|
|
938
986
|
description: a(d, "files.folder.quota.description", "You've reached the folder limit for your plan. Upgrade your plan or purchase an add-on to create more folders."),
|
|
939
987
|
confirmLabel: a(d, "files.folder.quota.upgrade", "View Billing"),
|
|
940
988
|
cancelLabel: a(d, "files.common.actions.dismiss", "Dismiss"),
|
|
941
989
|
onConfirm: () => {
|
|
942
|
-
|
|
990
|
+
Ft(!1), gt("/billing");
|
|
943
991
|
},
|
|
944
|
-
onCancel: () =>
|
|
992
|
+
onCancel: () => Ft(!1)
|
|
945
993
|
}),
|
|
946
|
-
|
|
994
|
+
zt && F && /* @__PURE__ */ c(Ae, {
|
|
947
995
|
item: F.item,
|
|
948
996
|
type: F.type,
|
|
949
997
|
onClose: () => {
|
|
950
|
-
|
|
998
|
+
N(!1), I(null);
|
|
951
999
|
},
|
|
952
|
-
onMove:
|
|
953
|
-
isLoading:
|
|
1000
|
+
onMove: Rn,
|
|
1001
|
+
isLoading: an.isPending || on.isPending
|
|
954
1002
|
}),
|
|
955
|
-
|
|
1003
|
+
Bt && L && /* @__PURE__ */ c(je, {
|
|
956
1004
|
item: L.item,
|
|
957
1005
|
type: L.type,
|
|
958
1006
|
onClose: () => {
|
|
959
|
-
|
|
1007
|
+
Vt(!1), Ut(null);
|
|
960
1008
|
},
|
|
961
|
-
onCopy:
|
|
962
|
-
isLoading:
|
|
1009
|
+
onCopy: zn,
|
|
1010
|
+
isLoading: rn.isPending
|
|
963
1011
|
}),
|
|
964
|
-
|
|
965
|
-
file:
|
|
966
|
-
onClose: () =>
|
|
1012
|
+
b && /* @__PURE__ */ c(Te, {
|
|
1013
|
+
file: b,
|
|
1014
|
+
onClose: () => kt(null),
|
|
967
1015
|
onDownload: () => {
|
|
968
|
-
ze(
|
|
1016
|
+
ze(b.downloadUrl || b.url);
|
|
969
1017
|
},
|
|
970
|
-
onShare:
|
|
971
|
-
P(
|
|
1018
|
+
onShare: g === "bin" ? void 0 : () => {
|
|
1019
|
+
P(b), Rt(!0);
|
|
972
1020
|
},
|
|
973
|
-
onStar:
|
|
974
|
-
onDelete: () =>
|
|
1021
|
+
onStar: g === "bin" ? void 0 : () => wn(b),
|
|
1022
|
+
onDelete: () => g === "bin" ? Cn(b) : xn(b)
|
|
975
1023
|
}),
|
|
976
|
-
|
|
977
|
-
item:
|
|
978
|
-
type:
|
|
979
|
-
onClose: () =>
|
|
1024
|
+
Dt && /* @__PURE__ */ c(Ee, {
|
|
1025
|
+
item: Dt.item,
|
|
1026
|
+
type: Dt.type,
|
|
1027
|
+
onClose: () => Ot(null)
|
|
980
1028
|
}),
|
|
981
1029
|
/* @__PURE__ */ c(Ne, {
|
|
982
|
-
items:
|
|
983
|
-
isOpen:
|
|
1030
|
+
items: Wt,
|
|
1031
|
+
isOpen: Gt,
|
|
984
1032
|
onClose: () => q(!1),
|
|
985
|
-
onPause:
|
|
986
|
-
onResume:
|
|
987
|
-
onRetry:
|
|
988
|
-
onCancel:
|
|
1033
|
+
onPause: un,
|
|
1034
|
+
onResume: dn,
|
|
1035
|
+
onRetry: fn,
|
|
1036
|
+
onCancel: pn
|
|
989
1037
|
}),
|
|
990
1038
|
/* @__PURE__ */ c(Oe, {
|
|
991
|
-
toasts:
|
|
992
|
-
onClose:
|
|
1039
|
+
toasts: x.toasts,
|
|
1040
|
+
onClose: x.removeToast
|
|
993
1041
|
}),
|
|
994
1042
|
!D && T.length === 0 && E.length === 0 && /* @__PURE__ */ c("div", {
|
|
995
1043
|
className: "px-6 py-12",
|
|
996
|
-
children:
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
/* @__PURE__ */ c("p", {
|
|
1008
|
-
className: "text-sm text-text-secondary mb-4",
|
|
1009
|
-
children: a(d, "files.browser.empty.search.description", "Try adjusting your search query or filters")
|
|
1010
|
-
}),
|
|
1011
|
-
/* @__PURE__ */ c("button", {
|
|
1012
|
-
type: "button",
|
|
1013
|
-
onClick: () => {
|
|
1014
|
-
vt(""), bt(void 0);
|
|
1015
|
-
},
|
|
1016
|
-
className: "inline-flex items-center gap-2 px-4 py-2 text-sm font-medium text-text-inverse bg-action-primary-bg rounded-lg hover:bg-action-primary-bg-hover transition-colors duration-200",
|
|
1017
|
-
children: a(d, "files.browser.search.clear", "Clear search")
|
|
1018
|
-
})
|
|
1019
|
-
]
|
|
1044
|
+
children: y ? /* @__PURE__ */ c(st, {
|
|
1045
|
+
illustration: "empty-search",
|
|
1046
|
+
title: a(d, "files.browser.empty.search.title", "No results found"),
|
|
1047
|
+
description: a(d, "files.browser.empty.search.description", "Try adjusting your search query or filters"),
|
|
1048
|
+
action: /* @__PURE__ */ c(u, {
|
|
1049
|
+
type: "button",
|
|
1050
|
+
onClick: () => {
|
|
1051
|
+
wt(""), Et(void 0);
|
|
1052
|
+
},
|
|
1053
|
+
children: a(d, "files.browser.search.clear", "Clear search")
|
|
1054
|
+
})
|
|
1020
1055
|
}) : /* @__PURE__ */ c(De, {
|
|
1021
|
-
type:
|
|
1022
|
-
onUpload:
|
|
1023
|
-
onNewFolder:
|
|
1056
|
+
type: g,
|
|
1057
|
+
onUpload: g === "all" ? cn : void 0,
|
|
1058
|
+
onNewFolder: g === "all" ? hn : void 0
|
|
1024
1059
|
})
|
|
1025
1060
|
})
|
|
1026
1061
|
]
|