@marktiderman/genesis-sites 0.1.0 → 0.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.
Files changed (47) hide show
  1. package/README.md +152 -8
  2. package/dist/assets/islands.77d11f5697.js +1 -0
  3. package/dist/assets/sites-forms.4e6aa42497.css +10 -0
  4. package/dist/assets/sites-forms.css +1 -1
  5. package/dist/assets/sites.css +1 -1
  6. package/dist/assets/sites.e1ffd2708b.css +2 -0
  7. package/dist/blocks.d.ts +1 -1
  8. package/dist/blocks.js +5 -1
  9. package/dist/blocks.js.map +1 -1
  10. package/dist/chunk-3VKTBE7S.js +69 -0
  11. package/dist/chunk-3VKTBE7S.js.map +1 -0
  12. package/dist/chunk-C375ZPU2.js +2241 -0
  13. package/dist/chunk-C375ZPU2.js.map +1 -0
  14. package/dist/{chunk-GA7U3CIN.js → chunk-IXMY4B56.js} +229 -10
  15. package/dist/chunk-IXMY4B56.js.map +1 -0
  16. package/dist/chunk-VZUDRPFG.js +13 -0
  17. package/dist/chunk-VZUDRPFG.js.map +1 -0
  18. package/dist/{chunk-KEF3V5ZN.js → chunk-ZGWGQGT2.js} +169 -73
  19. package/dist/chunk-ZGWGQGT2.js.map +1 -0
  20. package/dist/import.d.ts +130 -0
  21. package/dist/import.js +330 -0
  22. package/dist/import.js.map +1 -0
  23. package/dist/index.d.ts +40 -7
  24. package/dist/index.js +5 -3
  25. package/dist/index.js.map +1 -1
  26. package/dist/{registry-CdgVymsu.d.ts → registry-D_DCWRTc.d.ts} +274 -8
  27. package/dist/sections.d.ts +422 -6
  28. package/dist/sections.js +4 -2
  29. package/dist/{store-BzGw2i5J.d.ts → store-DkSycDhq.d.ts} +119 -53
  30. package/dist/supabase.d.ts +5 -5
  31. package/dist/supabase.js +115 -6
  32. package/dist/supabase.js.map +1 -1
  33. package/dist/web.d.ts +26 -8
  34. package/dist/web.js +142 -18
  35. package/dist/web.js.map +1 -1
  36. package/migrations/0001_genesis_sites.sql +64 -6
  37. package/migrations/0002_genesis_sites_posts.sql +404 -0
  38. package/migrations/tests/0001_genesis_sites.test.sql +30 -1
  39. package/migrations/tests/0002_genesis_sites_posts.test.sql +242 -0
  40. package/package.json +18 -10
  41. package/dist/assets/islands.230b20b9c4.js +0 -1
  42. package/dist/assets/sites-forms.5e6ebf31c3.css +0 -10
  43. package/dist/assets/sites.b28b796c6f.css +0 -2
  44. package/dist/chunk-43XUAO63.js +0 -1255
  45. package/dist/chunk-43XUAO63.js.map +0 -1
  46. package/dist/chunk-GA7U3CIN.js.map +0 -1
  47. package/dist/chunk-KEF3V5ZN.js.map +0 -1
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { S as SectionNode, P as PageDoc, A as AnySectionDefinition, a as SiteDoc, R as ReleasePage, b as Redirect, L as Link, c as SiteDocInput, d as PageKind } from './registry-CdgVymsu.js';
2
- export { B as BUILT_IN_SECTION_TYPES, e as BuiltInSectionType, C as Copy, F as FontChoice, f as FormsResolver, g as FormsResolverContext, H as Href, I as Image, h as Line, M as MAX_DOC_BYTES, i as MenuItem, j as PageMeta, k as PagePath, l as RegisterSectionOptions, m as Release, n as ReleaseMeta, o as ReleaseSnapshot, p as RenderContext, q as ResolvedForm, r as RichText, s as SECTION_CATEGORIES, t as SectionCategory, u as SectionDefinition, v as SectionDefinitionError, w as SectionId, x as SectionManifest, y as SectionPlacement, z as SectionPreset, D as SectionRenderProps, E as SectionVariant, G as Seo, J as SeoDefaults, K as Surface, T as TokenOverrides, N as defineSection, O as getSection, Q as listSections, U as newSectionId, V as nodeFromPreset, W as parseSnapshot, X as registerBuiltInSection, Y as registerSection, Z as sectionJsonSchema, _ as sectionManifests, $ as unregisterSection } from './registry-CdgVymsu.js';
3
- import { S as SiteBrand, B as BrandInput } from './store-BzGw2i5J.js';
4
- export { A as Asset, a as AssetMeta, b as BrandSource, C as CheckReleaseOptions, D as DEFAULT_RESERVED_PATHS, F as FONT_CHOICES, c as FontInfo, I as InvalidationInfo, M as MAX_PAGE_PATH_LENGTH, d as MAX_URL_LENGTH, e as MemorySiteStore, f as MemoryStoreOptions, N as NewPage, g as NewSite, P as PAGE_PATH, h as PageDraft, i as PreparedRelease, j as PublishBlockedError, k as PublishOptions, R as ReservedPaths, l as SaveResult, m as SiteConflictError, n as SiteDraft, o as SiteIssue, p as SiteStore, q as SiteTheme, T as ThemePair, r as brandDisplayName, s as checkContrast, t as checkHtmlOutline, u as checkPage, v as checkRelease, w as checkSiteDoc, x as contrastRatio, y as createMemorySiteStore, z as formCacheTag, E as hexToHslTriplet, G as isConflict, H as isExternalHref, J as isPublishable, K as isReservedPath, L as isSafeHref, O as isSafeImageSrc, Q as isSiteBrand, U as luminance, V as mix, W as normalizeRequestPath, X as pagePathProblems, Y as parseHex, Z as prepareRelease, _ as siteCacheTag, $ as siteTheme, a0 as stableHash, a1 as themeCss, a2 as toCanonicalBrand, a3 as validatePagePath, a4 as withCacheInvalidation } from './store-BzGw2i5J.js';
1
+ import { S as SectionNode, P as PageDoc, A as AnySectionDefinition, a as SiteDoc, R as ReleasePage, b as PostSummary, L as LivePost, c as Redirect, d as Link, e as SiteDocInput, f as PageKind } from './registry-D_DCWRTc.js';
2
+ export { B as BUILT_IN_SECTION_TYPES, g as BuiltInSectionType, C as Copy, F as FileRef, h as FontChoice, i as FormsResolver, j as FormsResolverContext, H as Href, I as Image, k as ImportPost, l as ImportPostsResult, m as Line, n as LinkEvent, M as MAX_DOC_BYTES, o as MAX_IMPORT_POSTS, p as MAX_LIVE_POSTS, q as MenuItem, r as PageMeta, s as PagePath, t as PostAuthor, u as PostDoc, v as PostDocInput, w as PostDraft, x as PostMeta, y as PostSlug, z as PostStatus, D as PostSummarySchema, E as PostsContext, G as RegisterSectionOptions, J as Release, K as ReleaseMeta, N as ReleaseSnapshot, O as RenderContext, Q as ResolvedForm, T as RichText, U as SECTION_CATEGORIES, V as SavePostInput, W as SavePostResult, X as SectionCategory, Y as SectionDefinition, Z as SectionDefinitionError, _ as SectionId, $ as SectionManifest, a0 as SectionPlacement, a1 as SectionPreset, a2 as SectionRenderProps, a3 as SectionVariant, a4 as Seo, a5 as SeoDefaults, a6 as Surface, a7 as TokenOverrides, a8 as defineSection, a9 as getSection, aa as isPlainEmail, ab as listSections, ac as mailtoHref, ad as newSectionId, ae as nodeFromPreset, af as opensInNewTab, ag as parseSnapshot, ah as postSummary, ai as registerBuiltInSection, aj as registerSection, ak as richTextPlain, al as sectionJsonSchema, am as sectionManifests, an as unregisterSection, ao as validatePostSlug } from './registry-D_DCWRTc.js';
3
+ import { a as SiteBrand, B as BrandInput } from './store-DkSycDhq.js';
4
+ export { A as ASSET_TYPES, b as Asset, c as AssetMeta, d as BrandSource, C as CheckReleaseOptions, D as DEFAULT_RESERVED_PATHS, F as FONT_CHOICES, e as FontInfo, I as InvalidationInfo, M as MAX_PAGE_PATH_LENGTH, f as MAX_URL_LENGTH, g as MemorySiteStore, h as MemoryStoreOptions, N as NewPage, i as NewSite, P as PAGE_PATH, j as PageDraft, k as PreparedRelease, l as PublishBlockedError, m as PublishOptions, R as ReservedPaths, n as SaveResult, o as SiteConflictError, p as SiteDraft, q as SiteIssue, S as SiteStore, r as SiteTheme, T as ThemePair, s as assetPath, t as brandDisplayName, u as checkBlog, v as checkContrast, w as checkHtmlOutline, x as checkPage, y as checkPost, z as checkRelease, E as checkSiteDoc, G as contrastRatio, H as createMemorySiteStore, J as formCacheTag, K as hexToHslTriplet, L as isConflict, O as isExternalHref, Q as isPublishable, U as isReservedPath, V as isSafeHref, W as isSafeImageSrc, X as isSiteBrand, Y as luminance, Z as mix, _ as normalizeRequestPath, $ as pagePathProblems, a0 as parseHex, a1 as prepareImportPost, a2 as prepareRelease, a3 as siteCacheTag, a4 as siteTheme, a5 as stableHash, a6 as themeCss, a7 as toCanonicalBrand, a8 as validatePagePath, a9 as withCacheInvalidation } from './store-DkSycDhq.js';
5
5
  import 'react';
