@atelic-action/artifact 6.3.1 → 6.4.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
@@ -25,7 +25,7 @@ Every export of the package, all from the one entry, `@atelic-action/artifact`.
25
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
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
27
  | `ReadSources` | The sources the read was built from, for the fine print's sources row: `public` links (the site, Google, PageSpeed, the AI answers) and the owner's `private` consoles | `/the-read` |
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` |
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, an icon list (each item led by an icon named from `planIcons`, `PlanIcon`, `PlanIconItem`, so a problem on the situation and its fix on the plan wear the same one), 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` |
29
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` |
30
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 |
31
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 |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atelic-action/artifact",
3
- "version": "6.3.1",
3
+ "version": "6.4.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",
@@ -12,7 +12,37 @@ import {
12
12
  type WriteupPerson,
13
13
  } from "@atelic-action/ui/artifact";
14
14
  import { IconList, ReportCard, Tabs, type Tone } from "@atelic-action/ui/components";
15
- import { ArrowUpRight, Check } from "lucide-react";
15
+ import {
16
+ Activity,
17
+ ArrowUpRight,
18
+ Braces,
19
+ CalendarCheck,
20
+ ChartLine,
21
+ Check,
22
+ Compass,
23
+ FileX,
24
+ Gauge,
25
+ KeyRound,
26
+ LayoutList,
27
+ Link,
28
+ type LucideIcon,
29
+ Map as MapIcon,
30
+ MapPin,
31
+ Megaphone,
32
+ MessageCircle,
33
+ Rocket,
34
+ Route,
35
+ ScanSearch,
36
+ Search,
37
+ Smartphone,
38
+ Sparkles,
39
+ Star,
40
+ Store,
41
+ Tag,
42
+ Target,
43
+ Users,
44
+ Wrench,
45
+ } from "lucide-react";
16
46
  import type { ReactNode } from "react";
17
47
  import { isRuns, type ReadTopic, Topic } from "./Topic";
18
48
 
@@ -182,8 +212,55 @@ export type PlanBlock =
182
212
  | { kind: "paragraph"; text: ReadParagraph }
183
213
  | { kind: "bullets"; items: ReadParagraph[] }
184
214
  | { kind: "numbered"; items: ReadParagraph[] }
215
+ | { kind: "icons"; items: PlanIconItem[] }
185
216
  | { kind: "table"; head?: string[]; rows: ReadParagraph[][] };
186
217
 
218
+ /**
219
+ * The icons a plan document's list may lead an item with, named by what the
220
+ * item touches, so the situation's problem and the plan's fix wear the same
221
+ * one: speed, a dead page, the index, search, the map, AI answers, ads, the
222
+ * weekly read, events, a booking, visitors, the one number, a price, a
223
+ * phone screen, a page, a town, a question, structured data, a review, a
224
+ * store, a key, a launch, a route, a link, a tool.
225
+ */
226
+ export const planIcons = {
227
+ gauge: Gauge,
228
+ "file-x": FileX,
229
+ "scan-search": ScanSearch,
230
+ search: Search,
231
+ "map-pin": MapPin,
232
+ sparkles: Sparkles,
233
+ megaphone: Megaphone,
234
+ "chart-line": ChartLine,
235
+ activity: Activity,
236
+ "calendar-check": CalendarCheck,
237
+ users: Users,
238
+ target: Target,
239
+ tag: Tag,
240
+ smartphone: Smartphone,
241
+ "layout-list": LayoutList,
242
+ map: MapIcon,
243
+ "message-circle": MessageCircle,
244
+ braces: Braces,
245
+ star: Star,
246
+ store: Store,
247
+ "key-round": KeyRound,
248
+ rocket: Rocket,
249
+ route: Route,
250
+ link: Link,
251
+ wrench: Wrench,
252
+ compass: Compass,
253
+ } satisfies Record<string, LucideIcon>;
254
+
255
+ /** The name of an icon in `planIcons`. */
256
+ export type PlanIcon = keyof typeof planIcons;
257
+
258
+ /** One item of an icon list: the icon it leads with, named, and the item itself. */
259
+ export interface PlanIconItem {
260
+ icon: PlanIcon;
261
+ text: ReadParagraph;
262
+ }
263
+
187
264
  /** A part of a plan section: a smaller heading under the section's, with its own body. */
188
265
  export interface PlanPart {
189
266
  /** The anchor a header stop or a link points at, e.g. "month-one". */
@@ -716,6 +793,24 @@ function PlanBlockView({ block }: { block: PlanBlock | undefined | null }) {
716
793
  </List>
717
794
  );
718
795
  }
796
+ if (block.kind === "icons") {
797
+ const items = (block.items ?? []).filter((item) => item && filled(item.text));
798
+ if (items.length === 0) return null;
799
+ return (
800
+ <IconList
801
+ className="rd-plan-icons"
802
+ items={items.map((item) => {
803
+ const Icon = Object.hasOwn(planIcons, item.icon)
804
+ ? planIcons[item.icon as PlanIcon]
805
+ : undefined;
806
+ return {
807
+ icon: Icon ? <Icon size={16} strokeWidth={2} /> : undefined,
808
+ body: <Runs paragraph={item.text} />,
809
+ };
810
+ })}
811
+ />
812
+ );
813
+ }
719
814
  if (block.kind === "table") {
720
815
  const rows = (block.rows ?? []).filter((row) => (row ?? []).some(filled));
721
816
  if (rows.length === 0) return null;
@@ -2469,6 +2469,16 @@
2469
2469
  .atelic-ui .rd-plan-list li::marker {
2470
2470
  color: var(--op-accent);
2471
2471
  }
2472
+ /* An icon list in a plan document: ui's IconList, the icons in the accent
2473
+ as the bullets are, each item a problem or a fix. */
2474
+ .atelic-ui .rd-plan-icons {
2475
+ margin: 12px 0 0;
2476
+ gap: 10px;
2477
+ color: var(--op-ink);
2478
+ }
2479
+ .atelic-ui .rd-plan-icons .icon-list-bullet {
2480
+ color: var(--op-accent);
2481
+ }
2472
2482
  .atelic-ui .rd-plan-table {
2473
2483
  margin-top: 14px;
2474
2484
  }
@@ -2583,6 +2593,7 @@
2583
2593
  .atelic-ui .rd-changes-table tr,
2584
2594
  .atelic-ui .rd-plan-table tr,
2585
2595
  .atelic-ui .rd-plan-list li,
2596
+ .atelic-ui .rd-plan-icons li,
2586
2597
  .atelic-ui .rd-checks li,
2587
2598
  .atelic-ui .rd-closing,
2588
2599
  .atelic-ui .rd-note,