@burdenoff/microfe-files 2026.527.1 → 2026.527.3

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 (49) hide show
  1. package/dist/files/components/ActionMenu.js +44 -40
  2. package/dist/files/components/ActionMenu.js.map +1 -1
  3. package/dist/files/components/ConfirmDialog.js +42 -40
  4. package/dist/files/components/ConfirmDialog.js.map +1 -1
  5. package/dist/files/components/CopyDialog.js +1 -0
  6. package/dist/files/components/CopyDialog.js.map +1 -1
  7. package/dist/files/components/FileBrowser.js +186 -170
  8. package/dist/files/components/FileBrowser.js.map +1 -1
  9. package/dist/files/components/FileCard.js.map +1 -1
  10. package/dist/files/components/FileInfoPanel.js +102 -102
  11. package/dist/files/components/FileInfoPanel.js.map +1 -1
  12. package/dist/files/components/FileListItem.js.map +1 -1
  13. package/dist/files/components/FolderCard.js +147 -161
  14. package/dist/files/components/FolderCard.js.map +1 -1
  15. package/dist/files/components/MoveDialog.js +9 -12
  16. package/dist/files/components/MoveDialog.js.map +1 -1
  17. package/dist/files/components/SearchBar.js +125 -117
  18. package/dist/files/components/SearchBar.js.map +1 -1
  19. package/dist/files/components/ShareDialog.js +5 -0
  20. package/dist/files/components/ShareDialog.js.map +1 -1
  21. package/dist/files/components/Toast.js +27 -24
  22. package/dist/files/components/Toast.js.map +1 -1
  23. package/dist/files/components/UploadQueue.js +1 -1
  24. package/dist/files/components/UploadQueue.js.map +1 -1
  25. package/dist/files/components/viewers/AudioPlayer.js +3 -0
  26. package/dist/files/components/viewers/AudioPlayer.js.map +1 -1
  27. package/dist/files/components/viewers/TextViewer.js +1 -0
  28. package/dist/files/components/viewers/TextViewer.js.map +1 -1
  29. package/dist/files/components/viewers/VideoPlayer.js +3 -0
  30. package/dist/files/components/viewers/VideoPlayer.js.map +1 -1
  31. package/dist/files/hooks/useCreateFolder.js +15 -7
  32. package/dist/files/hooks/useCreateFolder.js.map +1 -1
  33. package/dist/files/hooks/useKeyboardNavigation.js +51 -51
  34. package/dist/files/hooks/useKeyboardNavigation.js.map +1 -1
  35. package/dist/files/hooks/useMoveFile.js +1 -2
  36. package/dist/files/hooks/useMoveFile.js.map +1 -1
  37. package/dist/files/hooks/useMoveFolder.js +0 -2
  38. package/dist/files/hooks/useMoveFolder.js.map +1 -1
  39. package/dist/files/hooks/useStarredItems.js +4 -3
  40. package/dist/files/hooks/useStarredItems.js.map +1 -1
  41. package/dist/files/hooks/useToggleStar.js +10 -10
  42. package/dist/files/hooks/useToggleStar.js.map +1 -1
  43. package/dist/files/pages/BrowserPage.js +312 -302
  44. package/dist/files/pages/BrowserPage.js.map +1 -1
  45. package/dist/files/pages/ShareAccessPage.js +1 -0
  46. package/dist/files/pages/ShareAccessPage.js.map +1 -1
  47. package/dist/files/utils/quotaUtils.js +14 -0
  48. package/dist/files/utils/quotaUtils.js.map +1 -0
  49. package/package.json +2 -2
@@ -9,25 +9,25 @@ import { FolderCard as ie } from "./FolderCard.js";
9
9
  import { ContextMenu as r } from "./ContextMenu.js";
10
10
  import { createFileMenuItems as ae, createFolderMenuItems as i } from "./contextMenuItems.js";
11
11
  import { useState as a } from "react";
12
- import { Grid3x3 as oe, Loader2 as se, Star as ce } from "lucide-react";
12
+ import { Folder as oe, Loader2 as se, Star as ce } from "lucide-react";
13
13
  import { Fragment as le, jsx as o, jsxs as s } from "react/jsx-runtime";