6
6
  import 'zod';
7
7
  import '@marktiderman/genesis-design-system';
@@ -67,6 +67,13 @@ interface PageMetaInput {
67
67
  basePath?: string;
68
68
  /** A preview: always `noindex`. */
69
69
  preview?: boolean;
70
+ /** The page is a blog post: Open Graph says `article`, with its dates. */
71
+ article?: {
72
+ publishedTime: string;
73
+ modifiedTime?: string;
74
+ author?: string;
75
+ section?: string;
76
+ };
70
77
  }
71
78
  interface PageMeta {
72
79
  title: string;
@@ -85,11 +92,32 @@ declare function absoluteUrl(origin: string, basePath: string, path: string): st
85
92
  */
86
93
  declare function pageTitle(site: SiteDoc, doc: PageDoc, _path: string): string;
87
94
  /** Every meta value a page prints in its `<head>`. */
88
- declare function pageMeta({ site, page, origin, basePath, preview }: PageMetaInput): PageMeta;
95
+ declare function pageMeta({ site, page, origin, basePath, preview, article }: PageMetaInput): PageMeta;
89
96
  declare function organizationJsonLd(site: SiteDoc, origin: string, basePath?: string): Record<string, unknown>;
90
97
  declare function websiteJsonLd(site: SiteDoc, origin: string, basePath?: string): Record<string, unknown>;
91
98
  /** The trail from the home page to `page`, through every ancestor path that is a page. */
92
99
  declare function breadcrumbJsonLd(pages: readonly ReleasePage[], page: ReleasePage, origin: string, basePath?: string): Record<string, unknown> | null;
100
+ /** The URL of a post: `<post page path>/<slug>`. */
101
+ declare function postPath(postsPath: string, slug: string): string;
102
+ /** `Article` JSON-LD for a blog post. */
103
+ declare function articleJsonLd(site: SiteDoc, post: LivePost, url: string, origin: string, basePath?: string): Record<string, unknown>;
104
+ interface RssInput {
105
+ site: SiteDoc;
106
+ /** Published posts, newest first. */
107
+ posts: readonly PostSummary[];
108
+ /** The post page's path (`/blog`). */
109
+ postsPath: string;
110
+ /** Its title, the feed's (default: the site's name). */
111
+ title?: string;
112
+ origin: string;
113
+ basePath?: string;
114
+ /** The most items (default 20). */
115
+ limit?: number;
116
+ }
117
+ /** The blog's RSS 2.0 feed: the newest posts, with their excerpts. */
118
+ declare function rssXml({ site, posts, postsPath, title, origin, basePath, limit }: RssInput): string;
119
+ /** A post's description for a feed or a page with no excerpt: its first words. */
120
+ declare const postDescription: (doc: LivePost["doc"]) => string | undefined;
93
121
  /**
94
122
  * JSON for a `<script type="application/ld+json">` (or any JSON inside HTML):
95
123
  * `<`, `>`, `&` and the line separators are escaped as `\uXXXX`, so stored
@@ -104,9 +132,14 @@ interface SitemapInput {
104
132
  basePath?: string;
105
133
  /** The release's publish time, as every page's `lastmod`. */
106
134
  lastModified?: string | null;
135
+ /** The blog: its post page's path and the published posts (each with its own `lastmod`). */
136
+ posts?: {
137
+ path: string;
138
+ items: readonly PostSummary[];
139
+ };
107
140
  }
108
141
  /** sitemap.xml: every indexable page (not `noindex`, not one whose canonical points elsewhere). */
109
- declare function sitemapXml({ site, pages, origin, basePath, lastModified }: SitemapInput): string;
142
+ declare function sitemapXml({ site, pages, origin, basePath, lastModified, posts }: SitemapInput): string;
110
143
  interface RobotsInput {
111
144
  origin: string;
112
145
  basePath?: string;
@@ -237,4 +270,4 @@ declare const exampleBrands: Readonly<{
237
270
  };
238
271
  }>;
239
272
 
240
- export { AnySectionDefinition, BrandInput, Link, type MigratedNode, type MigratedPage, type MigrationIssue, type OnePageSiteInput, PageDoc, PageKind, type PageMetaInput, Redirect, ReleasePage, type RobotsInput, SectionNode, type PageMeta as SeoPageMeta, SiteBrand, SiteDoc, SiteDocInput, type SitemapInput, type TemplateInput, type TemplateMessage, type TemplateResult, absoluteUrl, breadcrumbJsonLd, escapeXml, exampleBrands, landingPage, matchRedirect, migrateNode, migratePage, migrateSite, onePageSite, organizationJsonLd, pageMeta, pageTitle, redirectsAfterMove, robotsTxt, safeJsonForHtml, sitemapXml, starterSite, websiteJsonLd };
273
+ export { AnySectionDefinition, BrandInput, Link, LivePost, type MigratedNode, type MigratedPage, type MigrationIssue, type OnePageSiteInput, PageDoc, PageKind, type PageMetaInput, PostSummary, Redirect, ReleasePage, type RobotsInput, type RssInput, SectionNode, type PageMeta as SeoPageMeta, SiteBrand, SiteDoc, SiteDocInput, type SitemapInput, type TemplateInput, type TemplateMessage, type TemplateResult, absoluteUrl, articleJsonLd, breadcrumbJsonLd, escapeXml, exampleBrands, landingPage, matchRedirect, migrateNode, migratePage, migrateSite, onePageSite, organizationJsonLd, pageMeta, pageTitle, postDescription, postPath, redirectsAfterMove, robotsTxt, rssXml, safeJsonForHtml, sitemapXml, starterSite, websiteJsonLd };
package/dist/index.js CHANGED
@@ -1,6 +1,8 @@
1
- import { brandDisplayName } from './chunk-GA7U3CIN.js';
2
- export { FONT_CHOICES, PublishBlockedError, SiteConflictError, brandDisplayName, checkContrast, checkHtmlOutline, checkPage, checkRelease, checkSiteDoc, contrastRatio, createMemorySiteStore, formCacheTag, hexToHslTriplet, isConflict, isPublishable, isSiteBrand, luminance, migrateNode, migratePage, migrateSite, mix, parseHex, prepareRelease, siteCacheTag, siteTheme, stableHash, themeCss, toCanonicalBrand, withCacheInvalidation } from './chunk-GA7U3CIN.js';
3
- export { BUILT_IN_SECTION_TYPES, Copy, DEFAULT_RESERVED_PATHS, FontChoice, Href, Image, Line, Link, MAX_DOC_BYTES, MAX_PAGE_PATH_LENGTH, MAX_URL_LENGTH, MenuItem, PAGE_PATH, PageDoc, PageKind, PagePath, Redirect, ReleasePage, ReleaseSnapshot, RichText, SECTION_CATEGORIES, SectionDefinitionError, SectionId, SectionNode, Seo, SeoDefaults, SiteDoc, Surface, TokenOverrides, absoluteUrl, breadcrumbJsonLd, defineSection, escapeXml, getSection, isExternalHref, isReservedPath, isSafeHref, isSafeImageSrc, listSections, matchRedirect, newSectionId, nodeFromPreset, normalizeRequestPath, organizationJsonLd, pageMeta, pagePathProblems, pageTitle, parseSnapshot, redirectsAfterMove, registerBuiltInSection, registerSection, robotsTxt, safeJsonForHtml, sectionJsonSchema, sectionManifests, sitemapXml, unregisterSection, validatePagePath, websiteJsonLd } from './chunk-KEF3V5ZN.js';
1
+ export { isPlainEmail, mailtoHref } from './chunk-VZUDRPFG.js';
2
+ import { brandDisplayName } from './chunk-IXMY4B56.js';
3
+ export { ASSET_TYPES, FONT_CHOICES, PublishBlockedError, SiteConflictError, assetPath, brandDisplayName, checkBlog, checkContrast, checkHtmlOutline, checkPage, checkPost, checkRelease, checkSiteDoc, contrastRatio, createMemorySiteStore, formCacheTag, hexToHslTriplet, isConflict, isPublishable, isSiteBrand, luminance, migrateNode, migratePage, migrateSite, mix, parseHex, prepareImportPost, prepareRelease, siteCacheTag, siteTheme, stableHash, themeCss, toCanonicalBrand, withCacheInvalidation } from './chunk-IXMY4B56.js';
4
+ export { BUILT_IN_SECTION_TYPES, Copy, FileRef, FontChoice, Href, Image, Line, Link, LinkEvent, MAX_DOC_BYTES, MAX_IMPORT_POSTS, MAX_LIVE_POSTS, MenuItem, PageDoc, PageKind, PagePath, PostAuthor, PostDoc, PostSlug, PostSummarySchema, Redirect, ReleasePage, ReleaseSnapshot, RichText, SECTION_CATEGORIES, SectionDefinitionError, SectionId, SectionNode, Seo, SeoDefaults, SiteDoc, Surface, TokenOverrides, absoluteUrl, articleJsonLd, breadcrumbJsonLd, defineSection, escapeXml, getSection, listSections, matchRedirect, newSectionId, nodeFromPreset, opensInNewTab, organizationJsonLd, pageMeta, pageTitle, parseSnapshot, postDescription, postPath, postSummary, redirectsAfterMove, registerBuiltInSection, registerSection, richTextPlain, robotsTxt, rssXml, safeJsonForHtml, sectionJsonSchema, sectionManifests, sitemapXml, unregisterSection, validatePostSlug, websiteJsonLd } from './chunk-ZGWGQGT2.js';
5
+ export { DEFAULT_RESERVED_PATHS, MAX_PAGE_PATH_LENGTH, MAX_URL_LENGTH, PAGE_PATH, isExternalHref, isReservedPath, isSafeHref, isSafeImageSrc, normalizeRequestPath, pagePathProblems, validatePagePath } from './chunk-3VKTBE7S.js';
4
6
 
