@the-smithy/hearth-schema 0.24.1 → 0.25.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/dist/index.d.ts CHANGED
@@ -34,6 +34,11 @@ declare const position: z.ZodObject<{
34
34
  lat: z.ZodNumber;
35
35
  lng: z.ZodNumber;
36
36
  }, z.core.$strip>;
37
+ /**
38
+ * A name a link can jump to, on any block: with `upcoming` here, /#upcoming goes straight to the block. Frontends make
39
+ * it the id of the block's outermost element.
40
+ */
41
+ declare const blockAnchorSchema: z.ZodString;
37
42
  declare const formFieldSchema: z.ZodObject<{
38
43
  name: z.ZodString;
39
44
  label: z.ZodString;
@@ -357,6 +362,12 @@ declare const blockDataSchemas: {
357
362
  compact: "compact";
358
363
  }>>;
359
364
  showLogo: z.ZodOptional<z.ZodBoolean>;
365
+ tone: z.ZodOptional<z.ZodEnum<{
366
+ default: "default";
367
+ muted: "muted";
368
+ inverse: "inverse";
369
+ accent: "accent";
370
+ }>>;
360
371
  }, z.core.$strip>;
361
372
  readonly richText: z.ZodObject<{
362
373
  markdown: z.ZodDefault<z.ZodString>;
@@ -420,6 +431,7 @@ declare const blockDataSchemas: {
420
431
  label: z.ZodString;
421
432
  href: z.ZodString;
422
433
  }, z.core.$strip>>;
434
+ icon: z.ZodOptional<z.ZodString>;
423
435
  }, z.core.$strip>>;
424
436
  tone: z.ZodDefault<z.ZodEnum<{
425
437
  default: "default";
@@ -462,6 +474,10 @@ declare const blockDataSchemas: {
462
474
  question: z.ZodString;
463
475
  answer: z.ZodDefault<z.ZodString>;
464
476
  }, z.core.$strip>>;
477
+ display: z.ZodOptional<z.ZodEnum<{
478
+ list: "list";
479
+ accordion: "accordion";
480
+ }>>;
465
481
  }, z.core.$strip>;
466
482
  /** Plans or packages side by side. Prices are text, so any currency, "Free" or "Let's talk" works. */
