@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.
Files changed (59) hide show
  1. package/README.md +14 -0
  2. package/dist/files/components/CopyDialog.d.ts +10 -0
  3. package/dist/files/components/CopyDialog.js +83 -85
  4. package/dist/files/components/CopyDialog.js.map +1 -1
  5. package/dist/files/components/FileBrowser.d.ts +0 -2
  6. package/dist/files/components/FileBrowser.js +256 -232
  7. package/dist/files/components/FileBrowser.js.map +1 -1
  8. package/dist/files/components/FileCard.d.ts +0 -1
  9. package/dist/files/components/FileCard.js +57 -63
  10. package/dist/files/components/FileCard.js.map +1 -1
  11. package/dist/files/components/FileInfoPanel.js.map +1 -1
  12. package/dist/files/components/FileListItem.d.ts +0 -1
  13. package/dist/files/components/FileListItem.js +141 -147
  14. package/dist/files/components/FileListItem.js.map +1 -1
  15. package/dist/files/components/FilePreviewModal.js +87 -86
  16. package/dist/files/components/FilePreviewModal.js.map +1 -1
  17. package/dist/files/components/FolderCard.d.ts +0 -1
  18. package/dist/files/components/FolderCard.js +122 -128
  19. package/dist/files/components/FolderCard.js.map +1 -1
  20. package/dist/files/components/SearchBar.js.map +1 -1
  21. package/dist/files/components/ShareDialog.d.ts +8 -12
  22. package/dist/files/components/ShareDialog.js +128 -146
  23. package/dist/files/components/ShareDialog.js.map +1 -1
  24. package/dist/files/components/ToolbarMoreMenu.d.ts +13 -0
  25. package/dist/files/components/ToolbarMoreMenu.js +36 -0
  26. package/dist/files/components/ToolbarMoreMenu.js.map +1 -0
  27. package/dist/files/components/UploadQueue.d.ts +3 -1
  28. package/dist/files/components/UploadQueue.js +99 -72
  29. package/dist/files/components/UploadQueue.js.map +1 -1
  30. package/dist/files/components/contextMenuItems.d.ts +0 -1
  31. package/dist/files/components/contextMenuItems.js +50 -55
  32. package/dist/files/components/contextMenuItems.js.map +1 -1
  33. package/dist/files/pages/BrowserPage.js +540 -495
  34. package/dist/files/pages/BrowserPage.js.map +1 -1
  35. package/dist/files/pages/ShareAccessPage.js +120 -75
  36. package/dist/files/pages/ShareAccessPage.js.map +1 -1
  37. package/dist/files/types.d.ts +10 -1
  38. package/dist/files/utils/bulkResults.d.ts +35 -0
  39. package/dist/files/utils/bulkResults.js +30 -0
  40. package/dist/files/utils/bulkResults.js.map +1 -0
  41. package/dist/files/utils/copyForm.d.ts +9 -0
  42. package/dist/files/utils/copyForm.js +10 -0
  43. package/dist/files/utils/copyForm.js.map +1 -0
  44. package/dist/files/utils/desktopDrop.d.ts +10 -0
  45. package/dist/files/utils/desktopDrop.js +10 -0
  46. package/dist/files/utils/desktopDrop.js.map +1 -0
  47. package/dist/files/utils/index.d.ts +6 -1
  48. package/dist/files/utils/index.js +6 -0
  49. package/dist/files/utils/index.js.map +1 -1
  50. package/dist/files/utils/shareAccess.d.ts +32 -0
  51. package/dist/files/utils/shareAccess.js +24 -0
  52. package/dist/files/utils/shareAccess.js.map +1 -0
  53. package/dist/files/utils/shareForm.d.ts +26 -0
  54. package/dist/files/utils/shareForm.js +23 -0
  55. package/dist/files/utils/shareForm.js.map +1 -0
  56. package/dist/translations/en.d.ts +26 -2
  57. package/dist/translations/en.js +30 -4
  58. package/dist/translations/en.js.map +1 -1
  59. package/package.json +3 -3
