@riverbankcms/sdk 0.178.0 → 0.180.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-DC_AvZwy.d.ts} +1 -1
- package/dist/_dts/{Page-C9i27wZA.d.ts → Page-DQOxVtp3.d.ts} +7 -7
- package/dist/_dts/{SdkPreviewMode-DzGSR3jh.d.ts → SdkPreviewMode-DrLgY9_f.d.ts} +3 -2
- package/dist/_dts/{client-BnYN6XsH.d.ts → client-BP7VBRvs.d.ts} +281 -72
- package/dist/_dts/{content-types-CXj6lp3d.d.ts → content-types-1-K2qi__.d.ts} +2 -2
- package/dist/_dts/{contracts-BZLwkTwL.d.ts → contracts-Dfqz0Tcu.d.ts} +6 -116
- package/dist/_dts/{generatePageMetadata-ByEWwe9j.d.ts → generatePageMetadata-CSfAqmry.d.ts} +2 -2
- package/dist/_dts/{index-BE9dWIsr.d.ts → index-B0_2-65A.d.ts} +3 -3
- package/dist/_dts/{index-0HFgCnGz.d.ts → index-BeM5Ylwf.d.ts} +5 -3
- package/dist/_dts/{index-D9-N1d9v.d.ts → index-Blrw2oVk.d.ts} +1 -1
- package/dist/_dts/{index-cTpvQg_Q.d.ts → index-CB5Csefo.d.ts} +2 -2
- package/dist/_dts/{index-nnEdgc3Z.d.ts → index-DCcxLa8p.d.ts} +4 -2
- package/dist/_dts/{index-DCa-8TEY.d.ts → index-DQBGwBPx.d.ts} +1 -1
- package/dist/_dts/{index-CKDRr54L.d.ts → index-DQr358-m.d.ts} +4 -4
- package/dist/_dts/{loadContent-DYkVV6w4.d.ts → loadContent-BG2tLGXj.d.ts} +15 -13
- package/dist/_dts/{request-B20VRWHH.d.ts → request-P08l6mkr.d.ts} +3641 -994
- package/dist/_dts/{resolveBlockData-C_aK5GIS.d.ts → resolveBlockData-BDHc8lFs.d.ts} +8 -5
- package/dist/_dts/resolvePageContent-Y3IZBbtL.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 +3 -3
- 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-BvtNagjw.d.ts +583 -0
- package/dist/_dts/{types-CYcd15BQ.d.ts → types-BrK6SS5c.d.ts} +9 -7
- package/dist/_dts/{types-CMZ5mkpv.d.ts → types-DpEAnP4F.d.ts} +10 -39
- package/dist/_dts/{types-rm2M4LGx.d.ts → types-HAy1-Jjo.d.ts} +3 -3
- package/dist/_dts/{validation-BSxnRhyy.d.ts → validation-D6q3tOBA.d.ts} +4 -4
- package/dist/client/{BlocksIslandsHydrator-D1n09bu-.mjs → BlocksIslandsHydrator-DJSmdNUJ.mjs} +17 -18
- package/dist/client/{BookingMailingListNote-DSD4gS96.mjs → BookingMailingListNote-CGxg37zx.mjs} +92 -60
- package/dist/client/{BookingQuestionFields-B57oGPcj.mjs → BookingQuestionFields-DXegGSnS.mjs} +26 -5
- package/dist/client/{CalendarNavigationChevron-qXvsFYOg.mjs → CalendarNavigationChevron-VfP50sYm.mjs} +42 -9
- package/dist/client/{CheckboxChoice-b-PJLEXe.mjs → CheckboxChoice-BZPLCgTU.mjs} +1 -1
- package/dist/client/{DemoBookingPortalAccess-Olvrwi3Z.mjs → DemoBookingPortalAccess-0Ua44F1j.mjs} +13 -8
- package/dist/client/{EventCalendar.client-DwFNFb-0.mjs → EventCalendar.client-CrpiyDSP.mjs} +10 -10
- package/dist/client/{EventCombined.client-Ffu-aVOb.mjs → EventCombined.client-D0me9wnz.mjs} +10 -10
- package/dist/client/{EventEmbeddedCheckoutStep-B18VbNS_.mjs → EventEmbeddedCheckoutStep-BDnicDM6.mjs} +1 -1
- package/dist/client/{EventItem-b8tVkNHA.mjs → EventItem-CJITrGkF.mjs} +249 -8
- package/dist/client/{EventListWeekNavigation-BxnJW_Gf.mjs → EventListWeekNavigation-BlEm_xjq.mjs} +1 -1
- package/dist/client/{EventListing.client-ViCnrNg4.mjs → EventListing.client-BNM_HuS0.mjs} +3 -3
- package/dist/client/{EventListing.view-CdjiepMf.mjs → EventListing.view-CXfb7RRy.mjs} +7 -16
- package/dist/client/{EventRegistrationPayment-BVd70XkH.mjs → EventRegistrationPayment-DiD9uYs6.mjs} +1439 -293
- package/dist/client/{Page-DqETUt-U.mjs → Page-bX7iy_MK.mjs} +24299 -20103
- package/dist/client/{ProtectedSubmitButton-C-ql101B.mjs → ProtectedSubmitButton-De6AzhE6.mjs} +1 -1
- package/dist/client/{SiteTermsAgreementField-DkFnbzf_.mjs → SiteTermsAgreementField-BAdW5DvE.mjs} +23 -16
- package/dist/client/{BookingPanelArrangement--EkA1ZQd.mjs → StepIndicator-DCfdcb7s.mjs} +12 -12
- package/dist/client/{StepIndicator-JO2PS03n.mjs → StepIndicator-DCqorVne.mjs} +7 -7
- 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-wofJY8xY.mjs} +1 -1
- package/dist/client/{booking-form.client-ljJoDwuI.mjs → booking-form.client-CYl9NrqS.mjs} +412 -79
- package/dist/client/{bookingForm-DtEHwY4W.mjs → bookingForm-kgVWtuMe.mjs} +4 -4
- package/dist/client/bookings.mjs +40 -10
- package/dist/client/{boxStyleClassNames-BHoMAcun.mjs → boxStyleClassNames-CQHWz5gJ.mjs} +19 -19
- package/dist/client/{carousel-B3UhbFu7.mjs → carousel-BE1dEFsD.mjs} +2 -2
- package/dist/client/{carousel.client-h65clfUO.mjs → carousel.client-DMtGYTTM.mjs} +1 -1
- package/dist/client/{cart-DzOJfYOR.mjs → cart-BsjsdGZE.mjs} +3 -3
- package/dist/client/{cart.client-DBG77v-5.mjs → cart.client-DylGUWXY.mjs} +1 -1
- package/dist/client/{checkout-LmePoEgM.mjs → checkout-B5KxEUDr.mjs} +3 -3
- package/dist/client/{checkout.client-DmgZuLBT.mjs → checkout.client-C98fhch3.mjs} +1 -1
- package/dist/client/{checkoutUrls-CMZI8o_V.mjs → checkoutUrls-BMLYTf38.mjs} +1 -1
- package/dist/client/client.mjs +502 -341
- package/dist/client/constants-PfYJsEZF.mjs +101 -0
- package/dist/client/{context-CJIz4FdL.mjs → context-DtKdUdkO.mjs} +200 -27
- package/dist/client/{dateFormatting-UoXqBh10.mjs → dateFormatting-BaGPvQS3.mjs} +1 -1
- package/dist/client/{demoPortalMagicLink-6CgFZNvu.mjs → demoPortalMagicLink-B8eDjhuG.mjs} +1 -1
- package/dist/client/{enhanceHeaderSection-DaMo6len.mjs → enhanceHeaderSection-DvhD-8eE.mjs} +4 -4
- package/dist/client/{event-registration.client-b6APrFQe.mjs → event-registration.client-Du9a_xAN.mjs} +1982 -1519
- package/dist/client/{eventCalendar-DJYz7yZf.mjs → eventCalendar-Di9wDfzl.mjs} +4 -4
- package/dist/client/{eventCombined-j9VCVgMW.mjs → eventCombined-CNW6nBsB.mjs} +4 -4
- package/dist/client/{eventListing-DWgpGuFM.mjs → eventListing-CQMxQ8By.mjs} +4 -4
- package/dist/client/{eventRegistration-DCinRot3.mjs → eventRegistration-CprS9k1D.mjs} +4 -4
- package/dist/client/events-9LPvwbWp.mjs +28 -0
- package/dist/client/{form-BBBtRwvy.mjs → form-Zl1_8RJ6.mjs} +3 -3
- package/dist/client/{form.client-CZeRQLGF.mjs → form.client-TaMUys6I.mjs} +5 -5
- package/dist/client/{form.parts-DhGGv4_L.mjs → form.parts-CpNPbPPM.mjs} +3 -3
- package/dist/client/{formatDate-DVFVDcDW.mjs → formatDate-hhI1-tzt.mjs} +1 -1
- package/dist/client/gifting/client.mjs +6 -6
- package/dist/client/{gifting-Di9-SpwW.mjs → gifting-DNVa7-Wj.mjs} +4 -4
- package/dist/client/{gifting.client-CjT5PrAZ.mjs → gifting.client-CFUq3GVx.mjs} +5 -5
- package/dist/client/{gifting.parts-ffP6mjMd.mjs → gifting.parts-CDQvxA4A.mjs} +2 -2
- package/dist/client/{headerSection-jjAvtSZk.mjs → headerSection-Cg6083rn.mjs} +2 -2
- package/dist/client/{lookSurfaces-C2VzJfyG.mjs → lookSurfaces-gJ3OqPf9.mjs} +258 -86
- package/dist/client/{newsletter-form.client-D45frHoa.mjs → newsletter-form.client-VuL9I96G.mjs} +6 -6
- package/dist/client/{shop.interactive-D7wky1GL.mjs → newsletter-form.interactive-7Of3eYn0.mjs} +4023 -4029
- package/dist/client/{newsletter-form.parts-CHdg82ct.mjs → newsletter-form.parts-OBqsfT24.mjs} +2 -2
- package/dist/client/{newsletterForm-tS465_vl.mjs → newsletterForm-BkJe_RTv.mjs} +3 -3
- package/dist/client/portal/client.mjs +301 -117
- package/dist/client/{product-detail.client-DIWSeW7P.mjs → product-detail.client-B2hdxqJN.mjs} +1 -1
- package/dist/client/{product-list.client-BRf14h_e.mjs → product-list.client-CCEgu9rx.mjs} +1 -1
- package/dist/client/{productDetail-gxF5whea.mjs → productDetail-CRX_ZRfS.mjs} +3 -3
- package/dist/client/{productList-B9t0XJrN.mjs → productList-BAdJ6z5S.mjs} +3 -3
- package/dist/client/{propsDecoder-Db8wAmgr.mjs → propsDecoder-BLKAmX0S.mjs} +2 -48
- package/dist/client/{registry.server-Bn0gE0uP.mjs → registry.server-Bj9cmHHF.mjs} +10464 -9113
- 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-Z45OLLEX.mjs} +1 -1
- package/dist/client/{routeIslandApiConfig-Bok1Oy50.mjs → routeIslandApiConfig-DHpTTK77.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-BKsgxm_-.mjs} +3 -3
- package/dist/client/{shop-commerce-DyMZLC0a.mjs → shop-commerce-Cbtk_kUW.mjs} +14 -14
- package/dist/client/{shop-commerce-store-FODNS63D.mjs → shop-commerce-store-B-rv2p5h.mjs} +1 -1
- package/dist/client/{shop-discount-apply.state-C4xcmFzZ.mjs → shop-discount-apply.state-CiCDLNh7.mjs} +2 -2
- package/dist/client/{shop.client-CRgRulfI.mjs → shop.client-Rnqa74Tk.mjs} +14 -14
- package/dist/client/{shopShared-Bd_hy9ZO.mjs → shopShared-BaBfhjCq.mjs} +2 -2
- package/dist/client/spam-protection.mjs +1 -1
- package/dist/client/{noop-D11X-B6n.mjs → src-o7WEvbK1.mjs} +398 -308
- package/dist/client/{timetableModel-UlWfP1gh.mjs → timetableModel-BOff1Kk5.mjs} +259 -11
- package/dist/client/{types-DjWUR_O6.mjs → types-BEaKfam_.mjs} +65 -65
- package/dist/client/{useAvailableSlots-D-qoooLy.mjs → useAvailableSlots-DQJNh10g.mjs} +3 -23
- package/dist/client/useDiscountCodeUi-BcFQRI_7.mjs +196 -0
- package/dist/client/{useEventPagination-CQH2e9sQ.mjs → useEventPagination-BvdcexDC.mjs} +8 -8
- package/dist/client/{view-bGU1ws-m.mjs → view-CTBwSpKv.mjs} +4 -4
- package/dist/client/{display-D1oVR5Eh.mjs → wizardSteps-CWIQyRIw.mjs} +10263 -9078
- package/dist/preview-next/before-render.mjs +5 -3
- package/dist/preview-next/client/{LocationPickerEnvironment-BHAT81Wx.mjs → LocationPickerEnvironment-BW3dRFIv.mjs} +1 -1
- package/dist/preview-next/client/{MapLibreEditMap-B52hkdIZ.mjs → MapLibreEditMap-Db9BHyXh.mjs} +2 -2
- package/dist/preview-next/client/{PageSectionToolbar-D-Le7O3o.mjs → PageSectionToolbar-CG6KwITA.mjs} +4 -4
- package/dist/preview-next/client/{PreviewEditorSidebar-DNy5j_ce.mjs → PreviewEditorSidebar-BGBqrC9m.mjs} +8 -7
- package/dist/preview-next/client/{PreviewEditorUI-CzJvgbqt.mjs → PreviewEditorUI-Bwkyx28x.mjs} +5 -5
- package/dist/preview-next/client/{PreviewShell-xhJ6ca1i.mjs → PreviewShell-DB1l6JNU.mjs} +7 -7
- package/dist/preview-next/client/{SdkPreviewModeRuntime-BmYO1TdT.mjs → SdkPreviewModeRuntime-Bs6Cwzr3.mjs} +15 -7
- package/dist/preview-next/client/{lucide-react-McYZeSMb.mjs → lucide-react-00FF_oar.mjs} +13 -1
- package/dist/preview-next/client/{previewAssistantSlot-BN93X9o1.mjs → previewAssistantSlot-T-oDD_Dd.mjs} +6252 -2461
- package/dist/preview-next/client/{previewChromeRoot-C51RQseo.mjs → previewChromeRoot-BeukcDRy.mjs} +1 -1
- package/dist/preview-next/client/runtime.mjs +3 -3
- package/dist/preview-next/client/{sdk-runtime-oeGquJM-.mjs → sdk-runtime-ceDW_9q2.mjs} +2 -2
- package/dist/preview-next/client/{siteStyleAccess-BGTAcPud.mjs → siteStyleAccess-CCB9bScO.mjs} +35 -23
- package/dist/preview-next/client/{useAutosaveStatus-BMGXjGZq.mjs → useAutosaveStatus-D4o0CKq7.mjs} +1 -1
- package/dist/preview-next/client/{useOpenBlockForSetup-CTDoR_gQ.mjs → useOpenBlockForSetup-Seccrvwu.mjs} +2 -2
- package/dist/preview-next/container-responsive.css +103 -10
- 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-FwFj8zGL.mjs} +71 -10
- package/dist/server/{Block.shared-Bp3OlOjj.mjs → Block.shared-D6WrRCxX.mjs} +4 -4
- package/dist/server/{ThemeScopeCore-DFEM1a85.mjs → ThemeScopeCore-BQzjDQ2q.mjs} +8 -1
- package/dist/server/{bindings-DrbJuftt.mjs → bindings-CS6ih1Yc.mjs} +37 -6
- package/dist/server/{client-Bf06n9oj.mjs → client-m0ylCj_f.mjs} +436 -526
- 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-vgWMz1uD.mjs +694 -0
- package/dist/server/{loadPage-5iZefzDd.mjs → loadPage-CIOL3-9t.mjs} +22 -4
- package/dist/server/{lookMediaFrame-CaH018pK.mjs → lookMediaFrame-m-91jGGn.mjs} +36 -0
- package/dist/server/next.mjs +67 -94
- package/dist/server/{overrideResolution-CUHtm7tW.mjs → overrideResolution-BiHmsvTZ.mjs} +1 -1
- package/dist/server/page-converter.mjs +1 -1
- package/dist/server/{pageRenderPlan-GmPXForc.mjs → pageRenderPlan-DJo_obpi.mjs} +15 -8
- package/dist/server/{pageRuntimeSupport-Dd8LFzfa.mjs → pageRuntimeSupport-BnSuoHON.mjs} +54 -2
- package/dist/server/{pageShared-tz-GVWft.mjs → pageShared-BJuOzxzn.mjs} +554 -304
- package/dist/server/{prebuild-JmsuYCIH.mjs → prebuild-Cr8p8T7V.mjs} +5 -4
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/{prefetchBlockData-Ce9DDwON.mjs → prefetchBlockData-BZh57-ua.mjs} +5 -3
- package/dist/server/{registry-D12XF_h1.mjs → registry-CvhFwbXJ.mjs} +358 -95
- 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-Cv_W1LVB.mjs} +61 -34
- package/dist/server/resolvePageContent-BWKUZUIn.mjs +89 -0
- package/dist/server/{responseMedia-F-ElH2Rd.mjs → responseMedia-KRKguBC5.mjs} +56 -1
- package/dist/server/routing.mjs +271 -57
- package/dist/server/server.mjs +3 -3
- package/dist/server/{loadContent-eaTY7RPg.mjs → servicePageContent-CRKbTm_7.mjs} +719 -459
- package/dist/server/theme-bridge.mjs +1 -1
- package/dist/server/{validation-CLq5cw6M.mjs → validation-DCl-FCk_.mjs} +4 -4
- package/dist/server/{version-oPbhAx8E.mjs → version-DT_R5JAR.mjs} +1 -1
- package/dist/styles/index.css +504 -27
- 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/constants-4o4_hl34.mjs +0 -6
- 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
|
@@ -0,0 +1,694 @@
|
|
|
1
|
+
import { In as registrationDataForEventSelection, Rn as selectionRepresentativeEvent, ic as resolveBookingBusinessTimeZone, na as isRecord, sr as resolveDateRuntimeContext } from "./registry-CvhFwbXJ.mjs";
|
|
2
|
+
import { P as readPublishedBlockPlacement, a as invalidRenderableBlock, d as siteBlockRenderContext, h as compileManifestContentContract, i as collectMediaAssetSidecar, l as resolveSdkBlockManifest, m as admitTransportedRenderableManifestContent, n as buildRenderablePageOutline, o as projectRenderablePageOutline, r as buildSiteRenderSupport, s as readInvalidBlockAdmission, u as sanitizeSdkRuntimeBlockContent } from "./pageRuntimeSupport-BnSuoHON.mjs";
|
|
3
|
+
import { _ as buildTemplatePageOutline, c as buildBookingPageOutline, l as bookingPageIdentity, n as SERVICE_BOOKING_BLOCK_IDS, o as bookingPageFacts, r as buildServiceBookingOutline, s as bookingPageSeedData, t as parseServicePageContent, v as readStoredSectionValues, y as selectBlocksForDeclaredEntrySlot } from "./servicePageContent-CRKbTm_7.mjs";
|
|
4
|
+
import { r as requireSdkTheme } from "./themeAdmission-DGSAlFUK.mjs";
|
|
5
|
+
import { r as normalizeDataLoaderSearchParams } from "./dataLoaderContext-lMRTfG5Z.mjs";
|
|
6
|
+
import { n as DEFAULT_RESOLVE_BLOCK_DATA_DEPS, o as resolveBlockDataWithDeps, r as createBlockDataLoadPolicy } from "./resolveBlockData-Cv_W1LVB.mjs";
|
|
7
|
+
//#region ../api/src/publicBookingService.ts
|
|
8
|
+
/** Adapt an admitted service to the catalogue row consumed by booking pickers. */
|
|
9
|
+
function toPublicBookingServiceCatalogueItem(service, categoryId) {
|
|
10
|
+
return {
|
|
11
|
+
categoryId,
|
|
12
|
+
requiresApproval: service.requiresApproval,
|
|
13
|
+
...service.onlinePaymentMode === void 0 ? {} : { onlinePaymentMode: service.onlinePaymentMode },
|
|
14
|
+
...service.onlinePaymentChoices === void 0 ? {} : { onlinePaymentChoices: service.onlinePaymentChoices },
|
|
15
|
+
...service.onlinePayments === void 0 ? {} : { onlinePayments: service.onlinePayments },
|
|
16
|
+
id: service.id,
|
|
17
|
+
asksSiteTerms: service.asksSiteTerms,
|
|
18
|
+
siteId: service.siteId,
|
|
19
|
+
slug: service.slug,
|
|
20
|
+
title: service.title,
|
|
21
|
+
image: service.image ?? null,
|
|
22
|
+
description: service.description ?? void 0,
|
|
23
|
+
durationMinutes: service.durationMinutes,
|
|
24
|
+
...service.pricing === void 0 ? {} : { pricing: service.pricing },
|
|
25
|
+
priceAmount: service.priceAmount,
|
|
26
|
+
priceCurrency: service.priceCurrency,
|
|
27
|
+
paymentTerms: service.paymentTerms,
|
|
28
|
+
paymentTermsAvailability: service.paymentTermsAvailability,
|
|
29
|
+
location: service.location,
|
|
30
|
+
cancellationPolicy: service.cancellationPolicy,
|
|
31
|
+
bookingQuestions: service.bookingQuestions,
|
|
32
|
+
...service.consent ? { consent: service.consent } : {}
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
//#endregion
|
|
36
|
+
//#region src/rendering/helpers/loadSelectedSystemPage.ts
|
|
37
|
+
function authoredSubject(content) {
|
|
38
|
+
if (content?.type === "pageSurface") return content.pageSurface;
|
|
39
|
+
return content?.type === "entry" ? content.entry : null;
|
|
40
|
+
}
|
|
41
|
+
function authoredFields(content) {
|
|
42
|
+
const subject = authoredSubject(content);
|
|
43
|
+
return {
|
|
44
|
+
...authoredSubjectFields(subject),
|
|
45
|
+
mediaAssets: content?.mediaAssets ?? [],
|
|
46
|
+
sections: content?.type === "pageSurface" && content.pageSections ? {
|
|
47
|
+
...content.pageSections,
|
|
48
|
+
values: readStoredSectionValues(subject?.content)
|
|
49
|
+
} : null
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
function authoredSubjectFields(subject) {
|
|
53
|
+
if (!subject) return {
|
|
54
|
+
content: null,
|
|
55
|
+
metaTitle: null,
|
|
56
|
+
metaDescription: null,
|
|
57
|
+
draftMetaTitle: null,
|
|
58
|
+
draftMetaDescription: null
|
|
59
|
+
};
|
|
60
|
+
return {
|
|
61
|
+
content: subject.content ?? null,
|
|
62
|
+
metaTitle: subject.metaTitle ?? null,
|
|
63
|
+
metaDescription: subject.metaDescription ?? null,
|
|
64
|
+
draftMetaTitle: subject.draftMetaTitle ?? null,
|
|
65
|
+
draftMetaDescription: subject.draftMetaDescription ?? null
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
function systemPagePlan(destination, support) {
|
|
69
|
+
const authored = authoredFields(destination.authored);
|
|
70
|
+
const design = {
|
|
71
|
+
theme: requireSdkTheme(support.theme, support.site.id),
|
|
72
|
+
path: destination.canonicalPath,
|
|
73
|
+
resolveBlockContentContract: (kind) => {
|
|
74
|
+
const manifest = resolveSdkBlockManifest(kind, support.customBlocks);
|
|
75
|
+
return manifest ? compileManifestContentContract(manifest) : null;
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
if (destination.kind === "system_service") return {
|
|
79
|
+
outline: buildServiceBookingOutline(destination.service, design, parseServicePageContent(authored)),
|
|
80
|
+
seed: {
|
|
81
|
+
[SERVICE_BOOKING_BLOCK_IDS.details]: { service: [destination.service] },
|
|
82
|
+
[SERVICE_BOOKING_BLOCK_IDS.booking]: { services: {
|
|
83
|
+
services: [toPublicBookingServiceCatalogueItem(destination.service, null)],
|
|
84
|
+
categories: []
|
|
85
|
+
} }
|
|
86
|
+
},
|
|
87
|
+
subject: {
|
|
88
|
+
kind: "appointmentService",
|
|
89
|
+
appointmentServiceId: destination.service.id
|
|
90
|
+
},
|
|
91
|
+
occurrenceContext: null,
|
|
92
|
+
timeZone: support.bookingTimeZone,
|
|
93
|
+
title: destination.service.title,
|
|
94
|
+
description: destination.service.description,
|
|
95
|
+
ownTitle: null,
|
|
96
|
+
ownDescription: null,
|
|
97
|
+
authored
|
|
98
|
+
};
|
|
99
|
+
const registration = registrationDataForEventSelection(destination.selection);
|
|
100
|
+
const event = selectionRepresentativeEvent(destination.selection);
|
|
101
|
+
const identity = bookingPageIdentity(destination.selection);
|
|
102
|
+
return {
|
|
103
|
+
outline: buildBookingPageOutline(destination.selection, design, authored.sections),
|
|
104
|
+
seed: bookingPageSeedData(bookingPageFacts(destination.selection)),
|
|
105
|
+
subject: registration.subject ?? {
|
|
106
|
+
kind: "eventSeries",
|
|
107
|
+
eventSeriesId: event.seriesId,
|
|
108
|
+
bookingScope: "single_occurrence"
|
|
109
|
+
},
|
|
110
|
+
occurrenceContext: "occurrenceContext" in registration ? registration.occurrenceContext ?? null : null,
|
|
111
|
+
timeZone: event.timeZone,
|
|
112
|
+
title: identity.title,
|
|
113
|
+
description: event.presentation?.summary ?? event.description ?? null,
|
|
114
|
+
ownTitle: identity.ownTitle,
|
|
115
|
+
ownDescription: identity.ownDescription,
|
|
116
|
+
authored
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
/** Build from the admitted subject. Seeded details/registration never fetch or select again. */
|
|
120
|
+
async function loadSelectedSystemPage(deps, params, destination) {
|
|
121
|
+
const support = buildSiteRenderSupport(params.site, destination.authored?.mediaAssets);
|
|
122
|
+
const plan = systemPagePlan(destination, support);
|
|
123
|
+
const bookingTimeZone = resolveBookingBusinessTimeZone(plan.timeZone);
|
|
124
|
+
const previewStage = params.preview ? "preview" : "published";
|
|
125
|
+
const prefetched = await resolveBlockDataWithDeps(deps, {
|
|
126
|
+
page: projectRenderablePageOutline(plan.outline),
|
|
127
|
+
siteId: params.siteId,
|
|
128
|
+
client: params.client,
|
|
129
|
+
previewStage,
|
|
130
|
+
renderTarget: {
|
|
131
|
+
kind: "system-page",
|
|
132
|
+
path: destination.canonicalPath,
|
|
133
|
+
subject: plan.subject,
|
|
134
|
+
occurrenceContext: plan.occurrenceContext
|
|
135
|
+
},
|
|
136
|
+
policy: createBlockDataLoadPolicy(params.dataLoaderOverrides, normalizeDataLoaderSearchParams(params.searchParams)),
|
|
137
|
+
seededData: plan.seed,
|
|
138
|
+
customBlocks: support.customBlocks,
|
|
139
|
+
bookingTimeZone,
|
|
140
|
+
now: support.now
|
|
141
|
+
});
|
|
142
|
+
return {
|
|
143
|
+
...support,
|
|
144
|
+
bookingTimeZone,
|
|
145
|
+
type: "page",
|
|
146
|
+
pageId: null,
|
|
147
|
+
routeId: null,
|
|
148
|
+
pageRead: params.contentResponse,
|
|
149
|
+
page: plan.outline,
|
|
150
|
+
resolvedData: prefetched.resolvedData,
|
|
151
|
+
runtimeJoins: [],
|
|
152
|
+
theme: support.theme,
|
|
153
|
+
siteId: params.siteId,
|
|
154
|
+
pageMetadata: {
|
|
155
|
+
title: plan.title,
|
|
156
|
+
draftTitle: plan.title,
|
|
157
|
+
path: destination.canonicalPath,
|
|
158
|
+
draftPath: destination.canonicalPath,
|
|
159
|
+
status: "published",
|
|
160
|
+
draftStatus: "published",
|
|
161
|
+
publishedAt: null,
|
|
162
|
+
ogImageId: null,
|
|
163
|
+
draftMetaTitle: plan.ownTitle ?? plan.authored.draftMetaTitle,
|
|
164
|
+
publishedMetaTitle: plan.ownTitle ?? plan.authored.metaTitle,
|
|
165
|
+
draftMetaDescription: plan.ownDescription ?? plan.authored.draftMetaDescription ?? plan.description,
|
|
166
|
+
publishedMetaDescription: plan.ownDescription ?? plan.authored.metaDescription ?? plan.description
|
|
167
|
+
},
|
|
168
|
+
dataContext: {
|
|
169
|
+
...siteBlockRenderContext(support),
|
|
170
|
+
previewStage,
|
|
171
|
+
now: support.now,
|
|
172
|
+
subject: plan.subject,
|
|
173
|
+
occurrenceContext: plan.occurrenceContext,
|
|
174
|
+
prefetchedBlockData: prefetched,
|
|
175
|
+
loaderSnapshot: prefetched.loaderSnapshot,
|
|
176
|
+
loaderFailures: prefetched.loaderFailures
|
|
177
|
+
}
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
//#endregion
|
|
181
|
+
//#region src/rendering/helpers/templateContent.ts
|
|
182
|
+
function createTemplateRenderTarget(source, templateId) {
|
|
183
|
+
switch (source.kind) {
|
|
184
|
+
case "entry-template": return {
|
|
185
|
+
kind: source.kind,
|
|
186
|
+
templateId,
|
|
187
|
+
entryId: source.entryId,
|
|
188
|
+
entryType: source.entryType
|
|
189
|
+
};
|
|
190
|
+
case "page-surface-template": return {
|
|
191
|
+
kind: source.kind,
|
|
192
|
+
templateId,
|
|
193
|
+
pageSurfaceId: source.pageSurfaceId,
|
|
194
|
+
routeId: source.routeId,
|
|
195
|
+
subject: source.subject
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
function processEntryTemplate(input) {
|
|
200
|
+
return processTemplatePage({
|
|
201
|
+
...input,
|
|
202
|
+
slotContent: input.entrySlots,
|
|
203
|
+
pageName: "Entry Template",
|
|
204
|
+
pagePath: input.entry.path || "/",
|
|
205
|
+
pagePurpose: "entry-template",
|
|
206
|
+
renderTargetSource: {
|
|
207
|
+
kind: "entry-template",
|
|
208
|
+
entryId: input.entry.id,
|
|
209
|
+
entryType: input.entry.type
|
|
210
|
+
}
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
async function processTemplatePage(input) {
|
|
214
|
+
const template = input.templates?.[0];
|
|
215
|
+
if (!template?.blocks?.length) return {
|
|
216
|
+
templatePage: null,
|
|
217
|
+
resolvedData: {}
|
|
218
|
+
};
|
|
219
|
+
const templatePage = materializeSdkTemplate(input, template);
|
|
220
|
+
if (templatePage === null) return {
|
|
221
|
+
templatePage: null,
|
|
222
|
+
resolvedData: {}
|
|
223
|
+
};
|
|
224
|
+
const prefetched = await resolveBlockDataWithDeps(input.deps, {
|
|
225
|
+
bookingTimeZone: input.bookingTimeZone,
|
|
226
|
+
now: input.now,
|
|
227
|
+
entrySubrouteData: input.entrySubrouteData,
|
|
228
|
+
page: projectRenderablePageOutline(templatePage),
|
|
229
|
+
siteId: input.siteId,
|
|
230
|
+
renderTarget: createTemplateRenderTarget(input.renderTargetSource, template.id),
|
|
231
|
+
previewStage: input.previewStage,
|
|
232
|
+
policy: input.blockDataPolicy,
|
|
233
|
+
client: input.client,
|
|
234
|
+
customBlocks: input.customBlocks
|
|
235
|
+
});
|
|
236
|
+
return {
|
|
237
|
+
templatePage,
|
|
238
|
+
prefetchedBlockData: prefetched,
|
|
239
|
+
...prefetched
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
/** Pure adapter: the shared renderer owns bindings, applicability, Looks and admission. */
|
|
243
|
+
function materializeSdkTemplate(input, template) {
|
|
244
|
+
return buildTemplatePageOutline({
|
|
245
|
+
entry: input.entry,
|
|
246
|
+
subject: templateCompilerSubject(input.renderTargetSource),
|
|
247
|
+
dateContext: resolveDateRuntimeContext(input.bookingTimeZone),
|
|
248
|
+
template: toContentTemplate(template),
|
|
249
|
+
page: {
|
|
250
|
+
name: template.name || input.pageName,
|
|
251
|
+
path: input.pagePath,
|
|
252
|
+
purpose: input.pagePurpose
|
|
253
|
+
},
|
|
254
|
+
theme: input.theme,
|
|
255
|
+
pageSections: input.pageSections,
|
|
256
|
+
resolveEntrySlotBlocks: ({ slotKey }) => selectBlocksForDeclaredEntrySlot({
|
|
257
|
+
declaredSlotKey: slotKey,
|
|
258
|
+
entrySlots: input.slotContent ?? []
|
|
259
|
+
}).map((block) => admitEntrySlotBlock(block, input.customBlocks, input.previewStage)),
|
|
260
|
+
resolveBlockContentContract: (kind) => {
|
|
261
|
+
const manifest = resolveSdkBlockManifest(kind, input.customBlocks);
|
|
262
|
+
return manifest === null ? null : compileManifestContentContract(manifest);
|
|
263
|
+
}
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
function templateCompilerSubject(source) {
|
|
267
|
+
switch (source.kind) {
|
|
268
|
+
case "entry-template": return;
|
|
269
|
+
case "page-surface-template": return source.subject;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
/** Adapt the SDK transport to the shared template renderer; decisions stay there. */
|
|
273
|
+
function toContentTemplate(template) {
|
|
274
|
+
return {
|
|
275
|
+
id: template.id,
|
|
276
|
+
name: template.name,
|
|
277
|
+
templateKey: template.templateKey,
|
|
278
|
+
designState: template.designState,
|
|
279
|
+
blocks: template.blocks.map((block, orderIndex) => ({
|
|
280
|
+
...block,
|
|
281
|
+
orderIndex,
|
|
282
|
+
content: sanitizeSdkRuntimeBlockContent(block.blockKind, block.content ?? {}),
|
|
283
|
+
bindings: block.bindings ?? null
|
|
284
|
+
}))
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
function admitEntrySlotBlock(block, customBlocks, previewStage) {
|
|
288
|
+
const base = {
|
|
289
|
+
id: block.id ?? block.blockId ?? null,
|
|
290
|
+
...block.identifier ? { identifier: block.identifier } : {},
|
|
291
|
+
contentVersionId: block.contentVersionId,
|
|
292
|
+
...entrySlotBlockIdentity(block, previewStage),
|
|
293
|
+
kind: block.kind,
|
|
294
|
+
purpose: block.purpose,
|
|
295
|
+
...isRecord(block.bindings) ? { bindings: block.bindings } : {}
|
|
296
|
+
};
|
|
297
|
+
const transportedAdmission = readInvalidBlockAdmission(block.admission);
|
|
298
|
+
if (transportedAdmission) return invalidRenderableBlock(base, transportedAdmission.error);
|
|
299
|
+
const manifest = resolveSdkBlockManifest(block.kind, customBlocks);
|
|
300
|
+
if (manifest === null) return invalidRenderableBlock(base, { kind: "manifest_unavailable" });
|
|
301
|
+
const renderable = admitTransportedRenderableManifestContent(compileManifestContentContract(manifest), block.content ?? {});
|
|
302
|
+
return renderable.ok ? {
|
|
303
|
+
...base,
|
|
304
|
+
admission: {
|
|
305
|
+
kind: "renderable",
|
|
306
|
+
content: renderable.value
|
|
307
|
+
}
|
|
308
|
+
} : invalidRenderableBlock(base, {
|
|
309
|
+
kind: "invalid_manifest_content",
|
|
310
|
+
error: renderable.error
|
|
311
|
+
});
|
|
312
|
+
}
|
|
313
|
+
function entrySlotBlockIdentity(block, previewStage) {
|
|
314
|
+
return {
|
|
315
|
+
draftContentId: block.draftContentId ?? null,
|
|
316
|
+
publishedPlacement: previewStage === "preview" ? readPublishedBlockPlacement(block.publishedContentId, isRecord(block.publishedContent) && isRecord(block.publishedContent.data) ? block.publishedContent.data : null) : null
|
|
317
|
+
};
|
|
318
|
+
}
|
|
319
|
+
//#endregion
|
|
320
|
+
//#region src/rendering/helpers/loadContent.ts
|
|
321
|
+
/**
|
|
322
|
+
* Type guard to check if result is a page
|
|
323
|
+
*/
|
|
324
|
+
function isPageContent(result) {
|
|
325
|
+
return result.type === "page";
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* Type guard to check if result is an entry
|
|
329
|
+
*/
|
|
330
|
+
function isEntryContent(result) {
|
|
331
|
+
return result.type === "entry";
|
|
332
|
+
}
|
|
333
|
+
function isPageSurfaceContent(result) {
|
|
334
|
+
return result.type === "pageSurface";
|
|
335
|
+
}
|
|
336
|
+
function isContentLoadNotFoundError(error) {
|
|
337
|
+
if (typeof error !== "object" || error === null || !("status" in error)) return false;
|
|
338
|
+
return Reflect.get(error, "status") === 404;
|
|
339
|
+
}
|
|
340
|
+
function getRejectedReason(result) {
|
|
341
|
+
return result.reason;
|
|
342
|
+
}
|
|
343
|
+
function toTemplateContentRenderSupport(support, siteId) {
|
|
344
|
+
return {
|
|
345
|
+
bookingOfferingPresets: support.bookingOfferingPresets,
|
|
346
|
+
openingHours: support.openingHours,
|
|
347
|
+
siteTerms: support.siteTerms,
|
|
348
|
+
mailingList: support.mailingList,
|
|
349
|
+
interactionContext: support.interactionContext,
|
|
350
|
+
bookingTimeZone: support.bookingTimeZone,
|
|
351
|
+
now: support.now,
|
|
352
|
+
...support.customBlocks ? { customBlocks: support.customBlocks } : {},
|
|
353
|
+
entriesByIdentifier: support.entriesByIdentifier,
|
|
354
|
+
...support.mediaAssets ? { mediaAssets: support.mediaAssets } : {},
|
|
355
|
+
pagesByIdentifier: support.pagesByIdentifier,
|
|
356
|
+
routeMap: support.routeMap,
|
|
357
|
+
sdkConfig: support.sdkConfig,
|
|
358
|
+
site: support.site,
|
|
359
|
+
siteId,
|
|
360
|
+
supabaseUrl: support.supabaseUrl,
|
|
361
|
+
theme: support.theme
|
|
362
|
+
};
|
|
363
|
+
}
|
|
364
|
+
/**
|
|
365
|
+
* Server-side helper to fetch content by path.
|
|
366
|
+
*
|
|
367
|
+
* Returns a discriminated union - either page data (ready for `<Page>` component)
|
|
368
|
+
* or raw entry data (for custom rendering).
|
|
369
|
+
*
|
|
370
|
+
* @example Dynamic routing with both pages and entries
|
|
371
|
+
* ```tsx
|
|
372
|
+
* import { loadContent, Page, isPageContent } from '@riverbankcms/sdk';
|
|
373
|
+
*
|
|
374
|
+
* export default async function DynamicRoute({ params }) {
|
|
375
|
+
* const content = await loadContent({
|
|
376
|
+
* client,
|
|
377
|
+
* siteId: 'site-123',
|
|
378
|
+
* path: `/${params.slug?.join('/') || ''}`,
|
|
379
|
+
* });
|
|
380
|
+
*
|
|
381
|
+
* if (isPageContent(content)) {
|
|
382
|
+
* if (!content.theme) throw new MissingSdkThemeError(content.siteId, 'cms_theme_absent');
|
|
383
|
+
* return <Page {...content} />;
|
|
384
|
+
* }
|
|
385
|
+
*
|
|
386
|
+
* // Render entry with custom UI
|
|
387
|
+
* return (
|
|
388
|
+
* <article>
|
|
389
|
+
* <h1>{content.entry.title}</h1>
|
|
390
|
+
* <div>{content.entry.content.body}</div>
|
|
391
|
+
* </article>
|
|
392
|
+
* );
|
|
393
|
+
* }
|
|
394
|
+
* ```
|
|
395
|
+
*
|
|
396
|
+
* @example Entry-specific rendering based on content type
|
|
397
|
+
* ```tsx
|
|
398
|
+
* const content = await loadContent({ client, siteId, path });
|
|
399
|
+
*
|
|
400
|
+
* if (content.type === 'entry') {
|
|
401
|
+
* switch (content.entry.type) {
|
|
402
|
+
* case 'blog-post':
|
|
403
|
+
* return <BlogPost entry={content.entry} theme={content.theme} />;
|
|
404
|
+
* case 'product':
|
|
405
|
+
* return <ProductPage entry={content.entry} theme={content.theme} />;
|
|
406
|
+
* default:
|
|
407
|
+
* return <GenericEntry entry={content.entry} />;
|
|
408
|
+
* }
|
|
409
|
+
* }
|
|
410
|
+
*
|
|
411
|
+
* if (!content.theme) throw new MissingSdkThemeError(content.siteId, 'cms_theme_absent');
|
|
412
|
+
* return <Page {...content} />;
|
|
413
|
+
* ```
|
|
414
|
+
*
|
|
415
|
+
* @example Preview mode for draft content
|
|
416
|
+
* ```tsx
|
|
417
|
+
* const content = await loadContent({
|
|
418
|
+
* client,
|
|
419
|
+
* siteId,
|
|
420
|
+
* path,
|
|
421
|
+
* preview: true, // Fetches draft content for both pages and entries
|
|
422
|
+
* });
|
|
423
|
+
* ```
|
|
424
|
+
*/
|
|
425
|
+
async function loadContent(params) {
|
|
426
|
+
return loadContentWithDeps(DEFAULT_RESOLVE_BLOCK_DATA_DEPS, params);
|
|
427
|
+
}
|
|
428
|
+
async function loadContentWithDeps(deps, params) {
|
|
429
|
+
const { client, siteId, path, preview = false, forceSite, dataLoaderOverrides, searchParams } = params;
|
|
430
|
+
const [siteResult, contentResult] = await Promise.allSettled([client.getSite({
|
|
431
|
+
id: siteId,
|
|
432
|
+
currentPath: path,
|
|
433
|
+
...forceSite ? { force: true } : {}
|
|
434
|
+
}), client.getPage({
|
|
435
|
+
siteId,
|
|
436
|
+
path,
|
|
437
|
+
preview
|
|
438
|
+
})]);
|
|
439
|
+
if (siteResult.status === "rejected" || contentResult.status === "rejected") {
|
|
440
|
+
const failures = [siteResult, contentResult].filter((result) => result.status === "rejected").map(getRejectedReason);
|
|
441
|
+
throw failures.find((error) => !isContentLoadNotFoundError(error)) ?? failures[0];
|
|
442
|
+
}
|
|
443
|
+
const site = siteResult.value;
|
|
444
|
+
const contentResponse = contentResult.value;
|
|
445
|
+
return loadContentFromContentResponseWithDeps(deps, {
|
|
446
|
+
client,
|
|
447
|
+
siteId,
|
|
448
|
+
site,
|
|
449
|
+
contentResponse,
|
|
450
|
+
preview,
|
|
451
|
+
dataLoaderOverrides,
|
|
452
|
+
searchParams
|
|
453
|
+
});
|
|
454
|
+
}
|
|
455
|
+
function hasContentFields(content) {
|
|
456
|
+
return content != null && Object.keys(content).length > 0;
|
|
457
|
+
}
|
|
458
|
+
async function loadContentFromContentResponseWithDeps(deps, params) {
|
|
459
|
+
const { client, siteId, site, contentResponse: pageRead, preview = false, dataLoaderOverrides, searchParams } = params;
|
|
460
|
+
const destination = pageRead.result;
|
|
461
|
+
if (destination.kind !== "cms") return loadSelectedSystemPage(deps, params, destination);
|
|
462
|
+
const contentResponse = destination.content;
|
|
463
|
+
const previewStage = preview ? "preview" : "published";
|
|
464
|
+
const blockDataPolicy = createBlockDataLoadPolicy(dataLoaderOverrides, normalizeDataLoaderSearchParams(searchParams));
|
|
465
|
+
const support = buildSiteRenderSupport(site, collectMediaAssetSidecar(contentResponse.mediaAssets));
|
|
466
|
+
const templateContentSupport = toTemplateContentRenderSupport(support, siteId);
|
|
467
|
+
if (isEntryResponse(contentResponse)) {
|
|
468
|
+
const entryData = contentResponse.entry;
|
|
469
|
+
const draftContent = entryData.draftContent;
|
|
470
|
+
const hasDraftContent = hasContentFields(draftContent);
|
|
471
|
+
const entry = {
|
|
472
|
+
id: entryData.id,
|
|
473
|
+
type: entryData.type,
|
|
474
|
+
title: entryData.title,
|
|
475
|
+
slug: entryData.slug,
|
|
476
|
+
path: entryData.path,
|
|
477
|
+
status: entryData.status,
|
|
478
|
+
publishAt: entryData.publishAt,
|
|
479
|
+
lastPublishedAt: entryData.lastPublishedAt,
|
|
480
|
+
content: preview && hasDraftContent ? draftContent : entryData.content,
|
|
481
|
+
metaTitle: preview ? entryData.draftMetaTitle ?? entryData.metaTitle : entryData.metaTitle,
|
|
482
|
+
metaDescription: preview ? entryData.draftMetaDescription ?? entryData.metaDescription : entryData.metaDescription,
|
|
483
|
+
createdAt: entryData.createdAt,
|
|
484
|
+
updatedAt: entryData.updatedAt
|
|
485
|
+
};
|
|
486
|
+
const { templatePage, resolvedData, prefetchedBlockData, loaderSnapshot, loaderFailures } = await processEntryTemplate({
|
|
487
|
+
theme: support.theme,
|
|
488
|
+
bookingTimeZone: support.bookingTimeZone,
|
|
489
|
+
now: support.now,
|
|
490
|
+
templates: contentResponse.templates,
|
|
491
|
+
entrySlots: contentResponse.entrySlots,
|
|
492
|
+
entry,
|
|
493
|
+
siteId,
|
|
494
|
+
previewStage,
|
|
495
|
+
blockDataPolicy,
|
|
496
|
+
client,
|
|
497
|
+
deps,
|
|
498
|
+
customBlocks: support.customBlocks
|
|
499
|
+
});
|
|
500
|
+
return {
|
|
501
|
+
type: "entry",
|
|
502
|
+
pageRead,
|
|
503
|
+
entry,
|
|
504
|
+
templatePage,
|
|
505
|
+
resolvedData,
|
|
506
|
+
dataContext: {
|
|
507
|
+
...siteBlockRenderContext(support),
|
|
508
|
+
previewStage,
|
|
509
|
+
prefetchedBlockData,
|
|
510
|
+
loaderSnapshot,
|
|
511
|
+
loaderFailures,
|
|
512
|
+
contentEntry: {
|
|
513
|
+
...entry.content ?? {},
|
|
514
|
+
id: entry.id,
|
|
515
|
+
slug: entry.slug,
|
|
516
|
+
contentTypeSlug: entry.type,
|
|
517
|
+
_entryId: entry.id,
|
|
518
|
+
_entrySlug: entry.slug,
|
|
519
|
+
_contentTypeSlug: entry.type
|
|
520
|
+
}
|
|
521
|
+
},
|
|
522
|
+
...templateContentSupport
|
|
523
|
+
};
|
|
524
|
+
}
|
|
525
|
+
if (isPageSurfaceResponse(contentResponse)) {
|
|
526
|
+
const pageSurfaceData = contentResponse.pageSurface;
|
|
527
|
+
const pageSurface = {
|
|
528
|
+
id: pageSurfaceData.id,
|
|
529
|
+
routeId: pageSurfaceData.routeId,
|
|
530
|
+
readinessState: pageSurfaceData.readinessState,
|
|
531
|
+
subject: pageSurfaceData.subject,
|
|
532
|
+
title: pageSurfaceData.title,
|
|
533
|
+
slug: pageSurfaceData.slug,
|
|
534
|
+
path: pageSurfaceData.path,
|
|
535
|
+
status: pageSurfaceData.status,
|
|
536
|
+
publishAt: pageSurfaceData.publishAt,
|
|
537
|
+
lastPublishedAt: pageSurfaceData.lastPublishedAt,
|
|
538
|
+
content: pageSurfaceData.content,
|
|
539
|
+
metaTitle: preview ? pageSurfaceData.draftMetaTitle ?? pageSurfaceData.metaTitle : pageSurfaceData.metaTitle,
|
|
540
|
+
metaDescription: preview ? pageSurfaceData.draftMetaDescription ?? pageSurfaceData.metaDescription : pageSurfaceData.metaDescription,
|
|
541
|
+
createdAt: pageSurfaceData.createdAt,
|
|
542
|
+
updatedAt: pageSurfaceData.updatedAt,
|
|
543
|
+
contentSource: pageSurfaceData.contentSource
|
|
544
|
+
};
|
|
545
|
+
const { templatePage, resolvedData, prefetchedBlockData, loaderSnapshot, loaderFailures } = await processTemplatePage({
|
|
546
|
+
entry: pageSurface,
|
|
547
|
+
theme: support.theme,
|
|
548
|
+
pageSections: contentResponse.pageSections,
|
|
549
|
+
entrySubrouteData: destination.eventSubroute,
|
|
550
|
+
bookingTimeZone: support.bookingTimeZone,
|
|
551
|
+
now: support.now,
|
|
552
|
+
templates: contentResponse.templates,
|
|
553
|
+
slotContent: contentResponse.surfaceSlots,
|
|
554
|
+
pageName: pageSurface.title || "Page Surface Template",
|
|
555
|
+
pagePath: pageSurface.path || "/",
|
|
556
|
+
pagePurpose: "page-surface-template",
|
|
557
|
+
siteId,
|
|
558
|
+
previewStage,
|
|
559
|
+
blockDataPolicy,
|
|
560
|
+
renderTargetSource: {
|
|
561
|
+
kind: "page-surface-template",
|
|
562
|
+
pageSurfaceId: pageSurface.id,
|
|
563
|
+
routeId: pageSurface.routeId,
|
|
564
|
+
subject: pageSurface.subject
|
|
565
|
+
},
|
|
566
|
+
client,
|
|
567
|
+
deps,
|
|
568
|
+
customBlocks: support.customBlocks
|
|
569
|
+
});
|
|
570
|
+
return {
|
|
571
|
+
type: "pageSurface",
|
|
572
|
+
pageRead,
|
|
573
|
+
pageSurface,
|
|
574
|
+
templatePage,
|
|
575
|
+
resolvedData,
|
|
576
|
+
dataContext: {
|
|
577
|
+
...siteBlockRenderContext(support),
|
|
578
|
+
previewStage,
|
|
579
|
+
prefetchedBlockData,
|
|
580
|
+
loaderSnapshot,
|
|
581
|
+
loaderFailures,
|
|
582
|
+
pageSurface: {
|
|
583
|
+
...pageSurface.content ?? {},
|
|
584
|
+
id: pageSurface.id,
|
|
585
|
+
slug: pageSurface.slug,
|
|
586
|
+
subject: pageSurface.subject,
|
|
587
|
+
_pageSurfaceId: pageSurface.id,
|
|
588
|
+
_pageSurfaceSlug: pageSurface.slug
|
|
589
|
+
},
|
|
590
|
+
subject: pageSurface.subject
|
|
591
|
+
},
|
|
592
|
+
...templateContentSupport
|
|
593
|
+
};
|
|
594
|
+
}
|
|
595
|
+
const { page: pageData } = contentResponse;
|
|
596
|
+
const pageRecord = pageData;
|
|
597
|
+
const canonicalPagePath = pageData.path ?? pageRecord.path ?? "/";
|
|
598
|
+
const pageOutline = buildRenderablePageOutline({
|
|
599
|
+
name: pageData.name,
|
|
600
|
+
path: canonicalPagePath,
|
|
601
|
+
fallbackPath: "/",
|
|
602
|
+
purpose: pageData.purpose,
|
|
603
|
+
blocks: pageData.blocks,
|
|
604
|
+
previewStage,
|
|
605
|
+
customBlocks: support.customBlocks
|
|
606
|
+
});
|
|
607
|
+
const prefetched = await resolveBlockDataWithDeps(deps, {
|
|
608
|
+
bookingTimeZone: support.bookingTimeZone,
|
|
609
|
+
now: support.now,
|
|
610
|
+
page: projectRenderablePageOutline(pageOutline),
|
|
611
|
+
siteId,
|
|
612
|
+
renderTarget: {
|
|
613
|
+
kind: "page",
|
|
614
|
+
pageId: pageData.id
|
|
615
|
+
},
|
|
616
|
+
previewStage,
|
|
617
|
+
policy: blockDataPolicy,
|
|
618
|
+
client,
|
|
619
|
+
customBlocks: support.customBlocks
|
|
620
|
+
});
|
|
621
|
+
return {
|
|
622
|
+
type: "page",
|
|
623
|
+
pageRead,
|
|
624
|
+
pageId: pageRecord.id,
|
|
625
|
+
routeId: pageRecord.routeId ?? null,
|
|
626
|
+
pageMetadata: projectPagePreviewMetadata(pageRecord, pageData.name, canonicalPagePath),
|
|
627
|
+
page: pageOutline,
|
|
628
|
+
runtimeJoins: pageData.runtimeJoins,
|
|
629
|
+
theme: support.theme,
|
|
630
|
+
siteId,
|
|
631
|
+
...support.customBlocks ? { customBlocks: support.customBlocks } : {},
|
|
632
|
+
resolvedData: prefetched.resolvedData,
|
|
633
|
+
dataContext: {
|
|
634
|
+
previewStage,
|
|
635
|
+
now: support.now,
|
|
636
|
+
...siteBlockRenderContext(support),
|
|
637
|
+
prefetchedBlockData: prefetched,
|
|
638
|
+
loaderSnapshot: prefetched.loaderSnapshot,
|
|
639
|
+
loaderFailures: prefetched.loaderFailures
|
|
640
|
+
},
|
|
641
|
+
bookingOfferingPresets: support.bookingOfferingPresets,
|
|
642
|
+
openingHours: support.openingHours,
|
|
643
|
+
siteTerms: support.siteTerms,
|
|
644
|
+
mailingList: support.mailingList,
|
|
645
|
+
interactionContext: support.interactionContext,
|
|
646
|
+
bookingTimeZone: support.bookingTimeZone,
|
|
647
|
+
now: support.now,
|
|
648
|
+
site: support.site,
|
|
649
|
+
sdkConfig: support.sdkConfig,
|
|
650
|
+
supabaseUrl: support.supabaseUrl,
|
|
651
|
+
routeMap: support.routeMap,
|
|
652
|
+
pagesByIdentifier: support.pagesByIdentifier,
|
|
653
|
+
entriesByIdentifier: support.entriesByIdentifier,
|
|
654
|
+
...support.mediaAssets ? { mediaAssets: support.mediaAssets } : {}
|
|
655
|
+
};
|
|
656
|
+
}
|
|
657
|
+
function projectPagePreviewMetadata(page, pageName, canonicalPath) {
|
|
658
|
+
return {
|
|
659
|
+
...projectDraftPageMetadata(page, pageName, canonicalPath),
|
|
660
|
+
...projectPublishedPageMetadata(page, pageName, canonicalPath)
|
|
661
|
+
};
|
|
662
|
+
}
|
|
663
|
+
function projectDraftPageMetadata(page, pageName, canonicalPath) {
|
|
664
|
+
return {
|
|
665
|
+
draftTitle: page.draftTitle ?? page.name ?? pageName,
|
|
666
|
+
draftPath: page.draftPath ?? page.path ?? canonicalPath,
|
|
667
|
+
draftStatus: page.draftStatus ?? page.status ?? "draft",
|
|
668
|
+
draftMetaTitle: page.draftMetaTitle ?? null,
|
|
669
|
+
draftMetaDescription: page.draftMetaDescription ?? null
|
|
670
|
+
};
|
|
671
|
+
}
|
|
672
|
+
function projectPublishedPageMetadata(page, pageName, canonicalPath) {
|
|
673
|
+
return {
|
|
674
|
+
title: page.name ?? pageName,
|
|
675
|
+
path: canonicalPath,
|
|
676
|
+
status: page.status ?? page.draftStatus ?? "draft",
|
|
677
|
+
publishedAt: page.publishedAt ?? null,
|
|
678
|
+
lastPublishedAt: page.lastPublishedAt ?? null,
|
|
679
|
+
publishedMetaTitle: page.publishedMetaTitle ?? null,
|
|
680
|
+
publishedMetaDescription: page.publishedMetaDescription ?? null,
|
|
681
|
+
ogImageId: page.ogImageId ?? null
|
|
682
|
+
};
|
|
683
|
+
}
|
|
684
|
+
/**
|
|
685
|
+
* Type guard to check if API response is an entry
|
|
686
|
+
*/
|
|
687
|
+
function isEntryResponse(response) {
|
|
688
|
+
return "entry" in response;
|
|
689
|
+
}
|
|
690
|
+
function isPageSurfaceResponse(response) {
|
|
691
|
+
return response.type === "pageSurface";
|
|
692
|
+
}
|
|
693
|
+
//#endregion
|
|
694
|
+
export { loadContentFromContentResponseWithDeps as a, loadContent as i, isPageContent as n, isPageSurfaceContent as r, isEntryContent as t };
|