@burdenoff/microfe-files 2026.624.1 → 2026.624.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/files/components/CopyDialog.js +73 -80
- package/dist/files/components/CopyDialog.js.map +1 -1
- package/dist/files/components/FileCard.js +4 -1
- package/dist/files/components/FileCard.js.map +1 -1
- package/dist/files/components/FileInfoPanel.js +1 -1
- package/dist/files/components/FileInfoPanel.js.map +1 -1
- package/dist/files/components/FileListItem.js +1 -1
- package/dist/files/components/FileListItem.js.map +1 -1
- package/dist/files/components/FileVersionPanel.js +4 -1
- package/dist/files/components/FileVersionPanel.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/components/Toast.js +1 -1
- package/dist/files/components/Toast.js.map +1 -1
- package/dist/files/components/viewers/TextViewer.js +1 -1
- package/dist/files/components/viewers/TextViewer.js.map +1 -1
- package/dist/files/pages/BrowserPage.js +487 -490
- package/dist/files/pages/BrowserPage.js.map +1 -1
- package/package.json +1 -1
|
@@ -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 rt, Input as it, ResponsiveDialog as at, ResponsiveDialogContent as ot, ResponsiveDialogFooter as st, ResponsiveDialogHeader as ct, ResponsiveDialogTitle as lt } from "@burdenoff/fe-libs/ui";
|
|
52
53
|
//#region src/files/pages/BrowserPage.tsx
|
|
53
|
-
function
|
|
54
|
-
let { t:
|
|
54
|
+
function u() {
|
|
55
|
+
let { t: u } = nt(), { folderId: d } = tt(), f = et(), ut = e(), { workspaceId: p } = ut, dt = Fe(p ?? ""), { viewMode: ft, setViewMode: pt, breadcrumbs: mt, selectedFiles: m, selectedFolders: h, clearSelection: g } = t(), [_, ht] = o("all"), gt = He(() => [
|
|
55
56
|
"all",
|
|
56
57
|
"recent",
|
|
57
58
|
"starred",
|
|
58
59
|
"bin"
|
|
59
60
|
], []);
|
|
60
61
|
Ve(() => {
|
|
61
|
-
|
|
62
|
-
}, [
|
|
63
|
-
let [
|
|
64
|
-
folderId:
|
|
62
|
+
gt.includes(_) || ht("all");
|
|
63
|
+
}, [gt, _]);
|
|
64
|
+
let [_t, vt] = o(""), [yt, bt] = o(), v = _t.trim().length >= 2, [xt, St] = o(null), [y, Ct] = o(null), b = be(), x = r({
|
|
65
|
+
folderId: d || void 0,
|
|
65
66
|
pageSize: 100,
|
|
66
|
-
skip:
|
|
67
|
-
}),
|
|
67
|
+
skip: _ !== "all" || v
|
|
68
|
+
}), S = i({ skip: _ !== "recent" || v }), C = ee({ skip: _ !== "starred" || v }), w = te({ skip: _ !== "bin" || v }), T = ye(_t, v, yt);
|
|
68
69
|
Ve(() => {
|
|
69
|
-
if (
|
|
70
|
-
let e =
|
|
70
|
+
if (d && x.data?.folderPath && x.data?.currentFolder) {
|
|
71
|
+
let e = x.data.folderPath.folders || [], n = x.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
|
-
}, [
|
|
80
|
-
let
|
|
81
|
-
if (
|
|
82
|
-
else switch (
|
|
80
|
+
}, [d, x.data]);
|
|
81
|
+
let E = [], D = [], O = !1, k = null, A = !1;
|
|
82
|
+
if (v && T.data) E = T.data.files || [], D = T.data.folders || [], O = T.isLoading, k = T.error;
|
|
83
|
+
else switch (_) {
|
|
83
84
|
case "all":
|
|
84
|
-
|
|
85
|
+
E = x.data?.filesList?.files || [], D = x.data?.foldersList?.folders || [], O = x.loading, k = x.error || null, A = !1;
|
|
85
86
|
break;
|
|
86
87
|
case "recent":
|
|
87
|
-
|
|
88
|
+
E = S.files || [], D = S.folders || [], O = S.isLoading, k = S.error || null, A = !0;
|
|
88
89
|
break;
|
|
89
90
|
case "starred":
|
|
90
|
-
|
|
91
|
+
E = C.files, D = C.folders, O = C.isLoading, k = C.error || null, A = !0;
|
|
91
92
|
break;
|
|
92
93
|
case "bin":
|
|
93
|
-
|
|
94
|
+
E = w.files, D = w.folders, O = w.isLoading, k = w.error || null, A = !0;
|
|
94
95
|
break;
|
|
95
96
|
}
|
|
96
|
-
let
|
|
97
|
-
Be(
|
|
98
|
-
},
|
|
99
|
-
if (!
|
|
100
|
-
let e =
|
|
101
|
-
|
|
102
|
-
...
|
|
97
|
+
let wt = _ === "all" ? (x.data?.filesList?.total ?? E.length) + (x.data?.foldersList?.total ?? D.length) : null, j = m.size + h.size, [Tt, M] = o(!1), [Et, Dt] = o(!1), [Ot, N] = o(!1), [kt, At] = o(!1), [jt, P] = o(!1), [Mt, Nt] = o(!1), [Pt, F] = o(null), [I, L] = o(null), [R, Ft] = o(null), [z, B] = o(null), [V, H] = o(""), [U, W] = o(""), [It, G] = o(!1), [Lt, K] = o([]), [Rt, q] = o(!1), [J, Y] = o(null), X = (e, t) => {
|
|
98
|
+
Be(ut, e, t);
|
|
99
|
+
}, zt = 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(), Bt = re(), Vt = ie(), Ht = ae(), Ut = oe(), Wt = se(), Gt = ce(), Kt = le(), qt = ue(), Q = de(), $ = fe(), Jt = pe(), Yt = me(), Xt = he(), Zt = ge(), Qt = _e(), $t = ve(), en = () => {
|
|
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;
|
|
@@ -125,25 +126,25 @@ function d() {
|
|
|
125
126
|
file: e,
|
|
126
127
|
status: "pending",
|
|
127
128
|
progress: 0,
|
|
128
|
-
folderId:
|
|
129
|
+
folderId: d || void 0,
|
|
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 tn(t);
|
|
135
|
+
G(!1);
|
|
135
136
|
}
|
|
136
137
|
}, e.click();
|
|
137
|
-
},
|
|
138
|
+
}, tn = 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 Bt.mutateAsync({
|
|
147
148
|
file: e.file,
|
|
148
149
|
folderId: e.folderId,
|
|
149
150
|
onProgress: (e) => {
|
|
@@ -153,49 +154,49 @@ 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
|
|
160
161
|
});
|
|
161
162
|
} catch (n) {
|
|
162
|
-
let r = n instanceof Error ? n.message : a(
|
|
163
|
+
let r = n instanceof Error ? n.message : a(u, "files.upload.errors.failed", "Upload failed");
|
|
163
164
|
r === "Upload paused" ? t({ status: "paused" }) : r === "QUOTA_EXHAUSTED" ? (t({
|
|
164
165
|
status: "failed",
|
|
165
|
-
error: a(
|
|
166
|
-
}),
|
|
166
|
+
error: a(u, "files.upload.errors.quotaExceeded", "Storage quota exceeded")
|
|
167
|
+
}), b.error(a(u, "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
|
+
}, nn = (e) => {
|
|
177
|
+
Bt.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
|
+
}, rn = (e) => {
|
|
182
|
+
let t = Lt.find((t) => t.id === e);
|
|
183
|
+
t && tn(t);
|
|
184
|
+
}, an = (e) => {
|
|
185
|
+
let t = Lt.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)), tn(t));
|
|
192
|
+
}, on = (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
|
-
if (!
|
|
198
|
-
|
|
197
|
+
}, sn = () => {
|
|
198
|
+
if (!p) {
|
|
199
|
+
b.error(a(u, "files.workspace.errors.notSelected", "Workspace not selected"));
|
|
199
200
|
return;
|
|
200
201
|
}
|
|
201
202
|
let e = document.createElement("input");
|
|
@@ -210,10 +211,10 @@ function d() {
|
|
|
210
211
|
let n = /* @__PURE__ */ new Map(), r = Array.from(e.keys()).sort();
|
|
211
212
|
for (let e of r) {
|
|
212
213
|
if (!e) continue;
|
|
213
|
-
let t = e.split("/"), r = "", i =
|
|
214
|
+
let t = e.split("/"), r = "", i = d || 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
|
});
|
|
@@ -222,7 +223,7 @@ function d() {
|
|
|
222
223
|
}
|
|
223
224
|
let i = [], ee = 0;
|
|
224
225
|
for (let [t, r] of e) {
|
|
225
|
-
let e = t ? n.get(t) :
|
|
226
|
+
let e = t ? n.get(t) : d || void 0;
|
|
226
227
|
for (let t of r) {
|
|
227
228
|
let n = await xe(t);
|
|
228
229
|
i.push({
|
|
@@ -235,42 +236,42 @@ 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 tn(e);
|
|
241
|
+
G(!1), b.success(a(u, "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:
|
|
252
|
-
parentFolderId:
|
|
247
|
+
}, cn = () => {
|
|
248
|
+
M(!0);
|
|
249
|
+
}, ln = async () => {
|
|
250
|
+
if (U.trim() && p) {
|
|
251
|
+
let { data: e, error: t } = await Z.mutateAsync({
|
|
252
|
+
name: U,
|
|
253
|
+
parentFolderId: d
|
|
253
254
|
});
|
|
254
255
|
if (t) {
|
|
255
|
-
Ie(t) ? (
|
|
256
|
+
Ie(t) ? (M(!1), W(""), Dt(!0)) : (b.error(t instanceof Error ? t.message : a(u, "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:
|
|
263
|
-
parentFolderId:
|
|
262
|
+
e && (W(""), M(!1), X("files.folder.created", {
|
|
263
|
+
folderName: U,
|
|
264
|
+
parentFolderId: d
|
|
264
265
|
}));
|
|
265
266
|
}
|
|
266
|
-
},
|
|
267
|
-
|
|
268
|
-
},
|
|
269
|
-
|
|
270
|
-
},
|
|
271
|
-
|
|
272
|
-
},
|
|
273
|
-
if (!e.fileId && !e.folderId) throw Error(a(
|
|
267
|
+
}, un = (e) => {
|
|
268
|
+
Ct(e);
|
|
269
|
+
}, dn = (e) => {
|
|
270
|
+
F(e), At(!0);
|
|
271
|
+
}, fn = (e) => {
|
|
272
|
+
F(e), At(!0);
|
|
273
|
+
}, pn = async (e) => {
|
|
274
|
+
if (!e.fileId && !e.folderId) throw Error(a(u, "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) {
|
|
276
277
|
let r = {
|
|
@@ -282,7 +283,7 @@ function d() {
|
|
|
282
283
|
shareType: t,
|
|
283
284
|
accessLevel: "DOWNLOAD"
|
|
284
285
|
};
|
|
285
|
-
n = (await
|
|
286
|
+
n = (await Jt.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 Yt.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"),
|
|
312
|
-
title: a(
|
|
313
|
-
description: a(
|
|
314
|
-
confirmLabel: a(
|
|
311
|
+
}, mn = async (e) => {
|
|
312
|
+
Le("medium"), Y({
|
|
313
|
+
title: a(u, "files.confirm.deleteFile.title", "Delete file"),
|
|
314
|
+
description: a(u, "files.confirm.deleteFile.description", "Move \"{{name}}\" to the bin?", { name: e.name }),
|
|
315
|
+
confirmLabel: a(u, "files.common.actions.delete", "Delete"),
|
|
315
316
|
variant: "danger",
|
|
316
317
|
onConfirm: async () => {
|
|
317
318
|
try {
|
|
318
|
-
await
|
|
319
|
+
await Vt.mutateAsync({ id: e.id }), Re("success"), b.success(a(u, "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
|
+
b.error(t instanceof Error ? t.message : a(u, "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
|
+
}, hn = async (e) => {
|
|
333
334
|
try {
|
|
334
|
-
await
|
|
335
|
+
await Ut.mutateAsync({ id: e.id }), b.success(a(u, "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
|
+
b.error(e instanceof Error ? e.message : a(u, "files.file.errors.restoreFailed", "Failed to restore file"));
|
|
340
341
|
}
|
|
341
|
-
},
|
|
342
|
-
Le("heavy"),
|
|
343
|
-
title: a(
|
|
344
|
-
description: a(
|
|
345
|
-
confirmLabel: a(
|
|
342
|
+
}, gn = async (e) => {
|
|
343
|
+
Le("heavy"), Y({
|
|
344
|
+
title: a(u, "files.confirm.permanentDeleteFile.title", "Permanently delete file"),
|
|
345
|
+
description: a(u, "files.confirm.permanentDeleteFile.description", "Permanently delete \"{{name}}\"? This cannot be undone.", { name: e.name }),
|
|
346
|
+
confirmLabel: a(u, "files.common.actions.deletePermanently", "Delete permanently"),
|
|
346
347
|
variant: "danger",
|
|
347
348
|
onConfirm: async () => {
|
|
348
349
|
try {
|
|
349
|
-
await
|
|
350
|
+
await Gt.mutateAsync({ id: e.id }), b.success(a(u, "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
|
+
b.error(e instanceof Error ? e.message : a(u, "files.file.errors.permanentDeleteFailed", "Failed to permanently delete file"));
|
|
356
357
|
}
|
|
357
358
|
}
|
|
358
359
|
});
|
|
359
|
-
},
|
|
360
|
+
}, _n = async (e) => {
|
|
360
361
|
try {
|
|
361
|
-
await
|
|
362
|
+
await qt.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
|
+
b.error(a(u, "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
|
+
}, vn = (e) => {
|
|
377
|
+
B({
|
|
377
378
|
id: e.id,
|
|
378
379
|
name: e.name,
|
|
379
380
|
type: "file"
|
|
380
|
-
}),
|
|
381
|
-
},
|
|
381
|
+
}), H(e.name), N(!0);
|
|
382
|
+
}, yn = async (e) => {
|
|
382
383
|
try {
|
|
383
384
|
let t = e.downloadUrl || e.url;
|
|
384
|
-
if (!t) throw Error(a(
|
|
385
|
+
if (!t) throw Error(a(u, "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), b.success(a(u, "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
|
+
b.error(e instanceof Error ? e.message : a(u, "files.file.errors.downloadFailed", "Failed to download file"));
|
|
392
393
|
}
|
|
393
|
-
},
|
|
394
|
-
|
|
394
|
+
}, bn = (e) => {
|
|
395
|
+
Ft({
|
|
395
396
|
item: e,
|
|
396
397
|
type: "file"
|
|
397
|
-
}),
|
|
398
|
-
},
|
|
399
|
-
|
|
398
|
+
}), Nt(!0);
|
|
399
|
+
}, xn = (e) => {
|
|
400
|
+
L({
|
|
400
401
|
item: e,
|
|
401
402
|
type: "file"
|
|
402
|
-
}),
|
|
403
|
-
},
|
|
404
|
-
|
|
403
|
+
}), P(!0);
|
|
404
|
+
}, Sn = (e) => {
|
|
405
|
+
St({
|
|
405
406
|
item: e,
|
|
406
407
|
type: "file"
|
|
407
408
|
});
|
|
408
|
-
},
|
|
409
|
-
|
|
410
|
-
},
|
|
411
|
-
Le("medium"),
|
|
412
|
-
title: a(
|
|
413
|
-
description: a(
|
|
414
|
-
confirmLabel: a(
|
|
409
|
+
}, Cn = (e) => {
|
|
410
|
+
f(`/files/browse/${e.id}`);
|
|
411
|
+
}, wn = async (e) => {
|
|
412
|
+
Le("medium"), Y({
|
|
413
|
+
title: a(u, "files.confirm.deleteFolder.title", "Delete folder"),
|
|
414
|
+
description: a(u, "files.confirm.deleteFolder.description", "Move folder \"{{name}}\" and all its contents to the bin?", { name: e.name }),
|
|
415
|
+
confirmLabel: a(u, "files.common.actions.delete", "Delete"),
|
|
415
416
|
variant: "danger",
|
|
416
417
|
onConfirm: async () => {
|
|
417
418
|
try {
|
|
418
|
-
await
|
|
419
|
+
await Ht.mutateAsync({
|
|
419
420
|
id: e.id,
|
|
420
421
|
recursive: !0
|
|
421
|
-
}),
|
|
422
|
+
}), b.success(a(u, "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
|
+
b.error(e instanceof Error ? e.message : a(u, "files.folder.errors.deleteFailed", "Failed to delete folder"));
|
|
428
429
|
}
|
|
429
430
|
}
|
|
430
431
|
});
|
|
431
|
-
},
|
|
432
|
+
}, Tn = async (e) => {
|
|
432
433
|
try {
|
|
433
|
-
await
|
|
434
|
+
await Wt.mutateAsync({ id: e.id }), b.success(a(u, "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
|
+
b.error(e instanceof Error ? e.message : a(u, "files.folder.errors.restoreFailed", "Failed to restore folder"));
|
|
439
440
|
}
|
|
440
|
-
},
|
|
441
|
-
|
|
442
|
-
title: a(
|
|
443
|
-
description: a(
|
|
444
|
-
confirmLabel: a(
|
|
441
|
+
}, En = async (e) => {
|
|
442
|
+
Y({
|
|
443
|
+
title: a(u, "files.confirm.permanentDeleteFolder.title", "Permanently delete folder"),
|
|
444
|
+
description: a(u, "files.confirm.permanentDeleteFolder.description", "Permanently delete folder \"{{name}}\" and its contents? This cannot be undone.", { name: e.name }),
|
|
445
|
+
confirmLabel: a(u, "files.common.actions.deletePermanently", "Delete permanently"),
|
|
445
446
|
variant: "danger",
|
|
446
447
|
onConfirm: async () => {
|
|
447
448
|
try {
|
|
448
|
-
await
|
|
449
|
+
await Kt.mutateAsync({ id: e.id }), b.success(a(u, "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
|
+
b.error(e instanceof Error ? e.message : a(u, "files.folder.errors.permanentDeleteFailed", "Failed to permanently delete folder"));
|
|
455
456
|
}
|
|
456
457
|
}
|
|
457
458
|
});
|
|
458
|
-
},
|
|
459
|
-
|
|
459
|
+
}, Dn = (e) => {
|
|
460
|
+
B({
|
|
460
461
|
id: e.id,
|
|
461
462
|
name: e.name,
|
|
462
463
|
type: "folder"
|
|
463
|
-
}),
|
|
464
|
-
},
|
|
465
|
-
|
|
464
|
+
}), H(e.name), N(!0);
|
|
465
|
+
}, On = (e) => {
|
|
466
|
+
L({
|
|
466
467
|
item: e,
|
|
467
468
|
type: "folder"
|
|
468
|
-
}),
|
|
469
|
-
},
|
|
469
|
+
}), P(!0);
|
|
470
|
+
}, kn = async (e) => {
|
|
470
471
|
try {
|
|
471
|
-
await
|
|
472
|
+
await qt.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
|
+
b.error(a(u, "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
|
+
}, An = (e) => {
|
|
487
|
+
St({
|
|
487
488
|
item: e,
|
|
488
489
|
type: "folder"
|
|
489
490
|
});
|
|
490
|
-
},
|
|
491
|
-
if (
|
|
492
|
-
|
|
493
|
-
fileId:
|
|
491
|
+
}, jn = async (e) => {
|
|
492
|
+
if (I) try {
|
|
493
|
+
I.type === "file" ? (await Zt.mutateAsync({
|
|
494
|
+
fileId: I.item.id,
|
|
494
495
|
targetFolderId: e || null
|
|
495
|
-
}),
|
|
496
|
-
fileId:
|
|
497
|
-
fileName:
|
|
496
|
+
}), b.success(a(u, "files.file.move.success", "\"{{name}}\" moved", { name: I.item.name })), X("files.file.moved", {
|
|
497
|
+
fileId: I.item.id,
|
|
498
|
+
fileName: I.item.name,
|
|
498
499
|
destinationFolderId: e
|
|
499
|
-
})) : (await
|
|
500
|
-
folderId:
|
|
500
|
+
})) : (await Qt.mutateAsync({
|
|
501
|
+
folderId: I.item.id,
|
|
501
502
|
targetParentFolderId: e
|
|
502
|
-
}),
|
|
503
|
-
folderId:
|
|
504
|
-
folderName:
|
|
503
|
+
}), b.success(a(u, "files.folder.move.success", "\"{{name}}\" moved", { name: I.item.name })), X("files.folder.moved", {
|
|
504
|
+
folderId: I.item.id,
|
|
505
|
+
folderName: I.item.name,
|
|
505
506
|
destinationFolderId: e
|
|
506
|
-
})),
|
|
507
|
+
})), P(!1), L(null);
|
|
507
508
|
} catch (e) {
|
|
508
|
-
|
|
509
|
-
action:
|
|
510
|
-
itemId:
|
|
511
|
-
itemType:
|
|
509
|
+
b.error(e instanceof Error ? e.message : a(u, "files.item.errors.moveFailed", "Failed to move \"{{name}}\"", { name: I.item.name })), X("files.api.failed", {
|
|
510
|
+
action: I.type === "file" ? "moveFile" : "moveFolder",
|
|
511
|
+
itemId: I.item.id,
|
|
512
|
+
itemType: I.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
|
+
}, Mn = async (e, t) => {
|
|
517
|
+
if (R) try {
|
|
518
|
+
if (R.type !== "file") throw Error(a(u, "files.folder.errors.copyUnsupported", "Folder copy is not supported"));
|
|
519
|
+
await Xt.mutateAsync({
|
|
520
|
+
id: R.item.id,
|
|
521
|
+
newName: t || `Copy of ${R.item.name}`,
|
|
521
522
|
targetFolderId: e || void 0
|
|
522
|
-
}),
|
|
523
|
-
fileId:
|
|
524
|
-
fileName:
|
|
523
|
+
}), b.success(a(u, "files.file.copy.success", "\"{{name}}\" copied", { name: R.item.name })), X("files.file.copied", {
|
|
524
|
+
fileId: R.item.id,
|
|
525
|
+
fileName: R.item.name,
|
|
525
526
|
destinationFolderId: e
|
|
526
|
-
}),
|
|
527
|
+
}), Nt(!1), Ft(null);
|
|
527
528
|
} catch (e) {
|
|
528
|
-
|
|
529
|
+
b.error(e instanceof Error ? e.message : a(u, "files.file.errors.copyFailed", "Failed to copy \"{{name}}\"", { name: R.item.name })), X("files.api.failed", {
|
|
529
530
|
action: "copyFile",
|
|
530
|
-
fileId:
|
|
531
|
+
fileId: R.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
|
+
}, Nn = async () => {
|
|
536
|
+
if (!(!z || !V.trim())) try {
|
|
537
|
+
let e = z.name, t = V.trim();
|
|
538
|
+
z.type === "file" ? (await Q.mutateAsync({
|
|
539
|
+
fileId: z.id,
|
|
539
540
|
newName: t
|
|
540
|
-
}),
|
|
541
|
-
fileId:
|
|
541
|
+
}), b.success(a(u, "files.file.rename.success", "Renamed \"{{name}}\"", { name: t })), X("files.file.renamed", {
|
|
542
|
+
fileId: z.id,
|
|
542
543
|
previousName: e,
|
|
543
544
|
name: t
|
|
544
|
-
})) : (await
|
|
545
|
-
folderId:
|
|
545
|
+
})) : (await $.mutateAsync({
|
|
546
|
+
folderId: z.id,
|
|
546
547
|
newName: t
|
|
547
|
-
}),
|
|
548
|
-
folderId:
|
|
548
|
+
}), b.success(a(u, "files.folder.rename.success", "Renamed \"{{name}}\"", { name: t })), X("files.folder.renamed", {
|
|
549
|
+
folderId: z.id,
|
|
549
550
|
previousName: e,
|
|
550
551
|
name: t
|
|
551
|
-
})),
|
|
552
|
+
})), N(!1), B(null), H("");
|
|
552
553
|
} catch (e) {
|
|
553
|
-
|
|
554
|
-
action:
|
|
555
|
-
itemId:
|
|
556
|
-
itemType:
|
|
554
|
+
b.error(e instanceof Error ? e.message : a(u, "files.item.errors.renameFailed", "Failed to rename {{type}}", { type: z.type })), X("files.api.failed", {
|
|
555
|
+
action: z.type === "file" ? "renameFile" : "renameFolder",
|
|
556
|
+
itemId: z.id,
|
|
557
|
+
itemType: z.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:
|
|
568
|
-
activeTab:
|
|
569
|
-
}),
|
|
563
|
+
files: E,
|
|
564
|
+
folders: D,
|
|
565
|
+
onFilePreview: un,
|
|
566
|
+
onFileDelete: mn,
|
|
567
|
+
onFolderOpen: Cn,
|
|
568
|
+
onFolderDelete: wn,
|
|
569
|
+
activeTab: _
|
|
570
|
+
}), p === 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
|
-
children: a(
|
|
574
|
+
children: a(u, "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
|
-
}) :
|
|
576
|
+
}) : p === "" ? /* @__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
|
-
children: a(
|
|
580
|
+
children: a(u, "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
|
+
/* @__PURE__ */ c("div", {
|
|
585
586
|
className: "bg-bg-surface border-b border-border-default 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
|
-
onClick: () =>
|
|
594
|
+
onClick: () => f("/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
|
-
title: a(
|
|
596
|
-
children: [/* @__PURE__ */
|
|
596
|
+
title: a(u, "files.browser.actions.goToRoot", "Go to root"),
|
|
597
|
+
children: [/* @__PURE__ */ c(qe, { className: "size-4" }), /* @__PURE__ */ c("span", {
|
|
597
598
|
className: "hidden sm:inline",
|
|
598
|
-
children: a(
|
|
599
|
+
children: a(u, "files.browser.rootLabel", "My Drive")
|
|
599
600
|
})]
|
|
600
|
-
}),
|
|
601
|
+
}), mt.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
|
-
onClick: () =>
|
|
608
|
-
className: `hover:bg-action-ghost-bg-hover px-2 py-1 rounded transition-colors duration-200 whitespace-nowrap ${t ===
|
|
608
|
+
onClick: () => f(`/files/browse/${e.id}`),
|
|
609
|
+
className: `hover:bg-action-ghost-bg-hover px-2 py-1 rounded transition-colors duration-200 whitespace-nowrap ${t === mt.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,438 +614,434 @@ 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
|
-
activeTab:
|
|
620
|
-
onTabChange:
|
|
621
|
-
tabs:
|
|
619
|
+
children: /* @__PURE__ */ c(Ce, {
|
|
620
|
+
activeTab: _,
|
|
621
|
+
onTabChange: ht,
|
|
622
|
+
tabs: gt
|
|
622
623
|
})
|
|
623
624
|
}),
|
|
624
|
-
/* @__PURE__ */
|
|
625
|
+
/* @__PURE__ */ l("div", {
|
|
625
626
|
className: "bg-bg-surface border-b border-border-default 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
|
-
placeholder: a(
|
|
639
|
-
initialQuery:
|
|
639
|
+
placeholder: a(u, "files.search.input.placeholder", "Search files and folders..."),
|
|
640
|
+
initialQuery: _t,
|
|
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
646
|
children: [
|
|
646
|
-
!
|
|
647
|
+
!v && (E.length > 0 || D.length > 0) && /* @__PURE__ */ c("button", {
|
|
647
648
|
type: "button",
|
|
648
649
|
onClick: () => {
|
|
649
|
-
let e =
|
|
650
|
+
let e = E.map((e) => e.id), n = D.map((e) => e.id);
|
|
650
651
|
t.getState().selectAllFiles(e), n.forEach((e) => t.getState().selectFolder(e));
|
|
651
652
|
},
|
|
652
653
|
className: "flex items-center gap-2 px-3 py-2 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",
|
|
653
|
-
children: a(
|
|
654
|
+
children: a(u, "files.browser.actions.selectAll", "Select All")
|
|
654
655
|
}),
|
|
655
|
-
!
|
|
656
|
-
/* @__PURE__ */
|
|
656
|
+
!v && /* @__PURE__ */ l($e, { children: [
|
|
657
|
+
/* @__PURE__ */ l("button", {
|
|
657
658
|
type: "button",
|
|
658
|
-
onClick:
|
|
659
|
+
onClick: cn,
|
|
659
660
|
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",
|
|
660
661
|
"data-tour": "files-new-folder-button",
|
|
661
|
-
children: [/* @__PURE__ */
|
|
662
|
+
children: [/* @__PURE__ */ c(Ue, { className: "size-4" }), /* @__PURE__ */ c("span", {
|
|
662
663
|
className: "hidden sm:inline",
|
|
663
|
-
children: a(
|
|
664
|
+
children: a(u, "files.browser.actions.newFolder", "New Folder")
|
|
664
665
|
})]
|
|
665
666
|
}),
|
|
666
|
-
/* @__PURE__ */
|
|
667
|
+
/* @__PURE__ */ c("button", {
|
|
667
668
|
type: "button",
|
|
668
|
-
onClick:
|
|
669
|
-
disabled:
|
|
669
|
+
onClick: en,
|
|
670
|
+
disabled: It,
|
|
670
671
|
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",
|
|
671
672
|
"data-tour": "files-upload-files-button",
|
|
672
|
-
children:
|
|
673
|
+
children: It ? /* @__PURE__ */ l($e, { children: [/* @__PURE__ */ c(s, { className: "size-4 animate-spin" }), /* @__PURE__ */ c("span", {
|
|
673
674
|
className: "hidden sm:inline",
|
|
674
|
-
children: a(
|
|
675
|
-
})] }) : /* @__PURE__ */
|
|
675
|
+
children: a(u, "files.browser.upload.uploading", "Uploading...")
|
|
676
|
+
})] }) : /* @__PURE__ */ l($e, { children: [/* @__PURE__ */ c(Ze, { className: "size-4" }), /* @__PURE__ */ c("span", {
|
|
676
677
|
className: "hidden sm:inline",
|
|
677
|
-
children: a(
|
|
678
|
+
children: a(u, "files.browser.actions.uploadFiles", "Upload Files")
|
|
678
679
|
})] })
|
|
679
680
|
}),
|
|
680
|
-
/* @__PURE__ */
|
|
681
|
+
/* @__PURE__ */ l("button", {
|
|
681
682
|
type: "button",
|
|
682
|
-
onClick:
|
|
683
|
-
disabled:
|
|
683
|
+
onClick: sn,
|
|
684
|
+
disabled: It,
|
|
684
685
|
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(
|
|
686
|
-
children: [/* @__PURE__ */
|
|
686
|
+
title: a(u, "files.browser.actions.uploadFolderTitle", "Upload entire folder with structure"),
|
|
687
|
+
children: [/* @__PURE__ */ c(We, { className: "size-4" }), a(u, "files.browser.actions.uploadFolder", "Upload Folder")]
|
|
687
688
|
})
|
|
688
689
|
] }),
|
|
689
|
-
/* @__PURE__ */
|
|
690
|
+
/* @__PURE__ */ l("div", {
|
|
690
691
|
className: "flex items-center border border-border-default rounded-lg overflow-hidden",
|
|
691
692
|
"data-tour": "files-view-mode-toggle",
|
|
692
|
-
children: [/* @__PURE__ */
|
|
693
|
+
children: [/* @__PURE__ */ c("button", {
|
|
693
694
|
type: "button",
|
|
694
|
-
onClick: () =>
|
|
695
|
-
className: `p-2 transition-colors duration-200 ${
|
|
696
|
-
"aria-label": a(
|
|
697
|
-
children: /* @__PURE__ */
|
|
698
|
-
}), /* @__PURE__ */
|
|
695
|
+
onClick: () => pt("grid"),
|
|
696
|
+
className: `p-2 transition-colors duration-200 ${ft === "grid" ? "bg-bg-accent text-text-link" : "text-text-secondary hover:bg-action-ghost-bg-hover"}`,
|
|
697
|
+
"aria-label": a(u, "files.browser.view.grid", "Grid view"),
|
|
698
|
+
children: /* @__PURE__ */ c(Ke, { className: "size-5" })
|
|
699
|
+
}), /* @__PURE__ */ c("button", {
|
|
699
700
|
type: "button",
|
|
700
|
-
onClick: () =>
|
|
701
|
-
className: `p-2 transition-colors duration-200 ${
|
|
702
|
-
"aria-label": a(
|
|
703
|
-
children: /* @__PURE__ */
|
|
701
|
+
onClick: () => pt("list"),
|
|
702
|
+
className: `p-2 transition-colors duration-200 ${ft === "list" ? "bg-bg-accent text-text-link" : "text-text-secondary hover:bg-action-ghost-bg-hover"}`,
|
|
703
|
+
"aria-label": a(u, "files.browser.view.list", "List view"),
|
|
704
|
+
children: /* @__PURE__ */ c(Je, { className: "size-5" })
|
|
704
705
|
})]
|
|
705
706
|
})
|
|
706
707
|
]
|
|
707
708
|
})]
|
|
708
709
|
}),
|
|
709
|
-
|
|
710
|
+
v && /* @__PURE__ */ l("div", {
|
|
710
711
|
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__ */
|
|
712
|
+
children: [/* @__PURE__ */ l("span", {
|
|
712
713
|
className: "text-sm font-medium text-status-success-text",
|
|
713
|
-
children: [a(
|
|
714
|
-
}), /* @__PURE__ */
|
|
714
|
+
children: [a(u, "files.browser.search.showingResults", "Showing search results for \"{{query}}\"", { query: _t }), T.data && ` (${(T.data.files?.length || 0) + (T.data.folders?.length || 0)} items)`]
|
|
715
|
+
}), /* @__PURE__ */ l("button", {
|
|
715
716
|
type: "button",
|
|
716
|
-
onClick: () =>
|
|
717
|
+
onClick: () => vt(""),
|
|
717
718
|
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__ */
|
|
719
|
+
children: [/* @__PURE__ */ c(Qe, { className: "size-4" }), a(u, "files.browser.search.clear", "Clear search")]
|
|
719
720
|
})]
|
|
720
721
|
}),
|
|
721
|
-
|
|
722
|
+
j > 0 && /* @__PURE__ */ l("div", {
|
|
722
723
|
className: "mt-3 flex items-center justify-between p-3 bg-bg-accent rounded-lg border border-action-primary-border transition-all duration-200",
|
|
723
|
-
children: [/* @__PURE__ */
|
|
724
|
+
children: [/* @__PURE__ */ l("div", {
|
|
724
725
|
className: "flex items-center gap-4",
|
|
725
|
-
children: [/* @__PURE__ */
|
|
726
|
+
children: [/* @__PURE__ */ c("span", {
|
|
726
727
|
className: "text-sm font-medium text-text-primary",
|
|
727
|
-
children: a(
|
|
728
|
-
count:
|
|
729
|
-
suffix:
|
|
728
|
+
children: a(u, "files.browser.selection.selectedCount", "{{count}} item{{suffix}} selected", {
|
|
729
|
+
count: j,
|
|
730
|
+
suffix: j > 1 ? "s" : ""
|
|
730
731
|
})
|
|
731
|
-
}), /* @__PURE__ */
|
|
732
|
+
}), /* @__PURE__ */ c("div", {
|
|
732
733
|
className: "flex items-center gap-2",
|
|
733
|
-
children:
|
|
734
|
+
children: _ === "bin" ? /* @__PURE__ */ l($e, { children: [/* @__PURE__ */ c("button", {
|
|
734
735
|
type: "button",
|
|
735
736
|
onClick: async () => {
|
|
736
737
|
try {
|
|
737
|
-
await Promise.all([...Array.from(
|
|
738
|
+
await Promise.all([...Array.from(m).map((e) => Ut.mutateAsync({ id: e })), ...Array.from(h).map((e) => Wt.mutateAsync({ id: e }))]), g(), b.success(`${j} item${j > 1 ? "s" : ""} restored`);
|
|
738
739
|
} catch (e) {
|
|
739
|
-
|
|
740
|
+
b.error(e instanceof Error ? e.message : "Failed to restore some items");
|
|
740
741
|
}
|
|
741
742
|
},
|
|
742
743
|
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
|
-
children: a(
|
|
744
|
-
}), /* @__PURE__ */
|
|
744
|
+
children: a(u, "files.browser.selection.actions.restore", "Restore")
|
|
745
|
+
}), /* @__PURE__ */ l("button", {
|
|
745
746
|
type: "button",
|
|
746
747
|
onClick: async () => {
|
|
747
|
-
|
|
748
|
-
title: a(
|
|
749
|
-
description: a(
|
|
750
|
-
count:
|
|
751
|
-
plural:
|
|
748
|
+
Y({
|
|
749
|
+
title: a(u, "files.confirm.bulkPermanentDelete.title", "Permanently delete selected items"),
|
|
750
|
+
description: a(u, "files.confirm.bulkPermanentDelete.description", "Permanently delete {{count}} selected item{{plural}}? This cannot be undone.", {
|
|
751
|
+
count: j,
|
|
752
|
+
plural: j > 1 ? "s" : ""
|
|
752
753
|
}),
|
|
753
|
-
confirmLabel: a(
|
|
754
|
+
confirmLabel: a(u, "files.common.actions.deletePermanently", "Delete permanently"),
|
|
754
755
|
variant: "danger",
|
|
755
756
|
onConfirm: async () => {
|
|
756
757
|
try {
|
|
757
|
-
await Promise.all([...Array.from(
|
|
758
|
-
count:
|
|
759
|
-
plural:
|
|
758
|
+
await Promise.all([...Array.from(m).map((e) => Gt.mutateAsync({ id: e })), ...Array.from(h).map((e) => Kt.mutateAsync({ id: e }))]), g(), b.success(a(u, "files.bulk.permanentDelete.success", "{{count}} item{{plural}} deleted permanently", {
|
|
759
|
+
count: j,
|
|
760
|
+
plural: j > 1 ? "s" : ""
|
|
760
761
|
}));
|
|
761
762
|
} catch (e) {
|
|
762
|
-
|
|
763
|
+
b.error(e instanceof Error ? e.message : a(u, "files.bulk.errors.permanentDeleteFailed", "Failed to permanently delete some items"));
|
|
763
764
|
}
|
|
764
765
|
}
|
|
765
766
|
});
|
|
766
767
|
},
|
|
767
768
|
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__ */
|
|
769
|
+
children: [/* @__PURE__ */ c(Xe, { className: "size-4" }), a(u, "files.browser.selection.actions.deletePermanently", "Delete permanently")]
|
|
770
|
+
})] }) : /* @__PURE__ */ l("button", {
|
|
770
771
|
type: "button",
|
|
771
772
|
onClick: async () => {
|
|
772
|
-
|
|
773
|
-
title: a(
|
|
774
|
-
description: a(
|
|
775
|
-
count:
|
|
776
|
-
plural:
|
|
773
|
+
Y({
|
|
774
|
+
title: a(u, "files.confirm.bulkDelete.title", "Delete selected items"),
|
|
775
|
+
description: a(u, "files.confirm.bulkDelete.description", "Move {{count}} selected item{{plural}} to the bin?", {
|
|
776
|
+
count: j,
|
|
777
|
+
plural: j > 1 ? "s" : ""
|
|
777
778
|
}),
|
|
778
|
-
confirmLabel: a(
|
|
779
|
+
confirmLabel: a(u, "files.common.actions.delete", "Delete"),
|
|
779
780
|
variant: "danger",
|
|
780
781
|
onConfirm: async () => {
|
|
781
782
|
try {
|
|
782
|
-
let e = Array.from(
|
|
783
|
-
e.length > 0 && await
|
|
783
|
+
let e = Array.from(m), t = Array.from(h);
|
|
784
|
+
e.length > 0 && await $t.mutateAsync(e), await Promise.all(t.map((e) => Ht.mutateAsync({
|
|
784
785
|
id: e,
|
|
785
786
|
recursive: !0
|
|
786
|
-
}))),
|
|
787
|
-
count:
|
|
788
|
-
plural:
|
|
787
|
+
}))), g(), b.success(a(u, "files.bulk.delete.success", "{{count}} item{{plural}} moved to bin", {
|
|
788
|
+
count: j,
|
|
789
|
+
plural: j > 1 ? "s" : ""
|
|
789
790
|
}));
|
|
790
791
|
} catch (e) {
|
|
791
|
-
|
|
792
|
+
b.error(e instanceof Error ? e.message : a(u, "files.bulk.errors.deleteFailed", "Failed to delete some items"));
|
|
792
793
|
}
|
|
793
794
|
}
|
|
794
795
|
});
|
|
795
796
|
},
|
|
796
797
|
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__ */
|
|
798
|
+
children: [/* @__PURE__ */ c(Xe, { className: "size-4" }), a(u, "files.browser.selection.actions.delete", "Delete")]
|
|
798
799
|
})
|
|
799
800
|
})]
|
|
800
|
-
}), /* @__PURE__ */
|
|
801
|
+
}), /* @__PURE__ */ l("button", {
|
|
801
802
|
type: "button",
|
|
802
|
-
onClick:
|
|
803
|
+
onClick: g,
|
|
803
804
|
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__ */
|
|
805
|
+
children: [/* @__PURE__ */ c(Qe, { className: "size-4" }), a(u, "files.common.actions.clear", "Clear")]
|
|
805
806
|
})]
|
|
806
807
|
})
|
|
807
808
|
]
|
|
808
809
|
}),
|
|
809
|
-
(
|
|
810
|
+
(dt.isExhausted || dt.isNearLimit) && /* @__PURE__ */ c("div", {
|
|
810
811
|
className: "px-4 sm:px-6 pt-3",
|
|
811
|
-
children: /* @__PURE__ */
|
|
812
|
+
children: /* @__PURE__ */ c(Pe, { quota: dt })
|
|
812
813
|
}),
|
|
813
|
-
/* @__PURE__ */
|
|
814
|
+
/* @__PURE__ */ l("div", {
|
|
814
815
|
className: "px-2 sm:px-4 md:px-6 py-3 sm:py-4",
|
|
815
816
|
"data-tour": "files-browser-grid",
|
|
816
|
-
children: [/* @__PURE__ */
|
|
817
|
-
files:
|
|
818
|
-
folders:
|
|
819
|
-
loading:
|
|
820
|
-
error:
|
|
821
|
-
preserveSortOrder:
|
|
822
|
-
onFilePreview:
|
|
823
|
-
onFileShare:
|
|
824
|
-
onFileDelete:
|
|
825
|
-
onFileRestore:
|
|
826
|
-
onFileFavorite:
|
|
827
|
-
onFileRename:
|
|
828
|
-
onFileDownload:
|
|
829
|
-
onFileCopy:
|
|
830
|
-
onFileMove:
|
|
831
|
-
onFileInfo:
|
|
832
|
-
onFolderOpen:
|
|
833
|
-
onFolderShare:
|
|
834
|
-
onFolderDelete:
|
|
835
|
-
onFolderRestore:
|
|
836
|
-
onFolderRename:
|
|
837
|
-
onFolderFavorite:
|
|
838
|
-
onFolderMove:
|
|
839
|
-
onFolderInfo:
|
|
840
|
-
}), !
|
|
817
|
+
children: [/* @__PURE__ */ c(Se, {
|
|
818
|
+
files: E,
|
|
819
|
+
folders: D,
|
|
820
|
+
loading: O,
|
|
821
|
+
error: k,
|
|
822
|
+
preserveSortOrder: A,
|
|
823
|
+
onFilePreview: un,
|
|
824
|
+
onFileShare: _ === "bin" ? void 0 : dn,
|
|
825
|
+
onFileDelete: _ === "bin" ? gn : mn,
|
|
826
|
+
onFileRestore: _ === "bin" ? hn : void 0,
|
|
827
|
+
onFileFavorite: _ === "bin" ? void 0 : _n,
|
|
828
|
+
onFileRename: _ === "bin" ? void 0 : vn,
|
|
829
|
+
onFileDownload: yn,
|
|
830
|
+
onFileCopy: _ === "bin" ? void 0 : bn,
|
|
831
|
+
onFileMove: _ === "bin" ? void 0 : xn,
|
|
832
|
+
onFileInfo: Sn,
|
|
833
|
+
onFolderOpen: Cn,
|
|
834
|
+
onFolderShare: _ === "bin" ? void 0 : fn,
|
|
835
|
+
onFolderDelete: _ === "bin" ? En : wn,
|
|
836
|
+
onFolderRestore: _ === "bin" ? Tn : void 0,
|
|
837
|
+
onFolderRename: _ === "bin" ? void 0 : Dn,
|
|
838
|
+
onFolderFavorite: _ === "bin" ? void 0 : kn,
|
|
839
|
+
onFolderMove: _ === "bin" ? void 0 : On,
|
|
840
|
+
onFolderInfo: An
|
|
841
|
+
}), !O && (E.length > 0 || D.length > 0) && /* @__PURE__ */ l("div", {
|
|
841
842
|
className: "mt-4 px-2 text-sm text-text-secondary",
|
|
842
|
-
children: [a(
|
|
843
|
+
children: [a(u, "files.browser.results.showingItems", "Showing {{count}} items", { count: E.length + D.length }), !v && _ === "all" && wt !== null && ` ${a(u, "files.browser.results.ofItems", "of {{count}} items", { count: wt })}`]
|
|
843
844
|
})]
|
|
844
845
|
}),
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
children: /* @__PURE__ */
|
|
851
|
-
className: "
|
|
846
|
+
Tt && /* @__PURE__ */ c(at, {
|
|
847
|
+
open: !0,
|
|
848
|
+
onOpenChange: (e) => {
|
|
849
|
+
!e && !Z.isPending && (M(!1), W(""));
|
|
850
|
+
},
|
|
851
|
+
children: /* @__PURE__ */ l(ot, {
|
|
852
|
+
className: "w-full max-w-xs",
|
|
852
853
|
children: [
|
|
853
|
-
/* @__PURE__ */
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
854
|
+
/* @__PURE__ */ c(ct, {
|
|
855
|
+
className: "text-left",
|
|
856
|
+
children: /* @__PURE__ */ c(lt, {
|
|
857
|
+
id: "files-new-folder-title",
|
|
858
|
+
className: "text-base font-semibold text-text-primary",
|
|
859
|
+
children: a(u, "files.browser.newFolderDialog.title", "New folder")
|
|
860
|
+
})
|
|
857
861
|
}),
|
|
858
|
-
/* @__PURE__ */
|
|
862
|
+
/* @__PURE__ */ c(it, {
|
|
859
863
|
type: "text",
|
|
860
|
-
value:
|
|
861
|
-
onChange: (e) =>
|
|
864
|
+
value: U,
|
|
865
|
+
onChange: (e) => W(e.target.value),
|
|
862
866
|
onKeyDown: (e) => {
|
|
863
|
-
e.key === "Enter" &&
|
|
867
|
+
e.key === "Enter" && ln();
|
|
864
868
|
},
|
|
865
|
-
"aria-label": a(
|
|
866
|
-
placeholder: a(
|
|
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"
|
|
869
|
+
"aria-label": a(u, "files.browser.newFolderDialog.title", "New folder"),
|
|
870
|
+
placeholder: a(u, "files.browser.newFolderDialog.placeholder", "Folder name")
|
|
868
871
|
}),
|
|
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
|
-
})
|
|
872
|
+
/* @__PURE__ */ l(st, { children: [/* @__PURE__ */ c(rt, {
|
|
873
|
+
type: "button",
|
|
874
|
+
variant: "outline",
|
|
875
|
+
onClick: () => {
|
|
876
|
+
M(!1), W("");
|
|
877
|
+
},
|
|
878
|
+
children: a(u, "files.common.actions.cancel", "Cancel")
|
|
879
|
+
}), /* @__PURE__ */ l(rt, {
|
|
880
|
+
type: "button",
|
|
881
|
+
onClick: ln,
|
|
882
|
+
disabled: !U.trim() || Z.isPending,
|
|
883
|
+
children: [Z.isPending && /* @__PURE__ */ c(s, { className: "size-4 animate-spin" }), Z.isPending ? a(u, "files.browser.newFolderDialog.actions.creating", "Creating...") : a(u, "files.common.actions.create", "Create")]
|
|
884
|
+
})] })
|
|
886
885
|
]
|
|
887
886
|
})
|
|
888
887
|
}),
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
children: /* @__PURE__ */
|
|
895
|
-
className: "
|
|
888
|
+
Ot && z && /* @__PURE__ */ c(at, {
|
|
889
|
+
open: !0,
|
|
890
|
+
onOpenChange: (e) => {
|
|
891
|
+
!e && !Q.isPending && !$.isPending && (N(!1), B(null), H(""));
|
|
892
|
+
},
|
|
893
|
+
children: /* @__PURE__ */ l(ot, {
|
|
894
|
+
className: "w-full max-w-xs",
|
|
896
895
|
children: [
|
|
897
|
-
/* @__PURE__ */
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
896
|
+
/* @__PURE__ */ c(ct, {
|
|
897
|
+
className: "text-left",
|
|
898
|
+
children: /* @__PURE__ */ c(lt, {
|
|
899
|
+
id: "files-rename-title",
|
|
900
|
+
className: "text-base font-semibold text-text-primary",
|
|
901
|
+
children: a(u, "files.browser.renameDialog.title", "Rename {{type}}", { type: z.type })
|
|
902
|
+
})
|
|
901
903
|
}),
|
|
902
|
-
/* @__PURE__ */
|
|
904
|
+
/* @__PURE__ */ c(it, {
|
|
903
905
|
type: "text",
|
|
904
|
-
value:
|
|
905
|
-
onChange: (e) =>
|
|
906
|
+
value: V,
|
|
907
|
+
onChange: (e) => H(e.target.value),
|
|
906
908
|
onKeyDown: (e) => {
|
|
907
|
-
e.key === "Enter" &&
|
|
909
|
+
e.key === "Enter" && Nn();
|
|
908
910
|
},
|
|
909
|
-
"aria-label": a(
|
|
910
|
-
placeholder: a(
|
|
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"
|
|
911
|
+
"aria-label": a(u, "files.browser.renameDialog.title", "Rename"),
|
|
912
|
+
placeholder: a(u, "files.browser.renameDialog.placeholder", "New name")
|
|
912
913
|
}),
|
|
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
|
-
})
|
|
914
|
+
/* @__PURE__ */ l(st, { children: [/* @__PURE__ */ c(rt, {
|
|
915
|
+
type: "button",
|
|
916
|
+
variant: "outline",
|
|
917
|
+
onClick: () => {
|
|
918
|
+
N(!1), B(null), H("");
|
|
919
|
+
},
|
|
920
|
+
children: a(u, "files.common.actions.cancel", "Cancel")
|
|
921
|
+
}), /* @__PURE__ */ l(rt, {
|
|
922
|
+
type: "button",
|
|
923
|
+
onClick: Nn,
|
|
924
|
+
disabled: !V.trim() || V.trim() === z.name || Q.isPending || $.isPending,
|
|
925
|
+
children: [(Q.isPending || $.isPending) && /* @__PURE__ */ c(s, { className: "size-4 animate-spin" }), Q.isPending || $.isPending ? a(u, "files.browser.renameDialog.actions.renaming", "Renaming...") : a(u, "files.common.actions.rename", "Rename")]
|
|
926
|
+
})] })
|
|
930
927
|
]
|
|
931
928
|
})
|
|
932
929
|
}),
|
|
933
|
-
|
|
934
|
-
item:
|
|
935
|
-
itemType: "mimeType" in
|
|
930
|
+
kt && Pt && /* @__PURE__ */ c(we, {
|
|
931
|
+
item: Pt,
|
|
932
|
+
itemType: "mimeType" in Pt ? "file" : "folder",
|
|
936
933
|
onClose: () => {
|
|
937
|
-
|
|
934
|
+
At(!1), F(null);
|
|
938
935
|
},
|
|
939
|
-
onCreateShare:
|
|
940
|
-
isLoading:
|
|
936
|
+
onCreateShare: pn,
|
|
937
|
+
isLoading: Jt.isPending
|
|
941
938
|
}),
|
|
942
|
-
|
|
943
|
-
title:
|
|
944
|
-
description:
|
|
945
|
-
confirmLabel:
|
|
946
|
-
cancelLabel: a(
|
|
947
|
-
variant:
|
|
948
|
-
loading:
|
|
949
|
-
onConfirm:
|
|
939
|
+
J && /* @__PURE__ */ c(Me, {
|
|
940
|
+
title: J.title,
|
|
941
|
+
description: J.description,
|
|
942
|
+
confirmLabel: J.confirmLabel,
|
|
943
|
+
cancelLabel: a(u, "files.common.actions.cancel", "Cancel"),
|
|
944
|
+
variant: J.variant,
|
|
945
|
+
loading: J.loading,
|
|
946
|
+
onConfirm: zt,
|
|
950
947
|
onCancel: () => {
|
|
951
|
-
|
|
948
|
+
J.loading || Y(null);
|
|
952
949
|
}
|
|
953
950
|
}),
|
|
954
|
-
|
|
955
|
-
title: a(
|
|
956
|
-
description: a(
|
|
957
|
-
confirmLabel: a(
|
|
958
|
-
cancelLabel: a(
|
|
951
|
+
Et && /* @__PURE__ */ c(Me, {
|
|
952
|
+
title: a(u, "files.folder.quota.title", "Folder Limit Reached"),
|
|
953
|
+
description: a(u, "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."),
|
|
954
|
+
confirmLabel: a(u, "files.folder.quota.upgrade", "View Billing"),
|
|
955
|
+
cancelLabel: a(u, "files.common.actions.dismiss", "Dismiss"),
|
|
959
956
|
onConfirm: () => {
|
|
960
|
-
|
|
957
|
+
Dt(!1), f("/billing");
|
|
961
958
|
},
|
|
962
|
-
onCancel: () =>
|
|
959
|
+
onCancel: () => Dt(!1)
|
|
963
960
|
}),
|
|
964
|
-
|
|
965
|
-
item:
|
|
966
|
-
type:
|
|
961
|
+
jt && I && /* @__PURE__ */ c(Ae, {
|
|
962
|
+
item: I.item,
|
|
963
|
+
type: I.type,
|
|
967
964
|
onClose: () => {
|
|
968
|
-
|
|
965
|
+
P(!1), L(null);
|
|
969
966
|
},
|
|
970
|
-
onMove:
|
|
971
|
-
isLoading:
|
|
967
|
+
onMove: jn,
|
|
968
|
+
isLoading: Zt.isPending || Qt.isPending
|
|
972
969
|
}),
|
|
973
|
-
|
|
974
|
-
item:
|
|
975
|
-
type:
|
|
970
|
+
Mt && R && /* @__PURE__ */ c(je, {
|
|
971
|
+
item: R.item,
|
|
972
|
+
type: R.type,
|
|
976
973
|
onClose: () => {
|
|
977
|
-
|
|
974
|
+
Nt(!1), Ft(null);
|
|
978
975
|
},
|
|
979
|
-
onCopy:
|
|
980
|
-
isLoading:
|
|
976
|
+
onCopy: Mn,
|
|
977
|
+
isLoading: Xt.isPending
|
|
981
978
|
}),
|
|
982
|
-
|
|
983
|
-
file:
|
|
984
|
-
onClose: () =>
|
|
979
|
+
y && /* @__PURE__ */ c(Te, {
|
|
980
|
+
file: y,
|
|
981
|
+
onClose: () => Ct(null),
|
|
985
982
|
onDownload: () => {
|
|
986
|
-
ze(
|
|
983
|
+
ze(y.downloadUrl || y.url);
|
|
987
984
|
},
|
|
988
|
-
onShare:
|
|
989
|
-
|
|
985
|
+
onShare: _ === "bin" ? void 0 : () => {
|
|
986
|
+
F(y), At(!0);
|
|
990
987
|
},
|
|
991
|
-
onStar:
|
|
992
|
-
onDelete: () =>
|
|
988
|
+
onStar: _ === "bin" ? void 0 : () => _n(y),
|
|
989
|
+
onDelete: () => _ === "bin" ? gn(y) : mn(y)
|
|
993
990
|
}),
|
|
994
|
-
|
|
995
|
-
item:
|
|
996
|
-
type:
|
|
997
|
-
onClose: () =>
|
|
991
|
+
xt && /* @__PURE__ */ c(Ee, {
|
|
992
|
+
item: xt.item,
|
|
993
|
+
type: xt.type,
|
|
994
|
+
onClose: () => St(null)
|
|
998
995
|
}),
|
|
999
|
-
/* @__PURE__ */
|
|
1000
|
-
items:
|
|
1001
|
-
isOpen:
|
|
1002
|
-
onClose: () =>
|
|
1003
|
-
onPause:
|
|
1004
|
-
onResume:
|
|
1005
|
-
onRetry:
|
|
1006
|
-
onCancel:
|
|
996
|
+
/* @__PURE__ */ c(Ne, {
|
|
997
|
+
items: Lt,
|
|
998
|
+
isOpen: Rt,
|
|
999
|
+
onClose: () => q(!1),
|
|
1000
|
+
onPause: nn,
|
|
1001
|
+
onResume: rn,
|
|
1002
|
+
onRetry: an,
|
|
1003
|
+
onCancel: on
|
|
1007
1004
|
}),
|
|
1008
|
-
/* @__PURE__ */
|
|
1009
|
-
toasts:
|
|
1010
|
-
onClose:
|
|
1005
|
+
/* @__PURE__ */ c(Oe, {
|
|
1006
|
+
toasts: b.toasts,
|
|
1007
|
+
onClose: b.removeToast
|
|
1011
1008
|
}),
|
|
1012
|
-
!
|
|
1009
|
+
!O && E.length === 0 && D.length === 0 && /* @__PURE__ */ c("div", {
|
|
1013
1010
|
className: "px-6 py-12",
|
|
1014
|
-
children:
|
|
1015
|
-
className: "text-center animate-in fade-in duration-
|
|
1011
|
+
children: v ? /* @__PURE__ */ l("div", {
|
|
1012
|
+
className: "text-center animate-in fade-in duration-200",
|
|
1016
1013
|
children: [
|
|
1017
|
-
/* @__PURE__ */
|
|
1014
|
+
/* @__PURE__ */ c("div", {
|
|
1018
1015
|
className: "inline-flex items-center justify-center size-16 bg-bg-sunken rounded-full mb-4",
|
|
1019
|
-
children: /* @__PURE__ */
|
|
1016
|
+
children: /* @__PURE__ */ c(Ye, { className: "size-8 text-text-tertiary" })
|
|
1020
1017
|
}),
|
|
1021
|
-
/* @__PURE__ */
|
|
1018
|
+
/* @__PURE__ */ c("h3", {
|
|
1022
1019
|
className: "text-lg font-medium text-text-primary mb-2",
|
|
1023
|
-
children: a(
|
|
1020
|
+
children: a(u, "files.browser.empty.search.title", "No results found")
|
|
1024
1021
|
}),
|
|
1025
|
-
/* @__PURE__ */
|
|
1022
|
+
/* @__PURE__ */ c("p", {
|
|
1026
1023
|
className: "text-sm text-text-secondary mb-4",
|
|
1027
|
-
children: a(
|
|
1024
|
+
children: a(u, "files.browser.empty.search.description", "Try adjusting your search query or filters")
|
|
1028
1025
|
}),
|
|
1029
|
-
/* @__PURE__ */
|
|
1026
|
+
/* @__PURE__ */ c("button", {
|
|
1030
1027
|
type: "button",
|
|
1031
1028
|
onClick: () => {
|
|
1032
|
-
|
|
1029
|
+
vt(""), bt(void 0);
|
|
1033
1030
|
},
|
|
1034
1031
|
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
|
-
children: a(
|
|
1032
|
+
children: a(u, "files.browser.search.clear", "Clear search")
|
|
1036
1033
|
})
|
|
1037
1034
|
]
|
|
1038
|
-
}) : /* @__PURE__ */
|
|
1039
|
-
type:
|
|
1040
|
-
onUpload:
|
|
1041
|
-
onNewFolder:
|
|
1035
|
+
}) : /* @__PURE__ */ c(De, {
|
|
1036
|
+
type: _,
|
|
1037
|
+
onUpload: _ === "all" ? en : void 0,
|
|
1038
|
+
onNewFolder: _ === "all" ? cn : void 0
|
|
1042
1039
|
})
|
|
1043
1040
|
})
|
|
1044
1041
|
]
|
|
1045
1042
|
});
|
|
1046
1043
|
}
|
|
1047
1044
|
//#endregion
|
|
1048
|
-
export {
|
|
1045
|
+
export { u as BrowserPage };
|
|
1049
1046
|
|
|
1050
1047
|
//# sourceMappingURL=BrowserPage.js.map
|