@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.
- package/README.md +5 -5
- package/dist/assets/form-island.dc9aedd556.js +51 -0
- package/dist/assets/{islands.eb84e107c4.js → islands.88abb49942.js} +1 -1
- package/dist/assets/sites-forms.css +1 -1
- package/dist/assets/sites-forms.e506c7dda2.css +10 -0
- package/dist/assets.generated-7FRY6LHS.js +3 -0
- package/dist/{assets.generated-QOBL5IUN.js.map → assets.generated-7FRY6LHS.js.map} +1 -1
- package/dist/{chunk-C375ZPU2.js → chunk-P5MR34QQ.js} +23 -9
- package/dist/chunk-P5MR34QQ.js.map +1 -0
- package/dist/{chunk-ULH54DAG.js → chunk-PA7IZF4X.js} +4 -4
- package/dist/{chunk-ULH54DAG.js.map → chunk-PA7IZF4X.js.map} +1 -1
- package/dist/chunk-PN2VXOA5.js +18 -0
- package/dist/chunk-PN2VXOA5.js.map +1 -0
- package/dist/editor.d.ts +4 -1
- package/dist/editor.js +24 -6
- package/dist/editor.js.map +1 -1
- package/dist/{handler-F4ZMH34N.js → handler-P7RRXR6K.js} +5 -5
- package/dist/{handler-F4ZMH34N.js.map → handler-P7RRXR6K.js.map} +1 -1
- package/dist/sections.d.ts +31 -21
- package/dist/sections.js +1 -1
- package/dist/web.d.ts +2 -2
- package/dist/web.js +3 -3
- package/package.json +41 -12
- package/dist/assets/form-island.f3bd46469d.js +0 -51
- package/dist/assets/sites-forms.732cc7e0c1.css +0 -10
- package/dist/assets.generated-QOBL5IUN.js +0 -3
- package/dist/chunk-3YW7ITU5.js +0 -18
- package/dist/chunk-3YW7ITU5.js.map +0 -1
- package/dist/chunk-C375ZPU2.js.map +0 -1
|
@@ -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
|
-
|
|
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("
|
|
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
|
|
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:
|
|
1923
|
+
version: 2,
|
|
1924
|
+
migrations: { 2: coachToHost },
|
|
1911
1925
|
label: "Timetable",
|
|
1912
|
-
description: "The week's classes by time and day, with
|
|
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",
|
|
1932
|
-
{ day: "wed", start: "06:00", title: "Strength", type: "strength",
|
|
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-
|
|
2241
|
-
//# sourceMappingURL=chunk-
|
|
2254
|
+
//# sourceMappingURL=chunk-P5MR34QQ.js.map
|
|
2255
|
+
//# sourceMappingURL=chunk-P5MR34QQ.js.map
|