5
7
  // src/core/templates.ts
6
8
  var year = () => (/* @__PURE__ */ new Date()).getUTCFullYear();
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/core/templates.ts","../src/core/examples.ts"],"names":[],"mappings":";;;;;AA2CA,IAAM,IAAA,GAAO,MAAA,iBAAM,I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AAA,CAAQ,KAAK,CAAA,CAAA,EAAG,GAAI,GAAA,EAAK,CAAC;AAAA,WAC5L;AAAA,UACA,gBAAgB,IAAI,CAAA,CAAA;AAAA;AACtB;AACF;AACF,GACF;AACF;;;AClTO,IAAM,aAAA,GAAgB,OAAO,MAAA,CAAO;AAAA,EACzC,SAAA,EAAW;AAAA,IACT,IAAA,EAAM,eAAA;AAAA,IACN,MAAA,EAAQ,EAAE,OAAA,EAAS,SAAA,EAAW,aAAa,SAAA,EAAU;AAAA,IACrD,KAAA,EAAO,EAAE,OAAA,EAAS,eAAA,EAAiB,MAAM,OAAA;AAAQ,GACnD;AAAA,EACA,OAAA,EAAS;AAAA,IACP,IAAA,EAAM,iBAAA;AAAA,IACN,MAAA,EAAQ,EAAE,OAAA,EAAS,SAAA,EAAW,aAAa,SAAA,EAAU;AAAA,IACrD,KAAA,EAAO,EAAE,OAAA,EAAS,kBAAA,EAAoB,MAAM,WAAA;AAAY;AAE5D,CAAqC","file":"index.js","sourcesContent":["/**\n * Templates: whole sites from a little input.\n *\n * - `landingPage`: the one-click landing page from a brand and a message.\n * Nav, hero, features, testimonials, a call to action, a form embed and a\n * footer, on one page.\n * - `onePageSite`: the smallest site a brand with no site can be seeded\n * with: just a name, a logo, a message, and the brand's colours and fonts.\n * - `starterSite`: three pages (home, about, contact) with nav and footer.\n *\n * Each returns documents (`site`, `pages`) for any `SiteStore` to create.\n * Nothing is invented and passed off as real: copy a template can't know\n * (a client's quote, a statistic) is marked `placeholder`, and the publish\n * check refuses it until someone replaces it or hides the section.\n */\nimport type { Link, PageDoc, PageKind, SectionNode, SiteDocInput } from \"./schemas\";\nimport { brandDisplayName, type BrandInput, type SiteBrand } from \"./theme\";\n\nexport interface TemplateMessage {\n /** The hero's headline: what you do, for whom. */\n headline: string;\n /** One or two sentences under it. */\n subhead?: string;\n /** The main button. Default: \"Get in touch\", to the form (or `#contact`). */\n cta?: Link;\n /** What you offer, as the features band. Without it the band is a placeholder to fill in. */\n benefits?: { title: string; body: string }[];\n}\n\nexport interface TemplateInput {\n brand: BrandInput;\n message: TemplateMessage;\n /** A form to embed (its slug, for the host's forms resolver). */\n form?: { slug: string; heading?: string; body?: string };\n /** For the footer. */\n contact?: { email?: string; phone?: string };\n}\n\nexport interface TemplateResult {\n site: SiteDocInput;\n pages: { path: string; kind: PageKind; doc: PageDoc }[];\n}\n\nconst year = () => new Date().getUTCFullYear();\n\nfunction node(id: string, type: string, variant: string, props: Record<string, unknown>, extra: Partial<SectionNode> = {}): SectionNode {\n return { id, type, v: 1, variant, props, ...extra };\n}\n\nfunction footerNode(name: string, contact: TemplateInput[\"contact\"], variant = \"simple\"): SectionNode {\n const links: Link[] = [];\n if (contact?.email) links.push({ label: contact.email, href: `mailto:${contact.email}` });\n if (contact?.phone) links.push({ label: contact.phone, href: `tel:${contact.phone.replace(/[^+\\d]/g, \"\")}` });\n return node(\"footer\", \"footer\", variant, {\n ...(links.length ? { links } : {}),\n copyright: `© ${year()} ${name}`,\n });\n}\n\nfunction seo(name: string, message: TemplateMessage) {\n return {\n titleTemplate: `%s · ${name}`,\n ...(message.subhead ? { description: message.subhead.slice(0, 200) } : {}),\n organization: { name },\n };\n}\n\nfunction primaryCta(input: TemplateInput): Link {\n return input.message.cta ?? { label: \"Get in touch\", href: \"#contact\" };\n}\n\nfunction benefitsNode(message: TemplateMessage): SectionNode {\n if (message.benefits?.length) {\n return node(\"features\", \"features\", \"grid\", {\n heading: \"What you get\",\n items: message.benefits.slice(0, 12).map((b, i) => ({ title: b.title, body: b.body, icon: ([\"check\", \"star\", \"heart\", \"zap\", \"shield\", \"clock\"] as const)[i % 6] })),\n });\n }\n return node(\n \"features\",\n \"features\",\n \"grid\",\n {\n heading: \"What you get\",\n items: [\n { title: \"Your first offer\", body: \"Say what someone gets and why it matters to them.\", icon: \"check\" },\n { title: \"Your second offer\", body: \"Keep each one to a sentence or two.\", icon: \"star\" },\n { title: \"Your third offer\", body: \"Three is plenty for a landing page.\", icon: \"heart\" },\n ],\n },\n { placeholder: true },\n );\n}\n\nconst testimonialsNode = () =>\n node(\n \"testimonials\",\n \"testimonials\",\n \"grid\",\n {\n heading: \"What people say\",\n items: [\n { quote: \"Add a quote from someone you have helped, in their words and with their permission.\", name: \"Their name\", role: \"What they did with you\" },\n { quote: \"A second quote, from someone different.\", name: \"Their name\" },\n ],\n },\n { placeholder: true },\n );\n\nfunction formNode(input: TemplateInput): SectionNode | null {\n if (!input.form) return null;\n return node(\"contact\", \"form-embed\", \"split\", {\n heading: input.form.heading ?? \"Get in touch\",\n ...(input.form.body ? { body: input.form.body } : { body: \"Tell us a little about yourself and we'll get back to you.\" }),\n form: input.form.slug,\n anchor: \"contact\",\n });\n}\n\n/**\n * The one-click landing page: brand plus message, on one page.\n *\n * @stability Beta\n */\nexport function landingPage(input: TemplateInput): TemplateResult {\n const name = brandDisplayName(input.brand);\n const cta = primaryCta(input);\n const form = formNode(input);\n const content: SectionNode[] = [\n node(\"hero\", \"hero\", \"centered\", {\n heading: input.message.headline,\n ...(input.message.subhead ? { body: input.message.subhead } : {}),\n primaryCta: cta,\n }),\n benefitsNode(input.message),\n testimonialsNode(),\n node(\"cta\", \"cta\", \"banner\", { heading: \"Ready when you are\", primaryCta: cta, surface: \"accent\" }),\n ];\n if (form) content.push(form);\n return {\n site: {\n schemaVersion: 1,\n name,\n header: [node(\"nav\", \"nav\", \"minimal\", { cta })],\n nav: [],\n footer: [footerNode(name, input.contact, \"minimal\")],\n seo: seo(name, input.message),\n },\n pages: [{ path: \"/\", kind: \"landing\", doc: { schemaVersion: 1, root: { props: { title: input.message.headline.slice(0, 120) } }, content, seo: input.message.subhead ? { description: input.message.subhead.slice(0, 200) } : undefined } }],\n };\n}\n\nexport interface OnePageSiteInput {\n name: string;\n logo?: { src: string; alt?: string };\n message: TemplateMessage;\n /** The brand's colours and fonts. */\n colors: SiteBrand[\"colors\"];\n fonts?: SiteBrand[\"fonts\"];\n contact?: TemplateInput[\"contact\"];\n}\n\n/**\n * The smallest site, for seeding a brand that has none: a header, a hero,\n * a call to action and a footer. `brand` is the minimal brand to store\n * beside it (the host's `BrandSource` returns it).\n *\n * @stability Beta\n */\nexport function onePageSite(input: OnePageSiteInput): TemplateResult & { brand: SiteBrand } {\n const brand: SiteBrand = { name: input.name, colors: input.colors, ...(input.fonts ? { fonts: input.fonts } : {}), ...(input.logo ? { logo: input.logo } : {}) };\n const cta = input.message.cta ?? (input.contact?.email ? { label: \"Email us\", href: `mailto:${input.contact.email}` } : { label: \"Get in touch\", href: \"#contact\" });\n return {\n brand,\n site: {\n schemaVersion: 1,\n name: input.name,\n header: [node(\"nav\", \"nav\", \"minimal\", { cta })],\n nav: [],\n footer: [footerNode(input.name, input.contact)],\n seo: seo(input.name, input.message),\n },\n pages: [\n {\n path: \"/\",\n kind: \"page\",\n doc: {\n schemaVersion: 1,\n root: { props: { title: input.message.headline.slice(0, 120) } },\n content: [\n node(\"hero\", \"hero\", \"centered\", {\n heading: input.message.headline,\n ...(input.message.subhead ? { body: input.message.subhead } : {}),\n primaryCta: cta,\n }),\n node(\"contact\", \"cta\", \"card\", { heading: `Talk to ${input.name}`, primaryCta: cta, anchor: \"contact\" }),\n ],\n ...(input.message.subhead ? { seo: { description: input.message.subhead.slice(0, 200) } } : {}),\n },\n },\n ],\n };\n}\n\n/**\n * A three-page starter site: home, about and contact, with the menu, a\n * footer and redirects-ready paths.\n *\n * @stability Beta\n */\nexport function starterSite(input: TemplateInput): TemplateResult {\n const name = brandDisplayName(input.brand);\n const cta: Link = input.message.cta ?? { label: \"Contact us\", href: \"/contact\" };\n const form = formNode(input);\n const page = (title: string, content: SectionNode[], description?: string): PageDoc => ({\n schemaVersion: 1,\n root: { props: { title } },\n content,\n ...(description ? { seo: { description } } : {}),\n });\n return {\n site: {\n schemaVersion: 1,\n name,\n header: [node(\"nav\", \"nav\", \"simple\", { cta })],\n nav: [\n { label: \"Home\", href: \"/\" },\n { label: \"About\", href: \"/about\" },\n { label: \"Contact\", href: \"/contact\" },\n ],\n footer: [\n node(\"footer\", \"footer\", \"columns\", {\n tagline: input.message.subhead?.slice(0, 200),\n columns: [\n { heading: name, links: [{ label: \"About\", href: \"/about\" }, { label: \"Contact\", href: \"/contact\" }] },\n ...(input.contact?.email || input.contact?.phone\n ? [\n {\n heading: \"Get in touch\",\n links: [\n ...(input.contact.email ? [{ label: input.contact.email, href: `mailto:${input.contact.email}` }] : []),\n ...(input.contact.phone ? [{ label: input.contact.phone, href: `tel:${input.contact.phone.replace(/[^+\\d]/g, \"\")}` }] : []),\n ],\n },\n ]\n : []),\n ],\n copyright: `© ${year()} ${name}`,\n }),\n ],\n seo: seo(name, input.message),\n },\n pages: [\n {\n path: \"/\",\n kind: \"page\",\n doc: page(\n \"Home\",\n [\n node(\"hero\", \"hero\", \"split\", {\n heading: input.message.headline,\n ...(input.message.subhead ? { body: input.message.subhead } : {}),\n primaryCta: cta,\n secondaryCta: { label: \"About us\", href: \"/about\" },\n }),\n benefitsNode(input.message),\n testimonialsNode(),\n node(\"cta\", \"cta\", \"banner\", { heading: \"Come and see for yourself\", primaryCta: cta, surface: \"accent\" }),\n ],\n input.message.subhead?.slice(0, 200),\n ),\n },\n {\n path: \"/about\",\n kind: \"page\",\n doc: page(\n \"About\",\n [\n node(\"hero\", \"hero\", \"centered\", { eyebrow: \"About\", heading: `About ${name}` }),\n node(\n \"story\",\n \"rich-text\",\n \"narrow\",\n {\n body: {\n type: \"doc\",\n content: [\n { type: \"heading\", attrs: { level: 2 }, content: [{ type: \"text\", text: \"Our story\" }] },\n { type: \"paragraph\", content: [{ type: \"text\", text: \"Tell people how you started, who you help and what you believe.\" }] },\n ],\n },\n },\n { placeholder: true },\n ),\n ],\n `About ${name}.`,\n ),\n },\n {\n path: \"/contact\",\n kind: \"page\",\n doc: page(\n \"Contact\",\n [\n node(\"hero\", \"hero\", \"centered\", { eyebrow: \"Contact\", heading: \"Get in touch\", ...(input.message.subhead ? { body: input.message.subhead } : {}) }),\n ...(form ? [form] : [node(\"contact\", \"cta\", \"card\", { heading: `Talk to ${name}`, primaryCta: input.contact?.email ? { label: \"Email us\", href: `mailto:${input.contact.email}` } : cta })]),\n ],\n `How to reach ${name}.`,\n ),\n },\n ],\n };\n}\n","/**\n * Made-up brands for demos, tests and docs. They are not anyone's real\n * business.\n */\nimport type { SiteBrand } from \"./theme\";\n\nexport const exampleBrands = Object.freeze({\n riverside: {\n name: \"Riverside Gym\",\n colors: { primary: \"#0f766e\", primaryDark: \"#2dd4bf\" },\n fonts: { heading: \"space-grotesk\", body: \"inter\" },\n },\n hilltop: {\n name: \"Hilltop Fitness\",\n colors: { primary: \"#b45309\", primaryDark: \"#fbbf24\" },\n fonts: { heading: \"playfair-display\", body: \"work-sans\" },\n },\n} satisfies Record<string, SiteBrand>);\n"]}
1
+ {"version":3,"sources":["../src/core/templates.ts","../src/core/examples.ts"],"names":[],"mappings":";;;;;;;AA2CA,IAAM,IAAA,GAAO,MAAA,iBAAM,IAAI,IAAA,IAAO,cAAA,EAAe;AAE7C,SAAS,KAAK,EAAA,EAAY,IAAA,EAAc,SAAiB,KAAA,EAAgC,KAAA,GAA8B,EAAC,EAAgB;AACtI,EAAA,OAAO,EAAE,IAAI,IAAA,EAAM,CAAA,EAAG,GAAG,OAAA,EAAS,KAAA,EAAO,GAAG,KAAA,EAAM;AACpD;AAEA,SAAS,UAAA,CAAW,IAAA,EAAc,OAAA,EAAmC,OAAA,GAAU,QAAA,EAAuB;AACpG,EAAA,MAAM,QAAgB,EAAC;AACvB,EAAA,IAAI,OAAA,EAAS,KAAA,EAAO,KAAA,CAAM,IAAA,CAAK,EAAE,KAAA,EAAO,OAAA,CAAQ,KAAA,EAAO,IAAA,EAAM,CAAA,OAAA,EAAU,OAAA,CAAQ,KAAK,IAAI,CAAA;AACxF,EAAA,IAAI,SAAS,KAAA,EAAO,KAAA,CAAM,IAAA,CAAK,EAAE,OAAO,OAAA,CAAQ,KAAA,EAAO,IAAA,EAAM,CAAA,IAAA,EAAO,QAAQ,KAAA,C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.\n *\n * - `landingPage`: the one-click landing page from a brand and a message.\n * Nav, hero, features, testimonials, a call to action, a form embed and a\n * footer, on one page.\n * - `onePageSite`: the smallest site a brand with no site can be seeded\n * with: just a name, a logo, a message, and the brand's colours and fonts.\n * - `starterSite`: three pages (home, about, contact) with nav and footer.\n *\n * Each returns documents (`site`, `pages`) for any `SiteStore` to create.\n * Nothing is invented and passed off as real: copy a template can't know\n * (a client's quote, a statistic) is marked `placeholder`, and the publish\n * check refuses it until someone replaces it or hides the section.\n */\nimport type { Link, PageDoc, PageKind, SectionNode, SiteDocInput } from \"./schemas\";\nimport { brandDisplayName, type BrandInput, type SiteBrand } from \"./theme\";\n\nexport interface TemplateMessage {\n /** The hero's headline: what you do, for whom. */\n headline: string;\n /** One or two sentences under it. */\n subhead?: string;\n /** The main button. Default: \"Get in touch\", to the form (or `#contact`). */\n cta?: Link;\n /** What you offer, as the features band. Without it the band is a placeholder to fill in. */\n benefits?: { title: string; body: string }[];\n}\n\nexport interface TemplateInput {\n brand: BrandInput;\n message: TemplateMessage;\n /** A form to embed (its slug, for the host's forms resolver). */\n form?: { slug: string; heading?: string; body?: string };\n /** For the footer. */\n contact?: { email?: string; phone?: string };\n}\n\nexport interface TemplateResult {\n site: SiteDocInput;\n pages: { path: string; kind: PageKind; doc: PageDoc }[];\n}\n\nconst year = () => new Date().getUTCFullYear();\n\nfunction node(id: string, type: string, variant: string, props: Record<string, unknown>, extra: Partial<SectionNode> = {}): SectionNode {\n return { id, type, v: 1, variant, props, ...extra };\n}\n\nfunction footerNode(name: string, contact: TemplateInput[\"contact\"], variant = \"simple\"): SectionNode {\n const links: Link[] = [];\n if (contact?.email) links.push({ label: contact.email, href: `mailto:${contact.email}` });\n if (contact?.phone) links.push({ label: contact.phone, href: `tel:${contact.phone.replace(/[^+\\d]/g, \"\")}` });\n return node(\"footer\", \"footer\", variant, {\n ...(links.length ? { links } : {}),\n copyright: `© ${year()} ${name}`,\n });\n}\n\nfunction seo(name: string, message: TemplateMessage) {\n return {\n titleTemplate: `%s · ${name}`,\n ...(message.subhead ? { description: message.subhead.slice(0, 200) } : {}),\n organization: { name },\n };\n}\n\nfunction primaryCta(input: TemplateInput): Link {\n return input.message.cta ?? { label: \"Get in touch\", href: \"#contact\" };\n}\n\nfunction benefitsNode(message: TemplateMessage): SectionNode {\n if (message.benefits?.length) {\n return node(\"features\", \"features\", \"grid\", {\n heading: \"What you get\",\n items: message.benefits.slice(0, 12).map((b, i) => ({ title: b.title, body: b.body, icon: ([\"check\", \"star\", \"heart\", \"zap\", \"shield\", \"clock\"] as const)[i % 6] })),\n });\n }\n return node(\n \"features\",\n \"features\",\n \"grid\",\n {\n heading: \"What you get\",\n items: [\n { title: \"Your first offer\", body: \"Say what someone gets and why it matters to them.\", icon: \"check\" },\n { title: \"Your second offer\", body: \"Keep each one to a sentence or two.\", icon: \"star\" },\n { title: \"Your third offer\", body: \"Three is plenty for a landing page.\", icon: \"heart\" },\n ],\n },\n { placeholder: true },\n );\n}\n\nconst testimonialsNode = () =>\n node(\n \"testimonials\",\n \"testimonials\",\n \"grid\",\n {\n heading: \"What people say\",\n items: [\n { quote: \"Add a quote from someone you have helped, in their words and with their permission.\", name: \"Their name\", role: \"What they did with you\" },\n { quote: \"A second quote, from someone different.\", name: \"Their name\" },\n ],\n },\n { placeholder: true },\n );\n\nfunction formNode(input: TemplateInput): SectionNode | null {\n if (!input.form) return null;\n return node(\"contact\", \"form-embed\", \"split\", {\n heading: input.form.heading ?? \"Get in touch\",\n ...(input.form.body ? { body: input.form.body } : { body: \"Tell us a little about yourself and we'll get back to you.\" }),\n form: input.form.slug,\n anchor: \"contact\",\n });\n}\n\n/**\n * The one-click landing page: brand plus message, on one page.\n *\n * @stability Beta\n */\nexport function landingPage(input: TemplateInput): TemplateResult {\n const name = brandDisplayName(input.brand);\n const cta = primaryCta(input);\n const form = formNode(input);\n const content: SectionNode[] = [\n node(\"hero\", \"hero\", \"centered\", {\n heading: input.message.headline,\n ...(input.message.subhead ? { body: input.message.subhead } : {}),\n primaryCta: cta,\n }),\n benefitsNode(input.message),\n testimonialsNode(),\n node(\"cta\", \"cta\", \"banner\", { heading: \"Ready when you are\", primaryCta: cta, surface: \"accent\" }),\n ];\n if (form) content.push(form);\n return {\n site: {\n schemaVersion: 1,\n name,\n header: [node(\"nav\", \"nav\", \"minimal\", { cta })],\n nav: [],\n footer: [footerNode(name, input.contact, \"minimal\")],\n seo: seo(name, input.message),\n },\n pages: [{ path: \"/\", kind: \"landing\", doc: { schemaVersion: 1, root: { props: { title: input.message.headline.slice(0, 120) } }, content, seo: input.message.subhead ? { description: input.message.subhead.slice(0, 200) } : undefined } }],\n };\n}\n\nexport interface OnePageSiteInput {\n name: string;\n logo?: { src: string; alt?: string };\n message: TemplateMessage;\n /** The brand's colours and fonts. */\n colors: SiteBrand[\"colors\"];\n fonts?: SiteBrand[\"fonts\"];\n contact?: TemplateInput[\"contact\"];\n}\n\n/**\n * The smallest site, for seeding a brand that has none: a header, a hero,\n * a call to action and a footer. `brand` is the minimal brand to store\n * beside it (the host's `BrandSource` returns it).\n *\n * @stability Beta\n */\nexport function onePageSite(input: OnePageSiteInput): TemplateResult & { brand: SiteBrand } {\n const brand: SiteBrand = { name: input.name, colors: input.colors, ...(input.fonts ? { fonts: input.fonts } : {}), ...(input.logo ? { logo: input.logo } : {}) };\n const cta = input.message.cta ?? (input.contact?.email ? { label: \"Email us\", href: `mailto:${input.contact.email}` } : { label: \"Get in touch\", href: \"#contact\" });\n return {\n brand,\n site: {\n schemaVersion: 1,\n name: input.name,\n header: [node(\"nav\", \"nav\", \"minimal\", { cta })],\n nav: [],\n footer: [footerNode(input.name, input.contact)],\n seo: seo(input.name, input.message),\n },\n pages: [\n {\n path: \"/\",\n kind: \"page\",\n doc: {\n schemaVersion: 1,\n root: { props: { title: input.message.headline.slice(0, 120) } },\n content: [\n node(\"hero\", \"hero\", \"centered\", {\n heading: input.message.headline,\n ...(input.message.subhead ? { body: input.message.subhead } : {}),\n primaryCta: cta,\n }),\n node(\"contact\", \"cta\", \"card\", { heading: `Talk to ${input.name}`, primaryCta: cta, anchor: \"contact\" }),\n ],\n ...(input.message.subhead ? { seo: { description: input.message.subhead.slice(0, 200) } } : {}),\n },\n },\n ],\n };\n}\n\n/**\n * A three-page starter site: home, about and contact, with the menu, a\n * footer and redirects-ready paths.\n *\n * @stability Beta\n */\nexport function starterSite(input: TemplateInput): TemplateResult {\n const name = brandDisplayName(input.brand);\n const cta: Link = input.message.cta ?? { label: \"Contact us\", href: \"/contact\" };\n const form = formNode(input);\n const page = (title: string, content: SectionNode[], description?: string): PageDoc => ({\n schemaVersion: 1,\n root: { props: { title } },\n content,\n ...(description ? { seo: { description } } : {}),\n });\n return {\n site: {\n schemaVersion: 1,\n name,\n header: [node(\"nav\", \"nav\", \"simple\", { cta })],\n nav: [\n { label: \"Home\", href: \"/\" },\n { label: \"About\", href: \"/about\" },\n { label: \"Contact\", href: \"/contact\" },\n ],\n footer: [\n node(\"footer\", \"footer\", \"columns\", {\n tagline: input.message.subhead?.slice(0, 200),\n columns: [\n { heading: name, links: [{ label: \"About\", href: \"/about\" }, { label: \"Contact\", href: \"/contact\" }] },\n ...(input.contact?.email || input.contact?.phone\n ? [\n {\n heading: \"Get in touch\",\n links: [\n ...(input.contact.email ? [{ label: input.contact.email, href: `mailto:${input.contact.email}` }] : []),\n ...(input.contact.phone ? [{ label: input.contact.phone, href: `tel:${input.contact.phone.replace(/[^+\\d]/g, \"\")}` }] : []),\n ],\n },\n ]\n : []),\n ],\n copyright: `© ${year()} ${name}`,\n }),\n ],\n seo: seo(name, input.message),\n },\n pages: [\n {\n path: \"/\",\n kind: \"page\",\n doc: page(\n \"Home\",\n [\n node(\"hero\", \"hero\", \"split\", {\n heading: input.message.headline,\n ...(input.message.subhead ? { body: input.message.subhead } : {}),\n primaryCta: cta,\n secondaryCta: { label: \"About us\", href: \"/about\" },\n }),\n benefitsNode(input.message),\n testimonialsNode(),\n node(\"cta\", \"cta\", \"banner\", { heading: \"Come and see for yourself\", primaryCta: cta, surface: \"accent\" }),\n ],\n input.message.subhead?.slice(0, 200),\n ),\n },\n {\n path: \"/about\",\n kind: \"page\",\n doc: page(\n \"About\",\n [\n node(\"hero\", \"hero\", \"centered\", { eyebrow: \"About\", heading: `About ${name}` }),\n node(\n \"story\",\n \"rich-text\",\n \"narrow\",\n {\n body: {\n type: \"doc\",\n content: [\n { type: \"heading\", attrs: { level: 2 }, content: [{ type: \"text\", text: \"Our story\" }] },\n { type: \"paragraph\", content: [{ type: \"text\", text: \"Tell people how you started, who you help and what you believe.\" }] },\n ],\n },\n },\n { placeholder: true },\n ),\n ],\n `About ${name}.`,\n ),\n },\n {\n path: \"/contact\",\n kind: \"page\",\n doc: page(\n \"Contact\",\n [\n node(\"hero\", \"hero\", \"centered\", { eyebrow: \"Contact\", heading: \"Get in touch\", ...(input.message.subhead ? { body: input.message.subhead } : {}) }),\n ...(form ? [form] : [node(\"contact\", \"cta\", \"card\", { heading: `Talk to ${name}`, primaryCta: input.contact?.email ? { label: \"Email us\", href: `mailto:${input.contact.email}` } : cta })]),\n ],\n `How to reach ${name}.`,\n ),\n },\n ],\n };\n}\n","/**\n * Made-up brands for demos, tests and docs. They are not anyone's real\n * business.\n */\nimport type { SiteBrand } from \"./theme\";\n\nexport const exampleBrands = Object.freeze({\n riverside: {\n name: \"Riverside Gym\",\n colors: { primary: \"#0f766e\", primaryDark: \"#2dd4bf\" },\n fonts: { heading: \"space-grotesk\", body: \"inter\" },\n },\n hilltop: {\n name: \"Hilltop Fitness\",\n colors: { primary: \"#b45309\", primaryDark: \"#fbbf24\" },\n fonts: { heading: \"playfair-display\", body: \"work-sans\" },\n },\n} satisfies Record<string, SiteBrand>);\n"]}
@@ -14,13 +14,51 @@ import { z } from 'zod';
14
14
 
