@burdenoff/microfe-theculturepost 2026.1122.1 → 2026.1124.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/theculturepost/components/ArchiveItemCard.js +37 -37
- package/dist/theculturepost/components/ArchiveItemCard.js.map +1 -1
- package/dist/theculturepost/components/OralHistoryCard.js +1 -0
- package/dist/theculturepost/components/StoryCard.js +52 -52
- package/dist/theculturepost/components/StoryCard.js.map +1 -1
- package/dist/theculturepost/hooks/useLanguageMetadata.d.ts +2 -0
- package/dist/theculturepost/hooks/useLanguageMetadata.js +10 -0
- package/dist/theculturepost/hooks/useLanguageMetadata.js.map +1 -0
- package/dist/theculturepost/pages/archive/ArchiveItemDetailPage.js +129 -128
- package/dist/theculturepost/pages/archive/ArchiveItemDetailPage.js.map +1 -1
- package/dist/theculturepost/pages/archive/ArchivePage.js +98 -101
- package/dist/theculturepost/pages/archive/ArchivePage.js.map +1 -1
- package/dist/theculturepost/pages/stories/StoryDetailPage.js +285 -288
- package/dist/theculturepost/pages/stories/StoryDetailPage.js.map +1 -1
- package/dist/theculturepost/utils/languageMetadata.d.ts +6 -0
- package/dist/theculturepost/utils/languageMetadata.js +35 -0
- package/dist/theculturepost/utils/languageMetadata.js.map +1 -0
- package/package.json +2 -2
|
@@ -12,36 +12,37 @@ import { cn as p } from "../../utils/cn.js";
|
|
|
12
12
|
import { nativeConfirm as m } from "../../utils/nativeBridge.js";
|
|
13
13
|
import { resolveArchiveItemPermissions as h } from "../../utils/archivePermissions.js";
|
|
14
14
|
import { formatDate as g, formatEnumLabel as _ } from "../../utils/formatters.js";
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
15
|
+
import { useLanguageMetadata as v } from "../../hooks/useLanguageMetadata.js";
|
|
16
|
+
import { describeError as y, notify as b } from "../../lib/toast.js";
|
|
17
|
+
import { createElement as x, useEffect as S, useState as C } from "react";
|
|
18
|
+
import { Archive as w, ArrowLeft as T, CalendarClock as E, Clock as D, Download as O, Globe as k, Landmark as A, Languages as j, Library as M, Loader2 as N, Lock as P, Maximize2 as F, Minus as I, Pencil as L, Plus as R, Quote as z, Tag as B, Users as V, X as H } from "lucide-react";
|
|
19
|
+
import { useParams as U } from "react-router";
|
|
20
|
+
import { Fragment as W, jsx as G, jsxs as K } from "react/jsx-runtime";
|
|
21
|
+
import { Button as q, GlassCard as J, Input as Y, ResponsiveDialog as X, ResponsiveDialogContent as Z, ResponsiveDialogDescription as ee, ResponsiveDialogFooter as te, ResponsiveDialogHeader as ne, ResponsiveDialogTitle as re } from "@burdenoff/fe-libs/ui";
|
|
22
|
+
import { useSafePermissions as ie } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
22
23
|
// src/theculturepost/pages/archive/ArchiveItemDetailPage.tsx
|
|
23
|
-
var
|
|
24
|
-
PUBLIC:
|
|
25
|
-
COMMUNITY:
|
|
26
|
-
RESTRICTED:
|
|
27
|
-
EMBARGOED:
|
|
24
|
+
var ae = {
|
|
25
|
+
PUBLIC: k,
|
|
26
|
+
COMMUNITY: V,
|
|
27
|
+
RESTRICTED: P,
|
|
28
|
+
EMBARGOED: D
|
|
28
29
|
};
|
|
29
30
|
function Q({ onBack: e, children: t }) {
|
|
30
|
-
return /* @__PURE__ */
|
|
31
|
+
return /* @__PURE__ */ G("div", {
|
|
31
32
|
className: "flex h-full flex-col",
|
|
32
|
-
children: /* @__PURE__ */
|
|
33
|
+
children: /* @__PURE__ */ G("div", {
|
|
33
34
|
className: "flex-1 overflow-auto",
|
|
34
|
-
children: /* @__PURE__ */
|
|
35
|
+
children: /* @__PURE__ */ K("div", {
|
|
35
36
|
className: "mx-auto w-full max-w-6xl p-4 sm:p-6",
|
|
36
|
-
children: [/* @__PURE__ */
|
|
37
|
+
children: [/* @__PURE__ */ K("button", {
|
|
37
38
|
type: "button",
|
|
38
39
|
onClick: e,
|
|
39
40
|
className: "inline-flex items-center gap-1.5 text-sm font-medium text-text-secondary hover:text-text-primary",
|
|
40
|
-
children: [/* @__PURE__ */
|
|
41
|
+
children: [/* @__PURE__ */ G(T, {
|
|
41
42
|
className: "h-4 w-4",
|
|
42
43
|
"aria-hidden": "true"
|
|
43
44
|
}), " Archive"]
|
|
44
|
-
}), /* @__PURE__ */
|
|
45
|
+
}), /* @__PURE__ */ G("div", {
|
|
45
46
|
className: "mt-4",
|
|
46
47
|
children: t
|
|
47
48
|
})]
|
|
@@ -49,91 +50,91 @@ function Q({ onBack: e, children: t }) {
|
|
|
49
50
|
})
|
|
50
51
|
});
|
|
51
52
|
}
|
|
52
|
-
function
|
|
53
|
-
let { id: r } =
|
|
54
|
-
if (f &&
|
|
53
|
+
function oe() {
|
|
54
|
+
let { id: r } = U(), { navigateTo: a, workspaceId: l } = e(), { data: f, isLoading: p, isError: _, refetch: S } = d(r), T = v(f?.languages), [D, O] = C(!1), [P, F] = C(!1), I = u(), R = ie(), { canEdit: V, canWithdraw: H } = h(R, l), W = () => a("archive"), J = async () => {
|
|
55
|
+
if (f && H && await m({
|
|
55
56
|
title: "Withdraw artifact",
|
|
56
57
|
message: `Withdraw “${f.title}” from the archive? It will no longer be listed, and stories that cite it keep their citation.`,
|
|
57
58
|
okButtonTitle: "Withdraw",
|
|
58
59
|
cancelButtonTitle: "Cancel"
|
|
59
60
|
})) try {
|
|
60
|
-
await
|
|
61
|
+
await I.mutateAsync({
|
|
61
62
|
id: f.id,
|
|
62
63
|
collectionId: f.collectionId
|
|
63
|
-
}),
|
|
64
|
+
}), b.success("Artifact withdrawn", f.title), W();
|
|
64
65
|
} catch (e) {
|
|
65
|
-
|
|
66
|
+
b.error("Could not withdraw the artifact", y(e));
|
|
66
67
|
}
|
|
67
68
|
};
|
|
68
|
-
if (p) return /* @__PURE__ */
|
|
69
|
-
onBack:
|
|
70
|
-
children: /* @__PURE__ */
|
|
69
|
+
if (p) return /* @__PURE__ */ G(Q, {
|
|
70
|
+
onBack: W,
|
|
71
|
+
children: /* @__PURE__ */ G(c, { label: "Loading artifact…" })
|
|
71
72
|
});
|
|
72
|
-
if (
|
|
73
|
-
onBack:
|
|
74
|
-
children: /* @__PURE__ */
|
|
73
|
+
if (_ || !f) return /* @__PURE__ */ G(Q, {
|
|
74
|
+
onBack: W,
|
|
75
|
+
children: /* @__PURE__ */ G(s, {
|
|
75
76
|
title: "Artifact not found",
|
|
76
77
|
message: "This artifact may have been archived, or you may not have access.",
|
|
77
|
-
onRetry: () =>
|
|
78
|
+
onRetry: () => S()
|
|
78
79
|
})
|
|
79
80
|
});
|
|
80
|
-
let
|
|
81
|
-
return /* @__PURE__ */
|
|
82
|
-
onBack:
|
|
81
|
+
let Y = f.collection, X = ae[f.accessLevel], Z = o[f.kind];
|
|
82
|
+
return /* @__PURE__ */ K(Q, {
|
|
83
|
+
onBack: W,
|
|
83
84
|
children: [
|
|
84
|
-
/* @__PURE__ */
|
|
85
|
+
/* @__PURE__ */ K("div", {
|
|
85
86
|
className: "grid gap-6 lg:grid-cols-[1.3fr_1fr]",
|
|
86
|
-
children: [/* @__PURE__ */
|
|
87
|
+
children: [/* @__PURE__ */ G(se, { item: f }), /* @__PURE__ */ K("div", {
|
|
87
88
|
className: "flex min-w-0 flex-col gap-5",
|
|
88
89
|
children: [
|
|
89
|
-
/* @__PURE__ */
|
|
90
|
+
/* @__PURE__ */ G("h1", {
|
|
90
91
|
className: "font-display text-3xl font-semibold leading-tight text-text-primary",
|
|
91
92
|
children: f.title
|
|
92
93
|
}),
|
|
93
|
-
/* @__PURE__ */
|
|
94
|
+
/* @__PURE__ */ K("div", {
|
|
94
95
|
className: "flex flex-wrap items-center gap-1.5",
|
|
95
|
-
children: [/* @__PURE__ */
|
|
96
|
+
children: [/* @__PURE__ */ G(n, {
|
|
96
97
|
status: f.kind,
|
|
97
|
-
icon:
|
|
98
|
-
}), /* @__PURE__ */
|
|
98
|
+
icon: x(Z, { className: "h-3 w-3" })
|
|
99
|
+
}), /* @__PURE__ */ G(n, {
|
|
99
100
|
status: f.accessLevel,
|
|
100
|
-
icon:
|
|
101
|
+
icon: x(X, { className: "h-3 w-3" })
|
|
101
102
|
})]
|
|
102
103
|
}),
|
|
103
|
-
f.description && /* @__PURE__ */
|
|
104
|
+
f.description && /* @__PURE__ */ G("p", {
|
|
104
105
|
className: "whitespace-pre-wrap text-sm leading-relaxed text-text-secondary",
|
|
105
106
|
children: f.description
|
|
106
107
|
}),
|
|
107
|
-
/* @__PURE__ */
|
|
108
|
-
/* @__PURE__ */
|
|
108
|
+
/* @__PURE__ */ G(i, { className: "py-2" }),
|
|
109
|
+
/* @__PURE__ */ K("dl", {
|
|
109
110
|
className: "flex flex-col gap-4",
|
|
110
111
|
children: [
|
|
111
|
-
f.provenance && /* @__PURE__ */
|
|
112
|
-
icon:
|
|
112
|
+
f.provenance && /* @__PURE__ */ G($, {
|
|
113
|
+
icon: A,
|
|
113
114
|
label: "Provenance",
|
|
114
115
|
children: f.provenance
|
|
115
116
|
}),
|
|
116
|
-
f.origin && /* @__PURE__ */
|
|
117
|
-
icon:
|
|
117
|
+
f.origin && /* @__PURE__ */ G($, {
|
|
118
|
+
icon: k,
|
|
118
119
|
label: "Origin",
|
|
119
120
|
children: f.origin
|
|
120
121
|
}),
|
|
121
|
-
f.datedAt && /* @__PURE__ */
|
|
122
|
-
icon:
|
|
122
|
+
f.datedAt && /* @__PURE__ */ G($, {
|
|
123
|
+
icon: E,
|
|
123
124
|
label: "Date",
|
|
124
125
|
children: g(f.datedAt)
|
|
125
126
|
}),
|
|
126
|
-
|
|
127
|
-
icon:
|
|
127
|
+
T && /* @__PURE__ */ G($, {
|
|
128
|
+
icon: j,
|
|
128
129
|
label: "Languages",
|
|
129
|
-
children:
|
|
130
|
+
children: /* @__PURE__ */ G("bdi", { children: T })
|
|
130
131
|
}),
|
|
131
|
-
f.tags.length > 0 && /* @__PURE__ */
|
|
132
|
-
icon:
|
|
132
|
+
f.tags.length > 0 && /* @__PURE__ */ G($, {
|
|
133
|
+
icon: B,
|
|
133
134
|
label: "Tags",
|
|
134
|
-
children: /* @__PURE__ */
|
|
135
|
+
children: /* @__PURE__ */ G("div", {
|
|
135
136
|
className: "flex flex-wrap gap-1.5",
|
|
136
|
-
children: f.tags.map((e) => /* @__PURE__ */
|
|
137
|
+
children: f.tags.map((e) => /* @__PURE__ */ G("span", {
|
|
137
138
|
className: "rounded-full bg-bg-sunken px-2.5 py-0.5 text-xs font-medium text-text-secondary",
|
|
138
139
|
children: e
|
|
139
140
|
}, e))
|
|
@@ -141,89 +142,89 @@ function ae() {
|
|
|
141
142
|
})
|
|
142
143
|
]
|
|
143
144
|
}),
|
|
144
|
-
|
|
145
|
+
Y && /* @__PURE__ */ K("button", {
|
|
145
146
|
type: "button",
|
|
146
|
-
onClick: () => a(`archive/collections/${
|
|
147
|
+
onClick: () => a(`archive/collections/${Y.id}`),
|
|
147
148
|
className: "inline-flex items-center gap-2 self-start rounded-lg border border-border-seam bg-bg-surface px-3 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken",
|
|
148
149
|
children: [
|
|
149
|
-
/* @__PURE__ */
|
|
150
|
+
/* @__PURE__ */ G(M, {
|
|
150
151
|
className: "h-4 w-4 text-text-tertiary",
|
|
151
152
|
"aria-hidden": "true"
|
|
152
153
|
}),
|
|
153
154
|
" ",
|
|
154
|
-
|
|
155
|
+
Y.name
|
|
155
156
|
]
|
|
156
157
|
}),
|
|
157
|
-
/* @__PURE__ */
|
|
158
|
+
/* @__PURE__ */ K(q, {
|
|
158
159
|
className: "w-full sm:w-auto",
|
|
159
|
-
onClick: () =>
|
|
160
|
-
children: [/* @__PURE__ */
|
|
160
|
+
onClick: () => O(!0),
|
|
161
|
+
children: [/* @__PURE__ */ G(z, { className: "mr-1.5 h-4 w-4" }), " Cite in a story"]
|
|
161
162
|
}),
|
|
162
|
-
(
|
|
163
|
+
(V || H) && /* @__PURE__ */ K("div", {
|
|
163
164
|
className: "flex flex-wrap gap-2",
|
|
164
|
-
children: [
|
|
165
|
+
children: [V && /* @__PURE__ */ K(q, {
|
|
165
166
|
variant: "outline",
|
|
166
|
-
onClick: () =>
|
|
167
|
-
children: [/* @__PURE__ */
|
|
168
|
-
}),
|
|
167
|
+
onClick: () => F(!0),
|
|
168
|
+
children: [/* @__PURE__ */ G(L, { className: "mr-1.5 h-4 w-4" }), " Edit"]
|
|
169
|
+
}), H && /* @__PURE__ */ K(q, {
|
|
169
170
|
variant: "outline",
|
|
170
|
-
onClick:
|
|
171
|
-
disabled:
|
|
172
|
-
children: [
|
|
171
|
+
onClick: J,
|
|
172
|
+
disabled: I.isPending,
|
|
173
|
+
children: [I.isPending ? /* @__PURE__ */ G(N, { className: "mr-1.5 h-4 w-4 animate-spin" }) : /* @__PURE__ */ G(w, { className: "mr-1.5 h-4 w-4" }), "Withdraw"]
|
|
173
174
|
})]
|
|
174
175
|
})
|
|
175
176
|
]
|
|
176
177
|
})]
|
|
177
178
|
}),
|
|
178
|
-
/* @__PURE__ */
|
|
179
|
-
open:
|
|
180
|
-
onOpenChange:
|
|
179
|
+
/* @__PURE__ */ G(ce, {
|
|
180
|
+
open: D,
|
|
181
|
+
onOpenChange: O,
|
|
181
182
|
item: f
|
|
182
183
|
}),
|
|
183
|
-
|
|
184
|
-
open:
|
|
185
|
-
onOpenChange:
|
|
184
|
+
V && P && /* @__PURE__ */ G(t, {
|
|
185
|
+
open: P,
|
|
186
|
+
onOpenChange: F,
|
|
186
187
|
item: f
|
|
187
188
|
})
|
|
188
189
|
]
|
|
189
190
|
});
|
|
190
191
|
}
|
|
191
192
|
function $({ icon: e, label: t, children: n }) {
|
|
192
|
-
return /* @__PURE__ */
|
|
193
|
+
return /* @__PURE__ */ K("div", {
|
|
193
194
|
className: "flex items-start gap-3",
|
|
194
195
|
children: [
|
|
195
|
-
/* @__PURE__ */
|
|
196
|
+
/* @__PURE__ */ G(e, {
|
|
196
197
|
className: "mt-0.5 h-4 w-4 shrink-0 text-accent",
|
|
197
198
|
"aria-hidden": "true"
|
|
198
199
|
}),
|
|
199
|
-
/* @__PURE__ */
|
|
200
|
+
/* @__PURE__ */ G("dt", {
|
|
200
201
|
className: "w-24 shrink-0 text-sm text-text-tertiary",
|
|
201
202
|
children: t
|
|
202
203
|
}),
|
|
203
|
-
/* @__PURE__ */
|
|
204
|
+
/* @__PURE__ */ G("dd", {
|
|
204
205
|
className: "min-w-0 flex-1 text-sm text-text-primary",
|
|
205
206
|
children: n
|
|
206
207
|
})
|
|
207
208
|
]
|
|
208
209
|
});
|
|
209
210
|
}
|
|
210
|
-
function
|
|
211
|
-
let { data: t } = r(e.file?.id), n = o[e.kind], [i, s] =
|
|
212
|
-
return
|
|
211
|
+
function se({ item: e }) {
|
|
212
|
+
let { data: t } = r(e.file?.id), n = o[e.kind], [i, s] = C(1), [c, l] = C(!1), [u, d] = C(!1), f = a.has(e.kind) && !!t && !u;
|
|
213
|
+
return S(() => {
|
|
213
214
|
if (!c) return;
|
|
214
215
|
let e = (e) => {
|
|
215
216
|
e.key === "Escape" && l(!1);
|
|
216
217
|
};
|
|
217
218
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
218
|
-
}, [c]), /* @__PURE__ */
|
|
219
|
+
}, [c]), /* @__PURE__ */ K("div", {
|
|
219
220
|
className: "flex flex-col gap-4",
|
|
220
221
|
children: [
|
|
221
|
-
/* @__PURE__ */
|
|
222
|
+
/* @__PURE__ */ G(J, {
|
|
222
223
|
treatment: "plain",
|
|
223
224
|
className: "p-3 sm:p-4",
|
|
224
|
-
children: /* @__PURE__ */
|
|
225
|
+
children: /* @__PURE__ */ K("div", {
|
|
225
226
|
className: p("relative aspect-[4/3] w-full rounded-xl bg-bg-sunken", i > 1 ? "overflow-auto" : "overflow-hidden"),
|
|
226
|
-
children: [f && t ? /* @__PURE__ */
|
|
227
|
+
children: [f && t ? /* @__PURE__ */ G("img", {
|
|
227
228
|
src: t,
|
|
228
229
|
alt: e.title,
|
|
229
230
|
onError: () => d(!0),
|
|
@@ -232,72 +233,72 @@ function oe({ item: e }) {
|
|
|
232
233
|
transformOrigin: "center center"
|
|
233
234
|
},
|
|
234
235
|
className: "h-full w-full object-contain transition-transform duration-200"
|
|
235
|
-
}) : /* @__PURE__ */
|
|
236
|
+
}) : /* @__PURE__ */ K("div", {
|
|
236
237
|
className: "flex h-full w-full flex-col items-center justify-center gap-3 text-text-tertiary",
|
|
237
|
-
children: [/* @__PURE__ */
|
|
238
|
+
children: [/* @__PURE__ */ G(n, {
|
|
238
239
|
className: "h-16 w-16",
|
|
239
240
|
"aria-hidden": "true"
|
|
240
|
-
}), /* @__PURE__ */
|
|
241
|
+
}), /* @__PURE__ */ G("span", {
|
|
241
242
|
className: "text-sm font-medium",
|
|
242
243
|
children: _(e.kind)
|
|
243
244
|
})]
|
|
244
|
-
}), f && t && /* @__PURE__ */ W
|
|
245
|
+
}), f && t && /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G("button", {
|
|
245
246
|
type: "button",
|
|
246
247
|
onClick: () => l(!0),
|
|
247
248
|
"aria-label": "View full screen",
|
|
248
249
|
className: "absolute right-3 top-3 z-10 flex h-9 w-9 items-center justify-center rounded-lg bg-bg-canvas/85 text-text-primary shadow-sm backdrop-blur-sm hover:bg-bg-canvas",
|
|
249
|
-
children: /* @__PURE__ */
|
|
250
|
-
}), /* @__PURE__ */
|
|
250
|
+
children: /* @__PURE__ */ G(F, { className: "h-4 w-4" })
|
|
251
|
+
}), /* @__PURE__ */ K("div", {
|
|
251
252
|
className: "absolute bottom-3 left-3 z-10 flex flex-col overflow-hidden rounded-lg border border-border-seam bg-bg-canvas/85 text-text-primary shadow-sm backdrop-blur-sm",
|
|
252
253
|
children: [
|
|
253
|
-
/* @__PURE__ */
|
|
254
|
+
/* @__PURE__ */ G("button", {
|
|
254
255
|
type: "button",
|
|
255
256
|
onClick: () => s((e) => Math.min(4, Math.round((e + .5) * 10) / 10)),
|
|
256
257
|
disabled: i >= 4,
|
|
257
258
|
"aria-label": "Zoom in",
|
|
258
259
|
className: "flex h-8 w-9 items-center justify-center hover:bg-bg-sunken disabled:opacity-40",
|
|
259
|
-
children: /* @__PURE__ */
|
|
260
|
+
children: /* @__PURE__ */ G(R, { className: "h-4 w-4" })
|
|
260
261
|
}),
|
|
261
|
-
/* @__PURE__ */
|
|
262
|
+
/* @__PURE__ */ K("button", {
|
|
262
263
|
type: "button",
|
|
263
264
|
onClick: () => s(1),
|
|
264
265
|
"aria-label": "Reset zoom",
|
|
265
266
|
className: "border-y border-border-seam px-1 py-1 text-[10px] font-medium tabular-nums hover:bg-bg-sunken",
|
|
266
267
|
children: [Math.round(i * 100), "%"]
|
|
267
268
|
}),
|
|
268
|
-
/* @__PURE__ */
|
|
269
|
+
/* @__PURE__ */ G("button", {
|
|
269
270
|
type: "button",
|
|
270
271
|
onClick: () => s((e) => Math.max(1, Math.round((e - .5) * 10) / 10)),
|
|
271
272
|
disabled: i <= 1,
|
|
272
273
|
"aria-label": "Zoom out",
|
|
273
274
|
className: "flex h-8 w-9 items-center justify-center hover:bg-bg-sunken disabled:opacity-40",
|
|
274
|
-
children: /* @__PURE__ */
|
|
275
|
+
children: /* @__PURE__ */ G(I, { className: "h-4 w-4" })
|
|
275
276
|
})
|
|
276
277
|
]
|
|
277
278
|
})] })]
|
|
278
279
|
})
|
|
279
280
|
}),
|
|
280
|
-
t && /* @__PURE__ */
|
|
281
|
+
t && /* @__PURE__ */ K("a", {
|
|
281
282
|
href: t,
|
|
282
283
|
target: "_blank",
|
|
283
284
|
rel: "noreferrer noopener",
|
|
284
285
|
download: !0,
|
|
285
286
|
className: "inline-flex items-center justify-center gap-2 self-start rounded-lg border border-border-seam bg-bg-surface px-4 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken",
|
|
286
|
-
children: [/* @__PURE__ */
|
|
287
|
+
children: [/* @__PURE__ */ G(O, { className: "h-4 w-4" }), " Download"]
|
|
287
288
|
}),
|
|
288
|
-
c && t && /* @__PURE__ */
|
|
289
|
+
c && t && /* @__PURE__ */ K("div", {
|
|
289
290
|
role: "dialog",
|
|
290
291
|
"aria-modal": "true",
|
|
291
292
|
"aria-label": `${e.title} — full view`,
|
|
292
293
|
onClick: () => l(!1),
|
|
293
294
|
className: "fixed inset-0 z-50 flex items-center justify-center bg-bg-canvas/95 p-4 backdrop-blur-sm",
|
|
294
|
-
children: [/* @__PURE__ */
|
|
295
|
+
children: [/* @__PURE__ */ G("button", {
|
|
295
296
|
type: "button",
|
|
296
297
|
onClick: () => l(!1),
|
|
297
298
|
"aria-label": "Close full view",
|
|
298
299
|
className: "absolute right-4 top-4 flex h-10 w-10 items-center justify-center rounded-full bg-bg-surface text-text-primary shadow-sm hover:bg-bg-sunken",
|
|
299
|
-
children: /* @__PURE__ */
|
|
300
|
-
}), /* @__PURE__ */
|
|
300
|
+
children: /* @__PURE__ */ G(H, { className: "h-5 w-5" })
|
|
301
|
+
}), /* @__PURE__ */ G("img", {
|
|
301
302
|
src: t,
|
|
302
303
|
alt: e.title,
|
|
303
304
|
onClick: (e) => e.stopPropagation(),
|
|
@@ -307,8 +308,8 @@ function oe({ item: e }) {
|
|
|
307
308
|
]
|
|
308
309
|
});
|
|
309
310
|
}
|
|
310
|
-
function
|
|
311
|
-
let r = f({ pagination: { limit: 50 } }), i = l(), [a, o] =
|
|
311
|
+
function ce({ open: e, onOpenChange: t, item: n }) {
|
|
312
|
+
let r = f({ pagination: { limit: 50 } }), i = l(), [a, o] = C(""), [s, u] = C(null), [d, p] = C(null), m = r.data?.items ?? [], h = a.trim().toLowerCase(), g = h ? m.filter((e) => e.title.toLowerCase().includes(h)) : m, v = async (e) => {
|
|
312
313
|
u(e.id), p(null);
|
|
313
314
|
try {
|
|
314
315
|
await i.mutateAsync({
|
|
@@ -318,68 +319,68 @@ function se({ open: e, onOpenChange: t, item: n }) {
|
|
|
318
319
|
provenance: n.provenance ?? null,
|
|
319
320
|
excerpt: n.description ?? null,
|
|
320
321
|
sourceFileId: n.file?.id ?? null
|
|
321
|
-
}),
|
|
322
|
+
}), b.success("Cited in a story", e.title), t(!1);
|
|
322
323
|
} catch (e) {
|
|
323
|
-
p(
|
|
324
|
+
p(y(e));
|
|
324
325
|
} finally {
|
|
325
326
|
u(null);
|
|
326
327
|
}
|
|
327
328
|
};
|
|
328
|
-
return /* @__PURE__ */
|
|
329
|
+
return /* @__PURE__ */ G(X, {
|
|
329
330
|
open: e,
|
|
330
331
|
onOpenChange: t,
|
|
331
|
-
children: /* @__PURE__ */
|
|
332
|
+
children: /* @__PURE__ */ K(Z, {
|
|
332
333
|
className: "sm:max-w-lg",
|
|
333
334
|
children: [
|
|
334
|
-
/* @__PURE__ */
|
|
335
|
+
/* @__PURE__ */ K(ne, { children: [/* @__PURE__ */ G(re, { children: "Cite in a story" }), /* @__PURE__ */ K(ee, { children: [
|
|
335
336
|
"Attach “",
|
|
336
337
|
n.title,
|
|
337
338
|
"” to a story as an archival-record citation."
|
|
338
339
|
] })] }),
|
|
339
|
-
/* @__PURE__ */
|
|
340
|
+
/* @__PURE__ */ K("div", {
|
|
340
341
|
className: "flex flex-col gap-3 py-2",
|
|
341
342
|
children: [
|
|
342
|
-
/* @__PURE__ */
|
|
343
|
+
/* @__PURE__ */ G(Y, {
|
|
343
344
|
value: a,
|
|
344
345
|
onChange: (e) => o(e.target.value),
|
|
345
346
|
placeholder: "Search stories…",
|
|
346
347
|
"aria-label": "Search stories"
|
|
347
348
|
}),
|
|
348
|
-
/* @__PURE__ */
|
|
349
|
+
/* @__PURE__ */ G("div", {
|
|
349
350
|
className: "flex max-h-[50vh] flex-col gap-1.5 overflow-y-auto",
|
|
350
|
-
children: r.isLoading ? /* @__PURE__ */
|
|
351
|
+
children: r.isLoading ? /* @__PURE__ */ G(c, {
|
|
351
352
|
label: "Loading stories…",
|
|
352
353
|
className: "min-h-[8rem]"
|
|
353
|
-
}) : g.length === 0 ? /* @__PURE__ */
|
|
354
|
+
}) : g.length === 0 ? /* @__PURE__ */ G("p", {
|
|
354
355
|
className: "py-8 text-center text-sm text-text-tertiary",
|
|
355
356
|
children: m.length === 0 ? "No stories yet — draft a story first." : "No stories match your search."
|
|
356
|
-
}) : g.map((e) => /* @__PURE__ */
|
|
357
|
+
}) : g.map((e) => /* @__PURE__ */ K("button", {
|
|
357
358
|
type: "button",
|
|
358
|
-
onClick: () =>
|
|
359
|
+
onClick: () => v(e),
|
|
359
360
|
disabled: i.isPending,
|
|
360
361
|
className: "flex items-center justify-between gap-3 rounded-xl border border-border-seam bg-bg-surface px-3 py-2.5 text-left transition-colors hover:bg-bg-sunken disabled:opacity-60",
|
|
361
|
-
children: [/* @__PURE__ */
|
|
362
|
+
children: [/* @__PURE__ */ K("span", {
|
|
362
363
|
className: "min-w-0",
|
|
363
|
-
children: [/* @__PURE__ */
|
|
364
|
+
children: [/* @__PURE__ */ G("span", {
|
|
364
365
|
className: "block truncate text-sm font-medium text-text-primary",
|
|
365
366
|
children: e.title
|
|
366
|
-
}), /* @__PURE__ */
|
|
367
|
+
}), /* @__PURE__ */ G("span", {
|
|
367
368
|
className: "mt-0.5 block truncate text-xs text-text-tertiary",
|
|
368
369
|
children: e.topic?.name ?? _(e.status)
|
|
369
370
|
})]
|
|
370
|
-
}), s === e.id ? /* @__PURE__ */
|
|
371
|
+
}), s === e.id ? /* @__PURE__ */ G(N, { className: "h-4 w-4 shrink-0 animate-spin text-text-tertiary" }) : /* @__PURE__ */ G(z, {
|
|
371
372
|
className: "h-4 w-4 shrink-0 text-text-tertiary",
|
|
372
373
|
"aria-hidden": "true"
|
|
373
374
|
})]
|
|
374
375
|
}, e.id))
|
|
375
376
|
}),
|
|
376
|
-
d && /* @__PURE__ */
|
|
377
|
+
d && /* @__PURE__ */ G("p", {
|
|
377
378
|
className: "text-sm text-status-error-text",
|
|
378
379
|
children: d
|
|
379
380
|
})
|
|
380
381
|
]
|
|
381
382
|
}),
|
|
382
|
-
/* @__PURE__ */
|
|
383
|
+
/* @__PURE__ */ G(te, { children: /* @__PURE__ */ G(q, {
|
|
383
384
|
variant: "outline",
|
|
384
385
|
onClick: () => t(!1),
|
|
385
386
|
children: "Close"
|
|
@@ -388,6 +389,6 @@ function se({ open: e, onOpenChange: t, item: n }) {
|
|
|
388
389
|
})
|
|
389
390
|
});
|
|
390
391
|
}
|
|
391
|
-
export {
|
|
392
|
+
export { oe as ArchiveItemDetailPage };
|
|
392
393
|
|
|
393
394
|
//# sourceMappingURL=ArchiveItemDetailPage.js.map
|