@anthusai/papyrus 1.19.1 → 2.0.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/app/globals.css CHANGED
@@ -3749,95 +3749,6 @@ img {
3749
3749
  gap: 0;
3750
3750
  }
3751
3751
 
3752
- .newsroom-deep-section {
3753
- border-top: 2px solid var(--rule);
3754
- display: grid;
3755
- grid-template-columns: repeat(var(--news-desk-page-columns), minmax(0, 1fr));
3756
- margin-top: calc(var(--paper-rhythm) * 2);
3757
- min-width: 0;
3758
- row-gap: calc(var(--paper-rhythm) * 1.5);
3759
- }
3760
-
3761
- .newsroom-deep-section__header {
3762
- border-bottom: 1px solid rgb(var(--rule-rgb) / 0.52);
3763
- display: grid;
3764
- grid-column: 1 / -1;
3765
- gap: calc(var(--paper-rhythm) * 0.5);
3766
- padding: calc(var(--paper-rhythm) * 0.75) 0;
3767
- }
3768
-
3769
- .newsroom-deep-section__header h2,
3770
- .newsroom-deep-section > h2 {
3771
- color: rgb(var(--ink-solid-rgb) / var(--ink-display-alpha));
3772
- font-size: 3rem;
3773
- font-weight: 900;
3774
- letter-spacing: 0;
3775
- line-height: 0.92;
3776
- margin: 0;
3777
- }
3778
-
3779
- .newsroom-deep-section__header a {
3780
- color: var(--muted);
3781
- font-family: Arial, Helvetica, sans-serif;
3782
- font-size: 0.66rem;
3783
- font-weight: 800;
3784
- letter-spacing: 0.08em;
3785
- text-transform: uppercase;
3786
- }
3787
-
3788
- .newsroom-deep-section__header-actions {
3789
- align-items: center;
3790
- display: flex;
3791
- flex-wrap: wrap;
3792
- gap: var(--paper-rhythm);
3793
- }
3794
-
3795
- .newsroom-deep-section__header-actions button {
3796
- background: transparent;
3797
- border: 1px solid rgb(var(--rule-rgb) / 0.62);
3798
- color: rgb(var(--ink-solid-rgb) / var(--ink-display-alpha));
3799
- cursor: pointer;
3800
- font-family: Arial, Helvetica, sans-serif;
3801
- font-size: 0.66rem;
3802
- font-weight: 800;
3803
- letter-spacing: 0.08em;
3804
- min-height: var(--paper-rhythm);
3805
- padding: 0 calc(var(--paper-rhythm) * 0.5);
3806
- text-transform: uppercase;
3807
- }
3808
-
3809
- .newsroom-deep-section__header-actions button:disabled {
3810
- color: var(--muted);
3811
- cursor: not-allowed;
3812
- }
3813
-
3814
- .newsroom-deep-section__body {
3815
- column-gap: var(--news-desk-column-gap);
3816
- display: grid;
3817
- grid-column: 1 / -1;
3818
- grid-template-columns: repeat(var(--news-desk-page-columns), minmax(0, 1fr));
3819
- row-gap: calc(var(--paper-rhythm) * 1.5);
3820
- }
3821
-
3822
- .newsroom-deep-section__field {
3823
- border-top: 1px solid rgb(var(--rule-rgb) / 0.42);
3824
- grid-column: span 2;
3825
- min-width: 0;
3826
- padding-top: calc(var(--paper-rhythm) * 0.5);
3827
- }
3828
-
3829
- .newsroom-deep-section__field--lead {
3830
- grid-column: span 3;
3831
- }
3832
-
3833
- .newsroom-deep-section__field p:not(.story-label),
3834
- .newsroom-deep-section > p:not(.story-label) {
3835
- color: var(--muted-strong);
3836
- font-size: 1.05rem;
3837
- line-height: var(--news-desk-text-leading, var(--paper-rhythm));
3838
- margin: calc(var(--paper-rhythm) * 0.5) 0 0;
3839
- }
3840
-
3841
3752
  .newsroom-recent-panel__header {
3842
3753
  border-bottom: 1px solid rgb(var(--rule-rgb) / 0.42);
3843
3754
  min-height: calc(var(--paper-rhythm, 19px) * 3);
@@ -8825,10 +8736,6 @@ img {
8825
8736
  grid-template-columns: repeat(3, minmax(0, 1fr));
8826
8737
  }
8827
8738
 
8828
- .newsroom-deep-section__field,
8829
- .newsroom-deep-section__field--lead {
8830
- grid-column: 1 / -1;
8831
- }
8832
8739
  }
