@riverbankcms/sdk 0.74.0 → 0.75.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.
Files changed (113) hide show
  1. package/dist/{PreviewEditorSidebar-5XL7M3OM.mjs → PreviewEditorSidebar-U2IHCBYN.mjs} +3 -3
  2. package/dist/{PreviewEditorUI-ZDFRDJID.mjs → PreviewEditorUI-ZGH2RQNP.mjs} +3 -3
  3. package/dist/SdkPreviewModeRuntime-MTUGBTLQ.mjs +8 -0
  4. package/dist/_dts/api/src/cache-tags.d.ts +22 -0
  5. package/dist/_dts/api/src/contentRuntime.d.ts +1 -0
  6. package/dist/_dts/api/src/endpoints.d.ts +24 -24
  7. package/dist/_dts/api/src/publicExperienceEndpoints.d.ts +2 -1
  8. package/dist/_dts/block-form/src/blockDraftSaveability.d.ts +4 -1
  9. package/dist/_dts/blocks/src/client/booking-form.d.ts +2 -0
  10. package/dist/_dts/blocks/src/client/carousel.d.ts +1 -0
  11. package/dist/_dts/blocks/src/client/course-registration.d.ts +2 -0
  12. package/dist/_dts/blocks/src/client/events.d.ts +4 -0
  13. package/dist/_dts/blocks/src/client/form.d.ts +2 -0
  14. package/dist/_dts/blocks/src/client/header.d.ts +1 -0
  15. package/dist/_dts/blocks/src/client/location-map.d.ts +1 -0
  16. package/dist/_dts/blocks/src/client/newsletter-form.d.ts +2 -0
  17. package/dist/_dts/blocks/src/client/shop.d.ts +6 -0
  18. package/dist/_dts/blocks/src/lib/video.d.ts +2 -0
  19. package/dist/_dts/blocks/src/system/manifest/fieldValidation/index.d.ts +21 -1
  20. package/dist/_dts/blocks/src/system/runtime/components/registry.client.d.ts +1 -0
  21. package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.headless.state.d.ts +3 -2
  22. package/dist/_dts/blocks/src/system/runtime/nodes/events/index.d.ts +3 -0
  23. package/dist/_dts/blocks/src/system/runtime/nodes/header-section.client.d.ts +1 -0
  24. package/dist/_dts/blocks/src/system/runtime/nodes/header-section.server.d.ts +1 -0
  25. package/dist/_dts/content-editor/src/hooks/validateBlocksForPublish.d.ts +5 -0
  26. package/dist/_dts/preview-next/src/client/preview/SiteChromeEditableSurface.d.ts +12 -2
  27. package/dist/_dts/sdk/src/public-api/contracts.d.ts +1 -0
  28. package/dist/_dts/sdk/src/rendering/islands/deferredVideoEmbeds.d.ts +2 -0
  29. package/dist/_dts/sdk/src/rendering/server.d.ts +3 -0
  30. package/dist/_dts/sdk/src/version.d.ts +1 -1
  31. package/dist/_dts/theme-core/src/generated/containerResponsiveThemeCss.d.ts +1 -1
  32. package/dist/{chunk-YY7K3QD2.mjs → chunk-BGMNDF6T.mjs} +7 -7
  33. package/dist/{chunk-2MIWNFJM.mjs → chunk-GFE74WRD.mjs} +309 -84
  34. package/dist/{chunk-CEQBBLMJ.mjs → chunk-RWXQBRQZ.mjs} +1 -1
  35. package/dist/{chunk-7RX72SK2.mjs → chunk-VX7B5VAC.mjs} +36 -25
  36. package/dist/{chunk-YRJKZEQ3.mjs → chunk-Z7JLNTJR.mjs} +1 -1
  37. package/dist/{chunk-CBD47MTM.mjs → chunk-ZSHFGFUG.mjs} +2 -2
  38. package/dist/cli/index.mjs +3395 -3753
  39. package/dist/client/{accordion-ZZVXWV3N.mjs → accordion-T2UD2ZTH.mjs} +1 -1
  40. package/dist/client/bookingForm-GUP75FKN.mjs +3022 -0
  41. package/dist/client/bookings.mjs +19 -10
  42. package/dist/client/{carousel-25WK2H7G.mjs → carousel-2NQA6V57.mjs} +3 -2
  43. package/dist/client/cart-5TFIAFDS.mjs +18 -0
  44. package/dist/client/checkout-TP4WAHZE.mjs +18 -0
  45. package/dist/client/chunk-2PHQZ666.mjs +383 -0
  46. package/dist/client/chunk-3DCJ45Z2.mjs +36 -0
  47. package/dist/client/chunk-3PEDD5KJ.mjs +146 -0
  48. package/dist/client/chunk-CY2ZTSE5.mjs +204 -0
  49. package/dist/client/chunk-F7LHOKEH.mjs +146 -0
  50. package/dist/client/{chunk-6VGXRE34.mjs → chunk-FU2QRZMX.mjs} +6 -6
  51. package/dist/client/chunk-I2MMZO53.mjs +6 -0
  52. package/dist/client/chunk-II7O4XN3.mjs +2206 -0
  53. package/dist/client/chunk-M3L3KYYR.mjs +1181 -0
  54. package/dist/client/chunk-NWOUL6JY.mjs +1378 -0
  55. package/dist/client/chunk-OJPZEZU2.mjs +31 -0
  56. package/dist/client/chunk-RTZ3JKKX.mjs +178 -0
  57. package/dist/client/chunk-TQ5MSPDX.mjs +74 -0
  58. package/dist/client/chunk-VUAOE3AG.mjs +5592 -0
  59. package/dist/client/chunk-WJXXNDSE.mjs +245 -0
  60. package/dist/client/chunk-YLMKMCSJ.mjs +86 -0
  61. package/dist/client/chunk-ZLMS67RR.mjs +106 -0
  62. package/dist/client/client.mjs +51626 -52074
  63. package/dist/client/courseRegistration-5DPU6PDY.mjs +1737 -0
  64. package/dist/client/{eventCalendar-X6GIPYFM.mjs → eventCalendar-F3GZGTEF.mjs} +13 -2
  65. package/dist/client/{eventCombined-EZUOPM3G.mjs → eventCombined-BQOB6QMY.mjs} +13 -2
  66. package/dist/client/eventDetails-PEM2EJWE.mjs +25 -0
  67. package/dist/client/{eventListing-HEFGAETC.mjs → eventListing-YMIQPVME.mjs} +13 -2
  68. package/dist/client/{eventRegistration-3LCP2V3P.mjs → eventRegistration-4I6ZNDUF.mjs} +13 -2
  69. package/dist/client/form-ZJVAYZ6G.mjs +300 -0
  70. package/dist/client/headerSection-TOT5MGTF.mjs +729 -0
  71. package/dist/client/hooks.mjs +49 -33
  72. package/dist/client/locationMap-J66NZREU.mjs +227 -0
  73. package/dist/client/newsletterForm-ET2XUMRO.mjs +208 -0
  74. package/dist/client/productDetail-C2XIH7C5.mjs +18 -0
  75. package/dist/client/productList-T2AZLFTP.mjs +18 -0
  76. package/dist/client/rendering/client.mjs +11763 -12445
  77. package/dist/client/rendering/islands.mjs +98 -21
  78. package/dist/client/rendering.mjs +46778 -47229
  79. package/dist/client/shop-UZ6IUZXD.mjs +20 -0
  80. package/dist/preview-next/before-render.mjs +37 -25
  81. package/dist/preview-next/client/runtime.mjs +5 -5
  82. package/dist/preview-next/middleware.mjs +37 -25
  83. package/dist/{sdk-runtime-OHNONZ5U.mjs → sdk-runtime-JCUQM63Y.mjs} +6 -6
  84. package/dist/server/components.mjs +409 -266
  85. package/dist/server/config-validation.mjs +49 -33
  86. package/dist/server/config.mjs +49 -33
  87. package/dist/server/data.mjs +49 -33
  88. package/dist/server/index.mjs +45 -33
  89. package/dist/server/next.mjs +405 -262
  90. package/dist/server/page-converter.mjs +12 -8
  91. package/dist/server/prebuild.mjs +1 -1
  92. package/dist/server/rendering/server.mjs +493 -265
  93. package/dist/server/rendering.mjs +411 -268
  94. package/dist/server/routing.mjs +49 -33
  95. package/dist/server/server.mjs +50 -34
  96. package/dist/server/theme-bridge.mjs +5 -0
  97. package/dist/styles/index.css +5 -0
  98. package/package.json +2 -1
  99. package/dist/SdkPreviewModeRuntime-CRYNDSPL.mjs +0 -8
  100. package/dist/client/bookingForm-4X77HKDS.mjs +0 -34
  101. package/dist/client/cart-JWD2VRFU.mjs +0 -11
  102. package/dist/client/checkout-V7KYGWL7.mjs +0 -11
  103. package/dist/client/chunk-5IYGMTUE.mjs +0 -18614
  104. package/dist/client/chunk-RKCFVIMS.mjs +0 -26
  105. package/dist/client/courseRegistration-O6ZPK4YT.mjs +0 -29
  106. package/dist/client/eventDetails-3WODIXET.mjs +0 -14
  107. package/dist/client/form-AKXQMY6Z.mjs +0 -85
  108. package/dist/client/headerSection-5KHCMU6B.mjs +0 -12
  109. package/dist/client/locationMap-7HIADW76.mjs +0 -14
  110. package/dist/client/newsletterForm-5N4YTMU3.mjs +0 -60
  111. package/dist/client/productDetail-IZUA7ZP3.mjs +0 -11
  112. package/dist/client/productList-KWIIJE6I.mjs +0 -11
  113. package/dist/client/shop-XZQFRQWZ.mjs +0 -13
