@riverbankcms/sdk 0.165.0 → 0.167.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/README.md +5 -0
- package/dist/_dts/{BlocksIslandsHydrator-CdsSMQEv.d.ts → BlocksIslandsHydrator-Dgb-ptph.d.ts} +1 -1
- package/dist/_dts/{Page-D6gp2Ipb.d.ts → Page-Bs3WxFgr.d.ts} +20 -258
- package/dist/_dts/{SdkPreviewMode-DNXAvnet.d.ts → SdkPreviewMode-DtUCsaHY.d.ts} +26 -3
- package/dist/_dts/{client-BkkExozE.d.ts → client-CwsI23pj.d.ts} +13 -1
- package/dist/_dts/{content-types-CXNAD7ef.d.ts → content-types-CAeP_-cV.d.ts} +3 -3
- package/dist/_dts/{contracts-XRXhbLWP.d.ts → contracts-BXHCiF-b.d.ts} +8 -5
- package/dist/_dts/{footerPageOutline-BP2bJYdY.d.ts → footerPageOutline-Bb2gbppW.d.ts} +6 -6
- package/dist/_dts/{generatePageMetadata-DcMtbztV.d.ts → generatePageMetadata-DaBBDx7M.d.ts} +2 -2
- package/dist/_dts/{index-DKNEgSOS.d.ts → index-5_jf52sZ.d.ts} +2 -2
- package/dist/_dts/{index-CQfJhOEA.d.ts → index-C20yUyob.d.ts} +1 -1
- package/dist/_dts/{index-CRRiddNp.d.ts → index-CS6b1B-c.d.ts} +4 -4
- package/dist/_dts/{index-B4ozSzFP.d.ts → index-ChpjHK0U.d.ts} +9737 -8316
- package/dist/_dts/{index-BdkHhyf8.d.ts → index-D7EbliE3.d.ts} +1 -1
- package/dist/_dts/{index-RXkE3a7M.d.ts → index-DeHDwMfu.d.ts} +4 -3
- package/dist/_dts/{index-DAPTSmBM.d.ts → index-RugyUnqR.d.ts} +2499 -2218
- package/dist/_dts/{index-C_3kdrUb.d.ts → index-bDln38Hm.d.ts} +2 -2
- package/dist/_dts/{loadContent-B9vJMq3s.d.ts → loadContent-CTqcL7CS.d.ts} +9 -6
- package/dist/_dts/resolveBlockData-C3s9WMPs.d.ts +136 -0
- package/dist/_dts/{resolvePageContent-DIQyYUi-.d.ts → resolvePageContent-JPwgRxwh.d.ts} +3 -2
- package/dist/_dts/sdk/src/bookings/index.d.ts +2 -2
- package/dist/_dts/sdk/src/client/types.d.ts +2 -2
- package/dist/_dts/sdk/src/client.d.ts +9 -6
- 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 +20 -0
- package/dist/_dts/sdk/src/data/resolveBlockData.d.ts +2 -0
- package/dist/_dts/sdk/src/data/types.d.ts +54 -0
- 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 +6 -1
- package/dist/_dts/sdk/src/navigation/index.d.ts +2 -2
- package/dist/_dts/sdk/src/next/index.d.ts +9 -8
- package/dist/_dts/sdk/src/next/middleware.d.ts +2 -2
- package/dist/_dts/sdk/src/page-converter/index.d.ts +36 -48
- package/dist/_dts/sdk/src/portal/client.d.ts +1 -1
- package/dist/_dts/sdk/src/prebuild/index.d.ts +1 -1
- package/dist/_dts/sdk/src/preview-next/before-render.d.ts +2 -2
- package/dist/_dts/sdk/src/preview-next/client/index.d.ts +2 -2
- package/dist/_dts/sdk/src/preview-next/client/runtime.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/client.d.ts +2 -2
- package/dist/_dts/sdk/src/rendering/components/pageShared.d.ts +2 -0
- package/dist/_dts/sdk/src/rendering/helpers/loadPage.d.ts +3 -0
- package/dist/_dts/sdk/src/rendering/helpers/pageRuntimeSupport.d.ts +260 -0
- package/dist/_dts/sdk/src/rendering/index.d.ts +8 -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/{themeAdmission-D_qtGYAT.d.ts → sdk/src/rendering/themeAdmission.d.ts} +3 -1
- package/dist/_dts/sdk/src/routing/index.d.ts +5 -5
- package/dist/_dts/sdk/src/server.d.ts +7 -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/{types-BDF73NzM.d.ts → types-BlaCuPLr.d.ts} +2 -2
- package/dist/_dts/{types-Cl0nP6al.d.ts → types-CwtTcaQP.d.ts} +3 -3
- package/dist/_dts/{types-mstFvhK4.d.ts → types-D-WElMCy.d.ts} +8 -7
- package/dist/_dts/{validation-DVWqSvjK.d.ts → validation-Y5wD9fGK.d.ts} +4 -4
- package/dist/client/{BlocksIslandsHydrator-CzKpH9Pm.mjs → BlocksIslandsHydrator-DFqkx158.mjs} +31 -24
- package/dist/client/{BookingMailingListNote-rUqsBN7L.mjs → BookingMailingListNote-CCVXX1LN.mjs} +2 -2
- package/dist/client/{CalendarNavigationChevron-YGzw2IPB.mjs → CalendarNavigationChevron-DQwJ7BPx.mjs} +167 -18
- package/dist/client/{CheckboxChoice-DlTC4J2a.mjs → CheckboxChoice-CZ-anOqV.mjs} +1 -1
- package/dist/client/{DemoBookingPortalAccess-D2LyS_Bi.mjs → DemoBookingPortalAccess-DdkY86qI.mjs} +6 -6
- package/dist/client/{DemoPortalSignInLink-BaFg2Uit.mjs → DemoPortalSignInLink-B9YrzZt2.mjs} +1 -1
- package/dist/client/{EventCalendar.client-tRrhPscX.mjs → EventCalendar.client-DAeQPV76.mjs} +11 -30
- package/dist/client/{EventCombined.client-6cfAVtnZ.mjs → EventCombined.client-Bus9R0bj.mjs} +137 -61
- package/dist/client/{EventEmbeddedCheckoutStep-CDNUpI0S.mjs → EventEmbeddedCheckoutStep-D_14yqAU.mjs} +27 -2
- package/dist/client/{EventItem-dILw2PN_.mjs → EventItem-DPBLjGwj.mjs} +75 -13
- package/dist/client/{EventListWeekNavigation-ClgLtjNY.mjs → EventListWeekNavigation-D6cwU82_.mjs} +1 -1
- package/dist/client/{EventListing.client-BNueAHmU.mjs → EventListing.client-Bogi_SnJ.mjs} +3 -3
- package/dist/client/{EventListing.view-DtVbKVkt.mjs → EventListing.view-CEumpN7i.mjs} +35 -51
- package/dist/client/{EventRegistrationPayment-CzkG0NSJ.mjs → EventRegistrationPayment-CIQw6vNy.mjs} +113 -11
- package/dist/client/{LocationMapActions-zWQsJhE5.mjs → LocationMapActions-BVO-qx4q.mjs} +2 -2
- package/dist/client/{MapDrawingSvg-D1AO_o4h.mjs → MapDrawingSvg-CcGaFawl.mjs} +22 -2
- package/dist/client/{Page-DUr2YhFR.mjs → Page-D4_H_u9V.mjs} +23892 -32266
- package/dist/client/{ProtectedSubmitButton-2fJqT_NR.mjs → ProtectedSubmitButton-8DuDw2ag.mjs} +1 -1
- package/dist/client/{StepIndicator-udNHcpOT.mjs → StepIndicator-Dptantmg.mjs} +3 -3
- package/dist/client/{TabBarFragment-C_kt-PXh.mjs → TabBarFragment-BxEGsKUx.mjs} +19 -19
- package/dist/client/{ThemedButton-Cfbo1bfh.mjs → ThemedButton-8jUc02mZ.mjs} +64 -2
- package/dist/client/{accordion-3CYNWzTS.mjs → accordion--EUHmEGa.mjs} +1 -1
- package/dist/client/{booking-form.client-BSbWgLyx.mjs → booking-form.client-BCXwOnhc.mjs} +19 -14
- package/dist/client/{bookingForm-2MoFBWSt.mjs → bookingForm-sHHcdism.mjs} +4 -4
- package/dist/client/bookings.mjs +6 -6
- package/dist/client/{carousel-Cu5mcpO-.mjs → carousel-Cp9xPBFZ.mjs} +2 -2
- package/dist/client/{carousel.client-CQLV8_Al.mjs → carousel.client-BO7sCEpH.mjs} +1 -1
- package/dist/client/{cart-CDc6x9cR.mjs → cart-CCZZC-Lq.mjs} +3 -3
- package/dist/client/{cart.client-BWS2r5Ef.mjs → cart.client-B7JfA19I.mjs} +1 -1
- package/dist/client/{checkout-CkxPqSwD.mjs → checkout-CipmYL4A.mjs} +3 -3
- package/dist/client/{checkout.client-DJfomKQc.mjs → checkout.client-DraalWdH.mjs} +1 -1
- package/dist/client/client.mjs +9550 -17
- package/dist/client/{context-CBV21-9L.mjs → context-Cv3QHjAF.mjs} +11 -6
- package/dist/client/{cta-Bw-al3cs.mjs → cta-P2vJVTEn.mjs} +45 -28
- package/dist/client/{dateFormatting-CFIUJ4Uf.mjs → dateFormatting-D8D47VT4.mjs} +1 -1
- package/dist/client/{demoPortalMagicLink-D0veHJyi.mjs → demoPortalMagicLink-CXWZoV-d.mjs} +1 -1
- package/dist/client/{enhanceHeaderSection-CEqqq92r.mjs → enhanceHeaderSection-BkAro1DJ.mjs} +4 -4
- package/dist/client/{event-details.client-Bk2kQ7ax.mjs → event-details.client-dLmyuPap.mjs} +2 -2
- package/dist/client/{event-registration.client-QMqtIywj.mjs → event-registration.client-BEhC2_-Y.mjs} +34 -20
- package/dist/client/{eventCalendar-BTDTMosr.mjs → eventCalendar-FBMS2Cpb.mjs} +4 -4
- package/dist/client/{eventCombined-BC7a709c.mjs → eventCombined-BrBhUvGe.mjs} +4 -4
- package/dist/client/{eventDetails-DL08GpUc.mjs → eventDetails-C7WUrbZ2.mjs} +2 -2
- package/dist/client/{eventListing-BfzuEQp_.mjs → eventListing-Bih-BgQM.mjs} +4 -4
- package/dist/client/{eventRegistration-Lfyzh1Ab.mjs → eventRegistration-DfTlqGbl.mjs} +4 -4
- package/dist/client/{form-L-xZOBUS.mjs → form-Bw1uuiUs.mjs} +3 -3
- package/dist/client/{form.client-BtpK3TZW.mjs → form.client-pZ-9gN33.mjs} +5 -5
- package/dist/client/{form.parts-Djos5Un4.mjs → form.parts-PXlu6XQO.mjs} +3 -3
- package/dist/client/{formatDate-DGmrm7YB.mjs → formatDate-DI3DP48e.mjs} +1 -1
- package/dist/client/gifting/client.mjs +3 -4
- package/dist/client/{headerSection-f16OGkz-.mjs → headerSection-BpJYUMd6.mjs} +2 -2
- package/dist/client/{mediaAssets-DHAmrVIi.mjs → mediaAssets-DpPauppt.mjs} +1 -1
- package/dist/client/{mediaContext-CwT6ZOm7.mjs → mediaContext-BLo4NtjP.mjs} +25 -19
- package/dist/client/{newsletter-form.client-DpHNZc7k.mjs → newsletter-form.client-CSoP0cGR.mjs} +6 -6
- package/dist/client/{newsletter-form.parts-CLGH20PL.mjs → newsletter-form.parts-DDbX_Sj0.mjs} +2 -2
- package/dist/client/{newsletterForm-BEU0Ocu9.mjs → newsletterForm-vCxYRar_.mjs} +3 -3
- package/dist/client/{noop-CQU7tiMg.mjs → noop-ByVtIWf4.mjs} +420 -170
- package/dist/client/portal/client.mjs +13 -14
- package/dist/client/{product-detail.client-Be-om1BT.mjs → product-detail.client-7Pi6avM-.mjs} +1 -1
- package/dist/client/{product-list.client-DR7hD5Vs.mjs → product-list.client-DEad-Pma.mjs} +1 -1
- package/dist/client/{productDetail-BD42UOmG.mjs → productDetail-G1SMXG13.mjs} +3 -3
- package/dist/client/{productList-CSk8sXCl.mjs → productList-B21TGdpT.mjs} +3 -3
- package/dist/client/{propsDecoder-C_Y6VYnF.mjs → propsDecoder-B3vIBkex.mjs} +4 -5
- package/dist/client/{registry.server-CIKtTsCl.mjs → registry.server-B8aQhJpO.mjs} +399 -473
- package/dist/client/rendering/client.mjs +29 -28
- package/dist/client/rendering/islands.mjs +1 -1
- package/dist/client/rendering.mjs +70 -8
- package/dist/client/{richText-coerce-spWtx86G.mjs → richText-coerce-DHkBtO0G.mjs} +1 -1
- package/dist/client/{routeIslandApiConfig-CROHPlYS.mjs → routeIslandApiConfig-DbHX4JOS.mjs} +1 -1
- package/dist/client/{shop-commerce-CDUohm_2.mjs → shop-commerce-B2UmrQg_.mjs} +12 -12
- package/dist/client/{shop-commerce-store-B9nw4lRP.mjs → shop-commerce-store-B7n-Z7nY.mjs} +1 -1
- package/dist/client/{shop-DscvMz86.mjs → shop-mqyoOvOK.mjs} +3 -3
- package/dist/client/{shop.client-M3kNsVPi.mjs → shop.client-BH-BBnA9.mjs} +13 -13
- package/dist/client/{shop.interactive-BGmkdIAZ.mjs → shop.interactive-mdM3UMWG.mjs} +74 -36
- package/dist/client/{shopShared-BdWp6LHa.mjs → shopShared-CXF5wxdg.mjs} +2 -2
- package/dist/client/site-styles-CMCUxsIM.mjs +3 -0
- package/dist/{preview-next/client/ThemedButton-Dc6aJ34Z.mjs → client/site-styles-D56hT2u1.mjs} +26000 -16565
- package/dist/client/spam-protection.mjs +1 -1
- package/dist/client/src-DjnxOjXG.mjs +217 -0
- package/dist/client/surfaceTransportMarker-BXepAVF6.mjs +152 -0
- package/dist/client/{timetableModel-Dynh5-j4.mjs → timetableModel-CrC80EOG.mjs} +13 -140
- package/dist/client/types-sF-IrGQr.mjs +633 -0
- package/dist/client/{useAvailableSlots-Cw9paRPY.mjs → useAvailableSlots-C4LOaI_Z.mjs} +8 -5
- package/dist/client/{useBookingNowIso-C9SF2rC6.mjs → useBookingNowIso-BDmWkYUW.mjs} +1 -1
- package/dist/client/{useDiscountApply-B-QJfBg0.mjs → useDiscountApply-6Q0nToVA.mjs} +3 -3
- package/dist/client/{useDiscountCodeUi-Uvum8q9d.mjs → useDiscountCodeUi-CM-DTX5X.mjs} +1 -1
- package/dist/client/{useEventPagination-BfM3xk6j.mjs → useEventPagination-Bcs89BR5.mjs} +9 -9
- package/dist/client/{view-DlkCDfuN.mjs → view-BN-fxyfq.mjs} +287 -232
- package/dist/client/{view-DXOuduIr.mjs → view-Dh2tGoS0.mjs} +4 -4
- package/dist/client/{wizardSteps-DManVJpc.mjs → wizardSteps-DtkhwKXK.mjs} +468 -149
- package/dist/preview-next/before-render.mjs +3 -140
- package/dist/preview-next/client/ArrangementLookControls-D4VjPs-r.mjs +31197 -0
- package/dist/preview-next/client/{EventEmbeddedCheckoutStep-Die6Y25O.mjs → EventEmbeddedCheckoutStep-C_h1cMYm.mjs} +33 -4
- package/dist/preview-next/client/{LocationPickerEnvironment-Bp4BHLCL.mjs → LocationPickerEnvironment-D56RD3e_.mjs} +1 -1
- package/dist/preview-next/client/{MapLibreEditMap-Cb0JhM9p.mjs → MapLibreEditMap-DFnyCckr.mjs} +2 -2
- package/dist/preview-next/client/PreviewEditorSidebar-Ckr2zk_L.mjs +37247 -0
- package/dist/preview-next/client/{PreviewEditorUI-CxwlLBGw.mjs → PreviewEditorUI-KOZgw_gS.mjs} +45 -17
- package/dist/preview-next/client/PreviewShell-CyO2V4kB.mjs +4757 -0
- package/dist/preview-next/client/SdkPreviewModeRuntime-DW3uKvNF.mjs +4258 -0
- package/dist/preview-next/client/SiteChromeCustomizeButton-CU9VD-7O.mjs +72202 -0
- package/dist/preview-next/client/ThemedButton-C0dgGJ5k.mjs +2006 -0
- package/dist/preview-next/client/{lucide-react-CqxuVAyz.mjs → lucide-react-CPBCf6QT.mjs} +15 -2
- package/dist/preview-next/client/previewAssistantSlot-DBi-WybM.mjs +112193 -0
- package/dist/preview-next/client/{previewChromeSurface-yuwnDP3B.mjs → previewChromeSurface-BhkUJst9.mjs} +90 -28
- package/dist/preview-next/client/runtime.mjs +3 -3
- package/dist/preview-next/client/sdk-runtime-BjCb6lOn.mjs +5 -0
- package/dist/preview-next/client/{editorStatusDecision-DR4BBKhy.mjs → useAutosaveStatus-CKxTaC3j.mjs} +40 -3
- package/dist/preview-next/client/useBlockCustomizeControls-B7MLTjBX.mjs +2633 -0
- package/dist/preview-next/client/useOpenBlockForSetup-BTUc0g9X.mjs +28 -0
- package/dist/preview-next/keepAlive.mjs +25 -2
- package/dist/preview-next/middleware.mjs +1 -1
- package/dist/preview-next/{route-contract-BBAJjFIz.mjs → route-contract-Bv3nkdpV.mjs} +215 -118
- package/dist/server/{Block.shared-ClFI3qpX.mjs → Block.shared-4fMqzltx.mjs} +7 -4
- package/dist/server/{src-DsYPhTbs.mjs → ThemeScopeCore-C72VC_lR.mjs} +894 -2556
- package/dist/server/accessibleSurfaces-B_Y_dA20.mjs +2305 -0
- package/dist/server/{bindings-Bi8EoRZD.mjs → bindings-ConMYJ2U.mjs} +2 -3
- package/dist/server/{publicProducts-Bz8loTRn.mjs → client-Cot-H5fQ.mjs} +2558 -343
- package/dist/server/config-validation.mjs +1 -1
- package/dist/server/config.mjs +33 -2
- package/dist/server/data/dataLoaderContext.mjs +2 -0
- package/dist/server/data/resolveBlockData.mjs +2 -0
- package/dist/server/data/types.mjs +1 -0
- package/dist/server/dataLoaderContext-B3fXA54R.mjs +47 -0
- package/dist/server/identity-Bn9OQiT1.mjs +6 -0
- package/dist/server/index.mjs +3 -3
- package/dist/server/{loadContent-dEEhQxL7.mjs → loadContent-BkaWYEwt.mjs} +6 -5
- package/dist/server/{loadPage-DBFBad8A.mjs → loadPage-kviUdH8c.mjs} +4 -2
- package/dist/server/manifest.mjs +1 -1
- package/dist/server/media-DnlczCMA.mjs +231 -0
- package/dist/server/metadata.mjs +5 -1
- package/dist/server/mode-Cv_TG9gP.mjs +63 -0
- package/dist/server/next/revalidate.mjs +9 -4
- package/dist/server/next.mjs +11 -11
- package/dist/server/opaqueSurface-BTnS09GS.mjs +54 -0
- package/dist/server/{overrideResolution-BIJbiXYc.mjs → overrideResolution-itXZCXs7.mjs} +2 -1
- package/dist/server/overrides-CD4d-1w7.mjs +177 -0
- package/dist/server/page-converter.mjs +243 -91
- package/dist/server/pageRenderPlan-CDyn7iLy.mjs +4162 -0
- package/dist/server/{themeAdmission-CSknYpxk.mjs → pageRuntimeSupport-DZ6cLxrM.mjs} +13 -28
- package/dist/server/{overrides-DhF87Vsd.mjs → pageShared-Q_Vij87H.mjs} +3808 -1928
- package/dist/server/parseThemeForPersistence-CDrF51tJ.mjs +52 -0
- package/dist/server/{prebuild-DaemmWQL.mjs → prebuild-DOG4MkOy.mjs} +1 -1
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/prefetchBlockData-DlprLLsc.mjs +756 -0
- package/dist/server/{registry-Cdvz1OtL.mjs → registry-BPFcpn6k.mjs} +21838 -709
- package/dist/server/rendering/components/pageShared.mjs +2 -0
- package/dist/server/rendering/helpers/loadPage.mjs +2 -0
- package/dist/server/rendering/helpers/pageRuntimeSupport.mjs +2 -0
- package/dist/server/rendering/server.mjs +5 -4
- package/dist/server/rendering/themeAdmission.mjs +2 -0
- package/dist/server/rendering.mjs +11 -10
- package/dist/server/repeaterFields-MIz7r1ez.mjs +9 -0
- package/dist/server/{resolveBlockData-CLpAJWWf.mjs → resolveBlockData-BHvfGD4y.mjs} +6 -48
- package/dist/server/resolveButtonColourStates-OXFRGn5M.mjs +2682 -0
- package/dist/server/responseMedia-D8J3VAFs.mjs +115 -0
- package/dist/server/{richTextSchema-YYc85FX4.mjs → richTextSchema-Euhuj-7V.mjs} +26 -1
- package/dist/server/routing.mjs +1 -1
- package/dist/server/schema-DEizlyi4.mjs +2524 -0
- package/dist/server/server.mjs +3 -3
- package/dist/server/theme-bridge.mjs +1031 -1
- package/dist/server/theme.mjs +2 -1
- package/dist/server/themeAdmission-DGSAlFUK.mjs +18 -0
- package/dist/server/{three-pass-converter-Chnb1XD-.mjs → three-pass-converter-_j2UE2tR.mjs} +1 -1
- package/dist/server/validation-CDd6m8Ry.mjs +140 -0
- package/dist/server/{validation-DYxhLzqQ.mjs → validation-bl6WcAi_.mjs} +419 -3
- package/dist/server/{version-Beu4q-Gv.mjs → version-BLXZ31S-.mjs} +1 -1
- package/dist/styles/index.css +710 -29
- package/package.json +39 -1
- package/dist/client/events-BmqPeeQm.mjs +0 -20
- package/dist/client/purchase-BV5xfaZH.mjs +0 -894
- package/dist/client/schema-BdSglH2X.mjs +0 -16084
- package/dist/client/site-styles-CWHmlVT5.mjs +0 -14503
- package/dist/client/src-VIsPY-kw.mjs +0 -62
- package/dist/preview-next/client/PreviewEditorSidebar-DEP3xD9K.mjs +0 -5810
- package/dist/preview-next/client/SdkPreviewModeRuntime-Cpe-XP8e.mjs +0 -3
- package/dist/preview-next/client/SdkPreviewModeRuntime-QDkMPASV.mjs +0 -8059
- package/dist/preview-next/client/SiteChromeCustomizeButton-1JaoGOKX.mjs +0 -9367
- package/dist/preview-next/client/previewSidebarNavigation-AXUj9-qQ.mjs +0 -224683
- package/dist/preview-next/client/result-BjJUoxUF.mjs +0 -16
- package/dist/preview-next/client/sdk-runtime-O-eA9-rV.mjs +0 -4
- package/dist/preview-next/refresh-contract-uQ6BXgLJ.mjs +0 -25
- package/dist/server/bindings-Dgt_0goJ.mjs +0 -17
- package/dist/server/client-DfMDbZ41.mjs +0 -2330
- package/dist/server/effectiveNavLinkStyle-BHIYPVG1.mjs +0 -13713
- package/dist/server/loadPage-CnVB-aeL.mjs +0 -2
- package/dist/server/prefetchBlockData-FwcsT5H2.mjs +0 -4359
- package/dist/server/schema-uSA_x1Zh.mjs +0 -16311
- package/dist/server/site-styles-CntHn2KI.mjs +0 -793
- package/dist/server/siteChromeOverlayClearance-DqP40Ka0.mjs +0 -802
|
@@ -0,0 +1,756 @@
|
|
|
1
|
+
import { B as selectBlockContent, H as defaultThemeTokens, c as coerceLinkedContentEntriesPayload, d as defaultTransforms, n as planArrangementContent } from "./pageRenderPlan-CDyn7iLy.mjs";
|
|
2
|
+
import { G as calendarWindowQuerySchema, Gn as resolveDateRuntimeContext, I as projectRecurringSchedule, Ri as bindingSchema, Wn as readRuntimeNow, ri as runTransforms, t as getBlockDefinition, yo as toUtcIsoDateTimeString } from "./registry-BPFcpn6k.mjs";
|
|
3
|
+
import { t as assertNever } from "./assert-never-ku-PUn9U.mjs";
|
|
4
|
+
import { a as isObjectRecord } from "./richTextSchema-Euhuj-7V.mjs";
|
|
5
|
+
import { a as SUPPORTED_LOADER_ENDPOINTS$1, i as parsePublicProductCategorySelector, n as materializeLoaderMedia } from "./responseMedia-D8J3VAFs.mjs";
|
|
6
|
+
//#region ../blocks/src/system/data/utils.ts
|
|
7
|
+
/**
|
|
8
|
+
* Normalize data loaders from block definition
|
|
9
|
+
*/
|
|
10
|
+
function normalizeDataLoaders(def) {
|
|
11
|
+
if (!def?.dataLoaders) return [];
|
|
12
|
+
return Object.entries(def.dataLoaders).map(([key, loader]) => ({
|
|
13
|
+
key,
|
|
14
|
+
loader
|
|
15
|
+
}));
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Normalize params for API calls.
|
|
19
|
+
* Converts supplied values to strings, preserving absent versus explicitly empty params.
|
|
20
|
+
*/
|
|
21
|
+
function normalizeParams(input) {
|
|
22
|
+
if (!input || typeof input !== "object") return {};
|
|
23
|
+
const output = {};
|
|
24
|
+
for (const [key, value] of Object.entries(input)) if (value !== void 0 && value !== null) output[key] = coerceToString(value);
|
|
25
|
+
return output;
|
|
26
|
+
}
|
|
27
|
+
function isNonArrayObject(value) {
|
|
28
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
29
|
+
}
|
|
30
|
+
function safeJsonStringify(value) {
|
|
31
|
+
try {
|
|
32
|
+
return JSON.stringify(value);
|
|
33
|
+
} catch {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Coerce value to string for API params
|
|
39
|
+
*/
|
|
40
|
+
function coerceToString(value) {
|
|
41
|
+
if (value === null || value === void 0) return "";
|
|
42
|
+
if (Array.isArray(value)) {
|
|
43
|
+
if (value.some(isNonArrayObject)) {
|
|
44
|
+
const json = safeJsonStringify(value);
|
|
45
|
+
if (typeof json === "string") return json;
|
|
46
|
+
}
|
|
47
|
+
return value.map(coerceToString).join(",");
|
|
48
|
+
}
|
|
49
|
+
if (isNonArrayObject(value)) {
|
|
50
|
+
const json = safeJsonStringify(value);
|
|
51
|
+
if (typeof json === "string") return json;
|
|
52
|
+
}
|
|
53
|
+
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean" || typeof value === "bigint") return String(value);
|
|
54
|
+
return "";
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* The appointment-services catalogue (issue 1403) pairs the services with the
|
|
58
|
+
* site's ordered categories. Both are needed to group them, so that response
|
|
59
|
+
* is passed through whole; any other `{ services }` wrapper is unwrapped.
|
|
60
|
+
*/
|
|
61
|
+
function coerceServicesPayload(record) {
|
|
62
|
+
return Array.isArray(record.services) && Array.isArray(record.categories) ? {
|
|
63
|
+
services: record.services,
|
|
64
|
+
categories: record.categories
|
|
65
|
+
} : record.services;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Extract data from API response.
|
|
69
|
+
* Unwraps common response wrappers: { data }, { form }, { entries }, { services }, { teamMembers }
|
|
70
|
+
*
|
|
71
|
+
* Note: We check that properties are NOT functions to avoid returning
|
|
72
|
+
* built-in methods like Array.prototype.entries
|
|
73
|
+
*/
|
|
74
|
+
function coercePayload(payload) {
|
|
75
|
+
const linkedContentEntries = coerceLinkedContentEntriesPayload(payload);
|
|
76
|
+
if (linkedContentEntries !== payload) return linkedContentEntries;
|
|
77
|
+
if (payload && typeof payload === "object" && !Array.isArray(payload)) {
|
|
78
|
+
const record = payload;
|
|
79
|
+
if ("data" in record && typeof record.data !== "function") return record.data;
|
|
80
|
+
if ("form" in record && typeof record.form !== "function") return record.form;
|
|
81
|
+
if ("entries" in record && typeof record.entries !== "function") return record.entries;
|
|
82
|
+
if ("services" in record && typeof record.services !== "function") return coerceServicesPayload(record);
|
|
83
|
+
if ("teamMembers" in record && typeof record.teamMembers !== "function") return record.teamMembers;
|
|
84
|
+
}
|
|
85
|
+
return payload;
|
|
86
|
+
}
|
|
87
|
+
//#endregion
|
|
88
|
+
//#region ../blocks/src/system/data/fetchLoaderData.ts
|
|
89
|
+
const ALL_PAGE_SIZE = 50;
|
|
90
|
+
/** The shared loader owns All pagination and rejects adapters that repeat a page. */
|
|
91
|
+
async function fetchLoaderData(apiClient, endpoint, params) {
|
|
92
|
+
if (params.limit === "all") return fetchAllPages(apiClient, endpoint, params, 0, /* @__PURE__ */ new Set());
|
|
93
|
+
return coercePayload(await apiClient({
|
|
94
|
+
endpoint,
|
|
95
|
+
params
|
|
96
|
+
}));
|
|
97
|
+
}
|
|
98
|
+
function planLoaderPage(data, offset, seenPages) {
|
|
99
|
+
if (!isUnknownArray(data)) return {
|
|
100
|
+
kind: "invalid",
|
|
101
|
+
message: "Expected paged loader entries"
|
|
102
|
+
};
|
|
103
|
+
if (data.length < ALL_PAGE_SIZE) return {
|
|
104
|
+
kind: "complete",
|
|
105
|
+
entries: data
|
|
106
|
+
};
|
|
107
|
+
const ids = data.map((entry) => isObjectRecord(entry) && typeof entry.id === "string" ? entry.id : null);
|
|
108
|
+
const key = JSON.stringify(ids.every((id) => id !== null) ? [...ids].sort() : data);
|
|
109
|
+
if (seenPages.has(key)) return {
|
|
110
|
+
kind: "invalid",
|
|
111
|
+
message: "Paged loader made no progress"
|
|
112
|
+
};
|
|
113
|
+
return {
|
|
114
|
+
kind: "continue",
|
|
115
|
+
entries: data,
|
|
116
|
+
offset: offset + data.length,
|
|
117
|
+
seenPages: /* @__PURE__ */ new Set([...seenPages, key])
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
async function fetchAllPages(apiClient, endpoint, params, offset, seenPages) {
|
|
121
|
+
const page = planLoaderPage(coercePayload(await apiClient({
|
|
122
|
+
endpoint,
|
|
123
|
+
params: {
|
|
124
|
+
...params,
|
|
125
|
+
limit: String(ALL_PAGE_SIZE),
|
|
126
|
+
offset: String(offset)
|
|
127
|
+
}
|
|
128
|
+
})), offset, seenPages);
|
|
129
|
+
switch (page.kind) {
|
|
130
|
+
case "invalid": throw new Error(page.message);
|
|
131
|
+
case "complete": return page.entries;
|
|
132
|
+
case "continue": return [...page.entries, ...await fetchAllPages(apiClient, endpoint, params, page.offset, page.seenPages)];
|
|
133
|
+
default: return assertNever(page);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
function isUnknownArray(value) {
|
|
137
|
+
return Array.isArray(value);
|
|
138
|
+
}
|
|
139
|
+
//#endregion
|
|
140
|
+
//#region ../blocks/src/system/runtime/bindings.ts
|
|
141
|
+
const shouldLogWarnings = isNonProductionEnv();
|
|
142
|
+
function isPlainObject(value) {
|
|
143
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
144
|
+
}
|
|
145
|
+
function isRouteMapEntry(value) {
|
|
146
|
+
if (typeof value === "string") return true;
|
|
147
|
+
return isPlainObject(value);
|
|
148
|
+
}
|
|
149
|
+
function isRouteMap(value) {
|
|
150
|
+
if (!isPlainObject(value)) return false;
|
|
151
|
+
return Object.values(value).every(isRouteMapEntry);
|
|
152
|
+
}
|
|
153
|
+
function isPageIdentifierMap(value) {
|
|
154
|
+
if (!isPlainObject(value)) return false;
|
|
155
|
+
return Object.values(value).every((v) => typeof v === "string");
|
|
156
|
+
}
|
|
157
|
+
function isEntryIdentifierMap(value) {
|
|
158
|
+
if (!isPlainObject(value)) return false;
|
|
159
|
+
for (const v of Object.values(value)) {
|
|
160
|
+
if (!isPlainObject(v)) return false;
|
|
161
|
+
if (!Object.values(v).every((inner) => typeof inner === "string")) return false;
|
|
162
|
+
}
|
|
163
|
+
return true;
|
|
164
|
+
}
|
|
165
|
+
function buildTransformContext(vm, dateContext, now) {
|
|
166
|
+
const root = vm.$root;
|
|
167
|
+
const stage = root && isPlainObject(root) && root.previewStage === "preview" ? "preview" : "published";
|
|
168
|
+
const routes = root && isPlainObject(root) && isRouteMap(root.routes) ? root.routes : void 0;
|
|
169
|
+
const pagesByIdentifier = root && isPlainObject(root) && isPageIdentifierMap(root.pagesByIdentifier) ? root.pagesByIdentifier : void 0;
|
|
170
|
+
const entriesByIdentifier = root && isPlainObject(root) && isEntryIdentifierMap(root.entriesByIdentifier) ? root.entriesByIdentifier : void 0;
|
|
171
|
+
return {
|
|
172
|
+
theme: defaultThemeTokens,
|
|
173
|
+
dateContext,
|
|
174
|
+
now,
|
|
175
|
+
stage,
|
|
176
|
+
data: vm.content,
|
|
177
|
+
routes,
|
|
178
|
+
pagesByIdentifier,
|
|
179
|
+
entriesByIdentifier
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
function resolveParamsBindings(input, vm, meta, dateContext = resolveDateRuntimeContext(typeof vm.$root?.bookingTimeZone === "string" ? vm.$root.bookingTimeZone : void 0), now = readRuntimeNow(vm.$root?.now)) {
|
|
183
|
+
return resolveLoaderParam(input, {
|
|
184
|
+
vm,
|
|
185
|
+
meta,
|
|
186
|
+
transforms: buildTransformContext(vm, dateContext, now)
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
function resolveLoaderParam(input, runtime) {
|
|
190
|
+
if (input === null || typeof input !== "object") return input;
|
|
191
|
+
if (Array.isArray(input)) return input.map((value) => resolveLoaderParam(value, runtime));
|
|
192
|
+
const inputRecord = input;
|
|
193
|
+
const binding = inputRecord.$bind;
|
|
194
|
+
if (binding && typeof binding === "object") return resolveBoundLoaderParam(binding, runtime);
|
|
195
|
+
return Object.fromEntries(Object.entries(inputRecord).map(([key, value]) => [key, resolveLoaderParam(value, runtime)]));
|
|
196
|
+
}
|
|
197
|
+
function resolveBoundLoaderParam(input, runtime) {
|
|
198
|
+
try {
|
|
199
|
+
const binding = bindingSchema.parse(input);
|
|
200
|
+
const value = resolveBinding(binding.from, runtime.vm);
|
|
201
|
+
const resolved = value === void 0 || value === null ? binding.fallback : runTransforms(value, binding.transforms, runtime.transforms, defaultTransforms);
|
|
202
|
+
return resolved === void 0 || resolved === null || resolved === "" ? binding.fallback : resolved;
|
|
203
|
+
} catch (err) {
|
|
204
|
+
if (shouldLogWarnings) console.warn(`bindings: failed to parse loader param binding for block "${runtime.meta?.blockKind ?? "unknown"}"`, err);
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
function resolveBinding(path, vm) {
|
|
209
|
+
const segments = splitPath(path);
|
|
210
|
+
if (!segments.length) return void 0;
|
|
211
|
+
const [first, ...rest] = segments;
|
|
212
|
+
let source = vm;
|
|
213
|
+
if (first === "$root") {
|
|
214
|
+
source = vm;
|
|
215
|
+
return readFromSource(source, [first, ...rest]);
|
|
216
|
+
}
|
|
217
|
+
if (first === "content") {
|
|
218
|
+
source = vm.content;
|
|
219
|
+
return readFromSource(source, rest);
|
|
220
|
+
}
|
|
221
|
+
const contentResult = readFromSource(vm.content, segments);
|
|
222
|
+
if (contentResult !== void 0) return contentResult;
|
|
223
|
+
return readFromSource(vm, segments);
|
|
224
|
+
}
|
|
225
|
+
function splitPath(path) {
|
|
226
|
+
const PATH_SEPARATOR_REGEX = /\./g;
|
|
227
|
+
const BRACKET_ACCESS_REGEX = /\[(?<token>[^\]]+)\]/g;
|
|
228
|
+
const segments = [];
|
|
229
|
+
const parts = path.split(PATH_SEPARATOR_REGEX);
|
|
230
|
+
for (const raw of parts) {
|
|
231
|
+
if (!raw) continue;
|
|
232
|
+
const baseMatch = raw.match(/^([^\[]+)/);
|
|
233
|
+
if (baseMatch && baseMatch[1]) segments.push(baseMatch[1]);
|
|
234
|
+
const bracketMatches = raw.matchAll(BRACKET_ACCESS_REGEX);
|
|
235
|
+
for (const match of bracketMatches) {
|
|
236
|
+
const token = match.groups?.token ?? "";
|
|
237
|
+
if (token.startsWith("\"") || token.startsWith("'")) segments.push(token.slice(1, -1));
|
|
238
|
+
else if (/^\d+$/.test(token)) segments.push(Number(token));
|
|
239
|
+
else segments.push(token);
|
|
240
|
+
}
|
|
241
|
+
if (!baseMatch && !raw.includes("[")) segments.push(raw);
|
|
242
|
+
}
|
|
243
|
+
return segments;
|
|
244
|
+
}
|
|
245
|
+
function readFromSource(source, segments) {
|
|
246
|
+
return segments.reduce((current, segment) => {
|
|
247
|
+
if (current === void 0 || current === null) return void 0;
|
|
248
|
+
if (typeof segment === "number") {
|
|
249
|
+
if (Array.isArray(current)) return current[segment];
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
if (typeof current === "object" && current !== null && segment in current) return current[segment];
|
|
253
|
+
}, source);
|
|
254
|
+
}
|
|
255
|
+
function isNonProductionEnv() {
|
|
256
|
+
if (typeof globalThis === "undefined") return true;
|
|
257
|
+
return globalThis.process?.env?.NODE_ENV !== "production";
|
|
258
|
+
}
|
|
259
|
+
//#endregion
|
|
260
|
+
//#region ../blocks/src/system/data/prefetchBlockData.ts
|
|
261
|
+
/**
|
|
262
|
+
* Core block data prefetching logic (framework-agnostic).
|
|
263
|
+
*
|
|
264
|
+
* This module provides the shared implementation for prefetching block data loaders.
|
|
265
|
+
* It works with any API client by accepting it as a parameter (dependency injection).
|
|
266
|
+
*
|
|
267
|
+
* Usage:
|
|
268
|
+
* - Frontend: provide internal API client
|
|
269
|
+
* - SDK: provide SDK client with endpoint mapping
|
|
270
|
+
*/
|
|
271
|
+
function projectDataLoaders(loaders, shouldLoad, blockId, blockKind) {
|
|
272
|
+
if (!shouldLoad) return [...loaders];
|
|
273
|
+
return loaders.filter(({ key }) => shouldLoad({
|
|
274
|
+
blockId,
|
|
275
|
+
blockKind,
|
|
276
|
+
loaderKey: key
|
|
277
|
+
}));
|
|
278
|
+
}
|
|
279
|
+
function shouldSkipResolvedLoader(input) {
|
|
280
|
+
if (input.loader.requiredParams?.some((param) => !input.params[param]?.trim())) return true;
|
|
281
|
+
return Boolean(input.isValidEndpoint && !input.isValidEndpoint(input.endpoint));
|
|
282
|
+
}
|
|
283
|
+
/** Resolve once through the shared bindings owner; request reuse never reuses content provenance. */
|
|
284
|
+
function planBlockDataRequests(page, context, options = {}) {
|
|
285
|
+
const runtime = admitLoaderDateRuntime(context);
|
|
286
|
+
const blocks = page.blocks.flatMap((block) => block.id ? [planBlockRequests(block, block.id, context, options, runtime)] : []);
|
|
287
|
+
return {
|
|
288
|
+
blocks,
|
|
289
|
+
loaderSnapshot: {
|
|
290
|
+
stage: context.previewStage === "preview" ? "draft" : "published",
|
|
291
|
+
blocks: Object.fromEntries(blocks.map((block) => [block.id, {
|
|
292
|
+
kind: block.kind,
|
|
293
|
+
content: block.content,
|
|
294
|
+
requests: Object.fromEntries(block.requests.map(({ key, endpoint, params }) => [key, {
|
|
295
|
+
endpoint,
|
|
296
|
+
params
|
|
297
|
+
}]))
|
|
298
|
+
}]))
|
|
299
|
+
}
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
async function prefetchBlockDataWithFailures$1(page, context, options) {
|
|
303
|
+
const plan = planBlockDataRequests(page, context, options);
|
|
304
|
+
return projectBlockDataOutcomes(plan, await Promise.all(plan.blocks.flatMap((block) => block.requests.map((request) => executeBlockDataRequest(request, options)))));
|
|
305
|
+
}
|
|
306
|
+
function projectBlockDataOutcomes(plan, outcomes) {
|
|
307
|
+
return {
|
|
308
|
+
...projectLoaderOutcomes(plan.blocks, outcomes),
|
|
309
|
+
loaderSnapshot: plan.loaderSnapshot
|
|
310
|
+
};
|
|
311
|
+
}
|
|
312
|
+
function planBlockRequests(block, id, context, options, runtime) {
|
|
313
|
+
const definition = (options.getBlockDefinition ?? getBlockDefinition)(block.kind);
|
|
314
|
+
const loaders = definition ? normalizeDataLoaders(definition) : customLoaders(block.kind, options);
|
|
315
|
+
const vm = {
|
|
316
|
+
content: plannedLoaderContent(block, definition, context),
|
|
317
|
+
$root: {
|
|
318
|
+
...context.root,
|
|
319
|
+
siteId: context.siteId,
|
|
320
|
+
pageId: context.pageId,
|
|
321
|
+
previewStage: context.previewStage
|
|
322
|
+
}
|
|
323
|
+
};
|
|
324
|
+
const requests = projectDataLoaders(loaders, options.shouldLoad, id, block.kind).flatMap((entry) => {
|
|
325
|
+
const request = planLoaderRequest(entry, block, id, vm, options, runtime);
|
|
326
|
+
return request ? [request] : [];
|
|
327
|
+
});
|
|
328
|
+
return {
|
|
329
|
+
id,
|
|
330
|
+
kind: block.kind,
|
|
331
|
+
content: selectBlockContent(block, context.previewStage),
|
|
332
|
+
requests
|
|
333
|
+
};
|
|
334
|
+
}
|
|
335
|
+
function customLoaders(kind, options) {
|
|
336
|
+
return Object.entries(options.getCustomBlockLoaders?.(kind) ?? {}).map(([key, loader]) => ({
|
|
337
|
+
key,
|
|
338
|
+
loader
|
|
339
|
+
}));
|
|
340
|
+
}
|
|
341
|
+
function planLoaderRequest({ key, loader }, block, blockId, vm, options, runtime) {
|
|
342
|
+
if (loader.mode === "client") return null;
|
|
343
|
+
const resolve = options.resolveParamsBindings ?? resolveParamsBindings;
|
|
344
|
+
const coordinates = { blockKind: block.kind };
|
|
345
|
+
if (loader.when !== void 0 && resolve(loader.when, vm, coordinates, runtime.dateContext, runtime.now) !== true) return null;
|
|
346
|
+
const params = normalizeParams(resolve(loader.params, vm, coordinates, runtime.dateContext, runtime.now));
|
|
347
|
+
if (shouldSkipResolvedLoader({
|
|
348
|
+
loader,
|
|
349
|
+
endpoint: loader.endpoint,
|
|
350
|
+
params,
|
|
351
|
+
isValidEndpoint: options.isValidEndpoint
|
|
352
|
+
})) return null;
|
|
353
|
+
return {
|
|
354
|
+
blockId,
|
|
355
|
+
blockKind: block.kind,
|
|
356
|
+
key,
|
|
357
|
+
endpoint: loader.endpoint,
|
|
358
|
+
params
|
|
359
|
+
};
|
|
360
|
+
}
|
|
361
|
+
async function executeBlockDataRequest(request, options) {
|
|
362
|
+
try {
|
|
363
|
+
return {
|
|
364
|
+
kind: "loaded",
|
|
365
|
+
request,
|
|
366
|
+
data: await fetchLoaderData(options.apiClient, request.endpoint, request.params)
|
|
367
|
+
};
|
|
368
|
+
} catch (error) {
|
|
369
|
+
options.onError?.(error, {
|
|
370
|
+
block: request.blockKind,
|
|
371
|
+
loader: request.key
|
|
372
|
+
});
|
|
373
|
+
return {
|
|
374
|
+
kind: "failed",
|
|
375
|
+
request
|
|
376
|
+
};
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
function projectLoaderOutcomes(blocks, outcomes) {
|
|
380
|
+
return {
|
|
381
|
+
resolvedData: Object.fromEntries(blocks.flatMap((block) => {
|
|
382
|
+
const values = outcomes.flatMap((outcome) => outcome.request.blockId === block.id && outcome.kind === "loaded" ? [[outcome.request.key, outcome.data]] : []);
|
|
383
|
+
return values.length ? [[block.id, Object.fromEntries(values)]] : [];
|
|
384
|
+
})),
|
|
385
|
+
loaderFailures: Object.fromEntries(blocks.flatMap((block) => {
|
|
386
|
+
const values = outcomes.flatMap((outcome) => outcome.request.blockId === block.id && outcome.kind === "failed" ? [[outcome.request.key, {
|
|
387
|
+
endpoint: outcome.request.endpoint,
|
|
388
|
+
params: outcome.request.params
|
|
389
|
+
}]] : []);
|
|
390
|
+
return values.length ? [[block.id, Object.fromEntries(values)]] : [];
|
|
391
|
+
}))
|
|
392
|
+
};
|
|
393
|
+
}
|
|
394
|
+
/** Prefetch executes the render-plan content stage before resolving loader bindings. */
|
|
395
|
+
function plannedLoaderContent(block, definition, context) {
|
|
396
|
+
const content = selectBlockContent(block, context.previewStage);
|
|
397
|
+
if (!definition || content._arrangementLooks === void 0) return content;
|
|
398
|
+
return planArrangementContent(block.kind, definition.manifest, content, context.previewStage === "preview" ? "authoring" : "public");
|
|
399
|
+
}
|
|
400
|
+
function admitLoaderDateRuntime(context) {
|
|
401
|
+
const root = context.root;
|
|
402
|
+
return {
|
|
403
|
+
now: root?.now === void 0 ? toUtcIsoDateTimeString((/* @__PURE__ */ new Date()).toISOString()) : readRuntimeNow(root.now),
|
|
404
|
+
dateContext: resolveDateRuntimeContext(typeof root?.bookingTimeZone === "string" ? root.bookingTimeZone : void 0)
|
|
405
|
+
};
|
|
406
|
+
}
|
|
407
|
+
//#endregion
|
|
408
|
+
//#region ../blocks/src/system/data/normalizeLoaderParams.ts
|
|
409
|
+
function toStringParams(value) {
|
|
410
|
+
if (!isObjectRecord(value)) return {};
|
|
411
|
+
const out = {};
|
|
412
|
+
for (const [k, v] of Object.entries(value)) if (typeof v === "string") out[k] = v;
|
|
413
|
+
return out;
|
|
414
|
+
}
|
|
415
|
+
function stripEmptyStringValues(params, endpoint) {
|
|
416
|
+
for (const [key, value] of Object.entries(params)) if (value === "" && !(key === "seriesIds" && (endpoint === "listPublicEvents" || endpoint === "listPublicEventCalendarWindow"))) delete params[key];
|
|
417
|
+
}
|
|
418
|
+
function ensureSiteId(params, context) {
|
|
419
|
+
if (!params.siteId && typeof context.siteId === "string" && context.siteId) params.siteId = context.siteId;
|
|
420
|
+
}
|
|
421
|
+
/**
|
|
422
|
+
* Normalize loader params emitted by the block runtime into a consistent shape
|
|
423
|
+
* (canonical keys + required context-derived fields).
|
|
424
|
+
*
|
|
425
|
+
* Note: params are already stringified by the core prefetch implementation.
|
|
426
|
+
*/
|
|
427
|
+
function normalizeLoaderParams(endpoint, params, context) {
|
|
428
|
+
const out = toStringParams(params);
|
|
429
|
+
stripEmptyStringValues(out, endpoint);
|
|
430
|
+
if (endpoint === "getPublicFormById") {
|
|
431
|
+
ensureSiteId(out, context);
|
|
432
|
+
if (!out.formId && out.formSlug) {
|
|
433
|
+
out.formId = out.formSlug;
|
|
434
|
+
delete out.formSlug;
|
|
435
|
+
}
|
|
436
|
+
return out;
|
|
437
|
+
}
|
|
438
|
+
if (endpoint === "getPublicBookingServices") {
|
|
439
|
+
ensureSiteId(out, context);
|
|
440
|
+
return out;
|
|
441
|
+
}
|
|
442
|
+
if (endpoint === "getPublicWeeklySlotAvailability") {
|
|
443
|
+
ensureSiteId(out, context);
|
|
444
|
+
return out;
|
|
445
|
+
}
|
|
446
|
+
if (endpoint === "listPublicEvents" || endpoint === "listPublicRecurringSchedule" || endpoint === "listPublicEventCalendarWindow") {
|
|
447
|
+
ensureSiteId(out, context);
|
|
448
|
+
return out;
|
|
449
|
+
}
|
|
450
|
+
if (endpoint === "getPublicEventDetails") {
|
|
451
|
+
ensureSiteId(out, context);
|
|
452
|
+
return out;
|
|
453
|
+
}
|
|
454
|
+
if (endpoint === "listPublicProducts") {
|
|
455
|
+
ensureSiteId(out, context);
|
|
456
|
+
return out;
|
|
457
|
+
}
|
|
458
|
+
if (endpoint === "listPublicTeamMembers") {
|
|
459
|
+
ensureSiteId(out, context);
|
|
460
|
+
return out;
|
|
461
|
+
}
|
|
462
|
+
if (endpoint === "listPublicRouteCandidates") {
|
|
463
|
+
ensureSiteId(out, context);
|
|
464
|
+
return out;
|
|
465
|
+
}
|
|
466
|
+
if (endpoint === "getPublishedEntryPreview") {
|
|
467
|
+
ensureSiteId(out, context);
|
|
468
|
+
return out;
|
|
469
|
+
}
|
|
470
|
+
ensureSiteId(out, context);
|
|
471
|
+
return out;
|
|
472
|
+
}
|
|
473
|
+
//#endregion
|
|
474
|
+
//#region src/data/prefetchBlockData.ts
|
|
475
|
+
const SUPPORTED_LOADER_ENDPOINTS = SUPPORTED_LOADER_ENDPOINTS$1;
|
|
476
|
+
function isSupportedLoaderEndpoint(endpoint) {
|
|
477
|
+
return SUPPORTED_LOADER_ENDPOINTS.includes(endpoint);
|
|
478
|
+
}
|
|
479
|
+
const ENTRY_REF_KEYS = [
|
|
480
|
+
"identifier",
|
|
481
|
+
"entryIdentifier",
|
|
482
|
+
"meditationIdentifier",
|
|
483
|
+
"entryId",
|
|
484
|
+
"slug"
|
|
485
|
+
];
|
|
486
|
+
function isRecord(value) {
|
|
487
|
+
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
488
|
+
}
|
|
489
|
+
function extractManualEntryRef(item) {
|
|
490
|
+
if (typeof item === "string") {
|
|
491
|
+
const trimmed = item.trim();
|
|
492
|
+
return trimmed.length > 0 ? trimmed : null;
|
|
493
|
+
}
|
|
494
|
+
if (!isRecord(item)) return null;
|
|
495
|
+
for (const key of ENTRY_REF_KEYS) {
|
|
496
|
+
const raw = item[key];
|
|
497
|
+
if (typeof raw === "string" && raw.trim().length > 0) return raw.trim();
|
|
498
|
+
}
|
|
499
|
+
const fallbackId = item.id;
|
|
500
|
+
if (typeof fallbackId === "string" && fallbackId.trim().length > 0) return fallbackId.trim();
|
|
501
|
+
return null;
|
|
502
|
+
}
|
|
503
|
+
function extractManualEntryRefsFromArray(items) {
|
|
504
|
+
return items.map(extractManualEntryRef).filter((ref) => typeof ref === "string");
|
|
505
|
+
}
|
|
506
|
+
function parseManualEntryRefsValue(value) {
|
|
507
|
+
if (Array.isArray(value)) {
|
|
508
|
+
const refs = extractManualEntryRefsFromArray(value);
|
|
509
|
+
return refs.length > 0 ? refs : void 0;
|
|
510
|
+
}
|
|
511
|
+
if (typeof value === "string" && value.trim()) try {
|
|
512
|
+
const parsed = JSON.parse(value);
|
|
513
|
+
if (!Array.isArray(parsed)) return void 0;
|
|
514
|
+
const refs = extractManualEntryRefsFromArray(parsed);
|
|
515
|
+
return refs.length > 0 ? refs : void 0;
|
|
516
|
+
} catch (error) {
|
|
517
|
+
if (typeof process !== "undefined" && process.env.NODE_ENV !== "production") console.warn("[prefetchBlockData] Failed to parse manual entry refs JSON", {
|
|
518
|
+
value,
|
|
519
|
+
error: error instanceof Error ? error.message : String(error)
|
|
520
|
+
});
|
|
521
|
+
return;
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
function parseManualEntryRefs(...values) {
|
|
525
|
+
for (const value of values) {
|
|
526
|
+
const parsed = parseManualEntryRefsValue(value);
|
|
527
|
+
if (parsed && parsed.length > 0) return parsed;
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
const loaderAdapters = {
|
|
531
|
+
listPublishedEntries,
|
|
532
|
+
getPublishedEntryPreview,
|
|
533
|
+
listPublicEvents,
|
|
534
|
+
listPublicEventCalendarWindow: ({ client, params }) => client.listPublicEventCalendarWindow({
|
|
535
|
+
...calendarWindowQuerySchema.parse(params),
|
|
536
|
+
siteId: requireStringParam(params, "siteId", "listPublicEventCalendarWindow")
|
|
537
|
+
}),
|
|
538
|
+
listPublicRecurringSchedule,
|
|
539
|
+
getPublicEventDetails,
|
|
540
|
+
listPublicRouteCandidates,
|
|
541
|
+
listPublicTeamMembers,
|
|
542
|
+
listPublicProducts,
|
|
543
|
+
listPublicPasses,
|
|
544
|
+
listPublicMemberships,
|
|
545
|
+
getPublicFormById,
|
|
546
|
+
getPublicBookingServices,
|
|
547
|
+
getPublicWeeklySlotAvailability
|
|
548
|
+
};
|
|
549
|
+
function readStringParam(params, key) {
|
|
550
|
+
const value = params[key];
|
|
551
|
+
return value && value.length > 0 ? value : void 0;
|
|
552
|
+
}
|
|
553
|
+
function requireStringParam(params, key, endpoint) {
|
|
554
|
+
const value = readStringParam(params, key);
|
|
555
|
+
if (!value) throw new Error(`${endpoint} requires ${key} param`);
|
|
556
|
+
return value;
|
|
557
|
+
}
|
|
558
|
+
function parsePositiveIntegerParam(params, key) {
|
|
559
|
+
const value = params[key];
|
|
560
|
+
const parsed = value === void 0 ? void 0 : Number.parseInt(value, 10);
|
|
561
|
+
return typeof parsed === "number" && Number.isInteger(parsed) && parsed > 0 ? parsed : void 0;
|
|
562
|
+
}
|
|
563
|
+
function parseEntryOrder(value) {
|
|
564
|
+
if (value === void 0) return void 0;
|
|
565
|
+
switch (value) {
|
|
566
|
+
case "order": return "manual";
|
|
567
|
+
case "newest":
|
|
568
|
+
case "oldest":
|
|
569
|
+
case "title": return value;
|
|
570
|
+
default: return;
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
function parsePublicEventKind(value) {
|
|
574
|
+
if (value === void 0) return void 0;
|
|
575
|
+
switch (value) {
|
|
576
|
+
case "all":
|
|
577
|
+
case "events": return value;
|
|
578
|
+
default: return;
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
async function listPublishedEntries({ client, params }) {
|
|
582
|
+
const siteId = requireStringParam(params, "siteId", "listPublishedEntries");
|
|
583
|
+
const type = requireStringParam(params, "type", "listPublishedEntries");
|
|
584
|
+
const stage = readStringParam(params, "stage");
|
|
585
|
+
const mode = readStringParam(params, "mode");
|
|
586
|
+
const parsedEntryRefs = mode === "manual" ? parseManualEntryRefs(params.identifiers, params.entryRefs, params.entryIds) : void 0;
|
|
587
|
+
if (mode === "manual" && (!parsedEntryRefs || parsedEntryRefs.length === 0)) return { entries: [] };
|
|
588
|
+
if (mode === "manual" && parsedEntryRefs) return await client.getEntriesByIdentifiers({
|
|
589
|
+
siteId,
|
|
590
|
+
contentType: type,
|
|
591
|
+
identifiers: parsedEntryRefs,
|
|
592
|
+
preview: stage === "preview"
|
|
593
|
+
});
|
|
594
|
+
return await client.getEntries(mapEntriesLoaderQuery(params, siteId, type));
|
|
595
|
+
}
|
|
596
|
+
function mapEntriesLoaderQuery(params, siteId, contentType) {
|
|
597
|
+
const rawOffset = readStringParam(params, "offset");
|
|
598
|
+
const offset = rawOffset === void 0 ? void 0 : Number(rawOffset);
|
|
599
|
+
return {
|
|
600
|
+
siteId,
|
|
601
|
+
contentType,
|
|
602
|
+
limit: parsePositiveIntegerParam(params, "limit"),
|
|
603
|
+
offset: offset !== void 0 && Number.isInteger(offset) && offset >= 0 ? offset : void 0,
|
|
604
|
+
order: parseEntryOrder(readStringParam(params, "orderBy")),
|
|
605
|
+
preview: readStringParam(params, "stage") === "preview"
|
|
606
|
+
};
|
|
607
|
+
}
|
|
608
|
+
async function getPublishedEntryPreview({ client, params }) {
|
|
609
|
+
return await client.getEntry({
|
|
610
|
+
siteId: requireStringParam(params, "siteId", "getPublishedEntryPreview"),
|
|
611
|
+
contentType: requireStringParam(params, "type", "getPublishedEntryPreview"),
|
|
612
|
+
slug: requireStringParam(params, "slug", "getPublishedEntryPreview")
|
|
613
|
+
});
|
|
614
|
+
}
|
|
615
|
+
async function listPublicEvents({ client, params }) {
|
|
616
|
+
return await client.listPublicEvents({
|
|
617
|
+
siteId: requireStringParam(params, "siteId", "listPublicEvents"),
|
|
618
|
+
limit: parsePositiveIntegerParam(params, "limit"),
|
|
619
|
+
from: readStringParam(params, "from"),
|
|
620
|
+
to: readStringParam(params, "to"),
|
|
621
|
+
afterStartsAt: readStringParam(params, "afterStartsAt"),
|
|
622
|
+
afterId: readStringParam(params, "afterId"),
|
|
623
|
+
stage: readStringParam(params, "stage"),
|
|
624
|
+
categoryIds: readStringParam(params, "categoryIds"),
|
|
625
|
+
venueId: readStringParam(params, "venueId"),
|
|
626
|
+
staffMemberId: readStringParam(params, "staffMemberId"),
|
|
627
|
+
kind: parsePublicEventKind(readStringParam(params, "kind")),
|
|
628
|
+
eventSurface: readStringParam(params, "eventSurface"),
|
|
629
|
+
eventPresets: readStringParam(params, "eventPresets"),
|
|
630
|
+
scheduleScope: readStringParam(params, "scheduleScope"),
|
|
631
|
+
detailLevel: readStringParam(params, "detailLevel") === "listing" ? "listing" : void 0,
|
|
632
|
+
readProfile: readStringParam(params, "readProfile"),
|
|
633
|
+
seriesId: readStringParam(params, "seriesId"),
|
|
634
|
+
includeOccurrenceId: readStringParam(params, "includeOccurrenceId")
|
|
635
|
+
});
|
|
636
|
+
}
|
|
637
|
+
async function listPublicRecurringSchedule(input) {
|
|
638
|
+
return projectRecurringSchedule(await listPublicEvents(input));
|
|
639
|
+
}
|
|
640
|
+
async function getPublicEventDetails({ client, params }) {
|
|
641
|
+
return await client.getPublicEventDetails({
|
|
642
|
+
siteId: requireStringParam(params, "siteId", "getPublicEventDetails"),
|
|
643
|
+
limit: parsePositiveIntegerParam(params, "limit"),
|
|
644
|
+
from: readStringParam(params, "from"),
|
|
645
|
+
to: readStringParam(params, "to"),
|
|
646
|
+
afterStartsAt: readStringParam(params, "afterStartsAt"),
|
|
647
|
+
afterId: readStringParam(params, "afterId"),
|
|
648
|
+
stage: readStringParam(params, "stage"),
|
|
649
|
+
categoryIds: readStringParam(params, "categoryIds"),
|
|
650
|
+
venueId: readStringParam(params, "venueId"),
|
|
651
|
+
staffMemberId: readStringParam(params, "staffMemberId"),
|
|
652
|
+
kind: readStringParam(params, "kind"),
|
|
653
|
+
eventSurface: readStringParam(params, "eventSurface"),
|
|
654
|
+
eventPresets: readStringParam(params, "eventPresets"),
|
|
655
|
+
scheduleScope: readStringParam(params, "scheduleScope"),
|
|
656
|
+
seriesId: readStringParam(params, "seriesId"),
|
|
657
|
+
includeOccurrenceId: readStringParam(params, "includeOccurrenceId")
|
|
658
|
+
});
|
|
659
|
+
}
|
|
660
|
+
async function listPublicRouteCandidates({ client, params }) {
|
|
661
|
+
const siteId = requireStringParam(params, "siteId", "listPublicRouteCandidates");
|
|
662
|
+
return { routes: (await client.getAllPublishedRoutes({ siteId })).items.flatMap((item) => {
|
|
663
|
+
if (!item.path) return [];
|
|
664
|
+
return [{
|
|
665
|
+
entityId: item.entityId,
|
|
666
|
+
path: item.path,
|
|
667
|
+
title: item.title,
|
|
668
|
+
kind: item.entityType,
|
|
669
|
+
contentTypeKey: item.contentTypeKey ?? null
|
|
670
|
+
}];
|
|
671
|
+
}) };
|
|
672
|
+
}
|
|
673
|
+
async function listPublicTeamMembers({ client, params }) {
|
|
674
|
+
return await client.listPublicTeamMembers({
|
|
675
|
+
siteId: requireStringParam(params, "siteId", "listPublicTeamMembers"),
|
|
676
|
+
stage: readStringParam(params, "stage")
|
|
677
|
+
});
|
|
678
|
+
}
|
|
679
|
+
async function listPublicProducts({ client, params }) {
|
|
680
|
+
return await client.listPublicProducts({
|
|
681
|
+
siteId: requireStringParam(params, "siteId", "listPublicProducts"),
|
|
682
|
+
stage: readStringParam(params, "stage") === "preview" ? "preview" : "published",
|
|
683
|
+
categorySelector: parsePublicProductCategorySelector(params.categorySelector)
|
|
684
|
+
});
|
|
685
|
+
}
|
|
686
|
+
async function listPublicPasses({ client, params }) {
|
|
687
|
+
return await client.listPublicPasses({
|
|
688
|
+
siteId: requireStringParam(params, "siteId", "listPublicPasses"),
|
|
689
|
+
categories: readStringParam(params, "categories")
|
|
690
|
+
});
|
|
691
|
+
}
|
|
692
|
+
async function listPublicMemberships({ client, params }) {
|
|
693
|
+
return await client.listPublicMemberships({
|
|
694
|
+
siteId: requireStringParam(params, "siteId", "listPublicMemberships"),
|
|
695
|
+
categories: readStringParam(params, "categories")
|
|
696
|
+
});
|
|
697
|
+
}
|
|
698
|
+
async function getPublicFormById({ client, params }) {
|
|
699
|
+
return await client.getPublicFormById({
|
|
700
|
+
formId: requireStringParam(params, "formId", "getPublicFormById"),
|
|
701
|
+
siteId: requireStringParam(params, "siteId", "getPublicFormById")
|
|
702
|
+
});
|
|
703
|
+
}
|
|
704
|
+
async function getPublicBookingServices({ client, params }) {
|
|
705
|
+
return await client.getPublicBookingServices({
|
|
706
|
+
siteId: requireStringParam(params, "siteId", "getPublicBookingServices"),
|
|
707
|
+
ids: readStringParam(params, "ids")
|
|
708
|
+
});
|
|
709
|
+
}
|
|
710
|
+
async function getPublicWeeklySlotAvailability({ client, params }) {
|
|
711
|
+
return await client.getPublicWeeklySlotAvailability({
|
|
712
|
+
siteId: requireStringParam(params, "siteId", "getPublicWeeklySlotAvailability"),
|
|
713
|
+
serviceId: requireStringParam(params, "serviceId", "getPublicWeeklySlotAvailability"),
|
|
714
|
+
resourceId: readStringParam(params, "resourceId"),
|
|
715
|
+
horizonWeeks: parsePositiveIntegerParam(params, "horizonWeeks"),
|
|
716
|
+
timezone: readStringParam(params, "timezone")
|
|
717
|
+
});
|
|
718
|
+
}
|
|
719
|
+
/** Rendering consumers retain the request identity with the loaded values. */
|
|
720
|
+
async function prefetchBlockDataWithFailures(page, context, client, options) {
|
|
721
|
+
return prefetchBlockDataWithFailures$1(page, context, sdkPrefetchOptions(normalizeLoaderParams, context, client, options));
|
|
722
|
+
}
|
|
723
|
+
function sdkPrefetchOptions(normalize, context, client, options) {
|
|
724
|
+
const { customBlocks } = options ?? {};
|
|
725
|
+
const customBlockMap = new Map((customBlocks ?? []).map((block) => [block.id, block]));
|
|
726
|
+
return {
|
|
727
|
+
apiClient: async ({ endpoint, params }) => {
|
|
728
|
+
if (!isSupportedLoaderEndpoint(endpoint)) throw new Error(`Unsupported loader endpoint: ${endpoint}. SDK only supports: ${SUPPORTED_LOADER_ENDPOINTS.join(", ")}`);
|
|
729
|
+
const resolvedParams = normalize(endpoint, params, context);
|
|
730
|
+
return materializeLoaderMedia(await loaderAdapters[endpoint]({
|
|
731
|
+
client,
|
|
732
|
+
params: resolvedParams
|
|
733
|
+
}));
|
|
734
|
+
},
|
|
735
|
+
isValidEndpoint: isSupportedLoaderEndpoint,
|
|
736
|
+
onError: (error, { block, loader }) => {
|
|
737
|
+
console.warn("[prefetchBlockData] failed to prefetch block data", {
|
|
738
|
+
block,
|
|
739
|
+
loader,
|
|
740
|
+
error
|
|
741
|
+
});
|
|
742
|
+
},
|
|
743
|
+
getCustomBlockLoaders: (kind) => sdkCustomLoaders(customBlockMap.get(kind))
|
|
744
|
+
};
|
|
745
|
+
}
|
|
746
|
+
function sdkCustomLoaders(block) {
|
|
747
|
+
return block?.dataLoaders ? Object.fromEntries(Object.entries(block.dataLoaders).map(([key, loader]) => [key, {
|
|
748
|
+
endpoint: loader.endpoint,
|
|
749
|
+
params: loader.params,
|
|
750
|
+
requiredParams: loader.requiredParams,
|
|
751
|
+
mode: loader.mode,
|
|
752
|
+
when: loader.when
|
|
753
|
+
}])) : void 0;
|
|
754
|
+
}
|
|
755
|
+
//#endregion
|
|
756
|
+
export { prefetchBlockDataWithFailures as n, SUPPORTED_LOADER_ENDPOINTS as t };
|