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