@burdenoff/microfe-files 2026.1120.1 → 2026.1123.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 (97) hide show
  1. package/dist/files/FilesRoutes.js +27 -21
  2. package/dist/files/FilesRoutes.js.map +1 -1
  3. package/dist/files/components/CopyDialog.js +12 -12
  4. package/dist/files/components/EmptyState.js +6 -6
  5. package/dist/files/components/EmptyState.js.map +1 -1
  6. package/dist/files/components/FileBrowser.js +4 -4
  7. package/dist/files/components/FileBrowser.js.map +1 -1
  8. package/dist/files/components/FileCard.js +4 -4
  9. package/dist/files/components/FileCard.js.map +1 -1
  10. package/dist/files/components/FileInfoPanel.js +18 -18
  11. package/dist/files/components/FileVersionPanel.js +4 -4
  12. package/dist/files/components/FolderCard.js +4 -4
  13. package/dist/files/components/FolderCard.js.map +1 -1
  14. package/dist/files/components/MoveDialog.js +10 -10
  15. package/dist/files/components/SearchBar.js +7 -7
  16. package/dist/files/components/ShareAccessParts.js +15 -15
  17. package/dist/files/components/ShareDialog.js +27 -27
  18. package/dist/files/components/SharedFolderView.js +9 -9
  19. package/dist/files/components/ToolbarMoreMenu.js +9 -9
  20. package/dist/files/components/UploadQueue.js +30 -30
  21. package/dist/files/components/UploadVisibilitySelect.js +4 -4
  22. package/dist/files/hooks/useCreateFolderShare.d.ts +2 -0
  23. package/dist/files/hooks/useCreateFolderShare.js +1 -1
  24. package/dist/files/hooks/useCreateFolderShare.js.map +1 -1
  25. package/dist/files/hooks/useCreateShare.d.ts +2 -0
  26. package/dist/files/hooks/useCreateShare.js +1 -1
  27. package/dist/files/hooks/useCreateShare.js.map +1 -1
  28. package/dist/files/pages/BrowserPage.js +22 -22
  29. package/dist/files/pages/BrowserPage.js.map +1 -1
  30. package/dist/files/pages/ShareAccessPage.js +4 -4
  31. package/dist/files/pages/ShareAccessPage.js.map +1 -1
  32. package/dist/files/types.d.ts +22 -0
  33. package/dist/files/utils/fileKind.d.ts +6 -0
  34. package/dist/files/utils/fileKind.js +49 -10
  35. package/dist/files/utils/fileKind.js.map +1 -1
  36. package/dist/files/v2/DialogShell.d.ts +28 -0
  37. package/dist/files/v2/DialogShell.js +47 -0
  38. package/dist/files/v2/DialogShell.js.map +1 -0
  39. package/dist/files/v2/FilesDialogs.d.ts +35 -0
  40. package/dist/files/v2/FilesDialogs.js +104 -0
  41. package/dist/files/v2/FilesDialogs.js.map +1 -0
  42. package/dist/files/v2/FilesListParts.d.ts +45 -0
  43. package/dist/files/v2/FilesListParts.js +344 -0
  44. package/dist/files/v2/FilesListParts.js.map +1 -0
  45. package/dist/files/v2/FilesPage.d.ts +15 -0
  46. package/dist/files/v2/FilesPage.js +340 -0
  47. package/dist/files/v2/FilesPage.js.map +1 -0
  48. package/dist/files/v2/FilesPageParts.d.ts +41 -0
  49. package/dist/files/v2/FilesPageParts.js +147 -0
  50. package/dist/files/v2/FilesPageParts.js.map +1 -0
  51. package/dist/files/v2/FilesV2Routes.d.ts +8 -0
  52. package/dist/files/v2/FilesV2Routes.js +41 -0
  53. package/dist/files/v2/FilesV2Routes.js.map +1 -0
  54. package/dist/files/v2/ShareDialogV2.d.ts +10 -0
  55. package/dist/files/v2/ShareDialogV2.js +401 -0
  56. package/dist/files/v2/ShareDialogV2.js.map +1 -0
  57. package/dist/files/v2/UploadDialog.d.ts +14 -0
  58. package/dist/files/v2/UploadDialog.js +171 -0
  59. package/dist/files/v2/UploadDialog.js.map +1 -0
  60. package/dist/files/v2/filesModel.d.ts +164 -0
  61. package/dist/files/v2/filesModel.js +247 -0
  62. package/dist/files/v2/filesModel.js.map +1 -0
  63. package/dist/files/v2/uploadLine.d.ts +36 -0
  64. package/dist/files/v2/uploadLine.js +33 -0
  65. package/dist/files/v2/uploadLine.js.map +1 -0
  66. package/dist/files/v2/useFilesPage.d.ts +28 -0
  67. package/dist/files/v2/useFilesPage.js +118 -0
  68. package/dist/files/v2/useFilesPage.js.map +1 -0
  69. package/dist/files/v2/useFilesV2Actions.d.ts +24 -0
  70. package/dist/files/v2/useFilesV2Actions.js +243 -0
  71. package/dist/files/v2/useFilesV2Actions.js.map +1 -0
  72. package/dist/files/v2/useFilesV2List.d.ts +24 -0
  73. package/dist/files/v2/useFilesV2List.js +159 -0
  74. package/dist/files/v2/useFilesV2List.js.map +1 -0
  75. package/dist/files/v2/useFilesV2Uploads.d.ts +87 -0
  76. package/dist/files/v2/useFilesV2Uploads.js +279 -0
  77. package/dist/files/v2/useFilesV2Uploads.js.map +1 -0
  78. package/dist/files/v2/useNow.d.ts +6 -0
  79. package/dist/files/v2/useNow.js +13 -0
  80. package/dist/files/v2/useNow.js.map +1 -0
  81. package/dist/files/v2/useShareV2.d.ts +39 -0
  82. package/dist/files/v2/useShareV2.js +89 -0
  83. package/dist/files/v2/useShareV2.js.map +1 -0
  84. package/dist/files/v2/whoCanSee.d.ts +9 -0
  85. package/dist/files/v2/whoCanSee.js +48 -0
  86. package/dist/files/v2/whoCanSee.js.map +1 -0
  87. package/dist/generated/global-types.d.ts +450 -6
  88. package/dist/generated/wspace-operations.d.ts +249 -0
  89. package/dist/generated/wspace-operations.js +4631 -1
  90. package/dist/generated/wspace-operations.js.map +1 -1
  91. package/dist/generated/wspace-types.d.ts +6866 -105
  92. package/dist/generated/wspace-types.js +9 -3
  93. package/dist/generated/wspace-types.js.map +1 -1
  94. package/dist/translations/en.d.ts +277 -0
  95. package/dist/translations/en.js +265 -0
  96. package/dist/translations/en.js.map +1 -1
  97. package/package.json +2 -2