8833
8740
 
8834
8741
  @media (max-width: 785px) {
@@ -10263,85 +10170,3 @@ img {
10263
10170
  }
10264
10171
  }
10265
10172
 
10266
- /* Ops app chrome: sans-only content surfaces; moss primary on navigation/actions */
10267
- [data-newsroom-chrome="app"][data-newsroom-ops-shell="true"] {
10268
- font-family: var(--font-sans), ui-sans-serif, system-ui, sans-serif;
10269
- }
10270
-
10271
- [data-newsroom-chrome="app"][data-newsroom-ops-shell="true"] h1,
10272
- [data-newsroom-chrome="app"][data-newsroom-ops-shell="true"] h2,
10273
- [data-newsroom-chrome="app"][data-newsroom-ops-shell="true"] h3,
10274
- [data-newsroom-chrome="app"][data-newsroom-ops-shell="true"] .story-label {
10275
- font-family: var(--font-sans), ui-sans-serif, system-ui, sans-serif;
10276
- }
10277
-
10278
- [data-newsroom-chrome="app"] [data-category-steering] {
10279
- font-family: var(--font-sans), ui-sans-serif, system-ui, sans-serif;
10280
- }
10281
-
10282
- [data-theme-pack="pilobol-us"] [data-newsroom-ops-shell="true"] a:focus-visible,
10283
- [data-theme-pack="pilobol-us"] [data-newsroom-ops-shell="true"] button:focus-visible {
10284
- --tw-ring-color: var(--theme-moss);
10285
- }
10286
-
10287
- /* List-row selection in ops chrome: tint wash + foreground copy; never invert to primary-foreground. */
10288
- [data-newsroom-chrome="app"] [data-newsroom-list-row][data-selected="true"],
10289
- [data-newsroom-chrome="app"] [data-newsroom-list-row][aria-current="true"],
10290
- [data-newsroom-chrome="app"] .newsroom-card[data-active="true"],
10291
- [data-newsroom-chrome="app"] .news-desk-data-grid__row[data-active="true"],
10292
- [data-newsroom-chrome="app"] .news-desk-topic-root-button[data-selected="true"],
10293
- [data-newsroom-chrome="app"] .news-desk-topic-focus-row[data-selected="true"],
10294
- [data-newsroom-chrome="app"] .news-desk-topic-focus-button[data-selected="true"],
10295
- [data-newsroom-chrome="app"] .news-desk-desk-card[data-selected="true"] {
10296
- background: color-mix(in srgb, var(--primary) 10%, transparent);
10297
- color: var(--foreground);
10298
- }
10299
-
10300
- [data-newsroom-chrome="app"] .newsroom-card[data-active="true"] .newsroom-card__title,
10301
- [data-newsroom-chrome="app"] .newsroom-card[data-active="true"] .newsroom-card__body,
10302
- [data-newsroom-chrome="app"] .newsroom-card[data-active="true"] .newsroom-card__kicker,
10303
- [data-newsroom-chrome="app"] .newsroom-card[data-active="true"] .newsroom-card__meta,
10304
- [data-newsroom-chrome="app"] .newsroom-card[data-active="true"] .newsroom-card__stamp,
10305
- [data-newsroom-chrome="app"] .news-desk-data-grid__row[data-active="true"] strong,
10306
- [data-newsroom-chrome="app"] .news-desk-topic-root-button[data-selected="true"] strong,
10307
- [data-newsroom-chrome="app"] .news-desk-topic-focus-button[data-selected="true"] strong {
10308
- color: var(--foreground);
10309
- }
10310
-
10311
- [data-newsroom-chrome="app"] [role="tab"][aria-selected="true"] {
10312
- background: color-mix(in srgb, var(--primary) 10%, transparent);
10313
- color: var(--foreground);
10314
- }
10315
-
10316
- @media (prefers-color-scheme: dark) {
10317
- :root:not([data-papyrus-theme="light"]):not(.light-theme) [data-newsroom-chrome="app"] [data-newsroom-list-row][data-selected="true"],
10318
- :root:not([data-papyrus-theme="light"]):not(.light-theme) [data-newsroom-chrome="app"] [data-newsroom-list-row][aria-current="true"],
10319
- :root:not([data-papyrus-theme="light"]):not(.light-theme) [data-newsroom-chrome="app"] .newsroom-card[data-active="true"],
10320
- :root:not([data-papyrus-theme="light"]):not(.light-theme) [data-newsroom-chrome="app"] .news-desk-data-grid__row[data-active="true"],
10321
- :root:not([data-papyrus-theme="light"]):not(.light-theme) [data-newsroom-chrome="app"] .news-desk-topic-root-button[data-selected="true"],
10322
- :root:not([data-papyrus-theme="light"]):not(.light-theme) [data-newsroom-chrome="app"] .news-desk-topic-focus-row[data-selected="true"],
10323
- :root:not([data-papyrus-theme="light"]):not(.light-theme) [data-newsroom-chrome="app"] .news-desk-topic-focus-button[data-selected="true"],
10324
- :root:not([data-papyrus-theme="light"]):not(.light-theme) [data-newsroom-chrome="app"] .news-desk-desk-card[data-selected="true"] {
10325
- background: color-mix(in srgb, var(--foreground) 8%, transparent);
10326
- }
10327
- }
10328
-
10329
- :root.dark-theme [data-newsroom-chrome="app"] [data-newsroom-list-row][data-selected="true"],
10330
- :root[data-papyrus-theme="dark"] [data-newsroom-chrome="app"] [data-newsroom-list-row][data-selected="true"],
10331
- :root.dark-theme [data-newsroom-chrome="app"] [data-newsroom-list-row][aria-current="true"],
10332
- :root[data-papyrus-theme="dark"] [data-newsroom-chrome="app"] [data-newsroom-list-row][aria-current="true"],
10333
- :root.dark-theme [data-newsroom-chrome="app"] .newsroom-card[data-active="true"],
10334
- :root[data-papyrus-theme="dark"] [data-newsroom-chrome="app"] .newsroom-card[data-active="true"],
10335
- :root.dark-theme [data-newsroom-chrome="app"] .news-desk-data-grid__row[data-active="true"],
10336
- :root[data-papyrus-theme="dark"] [data-newsroom-chrome="app"] .news-desk-data-grid__row[data-active="true"],
10337
- :root.dark-theme [data-newsroom-chrome="app"] .news-desk-topic-root-button[data-selected="true"],
10338
- :root[data-papyrus-theme="dark"] [data-newsroom-chrome="app"] .news-desk-topic-root-button[data-selected="true"],
10339
- :root.dark-theme [data-newsroom-chrome="app"] .news-desk-topic-focus-row[data-selected="true"],
10340
- :root[data-papyrus-theme="dark"] [data-newsroom-chrome="app"] .news-desk-topic-focus-row[data-selected="true"],
10341
- :root.dark-theme [data-newsroom-chrome="app"] .news-desk-topic-focus-button[data-selected="true"],
10342
- :root[data-papyrus-theme="dark"] [data-newsroom-chrome="app"] .news-desk-topic-focus-button[data-selected="true"],
10343
- :root.dark-theme [data-newsroom-chrome="app"] .news-desk-desk-card[data-selected="true"],
10344
- :root[data-papyrus-theme="dark"] [data-newsroom-chrome="app"] .news-desk-desk-card[data-selected="true"] {
10345
- background: color-mix(in srgb, var(--foreground) 8%, transparent);
10346
- }
10347
-
@@ -1,4 +1,3 @@
1
- import { resolveActiveSiteBrand } from "../../../../lib/site-brand-tenant";
2
1
  import { notFound, redirect } from "next/navigation";
