@anthusai/papyrus 1.3.0 → 1.4.0-next.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/amplify/functions/model-attachment-upload/handler.ts +1 -0
- package/app/newsroom/[section]/page.tsx +8 -0
- package/app/newsroom/articles/page.tsx +10 -0
- package/components/news-desk-client-provider.tsx +17 -2
- package/components/news-desk-taxonomy-client.ts +86 -3
- package/components/newspaper.tsx +4 -4
- package/components/newsroom-board-view.tsx +70 -29
- package/components/newsroom-client-shell.tsx +8 -1
- package/components/newsroom-organizer-shell.tsx +13 -8
- package/components/newsroom-organizer.css +5 -5
- package/components/newsroom-references-view.tsx +18 -0
- package/components/reference-cyclotron-priming.tsx +85 -0
- package/components/topic-steering-workspace.tsx +35 -1
- package/lib/article-flow.ts +95 -0
- package/lib/article-frame-solver.ts +519 -0
- package/lib/chrome-text.ts +504 -0
- package/lib/content-item-lifecycle.ts +32 -5
- package/lib/front-mosaic.ts +1132 -0
- package/lib/furniture.ts +385 -0
- package/lib/labels.ts +37 -0
- package/lib/layout-config.ts +237 -0
- package/lib/layout-plan.ts +37 -9
- package/lib/layout-scenarios.ts +21 -11
- package/lib/layout-types.ts +457 -0
- package/lib/local-preview-seed.ts +95 -0
- package/lib/local-preview.ts +3 -0
- package/lib/newspaper-layout.ts +17 -3410
- package/lib/newsroom-board.ts +70 -47
- package/lib/newsroom-organizer-nav.ts +5 -5
- package/lib/pretext-layout.ts +22 -0
- package/lib/relevance-status.ts +73 -0
- package/lib/site-brand.ts +8 -1
- package/lib/text-columns.ts +251 -0
- package/package.json +13 -2
- package/renderers/pretext/presentation-shell.tsx +1 -1
- package/routes.manifest.json +1 -9
- package/app/newsroom/work/page.tsx +0 -10
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import type { AssignmentRecord, ReferenceRecord } from "./category-repository";
|
|
2
|
+
import { contentItemStageKeys, type ContentItemVersionRecord } from "./content-item-lifecycle";
|
|
3
|
+
import { getContentItemStageDefinitions } from "./site-brand";
|
|
4
|
+
|
|
5
|
+
const SEED_TIMESTAMP_BASE = Date.parse("2026-10-01T12:00:00.000Z");
|
|
6
|
+
const ONE_HOUR_IN_MILLISECONDS = 60 * 60 * 1000;
|
|
7
|
+
|
|
8
|
+
const SEED_CONTENT_ITEM_HEADLINES_BY_POSITION: readonly (readonly string[])[] = [
|
|
9
|
+
["Three sources confirm the zoning reversal", "Reporting packet: school board redistricting"],
|
|
10
|
+
["Draft in progress: the last ferry crossing", "Draft in progress: neighborhood bakery profile"],
|
|
11
|
+
["Illustration brief: flooded streets, aerial view", "Illustration brief: the market at dawn"],
|
|
12
|
+
["Layout pass: front page lead and rail", "Layout pass: the Saturday supplement"],
|
|
13
|
+
["Published: harbor safety review", "Published: the lighthouse keepers' archive"],
|
|
14
|
+
["Held for the winter issue: the lighthouse keepers' archive", "Evergreen: how the harbor dredging works"],
|
|
15
|
+
["Spiked: the unconfirmed council rumor", "Spiked: the recycled press release"],
|
|
16
|
+
];
|
|
17
|
+
|
|
18
|
+
function isoTimestampHoursBeforeBase(hours: number): string {
|
|
19
|
+
return new Date(SEED_TIMESTAMP_BASE - hours * ONE_HOUR_IN_MILLISECONDS).toISOString();
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function slugFromHeadline(headline: string): string {
|
|
23
|
+
return headline.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function createLocalPreviewContentItemVersions(): ContentItemVersionRecord[] {
|
|
27
|
+
const stageKeys = contentItemStageKeys(getContentItemStageDefinitions());
|
|
28
|
+
return stageKeys.flatMap((stageKey, stageIndex) => {
|
|
29
|
+
const headlines = SEED_CONTENT_ITEM_HEADLINES_BY_POSITION[stageIndex % SEED_CONTENT_ITEM_HEADLINES_BY_POSITION.length];
|
|
30
|
+
return headlines.map((headline, headlineIndex) => {
|
|
31
|
+
const slug = slugFromHeadline(headline);
|
|
32
|
+
return {
|
|
33
|
+
id: `preview-item-version-${stageKey}-${headlineIndex}`,
|
|
34
|
+
lineageId: `preview-item-lineage-${stageKey}-${headlineIndex}`,
|
|
35
|
+
versionNumber: 1,
|
|
36
|
+
stage: stageKey,
|
|
37
|
+
type: "article",
|
|
38
|
+
status: stageKey === "published" ? "published" : "draft",
|
|
39
|
+
title: headline,
|
|
40
|
+
headline,
|
|
41
|
+
slug,
|
|
42
|
+
section: headlineIndex === 0 ? "news" : "features",
|
|
43
|
+
updatedAt: isoTimestampHoursBeforeBase(stageIndex * 3 + headlineIndex),
|
|
44
|
+
};
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function createLocalPreviewReferences(): ReferenceRecord[] {
|
|
50
|
+
const curationStatuses = ["pending", "accepted", "accepted", "rejected", "pending"];
|
|
51
|
+
return curationStatuses.map((curationStatus, index) => ({
|
|
52
|
+
id: `preview-reference-${index}`,
|
|
53
|
+
lineageId: `preview-reference-lineage-${index}`,
|
|
54
|
+
versionNumber: 1,
|
|
55
|
+
versionState: "current",
|
|
56
|
+
corpusId: "preview-corpus",
|
|
57
|
+
externalItemId: `preview-source-${index}`,
|
|
58
|
+
title: `Source document ${index + 1}: municipal filing excerpt`,
|
|
59
|
+
curationStatus,
|
|
60
|
+
curationStatusKey: curationStatus,
|
|
61
|
+
curationStatusReason: curationStatus === "rejected" ? "Duplicate of an earlier filing." : null,
|
|
62
|
+
importedAt: isoTimestampHoursBeforeBase(index * 5),
|
|
63
|
+
updatedAt: isoTimestampHoursBeforeBase(index * 5),
|
|
64
|
+
}));
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export function createLocalPreviewAssignments(): AssignmentRecord[] {
|
|
68
|
+
const contentItemVersions = createLocalPreviewContentItemVersions();
|
|
69
|
+
const assignmentTypeKeys = ["research", "reporting", "copywriting"];
|
|
70
|
+
const statuses = ["queued", "claimed", "completed"];
|
|
71
|
+
const assignmentsOnContentItems = contentItemVersions.slice(0, 9).map((version, index) => ({
|
|
72
|
+
id: `preview-assignment-${index}`,
|
|
73
|
+
assignmentTypeKey: assignmentTypeKeys[index % assignmentTypeKeys.length],
|
|
74
|
+
queueKey: assignmentTypeKeys[index % assignmentTypeKeys.length],
|
|
75
|
+
queueStatusKey: `${assignmentTypeKeys[index % assignmentTypeKeys.length]}#${statuses[index % statuses.length]}`,
|
|
76
|
+
status: statuses[index % statuses.length],
|
|
77
|
+
priority: 2,
|
|
78
|
+
title: `${assignmentTypeKeys[index % assignmentTypeKeys.length]} for: ${version.headline}`,
|
|
79
|
+
itemLineageId: version.lineageId,
|
|
80
|
+
createdAt: isoTimestampHoursBeforeBase(index * 2),
|
|
81
|
+
updatedAt: isoTimestampHoursBeforeBase(index * 2),
|
|
82
|
+
}));
|
|
83
|
+
const assignmentsWithoutContentItem = ["Pitch: community radio partnership", "Backfill the archive index"].map((title, index) => ({
|
|
84
|
+
id: `preview-assignment-standalone-${index}`,
|
|
85
|
+
assignmentTypeKey: "research",
|
|
86
|
+
queueKey: "research",
|
|
87
|
+
queueStatusKey: "research#queued",
|
|
88
|
+
status: "queued",
|
|
89
|
+
priority: 2,
|
|
90
|
+
title,
|
|
91
|
+
createdAt: isoTimestampHoursBeforeBase(index),
|
|
92
|
+
updatedAt: isoTimestampHoursBeforeBase(index),
|
|
93
|
+
}));
|
|
94
|
+
return [...assignmentsOnContentItems, ...assignmentsWithoutContentItem];
|
|
95
|
+
}
|