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