@vermeulen.solutions/eventual 0.18.2 → 0.18.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 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://github.com/Vermeulen-Solutions/eventual-rsvp-core/releases"><img src="https://img.shields.io/github/v/release/Vermeulen-Solutions/eventual-rsvp-core?color=176b57&label=GitHub%20download" alt="Latest GitHub source download" /></a>
10
- <a href="https://plugins.emdashcms.com/plugins/@vermeulen.solutions/eventual"><img src="https://img.shields.io/badge/EmDash_Registry-0.18.2-0b4d3d" alt="EmDash Plugin Registry" /></a>
10
+ <a href="https://plugins.emdashcms.com/plugins/@vermeulen.solutions/eventual"><img src="https://img.shields.io/badge/EmDash_Registry-0.18.3-0b4d3d" alt="EmDash Plugin Registry" /></a>
11
11
  <a href="https://emdashcms.com"><img src="https://img.shields.io/badge/EmDash-1.2.x%20%7C%201.4.x-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" />
@@ -43,7 +43,7 @@ In 0.14.x, old events stored inside the plugin are shown only when an administra
43
43
  For the opt-in HTML cache integration, see [public feed caching](./docs/public-feed-caching.md)
44
44
  and [release notes](./docs/release-notes-0.15.0.md). Eventual RSVP does not enable site caching.
45
45
 
46
- Requires **EmDash >=1.2.0 <2.0.0**; tested on 1.2.0 and 1.4.0. **1.4.0 is recommended** because it fixes nested Block Kit forms and Cloudflare plugin mutations; 1.2/1.3 remain supported with those host limitations. Upgrades from 0.12.x or earlier need the [native-content upgrade](./docs/upgrade-0.13.0.md). Source/developer tooling needs Node 24+.
46
+ Requires **EmDash >=1.2.0 <2.0.0**; tested on 1.2.0, 1.4.0 and 1.5.0. **1.4.0 or newer is recommended** because it fixes nested Block Kit forms and Cloudflare plugin mutations; 1.2/1.3 remain supported with those host limitations. Newer EmDash releases that have not been tested yet are not refused: the source installer prints a warning, and if the editor adapters no longer match a newer admin build they step aside and EmDash's own editor is used. Upgrades from 0.12.x or earlier need the [native-content upgrade](./docs/upgrade-0.13.0.md). Source/developer tooling needs Node 24+.
47
47
 
48
48
  ---
49
49
 