467
483
  readonly pricing: z.ZodObject<{
@@ -701,6 +717,7 @@ declare const blockDataSchemas: {
701
717
  limit: z.ZodDefault<z.ZodNumber>;
702
718
  collectionId: z.ZodOptional<z.ZodString>;
703
719
  categoryId: z.ZodOptional<z.ZodString>;
720
+ emptyText: z.ZodOptional<z.ZodString>;
704
721
  }, z.core.$strip>;
705
722
  /** Events that have ended, most recent first: a talk archive, past events. */
706
723
  readonly pastEvents: z.ZodObject<{
@@ -710,6 +727,7 @@ declare const blockDataSchemas: {
710
727
  limit: z.ZodDefault<z.ZodNumber>;
711
728
  collectionId: z.ZodOptional<z.ZodString>;
712
729
  categoryId: z.ZodOptional<z.ZodString>;
730
+ emptyText: z.ZodOptional<z.ZodString>;
713
731
  }, z.core.$strip>;
714
732
  readonly eventSpotlight: z.ZodObject<{
715
733
  eventSlug: z.ZodOptional<z.ZodString>;
@@ -762,6 +780,7 @@ declare const blockDataSchemas: {
762
780
  all: "all";
763
781
  }>>;
764
782
  categoryId: z.ZodOptional<z.ZodString>;
783
+ emptyText: z.ZodOptional<z.ZodString>;
765
784
  }, z.core.$strip>;
766
785
  /**
767
786
  * A donation form (giving feature). The frontend posts it to its own server, which starts checkout through the
@@ -790,6 +809,7 @@ declare const blockFeature: Partial<Record<BlockType, "events" | "giving">>;
790
809
  declare const blockSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
791
810
  id: z.ZodString;
792
811
  type: z.ZodLiteral<"custom" | "cta" | "quote" | "people" | "logos" | "hero" | "richText" | "mediaText" | "stats" | "cardGrid" | "faq" | "pricing" | "projects" | "location" | "locations" | "schedule" | "gallery" | "video" | "embed" | "form" | "upcomingEvents" | "pastEvents" | "eventSpotlight" | "volunteerSignup" | "collectionList" | "sharedBlock" | "fundraiserSpotlight" | "fundraiserGrid" | "donate">;
812
+ anchor: z.ZodOptional<z.ZodString>;
793
813
  data: z.ZodObject<{
794
814
  eyebrow: z.ZodOptional<z.ZodString>;
795
815
  heading: z.ZodString;
@@ -817,6 +837,12 @@ declare const blockSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
817
837
  compact: "compact";
818
838
  }>>;
819
839
  showLogo: z.ZodOptional<z.ZodBoolean>;
840
+ tone: z.ZodOptional<z.ZodEnum<{
841
+ default: "default";
842
+ muted: "muted";
843
+ inverse: "inverse";
844
+ accent: "accent";
845
+ }>>;
820
846
  }, z.core.$strip> | z.ZodObject<{
821
847
  markdown: z.ZodDefault<z.ZodString>;
822
848
  width: z.ZodDefault<z.ZodEnum<{
@@ -876,6 +902,7 @@ declare const blockSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
876
902
  label: z.ZodString;
877
903
  href: z.ZodString;
878
904
  }, z.core.$strip>>;
905
+ icon: z.ZodOptional<z.ZodString>;
879
906
  }, z.core.$strip>>;
880
907
  tone: z.ZodDefault<z.ZodEnum<{
881
908
  default: "default";
@@ -916,6 +943,10 @@ declare const blockSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
916
943
  question: z.ZodString;
917
944
  answer: z.ZodDefault<z.ZodString>;
918
945
  }, z.core.$strip>>;
946
+ display: z.ZodOptional<z.ZodEnum<{
947
+ list: "list";
948
+ accordion: "accordion";
949
+ }>>;
919
950
  }, z.core.$strip> | z.ZodObject<{
920
951
  eyebrow: z.ZodOptional<z.ZodString>;
921
952
  heading: z.ZodOptional<z.ZodString>;
@@ -1134,6 +1165,7 @@ declare const blockSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1134
1165
  limit: z.ZodDefault<z.ZodNumber>;
1135
1166
  collectionId: z.ZodOptional<z.ZodString>;
1136
1167
  categoryId: z.ZodOptional<z.ZodString>;
1168
+ emptyText: z.ZodOptional<z.ZodString>;
1137
1169
  }, z.core.$strip> | z.ZodObject<{
1138
1170
  eyebrow: z.ZodOptional<z.ZodString>;
1139
1171
  heading: z.ZodOptional<z.ZodString>;
@@ -1141,6 +1173,7 @@ declare const blockSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1141
1173
  limit: z.ZodDefault<z.ZodNumber>;
1142
1174
  collectionId: z.ZodOptional<z.ZodString>;
1143
1175
  categoryId: z.ZodOptional<z.ZodString>;
1176
+ emptyText: z.ZodOptional<z.ZodString>;
1144
1177
  }, z.core.$strip> | z.ZodObject<{
1145
1178
  eventSlug: z.ZodOptional<z.ZodString>;
1146
1179
  categoryId: z.ZodOptional<z.ZodString>;
@@ -1178,6 +1211,7 @@ declare const blockSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1178
1211
  all: "all";
1179
1212
  }>>;
1180
1213
  categoryId: z.ZodOptional<z.ZodString>;
1214
+ emptyText: z.ZodOptional<z.ZodString>;
1181
1215
  }, z.core.$strip> | z.ZodObject<{
1182
1216
  heading: z.ZodOptional<z.ZodString>;
1183
1217
  intro: z.ZodOptional<z.ZodString>;
@@ -1190,6 +1224,7 @@ declare const blockSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1190
1224
  }, z.core.$strip>, ...z.ZodObject<{
1191
1225
  id: z.ZodString;
1192
1226
  type: z.ZodLiteral<"custom" | "cta" | "quote" | "people" | "logos" | "hero" | "richText" | "mediaText" | "stats" | "cardGrid" | "faq" | "pricing" | "projects" | "location" | "locations" | "schedule" | "gallery" | "video" | "embed" | "form" | "upcomingEvents" | "pastEvents" | "eventSpotlight" | "volunteerSignup" | "collectionList" | "sharedBlock" | "fundraiserSpotlight" | "fundraiserGrid" | "donate">;
1227
+ anchor: z.ZodOptional<z.ZodString>;
1193
1228
  data: z.ZodObject<{
1194
1229
  eyebrow: z.ZodOptional<z.ZodString>;
1195
1230
  heading: z.ZodString;
@@ -1217,6 +1252,12 @@ declare const blockSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1217
1252
  compact: "compact";
1218
1253
  }>>;
1219
1254
  showLogo: z.ZodOptional<z.ZodBoolean>;
1255
+ tone: z.ZodOptional<z.ZodEnum<{
1256
+ default: "default";
1257
+ muted: "muted";
1258
+ inverse: "inverse";
1259
+ accent: "accent";
1260
+ }>>;
1220
1261
  }, z.core.$strip> | z.ZodObject<{
1221
1262
  markdown: z.ZodDefault<z.ZodString>;
1222
1263
  width: z.ZodDefault<z.ZodEnum<{
@@ -1276,6 +1317,7 @@ declare const blockSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1276
1317
  label: z.ZodString;
1277
1318
  href: z.ZodString;
1278
1319
  }, z.core.$strip>>;
1320
+ icon: z.ZodOptional<z.ZodString>;
1279
1321
  }, z.core.$strip>>;
1280
1322
  tone: z.ZodDefault<z.ZodEnum<{
1281
1323
  default: "default";
@@ -1316,6 +1358,10 @@ declare const blockSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1316
1358
  question: z.ZodString;
1317
1359
  answer: z.ZodDefault<z.ZodString>;
1318
1360
  }, z.core.$strip>>;
1361
+ display: z.ZodOptional<z.ZodEnum<{
1362
+ list: "list";
1363
+ accordion: "accordion";
1364
+ }>>;
1319
1365
  }, z.core.$strip> | z.ZodObject<{
1320
1366
  eyebrow: z.ZodOptional<z.ZodString>;
1321
1367
  heading: z.ZodOptional<z.ZodString>;
@@ -1534,6 +1580,7 @@ declare const blockSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1534
1580
  limit: z.ZodDefault<z.ZodNumber>;
1535
1581
  collectionId: z.ZodOptional<z.ZodString>;
1536
1582
  categoryId: z.ZodOptional<z.ZodString>;
1583
+ emptyText: z.ZodOptional<z.ZodString>;
1537
1584
  }, z.core.$strip> | z.ZodObject<{
1538
1585
  eyebrow: z.ZodOptional<z.ZodString>;
1539
1586
  heading: z.ZodOptional<z.ZodString>;
@@ -1541,6 +1588,7 @@ declare const blockSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1541
1588
  limit: z.ZodDefault<z.ZodNumber>;
1542
1589
  collectionId: z.ZodOptional<z.ZodString>;
1543
1590
  categoryId: z.ZodOptional<z.ZodString>;
1591
+ emptyText: z.ZodOptional<z.ZodString>;
1544
1592
  }, z.core.$strip> | z.ZodObject<{
1545
1593
  eventSlug: z.ZodOptional<z.ZodString>;
1546
1594
  categoryId: z.ZodOptional<z.ZodString>;
@@ -1578,6 +1626,7 @@ declare const blockSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1578
1626
  all: "all";
1579
1627
  }>>;
1580
1628
  categoryId: z.ZodOptional<z.ZodString>;
1629
+ emptyText: z.ZodOptional<z.ZodString>;
1581
1630
  }, z.core.$strip> | z.ZodObject<{
1582
1631
  heading: z.ZodOptional<z.ZodString>;
1583
1632
  intro: z.ZodOptional<z.ZodString>;
@@ -1592,6 +1641,7 @@ type Block = {
1592
1641
  [T in BlockType]: {
1593
1642
  id: string;
1594
1643
  type: T;
1644
+ anchor?: string;
1595
1645
  data: BlockData<T>;
1596
1646
  };
1597
1647
  }[BlockType];
@@ -1620,6 +1670,12 @@ declare const seoSchema: z.ZodObject<{
1620
1670
  canonical: z.ZodOptional<z.ZodString>;
1621
1671
  }, z.core.$strip>;
1622
1672
  type Seo = z.infer<typeof seoSchema>;
1673
+ /**
1674
+ * Pages at these addresses stand in for a page the frontend's own code serves that nobody searches for: the 404 and
1675
+ * where payments send people back to. They're never indexable and never in the sitemap or llms.txt.
1676
+ */
1677
+ declare const UNLISTED_PAGE_SLUGS: readonly string[];
1678
+ declare const isUnlistedPage: (pageSlug: string) => boolean;
1623
1679
  /** Page content as stored in `pages.draft` and `page_revisions.content`. */
1624
1680
  declare const pageContentSchema: z.ZodObject<{
1625
1681
  title: z.ZodString;
@@ -1642,6 +1698,7 @@ declare const pageContentSchema: z.ZodObject<{
1642
1698
  blocks: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
1643
1699
  id: z.ZodString;
1644
1700
  type: z.ZodLiteral<"custom" | "cta" | "quote" | "people" | "logos" | "hero" | "richText" | "mediaText" | "stats" | "cardGrid" | "faq" | "pricing" | "projects" | "location" | "locations" | "schedule" | "gallery" | "video" | "embed" | "form" | "upcomingEvents" | "pastEvents" | "eventSpotlight" | "volunteerSignup" | "collectionList" | "sharedBlock" | "fundraiserSpotlight" | "fundraiserGrid" | "donate">;
1701
+ anchor: z.ZodOptional<z.ZodString>;
1645
1702
  data: z.ZodObject<{
1646
1703
  eyebrow: z.ZodOptional<z.ZodString>;
1647
1704
  heading: z.ZodString;
@@ -1669,6 +1726,12 @@ declare const pageContentSchema: z.ZodObject<{
1669
1726
  compact: "compact";
1670
1727
  }>>;
1671
1728
  showLogo: z.ZodOptional<z.ZodBoolean>;
1729
+ tone: z.ZodOptional<z.ZodEnum<{
1730
+ default: "default";
1731
+ muted: "muted";
1732
+ inverse: "inverse";
1733
+ accent: "accent";
1734
+ }>>;
1672
1735
  }, z.core.$strip> | z.ZodObject<{
1673
1736
  markdown: z.ZodDefault<z.ZodString>;
1674
1737
  width: z.ZodDefault<z.ZodEnum<{
@@ -1728,6 +1791,7 @@ declare const pageContentSchema: z.ZodObject<{
1728
1791
  label: z.ZodString;
1729
1792
  href: z.ZodString;
1730
1793
  }, z.core.$strip>>;
1794
+ icon: z.ZodOptional<z.ZodString>;
1731
1795
  }, z.core.$strip>>;
1732
1796
  tone: z.ZodDefault<z.ZodEnum<{
1733
1797
  default: "default";
@@ -1768,6 +1832,10 @@ declare const pageContentSchema: z.ZodObject<{
1768
1832
  question: z.ZodString;
1769
1833
  answer: z.ZodDefault<z.ZodString>;
1770
1834
  }, z.core.$strip>>;
1835
+ display: z.ZodOptional<z.ZodEnum<{
1836
+ list: "list";
1837
+ accordion: "accordion";
1838
+ }>>;
1771
1839
  }, z.core.$strip> | z.ZodObject<{
1772
1840
  eyebrow: z.ZodOptional<z.ZodString>;
1773
1841
  heading: z.ZodOptional<z.ZodString>;
@@ -1986,6 +2054,7 @@ declare const pageContentSchema: z.ZodObject<{
1986
2054
  limit: z.ZodDefault<z.ZodNumber>;
1987
2055
  collectionId: z.ZodOptional<z.ZodString>;
1988
2056
  categoryId: z.ZodOptional<z.ZodString>;
2057
+ emptyText: z.ZodOptional<z.ZodString>;
1989
2058
  }, z.core.$strip> | z.ZodObject<{
1990
2059
  eyebrow: z.ZodOptional<z.ZodString>;
1991
2060
  heading: z.ZodOptional<z.ZodString>;
@@ -1993,6 +2062,7 @@ declare const pageContentSchema: z.ZodObject<{
1993
2062
  limit: z.ZodDefault<z.ZodNumber>;
1994
2063
  collectionId: z.ZodOptional<z.ZodString>;
1995
2064
  categoryId: z.ZodOptional<z.ZodString>;
2065
+ emptyText: z.ZodOptional<z.ZodString>;
1996
2066
  }, z.core.$strip> | z.ZodObject<{
1997
2067
  eventSlug: z.ZodOptional<z.ZodString>;
1998
2068
  categoryId: z.ZodOptional<z.ZodString>;
@@ -2030,6 +2100,7 @@ declare const pageContentSchema: z.ZodObject<{
2030
2100
  all: "all";
2031
2101
  }>>;
2032
2102
  categoryId: z.ZodOptional<z.ZodString>;
2103
+ emptyText: z.ZodOptional<z.ZodString>;
2033
2104
  }, z.core.$strip> | z.ZodObject<{
2034
2105
  heading: z.ZodOptional<z.ZodString>;
2035
2106
  intro: z.ZodOptional<z.ZodString>;
@@ -2042,6 +2113,7 @@ declare const pageContentSchema: z.ZodObject<{
2042
2113
  }, z.core.$strip>, ...z.ZodObject<{
2043
2114
  id: z.ZodString;
2044
2115
  type: z.ZodLiteral<"custom" | "cta" | "quote" | "people" | "logos" | "hero" | "richText" | "mediaText" | "stats" | "cardGrid" | "faq" | "pricing" | "projects" | "location" | "locations" | "schedule" | "gallery" | "video" | "embed" | "form" | "upcomingEvents" | "pastEvents" | "eventSpotlight" | "volunteerSignup" | "collectionList" | "sharedBlock" | "fundraiserSpotlight" | "fundraiserGrid" | "donate">;
2116
+ anchor: z.ZodOptional<z.ZodString>;
2045
2117
  data: z.ZodObject<{
2046
2118
  eyebrow: z.ZodOptional<z.ZodString>;
2047
2119
  heading: z.ZodString;
@@ -2069,6 +2141,12 @@ declare const pageContentSchema: z.ZodObject<{
2069
2141
  compact: "compact";
2070
2142
  }>>;
2071
2143
  showLogo: z.ZodOptional<z.ZodBoolean>;
2144
+ tone: z.ZodOptional<z.ZodEnum<{
2145
+ default: "default";
2146
+ muted: "muted";
2147
+ inverse: "inverse";
2148
+ accent: "accent";
2149
+ }>>;
2072
2150
  }, z.core.$strip> | z.ZodObject<{
2073
2151
  markdown: z.ZodDefault<z.ZodString>;
2074
2152
  width: z.ZodDefault<z.ZodEnum<{
@@ -2128,6 +2206,7 @@ declare const pageContentSchema: z.ZodObject<{
2128
2206
  label: z.ZodString;
2129
2207
  href: z.ZodString;
2130
2208
  }, z.core.$strip>>;
2209
+ icon: z.ZodOptional<z.ZodString>;
2131
2210
  }, z.core.$strip>>;
2132
2211
  tone: z.ZodDefault<z.ZodEnum<{
2133
2212
  default: "default";
@@ -2168,6 +2247,10 @@ declare const pageContentSchema: z.ZodObject<{
2168
2247
  question: z.ZodString;
2169
2248
  answer: z.ZodDefault<z.ZodString>;
2170
2249
  }, z.core.$strip>>;
2250
+ display: z.ZodOptional<z.ZodEnum<{
2251
+ list: "list";
2252
+ accordion: "accordion";
2253
+ }>>;
2171
2254
  }, z.core.$strip> | z.ZodObject<{
2172
2255
  eyebrow: z.ZodOptional<z.ZodString>;
2173
2256
  heading: z.ZodOptional<z.ZodString>;
@@ -2386,6 +2469,7 @@ declare const pageContentSchema: z.ZodObject<{
2386
2469
  limit: z.ZodDefault<z.ZodNumber>;
2387
2470
  collectionId: z.ZodOptional<z.ZodString>;
2388
2471
  categoryId: z.ZodOptional<z.ZodString>;
2472
+ emptyText: z.ZodOptional<z.ZodString>;
2389
2473
  }, z.core.$strip> | z.ZodObject<{
2390
2474
  eyebrow: z.ZodOptional<z.ZodString>;
2391
2475
  heading: z.ZodOptional<z.ZodString>;
@@ -2393,6 +2477,7 @@ declare const pageContentSchema: z.ZodObject<{
2393
2477
  limit: z.ZodDefault<z.ZodNumber>;
2394
2478
  collectionId: z.ZodOptional<z.ZodString>;
2395
2479
  categoryId: z.ZodOptional<z.ZodString>;
2480
+ emptyText: z.ZodOptional<z.ZodString>;
2396
2481
  }, z.core.$strip> | z.ZodObject<{
2397
2482
  eventSlug: z.ZodOptional<z.ZodString>;
2398
2483
  categoryId: z.ZodOptional<z.ZodString>;
@@ -2430,6 +2515,7 @@ declare const pageContentSchema: z.ZodObject<{
2430
2515
  all: "all";
2431
2516
  }>>;
2432
2517
  categoryId: z.ZodOptional<z.ZodString>;
2518
+ emptyText: z.ZodOptional<z.ZodString>;
2433
2519
  }, z.core.$strip> | z.ZodObject<{
2434
2520
  heading: z.ZodOptional<z.ZodString>;
2435
2521
  intro: z.ZodOptional<z.ZodString>;
@@ -2564,6 +2650,8 @@ declare const siteSettingsSchema: z.ZodObject<{
2564
2650
  label: z.ZodString;
2565
2651
  href: z.ZodString;
2566
2652
  }, z.core.$strip>>>;
2653
+ copyright: z.ZodOptional<z.ZodString>;
2654
+ footerNote: z.ZodOptional<z.ZodString>;
2567
2655
  contact: z.ZodDefault<z.ZodObject<{
2568
2656
  email: z.ZodOptional<z.ZodString>;
2569
2657
  phone: z.ZodOptional<z.ZodString>;
@@ -3086,7 +3174,14 @@ type Resolved<T extends BlockType> = T extends "hero" ? {
3086
3174
  data: BlockData<T> & {
3087
3175
  logo?: ImageRef | null;
3088
3176
  };
3089
- } : T extends "upcomingEvents" | "pastEvents" ? {
3177
+ } : T extends "upcomingEvents" ? {
3178
+ id: string;
3179
+ type: T;
3180
+ data: BlockData<T> & {
3181
+ events: HearthEvent[];
3182
+ collection?: Collection | null;
3183
+ };
3184
+ } : T extends "pastEvents" ? {
3090
3185
  id: string;
3091
3186
  type: T;
3092
3187
  data: BlockData<T> & {
@@ -3158,8 +3253,10 @@ type SharedFrom = {
3158
3253
  name: string;
3159
3254
  key?: string;
3160
3255
  };
3256
+ /** `anchor`, on any block: what links jump to it by (/#upcoming), for the id of its outermost element. */
3161
3257
  type KnownBlock = {
3162
3258
  [T in Exclude<BlockType, "sharedBlock">]: Resolved<T> & {
3259
+ anchor?: string;
3163
3260
  shared?: SharedFrom;
3164
3261
  };
3165
3262
  }[Exclude<BlockType, "sharedBlock">];
@@ -3167,6 +3264,7 @@ type KnownBlock = {
3167
3264
  type UnknownBlock = {
3168
3265
  id: string;
3169
3266
  type: string & {};
3267
+ anchor?: string;
3170
3268
  data: unknown;
3171
3269
  shared?: SharedFrom;
3172
3270
  };
@@ -3295,4 +3393,4 @@ type ApiErrorBody = {
3295
3393
  };
3296
3394
  };
3297
3395
 
3298
- export { type AnalyticsReport, type AnalyticsRow, type ApiErrorBody, BLOCK_SCHEMA_VERSION, type Block, type BlockData, type BlockOf, type BlockType, COLLECTION_SCHEMA_TYPES, type CategoryGroup, type CategoryRef, type Collection, type CollectionEntry, type CollectionRef, type CollectionSchemaType, type CustomBlockDefinition, type CustomField, type CustomFieldKind, DAYS_OF_WEEK, type DonationCheckout, type DonationInput, EMBED_ALLOW, EMBED_SANDBOX, type EntryDetails, type EventCustomFields, type EventRegistration, type EventTicket, type EventVolunteerShift, type EventVolunteering, type FormDefinition, type FormField, type Fundraiser, type FundraiserDetail, type GlobalBlock, type GlobalPopup, type HearthEvent, type HearthEventDetail, type HearthForm, type ImageRef, type KnownBlock, LODGING_TYPES, type LinkRef, ORGANIZATION_TYPES, type OrganizationType, PLACE_TYPES, type Page, type PageContent, type PageMeta, type PageSummary, type Position, type Redirect, type RegistrationInput, type RegistrationResult, type ResolvedBlock, SITE_LOCALES, SOCIAL_PLATFORMS, type Seo, type SharedFrom, type Site, type SiteAnalytics, type SiteSettings, type SitemapEntry, type TicketType, type UnknownBlock, VOLUNTEER_RESERVED_KEYS, type VolunteerForm, type VolunteerInput, type VolunteerResult, type VolunteerShift, type WebhookPayload, blockDataSchemas, blockFeature, blockSchema, blockTypes, customBlockDefinitionSchema, customBlockKey, customFieldSchema, customValuesSchema, directionsUrl, embedDocument, focalPosition, formDefinitionSchema, formFieldSchema, globalBlockKey, globalPopupSchema, pageContentSchema, parseBlocks, parsePageContent, parseSiteSettings, parseTicketTypes, parseVolunteerForm, parseVolunteerShifts, pinned, popupHref, popupKey, seoSchema, siteSettingsSchema, ticketTypeSchema, ticketTypesSchema, videoEmbedUrl, volunteerFormSchema, volunteerShiftSchema, volunteerShiftsSchema };
3396
+ export { type AnalyticsReport, type AnalyticsRow, type ApiErrorBody, BLOCK_SCHEMA_VERSION, type Block, type BlockData, type BlockOf, type BlockType, COLLECTION_SCHEMA_TYPES, type CategoryGroup, type CategoryRef, type Collection, type CollectionEntry, type CollectionRef, type CollectionSchemaType, type CustomBlockDefinition, type CustomField, type CustomFieldKind, DAYS_OF_WEEK, type DonationCheckout, type DonationInput, EMBED_ALLOW, EMBED_SANDBOX, type EntryDetails, type EventCustomFields, type EventRegistration, type EventTicket, type EventVolunteerShift, type EventVolunteering, type FormDefinition, type FormField, type Fundraiser, type FundraiserDetail, type GlobalBlock, type GlobalPopup, type HearthEvent, type HearthEventDetail, type HearthForm, type ImageRef, type KnownBlock, LODGING_TYPES, type LinkRef, ORGANIZATION_TYPES, type OrganizationType, PLACE_TYPES, type Page, type PageContent, type PageMeta, type PageSummary, type Position, type Redirect, type RegistrationInput, type RegistrationResult, type ResolvedBlock, SITE_LOCALES, SOCIAL_PLATFORMS, type Seo, type SharedFrom, type Site, type SiteAnalytics, type SiteSettings, type SitemapEntry, type TicketType, UNLISTED_PAGE_SLUGS, type UnknownBlock, VOLUNTEER_RESERVED_KEYS, type VolunteerForm, type VolunteerInput, type VolunteerResult, type VolunteerShift, type WebhookPayload, blockAnchorSchema, blockDataSchemas, blockFeature, blockSchema, blockTypes, customBlockDefinitionSchema, customBlockKey, customFieldSchema, customValuesSchema, directionsUrl, embedDocument, focalPosition, formDefinitionSchema, formFieldSchema, globalBlockKey, globalPopupSchema, isUnlistedPage, pageContentSchema, parseBlocks, parsePageContent, parseSiteSettings, parseTicketTypes, parseVolunteerForm, parseVolunteerShifts, pinned, popupHref, popupKey, seoSchema, siteSettingsSchema, ticketTypeSchema, ticketTypesSchema, videoEmbedUrl, volunteerFormSchema, volunteerShiftSchema, volunteerShiftsSchema };
package/dist/index.js CHANGED
@@ -22,6 +22,8 @@ var link = z.object({
22
22
  var position = z.object({ lat: z.number().min(-90).max(90), lng: z.number().min(-180).max(180) });
23
23
  var markdown = z.string().default("");
24
24
  var tone = z.enum(["default", "muted", "inverse", "accent"]);
25
+ var slug = /^[a-z0-9]+(-[a-z0-9]+)*$/;
26
+ var blockAnchorSchema = z.string().regex(slug, "Use lowercase letters, numbers and dashes.").max(60, "Keep it under 60 characters.");
25
27
  var formFieldSchema = z.object({
26
28
  /** Key in the submitted data, e.g. "phone". */
27
29
  name: z.string().regex(/^[a-z][a-zA-Z0-9_]*$/, "Use letters and numbers, starting with a lowercase letter."),
@@ -132,7 +134,9 @@ var blockDataSchemas = {
132
134
  secondaryCta: link.optional(),
133
135
  size: z.enum(["full", "compact"]).default("full"),
134
136
  /** Show the site's logo (Settings → SEO) in the hero; the API adds it as `logo`. */
135
- showLogo: z.boolean().optional()
137
+ showLogo: z.boolean().optional(),
138
+ /** The hero's ground. Unset, the site's design decides (usually dark, over the image). */
139
+ tone: tone.optional()
136
140
  }),
137
141
  richText: z.object({
138
142
  markdown,
@@ -161,7 +165,9 @@ var blockDataSchemas = {
161
165
  title: z.string().min(1),
162
166
  body: z.string().default(""),
163
167
  image: image.optional(),
164
- link: link.optional()
168
+ link: link.optional(),
169
+ /** A short key for an icon the frontend draws, such as "graduation-cap" (it isn't an image). */
170
+ icon: z.string().regex(slug, "Use a short key: lowercase letters, numbers and dashes.").max(40).optional()
165
171
  })
166
172
  ).min(1),
167
173
  tone: tone.default("default")
@@ -177,7 +183,9 @@ var blockDataSchemas = {
177
183
  }),
178
184
  faq: z.object({
179
185
  heading: z.string().optional(),
180
- items: z.array(z.object({ question: z.string().min(1), answer: markdown })).min(1)
186
+ items: z.array(z.object({ question: z.string().min(1), answer: markdown })).min(1),
187
+ /** "accordion" opens each answer on request (the default); "list" shows every answer. */
188
+ display: z.enum(["accordion", "list"]).optional()
181
189
  }),
182
190
  /** Plans or packages side by side. Prices are text, so any currency, "Free" or "Let's talk" works. */
183
191
  pricing: z.object({
@@ -339,11 +347,14 @@ var blockDataSchemas = {
339
347
  eyebrow: z.string().optional(),
340
348
  heading: z.string().optional(),
341
349
  intro: z.string().optional(),
342
- limit: z.number().int().min(1).max(12).default(3),
350
+ /** How many to show; 0 shows every upcoming event. */
351
+ limit: z.number().int().min(0).max(12).default(3),
343
352
  /** Only events in this event collection (e.g. "Talks"); omit for every event. */
344
353
  collectionId: z.string().uuid().optional(),
345
354
  /** Only events in this category (e.g. "Featured"). */
346
- categoryId: z.string().uuid().optional()
355
+ categoryId: z.string().uuid().optional(),
356
+ /** Shown when there are none; omit for the frontend's own wording. */
357
+ emptyText: z.string().optional()
347
358
  }),
348
359
  /** Events that have ended, most recent first: a talk archive, past events. */
349
360
  pastEvents: z.object({
@@ -354,7 +365,9 @@ var blockDataSchemas = {
354
365
  /** Only events in this event collection (e.g. "Talks"); omit for every event. */
355
366
  collectionId: z.string().uuid().optional(),
356
367
  /** Only events in this category. */
357
- categoryId: z.string().uuid().optional()
368
+ categoryId: z.string().uuid().optional(),
369
+ /** Shown when there are none; omit and the block doesn't show at all. */
370
+ emptyText: z.string().optional()
358
371
  }),
359
372
  eventSpotlight: z.object({
360
373
  /** Event slug; omit to show the next upcoming event. */
@@ -405,7 +418,9 @@ var blockDataSchemas = {
405
418
  intro: z.string().optional(),
406
419
  limit: z.number().int().min(1).max(24).default(6),
407
420
  status: z.enum(["active", "completed", "all"]).default("active"),
408
- categoryId: z.string().uuid().optional()
421
+ categoryId: z.string().uuid().optional(),
422
+ /** Shown when there are none; omit for the frontend's own wording. */
423
+ emptyText: z.string().optional()
409
424
  }),
410
425
  /**
411
426
  * A donation form (giving feature). The frontend posts it to its own server, which starts checkout through the
@@ -441,6 +456,7 @@ var blockVariants = blockTypes.map(
441
456
  (type) => z.object({
442
457
  id: z.string().min(1),
443
458
  type: z.literal(type),
459
+ anchor: blockAnchorSchema.optional(),
444
460
  data: blockDataSchemas[type]
445
461
  })
446
462
  );
@@ -457,6 +473,8 @@ var seoSchema = z.object({
457
473
  /** Point search engines at another address for this content (a path or full URL). */
458
474
  canonical: z.string().trim().max(500).optional()
459
475
  });
476
+ var UNLISTED_PAGE_SLUGS = ["not-found", "donate/thank-you", "registered"];
477
+ var isUnlistedPage = (pageSlug) => UNLISTED_PAGE_SLUGS.includes(pageSlug);
460
478
  var pageContentSchema = z.object({
461
479
  title: z.string().trim().min(1, "Give the page a title."),
462
480
  seo: z.object({
@@ -657,6 +675,10 @@ var siteSettingsSchema = z2.object({
657
675
  /** An optional button at the end of the main menu, e.g. "Book now" or "Donate". Frontends style it as a button. */
658
676
  navigationCta: link2.optional(),
659
677
  footerLinks: z2.array(link2).default([]),
678
+ /** The footer's copyright line, replacing "© <year> <site name>". {year} becomes the current year. */
679
+ copyright: z2.string().trim().max(200).optional(),
680
+ /** Small print at the foot of the footer, e.g. a registration number. */
681
+ footerNote: z2.string().trim().max(600).optional(),
660
682
  contact: z2.object({
661
683
  email: z2.string().trim().optional(),
662
684
  phone: z2.string().trim().optional(),
@@ -852,7 +874,9 @@ export {
852
874
  PLACE_TYPES,
853
875
  SITE_LOCALES,
854
876
  SOCIAL_PLATFORMS,
877
+ UNLISTED_PAGE_SLUGS,
855
878
  VOLUNTEER_RESERVED_KEYS,
879
+ blockAnchorSchema,
856
880
  blockDataSchemas,
857
881
  blockFeature,
858
882
  blockSchema,
@@ -868,6 +892,7 @@ export {
868
892
  formFieldSchema,
869
893
  globalBlockKey,
870
894
  globalPopupSchema,
895
+ isUnlistedPage,
871
896
  pageContentSchema,
872
897
  parseBlocks,
873
898
  parsePageContent,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@the-smithy/hearth-schema",
3
- "version": "0.24.1",
3
+ "version": "0.25.0",
4
4
  "description": "Content schemas and API types shared by Hearth and its SDK.",
5
5
  "type": "module",
6
6
  "license": "SEE LICENSE IN LICENSE",