3
2
  import { toPublicNewsroomPath } from "../../../../lib/newsroom-base-path";
4
3
  import { NewsDeskPage } from "../../../../components/news-desk-page";
@@ -42,11 +41,6 @@ export default async function NewsDeskNestedSectionPage({ params, searchParams }
42
41
  if (section === "users") redirect(toPublicNewsroomPath("/newsroom/administration/users"));
43
42
  if (section === "doctrine") redirect(toPublicNewsroomPath("/newsroom/administration/policies"));
44
43
  if (section === "administration" && selection[0] === "analysis") redirect(toPublicNewsroomPath("/newsroom/assignments"));
45
- if (section === "desks" && resolveActiveSiteBrand().newsroomLayout !== "organizer") {
46
- const category = selection[0] ? decodeURIComponent(selection[0]) : null;
47
- if (category) redirect(toPublicNewsroomPath(`/newsroom/topics?category=${encodeURIComponent(category)}`));
48
- redirect(toPublicNewsroomPath("/newsroom/topics"));
49
- }
50
44
  if (!NEWS_DESK_ROUTE_SECTIONS.has(section as NewsDeskTab)) notFound();
51
45
  return <NewsDeskPage section={section} selectionPath={selection} searchParams={searchParams} />;
52
46
  }
@@ -1,4 +1,3 @@
1
- import { resolveActiveSiteBrand } from "../../../lib/site-brand-tenant";
2
1
  import { notFound, redirect } from "next/navigation";
