@riverbankcms/sdk 0.162.0 → 0.163.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/dist/_dts/{BlocksIslandsHydrator-PZUoA872.d.ts → BlocksIslandsHydrator-DYPGA_qh.d.ts} +1 -1
- package/dist/_dts/{Page-CdQS6C7i.d.ts → Page-zwnvFBPu.d.ts} +8 -8
- package/dist/_dts/{SdkPreviewMode-CNGO-5f1.d.ts → SdkPreviewMode-DukuJzGr.d.ts} +3 -3
- package/dist/_dts/{client-DGa53rjL.d.ts → client-Chh3bnXC.d.ts} +1 -1
- package/dist/_dts/{content-types-K9R7P-KF.d.ts → content-types-Bbzqw9J2.d.ts} +2 -2
- package/dist/_dts/{contracts-CyBaPaIq.d.ts → contracts-GJ1kGBsi.d.ts} +4 -4
- package/dist/_dts/{footerPageOutline-B6jmKmon.d.ts → footerPageOutline-BNMKhyvo.d.ts} +6 -6
- package/dist/_dts/{generatePageMetadata-iemoR3AN.d.ts → generatePageMetadata-Ce0m1P3B.d.ts} +2 -2
- package/dist/_dts/{index-Wm62sXf2.d.ts → index-C3mJvn27.d.ts} +4 -4
- package/dist/_dts/{index-DI2yaSPY.d.ts → index-CaL0nKkl.d.ts} +81 -26
- package/dist/_dts/{index-DEu85xBt.d.ts → index-CdSNXLOx.d.ts} +1 -1
- package/dist/_dts/{index-Dbd0Sn0G.d.ts → index-CyQhZuhM.d.ts} +49 -3
- package/dist/_dts/{index-C39F9KaB.d.ts → index-D2y4Iy-d.d.ts} +1 -1
- package/dist/_dts/{index-BtnsA14K.d.ts → index-DRxgeK8L.d.ts} +4 -3
- package/dist/_dts/{index-Du1IRglc.d.ts → index-FstkyqQB.d.ts} +2 -2
- package/dist/_dts/{index-Jlcq6w69.d.ts → index-G2p-HOrK.d.ts} +3 -3
- package/dist/_dts/{index-8CN0Nd-Z.d.ts → index-rhMSu0oY.d.ts} +2 -2
- package/dist/_dts/{loadContent-BPfAAZDW.d.ts → loadContent-DiLZoInK.d.ts} +7 -7
- package/dist/_dts/{resolvePageContent-DWbrtKf8.d.ts → resolvePageContent-CWUnipv8.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 +6 -6
- package/dist/_dts/sdk/src/config/index.d.ts +6 -6
- package/dist/_dts/sdk/src/config/template-validation.d.ts +1 -1
- package/dist/_dts/sdk/src/config/validation.d.ts +1 -1
- package/dist/_dts/sdk/src/index.d.ts +8 -8
- package/dist/_dts/sdk/src/manifest/index.d.ts +3 -3
- package/dist/_dts/sdk/src/metadata/index.d.ts +1 -1
- package/dist/_dts/sdk/src/navigation/index.d.ts +2 -2
- package/dist/_dts/sdk/src/next/index.d.ts +7 -7
- package/dist/_dts/sdk/src/next/middleware.d.ts +2 -2
- package/dist/_dts/sdk/src/page-converter/index.d.ts +3 -3
- package/dist/_dts/sdk/src/portal/client.d.ts +1 -1
- package/dist/_dts/sdk/src/prebuild/index.d.ts +1 -1
- package/dist/_dts/sdk/src/preview-next/before-render.d.ts +2 -2
- package/dist/_dts/sdk/src/preview-next/client/index.d.ts +2 -2
- package/dist/_dts/sdk/src/preview-next/client/runtime.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/client.d.ts +2 -2
- package/dist/_dts/sdk/src/rendering/index.d.ts +13 -7
- 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/{types-CfNG5koF.d.ts → types-BmtrA45p.d.ts} +2 -2
- package/dist/_dts/{types-CVv2H4AT.d.ts → types-CalL7aKP.d.ts} +7 -7
- package/dist/_dts/{types-ClZ-BQL_.d.ts → types-DFOqkClJ.d.ts} +3 -3
- package/dist/_dts/{validation-BJ6Lf_Dr.d.ts → validation-G8MRoIhq.d.ts} +4 -4
- package/dist/client/{BlocksIslandsHydrator-COqlgWYU.mjs → BlocksIslandsHydrator-DLCXwe30.mjs} +20 -20
- package/dist/client/{BookingMailingListNote-CFYPDEHH.mjs → BookingMailingListNote-BV5-50F0.mjs} +1 -1
- package/dist/client/{CalendarNavigationChevron-COBVxgHb.mjs → CalendarNavigationChevron-CVLAHdZG.mjs} +6 -6
- package/dist/client/{CheckboxChoice-C7X9dJ8A.mjs → CheckboxChoice-Dtgp3OU8.mjs} +1 -1
- package/dist/client/{DemoBookingPortalAccess-CvT0E9AR.mjs → DemoBookingPortalAccess-B3caCnTT.mjs} +5 -5
- package/dist/client/{DemoPortalSignInLink-EBOBN5dT.mjs → DemoPortalSignInLink-Ct8JMKW0.mjs} +1 -1
- package/dist/client/{EventCalendar.client-U6pKcntV.mjs → EventCalendar.client-ffa6920T.mjs} +9 -9
- package/dist/client/{EventCombined.client-CNzwEHws.mjs → EventCombined.client-zm0W2G79.mjs} +8 -8
- package/dist/client/{EventEmbeddedCheckoutStep-B9yAWV_k.mjs → EventEmbeddedCheckoutStep-CPPE2rWS.mjs} +1 -1
- package/dist/client/{EventItem-M5rpaHxi.mjs → EventItem-CND3mfra.mjs} +91 -15
- package/dist/client/{EventListWeekNavigation-D4ieBLDY.mjs → EventListWeekNavigation-D8QdxL_f.mjs} +1 -1
- package/dist/client/{EventListing.client-B8F40Rmn.mjs → EventListing.client-CaoRZUI9.mjs} +3 -3
- package/dist/client/{EventListing.view-k4lhuCn5.mjs → EventListing.view-BfnOmxYD.mjs} +7 -56
- package/dist/client/{EventRegistrationPayment-C3g8_Hqb.mjs → EventRegistrationPayment-Dfu3RSL2.mjs} +10 -10
- package/dist/client/{LocationMapActions-CAjt7qVo.mjs → LocationMapActions-wlyxASdT.mjs} +2 -2
- package/dist/client/{MapDrawingSvg-_aIK2ojv.mjs → MapDrawingSvg-B9oKSitp.mjs} +1 -1
- package/dist/client/{Page-DJBIQBOw.mjs → Page-BEF9HrAy.mjs} +584 -251
- package/dist/client/{StepIndicator-CFacB1z6.mjs → StepIndicator-Bjx4faaw.mjs} +2 -2
- package/dist/client/{TabBarFragment-BLsfQskO.mjs → TabBarFragment-Cu7k_VSl.mjs} +1 -1
- package/dist/client/{ThemedButton-BWsDgjMC.mjs → ThemedButton-DclwabI7.mjs} +1 -1
- package/dist/client/{accordion-CtO2XF7M.mjs → accordion-lzM2nSZB.mjs} +1 -1
- package/dist/client/{booking-form.client-RICCQ0h2.mjs → booking-form.client-Bll4QwBi.mjs} +12 -12
- package/dist/client/{bookingForm-SvjLPx8i.mjs → bookingForm-Cq5fQ-vo.mjs} +4 -4
- package/dist/client/bookings.mjs +5 -5
- package/dist/client/{carousel-BR-zCD3O.mjs → carousel-CxerQwIx.mjs} +2 -2
- package/dist/client/{carousel.client-CEWtoZd3.mjs → carousel.client-CVUXq8Mb.mjs} +1 -1
- package/dist/client/{cart-C6YpKbZZ.mjs → cart-X-m0isoI.mjs} +3 -3
- package/dist/client/{cart.client-dC938WrX.mjs → cart.client-CJbzWIl0.mjs} +1 -1
- package/dist/client/{checkout-Dy9RlREI.mjs → checkout-Gd0O_fGH.mjs} +3 -3
- package/dist/client/{checkout.client-CefG0d2F.mjs → checkout.client-Baee6Jsm.mjs} +1 -1
- package/dist/client/client.mjs +2 -2
- package/dist/client/{context-BFwxgZpB.mjs → context-Bg0SFWcM.mjs} +1 -1
- package/dist/client/{cta-DtA42Xio.mjs → cta-HffyM4MA.mjs} +1 -1
- package/dist/client/{dateFormatting-yP1B7F0O.mjs → dateFormatting-CV45BH5M.mjs} +1 -1
- package/dist/client/{demoPortalMagicLink-WOiT5Ryi.mjs → demoPortalMagicLink-CDWheSjI.mjs} +1 -1
- package/dist/client/{enhanceHeaderSection-Dh8c_Lq-.mjs → enhanceHeaderSection-BqVDXL0D.mjs} +3 -3
- package/dist/client/{event-details.client-BFgsLqTj.mjs → event-details.client-SFtS9OkF.mjs} +1 -1
- package/dist/client/{event-registration.client-BaXZ1-Ky.mjs → event-registration.client-CguNVIFY.mjs} +13 -13
- package/dist/client/{eventCalendar-COLwF80U.mjs → eventCalendar-DSGG35jd.mjs} +4 -4
- package/dist/client/{eventCombined-D3Ltwu03.mjs → eventCombined-Oe-PiChx.mjs} +4 -4
- package/dist/client/{eventDetails-CBrkimXu.mjs → eventDetails-BhcTT6P3.mjs} +2 -2
- package/dist/client/{eventListing-CedKVA1S.mjs → eventListing-BS0kBEgI.mjs} +4 -4
- package/dist/client/{eventRegistration-DkQQfR1b.mjs → eventRegistration-B82SHv7j.mjs} +4 -4
- package/dist/client/{form-XFy9uXSJ.mjs → form-DAIUrVXb.mjs} +3 -3
- package/dist/client/{form.client-B0iancFK.mjs → form.client-BoAkhoh_.mjs} +4 -4
- package/dist/client/{form.parts-DMbolu9Y.mjs → form.parts-1VnasOK8.mjs} +3 -3
- package/dist/client/{formatDate-Jm5MQOCA.mjs → formatDate-BKil_Psb.mjs} +1 -1
- package/dist/client/gifting/client.mjs +3 -3
- package/dist/client/{headerSection-WjlECjtV.mjs → headerSection-CyuHk8Ei.mjs} +2 -2
- package/dist/client/mediaAssets-CGJE1Omu.mjs +43 -0
- package/dist/client/{mediaContext-CNzWmoA4.mjs → mediaContext-DIkX2S-X.mjs} +1 -1
- package/dist/client/{newsletter-form.client-D-XwJTjN.mjs → newsletter-form.client-CCdyHx0B.mjs} +5 -5
- package/dist/client/{newsletter-form.parts-H92f30y0.mjs → newsletter-form.parts-Dl8AjsXW.mjs} +2 -2
- package/dist/client/{newsletterForm-DMuxzu6I.mjs → newsletterForm-qFWLZJui.mjs} +3 -3
- package/dist/client/{noop-B3RNPVrt.mjs → noop-4XFGzJpT.mjs} +3 -3
- package/dist/client/portal/client.mjs +12 -12
- package/dist/client/{product-detail.client-B3HuuykE.mjs → product-detail.client-Tq4S99ce.mjs} +1 -1
- package/dist/client/{product-list.client-CzsDrHQO.mjs → product-list.client-CuL5jB1w.mjs} +1 -1
- package/dist/client/{productDetail-CbBUVWgd.mjs → productDetail-BRqgcotZ.mjs} +3 -3
- package/dist/client/{productList-vqOKH2mh.mjs → productList-EK9Um-oh.mjs} +3 -3
- package/dist/client/{propsDecoder-CkSUep5a.mjs → propsDecoder-VD4arFq1.mjs} +3 -3
- package/dist/client/{registry.server-cZ24QwtW.mjs → registry.server-qYbsatxH.mjs} +19 -19
- package/dist/client/rendering/client.mjs +26 -27
- package/dist/client/rendering/islands.mjs +1 -1
- package/dist/client/rendering.mjs +19 -19
- package/dist/client/{richText-coerce-DDcCKvBJ.mjs → richText-coerce-CW8CFk8v.mjs} +1 -1
- package/dist/client/{routeIslandApiConfig-DYBioANh.mjs → routeIslandApiConfig-CnZ_1ol2.mjs} +1 -1
- package/dist/client/{schema-DNHLlze-.mjs → schema-BFwQDvJL.mjs} +846 -497
- package/dist/client/{shop-CF0dhnfH.mjs → shop-CTUaT57E.mjs} +3 -3
- package/dist/client/{shop-commerce-DQznNBEo.mjs → shop-commerce-BWwbsm_-.mjs} +11 -11
- package/dist/client/{shop-commerce-store-Ba8zPlIg.mjs → shop-commerce-store-15UII0y3.mjs} +1 -1
- package/dist/client/{shop.client-DqfYoqWH.mjs → shop.client-UWgdmJBm.mjs} +12 -12
- package/dist/client/{shop.interactive-CreQ0I7i.mjs → shop.interactive-Cf_kASpd.mjs} +44 -26
- package/dist/client/{shopShared-D-yh-P7g.mjs → shopShared-Bi8d584P.mjs} +2 -2
- package/dist/client/{site-styles-B9HgmY07.mjs → site-styles-dy54AUdz.mjs} +747 -32
- package/dist/client/{timetableModel-DCdVErTJ.mjs → timetableModel-Bi8ruFgB.mjs} +10 -10
- package/dist/client/{useAvailableSlots-Cvgdp2DH.mjs → useAvailableSlots-DiLbDqM3.mjs} +3 -3
- package/dist/client/{useBookingNowIso-DrTnGNzD.mjs → useBookingNowIso-CWIiqPd0.mjs} +1 -1
- package/dist/client/{useDiscountApply-CULjnXGl.mjs → useDiscountApply-ChtszhF9.mjs} +2 -2
- package/dist/client/{useDiscountCodeUi-Gn_m7e0o.mjs → useDiscountCodeUi-B0Z7n2tZ.mjs} +1 -1
- package/dist/client/{useEventPagination-CsysCF22.mjs → useEventPagination-DRrATQHQ.mjs} +6 -6
- package/dist/client/{view-BpBjo9Te.mjs → view-OvsxzgxP.mjs} +7 -7
- package/dist/client/{view-DMyTchi7.mjs → view-yUIfWX3S.mjs} +4 -4
- package/dist/client/{wizardSteps-BO2OmMO9.mjs → wizardSteps-kbONzKUv.mjs} +5 -5
- package/dist/preview-next/before-render.mjs +1 -1
- package/dist/preview-next/chrome.css +1 -1
- package/dist/preview-next/client/{EventEmbeddedCheckoutStep-DLsSmZbO.mjs → EventEmbeddedCheckoutStep-DzoFjIqB.mjs} +1 -1
- package/dist/preview-next/client/{PreviewEditorSidebar-ChrW9VEo.mjs → PreviewEditorSidebar-BhgPyyUW.mjs} +10 -8
- package/dist/preview-next/client/{PreviewEditorUI-VaHvYtrA.mjs → PreviewEditorUI-lndKKBtB.mjs} +151 -126
- package/dist/preview-next/client/{SdkPreviewModeRuntime-DWwktlWs.mjs → SdkPreviewModeRuntime-Bk7On_EM.mjs} +139 -1264
- package/dist/preview-next/client/{SdkPreviewModeRuntime-Bz7jR6nl.mjs → SdkPreviewModeRuntime-DCDDXDlt.mjs} +1 -1
- package/dist/preview-next/client/{ThemedButton-CHKOWXxl.mjs → ThemedButton-nUnE3iMv.mjs} +403 -66
- package/dist/preview-next/client/{previewAuthStore-C0VUwEHz.mjs → previewAuthStore-DHtSQIBE.mjs} +12933 -11769
- package/dist/preview-next/client/{previewChromeSurface-Dhyx2YrS.mjs → previewChromeSurface-CxQ6dZ8D.mjs} +1 -1
- package/dist/preview-next/client/runtime.mjs +3 -3
- package/dist/preview-next/client/{sdk-runtime-C2GWOCyj.mjs → sdk-runtime-DSZv7Vfm.mjs} +1 -1
- package/dist/preview-next/client/{siteStyleAccess-DHyzUpv4.mjs → siteStyleAccess-Chq5KKKh.mjs} +3782 -2453
- package/dist/preview-next/client/{spinner-BeR2S8oG.mjs → spinner-CjxE3uws.mjs} +1 -1
- package/dist/preview-next/edit-map.css +37 -0
- package/dist/preview-next/keepAlive.mjs +1 -1
- package/dist/preview-next/maplibre-gl.css +1 -0
- package/dist/preview-next/middleware.mjs +1 -1
- package/dist/preview-next/{route-contract-CkrFDMrl.mjs → route-contract-CxCstfkP.mjs} +9 -0
- package/dist/preview-next/upload-structure.css +18 -0
- package/dist/server/{Block.shared-DxvNGDig.mjs → Block.shared-Dz9k8vCX.mjs} +16 -16
- package/dist/server/{bindings-BuhKvYkE.mjs → bindings-S-gCHhj5.mjs} +2 -2
- package/dist/server/{client-BobW6DOz.mjs → client-C2Q56xqV.mjs} +2 -2
- package/dist/server/config-validation.mjs +1 -1
- package/dist/server/config.mjs +2 -2
- package/dist/server/{effectiveNavLinkStyle-B-MKSt0p.mjs → effectiveNavLinkStyle-DLzJPcDL.mjs} +713 -12
- package/dist/server/index.mjs +3 -3
- package/dist/server/{loadContent-CCG_3mbY.mjs → loadContent-D7ItMsEl.mjs} +4 -4
- package/dist/server/loadPage-D2qvYV5g.mjs +2 -0
- package/dist/server/{loadPage-jntGoMrf.mjs → loadPage-DaPiPYUL.mjs} +2 -2
- package/dist/server/next.mjs +9 -9
- package/dist/server/{overrideResolution-BBOlgn4Z.mjs → overrideResolution-anoB3Kbn.mjs} +1 -1
- package/dist/server/{overrides-DByQwIyW.mjs → overrides-W1Cc6srh.mjs} +177 -80
- package/dist/server/page-converter.mjs +1 -1
- package/dist/server/{prebuild-DrwcTk2t.mjs → prebuild-BF9yNfCS.mjs} +1 -1
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/{prefetchBlockData-LfgxSJYE.mjs → prefetchBlockData-Cn9k3DW6.mjs} +10 -6
- package/dist/server/{publicProducts-8A3T5v4M.mjs → publicProducts-BVcJ6TG7.mjs} +11 -2
- package/dist/server/{registry-Digv02oV.mjs → registry-4ZF3bUuJ.mjs} +97 -42
- package/dist/server/rendering/server.mjs +4 -4
- package/dist/server/rendering.mjs +8 -8
- package/dist/server/{resolveBlockData-C23t8-77.mjs → resolveBlockData-BKQ1Fc0M.mjs} +1 -1
- package/dist/server/routing.mjs +1 -1
- package/dist/server/{schema-BiqpDRwB.mjs → schema-DgrigZq9.mjs} +4118 -3769
- package/dist/server/server.mjs +3 -3
- package/dist/server/{site-styles-DrkprQPL.mjs → site-styles-CxE9F3hj.mjs} +36 -22
- package/dist/server/{siteChromeOverlayClearance-BmKKkkbh.mjs → siteChromeOverlayClearance-OhS6f830.mjs} +161 -105
- package/dist/server/{src-08GY1njw.mjs → src-C44_fMy5.mjs} +291 -106
- package/dist/server/theme-bridge.mjs +1 -1
- package/dist/server/theme.mjs +1 -1
- package/dist/server/{themeAdmission-CSd_Vusz.mjs → themeAdmission-CVc04B9m.mjs} +2 -2
- package/dist/server/{validation-DdUTkBOZ.mjs → validation-BrbY0nxR.mjs} +2 -2
- package/dist/server/{version-DdIOqIDe.mjs → version-BBSk8uM6.mjs} +1 -1
- package/dist/styles/index.css +162 -72
- package/package.json +1 -1
- package/dist/client/mediaAssets-BkoW_PEn.mjs +0 -16
- package/dist/server/loadPage-Bk9HDh9K.mjs +0 -2
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { i as useOptionalPreviewLayout, t as PreviewQueryProvider } from "./PreviewQueryProvider-BC0V7iAR.mjs";
|
|
3
|
-
import {
|
|
4
|
-
import { $
|
|
3
|
+
import { Hn as defaultThemeTokens, Mr as asDesignBlockId, Sr as indexRenderableMediaAssets, U as parseThemeForPersistence, br as buildRenderableMediaAssetIndex, rn as textColorStyle, un as parseSurfaceTree, xr as renderableMediaAssetSchema$1, zr as assertNever$1 } from "./ThemedButton-nUnE3iMv.mjs";
|
|
4
|
+
import { $o as TabsList, $r as LINKED_CONTENT_ENTRY_META_KEY, Ai as blockLookFromContent, An as ApiRequestError, Ar as buildThemeDataAttrs, At as EditorProvider, B as useRetentionTicks, Bi as isRecord$5, Bn as clientComponentRegistry, Br as renderInlineText, Bs as parseFooterModuleId, Cn as decodePublicProductCategorySelectorQuery, Di as runTransforms, Dn as MediaEditorContextProvider, Do as getAtPath, Dr as getDefaultComponentRegistry, Ei as bodyCopyFragment, Er as mergeContentWithBlockStyleOverrides, Fi as loadedReadinessFact, Fr as buildAppointmentServicesView, G as EditorWriteSurface, Gi as inlineTextToPlainText, Gr as calendarWindowQuerySchema, Gs as readPublishedBlockPlacement, Hi as parseGeneratedIconAssetId, Hn as BlockApiProvider, Ho as CalloutDescription, Hr as Text$1, Hs as sameMailingListPlacementTargeting, Ht as useEditorUiStoreInstance, I as createEditorApiClientFactory, Ii as pageTemplateFromEntry, Ir as OFFERINGS_PREVIEW_EVENT_PRESET_DEFINITIONS, Is as cn, Ji as bindingSchema, Jr as resolveEntryRouteTarget, Jt as planLinkedSaveHandoverRetention, Ki as isInlineTextEmpty, Kr as publicEventsArraySchema, Ks as selectedContentVersionId, Li as unavailableReadinessFact, Ln as API_ENDPOINTS, Lr as offeringsListingFor, Mi as readRuntimeNow, Mr as buildLoadedOfferingsPreviewListing, Mt as createRoutingHelpers, Ni as resolveDateRuntimeContext, Nr as normalizeLocationMapSource, Ns as Button, Nt as createSnapshotFromPageRecord, Oi as defineFragment, Oo as siblingPath, Or as projectRecurringSchedule, Pi as admitReadinessFacts, Pr as resolveLocationMapLocation, Qn as isSupportedLoaderEndpoint, Qo as TabsContent, Qs as unsafeAsEditorBlockId, Qt as resolveRenderedValues, Sn as blocksKeys, Ti as ctaButton, Tn as deriveLaunchReadiness, U as EditLeaseDiscardedNotice, Ui as parseGeneratedIconSetId, Ur as RichText$1, Us as NO_BLOCK_VERSIONS, Ut as useOptionalEditorUiStoreInstance, V as VIEWING_PARTICIPATION, Vi as parseBlockIconValue, Vn as ImageResolveContextProvider, Vo as Callout, Vr as logger, Vs as parseMailingListPlacementTargeting, Vt as useEditorUiStore, W as EditLeaseModal, Wi as coerceInlineTextWithFallback, Wr as defaultTransforms, Ws as readEditorBlockVersionsFromPlacement, Xr as resolveRouteTarget, Xt as renderSourceFor, Yr as resolvePageRouteTarget, Yt as remoteDraftValues, Zo as Tabs, Zt as renderedFieldChanges, _i as testimonialsHeadingFragment, a as usePreviewAuth, ac as assertNever$2, ai as getCurrentResolveImageUrlContext, ao as formatSiteChromeBackgroundTokenLabel, as as DialogHeader, bi as ctaRowFragment, c as SessionJournalHost, ci as headingFragment, cr as offeringsPreviewBlockDefinition, di as faqHeadingFragment, ei as coerceLinkedContentEntriesPayload, en as unsafeAsLinkedContentEntryId, er as ThemeScopeCore, es as TabsTrigger, f as PreviewRichTextEditor, fi as blogFeaturedPostFragment, gi as testimonialsCarouselFragment, go as sectionTransitionVariantForBoundaryOptionId, h as PREVIEW_EDITABLE_OUTLINE, hi as formCopyFragment, ho as sectionTransitionFamilyForBoundaryOptionId, hr as validateManifestDraft, i as renewPreviewSession, ic as toUtcIsoDateTimeString, ii as buildResolveImageUrlContext, in as isEdited, ir as makeDefaultBlockComponent, is as DialogFooter, ji as readBlockComposition, jr as themeRuntimeScopeProps, jt as useEditor, ki as arrangementHooksFromContent, kn as useApiMediaUploader, kr as chosenString, kt as revealEditorElement, li as cardFragment, lr as publicRouteCandidatesSchema, m as PreviewTextEditor, mi as formEmbedFragment, mo as sectionTransitionFamilies, mr as compileManifestContentContract, n as initPreviewAuth, nn as editorAdmissionNotice, nr as resolveSdkFooterMode, ns as DialogContent, o as usePreviewToken, oi as setContextResolveImageUrlContext, or as getBlockDefinition, os as DialogTitle, p as PreviewInlineTextEditor, pi as singleButtonFragment, po as defaultSectionTransitionVariantForFamily, qr as bookingConsentCarrierSchema, qs as parseEditLeaseScope, qt as activeLinkedSaveHandover, r as registerPreviewRenewalFetcher, rn as baselineRevisionOf, rs as DialogDescription, s as SiteAdmissionObserver, si as richTextFragment, sn as canEditorWrite, sr as normalizeBlockContent, t as createGuardedPreviewApiClient, ti as getLinkedContentEntryMeta, ts as Dialog, u as renderSiteChromeBlock, ui as faqAccordionFragment, ur as SITE_CHROME_VISIBLE_HEADER_SELECTOR, v as EditableBlockProvider, vi as ctaCopyFragment, wn as DEFAULT_LAUNCH_READINESS_INPUT, wr as buildThemeRuntime, x as useEntryEditorController, xi as heroCopyFragment, y as EntryControllerProvider, yi as heroCtaRowFragment, z as createPageSurfaceEditorServices, zi as isObjectRecord, zn as unwrapResponse, zs as buildMailingListSignupBlockSourceRef } from "./previewAuthStore-DHtSQIBE.mjs";
|
|
5
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
|
|
6
|
+
import { $t as SiteDocumentLayout, A as resolveRuntimePreviewSourceForTheme, B as SiteChromeCustomizeProvider, Bt as CustomizeBackgroundColorPicker, D as PreviewThemeOverlayProvider, Dt as cyclePageDesignBlockLook, E as PreviewCompiledThemeProvider, Et as CustomizeBackgroundControlRows, F as entryFieldRebindingProjection, Ht as PreviewRenderPlanProjection, I as previewProjectionsFromAiOverlays, L as mergeResolvedDataContext, M as applyPreviewRuntimeContentProjections, Mt as lookPositionLabel, N as applyPreviewStructureProjections, Nt as lookTilePosition, O as usePreviewCompiledTheme, Ot as pageDesignLookPosition, P as blockHasPreviewContentFieldProjection, Qt as SITE_CHROME_CLASS_NAMES, R as renderedBlockContent, S as LookCyclePill, U as PreviewDesignCoordinatorProvider, Ut as usePreviewBlockCustomizeSelectionOptional, V as useSiteChromeCustomizeOptional, Vt as PreviewBlockCustomizeSelectionProvider, _ as useBlockCustomizeControls, a as sanitizeDashboardPath, an as toEditorPresentationPage, b as ArrangementModeSwitchPill, bt as PreviewPageDesignEditorStateProvider, cn as renderedJoinLayout, en as planSiteDocument, h as SiteFontStorageProvider, i as resolvePreviewDashboardSetupHandoff, in as selectBlockContent, j as applyPreviewContentFieldProjections, k as pageDesignRuntimeProjectionFromSource, ln as retargetJoinsAcrossOmissions, n as resolveSiteStyleAccess, nn as buildPageRenderPlan, on as composePageJoins, r as buildPreviewDashboardSetupUrl, rn as planArrangementContent, s as resolvePreviewSetupBannerModel, sn as joinSlotKey, t as canInspectSiteStyle, tn as ResponsiveScope, un as Toaster, w as useArrangementToolbar, xt as usePreviewPageDesignEditorState, y as ArrangementLookPill, z as withRenderedContentEntry } from "./siteStyleAccess-Chq5KKKh.mjs";
|
|
7
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-
|
|
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-CxQ6dZ8D.mjs";
|
|
9
9
|
import * as React$1 from "react";
|
|
10
|
-
import React, { Children, Fragment, cloneElement, createContext, isValidElement, useCallback, useContext, useEffect, useId, useLayoutEffect, useMemo, useReducer, useRef, useState
|
|
10
|
+
import React, { Children, Fragment, cloneElement, createContext, isValidElement, useCallback, useContext, useEffect, useId, useLayoutEffect, useMemo, useReducer, useRef, useState } from "react";
|
|
11
11
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
12
12
|
import { useQueryClient } from "@tanstack/react-query";
|
|
13
13
|
import { z } from "zod";
|
|
@@ -316,7 +316,7 @@ function getFragmentRegistry() {
|
|
|
316
316
|
}
|
|
317
317
|
//#endregion
|
|
318
318
|
//#region ../blocks/src/system/icons/generatedAssets.ts
|
|
319
|
-
function isRecord$
|
|
319
|
+
function isRecord$4(value) {
|
|
320
320
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
321
321
|
}
|
|
322
322
|
function generatedIconAssetRefKey(ref) {
|
|
@@ -326,11 +326,11 @@ function collectGeneratedIconAssetRefs(page) {
|
|
|
326
326
|
const blocks = [];
|
|
327
327
|
for (const block of page.blocks) {
|
|
328
328
|
if (block.kind !== "block.feature-cards" || typeof block.id !== "string") continue;
|
|
329
|
-
const content = isRecord$
|
|
329
|
+
const content = isRecord$4(block.draftContent) ? block.draftContent : isRecord$4(block.content) ? block.content : null;
|
|
330
330
|
const cards = Array.isArray(content?.cards) ? content.cards : [];
|
|
331
331
|
const refs = /* @__PURE__ */ new Map();
|
|
332
332
|
for (const card of cards) {
|
|
333
|
-
if (!isRecord$
|
|
333
|
+
if (!isRecord$4(card)) continue;
|
|
334
334
|
const icon = parseBlockIconValue(card.icon);
|
|
335
335
|
if (icon.kind !== "generated") continue;
|
|
336
336
|
const ref = {
|
|
@@ -420,98 +420,6 @@ function requireThemeResources(resources, blockKind) {
|
|
|
420
420
|
return resources;
|
|
421
421
|
}
|
|
422
422
|
//#endregion
|
|
423
|
-
//#region ../blocks/src/pageRenderJoins.ts
|
|
424
|
-
/**
|
|
425
|
-
* Re-points joins across omitted blocks. Pure over joins.
|
|
426
|
-
*
|
|
427
|
-
* Joins are keyed by adjacent block-id pairs, so dropping B from [A, B, C]
|
|
428
|
-
* removes the A→C join as well as B's own, because no A→C join was ever
|
|
429
|
-
* resolved. For each surviving pair the original join is kept when the pair
|
|
430
|
-
* was already adjacent. Across a gap, the treatment comes from the join
|
|
431
|
-
* entering the omitted run (A→first omitted), falling back to the one leaving
|
|
432
|
-
* it (last omitted→C). Nothing visual is carried: the survivors are composed
|
|
433
|
-
* from their own content afterwards.
|
|
434
|
-
*
|
|
435
|
-
* `survivors` are compared by identity against `originalBlocks`.
|
|
436
|
-
*/
|
|
437
|
-
function retargetJoinsAcrossOmissions(input) {
|
|
438
|
-
const { joins, originalBlocks, survivingBlocks } = input;
|
|
439
|
-
if (joins.length === 0) return joins;
|
|
440
|
-
if (originalBlocks.every((block) => survivingBlocks.has(block))) return joins;
|
|
441
|
-
const byPair = joinsByPair(joins);
|
|
442
|
-
const retargeted = [];
|
|
443
|
-
let previousSurvivor = null;
|
|
444
|
-
let run = [];
|
|
445
|
-
for (const block of originalBlocks) {
|
|
446
|
-
if (!survivingBlocks.has(block)) {
|
|
447
|
-
run.push(block);
|
|
448
|
-
continue;
|
|
449
|
-
}
|
|
450
|
-
if (previousSurvivor?.id && block.id) {
|
|
451
|
-
const join = run.length === 0 ? byPair.get(pairKey(previousSurvivor.id, block.id)) : joinAcrossRun(byPair, previousSurvivor.id, block.id, run);
|
|
452
|
-
if (join) retargeted.push(join);
|
|
453
|
-
}
|
|
454
|
-
previousSurvivor = block;
|
|
455
|
-
run = [];
|
|
456
|
-
}
|
|
457
|
-
return retargeted;
|
|
458
|
-
}
|
|
459
|
-
function joinAcrossRun(byPair, previousBlockId, nextBlockId, run) {
|
|
460
|
-
const firstOmittedId = run[0]?.id;
|
|
461
|
-
const lastOmittedId = run[run.length - 1]?.id;
|
|
462
|
-
const entering = firstOmittedId ? byPair.get(pairKey(previousBlockId, firstOmittedId)) : void 0;
|
|
463
|
-
const exiting = lastOmittedId ? byPair.get(pairKey(lastOmittedId, nextBlockId)) : void 0;
|
|
464
|
-
const donor = entering ?? exiting;
|
|
465
|
-
return donor ? {
|
|
466
|
-
previousBlockId,
|
|
467
|
-
nextBlockId,
|
|
468
|
-
treatment: donor.treatment
|
|
469
|
-
} : void 0;
|
|
470
|
-
}
|
|
471
|
-
/**
|
|
472
|
-
* The single composition site. For every adjacent pair of survivors with ids,
|
|
473
|
-
* finds its join and composes it from both survivors' final content: what
|
|
474
|
-
* each paints with and the frame each draws.
|
|
475
|
-
*/
|
|
476
|
-
function composePageJoins(input) {
|
|
477
|
-
const byPair = joinsByPair(input.joins);
|
|
478
|
-
return input.survivors.flatMap((previous, index) => {
|
|
479
|
-
const next = input.survivors[index + 1];
|
|
480
|
-
if (!next || !previous.id || !next.id) return [];
|
|
481
|
-
const join = byPair.get(pairKey(previous.id, next.id));
|
|
482
|
-
return [{
|
|
483
|
-
previousBlockId: previous.id,
|
|
484
|
-
nextBlockId: next.id,
|
|
485
|
-
join: join ? composeJoin(join, previous, next) : null
|
|
486
|
-
}];
|
|
487
|
-
});
|
|
488
|
-
}
|
|
489
|
-
function composeJoin(join, previous, next) {
|
|
490
|
-
return {
|
|
491
|
-
boundaryId: pairKey(join.previousBlockId, join.nextBlockId),
|
|
492
|
-
previousBlockId: join.previousBlockId,
|
|
493
|
-
nextBlockId: join.nextBlockId,
|
|
494
|
-
treatment: join.treatment,
|
|
495
|
-
outcome: composeBoundary(sectionFactsForContent(previous.content), sectionFactsForContent(next.content))
|
|
496
|
-
};
|
|
497
|
-
}
|
|
498
|
-
/** Placement, reserves and paint for a join that draws; null otherwise. */
|
|
499
|
-
function renderedJoinLayout(join) {
|
|
500
|
-
if (!join || join.outcome.kind !== "shown") return null;
|
|
501
|
-
return boundaryLayout(join.treatment, join.outcome.composition);
|
|
502
|
-
}
|
|
503
|
-
/** Joins with a missing id on either side cannot sit between two blocks. */
|
|
504
|
-
function joinsByPair(joins) {
|
|
505
|
-
return new Map(joins.flatMap((join) => join.previousBlockId && join.nextBlockId ? [[pairKey(join.previousBlockId, join.nextBlockId), join]] : []));
|
|
506
|
-
}
|
|
507
|
-
/** Slot lookup key for an adjacent pair, in the one boundary-id scheme. */
|
|
508
|
-
function joinSlotKey(previousBlockId, nextBlockId) {
|
|
509
|
-
return pairKey(previousBlockId, nextBlockId);
|
|
510
|
-
}
|
|
511
|
-
function pairKey(previousBlockId, nextBlockId) {
|
|
512
|
-
return makeBoundaryId(asDesignBlockId(previousBlockId), asDesignBlockId(nextBlockId));
|
|
513
|
-
}
|
|
514
|
-
//#endregion
|
|
515
423
|
//#region ../blocks/src/pageRendererBoundaries.tsx
|
|
516
424
|
function joinSlotsByPair(slots) {
|
|
517
425
|
return new Map(slots.map((slot) => [joinSlotKey(slot.previousBlockId, slot.nextBlockId), slot]));
|
|
@@ -738,473 +646,6 @@ function shouldDebugCustomBlocks() {
|
|
|
738
646
|
}
|
|
739
647
|
}
|
|
740
648
|
//#endregion
|
|
741
|
-
//#region ../blocks/src/pageRenderAdmission.ts
|
|
742
|
-
function toEditorPresentationPage(page) {
|
|
743
|
-
if (!page) return null;
|
|
744
|
-
return {
|
|
745
|
-
...page,
|
|
746
|
-
blocks: page.blocks.map((block) => ({
|
|
747
|
-
...block,
|
|
748
|
-
publishedPlacement: block.publishedPlacement,
|
|
749
|
-
presentationAdmission: { kind: "editor" }
|
|
750
|
-
}))
|
|
751
|
-
};
|
|
752
|
-
}
|
|
753
|
-
//#endregion
|
|
754
|
-
//#region ../blocks/src/system/data/selectBlockContent.ts
|
|
755
|
-
/** Canonical admitted content: legacy publishedContent never selects a version. */
|
|
756
|
-
function selectBlockContent(block, stage = "published") {
|
|
757
|
-
const source = stage === "preview" && block.draftContent ? block.draftContent : block.content;
|
|
758
|
-
return isObjectRecord(source) ? stripStaleTransitionStyleGroup(source) : {};
|
|
759
|
-
}
|
|
760
|
-
//#endregion
|
|
761
|
-
//#region ../blocks/src/pageRenderPlan.ts
|
|
762
|
-
/**
|
|
763
|
-
* Decides, once per page render, which blocks can render and what happens to
|
|
764
|
-
* the ones that cannot.
|
|
765
|
-
*
|
|
766
|
-
* Pure. Effects — logging in particular — belong at the call site, because this
|
|
767
|
-
* runs inside a `useMemo` whose recomputation React makes no promises about.
|
|
768
|
-
*/
|
|
769
|
-
function buildPageRenderPlan(input) {
|
|
770
|
-
const resolveTarget = createRenderTargetResolver(input);
|
|
771
|
-
const outcomes = input.page.blocks.map((block) => planPageBlock(block, input, resolveTarget));
|
|
772
|
-
const entries = outcomes.flatMap((outcome) => outcome.kind === "admitted" ? [outcome.entry] : []);
|
|
773
|
-
return {
|
|
774
|
-
entries: entries.map(applyArrangementRhythm),
|
|
775
|
-
omitted: outcomes.flatMap((outcome) => outcome.kind === "omitted" ? [outcome.omission] : []),
|
|
776
|
-
runtimeJoins: retargetJoinsAcrossOmissions({
|
|
777
|
-
joins: input.runtimeJoins ?? [],
|
|
778
|
-
originalBlocks: input.page.blocks,
|
|
779
|
-
survivingBlocks: new Set(entries.map((entry) => entry.block))
|
|
780
|
-
})
|
|
781
|
-
};
|
|
782
|
-
}
|
|
783
|
-
/**
|
|
784
|
-
* Mirrors the order of the checks `MemoBlockSection` used to make inline, so no
|
|
785
|
-
* case changes meaning: admission first, then definition/override resolution,
|
|
786
|
-
* then the layout requirement.
|
|
787
|
-
*/
|
|
788
|
-
function planBlock(block, renderableContent, resolveTarget, audience, siteStyleId) {
|
|
789
|
-
const common = {
|
|
790
|
-
block,
|
|
791
|
-
renderableContent
|
|
792
|
-
};
|
|
793
|
-
if (block.presentationAdmission.kind === "invalid") return {
|
|
794
|
-
...common,
|
|
795
|
-
kind: "diagnostic",
|
|
796
|
-
reason: {
|
|
797
|
-
kind: "invalid-admission",
|
|
798
|
-
blockKind: block.kind,
|
|
799
|
-
error: block.presentationAdmission.error
|
|
800
|
-
}
|
|
801
|
-
};
|
|
802
|
-
const { definition, systemDefinition, override } = resolveTarget(block.kind);
|
|
803
|
-
const isCustom = block.kind.startsWith("custom.");
|
|
804
|
-
if (!definition) return override ? {
|
|
805
|
-
...common,
|
|
806
|
-
kind: "override-only",
|
|
807
|
-
override
|
|
808
|
-
} : {
|
|
809
|
-
...common,
|
|
810
|
-
kind: "diagnostic",
|
|
811
|
-
reason: {
|
|
812
|
-
kind: "missing-definition",
|
|
813
|
-
blockKind: block.kind,
|
|
814
|
-
isCustom
|
|
815
|
-
}
|
|
816
|
-
};
|
|
817
|
-
const manifestHasLayout = Boolean(definition.manifest.layout) || Object.keys(definition.manifest.variants ?? {}).length > 0;
|
|
818
|
-
if (!override && !manifestHasLayout) return {
|
|
819
|
-
...common,
|
|
820
|
-
kind: "diagnostic",
|
|
821
|
-
reason: {
|
|
822
|
-
kind: "missing-layout",
|
|
823
|
-
blockKind: block.kind,
|
|
824
|
-
isCustom
|
|
825
|
-
}
|
|
826
|
-
};
|
|
827
|
-
return renderableBlockPlan(common, {
|
|
828
|
-
definition,
|
|
829
|
-
systemDefinition,
|
|
830
|
-
override
|
|
831
|
-
}, audience, siteStyleId);
|
|
832
|
-
}
|
|
833
|
-
function renderableBlockPlan(common, target, audience, siteStyleId) {
|
|
834
|
-
const { definition, systemDefinition, override } = target;
|
|
835
|
-
const renderableContent = planArrangementContent(common.block.kind, definition.manifest, common.renderableContent, audience);
|
|
836
|
-
const effectiveArrangementKey = resolveEffectiveArrangement({
|
|
837
|
-
manifest: arrangementManifestFromVariants(definition.manifest),
|
|
838
|
-
...definition.manifest.variantMeaning.kind !== "mode" ? { look: effectiveLookFromContent(renderableContent)?.look } : {},
|
|
839
|
-
storedVariant: parseStoredVariant(definition.manifest, renderableContent),
|
|
840
|
-
policy: siteStyleId === null ? void 0 : deriveSiteStyleBlockPolicy({
|
|
841
|
-
siteStyleId: asSiteStyleId(siteStyleId),
|
|
842
|
-
blockKind: common.block.kind
|
|
843
|
-
})
|
|
844
|
-
}).key;
|
|
845
|
-
return {
|
|
846
|
-
...common,
|
|
847
|
-
renderableContent,
|
|
848
|
-
kind: "renderable",
|
|
849
|
-
definition,
|
|
850
|
-
override,
|
|
851
|
-
effectiveArrangementKey,
|
|
852
|
-
effectiveListArrangementKey: definition.manifest.variantMeaning.kind === "mode" && renderableContent._lookMonthArrangement === void 0 ? resolveModeArrangement({
|
|
853
|
-
declaration: definition.manifest.variantMeaning,
|
|
854
|
-
content: renderableContent,
|
|
855
|
-
look: effectiveLookFromContent(renderableContent)?.look,
|
|
856
|
-
mode: readStoredMode({
|
|
857
|
-
...arrangementManifestFromVariants(definition.manifest),
|
|
858
|
-
variantMeaning: definition.manifest.variantMeaning
|
|
859
|
-
}, renderableContent)
|
|
860
|
-
}).key : null,
|
|
861
|
-
variantKey: systemDefinition ? effectiveArrangementKey : null,
|
|
862
|
-
managesOwnWrapper: Boolean(systemDefinition?.manifest.behaviours?.managesOwnWrapper)
|
|
863
|
-
};
|
|
864
|
-
}
|
|
865
|
-
/**
|
|
866
|
-
* Resolves definition + override once per block kind, and builds the
|
|
867
|
-
* custom-block registry at most once per plan rather than once per custom
|
|
868
|
-
* block, which is what the previous inline path did.
|
|
869
|
-
*/
|
|
870
|
-
function createRenderTargetResolver(input) {
|
|
871
|
-
const cache = /* @__PURE__ */ new Map();
|
|
872
|
-
let customRegistry = null;
|
|
873
|
-
const customRegistryOnce = () => {
|
|
874
|
-
customRegistry ?? (customRegistry = createCustomBlockRegistry({
|
|
875
|
-
sdkConfig: input.sdkConfig,
|
|
876
|
-
customBlocks: (input.customBlocks ?? []).map((manifest) => ({
|
|
877
|
-
manifest,
|
|
878
|
-
source: { kind: "managed-database" }
|
|
879
|
-
}))
|
|
880
|
-
}));
|
|
881
|
-
return customRegistry;
|
|
882
|
-
};
|
|
883
|
-
return (blockKind) => {
|
|
884
|
-
const cached = cache.get(blockKind);
|
|
885
|
-
if (cached) return cached;
|
|
886
|
-
const systemDefinition = getBlockDefinition(blockKind);
|
|
887
|
-
const resolved = {
|
|
888
|
-
definition: systemDefinition ?? (blockKind.startsWith("custom.") ? customRegistryOnce().findManifest(blockKind)?.descriptor.definition : void 0),
|
|
889
|
-
systemDefinition,
|
|
890
|
-
override: getBlockOverride(blockKind, input.blockOverrides)
|
|
891
|
-
};
|
|
892
|
-
cache.set(blockKind, resolved);
|
|
893
|
-
return resolved;
|
|
894
|
-
};
|
|
895
|
-
}
|
|
896
|
-
/**
|
|
897
|
-
* Look up a block override component by block kind.
|
|
898
|
-
* Supports both full ("block.hero") and short ("hero") keys.
|
|
899
|
-
*/
|
|
900
|
-
function getBlockOverride(blockKind, overrides) {
|
|
901
|
-
if (!overrides) return void 0;
|
|
902
|
-
if (overrides[blockKind]) return overrides[blockKind];
|
|
903
|
-
return overrides[blockKind.replace(/^block\./, "")];
|
|
904
|
-
}
|
|
905
|
-
/**
|
|
906
|
-
* Resolves block content based on stage priority.
|
|
907
|
-
* For draft/preview: draftContent takes priority over content.
|
|
908
|
-
* For published: content is the source of truth.
|
|
909
|
-
*/
|
|
910
|
-
/**
|
|
911
|
-
* The content a block renders with. Every render path (public, preview,
|
|
912
|
-
* templates, SDK) chooses content here, so this is also where a stale
|
|
913
|
-
* `site-style-transition-*` styleGroup is dropped; authored values survive.
|
|
914
|
-
*/
|
|
915
|
-
function getRenderableContent(block, previewStage = "published") {
|
|
916
|
-
return selectBlockContent(block, previewStage);
|
|
917
|
-
}
|
|
918
|
-
function arrangementRuntime(content) {
|
|
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
|
-
};
|
|
940
|
-
}
|
|
941
|
-
function effectiveLookFromContent(content) {
|
|
942
|
-
const value = content._effectiveLook;
|
|
943
|
-
return isObjectRecord(value) && isObjectRecord(value.look) ? restoreCompiledLook(value) : null;
|
|
944
|
-
}
|
|
945
|
-
function planArrangementContent(blockKind, manifest, content, audience) {
|
|
946
|
-
const runtime = arrangementRuntime(content);
|
|
947
|
-
if (!runtime) return content;
|
|
948
|
-
const mode = readStoredMode({
|
|
949
|
-
...arrangementManifestFromVariants(manifest),
|
|
950
|
-
variantMeaning: manifest.variantMeaning
|
|
951
|
-
}, content);
|
|
952
|
-
const selected = runtime.byMode[mode ?? "default"];
|
|
953
|
-
if (!selected) return content;
|
|
954
|
-
const { facts } = arrangementContentFacts(content);
|
|
955
|
-
const published = resolvePublishedLook({
|
|
956
|
-
look: selected.look,
|
|
957
|
-
contentFacts: facts,
|
|
958
|
-
audience,
|
|
959
|
-
catalogue: runtime.available.map((entry) => entry.look)
|
|
960
|
-
});
|
|
961
|
-
const effective = runtime.available.find((entry) => entry.look.id === published.id) ?? selected;
|
|
962
|
-
const { length, knobs } = resolveArrangementKnobs({
|
|
963
|
-
blockKind,
|
|
964
|
-
look: effective,
|
|
965
|
-
content
|
|
966
|
-
});
|
|
967
|
-
const values = Object.fromEntries(Object.entries(knobs).flatMap(([key, knob]) => knob.kind === "kept" ? [] : [[key, knob.value]]));
|
|
968
|
-
const effectiveContent = Object.fromEntries(Object.entries(values).map(([key, value]) => [key, effectiveContentKnobValue(blockKind, key, value)]));
|
|
969
|
-
const activeContent = Object.fromEntries(Object.entries(content).filter(([key]) => knobs[key]?.kind !== "kept"));
|
|
970
|
-
const photoContent = arrangementPhotoContent(activeContent, effectiveContent);
|
|
971
|
-
const visiblePhotos = arrangementContentFacts({
|
|
972
|
-
...activeContent,
|
|
973
|
-
...effectiveContent,
|
|
974
|
-
...photoContent
|
|
975
|
-
});
|
|
976
|
-
return {
|
|
977
|
-
...activeContent,
|
|
978
|
-
...mode !== null ? { variant: mode } : {},
|
|
979
|
-
...effectiveContent,
|
|
980
|
-
...photoContent,
|
|
981
|
-
...arrangementShapeContent(effective.look.id, {
|
|
982
|
-
...activeContent,
|
|
983
|
-
...effectiveContent
|
|
984
|
-
}),
|
|
985
|
-
...arrangementPanelContent(activeContent, effective, mode),
|
|
986
|
-
...arrangementQuoteContent(blockKind, effective, values),
|
|
987
|
-
_arrangementLooks: runtime,
|
|
988
|
-
_effectiveLook: effective,
|
|
989
|
-
_lookHooks: arrangementContentHooks(effective, mode, length, {
|
|
990
|
-
...facts,
|
|
991
|
-
photo: visiblePhotos.facts.photo
|
|
992
|
-
}, values, visiblePhotos.photoCount),
|
|
993
|
-
_effectiveKnobs: knobs,
|
|
994
|
-
_lookAudience: audience,
|
|
995
|
-
_lookSlots: arrangementContentSlots(blockKind),
|
|
996
|
-
blockLook: effective.look.id
|
|
997
|
-
};
|
|
998
|
-
}
|
|
999
|
-
/** Widget section hooks use the theme; hero background geometry never travels to list islands. */
|
|
1000
|
-
function arrangementContentSlots(blockKind) {
|
|
1001
|
-
return Object.fromEntries(arrangementSlotNames.filter((slot) => (!slot.startsWith("price-") || blockKind === "block.shop") && slot !== "schedule-section" && slot !== "shop-section" && (slot !== "background" || blockKind === "block.hero")).map((slot) => [slot, slot]));
|
|
1002
|
-
}
|
|
1003
|
-
/** C photo Looks render shape-specific crops without rewriting authored preferences. */
|
|
1004
|
-
function arrangementShapeContent(lookId, content) {
|
|
1005
|
-
if (lookId !== "intro-photo-beside-text" && lookId !== "media-text-photo-beside-text") return {};
|
|
1006
|
-
return content.imageShape === "circle" ? { aspectRatio: "1/1" } : content.imageShape === "arch" ? { aspectRatio: "4/5" } : {};
|
|
1007
|
-
}
|
|
1008
|
-
function arrangementQuoteContent(blockKind, effective, values) {
|
|
1009
|
-
if (blockKind !== "block.testimonials") return {};
|
|
1010
|
-
const single = effective.look.structure.byMode.default === "single";
|
|
1011
|
-
return {
|
|
1012
|
-
_quoteCount: single ? 1 : values.quoteCount === "all" ? null : Number(values.quoteCount),
|
|
1013
|
-
_quoteLoaderLimit: values.quoteCount === "all" && !single ? "all" : "50"
|
|
1014
|
-
};
|
|
1015
|
-
}
|
|
1016
|
-
function arrangementPanelContent(content, effective, mode) {
|
|
1017
|
-
if (mode === "calendar") return {
|
|
1018
|
-
_lookMonthArrangement: effective.look.structure.byMode.calendar,
|
|
1019
|
-
defaultCalendarView: "month"
|
|
1020
|
-
};
|
|
1021
|
-
const arrangement = effective.look.structure.byMode[mode ?? "default"];
|
|
1022
|
-
if (arrangement === "event-header") return { heading: void 0 };
|
|
1023
|
-
if (arrangement !== "compact" && arrangement !== "details-panel") return {};
|
|
1024
|
-
return {
|
|
1025
|
-
heading: void 0,
|
|
1026
|
-
_lookPanelHeading: content.heading
|
|
1027
|
-
};
|
|
1028
|
-
}
|
|
1029
|
-
function arrangementPhotoContent(content, knobs) {
|
|
1030
|
-
if (knobs.showPhotos !== false || !Array.isArray(content.cards)) return {};
|
|
1031
|
-
return { cards: content.cards.map((card) => {
|
|
1032
|
-
if (!isObjectRecord(card)) return card;
|
|
1033
|
-
const { media: _hiddenMedia, ...copy } = card;
|
|
1034
|
-
return copy;
|
|
1035
|
-
}) };
|
|
1036
|
-
}
|
|
1037
|
-
function arrangementContentFacts(content) {
|
|
1038
|
-
const photoCount = arrangementPhotoCount(content);
|
|
1039
|
-
const featured = typeof content.featured === "string" ? content.featured.trim().length > 0 : content.featured !== void 0 && content.featured !== null;
|
|
1040
|
-
return {
|
|
1041
|
-
photoCount,
|
|
1042
|
-
facts: {
|
|
1043
|
-
photo: photoCount > 0,
|
|
1044
|
-
facts: Array.isArray(content.facts) && content.facts.length > 0,
|
|
1045
|
-
featured,
|
|
1046
|
-
outcome: typeof content.outcome === "string" && content.outcome.length > 0,
|
|
1047
|
-
figure: typeof content.figure === "string" && content.figure.trim().length > 0,
|
|
1048
|
-
entrance: isObjectRecord(content.entrancePhoto)
|
|
1049
|
-
}
|
|
1050
|
-
};
|
|
1051
|
-
}
|
|
1052
|
-
/** The content stage owns media presence for every arrangement consumer. */
|
|
1053
|
-
function arrangementPhotoCount(content) {
|
|
1054
|
-
if (Array.isArray(content.cards)) return content.cards.filter((card) => isObjectRecord(card) && isObjectRecord(card.media)).length;
|
|
1055
|
-
if (Array.isArray(content.members)) return content.members.filter((member) => isObjectRecord(member) && isObjectRecord(member.photo)).length;
|
|
1056
|
-
if (Array.isArray(content.images)) return content.images.filter((item) => isObjectRecord(item) && isObjectRecord(item.image)).length;
|
|
1057
|
-
if (isObjectRecord(content.media) || isObjectRecord(content.entrancePhoto)) return 1;
|
|
1058
|
-
const section = isObjectRecord(content._sectionStyles) ? content._sectionStyles : {};
|
|
1059
|
-
return isObjectRecord((isObjectRecord(section.background) ? section.background : {}).image) ? 1 : 0;
|
|
1060
|
-
}
|
|
1061
|
-
function effectiveContentKnobValue(blockKind, key, value) {
|
|
1062
|
-
const facet = systemCustomizeFacetDefinitionsForBlock(blockKind).find((entry) => entry.target.kind === "content-field" && entry.target.field === key);
|
|
1063
|
-
return facet?.target.kind === "content-field" && facet.target.boolean ? value === "true" : value;
|
|
1064
|
-
}
|
|
1065
|
-
function arrangementContentHooks(effective, mode, length, facts, values, photoCount) {
|
|
1066
|
-
return {
|
|
1067
|
-
"data-look": effective.look.id,
|
|
1068
|
-
"data-treat": effective.treatment,
|
|
1069
|
-
"data-arrangement": effective.look.structure.byMode[mode ?? "default"],
|
|
1070
|
-
...mode !== null ? { "data-mode": mode } : {},
|
|
1071
|
-
...length !== null ? { "data-length": length } : {},
|
|
1072
|
-
...Object.fromEntries(Object.entries(facts).map(([key, value]) => [`data-has-${key}`, String(value)])),
|
|
1073
|
-
"data-photo-count": String(photoCount),
|
|
1074
|
-
...Object.fromEntries(Object.entries(values).map(([key, value]) => [`data-knob-${key === "titleSize" ? "headline" : key.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`)}`, value]))
|
|
1075
|
-
};
|
|
1076
|
-
}
|
|
1077
|
-
function applyArrangementRhythm(entry, position) {
|
|
1078
|
-
const runtime = arrangementRuntime(entry.renderableContent);
|
|
1079
|
-
const look = effectiveLookFromContent(entry.renderableContent);
|
|
1080
|
-
if (!runtime || !look) return entry;
|
|
1081
|
-
const rhythm = runtime.rhythm.length === 0 ? null : runtime.rhythm[position % runtime.rhythm.length];
|
|
1082
|
-
const content = entry.renderableContent;
|
|
1083
|
-
const resolved = resolveSectionBackground(parseCanonicalRuntimeBackground(content), null, rhythm, heroPhotoGround(entry));
|
|
1084
|
-
const updated = applyResolvedArrangementBackground(content, resolved);
|
|
1085
|
-
const surface = arrangementGroundToken(resolved);
|
|
1086
|
-
const grounded = resolveArrangementRoleSurfaces(look, runtime, resolved);
|
|
1087
|
-
const tinted = resolveArrangementTints(updated, grounded, runtime, surface) ?? grounded;
|
|
1088
|
-
return {
|
|
1089
|
-
...entry,
|
|
1090
|
-
renderableContent: {
|
|
1091
|
-
...updated,
|
|
1092
|
-
_effectiveLook: tinted,
|
|
1093
|
-
_lookHooks: {
|
|
1094
|
-
...isObjectRecord(updated._lookHooks) ? updated._lookHooks : {},
|
|
1095
|
-
"data-surface": surface
|
|
1096
|
-
}
|
|
1097
|
-
}
|
|
1098
|
-
};
|
|
1099
|
-
}
|
|
1100
|
-
function arrangementGroundToken(resolved) {
|
|
1101
|
-
if (resolved.kind === "base") return "background";
|
|
1102
|
-
switch (resolved.background.type) {
|
|
1103
|
-
case "image":
|
|
1104
|
-
case "video": return "media";
|
|
1105
|
-
case "color": return resolved.background.color ?? "background";
|
|
1106
|
-
case "gradient": return "gradient";
|
|
1107
|
-
}
|
|
1108
|
-
}
|
|
1109
|
-
function applyResolvedArrangementBackground(content, resolved) {
|
|
1110
|
-
const section = isObjectRecord(content._sectionStyles) ? content._sectionStyles : {};
|
|
1111
|
-
const photo = isObjectRecord(section.background) ? section.background.image : void 0;
|
|
1112
|
-
const ground = resolved.kind === "base" ? void 0 : resolved.background;
|
|
1113
|
-
const background = photo !== void 0 ? {
|
|
1114
|
-
...ground ?? {
|
|
1115
|
-
type: "color",
|
|
1116
|
-
color: "background"
|
|
1117
|
-
},
|
|
1118
|
-
image: photo
|
|
1119
|
-
} : ground;
|
|
1120
|
-
return {
|
|
1121
|
-
...content,
|
|
1122
|
-
_sectionStyles: {
|
|
1123
|
-
...section,
|
|
1124
|
-
background
|
|
1125
|
-
}
|
|
1126
|
-
};
|
|
1127
|
-
}
|
|
1128
|
-
function planPageBlock(block, input, resolveTarget) {
|
|
1129
|
-
const outcome = planBlock(block, getRenderableContent(block, input.previewStage), resolveTarget, input.audience, input.siteStyleId ?? null);
|
|
1130
|
-
if (outcome.kind !== "diagnostic") return {
|
|
1131
|
-
kind: "admitted",
|
|
1132
|
-
entry: outcome
|
|
1133
|
-
};
|
|
1134
|
-
const resolved = resolveTarget(block.kind);
|
|
1135
|
-
const debug = blockDiagnosticContext(resolved, input);
|
|
1136
|
-
return input.audience === "public" ? {
|
|
1137
|
-
kind: "omitted",
|
|
1138
|
-
omission: {
|
|
1139
|
-
blockId: block.id ?? null,
|
|
1140
|
-
blockKind: block.kind,
|
|
1141
|
-
reason: outcome.reason,
|
|
1142
|
-
override: resolved.override,
|
|
1143
|
-
debug
|
|
1144
|
-
}
|
|
1145
|
-
} : {
|
|
1146
|
-
kind: "admitted",
|
|
1147
|
-
entry: {
|
|
1148
|
-
...outcome,
|
|
1149
|
-
debug
|
|
1150
|
-
}
|
|
1151
|
-
};
|
|
1152
|
-
}
|
|
1153
|
-
function blockDiagnosticContext(resolved, input) {
|
|
1154
|
-
return {
|
|
1155
|
-
hasOverride: Boolean(resolved.override),
|
|
1156
|
-
sdkCustomBlocksCount: input.sdkConfig?.customBlocks?.length ?? 0,
|
|
1157
|
-
dbCustomBlocksCount: input.customBlocks?.length ?? 0,
|
|
1158
|
-
manifestKeys: resolved.definition ? Object.keys(resolved.definition.manifest).sort() : null
|
|
1159
|
-
};
|
|
1160
|
-
}
|
|
1161
|
-
function resolveArrangementTints(content, look, runtime, ground) {
|
|
1162
|
-
if (!look.surfaceTints) return null;
|
|
1163
|
-
const context = runtime.surfaceContext;
|
|
1164
|
-
const surfaces = arrangementSlotNames.flatMap((slot) => {
|
|
1165
|
-
const tint = look.surfaceTints?.[slot];
|
|
1166
|
-
if (!tint || tint.knob && content[tint.knob] !== true) return [];
|
|
1167
|
-
const owned = look.itemSurfaces[slot];
|
|
1168
|
-
return [[slot, resolveSurface({
|
|
1169
|
-
kind: "tint",
|
|
1170
|
-
base: owned?.kind === "owned" && owned.paint.kind === "solid" ? owned.paint.token : ground,
|
|
1171
|
-
source: tint.source,
|
|
1172
|
-
opacity: tint.opacity,
|
|
1173
|
-
gradient: tint.gradient
|
|
1174
|
-
}, context)]];
|
|
1175
|
-
});
|
|
1176
|
-
return {
|
|
1177
|
-
...look,
|
|
1178
|
-
itemSurfaces: {
|
|
1179
|
-
...look.itemSurfaces,
|
|
1180
|
-
...Object.fromEntries(surfaces)
|
|
1181
|
-
}
|
|
1182
|
-
};
|
|
1183
|
-
}
|
|
1184
|
-
function resolveArrangementRoleSurfaces(look, runtime, background) {
|
|
1185
|
-
const ground = deriveSectionGround(background, runtime.surfaceContext.palette);
|
|
1186
|
-
const style = {
|
|
1187
|
-
roleMap: look.roleMap,
|
|
1188
|
-
surfaces: runtime.surfaces,
|
|
1189
|
-
context: runtime.surfaceContext
|
|
1190
|
-
};
|
|
1191
|
-
const roleSurfaces = {
|
|
1192
|
-
card: resolveItemSurface("card", ground, style),
|
|
1193
|
-
statement: resolveItemSurface("statement", ground, style),
|
|
1194
|
-
highlight: resolveItemSurface("highlight", ground, style)
|
|
1195
|
-
};
|
|
1196
|
-
return {
|
|
1197
|
-
...look,
|
|
1198
|
-
ground,
|
|
1199
|
-
roleSurfaces,
|
|
1200
|
-
itemSurfaces: resolveLookSlotSurfaces(look.look, look.itemRoles, roleSurfaces)
|
|
1201
|
-
};
|
|
1202
|
-
}
|
|
1203
|
-
/** The arrangement key is resolved once by planBlock, including pinned Looks. */
|
|
1204
|
-
function heroPhotoGround(entry) {
|
|
1205
|
-
return entry.kind === "renderable" && entry.block.kind === "block.hero" ? { paintsGround: heroPhotoPaintsGround(entry.effectiveArrangementKey ?? void 0) } : void 0;
|
|
1206
|
-
}
|
|
1207
|
-
//#endregion
|
|
1208
649
|
//#region ../blocks/src/system/data/readinessFacts.ts
|
|
1209
650
|
const countSchema = z.array(z.unknown()).transform((entries) => entries.length);
|
|
1210
651
|
const formSchema = z.union([z.null(), z.object({
|
|
@@ -1325,7 +766,7 @@ function hydrateResolvedBookingConsentValue(value, context) {
|
|
|
1325
766
|
const hydratedItems = value.map((item) => hydrateResolvedBookingConsentValue(item, context));
|
|
1326
767
|
return hydratedItems.every((item, index) => item === value[index]) ? value : hydratedItems;
|
|
1327
768
|
}
|
|
1328
|
-
if (!isRecord$
|
|
769
|
+
if (!isRecord$5(value)) return value;
|
|
1329
770
|
if (isBookingConsentCarrier(value)) {
|
|
1330
771
|
const agreement = hydrateValue(value.agreement, context);
|
|
1331
772
|
return agreement === value.agreement ? value : {
|
|
@@ -1345,7 +786,7 @@ function hydrateValue(value, context) {
|
|
|
1345
786
|
const resolvedItems = value.map((item) => hydrateValue(item, context));
|
|
1346
787
|
return resolvedItems.every((item, index) => item === value[index]) ? value : resolvedItems;
|
|
1347
788
|
}
|
|
1348
|
-
if (isRecord$
|
|
789
|
+
if (isRecord$5(value)) {
|
|
1349
790
|
if (isInternalLink(value)) return hydrateInternalLink(value, context.routes);
|
|
1350
791
|
if (isPageLink(value)) return hydratePageLink(value, context);
|
|
1351
792
|
if (isEntryLink(value)) return hydrateEntryLink(value, context);
|
|
@@ -1410,7 +851,7 @@ function hydrateEntryLink(link, context) {
|
|
|
1410
851
|
//#region ../blocks/src/system/manifest/resolveBlockData.ts
|
|
1411
852
|
function resolveBlockData(blockId, dataLoaders, dataContext, routes) {
|
|
1412
853
|
const raw = blockId ? dataContext?.resolvedData?.[blockId] : void 0;
|
|
1413
|
-
if (isRecord$
|
|
854
|
+
if (isRecord$5(raw)) return routes ? hydrateResolvedBookingConsentLinks(raw, routes, dataContext?.pagesByIdentifier, dataContext?.entriesByIdentifier) : raw;
|
|
1414
855
|
return dataLoaders && typeof dataLoaders === "object" && Object.keys(dataLoaders).length > 0 ? {} : void 0;
|
|
1415
856
|
}
|
|
1416
857
|
//#endregion
|
|
@@ -1605,7 +1046,7 @@ function preparedBlockProps(entry, content, data, input) {
|
|
|
1605
1046
|
function buildBlockOverrideProps(input) {
|
|
1606
1047
|
const { block, dataContext } = input;
|
|
1607
1048
|
return {
|
|
1608
|
-
content: input.content,
|
|
1049
|
+
content: bindArrangementInkPolicy(input.content, input.themeResources),
|
|
1609
1050
|
dateContext: pageDateRuntimeContext(dataContext),
|
|
1610
1051
|
now: dataContext?.now,
|
|
1611
1052
|
...overrideThemeProps(input.themeResources),
|
|
@@ -1750,6 +1191,11 @@ function preparedPlanEntry(entry, prepared) {
|
|
|
1750
1191
|
prepared
|
|
1751
1192
|
};
|
|
1752
1193
|
}
|
|
1194
|
+
/** Compiled Looks share the render's authority, including transported item contexts. */
|
|
1195
|
+
function bindArrangementInkPolicy(content, theme) {
|
|
1196
|
+
const policy = theme.kind === "available" ? theme.tokens.solvedInks ?? "withhold" : "withhold";
|
|
1197
|
+
return Object.fromEntries(Object.entries(content).map(([key, value]) => [key, key === "_effectiveLook" || key === "_arrangementLooks" ? parseSurfaceTree(value, policy) : value]));
|
|
1198
|
+
}
|
|
1753
1199
|
//#endregion
|
|
1754
1200
|
//#region ../blocks/src/BlockErrorBoundary.tsx
|
|
1755
1201
|
/**
|
|
@@ -1819,7 +1265,7 @@ function EditorPageRenderer(props) {
|
|
|
1819
1265
|
}) });
|
|
1820
1266
|
}
|
|
1821
1267
|
function PageRendererCore(props) {
|
|
1822
|
-
const { page, audience, dataContext, routeMap
|
|
1268
|
+
const { page, audience, dataContext, routeMap } = props;
|
|
1823
1269
|
const imageResolveContext = React$1.useMemo(() => resolvePageRendererImageResolveContext(dataContext), [
|
|
1824
1270
|
dataContext?.imageResolveContext,
|
|
1825
1271
|
dataContext?.mediaAssets,
|
|
@@ -1847,16 +1293,20 @@ function PageRendererCore(props) {
|
|
|
1847
1293
|
themeResources,
|
|
1848
1294
|
imageResolveContext
|
|
1849
1295
|
]);
|
|
1850
|
-
const joinSlots = React$1.useMemo(() => joinSlotsByPair(preparation.joins), [preparation.joins]);
|
|
1851
1296
|
reportAndReplayOmissions({
|
|
1852
1297
|
plan,
|
|
1853
1298
|
preparation,
|
|
1854
1299
|
dataContext,
|
|
1855
1300
|
themeResources
|
|
1856
1301
|
});
|
|
1857
|
-
if (!page || preparation.entries.length === 0) return presentEmptyPage(audience);
|
|
1858
|
-
const resolvedRegistry = registry ?? getDefaultComponentRegistry();
|
|
1302
|
+
if (!page || preparation.entries.length === 0) return props.wrapPage ? props.wrapPage(plan, presentEmptyPage(audience)) : presentEmptyPage(audience);
|
|
1859
1303
|
setContextResolveImageUrlContext(imageResolveContext);
|
|
1304
|
+
const rendered = renderPreparedPage(props, preparation, themeResources, imageResolveContext);
|
|
1305
|
+
return props.wrapPage ? props.wrapPage(plan, rendered) : rendered;
|
|
1306
|
+
}
|
|
1307
|
+
function renderPreparedPage(props, preparation, themeResources, imageResolveContext) {
|
|
1308
|
+
const resolvedRegistry = props.registry ?? getDefaultComponentRegistry();
|
|
1309
|
+
const joinSlots = joinSlotsByPair(preparation.joins);
|
|
1860
1310
|
return /* @__PURE__ */ jsx("div", { children: preparation.entries.map((entry, index) => renderGuardedPlanEntry({
|
|
1861
1311
|
entry,
|
|
1862
1312
|
index,
|
|
@@ -2849,24 +2299,6 @@ function normalizePublicApiLoaderParams(endpoint, params, context) {
|
|
|
2849
2299
|
const Text = Text$1;
|
|
2850
2300
|
const RichText = RichText$1;
|
|
2851
2301
|
//#endregion
|
|
2852
|
-
//#region ../blocks/src/system/helpers/blockSectionForeground.ts
|
|
2853
|
-
/** Renderer admission supplies the variant; theme-core alone owns paint and foreground. */
|
|
2854
|
-
function resolveBlockSectionForeground(block, theme, audience) {
|
|
2855
|
-
const opening = planOpeningForegroundContent(block, audience);
|
|
2856
|
-
return resolveCompiledSectionForegroundFromContent(opening.content, expandPalette(theme.palette), opening.photo);
|
|
2857
|
-
}
|
|
2858
|
-
/** Apply the render plan's policy/content stage before measuring the opening. */
|
|
2859
|
-
function planOpeningForegroundContent(block, audience) {
|
|
2860
|
-
if (!block?.content) return { content: null };
|
|
2861
|
-
const definition = getBlockDefinition(block.kind);
|
|
2862
|
-
if (!definition) return { content: block.content };
|
|
2863
|
-
const content = planArrangementContent(block.kind, definition.manifest, block.content, audience);
|
|
2864
|
-
return {
|
|
2865
|
-
content,
|
|
2866
|
-
photo: block.kind === "block.hero" ? { paintsGround: heroPhotoPaintsGround(resolveBlockVariantKey(definition.manifest, content) ?? void 0) } : void 0
|
|
2867
|
-
};
|
|
2868
|
-
}
|
|
2869
|
-
//#endregion
|
|
2870
2302
|
//#region ../db/src/schemas/forms.ts
|
|
2871
2303
|
/**
|
|
2872
2304
|
* Form Settings Schemas
|
|
@@ -3396,7 +2828,7 @@ function parseRelativeStoragePath(value) {
|
|
|
3396
2828
|
if (!validated.ok) return validated;
|
|
3397
2829
|
return ok$1(brandRelativeStoragePath(validated.value));
|
|
3398
2830
|
}
|
|
3399
|
-
function isRecord$
|
|
2831
|
+
function isRecord$3(value) {
|
|
3400
2832
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
3401
2833
|
}
|
|
3402
2834
|
function parseFileKindJson(value) {
|
|
@@ -3617,7 +3049,7 @@ function parseEntitledCustomerAccessScopeJson(value) {
|
|
|
3617
3049
|
}
|
|
3618
3050
|
}
|
|
3619
3051
|
function requireRecord(value) {
|
|
3620
|
-
if (!isRecord$
|
|
3052
|
+
if (!isRecord$3(value)) return err("expected-object");
|
|
3621
3053
|
return ok(value);
|
|
3622
3054
|
}
|
|
3623
3055
|
function requireString(value) {
|
|
@@ -4007,7 +3439,7 @@ const DEFAULT_MESSAGES = {
|
|
|
4007
3439
|
update: "Failed to update media asset",
|
|
4008
3440
|
delete: "Failed to delete media asset"
|
|
4009
3441
|
};
|
|
4010
|
-
function isRecord$
|
|
3442
|
+
function isRecord$2(value) {
|
|
4011
3443
|
return typeof value === "object" && value !== null;
|
|
4012
3444
|
}
|
|
4013
3445
|
const normalizeLabels = (labels) => labels !== void 0 && labels.length > 0 ? labels.map((label) => label.trim()).filter((label) => label.length > 0).join(",") : void 0;
|
|
@@ -4041,7 +3473,7 @@ const filterUpdatePayload = (input) => {
|
|
|
4041
3473
|
return payload;
|
|
4042
3474
|
};
|
|
4043
3475
|
const extractErrorMessage = (body) => {
|
|
4044
|
-
if (!isRecord$
|
|
3476
|
+
if (!isRecord$2(body)) return typeof body === "string" && body.trim().length > 0 ? body : null;
|
|
4045
3477
|
for (const key of [
|
|
4046
3478
|
"error",
|
|
4047
3479
|
"message",
|
|
@@ -4054,11 +3486,11 @@ const extractErrorMessage = (body) => {
|
|
|
4054
3486
|
const details = body.details;
|
|
4055
3487
|
if (Array.isArray(details)) for (const entry of details) {
|
|
4056
3488
|
if (typeof entry === "string" && entry.trim().length > 0) return entry;
|
|
4057
|
-
if (isRecord$
|
|
3489
|
+
if (isRecord$2(entry) && typeof entry.message === "string" && entry.message.trim().length > 0) return entry.message;
|
|
4058
3490
|
}
|
|
4059
3491
|
const errors = body.errors;
|
|
4060
3492
|
if (Array.isArray(errors)) {
|
|
4061
|
-
for (const entry of errors) if (isRecord$
|
|
3493
|
+
for (const entry of errors) if (isRecord$2(entry) && typeof entry.message === "string" && entry.message.trim().length > 0) return entry.message;
|
|
4062
3494
|
}
|
|
4063
3495
|
return null;
|
|
4064
3496
|
};
|
|
@@ -4399,15 +3831,6 @@ function MediaEditorProvider({ siteId, apiClient, children, bucket = DEFAULT_MED
|
|
|
4399
3831
|
});
|
|
4400
3832
|
}
|
|
4401
3833
|
//#endregion
|
|
4402
|
-
//#region ../field-primitives/src/bindings/index.ts
|
|
4403
|
-
const BINDING_TRANSFORMS = {
|
|
4404
|
-
RICHTEXT_FIRST_PARAGRAPH: "richtext.firstParagraph",
|
|
4405
|
-
DATE_FORMAT_SHORT: "date.formatShort",
|
|
4406
|
-
DATE_FORMAT_LONG: "date.formatLong",
|
|
4407
|
-
TEXT_INLINE_TEXT: "text.inlineText"
|
|
4408
|
-
};
|
|
4409
|
-
Object.values(BINDING_TRANSFORMS);
|
|
4410
|
-
//#endregion
|
|
4411
3834
|
//#region ../preview-next/src/client/preview/PreviewAuthInit.tsx
|
|
4412
3835
|
function PreviewAuthInit({ children, session, siteId, siteSlug, pageId, token }) {
|
|
4413
3836
|
const lastInitRef = useRef(null);
|
|
@@ -4522,7 +3945,7 @@ function overlayValue(value, overlays) {
|
|
|
4522
3945
|
});
|
|
4523
3946
|
return changed ? next : value;
|
|
4524
3947
|
}
|
|
4525
|
-
if (!isRecord$
|
|
3948
|
+
if (!isRecord$1(value)) return value;
|
|
4526
3949
|
const match = matchingOverlay(value, overlays);
|
|
4527
3950
|
if (match) return overlaidEntry(value, match.meta, match.overlay);
|
|
4528
3951
|
let changed = false;
|
|
@@ -4581,7 +4004,7 @@ function renderedLinkedRevisions(dataContext) {
|
|
|
4581
4004
|
}
|
|
4582
4005
|
function linkedEntryOccurrences(value) {
|
|
4583
4006
|
if (Array.isArray(value)) return value.flatMap(linkedEntryOccurrences);
|
|
4584
|
-
if (!isRecord$
|
|
4007
|
+
if (!isRecord$1(value)) return [];
|
|
4585
4008
|
const meta = parseLinkedEntryMeta(value[LINKED_CONTENT_ENTRY_META_KEY]);
|
|
4586
4009
|
const nested = Object.entries(value).filter(([key]) => key !== LINKED_CONTENT_ENTRY_META_KEY).flatMap(([, child]) => linkedEntryOccurrences(child));
|
|
4587
4010
|
return meta ? [meta, ...nested] : nested;
|
|
@@ -4617,49 +4040,13 @@ function resolveOverlayTitle(content, meta) {
|
|
|
4617
4040
|
function parseLinkedEntryMeta(value) {
|
|
4618
4041
|
return getLinkedContentEntryMeta({ [LINKED_CONTENT_ENTRY_META_KEY]: value });
|
|
4619
4042
|
}
|
|
4620
|
-
function isRecord$
|
|
4043
|
+
function isRecord$1(value) {
|
|
4621
4044
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
4622
4045
|
}
|
|
4623
4046
|
function overlayRevision(overlay, meta) {
|
|
4624
4047
|
return overlay.optimisticHash === void 0 ? meta.optimisticHash : overlay.optimisticHash;
|
|
4625
4048
|
}
|
|
4626
4049
|
//#endregion
|
|
4627
|
-
//#region ../preview-next/src/client/blocks/renderPrecedence.ts
|
|
4628
|
-
/** A block's content as the preview renders it, from the tab's render source. */
|
|
4629
|
-
function renderedBlockContent(uiStore, blockId) {
|
|
4630
|
-
const state = uiStore.getState();
|
|
4631
|
-
return resolveRenderedValues(renderSourceFor(state.editability), state.drafts.getBlockSnapshot(blockId), remoteDraftValues(state.remoteDrafts, {
|
|
4632
|
-
kind: "block",
|
|
4633
|
-
id: blockId
|
|
4634
|
-
}));
|
|
4635
|
-
}
|
|
4636
|
-
/**
|
|
4637
|
-
* An entry template page renders the entry's own fields from `contentEntry`. The
|
|
4638
|
-
* server sent them as they were on load; the editor's rendered values (local
|
|
4639
|
-
* edits, then another tab's live draft) take over from there.
|
|
4640
|
-
*/
|
|
4641
|
-
function withRenderedContentEntry(dataContext, content) {
|
|
4642
|
-
if (!dataContext?.contentEntry || !content) return dataContext;
|
|
4643
|
-
return {
|
|
4644
|
-
...dataContext,
|
|
4645
|
-
contentEntry: {
|
|
4646
|
-
...dataContext.contentEntry,
|
|
4647
|
-
...content
|
|
4648
|
-
}
|
|
4649
|
-
};
|
|
4650
|
-
}
|
|
4651
|
-
/** Loader data fetched in the browser replaces the server's, block by block. */
|
|
4652
|
-
function mergeResolvedDataContext(dataContext, liveResolvedData) {
|
|
4653
|
-
if (!dataContext || !liveResolvedData) return dataContext;
|
|
4654
|
-
return {
|
|
4655
|
-
...dataContext,
|
|
4656
|
-
resolvedData: {
|
|
4657
|
-
...dataContext.resolvedData ?? {},
|
|
4658
|
-
...liveResolvedData
|
|
4659
|
-
}
|
|
4660
|
-
};
|
|
4661
|
-
}
|
|
4662
|
-
//#endregion
|
|
4663
4050
|
//#region ../preview-next/src/client/blocks/useLinkedSaveHandoverRetention.ts
|
|
4664
4051
|
/**
|
|
4665
4052
|
* The host's refresh of its server data: the same callback live drafts give a viewer
|
|
@@ -5083,6 +4470,57 @@ function PreviewEditingModePersistence({ siteId }) {
|
|
|
5083
4470
|
return null;
|
|
5084
4471
|
}
|
|
5085
4472
|
//#endregion
|
|
4473
|
+
//#region ../preview-next/src/client/preview/PreviewScrollViewport.tsx
|
|
4474
|
+
/** The canvas can remount when the split pane opens or a phone tab changes. */
|
|
4475
|
+
function PreviewScrollViewport({ children }) {
|
|
4476
|
+
const viewportRef = useRef(null);
|
|
4477
|
+
const selection = usePreviewBlockCustomizeSelectionOptional();
|
|
4478
|
+
const blockId = selection?.selectedBlockId;
|
|
4479
|
+
useEffect(() => {
|
|
4480
|
+
const viewport = viewportRef.current;
|
|
4481
|
+
if (!blockId || !viewport) return;
|
|
4482
|
+
const frames = { pending: 0 };
|
|
4483
|
+
const reveal = () => {
|
|
4484
|
+
if (document.documentElement.getAttribute("data-rb-preview-mode") !== "edit") return;
|
|
4485
|
+
const block = viewport.querySelector(`[data-block-id="${CSS.escape(blockId)}"]`);
|
|
4486
|
+
if (!block) return;
|
|
4487
|
+
observer.disconnect();
|
|
4488
|
+
revealEditorElement(block);
|
|
4489
|
+
};
|
|
4490
|
+
const observer = new MutationObserver(() => {
|
|
4491
|
+
cancelAnimationFrame(frames.pending);
|
|
4492
|
+
frames.pending = requestAnimationFrame(reveal);
|
|
4493
|
+
});
|
|
4494
|
+
observer.observe(document.documentElement, {
|
|
4495
|
+
attributes: true,
|
|
4496
|
+
attributeFilter: ["data-rb-preview-mode"]
|
|
4497
|
+
});
|
|
4498
|
+
observer.observe(viewport, {
|
|
4499
|
+
childList: true,
|
|
4500
|
+
subtree: true
|
|
4501
|
+
});
|
|
4502
|
+
frames.pending = requestAnimationFrame(reveal);
|
|
4503
|
+
return () => {
|
|
4504
|
+
cancelAnimationFrame(frames.pending);
|
|
4505
|
+
observer.disconnect();
|
|
4506
|
+
};
|
|
4507
|
+
}, [blockId, selection?.selection.kind === "selected" ? selection.selection.requestId : 0]);
|
|
4508
|
+
return /* @__PURE__ */ jsx("div", {
|
|
4509
|
+
className: "relative h-full min-h-0 overflow-hidden bg-muted/30",
|
|
4510
|
+
style: {
|
|
4511
|
+
contain: "layout paint",
|
|
4512
|
+
isolation: "isolate",
|
|
4513
|
+
transform: "translateZ(0)"
|
|
4514
|
+
},
|
|
4515
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
4516
|
+
ref: viewportRef,
|
|
4517
|
+
"data-preview-scroll-viewport": "",
|
|
4518
|
+
className: "relative flex h-full min-h-0 flex-col overflow-auto",
|
|
4519
|
+
children
|
|
4520
|
+
})
|
|
4521
|
+
});
|
|
4522
|
+
}
|
|
4523
|
+
//#endregion
|
|
5086
4524
|
//#region ../preview-next/src/client/preview/previewSetupGuidance.ts
|
|
5087
4525
|
function resolvePreviewSetupBannerState(input) {
|
|
5088
4526
|
if (input.authMode === "onboardingGrant") return input.dashboardUnlocked ? "dashboard_ready" : "awaiting_confirmation";
|
|
@@ -5437,29 +4875,29 @@ const INITIAL_ONBOARDING_CONFIRMATION_STATE = {
|
|
|
5437
4875
|
resendFeedback: null,
|
|
5438
4876
|
statusLoadFailed: false
|
|
5439
4877
|
};
|
|
5440
|
-
function isRecord
|
|
4878
|
+
function isRecord(value) {
|
|
5441
4879
|
return value !== null && typeof value === "object";
|
|
5442
4880
|
}
|
|
5443
4881
|
function getErrorMessageFromEnvelope(payload, fallback) {
|
|
5444
|
-
const error = isRecord
|
|
5445
|
-
const message = isRecord
|
|
4882
|
+
const error = isRecord(payload) ? payload.error : null;
|
|
4883
|
+
const message = isRecord(error) ? error.message : null;
|
|
5446
4884
|
return typeof message === "string" && message.trim().length > 0 ? message : fallback;
|
|
5447
4885
|
}
|
|
5448
4886
|
function isLaunchReadiness(value) {
|
|
5449
|
-
return isRecord
|
|
4887
|
+
return isRecord(value) && Array.isArray(value.requirements) && typeof value.pendingRequiredCount === "number" && typeof value.pendingRecommendedCount === "number" && typeof value.pendingOptionalCount === "number" && isRecord(value.goLiveDecision) && (value.goLiveDecision.kind === "allowed" || value.goLiveDecision.kind === "blocked");
|
|
5450
4888
|
}
|
|
5451
4889
|
function isOnboardingPreviewStatusResponse(value) {
|
|
5452
|
-
return isRecord
|
|
4890
|
+
return isRecord(value) && typeof value.dashboardUnlocked === "boolean" && typeof value.requiresEmailConfirmation === "boolean" && isLaunchReadiness(value.launchReadiness);
|
|
5453
4891
|
}
|
|
5454
4892
|
function isResendResult(value) {
|
|
5455
4893
|
if (value.result === "already_confirmed" || value.result === "limit_reached") return true;
|
|
5456
4894
|
return value.result === "resent" && typeof value.retryAfterSeconds === "number" && Number.isFinite(value.retryAfterSeconds) && value.retryAfterSeconds >= 0 && typeof value.limitReached === "boolean";
|
|
5457
4895
|
}
|
|
5458
4896
|
function isResendOnboardingPreviewConfirmationResponse(value) {
|
|
5459
|
-
return isRecord
|
|
4897
|
+
return isRecord(value) && isResendResult(value) && typeof value.dashboardUnlocked === "boolean" && typeof value.requiresEmailConfirmation === "boolean" && isLaunchReadiness(value.launchReadiness);
|
|
5460
4898
|
}
|
|
5461
4899
|
function getSuccessData(payload, isData) {
|
|
5462
|
-
if (!isRecord
|
|
4900
|
+
if (!isRecord(payload) || payload.success !== true || !isData(payload.data)) return null;
|
|
5463
4901
|
return payload.data;
|
|
5464
4902
|
}
|
|
5465
4903
|
function useOnboardingConfirmationCheck(input) {
|
|
@@ -7177,581 +6615,6 @@ function joinClassNames(...values) {
|
|
|
7177
6615
|
return className.length > 0 ? className : void 0;
|
|
7178
6616
|
}
|
|
7179
6617
|
//#endregion
|
|
7180
|
-
//#region ../preview-next/src/client/utils/path.ts
|
|
7181
|
-
const PATH_SEPARATOR_REGEX = /\./g;
|
|
7182
|
-
const BRACKET_ACCESS_REGEX = /\[([^\]]+)\]/g;
|
|
7183
|
-
function isRecord$1(value) {
|
|
7184
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
7185
|
-
}
|
|
7186
|
-
function isPathContainer(value) {
|
|
7187
|
-
return Array.isArray(value) || isRecord$1(value);
|
|
7188
|
-
}
|
|
7189
|
-
function createPathContainer(nextIsIndex) {
|
|
7190
|
-
return nextIsIndex ? [] : {};
|
|
7191
|
-
}
|
|
7192
|
-
function ensureContainerProperty(container, key, nextIsIndex) {
|
|
7193
|
-
const existing = Reflect.get(container, key);
|
|
7194
|
-
if (isPathContainer(existing)) return existing;
|
|
7195
|
-
const nextContainer = createPathContainer(nextIsIndex);
|
|
7196
|
-
Reflect.set(container, key, nextContainer);
|
|
7197
|
-
return nextContainer;
|
|
7198
|
-
}
|
|
7199
|
-
function parsePath(path) {
|
|
7200
|
-
if (Array.isArray(path)) return path;
|
|
7201
|
-
const segments = [];
|
|
7202
|
-
const parts = path.split(PATH_SEPARATOR_REGEX);
|
|
7203
|
-
for (const raw of parts) {
|
|
7204
|
-
if (!raw) continue;
|
|
7205
|
-
const baseMatch = raw.match(/^[^\[]+/);
|
|
7206
|
-
if (baseMatch) {
|
|
7207
|
-
const base = baseMatch[1] ?? baseMatch[0];
|
|
7208
|
-
if (/^\d+$/.test(base)) segments.push(Number(base));
|
|
7209
|
-
else segments.push(base);
|
|
7210
|
-
}
|
|
7211
|
-
const bracketMatches = raw.matchAll(BRACKET_ACCESS_REGEX);
|
|
7212
|
-
for (const match of bracketMatches) {
|
|
7213
|
-
const token = match[1] ?? "";
|
|
7214
|
-
if (token.startsWith("\"") || token.startsWith("'")) segments.push(token.slice(1, -1));
|
|
7215
|
-
else if (/^\d+$/.test(token)) segments.push(Number(token));
|
|
7216
|
-
else segments.push(token);
|
|
7217
|
-
}
|
|
7218
|
-
if (!baseMatch && !raw.includes("[")) segments.push(raw);
|
|
7219
|
-
}
|
|
7220
|
-
return segments;
|
|
7221
|
-
}
|
|
7222
|
-
function setAtPath(target, path, value) {
|
|
7223
|
-
const segments = parsePath(path);
|
|
7224
|
-
let current = target;
|
|
7225
|
-
for (let index = 0; index < segments.length; index += 1) {
|
|
7226
|
-
const segment = segments[index];
|
|
7227
|
-
if (segment === void 0) continue;
|
|
7228
|
-
const isLast = index === segments.length - 1;
|
|
7229
|
-
const nextIsIndex = typeof segments[index + 1] === "number";
|
|
7230
|
-
if (isLast) {
|
|
7231
|
-
if (typeof segment === "number") {
|
|
7232
|
-
if (Array.isArray(current)) current[segment] = value;
|
|
7233
|
-
} else Reflect.set(current, segment, value);
|
|
7234
|
-
return;
|
|
7235
|
-
}
|
|
7236
|
-
if (typeof segment === "number") {
|
|
7237
|
-
if (Array.isArray(current)) {
|
|
7238
|
-
const existing = current[segment];
|
|
7239
|
-
if (isPathContainer(existing)) current = existing;
|
|
7240
|
-
else {
|
|
7241
|
-
const nextContainer = createPathContainer(nextIsIndex);
|
|
7242
|
-
current[segment] = nextContainer;
|
|
7243
|
-
current = nextContainer;
|
|
7244
|
-
}
|
|
7245
|
-
continue;
|
|
7246
|
-
}
|
|
7247
|
-
current = ensureContainerProperty(current, String(segment), nextIsIndex);
|
|
7248
|
-
continue;
|
|
7249
|
-
}
|
|
7250
|
-
current = ensureContainerProperty(current, segment, nextIsIndex);
|
|
7251
|
-
}
|
|
7252
|
-
}
|
|
7253
|
-
//#endregion
|
|
7254
|
-
//#region ../preview-next/src/client/blocks/previewProjection/aiProposalProjection.ts
|
|
7255
|
-
function previewProjectionsFromAiOverlays(overlays) {
|
|
7256
|
-
if (!overlays) return [];
|
|
7257
|
-
const overrides = overlays.overrides ?? /* @__PURE__ */ new Map();
|
|
7258
|
-
const projections = [];
|
|
7259
|
-
if (overlays.structure) projections.push({
|
|
7260
|
-
kind: "structure-overlay",
|
|
7261
|
-
source: "ai-proposal",
|
|
7262
|
-
viewMode: overlays.viewMode,
|
|
7263
|
-
proposalId: overlays.structure.proposalId,
|
|
7264
|
-
includeUnspecified: overlays.structure.includeUnspecified,
|
|
7265
|
-
before: overlays.structure.before,
|
|
7266
|
-
after: overlays.structure.after
|
|
7267
|
-
});
|
|
7268
|
-
if (overrides.size > 0) projections.push({
|
|
7269
|
-
kind: "content-field-overrides",
|
|
7270
|
-
source: "ai-proposal",
|
|
7271
|
-
viewMode: overlays.viewMode,
|
|
7272
|
-
overrides
|
|
7273
|
-
});
|
|
7274
|
-
return projections;
|
|
7275
|
-
}
|
|
7276
|
-
function toStringArray(value) {
|
|
7277
|
-
return Array.isArray(value) ? value.filter((item) => typeof item === "string") : [];
|
|
7278
|
-
}
|
|
7279
|
-
function applyStructureProjection(blockItems, projection) {
|
|
7280
|
-
const order = projection.viewMode === "before" ? toStringArray(projection.before.blockIds) : toStringArray(projection.after.blockIds);
|
|
7281
|
-
if (order.length === 0) return blockItems.slice();
|
|
7282
|
-
const itemsById = /* @__PURE__ */ new Map();
|
|
7283
|
-
const unknownIdItems = [];
|
|
7284
|
-
for (const item of blockItems) if (typeof item.id === "string") itemsById.set(item.id, item);
|
|
7285
|
-
else unknownIdItems.push(item);
|
|
7286
|
-
const next = [];
|
|
7287
|
-
const orderedSet = new Set(order);
|
|
7288
|
-
const addedBlocksById = /* @__PURE__ */ new Map();
|
|
7289
|
-
for (const added of projection.after.addedBlocks ?? []) {
|
|
7290
|
-
if (!added || typeof added !== "object") continue;
|
|
7291
|
-
if (typeof added.id !== "string") continue;
|
|
7292
|
-
if (typeof added.kind !== "string") continue;
|
|
7293
|
-
addedBlocksById.set(added.id, {
|
|
7294
|
-
id: added.id,
|
|
7295
|
-
kind: added.kind,
|
|
7296
|
-
content: added.content ?? null
|
|
7297
|
-
});
|
|
7298
|
-
}
|
|
7299
|
-
for (const id of order) {
|
|
7300
|
-
const item = itemsById.get(id);
|
|
7301
|
-
if (item) {
|
|
7302
|
-
next.push(item);
|
|
7303
|
-
continue;
|
|
7304
|
-
}
|
|
7305
|
-
const added = addedBlocksById.get(id);
|
|
7306
|
-
if (added) next.push(added);
|
|
7307
|
-
}
|
|
7308
|
-
if (projection.includeUnspecified !== false) {
|
|
7309
|
-
for (const item of blockItems) if (typeof item.id === "string" && !orderedSet.has(item.id)) next.push(item);
|
|
7310
|
-
}
|
|
7311
|
-
if (unknownIdItems.length > 0) next.push(...unknownIdItems);
|
|
7312
|
-
return next;
|
|
7313
|
-
}
|
|
7314
|
-
function applyContentFieldOverrideProjection(blockId, content, projection) {
|
|
7315
|
-
if (projection.overrides.size === 0) return content;
|
|
7316
|
-
const prefix = `blocks.${blockId}.`;
|
|
7317
|
-
let next = null;
|
|
7318
|
-
for (const [editorPath, override] of projection.overrides.entries()) {
|
|
7319
|
-
if (!editorPath.startsWith(prefix)) continue;
|
|
7320
|
-
const fieldPath = editorPath.slice(prefix.length);
|
|
7321
|
-
if (!next) next = cloneRecord(content);
|
|
7322
|
-
const value = projection.viewMode === "after" ? override.after : override.before;
|
|
7323
|
-
setAtPath(next, parsePath(fieldPath), value);
|
|
7324
|
-
}
|
|
7325
|
-
return next ?? content;
|
|
7326
|
-
}
|
|
7327
|
-
function blockHasContentFieldOverrideProjection(blockId, projection) {
|
|
7328
|
-
if (projection.overrides.size === 0) return false;
|
|
7329
|
-
const prefix = `blocks.${blockId}.`;
|
|
7330
|
-
for (const editorPath of projection.overrides.keys()) if (editorPath.startsWith(prefix)) return true;
|
|
7331
|
-
return false;
|
|
7332
|
-
}
|
|
7333
|
-
function cloneRecord(value) {
|
|
7334
|
-
if (!value) return {};
|
|
7335
|
-
return JSON.parse(JSON.stringify(value));
|
|
7336
|
-
}
|
|
7337
|
-
//#endregion
|
|
7338
|
-
//#region ../preview-next/src/client/blocks/previewProjection/runtimeContentDecoration.ts
|
|
7339
|
-
function runtimeContentDecorationProjectionFromEditorModel(editorModel, surfaceResolutionContext, designRules, componentRules) {
|
|
7340
|
-
const compiled = compileEditorModelRuntime({
|
|
7341
|
-
editorModel,
|
|
7342
|
-
surfaceResolutionContext,
|
|
7343
|
-
designRules,
|
|
7344
|
-
componentRules
|
|
7345
|
-
});
|
|
7346
|
-
return {
|
|
7347
|
-
kind: "runtime-content-decoration",
|
|
7348
|
-
source: "page-design",
|
|
7349
|
-
fieldsByBlockId: runtimeFieldsByBlockId(compiled.blocks),
|
|
7350
|
-
joins: compiled.joins
|
|
7351
|
-
};
|
|
7352
|
-
}
|
|
7353
|
-
function runtimeFieldsByBlockId(blocks) {
|
|
7354
|
-
return new Map(blocks.map((block) => [block.blockId, block.fields]));
|
|
7355
|
-
}
|
|
7356
|
-
function applyRuntimeContentDecorationProjection(block, content, projection) {
|
|
7357
|
-
const blockId = designBlockIdFromBlockItem(block);
|
|
7358
|
-
const fields = blockId ? projection.fieldsByBlockId.get(blockId) : void 0;
|
|
7359
|
-
return applyCompiledRuntimeFieldsToContent(isRecord(content) ? content : {}, fields);
|
|
7360
|
-
}
|
|
7361
|
-
function designBlockIdFromBlockItem(block) {
|
|
7362
|
-
return typeof block.id === "string" && block.id.length > 0 ? asDesignBlockId(block.id) : null;
|
|
7363
|
-
}
|
|
7364
|
-
function isRecord(value) {
|
|
7365
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
7366
|
-
}
|
|
7367
|
-
//#endregion
|
|
7368
|
-
//#region ../blocks/src/bindings/types.ts
|
|
7369
|
-
/**
|
|
7370
|
-
* Available transform function names.
|
|
7371
|
-
*/
|
|
7372
|
-
const TRANSFORMS = BINDING_TRANSFORMS;
|
|
7373
|
-
const BINDING_SOURCES = [
|
|
7374
|
-
"field",
|
|
7375
|
-
"meta",
|
|
7376
|
-
"literal",
|
|
7377
|
-
"transform",
|
|
7378
|
-
"fallback"
|
|
7379
|
-
];
|
|
7380
|
-
//#endregion
|
|
7381
|
-
//#region ../blocks/src/bindings/index.ts
|
|
7382
|
-
/**
|
|
7383
|
-
* Resolves a binding map to actual content values.
|
|
7384
|
-
*
|
|
7385
|
-
* Returns only keys whose binding resolved to a non-null, non-undefined value.
|
|
7386
|
-
* To merge resolved bindings over a base content object (the dashboard
|
|
7387
|
-
* template preview's use case), see {@link applyBindingsToContent}.
|
|
7388
|
-
*
|
|
7389
|
-
* @param bindings - Map of field keys to binding descriptors
|
|
7390
|
-
* @param context - Entry data context (fields and meta)
|
|
7391
|
-
* @returns Resolved content object with actual values
|
|
7392
|
-
*
|
|
7393
|
-
* @example
|
|
7394
|
-
* ```typescript
|
|
7395
|
-
* const content = applyBindings(
|
|
7396
|
-
* {
|
|
7397
|
-
* headline: { source: 'meta', path: 'title' },
|
|
7398
|
-
* body: { source: 'field', path: 'content' },
|
|
7399
|
-
* },
|
|
7400
|
-
* {
|
|
7401
|
-
* fields: { content: 'Hello world' },
|
|
7402
|
-
* meta: { title: 'My Post', slug: 'my-post' },
|
|
7403
|
-
* }
|
|
7404
|
-
* );
|
|
7405
|
-
* // Result: { headline: 'My Post', body: 'Hello world' }
|
|
7406
|
-
* ```
|
|
7407
|
-
*/
|
|
7408
|
-
function applyBindings(bindings, context) {
|
|
7409
|
-
const result = {};
|
|
7410
|
-
for (const [key, bindingSpec] of Object.entries(bindings)) {
|
|
7411
|
-
if (isBindingDescriptor(bindingSpec)) {
|
|
7412
|
-
const value = resolveBindingValue(bindingSpec, context);
|
|
7413
|
-
if (value !== void 0 && value !== null) setBindingValue(result, key, value);
|
|
7414
|
-
continue;
|
|
7415
|
-
}
|
|
7416
|
-
if (typeof bindingSpec === "string") {
|
|
7417
|
-
const value = resolveBindingValue({
|
|
7418
|
-
source: "field",
|
|
7419
|
-
path: bindingSpec
|
|
7420
|
-
}, context);
|
|
7421
|
-
if (value !== void 0 && value !== null) setBindingValue(result, key, value);
|
|
7422
|
-
continue;
|
|
7423
|
-
}
|
|
7424
|
-
if (isRecord$7(bindingSpec)) {
|
|
7425
|
-
const nested = applyBindings(bindingSpec, context);
|
|
7426
|
-
if (Object.keys(nested).length > 0) setBindingValue(result, key, nested);
|
|
7427
|
-
}
|
|
7428
|
-
}
|
|
7429
|
-
return result;
|
|
7430
|
-
}
|
|
7431
|
-
/**
|
|
7432
|
-
* Resolve a binding map and merge the result over a base content object.
|
|
7433
|
-
*
|
|
7434
|
-
* Use this when a block has *some* hard-coded content (from a template's
|
|
7435
|
-
* `block.content`) and *some* values driven by template bindings against
|
|
7436
|
-
* an entry. The base provides defaults; resolved bindings override them.
|
|
7437
|
-
*
|
|
7438
|
-
* Same null-handling as {@link applyBindings}: keys whose binding resolves
|
|
7439
|
-
* to `null`/`undefined` do NOT overwrite the base. This means "no resolved
|
|
7440
|
-
* value" leaves the base value (or absence) intact, which is the correct
|
|
7441
|
-
* semantic for both the SDK/frontend render paths and the dashboard preview.
|
|
7442
|
-
*
|
|
7443
|
-
* Replaces the dashboard's bespoke `applyBindings` that lived in
|
|
7444
|
-
* `apps/dashboard/src/lib/templates/applyBindings.ts` — its divergent
|
|
7445
|
-
* "always-set-null" behaviour produced the `subheadline: null` regression
|
|
7446
|
-
* documented in Phase 1.
|
|
7447
|
-
*
|
|
7448
|
-
* @example
|
|
7449
|
-
* ```typescript
|
|
7450
|
-
* const content = applyBindingsToContent(
|
|
7451
|
-
* { eyebrow: 'Default eyebrow', headline: 'Default headline' },
|
|
7452
|
-
* { headline: { source: 'meta', path: 'title' } },
|
|
7453
|
-
* { fields: {}, meta: { title: 'Entry title' } },
|
|
7454
|
-
* );
|
|
7455
|
-
* // Result: { eyebrow: 'Default eyebrow', headline: 'Entry title' }
|
|
7456
|
-
* ```
|
|
7457
|
-
*/
|
|
7458
|
-
function applyBindingsToContent(baseContent, bindings, context) {
|
|
7459
|
-
return mergeResolvedBindings(baseContent, applyBindings(bindings, context));
|
|
7460
|
-
}
|
|
7461
|
-
function mergeResolvedBindings(base, resolved) {
|
|
7462
|
-
const merged = { ...base };
|
|
7463
|
-
for (const [key, resolvedValue] of Object.entries(resolved)) {
|
|
7464
|
-
const baseValue = merged[key];
|
|
7465
|
-
merged[key] = isRecord$7(baseValue) && isRecord$7(resolvedValue) ? mergeResolvedBindings(baseValue, resolvedValue) : resolvedValue;
|
|
7466
|
-
}
|
|
7467
|
-
return merged;
|
|
7468
|
-
}
|
|
7469
|
-
function setBindingValue(target, path, value) {
|
|
7470
|
-
const segments = path.split(".").map((segment) => segment.trim()).filter(Boolean);
|
|
7471
|
-
if (segments.length === 0) return;
|
|
7472
|
-
const firstSegment = segments[0];
|
|
7473
|
-
if (!firstSegment) return;
|
|
7474
|
-
if (segments.length === 1) {
|
|
7475
|
-
target[firstSegment] = value;
|
|
7476
|
-
return;
|
|
7477
|
-
}
|
|
7478
|
-
const isIndex = (segment) => /^\d+$/.test(segment);
|
|
7479
|
-
let current = target;
|
|
7480
|
-
for (let i = 0; i < segments.length; i++) {
|
|
7481
|
-
const segment = segments[i];
|
|
7482
|
-
if (!segment) return;
|
|
7483
|
-
const last = i === segments.length - 1;
|
|
7484
|
-
const nextSegment = segments[i + 1];
|
|
7485
|
-
if (last) {
|
|
7486
|
-
if (Array.isArray(current) && isIndex(segment)) {
|
|
7487
|
-
current[Number(segment)] = value;
|
|
7488
|
-
return;
|
|
7489
|
-
}
|
|
7490
|
-
if (isRecord$7(current)) current[segment] = value;
|
|
7491
|
-
return;
|
|
7492
|
-
}
|
|
7493
|
-
const nextWantsArray = typeof nextSegment === "string" && isIndex(nextSegment);
|
|
7494
|
-
if (Array.isArray(current) && isIndex(segment)) {
|
|
7495
|
-
const index = Number(segment);
|
|
7496
|
-
const existing = current[index];
|
|
7497
|
-
if (nextWantsArray) {
|
|
7498
|
-
if (!Array.isArray(existing)) current[index] = [];
|
|
7499
|
-
} else if (!isRecord$7(existing)) current[index] = {};
|
|
7500
|
-
current = current[index];
|
|
7501
|
-
continue;
|
|
7502
|
-
}
|
|
7503
|
-
if (isRecord$7(current)) {
|
|
7504
|
-
const existing = current[segment];
|
|
7505
|
-
if (nextWantsArray) {
|
|
7506
|
-
if (!Array.isArray(existing)) current[segment] = [];
|
|
7507
|
-
} else if (!isRecord$7(existing)) current[segment] = {};
|
|
7508
|
-
current = current[segment];
|
|
7509
|
-
continue;
|
|
7510
|
-
}
|
|
7511
|
-
return;
|
|
7512
|
-
}
|
|
7513
|
-
}
|
|
7514
|
-
/**
|
|
7515
|
-
* Resolves a single binding descriptor to its value.
|
|
7516
|
-
*/
|
|
7517
|
-
function resolveBindingValue(descriptor, context) {
|
|
7518
|
-
switch (descriptor.source) {
|
|
7519
|
-
case "field": return descriptor.path ? getPath(context.fields, descriptor.path) : void 0;
|
|
7520
|
-
case "meta": return descriptor.path ? getPath(context.meta, descriptor.path) : void 0;
|
|
7521
|
-
case "literal": return descriptor.value;
|
|
7522
|
-
case "transform": {
|
|
7523
|
-
const inputDescriptor = descriptor.input && isBindingDescriptorLike(descriptor.input) ? normalizeBindingInput(descriptor.input) : descriptor.path ? normalizeBindingInput(descriptor.path) : null;
|
|
7524
|
-
const inputValue = inputDescriptor ? resolveBindingValue(inputDescriptor, context) : void 0;
|
|
7525
|
-
return applyTransform(descriptor.transform, inputValue, context.dateContext);
|
|
7526
|
-
}
|
|
7527
|
-
case "fallback":
|
|
7528
|
-
for (const option of descriptor.options ?? []) {
|
|
7529
|
-
const normalized = normalizeBindingInput(option);
|
|
7530
|
-
if (!normalized) continue;
|
|
7531
|
-
const value = resolveBindingValue(normalized, context);
|
|
7532
|
-
if (value !== void 0 && value !== null && value !== "") return value;
|
|
7533
|
-
}
|
|
7534
|
-
return null;
|
|
7535
|
-
default: return null;
|
|
7536
|
-
}
|
|
7537
|
-
}
|
|
7538
|
-
/**
|
|
7539
|
-
* Gets a nested path from an object.
|
|
7540
|
-
*/
|
|
7541
|
-
function getPath(source, path) {
|
|
7542
|
-
const segments = path.split(".").map((segment) => segment.trim()).filter(Boolean);
|
|
7543
|
-
let current = source;
|
|
7544
|
-
for (const segment of segments) {
|
|
7545
|
-
if (!isRecord$7(current)) return void 0;
|
|
7546
|
-
current = current[segment];
|
|
7547
|
-
}
|
|
7548
|
-
return current;
|
|
7549
|
-
}
|
|
7550
|
-
/**
|
|
7551
|
-
* Applies a transform function to a value.
|
|
7552
|
-
*/
|
|
7553
|
-
function applyTransform(name, value, dateContext) {
|
|
7554
|
-
if (!name) return value;
|
|
7555
|
-
switch (name) {
|
|
7556
|
-
case TRANSFORMS.RICHTEXT_FIRST_PARAGRAPH: return extractFirstParagraph(value);
|
|
7557
|
-
case TRANSFORMS.DATE_FORMAT_SHORT: return formatDate(value, dateContext, { date: "short" });
|
|
7558
|
-
case TRANSFORMS.DATE_FORMAT_LONG: return formatDate(value, dateContext, {
|
|
7559
|
-
date: "long",
|
|
7560
|
-
includeTime: true
|
|
7561
|
-
});
|
|
7562
|
-
case TRANSFORMS.TEXT_INLINE_TEXT: return textToInlineText(value);
|
|
7563
|
-
default: return value;
|
|
7564
|
-
}
|
|
7565
|
-
}
|
|
7566
|
-
function textToInlineText(value) {
|
|
7567
|
-
if (typeof value !== "string") return null;
|
|
7568
|
-
return plainTextToInlineText(value);
|
|
7569
|
-
}
|
|
7570
|
-
/**
|
|
7571
|
-
* Extracts the first paragraph text from a TipTap/ProseMirror document.
|
|
7572
|
-
*
|
|
7573
|
-
* Accepts the canonical unwrapped form (`{ type: 'doc', content: [...] }`).
|
|
7574
|
-
*/
|
|
7575
|
-
function extractFirstParagraph(value) {
|
|
7576
|
-
if (!isRichTextDoc(value)) return null;
|
|
7577
|
-
for (const node of value.content) {
|
|
7578
|
-
if (!isRecord$7(node)) continue;
|
|
7579
|
-
if (node.type !== "paragraph" || !Array.isArray(node.content)) continue;
|
|
7580
|
-
const text = node.content.filter((item) => item.type === "text").map((item) => typeof item.text === "string" ? item.text : "").join("").trim();
|
|
7581
|
-
if (text.length > 0) return text;
|
|
7582
|
-
}
|
|
7583
|
-
return null;
|
|
7584
|
-
}
|
|
7585
|
-
/**
|
|
7586
|
-
* Type guard to check if a value is a valid binding descriptor.
|
|
7587
|
-
*/
|
|
7588
|
-
function isBindingDescriptor(value) {
|
|
7589
|
-
if (!isRecord$7(value) || typeof value.source !== "string") return false;
|
|
7590
|
-
if (!BINDING_SOURCES.includes(value.source)) return false;
|
|
7591
|
-
switch (value.source) {
|
|
7592
|
-
case "field":
|
|
7593
|
-
case "meta": return typeof value.path === "string";
|
|
7594
|
-
case "literal": return "value" in value;
|
|
7595
|
-
case "transform": return typeof value.transform === "string" && (value.input === void 0 || isBindingDescriptorLike(value.input)) && (value.path === void 0 || typeof value.path === "string");
|
|
7596
|
-
case "fallback": return Array.isArray(value.options);
|
|
7597
|
-
default: return false;
|
|
7598
|
-
}
|
|
7599
|
-
}
|
|
7600
|
-
/**
|
|
7601
|
-
* Type guard to check if a value is binding-descriptor-like (can be normalized).
|
|
7602
|
-
*/
|
|
7603
|
-
function isBindingDescriptorLike(value) {
|
|
7604
|
-
return isBindingDescriptor(value) || typeof value === "string" || isRecord$7(value) && typeof value.source === "string" && typeof value.path === "string";
|
|
7605
|
-
}
|
|
7606
|
-
/**
|
|
7607
|
-
* Normalizes a binding input to a binding descriptor.
|
|
7608
|
-
*
|
|
7609
|
-
* Converts string shorthand to field descriptors and validates
|
|
7610
|
-
* that objects have valid binding source values.
|
|
7611
|
-
*/
|
|
7612
|
-
function normalizeBindingInput(value) {
|
|
7613
|
-
if (isBindingDescriptor(value)) return value;
|
|
7614
|
-
if (typeof value === "string") return {
|
|
7615
|
-
source: "field",
|
|
7616
|
-
path: value
|
|
7617
|
-
};
|
|
7618
|
-
return null;
|
|
7619
|
-
}
|
|
7620
|
-
//#endregion
|
|
7621
|
-
//#region ../preview-next/src/client/blocks/previewProjection/entryFieldRebinding.ts
|
|
7622
|
-
/**
|
|
7623
|
-
* Only the entry fields that changed are bound in again: unchanged fields keep
|
|
7624
|
-
* the server's materialised value, which may be richer than the stored one
|
|
7625
|
-
* (media the loaders have hydrated, for instance).
|
|
7626
|
-
*/
|
|
7627
|
-
function entryFieldRebindingProjection(changedFields, dateContext) {
|
|
7628
|
-
return Object.keys(changedFields).length === 0 ? null : {
|
|
7629
|
-
kind: "entry-field-rebinding",
|
|
7630
|
-
source: "entry-draft",
|
|
7631
|
-
changedFields,
|
|
7632
|
-
dateContext
|
|
7633
|
-
};
|
|
7634
|
-
}
|
|
7635
|
-
/**
|
|
7636
|
-
* Binds the changed entry fields into a block with template bindings. A binding
|
|
7637
|
-
* whose source did not change resolves to nothing and leaves the content as it is.
|
|
7638
|
-
*/
|
|
7639
|
-
function applyEntryFieldRebindingProjection(block, content, projection) {
|
|
7640
|
-
if (!isRecord$7(block.bindings)) return content;
|
|
7641
|
-
return applyBindingsToContent(content ?? {}, block.bindings, {
|
|
7642
|
-
fields: { ...projection.changedFields },
|
|
7643
|
-
meta: {},
|
|
7644
|
-
dateContext: projection.dateContext
|
|
7645
|
-
});
|
|
7646
|
-
}
|
|
7647
|
-
//#endregion
|
|
7648
|
-
//#region ../preview-next/src/client/blocks/previewProjection/applyPreviewProjections.ts
|
|
7649
|
-
function applyPreviewStructureProjections(blockItems, projections) {
|
|
7650
|
-
return projections.reduce((current, projection) => {
|
|
7651
|
-
if (projection.kind !== "structure-overlay") return current;
|
|
7652
|
-
return applyStructureProjection(current, projection);
|
|
7653
|
-
}, blockItems.slice());
|
|
7654
|
-
}
|
|
7655
|
-
function applyPreviewContentFieldProjections(blockId, content, projections) {
|
|
7656
|
-
return projections.reduce((current, projection) => {
|
|
7657
|
-
if (projection.kind !== "content-field-overrides") return current;
|
|
7658
|
-
return applyContentFieldOverrideProjection(blockId, current, projection);
|
|
7659
|
-
}, content);
|
|
7660
|
-
}
|
|
7661
|
-
function applyPreviewRuntimeContentProjections(block, content, projections) {
|
|
7662
|
-
return projections.reduce((current, projection) => {
|
|
7663
|
-
if (projection.kind === "entry-field-rebinding") return applyEntryFieldRebindingProjection(block, current, projection);
|
|
7664
|
-
if (projection.kind !== "runtime-content-decoration") return current;
|
|
7665
|
-
return applyRuntimeContentDecorationProjection(block, current, projection);
|
|
7666
|
-
}, content);
|
|
7667
|
-
}
|
|
7668
|
-
function blockHasPreviewContentFieldProjection(blockId, projections) {
|
|
7669
|
-
return projections.some((projection) => projection.kind === "content-field-overrides" && blockHasContentFieldOverrideProjection(blockId, projection));
|
|
7670
|
-
}
|
|
7671
|
-
//#endregion
|
|
7672
|
-
//#region ../preview-next/src/client/blocks/pageDesignRuntimePreview.ts
|
|
7673
|
-
function resolveRuntimePreviewSourceForTheme(pageDesignState, theme) {
|
|
7674
|
-
if (!theme?.palette) return resolveRuntimePreviewSource({
|
|
7675
|
-
pageDesignState,
|
|
7676
|
-
surfaceResolutionContext: null
|
|
7677
|
-
});
|
|
7678
|
-
return resolveRuntimePreviewSource({
|
|
7679
|
-
pageDesignState,
|
|
7680
|
-
surfaceResolutionContext: surfaceResolutionContextFromTheme(theme),
|
|
7681
|
-
designRules: designRuntimeRulesForTheme(theme),
|
|
7682
|
-
componentRules: componentRuntimeRulesForTheme(theme)
|
|
7683
|
-
});
|
|
7684
|
-
}
|
|
7685
|
-
function applyPageDesignRuntimeFieldsToBlockContent(block, content, source) {
|
|
7686
|
-
if (source.kind === "preserve-server-runtime") return content;
|
|
7687
|
-
return applyPreviewRuntimeContentProjections(block, content, [runtimeContentDecorationProjectionFromEditorModel(source.editorModel, source.surfaceResolutionContext, source.designRules, source.componentRules)]);
|
|
7688
|
-
}
|
|
7689
|
-
function pageDesignRuntimeProjectionFromSource(source) {
|
|
7690
|
-
if (source.kind === "preserve-server-runtime") return null;
|
|
7691
|
-
return runtimeContentDecorationProjectionFromEditorModel(source.editorModel, source.surfaceResolutionContext, source.designRules, source.componentRules);
|
|
7692
|
-
}
|
|
7693
|
-
function resolveRuntimePreviewSource(input) {
|
|
7694
|
-
if (input.pageDesignState.kind === "loaded" && input.surfaceResolutionContext) return {
|
|
7695
|
-
kind: "apply-editor-model",
|
|
7696
|
-
editorModel: input.pageDesignState.editorModel,
|
|
7697
|
-
surfaceResolutionContext: input.surfaceResolutionContext,
|
|
7698
|
-
designRules: input.designRules,
|
|
7699
|
-
componentRules: input.componentRules
|
|
7700
|
-
};
|
|
7701
|
-
return { kind: "preserve-server-runtime" };
|
|
7702
|
-
}
|
|
7703
|
-
//#endregion
|
|
7704
|
-
//#region ../preview-next/src/client/preview/usePreviewOpeningTheme.ts
|
|
7705
|
-
const noSubscription = () => () => {};
|
|
7706
|
-
const noSnapshot = () => null;
|
|
7707
|
-
/** Select opening inputs; project canonical theme once, and retain it while ink is unchanged. */
|
|
7708
|
-
function usePreviewOpeningTheme(documentTheme) {
|
|
7709
|
-
const store = useOptionalEditorUiStoreInstance();
|
|
7710
|
-
const { state } = usePreviewPageDesignEditorState();
|
|
7711
|
-
const chrome = useSiteChromeCustomizeOptional();
|
|
7712
|
-
const { persistenceOverlayTheme: theme } = usePreviewThemeOverlay();
|
|
7713
|
-
const opening = state.kind === "loaded" ? state.editorModel.blocks[0] : null;
|
|
7714
|
-
const blockId = opening ? unsafeAsEditorBlockId(opening.blockId) : null;
|
|
7715
|
-
const selectContent = useCallback(() => store && blockId ? renderedBlockContent(store, blockId) : null, [store, blockId]);
|
|
7716
|
-
const content = useSyncExternalStore(store?.subscribe ?? noSubscription, selectContent, noSnapshot);
|
|
7717
|
-
const selectOverlays = useCallback(() => store?.getState().aiOverlays ?? null, [store]);
|
|
7718
|
-
const overlays = useSyncExternalStore(store?.subscribe ?? noSubscription, selectOverlays, noSnapshot);
|
|
7719
|
-
const recipe = previewOpeningHeaderRecipe(theme, chrome);
|
|
7720
|
-
const foreground = useMemo(() => {
|
|
7721
|
-
if (!opening || !blockId || !content || state.kind !== "loaded") return null;
|
|
7722
|
-
const projected = applyPreviewContentFieldProjections(blockId, content, overlays ? previewProjectionsFromAiOverlays(overlays) : []);
|
|
7723
|
-
const finalContent = applyPageDesignRuntimeFieldsToBlockContent({
|
|
7724
|
-
id: blockId,
|
|
7725
|
-
kind: opening.blockKind,
|
|
7726
|
-
content
|
|
7727
|
-
}, projected, resolveRuntimePreviewSourceForTheme(state, theme));
|
|
7728
|
-
return resolveBlockSectionForeground({
|
|
7729
|
-
kind: opening.blockKind,
|
|
7730
|
-
content: finalContent
|
|
7731
|
-
}, theme, "authoring");
|
|
7732
|
-
}, [
|
|
7733
|
-
opening,
|
|
7734
|
-
blockId,
|
|
7735
|
-
content,
|
|
7736
|
-
overlays,
|
|
7737
|
-
state,
|
|
7738
|
-
theme
|
|
7739
|
-
]);
|
|
7740
|
-
return useMemo(() => foreground && recipe ? applyPageOpeningForegroundToTheme(theme, recipe, { openingForeground: foreground }) : documentTheme, [
|
|
7741
|
-
theme,
|
|
7742
|
-
recipe,
|
|
7743
|
-
JSON.stringify(foreground),
|
|
7744
|
-
documentTheme
|
|
7745
|
-
]);
|
|
7746
|
-
}
|
|
7747
|
-
function previewOpeningHeaderRecipe(theme, chrome) {
|
|
7748
|
-
const header = chrome?.getSurfaceState("header");
|
|
7749
|
-
if (header?.kind !== "available" || header.surface !== "header") return null;
|
|
7750
|
-
const background = theme.header.background;
|
|
7751
|
-
if (background?.type === "color" && background.color !== "transparent") return null;
|
|
7752
|
-
return headerStyleRecipeForTheme(theme, header.currentId);
|
|
7753
|
-
}
|
|
7754
|
-
//#endregion
|
|
7755
6618
|
//#region ../preview-next/src/client/preview/previewDocumentFrame.ts
|
|
7756
6619
|
const PREVIEW_DOCUMENT_FRAME_CLASS_NAME = "builder-preview-document-frame";
|
|
7757
6620
|
function planPreviewDocumentFrame(input) {
|
|
@@ -7828,8 +6691,8 @@ function renderPreviewHeader(model, theme, fallback) {
|
|
|
7828
6691
|
});
|
|
7829
6692
|
}
|
|
7830
6693
|
function PreviewThemedSiteDocument({ children, themeRuntime = defaultPreviewThemeRuntime, useContainerResponsiveMode, viewportMode, viewportWidth, scale, contentHeight, scaleContainerRef, contentRef, staticHeaderNode, bannerNode, staticFooterNode, siteChromeRenderModel }) {
|
|
7831
|
-
const
|
|
7832
|
-
const effectiveTheme =
|
|
6694
|
+
const compiled = usePreviewCompiledTheme();
|
|
6695
|
+
const effectiveTheme = compiled.theme;
|
|
7833
6696
|
const headerNode = renderPreviewHeader(siteChromeRenderModel, effectiveTheme, staticHeaderNode);
|
|
7834
6697
|
const siteDocumentPlan = planPreviewSiteDocument(effectiveTheme, bannerNode, headerNode);
|
|
7835
6698
|
const footerNode = renderPreviewFooter(siteChromeRenderModel, effectiveTheme, staticFooterNode);
|
|
@@ -7846,7 +6709,7 @@ function PreviewThemedSiteDocument({ children, themeRuntime = defaultPreviewThem
|
|
|
7846
6709
|
footerNode,
|
|
7847
6710
|
children
|
|
7848
6711
|
});
|
|
7849
|
-
return renderThemedDocument(themeRuntime,
|
|
6712
|
+
return renderThemedDocument(themeRuntime, compiled, resolveDocumentResponsiveMode(themeRuntime, useContainerResponsiveMode), documentNode);
|
|
7850
6713
|
}
|
|
7851
6714
|
/**
|
|
7852
6715
|
* The shell marks whatever banner it's given, so preview chrome can stay clear
|
|
@@ -7868,10 +6731,12 @@ function renderPreviewFooter(model, theme, fallback) {
|
|
|
7868
6731
|
children: renderSiteChromeBlock(model, "footer", theme, { themeConfigOverrideMode: "ignore" })
|
|
7869
6732
|
});
|
|
7870
6733
|
}
|
|
7871
|
-
function renderThemedDocument(runtime,
|
|
6734
|
+
function renderThemedDocument(runtime, compiled, responsiveMode, documentNode) {
|
|
7872
6735
|
switch (runtime.kind) {
|
|
7873
|
-
case "cms-theme": return /* @__PURE__ */ jsx(
|
|
7874
|
-
|
|
6736
|
+
case "cms-theme": return /* @__PURE__ */ jsx(ThemeScopeCore, {
|
|
6737
|
+
...themeRuntimeScopeProps(compiled.runtime),
|
|
6738
|
+
dataAttrs: buildThemeDataAttrs(compiled.theme.axes, "theme-default", compiled.theme.skin),
|
|
6739
|
+
suppressHydrationWarning: true,
|
|
7875
6740
|
responsiveMode,
|
|
7876
6741
|
className: "rb-flex rb-flex-1 rb-flex-col",
|
|
7877
6742
|
children: documentNode
|
|
@@ -8046,26 +6911,11 @@ function resolveShellThemeRoles(props) {
|
|
|
8046
6911
|
}
|
|
8047
6912
|
const previewContainerResponsiveEnabled = process.env.NEXT_PUBLIC_ENABLE_PREVIEW_CONTAINER_RESPONSIVE !== "false";
|
|
8048
6913
|
const PreviewEditorSidebar = React.lazy(async () => {
|
|
8049
|
-
return { default: (await import("./PreviewEditorSidebar-
|
|
6914
|
+
return { default: (await import("./PreviewEditorSidebar-BhgPyyUW.mjs")).PreviewEditorSidebar };
|
|
8050
6915
|
});
|
|
8051
6916
|
const PreviewEditorUI = React.lazy(async () => {
|
|
8052
|
-
return { default: (await import("./PreviewEditorUI-
|
|
6917
|
+
return { default: (await import("./PreviewEditorUI-lndKKBtB.mjs")).PreviewEditorUI };
|
|
8053
6918
|
});
|
|
8054
|
-
const previewPaneContainmentStyle = {
|
|
8055
|
-
contain: "layout paint",
|
|
8056
|
-
isolation: "isolate",
|
|
8057
|
-
transform: "translateZ(0)"
|
|
8058
|
-
};
|
|
8059
|
-
function PreviewScrollViewport({ children }) {
|
|
8060
|
-
return /* @__PURE__ */ jsx("div", {
|
|
8061
|
-
className: "relative h-full min-h-0 overflow-hidden bg-muted/30",
|
|
8062
|
-
style: previewPaneContainmentStyle,
|
|
8063
|
-
children: /* @__PURE__ */ jsx("div", {
|
|
8064
|
-
className: "relative flex h-full min-h-0 flex-col overflow-auto",
|
|
8065
|
-
children
|
|
8066
|
-
})
|
|
8067
|
-
});
|
|
8068
|
-
}
|
|
8069
6919
|
function renderShellProviders(input) {
|
|
8070
6920
|
if (!input.themeRoles) return input.content;
|
|
8071
6921
|
const { props, themeRoles } = input;
|
|
@@ -8091,7 +6941,10 @@ function renderShellProviders(input) {
|
|
|
8091
6941
|
headerLogoContext: props.themeSelectionHeaderLogo,
|
|
8092
6942
|
siteStyleAccess: input.siteStyleAccess,
|
|
8093
6943
|
canOpenDesignEditor: props.entryData == null && props.pageId !== null && canInspectSiteStyle(input.siteStyleAccess),
|
|
8094
|
-
children:
|
|
6944
|
+
children: /* @__PURE__ */ jsx(PreviewCompiledThemeProvider, {
|
|
6945
|
+
responsiveMode: previewCompiledResponsiveMode(props),
|
|
6946
|
+
children: input.content
|
|
6947
|
+
})
|
|
8095
6948
|
}) })
|
|
8096
6949
|
});
|
|
8097
6950
|
}
|
|
@@ -8362,6 +7215,10 @@ function usePreviewDrawerOpen() {
|
|
|
8362
7215
|
const drawerOpen = useEditorUiStore((s) => s.drawerOpen);
|
|
8363
7216
|
return requestedEditingMode && drawerOpen;
|
|
8364
7217
|
}
|
|
7218
|
+
function previewCompiledResponsiveMode(props) {
|
|
7219
|
+
const runtime = props.themeRuntime;
|
|
7220
|
+
return runtime && runtime.kind !== "none" && runtime.responsiveMode ? runtime.responsiveMode : previewContainerResponsiveEnabled ? "container" : "viewport";
|
|
7221
|
+
}
|
|
8365
7222
|
//#endregion
|
|
8366
7223
|
//#region ../preview-next/src/client/preview/PreviewSessionJournalHost.tsx
|
|
8367
7224
|
/** Preview supplies its existing server refresh to the shared document-session host. */
|
|
@@ -8975,16 +7832,31 @@ function BlockToolbar({ placement = DEFAULT_PREVIEW_CHROME_FLOATING_PLACEMENT, .
|
|
|
8975
7832
|
})
|
|
8976
7833
|
]
|
|
8977
7834
|
});
|
|
8978
|
-
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
8979
|
-
|
|
8980
|
-
|
|
8981
|
-
|
|
8982
|
-
|
|
8983
|
-
|
|
8984
|
-
|
|
8985
|
-
|
|
8986
|
-
|
|
8987
|
-
|
|
7835
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
7836
|
+
/* @__PURE__ */ jsx("span", {
|
|
7837
|
+
ref: selection.probeRef,
|
|
7838
|
+
"aria-hidden": "true"
|
|
7839
|
+
}),
|
|
7840
|
+
/* @__PURE__ */ jsx(BlockSelectionFrame, {
|
|
7841
|
+
selected: selection.selected,
|
|
7842
|
+
element: selection.blockElement
|
|
7843
|
+
}),
|
|
7844
|
+
/* @__PURE__ */ jsx(ToolbarPlacement, {
|
|
7845
|
+
blockId: input.blockId,
|
|
7846
|
+
placement,
|
|
7847
|
+
selected: selection.selected,
|
|
7848
|
+
phone: selection.phone,
|
|
7849
|
+
children: row
|
|
7850
|
+
})
|
|
7851
|
+
] });
|
|
7852
|
+
}
|
|
7853
|
+
/** A separate frame preserves the site's own borders, shadows and outlines. */
|
|
7854
|
+
function BlockSelectionFrame({ selected, element }) {
|
|
7855
|
+
return selected && element ? createPortal(/* @__PURE__ */ jsx("div", {
|
|
7856
|
+
"aria-hidden": "true",
|
|
7857
|
+
"data-preview-block-selection-frame": "",
|
|
7858
|
+
className: "pointer-events-none absolute inset-0 z-10 border-2 border-sky-500"
|
|
7859
|
+
}), element) : null;
|
|
8988
7860
|
}
|
|
8989
7861
|
function useBlockToolbar(input) {
|
|
8990
7862
|
const uiStore = useEditorUiStoreInstance();
|
|
@@ -9032,7 +7904,6 @@ function useBlockToolbar(input) {
|
|
|
9032
7904
|
function useOpenBlockSidebar(blockId, uiStore) {
|
|
9033
7905
|
const selection = usePreviewBlockCustomizeSelectionOptional();
|
|
9034
7906
|
const open = () => {
|
|
9035
|
-
selection?.selectBlock(blockId);
|
|
9036
7907
|
selection?.inspectBlock(blockId);
|
|
9037
7908
|
uiStore.getState().setDrawerOpen(true);
|
|
9038
7909
|
};
|
|
@@ -9775,6 +8646,10 @@ function EditableDraftPageRenderer(props) {
|
|
|
9775
8646
|
return /* @__PURE__ */ jsx(EditorPageRenderer, {
|
|
9776
8647
|
...pageRendererProps,
|
|
9777
8648
|
page: renderPage,
|
|
8649
|
+
wrapPage: (plan, rendered) => /* @__PURE__ */ jsx(PreviewRenderPlanProjection, {
|
|
8650
|
+
plan,
|
|
8651
|
+
children: rendered
|
|
8652
|
+
}),
|
|
9778
8653
|
runtimeJoins,
|
|
9779
8654
|
registry: allowInlineEditing ? editorRegistry : pageRendererProps.registry ?? clientComponentRegistry,
|
|
9780
8655
|
wrapBlock: allowInlineEditing ? wrapBlockWithProvider : pageRendererProps.wrapBlock,
|