15
15
  /** A link target: a site path, a fragment, or an http(s), mailto or tel URL. */
16
16
  declare const Href: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
17
- /** A labelled link: a button, a menu entry, a footer link. */
17
+ /** An analytics event name for a link: `data-gs-event` on the page (default `cta` on buttons). */
18
+ declare const LinkEvent: z.ZodString;
19
+ /**
20
+ * A labelled link: a button, a menu entry, a footer link, an outbound
21
+ * booking link.
22
+ *
23
+ * - `external: true` marks a link that leaves the site (a booking or
24
+ * membership system): it must be an `http(s)` URL, and it renders with
25
+ * `rel="noopener noreferrer"` and `data-gs-outbound` for analytics.
26
+ * - `target` (`_blank` for a new tab) applies to http(s) links only;
27
+ * `newTab: true` is the older spelling of `target: "_blank"`.
28
+ * - `event` names the click for the host's analytics (`data-gs-event`).
29
+ */
18
30
  declare const Link: z.ZodObject<{
19
31
  label: z.ZodString;
20
32
  href: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
21
33
  newTab: z.ZodOptional<z.ZodBoolean>;
34
+ target: z.ZodOptional<z.ZodEnum<{
35
+ _self: "_self";
36
+ _blank: "_blank";
37
+ }>>;
38
+ external: z.ZodOptional<z.ZodBoolean>;
39
+ event: z.ZodOptional<z.ZodString>;
22
40
  }, z.core.$strip>;