3
2
  import { toPublicNewsroomPath } from "../../../lib/newsroom-base-path";
4
3
  import { contentItemBoardPathSegment } from "../../../lib/newsroom-board";
@@ -46,10 +45,9 @@ export default async function NewsDeskSectionPage({ params, searchParams }: News
46
45
  if (section === "work") redirect(toPublicNewsroomPath(`/newsroom/${contentItemBoardPathSegment()}`));
47
46
  if (section === "users") redirect(toPublicNewsroomPath("/newsroom/administration/users"));
48
47
  if (section === "doctrine") redirect(toPublicNewsroomPath("/newsroom/administration/policies"));
49
- if (section === "desks" && resolveActiveSiteBrand().newsroomLayout !== "organizer") redirect(toPublicNewsroomPath("/newsroom/topics"));
50
- if (section === contentItemBoardPathSegment() && resolveActiveSiteBrand().newsroomLayout === "organizer") return <NewsroomBoardView subject="contentItem" />;
48
+ if (section === contentItemBoardPathSegment()) return <NewsroomBoardView subject="contentItem" />;
51
49
  if (!NEWS_DESK_ROUTE_SECTIONS.has(section as NewsDeskTab)) notFound();
52
- if (section === "assignments" && resolveActiveSiteBrand().newsroomLayout === "organizer") {
50
+ if (section === "assignments") {
53
51
  const resolved = await searchParams;
54
52
  if (!resolved?.assignment && resolved?.demo !== "1") return <NewsroomBoardView subject="assignment" />;
55
53
  }
@@ -2,7 +2,6 @@ import { redirect } from "next/navigation";
2
2
  import { contentItemBoardPathSegment } from "../../../lib/newsroom-board";
3
3
  import { toPublicNewsroomPath } from "../../../lib/newsroom-base-path";
4
4
  import { NewsroomBoardView } from "../../../components/newsroom-board-view";
5
- import { resolveActiveSiteBrand } from "../../../lib/site-brand-tenant";
6
5
  import { NewsroomArticlesView } from "../../../components/newsroom-articles-view";
7
6
 
8
7
  export const dynamic = "force-dynamic";
@@ -14,7 +13,7 @@ type NewsroomArticlesPageProps = {
14
13
  export default async function NewsroomArticlesPage({ searchParams }: NewsroomArticlesPageProps) {
15
14
  const resolved = await searchParams;
16
15
  const demoValue = Array.isArray(resolved?.demo) ? resolved?.demo[0] : resolved?.demo;
17
- if (resolveActiveSiteBrand().newsroomLayout === "organizer" && demoValue !== "1") {
16
+ if (demoValue !== "1") {
18
17
  const boardPathSegment = contentItemBoardPathSegment();
19
18
  if (boardPathSegment !== "articles") redirect(toPublicNewsroomPath(`/newsroom/${boardPathSegment}`));
20
19
  return <NewsroomBoardView subject="contentItem" />;
@@ -1,20 +1,16 @@
1
1
  import { notFound } from "next/navigation";
2
- import { resolveActiveSiteBrand } from "../../../../lib/site-brand-tenant";
3
2
  import { NewsroomBoardView } from "../../../../components/newsroom-board-view";
4
- import { NewsDeskPage } from "../../../../components/news-desk-page";
5
3
 
6
4
  export const dynamic = "force-dynamic";
7
5
 
8
6
  type NewsroomDeepSectionPageProps = {
9
7
  params: Promise<{ sectionId: string }>;
10
- searchParams?: Promise<Record<string, string | string[] | undefined>>;
11
8
  };
12
9
 
13
- export default async function NewsroomDeepSectionPage({ params, searchParams }: NewsroomDeepSectionPageProps) {
10
+ export default async function NewsroomDeepSectionPage({ params }: NewsroomDeepSectionPageProps) {
14
11
  const { sectionId } = await params;
15
12
  const normalizedSectionId = decodeURIComponent(sectionId ?? "").trim();
16
13
  if (!normalizedSectionId) notFound();
17
14
 
18
- if (resolveActiveSiteBrand().newsroomLayout === "organizer") return <NewsroomBoardView subject="desk" deskId={normalizedSectionId} />;
19
- return <NewsDeskPage sectionPageId={normalizedSectionId} searchParams={searchParams} />;
15
+ return <NewsroomBoardView subject="desk" deskId={normalizedSectionId} />;
20
16
  }
@@ -12,6 +12,7 @@ import fs from "node:fs";
12
12
  import { spawnSync } from "node:child_process";
13
13
  import path from "node:path";
14
14
  import { createRequire } from "node:module";
15
+ import { resolveCdkEnvironment } from "../src/cdk-environment.mjs";
15
16
 
16
17
  const USAGE = [
17
18
  "Usage: papyrus-infra synth --site infra/site.json [--out cdk.out] [--account A] [--region R]",
@@ -26,6 +27,14 @@ const opt = (name, fallback) => {
26
27
  const i = args.indexOf(`--${name}`);
27
28
  return i >= 0 ? args[i + 1] : fallback;
28
29
  };
30
+ const resolveEnvironmentOrExit = () => {
31
+ try {
32
+ return resolveCdkEnvironment({ explicitAccount: opt("account"), explicitRegion: opt("region") });
33
+ } catch (error) {
34
+ console.error(`papyrus-infra: ${error instanceof Error ? error.message : error}`);
35
+ process.exit(1);
36
+ }
37
+ };
29
38
  const command = args[0];
30
39
  if (command !== "synth" && command !== "print-buildspec" && command !== "deploy" && command !== "deploy-edge") {
31
40
  console.error(USAGE);
@@ -85,7 +94,7 @@ if (accountStack !== undefined) {
85
94
  const { App } = createRequire(path.join(process.cwd(), "noop.js"))("aws-cdk-lib");
86
95
  const app = new App({ outdir: path.resolve(opt("out", "cdk.out")) });
87
96
  new GithubOidcProviderStack(app, "GithubOidcProviderStack", {
88
- env: { account: opt("account", process.env.CDK_DEFAULT_ACCOUNT ?? "335163751677"), region: opt("region", process.env.CDK_DEFAULT_REGION ?? "us-east-1") },
97
+ env: resolveEnvironmentOrExit(),
89
98
  stackName: "github-oidc-provider",
90
99
  });
91
100
  app.synth();
@@ -168,7 +177,7 @@ try {
168
177
  const { App } = createRequire(path.join(process.cwd(), "noop.js"))("aws-cdk-lib");
169
178
  const app = new App({ outdir: path.resolve(opt("out", "cdk.out")) });
170
179
  new AmplifyAppShellStack(app, `AmplifyAppShell-${config.siteId}`, config, {
171
- env: { account: opt("account", process.env.CDK_DEFAULT_ACCOUNT ?? "335163751677"), region: opt("region", process.env.CDK_DEFAULT_REGION ?? "us-east-1") },
180
+ env: resolveEnvironmentOrExit(),
172
181
  stackName: resolveStackName(config),
173
182
  });
174
183
  app.synth();
@@ -14,7 +14,6 @@ import {
14
14
  } from "../lib/site-brand-tenant";
15
15
 
16
16
  export type NewsDeskPageProps = {
17
- sectionPageId?: string | null;
18
17
  section?: string | string[] | null;
19
18
  selectionPath?: string[] | null;
20
19
  searchParams?: Promise<{
@@ -40,10 +39,10 @@ export type NewsDeskPageProps = {
40
39
  }>;
41
40
  };
42
41
 
43
- export async function NewsDeskPage({ section: routeSection, sectionPageId, selectionPath, searchParams }: NewsDeskPageProps) {
42
+ export async function NewsDeskPage({ section: routeSection, selectionPath, searchParams }: NewsDeskPageProps) {
44
43
  const resolvedSearchParams = await searchParams;
45
44
  const brand = resolveActiveSiteBrand();
46
- const initialTab = resolveNewsDeskTab(routeSection ?? getSearchParam(resolvedSearchParams, "section"), getSearchParam(resolvedSearchParams, "tab"), brand.newsroomLayout === "organizer");
45
+ const initialTab = resolveNewsDeskTab(routeSection ?? getSearchParam(resolvedSearchParams, "section"), getSearchParam(resolvedSearchParams, "tab"));
47
46
  const routeSelection = parseRouteSelection(initialTab, selectionPath);
48
47
  const initialSelection = {
49
48
  assignment: routeSelection.assignment ?? getFirstSearchParam(resolvedSearchParams, "assignment"),
@@ -70,7 +69,7 @@ export async function NewsDeskPage({ section: routeSection, sectionPageId, selec
70
69
  const dashboard = useDemoDashboard
71
70
  ? createDemoCategorySteeringDashboard(brand.id, getBrandNewsroomSectionsConfigPath(brand))
72
71
  : await loadCategorySteeringDashboard();
73
- return <NewsDeskWorkspace analysisProfiles={analysisProfiles} configuredCorpora={configuredCorpora} dashboard={dashboard} initialSelection={initialSelection} initialTab={initialTab} sectionPageId={sectionPageId ?? null} />;
72
+ return <NewsDeskWorkspace analysisProfiles={analysisProfiles} configuredCorpora={configuredCorpora} dashboard={dashboard} initialSelection={initialSelection} initialTab={initialTab} />;
74
73
  }
75
74
 
76
75
  function parseRouteSelection(tab: NewsDeskTab, selectionPath: string[] | null | undefined): { assignment?: string | null; category?: string | null; message?: string | null; panel?: string | null; reference?: string | null; forumThread?: string | null } {