@burdenoff/microfe-files 2026.1115.1 → 2026.1115.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/files/components/CopyDialog.d.ts +6 -0
- package/dist/files/components/CopyDialog.js +112 -101
- package/dist/files/components/CopyDialog.js.map +1 -1
- package/dist/files/components/FileBrowser.js +175 -165
- package/dist/files/components/FileBrowser.js.map +1 -1
- package/dist/files/components/FileInfoPanel.d.ts +7 -1
- package/dist/files/components/FileInfoPanel.js +225 -184
- package/dist/files/components/FileInfoPanel.js.map +1 -1
- package/dist/files/components/SearchBar.d.ts +7 -1
- package/dist/files/components/SearchBar.js +166 -159
- package/dist/files/components/SearchBar.js.map +1 -1
- package/dist/files/components/ShareAccessParts.d.ts +9 -1
- package/dist/files/components/ShareAccessParts.js +31 -23
- package/dist/files/components/ShareAccessParts.js.map +1 -1
- package/dist/files/components/ShareDialog.d.ts +5 -4
- package/dist/files/components/ShareDialog.js +31 -27
- package/dist/files/components/ShareDialog.js.map +1 -1
- package/dist/files/pages/BrowserPage.js +274 -271
- package/dist/files/pages/BrowserPage.js.map +1 -1
- package/dist/files/pages/ShareAccessPage.js +52 -51
- package/dist/files/pages/ShareAccessPage.js.map +1 -1
- package/dist/files/utils/fileKind.d.ts +16 -0
- package/dist/files/utils/fileKind.js +120 -0
- package/dist/files/utils/fileKind.js.map +1 -0
- package/dist/files/utils/infoTechnicalDetails.d.ts +12 -0
- package/dist/files/utils/infoTechnicalDetails.js +16 -0
- package/dist/files/utils/infoTechnicalDetails.js.map +1 -0
- package/dist/files/utils/shareAccess.d.ts +6 -0
- package/dist/files/utils/shareAccess.js +6 -1
- package/dist/files/utils/shareAccess.js.map +1 -1
- package/dist/translations/en.d.ts +29 -0
- package/dist/translations/en.js +32 -1
- package/dist/translations/en.js.map +1 -1
- package/package.json +2 -2
|
@@ -12,22 +12,23 @@ import { useSharePermissions as oe } from "../hooks/useSharePermissions.js";
|
|
|
12
12
|
import { shareEntryDeniedReason as se, sharePermissionMessages as ce } from "../utils/sharePermission.js";
|
|
13
13
|
import { canStartFileDrag as le, canStartFolderDrag as ue, fileCapabilities as a, folderCapabilities as o, isShareOffered as de, shareLookupTarget as fe } from "../utils/itemCapabilities.js";
|
|
14
14
|
import { useDragDrop as pe } from "../hooks/useDragDrop.js";
|
|
15
|
-
import { useState as
|
|
16
|
-
import { ArrowDown as
|
|
17
|
-
import { Fragment as
|
|
18
|
-
import { useI18n as
|
|
15
|
+
import { useState as me } from "react";
|
|
16
|
+
import { ArrowDown as he, ArrowUp as ge, ArrowUpDown as _e, Folder as ve, Star as ye } from "lucide-react";
|
|
17
|
+
import { Fragment as be, jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
18
|
+
import { useI18n as xe } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
19
|
+
import { ShowTechnicalDetails as Se } from "@burdenoff/fe-libs/ui";
|
|
19
20
|
// src/files/components/FileBrowser.tsx
|
|
20
|
-
var
|
|
21
|
-
let { t: O } =
|
|
21
|
+
var l = ({ files: l, folders: Ce, loading: we = !1, error: u = null, preserveSortOrder: d = !1, onFilePreview: Te, onFileShare: f, onFileDelete: p, onFileRestore: m, onFileFavorite: h, onFileRename: g, onFileDownload: _, onFileCopy: v, onFileMove: y, onFileInfo: b, onFolderOpen: Ee, onFolderShare: x, onFolderDelete: S, onFolderRestore: C, onFolderRename: w, onFolderFavorite: T, onFolderCopy: De, onFolderMove: E, onFolderInfo: D, onMoveFile: Oe, onCopyFile: ke, onMoveFolder: Ae, onCopyFolder: je }) => {
|
|
22
|
+
let { t: O } = xe(), { viewMode: Me, sortBy: k, sortDirection: A, selectedFiles: Ne, selectedFolders: Pe } = e(), { navigationV2: Fe = !1 } = t(), [Ie, Le] = me(null), [Re, j] = me({
|
|
22
23
|
draggedItem: null,
|
|
23
24
|
dropTargetFolderId: null
|
|
24
|
-
}), [M,
|
|
25
|
-
onMoveFile:
|
|
26
|
-
onCopyFile:
|
|
27
|
-
onMoveFolder:
|
|
28
|
-
onCopyFolder:
|
|
29
|
-
}),
|
|
30
|
-
le(e, t) && (
|
|
25
|
+
}), [M, ze] = me(null), N = oe(), { draggedItem: P, startDrag: Be, endDrag: Ve, handleDrop: He } = pe({
|
|
26
|
+
onMoveFile: Oe,
|
|
27
|
+
onCopyFile: ke,
|
|
28
|
+
onMoveFolder: Ae,
|
|
29
|
+
onCopyFolder: je
|
|
30
|
+
}), Ue = (e, t) => {
|
|
31
|
+
le(e, t) && (Be({
|
|
31
32
|
type: "file",
|
|
32
33
|
item: e,
|
|
33
34
|
operation: t
|
|
@@ -39,8 +40,8 @@ var u = ({ files: u, folders: xe, loading: Se = !1, error: Ce = null, preserveSo
|
|
|
39
40
|
},
|
|
40
41
|
dropTargetFolderId: null
|
|
41
42
|
}));
|
|
42
|
-
},
|
|
43
|
-
ue(e, t) && (
|
|
43
|
+
}, We = (e, t) => {
|
|
44
|
+
ue(e, t) && (Be({
|
|
44
45
|
type: "folder",
|
|
45
46
|
item: e,
|
|
46
47
|
operation: t
|
|
@@ -52,69 +53,69 @@ var u = ({ files: u, folders: xe, loading: Se = !1, error: Ce = null, preserveSo
|
|
|
52
53
|
},
|
|
53
54
|
dropTargetFolderId: null
|
|
54
55
|
}));
|
|
55
|
-
},
|
|
56
|
-
|
|
56
|
+
}, Ge = () => {
|
|
57
|
+
Ve(), j({
|
|
57
58
|
draggedItem: null,
|
|
58
59
|
dropTargetFolderId: null
|
|
59
60
|
});
|
|
60
|
-
},
|
|
61
|
-
P && (await
|
|
61
|
+
}, Ke = async (e) => {
|
|
62
|
+
P && (await He(e.id), j({
|
|
62
63
|
draggedItem: null,
|
|
63
64
|
dropTargetFolderId: null
|
|
64
65
|
}));
|
|
65
|
-
},
|
|
66
|
+
}, qe = (e) => {
|
|
66
67
|
j((t) => ({
|
|
67
68
|
...t,
|
|
68
69
|
dropTargetFolderId: e
|
|
69
70
|
}));
|
|
70
|
-
},
|
|
71
|
+
}, Je = () => {
|
|
71
72
|
j((e) => ({
|
|
72
73
|
...e,
|
|
73
74
|
dropTargetFolderId: null
|
|
74
75
|
}));
|
|
75
|
-
},
|
|
76
|
+
}, Ye = (e, t, n) => {
|
|
76
77
|
let r = z(e);
|
|
77
|
-
|
|
78
|
+
f && r && N.ensure(r), ze({
|
|
78
79
|
item: e,
|
|
79
80
|
type: "file",
|
|
80
81
|
x: t,
|
|
81
82
|
y: n
|
|
82
83
|
});
|
|
83
|
-
},
|
|
84
|
+
}, Xe = (e, t, n) => {
|
|
84
85
|
let r = W(e);
|
|
85
|
-
x && r && N.ensure(r),
|
|
86
|
+
x && r && N.ensure(r), ze({
|
|
86
87
|
item: e,
|
|
87
88
|
type: "folder",
|
|
88
89
|
x: t,
|
|
89
90
|
y: n
|
|
90
91
|
});
|
|
91
|
-
},
|
|
92
|
-
|
|
93
|
-
},
|
|
92
|
+
}, Ze = () => {
|
|
93
|
+
ze(null);
|
|
94
|
+
}, Qe = (e) => a(e).canPreview, F = (e) => a(e).canCopy, I = (e) => a(e).canUpdate, L = (e) => a(e).canMove, R = (e) => a(e).canDelete, $e = (e) => L(e) || F(e), et = (e) => de(a(e).share), z = (e) => fe(a(e).share), tt = (e) => o(e).canOpen, B = (e) => o(e).canUpdate, V = (e) => o(e).canMove, H = (e) => o(e).canDelete, nt = (e) => V(e) || !!je, rt = (e) => o(e).canAcceptDrop, U = (e) => de(o(e).share), W = (e) => fe(o(e).share), it = ce(O), at = (e) => e ? se(N.statusOf(e), it) : void 0, ot = (e) => at(z(e)), G = (e) => at(W(e)), K = f ? (e) => {
|
|
94
95
|
let t = z(e);
|
|
95
|
-
|
|
96
|
+
f(e, t ? N.guard(t) : void 0);
|
|
96
97
|
} : void 0, q = x ? (e) => {
|
|
97
98
|
let t = W(e);
|
|
98
99
|
x(e, t ? N.guard(t) : void 0);
|
|
99
|
-
} : void 0, J = (e) => !e || !(e.kind === "file" ?
|
|
100
|
+
} : void 0, J = (e) => !e || !(e.kind === "file" ? f : x) ? {} : {
|
|
100
101
|
onPointerOver: () => N.prefetch(e),
|
|
101
102
|
onPointerDown: () => N.ensure(e),
|
|
102
103
|
onFocus: () => N.ensure(e)
|
|
103
|
-
},
|
|
104
|
+
}, st = () => {
|
|
104
105
|
if (!M) return [];
|
|
105
106
|
if (M.type === "file") {
|
|
106
107
|
let e = M.item;
|
|
107
108
|
return re({
|
|
108
|
-
onShare: K &&
|
|
109
|
-
shareDeniedReason:
|
|
110
|
-
onDownload:
|
|
111
|
-
onCopy:
|
|
112
|
-
onRename:
|
|
113
|
-
onStar:
|
|
114
|
-
onMove:
|
|
115
|
-
onInfo:
|
|
116
|
-
onDelete:
|
|
117
|
-
onRestore:
|
|
109
|
+
onShare: K && et(e) ? () => K(e) : void 0,
|
|
110
|
+
shareDeniedReason: ot(e),
|
|
111
|
+
onDownload: _ ? () => _(e) : void 0,
|
|
112
|
+
onCopy: v && F(e) ? () => v(e) : void 0,
|
|
113
|
+
onRename: g && I(e) ? () => g(e) : void 0,
|
|
114
|
+
onStar: h && I(e) ? () => h(e) : void 0,
|
|
115
|
+
onMove: y && L(e) ? () => y(e) : void 0,
|
|
116
|
+
onInfo: b ? () => b(e) : void 0,
|
|
117
|
+
onDelete: p && R(e) ? () => p(e) : void 0,
|
|
118
|
+
onRestore: m ? () => m(e) : void 0,
|
|
118
119
|
isStarred: e.starred
|
|
119
120
|
}, O);
|
|
120
121
|
}
|
|
@@ -132,54 +133,63 @@ var u = ({ files: u, folders: xe, loading: Se = !1, error: Ce = null, preserveSo
|
|
|
132
133
|
isStarred: e.starred
|
|
133
134
|
}, O);
|
|
134
135
|
}
|
|
135
|
-
}, Y =
|
|
136
|
+
}, Y = d ? l : ae(l, k, A), X = d ? Ce : ae(Ce, k, A), Z = Fe && !d, Q = (e) => k === e ? A === "asc" ? "ascending" : "descending" : "none", ct = (t) => {
|
|
136
137
|
e.setState((e) => ({
|
|
137
138
|
sortBy: t,
|
|
138
139
|
sortDirection: e.sortBy === t && e.sortDirection === "asc" ? "desc" : "asc"
|
|
139
140
|
}));
|
|
140
141
|
}, $ = (e, t, n = "start") => {
|
|
141
142
|
if (!Z) return t;
|
|
142
|
-
let r = k === e, ee = r ? A === "asc" ?
|
|
143
|
-
return /* @__PURE__ */
|
|
143
|
+
let r = k === e, ee = r ? A === "asc" ? ge : he : _e;
|
|
144
|
+
return /* @__PURE__ */ c("button", {
|
|
144
145
|
type: "button",
|
|
145
|
-
onClick: () =>
|
|
146
|
+
onClick: () => ct(e),
|
|
146
147
|
className: `inline-flex items-center gap-1 rounded px-1 -mx-1 transition-colors hover:text-text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-action-primary-border ${n === "end" ? "flex-row-reverse" : ""} ${r ? "text-text-primary" : ""}`,
|
|
147
148
|
"aria-label": i(O, "files.browser.sortBy", "Sort by {{column}}", { column: t }),
|
|
148
|
-
children: [t, /* @__PURE__ */
|
|
149
|
+
children: [t, /* @__PURE__ */ s(ee, {
|
|
149
150
|
className: "size-3.5",
|
|
150
151
|
"aria-hidden": "true"
|
|
151
152
|
})]
|
|
152
153
|
});
|
|
153
154
|
};
|
|
154
|
-
return
|
|
155
|
+
return we ? /* @__PURE__ */ s("div", {
|
|
155
156
|
className: "@container p-page-padding",
|
|
156
157
|
role: "status",
|
|
157
158
|
"aria-busy": "true",
|
|
158
159
|
"aria-label": i(O, "files.browser.loading", "Loading files…"),
|
|
159
|
-
children: /* @__PURE__ */
|
|
160
|
+
children: /* @__PURE__ */ s("div", {
|
|
160
161
|
className: "grid grid-cols-2 gap-4 @md:grid-cols-3 @lg:grid-cols-4 @xl:grid-cols-5",
|
|
161
|
-
children: Array.from({ length: 10 }).map((e, t) => /* @__PURE__ */
|
|
162
|
+
children: Array.from({ length: 10 }).map((e, t) => /* @__PURE__ */ c("div", {
|
|
162
163
|
className: "overflow-hidden rounded-card border border-border-seam bg-bg-surface",
|
|
163
|
-
children: [/* @__PURE__ */
|
|
164
|
+
children: [/* @__PURE__ */ s("div", { className: "aspect-[4/3] w-full animate-vc-shimmer bg-bg-sunken" }), /* @__PURE__ */ c("div", {
|
|
164
165
|
className: "space-y-2 p-3",
|
|
165
|
-
children: [/* @__PURE__ */
|
|
166
|
+
children: [/* @__PURE__ */ s("div", { className: "h-3 w-3/4 animate-vc-shimmer rounded bg-bg-sunken" }), /* @__PURE__ */ s("div", { className: "h-3 w-1/2 animate-vc-shimmer rounded bg-bg-sunken" })]
|
|
166
167
|
})]
|
|
167
168
|
}, t))
|
|
168
169
|
})
|
|
169
|
-
}) :
|
|
170
|
+
}) : u ? /* @__PURE__ */ s("div", {
|
|
170
171
|
className: "flex items-center justify-center min-h-[500px]",
|
|
171
|
-
children: /* @__PURE__ */
|
|
172
|
+
children: /* @__PURE__ */ c("div", {
|
|
172
173
|
className: "text-center max-w-md",
|
|
173
174
|
children: [
|
|
174
|
-
/* @__PURE__ */
|
|
175
|
+
/* @__PURE__ */ s("div", {
|
|
175
176
|
className: "mb-3 text-xl font-semibold text-status-error-text",
|
|
176
177
|
children: i(O, "files.browser.loadError", "Failed to load files")
|
|
177
178
|
}),
|
|
178
|
-
/* @__PURE__ */ c("
|
|
179
|
+
Fe ? /* @__PURE__ */ c("div", {
|
|
180
|
+
className: "mb-6 space-y-2",
|
|
181
|
+
children: [/* @__PURE__ */ s("p", {
|
|
182
|
+
className: "text-sm text-text-secondary",
|
|
183
|
+
children: i(O, "files.browser.loadErrorHelp", "Something went wrong while loading your files. Try again in a moment.")
|
|
184
|
+
}), u.message && /* @__PURE__ */ s(Se, {
|
|
185
|
+
copyable: !0,
|
|
186
|
+
children: u.message
|
|
187
|
+
})]
|
|
188
|
+
}) : /* @__PURE__ */ s("p", {
|
|
179
189
|
className: "mb-6 text-sm text-text-secondary",
|
|
180
|
-
children:
|
|
190
|
+
children: u.message || i(O, "files.browser.unexpectedError", "An unexpected error occurred")
|
|
181
191
|
}),
|
|
182
|
-
/* @__PURE__ */
|
|
192
|
+
/* @__PURE__ */ s("button", {
|
|
183
193
|
type: "button",
|
|
184
194
|
onClick: () => window.location.reload(),
|
|
185
195
|
className: "rounded-lg bg-action-primary-bg px-6 py-2.5 text-sm font-medium text-text-inverse transition-colors hover:bg-action-primary-bg-hover",
|
|
@@ -187,71 +197,71 @@ var u = ({ files: u, folders: xe, loading: Se = !1, error: Ce = null, preserveSo
|
|
|
187
197
|
})
|
|
188
198
|
]
|
|
189
199
|
})
|
|
190
|
-
}) :
|
|
200
|
+
}) : l.length === 0 && Ce.length === 0 ? /* @__PURE__ */ s(be, { children: M && /* @__PURE__ */ s(ne, {
|
|
191
201
|
x: M.x,
|
|
192
202
|
y: M.y,
|
|
193
|
-
onClose:
|
|
194
|
-
items:
|
|
195
|
-
}) }) :
|
|
203
|
+
onClose: Ze,
|
|
204
|
+
items: st()
|
|
205
|
+
}) }) : Me === "list" ? Me === "list" ? /* @__PURE__ */ c("div", {
|
|
196
206
|
className: "@container bg-bg-canvas",
|
|
197
207
|
children: [
|
|
198
|
-
/* @__PURE__ */
|
|
208
|
+
/* @__PURE__ */ c("div", {
|
|
199
209
|
role: Z ? "row" : void 0,
|
|
200
210
|
className: "hidden @md:flex items-center gap-3 px-3 py-2 bg-bg-surface border-b border-border-seam text-text-secondary font-text-sm font-weight-medium",
|
|
201
211
|
children: [
|
|
202
|
-
/* @__PURE__ */
|
|
203
|
-
/* @__PURE__ */
|
|
204
|
-
/* @__PURE__ */
|
|
212
|
+
/* @__PURE__ */ s("div", { className: "flex-shrink-0 w-4" }),
|
|
213
|
+
/* @__PURE__ */ s("div", { className: "flex-shrink-0 w-6" }),
|
|
214
|
+
/* @__PURE__ */ s("div", {
|
|
205
215
|
className: "flex-1",
|
|
206
216
|
role: Z ? "columnheader" : void 0,
|
|
207
217
|
"aria-sort": Z ? Q("name") : void 0,
|
|
208
218
|
children: $("name", i(O, "files.browser.name", "Name"))
|
|
209
219
|
}),
|
|
210
|
-
/* @__PURE__ */
|
|
220
|
+
/* @__PURE__ */ s("div", {
|
|
211
221
|
className: "hidden @lg:block flex-shrink-0 w-40",
|
|
212
222
|
role: Z ? "columnheader" : void 0,
|
|
213
223
|
"aria-sort": Z ? Q("owner") : void 0,
|
|
214
224
|
children: $("owner", i(O, "files.browser.owner", "Owner"))
|
|
215
225
|
}),
|
|
216
|
-
/* @__PURE__ */
|
|
226
|
+
/* @__PURE__ */ s("div", {
|
|
217
227
|
className: "hidden @md:block flex-shrink-0 w-24 text-right",
|
|
218
228
|
role: Z ? "columnheader" : void 0,
|
|
219
229
|
"aria-sort": Z ? Q("size") : void 0,
|
|
220
230
|
children: $("size", i(O, "files.browser.size", "Size"), "end")
|
|
221
231
|
}),
|
|
222
|
-
/* @__PURE__ */
|
|
232
|
+
/* @__PURE__ */ s("div", {
|
|
223
233
|
className: "hidden @lg:block flex-shrink-0 w-32 text-right",
|
|
224
234
|
role: Z ? "columnheader" : void 0,
|
|
225
235
|
"aria-sort": Z ? Q("modified") : void 0,
|
|
226
236
|
children: $("modified", i(O, "files.browser.modified", "Modified"), "end")
|
|
227
237
|
}),
|
|
228
|
-
/* @__PURE__ */
|
|
238
|
+
/* @__PURE__ */ s("div", { className: "flex-shrink-0 w-32" })
|
|
229
239
|
]
|
|
230
240
|
}),
|
|
231
|
-
/* @__PURE__ */
|
|
241
|
+
/* @__PURE__ */ c("div", {
|
|
232
242
|
className: "divide-y divide-border-subtle",
|
|
233
|
-
children: [X.map((t) => /* @__PURE__ */
|
|
234
|
-
className: `group flex items-center gap-3 border-b border-border-seam bg-bg-surface p-3 transition-colors hover:bg-bg-sunken focus-within:bg-bg-sunken ${
|
|
243
|
+
children: [X.map((t) => /* @__PURE__ */ c("div", {
|
|
244
|
+
className: `group flex items-center gap-3 border-b border-border-seam bg-bg-surface p-3 transition-colors hover:bg-bg-sunken focus-within:bg-bg-sunken ${Re.dropTargetFolderId === t.id && P?.item.id !== t.id ? "bg-action-primary-bg/10" : ""} ${P?.item.id === t.id ? "opacity-50" : ""}`,
|
|
235
245
|
onClick: () => {
|
|
236
|
-
|
|
246
|
+
tt(t) && Ee?.(t);
|
|
237
247
|
},
|
|
238
248
|
onDragOver: (e) => {
|
|
239
|
-
P && P.item.id !== t.id &&
|
|
249
|
+
P && P.item.id !== t.id && rt(t) && (e.preventDefault(), qe(t.id));
|
|
240
250
|
},
|
|
241
|
-
onDragLeave:
|
|
251
|
+
onDragLeave: Je,
|
|
242
252
|
onDrop: async (e) => {
|
|
243
|
-
e.preventDefault(), P && P.item.id !== t.id &&
|
|
253
|
+
e.preventDefault(), P && P.item.id !== t.id && rt(t) && await Ke(t);
|
|
244
254
|
},
|
|
245
255
|
onContextMenu: (e) => {
|
|
246
|
-
e.preventDefault(),
|
|
256
|
+
e.preventDefault(), Xe(t, e.clientX, e.clientY);
|
|
247
257
|
},
|
|
248
258
|
...J(W(t)),
|
|
249
259
|
children: [
|
|
250
|
-
/* @__PURE__ */
|
|
260
|
+
/* @__PURE__ */ s("div", {
|
|
251
261
|
className: "flex-shrink-0",
|
|
252
|
-
children: /* @__PURE__ */
|
|
262
|
+
children: /* @__PURE__ */ s("input", {
|
|
253
263
|
type: "checkbox",
|
|
254
|
-
checked:
|
|
264
|
+
checked: Pe.has(t.id),
|
|
255
265
|
onChange: (n) => {
|
|
256
266
|
n.stopPropagation(), e.getState().toggleFolderSelection(t.id);
|
|
257
267
|
},
|
|
@@ -259,39 +269,39 @@ var u = ({ files: u, folders: xe, loading: Se = !1, error: Ce = null, preserveSo
|
|
|
259
269
|
"aria-label": `Select ${t.name}`
|
|
260
270
|
})
|
|
261
271
|
}),
|
|
262
|
-
/* @__PURE__ */
|
|
263
|
-
/* @__PURE__ */
|
|
272
|
+
/* @__PURE__ */ s(ve, { className: "size-6 text-action-primary-bg flex-shrink-0" }),
|
|
273
|
+
/* @__PURE__ */ s("div", {
|
|
264
274
|
className: "flex-1 min-w-0",
|
|
265
|
-
children: /* @__PURE__ */
|
|
275
|
+
children: /* @__PURE__ */ c("div", {
|
|
266
276
|
className: "flex items-center gap-2",
|
|
267
|
-
children: [/* @__PURE__ */
|
|
277
|
+
children: [/* @__PURE__ */ s("button", {
|
|
268
278
|
type: "button",
|
|
269
279
|
onClick: (e) => {
|
|
270
|
-
e.stopPropagation(),
|
|
280
|
+
e.stopPropagation(), tt(t) && Ee?.(t);
|
|
271
281
|
},
|
|
272
282
|
className: "min-w-0 truncate rounded-sm text-left font-text-md font-weight-medium text-text-primary focus:outline-none focus-visible:ring-2 focus-visible:ring-action-primary-bg",
|
|
273
283
|
"aria-label": `${i(O, "files.browser.openFolder", "Open folder")} ${t.name}`,
|
|
274
284
|
children: t.name
|
|
275
|
-
}), t.starred && /* @__PURE__ */
|
|
285
|
+
}), t.starred && /* @__PURE__ */ s(ye, { className: "size-3 flex-shrink-0 fill-status-warning-text text-status-warning-text" })]
|
|
276
286
|
})
|
|
277
287
|
}),
|
|
278
|
-
/* @__PURE__ */
|
|
288
|
+
/* @__PURE__ */ s("div", {
|
|
279
289
|
className: "hidden @lg:block flex-shrink-0 w-40",
|
|
280
|
-
children: t.createdBy && /* @__PURE__ */
|
|
290
|
+
children: t.createdBy && /* @__PURE__ */ c("div", {
|
|
281
291
|
className: "flex items-center gap-2",
|
|
282
|
-
children: [t.createdBy.avatar && /* @__PURE__ */
|
|
292
|
+
children: [t.createdBy.avatar && /* @__PURE__ */ s("img", {
|
|
283
293
|
src: t.createdBy.avatar,
|
|
284
294
|
alt: t.createdBy.name,
|
|
285
295
|
className: "size-6 rounded-full"
|
|
286
|
-
}), /* @__PURE__ */
|
|
296
|
+
}), /* @__PURE__ */ s("span", {
|
|
287
297
|
className: "font-text-sm text-text-secondary truncate",
|
|
288
298
|
children: t.createdBy.name
|
|
289
299
|
})]
|
|
290
300
|
})
|
|
291
301
|
}),
|
|
292
|
-
/* @__PURE__ */
|
|
302
|
+
/* @__PURE__ */ s("div", {
|
|
293
303
|
className: "hidden @md:block flex-shrink-0 w-24 text-right",
|
|
294
|
-
children: /* @__PURE__ */
|
|
304
|
+
children: /* @__PURE__ */ c("span", {
|
|
295
305
|
className: "font-text-sm text-text-secondary",
|
|
296
306
|
children: [
|
|
297
307
|
(t.filesCount ?? 0) + (t.subfoldersCount ?? 0),
|
|
@@ -300,17 +310,17 @@ var u = ({ files: u, folders: xe, loading: Se = !1, error: Ce = null, preserveSo
|
|
|
300
310
|
]
|
|
301
311
|
})
|
|
302
312
|
}),
|
|
303
|
-
/* @__PURE__ */
|
|
313
|
+
/* @__PURE__ */ s("div", {
|
|
304
314
|
className: "hidden @lg:block flex-shrink-0 w-32 text-right",
|
|
305
|
-
children: /* @__PURE__ */
|
|
315
|
+
children: /* @__PURE__ */ s("span", {
|
|
306
316
|
className: "font-text-sm text-text-secondary",
|
|
307
317
|
children: new Date(t.updatedAt).toLocaleDateString()
|
|
308
318
|
})
|
|
309
319
|
}),
|
|
310
|
-
/* @__PURE__ */
|
|
320
|
+
/* @__PURE__ */ c("div", {
|
|
311
321
|
className: "flex w-32 flex-shrink-0 items-center gap-1 opacity-0 transition-opacity group-hover:opacity-100 group-focus-within:opacity-100",
|
|
312
322
|
children: [
|
|
313
|
-
U(t) && q && /* @__PURE__ */
|
|
323
|
+
U(t) && q && /* @__PURE__ */ s("button", {
|
|
314
324
|
type: "button",
|
|
315
325
|
onClick: (e) => {
|
|
316
326
|
e.stopPropagation(), q(t);
|
|
@@ -319,12 +329,12 @@ var u = ({ files: u, folders: xe, loading: Se = !1, error: Ce = null, preserveSo
|
|
|
319
329
|
className: `p-1.5 rounded transition-colors hover:bg-action-ghost-bg-hover ${G(t) === void 0 ? "" : "opacity-50"}`,
|
|
320
330
|
"aria-label": i(O, "files.browser.share", "Share"),
|
|
321
331
|
title: G(t) ?? i(O, "files.browser.shareFolder", "Share folder"),
|
|
322
|
-
children: /* @__PURE__ */
|
|
332
|
+
children: /* @__PURE__ */ s("svg", {
|
|
323
333
|
className: "size-4 text-text-primary",
|
|
324
334
|
fill: "none",
|
|
325
335
|
viewBox: "0 0 24 24",
|
|
326
336
|
stroke: "currentColor",
|
|
327
|
-
children: /* @__PURE__ */
|
|
337
|
+
children: /* @__PURE__ */ s("path", {
|
|
328
338
|
strokeLinecap: "round",
|
|
329
339
|
strokeLinejoin: "round",
|
|
330
340
|
strokeWidth: 2,
|
|
@@ -332,7 +342,7 @@ var u = ({ files: u, folders: xe, loading: Se = !1, error: Ce = null, preserveSo
|
|
|
332
342
|
})
|
|
333
343
|
})
|
|
334
344
|
}),
|
|
335
|
-
B(t) && w && /* @__PURE__ */
|
|
345
|
+
B(t) && w && /* @__PURE__ */ s("button", {
|
|
336
346
|
type: "button",
|
|
337
347
|
onClick: (e) => {
|
|
338
348
|
e.stopPropagation(), w(t);
|
|
@@ -340,12 +350,12 @@ var u = ({ files: u, folders: xe, loading: Se = !1, error: Ce = null, preserveSo
|
|
|
340
350
|
className: "hidden @md:block p-1.5 hover:bg-action-ghost-bg-hover rounded transition-colors",
|
|
341
351
|
"aria-label": i(O, "files.browser.rename", "Rename"),
|
|
342
352
|
title: i(O, "files.browser.rename", "Rename"),
|
|
343
|
-
children: /* @__PURE__ */
|
|
353
|
+
children: /* @__PURE__ */ s("svg", {
|
|
344
354
|
className: "size-4 text-text-primary",
|
|
345
355
|
fill: "none",
|
|
346
356
|
viewBox: "0 0 24 24",
|
|
347
357
|
stroke: "currentColor",
|
|
348
|
-
children: /* @__PURE__ */
|
|
358
|
+
children: /* @__PURE__ */ s("path", {
|
|
349
359
|
strokeLinecap: "round",
|
|
350
360
|
strokeLinejoin: "round",
|
|
351
361
|
strokeWidth: 2,
|
|
@@ -353,7 +363,7 @@ var u = ({ files: u, folders: xe, loading: Se = !1, error: Ce = null, preserveSo
|
|
|
353
363
|
})
|
|
354
364
|
})
|
|
355
365
|
}),
|
|
356
|
-
H(t) && S && /* @__PURE__ */
|
|
366
|
+
H(t) && S && /* @__PURE__ */ s("button", {
|
|
357
367
|
type: "button",
|
|
358
368
|
onClick: (e) => {
|
|
359
369
|
e.stopPropagation(), S(t);
|
|
@@ -361,12 +371,12 @@ var u = ({ files: u, folders: xe, loading: Se = !1, error: Ce = null, preserveSo
|
|
|
361
371
|
className: "p-1.5 hover:bg-action-danger-bg-hover rounded transition-colors",
|
|
362
372
|
"aria-label": i(O, "files.browser.delete", "Delete"),
|
|
363
373
|
title: i(O, "files.browser.delete", "Delete"),
|
|
364
|
-
children: /* @__PURE__ */
|
|
374
|
+
children: /* @__PURE__ */ s("svg", {
|
|
365
375
|
className: "size-4 text-status-error-text",
|
|
366
376
|
fill: "none",
|
|
367
377
|
viewBox: "0 0 24 24",
|
|
368
378
|
stroke: "currentColor",
|
|
369
|
-
children: /* @__PURE__ */
|
|
379
|
+
children: /* @__PURE__ */ s("path", {
|
|
370
380
|
strokeLinecap: "round",
|
|
371
381
|
strokeLinejoin: "round",
|
|
372
382
|
strokeWidth: 2,
|
|
@@ -374,9 +384,9 @@ var u = ({ files: u, folders: xe, loading: Se = !1, error: Ce = null, preserveSo
|
|
|
374
384
|
})
|
|
375
385
|
})
|
|
376
386
|
}),
|
|
377
|
-
/* @__PURE__ */
|
|
387
|
+
/* @__PURE__ */ s("div", {
|
|
378
388
|
onClick: (e) => e.stopPropagation(),
|
|
379
|
-
children: /* @__PURE__ */
|
|
389
|
+
children: /* @__PURE__ */ s(te, {
|
|
380
390
|
items: ie({
|
|
381
391
|
onShare: U(t) && q ? () => q(t) : void 0,
|
|
382
392
|
shareDeniedReason: G(t),
|
|
@@ -388,122 +398,122 @@ var u = ({ files: u, folders: xe, loading: Se = !1, error: Ce = null, preserveSo
|
|
|
388
398
|
onDelete: H(t) && S ? () => S(t) : void 0,
|
|
389
399
|
isStarred: t.starred
|
|
390
400
|
}, O),
|
|
391
|
-
isOpen:
|
|
401
|
+
isOpen: Ie === t.id,
|
|
392
402
|
onToggle: (e) => {
|
|
393
403
|
let n = W(t);
|
|
394
|
-
e && x && n && N.ensure(n),
|
|
404
|
+
e && x && n && N.ensure(n), Le(e ? t.id : null);
|
|
395
405
|
}
|
|
396
406
|
})
|
|
397
407
|
})
|
|
398
408
|
]
|
|
399
409
|
})
|
|
400
410
|
]
|
|
401
|
-
}, t.id)), Y.map((e) => /* @__PURE__ */
|
|
411
|
+
}, t.id)), Y.map((e) => /* @__PURE__ */ s("div", {
|
|
402
412
|
className: "contents",
|
|
403
413
|
...J(z(e)),
|
|
404
|
-
children: /* @__PURE__ */
|
|
414
|
+
children: /* @__PURE__ */ s(r, {
|
|
405
415
|
file: e,
|
|
406
|
-
isSelected:
|
|
416
|
+
isSelected: Ne.has(e.id),
|
|
407
417
|
isDragging: P?.item.id === e.id,
|
|
408
|
-
onPreview:
|
|
409
|
-
onShare:
|
|
410
|
-
shareDeniedReason:
|
|
411
|
-
onDelete:
|
|
412
|
-
onRestore:
|
|
413
|
-
onFavorite: I(e) ?
|
|
414
|
-
onRename: I(e) ?
|
|
415
|
-
onDownload:
|
|
416
|
-
onCopy: F(e) ?
|
|
417
|
-
onMove: L(e) ?
|
|
418
|
-
onInfo:
|
|
419
|
-
onDragStart: $e(e) ?
|
|
420
|
-
onDragEnd:
|
|
421
|
-
onContextMenu:
|
|
418
|
+
onPreview: Qe(e) ? Te : void 0,
|
|
419
|
+
onShare: et(e) ? K : void 0,
|
|
420
|
+
shareDeniedReason: ot(e),
|
|
421
|
+
onDelete: R(e) ? p : void 0,
|
|
422
|
+
onRestore: m,
|
|
423
|
+
onFavorite: I(e) ? h : void 0,
|
|
424
|
+
onRename: I(e) ? g : void 0,
|
|
425
|
+
onDownload: _,
|
|
426
|
+
onCopy: F(e) ? v : void 0,
|
|
427
|
+
onMove: L(e) ? y : void 0,
|
|
428
|
+
onInfo: b,
|
|
429
|
+
onDragStart: $e(e) ? Ue : void 0,
|
|
430
|
+
onDragEnd: Ge,
|
|
431
|
+
onContextMenu: Ye
|
|
422
432
|
})
|
|
423
433
|
}, e.id))]
|
|
424
434
|
}),
|
|
425
|
-
M && /* @__PURE__ */
|
|
435
|
+
M && /* @__PURE__ */ s(ne, {
|
|
426
436
|
x: M.x,
|
|
427
437
|
y: M.y,
|
|
428
|
-
onClose:
|
|
429
|
-
items:
|
|
438
|
+
onClose: Ze,
|
|
439
|
+
items: st()
|
|
430
440
|
})
|
|
431
441
|
]
|
|
432
|
-
}) : null : /* @__PURE__ */
|
|
442
|
+
}) : null : /* @__PURE__ */ c("div", {
|
|
433
443
|
className: "@container bg-bg-canvas p-page-padding",
|
|
434
444
|
children: [
|
|
435
|
-
X.length > 0 && /* @__PURE__ */
|
|
445
|
+
X.length > 0 && /* @__PURE__ */ c("div", {
|
|
436
446
|
className: Y.length > 0 ? "mb-6" : "",
|
|
437
|
-
children: [Y.length > 0 && /* @__PURE__ */
|
|
447
|
+
children: [Y.length > 0 && /* @__PURE__ */ s("h2", {
|
|
438
448
|
className: "text-xs font-semibold text-text-tertiary uppercase tracking-wider mb-3 px-1",
|
|
439
449
|
children: i(O, "files.browser.section.folders", "Folders")
|
|
440
|
-
}), /* @__PURE__ */
|
|
450
|
+
}), /* @__PURE__ */ s("div", {
|
|
441
451
|
className: "grid grid-cols-1 @sm:grid-cols-2 @lg:grid-cols-3 @xl:grid-cols-4 gap-2",
|
|
442
|
-
children: X.map((e) => /* @__PURE__ */
|
|
452
|
+
children: X.map((e) => /* @__PURE__ */ s("div", {
|
|
443
453
|
className: "contents",
|
|
444
454
|
...J(W(e)),
|
|
445
|
-
children: /* @__PURE__ */
|
|
455
|
+
children: /* @__PURE__ */ s(ee, {
|
|
446
456
|
folder: e,
|
|
447
|
-
isSelected:
|
|
457
|
+
isSelected: Pe.has(e.id),
|
|
448
458
|
isDragging: P?.item.id === e.id,
|
|
449
|
-
isDropTarget:
|
|
459
|
+
isDropTarget: Re.dropTargetFolderId === e.id,
|
|
450
460
|
draggedItem: P,
|
|
451
|
-
onOpen:
|
|
461
|
+
onOpen: tt(e) ? Ee : void 0,
|
|
452
462
|
onShare: U(e) ? q : void 0,
|
|
453
463
|
shareDeniedReason: G(e),
|
|
454
464
|
onDelete: H(e) ? S : void 0,
|
|
455
465
|
onRestore: C,
|
|
456
466
|
onRename: B(e) ? w : void 0,
|
|
457
467
|
onFavorite: B(e) ? T : void 0,
|
|
458
|
-
onCopy:
|
|
468
|
+
onCopy: De,
|
|
459
469
|
onMove: V(e) ? E : void 0,
|
|
460
470
|
onInfo: D,
|
|
461
|
-
onDragStart:
|
|
462
|
-
onDragEnd:
|
|
463
|
-
onDrop:
|
|
464
|
-
onContextMenu:
|
|
471
|
+
onDragStart: nt(e) ? We : void 0,
|
|
472
|
+
onDragEnd: Ge,
|
|
473
|
+
onDrop: rt(e) ? Ke : void 0,
|
|
474
|
+
onContextMenu: Xe
|
|
465
475
|
})
|
|
466
476
|
}, e.id))
|
|
467
477
|
})]
|
|
468
478
|
}),
|
|
469
|
-
Y.length > 0 && /* @__PURE__ */
|
|
479
|
+
Y.length > 0 && /* @__PURE__ */ c("div", { children: [X.length > 0 && /* @__PURE__ */ s("h2", {
|
|
470
480
|
className: "text-xs font-semibold text-text-tertiary uppercase tracking-wider mb-3 px-1",
|
|
471
481
|
children: i(O, "files.browser.section.files", "Files")
|
|
472
|
-
}), /* @__PURE__ */
|
|
482
|
+
}), /* @__PURE__ */ s("div", {
|
|
473
483
|
className: "grid grid-cols-2 @md:grid-cols-3 @lg:grid-cols-4 @xl:grid-cols-5 gap-4",
|
|
474
|
-
children: Y.map((e) => /* @__PURE__ */
|
|
484
|
+
children: Y.map((e) => /* @__PURE__ */ s("div", {
|
|
475
485
|
className: "contents",
|
|
476
486
|
...J(z(e)),
|
|
477
|
-
children: /* @__PURE__ */
|
|
487
|
+
children: /* @__PURE__ */ s(n, {
|
|
478
488
|
file: e,
|
|
479
|
-
isSelected:
|
|
489
|
+
isSelected: Ne.has(e.id),
|
|
480
490
|
isDragging: P?.item.id === e.id,
|
|
481
|
-
onPreview:
|
|
482
|
-
onShare:
|
|
483
|
-
shareDeniedReason:
|
|
484
|
-
onDelete:
|
|
485
|
-
onRestore:
|
|
486
|
-
onFavorite: I(e) ?
|
|
487
|
-
onRename: I(e) ?
|
|
488
|
-
onDownload:
|
|
489
|
-
onCopy: F(e) ?
|
|
490
|
-
onMove: L(e) ?
|
|
491
|
-
onInfo:
|
|
492
|
-
onDragStart: $e(e) ?
|
|
493
|
-
onDragEnd:
|
|
494
|
-
onContextMenu:
|
|
491
|
+
onPreview: Qe(e) ? Te : void 0,
|
|
492
|
+
onShare: et(e) ? K : void 0,
|
|
493
|
+
shareDeniedReason: ot(e),
|
|
494
|
+
onDelete: R(e) ? p : void 0,
|
|
495
|
+
onRestore: m,
|
|
496
|
+
onFavorite: I(e) ? h : void 0,
|
|
497
|
+
onRename: I(e) ? g : void 0,
|
|
498
|
+
onDownload: _,
|
|
499
|
+
onCopy: F(e) ? v : void 0,
|
|
500
|
+
onMove: L(e) ? y : void 0,
|
|
501
|
+
onInfo: b,
|
|
502
|
+
onDragStart: $e(e) ? Ue : void 0,
|
|
503
|
+
onDragEnd: Ge,
|
|
504
|
+
onContextMenu: Ye
|
|
495
505
|
})
|
|
496
506
|
}, e.id))
|
|
497
507
|
})] }),
|
|
498
|
-
M && /* @__PURE__ */
|
|
508
|
+
M && /* @__PURE__ */ s(ne, {
|
|
499
509
|
x: M.x,
|
|
500
510
|
y: M.y,
|
|
501
|
-
onClose:
|
|
502
|
-
items:
|
|
511
|
+
onClose: Ze,
|
|
512
|
+
items: st()
|
|
503
513
|
})
|
|
504
514
|
]
|
|
505
515
|
});
|
|
506
516
|
};
|
|
507
|
-
export {
|
|
517
|
+
export { l as FileBrowser };
|
|
508
518
|
|
|
509
519
|
//# sourceMappingURL=FileBrowser.js.map
|