@burdenoff/microfe-files 2026.1110.2 → 2026.1111.1

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