@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
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as AnySectionDefinition, U as ReleaseSnapshot, h as ReleasePage, g as SiteDoc, R as Release, P as PageMeta, b as PageDoc, a as PageKind, T as ReleaseMeta, i as PostSummary, L as LivePost, G as PostMeta, E as PostDraft, Y as SavePostInput, Z as SavePostResult, p as ImportPost, q as ImportPostsResult, a7 as SiteDocInput, z as PostDoc, K as PostStatus } from './registry-
|
|
2
|
-
import { b as SiteTheme, B as BrandInput } from './theme-
|
|
1
|
+
import { A as AnySectionDefinition, U as ReleaseSnapshot, h as ReleasePage, g as SiteDoc, R as Release, P as PageMeta, b as PageDoc, a as PageKind, T as ReleaseMeta, i as PostSummary, L as LivePost, G as PostMeta, E as PostDraft, Y as SavePostInput, Z as SavePostResult, p as ImportPost, q as ImportPostsResult, a7 as SiteDocInput, z as PostDoc, K as PostStatus } from './registry-Cw7NF_le.js';
|
|
2
|
+
import { b as SiteTheme, B as BrandInput } from './theme-HJzN2tOm.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* URL and path rules shared by the schemas, the renderer and the database.
|
|
@@ -15,7 +15,7 @@ import { b as SiteTheme, B as BrandInput } from './theme-Cg-inpk5.js';
|
|
|
15
15
|
declare const MAX_URL_LENGTH = 2048;
|
|
16
16
|
/** Is this a link a site may render: a site path, a fragment, or an http(s), mailto or tel URL? */
|
|
17
17
|
declare function isSafeHref(value: unknown): value is string;
|
|
18
|
-
/** Is this a URL an image may load from: a site path
|
|
18
|
+
/** Is this a URL an image may load from: a site path, an `https:` URL, or http on this computer (`isLocalDevUrl`)? */
|
|
19
19
|
declare function isSafeImageSrc(value: unknown): value is string;
|
|
20
20
|
/** Is this an external (absolute) link, opened with `rel="noopener noreferrer"`? */
|
|
21
21
|
declare function isExternalHref(href: string): boolean;
|
|
@@ -58,6 +58,28 @@ interface SiteIssue {
|
|
|
58
58
|
sectionId?: string;
|
|
59
59
|
}
|
|
60
60
|
declare const isPublishable: (issues: readonly SiteIssue[]) => boolean;
|
|
61
|
+
/** What a check the app chooses does: stop the publish, list a warning, or nothing. */
|
|
62
|
+
type CheckLevel = "block" | "warn" | "off";
|
|
63
|
+
/**
|
|
64
|
+
* The publish checks an app chooses for itself. Each one blocks, warns or is
|
|
65
|
+
* off; left out, it warns.
|
|
66
|
+
*
|
|
67
|
+
* @stability Beta
|
|
68
|
+
*/
|
|
69
|
+
interface SiteCheckLevels {
|
|
70
|
+
/** A section still showing one of the starter sample pictures (`sample-image`). */
|
|
71
|
+
sampleImages?: CheckLevel;
|
|
72
|
+
/** A form section naming a form the host doesn't have, or none (`form-missing`). */
|
|
73
|
+
missingForms?: CheckLevel;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* The issues as the app's check levels have them: a chosen check's issue is an
|
|
77
|
+
* error when it blocks, a warning when it warns (the default), and dropped
|
|
78
|
+
* when it's off. Every other issue is left as it is.
|
|
79
|
+
*
|
|
80
|
+
* @stability Beta
|
|
81
|
+
*/
|
|
82
|
+
declare function applyCheckLevels(issues: readonly SiteIssue[], levels?: SiteCheckLevels): SiteIssue[];
|
|
61
83
|
type Lookup = (type: string) => AnySectionDefinition | undefined;
|
|
62
84
|
/**
|
|
63
85
|
* Is this URL the site's own: a site path (`/photo.jpg`), or a URL on one of
|
|
@@ -88,6 +110,8 @@ interface CheckReleaseOptions {
|
|
|
88
110
|
logo?: string;
|
|
89
111
|
lookup?: Lookup;
|
|
90
112
|
reserved?: ReservedPaths;
|
|
113
|
+
/** The sample-pictures check the app chooses: blocks, warns (the default) or is off. Missing forms are `checkSite`'s. */
|
|
114
|
+
checks?: Pick<SiteCheckLevels, "sampleImages">;
|
|
91
115
|
}
|
|
92
116
|
/**
|
|
93
117
|
* Everything a publish checks, for a whole release.
|
|
@@ -176,6 +200,8 @@ interface PublishOptions {
|
|
|
176
200
|
* where images load from. A store adds its own `assetOrigin`.
|
|
177
201
|
*/
|
|
178
202
|
assetOrigins?: readonly string[];
|
|
203
|
+
/** The sample-pictures check the app chooses: blocks, warns (the default) or is off. Missing forms are `checkSite`'s. */
|
|
204
|
+
checks?: Pick<SiteCheckLevels, "sampleImages">;
|
|
179
205
|
}
|
|
180
206
|
interface NewPage {
|
|
181
207
|
path: string;
|
|
@@ -363,4 +389,4 @@ interface MemoryStoreOptions {
|
|
|
363
389
|
*/
|
|
364
390
|
declare function createMemorySiteStore(options?: MemoryStoreOptions): MemorySiteStore;
|
|
365
391
|
|
|
366
|
-
export { type Asset as A,
|
|
392
|
+
export { type Asset as A, checkSiteDoc as B, type CheckLevel as C, DEFAULT_RESERVED_PATHS as D, createMemorySiteStore as E, formCacheTag as F, isConflict as G, isExternalHref as H, type InvalidationInfo as I, isOwnUrl as J, isPublishable as K, isReservedPath as L, MAX_PAGE_PATH_LENGTH as M, type NewPage as N, isSafeHref as O, type PublishOptions as P, isSafeImageSrc as Q, type ReservedPaths as R, type SiteStore as S, normalizeRequestPath as T, pagePathProblems as U, prepareImportPost as V, prepareRelease as W, siteCacheTag as X, validatePagePath as Y, withCacheInvalidation as Z, type AssetMeta as a, type SiteIssue as b, type SiteCheckLevels as c, type SaveResult as d, ASSET_TYPES as e, type AssetHostOptions as f, type CheckReleaseOptions as g, MAX_URL_LENGTH as h, type MemorySiteStore as i, type MemoryStoreOptions as j, type NewSite as k, PAGE_PATH as l, type PageDraft as m, type PreparedRelease as n, PublishBlockedError as o, SiteConflictError as p, type SiteDraft as q, applyCheckLevels as r, assetPath as s, checkAssetHosts as t, checkBlog as u, checkContrast as v, checkHtmlOutline as w, checkPage as x, checkPost as y, checkRelease as z };
|
package/dist/supabase.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { SupabaseClient } from '@supabase/supabase-js';
|
|
2
|
-
import { S as SiteStore } from './store-
|
|
3
|
-
export {
|
|
4
|
-
import './registry-
|
|
2
|
+
import { S as SiteStore } from './store-BNYD5NAQ.js';
|
|
3
|
+
export { e as ASSET_TYPES } from './store-BNYD5NAQ.js';
|
|
4
|
+
import './registry-Cw7NF_le.js';
|
|
5
5
|
import '@marktiderman/genesis-media';
|
|
6
6
|
import 'react';
|
|
7
7
|
import 'zod';
|
|
8
|
-
import './theme-
|
|
8
|
+
import './theme-HJzN2tOm.js';
|
|
9
9
|
import '@marktiderman/genesis-design-system';
|
|
10
10
|
|
|
11
11
|
/**
|
package/dist/supabase.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { prepareImportPost, checkPost, isPublishable, PublishBlockedError, assetPath, ASSET_TYPES, prepareRelease } from './chunk-
|
|
2
|
-
export { ASSET_TYPES } from './chunk-
|
|
3
|
-
import { MAX_IMPORT_POSTS, validatePostSlug, PostDoc, PostSummarySchema, PageDoc, SiteDoc, parseSnapshot, ReleaseSnapshot } from './chunk-
|
|
4
|
-
import './chunk-
|
|
1
|
+
import { prepareImportPost, checkPost, isPublishable, PublishBlockedError, assetPath, ASSET_TYPES, prepareRelease } from './chunk-UOKNFG5O.js';
|
|
2
|
+
export { ASSET_TYPES } from './chunk-UOKNFG5O.js';
|
|
3
|
+
import { MAX_IMPORT_POSTS, validatePostSlug, PostDoc, PostSummarySchema, PageDoc, SiteDoc, parseSnapshot, ReleaseSnapshot } from './chunk-QGU6FDH5.js';
|
|
4
|
+
import './chunk-CXBBUKGB.js';
|
|
5
5
|
|
|
6
6
|
// src/supabase/index.ts
|
|
7
7
|
var SITES_SCHEMA = "genesis_sites";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { s as Link, a7 as SiteDocInput, a as PageKind, b as PageDoc } from './registry-
|
|
2
|
-
import { S as SiteBrand, B as BrandInput } from './theme-
|
|
1
|
+
import { s as Link, a7 as SiteDocInput, a as PageKind, b as PageDoc } from './registry-Cw7NF_le.js';
|
|
2
|
+
import { S as SiteBrand, B as BrandInput } from './theme-HJzN2tOm.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Templates: whole sites from a little input.
|
package/dist/templates.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { l as BuiltInSectionType, a3 as SectionPreset } from './registry-
|
|
2
|
-
import { S as SiteBrand } from './theme-
|
|
3
|
-
import { a as TemplateMessage } from './templates-
|
|
1
|
+
import { l as BuiltInSectionType, a3 as SectionPreset } from './registry-Cw7NF_le.js';
|
|
2
|
+
import { S as SiteBrand } from './theme-HJzN2tOm.js';
|
|
3
|
+
import { a as TemplateMessage } from './templates-DPv0OYLl.js';
|
|
4
4
|
import { DesignSystem } from '@marktiderman/genesis-design-system';
|
|
5
5
|
import '@marktiderman/genesis-media';
|
|
6
6
|
import 'react';
|
package/dist/templates.js
CHANGED
|
@@ -62,6 +62,7 @@ var message = {
|
|
|
62
62
|
var team = [
|
|
63
63
|
{
|
|
64
64
|
name: "Coach cards",
|
|
65
|
+
sample: true,
|
|
65
66
|
variant: "cards",
|
|
66
67
|
props: {
|
|
67
68
|
heading: "Meet the coaches",
|
|
@@ -75,6 +76,7 @@ var team = [
|
|
|
75
76
|
var schedule = [
|
|
76
77
|
{
|
|
77
78
|
name: "Class timetable",
|
|
79
|
+
sample: true,
|
|
78
80
|
variant: "grid",
|
|
79
81
|
props: {
|
|
80
82
|
heading: "Class times",
|
|
@@ -96,6 +98,7 @@ var schedule = [
|
|
|
96
98
|
var features = [
|
|
97
99
|
{
|
|
98
100
|
name: "First visit steps",
|
|
101
|
+
sample: true,
|
|
99
102
|
variant: "steps",
|
|
100
103
|
props: {
|
|
101
104
|
heading: "How to start",
|
|
@@ -108,14 +111,15 @@ var features = [
|
|
|
108
111
|
}
|
|
109
112
|
];
|
|
110
113
|
var stats = [
|
|
111
|
-
{ name: "Gym in numbers", variant: "row", props: { items: [{ value: "12", label: "years open" }, { value: "40+", label: "classes a week" }, { value: "6", label: "coaches" }] } }
|
|
114
|
+
{ name: "Gym in numbers", sample: true, variant: "row", props: { items: [{ value: "12", label: "years open" }, { value: "40+", label: "classes a week" }, { value: "6", label: "coaches" }] } }
|
|
112
115
|
];
|
|
113
116
|
var logos = [
|
|
114
|
-
{ name: "Gym trust bar", variant: "trust-bar", props: { claim: "Why people train here", items: [{ name: "Small classes" }, { name: "Friendly coaches" }, { name: "Free first visit" }], surface: "inverse" } }
|
|
117
|
+
{ name: "Gym trust bar", sample: true, variant: "trust-bar", props: { claim: "Why people train here", items: [{ name: "Small classes" }, { name: "Friendly coaches" }, { name: "Free first visit" }], surface: "inverse" } }
|
|
115
118
|
];
|
|
116
119
|
var pricing = [
|
|
117
120
|
{
|
|
118
121
|
name: "Memberships",
|
|
122
|
+
sample: true,
|
|
119
123
|
variant: "cards",
|
|
120
124
|
props: {
|
|
121
125
|
heading: "Memberships",
|
|
@@ -127,7 +131,7 @@ var pricing = [
|
|
|
127
131
|
}
|
|
128
132
|
];
|
|
129
133
|
var file = [
|
|
130
|
-
{ name: "Forms to bring", variant: "cards", props: { heading: "Forms to bring", files: [{ label: "Waiver", description: "Sign it before your first class.", file: { src: "/files/waiver.pdf", mime: "application/pdf" } }] } }
|
|
134
|
+
{ name: "Forms to bring", sample: true, variant: "cards", props: { heading: "Forms to bring", files: [{ label: "Waiver", description: "Sign it before your first class.", file: { src: "/files/waiver.pdf", mime: "application/pdf" } }] } }
|
|
131
135
|
];
|
|
132
136
|
var fitness = Object.freeze({
|
|
133
137
|
id: "fitness",
|
package/dist/templates.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/templates/design-systems.ts","../src/templates/fitness.ts","../src/templates/index.ts"],"names":[],"mappings":";;;AAkBO,IAAM,oBAAkC,kBAAA,CAAmB;AAAA,EAChE,IAAA,EAAM,OAAA;AAAA,EACN,OAAA,EAAS,CAAA;AAAA,EACT,KAAA,EAAO,OAAA;AAAA,EACP,WAAA,EAAa,mGAAA;AAAA,EACb,IAAA,EAAM;AAAA,IACJ,IAAA,EAAM,EAAE,GAAG,YAAA,EAAc,OAAA,EAAS,EAAE,GAAA,EAAK,CAAA,EAAG,GAAA,EAAK,CAAA,EAAE,EAAG,EAAA,EAAI,EAAE,GAAA,EAAK,GAAA,EAAK,GAAA,EAAK,CAAA,EAAE,EAA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K,EAAE,KAAA,EAAO,gBAAgB,IAAA,EAAM,UAAA,EAAW,EAAG,CAAA,EAAE;AAAA,QACjK,EAAE,OAAA,EAAS,YAAA,EAAc,MAAA,EAAQ,QAAA,EAAU,KAAA,EAAO,CAAC,EAAE,IAAA,EAAM,WAAA,EAAa,KAAA,EAAO,MAAA,EAAQ,MAAA,EAAQ,aAAa,WAAA,EAAa,0BAAA,EAA4B,WAAA,EAAa,IAAA,EAAM,GAAA,EAAK,EAAE,KAAA,EAAO,MAAA,EAAQ,IAAA,EAAM,UAAA,EAAW,EAAG,CAAA;AAAE;AACtN;AACF;AAEJ,CAAA;AAEA,IAAM,IAAA,GAAwB;AAAA,EAC5B,EAAE,IAAA,EAAM,gBAAA,EAAkB,OAAA,EAAS,OAAA,EAAS,OAAO,EAAE,OAAA,EAAS,gBAAA,EAAkB,KAAA,EAAO,CAAC,EAAE,OAAO,QAAA,EAAU,WAAA,EAAa,kCAAA,EAAoC,IAAA,EAAM,EAAE,GAAA,EAAK,mBAAA,EAAqB,IAAA,EAAM,iBAAA,EAAkB,EAAG,CAAA,EAAE;AAC7N,CAAA;AAGO,IAAM,OAAA,GAA4B,OAAO,MAAA,CAAO;AAAA,EACrD,EAAA,EAAI,SAAA;AAAA,EACJ,KAAA,EAAO,SAAA;AAAA,EACP,KAAA;AAAA,EACA,OAAA;AAAA,EACA,aAAA,EAAe,CAAC,iBAAA,EAAmB,kBAAkB,CAAA;AAAA,EACrD,OAAA,EAAS,EAAE,IAAA,EAAM,QAAA,EAAU,UAAU,KAAA,EAAO,KAAA,EAAO,SAAS,IAAA;AAC9D,CAAC;;;AC1FM,IAAM,iBAAA,GAAgE,OAAO,MAAA,CAAO,EAAE,CAAC,OAAA,CAAQ,EAAE,GAAG,OAAA,EAAS","file":"templates.js","sourcesContent":["/**\n * Industry design systems: template content, defined like the neutral ones\n * in genesis-design-system (`defineDesignSystem`). A host registers the ones\n * it offers (`registerDesignSystem(...industryDesignSystems)`), and a brand\n * names one by id (`{ designSystem: { id: \"forge@1\" } }`).\n *\n * Each is a set of tokens only: no section renders differently because of\n * it, so swapping one for another (or for a neutral one) re-themes a site\n * without touching its pages.\n */\nimport { DEFAULT_RAMP, defineDesignSystem, type DesignSystem } from \"@marktiderman/genesis-design-system\";\n\n/**\n * Forge: bold and athletic. Poster-sized headings (up to 112px, capitals in\n * a condensed face), square corners and 2px edges, a cool ground, crisp\n * photos with a little grain, and lively motion. For a strength gym or a\n * training box.\n */\nexport const forgeDesignSystem: DesignSystem = defineDesignSystem({\n name: \"forge\",\n version: 1,\n label: \"Forge\",\n description: \"Bold and athletic: poster headings, square corners, heavy edges, a cool ground and lively motion.\",\n type: {\n ramp: { ...DEFAULT_RAMP, display: { min: 3, max: 7 }, h1: { min: 2.5, max: 5 }, h2: { min: 2, max: 3.5 } },\n classes: {\n condensed: { displayWeight: 400, headingWeight: 400, displayTracking: 0.01, headingTracking: 0.01, case: \"upper\", displayLeading: 0.88 },\n grotesk: { displayWeight: 700, headingWeight: 700, displayTracking: -0.01, headingTracking: -0.005, case: \"upper\", displayLeading: 0.92 },\n geometric: { displayWeight: 700, headingWeight: 700, displayTracking: -0.01, case: \"upper\", displayLeading: 0.95 },\n },\n eyebrow: { weight: 600, tracking: 0.14, case: \"upper\" },\n },\n space: { density: \"normal\" },\n shape: { corners: \"square\", borderWidth: 2, shadow: \"flat\" },\n surfaces: { ground: \"chalk\" },\n image: { filter: \"crisp\", grain: 3, scrim: \"full\" },\n motion: { level: \"lively\" },\n});\n\n/**\n * Studio: calm. A warm ground, generous space, rounded corners, soft\n * shadows, light headings that never shout (no display step bigger than an\n * h1), warm photos and calm motion. For a yoga or Pilates studio.\n */\nexport const studioDesignSystem: DesignSystem = defineDesignSystem({\n name: \"studio\",\n version: 1,\n label: \"Studio\",\n description: \"Calm: a warm ground, generous space, rounded corners, soft shadows, light headings and calm motion.\",\n type: {\n ramp: { ...DEFAULT_RAMP, display: { min: 2.5, max: 4.75 }, h1: { min: 2.25, max: 4 } },\n leading: { display: 1.05, h1: 1.05 },\n classes: {\n serif: { displayWeight: 400, headingWeight: 400, displayTracking: -0.015, headingTracking: -0.01, displayLeading: 1.05 },\n grotesk: { displayWeight: 400, headingWeight: 500, displayTracking: -0.025, headingTracking: -0.015, displayLeading: 1.05 },\n geometric: { displayWeight: 400, headingWeight: 500, displayTracking: -0.02, displayLeading: 1.05 },\n condensed: { displayWeight: 400, headingWeight: 400, case: \"as-written\", displayLeading: 1 },\n },\n eyebrow: { weight: 500, tracking: 0.18, case: \"upper\" },\n },\n space: { density: \"generous\" },\n shape: { corners: \"round\", borderWidth: 1, shadow: \"soft\" },\n surfaces: { ground: \"paper\" },\n image: { filter: \"warm\", grain: 0, scrim: \"full\" },\n motion: { level: \"calm\" },\n});\n\n/** Every industry design system in this library. */\nexport const industryDesignSystems: readonly DesignSystem[] = Object.freeze([forgeDesignSystem, studioDesignSystem]);\n","/**\n * Fitness: section presets and sample data for a functional fitness gym.\n *\n * Template content only, on the neutral sections: nothing here changes how a\n * section renders. The business is made up.\n */\nimport type { SectionPreset } from \"../core/registry\";\nimport type { SiteBrand } from \"../core/theme\";\nimport type { TemplateMessage } from \"../core/templates\";\nimport type { IndustryTemplate } from \"./types\";\nimport { forgeDesignSystem, studioDesignSystem } from \"./design-systems\";\n\nconst brand: SiteBrand = {\n name: \"Riverside Gym\",\n colors: { primary: \"#0f766e\", primaryDark: \"#2dd4bf\" },\n fonts: { heading: \"space-grotesk\", body: \"inter\" },\n};\n\nconst message: TemplateMessage = {\n headline: \"Train with people who know your name\",\n subhead: \"Small classes and real coaching by the river.\",\n benefits: [\n { title: \"Coached classes\", body: \"A coach in every class.\" },\n { title: \"Open gym\", body: \"Six days a week.\" },\n ],\n};\n\nconst team: SectionPreset[] = [\n {\n name: \"Coach cards\",\n variant: \"cards\",\n props: {\n heading: \"Meet the coaches\",\n members: [\n { name: \"Coach name\", role: \"Head coach\", credentials: \"Level 2 coach, nutrition coach\", summary: \"A line about what they love to coach.\", bio: \"Their story, in a few short paragraphs.\\n\\nWhat they love about coaching.\" },\n { name: \"Coach name\", role: \"Coach\", summary: \"A line about what they love to coach.\" },\n ],\n },\n },\n];\n\nconst schedule: SectionPreset[] = [\n {\n name: \"Class timetable\",\n variant: \"grid\",\n props: {\n heading: \"Class times\",\n labels: { items: \"classes\", types: \"Class types\" },\n types: [\n { id: \"strength\", name: \"Strength\", description: \"Barbell work in a coached group.\", tone: \"primary\" },\n { id: \"conditioning\", name: \"Conditioning\", description: \"Intervals for every level.\", tone: \"soft\" },\n { id: \"open\", name: \"Open gym\", description: \"Train on your own; a coach is on the floor.\", tone: \"plain\" },\n ],\n sessions: [\n { day: \"mon\", start: \"06:00\", end: \"07:00\", title: \"Strength\", type: \"strength\", host: \"Coach name\" },\n { day: \"mon\", start: \"18:00\", end: \"19:00\", title: \"Conditioning\", type: \"conditioning\", host: \"Coach name\" },\n { day: \"wed\", start: \"06:00\", end: \"07:00\", title: \"Strength\", type: \"strength\", host: \"Coach name\" },\n { day: \"sat\", start: \"09:00\", title: \"Open gym\", type: \"open\" },\n ],\n },\n },\n];\n\nconst features: SectionPreset[] = [\n {\n name: \"First visit steps\",\n variant: \"steps\",\n props: {\n heading: \"How to start\",\n items: [\n { title: \"Come to a free class\", body: \"Meet the coaches and try a session.\", cta: { label: \"Book a free class\", href: \"#contact\" } },\n { title: \"Learn the basics\", body: \"A few sessions on the movements, with a coach.\" },\n { title: \"Pick a plan\", body: \"Choose what fits your week.\", cta: { label: \"See the plans\", href: \"/plans\" } },\n ],\n },\n },\n];\n\nconst stats: SectionPreset[] = [\n { name: \"Gym in numbers\", variant: \"row\", props: { items: [{ value: \"12\", label: \"years open\" }, { value: \"40+\", label: \"classes a week\" }, { value: \"6\", label: \"coaches\" }] } },\n];\n\nconst logos: SectionPreset[] = [\n { name: \"Gym trust bar\", variant: \"trust-bar\", props: { claim: \"Why people train here\", items: [{ name: \"Small classes\" }, { name: \"Friendly coaches\" }, { name: \"Free first visit\" }], surface: \"inverse\" } },\n];\n\nconst pricing: SectionPreset[] = [\n {\n name: \"Memberships\",\n variant: \"cards\",\n props: {\n heading: \"Memberships\",\n groups: [\n { heading: \"Start here\", anchor: \"start\", tiers: [{ name: \"Drop-in\", price: \"$20\", description: \"One class\", cta: { label: \"Book a visit\", href: \"#contact\" } }] },\n { heading: \"Every week\", anchor: \"weekly\", tiers: [{ name: \"Unlimited\", price: \"$139\", period: \"per month\", description: \"Every class and open gym\", highlighted: true, cta: { label: \"Join\", href: \"#contact\" } }] },\n ],\n },\n },\n];\n\nconst file: SectionPreset[] = [\n { name: \"Forms to bring\", variant: \"cards\", props: { heading: \"Forms to bring\", files: [{ label: \"Waiver\", description: \"Sign it before your first class.\", file: { src: \"/files/waiver.pdf\", mime: \"application/pdf\" } }] } },\n];\n\n/** A functional fitness gym's presets and sample data. */\nexport const fitness: IndustryTemplate = Object.freeze({\n id: \"fitness\",\n label: \"Fitness\",\n brand,\n message,\n designSystems: [forgeDesignSystem, studioDesignSystem],\n presets: { team, schedule, features, stats, logos, pricing, file },\n});\n","/**\n * @marktiderman/genesis-sites/templates: industry template content.\n *\n * The core (schemas, sections, the editor, defaults) never names an industry.\n * Industry flavour lives here, as data on the neutral sections: presets per\n * section and sample data. Nothing here is a code path; a section renders the\n * same whichever template its props came from. The businesses are made up.\n *\n * Industry design systems (`forgeDesignSystem`, `studioDesignSystem`) are here\n * too: tokens only. Register the ones you offer with genesis-design-system's\n * `registerDesignSystem(...industryDesignSystems)`.\n *\n * @packageDocumentation\n */\nexport type { IndustryTemplate } from \"./types\";\nexport { fitness } from \"./fitness\";\nexport { forgeDesignSystem, industryDesignSystems, studioDesignSystem } from \"./design-systems\";\n\nimport { fitness } from \"./fitness\";\nimport type { IndustryTemplate } from \"./types\";\n\n/** Every template in this package, by id. */\nexport const industryTemplates: Readonly<Record<string, IndustryTemplate>> = Object.freeze({ [fitness.id]: fitness });\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/templates/design-systems.ts","../src/templates/fitness.ts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AAqB,IAAA,EAAM,iBAAA,EAAkB,EAAG,CAAA,EAAE;AAC3O,CAAA;AAGO,IAAM,OAAA,GAA4B,OAAO,MAAA,CAAO;AAAA,EACrD,EAAA,EAAI,SAAA;AAAA,EACJ,KAAA,EAAO,SAAA;AAAA,EACP,KAAA;AAAA,EACA,OAAA;AAAA,EACA,aAAA,EAAe,CAAC,iBAAA,EAAmB,kBAAkB,CAAA;AAAA,EACrD,OAAA,EAAS,EAAE,IAAA,EAAM,QAAA,EAAU,UAAU,KAAA,EAAO,KAAA,EAAO,SAAS,IAAA;AAC9D,CAAC;;;AC9FM,IAAM,iBAAA,GAAgE,OAAO,MAAA,CAAO,EAAE,CAAC,OAAA,CAAQ,EAAE,GAAG,OAAA,EAAS","file":"templates.js","sourcesContent":["/**\n * Industry design systems: template content, defined like the neutral ones\n * in genesis-design-system (`defineDesignSystem`). A host registers the ones\n * it offers (`registerDesignSystem(...industryDesignSystems)`), and a brand\n * names one by id (`{ designSystem: { id: \"forge@1\" } }`).\n *\n * Each is a set of tokens only: no section renders differently because of\n * it, so swapping one for another (or for a neutral one) re-themes a site\n * without touching its pages.\n */\nimport { DEFAULT_RAMP, defineDesignSystem, type DesignSystem } from \"@marktiderman/genesis-design-system\";\n\n/**\n * Forge: bold and athletic. Poster-sized headings (up to 112px, capitals in\n * a condensed face), square corners and 2px edges, a cool ground, crisp\n * photos with a little grain, and lively motion. For a strength gym or a\n * training box.\n */\nexport const forgeDesignSystem: DesignSystem = defineDesignSystem({\n name: \"forge\",\n version: 1,\n label: \"Forge\",\n description: \"Bold and athletic: poster headings, square corners, heavy edges, a cool ground and lively motion.\",\n type: {\n ramp: { ...DEFAULT_RAMP, display: { min: 3, max: 7 }, h1: { min: 2.5, max: 5 }, h2: { min: 2, max: 3.5 } },\n classes: {\n condensed: { displayWeight: 400, headingWeight: 400, displayTracking: 0.01, headingTracking: 0.01, case: \"upper\", displayLeading: 0.88 },\n grotesk: { displayWeight: 700, headingWeight: 700, displayTracking: -0.01, headingTracking: -0.005, case: \"upper\", displayLeading: 0.92 },\n geometric: { displayWeight: 700, headingWeight: 700, displayTracking: -0.01, case: \"upper\", displayLeading: 0.95 },\n },\n eyebrow: { weight: 600, tracking: 0.14, case: \"upper\" },\n },\n space: { density: \"normal\" },\n shape: { corners: \"square\", borderWidth: 2, shadow: \"flat\" },\n surfaces: { ground: \"chalk\" },\n image: { filter: \"crisp\", grain: 3, scrim: \"full\" },\n motion: { level: \"lively\" },\n});\n\n/**\n * Studio: calm. A warm ground, generous space, rounded corners, soft\n * shadows, light headings that never shout (no display step bigger than an\n * h1), warm photos and calm motion. For a yoga or Pilates studio.\n */\nexport const studioDesignSystem: DesignSystem = defineDesignSystem({\n name: \"studio\",\n version: 1,\n label: \"Studio\",\n description: \"Calm: a warm ground, generous space, rounded corners, soft shadows, light headings and calm motion.\",\n type: {\n ramp: { ...DEFAULT_RAMP, display: { min: 2.5, max: 4.75 }, h1: { min: 2.25, max: 4 } },\n leading: { display: 1.05, h1: 1.05 },\n classes: {\n serif: { displayWeight: 400, headingWeight: 400, displayTracking: -0.015, headingTracking: -0.01, displayLeading: 1.05 },\n grotesk: { displayWeight: 400, headingWeight: 500, displayTracking: -0.025, headingTracking: -0.015, displayLeading: 1.05 },\n geometric: { displayWeight: 400, headingWeight: 500, displayTracking: -0.02, displayLeading: 1.05 },\n condensed: { displayWeight: 400, headingWeight: 400, case: \"as-written\", displayLeading: 1 },\n },\n eyebrow: { weight: 500, tracking: 0.18, case: \"upper\" },\n },\n space: { density: \"generous\" },\n shape: { corners: \"round\", borderWidth: 1, shadow: \"soft\" },\n surfaces: { ground: \"paper\" },\n image: { filter: \"warm\", grain: 0, scrim: \"full\" },\n motion: { level: \"calm\" },\n});\n\n/** Every industry design system in this library. */\nexport const industryDesignSystems: readonly DesignSystem[] = Object.freeze([forgeDesignSystem, studioDesignSystem]);\n","/**\n * Fitness: section presets and sample data for a functional fitness gym.\n *\n * Template content only, on the neutral sections: nothing here changes how a\n * section renders. The business is made up.\n */\nimport type { SectionPreset } from \"../core/registry\";\nimport type { SiteBrand } from \"../core/theme\";\nimport type { TemplateMessage } from \"../core/templates\";\nimport type { IndustryTemplate } from \"./types\";\nimport { forgeDesignSystem, studioDesignSystem } from \"./design-systems\";\n\nconst brand: SiteBrand = {\n name: \"Riverside Gym\",\n colors: { primary: \"#0f766e\", primaryDark: \"#2dd4bf\" },\n fonts: { heading: \"space-grotesk\", body: \"inter\" },\n};\n\nconst message: TemplateMessage = {\n headline: \"Train with people who know your name\",\n subhead: \"Small classes and real coaching by the river.\",\n benefits: [\n { title: \"Coached classes\", body: \"A coach in every class.\" },\n { title: \"Open gym\", body: \"Six days a week.\" },\n ],\n};\n\nconst team: SectionPreset[] = [\n {\n name: \"Coach cards\",\n sample: true,\n variant: \"cards\",\n props: {\n heading: \"Meet the coaches\",\n members: [\n { name: \"Coach name\", role: \"Head coach\", credentials: \"Level 2 coach, nutrition coach\", summary: \"A line about what they love to coach.\", bio: \"Their story, in a few short paragraphs.\\n\\nWhat they love about coaching.\" },\n { name: \"Coach name\", role: \"Coach\", summary: \"A line about what they love to coach.\" },\n ],\n },\n },\n];\n\nconst schedule: SectionPreset[] = [\n {\n name: \"Class timetable\",\n sample: true,\n variant: \"grid\",\n props: {\n heading: \"Class times\",\n labels: { items: \"classes\", types: \"Class types\" },\n types: [\n { id: \"strength\", name: \"Strength\", description: \"Barbell work in a coached group.\", tone: \"primary\" },\n { id: \"conditioning\", name: \"Conditioning\", description: \"Intervals for every level.\", tone: \"soft\" },\n { id: \"open\", name: \"Open gym\", description: \"Train on your own; a coach is on the floor.\", tone: \"plain\" },\n ],\n sessions: [\n { day: \"mon\", start: \"06:00\", end: \"07:00\", title: \"Strength\", type: \"strength\", host: \"Coach name\" },\n { day: \"mon\", start: \"18:00\", end: \"19:00\", title: \"Conditioning\", type: \"conditioning\", host: \"Coach name\" },\n { day: \"wed\", start: \"06:00\", end: \"07:00\", title: \"Strength\", type: \"strength\", host: \"Coach name\" },\n { day: \"sat\", start: \"09:00\", title: \"Open gym\", type: \"open\" },\n ],\n },\n },\n];\n\nconst features: SectionPreset[] = [\n {\n name: \"First visit steps\",\n sample: true,\n variant: \"steps\",\n props: {\n heading: \"How to start\",\n items: [\n { title: \"Come to a free class\", body: \"Meet the coaches and try a session.\", cta: { label: \"Book a free class\", href: \"#contact\" } },\n { title: \"Learn the basics\", body: \"A few sessions on the movements, with a coach.\" },\n { title: \"Pick a plan\", body: \"Choose what fits your week.\", cta: { label: \"See the plans\", href: \"/plans\" } },\n ],\n },\n },\n];\n\nconst stats: SectionPreset[] = [\n { name: \"Gym in numbers\", sample: true, variant: \"row\", props: { items: [{ value: \"12\", label: \"years open\" }, { value: \"40+\", label: \"classes a week\" }, { value: \"6\", label: \"coaches\" }] } },\n];\n\nconst logos: SectionPreset[] = [\n { name: \"Gym trust bar\", sample: true, variant: \"trust-bar\", props: { claim: \"Why people train here\", items: [{ name: \"Small classes\" }, { name: \"Friendly coaches\" }, { name: \"Free first visit\" }], surface: \"inverse\" } },\n];\n\nconst pricing: SectionPreset[] = [\n {\n name: \"Memberships\",\n sample: true,\n variant: \"cards\",\n props: {\n heading: \"Memberships\",\n groups: [\n { heading: \"Start here\", anchor: \"start\", tiers: [{ name: \"Drop-in\", price: \"$20\", description: \"One class\", cta: { label: \"Book a visit\", href: \"#contact\" } }] },\n { heading: \"Every week\", anchor: \"weekly\", tiers: [{ name: \"Unlimited\", price: \"$139\", period: \"per month\", description: \"Every class and open gym\", highlighted: true, cta: { label: \"Join\", href: \"#contact\" } }] },\n ],\n },\n },\n];\n\nconst file: SectionPreset[] = [\n { name: \"Forms to bring\", sample: true, variant: \"cards\", props: { heading: \"Forms to bring\", files: [{ label: \"Waiver\", description: \"Sign it before your first class.\", file: { src: \"/files/waiver.pdf\", mime: \"application/pdf\" } }] } },\n];\n\n/** A functional fitness gym's presets and sample data. */\nexport const fitness: IndustryTemplate = Object.freeze({\n id: \"fitness\",\n label: \"Fitness\",\n brand,\n message,\n designSystems: [forgeDesignSystem, studioDesignSystem],\n presets: { team, schedule, features, stats, logos, pricing, file },\n});\n","/**\n * @marktiderman/genesis-sites/templates: industry template content.\n *\n * The core (schemas, sections, the editor, defaults) never names an industry.\n * Industry flavour lives here, as data on the neutral sections: presets per\n * section and sample data. Nothing here is a code path; a section renders the\n * same whichever template its props came from. The businesses are made up.\n *\n * Industry design systems (`forgeDesignSystem`, `studioDesignSystem`) are here\n * too: tokens only. Register the ones you offer with genesis-design-system's\n * `registerDesignSystem(...industryDesignSystems)`.\n *\n * @packageDocumentation\n */\nexport type { IndustryTemplate } from \"./types\";\nexport { fitness } from \"./fitness\";\nexport { forgeDesignSystem, industryDesignSystems, studioDesignSystem } from \"./design-systems\";\n\nimport { fitness } from \"./fitness\";\nimport type { IndustryTemplate } from \"./types\";\n\n/** Every template in this package, by id. */\nexport const industryTemplates: Readonly<Record<string, IndustryTemplate>> = Object.freeze({ [fitness.id]: fitness });\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DesignSystemChoice, CanonicalBrand, FontInfo, DesignSystem } from '@marktiderman/genesis-design-system';
|
|
2
|
-
import { n as FontChoice, k as BodyFontChoice, g as SiteDoc } from './registry-
|
|
2
|
+
import { n as FontChoice, k as BodyFontChoice, g as SiteDoc } from './registry-Cw7NF_le.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* A site's theme, from its brand: one `<style>` of CSS variables per site.
|
|
@@ -65,7 +65,7 @@ type BrandInput = SiteBrand | (CanonicalBrand & {
|
|
|
65
65
|
};
|
|
66
66
|
displayName?: string;
|
|
67
67
|
});
|
|
68
|
-
/** The host's brand
|
|
68
|
+
/** The host's brand: the editor and preview use it as it is now; a publish stores it in the release. */
|
|
69
69
|
interface BrandSource {
|
|
70
70
|
getBrand(siteId: string): Promise<BrandInput | null> | BrandInput | null;
|
|
71
71
|
}
|
package/dist/web.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ImageUrlBuilder } from '@marktiderman/genesis-media';
|
|
2
|
-
import { F as FormsResolver, U as ReleaseSnapshot, h as ReleasePage, d as ResolvedForm, O as PostsContext } from './registry-
|
|
3
|
-
import { S as SiteStore, R as ReservedPaths } from './store-
|
|
4
|
-
import { a as BrandSource, b as SiteTheme } from './theme-
|
|
2
|
+
import { F as FormsResolver, U as ReleaseSnapshot, h as ReleasePage, d as ResolvedForm, O as PostsContext } from './registry-Cw7NF_le.js';
|
|
3
|
+
import { S as SiteStore, R as ReservedPaths } from './store-BNYD5NAQ.js';
|
|
4
|
+
import { a as BrandSource, b as SiteTheme } from './theme-HJzN2tOm.js';
|
|
5
|
+
import { SiteBeacon } from './analytics.js';
|
|
5
6
|
import * as React from 'react';
|
|
6
7
|
import 'zod';
|
|
7
8
|
import '@marktiderman/genesis-design-system';
|
|
@@ -20,8 +21,9 @@ import '@marktiderman/genesis-design-system';
|
|
|
20
21
|
*
|
|
21
22
|
* Order: reserved paths (null), this package's assets, robots.txt and
|
|
22
23
|
* sitemap.xml, redirects, the trailing-slash redirect, then the page. An
|
|
23
|
-
* unknown path is null (or the site's 404
|
|
24
|
-
*
|
|
24
|
+
* unknown path is null (or, with `unknownPath: "not-found"`, the site's 404
|
|
25
|
+
* page: its page at `/404`, or the built-in text when it has none), status
|
|
26
|
+
* 404. Pages render to HTML with no hydration.
|
|
25
27
|
*/
|
|
26
28
|
|
|
27
29
|
/** Where this package serves its own files, under the site's base path. Reserved for pages. */
|
|
@@ -44,10 +46,13 @@ interface SiteRequestOptions {
|
|
|
44
46
|
*/
|
|
45
47
|
mode?: "live" | "preview";
|
|
46
48
|
/**
|
|
47
|
-
* Preview only:
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
49
|
+
* Preview only: who is viewing, as the host vouches for it: the signed-in
|
|
50
|
+
* user's id from its session, or any non-empty label (the editor's preview
|
|
51
|
+
* passes "editor", its store being the signed-in one). Only its presence is
|
|
52
|
+
* checked; the store's sign-in decides which drafts are read. Drafts are
|
|
53
|
+
* never read for an anonymous request (anon has no grant on them), so a
|
|
54
|
+
* preview without a viewer is null: the host decides what to show (its
|
|
55
|
+
* sign-in page, say). Live ignores it.
|
|
51
56
|
*/
|
|
52
57
|
viewer?: string | null;
|
|
53
58
|
/**
|
|
@@ -70,7 +75,10 @@ interface SiteRequestOptions {
|
|
|
70
75
|
path: string;
|
|
71
76
|
status: number;
|
|
72
77
|
}) => void;
|
|
73
|
-
/**
|
|
78
|
+
/**
|
|
79
|
+
* An unknown path: `fall-through` (default) returns null; `not-found` serves
|
|
80
|
+
* the site's 404 page (its page at `/404`, or the built-in text), status 404.
|
|
81
|
+
*/
|
|
74
82
|
unknownPath?: "fall-through" | "not-found";
|
|
75
83
|
/**
|
|
76
84
|
* The site's font files, served by this package under `/_gs/` (default
|
|
@@ -93,6 +101,33 @@ interface SiteRequestOptions {
|
|
|
93
101
|
* the URLs it builds must be on an asset origin, or the policy blocks them.
|
|
94
102
|
*/
|
|
95
103
|
imageUrl?: ImageUrlBuilder;
|
|
104
|
+
/**
|
|
105
|
+
* First-party analytics: live pages send a small beacon (a page view, a
|
|
106
|
+
* click on a link with `data-gs-event`, an outbound link, a download) to
|
|
107
|
+
* `/_gs/e` on the site's own address, and `collect` gets each one with the
|
|
108
|
+
* request (for the visitor's IP address, browser and Global Privacy Control
|
|
109
|
+
* header). The host forwards it with `forwardEvent` from
|
|
110
|
+
* `@marktiderman/genesis-sites/analytics`. Without it, pages send nothing.
|
|
111
|
+
*/
|
|
112
|
+
analytics?: SiteAnalytics;
|
|
113
|
+
/** The clock for pages' show dates (`showFrom`, `showUntil`); tests set it. Default: now. */
|
|
114
|
+
now?: () => Date;
|
|
115
|
+
}
|
|
116
|
+
/** Where a site's beacons go (`SiteRequestOptions.analytics`). */
|
|
117
|
+
interface SiteAnalytics {
|
|
118
|
+
/**
|
|
119
|
+
* Takes one beacon from one of the site's own pages (a beacon whose `Origin`
|
|
120
|
+
* or `Sec-Fetch-Site` says another site sent it never arrives here). The
|
|
121
|
+
* request waits for it, so forward the event after the response: hand the
|
|
122
|
+
* work to the platform's `waitUntil`, or a queue, and return. `basePath` is
|
|
123
|
+
* already at the start of the beacon's path.
|
|
124
|
+
*/
|
|
125
|
+
collect(beacon: SiteBeacon, info: {
|
|
126
|
+
request: Request;
|
|
127
|
+
siteId: string;
|
|
128
|
+
origin: string;
|
|
129
|
+
basePath: string;
|
|
130
|
+
}): void | Promise<void>;
|
|
96
131
|
}
|
|
97
132
|
/**
|
|
98
133
|
* Serve a site request, or return null when the request isn't the site's.
|
|
@@ -114,7 +149,7 @@ declare function renderSitePageToString(request: Request, options: SiteRequestOp
|
|
|
114
149
|
/**
|
|
115
150
|
* SiteRenderer: one page of a release as a whole HTML document. Server-only
|
|
116
151
|
* output: it is rendered to a string or stream and never hydrated. The only
|
|
117
|
-
* script is the islands loader,
|
|
152
|
+
* script is the islands loader, on a page with analytics (`beacon`), or with a phone menu or a
|
|
118
153
|
* form.
|
|
119
154
|
*/
|
|
120
155
|
|
|
@@ -134,8 +169,14 @@ interface SiteAssets {
|
|
|
134
169
|
}
|
|
135
170
|
interface SiteRendererProps {
|
|
136
171
|
snapshot: ReleaseSnapshot;
|
|
137
|
-
/** The page to render, or null for the
|
|
172
|
+
/** The page to render, or null for the built-in "Page not found" text. */
|
|
138
173
|
page: ReleasePage | null;
|
|
174
|
+
/**
|
|
175
|
+
* The page stands for an address the site doesn't have (the site's 404
|
|
176
|
+
* page): `noindex`, no canonical URL, Open Graph or structured data.
|
|
177
|
+
* Default: true when `page` is null or is the page at `/404`.
|
|
178
|
+
*/
|
|
179
|
+
notFound?: boolean;
|
|
139
180
|
theme: SiteTheme;
|
|
140
181
|
/** The site's primary origin, for canonical and Open Graph URLs. */
|
|
141
182
|
origin: string;
|
|
@@ -150,6 +191,11 @@ interface SiteRendererProps {
|
|
|
150
191
|
forms?: ReadonlyMap<string, ResolvedForm | null>;
|
|
151
192
|
/** Asset URLs. */
|
|
152
193
|
assets: SiteAssets;
|
|
194
|
+
/**
|
|
195
|
+
* Where the page sends its analytics beacon (`/_gs/e` under the base
|
|
196
|
+
* path), or none. Every page then loads the islands loader.
|
|
197
|
+
*/
|
|
198
|
+
beacon?: string;
|
|
153
199
|
/**
|
|
154
200
|
* The blog, when the site has a post page: its path, the posts, the post
|
|
155
201
|
* this page shows (`page` is then that post on the post page) and the
|
|
@@ -180,16 +226,16 @@ declare function collectFormSlugs(_snapshot: ReleaseSnapshot, page: ReleasePage
|
|
|
180
226
|
*
|
|
181
227
|
* @stability Beta
|
|
182
228
|
*/
|
|
183
|
-
declare function SiteRenderer({ snapshot, page, theme, origin, basePath, mode, logo, forms, assets, posts, imageUrl }: SiteRendererProps): React.JSX.Element;
|
|
229
|
+
declare function SiteRenderer({ snapshot, page, notFound, theme, origin, basePath, mode, logo, forms, assets, posts, imageUrl, beacon: beaconPath }: SiteRendererProps): React.JSX.Element;
|
|
184
230
|
|
|
185
231
|
declare const ASSET_SIZES: {
|
|
186
|
-
readonly css:
|
|
187
|
-
readonly formsCss:
|
|
188
|
-
readonly islands:
|
|
189
|
-
readonly formIsland:
|
|
232
|
+
readonly css: 49969;
|
|
233
|
+
readonly formsCss: 95639;
|
|
234
|
+
readonly islands: 3924;
|
|
235
|
+
readonly formIsland: 553656;
|
|
190
236
|
readonly fonts: 861576;
|
|
191
237
|
};
|
|
192
238
|
/** Each self-hosted font file's name under the assets prefix, by its key (`inter-700`). */
|
|
193
239
|
declare const FONT_FILES: Readonly<Record<string, string>>;
|
|
194
240
|
|
|
195
|
-
export { ASSETS_PREFIX, ASSET_SIZES, FONT_FILES, type SiteAssets, SiteRenderer, type SiteRendererProps, type SiteRequestOptions, collectFormSlugs, fontFaces, handleSiteRequest, pageStyleText, renderSitePageToString };
|
|
241
|
+
export { ASSETS_PREFIX, ASSET_SIZES, FONT_FILES, type SiteAnalytics, type SiteAssets, SiteRenderer, type SiteRendererProps, type SiteRequestOptions, collectFormSlugs, fontFaces, handleSiteRequest, pageStyleText, renderSitePageToString };
|
package/dist/web.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
export { ASSETS_PREFIX, SiteRenderer, collectFormSlugs, fontFaces, handleSiteRequest, pageStyleText, renderSitePageToString } from './chunk-
|
|
2
|
-
export { ASSET_SIZES, FONT_FILES } from './chunk-
|
|
1
|
+
export { ASSETS_PREFIX, SiteRenderer, collectFormSlugs, fontFaces, handleSiteRequest, pageStyleText, renderSitePageToString } from './chunk-ATRS5GSD.js';
|
|
2
|
+
export { ASSET_SIZES, FONT_FILES } from './chunk-5G2H6EZ2.js';
|
|
3
3
|
import './chunk-OFJISW3T.js';
|
|
4
|
-
import './chunk-
|
|
4
|
+
import './chunk-5RYCQEEE.js';
|
|
5
|
+
import './chunk-SBONYMUC.js';
|
|
5
6
|
import './chunk-VZUDRPFG.js';
|
|
6
|
-
import './chunk-
|
|
7
|
-
import './chunk-
|
|
8
|
-
import './chunk-
|
|
7
|
+
import './chunk-UOKNFG5O.js';
|
|
8
|
+
import './chunk-QGU6FDH5.js';
|
|
9
|
+
import './chunk-CXBBUKGB.js';
|
|
9
10
|
//# sourceMappingURL=web.js.map
|
|
10
11
|
//# sourceMappingURL=web.js.map
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
-- Genesis Sites 0003: an imported post keeps its date
|
|
2
|
+
--
|
|
3
|
+
-- Two fixes to 0002's import_posts and publish_post:
|
|
4
|
+
-- 1. A publishedAt of "infinity" was clamped to now() before the finite check,
|
|
5
|
+
-- so it was accepted as today. The date is now checked (finite, not before
|
|
6
|
+
-- 1970) before it is clamped to now.
|
|
7
|
+
-- 2. A post imported as a draft lost its publishedAt, so its first publish was
|
|
8
|
+
-- dated that day. A draft import now keeps the date in
|
|
9
|
+
-- site_posts.imported_published_at, and publish_post uses it when the post
|
|
10
|
+
-- has never been published.
|
|
11
|
+
--
|
|
12
|
+
-- This migration needs 0002. `add column if not exists`: an app that already
|
|
13
|
+
-- added the column under this name keeps it.
|
|
14
|
+
--
|
|
15
|
+
-- Use: `genesis add sites` copies this file into supabase/migrations under a
|
|
16
|
+
-- new timestamped name. Never edit it once applied; change it with a new migration.
|
|
17
|
+
--
|
|
18
|
+
-- Verify: the pgTAP test beside this file (`tests/0003_genesis_sites_post_dates.test.sql`).
|
|
19
|
+
|
|
20
|
+
alter table genesis_sites.site_posts add column if not exists imported_published_at timestamptz;
|
|
21
|
+
comment on column genesis_sites.site_posts.imported_published_at is
|
|
22
|
+
'A draft import''s date from the old site: its first publish uses it as published_at, so the post keeps its date. Null otherwise.';
|
|
23
|
+
|
|
24
|
+
create or replace function genesis_sites.publish_post(post_id uuid, expected_rev integer)
|
|
25
|
+
returns jsonb
|
|
26
|
+
language plpgsql
|
|
27
|
+
security definer
|
|
28
|
+
set search_path = ''
|
|
29
|
+
as $$
|
|
30
|
+
declare
|
|
31
|
+
post genesis_sites.site_posts;
|
|
32
|
+
site_status text;
|
|
33
|
+
begin
|
|
34
|
+
perform genesis_sites.assert_can_edit((select p.site_id from genesis_sites.site_posts p where p.id = post_id));
|
|
35
|
+
select s.status into site_status from genesis_sites.sites s where s.id = (select p.site_id from genesis_sites.site_posts p where p.id = post_id) for update;
|
|
36
|
+
-- Archiving is a takedown: an editor can't put posts back up.
|
|
37
|
+
if site_status = 'archived' then
|
|
38
|
+
raise exception 'genesis_sites: an archived site can''t publish posts' using errcode = '22023';
|
|
39
|
+
end if;
|
|
40
|
+
select * into post from genesis_sites.site_posts p where p.id = post_id and p.deleted_at is null for update;
|
|
41
|
+
if not found then
|
|
42
|
+
raise exception 'genesis_sites: no post %', post_id using errcode = 'P0002';
|
|
43
|
+
end if;
|
|
44
|
+
if post.draft_rev is distinct from expected_rev then
|
|
45
|
+
raise exception 'genesis_sites: the post changed since it was checked' using errcode = 'GS409', detail = post.draft_rev::text;
|
|
46
|
+
end if;
|
|
47
|
+
perform genesis_sites.assert_post(post.slug, post.draft);
|
|
48
|
+
update genesis_sites.site_posts p
|
|
49
|
+
set published = p.draft, status = 'published', published_at = coalesce(p.published_at, p.imported_published_at, now()), published_updated_at = now()
|
|
50
|
+
where p.id = post_id
|
|
51
|
+
returning * into post;
|
|
52
|
+
return genesis_sites.post_json(post);
|
|
53
|
+
end;
|
|
54
|
+
$$;
|
|
55
|
+
|
|
56
|
+
create or replace function genesis_sites.import_posts(site_id uuid, posts jsonb)
|
|
57
|
+
returns jsonb
|
|
58
|
+
language plpgsql
|
|
59
|
+
security definer
|
|
60
|
+
set search_path = ''
|
|
61
|
+
as $$
|
|
62
|
+
declare
|
|
63
|
+
item jsonb;
|
|
64
|
+
item_slug text;
|
|
65
|
+
item_status text;
|
|
66
|
+
item_at timestamptz;
|
|
67
|
+
new_id uuid;
|
|
68
|
+
imported jsonb := '[]'::jsonb;
|
|
69
|
+
skipped jsonb := '[]'::jsonb;
|
|
70
|
+
begin
|
|
71
|
+
perform genesis_sites.assert_can_edit(site_id);
|
|
72
|
+
if posts is null or jsonb_typeof(posts) <> 'array' or jsonb_array_length(posts) > 500 then
|
|
73
|
+
raise exception 'genesis_sites: posts is an array of at most 500 posts' using errcode = '22023';
|
|
74
|
+
end if;
|
|
75
|
+
perform 1 from genesis_sites.sites s where s.id = import_posts.site_id and s.status <> 'archived' for update;
|
|
76
|
+
if not found then
|
|
77
|
+
raise exception 'genesis_sites: no site % to import into', site_id using errcode = 'P0002';
|
|
78
|
+
end if;
|
|
79
|
+
for item in select * from jsonb_array_elements(posts) loop
|
|
80
|
+
item_slug := item ->> 'slug';
|
|
81
|
+
begin
|
|
82
|
+
perform genesis_sites.assert_post(item_slug, item -> 'doc');
|
|
83
|
+
if exists (select 1 from genesis_sites.site_posts p where p.site_id = import_posts.site_id and p.slug = item_slug and p.deleted_at is null) then
|
|
84
|
+
skipped := skipped || jsonb_build_array(jsonb_build_object('slug', item_slug, 'reason', 'The site already has a post at this slug.'));
|
|
85
|
+
continue;
|
|
86
|
+
end if;
|
|
87
|
+
-- Published only when asked: a post with no status (or any other) comes in as a draft.
|
|
88
|
+
item_status := case when item ->> 'status' = 'published' then 'published' else 'draft' end;
|
|
89
|
+
item_at := (item ->> 'publishedAt')::timestamptz;
|
|
90
|
+
-- A real date: not infinity, not before 1970 (the feeds and the sitemap print it). Checked
|
|
91
|
+
-- before the clamp to now, which would turn infinity into now.
|
|
92
|
+
if item_at is not null and (not isfinite(item_at) or item_at < '1970-01-01T00:00:00Z'::timestamptz) then
|
|
93
|
+
raise exception 'genesis_sites: "%" isn''t a usable publish date', item ->> 'publishedAt' using errcode = '22008';
|
|
94
|
+
end if;
|
|
95
|
+
-- Never later than now (only a given date: least() skips a null, which would stamp an
|
|
96
|
+
-- undated draft with the import time). A draft keeps the date given for its first publish.
|
|
97
|
+
if item_at is not null then
|
|
98
|
+
item_at := least(item_at, now());
|
|
99
|
+
end if;
|
|
100
|
+
insert into genesis_sites.site_posts (site_id, slug, draft, published, status, published_at, published_updated_at, imported_published_at)
|
|
101
|
+
values (
|
|
102
|
+
site_id, item_slug, item -> 'doc',
|
|
103
|
+
case when item_status = 'published' then item -> 'doc' end,
|
|
104
|
+
item_status,
|
|
105
|
+
case when item_status = 'published' then coalesce(item_at, now()) end,
|
|
106
|
+
case when item_status = 'published' then coalesce(item_at, now()) end,
|
|
107
|
+
case when item_status = 'draft' then item_at end
|
|
108
|
+
)
|
|
109
|
+
returning id into new_id;
|
|
110
|
+
imported := imported || jsonb_build_array(jsonb_build_object('slug', item_slug, 'id', new_id, 'status', item_status));
|
|
111
|
+
exception when sqlstate '22023' or sqlstate '22007' or sqlstate '22008' or sqlstate '23514' or sqlstate '23505' then
|
|
112
|
+
skipped := skipped || jsonb_build_array(jsonb_build_object('slug', coalesce(item_slug, '?'), 'reason', sqlerrm));
|
|
113
|
+
end;
|
|
114
|
+
end loop;
|
|
115
|
+
return jsonb_build_object('imported', imported, 'skipped', skipped);
|
|
116
|
+
end;
|
|
117
|
+
$$;
|