@riverbankcms/sdk 0.160.0 → 0.162.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-CoqeotCL.d.ts → BlocksIslandsHydrator-PZUoA872.d.ts} +1 -1
- package/dist/_dts/{Page-C0ENVLCF.d.ts → Page-CdQS6C7i.d.ts} +211 -9
- package/dist/_dts/{SdkPreviewMode-jZK0A49V.d.ts → SdkPreviewMode-CNGO-5f1.d.ts} +59 -92
- package/dist/_dts/{auth-contract-FPg0-2MC.d.ts → auth-contract-CgJ5nMaH.d.ts} +2 -0
- package/dist/_dts/{client-uMMuPq9V.d.ts → client-DGa53rjL.d.ts} +11 -3
- package/dist/_dts/{content-types-D6nXGqdQ.d.ts → content-types-K9R7P-KF.d.ts} +2 -2
- package/dist/_dts/{contracts-Bnmj1nxu.d.ts → contracts-CyBaPaIq.d.ts} +17 -5
- package/dist/_dts/{footerPageOutline-CeLjFX8b.d.ts → footerPageOutline-B6jmKmon.d.ts} +6 -6
- package/dist/_dts/{generatePageMetadata-nyU8q02J.d.ts → generatePageMetadata-iemoR3AN.d.ts} +2 -2
- package/dist/_dts/{index-BaaGBY1v.d.ts → index-8CN0Nd-Z.d.ts} +2 -2
- package/dist/_dts/{index-nVoi_74l.d.ts → index-BtnsA14K.d.ts} +10 -20
- package/dist/_dts/{index-lkpjIg5i.d.ts → index-C39F9KaB.d.ts} +13 -2
- package/dist/_dts/{index-C5xslEBn.d.ts → index-DEu85xBt.d.ts} +1 -1
- package/dist/_dts/{schema-D0bNcPWK.d.ts → index-DI2yaSPY.d.ts} +22873 -19918
- package/dist/_dts/{types-D8czmbQF.d.ts → index-Dbd0Sn0G.d.ts} +4356 -1827
- package/dist/_dts/{index-CEaKil7G.d.ts → index-Du1IRglc.d.ts} +2 -2
- package/dist/_dts/{index-DahMwisK.d.ts → index-Jlcq6w69.d.ts} +3 -3
- package/dist/_dts/{index-Bg64CkV-.d.ts → index-Wm62sXf2.d.ts} +4 -4
- package/dist/_dts/{loadContent-CYLmzvLq.d.ts → loadContent-BPfAAZDW.d.ts} +13 -10
- package/dist/_dts/{resolvePageContent-DqnxChOs.d.ts → resolvePageContent-DWbrtKf8.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/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/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/{types-DSgmJ15W.d.ts → types-CVv2H4AT.d.ts} +7 -7
- package/dist/_dts/{types-CFrYuXYP.d.ts → types-CfNG5koF.d.ts} +4 -2
- package/dist/_dts/{types-Dm-KW7nj.d.ts → types-ClZ-BQL_.d.ts} +3 -3
- package/dist/_dts/{validation-Bmb4WnHg.d.ts → validation-BJ6Lf_Dr.d.ts} +4 -4
- package/dist/client/{BlocksIslandsHydrator-DZRKi6tT.mjs → BlocksIslandsHydrator-COqlgWYU.mjs} +23 -21
- package/dist/client/{BookingMailingListNote-C00sLLdL.mjs → BookingMailingListNote-CFYPDEHH.mjs} +1 -1
- package/dist/client/{CalendarNavigationChevron-CHSi9b3E.mjs → CalendarNavigationChevron-COBVxgHb.mjs} +6 -6
- package/dist/client/{CheckboxChoice-Bhm6RAUL.mjs → CheckboxChoice-C7X9dJ8A.mjs} +1 -1
- package/dist/client/{DemoBookingPortalAccess-CaN-7ui7.mjs → DemoBookingPortalAccess-CvT0E9AR.mjs} +26 -10
- package/dist/client/{DemoPortalSignInLink-ClxN5_xZ.mjs → DemoPortalSignInLink-EBOBN5dT.mjs} +1 -1
- package/dist/client/{EventCalendar.client-BncvSa1n.mjs → EventCalendar.client-U6pKcntV.mjs} +16 -17
- package/dist/client/{EventCombined.client-DluBxVVu.mjs → EventCombined.client-CNzwEHws.mjs} +8 -8
- package/dist/client/{EventEmbeddedCheckoutStep-BiJrMtfp.mjs → EventEmbeddedCheckoutStep-B9yAWV_k.mjs} +1 -1
- package/dist/client/{EventItem-CXhnT9pF.mjs → EventItem-M5rpaHxi.mjs} +4 -4
- package/dist/client/{EventListWeekNavigation-V-dtoDlD.mjs → EventListWeekNavigation-D4ieBLDY.mjs} +1 -1
- package/dist/client/{EventListing.client-DPO6SZbx.mjs → EventListing.client-B8F40Rmn.mjs} +3 -3
- package/dist/client/{EventListing.view-B-Yi5JZS.mjs → EventListing.view-k4lhuCn5.mjs} +15 -6
- package/dist/client/{EventRegistrationPayment-Dc3Fnlnw.mjs → EventRegistrationPayment-C3g8_Hqb.mjs} +25 -13
- package/dist/client/LocationMapActions-CAjt7qVo.mjs +62 -0
- package/dist/client/MapDrawingSvg-_aIK2ojv.mjs +200 -0
- package/dist/client/{Page-7PkzO04N.mjs → Page-DJBIQBOw.mjs} +2555 -536
- package/dist/client/{StepIndicator-DiD6euZ8.mjs → StepIndicator-CFacB1z6.mjs} +2 -2
- package/dist/client/{TabBarFragment-BHd8GN8y.mjs → TabBarFragment-BLsfQskO.mjs} +1 -1
- package/dist/client/ThemedButton-BWsDgjMC.mjs +2243 -0
- package/dist/client/{accordion-2m27DsIk.mjs → accordion-CtO2XF7M.mjs} +1 -1
- package/dist/client/{booking-form.client-BddWV5w1.mjs → booking-form.client-RICCQ0h2.mjs} +137 -60
- package/dist/client/{bookingForm-bcdXQjmw.mjs → bookingForm-SvjLPx8i.mjs} +4 -4
- package/dist/client/bookings.mjs +5 -5
- package/dist/client/{carousel-D7nj9I0y.mjs → carousel-BR-zCD3O.mjs} +2 -2
- package/dist/client/{carousel.client-AffDJo_s.mjs → carousel.client-CEWtoZd3.mjs} +1 -1
- package/dist/client/{cart-PN6yCw1H.mjs → cart-C6YpKbZZ.mjs} +3 -3
- package/dist/client/{cart.client-D4t1f0cJ.mjs → cart.client-dC938WrX.mjs} +1 -1
- package/dist/client/{checkout-CsTwXVSb.mjs → checkout-Dy9RlREI.mjs} +3 -3
- package/dist/client/{checkout.client-BhQE3zY7.mjs → checkout.client-CefG0d2F.mjs} +1 -1
- package/dist/client/client.mjs +37 -71
- package/dist/client/{context-BLAvalAa.mjs → context-BFwxgZpB.mjs} +28 -1
- package/dist/client/{cta-CUXhX_D7.mjs → cta-DtA42Xio.mjs} +1 -1
- package/dist/client/{dateFormatting-BHIHxNuo.mjs → dateFormatting-yP1B7F0O.mjs} +39 -2
- package/dist/client/{demoPortalMagicLink-R-awbk_0.mjs → demoPortalMagicLink-WOiT5Ryi.mjs} +1 -1
- package/dist/client/{enhanceHeaderSection-9Q93uvTo.mjs → enhanceHeaderSection-Dh8c_Lq-.mjs} +3 -3
- package/dist/client/{event-details.client-BS1WtG-a.mjs → event-details.client-BFgsLqTj.mjs} +3 -17
- package/dist/client/{event-registration.client-BXndwsET.mjs → event-registration.client-BaXZ1-Ky.mjs} +16 -16
- package/dist/client/{eventCalendar-HyoOt1Qz.mjs → eventCalendar-COLwF80U.mjs} +4 -4
- package/dist/client/{eventCombined-sdG5oEaH.mjs → eventCombined-D3Ltwu03.mjs} +4 -4
- package/dist/client/{eventDetails-FFAknE4w.mjs → eventDetails-CBrkimXu.mjs} +2 -2
- package/dist/client/{eventListing-CGK6urk3.mjs → eventListing-CedKVA1S.mjs} +4 -4
- package/dist/client/{eventRegistration-VhrvCs4l.mjs → eventRegistration-DkQQfR1b.mjs} +4 -4
- package/dist/client/{form-C-B5O_ko.mjs → form-XFy9uXSJ.mjs} +3 -3
- package/dist/client/{form.client-DoZVcl8d.mjs → form.client-B0iancFK.mjs} +4 -4
- package/dist/client/{form.parts-mttKpgif.mjs → form.parts-DMbolu9Y.mjs} +3 -3
- package/dist/client/{formatDate-xUSCknEO.mjs → formatDate-Jm5MQOCA.mjs} +1 -1
- package/dist/client/gifting/client.mjs +3 -3
- package/dist/client/{headerSection-BHUEXsaI.mjs → headerSection-WjlECjtV.mjs} +2 -2
- package/dist/client/{mediaAssets-BOj-Co0B.mjs → mediaAssets-BkoW_PEn.mjs} +1 -1
- package/dist/client/{mediaContext-DThoeEBU.mjs → mediaContext-CNzWmoA4.mjs} +1 -1
- package/dist/client/{newsletter-form.client-D_n0rftg.mjs → newsletter-form.client-D-XwJTjN.mjs} +5 -5
- package/dist/client/{newsletter-form.parts-DKHye4IE.mjs → newsletter-form.parts-H92f30y0.mjs} +2 -2
- package/dist/client/{newsletterForm-tEaYelzx.mjs → newsletterForm-DMuxzu6I.mjs} +3 -3
- package/dist/client/{noop-B610YKEx.mjs → noop-B3RNPVrt.mjs} +313 -3
- package/dist/client/portal/client.mjs +1116 -85
- package/dist/client/{product-detail.client-DUf5x5Jt.mjs → product-detail.client-B3HuuykE.mjs} +1 -1
- package/dist/client/{product-list.client-Cqp1BPTV.mjs → product-list.client-CzsDrHQO.mjs} +1 -1
- package/dist/client/{productDetail-B8bBiogP.mjs → productDetail-CbBUVWgd.mjs} +3 -3
- package/dist/client/{productList-BKN4D-1z.mjs → productList-vqOKH2mh.mjs} +3 -3
- package/dist/client/{propsDecoder-2nNZh2Oe.mjs → propsDecoder-CkSUep5a.mjs} +4 -28
- package/dist/client/{registry.server-BAm4RPNJ.mjs → registry.server-cZ24QwtW.mjs} +607 -210
- package/dist/client/rendering/client.mjs +28 -28
- package/dist/client/rendering/islands.mjs +1 -1
- package/dist/client/rendering.mjs +18 -9
- package/dist/client/{richText-coerce-Cv-qomNB.mjs → richText-coerce-DDcCKvBJ.mjs} +1 -1
- package/dist/client/{routeIslandApiConfig-C5u8MbAA.mjs → routeIslandApiConfig-DYBioANh.mjs} +1 -1
- package/dist/client/{ThemedButton-C22C9cCF.mjs → schema-DNHLlze-.mjs} +7307 -8363
- package/dist/client/{shop-DZNC0VKk.mjs → shop-CF0dhnfH.mjs} +3 -3
- package/dist/client/{shop-commerce-DdX4LSa3.mjs → shop-commerce-DQznNBEo.mjs} +11 -11
- package/dist/client/{shop-commerce-store-BJtrZov9.mjs → shop-commerce-store-Ba8zPlIg.mjs} +1 -1
- package/dist/client/{shop.client-DmDd-igg.mjs → shop.client-DqfYoqWH.mjs} +12 -12
- package/dist/client/{shop.interactive-5SnnDHz3.mjs → shop.interactive-CreQ0I7i.mjs} +38 -183
- package/dist/client/{shopShared-CPqUlAh9.mjs → shopShared-D-yh-P7g.mjs} +2 -2
- package/dist/client/site-styles-B9HgmY07.mjs +11619 -0
- package/dist/client/{timetableModel-C19rcHEw.mjs → timetableModel-DCdVErTJ.mjs} +149 -8
- package/dist/client/{useAvailableSlots-BjbJXotk.mjs → useAvailableSlots-Cvgdp2DH.mjs} +8 -11
- package/dist/client/{useBookingNowIso-CMgfL7YJ.mjs → useBookingNowIso-DrTnGNzD.mjs} +1 -1
- package/dist/client/{useDiscountApply-KG8jB7WC.mjs → useDiscountApply-CULjnXGl.mjs} +2 -2
- package/dist/client/{useDiscountCodeUi-DK2w_i0a.mjs → useDiscountCodeUi-Gn_m7e0o.mjs} +1 -1
- package/dist/client/{useEventPagination-DW6MCirb.mjs → useEventPagination-CsysCF22.mjs} +8 -21
- package/dist/client/{view-CseyBW07.mjs → view-BpBjo9Te.mjs} +71 -59
- package/dist/client/{view-CkUn3Y0Y.mjs → view-DMyTchi7.mjs} +4 -4
- package/dist/client/wizardSteps-BO2OmMO9.mjs +6604 -0
- package/dist/preview-next/before-render.mjs +7 -6
- package/dist/preview-next/chrome.css +2 -0
- package/dist/preview-next/client/{EventEmbeddedCheckoutStep-lUHBrzHv.mjs → EventEmbeddedCheckoutStep-DLsSmZbO.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-DWyUGCAG.mjs → PreviewEditorSidebar-ChrW9VEo.mjs} +269 -1100
- package/dist/preview-next/client/{PreviewEditorUI-Wq0b3Daw.mjs → PreviewEditorUI-VaHvYtrA.mjs} +10 -190
- package/dist/preview-next/client/{SdkPreviewModeRuntime-BtZPcwYV.mjs → SdkPreviewModeRuntime-Bz7jR6nl.mjs} +1 -1
- package/dist/preview-next/client/{SdkPreviewModeRuntime-wSI_R361.mjs → SdkPreviewModeRuntime-DWwktlWs.mjs} +639 -536
- package/dist/preview-next/client/{ThemedButton-DzeycIlD.mjs → ThemedButton-CHKOWXxl.mjs} +1706 -692
- 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/{SiteChromeCustomizeContext-Hc4pYnNe.mjs → previewAuthStore-C0VUwEHz.mjs} +81363 -136296
- package/dist/preview-next/client/{previewChromeSurface-Corq4AG7.mjs → previewChromeSurface-Dhyx2YrS.mjs} +1 -1
- 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-CWymRWhK.mjs → sdk-runtime-C2GWOCyj.mjs} +1 -1
- package/dist/preview-next/client/siteStyleAccess-DHyzUpv4.mjs +12833 -0
- package/dist/preview-next/client/{spinner-C4If5Y-O.mjs → spinner-BeR2S8oG.mjs} +2 -1
- package/dist/preview-next/{constants-D8Ya7bO4.mjs → constants-Bf-vqdKH.mjs} +2 -1
- package/dist/preview-next/editor-base.css +2 -2
- package/dist/preview-next/keepAlive.mjs +3 -3
- package/dist/preview-next/middleware.mjs +7 -3
- package/dist/preview-next/{refresh-contract-CvmNqZ1Q.mjs → refresh-contract-uQ6BXgLJ.mjs} +5 -0
- package/dist/preview-next/{route-contract-8csADeIT.mjs → route-contract-CkrFDMrl.mjs} +434 -203
- 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-D1_gonwM.mjs → Block.shared-DxvNGDig.mjs} +4 -4
- package/dist/server/{bindings-CFmJg5lm.mjs → bindings-BuhKvYkE.mjs} +2 -1
- package/dist/server/{client-DPsi0Dai.mjs → client-BobW6DOz.mjs} +39 -72
- package/dist/server/config-validation.mjs +1 -1
- package/dist/server/config.mjs +2 -2
- package/dist/server/{siteChromeOverlayClearance-DALIAMwo.mjs → effectiveNavLinkStyle-B-MKSt0p.mjs} +2060 -1680
- package/dist/server/index.mjs +3 -3
- package/dist/server/{loadContent-RMCcuVU_.mjs → loadContent-CCG_3mbY.mjs} +14 -5
- package/dist/server/loadPage-Bk9HDh9K.mjs +2 -0
- package/dist/server/{loadPage-DhDGzj7t.mjs → loadPage-jntGoMrf.mjs} +3 -2
- package/dist/server/next.mjs +9 -9
- package/dist/server/{overrideResolution-OxY5FMuy.mjs → overrideResolution-BBOlgn4Z.mjs} +1 -1
- package/dist/server/{overrides-Bz_A6sB9.mjs → overrides-DByQwIyW.mjs} +803 -412
- package/dist/server/page-converter.mjs +1 -1
- package/dist/server/{prebuild-B_1vrSru.mjs → prebuild-DrwcTk2t.mjs} +1 -1
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/{prefetchBlockData-B7ukYXXR.mjs → prefetchBlockData-LfgxSJYE.mjs} +156 -89
- package/dist/server/{publicProducts-Djbpc81A.mjs → publicProducts-8A3T5v4M.mjs} +685 -166
- package/dist/server/{registry-eFjKtEhF.mjs → registry-Digv02oV.mjs} +780 -1052
- package/dist/server/rendering/server.mjs +4 -4
- package/dist/server/rendering.mjs +8 -8
- package/dist/server/{resolveBlockData-DYvEa9c5.mjs → resolveBlockData-C23t8-77.mjs} +1 -1
- package/dist/server/routing.mjs +1 -1
- package/dist/server/{schema-C3dJ5UkL.mjs → schema-BiqpDRwB.mjs} +4805 -3561
- package/dist/server/server.mjs +3 -3
- package/dist/server/site-styles-DrkprQPL.mjs +755 -0
- package/dist/server/siteChromeOverlayClearance-BmKKkkbh.mjs +750 -0
- package/dist/server/{src-C5Mu-z0F.mjs → src-08GY1njw.mjs} +1060 -44
- package/dist/server/theme-bridge.mjs +1 -1
- package/dist/server/theme.mjs +1 -1
- package/dist/server/{themeAdmission-ruoyXb_0.mjs → themeAdmission-CSd_Vusz.mjs} +151 -53
- package/dist/server/{validation-B-Xar8QS.mjs → validation-DdUTkBOZ.mjs} +2 -2
- package/dist/server/{version-Bg7VHK3i.mjs → version-DdIOqIDe.mjs} +1 -1
- package/dist/styles/index.css +1029 -41
- package/package.json +1 -1
- package/dist/_dts/index-Blwl7yl6.d.ts +0 -13
- package/dist/client/LeafletStaticMap-ClZCCzAm.mjs +0 -135
- package/dist/client/location-map.client-Cylb_MHw.mjs +0 -28
- package/dist/client/location-map.view-Cx4Bl7ij.mjs +0 -345
- package/dist/client/locationMap-QnKJi-nZ.mjs +0 -15
- package/dist/client/renderableMediaAssetAdmission-DGjBr_e-.mjs +0 -152
- package/dist/client/wizardSteps-zgq10lN1.mjs +0 -17181
- package/dist/preview-next/client/siteStyleAccess-QZkJRHl5.mjs +0 -1359
- package/dist/server/loadPage-DUPP51C-.mjs +0 -2
- package/dist/server/media-CcHwZkdJ.mjs +0 -243
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { Ir as makeBoundaryId, K as corners, Qn as paletteModeSchema, Qt as resolveSurface, Tr as assertNever$1, U as parseThemeForPersistence, Zn as paletteColorsSchema, _r as asDesignBlockId, cr as indexRenderableMediaAssets, kn as defaultThemeTokens, or as buildRenderableMediaAssetIndex, sn as textColorStyle, sr as renderableMediaAssetSchema$1, vt as stripStaleTransitionStyleGroup, wr as asSiteStyleId, xn as expandPalette } from "./ThemedButton-DzeycIlD.mjs";
|
|
3
2
|
import { i as useOptionalPreviewLayout, t as PreviewQueryProvider } from "./PreviewQueryProvider-BC0V7iAR.mjs";
|
|
4
|
-
import {
|
|
5
|
-
import { a as
|
|
6
|
-
import {
|
|
3
|
+
import { Ar as assertNever$1, Cr as asDesignBlockId, Hr as makeBoundaryId, Ln as defaultThemeTokens, U as parseThemeForPersistence, cn as parseResolvedSurface, dn as resolveSurface, dr as buildRenderableMediaAssetIndex, fr as renderableMediaAssetSchema$1, kn as expandPalette, kr as asSiteStyleId, ln as parseSurfaceTree, nn as textColorStyle, pr as indexRenderableMediaAssets, vt as stripStaleTransitionStyleGroup } from "./ThemedButton-CHKOWXxl.mjs";
|
|
4
|
+
import { $i as applyCompiledRuntimeFieldsToContent, $o as Dialog, $r as coerceLinkedContentEntriesPayload, $t as unsafeAsLinkedContentEntryId, Ai as readBlockComposition, B as useRetentionTicks, Bi as parseBlockIconValue, Bn as ImageResolveContextProvider, Bo as CalloutDescription, Br as logger, Bs as sameMailingListPlacementTargeting, Bt as useEditorUiStore, Ca as resolveModeArrangement, Cn as DEFAULT_LAUNCH_READINESS_INPUT, Cr as buildThemeRuntime, Di as defineFragment, Do as siblingPath, Dr as projectRecurringSchedule, Ea as componentRuntimeRulesForTheme, Ei as runTransforms, En as MediaEditorContextProvider, Eo as getAtPath, Er as getDefaultComponentRegistry, Fa as surfaceResolutionContextFromTheme, Fi as pageTemplateFromEntry, Fr as OFFERINGS_PREVIEW_EVENT_PRESET_DEFINITIONS, G as EditorWriteSurface, Gi as isInlineTextEmpty, Gr as publicEventsArraySchema, Gs as parseEditLeaseScope, Hi as parseGeneratedIconSetId, Hr as RichText$1, Hs as readEditorBlockVersionsFromPlacement, Ht as useOptionalEditorUiStoreInstance, I as createEditorApiClientFactory, Ii as unavailableReadinessFact, In as API_ENDPOINTS, Ir as offeringsListingFor, Jr as resolvePageRouteTarget, Jt as remoteDraftValues, Ki as plainTextToInlineText, Kr as bookingConsentCarrierSchema, Kt as activeLinkedSaveHandover, Li as isRichTextDoc, Ls as buildMailingListSignupBlockSourceRef, Ma as headerStyleRecipeForTheme, Mi as resolveDateRuntimeContext, Mr as normalizeLocationMapSource, Mt as createSnapshotFromPageRecord, Ni as admitReadinessFacts, Nr as resolveLocationMapLocation, Oa as designRuntimeRulesForTheme, Oi as arrangementHooksFromContent, On as useApiMediaUploader, Or as chosenString, Pi as loadedReadinessFact, Pr as buildAppointmentServicesView, Ps as cn, Qn as ThemeScope, Qo as TabsTrigger, Qr as LINKED_CONTENT_ENTRY_META_KEY, Ri as isObjectRecord, Rn as unwrapResponse, Rs as parseFooterModuleId, Sa as resolveEffectiveArrangement, Sn as decodePublicProductCategorySelectorQuery, Sr as resolveArrangementKnobs, Ta as deriveSiteStyleBlockPolicy, Ti as bodyCopyFragment, Tr as mergeContentWithBlockStyleOverrides, U as EditLeaseDiscardedNotice, Ui as coerceInlineTextWithFallback, Ur as defaultTransforms, Us as readPublishedBlockPlacement, V as VIEWING_PARTICIPATION, Vi as parseGeneratedIconAssetId, Vn as BlockApiProvider, Vr as Text$1, Vs as NO_BLOCK_VERSIONS, Vt as useEditorUiStoreInstance, W as EditLeaseModal, Wi as inlineTextToPlainText, Wr as calendarWindowQuerySchema, Ws as selectedContentVersionId, Xi as applyPageOpeningForegroundToTheme, Xo as TabsContent, Xs as unsafeAsEditorBlockId, Xt as renderedFieldChanges, Yo as Tabs, Yr as resolveRouteTarget, Yt as renderSourceFor, Zn as isSupportedLoaderEndpoint, Zo as TabsList, Zr as formatDate, Zt as resolveRenderedValues, _i as ctaCopyFragment, _o as heroPhotoPaintsGround, _t as EditorProvider, a as usePreviewAuth, ai as setContextResolveImageUrlContext, ar as getBlockDefinition, ba as arrangementManifestFromVariants, bi as heroCopyFragment, bo as resolveSectionBackground, c as SessionJournalHost, ci as cardFragment, co as boundaryLayout, cr as publicRouteCandidatesSchema, di as blogFeaturedPostFragment, ea as compileEditorModelRuntime, ei as getLinkedContentEntryMeta, es as DialogContent, f as PreviewRichTextEditor, fi as singleButtonFragment, fo as defaultSectionTransitionVariantForFamily, fr as parseStoredVariant, ga as arrangementSlotNames, gi as testimonialsHeadingFragment, go as deriveSectionGround, h as PREVIEW_EDITABLE_OUTLINE, hi as testimonialsCarouselFragment, ho as sectionTransitionVariantForBoundaryOptionId, i as renewPreviewSession, ii as getCurrentResolveImageUrlContext, io as formatSiteChromeBackgroundTokenLabel, ir as resolveBlockVariantKey, is as DialogTitle, ji as readRuntimeNow, jr as buildLoadedOfferingsPreviewListing, js as Button, jt as createRoutingHelpers, ki as blockLookFromContent, kn as ApiRequestError, li as faqAccordionFragment, lo as composeBoundary, lr as SITE_CHROME_VISIBLE_HEADER_SELECTOR, m as PreviewTextEditor, mi as formCopyFragment, mo as sectionTransitionFamilyForBoundaryOptionId, mr as validateManifestDraft, n as initPreviewAuth, nc as toUtcIsoDateTimeString, nn as baselineRevisionOf, nr as createCustomBlockRegistry, ns as DialogFooter, o as usePreviewToken, oi as richTextFragment, on as canEditorWrite, or as normalizeBlockContent, p as PreviewInlineTextEditor, pi as formEmbedFragment, po as sectionTransitionFamilies, pr as compileManifestContentContract, qi as bindingSchema, qr as resolveEntryRouteTarget, qt as planLinkedSaveHandoverRetention, r as registerPreviewRenewalFetcher, rc as assertNever$2, ri as buildResolveImageUrlContext, rn as isEdited, rr as makeDefaultBlockComponent, rs as DialogHeader, s as SiteAdmissionObserver, si as headingFragment, sr as offeringsPreviewBlockDefinition, t as createGuardedPreviewApiClient, tn as editorAdmissionNotice, tr as resolveSdkFooterMode, ts as DialogDescription, u as renderSiteChromeBlock, ui as faqHeadingFragment, uo as sectionFactsForContent, v as EditableBlockProvider, va as resolveItemSurface, vi as heroCtaRowFragment, vo as parseCanonicalRuntimeBackground, vr as systemCustomizeFacetDefinitionsForBlock, vt as useEditor, wa as resolvePublishedLook, wi as ctaButton, wn as deriveLaunchReadiness, x as useEntryEditorController, xa as readStoredMode, xn as blocksKeys, y as EntryControllerProvider, ya as resolveLookSlotSurfaces, yi as ctaRowFragment, yo as resolveCompiledSectionForegroundFromContent, z as createPageSurfaceEditorServices, zi as isRecord$7, zn as clientComponentRegistry, zo as Callout, zr as renderInlineText, zs as parseMailingListPlacementTargeting } from "./previewAuthStore-C0VUwEHz.mjs";
|
|
5
|
+
import { Ft as parseLocationValue, H as GripVertical, It as projectPublicLocation, Lt as publicLocationSchema, _ as RotateCcw, kt as decideLocationSourcePermission, lt as ChevronRight, n as X, ut as ChevronLeft } from "./lucide-react-CA9cpo0P.mjs";
|
|
6
|
+
import { $ as useBlockCustomizeControls, Bt as planSiteDocument, C as usePreviewThemeOverlay, Dt as CustomizeBackgroundColorPicker, Ht as Toaster, Ot as PreviewBlockCustomizeSelectionProvider, Rt as SITE_CHROME_CLASS_NAMES, S as PreviewThemeOverlayProvider, Vt as ResponsiveScope, _ as SiteChromeCustomizeProvider, a as sanitizeDashboardPath, b as PreviewDesignCoordinatorProvider, bt as lookTilePosition, ct as usePreviewPageDesignEditorState, h as SiteFontStorageProvider, ht as pageDesignLookPosition, i as resolvePreviewDashboardSetupHandoff, it as LookCyclePill, kt as usePreviewBlockCustomizeSelectionOptional, mt as cyclePageDesignBlockLook, n as resolveSiteStyleAccess, nt as ArrangementModeSwitchPill, ot as useArrangementToolbar, pt as CustomizeBackgroundControlRows, r as buildPreviewDashboardSetupUrl, s as resolvePreviewSetupBannerModel, st as PreviewPageDesignEditorStateProvider, t as canInspectSiteStyle, tt as ArrangementLookPill, v as useSiteChromeCustomizeOptional, yt as lookPositionLabel, zt as SiteDocumentLayout } from "./siteStyleAccess-DHyzUpv4.mjs";
|
|
7
|
+
import { n as LocationPickerEnvironmentProvider } from "./LocationPickerEnvironment-QtSG2Bl-.mjs";
|
|
8
|
+
import { a as resolvePreviewChromeSurface, i as getPreviewChromeSurfaceDataProps, n as PREVIEW_CHROME_THEME_CLASS_NAME, o as PREVIEW_KEEP_ALIVE_INTERVAL_MS, s as PREVIEW_KEEP_ALIVE_JITTER_RATIO, u as FixedBottomSurface } from "./previewChromeSurface-Dhyx2YrS.mjs";
|
|
7
9
|
import * as React$1 from "react";
|
|
8
10
|
import React, { Children, Fragment, cloneElement, createContext, isValidElement, useCallback, useContext, useEffect, useId, useLayoutEffect, useMemo, useReducer, useRef, useState, useSyncExternalStore } from "react";
|
|
9
11
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -136,6 +138,75 @@ function ResizableSplitPane({ left, right, defaultSplit = 40, minLeftWidth = 300
|
|
|
136
138
|
});
|
|
137
139
|
}
|
|
138
140
|
//#endregion
|
|
141
|
+
//#region ../ui/src/toast.tsx
|
|
142
|
+
function ToastProvider() {
|
|
143
|
+
return /* @__PURE__ */ jsx(Toaster, {
|
|
144
|
+
position: "bottom-right",
|
|
145
|
+
offset: {
|
|
146
|
+
right: "calc(var(--assistant-dock-inset, 0px) + 24px)",
|
|
147
|
+
bottom: "24px"
|
|
148
|
+
},
|
|
149
|
+
richColors: false,
|
|
150
|
+
className: "rb-sonner-toaster",
|
|
151
|
+
toastOptions: { classNames: {
|
|
152
|
+
toast: "rb-sonner-toast",
|
|
153
|
+
success: "rb-sonner-toast-success",
|
|
154
|
+
info: "rb-sonner-toast-info",
|
|
155
|
+
error: "rb-sonner-toast-error"
|
|
156
|
+
} }
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
//#endregion
|
|
160
|
+
//#region ../blocks/src/pageRenderAudience.tsx
|
|
161
|
+
/**
|
|
162
|
+
* The single policy for what a non-renderable block looks like.
|
|
163
|
+
*
|
|
164
|
+
* Public visitors never see renderer diagnostics, so every reason omits.
|
|
165
|
+
* Authoring surfaces keep the wording they have always had — the strings below
|
|
166
|
+
* are moved verbatim from the five former `fallback()` call sites.
|
|
167
|
+
*/
|
|
168
|
+
function presentNotRenderableBlock(reason, audience) {
|
|
169
|
+
if (audience === "public") return null;
|
|
170
|
+
if (reason.kind === "hidden-business-location" && reason.businessDetailsHref) return diagnostic(/* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
171
|
+
authoringMessage(reason),
|
|
172
|
+
" ",
|
|
173
|
+
/* @__PURE__ */ jsx("a", {
|
|
174
|
+
href: reason.businessDetailsHref,
|
|
175
|
+
children: "Open Business details"
|
|
176
|
+
})
|
|
177
|
+
] }));
|
|
178
|
+
return diagnostic(authoringMessage(reason));
|
|
179
|
+
}
|
|
180
|
+
function authoringMessage(reason) {
|
|
181
|
+
switch (reason.kind) {
|
|
182
|
+
case "invalid-admission": return `Invalid content for block kind "${reason.blockKind}".`;
|
|
183
|
+
case "missing-definition": return reason.isCustom ? `No renderer available for block kind "${reason.blockKind}". The custom block definition was not found (missing manifest).` : `No renderer available for block kind "${reason.blockKind}".`;
|
|
184
|
+
case "missing-layout": return reason.isCustom ? `No renderer available for block kind "${reason.blockKind}". This custom block has no layout/variants, so it must be rendered via blockOverrides["${reason.blockKind}"].` : `No renderer available for block kind "${reason.blockKind}".`;
|
|
185
|
+
case "hidden-business-location": return "This map is hidden because your business address is hidden.";
|
|
186
|
+
case "unresolved-location":
|
|
187
|
+
if (reason.source === "business_address") return "Business address details are not configured yet.";
|
|
188
|
+
return reason.source === "venue" ? "This map is hidden on your site until the venue has a location." : "This map is hidden on your site until you choose a place.";
|
|
189
|
+
case "editor-unpreviewable":
|
|
190
|
+
case "render-threw": return `Unable to render block kind "${reason.blockKind}".`;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* The empty-page notice. Authoring-only for the same reason as the block
|
|
195
|
+
* diagnostics: "No blocks found." is a message for whoever is building the
|
|
196
|
+
* page, not for whoever is reading it.
|
|
197
|
+
*/
|
|
198
|
+
function presentEmptyPage(audience) {
|
|
199
|
+
if (audience === "public") return null;
|
|
200
|
+
return diagnostic("No blocks found.");
|
|
201
|
+
}
|
|
202
|
+
function diagnostic(message) {
|
|
203
|
+
return /* @__PURE__ */ jsx("div", {
|
|
204
|
+
className: "rb-p-6 rb-caption",
|
|
205
|
+
style: textColorStyle("mutedText"),
|
|
206
|
+
children: message
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
//#endregion
|
|
139
210
|
//#region ../blocks/src/system/fragments/library/headerCta.ts
|
|
140
211
|
const headerCtaFragment = defineFragment({
|
|
141
212
|
variantMeaning: { kind: "arrangement" },
|
|
@@ -524,27 +595,33 @@ function pageBlockPosition(index, blockCount) {
|
|
|
524
595
|
//#endregion
|
|
525
596
|
//#region ../blocks/src/pageRendererContracts.ts
|
|
526
597
|
function buildPageRendererRootRuntime(dataContext) {
|
|
527
|
-
const { siteId = null, siteName, pageId = null, pathname = null,
|
|
598
|
+
const { siteId = null, siteName, pageId = null, pathname = null, previewStage = "published", apiBaseUrl = null, portalToken = null, readAuthority, openingHours, siteTerms, mailingList = { tag: "not_configured" }, loaderFailures = {} } = dataContext ?? {};
|
|
528
599
|
return {
|
|
529
600
|
siteId,
|
|
530
601
|
demoEmailSuppressed: resolveDemoEmailSuppression(dataContext),
|
|
531
602
|
siteName,
|
|
603
|
+
site: publicLocationRuntime(dataContext),
|
|
532
604
|
pageId,
|
|
533
605
|
pathname,
|
|
534
|
-
|
|
606
|
+
...pageBookingRuntime(dataContext),
|
|
535
607
|
...pageRuntimeContext(dataContext),
|
|
536
608
|
previewStage,
|
|
537
609
|
apiBaseUrl,
|
|
538
610
|
portalToken,
|
|
539
611
|
readAuthority,
|
|
540
|
-
bookingOfferingPresets,
|
|
541
|
-
appointmentServicePathPrefix,
|
|
542
612
|
openingHours,
|
|
543
613
|
siteTerms,
|
|
544
614
|
mailingList,
|
|
545
615
|
loaderFailures
|
|
546
616
|
};
|
|
547
617
|
}
|
|
618
|
+
function publicLocationRuntime(context) {
|
|
619
|
+
return {
|
|
620
|
+
businessAddress: context?.businessLocation ?? null,
|
|
621
|
+
venuesById: context?.venuesById ?? {},
|
|
622
|
+
siteCountry: context?.siteCountry ?? null
|
|
623
|
+
};
|
|
624
|
+
}
|
|
548
625
|
function resolveDemoEmailSuppression(dataContext) {
|
|
549
626
|
return dataContext?.demoEmailSuppressed === true;
|
|
550
627
|
}
|
|
@@ -558,43 +635,14 @@ function pageRuntimeContext(dataContext) {
|
|
|
558
635
|
function pageDateRuntimeContext(dataContext) {
|
|
559
636
|
return dataContext?.dateContext ?? resolveDateRuntimeContext(dataContext?.bookingTimeZone);
|
|
560
637
|
}
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
*/
|
|
570
|
-
function presentNotRenderableBlock(reason, audience) {
|
|
571
|
-
if (audience === "public") return null;
|
|
572
|
-
return diagnostic(authoringMessage(reason));
|
|
573
|
-
}
|
|
574
|
-
function authoringMessage(reason) {
|
|
575
|
-
switch (reason.kind) {
|
|
576
|
-
case "invalid-admission": return `Invalid content for block kind "${reason.blockKind}".`;
|
|
577
|
-
case "missing-definition": return reason.isCustom ? `No renderer available for block kind "${reason.blockKind}". The custom block definition was not found (missing manifest).` : `No renderer available for block kind "${reason.blockKind}".`;
|
|
578
|
-
case "missing-layout": return reason.isCustom ? `No renderer available for block kind "${reason.blockKind}". This custom block has no layout/variants, so it must be rendered via blockOverrides["${reason.blockKind}"].` : `No renderer available for block kind "${reason.blockKind}".`;
|
|
579
|
-
case "editor-unpreviewable":
|
|
580
|
-
case "render-threw": return `Unable to render block kind "${reason.blockKind}".`;
|
|
581
|
-
}
|
|
582
|
-
}
|
|
583
|
-
/**
|
|
584
|
-
* The empty-page notice. Authoring-only for the same reason as the block
|
|
585
|
-
* diagnostics: "No blocks found." is a message for whoever is building the
|
|
586
|
-
* page, not for whoever is reading it.
|
|
587
|
-
*/
|
|
588
|
-
function presentEmptyPage(audience) {
|
|
589
|
-
if (audience === "public") return null;
|
|
590
|
-
return diagnostic("No blocks found.");
|
|
591
|
-
}
|
|
592
|
-
function diagnostic(message) {
|
|
593
|
-
return /* @__PURE__ */ jsx("div", {
|
|
594
|
-
className: "rb-p-6 rb-caption",
|
|
595
|
-
style: textColorStyle("mutedText"),
|
|
596
|
-
children: message
|
|
597
|
-
});
|
|
638
|
+
/** Booking context keeps its defaults together across SSR and authoring. */
|
|
639
|
+
function pageBookingRuntime(context) {
|
|
640
|
+
const { bookingTimeZone, bookingOfferingPresets = [], appointmentServicePathPrefix = null } = context ?? {};
|
|
641
|
+
return {
|
|
642
|
+
bookingTimeZone,
|
|
643
|
+
bookingOfferingPresets,
|
|
644
|
+
appointmentServicePathPrefix
|
|
645
|
+
};
|
|
598
646
|
}
|
|
599
647
|
//#endregion
|
|
600
648
|
//#region ../blocks/src/pageRenderDiagnostics.ts
|
|
@@ -868,12 +916,31 @@ function getRenderableContent(block, previewStage = "published") {
|
|
|
868
916
|
return selectBlockContent(block, previewStage);
|
|
869
917
|
}
|
|
870
918
|
function arrangementRuntime(content) {
|
|
871
|
-
const value = content._arrangementLooks;
|
|
872
|
-
return isObjectRecord(value) && isObjectRecord(value.byMode) && Array.isArray(value.available) && Array.isArray(value.rhythm) ? value : null;
|
|
919
|
+
const value = parseSurfaceTree(content._arrangementLooks);
|
|
920
|
+
return isObjectRecord(value) && isObjectRecord(value.byMode) && Array.isArray(value.available) && Array.isArray(value.rhythm) ? restoreArrangementRuntime(value) : null;
|
|
921
|
+
}
|
|
922
|
+
/** JSON transports carry resolver inputs; rebuild every surface at this boundary. */
|
|
923
|
+
function restoreCompiledLook(look) {
|
|
924
|
+
return {
|
|
925
|
+
...look,
|
|
926
|
+
itemSurfaces: Object.fromEntries(Object.entries(look.itemSurfaces).map(([slot, surface]) => [slot, parseResolvedSurface(surface)])),
|
|
927
|
+
...look.roleSurfaces ? { roleSurfaces: {
|
|
928
|
+
card: parseResolvedSurface(look.roleSurfaces.card),
|
|
929
|
+
statement: parseResolvedSurface(look.roleSurfaces.statement),
|
|
930
|
+
highlight: parseResolvedSurface(look.roleSurfaces.highlight)
|
|
931
|
+
} } : {}
|
|
932
|
+
};
|
|
933
|
+
}
|
|
934
|
+
function restoreArrangementRuntime(runtime) {
|
|
935
|
+
return {
|
|
936
|
+
...runtime,
|
|
937
|
+
available: runtime.available.map(restoreCompiledLook),
|
|
938
|
+
byMode: Object.fromEntries(Object.entries(runtime.byMode).map(([mode, look]) => [mode, restoreCompiledLook(look)]))
|
|
939
|
+
};
|
|
873
940
|
}
|
|
874
941
|
function effectiveLookFromContent(content) {
|
|
875
942
|
const value = content._effectiveLook;
|
|
876
|
-
return isObjectRecord(value) && isObjectRecord(value.look) ? value : null;
|
|
943
|
+
return isObjectRecord(value) && isObjectRecord(value.look) ? restoreCompiledLook(value) : null;
|
|
877
944
|
}
|
|
878
945
|
function planArrangementContent(blockKind, manifest, content, audience) {
|
|
879
946
|
const runtime = arrangementRuntime(content);
|
|
@@ -908,6 +975,7 @@ function planArrangementContent(blockKind, manifest, content, audience) {
|
|
|
908
975
|
});
|
|
909
976
|
return {
|
|
910
977
|
...activeContent,
|
|
978
|
+
...mode !== null ? { variant: mode } : {},
|
|
911
979
|
...effectiveContent,
|
|
912
980
|
...photoContent,
|
|
913
981
|
...arrangementShapeContent(effective.look.id, {
|
|
@@ -916,6 +984,7 @@ function planArrangementContent(blockKind, manifest, content, audience) {
|
|
|
916
984
|
}),
|
|
917
985
|
...arrangementPanelContent(activeContent, effective, mode),
|
|
918
986
|
...arrangementQuoteContent(blockKind, effective, values),
|
|
987
|
+
_arrangementLooks: runtime,
|
|
919
988
|
_effectiveLook: effective,
|
|
920
989
|
_lookHooks: arrangementContentHooks(effective, mode, length, {
|
|
921
990
|
...facts,
|
|
@@ -975,7 +1044,8 @@ function arrangementContentFacts(content) {
|
|
|
975
1044
|
facts: Array.isArray(content.facts) && content.facts.length > 0,
|
|
976
1045
|
featured,
|
|
977
1046
|
outcome: typeof content.outcome === "string" && content.outcome.length > 0,
|
|
978
|
-
figure: typeof content.figure === "string" && content.figure.trim().length > 0
|
|
1047
|
+
figure: typeof content.figure === "string" && content.figure.trim().length > 0,
|
|
1048
|
+
entrance: isObjectRecord(content.entrancePhoto)
|
|
979
1049
|
}
|
|
980
1050
|
};
|
|
981
1051
|
}
|
|
@@ -984,7 +1054,7 @@ function arrangementPhotoCount(content) {
|
|
|
984
1054
|
if (Array.isArray(content.cards)) return content.cards.filter((card) => isObjectRecord(card) && isObjectRecord(card.media)).length;
|
|
985
1055
|
if (Array.isArray(content.members)) return content.members.filter((member) => isObjectRecord(member) && isObjectRecord(member.photo)).length;
|
|
986
1056
|
if (Array.isArray(content.images)) return content.images.filter((item) => isObjectRecord(item) && isObjectRecord(item.image)).length;
|
|
987
|
-
if (isObjectRecord(content.media)) return 1;
|
|
1057
|
+
if (isObjectRecord(content.media) || isObjectRecord(content.entrancePhoto)) return 1;
|
|
988
1058
|
const section = isObjectRecord(content._sectionStyles) ? content._sectionStyles : {};
|
|
989
1059
|
return isObjectRecord((isObjectRecord(section.background) ? section.background : {}).image) ? 1 : 0;
|
|
990
1060
|
}
|
|
@@ -1407,15 +1477,44 @@ function preparePageRender(input) {
|
|
|
1407
1477
|
mailingList: input.dataContext?.mailingList,
|
|
1408
1478
|
template: input.dataContext?.template ?? pageTemplateFromEntry(input.dataContext?.contentEntry)
|
|
1409
1479
|
});
|
|
1410
|
-
const
|
|
1411
|
-
const
|
|
1412
|
-
const
|
|
1480
|
+
const permission = input.dataContext?.businessLocationPermission ?? decideLocationSourcePermission("business_address", input.dataContext?.businessAddressVisibility);
|
|
1481
|
+
const entries = input.plan.entries.filter((entry) => input.audience === "authoring" || !entryNeedsSetup(entry, facts)).filter((entry) => isPublicSourcePermitted(entry, permission) || input.audience === "authoring" && permission.kind === "hidden").map((entry) => preparedPlanEntry(entry, prepareSourceEntry(entry, input, permission)));
|
|
1482
|
+
const constructionFailures = entries.filter((candidate) => candidate.prepared.kind === "render-threw").map((candidate) => candidate.entry);
|
|
1483
|
+
const survivors = input.audience === "authoring" ? entries : entries.filter((candidate) => candidate.prepared.kind !== "render-threw" && candidate.prepared.kind !== "unresolved-location");
|
|
1413
1484
|
return {
|
|
1414
1485
|
entries: survivors,
|
|
1415
1486
|
constructionFailures,
|
|
1416
1487
|
joins: composeSurvivorJoins(input.plan, survivors, input.themeResources)
|
|
1417
1488
|
};
|
|
1418
1489
|
}
|
|
1490
|
+
/** Source availability is decided before constructing the block or its hydration props. */
|
|
1491
|
+
function prepareSourceEntry(entry, input, permission) {
|
|
1492
|
+
if (!isPublicSourcePermitted(entry, permission)) return {
|
|
1493
|
+
kind: "hidden-business-location",
|
|
1494
|
+
businessDetailsHref: input.dataContext?.authoringBusinessDetailsHref ?? null
|
|
1495
|
+
};
|
|
1496
|
+
if (entry.block.kind === "block.location-map") {
|
|
1497
|
+
const content = entry.renderableContent;
|
|
1498
|
+
const resolved = resolveLocationMapLocation({
|
|
1499
|
+
location: content.location,
|
|
1500
|
+
locationSource: typeof content.locationSource === "string" ? content.locationSource : null,
|
|
1501
|
+
venueId: typeof content.venueId === "string" ? content.venueId : null,
|
|
1502
|
+
businessAddress: input.dataContext?.businessLocation,
|
|
1503
|
+
venuesById: input.dataContext?.venuesById
|
|
1504
|
+
});
|
|
1505
|
+
if (resolved.kind === "unresolved") return {
|
|
1506
|
+
kind: "unresolved-location",
|
|
1507
|
+
source: resolved.source
|
|
1508
|
+
};
|
|
1509
|
+
}
|
|
1510
|
+
return prepareEntry(entry, input);
|
|
1511
|
+
}
|
|
1512
|
+
/** No source data, override component or wrapper is touched for a hidden map. */
|
|
1513
|
+
function isPublicSourcePermitted(entry, permission) {
|
|
1514
|
+
if (entry.block.kind !== "block.location-map") return true;
|
|
1515
|
+
const rawSource = entry.renderableContent.locationSource;
|
|
1516
|
+
return normalizeLocationMapSource(typeof rawSource === "string" ? rawSource : null) !== "business_address" || permission.kind === "permitted";
|
|
1517
|
+
}
|
|
1419
1518
|
/**
|
|
1420
1519
|
* The only place joins are composed. Plan-time omissions were already
|
|
1421
1520
|
* re-pointed by the plan; construction failures are re-pointed here by the
|
|
@@ -1996,6 +2095,64 @@ function renderSystemBlockElement(input) {
|
|
|
1996
2095
|
previewAuthoring: input.previewAuthoring
|
|
1997
2096
|
});
|
|
1998
2097
|
}
|
|
2098
|
+
/** Pure diagnostic choice; the audience owner controls its presentation. */
|
|
2099
|
+
function preparationDiagnostic(prepared, blockKind) {
|
|
2100
|
+
switch (prepared.kind) {
|
|
2101
|
+
case "hidden-business-location": return {
|
|
2102
|
+
reason: {
|
|
2103
|
+
kind: prepared.kind,
|
|
2104
|
+
blockKind,
|
|
2105
|
+
businessDetailsHref: prepared.businessDetailsHref
|
|
2106
|
+
},
|
|
2107
|
+
outcome: "invalidPlaceholder"
|
|
2108
|
+
};
|
|
2109
|
+
case "unresolved-location": return {
|
|
2110
|
+
reason: {
|
|
2111
|
+
kind: prepared.kind,
|
|
2112
|
+
blockKind,
|
|
2113
|
+
source: prepared.source
|
|
2114
|
+
},
|
|
2115
|
+
outcome: "invalidPlaceholder"
|
|
2116
|
+
};
|
|
2117
|
+
case "editor-unpreviewable": return {
|
|
2118
|
+
reason: {
|
|
2119
|
+
kind: prepared.kind,
|
|
2120
|
+
blockKind
|
|
2121
|
+
},
|
|
2122
|
+
outcome: "invalidPlaceholder"
|
|
2123
|
+
};
|
|
2124
|
+
case "render-threw": return {
|
|
2125
|
+
reason: {
|
|
2126
|
+
kind: prepared.kind,
|
|
2127
|
+
blockKind
|
|
2128
|
+
},
|
|
2129
|
+
outcome: "exception"
|
|
2130
|
+
};
|
|
2131
|
+
case "content":
|
|
2132
|
+
case "plan-decided": return null;
|
|
2133
|
+
}
|
|
2134
|
+
}
|
|
2135
|
+
function blockRenderPerformanceMeta(meta) {
|
|
2136
|
+
return {
|
|
2137
|
+
outcome: meta?.outcome ?? "ok",
|
|
2138
|
+
override: meta?.override ?? false,
|
|
2139
|
+
hasResolvedData: meta?.hasResolvedData ?? false
|
|
2140
|
+
};
|
|
2141
|
+
}
|
|
2142
|
+
function finishBlockRender(node, block, perfStart, meta) {
|
|
2143
|
+
if (!perfStart) return node;
|
|
2144
|
+
const durationMs = Date.now() - perfStart;
|
|
2145
|
+
if (durationMs < getPerfSlowBlockRenderThresholdMs()) return node;
|
|
2146
|
+
try {
|
|
2147
|
+
console.debug("perf.blocks.blockRender", {
|
|
2148
|
+
blockId: block.id ?? null,
|
|
2149
|
+
blockKind: block.kind,
|
|
2150
|
+
durationMs,
|
|
2151
|
+
...blockRenderPerformanceMeta(meta)
|
|
2152
|
+
});
|
|
2153
|
+
} catch {}
|
|
2154
|
+
return node;
|
|
2155
|
+
}
|
|
1999
2156
|
/**
|
|
2000
2157
|
* Memoized block section component.
|
|
2001
2158
|
*
|
|
@@ -2008,22 +2165,7 @@ const MemoBlockSection = React$1.memo(function MemoBlockSection({ themeResources
|
|
|
2008
2165
|
const block = entry.block;
|
|
2009
2166
|
const perfStart = globalThis.process?.env?.DEBUG_PERF === "1" && typeof window === "undefined" ? Date.now() : 0;
|
|
2010
2167
|
const resolvedImageResolveContext = imageResolveContext ?? getCurrentResolveImageUrlContext();
|
|
2011
|
-
|
|
2012
|
-
if (!perfStart) return node;
|
|
2013
|
-
const durationMs = Date.now() - perfStart;
|
|
2014
|
-
if (durationMs < getPerfSlowBlockRenderThresholdMs()) return node;
|
|
2015
|
-
try {
|
|
2016
|
-
console.debug("perf.blocks.blockRender", {
|
|
2017
|
-
blockId: block.id ?? null,
|
|
2018
|
-
blockKind: block.kind,
|
|
2019
|
-
durationMs,
|
|
2020
|
-
outcome: meta?.outcome ?? "ok",
|
|
2021
|
-
override: meta?.override ?? false,
|
|
2022
|
-
hasResolvedData: meta?.hasResolvedData ?? false
|
|
2023
|
-
});
|
|
2024
|
-
} catch {}
|
|
2025
|
-
return node;
|
|
2026
|
-
}
|
|
2168
|
+
const finish = (node, meta) => finishBlockRender(node, block, perfStart, meta);
|
|
2027
2169
|
function wrapped(node) {
|
|
2028
2170
|
return wrapBlock && block.id ? /* @__PURE__ */ jsx(Fragment$1, { children: wrapBlock(block.id, node) }) : /* @__PURE__ */ jsx(Fragment$1, { children: node });
|
|
2029
2171
|
}
|
|
@@ -2039,6 +2181,11 @@ const MemoBlockSection = React$1.memo(function MemoBlockSection({ themeResources
|
|
|
2039
2181
|
override: false
|
|
2040
2182
|
});
|
|
2041
2183
|
}
|
|
2184
|
+
const diagnostic = preparationDiagnostic(prepared, block.kind);
|
|
2185
|
+
if (diagnostic) return finish(wrapped(presentNotRenderableBlock(diagnostic.reason, audience)), {
|
|
2186
|
+
outcome: diagnostic.outcome,
|
|
2187
|
+
override: false
|
|
2188
|
+
});
|
|
2042
2189
|
if (entry.kind === "override-only") {
|
|
2043
2190
|
const OverrideOnlyComponent = entry.override;
|
|
2044
2191
|
return finish(wrapped(/* @__PURE__ */ jsx(OverrideOnlyComponent, { ...buildBlockOverrideProps({
|
|
@@ -2055,20 +2202,7 @@ const MemoBlockSection = React$1.memo(function MemoBlockSection({ themeResources
|
|
|
2055
2202
|
hasResolvedData: false
|
|
2056
2203
|
});
|
|
2057
2204
|
}
|
|
2058
|
-
if (prepared.kind
|
|
2059
|
-
kind: "editor-unpreviewable",
|
|
2060
|
-
blockKind: block.kind
|
|
2061
|
-
}, audience)), {
|
|
2062
|
-
outcome: "invalidPlaceholder",
|
|
2063
|
-
override: false
|
|
2064
|
-
});
|
|
2065
|
-
if (prepared.kind !== "content") return finish(wrapped(presentNotRenderableBlock({
|
|
2066
|
-
kind: "render-threw",
|
|
2067
|
-
blockKind: block.kind
|
|
2068
|
-
}, audience)), {
|
|
2069
|
-
outcome: "exception",
|
|
2070
|
-
override: false
|
|
2071
|
-
});
|
|
2205
|
+
if (prepared.kind !== "content") return null;
|
|
2072
2206
|
let rendered;
|
|
2073
2207
|
if (OverrideComponent) rendered = /* @__PURE__ */ jsx(OverrideComponent, { ...prepared.baseProps });
|
|
2074
2208
|
else {
|
|
@@ -2134,214 +2268,6 @@ function usePageDateRuntime(props) {
|
|
|
2134
2268
|
};
|
|
2135
2269
|
}
|
|
2136
2270
|
//#endregion
|
|
2137
|
-
//#region ../theme-core/src/ResponsiveScope.tsx
|
|
2138
|
-
/**
|
|
2139
|
-
* Structural responsive root for SDK/runtime chrome that opts out of CMS theme
|
|
2140
|
-
* styling but still depends on scoped rb-* responsive utility classes.
|
|
2141
|
-
*/
|
|
2142
|
-
function ResponsiveScope({ children, responsiveMode = DEFAULT_THEME_RESPONSIVE_MODE, className }) {
|
|
2143
|
-
const responsiveScope = getResponsiveScopeSpec(responsiveMode);
|
|
2144
|
-
const isContainerResponsive = responsiveScope.kind === "container";
|
|
2145
|
-
const wrapperStyle = isContainerResponsive ? {
|
|
2146
|
-
containerType: "inline-size",
|
|
2147
|
-
containerName: responsiveScope.containerName
|
|
2148
|
-
} : {};
|
|
2149
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
2150
|
-
className: className ? `theme-scope ${className}` : "theme-scope",
|
|
2151
|
-
style: wrapperStyle,
|
|
2152
|
-
"data-rb-responsive-mode": responsiveScope.kind,
|
|
2153
|
-
children: [isContainerResponsive && /* @__PURE__ */ jsx("style", {
|
|
2154
|
-
"data-container-responsive-overrides": true,
|
|
2155
|
-
dangerouslySetInnerHTML: { __html: escapeStyleContent(containerResponsiveThemeCss) }
|
|
2156
|
-
}), children]
|
|
2157
|
-
});
|
|
2158
|
-
}
|
|
2159
|
-
z.object({
|
|
2160
|
-
tokens: z.record(z.string(), z.string()),
|
|
2161
|
-
typography: z.object({
|
|
2162
|
-
headingFamily: z.string().optional(),
|
|
2163
|
-
bodyFamily: z.string().optional(),
|
|
2164
|
-
headingWeight: z.number().optional(),
|
|
2165
|
-
bodyWeight: z.number().optional()
|
|
2166
|
-
}).optional(),
|
|
2167
|
-
spacing: z.enum([
|
|
2168
|
-
"comfortable",
|
|
2169
|
-
"standard",
|
|
2170
|
-
"dense"
|
|
2171
|
-
]).optional(),
|
|
2172
|
-
corners: z.enum([
|
|
2173
|
-
"square",
|
|
2174
|
-
"soft",
|
|
2175
|
-
"rounded",
|
|
2176
|
-
"pill"
|
|
2177
|
-
]).optional(),
|
|
2178
|
-
shadows: z.enum([
|
|
2179
|
-
"none",
|
|
2180
|
-
"low",
|
|
2181
|
-
"medium",
|
|
2182
|
-
"high"
|
|
2183
|
-
]).optional(),
|
|
2184
|
-
components: z.object({
|
|
2185
|
-
buttons: z.union([z.boolean(), z.object({ variants: z.array(z.enum([
|
|
2186
|
-
"primary",
|
|
2187
|
-
"secondary",
|
|
2188
|
-
"outline",
|
|
2189
|
-
"ghost"
|
|
2190
|
-
])).optional() })]).optional(),
|
|
2191
|
-
cards: z.union([z.boolean(), z.object({ variants: z.array(z.enum([
|
|
2192
|
-
"default",
|
|
2193
|
-
"alternative",
|
|
2194
|
-
"open",
|
|
2195
|
-
"elevated",
|
|
2196
|
-
"outlined"
|
|
2197
|
-
])).optional() })]).optional(),
|
|
2198
|
-
inputs: z.boolean().optional()
|
|
2199
|
-
}).optional(),
|
|
2200
|
-
overrides: z.record(z.string(), z.string()).optional()
|
|
2201
|
-
}).passthrough();
|
|
2202
|
-
//#endregion
|
|
2203
|
-
//#region ../theme-core/src/siteChromePlanning.ts
|
|
2204
|
-
function planSiteDocument(input) {
|
|
2205
|
-
const placement = planSiteChromePlacement(input.hasVisibleHeader ?? true ? input.headerPositioning : "static");
|
|
2206
|
-
const topShell = planSiteTopShell(input);
|
|
2207
|
-
const layoutMode = topShell.contentStartsUnderHeader ? "header-overlay" : "normal-flow";
|
|
2208
|
-
return {
|
|
2209
|
-
placement,
|
|
2210
|
-
topShell,
|
|
2211
|
-
layoutMode,
|
|
2212
|
-
overlayHeaderClearance: planSiteOverlayHeaderClearance({
|
|
2213
|
-
topShell,
|
|
2214
|
-
layoutMode
|
|
2215
|
-
})
|
|
2216
|
-
};
|
|
2217
|
-
}
|
|
2218
|
-
function planSiteTopShell(input) {
|
|
2219
|
-
if (input.hasVisibleHeader === false) return {
|
|
2220
|
-
behavior: "normal-flow",
|
|
2221
|
-
contentStartsUnderHeader: false,
|
|
2222
|
-
requiresHeaderOffset: false
|
|
2223
|
-
};
|
|
2224
|
-
const isOverlayHeader = input.headerVariant === "floating" && (input.headerPositioning === "sticky" || input.headerPositioning === "fixed");
|
|
2225
|
-
if (input.hasVisibleBanner && isOverlayHeader) return {
|
|
2226
|
-
behavior: "banner-above-overlay-header",
|
|
2227
|
-
contentStartsUnderHeader: true,
|
|
2228
|
-
requiresHeaderOffset: true
|
|
2229
|
-
};
|
|
2230
|
-
if (input.hasVisibleBanner && (input.headerPositioning === "sticky" || input.headerPositioning === "fixed")) return {
|
|
2231
|
-
behavior: "shared-sticky-shell",
|
|
2232
|
-
contentStartsUnderHeader: false,
|
|
2233
|
-
requiresHeaderOffset: false
|
|
2234
|
-
};
|
|
2235
|
-
return {
|
|
2236
|
-
behavior: "normal-flow",
|
|
2237
|
-
contentStartsUnderHeader: isOverlayHeader,
|
|
2238
|
-
requiresHeaderOffset: false
|
|
2239
|
-
};
|
|
2240
|
-
}
|
|
2241
|
-
//#endregion
|
|
2242
|
-
//#region ../theme-core/src/siteChrome.tsx
|
|
2243
|
-
const SITE_CHROME_CLASS_NAMES = {
|
|
2244
|
-
standaloneStickyHeaderShell: "sticky top-0 z-40 w-full",
|
|
2245
|
-
standaloneFixedHeaderShell: "fixed left-0 right-0 top-0 z-40 w-full",
|
|
2246
|
-
sharedStickyTopShell: "rb-sticky rb-top-0 rb-z-40 rb-w-full",
|
|
2247
|
-
defaultMinHeight: "rb-min-h-screen",
|
|
2248
|
-
fullMinHeight: "rb-min-h-full",
|
|
2249
|
-
overlayRoot: "rb-grid rb-grid-rows-main-footer rb-grid-cols-1",
|
|
2250
|
-
normalFlowRoot: "rb-flex rb-flex-col",
|
|
2251
|
-
overlayTopShell: "rb-row-start-1 rb-col-start-1 rb-z-40",
|
|
2252
|
-
overlayTopShellPlacementMarker: "rb-site-document-overlay-top-shell",
|
|
2253
|
-
overlayContent: "rb-row-start-1 rb-col-start-1",
|
|
2254
|
-
overlayFooter: "rb-row-start-2 rb-col-start-1",
|
|
2255
|
-
normalFlowContent: "rb-flex-1"
|
|
2256
|
-
};
|
|
2257
|
-
function renderSiteTopChrome({ headerNode, bannerNode = null, bannerShellBehavior = "normal-flow" }) {
|
|
2258
|
-
switch (bannerShellBehavior) {
|
|
2259
|
-
case "normal-flow": return /* @__PURE__ */ jsxs(Fragment$1, { children: [headerNode, bannerNode] });
|
|
2260
|
-
case "shared-sticky-shell": return /* @__PURE__ */ jsxs("div", {
|
|
2261
|
-
className: SITE_CHROME_CLASS_NAMES.sharedStickyTopShell,
|
|
2262
|
-
children: [headerNode, bannerNode]
|
|
2263
|
-
});
|
|
2264
|
-
case "banner-above-overlay-header": return /* @__PURE__ */ jsxs(Fragment$1, { children: [bannerNode, headerNode] });
|
|
2265
|
-
default: return assertNever$1(bannerShellBehavior);
|
|
2266
|
-
}
|
|
2267
|
-
}
|
|
2268
|
-
function SiteDocumentLayout({ plan, headerNode, bannerNode = null, footerNode, children, as: Root = "div", role, className = null, minHeightClassName = SITE_CHROME_CLASS_NAMES.defaultMinHeight, contentClassName = null, style }) {
|
|
2269
|
-
const isHeaderOverlay = plan.layoutMode === "header-overlay";
|
|
2270
|
-
const topShell = renderSiteTopChrome({
|
|
2271
|
-
headerNode,
|
|
2272
|
-
bannerNode,
|
|
2273
|
-
bannerShellBehavior: plan.topShell.behavior
|
|
2274
|
-
});
|
|
2275
|
-
const rootStyle = isHeaderOverlay ? {
|
|
2276
|
-
...style,
|
|
2277
|
-
gridTemplateColumns: "minmax(0, 1fr)",
|
|
2278
|
-
gridTemplateRows: "1fr auto"
|
|
2279
|
-
} : style;
|
|
2280
|
-
const rootClassName = joinSiteChromeClassNames(minHeightClassName, isHeaderOverlay ? SITE_CHROME_CLASS_NAMES.overlayRoot : SITE_CHROME_CLASS_NAMES.normalFlowRoot, className);
|
|
2281
|
-
if (isHeaderOverlay) {
|
|
2282
|
-
const contentStyle = plan.overlayHeaderClearance.kind === "opening-content" ? {
|
|
2283
|
-
gridColumn: "1",
|
|
2284
|
-
gridRow: "1",
|
|
2285
|
-
[SITE_OVERLAY_HEADER_CLEARANCE_CSS_VAR]: plan.overlayHeaderClearance.cssValue
|
|
2286
|
-
} : {
|
|
2287
|
-
gridColumn: "1",
|
|
2288
|
-
gridRow: "1"
|
|
2289
|
-
};
|
|
2290
|
-
return /* @__PURE__ */ jsxs(Root, {
|
|
2291
|
-
role,
|
|
2292
|
-
className: rootClassName,
|
|
2293
|
-
style: rootStyle,
|
|
2294
|
-
"data-site-document-layout": "",
|
|
2295
|
-
"data-site-document-layout-mode": plan.layoutMode,
|
|
2296
|
-
children: [
|
|
2297
|
-
/* @__PURE__ */ jsx("div", {
|
|
2298
|
-
className: joinSiteChromeClassNames(SITE_CHROME_CLASS_NAMES.overlayTopShell, SITE_CHROME_CLASS_NAMES.overlayTopShellPlacementMarker, plan.placement.headerRootClassName),
|
|
2299
|
-
"data-site-document-overlay-top-shell": "",
|
|
2300
|
-
style: {
|
|
2301
|
-
gridColumn: "1",
|
|
2302
|
-
gridRow: "1",
|
|
2303
|
-
alignSelf: "start"
|
|
2304
|
-
},
|
|
2305
|
-
children: topShell
|
|
2306
|
-
}),
|
|
2307
|
-
/* @__PURE__ */ jsx("div", {
|
|
2308
|
-
"data-site-document-overlay-content": plan.overlayHeaderClearance.kind === "opening-content" ? "true" : void 0,
|
|
2309
|
-
className: joinSiteChromeClassNames(SITE_CHROME_CLASS_NAMES.overlayContent, contentClassName),
|
|
2310
|
-
style: contentStyle,
|
|
2311
|
-
children
|
|
2312
|
-
}),
|
|
2313
|
-
/* @__PURE__ */ jsx("div", {
|
|
2314
|
-
className: SITE_CHROME_CLASS_NAMES.overlayFooter,
|
|
2315
|
-
style: {
|
|
2316
|
-
gridColumn: "1",
|
|
2317
|
-
gridRow: "2"
|
|
2318
|
-
},
|
|
2319
|
-
children: footerNode
|
|
2320
|
-
})
|
|
2321
|
-
]
|
|
2322
|
-
});
|
|
2323
|
-
}
|
|
2324
|
-
return /* @__PURE__ */ jsxs(Root, {
|
|
2325
|
-
role,
|
|
2326
|
-
className: rootClassName,
|
|
2327
|
-
style,
|
|
2328
|
-
"data-site-document-layout": "",
|
|
2329
|
-
"data-site-document-layout-mode": plan.layoutMode,
|
|
2330
|
-
children: [
|
|
2331
|
-
topShell,
|
|
2332
|
-
/* @__PURE__ */ jsx("div", {
|
|
2333
|
-
className: joinSiteChromeClassNames(SITE_CHROME_CLASS_NAMES.normalFlowContent, contentClassName),
|
|
2334
|
-
children
|
|
2335
|
-
}),
|
|
2336
|
-
footerNode
|
|
2337
|
-
]
|
|
2338
|
-
});
|
|
2339
|
-
}
|
|
2340
|
-
function joinSiteChromeClassNames(...values) {
|
|
2341
|
-
const className = values.filter(Boolean).join(" ");
|
|
2342
|
-
return className.length > 0 ? className : void 0;
|
|
2343
|
-
}
|
|
2344
|
-
//#endregion
|
|
2345
2271
|
//#region ../blocks/src/system/data/utils.ts
|
|
2346
2272
|
/**
|
|
2347
2273
|
* Normalize data loaders from block definition
|
|
@@ -4814,7 +4740,7 @@ function snapshotFromPreviewEntry(entryData) {
|
|
|
4814
4740
|
title,
|
|
4815
4741
|
path: entryData.path ?? "",
|
|
4816
4742
|
status,
|
|
4817
|
-
publishAt
|
|
4743
|
+
publishAt: entryData.lastPublishedAt ?? null
|
|
4818
4744
|
},
|
|
4819
4745
|
status,
|
|
4820
4746
|
route: previewEntryRoute(entryData)
|
|
@@ -4830,6 +4756,7 @@ function snapshotFromPreviewPage(pageId, metadata, schema) {
|
|
|
4830
4756
|
path: metadata.path,
|
|
4831
4757
|
status: metadata.status,
|
|
4832
4758
|
publishedAt: metadata.publishedAt,
|
|
4759
|
+
lastPublishedAt: metadata.lastPublishedAt,
|
|
4833
4760
|
draftMetaTitle: metadata.draftMetaTitle,
|
|
4834
4761
|
draftMetaDescription: metadata.draftMetaDescription,
|
|
4835
4762
|
publishedMetaTitle: metadata.publishedMetaTitle,
|
|
@@ -4868,11 +4795,8 @@ function previewValues(entryData, pageMetadata) {
|
|
|
4868
4795
|
};
|
|
4869
4796
|
}
|
|
4870
4797
|
/** Loading may render the document, but grants neither lease participation nor shortcuts. */
|
|
4871
|
-
function previewAuthoringMode(mode, admitted
|
|
4872
|
-
return {
|
|
4873
|
-
requestedEditingMode: admitted && mode.requestedEditingMode,
|
|
4874
|
-
historyShortcutsEnabled: admitted && mode.isEditingMode
|
|
4875
|
-
};
|
|
4798
|
+
function previewAuthoringMode(mode, admitted) {
|
|
4799
|
+
return { requestedEditingMode: admitted && mode.requestedEditingMode };
|
|
4876
4800
|
}
|
|
4877
4801
|
function PreviewEntryControllerProvider({ children, businessTimeZone, siteId, pageId, pageNodeType = "page", routeId: providedRouteId, entryData, contentTypeSchema, initialStatus = "draft", initialBlocks, blockFieldExtensions, pageMetadata, initialPageJournalState, authoringAdmitted, apiClient, subscribeToLeaseChanges, onLeaseGranted, liveDrafts }) {
|
|
4878
4802
|
const authoring = previewAuthoringMode(useEditor(), authoringAdmitted);
|
|
@@ -4923,7 +4847,6 @@ function PreviewEntryControllerProvider({ children, businessTimeZone, siteId, pa
|
|
|
4923
4847
|
initialPageJournalState,
|
|
4924
4848
|
initialBlocks: pageNodeType === "page_surface" ? void 0 : normalizedInitialBlocks,
|
|
4925
4849
|
blockFieldExtensions,
|
|
4926
|
-
historyShortcutsEnabled: authoring.historyShortcutsEnabled,
|
|
4927
4850
|
liveDrafts: previewLiveDraftsForScope(liveDrafts, previewToken, siteId, leaseScope)
|
|
4928
4851
|
};
|
|
4929
4852
|
if (pageNodeType === "page_surface" && pageId && pageMetadata) {
|
|
@@ -5209,6 +5132,7 @@ function PreviewConfirmationDialog({ dashboardContinueUrl, dialogState, isChecki
|
|
|
5209
5132
|
//#region ../preview-next/src/onboarding-preview-planner.ts
|
|
5210
5133
|
const DEFAULT_CHECK_ERROR_MESSAGE = "Unable to check your confirmation status right now.";
|
|
5211
5134
|
const DEFAULT_RESEND_ERROR_MESSAGE = "Unable to resend your confirmation email right now.";
|
|
5135
|
+
const RESEND_LIMIT_MESSAGE = "You’ve requested all the emails we can send for this sign-up. Check your inbox and spam folder for the latest link.";
|
|
5212
5136
|
const RESEND_SUCCESS_MESSAGE = "We sent a fresh confirmation email. Check your inbox and spam folder.";
|
|
5213
5137
|
const ALREADY_CONFIRMED_MESSAGE = "Your email is already confirmed. You can complete setup in the dashboard.";
|
|
5214
5138
|
function applyOnboardingConfirmationUpdate(state, update) {
|
|
@@ -5333,15 +5257,6 @@ function planInitialStatusLoadFailure() {
|
|
|
5333
5257
|
statusLoadFailed: true
|
|
5334
5258
|
}]);
|
|
5335
5259
|
}
|
|
5336
|
-
function planMissingResendConfirmationConfig(message = DEFAULT_RESEND_ERROR_MESSAGE) {
|
|
5337
|
-
return planNoEffect([{
|
|
5338
|
-
kind: "setResendFeedback",
|
|
5339
|
-
resendFeedback: {
|
|
5340
|
-
kind: "error",
|
|
5341
|
-
message
|
|
5342
|
-
}
|
|
5343
|
-
}]);
|
|
5344
|
-
}
|
|
5345
5260
|
function planResendConfirmationFailure(message = DEFAULT_RESEND_ERROR_MESSAGE) {
|
|
5346
5261
|
return planNoEffect([{
|
|
5347
5262
|
kind: "setResendFeedback",
|
|
@@ -5366,7 +5281,7 @@ function planResendConfirmationSuccess(input) {
|
|
|
5366
5281
|
kind: "setResendFeedback",
|
|
5367
5282
|
resendFeedback: {
|
|
5368
5283
|
kind: "success",
|
|
5369
|
-
message: input.response.result === "already_confirmed" ? ALREADY_CONFIRMED_MESSAGE : RESEND_SUCCESS_MESSAGE
|
|
5284
|
+
message: input.response.result === "already_confirmed" ? ALREADY_CONFIRMED_MESSAGE : input.response.result === "limit_reached" ? RESEND_LIMIT_MESSAGE : input.response.limitReached ? `We’ve sent another email. ${RESEND_LIMIT_MESSAGE}` : RESEND_SUCCESS_MESSAGE
|
|
5370
5285
|
}
|
|
5371
5286
|
}
|
|
5372
5287
|
],
|
|
@@ -5445,6 +5360,74 @@ function buildOnboardingResendConfirmationUrl(input) {
|
|
|
5445
5360
|
return url.toString();
|
|
5446
5361
|
}
|
|
5447
5362
|
//#endregion
|
|
5363
|
+
//#region ../preview-next/src/client/preview/usePreviewConfirmationResend.ts
|
|
5364
|
+
function stateAfterReply(reply) {
|
|
5365
|
+
if (reply.kind === "failed") return reply.retryAfterSeconds > 0 ? {
|
|
5366
|
+
kind: "cooling",
|
|
5367
|
+
seconds: reply.retryAfterSeconds
|
|
5368
|
+
} : { kind: "idle" };
|
|
5369
|
+
const data = reply.data;
|
|
5370
|
+
if (data.result === "limit_reached" || data.result === "resent" && data.limitReached) return { kind: "exhausted" };
|
|
5371
|
+
return data.result === "resent" ? {
|
|
5372
|
+
kind: "cooling",
|
|
5373
|
+
seconds: Math.ceil(data.retryAfterSeconds)
|
|
5374
|
+
} : { kind: "idle" };
|
|
5375
|
+
}
|
|
5376
|
+
function decideResendButton(state) {
|
|
5377
|
+
switch (state.kind) {
|
|
5378
|
+
case "idle": return {
|
|
5379
|
+
disabled: false,
|
|
5380
|
+
label: "Resend confirmation email"
|
|
5381
|
+
};
|
|
5382
|
+
case "sending": return {
|
|
5383
|
+
disabled: true,
|
|
5384
|
+
label: "Sending..."
|
|
5385
|
+
};
|
|
5386
|
+
case "exhausted": return {
|
|
5387
|
+
disabled: true,
|
|
5388
|
+
label: "No more emails available"
|
|
5389
|
+
};
|
|
5390
|
+
case "cooling": return {
|
|
5391
|
+
disabled: true,
|
|
5392
|
+
label: `Send again in ${state.seconds} seconds`
|
|
5393
|
+
};
|
|
5394
|
+
}
|
|
5395
|
+
}
|
|
5396
|
+
/** Owns duplicate submission, cooldown and exhaustion for preview's resend action. */
|
|
5397
|
+
function usePreviewConfirmationResend(input) {
|
|
5398
|
+
const [state, setState] = useState({ kind: "idle" });
|
|
5399
|
+
const inFlight = useRef(false);
|
|
5400
|
+
const resendButton = decideResendButton(state);
|
|
5401
|
+
useEffect(() => {
|
|
5402
|
+
if (state.kind !== "cooling") return;
|
|
5403
|
+
const timer = setTimeout(() => setState((current) => current.kind !== "cooling" ? current : current.seconds <= 1 ? { kind: "idle" } : {
|
|
5404
|
+
kind: "cooling",
|
|
5405
|
+
seconds: current.seconds - 1
|
|
5406
|
+
}), 1e3);
|
|
5407
|
+
return () => clearTimeout(timer);
|
|
5408
|
+
}, [state]);
|
|
5409
|
+
return {
|
|
5410
|
+
resendConfirmation: useCallback(async () => {
|
|
5411
|
+
if (inFlight.current || resendButton.disabled) return;
|
|
5412
|
+
inFlight.current = true;
|
|
5413
|
+
setState({ kind: "sending" });
|
|
5414
|
+
try {
|
|
5415
|
+
const reply = await input.request();
|
|
5416
|
+
setState(stateAfterReply(reply));
|
|
5417
|
+
if (reply.kind === "failed") input.failed(reply.message);
|
|
5418
|
+
else input.succeeded(reply.data);
|
|
5419
|
+
} catch (error) {
|
|
5420
|
+
setState({ kind: "idle" });
|
|
5421
|
+
input.failed(error instanceof Error ? error.message : "Unable to resend your confirmation email right now.");
|
|
5422
|
+
} finally {
|
|
5423
|
+
inFlight.current = false;
|
|
5424
|
+
}
|
|
5425
|
+
}, [input, resendButton.disabled]),
|
|
5426
|
+
resendButton,
|
|
5427
|
+
resendNeedsSupport: state.kind === "exhausted"
|
|
5428
|
+
};
|
|
5429
|
+
}
|
|
5430
|
+
//#endregion
|
|
5448
5431
|
//#region ../preview-next/src/client/preview/useOnboardingConfirmationCheck.ts
|
|
5449
5432
|
const INITIAL_ONBOARDING_CONFIRMATION_STATE = {
|
|
5450
5433
|
dashboardUnlocked: false,
|
|
@@ -5468,8 +5451,12 @@ function isLaunchReadiness(value) {
|
|
|
5468
5451
|
function isOnboardingPreviewStatusResponse(value) {
|
|
5469
5452
|
return isRecord$2(value) && typeof value.dashboardUnlocked === "boolean" && typeof value.requiresEmailConfirmation === "boolean" && isLaunchReadiness(value.launchReadiness);
|
|
5470
5453
|
}
|
|
5454
|
+
function isResendResult(value) {
|
|
5455
|
+
if (value.result === "already_confirmed" || value.result === "limit_reached") return true;
|
|
5456
|
+
return value.result === "resent" && typeof value.retryAfterSeconds === "number" && Number.isFinite(value.retryAfterSeconds) && value.retryAfterSeconds >= 0 && typeof value.limitReached === "boolean";
|
|
5457
|
+
}
|
|
5471
5458
|
function isResendOnboardingPreviewConfirmationResponse(value) {
|
|
5472
|
-
return isRecord$2(value) && (value
|
|
5459
|
+
return isRecord$2(value) && isResendResult(value) && typeof value.dashboardUnlocked === "boolean" && typeof value.requiresEmailConfirmation === "boolean" && isLaunchReadiness(value.launchReadiness);
|
|
5473
5460
|
}
|
|
5474
5461
|
function getSuccessData(payload, isData) {
|
|
5475
5462
|
if (!isRecord$2(payload) || payload.success !== true || !isData(payload.data)) return null;
|
|
@@ -5477,7 +5464,6 @@ function getSuccessData(payload, isData) {
|
|
|
5477
5464
|
}
|
|
5478
5465
|
function useOnboardingConfirmationCheck(input) {
|
|
5479
5466
|
const [isCheckingConfirmation, setIsCheckingConfirmation] = useState(false);
|
|
5480
|
-
const [isResendingConfirmation, setIsResendingConfirmation] = useState(false);
|
|
5481
5467
|
const [confirmationState, dispatchConfirmationUpdates] = useReducer(applyOnboardingConfirmationUpdates, INITIAL_ONBOARDING_CONFIRMATION_STATE);
|
|
5482
5468
|
const previewUpgradeStartedRef = useRef(false);
|
|
5483
5469
|
const { dashboardUnlocked, dialogState, hasLoadedStatus, launchReadiness, resendFeedback, statusLoadFailed } = confirmationState;
|
|
@@ -5562,49 +5548,39 @@ function useOnboardingConfirmationCheck(input) {
|
|
|
5562
5548
|
input.siteSlug,
|
|
5563
5549
|
readConfirmationStatus
|
|
5564
5550
|
]);
|
|
5565
|
-
const
|
|
5566
|
-
|
|
5567
|
-
|
|
5568
|
-
applyPlan(planMissingResendConfirmationConfig());
|
|
5569
|
-
return;
|
|
5570
|
-
}
|
|
5571
|
-
setIsResendingConfirmation(true);
|
|
5572
|
-
dispatchConfirmationUpdates([{
|
|
5573
|
-
kind: "setResendFeedback",
|
|
5574
|
-
resendFeedback: null
|
|
5575
|
-
}]);
|
|
5576
|
-
try {
|
|
5551
|
+
const resend = usePreviewConfirmationResend({
|
|
5552
|
+
request: useCallback(async () => {
|
|
5553
|
+
if (!resendConfirmationUrl || !input.previewToken) throw new Error(DEFAULT_RESEND_ERROR_MESSAGE);
|
|
5577
5554
|
const response = await fetch(resendConfirmationUrl, {
|
|
5578
5555
|
method: "POST",
|
|
5579
5556
|
headers: { Authorization: `Bearer ${input.previewToken}` }
|
|
5580
5557
|
});
|
|
5581
5558
|
const payload = await response.json().catch(() => null);
|
|
5582
|
-
if (!response.ok)
|
|
5559
|
+
if (!response.ok) {
|
|
5560
|
+
const delay = Number(response.headers.get("Retry-After"));
|
|
5561
|
+
return {
|
|
5562
|
+
kind: "failed",
|
|
5563
|
+
message: getErrorMessageFromEnvelope(payload, DEFAULT_RESEND_ERROR_MESSAGE),
|
|
5564
|
+
retryAfterSeconds: response.status === 429 ? Number.isFinite(delay) && delay > 0 ? Math.ceil(delay) : 60 : 0
|
|
5565
|
+
};
|
|
5566
|
+
}
|
|
5583
5567
|
const data = getSuccessData(payload, isResendOnboardingPreviewConfirmationResponse);
|
|
5584
5568
|
if (!data) throw new Error(DEFAULT_RESEND_ERROR_MESSAGE);
|
|
5585
|
-
|
|
5586
|
-
|
|
5587
|
-
|
|
5588
|
-
|
|
5589
|
-
|
|
5590
|
-
|
|
5591
|
-
|
|
5592
|
-
|
|
5593
|
-
|
|
5594
|
-
|
|
5595
|
-
|
|
5596
|
-
|
|
5597
|
-
|
|
5598
|
-
|
|
5599
|
-
|
|
5600
|
-
currentPreviewUrl,
|
|
5601
|
-
input.authMode,
|
|
5602
|
-
input.dashboardBaseUrl,
|
|
5603
|
-
input.previewToken,
|
|
5604
|
-
input.siteSlug,
|
|
5605
|
-
isResendingConfirmation,
|
|
5606
|
-
resendConfirmationUrl
|
|
5607
|
-
]);
|
|
5569
|
+
return {
|
|
5570
|
+
kind: "success",
|
|
5571
|
+
data
|
|
5572
|
+
};
|
|
5573
|
+
}, [resendConfirmationUrl, input.previewToken]),
|
|
5574
|
+
failed: (message) => applyPlan(planResendConfirmationFailure(message)),
|
|
5575
|
+
succeeded: (response) => applyPlan(planResendConfirmationSuccess({
|
|
5576
|
+
authMode: input.authMode,
|
|
5577
|
+
currentUrl: currentPreviewUrl(),
|
|
5578
|
+
dashboardBaseUrl: input.dashboardBaseUrl,
|
|
5579
|
+
response,
|
|
5580
|
+
siteSlug: input.siteSlug,
|
|
5581
|
+
upgradeAlreadyStarted: previewUpgradeStartedRef.current
|
|
5582
|
+
}))
|
|
5583
|
+
});
|
|
5608
5584
|
useEffect(() => {
|
|
5609
5585
|
if (!input.shouldLoadStatus || !confirmationStatusUrl || !input.previewToken) return;
|
|
5610
5586
|
let cancelled = false;
|
|
@@ -5651,9 +5627,8 @@ function useOnboardingConfirmationCheck(input) {
|
|
|
5651
5627
|
dialogState,
|
|
5652
5628
|
hasLoadedStatus,
|
|
5653
5629
|
isCheckingConfirmation,
|
|
5654
|
-
|
|
5630
|
+
...resend,
|
|
5655
5631
|
launchReadiness,
|
|
5656
|
-
resendConfirmation,
|
|
5657
5632
|
resendFeedback,
|
|
5658
5633
|
statusLoadFailed
|
|
5659
5634
|
};
|
|
@@ -5678,6 +5653,16 @@ function usePreviewRestart(dashboardBaseUrl, siteSlug) {
|
|
|
5678
5653
|
}, [dashboardBaseUrl, siteSlug])
|
|
5679
5654
|
};
|
|
5680
5655
|
}
|
|
5656
|
+
function ConfirmationResendSupport({ visible, dashboardBaseUrl }) {
|
|
5657
|
+
if (!visible || !dashboardBaseUrl) return null;
|
|
5658
|
+
return /* @__PURE__ */ jsx("a", {
|
|
5659
|
+
className: "text-xs underline underline-offset-2",
|
|
5660
|
+
href: new URL("/contact", dashboardBaseUrl).toString(),
|
|
5661
|
+
target: "_blank",
|
|
5662
|
+
rel: "noopener noreferrer",
|
|
5663
|
+
children: "Contact us for help"
|
|
5664
|
+
});
|
|
5665
|
+
}
|
|
5681
5666
|
function PreviewRecoveryBanner({ state, renewalPending, restartAvailable, reauthenticate }) {
|
|
5682
5667
|
const unavailable = state === "unavailable";
|
|
5683
5668
|
return /* @__PURE__ */ jsx(FixedBottomSurface, {
|
|
@@ -5817,36 +5802,43 @@ function PreviewAuthBanner({ dashboardBaseUrl = null, surfaceId }) {
|
|
|
5817
5802
|
]
|
|
5818
5803
|
}), /* @__PURE__ */ jsxs("div", {
|
|
5819
5804
|
className: "flex flex-col gap-2 sm:items-end",
|
|
5820
|
-
children: [
|
|
5821
|
-
|
|
5822
|
-
|
|
5823
|
-
|
|
5824
|
-
|
|
5825
|
-
|
|
5826
|
-
|
|
5827
|
-
|
|
5828
|
-
|
|
5829
|
-
|
|
5830
|
-
|
|
5831
|
-
|
|
5832
|
-
|
|
5833
|
-
|
|
5834
|
-
|
|
5835
|
-
|
|
5836
|
-
|
|
5837
|
-
|
|
5838
|
-
|
|
5839
|
-
|
|
5840
|
-
|
|
5841
|
-
|
|
5842
|
-
|
|
5843
|
-
|
|
5844
|
-
|
|
5845
|
-
|
|
5846
|
-
|
|
5847
|
-
|
|
5848
|
-
|
|
5849
|
-
|
|
5805
|
+
children: [
|
|
5806
|
+
/* @__PURE__ */ jsx("div", {
|
|
5807
|
+
className: "flex flex-col gap-2 sm:flex-row sm:items-center",
|
|
5808
|
+
children: showDashboardCta ? /* @__PURE__ */ jsx(Button, {
|
|
5809
|
+
type: "button",
|
|
5810
|
+
size: "sm",
|
|
5811
|
+
className: bannerModel.primaryButtonClassName,
|
|
5812
|
+
onClick: handleCompleteSetup,
|
|
5813
|
+
disabled: !dashboardContinueUrl,
|
|
5814
|
+
children: bannerModel.ctaLabel
|
|
5815
|
+
}) : /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Button, {
|
|
5816
|
+
type: "button",
|
|
5817
|
+
size: "sm",
|
|
5818
|
+
variant: "outline",
|
|
5819
|
+
className: bannerModel.secondaryButtonClassName,
|
|
5820
|
+
onClick: () => void onboardingConfirmationCheck.resendConfirmation(),
|
|
5821
|
+
disabled: onboardingConfirmationCheck.resendButton.disabled,
|
|
5822
|
+
children: onboardingConfirmationCheck.resendButton.label
|
|
5823
|
+
}), /* @__PURE__ */ jsx(Button, {
|
|
5824
|
+
type: "button",
|
|
5825
|
+
size: "sm",
|
|
5826
|
+
className: bannerModel.primaryButtonClassName,
|
|
5827
|
+
onClick: () => void onboardingConfirmationCheck.checkConfirmation(),
|
|
5828
|
+
disabled: !dashboardContinueUrl || onboardingConfirmationCheck.isCheckingConfirmation,
|
|
5829
|
+
children: onboardingConfirmationCheck.isCheckingConfirmation ? "Checking..." : "I've confirmed my email"
|
|
5830
|
+
})] })
|
|
5831
|
+
}),
|
|
5832
|
+
/* @__PURE__ */ jsx(ConfirmationResendSupport, {
|
|
5833
|
+
visible: onboardingConfirmationCheck.resendNeedsSupport,
|
|
5834
|
+
dashboardBaseUrl
|
|
5835
|
+
}),
|
|
5836
|
+
showOnboardingGrantGuidance && onboardingConfirmationCheck.resendFeedback ? /* @__PURE__ */ jsx("p", {
|
|
5837
|
+
"aria-live": "polite",
|
|
5838
|
+
className: onboardingConfirmationCheck.resendFeedback.kind === "error" ? "text-xs text-destructive" : "text-xs text-muted-foreground",
|
|
5839
|
+
children: onboardingConfirmationCheck.resendFeedback.message
|
|
5840
|
+
}) : null
|
|
5841
|
+
]
|
|
5850
5842
|
})]
|
|
5851
5843
|
})
|
|
5852
5844
|
}), /* @__PURE__ */ jsx(PreviewConfirmationDialog, {
|
|
@@ -5869,7 +5861,7 @@ function PreviewAccessBanners({ dashboardBaseUrl, surfaceId, isEntry, pageNodeTy
|
|
|
5869
5861
|
const { requestedEditingMode, setEditingMode } = useEditor();
|
|
5870
5862
|
const showDiscardedNotice = useEditorUiStore((editor) => canEditorWrite(editor.editability) && editor.leaseDiscardedChanges);
|
|
5871
5863
|
const thing = previewLeaseThing(isEntry, pageNodeType);
|
|
5872
|
-
const admissionNotice = useEditorUiStore((editor) => editorAdmissionNotice(editor.
|
|
5864
|
+
const admissionNotice = useEditorUiStore((editor) => editorAdmissionNotice(editor.getAdmission()));
|
|
5873
5865
|
const active = state === "ok";
|
|
5874
5866
|
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
5875
5867
|
/* @__PURE__ */ jsx(PreviewAuthBanner, {
|
|
@@ -5912,20 +5904,23 @@ function resolvePreviewThemeRoles(input) {
|
|
|
5912
5904
|
documentTheme: input.renderTheme ?? input.theme
|
|
5913
5905
|
};
|
|
5914
5906
|
}
|
|
5915
|
-
z.object({
|
|
5916
|
-
palette: paletteColorsSchema,
|
|
5917
|
-
paletteMode: paletteModeSchema,
|
|
5918
|
-
typography: z.object({
|
|
5919
|
-
headingFamily: z.string().trim().min(1),
|
|
5920
|
-
bodyFamily: z.string().trim().min(1)
|
|
5921
|
-
}).strict(),
|
|
5922
|
-
corners
|
|
5923
|
-
}).strict();
|
|
5924
5907
|
const DEFAULT_PREVIEW_CHROME_FLOATING_PLACEMENT = Object.freeze({
|
|
5925
5908
|
kind: "anchor-top-right",
|
|
5926
5909
|
topPx: 8,
|
|
5927
5910
|
rightPx: 16
|
|
5928
5911
|
});
|
|
5912
|
+
/** Set by the preview shell on the wrapper around the site's banner. */
|
|
5913
|
+
const PREVIEW_SITE_BANNER_ATTRIBUTE = "data-preview-site-banner";
|
|
5914
|
+
/** Room a rich-text format bar needs above its field: its own height plus the gap. */
|
|
5915
|
+
const FLOATING_BAR_ROOM_PX = 56;
|
|
5916
|
+
/**
|
|
5917
|
+
* A format bar sits above its field while it fits below the site's top chrome,
|
|
5918
|
+
* and drops under the field once it would cover the header or a banner.
|
|
5919
|
+
*/
|
|
5920
|
+
function planFloatingBarSide(input) {
|
|
5921
|
+
const chromeBottomPx = input.headerClearance.kind === "overlay" ? input.headerClearance.px : 0;
|
|
5922
|
+
return input.anchorTopPx - chromeBottomPx >= FLOATING_BAR_ROOM_PX ? "above" : "below";
|
|
5923
|
+
}
|
|
5929
5924
|
function headerClearanceFromPx(px) {
|
|
5930
5925
|
return Number.isFinite(px) && px > 0 ? {
|
|
5931
5926
|
kind: "overlay",
|
|
@@ -6016,6 +6011,97 @@ function isUsableAnchorBox(box) {
|
|
|
6016
6011
|
return Boolean(box && Number.isFinite(box.top) && Number.isFinite(box.right) && Number.isFinite(box.bottom) && Number.isFinite(box.height) && box.height > 0);
|
|
6017
6012
|
}
|
|
6018
6013
|
//#endregion
|
|
6014
|
+
//#region ../preview-next/src/client/preview/useSiteTopChromeClearance.ts
|
|
6015
|
+
const SITE_HEADER_SELECTOR = ".block-site-header";
|
|
6016
|
+
/** The banner's own elements, inside the box-less wrapper the preview shell puts round it. */
|
|
6017
|
+
const SITE_BANNER_SELECTOR = `[${PREVIEW_SITE_BANNER_ATTRIBUTE}] > *`;
|
|
6018
|
+
function findSiteTopChrome() {
|
|
6019
|
+
return {
|
|
6020
|
+
header: document.querySelector(SITE_HEADER_SELECTOR),
|
|
6021
|
+
banners: Array.from(document.querySelectorAll(SITE_BANNER_SELECTOR))
|
|
6022
|
+
};
|
|
6023
|
+
}
|
|
6024
|
+
function clearanceOf({ header, banners }) {
|
|
6025
|
+
return siteTopChromeClearance({
|
|
6026
|
+
header: header ? chromeBox(visibleHeaderPart(header)) : null,
|
|
6027
|
+
banners: banners.map(chromeBox)
|
|
6028
|
+
});
|
|
6029
|
+
}
|
|
6030
|
+
/** One live reading, for chrome that already re-measures itself on layout changes. */
|
|
6031
|
+
function measureSiteTopChromeClearance() {
|
|
6032
|
+
return clearanceOf(findSiteTopChrome());
|
|
6033
|
+
}
|
|
6034
|
+
/**
|
|
6035
|
+
* How far the site's header and any banner stacked with it reach down the
|
|
6036
|
+
* canvas right now. Re-measured on scroll as well as on layout changes, since
|
|
6037
|
+
* sticky chrome and a header scrolling away both change it.
|
|
6038
|
+
*/
|
|
6039
|
+
function useSiteTopChromeClearance() {
|
|
6040
|
+
const [clearance, setClearance] = useState({ kind: "none" });
|
|
6041
|
+
useEffect(() => {
|
|
6042
|
+
const frame = { id: null };
|
|
6043
|
+
const observed = { elements: [] };
|
|
6044
|
+
const resizeObserver = typeof ResizeObserver === "undefined" ? null : new ResizeObserver(() => schedule());
|
|
6045
|
+
const measure = () => {
|
|
6046
|
+
frame.id = null;
|
|
6047
|
+
const chrome = findSiteTopChrome();
|
|
6048
|
+
observe(chrome.header ? [chrome.header, ...chrome.banners] : chrome.banners);
|
|
6049
|
+
const next = clearanceOf(chrome);
|
|
6050
|
+
setClearance((current) => headerClearanceEquals(current, next) ? current : next);
|
|
6051
|
+
};
|
|
6052
|
+
const schedule = () => {
|
|
6053
|
+
if (frame.id === null) frame.id = window.requestAnimationFrame(measure);
|
|
6054
|
+
};
|
|
6055
|
+
const observe = (elements) => {
|
|
6056
|
+
if (!resizeObserver || sameElements(observed.elements, elements)) return;
|
|
6057
|
+
resizeObserver.disconnect();
|
|
6058
|
+
elements.forEach((element) => resizeObserver.observe(element));
|
|
6059
|
+
observed.elements = elements;
|
|
6060
|
+
};
|
|
6061
|
+
measure();
|
|
6062
|
+
const mutationObserver = new MutationObserver(schedule);
|
|
6063
|
+
mutationObserver.observe(document.body, {
|
|
6064
|
+
attributes: true,
|
|
6065
|
+
attributeFilter: ["class"],
|
|
6066
|
+
childList: true,
|
|
6067
|
+
subtree: true
|
|
6068
|
+
});
|
|
6069
|
+
window.addEventListener("resize", schedule);
|
|
6070
|
+
window.addEventListener("scroll", schedule, true);
|
|
6071
|
+
return () => {
|
|
6072
|
+
if (frame.id !== null) window.cancelAnimationFrame(frame.id);
|
|
6073
|
+
resizeObserver?.disconnect();
|
|
6074
|
+
mutationObserver.disconnect();
|
|
6075
|
+
window.removeEventListener("resize", schedule);
|
|
6076
|
+
window.removeEventListener("scroll", schedule, true);
|
|
6077
|
+
};
|
|
6078
|
+
}, []);
|
|
6079
|
+
return clearance;
|
|
6080
|
+
}
|
|
6081
|
+
/** The header's visible bar, when it marks one, rather than its whole box. */
|
|
6082
|
+
function visibleHeaderPart(header) {
|
|
6083
|
+
return Array.from(header.querySelectorAll(SITE_CHROME_VISIBLE_HEADER_SELECTOR)).find((candidate) => {
|
|
6084
|
+
const rect = candidate.getBoundingClientRect();
|
|
6085
|
+
return window.getComputedStyle(candidate).display !== "none" && rect.height > 0 && rect.bottom > 0;
|
|
6086
|
+
}) ?? header;
|
|
6087
|
+
}
|
|
6088
|
+
function chromeBox(element) {
|
|
6089
|
+
const rect = element.getBoundingClientRect();
|
|
6090
|
+
return {
|
|
6091
|
+
top: rect.top,
|
|
6092
|
+
bottom: rect.bottom
|
|
6093
|
+
};
|
|
6094
|
+
}
|
|
6095
|
+
function sameElements(left, right) {
|
|
6096
|
+
return left.length === right.length && left.every((element, index) => element === right[index]);
|
|
6097
|
+
}
|
|
6098
|
+
function headerClearanceEquals(left, right) {
|
|
6099
|
+
switch (left.kind) {
|
|
6100
|
+
case "none": return right.kind === "none";
|
|
6101
|
+
case "overlay": return right.kind === "overlay" && left.px === right.px;
|
|
6102
|
+
}
|
|
6103
|
+
}
|
|
6104
|
+
//#endregion
|
|
6019
6105
|
//#region ../preview-next/src/client/preview/PreviewChromeLayer.tsx
|
|
6020
6106
|
const PreviewChromeLayerContext = createContext(null);
|
|
6021
6107
|
function PreviewChromeLayerProvider({ children }) {
|
|
@@ -6234,6 +6320,21 @@ function PreviewChromeFloatingControl({ anchorSelector, anchorTargetSelector, pl
|
|
|
6234
6320
|
children
|
|
6235
6321
|
}), layer.portalTarget)] });
|
|
6236
6322
|
}
|
|
6323
|
+
/** Where a format bar goes for its field right now, in the chrome layer's coordinates. */
|
|
6324
|
+
function measureFloatingBarPosition(anchor, portalTarget, gapPx) {
|
|
6325
|
+
const anchorRect = anchor.getBoundingClientRect();
|
|
6326
|
+
const layerRect = portalTarget.getBoundingClientRect();
|
|
6327
|
+
const placement = planFloatingBarSide({
|
|
6328
|
+
anchorTopPx: anchorRect.top,
|
|
6329
|
+
headerClearance: measureSiteTopChromeClearance()
|
|
6330
|
+
});
|
|
6331
|
+
return {
|
|
6332
|
+
left: anchorRect.left - layerRect.left,
|
|
6333
|
+
top: placement === "above" ? anchorRect.top - layerRect.top - gapPx : anchorRect.bottom - layerRect.top + gapPx,
|
|
6334
|
+
width: anchorRect.width,
|
|
6335
|
+
placement
|
|
6336
|
+
};
|
|
6337
|
+
}
|
|
6237
6338
|
function PreviewChromeFloatingBar({ anchorSelector, gapPx = 8, children }) {
|
|
6238
6339
|
const layer = usePreviewChromeLayerOptional();
|
|
6239
6340
|
const probeRef = useRef(null);
|
|
@@ -6258,16 +6359,8 @@ function PreviewChromeFloatingBar({ anchorSelector, gapPx = 8, children }) {
|
|
|
6258
6359
|
setPosition(null);
|
|
6259
6360
|
return;
|
|
6260
6361
|
}
|
|
6261
|
-
const anchorRect = anchor.getBoundingClientRect();
|
|
6262
|
-
const layerRect = portalTarget.getBoundingClientRect();
|
|
6263
|
-
const placement = anchorRect.top >= 56 ? "above" : "below";
|
|
6264
6362
|
setThemeCustomProperties(readThemeCustomProperties(anchor));
|
|
6265
|
-
setPosition(
|
|
6266
|
-
left: anchorRect.left - layerRect.left,
|
|
6267
|
-
top: placement === "above" ? anchorRect.top - layerRect.top - gapPx : anchorRect.bottom - layerRect.top + gapPx,
|
|
6268
|
-
width: anchorRect.width,
|
|
6269
|
-
placement
|
|
6270
|
-
});
|
|
6363
|
+
setPosition(measureFloatingBarPosition(anchor, portalTarget, gapPx));
|
|
6271
6364
|
};
|
|
6272
6365
|
update();
|
|
6273
6366
|
const unsubscribe = layer.subscribeLayout(update);
|
|
@@ -6600,7 +6693,6 @@ function cycleAvailabilityFromFlags(input) {
|
|
|
6600
6693
|
//#region ../preview-next/src/client/preview/SiteChromeCustomizeButton.tsx
|
|
6601
6694
|
function SiteChromeCustomizeButton({ surface, containerClassName = "pointer-events-auto absolute right-2 top-2 z-50 flex gap-1 opacity-0 transition group-focus-within/site-chrome:opacity-100 group-hover/site-chrome:opacity-100" }) {
|
|
6602
6695
|
const customize = useSiteChromeCustomizeOptional();
|
|
6603
|
-
const editorUiStore = useOptionalEditorUiStoreInstance();
|
|
6604
6696
|
const popover = useCustomizePopoverController();
|
|
6605
6697
|
const [backgroundChooserOpen, setBackgroundChooserOpen] = useState(false);
|
|
6606
6698
|
const popoverSide = useSiteChromeCustomizePopoverSide({
|
|
@@ -6747,22 +6839,9 @@ function SiteChromeCustomizeButton({ surface, containerClassName = "pointer-even
|
|
|
6747
6839
|
})]
|
|
6748
6840
|
})]
|
|
6749
6841
|
}) : null,
|
|
6750
|
-
|
|
6751
|
-
|
|
6752
|
-
|
|
6753
|
-
type: "button",
|
|
6754
|
-
className: "w-full rounded-md border bg-background px-3 py-2 text-sm font-medium hover:bg-muted",
|
|
6755
|
-
onClick: (event) => {
|
|
6756
|
-
event.preventDefault();
|
|
6757
|
-
event.stopPropagation();
|
|
6758
|
-
editorUiStore.getState().openPreviewEditor({
|
|
6759
|
-
kind: "design",
|
|
6760
|
-
row: "header-style"
|
|
6761
|
-
});
|
|
6762
|
-
popover.close();
|
|
6763
|
-
},
|
|
6764
|
-
children: "More options"
|
|
6765
|
-
})
|
|
6842
|
+
surfaceState.surface === "header" ? /* @__PURE__ */ jsx(HeaderPopoverActions, {
|
|
6843
|
+
applyAllowed: surfaceState.applyAllowed,
|
|
6844
|
+
onClose: popover.close
|
|
6766
6845
|
}) : null,
|
|
6767
6846
|
surfaceState.diagnostics.length > 0 ? /* @__PURE__ */ jsx("ul", {
|
|
6768
6847
|
className: "space-y-1 text-xs text-amber-700",
|
|
@@ -6781,6 +6860,44 @@ function SiteChromeCustomizeButton({ surface, containerClassName = "pointer-even
|
|
|
6781
6860
|
]
|
|
6782
6861
|
});
|
|
6783
6862
|
}
|
|
6863
|
+
/** What the header popover offers beyond its own controls: the fuller editor, and a way back to the style. */
|
|
6864
|
+
function HeaderPopoverActions({ applyAllowed, onClose }) {
|
|
6865
|
+
const customize = useSiteChromeCustomizeOptional();
|
|
6866
|
+
const editorUiStore = useOptionalEditorUiStoreInstance();
|
|
6867
|
+
const run = (action) => (event) => {
|
|
6868
|
+
event.preventDefault();
|
|
6869
|
+
event.stopPropagation();
|
|
6870
|
+
action();
|
|
6871
|
+
};
|
|
6872
|
+
const className = "inline-flex w-full items-center justify-center gap-2 rounded-md border bg-background px-3 py-2 text-sm font-medium hover:bg-muted disabled:cursor-not-allowed disabled:opacity-50";
|
|
6873
|
+
const moreOptions = editorUiStore !== null && customize?.canOpenDesignEditor === true;
|
|
6874
|
+
const reset = customize?.headerFollowsStyleDefaults() === false;
|
|
6875
|
+
if (!customize || !moreOptions && !reset) return null;
|
|
6876
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
6877
|
+
className: "space-y-2 border-t pt-2",
|
|
6878
|
+
children: [moreOptions ? /* @__PURE__ */ jsx("button", {
|
|
6879
|
+
type: "button",
|
|
6880
|
+
className,
|
|
6881
|
+
onClick: run(() => {
|
|
6882
|
+
editorUiStore.getState().openPreviewEditor({
|
|
6883
|
+
kind: "design",
|
|
6884
|
+
row: "header-style"
|
|
6885
|
+
});
|
|
6886
|
+
onClose();
|
|
6887
|
+
}),
|
|
6888
|
+
children: "More options"
|
|
6889
|
+
}) : null, reset ? /* @__PURE__ */ jsxs("button", {
|
|
6890
|
+
type: "button",
|
|
6891
|
+
className,
|
|
6892
|
+
disabled: !applyAllowed,
|
|
6893
|
+
onClick: run(customize.resetHeaderToStyleDefaults),
|
|
6894
|
+
children: [/* @__PURE__ */ jsx(RotateCcw, {
|
|
6895
|
+
className: "h-4 w-4",
|
|
6896
|
+
"aria-hidden": "true"
|
|
6897
|
+
}), "Reset to the style's defaults"]
|
|
6898
|
+
}) : null]
|
|
6899
|
+
});
|
|
6900
|
+
}
|
|
6784
6901
|
/** Opens the footer composer, matching the block toolbar's Edit pill. */
|
|
6785
6902
|
function FooterEditPill() {
|
|
6786
6903
|
const editorUiStore = useOptionalEditorUiStoreInstance();
|
|
@@ -7714,6 +7831,8 @@ function PreviewThemedSiteDocument({ children, themeRuntime = defaultPreviewThem
|
|
|
7714
7831
|
const { effectiveTheme: overlayTheme } = usePreviewThemeOverlay();
|
|
7715
7832
|
const effectiveTheme = usePreviewOpeningTheme(overlayTheme);
|
|
7716
7833
|
const headerNode = renderPreviewHeader(siteChromeRenderModel, effectiveTheme, staticHeaderNode);
|
|
7834
|
+
const siteDocumentPlan = planPreviewSiteDocument(effectiveTheme, bannerNode, headerNode);
|
|
7835
|
+
const footerNode = renderPreviewFooter(siteChromeRenderModel, effectiveTheme, staticFooterNode);
|
|
7717
7836
|
const documentNode = renderPreviewDocument({
|
|
7718
7837
|
viewportMode,
|
|
7719
7838
|
viewportWidth,
|
|
@@ -7721,14 +7840,26 @@ function PreviewThemedSiteDocument({ children, themeRuntime = defaultPreviewThem
|
|
|
7721
7840
|
contentHeight,
|
|
7722
7841
|
scaleContainerRef,
|
|
7723
7842
|
contentRef,
|
|
7724
|
-
siteDocumentPlan
|
|
7843
|
+
siteDocumentPlan,
|
|
7725
7844
|
headerNode,
|
|
7726
|
-
bannerNode,
|
|
7727
|
-
footerNode
|
|
7845
|
+
bannerNode: markPreviewSiteBanner(bannerNode),
|
|
7846
|
+
footerNode,
|
|
7728
7847
|
children
|
|
7729
7848
|
});
|
|
7730
7849
|
return renderThemedDocument(themeRuntime, effectiveTheme, resolveDocumentResponsiveMode(themeRuntime, useContainerResponsiveMode), documentNode);
|
|
7731
7850
|
}
|
|
7851
|
+
/**
|
|
7852
|
+
* The shell marks whatever banner it's given, so preview chrome can stay clear
|
|
7853
|
+
* of it without the site's own markup having to cooperate (SDK sites render
|
|
7854
|
+
* their own). The wrapper has no box; the banner's elements are its children.
|
|
7855
|
+
*/
|
|
7856
|
+
function markPreviewSiteBanner(bannerNode) {
|
|
7857
|
+
return bannerNode ? /* @__PURE__ */ jsx("div", {
|
|
7858
|
+
[PREVIEW_SITE_BANNER_ATTRIBUTE]: "",
|
|
7859
|
+
style: { display: "contents" },
|
|
7860
|
+
children: bannerNode
|
|
7861
|
+
}) : null;
|
|
7862
|
+
}
|
|
7732
7863
|
function renderPreviewFooter(model, theme, fallback) {
|
|
7733
7864
|
if (!model || model.footer.canRenderReactively === false) return fallback;
|
|
7734
7865
|
return /* @__PURE__ */ jsx(SiteChromeEditableSurface, {
|
|
@@ -7915,10 +8046,10 @@ function resolveShellThemeRoles(props) {
|
|
|
7915
8046
|
}
|
|
7916
8047
|
const previewContainerResponsiveEnabled = process.env.NEXT_PUBLIC_ENABLE_PREVIEW_CONTAINER_RESPONSIVE !== "false";
|
|
7917
8048
|
const PreviewEditorSidebar = React.lazy(async () => {
|
|
7918
|
-
return { default: (await import("./PreviewEditorSidebar-
|
|
8049
|
+
return { default: (await import("./PreviewEditorSidebar-ChrW9VEo.mjs")).PreviewEditorSidebar };
|
|
7919
8050
|
});
|
|
7920
8051
|
const PreviewEditorUI = React.lazy(async () => {
|
|
7921
|
-
return { default: (await import("./PreviewEditorUI-
|
|
8052
|
+
return { default: (await import("./PreviewEditorUI-VaHvYtrA.mjs")).PreviewEditorUI };
|
|
7922
8053
|
});
|
|
7923
8054
|
const previewPaneContainmentStyle = {
|
|
7924
8055
|
contain: "layout paint",
|
|
@@ -7949,8 +8080,7 @@ function renderShellProviders(input) {
|
|
|
7949
8080
|
footerPreferences: props.themeSelectionFooterPreferences,
|
|
7950
8081
|
themeId: props.themeId ?? null,
|
|
7951
8082
|
selectionId: props.themeSelectionId ?? null,
|
|
7952
|
-
|
|
7953
|
-
selectionUpdatedAt: props.themeSelectionUpdatedAt ?? null,
|
|
8083
|
+
journalState: props.themeSelectionJournalState,
|
|
7954
8084
|
initialSelections: {
|
|
7955
8085
|
selectionVersion: props.themeSelectionVersion ?? null,
|
|
7956
8086
|
selectionUpdatedAt: props.themeSelectionUpdatedAt ?? null,
|
|
@@ -7995,7 +8125,7 @@ function PreviewDocumentContent(input) {
|
|
|
7995
8125
|
}
|
|
7996
8126
|
function PreviewShellLayout(props) {
|
|
7997
8127
|
const themeRoles = resolveShellThemeRoles(props);
|
|
7998
|
-
const { children, rendering, surfaceId, siteId, dashboardBaseUrl = null, pageId, entryData, contentTypeSchema, referenceContentTypeKeys = [], draftContent, currentTemplate, apiClient, themeId = null, themeSelectionId = null, themeSelectionVersion = null, themeSelectionUpdatedAt = null, themeSelectionButtonStyleSelection = null, themeSelectionButtonStyleRepairs, themeSelectionHeaderSelection = null, themeSelectionFooterLookId = null, themeSelectionHeaderLogo, isSiteLaunched, maintenanceModeEnabled, entrySubrouteContext, sdkConfig, bookingOfferingPresets, themeRuntime = defaultPreviewThemeRuntime, siteStyleAccess = { kind: "hidden" }, onFooterSaved } = props;
|
|
8128
|
+
const { children, rendering, surfaceId, siteId, dashboardBaseUrl = null, pageId, entryData, contentTypeSchema, referenceContentTypeKeys = [], draftContent, currentTemplate, apiClient, themeId = null, themeSelectionId = null, themeSelectionJournalState, themeSelectionVersion = null, themeSelectionUpdatedAt = null, themeSelectionButtonStyleSelection = null, themeSelectionButtonStyleRepairs, themeSelectionHeaderSelection = null, themeSelectionFooterLookId = null, themeSelectionHeaderLogo, isSiteLaunched, maintenanceModeEnabled, entrySubrouteContext, sdkConfig, bookingOfferingPresets, themeRuntime = defaultPreviewThemeRuntime, siteStyleAccess = { kind: "hidden" }, onFooterSaved } = props;
|
|
7999
8129
|
const layout = useOptionalPreviewLayout();
|
|
8000
8130
|
const headerNode = layout?.headerNode ?? null;
|
|
8001
8131
|
const bannerNode = layout?.bannerNode ?? null;
|
|
@@ -8160,6 +8290,7 @@ function PreviewShellLayout(props) {
|
|
|
8160
8290
|
apiClient,
|
|
8161
8291
|
themeId,
|
|
8162
8292
|
themeSelectionId,
|
|
8293
|
+
themeSelectionJournalState,
|
|
8163
8294
|
themeSelectionVersion,
|
|
8164
8295
|
themeSelectionUpdatedAt,
|
|
8165
8296
|
themeSelectionButtonStyleSelection,
|
|
@@ -8267,6 +8398,7 @@ function resolveShellLayoutProps(input) {
|
|
|
8267
8398
|
apiClient: input.apiClient,
|
|
8268
8399
|
themeId: props.themeId ?? null,
|
|
8269
8400
|
themeSelectionId: props.themeSelectionId ?? null,
|
|
8401
|
+
themeSelectionJournalState: props.themeSelectionJournalState,
|
|
8270
8402
|
themeSelectionVersion: props.themeSelectionVersion ?? null,
|
|
8271
8403
|
themeSelectionUpdatedAt: props.themeSelectionUpdatedAt ?? null,
|
|
8272
8404
|
themeSelectionButtonStyleSelection: props.themeSelectionButtonStyleSelection ?? null,
|
|
@@ -8301,7 +8433,7 @@ function renderShellLayout(input) {
|
|
|
8301
8433
|
});
|
|
8302
8434
|
}
|
|
8303
8435
|
function wrapPreviewSiteFontStorage(children, siteFontStorageUrl) {
|
|
8304
|
-
return /* @__PURE__ */ jsx(
|
|
8436
|
+
return /* @__PURE__ */ jsx(SiteFontStorageProvider, {
|
|
8305
8437
|
siteFontStorageUrl,
|
|
8306
8438
|
children
|
|
8307
8439
|
});
|
|
@@ -8309,8 +8441,7 @@ function wrapPreviewSiteFontStorage(children, siteFontStorageUrl) {
|
|
|
8309
8441
|
function PreviewEditorBody({ props, designEditorEnabled, siteStyleAccess }) {
|
|
8310
8442
|
const { apiClient } = useEntryEditorController();
|
|
8311
8443
|
const bearerToken = usePreviewToken();
|
|
8312
|
-
|
|
8313
|
-
const content = /* @__PURE__ */ jsx(PreviewPageDesignEditorStateProvider, {
|
|
8444
|
+
return /* @__PURE__ */ jsx(PreviewPageDesignEditorStateProvider, {
|
|
8314
8445
|
apiClient,
|
|
8315
8446
|
siteId: props.siteId,
|
|
8316
8447
|
pageId: props.pageId,
|
|
@@ -8328,7 +8459,6 @@ function PreviewEditorBody({ props, designEditorEnabled, siteStyleAccess }) {
|
|
|
8328
8459
|
}), props.siteFontStorageUrl)]
|
|
8329
8460
|
})
|
|
8330
8461
|
});
|
|
8331
|
-
return journal ? content : /* @__PURE__ */ jsx(PreviewDesignHistoryOrderProvider, { children: content });
|
|
8332
8462
|
}
|
|
8333
8463
|
function PreviewBlockApiProvider({ config, children }) {
|
|
8334
8464
|
const token = usePreviewToken();
|
|
@@ -8356,24 +8486,30 @@ function PreviewShell(props) {
|
|
|
8356
8486
|
...props,
|
|
8357
8487
|
hideSiteStyleConfigurator: props.hideSiteStyleConfigurator ?? false
|
|
8358
8488
|
});
|
|
8359
|
-
return /* @__PURE__ */
|
|
8360
|
-
session: props.previewSession,
|
|
8361
|
-
token: props.previewToken,
|
|
8489
|
+
return /* @__PURE__ */ jsxs(LocationPickerEnvironmentProvider, {
|
|
8362
8490
|
siteId: props.siteId,
|
|
8363
|
-
|
|
8364
|
-
|
|
8365
|
-
|
|
8366
|
-
|
|
8367
|
-
|
|
8368
|
-
|
|
8369
|
-
|
|
8370
|
-
|
|
8371
|
-
|
|
8372
|
-
|
|
8491
|
+
apiClient,
|
|
8492
|
+
tilesKey: props.previewSession?.tilesKey,
|
|
8493
|
+
dashboardBaseUrl: props.dashboardBaseUrl ?? props.apiBaseUrl,
|
|
8494
|
+
children: [/* @__PURE__ */ jsx(ToastProvider, {}), /* @__PURE__ */ jsx(PreviewQueryProvider, { children: /* @__PURE__ */ jsx(PreviewAuthInit, {
|
|
8495
|
+
session: props.previewSession,
|
|
8496
|
+
token: props.previewToken,
|
|
8497
|
+
siteId: props.siteId,
|
|
8498
|
+
siteSlug: props.siteSlug,
|
|
8499
|
+
pageId: props.editableId,
|
|
8500
|
+
children: /* @__PURE__ */ jsx(PreviewBlockApiProvider, {
|
|
8501
|
+
config: props.blockApiConfig,
|
|
8502
|
+
children: /* @__PURE__ */ jsx(PreviewEditingModeProvider, {
|
|
8503
|
+
siteId: props.siteId,
|
|
8504
|
+
children: /* @__PURE__ */ jsx(PreviewEditorMount, {
|
|
8505
|
+
props,
|
|
8506
|
+
apiClient,
|
|
8507
|
+
access
|
|
8508
|
+
})
|
|
8373
8509
|
})
|
|
8374
8510
|
})
|
|
8375
|
-
})
|
|
8376
|
-
})
|
|
8511
|
+
}) })]
|
|
8512
|
+
});
|
|
8377
8513
|
}
|
|
8378
8514
|
function previewJournalScope(props) {
|
|
8379
8515
|
const nodeId = props.pageId ?? props.entryData?.id;
|
|
@@ -8394,7 +8530,7 @@ function PreviewEditorMount({ props, apiClient, access }) {
|
|
|
8394
8530
|
]);
|
|
8395
8531
|
const editable = isPreviewRuntimeSessionEditable(props.previewSession);
|
|
8396
8532
|
const ordinaryPageId = props.pageId && !props.entryData && props.pageNodeType !== "page_surface" ? props.pageId : null;
|
|
8397
|
-
const renderContent = (initialPageJournalState,
|
|
8533
|
+
const renderContent = (initialPageJournalState, authoringAdmitted) => /* @__PURE__ */ jsxs(PreviewEntryControllerProvider, {
|
|
8398
8534
|
blockFieldExtensions: props.sdkConfig?.blockFieldExtensions ?? null,
|
|
8399
8535
|
businessTimeZone: props.businessTimeZone,
|
|
8400
8536
|
siteId: props.siteId,
|
|
@@ -8416,11 +8552,10 @@ function PreviewEditorMount({ props, apiClient, access }) {
|
|
|
8416
8552
|
authoringAdmitted && /* @__PURE__ */ jsx(SiteAdmissionObserver, {
|
|
8417
8553
|
siteId: props.siteId,
|
|
8418
8554
|
apiClient,
|
|
8419
|
-
checkpoint,
|
|
8420
8555
|
siteOnly: !scope && editable,
|
|
8421
8556
|
subscribeToAdmissionChanges: props.subscribeToAdmissionChanges
|
|
8422
8557
|
}),
|
|
8423
|
-
|
|
8558
|
+
/* @__PURE__ */ jsx(PreviewLeaseEditingMode, {}),
|
|
8424
8559
|
/* @__PURE__ */ jsx(PreviewEditorBody, {
|
|
8425
8560
|
props,
|
|
8426
8561
|
...access,
|
|
@@ -8435,8 +8570,8 @@ function PreviewEditorMount({ props, apiClient, access }) {
|
|
|
8435
8570
|
editable,
|
|
8436
8571
|
scope,
|
|
8437
8572
|
ordinaryPageId,
|
|
8438
|
-
fallback: renderContent(void 0,
|
|
8439
|
-
children: (initialPageJournalState
|
|
8573
|
+
fallback: renderContent(void 0, false),
|
|
8574
|
+
children: (initialPageJournalState) => renderContent(initialPageJournalState, true)
|
|
8440
8575
|
});
|
|
8441
8576
|
}
|
|
8442
8577
|
function defaultDesignEditorEligibility(input) {
|
|
@@ -8455,6 +8590,46 @@ function resolveShellAccess(input) {
|
|
|
8455
8590
|
};
|
|
8456
8591
|
}
|
|
8457
8592
|
//#endregion
|
|
8593
|
+
//#region ../preview-next/src/client/blocks/authoringLocationMaps.ts
|
|
8594
|
+
/** A render-only projection. Canonical drafts in the editor store remain untouched. */
|
|
8595
|
+
function projectAuthoringLocationMaps(page, admitted, siteCountry) {
|
|
8596
|
+
const ready = new Map((admitted?.blocks ?? []).flatMap((block) => {
|
|
8597
|
+
const parsed = publicLocationSchema.safeParse(block.content?.location);
|
|
8598
|
+
return block.id && parsed.success ? [[block.id, parsed.data]] : [];
|
|
8599
|
+
}));
|
|
8600
|
+
return {
|
|
8601
|
+
...page,
|
|
8602
|
+
blocks: page.blocks.map((block) => {
|
|
8603
|
+
if (block.kind !== "block.location-map") return block;
|
|
8604
|
+
const project = (content) => projectAuthoringMapContent(content, block.id ? ready.get(block.id) : void 0, siteCountry);
|
|
8605
|
+
return {
|
|
8606
|
+
...block,
|
|
8607
|
+
content: project(block.content),
|
|
8608
|
+
draftContent: block.draftContent ? project(block.draftContent) : block.draftContent
|
|
8609
|
+
};
|
|
8610
|
+
})
|
|
8611
|
+
};
|
|
8612
|
+
}
|
|
8613
|
+
function projectAuthoringMapContent(content, ready, siteCountry) {
|
|
8614
|
+
if (!content || content.locationSource === "business_address" || content.locationSource === "venue") return content ?? void 0;
|
|
8615
|
+
const canonical = parseLocationValue(content.location ?? null);
|
|
8616
|
+
if (!canonical.ok || canonical.value === null) return content;
|
|
8617
|
+
const location = projectPublicLocation(canonical.value, siteCountry);
|
|
8618
|
+
const drawing = drawingAtCurrentPin(location, ready);
|
|
8619
|
+
return {
|
|
8620
|
+
...content,
|
|
8621
|
+
location: {
|
|
8622
|
+
...location,
|
|
8623
|
+
...drawing ? { drawing } : {}
|
|
8624
|
+
}
|
|
8625
|
+
};
|
|
8626
|
+
}
|
|
8627
|
+
/** Geometry identity is the pin, never the block ID or an older address label. */
|
|
8628
|
+
function drawingAtCurrentPin(location, ready) {
|
|
8629
|
+
if (!ready?.pin || !location.pin) return void 0;
|
|
8630
|
+
return ready.pin.lat === location.pin.lat && ready.pin.lng === location.pin.lng ? ready.drawing : void 0;
|
|
8631
|
+
}
|
|
8632
|
+
//#endregion
|
|
8458
8633
|
//#region ../preview-next/src/client/blocks/composer/mergeDrafts.ts
|
|
8459
8634
|
const EMPTY_LINKED_ENTRY_OVERLAY = /* @__PURE__ */ new Map();
|
|
8460
8635
|
/**
|
|
@@ -8775,7 +8950,7 @@ function useMediaQuery(query) {
|
|
|
8775
8950
|
//#endregion
|
|
8776
8951
|
//#region ../preview-next/src/client/blocks/BlockToolbar.tsx
|
|
8777
8952
|
function BlockToolbar({ placement = DEFAULT_PREVIEW_CHROME_FLOATING_PLACEMENT, ...input }) {
|
|
8778
|
-
const { selection, controls, toolbar, open, cycleSdk,
|
|
8953
|
+
const { selection, controls, toolbar, open, cycleSdk, cycleRecipe } = useBlockToolbar(input);
|
|
8779
8954
|
const name = controls.manifest?.title ?? getBlockDefinition(input.blockKind)?.manifest.title ?? input.blockKind;
|
|
8780
8955
|
const row = /* @__PURE__ */ jsxs("div", {
|
|
8781
8956
|
role: "group",
|
|
@@ -8796,7 +8971,7 @@ function BlockToolbar({ placement = DEFAULT_PREVIEW_CHROME_FLOATING_PLACEMENT, .
|
|
|
8796
8971
|
controls,
|
|
8797
8972
|
toolbar,
|
|
8798
8973
|
onCycleSdk: cycleSdk,
|
|
8799
|
-
|
|
8974
|
+
onCycleRecipe: cycleRecipe
|
|
8800
8975
|
})
|
|
8801
8976
|
]
|
|
8802
8977
|
});
|
|
@@ -8840,7 +9015,7 @@ function useBlockToolbar(input) {
|
|
|
8840
9015
|
openField
|
|
8841
9016
|
});
|
|
8842
9017
|
const cycleSdk = (direction) => cycleSdkLook(controls, direction);
|
|
8843
|
-
const
|
|
9018
|
+
const cycleRecipe = (direction) => {
|
|
8844
9019
|
if (!controls.designBlock) return;
|
|
8845
9020
|
const action = cyclePageDesignBlockLook(controls.designBlock, direction);
|
|
8846
9021
|
if (action) applyAction(action, { runtimeContent: values });
|
|
@@ -8851,7 +9026,7 @@ function useBlockToolbar(input) {
|
|
|
8851
9026
|
toolbar,
|
|
8852
9027
|
open,
|
|
8853
9028
|
cycleSdk,
|
|
8854
|
-
|
|
9029
|
+
cycleRecipe
|
|
8855
9030
|
};
|
|
8856
9031
|
}
|
|
8857
9032
|
function useOpenBlockSidebar(blockId, uiStore) {
|
|
@@ -8883,7 +9058,7 @@ function cycleSdkLook(controls, direction) {
|
|
|
8883
9058
|
if (next) controls.backend.setValue(item.path, next.value);
|
|
8884
9059
|
}
|
|
8885
9060
|
/** The Look pill shows only while its arrows have somewhere to go. */
|
|
8886
|
-
function ToolbarLook({ controls, toolbar, onCycleSdk,
|
|
9061
|
+
function ToolbarLook({ controls, toolbar, onCycleSdk, onCycleRecipe }) {
|
|
8887
9062
|
if (controls.lookSource.kind === "sdk") {
|
|
8888
9063
|
const field = cyclableSdkLookField(controls.lookSource.item);
|
|
8889
9064
|
return field && controls.lookSource.item ? /* @__PURE__ */ jsx(SdkToolbarLook, {
|
|
@@ -8892,8 +9067,9 @@ function ToolbarLook({ controls, toolbar, onCycleSdk, onCycleLegacy }) {
|
|
|
8892
9067
|
onCycle: onCycleSdk
|
|
8893
9068
|
}) : null;
|
|
8894
9069
|
}
|
|
8895
|
-
if (toolbar?.controls.look) return toolbar.controls.
|
|
9070
|
+
if (toolbar?.controls.look) return toolbar.controls.tiles.length > 1 ? /* @__PURE__ */ jsx(ArrangementLookPill, {
|
|
8896
9071
|
look: toolbar.controls.look,
|
|
9072
|
+
position: lookTilePosition(toolbar.controls.tiles),
|
|
8897
9073
|
onCycle: toolbar.cycleLook
|
|
8898
9074
|
}) : null;
|
|
8899
9075
|
if (!controls.designBlock) return null;
|
|
@@ -8901,7 +9077,7 @@ function ToolbarLook({ controls, toolbar, onCycleSdk, onCycleLegacy }) {
|
|
|
8901
9077
|
return preset.canCycle ? /* @__PURE__ */ jsx(LookCyclePill, {
|
|
8902
9078
|
lookName: preset.lookName,
|
|
8903
9079
|
position: preset.position,
|
|
8904
|
-
onCycle:
|
|
9080
|
+
onCycle: onCycleRecipe
|
|
8905
9081
|
}) : null;
|
|
8906
9082
|
}
|
|
8907
9083
|
function cyclableSdkLookField(item) {
|
|
@@ -9271,85 +9447,6 @@ function formatBlockKindLabel(blockKind) {
|
|
|
9271
9447
|
return ((blockKind.includes(".") ? blockKindParts[blockKindParts.length - 1] : blockKind) ?? blockKind).split(/[-_]/).filter(Boolean).map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join(" ");
|
|
9272
9448
|
}
|
|
9273
9449
|
//#endregion
|
|
9274
|
-
//#region ../preview-next/src/client/preview/useSiteTopChromeClearance.ts
|
|
9275
|
-
const SITE_HEADER_SELECTOR = ".block-site-header";
|
|
9276
|
-
/** Announcement banners mark themselves so preview chrome can stay clear of them. */
|
|
9277
|
-
const SITE_BANNER_SELECTOR = "[data-site-banner]";
|
|
9278
|
-
/**
|
|
9279
|
-
* How far the site's header and any banner stacked with it reach down the
|
|
9280
|
-
* canvas right now. Re-measured on scroll as well as on layout changes, since
|
|
9281
|
-
* sticky chrome and a header scrolling away both change it.
|
|
9282
|
-
*/
|
|
9283
|
-
function useSiteTopChromeClearance() {
|
|
9284
|
-
const [clearance, setClearance] = useState({ kind: "none" });
|
|
9285
|
-
useEffect(() => {
|
|
9286
|
-
const frame = { id: null };
|
|
9287
|
-
const observed = { elements: [] };
|
|
9288
|
-
const resizeObserver = typeof ResizeObserver === "undefined" ? null : new ResizeObserver(() => schedule());
|
|
9289
|
-
const measure = () => {
|
|
9290
|
-
frame.id = null;
|
|
9291
|
-
const header = document.querySelector(SITE_HEADER_SELECTOR);
|
|
9292
|
-
const banners = Array.from(document.querySelectorAll(SITE_BANNER_SELECTOR));
|
|
9293
|
-
observe(header ? [header, ...banners] : banners);
|
|
9294
|
-
const next = siteTopChromeClearance({
|
|
9295
|
-
header: header ? chromeBox(visibleHeaderPart(header)) : null,
|
|
9296
|
-
banners: banners.map(chromeBox)
|
|
9297
|
-
});
|
|
9298
|
-
setClearance((current) => headerClearanceEquals(current, next) ? current : next);
|
|
9299
|
-
};
|
|
9300
|
-
const schedule = () => {
|
|
9301
|
-
if (frame.id === null) frame.id = window.requestAnimationFrame(measure);
|
|
9302
|
-
};
|
|
9303
|
-
const observe = (elements) => {
|
|
9304
|
-
if (!resizeObserver || sameElements(observed.elements, elements)) return;
|
|
9305
|
-
resizeObserver.disconnect();
|
|
9306
|
-
elements.forEach((element) => resizeObserver.observe(element));
|
|
9307
|
-
observed.elements = elements;
|
|
9308
|
-
};
|
|
9309
|
-
measure();
|
|
9310
|
-
const mutationObserver = new MutationObserver(schedule);
|
|
9311
|
-
mutationObserver.observe(document.body, {
|
|
9312
|
-
attributes: true,
|
|
9313
|
-
attributeFilter: ["class"],
|
|
9314
|
-
childList: true,
|
|
9315
|
-
subtree: true
|
|
9316
|
-
});
|
|
9317
|
-
window.addEventListener("resize", schedule);
|
|
9318
|
-
window.addEventListener("scroll", schedule, true);
|
|
9319
|
-
return () => {
|
|
9320
|
-
if (frame.id !== null) window.cancelAnimationFrame(frame.id);
|
|
9321
|
-
resizeObserver?.disconnect();
|
|
9322
|
-
mutationObserver.disconnect();
|
|
9323
|
-
window.removeEventListener("resize", schedule);
|
|
9324
|
-
window.removeEventListener("scroll", schedule, true);
|
|
9325
|
-
};
|
|
9326
|
-
}, []);
|
|
9327
|
-
return clearance;
|
|
9328
|
-
}
|
|
9329
|
-
/** The header's visible bar, when it marks one, rather than its whole box. */
|
|
9330
|
-
function visibleHeaderPart(header) {
|
|
9331
|
-
return Array.from(header.querySelectorAll(SITE_CHROME_VISIBLE_HEADER_SELECTOR)).find((candidate) => {
|
|
9332
|
-
const rect = candidate.getBoundingClientRect();
|
|
9333
|
-
return window.getComputedStyle(candidate).display !== "none" && rect.height > 0 && rect.bottom > 0;
|
|
9334
|
-
}) ?? header;
|
|
9335
|
-
}
|
|
9336
|
-
function chromeBox(element) {
|
|
9337
|
-
const rect = element.getBoundingClientRect();
|
|
9338
|
-
return {
|
|
9339
|
-
top: rect.top,
|
|
9340
|
-
bottom: rect.bottom
|
|
9341
|
-
};
|
|
9342
|
-
}
|
|
9343
|
-
function sameElements(left, right) {
|
|
9344
|
-
return left.length === right.length && left.every((element, index) => element === right[index]);
|
|
9345
|
-
}
|
|
9346
|
-
function headerClearanceEquals(left, right) {
|
|
9347
|
-
switch (left.kind) {
|
|
9348
|
-
case "none": return right.kind === "none";
|
|
9349
|
-
case "overlay": return right.kind === "overlay" && left.px === right.px;
|
|
9350
|
-
}
|
|
9351
|
-
}
|
|
9352
|
-
//#endregion
|
|
9353
9450
|
//#region ../preview-next/src/client/blocks/previewBatchLoaderParams.ts
|
|
9354
9451
|
function isBatchableEndpoint(endpoint) {
|
|
9355
9452
|
return endpoint === "listPublicEvents" || endpoint === "listPublicEventCalendarWindow" || endpoint === "getPublicEventDetails" || endpoint === "listPublicRouteCandidates" || endpoint === "listPublicTeamMembers" || endpoint === "listPublicProducts" || endpoint === "getPublicBookingServices" || endpoint === "getPublicWeeklySlotAvailability" || endpoint === "getPublicFormById";
|
|
@@ -9564,7 +9661,7 @@ function EditableDraftPageRenderer(props) {
|
|
|
9564
9661
|
return applyPreviewStructureProjections(blockItems, aiProjections);
|
|
9565
9662
|
}, [aiProjections, blockItems]);
|
|
9566
9663
|
const dateContext = usePreviewDateContext(pageRendererProps.dataContext);
|
|
9567
|
-
const
|
|
9664
|
+
const mergedPage = useMemo(() => {
|
|
9568
9665
|
return composePageFromBlocks({
|
|
9569
9666
|
page: pageRendererProps.page,
|
|
9570
9667
|
dateContext,
|
|
@@ -9582,12 +9679,17 @@ function EditableDraftPageRenderer(props) {
|
|
|
9582
9679
|
remoteDrafts,
|
|
9583
9680
|
contentSnapshot,
|
|
9584
9681
|
renderSource
|
|
9585
|
-
])
|
|
9682
|
+
]);
|
|
9683
|
+
const renderPage = useMemo(() => projectAuthoringLocationMaps(mergedPage ?? {
|
|
9586
9684
|
name: "",
|
|
9587
9685
|
path: "",
|
|
9588
9686
|
purpose: "",
|
|
9589
9687
|
blocks: []
|
|
9590
|
-
}
|
|
9688
|
+
}, pageRendererProps.page, linkedEntryDataContext?.siteCountry), [
|
|
9689
|
+
mergedPage,
|
|
9690
|
+
pageRendererProps.page,
|
|
9691
|
+
linkedEntryDataContext?.siteCountry
|
|
9692
|
+
]);
|
|
9591
9693
|
const runtimeJoins = editorRuntimeJoins(runtimeProjection, pageRendererProps.runtimeJoins);
|
|
9592
9694
|
const renderedBlockById = useMemo(() => {
|
|
9593
9695
|
return new Map((renderPage?.blocks ?? []).filter((block) => Boolean(block.id)).map((block) => [block.id, block]));
|
|
@@ -9993,7 +10095,8 @@ function SdkPreviewModeRuntime(props) {
|
|
|
9993
10095
|
supabaseUrl: content.supabaseUrl,
|
|
9994
10096
|
siteFontStorageUrl,
|
|
9995
10097
|
designEditorEligibility: { kind: "sdk-page" },
|
|
9996
|
-
hideSiteStyleConfigurator: true
|
|
10098
|
+
hideSiteStyleConfigurator: true,
|
|
10099
|
+
themeSelectionJournalState: null
|
|
9997
10100
|
};
|
|
9998
10101
|
if (model.rendering.kind === "overrides-only") return /* @__PURE__ */ jsx(PreviewShell, {
|
|
9999
10102
|
...shellProps,
|