@supersuit/artifacts 0.13.0 → 0.14.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/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.14.0 (2026-09-28)
7
+
8
+ **A page can say who it is for.** `to: Isaiah` in front matter reads "For Isaiah" in three
9
+ places: after the kicker on the page (not spoken), in the link preview's title ("For Isaiah:
10
+ <title>", og:title, twitter:title and <title>), and as a line above the title on the share card.
11
+ 1 to 60 characters, one line; a republish without it clears it. Past versions keep the name they
12
+ were published with. `audience:` is unchanged: stored, never shown.
13
+
14
+ - DETECTOR: a page with `to:` whose preview does not name the reader.
15
+ - REMEDY: bump; publishers must forward `to`.
16
+ - Tests: parse and refusals, store round trip and clear-on-omit, the kicker on open, password,
17
+ gated and version pages, the three metadata titles, the share card markup and PNG, narration
18
+ leaving the name out. Metadata title, share card prop and clear-on-omit mutation-checked.
19
+
6
20
  ## 0.13.0 (2026-09-28)
7
21
 
8
22
  **A publisher can hear about new comments, and every comment has a link to itself.**
package/README.md CHANGED
@@ -149,9 +149,10 @@ summary: Three bets, what each costs, and what we stop doing to afford them.
149
149
  | `title` (required) | The large line, and the unfurl title |
150
150
  | `summary` (required) | The italic teaser under it, and the unfurl description |
151
151
  | `subtitle` | A line between the two. A republish without it removes it |
152
+ | `to` | Who the page is for, e.g. `to: Marisol`. Shows as "For Marisol" after the kicker, leads the unfurl title ("For Marisol: <title>") and gets its own line on the share card. Never read aloud, and not an access control. One line, 1 to 60 characters; a republish without it removes it |
153
+ | `audience` | Free text stored with the page, never shown |
152
154
  | `id` | Republish in place instead of minting a new page |
153
155
  | `cover` | An image URL (absolute or site-relative) used as the unfurl image instead of the share card |
154
- | `audience` | Free text stored with the page |
155
156
  | `voice`, `narration`, `timings`, `narrationHash` | Read-aloud: the audio and word timings a publisher generated. Absent (or the timings will not load), the page is read by the browser's own voice instead, lighting the same words; a browser with no `speechSynthesis` shows no player |
156
157
  | `password` | Shuts the body behind a door (below) |
157
158
  | `access` | `freedom`, `invite` or `public`: a confidential page (below) |
