@burdenoff/microfe-theculturepost 2026.802.1 → 2026.830.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/CitationList.d.ts +2 -1
- package/dist/theculturepost/components/CitationList.d.ts.map +1 -1
- package/dist/theculturepost/components/CitationList.js +114 -95
- package/dist/theculturepost/components/CitationList.js.map +1 -1
- package/dist/theculturepost/components/SourceScanLink.d.ts +25 -0
- package/dist/theculturepost/components/SourceScanLink.d.ts.map +1 -0
- package/dist/theculturepost/components/SourceScanLink.js +36 -0
- package/dist/theculturepost/components/SourceScanLink.js.map +1 -0
- package/dist/theculturepost/components/index.d.ts +1 -0
- package/dist/theculturepost/components/index.d.ts.map +1 -1
- package/dist/theculturepost/components/index.js +1 -0
- package/dist/theculturepost/hooks/useTr.js +2 -2
- package/dist/theculturepost/hooks/useTr.js.map +1 -1
- package/dist/theculturepost/pages/HomePage.d.ts.map +1 -1
- package/dist/theculturepost/pages/HomePage.js +145 -127
- package/dist/theculturepost/pages/HomePage.js.map +1 -1
- package/dist/theculturepost/pages/governance/GovernancePage.d.ts +3 -1
- package/dist/theculturepost/pages/governance/GovernancePage.d.ts.map +1 -1
- package/dist/theculturepost/pages/governance/GovernancePage.js +122 -99
- package/dist/theculturepost/pages/governance/GovernancePage.js.map +1 -1
- package/dist/theculturepost/pages/stories/StoryDetailPage.d.ts +3 -0
- package/dist/theculturepost/pages/stories/StoryDetailPage.d.ts.map +1 -1
- package/dist/theculturepost/pages/stories/StoryDetailPage.js +202 -132
- package/dist/theculturepost/pages/stories/StoryDetailPage.js.map +1 -1
- package/dist/theculturepost/translations/ar.d.ts +43 -0
- package/dist/theculturepost/translations/ar.d.ts.map +1 -1
- package/dist/theculturepost/translations/ar.js +43 -0
- package/dist/theculturepost/translations/ar.js.map +1 -1
- package/dist/theculturepost/translations/en.d.ts +43 -0
- package/dist/theculturepost/translations/en.d.ts.map +1 -1
- package/dist/theculturepost/translations/en.js +43 -0
- package/dist/theculturepost/translations/en.js.map +1 -1
- package/dist/theculturepost/translations/es.d.ts +43 -0
- package/dist/theculturepost/translations/es.d.ts.map +1 -1
- package/dist/theculturepost/translations/es.js +43 -0
- package/dist/theculturepost/translations/es.js.map +1 -1
- package/dist/theculturepost/translations/hi.d.ts +43 -0
- package/dist/theculturepost/translations/hi.d.ts.map +1 -1
- package/dist/theculturepost/translations/hi.js +43 -0
- package/dist/theculturepost/translations/hi.js.map +1 -1
- package/dist/theculturepost/translations/ta.d.ts +43 -0
- package/dist/theculturepost/translations/ta.d.ts.map +1 -1
- package/dist/theculturepost/translations/ta.js +43 -0
- package/dist/theculturepost/translations/ta.js.map +1 -1
- package/dist/theculturepost/translations/zh.d.ts +43 -0
- package/dist/theculturepost/translations/zh.d.ts.map +1 -1
- package/dist/theculturepost/translations/zh.js +43 -0
- package/dist/theculturepost/translations/zh.js.map +1 -1
- package/package.json +2 -2
|
@@ -18,28 +18,29 @@ import { TagInput as O } from "../../components/TagInput.js";
|
|
|
18
18
|
import { OpenDiscussionDialog as k } from "../../components/OpenDiscussionDialog.js";
|
|
19
19
|
import { LifecycleStepper as A } from "../../components/LifecycleStepper.js";
|
|
20
20
|
import { FileUploadField as j } from "../../components/FileUploadField.js";
|
|
21
|
-
import {
|
|
21
|
+
import { SourceScanLink as M } from "../../components/SourceScanLink.js";
|
|
22
|
+
import { CitationList as N, VERIFICATIONS as P, VERIFICATION_META as F, sourceTypeIcon as I } from "../../components/CitationList.js";
|
|
22
23
|
import { AddCitationDialog as ee } from "../../components/AddCitationDialog.js";
|
|
23
|
-
import { Fragment as
|
|
24
|
-
import { Archive as
|
|
25
|
-
import { useParams as
|
|
26
|
-
import { Fragment as
|
|
27
|
-
import { Button as Y, DropdownMenu as
|
|
24
|
+
import { Fragment as L, useMemo as R, useState as z } from "react";
|
|
25
|
+
import { Archive as B, ArrowLeft as te, BookOpen as ne, Bookmark as re, ChevronDown as ie, Clock as ae, ExternalLink as oe, GitBranch as V, Languages as se, Lightbulb as ce, Lock as le, MessagesSquare as H, Pencil as ue, Plus as U, RotateCcw as de, Scroll as W, Send as G, Share2 as fe, ShieldCheck as K, Sparkles as pe, Tag as me } from "lucide-react";
|
|
26
|
+
import { useParams as he, useSearchParams as ge } from "react-router";
|
|
27
|
+
import { Fragment as _e, jsx as q, jsxs as J } from "react/jsx-runtime";
|
|
28
|
+
import { Button as Y, DropdownMenu as ve, DropdownMenuContent as ye, DropdownMenuItem as be, DropdownMenuTrigger as xe, GlassCard as X, Input as Se, Label as Z, ResponsiveDialog as Ce, ResponsiveDialogContent as we, ResponsiveDialogDescription as Te, ResponsiveDialogFooter as Ee, ResponsiveDialogHeader as De, ResponsiveDialogTitle as Oe, ResponsiveTable as ke, Select as Ae, SelectContent as je, SelectItem as Q, SelectTrigger as Me, SelectValue as Ne, Textarea as Pe } from "@burdenoff/fe-libs/ui";
|
|
28
29
|
//#region src/theculturepost/pages/stories/StoryDetailPage.tsx
|
|
29
|
-
var
|
|
30
|
+
var Fe = ["citations", "editorial"], Ie = {
|
|
30
31
|
IDEA: ["DRAFT"],
|
|
31
32
|
DRAFT: ["IN_REVIEW"],
|
|
32
33
|
IN_REVIEW: ["PUBLISHED", "DRAFT"],
|
|
33
34
|
PUBLISHED: ["ARCHIVED"],
|
|
34
35
|
ARCHIVED: ["PUBLISHED"]
|
|
35
|
-
},
|
|
36
|
+
}, Le = {
|
|
36
37
|
IDEA: {
|
|
37
38
|
label: "Move to Idea",
|
|
38
|
-
icon:
|
|
39
|
+
icon: ce
|
|
39
40
|
},
|
|
40
41
|
DRAFT: {
|
|
41
42
|
label: "Send back to Draft",
|
|
42
|
-
icon:
|
|
43
|
+
icon: de
|
|
43
44
|
},
|
|
44
45
|
IN_REVIEW: {
|
|
45
46
|
label: "Send to Review",
|
|
@@ -52,141 +53,149 @@ var Pe = {
|
|
|
52
53
|
},
|
|
53
54
|
ARCHIVED: {
|
|
54
55
|
label: "Archive",
|
|
55
|
-
icon:
|
|
56
|
+
icon: B
|
|
56
57
|
}
|
|
57
58
|
};
|
|
58
|
-
function
|
|
59
|
-
switch (
|
|
59
|
+
function Re(e) {
|
|
60
|
+
switch (F[e].accent) {
|
|
60
61
|
case "success": return "text-status-success-text";
|
|
61
62
|
case "warning": return "text-status-warning-text";
|
|
62
63
|
case "destructive": return "text-status-error-text";
|
|
63
64
|
default: return "text-text-tertiary";
|
|
64
65
|
}
|
|
65
66
|
}
|
|
66
|
-
function
|
|
67
|
-
let { id: n } =
|
|
67
|
+
function ze() {
|
|
68
|
+
let { id: n } = he(), { navigateTo: o } = e(), [l, f] = ge(), g = l.get("view"), _ = Fe.find((e) => e === g) ?? "reading", v = (e) => {
|
|
68
69
|
f((t) => {
|
|
69
70
|
let n = new URLSearchParams(t);
|
|
70
|
-
return e === "
|
|
71
|
+
return e === "reading" ? n.delete("view") : n.set("view", e), n;
|
|
71
72
|
}, { replace: !0 });
|
|
72
|
-
}, { data:
|
|
73
|
+
}, { data: y, isLoading: S, isError: E, refetch: O } = m(n), A = h(), [j, M] = z(!1), [N, P] = z(!1), [F, I] = z(!1), L = p({
|
|
73
74
|
storyId: n,
|
|
74
75
|
pagination: { limit: 20 }
|
|
75
|
-
}),
|
|
76
|
-
if (
|
|
76
|
+
}), R = L.data?.items ?? [];
|
|
77
|
+
if (S) return /* @__PURE__ */ J("div", {
|
|
77
78
|
className: "mx-auto max-w-6xl p-4 sm:p-6",
|
|
78
79
|
children: [/* @__PURE__ */ J(Y, {
|
|
79
80
|
variant: "ghost",
|
|
80
81
|
size: "sm",
|
|
81
82
|
onClick: () => o("stories"),
|
|
82
|
-
children: [/* @__PURE__ */ q(
|
|
83
|
+
children: [/* @__PURE__ */ q(te, { className: "mr-1.5 h-4 w-4" }), " Stories"]
|
|
83
84
|
}), /* @__PURE__ */ q(a, { label: "Loading story…" })]
|
|
84
85
|
});
|
|
85
|
-
if (
|
|
86
|
+
if (E || !y) return /* @__PURE__ */ J("div", {
|
|
86
87
|
className: "mx-auto max-w-6xl p-4 sm:p-6",
|
|
87
88
|
children: [/* @__PURE__ */ J(Y, {
|
|
88
89
|
variant: "ghost",
|
|
89
90
|
size: "sm",
|
|
90
91
|
onClick: () => o("stories"),
|
|
91
|
-
children: [/* @__PURE__ */ q(
|
|
92
|
+
children: [/* @__PURE__ */ q(te, { className: "mr-1.5 h-4 w-4" }), " Stories"]
|
|
92
93
|
}), /* @__PURE__ */ q(i, {
|
|
93
94
|
title: "Story not found",
|
|
94
95
|
message: "This story may have been archived, or you may not have access.",
|
|
95
|
-
onRetry: () =>
|
|
96
|
+
onRetry: () => O()
|
|
96
97
|
})]
|
|
97
98
|
});
|
|
98
|
-
let
|
|
99
|
-
/* @__PURE__ */ q(u, { status:
|
|
100
|
-
/* @__PURE__ */ q(u, { status:
|
|
101
|
-
|
|
99
|
+
let B = /* @__PURE__ */ J(_e, { children: [
|
|
100
|
+
/* @__PURE__ */ q(u, { status: y.format }),
|
|
101
|
+
/* @__PURE__ */ q(u, { status: y.status }),
|
|
102
|
+
y.topic && /* @__PURE__ */ J("button", {
|
|
102
103
|
type: "button",
|
|
103
|
-
onClick: () => o(`topics/${
|
|
104
|
+
onClick: () => o(`topics/${y.topic.id}`),
|
|
104
105
|
className: "inline-flex items-center gap-1 rounded-full bg-bg-sunken px-2.5 py-0.5 text-xs font-medium text-text-secondary transition-colors hover:text-text-primary",
|
|
105
106
|
children: [
|
|
106
|
-
/* @__PURE__ */ q(
|
|
107
|
+
/* @__PURE__ */ q(me, {
|
|
107
108
|
className: "h-3 w-3",
|
|
108
109
|
"aria-hidden": "true"
|
|
109
110
|
}),
|
|
110
111
|
" ",
|
|
111
|
-
|
|
112
|
+
y.topic.name
|
|
112
113
|
]
|
|
113
114
|
}),
|
|
114
115
|
/* @__PURE__ */ q("span", {
|
|
115
116
|
className: "inline-flex items-center gap-1.5 text-xs text-text-tertiary",
|
|
116
117
|
children: /* @__PURE__ */ q(d, {
|
|
117
|
-
actorId:
|
|
118
|
+
actorId: y.authorId,
|
|
118
119
|
prefix: "By",
|
|
119
120
|
withIcon: !0
|
|
120
121
|
})
|
|
121
122
|
}),
|
|
122
|
-
|
|
123
|
+
y.readingMins > 0 && /* @__PURE__ */ J("span", {
|
|
123
124
|
className: "inline-flex items-center gap-1 text-xs text-text-tertiary",
|
|
124
125
|
children: [
|
|
125
|
-
/* @__PURE__ */ q(
|
|
126
|
+
/* @__PURE__ */ q(ae, {
|
|
126
127
|
className: "h-3.5 w-3.5",
|
|
127
128
|
"aria-hidden": "true"
|
|
128
129
|
}),
|
|
129
130
|
" ",
|
|
130
|
-
c(
|
|
131
|
+
c(y.readingMins),
|
|
131
132
|
" min read"
|
|
132
133
|
]
|
|
133
134
|
}),
|
|
134
|
-
|
|
135
|
+
y.languages.length > 0 && /* @__PURE__ */ J("span", {
|
|
135
136
|
className: "inline-flex items-center gap-1 text-xs text-text-tertiary",
|
|
136
137
|
children: [
|
|
137
|
-
/* @__PURE__ */ q(
|
|
138
|
+
/* @__PURE__ */ q(se, {
|
|
138
139
|
className: "h-3.5 w-3.5",
|
|
139
140
|
"aria-hidden": "true"
|
|
140
141
|
}),
|
|
141
142
|
" ",
|
|
142
|
-
|
|
143
|
+
y.languages.map(s).join(", ")
|
|
143
144
|
]
|
|
144
145
|
})
|
|
145
|
-
] }),
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
146
|
+
] }), ie = [
|
|
147
|
+
{
|
|
148
|
+
value: "reading",
|
|
149
|
+
label: "Reading",
|
|
150
|
+
icon: /* @__PURE__ */ q(ne, { className: "h-4 w-4" })
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
value: "citations",
|
|
154
|
+
label: "Citations",
|
|
155
|
+
icon: /* @__PURE__ */ q(W, { className: "h-4 w-4" }),
|
|
156
|
+
count: y.citations.length
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
value: "editorial",
|
|
160
|
+
label: "Editorial",
|
|
161
|
+
icon: /* @__PURE__ */ q(V, { className: "h-4 w-4" })
|
|
162
|
+
}
|
|
163
|
+
];
|
|
155
164
|
return /* @__PURE__ */ J("div", {
|
|
156
165
|
className: "mx-auto flex max-w-6xl flex-col gap-6 p-4 sm:p-6",
|
|
157
166
|
children: [
|
|
158
167
|
/* @__PURE__ */ q(r, {
|
|
159
168
|
eyebrow: "Story",
|
|
160
|
-
title:
|
|
161
|
-
description:
|
|
162
|
-
coverFileId:
|
|
169
|
+
title: y.title,
|
|
170
|
+
description: y.summary ?? void 0,
|
|
171
|
+
coverFileId: y.cover?.id ?? void 0,
|
|
163
172
|
backAction: {
|
|
164
173
|
label: "Stories",
|
|
165
174
|
onClick: () => o("stories")
|
|
166
175
|
},
|
|
167
|
-
meta:
|
|
176
|
+
meta: B,
|
|
168
177
|
actions: /* @__PURE__ */ J("div", {
|
|
169
178
|
className: "flex items-center gap-2",
|
|
170
179
|
children: [
|
|
171
180
|
/* @__PURE__ */ J(Y, {
|
|
172
|
-
variant:
|
|
181
|
+
variant: y.isBookmarked ? "default" : "outline",
|
|
173
182
|
size: "sm",
|
|
174
183
|
onClick: async () => {
|
|
175
184
|
await C("light");
|
|
176
185
|
try {
|
|
177
|
-
await w(await
|
|
186
|
+
await w(await A.mutateAsync(y.id) ? "Saved to your reading list" : "Removed from your reading list");
|
|
178
187
|
} catch (e) {
|
|
179
188
|
x.error(b(e));
|
|
180
189
|
}
|
|
181
190
|
},
|
|
182
|
-
disabled:
|
|
183
|
-
"aria-pressed":
|
|
184
|
-
"aria-label":
|
|
191
|
+
disabled: A.isPending,
|
|
192
|
+
"aria-pressed": y.isBookmarked,
|
|
193
|
+
"aria-label": y.isBookmarked ? "Remove from reading list" : "Save to reading list",
|
|
185
194
|
"data-tour": "theculturepost-story-bookmark",
|
|
186
195
|
children: [
|
|
187
|
-
/* @__PURE__ */ q(
|
|
196
|
+
/* @__PURE__ */ q(re, { className: t("mr-1.5 h-4 w-4", y.isBookmarked && "fill-current") }),
|
|
188
197
|
" ",
|
|
189
|
-
|
|
198
|
+
y.isBookmarked ? "Saved" : "Save"
|
|
190
199
|
]
|
|
191
200
|
}),
|
|
192
201
|
/* @__PURE__ */ J(Y, {
|
|
@@ -194,19 +203,19 @@ function Ie() {
|
|
|
194
203
|
size: "sm",
|
|
195
204
|
onClick: async () => {
|
|
196
205
|
await C("light"), await T({
|
|
197
|
-
title:
|
|
198
|
-
text:
|
|
206
|
+
title: y.title,
|
|
207
|
+
text: y.summary ?? void 0,
|
|
199
208
|
url: window.location.href
|
|
200
209
|
}) && await w("Link shared");
|
|
201
210
|
},
|
|
202
211
|
"aria-label": "Share story",
|
|
203
|
-
children: [/* @__PURE__ */ q(
|
|
212
|
+
children: [/* @__PURE__ */ q(fe, { className: "mr-1.5 h-4 w-4" }), " Share"]
|
|
204
213
|
}),
|
|
205
214
|
/* @__PURE__ */ J(Y, {
|
|
206
215
|
variant: "outline",
|
|
207
|
-
onClick: () =>
|
|
216
|
+
onClick: () => I(!0),
|
|
208
217
|
"data-tour": "theculturepost-story-edit",
|
|
209
|
-
children: [/* @__PURE__ */ q(
|
|
218
|
+
children: [/* @__PURE__ */ q(ue, { className: "mr-1.5 h-4 w-4" }), " Edit"]
|
|
210
219
|
})
|
|
211
220
|
]
|
|
212
221
|
})
|
|
@@ -214,48 +223,48 @@ function Ie() {
|
|
|
214
223
|
/* @__PURE__ */ q("div", {
|
|
215
224
|
"data-tour": "theculturepost-story-tabs",
|
|
216
225
|
children: /* @__PURE__ */ q(D, {
|
|
217
|
-
items:
|
|
218
|
-
value:
|
|
219
|
-
onChange:
|
|
226
|
+
items: ie,
|
|
227
|
+
value: _,
|
|
228
|
+
onChange: v
|
|
220
229
|
})
|
|
221
230
|
}),
|
|
222
|
-
|
|
223
|
-
story:
|
|
224
|
-
discussions:
|
|
225
|
-
discussionsLoading:
|
|
226
|
-
onViewCitations: () =>
|
|
227
|
-
onOpenDiscussion: () =>
|
|
231
|
+
_ === "reading" ? /* @__PURE__ */ q(Be, {
|
|
232
|
+
story: y,
|
|
233
|
+
discussions: R,
|
|
234
|
+
discussionsLoading: L.isLoading,
|
|
235
|
+
onViewCitations: () => v("citations"),
|
|
236
|
+
onOpenDiscussion: () => P(!0),
|
|
228
237
|
onViewAllDiscussions: () => o("discussions"),
|
|
229
238
|
onOpenDiscussionItem: (e) => o(`discussions/${e.id}`)
|
|
230
|
-
}) :
|
|
231
|
-
story:
|
|
232
|
-
onAddCitation: () =>
|
|
239
|
+
}) : q(_ === "citations" ? Ue : We, {
|
|
240
|
+
story: y,
|
|
241
|
+
onAddCitation: () => M(!0)
|
|
233
242
|
}),
|
|
234
243
|
/* @__PURE__ */ q(ee, {
|
|
235
|
-
open:
|
|
236
|
-
onOpenChange:
|
|
237
|
-
storyId:
|
|
244
|
+
open: j,
|
|
245
|
+
onOpenChange: M,
|
|
246
|
+
storyId: y.id
|
|
238
247
|
}),
|
|
239
248
|
/* @__PURE__ */ q(k, {
|
|
240
|
-
open:
|
|
241
|
-
onOpenChange:
|
|
242
|
-
storyId:
|
|
249
|
+
open: N,
|
|
250
|
+
onOpenChange: P,
|
|
251
|
+
storyId: y.id,
|
|
243
252
|
onCreated: (e) => o(`discussions/${e.id}`)
|
|
244
253
|
}),
|
|
245
|
-
/* @__PURE__ */ q(
|
|
246
|
-
open:
|
|
247
|
-
onOpenChange:
|
|
248
|
-
story:
|
|
254
|
+
/* @__PURE__ */ q(Je, {
|
|
255
|
+
open: F,
|
|
256
|
+
onOpenChange: I,
|
|
257
|
+
story: y
|
|
249
258
|
})
|
|
250
259
|
]
|
|
251
260
|
});
|
|
252
261
|
}
|
|
253
|
-
function
|
|
262
|
+
function Be({ story: e, discussions: t, discussionsLoading: n, onViewCitations: r, onOpenDiscussion: i, onViewAllDiscussions: o, onOpenDiscussionItem: s }) {
|
|
254
263
|
return /* @__PURE__ */ J("div", {
|
|
255
264
|
className: "grid grid-cols-1 gap-8 lg:grid-cols-[minmax(0,1fr)_360px]",
|
|
256
265
|
children: [/* @__PURE__ */ J("article", {
|
|
257
266
|
className: "min-w-0",
|
|
258
|
-
children: [/* @__PURE__ */ q(
|
|
267
|
+
children: [/* @__PURE__ */ q(Ve, { body: e.body }), e.tags.length > 0 && /* @__PURE__ */ q("div", {
|
|
259
268
|
className: "mt-8 flex flex-wrap gap-1.5 border-t border-border-seam pt-6",
|
|
260
269
|
children: e.tags.map((e) => /* @__PURE__ */ J("span", {
|
|
261
270
|
className: "rounded-full bg-bg-sunken px-2.5 py-0.5 text-xs font-medium text-text-secondary",
|
|
@@ -272,7 +281,7 @@ function Le({ story: e, discussions: t, discussionsLoading: n, onViewCitations:
|
|
|
272
281
|
className: "text-xs font-medium text-accent hover:underline",
|
|
273
282
|
children: "View all"
|
|
274
283
|
}),
|
|
275
|
-
children: /* @__PURE__ */ q(
|
|
284
|
+
children: /* @__PURE__ */ q(N, {
|
|
276
285
|
storyId: e.id,
|
|
277
286
|
compact: !0
|
|
278
287
|
})
|
|
@@ -299,7 +308,7 @@ function Le({ story: e, discussions: t, discussionsLoading: n, onViewCitations:
|
|
|
299
308
|
})
|
|
300
309
|
}) : /* @__PURE__ */ q("div", {
|
|
301
310
|
className: "flex flex-col gap-3",
|
|
302
|
-
children: t.slice(0, 5).map((e) => /* @__PURE__ */ q(
|
|
311
|
+
children: t.slice(0, 5).map((e) => /* @__PURE__ */ q(He, {
|
|
303
312
|
discussion: e,
|
|
304
313
|
onOpen: () => s(e)
|
|
305
314
|
}, e.id))
|
|
@@ -317,20 +326,20 @@ function $({ title: e, action: t, children: n }) {
|
|
|
317
326
|
}), t]
|
|
318
327
|
}), n] });
|
|
319
328
|
}
|
|
320
|
-
function
|
|
321
|
-
let n =
|
|
329
|
+
function Ve({ body: e }) {
|
|
330
|
+
let n = R(() => (e ?? "").split(/\n{2,}/).map((e) => e.trim()).filter(Boolean), [e]);
|
|
322
331
|
return n.length === 0 ? /* @__PURE__ */ q("p", {
|
|
323
332
|
className: "rounded-xl border border-dashed border-border-seam px-4 py-10 text-center text-sm text-text-tertiary",
|
|
324
333
|
children: "This story has no body yet. Use Edit to write it."
|
|
325
334
|
}) : /* @__PURE__ */ q("div", {
|
|
326
335
|
className: "max-w-prose",
|
|
327
|
-
children: n.map((e, n) => /* @__PURE__ */ J(
|
|
336
|
+
children: n.map((e, n) => /* @__PURE__ */ J(L, { children: [n === 1 && /* @__PURE__ */ q(E, {}), /* @__PURE__ */ q("p", {
|
|
328
337
|
className: t("text-[1.05rem] leading-8 text-text-primary", n > 0 && n !== 1 && "mt-5", n === 0 && "first-letter:float-left first-letter:mr-3 first-letter:mt-1 first-letter:font-display first-letter:text-6xl first-letter:font-semibold first-letter:leading-[0.72] first-letter:text-accent"),
|
|
329
338
|
children: e
|
|
330
339
|
})] }, n))
|
|
331
340
|
});
|
|
332
341
|
}
|
|
333
|
-
function
|
|
342
|
+
function He({ discussion: e, onOpen: t }) {
|
|
334
343
|
return /* @__PURE__ */ q("button", {
|
|
335
344
|
type: "button",
|
|
336
345
|
onClick: t,
|
|
@@ -367,12 +376,12 @@ function ze({ discussion: e, onOpen: t }) {
|
|
|
367
376
|
/* @__PURE__ */ q("span", { children: l(e.createdAt) }),
|
|
368
377
|
e.isInterfaith && /* @__PURE__ */ q(u, {
|
|
369
378
|
status: "Interfaith",
|
|
370
|
-
icon: /* @__PURE__ */ q(
|
|
379
|
+
icon: /* @__PURE__ */ q(pe, { className: "h-3 w-3" }),
|
|
371
380
|
className: "ml-0.5"
|
|
372
381
|
}),
|
|
373
382
|
e.isLocked && /* @__PURE__ */ J("span", {
|
|
374
383
|
className: "inline-flex items-center gap-1 text-text-tertiary",
|
|
375
|
-
children: [/* @__PURE__ */ q(
|
|
384
|
+
children: [/* @__PURE__ */ q(le, {
|
|
376
385
|
className: "h-3 w-3",
|
|
377
386
|
"aria-hidden": "true"
|
|
378
387
|
}), " Locked"]
|
|
@@ -384,8 +393,37 @@ function ze({ discussion: e, onOpen: t }) {
|
|
|
384
393
|
})
|
|
385
394
|
});
|
|
386
395
|
}
|
|
387
|
-
function
|
|
388
|
-
|
|
396
|
+
function Ue({ story: e, onAddCitation: t }) {
|
|
397
|
+
return /* @__PURE__ */ J(X, {
|
|
398
|
+
treatment: "plain",
|
|
399
|
+
className: "p-5 sm:p-6",
|
|
400
|
+
children: [/* @__PURE__ */ J("div", {
|
|
401
|
+
className: "flex flex-wrap items-start justify-between gap-3",
|
|
402
|
+
children: [/* @__PURE__ */ J("div", {
|
|
403
|
+
className: "flex items-start gap-2.5",
|
|
404
|
+
children: [/* @__PURE__ */ q("span", {
|
|
405
|
+
className: "grid h-9 w-9 shrink-0 place-items-center rounded-xl bg-[var(--color-accent-soft)] text-text-primary",
|
|
406
|
+
"aria-hidden": "true",
|
|
407
|
+
children: /* @__PURE__ */ q(W, { className: "h-5 w-5" })
|
|
408
|
+
}), /* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q("h2", {
|
|
409
|
+
className: "font-display text-xl font-semibold text-text-primary",
|
|
410
|
+
children: "Verifiable sources that ground this story"
|
|
411
|
+
}), /* @__PURE__ */ q("p", {
|
|
412
|
+
className: "mt-0.5 max-w-prose text-sm text-text-secondary",
|
|
413
|
+
children: "Every source is reviewed for credibility and context. Set each one’s verification state as the evidence is checked."
|
|
414
|
+
})] })]
|
|
415
|
+
}), /* @__PURE__ */ J(Y, {
|
|
416
|
+
onClick: t,
|
|
417
|
+
children: [/* @__PURE__ */ q(U, { className: "mr-1.5 h-4 w-4" }), " Add citation"]
|
|
418
|
+
})]
|
|
419
|
+
}), /* @__PURE__ */ q(N, {
|
|
420
|
+
storyId: e.id,
|
|
421
|
+
className: "mt-5"
|
|
422
|
+
})]
|
|
423
|
+
});
|
|
424
|
+
}
|
|
425
|
+
function We({ story: e, onAddCitation: t }) {
|
|
426
|
+
let n = _(), r = Ie[e.status] ?? [], i = async (t) => {
|
|
389
427
|
try {
|
|
390
428
|
await n.mutateAsync({
|
|
391
429
|
id: e.id,
|
|
@@ -421,7 +459,7 @@ function Be({ story: e, onAddCitation: t }) {
|
|
|
421
459
|
children: [r.length > 0 ? /* @__PURE__ */ q("div", {
|
|
422
460
|
className: "flex flex-wrap gap-2",
|
|
423
461
|
children: r.map((e) => {
|
|
424
|
-
let t =
|
|
462
|
+
let t = Le[e], r = t.icon;
|
|
425
463
|
return /* @__PURE__ */ J(Y, {
|
|
426
464
|
variant: t.primary ? "default" : "outline",
|
|
427
465
|
onClick: () => i(e),
|
|
@@ -469,7 +507,7 @@ function Be({ story: e, onAddCitation: t }) {
|
|
|
469
507
|
children: [/* @__PURE__ */ q(U, { className: "mr-1.5 h-4 w-4" }), " Add citation"]
|
|
470
508
|
})]
|
|
471
509
|
}),
|
|
472
|
-
/* @__PURE__ */ q(
|
|
510
|
+
/* @__PURE__ */ q(Ge, {
|
|
473
511
|
storyId: e.id,
|
|
474
512
|
className: "mt-5"
|
|
475
513
|
}),
|
|
@@ -484,7 +522,7 @@ function Be({ story: e, onAddCitation: t }) {
|
|
|
484
522
|
})]
|
|
485
523
|
});
|
|
486
524
|
}
|
|
487
|
-
function
|
|
525
|
+
function Ge({ storyId: e, className: n }) {
|
|
488
526
|
let { data: r, isLoading: s, isError: c, refetch: l } = f(e);
|
|
489
527
|
return s ? /* @__PURE__ */ q(a, {
|
|
490
528
|
label: "Loading citations…",
|
|
@@ -495,7 +533,7 @@ function Ve({ storyId: e, className: n }) {
|
|
|
495
533
|
message: "We couldn't load citations.",
|
|
496
534
|
onRetry: () => l()
|
|
497
535
|
})
|
|
498
|
-
}) : /* @__PURE__ */ q(
|
|
536
|
+
}) : /* @__PURE__ */ q(ke, {
|
|
499
537
|
className: n,
|
|
500
538
|
columns: [
|
|
501
539
|
{
|
|
@@ -503,7 +541,11 @@ function Ve({ storyId: e, className: n }) {
|
|
|
503
541
|
header: "Source",
|
|
504
542
|
priority: "primary",
|
|
505
543
|
cell: (e) => {
|
|
506
|
-
let t =
|
|
544
|
+
let t = I(e.sourceType), n = o(e.publishedOn), r = [
|
|
545
|
+
e.author,
|
|
546
|
+
e.publisher,
|
|
547
|
+
n === "—" ? null : n
|
|
548
|
+
].filter((e) => e && e.trim()).join(" · ");
|
|
507
549
|
return /* @__PURE__ */ J("div", {
|
|
508
550
|
className: "flex min-w-0 items-start gap-3",
|
|
509
551
|
children: [/* @__PURE__ */ q("span", {
|
|
@@ -521,9 +563,37 @@ function Ve({ storyId: e, className: n }) {
|
|
|
521
563
|
className: "mt-0.5 line-clamp-1 text-xs italic text-text-tertiary",
|
|
522
564
|
children: e.excerpt
|
|
523
565
|
}),
|
|
524
|
-
|
|
566
|
+
r && /* @__PURE__ */ q("p", {
|
|
525
567
|
className: "mt-0.5 text-xs text-text-tertiary",
|
|
526
|
-
children:
|
|
568
|
+
children: r
|
|
569
|
+
}),
|
|
570
|
+
e.provenance && /* @__PURE__ */ J("p", {
|
|
571
|
+
className: "mt-0.5 line-clamp-1 text-xs text-text-tertiary",
|
|
572
|
+
title: e.provenance,
|
|
573
|
+
children: [
|
|
574
|
+
/* @__PURE__ */ q("span", {
|
|
575
|
+
className: "font-medium text-text-secondary",
|
|
576
|
+
children: "Provenance:"
|
|
577
|
+
}),
|
|
578
|
+
" ",
|
|
579
|
+
e.provenance
|
|
580
|
+
]
|
|
581
|
+
}),
|
|
582
|
+
(e.url || e.sourceFile) && /* @__PURE__ */ J("div", {
|
|
583
|
+
className: "mt-1 flex flex-wrap items-center gap-x-3 gap-y-1",
|
|
584
|
+
children: [e.url && /* @__PURE__ */ J("a", {
|
|
585
|
+
href: e.url,
|
|
586
|
+
target: "_blank",
|
|
587
|
+
rel: "noreferrer noopener",
|
|
588
|
+
className: "inline-flex items-center gap-1 text-xs font-medium text-accent hover:underline",
|
|
589
|
+
children: ["Open source", /* @__PURE__ */ q(oe, {
|
|
590
|
+
className: "h-3 w-3 shrink-0",
|
|
591
|
+
"aria-hidden": "true"
|
|
592
|
+
})]
|
|
593
|
+
}), /* @__PURE__ */ q(M, {
|
|
594
|
+
fileId: e.sourceFile?.id,
|
|
595
|
+
label: "View scan"
|
|
596
|
+
})]
|
|
527
597
|
})
|
|
528
598
|
]
|
|
529
599
|
})]
|
|
@@ -535,7 +605,7 @@ function Ve({ storyId: e, className: n }) {
|
|
|
535
605
|
header: "Type",
|
|
536
606
|
cell: (e) => /* @__PURE__ */ q(u, {
|
|
537
607
|
status: e.sourceType,
|
|
538
|
-
icon: /* @__PURE__ */ q(
|
|
608
|
+
icon: /* @__PURE__ */ q(I(e.sourceType), { className: "h-3 w-3" })
|
|
539
609
|
})
|
|
540
610
|
},
|
|
541
611
|
{
|
|
@@ -551,10 +621,10 @@ function Ve({ storyId: e, className: n }) {
|
|
|
551
621
|
key: "verification",
|
|
552
622
|
header: "Status",
|
|
553
623
|
cell: (e) => {
|
|
554
|
-
let n =
|
|
624
|
+
let n = F[e.verification].icon;
|
|
555
625
|
return /* @__PURE__ */ q(u, {
|
|
556
626
|
status: e.verification,
|
|
557
|
-
icon: /* @__PURE__ */ q(n, { className: t("h-3 w-3",
|
|
627
|
+
icon: /* @__PURE__ */ q(n, { className: t("h-3 w-3", Re(e.verification)) })
|
|
558
628
|
});
|
|
559
629
|
}
|
|
560
630
|
},
|
|
@@ -563,7 +633,7 @@ function Ve({ storyId: e, className: n }) {
|
|
|
563
633
|
header: "Actions",
|
|
564
634
|
headerClassName: "text-right",
|
|
565
635
|
cellClassName: "text-right",
|
|
566
|
-
cell: (e) => /* @__PURE__ */ q(
|
|
636
|
+
cell: (e) => /* @__PURE__ */ q(Ke, { citation: e })
|
|
567
637
|
}
|
|
568
638
|
],
|
|
569
639
|
data: r ?? [],
|
|
@@ -575,7 +645,7 @@ function Ve({ storyId: e, className: n }) {
|
|
|
575
645
|
})
|
|
576
646
|
});
|
|
577
647
|
}
|
|
578
|
-
function
|
|
648
|
+
function Ke({ citation: e }) {
|
|
579
649
|
let n = y(), r = async (t) => {
|
|
580
650
|
if (t !== e.verification) try {
|
|
581
651
|
await n.mutateAsync({
|
|
@@ -586,34 +656,34 @@ function He({ citation: e }) {
|
|
|
586
656
|
x.error("Could not update verification", b(e));
|
|
587
657
|
}
|
|
588
658
|
};
|
|
589
|
-
return /* @__PURE__ */ J(
|
|
659
|
+
return /* @__PURE__ */ J(ve, { children: [/* @__PURE__ */ q(xe, {
|
|
590
660
|
asChild: !0,
|
|
591
661
|
children: /* @__PURE__ */ J(Y, {
|
|
592
662
|
size: "sm",
|
|
593
663
|
variant: "outline",
|
|
594
664
|
disabled: n.isPending,
|
|
595
665
|
"aria-label": `Change verification for ${e.title}`,
|
|
596
|
-
children: ["Verify ", /* @__PURE__ */ q(
|
|
666
|
+
children: ["Verify ", /* @__PURE__ */ q(ie, {
|
|
597
667
|
className: "ml-1 h-4 w-4",
|
|
598
668
|
"aria-hidden": "true"
|
|
599
669
|
})]
|
|
600
670
|
})
|
|
601
|
-
}), /* @__PURE__ */ q(
|
|
671
|
+
}), /* @__PURE__ */ q(ye, {
|
|
602
672
|
align: "end",
|
|
603
|
-
children:
|
|
604
|
-
let i =
|
|
605
|
-
return /* @__PURE__ */ J(
|
|
673
|
+
children: P.map((n) => {
|
|
674
|
+
let i = F[n], a = i.icon;
|
|
675
|
+
return /* @__PURE__ */ J(be, {
|
|
606
676
|
onSelect: () => r(n),
|
|
607
677
|
className: t("gap-2", n === e.verification && "font-semibold"),
|
|
608
678
|
children: [/* @__PURE__ */ q(a, {
|
|
609
|
-
className: t("h-4 w-4",
|
|
679
|
+
className: t("h-4 w-4", Re(n)),
|
|
610
680
|
"aria-hidden": "true"
|
|
611
681
|
}), i.label]
|
|
612
682
|
}, n);
|
|
613
683
|
})
|
|
614
684
|
})] });
|
|
615
685
|
}
|
|
616
|
-
var
|
|
686
|
+
var qe = [
|
|
617
687
|
"ARTICLE",
|
|
618
688
|
"ESSAY",
|
|
619
689
|
"EXPLAINER",
|
|
@@ -621,15 +691,15 @@ var Ue = [
|
|
|
621
691
|
"PHOTO_STORY",
|
|
622
692
|
"TIMELINE"
|
|
623
693
|
];
|
|
624
|
-
function
|
|
625
|
-
let i = v(), a = g({ pagination: { limit: 100 } }), [o, c] =
|
|
626
|
-
return P !== N && (F(N), c(r.title), u(r.summary ?? ""), f(r.body ?? ""), m(r.format), _(r.topicId ?? ""), S(r.languages), w(r.tags), E(r.readingMins ? String(r.readingMins) : ""), k(r.cover?.id ?? null), M(null)), /* @__PURE__ */ q(
|
|
694
|
+
function Je({ open: e, onOpenChange: t, story: r }) {
|
|
695
|
+
let i = v(), a = g({ pagination: { limit: 100 } }), [o, c] = z(r.title), [l, u] = z(r.summary ?? ""), [d, f] = z(r.body ?? ""), [p, m] = z(r.format), [h, _] = z(r.topicId ?? ""), [y, S] = z(r.languages), [C, w] = z(r.tags), [T, E] = z(r.readingMins ? String(r.readingMins) : ""), [D, k] = z(r.cover?.id ?? null), [A, M] = z(null), N = R(() => `${r.id}:${r.updatedAt}`, [r.id, r.updatedAt]), [P, F] = z(N);
|
|
696
|
+
return P !== N && (F(N), c(r.title), u(r.summary ?? ""), f(r.body ?? ""), m(r.format), _(r.topicId ?? ""), S(r.languages), w(r.tags), E(r.readingMins ? String(r.readingMins) : ""), k(r.cover?.id ?? null), M(null)), /* @__PURE__ */ q(Ce, {
|
|
627
697
|
open: e,
|
|
628
698
|
onOpenChange: t,
|
|
629
|
-
children: /* @__PURE__ */ J(
|
|
699
|
+
children: /* @__PURE__ */ J(we, {
|
|
630
700
|
className: "sm:max-w-lg",
|
|
631
701
|
children: [
|
|
632
|
-
/* @__PURE__ */ J(
|
|
702
|
+
/* @__PURE__ */ J(De, { children: [/* @__PURE__ */ q(Oe, { children: "Edit story" }), /* @__PURE__ */ q(Te, { children: "Refine the story. The URL slug is fixed once created." })] }),
|
|
633
703
|
/* @__PURE__ */ J("div", {
|
|
634
704
|
className: "flex max-h-[62vh] flex-col gap-4 overflow-y-auto py-2",
|
|
635
705
|
children: [
|
|
@@ -649,7 +719,7 @@ function We({ open: e, onOpenChange: t, story: r }) {
|
|
|
649
719
|
children: [/* @__PURE__ */ q(Z, {
|
|
650
720
|
htmlFor: "edit-title",
|
|
651
721
|
children: "Title"
|
|
652
|
-
}), /* @__PURE__ */ q(
|
|
722
|
+
}), /* @__PURE__ */ q(Se, {
|
|
653
723
|
id: "edit-title",
|
|
654
724
|
value: o,
|
|
655
725
|
onChange: (e) => c(e.target.value)
|
|
@@ -659,10 +729,10 @@ function We({ open: e, onOpenChange: t, story: r }) {
|
|
|
659
729
|
className: "grid grid-cols-2 gap-3",
|
|
660
730
|
children: [/* @__PURE__ */ J("div", {
|
|
661
731
|
className: "grid gap-1.5",
|
|
662
|
-
children: [/* @__PURE__ */ q(Z, { children: "Format" }), /* @__PURE__ */ J(
|
|
732
|
+
children: [/* @__PURE__ */ q(Z, { children: "Format" }), /* @__PURE__ */ J(Ae, {
|
|
663
733
|
value: p,
|
|
664
734
|
onValueChange: (e) => m(e),
|
|
665
|
-
children: [/* @__PURE__ */ q(
|
|
735
|
+
children: [/* @__PURE__ */ q(Me, { children: /* @__PURE__ */ q(Ne, {}) }), /* @__PURE__ */ q(je, { children: qe.map((e) => /* @__PURE__ */ q(Q, {
|
|
666
736
|
value: e,
|
|
667
737
|
children: s(e)
|
|
668
738
|
}, e)) })]
|
|
@@ -672,7 +742,7 @@ function We({ open: e, onOpenChange: t, story: r }) {
|
|
|
672
742
|
children: [/* @__PURE__ */ q(Z, {
|
|
673
743
|
htmlFor: "edit-reading",
|
|
674
744
|
children: "Reading time (min)"
|
|
675
|
-
}), /* @__PURE__ */ q(
|
|
745
|
+
}), /* @__PURE__ */ q(Se, {
|
|
676
746
|
id: "edit-reading",
|
|
677
747
|
type: "number",
|
|
678
748
|
min: 0,
|
|
@@ -683,10 +753,10 @@ function We({ open: e, onOpenChange: t, story: r }) {
|
|
|
683
753
|
}),
|
|
684
754
|
/* @__PURE__ */ J("div", {
|
|
685
755
|
className: "grid gap-1.5",
|
|
686
|
-
children: [/* @__PURE__ */ q(Z, { children: "Topic" }), /* @__PURE__ */ J(
|
|
756
|
+
children: [/* @__PURE__ */ q(Z, { children: "Topic" }), /* @__PURE__ */ J(Ae, {
|
|
687
757
|
value: h,
|
|
688
758
|
onValueChange: _,
|
|
689
|
-
children: [/* @__PURE__ */ q(
|
|
759
|
+
children: [/* @__PURE__ */ q(Me, { children: /* @__PURE__ */ q(Ne, { placeholder: "Choose a topic (optional)" }) }), /* @__PURE__ */ q(je, { children: (a.data?.items ?? []).map((e) => /* @__PURE__ */ q(Q, {
|
|
690
760
|
value: e.id,
|
|
691
761
|
children: e.name
|
|
692
762
|
}, e.id)) })]
|
|
@@ -697,7 +767,7 @@ function We({ open: e, onOpenChange: t, story: r }) {
|
|
|
697
767
|
children: [/* @__PURE__ */ q(Z, {
|
|
698
768
|
htmlFor: "edit-summary",
|
|
699
769
|
children: "Summary"
|
|
700
|
-
}), /* @__PURE__ */ q(
|
|
770
|
+
}), /* @__PURE__ */ q(Pe, {
|
|
701
771
|
id: "edit-summary",
|
|
702
772
|
value: l,
|
|
703
773
|
onChange: (e) => u(e.target.value),
|
|
@@ -709,7 +779,7 @@ function We({ open: e, onOpenChange: t, story: r }) {
|
|
|
709
779
|
children: [/* @__PURE__ */ q(Z, {
|
|
710
780
|
htmlFor: "edit-body",
|
|
711
781
|
children: "Body"
|
|
712
|
-
}), /* @__PURE__ */ q(
|
|
782
|
+
}), /* @__PURE__ */ q(Pe, {
|
|
713
783
|
id: "edit-body",
|
|
714
784
|
value: d,
|
|
715
785
|
onChange: (e) => f(e.target.value),
|
|
@@ -745,7 +815,7 @@ function We({ open: e, onOpenChange: t, story: r }) {
|
|
|
745
815
|
})
|
|
746
816
|
]
|
|
747
817
|
}),
|
|
748
|
-
/* @__PURE__ */ J(
|
|
818
|
+
/* @__PURE__ */ J(Ee, { children: [/* @__PURE__ */ q(Y, {
|
|
749
819
|
variant: "outline",
|
|
750
820
|
onClick: () => t(!1),
|
|
751
821
|
children: "Cancel"
|
|
@@ -782,6 +852,6 @@ function We({ open: e, onOpenChange: t, story: r }) {
|
|
|
782
852
|
});
|
|
783
853
|
}
|
|
784
854
|
//#endregion
|
|
785
|
-
export {
|
|
855
|
+
export { ze as StoryDetailPage };
|
|
786
856
|
|
|
787
857
|
//# sourceMappingURL=StoryDetailPage.js.map
|