@atelic-action/artifact 6.0.0 → 6.1.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 +6 -5
- package/package.json +1 -1
- package/src/documents/TheRead.tsx +73 -23
- package/src/documents/documents.css +2 -1
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,
|
|
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.
|
|
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,10 +21,11 @@ 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.
|
|
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
|
|
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` |
|
|
26
26
|
| `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
|
-
| `
|
|
27
|
+
| `ProposalDocument` | The proposal tab's document, the same shape as `PlanDocument`: what success looks like, the measures (a table whose first cell links each measure to the card it rests on), the terms, and the next steps. 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 |
|
|
28
29
|
| `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 |
|
|
29
30
|
| `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` |
|
|
30
31
|
| `ratingCell` | A star rating table cell for a `table` block, sorted by its figure | `/the-read` |
|
|
@@ -38,7 +39,7 @@ Every export of the package, all from the one entry, `@atelic-action/artifact`.
|
|
|
38
39
|
| `discoveryLabels`, `DiscoveryLabels` | The fixed words the sheet sets (Show, Ask, Move, the close's who else decides beat, and the rest), each overridable through `labels` | `/discovery` |
|
|
39
40
|
| `discoverySectionIds` | The ids the page takes for itself (the shell's `main`, the brief, the open, the close), which a unit's `id` must not repeat; the content test checks it | none |
|
|
40
41
|
| `DiscoveryFact`, `DiscoveryStep`, `DiscoveryShow`, `DiscoveryUnit`, `DiscoveryParagraph` | The shapes a discovery sheet's content is written in, all plain data, so a skill writes the sheet as JSON | none |
|
|
41
|
-
| `Gate`, `GateProps`, `GatePayload`, `GatePerson` | The sealed document, opened in the browser by the reader's own address, and the payload it opens | `/proposal` |
|
|
42
|
+
| `Gate`, `GateProps`, `GatePayload`, `GatePerson` | The sealed document, opened in the browser by the reader's own address, and the payload it opens; the proposals sent before the read's proposal tab existed live here | `/proposal` |
|
|
42
43
|
| `normalizeEmail` | How a typed address becomes the key a payload opens with; the sealing command mirrors it | none |
|
|
43
44
|
| `documents.css` | The documents' styles, at `@atelic-action/artifact/styles/documents.css` | every route |
|
|
44
45
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atelic-action/artifact",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.1.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,15 +43,16 @@ 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
|
|
47
|
-
* a row of
|
|
48
|
-
*
|
|
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
|
|
49
50
|
* document of its own: a lede, then sections, each a heading, an optional
|
|
50
51
|
* timeline line, and paragraphs, lists, and tables, with parts under it. The
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
* one it always was.
|
|
52
|
+
* proposal tab holds the proposal in the same shape. The read tab holds
|
|
53
|
+
* everything that sat between the head and the foot before. On paper there
|
|
54
|
+
* 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.
|
|
55
56
|
*/
|
|
56
57
|
|
|
57
58
|
/** Whether anything on the page came from the owner's own consoles. */
|
|
@@ -201,12 +202,24 @@ export interface PlanDocument {
|
|
|
201
202
|
sections: PlanSection[];
|
|
202
203
|
}
|
|
203
204
|
|
|
204
|
-
/**
|
|
205
|
+
/**
|
|
206
|
+
* The proposal as a document of its own, the same shape as the plan
|
|
207
|
+
* (sections, parts, blocks), set in the proposal tab after the read: what
|
|
208
|
+
* success looks like, the measures, the terms, and the next steps, with a
|
|
209
|
+
* measure that rests on a finding linking to its card. Its `id` defaults to
|
|
210
|
+
* `theProposalTabId` and its `title` to the `proposalTab` label.
|
|
211
|
+
*/
|
|
212
|
+
export type ProposalDocument = PlanDocument;
|
|
213
|
+
|
|
214
|
+
/** The read tab's id, so a route holding the selected tab can tell the tabs apart. */
|
|
205
215
|
export const theReadTabId = "read";
|
|
206
216
|
|
|
207
217
|
/** The plan tab's id when the plan document names none. */
|
|
208
218
|
export const thePlanTabId = "plan";
|
|
209
219
|
|
|
220
|
+
/** The proposal tab's id when the proposal document names none. */
|
|
221
|
+
export const theProposalTabId = "proposal";
|
|
222
|
+
|
|
210
223
|
/** The close: one line, then the sign off. */
|
|
211
224
|
export interface ReadClose {
|
|
212
225
|
/** One sentence, e.g. what follows and when. */
|
|
@@ -257,7 +270,9 @@ export interface ReadLabels {
|
|
|
257
270
|
planTab?: string;
|
|
258
271
|
/** The read tab's name. */
|
|
259
272
|
readTab?: string;
|
|
260
|
-
/**
|
|
273
|
+
/** The proposal tab's name when the proposal document names none. */
|
|
274
|
+
proposalTab?: string;
|
|
275
|
+
/** What a screen reader calls the row of tabs; left out, it names the tabs present. */
|
|
261
276
|
tabsLabel?: string;
|
|
262
277
|
}
|
|
263
278
|
|
|
@@ -278,9 +293,17 @@ export const readLabels: Required<ReadLabels> = {
|
|
|
278
293
|
"This page is read from the outside, through what anyone can open. A customer's read adds what the owner's own consoles show.",
|
|
279
294
|
planTab: "The Plan",
|
|
280
295
|
readTab: "The Read",
|
|
296
|
+
proposalTab: "The Proposal",
|
|
281
297
|
tabsLabel: "The plan and the read",
|
|
282
298
|
};
|
|
283
299
|
|
|
300
|
+
/** 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;
|
|
305
|
+
}
|
|
306
|
+
|
|
284
307
|
export interface TheReadProps {
|
|
285
308
|
/** Whether anything on the page came from the owner's own consoles; a private read deploys only behind the wall. */
|
|
286
309
|
access: ReadAccess;
|
|
@@ -305,9 +328,15 @@ export interface TheReadProps {
|
|
|
305
328
|
tiers: ReadTier[];
|
|
306
329
|
/** The numbered steps between the scorecard and the cards. Superseded by `planDocument`, and to be removed at the next major. */
|
|
307
330
|
plan: ReadPlan;
|
|
308
|
-
/** The plan as a document of its own: set, the page becomes
|
|
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). */
|
|
309
332
|
planDocument?: PlanDocument;
|
|
310
|
-
/**
|
|
333
|
+
/**
|
|
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.
|
|
337
|
+
*/
|
|
338
|
+
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. */
|
|
311
340
|
selectedTab?: string;
|
|
312
341
|
/** Called with a tab's id whenever the reader, a link, or a hash opens it, e.g. to swap the header's stops. */
|
|
313
342
|
onSelectTab?: (id: string) => void;
|
|
@@ -671,10 +700,10 @@ function PlanBody({ part }: { part: PlanPart }) {
|
|
|
671
700
|
);
|
|
672
701
|
}
|
|
673
702
|
|
|
674
|
-
/**
|
|
675
|
-
function PlanDocumentView({ doc }: { doc: PlanDocument }) {
|
|
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. */
|
|
704
|
+
function PlanDocumentView({ doc, className }: { doc: PlanDocument; className?: string }) {
|
|
676
705
|
return (
|
|
677
|
-
<div className="rd-plan-doc">
|
|
706
|
+
<div className={className ? `rd-plan-doc ${className}` : "rd-plan-doc"}>
|
|
678
707
|
{filled(doc.lede) && <Paragraph paragraph={doc.lede} className="rd-plan-doc-lede" />}
|
|
679
708
|
{(doc.sections ?? []).filter(Boolean).map((section) => (
|
|
680
709
|
<section className="rd-plan-section" id={section.id} key={section.id}>
|
|
@@ -735,6 +764,7 @@ export function TheRead({
|
|
|
735
764
|
tiers,
|
|
736
765
|
plan,
|
|
737
766
|
planDocument,
|
|
767
|
+
proposalDocument,
|
|
738
768
|
selectedTab,
|
|
739
769
|
onSelectTab,
|
|
740
770
|
close,
|
|
@@ -746,8 +776,11 @@ export function TheRead({
|
|
|
746
776
|
const shownNote = filled(note) ? note : access === "public" ? labels.publicNote : undefined;
|
|
747
777
|
const signOff = Boolean(close.signOff && close.person);
|
|
748
778
|
const planTab = planDocument?.id?.trim() || thePlanTabId;
|
|
779
|
+
const proposalTab = proposalDocument?.id?.trim() || theProposalTabId;
|
|
780
|
+
const tabsLabel =
|
|
781
|
+
overrides?.tabsLabel ?? defaultTabsLabel(Boolean(planDocument), Boolean(proposalDocument));
|
|
749
782
|
// Everything between the head and the foot: the whole page without a plan
|
|
750
|
-
// document, the read tab's panel with
|
|
783
|
+
// or a proposal document, the read tab's panel with either.
|
|
751
784
|
const body = (
|
|
752
785
|
<>
|
|
753
786
|
{shownTiers.length > 0 && (
|
|
@@ -802,21 +835,38 @@ export function TheRead({
|
|
|
802
835
|
<h1>{title}</h1>
|
|
803
836
|
{filled(lede) && <Paragraph paragraph={lede} className="op-intro rd-lede" />}
|
|
804
837
|
</header>
|
|
805
|
-
{planDocument ? (
|
|
838
|
+
{planDocument || proposalDocument ? (
|
|
806
839
|
<Tabs
|
|
807
840
|
className="rd-tabs"
|
|
808
|
-
ariaLabel={
|
|
841
|
+
ariaLabel={tabsLabel}
|
|
809
842
|
headingLevel={2}
|
|
810
|
-
defaultId={planTab}
|
|
843
|
+
defaultId={planDocument ? planTab : theReadTabId}
|
|
811
844
|
selectedId={selectedTab}
|
|
812
845
|
onSelect={onSelectTab}
|
|
813
846
|
tabs={[
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
847
|
+
...(planDocument
|
|
848
|
+
? [
|
|
849
|
+
{
|
|
850
|
+
id: planTab,
|
|
851
|
+
label: planDocument.title?.trim() || (labels.planTab ?? readLabels.planTab),
|
|
852
|
+
content: <PlanDocumentView doc={planDocument} />,
|
|
853
|
+
},
|
|
854
|
+
]
|
|
855
|
+
: []),
|
|
819
856
|
{ 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
|
+
: []),
|
|
820
870
|
]}
|
|
821
871
|
/>
|
|
822
872
|
) : (
|
|
@@ -2548,7 +2548,8 @@
|
|
|
2548
2548
|
.atelic-ui .rd-tabs .tabs-print-heading {
|
|
2549
2549
|
break-after: avoid;
|
|
2550
2550
|
}
|
|
2551
|
-
/*
|
|
2551
|
+
/* 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
|
|
2552
2553
|
under its tab's name, set as a tier's heading is. */
|
|
2553
2554
|
.atelic-ui .rd-tabs > .tabs-panel + .tabs-panel {
|
|
2554
2555
|
break-before: page;
|