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