@anthusai/papyrus 1.7.0 → 1.9.0
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/components/newsroom-board-view.tsx +4 -6
- package/components/newsroom-newsprint-board.css +1 -0
- package/components/newsroom-organizer.css +7 -5
- package/components/topic-steering-workspace.tsx +1 -1
- package/lib/prospectus-account-client.ts +64 -0
- package/package.json +2 -1
- package/routes.manifest.json +1 -1
|
@@ -6,8 +6,6 @@ import { IssueCollection, IssueDetailPanel, IssueTypeFilter, issueTypeFromFilter
|
|
|
6
6
|
import "@kanbus/ui/styles/kanban.css";
|
|
7
7
|
import "./newsroom-newsprint-board.css";
|
|
8
8
|
import { PlusIcon } from "lucide-react";
|
|
9
|
-
import { buttonVariants } from "./ui/button";
|
|
10
|
-
import { cn } from "../lib/utils";
|
|
11
9
|
import { newsroomHref } from "../lib/newsroom-base-path";
|
|
12
10
|
import {
|
|
13
11
|
ASSIGNMENT_BOARD_TYPE,
|
|
@@ -142,17 +140,17 @@ export function NewsroomBoardView({ subject, deskId }: { subject: NewsroomBoardS
|
|
|
142
140
|
if (!allowed) return <NewsDeskAccessGate shell={session?.shell ?? null} />;
|
|
143
141
|
return <NewsroomOpsShell activeTab={subject === "contentItem" ? "articles" : subject === "desk" ? "desks" : "assignments"} appTitle={SITE_BRAND.appTitle} backLabel={SITE_BRAND.backToHomeLabel} pageTitle={pageTitle}
|
|
144
142
|
headerActions={<>
|
|
145
|
-
<
|
|
143
|
+
<span role="status" className="organizer-board-note">{loading ? "Loading records…" : `${issues.length} records loaded.`}</span>
|
|
144
|
+
<div role="group" aria-label="Record presentation" className="organizer-board-view-toggle"><button type="button" className="organizer-header-button" aria-pressed={view === "board"} onClick={() => setView("board")}>Board</button><button type="button" className="organizer-header-button" aria-pressed={view === "list"} onClick={() => setView("list")}>List</button></div>
|
|
146
145
|
{showsContentItems && (
|
|
147
|
-
<Link className=
|
|
148
|
-
<PlusIcon aria-hidden="true" />
|
|
146
|
+
<Link className="organizer-header-button" data-newsroom-article-new href={getNewsroomNavHref(newsroomHref("articles", "new"))}>
|
|
147
|
+
<PlusIcon size={14} aria-hidden="true" />
|
|
149
148
|
{`New ${getContentItemName().singular.toLowerCase()}`}
|
|
150
149
|
</Link>
|
|
151
150
|
)}
|
|
152
151
|
</>}>
|
|
153
152
|
<div className="organizer-native-board papyrus-newsprint-board" data-color-mode={theme}>
|
|
154
153
|
{error && <NewsroomOpsStatusBanner tone="error">{error}</NewsroomOpsStatusBanner>}
|
|
155
|
-
<p role="status" className="organizer-board-note">{loading ? "Loading records…" : `${issues.length} records loaded.`}</p>
|
|
156
154
|
{subject === "desk" && <IssueTypeFilter config={config} value={typeFilter} onChange={setTypeFilter} name="Record type" className="organizer-board-type-filter" />}
|
|
157
155
|
<div className="organizer-board-body" data-detail-open={Boolean(issue)} ref={boardBodyRef} onScrollCapture={handleBoardScroll}>
|
|
158
156
|
<IssueCollection issues={issues} config={config} query={{ type: subject === "desk" ? issueTypeFromFilter(typeFilter) : boardType }} view={view}
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
}
|
|
21
21
|
.papyrus-newsprint-board .kb-grid { height: 100%; min-height: 0; scrollbar-width: thin; }
|
|
22
22
|
.papyrus-newsprint-board .kb-column { border-left: 1px solid var(--org-line); padding-left: 10px; }
|
|
23
|
+
.papyrus-newsprint-board .kb-column:first-child { border-left: 0; padding-left: 0; }
|
|
23
24
|
.papyrus-newsprint-board .kb-column-header {
|
|
24
25
|
border-bottom: 2px solid var(--org-ink);
|
|
25
26
|
padding: 5px 0;
|
|
@@ -20,7 +20,7 @@ body:has(.newsroom-organizer)>[data-staging-banner]{flex-shrink:0}
|
|
|
20
20
|
.organizer-destinations a[aria-current=page]{border-bottom:2px solid var(--org-ink);color:var(--org-ink)}
|
|
21
21
|
.newsroom-organizer :is(a,button):focus-visible,.organizer-menu :is(a,button):focus-visible{outline:2px solid currentColor;outline-offset:-3px}
|
|
22
22
|
.organizer-workspace{display:flex;flex-direction:column;min-height:0;min-width:0;overflow:hidden;padding:0 16px}
|
|
23
|
-
.organizer-topbar{height:
|
|
23
|
+
.organizer-topbar{height:48px;min-height:48px;display:flex;align-items:center;gap:16px;border-bottom:1px solid var(--org-ink)}
|
|
24
24
|
.organizer-masthead{font:900 28px Newsroom Display,Georgia,serif;white-space:nowrap;max-width:30vw;overflow:hidden;text-overflow:ellipsis}
|
|
25
25
|
.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}
|
|
26
26
|
.organizer-toggle{display:flex;align-items:center;justify-content:center;width:36px;min-height:36px;padding:0;border:1px solid var(--org-line);flex-shrink:0}
|
|
@@ -36,11 +36,12 @@ body:has(.newsroom-organizer)>[data-staging-banner]{flex-shrink:0}
|
|
|
36
36
|
.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}
|
|
37
37
|
.organizer-bottom-nav{display:none}
|
|
38
38
|
.organizer-main:has(.organizer-native-board){display:flex;overflow:hidden}
|
|
39
|
-
.organizer-native-board{display:flex;flex-direction:column;flex:1;min-height:0;min-width:0;gap:
|
|
39
|
+
.organizer-native-board{display:flex;flex-direction:column;flex:1;min-height:0;min-width:0;gap:8px}
|
|
40
40
|
.organizer-board-view-toggle{display:flex;gap:4px;flex-shrink:0}
|
|
41
|
-
.organizer-
|
|
42
|
-
.organizer-
|
|
43
|
-
.organizer-board-note{font-size:11px;line-height:1.5;margin:0;color:var(--org-muted)}
|
|
41
|
+
.organizer-header-button{display:inline-flex;align-items:center;gap:6px;min-height:36px;padding:4px 12px;border:1px solid var(--org-line);font:inherit;color:inherit;background:transparent;text-decoration:none;white-space:nowrap;cursor:pointer}
|
|
42
|
+
.organizer-header-button[aria-pressed=true]{background:var(--org-ink);color:var(--org-paper)}
|
|
43
|
+
.organizer-board-note{font-size:11px;line-height:1.5;margin:0;color:var(--org-muted);white-space:nowrap}
|
|
44
|
+
@media(min-width:901px){.newsroom-organizer[data-sidebar-collapsed=false] .organizer-masthead{display:none}}
|
|
44
45
|
.organizer-board-body{position:relative;display:grid;grid-template-columns:minmax(0,1fr);flex:1;min-width:0;min-height:0;gap:16px}
|
|
45
46
|
.organizer-board-body[data-detail-open=true]{grid-template-columns:minmax(0,1fr) minmax(280px,360px)}
|
|
46
47
|
.organizer-board-body>.kb-issue-collection{height:100%;min-height:0;overflow:auto}
|
|
@@ -50,6 +51,7 @@ body:has(.newsroom-organizer)>[data-staging-banner]{flex-shrink:0}
|
|
|
50
51
|
.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}
|
|
51
52
|
.organizer-menu .organizer-destinations a{border:1px solid var(--org-line);padding:12px;color:var(--org-ink)}
|
|
52
53
|
@media(max-width:900px){
|
|
54
|
+
.organizer-board-note{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
|
|
53
55
|
.newsroom-organizer,.newsroom-organizer[data-sidebar-collapsed=true]{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr) auto}
|
|
54
56
|
.organizer-sidebar,.organizer-toggle{display:none}.organizer-workspace{padding:0 16px}.organizer-topbar{gap:8px;height:55px;min-height:55px}
|
|
55
57
|
.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%}
|
|
@@ -13297,7 +13297,7 @@ function buildUiAnalysisReindexAssignmentPlan({
|
|
|
13297
13297
|
createdBy: actorLabel,
|
|
13298
13298
|
createdAt: now,
|
|
13299
13299
|
updatedAt: now,
|
|
13300
|
-
newsroomFeedKey: "
|
|
13300
|
+
newsroomFeedKey: "operations",
|
|
13301
13301
|
metadata,
|
|
13302
13302
|
};
|
|
13303
13303
|
const event: AssignmentEventRecord = {
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
export interface ProspectusPublishingAccountChoice {
|
|
2
|
+
accountId: string;
|
|
3
|
+
name?: string;
|
|
4
|
+
role: string;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export type ProspectusAccountState =
|
|
8
|
+
| { status: "unavailable" }
|
|
9
|
+
| { status: "signedOut"; signInUrl: string }
|
|
10
|
+
| {
|
|
11
|
+
status: "signedIn";
|
|
12
|
+
publishingAccounts: ProspectusPublishingAccountChoice[];
|
|
13
|
+
selectedAccountId: string | null;
|
|
14
|
+
cyclotronLabAccess: boolean;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
type FetchImplementation = (input: string, init?: RequestInit) => Promise<Response>;
|
|
18
|
+
|
|
19
|
+
const SESSION_PATH = "/api/auth/prospectus/session";
|
|
20
|
+
const SELECTION_PATH = "/api/auth/prospectus/selection";
|
|
21
|
+
const SIGN_IN_PATH = "/api/auth/prospectus/sign-in";
|
|
22
|
+
|
|
23
|
+
export function prospectusSignInUrl(returnPath: string): string {
|
|
24
|
+
return `${SIGN_IN_PATH}?returnTo=${encodeURIComponent(returnPath)}`;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export async function loadProspectusAccountState(
|
|
28
|
+
returnPath: string,
|
|
29
|
+
fetchImplementation: FetchImplementation = fetch,
|
|
30
|
+
): Promise<ProspectusAccountState> {
|
|
31
|
+
let response: Response;
|
|
32
|
+
try {
|
|
33
|
+
response = await fetchImplementation(SESSION_PATH, { credentials: "same-origin", cache: "no-store" });
|
|
34
|
+
} catch {
|
|
35
|
+
return { status: "unavailable" };
|
|
36
|
+
}
|
|
37
|
+
if (!response.ok) return { status: "unavailable" };
|
|
38
|
+
const body = await response.json().catch(() => null) as
|
|
39
|
+
| { signedIn?: boolean; publishingAccounts?: ProspectusPublishingAccountChoice[]; selectedAccountId?: string | null; cyclotronLabAccess?: boolean }
|
|
40
|
+
| null;
|
|
41
|
+
if (!body) return { status: "unavailable" };
|
|
42
|
+
if (!body.signedIn) return { status: "signedOut", signInUrl: prospectusSignInUrl(returnPath) };
|
|
43
|
+
return {
|
|
44
|
+
status: "signedIn",
|
|
45
|
+
publishingAccounts: Array.isArray(body.publishingAccounts) ? body.publishingAccounts : [],
|
|
46
|
+
selectedAccountId: body.selectedAccountId ?? null,
|
|
47
|
+
cyclotronLabAccess: body.cyclotronLabAccess === true,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export async function selectProspectusAccount(
|
|
52
|
+
accountId: string,
|
|
53
|
+
fetchImplementation: FetchImplementation = fetch,
|
|
54
|
+
): Promise<{ selectedAccountId: string; role: string } | { error: string }> {
|
|
55
|
+
const response = await fetchImplementation(SELECTION_PATH, {
|
|
56
|
+
method: "POST",
|
|
57
|
+
credentials: "same-origin",
|
|
58
|
+
headers: { "content-type": "application/json" },
|
|
59
|
+
body: JSON.stringify({ accountId }),
|
|
60
|
+
});
|
|
61
|
+
const body = await response.json().catch(() => null) as { selectedAccountId?: string; role?: string; message?: string } | null;
|
|
62
|
+
if (!response.ok || !body?.selectedAccountId) return { error: body?.message ?? "That account could not be selected." };
|
|
63
|
+
return { selectedAccountId: body.selectedAccountId, role: body.role ?? "" };
|
|
64
|
+
}
|
package/package.json
CHANGED
|
@@ -220,6 +220,7 @@
|
|
|
220
220
|
"./lib/presentation-footer": "./lib/presentation-footer.ts",
|
|
221
221
|
"./lib/pretext-layout": "./lib/pretext-layout.ts",
|
|
222
222
|
"./lib/priming-proof-report": "./lib/priming-proof-report.ts",
|
|
223
|
+
"./lib/prospectus-account-client": "./lib/prospectus-account-client.ts",
|
|
223
224
|
"./lib/prospectus-publication-access": "./lib/prospectus-publication-access.ts",
|
|
224
225
|
"./lib/prospectus-session": "./lib/prospectus-session.ts",
|
|
225
226
|
"./lib/prospectus-sign-in-routes": "./lib/prospectus-sign-in-routes.ts",
|
|
@@ -351,7 +352,7 @@
|
|
|
351
352
|
"optional": true
|
|
352
353
|
}
|
|
353
354
|
},
|
|
354
|
-
"version": "1.
|
|
355
|
+
"version": "1.9.0",
|
|
355
356
|
"dependencies": {
|
|
356
357
|
"@aws-amplify/adapter-nextjs": "^1.7.3",
|
|
357
358
|
"@aws-crypto/sha256-js": "5.2.0",
|
package/routes.manifest.json
CHANGED