@anthusai/papyrus 1.7.0 → 1.8.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.
@@ -142,6 +142,7 @@ export function NewsroomBoardView({ subject, deskId }: { subject: NewsroomBoardS
142
142
  if (!allowed) return <NewsDeskAccessGate shell={session?.shell ?? null} />;
143
143
  return <NewsroomOpsShell activeTab={subject === "contentItem" ? "articles" : subject === "desk" ? "desks" : "assignments"} appTitle={SITE_BRAND.appTitle} backLabel={SITE_BRAND.backToHomeLabel} pageTitle={pageTitle}
144
144
  headerActions={<>
145
+ <span role="status" className="organizer-board-note">{loading ? "Loading records…" : `${issues.length} records loaded.`}</span>
145
146
  <div role="group" aria-label="Record presentation" className="organizer-board-view-toggle"><button type="button" aria-pressed={view === "board"} onClick={() => setView("board")}>Board</button><button type="button" aria-pressed={view === "list"} onClick={() => setView("list")}>List</button></div>
146
147
  {showsContentItems && (
147
148
  <Link className={cn(buttonVariants({ size: "sm" }))} data-newsroom-article-new href={getNewsroomNavHref(newsroomHref("articles", "new"))}>
@@ -152,7 +153,6 @@ export function NewsroomBoardView({ subject, deskId }: { subject: NewsroomBoardS
152
153
  </>}>
153
154
  <div className="organizer-native-board papyrus-newsprint-board" data-color-mode={theme}>
154
155
  {error && <NewsroomOpsStatusBanner tone="error">{error}</NewsroomOpsStatusBanner>}
155
- <p role="status" className="organizer-board-note">{loading ? "Loading records…" : `${issues.length} records loaded.`}</p>
156
156
  {subject === "desk" && <IssueTypeFilter config={config} value={typeFilter} onChange={setTypeFilter} name="Record type" className="organizer-board-type-filter" />}
157
157
  <div className="organizer-board-body" data-detail-open={Boolean(issue)} ref={boardBodyRef} onScrollCapture={handleBoardScroll}>
158
158
  <IssueCollection issues={issues} config={config} query={{ type: subject === "desk" ? issueTypeFromFilter(typeFilter) : boardType }} view={view}
@@ -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:57px;min-height:57px;display:flex;align-items:center;gap:16px;border-bottom:1px solid var(--org-ink)}
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,13 @@ 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:12px}
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
41
  .organizer-board-view-toggle button{min-height:36px;padding:4px 12px;border:1px solid var(--org-line)}
42
42
  .organizer-board-view-toggle 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)}
43
+ .organizer-board-note{font-size:11px;line-height:1.5;margin:0;color:var(--org-muted);white-space:nowrap}
44
+ .organizer-header-actions a[data-newsroom-article-new]{color:var(--primary-foreground)}
45
+ @media(min-width:901px){.newsroom-organizer[data-sidebar-collapsed=false] .organizer-masthead{display:none}}
44
46
  .organizer-board-body{position:relative;display:grid;grid-template-columns:minmax(0,1fr);flex:1;min-width:0;min-height:0;gap:16px}
45
47
  .organizer-board-body[data-detail-open=true]{grid-template-columns:minmax(0,1fr) minmax(280px,360px)}
46
48
  .organizer-board-body>.kb-issue-collection{height:100%;min-height:0;overflow:auto}
@@ -50,6 +52,7 @@ body:has(.newsroom-organizer)>[data-staging-banner]{flex-shrink:0}
50
52
  .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
53
  .organizer-menu .organizer-destinations a{border:1px solid var(--org-line);padding:12px;color:var(--org-ink)}
52
54
  @media(max-width:900px){
55
+ .organizer-board-note{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
53
56
  .newsroom-organizer,.newsroom-organizer[data-sidebar-collapsed=true]{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr) auto}
54
57
  .organizer-sidebar,.organizer-toggle{display:none}.organizer-workspace{padding:0 16px}.organizer-topbar{gap:8px;height:55px;min-height:55px}
55
58
  .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: "assignments",
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.7.0",
355
+ "version": "1.8.0",
355
356
  "dependencies": {
356
357
  "@aws-amplify/adapter-nextjs": "^1.7.3",
357
358
  "@aws-crypto/sha256-js": "5.2.0",
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.7.0",
2
+ "version": "1.8.0",
3
3
  "routes": [
4
4
  {
5
5
  "file": "app/%5F_preview/[[...path]]/route.ts",