@riverbankcms/sdk 0.85.0 → 0.89.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{PreviewEditorSidebar-4PH35ZIE.mjs → PreviewEditorSidebar-JDR64FEC.mjs} +3 -3
- package/dist/{PreviewEditorUI-WHMCRJGM.mjs → PreviewEditorUI-67TMJMAF.mjs} +3 -3
- package/dist/SdkPreviewModeRuntime-ZBEMRV7N.mjs +8 -0
- package/dist/_dts/api/src/accessAdmin.d.ts +7 -0
- package/dist/_dts/api/src/endpoints.d.ts +66 -14
- package/dist/_dts/api/src/index.d.ts +5 -2
- package/dist/_dts/api/src/launchReadiness.d.ts +3 -3
- package/dist/_dts/api/src/mailchimpIntegration.d.ts +215 -0
- package/dist/_dts/api/src/publicExperienceEndpoints.d.ts +35 -15
- package/dist/_dts/api/src/siteInfrastructure.d.ts +0 -14
- package/dist/_dts/api/src/siteManagementEndpoints.d.ts +5 -1
- package/dist/_dts/api/src/siteMembers.d.ts +6 -1
- package/dist/_dts/api/src/siteRuntimeEndpoints.d.ts +1 -13
- package/dist/_dts/api/src/types.d.ts +7 -4
- package/dist/_dts/blocks/src/PageRenderer.d.ts +1 -0
- package/dist/_dts/blocks/src/contracts/proof-block-islands.d.ts +4 -0
- package/dist/_dts/blocks/src/index.d.ts +2 -1
- package/dist/_dts/blocks/src/system/blocks/appointment-booking.d.ts +288 -288
- package/dist/_dts/blocks/src/system/blocks/blog-listing.d.ts +288 -288
- package/dist/_dts/blocks/src/system/blocks/cart.d.ts +288 -288
- package/dist/_dts/blocks/src/system/blocks/checkout.d.ts +288 -288
- package/dist/_dts/blocks/src/system/blocks/collection.d.ts +288 -288
- package/dist/_dts/blocks/src/system/blocks/events/shared/schemas.d.ts +42 -0
- package/dist/_dts/blocks/src/system/blocks/events/shared/types.d.ts +4 -0
- package/dist/_dts/blocks/src/system/blocks/faq.d.ts +288 -288
- package/dist/_dts/blocks/src/system/blocks/gifting.d.ts +288 -288
- package/dist/_dts/blocks/src/system/blocks/location-map.d.ts +1 -1
- package/dist/_dts/blocks/src/system/blocks/media-text.d.ts +42 -42
- package/dist/_dts/blocks/src/system/blocks/newsletter-signup-destination.d.ts +300 -0
- package/dist/_dts/blocks/src/system/blocks/newsletter-signup.d.ts +63 -3
- package/dist/_dts/blocks/src/system/blocks/product-detail.d.ts +288 -288
- package/dist/_dts/blocks/src/system/blocks/product-list.d.ts +288 -288
- package/dist/_dts/blocks/src/system/blocks/shop.d.ts +288 -288
- package/dist/_dts/blocks/src/system/fragments/library/newsletterForm.d.ts +53 -1
- package/dist/_dts/blocks/src/system/icons/cta.d.ts +3 -3
- package/dist/_dts/blocks/src/system/icons/index.d.ts +1 -0
- package/dist/_dts/blocks/src/system/icons/registry.d.ts +2 -2
- package/dist/_dts/blocks/src/system/icons/semantic.d.ts +3 -3
- package/dist/_dts/blocks/src/system/icons/svg.d.ts +72 -0
- package/dist/_dts/blocks/src/system/manifest/richTextSchema.d.ts +27 -0
- package/dist/_dts/blocks/src/system/manifest/schema.d.ts +23 -23
- package/dist/_dts/blocks/src/system/runtime/api/types.d.ts +11 -2
- package/dist/_dts/blocks/src/system/runtime/components/registry.client.d.ts +24 -0
- package/dist/_dts/blocks/src/system/runtime/components/runtime-backed-blocks.d.ts +12 -0
- package/dist/_dts/blocks/src/system/runtime/hooks/loadStateError.d.ts +1 -0
- package/dist/_dts/blocks/src/system/runtime/hooks/useAvailableDates.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/hooks/useAvailableDates.state.d.ts +55 -0
- package/dist/_dts/blocks/src/system/runtime/hooks/useAvailableSlots.state.d.ts +39 -0
- package/dist/_dts/blocks/src/system/runtime/hooks/useBookingFormConfig.d.ts +4 -27
- package/dist/_dts/blocks/src/system/runtime/hooks/useBookingFormConfig.state.d.ts +40 -0
- package/dist/_dts/blocks/src/system/runtime/hooks/useCalendarEvents.state.d.ts +20 -0
- package/dist/_dts/blocks/src/system/runtime/hooks/useEventFilters.state.d.ts +31 -0
- package/dist/_dts/blocks/src/system/runtime/hooks/useEventPagination.d.ts +3 -3
- package/dist/_dts/blocks/src/system/runtime/hooks/useEventPagination.state.d.ts +39 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/types.d.ts +1 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration.interactive.d.ts +4 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration.server.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/EventPaginatedListView.client.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/utils.d.ts +11 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/newsletter-form.client.state.d.ts +24 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/newsletter-form.interactive.d.ts +15 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/newsletter-form.server.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/newsletter-form.submission.d.ts +32 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/newsletter-form.types.d.ts +5 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/shared/MagicLinkForm.state.d.ts +24 -0
- package/dist/_dts/blocks/src/system/runtime/shared/components/ModalShell.d.ts +5 -1
- package/dist/_dts/blocks/src/system/runtime/shared/useWaitlistClaim.state.d.ts +35 -0
- package/dist/_dts/blocks/src/system/runtime/shared/utils/formatting.d.ts +1 -1
- package/dist/_dts/content-model/src/entry-slots/types.d.ts +54 -0
- package/dist/_dts/content-model/src/referenceFields.d.ts +1 -1
- package/dist/_dts/core/src/branded.d.ts +7 -0
- package/dist/_dts/core/src/currency-format.d.ts +37 -2
- package/dist/_dts/core/src/event-pricing.d.ts +24 -0
- package/dist/_dts/core/src/index.d.ts +1 -0
- package/dist/_dts/core/src/site-route-target.d.ts +40 -0
- package/dist/_dts/db/src/generated/supabase/database.types.d.ts +705 -17
- package/dist/_dts/editor-blocks/src/widgets/reference/loaders.d.ts +3 -1
- package/dist/_dts/media-core/src/fileDomain.d.ts +4 -0
- package/dist/_dts/sdk/src/client/runtimeCachePolicy.d.ts +160 -0
- package/dist/_dts/sdk/src/client/types.d.ts +35 -1
- package/dist/_dts/sdk/src/config/validation.d.ts +3 -0
- package/dist/_dts/sdk/src/contracts/system-block-content.d.ts +3 -0
- package/dist/_dts/sdk/src/data/prefetchBlockData.d.ts +3 -9
- package/dist/_dts/sdk/src/index.d.ts +3 -1
- package/dist/_dts/sdk/src/manifest/passes/pass1-fields.d.ts +1 -1
- package/dist/_dts/sdk/src/manifest/three-pass-converter.d.ts +7 -18
- package/dist/_dts/sdk/src/rendering/blocks-page-renderer.d.ts +2 -0
- package/dist/_dts/sdk/src/rendering/components/pageShared.d.ts +3 -1
- package/dist/_dts/sdk/src/rendering/helpers/loadContent.d.ts +7 -3
- package/dist/_dts/sdk/src/rendering/helpers/loadPage.d.ts +4 -24
- package/dist/_dts/sdk/src/rendering/helpers/pageRuntimeSupport.d.ts +45 -0
- package/dist/_dts/sdk/src/version.d.ts +1 -1
- package/dist/_dts/theme-core/src/generated/containerResponsiveThemeCss.d.ts +1 -1
- package/dist/_dts/theme-core/src/mock-themes/all.d.ts +9 -9
- package/dist/_dts/theme-core/src/schema.d.ts +11 -11
- package/dist/{chunk-PYDHOMEO.mjs → chunk-7N46MZHI.mjs} +1 -1
- package/dist/{chunk-ZR2GQK2A.mjs → chunk-7YUAXONX.mjs} +1880 -588
- package/dist/{chunk-4QNLOTES.mjs → chunk-F645A5UV.mjs} +76 -14
- package/dist/{chunk-OCGTXHSO.mjs → chunk-HKJQERFR.mjs} +7 -7
- package/dist/{chunk-NFWGLRZZ.mjs → chunk-TGBJWKMP.mjs} +37 -3
- package/dist/{chunk-WFPYN7KA.mjs → chunk-ZQRBLCW5.mjs} +2 -2
- package/dist/cli/index.mjs +1075 -126
- package/dist/client/{accordion-2UZPBMYM.mjs → accordion-MUCVNGQ7.mjs} +2 -2
- package/dist/client/{bookingForm-36CWQUMV.mjs → bookingForm-PKD6EFIE.mjs} +193 -77
- package/dist/client/bookings.mjs +487 -197
- package/dist/client/{carousel-QH77HR6X.mjs → carousel-3TKQSNJC.mjs} +4 -3
- package/dist/client/cart-6XHSZK23.mjs +19 -0
- package/dist/client/checkout-FVSPM6FI.mjs +19 -0
- package/dist/client/{chunk-ZE5G642V.mjs → chunk-25W2EQUN.mjs} +75 -1
- package/dist/client/chunk-6N7YRNYU.mjs +183 -0
- package/dist/client/{chunk-4OXKTA3D.mjs → chunk-7DH35FGA.mjs} +2 -2
- package/dist/client/{chunk-3C2VTPWI.mjs → chunk-CQKKFEQD.mjs} +363 -66
- package/dist/client/{chunk-7UCLJ5SP.mjs → chunk-EY42X22F.mjs} +4 -7
- package/dist/client/{chunk-SYIJ5JO2.mjs → chunk-FHU6PFPM.mjs} +1 -1
- package/dist/client/{chunk-ZKUO52W3.mjs → chunk-LQFDYWPJ.mjs} +1 -1
- package/dist/client/chunk-RSQWWUAD.mjs +390 -0
- package/dist/client/{chunk-UDNSI5PY.mjs → chunk-STJ2NCQM.mjs} +2 -3
- package/dist/client/{chunk-VGDBVNOO.mjs → chunk-UQFY4AHX.mjs} +511 -406
- package/dist/client/{chunk-F5VRX5Y6.mjs → chunk-VGLXACVK.mjs} +1 -1
- package/dist/client/{chunk-DVNUDUVT.mjs → chunk-WBQG7VJA.mjs} +4 -1
- package/dist/client/{chunk-52CGCQ7B.mjs → chunk-ZJZZA5EP.mjs} +10 -80
- package/dist/client/{chunk-XSV6KW4D.mjs → chunk-ZT5XE7FK.mjs} +1 -1
- package/dist/client/client.mjs +5820 -4782
- package/dist/client/{courseRegistration-TMKU6ABO.mjs → courseRegistration-ATZSYDHM.mjs} +7 -7
- package/dist/client/{eventCalendar-G6TI32X6.mjs → eventCalendar-6T2UGKKP.mjs} +11 -11
- package/dist/client/{eventCombined-SCKEMNAR.mjs → eventCombined-Q4VANXVF.mjs} +11 -11
- package/dist/client/{eventDetails-XPIFXXPK.mjs → eventDetails-DW37E7VW.mjs} +11 -11
- package/dist/client/{eventListing-7QFMEMGT.mjs → eventListing-XURTSAUW.mjs} +11 -11
- package/dist/client/{eventRegistration-TOODSZUI.mjs → eventRegistration-MRKEVAXW.mjs} +11 -11
- package/dist/client/{form-MTCMVCZT.mjs → form-WZZFFGMU.mjs} +3 -3
- package/dist/client/{headerSection-Y5TMR3TW.mjs → headerSection-EQYVQBLM.mjs} +4 -4
- package/dist/client/hooks.mjs +1700 -1412
- package/dist/client/{locationMap-RH2LG7FZ.mjs → locationMap-MFF5VAZR.mjs} +3 -4
- package/dist/client/{newsletterForm-PCAIPFMA.mjs → newsletterForm-JQ77UYIE.mjs} +127 -43
- package/dist/client/{productDetail-OIGDR4YE.mjs → productDetail-25LMT3IZ.mjs} +9 -9
- package/dist/client/{productList-4MA5S2CX.mjs → productList-5ABEMKUG.mjs} +9 -9
- package/dist/client/rendering/client.mjs +3884 -3722
- package/dist/client/rendering/islands.mjs +19 -19
- package/dist/client/rendering.mjs +6774 -6331
- package/dist/client/shop-OMMQZ6YO.mjs +21 -0
- package/dist/preview-next/before-render.mjs +76 -14
- package/dist/preview-next/client/runtime.mjs +5 -5
- package/dist/preview-next/editor-chrome.css +56 -9
- package/dist/preview-next/middleware.mjs +76 -14
- package/dist/{sdk-runtime-QLOCYKVU.mjs → sdk-runtime-WNLBZ3ZH.mjs} +6 -6
- package/dist/server/components.mjs +2579 -2548
- package/dist/server/config-validation.mjs +1737 -1461
- package/dist/server/config.mjs +1737 -1461
- package/dist/server/data.mjs +1701 -1413
- package/dist/server/index.mjs +1048 -400
- package/dist/server/next.mjs +3602 -2858
- package/dist/server/page-converter.mjs +2193 -1169
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/rendering/server.mjs +2770 -2742
- package/dist/server/rendering.mjs +2961 -2886
- package/dist/server/routing.mjs +2186 -1508
- package/dist/server/server.mjs +2237 -1287
- package/dist/server/theme-bridge.mjs +260 -0
- package/dist/styles/index.css +258 -0
- package/package.json +2 -1
- package/dist/SdkPreviewModeRuntime-4FGSVUYI.mjs +0 -8
- package/dist/client/cart-X4YK4FTW.mjs +0 -19
- package/dist/client/checkout-OM2BEPWD.mjs +0 -19
- package/dist/client/chunk-3DTWLTXM.mjs +0 -204
- package/dist/client/chunk-I2MMZO53.mjs +0 -6
- package/dist/client/shop-WXSYV5QO.mjs +0 -21
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { LeafletStaticMap } from './chunk-
|
|
2
|
-
import './chunk-I2MMZO53.mjs';
|
|
1
|
+
import { LeafletStaticMap } from './chunk-ZT5XE7FK.mjs';
|
|
3
2
|
import { mountReactIsland } from './chunk-N7PBWBWQ.mjs';
|
|
4
|
-
import { defineIslandPropsDecoder } from './chunk-
|
|
5
|
-
import { normalizeLocationAddressText, toLocationCoordinates, textColorStyle, mergeStyles, borderColorStyle, backgroundColorStyle } from './chunk-
|
|
3
|
+
import { defineIslandPropsDecoder } from './chunk-UQFY4AHX.mjs';
|
|
4
|
+
import { normalizeLocationAddressText, toLocationCoordinates, textColorStyle, mergeStyles, borderColorStyle, backgroundColorStyle } from './chunk-25W2EQUN.mjs';
|
|
6
5
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
7
6
|
|
|
8
7
|
// ../blocks/src/system/runtime/nodes/location-map.shared.ts
|
|
@@ -1,14 +1,31 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { getFieldValidationControlProps, FieldValidationMessage } from './chunk-3DCJ45Z2.mjs';
|
|
3
3
|
import { isSpamProtectionEnabled, AltchaWidget, getChallengeUrl } from './chunk-SDIYSQAY.mjs';
|
|
4
|
-
import { BlockApiProvider, useBlockApi, FeedbackMessage } from './chunk-
|
|
4
|
+
import { BlockApiProvider, useBlockApi, FeedbackMessage } from './chunk-STJ2NCQM.mjs';
|
|
5
5
|
import { mountReactIsland } from './chunk-N7PBWBWQ.mjs';
|
|
6
|
-
import { defineIslandPropsDecoder, themeButtonClassName } from './chunk-
|
|
7
|
-
import { clsx_default } from './chunk-
|
|
8
|
-
import { useState } from 'react';
|
|
6
|
+
import { defineIslandPropsDecoder, themeButtonClassName, assertNever11 } from './chunk-UQFY4AHX.mjs';
|
|
7
|
+
import { clsx_default } from './chunk-25W2EQUN.mjs';
|
|
8
|
+
import { useReducer, useState } from 'react';
|
|
9
9
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
10
10
|
|
|
11
11
|
// ../blocks/src/system/runtime/nodes/newsletter-form.client.state.ts
|
|
12
|
+
var initialNewsletterFormSubmissionState = {
|
|
13
|
+
tag: "idle"
|
|
14
|
+
};
|
|
15
|
+
function newsletterFormSubmissionReducer(state, action) {
|
|
16
|
+
switch (action.type) {
|
|
17
|
+
case "submitted":
|
|
18
|
+
if (state.tag === "success") return state;
|
|
19
|
+
return { tag: "submitting" };
|
|
20
|
+
case "failed":
|
|
21
|
+
if (state.tag === "success") return state;
|
|
22
|
+
return { tag: "error", error: action.error };
|
|
23
|
+
case "succeeded":
|
|
24
|
+
return { tag: "success" };
|
|
25
|
+
default:
|
|
26
|
+
return assertNever11(action);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
12
29
|
function newsletterFieldError(fieldId, message) {
|
|
13
30
|
return { kind: "field", fieldId, message };
|
|
14
31
|
}
|
|
@@ -21,69 +38,136 @@ function getNewsletterFieldError(error, fieldId) {
|
|
|
21
38
|
function getNewsletterFormError(error) {
|
|
22
39
|
return error?.kind === "form" ? error.message : null;
|
|
23
40
|
}
|
|
41
|
+
function isNewsletterFormSubmitting(state) {
|
|
42
|
+
return state.tag === "submitting";
|
|
43
|
+
}
|
|
44
|
+
function isNewsletterFormSuccess(state) {
|
|
45
|
+
return state.tag === "success";
|
|
46
|
+
}
|
|
47
|
+
function getNewsletterSubmissionFieldError(state, fieldId) {
|
|
48
|
+
return state.tag === "error" ? getNewsletterFieldError(state.error, fieldId) : null;
|
|
49
|
+
}
|
|
50
|
+
function getNewsletterSubmissionFormError(state) {
|
|
51
|
+
return state.tag === "error" ? getNewsletterFormError(state.error) : null;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// ../blocks/src/system/runtime/nodes/newsletter-form.submission.ts
|
|
55
|
+
function mapNewsletterFormFieldsToSubscriberInput(fields) {
|
|
56
|
+
return {
|
|
57
|
+
email: readSubmittedText(fields.email),
|
|
58
|
+
firstName: readOptionalSubmittedText(fields.firstName),
|
|
59
|
+
lastName: readOptionalSubmittedText(fields.lastName),
|
|
60
|
+
name: readOptionalSubmittedText(fields.name),
|
|
61
|
+
company: readOptionalSubmittedText(fields.company),
|
|
62
|
+
phone: readOptionalSubmittedText(fields.phone),
|
|
63
|
+
honeypot: readSubmittedText(fields.website)
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
function resolveNewsletterSubmitTarget(input) {
|
|
67
|
+
const listId = input.listId?.trim();
|
|
68
|
+
if (input.destinationRef) {
|
|
69
|
+
return {
|
|
70
|
+
tag: "ready",
|
|
71
|
+
target: {
|
|
72
|
+
tag: "published_block_ref",
|
|
73
|
+
destinationRef: input.destinationRef
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
if (!listId) {
|
|
78
|
+
return { tag: "unavailable", reason: "missing_legacy_list" };
|
|
79
|
+
}
|
|
80
|
+
return {
|
|
81
|
+
tag: "ready",
|
|
82
|
+
target: {
|
|
83
|
+
tag: "legacy_riverbank_list",
|
|
84
|
+
listId,
|
|
85
|
+
destinationRef: input.destinationRef ?? void 0
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
function readOptionalSubmittedText(value) {
|
|
90
|
+
const text = readSubmittedText(value);
|
|
91
|
+
return text.length > 0 ? text : void 0;
|
|
92
|
+
}
|
|
93
|
+
function readSubmittedText(value) {
|
|
94
|
+
return typeof value === "string" ? value.trim() : "";
|
|
95
|
+
}
|
|
24
96
|
function NewsletterFormClient({
|
|
25
97
|
render
|
|
26
98
|
}) {
|
|
27
99
|
const api = useBlockApi();
|
|
28
|
-
const [
|
|
29
|
-
|
|
30
|
-
|
|
100
|
+
const [submissionState, dispatchSubmission] = useReducer(
|
|
101
|
+
newsletterFormSubmissionReducer,
|
|
102
|
+
initialNewsletterFormSubmissionState
|
|
103
|
+
);
|
|
31
104
|
const [altchaSolution, setAltchaSolution] = useState(null);
|
|
32
105
|
const showSpamProtection = render.hydration.spamProtectionEnabled ?? isSpamProtectionEnabled();
|
|
33
106
|
const fields = render.display.fields;
|
|
34
107
|
const parsedTags = typeof render.hydration.tags === "string" ? render.hydration.tags.split(/[;,]/g).map((t) => t.trim()).filter(Boolean) : [];
|
|
35
108
|
const handleSubmit = async (e) => {
|
|
36
109
|
e.preventDefault();
|
|
37
|
-
setError(null);
|
|
38
110
|
const formData = new FormData(e.currentTarget);
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
111
|
+
const submittedFields = mapNewsletterFormFieldsToSubscriberInput({
|
|
112
|
+
email: formData.get("email"),
|
|
113
|
+
firstName: formData.get("firstName"),
|
|
114
|
+
lastName: formData.get("lastName"),
|
|
115
|
+
name: formData.get("name"),
|
|
116
|
+
company: formData.get("company"),
|
|
117
|
+
phone: formData.get("phone"),
|
|
118
|
+
website: formData.get("website")
|
|
119
|
+
});
|
|
120
|
+
if (submittedFields.honeypot) {
|
|
121
|
+
dispatchSubmission({ type: "succeeded" });
|
|
42
122
|
return;
|
|
43
123
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
const phone = formData.get("phone")?.trim() || void 0;
|
|
50
|
-
if (!email) {
|
|
51
|
-
setError(newsletterFieldError("email", "Email is required"));
|
|
124
|
+
if (!submittedFields.email) {
|
|
125
|
+
dispatchSubmission({
|
|
126
|
+
type: "failed",
|
|
127
|
+
error: newsletterFieldError("email", "Email is required")
|
|
128
|
+
});
|
|
52
129
|
return;
|
|
53
130
|
}
|
|
54
|
-
|
|
55
|
-
|
|
131
|
+
const submitTarget = resolveNewsletterSubmitTarget({
|
|
132
|
+
listId: render.hydration.listId,
|
|
133
|
+
destinationRef: render.hydration.destinationRef
|
|
134
|
+
});
|
|
135
|
+
if (submitTarget.tag === "unavailable") {
|
|
136
|
+
dispatchSubmission({
|
|
137
|
+
type: "failed",
|
|
138
|
+
error: newsletterFormError("Newsletter list is not configured")
|
|
139
|
+
});
|
|
56
140
|
return;
|
|
57
141
|
}
|
|
58
|
-
|
|
142
|
+
dispatchSubmission({ type: "submitted" });
|
|
59
143
|
try {
|
|
60
144
|
await api.subscribeNewsletter({
|
|
61
|
-
email,
|
|
62
|
-
firstName,
|
|
63
|
-
lastName,
|
|
64
|
-
name,
|
|
65
|
-
company,
|
|
66
|
-
phone,
|
|
67
|
-
|
|
145
|
+
email: submittedFields.email,
|
|
146
|
+
firstName: submittedFields.firstName,
|
|
147
|
+
lastName: submittedFields.lastName,
|
|
148
|
+
name: submittedFields.name,
|
|
149
|
+
company: submittedFields.company,
|
|
150
|
+
phone: submittedFields.phone,
|
|
151
|
+
target: submitTarget.target,
|
|
68
152
|
tags: parsedTags.length > 0 ? parsedTags : void 0,
|
|
69
|
-
blockId: void 0,
|
|
70
153
|
meta: {
|
|
71
|
-
honeypot,
|
|
154
|
+
honeypot: submittedFields.honeypot,
|
|
72
155
|
altchaSolution
|
|
73
156
|
}
|
|
74
157
|
});
|
|
75
|
-
|
|
158
|
+
dispatchSubmission({ type: "succeeded" });
|
|
76
159
|
} catch (err) {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
160
|
+
dispatchSubmission({
|
|
161
|
+
type: "failed",
|
|
162
|
+
error: newsletterFormError(
|
|
163
|
+
err instanceof Error ? err.message : "Subscription failed. Please try again."
|
|
164
|
+
)
|
|
165
|
+
});
|
|
82
166
|
}
|
|
83
167
|
};
|
|
84
168
|
const renderField = (field) => {
|
|
85
169
|
const inputId = `newsletter_${field.id}`;
|
|
86
|
-
const fieldError =
|
|
170
|
+
const fieldError = getNewsletterSubmissionFieldError(submissionState, field.id);
|
|
87
171
|
const fieldErrorId = `${inputId}-error`;
|
|
88
172
|
const validationProps = getFieldValidationControlProps({
|
|
89
173
|
message: fieldError,
|
|
@@ -104,15 +188,15 @@ function NewsletterFormClient({
|
|
|
104
188
|
placeholder: field.placeholder,
|
|
105
189
|
className: "form-input",
|
|
106
190
|
autoComplete: field.type === "email" ? "email" : void 0,
|
|
107
|
-
disabled:
|
|
191
|
+
disabled: isNewsletterFormSubmitting(submissionState),
|
|
108
192
|
...validationProps
|
|
109
193
|
}
|
|
110
194
|
),
|
|
111
195
|
fieldError && /* @__PURE__ */ jsx(FieldValidationMessage, { id: fieldErrorId, className: "fb-error", children: fieldError })
|
|
112
196
|
] }, field.id);
|
|
113
197
|
};
|
|
114
|
-
const formError =
|
|
115
|
-
if (
|
|
198
|
+
const formError = getNewsletterSubmissionFormError(submissionState);
|
|
199
|
+
if (isNewsletterFormSuccess(submissionState)) {
|
|
116
200
|
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
201
|
}
|
|
118
202
|
return /* @__PURE__ */ jsxs("div", { className: clsx_default("newsletter-form", render.display.className ?? void 0), children: [
|
|
@@ -143,8 +227,8 @@ function NewsletterFormClient({
|
|
|
143
227
|
{
|
|
144
228
|
type: "submit",
|
|
145
229
|
className: themeButtonClassName({ variant: "primary", size: "md" }),
|
|
146
|
-
disabled:
|
|
147
|
-
children:
|
|
230
|
+
disabled: isNewsletterFormSubmitting(submissionState),
|
|
231
|
+
children: isNewsletterFormSubmitting(submissionState) ? "Subscribing..." : render.display.buttonLabel
|
|
148
232
|
}
|
|
149
233
|
) })
|
|
150
234
|
] }),
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { mountShopBlockIsland, ProductDetailClient } from './chunk-
|
|
2
|
-
import './chunk-
|
|
3
|
-
import './chunk-
|
|
4
|
-
import './chunk-
|
|
1
|
+
import { mountShopBlockIsland, ProductDetailClient } from './chunk-ZJZZA5EP.mjs';
|
|
2
|
+
import './chunk-VGLXACVK.mjs';
|
|
3
|
+
import './chunk-7DH35FGA.mjs';
|
|
4
|
+
import './chunk-6N7YRNYU.mjs';
|
|
5
5
|
import './chunk-ZFHRN6W2.mjs';
|
|
6
6
|
import './chunk-L4J5Y62O.mjs';
|
|
7
|
-
import './chunk-
|
|
7
|
+
import './chunk-EY42X22F.mjs';
|
|
8
8
|
import './chunk-3DCJ45Z2.mjs';
|
|
9
|
-
import './chunk-
|
|
10
|
-
import './chunk-
|
|
9
|
+
import './chunk-WBQG7VJA.mjs';
|
|
10
|
+
import './chunk-STJ2NCQM.mjs';
|
|
11
11
|
import './chunk-N7PBWBWQ.mjs';
|
|
12
|
-
import { defineIslandPropsDecoder } from './chunk-
|
|
13
|
-
import './chunk-
|
|
12
|
+
import { defineIslandPropsDecoder } from './chunk-UQFY4AHX.mjs';
|
|
13
|
+
import './chunk-25W2EQUN.mjs';
|
|
14
14
|
|
|
15
15
|
// src/rendering/islands/enhancers/productDetail.tsx
|
|
16
16
|
var decode = defineIslandPropsDecoder("product-detail");
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { mountShopBlockIsland, ProductListClient } from './chunk-
|
|
2
|
-
import './chunk-
|
|
3
|
-
import './chunk-
|
|
4
|
-
import './chunk-
|
|
1
|
+
import { mountShopBlockIsland, ProductListClient } from './chunk-ZJZZA5EP.mjs';
|
|
2
|
+
import './chunk-VGLXACVK.mjs';
|
|
3
|
+
import './chunk-7DH35FGA.mjs';
|
|
4
|
+
import './chunk-6N7YRNYU.mjs';
|
|
5
5
|
import './chunk-ZFHRN6W2.mjs';
|
|
6
6
|
import './chunk-L4J5Y62O.mjs';
|
|
7
|
-
import './chunk-
|
|
7
|
+
import './chunk-EY42X22F.mjs';
|
|
8
8
|
import './chunk-3DCJ45Z2.mjs';
|
|
9
|
-
import './chunk-
|
|
10
|
-
import './chunk-
|
|
9
|
+
import './chunk-WBQG7VJA.mjs';
|
|
10
|
+
import './chunk-STJ2NCQM.mjs';
|
|
11
11
|
import './chunk-N7PBWBWQ.mjs';
|
|
12
|
-
import { defineIslandPropsDecoder } from './chunk-
|
|
13
|
-
import './chunk-
|
|
12
|
+
import { defineIslandPropsDecoder } from './chunk-UQFY4AHX.mjs';
|
|
13
|
+
import './chunk-25W2EQUN.mjs';
|
|
14
14
|
|
|
15
15
|
// src/rendering/islands/enhancers/productList.tsx
|
|
16
16
|
var decode = defineIslandPropsDecoder("product-list");
|