@burdenoff/microfe-files 2026.1124.1 → 2026.1126.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/FilesRoutes.js +32 -27
- package/dist/files/FilesRoutes.js.map +1 -1
- package/dist/files/components/ConfirmDialog.js +20 -15
- package/dist/files/components/ConfirmDialog.js.map +1 -1
- package/dist/files/components/CopyDialog.js +99 -81
- package/dist/files/components/CopyDialog.js.map +1 -1
- package/dist/files/components/FileBrowser.js +124 -123
- package/dist/files/components/FileBrowser.js.map +1 -1
- package/dist/files/components/FileInfoPanel.js +109 -101
- package/dist/files/components/FileInfoPanel.js.map +1 -1
- package/dist/files/components/FileVersionPanel.js +113 -109
- package/dist/files/components/FileVersionPanel.js.map +1 -1
- package/dist/files/components/MoveDialog.js +75 -65
- package/dist/files/components/MoveDialog.js.map +1 -1
- package/dist/files/components/ShareAccessParts.js +8 -7
- package/dist/files/components/ShareAccessParts.js.map +1 -1
- package/dist/files/components/ShareDialog.js +17 -16
- package/dist/files/components/ShareDialog.js.map +1 -1
- package/dist/files/components/SharedFolderView.js +29 -26
- package/dist/files/components/SharedFolderView.js.map +1 -1
- package/dist/files/components/UploadQueue.js +1 -0
- package/dist/files/components/UploadQueue.js.map +1 -1
- package/dist/files/components/loadingSystem.d.ts +64 -0
- package/dist/files/components/loadingSystem.js +56 -0
- package/dist/files/components/loadingSystem.js.map +1 -0
- package/dist/files/pages/BrowserPage.js +495 -475
- package/dist/files/pages/BrowserPage.js.map +1 -1
- package/dist/files/pages/FilePreviewPage.d.ts +2 -0
- package/dist/files/pages/FilePreviewPage.js +47 -0
- package/dist/files/pages/FilePreviewPage.js.map +1 -0
- package/dist/files/v2/FilesPage.js +10 -9
- package/dist/files/v2/FilesPage.js.map +1 -1
- package/dist/generated/wspace-operations.js +792 -13
- package/dist/generated/wspace-operations.js.map +1 -1
- package/package.json +2 -2
|
@@ -4,190 +4,194 @@ import { tWithFallback as r } from "../utils/i18n.js";
|
|
|
4
4
|
import { useDeleteFileVersion as i, useFileVersions as a, useRestoreFileVersion as o, useVersionDownloadUrl as s } from "../hooks/useFileVersions.js";
|
|
5
5
|
import { useToast as c } from "../hooks/useToast.js";
|
|
6
6
|
import { ConfirmDialog as l } from "./ConfirmDialog.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
7
|
+
import { SectionLoaderOr as u, SpinnerIcon as d } from "./loadingSystem.js";
|
|
8
|
+
import { useState as f } from "react";
|
|
9
|
+
import { AlertCircle as p, CheckCircle2 as m, Clock as h, Download as g, RotateCcw as _, Tag as v, Trash2 as y, X as b } from "lucide-react";
|
|
10
|
+
import { Fragment as x, jsx as S, jsxs as C } from "react/jsx-runtime";
|
|
11
|
+
import { IllustratedEmptyState as w } from "@burdenoff/fe-libs/ui";
|
|
12
|
+
import { useI18n as T } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
12
13
|
// src/files/components/FileVersionPanel.tsx
|
|
13
|
-
var
|
|
14
|
-
let { t:
|
|
15
|
-
|
|
16
|
-
title: `${r(
|
|
17
|
-
description: r(
|
|
18
|
-
confirmLabel: r(
|
|
14
|
+
var E = ({ file: E, onClose: D }) => {
|
|
15
|
+
let { t: O } = T(), [k, A] = f(null), [j, M] = f(null), N = c(), { data: P, isLoading: F, error: I } = a(E.id), L = P?.versions || [], R = o(), z = i(), B = s(), V = async (e, t) => {
|
|
16
|
+
M({
|
|
17
|
+
title: `${r(O, "files.version.restoreVersion", "Restore version")} ${t}`,
|
|
18
|
+
description: r(O, "files.version.restoreDescription", "This will create a new version with the restored content."),
|
|
19
|
+
confirmLabel: r(O, "files.version.restore", "Restore"),
|
|
19
20
|
onConfirm: async () => {
|
|
20
21
|
try {
|
|
21
|
-
await
|
|
22
|
+
await R.mutateAsync({
|
|
22
23
|
versionId: e,
|
|
23
24
|
createNewVersion: !0,
|
|
24
|
-
changeMessage: `${r(
|
|
25
|
-
}),
|
|
25
|
+
changeMessage: `${r(O, "files.version.restoredFrom", "Restored from version")} ${t}`
|
|
26
|
+
}), N.success(`${r(O, "files.version.versionRestored", "Version {{number}} restored successfully", { number: t })}`);
|
|
26
27
|
} catch {
|
|
27
|
-
|
|
28
|
+
N.error(r(O, "files.version.restoreFailed", "Failed to restore version"));
|
|
28
29
|
}
|
|
29
30
|
}
|
|
30
31
|
});
|
|
31
|
-
},
|
|
32
|
-
|
|
33
|
-
title: `${r(
|
|
34
|
-
description: r(
|
|
35
|
-
confirmLabel: r(
|
|
32
|
+
}, H = async (e, t) => {
|
|
33
|
+
M({
|
|
34
|
+
title: `${r(O, "files.version.deleteVersion", "Delete version")} ${t}`,
|
|
35
|
+
description: r(O, "files.version.deleteDescription", "This action cannot be undone."),
|
|
36
|
+
confirmLabel: r(O, "files.version.deleteVersionBtn", "Delete version"),
|
|
36
37
|
variant: "danger",
|
|
37
38
|
onConfirm: async () => {
|
|
38
39
|
try {
|
|
39
|
-
await
|
|
40
|
+
await z.mutateAsync(e), N.success(`${r(O, "files.version.versionDeleted", "Version {{number}} deleted", { number: t })}`);
|
|
40
41
|
} catch {
|
|
41
|
-
|
|
42
|
+
N.error(r(O, "files.version.deleteFailed", "Failed to delete version"));
|
|
42
43
|
}
|
|
43
44
|
}
|
|
44
45
|
});
|
|
45
|
-
},
|
|
46
|
-
if (!
|
|
47
|
-
let e =
|
|
48
|
-
|
|
49
|
-
...
|
|
46
|
+
}, U = async () => {
|
|
47
|
+
if (!j || j.loading) return;
|
|
48
|
+
let e = j.onConfirm;
|
|
49
|
+
M({
|
|
50
|
+
...j,
|
|
50
51
|
loading: !0
|
|
51
|
-
}), await e(),
|
|
52
|
-
},
|
|
52
|
+
}), await e(), M(null);
|
|
53
|
+
}, W = async (e) => {
|
|
53
54
|
try {
|
|
54
|
-
let t = await
|
|
55
|
-
if (!t) throw Error(r(
|
|
55
|
+
let t = await B.getDownloadUrl(e);
|
|
56
|
+
if (!t) throw Error(r(O, "files.version.downloadUnavailable", "Version download URL is unavailable"));
|
|
56
57
|
window.open(t, "_blank", "noopener,noreferrer");
|
|
57
58
|
} catch (e) {
|
|
58
|
-
|
|
59
|
+
N.error(e instanceof Error ? e.message : r(O, "files.version.downloadFailed", "Failed to download version"));
|
|
59
60
|
}
|
|
60
61
|
};
|
|
61
|
-
return /* @__PURE__ */
|
|
62
|
+
return /* @__PURE__ */ C("div", {
|
|
62
63
|
className: "fixed inset-0 z-[110] bg-bg-overlay flex items-center justify-center p-4 animate-in fade-in duration-200",
|
|
63
64
|
role: "dialog",
|
|
64
65
|
"aria-modal": "true",
|
|
65
|
-
"aria-label": r(
|
|
66
|
-
children: [/* @__PURE__ */
|
|
66
|
+
"aria-label": r(O, "files.version.historyFor", "Version history for {{name}}", { name: E.name }),
|
|
67
|
+
children: [/* @__PURE__ */ C("div", {
|
|
67
68
|
className: "bg-bg-surface rounded-lg shadow-xl max-w-3xl w-full max-h-[90vh] overflow-hidden flex flex-col animate-in zoom-in-95 duration-200",
|
|
68
69
|
children: [
|
|
69
|
-
/* @__PURE__ */
|
|
70
|
+
/* @__PURE__ */ C("div", {
|
|
70
71
|
className: "flex items-center justify-between p-6 border-b border-border-seam",
|
|
71
|
-
children: [/* @__PURE__ */
|
|
72
|
+
children: [/* @__PURE__ */ C("div", {
|
|
72
73
|
className: "flex items-center gap-3",
|
|
73
|
-
children: [/* @__PURE__ */
|
|
74
|
+
children: [/* @__PURE__ */ S(h, { className: "size-6 text-text-link" }), /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("h2", {
|
|
74
75
|
className: "text-lg font-semibold text-text-primary",
|
|
75
|
-
children: r(
|
|
76
|
-
}), /* @__PURE__ */
|
|
76
|
+
children: r(O, "files.version.versionHistory", "Version History")
|
|
77
|
+
}), /* @__PURE__ */ S("p", {
|
|
77
78
|
className: "text-sm text-text-secondary",
|
|
78
|
-
children:
|
|
79
|
+
children: E.name
|
|
79
80
|
})] })]
|
|
80
|
-
}), /* @__PURE__ */
|
|
81
|
+
}), /* @__PURE__ */ S("button", {
|
|
81
82
|
type: "button",
|
|
82
|
-
onClick:
|
|
83
|
+
onClick: D,
|
|
83
84
|
className: "p-2 text-text-tertiary hover:text-text-secondary hover:bg-action-ghost-bg-hover rounded-lg transition-colors duration-200",
|
|
84
|
-
"aria-label": r(
|
|
85
|
-
children: /* @__PURE__ */
|
|
85
|
+
"aria-label": r(O, "files.version.closeHistory", "Close version history"),
|
|
86
|
+
children: /* @__PURE__ */ S(b, { className: "size-5" })
|
|
86
87
|
})]
|
|
87
88
|
}),
|
|
88
|
-
/* @__PURE__ */
|
|
89
|
+
/* @__PURE__ */ C("div", {
|
|
89
90
|
className: "flex-1 overflow-y-auto p-6",
|
|
90
91
|
children: [
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
92
|
+
F && /* @__PURE__ */ S(u, {
|
|
93
|
+
minHeight: "8rem",
|
|
94
|
+
today: /* @__PURE__ */ S("div", {
|
|
95
|
+
className: "flex items-center justify-center py-12",
|
|
96
|
+
children: /* @__PURE__ */ S(d, { className: "size-8 text-text-link animate-spin" })
|
|
97
|
+
})
|
|
94
98
|
}),
|
|
95
|
-
|
|
99
|
+
I && /* @__PURE__ */ S("div", {
|
|
96
100
|
className: "flex items-center justify-center py-12",
|
|
97
|
-
children: /* @__PURE__ */
|
|
101
|
+
children: /* @__PURE__ */ C("div", {
|
|
98
102
|
className: "text-center",
|
|
99
|
-
children: [/* @__PURE__ */
|
|
103
|
+
children: [/* @__PURE__ */ S(p, { className: "size-12 text-status-error-text mx-auto mb-4" }), /* @__PURE__ */ S("p", {
|
|
100
104
|
className: "text-sm text-text-secondary",
|
|
101
|
-
children: r(
|
|
105
|
+
children: r(O, "files.version.loadFailed", "Failed to load version history")
|
|
102
106
|
})]
|
|
103
107
|
})
|
|
104
108
|
}),
|
|
105
|
-
!
|
|
109
|
+
!F && !I && L.length === 0 && /* @__PURE__ */ S(w, {
|
|
106
110
|
illustration: "empty-data",
|
|
107
|
-
title: r(
|
|
108
|
-
description: r(
|
|
111
|
+
title: r(O, "files.version.noHistory", "No version history available"),
|
|
112
|
+
description: r(O, "files.version.noHistoryDescription", "New versions appear here each time this file is re-uploaded or edited, so you can review and restore earlier copies."),
|
|
109
113
|
glassIllustration: "history",
|
|
110
114
|
size: "panel"
|
|
111
115
|
}),
|
|
112
|
-
!
|
|
116
|
+
!F && !I && L.length > 0 && /* @__PURE__ */ S("div", {
|
|
113
117
|
className: "space-y-3",
|
|
114
|
-
children:
|
|
115
|
-
className: `p-4 border rounded-lg transition-all duration-200 ${i.isCurrentVersion ? "border-action-primary-border bg-bg-accent" :
|
|
116
|
-
onClick: () =>
|
|
117
|
-
children: /* @__PURE__ */
|
|
118
|
+
children: L.map((i) => /* @__PURE__ */ S("div", {
|
|
119
|
+
className: `p-4 border rounded-lg transition-all duration-200 ${i.isCurrentVersion ? "border-action-primary-border bg-bg-accent" : k === i.id ? "border-border-seam bg-bg-sunken" : "border-border-seam hover:border-border-strong hover:bg-action-ghost-bg-hover"}`,
|
|
120
|
+
onClick: () => A(i.id),
|
|
121
|
+
children: /* @__PURE__ */ C("div", {
|
|
118
122
|
className: "flex items-start justify-between gap-4",
|
|
119
|
-
children: [/* @__PURE__ */
|
|
123
|
+
children: [/* @__PURE__ */ C("div", {
|
|
120
124
|
className: "flex-1 min-w-0",
|
|
121
125
|
children: [
|
|
122
|
-
/* @__PURE__ */
|
|
126
|
+
/* @__PURE__ */ C("div", {
|
|
123
127
|
className: "flex items-center gap-2 mb-2",
|
|
124
128
|
children: [
|
|
125
|
-
/* @__PURE__ */
|
|
129
|
+
/* @__PURE__ */ C("span", {
|
|
126
130
|
className: "text-sm font-semibold text-text-primary",
|
|
127
131
|
children: [
|
|
128
|
-
r(
|
|
132
|
+
r(O, "files.version.version", "Version"),
|
|
129
133
|
" ",
|
|
130
134
|
i.versionNumber
|
|
131
135
|
]
|
|
132
136
|
}),
|
|
133
|
-
i.isCurrentVersion && /* @__PURE__ */
|
|
137
|
+
i.isCurrentVersion && /* @__PURE__ */ C("span", {
|
|
134
138
|
className: "inline-flex items-center gap-1 px-2 py-0.5 bg-action-primary-bg text-text-inverse text-xs font-medium rounded",
|
|
135
|
-
children: [/* @__PURE__ */
|
|
139
|
+
children: [/* @__PURE__ */ S(m, { className: "size-3" }), r(O, "files.version.current", "Current")]
|
|
136
140
|
}),
|
|
137
|
-
i.isMajorVersion && /* @__PURE__ */
|
|
141
|
+
i.isMajorVersion && /* @__PURE__ */ C("span", {
|
|
138
142
|
className: "inline-flex items-center gap-1 px-2 py-0.5 bg-status-info-bg-subtle text-status-info-text text-xs font-medium rounded",
|
|
139
|
-
children: [/* @__PURE__ */
|
|
143
|
+
children: [/* @__PURE__ */ S(v, { className: "size-3" }), r(O, "files.version.major", "Major")]
|
|
140
144
|
}),
|
|
141
|
-
i.versionLabel && /* @__PURE__ */
|
|
145
|
+
i.versionLabel && /* @__PURE__ */ S("span", {
|
|
142
146
|
className: "inline-flex items-center px-2 py-0.5 bg-status-success-bg-subtle text-status-success-text text-xs font-medium rounded",
|
|
143
147
|
children: i.versionLabel
|
|
144
148
|
})
|
|
145
149
|
]
|
|
146
150
|
}),
|
|
147
|
-
i.changeMessage && /* @__PURE__ */
|
|
151
|
+
i.changeMessage && /* @__PURE__ */ S("p", {
|
|
148
152
|
className: "text-sm text-text-primary mb-2",
|
|
149
153
|
children: i.changeMessage
|
|
150
154
|
}),
|
|
151
|
-
/* @__PURE__ */
|
|
155
|
+
/* @__PURE__ */ C("div", {
|
|
152
156
|
className: "flex items-center gap-4 text-xs text-text-secondary",
|
|
153
157
|
children: [
|
|
154
|
-
/* @__PURE__ */
|
|
158
|
+
/* @__PURE__ */ S("span", {
|
|
155
159
|
className: "tabular-nums",
|
|
156
160
|
children: n(e(i.size))
|
|
157
161
|
}),
|
|
158
|
-
/* @__PURE__ */
|
|
159
|
-
/* @__PURE__ */
|
|
162
|
+
/* @__PURE__ */ S("span", { children: "•" }),
|
|
163
|
+
/* @__PURE__ */ S("span", { children: t(i.createdAt) })
|
|
160
164
|
]
|
|
161
165
|
})
|
|
162
166
|
]
|
|
163
|
-
}), /* @__PURE__ */
|
|
167
|
+
}), /* @__PURE__ */ C("div", {
|
|
164
168
|
className: "flex items-center gap-2",
|
|
165
|
-
children: [/* @__PURE__ */
|
|
169
|
+
children: [/* @__PURE__ */ S("button", {
|
|
166
170
|
type: "button",
|
|
167
171
|
onClick: (e) => {
|
|
168
|
-
e.stopPropagation(),
|
|
172
|
+
e.stopPropagation(), W(i.id);
|
|
169
173
|
},
|
|
170
174
|
className: "p-2 text-text-secondary hover:text-text-link hover:bg-bg-accent rounded-lg transition-colors duration-200",
|
|
171
|
-
title: r(
|
|
172
|
-
children: /* @__PURE__ */
|
|
173
|
-
}), !i.isCurrentVersion && /* @__PURE__ */
|
|
175
|
+
title: r(O, "files.version.downloadThisVersion", "Download this version"),
|
|
176
|
+
children: /* @__PURE__ */ S(g, { className: "size-4" })
|
|
177
|
+
}), !i.isCurrentVersion && /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ S("button", {
|
|
174
178
|
type: "button",
|
|
175
179
|
onClick: (e) => {
|
|
176
|
-
e.stopPropagation(),
|
|
180
|
+
e.stopPropagation(), V(i.id, i.versionNumber);
|
|
177
181
|
},
|
|
178
|
-
disabled:
|
|
182
|
+
disabled: R.isPending,
|
|
179
183
|
className: "p-2 text-text-secondary hover:text-status-success-text hover:bg-status-success-bg-subtle rounded-lg transition-colors duration-200 disabled:opacity-50 disabled:cursor-not-allowed",
|
|
180
|
-
title: r(
|
|
181
|
-
children:
|
|
182
|
-
}), /* @__PURE__ */
|
|
184
|
+
title: r(O, "files.version.restoreThisVersion", "Restore this version"),
|
|
185
|
+
children: R.isPending ? /* @__PURE__ */ S(d, { className: "size-4 animate-spin" }) : /* @__PURE__ */ S(_, { className: "size-4" })
|
|
186
|
+
}), /* @__PURE__ */ S("button", {
|
|
183
187
|
type: "button",
|
|
184
188
|
onClick: (e) => {
|
|
185
|
-
e.stopPropagation(),
|
|
189
|
+
e.stopPropagation(), H(i.id, i.versionNumber);
|
|
186
190
|
},
|
|
187
|
-
disabled:
|
|
191
|
+
disabled: z.isPending,
|
|
188
192
|
className: "p-2 text-text-secondary hover:text-status-error-text hover:bg-status-error-bg-subtle rounded-lg transition-colors duration-200 disabled:opacity-50 disabled:cursor-not-allowed",
|
|
189
|
-
title: r(
|
|
190
|
-
children:
|
|
193
|
+
title: r(O, "files.version.deleteThisVersion", "Delete this version"),
|
|
194
|
+
children: z.isPending ? /* @__PURE__ */ S(d, { className: "size-4 animate-spin" }) : /* @__PURE__ */ S(y, { className: "size-4" })
|
|
191
195
|
})] })]
|
|
192
196
|
})]
|
|
193
197
|
})
|
|
@@ -195,39 +199,39 @@ var T = ({ file: T, onClose: E }) => {
|
|
|
195
199
|
})
|
|
196
200
|
]
|
|
197
201
|
}),
|
|
198
|
-
/* @__PURE__ */
|
|
202
|
+
/* @__PURE__ */ S("div", {
|
|
199
203
|
className: "p-6 border-t border-border-seam bg-bg-sunken",
|
|
200
|
-
children: /* @__PURE__ */
|
|
204
|
+
children: /* @__PURE__ */ C("div", {
|
|
201
205
|
className: "flex items-center justify-between text-sm text-text-secondary",
|
|
202
|
-
children: [/* @__PURE__ */
|
|
203
|
-
|
|
206
|
+
children: [/* @__PURE__ */ C("span", { children: [
|
|
207
|
+
P?.total || 0,
|
|
204
208
|
" ",
|
|
205
|
-
|
|
209
|
+
P?.total === 1 ? r(O, "files.version.versionSingular", "version") : r(O, "files.version.versions", "versions"),
|
|
206
210
|
" ",
|
|
207
|
-
r(
|
|
208
|
-
] }), /* @__PURE__ */
|
|
211
|
+
r(O, "files.version.total", "total")
|
|
212
|
+
] }), /* @__PURE__ */ S("button", {
|
|
209
213
|
type: "button",
|
|
210
|
-
onClick:
|
|
214
|
+
onClick: D,
|
|
211
215
|
className: "px-4 py-2 text-sm font-medium text-text-primary hover:bg-action-ghost-bg-hover rounded-lg transition-colors duration-200",
|
|
212
|
-
children: r(
|
|
216
|
+
children: r(O, "files.common.actions.close", "Close")
|
|
213
217
|
})]
|
|
214
218
|
})
|
|
215
219
|
})
|
|
216
220
|
]
|
|
217
|
-
}),
|
|
218
|
-
title:
|
|
219
|
-
description:
|
|
220
|
-
confirmLabel:
|
|
221
|
-
cancelLabel: r(
|
|
222
|
-
variant:
|
|
223
|
-
loading:
|
|
224
|
-
onConfirm:
|
|
221
|
+
}), j && /* @__PURE__ */ S(l, {
|
|
222
|
+
title: j.title,
|
|
223
|
+
description: j.description,
|
|
224
|
+
confirmLabel: j.confirmLabel,
|
|
225
|
+
cancelLabel: r(O, "files.common.actions.cancel", "Cancel"),
|
|
226
|
+
variant: j.variant,
|
|
227
|
+
loading: j.loading,
|
|
228
|
+
onConfirm: U,
|
|
225
229
|
onCancel: () => {
|
|
226
|
-
|
|
230
|
+
j.loading || M(null);
|
|
227
231
|
}
|
|
228
232
|
})]
|
|
229
233
|
});
|
|
230
234
|
};
|
|
231
|
-
export {
|
|
235
|
+
export { E as FileVersionPanel };
|
|
232
236
|
|
|
233
237
|
//# sourceMappingURL=FileVersionPanel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileVersionPanel.js","names":["_Fragment","FileVersionPanel","useI18n","selectedVersionId","setSelectedVersionId","useState","confirmAction","setConfirmAction","toast","useToast","versionsData","useFileVersions","file","versions","restoreMutation","useRestoreFileVersion","deleteMutation","useDeleteFileVersion","versionDownload","useVersionDownloadUrl","handleRestore","tWithFallback","t","versionNumber","handleDelete","versionId","runConfirmAction","action","handleDownload","downloadUrl","error","Clock","onClose","X","isLoading","Loader2","AlertCircle","IllustratedEmptyState","version","CheckCircle2","Tag","formatFileSize","browserFileSize","formatFileDate","Download","Fragment","RotateCcw","Trash2","ConfirmDialog"],"sources":["../../../src/files/components/FileVersionPanel.tsx"],"sourcesContent":["import { browserFileSize } from \"../utils/fileViewModel\";\nimport { type FC, useState } from \"react\";\nimport {\n Clock,\n Download,\n RotateCcw,\n Trash2,\n X,\n CheckCircle2,\n AlertCircle,\n Loader2,\n Tag,\n} from \"lucide-react\";\nimport { useI18n } from \"@burdenoff/fe-libs/shared/providers/shell/I18nProvider\";\nimport { IllustratedEmptyState } from \"@burdenoff/fe-libs/ui\";\nimport type { FileItem } from \"../types\";\nimport { formatFileSize, formatFileDate } from \"../utils\";\nimport { tWithFallback } from \"../utils/i18n\";\nimport {\n useFileVersions,\n useRestoreFileVersion,\n useDeleteFileVersion,\n useVersionDownloadUrl,\n} from \"../hooks/useFileVersions\";\nimport { useToast } from \"../hooks/useToast\";\nimport { ConfirmDialog } from \"./ConfirmDialog\";\n\ninterface FileVersionPanelProps {\n file: FileItem;\n onClose: () => void;\n}\n\nexport const FileVersionPanel: FC<FileVersionPanelProps> = ({\n file,\n onClose,\n}) => {\n const { t } = useI18n();\n const [selectedVersionId, setSelectedVersionId] = useState<string | null>(\n null,\n );\n const [confirmAction, setConfirmAction] = useState<{\n title: string;\n description: string;\n confirmLabel: string;\n variant?: \"danger\" | \"default\";\n onConfirm: () => Promise<void>;\n loading?: boolean;\n } | null>(null);\n const toast = useToast();\n\n // Fetch versions\n const { data: versionsData, isLoading, error } = useFileVersions(file.id);\n const versions = versionsData?.versions || [];\n\n // Mutations\n const restoreMutation = useRestoreFileVersion();\n const deleteMutation = useDeleteFileVersion();\n const versionDownload = useVersionDownloadUrl();\n\n const handleRestore = async (versionId: string, versionNumber: number) => {\n setConfirmAction({\n title: `${tWithFallback(t, \"files.version.restoreVersion\", \"Restore version\")} ${versionNumber}`,\n description: tWithFallback(\n t,\n \"files.version.restoreDescription\",\n \"This will create a new version with the restored content.\",\n ),\n confirmLabel: tWithFallback(t, \"files.version.restore\", \"Restore\"),\n onConfirm: async () => {\n try {\n await restoreMutation.mutateAsync({\n versionId,\n createNewVersion: true,\n changeMessage: `${tWithFallback(t, \"files.version.restoredFrom\", \"Restored from version\")} ${versionNumber}`,\n });\n toast.success(\n `${tWithFallback(t, \"files.version.versionRestored\", \"Version {{number}} restored successfully\", { number: versionNumber })}`,\n );\n } catch {\n toast.error(\n tWithFallback(\n t,\n \"files.version.restoreFailed\",\n \"Failed to restore version\",\n ),\n );\n }\n },\n });\n };\n\n const handleDelete = async (versionId: string, versionNumber: number) => {\n setConfirmAction({\n title: `${tWithFallback(t, \"files.version.deleteVersion\", \"Delete version\")} ${versionNumber}`,\n description: tWithFallback(\n t,\n \"files.version.deleteDescription\",\n \"This action cannot be undone.\",\n ),\n confirmLabel: tWithFallback(\n t,\n \"files.version.deleteVersionBtn\",\n \"Delete version\",\n ),\n variant: \"danger\",\n onConfirm: async () => {\n try {\n await deleteMutation.mutateAsync(versionId);\n toast.success(\n `${tWithFallback(t, \"files.version.versionDeleted\", \"Version {{number}} deleted\", { number: versionNumber })}`,\n );\n } catch {\n toast.error(\n tWithFallback(\n t,\n \"files.version.deleteFailed\",\n \"Failed to delete version\",\n ),\n );\n }\n },\n });\n };\n\n const runConfirmAction = async () => {\n if (!confirmAction || confirmAction.loading) return;\n\n const action = confirmAction.onConfirm;\n setConfirmAction({ ...confirmAction, loading: true });\n await action();\n setConfirmAction(null);\n };\n\n const handleDownload = async (versionId: string) => {\n try {\n const downloadUrl = await versionDownload.getDownloadUrl(versionId);\n\n if (!downloadUrl) {\n throw new Error(\n tWithFallback(\n t,\n \"files.version.downloadUnavailable\",\n \"Version download URL is unavailable\",\n ),\n );\n }\n\n window.open(downloadUrl, \"_blank\", \"noopener,noreferrer\");\n } catch (error) {\n toast.error(\n error instanceof Error\n ? error.message\n : tWithFallback(\n t,\n \"files.version.downloadFailed\",\n \"Failed to download version\",\n ),\n );\n }\n };\n\n return (\n <div\n className=\"fixed inset-0 z-[110] bg-bg-overlay flex items-center justify-center p-4 animate-in fade-in duration-200\"\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label={tWithFallback(\n t,\n \"files.version.historyFor\",\n \"Version history for {{name}}\",\n { name: file.name },\n )}\n >\n <div className=\"bg-bg-surface rounded-lg shadow-xl max-w-3xl w-full max-h-[90vh] overflow-hidden flex flex-col animate-in zoom-in-95 duration-200\">\n {/* Header */}\n <div className=\"flex items-center justify-between p-6 border-b border-border-seam\">\n <div className=\"flex items-center gap-3\">\n <Clock className=\"size-6 text-text-link\" />\n <div>\n <h2 className=\"text-lg font-semibold text-text-primary\">\n {tWithFallback(\n t,\n \"files.version.versionHistory\",\n \"Version History\",\n )}\n </h2>\n <p className=\"text-sm text-text-secondary\">{file.name}</p>\n </div>\n </div>\n <button\n type=\"button\"\n onClick={onClose}\n className=\"p-2 text-text-tertiary hover:text-text-secondary hover:bg-action-ghost-bg-hover rounded-lg transition-colors duration-200\"\n aria-label={tWithFallback(\n t,\n \"files.version.closeHistory\",\n \"Close version history\",\n )}\n >\n <X className=\"size-5\" />\n </button>\n </div>\n\n {/* Content */}\n <div className=\"flex-1 overflow-y-auto p-6\">\n {isLoading && (\n <div className=\"flex items-center justify-center py-12\">\n <Loader2 className=\"size-8 text-text-link animate-spin\" />\n </div>\n )}\n\n {error && (\n <div className=\"flex items-center justify-center py-12\">\n <div className=\"text-center\">\n <AlertCircle className=\"size-12 text-status-error-text mx-auto mb-4\" />\n <p className=\"text-sm text-text-secondary\">\n {tWithFallback(\n t,\n \"files.version.loadFailed\",\n \"Failed to load version history\",\n )}\n </p>\n </div>\n </div>\n )}\n\n {!isLoading && !error && versions.length === 0 && (\n <IllustratedEmptyState\n illustration=\"empty-data\"\n title={tWithFallback(\n t,\n \"files.version.noHistory\",\n \"No version history available\",\n )}\n description={tWithFallback(\n t,\n \"files.version.noHistoryDescription\",\n \"New versions appear here each time this file is re-uploaded or edited, so you can review and restore earlier copies.\",\n )}\n glassIllustration=\"history\"\n size=\"panel\"\n />\n )}\n\n {!isLoading && !error && versions.length > 0 && (\n <div className=\"space-y-3\">\n {versions.map((version: (typeof versions)[number]) => (\n <div\n key={version.id}\n className={`p-4 border rounded-lg transition-all duration-200 ${\n version.isCurrentVersion\n ? \"border-action-primary-border bg-bg-accent\"\n : selectedVersionId === version.id\n ? \"border-border-seam bg-bg-sunken\"\n : \"border-border-seam hover:border-border-strong hover:bg-action-ghost-bg-hover\"\n }`}\n onClick={() => setSelectedVersionId(version.id)}\n >\n <div className=\"flex items-start justify-between gap-4\">\n {/* Version info */}\n <div className=\"flex-1 min-w-0\">\n <div className=\"flex items-center gap-2 mb-2\">\n <span className=\"text-sm font-semibold text-text-primary\">\n {tWithFallback(t, \"files.version.version\", \"Version\")}{\" \"}\n {version.versionNumber}\n </span>\n\n {version.isCurrentVersion && (\n <span className=\"inline-flex items-center gap-1 px-2 py-0.5 bg-action-primary-bg text-text-inverse text-xs font-medium rounded\">\n <CheckCircle2 className=\"size-3\" />\n {tWithFallback(\n t,\n \"files.version.current\",\n \"Current\",\n )}\n </span>\n )}\n\n {version.isMajorVersion && (\n <span className=\"inline-flex items-center gap-1 px-2 py-0.5 bg-status-info-bg-subtle text-status-info-text text-xs font-medium rounded\">\n <Tag className=\"size-3\" />\n {tWithFallback(t, \"files.version.major\", \"Major\")}\n </span>\n )}\n\n {version.versionLabel && (\n <span className=\"inline-flex items-center px-2 py-0.5 bg-status-success-bg-subtle text-status-success-text text-xs font-medium rounded\">\n {version.versionLabel}\n </span>\n )}\n </div>\n\n {version.changeMessage && (\n <p className=\"text-sm text-text-primary mb-2\">\n {version.changeMessage}\n </p>\n )}\n\n <div className=\"flex items-center gap-4 text-xs text-text-secondary\">\n <span className=\"tabular-nums\">\n {formatFileSize(browserFileSize(version.size))}\n </span>\n <span>•</span>\n <span>{formatFileDate(version.createdAt)}</span>\n </div>\n </div>\n\n {/* Actions */}\n <div className=\"flex items-center gap-2\">\n <button\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation();\n handleDownload(version.id);\n }}\n className=\"p-2 text-text-secondary hover:text-text-link hover:bg-bg-accent rounded-lg transition-colors duration-200\"\n title={tWithFallback(\n t,\n \"files.version.downloadThisVersion\",\n \"Download this version\",\n )}\n >\n <Download className=\"size-4\" />\n </button>\n\n {!version.isCurrentVersion && (\n <>\n <button\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation();\n handleRestore(version.id, version.versionNumber);\n }}\n disabled={restoreMutation.isPending}\n className=\"p-2 text-text-secondary hover:text-status-success-text hover:bg-status-success-bg-subtle rounded-lg transition-colors duration-200 disabled:opacity-50 disabled:cursor-not-allowed\"\n title={tWithFallback(\n t,\n \"files.version.restoreThisVersion\",\n \"Restore this version\",\n )}\n >\n {restoreMutation.isPending ? (\n <Loader2 className=\"size-4 animate-spin\" />\n ) : (\n <RotateCcw className=\"size-4\" />\n )}\n </button>\n\n <button\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation();\n handleDelete(version.id, version.versionNumber);\n }}\n disabled={deleteMutation.isPending}\n className=\"p-2 text-text-secondary hover:text-status-error-text hover:bg-status-error-bg-subtle rounded-lg transition-colors duration-200 disabled:opacity-50 disabled:cursor-not-allowed\"\n title={tWithFallback(\n t,\n \"files.version.deleteThisVersion\",\n \"Delete this version\",\n )}\n >\n {deleteMutation.isPending ? (\n <Loader2 className=\"size-4 animate-spin\" />\n ) : (\n <Trash2 className=\"size-4\" />\n )}\n </button>\n </>\n )}\n </div>\n </div>\n </div>\n ))}\n </div>\n )}\n </div>\n\n {/* Footer */}\n <div className=\"p-6 border-t border-border-seam bg-bg-sunken\">\n <div className=\"flex items-center justify-between text-sm text-text-secondary\">\n <span>\n {versionsData?.total || 0}{\" \"}\n {versionsData?.total !== 1\n ? tWithFallback(t, \"files.version.versions\", \"versions\")\n : tWithFallback(\n t,\n \"files.version.versionSingular\",\n \"version\",\n )}{\" \"}\n {tWithFallback(t, \"files.version.total\", \"total\")}\n </span>\n <button\n type=\"button\"\n onClick={onClose}\n className=\"px-4 py-2 text-sm font-medium text-text-primary hover:bg-action-ghost-bg-hover rounded-lg transition-colors duration-200\"\n >\n {tWithFallback(t, \"files.common.actions.close\", \"Close\")}\n </button>\n </div>\n </div>\n </div>\n\n {confirmAction && (\n <ConfirmDialog\n title={confirmAction.title}\n description={confirmAction.description}\n confirmLabel={confirmAction.confirmLabel}\n cancelLabel={tWithFallback(\n t,\n \"files.common.actions.cancel\",\n \"Cancel\",\n )}\n variant={confirmAction.variant}\n loading={confirmAction.loading}\n onConfirm={runConfirmAction}\n onCancel={() => {\n if (!confirmAction.loading) {\n setConfirmAction(null);\n }\n }}\n />\n )}\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;AAgCA,IAAaC,KAA+C,EAC1D,SACA,iBACI;CACJ,IAAM,EAAE,SAAMC,EAAQ,GAChB,CAACC,GAAmBC,KAAwBC,EAChD,IACF,GACM,CAACC,GAAeC,KAAoBF,EAOhC,IAAI,GACRG,IAAQC,EAAS,GAGjB,EAAE,MAAMC,GAAc,cAAW,aAAUC,EAAgBC,EAAK,EAAE,GAClEC,IAAWH,GAAc,YAAY,CAAC,GAGtCI,IAAkBC,EAAsB,GACxCC,IAAiBC,EAAqB,GACtCC,IAAkBC,EAAsB,GAExCC,IAAgB,OAAO,GAAmB,MAA0B;EACxE,EAAiB;GACf,OAAO,GAAGC,EAAcC,GAAG,gCAAgC,iBAAiB,EAAE,GAAGC;GACjF,aAAaF,EACXC,GACA,oCACA,2DACF;GACA,cAAcD,EAAcC,GAAG,yBAAyB,SAAS;GACjE,WAAW,YAAY;IACrB,IAAI;KAMF,AALA,MAAMR,EAAgB,YAAY;MAChC;MACA,kBAAkB;MAClB,eAAe,GAAGO,EAAcC,GAAG,8BAA8B,uBAAuB,EAAE,GAAGC;KAC/F,CAAC,GACDf,EAAM,QACJ,GAAGa,EAAcC,GAAG,iCAAiC,4CAA4C,EAAE,QAAQC,EAAc,CAAC,GAC5H;IACF,QAAQ;KACN,EAAM,MACJF,EACEC,GACA,+BACA,2BACF,CACF;IACF;GACF;EACF,CAAC;CACH,GAEME,IAAe,OAAO,GAAmB,MAA0B;EACvE,EAAiB;GACf,OAAO,GAAGH,EAAcC,GAAG,+BAA+B,gBAAgB,EAAE,GAAGC;GAC/E,aAAaF,EACXC,GACA,mCACA,+B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AACqB,GAAD,EAAS,WAAU,sBAAuB,CAAA,IAE1C,kBAACW,GAAD,EAAW,WAAU,SAAU,CAAA;UAE3B,CAAA,GAER,kBAAC,UAAD;WACE,MAAK;WACL,UAAU,MAAM;YAEd,AADA,EAAE,gBAAgB,GAClBtB,EAAac,EAAQ,IAAIA,EAAQ,aAAa;WAChD;WACA,UAAUtB,EAAe;WACzB,WAAU;WACV,OAAOK,EACLC,GACA,mCACA,qBACF;WAEC,UAAAN,EAAe,YACd,kBAACmB,GAAD,EAAS,WAAU,sBAAuB,CAAA,IAE1C,kBAACY,GAAD,EAAQ,WAAU,SAAU,CAAA;UAExB,CAAA,CACR,EAAA,CAAA,CAED;SACF,CAAA,CAAA;;OACF,GA5HET,EAAQ,EA4HV,CACN;MACE,CAAA;KAEJ;;IAGL,kBAAC,OAAD;KAAK,WAAU;KACb,UAAA,kBAAC,OAAD;MAAK,WAAU;MAAf,UAAA,CACE,kBAAC,QAAD,EAAA,UAAA;OACG5B,GAAc,SAAS;OAAG;OAC1BA,GAAc,UAAU,IAErBW,EACEC,GACA,iCACA,SACF,IALAD,EAAcC,GAAG,0BAA0B,UAAU;OAKlD;OACND,EAAcC,GAAG,uBAAuB,OAAO;MAC5C,EAAA,CAAA,GACN,kBAAC,UAAD;OACE,MAAK;OACL,SAASU;OACT,WAAU;OAET,UAAAX,EAAcC,GAAG,8BAA8B,OAAO;MACjD,CAAA,CACL;;IACF,CAAA;GACF;EAEJ,CAAA,GAAAhB,KACC,kBAAC0C,GAAD;GACE,OAAO1C,EAAc;GACrB,aAAaA,EAAc;GAC3B,cAAcA,EAAc;GAC5B,aAAae,EACXC,GACA,+BACA,QACF;GACA,SAAShB,EAAc;GACvB,SAASA,EAAc;GACvB,WAAWoB;GACX,gBAAgB;IACd,AAAKpB,EAAc,WACjBC,EAAiB,IAAI;GAEzB;EACD,CAAA,CAEA;;AAET"}
|
|
1
|
+
{"version":3,"file":"FileVersionPanel.js","names":["_Fragment","FileVersionPanel","useI18n","selectedVersionId","setSelectedVersionId","useState","confirmAction","setConfirmAction","toast","useToast","versionsData","useFileVersions","file","versions","restoreMutation","useRestoreFileVersion","deleteMutation","useDeleteFileVersion","versionDownload","useVersionDownloadUrl","handleRestore","tWithFallback","t","versionNumber","handleDelete","versionId","runConfirmAction","action","handleDownload","downloadUrl","error","Clock","onClose","X","isLoading","SectionLoaderOr","SpinnerIcon","AlertCircle","IllustratedEmptyState","version","CheckCircle2","Tag","formatFileSize","browserFileSize","formatFileDate","Download","Fragment","RotateCcw","Trash2","ConfirmDialog"],"sources":["../../../src/files/components/FileVersionPanel.tsx"],"sourcesContent":["import { browserFileSize } from \"../utils/fileViewModel\";\nimport { type FC, useState } from \"react\";\nimport {\n Clock,\n Download,\n RotateCcw,\n Trash2,\n X,\n CheckCircle2,\n AlertCircle,\n Tag,\n} from \"lucide-react\";\nimport { useI18n } from \"@burdenoff/fe-libs/shared/providers/shell/I18nProvider\";\nimport { IllustratedEmptyState } from \"@burdenoff/fe-libs/ui\";\nimport type { FileItem } from \"../types\";\nimport { formatFileSize, formatFileDate } from \"../utils\";\nimport { tWithFallback } from \"../utils/i18n\";\nimport {\n useFileVersions,\n useRestoreFileVersion,\n useDeleteFileVersion,\n useVersionDownloadUrl,\n} from \"../hooks/useFileVersions\";\nimport { useToast } from \"../hooks/useToast\";\nimport { ConfirmDialog } from \"./ConfirmDialog\";\nimport { SectionLoaderOr, SpinnerIcon } from \"./loadingSystem\";\n\ninterface FileVersionPanelProps {\n file: FileItem;\n onClose: () => void;\n}\n\nexport const FileVersionPanel: FC<FileVersionPanelProps> = ({\n file,\n onClose,\n}) => {\n const { t } = useI18n();\n const [selectedVersionId, setSelectedVersionId] = useState<string | null>(\n null,\n );\n const [confirmAction, setConfirmAction] = useState<{\n title: string;\n description: string;\n confirmLabel: string;\n variant?: \"danger\" | \"default\";\n onConfirm: () => Promise<void>;\n loading?: boolean;\n } | null>(null);\n const toast = useToast();\n\n // Fetch versions\n const { data: versionsData, isLoading, error } = useFileVersions(file.id);\n const versions = versionsData?.versions || [];\n\n // Mutations\n const restoreMutation = useRestoreFileVersion();\n const deleteMutation = useDeleteFileVersion();\n const versionDownload = useVersionDownloadUrl();\n\n const handleRestore = async (versionId: string, versionNumber: number) => {\n setConfirmAction({\n title: `${tWithFallback(t, \"files.version.restoreVersion\", \"Restore version\")} ${versionNumber}`,\n description: tWithFallback(\n t,\n \"files.version.restoreDescription\",\n \"This will create a new version with the restored content.\",\n ),\n confirmLabel: tWithFallback(t, \"files.version.restore\", \"Restore\"),\n onConfirm: async () => {\n try {\n await restoreMutation.mutateAsync({\n versionId,\n createNewVersion: true,\n changeMessage: `${tWithFallback(t, \"files.version.restoredFrom\", \"Restored from version\")} ${versionNumber}`,\n });\n toast.success(\n `${tWithFallback(t, \"files.version.versionRestored\", \"Version {{number}} restored successfully\", { number: versionNumber })}`,\n );\n } catch {\n toast.error(\n tWithFallback(\n t,\n \"files.version.restoreFailed\",\n \"Failed to restore version\",\n ),\n );\n }\n },\n });\n };\n\n const handleDelete = async (versionId: string, versionNumber: number) => {\n setConfirmAction({\n title: `${tWithFallback(t, \"files.version.deleteVersion\", \"Delete version\")} ${versionNumber}`,\n description: tWithFallback(\n t,\n \"files.version.deleteDescription\",\n \"This action cannot be undone.\",\n ),\n confirmLabel: tWithFallback(\n t,\n \"files.version.deleteVersionBtn\",\n \"Delete version\",\n ),\n variant: \"danger\",\n onConfirm: async () => {\n try {\n await deleteMutation.mutateAsync(versionId);\n toast.success(\n `${tWithFallback(t, \"files.version.versionDeleted\", \"Version {{number}} deleted\", { number: versionNumber })}`,\n );\n } catch {\n toast.error(\n tWithFallback(\n t,\n \"files.version.deleteFailed\",\n \"Failed to delete version\",\n ),\n );\n }\n },\n });\n };\n\n const runConfirmAction = async () => {\n if (!confirmAction || confirmAction.loading) return;\n\n const action = confirmAction.onConfirm;\n setConfirmAction({ ...confirmAction, loading: true });\n await action();\n setConfirmAction(null);\n };\n\n const handleDownload = async (versionId: string) => {\n try {\n const downloadUrl = await versionDownload.getDownloadUrl(versionId);\n\n if (!downloadUrl) {\n throw new Error(\n tWithFallback(\n t,\n \"files.version.downloadUnavailable\",\n \"Version download URL is unavailable\",\n ),\n );\n }\n\n window.open(downloadUrl, \"_blank\", \"noopener,noreferrer\");\n } catch (error) {\n toast.error(\n error instanceof Error\n ? error.message\n : tWithFallback(\n t,\n \"files.version.downloadFailed\",\n \"Failed to download version\",\n ),\n );\n }\n };\n\n return (\n <div\n className=\"fixed inset-0 z-[110] bg-bg-overlay flex items-center justify-center p-4 animate-in fade-in duration-200\"\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label={tWithFallback(\n t,\n \"files.version.historyFor\",\n \"Version history for {{name}}\",\n { name: file.name },\n )}\n >\n <div className=\"bg-bg-surface rounded-lg shadow-xl max-w-3xl w-full max-h-[90vh] overflow-hidden flex flex-col animate-in zoom-in-95 duration-200\">\n {/* Header */}\n <div className=\"flex items-center justify-between p-6 border-b border-border-seam\">\n <div className=\"flex items-center gap-3\">\n <Clock className=\"size-6 text-text-link\" />\n <div>\n <h2 className=\"text-lg font-semibold text-text-primary\">\n {tWithFallback(\n t,\n \"files.version.versionHistory\",\n \"Version History\",\n )}\n </h2>\n <p className=\"text-sm text-text-secondary\">{file.name}</p>\n </div>\n </div>\n <button\n type=\"button\"\n onClick={onClose}\n className=\"p-2 text-text-tertiary hover:text-text-secondary hover:bg-action-ghost-bg-hover rounded-lg transition-colors duration-200\"\n aria-label={tWithFallback(\n t,\n \"files.version.closeHistory\",\n \"Close version history\",\n )}\n >\n <X className=\"size-5\" />\n </button>\n </div>\n\n {/* Content */}\n <div className=\"flex-1 overflow-y-auto p-6\">\n {isLoading && (\n <SectionLoaderOr\n minHeight=\"8rem\"\n today={\n <div className=\"flex items-center justify-center py-12\">\n <SpinnerIcon className=\"size-8 text-text-link animate-spin\" />\n </div>\n }\n />\n )}\n\n {error && (\n <div className=\"flex items-center justify-center py-12\">\n <div className=\"text-center\">\n <AlertCircle className=\"size-12 text-status-error-text mx-auto mb-4\" />\n <p className=\"text-sm text-text-secondary\">\n {tWithFallback(\n t,\n \"files.version.loadFailed\",\n \"Failed to load version history\",\n )}\n </p>\n </div>\n </div>\n )}\n\n {!isLoading && !error && versions.length === 0 && (\n <IllustratedEmptyState\n illustration=\"empty-data\"\n title={tWithFallback(\n t,\n \"files.version.noHistory\",\n \"No version history available\",\n )}\n description={tWithFallback(\n t,\n \"files.version.noHistoryDescription\",\n \"New versions appear here each time this file is re-uploaded or edited, so you can review and restore earlier copies.\",\n )}\n glassIllustration=\"history\"\n size=\"panel\"\n />\n )}\n\n {!isLoading && !error && versions.length > 0 && (\n <div className=\"space-y-3\">\n {versions.map((version: (typeof versions)[number]) => (\n <div\n key={version.id}\n className={`p-4 border rounded-lg transition-all duration-200 ${\n version.isCurrentVersion\n ? \"border-action-primary-border bg-bg-accent\"\n : selectedVersionId === version.id\n ? \"border-border-seam bg-bg-sunken\"\n : \"border-border-seam hover:border-border-strong hover:bg-action-ghost-bg-hover\"\n }`}\n onClick={() => setSelectedVersionId(version.id)}\n >\n <div className=\"flex items-start justify-between gap-4\">\n {/* Version info */}\n <div className=\"flex-1 min-w-0\">\n <div className=\"flex items-center gap-2 mb-2\">\n <span className=\"text-sm font-semibold text-text-primary\">\n {tWithFallback(t, \"files.version.version\", \"Version\")}{\" \"}\n {version.versionNumber}\n </span>\n\n {version.isCurrentVersion && (\n <span className=\"inline-flex items-center gap-1 px-2 py-0.5 bg-action-primary-bg text-text-inverse text-xs font-medium rounded\">\n <CheckCircle2 className=\"size-3\" />\n {tWithFallback(\n t,\n \"files.version.current\",\n \"Current\",\n )}\n </span>\n )}\n\n {version.isMajorVersion && (\n <span className=\"inline-flex items-center gap-1 px-2 py-0.5 bg-status-info-bg-subtle text-status-info-text text-xs font-medium rounded\">\n <Tag className=\"size-3\" />\n {tWithFallback(t, \"files.version.major\", \"Major\")}\n </span>\n )}\n\n {version.versionLabel && (\n <span className=\"inline-flex items-center px-2 py-0.5 bg-status-success-bg-subtle text-status-success-text text-xs font-medium rounded\">\n {version.versionLabel}\n </span>\n )}\n </div>\n\n {version.changeMessage && (\n <p className=\"text-sm text-text-primary mb-2\">\n {version.changeMessage}\n </p>\n )}\n\n <div className=\"flex items-center gap-4 text-xs text-text-secondary\">\n <span className=\"tabular-nums\">\n {formatFileSize(browserFileSize(version.size))}\n </span>\n <span>•</span>\n <span>{formatFileDate(version.createdAt)}</span>\n </div>\n </div>\n\n {/* Actions */}\n <div className=\"flex items-center gap-2\">\n <button\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation();\n handleDownload(version.id);\n }}\n className=\"p-2 text-text-secondary hover:text-text-link hover:bg-bg-accent rounded-lg transition-colors duration-200\"\n title={tWithFallback(\n t,\n \"files.version.downloadThisVersion\",\n \"Download this version\",\n )}\n >\n <Download className=\"size-4\" />\n </button>\n\n {!version.isCurrentVersion && (\n <>\n <button\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation();\n handleRestore(version.id, version.versionNumber);\n }}\n disabled={restoreMutation.isPending}\n className=\"p-2 text-text-secondary hover:text-status-success-text hover:bg-status-success-bg-subtle rounded-lg transition-colors duration-200 disabled:opacity-50 disabled:cursor-not-allowed\"\n title={tWithFallback(\n t,\n \"files.version.restoreThisVersion\",\n \"Restore this version\",\n )}\n >\n {restoreMutation.isPending ? (\n <SpinnerIcon className=\"size-4 animate-spin\" />\n ) : (\n <RotateCcw className=\"size-4\" />\n )}\n </button>\n\n <button\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation();\n handleDelete(version.id, version.versionNumber);\n }}\n disabled={deleteMutation.isPending}\n className=\"p-2 text-text-secondary hover:text-status-error-text hover:bg-status-error-bg-subtle rounded-lg transition-colors duration-200 disabled:opacity-50 disabled:cursor-not-allowed\"\n title={tWithFallback(\n t,\n \"files.version.deleteThisVersion\",\n \"Delete this version\",\n )}\n >\n {deleteMutation.isPending ? (\n <SpinnerIcon className=\"size-4 animate-spin\" />\n ) : (\n <Trash2 className=\"size-4\" />\n )}\n </button>\n </>\n )}\n </div>\n </div>\n </div>\n ))}\n </div>\n )}\n </div>\n\n {/* Footer */}\n <div className=\"p-6 border-t border-border-seam bg-bg-sunken\">\n <div className=\"flex items-center justify-between text-sm text-text-secondary\">\n <span>\n {versionsData?.total || 0}{\" \"}\n {versionsData?.total !== 1\n ? tWithFallback(t, \"files.version.versions\", \"versions\")\n : tWithFallback(\n t,\n \"files.version.versionSingular\",\n \"version\",\n )}{\" \"}\n {tWithFallback(t, \"files.version.total\", \"total\")}\n </span>\n <button\n type=\"button\"\n onClick={onClose}\n className=\"px-4 py-2 text-sm font-medium text-text-primary hover:bg-action-ghost-bg-hover rounded-lg transition-colors duration-200\"\n >\n {tWithFallback(t, \"files.common.actions.close\", \"Close\")}\n </button>\n </div>\n </div>\n </div>\n\n {confirmAction && (\n <ConfirmDialog\n title={confirmAction.title}\n description={confirmAction.description}\n confirmLabel={confirmAction.confirmLabel}\n cancelLabel={tWithFallback(\n t,\n \"files.common.actions.cancel\",\n \"Cancel\",\n )}\n variant={confirmAction.variant}\n loading={confirmAction.loading}\n onConfirm={runConfirmAction}\n onCancel={() => {\n if (!confirmAction.loading) {\n setConfirmAction(null);\n }\n }}\n />\n )}\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;;AAgCA,IAAaC,KAA+C,EAC1D,SACA,iBACI;CACJ,IAAM,EAAE,SAAMC,EAAQ,GAChB,CAACC,GAAmBC,KAAwBC,EAChD,IACF,GACM,CAACC,GAAeC,KAAoBF,EAOhC,IAAI,GACRG,IAAQC,EAAS,GAGjB,EAAE,MAAMC,GAAc,cAAW,aAAUC,EAAgBC,EAAK,EAAE,GAClEC,IAAWH,GAAc,YAAY,CAAC,GAGtCI,IAAkBC,EAAsB,GACxCC,IAAiBC,EAAqB,GACtCC,IAAkBC,EAAsB,GAExCC,IAAgB,OAAO,GAAmB,MAA0B;EACxE,EAAiB;GACf,OAAO,GAAGC,EAAcC,GAAG,gCAAgC,iBAAiB,EAAE,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