14
14
  import { useI18n as ue } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
15
15
  //#region src/files/components/FileBrowser.tsx
16
- var c = ({ files: c, folders: l, loading: de = !1, error: u = null, preserveSortOrder: fe = !1, onFilePreview: d, onFileShare: f, onFileDelete: p, onFileRestore: m, onFileFavorite: h, onFileRename: g, onFileDownload: _, onFileCopy: v, onFileMove: y, onFileInfo: b, onFileActivity: x, onFolderOpen: S, onFolderShare: C, onFolderDelete: w, onFolderRestore: T, onFolderRename: E, onFolderFavorite: D, onFolderCopy: pe, onFolderMove: O, onFolderInfo: k, onFolderActivity: me, onMoveFile: he, onCopyFile: ge, onMoveFolder: _e, onCopyFolder: ve }) => {
17
- let { t: A } = ue(), { viewMode: j, sortBy: M, sortDirection: ye, selectedFiles: N, selectedFolders: P } = e(), [be, xe] = a(null), [F, I] = a({
16
+ var c = ({ files: c, folders: l, loading: de = !1, error: u = null, preserveSortOrder: fe = !1, onFilePreview: pe, 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: me, onFolderMove: D, onFolderInfo: O, onFolderActivity: he, onMoveFile: ge, onCopyFile: _e, onMoveFolder: ve, onCopyFolder: ye }) => {
17
+ let { t: k } = ue(), { viewMode: A, sortBy: j, sortDirection: be, selectedFiles: M, selectedFolders: N } = e(), [xe, Se] = a(null), [P, F] = a({
18
18
  draggedItem: null,
19
19
  dropTargetFolderId: null
20
- }), [L, R] = a(null), { draggedItem: z, startDrag: Se, endDrag: Ce, handleDrop: we } = te({
21
- onMoveFile: he,
22
- onCopyFile: ge,
23
- onMoveFolder: _e,
24
- onCopyFolder: ve
25
- }), Te = (e, t) => {
26
- Se({
20
+ }), [I, L] = a(null), { draggedItem: R, startDrag: Ce, endDrag: we, handleDrop: Te } = te({
21
+ onMoveFile: ge,
22
+ onCopyFile: _e,
23
+ onMoveFolder: ve,
24
+ onCopyFolder: ye
25
+ }), Ee = (e, t) => {
26
+ Ce({
27
27
  type: "file",
28
28
  item: e,
29
29
  operation: t
30
- }), I({
30
+ }), F({
31
31
  draggedItem: {
32
32
  type: "file",
33
33
  item: e,
@@ -35,12 +35,12 @@ var c = ({ files: c, folders: l, loading: de = !1, error: u = null, preserveSort
35
35
  },
36
36
  dropTargetFolderId: null
37
37
  });
38
- }, Ee = (e, t) => {
39
- Se({
38
+ }, De = (e, t) => {
39
+ Ce({
40
40
  type: "folder",
41
41
  item: e,
42
42
  operation: t
43
- }), I({
43
+ }), F({
44
44
  draggedItem: {
45
45
  type: "folder",
46
46
  item: e,
@@ -48,80 +48,80 @@ var c = ({ files: c, folders: l, loading: de = !1, error: u = null, preserveSort
48
48
  },
49
49
  dropTargetFolderId: null
50
50
  });
51
- }, B = () => {
52
- Ce(), I({
51
+ }, z = () => {
52
+ we(), F({
53
53
  draggedItem: null,
54
54
  dropTargetFolderId: null
55
55
  });
56
- }, V = async (e) => {
57
- z && (await we(e.id), I({
56
+ }, Oe = async (e) => {
57
+ R && (await Te(e.id), F({
58
58
  draggedItem: null,
59
59
  dropTargetFolderId: null
60
60
  }));
61
- }, De = (e) => {
62
- I((t) => ({
61
+ }, ke = (e) => {
62
+ F((t) => ({
63
63
  ...t,
64
64
  dropTargetFolderId: e
65
65
  }));
66
- }, Oe = () => {
67
- I((e) => ({
66
+ }, Ae = () => {
67
+ F((e) => ({
68
68
  ...e,
69
69
  dropTargetFolderId: null
70
70
  }));
71
- }, H = (e, t, n) => {
72
- R({
71
+ }, B = (e, t, n) => {
72
+ L({
73
73
  item: e,
74
74
  type: "file",
75
75
  x: t,
76
76
  y: n
77
77
  });
78
- }, U = (e, t, n) => {
79
- R({
78
+ }, V = (e, t, n) => {
79
+ L({
80
80
  item: e,
81
81
  type: "folder",
82
82
  x: t,
83
83
  y: n
84
84
  });
85
- }, W = () => {
86
- R(null);
87
- }, G = (e) => e.canRead === !0 || e.canUpdate === !0 || e.canWrite === !0, K = (e) => e.canUpdate === !0 || e.canWrite === !0, q = (e) => e.canShare === !0 || K(e), J = (e) => e.canDelete === !0, Y = (e) => e.canRead === !0 || e.permissions?.canRead === !0, X = (e) => e.canUpdate === !0 || e.permissions?.canWrite === !0, Z = (e) => e.permissions?.canShare === !0 || X(e), Q = (e) => e.canDelete === !0 || e.permissions?.canDelete === !0, $ = () => {
88
- if (!L) return [];
89
- if (L.type === "file") {
90
- let e = L.item;
85
+ }, H = () => {
86
+ L(null);
87
+ }, U = (e) => e.canRead === !0 || e.canUpdate === !0 || e.canWrite === !0, W = (e) => e.canUpdate === !0 || e.canWrite === !0, G = (e) => e.canShare === !0 || W(e), K = (e) => e.canDelete === !0, q = (e) => e.canRead === !0 || e.permissions?.canRead === !0, J = (e) => e.canUpdate === !0 || e.permissions?.canWrite === !0, Y = (e) => e.permissions?.canShare === !0 || J(e), X = (e) => e.canDelete === !0 || e.permissions?.canDelete === !0, Z = () => {
88
+ if (!I) return [];
89
+ if (I.type === "file") {
90
+ let e = I.item;
91
91
  return ae({
92
- onShare: f && q(e) ? () => f(e) : void 0,
93
- onDownload: _ && G(e) ? () => _(e) : void 0,
94
- onCopy: v && G(e) ? () => v(e) : void 0,
95
- onRename: g && K(e) ? () => g(e) : void 0,
96
- onStar: h && K(e) ? () => h(e) : void 0,
97
- onMove: y && K(e) ? () => y(e) : void 0,
98
- onInfo: b ? () => b(e) : void 0,
99
- onActivity: x ? () => x(e) : void 0,
100
- onDelete: p && J(e) ? () => p(e) : void 0,
101
- onRestore: m && K(e) ? () => m(e) : void 0,
92
+ onShare: d && G(e) ? () => d(e) : void 0,
93
+ onDownload: g && U(e) ? () => g(e) : void 0,
94
+ onCopy: _ && U(e) ? () => _(e) : void 0,
95
+ onRename: h && W(e) ? () => h(e) : void 0,
96
+ onStar: m && W(e) ? () => m(e) : void 0,
97
+ onMove: v && W(e) ? () => v(e) : void 0,
98
+ onInfo: y ? () => y(e) : void 0,
99
+ onActivity: b ? () => b(e) : void 0,
100
+ onDelete: f && K(e) ? () => f(e) : void 0,
101
+ onRestore: p && W(e) ? () => p(e) : void 0,
102
102
  isStarred: e.starred
103
- }, A);
103
+ }, k);
104
104
  } else {
105
- let e = L.item;
105
+ let e = I.item;
106
106
  return i({
107
- onShare: C && Z(e) ? () => C(e) : void 0,
108
- onRename: E && X(e) ? () => E(e) : void 0,
109
- onStar: D && X(e) ? () => D(e) : void 0,
110
- onMove: O && X(e) ? () => O(e) : void 0,
111
- onInfo: k ? () => k(e) : void 0,
112
- onDelete: w && Q(e) ? () => w(e) : void 0,
113
- onRestore: T && X(e) ? () => T(e) : void 0,
107
+ onShare: S && Y(e) ? () => S(e) : void 0,
108
+ onRename: T && J(e) ? () => T(e) : void 0,
109
+ onStar: E && J(e) ? () => E(e) : void 0,
110
+ onMove: D && J(e) ? () => D(e) : void 0,
111
+ onInfo: O ? () => O(e) : void 0,
112
+ onDelete: C && X(e) ? () => C(e) : void 0,
113
+ onRestore: w && J(e) ? () => w(e) : void 0,
114
114
  isStarred: e.starred
115
- }, A);
115
+ }, k);
116
116
  }
117
- }, ke = fe ? c : t(c, M, ye), Ae = fe ? l : t(l, M, ye);
117
+ }, Q = fe ? c : t(c, j, be), $ = fe ? l : t(l, j, be);
118
118
  return de ? /* @__PURE__ */ o("div", {
119
119
  className: "flex items-center justify-center min-h-[500px]",
120
120
  children: /* @__PURE__ */ s("div", {
121
121
  className: "flex flex-col items-center gap-4",
122
122
  children: [/* @__PURE__ */ o(se, { className: "size-10 animate-spin text-action-primary-bg" }), /* @__PURE__ */ o("span", {
123
123
  className: "text-sm text-text-secondary",
124
- children: n(A, "files.browser.loading", "Loading files…")
124
+ children: n(k, "files.browser.loading", "Loading files…")
125
125
  })]
126
126
  })
127
127
  }) : u ? /* @__PURE__ */ o("div", {
@@ -131,26 +131,26 @@ var c = ({ files: c, folders: l, loading: de = !1, error: u = null, preserveSort
131
131
  children: [
132
132
  /* @__PURE__ */ o("div", {
133
133
  className: "mb-3 text-xl font-semibold text-status-error-text",
134
- children: n(A, "files.browser.loadError", "Failed to load files")
134
+ children: n(k, "files.browser.loadError", "Failed to load files")
135
135
  }),
136
136
  /* @__PURE__ */ o("p", {
137
137
  className: "mb-6 text-sm text-text-secondary",
138
- children: u.message || n(A, "files.browser.unexpectedError", "An unexpected error occurred")
138
+ children: u.message || n(k, "files.browser.unexpectedError", "An unexpected error occurred")
139
139
  }),
140
140
  /* @__PURE__ */ o("button", {
141
141
  type: "button",
142
142
  onClick: () => window.location.reload(),
143
143
  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",
144
- children: n(A, "files.browser.retry", "Retry")
144
+ children: n(k, "files.browser.retry", "Retry")
145
145
  })
146
146
  ]
147
147
  })
148
- }) : c.length === 0 && l.length === 0 ? /* @__PURE__ */ o(le, { children: L && /* @__PURE__ */ o(r, {
149
- x: L.x,
150
- y: L.y,
151
- onClose: W,
152
- items: $()
153
- }) }) : j === "list" ? j === "list" ? /* @__PURE__ */ s("div", {
148
+ }) : c.length === 0 && l.length === 0 ? /* @__PURE__ */ o(le, { children: I && /* @__PURE__ */ o(r, {
149
+ x: I.x,
150
+ y: I.y,
151
+ onClose: H,
152
+ items: Z()
153
+ }) }) : A === "list" ? A === "list" ? /* @__PURE__ */ s("div", {
154
154
  className: "@container bg-bg-canvas",
155
155
  children: [
156
156
  /* @__PURE__ */ s("div", {
@@ -160,52 +160,52 @@ var c = ({ files: c, folders: l, loading: de = !1, error: u = null, preserveSort
160
160
  /* @__PURE__ */ o("div", { className: "flex-shrink-0 w-6" }),
161
161
  /* @__PURE__ */ o("div", {
162
162
  className: "flex-1",
163
- children: n(A, "files.browser.name", "Name")
163
+ children: n(k, "files.browser.name", "Name")
164
164
  }),
165
165
  /* @__PURE__ */ o("div", {
166
166
  className: "hidden @lg:block flex-shrink-0 w-40",
167
- children: n(A, "files.browser.owner", "Owner")
167
+ children: n(k, "files.browser.owner", "Owner")
168
168
  }),
169
169
  /* @__PURE__ */ o("div", {
170
170
  className: "hidden @md:block flex-shrink-0 w-24 text-right",
171
- children: n(A, "files.browser.size", "Size")
171
+ children: n(k, "files.browser.size", "Size")
172
172
  }),
173
173
  /* @__PURE__ */ o("div", {
174
174
  className: "hidden @lg:block flex-shrink-0 w-32 text-right",
175
- children: n(A, "files.browser.modified", "Modified")
175
+ children: n(k, "files.browser.modified", "Modified")
176
176
  }),
177
177
  /* @__PURE__ */ o("div", { className: "flex-shrink-0 w-32" })
178
178
  ]
179
179
  }),
180
180
  /* @__PURE__ */ s("div", {
181
181
  className: "divide-y divide-border-subtle",
182
- children: [Ae.map((t) => /* @__PURE__ */ s("div", {
183
- className: `group flex items-center gap-3 border-b border-border-subtle bg-bg-surface p-3 transition-colors hover:bg-bg-sunken focus-within:bg-bg-sunken ${F.dropTargetFolderId === t.id && z?.item.id !== t.id ? "bg-action-primary-bg/10" : ""} ${z?.item.id === t.id ? "opacity-50" : ""}`,
182
+ children: [$.map((t) => /* @__PURE__ */ s("div", {
183
+ className: `group flex items-center gap-3 border-b border-border-subtle bg-bg-surface p-3 transition-colors hover:bg-bg-sunken focus-within:bg-bg-sunken ${P.dropTargetFolderId === t.id && R?.item.id !== t.id ? "bg-action-primary-bg/10" : ""} ${R?.item.id === t.id ? "opacity-50" : ""}`,
184
184
  onClick: () => {
185
- Y(t) && S?.(t);
185
+ q(t) && x?.(t);
186
186
  },
187
187
  onKeyDown: (e) => {
188
- (e.key === "Enter" || e.key === " ") && (e.preventDefault(), Y(t) && S?.(t));
188
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), q(t) && x?.(t));
189
189
  },
190
190
  onDragOver: (e) => {
191
- z && z.item.id !== t.id && X(t) && (e.preventDefault(), De(t.id));
191
+ R && R.item.id !== t.id && J(t) && (e.preventDefault(), ke(t.id));
192
192
  },
193
- onDragLeave: Oe,
193
+ onDragLeave: Ae,
194
194
  onDrop: async (e) => {
195
- e.preventDefault(), z && z.item.id !== t.id && X(t) && await V(t);
195
+ e.preventDefault(), R && R.item.id !== t.id && J(t) && await Oe(t);
196
196
  },
197
197
  onContextMenu: (e) => {
198
- e.preventDefault(), U(t, e.clientX, e.clientY);
198
+ e.preventDefault(), V(t, e.clientX, e.clientY);
199
199
  },
200
200
  role: "button",
201
201
  tabIndex: 0,
202
- "aria-label": n(A, "files.browser.openFolder", "Open folder"),
202
+ "aria-label": n(k, "files.browser.openFolder", "Open folder"),
203
203
  children: [
204
204
  /* @__PURE__ */ o("div", {
205
205
  className: "flex-shrink-0",
206
206
  children: /* @__PURE__ */ o("input", {
207
207
  type: "checkbox",
208
- checked: P.has(t.id),
208
+ checked: N.has(t.id),
209
209
  onChange: (n) => {
210
210
  n.stopPropagation(), e.getState().toggleFolderSelection(t.id);
211
211
  },
@@ -243,9 +243,9 @@ var c = ({ files: c, folders: l, loading: de = !1, error: u = null, preserveSort
243
243
  children: /* @__PURE__ */ s("span", {
244
244
  className: "font-text-sm text-text-secondary",
245
245
  children: [
246
- t.filesCount ?? 0,
246
+ (t.filesCount ?? 0) + (t.subfoldersCount ?? 0),
247
247
  " ",
248
- n(A, "files.browser.items", "items")
248
+ n(k, "files.browser.items", "items")
249
249
  ]
250
250
  })
251
251
  }),
@@ -259,14 +259,14 @@ var c = ({ files: c, folders: l, loading: de = !1, error: u = null, preserveSort
259
259
  /* @__PURE__ */ s("div", {
260
260
  className: "flex w-32 flex-shrink-0 items-center gap-1 opacity-0 transition-opacity group-hover:opacity-100 group-focus-within:opacity-100",
261
261
  children: [
262
- Z(t) && C && /* @__PURE__ */ o("button", {
262
+ Y(t) && S && /* @__PURE__ */ o("button", {
263
263
  type: "button",
264
264
  onClick: (e) => {
265
- e.stopPropagation(), C(t);
265
+ e.stopPropagation(), S(t);
266
266
  },
267
267
  className: "p-1.5 hover:bg-action-ghost-bg-hover rounded transition-colors",
268
- "aria-label": n(A, "files.browser.share", "Share"),
269
- title: n(A, "files.browser.shareFolder", "Share folder"),
268
+ "aria-label": n(k, "files.browser.share", "Share"),
269
+ title: n(k, "files.browser.shareFolder", "Share folder"),
270
270
  children: /* @__PURE__ */ o("svg", {
271
271
  className: "size-4 text-text-primary",
272
272
  fill: "none",
@@ -280,14 +280,14 @@ var c = ({ files: c, folders: l, loading: de = !1, error: u = null, preserveSort
280
280
  })
281
281
  })
282
282
  }),
283
- X(t) && E && /* @__PURE__ */ o("button", {
283
+ J(t) && T && /* @__PURE__ */ o("button", {
284
284
  type: "button",
285
285
  onClick: (e) => {
286
- e.stopPropagation(), E(t);
286
+ e.stopPropagation(), T(t);
287
287
  },
288
288
  className: "hidden @md:block p-1.5 hover:bg-action-ghost-bg-hover rounded transition-colors",
289
- "aria-label": n(A, "files.browser.rename", "Rename"),
290
- title: n(A, "files.browser.rename", "Rename"),
289
+ "aria-label": n(k, "files.browser.rename", "Rename"),
290
+ title: n(k, "files.browser.rename", "Rename"),
291
291
  children: /* @__PURE__ */ o("svg", {
292
292
  className: "size-4 text-text-primary",
293
293
  fill: "none",
@@ -301,14 +301,14 @@ var c = ({ files: c, folders: l, loading: de = !1, error: u = null, preserveSort
301
301
  })
302
302
  })
303
303
  }),
304
- Q(t) && w && /* @__PURE__ */ o("button", {
304
+ X(t) && C && /* @__PURE__ */ o("button", {
305
305
  type: "button",
306
306
  onClick: (e) => {
307
- e.stopPropagation(), w(t);
307
+ e.stopPropagation(), C(t);
308
308
  },
309
309
  className: "p-1.5 hover:bg-action-danger-bg-hover rounded transition-colors",
310
- "aria-label": n(A, "files.browser.delete", "Delete"),
311
- title: n(A, "files.browser.delete", "Delete"),
310
+ "aria-label": n(k, "files.browser.delete", "Delete"),
311
+ title: n(k, "files.browser.delete", "Delete"),
312
312
  children: /* @__PURE__ */ o("svg", {
313
313
  className: "size-4 text-status-error-text",
314
314
  fill: "none",
@@ -326,98 +326,114 @@ var c = ({ files: c, folders: l, loading: de = !1, error: u = null, preserveSort
326
326
  onClick: (e) => e.stopPropagation(),
327
327
  children: /* @__PURE__ */ o(ee, {
328
328
  items: i({
329
- onShare: Z(t) && C ? () => C(t) : void 0,
330
- onRename: X(t) && E ? () => E(t) : void 0,
331
- onStar: X(t) && D ? () => D(t) : void 0,
332
- onMove: X(t) && O ? () => O(t) : void 0,
333
- onInfo: () => k?.(t),
334
- onRestore: X(t) && T ? () => T(t) : void 0,
335
- onDelete: Q(t) && w ? () => w(t) : void 0,
329
+ onShare: Y(t) && S ? () => S(t) : void 0,
330
+ onRename: J(t) && T ? () => T(t) : void 0,
331
+ onStar: J(t) && E ? () => E(t) : void 0,
332
+ onMove: J(t) && D ? () => D(t) : void 0,
333
+ onInfo: () => O?.(t),
334
+ onRestore: J(t) && w ? () => w(t) : void 0,
335
+ onDelete: X(t) && C ? () => C(t) : void 0,
336
336
  isStarred: t.starred
337
- }, A),
338
- isOpen: be === t.id,
339
- onToggle: (e) => xe(e ? t.id : null)
337
+ }, k),
338
+ isOpen: xe === t.id,
339
+ onToggle: (e) => Se(e ? t.id : null)
340
340
  })
341
341
  })
342
342
  ]
343
343
  })
344
344
  ]
345
- }, t.id)), ke.map((e) => /* @__PURE__ */ o(re, {
345
+ }, t.id)), Q.map((e) => /* @__PURE__ */ o(re, {
346
346
  file: e,
347
- isSelected: N.has(e.id),
348
- isDragging: z?.item.id === e.id,
349
- onPreview: G(e) ? d : void 0,
350
- onShare: q(e) ? f : void 0,
351
- onDelete: J(e) ? p : void 0,
352
- onRestore: K(e) ? m : void 0,
353
- onFavorite: K(e) ? h : void 0,
354
- onRename: K(e) ? g : void 0,
355
- onDownload: G(e) ? _ : void 0,
356
- onCopy: G(e) ? v : void 0,
357
- onMove: K(e) ? y : void 0,
358
- onInfo: b,
359
- onActivity: x,
360
- onDragStart: K(e) ? Te : void 0,
361
- onDragEnd: B,
362
- onContextMenu: H
347
+ isSelected: M.has(e.id),
348
+ isDragging: R?.item.id === e.id,
349
+ onPreview: U(e) ? pe : void 0,
350
+ onShare: G(e) ? d : void 0,
351
+ onDelete: K(e) ? f : void 0,
352
+ onRestore: W(e) ? p : void 0,
353
+ onFavorite: W(e) ? m : void 0,
354
+ onRename: W(e) ? h : void 0,
355
+ onDownload: U(e) ? g : void 0,
356
+ onCopy: U(e) ? _ : void 0,
357
+ onMove: W(e) ? v : void 0,
358
+ onInfo: y,
359
+ onActivity: b,
360
+ onDragStart: W(e) ? Ee : void 0,
361
+ onDragEnd: z,
362
+ onContextMenu: B
363
363
  }, e.id))]
364
364
  }),
365
- L && /* @__PURE__ */ o(r, {
366
- x: L.x,
367
- y: L.y,
368
- onClose: W,
369
- items: $()
365
+ I && /* @__PURE__ */ o(r, {
366
+ x: I.x,
367
+ y: I.y,
368
+ onClose: H,
369
+ items: Z()
370
370
  })
371
371
  ]
372
372
  }) : null : /* @__PURE__ */ s("div", {
373
373
  className: "@container bg-bg-canvas p-page-padding",
374
- children: [/* @__PURE__ */ s("div", {
375
- className: "grid grid-cols-2 @md:grid-cols-3 @lg:grid-cols-4 @xl:grid-cols-5 gap-4",
376
- children: [Ae.map((e) => /* @__PURE__ */ o(ie, {
377
- folder: e,
378
- isSelected: P.has(e.id),
379
- isDragging: z?.item.id === e.id,
380
- isDropTarget: F.dropTargetFolderId === e.id,
381
- draggedItem: z,
382
- onOpen: Y(e) ? S : void 0,
383
- onShare: Z(e) ? C : void 0,
384
- onDelete: Q(e) ? w : void 0,
385
- onRestore: X(e) ? T : void 0,
386
- onRename: X(e) ? E : void 0,
387
- onFavorite: X(e) ? D : void 0,
388
- onCopy: pe,
389
- onMove: X(e) ? O : void 0,
390
- onInfo: k,
391
- onActivity: me,
392
- onDragStart: X(e) ? Ee : void 0,
393
- onDragEnd: B,
394
- onDrop: X(e) ? V : void 0,
395
- onContextMenu: U
396
- }, e.id)), ke.map((e) => /* @__PURE__ */ o(ne, {
397
- file: e,
398
- isSelected: N.has(e.id),
399
- isDragging: z?.item.id === e.id,
400
- onPreview: G(e) ? d : void 0,
401
- onShare: q(e) ? f : void 0,
402
- onDelete: J(e) ? p : void 0,
403
- onRestore: K(e) ? m : void 0,
404
- onFavorite: K(e) ? h : void 0,
405
- onRename: K(e) ? g : void 0,
406
- onDownload: G(e) ? _ : void 0,
407
- onCopy: G(e) ? v : void 0,
408
- onMove: K(e) ? y : void 0,
409
- onInfo: b,
410
- onActivity: x,
411
- onDragStart: K(e) ? Te : void 0,
412
- onDragEnd: B,
413
- onContextMenu: H
414
- }, e.id))]
415
- }), L && /* @__PURE__ */ o(r, {
416
- x: L.x,
417
- y: L.y,
418
- onClose: W,
419
- items: $()
420
- })]
374
+ children: [
375
+ $.length > 0 && /* @__PURE__ */ s("div", {
376
+ className: Q.length > 0 ? "mb-6" : "",
377
+ children: [Q.length > 0 && /* @__PURE__ */ o("h2", {
378
+ className: "text-xs font-semibold text-text-tertiary uppercase tracking-wider mb-3 px-1",
379
+ children: n(k, "files.browser.section.folders", "Folders")
380
+ }), /* @__PURE__ */ o("div", {
381
+ className: "grid grid-cols-1 @sm:grid-cols-2 @lg:grid-cols-3 @xl:grid-cols-4 gap-2",
382
+ children: $.map((e) => /* @__PURE__ */ o(ie, {
383
+ folder: e,
384
+ isSelected: N.has(e.id),
385
+ isDragging: R?.item.id === e.id,
386
+ isDropTarget: P.dropTargetFolderId === e.id,
387
+ draggedItem: R,
388
+ onOpen: q(e) ? x : void 0,
389
+ onShare: Y(e) ? S : void 0,
390
+ onDelete: X(e) ? C : void 0,
391
+ onRestore: J(e) ? w : void 0,
392
+ onRename: J(e) ? T : void 0,
393
+ onFavorite: J(e) ? E : void 0,
394
+ onCopy: me,
395
+ onMove: J(e) ? D : void 0,
396
+ onInfo: O,
397
+ onActivity: he,
398
+ onDragStart: J(e) ? De : void 0,
399
+ onDragEnd: z,
400
+ onDrop: J(e) ? Oe : void 0,
401
+ onContextMenu: V
402
+ }, e.id))
403
+ })]
404
+ }),
405
+ Q.length > 0 && /* @__PURE__ */ s("div", { children: [$.length > 0 && /* @__PURE__ */ o("h2", {
406
+ className: "text-xs font-semibold text-text-tertiary uppercase tracking-wider mb-3 px-1",
407
+ children: n(k, "files.browser.section.files", "Files")
408
+ }), /* @__PURE__ */ o("div", {
409
+ className: "grid grid-cols-2 @md:grid-cols-3 @lg:grid-cols-4 @xl:grid-cols-5 gap-4",
410
+ children: Q.map((e) => /* @__PURE__ */ o(ne, {
411
+ file: e,
412
+ isSelected: M.has(e.id),
413
+ isDragging: R?.item.id === e.id,
414
+ onPreview: U(e) ? pe : void 0,
415
+ onShare: G(e) ? d : void 0,
416
+ onDelete: K(e) ? f : void 0,
417
+ onRestore: W(e) ? p : void 0,
418
+ onFavorite: W(e) ? m : void 0,
419
+ onRename: W(e) ? h : void 0,
420
+ onDownload: U(e) ? g : void 0,
421
+ onCopy: U(e) ? _ : void 0,
422
+ onMove: W(e) ? v : void 0,
423
+ onInfo: y,
424
+ onActivity: b,
425
+ onDragStart: W(e) ? Ee : void 0,
426
+ onDragEnd: z,
427
+ onContextMenu: B
428
+ }, e.id))
429
+ })] }),
430
+ I && /* @__PURE__ */ o(r, {
431
+ x: I.x,
432
+ y: I.y,
433
+ onClose: H,
434
+ items: Z()
435
+ })
436
+ ]
421
437
  });
422
438
  };
423
439
  //#endregion