@riverbankcms/sdk 0.167.0 → 0.168.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/dist/_dts/{BlocksIslandsHydrator-Dgb-ptph.d.ts → BlocksIslandsHydrator-CiD_VVGM.d.ts} +1 -1
- package/dist/_dts/{Page-Bs3WxFgr.d.ts → Page-Bj6VJRS5.d.ts} +7 -6
- package/dist/_dts/{SdkPreviewMode-DtUCsaHY.d.ts → SdkPreviewMode-ChpsnwDX.d.ts} +2 -2
- package/dist/_dts/{client-CwsI23pj.d.ts → client-C8mfUxrJ.d.ts} +65 -35
- package/dist/_dts/{content-types-CAeP_-cV.d.ts → content-types-_vXZyR4H.d.ts} +2 -2
- package/dist/_dts/{contracts-BXHCiF-b.d.ts → contracts-CJFfrVKU.d.ts} +5 -4
- package/dist/_dts/{footerPageOutline-Bb2gbppW.d.ts → footerPageOutline-CMegb23G.d.ts} +6 -6
- package/dist/_dts/{generatePageMetadata-DaBBDx7M.d.ts → generatePageMetadata-D9YdAIMh.d.ts} +2 -2
- package/dist/_dts/{index-CS6b1B-c.d.ts → index-BQXaZ7aY.d.ts} +4 -4
- package/dist/_dts/{index-5_jf52sZ.d.ts → index-Bpr-wT5k.d.ts} +2 -2
- package/dist/_dts/{index-DeHDwMfu.d.ts → index-C7_Rz8EY.d.ts} +3 -3
- package/dist/_dts/{index-D7EbliE3.d.ts → index-Cx2BQlHL.d.ts} +3 -3
- package/dist/_dts/{index-C20yUyob.d.ts → index-Dgz6yhsy.d.ts} +1 -1
- package/dist/_dts/index-Vh8B9FSa.d.ts +14 -0
- package/dist/_dts/{index-bDln38Hm.d.ts → index-vR3p9Bu-.d.ts} +2 -2
- package/dist/_dts/{loadContent-CTqcL7CS.d.ts → loadContent-dhWSgLeS.d.ts} +7 -7
- package/dist/_dts/previewCompiler-BVVgDSdq.d.ts +1 -0
- package/dist/_dts/{index-ChpjHK0U.d.ts → request-BrYhNV9Z.d.ts} +80718 -47665
- package/dist/_dts/{resolveBlockData-C3s9WMPs.d.ts → resolveBlockData-BfSHm8Ms.d.ts} +5 -5
- package/dist/_dts/{resolvePageContent-JPwgRxwh.d.ts → resolvePageContent-gZJ4i1wN.d.ts} +2 -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 +7 -7
- package/dist/_dts/sdk/src/config/index.d.ts +6 -6
- package/dist/_dts/sdk/src/config/template-validation.d.ts +1 -1
- package/dist/_dts/sdk/src/config/validation.d.ts +1 -1
- package/dist/_dts/sdk/src/data/dataLoaderContext.d.ts +2 -2
- package/dist/_dts/sdk/src/data/resolveBlockData.d.ts +1 -1
- package/dist/_dts/sdk/src/data/types.d.ts +2 -2
- package/dist/_dts/sdk/src/index.d.ts +8 -8
- package/dist/_dts/sdk/src/manifest/index.d.ts +3 -3
- package/dist/_dts/sdk/src/metadata/index.d.ts +1 -1
- package/dist/_dts/sdk/src/navigation/index.d.ts +2 -2
- 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/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 -5
- 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 +5 -5
- package/dist/_dts/sdk/src/server.d.ts +5 -5
- package/dist/_dts/sdk/src/spam-protection/index.d.ts +2 -2
- package/dist/_dts/sdk/src/theme/index.d.ts +1 -1
- package/dist/_dts/{types-CwtTcaQP.d.ts → types-BB33-Spd.d.ts} +3 -3
- package/dist/_dts/{types-D-WElMCy.d.ts → types-BVFXYtRg.d.ts} +7 -7
- package/dist/_dts/{types-BlaCuPLr.d.ts → types-FOsJ-KYb.d.ts} +4 -2
- package/dist/_dts/{validation-Y5wD9fGK.d.ts → validation-DckTc6TQ.d.ts} +4 -4
- package/dist/client/{BlocksIslandsHydrator-DFqkx158.mjs → BlocksIslandsHydrator-DcwEaliO.mjs} +21 -21
- package/dist/client/BookingMailingListNote-Dsugoe-n.mjs +946 -0
- package/dist/client/BookingQuestionFields-Bhh0cvsl.mjs +359 -0
- package/dist/client/{CalendarNavigationChevron-DQwJ7BPx.mjs → CalendarNavigationChevron-CNe3ZjdC.mjs} +7 -7
- package/dist/client/{CheckboxChoice-CZ-anOqV.mjs → CheckboxChoice-W_uiRgDK.mjs} +1 -1
- package/dist/client/{DemoBookingPortalAccess-DdkY86qI.mjs → DemoBookingPortalAccess-BeiZxEUJ.mjs} +7 -7
- package/dist/client/{EventCalendar.client-DAeQPV76.mjs → EventCalendar.client-BL943-tl.mjs} +9 -9
- package/dist/client/{EventCombined.client-Bus9R0bj.mjs → EventCombined.client-BFVxECTp.mjs} +8 -8
- package/dist/client/{EventEmbeddedCheckoutStep-D_14yqAU.mjs → EventEmbeddedCheckoutStep-Cf-HRHtb.mjs} +1 -1
- package/dist/client/{EventItem-DPBLjGwj.mjs → EventItem-BIc4gjiD.mjs} +37 -15
- package/dist/client/{EventListWeekNavigation-D6cwU82_.mjs → EventListWeekNavigation-a0QEIEf0.mjs} +1 -1
- package/dist/client/{EventListing.client-Bogi_SnJ.mjs → EventListing.client-CEFTC3jH.mjs} +3 -3
- package/dist/client/{EventListing.view-CEumpN7i.mjs → EventListing.view-Bt2sBBms.mjs} +34 -16
- package/dist/client/{EventRegistrationPayment-CIQw6vNy.mjs → EventRegistrationPayment-D9YBNb_E.mjs} +250 -40
- package/dist/client/{LocationMapActions-BVO-qx4q.mjs → LocationMapActions-gqzt5gkW.mjs} +2 -2
- package/dist/client/{MapDrawingSvg-CcGaFawl.mjs → MapDrawingSvg-13JQI7_z.mjs} +1 -1
- package/dist/client/{Page-D4_H_u9V.mjs → Page-D_M2Vxz3.mjs} +4471 -1601
- package/dist/client/{ProtectedSubmitButton-8DuDw2ag.mjs → ProtectedSubmitButton-C3H26pN9.mjs} +1 -1
- package/dist/client/{StepIndicator-Dptantmg.mjs → StepIndicator-CaN8snZ8.mjs} +3 -3
- package/dist/client/{TabBarFragment-BxEGsKUx.mjs → TabBarFragment-DkVKtK5a.mjs} +1 -1
- package/dist/client/{ThemedButton-8jUc02mZ.mjs → ThemedButton-BdnEwA38.mjs} +2 -5
- package/dist/client/accessibleSurfaces-chpD4C2c.mjs +4278 -0
- package/dist/client/{accordion--EUHmEGa.mjs → accordion-DE7OG--d.mjs} +1 -1
- package/dist/client/{booking-form.client-BCXwOnhc.mjs → booking-form.client-CS1PPjw7.mjs} +842 -374
- package/dist/client/{bookingForm-sHHcdism.mjs → bookingForm-DE2CwIU9.mjs} +5 -4
- package/dist/client/{src-DjnxOjXG.mjs → bookingQuestionValues-BjcyCru5.mjs} +88 -1
- package/dist/client/bookingQuestions-BHq83mzS.mjs +13 -0
- package/dist/client/bookings.mjs +18 -13
- package/dist/client/{carousel-Cp9xPBFZ.mjs → carousel-DZyUdnFh.mjs} +3 -3
- package/dist/client/{carousel.client-BO7sCEpH.mjs → carousel.client-BD4DXMtI.mjs} +62 -16
- package/dist/client/{carousel.shared-DBnWEJzo.mjs → carousel.shared-BFQ3kBEw.mjs} +6 -3
- package/dist/client/{cart-CCZZC-Lq.mjs → cart-D7HkkNwe.mjs} +3 -3
- package/dist/client/{cart.client-B7JfA19I.mjs → cart.client-H4sv2TpD.mjs} +1 -1
- package/dist/client/{checkout-CipmYL4A.mjs → checkout-2qVyG-Sh.mjs} +3 -3
- package/dist/client/{checkout.client-DraalWdH.mjs → checkout.client-DAjrBZ74.mjs} +1 -1
- package/dist/client/client.mjs +240 -63
- package/dist/client/{context-Cv3QHjAF.mjs → context-DXmIbXCK.mjs} +297 -3
- package/dist/client/{cta-P2vJVTEn.mjs → cta-DP_IBnq3.mjs} +2 -2
- package/dist/client/{dateFormatting-D8D47VT4.mjs → dateFormatting-CwrkFZTr.mjs} +1 -1
- package/dist/client/{demoPortalMagicLink-CXWZoV-d.mjs → demoPortalMagicLink-DQXK-Fh6.mjs} +1 -1
- package/dist/client/{enhanceHeaderSection-BkAro1DJ.mjs → enhanceHeaderSection-DheQj7rg.mjs} +3 -3
- package/dist/client/{event-details.client-dLmyuPap.mjs → event-details.client-C5UufcRp.mjs} +1 -1
- package/dist/client/{event-registration.client-BEhC2_-Y.mjs → event-registration.client-CMGg63IU.mjs} +72 -235
- package/dist/client/{eventCalendar-FBMS2Cpb.mjs → eventCalendar-DlD0GCEy.mjs} +4 -4
- package/dist/client/{eventCombined-BrBhUvGe.mjs → eventCombined-DoSi8p_l.mjs} +4 -4
- package/dist/client/{eventDetails-C7WUrbZ2.mjs → eventDetails-DzuQYgmO.mjs} +2 -2
- package/dist/client/{eventListing-Bih-BgQM.mjs → eventListing-CkiMjl0g.mjs} +4 -4
- package/dist/client/{eventRegistration-DfTlqGbl.mjs → eventRegistration-CjS3Zpjp.mjs} +4 -4
- package/dist/client/{form-Bw1uuiUs.mjs → form-DgQqm7T2.mjs} +3 -3
- package/dist/client/{form.client-pZ-9gN33.mjs → form.client-BI9Dcsq5.mjs} +5 -5
- package/dist/client/{form.parts-PXlu6XQO.mjs → form.parts-DevF0L_A.mjs} +3 -3
- package/dist/client/{formatDate-DI3DP48e.mjs → formatDate-DDyURjoe.mjs} +1 -1
- package/dist/client/gifting/client.mjs +3 -3
- package/dist/client/{headerSection-BpJYUMd6.mjs → headerSection-DYIG6Pwb.mjs} +2 -2
- package/dist/client/{mediaAssets-DpPauppt.mjs → mediaAssets-B99AP7ai.mjs} +1 -1
- package/dist/client/{mediaContext-BLo4NtjP.mjs → mediaContext-Fusweriw.mjs} +1 -1
- package/dist/client/{newsletter-form.client-CSoP0cGR.mjs → newsletter-form.client-BWp7Y1e1.mjs} +6 -6
- package/dist/client/{newsletter-form.parts-DDbX_Sj0.mjs → newsletter-form.parts-Dg8s9NwJ.mjs} +2 -2
- package/dist/client/{newsletterForm-vCxYRar_.mjs → newsletterForm-DnPraMzx.mjs} +3 -3
- package/dist/client/{noop-ByVtIWf4.mjs → noop-ByFRHYQ2.mjs} +437 -496
- package/dist/client/portal/client.mjs +76 -229
- package/dist/client/{product-detail.client-7Pi6avM-.mjs → product-detail.client-BFAgHrdg.mjs} +1 -1
- package/dist/client/{product-list.client-DEad-Pma.mjs → product-list.client-DVrs_DyY.mjs} +1 -1
- package/dist/client/{productDetail-G1SMXG13.mjs → productDetail-D4rvl6Xg.mjs} +3 -3
- package/dist/client/{productList-B21TGdpT.mjs → productList-B8o5AOMX.mjs} +3 -3
- package/dist/client/{propsDecoder-B3vIBkex.mjs → propsDecoder-hhotPP6P.mjs} +5 -4
- package/dist/client/{registry.server-B8aQhJpO.mjs → registry.server-Ch3EpupA.mjs} +2213 -2433
- package/dist/client/{surfaceTransportMarker-BXepAVF6.mjs → renderableMediaAssetAdmission-BlfqYLJW.mjs} +1 -18
- package/dist/client/rendering/client.mjs +30 -30
- package/dist/client/rendering/islands.mjs +1 -1
- package/dist/client/rendering.mjs +10 -9
- package/dist/client/{richText-coerce-DHkBtO0G.mjs → richText-coerce-C3LabQ1O.mjs} +1 -1
- package/dist/client/{routeIslandApiConfig-DbHX4JOS.mjs → routeIslandApiConfig-CQGlxId8.mjs} +1 -1
- package/dist/client/runtimeResponse-BP-L6exS.mjs +3 -0
- package/dist/client/runtimeResponse-Dg4XFsuM.mjs +9 -0
- package/dist/client/{shop-commerce-B2UmrQg_.mjs → shop-commerce-VDbVaKY-.mjs} +12 -12
- package/dist/client/{shop-commerce-store-B7n-Z7nY.mjs → shop-commerce-store-DqdgJ8Zw.mjs} +1 -1
- package/dist/client/{shop-mqyoOvOK.mjs → shop-rRXplPGZ.mjs} +3 -3
- package/dist/client/{shop.client-BH-BBnA9.mjs → shop.client-DdwvMvaK.mjs} +13 -13
- package/dist/client/{shop.interactive-mdM3UMWG.mjs → shop.interactive-C8OvFY06.mjs} +141 -66
- package/dist/client/{shopShared-CXF5wxdg.mjs → shopShared-BeuJiGPU.mjs} +2 -2
- package/dist/client/spam-protection.mjs +1 -1
- package/dist/client/surfaceTransportMarker-BuwkYxsI.mjs +19 -0
- package/dist/client/{timetableModel-CrC80EOG.mjs → timetableModel-Cko9LRKy.mjs} +11 -11
- package/dist/client/{types-sF-IrGQr.mjs → types-5fOsPIpL.mjs} +248 -111
- package/dist/client/{useAvailableSlots-C4LOaI_Z.mjs → useAvailableSlots-M6QIEiWf.mjs} +3 -3
- package/dist/client/{useDiscountApply-6Q0nToVA.mjs → useDiscountApply-BJSnyO0f.mjs} +3 -3
- package/dist/client/{useDiscountCodeUi-CM-DTX5X.mjs → useDiscountCodeUi-D3XnOSCi.mjs} +1 -1
- package/dist/client/{useEventPagination-Bcs89BR5.mjs → useEventPagination-PhTIoFVX.mjs} +7 -7
- package/dist/client/{view-BN-fxyfq.mjs → view-448wvvEY.mjs} +11 -7
- package/dist/client/{view-Dh2tGoS0.mjs → view-L_mkgtnk.mjs} +4 -4
- package/dist/client/{site-styles-D56hT2u1.mjs → wizardSteps-CFulHWnT.mjs} +19660 -18565
- package/dist/preview-next/client/{ArrangementLookControls-D4VjPs-r.mjs → ArrangementLookControls-BpvnOGlN.mjs} +26 -17
- package/dist/preview-next/client/{EventEmbeddedCheckoutStep-C_h1cMYm.mjs → EventEmbeddedCheckoutStep-8-qtHjpb.mjs} +1 -1
- package/dist/preview-next/client/{LocationPickerEnvironment-D56RD3e_.mjs → LocationPickerEnvironment-CZQ4vkRe.mjs} +1 -1
- package/dist/preview-next/client/{MapLibreEditMap-DFnyCckr.mjs → MapLibreEditMap-CP4w7T_0.mjs} +2 -2
- package/dist/preview-next/client/{PreviewEditorSidebar-Ckr2zk_L.mjs → PreviewEditorSidebar-C0OtdWu_.mjs} +128 -21
- package/dist/preview-next/client/{PreviewEditorUI-KOZgw_gS.mjs → PreviewEditorUI-Csc5vH5k.mjs} +6 -6
- package/dist/preview-next/client/{PreviewShell-CyO2V4kB.mjs → PreviewShell-BOLH_pm-.mjs} +199 -155
- package/dist/preview-next/client/{SdkPreviewModeRuntime-DW3uKvNF.mjs → SdkPreviewModeRuntime-CKodLReY.mjs} +31 -32
- package/dist/preview-next/client/{SiteChromeCustomizeButton-CU9VD-7O.mjs → SiteChromeCustomizeButton-BeEZpeKn.mjs} +3780 -3436
- package/dist/preview-next/client/{ThemedButton-C0dgGJ5k.mjs → ThemedButton-BQU45t-E.mjs} +260 -121
- package/dist/preview-next/client/{lucide-react-CPBCf6QT.mjs → lucide-react-DkZ8fO-G.mjs} +1 -1
- package/dist/preview-next/client/{previewAssistantSlot-DBi-WybM.mjs → previewAssistantSlot-BBdN5kfY.mjs} +18697 -15557
- package/dist/preview-next/client/{previewChromeSurface-BhkUJst9.mjs → previewChromeSurface-VZtGwPuH.mjs} +1 -1
- package/dist/preview-next/client/runtime.mjs +3 -3
- package/dist/preview-next/client/{sdk-runtime-BjCb6lOn.mjs → sdk-runtime-kiZkMcuR.mjs} +2 -2
- package/dist/preview-next/client/{useAutosaveStatus-CKxTaC3j.mjs → useAutosaveStatus-BiIHEeE0.mjs} +2 -2
- package/dist/preview-next/client/{useBlockCustomizeControls-B7MLTjBX.mjs → useBlockCustomizeControls-BuFLIpmX.mjs} +2 -2
- package/dist/preview-next/client/{useOpenBlockForSetup-BTUc0g9X.mjs → useOpenBlockForSetup-DlxYgmh_.mjs} +1 -1
- package/dist/preview-next/keepAlive.mjs +1 -1
- package/dist/preview-next/middleware.mjs +1 -1
- package/dist/preview-next/{route-contract-Bv3nkdpV.mjs → route-contract-C0sCvCYL.mjs} +165 -0
- package/dist/server/{Block.shared-4fMqzltx.mjs → Block.shared-Dnhc0Wu5.mjs} +5 -5
- package/dist/server/{ThemeScopeCore-C72VC_lR.mjs → ThemeScopeCore-NAQ_zsFu.mjs} +461 -128
- package/dist/server/{accessibleSurfaces-B_Y_dA20.mjs → accessibleSurfaces-108nxyGc.mjs} +319 -131
- package/dist/server/{bindings-ConMYJ2U.mjs → bindings-DLoZYUxG.mjs} +2 -2
- package/dist/server/{client-Cot-H5fQ.mjs → client-Bc8jI8zN.mjs} +261 -61
- package/dist/server/config-validation.mjs +1 -1
- package/dist/server/config.mjs +1 -1
- package/dist/server/{validation-CDd6m8Ry.mjs → customCss-QymcmOZ-.mjs} +12 -55
- package/dist/server/data/resolveBlockData.mjs +1 -1
- package/dist/server/headerVariant-BwR9NV4b.mjs +463 -0
- package/dist/server/{identity-Bn9OQiT1.mjs → identity-20XHqyuO.mjs} +1 -1
- package/dist/server/index.mjs +3 -3
- package/dist/server/{loadContent-BkaWYEwt.mjs → loadContent-D61gpqHB.mjs} +4 -5
- package/dist/server/{loadPage-kviUdH8c.mjs → loadPage-B4ZYpIcd.mjs} +2 -2
- package/dist/server/manifest.mjs +1 -1
- package/dist/server/{media-DnlczCMA.mjs → media-Brn9FW5s.mjs} +15 -1
- package/dist/server/{mode-Cv_TG9gP.mjs → mode-bkFS8glh.mjs} +4 -2
- package/dist/server/next.mjs +6 -6
- package/dist/server/{opaqueSurface-BTnS09GS.mjs → opaqueSurface-BawlEAd_.mjs} +6 -6
- package/dist/server/{overrideResolution-itXZCXs7.mjs → overrideResolution-CDReKy2P.mjs} +1 -1
- package/dist/server/page-converter.mjs +3 -3
- package/dist/server/{pageRenderPlan-CDyn7iLy.mjs → pageRenderPlan-ByVTA7-4.mjs} +255 -158
- package/dist/server/{pageRuntimeSupport-DZ6cLxrM.mjs → pageRuntimeSupport-Dzz_Dze6.mjs} +291 -5
- package/dist/server/{pageShared-Q_Vij87H.mjs → pageShared-Dk5Ku6hs.mjs} +1285 -897
- package/dist/server/{schema-DEizlyi4.mjs → parseThemeForPersistence-pJPGfMrf.mjs} +593 -1592
- package/dist/server/{prebuild-DOG4MkOy.mjs → prebuild-CW4M0WEZ.mjs} +1 -1
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/{prefetchBlockData-DlprLLsc.mjs → prefetchBlockData-Bvx0SiIM.mjs} +5 -4
- package/dist/server/{registry-BPFcpn6k.mjs → registry-Bh0Y25zH.mjs} +4399 -4065
- 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 +3 -3
- package/dist/server/rendering.mjs +8 -8
- package/dist/server/{resolveBlockData-BHvfGD4y.mjs → resolveBlockData-CnHHst9r.mjs} +1 -1
- package/dist/server/{resolveButtonColourStates-OXFRGn5M.mjs → resolveButtonColourStates-Cn6j8Ee0.mjs} +399 -518
- package/dist/server/{responseMedia-D8J3VAFs.mjs → responseMedia-t6gs0cB7.mjs} +2 -2
- package/dist/server/{richTextSchema-Euhuj-7V.mjs → richTextSchema-DQ2NBP0n.mjs} +5 -16
- package/dist/server/server.mjs +3 -3
- package/dist/server/theme-bridge.mjs +2 -3
- package/dist/server/theme.mjs +1 -2
- package/dist/server/{three-pass-converter-_j2UE2tR.mjs → three-pass-converter-CQWdnfjV.mjs} +1 -1
- package/dist/server/{validation-bl6WcAi_.mjs → validation-D2bHWSxJ.mjs} +57 -8
- package/dist/server/{version-BLXZ31S-.mjs → version-DkM1eAxG.mjs} +1 -1
- package/dist/styles/index.css +340 -68
- package/package.json +4 -3
- package/dist/_dts/index-CXsnaCGe.d.ts +0 -10
- package/dist/_dts/index-RugyUnqR.d.ts +0 -31535
- package/dist/client/BookingMailingListNote-CCVXX1LN.mjs +0 -331
- package/dist/client/DemoPortalSignInLink-B9YrzZt2.mjs +0 -19
- package/dist/client/site-styles-CMCUxsIM.mjs +0 -3
- package/dist/client/useBookingNowIso-BDmWkYUW.mjs +0 -58
- package/dist/client/wizardSteps-DtkhwKXK.mjs +0 -6933
- package/dist/server/parseThemeForPersistence-CDrF51tJ.mjs +0 -52
|
@@ -1,31 +1,32 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { $t as MediaNodeServer, B as giftingBlockRuntime, Cn as
|
|
3
|
-
import {
|
|
4
|
-
import { $r as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
2
|
+
import { $t as MediaNodeServer, B as giftingBlockRuntime, Cn as publicMembershipProductCollectionSchema, Ct as buildEventCalendarInteractiveIslandProps, Dn as parseMailingListPlacementTargeting, En as assessMailingListTargeting, Et as eventCalendarBlockRuntime, F as buildNewsletterFormInteractiveIslandProps, H as publicGiftingOffersResponseSchema, I as newsletterBlockSubmissionMessage, Jt as listingEventCardProps, L as newsletterFormBlockRuntime, Mt as eventListingBlockRuntime, N as publicProductsResponseSchema, P as NEWSLETTER_SIGNUPS_PAUSED_MESSAGE, Sn as splitSiteChromePlacementClasses, U as buildFormInteractiveIslandProps, W as formBlockRuntime, Y as eventRegistrationBlockRuntime, _ as shopProductPresentation, a as buildShopInteractiveIslandProps, bt as buildEventCombinedListingDisplay, c as checkoutBlockRuntime, cn as formatEventPriceDisplay, ct as resolveOfferingsPreviewGroupCta, d as productDetailBlockRuntime, dn as normalizeEventStaffMemberId, en as getCardOrientation, fn as normalizeEventSurfacePresets, h as shopBlockRuntime, i as buildProductListInteractiveIslandProps, in as eventListWeekDays, jt as buildEventListingInteractiveIslandProps, kn as DEFAULT_MAILING_LIST_TARGETING, kt as recurringScheduleProjectionSchema, ln as normalizeEventCategoryIds, lt as resolveOfferingsPreviewGroups, mn as normalizeEventVenueId, n as buildCheckoutInteractiveIslandProps, nn as Grid, nt as OFFERINGS_PREVIEW_EVENT_PRESET_DEFINITIONS, o as cartBlockRuntime, on as formatEventPrice, ot as normalizeOfferingsPreviewItemLimit, p as productListBlockRuntime, pn as normalizeEventSurfaceScope, q as buildEventRegistrationInteractiveIslandProps, qt as catalogueEventCardProps, r as buildProductDetailInteractiveIslandProps, rn as buildEventListWeek, rt as buildOfferingsPreviewListing, st as offeringsListingFor, t as buildCartInteractiveIslandProps, tn as getContainerClass, un as normalizeEventScheduleScope, ut as resolveOfferingsRenderInput, vt as occurrenceContextSchema, wn as publicPassProductCollectionSchema, wt as buildEventCalendarListingDisplay, xt as eventCombinedBlockRuntime, yn as staticHeaderChromeRuntime, yt as buildEventCombinedInteractiveIslandProps, z as buildGiftingInteractiveIslandProps } from "./shop.interactive-C8OvFY06.mjs";
|
|
3
|
+
import { f as err, p as ok } from "./renderableMediaAssetAdmission-BlfqYLJW.mjs";
|
|
4
|
+
import { $r as resolveEventRegistrationScopedEvents, An as resolveRuntimeEventDestination, Br as BLOCK_BUTTON_ROLE_OPTIONS, Dn as formatTime, En as formatEventTimeRange, Hn as groupPublicEventsByRun, Hr as isBlockButtonRole, In as getEventAvailability, Ln as getEventAvailabilityStatus, Ma as nextLiveRunSessionStartMs, Mn as canJoinEventWaitlistOnAnyMode, Na as orderedLiveRunSessions, Oa as sanitizeHref, On as groupEventsByDate, Pa as resolveWholeSeriesBookingPhase, Qa as resolvePricingOptionsPriceDisplay, Qr as normalizeEventRegistrationPageSurfaceSubject, Si as compiledRuntimeStyleFieldNames, Sn as formatEventCompactDateRail, Wa as formatBookingPriceDisplay, Wn as buildBookingFormInteractiveIslandProps, Za as resolveExactOrFreePriceDisplay, _n as eventDateOptions, ii as listItemPresentation, ka as parseAspectRatioValue, mn as buildCalendarViewport, nn as RichText, oi as listLookSlot, pn as resolvePublicMediaUrl, rn as ImagePresets, si as lookListPresentationSchemaShape, ua as arrangementSlotNames, wn as formatEventHourLabel, ya as cardVariantRoleValues, yn as formatCalendarTitle, zn as isEventFull } from "./wizardSteps-CFulHWnT.mjs";
|
|
5
|
+
import { Ct as trimmedStringOrNull, E as arrangementModes, G as RichTextDocSchema, Jt as toUtcIsoDateTimeString, L as publicEventsArraySchema, Q as runtimeMediaSchema, St as toLocationCoordinates, Tt as formatDate, Wt as resolveBookingBusinessTimeZone, b as isEventCalendarListLayout, bt as projectPublicLocation, d as calendarWindowPageSchema, et as PUBLIC_FILE_FIELD_KINDS, g as eventCalendarVariantMeaning, h as eventCalendarListLayoutOptions, nt as mediaTypeDiscriminants, tt as isDisplayMediaKind, v as isEventCalendarDefaultView, vt as normalizeLocationAddressText, x as normalizeEventCalendarDisplayMode$1, xt as publicLocationSchema$1, y as isEventCalendarDisplayMode, yt as parseLocationValue } from "./noop-ByFRHYQ2.mjs";
|
|
6
|
+
import { O as assertNever$1 } from "./bookingQuestionValues-BjcyCru5.mjs";
|
|
7
7
|
import { t as formatEventDuration } from "./duration-Q6_QNgiv.mjs";
|
|
8
8
|
import { n as selectCategoryView } from "./appointment-service-categories-Cl2pqw-z.mjs";
|
|
9
|
-
import { a as CalendarRecurringWeek, c as LinkNode, d as LocationMapView, i as buildWeekBoardViewProps, l as RichTextNode, n as WeekBoardView, o as RecurringSchedule, r as buildWeekBoardNavigationState, s as ButtonNode, t as buildTimetableModel, u as TextNode } from "./timetableModel-
|
|
10
|
-
import { Ai as mergeStyles, Ar as arrangementModes, Di as backgroundColorStyle, Ia as runtimeMediaSchema, N as compiledRuntimeStyleFieldNames, Ni as textColorStyle, Ti as resolveThemeColorReferenceValue, Ut as cardVariantRoleValues, ct as ICON_CONFIG, ji as rgbColorValue, m as arrangementSlotNames, mi as serializeSurfaceTree } from "./site-styles-D56hT2u1.mjs";
|
|
9
|
+
import { a as CalendarRecurringWeek, c as LinkNode, d as LocationMapView, i as buildWeekBoardViewProps, l as RichTextNode, n as WeekBoardView, o as RecurringSchedule, r as buildWeekBoardNavigationState, s as ButtonNode, t as buildTimetableModel, u as TextNode } from "./timetableModel-Cko9LRKy.mjs";
|
|
11
10
|
import { d as formatDateKey, h as getWeekCalendarDayTuple, m as getOrderedDayNames } from "./src-1PJxc8KO.mjs";
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import { i as
|
|
16
|
-
import { n as
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
11
|
+
import { B as mergeStyles, F as resolveThemeColorReferenceValue, L as backgroundColorStyle, U as textColorStyle, V as rgbColorValue, o as serializeSurfaceTree } from "./accessibleSurfaces-chpD4C2c.mjs";
|
|
12
|
+
import { h as SYSTEM_BLOCK_KINDS } from "./types-5fOsPIpL.mjs";
|
|
13
|
+
import { C as asPartialObject, _ as DEFAULT_SECTION_SPACING, a as EventCard, c as boxStyleClassNames, d as normalizeBoxStylesBorder, f as resolveCardRoleForBoxStyles, i as EventCompactRow, r as EmptyState, t as EventListingFrameView } from "./EventListing.view-Bt2sBBms.mjs";
|
|
14
|
+
import { S as clsx, _ as FileAudioIcon, a as ThemedDownloadLink, b as MinusIcon, c as isSemanticIconId, d as ChevronDownIcon, f as CircleMinusIcon, g as FileArchiveIcon, i as ThemedButtonLink, l as SpinnerNode, p as CirclePlusIcon, r as ThemedButton, s as getIconComponent, u as ArrowDownIcon, v as FileSpreadsheetIcon, x as PlusIcon, y as FileTextIcon } from "./ThemedButton-BdnEwA38.mjs";
|
|
15
|
+
import { a as deriveEventScheduleSummary, i as eventCardListContent, n as resolveEventDetailsPresentation, o as derivePreviewRunSchedule, t as EventDetailsView } from "./view-448wvvEY.mjs";
|
|
16
|
+
import { n as resolveEventCta, r as resolveEventLinkProps } from "./cta-DP_IBnq3.mjs";
|
|
17
|
+
import { i as SvgNode, o as formatEventLocation } from "./MapDrawingSvg-13JQI7_z.mjs";
|
|
18
|
+
import { n as CardListItems, r as EventItem } from "./EventItem-BIc4gjiD.mjs";
|
|
19
|
+
import { c as CalendarDayHeaders, i as CombinedLookFrame, l as buildMonthDay, n as WeekAgendaView, o as MonthLookView, u as resolveMonthSelectedDay } from "./CalendarNavigationChevron-CNe3ZjdC.mjs";
|
|
19
20
|
import { t as resolveDedicatedBookingHref } from "./bookingRoute-Bqlyu5Vb.mjs";
|
|
20
21
|
import { t as FeedbackMessage } from "./FeedbackMessage-CSJrAuXH.mjs";
|
|
21
22
|
import { t as EVENT_REGISTRATION_ANCHOR_ID } from "./constants-4o4_hl34.mjs";
|
|
22
|
-
import { a as carouselShape, c as getCarouselSlidesToShowCssVars, i as carouselRegionAttributes, l as normalizeSlidesToShow, n as arrangementCarouselSettings, r as carouselContents, t as CarouselSlideContent, u as resolveSlidesToShowMobile } from "./carousel.shared-
|
|
23
|
-
import { t as coerceRichTextDoc } from "./richText-coerce-
|
|
24
|
-
import { a as PassPurchaseUnavailable, c as ProductDetailView, d as ShopPurchaseAction, f as VariantSelectView, i as PassCardView, l as ProductGalleryFrameView, n as CheckoutShellView, o as PassesMembershipsSectionView, r as MembershipCardView, s as ProductCardView, t as CartShellView, u as ProductListSectionView } from "./view-
|
|
25
|
-
import { n as EventListWeekNavigation, t as EventListWeekEmptyState } from "./EventListWeekNavigation-
|
|
26
|
-
import { i as RegistrationClosedState, r as BookingEntryCard, t as StepIndicator } from "./StepIndicator-
|
|
27
|
-
import { n as FormSubmitAction, t as FormFieldGroups } from "./form.parts-
|
|
28
|
-
import { a as partitionNewsletterFields, n as NewsletterSubmitRow, r as NewsletterTopicChips, t as NewsletterExtraField } from "./newsletter-form.parts-
|
|
23
|
+
import { a as carouselShape, c as getCarouselSlidesToShowCssVars, i as carouselRegionAttributes, l as normalizeSlidesToShow, n as arrangementCarouselSettings, r as carouselContents, t as CarouselSlideContent, u as resolveSlidesToShowMobile } from "./carousel.shared-BFQ3kBEw.mjs";
|
|
24
|
+
import { t as coerceRichTextDoc } from "./richText-coerce-C3LabQ1O.mjs";
|
|
25
|
+
import { a as PassPurchaseUnavailable, c as ProductDetailView, d as ShopPurchaseAction, f as VariantSelectView, i as PassCardView, l as ProductGalleryFrameView, n as CheckoutShellView, o as PassesMembershipsSectionView, r as MembershipCardView, s as ProductCardView, t as CartShellView, u as ProductListSectionView } from "./view-L_mkgtnk.mjs";
|
|
26
|
+
import { n as EventListWeekNavigation, t as EventListWeekEmptyState } from "./EventListWeekNavigation-a0QEIEf0.mjs";
|
|
27
|
+
import { i as RegistrationClosedState, r as BookingEntryCard, t as StepIndicator } from "./StepIndicator-CaN8snZ8.mjs";
|
|
28
|
+
import { n as FormSubmitAction, t as FormFieldGroups } from "./form.parts-DevF0L_A.mjs";
|
|
29
|
+
import { a as partitionNewsletterFields, n as NewsletterSubmitRow, r as NewsletterTopicChips, t as NewsletterExtraField } from "./newsletter-form.parts-Dg8s9NwJ.mjs";
|
|
29
30
|
import React, { forwardRef } from "react";
|
|
30
31
|
import { z } from "zod";
|
|
31
32
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -181,7 +182,15 @@ function parseWeeklyOpeningHours(value) {
|
|
|
181
182
|
});
|
|
182
183
|
}
|
|
183
184
|
//#endregion
|
|
184
|
-
//#region ../
|
|
185
|
+
//#region ../site-contracts/src/siteData/venues.ts
|
|
186
|
+
/** Additive map DTO; hidden venues retain only their public name and area. */
|
|
187
|
+
const publicVenueMapLocationSchema = publicLocationSchema$1.unwrap().extend({
|
|
188
|
+
name: z.string().optional(),
|
|
189
|
+
area: z.string().nullable().optional(),
|
|
190
|
+
addressWithBooking: z.boolean().optional()
|
|
191
|
+
}).readonly();
|
|
192
|
+
//#endregion
|
|
193
|
+
//#region ../core/src/links.ts
|
|
185
194
|
const nullableString = z.union([z.string().min(1), z.null()]);
|
|
186
195
|
const RESOLVED_INTERNAL_LINK_ENTITY_TYPES = [
|
|
187
196
|
"page",
|
|
@@ -243,1309 +252,594 @@ const linkSchema = z.union([
|
|
|
243
252
|
entryLinkSchema
|
|
244
253
|
]);
|
|
245
254
|
//#endregion
|
|
246
|
-
//#region ../
|
|
247
|
-
const
|
|
248
|
-
function createButtonVariantField(options = {}) {
|
|
249
|
-
return {
|
|
250
|
-
id: options.id ?? "buttonVariant",
|
|
251
|
-
type: "select",
|
|
252
|
-
label: options.label ?? "Button style",
|
|
253
|
-
description: options.description ?? "Choose a button style from your theme.",
|
|
254
|
-
required: false,
|
|
255
|
-
multiple: false,
|
|
256
|
-
defaultValue: options.defaultValue ?? "primary",
|
|
257
|
-
options: [...options.variants ?? DEFAULT_THEME_BUTTON_VARIANTS],
|
|
258
|
-
ui: {
|
|
259
|
-
intent: "style",
|
|
260
|
-
widget: "buttonVariant"
|
|
261
|
-
}
|
|
262
|
-
};
|
|
263
|
-
}
|
|
264
|
-
function createButtonGroup(options = {}) {
|
|
265
|
-
const { variants = BLOCK_BUTTON_ROLE_OPTIONS, defaultVariant, includeSize = true, defaultSize = "md", showGroupLabel = false, groupId = "button", groupLabel = "Button", flattenInRepeater = true } = options;
|
|
266
|
-
const mainFields = [
|
|
267
|
-
{
|
|
268
|
-
id: "label",
|
|
269
|
-
type: "text",
|
|
270
|
-
label: "Label",
|
|
271
|
-
required: true,
|
|
272
|
-
multiline: false,
|
|
273
|
-
maxLength: 40,
|
|
274
|
-
ui: { row: "primary" }
|
|
275
|
-
},
|
|
276
|
-
{
|
|
277
|
-
id: "link",
|
|
278
|
-
type: "link",
|
|
279
|
-
label: "Link",
|
|
280
|
-
required: true,
|
|
281
|
-
ui: { row: "primary" }
|
|
282
|
-
},
|
|
283
|
-
{
|
|
284
|
-
id: "variant",
|
|
285
|
-
type: "select",
|
|
286
|
-
label: "Style",
|
|
287
|
-
options: [...variants],
|
|
288
|
-
required: false,
|
|
289
|
-
multiple: false,
|
|
290
|
-
...defaultVariant ? { defaultValue: defaultVariant } : {},
|
|
291
|
-
ui: {
|
|
292
|
-
intent: "style",
|
|
293
|
-
underLooks: "owner",
|
|
294
|
-
widget: "buttonVariant"
|
|
295
|
-
}
|
|
296
|
-
},
|
|
297
|
-
...includeSize ? [{
|
|
298
|
-
id: "size",
|
|
299
|
-
type: "select",
|
|
300
|
-
label: "Size",
|
|
301
|
-
options: [
|
|
302
|
-
{
|
|
303
|
-
value: "sm",
|
|
304
|
-
label: "Small"
|
|
305
|
-
},
|
|
306
|
-
{
|
|
307
|
-
value: "md",
|
|
308
|
-
label: "Medium"
|
|
309
|
-
},
|
|
310
|
-
{
|
|
311
|
-
value: "lg",
|
|
312
|
-
label: "Large"
|
|
313
|
-
},
|
|
314
|
-
{
|
|
315
|
-
value: "xl",
|
|
316
|
-
label: "Extra large"
|
|
317
|
-
}
|
|
318
|
-
],
|
|
319
|
-
required: false,
|
|
320
|
-
multiple: false,
|
|
321
|
-
defaultValue: defaultSize,
|
|
322
|
-
ui: { intent: "style" }
|
|
323
|
-
}] : []
|
|
324
|
-
];
|
|
325
|
-
const iconFields = [{
|
|
326
|
-
id: "iconLeft",
|
|
327
|
-
type: "text",
|
|
328
|
-
label: "Left icon",
|
|
329
|
-
required: false,
|
|
330
|
-
multiline: false,
|
|
331
|
-
maxLength: 64,
|
|
332
|
-
ui: {
|
|
333
|
-
intent: "style",
|
|
334
|
-
underLooks: "owner",
|
|
335
|
-
widget: "iconPicker",
|
|
336
|
-
iconPickerPreset: "cta"
|
|
337
|
-
}
|
|
338
|
-
}, {
|
|
339
|
-
id: "iconRight",
|
|
340
|
-
type: "text",
|
|
341
|
-
label: "Right icon",
|
|
342
|
-
required: false,
|
|
343
|
-
multiline: false,
|
|
344
|
-
maxLength: 64,
|
|
345
|
-
ui: {
|
|
346
|
-
intent: "style",
|
|
347
|
-
underLooks: "owner",
|
|
348
|
-
widget: "iconPicker",
|
|
349
|
-
iconPickerPreset: "cta"
|
|
350
|
-
}
|
|
351
|
-
}];
|
|
352
|
-
return {
|
|
353
|
-
id: groupId,
|
|
354
|
-
type: "group",
|
|
355
|
-
label: groupLabel,
|
|
356
|
-
ui: {
|
|
357
|
-
layout: "grid",
|
|
358
|
-
columns: 2,
|
|
359
|
-
gridColsPreset: "simple2",
|
|
360
|
-
gridColumns: {
|
|
361
|
-
base: 1,
|
|
362
|
-
sm: 2
|
|
363
|
-
},
|
|
364
|
-
flattenInRepeater,
|
|
365
|
-
hideLabel: !showGroupLabel
|
|
366
|
-
},
|
|
367
|
-
schema: { fields: [...mainFields, ...iconFields] },
|
|
368
|
-
required: false
|
|
369
|
-
};
|
|
370
|
-
}
|
|
255
|
+
//#region ../site-contracts/src/blocks/iconVocabulary.ts
|
|
256
|
+
const ICON_PICKER_PRESETS = ["cta", "feature"];
|
|
371
257
|
//#endregion
|
|
372
|
-
//#region ../
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
const BACKGROUND_POSITION_PRESETS = [
|
|
378
|
-
{
|
|
379
|
-
value: "center",
|
|
380
|
-
label: "Centre"
|
|
381
|
-
},
|
|
382
|
-
{
|
|
383
|
-
value: "top",
|
|
384
|
-
label: "Top"
|
|
385
|
-
},
|
|
386
|
-
{
|
|
387
|
-
value: "top left",
|
|
388
|
-
label: "Top Left"
|
|
389
|
-
},
|
|
390
|
-
{
|
|
391
|
-
value: "top right",
|
|
392
|
-
label: "Top Right"
|
|
393
|
-
},
|
|
394
|
-
{
|
|
395
|
-
value: "bottom",
|
|
396
|
-
label: "Bottom"
|
|
397
|
-
},
|
|
398
|
-
{
|
|
399
|
-
value: "bottom left",
|
|
400
|
-
label: "Bottom Left"
|
|
401
|
-
},
|
|
402
|
-
{
|
|
403
|
-
value: "bottom right",
|
|
404
|
-
label: "Bottom Right"
|
|
405
|
-
},
|
|
406
|
-
{
|
|
407
|
-
value: "left",
|
|
408
|
-
label: "Left"
|
|
409
|
-
},
|
|
410
|
-
{
|
|
411
|
-
value: "right",
|
|
412
|
-
label: "Right"
|
|
413
|
-
},
|
|
414
|
-
{
|
|
415
|
-
value: "top center",
|
|
416
|
-
label: "Top Center"
|
|
417
|
-
},
|
|
418
|
-
{
|
|
419
|
-
value: "bottom center",
|
|
420
|
-
label: "Bottom Center"
|
|
421
|
-
},
|
|
422
|
-
{
|
|
423
|
-
value: "left center",
|
|
424
|
-
label: "Left Center"
|
|
425
|
-
},
|
|
426
|
-
{
|
|
427
|
-
value: "right center",
|
|
428
|
-
label: "Right Center"
|
|
429
|
-
},
|
|
430
|
-
{
|
|
431
|
-
value: "left top",
|
|
432
|
-
label: "Left Top"
|
|
433
|
-
},
|
|
434
|
-
{
|
|
435
|
-
value: "right top",
|
|
436
|
-
label: "Right Top"
|
|
437
|
-
},
|
|
438
|
-
{
|
|
439
|
-
value: "left bottom",
|
|
440
|
-
label: "Left Bottom"
|
|
441
|
-
},
|
|
442
|
-
{
|
|
443
|
-
value: "right bottom",
|
|
444
|
-
label: "Right Bottom"
|
|
445
|
-
}
|
|
258
|
+
//#region ../site-contracts/src/blocks/fieldUi.ts
|
|
259
|
+
const visibilityLevels = [
|
|
260
|
+
"admin",
|
|
261
|
+
"designer",
|
|
262
|
+
"author"
|
|
446
263
|
];
|
|
447
|
-
const
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
264
|
+
const siteOptionSources = [
|
|
265
|
+
"eventCategories",
|
|
266
|
+
"eventSeries",
|
|
267
|
+
"venues",
|
|
268
|
+
"staffMembers",
|
|
269
|
+
"appointmentServiceCategories"
|
|
270
|
+
];
|
|
271
|
+
const mediaDeliverySchema = z.object({
|
|
272
|
+
sizes: z.string().optional(),
|
|
273
|
+
widthCandidates: z.array(z.number().int().positive()).optional(),
|
|
274
|
+
maxCssWidth: z.number().positive().optional(),
|
|
275
|
+
maxCssHeight: z.number().positive().optional(),
|
|
276
|
+
strategy: z.enum([
|
|
277
|
+
"default",
|
|
278
|
+
"columnsAuto",
|
|
279
|
+
"imageGalleryVariant"
|
|
280
|
+
]).optional(),
|
|
281
|
+
strategyOptions: z.record(z.string(), z.unknown()).optional()
|
|
282
|
+
});
|
|
283
|
+
const visibleWhenPredicateSchema = z.object({
|
|
284
|
+
field: z.string().min(1),
|
|
285
|
+
equals: z.any().optional(),
|
|
286
|
+
notEquals: z.any().optional(),
|
|
287
|
+
oneOf: z.array(z.any()).optional(),
|
|
288
|
+
notIn: z.array(z.any()).optional(),
|
|
289
|
+
minItems: z.number().int().nonnegative().optional(),
|
|
290
|
+
maxItems: z.number().int().nonnegative().optional()
|
|
291
|
+
});
|
|
292
|
+
const visibleWhenSchema = z.lazy(() => z.union([
|
|
293
|
+
visibleWhenPredicateSchema,
|
|
294
|
+
z.object({ allOf: z.array(visibleWhenSchema).min(1) }),
|
|
295
|
+
z.object({ anyOf: z.array(visibleWhenSchema).min(1) })
|
|
296
|
+
]));
|
|
297
|
+
const uiSchema = z.object({
|
|
298
|
+
widget: z.string().optional(),
|
|
299
|
+
preset: z.enum(["disclosure"]).optional(),
|
|
300
|
+
flattenInRepeater: z.boolean().optional(),
|
|
301
|
+
hidden: z.boolean().optional(),
|
|
302
|
+
hideLabel: z.boolean().optional(),
|
|
303
|
+
hideDescription: z.boolean().optional(),
|
|
304
|
+
showCharCount: z.union([z.number().int().positive(), z.object({ max: z.number().int().positive() })]).optional(),
|
|
305
|
+
showSlugPreview: z.boolean().optional(),
|
|
306
|
+
variant: z.enum([
|
|
307
|
+
"full",
|
|
308
|
+
"inline",
|
|
309
|
+
"limited",
|
|
310
|
+
"media",
|
|
311
|
+
"notes"
|
|
312
|
+
]).optional(),
|
|
313
|
+
richTextVariant: z.enum([
|
|
314
|
+
"full",
|
|
315
|
+
"inline",
|
|
316
|
+
"limited",
|
|
317
|
+
"media",
|
|
318
|
+
"notes"
|
|
319
|
+
]).optional(),
|
|
320
|
+
cropEditorMode: z.enum(["dialog", "inline"]).optional(),
|
|
321
|
+
cropEditorAutoOpen: z.boolean().optional(),
|
|
322
|
+
mediaPickerAutoOpen: z.boolean().optional(),
|
|
323
|
+
showMediaPreview: z.boolean().optional(),
|
|
324
|
+
showMediaOverlayActions: z.boolean().optional(),
|
|
325
|
+
mediaPreviewMaxWidth: z.enum([
|
|
326
|
+
"xs",
|
|
327
|
+
"sm",
|
|
328
|
+
"md",
|
|
329
|
+
"none"
|
|
330
|
+
]).optional(),
|
|
331
|
+
preventMediaPreviewUpscale: z.boolean().optional(),
|
|
332
|
+
mediaDelivery: mediaDeliverySchema.optional(),
|
|
333
|
+
mediaDeliveryByVariant: z.record(z.string(), mediaDeliverySchema).optional(),
|
|
334
|
+
inputType: z.enum([
|
|
335
|
+
"text",
|
|
336
|
+
"email",
|
|
337
|
+
"tel",
|
|
338
|
+
"number"
|
|
339
|
+
]).optional(),
|
|
340
|
+
min: z.number().optional(),
|
|
341
|
+
max: z.number().optional(),
|
|
342
|
+
step: z.number().optional(),
|
|
343
|
+
showValue: z.boolean().optional(),
|
|
344
|
+
valueUnit: z.enum([
|
|
345
|
+
"percent",
|
|
346
|
+
"pixels",
|
|
347
|
+
"unitless"
|
|
348
|
+
]).optional(),
|
|
349
|
+
unsetValue: z.enum(["max", "field-default"]).optional(),
|
|
350
|
+
allowDirectInput: z.boolean().optional(),
|
|
351
|
+
pattern: z.string().optional(),
|
|
352
|
+
placeholder: z.string().optional(),
|
|
353
|
+
visibleWhen: visibleWhenSchema.optional(),
|
|
354
|
+
modalConfig: z.object({
|
|
355
|
+
buttonLabel: z.string().optional(),
|
|
356
|
+
description: z.string().optional(),
|
|
357
|
+
buttonVariant: z.enum(["default", "outline"]).optional(),
|
|
358
|
+
showCustomizedIndicator: z.boolean().optional(),
|
|
359
|
+
maxWidth: z.string().optional()
|
|
360
|
+
}).optional(),
|
|
361
|
+
allowedTypes: z.array(z.enum([
|
|
362
|
+
"color",
|
|
363
|
+
"gradient",
|
|
364
|
+
"image"
|
|
365
|
+
])).optional(),
|
|
366
|
+
fullWidth: z.boolean().optional(),
|
|
367
|
+
row: z.string().optional(),
|
|
368
|
+
colSpan: z.number().int().min(1).max(4).optional(),
|
|
369
|
+
layout: z.enum(["stack", "grid"]).optional(),
|
|
370
|
+
columns: z.number().int().min(2).max(4).optional(),
|
|
371
|
+
gridColsPreset: z.enum([
|
|
372
|
+
"simple2",
|
|
373
|
+
"simple3",
|
|
374
|
+
"simple4",
|
|
375
|
+
"buttonCtaRow"
|
|
376
|
+
]).optional(),
|
|
377
|
+
gridColumns: z.object({
|
|
378
|
+
base: z.number().int().min(1).max(4).optional(),
|
|
379
|
+
sm: z.number().int().min(1).max(4).optional(),
|
|
380
|
+
md: z.number().int().min(1).max(4).optional(),
|
|
381
|
+
lg: z.number().int().min(1).max(4).optional(),
|
|
382
|
+
xl: z.number().int().min(1).max(4).optional()
|
|
383
|
+
}).optional(),
|
|
384
|
+
gridColsClassName: z.string().optional(),
|
|
385
|
+
repeaterPreset: z.enum(["thumbnailGrid", "layoutGrid"]).optional(),
|
|
386
|
+
thumbnailField: z.string().optional(),
|
|
387
|
+
thumbnailAltField: z.string().optional(),
|
|
388
|
+
thumbnailLabelField: z.string().optional(),
|
|
389
|
+
thumbnailAspectRatio: z.string().optional(),
|
|
390
|
+
thumbnailCardDensity: z.enum(["compact", "comfortable"]).optional(),
|
|
391
|
+
layoutGridColumns: z.union([
|
|
392
|
+
z.literal(1),
|
|
393
|
+
z.literal(2),
|
|
394
|
+
z.literal(3),
|
|
395
|
+
z.literal(4),
|
|
396
|
+
z.literal(5),
|
|
397
|
+
z.literal(6)
|
|
398
|
+
]).optional(),
|
|
399
|
+
layoutGridColumnsFields: z.object({
|
|
400
|
+
base: z.string().optional(),
|
|
401
|
+
sm: z.string().optional(),
|
|
402
|
+
md: z.string().optional(),
|
|
403
|
+
lg: z.string().min(1),
|
|
404
|
+
xl: z.string().optional()
|
|
405
|
+
}).optional(),
|
|
406
|
+
layoutGridSpanField: z.string().optional(),
|
|
407
|
+
layoutGridStartNewRowField: z.string().optional(),
|
|
408
|
+
layoutGridRowField: z.string().optional(),
|
|
409
|
+
layoutGridColumnField: z.string().optional(),
|
|
410
|
+
layoutGridMaxRows: z.number().int().positive().optional(),
|
|
411
|
+
iconPickerPreset: z.enum(ICON_PICKER_PRESETS).optional(),
|
|
412
|
+
contentTypeField: z.string().optional(),
|
|
413
|
+
fixedContentType: z.string().optional(),
|
|
414
|
+
valueFrom: z.enum([
|
|
415
|
+
"id",
|
|
416
|
+
"identifier",
|
|
417
|
+
"slug"
|
|
418
|
+
]).optional(),
|
|
419
|
+
siteOptionSource: z.enum(siteOptionSources).optional(),
|
|
420
|
+
searchThreshold: z.number().int().positive().optional(),
|
|
421
|
+
renderInHeader: z.boolean().optional(),
|
|
422
|
+
intent: z.enum([
|
|
423
|
+
"content",
|
|
424
|
+
"display",
|
|
425
|
+
"behavior",
|
|
426
|
+
"style"
|
|
427
|
+
]).optional(),
|
|
428
|
+
/**
|
|
429
|
+
* Under an arrangement Look, `display` and `style` fields belong to the
|
|
430
|
+
* Look. `'owner'` keeps a presentation choice with the owner anyway, such
|
|
431
|
+
* as primary or secondary on a button they added.
|
|
432
|
+
*/
|
|
433
|
+
underLooks: z.literal("owner").optional(),
|
|
434
|
+
valueContract: z.enum(["boxBackground", "location"]).optional()
|
|
435
|
+
}).partial().superRefine((ui, ctx) => {
|
|
436
|
+
if (ui.layoutGridColumns !== void 0 && ui.layoutGridColumnsFields !== void 0) ctx.addIssue({
|
|
437
|
+
code: "custom",
|
|
438
|
+
path: ["layoutGridColumns"],
|
|
439
|
+
message: "Layout-grid requires exactly one of ui.layoutGridColumns or ui.layoutGridColumnsFields.lg; do not set both"
|
|
440
|
+
});
|
|
441
|
+
}).transform((input) => {
|
|
442
|
+
const { layoutGridColumns, layoutGridColumnsFields, ...ui } = input;
|
|
443
|
+
if (layoutGridColumns !== void 0) return {
|
|
444
|
+
...ui,
|
|
445
|
+
layoutGridColumns
|
|
446
|
+
};
|
|
447
|
+
if (layoutGridColumnsFields !== void 0) return {
|
|
448
|
+
...ui,
|
|
449
|
+
layoutGridColumnsFields
|
|
502
450
|
};
|
|
451
|
+
return ui;
|
|
452
|
+
});
|
|
453
|
+
const baseFieldSchema = z.object({
|
|
454
|
+
id: z.string().min(1, "Field id is required"),
|
|
455
|
+
label: z.string().min(1, "Field label is required"),
|
|
456
|
+
description: z.string().optional(),
|
|
457
|
+
visibleRoles: z.array(z.enum(visibilityLevels)).optional(),
|
|
458
|
+
defaultValue: z.any().optional(),
|
|
459
|
+
required: z.boolean().default(false),
|
|
460
|
+
ui: uiSchema.optional()
|
|
461
|
+
});
|
|
462
|
+
function resolveRepeaterGridSpanFieldId(options) {
|
|
463
|
+
return trimmedStringOrNull(options?.id) ?? "gridSpan";
|
|
503
464
|
}
|
|
504
|
-
function
|
|
505
|
-
return
|
|
465
|
+
function resolveRepeaterGridRowFieldId(options) {
|
|
466
|
+
return trimmedStringOrNull(options?.id) ?? "gridRow";
|
|
506
467
|
}
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
* with Color/Gradient/Image tabs and advanced media options.
|
|
510
|
-
*
|
|
511
|
-
* ## Data Structure
|
|
512
|
-
*
|
|
513
|
-
* This factory sets `activeTabField: 'type'`. The 'type' field is NOT explicitly
|
|
514
|
-
* declared but is managed implicitly by TabGroupField. When the user switches tabs,
|
|
515
|
-
* the widget writes the tab ID to the path `{id}.type`.
|
|
516
|
-
*
|
|
517
|
-
* Persistence projects the selected tab into the canonical discriminated
|
|
518
|
-
* `BackgroundContent` union. Fields owned by inactive tabs are not stored.
|
|
519
|
-
*
|
|
520
|
-
* ## SDK Filtering
|
|
521
|
-
*
|
|
522
|
-
* Each tab has an `sdkSectionOption` that allows SDK sites to control tab visibility:
|
|
523
|
-
* - `backgroundColor` - Controls Color tab
|
|
524
|
-
* - `backgroundGradient` - Controls Gradient tab
|
|
525
|
-
* - `backgroundImage` - Controls Image tab
|
|
526
|
-
*
|
|
527
|
-
* @param options - Configuration options
|
|
528
|
-
* @param options.id - Field ID (default: 'background')
|
|
529
|
-
* @param options.label - Field label (default: 'Background')
|
|
530
|
-
* @param options.allowColor - Include Color tab (default: true)
|
|
531
|
-
* @param options.allowGradient - Include Gradient tab (default: true)
|
|
532
|
-
* @param options.allowImage - Include Image tab (default: true)
|
|
533
|
-
* @param options.includeAdvanced - Include advanced image/video options (default: false)
|
|
534
|
-
*/
|
|
535
|
-
function createBackgroundField(options = {}) {
|
|
536
|
-
const { id = "background", label = "Background", allowColor = true, allowGradient = true, allowImage = true, includeAdvanced = false } = options;
|
|
537
|
-
const tabs = [];
|
|
538
|
-
const textColorField = {
|
|
539
|
-
id: "textColor",
|
|
540
|
-
type: "text",
|
|
541
|
-
label: "Text color",
|
|
542
|
-
description: "Optional text color token to use on top of this background.",
|
|
543
|
-
required: false,
|
|
544
|
-
multiline: false,
|
|
545
|
-
ui: { widget: BACKGROUND_WIDGETS.COLOR }
|
|
546
|
-
};
|
|
547
|
-
const headingColorField = {
|
|
548
|
-
id: "headingColor",
|
|
549
|
-
type: "text",
|
|
550
|
-
label: "Heading color",
|
|
551
|
-
description: "Optional color token for headings. Falls back to text color if not set.",
|
|
552
|
-
required: false,
|
|
553
|
-
multiline: false,
|
|
554
|
-
ui: { widget: BACKGROUND_WIDGETS.COLOR }
|
|
555
|
-
};
|
|
556
|
-
if (allowColor) tabs.push({
|
|
557
|
-
id: "color",
|
|
558
|
-
label: "Color",
|
|
559
|
-
description: "Solid color background using theme tokens or custom colors",
|
|
560
|
-
sdkSectionOption: "backgroundColor",
|
|
561
|
-
fields: [
|
|
562
|
-
{
|
|
563
|
-
id: "color",
|
|
564
|
-
type: "text",
|
|
565
|
-
label: "Color",
|
|
566
|
-
description: "Select a background color from the available options.",
|
|
567
|
-
required: false,
|
|
568
|
-
multiline: false,
|
|
569
|
-
ui: { widget: BACKGROUND_WIDGETS.COLOR }
|
|
570
|
-
},
|
|
571
|
-
textColorField,
|
|
572
|
-
headingColorField
|
|
573
|
-
]
|
|
574
|
-
});
|
|
575
|
-
if (allowGradient) tabs.push({
|
|
576
|
-
id: "gradient",
|
|
577
|
-
label: "Gradient",
|
|
578
|
-
description: "CSS gradient background",
|
|
579
|
-
sdkSectionOption: "backgroundGradient",
|
|
580
|
-
fields: [
|
|
581
|
-
{
|
|
582
|
-
id: "gradient",
|
|
583
|
-
type: "text",
|
|
584
|
-
label: "Gradient",
|
|
585
|
-
description: "Select a gradient from theme presets.",
|
|
586
|
-
required: false,
|
|
587
|
-
multiline: false,
|
|
588
|
-
ui: { widget: BACKGROUND_WIDGETS.GRADIENT }
|
|
589
|
-
},
|
|
590
|
-
textColorField,
|
|
591
|
-
headingColorField
|
|
592
|
-
]
|
|
593
|
-
});
|
|
594
|
-
if (allowImage) {
|
|
595
|
-
const mediaFields = [
|
|
596
|
-
{
|
|
597
|
-
id: BACKGROUND_MEDIA_FIELD_ID,
|
|
598
|
-
type: "media",
|
|
599
|
-
label: "Image",
|
|
600
|
-
mediaKinds: ["image"],
|
|
601
|
-
required: false
|
|
602
|
-
},
|
|
603
|
-
textColorField,
|
|
604
|
-
headingColorField
|
|
605
|
-
];
|
|
606
|
-
if (includeAdvanced) {
|
|
607
|
-
const objectFitField = {
|
|
608
|
-
id: "objectFit",
|
|
609
|
-
type: "select",
|
|
610
|
-
label: "Media sizing",
|
|
611
|
-
description: "How the image or video should be sized and positioned.",
|
|
612
|
-
required: false,
|
|
613
|
-
multiple: false,
|
|
614
|
-
options: [
|
|
615
|
-
{
|
|
616
|
-
value: "fill",
|
|
617
|
-
label: "Fill (cover)"
|
|
618
|
-
},
|
|
619
|
-
{
|
|
620
|
-
value: "fit",
|
|
621
|
-
label: "Fit (contain)"
|
|
622
|
-
},
|
|
623
|
-
{
|
|
624
|
-
value: "original",
|
|
625
|
-
label: "Original size"
|
|
626
|
-
},
|
|
627
|
-
{
|
|
628
|
-
value: "custom",
|
|
629
|
-
label: "Scale up"
|
|
630
|
-
}
|
|
631
|
-
]
|
|
632
|
-
};
|
|
633
|
-
const scaleField = {
|
|
634
|
-
id: "scale",
|
|
635
|
-
type: "presetOrCustom",
|
|
636
|
-
label: "Scale",
|
|
637
|
-
description: "Media scale amount.",
|
|
638
|
-
required: false,
|
|
639
|
-
ui: { visibleWhen: {
|
|
640
|
-
field: "objectFit",
|
|
641
|
-
equals: "custom"
|
|
642
|
-
} },
|
|
643
|
-
presets: [
|
|
644
|
-
{
|
|
645
|
-
value: "125",
|
|
646
|
-
label: "125%"
|
|
647
|
-
},
|
|
648
|
-
{
|
|
649
|
-
value: "150",
|
|
650
|
-
label: "150%"
|
|
651
|
-
},
|
|
652
|
-
{
|
|
653
|
-
value: "175",
|
|
654
|
-
label: "175%"
|
|
655
|
-
},
|
|
656
|
-
{
|
|
657
|
-
value: "200",
|
|
658
|
-
label: "200%"
|
|
659
|
-
}
|
|
660
|
-
],
|
|
661
|
-
customInput: {
|
|
662
|
-
placeholder: "e.g., 800px, 50vw, 175%",
|
|
663
|
-
helpText: "Enter a custom size using %, px, vh, vw, rem, or em units"
|
|
664
|
-
}
|
|
665
|
-
};
|
|
666
|
-
const positionField = {
|
|
667
|
-
id: "position",
|
|
668
|
-
type: "presetOrCustom",
|
|
669
|
-
label: "Position",
|
|
670
|
-
description: "Anchor point for scaled media. For \"Fill\" mode, the media focus point (if set) takes precedence.",
|
|
671
|
-
required: false,
|
|
672
|
-
presets: [...BACKGROUND_POSITION_PRESETS],
|
|
673
|
-
customInput: {
|
|
674
|
-
placeholder: "e.g., 25% 75%, top 20px left 50px",
|
|
675
|
-
helpText: "Enter a custom CSS background-position value"
|
|
676
|
-
}
|
|
677
|
-
};
|
|
678
|
-
const opacityField = {
|
|
679
|
-
id: "opacity",
|
|
680
|
-
type: "number",
|
|
681
|
-
label: "Opacity",
|
|
682
|
-
description: "Image or video opacity (0-100).",
|
|
683
|
-
required: false,
|
|
684
|
-
ui: {
|
|
685
|
-
widget: "slider",
|
|
686
|
-
min: 0,
|
|
687
|
-
max: 100,
|
|
688
|
-
step: 5
|
|
689
|
-
}
|
|
690
|
-
};
|
|
691
|
-
const overlayTypeField = {
|
|
692
|
-
id: "overlay.type",
|
|
693
|
-
type: "select",
|
|
694
|
-
label: "Overlay",
|
|
695
|
-
description: "Add a color or gradient overlay on top of the image or video.",
|
|
696
|
-
required: false,
|
|
697
|
-
multiple: false,
|
|
698
|
-
options: [
|
|
699
|
-
{
|
|
700
|
-
value: "none",
|
|
701
|
-
label: "None"
|
|
702
|
-
},
|
|
703
|
-
{
|
|
704
|
-
value: "color",
|
|
705
|
-
label: "Color"
|
|
706
|
-
},
|
|
707
|
-
{
|
|
708
|
-
value: "gradient",
|
|
709
|
-
label: "Gradient"
|
|
710
|
-
}
|
|
711
|
-
]
|
|
712
|
-
};
|
|
713
|
-
const overlayColorField = {
|
|
714
|
-
id: "overlay.color",
|
|
715
|
-
type: "text",
|
|
716
|
-
label: "Overlay color",
|
|
717
|
-
required: false,
|
|
718
|
-
multiline: false,
|
|
719
|
-
ui: {
|
|
720
|
-
widget: BACKGROUND_WIDGETS.COLOR,
|
|
721
|
-
visibleWhen: {
|
|
722
|
-
field: "type",
|
|
723
|
-
equals: "color"
|
|
724
|
-
}
|
|
725
|
-
}
|
|
726
|
-
};
|
|
727
|
-
const overlayGradientField = {
|
|
728
|
-
id: "overlay.gradient",
|
|
729
|
-
type: "text",
|
|
730
|
-
label: "Overlay gradient",
|
|
731
|
-
required: false,
|
|
732
|
-
multiline: false,
|
|
733
|
-
ui: {
|
|
734
|
-
widget: BACKGROUND_WIDGETS.GRADIENT,
|
|
735
|
-
visibleWhen: {
|
|
736
|
-
field: "type",
|
|
737
|
-
equals: "gradient"
|
|
738
|
-
}
|
|
739
|
-
}
|
|
740
|
-
};
|
|
741
|
-
mediaFields.push(objectFitField, scaleField, positionField, opacityField, overlayTypeField, overlayColorField, overlayGradientField, {
|
|
742
|
-
id: "overlay.opacity",
|
|
743
|
-
type: "number",
|
|
744
|
-
label: "Overlay opacity",
|
|
745
|
-
description: "Overlay opacity (0-100).",
|
|
746
|
-
required: false,
|
|
747
|
-
ui: {
|
|
748
|
-
widget: "slider",
|
|
749
|
-
min: 0,
|
|
750
|
-
max: 100,
|
|
751
|
-
step: 5,
|
|
752
|
-
visibleWhen: {
|
|
753
|
-
field: "type",
|
|
754
|
-
oneOf: ["color", "gradient"]
|
|
755
|
-
}
|
|
756
|
-
}
|
|
757
|
-
});
|
|
758
|
-
}
|
|
759
|
-
tabs.push({
|
|
760
|
-
id: "image",
|
|
761
|
-
label: "Image",
|
|
762
|
-
description: mediaTabDescription("image", includeAdvanced),
|
|
763
|
-
sdkSectionOption: "backgroundImage",
|
|
764
|
-
fields: mediaFields
|
|
765
|
-
});
|
|
766
|
-
const videoFields = mediaFields.map((field) => {
|
|
767
|
-
const clonedField = cloneFieldDefinition$1(field);
|
|
768
|
-
if (clonedField.id !== BACKGROUND_MEDIA_FIELD_ID) return clonedField;
|
|
769
|
-
return {
|
|
770
|
-
...clonedField,
|
|
771
|
-
label: "Video",
|
|
772
|
-
mediaKinds: ["video"]
|
|
773
|
-
};
|
|
774
|
-
});
|
|
775
|
-
videoFields.splice(1, 0, {
|
|
776
|
-
id: "showVideoOnMobile",
|
|
777
|
-
type: "boolean",
|
|
778
|
-
label: "Show video on mobile",
|
|
779
|
-
description: "Off by default so mobile visitors see the fallback background instead of autoplay video.",
|
|
780
|
-
required: false,
|
|
781
|
-
defaultValue: false
|
|
782
|
-
});
|
|
783
|
-
tabs.push({
|
|
784
|
-
id: "video",
|
|
785
|
-
label: "Video",
|
|
786
|
-
description: mediaTabDescription("video", includeAdvanced),
|
|
787
|
-
sdkSectionOption: "backgroundImage",
|
|
788
|
-
fields: videoFields
|
|
789
|
-
});
|
|
790
|
-
}
|
|
791
|
-
return {
|
|
792
|
-
id,
|
|
793
|
-
type: "tabGroup",
|
|
794
|
-
label,
|
|
795
|
-
required: false,
|
|
796
|
-
tabs,
|
|
797
|
-
activeTabField: "type",
|
|
798
|
-
ui: {
|
|
799
|
-
hideLabel: false,
|
|
800
|
-
valueContract: "boxBackground"
|
|
801
|
-
}
|
|
802
|
-
};
|
|
803
|
-
}
|
|
804
|
-
//#endregion
|
|
805
|
-
//#region ../blocks/src/system/fields/boxStyles.ts
|
|
806
|
-
/**
|
|
807
|
-
* Internal helper to create box styles with depth (container or card).
|
|
808
|
-
*
|
|
809
|
-
* Both containers and cards support:
|
|
810
|
-
* - Background (color/gradient/image with advanced options)
|
|
811
|
-
* - Inner spacing (padding)
|
|
812
|
-
* - Raised (elevation shadow)
|
|
813
|
-
* - Rounded corners (border radius)
|
|
814
|
-
*
|
|
815
|
-
* This function is used internally by `containerStylesField()` and `cardStylesField()`
|
|
816
|
-
* to avoid code duplication while maintaining separate public APIs.
|
|
817
|
-
*
|
|
818
|
-
* @internal
|
|
819
|
-
* @param type - Box style type discriminator ('container' or 'card')
|
|
820
|
-
* @param options - Customization options passed from public field helpers
|
|
821
|
-
* @returns A modal FieldDefinition with depth-specific fields
|
|
822
|
-
*/
|
|
823
|
-
function createBoxStylesFieldWithDepth(type, options = {}) {
|
|
824
|
-
const defaults = {
|
|
825
|
-
container: {
|
|
826
|
-
id: "_containerStyles",
|
|
827
|
-
label: "Container styles",
|
|
828
|
-
contextName: "container"
|
|
829
|
-
},
|
|
830
|
-
card: {
|
|
831
|
-
id: "_cardStyles",
|
|
832
|
-
label: "Card styles",
|
|
833
|
-
contextName: "card"
|
|
834
|
-
}
|
|
835
|
-
};
|
|
836
|
-
const { id = defaults[type].id, label = defaults[type].label, includeBackground = true, renderInHeader, intent } = options;
|
|
837
|
-
const contextName = defaults[type].contextName;
|
|
838
|
-
const fields = [];
|
|
839
|
-
if (includeBackground) fields.push(createBackgroundField({
|
|
840
|
-
id: "background",
|
|
841
|
-
label: "Background",
|
|
842
|
-
allowColor: true,
|
|
843
|
-
allowGradient: true,
|
|
844
|
-
allowImage: true,
|
|
845
|
-
includeAdvanced: true
|
|
846
|
-
}));
|
|
847
|
-
fields.push({
|
|
848
|
-
id: "spacing",
|
|
849
|
-
type: "select",
|
|
850
|
-
label: "Inner spacing",
|
|
851
|
-
description: `Space inside the ${contextName}, around its content.`,
|
|
852
|
-
required: false,
|
|
853
|
-
multiple: false,
|
|
854
|
-
options: [
|
|
855
|
-
{
|
|
856
|
-
value: "none",
|
|
857
|
-
label: "None"
|
|
858
|
-
},
|
|
859
|
-
{
|
|
860
|
-
value: "compact",
|
|
861
|
-
label: "Compact"
|
|
862
|
-
},
|
|
863
|
-
{
|
|
864
|
-
value: "cozy",
|
|
865
|
-
label: "Cosy"
|
|
866
|
-
},
|
|
867
|
-
{
|
|
868
|
-
value: "medium",
|
|
869
|
-
label: "Medium"
|
|
870
|
-
},
|
|
871
|
-
{
|
|
872
|
-
value: "comfortable",
|
|
873
|
-
label: "Comfortable"
|
|
874
|
-
},
|
|
875
|
-
{
|
|
876
|
-
value: "spacious",
|
|
877
|
-
label: "Spacious"
|
|
878
|
-
}
|
|
879
|
-
]
|
|
880
|
-
});
|
|
881
|
-
if (type === "card") fields.push({
|
|
882
|
-
id: "border",
|
|
883
|
-
type: "group",
|
|
884
|
-
label: "Border",
|
|
885
|
-
required: false,
|
|
886
|
-
schema: { fields: [
|
|
887
|
-
{
|
|
888
|
-
id: "enabled",
|
|
889
|
-
type: "boolean",
|
|
890
|
-
label: "Show border",
|
|
891
|
-
description: "If you don't set this, the card uses your site style's border.",
|
|
892
|
-
required: false
|
|
893
|
-
},
|
|
894
|
-
{
|
|
895
|
-
id: "width",
|
|
896
|
-
type: "select",
|
|
897
|
-
label: "Border width",
|
|
898
|
-
required: false,
|
|
899
|
-
multiple: false,
|
|
900
|
-
options: [
|
|
901
|
-
{
|
|
902
|
-
value: "none",
|
|
903
|
-
label: "None"
|
|
904
|
-
},
|
|
905
|
-
{
|
|
906
|
-
value: "1",
|
|
907
|
-
label: "Thin (1px)"
|
|
908
|
-
},
|
|
909
|
-
{
|
|
910
|
-
value: "2",
|
|
911
|
-
label: "Medium (2px)"
|
|
912
|
-
},
|
|
913
|
-
{
|
|
914
|
-
value: "3",
|
|
915
|
-
label: "Thick (3px)"
|
|
916
|
-
}
|
|
917
|
-
],
|
|
918
|
-
ui: { visibleWhen: {
|
|
919
|
-
field: "enabled",
|
|
920
|
-
equals: true
|
|
921
|
-
} }
|
|
922
|
-
},
|
|
923
|
-
{
|
|
924
|
-
id: "colorToken",
|
|
925
|
-
type: "text",
|
|
926
|
-
label: "Border colour",
|
|
927
|
-
description: "A colour name from your site style, such as border or primary.",
|
|
928
|
-
required: false,
|
|
929
|
-
multiline: false,
|
|
930
|
-
defaultValue: "border",
|
|
931
|
-
ui: { visibleWhen: {
|
|
932
|
-
field: "enabled",
|
|
933
|
-
equals: true
|
|
934
|
-
} }
|
|
935
|
-
}
|
|
936
|
-
] }
|
|
937
|
-
});
|
|
938
|
-
fields.push({
|
|
939
|
-
id: "raised",
|
|
940
|
-
type: "boolean",
|
|
941
|
-
label: "Raised",
|
|
942
|
-
description: `Adds a soft shadow so the ${contextName} lifts off the page.`,
|
|
943
|
-
required: false
|
|
944
|
-
});
|
|
945
|
-
fields.push({
|
|
946
|
-
id: "rounded",
|
|
947
|
-
type: "select",
|
|
948
|
-
label: "Rounded corners",
|
|
949
|
-
description: "How rounded the corners are.",
|
|
950
|
-
required: false,
|
|
951
|
-
multiple: false,
|
|
952
|
-
options: [
|
|
953
|
-
{
|
|
954
|
-
value: "none",
|
|
955
|
-
label: "None"
|
|
956
|
-
},
|
|
957
|
-
{
|
|
958
|
-
value: "sm",
|
|
959
|
-
label: "Small"
|
|
960
|
-
},
|
|
961
|
-
{
|
|
962
|
-
value: "md",
|
|
963
|
-
label: "Medium"
|
|
964
|
-
},
|
|
965
|
-
{
|
|
966
|
-
value: "lg",
|
|
967
|
-
label: "Large"
|
|
968
|
-
},
|
|
969
|
-
{
|
|
970
|
-
value: "xl",
|
|
971
|
-
label: "Extra large"
|
|
972
|
-
},
|
|
973
|
-
{
|
|
974
|
-
value: "2xl",
|
|
975
|
-
label: "Extra extra large"
|
|
976
|
-
},
|
|
977
|
-
{
|
|
978
|
-
value: "full",
|
|
979
|
-
label: "Fully rounded"
|
|
980
|
-
}
|
|
981
|
-
]
|
|
982
|
-
});
|
|
983
|
-
if (type === "container") fields.push({
|
|
984
|
-
id: "fullWidth",
|
|
985
|
-
type: "boolean",
|
|
986
|
-
label: "Full width",
|
|
987
|
-
description: "Stretches the content right to the edges of the screen.",
|
|
988
|
-
required: false,
|
|
989
|
-
defaultValue: false
|
|
990
|
-
});
|
|
991
|
-
return {
|
|
992
|
-
id,
|
|
993
|
-
type: "modal",
|
|
994
|
-
label,
|
|
995
|
-
required: false,
|
|
996
|
-
schema: { fields },
|
|
997
|
-
ui: {
|
|
998
|
-
...typeof renderInHeader === "boolean" ? { renderInHeader } : {},
|
|
999
|
-
...intent ? { intent } : {},
|
|
1000
|
-
modalConfig: {
|
|
1001
|
-
buttonLabel: label,
|
|
1002
|
-
description: `Configure background, spacing, elevation, and rounded corners for the ${contextName}.`,
|
|
1003
|
-
buttonVariant: "outline",
|
|
1004
|
-
showCustomizedIndicator: true
|
|
1005
|
-
}
|
|
1006
|
-
}
|
|
1007
|
-
};
|
|
1008
|
-
}
|
|
1009
|
-
function sectionStylesField(options = {}) {
|
|
1010
|
-
const { id = "_sectionStyles", label = "Section styles", includeBackground = true, allowBackgroundColor = true, allowBackgroundGradient = true, allowBackgroundImage = true, includeAdvancedBackground = true, renderInHeader = true } = options;
|
|
1011
|
-
const fields = [];
|
|
1012
|
-
if (includeBackground) fields.push(createBackgroundField({
|
|
1013
|
-
id: "background",
|
|
1014
|
-
label: "Background",
|
|
1015
|
-
allowColor: allowBackgroundColor,
|
|
1016
|
-
allowGradient: allowBackgroundGradient,
|
|
1017
|
-
allowImage: allowBackgroundImage,
|
|
1018
|
-
includeAdvanced: includeAdvancedBackground
|
|
1019
|
-
}));
|
|
1020
|
-
fields.push({
|
|
1021
|
-
id: "spacing",
|
|
1022
|
-
type: "select",
|
|
1023
|
-
label: "Inner spacing",
|
|
1024
|
-
description: "Space above and below the section.",
|
|
1025
|
-
required: false,
|
|
1026
|
-
multiple: false,
|
|
1027
|
-
options: [
|
|
1028
|
-
{
|
|
1029
|
-
value: "none",
|
|
1030
|
-
label: "None"
|
|
1031
|
-
},
|
|
1032
|
-
{
|
|
1033
|
-
value: "compact",
|
|
1034
|
-
label: "Compact"
|
|
1035
|
-
},
|
|
1036
|
-
{
|
|
1037
|
-
value: "cozy",
|
|
1038
|
-
label: "Cosy"
|
|
1039
|
-
},
|
|
1040
|
-
{
|
|
1041
|
-
value: "medium",
|
|
1042
|
-
label: "Medium"
|
|
1043
|
-
},
|
|
1044
|
-
{
|
|
1045
|
-
value: "comfortable",
|
|
1046
|
-
label: "Comfortable"
|
|
1047
|
-
},
|
|
1048
|
-
{
|
|
1049
|
-
value: "spacious",
|
|
1050
|
-
label: "Spacious"
|
|
1051
|
-
}
|
|
1052
|
-
]
|
|
1053
|
-
});
|
|
1054
|
-
return {
|
|
1055
|
-
id,
|
|
1056
|
-
type: "modal",
|
|
1057
|
-
label,
|
|
1058
|
-
required: false,
|
|
1059
|
-
schema: { fields },
|
|
1060
|
-
ui: {
|
|
1061
|
-
renderInHeader,
|
|
1062
|
-
intent: "style",
|
|
1063
|
-
modalConfig: {
|
|
1064
|
-
buttonLabel: label,
|
|
1065
|
-
description: "Configure background and spacing for this section.",
|
|
1066
|
-
buttonVariant: "outline",
|
|
1067
|
-
showCustomizedIndicator: true
|
|
1068
|
-
}
|
|
1069
|
-
}
|
|
1070
|
-
};
|
|
1071
|
-
}
|
|
1072
|
-
function containerStylesField(options = {}) {
|
|
1073
|
-
return createBoxStylesFieldWithDepth("container", options);
|
|
1074
|
-
}
|
|
1075
|
-
function cardStylesField(options = {}) {
|
|
1076
|
-
if (options.controls === "role-only") return createRoleOnlyCardStylesField(options);
|
|
1077
|
-
return createBoxStylesFieldWithDepth("card", options);
|
|
1078
|
-
}
|
|
1079
|
-
function createRoleOnlyCardStylesField(options) {
|
|
1080
|
-
const { id = "_cardStyles", label = "Card styles", renderInHeader, intent } = options;
|
|
1081
|
-
return {
|
|
1082
|
-
id,
|
|
1083
|
-
type: "modal",
|
|
1084
|
-
label,
|
|
1085
|
-
required: false,
|
|
1086
|
-
schema: { fields: [{
|
|
1087
|
-
id: "role",
|
|
1088
|
-
type: "select",
|
|
1089
|
-
label: "Card style",
|
|
1090
|
-
description: "Choose a semantic card style from the active site style.",
|
|
1091
|
-
required: false,
|
|
1092
|
-
multiple: false,
|
|
1093
|
-
defaultValue: "default",
|
|
1094
|
-
options: cardVariantRoleValues.map((value) => ({
|
|
1095
|
-
value,
|
|
1096
|
-
label: value === "default" ? "Default" : "Alternative"
|
|
1097
|
-
}))
|
|
1098
|
-
}] },
|
|
1099
|
-
ui: {
|
|
1100
|
-
...typeof renderInHeader === "boolean" ? { renderInHeader } : {},
|
|
1101
|
-
...intent ? { intent } : {},
|
|
1102
|
-
modalConfig: {
|
|
1103
|
-
buttonLabel: label,
|
|
1104
|
-
description: "Choose the site-style card role.",
|
|
1105
|
-
buttonVariant: "outline",
|
|
1106
|
-
showCustomizedIndicator: true
|
|
1107
|
-
}
|
|
1108
|
-
}
|
|
1109
|
-
};
|
|
1110
|
-
}
|
|
1111
|
-
//#endregion
|
|
1112
|
-
//#region ../blocks/src/system/blocks/events/shared/fields.ts
|
|
1113
|
-
/**
|
|
1114
|
-
* Shared card styling fields for event blocks
|
|
1115
|
-
*/
|
|
1116
|
-
const cardStylingFields = [
|
|
1117
|
-
cardStylesField({
|
|
1118
|
-
id: "_cardStyles",
|
|
1119
|
-
label: "Card style",
|
|
1120
|
-
controls: "role-only",
|
|
1121
|
-
renderInHeader: false,
|
|
1122
|
-
intent: "style"
|
|
1123
|
-
}),
|
|
1124
|
-
createButtonVariantField({ description: "Choose a button style from your theme" }),
|
|
1125
|
-
{
|
|
1126
|
-
id: "buttonText",
|
|
1127
|
-
type: "text",
|
|
1128
|
-
label: "Button text",
|
|
1129
|
-
description: "The text on each event's button.",
|
|
1130
|
-
required: false,
|
|
1131
|
-
multiline: false,
|
|
1132
|
-
defaultValue: "Book",
|
|
1133
|
-
maxLength: 40
|
|
1134
|
-
}
|
|
1135
|
-
];
|
|
1136
|
-
/**
|
|
1137
|
-
* Shared event display option fields
|
|
1138
|
-
*/
|
|
1139
|
-
const eventDisplayFields = [
|
|
1140
|
-
{
|
|
1141
|
-
id: "showVenue",
|
|
1142
|
-
type: "boolean",
|
|
1143
|
-
label: "Show venue",
|
|
1144
|
-
description: "Shows the venue's name and address.",
|
|
1145
|
-
required: false,
|
|
1146
|
-
defaultValue: true,
|
|
1147
|
-
ui: { intent: "behavior" }
|
|
1148
|
-
},
|
|
1149
|
-
{
|
|
1150
|
-
id: "showMap",
|
|
1151
|
-
type: "boolean",
|
|
1152
|
-
label: "Show venue map",
|
|
1153
|
-
description: "Shows a map when the event's venue has a location set.",
|
|
1154
|
-
required: false,
|
|
1155
|
-
defaultValue: true,
|
|
1156
|
-
ui: { intent: "behavior" }
|
|
1157
|
-
},
|
|
1158
|
-
{
|
|
1159
|
-
id: "showCapacity",
|
|
1160
|
-
type: "boolean",
|
|
1161
|
-
label: "Show available places",
|
|
1162
|
-
description: "Shows how many places are left.",
|
|
1163
|
-
required: false,
|
|
1164
|
-
defaultValue: true,
|
|
1165
|
-
ui: { intent: "behavior" }
|
|
1166
|
-
}
|
|
1167
|
-
];
|
|
1168
|
-
/**
|
|
1169
|
-
* Empty state field for when no events are available
|
|
1170
|
-
*/
|
|
1171
|
-
const emptyStateField = {
|
|
1172
|
-
id: "emptyMessage",
|
|
1173
|
-
type: "text",
|
|
1174
|
-
label: "If there's nothing to show",
|
|
1175
|
-
description: "What visitors see when there are no upcoming events.",
|
|
1176
|
-
required: false,
|
|
1177
|
-
multiline: false,
|
|
1178
|
-
defaultValue: "No upcoming events scheduled.",
|
|
1179
|
-
maxLength: 200,
|
|
1180
|
-
ui: { intent: "behavior" }
|
|
1181
|
-
};
|
|
1182
|
-
/**
|
|
1183
|
-
* Layout selection field with grid/stack options
|
|
1184
|
-
*/
|
|
1185
|
-
const layoutField = {
|
|
1186
|
-
id: "layout",
|
|
1187
|
-
type: "select",
|
|
1188
|
-
label: "Layout",
|
|
1189
|
-
description: "Choose how events are displayed",
|
|
1190
|
-
required: false,
|
|
1191
|
-
multiple: false,
|
|
1192
|
-
defaultValue: "grid",
|
|
1193
|
-
options: [{
|
|
1194
|
-
value: "grid",
|
|
1195
|
-
label: "Grid (cards)"
|
|
1196
|
-
}, {
|
|
1197
|
-
value: "stack",
|
|
1198
|
-
label: "Stack (vertical list)"
|
|
1199
|
-
}],
|
|
1200
|
-
ui: { intent: "display" }
|
|
1201
|
-
};
|
|
1202
|
-
/**
|
|
1203
|
-
* Column count field for grid layouts (conditional on layout='grid')
|
|
1204
|
-
*/
|
|
1205
|
-
const columnsField = (options = [
|
|
1206
|
-
"2",
|
|
1207
|
-
"3",
|
|
1208
|
-
"4"
|
|
1209
|
-
]) => ({
|
|
1210
|
-
id: "columns",
|
|
1211
|
-
type: "select",
|
|
1212
|
-
label: "Columns",
|
|
1213
|
-
description: "Number of columns in grid layout",
|
|
1214
|
-
required: false,
|
|
1215
|
-
multiple: false,
|
|
1216
|
-
defaultValue: "3",
|
|
1217
|
-
ui: {
|
|
1218
|
-
intent: "display",
|
|
1219
|
-
visibleWhen: {
|
|
1220
|
-
field: "layout",
|
|
1221
|
-
equals: "grid"
|
|
1222
|
-
}
|
|
1223
|
-
},
|
|
1224
|
-
options: options.map((n) => ({
|
|
1225
|
-
value: n,
|
|
1226
|
-
label: `${n} columns`
|
|
1227
|
-
}))
|
|
1228
|
-
});
|
|
1229
|
-
//#endregion
|
|
1230
|
-
//#region ../blocks/src/system/runtime/nodes/events/domain/bookability.ts
|
|
1231
|
-
/**
|
|
1232
|
-
* Whether a public event has a registration path a visitor can take.
|
|
1233
|
-
*
|
|
1234
|
-
* Lifecycle admission comes from the public booking-availability contract;
|
|
1235
|
-
* capacity comes from the shared event-domain helpers so uncapped, fallback,
|
|
1236
|
-
* and hybrid attendance-mode cases agree with the registration runtime.
|
|
1237
|
-
*/
|
|
1238
|
-
function isBookableEvent(event) {
|
|
1239
|
-
if (!event.requiresRegistration) return false;
|
|
1240
|
-
if (event.bookingAvailability.kind !== "open") return false;
|
|
1241
|
-
return !isEventFull(event) || canJoinEventWaitlistOnAnyMode(event);
|
|
1242
|
-
}
|
|
1243
|
-
/**
|
|
1244
|
-
* Select the next occurrence-targeted events for a quick-book rail.
|
|
1245
|
-
*
|
|
1246
|
-
* The API normally returns valid timestamps, but malformed values sort after
|
|
1247
|
-
* valid events so one bad record cannot displace an otherwise useful rail.
|
|
1248
|
-
* Sorting before deduplication means a duplicate occurrence keeps its earliest
|
|
1249
|
-
* deterministic representation.
|
|
1250
|
-
*/
|
|
1251
|
-
function selectQuickDateEvents(events) {
|
|
1252
|
-
return orderedUniqueEventOccurrences(events.filter((event) => event.bookingScope !== "whole_series" && isBookableEvent(event))).slice(0, 4);
|
|
1253
|
-
}
|
|
1254
|
-
/** Shared ordering and identity selection, independent of booking capacity. */
|
|
1255
|
-
function orderedUniqueEventOccurrences(events) {
|
|
1256
|
-
const sorted = [...events].sort(compareQuickDateEvents);
|
|
1257
|
-
return sorted.filter((event, index) => sorted.findIndex((candidate) => candidate.occurrenceId === event.occurrenceId) === index);
|
|
1258
|
-
}
|
|
1259
|
-
function formatEventQuickDate(event, style = "legacy") {
|
|
1260
|
-
const options = eventDateOptions(event);
|
|
1261
|
-
const dateRail = formatEventCompactDateRail(event.startsAt, options, style === "site" ? "as-written" : "capitals");
|
|
1262
|
-
return {
|
|
1263
|
-
dateTime: event.startsAt,
|
|
1264
|
-
label: `${dateRail.weekday} ${dateRail.day} ${dateRail.month}, ${formatTime(event.startsAt, options)}`
|
|
1265
|
-
};
|
|
468
|
+
function resolveRepeaterGridColumnFieldId(options) {
|
|
469
|
+
return trimmedStringOrNull(options?.id) ?? "gridColumn";
|
|
1266
470
|
}
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
471
|
+
/** Strict admission; rendering normalization never grants permission to persist. */
|
|
472
|
+
function parseRepeaterGridInteger(value) {
|
|
473
|
+
if (typeof value !== "number" && (typeof value !== "string" || !value.trim())) return null;
|
|
474
|
+
const number = Number(value);
|
|
475
|
+
return Number.isInteger(number) ? number : null;
|
|
1270
476
|
}
|
|
1271
|
-
function
|
|
1272
|
-
const
|
|
1273
|
-
|
|
1274
|
-
return (Number.isNaN(leftTime) ? Number.POSITIVE_INFINITY : leftTime) - (Number.isNaN(rightTime) ? Number.POSITIVE_INFINITY : rightTime);
|
|
477
|
+
function isAcceptedRepeaterGridSpan(value, columns, acceptedSpans) {
|
|
478
|
+
const span = parseRepeaterGridInteger(value);
|
|
479
|
+
return span != null && span >= 1 && span <= columns && (!acceptedSpans || acceptedSpans.includes(span));
|
|
1275
480
|
}
|
|
1276
481
|
//#endregion
|
|
1277
|
-
//#region ../
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
if (
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
buttonVariant,
|
|
1300
|
-
dateStyle
|
|
1301
|
-
}, event.occurrenceId))
|
|
1302
|
-
})]
|
|
482
|
+
//#region ../site-contracts/src/blocks/layoutConfiguration.ts
|
|
483
|
+
const itemFieldsSchema = z.object({ fields: z.array(z.object({
|
|
484
|
+
id: z.string(),
|
|
485
|
+
type: z.string(),
|
|
486
|
+
defaultValue: z.unknown().optional(),
|
|
487
|
+
options: z.array(z.object({ value: z.string() })).optional(),
|
|
488
|
+
multiple: z.boolean().optional(),
|
|
489
|
+
source: z.object({ kind: z.string() }).optional()
|
|
490
|
+
})) });
|
|
491
|
+
function validateSpanSelect(span, columns, ctx) {
|
|
492
|
+
if (span.type !== "select") return;
|
|
493
|
+
const options = span.options ?? [];
|
|
494
|
+
const invalidOptions = options.some((option) => !isAcceptedRepeaterGridSpan(option.value, columns) || String(Number(option.value)) !== option.value);
|
|
495
|
+
if (span.multiple || options.length === 0 || invalidOptions || span.source && span.source.kind !== "static") ctx.addIssue({
|
|
496
|
+
code: "custom",
|
|
497
|
+
path: ["ui", "layoutGridSpanField"],
|
|
498
|
+
message: `Layout-grid span select must have single, static integer options within 1..${columns}`
|
|
499
|
+
});
|
|
500
|
+
if (span.defaultValue !== void 0 && !options.some((option) => option.value === span.defaultValue)) ctx.addIssue({
|
|
501
|
+
code: "custom",
|
|
502
|
+
path: ["ui", "layoutGridSpanField"],
|
|
503
|
+
message: "Layout-grid default span must be one of the span select options"
|
|
1303
504
|
});
|
|
1304
505
|
}
|
|
1305
|
-
/**
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
}),
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
className: "event-quick-date-when",
|
|
1340
|
-
dateTime: date.dateTime,
|
|
1341
|
-
"aria-label": date.label,
|
|
1342
|
-
children: date.label
|
|
1343
|
-
}),
|
|
1344
|
-
/* @__PURE__ */ jsx("h3", {
|
|
1345
|
-
className: "event-quick-date-title",
|
|
1346
|
-
children: /* @__PURE__ */ jsx("a", {
|
|
1347
|
-
className: "event-title-link",
|
|
1348
|
-
...resolveEventLinkProps(event),
|
|
1349
|
-
children: event.title
|
|
1350
|
-
})
|
|
1351
|
-
}),
|
|
1352
|
-
/* @__PURE__ */ jsxs("p", {
|
|
1353
|
-
className: "event-quick-date-meta status-muted",
|
|
1354
|
-
children: [
|
|
1355
|
-
formatEventLocation(event),
|
|
1356
|
-
" · ",
|
|
1357
|
-
formatEventDuration(event)
|
|
1358
|
-
]
|
|
1359
|
-
}),
|
|
1360
|
-
/* @__PURE__ */ jsxs("div", {
|
|
1361
|
-
className: "event-quick-date-footer rb-mt-auto rb-flex rb-items-center rb-justify-between rb-gap-3",
|
|
1362
|
-
children: [/* @__PURE__ */ jsx("span", {
|
|
1363
|
-
className: "event-quick-date-price",
|
|
1364
|
-
children: formatEventPrice(event)
|
|
1365
|
-
}), bookingLink ? /* @__PURE__ */ jsx(ThemedButtonLink, {
|
|
1366
|
-
variant: props.buttonVariant,
|
|
1367
|
-
size: "sm",
|
|
1368
|
-
extraClassName: "event-quick-date-cta",
|
|
1369
|
-
...bookingLink
|
|
1370
|
-
}) : null]
|
|
1371
|
-
})
|
|
1372
|
-
]
|
|
506
|
+
/** Both monomorphic and polymorphic item schemas have the same layout contract. */
|
|
507
|
+
function validateLayoutGridConfiguration(data, ctx) {
|
|
508
|
+
const ui = data.ui;
|
|
509
|
+
if (ui?.repeaterPreset !== "layoutGrid") return;
|
|
510
|
+
if (ui.layoutGridColumns !== void 0 === (ui.layoutGridColumnsFields !== void 0)) ctx.addIssue({
|
|
511
|
+
code: "custom",
|
|
512
|
+
path: ["ui", "layoutGridColumns"],
|
|
513
|
+
message: "Layout-grid requires exactly one of ui.layoutGridColumns or ui.layoutGridColumnsFields.lg; do not set both"
|
|
514
|
+
});
|
|
515
|
+
const spanId = resolveRepeaterGridSpanFieldId({ id: ui.layoutGridSpanField });
|
|
516
|
+
const requiredIds = [
|
|
517
|
+
spanId,
|
|
518
|
+
resolveRepeaterGridRowFieldId({ id: ui.layoutGridRowField }),
|
|
519
|
+
resolveRepeaterGridColumnFieldId({ id: ui.layoutGridColumnField })
|
|
520
|
+
];
|
|
521
|
+
(data.polymorphic && data.itemTypes ? Object.values(data.itemTypes) : [data.schema]).forEach((schema) => {
|
|
522
|
+
const parsed = itemFieldsSchema.safeParse(schema);
|
|
523
|
+
if (!parsed.success) return;
|
|
524
|
+
if (!requiredIds.every((id) => parsed.data.fields.some((field) => field.id === id))) ctx.addIssue({
|
|
525
|
+
code: "custom",
|
|
526
|
+
path: ["ui", "layoutGridRowField"],
|
|
527
|
+
message: `layoutGrid repeaters require span/row/column fields (${requiredIds.join(", ")}) to exist in repeater item fields`
|
|
528
|
+
});
|
|
529
|
+
if (ui.layoutGridStartNewRowField && !parsed.data.fields.some((field) => field.id === ui.layoutGridStartNewRowField && field.type === "boolean")) ctx.addIssue({
|
|
530
|
+
code: "custom",
|
|
531
|
+
path: ["ui", "layoutGridStartNewRowField"],
|
|
532
|
+
message: "Layout-grid Start a new row field must reference a boolean item field"
|
|
533
|
+
});
|
|
534
|
+
if (ui.layoutGridStartNewRowField && ui.layoutGridColumns === void 0) ctx.addIssue({
|
|
535
|
+
code: "custom",
|
|
536
|
+
path: ["ui", "layoutGridStartNewRowField"],
|
|
537
|
+
message: "Layout-grid Start a new row requires fixed columns (flow placement)"
|
|
538
|
+
});
|
|
539
|
+
parsed.data.fields.filter((field) => field.id === spanId).forEach((span) => validateSpanSelect(span, ui.layoutGridColumns ?? 6, ctx));
|
|
1373
540
|
});
|
|
1374
541
|
}
|
|
1375
542
|
//#endregion
|
|
1376
|
-
//#region ../
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
543
|
+
//#region ../site-contracts/src/blocks/selectField.ts
|
|
544
|
+
const selectOptionSchema = z.object({
|
|
545
|
+
value: z.string(),
|
|
546
|
+
label: z.string(),
|
|
547
|
+
description: z.string().optional(),
|
|
548
|
+
icon: z.string().optional()
|
|
549
|
+
});
|
|
550
|
+
const selectSourceSchema = z.discriminatedUnion("kind", [
|
|
551
|
+
z.object({ kind: z.literal("static") }),
|
|
552
|
+
z.object({
|
|
553
|
+
kind: z.literal("site"),
|
|
554
|
+
optionSource: z.enum(siteOptionSources)
|
|
555
|
+
}),
|
|
556
|
+
z.object({ kind: z.literal("sdk") })
|
|
557
|
+
]);
|
|
558
|
+
function assertNeverSelectSource(value) {
|
|
559
|
+
throw new Error(`Unhandled select source: ${JSON.stringify(value)}`);
|
|
1391
560
|
}
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
showDirections: true,
|
|
1405
|
-
directionsLabel: "Get directions"
|
|
1406
|
-
};
|
|
1407
|
-
const LOCATION_MAP_LIMITS = {
|
|
1408
|
-
zoom: {
|
|
1409
|
-
min: 3,
|
|
1410
|
-
max: 18
|
|
1411
|
-
},
|
|
1412
|
-
heightPx: {
|
|
1413
|
-
min: 200,
|
|
1414
|
-
max: 600
|
|
1415
|
-
}
|
|
1416
|
-
};
|
|
1417
|
-
function normalizeNumber(value, fallback) {
|
|
1418
|
-
if (typeof value === "number" && Number.isFinite(value)) return value;
|
|
1419
|
-
if (typeof value === "string") {
|
|
1420
|
-
const parsed = Number.parseFloat(value);
|
|
1421
|
-
if (Number.isFinite(parsed)) return parsed;
|
|
1422
|
-
}
|
|
1423
|
-
return fallback;
|
|
561
|
+
const selectFieldSchema = baseFieldSchema.extend({
|
|
562
|
+
type: z.literal("select"),
|
|
563
|
+
options: z.array(selectOptionSchema),
|
|
564
|
+
multiple: z.boolean().default(false),
|
|
565
|
+
source: selectSourceSchema.optional()
|
|
566
|
+
}).superRefine(validateSelectField);
|
|
567
|
+
function selectIssue(ctx, path, message) {
|
|
568
|
+
ctx.addIssue({
|
|
569
|
+
code: z.ZodIssueCode.custom,
|
|
570
|
+
path,
|
|
571
|
+
message
|
|
572
|
+
});
|
|
1424
573
|
}
|
|
1425
|
-
function
|
|
1426
|
-
if (
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
if (value === "false") return false;
|
|
574
|
+
function validateUnconfiguredSelect(field, ctx) {
|
|
575
|
+
if (field.ui?.siteOptionSource || field.ui?.widget === "sdkSelect") {
|
|
576
|
+
selectIssue(ctx, ["source"], "Runtime-backed select fields must declare source.kind explicitly");
|
|
577
|
+
return;
|
|
1430
578
|
}
|
|
1431
|
-
|
|
579
|
+
if (field.options.length === 0) selectIssue(ctx, ["options"], "Select fields require at least one option unless a runtime source is configured");
|
|
1432
580
|
}
|
|
1433
|
-
function
|
|
1434
|
-
if (
|
|
1435
|
-
|
|
1436
|
-
return projected === null ? null : {
|
|
1437
|
-
addressText: projected.displayAddress,
|
|
1438
|
-
...projected.pin ?? {
|
|
1439
|
-
lat: null,
|
|
1440
|
-
lng: null
|
|
1441
|
-
},
|
|
1442
|
-
drawing: projected.drawing,
|
|
1443
|
-
doorNote: projected.doorNote
|
|
1444
|
-
};
|
|
581
|
+
function validateStaticSelect(field, ctx) {
|
|
582
|
+
if (field.ui?.siteOptionSource || field.ui?.widget === "sdkSelect") selectIssue(ctx, ["ui"], "Static select fields cannot declare runtime-backed UI metadata");
|
|
583
|
+
if (field.options.length === 0) selectIssue(ctx, ["options"], "Static select fields require at least one option");
|
|
1445
584
|
}
|
|
1446
|
-
function
|
|
1447
|
-
|
|
585
|
+
function validateSiteSelect(field, optionSource, ctx) {
|
|
586
|
+
if (field.options.length > 0) selectIssue(ctx, ["options"], "Site-backed select fields must not define static options");
|
|
587
|
+
if (field.ui?.widget !== "siteOptionPicker") selectIssue(ctx, ["ui", "widget"], "Site-backed select fields must use the siteOptionPicker widget");
|
|
588
|
+
if (field.ui?.siteOptionSource !== optionSource) selectIssue(ctx, ["ui", "siteOptionSource"], "Site-backed select fields must keep ui.siteOptionSource in sync with source.optionSource");
|
|
1448
589
|
}
|
|
1449
|
-
function
|
|
1450
|
-
|
|
1451
|
-
if (
|
|
1452
|
-
const locationValue = normalizeLocationMapValue(input.businessAddress, input.siteCountry);
|
|
1453
|
-
return locationValue ? {
|
|
1454
|
-
kind: "business_address",
|
|
1455
|
-
locationValue
|
|
1456
|
-
} : {
|
|
1457
|
-
kind: "unresolved",
|
|
1458
|
-
source,
|
|
1459
|
-
reason: "missing_business_address"
|
|
1460
|
-
};
|
|
1461
|
-
}
|
|
1462
|
-
if (source === "venue") {
|
|
1463
|
-
const venueId = typeof input.venueId === "string" && input.venueId.trim() ? input.venueId.trim() : null;
|
|
1464
|
-
if (!venueId) return {
|
|
1465
|
-
kind: "unresolved",
|
|
1466
|
-
source,
|
|
1467
|
-
reason: "missing_venue_id"
|
|
1468
|
-
};
|
|
1469
|
-
const locationValue = input.venuesById ? normalizeLocationMapValue(input.venuesById[venueId] ?? null, input.siteCountry) : null;
|
|
1470
|
-
return locationValue ? {
|
|
1471
|
-
kind: "venue",
|
|
1472
|
-
venueId,
|
|
1473
|
-
locationValue
|
|
1474
|
-
} : {
|
|
1475
|
-
kind: "unresolved",
|
|
1476
|
-
source,
|
|
1477
|
-
reason: "missing_venue_location"
|
|
1478
|
-
};
|
|
1479
|
-
}
|
|
1480
|
-
const locationValue = normalizeLocationMapValue(input.location, input.siteCountry);
|
|
1481
|
-
return locationValue ? {
|
|
1482
|
-
kind: "custom",
|
|
1483
|
-
locationValue
|
|
1484
|
-
} : {
|
|
1485
|
-
kind: "unresolved",
|
|
1486
|
-
source,
|
|
1487
|
-
reason: "missing_custom_location"
|
|
1488
|
-
};
|
|
590
|
+
function validateSdkSelect(field, ctx) {
|
|
591
|
+
if (field.ui?.widget !== "sdkSelect") selectIssue(ctx, ["ui", "widget"], "SDK-backed select fields must use the sdkSelect widget");
|
|
592
|
+
if (field.ui?.siteOptionSource) selectIssue(ctx, ["ui", "siteOptionSource"], "SDK-backed select fields cannot declare ui.siteOptionSource");
|
|
1489
593
|
}
|
|
1490
|
-
function
|
|
1491
|
-
if (
|
|
1492
|
-
switch (
|
|
1493
|
-
case "
|
|
1494
|
-
case "
|
|
1495
|
-
case "
|
|
1496
|
-
|
|
594
|
+
function validateSelectField(field, ctx) {
|
|
595
|
+
if (!field.source) return validateUnconfiguredSelect(field, ctx);
|
|
596
|
+
switch (field.source.kind) {
|
|
597
|
+
case "static": return validateStaticSelect(field, ctx);
|
|
598
|
+
case "site": return validateSiteSelect(field, field.source.optionSource, ctx);
|
|
599
|
+
case "sdk": return validateSdkSelect(field, ctx);
|
|
600
|
+
default: return assertNeverSelectSource(field.source);
|
|
1497
601
|
}
|
|
1498
602
|
}
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
showAddressText: normalizeBoolean$1(input.showAddressText, LOCATION_MAP_DEFAULTS.showAddressText),
|
|
1516
|
-
showDirections: normalizeBoolean$1(input.showDirections, LOCATION_MAP_DEFAULTS.showDirections),
|
|
1517
|
-
directionsLabel,
|
|
1518
|
-
className: typeof input.className === "string" ? input.className : null
|
|
1519
|
-
};
|
|
1520
|
-
}
|
|
1521
|
-
/** All render-ready permitted details come from the same resolved source value. */
|
|
1522
|
-
function locationMapDetails(value) {
|
|
1523
|
-
return {
|
|
1524
|
-
drawing: value?.drawing ?? null,
|
|
1525
|
-
doorNote: value?.doorNote ?? null,
|
|
1526
|
-
addressText: value?.addressText ?? null,
|
|
1527
|
-
location: toLocationCoordinates(value)
|
|
1528
|
-
};
|
|
603
|
+
//#endregion
|
|
604
|
+
//#region ../site-contracts/src/blocks/fields.ts
|
|
605
|
+
const DEFAULT_MEDIA_FIELD_KINDS = ["image"];
|
|
606
|
+
const textFieldSchema = baseFieldSchema.extend({
|
|
607
|
+
type: z.literal("text"),
|
|
608
|
+
multiline: z.boolean().default(false),
|
|
609
|
+
maxLength: z.number().int().positive().optional()
|
|
610
|
+
});
|
|
611
|
+
const richTextFieldSchema = baseFieldSchema.extend({ type: z.literal("richText") });
|
|
612
|
+
const inlineTextFieldSchema = baseFieldSchema.extend({
|
|
613
|
+
type: z.literal("inlineText"),
|
|
614
|
+
maxLength: z.number().int().positive().optional(),
|
|
615
|
+
plainTextField: z.string().min(1).optional()
|
|
616
|
+
});
|
|
617
|
+
function hasMediaDefaultIdentifier(value) {
|
|
618
|
+
return value !== null && typeof value === "object" && !Array.isArray(value) && typeof value.identifier === "string" && value.identifier.trim().length > 0;
|
|
1529
619
|
}
|
|
1530
|
-
function
|
|
1531
|
-
|
|
620
|
+
function validateMediaFieldDefault(field, ctx) {
|
|
621
|
+
if (field.defaultValue !== void 0 && field.defaultValue !== null && !hasMediaDefaultIdentifier(field.defaultValue)) ctx.addIssue({
|
|
622
|
+
code: z.ZodIssueCode.custom,
|
|
623
|
+
path: ["defaultValue"],
|
|
624
|
+
message: `${field.type} defaultValue must be null or an object with a non-empty identifier`
|
|
625
|
+
});
|
|
1532
626
|
}
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
627
|
+
const mediaFieldSchema = baseFieldSchema.extend({
|
|
628
|
+
type: z.literal("media"),
|
|
629
|
+
mediaKinds: z.array(z.enum(mediaTypeDiscriminants)).default([...DEFAULT_MEDIA_FIELD_KINDS]).transform((kinds) => {
|
|
630
|
+
const displayKinds = kinds.filter(isDisplayMediaKind);
|
|
631
|
+
return displayKinds.length > 0 ? displayKinds : [...DEFAULT_MEDIA_FIELD_KINDS];
|
|
632
|
+
}),
|
|
633
|
+
aspectRatio: z.string().optional()
|
|
634
|
+
}).superRefine(validateMediaFieldDefault);
|
|
635
|
+
const fileFieldSchema = baseFieldSchema.extend({
|
|
636
|
+
type: z.literal("file"),
|
|
637
|
+
fileKinds: z.array(z.enum(PUBLIC_FILE_FIELD_KINDS)).default([...PUBLIC_FILE_FIELD_KINDS])
|
|
638
|
+
}).superRefine(validateMediaFieldDefault);
|
|
639
|
+
const booleanFieldSchema = baseFieldSchema.extend({ type: z.literal("boolean") });
|
|
640
|
+
const dateFieldSchema = baseFieldSchema.extend({ type: z.literal("date") });
|
|
641
|
+
const timeFieldSchema = baseFieldSchema.extend({ type: z.literal("time") });
|
|
642
|
+
const dateTimeFieldSchema = baseFieldSchema.extend({ type: z.literal("datetime") });
|
|
643
|
+
const slugFieldSchema = baseFieldSchema.extend({
|
|
644
|
+
type: z.literal("slug"),
|
|
645
|
+
sourceFieldId: z.string().min(1).optional(),
|
|
646
|
+
statusFieldId: z.string().min(1).optional(),
|
|
647
|
+
maxLength: z.number().int().positive().optional()
|
|
648
|
+
});
|
|
649
|
+
const urlFieldSchema = baseFieldSchema.extend({
|
|
650
|
+
type: z.literal("url"),
|
|
651
|
+
allowRelative: z.boolean().default(false)
|
|
652
|
+
});
|
|
653
|
+
const linkFieldSchema = baseFieldSchema.extend({ type: z.literal("link") });
|
|
654
|
+
const referenceFieldSchema = baseFieldSchema.extend({
|
|
655
|
+
type: z.literal("reference"),
|
|
656
|
+
referenceKind: z.string().min(1),
|
|
657
|
+
allowManualEntry: z.boolean().default(false)
|
|
658
|
+
});
|
|
659
|
+
/**
|
|
660
|
+
* Item type schema for polymorphic repeaters.
|
|
661
|
+
* Each type has a label, optional icon, and its own field schema.
|
|
662
|
+
*/
|
|
663
|
+
const itemTypeSchema = z.object({
|
|
664
|
+
label: z.string().min(1),
|
|
665
|
+
icon: z.string().optional(),
|
|
666
|
+
fields: z.lazy(() => getFieldSchemaInternal().array().min(1, "Item type requires at least one field"))
|
|
667
|
+
});
|
|
668
|
+
/**
|
|
669
|
+
* Repeater fields allow nesting of other fields within them.
|
|
670
|
+
* This enables complex layouts and structures by repeating a set of fields.
|
|
671
|
+
*
|
|
672
|
+
* Supports two modes:
|
|
673
|
+
* 1. Monomorphic (default): All items have the same schema
|
|
674
|
+
* 2. Polymorphic: Items can be different types (e.g., card, quote, stat)
|
|
675
|
+
*
|
|
676
|
+
* Uses z.lazy() to allow mutual recursion.
|
|
677
|
+
*/
|
|
678
|
+
const repeaterFieldSchema = baseFieldSchema.extend({
|
|
679
|
+
type: z.literal("repeater"),
|
|
680
|
+
itemLabel: z.string().default("Item"),
|
|
681
|
+
itemLabelSource: z.string().optional(),
|
|
682
|
+
showSummary: z.boolean().optional(),
|
|
683
|
+
summaryFields: z.string().array().optional(),
|
|
684
|
+
summaryMaxChars: z.number().int().positive().optional(),
|
|
685
|
+
minItems: z.number().int().min(0).default(0),
|
|
686
|
+
maxItems: z.number().int().positive().optional(),
|
|
687
|
+
schema: z.object({ fields: z.lazy(() => getFieldSchemaInternal().array().min(1, "Repeater requires at least one field")) }).optional(),
|
|
688
|
+
polymorphic: z.boolean().optional(),
|
|
689
|
+
itemTypes: z.record(z.string(), itemTypeSchema).optional(),
|
|
690
|
+
allowConversion: z.boolean().default(true)
|
|
691
|
+
}).refine((data) => {
|
|
692
|
+
return data.schema !== void 0 !== (data.polymorphic === true && data.itemTypes !== void 0);
|
|
693
|
+
}, { message: "Repeater must have either 'schema' (monomorphic) or 'polymorphic: true' with 'itemTypes' (polymorphic)" }).superRefine(validateLayoutGridConfiguration).refine((data) => {
|
|
694
|
+
const thumbnailAspectRatio = data.ui?.thumbnailAspectRatio;
|
|
695
|
+
if (!thumbnailAspectRatio) return true;
|
|
696
|
+
return parseAspectRatioValue(thumbnailAspectRatio) != null;
|
|
697
|
+
}, {
|
|
698
|
+
message: "ui.thumbnailAspectRatio must be a valid ratio (e.g. '16/9', '4:3', or '1.5')",
|
|
699
|
+
path: ["ui", "thumbnailAspectRatio"]
|
|
700
|
+
}).refine((data) => {
|
|
701
|
+
const labelField = data.ui?.thumbnailLabelField;
|
|
702
|
+
if (!labelField) return true;
|
|
703
|
+
const schemaFields = data.schema?.fields;
|
|
704
|
+
if (!schemaFields) return true;
|
|
705
|
+
return schemaFields.find((candidate) => candidate.id === labelField)?.type === "text";
|
|
706
|
+
}, {
|
|
707
|
+
message: "ui.thumbnailLabelField must reference a text field in the repeater schema",
|
|
708
|
+
path: ["ui", "thumbnailLabelField"]
|
|
709
|
+
});
|
|
710
|
+
const groupFieldSchema = baseFieldSchema.extend({
|
|
711
|
+
type: z.literal("group"),
|
|
712
|
+
schema: z.object({ fields: z.lazy(() => getFieldSchemaInternal().array().min(1, "Group requires at least one field")) })
|
|
713
|
+
});
|
|
714
|
+
const modalFieldSchema = baseFieldSchema.extend({
|
|
715
|
+
type: z.literal("modal"),
|
|
716
|
+
schema: z.object({ fields: z.lazy(() => getFieldSchemaInternal().array().min(1, "Modal requires at least one field")) })
|
|
717
|
+
});
|
|
718
|
+
const numberFieldSchema = baseFieldSchema.extend({
|
|
719
|
+
type: z.literal("number"),
|
|
720
|
+
min: z.number().optional(),
|
|
721
|
+
max: z.number().optional(),
|
|
722
|
+
step: z.number().optional()
|
|
723
|
+
});
|
|
724
|
+
const tabDefinitionSchema = z.object({
|
|
725
|
+
id: z.string().min(1),
|
|
726
|
+
label: z.string().min(1),
|
|
727
|
+
icon: z.string().optional(),
|
|
728
|
+
description: z.string().optional(),
|
|
729
|
+
fields: z.lazy(() => getFieldSchemaInternal().array()),
|
|
730
|
+
/** SDK section option that controls tab visibility based on site config */
|
|
731
|
+
sdkSectionOption: z.enum([
|
|
732
|
+
"backgroundColor",
|
|
733
|
+
"backgroundGradient",
|
|
734
|
+
"backgroundImage"
|
|
735
|
+
]).optional()
|
|
736
|
+
});
|
|
737
|
+
const tabGroupFieldSchema = baseFieldSchema.extend({
|
|
738
|
+
type: z.literal("tabGroup"),
|
|
739
|
+
tabs: z.array(tabDefinitionSchema).min(1, "TabGroup requires at least one tab"),
|
|
740
|
+
activeTabField: z.string().optional()
|
|
741
|
+
});
|
|
742
|
+
const presetOptionSchema = z.object({
|
|
743
|
+
value: z.string(),
|
|
744
|
+
label: z.string()
|
|
745
|
+
});
|
|
746
|
+
const presetOrCustomFieldSchema = baseFieldSchema.extend({
|
|
747
|
+
type: z.literal("presetOrCustom"),
|
|
748
|
+
presets: z.array(presetOptionSchema).min(1, "PresetOrCustom requires at least one preset"),
|
|
749
|
+
customInput: z.object({
|
|
750
|
+
placeholder: z.string().optional(),
|
|
751
|
+
pattern: z.string().optional(),
|
|
752
|
+
helpText: z.string().optional()
|
|
753
|
+
}).optional()
|
|
754
|
+
});
|
|
755
|
+
const contentTypeSelectFieldSchema = baseFieldSchema.extend({
|
|
756
|
+
type: z.literal("contentTypeSelect"),
|
|
757
|
+
/** Filter: all, routable (hasPages=true), nonRoutable (hasPages=false) */
|
|
758
|
+
filter: z.enum([
|
|
759
|
+
"all",
|
|
760
|
+
"routable",
|
|
761
|
+
"nonRoutable"
|
|
762
|
+
]).default("all")
|
|
763
|
+
});
|
|
764
|
+
const entryPickerFieldSchema = baseFieldSchema.extend({
|
|
765
|
+
type: z.literal("entryPicker"),
|
|
766
|
+
/** Fixed content type to filter entries by (no sibling contentType field required) */
|
|
767
|
+
fixedContentType: z.string().optional(),
|
|
768
|
+
/** Field ID that contains the content type to filter entries by */
|
|
769
|
+
contentTypeField: z.string().optional(),
|
|
770
|
+
/** What value should be stored when an entry is selected */
|
|
771
|
+
valueFrom: z.enum([
|
|
772
|
+
"id",
|
|
773
|
+
"identifier",
|
|
774
|
+
"slug"
|
|
775
|
+
]).optional()
|
|
776
|
+
});
|
|
777
|
+
const fieldSchema = z.discriminatedUnion("type", [
|
|
778
|
+
textFieldSchema,
|
|
779
|
+
richTextFieldSchema,
|
|
780
|
+
inlineTextFieldSchema,
|
|
781
|
+
mediaFieldSchema,
|
|
782
|
+
fileFieldSchema,
|
|
783
|
+
booleanFieldSchema,
|
|
784
|
+
numberFieldSchema,
|
|
785
|
+
dateFieldSchema,
|
|
786
|
+
timeFieldSchema,
|
|
787
|
+
dateTimeFieldSchema,
|
|
788
|
+
slugFieldSchema,
|
|
789
|
+
urlFieldSchema,
|
|
790
|
+
linkFieldSchema,
|
|
791
|
+
selectFieldSchema,
|
|
792
|
+
referenceFieldSchema,
|
|
793
|
+
repeaterFieldSchema,
|
|
794
|
+
groupFieldSchema,
|
|
795
|
+
modalFieldSchema,
|
|
796
|
+
tabGroupFieldSchema,
|
|
797
|
+
presetOrCustomFieldSchema,
|
|
798
|
+
contentTypeSelectFieldSchema,
|
|
799
|
+
entryPickerFieldSchema
|
|
800
|
+
]);
|
|
801
|
+
function getFieldSchemaInternal() {
|
|
802
|
+
return fieldSchema;
|
|
1546
803
|
}
|
|
804
|
+
z.array(z.enum(SYSTEM_BLOCK_KINDS)).readonly();
|
|
805
|
+
const blockRequiredFeatureSchema = z.enum([
|
|
806
|
+
"bookings.appointments",
|
|
807
|
+
"bookings.events",
|
|
808
|
+
"shop",
|
|
809
|
+
"newsletter",
|
|
810
|
+
"analytics"
|
|
811
|
+
]);
|
|
812
|
+
const blockCategoryEnum = z.enum([
|
|
813
|
+
"text-and-images",
|
|
814
|
+
"photos",
|
|
815
|
+
"people",
|
|
816
|
+
"events-and-bookings",
|
|
817
|
+
"shop",
|
|
818
|
+
"forms-and-sign-ups",
|
|
819
|
+
"marketing",
|
|
820
|
+
"content",
|
|
821
|
+
"blog",
|
|
822
|
+
"media",
|
|
823
|
+
"layout",
|
|
824
|
+
"interactive"
|
|
825
|
+
]);
|
|
826
|
+
const blockContentSourceSchema = z.object({
|
|
827
|
+
kind: z.enum([
|
|
828
|
+
"inline",
|
|
829
|
+
"entries",
|
|
830
|
+
"mixed"
|
|
831
|
+
]),
|
|
832
|
+
contentType: z.string().min(1).optional()
|
|
833
|
+
}).superRefine((value, ctx) => {
|
|
834
|
+
if (value.kind === "inline" && value.contentType) ctx.addIssue({
|
|
835
|
+
code: z.ZodIssueCode.custom,
|
|
836
|
+
path: ["contentType"],
|
|
837
|
+
message: "contentType is not allowed when contentSource.kind is \"inline\""
|
|
838
|
+
});
|
|
839
|
+
});
|
|
840
|
+
z.array(z.string().min(1)).optional(), z.string().min(1).optional();
|
|
1547
841
|
//#endregion
|
|
1548
|
-
//#region ../
|
|
842
|
+
//#region ../site-contracts/src/blocks/nodes.ts
|
|
1549
843
|
const transformStepSchema = z.object({
|
|
1550
844
|
id: z.string().min(1, "Transform requires an identifier"),
|
|
1551
845
|
options: z.record(z.string(), z.unknown()).optional()
|
|
@@ -1604,1123 +898,1371 @@ const nodeSchema = z.object({
|
|
|
1604
898
|
const nodeTreeSchema = nodeSchema.array().or(nodeSchema);
|
|
1605
899
|
const NodeSchema = nodeSchema;
|
|
1606
900
|
const NodeTreeSchema = nodeTreeSchema;
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
"
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
"
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
"
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
"
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
"
|
|
1632
|
-
|
|
1633
|
-
"
|
|
1634
|
-
|
|
1635
|
-
"block.event-listing",
|
|
1636
|
-
"block.event-calendar",
|
|
1637
|
-
"block.recurring-schedule",
|
|
1638
|
-
"block.offerings-preview"
|
|
1639
|
-
],
|
|
1640
|
-
"block.shop",
|
|
1641
|
-
"block.product-list",
|
|
1642
|
-
"block.product-detail",
|
|
1643
|
-
"block.cart",
|
|
1644
|
-
"block.checkout",
|
|
1645
|
-
"block.gifting",
|
|
1646
|
-
"block.newsletter-signup",
|
|
1647
|
-
"block.image-gallery",
|
|
1648
|
-
"block.video-grid",
|
|
1649
|
-
"block.audio-player",
|
|
1650
|
-
"block.file-download"
|
|
1651
|
-
];
|
|
1652
|
-
const MIN_COLUMNS = 1;
|
|
1653
|
-
const MAX_COLUMNS = 6;
|
|
1654
|
-
function normalizeInteger(value) {
|
|
1655
|
-
if (typeof value === "number" && Number.isFinite(value)) return Math.trunc(value);
|
|
1656
|
-
if (typeof value === "string") {
|
|
1657
|
-
const trimmed = value.trim();
|
|
1658
|
-
if (!trimmed) return null;
|
|
1659
|
-
const parsed = Number(trimmed);
|
|
1660
|
-
if (!Number.isFinite(parsed)) return null;
|
|
1661
|
-
return Math.trunc(parsed);
|
|
901
|
+
//#endregion
|
|
902
|
+
//#region ../theme-core/src/accordions/types.ts
|
|
903
|
+
/**
|
|
904
|
+
* Icon configuration mapping icon styles to Lucide icons and behavior
|
|
905
|
+
* Used by both CSS generation (for rotation) and component rendering (for icon selection)
|
|
906
|
+
*/
|
|
907
|
+
const ICON_CONFIG = {
|
|
908
|
+
"plus-minus": {
|
|
909
|
+
closedIcon: "Plus",
|
|
910
|
+
openIcon: "Minus",
|
|
911
|
+
rotation: 0
|
|
912
|
+
},
|
|
913
|
+
"chevron": {
|
|
914
|
+
closedIcon: "ChevronDown",
|
|
915
|
+
rotation: 180
|
|
916
|
+
},
|
|
917
|
+
"caret": {
|
|
918
|
+
closedIcon: "ChevronDown",
|
|
919
|
+
rotation: 180
|
|
920
|
+
},
|
|
921
|
+
"arrow": {
|
|
922
|
+
closedIcon: "ArrowDown",
|
|
923
|
+
rotation: 180
|
|
924
|
+
},
|
|
925
|
+
"circle-plus-minus": {
|
|
926
|
+
closedIcon: "CirclePlus",
|
|
927
|
+
openIcon: "CircleMinus",
|
|
928
|
+
rotation: 0
|
|
1662
929
|
}
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
930
|
+
};
|
|
931
|
+
/**
|
|
932
|
+
* Icon size mapping (px values for CSS and Lucide React)
|
|
933
|
+
*/
|
|
934
|
+
const ICON_SIZE_PX = {
|
|
935
|
+
sm: "16px",
|
|
936
|
+
md: "20px",
|
|
937
|
+
lg: "24px"
|
|
938
|
+
};
|
|
939
|
+
/**
|
|
940
|
+
* Spacing map for accordion content padding
|
|
941
|
+
*/
|
|
942
|
+
const ACCORDION_SPACING_MAP = {
|
|
943
|
+
none: "0",
|
|
944
|
+
compact: "0.75rem",
|
|
945
|
+
cozy: "1rem",
|
|
946
|
+
medium: "1.25rem",
|
|
947
|
+
comfortable: "1.5rem",
|
|
948
|
+
spacious: "2rem"
|
|
949
|
+
};
|
|
950
|
+
/**
|
|
951
|
+
* Question (trigger) font-size by scale step. Kept as self-contained clamps
|
|
952
|
+
* rather than the heading-scale CSS vars so question size stays predictable
|
|
953
|
+
* even when a theme configures very large headings.
|
|
954
|
+
*/
|
|
955
|
+
const ACCORDION_TRIGGER_FONT_SCALE = {
|
|
956
|
+
body: "clamp(0.95rem, var(--fs-body), 1.0625rem)",
|
|
957
|
+
md: "clamp(1.0625rem, 0.98rem + 0.45vw, 1.3rem)",
|
|
958
|
+
lg: "clamp(1.2rem, 1.05rem + 0.7vw, 1.6rem)"
|
|
959
|
+
};
|
|
960
|
+
const ACCORDION_TRIGGER_LETTER_SPACING = {
|
|
961
|
+
normal: "0",
|
|
962
|
+
tight: "-0.01em",
|
|
963
|
+
wide: "0.04em"
|
|
964
|
+
};
|
|
965
|
+
const ACCORDION_OPEN_ACCENT_THICKNESS = {
|
|
966
|
+
thin: "2px",
|
|
967
|
+
medium: "3px",
|
|
968
|
+
thick: "4px"
|
|
969
|
+
};
|
|
970
|
+
//#endregion
|
|
971
|
+
//#region ../blocks/src/system/fields/button.ts
|
|
972
|
+
const DEFAULT_THEME_BUTTON_VARIANTS = BLOCK_BUTTON_ROLE_OPTIONS;
|
|
973
|
+
function createButtonVariantField(options = {}) {
|
|
974
|
+
return {
|
|
975
|
+
id: options.id ?? "buttonVariant",
|
|
976
|
+
type: "select",
|
|
977
|
+
label: options.label ?? "Button style",
|
|
978
|
+
description: options.description ?? "Choose a button style from your theme.",
|
|
979
|
+
required: false,
|
|
980
|
+
multiple: false,
|
|
981
|
+
defaultValue: options.defaultValue ?? "primary",
|
|
982
|
+
options: [...options.variants ?? DEFAULT_THEME_BUTTON_VARIANTS],
|
|
983
|
+
ui: {
|
|
984
|
+
intent: "style",
|
|
985
|
+
widget: "buttonVariant"
|
|
986
|
+
}
|
|
987
|
+
};
|
|
1681
988
|
}
|
|
1682
|
-
function
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
989
|
+
function createButtonGroup(options = {}) {
|
|
990
|
+
const { variants = BLOCK_BUTTON_ROLE_OPTIONS, defaultVariant, includeSize = true, defaultSize = "md", showGroupLabel = false, groupId = "button", groupLabel = "Button", flattenInRepeater = true } = options;
|
|
991
|
+
const mainFields = [
|
|
992
|
+
{
|
|
993
|
+
id: "label",
|
|
994
|
+
type: "text",
|
|
995
|
+
label: "Label",
|
|
996
|
+
required: true,
|
|
997
|
+
multiline: false,
|
|
998
|
+
maxLength: 40,
|
|
999
|
+
ui: { row: "primary" }
|
|
1000
|
+
},
|
|
1001
|
+
{
|
|
1002
|
+
id: "link",
|
|
1003
|
+
type: "link",
|
|
1004
|
+
label: "Link",
|
|
1005
|
+
required: true,
|
|
1006
|
+
ui: { row: "primary" }
|
|
1007
|
+
},
|
|
1008
|
+
{
|
|
1009
|
+
id: "variant",
|
|
1010
|
+
type: "select",
|
|
1011
|
+
label: "Style",
|
|
1012
|
+
options: [...variants],
|
|
1013
|
+
required: false,
|
|
1014
|
+
multiple: false,
|
|
1015
|
+
...defaultVariant ? { defaultValue: defaultVariant } : {},
|
|
1016
|
+
ui: {
|
|
1017
|
+
intent: "style",
|
|
1018
|
+
underLooks: "owner",
|
|
1019
|
+
widget: "buttonVariant"
|
|
1020
|
+
}
|
|
1021
|
+
},
|
|
1022
|
+
...includeSize ? [{
|
|
1023
|
+
id: "size",
|
|
1024
|
+
type: "select",
|
|
1025
|
+
label: "Size",
|
|
1026
|
+
options: [
|
|
1027
|
+
{
|
|
1028
|
+
value: "sm",
|
|
1029
|
+
label: "Small"
|
|
1030
|
+
},
|
|
1031
|
+
{
|
|
1032
|
+
value: "md",
|
|
1033
|
+
label: "Medium"
|
|
1034
|
+
},
|
|
1035
|
+
{
|
|
1036
|
+
value: "lg",
|
|
1037
|
+
label: "Large"
|
|
1038
|
+
},
|
|
1039
|
+
{
|
|
1040
|
+
value: "xl",
|
|
1041
|
+
label: "Extra large"
|
|
1042
|
+
}
|
|
1043
|
+
],
|
|
1044
|
+
required: false,
|
|
1045
|
+
multiple: false,
|
|
1046
|
+
defaultValue: defaultSize,
|
|
1047
|
+
ui: { intent: "style" }
|
|
1048
|
+
}] : []
|
|
1706
1049
|
];
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
return Number.isInteger(number) ? number : null;
|
|
1735
|
-
}
|
|
1736
|
-
function isAcceptedRepeaterGridSpan(value, columns, acceptedSpans) {
|
|
1737
|
-
const span = parseRepeaterGridInteger(value);
|
|
1738
|
-
return span != null && span >= 1 && span <= columns && (!acceptedSpans || acceptedSpans.includes(span));
|
|
1739
|
-
}
|
|
1740
|
-
function normalizeRepeaterGridSpan(value, activeColumns, acceptedSpans) {
|
|
1741
|
-
if (acceptedSpans) {
|
|
1742
|
-
const valid = acceptedSpans.filter((span) => span <= activeColumns);
|
|
1743
|
-
const parsed = parseRepeaterGridInteger(value);
|
|
1744
|
-
return parsed != null && valid.includes(parsed) ? parsed : valid.length ? Math.min(...valid) : 1;
|
|
1745
|
-
}
|
|
1746
|
-
const parsed = normalizeInteger(value);
|
|
1747
|
-
if (parsed == null) return 1;
|
|
1748
|
-
return clamp(parsed, 1, Math.max(1, activeColumns));
|
|
1749
|
-
}
|
|
1750
|
-
function normalizeRepeaterGridColStart(value, activeColumns, span) {
|
|
1751
|
-
const parsed = normalizeInteger(value);
|
|
1752
|
-
const normalizedColumns = Math.max(1, activeColumns);
|
|
1753
|
-
const normalizedSpan = clamp(span, 1, normalizedColumns);
|
|
1754
|
-
const maxColStart = Math.max(1, normalizedColumns - normalizedSpan + 1);
|
|
1755
|
-
if (parsed == null) return 1;
|
|
1756
|
-
return clamp(parsed, 1, maxColStart);
|
|
1757
|
-
}
|
|
1758
|
-
function toRowCellKey(row, col, columns) {
|
|
1759
|
-
return (row - 1) * columns + col;
|
|
1760
|
-
}
|
|
1761
|
-
function buildPlacementCells(placement) {
|
|
1762
|
-
return Array.from({ length: placement.span }, (_, index) => placement.colStart + index);
|
|
1763
|
-
}
|
|
1764
|
-
function buildOccupancyByCell(placements, columns) {
|
|
1765
|
-
const occupancy = placements.flatMap((placement) => buildPlacementCells(placement).map((col) => [toRowCellKey(placement.row, col, columns), placement.id])).reduce((cells, [cell, id]) => new Map(cells).set(cell, /* @__PURE__ */ new Set([...cells.get(cell) ?? [], id])), /* @__PURE__ */ new Map());
|
|
1050
|
+
const iconFields = [{
|
|
1051
|
+
id: "iconLeft",
|
|
1052
|
+
type: "text",
|
|
1053
|
+
label: "Left icon",
|
|
1054
|
+
required: false,
|
|
1055
|
+
multiline: false,
|
|
1056
|
+
maxLength: 64,
|
|
1057
|
+
ui: {
|
|
1058
|
+
intent: "style",
|
|
1059
|
+
underLooks: "owner",
|
|
1060
|
+
widget: "iconPicker",
|
|
1061
|
+
iconPickerPreset: "cta"
|
|
1062
|
+
}
|
|
1063
|
+
}, {
|
|
1064
|
+
id: "iconRight",
|
|
1065
|
+
type: "text",
|
|
1066
|
+
label: "Right icon",
|
|
1067
|
+
required: false,
|
|
1068
|
+
multiline: false,
|
|
1069
|
+
maxLength: 64,
|
|
1070
|
+
ui: {
|
|
1071
|
+
intent: "style",
|
|
1072
|
+
underLooks: "owner",
|
|
1073
|
+
widget: "iconPicker",
|
|
1074
|
+
iconPickerPreset: "cta"
|
|
1075
|
+
}
|
|
1076
|
+
}];
|
|
1766
1077
|
return {
|
|
1767
|
-
|
|
1768
|
-
|
|
1078
|
+
id: groupId,
|
|
1079
|
+
type: "group",
|
|
1080
|
+
label: groupLabel,
|
|
1081
|
+
ui: {
|
|
1082
|
+
layout: "grid",
|
|
1083
|
+
columns: 2,
|
|
1084
|
+
gridColsPreset: "simple2",
|
|
1085
|
+
gridColumns: {
|
|
1086
|
+
base: 1,
|
|
1087
|
+
sm: 2
|
|
1088
|
+
},
|
|
1089
|
+
flattenInRepeater,
|
|
1090
|
+
hideLabel: !showGroupLabel
|
|
1091
|
+
},
|
|
1092
|
+
schema: { fields: [...mainFields, ...iconFields] },
|
|
1093
|
+
required: false
|
|
1769
1094
|
};
|
|
1770
1095
|
}
|
|
1771
|
-
|
|
1772
|
-
|
|
1096
|
+
//#endregion
|
|
1097
|
+
//#region ../blocks/src/system/constants/background.ts
|
|
1098
|
+
/**
|
|
1099
|
+
* @file Defines constants for the background field, ensuring a single source of truth
|
|
1100
|
+
* for presets used in both the field definition and the style transforms.
|
|
1101
|
+
*/
|
|
1102
|
+
const BACKGROUND_POSITION_PRESETS = [
|
|
1103
|
+
{
|
|
1104
|
+
value: "center",
|
|
1105
|
+
label: "Centre"
|
|
1106
|
+
},
|
|
1107
|
+
{
|
|
1108
|
+
value: "top",
|
|
1109
|
+
label: "Top"
|
|
1110
|
+
},
|
|
1111
|
+
{
|
|
1112
|
+
value: "top left",
|
|
1113
|
+
label: "Top Left"
|
|
1114
|
+
},
|
|
1115
|
+
{
|
|
1116
|
+
value: "top right",
|
|
1117
|
+
label: "Top Right"
|
|
1118
|
+
},
|
|
1119
|
+
{
|
|
1120
|
+
value: "bottom",
|
|
1121
|
+
label: "Bottom"
|
|
1122
|
+
},
|
|
1123
|
+
{
|
|
1124
|
+
value: "bottom left",
|
|
1125
|
+
label: "Bottom Left"
|
|
1126
|
+
},
|
|
1127
|
+
{
|
|
1128
|
+
value: "bottom right",
|
|
1129
|
+
label: "Bottom Right"
|
|
1130
|
+
},
|
|
1131
|
+
{
|
|
1132
|
+
value: "left",
|
|
1133
|
+
label: "Left"
|
|
1134
|
+
},
|
|
1135
|
+
{
|
|
1136
|
+
value: "right",
|
|
1137
|
+
label: "Right"
|
|
1138
|
+
},
|
|
1139
|
+
{
|
|
1140
|
+
value: "top center",
|
|
1141
|
+
label: "Top Center"
|
|
1142
|
+
},
|
|
1143
|
+
{
|
|
1144
|
+
value: "bottom center",
|
|
1145
|
+
label: "Bottom Center"
|
|
1146
|
+
},
|
|
1147
|
+
{
|
|
1148
|
+
value: "left center",
|
|
1149
|
+
label: "Left Center"
|
|
1150
|
+
},
|
|
1151
|
+
{
|
|
1152
|
+
value: "right center",
|
|
1153
|
+
label: "Right Center"
|
|
1154
|
+
},
|
|
1155
|
+
{
|
|
1156
|
+
value: "left top",
|
|
1157
|
+
label: "Left Top"
|
|
1158
|
+
},
|
|
1159
|
+
{
|
|
1160
|
+
value: "right top",
|
|
1161
|
+
label: "Right Top"
|
|
1162
|
+
},
|
|
1163
|
+
{
|
|
1164
|
+
value: "left bottom",
|
|
1165
|
+
label: "Left Bottom"
|
|
1166
|
+
},
|
|
1167
|
+
{
|
|
1168
|
+
value: "right bottom",
|
|
1169
|
+
label: "Right Bottom"
|
|
1170
|
+
}
|
|
1171
|
+
];
|
|
1172
|
+
const BACKGROUND_POSITION_PRESET_VALUES = BACKGROUND_POSITION_PRESETS.map((p) => p.value);
|
|
1173
|
+
/**
|
|
1174
|
+
* Maps position keywords to rb-* anchor positioning classes.
|
|
1175
|
+
* Used for positioning scaled/overflow images within their containers.
|
|
1176
|
+
*/
|
|
1177
|
+
const POSITION_TO_ANCHOR_CLASSES = {
|
|
1178
|
+
center: "rb-anchor-center",
|
|
1179
|
+
top: "rb-anchor-top",
|
|
1180
|
+
"top center": "rb-anchor-top",
|
|
1181
|
+
bottom: "rb-anchor-bottom",
|
|
1182
|
+
"bottom center": "rb-anchor-bottom",
|
|
1183
|
+
left: "rb-anchor-left",
|
|
1184
|
+
"left center": "rb-anchor-left",
|
|
1185
|
+
right: "rb-anchor-right",
|
|
1186
|
+
"right center": "rb-anchor-right",
|
|
1187
|
+
"top left": "rb-anchor-top-left",
|
|
1188
|
+
"left top": "rb-anchor-top-left",
|
|
1189
|
+
"top right": "rb-anchor-top-right",
|
|
1190
|
+
"right top": "rb-anchor-top-right",
|
|
1191
|
+
"bottom left": "rb-anchor-bottom-left",
|
|
1192
|
+
"left bottom": "rb-anchor-bottom-left",
|
|
1193
|
+
"bottom right": "rb-anchor-bottom-right",
|
|
1194
|
+
"right bottom": "rb-anchor-bottom-right"
|
|
1195
|
+
};
|
|
1196
|
+
/** Default anchor classes when position is null or unrecognized */
|
|
1197
|
+
const DEFAULT_ANCHOR_CLASSES = "rb-anchor-center";
|
|
1198
|
+
/**
|
|
1199
|
+
* Gets rb-* anchor positioning classes for a position keyword.
|
|
1200
|
+
* Used for positioning scaled/overflow background images.
|
|
1201
|
+
*/
|
|
1202
|
+
function getAnchorClasses(position) {
|
|
1203
|
+
if (!position) return DEFAULT_ANCHOR_CLASSES;
|
|
1204
|
+
return POSITION_TO_ANCHOR_CLASSES[position.toLowerCase().trim()] ?? "rb-anchor-center";
|
|
1773
1205
|
}
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1206
|
+
//#endregion
|
|
1207
|
+
//#region ../blocks/src/system/fields/background.ts
|
|
1208
|
+
/**
|
|
1209
|
+
* Widget name constants for background fields.
|
|
1210
|
+
*
|
|
1211
|
+
* These match the keys expected in widgetOverrides.
|
|
1212
|
+
*
|
|
1213
|
+
* IMPORTANT: These values MUST match WIDGET_NAMES in:
|
|
1214
|
+
* `packages/block-form/src/widgets/constants.ts`
|
|
1215
|
+
*
|
|
1216
|
+
* Duplicated here to avoid circular dependency (blocks cannot import block-form).
|
|
1217
|
+
*/
|
|
1218
|
+
const BACKGROUND_WIDGETS = {
|
|
1219
|
+
COLOR: "backgroundColor",
|
|
1220
|
+
GRADIENT: "backgroundGradient"
|
|
1221
|
+
};
|
|
1222
|
+
const BACKGROUND_MEDIA_FIELD_ID = "image";
|
|
1223
|
+
function cloneFieldDefinition$1(field) {
|
|
1779
1224
|
return {
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
acceptedSpans: item.acceptedSpans,
|
|
1783
|
-
sourceIndex,
|
|
1784
|
-
span,
|
|
1785
|
-
row,
|
|
1786
|
-
colStart,
|
|
1787
|
-
colEnd,
|
|
1788
|
-
startCell: toRowCellKey(row, colStart, columns)
|
|
1225
|
+
...field,
|
|
1226
|
+
...field.ui ? { ui: { ...field.ui } } : {}
|
|
1789
1227
|
};
|
|
1790
1228
|
}
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
const count = normalizeRepeaterGridColumns(columns);
|
|
1794
|
-
return items.reduce((placed, item) => {
|
|
1795
|
-
const span = normalizeRepeaterGridSpan(item.span, count);
|
|
1796
|
-
const previous = placed.at(-1);
|
|
1797
|
-
const nextColumn = previous ? previous.colStart + previous.span : 1;
|
|
1798
|
-
const wraps = previous != null && (item.startNewRow === true || nextColumn + span - 1 > count);
|
|
1799
|
-
return [...placed, {
|
|
1800
|
-
...item,
|
|
1801
|
-
span,
|
|
1802
|
-
row: (previous?.row ?? 1) + (wraps ? 1 : 0),
|
|
1803
|
-
colStart: wraps ? 1 : nextColumn
|
|
1804
|
-
}];
|
|
1805
|
-
}, []);
|
|
1806
|
-
}
|
|
1807
|
-
/** @internal */
|
|
1808
|
-
function orderedGridItems(layout) {
|
|
1809
|
-
return [...layout.placements].sort((a, b) => a.sourceIndex - b.sourceIndex);
|
|
1810
|
-
}
|
|
1811
|
-
function isRepeaterGridLayoutInvalid(layout) {
|
|
1812
|
-
return layout.hasInvalidItems || layout.hasCollisions || layout.overCapacity;
|
|
1813
|
-
}
|
|
1814
|
-
function hasInvalidGridItems(items, columns, policy) {
|
|
1815
|
-
const flow = policy === "flow" ? flowRepeaterGridItems(items, columns) : null;
|
|
1816
|
-
return items.some((item, index) => !isValidGridItemGeometry(item, columns) || flow != null && (item.row !== flow[index]?.row || item.colStart !== flow[index]?.colStart));
|
|
1817
|
-
}
|
|
1818
|
-
function isValidGridItemGeometry(item, columns) {
|
|
1819
|
-
return isAcceptedRepeaterGridSpan(item.span, columns, item.acceptedSpans) && parseRepeaterGridInteger(item.row) != null && item.row >= 1 && parseRepeaterGridInteger(item.colStart) != null && item.colStart >= 1 && item.colStart + item.span - 1 <= columns;
|
|
1820
|
-
}
|
|
1821
|
-
function findFlowAppendPlacement(layout, span, startNewRow) {
|
|
1822
|
-
const next = flowRepeaterGridItems([...orderedGridItems(layout), {
|
|
1823
|
-
id: "new",
|
|
1824
|
-
span,
|
|
1825
|
-
row: 1,
|
|
1826
|
-
colStart: 1,
|
|
1827
|
-
startNewRow
|
|
1828
|
-
}], layout.columns).at(-1);
|
|
1829
|
-
return !isRepeaterGridLayoutInvalid(layout) && next && (layout.maxRows == null || next.row <= layout.maxRows) ? {
|
|
1830
|
-
row: next.row,
|
|
1831
|
-
colStart: next.colStart
|
|
1832
|
-
} : null;
|
|
1229
|
+
function mediaTabDescription(kind, includeAdvanced) {
|
|
1230
|
+
return includeAdvanced ? `Background ${kind} with advanced controls` : `Background ${kind}`;
|
|
1833
1231
|
}
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1232
|
+
/**
|
|
1233
|
+
* Creates a TabGroupField for background configuration
|
|
1234
|
+
* with Color/Gradient/Image tabs and advanced media options.
|
|
1235
|
+
*
|
|
1236
|
+
* ## Data Structure
|
|
1237
|
+
*
|
|
1238
|
+
* This factory sets `activeTabField: 'type'`. The 'type' field is NOT explicitly
|
|
1239
|
+
* declared but is managed implicitly by TabGroupField. When the user switches tabs,
|
|
1240
|
+
* the widget writes the tab ID to the path `{id}.type`.
|
|
1241
|
+
*
|
|
1242
|
+
* Persistence projects the selected tab into the canonical discriminated
|
|
1243
|
+
* `BackgroundContent` union. Fields owned by inactive tabs are not stored.
|
|
1244
|
+
*
|
|
1245
|
+
* ## SDK Filtering
|
|
1246
|
+
*
|
|
1247
|
+
* Each tab has an `sdkSectionOption` that allows SDK sites to control tab visibility:
|
|
1248
|
+
* - `backgroundColor` - Controls Color tab
|
|
1249
|
+
* - `backgroundGradient` - Controls Gradient tab
|
|
1250
|
+
* - `backgroundImage` - Controls Image tab
|
|
1251
|
+
*
|
|
1252
|
+
* @param options - Configuration options
|
|
1253
|
+
* @param options.id - Field ID (default: 'background')
|
|
1254
|
+
* @param options.label - Field label (default: 'Background')
|
|
1255
|
+
* @param options.allowColor - Include Color tab (default: true)
|
|
1256
|
+
* @param options.allowGradient - Include Gradient tab (default: true)
|
|
1257
|
+
* @param options.allowImage - Include Image tab (default: true)
|
|
1258
|
+
* @param options.includeAdvanced - Include advanced image/video options (default: false)
|
|
1259
|
+
*/
|
|
1260
|
+
function createBackgroundField(options = {}) {
|
|
1261
|
+
const { id = "background", label = "Background", allowColor = true, allowGradient = true, allowImage = true, includeAdvanced = false } = options;
|
|
1262
|
+
const tabs = [];
|
|
1263
|
+
const textColorField = {
|
|
1264
|
+
id: "textColor",
|
|
1265
|
+
type: "text",
|
|
1266
|
+
label: "Text color",
|
|
1267
|
+
description: "Optional text color token to use on top of this background.",
|
|
1268
|
+
required: false,
|
|
1269
|
+
multiline: false,
|
|
1270
|
+
ui: { widget: BACKGROUND_WIDGETS.COLOR }
|
|
1859
1271
|
};
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
columns,
|
|
1869
|
-
maxRows,
|
|
1870
|
-
placementPolicy: input.placementPolicy
|
|
1871
|
-
});
|
|
1872
|
-
if (input.placementPolicy === "flow") return findFlowAppendPlacement(layout, span, input.startNewRow);
|
|
1873
|
-
const { occupancy } = buildOccupancyByCell(layout.placements, columns);
|
|
1874
|
-
const rowLimit = maxRows ?? Math.max(1, layout.maxRowUsed + 1);
|
|
1875
|
-
if (isRepeaterGridLayoutInvalid(layout)) return null;
|
|
1876
|
-
const maxColStart = columns - span + 1;
|
|
1877
|
-
return Array.from({ length: rowLimit * maxColStart }, (_, index) => ({
|
|
1878
|
-
row: Math.floor(index / maxColStart) + 1,
|
|
1879
|
-
colStart: index % maxColStart + 1
|
|
1880
|
-
})).find(({ row, colStart }) => getOverlappingItemIds({
|
|
1881
|
-
occupancy,
|
|
1882
|
-
row,
|
|
1883
|
-
colStart,
|
|
1884
|
-
span,
|
|
1885
|
-
columns
|
|
1886
|
-
}).size === 0) ?? null;
|
|
1887
|
-
}
|
|
1888
|
-
//#endregion
|
|
1889
|
-
//#region ../blocks/src/system/layout/repeaterGrid.ts
|
|
1890
|
-
/** Narrow rendering is a projection only. Never feed these placements into an authoring write. */
|
|
1891
|
-
function projectRepeaterGridLayout(layout, columns) {
|
|
1892
|
-
if (isRepeaterGridLayoutInvalid(layout)) return projectRepeaterGridLayoutForRendering(layout, columns);
|
|
1893
|
-
if (columns === layout.columns) return layout;
|
|
1894
|
-
if (layout.placementPolicy === "flow") return buildProjectedRepeaterGridLayout(layout, flowRepeaterGridItems(orderedGridItems(layout), columns), columns);
|
|
1895
|
-
return buildProjectedRepeaterGridLayout(layout, layout.placements.reduce((placed, item) => {
|
|
1896
|
-
const span = normalizeRepeaterGridSpan(item.span, columns);
|
|
1897
|
-
const destination = findFirstAvailableRepeaterGridPlacement({
|
|
1898
|
-
items: placed,
|
|
1899
|
-
newItemSpan: span,
|
|
1900
|
-
columns
|
|
1901
|
-
});
|
|
1902
|
-
return [...placed, {
|
|
1903
|
-
id: item.id,
|
|
1904
|
-
span,
|
|
1905
|
-
row: destination?.row ?? placed.length + 1,
|
|
1906
|
-
colStart: destination?.colStart ?? 1
|
|
1907
|
-
}];
|
|
1908
|
-
}, []), columns);
|
|
1909
|
-
}
|
|
1910
|
-
function buildProjectedRepeaterGridLayout(source, items, columns) {
|
|
1911
|
-
const projected = buildRepeaterGridLayout({
|
|
1912
|
-
items: items.map(({ id, span, row, colStart, startNewRow }) => ({
|
|
1913
|
-
id,
|
|
1914
|
-
span,
|
|
1915
|
-
row,
|
|
1916
|
-
colStart,
|
|
1917
|
-
startNewRow
|
|
1918
|
-
})),
|
|
1919
|
-
columns,
|
|
1920
|
-
placementPolicy: source.placementPolicy === "flow" || isRepeaterGridLayoutInvalid(source) ? "flow" : source.placementPolicy
|
|
1921
|
-
});
|
|
1922
|
-
const placements = projected.placements.map((item) => ({
|
|
1923
|
-
...item,
|
|
1924
|
-
sourceIndex: source.byId[item.id]?.sourceIndex ?? item.sourceIndex
|
|
1925
|
-
}));
|
|
1926
|
-
return {
|
|
1927
|
-
...projected,
|
|
1928
|
-
placements,
|
|
1929
|
-
byId: Object.fromEntries(placements.map((item) => [item.id, item]))
|
|
1272
|
+
const headingColorField = {
|
|
1273
|
+
id: "headingColor",
|
|
1274
|
+
type: "text",
|
|
1275
|
+
label: "Heading color",
|
|
1276
|
+
description: "Optional color token for headings. Falls back to text color if not set.",
|
|
1277
|
+
required: false,
|
|
1278
|
+
multiline: false,
|
|
1279
|
+
ui: { widget: BACKGROUND_WIDGETS.COLOR }
|
|
1930
1280
|
};
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
if (span.type !== "select") return;
|
|
1950
|
-
const options = span.options ?? [];
|
|
1951
|
-
const invalidOptions = options.some((option) => !isAcceptedRepeaterGridSpan(option.value, columns) || String(Number(option.value)) !== option.value);
|
|
1952
|
-
if (span.multiple || options.length === 0 || invalidOptions || span.source && span.source.kind !== "static") ctx.addIssue({
|
|
1953
|
-
code: "custom",
|
|
1954
|
-
path: ["ui", "layoutGridSpanField"],
|
|
1955
|
-
message: `Layout-grid span select must have single, static integer options within 1..${columns}`
|
|
1956
|
-
});
|
|
1957
|
-
if (span.defaultValue !== void 0 && !options.some((option) => option.value === span.defaultValue)) ctx.addIssue({
|
|
1958
|
-
code: "custom",
|
|
1959
|
-
path: ["ui", "layoutGridSpanField"],
|
|
1960
|
-
message: "Layout-grid default span must be one of the span select options"
|
|
1281
|
+
if (allowColor) tabs.push({
|
|
1282
|
+
id: "color",
|
|
1283
|
+
label: "Color",
|
|
1284
|
+
description: "Solid color background using theme tokens or custom colors",
|
|
1285
|
+
sdkSectionOption: "backgroundColor",
|
|
1286
|
+
fields: [
|
|
1287
|
+
{
|
|
1288
|
+
id: "color",
|
|
1289
|
+
type: "text",
|
|
1290
|
+
label: "Color",
|
|
1291
|
+
description: "Select a background color from the available options.",
|
|
1292
|
+
required: false,
|
|
1293
|
+
multiline: false,
|
|
1294
|
+
ui: { widget: BACKGROUND_WIDGETS.COLOR }
|
|
1295
|
+
},
|
|
1296
|
+
textColorField,
|
|
1297
|
+
headingColorField
|
|
1298
|
+
]
|
|
1961
1299
|
});
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1300
|
+
if (allowGradient) tabs.push({
|
|
1301
|
+
id: "gradient",
|
|
1302
|
+
label: "Gradient",
|
|
1303
|
+
description: "CSS gradient background",
|
|
1304
|
+
sdkSectionOption: "backgroundGradient",
|
|
1305
|
+
fields: [
|
|
1306
|
+
{
|
|
1307
|
+
id: "gradient",
|
|
1308
|
+
type: "text",
|
|
1309
|
+
label: "Gradient",
|
|
1310
|
+
description: "Select a gradient from theme presets.",
|
|
1311
|
+
required: false,
|
|
1312
|
+
multiline: false,
|
|
1313
|
+
ui: { widget: BACKGROUND_WIDGETS.GRADIENT }
|
|
1314
|
+
},
|
|
1315
|
+
textColorField,
|
|
1316
|
+
headingColorField
|
|
1317
|
+
]
|
|
1971
1318
|
});
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1319
|
+
if (allowImage) {
|
|
1320
|
+
const mediaFields = [
|
|
1321
|
+
{
|
|
1322
|
+
id: BACKGROUND_MEDIA_FIELD_ID,
|
|
1323
|
+
type: "media",
|
|
1324
|
+
label: "Image",
|
|
1325
|
+
mediaKinds: ["image"],
|
|
1326
|
+
required: false
|
|
1327
|
+
},
|
|
1328
|
+
textColorField,
|
|
1329
|
+
headingColorField
|
|
1330
|
+
];
|
|
1331
|
+
if (includeAdvanced) {
|
|
1332
|
+
const objectFitField = {
|
|
1333
|
+
id: "objectFit",
|
|
1334
|
+
type: "select",
|
|
1335
|
+
label: "Media sizing",
|
|
1336
|
+
description: "How the image or video should be sized and positioned.",
|
|
1337
|
+
required: false,
|
|
1338
|
+
multiple: false,
|
|
1339
|
+
options: [
|
|
1340
|
+
{
|
|
1341
|
+
value: "fill",
|
|
1342
|
+
label: "Fill (cover)"
|
|
1343
|
+
},
|
|
1344
|
+
{
|
|
1345
|
+
value: "fit",
|
|
1346
|
+
label: "Fit (contain)"
|
|
1347
|
+
},
|
|
1348
|
+
{
|
|
1349
|
+
value: "original",
|
|
1350
|
+
label: "Original size"
|
|
1351
|
+
},
|
|
1352
|
+
{
|
|
1353
|
+
value: "custom",
|
|
1354
|
+
label: "Scale up"
|
|
1355
|
+
}
|
|
1356
|
+
]
|
|
1357
|
+
};
|
|
1358
|
+
const scaleField = {
|
|
1359
|
+
id: "scale",
|
|
1360
|
+
type: "presetOrCustom",
|
|
1361
|
+
label: "Scale",
|
|
1362
|
+
description: "Media scale amount.",
|
|
1363
|
+
required: false,
|
|
1364
|
+
ui: { visibleWhen: {
|
|
1365
|
+
field: "objectFit",
|
|
1366
|
+
equals: "custom"
|
|
1367
|
+
} },
|
|
1368
|
+
presets: [
|
|
1369
|
+
{
|
|
1370
|
+
value: "125",
|
|
1371
|
+
label: "125%"
|
|
1372
|
+
},
|
|
1373
|
+
{
|
|
1374
|
+
value: "150",
|
|
1375
|
+
label: "150%"
|
|
1376
|
+
},
|
|
1377
|
+
{
|
|
1378
|
+
value: "175",
|
|
1379
|
+
label: "175%"
|
|
1380
|
+
},
|
|
1381
|
+
{
|
|
1382
|
+
value: "200",
|
|
1383
|
+
label: "200%"
|
|
1384
|
+
}
|
|
1385
|
+
],
|
|
1386
|
+
customInput: {
|
|
1387
|
+
placeholder: "e.g., 800px, 50vw, 175%",
|
|
1388
|
+
helpText: "Enter a custom size using %, px, vh, vw, rem, or em units"
|
|
1389
|
+
}
|
|
1390
|
+
};
|
|
1391
|
+
const positionField = {
|
|
1392
|
+
id: "position",
|
|
1393
|
+
type: "presetOrCustom",
|
|
1394
|
+
label: "Position",
|
|
1395
|
+
description: "Anchor point for scaled media. For \"Fill\" mode, the media focus point (if set) takes precedence.",
|
|
1396
|
+
required: false,
|
|
1397
|
+
presets: [...BACKGROUND_POSITION_PRESETS],
|
|
1398
|
+
customInput: {
|
|
1399
|
+
placeholder: "e.g., 25% 75%, top 20px left 50px",
|
|
1400
|
+
helpText: "Enter a custom CSS background-position value"
|
|
1401
|
+
}
|
|
1402
|
+
};
|
|
1403
|
+
const opacityField = {
|
|
1404
|
+
id: "opacity",
|
|
1405
|
+
type: "number",
|
|
1406
|
+
label: "Opacity",
|
|
1407
|
+
description: "Image or video opacity (0-100).",
|
|
1408
|
+
required: false,
|
|
1409
|
+
ui: {
|
|
1410
|
+
widget: "slider",
|
|
1411
|
+
min: 0,
|
|
1412
|
+
max: 100,
|
|
1413
|
+
step: 5
|
|
1414
|
+
}
|
|
1415
|
+
};
|
|
1416
|
+
const overlayTypeField = {
|
|
1417
|
+
id: "overlay.type",
|
|
1418
|
+
type: "select",
|
|
1419
|
+
label: "Overlay",
|
|
1420
|
+
description: "Add a color or gradient overlay on top of the image or video.",
|
|
1421
|
+
required: false,
|
|
1422
|
+
multiple: false,
|
|
1423
|
+
options: [
|
|
1424
|
+
{
|
|
1425
|
+
value: "none",
|
|
1426
|
+
label: "None"
|
|
1427
|
+
},
|
|
1428
|
+
{
|
|
1429
|
+
value: "color",
|
|
1430
|
+
label: "Color"
|
|
1431
|
+
},
|
|
1432
|
+
{
|
|
1433
|
+
value: "gradient",
|
|
1434
|
+
label: "Gradient"
|
|
1435
|
+
}
|
|
1436
|
+
]
|
|
1437
|
+
};
|
|
1438
|
+
const overlayColorField = {
|
|
1439
|
+
id: "overlay.color",
|
|
1440
|
+
type: "text",
|
|
1441
|
+
label: "Overlay color",
|
|
1442
|
+
required: false,
|
|
1443
|
+
multiline: false,
|
|
1444
|
+
ui: {
|
|
1445
|
+
widget: BACKGROUND_WIDGETS.COLOR,
|
|
1446
|
+
visibleWhen: {
|
|
1447
|
+
field: "type",
|
|
1448
|
+
equals: "color"
|
|
1449
|
+
}
|
|
1450
|
+
}
|
|
1451
|
+
};
|
|
1452
|
+
const overlayGradientField = {
|
|
1453
|
+
id: "overlay.gradient",
|
|
1454
|
+
type: "text",
|
|
1455
|
+
label: "Overlay gradient",
|
|
1456
|
+
required: false,
|
|
1457
|
+
multiline: false,
|
|
1458
|
+
ui: {
|
|
1459
|
+
widget: BACKGROUND_WIDGETS.GRADIENT,
|
|
1460
|
+
visibleWhen: {
|
|
1461
|
+
field: "type",
|
|
1462
|
+
equals: "gradient"
|
|
1463
|
+
}
|
|
1464
|
+
}
|
|
1465
|
+
};
|
|
1466
|
+
mediaFields.push(objectFitField, scaleField, positionField, opacityField, overlayTypeField, overlayColorField, overlayGradientField, {
|
|
1467
|
+
id: "overlay.opacity",
|
|
1468
|
+
type: "number",
|
|
1469
|
+
label: "Overlay opacity",
|
|
1470
|
+
description: "Overlay opacity (0-100).",
|
|
1471
|
+
required: false,
|
|
1472
|
+
ui: {
|
|
1473
|
+
widget: "slider",
|
|
1474
|
+
min: 0,
|
|
1475
|
+
max: 100,
|
|
1476
|
+
step: 5,
|
|
1477
|
+
visibleWhen: {
|
|
1478
|
+
field: "type",
|
|
1479
|
+
oneOf: ["color", "gradient"]
|
|
1480
|
+
}
|
|
1481
|
+
}
|
|
1482
|
+
});
|
|
1483
|
+
}
|
|
1484
|
+
tabs.push({
|
|
1485
|
+
id: "image",
|
|
1486
|
+
label: "Image",
|
|
1487
|
+
description: mediaTabDescription("image", includeAdvanced),
|
|
1488
|
+
sdkSectionOption: "backgroundImage",
|
|
1489
|
+
fields: mediaFields
|
|
1985
1490
|
});
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1491
|
+
const videoFields = mediaFields.map((field) => {
|
|
1492
|
+
const clonedField = cloneFieldDefinition$1(field);
|
|
1493
|
+
if (clonedField.id !== BACKGROUND_MEDIA_FIELD_ID) return clonedField;
|
|
1494
|
+
return {
|
|
1495
|
+
...clonedField,
|
|
1496
|
+
label: "Video",
|
|
1497
|
+
mediaKinds: ["video"]
|
|
1498
|
+
};
|
|
1990
1499
|
});
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1500
|
+
videoFields.splice(1, 0, {
|
|
1501
|
+
id: "showVideoOnMobile",
|
|
1502
|
+
type: "boolean",
|
|
1503
|
+
label: "Show video on mobile",
|
|
1504
|
+
description: "Off by default so mobile visitors see the fallback background instead of autoplay video.",
|
|
1505
|
+
required: false,
|
|
1506
|
+
defaultValue: false
|
|
1995
1507
|
});
|
|
1996
|
-
|
|
1997
|
-
|
|
1508
|
+
tabs.push({
|
|
1509
|
+
id: "video",
|
|
1510
|
+
label: "Video",
|
|
1511
|
+
description: mediaTabDescription("video", includeAdvanced),
|
|
1512
|
+
sdkSectionOption: "backgroundImage",
|
|
1513
|
+
fields: videoFields
|
|
1514
|
+
});
|
|
1515
|
+
}
|
|
1516
|
+
return {
|
|
1517
|
+
id,
|
|
1518
|
+
type: "tabGroup",
|
|
1519
|
+
label,
|
|
1520
|
+
required: false,
|
|
1521
|
+
tabs,
|
|
1522
|
+
activeTabField: "type",
|
|
1523
|
+
ui: {
|
|
1524
|
+
hideLabel: false,
|
|
1525
|
+
valueContract: "boxBackground"
|
|
1526
|
+
}
|
|
1527
|
+
};
|
|
1998
1528
|
}
|
|
1999
1529
|
//#endregion
|
|
2000
|
-
//#region ../blocks/src/system/
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
const
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
"eventCategories",
|
|
2031
|
-
"eventSeries",
|
|
2032
|
-
"venues",
|
|
2033
|
-
"staffMembers",
|
|
2034
|
-
"appointmentServiceCategories"
|
|
2035
|
-
];
|
|
2036
|
-
const mediaDeliverySchema = z.object({
|
|
2037
|
-
sizes: z.string().optional(),
|
|
2038
|
-
widthCandidates: z.array(z.number().int().positive()).optional(),
|
|
2039
|
-
maxCssWidth: z.number().positive().optional(),
|
|
2040
|
-
maxCssHeight: z.number().positive().optional(),
|
|
2041
|
-
strategy: z.enum([
|
|
2042
|
-
"default",
|
|
2043
|
-
"columnsAuto",
|
|
2044
|
-
"imageGalleryVariant"
|
|
2045
|
-
]).optional(),
|
|
2046
|
-
strategyOptions: z.record(z.string(), z.unknown()).optional()
|
|
2047
|
-
});
|
|
2048
|
-
const selectOptionSchema = z.object({
|
|
2049
|
-
value: z.string(),
|
|
2050
|
-
label: z.string(),
|
|
2051
|
-
description: z.string().optional(),
|
|
2052
|
-
icon: z.string().optional()
|
|
2053
|
-
});
|
|
2054
|
-
const selectSourceSchema = z.discriminatedUnion("kind", [
|
|
2055
|
-
z.object({ kind: z.literal("static") }),
|
|
2056
|
-
z.object({
|
|
2057
|
-
kind: z.literal("site"),
|
|
2058
|
-
optionSource: z.enum(siteOptionSources)
|
|
2059
|
-
}),
|
|
2060
|
-
z.object({ kind: z.literal("sdk") })
|
|
2061
|
-
]);
|
|
2062
|
-
function assertNeverSelectSource(value) {
|
|
2063
|
-
throw new Error(`Unhandled select source: ${JSON.stringify(value)}`);
|
|
2064
|
-
}
|
|
2065
|
-
const visibleWhenPredicateSchema = z.object({
|
|
2066
|
-
field: z.string().min(1),
|
|
2067
|
-
equals: z.any().optional(),
|
|
2068
|
-
notEquals: z.any().optional(),
|
|
2069
|
-
oneOf: z.array(z.any()).optional(),
|
|
2070
|
-
notIn: z.array(z.any()).optional(),
|
|
2071
|
-
minItems: z.number().int().nonnegative().optional(),
|
|
2072
|
-
maxItems: z.number().int().nonnegative().optional()
|
|
2073
|
-
});
|
|
2074
|
-
const visibleWhenSchema = z.lazy(() => z.union([
|
|
2075
|
-
visibleWhenPredicateSchema,
|
|
2076
|
-
z.object({ allOf: z.array(visibleWhenSchema).min(1) }),
|
|
2077
|
-
z.object({ anyOf: z.array(visibleWhenSchema).min(1) })
|
|
2078
|
-
]));
|
|
2079
|
-
const uiSchema = z.object({
|
|
2080
|
-
widget: z.string().optional(),
|
|
2081
|
-
preset: z.enum(["disclosure"]).optional(),
|
|
2082
|
-
flattenInRepeater: z.boolean().optional(),
|
|
2083
|
-
hidden: z.boolean().optional(),
|
|
2084
|
-
hideLabel: z.boolean().optional(),
|
|
2085
|
-
hideDescription: z.boolean().optional(),
|
|
2086
|
-
showCharCount: z.union([z.number().int().positive(), z.object({ max: z.number().int().positive() })]).optional(),
|
|
2087
|
-
showSlugPreview: z.boolean().optional(),
|
|
2088
|
-
variant: z.enum([
|
|
2089
|
-
"full",
|
|
2090
|
-
"inline",
|
|
2091
|
-
"limited",
|
|
2092
|
-
"media",
|
|
2093
|
-
"notes"
|
|
2094
|
-
]).optional(),
|
|
2095
|
-
richTextVariant: z.enum([
|
|
2096
|
-
"full",
|
|
2097
|
-
"inline",
|
|
2098
|
-
"limited",
|
|
2099
|
-
"media",
|
|
2100
|
-
"notes"
|
|
2101
|
-
]).optional(),
|
|
2102
|
-
cropEditorMode: z.enum(["dialog", "inline"]).optional(),
|
|
2103
|
-
cropEditorAutoOpen: z.boolean().optional(),
|
|
2104
|
-
mediaPickerAutoOpen: z.boolean().optional(),
|
|
2105
|
-
showMediaPreview: z.boolean().optional(),
|
|
2106
|
-
showMediaOverlayActions: z.boolean().optional(),
|
|
2107
|
-
mediaPreviewMaxWidth: z.enum([
|
|
2108
|
-
"xs",
|
|
2109
|
-
"sm",
|
|
2110
|
-
"md",
|
|
2111
|
-
"none"
|
|
2112
|
-
]).optional(),
|
|
2113
|
-
preventMediaPreviewUpscale: z.boolean().optional(),
|
|
2114
|
-
mediaDelivery: mediaDeliverySchema.optional(),
|
|
2115
|
-
mediaDeliveryByVariant: z.record(z.string(), mediaDeliverySchema).optional(),
|
|
2116
|
-
inputType: z.enum([
|
|
2117
|
-
"text",
|
|
2118
|
-
"email",
|
|
2119
|
-
"tel",
|
|
2120
|
-
"number"
|
|
2121
|
-
]).optional(),
|
|
2122
|
-
min: z.number().optional(),
|
|
2123
|
-
max: z.number().optional(),
|
|
2124
|
-
step: z.number().optional(),
|
|
2125
|
-
showValue: z.boolean().optional(),
|
|
2126
|
-
valueUnit: z.enum([
|
|
2127
|
-
"percent",
|
|
2128
|
-
"pixels",
|
|
2129
|
-
"unitless"
|
|
2130
|
-
]).optional(),
|
|
2131
|
-
unsetValue: z.enum(["max", "field-default"]).optional(),
|
|
2132
|
-
allowDirectInput: z.boolean().optional(),
|
|
2133
|
-
pattern: z.string().optional(),
|
|
2134
|
-
placeholder: z.string().optional(),
|
|
2135
|
-
visibleWhen: visibleWhenSchema.optional(),
|
|
2136
|
-
modalConfig: z.object({
|
|
2137
|
-
buttonLabel: z.string().optional(),
|
|
2138
|
-
description: z.string().optional(),
|
|
2139
|
-
buttonVariant: z.enum(["default", "outline"]).optional(),
|
|
2140
|
-
showCustomizedIndicator: z.boolean().optional(),
|
|
2141
|
-
maxWidth: z.string().optional()
|
|
2142
|
-
}).optional(),
|
|
2143
|
-
allowedTypes: z.array(z.enum([
|
|
2144
|
-
"color",
|
|
2145
|
-
"gradient",
|
|
2146
|
-
"image"
|
|
2147
|
-
])).optional(),
|
|
2148
|
-
fullWidth: z.boolean().optional(),
|
|
2149
|
-
row: z.string().optional(),
|
|
2150
|
-
colSpan: z.number().int().min(1).max(4).optional(),
|
|
2151
|
-
layout: z.enum(["stack", "grid"]).optional(),
|
|
2152
|
-
columns: z.number().int().min(2).max(4).optional(),
|
|
2153
|
-
gridColsPreset: z.enum([
|
|
2154
|
-
"simple2",
|
|
2155
|
-
"simple3",
|
|
2156
|
-
"simple4",
|
|
2157
|
-
"buttonCtaRow"
|
|
2158
|
-
]).optional(),
|
|
2159
|
-
gridColumns: z.object({
|
|
2160
|
-
base: z.number().int().min(1).max(4).optional(),
|
|
2161
|
-
sm: z.number().int().min(1).max(4).optional(),
|
|
2162
|
-
md: z.number().int().min(1).max(4).optional(),
|
|
2163
|
-
lg: z.number().int().min(1).max(4).optional(),
|
|
2164
|
-
xl: z.number().int().min(1).max(4).optional()
|
|
2165
|
-
}).optional(),
|
|
2166
|
-
gridColsClassName: z.string().optional(),
|
|
2167
|
-
repeaterPreset: z.enum(["thumbnailGrid", "layoutGrid"]).optional(),
|
|
2168
|
-
thumbnailField: z.string().optional(),
|
|
2169
|
-
thumbnailAltField: z.string().optional(),
|
|
2170
|
-
thumbnailLabelField: z.string().optional(),
|
|
2171
|
-
thumbnailAspectRatio: z.string().optional(),
|
|
2172
|
-
thumbnailCardDensity: z.enum(["compact", "comfortable"]).optional(),
|
|
2173
|
-
layoutGridColumns: z.union([
|
|
2174
|
-
z.literal(1),
|
|
2175
|
-
z.literal(2),
|
|
2176
|
-
z.literal(3),
|
|
2177
|
-
z.literal(4),
|
|
2178
|
-
z.literal(5),
|
|
2179
|
-
z.literal(6)
|
|
2180
|
-
]).optional(),
|
|
2181
|
-
layoutGridColumnsFields: z.object({
|
|
2182
|
-
base: z.string().optional(),
|
|
2183
|
-
sm: z.string().optional(),
|
|
2184
|
-
md: z.string().optional(),
|
|
2185
|
-
lg: z.string().min(1),
|
|
2186
|
-
xl: z.string().optional()
|
|
2187
|
-
}).optional(),
|
|
2188
|
-
layoutGridSpanField: z.string().optional(),
|
|
2189
|
-
layoutGridStartNewRowField: z.string().optional(),
|
|
2190
|
-
layoutGridRowField: z.string().optional(),
|
|
2191
|
-
layoutGridColumnField: z.string().optional(),
|
|
2192
|
-
layoutGridMaxRows: z.number().int().positive().optional(),
|
|
2193
|
-
iconPickerPreset: z.enum(ICON_PICKER_PRESETS).optional(),
|
|
2194
|
-
contentTypeField: z.string().optional(),
|
|
2195
|
-
fixedContentType: z.string().optional(),
|
|
2196
|
-
valueFrom: z.enum([
|
|
2197
|
-
"id",
|
|
2198
|
-
"identifier",
|
|
2199
|
-
"slug"
|
|
2200
|
-
]).optional(),
|
|
2201
|
-
siteOptionSource: z.enum(siteOptionSources).optional(),
|
|
2202
|
-
searchThreshold: z.number().int().positive().optional(),
|
|
2203
|
-
renderInHeader: z.boolean().optional(),
|
|
2204
|
-
intent: z.enum([
|
|
2205
|
-
"content",
|
|
2206
|
-
"display",
|
|
2207
|
-
"behavior",
|
|
2208
|
-
"style"
|
|
2209
|
-
]).optional(),
|
|
2210
|
-
/**
|
|
2211
|
-
* Under an arrangement Look, `display` and `style` fields belong to the
|
|
2212
|
-
* Look. `'owner'` keeps a presentation choice with the owner anyway, such
|
|
2213
|
-
* as primary or secondary on a button they added.
|
|
2214
|
-
*/
|
|
2215
|
-
underLooks: z.literal("owner").optional(),
|
|
2216
|
-
valueContract: z.enum(["boxBackground", "location"]).optional()
|
|
2217
|
-
}).partial().superRefine((ui, ctx) => {
|
|
2218
|
-
if (ui.layoutGridColumns !== void 0 && ui.layoutGridColumnsFields !== void 0) ctx.addIssue({
|
|
2219
|
-
code: "custom",
|
|
2220
|
-
path: ["layoutGridColumns"],
|
|
2221
|
-
message: "Layout-grid requires exactly one of ui.layoutGridColumns or ui.layoutGridColumnsFields.lg; do not set both"
|
|
2222
|
-
});
|
|
2223
|
-
}).transform((input) => {
|
|
2224
|
-
const { layoutGridColumns, layoutGridColumnsFields, ...ui } = input;
|
|
2225
|
-
if (layoutGridColumns !== void 0) return {
|
|
2226
|
-
...ui,
|
|
2227
|
-
layoutGridColumns
|
|
1530
|
+
//#region ../blocks/src/system/fields/boxStyles.ts
|
|
1531
|
+
/**
|
|
1532
|
+
* Internal helper to create box styles with depth (container or card).
|
|
1533
|
+
*
|
|
1534
|
+
* Both containers and cards support:
|
|
1535
|
+
* - Background (color/gradient/image with advanced options)
|
|
1536
|
+
* - Inner spacing (padding)
|
|
1537
|
+
* - Raised (elevation shadow)
|
|
1538
|
+
* - Rounded corners (border radius)
|
|
1539
|
+
*
|
|
1540
|
+
* This function is used internally by `containerStylesField()` and `cardStylesField()`
|
|
1541
|
+
* to avoid code duplication while maintaining separate public APIs.
|
|
1542
|
+
*
|
|
1543
|
+
* @internal
|
|
1544
|
+
* @param type - Box style type discriminator ('container' or 'card')
|
|
1545
|
+
* @param options - Customization options passed from public field helpers
|
|
1546
|
+
* @returns A modal FieldDefinition with depth-specific fields
|
|
1547
|
+
*/
|
|
1548
|
+
function createBoxStylesFieldWithDepth(type, options = {}) {
|
|
1549
|
+
const defaults = {
|
|
1550
|
+
container: {
|
|
1551
|
+
id: "_containerStyles",
|
|
1552
|
+
label: "Container styles",
|
|
1553
|
+
contextName: "container"
|
|
1554
|
+
},
|
|
1555
|
+
card: {
|
|
1556
|
+
id: "_cardStyles",
|
|
1557
|
+
label: "Card styles",
|
|
1558
|
+
contextName: "card"
|
|
1559
|
+
}
|
|
2228
1560
|
};
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
1561
|
+
const { id = defaults[type].id, label = defaults[type].label, includeBackground = true, renderInHeader, intent } = options;
|
|
1562
|
+
const contextName = defaults[type].contextName;
|
|
1563
|
+
const fields = [];
|
|
1564
|
+
if (includeBackground) fields.push(createBackgroundField({
|
|
1565
|
+
id: "background",
|
|
1566
|
+
label: "Background",
|
|
1567
|
+
allowColor: true,
|
|
1568
|
+
allowGradient: true,
|
|
1569
|
+
allowImage: true,
|
|
1570
|
+
includeAdvanced: true
|
|
1571
|
+
}));
|
|
1572
|
+
fields.push({
|
|
1573
|
+
id: "spacing",
|
|
1574
|
+
type: "select",
|
|
1575
|
+
label: "Inner spacing",
|
|
1576
|
+
description: `Space inside the ${contextName}, around its content.`,
|
|
1577
|
+
required: false,
|
|
1578
|
+
multiple: false,
|
|
1579
|
+
options: [
|
|
1580
|
+
{
|
|
1581
|
+
value: "none",
|
|
1582
|
+
label: "None"
|
|
1583
|
+
},
|
|
1584
|
+
{
|
|
1585
|
+
value: "compact",
|
|
1586
|
+
label: "Compact"
|
|
1587
|
+
},
|
|
1588
|
+
{
|
|
1589
|
+
value: "cozy",
|
|
1590
|
+
label: "Cosy"
|
|
1591
|
+
},
|
|
1592
|
+
{
|
|
1593
|
+
value: "medium",
|
|
1594
|
+
label: "Medium"
|
|
1595
|
+
},
|
|
1596
|
+
{
|
|
1597
|
+
value: "comfortable",
|
|
1598
|
+
label: "Comfortable"
|
|
1599
|
+
},
|
|
1600
|
+
{
|
|
1601
|
+
value: "spacious",
|
|
1602
|
+
label: "Spacious"
|
|
1603
|
+
}
|
|
1604
|
+
]
|
|
1605
|
+
});
|
|
1606
|
+
if (type === "card") fields.push({
|
|
1607
|
+
id: "border",
|
|
1608
|
+
type: "group",
|
|
1609
|
+
label: "Border",
|
|
1610
|
+
required: false,
|
|
1611
|
+
schema: { fields: [
|
|
1612
|
+
{
|
|
1613
|
+
id: "enabled",
|
|
1614
|
+
type: "boolean",
|
|
1615
|
+
label: "Show border",
|
|
1616
|
+
description: "If you don't set this, the card uses your site style's border.",
|
|
1617
|
+
required: false
|
|
1618
|
+
},
|
|
1619
|
+
{
|
|
1620
|
+
id: "width",
|
|
1621
|
+
type: "select",
|
|
1622
|
+
label: "Border width",
|
|
1623
|
+
required: false,
|
|
1624
|
+
multiple: false,
|
|
1625
|
+
options: [
|
|
1626
|
+
{
|
|
1627
|
+
value: "none",
|
|
1628
|
+
label: "None"
|
|
1629
|
+
},
|
|
1630
|
+
{
|
|
1631
|
+
value: "1",
|
|
1632
|
+
label: "Thin (1px)"
|
|
1633
|
+
},
|
|
1634
|
+
{
|
|
1635
|
+
value: "2",
|
|
1636
|
+
label: "Medium (2px)"
|
|
1637
|
+
},
|
|
1638
|
+
{
|
|
1639
|
+
value: "3",
|
|
1640
|
+
label: "Thick (3px)"
|
|
1641
|
+
}
|
|
1642
|
+
],
|
|
1643
|
+
ui: { visibleWhen: {
|
|
1644
|
+
field: "enabled",
|
|
1645
|
+
equals: true
|
|
1646
|
+
} }
|
|
1647
|
+
},
|
|
1648
|
+
{
|
|
1649
|
+
id: "colorToken",
|
|
1650
|
+
type: "text",
|
|
1651
|
+
label: "Border colour",
|
|
1652
|
+
description: "A colour name from your site style, such as border or primary.",
|
|
1653
|
+
required: false,
|
|
1654
|
+
multiline: false,
|
|
1655
|
+
defaultValue: "border",
|
|
1656
|
+
ui: { visibleWhen: {
|
|
1657
|
+
field: "enabled",
|
|
1658
|
+
equals: true
|
|
1659
|
+
} }
|
|
1660
|
+
}
|
|
1661
|
+
] }
|
|
1662
|
+
});
|
|
1663
|
+
fields.push({
|
|
1664
|
+
id: "raised",
|
|
1665
|
+
type: "boolean",
|
|
1666
|
+
label: "Raised",
|
|
1667
|
+
description: `Adds a soft shadow so the ${contextName} lifts off the page.`,
|
|
1668
|
+
required: false
|
|
1669
|
+
});
|
|
1670
|
+
fields.push({
|
|
1671
|
+
id: "rounded",
|
|
1672
|
+
type: "select",
|
|
1673
|
+
label: "Rounded corners",
|
|
1674
|
+
description: "How rounded the corners are.",
|
|
1675
|
+
required: false,
|
|
1676
|
+
multiple: false,
|
|
1677
|
+
options: [
|
|
1678
|
+
{
|
|
1679
|
+
value: "none",
|
|
1680
|
+
label: "None"
|
|
1681
|
+
},
|
|
1682
|
+
{
|
|
1683
|
+
value: "sm",
|
|
1684
|
+
label: "Small"
|
|
1685
|
+
},
|
|
1686
|
+
{
|
|
1687
|
+
value: "md",
|
|
1688
|
+
label: "Medium"
|
|
1689
|
+
},
|
|
1690
|
+
{
|
|
1691
|
+
value: "lg",
|
|
1692
|
+
label: "Large"
|
|
1693
|
+
},
|
|
1694
|
+
{
|
|
1695
|
+
value: "xl",
|
|
1696
|
+
label: "Extra large"
|
|
1697
|
+
},
|
|
1698
|
+
{
|
|
1699
|
+
value: "2xl",
|
|
1700
|
+
label: "Extra extra large"
|
|
1701
|
+
},
|
|
1702
|
+
{
|
|
1703
|
+
value: "full",
|
|
1704
|
+
label: "Fully rounded"
|
|
1705
|
+
}
|
|
1706
|
+
]
|
|
1707
|
+
});
|
|
1708
|
+
if (type === "container") fields.push({
|
|
1709
|
+
id: "fullWidth",
|
|
1710
|
+
type: "boolean",
|
|
1711
|
+
label: "Full width",
|
|
1712
|
+
description: "Stretches the content right to the edges of the screen.",
|
|
1713
|
+
required: false,
|
|
1714
|
+
defaultValue: false
|
|
1715
|
+
});
|
|
1716
|
+
return {
|
|
1717
|
+
id,
|
|
1718
|
+
type: "modal",
|
|
1719
|
+
label,
|
|
1720
|
+
required: false,
|
|
1721
|
+
schema: { fields },
|
|
1722
|
+
ui: {
|
|
1723
|
+
...typeof renderInHeader === "boolean" ? { renderInHeader } : {},
|
|
1724
|
+
...intent ? { intent } : {},
|
|
1725
|
+
modalConfig: {
|
|
1726
|
+
buttonLabel: label,
|
|
1727
|
+
description: `Configure background, spacing, elevation, and rounded corners for the ${contextName}.`,
|
|
1728
|
+
buttonVariant: "outline",
|
|
1729
|
+
showCustomizedIndicator: true
|
|
1730
|
+
}
|
|
1731
|
+
}
|
|
1732
|
+
};
|
|
1733
|
+
}
|
|
1734
|
+
function sectionStylesField(options = {}) {
|
|
1735
|
+
const { id = "_sectionStyles", label = "Section styles", includeBackground = true, allowBackgroundColor = true, allowBackgroundGradient = true, allowBackgroundImage = true, includeAdvancedBackground = true, renderInHeader = true } = options;
|
|
1736
|
+
const fields = [];
|
|
1737
|
+
if (includeBackground) fields.push(createBackgroundField({
|
|
1738
|
+
id: "background",
|
|
1739
|
+
label: "Background",
|
|
1740
|
+
allowColor: allowBackgroundColor,
|
|
1741
|
+
allowGradient: allowBackgroundGradient,
|
|
1742
|
+
allowImage: allowBackgroundImage,
|
|
1743
|
+
includeAdvanced: includeAdvancedBackground
|
|
1744
|
+
}));
|
|
1745
|
+
fields.push({
|
|
1746
|
+
id: "spacing",
|
|
1747
|
+
type: "select",
|
|
1748
|
+
label: "Inner spacing",
|
|
1749
|
+
description: "Space above and below the section.",
|
|
1750
|
+
required: false,
|
|
1751
|
+
multiple: false,
|
|
1752
|
+
options: [
|
|
1753
|
+
{
|
|
1754
|
+
value: "none",
|
|
1755
|
+
label: "None"
|
|
1756
|
+
},
|
|
1757
|
+
{
|
|
1758
|
+
value: "compact",
|
|
1759
|
+
label: "Compact"
|
|
1760
|
+
},
|
|
1761
|
+
{
|
|
1762
|
+
value: "cozy",
|
|
1763
|
+
label: "Cosy"
|
|
1764
|
+
},
|
|
1765
|
+
{
|
|
1766
|
+
value: "medium",
|
|
1767
|
+
label: "Medium"
|
|
1768
|
+
},
|
|
1769
|
+
{
|
|
1770
|
+
value: "comfortable",
|
|
1771
|
+
label: "Comfortable"
|
|
1772
|
+
},
|
|
1773
|
+
{
|
|
1774
|
+
value: "spacious",
|
|
1775
|
+
label: "Spacious"
|
|
1776
|
+
}
|
|
1777
|
+
]
|
|
1778
|
+
});
|
|
1779
|
+
return {
|
|
1780
|
+
id,
|
|
1781
|
+
type: "modal",
|
|
1782
|
+
label,
|
|
1783
|
+
required: false,
|
|
1784
|
+
schema: { fields },
|
|
1785
|
+
ui: {
|
|
1786
|
+
renderInHeader,
|
|
1787
|
+
intent: "style",
|
|
1788
|
+
modalConfig: {
|
|
1789
|
+
buttonLabel: label,
|
|
1790
|
+
description: "Configure background and spacing for this section.",
|
|
1791
|
+
buttonVariant: "outline",
|
|
1792
|
+
showCustomizedIndicator: true
|
|
1793
|
+
}
|
|
1794
|
+
}
|
|
2232
1795
|
};
|
|
2233
|
-
return ui;
|
|
2234
|
-
});
|
|
2235
|
-
const baseFieldSchema = z.object({
|
|
2236
|
-
id: z.string().min(1, "Field id is required"),
|
|
2237
|
-
label: z.string().min(1, "Field label is required"),
|
|
2238
|
-
description: z.string().optional(),
|
|
2239
|
-
visibleRoles: z.array(z.enum(visibilityLevels)).optional(),
|
|
2240
|
-
defaultValue: z.any().optional(),
|
|
2241
|
-
required: z.boolean().default(false),
|
|
2242
|
-
ui: uiSchema.optional()
|
|
2243
|
-
});
|
|
2244
|
-
const textFieldSchema = baseFieldSchema.extend({
|
|
2245
|
-
type: z.literal("text"),
|
|
2246
|
-
multiline: z.boolean().default(false),
|
|
2247
|
-
maxLength: z.number().int().positive().optional()
|
|
2248
|
-
});
|
|
2249
|
-
const richTextFieldSchema = baseFieldSchema.extend({ type: z.literal("richText") });
|
|
2250
|
-
const inlineTextFieldSchema = baseFieldSchema.extend({
|
|
2251
|
-
type: z.literal("inlineText"),
|
|
2252
|
-
maxLength: z.number().int().positive().optional(),
|
|
2253
|
-
plainTextField: z.string().min(1).optional()
|
|
2254
|
-
});
|
|
2255
|
-
function hasMediaDefaultIdentifier(value) {
|
|
2256
|
-
return value !== null && typeof value === "object" && !Array.isArray(value) && typeof value.identifier === "string" && value.identifier.trim().length > 0;
|
|
2257
1796
|
}
|
|
2258
|
-
function
|
|
2259
|
-
|
|
2260
|
-
code: z.ZodIssueCode.custom,
|
|
2261
|
-
path: ["defaultValue"],
|
|
2262
|
-
message: `${field.type} defaultValue must be null or an object with a non-empty identifier`
|
|
2263
|
-
});
|
|
1797
|
+
function containerStylesField(options = {}) {
|
|
1798
|
+
return createBoxStylesFieldWithDepth("container", options);
|
|
2264
1799
|
}
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
}
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
}
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
}
|
|
2298
|
-
const widget = field.ui?.widget;
|
|
2299
|
-
const siteOptionSource = field.ui?.siteOptionSource;
|
|
2300
|
-
if (!field.source) {
|
|
2301
|
-
if (siteOptionSource || widget === "sdkSelect") {
|
|
2302
|
-
ctx.addIssue({
|
|
2303
|
-
code: z.ZodIssueCode.custom,
|
|
2304
|
-
message: "Runtime-backed select fields must declare source.kind explicitly",
|
|
2305
|
-
path: ["source"]
|
|
2306
|
-
});
|
|
2307
|
-
return;
|
|
1800
|
+
function cardStylesField(options = {}) {
|
|
1801
|
+
if (options.controls === "role-only") return createRoleOnlyCardStylesField(options);
|
|
1802
|
+
return createBoxStylesFieldWithDepth("card", options);
|
|
1803
|
+
}
|
|
1804
|
+
function createRoleOnlyCardStylesField(options) {
|
|
1805
|
+
const { id = "_cardStyles", label = "Card styles", renderInHeader, intent } = options;
|
|
1806
|
+
return {
|
|
1807
|
+
id,
|
|
1808
|
+
type: "modal",
|
|
1809
|
+
label,
|
|
1810
|
+
required: false,
|
|
1811
|
+
schema: { fields: [{
|
|
1812
|
+
id: "role",
|
|
1813
|
+
type: "select",
|
|
1814
|
+
label: "Card style",
|
|
1815
|
+
description: "Choose a semantic card style from the active site style.",
|
|
1816
|
+
required: false,
|
|
1817
|
+
multiple: false,
|
|
1818
|
+
defaultValue: "default",
|
|
1819
|
+
options: cardVariantRoleValues.map((value) => ({
|
|
1820
|
+
value,
|
|
1821
|
+
label: value === "default" ? "Default" : "Alternative"
|
|
1822
|
+
}))
|
|
1823
|
+
}] },
|
|
1824
|
+
ui: {
|
|
1825
|
+
...typeof renderInHeader === "boolean" ? { renderInHeader } : {},
|
|
1826
|
+
...intent ? { intent } : {},
|
|
1827
|
+
modalConfig: {
|
|
1828
|
+
buttonLabel: label,
|
|
1829
|
+
description: "Choose the site-style card role.",
|
|
1830
|
+
buttonVariant: "outline",
|
|
1831
|
+
showCustomizedIndicator: true
|
|
1832
|
+
}
|
|
2308
1833
|
}
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
1834
|
+
};
|
|
1835
|
+
}
|
|
1836
|
+
//#endregion
|
|
1837
|
+
//#region ../blocks/src/system/blocks/events/shared/fields.ts
|
|
1838
|
+
/**
|
|
1839
|
+
* Shared card styling fields for event blocks
|
|
1840
|
+
*/
|
|
1841
|
+
const cardStylingFields = [
|
|
1842
|
+
cardStylesField({
|
|
1843
|
+
id: "_cardStyles",
|
|
1844
|
+
label: "Card style",
|
|
1845
|
+
controls: "role-only",
|
|
1846
|
+
renderInHeader: false,
|
|
1847
|
+
intent: "style"
|
|
1848
|
+
}),
|
|
1849
|
+
createButtonVariantField({ description: "Choose a button style from your theme" }),
|
|
1850
|
+
{
|
|
1851
|
+
id: "buttonText",
|
|
1852
|
+
type: "text",
|
|
1853
|
+
label: "Button text",
|
|
1854
|
+
description: "The text on each event's button.",
|
|
1855
|
+
required: false,
|
|
1856
|
+
multiline: false,
|
|
1857
|
+
defaultValue: "Book",
|
|
1858
|
+
maxLength: 40
|
|
2315
1859
|
}
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
if (widget !== "sdkSelect") ctx.addIssue({
|
|
2348
|
-
code: z.ZodIssueCode.custom,
|
|
2349
|
-
message: "SDK-backed select fields must use the sdkSelect widget",
|
|
2350
|
-
path: ["ui", "widget"]
|
|
2351
|
-
});
|
|
2352
|
-
if (siteOptionSource) ctx.addIssue({
|
|
2353
|
-
code: z.ZodIssueCode.custom,
|
|
2354
|
-
message: "SDK-backed select fields cannot declare ui.siteOptionSource",
|
|
2355
|
-
path: ["ui", "siteOptionSource"]
|
|
2356
|
-
});
|
|
2357
|
-
return;
|
|
2358
|
-
default: return assertNeverSelectSource(field.source);
|
|
1860
|
+
];
|
|
1861
|
+
/**
|
|
1862
|
+
* Shared event display option fields
|
|
1863
|
+
*/
|
|
1864
|
+
const eventDisplayFields = [
|
|
1865
|
+
{
|
|
1866
|
+
id: "showVenue",
|
|
1867
|
+
type: "boolean",
|
|
1868
|
+
label: "Show venue",
|
|
1869
|
+
description: "Shows the venue's name and address.",
|
|
1870
|
+
required: false,
|
|
1871
|
+
defaultValue: true,
|
|
1872
|
+
ui: { intent: "behavior" }
|
|
1873
|
+
},
|
|
1874
|
+
{
|
|
1875
|
+
id: "showMap",
|
|
1876
|
+
type: "boolean",
|
|
1877
|
+
label: "Show venue map",
|
|
1878
|
+
description: "Shows a map when the event's venue has a location set.",
|
|
1879
|
+
required: false,
|
|
1880
|
+
defaultValue: true,
|
|
1881
|
+
ui: { intent: "behavior" }
|
|
1882
|
+
},
|
|
1883
|
+
{
|
|
1884
|
+
id: "showCapacity",
|
|
1885
|
+
type: "boolean",
|
|
1886
|
+
label: "Show available places",
|
|
1887
|
+
description: "Shows how many places are left.",
|
|
1888
|
+
required: false,
|
|
1889
|
+
defaultValue: true,
|
|
1890
|
+
ui: { intent: "behavior" }
|
|
2359
1891
|
}
|
|
1892
|
+
];
|
|
1893
|
+
/**
|
|
1894
|
+
* Empty state field for when no events are available
|
|
1895
|
+
*/
|
|
1896
|
+
const emptyStateField = {
|
|
1897
|
+
id: "emptyMessage",
|
|
1898
|
+
type: "text",
|
|
1899
|
+
label: "If there's nothing to show",
|
|
1900
|
+
description: "What visitors see when there are no upcoming events.",
|
|
1901
|
+
required: false,
|
|
1902
|
+
multiline: false,
|
|
1903
|
+
defaultValue: "No upcoming events scheduled.",
|
|
1904
|
+
maxLength: 200,
|
|
1905
|
+
ui: { intent: "behavior" }
|
|
1906
|
+
};
|
|
1907
|
+
/**
|
|
1908
|
+
* Layout selection field with grid/stack options
|
|
1909
|
+
*/
|
|
1910
|
+
const layoutField = {
|
|
1911
|
+
id: "layout",
|
|
1912
|
+
type: "select",
|
|
1913
|
+
label: "Layout",
|
|
1914
|
+
description: "Choose how events are displayed",
|
|
1915
|
+
required: false,
|
|
1916
|
+
multiple: false,
|
|
1917
|
+
defaultValue: "grid",
|
|
1918
|
+
options: [{
|
|
1919
|
+
value: "grid",
|
|
1920
|
+
label: "Grid (cards)"
|
|
1921
|
+
}, {
|
|
1922
|
+
value: "stack",
|
|
1923
|
+
label: "Stack (vertical list)"
|
|
1924
|
+
}],
|
|
1925
|
+
ui: { intent: "display" }
|
|
1926
|
+
};
|
|
1927
|
+
/**
|
|
1928
|
+
* Column count field for grid layouts (conditional on layout='grid')
|
|
1929
|
+
*/
|
|
1930
|
+
const columnsField = (options = [
|
|
1931
|
+
"2",
|
|
1932
|
+
"3",
|
|
1933
|
+
"4"
|
|
1934
|
+
]) => ({
|
|
1935
|
+
id: "columns",
|
|
1936
|
+
type: "select",
|
|
1937
|
+
label: "Columns",
|
|
1938
|
+
description: "Number of columns in grid layout",
|
|
1939
|
+
required: false,
|
|
1940
|
+
multiple: false,
|
|
1941
|
+
defaultValue: "3",
|
|
1942
|
+
ui: {
|
|
1943
|
+
intent: "display",
|
|
1944
|
+
visibleWhen: {
|
|
1945
|
+
field: "layout",
|
|
1946
|
+
equals: "grid"
|
|
1947
|
+
}
|
|
1948
|
+
},
|
|
1949
|
+
options: options.map((n) => ({
|
|
1950
|
+
value: n,
|
|
1951
|
+
label: `${n} columns`
|
|
1952
|
+
}))
|
|
2360
1953
|
});
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
1954
|
+
//#endregion
|
|
1955
|
+
//#region ../blocks/src/system/runtime/nodes/events/domain/bookability.ts
|
|
1956
|
+
/**
|
|
1957
|
+
* Whether a public event has a registration path a visitor can take.
|
|
1958
|
+
*
|
|
1959
|
+
* Lifecycle admission comes from the public booking-availability contract;
|
|
1960
|
+
* capacity comes from the shared event-domain helpers so uncapped, fallback,
|
|
1961
|
+
* and hybrid attendance-mode cases agree with the registration runtime.
|
|
1962
|
+
*/
|
|
1963
|
+
function isBookableEvent(event) {
|
|
1964
|
+
if (!event.requiresRegistration) return false;
|
|
1965
|
+
if (event.bookingAvailability.kind !== "open") return false;
|
|
1966
|
+
return !isEventFull(event) || canJoinEventWaitlistOnAnyMode(event);
|
|
1967
|
+
}
|
|
1968
|
+
/**
|
|
1969
|
+
* Select the next occurrence-targeted events for a quick-book rail.
|
|
1970
|
+
*
|
|
1971
|
+
* The API normally returns valid timestamps, but malformed values sort after
|
|
1972
|
+
* valid events so one bad record cannot displace an otherwise useful rail.
|
|
1973
|
+
* Sorting before deduplication means a duplicate occurrence keeps its earliest
|
|
1974
|
+
* deterministic representation.
|
|
1975
|
+
*/
|
|
1976
|
+
function selectQuickDateEvents(events) {
|
|
1977
|
+
return orderedUniqueEventOccurrences(events.filter((event) => event.bookingScope !== "whole_series" && isBookableEvent(event))).slice(0, 4);
|
|
1978
|
+
}
|
|
1979
|
+
/** Shared ordering and identity selection, independent of booking capacity. */
|
|
1980
|
+
function orderedUniqueEventOccurrences(events) {
|
|
1981
|
+
const sorted = [...events].sort(compareQuickDateEvents);
|
|
1982
|
+
return sorted.filter((event, index) => sorted.findIndex((candidate) => candidate.occurrenceId === event.occurrenceId) === index);
|
|
1983
|
+
}
|
|
1984
|
+
function formatEventQuickDate(event, style = "legacy") {
|
|
1985
|
+
const options = eventDateOptions(event);
|
|
1986
|
+
const dateRail = formatEventCompactDateRail(event.startsAt, options, style === "site" ? "as-written" : "capitals");
|
|
1987
|
+
return {
|
|
1988
|
+
dateTime: event.startsAt,
|
|
1989
|
+
label: `${dateRail.weekday} ${dateRail.day} ${dateRail.month}, ${formatTime(event.startsAt, options)}`
|
|
1990
|
+
};
|
|
1991
|
+
}
|
|
1992
|
+
function compareQuickDateEvents(left, right) {
|
|
1993
|
+
const startsAtOrder = compareTimestamp(left.startsAt, right.startsAt);
|
|
1994
|
+
return startsAtOrder === 0 ? left.occurrenceId.localeCompare(right.occurrenceId) : startsAtOrder;
|
|
1995
|
+
}
|
|
1996
|
+
function compareTimestamp(left, right) {
|
|
1997
|
+
const leftTime = Date.parse(left);
|
|
1998
|
+
const rightTime = Date.parse(right);
|
|
1999
|
+
return (Number.isNaN(leftTime) ? Number.POSITIVE_INFINITY : leftTime) - (Number.isNaN(rightTime) ? Number.POSITIVE_INFINITY : rightTime);
|
|
2000
|
+
}
|
|
2001
|
+
//#endregion
|
|
2002
|
+
//#region ../blocks/src/system/runtime/nodes/events/shared/EventQuickDates.tsx
|
|
2366
2003
|
/**
|
|
2367
|
-
*
|
|
2368
|
-
*
|
|
2004
|
+
* Render a bounded rail of direct occurrence booking choices.
|
|
2005
|
+
*
|
|
2006
|
+
* The heading belongs to this runtime component so it stays with the
|
|
2007
|
+
* bounded rail. Native events target the occurrence booking route while
|
|
2008
|
+
* external events retain their canonical destination and target behaviour.
|
|
2369
2009
|
*/
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2010
|
+
function EventQuickDates({ events, pathname, buttonVariant = "primary", dateStyle }) {
|
|
2011
|
+
const quickDateEvents = selectQuickDateEvents(events);
|
|
2012
|
+
if (quickDateEvents.length === 0) return null;
|
|
2013
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
2014
|
+
className: "event-quick-dates rb-flex rb-flex-col rb-gap-4",
|
|
2015
|
+
"data-event-quick-dates": "true",
|
|
2016
|
+
children: [/* @__PURE__ */ jsx("h2", {
|
|
2017
|
+
className: "event-quick-dates-heading",
|
|
2018
|
+
children: "Next few dates"
|
|
2019
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
2020
|
+
className: "event-quick-dates-rail rb-overflow-x-auto rb-flex rb-gap-4",
|
|
2021
|
+
children: quickDateEvents.map((event) => /* @__PURE__ */ jsx(EventQuickDateCard, {
|
|
2022
|
+
event,
|
|
2023
|
+
pathname,
|
|
2024
|
+
buttonVariant,
|
|
2025
|
+
dateStyle
|
|
2026
|
+
}, event.occurrenceId))
|
|
2027
|
+
})]
|
|
2028
|
+
});
|
|
2029
|
+
}
|
|
2375
2030
|
/**
|
|
2376
|
-
*
|
|
2377
|
-
*
|
|
2378
|
-
*
|
|
2379
|
-
* Supports two modes:
|
|
2380
|
-
* 1. Monomorphic (default): All items have the same schema
|
|
2381
|
-
* 2. Polymorphic: Items can be different types (e.g., card, quote, stat)
|
|
2382
|
-
*
|
|
2383
|
-
* Uses z.lazy() to allow mutual recursion.
|
|
2031
|
+
* The complete link that books one date, shared by the strip and by date rows.
|
|
2032
|
+
* Null when the date has no registration path (closed, paused, not open yet,
|
|
2033
|
+
* no registration, or full with no waitlist), so no caller repeats that gate.
|
|
2384
2034
|
*/
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
}).refine((data) => {
|
|
2399
|
-
return data.schema !== void 0 !== (data.polymorphic === true && data.itemTypes !== void 0);
|
|
2400
|
-
}, { message: "Repeater must have either 'schema' (monomorphic) or 'polymorphic: true' with 'itemTypes' (polymorphic)" }).superRefine(validateLayoutGridConfiguration).refine((data) => {
|
|
2401
|
-
const thumbnailAspectRatio = data.ui?.thumbnailAspectRatio;
|
|
2402
|
-
if (!thumbnailAspectRatio) return true;
|
|
2403
|
-
return parseAspectRatioValue(thumbnailAspectRatio) != null;
|
|
2404
|
-
}, {
|
|
2405
|
-
message: "ui.thumbnailAspectRatio must be a valid ratio (e.g. '16/9', '4:3', or '1.5')",
|
|
2406
|
-
path: ["ui", "thumbnailAspectRatio"]
|
|
2407
|
-
}).refine((data) => {
|
|
2408
|
-
const labelField = data.ui?.thumbnailLabelField;
|
|
2409
|
-
if (!labelField) return true;
|
|
2410
|
-
const schemaFields = data.schema?.fields;
|
|
2411
|
-
if (!schemaFields) return true;
|
|
2412
|
-
return schemaFields.find((candidate) => candidate.id === labelField)?.type === "text";
|
|
2413
|
-
}, {
|
|
2414
|
-
message: "ui.thumbnailLabelField must reference a text field in the repeater schema",
|
|
2415
|
-
path: ["ui", "thumbnailLabelField"]
|
|
2416
|
-
});
|
|
2417
|
-
const groupFieldSchema = baseFieldSchema.extend({
|
|
2418
|
-
type: z.literal("group"),
|
|
2419
|
-
schema: z.object({ fields: z.lazy(() => getFieldSchemaInternal().array().min(1, "Group requires at least one field")) })
|
|
2420
|
-
});
|
|
2421
|
-
const modalFieldSchema = baseFieldSchema.extend({
|
|
2422
|
-
type: z.literal("modal"),
|
|
2423
|
-
schema: z.object({ fields: z.lazy(() => getFieldSchemaInternal().array().min(1, "Modal requires at least one field")) })
|
|
2424
|
-
});
|
|
2425
|
-
const numberFieldSchema = baseFieldSchema.extend({
|
|
2426
|
-
type: z.literal("number"),
|
|
2427
|
-
min: z.number().optional(),
|
|
2428
|
-
max: z.number().optional(),
|
|
2429
|
-
step: z.number().optional()
|
|
2430
|
-
});
|
|
2431
|
-
const tabDefinitionSchema = z.object({
|
|
2432
|
-
id: z.string().min(1),
|
|
2433
|
-
label: z.string().min(1),
|
|
2434
|
-
icon: z.string().optional(),
|
|
2435
|
-
description: z.string().optional(),
|
|
2436
|
-
fields: z.lazy(() => getFieldSchemaInternal().array()),
|
|
2437
|
-
/** SDK section option that controls tab visibility based on site config */
|
|
2438
|
-
sdkSectionOption: z.enum([
|
|
2439
|
-
"backgroundColor",
|
|
2440
|
-
"backgroundGradient",
|
|
2441
|
-
"backgroundImage"
|
|
2442
|
-
]).optional()
|
|
2443
|
-
});
|
|
2444
|
-
const tabGroupFieldSchema = baseFieldSchema.extend({
|
|
2445
|
-
type: z.literal("tabGroup"),
|
|
2446
|
-
tabs: z.array(tabDefinitionSchema).min(1, "TabGroup requires at least one tab"),
|
|
2447
|
-
activeTabField: z.string().optional()
|
|
2448
|
-
});
|
|
2449
|
-
const presetOptionSchema = z.object({
|
|
2450
|
-
value: z.string(),
|
|
2451
|
-
label: z.string()
|
|
2452
|
-
});
|
|
2453
|
-
const presetOrCustomFieldSchema = baseFieldSchema.extend({
|
|
2454
|
-
type: z.literal("presetOrCustom"),
|
|
2455
|
-
presets: z.array(presetOptionSchema).min(1, "PresetOrCustom requires at least one preset"),
|
|
2456
|
-
customInput: z.object({
|
|
2457
|
-
placeholder: z.string().optional(),
|
|
2458
|
-
pattern: z.string().optional(),
|
|
2459
|
-
helpText: z.string().optional()
|
|
2460
|
-
}).optional()
|
|
2461
|
-
});
|
|
2462
|
-
const contentTypeSelectFieldSchema = baseFieldSchema.extend({
|
|
2463
|
-
type: z.literal("contentTypeSelect"),
|
|
2464
|
-
/** Filter: all, routable (hasPages=true), nonRoutable (hasPages=false) */
|
|
2465
|
-
filter: z.enum([
|
|
2466
|
-
"all",
|
|
2467
|
-
"routable",
|
|
2468
|
-
"nonRoutable"
|
|
2469
|
-
]).default("all")
|
|
2470
|
-
});
|
|
2471
|
-
const entryPickerFieldSchema = baseFieldSchema.extend({
|
|
2472
|
-
type: z.literal("entryPicker"),
|
|
2473
|
-
/** Fixed content type to filter entries by (no sibling contentType field required) */
|
|
2474
|
-
fixedContentType: z.string().optional(),
|
|
2475
|
-
/** Field ID that contains the content type to filter entries by */
|
|
2476
|
-
contentTypeField: z.string().optional(),
|
|
2477
|
-
/** What value should be stored when an entry is selected */
|
|
2478
|
-
valueFrom: z.enum([
|
|
2479
|
-
"id",
|
|
2480
|
-
"identifier",
|
|
2481
|
-
"slug"
|
|
2482
|
-
]).optional()
|
|
2483
|
-
});
|
|
2484
|
-
let _fieldSchemaInternal = null;
|
|
2485
|
-
function getFieldSchemaInternal() {
|
|
2486
|
-
if (_fieldSchemaInternal) return _fieldSchemaInternal;
|
|
2487
|
-
_fieldSchemaInternal = z.discriminatedUnion("type", [
|
|
2488
|
-
textFieldSchema,
|
|
2489
|
-
richTextFieldSchema,
|
|
2490
|
-
inlineTextFieldSchema,
|
|
2491
|
-
mediaFieldSchema,
|
|
2492
|
-
fileFieldSchema,
|
|
2493
|
-
booleanFieldSchema,
|
|
2494
|
-
numberFieldSchema,
|
|
2495
|
-
dateFieldSchema,
|
|
2496
|
-
timeFieldSchema,
|
|
2497
|
-
dateTimeFieldSchema,
|
|
2498
|
-
slugFieldSchema,
|
|
2499
|
-
urlFieldSchema,
|
|
2500
|
-
linkFieldSchema,
|
|
2501
|
-
selectFieldSchema,
|
|
2502
|
-
referenceFieldSchema,
|
|
2503
|
-
repeaterFieldSchema,
|
|
2504
|
-
groupFieldSchema,
|
|
2505
|
-
modalFieldSchema,
|
|
2506
|
-
tabGroupFieldSchema,
|
|
2507
|
-
presetOrCustomFieldSchema,
|
|
2508
|
-
contentTypeSelectFieldSchema,
|
|
2509
|
-
entryPickerFieldSchema
|
|
2510
|
-
]);
|
|
2511
|
-
return _fieldSchemaInternal;
|
|
2035
|
+
function eventDateBookingLink(event, pathname, dateLabel) {
|
|
2036
|
+
if (!isBookableEvent(event)) return null;
|
|
2037
|
+
const cta = resolveEventCta(event);
|
|
2038
|
+
return {
|
|
2039
|
+
href: resolveRuntimeEventDestination(event).kind === "external" ? cta.href : resolveDedicatedBookingHref(pathname, {
|
|
2040
|
+
kind: "event_occurrence",
|
|
2041
|
+
occurrenceId: event.occurrenceId
|
|
2042
|
+
}),
|
|
2043
|
+
target: cta.external ? "_blank" : void 0,
|
|
2044
|
+
rel: cta.external ? "noopener noreferrer" : void 0,
|
|
2045
|
+
"aria-label": `${cta.label} ${event.title}, ${dateLabel}`,
|
|
2046
|
+
label: cta.label
|
|
2047
|
+
};
|
|
2512
2048
|
}
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
return prop in getFieldSchemaInternal();
|
|
2521
|
-
}
|
|
2522
|
-
});
|
|
2523
|
-
function parseFieldDefinition(input) {
|
|
2524
|
-
return fieldSchema.parse(input);
|
|
2049
|
+
/** Decide the formatted date and complete booking link before rendering. */
|
|
2050
|
+
function quickDateCardPresentation(props) {
|
|
2051
|
+
const date = formatEventQuickDate(props.event, props.dateStyle);
|
|
2052
|
+
return {
|
|
2053
|
+
date,
|
|
2054
|
+
bookingLink: eventDateBookingLink(props.event, props.pathname, date.label)
|
|
2055
|
+
};
|
|
2525
2056
|
}
|
|
2526
|
-
function
|
|
2527
|
-
|
|
2057
|
+
function EventQuickDateCard(props) {
|
|
2058
|
+
const { event } = props;
|
|
2059
|
+
const { date, bookingLink } = quickDateCardPresentation(props);
|
|
2060
|
+
return /* @__PURE__ */ jsxs("article", {
|
|
2061
|
+
className: "event-quick-date rb-flex rb-min-w-12rem rb-shrink-0 rb-flex-col rb-gap-3 rb-rounded-lg rb-border rb-bg-surface rb-p-4",
|
|
2062
|
+
children: [
|
|
2063
|
+
/* @__PURE__ */ jsx("time", {
|
|
2064
|
+
className: "event-quick-date-when",
|
|
2065
|
+
dateTime: date.dateTime,
|
|
2066
|
+
"aria-label": date.label,
|
|
2067
|
+
children: date.label
|
|
2068
|
+
}),
|
|
2069
|
+
/* @__PURE__ */ jsx("h3", {
|
|
2070
|
+
className: "event-quick-date-title",
|
|
2071
|
+
children: /* @__PURE__ */ jsx("a", {
|
|
2072
|
+
className: "event-title-link",
|
|
2073
|
+
...resolveEventLinkProps(event),
|
|
2074
|
+
children: event.title
|
|
2075
|
+
})
|
|
2076
|
+
}),
|
|
2077
|
+
/* @__PURE__ */ jsxs("p", {
|
|
2078
|
+
className: "event-quick-date-meta status-muted",
|
|
2079
|
+
children: [
|
|
2080
|
+
formatEventLocation(event),
|
|
2081
|
+
" · ",
|
|
2082
|
+
formatEventDuration(event)
|
|
2083
|
+
]
|
|
2084
|
+
}),
|
|
2085
|
+
/* @__PURE__ */ jsxs("div", {
|
|
2086
|
+
className: "event-quick-date-footer rb-mt-auto rb-flex rb-items-center rb-justify-between rb-gap-3",
|
|
2087
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
2088
|
+
className: "event-quick-date-price",
|
|
2089
|
+
children: formatEventPrice(event)
|
|
2090
|
+
}), bookingLink ? /* @__PURE__ */ jsx(ThemedButtonLink, {
|
|
2091
|
+
variant: props.buttonVariant,
|
|
2092
|
+
size: "sm",
|
|
2093
|
+
extraClassName: "event-quick-date-cta",
|
|
2094
|
+
...bookingLink
|
|
2095
|
+
}) : null]
|
|
2096
|
+
})
|
|
2097
|
+
]
|
|
2098
|
+
});
|
|
2528
2099
|
}
|
|
2100
|
+
//#endregion
|
|
2101
|
+
//#region ../blocks/src/system/runtime/nodes/events/shared/OfferingTitle.tsx
|
|
2529
2102
|
/**
|
|
2530
|
-
*
|
|
2531
|
-
*
|
|
2532
|
-
*
|
|
2103
|
+
* Heading for an offering card or row. Links to the offering's page when one
|
|
2104
|
+
* exists so a sold-out or closed offering stays reachable (issue 1372); the
|
|
2105
|
+
* `.event-title-link` rule lives in theme-core's event-list.css.
|
|
2533
2106
|
*/
|
|
2534
|
-
function
|
|
2535
|
-
return
|
|
2107
|
+
function OfferingTitle({ className, path, title }) {
|
|
2108
|
+
return /* @__PURE__ */ jsx("h3", {
|
|
2109
|
+
className,
|
|
2110
|
+
children: path ? /* @__PURE__ */ jsx("a", {
|
|
2111
|
+
className: "event-title-link",
|
|
2112
|
+
href: path,
|
|
2113
|
+
children: title
|
|
2114
|
+
}) : title
|
|
2115
|
+
});
|
|
2116
|
+
}
|
|
2117
|
+
//#endregion
|
|
2118
|
+
//#region ../blocks/src/system/runtime/nodes/location-map.shared.ts
|
|
2119
|
+
const LOCATION_MAP_DEFAULTS = {
|
|
2120
|
+
zoom: 15,
|
|
2121
|
+
heightPx: 320,
|
|
2122
|
+
showAddressText: true,
|
|
2123
|
+
showDirections: true,
|
|
2124
|
+
directionsLabel: "Get directions"
|
|
2125
|
+
};
|
|
2126
|
+
const LOCATION_MAP_LIMITS = {
|
|
2127
|
+
zoom: {
|
|
2128
|
+
min: 3,
|
|
2129
|
+
max: 18
|
|
2130
|
+
},
|
|
2131
|
+
heightPx: {
|
|
2132
|
+
min: 200,
|
|
2133
|
+
max: 600
|
|
2134
|
+
}
|
|
2135
|
+
};
|
|
2136
|
+
function normalizeNumber(value, fallback) {
|
|
2137
|
+
if (typeof value === "number" && Number.isFinite(value)) return value;
|
|
2138
|
+
if (typeof value === "string") {
|
|
2139
|
+
const parsed = Number.parseFloat(value);
|
|
2140
|
+
if (Number.isFinite(parsed)) return parsed;
|
|
2141
|
+
}
|
|
2142
|
+
return fallback;
|
|
2536
2143
|
}
|
|
2537
|
-
function
|
|
2538
|
-
if (
|
|
2539
|
-
|
|
2144
|
+
function normalizeBoolean$1(value, fallback) {
|
|
2145
|
+
if (typeof value === "boolean") return value;
|
|
2146
|
+
if (typeof value === "string") {
|
|
2147
|
+
if (value === "true") return true;
|
|
2148
|
+
if (value === "false") return false;
|
|
2149
|
+
}
|
|
2150
|
+
return fallback;
|
|
2540
2151
|
}
|
|
2541
|
-
function
|
|
2542
|
-
return
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
optionSource: input.optionSource
|
|
2152
|
+
function normalizeLocationMapValue(value, siteCountry) {
|
|
2153
|
+
if (typeof value !== "object" || value === null) return null;
|
|
2154
|
+
const projected = readLocationMapProjection(value, siteCountry);
|
|
2155
|
+
return projected === null ? null : {
|
|
2156
|
+
addressText: projected.displayAddress,
|
|
2157
|
+
...projected.pin ?? {
|
|
2158
|
+
lat: null,
|
|
2159
|
+
lng: null
|
|
2550
2160
|
},
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
siteOptionSource: input.optionSource
|
|
2555
|
-
}
|
|
2556
|
-
}));
|
|
2161
|
+
drawing: projected.drawing,
|
|
2162
|
+
doorNote: projected.doorNote
|
|
2163
|
+
};
|
|
2557
2164
|
}
|
|
2558
|
-
function
|
|
2559
|
-
return
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
}
|
|
2569
|
-
|
|
2165
|
+
function normalizeLocationMapSource(value) {
|
|
2166
|
+
return value === "business_address" || value === "venue" ? value : "custom";
|
|
2167
|
+
}
|
|
2168
|
+
function resolveLocationMapLocation(input) {
|
|
2169
|
+
const source = normalizeLocationMapSource(input.locationSource);
|
|
2170
|
+
if (source === "business_address") {
|
|
2171
|
+
const locationValue = normalizeLocationMapValue(input.businessAddress, input.siteCountry);
|
|
2172
|
+
return locationValue ? {
|
|
2173
|
+
kind: "business_address",
|
|
2174
|
+
locationValue
|
|
2175
|
+
} : {
|
|
2176
|
+
kind: "unresolved",
|
|
2177
|
+
source,
|
|
2178
|
+
reason: "missing_business_address"
|
|
2179
|
+
};
|
|
2180
|
+
}
|
|
2181
|
+
if (source === "venue") {
|
|
2182
|
+
const venueId = typeof input.venueId === "string" && input.venueId.trim() ? input.venueId.trim() : null;
|
|
2183
|
+
if (!venueId) return {
|
|
2184
|
+
kind: "unresolved",
|
|
2185
|
+
source,
|
|
2186
|
+
reason: "missing_venue_id"
|
|
2187
|
+
};
|
|
2188
|
+
const locationValue = input.venuesById ? normalizeLocationMapValue(input.venuesById[venueId] ?? null, input.siteCountry) : null;
|
|
2189
|
+
return locationValue ? {
|
|
2190
|
+
kind: "venue",
|
|
2191
|
+
venueId,
|
|
2192
|
+
locationValue
|
|
2193
|
+
} : {
|
|
2194
|
+
kind: "unresolved",
|
|
2195
|
+
source,
|
|
2196
|
+
reason: "missing_venue_location"
|
|
2197
|
+
};
|
|
2198
|
+
}
|
|
2199
|
+
const locationValue = normalizeLocationMapValue(input.location, input.siteCountry);
|
|
2200
|
+
return locationValue ? {
|
|
2201
|
+
kind: "custom",
|
|
2202
|
+
locationValue
|
|
2203
|
+
} : {
|
|
2204
|
+
kind: "unresolved",
|
|
2205
|
+
source,
|
|
2206
|
+
reason: "missing_custom_location"
|
|
2207
|
+
};
|
|
2208
|
+
}
|
|
2209
|
+
function describeUnresolvedLocationMapLocation(resolvedLocation) {
|
|
2210
|
+
if (resolvedLocation.kind !== "unresolved") return null;
|
|
2211
|
+
switch (resolvedLocation.reason) {
|
|
2212
|
+
case "missing_business_address": return "Business address details are not configured yet.";
|
|
2213
|
+
case "missing_venue_id": return "Choose a venue to show this map.";
|
|
2214
|
+
case "missing_venue_location": return "The selected venue does not have location details yet.";
|
|
2215
|
+
case "missing_custom_location": return "Location details coming soon.";
|
|
2216
|
+
}
|
|
2217
|
+
}
|
|
2218
|
+
function normalizeLocationMapProps(input) {
|
|
2219
|
+
const parsedHours = parseWeeklyOpeningHours(input.openingHours);
|
|
2220
|
+
const resolvedLocation = resolveLocationMapLocation(input);
|
|
2221
|
+
const locationValue = resolvedLocation.kind === "unresolved" ? null : resolvedLocation.locationValue;
|
|
2222
|
+
const directionsLabel = normalizeLocationAddressText(input.directionsLabel) ?? LOCATION_MAP_DEFAULTS.directionsLabel;
|
|
2223
|
+
return {
|
|
2224
|
+
...locationMapDetails(locationValue),
|
|
2225
|
+
wider: input.wider === true,
|
|
2226
|
+
googleMapsLabel: normalizedGoogleMapsLabel(input.googleMapsLabel),
|
|
2227
|
+
resolvedLocation,
|
|
2228
|
+
locationValue,
|
|
2229
|
+
unresolvedMessage: describeUnresolvedLocationMapLocation(resolvedLocation),
|
|
2230
|
+
zoom: Math.min(LOCATION_MAP_LIMITS.zoom.max, Math.max(LOCATION_MAP_LIMITS.zoom.min, Math.round(normalizeNumber(input.zoom, LOCATION_MAP_DEFAULTS.zoom)))),
|
|
2231
|
+
heightPx: Math.min(LOCATION_MAP_LIMITS.heightPx.max, Math.max(LOCATION_MAP_LIMITS.heightPx.min, Math.round(normalizeNumber(input.heightPx, LOCATION_MAP_DEFAULTS.heightPx)))),
|
|
2232
|
+
openingHours: parsedHours.ok ? parsedHours.value : null,
|
|
2233
|
+
showOpeningHours: normalizeBoolean$1(input.showOpeningHours, true),
|
|
2234
|
+
showAddressText: normalizeBoolean$1(input.showAddressText, LOCATION_MAP_DEFAULTS.showAddressText),
|
|
2235
|
+
showDirections: normalizeBoolean$1(input.showDirections, LOCATION_MAP_DEFAULTS.showDirections),
|
|
2236
|
+
directionsLabel,
|
|
2237
|
+
className: typeof input.className === "string" ? input.className : null
|
|
2238
|
+
};
|
|
2239
|
+
}
|
|
2240
|
+
/** All render-ready permitted details come from the same resolved source value. */
|
|
2241
|
+
function locationMapDetails(value) {
|
|
2242
|
+
return {
|
|
2243
|
+
drawing: value?.drawing ?? null,
|
|
2244
|
+
doorNote: value?.doorNote ?? null,
|
|
2245
|
+
addressText: value?.addressText ?? null,
|
|
2246
|
+
location: toLocationCoordinates(value)
|
|
2247
|
+
};
|
|
2248
|
+
}
|
|
2249
|
+
function normalizedGoogleMapsLabel(value) {
|
|
2250
|
+
return normalizeLocationAddressText(value) ?? "Open in Google Maps";
|
|
2251
|
+
}
|
|
2252
|
+
function readLocationMapProjection(value, siteCountry) {
|
|
2253
|
+
const venue = publicVenueMapLocationSchema.safeParse(value);
|
|
2254
|
+
if (venue.success) return venue.data.addressWithBooking ? {
|
|
2255
|
+
...venue.data,
|
|
2256
|
+
address: null,
|
|
2257
|
+
displayAddress: venue.data.area ?? null,
|
|
2258
|
+
pin: null,
|
|
2259
|
+
doorNote: null,
|
|
2260
|
+
drawing: void 0
|
|
2261
|
+
} : venue.data;
|
|
2262
|
+
const canonical = parseLocationValue(value);
|
|
2263
|
+
if (canonical.ok && canonical.value !== null) return projectPublicLocation(canonical.value, siteCountry);
|
|
2264
|
+
return null;
|
|
2570
2265
|
}
|
|
2571
|
-
const slotSchema = z.object({
|
|
2572
|
-
id: z.string().min(1),
|
|
2573
|
-
label: z.string().min(1),
|
|
2574
|
-
allowedKinds: z.array(z.string()).default([]),
|
|
2575
|
-
min: z.number().int().min(0).default(0),
|
|
2576
|
-
max: z.number().int().positive().optional(),
|
|
2577
|
-
help: z.string().optional(),
|
|
2578
|
-
visibleRoles: z.array(z.enum(visibilityLevels)).optional()
|
|
2579
|
-
});
|
|
2580
|
-
const typographyTokens = [
|
|
2581
|
-
"display",
|
|
2582
|
-
"heading",
|
|
2583
|
-
"subheading",
|
|
2584
|
-
"body",
|
|
2585
|
-
"caption"
|
|
2586
|
-
];
|
|
2587
|
-
const colorTokens = [
|
|
2588
|
-
"background",
|
|
2589
|
-
"surface",
|
|
2590
|
-
"foreground",
|
|
2591
|
-
"accent",
|
|
2592
|
-
"muted"
|
|
2593
|
-
];
|
|
2594
|
-
const styleTokenSchema = z.object({
|
|
2595
|
-
background: z.enum(colorTokens).optional(),
|
|
2596
|
-
foreground: z.enum(colorTokens).optional(),
|
|
2597
|
-
border: z.enum(colorTokens).optional(),
|
|
2598
|
-
typography: z.enum(typographyTokens).optional(),
|
|
2599
|
-
spacing: z.enum([
|
|
2600
|
-
"none",
|
|
2601
|
-
"xs",
|
|
2602
|
-
"sm",
|
|
2603
|
-
"md",
|
|
2604
|
-
"lg",
|
|
2605
|
-
"xl"
|
|
2606
|
-
]).optional(),
|
|
2607
|
-
radius: z.enum([
|
|
2608
|
-
"none",
|
|
2609
|
-
"sm",
|
|
2610
|
-
"md",
|
|
2611
|
-
"lg",
|
|
2612
|
-
"full"
|
|
2613
|
-
]).optional()
|
|
2614
|
-
});
|
|
2615
|
-
const behaviourSchema = z.object({
|
|
2616
|
-
supportsThemeSwitching: z.boolean().default(true),
|
|
2617
|
-
inlineEditing: z.boolean().default(false),
|
|
2618
|
-
animation: z.boolean().default(false),
|
|
2619
|
-
paletteHidden: z.boolean().default(false),
|
|
2620
|
-
managesOwnWrapper: z.boolean().optional()
|
|
2621
|
-
});
|
|
2622
|
-
z.array(z.enum(SYSTEM_BLOCK_KINDS)).readonly();
|
|
2623
|
-
const blockRequiredFeatureSchema = z.enum([
|
|
2624
|
-
"bookings.appointments",
|
|
2625
|
-
"bookings.events",
|
|
2626
|
-
"shop",
|
|
2627
|
-
"newsletter",
|
|
2628
|
-
"analytics"
|
|
2629
|
-
]);
|
|
2630
|
-
const blockCategoryEnum = z.enum([
|
|
2631
|
-
"text-and-images",
|
|
2632
|
-
"photos",
|
|
2633
|
-
"people",
|
|
2634
|
-
"events-and-bookings",
|
|
2635
|
-
"shop",
|
|
2636
|
-
"forms-and-sign-ups",
|
|
2637
|
-
"marketing",
|
|
2638
|
-
"content",
|
|
2639
|
-
"blog",
|
|
2640
|
-
"media",
|
|
2641
|
-
"layout",
|
|
2642
|
-
"interactive"
|
|
2643
|
-
]);
|
|
2644
|
-
const blockContentSourceSchema = z.object({
|
|
2645
|
-
kind: z.enum([
|
|
2646
|
-
"inline",
|
|
2647
|
-
"entries",
|
|
2648
|
-
"mixed"
|
|
2649
|
-
]),
|
|
2650
|
-
contentType: z.string().min(1).optional()
|
|
2651
|
-
}).superRefine((value, ctx) => {
|
|
2652
|
-
if (value.kind === "inline" && value.contentType) ctx.addIssue({
|
|
2653
|
-
code: z.ZodIssueCode.custom,
|
|
2654
|
-
path: ["contentType"],
|
|
2655
|
-
message: "contentType is not allowed when contentSource.kind is \"inline\""
|
|
2656
|
-
});
|
|
2657
|
-
});
|
|
2658
|
-
z.object({
|
|
2659
|
-
name: z.string().min(1),
|
|
2660
|
-
version: z.string().min(1),
|
|
2661
|
-
title: z.string().min(1),
|
|
2662
|
-
titleSource: z.union([z.string().min(1), z.array(z.string().min(1)).min(1)]).optional(),
|
|
2663
|
-
description: z.string().optional(),
|
|
2664
|
-
component: z.string().min(1),
|
|
2665
|
-
fields: fieldSchema.array().default([]),
|
|
2666
|
-
slots: slotSchema.array().default([]),
|
|
2667
|
-
styleTokens: styleTokenSchema.optional(),
|
|
2668
|
-
behaviours: behaviourSchema.optional(),
|
|
2669
|
-
layout: NodeTreeSchema.optional(),
|
|
2670
|
-
/**
|
|
2671
|
-
* Optional list of nested field paths that should be surfaced in the main form body
|
|
2672
|
-
* as "shortcuts" (render-only). These paths should refer to existing data within the
|
|
2673
|
-
* block content object (e.g. `_sectionStyles.background.image`).
|
|
2674
|
-
*
|
|
2675
|
-
* The original fields remain available in settings for power users.
|
|
2676
|
-
*/
|
|
2677
|
-
lookField: z.string().min(1).optional(),
|
|
2678
|
-
sourceLine: z.object({
|
|
2679
|
-
text: z.string(),
|
|
2680
|
-
target: z.enum([
|
|
2681
|
-
"testimonials",
|
|
2682
|
-
"team",
|
|
2683
|
-
"mailing-lists"
|
|
2684
|
-
]),
|
|
2685
|
-
when: z.object({
|
|
2686
|
-
field: z.string(),
|
|
2687
|
-
equals: z.string()
|
|
2688
|
-
}).optional()
|
|
2689
|
-
}).optional(),
|
|
2690
|
-
promotedFields: z.array(z.string().min(1)).optional(),
|
|
2691
|
-
variantMeaning: z.discriminatedUnion("kind", [z.object({
|
|
2692
|
-
kind: z.literal("arrangement"),
|
|
2693
|
-
lookOnlyKeys: z.array(z.string().min(1)).readonly().optional()
|
|
2694
|
-
}), z.object({
|
|
2695
|
-
kind: z.literal("mode"),
|
|
2696
|
-
modes: z.array(z.enum(arrangementModes)).min(1).readonly(),
|
|
2697
|
-
defaultMode: z.enum(arrangementModes),
|
|
2698
|
-
arrangementField: z.string().min(1),
|
|
2699
|
-
keys: z.array(z.string().min(1)).min(1).readonly(),
|
|
2700
|
-
defaultKey: z.string().min(1),
|
|
2701
|
-
lookOnlyKeys: z.array(z.string().min(1)).readonly().optional(),
|
|
2702
|
-
modeLabels: z.record(z.string(), z.string().min(1)).readonly().optional()
|
|
2703
|
-
})]),
|
|
2704
|
-
variants: z.record(z.string(), NodeTreeSchema).optional(),
|
|
2705
|
-
defaultVariant: z.string().optional(),
|
|
2706
|
-
variantOptions: z.record(z.string(), z.object({
|
|
2707
|
-
label: z.string().optional(),
|
|
2708
|
-
description: z.string().optional(),
|
|
2709
|
-
icon: z.string().optional()
|
|
2710
|
-
}).optional()).optional(),
|
|
2711
|
-
category: blockCategoryEnum.optional(),
|
|
2712
|
-
contentTypes: z.array(z.string()).optional(),
|
|
2713
|
-
requiredFeatures: z.array(blockRequiredFeatureSchema).optional(),
|
|
2714
|
-
/**
|
|
2715
|
-
* Explicit content-source classification (inline / entries / mixed). Optional at the
|
|
2716
|
-
* schema level for backward compatibility with SDK-defined custom blocks, but every
|
|
2717
|
-
* registered SYSTEM block must declare it (enforced by a registry-wide test).
|
|
2718
|
-
*/
|
|
2719
|
-
contentSource: blockContentSourceSchema.optional(),
|
|
2720
|
-
tags: z.array(z.string()).optional(),
|
|
2721
|
-
icon: z.string().optional()
|
|
2722
|
-
});
|
|
2723
|
-
z.array(z.string().min(1)).optional(), z.string().min(1).optional();
|
|
2724
2266
|
//#endregion
|
|
2725
2267
|
//#region ../blocks/src/system/readiness.ts
|
|
2726
2268
|
const ready = { kind: "Ready" };
|
|
@@ -2916,6 +2458,172 @@ const PUBLIC_DOWNLOAD_MEDIA_TYPES = [
|
|
|
2916
2458
|
"audio"
|
|
2917
2459
|
];
|
|
2918
2460
|
//#endregion
|
|
2461
|
+
//#region ../blocks/src/system/manifest/schema.ts
|
|
2462
|
+
function parseFieldDefinition(input) {
|
|
2463
|
+
return fieldSchema.parse(input);
|
|
2464
|
+
}
|
|
2465
|
+
function parseFieldDefinitions(input) {
|
|
2466
|
+
return fieldSchema.array().parse(input);
|
|
2467
|
+
}
|
|
2468
|
+
/**
|
|
2469
|
+
* Normalize legacy select fields into the closed source union before any consumer
|
|
2470
|
+
* branches on source semantics. Runtime-backed definitions must be explicit;
|
|
2471
|
+
* legacy static definitions normalize to `kind: "static"`.
|
|
2472
|
+
*/
|
|
2473
|
+
function normalizeSelectSource(field) {
|
|
2474
|
+
return field.source ?? { kind: "static" };
|
|
2475
|
+
}
|
|
2476
|
+
function expectParsedSelectField(field) {
|
|
2477
|
+
if (field.type !== "select") throw new Error(`Expected select field, received ${field.type}`);
|
|
2478
|
+
return field;
|
|
2479
|
+
}
|
|
2480
|
+
function createSiteOptionSelectField(input) {
|
|
2481
|
+
return expectParsedSelectField(parseFieldDefinition({
|
|
2482
|
+
...input,
|
|
2483
|
+
type: "select",
|
|
2484
|
+
options: [],
|
|
2485
|
+
multiple: input.multiple ?? false,
|
|
2486
|
+
source: {
|
|
2487
|
+
kind: "site",
|
|
2488
|
+
optionSource: input.optionSource
|
|
2489
|
+
},
|
|
2490
|
+
ui: {
|
|
2491
|
+
...input.ui ?? {},
|
|
2492
|
+
widget: "siteOptionPicker",
|
|
2493
|
+
siteOptionSource: input.optionSource
|
|
2494
|
+
}
|
|
2495
|
+
}));
|
|
2496
|
+
}
|
|
2497
|
+
function createSdkSelectField(input) {
|
|
2498
|
+
return expectParsedSelectField(parseFieldDefinition({
|
|
2499
|
+
...input,
|
|
2500
|
+
type: "select",
|
|
2501
|
+
options: input.options,
|
|
2502
|
+
multiple: input.multiple ?? false,
|
|
2503
|
+
source: { kind: "sdk" },
|
|
2504
|
+
ui: {
|
|
2505
|
+
...input.ui ?? {},
|
|
2506
|
+
widget: "sdkSelect"
|
|
2507
|
+
}
|
|
2508
|
+
}));
|
|
2509
|
+
}
|
|
2510
|
+
const slotSchema = z.object({
|
|
2511
|
+
id: z.string().min(1),
|
|
2512
|
+
label: z.string().min(1),
|
|
2513
|
+
allowedKinds: z.array(z.string()).default([]),
|
|
2514
|
+
min: z.number().int().min(0).default(0),
|
|
2515
|
+
max: z.number().int().positive().optional(),
|
|
2516
|
+
help: z.string().optional(),
|
|
2517
|
+
visibleRoles: z.array(z.enum(visibilityLevels)).optional()
|
|
2518
|
+
});
|
|
2519
|
+
const typographyTokens = [
|
|
2520
|
+
"display",
|
|
2521
|
+
"heading",
|
|
2522
|
+
"subheading",
|
|
2523
|
+
"body",
|
|
2524
|
+
"caption"
|
|
2525
|
+
];
|
|
2526
|
+
const colorTokens = [
|
|
2527
|
+
"background",
|
|
2528
|
+
"surface",
|
|
2529
|
+
"foreground",
|
|
2530
|
+
"accent",
|
|
2531
|
+
"muted"
|
|
2532
|
+
];
|
|
2533
|
+
const styleTokenSchema = z.object({
|
|
2534
|
+
background: z.enum(colorTokens).optional(),
|
|
2535
|
+
foreground: z.enum(colorTokens).optional(),
|
|
2536
|
+
border: z.enum(colorTokens).optional(),
|
|
2537
|
+
typography: z.enum(typographyTokens).optional(),
|
|
2538
|
+
spacing: z.enum([
|
|
2539
|
+
"none",
|
|
2540
|
+
"xs",
|
|
2541
|
+
"sm",
|
|
2542
|
+
"md",
|
|
2543
|
+
"lg",
|
|
2544
|
+
"xl"
|
|
2545
|
+
]).optional(),
|
|
2546
|
+
radius: z.enum([
|
|
2547
|
+
"none",
|
|
2548
|
+
"sm",
|
|
2549
|
+
"md",
|
|
2550
|
+
"lg",
|
|
2551
|
+
"full"
|
|
2552
|
+
]).optional()
|
|
2553
|
+
});
|
|
2554
|
+
const behaviourSchema = z.object({
|
|
2555
|
+
supportsThemeSwitching: z.boolean().default(true),
|
|
2556
|
+
inlineEditing: z.boolean().default(false),
|
|
2557
|
+
animation: z.boolean().default(false),
|
|
2558
|
+
paletteHidden: z.boolean().default(false),
|
|
2559
|
+
managesOwnWrapper: z.boolean().optional()
|
|
2560
|
+
});
|
|
2561
|
+
z.object({
|
|
2562
|
+
name: z.string().min(1),
|
|
2563
|
+
version: z.string().min(1),
|
|
2564
|
+
title: z.string().min(1),
|
|
2565
|
+
titleSource: z.union([z.string().min(1), z.array(z.string().min(1)).min(1)]).optional(),
|
|
2566
|
+
description: z.string().optional(),
|
|
2567
|
+
component: z.string().min(1),
|
|
2568
|
+
fields: fieldSchema.array().default([]),
|
|
2569
|
+
slots: slotSchema.array().default([]),
|
|
2570
|
+
styleTokens: styleTokenSchema.optional(),
|
|
2571
|
+
behaviours: behaviourSchema.optional(),
|
|
2572
|
+
layout: NodeTreeSchema.optional(),
|
|
2573
|
+
/**
|
|
2574
|
+
* Optional list of nested field paths that should be surfaced in the main form body
|
|
2575
|
+
* as "shortcuts" (render-only). These paths should refer to existing data within the
|
|
2576
|
+
* block content object (e.g. `_sectionStyles.background.image`).
|
|
2577
|
+
*
|
|
2578
|
+
* The original fields remain available in settings for power users.
|
|
2579
|
+
*/
|
|
2580
|
+
lookField: z.string().min(1).optional(),
|
|
2581
|
+
sourceLine: z.object({
|
|
2582
|
+
text: z.string(),
|
|
2583
|
+
target: z.enum([
|
|
2584
|
+
"testimonials",
|
|
2585
|
+
"team",
|
|
2586
|
+
"mailing-lists"
|
|
2587
|
+
]),
|
|
2588
|
+
when: z.object({
|
|
2589
|
+
field: z.string(),
|
|
2590
|
+
equals: z.string()
|
|
2591
|
+
}).optional()
|
|
2592
|
+
}).optional(),
|
|
2593
|
+
promotedFields: z.array(z.string().min(1)).optional(),
|
|
2594
|
+
variantMeaning: z.discriminatedUnion("kind", [z.object({
|
|
2595
|
+
kind: z.literal("arrangement"),
|
|
2596
|
+
lookOnlyKeys: z.array(z.string().min(1)).readonly().optional()
|
|
2597
|
+
}), z.object({
|
|
2598
|
+
kind: z.literal("mode"),
|
|
2599
|
+
modes: z.array(z.enum(arrangementModes)).min(1).readonly(),
|
|
2600
|
+
defaultMode: z.enum(arrangementModes),
|
|
2601
|
+
arrangementField: z.string().min(1),
|
|
2602
|
+
keys: z.array(z.string().min(1)).min(1).readonly(),
|
|
2603
|
+
defaultKey: z.string().min(1),
|
|
2604
|
+
lookOnlyKeys: z.array(z.string().min(1)).readonly().optional(),
|
|
2605
|
+
modeLabels: z.record(z.string(), z.string().min(1)).readonly().optional()
|
|
2606
|
+
})]),
|
|
2607
|
+
variants: z.record(z.string(), NodeTreeSchema).optional(),
|
|
2608
|
+
defaultVariant: z.string().optional(),
|
|
2609
|
+
variantOptions: z.record(z.string(), z.object({
|
|
2610
|
+
label: z.string().optional(),
|
|
2611
|
+
description: z.string().optional(),
|
|
2612
|
+
icon: z.string().optional()
|
|
2613
|
+
}).optional()).optional(),
|
|
2614
|
+
category: blockCategoryEnum.optional(),
|
|
2615
|
+
contentTypes: z.array(z.string()).optional(),
|
|
2616
|
+
requiredFeatures: z.array(blockRequiredFeatureSchema).optional(),
|
|
2617
|
+
/**
|
|
2618
|
+
* Explicit content-source classification (inline / entries / mixed). Optional at the
|
|
2619
|
+
* schema level for backward compatibility with SDK-defined custom blocks, but every
|
|
2620
|
+
* registered SYSTEM block must declare it (enforced by a registry-wide test).
|
|
2621
|
+
*/
|
|
2622
|
+
contentSource: blockContentSourceSchema.optional(),
|
|
2623
|
+
tags: z.array(z.string()).optional(),
|
|
2624
|
+
icon: z.string().optional()
|
|
2625
|
+
});
|
|
2626
|
+
//#endregion
|
|
2919
2627
|
//#region ../blocks/src/system/icons/ids.ts
|
|
2920
2628
|
const GENERATED_ICON_SET_ID_PATTERN = /^generated-icon-set:[a-z0-9][a-z0-9:_-]{0,107}$/u;
|
|
2921
2629
|
const GENERATED_ICON_ASSET_ID_PATTERN = /^generated-icon-asset:[a-z0-9][a-z0-9:_-]{0,105}$/u;
|
|
@@ -8333,7 +8041,7 @@ function IslandPropsScript({ value }) {
|
|
|
8333
8041
|
* Avoid "fake" navigation controls here; users can scroll horizontally.
|
|
8334
8042
|
*/
|
|
8335
8043
|
const CarouselNodeSSR = (props) => {
|
|
8336
|
-
const settings = carouselSsrSettings(props);
|
|
8044
|
+
const { indicator, ...settings } = carouselSsrSettings(props);
|
|
8337
8045
|
const slides = props.mode === "arrangement" ? props.slides : carouselContents(props).map((content) => ({
|
|
8338
8046
|
title: "",
|
|
8339
8047
|
content
|
|
@@ -8354,28 +8062,38 @@ const CarouselNodeSSR = (props) => {
|
|
|
8354
8062
|
"data-show-controls": controlsEnabled ? "true" : "false",
|
|
8355
8063
|
...getIslandRootProps("carousel", props.blockId),
|
|
8356
8064
|
children: [
|
|
8357
|
-
/* @__PURE__ */ jsx(IslandPropsScript, { value: props
|
|
8358
|
-
...settings,
|
|
8359
|
-
mode: props.mode,
|
|
8360
|
-
arrangement: props.arrangement,
|
|
8361
|
-
labels: props.labels,
|
|
8362
|
-
indicator: props.indicator,
|
|
8363
|
-
slides: props.slides.map(({ title }) => ({ title })),
|
|
8364
|
-
cardList: props.cardList
|
|
8365
|
-
} : settings }),
|
|
8065
|
+
/* @__PURE__ */ jsx(IslandPropsScript, { value: carouselIslandValue(props, settings, indicator) }),
|
|
8366
8066
|
/* @__PURE__ */ jsx(CarouselSsrFrame, {
|
|
8367
8067
|
slides,
|
|
8368
8068
|
transition: settings.transition,
|
|
8369
8069
|
arrangement: props.arrangement
|
|
8370
8070
|
}),
|
|
8371
8071
|
props.mode === "arrangement" ? /* @__PURE__ */ jsx(CarouselSsrControls, {
|
|
8372
|
-
props
|
|
8373
|
-
|
|
8072
|
+
props: {
|
|
8073
|
+
...props,
|
|
8074
|
+
indicator: indicator ?? props.indicator
|
|
8075
|
+
},
|
|
8076
|
+
count: slides.length,
|
|
8077
|
+
renderDots: settings.autoplay === true
|
|
8374
8078
|
}) : null
|
|
8375
8079
|
]
|
|
8376
8080
|
});
|
|
8377
8081
|
};
|
|
8378
|
-
|
|
8082
|
+
/** What the client needs to hydrate as the server rendered; auto-advance is carried only when on. */
|
|
8083
|
+
function carouselIslandValue(props, settings, indicator) {
|
|
8084
|
+
if (props.mode !== "arrangement") return settings;
|
|
8085
|
+
return {
|
|
8086
|
+
...settings,
|
|
8087
|
+
mode: props.mode,
|
|
8088
|
+
arrangement: props.arrangement,
|
|
8089
|
+
labels: props.labels,
|
|
8090
|
+
indicator,
|
|
8091
|
+
slides: props.slides.map(({ title }) => ({ title })),
|
|
8092
|
+
cardList: props.cardList,
|
|
8093
|
+
...settings.autoplay ? { autoAdvance: true } : {}
|
|
8094
|
+
};
|
|
8095
|
+
}
|
|
8096
|
+
function CarouselSsrControls({ props, count, renderDots }) {
|
|
8379
8097
|
return /* @__PURE__ */ jsxs("div", {
|
|
8380
8098
|
"data-slot": "controls",
|
|
8381
8099
|
hidden: true,
|
|
@@ -8387,6 +8105,21 @@ function CarouselSsrControls({ props, count }) {
|
|
|
8387
8105
|
"aria-disabled": "true",
|
|
8388
8106
|
children: "←"
|
|
8389
8107
|
}),
|
|
8108
|
+
renderDots && props.indicator === "dots" ? /* @__PURE__ */ jsx("div", {
|
|
8109
|
+
className: "carousel-dots",
|
|
8110
|
+
role: "group",
|
|
8111
|
+
"aria-label": "Carousel navigation",
|
|
8112
|
+
"data-control": "dots",
|
|
8113
|
+
children: Array.from({ length: count }, (_, index) => /* @__PURE__ */ jsx("button", {
|
|
8114
|
+
type: "button",
|
|
8115
|
+
className: "carousel-dot",
|
|
8116
|
+
"data-control": "dot",
|
|
8117
|
+
"data-current": String(index === 0),
|
|
8118
|
+
"data-active": String(index === 0),
|
|
8119
|
+
"aria-current": index === 0 ? "true" : void 0,
|
|
8120
|
+
"aria-label": `Show ${props.labels.item} ${index + 1} of ${count}`
|
|
8121
|
+
}, index))
|
|
8122
|
+
}) : null,
|
|
8390
8123
|
/* @__PURE__ */ jsx("button", {
|
|
8391
8124
|
type: "button",
|
|
8392
8125
|
"data-slot": "control",
|
|
@@ -8413,7 +8146,8 @@ function carouselSsrSettings(props) {
|
|
|
8413
8146
|
arrowVisibility,
|
|
8414
8147
|
autoplay,
|
|
8415
8148
|
autoplayDelay,
|
|
8416
|
-
loop
|
|
8149
|
+
loop,
|
|
8150
|
+
indicator: void 0
|
|
8417
8151
|
};
|
|
8418
8152
|
}
|
|
8419
8153
|
function CarouselSsrFrame(props) {
|
|
@@ -8651,6 +8385,52 @@ function HeaderControlNode({ className, children, "aria-label": label, "aria-exp
|
|
|
8651
8385
|
});
|
|
8652
8386
|
}
|
|
8653
8387
|
//#endregion
|
|
8388
|
+
//#region ../blocks/src/system/runtime/nodes/events/shared/ListGroup.tsx
|
|
8389
|
+
function listGroupPresentation(presentation) {
|
|
8390
|
+
return {
|
|
8391
|
+
lookSlots: presentation.lookSlots,
|
|
8392
|
+
surfacePresentation: presentation.surfacePresentation
|
|
8393
|
+
};
|
|
8394
|
+
}
|
|
8395
|
+
/**
|
|
8396
|
+
* Whether each group sits on its own panel, side by side ("A column per type").
|
|
8397
|
+
* Every renderer of grouped offerings frames its groups from this one answer.
|
|
8398
|
+
*/
|
|
8399
|
+
function listGroupFrames(presentation) {
|
|
8400
|
+
const panels = presentation.cardArrangement === "type-columns";
|
|
8401
|
+
return {
|
|
8402
|
+
list: panels ? listLookSlot(presentation, "list") : {},
|
|
8403
|
+
panel: panels ? listLookSlot(presentation, "panel") : {}
|
|
8404
|
+
};
|
|
8405
|
+
}
|
|
8406
|
+
/**
|
|
8407
|
+
* One category inside a list section: an offering type, a service category.
|
|
8408
|
+
* Its heading is a subheading, so arranged markup marks the group with
|
|
8409
|
+
* `data-list-group`: the shared sheet sizes the heading below the section's,
|
|
8410
|
+
* and styles that decorate section headings leave it alone. A group whose
|
|
8411
|
+
* title is null shows only its intro, so a lone category under a section
|
|
8412
|
+
* heading doesn't name the same thing twice.
|
|
8413
|
+
*/
|
|
8414
|
+
function ListGroup({ presentation, title, intro, Heading, sectionProps, children }) {
|
|
8415
|
+
const arranged = presentation.lookSlots !== void 0;
|
|
8416
|
+
const parts = /* @__PURE__ */ jsxs(Fragment, { children: [title !== null ? /* @__PURE__ */ jsx(Heading, {
|
|
8417
|
+
...listLookSlot(presentation, "heading"),
|
|
8418
|
+
children: title
|
|
8419
|
+
}) : null, intro ? /* @__PURE__ */ jsx("p", {
|
|
8420
|
+
...listLookSlot(presentation, "intro"),
|
|
8421
|
+
children: intro
|
|
8422
|
+
}) : null] });
|
|
8423
|
+
const head = title === null && !intro ? null : arranged ? /* @__PURE__ */ jsx("header", {
|
|
8424
|
+
...listLookSlot(presentation, "head"),
|
|
8425
|
+
children: parts
|
|
8426
|
+
}) : parts;
|
|
8427
|
+
return /* @__PURE__ */ jsxs("section", {
|
|
8428
|
+
...sectionProps,
|
|
8429
|
+
...arranged ? { "data-list-group": "" } : {},
|
|
8430
|
+
children: [head, children]
|
|
8431
|
+
});
|
|
8432
|
+
}
|
|
8433
|
+
//#endregion
|
|
8654
8434
|
//#region ../blocks/src/system/runtime/nodes/appointment-services.tsx
|
|
8655
8435
|
const publicVenueSchema = z.object({
|
|
8656
8436
|
name: z.string(),
|
|
@@ -8954,6 +8734,7 @@ function AppointmentServicesNode({ Carousel, preparedView, sectionHeading, categ
|
|
|
8954
8734
|
const hasSectionHeading = Boolean(sectionHeading);
|
|
8955
8735
|
if (presentation.lookSlots && (view.kind === "items" || view.kind === "groups")) return /* @__PURE__ */ jsx(AppointmentCardLists, {
|
|
8956
8736
|
sectionHeading: appointmentSectionHeading(sectionHeading),
|
|
8737
|
+
categoryChosen: readCategoryFilter(categoryId) !== null,
|
|
8957
8738
|
Carousel,
|
|
8958
8739
|
view,
|
|
8959
8740
|
presentation,
|
|
@@ -9019,7 +8800,7 @@ function appointmentCardContent(row) {
|
|
|
9019
8800
|
}
|
|
9020
8801
|
};
|
|
9021
8802
|
}
|
|
9022
|
-
function AppointmentCardLists({ Carousel, view, presentation, hasSectionHeading, sectionHeading }) {
|
|
8803
|
+
function AppointmentCardLists({ Carousel, view, presentation, hasSectionHeading, sectionHeading, categoryChosen }) {
|
|
9023
8804
|
if (view.kind === "items") return /* @__PURE__ */ jsx(CardListItems, {
|
|
9024
8805
|
Carousel,
|
|
9025
8806
|
carouselLabels: {
|
|
@@ -9031,23 +8812,21 @@ function AppointmentCardLists({ Carousel, view, presentation, hasSectionHeading,
|
|
|
9031
8812
|
Title: hasSectionHeading ? "h3" : "h2"
|
|
9032
8813
|
});
|
|
9033
8814
|
const Heading = hasSectionHeading ? "h3" : "h2";
|
|
8815
|
+
const lone = hasSectionHeading && !categoryChosen && view.groups.length === 1;
|
|
9034
8816
|
return /* @__PURE__ */ jsx("div", {
|
|
9035
8817
|
className: "rb-flex rb-flex-col rb-gap-10",
|
|
9036
|
-
children: view.groups.map((group) => /* @__PURE__ */
|
|
9037
|
-
|
|
9038
|
-
|
|
9039
|
-
|
|
9040
|
-
|
|
9041
|
-
|
|
9042
|
-
|
|
9043
|
-
|
|
9044
|
-
|
|
9045
|
-
|
|
9046
|
-
|
|
9047
|
-
|
|
9048
|
-
presentation,
|
|
9049
|
-
Title: hasSectionHeading ? "h4" : "h3"
|
|
9050
|
-
})] }, group.key))
|
|
8818
|
+
children: view.groups.map((group) => /* @__PURE__ */ jsx(ListGroup, {
|
|
8819
|
+
presentation: listGroupPresentation(presentation),
|
|
8820
|
+
title: lone ? null : group.heading,
|
|
8821
|
+
intro: group.intro,
|
|
8822
|
+
Heading,
|
|
8823
|
+
children: /* @__PURE__ */ jsx(CardListItems, {
|
|
8824
|
+
Carousel,
|
|
8825
|
+
items: group.rows.map(appointmentCardContent),
|
|
8826
|
+
presentation,
|
|
8827
|
+
Title: lone || !hasSectionHeading ? "h3" : "h4"
|
|
8828
|
+
})
|
|
8829
|
+
}, group.key))
|
|
9051
8830
|
});
|
|
9052
8831
|
}
|
|
9053
8832
|
/** Undated services merge in category order for the same arrangements as offerings. */
|
|
@@ -9631,6 +9410,7 @@ function renderOfferingsCatalogueGroups({ props, groups, shape }) {
|
|
|
9631
9410
|
const enabledSeriesIds = new Set(groups.flatMap((load) => load.kind === "items" ? load.items.map((item) => item.kind === "event" ? item.event.seriesId : item.run.eventSeriesId) : []));
|
|
9632
9411
|
const quickDateEvents = shape === "single" ? [] : selectQuickDateEvents((props.quickDateEvents ?? []).filter((event) => enabledSeriesIds.has(event.seriesId)));
|
|
9633
9412
|
const populated = groups.flatMap(catalogueGroupItems);
|
|
9413
|
+
const frames = listGroupFrames(props);
|
|
9634
9414
|
return /* @__PURE__ */ jsxs("div", {
|
|
9635
9415
|
className: "offerings-preview rb-flex rb-flex-col rb-gap-6",
|
|
9636
9416
|
"data-block": "offerings-preview",
|
|
@@ -9649,18 +9429,22 @@ function renderOfferingsCatalogueGroups({ props, groups, shape }) {
|
|
|
9649
9429
|
props.children,
|
|
9650
9430
|
/* @__PURE__ */ jsx("div", {
|
|
9651
9431
|
className: "offerings-catalogue rb-flex rb-flex-col rb-gap-8",
|
|
9652
|
-
|
|
9653
|
-
|
|
9654
|
-
|
|
9655
|
-
|
|
9656
|
-
|
|
9657
|
-
|
|
9658
|
-
|
|
9432
|
+
...frames.list,
|
|
9433
|
+
children: populated.map(({ group, items }) => /* @__PURE__ */ jsx(ListGroup, {
|
|
9434
|
+
presentation: listGroupPresentation(props),
|
|
9435
|
+
title: shape === "single" ? null : group.title,
|
|
9436
|
+
Heading: "h3",
|
|
9437
|
+
sectionProps: {
|
|
9438
|
+
...frames.panel,
|
|
9439
|
+
className: "rb-flex rb-flex-col rb-gap-5",
|
|
9440
|
+
"data-offering-source": group.sourceKey
|
|
9441
|
+
},
|
|
9442
|
+
children: renderCatalogueItems({
|
|
9659
9443
|
props,
|
|
9660
9444
|
items,
|
|
9661
9445
|
shape,
|
|
9662
9446
|
groupTitle: group.title
|
|
9663
|
-
})
|
|
9447
|
+
})
|
|
9664
9448
|
}, group.sourceKey))
|
|
9665
9449
|
})
|
|
9666
9450
|
]
|
|
@@ -10266,34 +10050,30 @@ function RunWithoutLiveDates({ group, path }) {
|
|
|
10266
10050
|
}
|
|
10267
10051
|
function renderOfferingCardGroups(props) {
|
|
10268
10052
|
const datesBySeries = offeringDatesBySeries(props.quickDateEvents ?? [], props.now);
|
|
10053
|
+
const frames = listGroupFrames(props);
|
|
10269
10054
|
return /* @__PURE__ */ jsx("div", {
|
|
10270
10055
|
className: "rb-flex rb-flex-col rb-gap-10",
|
|
10056
|
+
...frames.list,
|
|
10271
10057
|
children: props.states.map((state) => {
|
|
10272
10058
|
const cta = resolveOfferingsPreviewGroupCta({
|
|
10273
10059
|
group: state.group,
|
|
10274
10060
|
routes: props.routeCandidates?.routes ?? []
|
|
10275
10061
|
});
|
|
10276
|
-
return /* @__PURE__ */ jsxs(
|
|
10277
|
-
|
|
10278
|
-
|
|
10279
|
-
|
|
10280
|
-
|
|
10281
|
-
|
|
10282
|
-
|
|
10283
|
-
|
|
10284
|
-
|
|
10285
|
-
|
|
10286
|
-
|
|
10287
|
-
|
|
10288
|
-
|
|
10289
|
-
|
|
10290
|
-
|
|
10291
|
-
...listLookSlot(props, "more"),
|
|
10292
|
-
className: "rb-item-text-link",
|
|
10293
|
-
href: cta.href,
|
|
10294
|
-
children: cta.label
|
|
10295
|
-
}) : null
|
|
10296
|
-
]
|
|
10062
|
+
return /* @__PURE__ */ jsxs(ListGroup, {
|
|
10063
|
+
presentation: listGroupPresentation(props),
|
|
10064
|
+
title: state.group.title,
|
|
10065
|
+
intro: state.group.intro,
|
|
10066
|
+
Heading: "h3",
|
|
10067
|
+
sectionProps: {
|
|
10068
|
+
...frames.panel,
|
|
10069
|
+
"data-offering-source": state.group.sourceKey
|
|
10070
|
+
},
|
|
10071
|
+
children: [offeringGroupCards(state, props, datesBySeries), cta ? /* @__PURE__ */ jsx("a", {
|
|
10072
|
+
...listLookSlot(props, "more"),
|
|
10073
|
+
className: "rb-item-text-link",
|
|
10074
|
+
href: cta.href,
|
|
10075
|
+
children: cta.label
|
|
10076
|
+
}) : null]
|
|
10297
10077
|
}, state.group.sourceKey);
|
|
10298
10078
|
})
|
|
10299
10079
|
});
|
|
@@ -11490,4 +11270,4 @@ const serverComponentRegistry = {
|
|
|
11490
11270
|
...buildServerRegistryFromEntries(runtimeBackedBlockServerEntries)
|
|
11491
11271
|
};
|
|
11492
11272
|
//#endregion
|
|
11493
|
-
export { styledContainer as $,
|
|
11273
|
+
export { styledContainer as $, eventDisplayFields as $t, cardListPhotoNumberFields as A, createSdkSelectField as At, normalizeMailingListBlockContent as B, testimonialsReadiness as Bt, eventListingBlockDefinition as C, section as Ct, FEATURE_CARD_ICON_TREATMENTS as D, when as Dt, FEATURE_CARD_GENERATED_ICON_SIZE_PX as E, videoEmbed as Et, markEditableSurfaceForwarding as F, PUBLIC_DOWNLOAD_MEDIA_TYPES as Ft, formCopyFragment as G, LOCATION_MAP_DEFAULTS as Gt, formDataSchema as H, loadedReadinessFact as Ht, splitPositioningClasses as I, augmentManifest as It, defineFragment as J, normalizeLocationMapSource as Jt, buildFragmentDataLoaders as K, LOCATION_MAP_LIMITS as Kt, desktopOnlyDisplay as L, chosenString as Lt, cardListSectionActionFields as M, normalizeSelectSource as Mt, normalizeCardListContent as N, parseFieldDefinition as Nt, cardListSectionAction as O, withApiBindings as Ot, composeHeaderSectionWrapperClassName as P, parseFieldDefinitions as Pt, styledSection as Q, emptyStateField as Qt, mobileOnlyDisplay as R, galleryReadiness as Rt, eventCalendarBlockDefinition as S, linkSchema as Sn, richText as St, eventRegistrationBlockDefinition as T, text as Tt, createBlockManifest as U, pageTemplateFromEntry as Ut, formBlockDefinition as V, admitReadinessFacts as Vt, formEmbedFragment as W, unavailableReadinessFact as Wt, sectionHeaderLayoutNodes as X, cardStylingFields as Xt, sectionHeaderFields as Y, resolveLocationMapLocation as Yt, resolveBackgroundColorValue as Z, columnsField as Zt, checkoutBlockDefinition as _, parseRepeaterGridInteger as _n, inline as _t, buildLoadedOfferingsPreviewListing as a, getAnchorClasses as an, lookSkinSlotTransform as at, productListBlockDefinition as b, resolveRepeaterGridSpanFieldId as bn, props as bt, HeaderSectionFrame as c, ACCORDION_OPEN_ACCENT_THICKNESS as cn, bind as ct, accordionIconColorStyle as d, ACCORDION_TRIGGER_LETTER_SPACING as dn, carousel as dt, layoutField as en, sectionContainer as et, resolveAccordionIconStyle as f, ICON_CONFIG as fn, el as ft, giftingBlockDefinition as g, isAcceptedRepeaterGridSpan as gn, icon as gt, sanitizeNewsletterSignupPublicContent as h, DEFAULT_MEDIA_FIELD_KINDS as hn, headerSection as ht, WeeklySlotAvailabilityView as i, BACKGROUND_POSITION_PRESET_VALUES as in, lookQuoteLimitTransform as it, cardListPresentationBindings as j, createSiteOptionSelectField as jt, cardListKnobFields as k, parseBlockIconValue as kt, accordionItemPartSlots as l, ACCORDION_SPACING_MAP as ln, bookingForm as lt, newsletterSignupBlockDefinition as m, bindingSchema as mn, form as mt, runtimeBackedBlockModes as n, containerStylesField as nn, lookCarouselRegionTransform as nt, LocationMapSSR as o, createButtonGroup as on, lookSlot as ot, SectionNode as p, ICON_SIZE_PX as pn, fileDownload as pt, composeFragments as q, normalizeLocationMapProps as qt, runtimeBackedBlockServerEntries as r, sectionStylesField as rn, lookLeadSlotTransform as rt, buildAppointmentServicesView as s, createButtonVariantField as sn, accordionList as st, serverComponentRegistry as t, cardStylesField as tn, backgroundFrame as tt, accordionLookAttributes as u, ACCORDION_TRIGGER_FONT_SCALE as un, button as ut, cartBlockDefinition as v, resolveRepeaterGridColumnFieldId as vn, link as vt, mapDrawingStyleBinding as w, stack as wt, shopBlockDefinition as x, RESOLVED_INTERNAL_LINK_ENTITY_TYPES as xn, repeat as xt, productDetailBlockDefinition as y, resolveRepeaterGridRowFieldId as yn, media as yt, teamMemberCardBiographyFallback as z, teamReadiness as zt };
|