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