@anthusai/papyrus 1.0.0-next.55 → 1.0.0-next.57

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.
@@ -1,3 +1,4 @@
1
+ import { resolveActiveSiteBrand } from "../../../../lib/site-brand-tenant";
1
2
  import { notFound, redirect } from "next/navigation";
2
3
  import { toPublicNewsroomPath } from "../../../../lib/newsroom-base-path";
3
4
  import { NewsDeskPage } from "../../../../components/news-desk-page";
@@ -27,6 +28,7 @@ type NewsDeskNestedSectionPageProps = {
27
28
  };
28
29
 
29
30
  const NEWS_DESK_ROUTE_SECTIONS = new Set<NewsDeskTab>([
31
+ "desks",
30
32
  "administration",
31
33
  "topics",
32
34
  "concepts",
@@ -41,7 +43,7 @@ export default async function NewsDeskNestedSectionPage({ params, searchParams }
41
43
  if (section === "users") redirect(toPublicNewsroomPath("/newsroom/administration/users"));
42
44
  if (section === "doctrine") redirect(toPublicNewsroomPath("/newsroom/administration/policies"));
43
45
  if (section === "administration" && selection[0] === "analysis") redirect(toPublicNewsroomPath("/newsroom/assignments"));
44
- if (section === "desks") {
46
+ if (section === "desks" && resolveActiveSiteBrand().newsroomLayout !== "organizer") {
45
47
  const category = selection[0] ? decodeURIComponent(selection[0]) : null;
46
48
  if (category) redirect(toPublicNewsroomPath(`/newsroom/topics?category=${encodeURIComponent(category)}`));
47
49
  redirect(toPublicNewsroomPath("/newsroom/topics"));
@@ -1,3 +1,4 @@
1
+ import { resolveActiveSiteBrand } from "../../../lib/site-brand-tenant";
1
2
  import { notFound, redirect } from "next/navigation";
2
3
  import { toPublicNewsroomPath } from "../../../lib/newsroom-base-path";
3
4
  import { NewsDeskPage } from "../../../components/news-desk-page";
@@ -28,6 +29,7 @@ type NewsDeskSectionPageProps = {
28
29
  };
29
30
 
30
31
  const NEWS_DESK_ROUTE_SECTIONS = new Set<NewsDeskTab>([
32
+ "desks",
31
33
  "administration",
32
34
  "topics",
33
35
  "concepts",
@@ -42,7 +44,7 @@ export default async function NewsDeskSectionPage({ params, searchParams }: News
42
44
  const { section } = await params;
43
45
  if (section === "users") redirect(toPublicNewsroomPath("/newsroom/administration/users"));
44
46
  if (section === "doctrine") redirect(toPublicNewsroomPath("/newsroom/administration/policies"));
45
- if (section === "desks") redirect(toPublicNewsroomPath("/newsroom/topics"));
47
+ if (section === "desks" && resolveActiveSiteBrand().newsroomLayout !== "organizer") redirect(toPublicNewsroomPath("/newsroom/topics"));
46
48
  if (!NEWS_DESK_ROUTE_SECTIONS.has(section as NewsDeskTab)) notFound();
47
49
  return <NewsDeskPage section={section} searchParams={searchParams} />;
48
50
  }
@@ -0,0 +1,10 @@
1
+ import { notFound } from "next/navigation";
2
+ import { resolveActiveSiteBrand } from "../../../lib/site-brand-tenant";
3
+ import { NewsroomBoardView } from "../../../components/newsroom-board-view";
4
+
5
+ export const dynamic = "force-dynamic";
6
+
7
+ export default function NewsroomWorkPage() {
8
+ if (resolveActiveSiteBrand().newsroomLayout !== "organizer") notFound();
9
+ return <NewsroomBoardView />;
10
+ }
@@ -1,3 +1,4 @@
1
+ import { resolveNewsDeskTab } from "../lib/newsroom-section-routing";
1
2
  import { NewsDeskWorkspace, type NewsDeskTab } from "./topic-steering-workspace";
2
3
  import {
3
4
  createDemoCategorySteeringDashboard,
@@ -41,7 +42,8 @@ export type NewsDeskPageProps = {
41
42
 
42
43
  export async function NewsDeskPage({ section: routeSection, sectionPageId, selectionPath, searchParams }: NewsDeskPageProps) {
43
44
  const resolvedSearchParams = await searchParams;
44
- const initialTab = parseNewsDeskTab(routeSection ?? getSearchParam(resolvedSearchParams, "section"), getSearchParam(resolvedSearchParams, "tab"));
45
+ const brand = resolveActiveSiteBrand();
46
+ const initialTab = resolveNewsDeskTab(routeSection ?? getSearchParam(resolvedSearchParams, "section"), getSearchParam(resolvedSearchParams, "tab"), brand.newsroomLayout === "organizer");
45
47
  const routeSelection = parseRouteSelection(initialTab, selectionPath);
46
48
  const initialSelection = {
47
49
  assignment: routeSelection.assignment ?? getFirstSearchParam(resolvedSearchParams, "assignment"),
@@ -63,7 +65,6 @@ export async function NewsDeskPage({ section: routeSection, sectionPageId, selec
63
65
  proposal: getFirstSearchParam(resolvedSearchParams, "proposal"),
64
66
  };
65
67
  const useDemoDashboard = getFirstSearchParam(resolvedSearchParams, "demo") === "1";
66
- const brand = resolveActiveSiteBrand();
67
68
  const analysisProfiles = await loadAnalysisProfileSummaries(getBrandAnalysisProfilesPath(brand));
68
69
  const configuredCorpora = await loadConfiguredCorpusSummaries(getBrandSteeringConfigPath(brand));
69
70
  const dashboard = useDemoDashboard
@@ -77,6 +78,7 @@ function parseRouteSelection(tab: NewsDeskTab, selectionPath: string[] | null |
77
78
  if (!segments.length) return {};
78
79
  if (segments[0] === "forum" && segments[1]) return { forumThread: segments[1] };
79
80
  if (tab === "administration") return { panel: segments[0] ?? null };
81
+ if (tab === "desks") return { category: segments[0] ?? null };
80
82
  if (tab === "topics") return { category: segments[1] ?? segments[0] ?? null };
81
83
  if (tab === "references") return { reference: segments[0] ?? null };
82
84
  if (tab === "concepts") return { category: segments[0] ?? null };
@@ -101,16 +103,3 @@ function getFirstSearchParam(searchParams: unknown, key: string): string | null
101
103
  const first = Array.isArray(value) ? value[0] : value;
102
104
  return typeof first === "string" && first.trim() ? first.trim() : null;
103
105
  }
104
-
105
- function parseNewsDeskTab(sectionValue: string | string[] | null | undefined, legacyTabValue: string | string[] | null | undefined): NewsDeskTab {
106
- const section = Array.isArray(sectionValue) ? sectionValue[0] : sectionValue;
107
- const legacyTab = Array.isArray(legacyTabValue) ? legacyTabValue[0] : legacyTabValue;
108
- const rawValue = section ?? (legacyTab === "categories" ? "topics" : legacyTab);
109
- const value = rawValue === "users" || rawValue === "doctrine"
110
- ? "administration"
111
- : rawValue === "desks"
112
- ? "topics"
113
- : rawValue;
114
- if (value === "administration" || value === "topics" || value === "concepts" || value === "references" || value === "insights" || value === "messages" || value === "assignments" || value === "search") return value;
115
- return "overview";
116
- }
@@ -1,6 +1,7 @@
1
1
  "use client";
2
2
 
3
3
  import { generateClient } from "aws-amplify/data";
4
+ import { testEditorOverrideAllowed } from "../lib/test-editor-override";
4
5
  import { downloadData, getUrl } from "aws-amplify/storage";
5
6
  import type { Schema } from "../amplify/data/resource";
6
7
  import type { NewsDeskAppendix, NewsDeskCategoryTreeNode } from "../lib/content-types";
@@ -2569,8 +2570,7 @@ export async function runNewsroomKnowledgeQuery(input: Record<string, unknown>):
2569
2570
 
2570
2571
  export function hasTestEditorOverride(): boolean {
2571
2572
  if (typeof window === "undefined") return false;
2572
- const allowOverride = process.env.NODE_ENV === "test"
2573
- || process.env.NEXT_PUBLIC_ENABLE_TEST_EDITOR_OVERRIDE === "true";
2573
+ const allowOverride = testEditorOverrideAllowed(process.env.NODE_ENV, process.env.NEXT_PUBLIC_ENABLE_TEST_EDITOR_OVERRIDE);
2574
2574
  if (!allowOverride) return false;
2575
2575
  return window.localStorage.getItem(TEST_EDITOR_STORAGE_KEY) === "true";
2576
2576
  }
@@ -0,0 +1,101 @@
1
+ "use client";
2
+
3
+ import { useEffect, useMemo, useRef, useState } from "react";
4
+ import Link from "next/link";
5
+ import { IssueCollection, IssueDetailPanel, IssueTypeFilter, issueTypeFromFilter } from "@kanbus/ui";
6
+ import "@kanbus/ui/styles/tokens.css";
7
+ import "@kanbus/ui/styles/kanban.css";
8
+ import "@kanbus/ui/styles/organizer.css";
9
+ import { canReadNewsroomBoard, newsroomBoardConfig, projectNewsroomBoard, type NativeBoardIssue } from "../lib/newsroom-board";
10
+ import { resolveArticlesBackend } from "../lib/newsroom-articles";
11
+ import { SITE_BRAND } from "../lib/site-brand";
12
+ import { getNewsroomNavHref } from "../lib/newsroom-nav";
13
+ import { loadNewsroomAssignmentPage, loadNewsroomReferencePage } from "./news-desk-taxonomy-client";
14
+ import { useOptionalNewsDeskClient } from "./news-desk-client-provider";
15
+ import { NewsDeskAccessGate } from "./newsroom-access-gate";
16
+ import { NewsroomOpsShell, NewsroomOpsStatusBanner } from "./newsroom-ops-shell";
17
+ import { useResolvedPapyrusTheme } from "./use-resolved-papyrus-theme";
18
+ import { readLocalReaderSettings, subscribeReaderSettingsChanges } from "./reader-settings";
19
+
20
+ const STATIC_MOTION = { mode: "static" } as const;
21
+
22
+ /** Read-only shared board over authenticated CMS records; existing workspaces own every mutation. */
23
+ export function NewsroomBoardView() {
24
+ const session = useOptionalNewsDeskClient();
25
+ const allowed = canReadNewsroomBoard(session?.shell.phase);
26
+ const theme = useResolvedPapyrusTheme();
27
+ const [lowMotion, setLowMotion] = useState(false);
28
+ const [issues, setIssues] = useState<NativeBoardIssue[]>([]);
29
+ const [filter, setFilter] = useState("all");
30
+ const [view, setView] = useState<"board" | "list">("board");
31
+ const [revision, setRevision] = useState(0);
32
+ const [selected, setSelected] = useState<string | null>(null);
33
+ const [loading, setLoading] = useState(false);
34
+ const [error, setError] = useState<string | null>(null);
35
+ const [tokens, setTokens] = useState<{ reference?: string | null; assignment?: string | null }>({});
36
+ const generation = useRef(0);
37
+ const busy = useRef(false);
38
+ useEffect(() => {
39
+ setLowMotion(readLocalReaderSettings().motion === "low");
40
+ return subscribeReaderSettingsChanges(settings => setLowMotion(settings.motion === "low"));
41
+ }, []);
42
+ useEffect(() => {
43
+ const request = ++generation.current;
44
+ busy.current = false;
45
+ setIssues([]); setSelected(null); setTokens({}); setError(null);
46
+ if (!allowed) { setLoading(false); return; }
47
+ setLoading(true); busy.current = true;
48
+ Promise.all([
49
+ resolveArticlesBackend(false).listRows(),
50
+ loadNewsroomReferencePage({ limit: 50 }),
51
+ loadNewsroomAssignmentPage({ limit: 50 }),
52
+ ]).then(([articles, references, assignments]) => {
53
+ if (generation.current !== request) return;
54
+ setIssues(projectNewsroomBoard({ articles, references: references.items, assignments: assignments.items }));
55
+ setTokens({ reference: references.nextToken, assignment: assignments.nextToken });
56
+ }).catch((reason: unknown) => {
57
+ if (generation.current === request) setError(reason instanceof Error ? reason.message : "Could not load newsroom records.");
58
+ }).finally(() => { if (generation.current === request) { setLoading(false); busy.current = false; } });
59
+ return () => { generation.current = request + 1; };
60
+ }, [allowed, revision]);
61
+ async function loadMore(kind: "reference" | "assignment") {
62
+ if (!allowed || busy.current || !tokens[kind]) return;
63
+ const request = generation.current;
64
+ busy.current = true; setLoading(true); setError(null);
65
+ try {
66
+ const added = kind === "reference"
67
+ ? await loadNewsroomReferencePage({ limit: 50, nextToken: tokens.reference }).then(page => ({ issues: projectNewsroomBoard({ references: page.items }), token: page.nextToken }))
68
+ : await loadNewsroomAssignmentPage({ limit: 50, nextToken: tokens.assignment }).then(page => ({ issues: projectNewsroomBoard({ assignments: page.items }), token: page.nextToken }));
69
+ if (generation.current !== request) return;
70
+ setIssues(current => [...new Map([...current, ...added.issues].map(issue => [issue.id, issue])).values()]);
71
+ setTokens(current => ({ ...current, [kind]: added.token }));
72
+ } catch (reason) {
73
+ if (generation.current === request) setError(reason instanceof Error ? reason.message : "Could not load more records.");
74
+ } finally { if (generation.current === request) { setLoading(false); busy.current = false; } }
75
+ }
76
+ const config = useMemo(() => newsroomBoardConfig(issues), [issues]);
77
+ const issue = issues.find(item => item.id === selected);
78
+ if (!allowed) return <NewsDeskAccessGate shell={session?.shell ?? null} />;
79
+ return <NewsroomOpsShell activeTab="work" appTitle={SITE_BRAND.appTitle} backLabel={SITE_BRAND.backToHomeLabel} pageTitle="Board">
80
+ <div className="organizer-native-board kb-theme-organizer" data-color-mode={theme}>
81
+ <div className="organizer-board-toolbar">
82
+ <IssueTypeFilter config={config} value={filter} onChange={value => { setFilter(value); setSelected(null); }} name="Record type" />
83
+ <div role="group" aria-label="Record presentation"><button type="button" aria-pressed={view === "board"} onClick={() => setView("board")}>Board</button><button type="button" aria-pressed={view === "list"} onClick={() => setView("list")}>List</button><button type="button" disabled={loading} onClick={() => setRevision(current => current + 1)}>Refresh records</button></div>
84
+ </div>
85
+ <p className="organizer-board-note">Native CMS records and statuses. Open a record to use its existing editor or workflow controls. Story linking is not configured.</p>
86
+ {error && <NewsroomOpsStatusBanner tone="error">{error}</NewsroomOpsStatusBanner>}
87
+ <p role="status" className="organizer-board-note">{loading ? "Loading records…" : `${issues.length} records loaded. References and assignments load in pages.`}</p>
88
+ <div className="organizer-board-body" data-detail-open={Boolean(issue)}>
89
+ <IssueCollection issues={issues} config={config} query={{ type: issueTypeFromFilter(filter) }} view={view}
90
+ motion={lowMotion ? STATIC_MOTION : undefined}
91
+ columnStateKey={`papyrus.cms.columns.v1.${SITE_BRAND.id}`} initialScroll="start"
92
+ selectedIssueId={selected} detailOpen={Boolean(issue)} onSelectIssue={item => setSelected(item.id)} ariaLabel="Newsroom records"
93
+ emptyMessage={loading ? "Loading records…" : error ? "Records could not be loaded." : "No records in this selection."} />
94
+ {issue && <IssueDetailPanel issue={issue} onClose={() => setSelected(null)} fields={[{ label: "CMS record ID", value: issue.nativeId }, { label: "Status", value: issue.nativeStatus }]}>
95
+ <Link href={getNewsroomNavHref(issue.href)}>Open {issue.type} workspace</Link>
96
+ </IssueDetailPanel>}
97
+ </div>
98
+ <div className="organizer-board-pages">{tokens.reference && <button disabled={loading} type="button" onClick={() => void loadMore("reference")}>Load more references</button>}{tokens.assignment && <button disabled={loading} type="button" onClick={() => void loadMore("assignment")}>Load more assignments</button>}</div>
99
+ </div>
100
+ </NewsroomOpsShell>;
101
+ }
@@ -0,0 +1,93 @@
1
+ Copyright 2017 The Playfair Display Project Authors (https://github.com/clauseggers/Playfair-Display), with Reserved Font Name "Playfair Display"
2
+
3
+ This Font Software is licensed under the SIL Open Font License, Version 1.1.
4
+ This license is copied below, and is also available with a FAQ at:
5
+ http://scripts.sil.org/OFL
6
+
7
+
8
+ -----------------------------------------------------------
9
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
10
+ -----------------------------------------------------------
11
+
12
+ PREAMBLE
13
+ The goals of the Open Font License (OFL) are to stimulate worldwide
14
+ development of collaborative font projects, to support the font creation
15
+ efforts of academic and linguistic communities, and to provide a free and
16
+ open framework in which fonts may be shared and improved in partnership
17
+ with others.
18
+
19
+ The OFL allows the licensed fonts to be used, studied, modified and
20
+ redistributed freely as long as they are not sold by themselves. The
21
+ fonts, including any derivative works, can be bundled, embedded,
22
+ redistributed and/or sold with any software provided that any reserved
23
+ names are not used by derivative works. The fonts and derivatives,
24
+ however, cannot be released under any other type of license. The
25
+ requirement for fonts to remain under this license does not apply
26
+ to any document created using the fonts or their derivatives.
27
+
28
+ DEFINITIONS
29
+ "Font Software" refers to the set of files released by the Copyright
30
+ Holder(s) under this license and clearly marked as such. This may
31
+ include source files, build scripts and documentation.
32
+
33
+ "Reserved Font Name" refers to any names specified as such after the
34
+ copyright statement(s).
35
+
36
+ "Original Version" refers to the collection of Font Software components as
37
+ distributed by the Copyright Holder(s).
38
+
39
+ "Modified Version" refers to any derivative made by adding to, deleting,
40
+ or substituting -- in part or in whole -- any of the components of the
41
+ Original Version, by changing formats or by porting the Font Software to a
42
+ new environment.
43
+
44
+ "Author" refers to any designer, engineer, programmer, technical
45
+ writer or other person who contributed to the Font Software.
46
+
47
+ PERMISSION & CONDITIONS
48
+ Permission is hereby granted, free of charge, to any person obtaining
49
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
50
+ redistribute, and sell modified and unmodified copies of the Font
51
+ Software, subject to the following conditions:
52
+
53
+ 1) Neither the Font Software nor any of its individual components,
54
+ in Original or Modified Versions, may be sold by itself.
55
+
56
+ 2) Original or Modified Versions of the Font Software may be bundled,
57
+ redistributed and/or sold with any software, provided that each copy
58
+ contains the above copyright notice and this license. These can be
59
+ included either as stand-alone text files, human-readable headers or
60
+ in the appropriate machine-readable metadata fields within text or
61
+ binary files as long as those fields can be easily viewed by the user.
62
+
63
+ 3) No Modified Version of the Font Software may use the Reserved Font
64
+ Name(s) unless explicit written permission is granted by the corresponding
65
+ Copyright Holder. This restriction only applies to the primary font name as
66
+ presented to the users.
67
+
68
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
69
+ Software shall not be used to promote, endorse or advertise any
70
+ Modified Version, except to acknowledge the contribution(s) of the
71
+ Copyright Holder(s) and the Author(s) or with their explicit written
72
+ permission.
73
+
74
+ 5) The Font Software, modified or unmodified, in part or in whole,
75
+ must be distributed entirely under this license, and must not be
76
+ distributed under any other license. The requirement for fonts to
77
+ remain under this license does not apply to any document created
78
+ using the Font Software.
79
+
80
+ TERMINATION
81
+ This license becomes null and void if any of the above conditions are
82
+ not met.
83
+
84
+ DISCLAIMER
85
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
86
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
87
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
88
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
89
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
90
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
91
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
92
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
93
+ OTHER DEALINGS IN THE FONT SOFTWARE.
@@ -0,0 +1,93 @@
1
+ Copyright 2020 The Plus Jakarta Sans Project Authors (https://github.com/tokotype/PlusJakartaSans)
2
+
3
+ This Font Software is licensed under the SIL Open Font License, Version 1.1.
4
+ This license is copied below, and is also available with a FAQ at:
5
+ http://scripts.sil.org/OFL
6
+
7
+
8
+ -----------------------------------------------------------
9
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
10
+ -----------------------------------------------------------
11
+
12
+ PREAMBLE
13
+ The goals of the Open Font License (OFL) are to stimulate worldwide
14
+ development of collaborative font projects, to support the font creation
15
+ efforts of academic and linguistic communities, and to provide a free and
16
+ open framework in which fonts may be shared and improved in partnership
17
+ with others.
18
+
19
+ The OFL allows the licensed fonts to be used, studied, modified and
20
+ redistributed freely as long as they are not sold by themselves. The
21
+ fonts, including any derivative works, can be bundled, embedded,
22
+ redistributed and/or sold with any software provided that any reserved
23
+ names are not used by derivative works. The fonts and derivatives,
24
+ however, cannot be released under any other type of license. The
25
+ requirement for fonts to remain under this license does not apply
26
+ to any document created using the fonts or their derivatives.
27
+
28
+ DEFINITIONS
29
+ "Font Software" refers to the set of files released by the Copyright
30
+ Holder(s) under this license and clearly marked as such. This may
31
+ include source files, build scripts and documentation.
32
+
33
+ "Reserved Font Name" refers to any names specified as such after the
34
+ copyright statement(s).
35
+
36
+ "Original Version" refers to the collection of Font Software components as
37
+ distributed by the Copyright Holder(s).
38
+
39
+ "Modified Version" refers to any derivative made by adding to, deleting,
40
+ or substituting -- in part or in whole -- any of the components of the
41
+ Original Version, by changing formats or by porting the Font Software to a
42
+ new environment.
43
+
44
+ "Author" refers to any designer, engineer, programmer, technical
45
+ writer or other person who contributed to the Font Software.
46
+
47
+ PERMISSION & CONDITIONS
48
+ Permission is hereby granted, free of charge, to any person obtaining
49
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
50
+ redistribute, and sell modified and unmodified copies of the Font
51
+ Software, subject to the following conditions:
52
+
53
+ 1) Neither the Font Software nor any of its individual components,
54
+ in Original or Modified Versions, may be sold by itself.
55
+
56
+ 2) Original or Modified Versions of the Font Software may be bundled,
57
+ redistributed and/or sold with any software, provided that each copy
58
+ contains the above copyright notice and this license. These can be
59
+ included either as stand-alone text files, human-readable headers or
60
+ in the appropriate machine-readable metadata fields within text or
61
+ binary files as long as those fields can be easily viewed by the user.
62
+
63
+ 3) No Modified Version of the Font Software may use the Reserved Font
64
+ Name(s) unless explicit written permission is granted by the corresponding
65
+ Copyright Holder. This restriction only applies to the primary font name as
66
+ presented to the users.
67
+
68
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
69
+ Software shall not be used to promote, endorse or advertise any
70
+ Modified Version, except to acknowledge the contribution(s) of the
71
+ Copyright Holder(s) and the Author(s) or with their explicit written
72
+ permission.
73
+
74
+ 5) The Font Software, modified or unmodified, in part or in whole,
75
+ must be distributed entirely under this license, and must not be
76
+ distributed under any other license. The requirement for fonts to
77
+ remain under this license does not apply to any document created
78
+ using the Font Software.
79
+
80
+ TERMINATION
81
+ This license becomes null and void if any of the above conditions are
82
+ not met.
83
+
84
+ DISCLAIMER
85
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
86
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
87
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
88
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
89
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
90
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
91
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
92
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
93
+ OTHER DEALINGS IN THE FONT SOFTWARE.
@@ -34,6 +34,8 @@ import {
34
34
  NEWSROOM_SIDEBAR_NAV_INACTIVE,
35
35
  } from "../lib/newsroom-list-selection";
36
36
  import { cn } from "../lib/utils";
37
+ import { SITE_BRAND } from "../lib/site-brand";
38
+ import { NewsroomOrganizerShell } from "./newsroom-organizer-shell";
37
39
 
38
40
  export type NewsroomNavCount = {
39
41
  count: number | null;
@@ -41,7 +43,7 @@ export type NewsroomNavCount = {
41
43
  visible?: boolean;
42
44
  };
43
45
 
44
- type NewsroomOpsShellProps = {
46
+ export type NewsroomOpsShellProps = {
45
47
  activeTab: NewsroomNavTabId | string;
46
48
  appTitle: string;
47
49
  backHref?: string;
@@ -136,6 +138,10 @@ export function NewsroomOpsShell({
136
138
  const resolvedActiveTab = activeTab === "desks" ? "topics" : activeTab;
137
139
  const mobilePrimary = useMemo(() => NEWSROOM_MOBILE_PRIMARY_NAV, []);
138
140
 
141
+ if (SITE_BRAND.newsroomLayout === "organizer") return <NewsroomOrganizerShell activeTab={activeTab} appTitle={appTitle}
142
+ backHref={backHref} backLabel={backLabel} demo={demo} headerActions={headerActions} pageTitle={pageTitle}
143
+ showNavigation={showNavigation} tabCounts={tabCounts}>{children}</NewsroomOrganizerShell>;
144
+
139
145
  return (
140
146
  <div
141
147
  className="flex h-dvh max-h-dvh flex-col overflow-hidden bg-background text-foreground"
@@ -0,0 +1,130 @@
1
+ "use client";
2
+
3
+ import { useEffect, useId, useState } from "react";
4
+ import Link from "next/link";
5
+ import { usePathname } from "next/navigation";
6
+ import { BookOpen, ClipboardList, LayoutDashboard, Menu, MessagesSquare, PanelLeftClose, PanelLeftOpen, Settings, UserRound, LogIn, LogOut } from "lucide-react";
7
+ import { ORGANIZER_NAV_GROUPS, ORGANIZER_PRIMARY_NAV } from "../lib/newsroom-organizer-nav";
8
+ import { browserPathToInternalNewsroomPath } from "../lib/newsroom-base-path";
9
+ import { getNewsroomNavHref } from "../lib/newsroom-nav";
10
+ import { SITE_BRAND } from "../lib/site-brand";
11
+ import { useOptionalNewsDeskClient } from "./news-desk-client-provider";
12
+ import { ReaderAuthControl } from "./reader-auth-control";
13
+ import { Sheet, SheetContent, SheetHeader, SheetTitle, SheetDescription, SheetTrigger } from "./ui/sheet";
14
+ import { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuSeparator } from "./ui/dropdown-menu";
15
+ import type { NewsroomOpsShellProps } from "./newsroom-ops-shell";
16
+ import "./newsroom-organizer.css";
17
+
18
+ const ICONS = { overview: LayoutDashboard, board: ClipboardList, references: BookOpen, messages: MessagesSquare };
19
+
20
+ /** Navigation is a presentation layer; existing route and server authorization still own access. */
21
+ function Navigation({ activePath, demo, admin, surface, onNavigate }: { activePath: string; demo: boolean; admin: boolean; surface: string; onNavigate?: () => void }) {
22
+ const id = useId();
23
+ const all = ORGANIZER_NAV_GROUPS.flatMap(group => group.items);
24
+ const active = all.filter(item => activePath === item.path || (item.path !== "/newsroom" && activePath.startsWith(item.path + "/"))).sort((a, b) => b.path.length - a.path.length)[0]?.key;
25
+ return <nav className="organizer-destinations" aria-label={surface === "sidebar" ? "Newsroom" : "All workspaces"}>
26
+ {ORGANIZER_NAV_GROUPS.map((group, index) => <section key={group.title} aria-labelledby={`${id}-${index}`}>
27
+ <h3 id={`${id}-${index}`}>{group.title}</h3>
28
+ {group.items.filter(item => item.access !== "admin" || admin).map(item => <Link key={item.key}
29
+ href={getNewsroomNavHref(item.path, demo)} onClick={onNavigate} aria-label={item.label}
30
+ aria-current={active === item.key ? "page" : undefined} aria-describedby={`${id}-${item.key}`}
31
+ data-news-desk-tab={item.key}>
32
+ <strong>{item.label}</strong><small id={`${id}-${item.key}`}>{item.description}</small>
33
+ </Link>)}
34
+ </section>)}
35
+ </nav>;
36
+ }
37
+
38
+ function Account({ placement }: { placement: "sidebar" | "header" }) {
39
+ const session = useOptionalNewsDeskClient();
40
+ const auth = session?.shell.auth ?? { status: "loading" as const, label: "Checking sign-in" };
41
+ const [open, setOpen] = useState(false);
42
+ useEffect(() => {
43
+ const media = matchMedia("(max-width: 900px)");
44
+ const close = () => setOpen(false);
45
+ media.addEventListener("change", close);
46
+ return () => media.removeEventListener("change", close);
47
+ }, []);
48
+ return <DropdownMenu open={open} onOpenChange={setOpen}>
49
+ <DropdownMenuTrigger className={`organizer-account organizer-account-${placement}`} aria-label="Account menu" title="Account menu">
50
+ <UserRound size={18} aria-hidden="true" /><span><strong>{auth.label}</strong><small>{auth.status === "signedIn" ? "Account & preferences" : auth.status === "signedOut" ? "Not signed in" : "Checking session"}</small></span>
51
+ </DropdownMenuTrigger>
52
+ <DropdownMenuContent className="organizer-account-popup" side={placement === "sidebar" ? "top" : "bottom"} align="end">
53
+ <DropdownMenuGroup>
54
+ <DropdownMenuLabel>{auth.label}</DropdownMenuLabel><DropdownMenuSeparator />
55
+ <DropdownMenuItem render={<Link href="/settings" />}><Settings aria-hidden="true" />Settings</DropdownMenuItem>
56
+ <ReaderAuthControl authState={auth} renderAction={({ disabled, onClick, signedIn }) => <DropdownMenuItem disabled={disabled} closeOnClick={false} onClick={onClick}>
57
+ {signedIn ? <LogOut aria-hidden="true" /> : <LogIn aria-hidden="true" />}{signedIn ? "Sign out" : "Sign in"}
58
+ </DropdownMenuItem>} />
59
+ </DropdownMenuGroup>
60
+ </DropdownMenuContent>
61
+ </DropdownMenu>;
62
+ }
63
+
64
+ export function NewsroomOrganizerShell({ activeTab, appTitle, backHref = "/", backLabel, children, demo = false, headerActions, pageTitle, showNavigation = true }: NewsroomOpsShellProps) {
65
+ const pathname = usePathname();
66
+ const session = useOptionalNewsDeskClient();
67
+ const admin = demo || session?.shell.dashboard?.canManageUsers === true;
68
+ const [menuOpen, setMenuOpen] = useState(false);
69
+ const [collapsed, setCollapsed] = useState(false);
70
+ const [loadedPreference, setLoadedPreference] = useState(false);
71
+ const preferenceKey = `papyrus.cms.sidebar.v1.${SITE_BRAND.id}`;
72
+ useEffect(() => {
73
+ try { setCollapsed(localStorage.getItem(preferenceKey) === "true"); } catch { /* Optional browser preference. */ }
74
+ setLoadedPreference(true);
75
+ }, [preferenceKey]);
76
+ useEffect(() => { if (loadedPreference) try { localStorage.setItem(preferenceKey, String(collapsed)); } catch { /* Controls still work without storage. */ } }, [collapsed, loadedPreference, preferenceKey]);
77
+ useEffect(() => { setMenuOpen(false); }, [pathname]);
78
+ useEffect(() => {
79
+ const media = matchMedia("(max-width: 900px)");
80
+ let previousFocus: Element | null = null;
81
+ let frame = 0;
82
+ const remember = () => { if (document.activeElement !== document.body) previousFocus = document.activeElement; };
83
+ const change = () => {
84
+ const active = document.activeElement === document.body ? previousFocus : document.activeElement;
85
+ if (!(active instanceof HTMLElement)) return;
86
+ if (!media.matches) setMenuOpen(false);
87
+ const selector = active.closest(".organizer-account, .organizer-account-popup") ? ".organizer-account"
88
+ : media.matches && active.closest(".organizer-sidebar, .organizer-toggle") ? ".organizer-more"
89
+ : !media.matches && active.closest(".organizer-bottom-nav, .organizer-menu") ? ".organizer-toggle" : null;
90
+ if (!selector) return;
91
+ cancelAnimationFrame(frame);
92
+ frame = requestAnimationFrame(() => {
93
+ if (document.activeElement === active || document.activeElement === document.body || !(document.activeElement as HTMLElement)?.getClientRects().length)
94
+ Array.from(document.querySelectorAll<HTMLElement>(selector)).find(element => element.getClientRects().length)?.focus();
95
+ });
96
+ };
97
+ document.addEventListener("focusin", remember);
98
+ media.addEventListener("change", change);
99
+ return () => { document.removeEventListener("focusin", remember); media.removeEventListener("change", change); cancelAnimationFrame(frame); };
100
+ }, []);
101
+ const activePath = browserPathToInternalNewsroomPath(pathname ?? "/newsroom");
102
+ return <div className="newsroom-organizer" data-news-desk data-newsroom-ops-shell="true" data-newsroom-chrome="organizer" data-sidebar-collapsed={collapsed || !showNavigation ? "true" : "false"}>
103
+ {showNavigation && <aside className="organizer-sidebar" hidden={collapsed} id="organizer-sidebar">
104
+ <Link className="organizer-brand" href={getNewsroomNavHref("/newsroom", demo)}>{appTitle}<small>The newsroom</small></Link>
105
+ <Navigation activePath={activePath} demo={demo} admin={admin} surface="sidebar" />
106
+ <Account placement="sidebar" />
107
+ </aside>}
108
+ <div className="organizer-workspace">
109
+ <header className="organizer-topbar" data-newsroom-ops-topbar>
110
+ {showNavigation && <button type="button" className="organizer-toggle" title={collapsed ? "Expand sidebar" : "Collapse sidebar"}
111
+ aria-label={collapsed ? "Expand sidebar" : "Collapse sidebar"} aria-expanded={!collapsed} aria-controls="organizer-sidebar" onClick={() => setCollapsed(value => !value)}>
112
+ {collapsed ? <PanelLeftOpen size={16} aria-hidden="true" /> : <PanelLeftClose size={16} aria-hidden="true" />}<span>{collapsed ? "Expand sidebar" : "Collapse sidebar"}</span>
113
+ </button>}
114
+ <Link className="organizer-masthead" href={backHref} title={backLabel}>{appTitle}</Link>
115
+ <h1 data-newsroom-ops-title>{pageTitle}</h1><div className="organizer-header-actions">{headerActions}</div><Account placement="header" />
116
+ </header>
117
+ <main className="organizer-main">{demo && <p className="organizer-demo-notice">Demo workspace · synthetic examples</p>}{children}</main>
118
+ </div>
119
+ {showNavigation && <nav className="organizer-bottom-nav" aria-label="Primary newsroom navigation"><ul>
120
+ {ORGANIZER_PRIMARY_NAV.map(item => { const Icon = ICONS[item.key as keyof typeof ICONS]; return <li key={item.key}><Link
121
+ href={getNewsroomNavHref(item.path, demo)} title={item.description} aria-label={item.label} aria-current={activeTab === item.key || activeTab === "work" && item.key === "board" ? "page" : undefined}>
122
+ <Icon size={18} aria-hidden="true" /><span>{item.label}</span></Link></li>; })}
123
+ <li><Sheet open={menuOpen} onOpenChange={setMenuOpen}><SheetTrigger className="organizer-more" aria-label="More"><Menu size={18} aria-hidden="true" /><span>More</span></SheetTrigger>
124
+ <SheetContent side="bottom" className="organizer-menu"><SheetHeader><SheetTitle>Newsroom</SheetTitle><SheetDescription>Workspaces and administration</SheetDescription></SheetHeader>
125
+ <Navigation activePath={activePath} demo={demo} admin={admin} surface="menu" onNavigate={() => setMenuOpen(false)} />
126
+ </SheetContent>
127
+ </Sheet></li>
128
+ </ul></nav>}
129
+ </div>;
130
+ }
@@ -0,0 +1,59 @@
1
+ @font-face{font-family:Newsroom Display;src:url('./newsroom-fonts/playfair-display-700.ttf') format('truetype');font-weight:700;font-display:swap}
2
+ @font-face{font-family:Newsroom Display;src:url('./newsroom-fonts/playfair-display-900.ttf') format('truetype');font-weight:900;font-display:swap}
3
+ @font-face{font-family:Newsroom UI;src:url('./newsroom-fonts/plus-jakarta-sans-400.ttf') format('truetype');font-weight:400;font-display:swap}
4
+ @font-face{font-family:Newsroom UI;src:url('./newsroom-fonts/plus-jakarta-sans-600.ttf') format('truetype');font-weight:600;font-display:swap}
5
+ .newsroom-organizer,.organizer-menu,.organizer-account-popup{--org-paper:var(--background);--org-ink:var(--foreground);--org-line:var(--border);--org-muted:var(--muted-foreground);font-family:Newsroom UI,system-ui,sans-serif;color:var(--org-ink);background:var(--org-paper)}
6
+ .newsroom-organizer{display:grid;grid-template-columns:264px minmax(0,1fr);height:100dvh;max-height:100dvh;overflow:clip;font-size:14px}
7
+ .newsroom-organizer[data-sidebar-collapsed=true]{grid-template-columns:minmax(0,1fr)}
8
+ .newsroom-organizer h1,.newsroom-organizer h2,.newsroom-organizer h3{font-family:Newsroom Display,Georgia,serif}
9
+ .organizer-sidebar{min-height:0;display:flex;flex-direction:column;border-right:1px solid var(--org-line);padding:16px;gap:16px;overflow:hidden}
10
+ .organizer-sidebar[hidden]{display:none}.organizer-brand{font:900 40px/1.1 Newsroom Display,Georgia,serif;padding-bottom:20px;border-bottom:3px double var(--org-ink)}
11
+ .organizer-brand small{display:block;font:400 10px Newsroom UI,system-ui;letter-spacing:.3em;text-transform:uppercase;margin-top:12px}
12
+ .organizer-destinations{min-height:0;overflow:auto;overscroll-behavior:contain;flex:1;padding-right:1px}
13
+ .organizer-destinations section+section{margin-top:24px}.organizer-destinations h3{font:600 10px Newsroom UI,system-ui;letter-spacing:.07em;text-transform:uppercase;color:var(--org-muted);margin:16px 0 8px}
14
+ .organizer-destinations a{display:flex;flex-direction:column;align-items:start;gap:6px;padding:14px 8px;border-bottom:1px solid var(--org-line);color:var(--org-muted);text-decoration:none;min-height:44px}
15
+ .organizer-destinations a strong{font:700 16px Newsroom Display,Georgia,serif}.organizer-destinations a small{font:400 11px/1.5 Newsroom UI,system-ui;white-space:normal;overflow-wrap:anywhere}
16
+ .organizer-destinations a[aria-current=page]{border-bottom:2px solid var(--org-ink);color:var(--org-ink)}
17
+ .newsroom-organizer :is(a,button):focus-visible,.organizer-menu :is(a,button):focus-visible{outline:2px solid currentColor;outline-offset:-3px}
18
+ .organizer-workspace{display:flex;flex-direction:column;min-height:0;min-width:0;overflow:hidden;padding:0 16px}
19
+ .organizer-topbar{height:57px;min-height:57px;display:flex;align-items:center;gap:16px;border-bottom:1px solid var(--org-ink)}
20
+ .organizer-masthead{font:900 28px Newsroom Display,Georgia,serif;white-space:nowrap;max-width:30vw;overflow:hidden;text-overflow:ellipsis}
21
+ .organizer-topbar h1{font:400 12px Newsroom UI,system-ui;flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:0}
22
+ .organizer-toggle{display:flex;align-items:center;gap:8px;min-height:36px;padding:8px 12px;border:1px solid var(--org-line);font:400 11px Newsroom UI,system-ui;flex-shrink:0}
23
+ .organizer-header-actions{display:flex;align-items:center;gap:8px;min-width:0;max-width:45%;overflow-x:auto}
24
+ .organizer-main{min-width:0;min-height:0;overflow:auto;overscroll-behavior:contain;flex:1;padding:16px 0}
25
+ .organizer-main>[data-category-steering]{min-height:0}.organizer-demo-notice{font-size:11px;color:var(--org-muted);margin-bottom:12px}
26
+ .organizer-account{display:flex;align-items:center;gap:10px;min-height:44px;flex-shrink:0;border:1px solid var(--org-line);padding:8px;text-align:left;border-radius:3px}
27
+ .organizer-account span{min-width:0}.organizer-account strong{display:block;font:600 11px Newsroom UI,system-ui;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.organizer-account small{display:block;font-size:9px;color:var(--org-muted);margin-top:2px}
28
+ .organizer-account-header{display:none;padding:8px;min-width:36px;min-height:36px}.organizer-account-header span{display:none}
29
+ .newsroom-organizer[data-sidebar-collapsed=true] .organizer-account-header{display:flex}
30
+ .organizer-account-popup{min-width:250px;max-width:calc(100vw - 32px);border:1px solid var(--org-line);padding:6px;border-radius:4px}
31
+ .organizer-account-popup [role=menuitem]{min-height:40px;font-size:12px}.organizer-account-popup .reader-auth{display:contents}.organizer-account-popup .reader-auth__error{display:block;white-space:normal;font-size:11px;padding:8px}
32
+ .organizer-bottom-nav{display:none}
33
+ .organizer-main:has(.organizer-native-board){display:flex;overflow:hidden}
34
+ .organizer-native-board.kb-theme-organizer{--font-body:Newsroom UI,system-ui,sans-serif;--kb-label-font:Newsroom UI,system-ui,sans-serif;--kb-display-font:Newsroom Display,Georgia,serif;display:flex;flex-direction:column;flex:1;min-height:0;min-width:0;gap:12px}
35
+ .organizer-board-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;min-width:0;flex-wrap:wrap}
36
+ .organizer-board-toolbar [role=group],.organizer-board-pages{display:flex;gap:8px;flex-wrap:wrap}
37
+ .organizer-board-toolbar button,.organizer-board-pages button{min-height:44px;padding:8px 12px;border:1px solid var(--org-line)}
38
+ .organizer-board-toolbar button[aria-pressed=true]{background:var(--organizer-ink);color:var(--organizer-paper)}
39
+ .organizer-board-note{font-size:11px;line-height:1.5;margin:0;color:var(--organizer-muted)}
40
+ .organizer-board-body{position:relative;display:grid;grid-template-columns:minmax(0,1fr);flex:1;min-width:0;min-height:0;gap:16px}
41
+ .organizer-board-body[data-detail-open=true]{grid-template-columns:minmax(0,1fr) minmax(280px,360px)}
42
+ .organizer-board-body>.kb-issue-collection{height:100%;min-height:0;overflow:auto}
43
+ .organizer-board-body>.kb-issue-detail{overflow:auto;min-height:0}
44
+ .organizer-board-body .kb-issue-detail a{display:block;min-height:44px;text-decoration:underline;padding:12px 0}
45
+ .organizer-menu{height:min(85dvh,760px);max-height:85dvh;display:flex;flex-direction:column;padding:16px;border-radius:24px 24px 0 0;gap:20px}
46
+ .organizer-menu .organizer-destinations{overflow-y:auto}.organizer-menu .organizer-destinations section{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.organizer-menu .organizer-destinations h3{grid-column:1/-1;font-size:12px;text-transform:none;margin:0 0 4px}
47
+ .organizer-menu .organizer-destinations a{border:1px solid var(--org-line);padding:12px;color:var(--org-ink)}
48
+ @media(max-width:900px){
49
+ .newsroom-organizer,.newsroom-organizer[data-sidebar-collapsed=true]{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr) auto}
50
+ .organizer-sidebar,.organizer-toggle{display:none}.organizer-workspace{padding:0 16px}.organizer-topbar{gap:8px;height:55px;min-height:55px}
51
+ .organizer-masthead{font-size:24px;max-width:36vw}.organizer-topbar h1{font-size:10px}.organizer-account-header{display:flex}.organizer-header-actions{gap:4px;max-width:35%}
52
+ .organizer-bottom-nav{display:block;border-top:1px solid var(--org-ink);background:var(--org-paper);padding:4px 8px max(4px,env(safe-area-inset-bottom))}
53
+ .organizer-bottom-nav ul{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:4px;list-style:none;margin:0;padding:0}
54
+ .organizer-bottom-nav :is(a,button){display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;min-height:54px;width:100%;font:400 10px Newsroom UI,system-ui;padding:6px 0;text-decoration:none;border-radius:8px}
55
+ .organizer-bottom-nav a[aria-current=page]{background:var(--muted);font-weight:600}
56
+ .organizer-board-body[data-detail-open=true]{grid-template-columns:minmax(0,1fr)}
57
+ .organizer-board-body>.kb-issue-detail{position:absolute;inset:0;z-index:2;overflow:auto}
58
+ }
59
+ @media(prefers-reduced-motion:reduce){.newsroom-organizer *, .organizer-menu *{scroll-behavior:auto;animation-duration:0s!important;transition-duration:0s!important}}
@@ -2,7 +2,7 @@
2
2
 
3
3
  import { signInWithRedirect, signOut } from "aws-amplify/auth";
4
4
  import { Hub } from "aws-amplify/utils";
5
- import { useCallback, useEffect, useState } from "react";
5
+ import { useCallback, useEffect, useState, type ReactNode } from "react";
6
6
  import { configureAmplifyClient } from "./amplify-client-provider";
7
7
  import { loadReaderSessionSnapshot, type ReaderAuthSnapshot } from "./reader-auth-state";
8
8
 
@@ -12,6 +12,7 @@ type ReaderAuthControlProps = {
12
12
  postAuthPath?: string;
13
13
  showIdentity?: boolean;
14
14
  authState?: ReaderAuthSnapshot;
15
+ renderAction?: (action: { disabled: boolean; onClick: () => void; signedIn: boolean }) => ReactNode;
15
16
  };
16
17
 
17
18
  const POST_AUTH_PATH_KEY = "papyrus:reader-auth:post-auth-path";
@@ -22,6 +23,7 @@ export function ReaderAuthControl({
22
23
  postAuthPath,
23
24
  showIdentity = false,
24
25
  authState: externalAuthState,
26
+ renderAction,
25
27
  }: ReaderAuthControlProps) {
26
28
  const [authState, setAuthState] = useState<ReaderAuthSnapshot>(externalAuthState ?? { status: "loading", label: "Checking sign-in" });
27
29
  const [busy, setBusy] = useState(false);
@@ -124,19 +126,20 @@ export function ReaderAuthControl({
124
126
 
125
127
  const signedIn = authState.status === "signedIn";
126
128
  const actionLabel = signedIn ? "LOGOUT" : "LOGIN";
129
+ const Container = renderAction ? "div" : "span";
127
130
  return (
128
- <span className={className ? `reader-auth ${className}` : "reader-auth"} aria-live="polite" data-footer-utility={dataFooterUtility}>
131
+ <Container className={className ? `reader-auth ${className}` : "reader-auth"} aria-live="polite" data-footer-utility={dataFooterUtility}>
129
132
  {signedIn && showIdentity ? <span className="reader-auth__identity">{authState.label}</span> : null}
130
133
  {error ? <span className="reader-auth__error">{error}</span> : null}
131
- <button
134
+ {renderAction ? renderAction({ disabled: authState.status === "loading" || busy, onClick: signedIn ? signOutCurrentUser : signIn, signedIn }) : <button
132
135
  className="reader-auth__button"
133
136
  disabled={authState.status === "loading" || busy}
134
137
  onClick={signedIn ? signOutCurrentUser : signIn}
135
138
  type="button"
136
139
  >
137
140
  {actionLabel}
138
- </button>
139
- </span>
141
+ </button>}
142
+ </Container>
140
143
  );
141
144
  }
142
145
 
@@ -0,0 +1,60 @@
1
+ import type { KanbanConfig, KanbanIssue } from "@kanbus/ui";
2
+ import type { AssignmentRecord, ReferenceRecord } from "./category-repository";
3
+ import type { NewsroomArticleRow } from "./newsroom-articles";
4
+
5
+ export type NativeBoardKind = "article" | "reference" | "assignment";
6
+ export interface NativeBoardIssue extends KanbanIssue {
7
+ type: NativeBoardKind;
8
+ nativeId: string;
9
+ nativeStatus: string;
10
+ href: string;
11
+ }
12
+
13
+ /** Native records keep their own identity, status and mutation authority. No Story linkage is inferred. */
14
+ export function projectNewsroomBoard(records: {
15
+ articles?: readonly NewsroomArticleRow[];
16
+ references?: readonly ReferenceRecord[];
17
+ assignments?: readonly AssignmentRecord[];
18
+ }): NativeBoardIssue[] {
19
+ return [
20
+ ...(records.articles ?? []).map(row => ({
21
+ id: `article:${row.id}`, nativeId: row.id, type: "article" as const,
22
+ title: row.title, nativeStatus: row.status, status: `article/${row.status}`,
23
+ priority: 2, description: row.pending ? "Published copy has pending draft changes." : undefined,
24
+ updated_at: row.updatedAt, href: `/newsroom/articles/${encodeURIComponent(row.id)}`,
25
+ })),
26
+ ...(records.references ?? []).filter(row => !row.versionState || row.versionState === "current").map(row => ({
27
+ id: `reference:${row.id}`, nativeId: row.id, type: "reference" as const,
28
+ title: row.title || row.externalItemId || row.id,
29
+ nativeStatus: row.curationStatus || "pending", status: `reference/${row.curationStatus || "pending"}`,
30
+ priority: 2, description: row.curationStatusReason || undefined,
31
+ updated_at: row.updatedAt || row.importedAt || undefined,
32
+ href: `/newsroom/references/${encodeURIComponent(row.lineageId || row.id)}`,
33
+ })),
34
+ ...(records.assignments ?? []).map(row => ({
35
+ id: `assignment:${row.id}`, nativeId: row.id, type: "assignment" as const,
36
+ title: row.title, nativeStatus: row.status, status: `assignment/${row.status}`,
37
+ priority: row.priority ?? 2, assignee: row.assigneeId || undefined,
38
+ description: row.summary || row.brief || undefined,
39
+ created_at: row.createdAt, updated_at: row.updatedAt,
40
+ href: `/newsroom/assignments/${encodeURIComponent(row.id)}`,
41
+ })),
42
+ ];
43
+ }
44
+
45
+ /** Unknown native statuses remain visible instead of being translated into invented stages. */
46
+ export function newsroomBoardConfig(issues: readonly NativeBoardIssue[]): KanbanConfig {
47
+ const keys = [...new Set(issues.map(issue => issue.status))];
48
+ return {
49
+ hierarchy: [], types: ["article", "reference", "assignment"],
50
+ statuses: keys.map(key => ({ key, name: key.replace("/", " · "), category: "native" })),
51
+ categories: [{ name: "native" }], priorities: {}, type_colors: {},
52
+ workflows: Object.fromEntries(["article", "reference", "assignment"].map(kind => [kind,
53
+ Object.fromEntries(keys.filter(key => key.startsWith(`${kind}/`)).map(key => [key, []])),
54
+ ])),
55
+ };
56
+ }
57
+
58
+ export function canReadNewsroomBoard(phase: string | undefined): boolean {
59
+ return phase === "ready";
60
+ }
@@ -0,0 +1,30 @@
1
+ export type OrganizerDestination = {
2
+ key: string; label: string; description: string; path: string;
3
+ access?: "admin"; primary?: boolean; unavailable?: string;
4
+ };
5
+ export const ORGANIZER_NAV_GROUPS: readonly { title: string; items: readonly OrganizerDestination[] }[] = [
6
+ { title: "Editorial work", items: [
7
+ { key: "overview", label: "Overview", description: "See the desk and choose where to begin.", path: "/newsroom", primary: true },
8
+ { key: "board", label: "Board", description: "Follow articles, sources and assignments across their stages.", path: "/newsroom/work", primary: true },
9
+ { key: "articles", label: "Articles", description: "Write, revise and prepare copy for publication.", path: "/newsroom/articles" },
10
+ { key: "assignments", label: "Assignments", description: "Claim work and follow research and reporting progress.", path: "/newsroom/assignments" },
11
+ { key: "messages", label: "Messages", description: "Read and reply to newsroom conversations.", path: "/newsroom/messages", primary: true },
12
+ { key: "insights", label: "Insights", description: "Discuss findings and research threads.", path: "/newsroom/insights" },
13
+ ] },
14
+ { title: "Research & knowledge", items: [
15
+ { key: "references", label: "References", description: "Inspect sources and make editorial inclusion decisions.", path: "/newsroom/references", primary: true },
16
+ { key: "desks", label: "Taxonomy", description: "Maintain topic sets and category versions.", path: "/newsroom/desks" },
17
+ { key: "topics", label: "Topic proposals", description: "Review suggested changes to coverage.", path: "/newsroom/topics" },
18
+ { key: "concepts", label: "Concepts", description: "Explore knowledge entities and relationships.", path: "/newsroom/concepts" },
19
+ { key: "search", label: "Knowledge search", description: "Find evidence across the knowledge base.", path: "/newsroom/search" },
20
+ ] },
21
+ { title: "Administration", items: [
22
+ { key: "policies", label: "Policies", description: "Set publication and category guidance.", path: "/newsroom/administration/policies" },
23
+ { key: "sections", label: "Sections", description: "Organize the publication’s sections.", path: "/newsroom/administration/sections" },
24
+ { key: "procedures", label: "Procedures", description: "Manage procedure definitions and versions.", path: "/newsroom/administration/procedures", access: "admin" },
25
+ { key: "users", label: "Users & identity merging", description: "Review people, roles and identity merges.", path: "/newsroom/administration/users", access: "admin" },
26
+ { key: "administration", label: "Administration", description: "Open the existing CMS settings workspace.", path: "/newsroom/administration" },
27
+ ] },
28
+ ];
29
+ const all = ORGANIZER_NAV_GROUPS.flatMap(group => group.items);
30
+ export const ORGANIZER_PRIMARY_NAV = ["overview", "board", "references", "messages"].map(key => all.find(item => item.key === key)!);
@@ -0,0 +1,20 @@
1
+ import type { NewsDeskTab } from "../components/topic-steering-workspace";
2
+
3
+ /** The organizer restores the existing taxonomy editor; legacy sites retain their aliases. */
4
+ export function resolveNewsDeskTab(
5
+ sectionValue: string | string[] | null | undefined,
6
+ legacyTabValue: string | string[] | null | undefined,
7
+ organizer = false,
8
+ ): NewsDeskTab {
9
+ const section = Array.isArray(sectionValue) ? sectionValue[0] : sectionValue;
10
+ const legacyTab = Array.isArray(legacyTabValue) ? legacyTabValue[0] : legacyTabValue;
11
+ const raw = section ?? (legacyTab === "categories" ? "topics" : legacyTab);
12
+ const value = raw === "users" || raw === "doctrine" ? "administration"
13
+ : raw === "desks" && !organizer ? "topics" : raw;
14
+ switch (value) {
15
+ case "desks": case "administration": case "topics": case "concepts":
16
+ case "references": case "insights": case "messages": case "assignments": case "search":
17
+ return value;
18
+ default: return "overview";
19
+ }
20
+ }
package/lib/site-brand.ts CHANGED
@@ -105,6 +105,8 @@ export type SiteBrand = {
105
105
  /** Public URL prefix for the Pretext reader (home, editions, articles, archive, settings). Default `""`; e.g. `/information`. */
106
106
  readerBasePath?: string;
107
107
  opsChrome: OpsChrome;
108
+ /** Opt-in CMS viewport layout; independent of the public reader renderer/theme. */
109
+ newsroomLayout?: "organizer";
108
110
  corpusKey: string;
109
111
  steeringConfigPath: string;
110
112
  newsroomSectionsConfigPath: string;
@@ -0,0 +1,4 @@
1
+ /** Fixture identity overrides can never replace production authorization. */
2
+ export function testEditorOverrideAllowed(runtime: string | undefined, flag: string | undefined): boolean {
3
+ return runtime === "test" || (runtime === "development" && flag === "true");
4
+ }
package/package.json CHANGED
@@ -86,9 +86,11 @@
86
86
  "./components/newsroom-article-editor": "./components/newsroom-article-editor.tsx",
87
87
  "./components/newsroom-articles-view": "./components/newsroom-articles-view.tsx",
88
88
  "./components/newsroom-assignments-view": "./components/newsroom-assignments-view.tsx",
89
+ "./components/newsroom-board-view": "./components/newsroom-board-view.tsx",
89
90
  "./components/newsroom-client-shell": "./components/newsroom-client-shell.tsx",
90
91
  "./components/newsroom-ops-overview": "./components/newsroom-ops-overview.tsx",
91
92
  "./components/newsroom-ops-shell": "./components/newsroom-ops-shell.tsx",
93
+ "./components/newsroom-organizer-shell": "./components/newsroom-organizer-shell.tsx",
92
94
  "./components/newsroom-references-view": "./components/newsroom-references-view.tsx",
93
95
  "./components/newsroom-topics-view": "./components/newsroom-topics-view.tsx",
94
96
  "./components/papyrus-console-shell": "./components/papyrus-console-shell.tsx",
@@ -173,6 +175,7 @@
173
175
  "./lib/newsroom-articles": "./lib/newsroom-articles.ts",
174
176
  "./lib/newsroom-assignments": "./lib/newsroom-assignments.ts",
175
177
  "./lib/newsroom-base-path": "./lib/newsroom-base-path.ts",
178
+ "./lib/newsroom-board": "./lib/newsroom-board.ts",
176
179
  "./lib/newsroom-card-layout": "./lib/newsroom-card-layout.ts",
177
180
  "./lib/newsroom-category-drilldown": "./lib/newsroom-category-drilldown.ts",
178
181
  "./lib/newsroom-demo-articles": "./lib/newsroom-demo-articles.ts",
@@ -185,7 +188,9 @@
185
188
  "./lib/newsroom-media-backend": "./lib/newsroom-media-backend.ts",
186
189
  "./lib/newsroom-media": "./lib/newsroom-media.ts",
187
190
  "./lib/newsroom-nav": "./lib/newsroom-nav.ts",
191
+ "./lib/newsroom-organizer-nav": "./lib/newsroom-organizer-nav.ts",
188
192
  "./lib/newsroom-references": "./lib/newsroom-references.ts",
193
+ "./lib/newsroom-section-routing": "./lib/newsroom-section-routing.ts",
189
194
  "./lib/newsroom-sections": "./lib/newsroom-sections.ts",
190
195
  "./lib/newsroom-topics": "./lib/newsroom-topics.ts",
191
196
  "./lib/oauth-redirect-priority": "./lib/oauth-redirect-priority.ts",
@@ -226,6 +231,7 @@
226
231
  "./lib/staging-gate": "./lib/staging-gate.ts",
227
232
  "./lib/staging-gated-path": "./lib/staging-gated-path.ts",
228
233
  "./lib/staging-preview-object": "./lib/staging-preview-object.ts",
234
+ "./lib/test-editor-override": "./lib/test-editor-override.ts",
229
235
  "./lib/themed-image": "./lib/themed-image.ts",
230
236
  "./lib/utils": "./lib/utils.ts",
231
237
  "./lib/video-loading": "./lib/video-loading.ts",
@@ -262,6 +268,7 @@
262
268
  "./app/newsroom/layout": "./app/newsroom/layout.tsx",
263
269
  "./app/newsroom/page": "./app/newsroom/page.tsx",
264
270
  "./app/newsroom/sections/[sectionId]/page": "./app/newsroom/sections/[sectionId]/page.tsx",
271
+ "./app/newsroom/work/page": "./app/newsroom/work/page.tsx",
265
272
  "./app/page": "./app/page.tsx",
266
273
  "./app/robots": "./app/robots.ts",
267
274
  "./app/settings/page": "./app/settings/page.tsx"
@@ -311,7 +318,7 @@
311
318
  "optional": true
312
319
  }
313
320
  },
314
- "version": "1.0.0-next.55",
321
+ "version": "1.0.0-next.57",
315
322
  "dependencies": {
316
323
  "@aws-amplify/adapter-nextjs": "^1.7.3",
317
324
  "@aws-sdk/client-cognito-identity-provider": "3.1045.0",
@@ -321,6 +328,7 @@
321
328
  "@aws-sdk/s3-request-presigner": "^3.1045.0",
322
329
  "@base-ui/react": "^1.5.0",
323
330
  "@chenglou/pretext": "^0.0.7",
331
+ "@kanbus/ui": "https://github.com/AnthusAI/Kanbus/releases/download/ui-v0.2.0/kanbus-ui-0.2.0.tgz",
324
332
  "@radix-ui/colors": "3.0.0",
325
333
  "@streamdown/cjk": "^1.0.3",
326
334
  "@streamdown/code": "^1.1.1",
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.0.0-next.55",
2
+ "version": "1.0.0-next.57",
3
3
  "routes": [
4
4
  {
5
5
  "file": "app/%5F_preview/[[...path]]/route.ts",
@@ -193,6 +193,14 @@
193
193
  "dynamic": "\"force-dynamic\""
194
194
  }
195
195
  },
196
+ {
197
+ "file": "app/newsroom/work/page.tsx",
198
+ "hasDefault": true,
199
+ "exports": [],
200
+ "config": {
201
+ "dynamic": "\"force-dynamic\""
202
+ }
203
+ },
196
204
  {
197
205
  "file": "app/page.tsx",
198
206
  "reader": true,