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