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