@@ -10,6 +10,10 @@ export type ArtifactMeta = {
10
10
  /** A line under the title. Title, subtitle and summary are three separate fields; the summary
11
11
  * is the teaser, and the unfurl carries the title and the summary. */
12
12
  subtitle?: string;
13
+ /** Who the page is for ("For <name>" in the kicker, the unfurl title and the share card). A
14
+ * label, not an access control: a republish without it removes it. Never spoken. Distinct from
15
+ * `audience`, which is stored and never shown. */
16
+ to?: string;
13
17
  audience?: string;
14
18
  cover?: string;
15
19
  id?: string;
@@ -47,6 +51,8 @@ export type ArtifactMeta = {
47
51
  /** Who sees shared comments: `owner` (the default) or every reader (`readers`). */
48
52
  commentsVisible?: CommentsVisible;
49
53
  };
54
+ /** The longest `to:` a page may carry: a name or two, never a sentence. */
55
+ export declare const MAX_TO_CHARS = 60;
50
56
  export declare function parseArtifactSource(text: string): {
51
57
  ok: true;
52
58
  meta: ArtifactMeta;
@@ -7,7 +7,9 @@ import { mergeWidgetState, scanWidgets } from './widgets.js';
7
7
  import { COMMENTS_MODES, mergeCommentsState } from './comments.js';
8
8
  import { THEME_MODES } from '../brand/theme.js';
9
9
  import { parseDefinitions } from './definitions.js';
10
- const KNOWN = new Set(['title', 'summary', 'subtitle', 'template', 'audience', 'cover', 'id', 'voice', 'narration', 'timings', 'narrationHash', 'password', 'access', 'state', 'theme', 'toc', 'definitions', 'change', 'comments', 'comments_visible']);
10
+ /** The longest `to:` a page may carry: a name or two, never a sentence. */
11
+ export const MAX_TO_CHARS = 60;
12
+ const KNOWN = new Set(['title', 'summary', 'subtitle', 'to', 'template', 'audience', 'cover', 'id', 'voice', 'narration', 'timings', 'narrationHash', 'password', 'access', 'state', 'theme', 'toc', 'definitions', 'change', 'comments', 'comments_visible']);
11
13
  export function parseArtifactSource(text) {
12
14
  const { data, content } = matter(text);
13
15
  const d = data;
@@ -33,6 +35,12 @@ export function parseArtifactSource(text) {
33
35
  if (typeof v === 'string' && v)
34
36
  meta[k] = v;
35
37
  }
38
+ if (d.to !== undefined && d.to !== null) {
39
+ const to = typeof d.to === 'string' ? d.to.trim() : '';
40
+ if (!to || to.length > MAX_TO_CHARS || /[\r\n]/.test(to))
41
+ return { ok: false, error: `to must be one line naming who the page is for, 1 to ${MAX_TO_CHARS} characters` };
42
+ meta.to = to;
43
+ }
36
44
  if (d.change !== undefined && d.change !== null) {
37
45
  if (typeof d.change !== 'string')
38
46
  return { ok: false, error: 'change must be one line of text' };
@@ -11,6 +11,8 @@ export type ArtifactRecord = {
11
11
  summary: string;
12
12
  template: 'document';
13
13
  subtitle?: string;
14
+ /** Who the page is for; see ArtifactMeta.to. */
15
+ to?: string;
14
16
  audience?: string;
15
17
  cover?: string;
16
18
  voice?: string;
@@ -54,6 +56,7 @@ export type VersionRecord = VersionEntry & {
54
56
  markdown: string;
55
57
  title?: string;
56
58
  subtitle?: string;
59
+ to?: string;
57
60
  summary?: string;
58
61
  };
59
62
  /** A change note is one line: whitespace collapsed, capped, empty means none. */
@@ -76,7 +76,7 @@ async function versionOf(col, id, n) {
76
76
  const cur = currentOf(a);
77
77
  if (n === cur) {
78
78
  return { version: n, at: a.updatedAt, markdown: a.markdown, title: a.title, summary: a.summary, current: true,
79
- ...(a.subtitle ? { subtitle: a.subtitle } : {}), ...(a.note ? { note: a.note } : {}) };
79
+ ...(a.subtitle ? { subtitle: a.subtitle } : {}), ...(a.to ? { to: a.to } : {}), ...(a.note ? { note: a.note } : {}) };
80
80
  }
81
81
  if (n > cur)
82
82
  return null;
@@ -123,6 +123,7 @@ async function saveArtifact(col, input) {
123
123
  summary: input.meta.summary,
124
124
  template: input.meta.template,
125
125
  ...(input.meta.subtitle ? { subtitle: input.meta.subtitle } : {}),
126
+ ...(input.meta.to ? { to: input.meta.to } : {}),
126
127
  ...(input.meta.audience ? { audience: input.meta.audience } : {}),
127
128
  ...(input.meta.cover ? { cover: input.meta.cover } : {}),
128
129
  ...(input.meta.voice ? { voice: input.meta.voice } : {}),
@@ -161,7 +162,7 @@ async function saveArtifact(col, input) {
161
162
  await history.doc(vid(current)).set({
162
163
  version: current, markdown: existing.markdown, at: existing.updatedAt,
163
164
  title: existing.title, summary: existing.summary,
164
- ...(existing.subtitle ? { subtitle: existing.subtitle } : {}), ...(existing.note ? { note: existing.note } : {}),
165
+ ...(existing.subtitle ? { subtitle: existing.subtitle } : {}), ...(existing.to ? { to: existing.to } : {}), ...(existing.note ? { note: existing.note } : {}),
165
166
  });
166
167
  }
167
168
  const next = fresh ? current + 1 : current;
@@ -170,6 +171,8 @@ async function saveArtifact(col, input) {
170
171
  const password = input.meta.password ? {} : { password: FieldValue.delete() };
171
172
  // A subtitle the file no longer carries is gone from the page, like any other content.
172
173
  const subtitle = input.meta.subtitle ? {} : { subtitle: FieldValue.delete() };
174
+ // Who it is for is a label on the content, never an access control: absent clears it.
175
+ const to = input.meta.to ? {} : { to: FieldValue.delete() };
173
176
  // Access is the opposite of password on purpose: absent leaves it alone, and only an explicit
174
177
  // `access: public` opens the page. Reopening a confidential page must never be a side effect.
175
178
  const access = input.meta.access === 'public' ? { access: FieldValue.delete() } : {};
@@ -186,7 +189,7 @@ async function saveArtifact(col, input) {
186
189
  ...(input.meta.commentsVisible ? {} : { commentsVisible: FieldValue.delete() }),
187
190
  };
188
191
  await ref.update({
189
- ...fields, ...password, ...subtitle, ...access, ...state, ...look, markdown: input.markdown, version: next,
192
+ ...fields, ...password, ...subtitle, ...to, ...access, ...state, ...look, markdown: input.markdown, version: next,
190
193
  // `updatedAt` is when this version went live; finishing its own publish does not move it.
191
194
  ...(fresh || input.markdown !== existing.markdown ? { updatedAt: now } : {}),
192
195
  note: nextNote ?? FieldValue.delete(),
@@ -3,11 +3,14 @@ export declare const SHARE_W = 1200;
3
3
  export declare const SHARE_H = 630;
4
4
  /** Titles get smaller as they get longer, so three lines always fit above the mark. */
5
5
  export declare function titleSize(title: string): number;
6
- export declare function ShareCard({ pack, title, fontName, backdrop }: {
6
+ export declare function ShareCard({ pack, title, to, fontName, backdrop }: {
7
7
  pack: BrandPack;
8
8
  title: string;
9
+ to?: string;
9
10
  fontName: string;
10
11
  backdrop?: string;
11
12
  }): import("react").JSX.Element;
12
13
  /** A 1200x630 PNG for one page. Caller has already checked `pack.share` exists. */
13
- export declare function renderShareCard(pack: BrandPack, title: string): Promise<Response>;
14
+ export declare function renderShareCard(pack: BrandPack, title: string, opts?: {
15
+ to?: string;
16
+ }): Promise<Response>;
@@ -24,8 +24,9 @@ export function titleSize(title) {
24
24
  return 62;
25
25
  return 52;
26
26
  }
27
- export function ShareCard({ pack, title, fontName, backdrop }) {
27
+ export function ShareCard({ pack, title, to, fontName, backdrop }) {
28
28
  const size = titleSize(title);
29
+ const kicker = { display: 'flex', fontSize: 22, letterSpacing: 5, textTransform: 'uppercase', color: pack.accent, fontWeight: 500 };
29
30
  return (_jsxs("div", { style: {
30
31
  display: 'flex',
31
32
  flexDirection: 'column',
@@ -36,12 +37,12 @@ export function ShareCard({ pack, title, fontName, backdrop }) {
36
37
  ...(backdrop ? { backgroundImage: `url(${backdrop})`, backgroundSize: `${SHARE_W}px ${SHARE_H}px` } : {}),
37
38
  color: pack.ink,
38
39
  fontFamily: fontName,
39
- }, children: [_jsx("div", { style: { display: 'flex', fontSize: 22, letterSpacing: 5, textTransform: 'uppercase', color: pack.accent, fontWeight: 500 }, children: pack.kicker }), _jsx("div", { style: { display: 'flex', marginTop: 28, fontSize: size, lineHeight: 1.18, maxWidth: 980, lineClamp: 3 }, children: title })] }));
40
+ }, children: [_jsx("div", { style: kicker, children: pack.kicker }), to ? _jsx("div", { style: { ...kicker, marginTop: 12, lineHeight: 1.4 }, children: `For ${to}` }) : null, _jsx("div", { style: { display: 'flex', marginTop: 28, fontSize: size, lineHeight: 1.18, maxWidth: 980, lineClamp: 3 }, children: title })] }));
40
41
  }
41
42
  /** A 1200x630 PNG for one page. Caller has already checked `pack.share` exists. */
42
- export async function renderShareCard(pack, title) {
43
+ export async function renderShareCard(pack, title, opts = {}) {
43
44
  const { font, backdrop } = await assetsFor(pack);
44
- return new ImageResponse(_jsx(ShareCard, { pack: pack, title: title, fontName: font.name, backdrop: backdrop }), {
45
+ return new ImageResponse(_jsx(ShareCard, { pack: pack, title: title, to: opts.to, fontName: font.name, backdrop: backdrop }), {
45
46
  width: SHARE_W,
46
47
  height: SHARE_H,
47
48
  fonts: [{ name: font.name, data: font.data, weight: font.weight, style: 'normal' }],
@@ -66,6 +66,11 @@ export function createArtifactRoutes(config) {
66
66
  store, state: config.state, personal: config.personal, readers: config.readers, assets: config.assets, transcribe: config.transcribe,
67
67
  readerSecret, pageUrl, signInOrigin, siteUrl, clientIp: config.clientIp,
68
68
  });
69
+ /** The kicker over every title: the pack's line, then who the page is for. Never spoken: the
70
+ * whole paragraph is data-nospeak, and narrationText has no `to` to read. */
71
+ function Kicker({ to }) {
72
+ return (_jsxs("p", { "data-nospeak": true, className: "mb-4 text-[11px] font-medium uppercase tracking-[0.3em]", style: { color: brand.accent }, children: [brand.kicker, to ? _jsx("span", { "data-nospeak": true, "data-to": true, children: ` · For ${to}` }) : null] }));
73
+ }
69
74
  async function generateMetadata({ params }) {
70
75
  const { id } = await params;
71
76
  const a = ARTIFACT_ID.test(id) ? await store.get(id) : null;
@@ -73,13 +78,15 @@ export function createArtifactRoutes(config) {
73
78
  return { title: 'Not found', robots: { index: false, follow: false } };
74
79
  const url = pageUrl(a.id);
75
80
  const image = absolute(a.cover) ?? (brand.share ? shareCardUrl(a.id, a.updatedAt) : absolute(config.defaultShareImage));
81
+ // Who it is for leads the unfurl, so a thread shows it before the reader opens anything.
82
+ const title = a.to ? `For ${a.to}: ${a.title}` : a.title;
76
83
  return {
77
- title: a.title,
84
+ title,
78
85
  description: a.summary,
79
86
  alternates: { canonical: pagePath(a.id) },
80
87
  robots: { index: false, follow: false },
81
88
  openGraph: {
82
- title: a.title,
89
+ title,
83
90
  description: a.summary,
84
91
  url,
85
92
  siteName: brand.name,
@@ -88,7 +95,7 @@ export function createArtifactRoutes(config) {
88
95
  },
89
96
  twitter: {
90
97
  card: image ? 'summary_large_image' : 'summary',
91
- title: a.title,
98
+ title,
92
99
  description: a.summary,
93
100
  ...(image ? { images: [image] } : {}),
94
101
  },
@@ -145,7 +152,7 @@ export function createArtifactRoutes(config) {
145
152
  ];
146
153
  const remember = paths.length ? paths.map((p) => `document.cookie=${JSON.stringify(unlockLine(p))}`).join(';') : null;
147
154
  if (!open) {
148
- return (_jsxs(BrandGround, { pack: pack, mode: a.theme, children: [_jsxs("div", { className: "mx-auto max-w-2xl px-6 pt-24 pb-8 text-center sm:pt-28", children: [_jsx("p", { "data-nospeak": true, className: "mb-4 text-[11px] font-medium uppercase tracking-[0.3em]", style: { color: brand.accent }, children: brand.kicker }), _jsx("h1", { className: "text-4xl sm:text-5xl", style: { fontFamily: brand.type.display, color: brand.ink }, children: a.title }), a.subtitle ? (_jsx("p", { className: "mx-auto mt-4 max-w-xl text-xl sm:text-2xl", style: { fontFamily: brand.type.display, color: brand.ink }, children: a.subtitle })) : null, _jsx("p", { className: "mx-auto mt-6 max-w-xl text-lg italic opacity-80", children: a.summary })] }), _jsx(ArtifactDoor, { brand: brand, wrongKey: key !== undefined })] }));
155
+ return (_jsxs(BrandGround, { pack: pack, mode: a.theme, children: [_jsxs("div", { className: "mx-auto max-w-2xl px-6 pt-24 pb-8 text-center sm:pt-28", children: [_jsx(Kicker, { to: a.to }), _jsx("h1", { className: "text-4xl sm:text-5xl", style: { fontFamily: brand.type.display, color: brand.ink }, children: a.title }), a.subtitle ? (_jsx("p", { className: "mx-auto mt-4 max-w-xl text-xl sm:text-2xl", style: { fontFamily: brand.type.display, color: brand.ink }, children: a.subtitle })) : null, _jsx("p", { className: "mx-auto mt-6 max-w-xl text-lg italic opacity-80", children: a.summary })] }), _jsx(ArtifactDoor, { brand: brand, wrongKey: key !== undefined })] }));
149
156
  }
150
157
  // Who is reading an open page, when they happen to be signed in: their comments follow them.
151
158
  // Only a host that signs readers in can know one; the read never fails the page.
@@ -164,7 +171,7 @@ export function createArtifactRoutes(config) {
164
171
  const reader = readerSecret() ? verifyGrant(readerSecret(), await readCookie(GRANT_COOKIE).catch(() => undefined)) : null;
165
172
  const allow = config.readers && reader ? await config.readers.allowList(id) : [];
166
173
  const d = config.readers ? decide(a.access, reader, allow) : { open: false, why: 'signed-out' };
167
- const header = (_jsxs("div", { className: "mx-auto max-w-2xl px-6 pt-24 pb-8 text-center sm:pt-28", children: [_jsx("p", { "data-nospeak": true, className: "mb-4 text-[11px] font-medium uppercase tracking-[0.3em]", style: { color: brand.accent }, children: brand.kicker }), _jsx("h1", { className: "text-4xl sm:text-5xl", style: { fontFamily: brand.type.display, color: brand.ink }, children: a.title }), a.subtitle ? (_jsx("p", { className: "mx-auto mt-4 max-w-xl text-xl sm:text-2xl", style: { fontFamily: brand.type.display, color: brand.ink }, children: a.subtitle })) : null, _jsx("p", { className: "mx-auto mt-6 max-w-xl text-lg italic opacity-80", children: a.summary })] }));
174
+ const header = (_jsxs("div", { className: "mx-auto max-w-2xl px-6 pt-24 pb-8 text-center sm:pt-28", children: [_jsx(Kicker, { to: a.to }), _jsx("h1", { className: "text-4xl sm:text-5xl", style: { fontFamily: brand.type.display, color: brand.ink }, children: a.title }), a.subtitle ? (_jsx("p", { className: "mx-auto mt-4 max-w-xl text-xl sm:text-2xl", style: { fontFamily: brand.type.display, color: brand.ink }, children: a.subtitle })) : null, _jsx("p", { className: "mx-auto mt-6 max-w-xl text-lg italic opacity-80", children: a.summary })] }));
168
175
  if (!d.open) {
169
176
  if (d.why === 'not-allowed' && config.readers)
170
177
  void config.readers.flag({ artifactId: id, reader: d.reader, kind: 'refused' }).catch(() => { });
@@ -205,7 +212,7 @@ export function createArtifactRoutes(config) {
205
212
  const title = v.title ?? a.title;
206
213
  const summary = v.summary ?? a.summary;
207
214
  const toc = showToc(v.markdown, a.toc) ? tocOf(v.markdown) : [];
208
- return (_jsxs(_Fragment, { children: [toc.length ? _jsx(TocRail, { items: toc }) : null, _jsx("div", { "data-nospeak": true, className: `mx-auto max-w-2xl px-6 ${top ? 'pt-20 sm:pt-24' : 'pt-8'}`, children: _jsxs("p", { "data-version-banner": true, role: "status", className: "rounded-lg border px-4 py-3 text-sm", style: { borderColor: brand.accent }, children: [`You are reading version ${n} of ${of}. `, _jsx("a", { href: pagePath(a.id), className: "underline underline-offset-4", style: { color: brand.accent }, children: "Read the current version" })] }) }), _jsxs("div", { className: `mx-auto max-w-2xl px-6 ${top ? 'pt-10 sm:pt-12' : 'pt-10'} pb-8 text-center`, children: [_jsx("p", { "data-nospeak": true, className: "mb-4 text-[11px] font-medium uppercase tracking-[0.3em]", style: { color: brand.accent }, children: brand.kicker }), _jsx("h1", { className: "text-4xl sm:text-5xl", style: { fontFamily: brand.type.display, color: brand.ink }, children: title }), v.subtitle ? (_jsx("p", { className: "mx-auto mt-4 max-w-xl text-xl sm:text-2xl", style: { fontFamily: brand.type.display, color: brand.ink }, children: v.subtitle })) : null, _jsx("p", { className: "mx-auto mt-6 max-w-xl text-lg italic opacity-80", children: summary }), _jsx(VersionLine, { a: a, n: n, at: v.at, history: history })] }), _jsxs("article", { className: "mx-auto max-w-2xl px-6 pb-24", children: [toc.length ? _jsx(TocInline, { items: toc }) : null, _jsx(ArtifactMarkdown, { markdown: v.markdown, definitions: a.definitions })] })] }));
215
+ return (_jsxs(_Fragment, { children: [toc.length ? _jsx(TocRail, { items: toc }) : null, _jsx("div", { "data-nospeak": true, className: `mx-auto max-w-2xl px-6 ${top ? 'pt-20 sm:pt-24' : 'pt-8'}`, children: _jsxs("p", { "data-version-banner": true, role: "status", className: "rounded-lg border px-4 py-3 text-sm", style: { borderColor: brand.accent }, children: [`You are reading version ${n} of ${of}. `, _jsx("a", { href: pagePath(a.id), className: "underline underline-offset-4", style: { color: brand.accent }, children: "Read the current version" })] }) }), _jsxs("div", { className: `mx-auto max-w-2xl px-6 ${top ? 'pt-10 sm:pt-12' : 'pt-10'} pb-8 text-center`, children: [_jsx(Kicker, { to: v.to }), _jsx("h1", { className: "text-4xl sm:text-5xl", style: { fontFamily: brand.type.display, color: brand.ink }, children: title }), v.subtitle ? (_jsx("p", { className: "mx-auto mt-4 max-w-xl text-xl sm:text-2xl", style: { fontFamily: brand.type.display, color: brand.ink }, children: v.subtitle })) : null, _jsx("p", { className: "mx-auto mt-6 max-w-xl text-lg italic opacity-80", children: summary }), _jsx(VersionLine, { a: a, n: n, at: v.at, history: history })] }), _jsxs("article", { className: "mx-auto max-w-2xl px-6 pb-24", children: [toc.length ? _jsx(TocInline, { items: toc }) : null, _jsx(ArtifactMarkdown, { markdown: v.markdown, definitions: a.definitions })] })] }));
209
216
  }
210
217
  /** The page itself, shared by open and gated pages. */
211
218
  async function Body(a, { top, reader }) {
@@ -223,7 +230,7 @@ export function createArtifactRoutes(config) {
223
230
  const toc = showToc(a.markdown, a.toc) ? tocOf(a.markdown) : [];
224
231
  // Shared comments need the page to take them AND a host that keeps answers; personal notes need neither.
225
232
  const mode = config.state && a.state && a.comments && a.comments !== 'off' && a.state.slots[COMMENTS_SLOT] ? a.comments : 'off';
226
- return (_jsxs(_Fragment, { children: [toc.length ? _jsx(TocRail, { items: toc }) : null, _jsxs("div", { id: "artifact-narration-root", children: [_jsxs("div", { className: `mx-auto max-w-2xl px-6 ${top ? 'pt-24 sm:pt-28' : 'pt-12'} pb-8 text-center`, children: [_jsx("p", { "data-nospeak": true, className: "mb-4 text-[11px] font-medium uppercase tracking-[0.3em]", style: { color: brand.accent }, children: brand.kicker }), _jsx("h1", { className: "text-4xl sm:text-5xl", style: { fontFamily: brand.type.display, color: brand.ink }, children: a.title }), a.subtitle ? (_jsx("p", { className: "mx-auto mt-4 max-w-xl text-xl sm:text-2xl", style: { fontFamily: brand.type.display, color: brand.ink }, children: a.subtitle })) : null, _jsx("p", { className: "mx-auto mt-6 max-w-xl text-lg italic opacity-80", children: a.summary }), _jsx(VersionLine, { a: a, n: a.version ?? (a.versions?.length ?? 0) + 1, at: a.updatedAt, history: await historyOf(a.id) })] }), a.cover ? (_jsx("div", { className: "mx-auto max-w-2xl px-6 pb-8", children: _jsx("img", { src: a.cover, alt: "", className: "w-full rounded-xl border border-[color:var(--a-line)]" }) })) : null, _jsxs("article", { className: "mx-auto max-w-2xl px-6 pb-24", children: [toc.length ? _jsx(TocInline, { items: toc }) : null, _jsx(ArtifactMarkdown, { markdown: a.markdown, definitions: a.definitions, notes: config.state && a.state ? { artifactId: a.id, accent: brand.accent } : undefined })] })] }), _jsx(CommentLayer, { artifactId: a.id, rootId: "artifact-narration-root", ownerName: owner, comments: mode, canShare: mode !== 'off' && (reader !== null || effectiveWriters(a.state, a.access, COMMENTS_SLOT) === 'anyone'), signedIn: reader !== null, isOwner: !!reader && !!ownerEmail && reader.email === ownerEmail, version: a.version ?? (a.versions?.length ?? 0) + 1, accent: brand.accent, ground: brand.ground, signIn: signInOrigin ? signInUrl(signInOrigin, pageUrl(a.id)) : null }), a.narration && words.length > 0 ? (_jsx(ArtifactReader, { src: a.narration, words: words, rootId: "artifact-narration-root", label: brand.narratorLabel(a.voice), accent: brand.accent, ground: brand.ground })) : (
233
+ return (_jsxs(_Fragment, { children: [toc.length ? _jsx(TocRail, { items: toc }) : null, _jsxs("div", { id: "artifact-narration-root", children: [_jsxs("div", { className: `mx-auto max-w-2xl px-6 ${top ? 'pt-24 sm:pt-28' : 'pt-12'} pb-8 text-center`, children: [_jsx(Kicker, { to: a.to }), _jsx("h1", { className: "text-4xl sm:text-5xl", style: { fontFamily: brand.type.display, color: brand.ink }, children: a.title }), a.subtitle ? (_jsx("p", { className: "mx-auto mt-4 max-w-xl text-xl sm:text-2xl", style: { fontFamily: brand.type.display, color: brand.ink }, children: a.subtitle })) : null, _jsx("p", { className: "mx-auto mt-6 max-w-xl text-lg italic opacity-80", children: a.summary }), _jsx(VersionLine, { a: a, n: a.version ?? (a.versions?.length ?? 0) + 1, at: a.updatedAt, history: await historyOf(a.id) })] }), a.cover ? (_jsx("div", { className: "mx-auto max-w-2xl px-6 pb-8", children: _jsx("img", { src: a.cover, alt: "", className: "w-full rounded-xl border border-[color:var(--a-line)]" }) })) : null, _jsxs("article", { className: "mx-auto max-w-2xl px-6 pb-24", children: [toc.length ? _jsx(TocInline, { items: toc }) : null, _jsx(ArtifactMarkdown, { markdown: a.markdown, definitions: a.definitions, notes: config.state && a.state ? { artifactId: a.id, accent: brand.accent } : undefined })] })] }), _jsx(CommentLayer, { artifactId: a.id, rootId: "artifact-narration-root", ownerName: owner, comments: mode, canShare: mode !== 'off' && (reader !== null || effectiveWriters(a.state, a.access, COMMENTS_SLOT) === 'anyone'), signedIn: reader !== null, isOwner: !!reader && !!ownerEmail && reader.email === ownerEmail, version: a.version ?? (a.versions?.length ?? 0) + 1, accent: brand.accent, ground: brand.ground, signIn: signInOrigin ? signInUrl(signInOrigin, pageUrl(a.id)) : null }), a.narration && words.length > 0 ? (_jsx(ArtifactReader, { src: a.narration, words: words, rootId: "artifact-narration-root", label: brand.narratorLabel(a.voice), accent: brand.accent, ground: brand.ground })) : (
227
234
  // No recorded narration, or its timings would not load: the browser reads the page.
228
235
  _jsx(BrowserReader, { rootId: "artifact-narration-root", accent: brand.accent, ground: brand.ground }))] }));
229
236
  }
@@ -497,7 +504,7 @@ export function createArtifactRoutes(config) {
497
504
  const a = ARTIFACT_ID.test(id) ? await store.get(id) : null;
498
505
  if (!a)
499
506
  return new NextResponse(`no artifact with id ${id}`, { status: 404 });
500
- return renderShareCard(pack, a.title);
507
+ return renderShareCard(pack, a.title, { to: a.to });
501
508
  }
502
509
  /** GET|POST /api/artifacts/<id>/versions, publish key: the history, and a note written onto one
503
510
  * version after the fact. POST body: { version: number, note: string | null }. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@supersuit/artifacts",
3
- "version": "0.13.0",
3
+ "version": "0.14.0",
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",