@atelic-action/artifact 6.1.3 → 6.3.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/README.md CHANGED
@@ -7,7 +7,7 @@ The documents the practice hands or sends a business, as a published package and
7
7
 
8
8
  Three layers, each a version the next depends on (ATE-671): `@atelic-action/ui` holds the pieces, this package holds the documents built from them, and each business's folder holds only its content, routes, and config. A document fix reaches a folder by bumping this package; a piece fix by bumping ui here, then this package in the folder.
9
9
 
10
- Five artifacts live in the template site: the **read** at `/the-read`, the graded document a business gets from the practice, built from one snapshot at one of two depths (a prospect's, from public readings alone; a customer's, from their own consoles as well), a web page first with its printed copy derived from it, the grades explained by cause, the plan for the work set in a tab of its own ahead of the read, and the proposal in a tab of its own after it; the **proposal** at `/proposal`, the sealed page that stays for the proposals sent before the tab existed, opened by the reader's own email address; the **monthly page** at `/report`, what an Operate client gets each month on one letter sheet; the **note** at `/notes`, the first touch for a business whose site publishes no email address, set as a short page; and the **discovery sheet** at `/discovery`, the desk's page for the first conversation with a business, used to guide the call and not sent for now, written so it could be shared with them later. The bare host sends a reader to the read. Every artifact prerenders to static HTML, stays out of every index, and carries the practice's brand by default.
10
+ Five artifacts live in the template site: the **read** at `/the-read`, the graded document a business gets from the practice, built from one snapshot at one of two depths (a prospect's, from public readings alone; a customer's, from their own consoles as well), a web page first with its printed copy derived from it, the grades explained by cause, under a standard head (the dateline, the sources, the title and the lede the read sets from the business), with the situation, the plan, and the proposal each in a tab of its own ahead of the full read; the **proposal** at `/proposal`, the sealed page that stays for the proposals sent before the tab existed, opened by the reader's own email address; the **monthly page** at `/report`, what an Operate client gets each month on one letter sheet; the **note** at `/notes`, the first touch for a business whose site publishes no email address, set as a short page; and the **discovery sheet** at `/discovery`, the desk's page for the first conversation with a business, used to guide the call and not sent for now, written so it could be shared with them later. The bare host sends a reader to the read. Every artifact prerenders to static HTML, stays out of every index, and carries the practice's brand by default.
11
11
 
12
12
  The method behind them (the seven sections, the four grades from A to D, the rented line, what moved, and when an artifact is private) is the practice repo's `FOOTPRINT.md`. This repo builds to it and never restates it.
13
13
 
@@ -21,11 +21,13 @@ Every export of the package, all from the one entry, `@atelic-action/artifact`.
21
21
 
22
22
  | Export | What it is | Route |
23
23
  |---|---|---|
