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