@marktiderman/genesis-sites 0.7.6 → 0.9.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 +202 -19
- package/SKILL.md +15 -0
- package/dist/analytics.d.ts +184 -0
- package/dist/analytics.js +3 -0
- package/dist/analytics.js.map +1 -0
- package/dist/assets/form-island.da6c662a73.js +51 -0
- package/dist/assets/islands.399b13ea6f.js +1 -0
- package/dist/assets/sites-forms.b64c156079.css +10 -0
- package/dist/assets/sites-forms.css +1 -1
- package/dist/assets/sites.2fac65f96a.css +2 -0
- package/dist/assets/sites.css +1 -1
- package/dist/assets.generated-ZBFSP23U.js +3 -0
- package/dist/{assets.generated-LLUGUUWZ.js.map → assets.generated-ZBFSP23U.js.map} +1 -1
- package/dist/blocks.js +2 -1
- package/dist/blocks.js.map +1 -1
- package/dist/chunk-5G2H6EZ2.js +19 -0
- package/dist/chunk-5G2H6EZ2.js.map +1 -0
- package/dist/chunk-5RYCQEEE.js +256 -0
- package/dist/chunk-5RYCQEEE.js.map +1 -0
- package/dist/{chunk-7E3YGYVH.js → chunk-ATRS5GSD.js} +77 -22
- package/dist/chunk-ATRS5GSD.js.map +1 -0
- package/dist/{chunk-MU2Z2C4F.js → chunk-CXBBUKGB.js} +14 -4
- package/dist/chunk-CXBBUKGB.js.map +1 -0
- package/dist/{chunk-IU6AI75R.js → chunk-QGU6FDH5.js} +413 -162
- package/dist/chunk-QGU6FDH5.js.map +1 -0
- package/dist/{chunk-SMJMXQ3T.js → chunk-SBONYMUC.js} +294 -73
- package/dist/chunk-SBONYMUC.js.map +1 -0
- package/dist/{chunk-VJ4HOFBA.js → chunk-UOKNFG5O.js} +144 -20
- package/dist/chunk-UOKNFG5O.js.map +1 -0
- package/dist/{chunk-KY4ALBVH.js → chunk-UUC5USJH.js} +58 -37
- package/dist/chunk-UUC5USJH.js.map +1 -0
- package/dist/editor.d.ts +76 -19
- package/dist/editor.js +1217 -245
- package/dist/editor.js.map +1 -1
- package/dist/handler-OR554RTS.js +11 -0
- package/dist/{handler-UMGSZY33.js.map → handler-OR554RTS.js.map} +1 -1
- package/dist/import.d.ts +3 -3
- package/dist/import.js +1 -1
- package/dist/index.d.ts +66 -11
- package/dist/index.js +4 -4
- package/dist/redirects-LcCNIJHQ.d.ts +43 -0
- package/dist/{registry-BIijndsq.d.ts → registry-Cw7NF_le.d.ts} +92 -1
- package/dist/sections.d.ts +86 -4
- package/dist/sections.js +3 -3
- package/dist/{store-BImtGmoF.d.ts → store-BNYD5NAQ.d.ts} +30 -4
- package/dist/supabase.d.ts +4 -4
- package/dist/supabase.js +4 -4
- package/dist/{templates-kA-jrnWA.d.ts → templates-DPv0OYLl.d.ts} +2 -2
- package/dist/templates.d.ts +3 -3
- package/dist/templates.js +7 -3
- package/dist/templates.js.map +1 -1
- package/dist/{theme-Cg-inpk5.d.ts → theme-HJzN2tOm.d.ts} +2 -2
- package/dist/web.d.ts +64 -18
- package/dist/web.js +7 -6
- package/migrations/0003_genesis_sites_post_dates.sql +117 -0
- package/migrations/tests/0003_genesis_sites_post_dates.test.sql +76 -0
- package/package.json +12 -4
- package/dist/assets/form-island.defb8daccc.js +0 -51
- package/dist/assets/islands.33a445f34e.js +0 -1
- package/dist/assets/sites-forms.aff23b5617.css +0 -10
- package/dist/assets/sites.5b3f64c627.css +0 -2
- package/dist/assets.generated-LLUGUUWZ.js +0 -3
- package/dist/chunk-7E3YGYVH.js.map +0 -1
- package/dist/chunk-IU6AI75R.js.map +0 -1
- package/dist/chunk-KY4ALBVH.js.map +0 -1
- package/dist/chunk-MU2Z2C4F.js.map +0 -1
- package/dist/chunk-RLYO6VVP.js +0 -19
- package/dist/chunk-RLYO6VVP.js.map +0 -1
- package/dist/chunk-SMJMXQ3T.js.map +0 -1
- package/dist/chunk-VJ4HOFBA.js.map +0 -1
- package/dist/handler-UMGSZY33.js +0 -10
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/core/redirects.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EAAE,OAAA,EAAS,WAAW,IAAI,CAAA,CAAA,EAAI,UAAA,EAAY,KAAA,CAAM,OAAA,EAAS,KAAA,GAAQ,EAAE,KAAA,EAAO,YAAY,IAAA,EAAM,CAAA,OAAA,EAAU,KAAA,CAAM,OAAA,CAAQ,KAAK,CAAA,CAAA,EAAG,GAAI,GAAA,EAAK,CAAC;AAAA,WAC5L;AAAA,UACA,gBAAgB,IAAI,CAAA,CAAA;AAAA;AACtB;AACF;AACF,GACF;AACF;;;ACnTO,IAAM,aAAA,GAAgB,OAAO,MAAA,CAAO;AAAA,EACzC,SAAA,EAAW;AAAA,IACT,IAAA,EAAM,iBAAA;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,oBAAA;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":"chunk-UUC5USJH.js","sourcesContent":["/**\n * Redirects an editor adds by hand: an old or short address on the site that\n * sends visitors somewhere else, permanently (301) or for now (302). The\n * destination is one of the site's own pages or landing pages, a place the\n * host app offers (`RedirectDestination`, a form or an offer, say), or any\n * other address. Page moves add their own redirects (`redirectsAfterMove`);\n * these helpers keep the same rules: one redirect per address, never from a\n * page's address or a reserved one, and no chains.\n */\nimport { isLandingPage } from \"./landing\";\nimport { isNotFoundPage, NOT_FOUND_PATH } from \"./not-found\";\nimport type { PageMeta, Redirect } from \"./schemas\";\nimport { redirectLoops } from \"./seo\";\nimport { DEFAULT_RESERVED_PATHS, isSafeHref, pagePathProblems, type ReservedPaths } from \"./urls\";\n\n/**\n * A place a redirect can go, offered in the editor's picker: `path` is a site\n * path (`/f/feedback`) or a full URL, `label` names it, and `group` is the\n * heading it is listed under (\"Forms\", \"Offers\").\n */\nexport interface RedirectDestination {\n group: string;\n label: string;\n path: string;\n}\n\n/** The site's own pages and landing pages as destinations, then the host's (`extra`), each path once. */\nexport function redirectDestinations(pages: readonly Pick<PageMeta, \"path\" | \"title\" | \"kind\">[], extra: readonly RedirectDestination[] = []): RedirectDestination[] {\n const own: RedirectDestination[] = [];\n for (const p of pages) if (!isNotFoundPage(p) && !isLandingPage(p)) own.push({ group: \"Pages\", label: p.title, path: p.path });\n for (const p of pages) if (isLandingPage(p)) own.push({ group: \"Landing pages\", label: p.title, path: p.path });\n const seen = new Set<string>();\n return [...own, ...extra].filter((d) => (seen.has(d.path) ? false : (seen.add(d.path), true)));\n}\n\n/** The path a site-path destination names, without its query or fragment; null for a full URL. */\nfunction sitePathOf(to: string): string | null {\n if (!to.startsWith(\"/\")) return null;\n const path = to.split(/[?#]/)[0]!;\n return path.length > 1 && path.endsWith(\"/\") ? path.slice(0, -1) : path;\n}\n\nexport interface RedirectContext {\n /** The site's redirects now. */\n redirects: readonly Redirect[];\n /** The site's pages: a redirect can't take a page's address. */\n pages: readonly Pick<PageMeta, \"path\">[];\n reserved?: ReservedPaths | undefined;\n /** The address of the redirect being edited, which may keep it. */\n editing?: string | undefined;\n}\n\n/** Why a redirect can't be from `from` (empty when it can). */\nexport function redirectFromProblems(from: string, ctx: RedirectContext, how: RedirectMatch = {}): string[] {\n const problems = pagePathProblems(from, ctx.reserved ?? DEFAULT_RESERVED_PATHS).map((p) => p.replace(/^A page path/, \"The old address\"));\n if (from === \"/\") problems.push(\"The home page can't redirect.\");\n if (from === NOT_FOUND_PATH) problems.push(`${NOT_FOUND_PATH} is the site's 404 page and can't redirect.`);\n // Pages win over a prefix redirect, so only an exact one would hide the page at its address.\n if (how.match !== \"prefix\" && ctx.pages.some((p) => p.path === from)) problems.push(`A page is at ${from}; a redirect there would hide it.`);\n if (from !== ctx.editing && ctx.redirects.some((r) => r.from === from)) problems.push(`${from} already redirects.`);\n return problems;\n}\n\n/** How a redirect matches: its `from` only, or everything under it too. */\nexport interface RedirectMatch {\n match?: \"prefix\" | undefined;\n keepRest?: boolean | undefined;\n}\n\n/** Why a redirect from `from` can't go to `to` (empty when it can). */\nexport function redirectToProblems(from: string, to: string, ctx: RedirectContext, how: RedirectMatch = {}): string[] {\n if (!to) return [\"Choose where it goes.\"];\n if (!isSafeHref(to) || to.startsWith(\"#\")) return [\"Use a site path (/about) or a full https link.\"];\n const target = sitePathOf(to);\n if (target === from) return [\"A redirect can't go to its own address.\"];\n if (how.match === \"prefix\" && target !== null && target.startsWith(`${from}/`)) return [`${to} is under ${from} itself, so it would redirect again.`];\n if (how.keepRest && how.match !== \"prefix\") return [\"Keeping the rest of the address needs everything under the old address.\"];\n if (how.keepRest && target === null) return [\"Keeping the rest of the address needs a site path (/team), not a full link.\"];\n const onward = target === null ? undefined : ctx.redirects.find((r) => r.from === target && r.from !== ctx.editing);\n if (onward) return [`${target} redirects to ${onward.to} itself; choose ${onward.to} instead.`];\n // Through the other redirects (an address under a prefix one, say) it may still come back here.\n const after = upsertRedirect(ctx.redirects, { from, to, status: 301, ...(how.match ? { match: how.match } : {}), ...(how.keepRest ? { keepRest: true } : {}) }, ctx.editing);\n const pages = new Set(ctx.pages.map((p) => p.path));\n if (redirectLoops(after, (p) => pages.has(p)).length) return [`Visitors would go round in circles: following the redirects from ${from} comes back to an address they passed.`];\n return [];\n}\n\n/**\n * The redirects with `next` added, or put in place of the one from `replacing`.\n * Redirects that went to `next.from` go straight to `next.to` (no chains),\n * and any left pointing at their own address are dropped.\n */\nexport function upsertRedirect(redirects: readonly Redirect[], next: Redirect, replacing?: string): Redirect[] {\n const out: Redirect[] = [];\n let placed = false;\n for (const r of redirects) {\n if (r.from === replacing || r.from === next.from) {\n if (!placed) out.push(next);\n placed = true;\n continue;\n }\n // Point straight at the new destination, unless that is under the redirect's own prefix (it would catch itself).\n const target = sitePathOf(next.to);\n const catchesItself = r.match === \"prefix\" && target !== null && (target === r.from || target.startsWith(`${r.from}/`));\n const pointed = sitePathOf(r.to) === next.from && !catchesItself ? { ...r, to: next.to } : r;\n if (sitePathOf(pointed.to) !== pointed.from) out.push(pointed);\n }\n if (!placed) out.push(next);\n return out;\n}\n\n/** The redirects without the one from `from`. */\nexport function removeRedirect(redirects: readonly Redirect[], from: string): Redirect[] {\n return redirects.filter((r) => r.from !== from);\n}\n","/**\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 // The header with a menu: it shows the button alone until the site has pages to list, then their links.\n header: [node(\"nav\", \"nav\", \"simple\", { 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 Works\",\n colors: { primary: \"#0f766e\", primaryDark: \"#2dd4bf\" },\n fonts: { heading: \"space-grotesk\", body: \"inter\" },\n },\n hilltop: {\n name: \"Hilltop Collective\",\n colors: { primary: \"#b45309\", primaryDark: \"#fbbf24\" },\n fonts: { heading: \"playfair-display\", body: \"work-sans\" },\n },\n} satisfies Record<string, SiteBrand>);\n"]}
|
package/dist/editor.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { P as PageMeta, a as PageKind, b as PageDoc,
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { P as PageMeta, a as PageKind, b as PageDoc, F as FormsResolver, R as Release, c as RenderContext, d as ResolvedForm, S as SectionCategory, A as AnySectionDefinition, e as Seo, f as SectionNode, g as SiteDoc } from './registry-Cw7NF_le.js';
|
|
3
|
+
import { A as Asset, a as AssetMeta, S as SiteStore, b as SiteIssue, c as SiteCheckLevels, P as PublishOptions, R as ReservedPaths, d as SaveResult } from './store-BNYD5NAQ.js';
|
|
4
|
+
import { B as BrandInput } from './theme-HJzN2tOm.js';
|
|
5
|
+
import { R as RedirectDestination } from './redirects-LcCNIJHQ.js';
|
|
5
6
|
import { Config, Fields, Overrides } from '@puckeditor/core';
|
|
6
7
|
export { Config as PuckConfig, Data as PuckData, Overrides as PuckOverrides, createUsePuck, usePuck } from '@puckeditor/core';
|
|
7
8
|
import '@marktiderman/genesis-media';
|
|
@@ -24,12 +25,11 @@ interface PickedImage {
|
|
|
24
25
|
width?: number;
|
|
25
26
|
height?: number;
|
|
26
27
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
*/
|
|
28
|
+
/** One form a form section can show: its slug (what the section stores) and its name. */
|
|
29
|
+
interface FormOption {
|
|
30
|
+
slug: string;
|
|
31
|
+
title: string;
|
|
32
|
+
}
|
|
33
33
|
|
|
34
34
|
/** A store the editor can drive. `reorderPages` is optional: without it, page order is the store's. */
|
|
35
35
|
type EditorSiteStore = SiteStore & {
|
|
@@ -47,13 +47,24 @@ interface SiteCheck {
|
|
|
47
47
|
*
|
|
48
48
|
* @stability Beta
|
|
49
49
|
*/
|
|
50
|
-
|
|
50
|
+
/** The forms a site can show: the resolver that renders them, and the list the editor's picker offers. */
|
|
51
|
+
type SiteFormsOptions = {
|
|
52
|
+
forms?: FormsResolver;
|
|
53
|
+
/**
|
|
54
|
+
* The host's forms. When given, a form section's slug must be one of them: a resolver may embed
|
|
55
|
+
* any well-formed slug, and the list is what the editor offers, so the check agrees with it.
|
|
56
|
+
*/
|
|
57
|
+
listForms?: () => Promise<readonly FormOption[]>;
|
|
58
|
+
/** The checks the app chooses (sample pictures, missing forms): each blocks, warns (the default) or is off. */
|
|
59
|
+
checks?: SiteCheckLevels;
|
|
60
|
+
};
|
|
61
|
+
declare function checkSite(store: SiteStore, siteId: string, options?: Pick<PublishOptions, "brand" | "reserved"> & SiteFormsOptions): Promise<SiteCheck>;
|
|
51
62
|
/** Publish after checking: a site with errors is refused before the store is asked. */
|
|
52
63
|
declare function publishSite(store: SiteStore, siteId: string, options: {
|
|
53
64
|
brand: BrandInput;
|
|
54
65
|
note?: string;
|
|
55
66
|
reserved?: ReservedPaths;
|
|
56
|
-
}): Promise<{
|
|
67
|
+
} & SiteFormsOptions): Promise<{
|
|
57
68
|
release: Release;
|
|
58
69
|
} | {
|
|
59
70
|
blocked: SiteIssue[];
|
|
@@ -62,6 +73,7 @@ declare function publishSite(store: SiteStore, siteId: string, options: {
|
|
|
62
73
|
declare function pathProblems(path: string, pages: readonly Pick<PageMeta, "id" | "path">[], options?: {
|
|
63
74
|
reserved?: ReservedPaths;
|
|
64
75
|
except?: string;
|
|
76
|
+
notFoundPage?: boolean;
|
|
65
77
|
}): string[];
|
|
66
78
|
/** A page's title as a path segment: "Our services" → "/our-services". */
|
|
67
79
|
declare function slugify(title: string): string;
|
|
@@ -85,9 +97,11 @@ interface PageTemplate {
|
|
|
85
97
|
}): PageDoc;
|
|
86
98
|
}
|
|
87
99
|
/**
|
|
88
|
-
* The
|
|
89
|
-
*
|
|
90
|
-
* contact) after its home page.
|
|
100
|
+
* The page templates: a blank page, the one-click landing page from the
|
|
101
|
+
* brand, the 404 page, the blog (the post page), and each page of the
|
|
102
|
+
* starter site (about, contact) after its home page. The Add page dialog
|
|
103
|
+
* offers all but the landing page (made under Landing pages) and the 404
|
|
104
|
+
* page (made under Page not found).
|
|
91
105
|
*
|
|
92
106
|
* @stability Beta
|
|
93
107
|
*/
|
|
@@ -113,6 +127,7 @@ declare function createLandingPage(store: SiteStore, siteId: string, input: {
|
|
|
113
127
|
slug: string;
|
|
114
128
|
brand: BrandInput;
|
|
115
129
|
reserved?: ReservedPaths;
|
|
130
|
+
defaultDirectory?: string;
|
|
116
131
|
}): Promise<PageMeta>;
|
|
117
132
|
/**
|
|
118
133
|
* Give a landing page a new slug under the site's landing directory (a page
|
|
@@ -123,6 +138,7 @@ declare function createLandingPage(store: SiteStore, siteId: string, input: {
|
|
|
123
138
|
*/
|
|
124
139
|
declare function moveLandingPage(store: SiteStore, pageId: string, slug: string, options?: {
|
|
125
140
|
reserved?: ReservedPaths;
|
|
141
|
+
defaultDirectory?: string;
|
|
126
142
|
}): Promise<PageMeta>;
|
|
127
143
|
/**
|
|
128
144
|
* Change where new landing pages go (`site.landing.directory`). With
|
|
@@ -149,6 +165,7 @@ declare function moveLandingPage(store: SiteStore, pageId: string, slug: string,
|
|
|
149
165
|
declare function setLandingDirectory(store: SiteStore, siteId: string, directory: string, options?: {
|
|
150
166
|
movePages?: boolean;
|
|
151
167
|
reserved?: ReservedPaths;
|
|
168
|
+
defaultDirectory?: string;
|
|
152
169
|
}): Promise<{
|
|
153
170
|
directory: string;
|
|
154
171
|
moved: PageMeta[];
|
|
@@ -184,12 +201,22 @@ interface SiteEditorProps {
|
|
|
184
201
|
store: EditorSiteStore;
|
|
185
202
|
/** The site's brand: the canvas theme, and what a publish checks contrast against. */
|
|
186
203
|
brand: BrandInput;
|
|
187
|
-
/** Resolves form embeds' slugs, for the canvas and preview. */
|
|
204
|
+
/** Resolves form embeds' slugs, for the canvas and preview, and checks each one exists before a publish. */
|
|
188
205
|
forms?: FormsResolver;
|
|
206
|
+
/** The forms a form section can show, for its picker; without it, the form's slug is typed in. */
|
|
207
|
+
listForms?: () => Promise<readonly FormOption[]>;
|
|
208
|
+
/**
|
|
209
|
+
* The publish checks the app chooses: sample pictures left in a section
|
|
210
|
+
* (`sampleImages`) and form sections naming no form the host has
|
|
211
|
+
* (`missingForms`). Each blocks, warns or is off; left out, it warns.
|
|
212
|
+
*/
|
|
213
|
+
checks?: SiteCheckLevels;
|
|
189
214
|
/** The asset library and upload, beside the store's `putAsset`. */
|
|
190
215
|
assets?: EditorAssets;
|
|
191
216
|
/** After each publish. */
|
|
192
217
|
onPublish?: (release: Release) => void;
|
|
218
|
+
/** The host's page for the brand's fonts, colours and logo; the Pages tab links to it. */
|
|
219
|
+
brandSettingsHref?: string;
|
|
193
220
|
/**
|
|
194
221
|
* Whether anything isn't saved yet (waiting, saving, a conflict, a failed save, or a change that
|
|
195
222
|
* can't be saved until it's fixed). Block your app's own navigation while it's true: closing the
|
|
@@ -198,6 +225,14 @@ interface SiteEditorProps {
|
|
|
198
225
|
onDirtyChange?: (dirty: boolean) => void;
|
|
199
226
|
/** Paths the site can't use (default: the store's own rule). */
|
|
200
227
|
reserved?: ReservedPaths;
|
|
228
|
+
/** Where new landing pages go on a site that hasn't chosen (`site.landing` unset); default `/go`. */
|
|
229
|
+
landingDirectory?: string;
|
|
230
|
+
/**
|
|
231
|
+
* Places the host app publishes on the site's address that a redirect can go to, listed in the
|
|
232
|
+
* Redirects picker after the site's own pages and landing pages: `{ group: "Forms", label:
|
|
233
|
+
* "Feedback", path: "/f/feedback" }`. A `path` is a site path or a full URL.
|
|
234
|
+
*/
|
|
235
|
+
destinations?: readonly RedirectDestination[];
|
|
201
236
|
/** A link to the host's preview route for a page path (opens in a new tab). */
|
|
202
237
|
previewUrl?: (path: string) => string;
|
|
203
238
|
/** Milliseconds after the last change before a save (default 800). */
|
|
@@ -223,7 +258,7 @@ interface SiteEditorProps {
|
|
|
223
258
|
*
|
|
224
259
|
* @stability Beta
|
|
225
260
|
*/
|
|
226
|
-
declare function SiteEditor({ siteId, store, brand, forms, assets, onPublish, reserved, previewUrl, autosaveDelay, initialPageId, siteStylesheet, readOnly, onDirtyChange, className }: SiteEditorProps): React.JSX.Element;
|
|
261
|
+
declare function SiteEditor({ siteId, store, brand, forms, listForms, checks, assets, onPublish, brandSettingsHref, reserved, landingDirectory: defaultLanding, destinations, previewUrl, autosaveDelay, initialPageId, siteStylesheet, readOnly, onDirtyChange, className }: SiteEditorProps): React.JSX.Element;
|
|
227
262
|
|
|
228
263
|
/** What the Add picker and its limits know about one Puck component. */
|
|
229
264
|
interface ComponentInfo {
|
|
@@ -284,6 +319,7 @@ declare function createEditorConfig(options?: EditorConfigOptions): EditorConfig
|
|
|
284
319
|
* image picker, which asks for alt text;
|
|
285
320
|
* - `x-genesis-kind: "rich-text"` → the Genesis rich text editor;
|
|
286
321
|
* - `x-genesis-kind: "slot"` → a Puck slot (nested sections);
|
|
322
|
+
* - `x-genesis-kind: "form"` → a picker of the host's forms (`listForms`);
|
|
287
323
|
* - an enum, or a union of constants → a select;
|
|
288
324
|
* - a boolean → a yes/no radio; a number → a number input;
|
|
289
325
|
* - a string → text, or a textarea when it may run past 160 characters;
|
|
@@ -327,6 +363,16 @@ declare function sectionFields(def: AnySectionDefinition, options?: {
|
|
|
327
363
|
* and come back out on save. A page's header and footer (site parts) are
|
|
328
364
|
* slots on Puck's root, so the canvas shows and edits the whole page.
|
|
329
365
|
*
|
|
366
|
+
* A placeholder (sample content) carries the props it started with in
|
|
367
|
+
* `_placeholder`, so it stays one, wherever it came from (a template, or a
|
|
368
|
+
* `sample` preset added in the editor), until its props change.
|
|
369
|
+
*
|
|
370
|
+
* Puck draws an item over its component's `defaultProps` (the first preset's
|
|
371
|
+
* props), not only on insert. So an item from a document names every key of
|
|
372
|
+
* those defaults, set to `undefined` when the node doesn't have it: the canvas
|
|
373
|
+
* then draws what the document holds, as the live site does, never a preset's
|
|
374
|
+
* copy the page doesn't have.
|
|
375
|
+
*
|
|
330
376
|
* The editor's Add picker offers each section's presets: a preset after the
|
|
331
377
|
* first is its own Puck component, `type__n`, and turns back into `type` on
|
|
332
378
|
* save, so stored documents only ever name registered types.
|
|
@@ -385,13 +431,24 @@ interface FromItemOptions {
|
|
|
385
431
|
slotKeys?: SlotKeys;
|
|
386
432
|
/**
|
|
387
433
|
* A hash of the props each template placeholder had when the editor
|
|
388
|
-
* opened it (`placeholderSnapshot`), by section id
|
|
389
|
-
*
|
|
434
|
+
* opened it (`placeholderSnapshot`), by section id, for an item whose
|
|
435
|
+
* `_placeholder` is `true` (an item from `nodeToItem` carries its own
|
|
436
|
+
* starting props instead). A placeholder stays one only while its props
|
|
437
|
+
* are unchanged: editing it clears the flag.
|
|
390
438
|
*/
|
|
391
439
|
placeholders?: ReadonlyMap<string, string>;
|
|
392
440
|
}
|
|
393
441
|
/** A Puck item as a node. */
|
|
394
442
|
declare function itemToNode(item: PuckItem, options?: FromItemOptions): SectionNode;
|
|
443
|
+
/**
|
|
444
|
+
* Is this Puck item a placeholder nobody has edited yet (sample content, as
|
|
445
|
+
* it came from its template or preset)? Its text fields then show their
|
|
446
|
+
* values as hints, so typing replaces the sample rather than adding to it.
|
|
447
|
+
*/
|
|
448
|
+
declare function isUneditedSample(item: {
|
|
449
|
+
type: string;
|
|
450
|
+
props: Record<string, unknown>;
|
|
451
|
+
} | null | undefined, options?: Pick<FromItemOptions, "placeholders">): boolean;
|
|
395
452
|
/** A hash of every placeholder node's props, to tell later whether it was edited. */
|
|
396
453
|
declare function placeholderSnapshot(nodes: readonly SectionNode[], into?: Map<string, string>): Map<string, string>;
|
|
397
454
|
/** A page (and its site's header and footer) as the editor's Puck data. */
|
|
@@ -598,4 +655,4 @@ interface GenesisOverrideOptions {
|
|
|
598
655
|
}
|
|
599
656
|
declare function genesisOverrides(info: ReadonlyMap<string, ComponentInfo>, extra?: Partial<Overrides>, options?: GenesisOverrideOptions): Partial<Overrides>;
|
|
600
657
|
|
|
601
|
-
export { AssetPicker, type AssetPickerProps, AutosaveBlockedError, type AutosaveState, type AutosaveStatus, Autosaver, type AutosaverOptions, type CanvasMetadata, type ComponentInfo, type EditorAssets, type EditorConfig, type EditorConfigOptions, type EditorData, type EditorRootProps, type EditorSiteStore, type FromEditorResult, IMAGE_TYPES, LandingDirectoryError, NODE_KEYS, type PageTemplate, type PickedImage, type PreviewInput, type PreviewResult, type PuckItem, type SectionFields, type SiteCheck, SiteEditor, type SiteEditorProps, checkSite, countTypes, createEditorConfig, createLandingPage, fromEditorData, genesisOverrides, h1SectionId, humanize, itemToNode, moveLandingPage, movePageInList, nodeToItem, pageTemplates, pathProblems, placeholderSnapshot, presetComponentName, pruneEmpty, publishSite, renamePage, renderPreview, safeSectionId, sectionFields, sectionTypeOf, setLandingDirectory, slugify, toEditorData, uploadProblem };
|
|
658
|
+
export { AssetPicker, type AssetPickerProps, AutosaveBlockedError, type AutosaveState, type AutosaveStatus, Autosaver, type AutosaverOptions, type CanvasMetadata, type ComponentInfo, type EditorAssets, type EditorConfig, type EditorConfigOptions, type EditorData, type EditorRootProps, type EditorSiteStore, type FormOption, type FromEditorResult, IMAGE_TYPES, LandingDirectoryError, NODE_KEYS, type PageTemplate, type PickedImage, type PreviewInput, type PreviewResult, type PuckItem, RedirectDestination, type SectionFields, type SiteCheck, SiteEditor, type SiteEditorProps, type SiteFormsOptions, checkSite, countTypes, createEditorConfig, createLandingPage, fromEditorData, genesisOverrides, h1SectionId, humanize, isUneditedSample, itemToNode, moveLandingPage, movePageInList, nodeToItem, pageTemplates, pathProblems, placeholderSnapshot, presetComponentName, pruneEmpty, publishSite, renamePage, renderPreview, safeSectionId, sectionFields, sectionTypeOf, setLandingDirectory, slugify, toEditorData, uploadProblem };
|