@anthusai/papyrus 1.0.0-next.5 → 1.0.0-next.7
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/amplify/data/resource.js +6 -0
- package/amplify/data/resource.ts +7 -0
- package/amplify/data/schema.js +6 -0
- package/amplify/data/schema.ts +7 -0
- package/amplify/functions/content-actions/handler.py +44 -2
- package/amplify/rebuild-trigger-settings.js +22 -0
- package/amplify/rebuild-trigger-settings.ts +42 -0
- package/amplify/site-backend-config.ts +6 -0
- package/amplify/site-backend.js +18 -0
- package/amplify/site-backend.ts +20 -0
- package/app/newsroom/articles/[id]/page.tsx +15 -0
- package/app/newsroom/articles/page.tsx +13 -0
- package/components/markus-ir-preview.tsx +300 -0
- package/components/newsroom-access-gate.tsx +66 -0
- package/components/newsroom-article-editor.tsx +741 -0
- package/components/newsroom-articles-view.tsx +129 -0
- package/components/newsroom-ops-shell.tsx +3 -1
- package/components/topic-steering-workspace.tsx +1 -59
- package/lib/content-actions-demo.ts +190 -0
- package/lib/newsroom-articles.ts +325 -0
- package/lib/newsroom-demo-articles.ts +90 -0
- package/lib/newsroom-media-backend.ts +142 -0
- package/lib/newsroom-media.ts +182 -0
- package/lib/newsroom-nav.ts +2 -0
- package/package.json +12 -1
- package/routes.manifest.json +17 -1
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import Link from "next/link";
|
|
4
|
+
import { SITE_BRAND } from "../lib/site-brand";
|
|
5
|
+
import type { NewsDeskShellState } from "../lib/news-desk-session";
|
|
6
|
+
import { cn } from "../lib/utils";
|
|
7
|
+
import { NewsroomOpsShell } from "./newsroom-ops-shell";
|
|
8
|
+
import { ReaderAuthControl } from "./reader-auth-control";
|
|
9
|
+
import { buttonVariants } from "./ui/button";
|
|
10
|
+
|
|
11
|
+
export function NewsDeskAccessGate({ shell, showSectionTabs = false }: { shell: NewsDeskShellState | null; showSectionTabs?: boolean }) {
|
|
12
|
+
const accessPhase = shell?.phase ?? "checkingAccess";
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<NewsroomOpsShell
|
|
16
|
+
activeTab="overview"
|
|
17
|
+
appTitle={SITE_BRAND.appTitle}
|
|
18
|
+
backHref="/"
|
|
19
|
+
backLabel={SITE_BRAND.backToHomeLabel}
|
|
20
|
+
headerActions={(
|
|
21
|
+
<Link className={cn(buttonVariants({ variant: "ghost", size: "sm" }))} href="/settings">Settings</Link>
|
|
22
|
+
)}
|
|
23
|
+
pageTitle="Newsroom"
|
|
24
|
+
showNavigation={showSectionTabs}
|
|
25
|
+
>
|
|
26
|
+
<section aria-live="polite" data-news-desk-access={accessPhase} data-news-desk-access-phase={accessPhase}>
|
|
27
|
+
<div className="space-y-3 rounded-xl border border-border bg-card p-6">
|
|
28
|
+
<p className="m-0 text-[0.7rem] font-semibold uppercase tracking-[0.08em] text-muted-foreground">Access</p>
|
|
29
|
+
<h2 className="m-0 font-sans text-xl font-semibold tracking-tight">{formatAccessTitle(shell)}</h2>
|
|
30
|
+
<p className="m-0 text-sm text-muted-foreground">{formatAccessDetail(shell)}</p>
|
|
31
|
+
{shell?.error ? <p className="text-sm text-destructive">{shell.error}</p> : null}
|
|
32
|
+
<p className="m-0 text-sm text-foreground">{formatAccessActionDetail(shell)}</p>
|
|
33
|
+
{shell?.phase === "signedOut" || shell?.phase === "error" ? (
|
|
34
|
+
<div className="news-desk-access-panel__auth">
|
|
35
|
+
<ReaderAuthControl postAuthPath="/newsroom" showIdentity />
|
|
36
|
+
</div>
|
|
37
|
+
) : null}
|
|
38
|
+
</div>
|
|
39
|
+
</section>
|
|
40
|
+
</NewsroomOpsShell>
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function formatAccessTitle(state: NewsDeskShellState | null): string {
|
|
45
|
+
if (!state || state.phase === "checkingAccess") return "Checking Desk Credentials";
|
|
46
|
+
if (state.phase === "loadingDesk") return "Loading Newsroom Records";
|
|
47
|
+
if (state.phase === "forbidden") return "Editor Role Required";
|
|
48
|
+
if (state.phase === "error") return "Newsroom Unavailable";
|
|
49
|
+
return "Editor Sign-In Required";
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function formatAccessDetail(state: NewsDeskShellState | null): string {
|
|
53
|
+
if (!state || state.phase === "checkingAccess") return `${SITE_BRAND.appTitle} is checking the current browser session before loading steering state.`;
|
|
54
|
+
if (state.phase === "loadingDesk") return `${SITE_BRAND.appTitle} verified the browser session and is loading private Newsroom records.`;
|
|
55
|
+
if (state.phase === "forbidden") return "This account is signed in, but the Cognito session does not include the editor or admin group.";
|
|
56
|
+
if (state.phase === "error") return `${SITE_BRAND.appTitle} could not verify this editor session or load the private Newsroom data.`;
|
|
57
|
+
return "Sign in with an editor or admin account to inspect category, category tree, ontology, and graph steering.";
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function formatAccessActionDetail(state: NewsDeskShellState | null): string {
|
|
61
|
+
if (!state || state.phase === "checkingAccess") return "This should only take a moment. If it hangs, reload the page.";
|
|
62
|
+
if (state.phase === "loadingDesk") return "Private records are loading from GraphQL. Large reference queues may take several seconds.";
|
|
63
|
+
if (state.phase === "forbidden") return "Ask an admin to add this account to the editor or admin group, then sign out and back in.";
|
|
64
|
+
if (state.phase === "error") return "Reload the page or check the local development console for the GraphQL error.";
|
|
65
|
+
return "Use the login button above to authenticate with an editor or admin account.";
|
|
66
|
+
}
|