@burdenoff/microfe-theculturepost 2026.1117.1 → 2026.1122.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/TheCulturePostRoutes.js +13 -0
- package/dist/theculturepost/TheCulturePostRoutes.js.map +1 -1
- package/dist/theculturepost/components/AiContextPanel.d.ts +1 -1
- package/dist/theculturepost/components/AiContextPanel.js +146 -132
- package/dist/theculturepost/components/AiContextPanel.js.map +1 -1
- package/dist/theculturepost/components/OpenDiscussionDialog.js +60 -59
- package/dist/theculturepost/components/OpenDiscussionDialog.js.map +1 -1
- package/dist/theculturepost/components/StatusBadge.js +3 -0
- package/dist/theculturepost/components/StatusBadge.js.map +1 -1
- package/dist/theculturepost/components/index.js +2 -2
- package/dist/theculturepost/hooks/index.js +7 -7
- package/dist/theculturepost/hooks/useTcpApi.d.ts +19 -1
- package/dist/theculturepost/hooks/useTcpApi.js +110 -45
- package/dist/theculturepost/hooks/useTcpApi.js.map +1 -1
- package/dist/theculturepost/pages/discussions/DiscussionsPage.js +52 -51
- package/dist/theculturepost/pages/discussions/DiscussionsPage.js.map +1 -1
- package/dist/theculturepost/pages/governance/ContributorOnboardingPanel.d.ts +1 -0
- package/dist/theculturepost/pages/governance/ContributorOnboardingPanel.js +298 -0
- package/dist/theculturepost/pages/governance/ContributorOnboardingPanel.js.map +1 -0
- package/dist/theculturepost/pages/governance/EditorialReviewQueuePanel.d.ts +7 -0
- package/dist/theculturepost/pages/governance/EditorialReviewQueuePanel.js +185 -0
- package/dist/theculturepost/pages/governance/EditorialReviewQueuePanel.js.map +1 -0
- package/dist/theculturepost/pages/governance/GovernancePage.d.ts +11 -17
- package/dist/theculturepost/pages/governance/GovernancePage.js +324 -213
- package/dist/theculturepost/pages/governance/GovernancePage.js.map +1 -1
- package/dist/theculturepost/pages/governance/ModerationControlsPanel.d.ts +4 -0
- package/dist/theculturepost/pages/governance/ModerationControlsPanel.js +256 -0
- package/dist/theculturepost/pages/governance/ModerationControlsPanel.js.map +1 -0
- package/dist/theculturepost/pages/governance/TopicSettingsPanel.d.ts +1 -0
- package/dist/theculturepost/pages/governance/TopicSettingsPanel.js +298 -0
- package/dist/theculturepost/pages/governance/TopicSettingsPanel.js.map +1 -0
- package/dist/theculturepost/types/index.d.ts +23 -0
- package/package.json +1 -1
|
@@ -10,6 +10,7 @@ import { Spinner as f } from "@burdenoff/fe-libs/ui";
|
|
|
10
10
|
var p = {
|
|
11
11
|
home: "theculturepost.home",
|
|
12
12
|
overview: "theculturepost.overview",
|
|
13
|
+
admin: "theculturepost.admin",
|
|
13
14
|
stories: "theculturepost.stories",
|
|
14
15
|
topics: "theculturepost.topics",
|
|
15
16
|
timeline: "theculturepost.timeline",
|
|
@@ -57,6 +58,18 @@ var g = i(() => import("./pages/stories/StoriesPage.js").then((e) => ({ default:
|
|
|
57
58
|
path: "overview",
|
|
58
59
|
element: h(/* @__PURE__ */ u(T, {}), p.overview)
|
|
59
60
|
}),
|
|
61
|
+
/* @__PURE__ */ u(s, {
|
|
62
|
+
path: "overview/:tab",
|
|
63
|
+
element: h(/* @__PURE__ */ u(T, {}), p.overview)
|
|
64
|
+
}),
|
|
65
|
+
/* @__PURE__ */ u(s, {
|
|
66
|
+
path: "admin",
|
|
67
|
+
element: h(/* @__PURE__ */ u(T, { defaultTab: "review" }), p.admin)
|
|
68
|
+
}),
|
|
69
|
+
/* @__PURE__ */ u(s, {
|
|
70
|
+
path: "admin/:tab",
|
|
71
|
+
element: h(/* @__PURE__ */ u(T, {}), p.admin)
|
|
72
|
+
}),
|
|
60
73
|
/* @__PURE__ */ u(s, {
|
|
61
74
|
path: "stories",
|
|
62
75
|
element: h(/* @__PURE__ */ u(g, {}), p.stories)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TheCulturePostRoutes.js","names":["FEATURE","FeatureDisabledFallback","gated","FeatureGate","element","StoriesPage","lazy","m","StoryDetailPage","StoryCitationsPage","SavedStoriesPage","TopicsPage","TopicDetailPage","DiscussionsPage","DiscussionDetailPage","TimelinePage","GovernancePage","ArchivePage","CollectionDetailPage","ArchiveItemDetailPage","PageLoader","Spinner","TheCulturePostRoutes","useTheCulturePost","location","useLocation","normalizedBasePath","basePath","isStandalone","Suspense","Routes","Route","HomePage","Navigate"],"sources":["../../src/theculturepost/TheCulturePostRoutes.tsx"],"sourcesContent":["/**\n * TheCulturePost Routes\n * @module theculturepost\n *\n * Domain routes. The editorial home page is eager-loaded (primary landing); all\n * other pages are lazy-loaded. Every route maps to a real `tcp*` backend\n * capability.\n */\n\nimport { type FC, lazy, Suspense, type ReactElement } from 'react';\nimport { Routes, Route, Navigate, useLocation } from 'react-router';\nimport { Spinner } from '@burdenoff/fe-libs/ui';\nimport { FeatureGate } from '@burdenoff/fe-libs/shared/feature-flags';\nimport { useTheCulturePost } from './context/TheCulturePostContext';\nimport { usePageAnalytics } from './hooks/usePageAnalytics';\n\nconst FEATURE = {\n home: 'theculturepost.home',\n overview: 'theculturepost.overview',\n stories: 'theculturepost.stories',\n topics: 'theculturepost.topics',\n timeline: 'theculturepost.timeline',\n discussions: 'theculturepost.discussions',\n archive: 'theculturepost.archive',\n saved: 'theculturepost.saved',\n} as const;\n\nfunction FeatureDisabledFallback(): ReactElement {\n return (\n <div className=\"flex min-h-[400px] flex-col items-center justify-center gap-3 text-text-secondary\">\n <span className=\"text-lg font-semibold text-text-primary\">Feature unavailable</span>\n <span className=\"text-sm\">This page is disabled in your workspace.</span>\n </div>\n );\n}\n\nfunction gated(element: ReactElement, flag: string): ReactElement {\n return (\n <FeatureGate flag={flag} defaultValue fallback={<FeatureDisabledFallback />}>\n {element}\n </FeatureGate>\n );\n}\n\n// Eager — primary landing\nimport { HomePage } from './pages/HomePage';\n\n// Stories\nconst StoriesPage = lazy(() =>\n import('./pages/stories/StoriesPage').then((m) => ({ default: m.StoriesPage }))\n);\nconst StoryDetailPage = lazy(() =>\n import('./pages/stories/StoryDetailPage').then((m) => ({ default: m.StoryDetailPage }))\n);\nconst StoryCitationsPage = lazy(() =>\n import('./pages/stories/StoryCitationsPage').then((m) => ({ default: m.StoryCitationsPage }))\n);\nconst SavedStoriesPage = lazy(() =>\n import('./pages/stories/SavedStoriesPage').then((m) => ({ default: m.SavedStoriesPage }))\n);\n\n// Topics\nconst TopicsPage = lazy(() =>\n import('./pages/topics/TopicsPage').then((m) => ({ default: m.TopicsPage }))\n);\nconst TopicDetailPage = lazy(() =>\n import('./pages/topics/TopicDetailPage').then((m) => ({ default: m.TopicDetailPage }))\n);\n\n// Discussions\nconst DiscussionsPage = lazy(() =>\n import('./pages/discussions/DiscussionsPage').then((m) => ({ default: m.DiscussionsPage }))\n);\nconst DiscussionDetailPage = lazy(() =>\n import('./pages/discussions/DiscussionDetailPage').then((m) => ({\n default: m.DiscussionDetailPage,\n }))\n);\n\n// Timeline\nconst TimelinePage = lazy(() =>\n import('./pages/timeline/TimelinePage').then((m) => ({ default: m.TimelinePage }))\n);\n\n// Governance / Overview\nconst GovernancePage = lazy(() =>\n import('./pages/governance/GovernancePage').then((m) => ({ default: m.GovernancePage }))\n);\n\n// Archive\nconst ArchivePage = lazy(() =>\n import('./pages/archive/ArchivePage').then((m) => ({ default: m.ArchivePage }))\n);\nconst CollectionDetailPage = lazy(() =>\n import('./pages/archive/CollectionDetailPage').then((m) => ({ default: m.CollectionDetailPage }))\n);\nconst ArchiveItemDetailPage = lazy(() =>\n import('./pages/archive/ArchiveItemDetailPage').then((m) => ({\n default: m.ArchiveItemDetailPage,\n }))\n);\n\nconst PageLoader: FC = () => (\n <div className=\"flex min-h-[400px] items-center justify-center\">\n <Spinner size=\"lg\" />\n </div>\n);\n\nexport const TheCulturePostRoutes: FC = () => {\n const { basePath, isStandalone } = useTheCulturePost();\n const location = useLocation();\n\n usePageAnalytics();\n\n const normalizedBasePath = basePath === '/' ? '' : (basePath ?? '').replace(/\\/$/, '');\n\n // Guard: only render if the current path matches basePath (integrated mode).\n if (normalizedBasePath && !isStandalone) {\n const pathMatches =\n location.pathname === normalizedBasePath ||\n location.pathname.startsWith(normalizedBasePath + '/');\n if (!pathMatches) {\n return null;\n }\n }\n\n return (\n <div className=\"flex min-h-full flex-col\">\n <Suspense fallback={<PageLoader />}>\n <Routes>\n <Route index element={gated(<HomePage />, FEATURE.home)} />\n\n <Route path=\"overview\" element={gated(<GovernancePage />, FEATURE.overview)} />\n\n <Route path=\"stories\" element={gated(<StoriesPage />, FEATURE.stories)} />\n <Route path=\"stories/:id\" element={gated(<StoryDetailPage />, FEATURE.stories)} />\n <Route\n path=\"stories/:id/citations\"\n element={gated(<StoryCitationsPage />, FEATURE.stories)}\n />\n\n <Route path=\"saved\" element={gated(<SavedStoriesPage />, FEATURE.saved)} />\n\n <Route path=\"topics\" element={gated(<TopicsPage />, FEATURE.topics)} />\n <Route path=\"topics/:id\" element={gated(<TopicDetailPage />, FEATURE.topics)} />\n\n <Route path=\"timeline\" element={gated(<TimelinePage />, FEATURE.timeline)} />\n\n <Route path=\"discussions\" element={gated(<DiscussionsPage />, FEATURE.discussions)} />\n <Route\n path=\"discussions/:id\"\n element={gated(<DiscussionDetailPage />, FEATURE.discussions)}\n />\n\n <Route path=\"archive\" element={gated(<ArchivePage />, FEATURE.archive)} />\n <Route\n path=\"archive/collections/:id\"\n element={gated(<CollectionDetailPage />, FEATURE.archive)}\n />\n <Route\n path=\"archive/items/:id\"\n element={gated(<ArchiveItemDetailPage />, FEATURE.archive)}\n />\n\n <Route path=\"*\" element={<Navigate to=\"\" replace />} />\n </Routes>\n </Suspense>\n </div>\n );\n};\n"],"mappings":";;;;;;;;;AAgBA,IAAMA,IAAU;CACd,MAAM;CACN,UAAU;CACV,SAAS;CACT,QAAQ;CACR,UAAU;CACV,aAAa;CACb,SAAS;CACT,OAAO;AACT;AAEA,SAASC,IAAwC;CAC/C,OACE,kBAAC,OAAD;EAAK,WAAU;EAAf,UAAA,CACE,kBAAC,QAAD;GAAM,WAAU;GAA0C,UAAA;EAAyB,CAAA,GAC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E","FeatureDisabledFallback","gated","FeatureGate","element","StoriesPage","lazy","m","StoryDetailPage","StoryCitationsPage","SavedStoriesPage","TopicsPage","TopicDetailPage","DiscussionsPage","DiscussionDetailPage","TimelinePage","GovernancePage","ArchivePage","CollectionDetailPage","ArchiveItemDetailPage","PageLoader","Spinner","TheCulturePostRoutes","useTheCulturePost","location","useLocation","normalizedBasePath","basePath","isStandalone","Suspense","Routes","Route","HomePage","Navigate"],"sources":["../../src/theculturepost/TheCulturePostRoutes.tsx"],"sourcesContent":["/**\n * TheCulturePost Routes\n * @module theculturepost\n *\n * Domain routes. The editorial home page is eager-loaded (primary landing); all\n * other pages are lazy-loaded. Every route maps to a real `tcp*` backend\n * capability.\n */\n\nimport { type FC, lazy, Suspense, type ReactElement } from 'react';\nimport { Routes, Route, Navigate, useLocation } from 'react-router';\nimport { Spinner } from '@burdenoff/fe-libs/ui';\nimport { FeatureGate } from '@burdenoff/fe-libs/shared/feature-flags';\nimport { useTheCulturePost } from './context/TheCulturePostContext';\nimport { usePageAnalytics } from './hooks/usePageAnalytics';\n\nconst FEATURE = {\n home: 'theculturepost.home',\n overview: 'theculturepost.overview',\n admin: 'theculturepost.admin',\n stories: 'theculturepost.stories',\n topics: 'theculturepost.topics',\n timeline: 'theculturepost.timeline',\n discussions: 'theculturepost.discussions',\n archive: 'theculturepost.archive',\n saved: 'theculturepost.saved',\n} as const;\n\nfunction FeatureDisabledFallback(): ReactElement {\n return (\n <div className=\"flex min-h-[400px] flex-col items-center justify-center gap-3 text-text-secondary\">\n <span className=\"text-lg font-semibold text-text-primary\">Feature unavailable</span>\n <span className=\"text-sm\">This page is disabled in your workspace.</span>\n </div>\n );\n}\n\nfunction gated(element: ReactElement, flag: string): ReactElement {\n return (\n <FeatureGate flag={flag} defaultValue fallback={<FeatureDisabledFallback />}>\n {element}\n </FeatureGate>\n );\n}\n\n// Eager — primary landing\nimport { HomePage } from './pages/HomePage';\n\n// Stories\nconst StoriesPage = lazy(() =>\n import('./pages/stories/StoriesPage').then((m) => ({ default: m.StoriesPage }))\n);\nconst StoryDetailPage = lazy(() =>\n import('./pages/stories/StoryDetailPage').then((m) => ({ default: m.StoryDetailPage }))\n);\nconst StoryCitationsPage = lazy(() =>\n import('./pages/stories/StoryCitationsPage').then((m) => ({ default: m.StoryCitationsPage }))\n);\nconst SavedStoriesPage = lazy(() =>\n import('./pages/stories/SavedStoriesPage').then((m) => ({ default: m.SavedStoriesPage }))\n);\n\n// Topics\nconst TopicsPage = lazy(() =>\n import('./pages/topics/TopicsPage').then((m) => ({ default: m.TopicsPage }))\n);\nconst TopicDetailPage = lazy(() =>\n import('./pages/topics/TopicDetailPage').then((m) => ({ default: m.TopicDetailPage }))\n);\n\n// Discussions\nconst DiscussionsPage = lazy(() =>\n import('./pages/discussions/DiscussionsPage').then((m) => ({ default: m.DiscussionsPage }))\n);\nconst DiscussionDetailPage = lazy(() =>\n import('./pages/discussions/DiscussionDetailPage').then((m) => ({\n default: m.DiscussionDetailPage,\n }))\n);\n\n// Timeline\nconst TimelinePage = lazy(() =>\n import('./pages/timeline/TimelinePage').then((m) => ({ default: m.TimelinePage }))\n);\n\n// Governance / Overview\nconst GovernancePage = lazy(() =>\n import('./pages/governance/GovernancePage').then((m) => ({ default: m.GovernancePage }))\n);\n\n// Archive\nconst ArchivePage = lazy(() =>\n import('./pages/archive/ArchivePage').then((m) => ({ default: m.ArchivePage }))\n);\nconst CollectionDetailPage = lazy(() =>\n import('./pages/archive/CollectionDetailPage').then((m) => ({ default: m.CollectionDetailPage }))\n);\nconst ArchiveItemDetailPage = lazy(() =>\n import('./pages/archive/ArchiveItemDetailPage').then((m) => ({\n default: m.ArchiveItemDetailPage,\n }))\n);\n\nconst PageLoader: FC = () => (\n <div className=\"flex min-h-[400px] items-center justify-center\">\n <Spinner size=\"lg\" />\n </div>\n);\n\nexport const TheCulturePostRoutes: FC = () => {\n const { basePath, isStandalone } = useTheCulturePost();\n const location = useLocation();\n\n usePageAnalytics();\n\n const normalizedBasePath = basePath === '/' ? '' : (basePath ?? '').replace(/\\/$/, '');\n\n // Guard: only render if the current path matches basePath (integrated mode).\n if (normalizedBasePath && !isStandalone) {\n const pathMatches =\n location.pathname === normalizedBasePath ||\n location.pathname.startsWith(normalizedBasePath + '/');\n if (!pathMatches) {\n return null;\n }\n }\n\n return (\n <div className=\"flex min-h-full flex-col\">\n <Suspense fallback={<PageLoader />}>\n <Routes>\n <Route index element={gated(<HomePage />, FEATURE.home)} />\n\n <Route path=\"overview\" element={gated(<GovernancePage />, FEATURE.overview)} />\n <Route path=\"overview/:tab\" element={gated(<GovernancePage />, FEATURE.overview)} />\n <Route\n path=\"admin\"\n element={gated(<GovernancePage defaultTab=\"review\" />, FEATURE.admin)}\n />\n <Route path=\"admin/:tab\" element={gated(<GovernancePage />, FEATURE.admin)} />\n\n <Route path=\"stories\" element={gated(<StoriesPage />, FEATURE.stories)} />\n <Route path=\"stories/:id\" element={gated(<StoryDetailPage />, FEATURE.stories)} />\n <Route\n path=\"stories/:id/citations\"\n element={gated(<StoryCitationsPage />, FEATURE.stories)}\n />\n\n <Route path=\"saved\" element={gated(<SavedStoriesPage />, FEATURE.saved)} />\n\n <Route path=\"topics\" element={gated(<TopicsPage />, FEATURE.topics)} />\n <Route path=\"topics/:id\" element={gated(<TopicDetailPage />, FEATURE.topics)} />\n\n <Route path=\"timeline\" element={gated(<TimelinePage />, FEATURE.timeline)} />\n\n <Route path=\"discussions\" element={gated(<DiscussionsPage />, FEATURE.discussions)} />\n <Route\n path=\"discussions/:id\"\n element={gated(<DiscussionDetailPage />, FEATURE.discussions)}\n />\n\n <Route path=\"archive\" element={gated(<ArchivePage />, FEATURE.archive)} />\n <Route\n path=\"archive/collections/:id\"\n element={gated(<CollectionDetailPage />, FEATURE.archive)}\n />\n <Route\n path=\"archive/items/:id\"\n element={gated(<ArchiveItemDetailPage />, FEATURE.archive)}\n />\n\n <Route path=\"*\" element={<Navigate to=\"\" replace />} />\n </Routes>\n </Suspense>\n </div>\n );\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KACE,MAAK;KACL,SAAS7B,EAAM,kBAACY,GAAD,CAAuB,CAAA,GAAGd,EAAQ,WAAW;IAC7D,CAAA;IAED,kBAAC+B,GAAD;KAAO,MAAK;KAAU,SAAS7B,EAAM,kBAACe,GAAD,CAAc,CAAA,GAAGjB,EAAQ,OAAO;IAAI,CAAA;IACzE,kBAAC+B,GAAD;KACE,MAAK;KACL,SAAS7B,EAAM,kBAACgB,GAAD,CAAuB,CAAA,GAAGlB,EAAQ,OAAO;IACzD,CAAA;IACD,kBAAC+B,GAAD;KACE,MAAK;KACL,SAAS7B,EAAM,kBAACiB,GAAD,CAAwB,CAAA,GAAGnB,EAAQ,OAAO;IAC1D,CAAA;IAED,kBAAC+B,GAAD;KAAO,MAAK;KAAI,SAAS,kBAACE,GAAD;MAAU,IAAG;MAAG,SAAA;KAAS,CAAA;IAAI,CAAA;GAChD,EAAA,CAAA;EACA,CAAA;CACP,CAAA;AAET"}
|
|
@@ -31,4 +31,4 @@ export interface AiContextSectionProps {
|
|
|
31
31
|
export declare function AiContextSection({ storyId, collectionId, oralHistoryId, useCases, title, description, className, }: AiContextSectionProps): import('react').JSX.Element;
|
|
32
32
|
export declare function AiReviewQueue({ className }: {
|
|
33
33
|
className?: string;
|
|
34
|
-
}): import('react').JSX.Element
|
|
34
|
+
}): import('react').JSX.Element;
|
|
@@ -6,71 +6,72 @@ import "../hooks/index.js";
|
|
|
6
6
|
import { describeError as s, notify as c } from "../lib/toast.js";
|
|
7
7
|
import { formatEnumLabel as l, formatRelativeTime as u } from "../utils/formatters.js";
|
|
8
8
|
import { useState as d } from "react";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
9
|
+
import { FeatureGate as f } from "@burdenoff/fe-libs/shared/feature-flags";
|
|
10
|
+
import { Check as p, Sparkles as m, X as h } from "lucide-react";
|
|
11
|
+
import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
12
|
+
import { Button as y, GlassCard as b, Label as x, ResponsiveDialog as S, ResponsiveDialogContent as C, ResponsiveDialogDescription as w, ResponsiveDialogFooter as T, ResponsiveDialogHeader as E, ResponsiveDialogTitle as D, Textarea as O } from "@burdenoff/fe-libs/ui";
|
|
12
13
|
// src/theculturepost/components/AiContextPanel.tsx
|
|
13
|
-
var
|
|
14
|
+
var k = {
|
|
14
15
|
SUMMARIZE_EVIDENCE: "Summarise evidence",
|
|
15
16
|
DRAFT_FRAMING_PROMPT: "Draft framing",
|
|
16
17
|
SUGGEST_RELATED_TRADITIONS: "Find related traditions",
|
|
17
18
|
TRANSCRIBE_ORAL_HISTORY: "Clean up transcript"
|
|
18
|
-
},
|
|
19
|
+
}, A = {
|
|
19
20
|
SUMMARIZE_EVIDENCE: "What do the cited sources say about this story’s central claims?",
|
|
20
21
|
DRAFT_FRAMING_PROMPT: "Draft a short framing question that an editor could put to the cited sources.",
|
|
21
22
|
SUGGEST_RELATED_TRADITIONS: "Which traditions or practices in this collection relate to each other, and why?",
|
|
22
23
|
TRANSCRIBE_ORAL_HISTORY: "Clean up and format this transcript: fix punctuation and paragraph breaks, and mark speaker turns — do not add any content that is not in the original."
|
|
23
|
-
},
|
|
24
|
+
}, j = {
|
|
24
25
|
CITATION: "Citation",
|
|
25
26
|
ARCHIVE_ITEM: "Artifact",
|
|
26
27
|
ORAL_HISTORY: "Oral history"
|
|
27
|
-
},
|
|
28
|
-
function
|
|
29
|
-
let u = a(), [f,
|
|
30
|
-
e || (
|
|
28
|
+
}, M = (e) => e.reviewStatus === "PENDING";
|
|
29
|
+
function N({ open: e, onOpenChange: t, useCase: n, storyId: r, collectionId: i, oralHistoryId: o, onGenerated: l }) {
|
|
30
|
+
let u = a(), [f, p] = d(() => A[n]), [h, b] = d(null), j = (e) => {
|
|
31
|
+
e || (p(A[n]), b(null), u.reset()), t(e);
|
|
31
32
|
};
|
|
32
|
-
return /* @__PURE__ */
|
|
33
|
+
return /* @__PURE__ */ _(S, {
|
|
33
34
|
open: e,
|
|
34
35
|
onOpenChange: j,
|
|
35
|
-
children: /* @__PURE__ */
|
|
36
|
+
children: /* @__PURE__ */ v(C, {
|
|
36
37
|
className: "sm:max-w-xl",
|
|
37
38
|
children: [
|
|
38
|
-
/* @__PURE__ */
|
|
39
|
-
|
|
39
|
+
/* @__PURE__ */ v(E, { children: [/* @__PURE__ */ _(D, { children: k[n] }), /* @__PURE__ */ _(w, { children: "Runs on this product’s AI answer only from sources you can read (PUBLIC/COMMUNITY). Every run starts as pending editorial review — nothing is adopted automatically." })] }),
|
|
40
|
+
h ? /* @__PURE__ */ v("div", {
|
|
40
41
|
className: "flex flex-col gap-4",
|
|
41
|
-
children: [/* @__PURE__ */
|
|
42
|
+
children: [/* @__PURE__ */ _("p", {
|
|
42
43
|
className: "text-sm text-text-secondary",
|
|
43
44
|
children: "Run created — it is awaiting editorial review."
|
|
44
|
-
}), /* @__PURE__ */
|
|
45
|
-
}) : /* @__PURE__ */
|
|
45
|
+
}), /* @__PURE__ */ _(F, { run: h })]
|
|
46
|
+
}) : /* @__PURE__ */ v("div", {
|
|
46
47
|
className: "flex flex-col gap-2",
|
|
47
48
|
children: [
|
|
48
|
-
/* @__PURE__ */
|
|
49
|
+
/* @__PURE__ */ _(x, {
|
|
49
50
|
htmlFor: "ai-context-prompt",
|
|
50
51
|
children: "Your question or instruction"
|
|
51
52
|
}),
|
|
52
|
-
/* @__PURE__ */
|
|
53
|
+
/* @__PURE__ */ _(O, {
|
|
53
54
|
id: "ai-context-prompt",
|
|
54
55
|
value: f,
|
|
55
|
-
onChange: (e) =>
|
|
56
|
+
onChange: (e) => p(e.target.value),
|
|
56
57
|
rows: 4,
|
|
57
58
|
disabled: u.isPending
|
|
58
59
|
}),
|
|
59
|
-
/* @__PURE__ */
|
|
60
|
+
/* @__PURE__ */ _("p", {
|
|
60
61
|
className: "text-xs text-text-tertiary",
|
|
61
62
|
children: "Combined server-side with the grounded sources — never sent to the model alone."
|
|
62
63
|
})
|
|
63
64
|
]
|
|
64
65
|
}),
|
|
65
|
-
/* @__PURE__ */
|
|
66
|
+
/* @__PURE__ */ _(T, { children: h ? /* @__PURE__ */ _(y, {
|
|
66
67
|
onClick: () => j(!1),
|
|
67
68
|
children: "Done"
|
|
68
|
-
}) : /* @__PURE__ */
|
|
69
|
+
}) : /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(y, {
|
|
69
70
|
variant: "outline",
|
|
70
71
|
onClick: () => j(!1),
|
|
71
72
|
disabled: u.isPending,
|
|
72
73
|
children: "Cancel"
|
|
73
|
-
}), /* @__PURE__ */
|
|
74
|
+
}), /* @__PURE__ */ v(y, {
|
|
74
75
|
onClick: async () => {
|
|
75
76
|
let e = {
|
|
76
77
|
useCase: n,
|
|
@@ -81,13 +82,13 @@ function M({ open: e, onOpenChange: t, useCase: n, storyId: r, collectionId: i,
|
|
|
81
82
|
};
|
|
82
83
|
try {
|
|
83
84
|
let t = await u.mutateAsync(e);
|
|
84
|
-
|
|
85
|
+
b(t), l?.(t);
|
|
85
86
|
} catch (e) {
|
|
86
87
|
c.error("Generation failed", s(e));
|
|
87
88
|
}
|
|
88
89
|
},
|
|
89
90
|
disabled: u.isPending || !f.trim(),
|
|
90
|
-
children: [/* @__PURE__ */
|
|
91
|
+
children: [/* @__PURE__ */ _(m, {
|
|
91
92
|
className: "mr-1.5 h-4 w-4",
|
|
92
93
|
"aria-hidden": "true"
|
|
93
94
|
}), u.isPending ? "Generating…" : "Generate"]
|
|
@@ -96,13 +97,13 @@ function M({ open: e, onOpenChange: t, useCase: n, storyId: r, collectionId: i,
|
|
|
96
97
|
})
|
|
97
98
|
});
|
|
98
99
|
}
|
|
99
|
-
var
|
|
100
|
+
var P = {
|
|
100
101
|
LOW: "success",
|
|
101
102
|
MEDIUM: "warning",
|
|
102
103
|
HIGH: "destructive"
|
|
103
104
|
};
|
|
104
|
-
function
|
|
105
|
-
let n = o(), [r, i] = d(""), [a,
|
|
105
|
+
function F({ run: t }) {
|
|
106
|
+
let n = o(), [r, i] = d(""), [a, f] = d(!1), m = async (e) => {
|
|
106
107
|
try {
|
|
107
108
|
await n.mutateAsync({
|
|
108
109
|
id: t.id,
|
|
@@ -113,100 +114,100 @@ function P({ run: t }) {
|
|
|
113
114
|
c.error("Review failed", s(e));
|
|
114
115
|
}
|
|
115
116
|
};
|
|
116
|
-
return /* @__PURE__ */
|
|
117
|
+
return /* @__PURE__ */ v(b, {
|
|
117
118
|
treatment: "plain",
|
|
118
119
|
className: "flex flex-col gap-3 p-4",
|
|
119
120
|
children: [
|
|
120
|
-
/* @__PURE__ */
|
|
121
|
+
/* @__PURE__ */ v("div", {
|
|
121
122
|
className: "flex flex-wrap items-center gap-1.5",
|
|
122
123
|
children: [
|
|
123
|
-
/* @__PURE__ */
|
|
124
|
-
/* @__PURE__ */
|
|
125
|
-
t.status === "FAILED" && /* @__PURE__ */
|
|
126
|
-
t.uncertainty && /* @__PURE__ */
|
|
127
|
-
className: `inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium ${
|
|
124
|
+
/* @__PURE__ */ _(e, { status: t.useCase }),
|
|
125
|
+
/* @__PURE__ */ _(e, { status: t.reviewStatus }),
|
|
126
|
+
t.status === "FAILED" && /* @__PURE__ */ _(e, { status: "FAILED" }),
|
|
127
|
+
t.uncertainty && /* @__PURE__ */ v("span", {
|
|
128
|
+
className: `inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium ${P[t.uncertainty] === "success" ? "bg-status-success-bg-subtle text-status-success-text" : P[t.uncertainty] === "destructive" ? "bg-status-error-bg-subtle text-status-error-text" : "bg-status-warning-bg-subtle text-status-warning-text"}`,
|
|
128
129
|
children: ["Uncertainty: ", l(t.uncertainty)]
|
|
129
130
|
}),
|
|
130
|
-
/* @__PURE__ */
|
|
131
|
+
/* @__PURE__ */ _("span", {
|
|
131
132
|
className: "ml-auto text-xs text-text-tertiary",
|
|
132
133
|
children: u(t.createdAt)
|
|
133
134
|
})
|
|
134
135
|
]
|
|
135
136
|
}),
|
|
136
|
-
/* @__PURE__ */
|
|
137
|
+
/* @__PURE__ */ v("p", {
|
|
137
138
|
className: "text-sm text-text-secondary",
|
|
138
|
-
children: [/* @__PURE__ */
|
|
139
|
+
children: [/* @__PURE__ */ _("span", {
|
|
139
140
|
className: "font-medium text-text-primary",
|
|
140
141
|
children: "Prompt: "
|
|
141
142
|
}), t.promptSummary]
|
|
142
143
|
}),
|
|
143
|
-
t.error && /* @__PURE__ */
|
|
144
|
+
t.error && /* @__PURE__ */ _("p", {
|
|
144
145
|
className: "rounded-lg bg-status-error-bg-subtle p-2 text-xs text-status-error-text",
|
|
145
146
|
children: t.error
|
|
146
147
|
}),
|
|
147
|
-
t.content && /* @__PURE__ */
|
|
148
|
+
t.content && /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("button", {
|
|
148
149
|
type: "button",
|
|
149
|
-
onClick: () =>
|
|
150
|
+
onClick: () => f((e) => !e),
|
|
150
151
|
className: "text-xs font-medium text-text-secondary underline-offset-2 hover:underline",
|
|
151
152
|
children: a ? "Hide answer" : "Show answer"
|
|
152
|
-
}), a && /* @__PURE__ */
|
|
153
|
+
}), a && /* @__PURE__ */ _("p", {
|
|
153
154
|
className: "mt-2 whitespace-pre-wrap rounded-lg bg-bg-sunken p-3 text-sm text-text-primary",
|
|
154
155
|
children: t.content
|
|
155
156
|
})] }),
|
|
156
|
-
t.groundingRefs.length > 0 && /* @__PURE__ */
|
|
157
|
+
t.groundingRefs.length > 0 && /* @__PURE__ */ v("div", {
|
|
157
158
|
className: "flex flex-col gap-1.5",
|
|
158
|
-
children: [/* @__PURE__ */
|
|
159
|
+
children: [/* @__PURE__ */ v("p", {
|
|
159
160
|
className: "text-xs font-medium text-text-tertiary",
|
|
160
161
|
children: [
|
|
161
162
|
"Grounded in (",
|
|
162
163
|
t.groundingRefs.length,
|
|
163
164
|
" sources)"
|
|
164
165
|
]
|
|
165
|
-
}), /* @__PURE__ */
|
|
166
|
+
}), /* @__PURE__ */ _("ul", {
|
|
166
167
|
className: "flex flex-wrap gap-1.5",
|
|
167
|
-
children: t.groundingRefs.map((e) => /* @__PURE__ */
|
|
168
|
+
children: t.groundingRefs.map((e) => /* @__PURE__ */ v("li", {
|
|
168
169
|
className: "inline-flex max-w-full items-center gap-1 rounded-full bg-bg-sunken px-2.5 py-0.5 text-xs text-text-secondary",
|
|
169
170
|
title: e.title,
|
|
170
|
-
children: [/* @__PURE__ */
|
|
171
|
+
children: [/* @__PURE__ */ _("span", {
|
|
171
172
|
className: "shrink-0 font-medium",
|
|
172
|
-
children:
|
|
173
|
-
}), /* @__PURE__ */
|
|
173
|
+
children: j[e.kind] ?? l(e.kind)
|
|
174
|
+
}), /* @__PURE__ */ _("span", {
|
|
174
175
|
className: "truncate",
|
|
175
176
|
children: e.title
|
|
176
177
|
})]
|
|
177
178
|
}, `${e.kind}-${e.refId}`))
|
|
178
179
|
})]
|
|
179
180
|
}),
|
|
180
|
-
t.reviewStatus !== "PENDING" && (t.reviewNotes || t.reviewedAt) && /* @__PURE__ */
|
|
181
|
+
t.reviewStatus !== "PENDING" && (t.reviewNotes || t.reviewedAt) && /* @__PURE__ */ v("p", {
|
|
181
182
|
className: "text-xs text-text-tertiary",
|
|
182
183
|
children: [t.reviewStatus === "APPROVED" ? "Approved" : "Rejected", t.reviewNotes ? ` — ${t.reviewNotes}` : ""]
|
|
183
184
|
}),
|
|
184
|
-
|
|
185
|
+
M(t) && /* @__PURE__ */ v("div", {
|
|
185
186
|
className: "flex flex-col gap-2 border-t border-border-seam pt-3",
|
|
186
|
-
children: [/* @__PURE__ */
|
|
187
|
+
children: [/* @__PURE__ */ _(O, {
|
|
187
188
|
value: r,
|
|
188
189
|
onChange: (e) => i(e.target.value),
|
|
189
190
|
rows: 2,
|
|
190
191
|
placeholder: "Review notes (optional)",
|
|
191
192
|
disabled: n.isPending
|
|
192
|
-
}), /* @__PURE__ */
|
|
193
|
+
}), /* @__PURE__ */ v("div", {
|
|
193
194
|
className: "flex gap-2",
|
|
194
|
-
children: [/* @__PURE__ */
|
|
195
|
+
children: [/* @__PURE__ */ v(y, {
|
|
195
196
|
size: "sm",
|
|
196
|
-
onClick: () =>
|
|
197
|
+
onClick: () => m(!0),
|
|
197
198
|
disabled: n.isPending,
|
|
198
199
|
"aria-label": "Approve AI answer",
|
|
199
|
-
children: [/* @__PURE__ */
|
|
200
|
+
children: [/* @__PURE__ */ _(p, {
|
|
200
201
|
className: "mr-1.5 h-4 w-4",
|
|
201
202
|
"aria-hidden": "true"
|
|
202
203
|
}), " Approve"]
|
|
203
|
-
}), /* @__PURE__ */
|
|
204
|
+
}), /* @__PURE__ */ v(y, {
|
|
204
205
|
size: "sm",
|
|
205
206
|
variant: "outline",
|
|
206
|
-
onClick: () =>
|
|
207
|
+
onClick: () => m(!1),
|
|
207
208
|
disabled: n.isPending,
|
|
208
209
|
"aria-label": "Reject AI answer",
|
|
209
|
-
children: [/* @__PURE__ */
|
|
210
|
+
children: [/* @__PURE__ */ _(h, {
|
|
210
211
|
className: "mr-1.5 h-4 w-4",
|
|
211
212
|
"aria-hidden": "true"
|
|
212
213
|
}), " Reject"]
|
|
@@ -216,102 +217,115 @@ function P({ run: t }) {
|
|
|
216
217
|
]
|
|
217
218
|
});
|
|
218
219
|
}
|
|
219
|
-
function
|
|
220
|
-
let [
|
|
220
|
+
function I({ storyId: e, collectionId: a, oralHistoryId: o, useCases: s, title: c = "AI assistant", description: l = "Citation-grounded answers from sources you can read. Every answer waits for editorial review before adoption.", className: u }) {
|
|
221
|
+
let [p, h] = d(null), g = !!(e || a), x = i({
|
|
221
222
|
storyId: e,
|
|
222
223
|
collectionId: a,
|
|
223
224
|
pagination: { limit: 10 },
|
|
224
|
-
enabled:
|
|
225
|
-
}),
|
|
226
|
-
return /* @__PURE__ */ _(
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
225
|
+
enabled: g
|
|
226
|
+
}), S = g ? x.data?.items ?? [] : [], C = S.filter(M).length;
|
|
227
|
+
return /* @__PURE__ */ _(f, {
|
|
228
|
+
flag: "theculturepost.ai-context",
|
|
229
|
+
defaultValue: !0,
|
|
230
|
+
fallback: null,
|
|
231
|
+
children: /* @__PURE__ */ v(b, {
|
|
232
|
+
treatment: "plain",
|
|
233
|
+
className: `flex flex-col gap-4 p-5 sm:p-6 ${u ?? ""}`,
|
|
234
|
+
children: [
|
|
235
|
+
/* @__PURE__ */ v("div", {
|
|
236
|
+
className: "flex flex-wrap items-start justify-between gap-3",
|
|
237
|
+
children: [/* @__PURE__ */ v("div", { children: [/* @__PURE__ */ v("h2", {
|
|
238
|
+
className: "flex items-center gap-2 font-display text-xl font-semibold text-text-primary",
|
|
239
|
+
children: [
|
|
240
|
+
/* @__PURE__ */ _(m, {
|
|
241
|
+
className: "h-5 w-5 text-accent",
|
|
242
|
+
"aria-hidden": "true"
|
|
243
|
+
}),
|
|
244
|
+
" ",
|
|
245
|
+
c,
|
|
246
|
+
C > 0 && /* @__PURE__ */ v("span", {
|
|
247
|
+
className: "rounded-full bg-status-warning-bg-subtle px-2 py-0.5 text-xs font-medium text-status-warning-text",
|
|
248
|
+
children: [C, " pending"]
|
|
249
|
+
})
|
|
250
|
+
]
|
|
251
|
+
}), /* @__PURE__ */ _("p", {
|
|
252
|
+
className: "mt-1 text-sm text-text-secondary",
|
|
253
|
+
children: l
|
|
254
|
+
})] }), /* @__PURE__ */ _("div", {
|
|
255
|
+
className: "flex flex-wrap gap-2",
|
|
256
|
+
children: s.map((e) => /* @__PURE__ */ v(y, {
|
|
257
|
+
variant: "outline",
|
|
258
|
+
onClick: () => h(e),
|
|
259
|
+
children: [/* @__PURE__ */ _(m, {
|
|
260
|
+
className: "mr-1.5 h-4 w-4",
|
|
261
|
+
"aria-hidden": "true"
|
|
262
|
+
}), k[e]]
|
|
263
|
+
}, e))
|
|
264
|
+
})]
|
|
265
|
+
}),
|
|
266
|
+
g && (x.isLoading ? /* @__PURE__ */ _(r, { label: "Loading AI runs…" }) : x.isError ? /* @__PURE__ */ _(n, {
|
|
267
|
+
title: "Could not load AI runs",
|
|
268
|
+
onRetry: () => x.refetch()
|
|
269
|
+
}) : S.length === 0 ? /* @__PURE__ */ _(t, {
|
|
270
|
+
icon: /* @__PURE__ */ _(m, { className: "h-9 w-9" }),
|
|
271
|
+
title: "No AI runs yet",
|
|
272
|
+
description: "Run one of the actions above to draft a citation-grounded answer."
|
|
273
|
+
}) : /* @__PURE__ */ _("div", {
|
|
274
|
+
className: "flex flex-col gap-3",
|
|
275
|
+
children: S.map((e) => /* @__PURE__ */ _(F, { run: e }, e.id))
|
|
276
|
+
})),
|
|
277
|
+
p && /* @__PURE__ */ _(N, {
|
|
278
|
+
open: !0,
|
|
279
|
+
onOpenChange: (e) => {
|
|
280
|
+
e || h(null);
|
|
281
|
+
},
|
|
282
|
+
useCase: p,
|
|
283
|
+
storyId: e,
|
|
284
|
+
collectionId: a,
|
|
285
|
+
oralHistoryId: o
|
|
286
|
+
})
|
|
287
|
+
]
|
|
288
|
+
})
|
|
283
289
|
});
|
|
284
290
|
}
|
|
285
|
-
function
|
|
286
|
-
|
|
287
|
-
|
|
291
|
+
function L({ className: e }) {
|
|
292
|
+
return /* @__PURE__ */ _(f, {
|
|
293
|
+
flag: "theculturepost.ai-context",
|
|
294
|
+
defaultValue: !0,
|
|
295
|
+
fallback: null,
|
|
296
|
+
children: /* @__PURE__ */ _(R, { className: e })
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
function R({ className: e }) {
|
|
300
|
+
let t = i({ pagination: { limit: 50 } }), a = (t.data?.items ?? []).filter(M);
|
|
301
|
+
return t.isLoading ? /* @__PURE__ */ _(r, { label: "Loading AI review queue…" }) : t.isError ? /* @__PURE__ */ _(n, {
|
|
288
302
|
title: "Could not load the AI review queue",
|
|
289
303
|
onRetry: () => t.refetch()
|
|
290
|
-
}) : a.length === 0 ? null : /* @__PURE__ */
|
|
304
|
+
}) : a.length === 0 ? null : /* @__PURE__ */ v(b, {
|
|
291
305
|
treatment: "plain",
|
|
292
306
|
className: `flex flex-col gap-3 p-5 sm:p-6 ${e ?? ""}`,
|
|
293
307
|
children: [
|
|
294
|
-
/* @__PURE__ */
|
|
308
|
+
/* @__PURE__ */ v("h2", {
|
|
295
309
|
className: "flex items-center gap-2 font-display text-xl font-semibold text-text-primary",
|
|
296
310
|
children: [
|
|
297
|
-
/* @__PURE__ */
|
|
311
|
+
/* @__PURE__ */ _(m, {
|
|
298
312
|
className: "h-5 w-5 text-accent",
|
|
299
313
|
"aria-hidden": "true"
|
|
300
314
|
}),
|
|
301
315
|
" AI review queue",
|
|
302
|
-
/* @__PURE__ */
|
|
316
|
+
/* @__PURE__ */ v("span", {
|
|
303
317
|
className: "rounded-full bg-status-warning-bg-subtle px-2 py-0.5 text-xs font-medium text-status-warning-text",
|
|
304
318
|
children: [a.length, " pending"]
|
|
305
319
|
})
|
|
306
320
|
]
|
|
307
321
|
}),
|
|
308
|
-
/* @__PURE__ */
|
|
322
|
+
/* @__PURE__ */ _("p", {
|
|
309
323
|
className: "text-sm text-text-secondary",
|
|
310
324
|
children: "Generated answers awaiting an editorial decision, newest first. Approve or reject them here, or in place on the story or collection they belong to."
|
|
311
325
|
}),
|
|
312
|
-
/* @__PURE__ */
|
|
326
|
+
/* @__PURE__ */ v("div", {
|
|
313
327
|
className: "flex flex-col gap-3",
|
|
314
|
-
children: [a.slice(0, 5).map((e) => /* @__PURE__ */
|
|
328
|
+
children: [a.slice(0, 5).map((e) => /* @__PURE__ */ _(F, { run: e }, e.id)), a.length > 5 && /* @__PURE__ */ v("p", {
|
|
315
329
|
className: "text-xs text-text-tertiary",
|
|
316
330
|
children: [a.length - 5, " more pending — open the story or collection they belong to review them in place."]
|
|
317
331
|
})]
|
|
@@ -319,6 +333,6 @@ function I({ className: e }) {
|
|
|
319
333
|
]
|
|
320
334
|
});
|
|
321
335
|
}
|
|
322
|
-
export {
|
|
336
|
+
export { k as AI_USE_CASE_LABELS, I as AiContextSection, L as AiReviewQueue, F as AiRunCard, N as GenerateAiContextDialog };
|
|
323
337
|
|
|
324
338
|
//# sourceMappingURL=AiContextPanel.js.map
|