@@ -5,24 +5,24 @@ import { classifyShareRefusal as i, shareDenialCopy as a, sharePermissionMessage
5
5
  import { useEffect as s, useState as c } from "react";
6
6
  import { Calendar as l, Check as u, Copy as d, Download as f, Link as p, Loader2 as m, Lock as h, Mail as g, ShieldAlert as _ } from "lucide-react";
7
7
  import { Fragment as v, jsx as y, jsxs as b } from "react/jsx-runtime";
8
- import { useI18n as x } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
9
- import { Button as S, OptionalFields as C, ResponsiveDialog as w, ResponsiveDialogContent as T, ResponsiveDialogDescription as E, ResponsiveDialogFooter as D, ResponsiveDialogHeader as O, ResponsiveDialogTitle as k, ThemedSelect as A } from "@burdenoff/fe-libs/ui";
8
+ import { Button as x, OptionalFields as S, ResponsiveDialog as C, ResponsiveDialogContent as w, ResponsiveDialogDescription as T, ResponsiveDialogFooter as E, ResponsiveDialogHeader as D, ResponsiveDialogTitle as O, ThemedSelect as k } from "@burdenoff/fe-libs/ui";
9
+ import { useI18n as A } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
10
10
  // src/files/components/ShareDialog.tsx
11
11
  function j({ item: t, itemType: n, onClose: i, onCreateShare: a, isLoading: o, knownPermission: s, navigationV2: l = !1 }) {
12
- let { t: u } = x(), [d, f] = c(null), { permission: p, denialCause: m, recordRefusal: h } = r({
12
+ let { t: u } = A(), [d, f] = c(null), { permission: p, denialCause: m, recordRefusal: h } = r({
13
13
  item: t,
14
14
  itemType: n,
15
15
  knownPermission: s
16
16
  }), g = e(u, n === "folder" ? "files.shareDialog.itemType.folder" : "files.shareDialog.itemType.file", n === "folder" ? "folder" : "file");
17
- return /* @__PURE__ */ y(w, {
17
+ return /* @__PURE__ */ y(C, {
18
18
  open: !0,
19
19
  onOpenChange: (e) => {
20
20
  e || i();
21
21
  },
22
- children: /* @__PURE__ */ b(T, { children: [/* @__PURE__ */ b(O, { children: [/* @__PURE__ */ y(k, { children: e(u, "files.shareDialog.title", "Share {{itemType}} \"{{name}}\"", {
22
+ children: /* @__PURE__ */ b(w, { children: [/* @__PURE__ */ b(D, { children: [/* @__PURE__ */ y(O, { children: e(u, "files.shareDialog.title", "Share {{itemType}} \"{{name}}\"", {
23
23
  itemType: g,
24
24
  name: t.name
25
- }) }), l && d === null && /* @__PURE__ */ y(E, { children: e(u, "files.shareDialog.reach", "Anyone with the link can view and download until it expires.") })] }), /* @__PURE__ */ y(M, {
25
+ }) }), l && d === null && /* @__PURE__ */ y(T, { children: e(u, "files.shareDialog.reach", "Anyone with the link can view and download until it expires.") })] }), /* @__PURE__ */ y(M, {
26
26
  item: t,
27
27
  itemType: n,
28
28
  itemTypeLabel: g,
@@ -58,7 +58,7 @@ function M({ item: e, itemType: t, itemTypeLabel: n, permission: r, denialCause:
58
58
  });
59
59
  }
60
60
  function N({ cause: t, itemTypeLabel: n, onClose: r }) {
61
- let { t: i } = x(), o = a(i, t, n);
61
+ let { t: i } = A(), o = a(i, t, n);
62
62
  return /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ b("div", {
63
63
  role: "alert",
64
64
  className: "flex items-start gap-3 rounded-lg border border-status-warning-border bg-status-warning-bg-subtle px-4 py-3",
@@ -72,20 +72,20 @@ function N({ cause: t, itemTypeLabel: n, onClose: r }) {
72
72
  children: o.description
73
73
  })]
74
74
  })]
75
- }), /* @__PURE__ */ y(D, { children: /* @__PURE__ */ y(S, {
75
+ }), /* @__PURE__ */ y(E, { children: /* @__PURE__ */ y(x, {
76
76
  type: "button",
77
77
  onClick: r,
78
78
  children: e(i, "files.common.actions.close", "Close")
79
79
  }) })] });
80
80
  }
81
81
  function P({ onClose: t }) {
82
- let { t: n } = x();
82
+ let { t: n } = A();
83
83
  return /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ b("div", {
84
84
  role: "status",
85
85
  "aria-live": "polite",
86
86
  className: "flex items-center gap-3 py-6 text-sm text-text-secondary",
87
87
  children: [/* @__PURE__ */ y(m, { className: "size-4 animate-spin" }), o(n).checking]
88
- }), /* @__PURE__ */ y(D, { children: /* @__PURE__ */ y(S, {
88
+ }), /* @__PURE__ */ y(E, { children: /* @__PURE__ */ y(x, {
89
89
  type: "button",
90
90
  variant: "outline",
91
91
  onClick: t,
@@ -96,7 +96,7 @@ function F(t, n) {
96
96
  return n instanceof Error ? n.message : e(t, "files.shareDialog.errors.createFailed", "Failed to create share");
97
97
  }
98
98
  function I({ item: r, itemType: a, isLoading: o, onClose: s, onCreateShare: l, onCreated: u, onRefused: d, navigationV2: f }) {
99
- let { t: p } = x(), [m, h] = c(t), [g, _] = c(null), C = (e) => h((t) => ({
99
+ let { t: p } = A(), [m, h] = c(t), [g, _] = c(null), S = (e) => h((t) => ({
100
100
  ...t,
101
101
  ...e
102
102
  }));
@@ -110,25 +110,25 @@ function I({ item: r, itemType: a, isLoading: o, onClose: s, onCreateShare: l, o
110
110
  children: [
111
111
  /* @__PURE__ */ y(z, {
112
112
  value: m.expiryDays,
113
- onChange: (e) => C({ expiryDays: e })
113
+ onChange: (e) => S({ expiryDays: e })
114
114
  }),
115
115
  /* @__PURE__ */ y(B, {
116
116
  value: m.invitedEmail,
117
- onChange: (e) => C({ invitedEmail: e })
117
+ onChange: (e) => S({ invitedEmail: e })
118
118
  }),
119
119
  /* @__PURE__ */ y(V, {
120
120
  values: m,
121
- onChange: C,
121
+ onChange: S,
122
122
  navigationV2: f
123
123
  })
124
124
  ]
125
125
  }),
126
- /* @__PURE__ */ b(D, { children: [/* @__PURE__ */ y(S, {
126
+ /* @__PURE__ */ b(E, { children: [/* @__PURE__ */ y(x, {
127
127
  type: "button",
128
128
  variant: "outline",
129
129
  onClick: s,
130
130
  children: e(p, "files.common.actions.cancel", "Cancel")
131
- }), /* @__PURE__ */ y(S, {
131
+ }), /* @__PURE__ */ y(x, {
132
132
  type: "button",
133
133
  onClick: async () => {
134
134
  _(null);
@@ -155,7 +155,7 @@ function I({ item: r, itemType: a, isLoading: o, onClose: s, onCreateShare: l, o
155
155
  ] });
156
156
  }
157
157
  function L({ isLoading: t }) {
158
- let { t: n } = x();
158
+ let { t: n } = A();
159
159
  return t ? /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ y(m, { className: "size-4 animate-spin" }), e(n, "files.shareDialog.actions.creating", "Creating...")] }) : /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ y(p, { className: "size-4" }), e(n, "files.shareDialog.actions.createLink", "Create share link")] });
160
160
  }
161
161
  var R = [
@@ -186,12 +186,12 @@ var R = [
186
186
  }
187
187
  ];
188
188
  function z({ value: t, onChange: n }) {
189
- let { t: r } = x(), i = e(r, "files.shareDialog.expiry.label", "Link expires in");
189
+ let { t: r } = A(), i = e(r, "files.shareDialog.expiry.label", "Link expires in");
190
190
  return /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ b("label", {
191
191
  htmlFor: "share-dialog-expiry-select",
192
192
  className: "flex items-center gap-2 text-sm font-medium text-text-primary mb-2",
193
193
  children: [/* @__PURE__ */ y(l, { className: "size-4" }), i]
194
- }), /* @__PURE__ */ y(A, {
194
+ }), /* @__PURE__ */ y(k, {
195
195
  id: "share-dialog-expiry-select",
196
196
  "aria-label": i,
197
197
  value: t,
@@ -204,7 +204,7 @@ function z({ value: t, onChange: n }) {
204
204
  })] });
205
205
  }
206
206
  function B({ value: t, onChange: n }) {
207
- let { t: r } = x(), i = e(r, "files.shareDialog.invite.label", "Invite specific person (optional)");
207
+ let { t: r } = A(), i = e(r, "files.shareDialog.invite.label", "Invite specific person (optional)");
208
208
  return /* @__PURE__ */ b("div", { children: [
209
209
  /* @__PURE__ */ b("label", {
210
210
  htmlFor: "share-dialog-invite-email",
@@ -227,8 +227,8 @@ function B({ value: t, onChange: n }) {
227
227
  ] });
228
228
  }
229
229
  function V({ values: t, onChange: n, navigationV2: r }) {
230
- let { t: i } = x(), a = e(i, "files.shareDialog.downloads.label", "Maximum downloads");
231
- return /* @__PURE__ */ y(C, {
230
+ let { t: i } = A(), a = e(i, "files.shareDialog.downloads.label", "Maximum downloads");
231
+ return /* @__PURE__ */ y(S, {
232
232
  storageKey: r ? "files.shareDialog" : void 0,
233
233
  title: r ? void 0 : e(i, "files.shareDialog.advanced.title", "Advanced"),
234
234
  description: e(i, "files.shareDialog.advanced.description", "Download limits and password protection"),
@@ -258,7 +258,7 @@ function V({ values: t, onChange: n, navigationV2: r }) {
258
258
  });
259
259
  }
260
260
  function H({ values: t, onChange: n }) {
261
- let { t: r } = x(), i = e(r, "files.shareDialog.password.label", "Password protection"), a = e(r, "files.shareDialog.password.require", "Require password");
261
+ let { t: r } = A(), i = e(r, "files.shareDialog.password.label", "Password protection"), a = e(r, "files.shareDialog.password.require", "Require password");
262
262
  return /* @__PURE__ */ b("div", { children: [
263
263
  /* @__PURE__ */ b("label", {
264
264
  htmlFor: "share-dialog-password-required",
@@ -293,7 +293,7 @@ function H({ values: t, onChange: n }) {
293
293
  ] });
294
294
  }
295
295
  function U({ created: t, onClose: n }) {
296
- let { t: r } = x();
296
+ let { t: r } = A();
297
297
  return /* @__PURE__ */ b("div", {
298
298
  className: "space-y-4",
299
299
  children: [/* @__PURE__ */ y("div", {
@@ -305,7 +305,7 @@ function U({ created: t, onClose: n }) {
305
305
  className: "text-sm text-text-secondary",
306
306
  children: e(r, "files.shareDialog.success.invitationSentTo", "An invitation has been sent to {{email}}", { email: t.invitedEmail })
307
307
  })] }) : /* @__PURE__ */ y(W, { shareUrl: t.shareUrl })
308
- }), /* @__PURE__ */ y(D, { children: /* @__PURE__ */ y(S, {
308
+ }), /* @__PURE__ */ y(E, { children: /* @__PURE__ */ y(x, {
309
309
  type: "button",
310
310
  onClick: n,
311
311
  className: "w-full",
@@ -314,7 +314,7 @@ function U({ created: t, onClose: n }) {
314
314
  });
315
315
  }
316
316
  function W({ shareUrl: t }) {
317
- let { t: n } = x(), [r, i] = c(!1);
317
+ let { t: n } = A(), [r, i] = c(!1);
318
318
  return s(() => {
319
319
  if (r) {
320
320
  let e = setTimeout(() => i(!1), 2e3);
@@ -331,7 +331,7 @@ function W({ shareUrl: t }) {
331
331
  readOnly: !0,
332
332
  "aria-label": e(n, "files.shareDialog.success.linkCreated", "Share link"),
333
333
  className: "flex-1 min-h-11 px-3 py-2 bg-bg-surface border border-status-success-border rounded-lg text-sm"
334
- }), /* @__PURE__ */ y(S, {
334
+ }), /* @__PURE__ */ y(x, {
335
335
  type: "button",
336
336
  onClick: async () => {
337
337
  t && (await navigator.clipboard.writeText(t), i(!0));
@@ -2,11 +2,11 @@ import { tWithFallback as e } from "../utils/i18n.js";
2
2
  import { formatFileSize as t } from "../utils/index.js";
3
3
  import { Download as n, Eye as r, FileText as i, Folder as a, Loader2 as o } from "lucide-react";
4
4
  import { jsx as s, jsxs as c } from "react/jsx-runtime";
5
- import { useI18n as l } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
6
- import { Button as u } from "@burdenoff/fe-libs/ui";
5
+ import { Button as l } from "@burdenoff/fe-libs/ui";
6
+ import { useI18n as u } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
7
7
  // src/files/components/SharedFolderView.tsx
8
8
  function d({ folderName: d, files: f, truncated: p, busyFileId: m, failedFileId: h, onPreview: g, onDownload: _ }) {
9
- let { t: v } = l();
9
+ let { t: v } = u();
10
10
  return /* @__PURE__ */ c("div", {
11
11
  className: "space-y-4",
12
12
  children: [
@@ -24,7 +24,7 @@ function d({ folderName: d, files: f, truncated: p, busyFileId: m, failedFileId:
24
24
  className: "divide-y divide-border-seam rounded-lg border border-border-seam",
25
25
  "aria-label": e(v, "files.share.folder.listLabel", "Files in this folder"),
26
26
  children: f.map((a) => {
27
- let l = m === a.id;
27
+ let u = m === a.id;
28
28
  return /* @__PURE__ */ c("li", {
29
29
  className: "px-3 py-2",
30
30
  children: [/* @__PURE__ */ c("div", {
@@ -41,23 +41,23 @@ function d({ folderName: d, files: f, truncated: p, busyFileId: m, failedFileId:
41
41
  children: t(Number(a.size))
42
42
  })]
43
43
  }),
44
- /* @__PURE__ */ s(u, {
44
+ /* @__PURE__ */ s(l, {
45
45
  type: "button",
46
46
  variant: "ghost",
47
47
  size: "icon-sm",
48
- disabled: l,
48
+ disabled: u,
49
49
  "aria-label": e(v, "files.share.folder.previewFile", "Preview {{name}}", { name: a.name }),
50
50
  onClick: () => g(a),
51
51
  children: /* @__PURE__ */ s(r, { className: "size-4" })
52
52
  }),
53
- /* @__PURE__ */ s(u, {
53
+ /* @__PURE__ */ s(l, {
54
54
  type: "button",
55
55
  variant: "ghost",
56
56
  size: "icon-sm",
57
- disabled: l,
57
+ disabled: u,
58
58
  "aria-label": e(v, "files.share.folder.downloadFile", "Download {{name}}", { name: a.name }),
59
59
  onClick: () => _(a),
60
- children: l ? /* @__PURE__ */ s(o, { className: "size-4 animate-spin" }) : /* @__PURE__ */ s(n, { className: "size-4" })
60
+ children: u ? /* @__PURE__ */ s(o, { className: "size-4 animate-spin" }) : /* @__PURE__ */ s(n, { className: "size-4" })
61
61
  })
62
62
  ]
63
63
  }), h === a.id && /* @__PURE__ */ s("p", {
@@ -1,31 +1,31 @@
1
1
  import { tWithFallback as e } from "../utils/i18n.js";
2
2
  import { CheckSquare as t, FolderPlus as n, FolderUp as r, MoreHorizontal as i } from "lucide-react";
3
3
  import { jsx as a, jsxs as o } from "react/jsx-runtime";
4
- import { useI18n as s } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
5
- import { Button as c, DropdownMenu as l, DropdownMenuContent as u, DropdownMenuItem as d, DropdownMenuSub as f, DropdownMenuSubContent as p, DropdownMenuSubTrigger as m, DropdownMenuTrigger as h } from "@burdenoff/fe-libs/ui";
4
+ import { Button as s, DropdownMenu as c, DropdownMenuContent as l, DropdownMenuItem as u, DropdownMenuSub as d, DropdownMenuSubContent as f, DropdownMenuSubTrigger as p, DropdownMenuTrigger as m } from "@burdenoff/fe-libs/ui";
5
+ import { useI18n as h } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
6
6
  // src/files/components/ToolbarMoreMenu.tsx
7
7
  function g({ onNewFolder: g, onUploadFolder: _, onSelectAll: v, uploading: y = !1 }) {
8
- let { t: b } = s();
9
- return /* @__PURE__ */ o(l, { children: [/* @__PURE__ */ a(h, {
8
+ let { t: b } = h();
9
+ return /* @__PURE__ */ o(c, { children: [/* @__PURE__ */ a(m, {
10
10
  asChild: !0,
11
- children: /* @__PURE__ */ a(c, {
11
+ children: /* @__PURE__ */ a(s, {
12
12
  type: "button",
13
13
  variant: "outline",
14
14
  size: "icon",
15
15
  "aria-label": e(b, "files.browser.actions.moreActions", "More actions"),
16
16
  children: /* @__PURE__ */ a(i, { className: "size-4" })
17
17
  })
18
- }), /* @__PURE__ */ o(u, {
18
+ }), /* @__PURE__ */ o(l, {
19
19
  align: "end",
20
- children: [/* @__PURE__ */ o(d, {
20
+ children: [/* @__PURE__ */ o(u, {
21
21
  onSelect: g,
22
22
  "data-tour": "files-new-folder-button",
23
23
  children: [/* @__PURE__ */ a(n, { className: "size-4" }), e(b, "files.browser.actions.newFolder", "New Folder")]
24
- }), /* @__PURE__ */ o(f, { children: [/* @__PURE__ */ a(m, { children: e(b, "files.browser.actions.more", "More") }), /* @__PURE__ */ o(p, { children: [/* @__PURE__ */ o(d, {
24
+ }), /* @__PURE__ */ o(d, { children: [/* @__PURE__ */ a(p, { children: e(b, "files.browser.actions.more", "More") }), /* @__PURE__ */ o(f, { children: [/* @__PURE__ */ o(u, {
25
25
  onSelect: _,
26
26
  disabled: y,
27
27
  children: [/* @__PURE__ */ a(r, { className: "size-4" }), e(b, "files.browser.actions.uploadFolder", "Upload Folder")]
28
- }), v && /* @__PURE__ */ o(d, {
28
+ }), v && /* @__PURE__ */ o(u, {
29
29
  onSelect: v,
30
30
  children: [/* @__PURE__ */ a(t, { className: "size-4" }), e(b, "files.browser.actions.selectAll", "Select All")]
31
31
  })] })] })]
@@ -4,12 +4,12 @@ import { tWithFallback as t } from "../utils/i18n.js";
4
4
  import { useEffect as n, useRef as r } from "react";
5
5
  import { Image as i, MoreHorizontal as a, Pause as o, Play as s, RotateCcw as c, X as l } from "lucide-react";
6
6
  import { jsx as u, jsxs as d } from "react/jsx-runtime";
7
- import { useI18n as f } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
8
- import { DropdownMenu as p, DropdownMenuContent as m, DropdownMenuItem as h, DropdownMenuTrigger as g, GlassCard as _ } from "@burdenoff/fe-libs/ui";
7
+ import { DropdownMenu as f, DropdownMenuContent as p, DropdownMenuItem as m, DropdownMenuTrigger as h, GlassCard as g } from "@burdenoff/fe-libs/ui";
8
+ import { useI18n as _ } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
9
9
  // src/files/components/UploadQueue.tsx
10
10
  function v({ item: e, onPause: n, onResume: r }) {
11
- let { t: i } = f();
12
- return e.status !== "uploading" && e.status !== "paused" ? null : /* @__PURE__ */ d(p, { children: [/* @__PURE__ */ u(g, {
11
+ let { t: i } = _();
12
+ return e.status !== "uploading" && e.status !== "paused" ? null : /* @__PURE__ */ d(f, { children: [/* @__PURE__ */ u(h, {
13
13
  asChild: !0,
14
14
  children: /* @__PURE__ */ u("button", {
15
15
  type: "button",
@@ -17,19 +17,19 @@ function v({ item: e, onPause: n, onResume: r }) {
17
17
  "aria-label": t(i, "files.upload.moreActions", "More actions for {{name}}", { name: e.file.name }),
18
18
  children: /* @__PURE__ */ u(a, { className: "size-4" })
19
19
  })
20
- }), /* @__PURE__ */ u(m, {
20
+ }), /* @__PURE__ */ u(p, {
21
21
  align: "end",
22
- children: e.status === "uploading" ? /* @__PURE__ */ d(h, {
22
+ children: e.status === "uploading" ? /* @__PURE__ */ d(m, {
23
23
  onSelect: () => n(e.id),
24
24
  children: [/* @__PURE__ */ u(o, { className: "size-4" }), t(i, "files.upload.pause", "Pause")]
25
- }) : /* @__PURE__ */ d(h, {
25
+ }) : /* @__PURE__ */ d(m, {
26
26
  onSelect: () => r(e.id),
27
27
  children: [/* @__PURE__ */ u(s, { className: "size-4" }), t(i, "files.upload.resume", "Resume")]
28
28
  })
29
29
  })] });
30
30
  }
31
- function y({ item: a, onPause: p, onResume: m, onRetry: h, onCancel: g, navigationV2: _ = !1 }) {
32
- let { t: y } = f(), b = r(null), x = e(a.file.type);
31
+ function y({ item: a, onPause: f, onResume: p, onRetry: m, onCancel: h, navigationV2: g = !1 }) {
32
+ let { t: y } = _(), b = r(null), x = e(a.file.type);
33
33
  return n(() => {
34
34
  b.current && (b.current.style.width = `${a.progress}%`);
35
35
  }, [a.progress]), /* @__PURE__ */ u("div", {
@@ -101,35 +101,35 @@ function y({ item: a, onPause: p, onResume: m, onRetry: h, onCancel: g, navigati
101
101
  /* @__PURE__ */ d("div", {
102
102
  className: "flex items-center gap-1 flex-shrink-0",
103
103
  children: [
104
- _ && /* @__PURE__ */ u(v, {
104
+ g && /* @__PURE__ */ u(v, {
105
105
  item: a,
106
- onPause: p,
107
- onResume: m
106
+ onPause: f,
107
+ onResume: p
108
108
  }),
109
- !_ && a.status === "uploading" && /* @__PURE__ */ u("button", {
109
+ !g && a.status === "uploading" && /* @__PURE__ */ u("button", {
110
110
  type: "button",
111
- onClick: () => p(a.id),
111
+ onClick: () => f(a.id),
112
112
  className: "p-1.5 text-text-secondary hover:text-text-primary hover:bg-action-ghost-bg-hover rounded transition-colors",
113
113
  title: t(y, "files.upload.pause", "Pause"),
114
114
  children: /* @__PURE__ */ u(o, { className: "size-4" })
115
115
  }),
116
- !_ && a.status === "paused" && /* @__PURE__ */ u("button", {
116
+ !g && a.status === "paused" && /* @__PURE__ */ u("button", {
117
117
  type: "button",
118
- onClick: () => m(a.id),
118
+ onClick: () => p(a.id),
119
119
  className: "p-1.5 text-text-secondary hover:text-text-primary hover:bg-action-ghost-bg-hover rounded transition-colors",
120
120
  title: t(y, "files.upload.resume", "Resume"),
121
121
  children: /* @__PURE__ */ u(s, { className: "size-4" })
122
122
  }),
123
123
  a.status === "failed" && /* @__PURE__ */ u("button", {
124
124
  type: "button",
125
- onClick: () => h(a.id),
125
+ onClick: () => m(a.id),
126
126
  className: "p-1.5 text-text-secondary hover:text-text-primary hover:bg-action-ghost-bg-hover rounded transition-colors",
127
127
  title: t(y, "files.upload.retry", "Retry"),
128
128
  children: /* @__PURE__ */ u(c, { className: "size-4" })
129
129
  }),
130
130
  (a.status === "pending" || a.status === "paused" || a.status === "failed") && /* @__PURE__ */ u("button", {
131
131
  type: "button",
132
- onClick: () => g(a.id),
132
+ onClick: () => h(a.id),
133
133
  className: "p-1.5 text-text-secondary hover:text-status-error-text hover:bg-status-error-bg-subtle rounded transition-colors",
134
134
  title: t(y, "files.upload.cancel", "Cancel"),
135
135
  children: /* @__PURE__ */ u(l, { className: "size-4" })
@@ -141,10 +141,10 @@ function y({ item: a, onPause: p, onResume: m, onRetry: h, onCancel: g, navigati
141
141
  });
142
142
  }
143
143
  function b({ items: e, isOpen: n, onClose: r, onPause: i, onResume: a, onRetry: o, onCancel: s, navigationV2: c = !1 }) {
144
- let { t: p } = f();
144
+ let { t: f } = _();
145
145
  if (!n) return null;
146
- let m = e.filter((e) => e.status === "completed").length, h = e.filter((e) => e.status === "failed").length, g = e.filter((e) => e.status === "uploading" || e.status === "pending").length;
147
- return /* @__PURE__ */ d(_, {
146
+ let p = e.filter((e) => e.status === "completed").length, m = e.filter((e) => e.status === "failed").length, h = e.filter((e) => e.status === "uploading" || e.status === "pending").length;
147
+ return /* @__PURE__ */ d(g, {
148
148
  treatment: "glass",
149
149
  glow: !0,
150
150
  className: "fixed bottom-4 right-4 z-50 w-80 max-w-[90vw] md:w-96",
@@ -154,28 +154,28 @@ function b({ items: e, isOpen: n, onClose: r, onPause: i, onResume: a, onRetry:
154
154
  /* @__PURE__ */ d("h3", {
155
155
  className: "flex items-center gap-2 text-sm font-semibold text-text-primary",
156
156
  children: [
157
- g > 0 && /* @__PURE__ */ u("span", {
157
+ h > 0 && /* @__PURE__ */ u("span", {
158
158
  className: "size-2 shrink-0 rounded-full bg-action-primary-bg motion-safe:animate-vc-glow-pulse",
159
159
  "aria-hidden": "true"
160
160
  }),
161
- t(p, "files.upload.uploads", "Uploads"),
161
+ t(f, "files.upload.uploads", "Uploads"),
162
162
  " (",
163
- t(p, "files.upload.active", "{{count}} uploading", { count: g }),
163
+ t(f, "files.upload.active", "{{count}} uploading", { count: h }),
164
164
  ")"
165
165
  ]
166
166
  }),
167
- m > 0 && /* @__PURE__ */ u("p", {
167
+ p > 0 && /* @__PURE__ */ u("p", {
168
168
  className: "text-xs text-status-success-text",
169
- children: t(p, "files.upload.completed", "{{count}} completed", { count: m })
169
+ children: t(f, "files.upload.completed", "{{count}} completed", { count: p })
170
170
  }),
171
- h > 0 && /* @__PURE__ */ u("p", {
171
+ m > 0 && /* @__PURE__ */ u("p", {
172
172
  className: "text-xs text-status-error-text",
173
- children: t(p, "files.upload.failedCount", "{{count}} failed", { count: h })
173
+ children: t(f, "files.upload.failedCount", "{{count}} failed", { count: m })
174
174
  })
175
175
  ] }), /* @__PURE__ */ u("button", {
176
176
  type: "button",
177
177
  onClick: r,
178
- "aria-label": t(p, "files.upload.close", "Close uploads"),
178
+ "aria-label": t(f, "files.upload.close", "Close uploads"),
179
179
  className: "p-1 text-text-secondary hover:text-text-primary hover:bg-action-ghost-bg-hover rounded transition-colors",
180
180
  children: /* @__PURE__ */ u(l, { className: "size-4" })
181
181
  })]
@@ -183,7 +183,7 @@ function b({ items: e, isOpen: n, onClose: r, onPause: i, onResume: a, onRetry:
183
183
  className: "max-h-64 overflow-y-auto p-2 space-y-2",
184
184
  children: e.length === 0 ? /* @__PURE__ */ u("p", {
185
185
  className: "text-sm text-text-secondary text-center py-4",
186
- children: t(p, "files.upload.noUploads", "No uploads")
186
+ children: t(f, "files.upload.noUploads", "No uploads")
187
187
  }) : e.map((e) => /* @__PURE__ */ u(y, {
188
188
  item: e,
189
189
  onPause: i,
@@ -3,11 +3,11 @@ import { tWithFallback as t } from "../utils/i18n.js";
3
3
  import { isUploadVisibility as n } from "../utils/uploadVisibility.js";
4
4
  import { useId as r } from "react";
5
5
  import { jsx as i, jsxs as a } from "react/jsx-runtime";
6
- import { useI18n as o } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
7
- import { ThemedSelect as s } from "@burdenoff/fe-libs/ui";
6
+ import { ThemedSelect as o } from "@burdenoff/fe-libs/ui";
7
+ import { useI18n as s } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
8
8
  // src/files/components/UploadVisibilitySelect.tsx
9
9
  function c({ value: c, onChange: l, disabled: u = !1, label: d }) {
10
- let { t: f } = o(), p = r();
10
+ let { t: f } = s(), p = r();
11
11
  return /* @__PURE__ */ a("div", {
12
12
  className: "min-w-0 space-y-1",
13
13
  children: [
@@ -16,7 +16,7 @@ function c({ value: c, onChange: l, disabled: u = !1, label: d }) {
16
16
  className: "block text-sm font-medium text-text-primary",
17
17
  children: d ?? t(f, "files.visibility.uploadLabel", "Upload visibility")
18
18
  }),
19
- /* @__PURE__ */ a(s, {
19
+ /* @__PURE__ */ a(o, {
20
20
  id: p,
21
21
  value: c,
22
22
  disabled: u,
@@ -8,6 +8,8 @@ export interface CreateFolderShareInput {
8
8
  maxDownloads?: number;
9
9
  invitedEmail?: string;
10
10
  invitedUserIds?: string[];
11
+ /** A note for an email invite, shown in the invitation (Workspace pages v2). */
12
+ message?: string;
11
13
  }
12
14
  /**
13
15
  * Create a folder share through the consolidated ShareGrant stack (BOFF-5302).
@@ -35,7 +35,7 @@ var a = () => {
35
35
  resourceId: e.folderId,
36
36
  email: e.invitedEmail,
37
37
  role: i(e.accessLevel),
38
- message: null,
38
+ message: e.message?.trim() || null,
39
39
  expiresAt: e.expiresAt ?? null
40
40
  },
41
41
  options: {
@@ -1 +1 @@
1
- {"version":3,"file":"useCreateFolderShare.js","names":["toShareRole","accessLevel","useCreateFolderShare","shareFolderMutation","inviteLoading","inviteError","useMutation","ShareFolderDocument","createLinkMutation","linkLoading","linkError","CreateFolderShareLinkDocument","input","variables","result","extractShareToken"],"sources":["../../../src/files/hooks/useCreateFolderShare.ts"],"sourcesContent":["import { useMutation } from \"@apollo/client/react\";\n\nimport {\n CreateFolderShareLinkDocument,\n ShareFolderDocument,\n} from \"../../generated/wspace-operations\";\nimport type {\n FileShareAccessLevel,\n ShareRole,\n} from \"../../generated/wspace-types\";\nimport type {\n CreateFolderShareLinkMutationVariables,\n ShareFolderMutationVariables,\n} from \"../../generated/wspace-operations\";\nimport { extractShareToken, type ShareCreationResult } from \"./useCreateShare\";\n\nexport interface CreateFolderShareInput {\n folderId: string;\n shareType: \"PUBLIC_LINK\" | \"EMAIL_INVITE\" | \"GROUP_SHARE\";\n accessLevel: \"VIEW\" | \"COMMENT\" | \"DOWNLOAD\" | \"EDIT\";\n expiresAt?: string;\n password?: string;\n maxDownloads?: number;\n invitedEmail?: string;\n invitedUserIds?: string[];\n}\n\n/** Generic ShareRole for the legacy access levels (DOWNLOAD has no dedicated role). */\nfunction toShareRole(\n accessLevel: CreateFolderShareInput[\"accessLevel\"],\n): ShareRole {\n switch (accessLevel) {\n case \"COMMENT\":\n return \"COMMENTER\" as ShareRole;\n case \"EDIT\":\n return \"EDITOR\" as ShareRole;\n default:\n return \"VIEWER\" as ShareRole;\n }\n}\n\n/**\n * Create a folder share through the consolidated ShareGrant stack (BOFF-5302).\n * Same cutover as useCreateShare: public links become PUBLIC_LINK grants,\n * email invites become PENDING grants + accept email.\n */\nexport const useCreateFolderShare = () => {\n const [shareFolderMutation, { loading: inviteLoading, error: inviteError }] =\n useMutation(ShareFolderDocument);\n const [createLinkMutation, { loading: linkLoading, error: linkError }] =\n useMutation(CreateFolderShareLinkDocument);\n\n const loading = inviteLoading || linkLoading;\n const error = inviteError ?? linkError;\n\n return {\n mutateAsync: async (\n input: CreateFolderShareInput,\n ): Promise<ShareCreationResult> => {\n const accessLevel = input.accessLevel.toUpperCase() as\n \"VIEW\" | \"COMMENT\" | \"DOWNLOAD\" | \"EDIT\";\n if (input.shareType === \"PUBLIC_LINK\") {\n const variables: CreateFolderShareLinkMutationVariables = {\n input: {\n resourceId: input.folderId,\n role: toShareRole(input.accessLevel),\n expiresAt: input.expiresAt ?? null,\n },\n options: {\n password: input.password ?? null,\n maxDownloads: input.maxDownloads ?? null,\n accessLevel: accessLevel as unknown as FileShareAccessLevel,\n },\n };\n const result = await createLinkMutation({ variables });\n return {\n token: extractShareToken(\n result.data?.createFolderShareLink.shareUrl ?? \"\",\n ),\n };\n }\n\n if (input.shareType !== \"EMAIL_INVITE\" || !input.invitedEmail) {\n throw new Error(\"Email invite shares require an invitedEmail\");\n }\n\n const variables: ShareFolderMutationVariables = {\n input: {\n resourceId: input.folderId,\n email: input.invitedEmail,\n role: toShareRole(input.accessLevel),\n message: null,\n expiresAt: input.expiresAt ?? null,\n },\n options: {\n password: input.password ?? null,\n maxDownloads: input.maxDownloads ?? null,\n accessLevel: accessLevel as unknown as FileShareAccessLevel,\n },\n };\n await shareFolderMutation({ variables });\n return { token: \"\" };\n },\n isPending: loading,\n error,\n };\n};\n"],"mappings":";;;;AA4BA,SAASA,EACP,GACW;CACX,QAAQC,GAAR;EACE,KAAK,WACH,OAAO;EACT,KAAK,QACH,OAAO;EACT,SACE,OAAO;CACX;AACF;AAOA,IAAaC,UAA6B;CACxC,IAAM,CAACC,GAAqB,EAAE,SAASC,GAAe,OAAOC,OAC3DC,EAAYC,CAAmB,GAC3B,CAACC,GAAoB,EAAE,SAASC,GAAa,OAAOC,OACxDJ,EAAYK,CAA6B;CAK3C,OAAO;EACL,aAAa,OACX,MACiC;GACjC,IAAMV,IAAcW,EAAM,YAAY,YAAY;GAElD,IAAIA,EAAM,cAAc,eAAe;IACrC,IAAMC,IAAoD;KACxD,OAAO;MACL,YAAYD,EAAM;MAClB,MAAMZ,EAAYY,EAAM,WAAW;MACnC,WAAWA,EAAM,aAAa;KAChC;KACA,SAAS;MACP,UAAUA,EAAM,YAAY;MAC5B,cAAcA,EAAM,gBAAgB;MACvB;KACf;IACF,GACME,IAAS,MAAMN,EAAmB,EAAE,aAAU,CAAC;IACrD,OAAO,EACL,OAAOO,EACLD,EAAO,MAAM,sBAAsB,YAAY,EACjD,EACF;GACF;GAEA,IAAIF,EAAM,cAAc,kBAAkB,CAACA,EAAM,cAC/C,MAAU,MAAM,6CAA6C;GAG/D,IAAMC,IAA0C;IAC9C,OAAO;KACL,YAAYD,EAAM;KAClB,OAAOA,EAAM;KACb,MAAMZ,EAAYY,EAAM,WAAW;KACnC,SAAS;KACT,WAAWA,EAAM,aAAa;IAChC;IACA,SAAS;KACP,UAAUA,EAAM,YAAY;KAC5B,cAAcA,EAAM,gBAAgB;KACvB;IACf;GACF;GAEA,OADA,MAAMT,EAAoB,EAAE,aAAU,CAAC,GAChC,EAAE,OAAO,GAAG;EACrB;EACA,WAnDcC,KAAiBK;EAoD/B,OAnDYJ,KAAeK;CAoD7B;AACF"}
1
+ {"version":3,"file":"useCreateFolderShare.js","names":["toShareRole","accessLevel","useCreateFolderShare","shareFolderMutation","inviteLoading","inviteError","useMutation","ShareFolderDocument","createLinkMutation","linkLoading","linkError","CreateFolderShareLinkDocument","input","variables","result","extractShareToken"],"sources":["../../../src/files/hooks/useCreateFolderShare.ts"],"sourcesContent":["import { useMutation } from \"@apollo/client/react\";\n\nimport {\n CreateFolderShareLinkDocument,\n ShareFolderDocument,\n} from \"../../generated/wspace-operations\";\nimport type {\n FileShareAccessLevel,\n ShareRole,\n} from \"../../generated/wspace-types\";\nimport type {\n CreateFolderShareLinkMutationVariables,\n ShareFolderMutationVariables,\n} from \"../../generated/wspace-operations\";\nimport { extractShareToken, type ShareCreationResult } from \"./useCreateShare\";\n\nexport interface CreateFolderShareInput {\n folderId: string;\n shareType: \"PUBLIC_LINK\" | \"EMAIL_INVITE\" | \"GROUP_SHARE\";\n accessLevel: \"VIEW\" | \"COMMENT\" | \"DOWNLOAD\" | \"EDIT\";\n expiresAt?: string;\n password?: string;\n maxDownloads?: number;\n invitedEmail?: string;\n invitedUserIds?: string[];\n /** A note for an email invite, shown in the invitation (Workspace pages v2). */\n message?: string;\n}\n\n/** Generic ShareRole for the legacy access levels (DOWNLOAD has no dedicated role). */\nfunction toShareRole(\n accessLevel: CreateFolderShareInput[\"accessLevel\"],\n): ShareRole {\n switch (accessLevel) {\n case \"COMMENT\":\n return \"COMMENTER\" as ShareRole;\n case \"EDIT\":\n return \"EDITOR\" as ShareRole;\n default:\n return \"VIEWER\" as ShareRole;\n }\n}\n\n/**\n * Create a folder share through the consolidated ShareGrant stack (BOFF-5302).\n * Same cutover as useCreateShare: public links become PUBLIC_LINK grants,\n * email invites become PENDING grants + accept email.\n */\nexport const useCreateFolderShare = () => {\n const [shareFolderMutation, { loading: inviteLoading, error: inviteError }] =\n useMutation(ShareFolderDocument);\n const [createLinkMutation, { loading: linkLoading, error: linkError }] =\n useMutation(CreateFolderShareLinkDocument);\n\n const loading = inviteLoading || linkLoading;\n const error = inviteError ?? linkError;\n\n return {\n mutateAsync: async (\n input: CreateFolderShareInput,\n ): Promise<ShareCreationResult> => {\n const accessLevel = input.accessLevel.toUpperCase() as\n \"VIEW\" | \"COMMENT\" | \"DOWNLOAD\" | \"EDIT\";\n if (input.shareType === \"PUBLIC_LINK\") {\n const variables: CreateFolderShareLinkMutationVariables = {\n input: {\n resourceId: input.folderId,\n role: toShareRole(input.accessLevel),\n expiresAt: input.expiresAt ?? null,\n },\n options: {\n password: input.password ?? null,\n maxDownloads: input.maxDownloads ?? null,\n accessLevel: accessLevel as unknown as FileShareAccessLevel,\n },\n };\n const result = await createLinkMutation({ variables });\n return {\n token: extractShareToken(\n result.data?.createFolderShareLink.shareUrl ?? \"\",\n ),\n };\n }\n\n if (input.shareType !== \"EMAIL_INVITE\" || !input.invitedEmail) {\n throw new Error(\"Email invite shares require an invitedEmail\");\n }\n\n const variables: ShareFolderMutationVariables = {\n input: {\n resourceId: input.folderId,\n email: input.invitedEmail,\n role: toShareRole(input.accessLevel),\n message: input.message?.trim() || null,\n expiresAt: input.expiresAt ?? null,\n },\n options: {\n password: input.password ?? null,\n maxDownloads: input.maxDownloads ?? null,\n accessLevel: accessLevel as unknown as FileShareAccessLevel,\n },\n };\n await shareFolderMutation({ variables });\n return { token: \"\" };\n },\n isPending: loading,\n error,\n };\n};\n"],"mappings":";;;;AA8BA,SAASA,EACP,GACW;CACX,QAAQC,GAAR;EACE,KAAK,WACH,OAAO;EACT,KAAK,QACH,OAAO;EACT,SACE,OAAO;CACX;AACF;AAOA,IAAaC,UAA6B;CACxC,IAAM,CAACC,GAAqB,EAAE,SAASC,GAAe,OAAOC,OAC3DC,EAAYC,CAAmB,GAC3B,CAACC,GAAoB,EAAE,SAASC,GAAa,OAAOC,OACxDJ,EAAYK,CAA6B;CAK3C,OAAO;EACL,aAAa,OACX,MACiC;GACjC,IAAMV,IAAcW,EAAM,YAAY,YAAY;GAElD,IAAIA,EAAM,cAAc,eAAe;IACrC,IAAMC,IAAoD;KACxD,OAAO;MACL,YAAYD,EAAM;MAClB,MAAMZ,EAAYY,EAAM,WAAW;MACnC,WAAWA,EAAM,aAAa;KAChC;KACA,SAAS;MACP,UAAUA,EAAM,YAAY;MAC5B,cAAcA,EAAM,gBAAgB;MACvB;KACf;IACF,GACME,IAAS,MAAMN,EAAmB,EAAE,aAAU,CAAC;IACrD,OAAO,EACL,OAAOO,EACLD,EAAO,MAAM,sBAAsB,YAAY,EACjD,EACF;GACF;GAEA,IAAIF,EAAM,cAAc,kBAAkB,CAACA,EAAM,cAC/C,MAAU,MAAM,6CAA6C;GAG/D,IAAMC,IAA0C;IAC9C,OAAO;KACL,YAAYD,EAAM;KAClB,OAAOA,EAAM;KACb,MAAMZ,EAAYY,EAAM,WAAW;KACnC,SAASA,EAAM,SAAS,KAAK,KAAK;KAClC,WAAWA,EAAM,aAAa;IAChC;IACA,SAAS;KACP,UAAUA,EAAM,YAAY;KAC5B,cAAcA,EAAM,gBAAgB;KACvB;IACf;GACF;GAEA,OADA,MAAMT,EAAoB,EAAE,aAAU,CAAC,GAChC,EAAE,OAAO,GAAG;EACrB;EACA,WAnDcC,KAAiBK;EAoD/B,OAnDYJ,KAAeK;CAoD7B;AACF"}
@@ -7,6 +7,8 @@ export interface CreateShareInput {
7
7
  maxDownloads?: number;
8
8
  invitedEmail?: string;
9
9
  invitedUserIds?: string[];
10
+ /** A note for an email invite, shown in the invitation (Workspace pages v2). */
11
+ message?: string;
10
12
  }
11
13
  export interface ShareCreationResult {
12
14
  /** Raw share token (public links only) — drives the `/files/share/:token` URL. */
@@ -37,7 +37,7 @@ var a = () => {
37
37
  resourceId: e.fileId,
38
38
  email: e.invitedEmail,
39
39
  role: r(e.accessLevel),
40
- message: null,
40
+ message: e.message?.trim() || null,
41
41
  expiresAt: e.expiresAt ?? null
42
42
  },
43
43
  options: {
@@ -1 +1 @@
1
- {"version":3,"file":"useCreateShare.js","names":["toShareRole","accessLevel","extractShareToken","shareUrl","useCreateShare","shareFileMutation","inviteLoading","inviteError","useMutation","ShareFileDocument","createLinkMutation","linkLoading","linkError","CreateFileShareLinkDocument","input","variables"],"sources":["../../../src/files/hooks/useCreateShare.ts"],"sourcesContent":["import { useMutation } from \"@apollo/client/react\";\n\nimport {\n CreateFileShareLinkDocument,\n ShareFileDocument,\n} from \"../../generated/wspace-operations\";\nimport type {\n FileShareAccessLevel,\n ShareRole,\n} from \"../../generated/wspace-types\";\nimport type {\n CreateFileShareLinkMutationVariables,\n ShareFileMutationVariables,\n} from \"../../generated/wspace-operations\";\n\nexport interface CreateShareInput {\n fileId: string;\n shareType: \"PUBLIC_LINK\" | \"EMAIL_INVITE\" | \"GROUP_SHARE\";\n accessLevel: \"VIEW\" | \"COMMENT\" | \"DOWNLOAD\" | \"EDIT\";\n expiresAt?: string;\n password?: string;\n maxDownloads?: number;\n invitedEmail?: string;\n invitedUserIds?: string[];\n}\n\nexport interface ShareCreationResult {\n /** Raw share token (public links only) — drives the `/files/share/:token` URL. */\n token: string;\n}\n\n/** Generic ShareRole for the legacy access levels (DOWNLOAD has no dedicated role). */\nfunction toShareRole(accessLevel: CreateShareInput[\"accessLevel\"]): ShareRole {\n switch (accessLevel) {\n case \"COMMENT\":\n return \"COMMENTER\" as ShareRole;\n case \"EDIT\":\n return \"EDITOR\" as ShareRole;\n default:\n return \"VIEWER\" as ShareRole;\n }\n}\n\n/**\n * Extract the raw share token from a grant `shareUrl`\n * (`{origin}/share/accept/{token}`). Falls back to the trimmed whole string\n * when no path segment is present.\n */\nexport function extractShareToken(shareUrl: string): string {\n const match = shareUrl.match(/\\/share\\/accept\\/([^/?#]+)$/);\n return (match?.[1] ?? shareUrl).trim();\n}\n\n/**\n * Create a file share through the consolidated ShareGrant stack (BOFF-5302).\n * Public links become PUBLIC_LINK grants; email invites become PENDING\n * grants + a `resource-shared` accept email from the service. The legacy\n * access level is preserved on the grant so the token-access path keeps\n * issuing download URLs for DOWNLOAD shares.\n */\nexport const useCreateShare = () => {\n const [shareFileMutation, { loading: inviteLoading, error: inviteError }] =\n useMutation(ShareFileDocument);\n const [createLinkMutation, { loading: linkLoading, error: linkError }] =\n useMutation(CreateFileShareLinkDocument);\n\n const loading = inviteLoading || linkLoading;\n const error = inviteError ?? linkError;\n\n return {\n mutateAsync: async (\n input: CreateShareInput,\n ): Promise<ShareCreationResult> => {\n const accessLevel = input.accessLevel.toUpperCase() as\n \"VIEW\" | \"COMMENT\" | \"DOWNLOAD\" | \"EDIT\";\n if (input.shareType === \"PUBLIC_LINK\") {\n const variables: CreateFileShareLinkMutationVariables = {\n input: {\n resourceId: input.fileId,\n role: toShareRole(input.accessLevel),\n expiresAt: input.expiresAt ?? null,\n },\n options: {\n password: input.password ?? null,\n maxDownloads: input.maxDownloads ?? null,\n accessLevel: accessLevel as unknown as FileShareAccessLevel,\n },\n };\n const result = await createLinkMutation({ variables });\n return {\n token: extractShareToken(\n result.data?.createFileShareLink.shareUrl ?? \"\",\n ),\n };\n }\n\n if (input.shareType !== \"EMAIL_INVITE\" || !input.invitedEmail) {\n throw new Error(\"Email invite shares require an invitedEmail\");\n }\n\n const variables: ShareFileMutationVariables = {\n input: {\n resourceId: input.fileId,\n email: input.invitedEmail,\n role: toShareRole(input.accessLevel),\n message: null,\n expiresAt: input.expiresAt ?? null,\n },\n options: {\n password: input.password ?? null,\n maxDownloads: input.maxDownloads ?? null,\n accessLevel: accessLevel as unknown as FileShareAccessLevel,\n },\n };\n await shareFileMutation({ variables });\n // Invites are opened through the accept flow, not a public URL.\n return { token: \"\" };\n },\n isPending: loading,\n error,\n };\n};\n"],"mappings":";;;AAgCA,SAASA,EAAY,GAAyD;CAC5E,QAAQC,GAAR;EACE,KAAK,WACH,OAAO;EACT,KAAK,QACH,OAAO;EACT,SACE,OAAO;CACX;AACF;AAOA,SAAgBC,EAAkB,GAA0B;CAE1D,QADcC,EAAS,MAAM,6BACrB,CAAA,GAAQ,MAAMA,EAAA,CAAU,KAAK;AACvC;AASA,IAAaC,UAAuB;CAClC,IAAM,CAACC,GAAmB,EAAE,SAASC,GAAe,OAAOC,OACzDC,EAAYC,CAAiB,GACzB,CAACC,GAAoB,EAAE,SAASC,GAAa,OAAOC,OACxDJ,EAAYK,CAA2B;CAKzC,OAAO;EACL,aAAa,OACX,MACiC;GACjC,IAAMZ,IAAca,EAAM,YAAY,YAAY;GAElD,IAAIA,EAAM,cAAc,eAAe;IACrC,IAAMC,IAAkD;KACtD,OAAO;MACL,YAAYD,EAAM;MAClB,MAAMd,EAAYc,EAAM,WAAW;MACnC,WAAWA,EAAM,aAAa;KAChC;KACA,SAAS;MACP,UAAUA,EAAM,YAAY;MAC5B,cAAcA,EAAM,gBAAgB;MACvB;KACf;IACF;IAEA,OAAO,EACL,OAAOZ,GACL,MAHiBQ,EAAmB,EAAE,aAAU,CAAC,EAAA,CAG1C,MAAM,oBAAoB,YAAY,EAC/C,EACF;GACF;GAEA,IAAII,EAAM,cAAc,kBAAkB,CAACA,EAAM,cAC/C,MAAU,MAAM,6CAA6C;GAG/D,IAAMC,IAAwC;IAC5C,OAAO;KACL,YAAYD,EAAM;KAClB,OAAOA,EAAM;KACb,MAAMd,EAAYc,EAAM,WAAW;KACnC,SAAS;KACT,WAAWA,EAAM,aAAa;IAChC;IACA,SAAS;KACP,UAAUA,EAAM,YAAY;KAC5B,cAAcA,EAAM,gBAAgB;KACvB;IACf;GACF;GAGA,OAFA,MAAMT,EAAkB,EAAE,aAAU,CAAC,GAE9B,EAAE,OAAO,GAAG;EACrB;EACA,WApDcC,KAAiBK;EAqD/B,OApDYJ,KAAeK;CAqD7B;AACF"}
1
+ {"version":3,"file":"useCreateShare.js","names":["toShareRole","accessLevel","extractShareToken","shareUrl","useCreateShare","shareFileMutation","inviteLoading","inviteError","useMutation","ShareFileDocument","createLinkMutation","linkLoading","linkError","CreateFileShareLinkDocument","input","variables"],"sources":["../../../src/files/hooks/useCreateShare.ts"],"sourcesContent":["import { useMutation } from \"@apollo/client/react\";\n\nimport {\n CreateFileShareLinkDocument,\n ShareFileDocument,\n} from \"../../generated/wspace-operations\";\nimport type {\n FileShareAccessLevel,\n ShareRole,\n} from \"../../generated/wspace-types\";\nimport type {\n CreateFileShareLinkMutationVariables,\n ShareFileMutationVariables,\n} from \"../../generated/wspace-operations\";\n\nexport interface CreateShareInput {\n fileId: string;\n shareType: \"PUBLIC_LINK\" | \"EMAIL_INVITE\" | \"GROUP_SHARE\";\n accessLevel: \"VIEW\" | \"COMMENT\" | \"DOWNLOAD\" | \"EDIT\";\n expiresAt?: string;\n password?: string;\n maxDownloads?: number;\n invitedEmail?: string;\n invitedUserIds?: string[];\n /** A note for an email invite, shown in the invitation (Workspace pages v2). */\n message?: string;\n}\n\nexport interface ShareCreationResult {\n /** Raw share token (public links only) — drives the `/files/share/:token` URL. */\n token: string;\n}\n\n/** Generic ShareRole for the legacy access levels (DOWNLOAD has no dedicated role). */\nfunction toShareRole(accessLevel: CreateShareInput[\"accessLevel\"]): ShareRole {\n switch (accessLevel) {\n case \"COMMENT\":\n return \"COMMENTER\" as ShareRole;\n case \"EDIT\":\n return \"EDITOR\" as ShareRole;\n default:\n return \"VIEWER\" as ShareRole;\n }\n}\n\n/**\n * Extract the raw share token from a grant `shareUrl`\n * (`{origin}/share/accept/{token}`). Falls back to the trimmed whole string\n * when no path segment is present.\n */\nexport function extractShareToken(shareUrl: string): string {\n const match = shareUrl.match(/\\/share\\/accept\\/([^/?#]+)$/);\n return (match?.[1] ?? shareUrl).trim();\n}\n\n/**\n * Create a file share through the consolidated ShareGrant stack (BOFF-5302).\n * Public links become PUBLIC_LINK grants; email invites become PENDING\n * grants + a `resource-shared` accept email from the service. The legacy\n * access level is preserved on the grant so the token-access path keeps\n * issuing download URLs for DOWNLOAD shares.\n */\nexport const useCreateShare = () => {\n const [shareFileMutation, { loading: inviteLoading, error: inviteError }] =\n useMutation(ShareFileDocument);\n const [createLinkMutation, { loading: linkLoading, error: linkError }] =\n useMutation(CreateFileShareLinkDocument);\n\n const loading = inviteLoading || linkLoading;\n const error = inviteError ?? linkError;\n\n return {\n mutateAsync: async (\n input: CreateShareInput,\n ): Promise<ShareCreationResult> => {\n const accessLevel = input.accessLevel.toUpperCase() as\n \"VIEW\" | \"COMMENT\" | \"DOWNLOAD\" | \"EDIT\";\n if (input.shareType === \"PUBLIC_LINK\") {\n const variables: CreateFileShareLinkMutationVariables = {\n input: {\n resourceId: input.fileId,\n role: toShareRole(input.accessLevel),\n expiresAt: input.expiresAt ?? null,\n },\n options: {\n password: input.password ?? null,\n maxDownloads: input.maxDownloads ?? null,\n accessLevel: accessLevel as unknown as FileShareAccessLevel,\n },\n };\n const result = await createLinkMutation({ variables });\n return {\n token: extractShareToken(\n result.data?.createFileShareLink.shareUrl ?? \"\",\n ),\n };\n }\n\n if (input.shareType !== \"EMAIL_INVITE\" || !input.invitedEmail) {\n throw new Error(\"Email invite shares require an invitedEmail\");\n }\n\n const variables: ShareFileMutationVariables = {\n input: {\n resourceId: input.fileId,\n email: input.invitedEmail,\n role: toShareRole(input.accessLevel),\n message: input.message?.trim() || null,\n expiresAt: input.expiresAt ?? null,\n },\n options: {\n password: input.password ?? null,\n maxDownloads: input.maxDownloads ?? null,\n accessLevel: accessLevel as unknown as FileShareAccessLevel,\n },\n };\n await shareFileMutation({ variables });\n // Invites are opened through the accept flow, not a public URL.\n return { token: \"\" };\n },\n isPending: loading,\n error,\n };\n};\n"],"mappings":";;;AAkCA,SAASA,EAAY,GAAyD;CAC5E,QAAQC,GAAR;EACE,KAAK,WACH,OAAO;EACT,KAAK,QACH,OAAO;EACT,SACE,OAAO;CACX;AACF;AAOA,SAAgBC,EAAkB,GAA0B;CAE1D,QADcC,EAAS,MAAM,6BACrB,CAAA,GAAQ,MAAMA,EAAA,CAAU,KAAK;AACvC;AASA,IAAaC,UAAuB;CAClC,IAAM,CAACC,GAAmB,EAAE,SAASC,GAAe,OAAOC,OACzDC,EAAYC,CAAiB,GACzB,CAACC,GAAoB,EAAE,SAASC,GAAa,OAAOC,OACxDJ,EAAYK,CAA2B;CAKzC,OAAO;EACL,aAAa,OACX,MACiC;GACjC,IAAMZ,IAAca,EAAM,YAAY,YAAY;GAElD,IAAIA,EAAM,cAAc,eAAe;IACrC,IAAMC,IAAkD;KACtD,OAAO;MACL,YAAYD,EAAM;MAClB,MAAMd,EAAYc,EAAM,WAAW;MACnC,WAAWA,EAAM,aAAa;KAChC;KACA,SAAS;MACP,UAAUA,EAAM,YAAY;MAC5B,cAAcA,EAAM,gBAAgB;MACvB;KACf;IACF;IAEA,OAAO,EACL,OAAOZ,GACL,MAHiBQ,EAAmB,EAAE,aAAU,CAAC,EAAA,CAG1C,MAAM,oBAAoB,YAAY,EAC/C,EACF;GACF;GAEA,IAAII,EAAM,cAAc,kBAAkB,CAACA,EAAM,cAC/C,MAAU,MAAM,6CAA6C;GAG/D,IAAMC,IAAwC;IAC5C,OAAO;KACL,YAAYD,EAAM;KAClB,OAAOA,EAAM;KACb,MAAMd,EAAYc,EAAM,WAAW;KACnC,SAASA,EAAM,SAAS,KAAK,KAAK;KAClC,WAAWA,EAAM,aAAa;IAChC;IACA,SAAS;KACP,UAAUA,EAAM,YAAY;KAC5B,cAAcA,EAAM,gBAAgB;KACvB;IACf;GACF;GAGA,OAFA,MAAMT,EAAkB,EAAE,aAAU,CAAC,GAE9B,EAAE,OAAO,GAAG;EACrB;EACA,WApDcC,KAAiBK;EAqD/B,OApDYJ,KAAeK;CAqD7B;AACF"}