23
41
  type Link = z.infer<typeof Link>;
42
+ /** Does this link open in a new tab? Only an http(s) link can. */
43
+ declare const opensInNewTab: (link: Pick<Link, "href" | "newTab" | "target">) => boolean;
44
+ /**
45
+ * A downloadable file (a PDF timetable, a waiver): a site path (an upload
46
+ * under `sites/<site_id>/files/`) or an https URL. `bytes` and `mime` say
47
+ * what the visitor is about to download.
48
+ */
49
+ declare const FileRef: z.ZodObject<{
50
+ src: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
51
+ mime: z.ZodDefault<z.ZodEnum<{
52
+ "application/pdf": "application/pdf";
53
+ "image/png": "image/png";
54
+ "image/jpeg": "image/jpeg";
55
+ "image/webp": "image/webp";
56
+ "image/avif": "image/avif";
57
+ "image/gif": "image/gif";
58
+ }>>;
59
+ bytes: z.ZodOptional<z.ZodNumber>;
60
+ }, z.core.$strip>;
61
+ type FileRef = z.infer<typeof FileRef>;
24
62
  /**
25
63
  * An image. `alt` describes it for someone who can't see it; an image that
26
64
  * adds nothing (a texture) is `decorative: true` and gets an empty alt. The
@@ -134,9 +172,16 @@ declare const PageDoc: z.ZodObject<{
134
172
  }, z.core.$strip>>;
135
173
  }, z.core.$strip>;
136
174
  type PageDoc = z.infer<typeof PageDoc>;
175
+ /**
176
+ * What a page is: an ordinary `page`, a focused `landing` page, or the
177
+ * `post` page: the template every blog post renders in. A site has at most
178
+ * one post page; at its own path (`/blog`) it is the blog's index, and at
179
+ * `/blog/<slug>` it shows that post in its `post-body` section.
180
+ */
137
181
  declare const PageKind: z.ZodEnum<{
138
182
  page: "page";
139
183
  landing: "landing";
184
+ post: "post";
140
185
  }>;