@@ -1,36 +1,37 @@
1
1
  import { useFilesStore as e } from "../store/filesStore.js";
2
- import { FileCard as t } from "./FileCard.js";
3
- import { FileListItem as n } from "./FileListItem.js";
4
- import { FolderCard as r } from "./FolderCard.js";
5
- import { ActionMenu as ee } from "./ActionMenu.js";
6
- import { ContextMenu as te } from "./ContextMenu.js";
7
- import { createFileMenuItems as ne, createFolderMenuItems as re } from "./contextMenuItems.js";
8
- import { sortFiles as ie } from "../utils/index.js";
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 ae } from "../hooks/useSharePermissions.js";
11
- import { shareEntryDeniedReason as oe, sharePermissionMessages as se } from "../utils/sharePermission.js";
12
- import { canStartFileDrag as ce, canStartFolderDrag as le, fileCapabilities as a, folderCapabilities as o, isShareOffered as ue, shareLookupTarget as de } from "../utils/itemCapabilities.js";
13
- import { useDragDrop as fe } from "../hooks/useDragDrop.js";
14
- import { useState as pe } from "react";
15
- import { Folder as me, Star as he } from "lucide-react";
16
- import { Fragment as ge, jsx as s, jsxs as c } from "react/jsx-runtime";
17
- import { useI18n as _e } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
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 l = ({ files: l, folders: u, loading: ve = !1, error: ye = null, preserveSortOrder: be = !1, onFilePreview: xe, onFileShare: d, onFileDelete: f, onFileRestore: p, onFileFavorite: m, onFileRename: h, onFileDownload: g, onFileCopy: _, onFileMove: v, onFileInfo: y, onFileActivity: b, onFolderOpen: x, onFolderShare: S, onFolderDelete: C, onFolderRestore: w, onFolderRename: T, onFolderFavorite: E, onFolderCopy: Se, onFolderMove: D, onFolderInfo: O, onFolderActivity: Ce, onMoveFile: we, onCopyFile: Te, onMoveFolder: Ee, onCopyFolder: De }) => {
20
- let { t: k } = _e(), { viewMode: Oe, sortBy: ke, sortDirection: Ae, selectedFiles: je, selectedFolders: Me } = e(), [Ne, Pe] = pe(null), [Fe, A] = pe({
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
- }), [j, M] = pe(null), N = ae(), { draggedItem: P, startDrag: Ie, endDrag: Le, handleDrop: Re } = fe({
24
- onMoveFile: we,
25
- onCopyFile: Te,
26
- onMoveFolder: Ee,
27
- onCopyFolder: De
28
- }), ze = (e, t) => {
29
- ce(e, t) && (Ie({
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
- }), A({
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
- }, Be = (e, t) => {
42
- le(e, t) && (Ie({
42
+ }, Ue = (e, t) => {
43
+ ue(e, t) && (ze({
43
44
  type: "folder",
44
45
  item: e,
45
46
  operation: t
46
- }), A({
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
- }, Ve = () => {
55
- Le(), A({
55
+ }, We = () => {
56
+ Be(), j({
56
57
  draggedItem: null,
57
58
  dropTargetFolderId: null
58
59
  });
59
- }, He = async (e) => {
60
- P && (await Re(e.id), A({
60
+ }, Ge = async (e) => {
61
+ P && (await Ve(e.id), j({
61
62
  draggedItem: null,
62
63
  dropTargetFolderId: null
63
64
  }));
64
- }, Ue = (e) => {
65
- A((t) => ({
65
+ }, Ke = (e) => {
66
+ j((t) => ({
66
67
  ...t,
67
68
  dropTargetFolderId: e
68
69
  }));
69
- }, We = () => {
70
- A((e) => ({
70
+ }, qe = () => {
71
+ j((e) => ({
71
72
  ...e,
72
73
  dropTargetFolderId: null
73
74
  }));
74
- }, Ge = (e, t, n) => {
75
- let r = B(e);
76
- d && r && N.ensure(r), M({
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
- }, Ke = (e, t, n) => {
83
- let r = K(e);
84
- S && r && N.ensure(r), M({
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
- }, qe = () => {
91
- M(null);
92
- }, Je = (e) => a(e).canPreview, F = (e) => a(e).canCopy, I = (e) => a(e).canUpdate, L = (e) => a(e).canMove, R = (e) => a(e).canDelete, Ye = (e) => L(e) || F(e), z = (e) => ue(a(e).share), B = (e) => de(a(e).share), Xe = (e) => o(e).canOpen, V = (e) => o(e).canUpdate, H = (e) => o(e).canMove, U = (e) => o(e).canDelete, Ze = (e) => H(e) || !!De, W = (e) => o(e).canAcceptDrop, G = (e) => ue(o(e).share), K = (e) => de(o(e).share), Qe = se(k), $e = (e) => e ? oe(N.statusOf(e), Qe) : void 0, q = (e) => $e(B(e)), J = (e) => $e(K(e)), Y = d ? (e) => {
93
- let t = B(e);
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, X = S ? (e) => {
96
- let t = K(e);
97
- S(e, t ? N.guard(t) : void 0);
98
- } : void 0, Z = (e) => !e || !(e.kind === "file" ? d : S) ? {} : {
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
- }, et = () => {
103
- if (!j) return [];
104
- if (j.type === "file") {
105
- let e = j.item;
106
- return ne({
107
- onShare: Y && z(e) ? () => Y(e) : void 0,
108
- shareDeniedReason: q(e),
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
- onActivity: b ? () => b(e) : void 0,
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
- }, k);
119
+ }, O);
120
120
  }
121
121
  {
122
- let e = j.item;
123
- return re({
124
- onShare: X && G(e) ? () => X(e) : void 0,
125
- shareDeniedReason: J(e),
126
- onRename: T && V(e) ? () => T(e) : void 0,
127
- onStar: E && V(e) ? () => E(e) : void 0,
128
- onMove: D && H(e) ? () => D(e) : void 0,
129
- onInfo: O ? () => O(e) : void 0,
130
- onDelete: C && U(e) ? () => C(e) : void 0,
131
- onRestore: w ? () => w(e) : void 0,
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
- }, k);
133
+ }, O);
134
134
  }
135
- }, Q = be ? l : ie(l, ke, Ae), $ = be ? u : ie(u, ke, Ae);
136
- return ve ? /* @__PURE__ */ s("div", {
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(k, "files.browser.loading", "Loading files…"),
141
- children: /* @__PURE__ */ s("div", {
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__ */ c("div", {
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__ */ s("div", { className: "aspect-[4/3] w-full animate-vc-shimmer bg-bg-sunken" }), /* @__PURE__ */ c("div", {
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__ */ 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" })]
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
- }) : ye ? /* @__PURE__ */ s("div", {
169
+ }) : Ce ? /* @__PURE__ */ c("div", {
152
170
  className: "flex items-center justify-center min-h-[500px]",
153
- children: /* @__PURE__ */ c("div", {
171
+ children: /* @__PURE__ */ l("div", {
154
172
  className: "text-center max-w-md",
155
173
  children: [
156
- /* @__PURE__ */ s("div", {
174
+ /* @__PURE__ */ c("div", {
157
175
  className: "mb-3 text-xl font-semibold text-status-error-text",
158
- children: i(k, "files.browser.loadError", "Failed to load files")
176
+ children: i(O, "files.browser.loadError", "Failed to load files")
159
177
  }),
160
- /* @__PURE__ */ s("p", {
178
+ /* @__PURE__ */ c("p", {
161
179
  className: "mb-6 text-sm text-text-secondary",
162
- children: ye.message || i(k, "files.browser.unexpectedError", "An unexpected error occurred")
180
+ children: Ce.message || i(O, "files.browser.unexpectedError", "An unexpected error occurred")
163
181
  }),
164
- /* @__PURE__ */ s("button", {
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(k, "files.browser.retry", "Retry")
186
+ children: i(O, "files.browser.retry", "Retry")
169
187
  })
170
188
  ]
171
189
  })
172
- }) : l.length === 0 && u.length === 0 ? /* @__PURE__ */ s(ge, { children: j && /* @__PURE__ */ s(te, {
173
- x: j.x,
174
- y: j.y,
175
- onClose: qe,
176
- items: et()
177
- }) }) : Oe === "list" ? Oe === "list" ? /* @__PURE__ */ c("div", {
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__ */ c("div", {
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__ */ s("div", { className: "flex-shrink-0 w-4" }),
184
- /* @__PURE__ */ s("div", { className: "flex-shrink-0 w-6" }),
185
- /* @__PURE__ */ s("div", {
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
- children: i(k, "files.browser.name", "Name")
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__ */ s("div", {
210
+ /* @__PURE__ */ c("div", {
190
211
  className: "hidden @lg:block flex-shrink-0 w-40",
191
- children: i(k, "files.browser.owner", "Owner")
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__ */ s("div", {
216
+ /* @__PURE__ */ c("div", {
194
217
  className: "hidden @md:block flex-shrink-0 w-24 text-right",
195
- children: i(k, "files.browser.size", "Size")
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__ */ s("div", {
222
+ /* @__PURE__ */ c("div", {
198
223
  className: "hidden @lg:block flex-shrink-0 w-32 text-right",
199
- children: i(k, "files.browser.modified", "Modified")
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__ */ s("div", { className: "flex-shrink-0 w-32" })
228
+ /* @__PURE__ */ c("div", { className: "flex-shrink-0 w-32" })
202
229
  ]
203
230
  }),
204
- /* @__PURE__ */ c("div", {
231
+ /* @__PURE__ */ l("div", {
205
232
  className: "divide-y divide-border-subtle",
206
- children: [$.map((t) => /* @__PURE__ */ c("div", {
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 ${Fe.dropTargetFolderId === t.id && P?.item.id !== t.id ? "bg-action-primary-bg/10" : ""} ${P?.item.id === t.id ? "opacity-50" : ""}`,
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
- Xe(t) && x?.(t);
236
+ et(t) && b?.(t);
210
237
  },
211
238
  onDragOver: (e) => {
212
- P && P.item.id !== t.id && W(t) && (e.preventDefault(), Ue(t.id));
239
+ P && P.item.id !== t.id && nt(t) && (e.preventDefault(), Ke(t.id));
213
240
  },
214
- onDragLeave: We,
241
+ onDragLeave: qe,
215
242
  onDrop: async (e) => {
216
- e.preventDefault(), P && P.item.id !== t.id && W(t) && await He(t);
243
+ e.preventDefault(), P && P.item.id !== t.id && nt(t) && await Ge(t);
217
244
  },
218
245
  onContextMenu: (e) => {
219
- e.preventDefault(), Ke(t, e.clientX, e.clientY);
246
+ e.preventDefault(), Ye(t, e.clientX, e.clientY);
220
247
  },
221
- ...Z(K(t)),
248
+ ...J(W(t)),
222
249
  children: [
223
- /* @__PURE__ */ s("div", {
250
+ /* @__PURE__ */ c("div", {
224
251
  className: "flex-shrink-0",
225
- children: /* @__PURE__ */ s("input", {
252
+ children: /* @__PURE__ */ c("input", {
226
253
  type: "checkbox",
227
- checked: Me.has(t.id),
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__ */ s(me, { className: "size-6 text-action-primary-bg flex-shrink-0" }),
236
- /* @__PURE__ */ s("div", {
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__ */ c("div", {
265
+ children: /* @__PURE__ */ l("div", {
239
266
  className: "flex items-center gap-2",
240
- children: [/* @__PURE__ */ s("button", {
267
+ children: [/* @__PURE__ */ c("button", {
241
268
  type: "button",
242
269
  onClick: (e) => {
243
- e.stopPropagation(), Xe(t) && x?.(t);
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(k, "files.browser.openFolder", "Open folder")} ${t.name}`,
273
+ "aria-label": `${i(O, "files.browser.openFolder", "Open folder")} ${t.name}`,
247
274
  children: t.name
248
- }), t.starred && /* @__PURE__ */ s(he, { className: "size-3 flex-shrink-0 fill-status-warning-text text-status-warning-text" })]
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__ */ s("div", {
278
+ /* @__PURE__ */ c("div", {
252
279
  className: "hidden @lg:block flex-shrink-0 w-40",
253
- children: t.createdBy && /* @__PURE__ */ c("div", {
280
+ children: t.createdBy && /* @__PURE__ */ l("div", {
254
281
  className: "flex items-center gap-2",
255
- children: [t.createdBy.avatar && /* @__PURE__ */ s("img", {
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__ */ s("span", {
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__ */ s("div", {
292
+ /* @__PURE__ */ c("div", {
266
293
  className: "hidden @md:block flex-shrink-0 w-24 text-right",
267
- children: /* @__PURE__ */ c("span", {
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(k, "files.browser.items", "items")
299
+ i(O, "files.browser.items", "items")
273
300
  ]
274
301
  })
275
302
  }),
276
- /* @__PURE__ */ s("div", {
303
+ /* @__PURE__ */ c("div", {
277
304
  className: "hidden @lg:block flex-shrink-0 w-32 text-right",
278
- children: /* @__PURE__ */ s("span", {
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__ */ c("div", {
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
- G(t) && X && /* @__PURE__ */ s("button", {
313
+ U(t) && q && /* @__PURE__ */ c("button", {
287
314
  type: "button",
288
315
  onClick: (e) => {
289
- e.stopPropagation(), X(t);
316
+ e.stopPropagation(), q(t);
290
317
  },
291
- "data-share-denied": J(t) !== void 0 || void 0,
292
- className: `p-1.5 rounded transition-colors hover:bg-action-ghost-bg-hover ${J(t) === void 0 ? "" : "opacity-50"}`,
293
- "aria-label": i(k, "files.browser.share", "Share"),
294
- title: J(t) ?? i(k, "files.browser.shareFolder", "Share folder"),
295
- children: /* @__PURE__ */ s("svg", {
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__ */ s("path", {
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
- V(t) && T && /* @__PURE__ */ s("button", {
335
+ B(t) && w && /* @__PURE__ */ c("button", {
309
336
  type: "button",
310
337
  onClick: (e) => {
311
- e.stopPropagation(), T(t);
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(k, "files.browser.rename", "Rename"),
315
- title: i(k, "files.browser.rename", "Rename"),
316
- children: /* @__PURE__ */ s("svg", {
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__ */ s("path", {
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
- U(t) && C && /* @__PURE__ */ s("button", {
356
+ H(t) && S && /* @__PURE__ */ c("button", {
330
357
  type: "button",
331
358
  onClick: (e) => {
332
- e.stopPropagation(), C(t);
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(k, "files.browser.delete", "Delete"),
336
- title: i(k, "files.browser.delete", "Delete"),
337
- children: /* @__PURE__ */ s("svg", {
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__ */ s("path", {
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__ */ s("div", {
377
+ /* @__PURE__ */ c("div", {
351
378
  onClick: (e) => e.stopPropagation(),
352
- children: /* @__PURE__ */ s(ee, {
353
- items: re({
354
- onShare: G(t) && X ? () => X(t) : void 0,
355
- shareDeniedReason: J(t),
356
- onRename: V(t) && T ? () => T(t) : void 0,
357
- onStar: V(t) && E ? () => E(t) : void 0,
358
- onMove: H(t) && D ? () => D(t) : void 0,
359
- onInfo: () => O?.(t),
360
- onRestore: w ? () => w(t) : void 0,
361
- onDelete: U(t) && C ? () => C(t) : void 0,
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
- }, k),
364
- isOpen: Ne === t.id,
390
+ }, O),
391
+ isOpen: Fe === t.id,
365
392
  onToggle: (e) => {
366
- let n = K(t);
367
- e && S && n && N.ensure(n), Pe(e ? t.id : null);
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)), Q.map((e) => /* @__PURE__ */ s("div", {
401
+ }, t.id)), Y.map((e) => /* @__PURE__ */ c("div", {
375
402
  className: "contents",
376
- ...Z(B(e)),
377
- children: /* @__PURE__ */ s(n, {
403
+ ...J(z(e)),
404
+ children: /* @__PURE__ */ c(r, {
378
405
  file: e,
379
- isSelected: je.has(e.id),
406
+ isSelected: Me.has(e.id),
380
407
  isDragging: P?.item.id === e.id,
381
- onPreview: Je(e) ? xe : void 0,
382
- onShare: z(e) ? Y : void 0,
383
- shareDeniedReason: q(e),
384
- onDelete: R(e) ? f : void 0,
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
- onActivity: b,
393
- onDragStart: Ye(e) ? ze : void 0,
394
- onDragEnd: Ve,
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
- j && /* @__PURE__ */ s(te, {
400
- x: j.x,
401
- y: j.y,
402
- onClose: qe,
403
- items: et()
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__ */ c("div", {
432
+ }) : null : /* @__PURE__ */ l("div", {
407
433
  className: "@container bg-bg-canvas p-page-padding",
408
434
  children: [
409
- $.length > 0 && /* @__PURE__ */ c("div", {
410
- className: Q.length > 0 ? "mb-6" : "",
411
- children: [Q.length > 0 && /* @__PURE__ */ s("h2", {
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(k, "files.browser.section.folders", "Folders")
414
- }), /* @__PURE__ */ s("div", {
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: $.map((e) => /* @__PURE__ */ s("div", {
442
+ children: X.map((e) => /* @__PURE__ */ c("div", {
417
443
  className: "contents",
418
- ...Z(K(e)),
419
- children: /* @__PURE__ */ s(r, {
444
+ ...J(W(e)),
445
+ children: /* @__PURE__ */ c(ee, {
420
446
  folder: e,
421
- isSelected: Me.has(e.id),
447
+ isSelected: Ne.has(e.id),
422
448
  isDragging: P?.item.id === e.id,
423
- isDropTarget: Fe.dropTargetFolderId === e.id,
449
+ isDropTarget: Le.dropTargetFolderId === e.id,
424
450
  draggedItem: P,
425
- onOpen: Xe(e) ? x : void 0,
426
- onShare: G(e) ? X : void 0,
427
- shareDeniedReason: J(e),
428
- onDelete: U(e) ? C : void 0,
429
- onRestore: w,
430
- onRename: V(e) ? T : void 0,
431
- onFavorite: V(e) ? E : void 0,
432
- onCopy: Se,
433
- onMove: H(e) ? D : void 0,
434
- onInfo: O,
435
- onActivity: Ce,
436
- onDragStart: Ze(e) ? Be : void 0,
437
- onDragEnd: Ve,
438
- onDrop: W(e) ? He : void 0,
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
- Q.length > 0 && /* @__PURE__ */ c("div", { children: [$.length > 0 && /* @__PURE__ */ s("h2", {
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(k, "files.browser.section.files", "Files")
447
- }), /* @__PURE__ */ s("div", {
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: Q.map((e) => /* @__PURE__ */ s("div", {
474
+ children: Y.map((e) => /* @__PURE__ */ c("div", {
450
475
  className: "contents",
451
- ...Z(B(e)),
452
- children: /* @__PURE__ */ s(t, {
476
+ ...J(z(e)),
477
+ children: /* @__PURE__ */ c(n, {
453
478
  file: e,
454
- isSelected: je.has(e.id),
479
+ isSelected: Me.has(e.id),
455
480
  isDragging: P?.item.id === e.id,
456
- onPreview: Je(e) ? xe : void 0,
457
- onShare: z(e) ? Y : void 0,
458
- shareDeniedReason: q(e),
459
- onDelete: R(e) ? f : void 0,
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
- onActivity: b,
468
- onDragStart: Ye(e) ? ze : void 0,
469
- onDragEnd: Ve,
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
- j && /* @__PURE__ */ s(te, {
475
- x: j.x,
476
- y: j.y,
477
- onClose: qe,
478
- items: et()
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 { l as FileBrowser };
507
+ export { u as FileBrowser };
484
508
 
485
509
  //# sourceMappingURL=FileBrowser.js.map