@riverbankcms/sdk 0.132.0 → 0.134.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/CHANGELOG.md +10 -0
- package/dist/{PreviewEditorSidebar-DKQ5eFK9.mjs → PreviewEditorSidebar-DfRhJPFQ.mjs} +3 -3
- package/dist/{PreviewEditorUI-CNTcOjCC.mjs → PreviewEditorUI-Dppxcr_g.mjs} +2 -2
- package/dist/{SdkPreviewModeRuntime-DJu3qu33.mjs → SdkPreviewModeRuntime-8CyGCXir.mjs} +46 -15
- package/dist/{SiteChromeCustomizeContext-2TzT3vbj.mjs → SiteChromeCustomizeContext-DVMTMvqA.mjs} +497 -169
- package/dist/_dts/ai/src/contracts/proposals.d.ts +384 -384
- package/dist/_dts/ai/src/contracts/siteStyleProposalSchemas.d.ts +219 -219
- package/dist/_dts/api/src/accountApi.d.ts +5 -5
- package/dist/_dts/api/src/appointmentEndpointDefinitions.d.ts +1 -1
- package/dist/_dts/api/src/bookingOperations.d.ts +2 -14
- package/dist/_dts/api/src/bookings.d.ts +2 -2
- package/dist/_dts/api/src/contentRuntime.d.ts +1 -1
- package/dist/_dts/api/src/courseEndpointDefinitions.d.ts +2 -2
- package/dist/_dts/api/src/endpoints.d.ts +3 -3
- package/dist/_dts/api/src/indexCoreTypes.d.ts +1 -1
- package/dist/_dts/api/src/navigation/contracts.d.ts +9 -6
- package/dist/_dts/api/src/navigation/linkResolver.d.ts +6 -2
- package/dist/_dts/api/src/navigation/types.d.ts +23 -6
- package/dist/_dts/api/src/navigation.d.ts +1 -1
- package/dist/_dts/api/src/publicBookingService.d.ts +15 -0
- package/dist/_dts/api/src/publicExperience/eventEndpoints.d.ts +3 -1
- package/dist/_dts/api/src/publicExperience/wholeSeriesEndpoints.d.ts +2 -0
- package/dist/_dts/api/src/sdk-event-upsert.d.ts +1 -1
- package/dist/_dts/api/src/sdkThemeWire.d.ts +50 -50
- package/dist/_dts/api/src/siteBanner.d.ts +4 -2
- package/dist/_dts/api/src/types.d.ts +1 -1
- package/dist/_dts/api/src/webhooks.d.ts +12 -12
- package/dist/_dts/blocks/src/client.d.ts +1 -1
- package/dist/_dts/blocks/src/contracts/proof-block-islands.d.ts +28 -72
- package/dist/_dts/blocks/src/index.d.ts +3 -2
- package/dist/_dts/blocks/src/primitives/content/components/RichText.d.ts +2 -2
- package/dist/_dts/blocks/src/primitives/content/primitives.d.ts +1 -0
- package/dist/_dts/blocks/src/system/blocks/events/shared/schemas.d.ts +36 -14
- package/dist/_dts/blocks/src/system/blocks/events/shared/types.d.ts +3 -0
- package/dist/_dts/blocks/src/system/blocks/events/whole-series/schemas.d.ts +3 -3
- package/dist/_dts/blocks/src/system/blocks/events/whole-series/types.d.ts +3 -0
- package/dist/_dts/blocks/src/system/blocks/location-map.d.ts +4 -4
- package/dist/_dts/blocks/src/system/blocks/media-text.d.ts +148 -148
- package/dist/_dts/blocks/src/system/blocks/offerings-preview/model.d.ts +2 -1
- package/dist/_dts/blocks/src/system/blocks/shared/bookingConsent.d.ts +36 -0
- package/dist/_dts/blocks/src/system/manifest/hydrateLinks.d.ts +9 -2
- package/dist/_dts/blocks/src/system/manifest/resolveBlockData.d.ts +8 -0
- package/dist/_dts/blocks/src/system/manifest/schema.d.ts +79 -79
- package/dist/_dts/blocks/src/system/runtime/api/types/appointments.d.ts +2 -11
- package/dist/_dts/blocks/src/system/runtime/api/types/courses.d.ts +2 -0
- package/dist/_dts/blocks/src/system/runtime/api/types/events.d.ts +1 -0
- package/dist/_dts/blocks/src/system/runtime/components/multi-step/DynamicFormFields.d.ts +3 -19
- package/dist/_dts/blocks/src/system/runtime/components/runtime-backed-blocks.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/hooks/useSelectedAppointmentConsentForm.d.ts +2 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.consent.d.ts +10 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.field-values.d.ts +4 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.fields.d.ts +21 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.headless.state.d.ts +2 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.interactive.d.ts +38 -144
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.state.d.ts +5 -19
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-runtime-sources.d.ts +3 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/AttendeeDetailsStep.d.ts +2 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/registrationSurface.d.ts +18 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationWizard.d.ts +4 -4
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/validation.d.ts +2 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/whole-series/components.d.ts +2 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/whole-series/whole-series-registration.headless.contract.d.ts +2 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/eventCollectionContract.d.ts +34 -12
- package/dist/_dts/blocks/src/system/runtime/shared/components/BookingConsentAgreement.d.ts +7 -0
- package/dist/_dts/blocks/src/system/runtime/shared/types.d.ts +1 -0
- package/dist/_dts/blocks/src/system/types/link.d.ts +7 -1
- package/dist/_dts/content-model/src/content-types/schema.d.ts +4 -4
- package/dist/_dts/core/src/booking-consent.d.ts +8 -0
- package/dist/_dts/core/src/index.d.ts +1 -0
- package/dist/_dts/db/src/generated/supabase/database.types.d.ts +9 -3
- package/dist/_dts/db/src/schemas/forms.d.ts +21 -21
- package/dist/_dts/db/src/types/jsonb.d.ts +1 -1
- package/dist/_dts/editor/src/primitives/rich-text/RichTextEditorSurface.d.ts +2 -1
- package/dist/_dts/editor/src/primitives/rich-text/config.d.ts +2 -1
- package/dist/_dts/editor/src/primitives/rich-text/toolbar/linkPopoverUtils.d.ts +3 -2
- package/dist/_dts/editor/src/primitives/rich-text/useRichTextEditor.d.ts +3 -4
- package/dist/_dts/media-core/src/usageScanner.d.ts +1 -1
- package/dist/_dts/sdk/src/bookings/types.d.ts +7 -89
- package/dist/_dts/sdk/src/config/validation.d.ts +30 -30
- package/dist/_dts/sdk/src/contracts/content.d.ts +10 -36
- package/dist/_dts/sdk/src/contracts/rendering.d.ts +1 -1
- package/dist/_dts/sdk/src/manifest/passes/pass1-fields.d.ts +9 -9
- package/dist/_dts/sdk/src/public-api/contracts.d.ts +6 -19
- package/dist/_dts/sdk/src/version.d.ts +1 -1
- package/dist/_dts/theme-core/src/accordions/types.d.ts +2 -2
- package/dist/_dts/theme-core/src/buttons/types.d.ts +12 -12
- package/dist/_dts/theme-core/src/cards/types.d.ts +5 -5
- package/dist/_dts/theme-core/src/mock-themes/all.d.ts +72 -72
- package/dist/_dts/theme-core/src/navigation/types.d.ts +4 -4
- package/dist/_dts/theme-core/src/palette/colors.d.ts +1 -1
- package/dist/_dts/theme-core/src/palette/curated/types.d.ts +2 -2
- package/dist/_dts/theme-core/src/schema.d.ts +82 -82
- package/dist/_dts/theme-core/src/site-styles/cardRoleVocabulary.d.ts +1 -1
- package/dist/_dts/theme-core/src/site-styles/designState.d.ts +2 -2
- package/dist/_dts/theme-core/src/site-styles/generatedSchemas.d.ts +4 -4
- package/dist/_dts/theme-core/src/site-styles/logoBranding.d.ts +4 -4
- package/dist/_dts/theme-core/src/tokens/themeColorTokens.d.ts +1 -1
- package/dist/_dts/ui/src/badge.d.ts +1 -1
- package/dist/_dts/ui/src/button.d.ts +1 -1
- package/dist/_dts/ui/src/callout.d.ts +1 -1
- package/dist/_dts/ui/src/card.d.ts +1 -1
- package/dist/client/{StepIndicator-CGixP_LW.mjs → BookingConsentAgreement-BxgpGEFD.mjs} +26 -4
- package/dist/client/{DiscountCodeDisclosure-DO7llLxm.mjs → DiscountCodeDisclosure-CfuPOHD0.mjs} +1 -1
- package/dist/client/{EventCombined.client-xID7zN__.mjs → EventCombined.client-DB8Qfzi-.mjs} +3 -3
- package/dist/client/{EventListing.client-CriBslp0.mjs → EventListing.client-DD4X8hp4.mjs} +2 -2
- package/dist/client/{LeafletStaticMap-DYmHnM8g.mjs → LeafletStaticMap-QhgIBQbv.mjs} +1 -1
- package/dist/client/{WholeSeriesRegistrationWizard-BEjzSiOA.mjs → WholeSeriesRegistrationWizard-DwtC7bCs.mjs} +72 -22
- package/dist/client/{accordion-CgFbnnnQ.mjs → accordion-DFXpLvwg.mjs} +1 -1
- package/dist/client/{bookingForm-dUyGpbxc.mjs → bookingForm-sI05d3lk.mjs} +73 -47
- package/dist/client/bookings.mjs +989 -140
- package/dist/client/{carousel-BvBwkUzx.mjs → carousel-wjyWTZCh.mjs} +1 -1
- package/dist/client/{cart-DiZENT2E.mjs → cart-DCwdpA4i.mjs} +3 -3
- package/dist/client/{checkout-Dq13KIgR.mjs → checkout-DTDW3l0R.mjs} +3 -3
- package/dist/client/checkoutUrls-DQYC_Br-.mjs +187 -0
- package/dist/client/client.mjs +556 -237
- package/dist/client/{context-B83PiNzm.mjs → context-TSK1CGx8.mjs} +1 -14
- package/dist/client/{courseRegistration-CKC5NmyH.mjs → courseRegistration-A-Tg7qw_.mjs} +3 -3
- package/dist/client/{eventCalendar-BF0Jatfw.mjs → eventCalendar-B0Zg-i_w.mjs} +5 -5
- package/dist/client/{eventCombined-BuoCF8je.mjs → eventCombined-B8Y2wizd.mjs} +3 -3
- package/dist/client/{eventDetails-CKwh0S9s.mjs → eventDetails-DPDOwURJ.mjs} +3 -3
- package/dist/client/{eventListing-eUxaWFaB.mjs → eventListing-CjBcmSLn.mjs} +3 -3
- package/dist/client/{eventRegistration-CfkNOkPb.mjs → eventRegistration-CK30HsAq.mjs} +111 -64
- package/dist/client/{form-C17H1c_H.mjs → form-CUXfsABE.mjs} +2 -2
- package/dist/client/{headerSection-DEwUmrtt.mjs → headerSection-N-mN3rjr.mjs} +2 -2
- package/dist/client/hooks.mjs +106 -3
- package/dist/client/{locationMap-Pf2QwuvW.mjs → locationMap-oiIDQMBt.mjs} +2 -2
- package/dist/client/{newsletterForm-BWQAH5Sv.mjs → newsletterForm-CkQ2tTrM.mjs} +2 -2
- package/dist/client/{pricing-CVdvbopJ.mjs → pricing-Caa0QWzh.mjs} +1 -1
- package/dist/client/{productDetail-BZi1Fa_G.mjs → productDetail-CnidyrsN.mjs} +3 -3
- package/dist/client/{productList-qq-55DNk.mjs → productList-CttYcS_S.mjs} +3 -3
- package/dist/client/{propsDecoder-BxmqPKdP.mjs → propsDecoder-CeUMxI9a.mjs} +211 -100
- package/dist/client/rendering/client.mjs +428 -151
- package/dist/client/rendering/islands.mjs +18 -18
- package/dist/client/rendering.mjs +643 -324
- package/dist/client/{scrollToBlock-B3CcKdtG.mjs → scrollToBlock-lPr1oqxB.mjs} +1 -1
- package/dist/client/{shop-DNWJPut5.mjs → shop-DXQtMo2O.mjs} +6 -6
- package/dist/client/{shop-commerce-BhvQCosS.mjs → shop-commerce-quDL411J.mjs} +7 -164
- package/dist/client/{shop-commerce-store-B04sCNnW.mjs → shop-commerce-store-Dnu-8Iub.mjs} +1 -1
- package/dist/client/{shopShared-DNNgZlmW.mjs → shopShared-BWPUURvG.mjs} +3 -3
- package/dist/client/{useEventFilters-CUmhE24_.mjs → useEventFilters-DRhWp2_5.mjs} +3 -3
- package/dist/client/{usePolling-M5jG675x.mjs → usePolling-UN4WKnaM.mjs} +2 -2
- package/dist/preview-next/client/runtime.mjs +3 -3
- package/dist/{sdk-runtime-BEXb1wqo.mjs → sdk-runtime-Ca5RD78X.mjs} +1 -1
- package/dist/{separator-DGMuip1D.mjs → separator-CMhj6BTi.mjs} +1 -1
- package/dist/server/components.mjs +117 -37
- package/dist/server/config-validation.mjs +106 -3
- package/dist/server/config.mjs +106 -3
- package/dist/server/data.mjs +106 -3
- package/dist/server/index.mjs +1 -1
- package/dist/server/next.mjs +186 -106
- package/dist/server/page-converter.mjs +105 -2
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/rendering/server.mjs +119 -37
- package/dist/server/rendering.mjs +117 -37
- package/dist/server/routing.mjs +132 -73
- package/dist/server/server.mjs +107 -4
- package/dist/server/theme-bridge.mjs +4 -4
- package/package.json +2 -2
- package/dist/client/checkoutUrls-Ct8Mxna3.mjs +0 -26
|
@@ -665,6 +665,117 @@ function err(error) {
|
|
|
665
665
|
function assertNever$1(value, message) {
|
|
666
666
|
throw new Error(message ?? `Unexpected value: ${String(value)}`);
|
|
667
667
|
}
|
|
668
|
+
//#endregion
|
|
669
|
+
//#region ../blocks/src/lib/typeGuards.ts
|
|
670
|
+
/**
|
|
671
|
+
* Strict record guard: excludes null, primitives, and arrays.
|
|
672
|
+
*/
|
|
673
|
+
function isRecord$5(value) {
|
|
674
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
675
|
+
}
|
|
676
|
+
//#endregion
|
|
677
|
+
//#region ../blocks/src/system/manifest/richTextSchema.ts
|
|
678
|
+
/**
|
|
679
|
+
* Shared Rich Text Schema
|
|
680
|
+
*
|
|
681
|
+
* This module provides a single source of truth for TipTap rich text validation
|
|
682
|
+
* across both the block-form editor and the block rendering system.
|
|
683
|
+
*
|
|
684
|
+
* Rich-text fields use one canonical root shape:
|
|
685
|
+
* `{ type: 'doc', content: [...] }`.
|
|
686
|
+
*/
|
|
687
|
+
/**
|
|
688
|
+
* TipTap document node schema (recursive structure)
|
|
689
|
+
*
|
|
690
|
+
* Supports the full TipTap document structure including:
|
|
691
|
+
* - type: Node type (e.g., 'doc', 'paragraph', 'text')
|
|
692
|
+
* - content: Nested array of child nodes
|
|
693
|
+
* - text: Text content for text nodes
|
|
694
|
+
* - attrs: Node attributes (e.g., alignment, color)
|
|
695
|
+
* - marks: Text formatting marks (e.g., bold, italic)
|
|
696
|
+
*/
|
|
697
|
+
const TipTapMarkSchema = z.object({
|
|
698
|
+
type: z.string().min(1),
|
|
699
|
+
attrs: z.record(z.string(), z.unknown()).optional()
|
|
700
|
+
}).strict();
|
|
701
|
+
const TipTapNodeSchema = z.lazy(() => z.object({
|
|
702
|
+
type: z.string().min(1),
|
|
703
|
+
content: z.array(TipTapNodeSchema).optional(),
|
|
704
|
+
text: z.string().optional(),
|
|
705
|
+
attrs: z.record(z.string(), z.unknown()).optional(),
|
|
706
|
+
marks: z.array(TipTapMarkSchema).optional()
|
|
707
|
+
}).strict().superRefine((node, ctx) => {
|
|
708
|
+
if (node.type === "doc") ctx.addIssue({
|
|
709
|
+
code: "custom",
|
|
710
|
+
path: ["type"],
|
|
711
|
+
message: "Document nodes are only valid at the rich-text root"
|
|
712
|
+
});
|
|
713
|
+
if (node.type === "text") {
|
|
714
|
+
if (node.text === void 0 || node.text.length === 0) ctx.addIssue({
|
|
715
|
+
code: "custom",
|
|
716
|
+
path: ["text"],
|
|
717
|
+
message: "Text nodes require a non-empty text value"
|
|
718
|
+
});
|
|
719
|
+
if (node.content !== void 0) ctx.addIssue({
|
|
720
|
+
code: "custom",
|
|
721
|
+
path: ["content"],
|
|
722
|
+
message: "Text nodes cannot contain child nodes"
|
|
723
|
+
});
|
|
724
|
+
return;
|
|
725
|
+
}
|
|
726
|
+
if (node.text !== void 0) ctx.addIssue({
|
|
727
|
+
code: "custom",
|
|
728
|
+
path: ["text"],
|
|
729
|
+
message: "Only text nodes can contain a text value"
|
|
730
|
+
});
|
|
731
|
+
}));
|
|
732
|
+
/**
|
|
733
|
+
* Canonical schema for a TipTap rich-text document root.
|
|
734
|
+
*
|
|
735
|
+
* Stricter than {@link TipTapNodeSchema}: `type` is literally `'doc'` and
|
|
736
|
+
* `content` is required (possibly empty). This is the shape every producer
|
|
737
|
+
* (dummy content, editor output, migrations) must emit, and the shape every
|
|
738
|
+
* non-legacy consumer can rely on.
|
|
739
|
+
*
|
|
740
|
+
*/
|
|
741
|
+
const RichTextDocSchema = z.object({
|
|
742
|
+
type: z.literal("doc"),
|
|
743
|
+
content: z.array(TipTapNodeSchema)
|
|
744
|
+
}).strict();
|
|
745
|
+
//#endregion
|
|
746
|
+
//#region ../blocks/src/system/blocks/shared/bookingConsent.ts
|
|
747
|
+
const BOOKING_REQUIREMENT_CONSENT_FIELD_PREFIX = "booking_requirement_consent_";
|
|
748
|
+
function toBookingRequirementConsentFieldId(requirementId) {
|
|
749
|
+
return `${BOOKING_REQUIREMENT_CONSENT_FIELD_PREFIX}${requirementId}`;
|
|
750
|
+
}
|
|
751
|
+
function isBookingRequirementConsentFieldId(value) {
|
|
752
|
+
return value.startsWith(BOOKING_REQUIREMENT_CONSENT_FIELD_PREFIX);
|
|
753
|
+
}
|
|
754
|
+
function toBookingRequirementConsentField(consent) {
|
|
755
|
+
return {
|
|
756
|
+
id: toBookingRequirementConsentFieldId(consent.requirementId),
|
|
757
|
+
label: consent.title,
|
|
758
|
+
type: "booking_requirement_consent",
|
|
759
|
+
required: true,
|
|
760
|
+
agreement: consent.agreement,
|
|
761
|
+
checkboxLabel: consent.checkboxLabel
|
|
762
|
+
};
|
|
763
|
+
}
|
|
764
|
+
const blockBookingConsentSchema = z.object({
|
|
765
|
+
requirementId: z.string(),
|
|
766
|
+
title: z.string(),
|
|
767
|
+
agreement: RichTextDocSchema,
|
|
768
|
+
checkboxLabel: z.string()
|
|
769
|
+
});
|
|
770
|
+
const bookingRequirementConsentFieldSchema = z.object({
|
|
771
|
+
id: z.string(),
|
|
772
|
+
label: z.string(),
|
|
773
|
+
type: z.literal("booking_requirement_consent"),
|
|
774
|
+
required: z.literal(true),
|
|
775
|
+
agreement: RichTextDocSchema,
|
|
776
|
+
checkboxLabel: z.string().min(1)
|
|
777
|
+
});
|
|
778
|
+
z.union([blockBookingConsentSchema, bookingRequirementConsentFieldSchema]);
|
|
668
779
|
const BOOKING_FORM_DATA_RESERVED_KEYS = /* @__PURE__ */ new Set([
|
|
669
780
|
"serviceId",
|
|
670
781
|
"resourceId",
|
|
@@ -676,6 +787,28 @@ const BOOKING_FORM_DATA_RESERVED_KEYS = /* @__PURE__ */ new Set([
|
|
|
676
787
|
"selectedAppointmentPackageId"
|
|
677
788
|
]);
|
|
678
789
|
//#endregion
|
|
790
|
+
//#region ../blocks/src/system/runtime/nodes/booking-form.consent.ts
|
|
791
|
+
function resolveSelectedAppointmentConsent(service) {
|
|
792
|
+
return service?.consent ? {
|
|
793
|
+
kind: "required-for-selected-service",
|
|
794
|
+
field: toBookingRequirementConsentField(service.consent)
|
|
795
|
+
} : { kind: "not-applicable" };
|
|
796
|
+
}
|
|
797
|
+
function projectSelectedAppointmentConsentIntoForm(form, selectedConsent) {
|
|
798
|
+
if (!form) return null;
|
|
799
|
+
const sourceFields = form.schema?.fields ?? [];
|
|
800
|
+
const baseFields = sourceFields.filter((field) => field.type !== "booking_requirement_consent");
|
|
801
|
+
const fields = selectedConsent.kind === "required-for-selected-service" ? [...baseFields, selectedConsent.field] : baseFields;
|
|
802
|
+
if (selectedConsent.kind === "not-applicable" && baseFields.length === sourceFields.length) return form;
|
|
803
|
+
return {
|
|
804
|
+
...form,
|
|
805
|
+
schema: {
|
|
806
|
+
...form.schema,
|
|
807
|
+
fields
|
|
808
|
+
}
|
|
809
|
+
};
|
|
810
|
+
}
|
|
811
|
+
//#endregion
|
|
679
812
|
//#region ../blocks/src/system/runtime/nodes/booking-form.state.ts
|
|
680
813
|
function toTrimmedString(value) {
|
|
681
814
|
const trimmed = value?.trim();
|
|
@@ -792,12 +925,12 @@ function resolveBookingSiteId(siteId, form) {
|
|
|
792
925
|
return siteId || form?.siteId || "";
|
|
793
926
|
}
|
|
794
927
|
function normalizeBookingFormConfig(form) {
|
|
795
|
-
if (!isRecord$
|
|
928
|
+
if (!isRecord$4(form)) return null;
|
|
796
929
|
const id = readNonEmptyString(form.id);
|
|
797
930
|
const name = readNonEmptyString(form.name);
|
|
798
931
|
if (!id || !name) return null;
|
|
799
|
-
const schemaSource = isRecord$
|
|
800
|
-
const settingsSource = isRecord$
|
|
932
|
+
const schemaSource = isRecord$4(form.schema) ? form.schema : isRecord$4(form.schemaJson) ? form.schemaJson : null;
|
|
933
|
+
const settingsSource = isRecord$4(form.settings) ? form.settings : isRecord$4(form.settingsJson) ? form.settingsJson : null;
|
|
801
934
|
return {
|
|
802
935
|
id,
|
|
803
936
|
name,
|
|
@@ -817,8 +950,8 @@ function normalizeBookingServices(services) {
|
|
|
817
950
|
};
|
|
818
951
|
if (!services) return [];
|
|
819
952
|
if (Array.isArray(services)) return services.filter(isBookingFormService).map(normalizeService);
|
|
820
|
-
if (isRecord$
|
|
821
|
-
return isRecord$
|
|
953
|
+
if (isRecord$4(services) && "services" in services) return Array.isArray(services.services) ? services.services.filter(isBookingFormService).map(normalizeService) : [];
|
|
954
|
+
return isRecord$4(services) ? Object.values(services).filter(isBookingFormService).map(normalizeService) : [];
|
|
822
955
|
}
|
|
823
956
|
function normalizeBookingSchema(value) {
|
|
824
957
|
if (!value) return void 0;
|
|
@@ -829,7 +962,7 @@ function normalizeBookingSchema(value) {
|
|
|
829
962
|
};
|
|
830
963
|
}
|
|
831
964
|
function readBookingFormField(value) {
|
|
832
|
-
if (!isRecord$
|
|
965
|
+
if (!isRecord$4(value)) return null;
|
|
833
966
|
const id = readNonEmptyString(value.id);
|
|
834
967
|
const label = readNonEmptyString(value.label);
|
|
835
968
|
const type = readBookingFieldType(value.type);
|
|
@@ -858,7 +991,6 @@ function readBookingFieldType(value) {
|
|
|
858
991
|
case "select":
|
|
859
992
|
case "radio":
|
|
860
993
|
case "checkbox":
|
|
861
|
-
case "booking_requirement_consent":
|
|
862
994
|
case "tel":
|
|
863
995
|
case "url":
|
|
864
996
|
case "number":
|
|
@@ -873,7 +1005,7 @@ function readBookingFieldOptions(value) {
|
|
|
873
1005
|
return options.length > 0 ? options : void 0;
|
|
874
1006
|
}
|
|
875
1007
|
function readBookingFieldOption(value) {
|
|
876
|
-
if (!isRecord$
|
|
1008
|
+
if (!isRecord$4(value)) return null;
|
|
877
1009
|
const optionValue = readNonEmptyString(value.value);
|
|
878
1010
|
const label = readNonEmptyString(value.label);
|
|
879
1011
|
return optionValue && label ? {
|
|
@@ -893,7 +1025,7 @@ function normalizeBookingSettings(value) {
|
|
|
893
1025
|
};
|
|
894
1026
|
}
|
|
895
1027
|
function isBookingFormService(value) {
|
|
896
|
-
return isRecord$
|
|
1028
|
+
return isRecord$4(value) && typeof value.id === "string" && typeof value.siteId === "string" && typeof value.title === "string" && (value.consent === void 0 || blockBookingConsentSchema.safeParse(value.consent).success);
|
|
897
1029
|
}
|
|
898
1030
|
function collectBookingCustomFields(data) {
|
|
899
1031
|
const customFields = {};
|
|
@@ -943,7 +1075,7 @@ function readStringArray(value) {
|
|
|
943
1075
|
const strings = value.filter((item) => typeof item === "string");
|
|
944
1076
|
return strings.length > 0 ? strings : void 0;
|
|
945
1077
|
}
|
|
946
|
-
function isRecord$
|
|
1078
|
+
function isRecord$4(value) {
|
|
947
1079
|
return typeof value === "object" && value !== null;
|
|
948
1080
|
}
|
|
949
1081
|
function getBookingServicePaymentSelectionMode(service) {
|
|
@@ -1152,6 +1284,15 @@ const bookingFieldOptionSchema = z.object({
|
|
|
1152
1284
|
value: z.string(),
|
|
1153
1285
|
label: z.string()
|
|
1154
1286
|
});
|
|
1287
|
+
const standardBookingFieldRules = {
|
|
1288
|
+
options: z.array(bookingFieldOptionSchema).optional(),
|
|
1289
|
+
multiple: z.boolean().optional(),
|
|
1290
|
+
minLength: z.number().optional(),
|
|
1291
|
+
maxLength: z.number().optional(),
|
|
1292
|
+
pattern: z.string().optional(),
|
|
1293
|
+
min: z.number().optional(),
|
|
1294
|
+
max: z.number().optional()
|
|
1295
|
+
};
|
|
1155
1296
|
const bookingFieldSchema = z.object({
|
|
1156
1297
|
id: z.string(),
|
|
1157
1298
|
label: z.string(),
|
|
@@ -1162,7 +1303,6 @@ const bookingFieldSchema = z.object({
|
|
|
1162
1303
|
"select",
|
|
1163
1304
|
"radio",
|
|
1164
1305
|
"checkbox",
|
|
1165
|
-
"booking_requirement_consent",
|
|
1166
1306
|
"tel",
|
|
1167
1307
|
"url",
|
|
1168
1308
|
"number",
|
|
@@ -1172,13 +1312,7 @@ const bookingFieldSchema = z.object({
|
|
|
1172
1312
|
required: z.boolean().optional(),
|
|
1173
1313
|
placeholder: z.string().optional(),
|
|
1174
1314
|
helpText: z.string().optional(),
|
|
1175
|
-
|
|
1176
|
-
multiple: z.boolean().optional(),
|
|
1177
|
-
minLength: z.number().optional(),
|
|
1178
|
-
maxLength: z.number().optional(),
|
|
1179
|
-
pattern: z.string().optional(),
|
|
1180
|
-
min: z.number().optional(),
|
|
1181
|
-
max: z.number().optional()
|
|
1315
|
+
...standardBookingFieldRules
|
|
1182
1316
|
});
|
|
1183
1317
|
const bookingSettingsSchema = z.object({
|
|
1184
1318
|
type: z.literal("booking"),
|
|
@@ -1284,7 +1418,8 @@ const bookingServiceSchema = z.object({
|
|
|
1284
1418
|
priceAmount: z.number().nullable().optional(),
|
|
1285
1419
|
priceCurrency: z.string().nullable().optional(),
|
|
1286
1420
|
paymentTerms: blockBookingPaymentTermsSchema.optional(),
|
|
1287
|
-
paymentTermsAvailability: blockBookingPaymentTermsAvailabilitySchema.optional()
|
|
1421
|
+
paymentTermsAvailability: blockBookingPaymentTermsAvailabilitySchema.optional(),
|
|
1422
|
+
consent: blockBookingConsentSchema.optional()
|
|
1288
1423
|
});
|
|
1289
1424
|
const bookingServicesSourceSchema = z.union([
|
|
1290
1425
|
z.array(bookingServiceSchema),
|
|
@@ -1466,6 +1601,7 @@ const publicWholeSeriesOfferingSchema = z.object({
|
|
|
1466
1601
|
pricing: wholeSeriesPricingSchema,
|
|
1467
1602
|
currency: z.string(),
|
|
1468
1603
|
paymentTerms: blockBookingPaymentTermsSchema,
|
|
1604
|
+
consent: blockBookingConsentSchema.nullable(),
|
|
1469
1605
|
enrollmentCapacity: z.number().nullable(),
|
|
1470
1606
|
acceptsMemberships: z.boolean(),
|
|
1471
1607
|
status: z.enum([
|
|
@@ -3377,7 +3513,7 @@ const boxBackgroundSchema = z.discriminatedUnion("type", [
|
|
|
3377
3513
|
})
|
|
3378
3514
|
]);
|
|
3379
3515
|
function normalizeAuthoringOpacity(value) {
|
|
3380
|
-
if (!isRecord$
|
|
3516
|
+
if (!isRecord$3(value)) return value;
|
|
3381
3517
|
return {
|
|
3382
3518
|
...value,
|
|
3383
3519
|
opacity: normalizeOpacity(value.opacity)
|
|
@@ -3386,7 +3522,7 @@ function normalizeAuthoringOpacity(value) {
|
|
|
3386
3522
|
function normalizeOpacity(value) {
|
|
3387
3523
|
return typeof value === "number" && value > 1 && value <= 100 ? value / 100 : value;
|
|
3388
3524
|
}
|
|
3389
|
-
function isRecord$
|
|
3525
|
+
function isRecord$3(value) {
|
|
3390
3526
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
3391
3527
|
}
|
|
3392
3528
|
//#endregion
|
|
@@ -6089,83 +6225,6 @@ const courseRegistrationInteractiveIslandPropsCodec = createInteractiveIslandCod
|
|
|
6089
6225
|
})
|
|
6090
6226
|
});
|
|
6091
6227
|
//#endregion
|
|
6092
|
-
//#region ../blocks/src/lib/typeGuards.ts
|
|
6093
|
-
/**
|
|
6094
|
-
* Strict record guard: excludes null, primitives, and arrays.
|
|
6095
|
-
*/
|
|
6096
|
-
function isRecord$3(value) {
|
|
6097
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
6098
|
-
}
|
|
6099
|
-
//#endregion
|
|
6100
|
-
//#region ../blocks/src/system/manifest/richTextSchema.ts
|
|
6101
|
-
/**
|
|
6102
|
-
* Shared Rich Text Schema
|
|
6103
|
-
*
|
|
6104
|
-
* This module provides a single source of truth for TipTap rich text validation
|
|
6105
|
-
* across both the block-form editor and the block rendering system.
|
|
6106
|
-
*
|
|
6107
|
-
* Rich-text fields use one canonical root shape:
|
|
6108
|
-
* `{ type: 'doc', content: [...] }`.
|
|
6109
|
-
*/
|
|
6110
|
-
/**
|
|
6111
|
-
* TipTap document node schema (recursive structure)
|
|
6112
|
-
*
|
|
6113
|
-
* Supports the full TipTap document structure including:
|
|
6114
|
-
* - type: Node type (e.g., 'doc', 'paragraph', 'text')
|
|
6115
|
-
* - content: Nested array of child nodes
|
|
6116
|
-
* - text: Text content for text nodes
|
|
6117
|
-
* - attrs: Node attributes (e.g., alignment, color)
|
|
6118
|
-
* - marks: Text formatting marks (e.g., bold, italic)
|
|
6119
|
-
*/
|
|
6120
|
-
const TipTapMarkSchema = z.object({
|
|
6121
|
-
type: z.string().min(1),
|
|
6122
|
-
attrs: z.record(z.string(), z.unknown()).optional()
|
|
6123
|
-
}).strict();
|
|
6124
|
-
const TipTapNodeSchema = z.lazy(() => z.object({
|
|
6125
|
-
type: z.string().min(1),
|
|
6126
|
-
content: z.array(TipTapNodeSchema).optional(),
|
|
6127
|
-
text: z.string().optional(),
|
|
6128
|
-
attrs: z.record(z.string(), z.unknown()).optional(),
|
|
6129
|
-
marks: z.array(TipTapMarkSchema).optional()
|
|
6130
|
-
}).strict().superRefine((node, ctx) => {
|
|
6131
|
-
if (node.type === "doc") ctx.addIssue({
|
|
6132
|
-
code: "custom",
|
|
6133
|
-
path: ["type"],
|
|
6134
|
-
message: "Document nodes are only valid at the rich-text root"
|
|
6135
|
-
});
|
|
6136
|
-
if (node.type === "text") {
|
|
6137
|
-
if (node.text === void 0 || node.text.length === 0) ctx.addIssue({
|
|
6138
|
-
code: "custom",
|
|
6139
|
-
path: ["text"],
|
|
6140
|
-
message: "Text nodes require a non-empty text value"
|
|
6141
|
-
});
|
|
6142
|
-
if (node.content !== void 0) ctx.addIssue({
|
|
6143
|
-
code: "custom",
|
|
6144
|
-
path: ["content"],
|
|
6145
|
-
message: "Text nodes cannot contain child nodes"
|
|
6146
|
-
});
|
|
6147
|
-
return;
|
|
6148
|
-
}
|
|
6149
|
-
if (node.text !== void 0) ctx.addIssue({
|
|
6150
|
-
code: "custom",
|
|
6151
|
-
path: ["text"],
|
|
6152
|
-
message: "Only text nodes can contain a text value"
|
|
6153
|
-
});
|
|
6154
|
-
}));
|
|
6155
|
-
/**
|
|
6156
|
-
* Canonical schema for a TipTap rich-text document root.
|
|
6157
|
-
*
|
|
6158
|
-
* Stricter than {@link TipTapNodeSchema}: `type` is literally `'doc'` and
|
|
6159
|
-
* `content` is required (possibly empty). This is the shape every producer
|
|
6160
|
-
* (dummy content, editor output, migrations) must emit, and the shape every
|
|
6161
|
-
* non-legacy consumer can rely on.
|
|
6162
|
-
*
|
|
6163
|
-
*/
|
|
6164
|
-
const RichTextDocSchema = z.object({
|
|
6165
|
-
type: z.literal("doc"),
|
|
6166
|
-
content: z.array(TipTapNodeSchema)
|
|
6167
|
-
}).strict();
|
|
6168
|
-
//#endregion
|
|
6169
6228
|
//#region ../blocks/src/system/blocks/events/shared/schemas.ts
|
|
6170
6229
|
const eventPresetSchema = z.enum([
|
|
6171
6230
|
"event",
|
|
@@ -6468,6 +6527,7 @@ const publicEventSchema = z.object({
|
|
|
6468
6527
|
timeZone: z.string(),
|
|
6469
6528
|
pricing: publicEventPricingSchema,
|
|
6470
6529
|
paymentTerms: blockBookingPaymentTermsSchema,
|
|
6530
|
+
consent: blockBookingConsentSchema.nullable(),
|
|
6471
6531
|
accessRestriction: accessRestrictionSchema,
|
|
6472
6532
|
allowedCategoryIds: z.array(z.string()),
|
|
6473
6533
|
requireGuestDetails: z.boolean().optional(),
|
|
@@ -10312,6 +10372,54 @@ const eventCombinedInteractiveIslandPropsCodec = createInteractiveIslandCodec({
|
|
|
10312
10372
|
})
|
|
10313
10373
|
});
|
|
10314
10374
|
//#endregion
|
|
10375
|
+
//#region ../blocks/src/system/runtime/nodes/event-registration/registrationSurface.ts
|
|
10376
|
+
function planEventRegistrationScope(input) {
|
|
10377
|
+
const subject = input.subject;
|
|
10378
|
+
const selectedRunOffering = input.wholeSeriesOffering;
|
|
10379
|
+
if (subject?.kind !== "eventOffering" || !selectedRunOffering) return {
|
|
10380
|
+
kind: "context",
|
|
10381
|
+
events: resolveEventRegistrationScopedEvents(input.events, {
|
|
10382
|
+
occurrenceContext: input.occurrenceContext,
|
|
10383
|
+
subject
|
|
10384
|
+
})
|
|
10385
|
+
};
|
|
10386
|
+
if (!(selectedRunOffering.eventOfferingId === subject.eventOfferingId && subject.availableEventSeriesIds.some((seriesId) => seriesId === selectedRunOffering.eventSeriesId))) return { kind: "invalidSelectedRun" };
|
|
10387
|
+
return {
|
|
10388
|
+
kind: "selectedRun",
|
|
10389
|
+
events: input.events.filter((event) => event.seriesId === selectedRunOffering.eventSeriesId),
|
|
10390
|
+
offering: selectedRunOffering
|
|
10391
|
+
};
|
|
10392
|
+
}
|
|
10393
|
+
function planEventRegistrationSurface(input) {
|
|
10394
|
+
const scope = planEventRegistrationScope(input);
|
|
10395
|
+
if (scope.kind === "invalidSelectedRun") return { kind: "unavailableWholeSeries" };
|
|
10396
|
+
const scopedEvents = scope.events;
|
|
10397
|
+
const bookingScopes = new Set(scopedEvents.map((event) => event.bookingScope));
|
|
10398
|
+
if (scope.kind === "selectedRun") {
|
|
10399
|
+
if (bookingScopes.size !== 1 || !bookingScopes.has("whole_series")) return { kind: "unavailableWholeSeries" };
|
|
10400
|
+
return {
|
|
10401
|
+
kind: "wholeSeries",
|
|
10402
|
+
offerings: [scope.offering]
|
|
10403
|
+
};
|
|
10404
|
+
}
|
|
10405
|
+
if (!input.occurrenceContext && !input.subject && bookingScopes.has("single_occurrence")) return {
|
|
10406
|
+
kind: "occurrence",
|
|
10407
|
+
events: scopedEvents.filter((event) => event.bookingScope === "single_occurrence")
|
|
10408
|
+
};
|
|
10409
|
+
if (bookingScopes.size === 0 || bookingScopes.has("single_occurrence")) return bookingScopes.has("whole_series") ? { kind: "mixedBookingScopes" } : {
|
|
10410
|
+
kind: "occurrence",
|
|
10411
|
+
events: scopedEvents
|
|
10412
|
+
};
|
|
10413
|
+
const requiredSeriesIds = new Set(scopedEvents.map((event) => event.seriesId));
|
|
10414
|
+
const wholeSeriesOffering = input.wholeSeriesOffering;
|
|
10415
|
+
const offerings = (wholeSeriesOffering ? [wholeSeriesOffering, ...input.wholeSeriesOfferings.filter((offering) => offering.eventSeriesId !== wholeSeriesOffering.eventSeriesId)] : input.wholeSeriesOfferings).filter((offering) => requiredSeriesIds.has(offering.eventSeriesId));
|
|
10416
|
+
const loadedSeriesIds = new Set(offerings.map((offering) => offering.eventSeriesId));
|
|
10417
|
+
return [...requiredSeriesIds].every((seriesId) => loadedSeriesIds.has(seriesId)) && offerings.length > 0 ? {
|
|
10418
|
+
kind: "wholeSeries",
|
|
10419
|
+
offerings
|
|
10420
|
+
} : { kind: "unavailableWholeSeries" };
|
|
10421
|
+
}
|
|
10422
|
+
//#endregion
|
|
10315
10423
|
//#region ../blocks/src/system/runtime/nodes/event-registration/wizardSteps.ts
|
|
10316
10424
|
/**
|
|
10317
10425
|
* Steps that are part of the main wizard and should show the step indicator
|
|
@@ -10526,10 +10634,13 @@ function buildEventRegistrationShellStepLabels(source) {
|
|
|
10526
10634
|
}) : false).map((step) => shellLabelForRegistrationStep(step, scopedEvents));
|
|
10527
10635
|
}
|
|
10528
10636
|
function scopeEventRegistrationEvents(source) {
|
|
10529
|
-
|
|
10637
|
+
const scope = planEventRegistrationScope({
|
|
10638
|
+
events: toRegistrationEvents(source.events ?? []),
|
|
10639
|
+
wholeSeriesOffering: source.wholeSeriesOffering,
|
|
10530
10640
|
occurrenceContext: source.occurrenceContext,
|
|
10531
10641
|
subject: source.subject
|
|
10532
10642
|
});
|
|
10643
|
+
return scope.kind === "invalidSelectedRun" ? [] : scope.events;
|
|
10533
10644
|
}
|
|
10534
10645
|
function shellLabelForRegistrationStep(step, events) {
|
|
10535
10646
|
switch (step) {
|
|
@@ -12058,4 +12169,4 @@ function defineIslandPropsDecoder(kind) {
|
|
|
12058
12169
|
};
|
|
12059
12170
|
}
|
|
12060
12171
|
//#endregion
|
|
12061
|
-
export {
|
|
12172
|
+
export { themeButtonClassName as $, buildEventRuntimeFilters as A, okWith as At, formatEventTeacherLine as B, parseBookingLocalDate as Bt, getWizardStepsForContext as C, isBookingRequirementConsentFieldId as Ct, SEMANTIC_SPACING_VALUES as D, clearWorkflowFeedback as Dt, staticHeaderChromeRuntime as E, assertNever$1 as Et, formatDate as F, formatBookingDateTime as Ft, resolveEventCta as G, formatBookingPriceDisplay as Gt, getCardOrientation as H, toBookingTimeZone as Ht, formatEventCompactDateRail as I, formatBookingInstant as It, getEventAvailability as J, publicEventPricingType as Jt, resolveEventLinkProps as K, publicEventPricingCurrency as Kt, formatEventDateParts as L, formatBookingTime as Lt, normalizeCsvIds as M, reportWorkflowSuccess as Mt, normalizeCsvString as N, addLocalScheduleDays as Nt, isSemanticSpacing as O, err as Ot, normalizeOptionalId as P, formatBookingDate as Pt, resolveEventRegistrationScopedEvents as Q, assertNever$2 as Qt, formatEventPrice as R, formatLocalScheduleDate as Rt, getStepNumber as S, BOOKING_FORM_DATA_RESERVED_KEYS as St, buildEventCalendarListingRender as T, isRecord$5 as Tt, getContainerClass as U, toScheduledBookingDateTime as Ut, formatTime as V, resolveBookingTimeZoneId as Vt, groupEventsByDate as W, parseEventPageSurfaceSubject as Wt, getLocalDateKey as X, publicEventTicketTypes as Xt, getEventAvailabilityStatus as Y, publicEventScalarPrice as Yt, getLocalMinuteOfDay as Z, formatCurrencyAmount as Zt, findPreSelectedEvent as _, resolveBookingSiteId as _t, buildProductDetailDisplay as a, logger as at, resolveRegistrationTarget as b, projectSelectedAppointmentConsentIntoForm as bt, EMPTY_COMMERCE_CART_STATE as c, formatBookingSubmissionPreparationError as ct, deriveCommerceCheckoutState as d, getBookingSuccessMessage as dt, boxBackgroundSchema as et, parseStoredCommerceCartState as f, isBookingServiceSlidingAmountInRange as ft, findEventByOccurrenceId as g, resolveBookingPaymentStep as gt, toRegistrationEvents as h, resolveAppointmentCheckoutVerificationState as ht, buildProductCardDisplay as i, normalizeCardRole as it, getEventRuntimeFiltersKey as j, reportWorkflowError as jt, resolveSpacing as k, ok as kt, buildPassCartItem as l, getBookingRedirectStateFromLocation as lt, reduceCommerceCart as m, prepareBookingSubmission as mt, getShopDisplayForItems as n, resolveOnColorForThemeToken as nt, formatCommercePrice as o, deriveBookingFormViewState as ot, productItemKey as p, parseBookingCurrencyInputToCents as pt, resolveRuntimeEventPricing as q, publicEventPricingMode as qt, buildCartDisplay as r, resolveTokenOrCssColorValue as rt, formatInterval as s, formatBookingCentsAsCurrencyInput as st, defineIslandPropsDecoder as t, isCssColorLiteral as tt, buildProductCartItem as u, getBookingServiceSlidingScale as ut, resolveDiscountContext as v, resolveDefaultBookingServiceId as vt, planEventRegistrationSurface as w, RichTextDocSchema as wt, WIZARD_STEPS as x, resolveSelectedAppointmentConsent as xt, resolveEventRequiresPayment as y, toSelectedCollectionOptionKind as yt, formatEventPriceDisplay as z, getBookingLocalDateKey as zt };
|