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