@burdenoff/microfe-files 2026.1115.2 → 2026.1119.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/SearchBar.js +90 -90
- package/dist/files/components/SearchBar.js.map +1 -1
- package/dist/files/components/ShareDialog.js +29 -29
- package/dist/files/components/ShareDialog.js.map +1 -1
- package/dist/files/components/UploadVisibilitySelect.js +16 -15
- package/dist/files/components/UploadVisibilitySelect.js.map +1 -1
- package/dist/files/components/viewers/VideoPlayer.js +48 -47
- package/dist/files/components/viewers/VideoPlayer.js.map +1 -1
- package/package.json +2 -2
|
@@ -4,9 +4,9 @@ import { useCallback as i, useEffect as a, useEffectEvent as o, useState as s }
|
|
|
4
4
|
import { Filter as c, Search as l, X as u } from "lucide-react";
|
|
5
5
|
import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
6
6
|
import { useI18n as m } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
7
|
-
import { OptionalFields as h } from "@burdenoff/fe-libs/ui";
|
|
7
|
+
import { OptionalFields as h, ThemedSelect as g } from "@burdenoff/fe-libs/ui";
|
|
8
8
|
// src/files/components/SearchBar.tsx
|
|
9
|
-
var
|
|
9
|
+
var _ = {
|
|
10
10
|
image: [
|
|
11
11
|
"image/jpeg",
|
|
12
12
|
"image/png",
|
|
@@ -39,23 +39,23 @@ var g = {
|
|
|
39
39
|
"application/x-rar-compressed"
|
|
40
40
|
]
|
|
41
41
|
};
|
|
42
|
-
function
|
|
43
|
-
let { t:
|
|
42
|
+
function v({ onSearch: v, placeholder: y = "Search files and folders...", initialQuery: b = "", showFilters: x = !0, navigationV2: S = !1 }) {
|
|
43
|
+
let { t: C } = m(), [w, T] = s(b), [E, D] = s(!1), [O, k] = s({}), A = O.status, j = Object.values(n).find((e) => String(e) === O.status), M = O.visibility, N = O.fileType ? _[O.fileType] : void 0;
|
|
44
44
|
a(() => {
|
|
45
|
-
|
|
46
|
-
}, [
|
|
47
|
-
let
|
|
48
|
-
if (
|
|
45
|
+
T(b);
|
|
46
|
+
}, [b]);
|
|
47
|
+
let P = o(() => {
|
|
48
|
+
if (w.length >= 2 || w.length === 0) {
|
|
49
49
|
let e = {
|
|
50
|
-
...
|
|
51
|
-
...k && { status: k },
|
|
52
|
-
...j && { visibility: j },
|
|
53
|
-
...D.starred !== void 0 && { starred: D.starred }
|
|
54
|
-
}, t = {
|
|
50
|
+
...N && { mimeTypes: N },
|
|
55
51
|
...A && { status: A },
|
|
56
|
-
...
|
|
52
|
+
...M && { visibility: M },
|
|
53
|
+
...O.starred !== void 0 && { starred: O.starred }
|
|
54
|
+
}, t = {
|
|
55
|
+
...j && { status: j },
|
|
56
|
+
...O.starred !== void 0 && { starred: O.starred }
|
|
57
57
|
};
|
|
58
|
-
|
|
58
|
+
v(w, {
|
|
59
59
|
fileFilter: e,
|
|
60
60
|
folderFilter: t
|
|
61
61
|
});
|
|
@@ -63,82 +63,82 @@ function _({ onSearch: _, placeholder: v = "Search files and folders...", initia
|
|
|
63
63
|
});
|
|
64
64
|
a(() => {
|
|
65
65
|
let e = setTimeout(() => {
|
|
66
|
-
|
|
66
|
+
P();
|
|
67
67
|
}, 300);
|
|
68
68
|
return () => clearTimeout(e);
|
|
69
69
|
}, [
|
|
70
|
-
|
|
70
|
+
A,
|
|
71
|
+
N,
|
|
71
72
|
M,
|
|
72
73
|
j,
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
C
|
|
74
|
+
O,
|
|
75
|
+
w
|
|
76
76
|
]);
|
|
77
|
-
let
|
|
78
|
-
|
|
79
|
-
}, [
|
|
77
|
+
let F = i(() => {
|
|
78
|
+
T(""), k({}), v("");
|
|
79
|
+
}, [v]), I = Object.values(O).filter((e) => e !== void 0).length, L = /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("label", {
|
|
80
80
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
81
|
-
children: r(
|
|
82
|
-
}), /* @__PURE__ */ p(
|
|
83
|
-
value:
|
|
84
|
-
onChange: (t) =>
|
|
85
|
-
...
|
|
81
|
+
children: r(C, "files.search.filters.status.label", "Status")
|
|
82
|
+
}), /* @__PURE__ */ p(g, {
|
|
83
|
+
value: O.status || "",
|
|
84
|
+
onChange: (t) => k({
|
|
85
|
+
...O,
|
|
86
86
|
status: Object.values(e).find((e) => e === t.target.value)
|
|
87
87
|
}),
|
|
88
|
-
"aria-label": r(
|
|
88
|
+
"aria-label": r(C, "files.search.filters.status.label", "Status"),
|
|
89
89
|
className: "w-full 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:ring-2 focus:ring-action-primary-border transition-colors duration-200 [&_option]:bg-bg-surface [&_option]:text-text-primary",
|
|
90
90
|
children: [
|
|
91
91
|
/* @__PURE__ */ f("option", {
|
|
92
92
|
value: "",
|
|
93
|
-
children: r(
|
|
93
|
+
children: r(C, "files.search.filters.status.options.all", "All statuses")
|
|
94
94
|
}),
|
|
95
95
|
/* @__PURE__ */ f("option", {
|
|
96
96
|
value: "ACTIVE",
|
|
97
|
-
children: r(
|
|
97
|
+
children: r(C, "files.search.filters.status.options.active", "Active")
|
|
98
98
|
}),
|
|
99
99
|
/* @__PURE__ */ f("option", {
|
|
100
100
|
value: "ARCHIVED",
|
|
101
|
-
children: r(
|
|
101
|
+
children: r(C, "files.search.filters.status.options.archived", "Archived")
|
|
102
102
|
}),
|
|
103
103
|
/* @__PURE__ */ f("option", {
|
|
104
104
|
value: "DELETED",
|
|
105
|
-
children: r(
|
|
105
|
+
children: r(C, "files.search.filters.status.options.deleted", "Deleted")
|
|
106
106
|
})
|
|
107
107
|
]
|
|
108
|
-
})] }),
|
|
108
|
+
})] }), R = /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("label", {
|
|
109
109
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
110
|
-
children: r(
|
|
111
|
-
}), /* @__PURE__ */ p(
|
|
112
|
-
value:
|
|
113
|
-
onChange: (e) =>
|
|
114
|
-
...
|
|
110
|
+
children: r(C, "files.search.filters.visibility.label", "Visibility")
|
|
111
|
+
}), /* @__PURE__ */ p(g, {
|
|
112
|
+
value: O.visibility || "",
|
|
113
|
+
onChange: (e) => k({
|
|
114
|
+
...O,
|
|
115
115
|
visibility: Object.values(t).find((t) => t === e.target.value)
|
|
116
116
|
}),
|
|
117
|
-
"aria-label": r(
|
|
117
|
+
"aria-label": r(C, "files.search.filters.visibility.label", "Visibility"),
|
|
118
118
|
className: "w-full 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:ring-2 focus:ring-action-primary-border transition-colors duration-200 [&_option]:bg-bg-surface [&_option]:text-text-primary",
|
|
119
119
|
children: [
|
|
120
120
|
/* @__PURE__ */ f("option", {
|
|
121
121
|
value: "",
|
|
122
|
-
children: r(
|
|
122
|
+
children: r(C, "files.search.filters.visibility.options.all", "All visibility")
|
|
123
123
|
}),
|
|
124
124
|
/* @__PURE__ */ f("option", {
|
|
125
125
|
value: "PRIVATE",
|
|
126
|
-
children: r(
|
|
126
|
+
children: r(C, "files.search.filters.visibility.options.private", "Private")
|
|
127
127
|
}),
|
|
128
128
|
/* @__PURE__ */ f("option", {
|
|
129
129
|
value: "TEAM",
|
|
130
|
-
children: r(
|
|
130
|
+
children: r(C, "files.search.filters.visibility.options.team", "Team")
|
|
131
131
|
}),
|
|
132
132
|
/* @__PURE__ */ f("option", {
|
|
133
133
|
value: "WORKSPACE",
|
|
134
|
-
children: r(
|
|
134
|
+
children: r(C, "files.search.filters.visibility.options.workspace", "Workspace")
|
|
135
135
|
}),
|
|
136
136
|
/* @__PURE__ */ f("option", {
|
|
137
137
|
value: "PUBLIC",
|
|
138
|
-
children: r(
|
|
138
|
+
children: r(C, "files.search.filters.visibility.options.public", "Public")
|
|
139
139
|
})
|
|
140
140
|
]
|
|
141
|
-
})] }),
|
|
141
|
+
})] }), z = (O.status === void 0 ? 0 : 1) + (O.visibility === void 0 ? 0 : 1);
|
|
142
142
|
return /* @__PURE__ */ p("div", {
|
|
143
143
|
className: "relative",
|
|
144
144
|
children: [/* @__PURE__ */ p("div", {
|
|
@@ -148,42 +148,42 @@ function _({ onSearch: _, placeholder: v = "Search files and folders...", initia
|
|
|
148
148
|
/* @__PURE__ */ f("label", {
|
|
149
149
|
htmlFor: "files-search-input",
|
|
150
150
|
className: "sr-only",
|
|
151
|
-
children: r(
|
|
151
|
+
children: r(C, "files.search.input.label", "Search files and folders")
|
|
152
152
|
}),
|
|
153
153
|
/* @__PURE__ */ f("input", {
|
|
154
154
|
id: "files-search-input",
|
|
155
155
|
type: "text",
|
|
156
|
-
value:
|
|
157
|
-
onChange: (e) =>
|
|
158
|
-
placeholder:
|
|
159
|
-
"aria-label": r(
|
|
156
|
+
value: w,
|
|
157
|
+
onChange: (e) => T(e.target.value),
|
|
158
|
+
placeholder: y,
|
|
159
|
+
"aria-label": r(C, "files.search.input.label", "Search files and folders"),
|
|
160
160
|
className: "w-full pl-[3.25rem] pr-20 py-2 border border-border-default rounded-lg focus:outline-none focus:ring-2 focus:ring-action-primary-border focus:border-action-primary-border transition-colors duration-200"
|
|
161
161
|
}),
|
|
162
162
|
/* @__PURE__ */ p("div", {
|
|
163
163
|
className: "absolute right-2 flex items-center gap-1",
|
|
164
|
-
children: [
|
|
164
|
+
children: [w && /* @__PURE__ */ f("button", {
|
|
165
165
|
type: "button",
|
|
166
|
-
onClick:
|
|
166
|
+
onClick: F,
|
|
167
167
|
className: "p-1.5 text-text-tertiary hover:text-text-secondary hover:bg-action-ghost-bg-hover rounded transition-colors duration-200",
|
|
168
|
-
title: r(
|
|
169
|
-
"aria-label": r(
|
|
168
|
+
title: r(C, "files.search.actions.clearSearch", "Clear search"),
|
|
169
|
+
"aria-label": r(C, "files.search.actions.clearSearch", "Clear search"),
|
|
170
170
|
children: /* @__PURE__ */ f(u, { className: "size-4" })
|
|
171
|
-
}),
|
|
171
|
+
}), x && /* @__PURE__ */ p("button", {
|
|
172
172
|
type: "button",
|
|
173
|
-
onClick: () =>
|
|
174
|
-
"aria-expanded":
|
|
173
|
+
onClick: () => D(!E),
|
|
174
|
+
"aria-expanded": E,
|
|
175
175
|
"aria-controls": "files-search-filter-panel",
|
|
176
|
-
"aria-label": r(
|
|
177
|
-
className: `p-1.5 rounded transition-colors duration-200 relative ${
|
|
178
|
-
title: r(
|
|
179
|
-
children: [/* @__PURE__ */ f(c, { className: "size-4" }),
|
|
176
|
+
"aria-label": r(C, "files.search.filters.toggleAria", "Toggle filters"),
|
|
177
|
+
className: `p-1.5 rounded transition-colors duration-200 relative ${E || I > 0 ? "text-text-link bg-bg-accent hover:bg-action-primary-bg/20" : "text-text-tertiary hover:text-text-secondary hover:bg-action-ghost-bg-hover"}`,
|
|
178
|
+
title: r(C, "files.search.filters.title", "Filters"),
|
|
179
|
+
children: [/* @__PURE__ */ f(c, { className: "size-4" }), I > 0 && /* @__PURE__ */ f("span", {
|
|
180
180
|
className: "absolute -top-1 -right-1 size-4 bg-action-primary-bg text-text-inverse text-[10px] font-bold rounded-full flex items-center justify-center",
|
|
181
|
-
children:
|
|
181
|
+
children: I
|
|
182
182
|
})]
|
|
183
183
|
})]
|
|
184
184
|
})
|
|
185
185
|
]
|
|
186
|
-
}),
|
|
186
|
+
}), E && /* @__PURE__ */ f("div", {
|
|
187
187
|
id: "files-search-filter-panel",
|
|
188
188
|
className: "absolute top-full left-0 right-0 mt-2 p-4 bg-bg-surface border border-border-default rounded-lg shadow-lg z-10 animate-in fade-in duration-200",
|
|
189
189
|
children: /* @__PURE__ */ p("div", {
|
|
@@ -191,65 +191,65 @@ function _({ onSearch: _, placeholder: v = "Search files and folders...", initia
|
|
|
191
191
|
children: [
|
|
192
192
|
/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("label", {
|
|
193
193
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
194
|
-
children: r(
|
|
195
|
-
}), /* @__PURE__ */ p(
|
|
196
|
-
value:
|
|
197
|
-
onChange: (e) =>
|
|
198
|
-
...
|
|
194
|
+
children: r(C, "files.search.filters.fileType.label", "File Type")
|
|
195
|
+
}), /* @__PURE__ */ p(g, {
|
|
196
|
+
value: O.fileType || "",
|
|
197
|
+
onChange: (e) => k({
|
|
198
|
+
...O,
|
|
199
199
|
fileType: e.target.value || void 0
|
|
200
200
|
}),
|
|
201
|
-
"aria-label": r(
|
|
201
|
+
"aria-label": r(C, "files.search.filters.fileType.label", "File Type"),
|
|
202
202
|
className: "w-full 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:ring-2 focus:ring-action-primary-border transition-colors duration-200 [&_option]:bg-bg-surface [&_option]:text-text-primary",
|
|
203
203
|
children: [
|
|
204
204
|
/* @__PURE__ */ f("option", {
|
|
205
205
|
value: "",
|
|
206
|
-
children: r(
|
|
206
|
+
children: r(C, "files.search.filters.fileType.options.all", "All types")
|
|
207
207
|
}),
|
|
208
208
|
/* @__PURE__ */ f("option", {
|
|
209
209
|
value: "image",
|
|
210
|
-
children: r(
|
|
210
|
+
children: r(C, "files.search.filters.fileType.options.image", "Images")
|
|
211
211
|
}),
|
|
212
212
|
/* @__PURE__ */ f("option", {
|
|
213
213
|
value: "video",
|
|
214
|
-
children: r(
|
|
214
|
+
children: r(C, "files.search.filters.fileType.options.video", "Videos")
|
|
215
215
|
}),
|
|
216
216
|
/* @__PURE__ */ f("option", {
|
|
217
217
|
value: "document",
|
|
218
|
-
children: r(
|
|
218
|
+
children: r(C, "files.search.filters.fileType.options.document", "Documents")
|
|
219
219
|
}),
|
|
220
220
|
/* @__PURE__ */ f("option", {
|
|
221
221
|
value: "pdf",
|
|
222
|
-
children: r(
|
|
222
|
+
children: r(C, "files.search.filters.fileType.options.pdf", "PDFs")
|
|
223
223
|
}),
|
|
224
224
|
/* @__PURE__ */ f("option", {
|
|
225
225
|
value: "archive",
|
|
226
|
-
children: r(
|
|
226
|
+
children: r(C, "files.search.filters.fileType.options.archive", "Archives")
|
|
227
227
|
})
|
|
228
228
|
]
|
|
229
229
|
})] }),
|
|
230
|
-
|
|
230
|
+
S ? /* @__PURE__ */ p(h, {
|
|
231
231
|
storageKey: "files.searchFilters",
|
|
232
|
-
label:
|
|
233
|
-
children: [
|
|
232
|
+
label: z > 0 ? r(C, "files.search.filters.moreWithCount", "More filters ({{count}})", { count: z }) : r(C, "files.search.filters.more", "More filters"),
|
|
233
|
+
children: [L, R]
|
|
234
234
|
}) : /* @__PURE__ */ p(d, { children: [
|
|
235
|
-
I,
|
|
236
235
|
L,
|
|
236
|
+
R,
|
|
237
237
|
/* @__PURE__ */ p("div", {
|
|
238
238
|
className: "flex items-center",
|
|
239
239
|
children: [/* @__PURE__ */ f("input", {
|
|
240
240
|
type: "checkbox",
|
|
241
241
|
id: "starred-filter",
|
|
242
|
-
checked:
|
|
243
|
-
onChange: (e) =>
|
|
244
|
-
...
|
|
242
|
+
checked: O.starred || !1,
|
|
243
|
+
onChange: (e) => k({
|
|
244
|
+
...O,
|
|
245
245
|
starred: e.target.checked || void 0
|
|
246
246
|
}),
|
|
247
|
-
"aria-label": r(
|
|
247
|
+
"aria-label": r(C, "files.search.filters.starred.label", "Starred only"),
|
|
248
248
|
className: "size-4 text-action-primary-bg border-border-default rounded focus:ring-action-primary-border transition-colors duration-200"
|
|
249
249
|
}), /* @__PURE__ */ f("label", {
|
|
250
250
|
htmlFor: "starred-filter",
|
|
251
251
|
className: "ml-2 text-sm text-text-primary",
|
|
252
|
-
children: r(
|
|
252
|
+
children: r(C, "files.search.filters.starredOnly", "Starred only")
|
|
253
253
|
})]
|
|
254
254
|
})
|
|
255
255
|
] }),
|
|
@@ -258,15 +258,15 @@ function _({ onSearch: _, placeholder: v = "Search files and folders...", initia
|
|
|
258
258
|
children: [/* @__PURE__ */ f("button", {
|
|
259
259
|
type: "button",
|
|
260
260
|
onClick: () => {
|
|
261
|
-
|
|
261
|
+
k({}), D(!1);
|
|
262
262
|
},
|
|
263
263
|
className: "px-3 py-1.5 text-sm text-text-primary hover:bg-action-ghost-bg-hover rounded transition-colors duration-200",
|
|
264
|
-
children: r(
|
|
264
|
+
children: r(C, "files.search.filters.actions.clear", "Clear filters")
|
|
265
265
|
}), /* @__PURE__ */ f("button", {
|
|
266
266
|
type: "button",
|
|
267
|
-
onClick: () =>
|
|
267
|
+
onClick: () => D(!1),
|
|
268
268
|
className: "px-3 py-1.5 text-sm bg-action-primary-bg text-text-inverse rounded hover:bg-action-primary-bg-hover transition-colors duration-200",
|
|
269
|
-
children: r(
|
|
269
|
+
children: r(C, "files.search.filters.actions.apply", "Apply")
|
|
270
270
|
})]
|
|
271
271
|
})
|
|
272
272
|
]
|
|
@@ -274,6 +274,6 @@ function _({ onSearch: _, placeholder: v = "Search files and folders...", initia
|
|
|
274
274
|
})]
|
|
275
275
|
});
|
|
276
276
|
}
|
|
277
|
-
export {
|
|
277
|
+
export { v as SearchBar };
|
|
278
278
|
|
|
279
279
|
//# sourceMappingURL=SearchBar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchBar.js","names":["_Fragment","FILE_TYPE_MIME_MAP","SearchBar","useI18n","query","setQuery","useState","initialQuery","showFilterPanel","setShowFilterPanel","filters","setFilters","fileStatus","folderStatus","FolderStatus","value","fileVisibility","fileMimeTypes","runSearch","useEffectEvent","fileFilter","folderFilter","timer","handleClear","useCallback","onSearch","activeFilterCount","v","statusFilter","tWithFallback","t","FileStatus","e","visibilityFilter","FileVisibility","moreFilterCount","Search","X","showFilters","Filter","navigationV2","OptionalFields","Fragment"],"sources":["../../../src/files/components/SearchBar.tsx"],"sourcesContent":["import {\n FileStatus,\n FolderStatus,\n FileVisibility,\n} from \"../../generated/wspace-types\";\nimport { useState, useEffect, useEffectEvent, useCallback } from \"react\";\nimport { Search, X, Filter } from \"lucide-react\";\nimport { useI18n } from \"@burdenoff/fe-libs/shared/providers/shell/I18nProvider\";\nimport { OptionalFields } from \"@burdenoff/fe-libs/ui\";\nimport type { FileFilterInput, FolderFilterInput } from \"../graphql-types\";\nimport { tWithFallback } from \"../utils/i18n\";\n\ninterface SearchBarProps {\n onSearch: (\n query: string,\n filters?: {\n fileFilter?: FileFilterInput;\n folderFilter?: FolderFilterInput;\n },\n ) => void;\n placeholder?: string;\n initialQuery?: string;\n showFilters?: boolean;\n /**\n * Navigation v2 (BOFF-11865), FluidGrids only: File Type stays on the\n * panel, Status and Visibility fold into a remembered \"More filters\", and\n * \"Starred only\" is dropped (the Starred tab shows exactly that).\n */\n navigationV2?: boolean;\n}\n\nconst FILE_TYPE_MIME_MAP: Record<string, string[]> = {\n image: [\n \"image/jpeg\",\n \"image/png\",\n \"image/gif\",\n \"image/webp\",\n \"image/svg+xml\",\n ],\n video: [\"video/mp4\", \"video/webm\", \"video/quicktime\"],\n document: [\n \"application/msword\",\n \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\",\n \"application/vnd.ms-excel\",\n \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\",\n \"application/vnd.ms-powerpoint\",\n \"application/vnd.openxmlformats-officedocument.presentationml.presentation\",\n \"text/plain\",\n \"text/csv\",\n \"application/json\",\n ],\n pdf: [\"application/pdf\"],\n archive: [\n \"application/zip\",\n \"application/x-tar\",\n \"application/x-7z-compressed\",\n \"application/gzip\",\n \"application/x-rar-compressed\",\n ],\n};\n\nexport function SearchBar({\n onSearch,\n placeholder = \"Search files and folders...\",\n initialQuery = \"\",\n showFilters = true,\n navigationV2 = false,\n}: SearchBarProps) {\n const { t } = useI18n();\n const [query, setQuery] = useState(initialQuery);\n const [showFilterPanel, setShowFilterPanel] = useState(false);\n const [filters, setFilters] = useState<{\n fileType?: string;\n status?: FileStatus;\n visibility?: FileVisibility;\n starred?: boolean;\n }>({});\n const fileStatus = filters.status;\n const folderStatus = Object.values(FolderStatus).find(\n (value) => String(value) === filters.status,\n );\n const fileVisibility = filters.visibility;\n const fileMimeTypes = filters.fileType\n ? FILE_TYPE_MIME_MAP[filters.fileType]\n : undefined;\n\n useEffect(() => {\n setQuery(initialQuery);\n }, [initialQuery]);\n\n const runSearch = useEffectEvent(() => {\n if (query.length >= 2 || query.length === 0) {\n const fileFilter: FileFilterInput = {\n ...(fileMimeTypes && { mimeTypes: fileMimeTypes }),\n ...(fileStatus && { status: fileStatus }),\n ...(fileVisibility && { visibility: fileVisibility }),\n ...(filters.starred !== undefined && { starred: filters.starred }),\n };\n\n const folderFilter: FolderFilterInput = {\n ...(folderStatus && { status: folderStatus }),\n ...(filters.starred !== undefined && { starred: filters.starred }),\n };\n\n onSearch(query, { fileFilter, folderFilter });\n }\n });\n\n // Debounced search\n useEffect(() => {\n const timer = setTimeout(() => {\n runSearch();\n }, 300);\n\n return () => clearTimeout(timer);\n }, [fileStatus, fileMimeTypes, fileVisibility, folderStatus, filters, query]);\n\n const handleClear = useCallback(() => {\n setQuery(\"\");\n setFilters({});\n onSearch(\"\");\n }, [onSearch]);\n\n const activeFilterCount = Object.values(filters).filter(\n (v) => v !== undefined,\n ).length;\n\n // Status and Visibility, shared by both layouts of the filter panel.\n const statusFilter = (\n <div>\n <label className=\"block text-sm font-medium text-text-primary mb-1\">\n {tWithFallback(t, \"files.search.filters.status.label\", \"Status\")}\n </label>\n <select\n value={filters.status || \"\"}\n onChange={(e) =>\n setFilters({\n ...filters,\n status: Object.values(FileStatus).find(\n (value) => value === e.target.value,\n ),\n })\n }\n aria-label={tWithFallback(\n t,\n \"files.search.filters.status.label\",\n \"Status\",\n )}\n className=\"w-full 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:ring-2 focus:ring-action-primary-border transition-colors duration-200 [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"\">\n {tWithFallback(\n t,\n \"files.search.filters.status.options.all\",\n \"All statuses\",\n )}\n </option>\n <option value=\"ACTIVE\">\n {tWithFallback(\n t,\n \"files.search.filters.status.options.active\",\n \"Active\",\n )}\n </option>\n <option value=\"ARCHIVED\">\n {tWithFallback(\n t,\n \"files.search.filters.status.options.archived\",\n \"Archived\",\n )}\n </option>\n <option value=\"DELETED\">\n {tWithFallback(\n t,\n \"files.search.filters.status.options.deleted\",\n \"Deleted\",\n )}\n </option>\n </select>\n </div>\n );\n const visibilityFilter = (\n <div>\n <label className=\"block text-sm font-medium text-text-primary mb-1\">\n {tWithFallback(\n t,\n \"files.search.filters.visibility.label\",\n \"Visibility\",\n )}\n </label>\n <select\n value={filters.visibility || \"\"}\n onChange={(e) =>\n setFilters({\n ...filters,\n visibility: Object.values(FileVisibility).find(\n (value) => value === e.target.value,\n ),\n })\n }\n aria-label={tWithFallback(\n t,\n \"files.search.filters.visibility.label\",\n \"Visibility\",\n )}\n className=\"w-full 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:ring-2 focus:ring-action-primary-border transition-colors duration-200 [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"\">\n {tWithFallback(\n t,\n \"files.search.filters.visibility.options.all\",\n \"All visibility\",\n )}\n </option>\n <option value=\"PRIVATE\">\n {tWithFallback(\n t,\n \"files.search.filters.visibility.options.private\",\n \"Private\",\n )}\n </option>\n <option value=\"TEAM\">\n {tWithFallback(\n t,\n \"files.search.filters.visibility.options.team\",\n \"Team\",\n )}\n </option>\n <option value=\"WORKSPACE\">\n {tWithFallback(\n t,\n \"files.search.filters.visibility.options.workspace\",\n \"Workspace\",\n )}\n </option>\n <option value=\"PUBLIC\">\n {tWithFallback(\n t,\n \"files.search.filters.visibility.options.public\",\n \"Public\",\n )}\n </option>\n </select>\n </div>\n );\n const moreFilterCount =\n (filters.status !== undefined ? 1 : 0) +\n (filters.visibility !== undefined ? 1 : 0);\n\n return (\n <div className=\"relative\">\n {/* Search Input */}\n <div className=\"relative flex items-center\">\n <Search className=\"absolute left-3 size-4 text-text-tertiary\" />\n <label htmlFor=\"files-search-input\" className=\"sr-only\">\n {tWithFallback(\n t,\n \"files.search.input.label\",\n \"Search files and folders\",\n )}\n </label>\n <input\n id=\"files-search-input\"\n type=\"text\"\n value={query}\n onChange={(e) => setQuery(e.target.value)}\n placeholder={placeholder}\n aria-label={tWithFallback(\n t,\n \"files.search.input.label\",\n \"Search files and folders\",\n )}\n className=\"w-full pl-[3.25rem] pr-20 py-2 border border-border-default rounded-lg focus:outline-none focus:ring-2 focus:ring-action-primary-border focus:border-action-primary-border transition-colors duration-200\"\n />\n <div className=\"absolute right-2 flex items-center gap-1\">\n {query && (\n <button\n type=\"button\"\n onClick={handleClear}\n className=\"p-1.5 text-text-tertiary hover:text-text-secondary hover:bg-action-ghost-bg-hover rounded transition-colors duration-200\"\n title={tWithFallback(\n t,\n \"files.search.actions.clearSearch\",\n \"Clear search\",\n )}\n aria-label={tWithFallback(\n t,\n \"files.search.actions.clearSearch\",\n \"Clear search\",\n )}\n >\n <X className=\"size-4\" />\n </button>\n )}\n {showFilters && (\n <button\n type=\"button\"\n onClick={() => setShowFilterPanel(!showFilterPanel)}\n aria-expanded={showFilterPanel}\n aria-controls=\"files-search-filter-panel\"\n aria-label={tWithFallback(\n t,\n \"files.search.filters.toggleAria\",\n \"Toggle filters\",\n )}\n className={`p-1.5 rounded transition-colors duration-200 relative ${\n showFilterPanel || activeFilterCount > 0\n ? \"text-text-link bg-bg-accent hover:bg-action-primary-bg/20\"\n : \"text-text-tertiary hover:text-text-secondary hover:bg-action-ghost-bg-hover\"\n }`}\n title={tWithFallback(t, \"files.search.filters.title\", \"Filters\")}\n >\n <Filter className=\"size-4\" />\n {activeFilterCount > 0 && (\n <span className=\"absolute -top-1 -right-1 size-4 bg-action-primary-bg text-text-inverse text-[10px] font-bold rounded-full flex items-center justify-center\">\n {activeFilterCount}\n </span>\n )}\n </button>\n )}\n </div>\n </div>\n\n {/* Filter Panel */}\n {showFilterPanel && (\n <div\n id=\"files-search-filter-panel\"\n className=\"absolute top-full left-0 right-0 mt-2 p-4 bg-bg-surface border border-border-default rounded-lg shadow-lg z-10 animate-in fade-in duration-200\"\n >\n <div className=\"space-y-4\">\n <div>\n <label className=\"block text-sm font-medium text-text-primary mb-1\">\n {tWithFallback(\n t,\n \"files.search.filters.fileType.label\",\n \"File Type\",\n )}\n </label>\n <select\n value={filters.fileType || \"\"}\n onChange={(e) =>\n setFilters({\n ...filters,\n fileType: e.target.value || undefined,\n })\n }\n aria-label={tWithFallback(\n t,\n \"files.search.filters.fileType.label\",\n \"File Type\",\n )}\n className=\"w-full 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:ring-2 focus:ring-action-primary-border transition-colors duration-200 [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"\">\n {tWithFallback(\n t,\n \"files.search.filters.fileType.options.all\",\n \"All types\",\n )}\n </option>\n <option value=\"image\">\n {tWithFallback(\n t,\n \"files.search.filters.fileType.options.image\",\n \"Images\",\n )}\n </option>\n <option value=\"video\">\n {tWithFallback(\n t,\n \"files.search.filters.fileType.options.video\",\n \"Videos\",\n )}\n </option>\n <option value=\"document\">\n {tWithFallback(\n t,\n \"files.search.filters.fileType.options.document\",\n \"Documents\",\n )}\n </option>\n <option value=\"pdf\">\n {tWithFallback(\n t,\n \"files.search.filters.fileType.options.pdf\",\n \"PDFs\",\n )}\n </option>\n <option value=\"archive\">\n {tWithFallback(\n t,\n \"files.search.filters.fileType.options.archive\",\n \"Archives\",\n )}\n </option>\n </select>\n </div>\n\n {navigationV2 ? (\n <OptionalFields\n storageKey=\"files.searchFilters\"\n label={\n moreFilterCount > 0\n ? tWithFallback(\n t,\n \"files.search.filters.moreWithCount\",\n \"More filters ({{count}})\",\n { count: moreFilterCount },\n )\n : tWithFallback(\n t,\n \"files.search.filters.more\",\n \"More filters\",\n )\n }\n >\n {statusFilter}\n {visibilityFilter}\n </OptionalFields>\n ) : (\n <>\n {statusFilter}\n {visibilityFilter}\n <div className=\"flex items-center\">\n <input\n type=\"checkbox\"\n id=\"starred-filter\"\n checked={filters.starred || false}\n onChange={(e) =>\n setFilters({\n ...filters,\n starred: e.target.checked || undefined,\n })\n }\n aria-label={tWithFallback(\n t,\n \"files.search.filters.starred.label\",\n \"Starred only\",\n )}\n className=\"size-4 text-action-primary-bg border-border-default rounded focus:ring-action-primary-border transition-colors duration-200\"\n />\n <label\n htmlFor=\"starred-filter\"\n className=\"ml-2 text-sm text-text-primary\"\n >\n {tWithFallback(\n t,\n \"files.search.filters.starredOnly\",\n \"Starred only\",\n )}\n </label>\n </div>\n </>\n )}\n\n <div className=\"flex justify-end gap-2 pt-2 border-t border-border-default\">\n <button\n type=\"button\"\n onClick={() => {\n setFilters({});\n setShowFilterPanel(false);\n }}\n className=\"px-3 py-1.5 text-sm text-text-primary hover:bg-action-ghost-bg-hover rounded transition-colors duration-200\"\n >\n {tWithFallback(\n t,\n \"files.search.filters.actions.clear\",\n \"Clear filters\",\n )}\n </button>\n <button\n type=\"button\"\n onClick={() => setShowFilterPanel(false)}\n className=\"px-3 py-1.5 text-sm bg-action-primary-bg text-text-inverse rounded hover:bg-action-primary-bg-hover transition-colors duration-200\"\n >\n {tWithFallback(\n t,\n \"files.search.filters.actions.apply\",\n \"Apply\",\n )}\n </button>\n </div>\n </div>\n </div>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;AA+BA,IAAMC,IAA+C;CACnD,OAAO;EACL;EACA;EACA;EACA;EACA;CACF;CACA,OAAO;EAAC;EAAa;EAAc;CAAiB;CACpD,UAAU;EACR;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,KAAK,CAAC,iBAAiB;CACvB,SAAS;EACP;EACA;EACA;EACA;EACA;CACF;AACF;AAEA,SAAgBC,EAAU,EACxB,aACA,iBAAc,+BACd,kBAAe,IACf,iBAAc,IACd,kBAAe,MACE;CACjB,IAAM,EAAE,SAAMC,EAAQ,GAChB,CAACC,GAAOC,KAAYC,EAASC,CAAY,GACzC,CAACC,GAAiB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QACE,MAAK;QACL,IAAG;QACH,SAASvB,EAAQ,WAAW;QAC5B,WAAW,MACTC,EAAW;SACT,GAAGD;SACH,SAAS,EAAE,OAAO,WAAW,KAAA;QAC/B,CAAC;QAEH,cAAYmB,EACVC,GACA,sCACA,cACF;QACA,WAAU;OACX,CAAA,GACD,kBAAC,SAAD;QACE,SAAQ;QACR,WAAU;QAET,UAAAD,EACCC,GACA,oCACA,cACF;OACK,CAAA,CACJ;;KACL,EAAA,CAAA;KAGJ,kBAAC,OAAD;MAAK,WAAU;MAAf,UAAA,CACE,kBAAC,UAAD;OACE,MAAK;OACL,eAAe;QAEb,AADAnB,EAAW,CAAC,CAAC,GACbF,EAAmB,EAAK;OAC1B;OACA,WAAU;OAET,UAAAoB,EACCC,GACA,sCACA,eACF;MACM,CAAA,GACR,kBAAC,UAAD;OACE,MAAK;OACL,eAAerB,EAAmB,EAAK;OACvC,WAAU;OAET,UAAAoB,EACCC,GACA,sCACA,OACF;MACM,CAAA,CACL;;IACF;;EACF,CAAA,CAEJ;;AAET"}
|
|
1
|
+
{"version":3,"file":"SearchBar.js","names":["_Fragment","FILE_TYPE_MIME_MAP","SearchBar","useI18n","query","setQuery","useState","initialQuery","showFilterPanel","setShowFilterPanel","filters","setFilters","fileStatus","folderStatus","FolderStatus","value","fileVisibility","fileMimeTypes","runSearch","useEffectEvent","fileFilter","folderFilter","timer","handleClear","useCallback","onSearch","activeFilterCount","v","statusFilter","tWithFallback","t","ThemedSelect","FileStatus","e","visibilityFilter","FileVisibility","moreFilterCount","Search","X","showFilters","Filter","navigationV2","OptionalFields","Fragment"],"sources":["../../../src/files/components/SearchBar.tsx"],"sourcesContent":["import {\n FileStatus,\n FolderStatus,\n FileVisibility,\n} from \"../../generated/wspace-types\";\nimport { useState, useEffect, useEffectEvent, useCallback } from \"react\";\nimport { Search, X, Filter } from \"lucide-react\";\nimport { useI18n } from \"@burdenoff/fe-libs/shared/providers/shell/I18nProvider\";\nimport { OptionalFields, ThemedSelect } from \"@burdenoff/fe-libs/ui\";\nimport type { FileFilterInput, FolderFilterInput } from \"../graphql-types\";\nimport { tWithFallback } from \"../utils/i18n\";\n\ninterface SearchBarProps {\n onSearch: (\n query: string,\n filters?: {\n fileFilter?: FileFilterInput;\n folderFilter?: FolderFilterInput;\n },\n ) => void;\n placeholder?: string;\n initialQuery?: string;\n showFilters?: boolean;\n /**\n * Navigation v2 (BOFF-11865), FluidGrids only: File Type stays on the\n * panel, Status and Visibility fold into a remembered \"More filters\", and\n * \"Starred only\" is dropped (the Starred tab shows exactly that).\n */\n navigationV2?: boolean;\n}\n\nconst FILE_TYPE_MIME_MAP: Record<string, string[]> = {\n image: [\n \"image/jpeg\",\n \"image/png\",\n \"image/gif\",\n \"image/webp\",\n \"image/svg+xml\",\n ],\n video: [\"video/mp4\", \"video/webm\", \"video/quicktime\"],\n document: [\n \"application/msword\",\n \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\",\n \"application/vnd.ms-excel\",\n \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\",\n \"application/vnd.ms-powerpoint\",\n \"application/vnd.openxmlformats-officedocument.presentationml.presentation\",\n \"text/plain\",\n \"text/csv\",\n \"application/json\",\n ],\n pdf: [\"application/pdf\"],\n archive: [\n \"application/zip\",\n \"application/x-tar\",\n \"application/x-7z-compressed\",\n \"application/gzip\",\n \"application/x-rar-compressed\",\n ],\n};\n\nexport function SearchBar({\n onSearch,\n placeholder = \"Search files and folders...\",\n initialQuery = \"\",\n showFilters = true,\n navigationV2 = false,\n}: SearchBarProps) {\n const { t } = useI18n();\n const [query, setQuery] = useState(initialQuery);\n const [showFilterPanel, setShowFilterPanel] = useState(false);\n const [filters, setFilters] = useState<{\n fileType?: string;\n status?: FileStatus;\n visibility?: FileVisibility;\n starred?: boolean;\n }>({});\n const fileStatus = filters.status;\n const folderStatus = Object.values(FolderStatus).find(\n (value) => String(value) === filters.status,\n );\n const fileVisibility = filters.visibility;\n const fileMimeTypes = filters.fileType\n ? FILE_TYPE_MIME_MAP[filters.fileType]\n : undefined;\n\n useEffect(() => {\n setQuery(initialQuery);\n }, [initialQuery]);\n\n const runSearch = useEffectEvent(() => {\n if (query.length >= 2 || query.length === 0) {\n const fileFilter: FileFilterInput = {\n ...(fileMimeTypes && { mimeTypes: fileMimeTypes }),\n ...(fileStatus && { status: fileStatus }),\n ...(fileVisibility && { visibility: fileVisibility }),\n ...(filters.starred !== undefined && { starred: filters.starred }),\n };\n\n const folderFilter: FolderFilterInput = {\n ...(folderStatus && { status: folderStatus }),\n ...(filters.starred !== undefined && { starred: filters.starred }),\n };\n\n onSearch(query, { fileFilter, folderFilter });\n }\n });\n\n // Debounced search\n useEffect(() => {\n const timer = setTimeout(() => {\n runSearch();\n }, 300);\n\n return () => clearTimeout(timer);\n }, [fileStatus, fileMimeTypes, fileVisibility, folderStatus, filters, query]);\n\n const handleClear = useCallback(() => {\n setQuery(\"\");\n setFilters({});\n onSearch(\"\");\n }, [onSearch]);\n\n const activeFilterCount = Object.values(filters).filter(\n (v) => v !== undefined,\n ).length;\n\n // Status and Visibility, shared by both layouts of the filter panel.\n const statusFilter = (\n <div>\n <label className=\"block text-sm font-medium text-text-primary mb-1\">\n {tWithFallback(t, \"files.search.filters.status.label\", \"Status\")}\n </label>\n <ThemedSelect\n value={filters.status || \"\"}\n onChange={(e) =>\n setFilters({\n ...filters,\n status: Object.values(FileStatus).find(\n (value) => value === e.target.value,\n ),\n })\n }\n aria-label={tWithFallback(\n t,\n \"files.search.filters.status.label\",\n \"Status\",\n )}\n className=\"w-full 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:ring-2 focus:ring-action-primary-border transition-colors duration-200 [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"\">\n {tWithFallback(\n t,\n \"files.search.filters.status.options.all\",\n \"All statuses\",\n )}\n </option>\n <option value=\"ACTIVE\">\n {tWithFallback(\n t,\n \"files.search.filters.status.options.active\",\n \"Active\",\n )}\n </option>\n <option value=\"ARCHIVED\">\n {tWithFallback(\n t,\n \"files.search.filters.status.options.archived\",\n \"Archived\",\n )}\n </option>\n <option value=\"DELETED\">\n {tWithFallback(\n t,\n \"files.search.filters.status.options.deleted\",\n \"Deleted\",\n )}\n </option>\n </ThemedSelect>\n </div>\n );\n const visibilityFilter = (\n <div>\n <label className=\"block text-sm font-medium text-text-primary mb-1\">\n {tWithFallback(\n t,\n \"files.search.filters.visibility.label\",\n \"Visibility\",\n )}\n </label>\n <ThemedSelect\n value={filters.visibility || \"\"}\n onChange={(e) =>\n setFilters({\n ...filters,\n visibility: Object.values(FileVisibility).find(\n (value) => value === e.target.value,\n ),\n })\n }\n aria-label={tWithFallback(\n t,\n \"files.search.filters.visibility.label\",\n \"Visibility\",\n )}\n className=\"w-full 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:ring-2 focus:ring-action-primary-border transition-colors duration-200 [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"\">\n {tWithFallback(\n t,\n \"files.search.filters.visibility.options.all\",\n \"All visibility\",\n )}\n </option>\n <option value=\"PRIVATE\">\n {tWithFallback(\n t,\n \"files.search.filters.visibility.options.private\",\n \"Private\",\n )}\n </option>\n <option value=\"TEAM\">\n {tWithFallback(\n t,\n \"files.search.filters.visibility.options.team\",\n \"Team\",\n )}\n </option>\n <option value=\"WORKSPACE\">\n {tWithFallback(\n t,\n \"files.search.filters.visibility.options.workspace\",\n \"Workspace\",\n )}\n </option>\n <option value=\"PUBLIC\">\n {tWithFallback(\n t,\n \"files.search.filters.visibility.options.public\",\n \"Public\",\n )}\n </option>\n </ThemedSelect>\n </div>\n );\n const moreFilterCount =\n (filters.status !== undefined ? 1 : 0) +\n (filters.visibility !== undefined ? 1 : 0);\n\n return (\n <div className=\"relative\">\n {/* Search Input */}\n <div className=\"relative flex items-center\">\n <Search className=\"absolute left-3 size-4 text-text-tertiary\" />\n <label htmlFor=\"files-search-input\" className=\"sr-only\">\n {tWithFallback(\n t,\n \"files.search.input.label\",\n \"Search files and folders\",\n )}\n </label>\n <input\n id=\"files-search-input\"\n type=\"text\"\n value={query}\n onChange={(e) => setQuery(e.target.value)}\n placeholder={placeholder}\n aria-label={tWithFallback(\n t,\n \"files.search.input.label\",\n \"Search files and folders\",\n )}\n className=\"w-full pl-[3.25rem] pr-20 py-2 border border-border-default rounded-lg focus:outline-none focus:ring-2 focus:ring-action-primary-border focus:border-action-primary-border transition-colors duration-200\"\n />\n <div className=\"absolute right-2 flex items-center gap-1\">\n {query && (\n <button\n type=\"button\"\n onClick={handleClear}\n className=\"p-1.5 text-text-tertiary hover:text-text-secondary hover:bg-action-ghost-bg-hover rounded transition-colors duration-200\"\n title={tWithFallback(\n t,\n \"files.search.actions.clearSearch\",\n \"Clear search\",\n )}\n aria-label={tWithFallback(\n t,\n \"files.search.actions.clearSearch\",\n \"Clear search\",\n )}\n >\n <X className=\"size-4\" />\n </button>\n )}\n {showFilters && (\n <button\n type=\"button\"\n onClick={() => setShowFilterPanel(!showFilterPanel)}\n aria-expanded={showFilterPanel}\n aria-controls=\"files-search-filter-panel\"\n aria-label={tWithFallback(\n t,\n \"files.search.filters.toggleAria\",\n \"Toggle filters\",\n )}\n className={`p-1.5 rounded transition-colors duration-200 relative ${\n showFilterPanel || activeFilterCount > 0\n ? \"text-text-link bg-bg-accent hover:bg-action-primary-bg/20\"\n : \"text-text-tertiary hover:text-text-secondary hover:bg-action-ghost-bg-hover\"\n }`}\n title={tWithFallback(t, \"files.search.filters.title\", \"Filters\")}\n >\n <Filter className=\"size-4\" />\n {activeFilterCount > 0 && (\n <span className=\"absolute -top-1 -right-1 size-4 bg-action-primary-bg text-text-inverse text-[10px] font-bold rounded-full flex items-center justify-center\">\n {activeFilterCount}\n </span>\n )}\n </button>\n )}\n </div>\n </div>\n\n {/* Filter Panel */}\n {showFilterPanel && (\n <div\n id=\"files-search-filter-panel\"\n className=\"absolute top-full left-0 right-0 mt-2 p-4 bg-bg-surface border border-border-default rounded-lg shadow-lg z-10 animate-in fade-in duration-200\"\n >\n <div className=\"space-y-4\">\n <div>\n <label className=\"block text-sm font-medium text-text-primary mb-1\">\n {tWithFallback(\n t,\n \"files.search.filters.fileType.label\",\n \"File Type\",\n )}\n </label>\n <ThemedSelect\n value={filters.fileType || \"\"}\n onChange={(e) =>\n setFilters({\n ...filters,\n fileType: e.target.value || undefined,\n })\n }\n aria-label={tWithFallback(\n t,\n \"files.search.filters.fileType.label\",\n \"File Type\",\n )}\n className=\"w-full 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:ring-2 focus:ring-action-primary-border transition-colors duration-200 [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"\">\n {tWithFallback(\n t,\n \"files.search.filters.fileType.options.all\",\n \"All types\",\n )}\n </option>\n <option value=\"image\">\n {tWithFallback(\n t,\n \"files.search.filters.fileType.options.image\",\n \"Images\",\n )}\n </option>\n <option value=\"video\">\n {tWithFallback(\n t,\n \"files.search.filters.fileType.options.video\",\n \"Videos\",\n )}\n </option>\n <option value=\"document\">\n {tWithFallback(\n t,\n \"files.search.filters.fileType.options.document\",\n \"Documents\",\n )}\n </option>\n <option value=\"pdf\">\n {tWithFallback(\n t,\n \"files.search.filters.fileType.options.pdf\",\n \"PDFs\",\n )}\n </option>\n <option value=\"archive\">\n {tWithFallback(\n t,\n \"files.search.filters.fileType.options.archive\",\n \"Archives\",\n )}\n </option>\n </ThemedSelect>\n </div>\n\n {navigationV2 ? (\n <OptionalFields\n storageKey=\"files.searchFilters\"\n label={\n moreFilterCount > 0\n ? tWithFallback(\n t,\n \"files.search.filters.moreWithCount\",\n \"More filters ({{count}})\",\n { count: moreFilterCount },\n )\n : tWithFallback(\n t,\n \"files.search.filters.more\",\n \"More filters\",\n )\n }\n >\n {statusFilter}\n {visibilityFilter}\n </OptionalFields>\n ) : (\n <>\n {statusFilter}\n {visibilityFilter}\n <div className=\"flex items-center\">\n <input\n type=\"checkbox\"\n id=\"starred-filter\"\n checked={filters.starred || false}\n onChange={(e) =>\n setFilters({\n ...filters,\n starred: e.target.checked || undefined,\n })\n }\n aria-label={tWithFallback(\n t,\n \"files.search.filters.starred.label\",\n \"Starred only\",\n )}\n className=\"size-4 text-action-primary-bg border-border-default rounded focus:ring-action-primary-border transition-colors duration-200\"\n />\n <label\n htmlFor=\"starred-filter\"\n className=\"ml-2 text-sm text-text-primary\"\n >\n {tWithFallback(\n t,\n \"files.search.filters.starredOnly\",\n \"Starred only\",\n )}\n </label>\n </div>\n </>\n )}\n\n <div className=\"flex justify-end gap-2 pt-2 border-t border-border-default\">\n <button\n type=\"button\"\n onClick={() => {\n setFilters({});\n setShowFilterPanel(false);\n }}\n className=\"px-3 py-1.5 text-sm text-text-primary hover:bg-action-ghost-bg-hover rounded transition-colors duration-200\"\n >\n {tWithFallback(\n t,\n \"files.search.filters.actions.clear\",\n \"Clear filters\",\n )}\n </button>\n <button\n type=\"button\"\n onClick={() => setShowFilterPanel(false)}\n className=\"px-3 py-1.5 text-sm bg-action-primary-bg text-text-inverse rounded hover:bg-action-primary-bg-hover transition-colors duration-200\"\n >\n {tWithFallback(\n t,\n \"files.search.filters.actions.apply\",\n \"Apply\",\n )}\n </button>\n </div>\n </div>\n </div>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;AA+BA,IAAMC,IAA+C;CACnD,OAAO;EACL;EACA;EACA;EACA;EACA;CACF;CACA,OAAO;EAAC;EAAa;EAAc;CAAiB;CACpD,UAAU;EACR;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,KAAK,CAAC,iBAAiB;CACvB,SAAS;EACP;EACA;EACA;EACA;EACA;CACF;AACF;AAEA,SAAgBC,EAAU,EACxB,aACA,iBAAc,+BACd,kBAAe,IACf,iBAAc,IACd,kBAAe,MACE;CACjB,IAAM,EAAE,SAAMC,EAAQ,GAChB,CAACC,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AD;OAAK,WAAU;OAAf,UAAA,CACE,kBAAC,SAAD;QACE,MAAK;QACL,IAAG;QACH,SAASxB,EAAQ,WAAW;QAC5B,WAAW,MACTC,EAAW;SACT,GAAGD;SACH,SAAS,EAAE,OAAO,WAAW,KAAA;QAC/B,CAAC;QAEH,cAAYmB,EACVC,GACA,sCACA,cACF;QACA,WAAU;OACX,CAAA,GACD,kBAAC,SAAD;QACE,SAAQ;QACR,WAAU;QAET,UAAAD,EACCC,GACA,oCACA,cACF;OACK,CAAA,CACJ;;KACL,EAAA,CAAA;KAGJ,kBAAC,OAAD;MAAK,WAAU;MAAf,UAAA,CACE,kBAAC,UAAD;OACE,MAAK;OACL,eAAe;QAEb,AADAnB,EAAW,CAAC,CAAC,GACbF,EAAmB,EAAK;OAC1B;OACA,WAAU;OAET,UAAAoB,EACCC,GACA,sCACA,eACF;MACM,CAAA,GACR,kBAAC,UAAD;OACE,MAAK;OACL,eAAerB,EAAmB,EAAK;OACvC,WAAU;OAET,UAAAoB,EACCC,GACA,sCACA,OACF;MACM,CAAA,CACL;;IACF;;EACF,CAAA,CAEJ;;AAET"}
|
|
@@ -6,9 +6,9 @@ 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
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 } from "@burdenoff/fe-libs/ui";
|
|
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";
|
|
10
10
|
// src/files/components/ShareDialog.tsx
|
|
11
|
-
function
|
|
11
|
+
function j({ item: t, itemType: n, onClose: i, onCreateShare: a, isLoading: o, knownPermission: s, navigationV2: l = !1 }) {
|
|
12
12
|
let { t: u } = x(), [d, f] = c(null), { permission: p, denialCause: m, recordRefusal: h } = r({
|
|
13
13
|
item: t,
|
|
14
14
|
itemType: n,
|
|
@@ -22,7 +22,7 @@ function A({ item: t, itemType: n, onClose: i, onCreateShare: a, isLoading: o, k
|
|
|
22
22
|
children: /* @__PURE__ */ b(T, { children: [/* @__PURE__ */ b(O, { children: [/* @__PURE__ */ y(k, { 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(
|
|
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, {
|
|
26
26
|
item: t,
|
|
27
27
|
itemType: n,
|
|
28
28
|
itemTypeLabel: g,
|
|
@@ -38,8 +38,8 @@ function A({ item: t, itemType: n, onClose: i, onCreateShare: a, isLoading: o, k
|
|
|
38
38
|
})] })
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
|
-
function
|
|
42
|
-
return i === null ? r === "checking" ? /* @__PURE__ */ y(
|
|
41
|
+
function M({ item: e, itemType: t, itemTypeLabel: n, permission: r, denialCause: i, created: a, isLoading: o, onClose: s, onCreateShare: c, onCreated: l, onRefused: u, navigationV2: d }) {
|
|
42
|
+
return i === null ? r === "checking" ? /* @__PURE__ */ y(P, { onClose: s }) : a === null ? /* @__PURE__ */ y(I, {
|
|
43
43
|
item: e,
|
|
44
44
|
itemType: t,
|
|
45
45
|
isLoading: o,
|
|
@@ -48,16 +48,16 @@ function j({ item: e, itemType: t, itemTypeLabel: n, permission: r, denialCause:
|
|
|
48
48
|
onCreated: l,
|
|
49
49
|
onRefused: u,
|
|
50
50
|
navigationV2: d
|
|
51
|
-
}) : /* @__PURE__ */ y(
|
|
51
|
+
}) : /* @__PURE__ */ y(U, {
|
|
52
52
|
created: a,
|
|
53
53
|
onClose: s
|
|
54
|
-
}) : /* @__PURE__ */ y(
|
|
54
|
+
}) : /* @__PURE__ */ y(N, {
|
|
55
55
|
cause: i,
|
|
56
56
|
itemTypeLabel: n,
|
|
57
57
|
onClose: s
|
|
58
58
|
});
|
|
59
59
|
}
|
|
60
|
-
function
|
|
60
|
+
function N({ cause: t, itemTypeLabel: n, onClose: r }) {
|
|
61
61
|
let { t: i } = x(), o = a(i, t, n);
|
|
62
62
|
return /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ b("div", {
|
|
63
63
|
role: "alert",
|
|
@@ -78,7 +78,7 @@ function M({ cause: t, itemTypeLabel: n, onClose: r }) {
|
|
|
78
78
|
children: e(i, "files.common.actions.close", "Close")
|
|
79
79
|
}) })] });
|
|
80
80
|
}
|
|
81
|
-
function
|
|
81
|
+
function P({ onClose: t }) {
|
|
82
82
|
let { t: n } = x();
|
|
83
83
|
return /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ b("div", {
|
|
84
84
|
role: "status",
|
|
@@ -92,10 +92,10 @@ function N({ onClose: t }) {
|
|
|
92
92
|
children: e(n, "files.common.actions.cancel", "Cancel")
|
|
93
93
|
}) })] });
|
|
94
94
|
}
|
|
95
|
-
function
|
|
95
|
+
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
|
-
function
|
|
98
|
+
function I({ item: r, itemType: a, isLoading: o, onClose: s, onCreateShare: l, onCreated: u, onRefused: d, navigationV2: f }) {
|
|
99
99
|
let { t: p } = x(), [m, h] = c(t), [g, _] = c(null), C = (e) => h((t) => ({
|
|
100
100
|
...t,
|
|
101
101
|
...e
|
|
@@ -108,15 +108,15 @@ function F({ item: r, itemType: a, isLoading: o, onClose: s, onCreateShare: l, o
|
|
|
108
108
|
/* @__PURE__ */ b("div", {
|
|
109
109
|
className: "space-y-4",
|
|
110
110
|
children: [
|
|
111
|
-
/* @__PURE__ */ y(
|
|
111
|
+
/* @__PURE__ */ y(z, {
|
|
112
112
|
value: m.expiryDays,
|
|
113
113
|
onChange: (e) => C({ expiryDays: e })
|
|
114
114
|
}),
|
|
115
|
-
/* @__PURE__ */ y(
|
|
115
|
+
/* @__PURE__ */ y(B, {
|
|
116
116
|
value: m.invitedEmail,
|
|
117
117
|
onChange: (e) => C({ invitedEmail: e })
|
|
118
118
|
}),
|
|
119
|
-
/* @__PURE__ */ y(
|
|
119
|
+
/* @__PURE__ */ y(V, {
|
|
120
120
|
values: m,
|
|
121
121
|
onChange: C,
|
|
122
122
|
navigationV2: f
|
|
@@ -146,19 +146,19 @@ function F({ item: r, itemType: a, isLoading: o, onClose: s, onCreateShare: l, o
|
|
|
146
146
|
d(t);
|
|
147
147
|
return;
|
|
148
148
|
}
|
|
149
|
-
_(
|
|
149
|
+
_(F(p, e));
|
|
150
150
|
}
|
|
151
151
|
},
|
|
152
152
|
disabled: o || m.hasPassword && !m.password,
|
|
153
|
-
children: /* @__PURE__ */ y(
|
|
153
|
+
children: /* @__PURE__ */ y(L, { isLoading: o })
|
|
154
154
|
})] })
|
|
155
155
|
] });
|
|
156
156
|
}
|
|
157
|
-
function
|
|
157
|
+
function L({ isLoading: t }) {
|
|
158
158
|
let { t: n } = x();
|
|
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
|
-
var
|
|
161
|
+
var R = [
|
|
162
162
|
{
|
|
163
163
|
days: 0,
|
|
164
164
|
key: "files.shareDialog.expiry.options.never",
|
|
@@ -185,25 +185,25 @@ var L = [
|
|
|
185
185
|
fallback: "90 days"
|
|
186
186
|
}
|
|
187
187
|
];
|
|
188
|
-
function
|
|
188
|
+
function z({ value: t, onChange: n }) {
|
|
189
189
|
let { t: r } = x(), 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(
|
|
194
|
+
}), /* @__PURE__ */ y(A, {
|
|
195
195
|
id: "share-dialog-expiry-select",
|
|
196
196
|
"aria-label": i,
|
|
197
197
|
value: t,
|
|
198
198
|
onChange: (e) => n(Number(e.target.value)),
|
|
199
199
|
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",
|
|
200
|
-
children:
|
|
200
|
+
children: R.map((t) => /* @__PURE__ */ y("option", {
|
|
201
201
|
value: t.days,
|
|
202
202
|
children: e(r, t.key, t.fallback)
|
|
203
203
|
}, t.days))
|
|
204
204
|
})] });
|
|
205
205
|
}
|
|
206
|
-
function
|
|
206
|
+
function B({ value: t, onChange: n }) {
|
|
207
207
|
let { t: r } = x(), i = e(r, "files.shareDialog.invite.label", "Invite specific person (optional)");
|
|
208
208
|
return /* @__PURE__ */ b("div", { children: [
|
|
209
209
|
/* @__PURE__ */ b("label", {
|
|
@@ -226,7 +226,7 @@ function z({ value: t, onChange: n }) {
|
|
|
226
226
|
})
|
|
227
227
|
] });
|
|
228
228
|
}
|
|
229
|
-
function
|
|
229
|
+
function V({ values: t, onChange: n, navigationV2: r }) {
|
|
230
230
|
let { t: i } = x(), a = e(i, "files.shareDialog.downloads.label", "Maximum downloads");
|
|
231
231
|
return /* @__PURE__ */ y(C, {
|
|
232
232
|
storageKey: r ? "files.shareDialog" : void 0,
|
|
@@ -250,14 +250,14 @@ function B({ values: t, onChange: n, navigationV2: r }) {
|
|
|
250
250
|
"aria-label": a,
|
|
251
251
|
placeholder: e(i, "files.shareDialog.downloads.placeholder", "Unlimited"),
|
|
252
252
|
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"
|
|
253
|
-
})] }), /* @__PURE__ */ y(
|
|
253
|
+
})] }), /* @__PURE__ */ y(H, {
|
|
254
254
|
values: t,
|
|
255
255
|
onChange: n
|
|
256
256
|
})]
|
|
257
257
|
})
|
|
258
258
|
});
|
|
259
259
|
}
|
|
260
|
-
function
|
|
260
|
+
function H({ values: t, onChange: n }) {
|
|
261
261
|
let { t: r } = x(), 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", {
|
|
@@ -292,7 +292,7 @@ function V({ values: t, onChange: n }) {
|
|
|
292
292
|
})] })
|
|
293
293
|
] });
|
|
294
294
|
}
|
|
295
|
-
function
|
|
295
|
+
function U({ created: t, onClose: n }) {
|
|
296
296
|
let { t: r } = x();
|
|
297
297
|
return /* @__PURE__ */ b("div", {
|
|
298
298
|
className: "space-y-4",
|
|
@@ -304,7 +304,7 @@ function H({ created: t, onClose: n }) {
|
|
|
304
304
|
}), /* @__PURE__ */ y("p", {
|
|
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
|
-
})] }) : /* @__PURE__ */ y(
|
|
307
|
+
})] }) : /* @__PURE__ */ y(W, { shareUrl: t.shareUrl })
|
|
308
308
|
}), /* @__PURE__ */ y(D, { children: /* @__PURE__ */ y(S, {
|
|
309
309
|
type: "button",
|
|
310
310
|
onClick: n,
|
|
@@ -313,7 +313,7 @@ function H({ created: t, onClose: n }) {
|
|
|
313
313
|
}) })]
|
|
314
314
|
});
|
|
315
315
|
}
|
|
316
|
-
function
|
|
316
|
+
function W({ shareUrl: t }) {
|
|
317
317
|
let { t: n } = x(), [r, i] = c(!1);
|
|
318
318
|
return s(() => {
|
|
319
319
|
if (r) {
|
|
@@ -340,6 +340,6 @@ function U({ shareUrl: t }) {
|
|
|
340
340
|
})]
|
|
341
341
|
})] });
|
|
342
342
|
}
|
|
343
|
-
export {
|
|
343
|
+
export { j as ShareDialog };
|
|
344
344
|
|
|
345
345
|
//# sourceMappingURL=ShareDialog.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ShareDialog.js","names":["_Fragment","ShareDialog","useI18n","created","setCreated","useState","useShareDialogPermission","itemTypeLabel","tWithFallback","t","itemType","ResponsiveDialog","next","onClose","ResponsiveDialogContent","ResponsiveDialogHeader","ResponsiveDialogTitle","item","navigationV2","ResponsiveDialogDescription","ShareDialogBody","recordRefusal","denialCause","permission","ShareCheckingPanel","ShareForm","ShareSuccessPanel","ShareDeniedPanel","copy","shareDenialCopy","cause","Fragment","ShieldAlert","ResponsiveDialogFooter","Button","Loader2","sharePermissionMessages","shareErrorMessage","error","values","setValues","DEFAULT_SHARE_FORM_VALUES","errorMessage","setErrorMessage","update","current","patch","ShareExpiryField","ShareInviteField","ShareAdvancedFields","shareInput","buildShareInput","result","onCreateShare","source","classifyShareRefusal","isLoading","ShareSubmitLabel","Link","EXPIRY_OPTIONS","label","Calendar","onChange","option","Mail","downloadsLabel","OptionalFields","Download","valueAsNumber","SharePasswordField","requireLabel","Lock","ShareLinkResult","copied","setCopied","useEffect","timer","shareUrl","Check","Copy"],"sources":["../../../src/files/components/ShareDialog.tsx"],"sourcesContent":["import { useEffect, useState } from \"react\";\nimport {\n Link,\n Mail,\n Calendar,\n Download,\n Lock,\n Copy,\n Check,\n Loader2,\n ShieldAlert,\n} from \"lucide-react\";\nimport {\n useI18n,\n type I18nContextValue,\n} from \"@burdenoff/fe-libs/shared/providers/shell/I18nProvider\";\nimport {\n ResponsiveDialog,\n ResponsiveDialogContent,\n ResponsiveDialogHeader,\n ResponsiveDialogTitle,\n ResponsiveDialogDescription,\n ResponsiveDialogFooter,\n OptionalFields,\n Button,\n} from \"@burdenoff/fe-libs/ui\";\nimport type { FileItem, FolderItem } from \"../types\";\nimport { tWithFallback } from \"../utils/i18n\";\nimport {\n DEFAULT_SHARE_FORM_VALUES,\n type ShareDialogInput,\n type ShareFormValues,\n buildShareInput,\n} from \"../utils/shareForm\";\n\nexport type { ShareDialogInput } from \"../utils/shareForm\";\nimport { useShareDialogPermission } from \"../hooks/useShareDialogPermission\";\nimport {\n classifyShareRefusal,\n shareDenialCopy,\n sharePermissionMessages,\n type ShareDenialCause,\n type ShareRefusalSource,\n} from \"../utils/sharePermission\";\n\ntype CreateShare = (\n input: ShareDialogInput,\n) => Promise<{ publicUrl: string; token: string }>;\n\ntype Translate = I18nContextValue[\"t\"];\n\ninterface ShareDialogProps {\n item: FileItem | FolderItem;\n itemType: \"file\" | \"folder\";\n onClose: () => void;\n onCreateShare: CreateShare;\n isLoading?: boolean;\n /**\n * A denial the caller recorded recently (within its TTL). The dialog shows\n * the denied state at once instead of a spinner, and still re-checks: if the\n * re-check allows sharing, the form replaces the denial.\n */\n knownPermission?: \"denied\";\n /**\n * Navigation v2 (BOFF-11865), FluidGrids only: state the reach of a link\n * under the title before it is created, and fold Maximum downloads and\n * Password protection into the shared, remembered \"More options\".\n */\n navigationV2?: boolean;\n}\n\n/** A share the dialog created, shown in the success panel. */\ninterface CreatedShare {\n shareType: ShareDialogInput[\"shareType\"];\n shareUrl: string;\n invitedEmail: string;\n}\n\nexport function ShareDialog({\n item,\n itemType,\n onClose,\n onCreateShare,\n isLoading,\n knownPermission,\n navigationV2 = false,\n}: ShareDialogProps) {\n const { t } = useI18n();\n const [created, setCreated] = useState<CreatedShare | null>(null);\n const { permission, denialCause, recordRefusal } = useShareDialogPermission({\n item,\n itemType,\n knownPermission,\n });\n const itemTypeLabel = tWithFallback(\n t,\n itemType === \"folder\"\n ? \"files.shareDialog.itemType.folder\"\n : \"files.shareDialog.itemType.file\",\n itemType === \"folder\" ? \"folder\" : \"file\",\n );\n\n return (\n <ResponsiveDialog\n open\n onOpenChange={(next: boolean) => {\n if (!next) onClose();\n }}\n >\n <ResponsiveDialogContent>\n <ResponsiveDialogHeader>\n <ResponsiveDialogTitle>\n {tWithFallback(\n t,\n \"files.shareDialog.title\",\n 'Share {{itemType}} \"{{name}}\"',\n { itemType: itemTypeLabel, name: item.name },\n )}\n </ResponsiveDialogTitle>\n {navigationV2 && created === null && (\n <ResponsiveDialogDescription>\n {tWithFallback(\n t,\n \"files.shareDialog.reach\",\n \"Anyone with the link can view and download until it expires.\",\n )}\n </ResponsiveDialogDescription>\n )}\n </ResponsiveDialogHeader>\n\n <ShareDialogBody\n item={item}\n itemType={itemType}\n itemTypeLabel={itemTypeLabel}\n permission={permission}\n denialCause={denialCause}\n created={created}\n isLoading={isLoading}\n onClose={onClose}\n onCreateShare={onCreateShare}\n onCreated={setCreated}\n onRefused={recordRefusal}\n navigationV2={navigationV2}\n />\n </ResponsiveDialogContent>\n </ResponsiveDialog>\n );\n}\n\ninterface ShareDialogBodyProps {\n item: FileItem | FolderItem;\n itemType: \"file\" | \"folder\";\n itemTypeLabel: string;\n permission: ReturnType<typeof useShareDialogPermission>[\"permission\"];\n denialCause: ShareDenialCause | null;\n created: CreatedShare | null;\n isLoading?: boolean;\n onClose: () => void;\n onCreateShare: CreateShare;\n onCreated: (created: CreatedShare) => void;\n onRefused: (source: ShareRefusalSource) => void;\n navigationV2: boolean;\n}\n\n/** Picks the dialog body: denial, permission check, share form or result. */\nfunction ShareDialogBody({\n item,\n itemType,\n itemTypeLabel,\n permission,\n denialCause,\n created,\n isLoading,\n onClose,\n onCreateShare,\n onCreated,\n onRefused,\n navigationV2,\n}: ShareDialogBodyProps) {\n if (denialCause !== null) {\n return (\n <ShareDeniedPanel\n cause={denialCause}\n itemTypeLabel={itemTypeLabel}\n onClose={onClose}\n />\n );\n }\n if (permission === \"checking\") {\n return <ShareCheckingPanel onClose={onClose} />;\n }\n if (created === null) {\n return (\n <ShareForm\n item={item}\n itemType={itemType}\n isLoading={isLoading}\n onClose={onClose}\n onCreateShare={onCreateShare}\n onCreated={onCreated}\n onRefused={onRefused}\n navigationV2={navigationV2}\n />\n );\n }\n return <ShareSuccessPanel created={created} onClose={onClose} />;\n}\n\nfunction ShareDeniedPanel({\n cause,\n itemTypeLabel,\n onClose,\n}: {\n cause: ShareDenialCause;\n itemTypeLabel: string;\n onClose: () => void;\n}) {\n const { t } = useI18n();\n const copy = shareDenialCopy(t, cause, itemTypeLabel);\n return (\n <>\n <div\n role=\"alert\"\n className=\"flex items-start gap-3 rounded-lg border border-status-warning-border bg-status-warning-bg-subtle px-4 py-3\"\n >\n <ShieldAlert className=\"mt-0.5 size-5 flex-shrink-0 text-status-warning-text\" />\n <div className=\"space-y-1\">\n <p className=\"text-sm font-medium text-text-primary\">{copy.title}</p>\n <p className=\"text-sm text-text-secondary\">{copy.description}</p>\n </div>\n </div>\n <ResponsiveDialogFooter>\n <Button type=\"button\" onClick={onClose}>\n {tWithFallback(t, \"files.common.actions.close\", \"Close\")}\n </Button>\n </ResponsiveDialogFooter>\n </>\n );\n}\n\nfunction ShareCheckingPanel({ onClose }: { onClose: () => void }) {\n const { t } = useI18n();\n return (\n <>\n <div\n role=\"status\"\n aria-live=\"polite\"\n className=\"flex items-center gap-3 py-6 text-sm text-text-secondary\"\n >\n <Loader2 className=\"size-4 animate-spin\" />\n {sharePermissionMessages(t).checking}\n </div>\n <ResponsiveDialogFooter>\n <Button type=\"button\" variant=\"outline\" onClick={onClose}>\n {tWithFallback(t, \"files.common.actions.cancel\", \"Cancel\")}\n </Button>\n </ResponsiveDialogFooter>\n </>\n );\n}\n\ninterface ShareFormProps {\n item: FileItem | FolderItem;\n itemType: \"file\" | \"folder\";\n isLoading?: boolean;\n onClose: () => void;\n onCreateShare: CreateShare;\n onCreated: (created: CreatedShare) => void;\n onRefused: (source: ShareRefusalSource) => void;\n navigationV2: boolean;\n}\n\nfunction shareErrorMessage(t: Translate, error: unknown): string {\n return error instanceof Error\n ? error.message\n : tWithFallback(\n t,\n \"files.shareDialog.errors.createFailed\",\n \"Failed to create share\",\n );\n}\n\nfunction ShareForm({\n item,\n itemType,\n isLoading,\n onClose,\n onCreateShare,\n onCreated,\n onRefused,\n navigationV2,\n}: ShareFormProps) {\n const { t } = useI18n();\n const [values, setValues] = useState<ShareFormValues>(\n DEFAULT_SHARE_FORM_VALUES,\n );\n const [errorMessage, setErrorMessage] = useState<string | null>(null);\n const update = (patch: Partial<ShareFormValues>) =>\n setValues((current) => ({ ...current, ...patch }));\n\n const handleCreateShare = async () => {\n setErrorMessage(null);\n const shareInput = buildShareInput(item.id, itemType, values);\n try {\n const result = await onCreateShare(shareInput);\n onCreated({\n shareType: shareInput.shareType,\n shareUrl: result.publicUrl || \"\",\n invitedEmail: values.invitedEmail,\n });\n } catch (error) {\n const source = classifyShareRefusal(error);\n if (source !== null) {\n onRefused(source);\n return;\n }\n setErrorMessage(shareErrorMessage(t, error));\n }\n };\n\n return (\n <>\n {errorMessage && (\n <div 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\">\n {errorMessage}\n </div>\n )}\n\n <div className=\"space-y-4\">\n <ShareExpiryField\n value={values.expiryDays}\n onChange={(expiryDays) => update({ expiryDays })}\n />\n <ShareInviteField\n value={values.invitedEmail}\n onChange={(invitedEmail) => update({ invitedEmail })}\n />\n <ShareAdvancedFields\n values={values}\n onChange={update}\n navigationV2={navigationV2}\n />\n </div>\n\n <ResponsiveDialogFooter>\n <Button type=\"button\" variant=\"outline\" onClick={onClose}>\n {tWithFallback(t, \"files.common.actions.cancel\", \"Cancel\")}\n </Button>\n <Button\n type=\"button\"\n onClick={handleCreateShare}\n disabled={isLoading || (values.hasPassword && !values.password)}\n >\n <ShareSubmitLabel isLoading={isLoading} />\n </Button>\n </ResponsiveDialogFooter>\n </>\n );\n}\n\nfunction ShareSubmitLabel({ isLoading }: { isLoading?: boolean }) {\n const { t } = useI18n();\n if (isLoading) {\n return (\n <>\n <Loader2 className=\"size-4 animate-spin\" />\n {tWithFallback(t, \"files.shareDialog.actions.creating\", \"Creating...\")}\n </>\n );\n }\n return (\n <>\n <Link className=\"size-4\" />\n {tWithFallback(\n t,\n \"files.shareDialog.actions.createLink\",\n \"Create share link\",\n )}\n </>\n );\n}\n\nconst EXPIRY_OPTIONS: ReadonlyArray<{\n days: number;\n key: string;\n fallback: string;\n}> = [\n { days: 0, key: \"files.shareDialog.expiry.options.never\", fallback: \"Never\" },\n {\n days: 1,\n key: \"files.shareDialog.expiry.options.oneDay\",\n fallback: \"1 day\",\n },\n {\n days: 7,\n key: \"files.shareDialog.expiry.options.sevenDays\",\n fallback: \"7 days\",\n },\n {\n days: 30,\n key: \"files.shareDialog.expiry.options.thirtyDays\",\n fallback: \"30 days\",\n },\n {\n days: 90,\n key: \"files.shareDialog.expiry.options.ninetyDays\",\n fallback: \"90 days\",\n },\n];\n\n/** Expiry: smart-default field, visible above the fold. */\nfunction ShareExpiryField({\n value,\n onChange,\n}: {\n value: number;\n onChange: (days: number) => void;\n}) {\n const { t } = useI18n();\n const label = tWithFallback(\n t,\n \"files.shareDialog.expiry.label\",\n \"Link expires in\",\n );\n return (\n <div>\n <label\n htmlFor=\"share-dialog-expiry-select\"\n className=\"flex items-center gap-2 text-sm font-medium text-text-primary mb-2\"\n >\n <Calendar className=\"size-4\" />\n {label}\n </label>\n <select\n id=\"share-dialog-expiry-select\"\n aria-label={label}\n value={value}\n onChange={(e) => onChange(Number(e.target.value))}\n 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\"\n >\n {EXPIRY_OPTIONS.map((option) => (\n <option key={option.days} value={option.days}>\n {tWithFallback(t, option.key, option.fallback)}\n </option>\n ))}\n </select>\n </div>\n );\n}\n\n/** Invited email: smart-default; leave empty for a public link. */\nfunction ShareInviteField({\n value,\n onChange,\n}: {\n value: string;\n onChange: (email: string) => void;\n}) {\n const { t } = useI18n();\n const label = tWithFallback(\n t,\n \"files.shareDialog.invite.label\",\n \"Invite specific person (optional)\",\n );\n return (\n <div>\n <label\n htmlFor=\"share-dialog-invite-email\"\n className=\"flex items-center gap-2 text-sm font-medium text-text-primary mb-2\"\n >\n <Mail className=\"size-4\" />\n {label}\n </label>\n <input\n id=\"share-dialog-invite-email\"\n type=\"email\"\n value={value}\n onChange={(e) => onChange(e.target.value)}\n aria-label={label}\n placeholder=\"user@example.com\"\n 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\"\n />\n <p className=\"mt-1 text-xs text-text-secondary\">\n {tWithFallback(\n t,\n \"files.shareDialog.invite.help\",\n \"Leave empty for public link\",\n )}\n </p>\n </div>\n );\n}\n\n/**\n * Download limits and password protection. Navigation v2 uses the shared\n * \"More options\" fold (BOFF-11841): closed on a first visit, remembered per\n * profile, fields kept mounted so they still submit while it reads closed.\n * Every other app keeps the \"Advanced\" accordion.\n */\nfunction ShareAdvancedFields({\n values,\n onChange,\n navigationV2,\n}: {\n values: ShareFormValues;\n onChange: (patch: Partial<ShareFormValues>) => void;\n navigationV2: boolean;\n}) {\n const { t } = useI18n();\n const downloadsLabel = tWithFallback(\n t,\n \"files.shareDialog.downloads.label\",\n \"Maximum downloads\",\n );\n return (\n <OptionalFields\n // With a storageKey the trigger reads the shared \"More options\" label,\n // so the \"Advanced\" title is only passed to the old accordion.\n storageKey={navigationV2 ? \"files.shareDialog\" : undefined}\n title={\n navigationV2\n ? undefined\n : tWithFallback(t, \"files.shareDialog.advanced.title\", \"Advanced\")\n }\n description={tWithFallback(\n t,\n \"files.shareDialog.advanced.description\",\n \"Download limits and password protection\",\n )}\n >\n <div className=\"space-y-4\">\n <div>\n <label\n htmlFor=\"share-dialog-max-downloads\"\n className=\"flex items-center gap-2 text-sm font-medium text-text-primary mb-2\"\n >\n <Download className=\"size-4\" />\n {downloadsLabel}\n </label>\n <input\n id=\"share-dialog-max-downloads\"\n type=\"number\"\n min=\"0\"\n value={values.maxDownloads}\n onChange={(e) => {\n // An empty or partial entry (NaN) means \"unlimited\" (0).\n const { valueAsNumber } = e.target;\n onChange({\n maxDownloads: Number.isNaN(valueAsNumber) ? 0 : valueAsNumber,\n });\n }}\n aria-label={downloadsLabel}\n placeholder={tWithFallback(\n t,\n \"files.shareDialog.downloads.placeholder\",\n \"Unlimited\",\n )}\n 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\"\n />\n </div>\n\n <SharePasswordField values={values} onChange={onChange} />\n </div>\n </OptionalFields>\n );\n}\n\nfunction SharePasswordField({\n values,\n onChange,\n}: {\n values: ShareFormValues;\n onChange: (patch: Partial<ShareFormValues>) => void;\n}) {\n const { t } = useI18n();\n const label = tWithFallback(\n t,\n \"files.shareDialog.password.label\",\n \"Password protection\",\n );\n const requireLabel = tWithFallback(\n t,\n \"files.shareDialog.password.require\",\n \"Require password\",\n );\n return (\n <div>\n <label\n htmlFor=\"share-dialog-password-required\"\n className=\"flex items-center gap-2 text-sm font-medium text-text-primary mb-2\"\n >\n <Lock className=\"size-4\" />\n {label}\n </label>\n <div className=\"flex items-center gap-2\">\n <input\n id=\"share-dialog-password-required\"\n type=\"checkbox\"\n checked={values.hasPassword}\n onChange={(e) => onChange({ hasPassword: e.target.checked })}\n aria-label={requireLabel}\n className=\"rounded transition-colors duration-200\"\n />\n <span className=\"text-sm text-text-secondary\">{requireLabel}</span>\n </div>\n {values.hasPassword && (\n <>\n <input\n type=\"password\"\n value={values.password}\n onChange={(e) => onChange({ password: e.target.value })}\n aria-label={label}\n placeholder={tWithFallback(\n t,\n \"files.shareDialog.password.placeholder\",\n \"Enter password\",\n )}\n 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\"\n />\n <p className=\"mt-1 text-xs text-text-tertiary\">\n {tWithFallback(\n t,\n \"files.shareDialog.password.help\",\n \"Password must be at least 8 characters and contain uppercase, lowercase, and number\",\n )}\n </p>\n </>\n )}\n </div>\n );\n}\n\nfunction ShareSuccessPanel({\n created,\n onClose,\n}: {\n created: CreatedShare;\n onClose: () => void;\n}) {\n const { t } = useI18n();\n return (\n <div className=\"space-y-4\">\n <div className=\"bg-status-success-bg-subtle border border-status-success-border rounded-lg p-4\">\n {created.shareType === \"EMAIL_INVITE\" ? (\n <>\n <p className=\"text-sm font-medium text-status-success-text mb-2\">\n {tWithFallback(\n t,\n \"files.shareDialog.success.invitationSent\",\n \"Invitation sent successfully!\",\n )}\n </p>\n <p className=\"text-sm text-text-secondary\">\n {tWithFallback(\n t,\n \"files.shareDialog.success.invitationSentTo\",\n \"An invitation has been sent to {{email}}\",\n { email: created.invitedEmail },\n )}\n </p>\n </>\n ) : (\n <ShareLinkResult shareUrl={created.shareUrl} />\n )}\n </div>\n\n <ResponsiveDialogFooter>\n <Button type=\"button\" onClick={onClose} className=\"w-full\">\n {tWithFallback(t, \"files.common.actions.done\", \"Done\")}\n </Button>\n </ResponsiveDialogFooter>\n </div>\n );\n}\n\nfunction ShareLinkResult({ shareUrl }: { shareUrl: string }) {\n const { t } = useI18n();\n const [copied, setCopied] = useState(false);\n\n const handleCopyLink = async () => {\n if (shareUrl) {\n await navigator.clipboard.writeText(shareUrl);\n setCopied(true);\n }\n };\n\n useEffect(() => {\n if (copied) {\n const timer = setTimeout(() => setCopied(false), 2000);\n return () => clearTimeout(timer);\n }\n return undefined;\n }, [copied]);\n\n return (\n <>\n <p className=\"text-sm font-medium text-status-success-text mb-2\">\n {tWithFallback(\n t,\n \"files.shareDialog.success.linkCreated\",\n \"Share link created successfully!\",\n )}\n </p>\n <div className=\"flex flex-col sm:flex-row items-stretch sm:items-center gap-2\">\n <input\n type=\"text\"\n value={shareUrl}\n readOnly\n aria-label={tWithFallback(\n t,\n \"files.shareDialog.success.linkCreated\",\n \"Share link\",\n )}\n className=\"flex-1 min-h-11 px-3 py-2 bg-bg-surface border border-status-success-border rounded-lg text-sm\"\n />\n <Button type=\"button\" onClick={handleCopyLink}>\n {copied ? (\n <>\n <Check className=\"size-4\" />\n {tWithFallback(t, \"files.shareDialog.actions.copied\", \"Copied!\")}\n </>\n ) : (\n <>\n <Copy className=\"size-4\" />\n {tWithFallback(t, \"files.common.actions.copy\", \"Copy\")}\n </>\n )}\n </Button>\n </div>\n </>\n );\n}\n"],"mappings":";;;;;;;;;;AA8EA,SAAgBC,EAAY,EAC1B,SACA,aACA,YACA,kBACA,cACA,oBACA,kBAAe,MACI;CACnB,IAAM,EAAE,SAAMC,EAAQ,GAChB,CAACC,GAASC,KAAcC,EAA8B,IAAI,GAC1D,EAAE,eAAY,gBAAa,qBAAkBC,EAAyB;EAC1E;EACA;EACA;CACF,CAAC,GACKC,IAAgBC,EACpBC,GACAC,MAAa,WACT,sCACA,mCACJA,MAAa,WAAW,WAAW,MACrC;CAEA,OACE,kBAACC,GAAD;EACE,MAAA;EACA,eAAe,MAAkB;GAC/B,AAAKC,KAAMC,EAAQ;EACrB;EAEA,UAAA,kBAACC,GAAD,EAAA,UAAA,CACE,kBAACC,GAAD,EAAA,UAAA,CACE,kBAACC,GAAD,EAAA,UACGR,EACCC,GACA,2BACA,mCACA;GAAE,UAAUF;GAAe,MAAM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U,EAAK,GAAG,GAAI;GACrD,aAAa,aAAaE,CAAK;EACjC;CAEF,GAAG,CAACH,CAAM,CAAC,GAGT,kBAAAzE,GAAA,EAAA,UAAA,CACE,kBAAC,KAAD;EAAG,WAAU;EACV,UAAAQ,EACCC,GACA,yCACA,kCACF;CACC,CAAA,GACH,kBAAC,OAAD;EAAK,WAAU;EAAf,UAAA,CACE,kBAAC,SAAD;GACE,MAAK;GACL,OAAOoE;GACP,UAAA;GACA,cAAYrE,EACVC,GACA,yCACA,YACF;GACA,WAAU;EACX,CAAA,GACD,kBAACyB,GAAD;GAAQ,MAAK;GAAS,SAAS,YApCF;IACjC,AAAI2C,MACF,MAAM,UAAU,UAAU,UAAUA,CAAQ,GAC5CH,EAAU,EAAI;GAElB;GAgCS,UAAAD,IACC,kBAAAzE,GAAA,EAAA,UAAA,CACE,kBAAC8E,GAAD,EAAO,WAAU,SAAU,CAAA,GAC1BtE,EAAcC,GAAG,oCAAoC,SAAS,CAC/D,EAAA,CAAA,IAEF,kBAAAT,GAAA,EAAA,UAAA,CACE,kBAAC+E,GAAD,EAAM,WAAU,SAAU,CAAA,GACzBvE,EAAcC,GAAG,6BAA6B,MAAM,CACrD,EAAA,CAAA;EAEE,CAAA,CACL;CACL,CAAA,CAAA,EAAA,CAAA;AAEN"}
|
|
1
|
+
{"version":3,"file":"ShareDialog.js","names":["_Fragment","ShareDialog","useI18n","created","setCreated","useState","useShareDialogPermission","itemTypeLabel","tWithFallback","t","itemType","ResponsiveDialog","next","onClose","ResponsiveDialogContent","ResponsiveDialogHeader","ResponsiveDialogTitle","item","navigationV2","ResponsiveDialogDescription","ShareDialogBody","recordRefusal","denialCause","permission","ShareCheckingPanel","ShareForm","ShareSuccessPanel","ShareDeniedPanel","copy","shareDenialCopy","cause","Fragment","ShieldAlert","ResponsiveDialogFooter","Button","Loader2","sharePermissionMessages","shareErrorMessage","error","values","setValues","DEFAULT_SHARE_FORM_VALUES","errorMessage","setErrorMessage","update","current","patch","ShareExpiryField","ShareInviteField","ShareAdvancedFields","shareInput","buildShareInput","result","onCreateShare","source","classifyShareRefusal","isLoading","ShareSubmitLabel","Link","EXPIRY_OPTIONS","label","Calendar","ThemedSelect","onChange","option","Mail","downloadsLabel","OptionalFields","Download","valueAsNumber","SharePasswordField","requireLabel","Lock","ShareLinkResult","copied","setCopied","useEffect","timer","shareUrl","Check","Copy"],"sources":["../../../src/files/components/ShareDialog.tsx"],"sourcesContent":["import { useEffect, useState } from \"react\";\nimport {\n Link,\n Mail,\n Calendar,\n Download,\n Lock,\n Copy,\n Check,\n Loader2,\n ShieldAlert,\n} from \"lucide-react\";\nimport {\n useI18n,\n type I18nContextValue,\n} from \"@burdenoff/fe-libs/shared/providers/shell/I18nProvider\";\nimport {\n ResponsiveDialog,\n ResponsiveDialogContent,\n ResponsiveDialogHeader,\n ResponsiveDialogTitle,\n ResponsiveDialogDescription,\n ResponsiveDialogFooter,\n OptionalFields,\n Button,\n ThemedSelect,\n} from \"@burdenoff/fe-libs/ui\";\nimport type { FileItem, FolderItem } from \"../types\";\nimport { tWithFallback } from \"../utils/i18n\";\nimport {\n DEFAULT_SHARE_FORM_VALUES,\n type ShareDialogInput,\n type ShareFormValues,\n buildShareInput,\n} from \"../utils/shareForm\";\n\nexport type { ShareDialogInput } from \"../utils/shareForm\";\nimport { useShareDialogPermission } from \"../hooks/useShareDialogPermission\";\nimport {\n classifyShareRefusal,\n shareDenialCopy,\n sharePermissionMessages,\n type ShareDenialCause,\n type ShareRefusalSource,\n} from \"../utils/sharePermission\";\n\ntype CreateShare = (\n input: ShareDialogInput,\n) => Promise<{ publicUrl: string; token: string }>;\n\ntype Translate = I18nContextValue[\"t\"];\n\ninterface ShareDialogProps {\n item: FileItem | FolderItem;\n itemType: \"file\" | \"folder\";\n onClose: () => void;\n onCreateShare: CreateShare;\n isLoading?: boolean;\n /**\n * A denial the caller recorded recently (within its TTL). The dialog shows\n * the denied state at once instead of a spinner, and still re-checks: if the\n * re-check allows sharing, the form replaces the denial.\n */\n knownPermission?: \"denied\";\n /**\n * Navigation v2 (BOFF-11865), FluidGrids only: state the reach of a link\n * under the title before it is created, and fold Maximum downloads and\n * Password protection into the shared, remembered \"More options\".\n */\n navigationV2?: boolean;\n}\n\n/** A share the dialog created, shown in the success panel. */\ninterface CreatedShare {\n shareType: ShareDialogInput[\"shareType\"];\n shareUrl: string;\n invitedEmail: string;\n}\n\nexport function ShareDialog({\n item,\n itemType,\n onClose,\n onCreateShare,\n isLoading,\n knownPermission,\n navigationV2 = false,\n}: ShareDialogProps) {\n const { t } = useI18n();\n const [created, setCreated] = useState<CreatedShare | null>(null);\n const { permission, denialCause, recordRefusal } = useShareDialogPermission({\n item,\n itemType,\n knownPermission,\n });\n const itemTypeLabel = tWithFallback(\n t,\n itemType === \"folder\"\n ? \"files.shareDialog.itemType.folder\"\n : \"files.shareDialog.itemType.file\",\n itemType === \"folder\" ? \"folder\" : \"file\",\n );\n\n return (\n <ResponsiveDialog\n open\n onOpenChange={(next: boolean) => {\n if (!next) onClose();\n }}\n >\n <ResponsiveDialogContent>\n <ResponsiveDialogHeader>\n <ResponsiveDialogTitle>\n {tWithFallback(\n t,\n \"files.shareDialog.title\",\n 'Share {{itemType}} \"{{name}}\"',\n { itemType: itemTypeLabel, name: item.name },\n )}\n </ResponsiveDialogTitle>\n {navigationV2 && created === null && (\n <ResponsiveDialogDescription>\n {tWithFallback(\n t,\n \"files.shareDialog.reach\",\n \"Anyone with the link can view and download until it expires.\",\n )}\n </ResponsiveDialogDescription>\n )}\n </ResponsiveDialogHeader>\n\n <ShareDialogBody\n item={item}\n itemType={itemType}\n itemTypeLabel={itemTypeLabel}\n permission={permission}\n denialCause={denialCause}\n created={created}\n isLoading={isLoading}\n onClose={onClose}\n onCreateShare={onCreateShare}\n onCreated={setCreated}\n onRefused={recordRefusal}\n navigationV2={navigationV2}\n />\n </ResponsiveDialogContent>\n </ResponsiveDialog>\n );\n}\n\ninterface ShareDialogBodyProps {\n item: FileItem | FolderItem;\n itemType: \"file\" | \"folder\";\n itemTypeLabel: string;\n permission: ReturnType<typeof useShareDialogPermission>[\"permission\"];\n denialCause: ShareDenialCause | null;\n created: CreatedShare | null;\n isLoading?: boolean;\n onClose: () => void;\n onCreateShare: CreateShare;\n onCreated: (created: CreatedShare) => void;\n onRefused: (source: ShareRefusalSource) => void;\n navigationV2: boolean;\n}\n\n/** Picks the dialog body: denial, permission check, share form or result. */\nfunction ShareDialogBody({\n item,\n itemType,\n itemTypeLabel,\n permission,\n denialCause,\n created,\n isLoading,\n onClose,\n onCreateShare,\n onCreated,\n onRefused,\n navigationV2,\n}: ShareDialogBodyProps) {\n if (denialCause !== null) {\n return (\n <ShareDeniedPanel\n cause={denialCause}\n itemTypeLabel={itemTypeLabel}\n onClose={onClose}\n />\n );\n }\n if (permission === \"checking\") {\n return <ShareCheckingPanel onClose={onClose} />;\n }\n if (created === null) {\n return (\n <ShareForm\n item={item}\n itemType={itemType}\n isLoading={isLoading}\n onClose={onClose}\n onCreateShare={onCreateShare}\n onCreated={onCreated}\n onRefused={onRefused}\n navigationV2={navigationV2}\n />\n );\n }\n return <ShareSuccessPanel created={created} onClose={onClose} />;\n}\n\nfunction ShareDeniedPanel({\n cause,\n itemTypeLabel,\n onClose,\n}: {\n cause: ShareDenialCause;\n itemTypeLabel: string;\n onClose: () => void;\n}) {\n const { t } = useI18n();\n const copy = shareDenialCopy(t, cause, itemTypeLabel);\n return (\n <>\n <div\n role=\"alert\"\n className=\"flex items-start gap-3 rounded-lg border border-status-warning-border bg-status-warning-bg-subtle px-4 py-3\"\n >\n <ShieldAlert className=\"mt-0.5 size-5 flex-shrink-0 text-status-warning-text\" />\n <div className=\"space-y-1\">\n <p className=\"text-sm font-medium text-text-primary\">{copy.title}</p>\n <p className=\"text-sm text-text-secondary\">{copy.description}</p>\n </div>\n </div>\n <ResponsiveDialogFooter>\n <Button type=\"button\" onClick={onClose}>\n {tWithFallback(t, \"files.common.actions.close\", \"Close\")}\n </Button>\n </ResponsiveDialogFooter>\n </>\n );\n}\n\nfunction ShareCheckingPanel({ onClose }: { onClose: () => void }) {\n const { t } = useI18n();\n return (\n <>\n <div\n role=\"status\"\n aria-live=\"polite\"\n className=\"flex items-center gap-3 py-6 text-sm text-text-secondary\"\n >\n <Loader2 className=\"size-4 animate-spin\" />\n {sharePermissionMessages(t).checking}\n </div>\n <ResponsiveDialogFooter>\n <Button type=\"button\" variant=\"outline\" onClick={onClose}>\n {tWithFallback(t, \"files.common.actions.cancel\", \"Cancel\")}\n </Button>\n </ResponsiveDialogFooter>\n </>\n );\n}\n\ninterface ShareFormProps {\n item: FileItem | FolderItem;\n itemType: \"file\" | \"folder\";\n isLoading?: boolean;\n onClose: () => void;\n onCreateShare: CreateShare;\n onCreated: (created: CreatedShare) => void;\n onRefused: (source: ShareRefusalSource) => void;\n navigationV2: boolean;\n}\n\nfunction shareErrorMessage(t: Translate, error: unknown): string {\n return error instanceof Error\n ? error.message\n : tWithFallback(\n t,\n \"files.shareDialog.errors.createFailed\",\n \"Failed to create share\",\n );\n}\n\nfunction ShareForm({\n item,\n itemType,\n isLoading,\n onClose,\n onCreateShare,\n onCreated,\n onRefused,\n navigationV2,\n}: ShareFormProps) {\n const { t } = useI18n();\n const [values, setValues] = useState<ShareFormValues>(\n DEFAULT_SHARE_FORM_VALUES,\n );\n const [errorMessage, setErrorMessage] = useState<string | null>(null);\n const update = (patch: Partial<ShareFormValues>) =>\n setValues((current) => ({ ...current, ...patch }));\n\n const handleCreateShare = async () => {\n setErrorMessage(null);\n const shareInput = buildShareInput(item.id, itemType, values);\n try {\n const result = await onCreateShare(shareInput);\n onCreated({\n shareType: shareInput.shareType,\n shareUrl: result.publicUrl || \"\",\n invitedEmail: values.invitedEmail,\n });\n } catch (error) {\n const source = classifyShareRefusal(error);\n if (source !== null) {\n onRefused(source);\n return;\n }\n setErrorMessage(shareErrorMessage(t, error));\n }\n };\n\n return (\n <>\n {errorMessage && (\n <div 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\">\n {errorMessage}\n </div>\n )}\n\n <div className=\"space-y-4\">\n <ShareExpiryField\n value={values.expiryDays}\n onChange={(expiryDays) => update({ expiryDays })}\n />\n <ShareInviteField\n value={values.invitedEmail}\n onChange={(invitedEmail) => update({ invitedEmail })}\n />\n <ShareAdvancedFields\n values={values}\n onChange={update}\n navigationV2={navigationV2}\n />\n </div>\n\n <ResponsiveDialogFooter>\n <Button type=\"button\" variant=\"outline\" onClick={onClose}>\n {tWithFallback(t, \"files.common.actions.cancel\", \"Cancel\")}\n </Button>\n <Button\n type=\"button\"\n onClick={handleCreateShare}\n disabled={isLoading || (values.hasPassword && !values.password)}\n >\n <ShareSubmitLabel isLoading={isLoading} />\n </Button>\n </ResponsiveDialogFooter>\n </>\n );\n}\n\nfunction ShareSubmitLabel({ isLoading }: { isLoading?: boolean }) {\n const { t } = useI18n();\n if (isLoading) {\n return (\n <>\n <Loader2 className=\"size-4 animate-spin\" />\n {tWithFallback(t, \"files.shareDialog.actions.creating\", \"Creating...\")}\n </>\n );\n }\n return (\n <>\n <Link className=\"size-4\" />\n {tWithFallback(\n t,\n \"files.shareDialog.actions.createLink\",\n \"Create share link\",\n )}\n </>\n );\n}\n\nconst EXPIRY_OPTIONS: ReadonlyArray<{\n days: number;\n key: string;\n fallback: string;\n}> = [\n { days: 0, key: \"files.shareDialog.expiry.options.never\", fallback: \"Never\" },\n {\n days: 1,\n key: \"files.shareDialog.expiry.options.oneDay\",\n fallback: \"1 day\",\n },\n {\n days: 7,\n key: \"files.shareDialog.expiry.options.sevenDays\",\n fallback: \"7 days\",\n },\n {\n days: 30,\n key: \"files.shareDialog.expiry.options.thirtyDays\",\n fallback: \"30 days\",\n },\n {\n days: 90,\n key: \"files.shareDialog.expiry.options.ninetyDays\",\n fallback: \"90 days\",\n },\n];\n\n/** Expiry: smart-default field, visible above the fold. */\nfunction ShareExpiryField({\n value,\n onChange,\n}: {\n value: number;\n onChange: (days: number) => void;\n}) {\n const { t } = useI18n();\n const label = tWithFallback(\n t,\n \"files.shareDialog.expiry.label\",\n \"Link expires in\",\n );\n return (\n <div>\n <label\n htmlFor=\"share-dialog-expiry-select\"\n className=\"flex items-center gap-2 text-sm font-medium text-text-primary mb-2\"\n >\n <Calendar className=\"size-4\" />\n {label}\n </label>\n <ThemedSelect\n id=\"share-dialog-expiry-select\"\n aria-label={label}\n value={value}\n onChange={(e) => onChange(Number(e.target.value))}\n 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\"\n >\n {EXPIRY_OPTIONS.map((option) => (\n <option key={option.days} value={option.days}>\n {tWithFallback(t, option.key, option.fallback)}\n </option>\n ))}\n </ThemedSelect>\n </div>\n );\n}\n\n/** Invited email: smart-default; leave empty for a public link. */\nfunction ShareInviteField({\n value,\n onChange,\n}: {\n value: string;\n onChange: (email: string) => void;\n}) {\n const { t } = useI18n();\n const label = tWithFallback(\n t,\n \"files.shareDialog.invite.label\",\n \"Invite specific person (optional)\",\n );\n return (\n <div>\n <label\n htmlFor=\"share-dialog-invite-email\"\n className=\"flex items-center gap-2 text-sm font-medium text-text-primary mb-2\"\n >\n <Mail className=\"size-4\" />\n {label}\n </label>\n <input\n id=\"share-dialog-invite-email\"\n type=\"email\"\n value={value}\n onChange={(e) => onChange(e.target.value)}\n aria-label={label}\n placeholder=\"user@example.com\"\n 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\"\n />\n <p className=\"mt-1 text-xs text-text-secondary\">\n {tWithFallback(\n t,\n \"files.shareDialog.invite.help\",\n \"Leave empty for public link\",\n )}\n </p>\n </div>\n );\n}\n\n/**\n * Download limits and password protection. Navigation v2 uses the shared\n * \"More options\" fold (BOFF-11841): closed on a first visit, remembered per\n * profile, fields kept mounted so they still submit while it reads closed.\n * Every other app keeps the \"Advanced\" accordion.\n */\nfunction ShareAdvancedFields({\n values,\n onChange,\n navigationV2,\n}: {\n values: ShareFormValues;\n onChange: (patch: Partial<ShareFormValues>) => void;\n navigationV2: boolean;\n}) {\n const { t } = useI18n();\n const downloadsLabel = tWithFallback(\n t,\n \"files.shareDialog.downloads.label\",\n \"Maximum downloads\",\n );\n return (\n <OptionalFields\n // With a storageKey the trigger reads the shared \"More options\" label,\n // so the \"Advanced\" title is only passed to the old accordion.\n storageKey={navigationV2 ? \"files.shareDialog\" : undefined}\n title={\n navigationV2\n ? undefined\n : tWithFallback(t, \"files.shareDialog.advanced.title\", \"Advanced\")\n }\n description={tWithFallback(\n t,\n \"files.shareDialog.advanced.description\",\n \"Download limits and password protection\",\n )}\n >\n <div className=\"space-y-4\">\n <div>\n <label\n htmlFor=\"share-dialog-max-downloads\"\n className=\"flex items-center gap-2 text-sm font-medium text-text-primary mb-2\"\n >\n <Download className=\"size-4\" />\n {downloadsLabel}\n </label>\n <input\n id=\"share-dialog-max-downloads\"\n type=\"number\"\n min=\"0\"\n value={values.maxDownloads}\n onChange={(e) => {\n // An empty or partial entry (NaN) means \"unlimited\" (0).\n const { valueAsNumber } = e.target;\n onChange({\n maxDownloads: Number.isNaN(valueAsNumber) ? 0 : valueAsNumber,\n });\n }}\n aria-label={downloadsLabel}\n placeholder={tWithFallback(\n t,\n \"files.shareDialog.downloads.placeholder\",\n \"Unlimited\",\n )}\n 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\"\n />\n </div>\n\n <SharePasswordField values={values} onChange={onChange} />\n </div>\n </OptionalFields>\n );\n}\n\nfunction SharePasswordField({\n values,\n onChange,\n}: {\n values: ShareFormValues;\n onChange: (patch: Partial<ShareFormValues>) => void;\n}) {\n const { t } = useI18n();\n const label = tWithFallback(\n t,\n \"files.shareDialog.password.label\",\n \"Password protection\",\n );\n const requireLabel = tWithFallback(\n t,\n \"files.shareDialog.password.require\",\n \"Require password\",\n );\n return (\n <div>\n <label\n htmlFor=\"share-dialog-password-required\"\n className=\"flex items-center gap-2 text-sm font-medium text-text-primary mb-2\"\n >\n <Lock className=\"size-4\" />\n {label}\n </label>\n <div className=\"flex items-center gap-2\">\n <input\n id=\"share-dialog-password-required\"\n type=\"checkbox\"\n checked={values.hasPassword}\n onChange={(e) => onChange({ hasPassword: e.target.checked })}\n aria-label={requireLabel}\n className=\"rounded transition-colors duration-200\"\n />\n <span className=\"text-sm text-text-secondary\">{requireLabel}</span>\n </div>\n {values.hasPassword && (\n <>\n <input\n type=\"password\"\n value={values.password}\n onChange={(e) => onChange({ password: e.target.value })}\n aria-label={label}\n placeholder={tWithFallback(\n t,\n \"files.shareDialog.password.placeholder\",\n \"Enter password\",\n )}\n 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\"\n />\n <p className=\"mt-1 text-xs text-text-tertiary\">\n {tWithFallback(\n t,\n \"files.shareDialog.password.help\",\n \"Password must be at least 8 characters and contain uppercase, lowercase, and number\",\n )}\n </p>\n </>\n )}\n </div>\n );\n}\n\nfunction ShareSuccessPanel({\n created,\n onClose,\n}: {\n created: CreatedShare;\n onClose: () => void;\n}) {\n const { t } = useI18n();\n return (\n <div className=\"space-y-4\">\n <div className=\"bg-status-success-bg-subtle border border-status-success-border rounded-lg p-4\">\n {created.shareType === \"EMAIL_INVITE\" ? (\n <>\n <p className=\"text-sm font-medium text-status-success-text mb-2\">\n {tWithFallback(\n t,\n \"files.shareDialog.success.invitationSent\",\n \"Invitation sent successfully!\",\n )}\n </p>\n <p className=\"text-sm text-text-secondary\">\n {tWithFallback(\n t,\n \"files.shareDialog.success.invitationSentTo\",\n \"An invitation has been sent to {{email}}\",\n { email: created.invitedEmail },\n )}\n </p>\n </>\n ) : (\n <ShareLinkResult shareUrl={created.shareUrl} />\n )}\n </div>\n\n <ResponsiveDialogFooter>\n <Button type=\"button\" onClick={onClose} className=\"w-full\">\n {tWithFallback(t, \"files.common.actions.done\", \"Done\")}\n </Button>\n </ResponsiveDialogFooter>\n </div>\n );\n}\n\nfunction ShareLinkResult({ shareUrl }: { shareUrl: string }) {\n const { t } = useI18n();\n const [copied, setCopied] = useState(false);\n\n const handleCopyLink = async () => {\n if (shareUrl) {\n await navigator.clipboard.writeText(shareUrl);\n setCopied(true);\n }\n };\n\n useEffect(() => {\n if (copied) {\n const timer = setTimeout(() => setCopied(false), 2000);\n return () => clearTimeout(timer);\n }\n return undefined;\n }, [copied]);\n\n return (\n <>\n <p className=\"text-sm font-medium text-status-success-text mb-2\">\n {tWithFallback(\n t,\n \"files.shareDialog.success.linkCreated\",\n \"Share link created successfully!\",\n )}\n </p>\n <div className=\"flex flex-col sm:flex-row items-stretch sm:items-center gap-2\">\n <input\n type=\"text\"\n value={shareUrl}\n readOnly\n aria-label={tWithFallback(\n t,\n \"files.shareDialog.success.linkCreated\",\n \"Share link\",\n )}\n className=\"flex-1 min-h-11 px-3 py-2 bg-bg-surface border border-status-success-border rounded-lg text-sm\"\n />\n <Button type=\"button\" onClick={handleCopyLink}>\n {copied ? (\n <>\n <Check className=\"size-4\" />\n {tWithFallback(t, \"files.shareDialog.actions.copied\", \"Copied!\")}\n </>\n ) : (\n <>\n <Copy className=\"size-4\" />\n {tWithFallback(t, \"files.common.actions.copy\", \"Copy\")}\n </>\n )}\n </Button>\n </div>\n </>\n );\n}\n"],"mappings":";;;;;;;;;;AA+EA,SAAgBC,EAAY,EAC1B,SACA,aACA,YACA,kBACA,cACA,oBACA,kBAAe,MACI;CACnB,IAAM,EAAE,SAAMC,EAAQ,GAChB,CAACC,GAASC,KAAcC,EAA8B,IAAI,GAC1D,EAAE,eAAY,gBAAa,qBAAkBC,EAAyB;EAC1E;EACA;EACA;CACF,CAAC,GACKC,IAAgBC,EACpBC,GACAC,MAAa,WACT,sCACA,mCACJA,MAAa,WAAW,WAAW,MACrC;CA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,6BAA6B,MAAM;EAC/C,CAAA,EACc,CAAA,CACrB;;AAET;AAEA,SAASgE,EAAgB,EAAE,eAAkC;CAC3D,IAAM,EAAE,SAAMvE,EAAQ,GAChB,CAACwE,GAAQC,KAAatE,EAAS,EAAK;CAiB1C,OARAuE,QAAgB;EACd,IAAIF,GAAQ;GACV,IAAMG,IAAQ,iBAAiBF,EAAU,EAAK,GAAG,GAAI;GACrD,aAAa,aAAaE,CAAK;EACjC;CAEF,GAAG,CAACH,CAAM,CAAC,GAGT,kBAAA1E,GAAA,EAAA,UAAA,CACE,kBAAC,KAAD;EAAG,WAAU;EACV,UAAAQ,EACCC,GACA,yCACA,kCACF;CACC,CAAA,GACH,kBAAC,OAAD;EAAK,WAAU;EAAf,UAAA,CACE,kBAAC,SAAD;GACE,MAAK;GACL,OAAOqE;GACP,UAAA;GACA,cAAYtE,EACVC,GACA,yCACA,YACF;GACA,WAAU;EACX,CAAA,GACD,kBAACyB,GAAD;GAAQ,MAAK;GAAS,SAAS,YApCF;IACjC,AAAI4C,MACF,MAAM,UAAU,UAAU,UAAUA,CAAQ,GAC5CH,EAAU,EAAI;GAElB;GAgCS,UAAAD,IACC,kBAAA1E,GAAA,EAAA,UAAA,CACE,kBAAC+E,GAAD,EAAO,WAAU,SAAU,CAAA,GAC1BvE,EAAcC,GAAG,oCAAoC,SAAS,CAC/D,EAAA,CAAA,IAEF,kBAAAT,GAAA,EAAA,UAAA,CACE,kBAACgF,GAAD,EAAM,WAAU,SAAU,CAAA,GACzBxE,EAAcC,GAAG,6BAA6B,MAAM,CACrD,EAAA,CAAA;EAEE,CAAA,CACL;CACL,CAAA,CAAA,EAAA,CAAA;AAEN"}
|
|
@@ -4,42 +4,43 @@ 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
6
|
import { useI18n as o } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
7
|
+
import { ThemedSelect as s } from "@burdenoff/fe-libs/ui";
|
|
7
8
|
// src/files/components/UploadVisibilitySelect.tsx
|
|
8
|
-
function
|
|
9
|
-
let { t:
|
|
9
|
+
function c({ value: c, onChange: l, disabled: u = !1, label: d }) {
|
|
10
|
+
let { t: f } = o(), p = r();
|
|
10
11
|
return /* @__PURE__ */ a("div", {
|
|
11
12
|
className: "min-w-0 space-y-1",
|
|
12
13
|
children: [
|
|
13
14
|
/* @__PURE__ */ i("label", {
|
|
14
|
-
htmlFor:
|
|
15
|
+
htmlFor: p,
|
|
15
16
|
className: "block text-sm font-medium text-text-primary",
|
|
16
|
-
children:
|
|
17
|
+
children: d ?? t(f, "files.visibility.uploadLabel", "Upload visibility")
|
|
17
18
|
}),
|
|
18
|
-
/* @__PURE__ */ a(
|
|
19
|
-
id:
|
|
20
|
-
value:
|
|
21
|
-
disabled:
|
|
22
|
-
"aria-describedby": `${
|
|
19
|
+
/* @__PURE__ */ a(s, {
|
|
20
|
+
id: p,
|
|
21
|
+
value: c,
|
|
22
|
+
disabled: u,
|
|
23
|
+
"aria-describedby": `${p}-hint`,
|
|
23
24
|
onChange: (e) => {
|
|
24
|
-
n(e.target.value) &&
|
|
25
|
+
n(e.target.value) && l(e.target.value);
|
|
25
26
|
},
|
|
26
27
|
className: "w-full rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm text-text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring disabled:opacity-50",
|
|
27
28
|
children: [/* @__PURE__ */ i("option", {
|
|
28
29
|
value: e.Private,
|
|
29
|
-
children: t(
|
|
30
|
+
children: t(f, "files.visibility.private", "Private")
|
|
30
31
|
}), /* @__PURE__ */ i("option", {
|
|
31
32
|
value: e.Workspace,
|
|
32
|
-
children: t(
|
|
33
|
+
children: t(f, "files.visibility.workspace", "Workspace")
|
|
33
34
|
})]
|
|
34
35
|
}),
|
|
35
36
|
/* @__PURE__ */ i("p", {
|
|
36
|
-
id: `${
|
|
37
|
+
id: `${p}-hint`,
|
|
37
38
|
className: "max-w-sm text-xs text-text-secondary",
|
|
38
|
-
children:
|
|
39
|
+
children: c === e.Workspace ? t(f, "files.visibility.workspaceHint", "All workspace members can find and open this file.") : t(f, "files.visibility.privateHint", "Only the uploader and people with an existing file or folder grant can open this file.")
|
|
39
40
|
})
|
|
40
41
|
]
|
|
41
42
|
});
|
|
42
43
|
}
|
|
43
|
-
export {
|
|
44
|
+
export { c as UploadVisibilitySelect };
|
|
44
45
|
|
|
45
46
|
//# sourceMappingURL=UploadVisibilitySelect.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UploadVisibilitySelect.js","names":["UploadVisibilitySelect","useI18n","id","useId","label","tWithFallback","t","isUploadVisibility","event","onChange","FileVisibility","value"],"sources":["../../../src/files/components/UploadVisibilitySelect.tsx"],"sourcesContent":["import { useId } from \"react\";\nimport { useI18n } from \"@burdenoff/fe-libs/shared/providers/shell/I18nProvider\";\nimport { FileVisibility } from \"../../generated/wspace-types\";\nimport { tWithFallback } from \"../utils/i18n\";\nimport {\n isUploadVisibility,\n type UploadVisibility,\n} from \"../utils/uploadVisibility\";\n\nexport function UploadVisibilitySelect({\n value,\n onChange,\n disabled = false,\n label,\n}: {\n value: UploadVisibility;\n onChange: (value: UploadVisibility) => void;\n disabled?: boolean;\n label?: string;\n}) {\n const { t } = useI18n();\n const id = useId();\n return (\n <div className=\"min-w-0 space-y-1\">\n <label\n htmlFor={id}\n className=\"block text-sm font-medium text-text-primary\"\n >\n {label ??\n tWithFallback(t, \"files.visibility.uploadLabel\", \"Upload visibility\")}\n </label>\n <
|
|
1
|
+
{"version":3,"file":"UploadVisibilitySelect.js","names":["UploadVisibilitySelect","useI18n","id","useId","label","tWithFallback","t","ThemedSelect","isUploadVisibility","event","onChange","FileVisibility","value"],"sources":["../../../src/files/components/UploadVisibilitySelect.tsx"],"sourcesContent":["import { useId } from \"react\";\nimport { useI18n } from \"@burdenoff/fe-libs/shared/providers/shell/I18nProvider\";\nimport { FileVisibility } from \"../../generated/wspace-types\";\nimport { tWithFallback } from \"../utils/i18n\";\nimport {\n isUploadVisibility,\n type UploadVisibility,\n} from \"../utils/uploadVisibility\";\nimport { ThemedSelect } from \"@burdenoff/fe-libs/ui\";\n\nexport function UploadVisibilitySelect({\n value,\n onChange,\n disabled = false,\n label,\n}: {\n value: UploadVisibility;\n onChange: (value: UploadVisibility) => void;\n disabled?: boolean;\n label?: string;\n}) {\n const { t } = useI18n();\n const id = useId();\n return (\n <div className=\"min-w-0 space-y-1\">\n <label\n htmlFor={id}\n className=\"block text-sm font-medium text-text-primary\"\n >\n {label ??\n tWithFallback(t, \"files.visibility.uploadLabel\", \"Upload visibility\")}\n </label>\n <ThemedSelect\n id={id}\n value={value}\n disabled={disabled}\n aria-describedby={`${id}-hint`}\n onChange={(event) => {\n if (isUploadVisibility(event.target.value))\n onChange(event.target.value);\n }}\n className=\"w-full rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm text-text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring disabled:opacity-50\"\n >\n <option value={FileVisibility.Private}>\n {tWithFallback(t, \"files.visibility.private\", \"Private\")}\n </option>\n <option value={FileVisibility.Workspace}>\n {tWithFallback(t, \"files.visibility.workspace\", \"Workspace\")}\n </option>\n </ThemedSelect>\n <p id={`${id}-hint`} className=\"max-w-sm text-xs text-text-secondary\">\n {value === FileVisibility.Workspace\n ? tWithFallback(\n t,\n \"files.visibility.workspaceHint\",\n \"All workspace members can find and open this file.\",\n )\n : tWithFallback(\n t,\n \"files.visibility.privateHint\",\n \"Only the uploader and people with an existing file or folder grant can open this file.\",\n )}\n </p>\n </div>\n );\n}\n"],"mappings":";;;;;;;;AAUA,SAAgBA,EAAuB,EACrC,UACA,aACA,cAAW,IACX,YAMC;CACD,IAAM,EAAE,SAAMC,EAAQ,GAChBC,IAAKC,EAAM;CACjB,OACE,kBAAC,OAAD;EAAK,WAAU;EAAf,UAAA;GACE,kBAAC,SAAD;IACE,SAASD;IACT,WAAU;IAET,UAAAE,KACCC,EAAcC,GAAG,gCAAgC,mBAAmB;GACjE,CAAA;GACP,kBAACC,GAAD;IACM;IACG;IACG;IACV,oBAAkB,GAAGL,EAAG;IACxB,WAAW,MAAU;KACnB,AAAIM,EAAmBC,EAAM,OAAO,KAAK,KACvCC,EAASD,EAAM,OAAO,KAAK;IAC/B;IACA,WAAU;IATZ,UAAA,CAWE,kBAAC,UAAD;KAAQ,OAAOE,EAAe;KAC3B,UAAAN,EAAcC,GAAG,4BAA4B,SAAS;IACjD,CAAA,GACR,kBAAC,UAAD;KAAQ,OAAOK,EAAe;KAC3B,UAAAN,EAAcC,GAAG,8BAA8B,WAAW;IACrD,CAAA,CACI;;GACd,kBAAC,KAAD;IAAG,IAAI,GAAGJ,EAAG;IAAQ,WAAU;IAC5B,UAAAU,MAAUD,EAAe,YACtBN,EACEC,GACA,kCACA,oDACF,IACAD,EACEC,GACA,gCACA,wFACF;GACH,CAAA;EACA;;AAET"}
|
|
@@ -2,43 +2,44 @@ import { useTr as e } from "../../../shared/hooks/useTr.js";
|
|
|
2
2
|
import { useEffect as t, useRef as n, useState as r } from "react";
|
|
3
3
|
import { Maximize as i, Pause as a, Play as o, Volume2 as s, VolumeX as c } from "lucide-react";
|
|
4
4
|
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
5
|
+
import { ThemedSelect as d } from "@burdenoff/fe-libs/ui";
|
|
5
6
|
// src/files/components/viewers/VideoPlayer.tsx
|
|
6
|
-
function
|
|
7
|
-
let
|
|
7
|
+
function f({ file: f, url: p }) {
|
|
8
|
+
let m = e(), h = n(null), [g, _] = r(!1), [v, y] = r(0), [b, x] = r(0), [S, C] = r(1), [w, T] = r(!1), [E, D] = r(1);
|
|
8
9
|
t(() => {
|
|
9
|
-
let e =
|
|
10
|
+
let e = h.current;
|
|
10
11
|
if (!e) return;
|
|
11
|
-
let t = () =>
|
|
12
|
+
let t = () => y(e.currentTime), n = () => x(e.duration), r = () => _(!1);
|
|
12
13
|
return e.addEventListener("timeupdate", t), e.addEventListener("loadedmetadata", n), e.addEventListener("ended", r), () => {
|
|
13
14
|
e.removeEventListener("timeupdate", t), e.removeEventListener("loadedmetadata", n), e.removeEventListener("ended", r);
|
|
14
15
|
};
|
|
15
16
|
}, []);
|
|
16
|
-
let
|
|
17
|
-
|
|
18
|
-
}, O = (e) => {
|
|
19
|
-
m.current && (m.current.currentTime = e, v(e));
|
|
17
|
+
let O = () => {
|
|
18
|
+
h.current && (g ? h.current.pause() : h.current.play(), _(!g));
|
|
20
19
|
}, k = (e) => {
|
|
21
|
-
|
|
22
|
-
}, A = () => {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
h.current && (h.current.currentTime = e, y(e));
|
|
21
|
+
}, A = (e) => {
|
|
22
|
+
C(e), T(e === 0), h.current && (h.current.volume = e);
|
|
23
|
+
}, j = () => {
|
|
24
|
+
if (h.current) {
|
|
25
|
+
let e = !w;
|
|
26
|
+
T(e), h.current.muted = e;
|
|
26
27
|
}
|
|
27
|
-
},
|
|
28
|
-
|
|
29
|
-
},
|
|
30
|
-
|
|
31
|
-
},
|
|
28
|
+
}, M = (e) => {
|
|
29
|
+
D(e), h.current && (h.current.playbackRate = e);
|
|
30
|
+
}, N = () => {
|
|
31
|
+
h.current && h.current.requestFullscreen();
|
|
32
|
+
}, P = (e) => `${Math.floor(e / 60)}:${Math.floor(e % 60).toString().padStart(2, "0")}`;
|
|
32
33
|
return /* @__PURE__ */ u("div", {
|
|
33
34
|
className: "flex h-full flex-col bg-bg-canvas",
|
|
34
35
|
children: [/* @__PURE__ */ l("div", {
|
|
35
36
|
className: "flex-1 flex items-center justify-center",
|
|
36
37
|
children: /* @__PURE__ */ l("video", {
|
|
37
|
-
ref:
|
|
38
|
-
src:
|
|
39
|
-
"aria-label":
|
|
38
|
+
ref: h,
|
|
39
|
+
src: p,
|
|
40
|
+
"aria-label": f.name,
|
|
40
41
|
className: "max-w-full max-h-full",
|
|
41
|
-
onClick:
|
|
42
|
+
onClick: O,
|
|
42
43
|
children: /* @__PURE__ */ l("track", { kind: "captions" })
|
|
43
44
|
})
|
|
44
45
|
}), /* @__PURE__ */ u("div", {
|
|
@@ -48,14 +49,14 @@ function d({ file: d, url: f }) {
|
|
|
48
49
|
children: [/* @__PURE__ */ l("input", {
|
|
49
50
|
type: "range",
|
|
50
51
|
min: 0,
|
|
51
|
-
max:
|
|
52
|
-
value:
|
|
53
|
-
onChange: (e) =>
|
|
54
|
-
"aria-label":
|
|
52
|
+
max: b || 0,
|
|
53
|
+
value: v,
|
|
54
|
+
onChange: (e) => k(Number(e.target.value)),
|
|
55
|
+
"aria-label": m("files.preview.video.seek", "Seek"),
|
|
55
56
|
className: "w-full h-1 bg-bg-sunken rounded-lg appearance-none cursor-pointer accent-action-primary-bg"
|
|
56
57
|
}), /* @__PURE__ */ u("div", {
|
|
57
58
|
className: "flex justify-between mt-1 text-xs text-text-secondary",
|
|
58
|
-
children: [/* @__PURE__ */ l("span", { children:
|
|
59
|
+
children: [/* @__PURE__ */ l("span", { children: P(v) }), /* @__PURE__ */ l("span", { children: P(b) })]
|
|
59
60
|
})]
|
|
60
61
|
}), /* @__PURE__ */ u("div", {
|
|
61
62
|
className: "flex items-center justify-between",
|
|
@@ -64,36 +65,36 @@ function d({ file: d, url: f }) {
|
|
|
64
65
|
children: [
|
|
65
66
|
/* @__PURE__ */ l("button", {
|
|
66
67
|
type: "button",
|
|
67
|
-
onClick:
|
|
68
|
+
onClick: O,
|
|
68
69
|
className: "p-2 text-text-primary hover:bg-action-ghost-bg-hover rounded transition-colors duration-200",
|
|
69
|
-
title:
|
|
70
|
-
"aria-label":
|
|
71
|
-
children: l(
|
|
70
|
+
title: g ? m("files.preview.video.pause", "Pause") : m("files.preview.video.play", "Play"),
|
|
71
|
+
"aria-label": g ? m("files.preview.video.pauseVideo", "Pause video") : m("files.preview.video.playVideo", "Play video"),
|
|
72
|
+
children: l(g ? a : o, { className: "size-5" })
|
|
72
73
|
}),
|
|
73
74
|
/* @__PURE__ */ u("div", {
|
|
74
75
|
className: "flex items-center gap-2",
|
|
75
76
|
children: [/* @__PURE__ */ l("button", {
|
|
76
77
|
type: "button",
|
|
77
|
-
onClick:
|
|
78
|
+
onClick: j,
|
|
78
79
|
className: "p-2 text-text-secondary hover:text-text-primary hover:bg-action-ghost-bg-hover rounded transition-colors duration-200",
|
|
79
|
-
title:
|
|
80
|
-
"aria-label":
|
|
81
|
-
children: l(
|
|
80
|
+
title: w ? m("files.preview.video.unmute", "Unmute") : m("files.preview.video.mute", "Mute"),
|
|
81
|
+
"aria-label": w ? m("files.preview.video.unmuteVideo", "Unmute video") : m("files.preview.video.muteVideo", "Mute video"),
|
|
82
|
+
children: l(w ? c : s, { className: "size-5" })
|
|
82
83
|
}), /* @__PURE__ */ l("input", {
|
|
83
84
|
type: "range",
|
|
84
85
|
min: 0,
|
|
85
86
|
max: 1,
|
|
86
87
|
step: .1,
|
|
87
|
-
value:
|
|
88
|
-
onChange: (e) =>
|
|
89
|
-
"aria-label":
|
|
88
|
+
value: S,
|
|
89
|
+
onChange: (e) => A(Number(e.target.value)),
|
|
90
|
+
"aria-label": m("files.preview.video.volume", "Volume"),
|
|
90
91
|
className: "w-20 h-1 bg-bg-sunken rounded-lg appearance-none cursor-pointer accent-action-primary-bg"
|
|
91
92
|
})]
|
|
92
93
|
}),
|
|
93
|
-
/* @__PURE__ */ u(
|
|
94
|
-
"aria-label":
|
|
95
|
-
value:
|
|
96
|
-
onChange: (e) =>
|
|
94
|
+
/* @__PURE__ */ u(d, {
|
|
95
|
+
"aria-label": m("files.preview.video.playbackRate", "Playback speed"),
|
|
96
|
+
value: E,
|
|
97
|
+
onChange: (e) => M(Number(e.target.value)),
|
|
97
98
|
className: "px-2 py-1 text-sm bg-bg-surface border border-border-default rounded text-text-primary scheme-normal dark:scheme-dark cursor-pointer [&_option]:bg-bg-surface [&_option]:text-text-primary",
|
|
98
99
|
children: [
|
|
99
100
|
/* @__PURE__ */ l("option", {
|
|
@@ -127,13 +128,13 @@ function d({ file: d, url: f }) {
|
|
|
127
128
|
className: "flex items-center gap-2",
|
|
128
129
|
children: [/* @__PURE__ */ l("span", {
|
|
129
130
|
className: "text-sm text-text-secondary",
|
|
130
|
-
children:
|
|
131
|
+
children: f.name
|
|
131
132
|
}), /* @__PURE__ */ l("button", {
|
|
132
133
|
type: "button",
|
|
133
|
-
onClick:
|
|
134
|
+
onClick: N,
|
|
134
135
|
className: "p-2 text-text-secondary hover:text-text-primary hover:bg-action-ghost-bg-hover rounded transition-colors duration-200",
|
|
135
|
-
title:
|
|
136
|
-
"aria-label":
|
|
136
|
+
title: m("files.preview.video.fullscreen", "Fullscreen"),
|
|
137
|
+
"aria-label": m("files.preview.video.openFullscreen", "Open fullscreen"),
|
|
137
138
|
children: /* @__PURE__ */ l(i, { className: "size-5" })
|
|
138
139
|
})]
|
|
139
140
|
})]
|
|
@@ -141,6 +142,6 @@ function d({ file: d, url: f }) {
|
|
|
141
142
|
})]
|
|
142
143
|
});
|
|
143
144
|
}
|
|
144
|
-
export {
|
|
145
|
+
export { f as VideoPlayer };
|
|
145
146
|
|
|
146
147
|
//# sourceMappingURL=VideoPlayer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VideoPlayer.js","names":["VideoPlayer","tr","useTr","videoRef","useRef","isPlaying","setIsPlaying","useState","currentTime","setCurrentTime","duration","setDuration","volume","setVolume","isMuted","setIsMuted","playbackRate","setPlaybackRate","video","handleTimeUpdate","handleLoadedMetadata","handleEnded","togglePlay","handleSeek","time","handleVolumeChange","newVolume","toggleMute","newMuted","handlePlaybackRateChange","rate","handleFullscreen","formatTime","seconds","url","file","jsx","Pause","Play","VolumeX","Volume2","Maximize"],"sources":["../../../../src/files/components/viewers/VideoPlayer.tsx"],"sourcesContent":["import { useState, useRef, useEffect } from \"react\";\nimport { Play, Pause, Volume2, VolumeX, Maximize } from \"lucide-react\";\nimport type { FileItem } from \"../../types\";\nimport { useTr } from \"../../../shared/hooks/useTr\";\n\ninterface VideoPlayerProps {\n file: FileItem;\n url: string;\n}\n\nexport function VideoPlayer({ file, url }: VideoPlayerProps) {\n const tr = useTr();\n const videoRef = useRef<HTMLVideoElement>(null);\n const [isPlaying, setIsPlaying] = useState(false);\n const [currentTime, setCurrentTime] = useState(0);\n const [duration, setDuration] = useState(0);\n const [volume, setVolume] = useState(1);\n const [isMuted, setIsMuted] = useState(false);\n const [playbackRate, setPlaybackRate] = useState(1);\n\n useEffect(() => {\n const video = videoRef.current;\n if (!video) return;\n\n const handleTimeUpdate = () => setCurrentTime(video.currentTime);\n const handleLoadedMetadata = () => setDuration(video.duration);\n const handleEnded = () => setIsPlaying(false);\n\n video.addEventListener(\"timeupdate\", handleTimeUpdate);\n video.addEventListener(\"loadedmetadata\", handleLoadedMetadata);\n video.addEventListener(\"ended\", handleEnded);\n\n return () => {\n video.removeEventListener(\"timeupdate\", handleTimeUpdate);\n video.removeEventListener(\"loadedmetadata\", handleLoadedMetadata);\n video.removeEventListener(\"ended\", handleEnded);\n };\n }, []);\n\n const togglePlay = () => {\n if (videoRef.current) {\n if (isPlaying) {\n videoRef.current.pause();\n } else {\n videoRef.current.play();\n }\n setIsPlaying(!isPlaying);\n }\n };\n\n const handleSeek = (time: number) => {\n if (videoRef.current) {\n videoRef.current.currentTime = time;\n setCurrentTime(time);\n }\n };\n\n const handleVolumeChange = (newVolume: number) => {\n setVolume(newVolume);\n setIsMuted(newVolume === 0);\n if (videoRef.current) {\n videoRef.current.volume = newVolume;\n }\n };\n\n const toggleMute = () => {\n if (videoRef.current) {\n const newMuted = !isMuted;\n setIsMuted(newMuted);\n videoRef.current.muted = newMuted;\n }\n };\n\n const handlePlaybackRateChange = (rate: number) => {\n setPlaybackRate(rate);\n if (videoRef.current) {\n videoRef.current.playbackRate = rate;\n }\n };\n\n const handleFullscreen = () => {\n if (videoRef.current) {\n videoRef.current.requestFullscreen();\n }\n };\n\n const formatTime = (seconds: number): string => {\n const mins = Math.floor(seconds / 60);\n const secs = Math.floor(seconds % 60);\n return `${mins}:${secs.toString().padStart(2, \"0\")}`;\n };\n\n return (\n <div className=\"flex h-full flex-col bg-bg-canvas\">\n {/* Video */}\n <div className=\"flex-1 flex items-center justify-center\">\n <video\n ref={videoRef}\n src={url}\n aria-label={file.name}\n className=\"max-w-full max-h-full\"\n onClick={togglePlay}\n >\n <track kind=\"captions\" />\n </video>\n </div>\n\n {/* Controls */}\n <div className=\"bg-bg-surface border-t border-border-default p-4\">\n {/* Progress Bar */}\n <div className=\"mb-4\">\n <input\n type=\"range\"\n min={0}\n max={duration || 0}\n value={currentTime}\n onChange={(e) => handleSeek(Number(e.target.value))}\n aria-label={tr(\"files.preview.video.seek\", \"Seek\")}\n className=\"w-full h-1 bg-bg-sunken rounded-lg appearance-none cursor-pointer accent-action-primary-bg\"\n />\n <div className=\"flex justify-between mt-1 text-xs text-text-secondary\">\n <span>{formatTime(currentTime)}</span>\n <span>{formatTime(duration)}</span>\n </div>\n </div>\n\n {/* Control Buttons */}\n <div className=\"flex items-center justify-between\">\n <div className=\"flex items-center gap-2\">\n {/* Play/Pause */}\n <button\n type=\"button\"\n onClick={togglePlay}\n className=\"p-2 text-text-primary hover:bg-action-ghost-bg-hover rounded transition-colors duration-200\"\n title={\n isPlaying\n ? tr(\"files.preview.video.pause\", \"Pause\")\n : tr(\"files.preview.video.play\", \"Play\")\n }\n aria-label={\n isPlaying\n ? tr(\"files.preview.video.pauseVideo\", \"Pause video\")\n : tr(\"files.preview.video.playVideo\", \"Play video\")\n }\n >\n {isPlaying ? (\n <Pause className=\"size-5\" />\n ) : (\n <Play className=\"size-5\" />\n )}\n </button>\n\n {/* Volume */}\n <div className=\"flex items-center gap-2\">\n <button\n type=\"button\"\n onClick={toggleMute}\n className=\"p-2 text-text-secondary hover:text-text-primary hover:bg-action-ghost-bg-hover rounded transition-colors duration-200\"\n title={\n isMuted\n ? tr(\"files.preview.video.unmute\", \"Unmute\")\n : tr(\"files.preview.video.mute\", \"Mute\")\n }\n aria-label={\n isMuted\n ? tr(\"files.preview.video.unmuteVideo\", \"Unmute video\")\n : tr(\"files.preview.video.muteVideo\", \"Mute video\")\n }\n >\n {isMuted ? (\n <VolumeX className=\"size-5\" />\n ) : (\n <Volume2 className=\"size-5\" />\n )}\n </button>\n <input\n type=\"range\"\n min={0}\n max={1}\n step={0.1}\n value={volume}\n onChange={(e) => handleVolumeChange(Number(e.target.value))}\n aria-label={tr(\"files.preview.video.volume\", \"Volume\")}\n className=\"w-20 h-1 bg-bg-sunken rounded-lg appearance-none cursor-pointer accent-action-primary-bg\"\n />\n </div>\n\n {/* Playback Speed */}\n <select\n aria-label={tr(\n \"files.preview.video.playbackRate\",\n \"Playback speed\",\n )}\n value={playbackRate}\n onChange={(e) => handlePlaybackRateChange(Number(e.target.value))}\n className=\"px-2 py-1 text-sm bg-bg-surface border border-border-default rounded text-text-primary scheme-normal dark:scheme-dark cursor-pointer [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"0.5\">0.5x</option>\n <option value=\"0.75\">0.75x</option>\n <option value=\"1\">1x</option>\n <option value=\"1.25\">1.25x</option>\n <option value=\"1.5\">1.5x</option>\n <option value=\"2\">2x</option>\n </select>\n </div>\n\n <div className=\"flex items-center gap-2\">\n <span className=\"text-sm text-text-secondary\">{file.name}</span>\n <button\n type=\"button\"\n onClick={handleFullscreen}\n className=\"p-2 text-text-secondary hover:text-text-primary hover:bg-action-ghost-bg-hover rounded transition-colors duration-200\"\n title={tr(\"files.preview.video.fullscreen\", \"Fullscreen\")}\n aria-label={tr(\n \"files.preview.video.openFullscreen\",\n \"Open fullscreen\",\n )}\n >\n <Maximize className=\"size-5\" />\n </button>\n </div>\n </div>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;AAUA,SAAgBA,EAAY,EAAE,SAAM,UAAyB;CAC3D,IAAMC,IAAKC,EAAM,GACXC,IAAWC,EAAyB,IAAI,GAC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ACV,OAAO9B,EAAG,kCAAkC,YAAY;MACxD,cAAYA,EACV,sCACA,iBACF;MAEA,UAAA,kBAACwC,GAAD,EAAU,WAAU,SAAU,CAAA;KACxB,CAAA,CACL;IACF,CAAA,CAAA;GACF,CAAA,CAAA;EACF,CAAA,CAAA;;AAET"}
|
|
1
|
+
{"version":3,"file":"VideoPlayer.js","names":["VideoPlayer","tr","useTr","videoRef","useRef","isPlaying","setIsPlaying","useState","currentTime","setCurrentTime","duration","setDuration","volume","setVolume","isMuted","setIsMuted","playbackRate","setPlaybackRate","video","handleTimeUpdate","handleLoadedMetadata","handleEnded","togglePlay","handleSeek","time","handleVolumeChange","newVolume","toggleMute","newMuted","handlePlaybackRateChange","rate","handleFullscreen","formatTime","seconds","url","file","jsx","Pause","Play","VolumeX","Volume2","ThemedSelect","Maximize"],"sources":["../../../../src/files/components/viewers/VideoPlayer.tsx"],"sourcesContent":["import { useState, useRef, useEffect } from \"react\";\nimport { Play, Pause, Volume2, VolumeX, Maximize } from \"lucide-react\";\nimport type { FileItem } from \"../../types\";\nimport { useTr } from \"../../../shared/hooks/useTr\";\nimport { ThemedSelect } from \"@burdenoff/fe-libs/ui\";\n\ninterface VideoPlayerProps {\n file: FileItem;\n url: string;\n}\n\nexport function VideoPlayer({ file, url }: VideoPlayerProps) {\n const tr = useTr();\n const videoRef = useRef<HTMLVideoElement>(null);\n const [isPlaying, setIsPlaying] = useState(false);\n const [currentTime, setCurrentTime] = useState(0);\n const [duration, setDuration] = useState(0);\n const [volume, setVolume] = useState(1);\n const [isMuted, setIsMuted] = useState(false);\n const [playbackRate, setPlaybackRate] = useState(1);\n\n useEffect(() => {\n const video = videoRef.current;\n if (!video) return;\n\n const handleTimeUpdate = () => setCurrentTime(video.currentTime);\n const handleLoadedMetadata = () => setDuration(video.duration);\n const handleEnded = () => setIsPlaying(false);\n\n video.addEventListener(\"timeupdate\", handleTimeUpdate);\n video.addEventListener(\"loadedmetadata\", handleLoadedMetadata);\n video.addEventListener(\"ended\", handleEnded);\n\n return () => {\n video.removeEventListener(\"timeupdate\", handleTimeUpdate);\n video.removeEventListener(\"loadedmetadata\", handleLoadedMetadata);\n video.removeEventListener(\"ended\", handleEnded);\n };\n }, []);\n\n const togglePlay = () => {\n if (videoRef.current) {\n if (isPlaying) {\n videoRef.current.pause();\n } else {\n videoRef.current.play();\n }\n setIsPlaying(!isPlaying);\n }\n };\n\n const handleSeek = (time: number) => {\n if (videoRef.current) {\n videoRef.current.currentTime = time;\n setCurrentTime(time);\n }\n };\n\n const handleVolumeChange = (newVolume: number) => {\n setVolume(newVolume);\n setIsMuted(newVolume === 0);\n if (videoRef.current) {\n videoRef.current.volume = newVolume;\n }\n };\n\n const toggleMute = () => {\n if (videoRef.current) {\n const newMuted = !isMuted;\n setIsMuted(newMuted);\n videoRef.current.muted = newMuted;\n }\n };\n\n const handlePlaybackRateChange = (rate: number) => {\n setPlaybackRate(rate);\n if (videoRef.current) {\n videoRef.current.playbackRate = rate;\n }\n };\n\n const handleFullscreen = () => {\n if (videoRef.current) {\n videoRef.current.requestFullscreen();\n }\n };\n\n const formatTime = (seconds: number): string => {\n const mins = Math.floor(seconds / 60);\n const secs = Math.floor(seconds % 60);\n return `${mins}:${secs.toString().padStart(2, \"0\")}`;\n };\n\n return (\n <div className=\"flex h-full flex-col bg-bg-canvas\">\n {/* Video */}\n <div className=\"flex-1 flex items-center justify-center\">\n <video\n ref={videoRef}\n src={url}\n aria-label={file.name}\n className=\"max-w-full max-h-full\"\n onClick={togglePlay}\n >\n <track kind=\"captions\" />\n </video>\n </div>\n\n {/* Controls */}\n <div className=\"bg-bg-surface border-t border-border-default p-4\">\n {/* Progress Bar */}\n <div className=\"mb-4\">\n <input\n type=\"range\"\n min={0}\n max={duration || 0}\n value={currentTime}\n onChange={(e) => handleSeek(Number(e.target.value))}\n aria-label={tr(\"files.preview.video.seek\", \"Seek\")}\n className=\"w-full h-1 bg-bg-sunken rounded-lg appearance-none cursor-pointer accent-action-primary-bg\"\n />\n <div className=\"flex justify-between mt-1 text-xs text-text-secondary\">\n <span>{formatTime(currentTime)}</span>\n <span>{formatTime(duration)}</span>\n </div>\n </div>\n\n {/* Control Buttons */}\n <div className=\"flex items-center justify-between\">\n <div className=\"flex items-center gap-2\">\n {/* Play/Pause */}\n <button\n type=\"button\"\n onClick={togglePlay}\n className=\"p-2 text-text-primary hover:bg-action-ghost-bg-hover rounded transition-colors duration-200\"\n title={\n isPlaying\n ? tr(\"files.preview.video.pause\", \"Pause\")\n : tr(\"files.preview.video.play\", \"Play\")\n }\n aria-label={\n isPlaying\n ? tr(\"files.preview.video.pauseVideo\", \"Pause video\")\n : tr(\"files.preview.video.playVideo\", \"Play video\")\n }\n >\n {isPlaying ? (\n <Pause className=\"size-5\" />\n ) : (\n <Play className=\"size-5\" />\n )}\n </button>\n\n {/* Volume */}\n <div className=\"flex items-center gap-2\">\n <button\n type=\"button\"\n onClick={toggleMute}\n className=\"p-2 text-text-secondary hover:text-text-primary hover:bg-action-ghost-bg-hover rounded transition-colors duration-200\"\n title={\n isMuted\n ? tr(\"files.preview.video.unmute\", \"Unmute\")\n : tr(\"files.preview.video.mute\", \"Mute\")\n }\n aria-label={\n isMuted\n ? tr(\"files.preview.video.unmuteVideo\", \"Unmute video\")\n : tr(\"files.preview.video.muteVideo\", \"Mute video\")\n }\n >\n {isMuted ? (\n <VolumeX className=\"size-5\" />\n ) : (\n <Volume2 className=\"size-5\" />\n )}\n </button>\n <input\n type=\"range\"\n min={0}\n max={1}\n step={0.1}\n value={volume}\n onChange={(e) => handleVolumeChange(Number(e.target.value))}\n aria-label={tr(\"files.preview.video.volume\", \"Volume\")}\n className=\"w-20 h-1 bg-bg-sunken rounded-lg appearance-none cursor-pointer accent-action-primary-bg\"\n />\n </div>\n\n {/* Playback Speed */}\n <ThemedSelect\n aria-label={tr(\n \"files.preview.video.playbackRate\",\n \"Playback speed\",\n )}\n value={playbackRate}\n onChange={(e) => handlePlaybackRateChange(Number(e.target.value))}\n className=\"px-2 py-1 text-sm bg-bg-surface border border-border-default rounded text-text-primary scheme-normal dark:scheme-dark cursor-pointer [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"0.5\">0.5x</option>\n <option value=\"0.75\">0.75x</option>\n <option value=\"1\">1x</option>\n <option value=\"1.25\">1.25x</option>\n <option value=\"1.5\">1.5x</option>\n <option value=\"2\">2x</option>\n </ThemedSelect>\n </div>\n\n <div className=\"flex items-center gap-2\">\n <span className=\"text-sm text-text-secondary\">{file.name}</span>\n <button\n type=\"button\"\n onClick={handleFullscreen}\n className=\"p-2 text-text-secondary hover:text-text-primary hover:bg-action-ghost-bg-hover rounded transition-colors duration-200\"\n title={tr(\"files.preview.video.fullscreen\", \"Fullscreen\")}\n aria-label={tr(\n \"files.preview.video.openFullscreen\",\n \"Open fullscreen\",\n )}\n >\n <Maximize className=\"size-5\" />\n </button>\n </div>\n </div>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;AAWA,SAAgBA,EAAY,EAAE,SAAM,UAAyB;CAC3D,IAAMC,IAAKC,EAAM,GACXC,IAAWC,EAAyB,IAAI,GACxC,CAACC,GAAWC,KAAgBC,EAAS,EAAK,GAC1C,CAACC,GAAaC,KAAkBF,EAAS,CAAC,GAC1C,CAACG,GAAUC,KAAeJ,EAAS,CAAC,GACpC,CAACK,GAAQC,KAAaN,EAAS,CAAC,GAChC,CAACO,GAASC,KAAcR,EAAS,EAAK,GACtC,CAACS,GAAcC,KAAmBV,EAAS,CAAC;CAElD,QAAgB;EACd,IAAMW,IAAQf,EAAS;EACvB,IAAI,CAACe,GAAO;EAEZ,IAAMC,UAAyBV,EAAeS,EAAM,WAAW,GACzDE,UAA6BT,EAAYO,EAAM,QAAQ,GACvDG,UAAoBf,EAAa,EAAK;EAM5C,OAJAY,EAAM,iBAAiB,cAAcC,CAAgB,GACrDD,EAAM,iBAAiB,kBAAkBE,CAAoB,GAC7DF,EAAM,iBAAiB,SAASG,CAAW,SAE9B;GAGX,AAFAH,EA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,WAAU;OACX,CAAA,CACE;;MAGL,kBAACwC,GAAD;OACE,cAAYxC,EACV,oCACA,gBACF;OACA,OAAOe;OACP,WAAW,MAAMa,EAAyB,OAAO,EAAE,OAAO,KAAK,CAAC;OAChE,WAAU;OAPZ,UAAA;QASE,kBAAC,UAAD;SAAQ,OAAM;SAAM,UAAA;QAAY,CAAA;QAChC,kBAAC,UAAD;SAAQ,OAAM;SAAO,UAAA;QAAa,CAAA;QAClC,kBAAC,UAAD;SAAQ,OAAM;SAAI,UAAA;QAAU,CAAA;QAC5B,kBAAC,UAAD;SAAQ,OAAM;SAAO,UAAA;QAAa,CAAA;QAClC,kBAAC,UAAD;SAAQ,OAAM;SAAM,UAAA;QAAY,CAAA;QAChC,kBAAC,UAAD;SAAQ,OAAM;SAAI,UAAA;QAAU,CAAA;OAChB;;KACX;IAEL,CAAA,GAAA,kBAAC,OAAD;KAAK,WAAU;KAAf,UAAA,CACE,kBAAC,QAAD;MAAM,WAAU;MAA+B,UAAAM,EAAK;KAAW,CAAA,GAC/D,kBAAC,UAAD;MACE,MAAK;MACL,SAASJ;MACT,WAAU;MACV,OAAO9B,EAAG,kCAAkC,YAAY;MACxD,cAAYA,EACV,sCACA,iBACF;MAEA,UAAA,kBAACyC,GAAD,EAAU,WAAU,SAAU,CAAA;KACxB,CAAA,CACL;IACF,CAAA,CAAA;GACF,CAAA,CAAA;EACF,CAAA,CAAA;;AAET"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@burdenoff/microfe-files",
|
|
3
|
-
"version": "2026.
|
|
3
|
+
"version": "2026.1119.1",
|
|
4
4
|
"description": "Burdenoff Files Microfrontend - Standalone file management module",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"imports": {
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
61
|
"@apollo/client": "^4.3.6",
|
|
62
|
-
"@burdenoff/fe-libs": "2026.
|
|
62
|
+
"@burdenoff/fe-libs": "2026.1119.2",
|
|
63
63
|
"@noble/hashes": "2.4.0",
|
|
64
64
|
"@tanstack/react-query": "^5.106.1",
|
|
65
65
|
"graphql": "^16.15.0",
|