@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.
- package/dist/files/components/ActionMenu.d.ts +6 -0
- package/dist/files/components/ActionMenu.js +2 -1
- package/dist/files/components/ActionMenu.js.map +1 -1
- package/dist/files/components/ContextMenu.d.ts +6 -0
- package/dist/files/components/ContextMenu.js +2 -0
- package/dist/files/components/ContextMenu.js.map +1 -1
- package/dist/files/components/FileBrowser.d.ts +8 -2
- package/dist/files/components/FileBrowser.js +214 -180
- package/dist/files/components/FileBrowser.js.map +1 -1
- package/dist/files/components/FileCard.d.ts +5 -0
- package/dist/files/components/FileCard.js +98 -94
- package/dist/files/components/FileCard.js.map +1 -1
- package/dist/files/components/FileListItem.d.ts +5 -0
- package/dist/files/components/FileListItem.js +88 -87
- package/dist/files/components/FileListItem.js.map +1 -1
- package/dist/files/components/FilePreviewModal.d.ts +6 -1
- package/dist/files/components/FilePreviewModal.js +30 -29
- package/dist/files/components/FilePreviewModal.js.map +1 -1
- package/dist/files/components/FolderCard.d.ts +5 -0
- package/dist/files/components/FolderCard.js +108 -104
- package/dist/files/components/FolderCard.js.map +1 -1
- package/dist/files/components/ShareDialog.d.ts +12 -5
- package/dist/files/components/ShareDialog.js +348 -188
- package/dist/files/components/ShareDialog.js.map +1 -1
- package/dist/files/components/UploadQueue.js +1 -1
- package/dist/files/components/contextMenuItems.d.ts +32 -0
- package/dist/files/components/contextMenuItems.js +6 -2
- package/dist/files/components/contextMenuItems.js.map +1 -1
- package/dist/files/hooks/useShareDialogPermission.d.ts +45 -0
- package/dist/files/hooks/useShareDialogPermission.js +31 -0
- package/dist/files/hooks/useShareDialogPermission.js.map +1 -0
- package/dist/files/hooks/useSharePermissions.d.ts +26 -0
- package/dist/files/hooks/useSharePermissions.js +81 -0
- package/dist/files/hooks/useSharePermissions.js.map +1 -0
- package/dist/files/pages/BrowserPage.js +340 -336
- package/dist/files/pages/BrowserPage.js.map +1 -1
- package/dist/files/utils/sharePermission.d.ts +140 -0
- package/dist/files/utils/sharePermission.js +77 -0
- package/dist/files/utils/sharePermission.js.map +1 -0
- package/dist/generated/wspace-operations.d.ts +20 -0
- package/dist/generated/wspace-operations.js +141 -1
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/translations/en.d.ts +16 -0
- package/dist/translations/en.js +16 -0
- package/dist/translations/en.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,199 +1,359 @@
|
|
|
1
1
|
import { tWithFallback as e } from "../utils/i18n.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
2
|
+
import { useShareDialogPermission as t } from "../hooks/useShareDialogPermission.js";
|
|
3
|
+
import { classifyShareRefusal as n, shareDenialCopy as r, sharePermissionMessages as i } from "../utils/sharePermission.js";
|
|
4
|
+
import { useEffect as a, useState as o } from "react";
|
|
5
|
+
import { Calendar as s, Check as c, Copy as l, Download as u, Link as d, Loader2 as f, Lock as p, Mail as m, ShieldAlert as h } from "lucide-react";
|
|
6
|
+
import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
7
|
+
import { useI18n as y } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
8
|
+
import { Button as b, OptionalFields as x, ResponsiveDialog as S, ResponsiveDialogContent as C, ResponsiveDialogFooter as w, ResponsiveDialogHeader as T, ResponsiveDialogTitle as E } from "@burdenoff/fe-libs/ui";
|
|
7
9
|
// src/files/components/ShareDialog.tsx
|
|
8
|
-
function
|
|
9
|
-
let { t:
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}, [M]), /* @__PURE__ */ f(_, {
|
|
10
|
+
function D({ item: n, itemType: r, onClose: i, onCreateShare: a, isLoading: s, knownPermission: c }) {
|
|
11
|
+
let { t: l } = y(), [u, d] = o(null), { permission: f, denialCause: p, recordRefusal: m } = t({
|
|
12
|
+
item: n,
|
|
13
|
+
itemType: r,
|
|
14
|
+
knownPermission: c
|
|
15
|
+
}), h = e(l, r === "folder" ? "files.shareDialog.itemType.folder" : "files.shareDialog.itemType.file", r === "folder" ? "folder" : "file");
|
|
16
|
+
return /* @__PURE__ */ _(S, {
|
|
16
17
|
open: !0,
|
|
17
18
|
onOpenChange: (e) => {
|
|
18
|
-
e ||
|
|
19
|
+
e || i();
|
|
19
20
|
},
|
|
20
|
-
children: /* @__PURE__ */
|
|
21
|
-
itemType:
|
|
22
|
-
name:
|
|
23
|
-
}) }) }),
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
21
|
+
children: /* @__PURE__ */ v(C, { children: [/* @__PURE__ */ _(T, { children: /* @__PURE__ */ _(E, { children: e(l, "files.shareDialog.title", "Share {{itemType}} \"{{name}}\"", {
|
|
22
|
+
itemType: h,
|
|
23
|
+
name: n.name
|
|
24
|
+
}) }) }), /* @__PURE__ */ _(O, {
|
|
25
|
+
item: n,
|
|
26
|
+
itemType: r,
|
|
27
|
+
itemTypeLabel: h,
|
|
28
|
+
permission: f,
|
|
29
|
+
denialCause: p,
|
|
30
|
+
created: u,
|
|
31
|
+
isLoading: s,
|
|
32
|
+
onClose: i,
|
|
33
|
+
onCreateShare: a,
|
|
34
|
+
onCreated: d,
|
|
35
|
+
onRefused: m
|
|
36
|
+
})] })
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
function O({ item: e, itemType: t, itemTypeLabel: n, permission: r, denialCause: i, created: a, isLoading: o, onClose: s, onCreateShare: c, onCreated: l, onRefused: u }) {
|
|
40
|
+
return i === null ? r === "checking" ? /* @__PURE__ */ _(A, { onClose: s }) : a === null ? /* @__PURE__ */ _(P, {
|
|
41
|
+
item: e,
|
|
42
|
+
itemType: t,
|
|
43
|
+
isLoading: o,
|
|
44
|
+
onClose: s,
|
|
45
|
+
onCreateShare: c,
|
|
46
|
+
onCreated: l,
|
|
47
|
+
onRefused: u
|
|
48
|
+
}) : /* @__PURE__ */ _(V, {
|
|
49
|
+
created: a,
|
|
50
|
+
onClose: s
|
|
51
|
+
}) : /* @__PURE__ */ _(k, {
|
|
52
|
+
cause: i,
|
|
53
|
+
itemTypeLabel: n,
|
|
54
|
+
onClose: s
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
function k({ cause: t, itemTypeLabel: n, onClose: i }) {
|
|
58
|
+
let { t: a } = y(), o = r(a, t, n);
|
|
59
|
+
return /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ v("div", {
|
|
60
|
+
role: "alert",
|
|
61
|
+
className: "flex items-start gap-3 rounded-lg border border-status-warning-border bg-status-warning-bg-subtle px-4 py-3",
|
|
62
|
+
children: [/* @__PURE__ */ _(h, { className: "mt-0.5 size-5 flex-shrink-0 text-status-warning-text" }), /* @__PURE__ */ v("div", {
|
|
63
|
+
className: "space-y-1",
|
|
64
|
+
children: [/* @__PURE__ */ _("p", {
|
|
65
|
+
className: "text-sm font-medium text-text-primary",
|
|
66
|
+
children: o.title
|
|
67
|
+
}), /* @__PURE__ */ _("p", {
|
|
68
|
+
className: "text-sm text-text-secondary",
|
|
69
|
+
children: o.description
|
|
70
|
+
})]
|
|
71
|
+
})]
|
|
72
|
+
}), /* @__PURE__ */ _(w, { children: /* @__PURE__ */ _(b, {
|
|
73
|
+
type: "button",
|
|
74
|
+
onClick: i,
|
|
75
|
+
children: e(a, "files.common.actions.close", "Close")
|
|
76
|
+
}) })] });
|
|
77
|
+
}
|
|
78
|
+
function A({ onClose: t }) {
|
|
79
|
+
let { t: n } = y();
|
|
80
|
+
return /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ v("div", {
|
|
81
|
+
role: "status",
|
|
82
|
+
"aria-live": "polite",
|
|
83
|
+
className: "flex items-center gap-3 py-6 text-sm text-text-secondary",
|
|
84
|
+
children: [/* @__PURE__ */ _(f, { className: "size-4 animate-spin" }), i(n).checking]
|
|
85
|
+
}), /* @__PURE__ */ _(w, { children: /* @__PURE__ */ _(b, {
|
|
86
|
+
type: "button",
|
|
87
|
+
variant: "outline",
|
|
88
|
+
onClick: t,
|
|
89
|
+
children: e(n, "files.common.actions.cancel", "Cancel")
|
|
90
|
+
}) })] });
|
|
91
|
+
}
|
|
92
|
+
var j = 864e5;
|
|
93
|
+
function M(e, t, n) {
|
|
94
|
+
let r = n.expiryDays > 0 ? new Date(Date.now() + n.expiryDays * j).toISOString() : void 0;
|
|
95
|
+
return {
|
|
96
|
+
...t === "file" ? { fileId: e } : { folderId: e },
|
|
97
|
+
shareType: n.invitedEmail ? "EMAIL_INVITE" : "PUBLIC_LINK",
|
|
98
|
+
accessLevel: "DOWNLOAD",
|
|
99
|
+
expiresAt: r,
|
|
100
|
+
maxDownloads: n.maxDownloads > 0 ? n.maxDownloads : void 0,
|
|
101
|
+
password: n.hasPassword && n.password ? n.password : void 0,
|
|
102
|
+
invitedEmail: n.invitedEmail || void 0
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
function N(t, n) {
|
|
106
|
+
return n instanceof Error ? n.message : e(t, "files.shareDialog.errors.createFailed", "Failed to create share");
|
|
107
|
+
}
|
|
108
|
+
function P({ item: t, itemType: r, isLoading: i, onClose: a, onCreateShare: s, onCreated: c, onRefused: l }) {
|
|
109
|
+
let { t: u } = y(), [d, f] = o({
|
|
110
|
+
expiryDays: 7,
|
|
111
|
+
maxDownloads: 0,
|
|
112
|
+
hasPassword: !1,
|
|
113
|
+
password: "",
|
|
114
|
+
invitedEmail: ""
|
|
115
|
+
}), [p, m] = o(null), h = (e) => f((t) => ({
|
|
116
|
+
...t,
|
|
117
|
+
...e
|
|
118
|
+
}));
|
|
119
|
+
return /* @__PURE__ */ v(g, { children: [
|
|
120
|
+
p && /* @__PURE__ */ _("div", {
|
|
121
|
+
className: "mb-4 rounded-lg border border-status-error-border bg-status-error-bg-subtle px-3 py-2 text-sm text-status-error-text",
|
|
122
|
+
children: p
|
|
123
|
+
}),
|
|
124
|
+
/* @__PURE__ */ v("div", {
|
|
125
|
+
className: "space-y-4",
|
|
126
|
+
children: [
|
|
127
|
+
/* @__PURE__ */ _(L, {
|
|
128
|
+
value: d.expiryDays,
|
|
129
|
+
onChange: (e) => h({ expiryDays: e })
|
|
130
|
+
}),
|
|
131
|
+
/* @__PURE__ */ _(R, {
|
|
132
|
+
value: d.invitedEmail,
|
|
133
|
+
onChange: (e) => h({ invitedEmail: e })
|
|
134
|
+
}),
|
|
135
|
+
/* @__PURE__ */ _(z, {
|
|
136
|
+
values: d,
|
|
137
|
+
onChange: h
|
|
138
|
+
})
|
|
139
|
+
]
|
|
140
|
+
}),
|
|
141
|
+
/* @__PURE__ */ v(w, { children: [/* @__PURE__ */ _(b, {
|
|
142
|
+
type: "button",
|
|
143
|
+
variant: "outline",
|
|
144
|
+
onClick: a,
|
|
145
|
+
children: e(u, "files.common.actions.cancel", "Cancel")
|
|
146
|
+
}), /* @__PURE__ */ _(b, {
|
|
147
|
+
type: "button",
|
|
148
|
+
onClick: async () => {
|
|
149
|
+
m(null);
|
|
150
|
+
let e = M(t.id, r, d);
|
|
151
|
+
try {
|
|
152
|
+
let t = await s(e);
|
|
153
|
+
c({
|
|
154
|
+
shareType: e.shareType,
|
|
155
|
+
shareUrl: t.publicUrl || "",
|
|
156
|
+
invitedEmail: d.invitedEmail
|
|
157
|
+
});
|
|
158
|
+
} catch (e) {
|
|
159
|
+
let t = n(e);
|
|
160
|
+
if (t !== null) {
|
|
161
|
+
l(t);
|
|
162
|
+
return;
|
|
154
163
|
}
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
164
|
+
m(N(u, e));
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
disabled: i || d.hasPassword && !d.password,
|
|
168
|
+
children: /* @__PURE__ */ _(F, { isLoading: i })
|
|
169
|
+
})] })
|
|
170
|
+
] });
|
|
171
|
+
}
|
|
172
|
+
function F({ isLoading: t }) {
|
|
173
|
+
let { t: n } = y();
|
|
174
|
+
return t ? /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(f, { className: "size-4 animate-spin" }), e(n, "files.shareDialog.actions.creating", "Creating...")] }) : /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(d, { className: "size-4" }), e(n, "files.shareDialog.actions.createLink", "Create share link")] });
|
|
175
|
+
}
|
|
176
|
+
var I = [
|
|
177
|
+
{
|
|
178
|
+
days: 0,
|
|
179
|
+
key: "files.shareDialog.expiry.options.never",
|
|
180
|
+
fallback: "Never"
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
days: 1,
|
|
184
|
+
key: "files.shareDialog.expiry.options.oneDay",
|
|
185
|
+
fallback: "1 day"
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
days: 7,
|
|
189
|
+
key: "files.shareDialog.expiry.options.sevenDays",
|
|
190
|
+
fallback: "7 days"
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
days: 30,
|
|
194
|
+
key: "files.shareDialog.expiry.options.thirtyDays",
|
|
195
|
+
fallback: "30 days"
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
days: 90,
|
|
199
|
+
key: "files.shareDialog.expiry.options.ninetyDays",
|
|
200
|
+
fallback: "90 days"
|
|
201
|
+
}
|
|
202
|
+
];
|
|
203
|
+
function L({ value: t, onChange: n }) {
|
|
204
|
+
let { t: r } = y(), i = e(r, "files.shareDialog.expiry.label", "Link expires in");
|
|
205
|
+
return /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ v("label", {
|
|
206
|
+
htmlFor: "share-dialog-expiry-select",
|
|
207
|
+
className: "flex items-center gap-2 text-sm font-medium text-text-primary mb-2",
|
|
208
|
+
children: [/* @__PURE__ */ _(s, { className: "size-4" }), i]
|
|
209
|
+
}), /* @__PURE__ */ _("select", {
|
|
210
|
+
id: "share-dialog-expiry-select",
|
|
211
|
+
"aria-label": i,
|
|
212
|
+
value: t,
|
|
213
|
+
onChange: (e) => n(Number(e.target.value)),
|
|
214
|
+
className: "w-full min-h-11 px-3 py-2 border border-border-default rounded-lg bg-bg-surface text-text-primary scheme-normal dark:scheme-dark focus:outline-none focus:border-action-primary-border text-sm transition-colors duration-200 [&_option]:bg-bg-surface [&_option]:text-text-primary",
|
|
215
|
+
children: I.map((t) => /* @__PURE__ */ _("option", {
|
|
216
|
+
value: t.days,
|
|
217
|
+
children: e(r, t.key, t.fallback)
|
|
218
|
+
}, t.days))
|
|
219
|
+
})] });
|
|
220
|
+
}
|
|
221
|
+
function R({ value: t, onChange: n }) {
|
|
222
|
+
let { t: r } = y(), i = e(r, "files.shareDialog.invite.label", "Invite specific person (optional)");
|
|
223
|
+
return /* @__PURE__ */ v("div", { children: [
|
|
224
|
+
/* @__PURE__ */ v("label", {
|
|
225
|
+
htmlFor: "share-dialog-invite-email",
|
|
226
|
+
className: "flex items-center gap-2 text-sm font-medium text-text-primary mb-2",
|
|
227
|
+
children: [/* @__PURE__ */ _(m, { className: "size-4" }), i]
|
|
228
|
+
}),
|
|
229
|
+
/* @__PURE__ */ _("input", {
|
|
230
|
+
id: "share-dialog-invite-email",
|
|
231
|
+
type: "email",
|
|
232
|
+
value: t,
|
|
233
|
+
onChange: (e) => n(e.target.value),
|
|
234
|
+
"aria-label": i,
|
|
235
|
+
placeholder: "user@example.com",
|
|
236
|
+
className: "w-full min-h-11 px-3 py-2 border border-border-default rounded-lg focus:outline-none focus:border-action-primary-border text-sm transition-colors duration-200"
|
|
237
|
+
}),
|
|
238
|
+
/* @__PURE__ */ _("p", {
|
|
239
|
+
className: "mt-1 text-xs text-text-secondary",
|
|
240
|
+
children: e(r, "files.shareDialog.invite.help", "Leave empty for public link")
|
|
241
|
+
})
|
|
242
|
+
] });
|
|
243
|
+
}
|
|
244
|
+
function z({ values: t, onChange: n }) {
|
|
245
|
+
let { t: r } = y(), i = e(r, "files.shareDialog.downloads.label", "Maximum downloads");
|
|
246
|
+
return /* @__PURE__ */ _(x, {
|
|
247
|
+
title: e(r, "files.shareDialog.advanced.title", "Advanced"),
|
|
248
|
+
description: e(r, "files.shareDialog.advanced.description", "Download limits and password protection"),
|
|
249
|
+
children: /* @__PURE__ */ v("div", {
|
|
160
250
|
className: "space-y-4",
|
|
161
|
-
children: [/* @__PURE__ */
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
onClick: async () => {
|
|
183
|
-
O && (await navigator.clipboard.writeText(O), N(!0));
|
|
184
|
-
},
|
|
185
|
-
children: M ? /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f(i, { className: "size-4" }), e(D, "files.shareDialog.actions.copied", "Copied!")] }) : /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f(a, { className: "size-4" }), e(D, "files.common.actions.copy", "Copy")] })
|
|
186
|
-
})]
|
|
187
|
-
})] })
|
|
188
|
-
}), /* @__PURE__ */ f(y, { children: /* @__PURE__ */ f(h, {
|
|
189
|
-
type: "button",
|
|
190
|
-
onClick: w,
|
|
191
|
-
className: "w-full",
|
|
192
|
-
children: e(D, "files.common.actions.done", "Done")
|
|
193
|
-
}) })]
|
|
194
|
-
}) })] })
|
|
251
|
+
children: [/* @__PURE__ */ v("div", { children: [/* @__PURE__ */ v("label", {
|
|
252
|
+
htmlFor: "share-dialog-max-downloads",
|
|
253
|
+
className: "flex items-center gap-2 text-sm font-medium text-text-primary mb-2",
|
|
254
|
+
children: [/* @__PURE__ */ _(u, { className: "size-4" }), i]
|
|
255
|
+
}), /* @__PURE__ */ _("input", {
|
|
256
|
+
id: "share-dialog-max-downloads",
|
|
257
|
+
type: "number",
|
|
258
|
+
min: "0",
|
|
259
|
+
value: t.maxDownloads,
|
|
260
|
+
onChange: (e) => {
|
|
261
|
+
let { valueAsNumber: t } = e.target;
|
|
262
|
+
n({ maxDownloads: Number.isNaN(t) ? 0 : t });
|
|
263
|
+
},
|
|
264
|
+
"aria-label": i,
|
|
265
|
+
placeholder: e(r, "files.shareDialog.downloads.placeholder", "Unlimited"),
|
|
266
|
+
className: "w-full min-h-11 px-3 py-2 border border-border-default rounded-lg focus:outline-none focus:border-action-primary-border text-sm transition-colors duration-200"
|
|
267
|
+
})] }), /* @__PURE__ */ _(B, {
|
|
268
|
+
values: t,
|
|
269
|
+
onChange: n
|
|
270
|
+
})]
|
|
271
|
+
})
|
|
195
272
|
});
|
|
196
273
|
}
|
|
197
|
-
|
|
274
|
+
function B({ values: t, onChange: n }) {
|
|
275
|
+
let { t: r } = y(), i = e(r, "files.shareDialog.password.label", "Password protection"), a = e(r, "files.shareDialog.password.require", "Require password");
|
|
276
|
+
return /* @__PURE__ */ v("div", { children: [
|
|
277
|
+
/* @__PURE__ */ v("label", {
|
|
278
|
+
htmlFor: "share-dialog-password-required",
|
|
279
|
+
className: "flex items-center gap-2 text-sm font-medium text-text-primary mb-2",
|
|
280
|
+
children: [/* @__PURE__ */ _(p, { className: "size-4" }), i]
|
|
281
|
+
}),
|
|
282
|
+
/* @__PURE__ */ v("div", {
|
|
283
|
+
className: "flex items-center gap-2",
|
|
284
|
+
children: [/* @__PURE__ */ _("input", {
|
|
285
|
+
id: "share-dialog-password-required",
|
|
286
|
+
type: "checkbox",
|
|
287
|
+
checked: t.hasPassword,
|
|
288
|
+
onChange: (e) => n({ hasPassword: e.target.checked }),
|
|
289
|
+
"aria-label": a,
|
|
290
|
+
className: "rounded transition-colors duration-200"
|
|
291
|
+
}), /* @__PURE__ */ _("span", {
|
|
292
|
+
className: "text-sm text-text-secondary",
|
|
293
|
+
children: a
|
|
294
|
+
})]
|
|
295
|
+
}),
|
|
296
|
+
t.hasPassword && /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _("input", {
|
|
297
|
+
type: "password",
|
|
298
|
+
value: t.password,
|
|
299
|
+
onChange: (e) => n({ password: e.target.value }),
|
|
300
|
+
"aria-label": i,
|
|
301
|
+
placeholder: e(r, "files.shareDialog.password.placeholder", "Enter password"),
|
|
302
|
+
className: "w-full min-h-11 mt-2 px-3 py-2 border border-border-default rounded-lg focus:outline-none focus:border-action-primary-border text-sm transition-colors duration-200"
|
|
303
|
+
}), /* @__PURE__ */ _("p", {
|
|
304
|
+
className: "mt-1 text-xs text-text-tertiary",
|
|
305
|
+
children: e(r, "files.shareDialog.password.help", "Password must be at least 8 characters and contain uppercase, lowercase, and number")
|
|
306
|
+
})] })
|
|
307
|
+
] });
|
|
308
|
+
}
|
|
309
|
+
function V({ created: t, onClose: n }) {
|
|
310
|
+
let { t: r } = y();
|
|
311
|
+
return /* @__PURE__ */ v("div", {
|
|
312
|
+
className: "space-y-4",
|
|
313
|
+
children: [/* @__PURE__ */ _("div", {
|
|
314
|
+
className: "bg-status-success-bg-subtle border border-status-success-border rounded-lg p-4",
|
|
315
|
+
children: t.shareType === "EMAIL_INVITE" ? /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _("p", {
|
|
316
|
+
className: "text-sm font-medium text-status-success-text mb-2",
|
|
317
|
+
children: e(r, "files.shareDialog.success.invitationSent", "Invitation sent successfully!")
|
|
318
|
+
}), /* @__PURE__ */ _("p", {
|
|
319
|
+
className: "text-sm text-text-secondary",
|
|
320
|
+
children: e(r, "files.shareDialog.success.invitationSentTo", "An invitation has been sent to {{email}}", { email: t.invitedEmail })
|
|
321
|
+
})] }) : /* @__PURE__ */ _(H, { shareUrl: t.shareUrl })
|
|
322
|
+
}), /* @__PURE__ */ _(w, { children: /* @__PURE__ */ _(b, {
|
|
323
|
+
type: "button",
|
|
324
|
+
onClick: n,
|
|
325
|
+
className: "w-full",
|
|
326
|
+
children: e(r, "files.common.actions.done", "Done")
|
|
327
|
+
}) })]
|
|
328
|
+
});
|
|
329
|
+
}
|
|
330
|
+
function H({ shareUrl: t }) {
|
|
331
|
+
let { t: n } = y(), [r, i] = o(!1);
|
|
332
|
+
return a(() => {
|
|
333
|
+
if (r) {
|
|
334
|
+
let e = setTimeout(() => i(!1), 2e3);
|
|
335
|
+
return () => clearTimeout(e);
|
|
336
|
+
}
|
|
337
|
+
}, [r]), /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _("p", {
|
|
338
|
+
className: "text-sm font-medium text-status-success-text mb-2",
|
|
339
|
+
children: e(n, "files.shareDialog.success.linkCreated", "Share link created successfully!")
|
|
340
|
+
}), /* @__PURE__ */ v("div", {
|
|
341
|
+
className: "flex flex-col sm:flex-row items-stretch sm:items-center gap-2",
|
|
342
|
+
children: [/* @__PURE__ */ _("input", {
|
|
343
|
+
type: "text",
|
|
344
|
+
value: t,
|
|
345
|
+
readOnly: !0,
|
|
346
|
+
"aria-label": e(n, "files.shareDialog.success.linkCreated", "Share link"),
|
|
347
|
+
className: "flex-1 min-h-11 px-3 py-2 bg-bg-surface border border-status-success-border rounded-lg text-sm"
|
|
348
|
+
}), /* @__PURE__ */ _(b, {
|
|
349
|
+
type: "button",
|
|
350
|
+
onClick: async () => {
|
|
351
|
+
t && (await navigator.clipboard.writeText(t), i(!0));
|
|
352
|
+
},
|
|
353
|
+
children: r ? /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(c, { className: "size-4" }), e(n, "files.shareDialog.actions.copied", "Copied!")] }) : /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(l, { className: "size-4" }), e(n, "files.common.actions.copy", "Copy")] })
|
|
354
|
+
})]
|
|
355
|
+
})] });
|
|
356
|
+
}
|
|
357
|
+
export { D as ShareDialog };
|
|
198
358
|
|
|
199
359
|
//# sourceMappingURL=ShareDialog.js.map
|