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