@@ -0,0 +1,208 @@
1
+ "use client";
2
+ import { getFieldValidationControlProps, FieldValidationMessage } from './chunk-3DCJ45Z2.mjs';
3
+ import { isSpamProtectionEnabled, AltchaWidget, getChallengeUrl } from './chunk-YLMKMCSJ.mjs';
4
+ import { BlockApiProvider, useBlockApi, FeedbackMessage } from './chunk-M3L3KYYR.mjs';
5
+ import { mountReactIsland } from './chunk-N7PBWBWQ.mjs';
6
+ import { defineIslandPropsDecoder, themeButtonClassName } from './chunk-FU2QRZMX.mjs';
7
+ import { clsx_default } from './chunk-PMAIXMAB.mjs';
8
+ import { useState } from 'react';
9
+ import { jsx, jsxs } from 'react/jsx-runtime';
10
+
11
+ // ../blocks/src/system/runtime/nodes/newsletter-form.client.state.ts
12
+ function newsletterFieldError(fieldId, message) {
13
+ return { kind: "field", fieldId, message };
14
+ }
15
+ function newsletterFormError(message) {
16
+ return { kind: "form", message };
17
+ }
18
+ function getNewsletterFieldError(error, fieldId) {
19
+ return error?.kind === "field" && error.fieldId === fieldId ? error.message : null;
20
+ }
21
+ function getNewsletterFormError(error) {
22
+ return error?.kind === "form" ? error.message : null;
23
+ }
24
+ function NewsletterFormClient({
25
+ render
26
+ }) {
27
+ const api = useBlockApi();
28
+ const [isSubmitting, setIsSubmitting] = useState(false);
29
+ const [error, setError] = useState(null);
30
+ const [isSuccess, setIsSuccess] = useState(false);
31
+ const [altchaSolution, setAltchaSolution] = useState(null);
32
+ const showSpamProtection = render.hydration.spamProtectionEnabled ?? isSpamProtectionEnabled();
33
+ const fields = render.display.fields;
34
+ const parsedTags = typeof render.hydration.tags === "string" ? render.hydration.tags.split(/[;,]/g).map((t) => t.trim()).filter(Boolean) : [];
35
+ const handleSubmit = async (e) => {
36
+ e.preventDefault();
37
+ setError(null);
38
+ const formData = new FormData(e.currentTarget);
39
+ const honeypot = formData.get("website");
40
+ if (honeypot?.trim()) {
41
+ setIsSuccess(true);
42
+ return;
43
+ }
44
+ const email = formData.get("email")?.trim();
45
+ const firstName = formData.get("firstName")?.trim() || void 0;
46
+ const lastName = formData.get("lastName")?.trim() || void 0;
47
+ const name = formData.get("name")?.trim() || void 0;
48
+ const company = formData.get("company")?.trim() || void 0;
49
+ const phone = formData.get("phone")?.trim() || void 0;
50
+ if (!email) {
51
+ setError(newsletterFieldError("email", "Email is required"));
52
+ return;
53
+ }
54
+ if (!render.hydration.listId) {
55
+ setError(newsletterFormError("Newsletter list is not configured"));
56
+ return;
57
+ }
58
+ setIsSubmitting(true);
59
+ try {
60
+ await api.subscribeNewsletter({
61
+ email,
62
+ firstName,
63
+ lastName,
64
+ name,
65
+ company,
66
+ phone,
67
+ listId: render.hydration.listId,
68
+ tags: parsedTags.length > 0 ? parsedTags : void 0,
69
+ blockId: void 0,
70
+ meta: {
71
+ honeypot,
72
+ altchaSolution
73
+ }
74
+ });
75
+ setIsSuccess(true);
76
+ } catch (err) {
77
+ setError(newsletterFormError(
78
+ err instanceof Error ? err.message : "Subscription failed. Please try again."
79
+ ));
80
+ } finally {
81
+ setIsSubmitting(false);
82
+ }
83
+ };
84
+ const renderField = (field) => {
85
+ const inputId = `newsletter_${field.id}`;
86
+ const fieldError = getNewsletterFieldError(error, field.id);
87
+ const fieldErrorId = `${inputId}-error`;
88
+ const validationProps = getFieldValidationControlProps({
89
+ message: fieldError,
90
+ messageId: fieldErrorId
91
+ });
92
+ return /* @__PURE__ */ jsxs("div", { className: "fb-field newsletter-field", children: [
93
+ /* @__PURE__ */ jsxs("label", { htmlFor: inputId, className: "form-label", children: [
94
+ field.label,
95
+ field.required && /* @__PURE__ */ jsx("span", { className: "newsletter-required", "aria-hidden": "true", children: "*" })
96
+ ] }),
97
+ /* @__PURE__ */ jsx(
98
+ "input",
99
+ {
100
+ id: inputId,
101
+ name: field.id,
102
+ type: field.type,
103
+ required: field.required,
104
+ placeholder: field.placeholder,
105
+ className: "form-input",
106
+ autoComplete: field.type === "email" ? "email" : void 0,
107
+ disabled: isSubmitting,
108
+ ...validationProps
109
+ }
110
+ ),
111
+ fieldError && /* @__PURE__ */ jsx(FieldValidationMessage, { id: fieldErrorId, className: "fb-error", children: fieldError })
112
+ ] }, field.id);
113
+ };
114
+ const formError = getNewsletterFormError(error);
115
+ if (isSuccess) {
116
+ return /* @__PURE__ */ jsx("div", { className: clsx_default("newsletter-form", "newsletter-success", render.display.className ?? void 0), children: /* @__PURE__ */ jsx(FeedbackMessage, { tone: "success", className: "fb-success", role: "status", children: render.display.successMessage?.trim() || "Thanks for subscribing!" }) });
117
+ }
118
+ return /* @__PURE__ */ jsxs("div", { className: clsx_default("newsletter-form", render.display.className ?? void 0), children: [
119
+ formError && /* @__PURE__ */ jsx(FeedbackMessage, { tone: "error", className: "fb-error", role: "alert", children: formError }),
120
+ /* @__PURE__ */ jsxs("form", { onSubmit: handleSubmit, className: "fb-form", children: [
121
+ /* @__PURE__ */ jsx(
122
+ "input",
123
+ {
124
+ type: "text",
125
+ name: "website",
126
+ className: "hidden",
127
+ tabIndex: -1,
128
+ autoComplete: "off",
129
+ "aria-hidden": "true"
130
+ }
131
+ ),
132
+ /* @__PURE__ */ jsxs("div", { className: "newsletter-form-fields", children: [
133
+ fields.map(renderField),
134
+ showSpamProtection && /* @__PURE__ */ jsx("div", { className: "newsletter-altcha", children: /* @__PURE__ */ jsx(
135
+ AltchaWidget,
136
+ {
137
+ challengeUrl: getChallengeUrl(),
138
+ onSolutionChange: setAltchaSolution
139
+ }
140
+ ) }),
141
+ /* @__PURE__ */ jsx("div", { className: "newsletter-submit", children: /* @__PURE__ */ jsx(
142
+ "button",
143
+ {
144
+ type: "submit",
145
+ className: themeButtonClassName({ variant: "primary", size: "md" }),
146
+ disabled: isSubmitting,
147
+ children: isSubmitting ? "Subscribing..." : render.display.buttonLabel
148
+ }
149
+ ) })
150
+ ] }),
151
+ render.display.privacyNote && /* @__PURE__ */ jsx("p", { className: "newsletter-privacy-note", children: render.display.privacyNote })
152
+ ] })
153
+ ] });
154
+ }
155
+ var decode = defineIslandPropsDecoder("newsletter-form");
156
+ function snapshotFormValues(form) {
157
+ if (!form) return [];
158
+ const snapshots = [];
159
+ const elements = Array.from(form.elements);
160
+ for (const el of elements) {
161
+ if (!(el instanceof HTMLInputElement || el instanceof HTMLTextAreaElement)) {
162
+ continue;
163
+ }
164
+ const name = el.name;
165
+ if (!name) continue;
166
+ snapshots.push({ name, value: el.value });
167
+ }
168
+ return snapshots;
169
+ }
170
+ function applySnapshots(form, snapshots) {
171
+ if (!form) return;
172
+ for (const snapshot of snapshots) {
173
+ const el = form.elements.namedItem(snapshot.name);
174
+ if (el instanceof HTMLInputElement || el instanceof HTMLTextAreaElement) {
175
+ el.value = snapshot.value;
176
+ }
177
+ }
178
+ }
179
+ var enhance = (root, props) => {
180
+ const { siteId, apiBaseUrl, render } = props;
181
+ if (!siteId) {
182
+ throw new Error("[sdk:islands] newsletter-form requires siteId");
183
+ }
184
+ if (!apiBaseUrl) {
185
+ throw new Error("[sdk:islands] newsletter-form requires apiBaseUrl");
186
+ }
187
+ if (!render.hydration.listId) {
188
+ throw new Error("[sdk:islands] newsletter-form requires listId");
189
+ }
190
+ const apiConfig = {
191
+ baseUrl: apiBaseUrl,
192
+ auth: { type: "none" },
193
+ siteId
194
+ };
195
+ const existingForm = root.querySelector("form");
196
+ const snapshots = snapshotFormValues(existingForm);
197
+ return mountReactIsland(root, ({ root: reactRoot }) => {
198
+ reactRoot.render(
199
+ /* @__PURE__ */ jsx(BlockApiProvider, { config: apiConfig, children: /* @__PURE__ */ jsx(NewsletterFormClient, { ...props }) })
200
+ );
201
+ requestAnimationFrame(() => {
202
+ const nextForm = root.querySelector("form");
203
+ applySnapshots(nextForm, snapshots);
204
+ });
205
+ });
206
+ };
207
+
208
+ export { decode, enhance };
@@ -0,0 +1,18 @@
1
+ import { mountShopBlockIsland, ProductDetailClient } from './chunk-NWOUL6JY.mjs';
2
+ import './chunk-ZLMS67RR.mjs';
3
+ import './chunk-II7O4XN3.mjs';
4
+ import './chunk-I2MMZO53.mjs';
5
+ import './chunk-RTZ3JKKX.mjs';
6
+ import './chunk-2PHQZ666.mjs';
7
+ import './chunk-3DCJ45Z2.mjs';
8
+ import './chunk-3PEDD5KJ.mjs';
9
+ import './chunk-M3L3KYYR.mjs';
10
+ import './chunk-N7PBWBWQ.mjs';
11
+ import { defineIslandPropsDecoder } from './chunk-FU2QRZMX.mjs';
12
+ import './chunk-PMAIXMAB.mjs';
13
+
14
+ // src/rendering/islands/enhancers/productDetail.tsx
15
+ var decode = defineIslandPropsDecoder("product-detail");
16
+ var enhance = (root, props) => mountShopBlockIsland(root, props, ProductDetailClient, "product-detail");
17
+
18
+ export { decode, enhance };
@@ -0,0 +1,18 @@
1
+ import { mountShopBlockIsland, ProductListClient } from './chunk-NWOUL6JY.mjs';
2
+ import './chunk-ZLMS67RR.mjs';
3
+ import './chunk-II7O4XN3.mjs';
4
+ import './chunk-I2MMZO53.mjs';
5
+ import './chunk-RTZ3JKKX.mjs';
6
+ import './chunk-2PHQZ666.mjs';
7
+ import './chunk-3DCJ45Z2.mjs';
8
+ import './chunk-3PEDD5KJ.mjs';
9
+ import './chunk-M3L3KYYR.mjs';
10
+ import './chunk-N7PBWBWQ.mjs';
11
+ import { defineIslandPropsDecoder } from './chunk-FU2QRZMX.mjs';
12
+ import './chunk-PMAIXMAB.mjs';
13
+
14
+ // src/rendering/islands/enhancers/productList.tsx
15
+ var decode = defineIslandPropsDecoder("product-list");
16
+ var enhance = (root, props) => mountShopBlockIsland(root, props, ProductListClient, "product-list");
17
+
18
+ export { decode, enhance };