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