@atelic-action/artifact 6.1.3 → 6.2.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, and `sources` draws a Sources line under the dateline, the public sources then the private ones, each a link in a new tab. 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, `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.2.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,18 @@ 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 that opens the Sources line under the dateline. */
300
+ sourcesLabel?: string;
301
+ /** The word before the public sources on that line. */
302
+ publicSources?: string;
303
+ /** The word before the private sources on that line. */
304
+ privateSources?: string;
305
+ /** The state tab's name when the state document names none. */
306
+ stateTab?: string;
269
307
  /** The plan tab's name when the plan document names none. */
270
308
  planTab?: string;
271
309
  /** The read tab's name. */
@@ -291,29 +329,50 @@ export const readLabels: Required<ReadLabels> = {
291
329
  plan: "The Plan",
292
330
  publicNote:
293
331
  "This page is read from the outside, through what anyone can open. A customer's read adds what the owner's own consoles show.",
332
+ overviewTitle: "Overview of",
333
+ overviewLede:
334
+ "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.",
335
+ sourcesLabel: "Sources",
336
+ publicSources: "Public",
337
+ privateSources: "Private",
338
+ stateTab: "The Situation",
294
339
  planTab: "The Plan",
295
- readTab: "The Read",
340
+ readTab: "The Full Read",
296
341
  proposalTab: "The Proposal",
297
- tabsLabel: "The plan and the read",
342
+ tabsLabel: "The plan and the full read",
298
343
  };
299
344
 
300
345
  /** 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;
346
+ function defaultTabsLabel(state: boolean, plan: boolean, proposal: boolean): string {
347
+ if (plan && !state && !proposal) return readLabels.tabsLabel;
348
+ const present = [
349
+ ...(state ? ["the situation"] : []),
350
+ ...(plan ? ["the plan"] : []),
351
+ ...(proposal ? ["the proposal"] : []),
352
+ "the full read",
353
+ ];
354
+ const words =
355
+ present.length === 1
356
+ ? present[0]
357
+ : present.length === 2
358
+ ? present.join(" and ")
359
+ : `${present.slice(0, -1).join(", ")}, and ${present[present.length - 1]}`;
360
+ return words.charAt(0).toUpperCase() + words.slice(1);
305
361
  }
306
362
 
307
363
  export interface TheReadProps {
308
364
  /** Whether anything on the page came from the owner's own consoles; a private read deploys only behind the wall. */
309
365
  access: ReadAccess;
310
- title: string;
311
- /** The business, set in the dateline. */
366
+ /** The title; left out, the `overviewTitle` label and the business ("Overview of Summit Movement Studio"). */
367
+ title?: string;
368
+ /** The business, set in the dateline and in the title and the lede the read sets itself. */
312
369
  preparedFor: string;
313
370
  /** The ISO date, e.g. "2026-10-16". */
314
371
  date: string;
315
- /** Two or three sentences under the title. */
316
- lede: ReadParagraph;
372
+ /** Two or three sentences under the title; left out, the `overviewLede` label with the business in it. */
373
+ lede?: ReadParagraph;
374
+ /** The sources the read was built from, drawn as a line under the dateline: the public ones, then the private ones. */
375
+ sources?: ReadSources;
317
376
  /** The heading over the scorecard, e.g. "The Scorecard". */
318
377
  gistTitle?: string;
319
378
  /** 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 +387,17 @@ export interface TheReadProps {
328
387
  tiers: ReadTier[];
329
388
  /** The numbered steps between the scorecard and the cards. Superseded by `planDocument`, and to be removed at the next major. */
330
389
  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). */
390
+ /** The state as a document of its own: set, the page becomes tabs and The Situation comes first. */
391
+ stateDocument?: StateDocument;
392
+ /** 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
393
  planDocument?: PlanDocument;
333
394
  /**
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.
395
+ * The proposal as a document of its own: set, the page becomes tabs and
396
+ * The Proposal follows the plan, ahead of The Full Read, which always
397
+ * comes last.
337
398
  */
338
399
  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. */
400
+ /** 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
401
  selectedTab?: string;
341
402
  /** 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
403
  onSelectTab?: (id: string) => void;
@@ -700,7 +761,42 @@ function PlanBody({ part }: { part: PlanPart }) {
700
761
  );
701
762
  }
702
763
 
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. */
764
+ /** The Sources line under the dateline: the label, the public sources as links, then the private ones when there are any. */
765
+ function Sources({ sources, labels }: { sources: ReadSources; labels: ReadLabels }) {
766
+ const groups = [
767
+ {
768
+ name: "public",
769
+ label: labels.publicSources ?? readLabels.publicSources,
770
+ links: sources.public ?? [],
771
+ },
772
+ {
773
+ name: "private",
774
+ label: labels.privateSources ?? readLabels.privateSources,
775
+ links: sources.private ?? [],
776
+ },
777
+ ].filter((group) => group.links.length > 0);
778
+ if (groups.length === 0) return null;
779
+ return (
780
+ <p className="op-meta rd-sources">
781
+ <span className="rd-sources-label">{labels.sourcesLabel ?? readLabels.sourcesLabel}</span>
782
+ {groups.map((group) => (
783
+ <span className="rd-sources-group" key={group.name}>
784
+ <b>{group.label}</b>{" "}
785
+ {group.links.map((link, index) => (
786
+ <span key={`${group.name} ${link.href} ${link.text}`}>
787
+ {index > 0 && ", "}
788
+ <a href={link.href} {...newTabProps(link.href, true)}>
789
+ {link.text}
790
+ </a>
791
+ </span>
792
+ ))}
793
+ </span>
794
+ ))}
795
+ </p>
796
+ );
797
+ }
798
+
799
+ /** 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
800
  function PlanDocumentView({ doc, className }: { doc: PlanDocument; className?: string }) {
705
801
  return (
706
802
  <div className={className ? `rd-plan-doc ${className}` : "rd-plan-doc"}>
@@ -756,6 +852,7 @@ export function TheRead({
756
852
  preparedFor,
757
853
  date,
758
854
  lede,
855
+ sources,
759
856
  gistTitle,
760
857
  gistLead,
761
858
  gistId,
@@ -763,6 +860,7 @@ export function TheRead({
763
860
  gradeKey,
764
861
  tiers,
765
862
  plan,
863
+ stateDocument,
766
864
  planDocument,
767
865
  proposalDocument,
768
866
  selectedTab,
@@ -775,10 +873,36 @@ export function TheRead({
775
873
  const shownTiers = tiers.filter((tier) => tier.sections.length > 0);
776
874
  const shownNote = filled(note) ? note : access === "public" ? labels.publicNote : undefined;
777
875
  const signOff = Boolean(close.signOff && close.person);
778
- const planTab = planDocument?.id?.trim() || thePlanTabId;
779
- const proposalTab = proposalDocument?.id?.trim() || theProposalTabId;
876
+ const shownTitle =
877
+ title?.trim() || `${labels.overviewTitle ?? readLabels.overviewTitle} ${preparedFor}`;
878
+ const shownLede = filled(lede)
879
+ ? lede
880
+ : (labels.overviewLede ?? readLabels.overviewLede).replaceAll("{business}", preparedFor);
780
881
  const tabsLabel =
781
- overrides?.tabsLabel ?? defaultTabsLabel(Boolean(planDocument), Boolean(proposalDocument));
882
+ overrides?.tabsLabel ??
883
+ defaultTabsLabel(Boolean(stateDocument), Boolean(planDocument), Boolean(proposalDocument));
884
+ // The document tabs ahead of the read, in order, each present only when
885
+ // its document is: the state, the plan, the proposal.
886
+ const documents = [
887
+ {
888
+ doc: stateDocument,
889
+ id: stateDocument?.id?.trim() || theStateTabId,
890
+ label: labels.stateTab ?? readLabels.stateTab,
891
+ className: "rd-state-doc",
892
+ },
893
+ {
894
+ doc: planDocument,
895
+ id: planDocument?.id?.trim() || thePlanTabId,
896
+ label: labels.planTab ?? readLabels.planTab,
897
+ className: undefined,
898
+ },
899
+ {
900
+ doc: proposalDocument,
901
+ id: proposalDocument?.id?.trim() || theProposalTabId,
902
+ label: labels.proposalTab ?? readLabels.proposalTab,
903
+ className: "rd-proposal-doc",
904
+ },
905
+ ].filter((tab): tab is typeof tab & { doc: PlanDocument } => Boolean(tab.doc));
782
906
  // Everything between the head and the foot: the whole page without a plan
783
907
  // or a proposal document, the read tab's panel with either.
784
908
  const body = (
@@ -832,41 +956,25 @@ export function TheRead({
832
956
  </span>
833
957
  <span className="op-meta-date">{date}</span>
834
958
  </p>
835
- <h1>{title}</h1>
836
- {filled(lede) && <Paragraph paragraph={lede} className="op-intro rd-lede" />}
959
+ {sources && <Sources sources={sources} labels={labels} />}
960
+ <h1>{shownTitle}</h1>
961
+ {filled(shownLede) && <Paragraph paragraph={shownLede} className="op-intro rd-lede" />}
837
962
  </header>
838
- {planDocument || proposalDocument ? (
963
+ {documents.length > 0 ? (
839
964
  <Tabs
840
965
  className="rd-tabs"
841
966
  ariaLabel={tabsLabel}
842
967
  headingLevel={2}
843
- defaultId={planDocument ? planTab : theReadTabId}
968
+ defaultId={documents[0].id}
844
969
  selectedId={selectedTab}
845
970
  onSelect={onSelectTab}
846
971
  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
- : []),
972
+ ...documents.map((tab) => ({
973
+ id: tab.id,
974
+ label: tab.doc.title?.trim() || tab.label,
975
+ content: <PlanDocumentView doc={tab.doc} className={tab.className} />,
976
+ })),
856
977
  { 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
978
  ]}
871
979
  />
872
980
  ) : (
@@ -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;