@marktiderman/genesis-sites 0.3.3 → 0.4.1

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.
@@ -1809,7 +1809,10 @@ var Session = z.object({
1809
1809
  title: Line(60),
1810
1810
  /** A class type's id, for its chip colour and the legend. */
1811
1811
  type: TypeId.optional(),
1812
- coach: Line(60).optional(),
1812
+ /** Who leads it: shown as "with …". */
1813
+ host: Line(60).optional(),
1814
+ /** @deprecated Use `host`. Still accepted; version 2 moves it into `host`, and the editor hides it. */
1815
+ coach: Line(60).optional().meta({ deprecated: true }),
1813
1816
  location: Line(60).optional(),
1814
1817
  note: Line(80).optional(),
1815
1818
  /** Book this class (an outbound link, say). */
@@ -1827,7 +1830,7 @@ var schema18 = z.object({
1827
1830
  types: z.array(ClassType).max(16).default([]),
1828
1831
  sessions: z.array(Session).max(200),
1829
1832
  /** What an empty slot or day says. */
1830
- emptyText: Line(60).default("No classes"),
1833
+ emptyText: Line(60).default("Nothing scheduled"),
1831
1834
  footnote: Copy(300).optional(),
1832
1835
  surface: Surface.default("base"),
1833
1836
  anchor: Anchor
@@ -1865,7 +1868,8 @@ function Chip({ session, types }) {
1865
1868
  ] });
1866
1869
  }
1867
1870
  function Details({ session, muted }) {
1868
- const parts = [session.coach ? `with ${session.coach}` : null, session.location, session.note].filter(Boolean);
1871
+ const host = session.host ?? session.coach;
1872
+ const parts = [host ? `with ${host}` : null, session.location, session.note].filter(Boolean);
1869
1873
  if (!parts.length) return null;
1870
1874
  return /* @__PURE__ */ jsx("span", { className: cn("block text-xs", muted && "text-muted-foreground"), children: parts.join(" \xB7 ") });
1871
1875
  }
@@ -1905,11 +1909,21 @@ function Legend({ props, days }) {
1905
1909
  ] }, t.id)) })
1906
1910
  );
1907
1911
  }
1912
+ function coachToHost(props) {
1913
+ if (!Array.isArray(props.sessions)) return props;
1914
+ const sessions = props.sessions.map((s) => {
1915
+ if (!s || typeof s !== "object" || !("coach" in s)) return s;
1916
+ const { coach, ...rest } = s;
1917
+ return rest.host === void 0 || rest.host === "" ? coach === void 0 ? rest : { ...rest, host: coach } : rest;
1918
+ });
1919
+ return { ...props, sessions };
1920
+ }
1908
1921
  var scheduleSection = defineSection({
1909
1922
  type: "schedule",
1910
- version: 1,
1923
+ version: 2,
1924
+ migrations: { 2: coachToHost },
1911
1925
  label: "Timetable",
1912
- description: "The week's classes by time and day, with coach and place: a table on wider screens and a day picker on a phone.",
1926
+ description: "The week's classes by time and day, with host and place: a table on wider screens and a day picker on a phone.",
1913
1927
  category: "content",
1914
1928
  schema: schema18,
1915
1929
  variants: [
@@ -1928,8 +1942,8 @@ var scheduleSection = defineSection({
1928
1942
  { id: "open", name: "Open gym", description: "Train on your own; a coach is on the floor.", tone: "soft" }
1929
1943
  ],
1930
1944
  sessions: [
1931
- { day: "mon", start: "06:00", title: "Strength", type: "strength", coach: "Coach name" },
1932
- { day: "wed", start: "06:00", title: "Strength", type: "strength", coach: "Coach name" },
1945
+ { day: "mon", start: "06:00", title: "Strength", type: "strength", host: "Host name" },
1946
+ { day: "wed", start: "06:00", title: "Strength", type: "strength", host: "Host name" },
1933
1947
  { day: "sat", start: "09:00", title: "Open gym", type: "open" }
1934
1948
  ]
1935
1949
  }
@@ -2237,5 +2251,5 @@ var builtInSections = Object.freeze([
2237
2251
  for (const def of builtInSections) registerBuiltInSection(def);
2238
2252
 
2239
2253
  export { Anchor, ButtonLink, CHIP_TONES, HiddenTitle, ICONS, IconName, ItemTitle, MAP_PROVIDERS, SectionBand, SectionIntro, SectionTitle, SiteFormHeader, SiteImage, TextLink, WEEKDAYS, blogListSection, builtInSections, ctaSection, faqSection, featuresSection, fileDescription, fileHref, fileSection, footerSection, formDrawMode, formEmbedSection, formatPostDate, formatTime, gallerySection, heroSection, linkAttrs, logosSection, mapEmbedUrl, mapPageUrl, mapSection, navSection, postBodySection, pricingSection, resolveHref, richTextSection, scheduleSection, siteFormSlots, statsSection, teamSection, testimonialsSection, timelineSection, titleId };
2240
- //# sourceMappingURL=chunk-C375ZPU2.js.map
2241
- //# sourceMappingURL=chunk-C375ZPU2.js.map
2254
+ //# sourceMappingURL=chunk-P5MR34QQ.js.map
2255
+ //# sourceMappingURL=chunk-P5MR34QQ.js.map