141
186
  type PageKind = z.infer<typeof PageKind>;
142
187
  declare const PagePath: z.ZodString;
@@ -340,6 +385,7 @@ declare const ReleasePage: z.ZodObject<{
340
385
  kind: z.ZodEnum<{
341
386
  page: "page";
342
387
  landing: "landing";
388
+ post: "post";
343
389
  }>;
344
390
  doc: z.ZodObject<{
345
391
  schemaVersion: z.ZodLiteral<1>;
@@ -494,6 +540,7 @@ declare const ReleaseSnapshot: z.ZodObject<{
494
540
  kind: z.ZodEnum<{
495
541
  page: "page";
496
542
  landing: "landing";
543
+ post: "post";
497
544
  }>;
498
545
  doc: z.ZodObject<{
499
546
  schemaVersion: z.ZodLiteral<1>;
@@ -574,10 +621,15 @@ declare const MAX_DOC_BYTES: number;
574
621
  * form by its slug; the host says what that slug is, through a resolver
575
622
  * passed to the renderer. This package assumes no forms table.
576
623
  *
577
- * - `definition`: a genesis-forms definition. The page renders it on the
578
- * server with forms-web's `<Form>`, and the form island makes it
579
- * interactive; answers are POSTed as JSON to `submitUrl` (the host's
580
- * endpoint, for example one that runs genesis-forms destinations).
624
+ * - `definition`: a genesis-forms definition, sent to an endpoint. The page
625
+ * renders it on the server (a plain HTML form when it needs no engine,
626
+ * forms-web's `<Form>` and the form island otherwise), and answers are
627
+ * POSTed as JSON (`{ form, answers }`) to `submitUrl`: a site path (the
628
+ * host's own endpoint, for example one that runs genesis-forms
629
+ * destinations) or an https URL (another service's endpoint).
630
+ * - `mailto`: no form at all, a button that opens the visitor's email to
631
+ * `email`. The fallback for a site with no endpoint yet: nothing is
632
+ * stored, and a page never posts a form to `mailto:`.
581
633
  * - `embed`: an https URL the page shows in an iframe (a hosted form).
582
634
  */
583
635
  type ResolvedForm = {
@@ -588,6 +640,16 @@ type ResolvedForm = {
588
640
  submitUrl: string;
589
641
  layout?: "classic" | "focus";
590
642
  submitLabel?: string;
643
+ } | {
644
+ kind: "mailto";
645
+ /** The address the button writes to. */
646
+ email: string;
647
+ /** The email's subject line. */
648
+ subject?: string;
649
+ /** The button's label (default "Email us"). */
650
+ label?: string;
651
+ /** A line above the button. */
652
+ note?: string;
591
653
  } | {
592
654
  kind: "embed";
593
655
  /** An https URL. */
@@ -604,6 +666,188 @@ interface FormsResolverContext {
604
666
  }
605
667
  /** slug → the form to show, or null when the host has no such form (the section then renders nothing and logs). */
606
668
  type FormsResolver = (slug: string, ctx: FormsResolverContext) => ResolvedForm | null | Promise<ResolvedForm | null>;
669
+ /** A plain email address (no display name, no `%` escapes, no header injection): what a `mailto` form may write to. */
670
+ declare function isPlainEmail(value: unknown): value is string;
671
+ /** The `mailto:` link for a mailto form, or null when its address isn't a plain one. */
672
+ declare function mailtoHref(form: Extract<ResolvedForm, {
673
+ kind: "mailto";
674
+ }>): string | null;
675
+
676
+ /**
677
+ * Blog posts: a site's collection of dated articles.
678
+ *
679
+ * A post is its own document (`PostDoc`), kept beside the pages rather than
680
+ * in them, with a draft and a published copy. `publishPost` checks the draft
681
+ * and copies it to the published copy; that copy is what visitors see, so
682
+ * a post goes live (and comes down) on its own, without republishing the
683
+ * site. The site's `post` page is the template every post renders in: at its
684
+ * own path it is the blog's index, and at `<path>/<slug>` it shows the post.
685
+ */
686
+
687
+ /** A post's slug: lowercase letters, digits and single hyphens (`september-testing`). */
688
+ declare const PostSlug: z.ZodString;
689
+ declare const PostAuthor: z.ZodObject<{
690
+ name: z.ZodString;
691
+ url: z.ZodOptional<z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>>;
692
+ }, z.core.$strip>;
693
+ declare const PostDoc: z.ZodObject<{
694
+ schemaVersion: z.ZodLiteral<1>;
695
+ title: z.ZodString;
696
+ excerpt: z.ZodOptional<z.ZodString>;
697
+ body: z.ZodObject<{
698
+ type: z.ZodLiteral<"doc">;
699
+ content: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
700
+ }, z.core.$strip>;
701
+ cover: z.ZodOptional<z.ZodObject<{
702
+ src: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
703
+ alt: z.ZodDefault<z.ZodString>;
704
+ decorative: z.ZodOptional<z.ZodBoolean>;
705
+ width: z.ZodOptional<z.ZodNumber>;
706
+ height: z.ZodOptional<z.ZodNumber>;
707
+ focal: z.ZodOptional<z.ZodObject<{
708
+ x: z.ZodNumber;
709
+ y: z.ZodNumber;
710
+ }, z.core.$strip>>;
711
+ }, z.core.$strip>>;
712
+ author: z.ZodOptional<z.ZodObject<{
713
+ name: z.ZodString;
714
+ url: z.ZodOptional<z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>>;
715
+ }, z.core.$strip>>;
716
+ category: z.ZodOptional<z.ZodString>;
717
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
718
+ seo: z.ZodOptional<z.ZodObject<{
719
+ title: z.ZodOptional<z.ZodString>;
720
+ description: z.ZodOptional<z.ZodString>;
721
+ ogImage: z.ZodOptional<z.ZodObject<{
722
+ src: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
723
+ alt: z.ZodDefault<z.ZodString>;
724
+ decorative: z.ZodOptional<z.ZodBoolean>;
725
+ width: z.ZodOptional<z.ZodNumber>;
726
+ height: z.ZodOptional<z.ZodNumber>;
727
+ focal: z.ZodOptional<z.ZodObject<{
728
+ x: z.ZodNumber;
729
+ y: z.ZodNumber;
730
+ }, z.core.$strip>>;
731
+ }, z.core.$strip>>;
732
+ canonical: z.ZodOptional<z.ZodURL>;
733
+ noindex: z.ZodOptional<z.ZodBoolean>;
734
+ }, z.core.$strip>>;
735
+ }, z.core.$strip>;
736
+ type PostDoc = z.infer<typeof PostDoc>;
737
+ type PostDocInput = z.input<typeof PostDoc>;
738
+ type PostStatus = "draft" | "published";
739
+ /** A post as the editor lists it. */
740
+ interface PostMeta {
741
+ id: string;
742
+ siteId: string;
743
+ slug: string;
744
+ title: string;
745
+ status: PostStatus;
746
+ /** The draft's revision, for compare-and-swap saves. */
747
+ rev: number;
748
+ /** When it was first published (kept when it is published again), or null. */
749
+ publishedAt: string | null;
750
+ updatedAt: string;
751
+ }
752
+ /** A post's draft, for the editor. */
753
+ interface PostDraft extends PostMeta {
754
+ doc: PostDoc;
755
+ }
756
+ /** A published post, as visitors see it. */
757
+ interface LivePost {
758
+ slug: string;
759
+ publishedAt: string;
760
+ /** When its published copy last changed. */
761
+ updatedAt: string;
762
+ doc: PostDoc;
763
+ }
764
+ /** A published post in a list: everything but the body. */
765
+ interface PostSummary {
766
+ slug: string;
767
+ title: string;
768
+ excerpt?: string;
769
+ cover?: Image;
770
+ author?: z.infer<typeof PostAuthor>;
771
+ category?: string;
772
+ /** Kept out of the sitemap and the feed (`seo.noindex`, or a canonical elsewhere). */
773
+ noindex?: boolean;
774
+ publishedAt: string;
775
+ updatedAt: string;
776
+ }
777
+ /** A list item as a store returns it, checked: a stored row that skipped the checks is left out. */
778
+ declare const PostSummarySchema: z.ZodObject<{
779
+ slug: z.ZodString;
780
+ title: z.ZodString;
781
+ excerpt: z.ZodOptional<z.ZodString>;
782
+ cover: z.ZodOptional<z.ZodObject<{
783
+ src: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
784
+ alt: z.ZodDefault<z.ZodString>;
785
+ decorative: z.ZodOptional<z.ZodBoolean>;
786
+ width: z.ZodOptional<z.ZodNumber>;
787
+ height: z.ZodOptional<z.ZodNumber>;
788
+ focal: z.ZodOptional<z.ZodObject<{
789
+ x: z.ZodNumber;
790
+ y: z.ZodNumber;
791
+ }, z.core.$strip>>;
792
+ }, z.core.$strip>>;
793
+ author: z.ZodOptional<z.ZodObject<{
794
+ name: z.ZodString;
795
+ url: z.ZodOptional<z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>>;
796
+ }, z.core.$strip>>;
797
+ category: z.ZodOptional<z.ZodString>;
798
+ noindex: z.ZodOptional<z.ZodBoolean>;
799
+ publishedAt: z.ZodString;
800
+ updatedAt: z.ZodString;
801
+ }, z.core.$strip>;
802
+ /** The most posts a list reads (the newest first). */
803
+ declare const MAX_LIVE_POSTS = 500;
804
+ /** A save of a post: a new one (no `id`), or a compare-and-swap of an existing one's draft. */
805
+ interface SavePostInput {
806
+ id?: string;
807
+ slug: string;
808
+ /** The draft revision this save started from (required with `id`). */
809
+ rev?: number;
810
+ doc: PostDocInput;
811
+ }
812
+ type SavePostResult = {
813
+ id: string;
814
+ rev: number;
815
+ } | {
816
+ id: string;
817
+ conflict: PostDoc;
818
+ rev: number;
819
+ };
820
+ /** One post to import (a move from another site): published as of `publishedAt` unless it fails a check. */
821
+ interface ImportPost {
822
+ slug: string;
823
+ doc: PostDocInput;
824
+ /** When it was first published, kept from the old site (default: now). */
825
+ publishedAt?: string;
826
+ /** `draft` imports it unpublished. Default `published`. */
827
+ status?: PostStatus;
828
+ }
829
+ interface ImportPostsResult {
830
+ /** Imported posts: published, or a draft when asked for or when a check failed (see `issues`). */
831
+ imported: {
832
+ slug: string;
833
+ id: string;
834
+ status: PostStatus;
835
+ issues?: string[];
836
+ }[];
837
+ /** Posts left out: a slug the site already has, or a document that doesn't parse. */
838
+ skipped: {
839
+ slug: string;
840
+ reason: string;
841
+ }[];
842
+ }
843
+ /** The most posts one `importPosts` call takes. */
844
+ declare const MAX_IMPORT_POSTS = 500;
845
+ /** A published post as a list item. */
846
+ declare function postSummary(post: LivePost): PostSummary;
847
+ /** Plain text of a rich text document (for a feed's description when a post has no excerpt). */
848
+ declare function richTextPlain(value: unknown, max?: number): string;
849
+ /** Validate a post slug, throwing with a readable message. */
850
+ declare function validatePostSlug(slug: string): string;
607
851
 
608
852
  /**
609
853
  * Sections: `defineSection` describes one kind of section (its props schema,
@@ -660,6 +904,20 @@ interface RenderContext {
660
904
  mode: "live" | "preview";
661
905
  /** A prefix that makes ids unique on the page: the section node's id. */
662
906
  idPrefix: string;
907
+ /**
908
+ * The site's blog, when it has a post page: its path, the published posts
909
+ * (newest first, without bodies), the post this page shows (on
910
+ * `<path>/<slug>`), and the list's page number (`?page=`).
911
+ */
912
+ posts?: PostsContext;
913
+ }
914
+ interface PostsContext {
915
+ /** The post page's path (`/blog`): posts live at `<path>/<slug>`. */
916
+ path: string;
917
+ list: readonly PostSummary[];
918
+ current: LivePost | null;
919
+ /** The list's page, from `?page=` (1 when absent). */
920
+ page: number;
663
921
  }
664
922
  interface SectionRenderProps<P> {
665
923
  props: P;
@@ -694,7 +952,15 @@ interface SectionDefinition<P = Record<string, unknown>> {
694
952
  * the renderer, and a publish writes the result into the release.
695
953
  */
696
954
  migrations?: Readonly<Record<number, (props: Record<string, unknown>) => Record<string, unknown>>>;
697
- /** Server-safe React: no state, no effects, no browser APIs. */
955
+ /**
956
+ * The https origins this section frames (a map), so the page's
957
+ * Content-Security-Policy allows them in `frame-src`. Only origins the
958
+ * section builds itself, never a URL an editor typed.
959
+ */
960
+ frameOrigins?: (props: P) => readonly string[];
961
+ /** It needs the islands loader (a click-to-load map, say). */
962
+ islands?: boolean;
963
+ /** Server-safe React: no state, no effects, no browser APIs. Returning null gives the page's h1 back. */
698
964
  render: (input: SectionRenderProps<P>) => ReactNode;
699
965
  }
700
966
  /** A definition as the registry holds it: props erased to a record. */
@@ -711,7 +977,7 @@ declare class SectionDefinitionError extends Error {
711
977
  */
712
978
  declare function defineSection<P>(def: SectionDefinition<P>): Readonly<SectionDefinition<P>>;
713
979
  /** The built-in section kinds, which a host replaces only with `{ replace: true }`. */
714
- declare const BUILT_IN_SECTION_TYPES: readonly ["nav", "hero", "features", "cta", "testimonials", "faq", "pricing", "logos", "stats", "gallery", "rich-text", "form-embed", "footer"];
980
+ declare const BUILT_IN_SECTION_TYPES: readonly ["nav", "hero", "features", "cta", "testimonials", "faq", "pricing", "logos", "stats", "gallery", "rich-text", "form-embed", "footer", "schedule", "team", "blog-list", "post-body", "map", "timeline", "file"];
715
981
  type BuiltInSectionType = (typeof BUILT_IN_SECTION_TYPES)[number];
716
982
  interface RegisterSectionOptions {
717
983
  /** Replace a built-in kind, for every site in this process. */
@@ -761,4 +1027,4 @@ declare function newSectionId(prefix?: string): string;
761
1027
  /** A section node from a preset: the editor's Add, and templates. */
762
1028
  declare function nodeFromPreset(type: string, presetName?: string, id?: string): SectionNode;
763
1029
 
764
- export { unregisterSection as $, type AnySectionDefinition as A, BUILT_IN_SECTION_TYPES as B, Copy as C, type SectionRenderProps as D, type SectionVariant as E, FontChoice as F, Seo as G, Href as H, Image as I, SeoDefaults as J, Surface as K, Link as L, MAX_DOC_BYTES as M, defineSection as N, getSection as O, PageDoc as P, listSections as Q, ReleasePage as R, SectionNode as S, TokenOverrides as T, newSectionId as U, nodeFromPreset as V, parseSnapshot as W, registerBuiltInSection as X, registerSection as Y, sectionJsonSchema as Z, sectionManifests as _, SiteDoc as a, Redirect as b, type SiteDocInput as c, PageKind as d, type BuiltInSectionType as e, type FormsResolver as f, type FormsResolverContext as g, Line as h, MenuItem as i, type PageMeta as j, PagePath as k, type RegisterSectionOptions as l, type Release as m, type ReleaseMeta as n, ReleaseSnapshot as o, type RenderContext as p, type ResolvedForm as q, RichText as r, SECTION_CATEGORIES as s, type SectionCategory as t, type SectionDefinition as u, SectionDefinitionError as v, SectionId as w, type SectionManifest as x, type SectionPlacement as y, type SectionPreset as z };
1030
+ export { type SectionManifest as $, type AnySectionDefinition as A, BUILT_IN_SECTION_TYPES as B, Copy as C, PostSummarySchema as D, type PostsContext as E, FileRef as F, type RegisterSectionOptions as G, Href as H, Image as I, type Release as J, type ReleaseMeta as K, type LivePost as L, MAX_DOC_BYTES as M, ReleaseSnapshot as N, type RenderContext as O, PageDoc as P, type ResolvedForm as Q, ReleasePage as R, SectionNode as S, RichText as T, SECTION_CATEGORIES as U, type SavePostInput as V, type SavePostResult as W, type SectionCategory as X, type SectionDefinition as Y, SectionDefinitionError as Z, SectionId as _, SiteDoc as a, type SectionPlacement as a0, type SectionPreset as a1, type SectionRenderProps as a2, type SectionVariant as a3, Seo as a4, SeoDefaults as a5, Surface as a6, TokenOverrides as a7, defineSection as a8, getSection as a9, isPlainEmail as aa, listSections as ab, mailtoHref as ac, newSectionId as ad, nodeFromPreset as ae, opensInNewTab as af, parseSnapshot as ag, postSummary as ah, registerBuiltInSection as ai, registerSection as aj, richTextPlain as ak, sectionJsonSchema as al, sectionManifests as am, unregisterSection as an, validatePostSlug as ao, type PostSummary as b, Redirect as c, Link as d, type SiteDocInput as e, PageKind as f, type BuiltInSectionType as g, FontChoice as h, type FormsResolver as i, type FormsResolverContext as j, type ImportPost as k, type ImportPostsResult as l, Line as m, LinkEvent as n, MAX_IMPORT_POSTS as o, MAX_LIVE_POSTS as p, MenuItem as q, type PageMeta as r, PagePath as s, PostAuthor as t, PostDoc as u, type PostDocInput as v, type PostDraft as w, type PostMeta as x, PostSlug as y, type PostStatus as z };