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