ferst-core 0.13.0 → 0.15.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.
@@ -10,7 +10,7 @@
10
10
  // Forms and calendars live in the portal, never in the repo: place a form with a
11
11
  // `{ "type": "form", "form": "<its name on this site>" }` block, take a payment with a
12
12
  // `{ "type": "pay", "item": "<its id>" }` block, take bookings with a
13
- // `{ "type": "book", "service": "<its id>" }` block, and show the calendar by setting
13
+ // `{ "type": "book", "service": "<its id>" }` block (or `"resource"`, for a person or a place), and show the calendar by setting
14
14
  // calendarSettings.embedUrl to the address printed here.
15
15
  import { readFileSync, realpathSync } from 'node:fs';
16
16
  import { resolve } from 'node:path';
@@ -87,6 +87,20 @@ export function formatModules(data) {
87
87
  const how = { times: 'a time of that length', chosen: 'from that long, a start and an end', places: 'places at its events' }[b.mode];
88
88
  out.push(` ${b.name}: ${minutesText(b.minutes)}${how ? `, ${how}` : ''}${b.price ? `, ${b.price}` : ''}`);
89
89
  out.push(` place it with: { "type": "book", "service": "${b.id}" }`);
90
+ // Its events (platform 2026-11-24+): "Book now" for one, its next date with places.
91
+ for (const e of b.events ?? []) {
92
+ out.push(` ${e.title}${e.next ? `, next ${e.next.replace('T', ' at ')}` : ''}: { "type": "book", "service": "${b.id}", "event": "${e.id}", "look": "button", "title": "${e.title.replace(/"/g, '\\"')}" }`);
93
+ }
94
+ }
95
+ // The people and places that provide them (platform 2026-11-24+): a block can name one of them.
96
+ if (data.book_with?.length) {
97
+ const names = new Map(data.book.map((b) => [b.id, b.name]));
98
+ out.push(' Who and where (a block for one books everything they provide online):');
99
+ for (const r of data.book_with) {
100
+ out.push(` ${r.name} (${r.kind === 'place' ? 'a place' : 'a person'}): ${r.offers.map((id) => names.get(id) ?? id).join(', ')}`);
101
+ out.push(` place it with: { "type": "book", "resource": "${r.id}" }`);
102
+ out.push(` or one offer with them: { "type": "book", "service": "<offer>", "resource": "${r.id}" }`);
103
+ }
90
104
  }
91
105
  out.push('');
92
106
  }
@@ -81,6 +81,17 @@ collections:
81
81
  - { name: secondaryLogoLight, label: Footer logo (light), widget: image, required: false }
82
82
  - { name: secondaryLogoDark, label: Footer logo (dark), widget: image, required: false }
83
83
  - { name: favicon, label: Browser icon, widget: image, required: false, hint: "A square image (PNG or SVG), at least 48 x 48. Leave blank to use the header logo if it's square, or the site's initial in its brand colour." }
84
+ - name: header
85
+ label: Header logo layout
86
+ widget: object
87
+ required: false
88
+ collapsed: true
89
+ hint: How big the header logo is, and whether it hangs below the bar over the top of the page (good for a round badge).
90
+ fields:
91
+ - { name: size, label: Size, widget: select, required: false, default: standard, options: [{ label: "Standard", value: standard }, { label: "Large (about twice)", value: large }, { label: "Extra large (about four times)", value: xl }] }
92
+ - { name: placement, label: Placement, widget: select, required: false, default: inline, options: [{ label: "Inside the bar", value: inline }, { label: "Hanging below the bar", value: overhang }] }
93
+ - { name: shrinkOnScroll, label: Tuck into the bar when scrolling, widget: boolean, required: false, default: true, hint: "Hanging logos only. Off keeps it hanging while visitors read." }
94
+ - { name: shadow, label: Soft shadow, widget: boolean, required: false, default: false, hint: "Helps a dark round badge stand out from a dark header." }
84
95
 
85
96
  - name: navbar
86
97
  label: Navigation