@burdenoff/microfe-theculturepost 2026.704.2 → 2026.705.2
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/TheCulturePostRoot.js +63 -45
- package/dist/theculturepost/TheCulturePostRoot.js.map +1 -1
- package/dist/theculturepost/TheCulturePostRoutes.js +17 -9
- package/dist/theculturepost/TheCulturePostRoutes.js.map +1 -1
- package/dist/theculturepost/components/AddCitationDialog.js +131 -102
- package/dist/theculturepost/components/AddCitationDialog.js.map +1 -1
- package/dist/theculturepost/components/ArchiveItemCard.js +56 -43
- package/dist/theculturepost/components/ArchiveItemCard.js.map +1 -1
- package/dist/theculturepost/components/AudioPlayer.js +74 -0
- package/dist/theculturepost/components/AudioPlayer.js.map +1 -0
- package/dist/theculturepost/components/CitationList.js +215 -105
- package/dist/theculturepost/components/CitationList.js.map +1 -1
- package/dist/theculturepost/components/CollectionCard.js +32 -32
- package/dist/theculturepost/components/CollectionCard.js.map +1 -1
- package/dist/theculturepost/components/CreateArchiveItemDialog.js +133 -93
- package/dist/theculturepost/components/CreateArchiveItemDialog.js.map +1 -1
- package/dist/theculturepost/components/CreateCollectionDialog.js +91 -70
- package/dist/theculturepost/components/CreateCollectionDialog.js.map +1 -1
- package/dist/theculturepost/components/CreateStoryDialog.js +311 -132
- package/dist/theculturepost/components/CreateStoryDialog.js.map +1 -1
- package/dist/theculturepost/components/DecorativeCover.js +78 -0
- package/dist/theculturepost/components/DecorativeCover.js.map +1 -0
- package/dist/theculturepost/components/DecorativeDivider.js +45 -0
- package/dist/theculturepost/components/DecorativeDivider.js.map +1 -0
- package/dist/theculturepost/components/DiscussionCard.js +75 -60
- package/dist/theculturepost/components/DiscussionCard.js.map +1 -1
- package/dist/theculturepost/components/HistoryTimeline.js +115 -0
- package/dist/theculturepost/components/HistoryTimeline.js.map +1 -0
- package/dist/theculturepost/components/LifecycleStepper.js +33 -0
- package/dist/theculturepost/components/LifecycleStepper.js.map +1 -0
- package/dist/theculturepost/components/OpenDiscussionDialog.js +66 -56
- package/dist/theculturepost/components/OpenDiscussionDialog.js.map +1 -1
- package/dist/theculturepost/components/OralHistoryCard.js +6 -73
- package/dist/theculturepost/components/OverlayBadge.js +22 -0
- package/dist/theculturepost/components/OverlayBadge.js.map +1 -0
- package/dist/theculturepost/components/PageHero.js +62 -0
- package/dist/theculturepost/components/PageHero.js.map +1 -0
- package/dist/theculturepost/components/RecordOralHistoryDialog.js +306 -131
- package/dist/theculturepost/components/RecordOralHistoryDialog.js.map +1 -1
- package/dist/theculturepost/components/ReplyThread.js +268 -139
- package/dist/theculturepost/components/ReplyThread.js.map +1 -1
- package/dist/theculturepost/components/StatusBadge.js +9 -9
- package/dist/theculturepost/components/StatusBadge.js.map +1 -1
- package/dist/theculturepost/components/StoryCard.js +54 -49
- package/dist/theculturepost/components/StoryCard.js.map +1 -1
- package/dist/theculturepost/components/TopicCard.js +60 -41
- package/dist/theculturepost/components/TopicCard.js.map +1 -1
- package/dist/theculturepost/components/Waveform.js +31 -0
- package/dist/theculturepost/components/Waveform.js.map +1 -0
- package/dist/theculturepost/components/categoryMeta.js +20 -0
- package/dist/theculturepost/components/categoryMeta.js.map +1 -0
- package/dist/theculturepost/components/index.js +41 -0
- package/dist/theculturepost/components/viz/BarChart.js +53 -0
- package/dist/theculturepost/components/viz/BarChart.js.map +1 -0
- package/dist/theculturepost/components/viz/Donut.js +58 -0
- package/dist/theculturepost/components/viz/Donut.js.map +1 -0
- package/dist/theculturepost/components/viz/StatTile.js +35 -0
- package/dist/theculturepost/components/viz/StatTile.js.map +1 -0
- package/dist/theculturepost/components/viz/index.js +3 -0
- package/dist/theculturepost/hooks/useFiles.js +1 -1
- package/dist/theculturepost/hooks/useFiles.js.map +1 -1
- package/dist/theculturepost/pages/HomePage.js +247 -124
- package/dist/theculturepost/pages/HomePage.js.map +1 -1
- package/dist/theculturepost/pages/archive/ArchiveItemDetailPage.js +319 -127
- package/dist/theculturepost/pages/archive/ArchiveItemDetailPage.js.map +1 -1
- package/dist/theculturepost/pages/archive/ArchivePage.js +265 -180
- package/dist/theculturepost/pages/archive/ArchivePage.js.map +1 -1
- package/dist/theculturepost/pages/archive/CollectionDetailPage.js +158 -143
- package/dist/theculturepost/pages/archive/CollectionDetailPage.js.map +1 -1
- package/dist/theculturepost/pages/discussions/DiscussionDetailPage.js +155 -93
- package/dist/theculturepost/pages/discussions/DiscussionDetailPage.js.map +1 -1
- package/dist/theculturepost/pages/discussions/DiscussionsPage.js +16 -16
- package/dist/theculturepost/pages/discussions/DiscussionsPage.js.map +1 -1
- package/dist/theculturepost/pages/governance/GovernancePage.js +293 -0
- package/dist/theculturepost/pages/governance/GovernancePage.js.map +1 -0
- package/dist/theculturepost/pages/stories/StoriesPage.js +18 -18
- package/dist/theculturepost/pages/stories/StoriesPage.js.map +1 -1
- package/dist/theculturepost/pages/stories/StoryDetailPage.js +603 -285
- package/dist/theculturepost/pages/stories/StoryDetailPage.js.map +1 -1
- package/dist/theculturepost/pages/timeline/TimelinePage.js +162 -0
- package/dist/theculturepost/pages/timeline/TimelinePage.js.map +1 -0
- package/dist/theculturepost/pages/topics/TopicDetailPage.js +239 -163
- package/dist/theculturepost/pages/topics/TopicDetailPage.js.map +1 -1
- package/dist/theculturepost/pages/topics/TopicsPage.js +76 -74
- package/dist/theculturepost/pages/topics/TopicsPage.js.map +1 -1
- package/dist/theculturepost/styles/injectDisplayFont.js +11 -0
- package/dist/theculturepost/styles/injectDisplayFont.js.map +1 -0
- package/dist/theculturepost/utils/formatters.js +6 -1
- package/dist/theculturepost/utils/formatters.js.map +1 -1
- package/package.json +1 -1
- package/dist/theculturepost/components/OralHistoryCard.js.map +0 -1
|
@@ -1,91 +1,109 @@
|
|
|
1
1
|
import { joinPath as e } from "./utils/navigation.js";
|
|
2
2
|
import { TheCulturePostProvider as t } from "./context/TheCulturePostContext.js";
|
|
3
3
|
import { TheCulturePostRoutes as n } from "./TheCulturePostRoutes.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
4
|
+
import { injectDisplayFont as r } from "./styles/injectDisplayFont.js";
|
|
5
|
+
import { useCallback as i, useEffect as a } from "react";
|
|
6
|
+
import { QueryClient as o, QueryClientProvider as s } from "@tanstack/react-query";
|
|
7
|
+
import { FeatureFlagProvider as c } from "@burdenoff/fe-libs/shared/feature-flags";
|
|
8
|
+
import { useI18n as l } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
9
|
+
import { BookOpen as u, Compass as d, Landmark as f, LayoutDashboard as p, MessagesSquare as m, Milestone as h, Newspaper as g } from "lucide-react";
|
|
10
|
+
import { jsx as _ } from "react/jsx-runtime";
|
|
10
11
|
//#region src/theculturepost/TheCulturePostRoot.tsx
|
|
11
|
-
|
|
12
|
+
r();
|
|
13
|
+
var v = new o({ defaultOptions: { queries: {
|
|
12
14
|
staleTime: 60 * 1e3,
|
|
13
15
|
retry: 1,
|
|
14
16
|
refetchOnWindowFocus: !1
|
|
15
|
-
} } }),
|
|
16
|
-
let { registerNavItems:
|
|
17
|
-
let n =
|
|
17
|
+
} } }), y = (r) => {
|
|
18
|
+
let { registerNavItems: o, registerFooterItems: y, basePath: b = "/" } = r, { t: x } = l(), S = i((e, t) => {
|
|
19
|
+
let n = x(e);
|
|
18
20
|
return n === e ? t : n;
|
|
19
|
-
}, [
|
|
20
|
-
return
|
|
21
|
-
if (
|
|
21
|
+
}, [x]);
|
|
22
|
+
return a(() => {
|
|
23
|
+
if (o) return o([
|
|
22
24
|
{
|
|
23
25
|
id: "theculturepost-home",
|
|
24
|
-
label:
|
|
25
|
-
path: e(
|
|
26
|
-
icon: /* @__PURE__ */
|
|
26
|
+
label: S("theculturepost.nav.home", "Home"),
|
|
27
|
+
path: e(b, ""),
|
|
28
|
+
icon: /* @__PURE__ */ _(g, { size: 20 }),
|
|
27
29
|
order: 0,
|
|
28
30
|
group: "products"
|
|
29
31
|
},
|
|
30
32
|
{
|
|
31
|
-
id: "theculturepost-
|
|
32
|
-
label:
|
|
33
|
-
path: e(
|
|
34
|
-
icon: /* @__PURE__ */
|
|
33
|
+
id: "theculturepost-overview",
|
|
34
|
+
label: S("theculturepost.nav.overview", "Overview"),
|
|
35
|
+
path: e(b, "overview"),
|
|
36
|
+
icon: /* @__PURE__ */ _(p, { size: 20 }),
|
|
35
37
|
order: 1,
|
|
36
38
|
group: "products"
|
|
37
39
|
},
|
|
38
40
|
{
|
|
39
|
-
id: "theculturepost-
|
|
40
|
-
label:
|
|
41
|
-
path: e(
|
|
42
|
-
icon: /* @__PURE__ */
|
|
41
|
+
id: "theculturepost-stories",
|
|
42
|
+
label: S("theculturepost.nav.stories", "Stories"),
|
|
43
|
+
path: e(b, "stories"),
|
|
44
|
+
icon: /* @__PURE__ */ _(u, { size: 20 }),
|
|
43
45
|
order: 2,
|
|
44
46
|
group: "products"
|
|
45
47
|
},
|
|
46
48
|
{
|
|
47
|
-
id: "theculturepost-
|
|
48
|
-
label:
|
|
49
|
-
path: e(
|
|
50
|
-
icon: /* @__PURE__ */
|
|
49
|
+
id: "theculturepost-topics",
|
|
50
|
+
label: S("theculturepost.nav.topics", "Topics"),
|
|
51
|
+
path: e(b, "topics"),
|
|
52
|
+
icon: /* @__PURE__ */ _(d, { size: 20 }),
|
|
51
53
|
order: 3,
|
|
52
54
|
group: "products"
|
|
53
55
|
},
|
|
54
56
|
{
|
|
55
|
-
id: "theculturepost-
|
|
56
|
-
label:
|
|
57
|
-
path: e(
|
|
58
|
-
icon: /* @__PURE__ */
|
|
57
|
+
id: "theculturepost-timeline",
|
|
58
|
+
label: S("theculturepost.nav.timeline", "Timeline"),
|
|
59
|
+
path: e(b, "timeline"),
|
|
60
|
+
icon: /* @__PURE__ */ _(h, { size: 20 }),
|
|
59
61
|
order: 4,
|
|
60
62
|
group: "products"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
id: "theculturepost-discussions",
|
|
66
|
+
label: S("theculturepost.nav.discussions", "Discussions"),
|
|
67
|
+
path: e(b, "discussions"),
|
|
68
|
+
icon: /* @__PURE__ */ _(m, { size: 20 }),
|
|
69
|
+
order: 5,
|
|
70
|
+
group: "products"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
id: "theculturepost-archive",
|
|
74
|
+
label: S("theculturepost.nav.archive", "Archive"),
|
|
75
|
+
path: e(b, "archive"),
|
|
76
|
+
icon: /* @__PURE__ */ _(f, { size: 20 }),
|
|
77
|
+
order: 6,
|
|
78
|
+
group: "products"
|
|
61
79
|
}
|
|
62
80
|
]);
|
|
63
81
|
}, [
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
]),
|
|
68
|
-
if (
|
|
82
|
+
o,
|
|
83
|
+
b,
|
|
84
|
+
S
|
|
85
|
+
]), a(() => {
|
|
86
|
+
if (y) return y([{
|
|
69
87
|
id: "theculturepost-status",
|
|
70
|
-
label:
|
|
88
|
+
label: S("theculturepost.footer.ready", "TheCulturePost Ready"),
|
|
71
89
|
type: "status",
|
|
72
90
|
section: "left",
|
|
73
91
|
order: 10
|
|
74
92
|
}]);
|
|
75
|
-
}, [
|
|
76
|
-
client:
|
|
77
|
-
children: /* @__PURE__ */
|
|
93
|
+
}, [y, S]), /* @__PURE__ */ _(s, {
|
|
94
|
+
client: v,
|
|
95
|
+
children: /* @__PURE__ */ _(c, {
|
|
78
96
|
workspaceId: null,
|
|
79
97
|
gateway: "global",
|
|
80
98
|
defaultEnabled: !0,
|
|
81
|
-
children: /* @__PURE__ */
|
|
82
|
-
...
|
|
83
|
-
children: /* @__PURE__ */
|
|
99
|
+
children: /* @__PURE__ */ _(t, {
|
|
100
|
+
...r,
|
|
101
|
+
children: /* @__PURE__ */ _(n, {})
|
|
84
102
|
})
|
|
85
103
|
})
|
|
86
104
|
});
|
|
87
105
|
};
|
|
88
106
|
//#endregion
|
|
89
|
-
export {
|
|
107
|
+
export { y as TheCulturePostRoot };
|
|
90
108
|
|
|
91
109
|
//# sourceMappingURL=TheCulturePostRoot.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TheCulturePostRoot.js","names":[],"sources":["../../src/theculturepost/TheCulturePostRoot.tsx"],"sourcesContent":["/**\n * TheCulturePost Root Component\n * @module theculturepost\n *\n * Host-contract entry point. Registers the product's sidebar nav (five sections\n * that map to the wspace-theculturepost-svc `tcp*` backend) and mounts the\n * routed pages inside the shared QueryClient + FeatureFlag providers.\n */\n\nimport type { FC } from 'react';\nimport { useCallback, useEffect } from 'react';\nimport { QueryClient, QueryClientProvider } from '@tanstack/react-query';\nimport { FeatureFlagProvider } from '@burdenoff/fe-libs/shared/feature-flags';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport {
|
|
1
|
+
{"version":3,"file":"TheCulturePostRoot.js","names":[],"sources":["../../src/theculturepost/TheCulturePostRoot.tsx"],"sourcesContent":["/**\n * TheCulturePost Root Component\n * @module theculturepost\n *\n * Host-contract entry point. Registers the product's sidebar nav (five sections\n * that map to the wspace-theculturepost-svc `tcp*` backend) and mounts the\n * routed pages inside the shared QueryClient + FeatureFlag providers.\n */\n\nimport type { FC } from 'react';\nimport { useCallback, useEffect } from 'react';\nimport { QueryClient, QueryClientProvider } from '@tanstack/react-query';\nimport { FeatureFlagProvider } from '@burdenoff/fe-libs/shared/feature-flags';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport {\n Newspaper,\n LayoutDashboard,\n BookOpen,\n Compass,\n Milestone,\n MessagesSquare,\n Landmark,\n} from 'lucide-react';\nimport { TheCulturePostProvider } from './context/TheCulturePostContext';\nimport { TheCulturePostRoutes } from './TheCulturePostRoutes';\nimport { injectDisplayFont } from './styles/injectDisplayFont';\n\n// Ensure the `.font-display` serif utility exists in the built MFE (shells own\n// Tailwind but won't emit this custom class). Runs once, idempotently.\ninjectDisplayFont();\nimport { joinPath } from './utils/navigation';\nimport type { TheCulturePostRootProps, NavItem } from './types';\n\nconst queryClient = new QueryClient({\n defaultOptions: {\n queries: {\n staleTime: 60 * 1000,\n retry: 1,\n refetchOnWindowFocus: false,\n },\n },\n});\n\nexport const TheCulturePostRoot: FC<TheCulturePostRootProps> = (props) => {\n const { registerNavItems, registerFooterItems, basePath = '/' } = props;\n const { t: translate } = useI18n();\n const t = useCallback(\n (key: string, fallback: string): string => {\n const value = translate(key);\n return value === key ? fallback : value;\n },\n [translate]\n );\n\n // Register navigation items with the shell on mount. Ids/paths/orders match\n // the app-shell static NavRegistration block so the two are a single,\n // consistent source of truth.\n useEffect(() => {\n if (!registerNavItems) return;\n\n const navItems: NavItem[] = [\n {\n id: 'theculturepost-home',\n label: t('theculturepost.nav.home', 'Home'),\n path: joinPath(basePath, ''),\n icon: <Newspaper size={20} />,\n order: 0,\n group: 'products',\n },\n {\n id: 'theculturepost-overview',\n label: t('theculturepost.nav.overview', 'Overview'),\n path: joinPath(basePath, 'overview'),\n icon: <LayoutDashboard size={20} />,\n order: 1,\n group: 'products',\n },\n {\n id: 'theculturepost-stories',\n label: t('theculturepost.nav.stories', 'Stories'),\n path: joinPath(basePath, 'stories'),\n icon: <BookOpen size={20} />,\n order: 2,\n group: 'products',\n },\n {\n id: 'theculturepost-topics',\n label: t('theculturepost.nav.topics', 'Topics'),\n path: joinPath(basePath, 'topics'),\n icon: <Compass size={20} />,\n order: 3,\n group: 'products',\n },\n {\n id: 'theculturepost-timeline',\n label: t('theculturepost.nav.timeline', 'Timeline'),\n path: joinPath(basePath, 'timeline'),\n icon: <Milestone size={20} />,\n order: 4,\n group: 'products',\n },\n {\n id: 'theculturepost-discussions',\n label: t('theculturepost.nav.discussions', 'Discussions'),\n path: joinPath(basePath, 'discussions'),\n icon: <MessagesSquare size={20} />,\n order: 5,\n group: 'products',\n },\n {\n id: 'theculturepost-archive',\n label: t('theculturepost.nav.archive', 'Archive'),\n path: joinPath(basePath, 'archive'),\n icon: <Landmark size={20} />,\n order: 6,\n group: 'products',\n },\n ];\n\n return registerNavItems(navItems);\n }, [registerNavItems, basePath, t]);\n\n useEffect(() => {\n if (!registerFooterItems) return;\n return registerFooterItems([\n {\n id: 'theculturepost-status',\n label: t('theculturepost.footer.ready', 'TheCulturePost Ready'),\n type: 'status',\n section: 'left',\n order: 10,\n },\n ]);\n }, [registerFooterItems, t]);\n\n return (\n <QueryClientProvider client={queryClient}>\n <FeatureFlagProvider workspaceId={null} gateway=\"global\" defaultEnabled={true}>\n <TheCulturePostProvider {...props}>\n <TheCulturePostRoutes />\n </TheCulturePostProvider>\n </FeatureFlagProvider>\n </QueryClientProvider>\n );\n};\n"],"mappings":";;;;;;;;;;;AA6BA,GAAmB;AAInB,IAAM,IAAc,IAAI,EAAY,EAClC,gBAAgB,EACd,SAAS;CACP,WAAW,KAAK;CAChB,OAAO;CACP,sBAAsB;CACvB,EACF,EACF,CAAC,EAEW,KAAmD,MAAU;CACxE,IAAM,EAAE,qBAAkB,wBAAqB,cAAW,QAAQ,GAC5D,EAAE,GAAG,MAAc,GAAS,EAC5B,IAAI,GACP,GAAa,MAA6B;EACzC,IAAM,IAAQ,EAAU,EAAI;AAC5B,SAAO,MAAU,IAAM,IAAW;IAEpC,CAAC,EAAU,CACZ;AAmFD,QA9EA,QAAgB;AACT,QA6DL,QAAO,EA3DqB;GAC1B;IACE,IAAI;IACJ,OAAO,EAAE,2BAA2B,OAAO;IAC3C,MAAM,EAAS,GAAU,GAAG;IAC5B,MAAM,kBAAC,GAAD,EAAW,MAAM,IAAM,CAAA;IAC7B,OAAO;IACP,OAAO;IACR;GACD;IACE,IAAI;IACJ,OAAO,EAAE,+BAA+B,WAAW;IACnD,MAAM,EAAS,GAAU,WAAW;IACpC,MAAM,kBAAC,GAAD,EAAiB,MAAM,IAAM,CAAA;IACnC,OAAO;IACP,OAAO;IACR;GACD;IACE,IAAI;IACJ,OAAO,EAAE,8BAA8B,UAAU;IACjD,MAAM,EAAS,GAAU,UAAU;IACnC,MAAM,kBAAC,GAAD,EAAU,MAAM,IAAM,CAAA;IAC5B,OAAO;IACP,OAAO;IACR;GACD;IACE,IAAI;IACJ,OAAO,EAAE,6BAA6B,SAAS;IAC/C,MAAM,EAAS,GAAU,SAAS;IAClC,MAAM,kBAAC,GAAD,EAAS,MAAM,IAAM,CAAA;IAC3B,OAAO;IACP,OAAO;IACR;GACD;IACE,IAAI;IACJ,OAAO,EAAE,+BAA+B,WAAW;IACnD,MAAM,EAAS,GAAU,WAAW;IACpC,MAAM,kBAAC,GAAD,EAAW,MAAM,IAAM,CAAA;IAC7B,OAAO;IACP,OAAO;IACR;GACD;IACE,IAAI;IACJ,OAAO,EAAE,kCAAkC,cAAc;IACzD,MAAM,EAAS,GAAU,cAAc;IACvC,MAAM,kBAAC,GAAD,EAAgB,MAAM,IAAM,CAAA;IAClC,OAAO;IACP,OAAO;IACR;GACD;IACE,IAAI;IACJ,OAAO,EAAE,8BAA8B,UAAU;IACjD,MAAM,EAAS,GAAU,UAAU;IACnC,MAAM,kBAAC,GAAD,EAAU,MAAM,IAAM,CAAA;IAC5B,OAAO;IACP,OAAO;IACR;GACF,CAEgC;IAChC;EAAC;EAAkB;EAAU;EAAE,CAAC,EAEnC,QAAgB;AACT,QACL,QAAO,EAAoB,CACzB;GACE,IAAI;GACJ,OAAO,EAAE,+BAA+B,uBAAuB;GAC/D,MAAM;GACN,SAAS;GACT,OAAO;GACR,CACF,CAAC;IACD,CAAC,GAAqB,EAAE,CAAC,EAG1B,kBAAC,GAAD;EAAqB,QAAQ;YAC3B,kBAAC,GAAD;GAAqB,aAAa;GAAM,SAAQ;GAAS,gBAAgB;aACvE,kBAAC,GAAD;IAAwB,GAAI;cAC1B,kBAAC,GAAD,EAAwB,CAAA;IACD,CAAA;GACL,CAAA;EACF,CAAA"}
|
|
@@ -5,20 +5,24 @@ import { Navigate as i, Route as a, Routes as o, useLocation as s } from "react-
|
|
|
5
5
|
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
6
6
|
import { Spinner as u } from "@burdenoff/fe-libs/ui";
|
|
7
7
|
//#region src/theculturepost/TheCulturePostRoutes.tsx
|
|
8
|
-
var d = r(() => import("./pages/stories/StoriesPage.js").then((e) => ({ default: e.StoriesPage }))), f = r(() => import("./pages/stories/StoryDetailPage.js").then((e) => ({ default: e.StoryDetailPage }))), p = r(() => import("./pages/topics/TopicsPage.js").then((e) => ({ default: e.TopicsPage }))), m = r(() => import("./pages/topics/TopicDetailPage.js").then((e) => ({ default: e.TopicDetailPage }))), h = r(() => import("./pages/discussions/DiscussionsPage.js").then((e) => ({ default: e.DiscussionsPage }))), g = r(() => import("./pages/discussions/DiscussionDetailPage.js").then((e) => ({ default: e.DiscussionDetailPage }))), _ = r(() => import("./pages/archive/ArchivePage.js").then((e) => ({ default: e.ArchivePage }))),
|
|
8
|
+
var d = r(() => import("./pages/stories/StoriesPage.js").then((e) => ({ default: e.StoriesPage }))), f = r(() => import("./pages/stories/StoryDetailPage.js").then((e) => ({ default: e.StoryDetailPage }))), p = r(() => import("./pages/topics/TopicsPage.js").then((e) => ({ default: e.TopicsPage }))), m = r(() => import("./pages/topics/TopicDetailPage.js").then((e) => ({ default: e.TopicDetailPage }))), h = r(() => import("./pages/discussions/DiscussionsPage.js").then((e) => ({ default: e.DiscussionsPage }))), g = r(() => import("./pages/discussions/DiscussionDetailPage.js").then((e) => ({ default: e.DiscussionDetailPage }))), _ = r(() => import("./pages/timeline/TimelinePage.js").then((e) => ({ default: e.TimelinePage }))), v = r(() => import("./pages/governance/GovernancePage.js").then((e) => ({ default: e.GovernancePage }))), y = r(() => import("./pages/archive/ArchivePage.js").then((e) => ({ default: e.ArchivePage }))), b = r(() => import("./pages/archive/CollectionDetailPage.js").then((e) => ({ default: e.CollectionDetailPage }))), x = r(() => import("./pages/archive/ArchiveItemDetailPage.js").then((e) => ({ default: e.ArchiveItemDetailPage }))), S = () => /* @__PURE__ */ c("div", {
|
|
9
9
|
className: "flex min-h-[400px] items-center justify-center",
|
|
10
10
|
children: /* @__PURE__ */ c(u, { size: "lg" })
|
|
11
|
-
}),
|
|
12
|
-
let { basePath: r, isStandalone: u } = e(),
|
|
13
|
-
return
|
|
11
|
+
}), C = () => {
|
|
12
|
+
let { basePath: r, isStandalone: u } = e(), C = s(), w = r === "/" ? "" : (r ?? "").replace(/\/$/, "");
|
|
13
|
+
return w && !u && !(C.pathname === w || C.pathname.startsWith(w + "/")) ? null : /* @__PURE__ */ c("div", {
|
|
14
14
|
className: "flex min-h-full flex-col",
|
|
15
15
|
children: /* @__PURE__ */ c(n, {
|
|
16
|
-
fallback: /* @__PURE__ */ c(
|
|
16
|
+
fallback: /* @__PURE__ */ c(S, {}),
|
|
17
17
|
children: /* @__PURE__ */ l(o, { children: [
|
|
18
18
|
/* @__PURE__ */ c(a, {
|
|
19
19
|
index: !0,
|
|
20
20
|
element: /* @__PURE__ */ c(t, {})
|
|
21
21
|
}),
|
|
22
|
+
/* @__PURE__ */ c(a, {
|
|
23
|
+
path: "overview",
|
|
24
|
+
element: /* @__PURE__ */ c(v, {})
|
|
25
|
+
}),
|
|
22
26
|
/* @__PURE__ */ c(a, {
|
|
23
27
|
path: "stories",
|
|
24
28
|
element: /* @__PURE__ */ c(d, {})
|
|
@@ -35,6 +39,10 @@ var d = r(() => import("./pages/stories/StoriesPage.js").then((e) => ({ default:
|
|
|
35
39
|
path: "topics/:id",
|
|
36
40
|
element: /* @__PURE__ */ c(m, {})
|
|
37
41
|
}),
|
|
42
|
+
/* @__PURE__ */ c(a, {
|
|
43
|
+
path: "timeline",
|
|
44
|
+
element: /* @__PURE__ */ c(_, {})
|
|
45
|
+
}),
|
|
38
46
|
/* @__PURE__ */ c(a, {
|
|
39
47
|
path: "discussions",
|
|
40
48
|
element: /* @__PURE__ */ c(h, {})
|
|
@@ -45,15 +53,15 @@ var d = r(() => import("./pages/stories/StoriesPage.js").then((e) => ({ default:
|
|
|
45
53
|
}),
|
|
46
54
|
/* @__PURE__ */ c(a, {
|
|
47
55
|
path: "archive",
|
|
48
|
-
element: /* @__PURE__ */ c(
|
|
56
|
+
element: /* @__PURE__ */ c(y, {})
|
|
49
57
|
}),
|
|
50
58
|
/* @__PURE__ */ c(a, {
|
|
51
59
|
path: "archive/collections/:id",
|
|
52
|
-
element: /* @__PURE__ */ c(
|
|
60
|
+
element: /* @__PURE__ */ c(b, {})
|
|
53
61
|
}),
|
|
54
62
|
/* @__PURE__ */ c(a, {
|
|
55
63
|
path: "archive/items/:id",
|
|
56
|
-
element: /* @__PURE__ */ c(
|
|
64
|
+
element: /* @__PURE__ */ c(x, {})
|
|
57
65
|
}),
|
|
58
66
|
/* @__PURE__ */ c(a, {
|
|
59
67
|
path: "*",
|
|
@@ -67,6 +75,6 @@ var d = r(() => import("./pages/stories/StoriesPage.js").then((e) => ({ default:
|
|
|
67
75
|
});
|
|
68
76
|
};
|
|
69
77
|
//#endregion
|
|
70
|
-
export {
|
|
78
|
+
export { C as TheCulturePostRoutes };
|
|
71
79
|
|
|
72
80
|
//# sourceMappingURL=TheCulturePostRoutes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TheCulturePostRoutes.js","names":[],"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 } from 'react';\nimport { Routes, Route, Navigate, useLocation } from 'react-router-dom';\nimport { Spinner } from '@burdenoff/fe-libs/ui';\nimport { useTheCulturePost } from './context/TheCulturePostContext';\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);\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// 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 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={<HomePage />} />\n\n <Route path=\"stories\" element={<StoriesPage />} />\n <Route path=\"stories/:id\" element={<StoryDetailPage />} />\n\n <Route path=\"topics\" element={<TopicsPage />} />\n <Route path=\"topics/:id\" element={<TopicDetailPage />} />\n\n <Route path=\"discussions\" element={<DiscussionsPage />} />\n <Route path=\"discussions/:id\" element={<DiscussionDetailPage />} />\n\n <Route path=\"archive\" element={<ArchivePage />} />\n <Route path=\"archive/collections/:id\" element={<CollectionDetailPage />} />\n <Route path=\"archive/items/:id\" element={<ArchiveItemDetailPage />} />\n\n <Route path=\"*\" element={<Navigate to=\"\" replace />} />\n </Routes>\n </Suspense>\n </div>\n );\n};\n"],"mappings":";;;;;;;AAkBA,IAAM,IAAc,QAClB,OAAO,kCAA+B,MAAM,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,CAChF,EACK,IAAkB,QACtB,OAAO,sCAAmC,MAAM,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,CACxF,EAGK,IAAa,QACjB,OAAO,gCAA6B,MAAM,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAC7E,EACK,IAAkB,QACtB,OAAO,qCAAkC,MAAM,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,CACvF,EAGK,IAAkB,QACtB,OAAO,0CAAuC,MAAM,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAC5F,EACK,IAAuB,QAC3B,OAAO,+CAA4C,MAAM,OAAO,EAC9D,SAAS,EAAE,sBACZ,EAAE,CACJ,EAGK,IAAc,QAClB,OAAO,kCAA+B,MAAM,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,CAChF,EACK,IAAuB,QAC3B,OAAO,2CAAwC,MAAM,OAAO,EAAE,SAAS,EAAE,sBAAsB,EAAE,CAClG,EACK,IAAwB,QAC5B,OAAO,4CAAyC,MAAM,OAAO,EAC3D,SAAS,EAAE,uBACZ,EAAE,CACJ,EAEK,UACJ,kBAAC,OAAD;CAAK,WAAU;WACb,kBAAC,GAAD,EAAS,MAAK,MAAO,CAAA;CACjB,CAAA,EAGK,UAAiC;CAC5C,IAAM,EAAE,aAAU,oBAAiB,GAAmB,EAChD,IAAW,GAAa,EAExB,IAAqB,MAAa,MAAM,MAAM,KAAY,IAAI,QAAQ,OAAO,GAAG;AAYtF,QATI,KAAsB,CAAC,KAIrB,EAFF,EAAS,aAAa,KACtB,EAAS,SAAS,WAAW,IAAqB,IAAI,IAE/C,OAKT,kBAAC,OAAD;EAAK,WAAU;YACb,kBAAC,GAAD;GAAU,UAAU,kBAAC,GAAD,EAAc,CAAA;aAChC,kBAAC,GAAD,EAAA,UAAA;IACE,kBAAC,GAAD;KAAO,OAAA;KAAM,SAAS,kBAAC,GAAD,EAAY,CAAA;KAAI,CAAA;IAEtC,kBAAC,GAAD;KAAO,MAAK;KAAU,SAAS,kBAAC,GAAD,EAAe,CAAA;KAAI,CAAA;IAClD,kBAAC,GAAD;KAAO,MAAK;KAAc,SAAS,kBAAC,GAAD,EAAmB,CAAA;KAAI,CAAA;IAE1D,kBAAC,GAAD;KAAO,MAAK;KAAS,SAAS,kBAAC,GAAD,EAAc,CAAA;KAAI,CAAA;IAChD,kBAAC,GAAD;KAAO,MAAK;KAAa,SAAS,kBAAC,GAAD,EAAmB,CAAA;KAAI,CAAA;IAEzD,kBAAC,GAAD;KAAO,MAAK;KAAc,SAAS,kBAAC,GAAD,EAAmB,CAAA;KAAI,CAAA;IAC1D,kBAAC,GAAD;KAAO,MAAK;KAAkB,SAAS,kBAAC,GAAD,EAAwB,CAAA;KAAI,CAAA;IAEnE,kBAAC,GAAD;KAAO,MAAK;KAAU,SAAS,kBAAC,GAAD,EAAe,CAAA;KAAI,CAAA;IAClD,kBAAC,GAAD;KAAO,MAAK;KAA0B,SAAS,kBAAC,GAAD,EAAwB,CAAA;KAAI,CAAA;IAC3E,kBAAC,GAAD;KAAO,MAAK;KAAoB,SAAS,kBAAC,GAAD,EAAyB,CAAA;KAAI,CAAA;IAEtE,kBAAC,GAAD;KAAO,MAAK;KAAI,SAAS,kBAAC,GAAD;MAAU,IAAG;MAAG,SAAA;MAAU,CAAA;KAAI,CAAA;IAChD,EAAA,CAAA;GACA,CAAA;EACP,CAAA"}
|
|
1
|
+
{"version":3,"file":"TheCulturePostRoutes.js","names":[],"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 } from 'react';\nimport { Routes, Route, Navigate, useLocation } from 'react-router-dom';\nimport { Spinner } from '@burdenoff/fe-libs/ui';\nimport { useTheCulturePost } from './context/TheCulturePostContext';\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);\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 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={<HomePage />} />\n\n <Route path=\"overview\" element={<GovernancePage />} />\n\n <Route path=\"stories\" element={<StoriesPage />} />\n <Route path=\"stories/:id\" element={<StoryDetailPage />} />\n\n <Route path=\"topics\" element={<TopicsPage />} />\n <Route path=\"topics/:id\" element={<TopicDetailPage />} />\n\n <Route path=\"timeline\" element={<TimelinePage />} />\n\n <Route path=\"discussions\" element={<DiscussionsPage />} />\n <Route path=\"discussions/:id\" element={<DiscussionDetailPage />} />\n\n <Route path=\"archive\" element={<ArchivePage />} />\n <Route path=\"archive/collections/:id\" element={<CollectionDetailPage />} />\n <Route path=\"archive/items/:id\" element={<ArchiveItemDetailPage />} />\n\n <Route path=\"*\" element={<Navigate to=\"\" replace />} />\n </Routes>\n </Suspense>\n </div>\n );\n};\n"],"mappings":";;;;;;;AAkBA,IAAM,IAAc,QAClB,OAAO,kCAA+B,MAAM,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,CAChF,EACK,IAAkB,QACtB,OAAO,sCAAmC,MAAM,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,CACxF,EAGK,IAAa,QACjB,OAAO,gCAA6B,MAAM,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAC7E,EACK,IAAkB,QACtB,OAAO,qCAAkC,MAAM,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,CACvF,EAGK,IAAkB,QACtB,OAAO,0CAAuC,MAAM,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAC5F,EACK,IAAuB,QAC3B,OAAO,+CAA4C,MAAM,OAAO,EAC9D,SAAS,EAAE,sBACZ,EAAE,CACJ,EAGK,IAAe,QACnB,OAAO,oCAAiC,MAAM,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,CACnF,EAGK,IAAiB,QACrB,OAAO,wCAAqC,MAAM,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,CACzF,EAGK,IAAc,QAClB,OAAO,kCAA+B,MAAM,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,CAChF,EACK,IAAuB,QAC3B,OAAO,2CAAwC,MAAM,OAAO,EAAE,SAAS,EAAE,sBAAsB,EAAE,CAClG,EACK,IAAwB,QAC5B,OAAO,4CAAyC,MAAM,OAAO,EAC3D,SAAS,EAAE,uBACZ,EAAE,CACJ,EAEK,UACJ,kBAAC,OAAD;CAAK,WAAU;WACb,kBAAC,GAAD,EAAS,MAAK,MAAO,CAAA;CACjB,CAAA,EAGK,UAAiC;CAC5C,IAAM,EAAE,aAAU,oBAAiB,GAAmB,EAChD,IAAW,GAAa,EAExB,IAAqB,MAAa,MAAM,MAAM,KAAY,IAAI,QAAQ,OAAO,GAAG;AAYtF,QATI,KAAsB,CAAC,KAIrB,EAFF,EAAS,aAAa,KACtB,EAAS,SAAS,WAAW,IAAqB,IAAI,IAE/C,OAKT,kBAAC,OAAD;EAAK,WAAU;YACb,kBAAC,GAAD;GAAU,UAAU,kBAAC,GAAD,EAAc,CAAA;aAChC,kBAAC,GAAD,EAAA,UAAA;IACE,kBAAC,GAAD;KAAO,OAAA;KAAM,SAAS,kBAAC,GAAD,EAAY,CAAA;KAAI,CAAA;IAEtC,kBAAC,GAAD;KAAO,MAAK;KAAW,SAAS,kBAAC,GAAD,EAAkB,CAAA;KAAI,CAAA;IAEtD,kBAAC,GAAD;KAAO,MAAK;KAAU,SAAS,kBAAC,GAAD,EAAe,CAAA;KAAI,CAAA;IAClD,kBAAC,GAAD;KAAO,MAAK;KAAc,SAAS,kBAAC,GAAD,EAAmB,CAAA;KAAI,CAAA;IAE1D,kBAAC,GAAD;KAAO,MAAK;KAAS,SAAS,kBAAC,GAAD,EAAc,CAAA;KAAI,CAAA;IAChD,kBAAC,GAAD;KAAO,MAAK;KAAa,SAAS,kBAAC,GAAD,EAAmB,CAAA;KAAI,CAAA;IAEzD,kBAAC,GAAD;KAAO,MAAK;KAAW,SAAS,kBAAC,GAAD,EAAgB,CAAA;KAAI,CAAA;IAEpD,kBAAC,GAAD;KAAO,MAAK;KAAc,SAAS,kBAAC,GAAD,EAAmB,CAAA;KAAI,CAAA;IAC1D,kBAAC,GAAD;KAAO,MAAK;KAAkB,SAAS,kBAAC,GAAD,EAAwB,CAAA;KAAI,CAAA;IAEnE,kBAAC,GAAD;KAAO,MAAK;KAAU,SAAS,kBAAC,GAAD,EAAe,CAAA;KAAI,CAAA;IAClD,kBAAC,GAAD;KAAO,MAAK;KAA0B,SAAS,kBAAC,GAAD,EAAwB,CAAA;KAAI,CAAA;IAC3E,kBAAC,GAAD;KAAO,MAAK;KAAoB,SAAS,kBAAC,GAAD,EAAyB,CAAA;KAAI,CAAA;IAEtE,kBAAC,GAAD;KAAO,MAAK;KAAI,SAAS,kBAAC,GAAD;MAAU,IAAG;MAAG,SAAA;MAAU,CAAA;KAAI,CAAA;IAChD,EAAA,CAAA;GACA,CAAA;EACP,CAAA"}
|
|
@@ -4,11 +4,13 @@ import { useTcpAddCitation as n } from "../hooks/useTcpApi.js";
|
|
|
4
4
|
import "../hooks/index.js";
|
|
5
5
|
import { describeError as r, notify as i } from "../lib/toast.js";
|
|
6
6
|
import { FileUploadField as a } from "./FileUploadField.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
7
|
+
import { sourceTypeIcon as o } from "./CitationList.js";
|
|
8
|
+
import { createElement as s, useState as c } from "react";
|
|
9
|
+
import { ShieldCheck as l } from "lucide-react";
|
|
10
|
+
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
11
|
+
import { Button as f, Input as p, Label as m, ResponsiveDialog as h, ResponsiveDialogContent as g, ResponsiveDialogDescription as _, ResponsiveDialogFooter as v, ResponsiveDialogHeader as y, ResponsiveDialogTitle as b, Select as x, SelectContent as S, SelectItem as C, SelectTrigger as w, SelectValue as T, Textarea as E } from "@burdenoff/fe-libs/ui";
|
|
10
12
|
//#region src/theculturepost/components/AddCitationDialog.tsx
|
|
11
|
-
var
|
|
13
|
+
var D = [
|
|
12
14
|
"WEB",
|
|
13
15
|
"BOOK",
|
|
14
16
|
"ACADEMIC",
|
|
@@ -17,170 +19,197 @@ var w = [
|
|
|
17
19
|
"PRIMARY_DOCUMENT",
|
|
18
20
|
"ARCHIVAL_RECORD",
|
|
19
21
|
"ARTIFACT"
|
|
20
|
-
],
|
|
22
|
+
], O = (e) => {
|
|
21
23
|
if (!e) return null;
|
|
22
24
|
let t = new Date(e);
|
|
23
25
|
return Number.isNaN(t.getTime()) ? null : t.toISOString();
|
|
24
26
|
};
|
|
25
|
-
function
|
|
26
|
-
let
|
|
27
|
-
|
|
27
|
+
function k({ open: k, onOpenChange: A, storyId: j, onCreated: M }) {
|
|
28
|
+
let N = n(), [P, F] = c(""), [I, L] = c(""), [R, z] = c(""), [B, V] = c(""), [H, U] = c(""), [W, G] = c(""), [K, q] = c(""), [J, Y] = c("WEB"), [X, Z] = c(null), [Q, $] = c(null), ee = () => {
|
|
29
|
+
F(""), L(""), z(""), V(""), U(""), G(""), q(""), Y("WEB"), Z(null), $(null);
|
|
28
30
|
};
|
|
29
|
-
return /* @__PURE__ */
|
|
30
|
-
open:
|
|
31
|
-
onOpenChange:
|
|
32
|
-
children: /* @__PURE__ */
|
|
31
|
+
return /* @__PURE__ */ u(h, {
|
|
32
|
+
open: k,
|
|
33
|
+
onOpenChange: A,
|
|
34
|
+
children: /* @__PURE__ */ d(g, {
|
|
33
35
|
className: "sm:max-w-lg",
|
|
34
36
|
children: [
|
|
35
|
-
/* @__PURE__ */
|
|
36
|
-
/* @__PURE__ */
|
|
37
|
-
className: "flex max-h-[62vh] flex-col gap-
|
|
37
|
+
/* @__PURE__ */ d(y, { children: [/* @__PURE__ */ u(b, { children: "Add a citation" }), /* @__PURE__ */ u(_, { children: "Ground this story in the record with a verifiable source." })] }),
|
|
38
|
+
/* @__PURE__ */ d("div", {
|
|
39
|
+
className: "flex max-h-[62vh] flex-col gap-5 overflow-y-auto py-2",
|
|
38
40
|
children: [
|
|
39
|
-
/* @__PURE__ */
|
|
41
|
+
/* @__PURE__ */ d("div", {
|
|
40
42
|
className: "grid gap-1.5",
|
|
41
|
-
children: [/* @__PURE__ */
|
|
43
|
+
children: [/* @__PURE__ */ d(m, {
|
|
42
44
|
htmlFor: "cite-title",
|
|
43
|
-
children: "Title"
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
value: j,
|
|
47
|
-
onChange: (e) => M(e.target.value),
|
|
48
|
-
placeholder: "Source title"
|
|
49
|
-
})]
|
|
50
|
-
}),
|
|
51
|
-
/* @__PURE__ */ c("div", {
|
|
52
|
-
className: "grid grid-cols-2 gap-3",
|
|
53
|
-
children: [/* @__PURE__ */ c("div", {
|
|
54
|
-
className: "grid gap-1.5",
|
|
55
|
-
children: [/* @__PURE__ */ s(d, {
|
|
56
|
-
htmlFor: "cite-author",
|
|
57
|
-
children: "Author"
|
|
58
|
-
}), /* @__PURE__ */ s(u, {
|
|
59
|
-
id: "cite-author",
|
|
60
|
-
value: N,
|
|
61
|
-
onChange: (e) => P(e.target.value)
|
|
62
|
-
})]
|
|
63
|
-
}), /* @__PURE__ */ c("div", {
|
|
64
|
-
className: "grid gap-1.5",
|
|
65
|
-
children: [/* @__PURE__ */ s(d, {
|
|
66
|
-
htmlFor: "cite-publisher",
|
|
67
|
-
children: "Publisher"
|
|
68
|
-
}), /* @__PURE__ */ s(u, {
|
|
69
|
-
id: "cite-publisher",
|
|
70
|
-
value: F,
|
|
71
|
-
onChange: (e) => I(e.target.value)
|
|
45
|
+
children: ["Title ", /* @__PURE__ */ u("span", {
|
|
46
|
+
className: "text-status-error-text",
|
|
47
|
+
children: "*"
|
|
72
48
|
})]
|
|
49
|
+
}), /* @__PURE__ */ u(p, {
|
|
50
|
+
id: "cite-title",
|
|
51
|
+
value: P,
|
|
52
|
+
onChange: (e) => F(e.target.value),
|
|
53
|
+
placeholder: "e.g. The Penguin History of Early India"
|
|
73
54
|
})]
|
|
74
55
|
}),
|
|
75
|
-
/* @__PURE__ */
|
|
76
|
-
className: "grid grid-cols-
|
|
77
|
-
children: [/* @__PURE__ */
|
|
56
|
+
/* @__PURE__ */ d("div", {
|
|
57
|
+
className: "grid grid-cols-1 gap-3 sm:grid-cols-2",
|
|
58
|
+
children: [/* @__PURE__ */ d("div", {
|
|
78
59
|
className: "grid gap-1.5",
|
|
79
|
-
children: [/* @__PURE__ */
|
|
80
|
-
value:
|
|
81
|
-
onValueChange: (e) =>
|
|
82
|
-
children: [/* @__PURE__ */
|
|
60
|
+
children: [/* @__PURE__ */ u(m, { children: "Source type" }), /* @__PURE__ */ d(x, {
|
|
61
|
+
value: J,
|
|
62
|
+
onValueChange: (e) => Y(e),
|
|
63
|
+
children: [/* @__PURE__ */ u(w, { children: /* @__PURE__ */ u(T, {}) }), /* @__PURE__ */ u(S, { children: D.map((e) => /* @__PURE__ */ u(C, {
|
|
83
64
|
value: e,
|
|
84
|
-
children:
|
|
65
|
+
children: /* @__PURE__ */ d("span", {
|
|
66
|
+
className: "inline-flex items-center gap-2",
|
|
67
|
+
children: [s(o(e), { className: "h-3.5 w-3.5 text-text-tertiary" }), t(e)]
|
|
68
|
+
})
|
|
85
69
|
}, e)) })]
|
|
86
70
|
})]
|
|
87
|
-
}), /* @__PURE__ */
|
|
71
|
+
}), /* @__PURE__ */ d("div", {
|
|
88
72
|
className: "grid gap-1.5",
|
|
89
|
-
children: [/* @__PURE__ */
|
|
73
|
+
children: [/* @__PURE__ */ u(m, {
|
|
90
74
|
htmlFor: "cite-published",
|
|
91
75
|
children: "Published on"
|
|
92
|
-
}), /* @__PURE__ */
|
|
76
|
+
}), /* @__PURE__ */ u(p, {
|
|
93
77
|
id: "cite-published",
|
|
94
78
|
type: "date",
|
|
95
|
-
value:
|
|
96
|
-
onChange: (e) =>
|
|
79
|
+
value: B,
|
|
80
|
+
onChange: (e) => V(e.target.value)
|
|
97
81
|
})]
|
|
98
82
|
})]
|
|
99
83
|
}),
|
|
100
|
-
/* @__PURE__ */
|
|
84
|
+
/* @__PURE__ */ d("div", {
|
|
85
|
+
className: "grid grid-cols-1 gap-3 sm:grid-cols-2",
|
|
86
|
+
children: [/* @__PURE__ */ d("div", {
|
|
87
|
+
className: "grid gap-1.5",
|
|
88
|
+
children: [/* @__PURE__ */ u(m, {
|
|
89
|
+
htmlFor: "cite-author",
|
|
90
|
+
children: "Author"
|
|
91
|
+
}), /* @__PURE__ */ u(p, {
|
|
92
|
+
id: "cite-author",
|
|
93
|
+
value: I,
|
|
94
|
+
onChange: (e) => L(e.target.value),
|
|
95
|
+
placeholder: "e.g. Romila Thapar"
|
|
96
|
+
})]
|
|
97
|
+
}), /* @__PURE__ */ d("div", {
|
|
98
|
+
className: "grid gap-1.5",
|
|
99
|
+
children: [/* @__PURE__ */ u(m, {
|
|
100
|
+
htmlFor: "cite-publisher",
|
|
101
|
+
children: "Publisher"
|
|
102
|
+
}), /* @__PURE__ */ u(p, {
|
|
103
|
+
id: "cite-publisher",
|
|
104
|
+
value: R,
|
|
105
|
+
onChange: (e) => z(e.target.value),
|
|
106
|
+
placeholder: "e.g. Penguin Books"
|
|
107
|
+
})]
|
|
108
|
+
})]
|
|
109
|
+
}),
|
|
110
|
+
/* @__PURE__ */ d("div", {
|
|
101
111
|
className: "grid gap-1.5",
|
|
102
|
-
children: [/* @__PURE__ */
|
|
112
|
+
children: [/* @__PURE__ */ u(m, {
|
|
103
113
|
htmlFor: "cite-url",
|
|
104
114
|
children: "URL"
|
|
105
|
-
}), /* @__PURE__ */
|
|
115
|
+
}), /* @__PURE__ */ u(p, {
|
|
106
116
|
id: "cite-url",
|
|
107
|
-
|
|
108
|
-
|
|
117
|
+
type: "url",
|
|
118
|
+
inputMode: "url",
|
|
119
|
+
value: H,
|
|
120
|
+
onChange: (e) => U(e.target.value),
|
|
109
121
|
placeholder: "https://…"
|
|
110
122
|
})]
|
|
111
123
|
}),
|
|
112
|
-
/* @__PURE__ */
|
|
124
|
+
/* @__PURE__ */ d("div", {
|
|
113
125
|
className: "grid gap-1.5",
|
|
114
|
-
children: [/* @__PURE__ */
|
|
126
|
+
children: [/* @__PURE__ */ u(m, {
|
|
115
127
|
htmlFor: "cite-excerpt",
|
|
116
128
|
children: "Excerpt"
|
|
117
|
-
}), /* @__PURE__ */
|
|
129
|
+
}), /* @__PURE__ */ u(E, {
|
|
118
130
|
id: "cite-excerpt",
|
|
119
|
-
value:
|
|
120
|
-
onChange: (e) =>
|
|
121
|
-
placeholder: "A short quoted passage",
|
|
131
|
+
value: W,
|
|
132
|
+
onChange: (e) => G(e.target.value),
|
|
133
|
+
placeholder: "A short quoted passage that supports the story.",
|
|
122
134
|
rows: 2
|
|
123
135
|
})]
|
|
124
136
|
}),
|
|
125
|
-
/* @__PURE__ */
|
|
137
|
+
/* @__PURE__ */ d("div", {
|
|
126
138
|
className: "grid gap-1.5",
|
|
127
|
-
children: [/* @__PURE__ */
|
|
139
|
+
children: [/* @__PURE__ */ u(m, {
|
|
128
140
|
htmlFor: "cite-provenance",
|
|
129
141
|
children: "Provenance"
|
|
130
|
-
}), /* @__PURE__ */
|
|
142
|
+
}), /* @__PURE__ */ u(E, {
|
|
131
143
|
id: "cite-provenance",
|
|
132
|
-
value:
|
|
133
|
-
onChange: (e) =>
|
|
144
|
+
value: K,
|
|
145
|
+
onChange: (e) => q(e.target.value),
|
|
146
|
+
placeholder: "Where the source is held, reference numbers, chain of custody…",
|
|
134
147
|
rows: 2
|
|
135
148
|
})]
|
|
136
149
|
}),
|
|
137
|
-
/* @__PURE__ */
|
|
150
|
+
/* @__PURE__ */ d("div", {
|
|
138
151
|
className: "grid gap-1.5",
|
|
139
|
-
children: [/* @__PURE__ */
|
|
152
|
+
children: [/* @__PURE__ */ u(m, { children: "Source scan" }), /* @__PURE__ */ u(a, {
|
|
140
153
|
folder: e.artifacts,
|
|
141
154
|
accept: "image/*,application/pdf",
|
|
142
155
|
label: "Upload source scan",
|
|
143
156
|
hint: "A scan of the primary source (optional).",
|
|
144
|
-
fileId:
|
|
145
|
-
onUploaded:
|
|
146
|
-
onCleared: () =>
|
|
157
|
+
fileId: X,
|
|
158
|
+
onUploaded: Z,
|
|
159
|
+
onCleared: () => Z(null)
|
|
147
160
|
})]
|
|
148
161
|
}),
|
|
149
|
-
|
|
162
|
+
/* @__PURE__ */ d("p", {
|
|
163
|
+
className: "flex items-start gap-2 rounded-lg bg-bg-sunken/60 px-3 py-2 text-xs text-text-tertiary",
|
|
164
|
+
children: [
|
|
165
|
+
/* @__PURE__ */ u(l, {
|
|
166
|
+
className: "mt-0.5 h-3.5 w-3.5 shrink-0",
|
|
167
|
+
"aria-hidden": "true"
|
|
168
|
+
}),
|
|
169
|
+
"New sources start as ",
|
|
170
|
+
/* @__PURE__ */ u("span", {
|
|
171
|
+
className: "font-medium text-text-secondary",
|
|
172
|
+
children: "Unverified"
|
|
173
|
+
}),
|
|
174
|
+
" ",
|
|
175
|
+
"and are reviewed for accuracy, relevance, and cultural sensitivity before verification."
|
|
176
|
+
]
|
|
177
|
+
}),
|
|
178
|
+
Q && /* @__PURE__ */ u("p", {
|
|
150
179
|
className: "text-sm text-status-error-text",
|
|
151
|
-
children:
|
|
180
|
+
children: Q
|
|
152
181
|
})
|
|
153
182
|
]
|
|
154
183
|
}),
|
|
155
|
-
/* @__PURE__ */
|
|
184
|
+
/* @__PURE__ */ d(v, { children: [/* @__PURE__ */ u(f, {
|
|
156
185
|
variant: "outline",
|
|
157
|
-
onClick: () =>
|
|
186
|
+
onClick: () => A(!1),
|
|
158
187
|
children: "Cancel"
|
|
159
|
-
}), /* @__PURE__ */
|
|
188
|
+
}), /* @__PURE__ */ u(f, {
|
|
160
189
|
onClick: async () => {
|
|
161
|
-
if (!
|
|
162
|
-
|
|
190
|
+
if (!P.trim()) {
|
|
191
|
+
$("A citation title is required.");
|
|
163
192
|
return;
|
|
164
193
|
}
|
|
165
194
|
try {
|
|
166
|
-
let e = await
|
|
167
|
-
storyId:
|
|
168
|
-
title:
|
|
169
|
-
author:
|
|
170
|
-
publisher:
|
|
171
|
-
publishedOn:
|
|
172
|
-
url:
|
|
173
|
-
excerpt:
|
|
174
|
-
provenance:
|
|
175
|
-
sourceType:
|
|
176
|
-
sourceFileId:
|
|
195
|
+
let e = await N.mutateAsync({
|
|
196
|
+
storyId: j,
|
|
197
|
+
title: P.trim(),
|
|
198
|
+
author: I.trim() || null,
|
|
199
|
+
publisher: R.trim() || null,
|
|
200
|
+
publishedOn: O(B),
|
|
201
|
+
url: H.trim() || null,
|
|
202
|
+
excerpt: W.trim() || null,
|
|
203
|
+
provenance: K.trim() || null,
|
|
204
|
+
sourceType: J,
|
|
205
|
+
sourceFileId: X
|
|
177
206
|
});
|
|
178
|
-
i.success("Citation added", e.title),
|
|
207
|
+
i.success("Citation added", e.title), A(!1), ee(), M?.(e);
|
|
179
208
|
} catch (e) {
|
|
180
|
-
|
|
209
|
+
$(r(e));
|
|
181
210
|
}
|
|
182
211
|
},
|
|
183
|
-
disabled:
|
|
212
|
+
disabled: N.isPending,
|
|
184
213
|
children: "Add citation"
|
|
185
214
|
})] })
|
|
186
215
|
]
|
|
@@ -188,6 +217,6 @@ function E({ open: E, onOpenChange: D, storyId: O, onCreated: k }) {
|
|
|
188
217
|
});
|
|
189
218
|
}
|
|
190
219
|
//#endregion
|
|
191
|
-
export {
|
|
220
|
+
export { k as AddCitationDialog };
|
|
192
221
|
|
|
193
222
|
//# sourceMappingURL=AddCitationDialog.js.map
|