@riverbankcms/sdk 0.140.0 → 0.142.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.
- package/dist/{PreviewEditorSidebar-CUyTzd5z.mjs → PreviewEditorSidebar-Dk6Dt11f.mjs} +24 -15
- package/dist/{PreviewEditorUI-Agkw4v5i.mjs → PreviewEditorUI-D6EQTsCA.mjs} +3 -3
- package/dist/{PreviewQueryProvider-CN0ewic5.mjs → PreviewQueryProvider-CC-EPkyQ.mjs} +1 -1
- package/dist/{SdkPreviewModeRuntime-DdbeAdS8.mjs → SdkPreviewModeRuntime-DH1n4ytY.mjs} +85 -54
- package/dist/{SiteChromeCustomizeContext-CqGOz-Kv.mjs → SiteChromeCustomizeContext-DunIzY0K.mjs} +797 -216
- package/dist/_dts/api/src/billing.d.ts +6 -1
- package/dist/_dts/api/src/bookingConfig.d.ts +1 -1
- package/dist/_dts/api/src/commercePortalEndpoints.d.ts +2 -2
- package/dist/_dts/api/src/contentRuntime.d.ts +12 -31
- package/dist/_dts/api/src/domainConnection.d.ts +4 -0
- package/dist/_dts/api/src/endpoints.d.ts +0 -27
- package/dist/_dts/api/src/footerCompositionContracts.d.ts +25 -0
- package/dist/_dts/api/src/index.d.ts +2 -2
- package/dist/_dts/api/src/launchReadiness.d.ts +1 -0
- package/dist/_dts/api/src/navigation/dashboardSiteNav.d.ts +2 -1
- package/dist/_dts/api/src/publicBookingService.d.ts +1 -0
- package/dist/_dts/api/src/sdkConfig/layout.d.ts +13 -0
- package/dist/_dts/api/src/sdkContracts.d.ts +3 -8
- package/dist/_dts/api/src/siteManagementEndpoints.d.ts +3 -26
- package/dist/_dts/api/src/siteOnboarding.d.ts +7 -0
- package/dist/_dts/api/src/sitePlatformEndpoints.d.ts +1 -31
- package/dist/_dts/api/src/siteRuntimeEndpoints.d.ts +6 -1
- package/dist/_dts/billing/src/site-arrangements.d.ts +18 -5
- package/dist/_dts/blocks/src/contracts/proof-block-islands.d.ts +4 -0
- package/dist/_dts/blocks/src/pageRendererContracts.d.ts +2 -0
- package/dist/_dts/blocks/src/system/blocks/events/event-calendar.d.ts +2 -0
- package/dist/_dts/blocks/src/system/blocks/events/eventSelectionFields.d.ts +122 -0
- package/dist/_dts/blocks/src/system/blocks/events/shared/calendarWindow.d.ts +2 -1
- package/dist/_dts/blocks/src/system/blocks/events/shared/eventSelection.d.ts +11 -0
- package/dist/_dts/blocks/src/system/blocks/events/shared/schemas.d.ts +56 -0
- package/dist/_dts/blocks/src/system/blocks/events/shared/types.d.ts +8 -0
- package/dist/_dts/blocks/src/system/blocks/location-map.d.ts +2 -2
- package/dist/_dts/blocks/src/system/blocks/media-text.d.ts +47 -47
- package/dist/_dts/blocks/src/system/data/prefetchBlockData.d.ts +5 -0
- package/dist/_dts/blocks/src/system/data/utils.d.ts +1 -1
- package/dist/_dts/blocks/src/system/manifest/schema.d.ts +27 -1
- package/dist/_dts/blocks/src/system/runtime/components/registry.client.d.ts +12 -180
- package/dist/_dts/blocks/src/system/runtime/components/runtime-backed-blocks.d.ts +6 -90
- package/dist/_dts/blocks/src/system/runtime/hooks/useEventFilters.d.ts +2 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/appointment-services.d.ts +5 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/hooks.d.ts +4 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/hooks.state.d.ts +5 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useDiscountCodeUi.d.ts +3 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useDiscountCodeUi.state.d.ts +10 -3
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventCheckoutHandoffRestore.d.ts +9 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationWizard.d.ts +4 -5
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useSettledCommerceView.d.ts +37 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/events/EventCombined.client.d.ts +4 -3
- package/dist/_dts/blocks/src/system/runtime/nodes/events/EventCombined.interactive.d.ts +3 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/events/EventListing.interactive.d.ts +11 -101
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/eventCollectionContract.d.ts +63 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/listOptions.d.ts +2 -0
- package/dist/_dts/blocks/src/system/transforms/registry/eventCalendar.d.ts +12 -0
- package/dist/_dts/commerce/src/purchase/bookingInstalmentSchedule.d.ts +4 -0
- package/dist/_dts/commerce/src/purchase/stripeCommissionMetadata.d.ts +1 -2
- package/dist/_dts/db/src/generated/supabase/database.types.d.ts +3102 -3122
- package/dist/_dts/editor-blocks/src/block-editor/ColourFieldOptionsProvider.d.ts +7 -0
- package/dist/_dts/editor-blocks/src/block-editor/colourFieldVisibility.d.ts +7 -0
- package/dist/_dts/editor-blocks/src/block-editor/preparedManifest.d.ts +2 -0
- package/dist/_dts/editor-blocks/src/index.d.ts +1 -0
- package/dist/_dts/editor-blocks/src/widgets/site-option-picker/loaders.d.ts +27 -1
- package/dist/_dts/preview-next/src/client/preview/PreviewEditorSidebar.d.ts +2 -2
- package/dist/_dts/preview-next/src/client/preview/PreviewFooterEditorPanel.d.ts +3 -6
- package/dist/_dts/preview-next/src/client/preview/PreviewShell.d.ts +2 -2
- package/dist/_dts/preview-next/src/client/preview/PreviewShellLayout.d.ts +2 -2
- package/dist/_dts/preview-next/src/client/preview/footerInspection.d.ts +16 -0
- package/dist/_dts/preview-next/src/client/preview/sdkConfig.d.ts +6 -0
- package/dist/_dts/sdk/src/config/types.d.ts +2 -18
- package/dist/_dts/sdk/src/config/validation.d.ts +6 -0
- package/dist/_dts/sdk/src/public-api/contracts.d.ts +4 -1
- package/dist/_dts/sdk/src/version.d.ts +1 -1
- package/dist/_dts/theme-core/src/ThemeFontLoader.d.ts +17 -1
- package/dist/_dts/theme-core/src/buttons/affordanceSuppression.d.ts +17 -0
- package/dist/_dts/theme-core/src/buttons/buttonColourContract.d.ts +1 -1
- package/dist/_dts/theme-core/src/buttons/classNames.d.ts +16 -0
- package/dist/_dts/theme-core/src/buttons/generateButtonCss.d.ts +0 -6
- package/dist/_dts/theme-core/src/buttons/resolvedButtonCss.d.ts +4 -4
- package/dist/_dts/theme-core/src/footer/mode.d.ts +10 -1
- package/dist/_dts/theme-core/src/generated/containerResponsiveThemeCss.d.ts +1 -1
- package/dist/_dts/theme-core/src/hosted-booking-appearance.d.ts +54 -12
- package/dist/_dts/theme-core/src/index.d.ts +1 -1
- package/dist/_dts/theme-core/src/schema.d.ts +1 -7
- package/dist/_dts/theme-core/src/site-styles/effectivePageDesign.d.ts +32 -0
- package/dist/_dts/theme-core/src/site-styles/index.d.ts +1 -0
- package/dist/client/{BookingConsentAgreement-CuKa82V4.mjs → BookingConsentAgreement-CnJeq3_r.mjs} +2 -2
- package/dist/client/{DiscountCodeDisclosure-BbYieKWB.mjs → DiscountCodeDisclosure-BINEO6J9.mjs} +1 -1
- package/dist/client/{EventCombined.client-LTfR1Aby.mjs → EventCombined.client-srxNQ6sZ.mjs} +11 -15
- package/dist/client/{EventListing.client-DUHpYSuo.mjs → EventListing.client-DbyVyGkX.mjs} +4 -17
- package/dist/client/{LeafletStaticMap-CHRupL6m.mjs → LeafletStaticMap-B-wpijzL.mjs} +1 -1
- package/dist/client/{accordion-6HiIFxNL.mjs → accordion-B-iUXU7n.mjs} +1 -1
- package/dist/client/{bookingForm-Dlmid43H.mjs → bookingForm-BXYPke5q.mjs} +5 -5
- package/dist/client/bookings.mjs +194 -102
- package/dist/client/{carousel-DmkZRRq_.mjs → carousel-Cr4aj63H.mjs} +1 -1
- package/dist/client/{cart-CIC24330.mjs → cart-DibP9WWa.mjs} +3 -3
- package/dist/client/{checkout-D1Zw9imo.mjs → checkout-CrSBVnL8.mjs} +3 -3
- package/dist/client/client.mjs +643 -192
- package/dist/client/{context-Cy1OayHx.mjs → context-Ces-AgdR.mjs} +1 -1
- package/dist/client/{dates-aDcfoLHr.mjs → dates-BXyNeNhB.mjs} +2 -2
- package/dist/client/{eventCalendar-FQxMPAjf.mjs → eventCalendar-HwpPeqrH.mjs} +11 -7
- package/dist/client/{eventCombined-Dr3ac6Hb.mjs → eventCombined-BpFUkuEI.mjs} +3 -3
- package/dist/client/{eventDetails-D-AzUHFQ.mjs → eventDetails-DK_agiWy.mjs} +4 -4
- package/dist/client/{eventListing-B3XxBf3i.mjs → eventListing-DhzHqP1c.mjs} +3 -3
- package/dist/client/{eventRegistration-I6EaokFD.mjs → eventRegistration-BdQ_Dn2d.mjs} +124 -32
- package/dist/client/{form-BbWckVWY.mjs → form-B1frcuzy.mjs} +2 -2
- package/dist/client/{headerSection-C9qU4Y7x.mjs → headerSection-CT5z460s.mjs} +2 -2
- package/dist/client/hooks.mjs +274 -45
- package/dist/client/{locationMap-CLCShvlG.mjs → locationMap-CIQXB9i2.mjs} +2 -2
- package/dist/client/{newsletterForm-Briukxzi.mjs → newsletterForm-BYNYZSes.mjs} +23 -10
- package/dist/client/{pricing-Copadu-2.mjs → pricing-CbTlAsmt.mjs} +1 -1
- package/dist/client/{productDetail-oujlRd-r.mjs → productDetail-CR7Z3yjS.mjs} +3 -3
- package/dist/client/{productList-BRiIRUcd.mjs → productList-DXj00vzR.mjs} +3 -3
- package/dist/client/{propsDecoder-CB2KS_ko.mjs → propsDecoder-DiLiBdek.mjs} +57 -16
- package/dist/client/rendering/client.mjs +476 -132
- package/dist/client/rendering/islands.mjs +17 -17
- package/dist/client/rendering.mjs +686 -195
- package/dist/client/{scrollToBlock-B1IS1_ua.mjs → scrollToBlock-CrcbBf0h.mjs} +28 -11
- package/dist/client/{shop-Vn6yNFED.mjs → shop-DgqiB_1b.mjs} +6 -6
- package/dist/client/{shop-commerce-BVTqipYp.mjs → shop-commerce-D_J781in.mjs} +5 -5
- package/dist/client/{shop-commerce-store-BVnJVy7v.mjs → shop-commerce-store-PGUbDwqe.mjs} +1 -1
- package/dist/client/{shopShared-COIeK77T.mjs → shopShared-C_Bb2zwG.mjs} +3 -3
- package/dist/client/{useEventFilters-DzIUcS9n.mjs → useEventFilters-CM17Xpr1.mjs} +17 -11
- package/dist/preview-next/before-render.mjs +0 -37
- package/dist/preview-next/client/runtime.mjs +4 -4
- package/dist/preview-next/editor-chrome.css +4 -8
- package/dist/preview-next/keepAlive.mjs +0 -37
- package/dist/preview-next/middleware.mjs +0 -37
- package/dist/{previewAuthStore-Gjb6r6vz.mjs → previewAuthStore-oVttoRDO.mjs} +0 -37
- package/dist/{sdk-runtime-CnCLvZRv.mjs → sdk-runtime-DhmuRhIX.mjs} +2 -2
- package/dist/{separator-DKDRJ1oH.mjs → separator-C3hlg9LH.mjs} +1 -1
- package/dist/server/components.mjs +452 -111
- package/dist/server/config-validation.mjs +263 -40
- package/dist/server/config.mjs +263 -40
- package/dist/server/data.mjs +274 -45
- package/dist/server/index.mjs +1 -38
- package/dist/server/next.mjs +427 -119
- package/dist/server/page-converter.mjs +208 -33
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/rendering/server.mjs +467 -119
- package/dist/server/rendering.mjs +467 -117
- package/dist/server/routing.mjs +301 -50
- package/dist/server/server.mjs +275 -83
- package/dist/server/theme-bridge.mjs +57 -23
- package/dist/server/theme.mjs +11 -9
- package/dist/styles/index.css +28 -2
- package/package.json +1 -1
package/dist/client/hooks.mjs
CHANGED
|
@@ -1439,6 +1439,14 @@ function walkAndCollectImageAttrs(value, out, location = "") {
|
|
|
1439
1439
|
for (const [key, child] of Object.entries(value)) walkAndCollectImageAttrs(child, out, location ? `${location}.${key}` : key);
|
|
1440
1440
|
}
|
|
1441
1441
|
//#endregion
|
|
1442
|
+
//#region ../theme-core/src/footer/mode.ts
|
|
1443
|
+
const footerModeSchema = z.enum([
|
|
1444
|
+
"default",
|
|
1445
|
+
"blocks",
|
|
1446
|
+
"default+blocks",
|
|
1447
|
+
"none"
|
|
1448
|
+
]);
|
|
1449
|
+
//#endregion
|
|
1442
1450
|
//#region ../theme-core/src/lib/media.ts
|
|
1443
1451
|
const hotspotSchema = z.object({
|
|
1444
1452
|
x: z.number().min(0).max(1),
|
|
@@ -2524,7 +2532,7 @@ const BUTTON_CONTRAST_POLICY = {
|
|
|
2524
2532
|
nonTextMinimumRatio: 3,
|
|
2525
2533
|
gradientSamplesPerSegment: 20,
|
|
2526
2534
|
alphaBackgrounds: "reject-without-known-surface",
|
|
2527
|
-
disabled: "
|
|
2535
|
+
disabled: "validated-colour-pair-with-muted-control-opacity"
|
|
2528
2536
|
};
|
|
2529
2537
|
function validateButtonSurfaceContrast(input) {
|
|
2530
2538
|
const ratio = contrastRatio(input.buttonPaint, input.surfaceHex);
|
|
@@ -7480,12 +7488,6 @@ const footerVariant = z.enum([
|
|
|
7480
7488
|
"split"
|
|
7481
7489
|
]);
|
|
7482
7490
|
const footerMaxWidth = z.enum(["container", "full"]);
|
|
7483
|
-
const footerMode = z.enum([
|
|
7484
|
-
"default",
|
|
7485
|
-
"blocks",
|
|
7486
|
-
"default+blocks",
|
|
7487
|
-
"none"
|
|
7488
|
-
]);
|
|
7489
7491
|
const footerNavLayoutMode = z.enum([
|
|
7490
7492
|
"stack",
|
|
7491
7493
|
"inline",
|
|
@@ -7574,9 +7576,9 @@ const footerSchema = z.object({
|
|
|
7574
7576
|
/**
|
|
7575
7577
|
* SDK-only footer rendering mode.
|
|
7576
7578
|
*
|
|
7577
|
-
*
|
|
7579
|
+
* Historical persisted field; SDK rendering mode now lives in layout.footerMode.
|
|
7578
7580
|
*/
|
|
7579
|
-
mode:
|
|
7581
|
+
mode: footerModeSchema.optional(),
|
|
7580
7582
|
variant: footerVariant,
|
|
7581
7583
|
maxWidth: footerMaxWidth,
|
|
7582
7584
|
showLogoText: z.boolean().optional(),
|
|
@@ -8177,6 +8179,15 @@ const publicEventBaseSchema = z.object({
|
|
|
8177
8179
|
timeZone: z.string(),
|
|
8178
8180
|
pricing: publicEventPricingSchema,
|
|
8179
8181
|
paymentTerms: blockBookingPaymentTermsSchema,
|
|
8182
|
+
cancellationPolicy: z.object({ refunds: z.object({
|
|
8183
|
+
mode: z.enum([
|
|
8184
|
+
"never",
|
|
8185
|
+
"always",
|
|
8186
|
+
"cutoff"
|
|
8187
|
+
]),
|
|
8188
|
+
cutoffHours: z.number(),
|
|
8189
|
+
method: z.enum(["original_payment_method", "site_credit"])
|
|
8190
|
+
}) }),
|
|
8180
8191
|
consent: blockBookingConsentSchema.nullable(),
|
|
8181
8192
|
accessRestriction: accessRestrictionSchema,
|
|
8182
8193
|
allowedCategoryIds: z.array(z.string()),
|
|
@@ -8349,6 +8360,7 @@ const calendarWindowQuerySchema = z.object({
|
|
|
8349
8360
|
eventSurface: z.enum(eventSurfaceScopeValues).optional(),
|
|
8350
8361
|
eventPresets: z.string().optional(),
|
|
8351
8362
|
scheduleScope: z.enum(eventScheduleScopeValues).optional(),
|
|
8363
|
+
seriesIds: z.string().optional(),
|
|
8352
8364
|
categoryIds: z.string().optional(),
|
|
8353
8365
|
venueId: z.string().transform(normalizeCalendarFilterId).optional(),
|
|
8354
8366
|
staffMemberId: z.string().transform(normalizeCalendarFilterId).optional()
|
|
@@ -17016,6 +17028,7 @@ function isDisplayMediaKind(kind) {
|
|
|
17016
17028
|
}
|
|
17017
17029
|
const siteOptionSources = [
|
|
17018
17030
|
"eventCategories",
|
|
17031
|
+
"eventSeries",
|
|
17019
17032
|
"venues",
|
|
17020
17033
|
"staffMembers"
|
|
17021
17034
|
];
|
|
@@ -29712,7 +29725,8 @@ const appointmentServicesBlockDefinition = {
|
|
|
29712
29725
|
el("appointment-services", {
|
|
29713
29726
|
sectionHeading: { $bind: { from: "content.heading" } },
|
|
29714
29727
|
services: { $bind: { from: "data.services" } },
|
|
29715
|
-
pathname: { $bind: { from: "$root.pathname" } }
|
|
29728
|
+
pathname: { $bind: { from: "$root.pathname" } },
|
|
29729
|
+
servicePathPrefix: { $bind: { from: "$root.appointmentServicePathPrefix" } }
|
|
29716
29730
|
})
|
|
29717
29731
|
], { gap: "lg" })
|
|
29718
29732
|
})]
|
|
@@ -31253,6 +31267,35 @@ const eventSpotlightBlockDefinition = {
|
|
|
31253
31267
|
} }
|
|
31254
31268
|
};
|
|
31255
31269
|
//#endregion
|
|
31270
|
+
//#region ../blocks/src/system/blocks/events/shared/eventSelection.ts
|
|
31271
|
+
/** Invalid saved selections fail closed rather than widening discovery. */
|
|
31272
|
+
function resolveEventSelection(mode, value) {
|
|
31273
|
+
if (mode !== "selected") return { kind: "matching" };
|
|
31274
|
+
const candidates = Array.isArray(value) ? value : typeof value === "string" ? value.split(",").filter(Boolean) : [];
|
|
31275
|
+
const ids = [];
|
|
31276
|
+
for (const candidate of candidates) {
|
|
31277
|
+
if (typeof candidate !== "string") return {
|
|
31278
|
+
kind: "selected",
|
|
31279
|
+
seriesIds: []
|
|
31280
|
+
};
|
|
31281
|
+
const parsed = parseEventSeriesId(candidate.trim());
|
|
31282
|
+
if (!parsed.ok) return {
|
|
31283
|
+
kind: "selected",
|
|
31284
|
+
seriesIds: []
|
|
31285
|
+
};
|
|
31286
|
+
ids.push(parsed.value);
|
|
31287
|
+
}
|
|
31288
|
+
return {
|
|
31289
|
+
kind: "selected",
|
|
31290
|
+
seriesIds: [...new Set(ids)].sort()
|
|
31291
|
+
};
|
|
31292
|
+
}
|
|
31293
|
+
/** Undefined means discovery; an empty string is an explicitly empty selection. */
|
|
31294
|
+
function eventSeriesScopeCsv(value) {
|
|
31295
|
+
if (value == null) return void 0;
|
|
31296
|
+
return typeof value === "string" ? value : value.join(",");
|
|
31297
|
+
}
|
|
31298
|
+
//#endregion
|
|
31256
31299
|
//#region ../blocks/src/system/runtime/nodes/events/shared/listingLayout.ts
|
|
31257
31300
|
/**
|
|
31258
31301
|
* Layout classes for event listing containers and cards. Presentation
|
|
@@ -31352,6 +31395,7 @@ const eventCollectionFilterSourceSchemaShape = {
|
|
|
31352
31395
|
eventSurface: eventSurfaceScopeSchema$1.nullable().optional(),
|
|
31353
31396
|
filterEventPresets: z.union([z.string(), z.array(z.string())]).nullable().optional(),
|
|
31354
31397
|
scheduleScope: eventScheduleScopeSchema$1.nullable().optional(),
|
|
31398
|
+
seriesIds: z.union([z.string(), z.array(z.string())]).nullable().optional(),
|
|
31355
31399
|
filterCategoryIds: z.union([z.string(), z.array(z.string())]).nullable().optional(),
|
|
31356
31400
|
filterStaffMemberId: z.string().nullable().optional(),
|
|
31357
31401
|
filterVenueId: z.string().nullable().optional()
|
|
@@ -31398,6 +31442,7 @@ const eventCollectionDisplaySchemaShape = {
|
|
|
31398
31442
|
eventSurface: eventSurfaceScopeSchema$1,
|
|
31399
31443
|
filterEventPresets: z.string().nullable(),
|
|
31400
31444
|
scheduleScope: eventScheduleScopeSchema$1,
|
|
31445
|
+
seriesIds: z.string().nullable().optional(),
|
|
31401
31446
|
filterCategoryIds: z.string().nullable(),
|
|
31402
31447
|
filterStaffMemberId: z.string().nullable(),
|
|
31403
31448
|
filterVenueId: z.string().nullable(),
|
|
@@ -31445,11 +31490,15 @@ function buildEventCollectionDisplay(source) {
|
|
|
31445
31490
|
};
|
|
31446
31491
|
}
|
|
31447
31492
|
function buildEventCollectionFilterDisplay(source) {
|
|
31448
|
-
|
|
31449
|
-
|
|
31450
|
-
|
|
31451
|
-
|
|
31452
|
-
|
|
31493
|
+
const selected = source.seriesIds != null;
|
|
31494
|
+
const matchingFilters = selected ? {
|
|
31495
|
+
eventSurface: "all",
|
|
31496
|
+
filterEventPresets: null,
|
|
31497
|
+
scheduleScope: "any",
|
|
31498
|
+
filterCategoryIds: null,
|
|
31499
|
+
filterStaffMemberId: null,
|
|
31500
|
+
filterVenueId: null
|
|
31501
|
+
} : {
|
|
31453
31502
|
eventSurface: normalizeEventSurfaceScope(source.eventSurface),
|
|
31454
31503
|
filterEventPresets: normalizeEventSurfacePresetsCsv(source.filterEventPresets),
|
|
31455
31504
|
scheduleScope: normalizeEventScheduleScope(source.scheduleScope),
|
|
@@ -31457,6 +31506,14 @@ function buildEventCollectionFilterDisplay(source) {
|
|
|
31457
31506
|
filterStaffMemberId: normalizeEventStaffMemberId(source.filterStaffMemberId),
|
|
31458
31507
|
filterVenueId: normalizeEventVenueId(source.filterVenueId)
|
|
31459
31508
|
};
|
|
31509
|
+
return {
|
|
31510
|
+
seriesIds: eventSeriesScopeCsv(source.seriesIds),
|
|
31511
|
+
showFilters: selected ? false : source.showFilters ?? true,
|
|
31512
|
+
showCategoryFilter: source.showCategoryFilter ?? "auto",
|
|
31513
|
+
showVenueFilter: source.showVenueFilter ?? false,
|
|
31514
|
+
showStaffFilter: source.showStaffFilter ?? true,
|
|
31515
|
+
...matchingFilters
|
|
31516
|
+
};
|
|
31460
31517
|
}
|
|
31461
31518
|
function buildEventCollectionPresentationDisplay(source) {
|
|
31462
31519
|
return {
|
|
@@ -31471,14 +31528,15 @@ function buildEventCollectionPresentationDisplay(source) {
|
|
|
31471
31528
|
}
|
|
31472
31529
|
function buildEventCollectionHydration(source, now = /* @__PURE__ */ new Date()) {
|
|
31473
31530
|
const timeZone = source.calendarWindow?.scope.timeZone ?? toBookingTimeZone(source.bookingTimeZone);
|
|
31531
|
+
const selected = source.seriesIds != null;
|
|
31474
31532
|
return {
|
|
31475
31533
|
calendarWindow: source.calendarWindow ?? void 0,
|
|
31476
31534
|
siteId: source.siteId,
|
|
31477
31535
|
stage: source.stage,
|
|
31478
31536
|
prefetchedEvents: source.events != null,
|
|
31479
|
-
eventSurface: normalizeEventSurfaceScope(source.eventSurface),
|
|
31480
|
-
filterEventPresets: normalizeEventSurfacePresetsCsv(source.filterEventPresets),
|
|
31481
|
-
scheduleScope: normalizeEventScheduleScope(source.scheduleScope),
|
|
31537
|
+
eventSurface: selected ? "all" : normalizeEventSurfaceScope(source.eventSurface),
|
|
31538
|
+
filterEventPresets: selected ? null : normalizeEventSurfacePresetsCsv(source.filterEventPresets),
|
|
31539
|
+
scheduleScope: selected ? "any" : normalizeEventScheduleScope(source.scheduleScope),
|
|
31482
31540
|
calendarContext: {
|
|
31483
31541
|
timeZone,
|
|
31484
31542
|
initialToday: source.calendarWindow?.initialToday ?? getLocalScheduleDate(now, timeZone)
|
|
@@ -31544,6 +31602,7 @@ const eventListingHydrationSchema = z.object({
|
|
|
31544
31602
|
eventSurface: eventSurfaceScopeSchema,
|
|
31545
31603
|
filterEventPresets: z.string().nullable(),
|
|
31546
31604
|
scheduleScope: eventScheduleScopeSchema,
|
|
31605
|
+
seriesIds: z.string().nullable().optional(),
|
|
31547
31606
|
filterCategoryIds: z.string().nullable().optional(),
|
|
31548
31607
|
filterStaffMemberId: z.string().nullable().optional(),
|
|
31549
31608
|
filterVenueId: z.string().nullable().optional(),
|
|
@@ -31604,6 +31663,7 @@ const eventListingBlockRuntime = defineProgressiveBlockRuntime({
|
|
|
31604
31663
|
eventSurface: normalizeEventSurfaceScope(source.eventSurface),
|
|
31605
31664
|
filterEventPresets: normalizeEventSurfacePresetsCsv(source.filterEventPresets),
|
|
31606
31665
|
scheduleScope: normalizeEventScheduleScope(source.scheduleScope),
|
|
31666
|
+
seriesIds: eventSeriesScopeCsv(source.seriesIds),
|
|
31607
31667
|
filterCategoryIds: normalizeEventCategoryIdsCsv(source.filterCategoryIds),
|
|
31608
31668
|
filterStaffMemberId: normalizeEventStaffMemberId(source.filterStaffMemberId),
|
|
31609
31669
|
filterVenueId: normalizeEventVenueId(source.filterVenueId),
|
|
@@ -31977,6 +32037,65 @@ const eventListingBlockDefinition = {
|
|
|
31977
32037
|
} }
|
|
31978
32038
|
};
|
|
31979
32039
|
//#endregion
|
|
32040
|
+
//#region ../blocks/src/system/blocks/events/eventSelectionFields.ts
|
|
32041
|
+
const eventSelectionFields = [{
|
|
32042
|
+
id: "eventSelection",
|
|
32043
|
+
type: "select",
|
|
32044
|
+
label: "Events to show",
|
|
32045
|
+
required: false,
|
|
32046
|
+
multiple: false,
|
|
32047
|
+
defaultValue: "matching",
|
|
32048
|
+
options: [{
|
|
32049
|
+
value: "matching",
|
|
32050
|
+
label: "All matching events"
|
|
32051
|
+
}, {
|
|
32052
|
+
value: "selected",
|
|
32053
|
+
label: "Selected events"
|
|
32054
|
+
}],
|
|
32055
|
+
ui: { intent: "behavior" }
|
|
32056
|
+
}, createSiteOptionSelectField({
|
|
32057
|
+
id: "selectedEventSeriesIds",
|
|
32058
|
+
label: "Selected events",
|
|
32059
|
+
description: "Show upcoming dates for these events. Other event filters do not apply.",
|
|
32060
|
+
required: false,
|
|
32061
|
+
multiple: true,
|
|
32062
|
+
defaultValue: [],
|
|
32063
|
+
optionSource: "eventSeries",
|
|
32064
|
+
ui: {
|
|
32065
|
+
intent: "behavior",
|
|
32066
|
+
searchThreshold: 1,
|
|
32067
|
+
visibleWhen: {
|
|
32068
|
+
field: "eventSelection",
|
|
32069
|
+
equals: "selected"
|
|
32070
|
+
}
|
|
32071
|
+
}
|
|
32072
|
+
})];
|
|
32073
|
+
function withEventSelectionVisibility(field) {
|
|
32074
|
+
if (![
|
|
32075
|
+
"eventSurface",
|
|
32076
|
+
"filterEventPresets",
|
|
32077
|
+
"scheduleScope",
|
|
32078
|
+
"filterCategoryIds",
|
|
32079
|
+
"filterStaffMemberId",
|
|
32080
|
+
"filterVenueId",
|
|
32081
|
+
"showFilters",
|
|
32082
|
+
"showCategoryFilter",
|
|
32083
|
+
"showVenueFilter",
|
|
32084
|
+
"showStaffFilter"
|
|
32085
|
+
].includes(field.id)) return field;
|
|
32086
|
+
const visibleWhen = field.ui?.visibleWhen;
|
|
32087
|
+
return {
|
|
32088
|
+
...field,
|
|
32089
|
+
ui: {
|
|
32090
|
+
...field.ui,
|
|
32091
|
+
visibleWhen: { allOf: [{
|
|
32092
|
+
field: "eventSelection",
|
|
32093
|
+
notEquals: "selected"
|
|
32094
|
+
}, ...visibleWhen ? [visibleWhen] : []] }
|
|
32095
|
+
}
|
|
32096
|
+
};
|
|
32097
|
+
}
|
|
32098
|
+
//#endregion
|
|
31980
32099
|
//#region ../blocks/src/system/runtime/nodes/events/EventCalendar.interactive.ts
|
|
31981
32100
|
const eventCalendarSourceSchema = z.object({
|
|
31982
32101
|
...eventCollectionSourceSchemaShape,
|
|
@@ -32059,19 +32178,59 @@ const eventCalendarBlockRuntime = defineProgressiveBlockRuntime({
|
|
|
32059
32178
|
//#region ../blocks/src/system/blocks/events/eventCalendarDataLoaders.ts
|
|
32060
32179
|
const scopeParams = {
|
|
32061
32180
|
siteId: { $bind: { from: "$root.siteId" } },
|
|
32181
|
+
seriesIds: { $bind: {
|
|
32182
|
+
from: "content",
|
|
32183
|
+
transforms: [{
|
|
32184
|
+
id: "events.calendarSelectionParam",
|
|
32185
|
+
options: { key: "seriesIds" }
|
|
32186
|
+
}]
|
|
32187
|
+
} },
|
|
32062
32188
|
stage: { $bind: {
|
|
32063
32189
|
from: "$root.previewStage",
|
|
32064
32190
|
fallback: "published"
|
|
32065
32191
|
} },
|
|
32066
|
-
eventSurface: { $bind: {
|
|
32192
|
+
eventSurface: { $bind: {
|
|
32193
|
+
from: "content",
|
|
32194
|
+
transforms: [{
|
|
32195
|
+
id: "events.calendarSelectionParam",
|
|
32196
|
+
options: { key: "eventSurface" }
|
|
32197
|
+
}, { id: "value.csv" }]
|
|
32198
|
+
} },
|
|
32067
32199
|
eventPresets: { $bind: {
|
|
32068
|
-
from: "content
|
|
32069
|
-
transforms: [{
|
|
32200
|
+
from: "content",
|
|
32201
|
+
transforms: [{
|
|
32202
|
+
id: "events.calendarSelectionParam",
|
|
32203
|
+
options: { key: "filterEventPresets" }
|
|
32204
|
+
}, { id: "value.csv" }]
|
|
32070
32205
|
} },
|
|
32071
|
-
scheduleScope: { $bind: {
|
|
32072
|
-
|
|
32073
|
-
|
|
32074
|
-
|
|
32206
|
+
scheduleScope: { $bind: {
|
|
32207
|
+
from: "content",
|
|
32208
|
+
transforms: [{
|
|
32209
|
+
id: "events.calendarSelectionParam",
|
|
32210
|
+
options: { key: "scheduleScope" }
|
|
32211
|
+
}, { id: "value.csv" }]
|
|
32212
|
+
} },
|
|
32213
|
+
categoryIds: { $bind: {
|
|
32214
|
+
from: "content",
|
|
32215
|
+
transforms: [{
|
|
32216
|
+
id: "events.calendarSelectionParam",
|
|
32217
|
+
options: { key: "filterCategoryIds" }
|
|
32218
|
+
}, { id: "value.csv" }]
|
|
32219
|
+
} },
|
|
32220
|
+
staffMemberId: { $bind: {
|
|
32221
|
+
from: "content",
|
|
32222
|
+
transforms: [{
|
|
32223
|
+
id: "events.calendarSelectionParam",
|
|
32224
|
+
options: { key: "filterStaffMemberId" }
|
|
32225
|
+
}, { id: "value.csv" }]
|
|
32226
|
+
} },
|
|
32227
|
+
venueId: { $bind: {
|
|
32228
|
+
from: "content",
|
|
32229
|
+
transforms: [{
|
|
32230
|
+
id: "events.calendarSelectionParam",
|
|
32231
|
+
options: { key: "filterVenueId" }
|
|
32232
|
+
}, { id: "value.csv" }]
|
|
32233
|
+
} }
|
|
32075
32234
|
};
|
|
32076
32235
|
/** Combined renders two jobs; calendar-only variants never pay for the list seed. */
|
|
32077
32236
|
const eventCalendarDataLoaders = {
|
|
@@ -32201,6 +32360,13 @@ const eventCalendarLayout = [styledSection({
|
|
|
32201
32360
|
from: "content.defaultCalendarView",
|
|
32202
32361
|
fallback: "month"
|
|
32203
32362
|
} },
|
|
32363
|
+
seriesIds: { $bind: {
|
|
32364
|
+
from: "content",
|
|
32365
|
+
transforms: [{
|
|
32366
|
+
id: "events.calendarSelectionParam",
|
|
32367
|
+
options: { key: "seriesIds" }
|
|
32368
|
+
}]
|
|
32369
|
+
} },
|
|
32204
32370
|
showFilters: { $bind: {
|
|
32205
32371
|
from: "content.showFilters",
|
|
32206
32372
|
fallback: true
|
|
@@ -32222,17 +32388,47 @@ const eventCalendarLayout = [styledSection({
|
|
|
32222
32388
|
fallback: true
|
|
32223
32389
|
} },
|
|
32224
32390
|
eventSurface: { $bind: {
|
|
32225
|
-
from: "content
|
|
32226
|
-
|
|
32391
|
+
from: "content",
|
|
32392
|
+
transforms: [{
|
|
32393
|
+
id: "events.calendarSelectionParam",
|
|
32394
|
+
options: { key: "eventSurface" }
|
|
32395
|
+
}]
|
|
32396
|
+
} },
|
|
32397
|
+
filterEventPresets: { $bind: {
|
|
32398
|
+
from: "content",
|
|
32399
|
+
transforms: [{
|
|
32400
|
+
id: "events.calendarSelectionParam",
|
|
32401
|
+
options: { key: "filterEventPresets" }
|
|
32402
|
+
}]
|
|
32227
32403
|
} },
|
|
32228
|
-
filterEventPresets: { $bind: { from: "content.filterEventPresets" } },
|
|
32229
32404
|
scheduleScope: { $bind: {
|
|
32230
|
-
from: "content
|
|
32231
|
-
|
|
32405
|
+
from: "content",
|
|
32406
|
+
transforms: [{
|
|
32407
|
+
id: "events.calendarSelectionParam",
|
|
32408
|
+
options: { key: "scheduleScope" }
|
|
32409
|
+
}]
|
|
32410
|
+
} },
|
|
32411
|
+
filterCategoryIds: { $bind: {
|
|
32412
|
+
from: "content",
|
|
32413
|
+
transforms: [{
|
|
32414
|
+
id: "events.calendarSelectionParam",
|
|
32415
|
+
options: { key: "filterCategoryIds" }
|
|
32416
|
+
}]
|
|
32417
|
+
} },
|
|
32418
|
+
filterStaffMemberId: { $bind: {
|
|
32419
|
+
from: "content",
|
|
32420
|
+
transforms: [{
|
|
32421
|
+
id: "events.calendarSelectionParam",
|
|
32422
|
+
options: { key: "filterStaffMemberId" }
|
|
32423
|
+
}]
|
|
32424
|
+
} },
|
|
32425
|
+
filterVenueId: { $bind: {
|
|
32426
|
+
from: "content",
|
|
32427
|
+
transforms: [{
|
|
32428
|
+
id: "events.calendarSelectionParam",
|
|
32429
|
+
options: { key: "filterVenueId" }
|
|
32430
|
+
}]
|
|
32232
32431
|
} },
|
|
32233
|
-
filterCategoryIds: { $bind: { from: "content.filterCategoryIds" } },
|
|
32234
|
-
filterStaffMemberId: { $bind: { from: "content.filterStaffMemberId" } },
|
|
32235
|
-
filterVenueId: { $bind: { from: "content.filterVenueId" } },
|
|
32236
32432
|
cardRole: { $bind: {
|
|
32237
32433
|
from: "content._cardStyles.role",
|
|
32238
32434
|
fallback: "default"
|
|
@@ -32736,6 +32932,7 @@ const eventCalendarAdditionalFields = [
|
|
|
32736
32932
|
}
|
|
32737
32933
|
}
|
|
32738
32934
|
},
|
|
32935
|
+
...eventSelectionFields,
|
|
32739
32936
|
{
|
|
32740
32937
|
id: "eventSurface",
|
|
32741
32938
|
type: "select",
|
|
@@ -32945,7 +33142,7 @@ const eventCalendarBlockDefinition = {
|
|
|
32945
33142
|
titleSource: "heading",
|
|
32946
33143
|
description: "Display events with calendar, list, or combined views with filtering",
|
|
32947
33144
|
skipSectionStyles: true,
|
|
32948
|
-
additionalFields: eventCalendarAdditionalFields,
|
|
33145
|
+
additionalFields: eventCalendarAdditionalFields.map(withEventSelectionVisibility),
|
|
32949
33146
|
styleTokens: {
|
|
32950
33147
|
background: "surface",
|
|
32951
33148
|
typography: "body",
|
|
@@ -39604,6 +39801,26 @@ const linksTransforms = [{
|
|
|
39604
39801
|
}
|
|
39605
39802
|
}];
|
|
39606
39803
|
const defaultTransforms = createTransformRegistry([
|
|
39804
|
+
{
|
|
39805
|
+
id: "events.calendarSelectionParam",
|
|
39806
|
+
kind: "formatter",
|
|
39807
|
+
summary: "Resolve selected events instead of discovery filters",
|
|
39808
|
+
schema: z.object({ key: z.enum([
|
|
39809
|
+
"seriesIds",
|
|
39810
|
+
"eventSurface",
|
|
39811
|
+
"filterEventPresets",
|
|
39812
|
+
"scheduleScope",
|
|
39813
|
+
"filterCategoryIds",
|
|
39814
|
+
"filterStaffMemberId",
|
|
39815
|
+
"filterVenueId"
|
|
39816
|
+
]) }),
|
|
39817
|
+
run(value, { key }) {
|
|
39818
|
+
const content = asPartialObject(value) ?? {};
|
|
39819
|
+
const selection = resolveEventSelection(content.eventSelection, content.selectedEventSeriesIds);
|
|
39820
|
+
if (selection.kind === "selected") return key === "seriesIds" ? selection.seriesIds : void 0;
|
|
39821
|
+
return key === "seriesIds" ? void 0 : content[key];
|
|
39822
|
+
}
|
|
39823
|
+
},
|
|
39607
39824
|
{
|
|
39608
39825
|
id: "events.calendarReadEnabled",
|
|
39609
39826
|
kind: "formatter",
|
|
@@ -39918,12 +40135,12 @@ function normalizeContent(block) {
|
|
|
39918
40135
|
}
|
|
39919
40136
|
/**
|
|
39920
40137
|
* Normalize params for API calls.
|
|
39921
|
-
* Converts
|
|
40138
|
+
* Converts supplied values to strings, preserving absent versus explicitly empty params.
|
|
39922
40139
|
*/
|
|
39923
40140
|
function normalizeParams(input) {
|
|
39924
40141
|
if (!input || typeof input !== "object") return {};
|
|
39925
40142
|
const output = {};
|
|
39926
|
-
for (const [key, value] of Object.entries(input)) output[key] = coerceToString(value);
|
|
40143
|
+
for (const [key, value] of Object.entries(input)) if (value !== void 0 && value !== null) output[key] = coerceToString(value);
|
|
39927
40144
|
return output;
|
|
39928
40145
|
}
|
|
39929
40146
|
function isNonArrayObject(value) {
|
|
@@ -39987,6 +40204,14 @@ function coercePayload(payload) {
|
|
|
39987
40204
|
* - Frontend: provide internal API client
|
|
39988
40205
|
* - SDK: provide SDK client with endpoint mapping
|
|
39989
40206
|
*/
|
|
40207
|
+
function projectDataLoaders(loaders, shouldLoad, blockId, blockKind) {
|
|
40208
|
+
if (!shouldLoad) return [...loaders];
|
|
40209
|
+
return loaders.filter(({ key }) => shouldLoad({
|
|
40210
|
+
blockId,
|
|
40211
|
+
blockKind,
|
|
40212
|
+
loaderKey: key
|
|
40213
|
+
}));
|
|
40214
|
+
}
|
|
39990
40215
|
function shouldSkipResolvedLoader(input) {
|
|
39991
40216
|
if (input.loader.requiredParams?.some((param) => !input.params[param]?.trim())) return true;
|
|
39992
40217
|
return Boolean(input.isValidEndpoint && !input.isValidEndpoint(input.endpoint));
|
|
@@ -40015,7 +40240,7 @@ async function prefetchBlockData$1(page, context, options) {
|
|
|
40015
40240
|
return (await prefetchBlockDataWithFailures(page, context, options)).resolvedData;
|
|
40016
40241
|
}
|
|
40017
40242
|
async function prefetchBlockDataWithFailures(page, context, options) {
|
|
40018
|
-
const { apiClient, isValidEndpoint, onError, getCustomBlockLoaders, getBlockDefinition: getBlockDefinition$1 = getBlockDefinition, resolveParamsBindings: resolveParamsBindings$1 = resolveParamsBindings } = options;
|
|
40243
|
+
const { apiClient, isValidEndpoint, onError, getCustomBlockLoaders, getBlockDefinition: getBlockDefinition$1 = getBlockDefinition, resolveParamsBindings: resolveParamsBindings$1 = resolveParamsBindings, shouldLoad } = options;
|
|
40019
40244
|
const results = {};
|
|
40020
40245
|
const loaderFailures = {};
|
|
40021
40246
|
const tasks = [];
|
|
@@ -40032,6 +40257,7 @@ async function prefetchBlockDataWithFailures(page, context, options) {
|
|
|
40032
40257
|
loader
|
|
40033
40258
|
})) : [];
|
|
40034
40259
|
} else loaders = [];
|
|
40260
|
+
loaders = projectDataLoaders(loaders, shouldLoad, blockId, block.kind);
|
|
40035
40261
|
if (loaders.length === 0) continue;
|
|
40036
40262
|
const root = {
|
|
40037
40263
|
...context.root ?? {},
|
|
@@ -40110,8 +40336,8 @@ function toStringParams(value) {
|
|
|
40110
40336
|
for (const [k, v] of Object.entries(value)) if (typeof v === "string") out[k] = v;
|
|
40111
40337
|
return out;
|
|
40112
40338
|
}
|
|
40113
|
-
function stripEmptyStringValues(params) {
|
|
40114
|
-
for (const [key, value] of Object.entries(params)) if (value === "") delete params[key];
|
|
40339
|
+
function stripEmptyStringValues(params, endpoint) {
|
|
40340
|
+
for (const [key, value] of Object.entries(params)) if (value === "" && !(key === "seriesIds" && (endpoint === "listPublicEvents" || endpoint === "listPublicEventCalendarWindow"))) delete params[key];
|
|
40115
40341
|
}
|
|
40116
40342
|
function ensureSiteId(params, context) {
|
|
40117
40343
|
if (!params.siteId && typeof context.siteId === "string" && context.siteId) params.siteId = context.siteId;
|
|
@@ -40124,7 +40350,7 @@ function ensureSiteId(params, context) {
|
|
|
40124
40350
|
*/
|
|
40125
40351
|
function normalizeLoaderParams(endpoint, params, context) {
|
|
40126
40352
|
const out = toStringParams(params);
|
|
40127
|
-
stripEmptyStringValues(out);
|
|
40353
|
+
stripEmptyStringValues(out, endpoint);
|
|
40128
40354
|
if (endpoint === "getPublicFormById") {
|
|
40129
40355
|
ensureSiteId(out, context);
|
|
40130
40356
|
if (!out.formId && out.formSlug) {
|
|
@@ -40341,11 +40567,14 @@ const sdkSiteStyleConfigSchema = z.object({
|
|
|
40341
40567
|
sectionOptions: sdkSectionOptionsConfigSchema.optional(),
|
|
40342
40568
|
containerOptions: sdkContainerOptionsConfigSchema.optional()
|
|
40343
40569
|
});
|
|
40344
|
-
const sdkSiteLayoutConfigSchema = z.object({
|
|
40345
|
-
|
|
40346
|
-
|
|
40347
|
-
|
|
40348
|
-
|
|
40570
|
+
const sdkSiteLayoutConfigSchema = z.object({
|
|
40571
|
+
footerMode: footerModeSchema.optional(),
|
|
40572
|
+
footerBlocks: z.array(z.object({
|
|
40573
|
+
id: z.string().min(1).optional(),
|
|
40574
|
+
kind: z.string().min(1),
|
|
40575
|
+
content: z.record(z.string(), z.unknown()).optional()
|
|
40576
|
+
})).optional()
|
|
40577
|
+
});
|
|
40349
40578
|
const sdkFieldSelectOptionSchema = z.object({
|
|
40350
40579
|
value: z.string(),
|
|
40351
40580
|
label: z.string()
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { i as textColorStyle } from "./colorStyles-3013aRAY.mjs";
|
|
2
|
-
import { dt as themeButtonClassName, t as defineIslandPropsDecoder } from "./propsDecoder-
|
|
2
|
+
import { dt as themeButtonClassName, t as defineIslandPropsDecoder } from "./propsDecoder-DiLiBdek.mjs";
|
|
3
3
|
import { t as mountReactIsland } from "./reactMount-SY8AVRof.mjs";
|
|
4
|
-
import { t as LeafletStaticMap } from "./LeafletStaticMap-
|
|
4
|
+
import { t as LeafletStaticMap } from "./LeafletStaticMap-B-wpijzL.mjs";
|
|
5
5
|
import "react";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
//#region ../core/src/location.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { O as clsx } from "./colorStyles-3013aRAY.mjs";
|
|
3
|
-
import { Pt as assertNever, Ut as parseMailingListVisitorSelection, dt as themeButtonClassName, mn as assertNever$1, t as defineIslandPropsDecoder } from "./propsDecoder-
|
|
4
|
-
import { n as useBlockApi, r as BlockApiError, t as BlockApiProvider } from "./context-
|
|
3
|
+
import { Pt as assertNever, Ut as parseMailingListVisitorSelection, dt as themeButtonClassName, mn as assertNever$1, t as defineIslandPropsDecoder } from "./propsDecoder-DiLiBdek.mjs";
|
|
4
|
+
import { n as useBlockApi, r as BlockApiError, t as BlockApiProvider } from "./context-Ces-AgdR.mjs";
|
|
5
5
|
import { n as isSpamProtectionEnabled, r as AltchaWidget, t as getChallengeUrl } from "./src-B833rYRr.mjs";
|
|
6
6
|
import { t as FeedbackMessage } from "./FeedbackMessage-CtLvvS_d.mjs";
|
|
7
7
|
import { n as getFieldValidationControlProps, t as FieldValidationMessage } from "./FieldValidationMessage-AYanWFb-.mjs";
|
|
@@ -145,7 +145,7 @@ function NewsletterFormClient({ render }) {
|
|
|
145
145
|
if (submitTarget.tag === "unavailable") {
|
|
146
146
|
dispatchSubmission({
|
|
147
147
|
type: "failed",
|
|
148
|
-
error: newsletterFormError(
|
|
148
|
+
error: newsletterFormError(SIGNUPS_PAUSED_MESSAGE)
|
|
149
149
|
});
|
|
150
150
|
return;
|
|
151
151
|
}
|
|
@@ -156,14 +156,16 @@ function NewsletterFormClient({ render }) {
|
|
|
156
156
|
});
|
|
157
157
|
return;
|
|
158
158
|
}
|
|
159
|
-
const
|
|
160
|
-
|
|
159
|
+
const selection = readVisitorSelection(formData, render.hydration);
|
|
160
|
+
const selectionError = visitorSelectionError(selection);
|
|
161
|
+
if (selectionError) {
|
|
161
162
|
dispatchSubmission({
|
|
162
163
|
type: "failed",
|
|
163
|
-
error:
|
|
164
|
+
error: selectionError
|
|
164
165
|
});
|
|
165
166
|
return;
|
|
166
167
|
}
|
|
168
|
+
const visitorSelection = selection.tag === "chosen" ? selection.value : void 0;
|
|
167
169
|
dispatchSubmission({ type: "submitted" });
|
|
168
170
|
try {
|
|
169
171
|
const result = await api.subscribeNewsletter({
|
|
@@ -363,10 +365,18 @@ function transportFailureMessage(err) {
|
|
|
363
365
|
}
|
|
364
366
|
return RETRY_SHORTLY_MESSAGE;
|
|
365
367
|
}
|
|
368
|
+
function visitorSelectionError(selection) {
|
|
369
|
+
switch (selection.tag) {
|
|
370
|
+
case "nothing_chosen": return newsletterFieldError(TOPIC_CHOICE_FIELD_ID, "Choose at least one email topic.");
|
|
371
|
+
case "unusable": return newsletterFormError(SIGNUPS_PAUSED_MESSAGE);
|
|
372
|
+
case "not_offered":
|
|
373
|
+
case "chosen": return null;
|
|
374
|
+
}
|
|
375
|
+
}
|
|
366
376
|
function readVisitorSelection(formData, hydration) {
|
|
367
|
-
if (hydration.choicePresentation !== "visitor_choice") return
|
|
377
|
+
if (hydration.choicePresentation !== "visitor_choice") return { tag: "not_offered" };
|
|
368
378
|
const ids = formData.getAll(TOPIC_CHOICE_FIELD_ID).flatMap((value) => typeof value === "string" ? [value] : []);
|
|
369
|
-
if (ids.length === 0) return
|
|
379
|
+
if (ids.length === 0) return { tag: "nothing_chosen" };
|
|
370
380
|
const raw = hydration.choiceProvider === "native" ? {
|
|
371
381
|
provider: "native",
|
|
372
382
|
topicIds: ids
|
|
@@ -377,9 +387,12 @@ function readVisitorSelection(formData, hydration) {
|
|
|
377
387
|
provider: "mailchimp",
|
|
378
388
|
interestIds: ids
|
|
379
389
|
} : null;
|
|
380
|
-
if (raw === null) return
|
|
390
|
+
if (raw === null) return { tag: "unusable" };
|
|
381
391
|
const parsed = parseMailingListVisitorSelection(raw);
|
|
382
|
-
return parsed.ok ?
|
|
392
|
+
return parsed.ok ? {
|
|
393
|
+
tag: "chosen",
|
|
394
|
+
value: parsed.value
|
|
395
|
+
} : { tag: "unusable" };
|
|
383
396
|
}
|
|
384
397
|
function publicSignupError(outcome) {
|
|
385
398
|
switch (outcome.tag) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { an as formatEventPricing, cn as publicEventPricingDisplay, in as formatBookingPriceDisplay } from "./propsDecoder-
|
|
1
|
+
import { an as formatEventPricing, cn as publicEventPricingDisplay, in as formatBookingPriceDisplay } from "./propsDecoder-DiLiBdek.mjs";
|
|
2
2
|
//#region ../blocks/src/system/runtime/nodes/events/domain/capacity.ts
|
|
3
3
|
/**
|
|
4
4
|
* Compute remaining spots for an event from `availableSpots` with a fallback
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as defineIslandPropsDecoder } from "./propsDecoder-
|
|
2
|
-
import { r as ProductDetailController } from "./shop-commerce-
|
|
3
|
-
import { t as mountShopBlockIsland } from "./shopShared-
|
|
1
|
+
import { t as defineIslandPropsDecoder } from "./propsDecoder-DiLiBdek.mjs";
|
|
2
|
+
import { r as ProductDetailController } from "./shop-commerce-D_J781in.mjs";
|
|
3
|
+
import { t as mountShopBlockIsland } from "./shopShared-C_Bb2zwG.mjs";
|
|
4
4
|
import "react";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
//#region ../blocks/src/system/runtime/nodes/product-detail.client.tsx
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as defineIslandPropsDecoder } from "./propsDecoder-
|
|
2
|
-
import { i as ProductListController } from "./shop-commerce-
|
|
3
|
-
import { t as mountShopBlockIsland } from "./shopShared-
|
|
1
|
+
import { t as defineIslandPropsDecoder } from "./propsDecoder-DiLiBdek.mjs";
|
|
2
|
+
import { i as ProductListController } from "./shop-commerce-D_J781in.mjs";
|
|
3
|
+
import { t as mountShopBlockIsland } from "./shopShared-C_Bb2zwG.mjs";
|
|
4
4
|
import "react";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
//#region ../blocks/src/system/runtime/nodes/product-list.client.tsx
|