@riverbankcms/sdk 0.178.0 → 0.179.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/README.md +15 -8
- package/dist/_dts/{BlocksIslandsHydrator-CrKsXtpD.d.ts → BlocksIslandsHydrator-DKwgs95u.d.ts} +1 -1
- package/dist/_dts/{Page-C9i27wZA.d.ts → Page-lWenra5i.d.ts} +7 -7
- package/dist/_dts/{SdkPreviewMode-DzGSR3jh.d.ts → SdkPreviewMode-BRxhRw4I.d.ts} +2 -2
- package/dist/_dts/{client-BnYN6XsH.d.ts → client-qWn7xAwJ.d.ts} +47 -17
- package/dist/_dts/{content-types-CXj6lp3d.d.ts → content-types-DL6GIvTm.d.ts} +2 -2
- package/dist/_dts/{contracts-BZLwkTwL.d.ts → contracts-CzWyAiJj.d.ts} +6 -116
- package/dist/_dts/{generatePageMetadata-ByEWwe9j.d.ts → generatePageMetadata-CBKd0cJ4.d.ts} +2 -2
- package/dist/_dts/{index-DCa-8TEY.d.ts → index-7CDBZGb-.d.ts} +1 -1
- package/dist/_dts/{index-CKDRr54L.d.ts → index-BU9uAkHB.d.ts} +4 -4
- package/dist/_dts/{index-D9-N1d9v.d.ts → index-BYnG_vF5.d.ts} +1 -1
- package/dist/_dts/{index-nnEdgc3Z.d.ts → index-CZgJrhzT.d.ts} +4 -2
- package/dist/_dts/{index-cTpvQg_Q.d.ts → index-CaCum9mM.d.ts} +2 -2
- package/dist/_dts/{index-0HFgCnGz.d.ts → index-DCiSHd-C.d.ts} +1 -1
- package/dist/_dts/{index-BE9dWIsr.d.ts → index-DVSipdrT.d.ts} +3 -3
- package/dist/_dts/{loadContent-DYkVV6w4.d.ts → loadContent-CPKbFQyq.d.ts} +15 -13
- package/dist/_dts/{request-B20VRWHH.d.ts → request-BjKBCS7t.d.ts} +1201 -335
- package/dist/_dts/{resolveBlockData-C_aK5GIS.d.ts → resolveBlockData-DupbMCup.d.ts} +8 -5
- package/dist/_dts/resolvePageContent-BqNyCHi8.d.ts +61 -0
- package/dist/_dts/sdk/src/bookings/index.d.ts +2 -2
- package/dist/_dts/sdk/src/client/types.d.ts +3 -3
- package/dist/_dts/sdk/src/client.d.ts +7 -7
- package/dist/_dts/sdk/src/config/index.d.ts +6 -6
- package/dist/_dts/sdk/src/config/template-validation.d.ts +1 -1
- package/dist/_dts/sdk/src/config/validation.d.ts +1 -1
- package/dist/_dts/sdk/src/data/dataLoaderContext.d.ts +2 -2
- package/dist/_dts/sdk/src/data/resolveBlockData.d.ts +1 -1
- package/dist/_dts/sdk/src/data/types.d.ts +7 -2
- package/dist/_dts/sdk/src/gifting/client.d.ts +1 -1
- package/dist/_dts/sdk/src/index.d.ts +8 -8
- package/dist/_dts/sdk/src/manifest/index.d.ts +3 -3
- package/dist/_dts/sdk/src/metadata/index.d.ts +1 -1
- package/dist/_dts/sdk/src/navigation/index.d.ts +3 -3
- package/dist/_dts/sdk/src/next/index.d.ts +16 -8
- package/dist/_dts/sdk/src/next/middleware.d.ts +2 -2
- package/dist/_dts/sdk/src/page-converter/index.d.ts +3 -3
- package/dist/_dts/sdk/src/portal/client.d.ts +1 -1
- package/dist/_dts/sdk/src/prebuild/index.d.ts +1 -1
- package/dist/_dts/sdk/src/preview-next/before-render.d.ts +2 -2
- package/dist/_dts/sdk/src/preview-next/client/index.d.ts +2 -2
- package/dist/_dts/sdk/src/preview-next/client/runtime.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/client.d.ts +2 -2
- package/dist/_dts/sdk/src/rendering/components/pageShared.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/helpers/loadPage.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/helpers/pageRuntimeSupport.d.ts +4 -4
- package/dist/_dts/sdk/src/rendering/index.d.ts +7 -7
- package/dist/_dts/sdk/src/rendering/islands/client.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/server.d.ts +3 -3
- package/dist/_dts/sdk/src/rendering/themeAdmission.d.ts +1 -1
- package/dist/_dts/sdk/src/routing/index.d.ts +19 -6
- package/dist/_dts/sdk/src/server.d.ts +5 -5
- package/dist/_dts/sdk/src/spam-protection/index.d.ts +2 -2
- package/dist/_dts/sdk/src/theme/index.d.ts +1 -1
- package/dist/_dts/serviceBookingOutline-YcsIjvn1.d.ts +582 -0
- package/dist/_dts/{types-rm2M4LGx.d.ts → types-B7e6Lmo5.d.ts} +3 -3
- package/dist/_dts/{types-CYcd15BQ.d.ts → types-BOxSq-Bq.d.ts} +8 -7
- package/dist/_dts/{types-CMZ5mkpv.d.ts → types-CT-KOxl_.d.ts} +5 -39
- package/dist/_dts/{validation-BSxnRhyy.d.ts → validation-Dz6qccue.d.ts} +4 -4
- package/dist/client/{BlocksIslandsHydrator-D1n09bu-.mjs → BlocksIslandsHydrator-1XifJg6V.mjs} +17 -18
- package/dist/client/{BookingMailingListNote-DSD4gS96.mjs → BookingMailingListNote-BsbEgagJ.mjs} +7 -7
- package/dist/client/{BookingQuestionFields-B57oGPcj.mjs → BookingQuestionFields-C8IbeLHj.mjs} +4 -4
- package/dist/client/{CalendarNavigationChevron-qXvsFYOg.mjs → CalendarNavigationChevron-Bbqij1XQ.mjs} +42 -9
- package/dist/client/{CheckboxChoice-b-PJLEXe.mjs → CheckboxChoice-BZPLCgTU.mjs} +1 -1
- package/dist/client/{DemoBookingPortalAccess-Olvrwi3Z.mjs → DemoBookingPortalAccess-uA9H8LIL.mjs} +4 -4
- package/dist/client/{EventCalendar.client-DwFNFb-0.mjs → EventCalendar.client-yoSI77ov.mjs} +10 -10
- package/dist/client/{EventCombined.client-Ffu-aVOb.mjs → EventCombined.client-HeCNlliq.mjs} +10 -10
- package/dist/client/{EventEmbeddedCheckoutStep-B18VbNS_.mjs → EventEmbeddedCheckoutStep-BDnicDM6.mjs} +1 -1
- package/dist/client/{EventItem-b8tVkNHA.mjs → EventItem-Duhk1vnF.mjs} +247 -7
- package/dist/client/{EventListWeekNavigation-BxnJW_Gf.mjs → EventListWeekNavigation-BiutEqPK.mjs} +1 -1
- package/dist/client/{EventListing.client-ViCnrNg4.mjs → EventListing.client-B5ln77jG.mjs} +3 -3
- package/dist/client/{EventListing.view-CdjiepMf.mjs → EventListing.view-hUDhNtMv.mjs} +203 -9
- package/dist/client/{EventRegistrationPayment-BVd70XkH.mjs → EventRegistrationPayment-DqtX1vB2.mjs} +189 -111
- package/dist/client/{Page-DqETUt-U.mjs → Page-ChJ2TGVk.mjs} +24314 -20226
- package/dist/client/{ProtectedSubmitButton-C-ql101B.mjs → ProtectedSubmitButton-De6AzhE6.mjs} +1 -1
- package/dist/client/{SiteTermsAgreementField-DkFnbzf_.mjs → SiteTermsAgreementField-CDBU31xW.mjs} +3 -3
- package/dist/client/{StepIndicator-JO2PS03n.mjs → StepIndicator-2Dl9zon2.mjs} +6 -6
- package/dist/client/{BookingPanelArrangement--EkA1ZQd.mjs → StepIndicator-JQA-VuEH.mjs} +12 -12
- package/dist/client/{TabBarFragment-BqfRLojo.mjs → TabBarFragment-DlKQRhP4.mjs} +1 -1
- package/dist/client/{ThemedButton-DuaYtnvG.mjs → ThemedButton-CnSa7o-I.mjs} +66 -66
- package/dist/client/{accessibleSurfaces-DN8it_Cx.mjs → accessibleSurfaces-Wl8-_OVJ.mjs} +1 -1
- package/dist/client/{accordion-XgNxl0Wg.mjs → accordion-B6SqU49k.mjs} +1 -1
- package/dist/client/{booking-form.client-ljJoDwuI.mjs → booking-form.client-DrEOjQ3N.mjs} +15 -15
- package/dist/client/{bookingForm-DtEHwY4W.mjs → bookingForm-drZBwEZW.mjs} +4 -4
- package/dist/client/bookings.mjs +5 -5
- package/dist/client/{boxStyleClassNames-BHoMAcun.mjs → boxStyleClassNames-DEh45w16.mjs} +19 -19
- package/dist/client/{carousel-B3UhbFu7.mjs → carousel-C-YJliD-.mjs} +2 -2
- package/dist/client/{carousel.client-h65clfUO.mjs → carousel.client-DMtGYTTM.mjs} +1 -1
- package/dist/client/{cart-DzOJfYOR.mjs → cart-acGFWK9R.mjs} +3 -3
- package/dist/client/{cart.client-DBG77v-5.mjs → cart.client-BzlOGP2j.mjs} +1 -1
- package/dist/client/{checkout-LmePoEgM.mjs → checkout-SEontwhy.mjs} +3 -3
- package/dist/client/{checkout.client-DmgZuLBT.mjs → checkout.client-C0Qvh-d4.mjs} +1 -1
- package/dist/client/{checkoutUrls-CMZI8o_V.mjs → checkoutUrls-yUKeq1N9.mjs} +1 -1
- package/dist/client/client.mjs +414 -319
- package/dist/client/{context-CJIz4FdL.mjs → context-DTrwaQtg.mjs} +2 -1
- package/dist/client/{dateFormatting-UoXqBh10.mjs → dateFormatting-Cg8E1r9l.mjs} +1 -1
- package/dist/client/{demoPortalMagicLink-6CgFZNvu.mjs → demoPortalMagicLink-D0kOJYOX.mjs} +1 -1
- package/dist/client/{enhanceHeaderSection-DaMo6len.mjs → enhanceHeaderSection-DyrpZ7ks.mjs} +4 -4
- package/dist/client/{event-registration.client-b6APrFQe.mjs → event-registration.client-RLZQWi2V.mjs} +13 -13
- package/dist/client/{eventCalendar-DJYz7yZf.mjs → eventCalendar-CphYnImh.mjs} +4 -4
- package/dist/client/{eventCombined-j9VCVgMW.mjs → eventCombined-BvqjASB_.mjs} +4 -4
- package/dist/client/{eventListing-DWgpGuFM.mjs → eventListing-BaNAoC_M.mjs} +4 -4
- package/dist/client/{eventRegistration-DCinRot3.mjs → eventRegistration-COMHoRl6.mjs} +4 -4
- package/dist/client/events-9LPvwbWp.mjs +28 -0
- package/dist/client/{form-BBBtRwvy.mjs → form-DyH2juYT.mjs} +3 -3
- package/dist/client/{form.client-CZeRQLGF.mjs → form.client-DBwzkB0M.mjs} +5 -5
- package/dist/client/{form.parts-DhGGv4_L.mjs → form.parts-CY4kX3mh.mjs} +3 -3
- package/dist/client/{formatDate-DVFVDcDW.mjs → formatDate-CTEN7gxW.mjs} +1 -1
- package/dist/client/gifting/client.mjs +6 -6
- package/dist/client/{gifting-Di9-SpwW.mjs → gifting-CIx4V378.mjs} +4 -4
- package/dist/client/{gifting.client-CjT5PrAZ.mjs → gifting.client-BEVPpzJM.mjs} +5 -5
- package/dist/client/{gifting.parts-ffP6mjMd.mjs → gifting.parts-VnORjnZK.mjs} +2 -2
- package/dist/client/{headerSection-jjAvtSZk.mjs → headerSection-DGcJfRS8.mjs} +2 -2
- package/dist/client/{lookSurfaces-C2VzJfyG.mjs → lookSurfaces-IqT_SVnX.mjs} +167 -85
- package/dist/client/{newsletter-form.client-D45frHoa.mjs → newsletter-form.client-BvEDkjiD.mjs} +6 -6
- package/dist/client/{shop.interactive-D7wky1GL.mjs → newsletter-form.interactive-DCO1lErD.mjs} +3975 -3975
- package/dist/client/{newsletter-form.parts-CHdg82ct.mjs → newsletter-form.parts-BIy4IUT3.mjs} +2 -2
- package/dist/client/{newsletterForm-tS465_vl.mjs → newsletterForm-CoTXDNFS.mjs} +3 -3
- package/dist/client/portal/client.mjs +9 -9
- package/dist/client/{product-detail.client-DIWSeW7P.mjs → product-detail.client-YHQ2aKX1.mjs} +1 -1
- package/dist/client/{product-list.client-BRf14h_e.mjs → product-list.client-DxoZw1vF.mjs} +1 -1
- package/dist/client/{productDetail-gxF5whea.mjs → productDetail-DjuFvkey.mjs} +3 -3
- package/dist/client/{productList-B9t0XJrN.mjs → productList-DE9GEFoZ.mjs} +3 -3
- package/dist/client/{propsDecoder-Db8wAmgr.mjs → propsDecoder-Cyag_HOs.mjs} +2 -48
- package/dist/client/{registry.server-Bn0gE0uP.mjs → registry.server-BPwV-0Pp.mjs} +10420 -9108
- package/dist/client/rendering/client.mjs +41 -27
- package/dist/client/rendering/islands.mjs +1 -1
- package/dist/client/rendering.mjs +23 -2836
- package/dist/client/{richText-coerce-COnKrLO7.mjs → richText-coerce-NrRqDeOg.mjs} +1 -1
- package/dist/client/{routeIslandApiConfig-Bok1Oy50.mjs → routeIslandApiConfig-BWq5gKFK.mjs} +1 -1
- package/dist/client/runtimeResponse-D2j2-mOk.mjs +3 -0
- package/dist/client/{runtimeResponse-9v8q2NBc.mjs → runtimeResponse-DtWSfWSZ.mjs} +1 -1
- package/dist/client/{shop-D1oTPDxm.mjs → shop-C3wM0Hr4.mjs} +3 -3
- package/dist/client/{shop-commerce-DyMZLC0a.mjs → shop-commerce-34YvcpbX.mjs} +14 -14
- package/dist/client/{shop-commerce-store-FODNS63D.mjs → shop-commerce-store-B7xHksOs.mjs} +1 -1
- package/dist/client/{shop-discount-apply.state-C4xcmFzZ.mjs → shop-discount-apply.state-BiBnozfO.mjs} +2 -2
- package/dist/client/{shop.client-CRgRulfI.mjs → shop.client-C0v88nLd.mjs} +14 -14
- package/dist/client/{shopShared-Bd_hy9ZO.mjs → shopShared-Ct-BRNez.mjs} +2 -2
- package/dist/client/spam-protection.mjs +1 -1
- package/dist/client/{noop-D11X-B6n.mjs → src-CCtanNlD.mjs} +317 -342
- package/dist/client/{timetableModel-UlWfP1gh.mjs → timetableModel-lhE29TNT.mjs} +65 -11
- package/dist/client/{types-DjWUR_O6.mjs → types-BEaKfam_.mjs} +65 -65
- package/dist/client/{useAvailableSlots-D-qoooLy.mjs → useAvailableSlots-BelJviOT.mjs} +2 -2
- package/dist/client/useDiscountCodeUi-rQRE1-Ho.mjs +196 -0
- package/dist/client/{useEventPagination-CQH2e9sQ.mjs → useEventPagination-C4rS2Xxl.mjs} +8 -8
- package/dist/client/{view-bGU1ws-m.mjs → view-LJVHVqsy.mjs} +4 -4
- package/dist/client/{display-D1oVR5Eh.mjs → wizardSteps-CNDsxeJH.mjs} +8935 -8913
- package/dist/preview-next/before-render.mjs +4 -3
- package/dist/preview-next/client/{PageSectionToolbar-D-Le7O3o.mjs → PageSectionToolbar-C4TtBPN-.mjs} +3 -3
- package/dist/preview-next/client/{PreviewEditorSidebar-DNy5j_ce.mjs → PreviewEditorSidebar-D6fkE59-.mjs} +5 -5
- package/dist/preview-next/client/{PreviewEditorUI-CzJvgbqt.mjs → PreviewEditorUI-amcDlj0O.mjs} +4 -4
- package/dist/preview-next/client/{PreviewShell-xhJ6ca1i.mjs → PreviewShell-DeQjx4zk.mjs} +5 -5
- package/dist/preview-next/client/{SdkPreviewModeRuntime-BmYO1TdT.mjs → SdkPreviewModeRuntime-Cx0SXnoX.mjs} +5 -5
- package/dist/preview-next/client/{previewAssistantSlot-BN93X9o1.mjs → previewAssistantSlot-aqpU34WI.mjs} +627 -498
- package/dist/preview-next/client/{previewChromeRoot-C51RQseo.mjs → previewChromeRoot-D3Gy_Rs0.mjs} +1 -1
- package/dist/preview-next/client/runtime.mjs +3 -3
- package/dist/preview-next/client/{sdk-runtime-oeGquJM-.mjs → sdk-runtime-Dzx_RrN7.mjs} +2 -2
- package/dist/preview-next/client/{siteStyleAccess-BGTAcPud.mjs → siteStyleAccess-LHedw83e.mjs} +1 -1
- package/dist/preview-next/client/{useAutosaveStatus-BMGXjGZq.mjs → useAutosaveStatus-DpSd9aVk.mjs} +1 -1
- package/dist/preview-next/client/{useOpenBlockForSetup-CTDoR_gQ.mjs → useOpenBlockForSetup-BGZn5AT1.mjs} +1 -1
- package/dist/preview-next/keepAlive.mjs +1 -1
- package/dist/preview-next/middleware.mjs +1 -1
- package/dist/preview-next/{route-contract-BtdzkSUg.mjs → route-contract-DnL-FgSV.mjs} +28 -10
- package/dist/server/{Block.shared-Bp3OlOjj.mjs → Block.shared-BEbq6EwO.mjs} +4 -4
- package/dist/server/{bindings-DrbJuftt.mjs → bindings-Bly0dRs7.mjs} +36 -5
- package/dist/server/{client-Bf06n9oj.mjs → client-CGJ2ztYp.mjs} +1449 -1600
- package/dist/server/config-validation.mjs +1 -1
- package/dist/server/config.mjs +2 -2
- package/dist/server/contentTypeResolver-B9vy8BrF.mjs +19 -0
- package/dist/server/data/dataLoaderContext.mjs +1 -1
- package/dist/server/data/resolveBlockData.mjs +1 -1
- package/dist/server/{dataLoaderContext-B3fXA54R.mjs → dataLoaderContext-lMRTfG5Z.mjs} +1 -0
- package/dist/server/error-f4g44bKx.mjs +387 -0
- package/dist/server/index.mjs +3 -2
- package/dist/server/loadContent-BkK1w3QQ.mjs +692 -0
- package/dist/server/{loadPage-5iZefzDd.mjs → loadPage-DTLe0FEs.mjs} +22 -4
- package/dist/server/next.mjs +54 -94
- package/dist/server/{overrideResolution-CUHtm7tW.mjs → overrideResolution-Uy9Zp2Ks.mjs} +1 -1
- package/dist/server/page-converter.mjs +1 -1
- package/dist/server/{pageRenderPlan-GmPXForc.mjs → pageRenderPlan-JzxBnqfV.mjs} +7 -2
- package/dist/server/{pageRuntimeSupport-Dd8LFzfa.mjs → pageRuntimeSupport-DyNSd2Yj.mjs} +50 -2
- package/dist/server/{pageShared-tz-GVWft.mjs → pageShared-DU4ETFPS.mjs} +8 -50
- package/dist/server/{prebuild-JmsuYCIH.mjs → prebuild-8jNtDXmS.mjs} +5 -4
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/{prefetchBlockData-Ce9DDwON.mjs → prefetchBlockData-xeMG42aw.mjs} +3 -2
- package/dist/server/{registry-D12XF_h1.mjs → registry-DH1VrsCl.mjs} +122 -19
- package/dist/server/rendering/components/pageShared.mjs +1 -1
- package/dist/server/rendering/helpers/loadPage.mjs +1 -1
- package/dist/server/rendering/helpers/pageRuntimeSupport.mjs +1 -1
- package/dist/server/rendering/server.mjs +5 -4
- package/dist/server/rendering.mjs +9 -8
- package/dist/server/{resolveBlockData-D9yZIN3V.mjs → resolveBlockData-BN8tweTx.mjs} +24 -5
- package/dist/server/resolvePageContent-DnM16_f9.mjs +89 -0
- package/dist/server/routing.mjs +271 -57
- package/dist/server/server.mjs +3 -3
- package/dist/server/{loadContent-eaTY7RPg.mjs → servicePageContent-B-FezJmH.mjs} +709 -453
- package/dist/server/{validation-CLq5cw6M.mjs → validation-3jOzYdPL.mjs} +3 -3
- package/dist/server/{version-oPbhAx8E.mjs → version-8t0o6_jd.mjs} +1 -1
- package/package.json +1 -1
- package/dist/_dts/footerPageOutline-D_XbQW_o.d.ts +0 -256
- package/dist/_dts/resolvePageContent-YT6ndha1.d.ts +0 -162
- package/dist/client/LocationMapActions-CiMtl1Ha.mjs +0 -62
- package/dist/client/MapDrawingSvg-BCZa3dpf.mjs +0 -200
- package/dist/client/course-DBEU9IA9.mjs +0 -244
- package/dist/client/duration-Q6_QNgiv.mjs +0 -37
- package/dist/client/event-details.client-BwASwKIq.mjs +0 -53
- package/dist/client/eventDetails-BzGOVDI-.mjs +0 -13
- package/dist/client/runtimeResponse-CVkM0dHy.mjs +0 -3
- package/dist/client/useDiscountCodeUi-B9DODAkj.mjs +0 -237
- package/dist/client/view-DNX59QwM.mjs +0 -1372
- package/dist/server/resolvePageContent-CAELMBEJ.mjs +0 -438
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { at as arrangementContentFacts, b as describePublicRefundPolicy, c as createCustomBlockRegistry, y as PUBLIC_FREE_CANCELLATION } from "./pageRenderPlan-JzxBnqfV.mjs";
|
|
2
|
+
import { $a as componentRuntimeRulesForTheme, Go as appearancePresets, In as registrationDataForEventSelection, Ja as buildInitialPolicyPageDesignIntent, Ji as parseInlineTextFromUnknown, Ka as applyBlockContentVariantPolicy, Ki as inlineTextToPlainText, Nn as planWholeSeriesParentBooking, Pr as blockDesignCapabilityMapFromDefinitions, Qa as componentRuntimeRulesForSiteStyle, Qn as siteHeaderManifest, Rn as selectionRepresentativeEvent, So as pageDesignDecisionsV2Schema, Vs as isCanonicalRichTextDoc, Ya as deriveSiteStyleBlockPolicy, Yi as plainTextToInlineText, Zi as parseFieldDefinition, ao as stripCompiledRuntimeStyleFields, eo as designRuntimeRulesForSiteStyle, i as systemBlockDefinitions, is as resolveRepeaterGridSpanFieldId, js as EVENT_PRESET_VALUES, mc as unsafeAsEventCategoryId, na as isRecord, ns as resolveRepeaterGridColumnFieldId, oo as surfaceResolutionContextFromTheme, pc as unsafeAsContentEntryId, pi as parseBackgroundContent, qa as applySiteStyleBlockPoliciesToPageDesignIntent, rc as offeringLabelForPageSurfaceSubject, ro as requireCuratedSiteStyle, rs as resolveRepeaterGridRowFieldId, t as getBlockDefinition, to as designRuntimeRulesForTheme, vo as parsePageDesignIntent, wa as parseListLook, yo as rebasePageDesignIntentToSiteStyle } from "./registry-DH1VrsCl.mjs";
|
|
2
3
|
import { S as asDesignBlockId, T as asLayoutVariantKey, b as asAppearancePresetId } from "./customCss-BZ8YSrQg.mjs";
|
|
3
|
-
import {
|
|
4
|
+
import { i as mediaSchema } from "./media-luf7RF22.mjs";
|
|
5
|
+
import { D as resolveRepeaterGridAcceptedSpans, E as normalizeRepeaterGridSpan, P as readPublishedBlockPlacement, S as fieldPlanToZod, T as flowRepeaterGridItems, _ as findNonPortableManifestMediaPaths, g as deriveRenderableManifestContent, h as compileManifestContentContract, m as admitTransportedRenderableManifestContent, p as admitStoredManifestContentForRendering, v as registeredManifestContentContract, x as deriveFieldValidationPlan } from "./pageRuntimeSupport-DyNSd2Yj.mjs";
|
|
4
6
|
import { i as createRichTextDoc, o as isRecord$1, r as buildRichTextSchema } from "./richTextSchema-QLaQrbII.mjs";
|
|
5
|
-
import { a as
|
|
6
|
-
import { r as normalizeDataLoaderSearchParams } from "./dataLoaderContext-B3fXA54R.mjs";
|
|
7
|
-
import { n as DEFAULT_RESOLVE_BLOCK_DATA_DEPS, o as resolveBlockDataWithDeps, r as createBlockDataLoadPolicy } from "./resolveBlockData-D9yZIN3V.mjs";
|
|
7
|
+
import { a as buildPageDesignBlockBinding, c as compileEditorModelRuntime, i as blockDesignInputsForDefinition, n as isEntryBoundBlockEmpty, o as buildPageDesignEditorReadModel, r as resolveRuntimeJoinFacts, s as applyCompiledRuntimeFieldsToContent, t as applyBindingsToContent } from "./bindings-Bly0dRs7.mjs";
|
|
8
8
|
import { z } from "zod";
|
|
9
9
|
//#region ../theme-core/src/site-styles/contentTemplateDesignIntent.ts
|
|
10
10
|
function asContentTemplateDesignBlockId(value) {
|
|
@@ -76,6 +76,38 @@ function compileContentTemplateRuntimeFields(input) {
|
|
|
76
76
|
issues: editorModel.issues
|
|
77
77
|
};
|
|
78
78
|
}
|
|
79
|
+
//#endregion
|
|
80
|
+
//#region ../theme-core/src/site-styles/effectivePageDesign.ts
|
|
81
|
+
/**
|
|
82
|
+
* Every page with an applicable site style has an effective design, whether or
|
|
83
|
+
* not a design version was ever persisted. Missing persistence is ordinary
|
|
84
|
+
* default resolution, not a failure.
|
|
85
|
+
*
|
|
86
|
+
* Corrupt persisted state never reaches this function: callers keep their own
|
|
87
|
+
* invalid state untouched and only resolve `stored` values they could parse.
|
|
88
|
+
*/
|
|
89
|
+
function resolveEffectivePageDesignIntent(stored, currentSiteStyleId) {
|
|
90
|
+
if (stored) return {
|
|
91
|
+
kind: "resolved",
|
|
92
|
+
intent: currentSiteStyleId ? rebasePageDesignIntentToSiteStyle(stored, currentSiteStyleId) : stored,
|
|
93
|
+
source: "stored"
|
|
94
|
+
};
|
|
95
|
+
return currentSiteStyleId ? {
|
|
96
|
+
kind: "resolved",
|
|
97
|
+
intent: buildInitialPolicyPageDesignIntent(currentSiteStyleId),
|
|
98
|
+
source: "default"
|
|
99
|
+
} : { kind: "no-site-style" };
|
|
100
|
+
}
|
|
101
|
+
//#endregion
|
|
102
|
+
//#region ../theme-core/src/site-styles/pageDesignVersionIntent.ts
|
|
103
|
+
/** Ordinary page versions contain decisions; the site owns their current style. */
|
|
104
|
+
const decodedPageDesignIntentSchema = z.union([z.nullish(z.never()).transform(() => ({ kind: "automatic" })), pageDesignDecisionsV2Schema.transform((decisions) => ({
|
|
105
|
+
kind: "decisions",
|
|
106
|
+
decisions
|
|
107
|
+
}))], { error: (issue) => {
|
|
108
|
+
const value = issue.input;
|
|
109
|
+
return typeof value === "object" && value !== null && "schemaVersion" in value && value.schemaVersion !== 2 ? "Unsupported page design decisions schemaVersion." : "Invalid page design decisions shape.";
|
|
110
|
+
} });
|
|
79
111
|
const PAGE_SECTIONS_ANCHOR_BLOCK_KIND = "system.page-sections";
|
|
80
112
|
function isSystemTemplateBlockKind(value) {
|
|
81
113
|
return value === "system.entry-slot" || value === "system.page-sections";
|
|
@@ -1804,507 +1836,731 @@ function isEntryTitleBinding(binding) {
|
|
|
1804
1836
|
if (!isRecord(binding)) return false;
|
|
1805
1837
|
return binding.source === "meta" && binding.path === "title" || binding.source === "transform" && isEntryTitleBinding(binding.input);
|
|
1806
1838
|
}
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1839
|
+
/**
|
|
1840
|
+
* The design intent a page renders with: a stored intent rebased onto the
|
|
1841
|
+
* current site style, or the style's defaults when nothing is stored, with the
|
|
1842
|
+
* look pins the style's block policies require. Null when the site has no
|
|
1843
|
+
* site style, so the page renders its content as authored.
|
|
1844
|
+
*
|
|
1845
|
+
* Blocks whose id is not a valid design block id get no policy pin; the
|
|
1846
|
+
* pipeline reports them as `invalid-block-id` diagnostics.
|
|
1847
|
+
*/
|
|
1848
|
+
function resolveOrdinaryPageDesignIntent(input) {
|
|
1849
|
+
const resolution = resolveEffectivePageDesignIntent(input.stored !== null && input.siteStyleId !== null ? {
|
|
1850
|
+
...input.stored,
|
|
1851
|
+
siteStyleId: input.siteStyleId
|
|
1852
|
+
} : null, input.siteStyleId);
|
|
1853
|
+
if (resolution.kind !== "resolved") return null;
|
|
1854
|
+
const { siteStyleId: _style, ...decisions } = applySiteStyleBlockPoliciesToPageDesignIntent(resolution.intent, input.blocks.flatMap((block) => {
|
|
1855
|
+
const blockId = toDesignBlockId(block.id);
|
|
1856
|
+
return blockId !== null ? [{
|
|
1857
|
+
blockId,
|
|
1858
|
+
blockKind: block.kind
|
|
1859
|
+
}] : [];
|
|
1860
|
+
}));
|
|
1861
|
+
return decisions;
|
|
1862
|
+
}
|
|
1863
|
+
/**
|
|
1864
|
+
* Materialize → policy → stored admission → design runtime → renderable proof.
|
|
1865
|
+
*
|
|
1866
|
+
* Admission sits ahead of the design runtime on purpose. `applyPageDesignRuntimeFields`
|
|
1867
|
+
* is adjacent-pair dependent throughout — per-block fields are compiled against the
|
|
1868
|
+
* *next* block's surface, boundaries are keyed to neighbouring block ids, and the
|
|
1869
|
+
* final block is treated as the page end — so it has to see the list that will
|
|
1870
|
+
* actually render. On a public page an `invalid` block is omitted entirely by
|
|
1871
|
+
* `PageRenderer`, and compiling joins to a section nobody sees produces boundaries
|
|
1872
|
+
* that then have to be approximated back into shape downstream.
|
|
1873
|
+
*/
|
|
1874
|
+
function buildOrdinaryPageRenderBlocks(input) {
|
|
1875
|
+
return buildOrdinaryPageWithContext(input);
|
|
1876
|
+
}
|
|
1877
|
+
function buildOrdinaryPageWithContext(input, preparedContext) {
|
|
1878
|
+
const design = resolvePageDesignCompilation(input);
|
|
1879
|
+
const materialized = materializeOrdinaryPageBlocks(input);
|
|
1880
|
+
const admitted = admitOrdinaryPageBlocks({
|
|
1881
|
+
blocks: design.kind === "compile" ? applyBlockContentPolicies({
|
|
1882
|
+
blocks: materialized,
|
|
1883
|
+
designState: design.designState,
|
|
1884
|
+
siteStyleId: design.siteStyleId
|
|
1885
|
+
}) : materialized,
|
|
1886
|
+
resolveContract: input.resolveBlockContentContract ?? resolveRegisteredBlockContentContract,
|
|
1887
|
+
designRuntimeOwnsStyleFields: design.kind === "compile"
|
|
1888
|
+
});
|
|
1889
|
+
const compiled = design.kind === "compile" ? compileOrdinaryPageDesignRuntime({
|
|
1890
|
+
blocks: admitted,
|
|
1891
|
+
designState: design.designState,
|
|
1892
|
+
siteStyleId: design.siteStyleId,
|
|
1893
|
+
stage: input.stage,
|
|
1894
|
+
theme: design.theme,
|
|
1895
|
+
surfaceResolutionContext: preparedContext ?? surfaceResolutionContextFromTheme(design.theme)
|
|
1896
|
+
}) : {
|
|
1897
|
+
blocks: admitted,
|
|
1898
|
+
runtimeJoins: [],
|
|
1899
|
+
diagnostics: design.diagnostics
|
|
1900
|
+
};
|
|
1901
|
+
return {
|
|
1902
|
+
blocks: compiled.blocks.map((block) => finalizeOrdinaryPageRenderBlock(block, input.stage)),
|
|
1903
|
+
runtimeJoins: compiled.runtimeJoins,
|
|
1904
|
+
diagnostics: compiled.diagnostics
|
|
1905
|
+
};
|
|
1906
|
+
}
|
|
1907
|
+
function resolvePageDesignCompilation(input) {
|
|
1908
|
+
const parsed = decodedPageDesignIntentSchema.safeParse(input.designState);
|
|
1909
|
+
if (!parsed.success) return {
|
|
1910
|
+
kind: "skip",
|
|
1911
|
+
diagnostics: [{ kind: "invalid-design-state" }]
|
|
1912
|
+
};
|
|
1913
|
+
if (parsed.data.kind === "automatic") return {
|
|
1914
|
+
kind: "skip",
|
|
1915
|
+
diagnostics: []
|
|
1916
|
+
};
|
|
1917
|
+
const currentSiteStyleId = input.theme?.siteStyleId;
|
|
1918
|
+
if (input.theme === null || currentSiteStyleId == null) return {
|
|
1919
|
+
kind: "skip",
|
|
1920
|
+
diagnostics: [{ kind: "missing-theme-for-design-state" }]
|
|
1921
|
+
};
|
|
1922
|
+
return {
|
|
1923
|
+
kind: "compile",
|
|
1924
|
+
designState: parsed.data.decisions,
|
|
1925
|
+
siteStyleId: currentSiteStyleId,
|
|
1926
|
+
theme: input.theme
|
|
1927
|
+
};
|
|
1928
|
+
}
|
|
1929
|
+
function materializeOrdinaryPageBlocks(input) {
|
|
1930
|
+
switch (input.source) {
|
|
1931
|
+
case "stored": return input.blocks.map((block) => mapOrdinaryPageBlock(block, input.contentByBlockId[block.id], input.stage)).filter((block) => block !== null);
|
|
1932
|
+
case "inline": return input.blocks.map((block) => ({
|
|
1933
|
+
id: block.id,
|
|
1934
|
+
kind: block.kind,
|
|
1935
|
+
purpose: block.purpose,
|
|
1936
|
+
content: cloneRecord(block.content),
|
|
1937
|
+
versions: { kind: "inline" }
|
|
1938
|
+
}));
|
|
1826
1939
|
}
|
|
1827
1940
|
}
|
|
1828
|
-
function
|
|
1829
|
-
return
|
|
1941
|
+
function admitOrdinaryPageBlocks(input) {
|
|
1942
|
+
return input.blocks.map((block) => {
|
|
1943
|
+
const contract = input.resolveContract(block.kind);
|
|
1944
|
+
const nonPortable = block.versions.kind === "stored" && contract !== null ? findNonPortableManifestMediaPaths(contract, block.content) : [];
|
|
1945
|
+
const admission = nonPortable.length ? invalidContentAdmission({
|
|
1946
|
+
kind: "non_portable_media",
|
|
1947
|
+
paths: nonPortable
|
|
1948
|
+
}) : admitOrdinaryPageContent(contract, block.versions.kind, storedContentForAdmission(block.content, input.designRuntimeOwnsStyleFields));
|
|
1949
|
+
return {
|
|
1950
|
+
...block,
|
|
1951
|
+
admission
|
|
1952
|
+
};
|
|
1953
|
+
});
|
|
1954
|
+
}
|
|
1955
|
+
/**
|
|
1956
|
+
* Where the design runtime runs it replaces every compiled style field wholesale,
|
|
1957
|
+
* so a stale persisted one never reaches the rendered page and must not be what
|
|
1958
|
+
* costs a block its admission. Dropping those fields here lets the runtime
|
|
1959
|
+
* projection put the compiled values back before the render shape is judged.
|
|
1960
|
+
* Where the runtime does not run, content is rendered as stored and is judged as
|
|
1961
|
+
* stored.
|
|
1962
|
+
*
|
|
1963
|
+
* The strip is not verdict-preserving on its own. `admitStoredManifestContent`
|
|
1964
|
+
* runs two checks: media portability over the whole content, then the strict
|
|
1965
|
+
* stored schema. Both stop seeing the stripped fields, and a compiled style field
|
|
1966
|
+
* can itself declare media (`_sectionStyles.background.image`), so portability
|
|
1967
|
+
* over those fields is checked before stripping, then re-checked against the decorated content in
|
|
1968
|
+
* `finalizeOrdinaryPageRenderBlock`. Only the schema half is deliberately
|
|
1969
|
+
* deferred there, to the render schema over the projection.
|
|
1970
|
+
*/
|
|
1971
|
+
function storedContentForAdmission(content, designRuntimeOwnsStyleFields) {
|
|
1972
|
+
return designRuntimeOwnsStyleFields ? stripCompiledRuntimeStyleFields(content) : content;
|
|
1973
|
+
}
|
|
1974
|
+
function compileOrdinaryPageDesignRuntime(input) {
|
|
1975
|
+
const compiling = input.blocks.map((block) => participatesInDesignCompilation(block, input.stage));
|
|
1976
|
+
const compiled = applyPageDesignRuntimeFields({
|
|
1830
1977
|
...input,
|
|
1831
|
-
|
|
1832
|
-
pageName: "Entry Template",
|
|
1833
|
-
pagePath: input.entry.path || "/",
|
|
1834
|
-
pagePurpose: "entry-template",
|
|
1835
|
-
renderTargetSource: {
|
|
1836
|
-
kind: "entry-template",
|
|
1837
|
-
entryId: input.entry.id,
|
|
1838
|
-
entryType: input.entry.type
|
|
1839
|
-
}
|
|
1978
|
+
blocks: input.blocks.filter((_, index) => compiling[index] === true)
|
|
1840
1979
|
});
|
|
1980
|
+
return {
|
|
1981
|
+
...compiled,
|
|
1982
|
+
blocks: restoreBlocksExcludedFromCompilation(input.blocks, compiling, compiled.blocks)
|
|
1983
|
+
};
|
|
1841
1984
|
}
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
now: input.now,
|
|
1856
|
-
page: projectRenderablePageOutline(templatePage),
|
|
1857
|
-
siteId: input.siteId,
|
|
1858
|
-
renderTarget: createTemplateRenderTarget(input.renderTargetSource, template.id),
|
|
1859
|
-
previewStage: input.previewStage,
|
|
1860
|
-
policy: input.blockDataPolicy,
|
|
1861
|
-
client: input.client,
|
|
1862
|
-
customBlocks: input.customBlocks
|
|
1985
|
+
/**
|
|
1986
|
+
* The compiled subset keeps the source order and its length — `applyPageDesignRuntimeFields`
|
|
1987
|
+
* returns `input.blocks.map(...)` — so walking it in step puts the excluded
|
|
1988
|
+
* blocks back where they were. Deliberately not keyed on block id: ids reach
|
|
1989
|
+
* this pipeline unvalidated (see `toDesignBlockId`) and need not be unique.
|
|
1990
|
+
*/
|
|
1991
|
+
function restoreBlocksExcludedFromCompilation(blocks, compiling, compiled) {
|
|
1992
|
+
const remaining = compiled[Symbol.iterator]();
|
|
1993
|
+
return blocks.map((block, index) => {
|
|
1994
|
+
if (compiling[index] !== true) return block;
|
|
1995
|
+
const next = remaining.next();
|
|
1996
|
+
if (next.done === true) throw new Error("Page design compilation returned fewer blocks than it was given");
|
|
1997
|
+
return next.value;
|
|
1863
1998
|
});
|
|
1999
|
+
}
|
|
2000
|
+
/**
|
|
2001
|
+
* Published pages never show an invalid block: `PageRenderer` omits it outright,
|
|
2002
|
+
* so a boundary or terminal surface compiled against it describes a join that is
|
|
2003
|
+
* not on the page. Draft pages keep them, because the authoring renderers render
|
|
2004
|
+
* an invalid block as a diagnostic panel that occupies its slot in the flow — the
|
|
2005
|
+
* authoring surface's real adjacency *is* the full block list, and skipping the
|
|
2006
|
+
* block here would hand the editor joins that leap over something visible.
|
|
2007
|
+
*
|
|
2008
|
+
* One draft-stage consumer is not an authoring renderer: the portal preview in
|
|
2009
|
+
* `apps/frontend/src/app/(site)/[[...slug]]/page.tsx` (`renderPortalPreview`)
|
|
2010
|
+
* feeds draft data to the public `Page`, which omits invalid blocks, so its
|
|
2011
|
+
* boundaries are compiled over a block it will not draw.
|
|
2012
|
+
*/
|
|
2013
|
+
function participatesInDesignCompilation(block, stage) {
|
|
2014
|
+
return stage === "draft" || block.admission.kind === "admitted";
|
|
2015
|
+
}
|
|
2016
|
+
function mapOrdinaryPageBlock(block, contentPair, stage) {
|
|
2017
|
+
if (contentPair === void 0) throw new Error(`Missing selected page content: ${block.id}`);
|
|
2018
|
+
const selected = cloneBlockContent(contentPair.selected);
|
|
2019
|
+
const published = cloneBlockContent(contentPair.published);
|
|
2020
|
+
if (stage === "published" && selected === null) return null;
|
|
1864
2021
|
return {
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
entry: input.entry,
|
|
1874
|
-
subject: templateCompilerSubject(input.renderTargetSource),
|
|
1875
|
-
dateContext: resolveDateRuntimeContext(input.bookingTimeZone),
|
|
1876
|
-
template: toContentTemplate(template),
|
|
1877
|
-
page: {
|
|
1878
|
-
name: template.name || input.pageName,
|
|
1879
|
-
path: input.pagePath,
|
|
1880
|
-
purpose: input.pagePurpose
|
|
1881
|
-
},
|
|
1882
|
-
theme: input.theme,
|
|
1883
|
-
pageSections: input.pageSections,
|
|
1884
|
-
resolveEntrySlotBlocks: ({ slotKey }) => selectBlocksForDeclaredEntrySlot({
|
|
1885
|
-
declaredSlotKey: slotKey,
|
|
1886
|
-
entrySlots: input.slotContent ?? []
|
|
1887
|
-
}).map((block) => admitEntrySlotBlock(block, input.customBlocks, input.previewStage)),
|
|
1888
|
-
resolveBlockContentContract: (kind) => {
|
|
1889
|
-
const manifest = resolveSdkBlockManifest(kind, input.customBlocks);
|
|
1890
|
-
return manifest === null ? null : compileManifestContentContract(manifest);
|
|
2022
|
+
id: block.id,
|
|
2023
|
+
kind: block.kind,
|
|
2024
|
+
purpose: block.purpose ?? "content",
|
|
2025
|
+
content: cloneRecord(selected?.data ?? {}),
|
|
2026
|
+
versions: {
|
|
2027
|
+
kind: "stored",
|
|
2028
|
+
selected,
|
|
2029
|
+
published
|
|
1891
2030
|
}
|
|
2031
|
+
};
|
|
2032
|
+
}
|
|
2033
|
+
function applyPageDesignRuntimeFields(input) {
|
|
2034
|
+
const bindings = input.blocks.map((block) => buildPageDesignBlockBinding({
|
|
2035
|
+
id: block.id,
|
|
2036
|
+
kind: block.kind,
|
|
2037
|
+
currentContentId: resolveActiveContentId(block),
|
|
2038
|
+
content: block.content
|
|
2039
|
+
}));
|
|
2040
|
+
const diagnostics = bindings.flatMap((binding) => binding.kind === "invalid-block-id" ? [binding] : []);
|
|
2041
|
+
const editorBlocks = bindings.flatMap((binding) => binding.kind === "valid" ? [binding.block] : []);
|
|
2042
|
+
const contentById = new Map(input.blocks.map((block) => [block.id, block.content]));
|
|
2043
|
+
const compiledRuntime = compileEditorModelRuntime({
|
|
2044
|
+
editorModel: buildPageDesignEditorReadModel({
|
|
2045
|
+
joinResolution: {
|
|
2046
|
+
surfaceResolutionContext: input.surfaceResolutionContext,
|
|
2047
|
+
resolveFacts: resolveRuntimeJoinFacts,
|
|
2048
|
+
designRules: designRuntimeRulesForTheme(input.theme),
|
|
2049
|
+
componentRules: componentRuntimeRulesForTheme(input.theme),
|
|
2050
|
+
contentForBlock: (id) => {
|
|
2051
|
+
const content = contentById.get(id);
|
|
2052
|
+
if (content === void 0) throw new Error(`Missing page content for ${id}`);
|
|
2053
|
+
return content;
|
|
2054
|
+
}
|
|
2055
|
+
},
|
|
2056
|
+
siteStyleId: input.siteStyleId,
|
|
2057
|
+
intent: input.designState,
|
|
2058
|
+
blocks: editorBlocks
|
|
2059
|
+
}),
|
|
2060
|
+
surfaceResolutionContext: input.surfaceResolutionContext,
|
|
2061
|
+
designRules: designRuntimeRulesForTheme(input.theme),
|
|
2062
|
+
componentRules: componentRuntimeRulesForTheme(input.theme),
|
|
2063
|
+
publicationForBlock: input.stage === "published" ? (blockId) => {
|
|
2064
|
+
const content = contentById.get(blockId);
|
|
2065
|
+
if (content === void 0) throw new Error(`Published design block has no content: ${blockId}`);
|
|
2066
|
+
return {
|
|
2067
|
+
kind: "published",
|
|
2068
|
+
facts: arrangementContentFacts(content).facts
|
|
2069
|
+
};
|
|
2070
|
+
} : void 0
|
|
2071
|
+
});
|
|
2072
|
+
const runtimeFieldsByBlockId = new Map(compiledRuntime.blocks.map((block) => [block.blockId, block.fields]));
|
|
2073
|
+
return {
|
|
2074
|
+
diagnostics,
|
|
2075
|
+
blocks: input.blocks.map((block) => {
|
|
2076
|
+
const blockId = toDesignBlockId(block.id);
|
|
2077
|
+
return applyRuntimeFieldsToOrdinaryPageBlock(block, blockId !== null ? runtimeFieldsByBlockId.get(blockId) : void 0);
|
|
2078
|
+
}),
|
|
2079
|
+
runtimeJoins: compiledRuntime.joins
|
|
2080
|
+
};
|
|
2081
|
+
}
|
|
2082
|
+
function applyBlockContentPolicies(input) {
|
|
2083
|
+
return input.blocks.map((block) => {
|
|
2084
|
+
const content = applyBlockContentVariantPolicy({
|
|
2085
|
+
policy: deriveSiteStyleBlockPolicy({
|
|
2086
|
+
siteStyleId: input.siteStyleId,
|
|
2087
|
+
blockKind: block.kind
|
|
2088
|
+
}),
|
|
2089
|
+
content: block.content
|
|
2090
|
+
});
|
|
2091
|
+
return content === block.content ? block : {
|
|
2092
|
+
...block,
|
|
2093
|
+
content: cloneRecord(content)
|
|
2094
|
+
};
|
|
1892
2095
|
});
|
|
1893
2096
|
}
|
|
1894
|
-
function
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
2097
|
+
function applyRuntimeFieldsToOrdinaryPageBlock(block, fields) {
|
|
2098
|
+
if (fields === void 0) return block;
|
|
2099
|
+
return {
|
|
2100
|
+
...block,
|
|
2101
|
+
content: applyCompiledRuntimeFieldsToContent(cloneRecord(block.content), fields)
|
|
2102
|
+
};
|
|
2103
|
+
}
|
|
2104
|
+
function resolveActiveContentId(block) {
|
|
2105
|
+
return block.versions.kind === "inline" ? null : block.versions.selected?.id ?? null;
|
|
2106
|
+
}
|
|
2107
|
+
function resolvePublishedPlacement(block, stage) {
|
|
2108
|
+
const { versions } = block;
|
|
2109
|
+
return stage === "draft" && versions.kind === "stored" ? readPublishedBlockPlacement(versions.published?.id, versions.published?.data) : null;
|
|
2110
|
+
}
|
|
2111
|
+
function cloneBlockContent(content) {
|
|
2112
|
+
return content !== null ? {
|
|
2113
|
+
...content,
|
|
2114
|
+
data: cloneRecord(content.data)
|
|
2115
|
+
} : null;
|
|
2116
|
+
}
|
|
2117
|
+
function cloneRecord(value) {
|
|
2118
|
+
return structuredClone(value);
|
|
2119
|
+
}
|
|
2120
|
+
function admitOrdinaryPageContent(contract, source, content) {
|
|
2121
|
+
if (contract === null) return {
|
|
2122
|
+
kind: "invalid",
|
|
2123
|
+
error: { kind: "manifest_unavailable" }
|
|
2124
|
+
};
|
|
2125
|
+
switch (source) {
|
|
2126
|
+
case "stored": {
|
|
2127
|
+
const stored = admitStoredManifestContentForRendering(contract, content);
|
|
2128
|
+
return stored.ok ? {
|
|
2129
|
+
kind: "admitted",
|
|
2130
|
+
contract,
|
|
2131
|
+
proof: {
|
|
2132
|
+
kind: "stored",
|
|
2133
|
+
stored: stored.value
|
|
2134
|
+
}
|
|
2135
|
+
} : invalidContentAdmission(stored.error);
|
|
2136
|
+
}
|
|
2137
|
+
case "inline": {
|
|
2138
|
+
const inline = admitInlineContent(contract, content);
|
|
2139
|
+
return inline.ok ? {
|
|
2140
|
+
kind: "admitted",
|
|
2141
|
+
contract,
|
|
2142
|
+
proof: { kind: "inline" }
|
|
2143
|
+
} : invalidContentAdmission(inline.error);
|
|
2144
|
+
}
|
|
1898
2145
|
}
|
|
1899
2146
|
}
|
|
1900
|
-
/**
|
|
1901
|
-
|
|
2147
|
+
/**
|
|
2148
|
+
* Inline content is composed from already-hydrated runtime facts (a cover
|
|
2149
|
+
* image carries its public `src`) and never reaches a writer, so it is judged
|
|
2150
|
+
* by the render schema alone. Stored admission's portability check is right
|
|
2151
|
+
* for persisted rows and wrong here — the same reasoning as
|
|
2152
|
+
* `admitMaterializedTemplateContent` in `templatePageOutline.ts`.
|
|
2153
|
+
*/
|
|
2154
|
+
function admitInlineContent(contract, content) {
|
|
2155
|
+
return admitTransportedRenderableManifestContent(contract, content);
|
|
2156
|
+
}
|
|
2157
|
+
function invalidContentAdmission(error) {
|
|
1902
2158
|
return {
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
...block,
|
|
1909
|
-
orderIndex,
|
|
1910
|
-
content: sanitizeSdkRuntimeBlockContent(block.blockKind, block.content ?? {}),
|
|
1911
|
-
bindings: block.bindings ?? null
|
|
1912
|
-
}))
|
|
2159
|
+
kind: "invalid",
|
|
2160
|
+
error: {
|
|
2161
|
+
kind: "invalid_manifest_content",
|
|
2162
|
+
error
|
|
2163
|
+
}
|
|
1913
2164
|
};
|
|
1914
2165
|
}
|
|
1915
|
-
|
|
2166
|
+
/**
|
|
2167
|
+
* Completes admission once the design runtime has produced the render shape.
|
|
2168
|
+
*
|
|
2169
|
+
* The runtime decoration *is* the pure projection this transition expects; it
|
|
2170
|
+
* simply cannot run per block, because it depends on the block's neighbours. So
|
|
2171
|
+
* it is applied across the list above and handed back here as the projection.
|
|
2172
|
+
*
|
|
2173
|
+
* For stored content, media portability is re-checked first, because
|
|
2174
|
+
* `storedContentForAdmission` hid the compiled style fields from the stored gate
|
|
2175
|
+
* and those fields can declare media of their own. Inline content is judged by
|
|
2176
|
+
* the render schema, as it was before compilation (`admitInlineContent`).
|
|
2177
|
+
*/
|
|
2178
|
+
function finalizeOrdinaryPageRenderBlock(block, stage) {
|
|
1916
2179
|
const base = {
|
|
1917
|
-
id: block.id
|
|
1918
|
-
contentVersionId: block.contentVersionId,
|
|
1919
|
-
...entrySlotBlockIdentity(block, previewStage),
|
|
2180
|
+
id: block.id,
|
|
1920
2181
|
kind: block.kind,
|
|
1921
2182
|
purpose: block.purpose,
|
|
1922
|
-
|
|
2183
|
+
contentVersionId: resolveActiveContentId(block),
|
|
2184
|
+
publishedPlacement: resolvePublishedPlacement(block, stage)
|
|
1923
2185
|
};
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
const
|
|
1927
|
-
if (manifest === null) return invalidRenderableBlock$1(base, { kind: "manifest_unavailable" });
|
|
1928
|
-
const renderable = admitTransportedRenderableManifestContent(compileManifestContentContract(manifest), block.content ?? {});
|
|
2186
|
+
if (block.admission.kind === "invalid") return invalidRenderableBlock(base, block.admission.error);
|
|
2187
|
+
const { contract, proof } = block.admission;
|
|
2188
|
+
const renderable = proof.kind === "stored" ? deriveStoredRenderableContent(contract, proof.stored, block.content) : admitInlineContent(contract, block.content);
|
|
1929
2189
|
return renderable.ok ? {
|
|
1930
2190
|
...base,
|
|
1931
2191
|
admission: {
|
|
1932
2192
|
kind: "renderable",
|
|
1933
2193
|
content: renderable.value
|
|
1934
2194
|
}
|
|
1935
|
-
} : invalidRenderableBlock
|
|
2195
|
+
} : invalidRenderableBlock(base, {
|
|
1936
2196
|
kind: "invalid_manifest_content",
|
|
1937
2197
|
error: renderable.error
|
|
1938
2198
|
});
|
|
1939
2199
|
}
|
|
1940
|
-
function
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
2200
|
+
function deriveStoredRenderableContent(contract, stored, decorated) {
|
|
2201
|
+
const nonPortablePaths = findNonPortableManifestMediaPaths(contract, decorated);
|
|
2202
|
+
if (nonPortablePaths.length > 0) return {
|
|
2203
|
+
ok: false,
|
|
2204
|
+
error: {
|
|
2205
|
+
kind: "non_portable_media",
|
|
2206
|
+
paths: nonPortablePaths
|
|
2207
|
+
}
|
|
1944
2208
|
};
|
|
2209
|
+
return deriveRenderableManifestContent(contract, stored, () => decorated);
|
|
2210
|
+
}
|
|
2211
|
+
function toDesignBlockId(value) {
|
|
2212
|
+
if (value.trim().length === 0) return null;
|
|
2213
|
+
try {
|
|
2214
|
+
return asDesignBlockId(value);
|
|
2215
|
+
} catch {
|
|
2216
|
+
return null;
|
|
2217
|
+
}
|
|
1945
2218
|
}
|
|
2219
|
+
blockDesignCapabilityMapFromDefinitions(systemBlockDefinitions);
|
|
2220
|
+
createManifestDefaultValues(siteHeaderManifest);
|
|
1946
2221
|
//#endregion
|
|
1947
|
-
//#region src/rendering/
|
|
1948
|
-
/**
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
2222
|
+
//#region src/rendering/systemPages/bookingPageContent.ts
|
|
2223
|
+
/** Event and service booking pages use the same title/photo treatment. */
|
|
2224
|
+
function bookingHero({ id, title, eyebrow, summary = "", image }) {
|
|
2225
|
+
return {
|
|
2226
|
+
id,
|
|
2227
|
+
kind: "block.hero",
|
|
2228
|
+
purpose: "booking-introduction",
|
|
2229
|
+
content: {
|
|
2230
|
+
eyebrow,
|
|
2231
|
+
headlineInline: plainTextToInlineText(title),
|
|
2232
|
+
subheadline: summary,
|
|
2233
|
+
variant: image ? "split" : "micro",
|
|
2234
|
+
...image ? { _sectionStyles: { background: {
|
|
2235
|
+
type: "image",
|
|
2236
|
+
image
|
|
2237
|
+
} } } : {}
|
|
2238
|
+
}
|
|
2239
|
+
};
|
|
1953
2240
|
}
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
2241
|
+
function bookingPageDesign(heroId, hasImage, { theme }, detailsId) {
|
|
2242
|
+
if (!theme.siteStyleId) return null;
|
|
2243
|
+
return {
|
|
2244
|
+
...buildInitialPolicyPageDesignIntent(theme.siteStyleId),
|
|
2245
|
+
blockLookPins: [{
|
|
2246
|
+
blockId: asDesignBlockId(heroId),
|
|
2247
|
+
blockKind: "block.hero",
|
|
2248
|
+
choice: {
|
|
2249
|
+
kind: "user-pinned",
|
|
2250
|
+
value: asAppearancePresetId(hasImage ? "hero-photo-then-text" : "hero-page-head")
|
|
2251
|
+
}
|
|
2252
|
+
}, ...detailsId ? [{
|
|
2253
|
+
blockId: asDesignBlockId(detailsId),
|
|
2254
|
+
blockKind: "block.event-details",
|
|
2255
|
+
choice: {
|
|
2256
|
+
kind: "user-pinned",
|
|
2257
|
+
value: asAppearancePresetId("event-details-panel")
|
|
2258
|
+
}
|
|
2259
|
+
}] : []]
|
|
2260
|
+
};
|
|
1959
2261
|
}
|
|
1960
|
-
|
|
1961
|
-
|
|
2262
|
+
/** Booking pages always use the site's default section Looks. */
|
|
2263
|
+
function bookingSectionBlocks(sections, purpose) {
|
|
2264
|
+
return (sections ? compilePageSections(sections, {}).blocks : []).map((block) => ({
|
|
2265
|
+
id: block.id,
|
|
2266
|
+
kind: block.blockKind,
|
|
2267
|
+
purpose,
|
|
2268
|
+
content: block.content ?? {}
|
|
2269
|
+
}));
|
|
1962
2270
|
}
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
return
|
|
2271
|
+
/** The hero owns h1, including when a description was authored with its own title. */
|
|
2272
|
+
function bookingDescription(body) {
|
|
2273
|
+
return {
|
|
2274
|
+
...body,
|
|
2275
|
+
content: body.content.map(bookingDescriptionNode)
|
|
2276
|
+
};
|
|
1966
2277
|
}
|
|
1967
|
-
function
|
|
1968
|
-
return
|
|
2278
|
+
function bookingDescriptionNode(node) {
|
|
2279
|
+
return {
|
|
2280
|
+
...node,
|
|
2281
|
+
...node.type === "heading" && node.attrs?.level === 1 ? { attrs: {
|
|
2282
|
+
...node.attrs,
|
|
2283
|
+
level: 2
|
|
2284
|
+
} } : {},
|
|
2285
|
+
...node.content ? { content: node.content.map(bookingDescriptionNode) } : {}
|
|
2286
|
+
};
|
|
1969
2287
|
}
|
|
1970
|
-
|
|
2288
|
+
//#endregion
|
|
2289
|
+
//#region src/rendering/systemPages/codeOwnedPageBlocks.ts
|
|
2290
|
+
/** Code-owned pages share the ordinary design compiler and inline admission boundary. */
|
|
2291
|
+
function buildCodeOwnedPageBlocks(blocks, design, stored = null, ownerWrittenBlocks = []) {
|
|
2292
|
+
const allBlocks = [...blocks, ...ownerWrittenBlocks];
|
|
2293
|
+
const codeWrittenIds = new Set(blocks.map((block) => block.id));
|
|
2294
|
+
const result = buildOrdinaryPageRenderBlocks({
|
|
2295
|
+
source: "inline",
|
|
2296
|
+
blocks: allBlocks,
|
|
2297
|
+
stage: "published",
|
|
2298
|
+
theme: design.theme,
|
|
2299
|
+
designState: resolveOrdinaryPageDesignIntent({
|
|
2300
|
+
stored,
|
|
2301
|
+
siteStyleId: design.theme.siteStyleId ?? null,
|
|
2302
|
+
blocks: allBlocks
|
|
2303
|
+
}),
|
|
2304
|
+
resolveBlockContentContract: design.resolveBlockContentContract ?? createPublicBlockContentContractResolver(design.customBlocks)
|
|
2305
|
+
});
|
|
2306
|
+
const invalid = result.blocks.find((block) => block.admission.kind === "invalid" && block.id !== null && codeWrittenIds.has(block.id));
|
|
2307
|
+
if (invalid?.admission.kind === "invalid") throw new Error(`Code-owned page admission failed for ${invalid.kind} (${invalid.admission.error.kind})`);
|
|
1971
2308
|
return {
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
sdkConfig: support.sdkConfig,
|
|
1985
|
-
site: support.site,
|
|
1986
|
-
siteId,
|
|
1987
|
-
supabaseUrl: support.supabaseUrl,
|
|
1988
|
-
theme: support.theme
|
|
2309
|
+
...result,
|
|
2310
|
+
blocks: result.blocks.filter((block) => block.admission.kind !== "invalid")
|
|
2311
|
+
};
|
|
2312
|
+
}
|
|
2313
|
+
function createPublicBlockContentContractResolver(customBlocks) {
|
|
2314
|
+
const customRegistry = createCustomBlockRegistry({ customBlocks: customBlocks?.map((manifest) => ({
|
|
2315
|
+
manifest,
|
|
2316
|
+
source: { kind: "managed-database" }
|
|
2317
|
+
})) });
|
|
2318
|
+
return (blockKind) => {
|
|
2319
|
+
const manifest = customRegistry.findManifest(blockKind)?.manifest ?? getBlockDefinition(blockKind)?.manifest;
|
|
2320
|
+
return manifest ? compileManifestContentContract(manifest) : null;
|
|
1989
2321
|
};
|
|
1990
2322
|
}
|
|
2323
|
+
//#endregion
|
|
2324
|
+
//#region src/rendering/systemPages/bookingPageIdentity.ts
|
|
1991
2325
|
/**
|
|
1992
|
-
*
|
|
1993
|
-
*
|
|
1994
|
-
*
|
|
1995
|
-
* or raw entry data (for custom rendering).
|
|
1996
|
-
*
|
|
1997
|
-
* @example Dynamic routing with both pages and entries
|
|
1998
|
-
* ```tsx
|
|
1999
|
-
* import { loadContent, Page, isPageContent } from '@riverbankcms/sdk';
|
|
2000
|
-
*
|
|
2001
|
-
* export default async function DynamicRoute({ params }) {
|
|
2002
|
-
* const content = await loadContent({
|
|
2003
|
-
* client,
|
|
2004
|
-
* siteId: 'site-123',
|
|
2005
|
-
* path: `/${params.slug?.join('/') || ''}`,
|
|
2006
|
-
* });
|
|
2007
|
-
*
|
|
2008
|
-
* if (isPageContent(content)) {
|
|
2009
|
-
* if (!content.theme) throw new MissingSdkThemeError(content.siteId, 'cms_theme_absent');
|
|
2010
|
-
* return <Page {...content} />;
|
|
2011
|
-
* }
|
|
2012
|
-
*
|
|
2013
|
-
* // Render entry with custom UI
|
|
2014
|
-
* return (
|
|
2015
|
-
* <article>
|
|
2016
|
-
* <h1>{content.entry.title}</h1>
|
|
2017
|
-
* <div>{content.entry.content.body}</div>
|
|
2018
|
-
* </article>
|
|
2019
|
-
* );
|
|
2020
|
-
* }
|
|
2021
|
-
* ```
|
|
2022
|
-
*
|
|
2023
|
-
* @example Entry-specific rendering based on content type
|
|
2024
|
-
* ```tsx
|
|
2025
|
-
* const content = await loadContent({ client, siteId, path });
|
|
2026
|
-
*
|
|
2027
|
-
* if (content.type === 'entry') {
|
|
2028
|
-
* switch (content.entry.type) {
|
|
2029
|
-
* case 'blog-post':
|
|
2030
|
-
* return <BlogPost entry={content.entry} theme={content.theme} />;
|
|
2031
|
-
* case 'product':
|
|
2032
|
-
* return <ProductPage entry={content.entry} theme={content.theme} />;
|
|
2033
|
-
* default:
|
|
2034
|
-
* return <GenericEntry entry={content.entry} />;
|
|
2035
|
-
* }
|
|
2036
|
-
* }
|
|
2037
|
-
*
|
|
2038
|
-
* if (!content.theme) throw new MissingSdkThemeError(content.siteId, 'cms_theme_absent');
|
|
2039
|
-
* return <Page {...content} />;
|
|
2040
|
-
* ```
|
|
2041
|
-
*
|
|
2042
|
-
* @example Preview mode for draft content
|
|
2043
|
-
* ```tsx
|
|
2044
|
-
* const content = await loadContent({
|
|
2045
|
-
* client,
|
|
2046
|
-
* siteId,
|
|
2047
|
-
* path,
|
|
2048
|
-
* preview: true, // Fetches draft content for both pages and entries
|
|
2049
|
-
* });
|
|
2050
|
-
* ```
|
|
2326
|
+
* How a booking page names itself. Only a page for one date speaks in that
|
|
2327
|
+
* date's own words: a date chooser or a course run stands for all its dates,
|
|
2328
|
+
* so it keeps the event's, whatever its first date is called.
|
|
2051
2329
|
*/
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
}), client.getPage({
|
|
2062
|
-
siteId,
|
|
2063
|
-
path,
|
|
2064
|
-
preview
|
|
2065
|
-
})]);
|
|
2066
|
-
if (siteResult.status === "rejected" || contentResult.status === "rejected") {
|
|
2067
|
-
const failures = [siteResult, contentResult].filter((result) => result.status === "rejected").map(getRejectedReason);
|
|
2068
|
-
throw failures.find((error) => !isContentLoadNotFoundError(error)) ?? failures[0];
|
|
2069
|
-
}
|
|
2070
|
-
const site = siteResult.value;
|
|
2071
|
-
const contentResponse = contentResult.value;
|
|
2072
|
-
return loadContentFromContentResponseWithDeps(deps, {
|
|
2073
|
-
client,
|
|
2074
|
-
siteId,
|
|
2075
|
-
site,
|
|
2076
|
-
contentResponse,
|
|
2077
|
-
preview,
|
|
2078
|
-
dataLoaderOverrides,
|
|
2079
|
-
searchParams
|
|
2080
|
-
});
|
|
2330
|
+
function bookingPageIdentity(selection) {
|
|
2331
|
+
const event = selectionRepresentativeEvent(selection);
|
|
2332
|
+
const ownTitle = selection.kind === "occurrence" ? event.occurrenceTitle ?? null : null;
|
|
2333
|
+
const ownDescription = selection.kind === "occurrence" ? event.occurrenceDescription ?? null : null;
|
|
2334
|
+
return {
|
|
2335
|
+
title: ownTitle ?? event.title,
|
|
2336
|
+
ownTitle,
|
|
2337
|
+
ownDescription
|
|
2338
|
+
};
|
|
2081
2339
|
}
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
const previewStage = preview ? "preview" : "published";
|
|
2085
|
-
const blockDataPolicy = createBlockDataLoadPolicy(dataLoaderOverrides, normalizeDataLoaderSearchParams(searchParams));
|
|
2086
|
-
const support = buildSiteRenderSupport(site, collectMediaAssetSidecar(contentResponse.mediaAssets));
|
|
2087
|
-
const templateContentSupport = toTemplateContentRenderSupport(support, siteId);
|
|
2088
|
-
if (isEntryResponse(contentResponse)) {
|
|
2089
|
-
const entryData = contentResponse.entry;
|
|
2090
|
-
const draftContent = entryData.draftContent;
|
|
2091
|
-
const hasDraftContent = draftContent && Object.keys(draftContent).length > 0;
|
|
2092
|
-
const entry = {
|
|
2093
|
-
id: entryData.id,
|
|
2094
|
-
type: entryData.type,
|
|
2095
|
-
title: entryData.title,
|
|
2096
|
-
slug: entryData.slug,
|
|
2097
|
-
path: entryData.path,
|
|
2098
|
-
status: entryData.status,
|
|
2099
|
-
publishAt: entryData.publishAt,
|
|
2100
|
-
lastPublishedAt: entryData.lastPublishedAt,
|
|
2101
|
-
content: preview && hasDraftContent ? draftContent : entryData.content,
|
|
2102
|
-
metaTitle: preview ? entryData.draftMetaTitle ?? entryData.metaTitle : entryData.metaTitle,
|
|
2103
|
-
metaDescription: preview ? entryData.draftMetaDescription ?? entryData.metaDescription : entryData.metaDescription,
|
|
2104
|
-
createdAt: entryData.createdAt,
|
|
2105
|
-
updatedAt: entryData.updatedAt
|
|
2106
|
-
};
|
|
2107
|
-
const { templatePage, resolvedData, prefetchedBlockData, loaderSnapshot, loaderFailures } = await processEntryTemplate({
|
|
2108
|
-
theme: support.theme,
|
|
2109
|
-
bookingTimeZone: support.bookingTimeZone,
|
|
2110
|
-
now: support.now,
|
|
2111
|
-
templates: contentResponse.templates,
|
|
2112
|
-
entrySlots: contentResponse.entrySlots,
|
|
2113
|
-
entry,
|
|
2114
|
-
siteId,
|
|
2115
|
-
previewStage,
|
|
2116
|
-
blockDataPolicy,
|
|
2117
|
-
client,
|
|
2118
|
-
deps,
|
|
2119
|
-
customBlocks: support.customBlocks
|
|
2120
|
-
});
|
|
2121
|
-
return {
|
|
2122
|
-
type: "entry",
|
|
2123
|
-
entry,
|
|
2124
|
-
templatePage,
|
|
2125
|
-
resolvedData,
|
|
2126
|
-
dataContext: {
|
|
2127
|
-
...siteBlockRenderContext(support),
|
|
2128
|
-
previewStage,
|
|
2129
|
-
prefetchedBlockData,
|
|
2130
|
-
loaderSnapshot,
|
|
2131
|
-
loaderFailures,
|
|
2132
|
-
contentEntry: {
|
|
2133
|
-
...entry.content ?? {},
|
|
2134
|
-
id: entry.id,
|
|
2135
|
-
slug: entry.slug,
|
|
2136
|
-
contentTypeSlug: entry.type,
|
|
2137
|
-
_entryId: entry.id,
|
|
2138
|
-
_entrySlug: entry.slug,
|
|
2139
|
-
_contentTypeSlug: entry.type
|
|
2140
|
-
}
|
|
2141
|
-
},
|
|
2142
|
-
...templateContentSupport
|
|
2143
|
-
};
|
|
2144
|
-
}
|
|
2145
|
-
if (isPageSurfaceResponse(contentResponse)) {
|
|
2146
|
-
const pageSurfaceData = contentResponse.pageSurface;
|
|
2147
|
-
const pageSurface = {
|
|
2148
|
-
id: pageSurfaceData.id,
|
|
2149
|
-
routeId: pageSurfaceData.routeId,
|
|
2150
|
-
readinessState: pageSurfaceData.readinessState,
|
|
2151
|
-
subject: pageSurfaceData.subject,
|
|
2152
|
-
title: pageSurfaceData.title,
|
|
2153
|
-
slug: pageSurfaceData.slug,
|
|
2154
|
-
path: pageSurfaceData.path,
|
|
2155
|
-
status: pageSurfaceData.status,
|
|
2156
|
-
publishAt: pageSurfaceData.publishAt,
|
|
2157
|
-
lastPublishedAt: pageSurfaceData.lastPublishedAt,
|
|
2158
|
-
content: pageSurfaceData.content,
|
|
2159
|
-
metaTitle: preview ? pageSurfaceData.draftMetaTitle ?? pageSurfaceData.metaTitle : pageSurfaceData.metaTitle,
|
|
2160
|
-
metaDescription: preview ? pageSurfaceData.draftMetaDescription ?? pageSurfaceData.metaDescription : pageSurfaceData.metaDescription,
|
|
2161
|
-
createdAt: pageSurfaceData.createdAt,
|
|
2162
|
-
updatedAt: pageSurfaceData.updatedAt,
|
|
2163
|
-
contentSource: pageSurfaceData.contentSource
|
|
2164
|
-
};
|
|
2165
|
-
const { templatePage, resolvedData, prefetchedBlockData, loaderSnapshot, loaderFailures } = await processTemplatePage({
|
|
2166
|
-
entry: pageSurface,
|
|
2167
|
-
theme: support.theme,
|
|
2168
|
-
pageSections: contentResponse.pageSections,
|
|
2169
|
-
bookingTimeZone: support.bookingTimeZone,
|
|
2170
|
-
now: support.now,
|
|
2171
|
-
templates: contentResponse.templates,
|
|
2172
|
-
slotContent: contentResponse.surfaceSlots,
|
|
2173
|
-
pageName: pageSurface.title || "Page Surface Template",
|
|
2174
|
-
pagePath: pageSurface.path || "/",
|
|
2175
|
-
pagePurpose: "page-surface-template",
|
|
2176
|
-
siteId,
|
|
2177
|
-
previewStage,
|
|
2178
|
-
blockDataPolicy,
|
|
2179
|
-
renderTargetSource: {
|
|
2180
|
-
kind: "page-surface-template",
|
|
2181
|
-
pageSurfaceId: pageSurface.id,
|
|
2182
|
-
routeId: pageSurface.routeId,
|
|
2183
|
-
subject: pageSurface.subject
|
|
2184
|
-
},
|
|
2185
|
-
client,
|
|
2186
|
-
deps,
|
|
2187
|
-
customBlocks: support.customBlocks
|
|
2188
|
-
});
|
|
2189
|
-
return {
|
|
2190
|
-
type: "pageSurface",
|
|
2191
|
-
pageSurface,
|
|
2192
|
-
templatePage,
|
|
2193
|
-
resolvedData,
|
|
2194
|
-
dataContext: {
|
|
2195
|
-
...siteBlockRenderContext(support),
|
|
2196
|
-
previewStage,
|
|
2197
|
-
prefetchedBlockData,
|
|
2198
|
-
loaderSnapshot,
|
|
2199
|
-
loaderFailures,
|
|
2200
|
-
pageSurface: {
|
|
2201
|
-
...pageSurface.content ?? {},
|
|
2202
|
-
id: pageSurface.id,
|
|
2203
|
-
slug: pageSurface.slug,
|
|
2204
|
-
subject: pageSurface.subject,
|
|
2205
|
-
_pageSurfaceId: pageSurface.id,
|
|
2206
|
-
_pageSurfaceSlug: pageSurface.slug
|
|
2207
|
-
},
|
|
2208
|
-
subject: pageSurface.subject
|
|
2209
|
-
},
|
|
2210
|
-
...templateContentSupport
|
|
2211
|
-
};
|
|
2212
|
-
}
|
|
2213
|
-
const { page: pageData } = contentResponse;
|
|
2214
|
-
const pageRecord = pageData;
|
|
2215
|
-
const canonicalPagePath = pageData.path ?? pageRecord.path ?? "/";
|
|
2216
|
-
const pageOutline = buildRenderablePageOutline({
|
|
2217
|
-
name: pageData.name,
|
|
2218
|
-
path: canonicalPagePath,
|
|
2219
|
-
fallbackPath: "/",
|
|
2220
|
-
purpose: pageData.purpose,
|
|
2221
|
-
blocks: pageData.blocks,
|
|
2222
|
-
previewStage,
|
|
2223
|
-
customBlocks: support.customBlocks
|
|
2224
|
-
});
|
|
2225
|
-
const prefetched = await resolveBlockDataWithDeps(deps, {
|
|
2226
|
-
bookingTimeZone: support.bookingTimeZone,
|
|
2227
|
-
now: support.now,
|
|
2228
|
-
page: projectRenderablePageOutline(pageOutline),
|
|
2229
|
-
siteId,
|
|
2230
|
-
renderTarget: {
|
|
2231
|
-
kind: "page",
|
|
2232
|
-
pageId: pageData.id
|
|
2233
|
-
},
|
|
2234
|
-
previewStage,
|
|
2235
|
-
policy: blockDataPolicy,
|
|
2236
|
-
client,
|
|
2237
|
-
customBlocks: support.customBlocks
|
|
2238
|
-
});
|
|
2340
|
+
/** A date's description is plain text: blank lines part paragraphs, single ones break lines. */
|
|
2341
|
+
function plainTextDoc(text) {
|
|
2239
2342
|
return {
|
|
2240
|
-
type: "
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
site: support.site,
|
|
2265
|
-
sdkConfig: support.sdkConfig,
|
|
2266
|
-
supabaseUrl: support.supabaseUrl,
|
|
2267
|
-
routeMap: support.routeMap,
|
|
2268
|
-
pagesByIdentifier: support.pagesByIdentifier,
|
|
2269
|
-
entriesByIdentifier: support.entriesByIdentifier,
|
|
2270
|
-
...support.mediaAssets ? { mediaAssets: support.mediaAssets } : {}
|
|
2271
|
-
};
|
|
2272
|
-
}
|
|
2273
|
-
function projectPagePreviewMetadata(page, pageName, canonicalPath) {
|
|
2343
|
+
type: "doc",
|
|
2344
|
+
content: text.split(/\n\s*\n/).map((paragraph) => ({
|
|
2345
|
+
type: "paragraph",
|
|
2346
|
+
content: paragraph.split("\n").flatMap((line, index) => [...index > 0 ? [{ type: "hardBreak" }] : [], ...line ? [{
|
|
2347
|
+
type: "text",
|
|
2348
|
+
text: line
|
|
2349
|
+
}] : []])
|
|
2350
|
+
}))
|
|
2351
|
+
};
|
|
2352
|
+
}
|
|
2353
|
+
//#endregion
|
|
2354
|
+
//#region src/rendering/systemPages/bookingPageOutline.ts
|
|
2355
|
+
const BOOKING_PAGE_BLOCK_IDS = {
|
|
2356
|
+
hero: "booking-hero",
|
|
2357
|
+
details: "booking-details",
|
|
2358
|
+
description: "booking-description",
|
|
2359
|
+
registration: "booking-registration",
|
|
2360
|
+
refundPolicy: "booking-refund-policy"
|
|
2361
|
+
};
|
|
2362
|
+
/** The fixed booking outline; only its block content and style's Looks vary. */
|
|
2363
|
+
function buildBookingPageOutline(selection, design, sections) {
|
|
2364
|
+
return outlineFromFacts(bookingPageFacts(selection), design, sections);
|
|
2365
|
+
}
|
|
2366
|
+
function bookingPageFacts(selection) {
|
|
2274
2367
|
return {
|
|
2275
|
-
|
|
2276
|
-
|
|
2368
|
+
event: selectionRepresentativeEvent(selection),
|
|
2369
|
+
identity: bookingPageIdentity(selection),
|
|
2370
|
+
details: bookingDetailEvents(selection),
|
|
2371
|
+
registration: registrationDataForEventSelection(selection)
|
|
2277
2372
|
};
|
|
2278
2373
|
}
|
|
2279
|
-
function
|
|
2374
|
+
function outlineFromFacts({ event, identity, details }, design, sections) {
|
|
2375
|
+
const sectionBlocks = bookingSectionBlocks(sections, "event-section");
|
|
2376
|
+
const main = buildCodeOwnedPageBlocks(bookingMainBlocks(event, identity, details.length > 0), design, bookingPageDesign(BOOKING_PAGE_BLOCK_IDS.hero, Boolean(event.presentation?.image), design, BOOKING_PAGE_BLOCK_IDS.details), sectionBlocks);
|
|
2377
|
+
const aside = buildCodeOwnedPageBlocks([{
|
|
2378
|
+
id: BOOKING_PAGE_BLOCK_IDS.registration,
|
|
2379
|
+
kind: "block.event-registration",
|
|
2380
|
+
purpose: "booking",
|
|
2381
|
+
content: {
|
|
2382
|
+
pageKind: "bookingPage",
|
|
2383
|
+
heading: "",
|
|
2384
|
+
buttonText: "Register",
|
|
2385
|
+
showCapacity: true,
|
|
2386
|
+
showVenue: true
|
|
2387
|
+
}
|
|
2388
|
+
}, {
|
|
2389
|
+
id: BOOKING_PAGE_BLOCK_IDS.refundPolicy,
|
|
2390
|
+
kind: "block.body-text",
|
|
2391
|
+
purpose: "refund-policy",
|
|
2392
|
+
content: { body: {
|
|
2393
|
+
type: "doc",
|
|
2394
|
+
content: [{
|
|
2395
|
+
type: "heading",
|
|
2396
|
+
attrs: { level: 2 },
|
|
2397
|
+
content: [{
|
|
2398
|
+
type: "text",
|
|
2399
|
+
text: "Cancelling"
|
|
2400
|
+
}]
|
|
2401
|
+
}, {
|
|
2402
|
+
type: "paragraph",
|
|
2403
|
+
content: [{
|
|
2404
|
+
type: "text",
|
|
2405
|
+
text: cancellingSentence(event)
|
|
2406
|
+
}]
|
|
2407
|
+
}]
|
|
2408
|
+
} }
|
|
2409
|
+
}], design);
|
|
2280
2410
|
return {
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2411
|
+
name: identity.title,
|
|
2412
|
+
path: design.path,
|
|
2413
|
+
purpose: "event-booking",
|
|
2414
|
+
blocks: main.blocks,
|
|
2415
|
+
aside: aside.blocks,
|
|
2416
|
+
runtimeJoins: []
|
|
2286
2417
|
};
|
|
2287
2418
|
}
|
|
2288
|
-
function
|
|
2419
|
+
function cancellingSentence(event) {
|
|
2420
|
+
const { refunds } = event.cancellationPolicy;
|
|
2421
|
+
return event.pricing.kind === "free" ? PUBLIC_FREE_CANCELLATION : describePublicRefundPolicy(refunds);
|
|
2422
|
+
}
|
|
2423
|
+
/** A date's own description takes the place of both the event's summary and its body. */
|
|
2424
|
+
function heroSummary(event, identity) {
|
|
2425
|
+
return identity.ownDescription ? "" : event.presentation?.summary ?? event.description ?? "";
|
|
2426
|
+
}
|
|
2427
|
+
function descriptionBody(event, identity) {
|
|
2428
|
+
if (identity.ownDescription) return plainTextDoc(identity.ownDescription);
|
|
2429
|
+
return event.content?.body ? bookingDescription(event.content.body) : null;
|
|
2430
|
+
}
|
|
2431
|
+
function bookingMainBlocks(event, identity, hasDetails) {
|
|
2432
|
+
const image = event.presentation?.image;
|
|
2433
|
+
const hero = bookingHero({
|
|
2434
|
+
id: BOOKING_PAGE_BLOCK_IDS.hero,
|
|
2435
|
+
title: identity.title,
|
|
2436
|
+
eyebrow: "Event booking",
|
|
2437
|
+
summary: heroSummary(event, identity),
|
|
2438
|
+
image
|
|
2439
|
+
});
|
|
2440
|
+
const description = descriptionBody(event, identity);
|
|
2441
|
+
return [
|
|
2442
|
+
{
|
|
2443
|
+
...hero,
|
|
2444
|
+
content: {
|
|
2445
|
+
...hero.content,
|
|
2446
|
+
...event.facts?.length ? { _pageFacts: event.facts } : {}
|
|
2447
|
+
}
|
|
2448
|
+
},
|
|
2449
|
+
...hasDetails ? [{
|
|
2450
|
+
id: BOOKING_PAGE_BLOCK_IDS.details,
|
|
2451
|
+
kind: "block.event-details",
|
|
2452
|
+
purpose: "event-facts",
|
|
2453
|
+
content: {
|
|
2454
|
+
heading: "",
|
|
2455
|
+
showTitle: false,
|
|
2456
|
+
showDescription: false,
|
|
2457
|
+
showCapacity: false,
|
|
2458
|
+
showAcceptedPasses: true,
|
|
2459
|
+
showAcceptedMemberships: true,
|
|
2460
|
+
showCost: true,
|
|
2461
|
+
showMap: true,
|
|
2462
|
+
showOtherDates: true,
|
|
2463
|
+
showVenue: true
|
|
2464
|
+
}
|
|
2465
|
+
}] : [],
|
|
2466
|
+
...description ? [{
|
|
2467
|
+
id: BOOKING_PAGE_BLOCK_IDS.description,
|
|
2468
|
+
kind: "block.body-text",
|
|
2469
|
+
purpose: "event-description",
|
|
2470
|
+
content: { body: description }
|
|
2471
|
+
}] : []
|
|
2472
|
+
];
|
|
2473
|
+
}
|
|
2474
|
+
/** A multi-run parent must not imply that one run's facts describe all its dates. */
|
|
2475
|
+
function bookingDetailEvents(selection) {
|
|
2476
|
+
switch (selection.kind) {
|
|
2477
|
+
case "occurrence": return [selection.event];
|
|
2478
|
+
case "dateChoice": return selection.dates;
|
|
2479
|
+
case "wholeSeriesRun": return [selection.run.representative];
|
|
2480
|
+
case "wholeSeriesParent": {
|
|
2481
|
+
const panel = planWholeSeriesParentBooking(selection.eligibleRuns);
|
|
2482
|
+
return panel.kind === "single" ? [panel.run.representative] : [];
|
|
2483
|
+
}
|
|
2484
|
+
case "wholeSeriesParentUnavailable": return [];
|
|
2485
|
+
}
|
|
2486
|
+
}
|
|
2487
|
+
/** Seed the route's admitted facts, never select or fetch its Event a second time. */
|
|
2488
|
+
function bookingPageSeedData({ registration, details }) {
|
|
2289
2489
|
return {
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
publishedMetaDescription: page.publishedMetaDescription ?? null,
|
|
2297
|
-
ogImageId: page.ogImageId ?? null
|
|
2490
|
+
[BOOKING_PAGE_BLOCK_IDS.registration]: { ..."events" in registration ? { events: registration.events } : { wholeSeriesRunEvents: registration.wholeSeriesRunEvents } },
|
|
2491
|
+
[BOOKING_PAGE_BLOCK_IDS.details]: { eventDetailsData: {
|
|
2492
|
+
events: details,
|
|
2493
|
+
sitePasses: { passes: [] },
|
|
2494
|
+
siteMemberships: { memberships: [] }
|
|
2495
|
+
} }
|
|
2298
2496
|
};
|
|
2299
2497
|
}
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2498
|
+
//#endregion
|
|
2499
|
+
//#region src/rendering/systemPages/serviceBookingOutline.ts
|
|
2500
|
+
const SERVICE_BOOKING_BLOCK_IDS = {
|
|
2501
|
+
hero: "service-hero",
|
|
2502
|
+
details: "service-details",
|
|
2503
|
+
description: "service-description",
|
|
2504
|
+
booking: "service-booking"
|
|
2505
|
+
};
|
|
2506
|
+
function buildServiceBookingOutline(service, design, { content, sections }) {
|
|
2507
|
+
const ids = SERVICE_BOOKING_BLOCK_IDS;
|
|
2508
|
+
const image = content.image;
|
|
2509
|
+
const sectionBlocks = bookingSectionBlocks(sections, "service-section");
|
|
2510
|
+
const main = buildCodeOwnedPageBlocks([
|
|
2511
|
+
bookingHero({
|
|
2512
|
+
id: ids.hero,
|
|
2513
|
+
title: service.title,
|
|
2514
|
+
eyebrow: "One-to-one",
|
|
2515
|
+
summary: content.summary,
|
|
2516
|
+
image
|
|
2517
|
+
}),
|
|
2518
|
+
{
|
|
2519
|
+
id: ids.details,
|
|
2520
|
+
kind: "block.service-details",
|
|
2521
|
+
purpose: "service-facts",
|
|
2522
|
+
content: { heading: "Good to know" }
|
|
2523
|
+
},
|
|
2524
|
+
...content.body ? [{
|
|
2525
|
+
id: ids.description,
|
|
2526
|
+
kind: "block.body-text",
|
|
2527
|
+
purpose: "service-description",
|
|
2528
|
+
content: { body: bookingDescription(content.body) }
|
|
2529
|
+
}] : []
|
|
2530
|
+
], design, bookingPageDesign(ids.hero, Boolean(image), design), sectionBlocks);
|
|
2531
|
+
const aside = buildCodeOwnedPageBlocks([{
|
|
2532
|
+
id: ids.booking,
|
|
2533
|
+
kind: "block.appointment-booking",
|
|
2534
|
+
purpose: "service-booking",
|
|
2535
|
+
content: {
|
|
2536
|
+
pageKind: "bookingPage",
|
|
2537
|
+
formId: "booking-form",
|
|
2538
|
+
serviceId: service.id,
|
|
2539
|
+
heading: ""
|
|
2540
|
+
}
|
|
2541
|
+
}], design);
|
|
2542
|
+
return {
|
|
2543
|
+
name: service.title,
|
|
2544
|
+
path: design.path,
|
|
2545
|
+
purpose: "service-booking",
|
|
2546
|
+
blocks: main.blocks,
|
|
2547
|
+
aside: aside.blocks
|
|
2548
|
+
};
|
|
2305
2549
|
}
|
|
2306
|
-
|
|
2307
|
-
|
|
2550
|
+
//#endregion
|
|
2551
|
+
//#region src/rendering/systemPages/servicePageContent.ts
|
|
2552
|
+
function parseServicePageContent(source) {
|
|
2553
|
+
const content = source.content;
|
|
2554
|
+
const image = mediaSchema.safeParse(content?.image);
|
|
2555
|
+
return {
|
|
2556
|
+
content: {
|
|
2557
|
+
summary: typeof content?.summary === "string" ? content.summary : "",
|
|
2558
|
+
image: image.success && image.data.type === "image" ? image.data : null,
|
|
2559
|
+
body: isCanonicalRichTextDoc(content?.body) ? content.body : null
|
|
2560
|
+
},
|
|
2561
|
+
sections: source.sections,
|
|
2562
|
+
mediaAssets: source.mediaAssets
|
|
2563
|
+
};
|
|
2308
2564
|
}
|
|
2309
2565
|
//#endregion
|
|
2310
|
-
export {
|
|
2566
|
+
export { buildTemplatePageOutline as _, bookingDetailEvents as a, buildBookingPageOutline as c, buildCodeOwnedPageBlocks as d, createPublicBlockContentContractResolver as f, bookingSectionBlocks as g, bookingPageDesign as h, BOOKING_PAGE_BLOCK_IDS as i, bookingPageIdentity as l, bookingHero as m, SERVICE_BOOKING_BLOCK_IDS as n, bookingPageFacts as o, bookingDescription as p, buildServiceBookingOutline as r, bookingPageSeedData as s, parseServicePageContent as t, plainTextDoc as u, readStoredSectionValues as v, selectBlocksForDeclaredEntrySlot as y };
|