@supersuit/artifacts 0.7.0 → 0.7.1

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/CHANGELOG.md CHANGED
@@ -3,6 +3,20 @@
3
3
  `@supersuit/artifacts`. One entry per version, newest first. Each entry says what changed, how a
4
4
  host can tell whether it is affected (DETECTOR), what a host does about it (REMEDY), and the tests.
5
5
 
6
+ ## 0.7.1 (2026-09-27)
7
+
8
+ **The narrator reads the subtitle.** `narrationText` built the spoken text from the title, the
9
+ summary and the body, while the page renders a `subtitle:` between the title and the summary with
10
+ no `data-nospeak`. So the audio skipped the page's first line under the title, and the highlighter
11
+ expected words the narration never said.
12
+
13
+ - `narrationText` takes an optional `subtitle` and reads it second; the narration-text route
14
+ passes it.
15
+ - DETECTOR: a page with a `subtitle:` whose audio goes straight from the title to the summary.
16
+ - REMEDY: bump, then republish the page so its narration is regenerated (the spoken text changed,
17
+ so the narration hash no longer matches and the publisher re-narrates).
18
+ - Tests: `narration.test.ts` pins title, subtitle, summary, body order.
19
+
6
20
  ## 0.7.0 (2026-09-27)
7
21
 
8
22
  **A real version history: every page names its version, lists every version with its change note,
@@ -1,6 +1,7 @@
1
1
  export declare function narrationTextFromMarkdown(markdown: string): string;
2
2
  export declare function narrationText(input: {
3
3
  title: string;
4
+ subtitle?: string;
4
5
  summary: string;
5
6
  markdown: string;
6
7
  }): string;
@@ -76,8 +76,12 @@ export function narrationTextFromMarkdown(markdown) {
76
76
  blocks(tree.children, out);
77
77
  return clean(out);
78
78
  }
79
+ // The subtitle renders between the title and the summary with no data-nospeak, so the
80
+ // highlighter expects it there; leaving it out made the narrator skip the page's first line.
79
81
  export function narrationText(input) {
80
- return [input.title.trim(), input.summary.trim(), narrationTextFromMarkdown(input.markdown)].filter(Boolean).join('\n');
82
+ return [input.title.trim(), (input.subtitle ?? '').trim(), input.summary.trim(), narrationTextFromMarkdown(input.markdown)]
83
+ .filter(Boolean)
84
+ .join('\n');
81
85
  }
82
86
  /** Tokens the highlighter and the timings agree on: whitespace-split, lowercased, letters and digits only. */
83
87
  export function normalizeWord(w) {
@@ -391,7 +391,7 @@ export function createArtifactRoutes(config) {
391
391
  const a = await store.get(id);
392
392
  if (!a)
393
393
  return NextResponse.json({ error: `no artifact with id ${id}` }, { status: 404 });
394
- return NextResponse.json({ id, text: narrationText({ title: a.title, summary: a.summary, markdown: a.markdown }) });
394
+ return NextResponse.json({ id, text: narrationText({ title: a.title, subtitle: a.subtitle, summary: a.summary, markdown: a.markdown }) });
395
395
  }
396
396
  /** PUT /api/artifacts/<id>/assets/<name>: raw bytes in, public URL out. 16 MiB cap. */
397
397
  async function PUT_ASSET(request, { params }) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@supersuit/artifacts",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "description": "Publish markdown as branded, read-aloud pages from a Next.js app: the artifacts store, the route factory, the read-along reader, brand packs, password and confidential pages, and share cards.",
5
5
  "license": "MIT",
6
6
  "type": "module",