@vermeulen.solutions/eventual 0.19.1 → 0.19.3
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 +3 -2
- package/astro/events/description.ts +28 -9
- package/dist/index.mjs +1 -1
- package/docs/developer-guide.md +2 -0
- package/docs/registry-installation.md +2 -2
- package/package.json +2 -1
- package/skills/eventual-rsvp/SKILL.md +90 -0
- package/skills/eventual-rsvp/references/event-pages.md +78 -0
- package/skills/eventual-rsvp/references/registrations-and-tickets.md +82 -0
- package/skills/eventual-rsvp/references/setup.md +97 -0
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
<p align="center">
|
|
8
8
|
<a href="https://github.com/Vermeulen-Solutions/eventual-rsvp-core/actions/workflows/ci.yml"><img src="https://github.com/Vermeulen-Solutions/eventual-rsvp-core/actions/workflows/ci.yml/badge.svg" alt="CI Status" /></a>
|
|
9
9
|
<a href="https://www.npmjs.com/package/@vermeulen.solutions/eventual"><img src="https://img.shields.io/npm/v/%40vermeulen.solutions%2Feventual?color=176b57&label=npm%20helpers" alt="Latest npm version of the helpers" /></a>
|
|
10
|
-
<a href="https://plugins.emdashcms.com/plugins/@vermeulen.solutions/eventual"><img src="https://img.shields.io/badge/EmDash_Registry-0.19.
|
|
10
|
+
<a href="https://plugins.emdashcms.com/plugins/@vermeulen.solutions/eventual"><img src="https://img.shields.io/badge/EmDash_Registry-0.19.3-0b4d3d" alt="EmDash Plugin Registry" /></a>
|
|
11
11
|
<a href="https://emdashcms.com"><img src="https://img.shields.io/badge/EmDash-1.2%20to%201.6-0b4d3d" alt="EmDash Compatibility" /></a>
|
|
12
12
|
<a href="./LICENSE"><img src="https://img.shields.io/badge/License-MIT-d89521" alt="License: MIT" /></a>
|
|
13
13
|
<img src="https://img.shields.io/badge/TypeScript-strict-3178c6" alt="TypeScript Strict" />
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
Plan and publish events in [EmDash CMS](https://emdashcms.com). Write announcements, choose venues and organizers, set repeat schedules, and share events through your website and calendar subscriptions.
|
|
20
20
|
|
|
21
|
-
**Current release: 0.19.
|
|
21
|
+
**Current release: 0.19.3**, the same version on the EmDash Registry and on npm. Events are edited in EmDash's own collections, with rich text, images, drafts and translations. Your site builder adds the visitor pages from the package; the screenshots below show them.
|
|
22
22
|
|
|
23
23
|
In 0.14.x, old events stored inside the plugin are shown only when an administrator explicitly enables **Show old events saved inside the plugin**. Native collections remain authoritative. See [what changed](./docs/release-notes-0.14.0.md).
|
|
24
24
|
|
|
@@ -136,6 +136,7 @@ The backend shares EmDash's sandbox call budget: the public feeds use up to 30 c
|
|
|
136
136
|
- [Developer guide](./docs/developer-guide.md) — integration and API reference.
|
|
137
137
|
- [Changelog](./CHANGELOG.md) · [0.19.0 release notes](./docs/release-notes-0.19.0.md) · [0.18.7 release notes](./docs/release-notes-0.18.7.md) · [0.18.6 release notes](./docs/release-notes-0.18.6.md) · [0.18.5 release notes](./docs/release-notes-0.18.5.md) · [0.15.0 cache integration](./docs/release-notes-0.15.0.md) · [0.14.0 native collections](./docs/release-notes-0.14.0.md).
|
|
138
138
|
- [Astro example site](./examples/astro-events/README.md) — the event pages in a small site.
|
|
139
|
+
- [Agent skill](./skills/eventual-rsvp/SKILL.md) — for coding agents (Claude Code, Codex, opencode and others) building an Eventual site: copy `skills/eventual-rsvp` into the project's `.agents/skills/` or `.claude/skills/`. Docs as Markdown for agents: [eventual.rsvp/llms.txt](https://eventual.rsvp/llms.txt).
|
|
139
140
|
- [Release evidence and older records](./docs/history.md).
|
|
140
141
|
|
|
141
142
|
---
|
|
@@ -20,16 +20,35 @@ export function descriptionHtml(blocks: unknown[] | undefined, text: string, opt
|
|
|
20
20
|
return Array.isArray(blocks) && blocks.length ? portableTextHtml(blocks, options) : markdownHtml(text, options);
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* A plain one-paragraph excerpt for lists and cards. Blocks (paragraphs, headings, list items)
|
|
25
|
+
* are joined as a sentence would be: a colon before a list, semicolons between its items and a
|
|
26
|
+
* full stop after a heading, so "What to bring" and its list do not run together.
|
|
27
|
+
*/
|
|
24
28
|
export function descriptionExcerpt(source: string, limit = 180): string {
|
|
25
|
-
const
|
|
26
|
-
.replace(/<[^>]*>/
|
|
27
|
-
.replace(
|
|
28
|
-
.replace(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
const text = source
|
|
30
|
+
.replace(/<li\b[^>]*>/gi, "\n- ")
|
|
31
|
+
.replace(/<br\s*\/?>|<\/(?:p|li|h[1-6]|div|blockquote)>/gi, "\n")
|
|
32
|
+
.replace(/<[^>]*>/g, " ");
|
|
33
|
+
const blocks = text.split(/\n+/).map((line) => ({
|
|
34
|
+
list: /^\s*(?:[-*+]|\d+[.)])\s+/.test(line),
|
|
35
|
+
text: line
|
|
36
|
+
.replace(/^\s*#{1,6}\s+/, "")
|
|
37
|
+
.replace(/^\s*(?:[-*+]|\d+[.)])\s+/, "")
|
|
38
|
+
.replace(/\[([^\]]+)\]\([^)]*\)/g, "$1")
|
|
39
|
+
.replace(/\s*\(https?:\/\/[^\s)]+\)/g, "")
|
|
40
|
+
.replace(/\*\*|__|[*_`]/g, "")
|
|
41
|
+
.replace(/\s+/g, " ")
|
|
42
|
+
.trim(),
|
|
43
|
+
})).filter((block) => block.text);
|
|
44
|
+
let plain = "";
|
|
45
|
+
blocks.forEach((block, index) => {
|
|
46
|
+
plain += block.text;
|
|
47
|
+
const next = blocks[index + 1];
|
|
48
|
+
if (!next) return;
|
|
49
|
+
if (/[.!?…:;,]$/.test(block.text)) plain += " ";
|
|
50
|
+
else plain += block.list && next.list ? "; " : next.list ? ": " : ". ";
|
|
51
|
+
});
|
|
33
52
|
if (plain.length <= limit) return plain;
|
|
34
53
|
const cut = plain.slice(0, limit + 1);
|
|
35
54
|
const boundary = cut.lastIndexOf(" ");
|
package/dist/index.mjs
CHANGED
package/docs/developer-guide.md
CHANGED
|
@@ -5,6 +5,8 @@ EmDash collections own content, rich text, languages, drafts, revisions and publ
|
|
|
5
5
|
The [public feed caching guide](public-feed-caching.md) describes additive
|
|
6
6
|
dependency/expiry metadata, direct runtime dispatch and the host's explicit opt-in.
|
|
7
7
|
|
|
8
|
+
Building with a coding agent? Give it the [eventual-rsvp skill](../skills/eventual-rsvp/SKILL.md) (also inside the npm package under `skills/`) or point it at [eventual.rsvp/llms.txt](https://eventual.rsvp/llms.txt).
|
|
9
|
+
|
|
8
10
|
## Versions and where to get them
|
|
9
11
|
|
|
10
12
|
One version number covers everything. Use the same one in all three places:
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
# Eventual RSVP – Core 0.19.
|
|
1
|
+
# Eventual RSVP – Core 0.19.3
|
|
2
2
|
|
|
3
3
|
Requires EmDash **>=1.2.0 <2.0.0**; tested on 1.2.0, 1.4.0, 1.5.0 and 1.6.0. **1.4.0 or newer is recommended** for nested forms and Cloudflare plugin mutations, and required for the optional cache integration.
|
|
4
4
|
|
|
5
|
-
In **Plugins → Registry**, find **Eventual RSVP – Core** by **vermeulen.solutions**, review permissions and install or update. 0.19.
|
|
5
|
+
In **Plugins → Registry**, find **Eventual RSVP – Core** by **vermeulen.solutions**, review permissions and install or update. 0.19.3 needs no new permissions; since 0.18.0 Core uses `network:request` to `cdn.jsdelivr.net` for the admin's language packs. Agent tools stay off until you expand the plugin under **Plugins** and switch on **Agent access**.
|
|
6
6
|
|
|
7
7
|
Open **Event settings**, select compatible event, venue and organizer collections, then **Save settings**. Installation does not create schemas or migrate content. Site builders: [collection setup](https://github.com/Vermeulen-Solutions/eventual-rsvp-core/blob/main/docs/collection-setup.md).
|
|
8
8
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vermeulen.solutions/eventual",
|
|
3
|
-
"version": "0.19.
|
|
3
|
+
"version": "0.19.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"homepage": "https://eventual.rsvp/",
|
|
6
6
|
"type": "module",
|
|
@@ -45,6 +45,7 @@
|
|
|
45
45
|
"dist/*.d.mts",
|
|
46
46
|
"emdash-plugin.jsonc",
|
|
47
47
|
"astro",
|
|
48
|
+
"skills",
|
|
48
49
|
"transfer",
|
|
49
50
|
"src/domain",
|
|
50
51
|
"src/schema",
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: eventual-rsvp
|
|
3
|
+
description: Add events, registrations and tickets to an EmDash (Astro) site with the Eventual RSVP plugins — Core (events, venues, recurrence, feeds, ready-made event pages), Registrations (free RSVP) and Tickets (paid tickets). Use when installing or configuring these plugins, building event pages, wiring an RSVP or ticket form, finding a plugin ID, or styling the event pages.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Eventual RSVP for EmDash
|
|
7
|
+
|
|
8
|
+
Eventual RSVP is three EmDash plugins. **Core** (`@vermeulen.solutions/eventual`, free, MIT) keeps events, venues and organizers in the site's own EmDash collections, handles recurring dates, serves JSON and iCalendar feeds, and ships two ready-made Astro page bodies. **Registrations** (`@vermeulen.solutions/eventual-attendance`, free, MIT) adds RSVP with places, a waiting list, approval and reminders. **Tickets** (`@vermeulen.solutions/eventual-tickets`, commercial licence) adds paid and free tickets, Stripe or invoice payment, QR tickets and door check-in. Registrations and Tickets need Core.
|
|
9
|
+
|
|
10
|
+
## Gotchas
|
|
11
|
+
|
|
12
|
+
These silently break sites. Check them before writing code.
|
|
13
|
+
|
|
14
|
+
1. **The npm package `eventual` is unrelated.** Never run `npm install eventual`. The packages are scoped: `@vermeulen.solutions/eventual`, `-attendance`, `-tickets`. A Registry install still needs these npm packages for the Astro components.
|
|
15
|
+
2. **One install route per plugin.** Install each plugin either from the EmDash Registry (Admin → Plugins → Registry) or from npm in `astro.config.mjs`, never both: EmDash would treat them as two plugins with separate settings and data.
|
|
16
|
+
3. **The plugin ID depends on the install route.** Every address and component prop must use it.
|
|
17
|
+
|
|
18
|
+
| | Core | Registrations | Tickets |
|
|
19
|
+
| --- | --- | --- | --- |
|
|
20
|
+
| Registry install (same on every site) | `r_hxn32uyal53iahxf` | `r_lywzrupdtpjvkohn` | `r_qd5hk435vo2yqk2n` |
|
|
21
|
+
| npm, in `astro.config.mjs` | `eventual` | `eventual-attendance` | `eventual-tickets` |
|
|
22
|
+
|
|
23
|
+
Ask the user which route they used if it is not clear, and keep the IDs in one module (see [setup](references/setup.md#plugin-ids)). If the site's own admin shows a different ID than this table, the admin wins: use its value and tell the user.
|
|
24
|
+
4. **Core does not create collections.** Events, venues and organizers are EmDash collections made from Core's blueprint (`npx -p @vermeulen.solutions/eventual eventual-schema`), then chosen under **Event settings**. Without them the feeds answer that events are not connected.
|
|
25
|
+
5. **Event pages are server-rendered.** Every page using Core's loaders needs `export const prerender = false` (the month, view and category come from the address).
|
|
26
|
+
6. **Don't rebuild what Core ships.** Use `EventBrowser` and `EventDetail` with `loadEventBrowser` / `loadEventDetail` instead of fetching the feed and writing views by hand. Use each feed event's `calendarLinks` for "Add to calendar"; don't build Google/Outlook/ICS links yourself.
|
|
27
|
+
7. **Forms go inside `EventDetail`.** `RsvpForm` and `TicketCheckout` take the event's content ID and occurrence start: use `eventContentId(event)` and `occurrenceStart(event)`, not `event.id` (recurring dates have IDs like `<id>#<date>`).
|
|
28
|
+
8. **Theming is CSS properties.** Set `--eventual-*` (Core, Registrations) or `--et-*` (Tickets). The components' CSS sits in the `eventual` cascade layer, so site CSS wins without `!important`. Colours follow `color-scheme`, not the OS: see [theming](references/event-pages.md#theming).
|
|
29
|
+
9. **Moving a site from npm to the Registry loses plugin data** stored under the old ID (settings, registrations, orders, licence, calendar subscriber addresses). Read [setup](references/setup.md#moving-to-the-registry) before suggesting it.
|
|
30
|
+
|
|
31
|
+
## Typical tasks
|
|
32
|
+
|
|
33
|
+
| Task | Read |
|
|
34
|
+
| --- | --- |
|
|
35
|
+
| Install, collections, plugin IDs, moving to the Registry | [references/setup.md](references/setup.md) |
|
|
36
|
+
| Events page and event page, options, languages, theming | [references/event-pages.md](references/event-pages.md) |
|
|
37
|
+
| RSVP form, manage page, ticket checkout, order and door pages | [references/registrations-and-tickets.md](references/registrations-and-tickets.md) |
|
|
38
|
+
|
|
39
|
+
## Minimal working pages
|
|
40
|
+
|
|
41
|
+
`src/lib/eventual.ts` (one place for IDs and site settings; values here are for a Registry install):
|
|
42
|
+
|
|
43
|
+
```ts
|
|
44
|
+
export const CORE_ID = "r_hxn32uyal53iahxf"; // npm install: "eventual"
|
|
45
|
+
// With Registrations or Tickets, add RSVP_ID / TICKETS_ID and their paths: references/setup.md#plugin-ids
|
|
46
|
+
export const LOCALE = "en-GB"; // any BCP 47 tag, e.g. "fr-CH"
|
|
47
|
+
export const TIME_ZONE = "Europe/London";
|
|
48
|
+
export const EVENTS_PATH = "/events"; // must match the page folder
|
|
49
|
+
export const eventOptions = { pluginId: CORE_ID, locale: LOCALE, timeZone: TIME_ZONE, basePath: EVENTS_PATH };
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
`src/pages/events/index.astro`:
|
|
53
|
+
|
|
54
|
+
```astro
|
|
55
|
+
---
|
|
56
|
+
import EventBrowser from "@vermeulen.solutions/eventual/astro/EventBrowser.astro";
|
|
57
|
+
import { loadEventBrowser } from "@vermeulen.solutions/eventual/astro/events";
|
|
58
|
+
import Layout from "../../layouts/Layout.astro";
|
|
59
|
+
import { eventOptions } from "../../lib/eventual";
|
|
60
|
+
|
|
61
|
+
export const prerender = false;
|
|
62
|
+
const data = await loadEventBrowser(Astro.url, eventOptions);
|
|
63
|
+
Astro.response.status = data.status;
|
|
64
|
+
---
|
|
65
|
+
<Layout title={data.pageTitle} lang={data.lang}><EventBrowser data={data} /></Layout>
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
`src/pages/events/[id].astro`:
|
|
69
|
+
|
|
70
|
+
```astro
|
|
71
|
+
---
|
|
72
|
+
import EventDetail from "@vermeulen.solutions/eventual/astro/EventDetail.astro";
|
|
73
|
+
import { loadEventDetail } from "@vermeulen.solutions/eventual/astro/events";
|
|
74
|
+
import Layout from "../../layouts/Layout.astro";
|
|
75
|
+
import { eventOptions } from "../../lib/eventual";
|
|
76
|
+
|
|
77
|
+
export const prerender = false;
|
|
78
|
+
const data = await loadEventDetail(Astro.url, Astro.params.id, eventOptions);
|
|
79
|
+
Astro.response.status = data.status;
|
|
80
|
+
---
|
|
81
|
+
<Layout title={data.pageTitle} lang={data.lang}><EventDetail data={data} /></Layout>
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Adapt the `Layout` props to the site's layout; `data.pageTitle`, `data.description` and `data.lang` are always set (also on 404 and 502). `data.lang` is the language the texts are in (`fr` for `fr-CH`), and `data.dir` is `rtl` for Arabic and Hebrew: pass it too if the site may use those. Per-page options extend the shared ones: `loadEventBrowser(Astro.url, { ...eventOptions, views: ["list", "month"] })`. Keep `Astro.response.status = data.status`: 502 when the feed cannot be reached, 404 for an unknown event.
|
|
85
|
+
|
|
86
|
+
## Where facts come from
|
|
87
|
+
|
|
88
|
+
- Docs as Markdown: https://eventual.rsvp/llms.txt (every package's docs and changelog).
|
|
89
|
+
- Core developer guide: https://github.com/Vermeulen-Solutions/eventual-rsvp-core/blob/main/docs/developer-guide.md
|
|
90
|
+
- In an installed project, the types are the final word: `node_modules/@vermeulen.solutions/eventual/astro/events/index.ts` (loader options and data), and each component's `interface Props`.
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# Event pages: EventBrowser and EventDetail (Core 0.19+)
|
|
2
|
+
|
|
3
|
+
Two page bodies render inside the site's own layout. A loader fetches Core's feed and returns everything the page needs, including the HTTP status and the translated texts.
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
import EventBrowser from "@vermeulen.solutions/eventual/astro/EventBrowser.astro";
|
|
7
|
+
import EventDetail from "@vermeulen.solutions/eventual/astro/EventDetail.astro";
|
|
8
|
+
import { loadEventBrowser, loadEventDetail, eventContentId, occurrenceStart } from "@vermeulen.solutions/eventual/astro/events";
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Pages using them need `export const prerender = false` and should set `Astro.response.status = data.status` (502 when the feed cannot be reached, 404 for an unknown event). Use `data.pageTitle` and `data.description` for the head.
|
|
12
|
+
|
|
13
|
+
## Loader options (both loaders)
|
|
14
|
+
|
|
15
|
+
| Option | Default | Meaning |
|
|
16
|
+
| --- | --- | --- |
|
|
17
|
+
| `pluginId` | `eventual` | Installed plugin ID (`r_…` for a Registry install). |
|
|
18
|
+
| `origin` | the page's origin | EmDash site serving the feed, when the pages run on another host. |
|
|
19
|
+
| `locale` | `en` | Page texts (21 languages), date formats, first day of the week, and the content language asked from the feed. Arabic and Hebrew render right to left. |
|
|
20
|
+
| `contentLocale`, `strict` | language of `locale`, `false` | Feed content language; `strict: true` leaves out untranslated events instead of showing them with a language prefix. |
|
|
21
|
+
| `timeZone` | `UTC` | Zone for "this month" and "today". Events keep their own zones. |
|
|
22
|
+
| `basePath` | `/events` | Address of the events page; detail links are `<basePath>/<slug>`. Must match the page folder. |
|
|
23
|
+
| `linkTo` | `detail` | `cms` links to the entry's own public page when it has one. |
|
|
24
|
+
| `views`, `defaultView` | all seven, `list` | Offered views, in order: `list`, `timeline`, `cards`, `schedule`, `dates`, `month`, `locations`. |
|
|
25
|
+
| `view`, `month`, `category` | from the query string | Fix a value instead of reading `?view=`, `?month=YYYY-MM`, `?category=`. |
|
|
26
|
+
|
|
27
|
+
`loadEventDetail(Astro.url, Astro.params.id, options)` accepts an event slug or ID; pass it the same options as the events page (`basePath` sets its back link and `locale` its texts; `timeZone` matters little there, as event times use the event's own zone). It searches from today through one year by default; `?from=YYYY-MM-DD&through=YYYY-MM-DD` narrows it and picks the right date of a recurring event.
|
|
28
|
+
|
|
29
|
+
Pure variants for tests or the SSR dispatcher: `buildEventBrowserData(events, url, options)` and `buildEventDetailData(events, id, url, options)` (pass `null` as `events` for a failed feed).
|
|
30
|
+
|
|
31
|
+
## Languages
|
|
32
|
+
|
|
33
|
+
`locale` takes any BCP 47 tag (`fr-CH`, `pt-BR`, `de-AT`). Dates and the first day of the week follow the full tag; texts use the closest of 21 shipped languages (English, French, German, Dutch, Spanish, Italian, Portuguese and Brazilian Portuguese, Polish, Czech, Swedish, Danish, Norwegian, Finnish, Japanese, Chinese, Korean, Turkish, Ukrainian, Arabic, Hebrew), else English. `data.lang` and `data.dir` give the language and direction actually used: put them on `<html>`. Registrations' and Tickets' components take the same tags in their `locale` prop.
|
|
34
|
+
|
|
35
|
+
## Component props
|
|
36
|
+
|
|
37
|
+
- `EventBrowser`: `data` (required), `headingLevel` (1, or 2 inside another page), `title`, `intro` (`false` for none), `id`, `showFilter`, `showViewSwitch`, `scheme`, `class`.
|
|
38
|
+
- `EventDetail`: `data` (required), `headingLevel`, `backHref` (`false` for none), `showSubscribe`, `jsonLd` (Event structured data, default on), `scheme`, `class`. Its default slot renders after the description: put `RsvpForm` or `TicketCheckout` there.
|
|
39
|
+
|
|
40
|
+
```astro
|
|
41
|
+
<EventDetail data={data}>
|
|
42
|
+
{data.event && <RsvpForm eventId={eventContentId(data.event)} occurrenceStart={occurrenceStart(data.event)} apiEndpoint={`${rsvpBase}/rsvp`} />}
|
|
43
|
+
</EventDetail>
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Theming
|
|
47
|
+
|
|
48
|
+
Styles live in the `eventual` cascade layer under `.eventual-browser` / `.eventual-detail`; every class starts with `eventual-`. Unlayered site CSS always wins; with Tailwind 4 declare `@layer theme, base, eventual, components, utilities;`. Neutral colours follow the text colour, so the pages suit any background; the components have no font of their own.
|
|
49
|
+
|
|
50
|
+
Put the theme in the site's global stylesheet (imported by the layout), on `:root`. If the layout can't be changed, import the stylesheet in each event page's frontmatter instead. If you can't tell how the site switches dark mode (see below), ask.
|
|
51
|
+
|
|
52
|
+
```css
|
|
53
|
+
:root {
|
|
54
|
+
--eventual-primary: light-dark(#9d174d, #f9a8d4); /* accent: selected view, buttons, date tiles, icons */
|
|
55
|
+
--eventual-on-primary: light-dark(#ffffff, #500724); /* text on the accent */
|
|
56
|
+
--eventual-radius: 1.5rem; /* cards */
|
|
57
|
+
--eventual-control-radius: 1rem; /* buttons, fields */
|
|
58
|
+
}
|
|
59
|
+
.eventual-card { box-shadow: 0 0.5rem 1.5rem rgb(0 0 0 / 0.08); } /* own rules win */
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Defaults: accent `light-dark(#075985, #7dd3fc)` with `light-dark(#ffffff, #082f49)` on it; focus ring = the accent. For a brand colour, give the dark value a light tint of the brand (4.5:1 against the dark page) and a dark text colour on it, as above. Other properties: `--eventual-text-muted`, `--eventual-border`, `--eventual-surface`, `--eventual-cancelled`, `--eventual-changed`, `--eventual-error`, `--eventual-focus`, `--eventual-gap`.
|
|
63
|
+
|
|
64
|
+
**Dark mode follows the CSS `color-scheme` property**, not the operating system directly. Match how the site does dark mode:
|
|
65
|
+
|
|
66
|
+
- System setting: `:root { color-scheme: light dark; }` plus the site's own dark colours in `@media (prefers-color-scheme: dark)`.
|
|
67
|
+
- A class or attribute toggle: `[data-theme="dark"] { color-scheme: dark; }` (and `light` for the light theme). Don't add `light dark` on `:root` then, or a light page can get dark accents on a dark-mode computer.
|
|
68
|
+
- Light-only site: set nothing.
|
|
69
|
+
- One dark section on a light page: pass `scheme="dark"` to the component.
|
|
70
|
+
|
|
71
|
+
Wrapper classes for scoping: `.eventual-browser`, `.eventual-detail` (Core), `.eventual-rsvp-widget`, `.eventual-manage` (Registrations, which reads the same `--eventual-*` properties), `.eventual-tickets-widget` (Tickets, which reads `--et-*`: `--et-primary`, `--et-on-primary`, `--et-bg`, `--et-field-bg`, `--et-border`, `--et-text`, `--et-muted`, …).
|
|
72
|
+
|
|
73
|
+
## Other helpers
|
|
74
|
+
|
|
75
|
+
- `EventList.astro` (`@vermeulen.solutions/eventual/astro/EventList.astro`): a simple list for a sidebar or home page (`events`, `basePath`, `heading`, `locale`, `emptyMessage`, `showCalendarLinks`).
|
|
76
|
+
- `fetchPublicFeed(origin, from, through, category, { pluginId, locale, strict, publicUrls })` from `@vermeulen.solutions/eventual/astro`: the raw feed. Each event has `calendarLinks` (Google, Outlook, Office 365, `.ics`) built for the installed plugin.
|
|
77
|
+
- `eventToJsonLd` and `serializeJsonLd` for structured data (always use the serializer; it escapes for `<script>`).
|
|
78
|
+
- Calendar subscription for visitors: `webcal://<host>/_emdash/api/plugins/<pluginId>/calendar` (`EventBrowser` shows this link).
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# Registrations and Tickets on the site
|
|
2
|
+
|
|
3
|
+
Both add-ons need Core and its event collection with the shared capacity fields (see [setup](setup.md#collections)), plus their npm packages for the components (also on a Registry install). Their forms read the event by its content ID and the date's start: on Core's event page use `eventContentId(data.event)` and `occurrenceStart(data.event)`. Paths are built from each add-on's plugin ID ([setup](setup.md#plugin-ids)).
|
|
4
|
+
|
|
5
|
+
## Registrations (`@vermeulen.solutions/eventual-attendance`)
|
|
6
|
+
|
|
7
|
+
### Event page with the form
|
|
8
|
+
|
|
9
|
+
The form shows on events whose **Registrations** panel is turned on. Ask the form route first so other events get no form:
|
|
10
|
+
|
|
11
|
+
```astro
|
|
12
|
+
---
|
|
13
|
+
// src/pages/events/[id].astro
|
|
14
|
+
import EventDetail from "@vermeulen.solutions/eventual/astro/EventDetail.astro";
|
|
15
|
+
import RsvpForm from "@vermeulen.solutions/eventual-attendance/astro/RsvpForm.astro";
|
|
16
|
+
import { eventContentId, loadEventDetail, occurrenceStart } from "@vermeulen.solutions/eventual/astro/events";
|
|
17
|
+
import Layout from "../../layouts/Layout.astro";
|
|
18
|
+
import { eventOptions, LOCALE, rsvpBase } from "../../lib/eventual";
|
|
19
|
+
|
|
20
|
+
export const prerender = false;
|
|
21
|
+
const data = await loadEventDetail(Astro.url, Astro.params.id, eventOptions);
|
|
22
|
+
Astro.response.status = data.status;
|
|
23
|
+
|
|
24
|
+
const eventId = data.event ? eventContentId(data.event) : "";
|
|
25
|
+
const start = data.event ? occurrenceStart(data.event) : "";
|
|
26
|
+
let rsvpOpen = false;
|
|
27
|
+
if (eventId) {
|
|
28
|
+
try {
|
|
29
|
+
const url = new URL(`${rsvpBase}/rsvp/form?eventId=${encodeURIComponent(eventId)}&occurrence=${encodeURIComponent(start)}`, Astro.url);
|
|
30
|
+
const res = await fetch(url, { signal: AbortSignal.timeout(5000) });
|
|
31
|
+
const body = res.ok ? await res.json() : null;
|
|
32
|
+
rsvpOpen = Boolean(body?.success && body.data?.ok && body.data.open);
|
|
33
|
+
} catch {
|
|
34
|
+
rsvpOpen = false;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
---
|
|
38
|
+
<Layout title={data.pageTitle} lang={data.lang}>
|
|
39
|
+
<EventDetail data={data}>
|
|
40
|
+
{rsvpOpen && <RsvpForm eventId={eventId} occurrenceStart={start} apiEndpoint={`${rsvpBase}/rsvp`} locale={LOCALE} />}
|
|
41
|
+
</EventDetail>
|
|
42
|
+
</Layout>
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
The route `GET <rsvpBase>/rsvp/form?eventId=…[&occurrence=…][&collection=…]` answers `{ success, data }`. `data.ok` is false when the event is unknown or sells tickets instead (`error`: `EVENT_NOT_FOUND`, `EVENT_TICKETED`). `data.open` says whether registrations are on for the event. A full event stays `open`: the form itself shows "full" or the waiting list (`data.full`, `data.seatsLeft`, `data.allowWaitlist`). The check is one extra request per event page; the form makes the same request in the browser. When the pages run on the EmDash site itself, you can skip the HTTP round trip with EmDash's dispatcher: `const result = await Astro.locals.emdash.handlePublicPluginApiRoute(RSVP_ID, "GET", "/rsvp/form", new Request(url));` then read `result.success` and `result.data` the same way.
|
|
46
|
+
|
|
47
|
+
`RsvpForm` props: `eventId`, `occurrenceStart`, `apiEndpoint` (default `/_emdash/api/plugins/eventual-attendance/rsvp`, the npm-install path: always pass `<rsvpBase>/rsvp` on a Registry install), `formEndpoint` (default `${apiEndpoint}/form`), `collection` (events outside the default collection), `locale` (any BCP 47 tag; emails for the booking use its language), `allowWaitlist`, `maxQuantity`, `title`, `nameLabel`, `emailLabel`. It needs client JavaScript and fires a bubbling `eventual:availability` event with `{ full, seatsLeft, allowWaitlist }`.
|
|
48
|
+
|
|
49
|
+
### Manage page (required)
|
|
50
|
+
|
|
51
|
+
Cancellation and waiting-list emails link here. Default path `/rsvp/manage`; it can be changed under **Site setup** on the Registrations settings page (keep page and setting the same). Ask the user if the site's language suggests another path.
|
|
52
|
+
|
|
53
|
+
```astro
|
|
54
|
+
---
|
|
55
|
+
// src/pages/rsvp/manage.astro
|
|
56
|
+
import RsvpManage from "@vermeulen.solutions/eventual-attendance/astro/RsvpManage.astro";
|
|
57
|
+
import Layout from "../../layouts/Layout.astro";
|
|
58
|
+
import { LOCALE, rsvpBase } from "../../lib/eventual";
|
|
59
|
+
---
|
|
60
|
+
<Layout title="…" lang={LOCALE.split("-")[0]}><RsvpManage apiBase={rsvpBase} locale={LOCALE} /></Layout>
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
`RsvpManage` props: `apiBase`, `locale`, `class`. It renders its own heading and works on a static page (the token is in the link's `#fragment`). Nothing changes until the visitor presses a button, so email link scanners cannot cancel bookings.
|
|
64
|
+
|
|
65
|
+
Spam protection (optional): Cloudflare Turnstile keys on the settings page. A site with a Content Security Policy must then allow `https://challenges.cloudflare.com` in `script-src` and `frame-src`.
|
|
66
|
+
|
|
67
|
+
## Tickets (`@vermeulen.solutions/eventual-tickets`)
|
|
68
|
+
|
|
69
|
+
Commercial licence (yearly per site; `localhost`, `*.workers.dev` and `*.pages.dev` need none). Free tickets and pay-by-invoice work without Stripe. Card payments need `EMDASH_ENCRYPTION_KEY` (`npx emdash secrets generate`) and the Stripe secret key and webhook signing secret pasted on the **Tickets** admin page, which also shows the webhook address.
|
|
70
|
+
|
|
71
|
+
| Page | Component (`@vermeulen.solutions/eventual-tickets/astro/…`) | Props |
|
|
72
|
+
| --- | --- | --- |
|
|
73
|
+
| Event page, inside `EventDetail` | `TicketCheckout.astro` | `eventId`, `occurrenceStart`, `apiBase`, `title`, `locale`, `class` |
|
|
74
|
+
| `/tickets/checkout` (return from Stripe; path set on the Tickets page) | `TicketCheckoutReturn.astro` | `apiBase`, `backHref` (default `/`), `locale`, `class` |
|
|
75
|
+
| `/tickets/order` (linked from ticket emails) | `TicketOrder.astro` | `apiBase`, `checkinPath` (default `/tickets/check`), `locale`, `class` |
|
|
76
|
+
| `/tickets/check` (door staff, signed in to EmDash) | `TicketCheckin.astro` | `apiBase`, `eventId`, `occurrenceStart`, `locale`, `class` |
|
|
77
|
+
|
|
78
|
+
`apiBase` is `/_emdash/api/plugins/<ticketsId>`. To show the checkout only for events on sale, ask `GET <apiBase>/availability?eventId=<contentId>&occurrence=<occurrenceStart>` the same way as above and render when `body.data.ok` is true. An event uses either Registrations or Tickets, not both.
|
|
79
|
+
|
|
80
|
+
When invoice payment is chosen, the checkout button reads "Reserve my places" instead of "Continue to payment".
|
|
81
|
+
|
|
82
|
+
Theme Tickets with `--et-*` properties (`--et-primary`, `--et-on-primary`, `--et-bg`, `--et-field-bg`, `--et-border`, `--et-text`, `--et-muted`, …), not `--eventual-*`.
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# Setup: install, collections, plugin IDs
|
|
2
|
+
|
|
3
|
+
Requires EmDash `>=1.2.0 <2.0.0` (1.4.0 or newer recommended) and Node 24+ for the command-line tools.
|
|
4
|
+
|
|
5
|
+
## Install (choose one route per plugin)
|
|
6
|
+
|
|
7
|
+
**From the EmDash Registry** (most sites): Admin → Plugins → Registry, search "Eventual RSVP" (publisher vermeulen.solutions), review the permissions, install. The site still needs the npm package for the Astro components and helpers:
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
npm install @vermeulen.solutions/eventual
|
|
11
|
+
# with Registrations / Tickets:
|
|
12
|
+
npm install @vermeulen.solutions/eventual-attendance @vermeulen.solutions/eventual-tickets
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
**From npm in the config** (the plugin runs in the site's own sandbox):
|
|
16
|
+
|
|
17
|
+
```js
|
|
18
|
+
// astro.config.mjs
|
|
19
|
+
import { defineConfig } from "astro/config";
|
|
20
|
+
import emdash from "emdash/astro";
|
|
21
|
+
import eventual from "@vermeulen.solutions/eventual";
|
|
22
|
+
import eventualAttendance from "@vermeulen.solutions/eventual-attendance";
|
|
23
|
+
import eventualTickets from "@vermeulen.solutions/eventual-tickets";
|
|
24
|
+
|
|
25
|
+
export default defineConfig({
|
|
26
|
+
integrations: [
|
|
27
|
+
emdash({
|
|
28
|
+
// …the site's existing EmDash options…
|
|
29
|
+
sandboxed: [eventual, eventualAttendance, eventualTickets],
|
|
30
|
+
sandboxRunner: "@emdash-cms/cloudflare/sandbox", // on Node: "@emdash-cms/sandbox-workerd/sandbox"
|
|
31
|
+
}),
|
|
32
|
+
],
|
|
33
|
+
});
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Never both routes for the same plugin.
|
|
37
|
+
|
|
38
|
+
## Collections
|
|
39
|
+
|
|
40
|
+
Core reads events, venues and organizers from EmDash collections the site owns. It cannot create them (read-only schema permission). Export the blueprint, apply it, then select the collections in **Event settings**:
|
|
41
|
+
|
|
42
|
+
```sh
|
|
43
|
+
npx -p @vermeulen.solutions/eventual eventual-schema --locale en --output eventual-schema.json
|
|
44
|
+
# With Registrations or Tickets, add the shared capacity fields:
|
|
45
|
+
npx -p @vermeulen.solutions/eventual-capacity eventual-capacity-fields --merge eventual-schema.json --output eventual-schema-with-capacity.json
|
|
46
|
+
# New local SQLite site:
|
|
47
|
+
npx emdash seed eventual-schema-with-capacity.json --validate
|
|
48
|
+
npx emdash seed eventual-schema-with-capacity.json --database ./data.db --no-content --on-conflict error
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Options: `--timezone Europe/London` (default for new events; otherwise the computer's), `--event-collection activities`, `--reuse-venues`, `--reuse-organizers`. Use a locale the site already has. The exporter refuses to overwrite a file. For a populated or remote (D1) site, apply reviewed additive changes through the site's schema workflow instead of reseeding.
|
|
52
|
+
|
|
53
|
+
Leave **Show old events saved inside the plugin** off unless migrating data from before Core 0.14.
|
|
54
|
+
|
|
55
|
+
## Plugin IDs
|
|
56
|
+
|
|
57
|
+
| Install route | Core | Registrations | Tickets |
|
|
58
|
+
| --- | --- | --- | --- |
|
|
59
|
+
| EmDash Registry | `r_hxn32uyal53iahxf` | `r_lywzrupdtpjvkohn` | `r_qd5hk435vo2yqk2n` |
|
|
60
|
+
| npm, in `astro.config.mjs` | `eventual` | `eventual-attendance` | `eventual-tickets` |
|
|
61
|
+
|
|
62
|
+
EmDash derives a Registry ID from the publisher and the plugin's name, so these are the same on every site and never change. If the site's admin shows another ID, the admin is right: use its value and tell the user. If unsure which route a site uses, the admin shows the ID: Core's **Eventual RSVP** page address (`/_emdash/admin/plugins/<id>/events`) and its **Subscribe** links; Registrations' settings page under **Site setup**; the **Tickets** admin page.
|
|
63
|
+
|
|
64
|
+
Where the IDs go:
|
|
65
|
+
|
|
66
|
+
| Plugin | Use |
|
|
67
|
+
| --- | --- |
|
|
68
|
+
| Core | `pluginId` option of `loadEventBrowser`, `loadEventDetail`, `fetchPublicFeed`; routes `/_emdash/api/plugins/<id>/publicEvents`, `/calendar`, `/publicEventImage` |
|
|
69
|
+
| Registrations | `RsvpForm apiEndpoint="/_emdash/api/plugins/<id>/rsvp"`, `RsvpManage apiBase="/_emdash/api/plugins/<id>"` |
|
|
70
|
+
| Tickets | `apiBase="/_emdash/api/plugins/<id>"` on every Tickets component |
|
|
71
|
+
|
|
72
|
+
Keep the IDs in one module and build the paths from them:
|
|
73
|
+
|
|
74
|
+
```ts
|
|
75
|
+
// src/lib/eventual.ts
|
|
76
|
+
export const CORE_ID = "r_hxn32uyal53iahxf";
|
|
77
|
+
export const RSVP_ID = "r_lywzrupdtpjvkohn";
|
|
78
|
+
export const TICKETS_ID = "r_qd5hk435vo2yqk2n";
|
|
79
|
+
export const rsvpBase = `/_emdash/api/plugins/${RSVP_ID}`;
|
|
80
|
+
export const ticketsBase = `/_emdash/api/plugins/${TICKETS_ID}`;
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Constants are enough: the IDs only change if the site switches install route. If the user wants them configurable, use Astro's `astro:env` (`envField` in `astro.config.mjs`, read from `astro:env/server`), not `import.meta.env`, whose private values are usually fixed when the site is built; and fall back with `||`, since an empty variable is `""`.
|
|
84
|
+
|
|
85
|
+
## Agent tools
|
|
86
|
+
|
|
87
|
+
Core has MCP tools for managing events (`<pluginId>__<tool>`). They are off after install: Admin → **Plugins**, expand the plugin, switch on **Agent access**. `updateSettings` requires `defaultTimezone` in every call.
|
|
88
|
+
|
|
89
|
+
## Moving to the Registry
|
|
90
|
+
|
|
91
|
+
A Registry install has a new ID and starts empty; data stored under the old ID stays in the database but the new install cannot read it. Events, venues and organizers (EmDash content) are not affected. What stays behind:
|
|
92
|
+
|
|
93
|
+
- **Core:** settings (select the collections and default time zone again); the calendar subscription address changes (update links, tell subscribers, or redirect the old address); update counters restart; events stored inside the plugin from before 0.13 (migrate them first).
|
|
94
|
+
- **Registrations:** registrations, places taken, reminders, settings and the signing key for manage links. Move when no event has open registrations or upcoming bookings.
|
|
95
|
+
- **Tickets:** orders, tickets sold and check-ins (buyers' QR codes stop working and their places free up, so events can be oversold), ticket types and prices, settings including Stripe keys, and the licence key (paste the licence code again). The Stripe webhook address contains the plugin ID: point Stripe at the new address the **Tickets** page shows. Move when nothing is on sale.
|
|
96
|
+
|
|
97
|
+
Point the user to the docs before they move: https://eventual.rsvp/docs/
|