@riverbankcms/sdk 0.159.0 → 0.161.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/dist/_dts/{BlocksIslandsHydrator-Cj1i1Yhh.d.ts → BlocksIslandsHydrator-Bx4kLiTA.d.ts} +1 -1
- package/dist/_dts/{Page-Cgzbv22M.d.ts → Page-Dm7_P13o.d.ts} +217 -8
- package/dist/_dts/{SdkPreviewMode-BC_FGc6b.d.ts → SdkPreviewMode-D7HdWWwF.d.ts} +55 -127
- package/dist/_dts/{auth-contract-FPg0-2MC.d.ts → auth-contract-CgJ5nMaH.d.ts} +2 -0
- package/dist/_dts/{client-BOK-YHVJ.d.ts → client-Ep0jI9eE.d.ts} +1 -1
- package/dist/_dts/{content-types-CsrYWxq_.d.ts → content-types-BgAzCrBc.d.ts} +18 -18
- package/dist/_dts/{contracts-ClgMD-9g.d.ts → contracts-DUiOnj9e.d.ts} +10 -6
- package/dist/_dts/{footerPageOutline-C_IDuELl.d.ts → footerPageOutline-B-uXamTG.d.ts} +6 -6
- package/dist/_dts/{generatePageMetadata-B7bhYSWx.d.ts → generatePageMetadata-BDkZYEcS.d.ts} +2 -2
- package/dist/_dts/index-BQDBQvdu.d.ts +13 -0
- package/dist/_dts/index-BVkP8f70.d.ts +66 -0
- package/dist/_dts/{index-Dt3XSGzY.d.ts → index-CF6Cjs7b.d.ts} +2 -2
- package/dist/_dts/{index-Ci1PEk82.d.ts → index-CSsfq6KG.d.ts} +3 -17
- package/dist/_dts/{index-BZ4fb2zz.d.ts → index-D_8uz4OP.d.ts} +3 -3
- package/dist/_dts/{index-CcaG6O13.d.ts → index-DvKQA6AZ.d.ts} +4 -4
- package/dist/_dts/{index-DMOfW1A7.d.ts → index-KPrWM0KF.d.ts} +2 -2
- package/dist/_dts/{index-DzUdUaJ-.d.ts → index-ylivB7Jj.d.ts} +2 -2
- package/dist/_dts/{loadContent-C1JI2pG0.d.ts → loadContent-DTjKOO-T.d.ts} +19 -10
- package/dist/_dts/{resolvePageContent-BtRUtrJa.d.ts → resolvePageContent-C1vA5c5w.d.ts} +2 -2
- package/dist/_dts/{constants-DkcKHMX-.d.ts → runtime-BY8DQBbT.d.ts} +10 -16
- package/dist/_dts/{hosted-booking-appearance-ChGCQYdQ.d.ts → schema-BHu0PYWl.d.ts} +25911 -23567
- 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 +13 -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/index.d.ts +8 -8
- package/dist/_dts/sdk/src/manifest/index.d.ts +6 -6
- 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 +10 -28
- 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/preview-next/keep-alive.d.ts +1 -1
- package/dist/_dts/sdk/src/preview-next/session.d.ts +2 -2
- package/dist/_dts/sdk/src/rendering/client.d.ts +2 -2
- 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/routing/index.d.ts +5 -5
- package/dist/_dts/sdk/src/server.d.ts +5 -5
- package/dist/_dts/sdk/src/theme/index.d.ts +1 -1
- package/dist/_dts/{session-Ba2CsnK5.d.ts → session-C_gtSFyZ.d.ts} +2 -1
- package/dist/_dts/{navigation-BnV_hOZy.d.ts → types-BR1Yboa9.d.ts} +15530 -16017
- package/dist/_dts/{types-CMFIZGUI.d.ts → types-CJXTCF_F.d.ts} +10 -13
- package/dist/_dts/{types-CI9dYWJ8.d.ts → types-D02ngcUH.d.ts} +4 -2
- package/dist/_dts/{types--oWXIfyz.d.ts → types-ZGUiHpDE.d.ts} +7 -7
- package/dist/_dts/{validation-Ct-GL0eA.d.ts → validation-BaV565gb.d.ts} +4 -4
- package/dist/client/{BlocksIslandsHydrator-DKS8Ba30.mjs → BlocksIslandsHydrator-DTExCJsb.mjs} +22 -21
- package/dist/client/{BookingMailingListNote-Cg9v6d7Y.mjs → BookingMailingListNote-BDpxmn1p.mjs} +2 -2
- package/dist/client/{CalendarNavigationChevron-BoVCTUXy.mjs → CalendarNavigationChevron-PeCiL82X.mjs} +6 -6
- package/dist/client/{CheckboxChoice-BF9eCNno.mjs → CheckboxChoice-DWexRLf6.mjs} +1 -1
- package/dist/client/{DemoBookingPortalAccess-BxRVCJG3.mjs → DemoBookingPortalAccess-3zmIqakW.mjs} +6 -6
- package/dist/client/{DemoPortalSignInLink-DHxYgkT6.mjs → DemoPortalSignInLink-GHi-8BW5.mjs} +1 -1
- package/dist/client/{EventCalendar.client-BI-kvwXf.mjs → EventCalendar.client-BxQLY5cX.mjs} +10 -9
- package/dist/client/{EventCombined.client-DIvnoN5l.mjs → EventCombined.client-B5bmQ03b.mjs} +8 -8
- package/dist/client/{EventEmbeddedCheckoutStep-B3XUyNY9.mjs → EventEmbeddedCheckoutStep-CgMZ9TeU.mjs} +1 -1
- package/dist/client/{EventItem-BRMtEaa6.mjs → EventItem-BEx-qiDE.mjs} +11 -6
- package/dist/client/{EventListWeekNavigation-B8DzAUDa.mjs → EventListWeekNavigation-CyH5tA6Y.mjs} +1 -1
- package/dist/client/{EventListing.client-Bo4qzQi0.mjs → EventListing.client-D3uySdGP.mjs} +3 -3
- package/dist/client/{EventListing.view-D2vemnCx.mjs → EventListing.view-9RFrBejr.mjs} +31 -15
- package/dist/client/{EventRegistrationPayment-e5XWtygG.mjs → EventRegistrationPayment-CG2tQx8K.mjs} +92 -99
- package/dist/client/LocationMapActions-Wsr83Q7q.mjs +268 -0
- package/dist/client/{Page-Dqpv9Ggi.mjs → Page-Bf2nPACI.mjs} +2673 -2290
- package/dist/client/{StepIndicator-BrvKa_8H.mjs → StepIndicator-CZweb1vs.mjs} +3 -3
- package/dist/client/{TabBarFragment-DvzIV75f.mjs → TabBarFragment-Bkgz67gt.mjs} +1 -1
- package/dist/client/ThemedButton-CnyL3s1A.mjs +2243 -0
- package/dist/client/{accordion-ByLpb4Dz.mjs → accordion-TcimLLRQ.mjs} +1 -1
- package/dist/client/{booking-form.client-BLndwxpx.mjs → booking-form.client-q-RpJ4aF.mjs} +13 -13
- package/dist/client/{bookingForm-CTxTEgHX.mjs → bookingForm-DjGfk3Wj.mjs} +4 -4
- package/dist/client/bookings.mjs +6 -6
- package/dist/client/{carousel-C8ef0vnT.mjs → carousel-CGAk6j0m.mjs} +2 -2
- package/dist/client/{carousel.client-BJGoJVtg.mjs → carousel.client-ArlGmYWV.mjs} +1 -1
- package/dist/client/{cart-BpH6jkUO.mjs → cart-D_h3rAZ2.mjs} +3 -3
- package/dist/client/{cart.client-DV78Td13.mjs → cart.client-DHOxZbJ7.mjs} +1 -1
- package/dist/client/{checkout-BJVb2RpL.mjs → checkout-tC-3CzuM.mjs} +3 -3
- package/dist/client/{checkout.client-CqGPXPSm.mjs → checkout.client-DsBb2Pkm.mjs} +1 -1
- package/dist/client/client.mjs +28 -15
- package/dist/client/{context-BRgBWthI.mjs → context-9ZfMb6GA.mjs} +1 -1
- package/dist/client/{cta-D8ucLsvX.mjs → cta-D-ZqL7-e.mjs} +2 -1
- package/dist/client/{dateFormatting-LeKNQ-iX.mjs → dateFormatting-BCwLqYpW.mjs} +1 -1
- package/dist/client/{demoPortalMagicLink-CjstiFPh.mjs → demoPortalMagicLink-BxkSS9fx.mjs} +1 -1
- package/dist/client/{enhanceHeaderSection-BaQJyI9x.mjs → enhanceHeaderSection-xg6to91E.mjs} +3 -3
- package/dist/client/{event-details.client-CYNQYOsP.mjs → event-details.client-C670TgRd.mjs} +2 -17
- package/dist/client/{event-registration.client-DDqSpN36.mjs → event-registration.client-C6GApWTB.mjs} +17 -17
- package/dist/client/{eventCalendar-3vQtuC9X.mjs → eventCalendar-CWc0dg9i.mjs} +4 -4
- package/dist/client/{eventCombined-CEJFMjqV.mjs → eventCombined-D4DbOrvQ.mjs} +4 -4
- package/dist/client/{eventDetails-nGh47jef.mjs → eventDetails-C2DfmbC0.mjs} +2 -2
- package/dist/client/{eventListing-BL3Ptb83.mjs → eventListing-C_yXmHyz.mjs} +4 -4
- package/dist/client/{eventRegistration-DDSO6KB2.mjs → eventRegistration-DJuaCB-O.mjs} +4 -4
- package/dist/client/{form-DjNLfy2Z.mjs → form-QZhtdFHA.mjs} +3 -3
- package/dist/client/{form.client-Cj0By6ot.mjs → form.client-CgvPACwG.mjs} +5 -5
- package/dist/client/{form.parts-DyA9C5Hy.mjs → form.parts-2uI0-5N-.mjs} +3 -3
- package/dist/client/{formatDate-CZo0MPTA.mjs → formatDate-Danr0Nk4.mjs} +1 -1
- package/dist/client/gifting/client.mjs +3 -3
- package/dist/client/{headerSection-JjSq6Mzp.mjs → headerSection-DJdlLdvZ.mjs} +2 -2
- package/dist/client/{mediaAssets-BOj-Co0B.mjs → mediaAssets-BvjcAZpS.mjs} +1 -1
- package/dist/client/mediaContext-jPeJ2PmJ.mjs +10801 -0
- package/dist/client/{newsletter-form.client-C2EgEBP1.mjs → newsletter-form.client-Cbepz2KU.mjs} +8 -8
- package/dist/client/{newsletter-form.parts-CaldoFmi.mjs → newsletter-form.parts-DN8oMCQ0.mjs} +2 -2
- package/dist/client/{newsletterForm-hm7L17LM.mjs → newsletterForm-wjLtW-wq.mjs} +3 -3
- package/dist/client/{noop-M8FTSgm2.mjs → noop-B7H6gCbj.mjs} +306 -5
- package/dist/client/portal/client.mjs +4560 -115
- package/dist/client/{product-detail.client-y86uwzEI.mjs → product-detail.client-CYTR165c.mjs} +1 -1
- package/dist/client/{product-list.client-_JBndYZT.mjs → product-list.client-B4vTvag8.mjs} +1 -1
- package/dist/client/{productDetail-D-9fb2cW.mjs → productDetail-k8LEMSWn.mjs} +3 -3
- package/dist/client/{productList-BSRlnwBW.mjs → productList-DEo8Bqoe.mjs} +3 -3
- package/dist/client/{propsDecoder-DhbGL302.mjs → propsDecoder-G0j0HXBO.mjs} +3 -28
- package/dist/client/{registry.server-BaX0hxf5.mjs → registry.server-BTmSXE3D.mjs} +1154 -997
- package/dist/client/rendering/client.mjs +28 -28
- package/dist/client/rendering/islands.mjs +1 -1
- package/dist/client/rendering.mjs +57 -32
- package/dist/client/{richText-coerce-Cny2Ukb6.mjs → richText-coerce-B19taoH6.mjs} +1 -1
- package/dist/client/{routeIslandApiConfig-96er7pIx.mjs → routeIslandApiConfig-Chu5BHra.mjs} +1 -1
- package/dist/client/{ThemedButton-DVBC_pS9.mjs → schema-C-m8XHuW.mjs} +1123 -2362
- package/dist/client/{shop-CnIJfdZA.mjs → shop-RGWa43H7.mjs} +3 -3
- package/dist/client/{shop-commerce-CsLwzq5O.mjs → shop-commerce-TJYCBO_H.mjs} +12 -12
- package/dist/client/{shop-commerce-store--O8GRBwr.mjs → shop-commerce-store-CjCcUB_o.mjs} +1 -1
- package/dist/client/{shop.client-BcaJ-acA.mjs → shop.client-tsKfZw1W.mjs} +15 -15
- package/dist/client/{shop.interactive-BxL_bshW.mjs → shop.interactive-CVqLAU53.mjs} +370 -189
- package/dist/client/{shopShared-VZjPOfCX.mjs → shopShared-C3lHMz_R.mjs} +2 -2
- package/dist/client/{src-7cXhT0G_.mjs → src-VIsPY-kw.mjs} +6 -1
- package/dist/client/timetableModel-V2ifvGGy.mjs +1100 -0
- package/dist/client/{useAvailableSlots-pTXuY3jV.mjs → useAvailableSlots-D1X69-pN.mjs} +4 -4
- package/dist/client/{useBookingNowIso-D14J-EhJ.mjs → useBookingNowIso-Ch30jino.mjs} +1 -1
- package/dist/client/{useDiscountApply-o5sIVZ2u.mjs → useDiscountApply-Bwzr1RjV.mjs} +3 -3
- package/dist/client/{useDiscountCodeUi-DJhFP_rg.mjs → useDiscountCodeUi-BimJbFC7.mjs} +1 -1
- package/dist/client/{useEventPagination-DMmNf2FP.mjs → useEventPagination-CLAS0upd.mjs} +12 -24
- package/dist/client/uuid-BETKW8rS.mjs +12 -0
- package/dist/client/{view-BgPql2yH2.mjs → view-BUh4LnLS.mjs} +4 -4
- package/dist/client/{view-D1R3Lk05.mjs → view-Dj_FZHmg.mjs} +19 -15
- package/dist/client/wizardSteps-BkZc-hKH.mjs +6598 -0
- package/dist/preview-next/before-render.mjs +5 -4
- package/dist/preview-next/chrome.css +2 -0
- package/dist/preview-next/client/{EventEmbeddedCheckoutStep-BFlBqSu4.mjs → EventEmbeddedCheckoutStep-CwerMfzn.mjs} +2 -1
- package/dist/preview-next/client/LocationPickerEnvironment-QtSG2Bl-.mjs +138 -0
- package/dist/preview-next/client/MapLibreEditMap-B-rohNcG.mjs +488 -0
- package/dist/preview-next/client/{PreviewEditorSidebar-DADCj_ET.mjs → PreviewEditorSidebar-Dvq-RW9-.mjs} +1328 -171
- package/dist/preview-next/client/{PreviewEditorUI-La40Dmmh.mjs → PreviewEditorUI-BdFjS39R.mjs} +53 -79
- package/dist/preview-next/client/{SdkPreviewModeRuntime-406Hw9zY.mjs → SdkPreviewModeRuntime-BEfHln1E.mjs} +1249 -2551
- package/dist/preview-next/client/{SdkPreviewModeRuntime-CWN44I_B.mjs → SdkPreviewModeRuntime-CjkGh1IG.mjs} +1 -1
- package/dist/preview-next/client/{SiteChromeCustomizeContext-BdwEZoo9.mjs → SiteChromeCustomizeContext-CDbxk_qZ.mjs} +117481 -162497
- package/dist/preview-next/client/{ThemedButton-BEOPss9H.mjs → ThemedButton-b14Bv03E.mjs} +1253 -403
- package/dist/preview-next/client/lucide-react-CA9cpo0P.mjs +51984 -0
- package/dist/preview-next/client/maplibre-gl-DykfOYYn.mjs +34208 -0
- package/dist/preview-next/client/{previewChromeSurface-BVUKIYG0.mjs → previewChromeSurface-Dd1_mNIg.mjs} +3 -8
- package/dist/preview-next/client/result-BjJUoxUF.mjs +16 -0
- package/dist/preview-next/client/rolldown-runtime-CE6sIgz8.mjs +34 -0
- package/dist/preview-next/client/runtime.mjs +3 -3
- package/dist/preview-next/client/{sdk-runtime-Cy9AKPy5.mjs → sdk-runtime-B-CXyGVb.mjs} +1 -1
- package/dist/preview-next/client/siteStyleAccess-Kqk0j0dE.mjs +5812 -0
- package/dist/preview-next/client/{spinner-Bhpzz2vO.mjs → spinner-CGxS8Ns-.mjs} +2 -1
- package/dist/preview-next/{constants-D8Ya7bO4.mjs → constants-Bf-vqdKH.mjs} +2 -1
- package/dist/preview-next/editor-base.css +64 -2
- package/dist/preview-next/editor-chrome.css +85 -0
- package/dist/preview-next/keepAlive.mjs +2 -2
- package/dist/preview-next/middleware.mjs +7 -3
- package/dist/preview-next/{route-contract-DM22uOXM.mjs → route-contract-hLg-yjQN.mjs} +190 -116
- package/dist/preview-next/{session-BgkrPqu0.mjs → session-P1R_ajT7.mjs} +12 -2
- package/dist/preview-next/session.mjs +1 -1
- package/dist/server/{Block.shared-DB6fb1pR.mjs → Block.shared-CeTd2saO.mjs} +6 -6
- package/dist/server/{bindings-z2daXp-2.mjs → bindings-C5YpKuKt.mjs} +3 -2
- package/dist/server/{client-Cv-osXoU.mjs → client-Cv26lZQ4.mjs} +14 -10
- package/dist/server/config-template-validation.mjs +50 -10
- package/dist/server/config-validation.mjs +1 -1
- package/dist/server/config.mjs +2 -2
- package/dist/server/{siteChromeOverlayClearance-BangtD8A.mjs → effectiveNavLinkStyle-CGvGr3yD.mjs} +572 -1078
- package/dist/server/index.mjs +3 -3
- package/dist/server/{loadContent-BNMDYCm8.mjs → loadContent-C8a0b-cC.mjs} +40 -21
- package/dist/server/loadPage--DXBwI8V.mjs +2 -0
- package/dist/server/{loadPage-CjA_F_AF.mjs → loadPage-BW7dklu3.mjs} +9 -5
- package/dist/server/manifest.mjs +1 -1
- package/dist/server/next.mjs +9 -9
- package/dist/server/{overrideResolution-CGodrtqi.mjs → overrideResolution-tIuqmJB3.mjs} +1 -1
- package/dist/server/{overrides-DxRC724a.mjs → overrides-D1fiPOKF.mjs} +1158 -754
- package/dist/server/page-converter.mjs +8 -10
- package/dist/server/{prebuild-C6bhjRKT.mjs → prebuild--fO0E2tr.mjs} +1 -1
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/{prefetchBlockData-DZ5Fq_-r.mjs → prefetchBlockData-CqJnokWJ.mjs} +968 -968
- package/dist/server/{publicProducts-C3meXS2o.mjs → publicProducts-CvvZ4JIe.mjs} +207 -132
- package/dist/server/{blocks-BaG8Qpaa.mjs → registry-BVfCqaCq.mjs} +2853 -2799
- package/dist/server/rendering/server.mjs +4 -4
- package/dist/server/rendering.mjs +8 -8
- package/dist/server/{resolveBlockData-CbGDakvp.mjs → resolveBlockData-DPNvhXEz.mjs} +6 -3
- package/dist/server/routing.mjs +1 -1
- package/dist/server/{schema-Bs735S27.mjs → schema-CD4peO7m.mjs} +2441 -1401
- package/dist/server/server.mjs +3 -3
- package/dist/server/site-styles-H-EvTJiW.mjs +787 -0
- package/dist/server/siteChromeOverlayClearance-DNC2k1U0.mjs +750 -0
- package/dist/server/{src-B935_bzN.mjs → src-ILxc6pid.mjs} +427 -190
- package/dist/server/theme-bridge.mjs +1 -1
- package/dist/server/theme.mjs +1 -1
- package/dist/server/{themeAdmission-DK2YBNqy.mjs → themeAdmission-BNHIXiUj.mjs} +117 -26
- package/dist/server/{three-pass-converter-CmmchOFC.mjs → three-pass-converter-Chnb1XD-.mjs} +2 -58
- package/dist/server/{validation-BtHE2S_D.mjs → validation-B1ieVemg.mjs} +22 -63
- package/dist/server/{version-CNCdL6id.mjs → version-BQK44wFg.mjs} +1 -1
- package/dist/styles/index.css +235 -0
- package/package.json +8 -3
- package/dist/_dts/index-CXsnaCGe.d.ts +0 -10
- package/dist/_dts/index-cnymEAZY.d.ts +0 -1
- package/dist/client/LeafletStaticMap-dlapZ6mi.mjs +0 -135
- package/dist/client/location-map.client-DRN1JePj.mjs +0 -28
- package/dist/client/location-map.view-CuCvQdvp.mjs +0 -282
- package/dist/client/locationMap-B9srHHzZ.mjs +0 -15
- package/dist/client/mediaContext-DThoeEBU.mjs +0 -136
- package/dist/client/renderableMediaAssetAdmission-DGjBr_e-.mjs +0 -152
- package/dist/client/timetableModel-D09jPdue.mjs +0 -480
- package/dist/client/wizardSteps-C0TsNqJc.mjs +0 -17049
- package/dist/preview-next/client/siteStyleAccess-CFMmoMZb.mjs +0 -1326
- package/dist/server/loadPage-jade28Xh.mjs +0 -2
- package/dist/server/media-CcHwZkdJ.mjs +0 -243
|
@@ -1,282 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { i as ThemedButtonLink, rr as textColorStyle } from "./ThemedButton-DVBC_pS9.mjs";
|
|
3
|
-
import { St as toScheduledBookingDateTime, _t as parseLocalScheduleTime, ft as formatBookingCompactEnglishTime } from "./noop-M8FTSgm2.mjs";
|
|
4
|
-
import { fn as parseWeeklyOpeningHours } from "./shop.interactive-BxL_bshW.mjs";
|
|
5
|
-
import "react";
|
|
6
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
-
//#region ../core/src/location.ts
|
|
8
|
-
function normalizeLocationAddressText(value) {
|
|
9
|
-
if (typeof value !== "string") return null;
|
|
10
|
-
const trimmed = value.trim();
|
|
11
|
-
return trimmed.length > 0 ? trimmed : null;
|
|
12
|
-
}
|
|
13
|
-
function hasLocationCoordinates(value) {
|
|
14
|
-
return value != null && typeof value.lat === "number" && typeof value.lng === "number";
|
|
15
|
-
}
|
|
16
|
-
function toLocationCoordinates(value) {
|
|
17
|
-
if (!hasLocationCoordinates(value)) return null;
|
|
18
|
-
return {
|
|
19
|
-
lat: value.lat,
|
|
20
|
-
lng: value.lng
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
//#endregion
|
|
24
|
-
//#region ../core/src/opening-hours.ts
|
|
25
|
-
const openingHoursWeekdayLabels = {
|
|
26
|
-
monday: "Monday",
|
|
27
|
-
tuesday: "Tuesday",
|
|
28
|
-
wednesday: "Wednesday",
|
|
29
|
-
thursday: "Thursday",
|
|
30
|
-
friday: "Friday",
|
|
31
|
-
saturday: "Saturday",
|
|
32
|
-
sunday: "Sunday"
|
|
33
|
-
};
|
|
34
|
-
function formatOpeningHoursTime(value) {
|
|
35
|
-
const time = parseLocalScheduleTime(value);
|
|
36
|
-
return formatBookingCompactEnglishTime(toScheduledBookingDateTime({
|
|
37
|
-
startsAt: new Date(Date.UTC(2e3, 0, 1, time.hour, time.minute)).toISOString(),
|
|
38
|
-
timeZone: "UTC",
|
|
39
|
-
locale: "en-GB"
|
|
40
|
-
}));
|
|
41
|
-
}
|
|
42
|
-
function formatDayHours(day) {
|
|
43
|
-
return day.kind === "closed" ? "Closed" : day.intervals.map((interval) => `${formatOpeningHoursTime(interval.opensAt)} to ${formatOpeningHoursTime(interval.closesAt)}`).join(", ");
|
|
44
|
-
}
|
|
45
|
-
function weekdayRangeLabel(weekdays) {
|
|
46
|
-
const first = weekdays[0];
|
|
47
|
-
const last = weekdays[weekdays.length - 1];
|
|
48
|
-
if (!first || !last) return "";
|
|
49
|
-
return first === last ? openingHoursWeekdayLabels[first] : `${openingHoursWeekdayLabels[first]} to ${openingHoursWeekdayLabels[last]}`;
|
|
50
|
-
}
|
|
51
|
-
/** Monday-first table rows; only adjacent days with identical ranges are grouped. */
|
|
52
|
-
function formatOpeningHoursRows(hours) {
|
|
53
|
-
return (hours?.days ?? []).reduce((rows, day) => {
|
|
54
|
-
const text = formatDayHours(day);
|
|
55
|
-
const previous = rows[rows.length - 1];
|
|
56
|
-
const weekdays = previous?.kind === day.kind && previous.hours === text ? [...previous.weekdays, day.weekday] : [day.weekday];
|
|
57
|
-
const row = {
|
|
58
|
-
kind: day.kind,
|
|
59
|
-
weekdays,
|
|
60
|
-
label: weekdayRangeLabel(weekdays),
|
|
61
|
-
hours: text
|
|
62
|
-
};
|
|
63
|
-
return weekdays.length > 1 ? [...rows.slice(0, -1), row] : [...rows, row];
|
|
64
|
-
}, []);
|
|
65
|
-
}
|
|
66
|
-
//#endregion
|
|
67
|
-
//#region ../blocks/src/system/runtime/nodes/location-map.shared.ts
|
|
68
|
-
const LOCATION_MAP_DEFAULTS = {
|
|
69
|
-
zoom: 15,
|
|
70
|
-
heightPx: 320,
|
|
71
|
-
showAddressText: true,
|
|
72
|
-
showDirections: true,
|
|
73
|
-
directionsLabel: "Get directions"
|
|
74
|
-
};
|
|
75
|
-
const LOCATION_MAP_LIMITS = {
|
|
76
|
-
zoom: {
|
|
77
|
-
min: 3,
|
|
78
|
-
max: 18
|
|
79
|
-
},
|
|
80
|
-
heightPx: {
|
|
81
|
-
min: 200,
|
|
82
|
-
max: 600
|
|
83
|
-
}
|
|
84
|
-
};
|
|
85
|
-
function normalizeNumber(value, fallback) {
|
|
86
|
-
if (typeof value === "number" && Number.isFinite(value)) return value;
|
|
87
|
-
if (typeof value === "string") {
|
|
88
|
-
const parsed = Number.parseFloat(value);
|
|
89
|
-
if (Number.isFinite(parsed)) return parsed;
|
|
90
|
-
}
|
|
91
|
-
return fallback;
|
|
92
|
-
}
|
|
93
|
-
function normalizeOptionalNumber(value) {
|
|
94
|
-
if (typeof value === "number" && Number.isFinite(value)) return value;
|
|
95
|
-
if (typeof value === "string") {
|
|
96
|
-
const parsed = Number.parseFloat(value);
|
|
97
|
-
if (Number.isFinite(parsed)) return parsed;
|
|
98
|
-
}
|
|
99
|
-
return null;
|
|
100
|
-
}
|
|
101
|
-
function normalizeBoolean(value, fallback) {
|
|
102
|
-
if (typeof value === "boolean") return value;
|
|
103
|
-
if (typeof value === "string") {
|
|
104
|
-
if (value === "true") return true;
|
|
105
|
-
if (value === "false") return false;
|
|
106
|
-
}
|
|
107
|
-
return fallback;
|
|
108
|
-
}
|
|
109
|
-
function normalizeLocationMapValueRecord(record) {
|
|
110
|
-
const normalized = {
|
|
111
|
-
addressText: normalizeLocationAddressText(typeof record.addressText === "string" ? record.addressText : typeof record.displayAddress === "string" ? record.displayAddress : null),
|
|
112
|
-
lat: normalizeOptionalNumber(record.lat),
|
|
113
|
-
lng: normalizeOptionalNumber(record.lng)
|
|
114
|
-
};
|
|
115
|
-
if (normalized.addressText === null && normalized.lat === null && normalized.lng === null) return null;
|
|
116
|
-
return normalized;
|
|
117
|
-
}
|
|
118
|
-
function normalizeLocationMapValue(value) {
|
|
119
|
-
if (typeof value !== "object" || value === null) return null;
|
|
120
|
-
return normalizeLocationMapValueRecord(value);
|
|
121
|
-
}
|
|
122
|
-
function normalizeLocationMapSource(value) {
|
|
123
|
-
return value === "business_address" || value === "venue" ? value : "custom";
|
|
124
|
-
}
|
|
125
|
-
function resolveLocationMapLocation(input) {
|
|
126
|
-
const source = normalizeLocationMapSource(input.locationSource);
|
|
127
|
-
if (source === "business_address") {
|
|
128
|
-
const locationValue = normalizeLocationMapValue(input.businessAddress ?? input.location);
|
|
129
|
-
return locationValue ? {
|
|
130
|
-
kind: "business_address",
|
|
131
|
-
locationValue
|
|
132
|
-
} : {
|
|
133
|
-
kind: "unresolved",
|
|
134
|
-
source,
|
|
135
|
-
reason: "missing_business_address"
|
|
136
|
-
};
|
|
137
|
-
}
|
|
138
|
-
if (source === "venue") {
|
|
139
|
-
const venueId = typeof input.venueId === "string" && input.venueId.trim() ? input.venueId.trim() : null;
|
|
140
|
-
if (!venueId) return {
|
|
141
|
-
kind: "unresolved",
|
|
142
|
-
source,
|
|
143
|
-
reason: "missing_venue_id"
|
|
144
|
-
};
|
|
145
|
-
const locationValue = input.venuesById ? normalizeLocationMapValue(input.venuesById[venueId] ?? null) : null;
|
|
146
|
-
return locationValue ? {
|
|
147
|
-
kind: "venue",
|
|
148
|
-
venueId,
|
|
149
|
-
locationValue
|
|
150
|
-
} : {
|
|
151
|
-
kind: "unresolved",
|
|
152
|
-
source,
|
|
153
|
-
reason: "missing_venue_location"
|
|
154
|
-
};
|
|
155
|
-
}
|
|
156
|
-
const locationValue = normalizeLocationMapValue(input.location);
|
|
157
|
-
return locationValue ? {
|
|
158
|
-
kind: "custom",
|
|
159
|
-
locationValue
|
|
160
|
-
} : {
|
|
161
|
-
kind: "unresolved",
|
|
162
|
-
source,
|
|
163
|
-
reason: "missing_custom_location"
|
|
164
|
-
};
|
|
165
|
-
}
|
|
166
|
-
function describeUnresolvedLocationMapLocation(resolvedLocation) {
|
|
167
|
-
if (resolvedLocation.kind !== "unresolved") return null;
|
|
168
|
-
switch (resolvedLocation.reason) {
|
|
169
|
-
case "missing_business_address": return "Business address details are not configured yet.";
|
|
170
|
-
case "missing_venue_id": return "Choose a venue to show this map.";
|
|
171
|
-
case "missing_venue_location": return "The selected venue does not have location details yet.";
|
|
172
|
-
case "missing_custom_location": return "Location details coming soon.";
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
function normalizeLocationMapProps(input) {
|
|
176
|
-
const parsedHours = parseWeeklyOpeningHours(input.openingHours);
|
|
177
|
-
const resolvedLocation = resolveLocationMapLocation(input);
|
|
178
|
-
const locationValue = resolvedLocation.kind === "unresolved" ? null : resolvedLocation.locationValue;
|
|
179
|
-
const directionsLabel = normalizeLocationAddressText(input.directionsLabel) ?? LOCATION_MAP_DEFAULTS.directionsLabel;
|
|
180
|
-
return {
|
|
181
|
-
resolvedLocation,
|
|
182
|
-
locationValue,
|
|
183
|
-
unresolvedMessage: describeUnresolvedLocationMapLocation(resolvedLocation),
|
|
184
|
-
addressText: locationValue?.addressText ?? null,
|
|
185
|
-
location: toLocationCoordinates(locationValue),
|
|
186
|
-
zoom: Math.min(LOCATION_MAP_LIMITS.zoom.max, Math.max(LOCATION_MAP_LIMITS.zoom.min, Math.round(normalizeNumber(input.zoom, LOCATION_MAP_DEFAULTS.zoom)))),
|
|
187
|
-
heightPx: Math.min(LOCATION_MAP_LIMITS.heightPx.max, Math.max(LOCATION_MAP_LIMITS.heightPx.min, Math.round(normalizeNumber(input.heightPx, LOCATION_MAP_DEFAULTS.heightPx)))),
|
|
188
|
-
openingHours: parsedHours.ok ? parsedHours.value : null,
|
|
189
|
-
showOpeningHours: normalizeBoolean(input.showOpeningHours, true),
|
|
190
|
-
showAddressText: normalizeBoolean(input.showAddressText, LOCATION_MAP_DEFAULTS.showAddressText),
|
|
191
|
-
showDirections: normalizeBoolean(input.showDirections, LOCATION_MAP_DEFAULTS.showDirections),
|
|
192
|
-
directionsLabel,
|
|
193
|
-
className: typeof input.className === "string" ? input.className : null
|
|
194
|
-
};
|
|
195
|
-
}
|
|
196
|
-
function toLocationMapHydrationProps(input) {
|
|
197
|
-
const normalized = normalizeLocationMapProps(input);
|
|
198
|
-
return {
|
|
199
|
-
location: normalized.locationValue,
|
|
200
|
-
zoom: normalized.zoom,
|
|
201
|
-
heightPx: normalized.heightPx,
|
|
202
|
-
openingHours: normalized.openingHours,
|
|
203
|
-
showOpeningHours: normalized.showOpeningHours,
|
|
204
|
-
showAddressText: normalized.showAddressText,
|
|
205
|
-
showDirections: normalized.showDirections,
|
|
206
|
-
directionsLabel: normalized.directionsLabel,
|
|
207
|
-
className: normalized.className
|
|
208
|
-
};
|
|
209
|
-
}
|
|
210
|
-
function buildGoogleMapsDirectionsUrl(input) {
|
|
211
|
-
const destination = input.location ? `${input.location.lat},${input.location.lng}` : normalizeLocationAddressText(input.addressText);
|
|
212
|
-
if (!destination) return null;
|
|
213
|
-
const url = new URL("https://www.google.com/maps/dir/");
|
|
214
|
-
url.searchParams.set("api", "1");
|
|
215
|
-
url.searchParams.set("destination", destination);
|
|
216
|
-
return url.toString();
|
|
217
|
-
}
|
|
218
|
-
//#endregion
|
|
219
|
-
//#region ../blocks/src/system/runtime/nodes/location-map.view.tsx
|
|
220
|
-
function OpeningHoursTable({ hours }) {
|
|
221
|
-
if (!hours) return null;
|
|
222
|
-
return /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsxs("table", { children: [/* @__PURE__ */ jsx("caption", { children: "Opening hours" }), /* @__PURE__ */ jsx("tbody", { children: formatOpeningHoursRows(hours).map((row) => /* @__PURE__ */ jsxs("tr", {
|
|
223
|
-
"data-closed": row.kind === "closed" ? true : void 0,
|
|
224
|
-
children: [/* @__PURE__ */ jsx("th", {
|
|
225
|
-
scope: "row",
|
|
226
|
-
children: row.label
|
|
227
|
-
}), /* @__PURE__ */ jsx("td", { children: row.hours })]
|
|
228
|
-
}, row.label)) })] }), hours.note ? /* @__PURE__ */ jsx("p", { children: hours.note }) : null] });
|
|
229
|
-
}
|
|
230
|
-
function LocationMapDirections({ url, label }) {
|
|
231
|
-
return url ? /* @__PURE__ */ jsx(ThemedButtonLink, {
|
|
232
|
-
href: url,
|
|
233
|
-
target: "_blank",
|
|
234
|
-
rel: "noreferrer",
|
|
235
|
-
variant: "ghost",
|
|
236
|
-
size: "sm",
|
|
237
|
-
extraClassName: "rb-w-fit",
|
|
238
|
-
label
|
|
239
|
-
}) : null;
|
|
240
|
-
}
|
|
241
|
-
function LocationMapView(props) {
|
|
242
|
-
const { addressText, location, renderMap, zoom, heightPx, showAddressText, directionsLabel } = props;
|
|
243
|
-
const directionsUrl = props.showDirections ? buildGoogleMapsDirectionsUrl({
|
|
244
|
-
addressText,
|
|
245
|
-
location
|
|
246
|
-
}) : null;
|
|
247
|
-
const hours = props.showOpeningHours === false ? null : props.openingHours ?? null;
|
|
248
|
-
if (![
|
|
249
|
-
location,
|
|
250
|
-
addressText,
|
|
251
|
-
directionsUrl,
|
|
252
|
-
hours
|
|
253
|
-
].some(Boolean)) return /* @__PURE__ */ jsx("p", {
|
|
254
|
-
className: "rb-caption",
|
|
255
|
-
style: textColorStyle("mutedText"),
|
|
256
|
-
children: props.unresolvedMessage ?? "Location details coming soon."
|
|
257
|
-
});
|
|
258
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
259
|
-
className: "rb-flex rb-flex-col rb-gap-4 rb-text-left",
|
|
260
|
-
children: [
|
|
261
|
-
location && renderMap ? renderMap({
|
|
262
|
-
addressText,
|
|
263
|
-
location,
|
|
264
|
-
className: "rb-location-map-canvas",
|
|
265
|
-
height: heightPx,
|
|
266
|
-
zoom
|
|
267
|
-
}) : null,
|
|
268
|
-
showAddressText && addressText ? /* @__PURE__ */ jsx("p", {
|
|
269
|
-
className: "rb-caption",
|
|
270
|
-
style: textColorStyle("mutedText"),
|
|
271
|
-
children: addressText
|
|
272
|
-
}) : null,
|
|
273
|
-
/* @__PURE__ */ jsx(OpeningHoursTable, { hours }),
|
|
274
|
-
/* @__PURE__ */ jsx(LocationMapDirections, {
|
|
275
|
-
url: directionsUrl,
|
|
276
|
-
label: directionsLabel
|
|
277
|
-
})
|
|
278
|
-
]
|
|
279
|
-
});
|
|
280
|
-
}
|
|
281
|
-
//#endregion
|
|
282
|
-
export { normalizeLocationMapSource as a, normalizeLocationMapProps as i, LOCATION_MAP_DEFAULTS as n, toLocationMapHydrationProps as o, LOCATION_MAP_LIMITS as r, LocationMapView as t };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { t as defineIslandPropsDecoder } from "./propsDecoder-DhbGL302.mjs";
|
|
3
|
-
import { t as LocationMapIslandClient } from "./location-map.client-DRN1JePj.mjs";
|
|
4
|
-
import { t as mountReactIsland } from "./reactMount-BGJVsHRb.mjs";
|
|
5
|
-
import "react";
|
|
6
|
-
import { jsx } from "react/jsx-runtime";
|
|
7
|
-
//#region src/rendering/islands/enhancers/locationMap.tsx
|
|
8
|
-
const decode = defineIslandPropsDecoder("location-map");
|
|
9
|
-
const enhance = (root, props) => {
|
|
10
|
-
return mountReactIsland(root, ({ root: reactRoot }) => {
|
|
11
|
-
reactRoot.render(/* @__PURE__ */ jsx(LocationMapIslandClient, { ...props }));
|
|
12
|
-
});
|
|
13
|
-
};
|
|
14
|
-
//#endregion
|
|
15
|
-
export { decode, enhance };
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { t as buildRenderableMediaAssetIndex } from "./renderableMediaAssetAdmission-DGjBr_e-.mjs";
|
|
3
|
-
//#region ../blocks/src/system/runtime/nodes/mediaContext.ts
|
|
4
|
-
function buildMediaAssetIndex(assets) {
|
|
5
|
-
return buildRenderableMediaAssetIndex(assets);
|
|
6
|
-
}
|
|
7
|
-
function normalizeSupabaseUrl(value) {
|
|
8
|
-
return value?.replace(/\/$/, "");
|
|
9
|
-
}
|
|
10
|
-
function buildResolveImageUrlContext(input) {
|
|
11
|
-
return {
|
|
12
|
-
supabaseUrl: normalizeSupabaseUrl(input?.supabaseUrl),
|
|
13
|
-
siteId: input?.siteId,
|
|
14
|
-
mediaAssetIndex: input?.mediaAssetIndex ?? buildMediaAssetIndex(input?.mediaAssets)
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Server-side: AsyncLocalStorage for request isolation.
|
|
19
|
-
* Prevents race conditions when multiple requests are processed concurrently.
|
|
20
|
-
*
|
|
21
|
-
* Lazy initialization to avoid issues in environments that don't support async_hooks.
|
|
22
|
-
*/
|
|
23
|
-
const serverStorageState = {
|
|
24
|
-
storage: null,
|
|
25
|
-
checked: false
|
|
26
|
-
};
|
|
27
|
-
function getServerStorage() {
|
|
28
|
-
if (typeof window !== "undefined") return null;
|
|
29
|
-
if (serverStorageState.checked) return serverStorageState.storage;
|
|
30
|
-
serverStorageState.checked = true;
|
|
31
|
-
try {
|
|
32
|
-
const globalWithNonWebpackRequire = globalThis;
|
|
33
|
-
const AsyncLocalStorage = (typeof globalWithNonWebpackRequire.__non_webpack_require__ === "function" ? globalWithNonWebpackRequire.__non_webpack_require__ : new Function("id", "return require(id)"))("async_hooks").AsyncLocalStorage;
|
|
34
|
-
if (AsyncLocalStorage) {
|
|
35
|
-
serverStorageState.storage = new AsyncLocalStorage();
|
|
36
|
-
return serverStorageState.storage;
|
|
37
|
-
}
|
|
38
|
-
return null;
|
|
39
|
-
} catch {
|
|
40
|
-
console.warn("[blocks] AsyncLocalStorage not available - using module-level state");
|
|
41
|
-
return null;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Client-side context storage.
|
|
46
|
-
* Safe because browsers are single-threaded per tab.
|
|
47
|
-
*
|
|
48
|
-
* IMPORTANT: This must be shared across bundles.
|
|
49
|
-
* SDK preview mode can load multiple independently-bundled entrypoints
|
|
50
|
-
* (e.g. `@riverbankcms/sdk/rendering` + `@riverbankcms/sdk/preview-next/client`),
|
|
51
|
-
* which can otherwise each get their own module-scoped singleton.
|
|
52
|
-
*/
|
|
53
|
-
const RB_MEDIA_CONTEXT_KEY = Symbol.for("riverbankcms.blocks.mediaContext");
|
|
54
|
-
function getClientContextStore() {
|
|
55
|
-
const g = globalThis;
|
|
56
|
-
const existing = g[RB_MEDIA_CONTEXT_KEY];
|
|
57
|
-
if (existing && typeof existing === "object") return existing;
|
|
58
|
-
const next = {};
|
|
59
|
-
g[RB_MEDIA_CONTEXT_KEY] = next;
|
|
60
|
-
return next;
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Get the current media context.
|
|
64
|
-
* Server-side: Uses AsyncLocalStorage for request isolation.
|
|
65
|
-
* Client-side: Uses module-level state (safe in single-threaded browser).
|
|
66
|
-
*/
|
|
67
|
-
function getMediaContext() {
|
|
68
|
-
const storage = getServerStorage();
|
|
69
|
-
if (storage) return storage.getStore() ?? {};
|
|
70
|
-
return getClientContextStore();
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Set the Supabase URL in the current context.
|
|
74
|
-
* @deprecated Use runWithMediaContext instead for request isolation.
|
|
75
|
-
*/
|
|
76
|
-
function updateMediaContext(patch) {
|
|
77
|
-
const storage = getServerStorage();
|
|
78
|
-
const current = storage?.getStore();
|
|
79
|
-
if (current) Object.assign(current, patch);
|
|
80
|
-
else if (storage?.enterWith) storage.enterWith(patch);
|
|
81
|
-
else Object.assign(getClientContextStore(), patch);
|
|
82
|
-
}
|
|
83
|
-
function setContextSupabaseUrl(url) {
|
|
84
|
-
updateMediaContext({ supabaseUrl: normalizeSupabaseUrl(url) });
|
|
85
|
-
}
|
|
86
|
-
/** @deprecated Use runWithMediaContext for request isolation. */
|
|
87
|
-
function setContextSiteId(siteId) {
|
|
88
|
-
updateMediaContext({ siteId });
|
|
89
|
-
}
|
|
90
|
-
function setContextMediaAssetIndex(index) {
|
|
91
|
-
updateMediaContext({ mediaAssetIndex: index });
|
|
92
|
-
}
|
|
93
|
-
function setContextResolveImageUrlContext(context) {
|
|
94
|
-
setContextSupabaseUrl(context?.supabaseUrl);
|
|
95
|
-
setContextSiteId(context?.siteId);
|
|
96
|
-
setContextMediaAssetIndex(context?.mediaAssetIndex);
|
|
97
|
-
}
|
|
98
|
-
function getCurrentResolveImageUrlContext() {
|
|
99
|
-
const context = getMediaContext();
|
|
100
|
-
if (!context.supabaseUrl && !context.siteId && !context.mediaAssetIndex) return;
|
|
101
|
-
return {
|
|
102
|
-
supabaseUrl: context.supabaseUrl,
|
|
103
|
-
siteId: context.siteId,
|
|
104
|
-
mediaAssetIndex: context.mediaAssetIndex
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
|
-
* Get the Supabase URL for constructing direct storage URLs.
|
|
109
|
-
* Used for serving images directly from Supabase storage CDN.
|
|
110
|
-
*
|
|
111
|
-
* Resolution order:
|
|
112
|
-
* 1. Context URL (set via runWithMediaContext or setContextSupabaseUrl)
|
|
113
|
-
* 2. Environment variable NEXT_PUBLIC_SUPABASE_URL
|
|
114
|
-
*
|
|
115
|
-
* SDK sites receive the URL from the API, so they don't need the env var.
|
|
116
|
-
* Dashboard and frontend apps use the env var.
|
|
117
|
-
*/
|
|
118
|
-
function getSupabaseUrl() {
|
|
119
|
-
const context = getMediaContext();
|
|
120
|
-
if (context.supabaseUrl) return context.supabaseUrl;
|
|
121
|
-
const url = process.env.NEXT_PUBLIC_SUPABASE_URL;
|
|
122
|
-
if (!url) throw new Error("NEXT_PUBLIC_SUPABASE_URL is not configured. Set it to your Supabase project URL (e.g., https://xxx.supabase.co)");
|
|
123
|
-
return url.replace(/\/$/, "");
|
|
124
|
-
}
|
|
125
|
-
/**
|
|
126
|
-
* Get the site ID for constructing storage paths.
|
|
127
|
-
* Required for relative path resolution.
|
|
128
|
-
*/
|
|
129
|
-
function getSiteId() {
|
|
130
|
-
return getMediaContext().siteId;
|
|
131
|
-
}
|
|
132
|
-
function getMediaAssetIndex(context) {
|
|
133
|
-
return context?.mediaAssetIndex ?? getMediaContext().mediaAssetIndex;
|
|
134
|
-
}
|
|
135
|
-
//#endregion
|
|
136
|
-
export { getSupabaseUrl as a, getSiteId as i, getCurrentResolveImageUrlContext as n, setContextResolveImageUrlContext as o, getMediaAssetIndex as r, buildResolveImageUrlContext as t };
|
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
//#region ../core/src/result.ts
|
|
4
|
-
function ok(value) {
|
|
5
|
-
return {
|
|
6
|
-
ok: true,
|
|
7
|
-
value
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
|
-
function err(error) {
|
|
11
|
-
return {
|
|
12
|
-
ok: false,
|
|
13
|
-
error
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
//#endregion
|
|
17
|
-
//#region ../core/src/branded.ts
|
|
18
|
-
const UUID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
19
|
-
function parseUuidBrand(value, unsafeConstructor) {
|
|
20
|
-
if (typeof value !== "string") return err({ kind: "not_string" });
|
|
21
|
-
const normalized = value.trim().toLowerCase();
|
|
22
|
-
if (normalized.length === 0) return err({ kind: "empty_string" });
|
|
23
|
-
if (!UUID_PATTERN.test(normalized)) return err({ kind: "invalid_uuid" });
|
|
24
|
-
return ok(unsafeConstructor(normalized));
|
|
25
|
-
}
|
|
26
|
-
const unsafeAsSiteId = (id) => id;
|
|
27
|
-
const unsafeAsApiKeyId = (id) => id;
|
|
28
|
-
const unsafeAsEventOfferingId = (id) => id;
|
|
29
|
-
const unsafeAsEventSeriesId = (id) => id;
|
|
30
|
-
const unsafeAsMediaAssetId = (id) => id;
|
|
31
|
-
const unsafeAsStorageBucketName = (value) => value;
|
|
32
|
-
const unsafeAsStoragePath = (value) => value;
|
|
33
|
-
const unsafeAsUserId = (id) => id;
|
|
34
|
-
const unsafeAsFormId = (id) => id;
|
|
35
|
-
const unsafeAsPassId = (id) => id;
|
|
36
|
-
const unsafeAsSiteTermsVersionId = (id) => id;
|
|
37
|
-
const unsafeAsCustomerPassId = (id) => id;
|
|
38
|
-
const unsafeAsAppointmentServiceId = (id) => id;
|
|
39
|
-
const unsafeAsAppointmentResourceId = (id) => id;
|
|
40
|
-
const unsafeAsContentVersionId = (id) => id;
|
|
41
|
-
const parseSiteId = (value) => parseUuidBrand(value, unsafeAsSiteId);
|
|
42
|
-
const parseApiKeyId = (value) => parseUuidBrand(value, unsafeAsApiKeyId);
|
|
43
|
-
const parseEventOfferingId = (value) => parseUuidBrand(value, unsafeAsEventOfferingId);
|
|
44
|
-
const parseUserId = (value) => parseUuidBrand(value, unsafeAsUserId);
|
|
45
|
-
const parseMediaAssetId = (value) => parseUuidBrand(value, unsafeAsMediaAssetId);
|
|
46
|
-
const parseContentVersionId = (value) => parseUuidBrand(value, unsafeAsContentVersionId);
|
|
47
|
-
const parseSiteTermsVersionId = (value) => parseUuidBrand(value, unsafeAsSiteTermsVersionId);
|
|
48
|
-
const parseEventSeriesId = (value) => parseUuidBrand(value, unsafeAsEventSeriesId);
|
|
49
|
-
//#endregion
|
|
50
|
-
//#region ../media-core/src/identifiers.ts
|
|
51
|
-
function slugifyMediaIdentifier(value) {
|
|
52
|
-
return value.toLowerCase().trim().replace(/[^a-z0-9\s-]/g, "").replace(/\s+/g, "-").replace(/-+/g, "-");
|
|
53
|
-
}
|
|
54
|
-
function parseMediaIdentifier(value) {
|
|
55
|
-
if (typeof value !== "string") return err({ kind: "not_string" });
|
|
56
|
-
const trimmed = value.trim();
|
|
57
|
-
if (trimmed.length === 0) return err({ kind: "empty_identifier" });
|
|
58
|
-
const normalized = slugifyMediaIdentifier(trimmed);
|
|
59
|
-
if (normalized.length === 0) return err({
|
|
60
|
-
kind: "empty_after_normalization",
|
|
61
|
-
value
|
|
62
|
-
});
|
|
63
|
-
return ok(normalized);
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Admits identifiers read from trusted persistence without repairing dirty data in memory.
|
|
67
|
-
* User input should use parseMediaIdentifier, which intentionally canonicalizes it.
|
|
68
|
-
*/
|
|
69
|
-
function parseCanonicalMediaIdentifier(value) {
|
|
70
|
-
if (typeof value !== "string") return err({ kind: "not_string" });
|
|
71
|
-
const parsed = parseMediaIdentifier(value);
|
|
72
|
-
if (!parsed.ok) return parsed;
|
|
73
|
-
if (value !== parsed.value) return err({
|
|
74
|
-
kind: "non_canonical_identifier",
|
|
75
|
-
value,
|
|
76
|
-
canonical: parsed.value
|
|
77
|
-
});
|
|
78
|
-
return parsed;
|
|
79
|
-
}
|
|
80
|
-
//#endregion
|
|
81
|
-
//#region ../media-core/src/mediaIdentifierSchema.ts
|
|
82
|
-
/** Strict stored-reference admission delegates the canonical identifier decision. */
|
|
83
|
-
const mediaIdentifierSchema = z.string().transform((value, context) => {
|
|
84
|
-
const parsed = parseCanonicalMediaIdentifier(value);
|
|
85
|
-
if (parsed.ok) return parsed.value;
|
|
86
|
-
context.addIssue({
|
|
87
|
-
code: "custom",
|
|
88
|
-
message: "Expected a canonical media identifier"
|
|
89
|
-
});
|
|
90
|
-
return z.NEVER;
|
|
91
|
-
});
|
|
92
|
-
//#endregion
|
|
93
|
-
//#region ../media-core/src/renderableMediaAsset.ts
|
|
94
|
-
/** Shared identifier indexing for admitted site-scoped projections. */
|
|
95
|
-
function buildMediaIdentifierIndex(assets) {
|
|
96
|
-
const index = new Map(assets.map((asset) => [asset.identifier, asset]));
|
|
97
|
-
if (index.size !== assets.length) throw new Error("Duplicate media identifier in a site asset list");
|
|
98
|
-
return index;
|
|
99
|
-
}
|
|
100
|
-
/** Index already admitted projections, including runtime registration updates. */
|
|
101
|
-
function indexRenderableMediaAssets(assets) {
|
|
102
|
-
if (!assets.length) return void 0;
|
|
103
|
-
const byId = new Map(assets.map((asset) => [asset.id, asset]));
|
|
104
|
-
const byIdentifier = buildMediaIdentifierIndex(assets);
|
|
105
|
-
if (byId.size !== assets.length) throw new Error("Duplicate media asset identity in a site asset list");
|
|
106
|
-
return {
|
|
107
|
-
assets,
|
|
108
|
-
byId,
|
|
109
|
-
byIdentifier
|
|
110
|
-
};
|
|
111
|
-
}
|
|
112
|
-
/** A portable reference never uses an incidental UUID, URL or storage snapshot for identity. */
|
|
113
|
-
function resolveManagedMediaReference(reference, index) {
|
|
114
|
-
const asset = index?.byIdentifier.get(reference.identifier);
|
|
115
|
-
return asset ? {
|
|
116
|
-
kind: "resolved",
|
|
117
|
-
reference,
|
|
118
|
-
asset
|
|
119
|
-
} : {
|
|
120
|
-
kind: "missing",
|
|
121
|
-
reference
|
|
122
|
-
};
|
|
123
|
-
}
|
|
124
|
-
//#endregion
|
|
125
|
-
//#region ../media-core/src/renderableMediaAssetAdmission.ts
|
|
126
|
-
const mediaAssetIdSchema = z.string().transform((value, context) => {
|
|
127
|
-
const parsed = parseMediaAssetId(value);
|
|
128
|
-
if (parsed.ok) return parsed.value;
|
|
129
|
-
context.addIssue({
|
|
130
|
-
code: "custom",
|
|
131
|
-
message: "Expected a media asset ID"
|
|
132
|
-
});
|
|
133
|
-
return z.NEVER;
|
|
134
|
-
});
|
|
135
|
-
const nonemptyStorageValue = z.string().refine((value) => value.trim().length > 0);
|
|
136
|
-
const renderableMediaAssetSchema = z.object({
|
|
137
|
-
id: mediaAssetIdSchema,
|
|
138
|
-
identifier: mediaIdentifierSchema,
|
|
139
|
-
storageBucket: nonemptyStorageValue,
|
|
140
|
-
storagePath: nonemptyStorageValue,
|
|
141
|
-
mimeType: nonemptyStorageValue,
|
|
142
|
-
filename: z.string().optional(),
|
|
143
|
-
width: z.number().positive().nullable(),
|
|
144
|
-
height: z.number().positive().nullable()
|
|
145
|
-
});
|
|
146
|
-
/** Admission precedes the identifier-only runtime resolution decision. */
|
|
147
|
-
function buildRenderableMediaAssetIndex(assets) {
|
|
148
|
-
if (!assets?.length) return void 0;
|
|
149
|
-
return indexRenderableMediaAssets(assets.map((asset) => renderableMediaAssetSchema.parse(asset)));
|
|
150
|
-
}
|
|
151
|
-
//#endregion
|
|
152
|
-
export { unsafeAsStoragePath as C, unsafeAsStorageBucketName as S, ok as T, unsafeAsCustomerPassId as _, mediaIdentifierSchema as a, unsafeAsPassId as b, parseApiKeyId as c, parseEventSeriesId as d, parseSiteId as f, unsafeAsAppointmentServiceId as g, unsafeAsAppointmentResourceId as h, resolveManagedMediaReference as i, parseContentVersionId as l, parseUserId as m, renderableMediaAssetSchema as n, parseCanonicalMediaIdentifier as o, parseSiteTermsVersionId as p, indexRenderableMediaAssets as r, parseMediaIdentifier as s, buildRenderableMediaAssetIndex as t, parseEventOfferingId as u, unsafeAsFormId as v, err as w, unsafeAsSiteId as x, unsafeAsMediaAssetId as y };
|