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