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