24
- | `TheRead`, `TheReadProps` | The graded document a business gets, built from one snapshot: the dated lede; the scorecard, a `ReportCard` with each row a link to its card and the earlier letter beside a row that moved, with an optional `note` callout over it for what the read leaves out; the plan's numbered steps between the scorecard and the cards when `plan` has any (superseded by the plan tab, and removed at the next major); then the tiers, each section on the card (the trade name linked to its definition, the one liner, the grade, the why line as the summary, the blocks, and the sources at the foot) plus the read's own today and after (a two column table) and what we recommend (a checklist), a tier opening on a `markets` table of letters and closing on the `rented` line when it has them; the closing line and the sign off. `access` says which depth it is (`"public"`, from public readings alone, or `"private"`, from the owner's consoles too), and a public read with no note gets the `publicNote` label over its scorecard. `print` adds the lockup and the twin's QR to the printed copy. A beat with no data is left out. The page is up to three tabs under the shared head: given a `planDocument`, The Plan comes first and opens first; The Read, which holds everything that sat between the head and the sign off, comes next; and given a `proposalDocument`, The Proposal comes last. With a proposal and no plan the page is two tabs, The Read then The Proposal, and the read opens first. The sign off stays under all of them, and the tab row's screen reader name, unless `labels` sets one, names the tabs present. The tabs are ui's `Tabs`, so a link or a hash naming a card in the read opens the read tab and lands on it, and on paper every panel prints in order, each after the first on a new page under its tab's name. `selectedTab` and `onSelectTab` let a route hold the open tab, for instance to swap the header's stops with it; left out, the plan tab opens first, or the read tab when there is no plan. With neither document the page is the one it always was | `/the-read` |
25
- | `readLabels`, `ReadLabels` | The fixed words the read sets (Prepared for, the scorecard's screen reader words, Before, Rented, Today, After, Recommendations, the plan's heading, the public note, the three tabs' names (`planTab`, `readTab`, `proposalTab`), and the tab row's name for a screen reader, which names the tabs present when left out), each overridable through `labels` | `/the-read` |
24
+ | `TheRead`, `TheReadProps` | The graded document a business gets, built from one snapshot: the dated lede; the scorecard, a `ReportCard` with each row a link to its card and the earlier letter beside a row that moved, with an optional `note` callout over it for what the read leaves out; the plan's numbered steps between the scorecard and the cards when `plan` has any (superseded by the plan tab, and removed at the next major); then the tiers, each section on the card (the trade name linked to its definition, the one liner, the grade, the why line as the summary, the blocks, and the sources at the foot) plus the read's own today and after (a two column table) and what we recommend (a checklist), a tier opening on a `markets` table of letters and closing on the `rented` line when it has them; the closing line and the sign off. `access` says which depth it is (`"public"`, from public readings alone, or `"private"`, from the owner's consoles too), and a public read with no note gets the `publicNote` label over its scorecard. `print` adds the lockup and the twin's QR to the printed copy. A beat with no data is left out. The head is the same for every business: `title` left out is the `overviewTitle` label and `preparedFor` ("Overview of Summit Movement Studio"), `lede` left out is the `overviewLede` label with the business in it, `sources` draws a Sources line under the dateline, the public sources then the private ones, each a link in a new tab, and `period` ("2026-08-01 to 2026-10-31", the window every reading on the page is read over) draws on the dateline after the date under the `periodLabel` word. The page is up to four tabs under that head, in a fixed order, each document tab present only when its document is: given a `stateDocument`, The Situation (the problems, by tier, each linked to its card); given a `planDocument`, The Plan; given a `proposalDocument`, The Proposal; and The Full Read, which holds everything that sat between the head and the sign off, always last. The first tab present opens. The sign off stays under all of them, and the tab row's screen reader name, unless `labels` sets one, names the tabs present. The tabs are ui's `Tabs`, so a link or a hash naming a card in the read opens the read tab and lands on it, and on paper every panel prints in order, each after the first on a new page under its tab's name. `selectedTab` and `onSelectTab` let a route hold the open tab, for instance to swap the header's stops with it. With no document the page is the one it always was | `/the-read` |
25
+ | `readLabels`, `ReadLabels` | The fixed words the read sets (Prepared for, the scorecard's screen reader words, Before, Rented, Today, After, Recommendations, the plan's heading, the public note, the standard head's words (`overviewTitle`, `overviewLede` with `{business}` in it, `periodLabel`, `sourcesLabel`, `publicSources`, `privateSources`), the four tabs' names (`stateTab`, `planTab`, `proposalTab`, `readTab`: The Situation, The Plan, The Proposal, The Full Read), and the tab row's name for a screen reader, which names the tabs present when left out), each overridable through `labels` | `/the-read` |
26
+ | `StateDocument` | The situation tab's document, the same shape as `PlanDocument`: the problems the read found, one section per tier (Health, Visibility, Conversion), each line linked to the card that shows it, so the plan answers them in the same order. Its panel wears `rd-state-doc` beside `rd-plan-doc`. Its `id` defaults to `theStateTabId` and its `title` to the `stateTab` label | `/the-read` |
27
+ | `ReadSources` | The sources the read was built from, for the Sources line: `public` links (the site, Google, PageSpeed, the AI answers) and the owner's `private` consoles | `/the-read` |
26
28
  | `PlanDocument`, `PlanSection`, `PlanPart`, `PlanBlock` | The shapes the plan tab is written in, all plain data, so a routine can write a plan as JSON. A plan is an optional lede and its sections; a section is an `id` (the anchor a header stop points at), a `heading`, an optional `timeline` line set small under the heading (when the work happens and whose it is), its blocks in order, and any parts, each a smaller heading with the same body. A block is a paragraph, a bulleted or numbered list, or a table with an optional head row, and every piece of text in one is a paragraph, so a link into the read is a run whose `href` is a card's anchor. A block with nothing in it is left out. On a phone a table's rows stack, each cell wearing its column's name | `/the-read` |
27
29
  | `ProposalDocument` | The proposal tab's document, the same shape as `PlanDocument`: what the owner gets, what it costs, the owner's own questions, and the next steps, with a line that rests on a finding linking to its card (What You Get, What It Costs, Your Questions, and Next Steps in the example). Its panel wears `rd-proposal-doc` beside `rd-plan-doc`, so the plan's styles dress it unchanged. Its `id` defaults to `theProposalTabId` and its `title` to the `proposalTab` label | `/the-read` |
28
- | `thePlanTabId`, `theReadTabId`, `theProposalTabId` | The three tabs' ids (`"plan"` and `"proposal"`, unless the document names its own, and `"read"`), so a route compares the open tab without a string of its own. No anchor on the page may share any of them | none |
30
+ | `theStateTabId`, `thePlanTabId`, `theProposalTabId`, `theReadTabId` | The four tabs' ids (`"state"`, `"plan"`, and `"proposal"`, unless the document names its own, and `"read"`), so a route compares the open tab without a string of its own. No anchor on the page may share any of them | none |
29
31
  | `ReadAccess`, `ReadTier`, `ReadSection`, `ReadChange`, `ReadRecommendation`, `ReadMarkets`, `ReadMarketRow`, `ReadRented`, `ReadStep`, `ReadPlan` (both superseded by the plan tab), `ReadClose`, `ReadPrint`, `ReadLink`, `ReadParagraph` | The shapes a read's content is written in. `ReadSection` is a `ReadTopic` plus `gist`, `before`, `changes`, and `recommend`; its `why`, a finding's `body`, a market row's `read`, and the rented `text` take a paragraph (a string, or runs of text and links) as well as a node, so a routine can write a read as JSON | none |
30
32
  | `Topic` | The section card on its own: the trade name linked to its definition, the one liner, the grade, the why line, the blocks, and the sources, with an `extra` slot after the blocks. The read renders every section through it | `/the-read` |
31
33
  | `ratingCell` | A star rating table cell for a `table` block, sorted by its figure | `/the-read` |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atelic-action/artifact",
3
- "version": "6.1.3",
3
+ "version": "6.3.0",
4
4
  "description": "The composed documents the Atelic practice hands or sends a business (the read, the monthly page, the note, the discovery sheet, and the sealed document), built from the pieces in @atelic-action/ui",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -43,16 +43,22 @@ import { isRuns, type ReadTopic, Topic } from "./Topic";
43
43
  * sender and recipient lockup where the header was, and the pointer to the
44
44
  * hosted twin with its QR under the sign off.
45
45
  *
46
- * A read may carry a plan document ahead of it and a proposal document after
47
- * it. Then the head stays on top, a row of tabs follows (The Plan, The Read,
48
- * The Proposal, each present only when its document is), and the sign off
49
- * stays at the foot under all of them. The plan tab holds the plan as a
50
- * document of its own: a lede, then sections, each a heading, an optional
51
- * timeline line, and paragraphs, lists, and tables, with parts under it. The
52
- * proposal tab holds the proposal in the same shape. The read tab holds
46
+ * The head is the same for every business: the dateline, the Sources line
47
+ * under it (the public sources, then the private ones, each a link), the
48
+ * title (Overview of the business, unless the content sets its own), and
49
+ * the lede (the standard sentence, unless the content sets its own).
50
+ *
51
+ * A read may carry up to three documents beside it, each a tab: the state
52
+ * (the problems, by tier), the plan (the fixes, by tier), and the proposal.
53
+ * Then the head stays on top, a row of tabs follows (The Situation, The Plan,
54
+ * The Proposal, The Full Read, each present only when its document is, the
55
+ * read always), the first present tab opens, and the sign off stays at the
56
+ * foot under all of them. A document tab holds a document of its own: a
57
+ * lede, then sections, each a heading, an optional timeline line, and
58
+ * paragraphs, lists, and tables, with parts under it. The read tab holds
53
59
  * everything that sat between the head and the foot before. On paper there
54
60
  * are no tabs: each document prints in order on a new page, under its tab's
55
- * name. With neither document the page is the one it always was.
61
+ * name. With no document the page is the one it always was.
56
62
  */
57
63
 
58
64
  /** Whether anything on the page came from the owner's own consoles. */
@@ -191,11 +197,11 @@ export interface PlanSection extends PlanPart {
191
197
  parts?: PlanPart[];
192
198
  }
193
199
 
194
- /** The plan as a document of its own, set in the plan tab ahead of the read. */
200
+ /** The plan as a document of its own, set in the plan tab ahead of the read. The state document and the proposal share its shape. */
195
201
  export interface PlanDocument {
196
- /** The tab's id, so `#plan` opens it; `thePlanTabId` when left out. Never the read tab's id. */
202
+ /** The tab's id, so `#plan` opens it; the tab's default id when left out. Never the read tab's id. */
197
203
  id?: string;
198
- /** The tab's name; the `planTab` label when left out. */
204
+ /** The tab's name; the tab's label when left out. */
199
205
  title?: string;
200
206
  /** A paragraph over the sections. */
201
207
  lede?: ReadParagraph;
@@ -211,9 +217,29 @@ export interface PlanDocument {
211
217
  */
212
218
  export type ProposalDocument = PlanDocument;
213
219
 
220
+ /**
221
+ * The state as a document of its own, the same shape as the plan, set in the
222
+ * first tab: the problems the read found, by tier (Health, Visibility,
223
+ * Conversion), each linked to the card that shows it, so the plan answers
224
+ * them in the same order. Its `id` defaults to `theStateTabId` and its
225
+ * `title` to the `stateTab` label.
226
+ */
227
+ export type StateDocument = PlanDocument;
228
+
229
+ /** The sources the read was built from, each a link: the public ones, then the private ones the owner opened. */
230
+ export interface ReadSources {
231
+ /** What anyone can open: the site, Google, PageSpeed, the AI answers. */
232
+ public: ReadLink[];
233
+ /** The owner's own consoles, when the read is private. */
234
+ private?: ReadLink[];
235
+ }
236
+
214
237
  /** The read tab's id, so a route holding the selected tab can tell the tabs apart. */
215
238
  export const theReadTabId = "read";
216
239
 
240
+ /** The state tab's id when the state document names none. */
241
+ export const theStateTabId = "state";
242
+
217
243
  /** The plan tab's id when the plan document names none. */
218
244
  export const thePlanTabId = "plan";
219
245
 
@@ -266,6 +292,20 @@ export interface ReadLabels {
266
292
  plan: string;
267
293
  /** The note over the scorecard on a public read that sets none: what the read leaves out. */
268
294
  publicNote: string;
295
+ /** The words before the business in the title the read sets when the content gives none, e.g. "Overview of". */
296
+ overviewTitle?: string;
297
+ /** The lede the read sets when the content gives none, with `{business}` standing for the business. */
298
+ overviewLede?: string;
299
+ /** The word before the period on the dateline, e.g. "Period". */
300
+ periodLabel?: string;
301
+ /** The word that opens the Sources line under the dateline. */
302
+ sourcesLabel?: string;
303
+ /** The word before the public sources on that line. */
304
+ publicSources?: string;
305
+ /** The word before the private sources on that line. */
306
+ privateSources?: string;
307
+ /** The state tab's name when the state document names none. */
308
+ stateTab?: string;
269
309
  /** The plan tab's name when the plan document names none. */
270
310
  planTab?: string;
271
311
  /** The read tab's name. */
@@ -291,29 +331,53 @@ export const readLabels: Required<ReadLabels> = {
291
331
  plan: "The Plan",
292
332
  publicNote:
293
333
  "This page is read from the outside, through what anyone can open. A customer's read adds what the owner's own consoles show.",
334
+ overviewTitle: "Overview of",
335
+ overviewLede:
336
+ "An overview of {business} prepared by Atelic. It holds a read of the current state of the site, in Health, Visibility, and Conversion, and a proposed plan for improvement.",
337
+ periodLabel: "Period",
338
+ sourcesLabel: "Sources",
339
+ publicSources: "Public",
340
+ privateSources: "Private",
341
+ stateTab: "The Situation",
294
342
  planTab: "The Plan",
295
- readTab: "The Read",
343
+ readTab: "The Full Read",
296
344
  proposalTab: "The Proposal",
297
- tabsLabel: "The plan and the read",
345
+ tabsLabel: "The plan and the full read",
298
346
  };
299
347
 
300
348
  /** What a screen reader calls the row of tabs when the labels name nothing: the tabs present, in order. */
301
- function defaultTabsLabel(plan: boolean, proposal: boolean): string {
302
- if (plan && proposal) return "The plan, the read, and the proposal";
303
- if (proposal) return "The read and the proposal";
304
- return readLabels.tabsLabel;
349
+ function defaultTabsLabel(state: boolean, plan: boolean, proposal: boolean): string {
350
+ if (plan && !state && !proposal) return readLabels.tabsLabel;
351
+ const present = [
352
+ ...(state ? ["the situation"] : []),
353
+ ...(plan ? ["the plan"] : []),
354
+ ...(proposal ? ["the proposal"] : []),
355
+ "the full read",
356
+ ];
357
+ const words =
358
+ present.length === 1
359
+ ? present[0]
360
+ : present.length === 2
361
+ ? present.join(" and ")
362
+ : `${present.slice(0, -1).join(", ")}, and ${present[present.length - 1]}`;
363
+ return words.charAt(0).toUpperCase() + words.slice(1);
305
364
  }
306
365
 
307
366
  export interface TheReadProps {
308
367
  /** Whether anything on the page came from the owner's own consoles; a private read deploys only behind the wall. */
309
368
  access: ReadAccess;
310
- title: string;
311
- /** The business, set in the dateline. */
369
+ /** The title; left out, the `overviewTitle` label and the business ("Overview of Summit Movement Studio"). */
370
+ title?: string;
371
+ /** The business, set in the dateline and in the title and the lede the read sets itself. */
312
372
  preparedFor: string;
313
373
  /** The ISO date, e.g. "2026-10-16". */
314
374
  date: string;
315
- /** Two or three sentences under the title. */
316
- lede: ReadParagraph;
375
+ /** The period every reading on the page is read over, e.g. "2026-08-01 to 2026-10-31"; drawn on the dateline after the date. */
376
+ period?: string;
377
+ /** Two or three sentences under the title; left out, the `overviewLede` label with the business in it. */
378
+ lede?: ReadParagraph;
379
+ /** The sources the read was built from, drawn as a line under the dateline: the public ones, then the private ones. */
380
+ sources?: ReadSources;
317
381
  /** The heading over the scorecard, e.g. "The Scorecard". */
318
382
  gistTitle?: string;
319
383
  /** The line under the scorecard's heading, e.g. what it is. Set only with a `gistTitle`, since it reads as the heading's subtitle. */
@@ -328,15 +392,17 @@ export interface TheReadProps {
328
392
  tiers: ReadTier[];
329
393
  /** The numbered steps between the scorecard and the cards. Superseded by `planDocument`, and to be removed at the next major. */
330
394
  plan: ReadPlan;
331
- /** The plan as a document of its own: set, the page becomes tabs, The Plan first and open, then The Read (and The Proposal, when set). */
395
+ /** The state as a document of its own: set, the page becomes tabs and The Situation comes first. */
396
+ stateDocument?: StateDocument;
397
+ /** The plan as a document of its own: set, the page becomes tabs and The Plan follows the state (or comes first without one). */
332
398
  planDocument?: PlanDocument;
333
399
  /**
334
- * The proposal as a document of its own: set, the page gains The Proposal
335
- * as its last tab. With no plan document the page is two tabs, The Read
336
- * then The Proposal, and the read opens first.
400
+ * The proposal as a document of its own: set, the page becomes tabs and
401
+ * The Proposal follows the plan, ahead of The Full Read, which always
402
+ * comes last.
337
403
  */
338
404
  proposalDocument?: ProposalDocument;
339
- /** Held by the caller: the open tab's id. Pass `onSelectTab` with it; left out, the plan tab opens first, or the read tab when there is no plan. */
405
+ /** Held by the caller: the open tab's id. Pass `onSelectTab` with it; left out, the first tab present opens (the state, the plan, the proposal, or the read). */
340
406
  selectedTab?: string;
341
407
  /** Called with a tab's id whenever the reader, a link, or a hash opens it, e.g. to swap the header's stops. */
342
408
  onSelectTab?: (id: string) => void;
@@ -700,7 +766,42 @@ function PlanBody({ part }: { part: PlanPart }) {
700
766
  );
701
767
  }
702
768
 
703
- /** A plan shaped tab's panel (the plan's or the proposal's): the lede, then each section under its heading, its parts under theirs. */
769
+ /** The Sources line under the dateline: the label, the public sources as links, then the private ones when there are any. */
770
+ function Sources({ sources, labels }: { sources: ReadSources; labels: ReadLabels }) {
771
+ const groups = [
772
+ {
773
+ name: "public",
774
+ label: labels.publicSources ?? readLabels.publicSources,
775
+ links: sources.public ?? [],
776
+ },
777
+ {
778
+ name: "private",
779
+ label: labels.privateSources ?? readLabels.privateSources,
780
+ links: sources.private ?? [],
781
+ },
782
+ ].filter((group) => group.links.length > 0);
783
+ if (groups.length === 0) return null;
784
+ return (
785
+ <p className="op-meta rd-sources">
786
+ <span className="rd-sources-label">{labels.sourcesLabel ?? readLabels.sourcesLabel}</span>
787
+ {groups.map((group) => (
788
+ <span className="rd-sources-group" key={group.name}>
789
+ <b>{group.label}</b>{" "}
790
+ {group.links.map((link, index) => (
791
+ <span key={`${group.name} ${link.href} ${link.text}`}>
792
+ {index > 0 && ", "}
793
+ <a href={link.href} {...newTabProps(link.href, true)}>
794
+ {link.text}
795
+ </a>
796
+ </span>
797
+ ))}
798
+ </span>
799
+ ))}
800
+ </p>
801
+ );
802
+ }
803
+
804
+ /** A document tab's panel (the state's, the plan's, or the proposal's): the lede, then each section under its heading, its parts under theirs. */
704
805
  function PlanDocumentView({ doc, className }: { doc: PlanDocument; className?: string }) {
705
806
  return (
706
807
  <div className={className ? `rd-plan-doc ${className}` : "rd-plan-doc"}>
@@ -755,7 +856,9 @@ export function TheRead({
755
856
  title,
756
857
  preparedFor,
757
858
  date,
859
+ period,
758
860
  lede,
861
+ sources,
759
862
  gistTitle,
760
863
  gistLead,
761
864
  gistId,
@@ -763,6 +866,7 @@ export function TheRead({
763
866
  gradeKey,
764
867
  tiers,
765
868
  plan,
869
+ stateDocument,
766
870
  planDocument,
767
871
  proposalDocument,
768
872
  selectedTab,
@@ -775,10 +879,36 @@ export function TheRead({
775
879
  const shownTiers = tiers.filter((tier) => tier.sections.length > 0);
776
880
  const shownNote = filled(note) ? note : access === "public" ? labels.publicNote : undefined;
777
881
  const signOff = Boolean(close.signOff && close.person);
778
- const planTab = planDocument?.id?.trim() || thePlanTabId;
779
- const proposalTab = proposalDocument?.id?.trim() || theProposalTabId;
882
+ const shownTitle =
883
+ title?.trim() || `${labels.overviewTitle ?? readLabels.overviewTitle} ${preparedFor}`;
884
+ const shownLede = filled(lede)
885
+ ? lede
886
+ : (labels.overviewLede ?? readLabels.overviewLede).replaceAll("{business}", preparedFor);
780
887
  const tabsLabel =
781
- overrides?.tabsLabel ?? defaultTabsLabel(Boolean(planDocument), Boolean(proposalDocument));
888
+ overrides?.tabsLabel ??
889
+ defaultTabsLabel(Boolean(stateDocument), Boolean(planDocument), Boolean(proposalDocument));
890
+ // The document tabs ahead of the read, in order, each present only when
891
+ // its document is: the state, the plan, the proposal.
892
+ const documents = [
893
+ {
894
+ doc: stateDocument,
895
+ id: stateDocument?.id?.trim() || theStateTabId,
896
+ label: labels.stateTab ?? readLabels.stateTab,
897
+ className: "rd-state-doc",
898
+ },
899
+ {
900
+ doc: planDocument,
901
+ id: planDocument?.id?.trim() || thePlanTabId,
902
+ label: labels.planTab ?? readLabels.planTab,
903
+ className: undefined,
904
+ },
905
+ {
906
+ doc: proposalDocument,
907
+ id: proposalDocument?.id?.trim() || theProposalTabId,
908
+ label: labels.proposalTab ?? readLabels.proposalTab,
909
+ className: "rd-proposal-doc",
910
+ },
911
+ ].filter((tab): tab is typeof tab & { doc: PlanDocument } => Boolean(tab.doc));
782
912
  // Everything between the head and the foot: the whole page without a plan
783
913
  // or a proposal document, the read tab's panel with either.
784
914
  const body = (
@@ -831,42 +961,36 @@ export function TheRead({
831
961
  {" · "}
832
962
  </span>
833
963
  <span className="op-meta-date">{date}</span>
964
+ {period?.trim() && (
965
+ <>
966
+ <span className="op-meta-sep" aria-hidden="true">
967
+ {" · "}
968
+ </span>
969
+ <span className="op-meta-period">
970
+ {labels.periodLabel ?? readLabels.periodLabel} <b>{period.trim()}</b>
971
+ </span>
972
+ </>
973
+ )}
834
974
  </p>
835
- <h1>{title}</h1>
836
- {filled(lede) && <Paragraph paragraph={lede} className="op-intro rd-lede" />}
975
+ {sources && <Sources sources={sources} labels={labels} />}
976
+ <h1>{shownTitle}</h1>
977
+ {filled(shownLede) && <Paragraph paragraph={shownLede} className="op-intro rd-lede" />}
837
978
  </header>
838
- {planDocument || proposalDocument ? (
979
+ {documents.length > 0 ? (
839
980
  <Tabs
840
981
  className="rd-tabs"
841
982
  ariaLabel={tabsLabel}
842
983
  headingLevel={2}
843
- defaultId={planDocument ? planTab : theReadTabId}
984
+ defaultId={documents[0].id}
844
985
  selectedId={selectedTab}
845
986
  onSelect={onSelectTab}
846
987
  tabs={[
847
- ...(planDocument
848
- ? [
849
- {
850
- id: planTab,
851
- label: planDocument.title?.trim() || (labels.planTab ?? readLabels.planTab),
852
- content: <PlanDocumentView doc={planDocument} />,
853
- },
854
- ]
855
- : []),
988
+ ...documents.map((tab) => ({
989
+ id: tab.id,
990
+ label: tab.doc.title?.trim() || tab.label,
991
+ content: <PlanDocumentView doc={tab.doc} className={tab.className} />,
992
+ })),
856
993
  { id: theReadTabId, label: labels.readTab ?? readLabels.readTab, content: body },
857
- ...(proposalDocument
858
- ? [
859
- {
860
- id: proposalTab,
861
- label:
862
- proposalDocument.title?.trim() ||
863
- (labels.proposalTab ?? readLabels.proposalTab),
864
- content: (
865
- <PlanDocumentView doc={proposalDocument} className="rd-proposal-doc" />
866
- ),
867
- },
868
- ]
869
- : []),
870
994
  ]}
871
995
  />
872
996
  ) : (
@@ -886,6 +886,24 @@
886
886
  .atelic-ui .op-meta-date {
887
887
  display: block;
888
888
  }
889
+ /* The read's Sources line, under the dateline in its dress: the label,
890
+ then the public sources and the private ones, wrapping onto new lines
891
+ as the width runs out. */
892
+ .atelic-ui .rd-sources {
893
+ display: flex;
894
+ flex-wrap: wrap;
895
+ gap: 2px 14px;
896
+ margin: -4px 0 14px;
897
+ }
898
+ .atelic-ui .rd-sources a {
899
+ color: inherit;
900
+ text-decoration: underline;
901
+ text-underline-offset: 2px;
902
+ text-decoration-thickness: 1px;
903
+ }
904
+ .atelic-ui .rd-sources a:hover {
905
+ color: var(--op-accent);
906
+ }
889
907
  .atelic-ui .op h1 {
890
908
  font-size: clamp(32px, 5vw, 44px);
891
909
  font-weight: 650;
@@ -2549,8 +2567,8 @@
2549
2567
  break-after: avoid;
2550
2568
  }
2551
2569
  /* Every panel prints in order, each after the first on a page of its
2552
- own (the read after the plan, the proposal after the read), each
2553
- under its tab's name, set as a tier's heading is. */
2570
+ own (the situation, the plan, the proposal, then the full read),
2571
+ each under its tab's name, set as a tier's heading is. */
2554
2572
  .atelic-ui .rd-tabs > .tabs-panel + .tabs-panel {
2555
2573
  break-before: page;
2556
2574
  margin-top: 0;