@riverbankcms/sdk 0.182.0 → 0.183.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 +79 -0
- package/README.md +49 -3
- package/dist/_dts/{BlocksIslandsHydrator-Bvw2bUif.d.ts → BlocksIslandsHydrator-X1_G96iN.d.ts} +1 -1
- package/dist/_dts/{Page-B2EAT-bE.d.ts → Page-CEqZJZEE.d.ts} +7 -7
- package/dist/_dts/{SdkPreviewMode-D0vww6rh.d.ts → SdkPreviewMode-DQejfbXL.d.ts} +2 -2
- package/dist/_dts/{client-D6T430bk.d.ts → client-B_B_amKD.d.ts} +2 -1
- package/dist/_dts/{content-types-wZVWccC6.d.ts → content-types-Dhx5Ocvx.d.ts} +9 -16
- package/dist/_dts/{contracts-B-vtOcr8.d.ts → contracts-FeOnfoa1.d.ts} +3 -3
- package/dist/_dts/{generatePageMetadata-CxfwHE6z.d.ts → generatePageMetadata-m70J6tit.d.ts} +2 -2
- package/dist/_dts/{index-CEyYMhLJ.d.ts → index-BOpUh8kO.d.ts} +1 -1
- package/dist/_dts/{index-DIU-wL1M.d.ts → index-Bizdaxji.d.ts} +2 -2
- package/dist/_dts/{index-Cqxis-nv.d.ts → index-BxCmCit0.d.ts} +1 -1
- package/dist/_dts/{index-CQrb3Ccc.d.ts → index-CjAkEWAp.d.ts} +4 -4
- package/dist/_dts/{index-DqPKdeTk.d.ts → index-iuFrbIjt.d.ts} +1 -1
- package/dist/_dts/{index-CciRW_w1.d.ts → index-liuhlOX7.d.ts} +2 -2
- package/dist/_dts/{loadContent-D0wrxiSp.d.ts → loadContent-D4wrTIIw.d.ts} +7 -7
- package/dist/_dts/{request-DEwxUSw8.d.ts → request-Gn0O1blj.d.ts} +24912 -23733
- package/dist/_dts/{resolveBlockData-VaG_MYbN.d.ts → resolveBlockData-D5duwuqS.d.ts} +5 -5
- package/dist/_dts/{resolvePageContent-DTwklC_v.d.ts → resolvePageContent-xzJ3c9Na.d.ts} +1 -1
- 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 +7 -7
- package/dist/_dts/sdk/src/config/index.d.ts +7 -7
- 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 +2 -2
- package/dist/_dts/sdk/src/gifting/client.d.ts +1 -1
- package/dist/_dts/sdk/src/index.d.ts +8 -8
- package/dist/_dts/sdk/src/manifest/index.d.ts +3 -3
- package/dist/_dts/sdk/src/metadata/index.d.ts +1 -1
- package/dist/_dts/sdk/src/navigation/index.d.ts +3 -3
- package/dist/_dts/sdk/src/next/index.d.ts +7 -7
- package/dist/_dts/sdk/src/next/middleware.d.ts +2 -2
- package/dist/_dts/sdk/src/page-converter/index.d.ts +3 -3
- package/dist/_dts/sdk/src/portal/client.d.ts +1 -1
- package/dist/_dts/sdk/src/portal/index.d.ts +1 -1
- package/dist/_dts/sdk/src/prebuild/index.d.ts +1 -1
- package/dist/_dts/sdk/src/preview-next/before-render.d.ts +2 -2
- package/dist/_dts/sdk/src/preview-next/client/index.d.ts +2 -2
- package/dist/_dts/sdk/src/preview-next/client/runtime.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/client.d.ts +2 -2
- package/dist/_dts/sdk/src/rendering/components/pageShared.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/helpers/loadPage.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/helpers/pageRuntimeSupport.d.ts +4 -4
- package/dist/_dts/sdk/src/rendering/index.d.ts +6 -6
- package/dist/_dts/sdk/src/rendering/islands/client.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/server.d.ts +2 -2
- package/dist/_dts/sdk/src/rendering/themeAdmission.d.ts +1 -1
- package/dist/_dts/sdk/src/routing/index.d.ts +6 -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 +91 -2
- package/dist/_dts/{serviceBookingOutline-DtQuFlID.d.ts → serviceBookingOutline-B1gyJon_.d.ts} +7 -7
- package/dist/_dts/{types-B3RjeBLV.d.ts → types-BoITy0rA.d.ts} +41 -4
- package/dist/_dts/{types-BvUSGQrw.d.ts → types-DBNuMtSk.d.ts} +16 -5
- package/dist/_dts/{types-CkRFtBqd.d.ts → types-DHMcuoeQ.d.ts} +7 -7
- package/dist/_dts/{validation-BZA3DhcV.d.ts → validation-BIPO-XlE.d.ts} +4 -4
- package/dist/client/{BlocksIslandsHydrator-CQMf0HdN.mjs → BlocksIslandsHydrator-Ct8slgRk.mjs} +22 -18
- package/dist/client/{BookingMailingListNote-7kdvuPow.mjs → BookingMailingListNote-qqTxGGS4.mjs} +7 -7
- package/dist/client/{BookingQuestionFields-BJI7mZuV.mjs → BookingQuestionFields-DCh9MUIF.mjs} +2 -2
- package/dist/client/{CalendarAction-D_Glwvz2.mjs → CalendarAction-RcdaStG7.mjs} +1 -1
- package/dist/client/{CalendarNavigationChevron-DPUD6wjy.mjs → CalendarNavigationChevron-D7Wt-Oaa.mjs} +25 -8
- package/dist/client/{CheckboxChoice-C8i4NraK.mjs → CheckboxChoice-BdGxZWeg.mjs} +1 -1
- package/dist/client/{DemoBookingPortalAccess-8kwNF9HN.mjs → DemoBookingPortalAccess-HFVkoOac.mjs} +5 -5
- package/dist/client/{EventCalendar.client-Dhb14bcC.mjs → EventCalendar.client-BtkJW8bA.mjs} +10 -10
- package/dist/client/{EventCombined.client-C1jEZBN9.mjs → EventCombined.client-DxaGjFFS.mjs} +9 -9
- package/dist/client/{EventEmbeddedCheckoutStep-BGkbUhuw.mjs → EventEmbeddedCheckoutStep-B2c5dR49.mjs} +1 -1
- package/dist/client/{EventItem-Bb0ppG2N.mjs → EventItem-Fr2qi2C2.mjs} +29 -14
- package/dist/client/{EventListWeekNavigation-DMryCaNV.mjs → EventListWeekNavigation-BRMaq0ky.mjs} +1 -1
- package/dist/client/{EventListing.client-BuH5kKA3.mjs → EventListing.client-BhGxfbjt.mjs} +3 -3
- package/dist/client/{EventListing.view-DsqvuulZ.mjs → EventListing.view-COuEJzbO.mjs} +6 -6
- package/dist/client/{EventRegistrationPayment-D4FvQSFF.mjs → EventRegistrationPayment-BTLYhVxD.mjs} +21 -42
- package/dist/client/{Page-sV6BJkXX.mjs → Page-CgbQZP5g.mjs} +2786 -927
- package/dist/client/{ProtectedSubmitButton-BNnKuir8.mjs → ProtectedSubmitButton-BG7my0Qf.mjs} +1 -1
- package/dist/client/{SiteTermsAgreementField-VfSd6JU-.mjs → SiteTermsAgreementField-DQNkfNLA.mjs} +3 -3
- package/dist/client/{StepIndicator-B6o5B7g3.mjs → StepIndicator-DvPekKeM.mjs} +1 -1
- package/dist/client/{StepIndicator-BTqO7cJl.mjs → StepIndicator-DyXoI3ob.mjs} +7 -7
- package/dist/client/{ThemedButton-PFOhXktM.mjs → ThemedButton-Bc9DBbVp.mjs} +42 -9
- package/dist/client/{accessibleSurfaces-BogaGutk.mjs → accessibleSurfaces-wj4Rloo5.mjs} +336 -119
- package/dist/client/{accordion-6cuswD_s.mjs → accordion-BVXfjnh-.mjs} +1 -1
- package/dist/client/{booking-form.client-BOMe_SKi.mjs → booking-form.client-DycPGtke.mjs} +191 -71
- package/dist/client/{bookingForm-DSCH-VHo.mjs → bookingForm-DrWSUqL3.mjs} +4 -4
- package/dist/client/bookings.mjs +5 -5
- package/dist/client/{boxStyleClassNames-BFuqZCfz.mjs → boxStyleClassNames-CduDRcIk.mjs} +2 -2
- package/dist/client/buttonParts-CJEtVOUy.mjs +1511 -0
- package/dist/client/{carousel-CGyQVV1M.mjs → carousel-DyCLMP8s.mjs} +2 -2
- package/dist/client/{carousel.client-BtLwHefX.mjs → carousel.client-DffP_Nv0.mjs} +1 -1
- package/dist/client/{cart-BYOe7MCh.mjs → cart-BuEp_cj4.mjs} +3 -3
- package/dist/client/{cart.client-BKFkaXdV.mjs → cart.client-CAO39uDG.mjs} +1 -1
- package/dist/client/{checkout-Dwd7Di77.mjs → checkout-BoxzT64s.mjs} +3 -3
- package/dist/client/{checkout.client-C25hpi-z.mjs → checkout.client-IGUy7XOx.mjs} +1 -1
- package/dist/client/{checkoutUrls-tG788sw0.mjs → checkoutUrls-D0UsiFmm.mjs} +1 -1
- package/dist/client/client.mjs +446 -93
- package/dist/client/{constants-DdxFG3Ic.mjs → constants-C_8AxMdm.mjs} +1 -1
- package/dist/client/{context-Hi1RuYEM.mjs → context-D1L0pe__.mjs} +2 -2
- package/dist/client/{dateFormatting-C8vBCHuo.mjs → dateFormatting-HvfmS_cH.mjs} +1 -1
- package/dist/client/{demoPortalMagicLink-BAL5UIDG.mjs → demoPortalMagicLink-BunFTnIq.mjs} +1 -1
- package/dist/client/{enhanceHeaderSection-Dv1Lr9kJ.mjs → enhanceHeaderSection-CtLAG651.mjs} +4 -4
- package/dist/client/{event-registration.client-dB_Z7bb-.mjs → event-registration.client-DiSxkBUP.mjs} +15 -15
- package/dist/client/{eventCalendar-CQnRA4Ww.mjs → eventCalendar-DUnhwZ1o.mjs} +4 -4
- package/dist/client/{eventCombined-BDOG1hVp.mjs → eventCombined-BvBQo0nF.mjs} +4 -4
- package/dist/client/{eventListing-DSVmhy9n.mjs → eventListing-aTLifOX7.mjs} +4 -4
- package/dist/client/{eventRegistration-CD5mRtEH.mjs → eventRegistration-DFd7pr09.mjs} +4 -4
- package/dist/client/{form-DWnlEVSK.mjs → form-Dikmc2AO.mjs} +3 -3
- package/dist/client/{form.client-D7zmeqNI.mjs → form.client-zHaQK5I9.mjs} +5 -5
- package/dist/client/{form.parts-C-G6N_MK.mjs → form.parts-BLl9n8TH.mjs} +3 -3
- package/dist/client/gifting/client.mjs +16 -9
- package/dist/client/{gifting-Cn0jidP5.mjs → gifting-CufPM38H.mjs} +4 -4
- package/dist/client/{gifting.client-DVo1YFLs.mjs → gifting.client--N1GaSY8.mjs} +155 -84
- package/dist/client/gifting.interactive-D9MK4HkV.mjs +157 -0
- package/dist/client/gifting.parts-CRtiRzo-.mjs +119 -0
- package/dist/client/{headerSection-DjQuj_6v.mjs → headerSection-BIaBpmk3.mjs} +2 -2
- package/dist/client/{noop-jesvJXEE.mjs → islands-DJDLGQEm.mjs} +14007 -6685
- package/dist/client/{newsletter-form.client-rIYPziZC.mjs → newsletter-form.client-wg_JHTxm.mjs} +6 -6
- package/dist/client/{newsletter-form.interactive-DVt3enLr.mjs → newsletter-form.interactive-hzpkW9NQ.mjs} +226 -195
- package/dist/client/{newsletter-form.parts-CH6dGfdn.mjs → newsletter-form.parts-CgzpSv9p.mjs} +2 -2
- package/dist/client/{newsletterForm-Cg8cBDHd.mjs → newsletterForm-CvxLiEBT.mjs} +3 -3
- package/dist/client/portal/client.mjs +31 -27
- package/dist/client/{portalOrders-oEoTvzkW.mjs → portalOrders-tCxS04g0.mjs} +3 -2
- package/dist/client/{portalRoutes-ByyVZfVq.mjs → portalRoutes-DTHlWg_F.mjs} +22 -7
- package/dist/client/{product-detail.client-5aHq-vuu.mjs → product-detail.client-22Q7zgjN.mjs} +1 -1
- package/dist/client/{product-list.client-CyAk5rnC.mjs → product-list.client-DFWYvK8z.mjs} +1 -1
- package/dist/client/{productDetail-B8aZ2mqY.mjs → productDetail-DhZAwo60.mjs} +3 -3
- package/dist/client/{productList-BuLemmod.mjs → productList-BiVpbZK2.mjs} +3 -3
- package/dist/client/{propsDecoder-0Unsqn3R.mjs → propsDecoder-DFYqKnLy.mjs} +4 -2
- package/dist/client/{registry.server-DzvtVVD0.mjs → registry.server-C3OBRg7x.mjs} +2027 -781
- package/dist/client/rendering/client.mjs +29 -26
- package/dist/client/rendering/islands.mjs +1 -1
- package/dist/client/rendering.mjs +5 -5
- package/dist/client/{richText-coerce-Bnng7JFA.mjs → richText-coerce-ms477Z08.mjs} +2 -2
- package/dist/client/{routeIslandApiConfig-BGfcc9sk.mjs → routeIslandApiConfig-B6nQeqvH.mjs} +1 -1
- package/dist/client/{runtimeResponse-DAPVRToN.mjs → runtimeResponse-BYqsV1Kb.mjs} +1 -1
- package/dist/client/runtimeResponse-CUX_lldL.mjs +3 -0
- package/dist/client/{shop-commerce-D5bDY1o1.mjs → shop-commerce-DVsIcPaI.mjs} +16 -15
- package/dist/client/{shop-commerce-store-B7sHnLwI.mjs → shop-commerce-store-7mO6KY7_.mjs} +1 -1
- package/dist/client/{shop-discount-apply.state-Dos2zdC2.mjs → shop-discount-apply.state-L1Vge8tG.mjs} +2 -2
- package/dist/client/{shop-GuMqnDL-.mjs → shop-xt4dQ3HH.mjs} +3 -3
- package/dist/client/{shop.client-uvj5GDZb.mjs → shop.client-DNJfD3VQ.mjs} +28 -17
- package/dist/client/{shopShared-3giNWE3H.mjs → shopShared-DS8t6749.mjs} +2 -2
- package/dist/client/spam-protection.mjs +1 -1
- package/dist/client/{src-CmXh3JWs.mjs → src-Do_s2lqH.mjs} +11 -18
- package/dist/client/{timetableModel-GA-hn1qM.mjs → timetableModel-Dy3nNfTG.mjs} +11 -8
- package/dist/client/{useAvailableSlots-CBneCxbG.mjs → useAvailableSlots-DcjtDpUu.mjs} +2 -2
- package/dist/client/{useDiscountCodeUi-D0kGF0C7.mjs → useDiscountCodeUi-DvdFFWOT.mjs} +1 -1
- package/dist/client/{useEventPagination-xX8n_Tuu.mjs → useEventPagination-Cq-7sU5_.mjs} +8 -8
- package/dist/client/{view-DOyZc-DF.mjs → view-4gnPcpWJ.mjs} +24 -9
- package/dist/client/{wizardSteps-B952ify5.mjs → wizardSteps-DDvL3iza.mjs} +76 -159
- package/dist/preview-next/client/{EventEmbeddedCheckoutStep-aRJjq4x8.mjs → EventEmbeddedCheckoutStep-CLqSRUpt.mjs} +1 -1
- package/dist/preview-next/client/{LocationPickerEnvironment-BW3dRFIv.mjs → LocationPickerEnvironment-CIdAg-Tm.mjs} +1 -1
- package/dist/preview-next/client/{MapLibreEditMap-Db9BHyXh.mjs → MapLibreEditMap-Bm85jX35.mjs} +2 -2
- package/dist/preview-next/client/{PageSectionToolbar-BI3UCdpu.mjs → PageSectionToolbar-D8srnz9R.mjs} +445 -18
- package/dist/preview-next/client/{PreviewEditorSidebar-jkfLVOgY.mjs → PreviewEditorSidebar-DVpk5cqp.mjs} +3864 -1943
- package/dist/preview-next/client/{PreviewEditorUI-DwJQs4hM.mjs → PreviewEditorUI-XoTtHSFH.mjs} +11 -36
- package/dist/preview-next/client/{PreviewShell-BAxAkuz8.mjs → PreviewShell-VQHsRg2u.mjs} +40 -35
- package/dist/preview-next/client/{SdkPreviewModeRuntime-0UVB-39f.mjs → SdkPreviewModeRuntime-CLdF9f6o.mjs} +12 -8
- package/dist/preview-next/client/{ThemedButton-CVYz7h68.mjs → ThemedButton-ORNN4x-3.mjs} +782 -16
- package/dist/preview-next/client/{lucide-react-00FF_oar.mjs → lucide-react-eAi3tDAr.mjs} +11 -1
- package/dist/preview-next/client/{previewAssistantSlot-BgiYk3PB.mjs → previewAssistantSlot-CqH91EwA.mjs} +17988 -6757
- package/dist/preview-next/client/{previewChromeRoot-tieNdF3E.mjs → previewChromeRoot-B3ySEu6p.mjs} +3 -90
- package/dist/preview-next/client/runtime.mjs +3 -3
- package/dist/preview-next/client/{sdk-runtime-DXb_Evl0.mjs → sdk-runtime-CdpSupcr.mjs} +2 -2
- package/dist/preview-next/client/{siteStyleAccess-BlN0jt2c.mjs → siteStyleAccess-C6eOP6QW.mjs} +35 -6
- package/dist/preview-next/client/{useAutosaveStatus-BUEPA4oL.mjs → useAutosaveStatus-BhPg4e-r.mjs} +49 -3
- package/dist/preview-next/client/{useOpenBlockForSetup-BVfr5P--.mjs → useOpenBlockForSetup-BaWUF9D7.mjs} +2007 -448
- package/dist/preview-next/container-responsive.css +320 -0
- package/dist/preview-next/editor-chrome.css +23 -2
- package/dist/preview-next/keepAlive.mjs +1 -1
- package/dist/preview-next/middleware.mjs +1 -1
- package/dist/preview-next/{route-contract-BHTBA48n.mjs → route-contract-Ch0X99vE.mjs} +163 -17
- package/dist/server/{Block.shared-hGoyEdjJ.mjs → Block.shared-B2FmczLO.mjs} +5 -5
- package/dist/server/{ThemeScopeCore-BfUCTOwj.mjs → ThemeScopeCore-DtAyv9qA.mjs} +17 -7
- package/dist/server/{accessibleSurfaces-Dskni4Xj.mjs → accessibleSurfaces-BtPqb76u.mjs} +418 -31
- package/dist/server/{accordions-By_0Ykks.mjs → accordions-vzdZ2Wt1.mjs} +1 -1
- package/dist/server/{bindings-DMJH4bvo.mjs → bindings-B_9JuU66.mjs} +7 -7
- package/dist/server/{client-DrwlRNAH.mjs → client-DC7cjiSw.mjs} +469 -92
- package/dist/server/config-validation.mjs +1 -1
- package/dist/server/config.mjs +2 -2
- package/dist/server/{constants-CeMywaiD.mjs → constants-d6nPNJpe.mjs} +22 -6
- package/dist/server/{customCss-C9kgPHvr.mjs → customCss-rtIfEYwQ.mjs} +1 -18
- package/dist/server/data/resolveBlockData.mjs +1 -1
- package/dist/server/{expandPalette-ehuW8r2g.mjs → expandPalette-DxPrNOAB.mjs} +182 -90
- package/dist/server/index.mjs +3 -3
- package/dist/server/{loadContent-D0prFflT.mjs → loadContent-hb27HYic.mjs} +11 -10
- package/dist/server/{loadPage-CBLke9pJ.mjs → loadPage-JToD8wDD.mjs} +3 -3
- package/dist/server/{lookMediaFrame-H0fi4bJk.mjs → lookMediaFrame-CTsycLLK.mjs} +94 -39
- package/dist/server/manifest.mjs +2 -2
- package/dist/server/{navigation-wrcuWmgp.mjs → navigation-B2WhGofA.mjs} +1 -1
- package/dist/server/navigation.mjs +1 -1
- package/dist/server/next.mjs +8 -8
- package/dist/server/{overrideResolution-DUgCEH8z.mjs → overrideResolution-vD5KTClL.mjs} +1 -1
- package/dist/server/page-converter.mjs +3 -3
- package/dist/server/{pageRenderPlan-BHrmogsW.mjs → pageRenderPlan-CdqJ1NQZ.mjs} +86 -97
- package/dist/server/{pageRuntimeSupport-D2-YMRei.mjs → pageRuntimeSupport-CAhr4oOf.mjs} +3 -3
- package/dist/server/{pageShared-CG8O31Eo.mjs → pageShared-m80Xu2pd.mjs} +429 -247
- package/dist/server/{parseThemeForPersistence-CrPlbJEN.mjs → parseThemeForPersistence-CRwOZfpa.mjs} +3 -3
- package/dist/server/{portal-pG_uhsI2.mjs → portal-B2wCQno_.mjs} +1 -1
- package/dist/server/portal.mjs +2 -2
- package/dist/server/{prebuild-C8Amvzce.mjs → prebuild-BWIkFaXq.mjs} +1 -1
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/{prefetchBlockData-BxUETRIZ.mjs → prefetchBlockData-D1PHU-K9.mjs} +3 -3
- package/dist/server/{registry-Cc88-23f.mjs → registry-KtsOsAzY.mjs} +20113 -9774
- 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 +4 -4
- package/dist/server/rendering.mjs +9 -9
- package/dist/server/{resolveBlockData-OG3KOkig.mjs → resolveBlockData-sjIDJYl7.mjs} +1 -1
- package/dist/server/{schema-CwfxQjc4.mjs → schema-BBEqquBM.mjs} +44 -28
- package/dist/server/server.mjs +3 -3
- package/dist/server/{servicePageContent-BcFuhhD7.mjs → servicePageContent-ChEZDRwU.mjs} +37 -14
- package/dist/server/theme-bridge.mjs +3 -3
- package/dist/server/theme.mjs +2 -2
- package/dist/server/{three-pass-converter-DPaUPTfl.mjs → three-pass-converter-DKCIBeb1.mjs} +2 -2
- package/dist/server/{titleSourceSchema-NhK6azFS.mjs → titleSourceSchema-DybHErxH.mjs} +4 -4
- package/dist/server/{typeGuards-CTW_9AXq.mjs → typeGuards-DZOaGTEv.mjs} +126 -126
- package/dist/server/{types-BKaBZFjD.mjs → types-vyz09w64.mjs} +479 -8
- package/dist/server/{validation-BovmbS8N.mjs → validation-Cvi-1TZZ.mjs} +13 -9
- package/dist/server/{version-hws4hgyX.mjs → version-B-icAIV1.mjs} +1 -1
- package/dist/server/{video-Cdr3wh-q.mjs → video-DBaeSawZ.mjs} +1 -1
- package/dist/styles/index.css +2482 -108
- package/package.json +1 -1
- package/dist/client/gifting.parts-Bak93gD2.mjs +0 -86
- package/dist/client/runtimeResponse-nXT8VAMl.mjs +0 -3
- package/dist/client/types-BEaKfam_.mjs +0 -778
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import { i as useSiteTermsAgreement, n as SiteTermsChangedNotice, t as SiteTermsAgreementField } from "./SiteTermsAgreementField-
|
|
4
|
-
import { n as useBlockApi } from "./context-
|
|
5
|
-
import { n as ThemedButton } from "./ThemedButton-
|
|
2
|
+
import { t as assertNever } from "./src-Do_s2lqH.mjs";
|
|
3
|
+
import { i as useSiteTermsAgreement, n as SiteTermsChangedNotice, t as SiteTermsAgreementField } from "./SiteTermsAgreementField-DQNkfNLA.mjs";
|
|
4
|
+
import { n as useBlockApi } from "./context-D1L0pe__.mjs";
|
|
5
|
+
import { n as ThemedButton } from "./ThemedButton-Bc9DBbVp.mjs";
|
|
6
|
+
import { t as buildGiftingDisplay } from "./gifting.interactive-D9MK4HkV.mjs";
|
|
6
7
|
import { t as FeedbackMessage } from "./FeedbackMessage-CSJrAuXH.mjs";
|
|
7
|
-
import { a as
|
|
8
|
-
import { startTransition, useEffect, useReducer, useRef, useState } from "react";
|
|
8
|
+
import { a as firstGiftAmountChoice, i as GiftingPanelHead, n as GiftCardAmounts, o as formatGiftAmount, r as GiftGroup, s as giftingSlot } from "./gifting.parts-CRtiRzo-.mjs";
|
|
9
|
+
import React, { startTransition, useEffect, useReducer, useRef, useState } from "react";
|
|
9
10
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
10
11
|
//#region ../blocks/src/system/runtime/nodes/gifting.client.state.ts
|
|
11
12
|
function createInitialGiftingClientState(initialOffers) {
|
|
@@ -50,16 +51,20 @@ function giftingClientReducer(state, action) {
|
|
|
50
51
|
default: return assertNever(action);
|
|
51
52
|
}
|
|
52
53
|
}
|
|
53
|
-
function resolveGiftingPurchaseNotice(search, defaultSuccessMessage) {
|
|
54
|
-
|
|
54
|
+
function resolveGiftingPurchaseNotice(search, defaultSuccessMessage, today = /* @__PURE__ */ new Date()) {
|
|
55
|
+
const params = new URLSearchParams(search);
|
|
56
|
+
switch (params.get("gifting")) {
|
|
55
57
|
case null: return null;
|
|
56
|
-
case "success":
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
case "success": {
|
|
59
|
+
const day = formatSendOnDay(params.get("gift_send_on"), today);
|
|
60
|
+
return {
|
|
61
|
+
kind: "success",
|
|
62
|
+
message: day ? `Thanks, that's all paid for. We'll email the gift to them on ${day}.` : defaultSuccessMessage
|
|
63
|
+
};
|
|
64
|
+
}
|
|
60
65
|
case "cancelled": return {
|
|
61
66
|
kind: "cancelled",
|
|
62
|
-
message: "
|
|
67
|
+
message: "You didn't finish paying, so nothing's been charged. You can try again whenever you're ready."
|
|
63
68
|
};
|
|
64
69
|
default: return null;
|
|
65
70
|
}
|
|
@@ -69,16 +74,16 @@ function toGiftingControllerProps(props) {
|
|
|
69
74
|
className: props.render.display.className,
|
|
70
75
|
heading: props.render.display.heading,
|
|
71
76
|
intro: props.render.display.intro,
|
|
72
|
-
giftCardsHeading: props.render.display.giftCardsHeading,
|
|
73
|
-
vouchersHeading: props.render.display.vouchersHeading,
|
|
74
77
|
emptyStateText: props.render.display.emptyStateText,
|
|
75
78
|
checkoutButtonText: props.render.hydration.checkoutButtonText,
|
|
76
79
|
successMessage: props.render.hydration.successMessage
|
|
77
80
|
};
|
|
78
81
|
}
|
|
79
|
-
function buildGiftingCheckoutReturnUrl(currentHref, kind) {
|
|
82
|
+
function buildGiftingCheckoutReturnUrl(currentHref, kind, sendOnDate = null) {
|
|
80
83
|
const url = new URL(currentHref);
|
|
81
84
|
url.searchParams.set("gifting", kind);
|
|
85
|
+
if (kind === "success" && sendOnDate) url.searchParams.set("gift_send_on", sendOnDate);
|
|
86
|
+
else url.searchParams.delete("gift_send_on");
|
|
82
87
|
return url.toString();
|
|
83
88
|
}
|
|
84
89
|
function hasPublicGiftingOffers(offers) {
|
|
@@ -113,10 +118,29 @@ function giftingSubmission(previous, fields, createToken) {
|
|
|
113
118
|
token: createToken()
|
|
114
119
|
};
|
|
115
120
|
}
|
|
121
|
+
/** Calendar dates are constructed and compared locally, without parsing an ISO instant. */
|
|
122
|
+
function formatSendOnDay(isoDate, today) {
|
|
123
|
+
if (!isoDate || !/^\d{4}-\d{2}-\d{2}$/.test(isoDate)) return null;
|
|
124
|
+
const [year = 0, month = 0, day = 0] = isoDate.split("-").map(Number);
|
|
125
|
+
const date = new Date(year, month - 1, day);
|
|
126
|
+
if (date.getFullYear() !== year || date.getMonth() !== month - 1 || date.getDate() !== day || date < new Date(today.getFullYear(), today.getMonth(), today.getDate())) return null;
|
|
127
|
+
return new Intl.DateTimeFormat("en-GB", {
|
|
128
|
+
weekday: "long",
|
|
129
|
+
day: "numeric",
|
|
130
|
+
month: "long"
|
|
131
|
+
}).format(date);
|
|
132
|
+
}
|
|
133
|
+
function giftingReturnUrlWithoutNotice(currentHref) {
|
|
134
|
+
const url = new URL(currentHref);
|
|
135
|
+
url.searchParams.delete("gifting");
|
|
136
|
+
url.searchParams.delete("gift_send_on");
|
|
137
|
+
return url.toString();
|
|
138
|
+
}
|
|
116
139
|
//#endregion
|
|
117
140
|
//#region ../blocks/src/system/runtime/nodes/gifting.client.tsx
|
|
118
141
|
function GiftingClient(props) {
|
|
119
142
|
const api = useBlockApi();
|
|
143
|
+
const noticeRef = useRef(null);
|
|
120
144
|
const siteTerms = useSiteTermsAgreement({
|
|
121
145
|
terms: props.render.hydration.siteTerms,
|
|
122
146
|
context: { kind: "purchase" }
|
|
@@ -124,11 +148,18 @@ function GiftingClient(props) {
|
|
|
124
148
|
const controller = toGiftingControllerProps(props);
|
|
125
149
|
const [state, dispatch] = useReducer(giftingClientReducer, props.render.hydration.offers, createInitialGiftingClientState);
|
|
126
150
|
useEffect(() => {
|
|
151
|
+
const notice = resolveGiftingPurchaseNotice(window.location.search, props.render.hydration.successMessage);
|
|
127
152
|
dispatch({
|
|
128
153
|
type: "purchaseNoticeResolved",
|
|
129
|
-
notice
|
|
154
|
+
notice
|
|
130
155
|
});
|
|
156
|
+
if (notice) window.history.replaceState(window.history.state, "", giftingReturnUrlWithoutNotice(window.location.href));
|
|
131
157
|
}, [props.render.hydration.successMessage]);
|
|
158
|
+
useEffect(() => {
|
|
159
|
+
if (!state.purchaseNotice) return;
|
|
160
|
+
noticeRef.current?.scrollIntoView({ block: "center" });
|
|
161
|
+
noticeRef.current?.focus({ preventScroll: true });
|
|
162
|
+
}, [state.purchaseNotice]);
|
|
132
163
|
useEffect(() => {
|
|
133
164
|
if (state.offers) return;
|
|
134
165
|
let cancelled = false;
|
|
@@ -161,6 +192,7 @@ function GiftingClient(props) {
|
|
|
161
192
|
event.preventDefault();
|
|
162
193
|
if (!siteTerms.requireAgreement("commerce")) return;
|
|
163
194
|
const formData = new FormData(event.currentTarget);
|
|
195
|
+
const sendOnDate = formData.get("sendOnDate");
|
|
164
196
|
const fields = JSON.stringify([...formData.entries()]);
|
|
165
197
|
const submission = giftingSubmission(state.submissions.get(offerId), fields, () => crypto.randomUUID());
|
|
166
198
|
dispatch({
|
|
@@ -173,10 +205,10 @@ function GiftingClient(props) {
|
|
|
173
205
|
offerId,
|
|
174
206
|
purchaseToken: submission.token,
|
|
175
207
|
kind,
|
|
176
|
-
successUrl: buildGiftingCheckoutReturnUrl(window.location.href, "success"),
|
|
208
|
+
successUrl: buildGiftingCheckoutReturnUrl(window.location.href, "success", typeof sendOnDate === "string" ? sendOnDate : null),
|
|
177
209
|
cancelUrl: buildGiftingCheckoutReturnUrl(window.location.href, "cancelled")
|
|
178
210
|
}));
|
|
179
|
-
window.location.
|
|
211
|
+
window.location.assign(checkout.checkoutUrl);
|
|
180
212
|
} catch (error) {
|
|
181
213
|
dispatch({
|
|
182
214
|
type: "checkoutFailed",
|
|
@@ -188,73 +220,81 @@ function GiftingClient(props) {
|
|
|
188
220
|
const currency = offers?.currency ?? "GBP";
|
|
189
221
|
const giftCards = offers?.giftCards ?? [];
|
|
190
222
|
const vouchers = offers?.vouchers ?? [];
|
|
191
|
-
const
|
|
192
|
-
|
|
193
|
-
|
|
223
|
+
const look = state.offers === props.render.hydration.offers ? props.render.display : buildGiftingDisplay({
|
|
224
|
+
...props.render.display,
|
|
225
|
+
...props.render.hydration.groupHeadings,
|
|
226
|
+
offers: state.offers
|
|
194
227
|
});
|
|
195
|
-
const look = props.render.display;
|
|
196
228
|
const purchaseFields = (offerId) => /* @__PURE__ */ jsx(GiftingPurchaseFields, {
|
|
197
229
|
siteTerms,
|
|
198
230
|
submitting: state.submittingOfferId === offerId,
|
|
199
|
-
buttonText: controller.checkoutButtonText ?? "Continue"
|
|
231
|
+
buttonText: controller.checkoutButtonText ?? "Continue to payment"
|
|
200
232
|
});
|
|
201
233
|
return /* @__PURE__ */ jsx("section", {
|
|
202
234
|
className: controller.className ?? void 0,
|
|
203
235
|
"data-block": "gifting",
|
|
204
236
|
children: /* @__PURE__ */ jsxs("div", {
|
|
205
|
-
className: "gifting
|
|
206
|
-
...
|
|
207
|
-
children: [
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
look,
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
237
|
+
className: "gifting",
|
|
238
|
+
...look.lookSlots ? { "data-slot": "layout" } : {},
|
|
239
|
+
children: [/* @__PURE__ */ jsx(GiftingPanelHead, {
|
|
240
|
+
heading: look.heading,
|
|
241
|
+
intro: look.intro,
|
|
242
|
+
look
|
|
243
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
244
|
+
className: "gifting-main",
|
|
245
|
+
children: [
|
|
246
|
+
state.purchaseNotice ? /* @__PURE__ */ jsx("div", {
|
|
247
|
+
ref: noticeRef,
|
|
248
|
+
tabIndex: -1,
|
|
249
|
+
className: "gifting-notice",
|
|
250
|
+
children: /* @__PURE__ */ jsx(FeedbackMessage, {
|
|
251
|
+
tone: state.purchaseNotice.kind === "success" ? "success" : "warning",
|
|
252
|
+
className: "gifting-feedback",
|
|
253
|
+
role: "status",
|
|
254
|
+
children: state.purchaseNotice.message
|
|
255
|
+
})
|
|
256
|
+
}) : null,
|
|
257
|
+
state.errorMessage ? /* @__PURE__ */ jsx(FeedbackMessage, {
|
|
258
|
+
tone: "error",
|
|
259
|
+
className: "gifting-feedback",
|
|
260
|
+
role: "alert",
|
|
261
|
+
children: state.errorMessage
|
|
262
|
+
}) : null,
|
|
263
|
+
/* @__PURE__ */ jsx(SiteTermsChangedNotice, { message: siteTerms.notice }),
|
|
264
|
+
hasOffers ? /* @__PURE__ */ jsx("div", {
|
|
265
|
+
className: "gifting-groups",
|
|
266
|
+
"data-group-count": look.groups.length,
|
|
267
|
+
children: look.groups.map((group) => /* @__PURE__ */ jsx(GiftGroup, {
|
|
268
|
+
group,
|
|
269
|
+
look,
|
|
270
|
+
children: group.kind === "gift_card" ? giftCards.map((offer) => /* @__PURE__ */ jsx(GiftCardOfferForm, {
|
|
271
|
+
offer,
|
|
272
|
+
currency,
|
|
273
|
+
showTitle: giftCards.length > 1,
|
|
274
|
+
initialAmount: props.chosenAmounts?.[offer.id],
|
|
275
|
+
look,
|
|
276
|
+
onSubmit: (event) => void handleSubmit(event, offer.id, "gift_card"),
|
|
277
|
+
fields: purchaseFields(offer.id)
|
|
278
|
+
}, offer.id)) : /* @__PURE__ */ jsx("ul", {
|
|
279
|
+
className: "gifting-voucher-list",
|
|
280
|
+
children: vouchers.map((offer) => /* @__PURE__ */ jsx("li", {
|
|
281
|
+
className: "gifting-voucher",
|
|
282
|
+
children: /* @__PURE__ */ jsx(VoucherOfferForm, {
|
|
283
|
+
offer,
|
|
284
|
+
currency,
|
|
285
|
+
look,
|
|
286
|
+
onSubmit: (event) => void handleSubmit(event, offer.id, "voucher"),
|
|
287
|
+
fields: purchaseFields(offer.id)
|
|
288
|
+
})
|
|
289
|
+
}, offer.id))
|
|
290
|
+
})
|
|
291
|
+
}, group.kind))
|
|
292
|
+
}) : /* @__PURE__ */ jsx("p", {
|
|
293
|
+
className: "gifting-empty",
|
|
294
|
+
children: look.emptyStateText
|
|
295
|
+
})
|
|
296
|
+
]
|
|
297
|
+
})]
|
|
258
298
|
})
|
|
259
299
|
});
|
|
260
300
|
}
|
|
@@ -274,7 +314,7 @@ function GiftCardOfferForm(props) {
|
|
|
274
314
|
look: props.look
|
|
275
315
|
}),
|
|
276
316
|
extraFields: amountChoice === "custom" ? /* @__PURE__ */ jsx(CustomGiftAmount, { offer }) : null,
|
|
277
|
-
children: [props.showTitle ? /* @__PURE__ */ jsx("
|
|
317
|
+
children: [props.showTitle ? /* @__PURE__ */ jsx("h4", {
|
|
278
318
|
className: "gifting-offer-title",
|
|
279
319
|
children: offer.title
|
|
280
320
|
}) : null, offer.description ? /* @__PURE__ */ jsx("p", {
|
|
@@ -283,6 +323,28 @@ function GiftCardOfferForm(props) {
|
|
|
283
323
|
}) : null]
|
|
284
324
|
});
|
|
285
325
|
}
|
|
326
|
+
function VoucherOfferForm(props) {
|
|
327
|
+
return /* @__PURE__ */ jsxs(RevealingOfferForm, {
|
|
328
|
+
buyLabel: "Buy this voucher",
|
|
329
|
+
variant: "secondary",
|
|
330
|
+
look: props.look,
|
|
331
|
+
onSubmit: props.onSubmit,
|
|
332
|
+
fields: props.fields,
|
|
333
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
334
|
+
className: "gifting-offer-summary",
|
|
335
|
+
children: [/* @__PURE__ */ jsx("h4", {
|
|
336
|
+
className: "gifting-offer-title",
|
|
337
|
+
children: props.offer.title
|
|
338
|
+
}), /* @__PURE__ */ jsx("strong", {
|
|
339
|
+
className: "gifting-offer-price",
|
|
340
|
+
children: formatGiftAmount(props.offer.voucher.purchaseAmountCents, props.currency)
|
|
341
|
+
})]
|
|
342
|
+
}), props.offer.description ? /* @__PURE__ */ jsx("p", {
|
|
343
|
+
className: "gifting-offer-description",
|
|
344
|
+
children: props.offer.description
|
|
345
|
+
}) : null]
|
|
346
|
+
});
|
|
347
|
+
}
|
|
286
348
|
function CustomGiftAmount({ offer }) {
|
|
287
349
|
const min = offer.giftCard.customAmountMinCents / 100;
|
|
288
350
|
const max = offer.giftCard.customAmountMaxCents / 100;
|
|
@@ -317,7 +379,7 @@ function RevealingOfferForm(props) {
|
|
|
317
379
|
children: [props.row, open ? null : /* @__PURE__ */ jsx(ThemedButton, {
|
|
318
380
|
...giftingSlot(props.look, "action"),
|
|
319
381
|
type: "button",
|
|
320
|
-
variant: "primary",
|
|
382
|
+
variant: props.variant ?? "primary",
|
|
321
383
|
size: "md",
|
|
322
384
|
extraClassName: "gifting-buy",
|
|
323
385
|
label: props.buyLabel,
|
|
@@ -333,6 +395,7 @@ function RevealingOfferForm(props) {
|
|
|
333
395
|
});
|
|
334
396
|
}
|
|
335
397
|
function GiftingCustomerFields() {
|
|
398
|
+
const hintId = React.useId();
|
|
336
399
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
337
400
|
/* @__PURE__ */ jsxs("div", {
|
|
338
401
|
className: "gifting-field-grid",
|
|
@@ -365,16 +428,24 @@ function GiftingCustomerFields() {
|
|
|
365
428
|
}),
|
|
366
429
|
/* @__PURE__ */ jsxs("label", {
|
|
367
430
|
className: "gifting-field",
|
|
368
|
-
children: [/* @__PURE__ */ jsx("span", { children: "Message" }), /* @__PURE__ */ jsx("textarea", {
|
|
431
|
+
children: [/* @__PURE__ */ jsx("span", { children: "Message (optional)" }), /* @__PURE__ */ jsx("textarea", {
|
|
369
432
|
name: "message",
|
|
370
433
|
rows: 4
|
|
371
434
|
})]
|
|
372
435
|
}),
|
|
373
|
-
/* @__PURE__ */ jsxs("
|
|
436
|
+
/* @__PURE__ */ jsxs("div", {
|
|
374
437
|
className: "gifting-field",
|
|
375
|
-
children: [/* @__PURE__ */
|
|
376
|
-
|
|
377
|
-
|
|
438
|
+
children: [/* @__PURE__ */ jsxs("label", {
|
|
439
|
+
className: "gifting-field",
|
|
440
|
+
children: [/* @__PURE__ */ jsx("span", { children: "Send on" }), /* @__PURE__ */ jsx("input", {
|
|
441
|
+
name: "sendOnDate",
|
|
442
|
+
type: "date",
|
|
443
|
+
"aria-describedby": hintId
|
|
444
|
+
})]
|
|
445
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
446
|
+
id: hintId,
|
|
447
|
+
className: "gifting-field-hint",
|
|
448
|
+
children: "Leave this blank to send it straight away."
|
|
378
449
|
})]
|
|
379
450
|
})
|
|
380
451
|
] });
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { c as blockSiteTermsSchema } from "./src-Do_s2lqH.mjs";
|
|
3
|
+
import { a as defineClientOwnedBlockRuntime, f as lookListPresentationSchemaShape, i as createZodCodec, n as createInteractiveIslandCodec, r as defineInteractiveIslandMetaKeys, t as buildInteractiveIslandProps } from "./islands-DJDLGQEm.mjs";
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
//#region ../blocks/src/system/runtime/nodes/gifting.interactive.ts
|
|
6
|
+
const publicGiftCardOfferSchema = z.object({
|
|
7
|
+
id: z.string(),
|
|
8
|
+
kind: z.literal("gift_card"),
|
|
9
|
+
title: z.string(),
|
|
10
|
+
description: z.string().nullable(),
|
|
11
|
+
sortOrder: z.number().int(),
|
|
12
|
+
giftCard: z.object({
|
|
13
|
+
fixedDenominations: z.array(z.number().int().positive()),
|
|
14
|
+
customAmountEnabled: z.boolean(),
|
|
15
|
+
customAmountMinCents: z.number().int().positive(),
|
|
16
|
+
customAmountMaxCents: z.number().int().positive()
|
|
17
|
+
}),
|
|
18
|
+
voucher: z.null()
|
|
19
|
+
});
|
|
20
|
+
const publicVoucherOfferSchema = z.object({
|
|
21
|
+
id: z.string(),
|
|
22
|
+
kind: z.literal("voucher"),
|
|
23
|
+
title: z.string(),
|
|
24
|
+
description: z.string().nullable(),
|
|
25
|
+
sortOrder: z.number().int(),
|
|
26
|
+
giftCard: z.null(),
|
|
27
|
+
voucher: z.object({ purchaseAmountCents: z.number().int().positive() })
|
|
28
|
+
});
|
|
29
|
+
const publicGiftingOffersResponseSchema = z.object({
|
|
30
|
+
currency: z.string(),
|
|
31
|
+
giftCards: z.array(publicGiftCardOfferSchema),
|
|
32
|
+
vouchers: z.array(publicVoucherOfferSchema)
|
|
33
|
+
});
|
|
34
|
+
const giftingSourceSchema = z.object({
|
|
35
|
+
lookSlots: lookListPresentationSchemaShape.lookSlots,
|
|
36
|
+
surfacePresentation: lookListPresentationSchemaShape.surfacePresentation,
|
|
37
|
+
siteTerms: blockSiteTermsSchema.optional(),
|
|
38
|
+
siteId: z.string().optional(),
|
|
39
|
+
apiBaseUrl: z.string().optional(),
|
|
40
|
+
offers: publicGiftingOffersResponseSchema.nullable().optional(),
|
|
41
|
+
className: z.string().nullable().optional(),
|
|
42
|
+
heading: z.string().nullable().optional(),
|
|
43
|
+
intro: z.string().nullable().optional(),
|
|
44
|
+
giftCardsHeading: z.string().nullable().optional(),
|
|
45
|
+
vouchersHeading: z.string().nullable().optional(),
|
|
46
|
+
emptyStateText: z.string().nullable().optional(),
|
|
47
|
+
checkoutButtonText: z.string().nullable().optional(),
|
|
48
|
+
successMessage: z.string().nullable().optional()
|
|
49
|
+
});
|
|
50
|
+
const giftingDisplaySchema = z.object({
|
|
51
|
+
lookSlots: lookListPresentationSchemaShape.lookSlots,
|
|
52
|
+
surfacePresentation: lookListPresentationSchemaShape.surfacePresentation,
|
|
53
|
+
kind: z.literal("gifting"),
|
|
54
|
+
state: z.literal("ready"),
|
|
55
|
+
className: z.string().nullable(),
|
|
56
|
+
heading: z.string(),
|
|
57
|
+
intro: z.string().nullable(),
|
|
58
|
+
groups: z.array(z.object({
|
|
59
|
+
kind: z.enum(["gift_card", "voucher"]),
|
|
60
|
+
heading: z.string(),
|
|
61
|
+
line: z.string()
|
|
62
|
+
})),
|
|
63
|
+
emptyStateText: z.string()
|
|
64
|
+
});
|
|
65
|
+
const giftingHydrationSchema = z.object({
|
|
66
|
+
groupHeadings: z.object({
|
|
67
|
+
giftCardsHeading: z.string().nullable().optional(),
|
|
68
|
+
vouchersHeading: z.string().nullable().optional()
|
|
69
|
+
}),
|
|
70
|
+
siteTerms: blockSiteTermsSchema.optional(),
|
|
71
|
+
offers: publicGiftingOffersResponseSchema.nullable(),
|
|
72
|
+
checkoutButtonText: z.string(),
|
|
73
|
+
successMessage: z.string()
|
|
74
|
+
});
|
|
75
|
+
const giftingRenderSchema = z.object({
|
|
76
|
+
display: giftingDisplaySchema,
|
|
77
|
+
hydration: giftingHydrationSchema
|
|
78
|
+
});
|
|
79
|
+
const giftingIslandMetaCodec = createZodCodec(z.object({
|
|
80
|
+
siteId: z.string().optional(),
|
|
81
|
+
apiBaseUrl: z.string().optional()
|
|
82
|
+
}));
|
|
83
|
+
const giftingIslandMetaKeys = defineInteractiveIslandMetaKeys("siteId", "apiBaseUrl");
|
|
84
|
+
/** The Look's slot hooks and surfaces, carried only when the block has a Look. */
|
|
85
|
+
function giftingLookPresentation({ lookSlots, surfacePresentation }) {
|
|
86
|
+
return {
|
|
87
|
+
...lookSlots ? { lookSlots } : {},
|
|
88
|
+
...surfacePresentation ? { surfacePresentation } : {}
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
function giftingGroups(source) {
|
|
92
|
+
return [giftingGroup("gift_card", source.offers?.giftCards.length ?? 0, source.giftCardsHeading), giftingGroup("voucher", source.offers?.vouchers.length ?? 0, source.vouchersHeading)].flatMap((group) => group ? [group] : []);
|
|
93
|
+
}
|
|
94
|
+
function giftingGroup(kind, count, heading) {
|
|
95
|
+
if (count === 0) return null;
|
|
96
|
+
const singular = kind === "gift_card" ? "Gift card" : "Voucher";
|
|
97
|
+
return {
|
|
98
|
+
kind,
|
|
99
|
+
heading: heading?.trim() || (count === 1 ? singular : `${singular}s`),
|
|
100
|
+
line: kind === "gift_card" ? "An amount they can spend on any booking here." : "Paid for in advance, for one particular thing."
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
function buildGiftingDisplay(source) {
|
|
104
|
+
return {
|
|
105
|
+
kind: "gifting",
|
|
106
|
+
...giftingLookPresentation(source),
|
|
107
|
+
state: "ready",
|
|
108
|
+
className: source.className ?? null,
|
|
109
|
+
heading: source.heading?.trim() || "Gift cards & vouchers",
|
|
110
|
+
intro: source.intro?.trim() || null,
|
|
111
|
+
groups: giftingGroups(source),
|
|
112
|
+
emptyStateText: source.emptyStateText?.trim() || "Nothing is available right now."
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
const giftingBlockRuntime = defineClientOwnedBlockRuntime({
|
|
116
|
+
kind: "client-owned",
|
|
117
|
+
contracts: {
|
|
118
|
+
source: createZodCodec(giftingSourceSchema),
|
|
119
|
+
render: createZodCodec(giftingRenderSchema)
|
|
120
|
+
},
|
|
121
|
+
buildRender: (source) => ({
|
|
122
|
+
display: buildGiftingDisplay(source),
|
|
123
|
+
hydration: {
|
|
124
|
+
groupHeadings: {
|
|
125
|
+
giftCardsHeading: source.giftCardsHeading,
|
|
126
|
+
vouchersHeading: source.vouchersHeading
|
|
127
|
+
},
|
|
128
|
+
siteTerms: source.siteTerms,
|
|
129
|
+
offers: source.offers ?? null,
|
|
130
|
+
checkoutButtonText: source.checkoutButtonText?.trim() || "Continue to payment",
|
|
131
|
+
successMessage: source.successMessage?.trim() || "Thanks, that's all paid for. We'll email the gift to them in the next few minutes."
|
|
132
|
+
}
|
|
133
|
+
})
|
|
134
|
+
});
|
|
135
|
+
const giftingInteractiveIslandPropsCodec = createInteractiveIslandCodec({
|
|
136
|
+
runtime: giftingBlockRuntime,
|
|
137
|
+
mode: "gifting",
|
|
138
|
+
meta: giftingIslandMetaCodec,
|
|
139
|
+
metaKeys: giftingIslandMetaKeys,
|
|
140
|
+
selectMeta: (value) => ({
|
|
141
|
+
siteId: value.siteId,
|
|
142
|
+
apiBaseUrl: value.apiBaseUrl
|
|
143
|
+
})
|
|
144
|
+
});
|
|
145
|
+
function buildGiftingInteractiveIslandProps(props) {
|
|
146
|
+
return buildInteractiveIslandProps({
|
|
147
|
+
runtime: giftingBlockRuntime,
|
|
148
|
+
mode: "gifting",
|
|
149
|
+
meta: {
|
|
150
|
+
siteId: props.siteId,
|
|
151
|
+
apiBaseUrl: props.apiBaseUrl
|
|
152
|
+
},
|
|
153
|
+
source: props
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
//#endregion
|
|
157
|
+
export { publicGiftingOffersResponseSchema as a, giftingInteractiveIslandPropsCodec as i, buildGiftingInteractiveIslandProps as n, giftingBlockRuntime as r, buildGiftingDisplay as t };
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { An as formatCurrencyAmount } from "./src-Do_s2lqH.mjs";
|
|
3
|
+
import { d as listLookSlot } from "./islands-DJDLGQEm.mjs";
|
|
4
|
+
import "react";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
//#region ../blocks/src/system/runtime/shared/components/ChoiceGroup.tsx
|
|
7
|
+
function ChoiceGroup(props) {
|
|
8
|
+
const size = props.size ?? "pill";
|
|
9
|
+
return /* @__PURE__ */ jsxs("fieldset", {
|
|
10
|
+
className: ["rb-choice-group", props.className].filter(Boolean).join(" "),
|
|
11
|
+
"data-choice-size": size,
|
|
12
|
+
disabled: props.disabled,
|
|
13
|
+
children: [/* @__PURE__ */ jsx("legend", {
|
|
14
|
+
className: props.legendHidden ? "rb-choice-legend rb-choice-legend--hidden" : "rb-choice-legend",
|
|
15
|
+
children: props.legend
|
|
16
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
17
|
+
className: "rb-choice-options",
|
|
18
|
+
children: props.options.map((option) => /* @__PURE__ */ jsxs("label", {
|
|
19
|
+
className: "rb-choice",
|
|
20
|
+
"data-choice-size": size,
|
|
21
|
+
children: [/* @__PURE__ */ jsx("input", {
|
|
22
|
+
type: "radio",
|
|
23
|
+
className: "rb-choice-input",
|
|
24
|
+
name: props.name,
|
|
25
|
+
value: option.value,
|
|
26
|
+
required: props.required,
|
|
27
|
+
disabled: option.disabled,
|
|
28
|
+
...props.value === void 0 ? { defaultChecked: option.value === props.defaultValue } : { checked: option.value === props.value },
|
|
29
|
+
onChange: props.onChange ? () => props.onChange?.(option.value) : void 0
|
|
30
|
+
}), /* @__PURE__ */ jsxs("span", {
|
|
31
|
+
className: "rb-choice-face",
|
|
32
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
33
|
+
className: "rb-choice-label",
|
|
34
|
+
children: option.label
|
|
35
|
+
}), option.detail ? /* @__PURE__ */ jsx("span", {
|
|
36
|
+
className: "rb-choice-detail",
|
|
37
|
+
children: option.detail
|
|
38
|
+
}) : null]
|
|
39
|
+
})]
|
|
40
|
+
}, option.value))
|
|
41
|
+
})]
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
//#endregion
|
|
45
|
+
//#region ../blocks/src/system/runtime/nodes/gifting.parts.tsx
|
|
46
|
+
const CUSTOM_GIFT_AMOUNT = "custom";
|
|
47
|
+
/** A Look's hook (and, for the panel, its surface) on one part of the gifting panel; nothing outside a Look. */
|
|
48
|
+
function giftingSlot(look, slot) {
|
|
49
|
+
return listLookSlot(look ?? {}, slot);
|
|
50
|
+
}
|
|
51
|
+
function GiftingPanelHead(props) {
|
|
52
|
+
const { look } = props;
|
|
53
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
54
|
+
className: "gifting-panel-head",
|
|
55
|
+
...giftingSlot(look, "head"),
|
|
56
|
+
children: [/* @__PURE__ */ jsx("h2", {
|
|
57
|
+
className: "gifting-heading",
|
|
58
|
+
...giftingSlot(look, "heading"),
|
|
59
|
+
children: props.heading
|
|
60
|
+
}), props.intro ? /* @__PURE__ */ jsx("p", {
|
|
61
|
+
className: "gifting-intro",
|
|
62
|
+
...giftingSlot(look, "intro"),
|
|
63
|
+
children: props.intro
|
|
64
|
+
}) : null]
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
/** Amount buttons are radios, so they keep working from the keyboard and post with the form. */
|
|
68
|
+
function GiftCardAmounts(props) {
|
|
69
|
+
const { offer, currency, disabled, onChoose } = props;
|
|
70
|
+
const options = [...offer.giftCard.fixedDenominations.map((amount) => ({
|
|
71
|
+
value: String(amount),
|
|
72
|
+
label: formatGiftAmount(amount, currency)
|
|
73
|
+
})), ...offer.giftCard.customAmountEnabled ? [{
|
|
74
|
+
value: CUSTOM_GIFT_AMOUNT,
|
|
75
|
+
label: "Another amount"
|
|
76
|
+
}] : []];
|
|
77
|
+
return /* @__PURE__ */ jsx(ChoiceGroup, {
|
|
78
|
+
className: "gifting-amounts",
|
|
79
|
+
name: props.groupName ?? "amountChoice",
|
|
80
|
+
legend: "Amount",
|
|
81
|
+
legendHidden: true,
|
|
82
|
+
options,
|
|
83
|
+
defaultValue: props.initialChoice ?? firstGiftAmountChoice(offer),
|
|
84
|
+
disabled,
|
|
85
|
+
required: true,
|
|
86
|
+
onChange: onChoose
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
function firstGiftAmountChoice(offer) {
|
|
90
|
+
const first = offer.giftCard.fixedDenominations[0];
|
|
91
|
+
return first === void 0 ? CUSTOM_GIFT_AMOUNT : String(first);
|
|
92
|
+
}
|
|
93
|
+
function readChosenGiftAmounts(root) {
|
|
94
|
+
const entries = Array.from(root.querySelectorAll("[data-gift-offer]"), (offer) => [offer.dataset.giftOffer ?? "", offer.querySelector("input[type=\"radio\"]:checked")?.value ?? ""]);
|
|
95
|
+
return Object.fromEntries(entries.filter(([id, amount]) => id !== "" && amount !== ""));
|
|
96
|
+
}
|
|
97
|
+
function formatGiftAmount(amount, currency) {
|
|
98
|
+
return formatCurrencyAmount(amount, currency, { decimals: "auto" });
|
|
99
|
+
}
|
|
100
|
+
/** Shared by first paint and the island; the resolved group carries all its copy. */
|
|
101
|
+
function GiftGroup(props) {
|
|
102
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
103
|
+
className: "gifting-group",
|
|
104
|
+
"data-gift-kind": props.group.kind,
|
|
105
|
+
...giftingSlot(props.look, "panel"),
|
|
106
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
107
|
+
className: "gifting-group-head",
|
|
108
|
+
children: [/* @__PURE__ */ jsx("h3", {
|
|
109
|
+
className: "gifting-group-title",
|
|
110
|
+
children: props.group.heading
|
|
111
|
+
}), /* @__PURE__ */ jsx("p", {
|
|
112
|
+
className: "gifting-group-line",
|
|
113
|
+
children: props.group.line
|
|
114
|
+
})]
|
|
115
|
+
}), props.children]
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
//#endregion
|
|
119
|
+
export { firstGiftAmountChoice as a, readChosenGiftAmounts as c, GiftingPanelHead as i, GiftCardAmounts as n, formatGiftAmount as o, GiftGroup as r, giftingSlot as s, CUSTOM_GIFT_AMOUNT as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t as defineIslandPropsDecoder } from "./propsDecoder-
|
|
3
|
-
import { t as mountHeaderChromeRuntime } from "./enhanceHeaderSection-
|
|
2
|
+
import { t as defineIslandPropsDecoder } from "./propsDecoder-DFYqKnLy.mjs";
|
|
3
|
+
import { t as mountHeaderChromeRuntime } from "./enhanceHeaderSection-CtLAG651.mjs";
|
|
4
4
|
//#region src/rendering/islands/enhancers/headerSection.ts
|
|
5
5
|
const decode = defineIslandPropsDecoder("headerSection");
|
|
6
6
|
const enhance = (root, props) => {
|