@burdenoff/microfe-files 2026.1113.2 → 2026.1115.2

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