@riverbankcms/sdk 0.177.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-sYraeqm9.d.ts → BlocksIslandsHydrator-DKwgs95u.d.ts} +1 -1
- package/dist/_dts/{Page-Bp7hTDTy.d.ts → Page-lWenra5i.d.ts} +7 -7
- package/dist/_dts/{SdkPreviewMode-CxkCCyKw.d.ts → SdkPreviewMode-BRxhRw4I.d.ts} +2 -2
- package/dist/_dts/{client-K6UhbL3t.d.ts → client-qWn7xAwJ.d.ts} +77 -23
- package/dist/_dts/{content-types-BLAdIMyr.d.ts → content-types-DL6GIvTm.d.ts} +2 -2
- package/dist/_dts/{contracts-BG7yTZ6t.d.ts → contracts-CzWyAiJj.d.ts} +6 -116
- package/dist/_dts/{generatePageMetadata-X_WpGzZZ.d.ts → generatePageMetadata-CBKd0cJ4.d.ts} +2 -2
- package/dist/_dts/{index--n-wV8Xd.d.ts → index-7CDBZGb-.d.ts} +1 -1
- package/dist/_dts/{index-Bygd2RCg.d.ts → index-BU9uAkHB.d.ts} +4 -4
- package/dist/_dts/{index-BMGif2r3.d.ts → index-BYnG_vF5.d.ts} +1 -1
- package/dist/_dts/{index-CBRbZJ6u.d.ts → index-CZgJrhzT.d.ts} +4 -2
- package/dist/_dts/{index-BLseXObg.d.ts → index-CaCum9mM.d.ts} +2 -2
- package/dist/_dts/{index-BpAW9AKB.d.ts → index-DCiSHd-C.d.ts} +1 -1
- package/dist/_dts/{index-CX9bp60k.d.ts → index-DVSipdrT.d.ts} +3 -3
- package/dist/_dts/{loadContent-uhUThWaq.d.ts → loadContent-CPKbFQyq.d.ts} +15 -13
- package/dist/_dts/{request-Bf9YImJw.d.ts → request-BjKBCS7t.d.ts} +1687 -373
- package/dist/_dts/{resolveBlockData-D6M5NMZB.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 -2
- 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 +32 -12
- 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 +56 -4
- package/dist/_dts/sdk/src/portal/index.d.ts +95 -13
- 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-C1l2Sm2h.d.ts → types-B7e6Lmo5.d.ts} +3 -3
- package/dist/_dts/{types-DgV8P2mz.d.ts → types-BOxSq-Bq.d.ts} +8 -7
- package/dist/_dts/{types-BdZ5pJSk.d.ts → types-CT-KOxl_.d.ts} +5 -39
- package/dist/_dts/{validation-BtbZIT5f.d.ts → validation-Dz6qccue.d.ts} +4 -4
- package/dist/client/{BlocksIslandsHydrator-CeYQQQs7.mjs → BlocksIslandsHydrator-1XifJg6V.mjs} +17 -18
- package/dist/client/{BookingMailingListNote-CDDWrY_W.mjs → BookingMailingListNote-BsbEgagJ.mjs} +7 -7
- package/dist/client/{BookingQuestionFields-MbvIo2jS.mjs → BookingQuestionFields-C8IbeLHj.mjs} +4 -4
- package/dist/client/{CalendarNavigationChevron-C6CSVfEB.mjs → CalendarNavigationChevron-Bbqij1XQ.mjs} +43 -10
- package/dist/client/{CheckboxChoice-b-PJLEXe.mjs → CheckboxChoice-BZPLCgTU.mjs} +1 -1
- package/dist/client/{DemoBookingPortalAccess-C9Ggcfx3.mjs → DemoBookingPortalAccess-uA9H8LIL.mjs} +4 -4
- package/dist/client/{EventCalendar.client-BSMuSqg0.mjs → EventCalendar.client-yoSI77ov.mjs} +11 -11
- package/dist/client/{EventCombined.client-BTrmSyUB.mjs → EventCombined.client-HeCNlliq.mjs} +11 -11
- package/dist/client/{EventEmbeddedCheckoutStep-B18VbNS_.mjs → EventEmbeddedCheckoutStep-BDnicDM6.mjs} +1 -1
- package/dist/client/{EventItem-B0WjGXsH.mjs → EventItem-Duhk1vnF.mjs} +247 -7
- package/dist/client/{EventListWeekNavigation-8Ij7vuxY.mjs → EventListWeekNavigation-BiutEqPK.mjs} +1 -1
- package/dist/client/{EventListing.client-CWk2NEwd.mjs → EventListing.client-B5ln77jG.mjs} +3 -3
- package/dist/client/{EventListing.view-BEH4UbSL.mjs → EventListing.view-hUDhNtMv.mjs} +203 -9
- package/dist/client/{EventRegistrationPayment-B2EikR3f.mjs → EventRegistrationPayment-DqtX1vB2.mjs} +439 -123
- package/dist/client/{Page-C03rc6jw.mjs → Page-ChJ2TGVk.mjs} +24314 -20226
- package/dist/client/{ProtectedSubmitButton-C-ql101B.mjs → ProtectedSubmitButton-De6AzhE6.mjs} +1 -1
- package/dist/client/{SiteTermsAgreementField-BYACYP0T.mjs → SiteTermsAgreementField-CDBU31xW.mjs} +3 -3
- package/dist/client/{StepIndicator-Bb7rPtSq.mjs → StepIndicator-2Dl9zon2.mjs} +80 -33
- package/dist/client/{BookingPanelArrangement-BShQSial.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-BfsOiweL.mjs → accordion-B6SqU49k.mjs} +1 -1
- package/dist/client/{booking-form.client-B8ohIj13.mjs → booking-form.client-DrEOjQ3N.mjs} +15 -15
- package/dist/client/{bookingForm-CXsck2oH.mjs → bookingForm-drZBwEZW.mjs} +4 -4
- package/dist/client/bookings.mjs +5 -5
- package/dist/client/{boxStyleClassNames-B_hcuT06.mjs → boxStyleClassNames-DEh45w16.mjs} +19 -19
- package/dist/client/{carousel-Cz5Ddbsx.mjs → carousel-C-YJliD-.mjs} +2 -2
- package/dist/client/{carousel.client-h65clfUO.mjs → carousel.client-DMtGYTTM.mjs} +1 -1
- package/dist/client/{cart-CTC2oS3p.mjs → cart-acGFWK9R.mjs} +3 -3
- package/dist/client/{cart.client-c1YkTC-Q.mjs → cart.client-BzlOGP2j.mjs} +1 -1
- package/dist/client/{checkout-BeW1ufaH.mjs → checkout-SEontwhy.mjs} +3 -3
- package/dist/client/{checkout.client-BeU32khQ.mjs → checkout.client-C0Qvh-d4.mjs} +1 -1
- package/dist/client/{checkoutUrls-DVfSUSKp.mjs → checkoutUrls-yUKeq1N9.mjs} +1 -1
- package/dist/client/client.mjs +469 -320
- package/dist/client/{context-R9p5c8IH.mjs → context-DTrwaQtg.mjs} +2 -1
- package/dist/client/{dateFormatting-CF6FWCoo.mjs → dateFormatting-Cg8E1r9l.mjs} +1 -1
- package/dist/client/{demoPortalMagicLink-tZxIm3RL.mjs → demoPortalMagicLink-D0kOJYOX.mjs} +5 -4
- package/dist/client/{enhanceHeaderSection-DEYDI54E.mjs → enhanceHeaderSection-DyrpZ7ks.mjs} +4 -4
- package/dist/client/{event-registration.client-DWvSODTI.mjs → event-registration.client-RLZQWi2V.mjs} +121 -183
- package/dist/client/{eventCalendar-C9Pn9eeZ.mjs → eventCalendar-CphYnImh.mjs} +4 -4
- package/dist/client/{eventCombined-Bdhk0fp0.mjs → eventCombined-BvqjASB_.mjs} +4 -4
- package/dist/client/{eventListing-B-bJOQUk.mjs → eventListing-BaNAoC_M.mjs} +4 -4
- package/dist/client/{eventRegistration-CbdmUiDT.mjs → eventRegistration-COMHoRl6.mjs} +4 -4
- package/dist/client/events-9LPvwbWp.mjs +28 -0
- package/dist/client/{form-BbUUt784.mjs → form-DyH2juYT.mjs} +3 -3
- package/dist/client/{form.client-BVlz-9_t.mjs → form.client-DBwzkB0M.mjs} +5 -5
- package/dist/client/{form.parts-TB4UIrML.mjs → form.parts-CY4kX3mh.mjs} +3 -3
- package/dist/client/{formatDate-TDHhFjFN.mjs → formatDate-CTEN7gxW.mjs} +1 -1
- package/dist/client/gifting/client.mjs +7 -6
- package/dist/client/{gifting-CbNSrp7C.mjs → gifting-CIx4V378.mjs} +4 -4
- package/dist/client/{gifting.client-B__bGhFc.mjs → gifting.client-BEVPpzJM.mjs} +5 -5
- package/dist/client/{gifting.parts-CTA1sDW6.mjs → gifting.parts-VnORjnZK.mjs} +2 -2
- package/dist/client/{headerSection-5Wn9nUW_.mjs → headerSection-DGcJfRS8.mjs} +2 -2
- package/dist/client/{lookSurfaces-BwiNdgMU.mjs → lookSurfaces-IqT_SVnX.mjs} +167 -85
- package/dist/client/{newsletter-form.client-B17WYHxZ.mjs → newsletter-form.client-BvEDkjiD.mjs} +6 -6
- package/dist/client/{shop.interactive-CxDJ8P2r.mjs → newsletter-form.interactive-DCO1lErD.mjs} +3970 -3997
- package/dist/client/{newsletter-form.parts-DN9wD1ZG.mjs → newsletter-form.parts-BIy4IUT3.mjs} +2 -2
- package/dist/client/{newsletterForm-DLMlxInp.mjs → newsletterForm-CoTXDNFS.mjs} +3 -3
- package/dist/client/portal/client.mjs +346 -21
- package/dist/client/{product-detail.client-Di_anRGR.mjs → product-detail.client-YHQ2aKX1.mjs} +1 -1
- package/dist/client/{product-list.client-Duhl6rtL.mjs → product-list.client-DxoZw1vF.mjs} +1 -1
- package/dist/client/{productDetail-BgKmCwA8.mjs → productDetail-DjuFvkey.mjs} +3 -3
- package/dist/client/{productList-C_wMKsYS.mjs → productList-DE9GEFoZ.mjs} +3 -3
- package/dist/client/{propsDecoder-y3LvxaiG.mjs → propsDecoder-Cyag_HOs.mjs} +2 -48
- package/dist/client/{registry.server-CIWYKz1V.mjs → registry.server-BPwV-0Pp.mjs} +10426 -9114
- 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-DkPBFb_a.mjs → richText-coerce-NrRqDeOg.mjs} +1 -1
- package/dist/client/{routeIslandApiConfig-BgO0rZce.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-CFbWlv_W.mjs → shop-C3wM0Hr4.mjs} +3 -3
- package/dist/client/{shop-commerce-C-I29eaA.mjs → shop-commerce-34YvcpbX.mjs} +14 -14
- package/dist/client/{shop-commerce-store-DGcc7twO.mjs → shop-commerce-store-B7xHksOs.mjs} +1 -1
- package/dist/client/{shop-discount-apply.state-DOm7vx0X.mjs → shop-discount-apply.state-BiBnozfO.mjs} +2 -2
- package/dist/client/{shop.client-GHTWUKD6.mjs → shop.client-C0v88nLd.mjs} +14 -14
- package/dist/client/{shopShared-Be9QJJpT.mjs → shopShared-Ct-BRNez.mjs} +2 -2
- package/dist/client/spam-protection.mjs +1 -1
- package/dist/client/{noop-CaQxI-Js.mjs → src-CCtanNlD.mjs} +462 -455
- package/dist/client/src-DqMbCjI1.mjs +3 -0
- package/dist/client/{src-xrjaKaCj.mjs → src-uwCpbHXG.mjs} +2 -1
- package/dist/client/{timetableModel--R0zVzZO.mjs → timetableModel-lhE29TNT.mjs} +66 -12
- package/dist/client/{types-DjWUR_O6.mjs → types-BEaKfam_.mjs} +65 -65
- package/dist/client/{useAvailableSlots-BGu_2F50.mjs → useAvailableSlots-BelJviOT.mjs} +2 -2
- package/dist/client/useDiscountCodeUi-rQRE1-Ho.mjs +196 -0
- package/dist/client/{useEventPagination-DxIJ--JZ.mjs → useEventPagination-C4rS2Xxl.mjs} +8 -8
- package/dist/client/{view-3foOzGWR.mjs → view-LJVHVqsy.mjs} +4 -4
- package/dist/client/{display-4HYOb-AK.mjs → wizardSteps-CNDsxeJH.mjs} +9168 -8981
- package/dist/preview-next/before-render.mjs +4 -3
- package/dist/preview-next/client/{PageSectionToolbar-D6-jojqh.mjs → PageSectionToolbar-C4TtBPN-.mjs} +3 -3
- package/dist/preview-next/client/{PreviewEditorSidebar-BUVFKZ4k.mjs → PreviewEditorSidebar-D6fkE59-.mjs} +15 -13
- package/dist/preview-next/client/{PreviewEditorUI-292pOiSt.mjs → PreviewEditorUI-amcDlj0O.mjs} +4 -4
- package/dist/preview-next/client/{PreviewShell-CW0Yzj3h.mjs → PreviewShell-DeQjx4zk.mjs} +5 -5
- package/dist/preview-next/client/{SdkPreviewModeRuntime-Dba7zoZK.mjs → SdkPreviewModeRuntime-Cx0SXnoX.mjs} +5 -5
- package/dist/preview-next/client/{previewAssistantSlot-B-utyhbS.mjs → previewAssistantSlot-aqpU34WI.mjs} +1764 -1090
- package/dist/preview-next/client/{previewChromeRoot-CCoGydUD.mjs → previewChromeRoot-D3Gy_Rs0.mjs} +1 -1
- package/dist/preview-next/client/runtime.mjs +3 -3
- package/dist/preview-next/client/{sdk-runtime-DCpXVcA0.mjs → sdk-runtime-Dzx_RrN7.mjs} +2 -2
- package/dist/preview-next/client/{siteStyleAccess-sjOvRAHY.mjs → siteStyleAccess-LHedw83e.mjs} +1 -1
- package/dist/preview-next/client/src-EO5QoRlU.mjs +3 -0
- package/dist/preview-next/client/{src-DzXUmsyK.mjs → src-lX6heoDA.mjs} +2 -1
- package/dist/preview-next/client/{useAutosaveStatus-R1rZ9-IZ.mjs → useAutosaveStatus-DpSd9aVk.mjs} +1 -1
- package/dist/preview-next/client/{useOpenBlockForSetup-BS7CANPv.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-BSSbtz6A.mjs → route-contract-DnL-FgSV.mjs} +83 -11
- package/dist/server/{Block.shared-Dc3DX7Cf.mjs → Block.shared-BEbq6EwO.mjs} +5 -5
- package/dist/server/{bindings-VGgS6UvF.mjs → bindings-Bly0dRs7.mjs} +36 -5
- package/dist/server/{client-BPLLL22F.mjs → client-CGJ2ztYp.mjs} +1021 -1118
- package/dist/server/config-validation.mjs +1 -1
- package/dist/server/config.mjs +2 -2
- package/dist/server/constants-Cj7hfbrA.mjs +41 -0
- 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-CQgde5DN.mjs → loadPage-DTLe0FEs.mjs} +22 -4
- package/dist/server/{navigation-iC_hXjJI.mjs → navigation-BcNfYYuu.mjs} +1 -1
- package/dist/server/navigation.mjs +1 -1
- package/dist/server/next.mjs +103 -100
- package/dist/server/{overrideResolution-CkpwAHvW.mjs → overrideResolution-Uy9Zp2Ks.mjs} +1 -1
- package/dist/server/page-converter.mjs +1 -1
- package/dist/server/{pageRenderPlan-CfSnAkCO.mjs → pageRenderPlan-JzxBnqfV.mjs} +19 -7
- package/dist/server/{pageRuntimeSupport-uz4gzBOo.mjs → pageRuntimeSupport-DyNSd2Yj.mjs} +50 -2
- package/dist/server/{pageShared-6z6JBU41.mjs → pageShared-DU4ETFPS.mjs} +89 -83
- package/dist/server/portal-B4JVkdjc.mjs +783 -0
- package/dist/server/portal.mjs +3 -3
- package/dist/server/{prebuild-B4_Llisx.mjs → prebuild-8jNtDXmS.mjs} +5 -4
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/{prefetchBlockData-CCiYV8_s.mjs → prefetchBlockData-xeMG42aw.mjs} +3 -2
- package/dist/server/{registry-CXRXsFSx.mjs → registry-DH1VrsCl.mjs} +587 -329
- 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-yfe8WLEA.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-CxASA3PE.mjs → servicePageContent-B-FezJmH.mjs} +709 -453
- package/dist/server/{validation-BvHio6QI.mjs → validation-3jOzYdPL.mjs} +3 -3
- package/dist/server/{version-SuFlio6n.mjs → version-8t0o6_jd.mjs} +1 -1
- package/dist/styles/index.css +19 -0
- package/package.json +1 -1
- package/dist/_dts/footerPageOutline-DwMHeYmQ.d.ts +0 -256
- package/dist/_dts/resolvePageContent-DkzWvFbG.d.ts +0 -162
- package/dist/client/LocationMapActions-myIQIvQL.mjs +0 -62
- package/dist/client/MapDrawingSvg-BfsVyPvB.mjs +0 -200
- package/dist/client/course-CUFVJEAc.mjs +0 -237
- package/dist/client/duration-Q6_QNgiv.mjs +0 -37
- package/dist/client/event-details.client-BwjBJP-f.mjs +0 -53
- package/dist/client/eventDetails-C2LfNW_o.mjs +0 -13
- package/dist/client/runtimeResponse-CVkM0dHy.mjs +0 -3
- package/dist/client/src-BozhJ43Z.mjs +0 -3
- package/dist/client/useDiscountCodeUi-I_mXI9Yd.mjs +0 -237
- package/dist/client/view-BbzH5MQb.mjs +0 -1371
- package/dist/preview-next/client/src-LUhVXBEQ.mjs +0 -3
- package/dist/server/constants-hl17xz6x.mjs +0 -22
- package/dist/server/portal-BjVHMAUC.mjs +0 -371
- package/dist/server/resolvePageContent-CAELMBEJ.mjs +0 -438
|
@@ -0,0 +1,692 @@
|
|
|
1
|
+
import { In as registrationDataForEventSelection, Rn as selectionRepresentativeEvent, na as isRecord, sr as resolveDateRuntimeContext, tc as resolveBookingBusinessTimeZone } from "./registry-DH1VrsCl.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-DyNSd2Yj.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-B-FezJmH.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-BN8tweTx.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
|
+
id: service.id,
|
|
16
|
+
asksSiteTerms: service.asksSiteTerms,
|
|
17
|
+
siteId: service.siteId,
|
|
18
|
+
slug: service.slug,
|
|
19
|
+
title: service.title,
|
|
20
|
+
image: service.image ?? null,
|
|
21
|
+
description: service.description ?? void 0,
|
|
22
|
+
durationMinutes: service.durationMinutes,
|
|
23
|
+
...service.pricing === void 0 ? {} : { pricing: service.pricing },
|
|
24
|
+
priceAmount: service.priceAmount,
|
|
25
|
+
priceCurrency: service.priceCurrency,
|
|
26
|
+
paymentTerms: service.paymentTerms,
|
|
27
|
+
paymentTermsAvailability: service.paymentTermsAvailability,
|
|
28
|
+
location: service.location,
|
|
29
|
+
cancellationPolicy: service.cancellationPolicy,
|
|
30
|
+
bookingQuestions: service.bookingQuestions,
|
|
31
|
+
...service.consent ? { consent: service.consent } : {}
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
//#endregion
|
|
35
|
+
//#region src/rendering/helpers/loadSelectedSystemPage.ts
|
|
36
|
+
function authoredSubject(content) {
|
|
37
|
+
if (content?.type === "pageSurface") return content.pageSurface;
|
|
38
|
+
return content?.type === "entry" ? content.entry : null;
|
|
39
|
+
}
|
|
40
|
+
function authoredFields(content) {
|
|
41
|
+
const subject = authoredSubject(content);
|
|
42
|
+
return {
|
|
43
|
+
...authoredSubjectFields(subject),
|
|
44
|
+
mediaAssets: content?.mediaAssets ?? [],
|
|
45
|
+
sections: content?.type === "pageSurface" && content.pageSections ? {
|
|
46
|
+
...content.pageSections,
|
|
47
|
+
values: readStoredSectionValues(subject?.content)
|
|
48
|
+
} : null
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
function authoredSubjectFields(subject) {
|
|
52
|
+
if (!subject) return {
|
|
53
|
+
content: null,
|
|
54
|
+
metaTitle: null,
|
|
55
|
+
metaDescription: null,
|
|
56
|
+
draftMetaTitle: null,
|
|
57
|
+
draftMetaDescription: null
|
|
58
|
+
};
|
|
59
|
+
return {
|
|
60
|
+
content: subject.content ?? null,
|
|
61
|
+
metaTitle: subject.metaTitle ?? null,
|
|
62
|
+
metaDescription: subject.metaDescription ?? null,
|
|
63
|
+
draftMetaTitle: subject.draftMetaTitle ?? null,
|
|
64
|
+
draftMetaDescription: subject.draftMetaDescription ?? null
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
function systemPagePlan(destination, support) {
|
|
68
|
+
const authored = authoredFields(destination.authored);
|
|
69
|
+
const design = {
|
|
70
|
+
theme: requireSdkTheme(support.theme, support.site.id),
|
|
71
|
+
path: destination.canonicalPath,
|
|
72
|
+
resolveBlockContentContract: (kind) => {
|
|
73
|
+
const manifest = resolveSdkBlockManifest(kind, support.customBlocks);
|
|
74
|
+
return manifest ? compileManifestContentContract(manifest) : null;
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
if (destination.kind === "system_service") return {
|
|
78
|
+
outline: buildServiceBookingOutline(destination.service, design, parseServicePageContent(authored)),
|
|
79
|
+
seed: {
|
|
80
|
+
[SERVICE_BOOKING_BLOCK_IDS.details]: { service: [destination.service] },
|
|
81
|
+
[SERVICE_BOOKING_BLOCK_IDS.booking]: { services: {
|
|
82
|
+
services: [toPublicBookingServiceCatalogueItem(destination.service, null)],
|
|
83
|
+
categories: []
|
|
84
|
+
} }
|
|
85
|
+
},
|
|
86
|
+
subject: {
|
|
87
|
+
kind: "appointmentService",
|
|
88
|
+
appointmentServiceId: destination.service.id
|
|
89
|
+
},
|
|
90
|
+
occurrenceContext: null,
|
|
91
|
+
timeZone: support.bookingTimeZone,
|
|
92
|
+
title: destination.service.title,
|
|
93
|
+
description: destination.service.description,
|
|
94
|
+
ownTitle: null,
|
|
95
|
+
ownDescription: null,
|
|
96
|
+
authored
|
|
97
|
+
};
|
|
98
|
+
const registration = registrationDataForEventSelection(destination.selection);
|
|
99
|
+
const event = selectionRepresentativeEvent(destination.selection);
|
|
100
|
+
const identity = bookingPageIdentity(destination.selection);
|
|
101
|
+
return {
|
|
102
|
+
outline: buildBookingPageOutline(destination.selection, design, authored.sections),
|
|
103
|
+
seed: bookingPageSeedData(bookingPageFacts(destination.selection)),
|
|
104
|
+
subject: registration.subject ?? {
|
|
105
|
+
kind: "eventSeries",
|
|
106
|
+
eventSeriesId: event.seriesId,
|
|
107
|
+
bookingScope: "single_occurrence"
|
|
108
|
+
},
|
|
109
|
+
occurrenceContext: "occurrenceContext" in registration ? registration.occurrenceContext ?? null : null,
|
|
110
|
+
timeZone: event.timeZone,
|
|
111
|
+
title: identity.title,
|
|
112
|
+
description: event.presentation?.summary ?? event.description ?? null,
|
|
113
|
+
ownTitle: identity.ownTitle,
|
|
114
|
+
ownDescription: identity.ownDescription,
|
|
115
|
+
authored
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
/** Build from the admitted subject. Seeded details/registration never fetch or select again. */
|
|
119
|
+
async function loadSelectedSystemPage(deps, params, destination) {
|
|
120
|
+
const support = buildSiteRenderSupport(params.site, destination.authored?.mediaAssets);
|
|
121
|
+
const plan = systemPagePlan(destination, support);
|
|
122
|
+
const bookingTimeZone = resolveBookingBusinessTimeZone(plan.timeZone);
|
|
123
|
+
const previewStage = params.preview ? "preview" : "published";
|
|
124
|
+
const prefetched = await resolveBlockDataWithDeps(deps, {
|
|
125
|
+
page: projectRenderablePageOutline(plan.outline),
|
|
126
|
+
siteId: params.siteId,
|
|
127
|
+
client: params.client,
|
|
128
|
+
previewStage,
|
|
129
|
+
renderTarget: {
|
|
130
|
+
kind: "system-page",
|
|
131
|
+
path: destination.canonicalPath,
|
|
132
|
+
subject: plan.subject,
|
|
133
|
+
occurrenceContext: plan.occurrenceContext
|
|
134
|
+
},
|
|
135
|
+
policy: createBlockDataLoadPolicy(params.dataLoaderOverrides, normalizeDataLoaderSearchParams(params.searchParams)),
|
|
136
|
+
seededData: plan.seed,
|
|
137
|
+
customBlocks: support.customBlocks,
|
|
138
|
+
bookingTimeZone,
|
|
139
|
+
now: support.now
|
|
140
|
+
});
|
|
141
|
+
return {
|
|
142
|
+
...support,
|
|
143
|
+
bookingTimeZone,
|
|
144
|
+
type: "page",
|
|
145
|
+
pageId: null,
|
|
146
|
+
routeId: null,
|
|
147
|
+
pageRead: params.contentResponse,
|
|
148
|
+
page: plan.outline,
|
|
149
|
+
resolvedData: prefetched.resolvedData,
|
|
150
|
+
runtimeJoins: [],
|
|
151
|
+
theme: support.theme,
|
|
152
|
+
siteId: params.siteId,
|
|
153
|
+
pageMetadata: {
|
|
154
|
+
title: plan.title,
|
|
155
|
+
draftTitle: plan.title,
|
|
156
|
+
path: destination.canonicalPath,
|
|
157
|
+
draftPath: destination.canonicalPath,
|
|
158
|
+
status: "published",
|
|
159
|
+
draftStatus: "published",
|
|
160
|
+
publishedAt: null,
|
|
161
|
+
ogImageId: null,
|
|
162
|
+
draftMetaTitle: plan.ownTitle ?? plan.authored.draftMetaTitle,
|
|
163
|
+
publishedMetaTitle: plan.ownTitle ?? plan.authored.metaTitle,
|
|
164
|
+
draftMetaDescription: plan.ownDescription ?? plan.authored.draftMetaDescription ?? plan.description,
|
|
165
|
+
publishedMetaDescription: plan.ownDescription ?? plan.authored.metaDescription ?? plan.description
|
|
166
|
+
},
|
|
167
|
+
dataContext: {
|
|
168
|
+
...siteBlockRenderContext(support),
|
|
169
|
+
previewStage,
|
|
170
|
+
now: support.now,
|
|
171
|
+
subject: plan.subject,
|
|
172
|
+
occurrenceContext: plan.occurrenceContext,
|
|
173
|
+
prefetchedBlockData: prefetched,
|
|
174
|
+
loaderSnapshot: prefetched.loaderSnapshot,
|
|
175
|
+
loaderFailures: prefetched.loaderFailures
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
//#endregion
|
|
180
|
+
//#region src/rendering/helpers/templateContent.ts
|
|
181
|
+
function createTemplateRenderTarget(source, templateId) {
|
|
182
|
+
switch (source.kind) {
|
|
183
|
+
case "entry-template": return {
|
|
184
|
+
kind: source.kind,
|
|
185
|
+
templateId,
|
|
186
|
+
entryId: source.entryId,
|
|
187
|
+
entryType: source.entryType
|
|
188
|
+
};
|
|
189
|
+
case "page-surface-template": return {
|
|
190
|
+
kind: source.kind,
|
|
191
|
+
templateId,
|
|
192
|
+
pageSurfaceId: source.pageSurfaceId,
|
|
193
|
+
routeId: source.routeId,
|
|
194
|
+
subject: source.subject
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
function processEntryTemplate(input) {
|
|
199
|
+
return processTemplatePage({
|
|
200
|
+
...input,
|
|
201
|
+
slotContent: input.entrySlots,
|
|
202
|
+
pageName: "Entry Template",
|
|
203
|
+
pagePath: input.entry.path || "/",
|
|
204
|
+
pagePurpose: "entry-template",
|
|
205
|
+
renderTargetSource: {
|
|
206
|
+
kind: "entry-template",
|
|
207
|
+
entryId: input.entry.id,
|
|
208
|
+
entryType: input.entry.type
|
|
209
|
+
}
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
async function processTemplatePage(input) {
|
|
213
|
+
const template = input.templates?.[0];
|
|
214
|
+
if (!template?.blocks?.length) return {
|
|
215
|
+
templatePage: null,
|
|
216
|
+
resolvedData: {}
|
|
217
|
+
};
|
|
218
|
+
const templatePage = materializeSdkTemplate(input, template);
|
|
219
|
+
if (templatePage === null) return {
|
|
220
|
+
templatePage: null,
|
|
221
|
+
resolvedData: {}
|
|
222
|
+
};
|
|
223
|
+
const prefetched = await resolveBlockDataWithDeps(input.deps, {
|
|
224
|
+
bookingTimeZone: input.bookingTimeZone,
|
|
225
|
+
now: input.now,
|
|
226
|
+
entrySubrouteData: input.entrySubrouteData,
|
|
227
|
+
page: projectRenderablePageOutline(templatePage),
|
|
228
|
+
siteId: input.siteId,
|
|
229
|
+
renderTarget: createTemplateRenderTarget(input.renderTargetSource, template.id),
|
|
230
|
+
previewStage: input.previewStage,
|
|
231
|
+
policy: input.blockDataPolicy,
|
|
232
|
+
client: input.client,
|
|
233
|
+
customBlocks: input.customBlocks
|
|
234
|
+
});
|
|
235
|
+
return {
|
|
236
|
+
templatePage,
|
|
237
|
+
prefetchedBlockData: prefetched,
|
|
238
|
+
...prefetched
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
/** Pure adapter: the shared renderer owns bindings, applicability, Looks and admission. */
|
|
242
|
+
function materializeSdkTemplate(input, template) {
|
|
243
|
+
return buildTemplatePageOutline({
|
|
244
|
+
entry: input.entry,
|
|
245
|
+
subject: templateCompilerSubject(input.renderTargetSource),
|
|
246
|
+
dateContext: resolveDateRuntimeContext(input.bookingTimeZone),
|
|
247
|
+
template: toContentTemplate(template),
|
|
248
|
+
page: {
|
|
249
|
+
name: template.name || input.pageName,
|
|
250
|
+
path: input.pagePath,
|
|
251
|
+
purpose: input.pagePurpose
|
|
252
|
+
},
|
|
253
|
+
theme: input.theme,
|
|
254
|
+
pageSections: input.pageSections,
|
|
255
|
+
resolveEntrySlotBlocks: ({ slotKey }) => selectBlocksForDeclaredEntrySlot({
|
|
256
|
+
declaredSlotKey: slotKey,
|
|
257
|
+
entrySlots: input.slotContent ?? []
|
|
258
|
+
}).map((block) => admitEntrySlotBlock(block, input.customBlocks, input.previewStage)),
|
|
259
|
+
resolveBlockContentContract: (kind) => {
|
|
260
|
+
const manifest = resolveSdkBlockManifest(kind, input.customBlocks);
|
|
261
|
+
return manifest === null ? null : compileManifestContentContract(manifest);
|
|
262
|
+
}
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
function templateCompilerSubject(source) {
|
|
266
|
+
switch (source.kind) {
|
|
267
|
+
case "entry-template": return;
|
|
268
|
+
case "page-surface-template": return source.subject;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
/** Adapt the SDK transport to the shared template renderer; decisions stay there. */
|
|
272
|
+
function toContentTemplate(template) {
|
|
273
|
+
return {
|
|
274
|
+
id: template.id,
|
|
275
|
+
name: template.name,
|
|
276
|
+
templateKey: template.templateKey,
|
|
277
|
+
designState: template.designState,
|
|
278
|
+
blocks: template.blocks.map((block, orderIndex) => ({
|
|
279
|
+
...block,
|
|
280
|
+
orderIndex,
|
|
281
|
+
content: sanitizeSdkRuntimeBlockContent(block.blockKind, block.content ?? {}),
|
|
282
|
+
bindings: block.bindings ?? null
|
|
283
|
+
}))
|
|
284
|
+
};
|
|
285
|
+
}
|
|
286
|
+
function admitEntrySlotBlock(block, customBlocks, previewStage) {
|
|
287
|
+
const base = {
|
|
288
|
+
id: block.id ?? block.blockId ?? null,
|
|
289
|
+
contentVersionId: block.contentVersionId,
|
|
290
|
+
...entrySlotBlockIdentity(block, previewStage),
|
|
291
|
+
kind: block.kind,
|
|
292
|
+
purpose: block.purpose,
|
|
293
|
+
...isRecord(block.bindings) ? { bindings: block.bindings } : {}
|
|
294
|
+
};
|
|
295
|
+
const transportedAdmission = readInvalidBlockAdmission(block.admission);
|
|
296
|
+
if (transportedAdmission) return invalidRenderableBlock(base, transportedAdmission.error);
|
|
297
|
+
const manifest = resolveSdkBlockManifest(block.kind, customBlocks);
|
|
298
|
+
if (manifest === null) return invalidRenderableBlock(base, { kind: "manifest_unavailable" });
|
|
299
|
+
const renderable = admitTransportedRenderableManifestContent(compileManifestContentContract(manifest), block.content ?? {});
|
|
300
|
+
return renderable.ok ? {
|
|
301
|
+
...base,
|
|
302
|
+
admission: {
|
|
303
|
+
kind: "renderable",
|
|
304
|
+
content: renderable.value
|
|
305
|
+
}
|
|
306
|
+
} : invalidRenderableBlock(base, {
|
|
307
|
+
kind: "invalid_manifest_content",
|
|
308
|
+
error: renderable.error
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
function entrySlotBlockIdentity(block, previewStage) {
|
|
312
|
+
return {
|
|
313
|
+
draftContentId: block.draftContentId ?? null,
|
|
314
|
+
publishedPlacement: previewStage === "preview" ? readPublishedBlockPlacement(block.publishedContentId, isRecord(block.publishedContent) && isRecord(block.publishedContent.data) ? block.publishedContent.data : null) : null
|
|
315
|
+
};
|
|
316
|
+
}
|
|
317
|
+
//#endregion
|
|
318
|
+
//#region src/rendering/helpers/loadContent.ts
|
|
319
|
+
/**
|
|
320
|
+
* Type guard to check if result is a page
|
|
321
|
+
*/
|
|
322
|
+
function isPageContent(result) {
|
|
323
|
+
return result.type === "page";
|
|
324
|
+
}
|
|
325
|
+
/**
|
|
326
|
+
* Type guard to check if result is an entry
|
|
327
|
+
*/
|
|
328
|
+
function isEntryContent(result) {
|
|
329
|
+
return result.type === "entry";
|
|
330
|
+
}
|
|
331
|
+
function isPageSurfaceContent(result) {
|
|
332
|
+
return result.type === "pageSurface";
|
|
333
|
+
}
|
|
334
|
+
function isContentLoadNotFoundError(error) {
|
|
335
|
+
if (typeof error !== "object" || error === null || !("status" in error)) return false;
|
|
336
|
+
return Reflect.get(error, "status") === 404;
|
|
337
|
+
}
|
|
338
|
+
function getRejectedReason(result) {
|
|
339
|
+
return result.reason;
|
|
340
|
+
}
|
|
341
|
+
function toTemplateContentRenderSupport(support, siteId) {
|
|
342
|
+
return {
|
|
343
|
+
bookingOfferingPresets: support.bookingOfferingPresets,
|
|
344
|
+
openingHours: support.openingHours,
|
|
345
|
+
siteTerms: support.siteTerms,
|
|
346
|
+
mailingList: support.mailingList,
|
|
347
|
+
interactionContext: support.interactionContext,
|
|
348
|
+
bookingTimeZone: support.bookingTimeZone,
|
|
349
|
+
now: support.now,
|
|
350
|
+
...support.customBlocks ? { customBlocks: support.customBlocks } : {},
|
|
351
|
+
entriesByIdentifier: support.entriesByIdentifier,
|
|
352
|
+
...support.mediaAssets ? { mediaAssets: support.mediaAssets } : {},
|
|
353
|
+
pagesByIdentifier: support.pagesByIdentifier,
|
|
354
|
+
routeMap: support.routeMap,
|
|
355
|
+
sdkConfig: support.sdkConfig,
|
|
356
|
+
site: support.site,
|
|
357
|
+
siteId,
|
|
358
|
+
supabaseUrl: support.supabaseUrl,
|
|
359
|
+
theme: support.theme
|
|
360
|
+
};
|
|
361
|
+
}
|
|
362
|
+
/**
|
|
363
|
+
* Server-side helper to fetch content by path.
|
|
364
|
+
*
|
|
365
|
+
* Returns a discriminated union - either page data (ready for `<Page>` component)
|
|
366
|
+
* or raw entry data (for custom rendering).
|
|
367
|
+
*
|
|
368
|
+
* @example Dynamic routing with both pages and entries
|
|
369
|
+
* ```tsx
|
|
370
|
+
* import { loadContent, Page, isPageContent } from '@riverbankcms/sdk';
|
|
371
|
+
*
|
|
372
|
+
* export default async function DynamicRoute({ params }) {
|
|
373
|
+
* const content = await loadContent({
|
|
374
|
+
* client,
|
|
375
|
+
* siteId: 'site-123',
|
|
376
|
+
* path: `/${params.slug?.join('/') || ''}`,
|
|
377
|
+
* });
|
|
378
|
+
*
|
|
379
|
+
* if (isPageContent(content)) {
|
|
380
|
+
* if (!content.theme) throw new MissingSdkThemeError(content.siteId, 'cms_theme_absent');
|
|
381
|
+
* return <Page {...content} />;
|
|
382
|
+
* }
|
|
383
|
+
*
|
|
384
|
+
* // Render entry with custom UI
|
|
385
|
+
* return (
|
|
386
|
+
* <article>
|
|
387
|
+
* <h1>{content.entry.title}</h1>
|
|
388
|
+
* <div>{content.entry.content.body}</div>
|
|
389
|
+
* </article>
|
|
390
|
+
* );
|
|
391
|
+
* }
|
|
392
|
+
* ```
|
|
393
|
+
*
|
|
394
|
+
* @example Entry-specific rendering based on content type
|
|
395
|
+
* ```tsx
|
|
396
|
+
* const content = await loadContent({ client, siteId, path });
|
|
397
|
+
*
|
|
398
|
+
* if (content.type === 'entry') {
|
|
399
|
+
* switch (content.entry.type) {
|
|
400
|
+
* case 'blog-post':
|
|
401
|
+
* return <BlogPost entry={content.entry} theme={content.theme} />;
|
|
402
|
+
* case 'product':
|
|
403
|
+
* return <ProductPage entry={content.entry} theme={content.theme} />;
|
|
404
|
+
* default:
|
|
405
|
+
* return <GenericEntry entry={content.entry} />;
|
|
406
|
+
* }
|
|
407
|
+
* }
|
|
408
|
+
*
|
|
409
|
+
* if (!content.theme) throw new MissingSdkThemeError(content.siteId, 'cms_theme_absent');
|
|
410
|
+
* return <Page {...content} />;
|
|
411
|
+
* ```
|
|
412
|
+
*
|
|
413
|
+
* @example Preview mode for draft content
|
|
414
|
+
* ```tsx
|
|
415
|
+
* const content = await loadContent({
|
|
416
|
+
* client,
|
|
417
|
+
* siteId,
|
|
418
|
+
* path,
|
|
419
|
+
* preview: true, // Fetches draft content for both pages and entries
|
|
420
|
+
* });
|
|
421
|
+
* ```
|
|
422
|
+
*/
|
|
423
|
+
async function loadContent(params) {
|
|
424
|
+
return loadContentWithDeps(DEFAULT_RESOLVE_BLOCK_DATA_DEPS, params);
|
|
425
|
+
}
|
|
426
|
+
async function loadContentWithDeps(deps, params) {
|
|
427
|
+
const { client, siteId, path, preview = false, forceSite, dataLoaderOverrides, searchParams } = params;
|
|
428
|
+
const [siteResult, contentResult] = await Promise.allSettled([client.getSite({
|
|
429
|
+
id: siteId,
|
|
430
|
+
currentPath: path,
|
|
431
|
+
...forceSite ? { force: true } : {}
|
|
432
|
+
}), client.getPage({
|
|
433
|
+
siteId,
|
|
434
|
+
path,
|
|
435
|
+
preview
|
|
436
|
+
})]);
|
|
437
|
+
if (siteResult.status === "rejected" || contentResult.status === "rejected") {
|
|
438
|
+
const failures = [siteResult, contentResult].filter((result) => result.status === "rejected").map(getRejectedReason);
|
|
439
|
+
throw failures.find((error) => !isContentLoadNotFoundError(error)) ?? failures[0];
|
|
440
|
+
}
|
|
441
|
+
const site = siteResult.value;
|
|
442
|
+
const contentResponse = contentResult.value;
|
|
443
|
+
return loadContentFromContentResponseWithDeps(deps, {
|
|
444
|
+
client,
|
|
445
|
+
siteId,
|
|
446
|
+
site,
|
|
447
|
+
contentResponse,
|
|
448
|
+
preview,
|
|
449
|
+
dataLoaderOverrides,
|
|
450
|
+
searchParams
|
|
451
|
+
});
|
|
452
|
+
}
|
|
453
|
+
function hasContentFields(content) {
|
|
454
|
+
return content != null && Object.keys(content).length > 0;
|
|
455
|
+
}
|
|
456
|
+
async function loadContentFromContentResponseWithDeps(deps, params) {
|
|
457
|
+
const { client, siteId, site, contentResponse: pageRead, preview = false, dataLoaderOverrides, searchParams } = params;
|
|
458
|
+
const destination = pageRead.result;
|
|
459
|
+
if (destination.kind !== "cms") return loadSelectedSystemPage(deps, params, destination);
|
|
460
|
+
const contentResponse = destination.content;
|
|
461
|
+
const previewStage = preview ? "preview" : "published";
|
|
462
|
+
const blockDataPolicy = createBlockDataLoadPolicy(dataLoaderOverrides, normalizeDataLoaderSearchParams(searchParams));
|
|
463
|
+
const support = buildSiteRenderSupport(site, collectMediaAssetSidecar(contentResponse.mediaAssets));
|
|
464
|
+
const templateContentSupport = toTemplateContentRenderSupport(support, siteId);
|
|
465
|
+
if (isEntryResponse(contentResponse)) {
|
|
466
|
+
const entryData = contentResponse.entry;
|
|
467
|
+
const draftContent = entryData.draftContent;
|
|
468
|
+
const hasDraftContent = hasContentFields(draftContent);
|
|
469
|
+
const entry = {
|
|
470
|
+
id: entryData.id,
|
|
471
|
+
type: entryData.type,
|
|
472
|
+
title: entryData.title,
|
|
473
|
+
slug: entryData.slug,
|
|
474
|
+
path: entryData.path,
|
|
475
|
+
status: entryData.status,
|
|
476
|
+
publishAt: entryData.publishAt,
|
|
477
|
+
lastPublishedAt: entryData.lastPublishedAt,
|
|
478
|
+
content: preview && hasDraftContent ? draftContent : entryData.content,
|
|
479
|
+
metaTitle: preview ? entryData.draftMetaTitle ?? entryData.metaTitle : entryData.metaTitle,
|
|
480
|
+
metaDescription: preview ? entryData.draftMetaDescription ?? entryData.metaDescription : entryData.metaDescription,
|
|
481
|
+
createdAt: entryData.createdAt,
|
|
482
|
+
updatedAt: entryData.updatedAt
|
|
483
|
+
};
|
|
484
|
+
const { templatePage, resolvedData, prefetchedBlockData, loaderSnapshot, loaderFailures } = await processEntryTemplate({
|
|
485
|
+
theme: support.theme,
|
|
486
|
+
bookingTimeZone: support.bookingTimeZone,
|
|
487
|
+
now: support.now,
|
|
488
|
+
templates: contentResponse.templates,
|
|
489
|
+
entrySlots: contentResponse.entrySlots,
|
|
490
|
+
entry,
|
|
491
|
+
siteId,
|
|
492
|
+
previewStage,
|
|
493
|
+
blockDataPolicy,
|
|
494
|
+
client,
|
|
495
|
+
deps,
|
|
496
|
+
customBlocks: support.customBlocks
|
|
497
|
+
});
|
|
498
|
+
return {
|
|
499
|
+
type: "entry",
|
|
500
|
+
pageRead,
|
|
501
|
+
entry,
|
|
502
|
+
templatePage,
|
|
503
|
+
resolvedData,
|
|
504
|
+
dataContext: {
|
|
505
|
+
...siteBlockRenderContext(support),
|
|
506
|
+
previewStage,
|
|
507
|
+
prefetchedBlockData,
|
|
508
|
+
loaderSnapshot,
|
|
509
|
+
loaderFailures,
|
|
510
|
+
contentEntry: {
|
|
511
|
+
...entry.content ?? {},
|
|
512
|
+
id: entry.id,
|
|
513
|
+
slug: entry.slug,
|
|
514
|
+
contentTypeSlug: entry.type,
|
|
515
|
+
_entryId: entry.id,
|
|
516
|
+
_entrySlug: entry.slug,
|
|
517
|
+
_contentTypeSlug: entry.type
|
|
518
|
+
}
|
|
519
|
+
},
|
|
520
|
+
...templateContentSupport
|
|
521
|
+
};
|
|
522
|
+
}
|
|
523
|
+
if (isPageSurfaceResponse(contentResponse)) {
|
|
524
|
+
const pageSurfaceData = contentResponse.pageSurface;
|
|
525
|
+
const pageSurface = {
|
|
526
|
+
id: pageSurfaceData.id,
|
|
527
|
+
routeId: pageSurfaceData.routeId,
|
|
528
|
+
readinessState: pageSurfaceData.readinessState,
|
|
529
|
+
subject: pageSurfaceData.subject,
|
|
530
|
+
title: pageSurfaceData.title,
|
|
531
|
+
slug: pageSurfaceData.slug,
|
|
532
|
+
path: pageSurfaceData.path,
|
|
533
|
+
status: pageSurfaceData.status,
|
|
534
|
+
publishAt: pageSurfaceData.publishAt,
|
|
535
|
+
lastPublishedAt: pageSurfaceData.lastPublishedAt,
|
|
536
|
+
content: pageSurfaceData.content,
|
|
537
|
+
metaTitle: preview ? pageSurfaceData.draftMetaTitle ?? pageSurfaceData.metaTitle : pageSurfaceData.metaTitle,
|
|
538
|
+
metaDescription: preview ? pageSurfaceData.draftMetaDescription ?? pageSurfaceData.metaDescription : pageSurfaceData.metaDescription,
|
|
539
|
+
createdAt: pageSurfaceData.createdAt,
|
|
540
|
+
updatedAt: pageSurfaceData.updatedAt,
|
|
541
|
+
contentSource: pageSurfaceData.contentSource
|
|
542
|
+
};
|
|
543
|
+
const { templatePage, resolvedData, prefetchedBlockData, loaderSnapshot, loaderFailures } = await processTemplatePage({
|
|
544
|
+
entry: pageSurface,
|
|
545
|
+
theme: support.theme,
|
|
546
|
+
pageSections: contentResponse.pageSections,
|
|
547
|
+
entrySubrouteData: destination.eventSubroute,
|
|
548
|
+
bookingTimeZone: support.bookingTimeZone,
|
|
549
|
+
now: support.now,
|
|
550
|
+
templates: contentResponse.templates,
|
|
551
|
+
slotContent: contentResponse.surfaceSlots,
|
|
552
|
+
pageName: pageSurface.title || "Page Surface Template",
|
|
553
|
+
pagePath: pageSurface.path || "/",
|
|
554
|
+
pagePurpose: "page-surface-template",
|
|
555
|
+
siteId,
|
|
556
|
+
previewStage,
|
|
557
|
+
blockDataPolicy,
|
|
558
|
+
renderTargetSource: {
|
|
559
|
+
kind: "page-surface-template",
|
|
560
|
+
pageSurfaceId: pageSurface.id,
|
|
561
|
+
routeId: pageSurface.routeId,
|
|
562
|
+
subject: pageSurface.subject
|
|
563
|
+
},
|
|
564
|
+
client,
|
|
565
|
+
deps,
|
|
566
|
+
customBlocks: support.customBlocks
|
|
567
|
+
});
|
|
568
|
+
return {
|
|
569
|
+
type: "pageSurface",
|
|
570
|
+
pageRead,
|
|
571
|
+
pageSurface,
|
|
572
|
+
templatePage,
|
|
573
|
+
resolvedData,
|
|
574
|
+
dataContext: {
|
|
575
|
+
...siteBlockRenderContext(support),
|
|
576
|
+
previewStage,
|
|
577
|
+
prefetchedBlockData,
|
|
578
|
+
loaderSnapshot,
|
|
579
|
+
loaderFailures,
|
|
580
|
+
pageSurface: {
|
|
581
|
+
...pageSurface.content ?? {},
|
|
582
|
+
id: pageSurface.id,
|
|
583
|
+
slug: pageSurface.slug,
|
|
584
|
+
subject: pageSurface.subject,
|
|
585
|
+
_pageSurfaceId: pageSurface.id,
|
|
586
|
+
_pageSurfaceSlug: pageSurface.slug
|
|
587
|
+
},
|
|
588
|
+
subject: pageSurface.subject
|
|
589
|
+
},
|
|
590
|
+
...templateContentSupport
|
|
591
|
+
};
|
|
592
|
+
}
|
|
593
|
+
const { page: pageData } = contentResponse;
|
|
594
|
+
const pageRecord = pageData;
|
|
595
|
+
const canonicalPagePath = pageData.path ?? pageRecord.path ?? "/";
|
|
596
|
+
const pageOutline = buildRenderablePageOutline({
|
|
597
|
+
name: pageData.name,
|
|
598
|
+
path: canonicalPagePath,
|
|
599
|
+
fallbackPath: "/",
|
|
600
|
+
purpose: pageData.purpose,
|
|
601
|
+
blocks: pageData.blocks,
|
|
602
|
+
previewStage,
|
|
603
|
+
customBlocks: support.customBlocks
|
|
604
|
+
});
|
|
605
|
+
const prefetched = await resolveBlockDataWithDeps(deps, {
|
|
606
|
+
bookingTimeZone: support.bookingTimeZone,
|
|
607
|
+
now: support.now,
|
|
608
|
+
page: projectRenderablePageOutline(pageOutline),
|
|
609
|
+
siteId,
|
|
610
|
+
renderTarget: {
|
|
611
|
+
kind: "page",
|
|
612
|
+
pageId: pageData.id
|
|
613
|
+
},
|
|
614
|
+
previewStage,
|
|
615
|
+
policy: blockDataPolicy,
|
|
616
|
+
client,
|
|
617
|
+
customBlocks: support.customBlocks
|
|
618
|
+
});
|
|
619
|
+
return {
|
|
620
|
+
type: "page",
|
|
621
|
+
pageRead,
|
|
622
|
+
pageId: pageRecord.id,
|
|
623
|
+
routeId: pageRecord.routeId ?? null,
|
|
624
|
+
pageMetadata: projectPagePreviewMetadata(pageRecord, pageData.name, canonicalPagePath),
|
|
625
|
+
page: pageOutline,
|
|
626
|
+
runtimeJoins: pageData.runtimeJoins,
|
|
627
|
+
theme: support.theme,
|
|
628
|
+
siteId,
|
|
629
|
+
...support.customBlocks ? { customBlocks: support.customBlocks } : {},
|
|
630
|
+
resolvedData: prefetched.resolvedData,
|
|
631
|
+
dataContext: {
|
|
632
|
+
previewStage,
|
|
633
|
+
now: support.now,
|
|
634
|
+
...siteBlockRenderContext(support),
|
|
635
|
+
prefetchedBlockData: prefetched,
|
|
636
|
+
loaderSnapshot: prefetched.loaderSnapshot,
|
|
637
|
+
loaderFailures: prefetched.loaderFailures
|
|
638
|
+
},
|
|
639
|
+
bookingOfferingPresets: support.bookingOfferingPresets,
|
|
640
|
+
openingHours: support.openingHours,
|
|
641
|
+
siteTerms: support.siteTerms,
|
|
642
|
+
mailingList: support.mailingList,
|
|
643
|
+
interactionContext: support.interactionContext,
|
|
644
|
+
bookingTimeZone: support.bookingTimeZone,
|
|
645
|
+
now: support.now,
|
|
646
|
+
site: support.site,
|
|
647
|
+
sdkConfig: support.sdkConfig,
|
|
648
|
+
supabaseUrl: support.supabaseUrl,
|
|
649
|
+
routeMap: support.routeMap,
|
|
650
|
+
pagesByIdentifier: support.pagesByIdentifier,
|
|
651
|
+
entriesByIdentifier: support.entriesByIdentifier,
|
|
652
|
+
...support.mediaAssets ? { mediaAssets: support.mediaAssets } : {}
|
|
653
|
+
};
|
|
654
|
+
}
|
|
655
|
+
function projectPagePreviewMetadata(page, pageName, canonicalPath) {
|
|
656
|
+
return {
|
|
657
|
+
...projectDraftPageMetadata(page, pageName, canonicalPath),
|
|
658
|
+
...projectPublishedPageMetadata(page, pageName, canonicalPath)
|
|
659
|
+
};
|
|
660
|
+
}
|
|
661
|
+
function projectDraftPageMetadata(page, pageName, canonicalPath) {
|
|
662
|
+
return {
|
|
663
|
+
draftTitle: page.draftTitle ?? page.name ?? pageName,
|
|
664
|
+
draftPath: page.draftPath ?? page.path ?? canonicalPath,
|
|
665
|
+
draftStatus: page.draftStatus ?? page.status ?? "draft",
|
|
666
|
+
draftMetaTitle: page.draftMetaTitle ?? null,
|
|
667
|
+
draftMetaDescription: page.draftMetaDescription ?? null
|
|
668
|
+
};
|
|
669
|
+
}
|
|
670
|
+
function projectPublishedPageMetadata(page, pageName, canonicalPath) {
|
|
671
|
+
return {
|
|
672
|
+
title: page.name ?? pageName,
|
|
673
|
+
path: canonicalPath,
|
|
674
|
+
status: page.status ?? page.draftStatus ?? "draft",
|
|
675
|
+
publishedAt: page.publishedAt ?? null,
|
|
676
|
+
lastPublishedAt: page.lastPublishedAt ?? null,
|
|
677
|
+
publishedMetaTitle: page.publishedMetaTitle ?? null,
|
|
678
|
+
publishedMetaDescription: page.publishedMetaDescription ?? null,
|
|
679
|
+
ogImageId: page.ogImageId ?? null
|
|
680
|
+
};
|
|
681
|
+
}
|
|
682
|
+
/**
|
|
683
|
+
* Type guard to check if API response is an entry
|
|
684
|
+
*/
|
|
685
|
+
function isEntryResponse(response) {
|
|
686
|
+
return "entry" in response;
|
|
687
|
+
}
|
|
688
|
+
function isPageSurfaceResponse(response) {
|
|
689
|
+
return response.type === "pageSurface";
|
|
690
|
+
}
|
|
691
|
+
//#endregion
|
|
692
|
+
export { loadContentFromContentResponseWithDeps as a, loadContent as i, isPageContent as n, isPageSurfaceContent as r, isEntryContent as t };
|