@@ -1,197 +1,222 @@
1
- /**
2
- * Legacy source-install transform for `@vermeulen.solutions/eventual/install`. Registry installs
3
- * never execute this file; the host renders plugin panels directly.
4
- *
5
- * Blocks 1.2-1.3 render a form block as <form> inside the content editor's
6
- * <form>. Blocks 1.4+ render a div[role="group"] with its own Enter handling.
7
- * This patches both shapes plus Eventual-specific form state and date-label
8
- * behaviour that the host renderer does not provide.
9
- */
10
- import { fileURLToPath } from "node:url";
11
- const presentationModule = fileURLToPath(new URL("./editor-i18n.mjs",import.meta.url)).replaceAll("\\","/");
12
- export function patchEmbeddedBlockForms(source) {
13
- const marker = "function FormBlockComponent({ block, onAction }) {";
14
- const start = source.indexOf(marker);
15
- if (start < 0)
16
- throw new Error(
17
- "Unsupported EmDash Block Kit renderer: FormBlockComponent changed.",
18
- );
19
- const end = source.indexOf("\n//#endregion", start);
20
- if (end < 0) throw new Error("Unsupported EmDash Block Kit form boundary.");
21
- let component = source.slice(start, end);
22
- const initializer =
23
- "const [values, setValues] = useState(() => getInitialValues(block.fields));";
24
- if (!component.includes(initializer))
25
- throw new Error("Unsupported EmDash Block Kit form state initializer.");
26
- component = component.replace(
27
- initializer,
28
- initializer +
29
- "\n useEffect(() => setValues(getInitialValues(block.fields)), [block.fields]);",
30
- );
31
- const legacyForm =
32
- component.includes('jsxs("form", {') &&
33
- component.includes("onSubmit: handleSubmit,") &&
34
- component.includes('type: "submit",') &&
35
- component.includes("e.preventDefault();");
36
- const modernForm =
37
- !component.includes('jsxs("form", {') &&
38
- component.includes('role: "group"') &&
39
- component.includes('type: "button"') &&
40
- component.includes("onClick: handleClick");
41
- if (!legacyForm && !modernForm)
42
- throw new Error("Unsupported EmDash Block Kit form renderer.");
43
- const fieldKey = "}, field.action_id);";
44
- if (!component.includes(fieldKey))
45
- throw new Error("Unsupported EmDash Block Kit form field key.");
46
- component = component.replace(
47
- fieldKey,
48
- '}, field.action_id + JSON.stringify(field.initial_value));',
49
- );
50
- if (legacyForm) {
51
- for (const needle of [
52
- "e.preventDefault();",
53
- 'jsxs("form", {',
54
- "onSubmit: handleSubmit,",
55
- 'type: "submit",',
56
- ]) {
57
- if (!component.includes(needle))
58
- throw new Error("Unsupported EmDash Block Kit form: " + needle);
59
- }
60
- component = component.replace(
61
- "e.preventDefault();",
62
- `e.preventDefault();
63
- e.stopPropagation();
64
- const root=e.currentTarget.closest('[data-eventual-block-form]');
65
- const invalid=root?.querySelector(':invalid');
66
- if (invalid) { invalid.reportValidity?.(); return; }`,
67
- );
68
- component = component
69
- .replace('jsxs("form", {', 'jsxs("div", {')
70
- .replace(
71
- "onSubmit: handleSubmit,",
72
- `role: "group",
73
- "data-eventual-block-form": "",
74
- onKeyDown: (event) => {
75
- if (event.key === "Enter" && !event.defaultPrevented && !event.isComposing && event.target.tagName !== "TEXTAREA" && event.target.tagName !== "BUTTON" && event.target.getAttribute("role") !== "combobox") handleSubmit(event);
76
- },`,
77
- )
78
- .replace('type: "submit",', 'type: "button", onClick: handleSubmit,');
79
- }
80
- let patched = source.slice(0, start) + component + source.slice(end);
81
- // The 1.2/1.3 renderer omits the option key, producing warnings on every
82
- // venue choice. Use its stable value, including the empty "no venue" option.
83
- const optionKey = "children: item.label\n\t\t})";
84
- if (patched.includes(optionKey))
85
- patched = patched.replace(
86
- optionKey,
87
- "children: item.label\n\t\t}, item.value)",
88
- );
89
- const dateMarker =
90
- "function DateInputElementComponent({ element, onAction, onChange }) {";
91
- const dateStart = patched.indexOf(dateMarker),
92
- dateEnd = patched.indexOf("\n//#endregion", dateStart);
93
- if (dateStart < 0 || dateEnd < 0)
94
- throw new Error("Unsupported Block Kit date input.");
95
- const date = patched.slice(dateStart, dateEnd);
96
- if (!date.includes('jsx("label", {') || !date.includes('type: "date",'))
97
- throw new Error("Unsupported Block Kit date label.");
98
- patched =
99
- patched.slice(0, dateStart) +
100
- date
101
- .replace(dateMarker, dateMarker + "\n const eventualDateId=useId();")
102
- .replace('jsx("label", {', 'jsx("label", { htmlFor:eventualDateId,')
103
- .replace('type: "date",', 'type: "date", id:eventualDateId,') +
104
- patched.slice(dateEnd);
105
- return addUseIdImport(patched);
106
- }
107
-
108
- function addUseIdImport(source) {
109
- const reactImport = /import \{([^}]+)\} from "react";/;
110
- const match = source.match(reactImport);
111
- if (!match) throw new Error("Unsupported Block Kit React import.");
112
- const names = match[1].split(",").map((name) => name.trim());
113
- if (names.includes("useId")) return source;
114
- names.push("useId");
115
- return source.replace(
116
- reactImport,
117
- `import { ${names.join(", ")} } from "react";`,
118
- );
119
- }
120
- export function eventualEditorCompatibility() {
121
- let command = "serve";
122
- return {
123
- name: "eventual-embedded-block-forms-1.0.1",
124
- enforce: "pre",
125
- config(_config, env = { command: "serve" }) {
126
- command = env.command ?? "serve";
127
- // Keep core's admin prebundle (including its CommonJS dependencies) and
128
- // apply presentation before optimization in dev. Production builds use
129
- // the regular transform below; applying both duplicates the admin module.
130
- return { optimizeDeps: { exclude: ["@emdash-cms/blocks"], rolldownOptions: {plugins:[{name:"eventual-admin-presentation-1.0.1", transform(source,id) {
131
- if (command !== "serve") return null;
132
- if (id.replaceAll("\\", "/").endsWith("/@emdash-cms/admin/dist/index.js")) return {code:patchEventualPresentation(source),map:null};
133
- return null;
134
- }}]} } };
135
- },
136
- transform(source, id) {
137
- const path = id.replaceAll("\\", "/").split("?")[0];
138
- if (path.endsWith("/@emdash-cms/admin/dist/index.js"))
139
- return command === "serve"
140
- ? null
141
- : { code: patchEventualPresentation(source), map: null };
142
- if (
143
- !id
144
- .replaceAll("\\", "/")
145
- .split("?")[0]
146
- .endsWith("/@emdash-cms/blocks/dist/index.js")
147
- )
148
- return null;
149
- return { code: patchEmbeddedBlockForms(source), map: null };
150
- },
151
- };
152
- }
153
-
154
- /** Presentation adapter for the tested admin build. RPC and receipts stay untouched. */
155
- export function patchEventualPresentation(source) {
156
- const original = 'import { BlockRenderer, isSafePluginPagePath, normalizePluginPagePath } from "@emdash-cms/blocks";';
157
- const panel = 'function SandboxedContentEditorPanel({ pluginId, panelId, title, collection, entryId, locale, versionToken, draftAccess, captureDraft, onDraftResponse, onEntryRefresh, reserveHeaderEnd = false }) {';
158
- const fieldLabel = 'return field?.label || slug.charAt(0).toUpperCase() + slug.slice(1);';
159
- const preview = 'function EditorDraftPatchPreview({ operations, fields, currentValues, onApply, onClose }) {';
160
- const editPage = 'function ContentEditPage() {';
161
- if (!source.includes(original) || !source.includes(panel) || !source.includes(fieldLabel) || !source.includes(editPage)) throw new Error("Unsupported EmDash admin presentation adapter. Use the tested compatibility matrix.");
162
- let patched=source.replace(original, original.replace("{ BlockRenderer,", "{ BlockRenderer as EventualOriginalBlockRenderer,") + `
163
- import { localizeEventualBlocks, draftSummary as eventualDraftSummary, editorText as eventualEditorText, loadEditorCatalog as eventualLoadCatalog, onEditorCatalog as eventualOnCatalog } from ${JSON.stringify(presentationModule)};
164
- function BlockRenderer(props) {
165
- const {locale}=useLocale();
166
- const [eventualCatalogTick,eventualSetCatalogTick]=React$1.useState(0);
167
- React$1.useEffect(()=>{ const off=eventualOnCatalog(()=>eventualSetCatalogTick(n=>n+1)); eventualLoadCatalog(locale); return off; },[locale]);
168
- const blocks=React$1.useMemo(()=>localizeEventualBlocks(props.blocks, locale), [props.blocks,locale,eventualCatalogTick]);
169
- return jsx(EventualOriginalBlockRenderer, {...props,blocks});
170
- }`)
171
- .replace(panel, panel + '\n const {locale: eventualUiLocale}=useLocale();\n if(pluginId === "eventual") title=eventualEditorText(title,eventualUiLocale);')
172
- .replace(fieldLabel, 'const label=field?.label || slug.charAt(0).toUpperCase() + slug.slice(1); return field?.options?.eventualEditor ? eventualEditorText(label,i18n.locale) : label;')
173
- // ContentEditPage's local i18n is the content configuration, not Lingui.
174
- .replace(editPage,editPage+'\n const {locale:eventualPageUiLocale}=useLocale();')
175
- .replace('description: error instanceof Error ? error.message : _t4({', 'description: error instanceof Error ? (collectionFields.start?.options?.eventualEditor ? eventualEditorText(error.message,eventualPageUiLocale) : error.message) : _t4({')
176
- .replace(preview, preview + '\n const {locale: eventualPreviewLocale}=useLocale(); const eventualPreview=fields.start?.options?.eventualEditor===true;')
177
- .replace('function EditorDraftPatchPreview({ operations, fields, currentValues, onApply, onClose }) {\n const {locale: eventualPreviewLocale}=useLocale(); const eventualPreview=fields.start?.options?.eventualEditor===true;\n\tconst { _: _t } = useLingui();', preview + '\n const {locale: eventualPreviewLocale}=useLocale(); const eventualPreview=fields.start?.options?.eventualEditor===true;\n const {_: eventualOriginalT}=useLingui(); const _t=eventualPreview ? message=>eventualEditorText(eventualOriginalT(message), eventualPreviewLocale):eventualOriginalT;')
178
- .replace('children: fields[operation.field]?.label ?? operation.field', 'children: eventualPreview ? eventualEditorText(fields[operation.field]?.label ?? operation.field,eventualPreviewLocale) : fields[operation.field]?.label ?? operation.field')
179
- .replace('children: summarize(currentValues[operation.field])', 'children: eventualPreview ? eventualDraftSummary(operation.field,currentValues[operation.field],eventualPreviewLocale,currentValues.timezone) : summarize(currentValues[operation.field])')
180
- .replace('children: summarize(operation.op === "clear" ? null : operation.value)', 'children: eventualPreview ? eventualDraftSummary(operation.field,operation.op === "clear" ? null : operation.value,eventualPreviewLocale,currentValues.timezone) : summarize(operation.op === "clear" ? null : operation.value)');
181
- const editorStart=patched.indexOf('function ContentEditor({'), editorEnd=patched.indexOf('\n//#endregion',editorStart);
182
- if(editorStart<0 || editorEnd<0) throw new Error("Unsupported content editor boundary.");
183
- const editor=patched.slice(editorStart,editorEnd).replaceAll('jsx(PublishActions, {','jsx(PublishActions, { eventualUi:Object.values(fields).some(field=>field.options?.eventualEditor===true),').replaceAll('jsx(SettingsActionBar, {','jsx(SettingsActionBar, { eventualUi:Object.values(fields).some(field=>field.options?.eventualEditor===true),');
184
- patched=patched.slice(0,editorStart)+editor+patched.slice(editorEnd);
185
- // Admin 1.2/1.3 use SettingsActionBar; 1.4 removed it. Patch it only when present.
186
- const barStart=patched.indexOf('function SettingsActionBar({');
187
- if(barStart>=0){
188
- const barEnd=patched.indexOf('\nfunction ',barStart+1);
189
- if(barEnd<0) throw new Error("Unsupported settings action bar boundary.");
190
- patched=patched.slice(0,barStart)+patched.slice(barStart,barEnd).replace('jsx(PublishActions, {','jsx(PublishActions, { eventualUi,')+patched.slice(barEnd);
191
- patched=patched.replace('function SettingsActionBar({ collectionLabel,','function SettingsActionBar({ eventualUi=false, collectionLabel,');
192
- if(!patched.includes('function SettingsActionBar({ eventualUi=false, collectionLabel,')) throw new Error("Unsupported settings action bar signature.");
193
- }
194
- const publishPattern=/function PublishActions\(\{ collectionLabel, (isNew, isLive, hasPendingChanges, publishingState, isPending, disabled, onPublish, onUnpublish, onMenuOpenChange, size, (?:fullWidth|compact)) \}\) \{\n\tconst \{ _: _t4 \} = useLingui\(\);/;
195
- if(!publishPattern.test(patched)) throw new Error("Unsupported publish actions signature.");
196
- return patched.replace(publishPattern, (_match, props) => `function PublishActions({ eventualUi=false, collectionLabel, ${props} }) {\n const {locale: eventualPublishLocale}=useLocale(); const {_:eventualPublishT}=useLingui(); const _t4=eventualUi ? message=>eventualEditorText(eventualPublishT(message),eventualPublishLocale):eventualPublishT;`);
197
- }
1
+ /**
2
+ * Legacy source-install transform for `@vermeulen.solutions/eventual/install`. Registry installs
3
+ * never execute this file; the host renders plugin panels directly.
4
+ *
5
+ * Blocks 1.2-1.3 render a form block as <form> inside the content editor's
6
+ * <form>. Blocks 1.4+ render a div[role="group"] with its own Enter handling.
7
+ * This patches both shapes plus Eventual-specific form state and date-label
8
+ * behaviour that the host renderer does not provide.
9
+ */
10
+ import { fileURLToPath } from "node:url";
11
+ const warned = new Set();
12
+ export function warnOnce(message) {
13
+ if (warned.has(message)) return;
14
+ warned.add(message);
15
+ console.warn("[eventual] " + message);
16
+ }
17
+ const presentationModule = fileURLToPath(new URL("./editor-i18n.mjs",import.meta.url)).replaceAll("\\","/");
18
+ export function patchEmbeddedBlockForms(source) {
19
+ const marker = "function FormBlockComponent({ block, onAction }) {";
20
+ const start = source.indexOf(marker);
21
+ if (start < 0)
22
+ throw new Error(
23
+ "Unsupported EmDash Block Kit renderer: FormBlockComponent changed.",
24
+ );
25
+ const end = source.indexOf("\n//#endregion", start);
26
+ if (end < 0) throw new Error("Unsupported EmDash Block Kit form boundary.");
27
+ let component = source.slice(start, end);
28
+ const initializer =
29
+ "const [values, setValues] = useState(() => getInitialValues(block.fields));";
30
+ if (!component.includes(initializer))
31
+ throw new Error("Unsupported EmDash Block Kit form state initializer.");
32
+ component = component.replace(
33
+ initializer,
34
+ initializer +
35
+ "\n useEffect(() => setValues(getInitialValues(block.fields)), [block.fields]);",
36
+ );
37
+ const legacyForm =
38
+ component.includes('jsxs("form", {') &&
39
+ component.includes("onSubmit: handleSubmit,") &&
40
+ component.includes('type: "submit",') &&
41
+ component.includes("e.preventDefault();");
42
+ const modernForm =
43
+ !component.includes('jsxs("form", {') &&
44
+ component.includes('role: "group"') &&
45
+ component.includes('type: "button"') &&
46
+ component.includes("onClick: handleClick");
47
+ if (!legacyForm && !modernForm)
48
+ throw new Error("Unsupported EmDash Block Kit form renderer.");
49
+ const fieldKey = "}, field.action_id);";
50
+ if (!component.includes(fieldKey))
51
+ throw new Error("Unsupported EmDash Block Kit form field key.");
52
+ component = component.replace(
53
+ fieldKey,
54
+ '}, field.action_id + JSON.stringify(field.initial_value));',
55
+ );
56
+ if (legacyForm) {
57
+ for (const needle of [
58
+ "e.preventDefault();",
59
+ 'jsxs("form", {',
60
+ "onSubmit: handleSubmit,",
61
+ 'type: "submit",',
62
+ ]) {
63
+ if (!component.includes(needle))
64
+ throw new Error("Unsupported EmDash Block Kit form: " + needle);
65
+ }
66
+ component = component.replace(
67
+ "e.preventDefault();",
68
+ `e.preventDefault();
69
+ e.stopPropagation();
70
+ const root=e.currentTarget.closest('[data-eventual-block-form]');
71
+ const invalid=root?.querySelector(':invalid');
72
+ if (invalid) { invalid.reportValidity?.(); return; }`,
73
+ );
74
+ component = component
75
+ .replace('jsxs("form", {', 'jsxs("div", {')
76
+ .replace(
77
+ "onSubmit: handleSubmit,",
78
+ `role: "group",
79
+ "data-eventual-block-form": "",
80
+ onKeyDown: (event) => {
81
+ if (event.key === "Enter" && !event.defaultPrevented && !event.isComposing && event.target.tagName !== "TEXTAREA" && event.target.tagName !== "BUTTON" && event.target.getAttribute("role") !== "combobox") handleSubmit(event);
82
+ },`,
83
+ )
84
+ .replace('type: "submit",', 'type: "button", onClick: handleSubmit,');
85
+ }
86
+ let patched = source.slice(0, start) + component + source.slice(end);
87
+ // The 1.2/1.3 renderer omits the option key, producing warnings on every
88
+ // venue choice. Use its stable value, including the empty "no venue" option.
89
+ const optionKey = "children: item.label\n\t\t})";
90
+ if (patched.includes(optionKey))
91
+ patched = patched.replace(
92
+ optionKey,
93
+ "children: item.label\n\t\t}, item.value)",
94
+ );
95
+ const dateMarker =
96
+ "function DateInputElementComponent({ element, onAction, onChange }) {";
97
+ const dateStart = patched.indexOf(dateMarker),
98
+ dateEnd = patched.indexOf("\n//#endregion", dateStart);
99
+ if (dateStart < 0 || dateEnd < 0)
100
+ throw new Error("Unsupported Block Kit date input.");
101
+ const date = patched.slice(dateStart, dateEnd);
102
+ if (!date.includes('jsx("label", {') || !date.includes('type: "date",'))
103
+ throw new Error("Unsupported Block Kit date label.");
104
+ patched =
105
+ patched.slice(0, dateStart) +
106
+ date
107
+ .replace(dateMarker, dateMarker + "\n const eventualDateId=useId();")
108
+ .replace('jsx("label", {', 'jsx("label", { htmlFor:eventualDateId,')
109
+ .replace('type: "date",', 'type: "date", id:eventualDateId,') +
110
+ patched.slice(dateEnd);
111
+ return addUseIdImport(patched);
112
+ }
113
+
114
+ function addUseIdImport(source) {
115
+ const reactImport = /import \{([^}]+)\} from "react";/;
116
+ const match = source.match(reactImport);
117
+ if (!match) throw new Error("Unsupported Block Kit React import.");
118
+ const names = match[1].split(",").map((name) => name.trim());
119
+ if (names.includes("useId")) return source;
120
+ names.push("useId");
121
+ return source.replace(
122
+ reactImport,
123
+ `import { ${names.join(", ")} } from "react";`,
124
+ );
125
+ }
126
+ /**
127
+ * Apply an adapter patch, or leave the host module untouched when its build is not one we recognise.
128
+ * A newer EmDash then shows stock editor behaviour (untranslated labels, host form handling) instead
129
+ * of failing the whole site build.
130
+ */
131
+ export function patchOrPassThrough(patch, source, what, warn = warnOnce) {
132
+ try { return { code: patch(source), map: null }; }
133
+ catch (error) {
134
+ warn(`${what} did not match this EmDash build (${error.message}); using the stock EmDash editor for it. Check the event editor and report the EmDash version.`);
135
+ return null;
136
+ }
137
+ }
138
+ export function eventualEditorCompatibility() {
139
+ let command = "serve";
140
+ return {
141
+ name: "eventual-embedded-block-forms-1.0.1",
142
+ enforce: "pre",
143
+ config(_config, env = { command: "serve" }) {
144
+ command = env.command ?? "serve";
145
+ // Keep core's admin prebundle (including its CommonJS dependencies) and
146
+ // apply presentation before optimization in dev. Production builds use
147
+ // the regular transform below; applying both duplicates the admin module.
148
+ return { optimizeDeps: { exclude: ["@emdash-cms/blocks"], rolldownOptions: {plugins:[{name:"eventual-admin-presentation-1.0.1", transform(source,id) {
149
+ if (command !== "serve") return null;
150
+ if (id.replaceAll("\\", "/").endsWith("/@emdash-cms/admin/dist/index.js")) return patchOrPassThrough(patchEventualPresentation, source, "Eventual's admin presentation adapter");
151
+ return null;
152
+ }}]} } };
153
+ },
154
+ transform(source, id) {
155
+ const path = id.replaceAll("\\", "/").split("?")[0];
156
+ if (path.endsWith("/@emdash-cms/admin/dist/index.js"))
157
+ return command === "serve"
158
+ ? null
159
+ : patchOrPassThrough(patchEventualPresentation, source, "Eventual's admin presentation adapter");
160
+ if (
161
+ !id
162
+ .replaceAll("\\", "/")
163
+ .split("?")[0]
164
+ .endsWith("/@emdash-cms/blocks/dist/index.js")
165
+ )
166
+ return null;
167
+ return patchOrPassThrough(patchEmbeddedBlockForms, source, "Eventual's Block Kit form adapter");
168
+ },
169
+ };
170
+ }
171
+
172
+ /** Presentation adapter for the tested admin build. RPC and receipts stay untouched. */
173
+ export function patchEventualPresentation(source) {
174
+ const original = 'import { BlockRenderer, isSafePluginPagePath, normalizePluginPagePath } from "@emdash-cms/blocks";';
175
+ // EmDash 1.5 dropped the unused `reserveHeaderEnd` prop from the panel host; accept both builds.
176
+ const panelSignatures = [
177
+ 'function SandboxedContentEditorPanel({ pluginId, panelId, title, collection, entryId, locale, versionToken, draftAccess, captureDraft, onDraftResponse, onEntryRefresh, reserveHeaderEnd = false }) {',
178
+ 'function SandboxedContentEditorPanel({ pluginId, panelId, title, collection, entryId, locale, versionToken, draftAccess, captureDraft, onDraftResponse, onEntryRefresh }) {',
179
+ ];
180
+ const panel = panelSignatures.find(signature => source.includes(signature)) ?? panelSignatures[0];
181
+ const fieldLabel = 'return field?.label || slug.charAt(0).toUpperCase() + slug.slice(1);';
182
+ const preview = 'function EditorDraftPatchPreview({ operations, fields, currentValues, onApply, onClose }) {';
183
+ const editPage = 'function ContentEditPage() {';
184
+ if (!source.includes(original) || !source.includes(panel) || !source.includes(fieldLabel) || !source.includes(editPage)) throw new Error("Unsupported EmDash admin presentation adapter. Use the tested compatibility matrix.");
185
+ let patched=source.replace(original, original.replace("{ BlockRenderer,", "{ BlockRenderer as EventualOriginalBlockRenderer,") + `
186
+ import { localizeEventualBlocks, draftSummary as eventualDraftSummary, editorText as eventualEditorText, loadEditorCatalog as eventualLoadCatalog, onEditorCatalog as eventualOnCatalog } from ${JSON.stringify(presentationModule)};
187
+ function BlockRenderer(props) {
188
+ const {locale}=useLocale();
189
+ const [eventualCatalogTick,eventualSetCatalogTick]=React$1.useState(0);
190
+ React$1.useEffect(()=>{ const off=eventualOnCatalog(()=>eventualSetCatalogTick(n=>n+1)); eventualLoadCatalog(locale); return off; },[locale]);
191
+ const blocks=React$1.useMemo(()=>localizeEventualBlocks(props.blocks, locale), [props.blocks,locale,eventualCatalogTick]);
192
+ return jsx(EventualOriginalBlockRenderer, {...props,blocks});
193
+ }`)
194
+ .replace(panel, panel + '\n const {locale: eventualUiLocale}=useLocale();\n if(pluginId === "eventual") title=eventualEditorText(title,eventualUiLocale);')
195
+ .replace(fieldLabel, 'const label=field?.label || slug.charAt(0).toUpperCase() + slug.slice(1); return field?.options?.eventualEditor ? eventualEditorText(label,i18n.locale) : label;')
196
+ // ContentEditPage's local i18n is the content configuration, not Lingui.
197
+ .replace(editPage,editPage+'\n const {locale:eventualPageUiLocale}=useLocale();')
198
+ .replace('description: error instanceof Error ? error.message : _t4({', 'description: error instanceof Error ? (collectionFields.start?.options?.eventualEditor ? eventualEditorText(error.message,eventualPageUiLocale) : error.message) : _t4({')
199
+ .replace(preview, preview + '\n const {locale: eventualPreviewLocale}=useLocale(); const eventualPreview=fields.start?.options?.eventualEditor===true;')
200
+ .replace('function EditorDraftPatchPreview({ operations, fields, currentValues, onApply, onClose }) {\n const {locale: eventualPreviewLocale}=useLocale(); const eventualPreview=fields.start?.options?.eventualEditor===true;\n\tconst { _: _t } = useLingui();', preview + '\n const {locale: eventualPreviewLocale}=useLocale(); const eventualPreview=fields.start?.options?.eventualEditor===true;\n const {_: eventualOriginalT}=useLingui(); const _t=eventualPreview ? message=>eventualEditorText(eventualOriginalT(message), eventualPreviewLocale):eventualOriginalT;')
201
+ .replace('children: fields[operation.field]?.label ?? operation.field', 'children: eventualPreview ? eventualEditorText(fields[operation.field]?.label ?? operation.field,eventualPreviewLocale) : fields[operation.field]?.label ?? operation.field')
202
+ .replace('children: summarize(currentValues[operation.field])', 'children: eventualPreview ? eventualDraftSummary(operation.field,currentValues[operation.field],eventualPreviewLocale,currentValues.timezone) : summarize(currentValues[operation.field])')
203
+ .replace('children: summarize(operation.op === "clear" ? null : operation.value)', 'children: eventualPreview ? eventualDraftSummary(operation.field,operation.op === "clear" ? null : operation.value,eventualPreviewLocale,currentValues.timezone) : summarize(operation.op === "clear" ? null : operation.value)');
204
+ const editorStart=patched.indexOf('function ContentEditor({'), editorEnd=patched.indexOf('\n//#endregion',editorStart);
205
+ if(editorStart<0 || editorEnd<0) throw new Error("Unsupported content editor boundary.");
206
+ const editor=patched.slice(editorStart,editorEnd).replaceAll('jsx(PublishActions, {','jsx(PublishActions, { eventualUi:Object.values(fields).some(field=>field.options?.eventualEditor===true),').replaceAll('jsx(SettingsActionBar, {','jsx(SettingsActionBar, { eventualUi:Object.values(fields).some(field=>field.options?.eventualEditor===true),');
207
+ patched=patched.slice(0,editorStart)+editor+patched.slice(editorEnd);
208
+ // Admin 1.2/1.3 use SettingsActionBar; 1.4 removed it. Patch it only when present.
209
+ const barStart=patched.indexOf('function SettingsActionBar({');
210
+ if(barStart>=0){
211
+ const barEnd=patched.indexOf('\nfunction ',barStart+1);
212
+ if(barEnd<0) throw new Error("Unsupported settings action bar boundary.");
213
+ patched=patched.slice(0,barStart)+patched.slice(barStart,barEnd).replace('jsx(PublishActions, {','jsx(PublishActions, { eventualUi,')+patched.slice(barEnd);
214
+ patched=patched.replace('function SettingsActionBar({ collectionLabel,','function SettingsActionBar({ eventualUi=false, collectionLabel,');
215
+ if(!patched.includes('function SettingsActionBar({ eventualUi=false, collectionLabel,')) throw new Error("Unsupported settings action bar signature.");
216
+ }
217
+ // Only Eventual's own prop is prepended, so any host prop list is kept as is (1.5 renamed
218
+ // \`disabled\` and added \`revisions\`).
219
+ const publishPattern=/function PublishActions\(\{ collectionLabel, (isNew, [^{}]*?) \}\) \{\r?\n\tconst \{ _: _t4 \} = useLingui\(\);/;
220
+ if(!publishPattern.test(patched)) throw new Error("Unsupported publish actions signature.");
221
+ return patched.replace(publishPattern, (_match, props) => `function PublishActions({ eventualUi=false, collectionLabel, ${props} }) {\n const {locale: eventualPublishLocale}=useLocale(); const {_:eventualPublishT}=useLingui(); const _t4=eventualUi ? message=>eventualEditorText(eventualPublishT(message),eventualPublishLocale):eventualPublishT;`);
222
+ }
package/astro/install.mjs CHANGED
@@ -4,13 +4,14 @@ import { createRequire } from "node:module";
4
4
  import { readFileSync } from "node:fs";
5
5
  import { dirname, join } from "node:path";
6
6
  import { eventualEditor } from "./descriptor.mjs";
7
- import { eventualEditorCompatibility } from "./editor-compat.mjs";
7
+ import { eventualEditorCompatibility, warnOnce } from "./editor-compat.mjs";
8
+ export { warnOnce };
8
9
 
9
10
  const require = createRequire(import.meta.url);
10
11
  export const testedVersions = Object.freeze({
11
- emdash: Object.freeze(["1.2.0", "1.4.0"]),
12
- "@emdash-cms/admin": Object.freeze(["1.2.0", "1.4.0"]),
13
- "@emdash-cms/blocks": Object.freeze(["1.2.0", "1.4.0"]),
12
+ emdash: Object.freeze(["1.2.0", "1.4.0", "1.5.0"]),
13
+ "@emdash-cms/admin": Object.freeze(["1.2.0", "1.4.0", "1.5.0"]),
14
+ "@emdash-cms/blocks": Object.freeze(["1.2.0", "1.4.0", "1.5.0"]),
14
15
  });
15
16
  export const testedToolchain = Object.freeze({astro:"7.3.x-7.4.x (>=7.3.2 <7.5.0)",vite:"8.3.x",react:"19.x"});
16
17
  export function installedVersion(name, resolver = require) {
@@ -25,19 +26,35 @@ export function installedVersion(name, resolver = require) {
25
26
  directory = parent;
26
27
  }
27
28
  }
28
- export function checkEditorVersions(resolveVersion = installedVersion) {
29
+ /** Compare dotted versions numerically; prerelease tags are ignored. */
30
+ export function compareVersions(a, b) {
31
+ const pa = String(a).split("-")[0].split(".").map(Number), pb = String(b).split("-")[0].split(".").map(Number);
32
+ for (let i = 0; i < 3; i++) if ((pa[i] ?? 0) !== (pb[i] ?? 0)) return (pa[i] ?? 0) - (pb[i] ?? 0);
33
+ return 0;
34
+ }
35
+ /**
36
+ * Versions older than the oldest tested release have known-incompatible shapes and are refused.
37
+ * Newer untested releases are allowed with a warning: the editor adapters fall back to stock
38
+ * EmDash behaviour if a build no longer matches, so an EmDash update never blocks a site.
39
+ */
40
+ export function checkEditorVersions(resolveVersion = installedVersion, warn = warnOnce) {
29
41
  const versions = Object.fromEntries(Object.keys(testedVersions).map(name => [name, resolveVersion(name)]));
30
42
  for (const [name, version] of Object.entries(versions)) {
31
43
  const expected = testedVersions[name];
32
- if (!expected.includes(version)) throw new Error(`Eventual editor requires tested ${name} ${expected.join(" or ")}; found ${version}. Use the documented compatibility matrix before upgrading.`);
44
+ if (expected.includes(version)) continue;
45
+ if (compareVersions(version, expected[0]) < 0) throw new Error(`Eventual editor requires ${name} ${expected[0]} or newer; found ${version}. Upgrade EmDash first.`);
46
+ warn(`${name} ${version} has not been tested with this Eventual release (tested: ${expected.join(", ")}). Eventual will run; check the event editor after upgrading and report anything that looks wrong.`);
33
47
  }
34
48
  return versions;
35
49
  }
36
- export function checkToolchainVersions(resolveVersion = installedVersion) {
50
+ const toolchainMinimum = Object.freeze({ astro: "7.3.2", vite: "8.3.0", react: "19.0.0" });
51
+ const toolchainTested = Object.freeze({ astro: v => /^7.[34]./.test(v), vite: v => /^8.3./.test(v), react: v => /^19./.test(v) });
52
+ export function checkToolchainVersions(resolveVersion = installedVersion, warn = warnOnce) {
37
53
  const versions={};
38
54
  for (const [name, range] of Object.entries(testedToolchain)) {
39
55
  const version=resolveVersion(name);
40
- if (!(name === "astro" ? /^7\.[34]\.\d+$/.test(version) && (version.startsWith("7.4.") || Number(version.split(".")[2]) >= 2) : name === "vite" ? /^8\.3\.\d+$/.test(version) : /^19\.\d+\.\d+$/.test(version))) throw new Error(`Eventual editor requires ${name} ${range}; found ${version}. See the editor compatibility matrix.`);
56
+ if (compareVersions(version, toolchainMinimum[name]) < 0) throw new Error(`Eventual editor requires ${name} ${toolchainMinimum[name]} or newer (tested: ${range}); found ${version}. See the editor compatibility matrix.`);
57
+ if (!toolchainTested[name](version)) warn(`${name} ${version} is newer than the tested ${range}. Eventual will run; check the event editor after upgrading.`);
41
58
  versions[name]=version;
42
59
  }
43
60
  return versions;
package/dist/index.mjs CHANGED
@@ -7,7 +7,7 @@
7
7
  /** @type {import("emdash").PluginDescriptor} */
8
8
  const descriptor = Object.freeze({
9
9
  "id": "eventual",
10
- "version": "0.18.2",
10
+ "version": "0.18.3",
11
11
  "format": "standard",
12
12
  "entrypoint": "@vermeulen.solutions/eventual/sandbox",
13
13
  "capabilities": [
@@ -25,13 +25,15 @@ Releases before 0.18.1 were not on npm; their source archives (`eventual-<versio
25
25
  To build the same helpers from the release checkout, run `npm ci`, `npm run build`
26
26
  and `npm pack`. Keep helper and backend versions aligned.
27
27
 
28
- Source tooling needs Node 24+. Peer ranges are in [package.json](../package.json); release acceptance uses EmDash/Admin/Block Kit **1.2.0 and 1.4.0**, Astro 7.3.x/7.4.x and React 19. The source `@vermeulen.solutions/eventual/install` lane accepts 1.2.0 and 1.4.0; Registry installs never execute that transform.
28
+ Source tooling needs Node 24+. Peer ranges are in [package.json](../package.json); release acceptance uses EmDash/Admin/Block Kit **1.2.0 and 1.4.0**, Astro 7.3.x/7.4.x and React 19. The source `@vermeulen.solutions/eventual/install` lane is tested on 1.2.0, 1.4.0 and 1.5.0. It refuses only hosts older than 1.2.0; a newer untested host builds with a warning, and an editor adapter that no longer matches the admin build steps aside (with a warning) so EmDash's own editor is used. Registry installs never execute that transform.
29
29
 
30
30
  | Host | Status | Notes |
31
31
  | --- | --- | --- |
32
32
  | 1.2.0 | supported, unit-tested | Panel Enter/validation is scoped to the outer content-editor form; Cloudflare cross-isolate plugin mutations can fail. |
33
33
  | 1.3.x | supported, untested | Same form/Cloudflare limitations; includes the plugin-storage cursor fix. |
34
34
  | 1.4.x | supported, full acceptance | Recommended. Fixes nested Block Kit forms and Cloudflare plugin mutations. |
35
+ | 1.5.x | supported, host-tested | 1.5.0 passes the native-site and plugin integration suites; the admin adapter recognises its editor panel. |
36
+ | newer | allowed with a warning | Not yet tested. Check the event editor after upgrading. |
35
37
 
36
38
  ## Public routes
37
39
 
@@ -1,8 +1,8 @@
1
- # Eventual RSVP – Core 0.18.2
1
+ # Eventual RSVP – Core 0.18.3
2
2
 
3
- Requires EmDash **>=1.2.0 <2.0.0** for event management. **1.4.0 is recommended** for nested forms and Cloudflare plugin mutations, and required for the optional cache integration.
3
+ Requires EmDash **>=1.2.0 <2.0.0** for event management; tested on 1.2.0, 1.4.0 and 1.5.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. Version 0.18.2 asks for no new permissions; since 0.18.0 Core uses `network:request` to `cdn.jsdelivr.net` for the admin's language packs. It adds no MCP tools. Enable intended tools separately under **Agent access**.
5
+ In **Plugins → Registry**, find **Eventual RSVP – Core** by **vermeulen.solutions**, review permissions and install or update. Version 0.18.3 asks for no new permissions; since 0.18.0 Core uses `network:request` to `cdn.jsdelivr.net` for the admin's language packs. It adds no MCP tools. Enable intended tools separately under **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
 
@@ -0,0 +1,6 @@
1
+ # Eventual RSVP – Core 0.18.3 — EmDash 1.5
2
+
3
+ - **Tested on EmDash 1.5.0**, as well as 1.2.0 and 1.4.0. The source installer's admin adapter recognises the 1.5 content-editor panel.
4
+ - **Newer EmDash releases are no longer refused.** Sites installed with `emdashWithEventual()` used to fail to build on any EmDash version Eventual had not been tested with. Now only versions older than 1.2.0 are refused; a newer untested version builds with a warning asking you to check the event editor.
5
+ - **Editor adapters step aside safely.** If a future admin build no longer matches what Eventual expects, Eventual prints a warning and EmDash's own editor is used for that part, instead of the site build stopping.
6
+ - **Nothing else changes**: no runtime, permission or schema changes, and no new MCP tools. Registry installs are unaffected by the source-installer changes. EmDash `>=1.2.0 <2.0.0`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vermeulen.solutions/eventual",
3
- "version": "0.18.2",
3
+ "version": "0.18.3",
4
4
  "license": "MIT",
5
5
  "homepage": "https://eventual.rsvp/",
6
6
  "type": "module",
@@ -64,7 +64,8 @@
64
64
  "docs/release-notes-0.17.0.md",
65
65
  "docs/release-notes-0.18.0.md",
66
66
  "docs/release-notes-0.18.1.md",
67
- "docs/release-notes-0.18.2.md"
67
+ "docs/release-notes-0.18.2.md",
68
+ "docs/release-notes-0.18.3.md"
68
69
  ],
69
70
  "scripts": {
70
71
  "validate": "emdash-plugin validate",