@riverbankcms/sdk 0.161.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-Bx4kLiTA.d.ts → BlocksIslandsHydrator-DYPGA_qh.d.ts} +1 -1
- package/dist/_dts/{Page-Dm7_P13o.d.ts → Page-zwnvFBPu.d.ts} +8 -8
- package/dist/_dts/{SdkPreviewMode-D7HdWWwF.d.ts → SdkPreviewMode-DukuJzGr.d.ts} +58 -91
- package/dist/_dts/{client-Ep0jI9eE.d.ts → client-Chh3bnXC.d.ts} +11 -3
- package/dist/_dts/{content-types-BgAzCrBc.d.ts → content-types-Bbzqw9J2.d.ts} +2 -2
- package/dist/_dts/{contracts-DUiOnj9e.d.ts → contracts-GJ1kGBsi.d.ts} +13 -4
- package/dist/_dts/{footerPageOutline-B-uXamTG.d.ts → footerPageOutline-BNMKhyvo.d.ts} +6 -6
- package/dist/_dts/{generatePageMetadata-BDkZYEcS.d.ts → generatePageMetadata-Ce0m1P3B.d.ts} +2 -2
- package/dist/_dts/{index-DvKQA6AZ.d.ts → index-C3mJvn27.d.ts} +4 -4
- package/dist/_dts/{schema-BHu0PYWl.d.ts → index-CaL0nKkl.d.ts} +4166 -3355
- package/dist/_dts/{index-KPrWM0KF.d.ts → index-CdSNXLOx.d.ts} +1 -1
- package/dist/_dts/{types-BR1Yboa9.d.ts → index-CyQhZuhM.d.ts} +3347 -1692
- package/dist/_dts/{index-BVkP8f70.d.ts → index-D2y4Iy-d.d.ts} +13 -2
- package/dist/_dts/{index-CSsfq6KG.d.ts → index-DRxgeK8L.d.ts} +11 -6
- package/dist/_dts/{index-CF6Cjs7b.d.ts → index-FstkyqQB.d.ts} +2 -2
- package/dist/_dts/{index-D_8uz4OP.d.ts → index-G2p-HOrK.d.ts} +3 -3
- package/dist/_dts/{index-ylivB7Jj.d.ts → index-rhMSu0oY.d.ts} +2 -2
- package/dist/_dts/{loadContent-DTjKOO-T.d.ts → loadContent-DiLZoInK.d.ts} +10 -7
- package/dist/_dts/{resolvePageContent-C1vA5c5w.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-D02ngcUH.d.ts → types-BmtrA45p.d.ts} +2 -2
- package/dist/_dts/{types-ZGUiHpDE.d.ts → types-CalL7aKP.d.ts} +7 -7
- package/dist/_dts/{types-CJXTCF_F.d.ts → types-DFOqkClJ.d.ts} +3 -3
- package/dist/_dts/{validation-BaV565gb.d.ts → validation-G8MRoIhq.d.ts} +4 -4
- package/dist/client/{BlocksIslandsHydrator-DTExCJsb.mjs → BlocksIslandsHydrator-DLCXwe30.mjs} +20 -19
- package/dist/client/{BookingMailingListNote-BDpxmn1p.mjs → BookingMailingListNote-BV5-50F0.mjs} +1 -1
- package/dist/client/{CalendarNavigationChevron-PeCiL82X.mjs → CalendarNavigationChevron-CVLAHdZG.mjs} +6 -6
- package/dist/client/{CheckboxChoice-DWexRLf6.mjs → CheckboxChoice-Dtgp3OU8.mjs} +1 -1
- package/dist/client/{DemoBookingPortalAccess-3zmIqakW.mjs → DemoBookingPortalAccess-B3caCnTT.mjs} +26 -10
- package/dist/client/{DemoPortalSignInLink-GHi-8BW5.mjs → DemoPortalSignInLink-Ct8JMKW0.mjs} +1 -1
- package/dist/client/{EventCalendar.client-BxQLY5cX.mjs → EventCalendar.client-ffa6920T.mjs} +16 -17
- package/dist/client/{EventCombined.client-B5bmQ03b.mjs → EventCombined.client-zm0W2G79.mjs} +8 -8
- package/dist/client/{EventEmbeddedCheckoutStep-CgMZ9TeU.mjs → EventEmbeddedCheckoutStep-CPPE2rWS.mjs} +1 -1
- package/dist/client/{EventItem-BEx-qiDE.mjs → EventItem-CND3mfra.mjs} +91 -15
- package/dist/client/{EventListWeekNavigation-CyH5tA6Y.mjs → EventListWeekNavigation-D8QdxL_f.mjs} +1 -1
- package/dist/client/{EventListing.client-D3uySdGP.mjs → EventListing.client-CaoRZUI9.mjs} +3 -3
- package/dist/client/{EventListing.view-9RFrBejr.mjs → EventListing.view-BfnOmxYD.mjs} +14 -70
- package/dist/client/{EventRegistrationPayment-CG2tQx8K.mjs → EventRegistrationPayment-Dfu3RSL2.mjs} +10 -10
- package/dist/client/LocationMapActions-wlyxASdT.mjs +62 -0
- package/dist/client/{LocationMapActions-Wsr83Q7q.mjs → MapDrawingSvg-B9oKSitp.mjs} +2 -70
- package/dist/client/{Page-Bf2nPACI.mjs → Page-BEF9HrAy.mjs} +2333 -492
- package/dist/client/{StepIndicator-CZweb1vs.mjs → StepIndicator-Bjx4faaw.mjs} +2 -2
- package/dist/client/{TabBarFragment-Bkgz67gt.mjs → TabBarFragment-Cu7k_VSl.mjs} +1 -1
- package/dist/client/{ThemedButton-CnyL3s1A.mjs → ThemedButton-DclwabI7.mjs} +1 -1
- package/dist/client/{accordion-TcimLLRQ.mjs → accordion-lzM2nSZB.mjs} +1 -1
- package/dist/client/{booking-form.client-q-RpJ4aF.mjs → booking-form.client-Bll4QwBi.mjs} +137 -60
- package/dist/client/{bookingForm-DjGfk3Wj.mjs → bookingForm-Cq5fQ-vo.mjs} +4 -4
- package/dist/client/bookings.mjs +5 -5
- package/dist/client/{carousel-CGAk6j0m.mjs → carousel-CxerQwIx.mjs} +2 -2
- package/dist/client/{carousel.client-ArlGmYWV.mjs → carousel.client-CVUXq8Mb.mjs} +1 -1
- package/dist/client/{cart-D_h3rAZ2.mjs → cart-X-m0isoI.mjs} +3 -3
- package/dist/client/{cart.client-DHOxZbJ7.mjs → cart.client-CJbzWIl0.mjs} +1 -1
- package/dist/client/{checkout-tC-3CzuM.mjs → checkout-Gd0O_fGH.mjs} +3 -3
- package/dist/client/{checkout.client-DsBb2Pkm.mjs → checkout.client-Baee6Jsm.mjs} +1 -1
- package/dist/client/client.mjs +34 -69
- package/dist/client/{context-9ZfMb6GA.mjs → context-Bg0SFWcM.mjs} +28 -1
- package/dist/client/{cta-D-ZqL7-e.mjs → cta-HffyM4MA.mjs} +1 -1
- package/dist/client/{dateFormatting-BCwLqYpW.mjs → dateFormatting-CV45BH5M.mjs} +39 -2
- package/dist/client/{demoPortalMagicLink-BxkSS9fx.mjs → demoPortalMagicLink-CDWheSjI.mjs} +1 -1
- package/dist/client/{enhanceHeaderSection-xg6to91E.mjs → enhanceHeaderSection-BqVDXL0D.mjs} +3 -3
- package/dist/client/{event-details.client-C670TgRd.mjs → event-details.client-SFtS9OkF.mjs} +2 -1
- package/dist/client/{event-registration.client-C6GApWTB.mjs → event-registration.client-CguNVIFY.mjs} +13 -13
- package/dist/client/{eventCalendar-CWc0dg9i.mjs → eventCalendar-DSGG35jd.mjs} +4 -4
- package/dist/client/{eventCombined-D4DbOrvQ.mjs → eventCombined-Oe-PiChx.mjs} +4 -4
- package/dist/client/{eventDetails-C2DfmbC0.mjs → eventDetails-BhcTT6P3.mjs} +2 -2
- package/dist/client/{eventListing-C_yXmHyz.mjs → eventListing-BS0kBEgI.mjs} +4 -4
- package/dist/client/{eventRegistration-DJuaCB-O.mjs → eventRegistration-B82SHv7j.mjs} +4 -4
- package/dist/client/{form-QZhtdFHA.mjs → form-DAIUrVXb.mjs} +3 -3
- package/dist/client/{form.client-CgvPACwG.mjs → form.client-BoAkhoh_.mjs} +4 -4
- package/dist/client/{form.parts-2uI0-5N-.mjs → form.parts-1VnasOK8.mjs} +3 -3
- package/dist/client/{formatDate-Danr0Nk4.mjs → formatDate-BKil_Psb.mjs} +1 -1
- package/dist/client/gifting/client.mjs +3 -3
- package/dist/client/{headerSection-DJdlLdvZ.mjs → headerSection-CyuHk8Ei.mjs} +2 -2
- package/dist/client/mediaAssets-CGJE1Omu.mjs +43 -0
- package/dist/client/mediaContext-DIkX2S-X.mjs +136 -0
- package/dist/client/{newsletter-form.client-Cbepz2KU.mjs → newsletter-form.client-CCdyHx0B.mjs} +5 -5
- package/dist/client/{newsletter-form.parts-DN8oMCQ0.mjs → newsletter-form.parts-Dl8AjsXW.mjs} +2 -2
- package/dist/client/{newsletterForm-wjLtW-wq.mjs → newsletterForm-qFWLZJui.mjs} +3 -3
- package/dist/client/{noop-B7H6gCbj.mjs → noop-4XFGzJpT.mjs} +19 -3
- package/dist/client/portal/client.mjs +1116 -85
- package/dist/client/{product-detail.client-CYTR165c.mjs → product-detail.client-Tq4S99ce.mjs} +1 -1
- package/dist/client/{product-list.client-B4vTvag8.mjs → product-list.client-CuL5jB1w.mjs} +1 -1
- package/dist/client/{productDetail-k8LEMSWn.mjs → productDetail-BRqgcotZ.mjs} +3 -3
- package/dist/client/{productList-DEo8Bqoe.mjs → productList-EK9Um-oh.mjs} +3 -3
- package/dist/client/{propsDecoder-G0j0HXBO.mjs → propsDecoder-VD4arFq1.mjs} +4 -3
- package/dist/client/{registry.server-BTmSXE3D.mjs → registry.server-qYbsatxH.mjs} +272 -68
- package/dist/client/rendering/client.mjs +26 -26
- package/dist/client/rendering/islands.mjs +1 -1
- package/dist/client/rendering.mjs +22 -19
- package/dist/client/{richText-coerce-B19taoH6.mjs → richText-coerce-CW8CFk8v.mjs} +1 -1
- package/dist/client/{routeIslandApiConfig-Chu5BHra.mjs → routeIslandApiConfig-CnZ_1ol2.mjs} +1 -1
- package/dist/client/{schema-C-m8XHuW.mjs → schema-BFwQDvJL.mjs} +4561 -3948
- package/dist/client/{shop-RGWa43H7.mjs → shop-CTUaT57E.mjs} +3 -3
- package/dist/client/{shop-commerce-TJYCBO_H.mjs → shop-commerce-BWwbsm_-.mjs} +11 -11
- package/dist/client/{shop-commerce-store-CjCcUB_o.mjs → shop-commerce-store-15UII0y3.mjs} +1 -1
- package/dist/client/{shop.client-tsKfZw1W.mjs → shop.client-UWgdmJBm.mjs} +12 -12
- package/dist/client/{shop.interactive-CVqLAU53.mjs → shop.interactive-Cf_kASpd.mjs} +76 -51
- package/dist/client/{shopShared-C3lHMz_R.mjs → shopShared-Bi8d584P.mjs} +2 -2
- package/dist/{server/effectiveNavLinkStyle-CGvGr3yD.mjs → client/site-styles-dy54AUdz.mjs} +2781 -331
- package/dist/client/{timetableModel-V2ifvGGy.mjs → timetableModel-Bi8ruFgB.mjs} +10 -9
- package/dist/client/{useAvailableSlots-D1X69-pN.mjs → useAvailableSlots-DiLbDqM3.mjs} +8 -11
- package/dist/client/{useBookingNowIso-Ch30jino.mjs → useBookingNowIso-CWIiqPd0.mjs} +1 -1
- package/dist/client/{useDiscountApply-Bwzr1RjV.mjs → useDiscountApply-ChtszhF9.mjs} +2 -2
- package/dist/client/{useDiscountCodeUi-BimJbFC7.mjs → useDiscountCodeUi-B0Z7n2tZ.mjs} +1 -1
- package/dist/client/{useEventPagination-CLAS0upd.mjs → useEventPagination-DRrATQHQ.mjs} +6 -6
- package/dist/client/{view-Dj_FZHmg.mjs → view-OvsxzgxP.mjs} +64 -55
- package/dist/client/{view-BUh4LnLS.mjs → view-yUIfWX3S.mjs} +4 -4
- package/dist/client/{wizardSteps-BkZc-hKH.mjs → wizardSteps-kbONzKUv.mjs} +59 -53
- package/dist/preview-next/before-render.mjs +3 -3
- package/dist/preview-next/chrome.css +1 -1
- package/dist/preview-next/client/{EventEmbeddedCheckoutStep-CwerMfzn.mjs → EventEmbeddedCheckoutStep-DzoFjIqB.mjs} +1 -1
- package/dist/preview-next/client/{PreviewEditorSidebar-Dvq-RW9-.mjs → PreviewEditorSidebar-BhgPyyUW.mjs} +170 -1046
- package/dist/preview-next/client/{PreviewEditorUI-BdFjS39R.mjs → PreviewEditorUI-lndKKBtB.mjs} +157 -313
- package/dist/preview-next/client/{SdkPreviewModeRuntime-BEfHln1E.mjs → SdkPreviewModeRuntime-Bk7On_EM.mjs} +351 -1386
- package/dist/preview-next/client/{SdkPreviewModeRuntime-CjkGh1IG.mjs → SdkPreviewModeRuntime-DCDDXDlt.mjs} +1 -1
- package/dist/preview-next/client/{ThemedButton-b14Bv03E.mjs → ThemedButton-nUnE3iMv.mjs} +1010 -398
- package/dist/preview-next/client/{SiteChromeCustomizeContext-CDbxk_qZ.mjs → previewAuthStore-DHtSQIBE.mjs} +159416 -162308
- package/dist/preview-next/client/{previewChromeSurface-Dd1_mNIg.mjs → previewChromeSurface-CxQ6dZ8D.mjs} +1 -1
- package/dist/preview-next/client/runtime.mjs +3 -3
- package/dist/preview-next/client/{sdk-runtime-B-CXyGVb.mjs → sdk-runtime-DSZv7Vfm.mjs} +1 -1
- package/dist/preview-next/client/siteStyleAccess-Chq5KKKh.mjs +14162 -0
- package/dist/preview-next/client/{spinner-CGxS8Ns-.mjs → spinner-CjxE3uws.mjs} +1 -1
- package/dist/preview-next/edit-map.css +37 -0
- package/dist/preview-next/keepAlive.mjs +2 -2
- package/dist/preview-next/maplibre-gl.css +1 -0
- package/dist/preview-next/middleware.mjs +1 -1
- package/dist/preview-next/{refresh-contract-CvmNqZ1Q.mjs → refresh-contract-uQ6BXgLJ.mjs} +5 -0
- package/dist/preview-next/{route-contract-hLg-yjQN.mjs → route-contract-CxCstfkP.mjs} +403 -200
- package/dist/preview-next/upload-structure.css +18 -0
- package/dist/server/{Block.shared-CeTd2saO.mjs → Block.shared-Dz9k8vCX.mjs} +16 -16
- package/dist/server/{bindings-C5YpKuKt.mjs → bindings-S-gCHhj5.mjs} +2 -2
- package/dist/server/{client-Cv26lZQ4.mjs → client-C2Q56xqV.mjs} +34 -69
- package/dist/server/config-validation.mjs +1 -1
- package/dist/server/config.mjs +2 -2
- package/dist/{client/mediaContext-jPeJ2PmJ.mjs → server/effectiveNavLinkStyle-DLzJPcDL.mjs} +1977 -1210
- package/dist/server/index.mjs +3 -3
- package/dist/server/{loadContent-C8a0b-cC.mjs → loadContent-D7ItMsEl.mjs} +7 -4
- package/dist/server/loadPage-D2qvYV5g.mjs +2 -0
- package/dist/server/{loadPage-BW7dklu3.mjs → loadPage-DaPiPYUL.mjs} +2 -2
- package/dist/server/next.mjs +9 -9
- package/dist/server/{overrideResolution-tIuqmJB3.mjs → overrideResolution-anoB3Kbn.mjs} +1 -1
- package/dist/server/{overrides-D1fiPOKF.mjs → overrides-W1Cc6srh.mjs} +434 -241
- package/dist/server/page-converter.mjs +1 -1
- package/dist/server/{prebuild--fO0E2tr.mjs → prebuild-BF9yNfCS.mjs} +1 -1
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/{prefetchBlockData-CqJnokWJ.mjs → prefetchBlockData-Cn9k3DW6.mjs} +36 -11
- package/dist/server/{publicProducts-CvvZ4JIe.mjs → publicProducts-BVcJ6TG7.mjs} +656 -166
- package/dist/server/{registry-BVfCqaCq.mjs → registry-4ZF3bUuJ.mjs} +401 -74
- package/dist/server/rendering/server.mjs +4 -4
- package/dist/server/rendering.mjs +8 -8
- package/dist/server/{resolveBlockData-DPNvhXEz.mjs → resolveBlockData-BKQ1Fc0M.mjs} +1 -1
- package/dist/server/routing.mjs +1 -1
- package/dist/server/{schema-CD4peO7m.mjs → schema-DgrigZq9.mjs} +7748 -7135
- package/dist/server/server.mjs +3 -3
- package/dist/server/{site-styles-H-EvTJiW.mjs → site-styles-CxE9F3hj.mjs} +99 -117
- package/dist/server/{siteChromeOverlayClearance-DNC2k1U0.mjs → siteChromeOverlayClearance-OhS6f830.mjs} +161 -105
- package/dist/server/{src-ILxc6pid.mjs → src-C44_fMy5.mjs} +1190 -147
- package/dist/server/theme-bridge.mjs +1 -1
- package/dist/server/theme.mjs +1 -1
- package/dist/server/{themeAdmission-BNHIXiUj.mjs → themeAdmission-CVc04B9m.mjs} +36 -29
- package/dist/server/{validation-B1ieVemg.mjs → validation-BrbY0nxR.mjs} +2 -2
- package/dist/server/{version-BQK44wFg.mjs → version-BBSk8uM6.mjs} +1 -1
- package/dist/styles/index.css +1034 -113
- package/package.json +1 -1
- package/dist/_dts/index-BQDBQvdu.d.ts +0 -13
- package/dist/client/mediaAssets-BvjcAZpS.mjs +0 -16
- package/dist/preview-next/client/siteStyleAccess-Kqk0j0dE.mjs +0 -5812
- package/dist/server/loadPage--DXBwI8V.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 { $ as
|
|
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 { A 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,472 +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
|
-
...effectiveContent,
|
|
979
|
-
...photoContent,
|
|
980
|
-
...arrangementShapeContent(effective.look.id, {
|
|
981
|
-
...activeContent,
|
|
982
|
-
...effectiveContent
|
|
983
|
-
}),
|
|
984
|
-
...arrangementPanelContent(activeContent, effective, mode),
|
|
985
|
-
...arrangementQuoteContent(blockKind, effective, values),
|
|
986
|
-
_arrangementLooks: runtime,
|
|
987
|
-
_effectiveLook: effective,
|
|
988
|
-
_lookHooks: arrangementContentHooks(effective, mode, length, {
|
|
989
|
-
...facts,
|
|
990
|
-
photo: visiblePhotos.facts.photo
|
|
991
|
-
}, values, visiblePhotos.photoCount),
|
|
992
|
-
_effectiveKnobs: knobs,
|
|
993
|
-
_lookAudience: audience,
|
|
994
|
-
_lookSlots: arrangementContentSlots(blockKind),
|
|
995
|
-
blockLook: effective.look.id
|
|
996
|
-
};
|
|
997
|
-
}
|
|
998
|
-
/** Widget section hooks use the theme; hero background geometry never travels to list islands. */
|
|
999
|
-
function arrangementContentSlots(blockKind) {
|
|
1000
|
-
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]));
|
|
1001
|
-
}
|
|
1002
|
-
/** C photo Looks render shape-specific crops without rewriting authored preferences. */
|
|
1003
|
-
function arrangementShapeContent(lookId, content) {
|
|
1004
|
-
if (lookId !== "intro-photo-beside-text" && lookId !== "media-text-photo-beside-text") return {};
|
|
1005
|
-
return content.imageShape === "circle" ? { aspectRatio: "1/1" } : content.imageShape === "arch" ? { aspectRatio: "4/5" } : {};
|
|
1006
|
-
}
|
|
1007
|
-
function arrangementQuoteContent(blockKind, effective, values) {
|
|
1008
|
-
if (blockKind !== "block.testimonials") return {};
|
|
1009
|
-
const single = effective.look.structure.byMode.default === "single";
|
|
1010
|
-
return {
|
|
1011
|
-
_quoteCount: single ? 1 : values.quoteCount === "all" ? null : Number(values.quoteCount),
|
|
1012
|
-
_quoteLoaderLimit: values.quoteCount === "all" && !single ? "all" : "50"
|
|
1013
|
-
};
|
|
1014
|
-
}
|
|
1015
|
-
function arrangementPanelContent(content, effective, mode) {
|
|
1016
|
-
if (mode === "calendar") return {
|
|
1017
|
-
_lookMonthArrangement: effective.look.structure.byMode.calendar,
|
|
1018
|
-
defaultCalendarView: "month"
|
|
1019
|
-
};
|
|
1020
|
-
const arrangement = effective.look.structure.byMode[mode ?? "default"];
|
|
1021
|
-
if (arrangement === "event-header") return { heading: void 0 };
|
|
1022
|
-
if (arrangement !== "compact" && arrangement !== "details-panel") return {};
|
|
1023
|
-
return {
|
|
1024
|
-
heading: void 0,
|
|
1025
|
-
_lookPanelHeading: content.heading
|
|
1026
|
-
};
|
|
1027
|
-
}
|
|
1028
|
-
function arrangementPhotoContent(content, knobs) {
|
|
1029
|
-
if (knobs.showPhotos !== false || !Array.isArray(content.cards)) return {};
|
|
1030
|
-
return { cards: content.cards.map((card) => {
|
|
1031
|
-
if (!isObjectRecord(card)) return card;
|
|
1032
|
-
const { media: _hiddenMedia, ...copy } = card;
|
|
1033
|
-
return copy;
|
|
1034
|
-
}) };
|
|
1035
|
-
}
|
|
1036
|
-
function arrangementContentFacts(content) {
|
|
1037
|
-
const photoCount = arrangementPhotoCount(content);
|
|
1038
|
-
const featured = typeof content.featured === "string" ? content.featured.trim().length > 0 : content.featured !== void 0 && content.featured !== null;
|
|
1039
|
-
return {
|
|
1040
|
-
photoCount,
|
|
1041
|
-
facts: {
|
|
1042
|
-
photo: photoCount > 0,
|
|
1043
|
-
facts: Array.isArray(content.facts) && content.facts.length > 0,
|
|
1044
|
-
featured,
|
|
1045
|
-
outcome: typeof content.outcome === "string" && content.outcome.length > 0,
|
|
1046
|
-
figure: typeof content.figure === "string" && content.figure.trim().length > 0,
|
|
1047
|
-
entrance: isObjectRecord(content.entrancePhoto)
|
|
1048
|
-
}
|
|
1049
|
-
};
|
|
1050
|
-
}
|
|
1051
|
-
/** The content stage owns media presence for every arrangement consumer. */
|
|
1052
|
-
function arrangementPhotoCount(content) {
|
|
1053
|
-
if (Array.isArray(content.cards)) return content.cards.filter((card) => isObjectRecord(card) && isObjectRecord(card.media)).length;
|
|
1054
|
-
if (Array.isArray(content.members)) return content.members.filter((member) => isObjectRecord(member) && isObjectRecord(member.photo)).length;
|
|
1055
|
-
if (Array.isArray(content.images)) return content.images.filter((item) => isObjectRecord(item) && isObjectRecord(item.image)).length;
|
|
1056
|
-
if (isObjectRecord(content.media) || isObjectRecord(content.entrancePhoto)) return 1;
|
|
1057
|
-
const section = isObjectRecord(content._sectionStyles) ? content._sectionStyles : {};
|
|
1058
|
-
return isObjectRecord((isObjectRecord(section.background) ? section.background : {}).image) ? 1 : 0;
|
|
1059
|
-
}
|
|
1060
|
-
function effectiveContentKnobValue(blockKind, key, value) {
|
|
1061
|
-
const facet = systemCustomizeFacetDefinitionsForBlock(blockKind).find((entry) => entry.target.kind === "content-field" && entry.target.field === key);
|
|
1062
|
-
return facet?.target.kind === "content-field" && facet.target.boolean ? value === "true" : value;
|
|
1063
|
-
}
|
|
1064
|
-
function arrangementContentHooks(effective, mode, length, facts, values, photoCount) {
|
|
1065
|
-
return {
|
|
1066
|
-
"data-look": effective.look.id,
|
|
1067
|
-
"data-treat": effective.treatment,
|
|
1068
|
-
"data-arrangement": effective.look.structure.byMode[mode ?? "default"],
|
|
1069
|
-
...mode !== null ? { "data-mode": mode } : {},
|
|
1070
|
-
...length !== null ? { "data-length": length } : {},
|
|
1071
|
-
...Object.fromEntries(Object.entries(facts).map(([key, value]) => [`data-has-${key}`, String(value)])),
|
|
1072
|
-
"data-photo-count": String(photoCount),
|
|
1073
|
-
...Object.fromEntries(Object.entries(values).map(([key, value]) => [`data-knob-${key === "titleSize" ? "headline" : key.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`)}`, value]))
|
|
1074
|
-
};
|
|
1075
|
-
}
|
|
1076
|
-
function applyArrangementRhythm(entry, position) {
|
|
1077
|
-
const runtime = arrangementRuntime(entry.renderableContent);
|
|
1078
|
-
const look = effectiveLookFromContent(entry.renderableContent);
|
|
1079
|
-
if (!runtime || !look) return entry;
|
|
1080
|
-
const rhythm = runtime.rhythm.length === 0 ? null : runtime.rhythm[position % runtime.rhythm.length];
|
|
1081
|
-
const content = entry.renderableContent;
|
|
1082
|
-
const resolved = resolveSectionBackground(parseCanonicalRuntimeBackground(content), null, rhythm, heroPhotoGround(entry));
|
|
1083
|
-
const updated = applyResolvedArrangementBackground(content, resolved);
|
|
1084
|
-
const surface = arrangementGroundToken(resolved);
|
|
1085
|
-
const grounded = resolveArrangementRoleSurfaces(look, runtime, resolved);
|
|
1086
|
-
const tinted = resolveArrangementTints(updated, grounded, runtime, surface) ?? grounded;
|
|
1087
|
-
return {
|
|
1088
|
-
...entry,
|
|
1089
|
-
renderableContent: {
|
|
1090
|
-
...updated,
|
|
1091
|
-
_effectiveLook: tinted,
|
|
1092
|
-
_lookHooks: {
|
|
1093
|
-
...isObjectRecord(updated._lookHooks) ? updated._lookHooks : {},
|
|
1094
|
-
"data-surface": surface
|
|
1095
|
-
}
|
|
1096
|
-
}
|
|
1097
|
-
};
|
|
1098
|
-
}
|
|
1099
|
-
function arrangementGroundToken(resolved) {
|
|
1100
|
-
if (resolved.kind === "base") return "background";
|
|
1101
|
-
switch (resolved.background.type) {
|
|
1102
|
-
case "image":
|
|
1103
|
-
case "video": return "media";
|
|
1104
|
-
case "color": return resolved.background.color ?? "background";
|
|
1105
|
-
case "gradient": return "gradient";
|
|
1106
|
-
}
|
|
1107
|
-
}
|
|
1108
|
-
function applyResolvedArrangementBackground(content, resolved) {
|
|
1109
|
-
const section = isObjectRecord(content._sectionStyles) ? content._sectionStyles : {};
|
|
1110
|
-
const photo = isObjectRecord(section.background) ? section.background.image : void 0;
|
|
1111
|
-
const ground = resolved.kind === "base" ? void 0 : resolved.background;
|
|
1112
|
-
const background = photo !== void 0 ? {
|
|
1113
|
-
...ground ?? {
|
|
1114
|
-
type: "color",
|
|
1115
|
-
color: "background"
|
|
1116
|
-
},
|
|
1117
|
-
image: photo
|
|
1118
|
-
} : ground;
|
|
1119
|
-
return {
|
|
1120
|
-
...content,
|
|
1121
|
-
_sectionStyles: {
|
|
1122
|
-
...section,
|
|
1123
|
-
background
|
|
1124
|
-
}
|
|
1125
|
-
};
|
|
1126
|
-
}
|
|
1127
|
-
function planPageBlock(block, input, resolveTarget) {
|
|
1128
|
-
const outcome = planBlock(block, getRenderableContent(block, input.previewStage), resolveTarget, input.audience, input.siteStyleId ?? null);
|
|
1129
|
-
if (outcome.kind !== "diagnostic") return {
|
|
1130
|
-
kind: "admitted",
|
|
1131
|
-
entry: outcome
|
|
1132
|
-
};
|
|
1133
|
-
const resolved = resolveTarget(block.kind);
|
|
1134
|
-
const debug = blockDiagnosticContext(resolved, input);
|
|
1135
|
-
return input.audience === "public" ? {
|
|
1136
|
-
kind: "omitted",
|
|
1137
|
-
omission: {
|
|
1138
|
-
blockId: block.id ?? null,
|
|
1139
|
-
blockKind: block.kind,
|
|
1140
|
-
reason: outcome.reason,
|
|
1141
|
-
override: resolved.override,
|
|
1142
|
-
debug
|
|
1143
|
-
}
|
|
1144
|
-
} : {
|
|
1145
|
-
kind: "admitted",
|
|
1146
|
-
entry: {
|
|
1147
|
-
...outcome,
|
|
1148
|
-
debug
|
|
1149
|
-
}
|
|
1150
|
-
};
|
|
1151
|
-
}
|
|
1152
|
-
function blockDiagnosticContext(resolved, input) {
|
|
1153
|
-
return {
|
|
1154
|
-
hasOverride: Boolean(resolved.override),
|
|
1155
|
-
sdkCustomBlocksCount: input.sdkConfig?.customBlocks?.length ?? 0,
|
|
1156
|
-
dbCustomBlocksCount: input.customBlocks?.length ?? 0,
|
|
1157
|
-
manifestKeys: resolved.definition ? Object.keys(resolved.definition.manifest).sort() : null
|
|
1158
|
-
};
|
|
1159
|
-
}
|
|
1160
|
-
function resolveArrangementTints(content, look, runtime, ground) {
|
|
1161
|
-
if (!look.surfaceTints) return null;
|
|
1162
|
-
const context = runtime.surfaceContext;
|
|
1163
|
-
const surfaces = arrangementSlotNames.flatMap((slot) => {
|
|
1164
|
-
const tint = look.surfaceTints?.[slot];
|
|
1165
|
-
if (!tint || tint.knob && content[tint.knob] !== true) return [];
|
|
1166
|
-
const owned = look.itemSurfaces[slot];
|
|
1167
|
-
return [[slot, resolveSurface({
|
|
1168
|
-
kind: "tint",
|
|
1169
|
-
base: owned?.kind === "owned" && owned.paint.kind === "solid" ? owned.paint.token : ground,
|
|
1170
|
-
source: tint.source,
|
|
1171
|
-
opacity: tint.opacity,
|
|
1172
|
-
gradient: tint.gradient
|
|
1173
|
-
}, context)]];
|
|
1174
|
-
});
|
|
1175
|
-
return {
|
|
1176
|
-
...look,
|
|
1177
|
-
itemSurfaces: {
|
|
1178
|
-
...look.itemSurfaces,
|
|
1179
|
-
...Object.fromEntries(surfaces)
|
|
1180
|
-
}
|
|
1181
|
-
};
|
|
1182
|
-
}
|
|
1183
|
-
function resolveArrangementRoleSurfaces(look, runtime, background) {
|
|
1184
|
-
const ground = deriveSectionGround(background, runtime.surfaceContext.palette);
|
|
1185
|
-
const style = {
|
|
1186
|
-
roleMap: look.roleMap,
|
|
1187
|
-
surfaces: runtime.surfaces,
|
|
1188
|
-
context: runtime.surfaceContext
|
|
1189
|
-
};
|
|
1190
|
-
const roleSurfaces = {
|
|
1191
|
-
card: resolveItemSurface("card", ground, style),
|
|
1192
|
-
statement: resolveItemSurface("statement", ground, style),
|
|
1193
|
-
highlight: resolveItemSurface("highlight", ground, style)
|
|
1194
|
-
};
|
|
1195
|
-
return {
|
|
1196
|
-
...look,
|
|
1197
|
-
ground,
|
|
1198
|
-
roleSurfaces,
|
|
1199
|
-
itemSurfaces: resolveLookSlotSurfaces(look.look, look.itemRoles, roleSurfaces)
|
|
1200
|
-
};
|
|
1201
|
-
}
|
|
1202
|
-
/** The arrangement key is resolved once by planBlock, including pinned Looks. */
|
|
1203
|
-
function heroPhotoGround(entry) {
|
|
1204
|
-
return entry.kind === "renderable" && entry.block.kind === "block.hero" ? { paintsGround: heroPhotoPaintsGround(entry.effectiveArrangementKey ?? void 0) } : void 0;
|
|
1205
|
-
}
|
|
1206
|
-
//#endregion
|
|
1207
649
|
//#region ../blocks/src/system/data/readinessFacts.ts
|
|
1208
650
|
const countSchema = z.array(z.unknown()).transform((entries) => entries.length);
|
|
1209
651
|
const formSchema = z.union([z.null(), z.object({
|
|
@@ -1324,7 +766,7 @@ function hydrateResolvedBookingConsentValue(value, context) {
|
|
|
1324
766
|
const hydratedItems = value.map((item) => hydrateResolvedBookingConsentValue(item, context));
|
|
1325
767
|
return hydratedItems.every((item, index) => item === value[index]) ? value : hydratedItems;
|
|
1326
768
|
}
|
|
1327
|
-
if (!isRecord$
|
|
769
|
+
if (!isRecord$5(value)) return value;
|
|
1328
770
|
if (isBookingConsentCarrier(value)) {
|
|
1329
771
|
const agreement = hydrateValue(value.agreement, context);
|
|
1330
772
|
return agreement === value.agreement ? value : {
|
|
@@ -1344,7 +786,7 @@ function hydrateValue(value, context) {
|
|
|
1344
786
|
const resolvedItems = value.map((item) => hydrateValue(item, context));
|
|
1345
787
|
return resolvedItems.every((item, index) => item === value[index]) ? value : resolvedItems;
|
|
1346
788
|
}
|
|
1347
|
-
if (isRecord$
|
|
789
|
+
if (isRecord$5(value)) {
|
|
1348
790
|
if (isInternalLink(value)) return hydrateInternalLink(value, context.routes);
|
|
1349
791
|
if (isPageLink(value)) return hydratePageLink(value, context);
|
|
1350
792
|
if (isEntryLink(value)) return hydrateEntryLink(value, context);
|
|
@@ -1409,7 +851,7 @@ function hydrateEntryLink(link, context) {
|
|
|
1409
851
|
//#region ../blocks/src/system/manifest/resolveBlockData.ts
|
|
1410
852
|
function resolveBlockData(blockId, dataLoaders, dataContext, routes) {
|
|
1411
853
|
const raw = blockId ? dataContext?.resolvedData?.[blockId] : void 0;
|
|
1412
|
-
if (isRecord$
|
|
854
|
+
if (isRecord$5(raw)) return routes ? hydrateResolvedBookingConsentLinks(raw, routes, dataContext?.pagesByIdentifier, dataContext?.entriesByIdentifier) : raw;
|
|
1413
855
|
return dataLoaders && typeof dataLoaders === "object" && Object.keys(dataLoaders).length > 0 ? {} : void 0;
|
|
1414
856
|
}
|
|
1415
857
|
//#endregion
|
|
@@ -1604,7 +1046,7 @@ function preparedBlockProps(entry, content, data, input) {
|
|
|
1604
1046
|
function buildBlockOverrideProps(input) {
|
|
1605
1047
|
const { block, dataContext } = input;
|
|
1606
1048
|
return {
|
|
1607
|
-
content: input.content,
|
|
1049
|
+
content: bindArrangementInkPolicy(input.content, input.themeResources),
|
|
1608
1050
|
dateContext: pageDateRuntimeContext(dataContext),
|
|
1609
1051
|
now: dataContext?.now,
|
|
1610
1052
|
...overrideThemeProps(input.themeResources),
|
|
@@ -1749,6 +1191,11 @@ function preparedPlanEntry(entry, prepared) {
|
|
|
1749
1191
|
prepared
|
|
1750
1192
|
};
|
|
1751
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
|
+
}
|
|
1752
1199
|
//#endregion
|
|
1753
1200
|
//#region ../blocks/src/BlockErrorBoundary.tsx
|
|
1754
1201
|
/**
|
|
@@ -1818,7 +1265,7 @@ function EditorPageRenderer(props) {
|
|
|
1818
1265
|
}) });
|
|
1819
1266
|
}
|
|
1820
1267
|
function PageRendererCore(props) {
|
|
1821
|
-
const { page, audience, dataContext, routeMap
|
|
1268
|
+
const { page, audience, dataContext, routeMap } = props;
|
|
1822
1269
|
const imageResolveContext = React$1.useMemo(() => resolvePageRendererImageResolveContext(dataContext), [
|
|
1823
1270
|
dataContext?.imageResolveContext,
|
|
1824
1271
|
dataContext?.mediaAssets,
|
|
@@ -1846,16 +1293,20 @@ function PageRendererCore(props) {
|
|
|
1846
1293
|
themeResources,
|
|
1847
1294
|
imageResolveContext
|
|
1848
1295
|
]);
|
|
1849
|
-
const joinSlots = React$1.useMemo(() => joinSlotsByPair(preparation.joins), [preparation.joins]);
|
|
1850
1296
|
reportAndReplayOmissions({
|
|
1851
1297
|
plan,
|
|
1852
1298
|
preparation,
|
|
1853
1299
|
dataContext,
|
|
1854
1300
|
themeResources
|
|
1855
1301
|
});
|
|
1856
|
-
if (!page || preparation.entries.length === 0) return presentEmptyPage(audience);
|
|
1857
|
-
const resolvedRegistry = registry ?? getDefaultComponentRegistry();
|
|
1302
|
+
if (!page || preparation.entries.length === 0) return props.wrapPage ? props.wrapPage(plan, presentEmptyPage(audience)) : presentEmptyPage(audience);
|
|
1858
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);
|
|
1859
1310
|
return /* @__PURE__ */ jsx("div", { children: preparation.entries.map((entry, index) => renderGuardedPlanEntry({
|
|
1860
1311
|
entry,
|
|
1861
1312
|
index,
|
|
@@ -2848,24 +2299,6 @@ function normalizePublicApiLoaderParams(endpoint, params, context) {
|
|
|
2848
2299
|
const Text = Text$1;
|
|
2849
2300
|
const RichText = RichText$1;
|
|
2850
2301
|
//#endregion
|
|
2851
|
-
//#region ../blocks/src/system/helpers/blockSectionForeground.ts
|
|
2852
|
-
/** Renderer admission supplies the variant; theme-core alone owns paint and foreground. */
|
|
2853
|
-
function resolveBlockSectionForeground(block, theme, audience) {
|
|
2854
|
-
const opening = planOpeningForegroundContent(block, audience);
|
|
2855
|
-
return resolveCompiledSectionForegroundFromContent(opening.content, expandPalette(theme.palette), opening.photo);
|
|
2856
|
-
}
|
|
2857
|
-
/** Apply the render plan's policy/content stage before measuring the opening. */
|
|
2858
|
-
function planOpeningForegroundContent(block, audience) {
|
|
2859
|
-
if (!block?.content) return { content: null };
|
|
2860
|
-
const definition = getBlockDefinition(block.kind);
|
|
2861
|
-
if (!definition) return { content: block.content };
|
|
2862
|
-
const content = planArrangementContent(block.kind, definition.manifest, block.content, audience);
|
|
2863
|
-
return {
|
|
2864
|
-
content,
|
|
2865
|
-
photo: block.kind === "block.hero" ? { paintsGround: heroPhotoPaintsGround(resolveBlockVariantKey(definition.manifest, content) ?? void 0) } : void 0
|
|
2866
|
-
};
|
|
2867
|
-
}
|
|
2868
|
-
//#endregion
|
|
2869
2302
|
//#region ../db/src/schemas/forms.ts
|
|
2870
2303
|
/**
|
|
2871
2304
|
* Form Settings Schemas
|
|
@@ -3395,7 +2828,7 @@ function parseRelativeStoragePath(value) {
|
|
|
3395
2828
|
if (!validated.ok) return validated;
|
|
3396
2829
|
return ok$1(brandRelativeStoragePath(validated.value));
|
|
3397
2830
|
}
|
|
3398
|
-
function isRecord$
|
|
2831
|
+
function isRecord$3(value) {
|
|
3399
2832
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
3400
2833
|
}
|
|
3401
2834
|
function parseFileKindJson(value) {
|
|
@@ -3616,7 +3049,7 @@ function parseEntitledCustomerAccessScopeJson(value) {
|
|
|
3616
3049
|
}
|
|
3617
3050
|
}
|
|
3618
3051
|
function requireRecord(value) {
|
|
3619
|
-
if (!isRecord$
|
|
3052
|
+
if (!isRecord$3(value)) return err("expected-object");
|
|
3620
3053
|
return ok(value);
|
|
3621
3054
|
}
|
|
3622
3055
|
function requireString(value) {
|
|
@@ -4006,7 +3439,7 @@ const DEFAULT_MESSAGES = {
|
|
|
4006
3439
|
update: "Failed to update media asset",
|
|
4007
3440
|
delete: "Failed to delete media asset"
|
|
4008
3441
|
};
|
|
4009
|
-
function isRecord$
|
|
3442
|
+
function isRecord$2(value) {
|
|
4010
3443
|
return typeof value === "object" && value !== null;
|
|
4011
3444
|
}
|
|
4012
3445
|
const normalizeLabels = (labels) => labels !== void 0 && labels.length > 0 ? labels.map((label) => label.trim()).filter((label) => label.length > 0).join(",") : void 0;
|
|
@@ -4040,7 +3473,7 @@ const filterUpdatePayload = (input) => {
|
|
|
4040
3473
|
return payload;
|
|
4041
3474
|
};
|
|
4042
3475
|
const extractErrorMessage = (body) => {
|
|
4043
|
-
if (!isRecord$
|
|
3476
|
+
if (!isRecord$2(body)) return typeof body === "string" && body.trim().length > 0 ? body : null;
|
|
4044
3477
|
for (const key of [
|
|
4045
3478
|
"error",
|
|
4046
3479
|
"message",
|
|
@@ -4053,11 +3486,11 @@ const extractErrorMessage = (body) => {
|
|
|
4053
3486
|
const details = body.details;
|
|
4054
3487
|
if (Array.isArray(details)) for (const entry of details) {
|
|
4055
3488
|
if (typeof entry === "string" && entry.trim().length > 0) return entry;
|
|
4056
|
-
if (isRecord$
|
|
3489
|
+
if (isRecord$2(entry) && typeof entry.message === "string" && entry.message.trim().length > 0) return entry.message;
|
|
4057
3490
|
}
|
|
4058
3491
|
const errors = body.errors;
|
|
4059
3492
|
if (Array.isArray(errors)) {
|
|
4060
|
-
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;
|
|
4061
3494
|
}
|
|
4062
3495
|
return null;
|
|
4063
3496
|
};
|
|
@@ -4398,15 +3831,6 @@ function MediaEditorProvider({ siteId, apiClient, children, bucket = DEFAULT_MED
|
|
|
4398
3831
|
});
|
|
4399
3832
|
}
|
|
4400
3833
|
//#endregion
|
|
4401
|
-
//#region ../field-primitives/src/bindings/index.ts
|
|
4402
|
-
const BINDING_TRANSFORMS = {
|
|
4403
|
-
RICHTEXT_FIRST_PARAGRAPH: "richtext.firstParagraph",
|
|
4404
|
-
DATE_FORMAT_SHORT: "date.formatShort",
|
|
4405
|
-
DATE_FORMAT_LONG: "date.formatLong",
|
|
4406
|
-
TEXT_INLINE_TEXT: "text.inlineText"
|
|
4407
|
-
};
|
|
4408
|
-
Object.values(BINDING_TRANSFORMS);
|
|
4409
|
-
//#endregion
|
|
4410
3834
|
//#region ../preview-next/src/client/preview/PreviewAuthInit.tsx
|
|
4411
3835
|
function PreviewAuthInit({ children, session, siteId, siteSlug, pageId, token }) {
|
|
4412
3836
|
const lastInitRef = useRef(null);
|
|
@@ -4521,7 +3945,7 @@ function overlayValue(value, overlays) {
|
|
|
4521
3945
|
});
|
|
4522
3946
|
return changed ? next : value;
|
|
4523
3947
|
}
|
|
4524
|
-
if (!isRecord$
|
|
3948
|
+
if (!isRecord$1(value)) return value;
|
|
4525
3949
|
const match = matchingOverlay(value, overlays);
|
|
4526
3950
|
if (match) return overlaidEntry(value, match.meta, match.overlay);
|
|
4527
3951
|
let changed = false;
|
|
@@ -4580,7 +4004,7 @@ function renderedLinkedRevisions(dataContext) {
|
|
|
4580
4004
|
}
|
|
4581
4005
|
function linkedEntryOccurrences(value) {
|
|
4582
4006
|
if (Array.isArray(value)) return value.flatMap(linkedEntryOccurrences);
|
|
4583
|
-
if (!isRecord$
|
|
4007
|
+
if (!isRecord$1(value)) return [];
|
|
4584
4008
|
const meta = parseLinkedEntryMeta(value[LINKED_CONTENT_ENTRY_META_KEY]);
|
|
4585
4009
|
const nested = Object.entries(value).filter(([key]) => key !== LINKED_CONTENT_ENTRY_META_KEY).flatMap(([, child]) => linkedEntryOccurrences(child));
|
|
4586
4010
|
return meta ? [meta, ...nested] : nested;
|
|
@@ -4616,49 +4040,13 @@ function resolveOverlayTitle(content, meta) {
|
|
|
4616
4040
|
function parseLinkedEntryMeta(value) {
|
|
4617
4041
|
return getLinkedContentEntryMeta({ [LINKED_CONTENT_ENTRY_META_KEY]: value });
|
|
4618
4042
|
}
|
|
4619
|
-
function isRecord$
|
|
4043
|
+
function isRecord$1(value) {
|
|
4620
4044
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
4621
4045
|
}
|
|
4622
4046
|
function overlayRevision(overlay, meta) {
|
|
4623
4047
|
return overlay.optimisticHash === void 0 ? meta.optimisticHash : overlay.optimisticHash;
|
|
4624
4048
|
}
|
|
4625
4049
|
//#endregion
|
|
4626
|
-
//#region ../preview-next/src/client/blocks/renderPrecedence.ts
|
|
4627
|
-
/** A block's content as the preview renders it, from the tab's render source. */
|
|
4628
|
-
function renderedBlockContent(uiStore, blockId) {
|
|
4629
|
-
const state = uiStore.getState();
|
|
4630
|
-
return resolveRenderedValues(renderSourceFor(state.editability), state.drafts.getBlockSnapshot(blockId), remoteDraftValues(state.remoteDrafts, {
|
|
4631
|
-
kind: "block",
|
|
4632
|
-
id: blockId
|
|
4633
|
-
}));
|
|
4634
|
-
}
|
|
4635
|
-
/**
|
|
4636
|
-
* An entry template page renders the entry's own fields from `contentEntry`. The
|
|
4637
|
-
* server sent them as they were on load; the editor's rendered values (local
|
|
4638
|
-
* edits, then another tab's live draft) take over from there.
|
|
4639
|
-
*/
|
|
4640
|
-
function withRenderedContentEntry(dataContext, content) {
|
|
4641
|
-
if (!dataContext?.contentEntry || !content) return dataContext;
|
|
4642
|
-
return {
|
|
4643
|
-
...dataContext,
|
|
4644
|
-
contentEntry: {
|
|
4645
|
-
...dataContext.contentEntry,
|
|
4646
|
-
...content
|
|
4647
|
-
}
|
|
4648
|
-
};
|
|
4649
|
-
}
|
|
4650
|
-
/** Loader data fetched in the browser replaces the server's, block by block. */
|
|
4651
|
-
function mergeResolvedDataContext(dataContext, liveResolvedData) {
|
|
4652
|
-
if (!dataContext || !liveResolvedData) return dataContext;
|
|
4653
|
-
return {
|
|
4654
|
-
...dataContext,
|
|
4655
|
-
resolvedData: {
|
|
4656
|
-
...dataContext.resolvedData ?? {},
|
|
4657
|
-
...liveResolvedData
|
|
4658
|
-
}
|
|
4659
|
-
};
|
|
4660
|
-
}
|
|
4661
|
-
//#endregion
|
|
4662
4050
|
//#region ../preview-next/src/client/blocks/useLinkedSaveHandoverRetention.ts
|
|
4663
4051
|
/**
|
|
4664
4052
|
* The host's refresh of its server data: the same callback live drafts give a viewer
|
|
@@ -4739,7 +4127,7 @@ function snapshotFromPreviewEntry(entryData) {
|
|
|
4739
4127
|
title,
|
|
4740
4128
|
path: entryData.path ?? "",
|
|
4741
4129
|
status,
|
|
4742
|
-
publishAt
|
|
4130
|
+
publishAt: entryData.lastPublishedAt ?? null
|
|
4743
4131
|
},
|
|
4744
4132
|
status,
|
|
4745
4133
|
route: previewEntryRoute(entryData)
|
|
@@ -4755,6 +4143,7 @@ function snapshotFromPreviewPage(pageId, metadata, schema) {
|
|
|
4755
4143
|
path: metadata.path,
|
|
4756
4144
|
status: metadata.status,
|
|
4757
4145
|
publishedAt: metadata.publishedAt,
|
|
4146
|
+
lastPublishedAt: metadata.lastPublishedAt,
|
|
4758
4147
|
draftMetaTitle: metadata.draftMetaTitle,
|
|
4759
4148
|
draftMetaDescription: metadata.draftMetaDescription,
|
|
4760
4149
|
publishedMetaTitle: metadata.publishedMetaTitle,
|
|
@@ -4793,11 +4182,8 @@ function previewValues(entryData, pageMetadata) {
|
|
|
4793
4182
|
};
|
|
4794
4183
|
}
|
|
4795
4184
|
/** Loading may render the document, but grants neither lease participation nor shortcuts. */
|
|
4796
|
-
function previewAuthoringMode(mode, admitted
|
|
4797
|
-
return {
|
|
4798
|
-
requestedEditingMode: admitted && mode.requestedEditingMode,
|
|
4799
|
-
historyShortcutsEnabled: admitted && mode.isEditingMode
|
|
4800
|
-
};
|
|
4185
|
+
function previewAuthoringMode(mode, admitted) {
|
|
4186
|
+
return { requestedEditingMode: admitted && mode.requestedEditingMode };
|
|
4801
4187
|
}
|
|
4802
4188
|
function PreviewEntryControllerProvider({ children, businessTimeZone, siteId, pageId, pageNodeType = "page", routeId: providedRouteId, entryData, contentTypeSchema, initialStatus = "draft", initialBlocks, blockFieldExtensions, pageMetadata, initialPageJournalState, authoringAdmitted, apiClient, subscribeToLeaseChanges, onLeaseGranted, liveDrafts }) {
|
|
4803
4189
|
const authoring = previewAuthoringMode(useEditor(), authoringAdmitted);
|
|
@@ -4848,7 +4234,6 @@ function PreviewEntryControllerProvider({ children, businessTimeZone, siteId, pa
|
|
|
4848
4234
|
initialPageJournalState,
|
|
4849
4235
|
initialBlocks: pageNodeType === "page_surface" ? void 0 : normalizedInitialBlocks,
|
|
4850
4236
|
blockFieldExtensions,
|
|
4851
|
-
historyShortcutsEnabled: authoring.historyShortcutsEnabled,
|
|
4852
4237
|
liveDrafts: previewLiveDraftsForScope(liveDrafts, previewToken, siteId, leaseScope)
|
|
4853
4238
|
};
|
|
4854
4239
|
if (pageNodeType === "page_surface" && pageId && pageMetadata) {
|
|
@@ -5085,6 +4470,57 @@ function PreviewEditingModePersistence({ siteId }) {
|
|
|
5085
4470
|
return null;
|
|
5086
4471
|
}
|
|
5087
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
|
|
5088
4524
|
//#region ../preview-next/src/client/preview/previewSetupGuidance.ts
|
|
5089
4525
|
function resolvePreviewSetupBannerState(input) {
|
|
5090
4526
|
if (input.authMode === "onboardingGrant") return input.dashboardUnlocked ? "dashboard_ready" : "awaiting_confirmation";
|
|
@@ -5134,6 +4570,7 @@ function PreviewConfirmationDialog({ dashboardContinueUrl, dialogState, isChecki
|
|
|
5134
4570
|
//#region ../preview-next/src/onboarding-preview-planner.ts
|
|
5135
4571
|
const DEFAULT_CHECK_ERROR_MESSAGE = "Unable to check your confirmation status right now.";
|
|
5136
4572
|
const DEFAULT_RESEND_ERROR_MESSAGE = "Unable to resend your confirmation email right now.";
|
|
4573
|
+
const RESEND_LIMIT_MESSAGE = "You’ve requested all the emails we can send for this sign-up. Check your inbox and spam folder for the latest link.";
|
|
5137
4574
|
const RESEND_SUCCESS_MESSAGE = "We sent a fresh confirmation email. Check your inbox and spam folder.";
|
|
5138
4575
|
const ALREADY_CONFIRMED_MESSAGE = "Your email is already confirmed. You can complete setup in the dashboard.";
|
|
5139
4576
|
function applyOnboardingConfirmationUpdate(state, update) {
|
|
@@ -5258,15 +4695,6 @@ function planInitialStatusLoadFailure() {
|
|
|
5258
4695
|
statusLoadFailed: true
|
|
5259
4696
|
}]);
|
|
5260
4697
|
}
|
|
5261
|
-
function planMissingResendConfirmationConfig(message = DEFAULT_RESEND_ERROR_MESSAGE) {
|
|
5262
|
-
return planNoEffect([{
|
|
5263
|
-
kind: "setResendFeedback",
|
|
5264
|
-
resendFeedback: {
|
|
5265
|
-
kind: "error",
|
|
5266
|
-
message
|
|
5267
|
-
}
|
|
5268
|
-
}]);
|
|
5269
|
-
}
|
|
5270
4698
|
function planResendConfirmationFailure(message = DEFAULT_RESEND_ERROR_MESSAGE) {
|
|
5271
4699
|
return planNoEffect([{
|
|
5272
4700
|
kind: "setResendFeedback",
|
|
@@ -5291,7 +4719,7 @@ function planResendConfirmationSuccess(input) {
|
|
|
5291
4719
|
kind: "setResendFeedback",
|
|
5292
4720
|
resendFeedback: {
|
|
5293
4721
|
kind: "success",
|
|
5294
|
-
message: input.response.result === "already_confirmed" ? ALREADY_CONFIRMED_MESSAGE : RESEND_SUCCESS_MESSAGE
|
|
4722
|
+
message: input.response.result === "already_confirmed" ? ALREADY_CONFIRMED_MESSAGE : input.response.result === "limit_reached" ? RESEND_LIMIT_MESSAGE : input.response.limitReached ? `We’ve sent another email. ${RESEND_LIMIT_MESSAGE}` : RESEND_SUCCESS_MESSAGE
|
|
5295
4723
|
}
|
|
5296
4724
|
}
|
|
5297
4725
|
],
|
|
@@ -5370,6 +4798,74 @@ function buildOnboardingResendConfirmationUrl(input) {
|
|
|
5370
4798
|
return url.toString();
|
|
5371
4799
|
}
|
|
5372
4800
|
//#endregion
|
|
4801
|
+
//#region ../preview-next/src/client/preview/usePreviewConfirmationResend.ts
|
|
4802
|
+
function stateAfterReply(reply) {
|
|
4803
|
+
if (reply.kind === "failed") return reply.retryAfterSeconds > 0 ? {
|
|
4804
|
+
kind: "cooling",
|
|
4805
|
+
seconds: reply.retryAfterSeconds
|
|
4806
|
+
} : { kind: "idle" };
|
|
4807
|
+
const data = reply.data;
|
|
4808
|
+
if (data.result === "limit_reached" || data.result === "resent" && data.limitReached) return { kind: "exhausted" };
|
|
4809
|
+
return data.result === "resent" ? {
|
|
4810
|
+
kind: "cooling",
|
|
4811
|
+
seconds: Math.ceil(data.retryAfterSeconds)
|
|
4812
|
+
} : { kind: "idle" };
|
|
4813
|
+
}
|
|
4814
|
+
function decideResendButton(state) {
|
|
4815
|
+
switch (state.kind) {
|
|
4816
|
+
case "idle": return {
|
|
4817
|
+
disabled: false,
|
|
4818
|
+
label: "Resend confirmation email"
|
|
4819
|
+
};
|
|
4820
|
+
case "sending": return {
|
|
4821
|
+
disabled: true,
|
|
4822
|
+
label: "Sending..."
|
|
4823
|
+
};
|
|
4824
|
+
case "exhausted": return {
|
|
4825
|
+
disabled: true,
|
|
4826
|
+
label: "No more emails available"
|
|
4827
|
+
};
|
|
4828
|
+
case "cooling": return {
|
|
4829
|
+
disabled: true,
|
|
4830
|
+
label: `Send again in ${state.seconds} seconds`
|
|
4831
|
+
};
|
|
4832
|
+
}
|
|
4833
|
+
}
|
|
4834
|
+
/** Owns duplicate submission, cooldown and exhaustion for preview's resend action. */
|
|
4835
|
+
function usePreviewConfirmationResend(input) {
|
|
4836
|
+
const [state, setState] = useState({ kind: "idle" });
|
|
4837
|
+
const inFlight = useRef(false);
|
|
4838
|
+
const resendButton = decideResendButton(state);
|
|
4839
|
+
useEffect(() => {
|
|
4840
|
+
if (state.kind !== "cooling") return;
|
|
4841
|
+
const timer = setTimeout(() => setState((current) => current.kind !== "cooling" ? current : current.seconds <= 1 ? { kind: "idle" } : {
|
|
4842
|
+
kind: "cooling",
|
|
4843
|
+
seconds: current.seconds - 1
|
|
4844
|
+
}), 1e3);
|
|
4845
|
+
return () => clearTimeout(timer);
|
|
4846
|
+
}, [state]);
|
|
4847
|
+
return {
|
|
4848
|
+
resendConfirmation: useCallback(async () => {
|
|
4849
|
+
if (inFlight.current || resendButton.disabled) return;
|
|
4850
|
+
inFlight.current = true;
|
|
4851
|
+
setState({ kind: "sending" });
|
|
4852
|
+
try {
|
|
4853
|
+
const reply = await input.request();
|
|
4854
|
+
setState(stateAfterReply(reply));
|
|
4855
|
+
if (reply.kind === "failed") input.failed(reply.message);
|
|
4856
|
+
else input.succeeded(reply.data);
|
|
4857
|
+
} catch (error) {
|
|
4858
|
+
setState({ kind: "idle" });
|
|
4859
|
+
input.failed(error instanceof Error ? error.message : "Unable to resend your confirmation email right now.");
|
|
4860
|
+
} finally {
|
|
4861
|
+
inFlight.current = false;
|
|
4862
|
+
}
|
|
4863
|
+
}, [input, resendButton.disabled]),
|
|
4864
|
+
resendButton,
|
|
4865
|
+
resendNeedsSupport: state.kind === "exhausted"
|
|
4866
|
+
};
|
|
4867
|
+
}
|
|
4868
|
+
//#endregion
|
|
5373
4869
|
//#region ../preview-next/src/client/preview/useOnboardingConfirmationCheck.ts
|
|
5374
4870
|
const INITIAL_ONBOARDING_CONFIRMATION_STATE = {
|
|
5375
4871
|
dashboardUnlocked: false,
|
|
@@ -5379,30 +4875,33 @@ const INITIAL_ONBOARDING_CONFIRMATION_STATE = {
|
|
|
5379
4875
|
resendFeedback: null,
|
|
5380
4876
|
statusLoadFailed: false
|
|
5381
4877
|
};
|
|
5382
|
-
function isRecord
|
|
4878
|
+
function isRecord(value) {
|
|
5383
4879
|
return value !== null && typeof value === "object";
|
|
5384
4880
|
}
|
|
5385
4881
|
function getErrorMessageFromEnvelope(payload, fallback) {
|
|
5386
|
-
const error = isRecord
|
|
5387
|
-
const message = isRecord
|
|
4882
|
+
const error = isRecord(payload) ? payload.error : null;
|
|
4883
|
+
const message = isRecord(error) ? error.message : null;
|
|
5388
4884
|
return typeof message === "string" && message.trim().length > 0 ? message : fallback;
|
|
5389
4885
|
}
|
|
5390
4886
|
function isLaunchReadiness(value) {
|
|
5391
|
-
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");
|
|
5392
4888
|
}
|
|
5393
4889
|
function isOnboardingPreviewStatusResponse(value) {
|
|
5394
|
-
return isRecord
|
|
4890
|
+
return isRecord(value) && typeof value.dashboardUnlocked === "boolean" && typeof value.requiresEmailConfirmation === "boolean" && isLaunchReadiness(value.launchReadiness);
|
|
4891
|
+
}
|
|
4892
|
+
function isResendResult(value) {
|
|
4893
|
+
if (value.result === "already_confirmed" || value.result === "limit_reached") return true;
|
|
4894
|
+
return value.result === "resent" && typeof value.retryAfterSeconds === "number" && Number.isFinite(value.retryAfterSeconds) && value.retryAfterSeconds >= 0 && typeof value.limitReached === "boolean";
|
|
5395
4895
|
}
|
|
5396
4896
|
function isResendOnboardingPreviewConfirmationResponse(value) {
|
|
5397
|
-
return isRecord
|
|
4897
|
+
return isRecord(value) && isResendResult(value) && typeof value.dashboardUnlocked === "boolean" && typeof value.requiresEmailConfirmation === "boolean" && isLaunchReadiness(value.launchReadiness);
|
|
5398
4898
|
}
|
|
5399
4899
|
function getSuccessData(payload, isData) {
|
|
5400
|
-
if (!isRecord
|
|
4900
|
+
if (!isRecord(payload) || payload.success !== true || !isData(payload.data)) return null;
|
|
5401
4901
|
return payload.data;
|
|
5402
4902
|
}
|
|
5403
4903
|
function useOnboardingConfirmationCheck(input) {
|
|
5404
4904
|
const [isCheckingConfirmation, setIsCheckingConfirmation] = useState(false);
|
|
5405
|
-
const [isResendingConfirmation, setIsResendingConfirmation] = useState(false);
|
|
5406
4905
|
const [confirmationState, dispatchConfirmationUpdates] = useReducer(applyOnboardingConfirmationUpdates, INITIAL_ONBOARDING_CONFIRMATION_STATE);
|
|
5407
4906
|
const previewUpgradeStartedRef = useRef(false);
|
|
5408
4907
|
const { dashboardUnlocked, dialogState, hasLoadedStatus, launchReadiness, resendFeedback, statusLoadFailed } = confirmationState;
|
|
@@ -5487,49 +4986,39 @@ function useOnboardingConfirmationCheck(input) {
|
|
|
5487
4986
|
input.siteSlug,
|
|
5488
4987
|
readConfirmationStatus
|
|
5489
4988
|
]);
|
|
5490
|
-
const
|
|
5491
|
-
|
|
5492
|
-
|
|
5493
|
-
applyPlan(planMissingResendConfirmationConfig());
|
|
5494
|
-
return;
|
|
5495
|
-
}
|
|
5496
|
-
setIsResendingConfirmation(true);
|
|
5497
|
-
dispatchConfirmationUpdates([{
|
|
5498
|
-
kind: "setResendFeedback",
|
|
5499
|
-
resendFeedback: null
|
|
5500
|
-
}]);
|
|
5501
|
-
try {
|
|
4989
|
+
const resend = usePreviewConfirmationResend({
|
|
4990
|
+
request: useCallback(async () => {
|
|
4991
|
+
if (!resendConfirmationUrl || !input.previewToken) throw new Error(DEFAULT_RESEND_ERROR_MESSAGE);
|
|
5502
4992
|
const response = await fetch(resendConfirmationUrl, {
|
|
5503
4993
|
method: "POST",
|
|
5504
4994
|
headers: { Authorization: `Bearer ${input.previewToken}` }
|
|
5505
4995
|
});
|
|
5506
4996
|
const payload = await response.json().catch(() => null);
|
|
5507
|
-
if (!response.ok)
|
|
4997
|
+
if (!response.ok) {
|
|
4998
|
+
const delay = Number(response.headers.get("Retry-After"));
|
|
4999
|
+
return {
|
|
5000
|
+
kind: "failed",
|
|
5001
|
+
message: getErrorMessageFromEnvelope(payload, DEFAULT_RESEND_ERROR_MESSAGE),
|
|
5002
|
+
retryAfterSeconds: response.status === 429 ? Number.isFinite(delay) && delay > 0 ? Math.ceil(delay) : 60 : 0
|
|
5003
|
+
};
|
|
5004
|
+
}
|
|
5508
5005
|
const data = getSuccessData(payload, isResendOnboardingPreviewConfirmationResponse);
|
|
5509
5006
|
if (!data) throw new Error(DEFAULT_RESEND_ERROR_MESSAGE);
|
|
5510
|
-
|
|
5511
|
-
|
|
5512
|
-
|
|
5513
|
-
|
|
5514
|
-
|
|
5515
|
-
|
|
5516
|
-
|
|
5517
|
-
|
|
5518
|
-
|
|
5519
|
-
|
|
5520
|
-
|
|
5521
|
-
|
|
5522
|
-
|
|
5523
|
-
|
|
5524
|
-
|
|
5525
|
-
currentPreviewUrl,
|
|
5526
|
-
input.authMode,
|
|
5527
|
-
input.dashboardBaseUrl,
|
|
5528
|
-
input.previewToken,
|
|
5529
|
-
input.siteSlug,
|
|
5530
|
-
isResendingConfirmation,
|
|
5531
|
-
resendConfirmationUrl
|
|
5532
|
-
]);
|
|
5007
|
+
return {
|
|
5008
|
+
kind: "success",
|
|
5009
|
+
data
|
|
5010
|
+
};
|
|
5011
|
+
}, [resendConfirmationUrl, input.previewToken]),
|
|
5012
|
+
failed: (message) => applyPlan(planResendConfirmationFailure(message)),
|
|
5013
|
+
succeeded: (response) => applyPlan(planResendConfirmationSuccess({
|
|
5014
|
+
authMode: input.authMode,
|
|
5015
|
+
currentUrl: currentPreviewUrl(),
|
|
5016
|
+
dashboardBaseUrl: input.dashboardBaseUrl,
|
|
5017
|
+
response,
|
|
5018
|
+
siteSlug: input.siteSlug,
|
|
5019
|
+
upgradeAlreadyStarted: previewUpgradeStartedRef.current
|
|
5020
|
+
}))
|
|
5021
|
+
});
|
|
5533
5022
|
useEffect(() => {
|
|
5534
5023
|
if (!input.shouldLoadStatus || !confirmationStatusUrl || !input.previewToken) return;
|
|
5535
5024
|
let cancelled = false;
|
|
@@ -5576,9 +5065,8 @@ function useOnboardingConfirmationCheck(input) {
|
|
|
5576
5065
|
dialogState,
|
|
5577
5066
|
hasLoadedStatus,
|
|
5578
5067
|
isCheckingConfirmation,
|
|
5579
|
-
|
|
5068
|
+
...resend,
|
|
5580
5069
|
launchReadiness,
|
|
5581
|
-
resendConfirmation,
|
|
5582
5070
|
resendFeedback,
|
|
5583
5071
|
statusLoadFailed
|
|
5584
5072
|
};
|
|
@@ -5603,6 +5091,16 @@ function usePreviewRestart(dashboardBaseUrl, siteSlug) {
|
|
|
5603
5091
|
}, [dashboardBaseUrl, siteSlug])
|
|
5604
5092
|
};
|
|
5605
5093
|
}
|
|
5094
|
+
function ConfirmationResendSupport({ visible, dashboardBaseUrl }) {
|
|
5095
|
+
if (!visible || !dashboardBaseUrl) return null;
|
|
5096
|
+
return /* @__PURE__ */ jsx("a", {
|
|
5097
|
+
className: "text-xs underline underline-offset-2",
|
|
5098
|
+
href: new URL("/contact", dashboardBaseUrl).toString(),
|
|
5099
|
+
target: "_blank",
|
|
5100
|
+
rel: "noopener noreferrer",
|
|
5101
|
+
children: "Contact us for help"
|
|
5102
|
+
});
|
|
5103
|
+
}
|
|
5606
5104
|
function PreviewRecoveryBanner({ state, renewalPending, restartAvailable, reauthenticate }) {
|
|
5607
5105
|
const unavailable = state === "unavailable";
|
|
5608
5106
|
return /* @__PURE__ */ jsx(FixedBottomSurface, {
|
|
@@ -5742,36 +5240,43 @@ function PreviewAuthBanner({ dashboardBaseUrl = null, surfaceId }) {
|
|
|
5742
5240
|
]
|
|
5743
5241
|
}), /* @__PURE__ */ jsxs("div", {
|
|
5744
5242
|
className: "flex flex-col gap-2 sm:items-end",
|
|
5745
|
-
children: [
|
|
5746
|
-
|
|
5747
|
-
|
|
5748
|
-
|
|
5749
|
-
|
|
5750
|
-
|
|
5751
|
-
|
|
5752
|
-
|
|
5753
|
-
|
|
5754
|
-
|
|
5755
|
-
|
|
5756
|
-
|
|
5757
|
-
|
|
5758
|
-
|
|
5759
|
-
|
|
5760
|
-
|
|
5761
|
-
|
|
5762
|
-
|
|
5763
|
-
|
|
5764
|
-
|
|
5765
|
-
|
|
5766
|
-
|
|
5767
|
-
|
|
5768
|
-
|
|
5769
|
-
|
|
5770
|
-
|
|
5771
|
-
|
|
5772
|
-
|
|
5773
|
-
|
|
5774
|
-
|
|
5243
|
+
children: [
|
|
5244
|
+
/* @__PURE__ */ jsx("div", {
|
|
5245
|
+
className: "flex flex-col gap-2 sm:flex-row sm:items-center",
|
|
5246
|
+
children: showDashboardCta ? /* @__PURE__ */ jsx(Button, {
|
|
5247
|
+
type: "button",
|
|
5248
|
+
size: "sm",
|
|
5249
|
+
className: bannerModel.primaryButtonClassName,
|
|
5250
|
+
onClick: handleCompleteSetup,
|
|
5251
|
+
disabled: !dashboardContinueUrl,
|
|
5252
|
+
children: bannerModel.ctaLabel
|
|
5253
|
+
}) : /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Button, {
|
|
5254
|
+
type: "button",
|
|
5255
|
+
size: "sm",
|
|
5256
|
+
variant: "outline",
|
|
5257
|
+
className: bannerModel.secondaryButtonClassName,
|
|
5258
|
+
onClick: () => void onboardingConfirmationCheck.resendConfirmation(),
|
|
5259
|
+
disabled: onboardingConfirmationCheck.resendButton.disabled,
|
|
5260
|
+
children: onboardingConfirmationCheck.resendButton.label
|
|
5261
|
+
}), /* @__PURE__ */ jsx(Button, {
|
|
5262
|
+
type: "button",
|
|
5263
|
+
size: "sm",
|
|
5264
|
+
className: bannerModel.primaryButtonClassName,
|
|
5265
|
+
onClick: () => void onboardingConfirmationCheck.checkConfirmation(),
|
|
5266
|
+
disabled: !dashboardContinueUrl || onboardingConfirmationCheck.isCheckingConfirmation,
|
|
5267
|
+
children: onboardingConfirmationCheck.isCheckingConfirmation ? "Checking..." : "I've confirmed my email"
|
|
5268
|
+
})] })
|
|
5269
|
+
}),
|
|
5270
|
+
/* @__PURE__ */ jsx(ConfirmationResendSupport, {
|
|
5271
|
+
visible: onboardingConfirmationCheck.resendNeedsSupport,
|
|
5272
|
+
dashboardBaseUrl
|
|
5273
|
+
}),
|
|
5274
|
+
showOnboardingGrantGuidance && onboardingConfirmationCheck.resendFeedback ? /* @__PURE__ */ jsx("p", {
|
|
5275
|
+
"aria-live": "polite",
|
|
5276
|
+
className: onboardingConfirmationCheck.resendFeedback.kind === "error" ? "text-xs text-destructive" : "text-xs text-muted-foreground",
|
|
5277
|
+
children: onboardingConfirmationCheck.resendFeedback.message
|
|
5278
|
+
}) : null
|
|
5279
|
+
]
|
|
5775
5280
|
})]
|
|
5776
5281
|
})
|
|
5777
5282
|
}), /* @__PURE__ */ jsx(PreviewConfirmationDialog, {
|
|
@@ -5794,7 +5299,7 @@ function PreviewAccessBanners({ dashboardBaseUrl, surfaceId, isEntry, pageNodeTy
|
|
|
5794
5299
|
const { requestedEditingMode, setEditingMode } = useEditor();
|
|
5795
5300
|
const showDiscardedNotice = useEditorUiStore((editor) => canEditorWrite(editor.editability) && editor.leaseDiscardedChanges);
|
|
5796
5301
|
const thing = previewLeaseThing(isEntry, pageNodeType);
|
|
5797
|
-
const admissionNotice = useEditorUiStore((editor) => editorAdmissionNotice(editor.
|
|
5302
|
+
const admissionNotice = useEditorUiStore((editor) => editorAdmissionNotice(editor.getAdmission()));
|
|
5798
5303
|
const active = state === "ok";
|
|
5799
5304
|
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
5800
5305
|
/* @__PURE__ */ jsx(PreviewAuthBanner, {
|
|
@@ -6626,7 +6131,6 @@ function cycleAvailabilityFromFlags(input) {
|
|
|
6626
6131
|
//#region ../preview-next/src/client/preview/SiteChromeCustomizeButton.tsx
|
|
6627
6132
|
function SiteChromeCustomizeButton({ surface, containerClassName = "pointer-events-auto absolute right-2 top-2 z-50 flex gap-1 opacity-0 transition group-focus-within/site-chrome:opacity-100 group-hover/site-chrome:opacity-100" }) {
|
|
6628
6133
|
const customize = useSiteChromeCustomizeOptional();
|
|
6629
|
-
const editorUiStore = useOptionalEditorUiStoreInstance();
|
|
6630
6134
|
const popover = useCustomizePopoverController();
|
|
6631
6135
|
const [backgroundChooserOpen, setBackgroundChooserOpen] = useState(false);
|
|
6632
6136
|
const popoverSide = useSiteChromeCustomizePopoverSide({
|
|
@@ -6773,22 +6277,9 @@ function SiteChromeCustomizeButton({ surface, containerClassName = "pointer-even
|
|
|
6773
6277
|
})]
|
|
6774
6278
|
})]
|
|
6775
6279
|
}) : null,
|
|
6776
|
-
|
|
6777
|
-
|
|
6778
|
-
|
|
6779
|
-
type: "button",
|
|
6780
|
-
className: "w-full rounded-md border bg-background px-3 py-2 text-sm font-medium hover:bg-muted",
|
|
6781
|
-
onClick: (event) => {
|
|
6782
|
-
event.preventDefault();
|
|
6783
|
-
event.stopPropagation();
|
|
6784
|
-
editorUiStore.getState().openPreviewEditor({
|
|
6785
|
-
kind: "design",
|
|
6786
|
-
row: "header-style"
|
|
6787
|
-
});
|
|
6788
|
-
popover.close();
|
|
6789
|
-
},
|
|
6790
|
-
children: "More options"
|
|
6791
|
-
})
|
|
6280
|
+
surfaceState.surface === "header" ? /* @__PURE__ */ jsx(HeaderPopoverActions, {
|
|
6281
|
+
applyAllowed: surfaceState.applyAllowed,
|
|
6282
|
+
onClose: popover.close
|
|
6792
6283
|
}) : null,
|
|
6793
6284
|
surfaceState.diagnostics.length > 0 ? /* @__PURE__ */ jsx("ul", {
|
|
6794
6285
|
className: "space-y-1 text-xs text-amber-700",
|
|
@@ -6807,6 +6298,44 @@ function SiteChromeCustomizeButton({ surface, containerClassName = "pointer-even
|
|
|
6807
6298
|
]
|
|
6808
6299
|
});
|
|
6809
6300
|
}
|
|
6301
|
+
/** What the header popover offers beyond its own controls: the fuller editor, and a way back to the style. */
|
|
6302
|
+
function HeaderPopoverActions({ applyAllowed, onClose }) {
|
|
6303
|
+
const customize = useSiteChromeCustomizeOptional();
|
|
6304
|
+
const editorUiStore = useOptionalEditorUiStoreInstance();
|
|
6305
|
+
const run = (action) => (event) => {
|
|
6306
|
+
event.preventDefault();
|
|
6307
|
+
event.stopPropagation();
|
|
6308
|
+
action();
|
|
6309
|
+
};
|
|
6310
|
+
const className = "inline-flex w-full items-center justify-center gap-2 rounded-md border bg-background px-3 py-2 text-sm font-medium hover:bg-muted disabled:cursor-not-allowed disabled:opacity-50";
|
|
6311
|
+
const moreOptions = editorUiStore !== null && customize?.canOpenDesignEditor === true;
|
|
6312
|
+
const reset = customize?.headerFollowsStyleDefaults() === false;
|
|
6313
|
+
if (!customize || !moreOptions && !reset) return null;
|
|
6314
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
6315
|
+
className: "space-y-2 border-t pt-2",
|
|
6316
|
+
children: [moreOptions ? /* @__PURE__ */ jsx("button", {
|
|
6317
|
+
type: "button",
|
|
6318
|
+
className,
|
|
6319
|
+
onClick: run(() => {
|
|
6320
|
+
editorUiStore.getState().openPreviewEditor({
|
|
6321
|
+
kind: "design",
|
|
6322
|
+
row: "header-style"
|
|
6323
|
+
});
|
|
6324
|
+
onClose();
|
|
6325
|
+
}),
|
|
6326
|
+
children: "More options"
|
|
6327
|
+
}) : null, reset ? /* @__PURE__ */ jsxs("button", {
|
|
6328
|
+
type: "button",
|
|
6329
|
+
className,
|
|
6330
|
+
disabled: !applyAllowed,
|
|
6331
|
+
onClick: run(customize.resetHeaderToStyleDefaults),
|
|
6332
|
+
children: [/* @__PURE__ */ jsx(RotateCcw, {
|
|
6333
|
+
className: "h-4 w-4",
|
|
6334
|
+
"aria-hidden": "true"
|
|
6335
|
+
}), "Reset to the style's defaults"]
|
|
6336
|
+
}) : null]
|
|
6337
|
+
});
|
|
6338
|
+
}
|
|
6810
6339
|
/** Opens the footer composer, matching the block toolbar's Edit pill. */
|
|
6811
6340
|
function FooterEditPill() {
|
|
6812
6341
|
const editorUiStore = useOptionalEditorUiStoreInstance();
|
|
@@ -7086,581 +6615,6 @@ function joinClassNames(...values) {
|
|
|
7086
6615
|
return className.length > 0 ? className : void 0;
|
|
7087
6616
|
}
|
|
7088
6617
|
//#endregion
|
|
7089
|
-
//#region ../preview-next/src/client/utils/path.ts
|
|
7090
|
-
const PATH_SEPARATOR_REGEX = /\./g;
|
|
7091
|
-
const BRACKET_ACCESS_REGEX = /\[([^\]]+)\]/g;
|
|
7092
|
-
function isRecord$1(value) {
|
|
7093
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
7094
|
-
}
|
|
7095
|
-
function isPathContainer(value) {
|
|
7096
|
-
return Array.isArray(value) || isRecord$1(value);
|
|
7097
|
-
}
|
|
7098
|
-
function createPathContainer(nextIsIndex) {
|
|
7099
|
-
return nextIsIndex ? [] : {};
|
|
7100
|
-
}
|
|
7101
|
-
function ensureContainerProperty(container, key, nextIsIndex) {
|
|
7102
|
-
const existing = Reflect.get(container, key);
|
|
7103
|
-
if (isPathContainer(existing)) return existing;
|
|
7104
|
-
const nextContainer = createPathContainer(nextIsIndex);
|
|
7105
|
-
Reflect.set(container, key, nextContainer);
|
|
7106
|
-
return nextContainer;
|
|
7107
|
-
}
|
|
7108
|
-
function parsePath(path) {
|
|
7109
|
-
if (Array.isArray(path)) return path;
|
|
7110
|
-
const segments = [];
|
|
7111
|
-
const parts = path.split(PATH_SEPARATOR_REGEX);
|
|
7112
|
-
for (const raw of parts) {
|
|
7113
|
-
if (!raw) continue;
|
|
7114
|
-
const baseMatch = raw.match(/^[^\[]+/);
|
|
7115
|
-
if (baseMatch) {
|
|
7116
|
-
const base = baseMatch[1] ?? baseMatch[0];
|
|
7117
|
-
if (/^\d+$/.test(base)) segments.push(Number(base));
|
|
7118
|
-
else segments.push(base);
|
|
7119
|
-
}
|
|
7120
|
-
const bracketMatches = raw.matchAll(BRACKET_ACCESS_REGEX);
|
|
7121
|
-
for (const match of bracketMatches) {
|
|
7122
|
-
const token = match[1] ?? "";
|
|
7123
|
-
if (token.startsWith("\"") || token.startsWith("'")) segments.push(token.slice(1, -1));
|
|
7124
|
-
else if (/^\d+$/.test(token)) segments.push(Number(token));
|
|
7125
|
-
else segments.push(token);
|
|
7126
|
-
}
|
|
7127
|
-
if (!baseMatch && !raw.includes("[")) segments.push(raw);
|
|
7128
|
-
}
|
|
7129
|
-
return segments;
|
|
7130
|
-
}
|
|
7131
|
-
function setAtPath(target, path, value) {
|
|
7132
|
-
const segments = parsePath(path);
|
|
7133
|
-
let current = target;
|
|
7134
|
-
for (let index = 0; index < segments.length; index += 1) {
|
|
7135
|
-
const segment = segments[index];
|
|
7136
|
-
if (segment === void 0) continue;
|
|
7137
|
-
const isLast = index === segments.length - 1;
|
|
7138
|
-
const nextIsIndex = typeof segments[index + 1] === "number";
|
|
7139
|
-
if (isLast) {
|
|
7140
|
-
if (typeof segment === "number") {
|
|
7141
|
-
if (Array.isArray(current)) current[segment] = value;
|
|
7142
|
-
} else Reflect.set(current, segment, value);
|
|
7143
|
-
return;
|
|
7144
|
-
}
|
|
7145
|
-
if (typeof segment === "number") {
|
|
7146
|
-
if (Array.isArray(current)) {
|
|
7147
|
-
const existing = current[segment];
|
|
7148
|
-
if (isPathContainer(existing)) current = existing;
|
|
7149
|
-
else {
|
|
7150
|
-
const nextContainer = createPathContainer(nextIsIndex);
|
|
7151
|
-
current[segment] = nextContainer;
|
|
7152
|
-
current = nextContainer;
|
|
7153
|
-
}
|
|
7154
|
-
continue;
|
|
7155
|
-
}
|
|
7156
|
-
current = ensureContainerProperty(current, String(segment), nextIsIndex);
|
|
7157
|
-
continue;
|
|
7158
|
-
}
|
|
7159
|
-
current = ensureContainerProperty(current, segment, nextIsIndex);
|
|
7160
|
-
}
|
|
7161
|
-
}
|
|
7162
|
-
//#endregion
|
|
7163
|
-
//#region ../preview-next/src/client/blocks/previewProjection/aiProposalProjection.ts
|
|
7164
|
-
function previewProjectionsFromAiOverlays(overlays) {
|
|
7165
|
-
if (!overlays) return [];
|
|
7166
|
-
const overrides = overlays.overrides ?? /* @__PURE__ */ new Map();
|
|
7167
|
-
const projections = [];
|
|
7168
|
-
if (overlays.structure) projections.push({
|
|
7169
|
-
kind: "structure-overlay",
|
|
7170
|
-
source: "ai-proposal",
|
|
7171
|
-
viewMode: overlays.viewMode,
|
|
7172
|
-
proposalId: overlays.structure.proposalId,
|
|
7173
|
-
includeUnspecified: overlays.structure.includeUnspecified,
|
|
7174
|
-
before: overlays.structure.before,
|
|
7175
|
-
after: overlays.structure.after
|
|
7176
|
-
});
|
|
7177
|
-
if (overrides.size > 0) projections.push({
|
|
7178
|
-
kind: "content-field-overrides",
|
|
7179
|
-
source: "ai-proposal",
|
|
7180
|
-
viewMode: overlays.viewMode,
|
|
7181
|
-
overrides
|
|
7182
|
-
});
|
|
7183
|
-
return projections;
|
|
7184
|
-
}
|
|
7185
|
-
function toStringArray(value) {
|
|
7186
|
-
return Array.isArray(value) ? value.filter((item) => typeof item === "string") : [];
|
|
7187
|
-
}
|
|
7188
|
-
function applyStructureProjection(blockItems, projection) {
|
|
7189
|
-
const order = projection.viewMode === "before" ? toStringArray(projection.before.blockIds) : toStringArray(projection.after.blockIds);
|
|
7190
|
-
if (order.length === 0) return blockItems.slice();
|
|
7191
|
-
const itemsById = /* @__PURE__ */ new Map();
|
|
7192
|
-
const unknownIdItems = [];
|
|
7193
|
-
for (const item of blockItems) if (typeof item.id === "string") itemsById.set(item.id, item);
|
|
7194
|
-
else unknownIdItems.push(item);
|
|
7195
|
-
const next = [];
|
|
7196
|
-
const orderedSet = new Set(order);
|
|
7197
|
-
const addedBlocksById = /* @__PURE__ */ new Map();
|
|
7198
|
-
for (const added of projection.after.addedBlocks ?? []) {
|
|
7199
|
-
if (!added || typeof added !== "object") continue;
|
|
7200
|
-
if (typeof added.id !== "string") continue;
|
|
7201
|
-
if (typeof added.kind !== "string") continue;
|
|
7202
|
-
addedBlocksById.set(added.id, {
|
|
7203
|
-
id: added.id,
|
|
7204
|
-
kind: added.kind,
|
|
7205
|
-
content: added.content ?? null
|
|
7206
|
-
});
|
|
7207
|
-
}
|
|
7208
|
-
for (const id of order) {
|
|
7209
|
-
const item = itemsById.get(id);
|
|
7210
|
-
if (item) {
|
|
7211
|
-
next.push(item);
|
|
7212
|
-
continue;
|
|
7213
|
-
}
|
|
7214
|
-
const added = addedBlocksById.get(id);
|
|
7215
|
-
if (added) next.push(added);
|
|
7216
|
-
}
|
|
7217
|
-
if (projection.includeUnspecified !== false) {
|
|
7218
|
-
for (const item of blockItems) if (typeof item.id === "string" && !orderedSet.has(item.id)) next.push(item);
|
|
7219
|
-
}
|
|
7220
|
-
if (unknownIdItems.length > 0) next.push(...unknownIdItems);
|
|
7221
|
-
return next;
|
|
7222
|
-
}
|
|
7223
|
-
function applyContentFieldOverrideProjection(blockId, content, projection) {
|
|
7224
|
-
if (projection.overrides.size === 0) return content;
|
|
7225
|
-
const prefix = `blocks.${blockId}.`;
|
|
7226
|
-
let next = null;
|
|
7227
|
-
for (const [editorPath, override] of projection.overrides.entries()) {
|
|
7228
|
-
if (!editorPath.startsWith(prefix)) continue;
|
|
7229
|
-
const fieldPath = editorPath.slice(prefix.length);
|
|
7230
|
-
if (!next) next = cloneRecord(content);
|
|
7231
|
-
const value = projection.viewMode === "after" ? override.after : override.before;
|
|
7232
|
-
setAtPath(next, parsePath(fieldPath), value);
|
|
7233
|
-
}
|
|
7234
|
-
return next ?? content;
|
|
7235
|
-
}
|
|
7236
|
-
function blockHasContentFieldOverrideProjection(blockId, projection) {
|
|
7237
|
-
if (projection.overrides.size === 0) return false;
|
|
7238
|
-
const prefix = `blocks.${blockId}.`;
|
|
7239
|
-
for (const editorPath of projection.overrides.keys()) if (editorPath.startsWith(prefix)) return true;
|
|
7240
|
-
return false;
|
|
7241
|
-
}
|
|
7242
|
-
function cloneRecord(value) {
|
|
7243
|
-
if (!value) return {};
|
|
7244
|
-
return JSON.parse(JSON.stringify(value));
|
|
7245
|
-
}
|
|
7246
|
-
//#endregion
|
|
7247
|
-
//#region ../preview-next/src/client/blocks/previewProjection/runtimeContentDecoration.ts
|
|
7248
|
-
function runtimeContentDecorationProjectionFromEditorModel(editorModel, surfaceResolutionContext, designRules, componentRules) {
|
|
7249
|
-
const compiled = compileEditorModelRuntime({
|
|
7250
|
-
editorModel,
|
|
7251
|
-
surfaceResolutionContext,
|
|
7252
|
-
designRules,
|
|
7253
|
-
componentRules
|
|
7254
|
-
});
|
|
7255
|
-
return {
|
|
7256
|
-
kind: "runtime-content-decoration",
|
|
7257
|
-
source: "page-design",
|
|
7258
|
-
fieldsByBlockId: runtimeFieldsByBlockId(compiled.blocks),
|
|
7259
|
-
joins: compiled.joins
|
|
7260
|
-
};
|
|
7261
|
-
}
|
|
7262
|
-
function runtimeFieldsByBlockId(blocks) {
|
|
7263
|
-
return new Map(blocks.map((block) => [block.blockId, block.fields]));
|
|
7264
|
-
}
|
|
7265
|
-
function applyRuntimeContentDecorationProjection(block, content, projection) {
|
|
7266
|
-
const blockId = designBlockIdFromBlockItem(block);
|
|
7267
|
-
const fields = blockId ? projection.fieldsByBlockId.get(blockId) : void 0;
|
|
7268
|
-
return applyCompiledRuntimeFieldsToContent(isRecord(content) ? content : {}, fields);
|
|
7269
|
-
}
|
|
7270
|
-
function designBlockIdFromBlockItem(block) {
|
|
7271
|
-
return typeof block.id === "string" && block.id.length > 0 ? asDesignBlockId(block.id) : null;
|
|
7272
|
-
}
|
|
7273
|
-
function isRecord(value) {
|
|
7274
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
7275
|
-
}
|
|
7276
|
-
//#endregion
|
|
7277
|
-
//#region ../blocks/src/bindings/types.ts
|
|
7278
|
-
/**
|
|
7279
|
-
* Available transform function names.
|
|
7280
|
-
*/
|
|
7281
|
-
const TRANSFORMS = BINDING_TRANSFORMS;
|
|
7282
|
-
const BINDING_SOURCES = [
|
|
7283
|
-
"field",
|
|
7284
|
-
"meta",
|
|
7285
|
-
"literal",
|
|
7286
|
-
"transform",
|
|
7287
|
-
"fallback"
|
|
7288
|
-
];
|
|
7289
|
-
//#endregion
|
|
7290
|
-
//#region ../blocks/src/bindings/index.ts
|
|
7291
|
-
/**
|
|
7292
|
-
* Resolves a binding map to actual content values.
|
|
7293
|
-
*
|
|
7294
|
-
* Returns only keys whose binding resolved to a non-null, non-undefined value.
|
|
7295
|
-
* To merge resolved bindings over a base content object (the dashboard
|
|
7296
|
-
* template preview's use case), see {@link applyBindingsToContent}.
|
|
7297
|
-
*
|
|
7298
|
-
* @param bindings - Map of field keys to binding descriptors
|
|
7299
|
-
* @param context - Entry data context (fields and meta)
|
|
7300
|
-
* @returns Resolved content object with actual values
|
|
7301
|
-
*
|
|
7302
|
-
* @example
|
|
7303
|
-
* ```typescript
|
|
7304
|
-
* const content = applyBindings(
|
|
7305
|
-
* {
|
|
7306
|
-
* headline: { source: 'meta', path: 'title' },
|
|
7307
|
-
* body: { source: 'field', path: 'content' },
|
|
7308
|
-
* },
|
|
7309
|
-
* {
|
|
7310
|
-
* fields: { content: 'Hello world' },
|
|
7311
|
-
* meta: { title: 'My Post', slug: 'my-post' },
|
|
7312
|
-
* }
|
|
7313
|
-
* );
|
|
7314
|
-
* // Result: { headline: 'My Post', body: 'Hello world' }
|
|
7315
|
-
* ```
|
|
7316
|
-
*/
|
|
7317
|
-
function applyBindings(bindings, context) {
|
|
7318
|
-
const result = {};
|
|
7319
|
-
for (const [key, bindingSpec] of Object.entries(bindings)) {
|
|
7320
|
-
if (isBindingDescriptor(bindingSpec)) {
|
|
7321
|
-
const value = resolveBindingValue(bindingSpec, context);
|
|
7322
|
-
if (value !== void 0 && value !== null) setBindingValue(result, key, value);
|
|
7323
|
-
continue;
|
|
7324
|
-
}
|
|
7325
|
-
if (typeof bindingSpec === "string") {
|
|
7326
|
-
const value = resolveBindingValue({
|
|
7327
|
-
source: "field",
|
|
7328
|
-
path: bindingSpec
|
|
7329
|
-
}, context);
|
|
7330
|
-
if (value !== void 0 && value !== null) setBindingValue(result, key, value);
|
|
7331
|
-
continue;
|
|
7332
|
-
}
|
|
7333
|
-
if (isRecord$7(bindingSpec)) {
|
|
7334
|
-
const nested = applyBindings(bindingSpec, context);
|
|
7335
|
-
if (Object.keys(nested).length > 0) setBindingValue(result, key, nested);
|
|
7336
|
-
}
|
|
7337
|
-
}
|
|
7338
|
-
return result;
|
|
7339
|
-
}
|
|
7340
|
-
/**
|
|
7341
|
-
* Resolve a binding map and merge the result over a base content object.
|
|
7342
|
-
*
|
|
7343
|
-
* Use this when a block has *some* hard-coded content (from a template's
|
|
7344
|
-
* `block.content`) and *some* values driven by template bindings against
|
|
7345
|
-
* an entry. The base provides defaults; resolved bindings override them.
|
|
7346
|
-
*
|
|
7347
|
-
* Same null-handling as {@link applyBindings}: keys whose binding resolves
|
|
7348
|
-
* to `null`/`undefined` do NOT overwrite the base. This means "no resolved
|
|
7349
|
-
* value" leaves the base value (or absence) intact, which is the correct
|
|
7350
|
-
* semantic for both the SDK/frontend render paths and the dashboard preview.
|
|
7351
|
-
*
|
|
7352
|
-
* Replaces the dashboard's bespoke `applyBindings` that lived in
|
|
7353
|
-
* `apps/dashboard/src/lib/templates/applyBindings.ts` — its divergent
|
|
7354
|
-
* "always-set-null" behaviour produced the `subheadline: null` regression
|
|
7355
|
-
* documented in Phase 1.
|
|
7356
|
-
*
|
|
7357
|
-
* @example
|
|
7358
|
-
* ```typescript
|
|
7359
|
-
* const content = applyBindingsToContent(
|
|
7360
|
-
* { eyebrow: 'Default eyebrow', headline: 'Default headline' },
|
|
7361
|
-
* { headline: { source: 'meta', path: 'title' } },
|
|
7362
|
-
* { fields: {}, meta: { title: 'Entry title' } },
|
|
7363
|
-
* );
|
|
7364
|
-
* // Result: { eyebrow: 'Default eyebrow', headline: 'Entry title' }
|
|
7365
|
-
* ```
|
|
7366
|
-
*/
|
|
7367
|
-
function applyBindingsToContent(baseContent, bindings, context) {
|
|
7368
|
-
return mergeResolvedBindings(baseContent, applyBindings(bindings, context));
|
|
7369
|
-
}
|
|
7370
|
-
function mergeResolvedBindings(base, resolved) {
|
|
7371
|
-
const merged = { ...base };
|
|
7372
|
-
for (const [key, resolvedValue] of Object.entries(resolved)) {
|
|
7373
|
-
const baseValue = merged[key];
|
|
7374
|
-
merged[key] = isRecord$7(baseValue) && isRecord$7(resolvedValue) ? mergeResolvedBindings(baseValue, resolvedValue) : resolvedValue;
|
|
7375
|
-
}
|
|
7376
|
-
return merged;
|
|
7377
|
-
}
|
|
7378
|
-
function setBindingValue(target, path, value) {
|
|
7379
|
-
const segments = path.split(".").map((segment) => segment.trim()).filter(Boolean);
|
|
7380
|
-
if (segments.length === 0) return;
|
|
7381
|
-
const firstSegment = segments[0];
|
|
7382
|
-
if (!firstSegment) return;
|
|
7383
|
-
if (segments.length === 1) {
|
|
7384
|
-
target[firstSegment] = value;
|
|
7385
|
-
return;
|
|
7386
|
-
}
|
|
7387
|
-
const isIndex = (segment) => /^\d+$/.test(segment);
|
|
7388
|
-
let current = target;
|
|
7389
|
-
for (let i = 0; i < segments.length; i++) {
|
|
7390
|
-
const segment = segments[i];
|
|
7391
|
-
if (!segment) return;
|
|
7392
|
-
const last = i === segments.length - 1;
|
|
7393
|
-
const nextSegment = segments[i + 1];
|
|
7394
|
-
if (last) {
|
|
7395
|
-
if (Array.isArray(current) && isIndex(segment)) {
|
|
7396
|
-
current[Number(segment)] = value;
|
|
7397
|
-
return;
|
|
7398
|
-
}
|
|
7399
|
-
if (isRecord$7(current)) current[segment] = value;
|
|
7400
|
-
return;
|
|
7401
|
-
}
|
|
7402
|
-
const nextWantsArray = typeof nextSegment === "string" && isIndex(nextSegment);
|
|
7403
|
-
if (Array.isArray(current) && isIndex(segment)) {
|
|
7404
|
-
const index = Number(segment);
|
|
7405
|
-
const existing = current[index];
|
|
7406
|
-
if (nextWantsArray) {
|
|
7407
|
-
if (!Array.isArray(existing)) current[index] = [];
|
|
7408
|
-
} else if (!isRecord$7(existing)) current[index] = {};
|
|
7409
|
-
current = current[index];
|
|
7410
|
-
continue;
|
|
7411
|
-
}
|
|
7412
|
-
if (isRecord$7(current)) {
|
|
7413
|
-
const existing = current[segment];
|
|
7414
|
-
if (nextWantsArray) {
|
|
7415
|
-
if (!Array.isArray(existing)) current[segment] = [];
|
|
7416
|
-
} else if (!isRecord$7(existing)) current[segment] = {};
|
|
7417
|
-
current = current[segment];
|
|
7418
|
-
continue;
|
|
7419
|
-
}
|
|
7420
|
-
return;
|
|
7421
|
-
}
|
|
7422
|
-
}
|
|
7423
|
-
/**
|
|
7424
|
-
* Resolves a single binding descriptor to its value.
|
|
7425
|
-
*/
|
|
7426
|
-
function resolveBindingValue(descriptor, context) {
|
|
7427
|
-
switch (descriptor.source) {
|
|
7428
|
-
case "field": return descriptor.path ? getPath(context.fields, descriptor.path) : void 0;
|
|
7429
|
-
case "meta": return descriptor.path ? getPath(context.meta, descriptor.path) : void 0;
|
|
7430
|
-
case "literal": return descriptor.value;
|
|
7431
|
-
case "transform": {
|
|
7432
|
-
const inputDescriptor = descriptor.input && isBindingDescriptorLike(descriptor.input) ? normalizeBindingInput(descriptor.input) : descriptor.path ? normalizeBindingInput(descriptor.path) : null;
|
|
7433
|
-
const inputValue = inputDescriptor ? resolveBindingValue(inputDescriptor, context) : void 0;
|
|
7434
|
-
return applyTransform(descriptor.transform, inputValue, context.dateContext);
|
|
7435
|
-
}
|
|
7436
|
-
case "fallback":
|
|
7437
|
-
for (const option of descriptor.options ?? []) {
|
|
7438
|
-
const normalized = normalizeBindingInput(option);
|
|
7439
|
-
if (!normalized) continue;
|
|
7440
|
-
const value = resolveBindingValue(normalized, context);
|
|
7441
|
-
if (value !== void 0 && value !== null && value !== "") return value;
|
|
7442
|
-
}
|
|
7443
|
-
return null;
|
|
7444
|
-
default: return null;
|
|
7445
|
-
}
|
|
7446
|
-
}
|
|
7447
|
-
/**
|
|
7448
|
-
* Gets a nested path from an object.
|
|
7449
|
-
*/
|
|
7450
|
-
function getPath(source, path) {
|
|
7451
|
-
const segments = path.split(".").map((segment) => segment.trim()).filter(Boolean);
|
|
7452
|
-
let current = source;
|
|
7453
|
-
for (const segment of segments) {
|
|
7454
|
-
if (!isRecord$7(current)) return void 0;
|
|
7455
|
-
current = current[segment];
|
|
7456
|
-
}
|
|
7457
|
-
return current;
|
|
7458
|
-
}
|
|
7459
|
-
/**
|
|
7460
|
-
* Applies a transform function to a value.
|
|
7461
|
-
*/
|
|
7462
|
-
function applyTransform(name, value, dateContext) {
|
|
7463
|
-
if (!name) return value;
|
|
7464
|
-
switch (name) {
|
|
7465
|
-
case TRANSFORMS.RICHTEXT_FIRST_PARAGRAPH: return extractFirstParagraph(value);
|
|
7466
|
-
case TRANSFORMS.DATE_FORMAT_SHORT: return formatDate(value, dateContext, { date: "short" });
|
|
7467
|
-
case TRANSFORMS.DATE_FORMAT_LONG: return formatDate(value, dateContext, {
|
|
7468
|
-
date: "long",
|
|
7469
|
-
includeTime: true
|
|
7470
|
-
});
|
|
7471
|
-
case TRANSFORMS.TEXT_INLINE_TEXT: return textToInlineText(value);
|
|
7472
|
-
default: return value;
|
|
7473
|
-
}
|
|
7474
|
-
}
|
|
7475
|
-
function textToInlineText(value) {
|
|
7476
|
-
if (typeof value !== "string") return null;
|
|
7477
|
-
return plainTextToInlineText(value);
|
|
7478
|
-
}
|
|
7479
|
-
/**
|
|
7480
|
-
* Extracts the first paragraph text from a TipTap/ProseMirror document.
|
|
7481
|
-
*
|
|
7482
|
-
* Accepts the canonical unwrapped form (`{ type: 'doc', content: [...] }`).
|
|
7483
|
-
*/
|
|
7484
|
-
function extractFirstParagraph(value) {
|
|
7485
|
-
if (!isRichTextDoc(value)) return null;
|
|
7486
|
-
for (const node of value.content) {
|
|
7487
|
-
if (!isRecord$7(node)) continue;
|
|
7488
|
-
if (node.type !== "paragraph" || !Array.isArray(node.content)) continue;
|
|
7489
|
-
const text = node.content.filter((item) => item.type === "text").map((item) => typeof item.text === "string" ? item.text : "").join("").trim();
|
|
7490
|
-
if (text.length > 0) return text;
|
|
7491
|
-
}
|
|
7492
|
-
return null;
|
|
7493
|
-
}
|
|
7494
|
-
/**
|
|
7495
|
-
* Type guard to check if a value is a valid binding descriptor.
|
|
7496
|
-
*/
|
|
7497
|
-
function isBindingDescriptor(value) {
|
|
7498
|
-
if (!isRecord$7(value) || typeof value.source !== "string") return false;
|
|
7499
|
-
if (!BINDING_SOURCES.includes(value.source)) return false;
|
|
7500
|
-
switch (value.source) {
|
|
7501
|
-
case "field":
|
|
7502
|
-
case "meta": return typeof value.path === "string";
|
|
7503
|
-
case "literal": return "value" in value;
|
|
7504
|
-
case "transform": return typeof value.transform === "string" && (value.input === void 0 || isBindingDescriptorLike(value.input)) && (value.path === void 0 || typeof value.path === "string");
|
|
7505
|
-
case "fallback": return Array.isArray(value.options);
|
|
7506
|
-
default: return false;
|
|
7507
|
-
}
|
|
7508
|
-
}
|
|
7509
|
-
/**
|
|
7510
|
-
* Type guard to check if a value is binding-descriptor-like (can be normalized).
|
|
7511
|
-
*/
|
|
7512
|
-
function isBindingDescriptorLike(value) {
|
|
7513
|
-
return isBindingDescriptor(value) || typeof value === "string" || isRecord$7(value) && typeof value.source === "string" && typeof value.path === "string";
|
|
7514
|
-
}
|
|
7515
|
-
/**
|
|
7516
|
-
* Normalizes a binding input to a binding descriptor.
|
|
7517
|
-
*
|
|
7518
|
-
* Converts string shorthand to field descriptors and validates
|
|
7519
|
-
* that objects have valid binding source values.
|
|
7520
|
-
*/
|
|
7521
|
-
function normalizeBindingInput(value) {
|
|
7522
|
-
if (isBindingDescriptor(value)) return value;
|
|
7523
|
-
if (typeof value === "string") return {
|
|
7524
|
-
source: "field",
|
|
7525
|
-
path: value
|
|
7526
|
-
};
|
|
7527
|
-
return null;
|
|
7528
|
-
}
|
|
7529
|
-
//#endregion
|
|
7530
|
-
//#region ../preview-next/src/client/blocks/previewProjection/entryFieldRebinding.ts
|
|
7531
|
-
/**
|
|
7532
|
-
* Only the entry fields that changed are bound in again: unchanged fields keep
|
|
7533
|
-
* the server's materialised value, which may be richer than the stored one
|
|
7534
|
-
* (media the loaders have hydrated, for instance).
|
|
7535
|
-
*/
|
|
7536
|
-
function entryFieldRebindingProjection(changedFields, dateContext) {
|
|
7537
|
-
return Object.keys(changedFields).length === 0 ? null : {
|
|
7538
|
-
kind: "entry-field-rebinding",
|
|
7539
|
-
source: "entry-draft",
|
|
7540
|
-
changedFields,
|
|
7541
|
-
dateContext
|
|
7542
|
-
};
|
|
7543
|
-
}
|
|
7544
|
-
/**
|
|
7545
|
-
* Binds the changed entry fields into a block with template bindings. A binding
|
|
7546
|
-
* whose source did not change resolves to nothing and leaves the content as it is.
|
|
7547
|
-
*/
|
|
7548
|
-
function applyEntryFieldRebindingProjection(block, content, projection) {
|
|
7549
|
-
if (!isRecord$7(block.bindings)) return content;
|
|
7550
|
-
return applyBindingsToContent(content ?? {}, block.bindings, {
|
|
7551
|
-
fields: { ...projection.changedFields },
|
|
7552
|
-
meta: {},
|
|
7553
|
-
dateContext: projection.dateContext
|
|
7554
|
-
});
|
|
7555
|
-
}
|
|
7556
|
-
//#endregion
|
|
7557
|
-
//#region ../preview-next/src/client/blocks/previewProjection/applyPreviewProjections.ts
|
|
7558
|
-
function applyPreviewStructureProjections(blockItems, projections) {
|
|
7559
|
-
return projections.reduce((current, projection) => {
|
|
7560
|
-
if (projection.kind !== "structure-overlay") return current;
|
|
7561
|
-
return applyStructureProjection(current, projection);
|
|
7562
|
-
}, blockItems.slice());
|
|
7563
|
-
}
|
|
7564
|
-
function applyPreviewContentFieldProjections(blockId, content, projections) {
|
|
7565
|
-
return projections.reduce((current, projection) => {
|
|
7566
|
-
if (projection.kind !== "content-field-overrides") return current;
|
|
7567
|
-
return applyContentFieldOverrideProjection(blockId, current, projection);
|
|
7568
|
-
}, content);
|
|
7569
|
-
}
|
|
7570
|
-
function applyPreviewRuntimeContentProjections(block, content, projections) {
|
|
7571
|
-
return projections.reduce((current, projection) => {
|
|
7572
|
-
if (projection.kind === "entry-field-rebinding") return applyEntryFieldRebindingProjection(block, current, projection);
|
|
7573
|
-
if (projection.kind !== "runtime-content-decoration") return current;
|
|
7574
|
-
return applyRuntimeContentDecorationProjection(block, current, projection);
|
|
7575
|
-
}, content);
|
|
7576
|
-
}
|
|
7577
|
-
function blockHasPreviewContentFieldProjection(blockId, projections) {
|
|
7578
|
-
return projections.some((projection) => projection.kind === "content-field-overrides" && blockHasContentFieldOverrideProjection(blockId, projection));
|
|
7579
|
-
}
|
|
7580
|
-
//#endregion
|
|
7581
|
-
//#region ../preview-next/src/client/blocks/pageDesignRuntimePreview.ts
|
|
7582
|
-
function resolveRuntimePreviewSourceForTheme(pageDesignState, theme) {
|
|
7583
|
-
if (!theme?.palette) return resolveRuntimePreviewSource({
|
|
7584
|
-
pageDesignState,
|
|
7585
|
-
surfaceResolutionContext: null
|
|
7586
|
-
});
|
|
7587
|
-
return resolveRuntimePreviewSource({
|
|
7588
|
-
pageDesignState,
|
|
7589
|
-
surfaceResolutionContext: surfaceResolutionContextFromTheme(theme),
|
|
7590
|
-
designRules: designRuntimeRulesForTheme(theme),
|
|
7591
|
-
componentRules: componentRuntimeRulesForTheme(theme)
|
|
7592
|
-
});
|
|
7593
|
-
}
|
|
7594
|
-
function applyPageDesignRuntimeFieldsToBlockContent(block, content, source) {
|
|
7595
|
-
if (source.kind === "preserve-server-runtime") return content;
|
|
7596
|
-
return applyPreviewRuntimeContentProjections(block, content, [runtimeContentDecorationProjectionFromEditorModel(source.editorModel, source.surfaceResolutionContext, source.designRules, source.componentRules)]);
|
|
7597
|
-
}
|
|
7598
|
-
function pageDesignRuntimeProjectionFromSource(source) {
|
|
7599
|
-
if (source.kind === "preserve-server-runtime") return null;
|
|
7600
|
-
return runtimeContentDecorationProjectionFromEditorModel(source.editorModel, source.surfaceResolutionContext, source.designRules, source.componentRules);
|
|
7601
|
-
}
|
|
7602
|
-
function resolveRuntimePreviewSource(input) {
|
|
7603
|
-
if (input.pageDesignState.kind === "loaded" && input.surfaceResolutionContext) return {
|
|
7604
|
-
kind: "apply-editor-model",
|
|
7605
|
-
editorModel: input.pageDesignState.editorModel,
|
|
7606
|
-
surfaceResolutionContext: input.surfaceResolutionContext,
|
|
7607
|
-
designRules: input.designRules,
|
|
7608
|
-
componentRules: input.componentRules
|
|
7609
|
-
};
|
|
7610
|
-
return { kind: "preserve-server-runtime" };
|
|
7611
|
-
}
|
|
7612
|
-
//#endregion
|
|
7613
|
-
//#region ../preview-next/src/client/preview/usePreviewOpeningTheme.ts
|
|
7614
|
-
const noSubscription = () => () => {};
|
|
7615
|
-
const noSnapshot = () => null;
|
|
7616
|
-
/** Select opening inputs; project canonical theme once, and retain it while ink is unchanged. */
|
|
7617
|
-
function usePreviewOpeningTheme(documentTheme) {
|
|
7618
|
-
const store = useOptionalEditorUiStoreInstance();
|
|
7619
|
-
const { state } = usePreviewPageDesignEditorState();
|
|
7620
|
-
const chrome = useSiteChromeCustomizeOptional();
|
|
7621
|
-
const { persistenceOverlayTheme: theme } = usePreviewThemeOverlay();
|
|
7622
|
-
const opening = state.kind === "loaded" ? state.editorModel.blocks[0] : null;
|
|
7623
|
-
const blockId = opening ? unsafeAsEditorBlockId(opening.blockId) : null;
|
|
7624
|
-
const selectContent = useCallback(() => store && blockId ? renderedBlockContent(store, blockId) : null, [store, blockId]);
|
|
7625
|
-
const content = useSyncExternalStore(store?.subscribe ?? noSubscription, selectContent, noSnapshot);
|
|
7626
|
-
const selectOverlays = useCallback(() => store?.getState().aiOverlays ?? null, [store]);
|
|
7627
|
-
const overlays = useSyncExternalStore(store?.subscribe ?? noSubscription, selectOverlays, noSnapshot);
|
|
7628
|
-
const recipe = previewOpeningHeaderRecipe(theme, chrome);
|
|
7629
|
-
const foreground = useMemo(() => {
|
|
7630
|
-
if (!opening || !blockId || !content || state.kind !== "loaded") return null;
|
|
7631
|
-
const projected = applyPreviewContentFieldProjections(blockId, content, overlays ? previewProjectionsFromAiOverlays(overlays) : []);
|
|
7632
|
-
const finalContent = applyPageDesignRuntimeFieldsToBlockContent({
|
|
7633
|
-
id: blockId,
|
|
7634
|
-
kind: opening.blockKind,
|
|
7635
|
-
content
|
|
7636
|
-
}, projected, resolveRuntimePreviewSourceForTheme(state, theme));
|
|
7637
|
-
return resolveBlockSectionForeground({
|
|
7638
|
-
kind: opening.blockKind,
|
|
7639
|
-
content: finalContent
|
|
7640
|
-
}, theme, "authoring");
|
|
7641
|
-
}, [
|
|
7642
|
-
opening,
|
|
7643
|
-
blockId,
|
|
7644
|
-
content,
|
|
7645
|
-
overlays,
|
|
7646
|
-
state,
|
|
7647
|
-
theme
|
|
7648
|
-
]);
|
|
7649
|
-
return useMemo(() => foreground && recipe ? applyPageOpeningForegroundToTheme(theme, recipe, { openingForeground: foreground }) : documentTheme, [
|
|
7650
|
-
theme,
|
|
7651
|
-
recipe,
|
|
7652
|
-
JSON.stringify(foreground),
|
|
7653
|
-
documentTheme
|
|
7654
|
-
]);
|
|
7655
|
-
}
|
|
7656
|
-
function previewOpeningHeaderRecipe(theme, chrome) {
|
|
7657
|
-
const header = chrome?.getSurfaceState("header");
|
|
7658
|
-
if (header?.kind !== "available" || header.surface !== "header") return null;
|
|
7659
|
-
const background = theme.header.background;
|
|
7660
|
-
if (background?.type === "color" && background.color !== "transparent") return null;
|
|
7661
|
-
return headerStyleRecipeForTheme(theme, header.currentId);
|
|
7662
|
-
}
|
|
7663
|
-
//#endregion
|
|
7664
6618
|
//#region ../preview-next/src/client/preview/previewDocumentFrame.ts
|
|
7665
6619
|
const PREVIEW_DOCUMENT_FRAME_CLASS_NAME = "builder-preview-document-frame";
|
|
7666
6620
|
function planPreviewDocumentFrame(input) {
|
|
@@ -7737,8 +6691,8 @@ function renderPreviewHeader(model, theme, fallback) {
|
|
|
7737
6691
|
});
|
|
7738
6692
|
}
|
|
7739
6693
|
function PreviewThemedSiteDocument({ children, themeRuntime = defaultPreviewThemeRuntime, useContainerResponsiveMode, viewportMode, viewportWidth, scale, contentHeight, scaleContainerRef, contentRef, staticHeaderNode, bannerNode, staticFooterNode, siteChromeRenderModel }) {
|
|
7740
|
-
const
|
|
7741
|
-
const effectiveTheme =
|
|
6694
|
+
const compiled = usePreviewCompiledTheme();
|
|
6695
|
+
const effectiveTheme = compiled.theme;
|
|
7742
6696
|
const headerNode = renderPreviewHeader(siteChromeRenderModel, effectiveTheme, staticHeaderNode);
|
|
7743
6697
|
const siteDocumentPlan = planPreviewSiteDocument(effectiveTheme, bannerNode, headerNode);
|
|
7744
6698
|
const footerNode = renderPreviewFooter(siteChromeRenderModel, effectiveTheme, staticFooterNode);
|
|
@@ -7755,7 +6709,7 @@ function PreviewThemedSiteDocument({ children, themeRuntime = defaultPreviewThem
|
|
|
7755
6709
|
footerNode,
|
|
7756
6710
|
children
|
|
7757
6711
|
});
|
|
7758
|
-
return renderThemedDocument(themeRuntime,
|
|
6712
|
+
return renderThemedDocument(themeRuntime, compiled, resolveDocumentResponsiveMode(themeRuntime, useContainerResponsiveMode), documentNode);
|
|
7759
6713
|
}
|
|
7760
6714
|
/**
|
|
7761
6715
|
* The shell marks whatever banner it's given, so preview chrome can stay clear
|
|
@@ -7777,10 +6731,12 @@ function renderPreviewFooter(model, theme, fallback) {
|
|
|
7777
6731
|
children: renderSiteChromeBlock(model, "footer", theme, { themeConfigOverrideMode: "ignore" })
|
|
7778
6732
|
});
|
|
7779
6733
|
}
|
|
7780
|
-
function renderThemedDocument(runtime,
|
|
6734
|
+
function renderThemedDocument(runtime, compiled, responsiveMode, documentNode) {
|
|
7781
6735
|
switch (runtime.kind) {
|
|
7782
|
-
case "cms-theme": return /* @__PURE__ */ jsx(
|
|
7783
|
-
|
|
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,
|
|
7784
6740
|
responsiveMode,
|
|
7785
6741
|
className: "rb-flex rb-flex-1 rb-flex-col",
|
|
7786
6742
|
children: documentNode
|
|
@@ -7955,26 +6911,11 @@ function resolveShellThemeRoles(props) {
|
|
|
7955
6911
|
}
|
|
7956
6912
|
const previewContainerResponsiveEnabled = process.env.NEXT_PUBLIC_ENABLE_PREVIEW_CONTAINER_RESPONSIVE !== "false";
|
|
7957
6913
|
const PreviewEditorSidebar = React.lazy(async () => {
|
|
7958
|
-
return { default: (await import("./PreviewEditorSidebar-
|
|
6914
|
+
return { default: (await import("./PreviewEditorSidebar-BhgPyyUW.mjs")).PreviewEditorSidebar };
|
|
7959
6915
|
});
|
|
7960
6916
|
const PreviewEditorUI = React.lazy(async () => {
|
|
7961
|
-
return { default: (await import("./PreviewEditorUI-
|
|
6917
|
+
return { default: (await import("./PreviewEditorUI-lndKKBtB.mjs")).PreviewEditorUI };
|
|
7962
6918
|
});
|
|
7963
|
-
const previewPaneContainmentStyle = {
|
|
7964
|
-
contain: "layout paint",
|
|
7965
|
-
isolation: "isolate",
|
|
7966
|
-
transform: "translateZ(0)"
|
|
7967
|
-
};
|
|
7968
|
-
function PreviewScrollViewport({ children }) {
|
|
7969
|
-
return /* @__PURE__ */ jsx("div", {
|
|
7970
|
-
className: "relative h-full min-h-0 overflow-hidden bg-muted/30",
|
|
7971
|
-
style: previewPaneContainmentStyle,
|
|
7972
|
-
children: /* @__PURE__ */ jsx("div", {
|
|
7973
|
-
className: "relative flex h-full min-h-0 flex-col overflow-auto",
|
|
7974
|
-
children
|
|
7975
|
-
})
|
|
7976
|
-
});
|
|
7977
|
-
}
|
|
7978
6919
|
function renderShellProviders(input) {
|
|
7979
6920
|
if (!input.themeRoles) return input.content;
|
|
7980
6921
|
const { props, themeRoles } = input;
|
|
@@ -7989,8 +6930,7 @@ function renderShellProviders(input) {
|
|
|
7989
6930
|
footerPreferences: props.themeSelectionFooterPreferences,
|
|
7990
6931
|
themeId: props.themeId ?? null,
|
|
7991
6932
|
selectionId: props.themeSelectionId ?? null,
|
|
7992
|
-
|
|
7993
|
-
selectionUpdatedAt: props.themeSelectionUpdatedAt ?? null,
|
|
6933
|
+
journalState: props.themeSelectionJournalState,
|
|
7994
6934
|
initialSelections: {
|
|
7995
6935
|
selectionVersion: props.themeSelectionVersion ?? null,
|
|
7996
6936
|
selectionUpdatedAt: props.themeSelectionUpdatedAt ?? null,
|
|
@@ -8001,7 +6941,10 @@ function renderShellProviders(input) {
|
|
|
8001
6941
|
headerLogoContext: props.themeSelectionHeaderLogo,
|
|
8002
6942
|
siteStyleAccess: input.siteStyleAccess,
|
|
8003
6943
|
canOpenDesignEditor: props.entryData == null && props.pageId !== null && canInspectSiteStyle(input.siteStyleAccess),
|
|
8004
|
-
children:
|
|
6944
|
+
children: /* @__PURE__ */ jsx(PreviewCompiledThemeProvider, {
|
|
6945
|
+
responsiveMode: previewCompiledResponsiveMode(props),
|
|
6946
|
+
children: input.content
|
|
6947
|
+
})
|
|
8005
6948
|
}) })
|
|
8006
6949
|
});
|
|
8007
6950
|
}
|
|
@@ -8035,7 +6978,7 @@ function PreviewDocumentContent(input) {
|
|
|
8035
6978
|
}
|
|
8036
6979
|
function PreviewShellLayout(props) {
|
|
8037
6980
|
const themeRoles = resolveShellThemeRoles(props);
|
|
8038
|
-
const { children, rendering, surfaceId, siteId, dashboardBaseUrl = null, pageId, entryData, contentTypeSchema, referenceContentTypeKeys = [], draftContent, currentTemplate, apiClient, themeId = null, themeSelectionId = null, themeSelectionVersion = null, themeSelectionUpdatedAt = null, themeSelectionButtonStyleSelection = null, themeSelectionButtonStyleRepairs, themeSelectionHeaderSelection = null, themeSelectionFooterLookId = null, themeSelectionHeaderLogo, isSiteLaunched, maintenanceModeEnabled, entrySubrouteContext, sdkConfig, bookingOfferingPresets, themeRuntime = defaultPreviewThemeRuntime, siteStyleAccess = { kind: "hidden" }, onFooterSaved } = props;
|
|
6981
|
+
const { children, rendering, surfaceId, siteId, dashboardBaseUrl = null, pageId, entryData, contentTypeSchema, referenceContentTypeKeys = [], draftContent, currentTemplate, apiClient, themeId = null, themeSelectionId = null, themeSelectionJournalState, themeSelectionVersion = null, themeSelectionUpdatedAt = null, themeSelectionButtonStyleSelection = null, themeSelectionButtonStyleRepairs, themeSelectionHeaderSelection = null, themeSelectionFooterLookId = null, themeSelectionHeaderLogo, isSiteLaunched, maintenanceModeEnabled, entrySubrouteContext, sdkConfig, bookingOfferingPresets, themeRuntime = defaultPreviewThemeRuntime, siteStyleAccess = { kind: "hidden" }, onFooterSaved } = props;
|
|
8039
6982
|
const layout = useOptionalPreviewLayout();
|
|
8040
6983
|
const headerNode = layout?.headerNode ?? null;
|
|
8041
6984
|
const bannerNode = layout?.bannerNode ?? null;
|
|
@@ -8200,6 +7143,7 @@ function PreviewShellLayout(props) {
|
|
|
8200
7143
|
apiClient,
|
|
8201
7144
|
themeId,
|
|
8202
7145
|
themeSelectionId,
|
|
7146
|
+
themeSelectionJournalState,
|
|
8203
7147
|
themeSelectionVersion,
|
|
8204
7148
|
themeSelectionUpdatedAt,
|
|
8205
7149
|
themeSelectionButtonStyleSelection,
|
|
@@ -8271,6 +7215,10 @@ function usePreviewDrawerOpen() {
|
|
|
8271
7215
|
const drawerOpen = useEditorUiStore((s) => s.drawerOpen);
|
|
8272
7216
|
return requestedEditingMode && drawerOpen;
|
|
8273
7217
|
}
|
|
7218
|
+
function previewCompiledResponsiveMode(props) {
|
|
7219
|
+
const runtime = props.themeRuntime;
|
|
7220
|
+
return runtime && runtime.kind !== "none" && runtime.responsiveMode ? runtime.responsiveMode : previewContainerResponsiveEnabled ? "container" : "viewport";
|
|
7221
|
+
}
|
|
8274
7222
|
//#endregion
|
|
8275
7223
|
//#region ../preview-next/src/client/preview/PreviewSessionJournalHost.tsx
|
|
8276
7224
|
/** Preview supplies its existing server refresh to the shared document-session host. */
|
|
@@ -8307,6 +7255,7 @@ function resolveShellLayoutProps(input) {
|
|
|
8307
7255
|
apiClient: input.apiClient,
|
|
8308
7256
|
themeId: props.themeId ?? null,
|
|
8309
7257
|
themeSelectionId: props.themeSelectionId ?? null,
|
|
7258
|
+
themeSelectionJournalState: props.themeSelectionJournalState,
|
|
8310
7259
|
themeSelectionVersion: props.themeSelectionVersion ?? null,
|
|
8311
7260
|
themeSelectionUpdatedAt: props.themeSelectionUpdatedAt ?? null,
|
|
8312
7261
|
themeSelectionButtonStyleSelection: props.themeSelectionButtonStyleSelection ?? null,
|
|
@@ -8341,7 +7290,7 @@ function renderShellLayout(input) {
|
|
|
8341
7290
|
});
|
|
8342
7291
|
}
|
|
8343
7292
|
function wrapPreviewSiteFontStorage(children, siteFontStorageUrl) {
|
|
8344
|
-
return /* @__PURE__ */ jsx(
|
|
7293
|
+
return /* @__PURE__ */ jsx(SiteFontStorageProvider, {
|
|
8345
7294
|
siteFontStorageUrl,
|
|
8346
7295
|
children
|
|
8347
7296
|
});
|
|
@@ -8349,8 +7298,7 @@ function wrapPreviewSiteFontStorage(children, siteFontStorageUrl) {
|
|
|
8349
7298
|
function PreviewEditorBody({ props, designEditorEnabled, siteStyleAccess }) {
|
|
8350
7299
|
const { apiClient } = useEntryEditorController();
|
|
8351
7300
|
const bearerToken = usePreviewToken();
|
|
8352
|
-
|
|
8353
|
-
const content = /* @__PURE__ */ jsx(PreviewPageDesignEditorStateProvider, {
|
|
7301
|
+
return /* @__PURE__ */ jsx(PreviewPageDesignEditorStateProvider, {
|
|
8354
7302
|
apiClient,
|
|
8355
7303
|
siteId: props.siteId,
|
|
8356
7304
|
pageId: props.pageId,
|
|
@@ -8368,7 +7316,6 @@ function PreviewEditorBody({ props, designEditorEnabled, siteStyleAccess }) {
|
|
|
8368
7316
|
}), props.siteFontStorageUrl)]
|
|
8369
7317
|
})
|
|
8370
7318
|
});
|
|
8371
|
-
return journal ? content : /* @__PURE__ */ jsx(PreviewDesignHistoryOrderProvider, { children: content });
|
|
8372
7319
|
}
|
|
8373
7320
|
function PreviewBlockApiProvider({ config, children }) {
|
|
8374
7321
|
const token = usePreviewToken();
|
|
@@ -8440,7 +7387,7 @@ function PreviewEditorMount({ props, apiClient, access }) {
|
|
|
8440
7387
|
]);
|
|
8441
7388
|
const editable = isPreviewRuntimeSessionEditable(props.previewSession);
|
|
8442
7389
|
const ordinaryPageId = props.pageId && !props.entryData && props.pageNodeType !== "page_surface" ? props.pageId : null;
|
|
8443
|
-
const renderContent = (initialPageJournalState,
|
|
7390
|
+
const renderContent = (initialPageJournalState, authoringAdmitted) => /* @__PURE__ */ jsxs(PreviewEntryControllerProvider, {
|
|
8444
7391
|
blockFieldExtensions: props.sdkConfig?.blockFieldExtensions ?? null,
|
|
8445
7392
|
businessTimeZone: props.businessTimeZone,
|
|
8446
7393
|
siteId: props.siteId,
|
|
@@ -8462,11 +7409,10 @@ function PreviewEditorMount({ props, apiClient, access }) {
|
|
|
8462
7409
|
authoringAdmitted && /* @__PURE__ */ jsx(SiteAdmissionObserver, {
|
|
8463
7410
|
siteId: props.siteId,
|
|
8464
7411
|
apiClient,
|
|
8465
|
-
checkpoint,
|
|
8466
7412
|
siteOnly: !scope && editable,
|
|
8467
7413
|
subscribeToAdmissionChanges: props.subscribeToAdmissionChanges
|
|
8468
7414
|
}),
|
|
8469
|
-
|
|
7415
|
+
/* @__PURE__ */ jsx(PreviewLeaseEditingMode, {}),
|
|
8470
7416
|
/* @__PURE__ */ jsx(PreviewEditorBody, {
|
|
8471
7417
|
props,
|
|
8472
7418
|
...access,
|
|
@@ -8481,8 +7427,8 @@ function PreviewEditorMount({ props, apiClient, access }) {
|
|
|
8481
7427
|
editable,
|
|
8482
7428
|
scope,
|
|
8483
7429
|
ordinaryPageId,
|
|
8484
|
-
fallback: renderContent(void 0,
|
|
8485
|
-
children: (initialPageJournalState
|
|
7430
|
+
fallback: renderContent(void 0, false),
|
|
7431
|
+
children: (initialPageJournalState) => renderContent(initialPageJournalState, true)
|
|
8486
7432
|
});
|
|
8487
7433
|
}
|
|
8488
7434
|
function defaultDesignEditorEligibility(input) {
|
|
@@ -8861,7 +7807,7 @@ function useMediaQuery(query) {
|
|
|
8861
7807
|
//#endregion
|
|
8862
7808
|
//#region ../preview-next/src/client/blocks/BlockToolbar.tsx
|
|
8863
7809
|
function BlockToolbar({ placement = DEFAULT_PREVIEW_CHROME_FLOATING_PLACEMENT, ...input }) {
|
|
8864
|
-
const { selection, controls, toolbar, open, cycleSdk,
|
|
7810
|
+
const { selection, controls, toolbar, open, cycleSdk, cycleRecipe } = useBlockToolbar(input);
|
|
8865
7811
|
const name = controls.manifest?.title ?? getBlockDefinition(input.blockKind)?.manifest.title ?? input.blockKind;
|
|
8866
7812
|
const row = /* @__PURE__ */ jsxs("div", {
|
|
8867
7813
|
role: "group",
|
|
@@ -8882,20 +7828,35 @@ function BlockToolbar({ placement = DEFAULT_PREVIEW_CHROME_FLOATING_PLACEMENT, .
|
|
|
8882
7828
|
controls,
|
|
8883
7829
|
toolbar,
|
|
8884
7830
|
onCycleSdk: cycleSdk,
|
|
8885
|
-
|
|
7831
|
+
onCycleRecipe: cycleRecipe
|
|
8886
7832
|
})
|
|
8887
7833
|
]
|
|
8888
7834
|
});
|
|
8889
|
-
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
8890
|
-
|
|
8891
|
-
|
|
8892
|
-
|
|
8893
|
-
|
|
8894
|
-
|
|
8895
|
-
|
|
8896
|
-
|
|
8897
|
-
|
|
8898
|
-
|
|
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;
|
|
8899
7860
|
}
|
|
8900
7861
|
function useBlockToolbar(input) {
|
|
8901
7862
|
const uiStore = useEditorUiStoreInstance();
|
|
@@ -8926,7 +7887,7 @@ function useBlockToolbar(input) {
|
|
|
8926
7887
|
openField
|
|
8927
7888
|
});
|
|
8928
7889
|
const cycleSdk = (direction) => cycleSdkLook(controls, direction);
|
|
8929
|
-
const
|
|
7890
|
+
const cycleRecipe = (direction) => {
|
|
8930
7891
|
if (!controls.designBlock) return;
|
|
8931
7892
|
const action = cyclePageDesignBlockLook(controls.designBlock, direction);
|
|
8932
7893
|
if (action) applyAction(action, { runtimeContent: values });
|
|
@@ -8937,13 +7898,12 @@ function useBlockToolbar(input) {
|
|
|
8937
7898
|
toolbar,
|
|
8938
7899
|
open,
|
|
8939
7900
|
cycleSdk,
|
|
8940
|
-
|
|
7901
|
+
cycleRecipe
|
|
8941
7902
|
};
|
|
8942
7903
|
}
|
|
8943
7904
|
function useOpenBlockSidebar(blockId, uiStore) {
|
|
8944
7905
|
const selection = usePreviewBlockCustomizeSelectionOptional();
|
|
8945
7906
|
const open = () => {
|
|
8946
|
-
selection?.selectBlock(blockId);
|
|
8947
7907
|
selection?.inspectBlock(blockId);
|
|
8948
7908
|
uiStore.getState().setDrawerOpen(true);
|
|
8949
7909
|
};
|
|
@@ -8969,7 +7929,7 @@ function cycleSdkLook(controls, direction) {
|
|
|
8969
7929
|
if (next) controls.backend.setValue(item.path, next.value);
|
|
8970
7930
|
}
|
|
8971
7931
|
/** The Look pill shows only while its arrows have somewhere to go. */
|
|
8972
|
-
function ToolbarLook({ controls, toolbar, onCycleSdk,
|
|
7932
|
+
function ToolbarLook({ controls, toolbar, onCycleSdk, onCycleRecipe }) {
|
|
8973
7933
|
if (controls.lookSource.kind === "sdk") {
|
|
8974
7934
|
const field = cyclableSdkLookField(controls.lookSource.item);
|
|
8975
7935
|
return field && controls.lookSource.item ? /* @__PURE__ */ jsx(SdkToolbarLook, {
|
|
@@ -8988,7 +7948,7 @@ function ToolbarLook({ controls, toolbar, onCycleSdk, onCycleLegacy }) {
|
|
|
8988
7948
|
return preset.canCycle ? /* @__PURE__ */ jsx(LookCyclePill, {
|
|
8989
7949
|
lookName: preset.lookName,
|
|
8990
7950
|
position: preset.position,
|
|
8991
|
-
onCycle:
|
|
7951
|
+
onCycle: onCycleRecipe
|
|
8992
7952
|
}) : null;
|
|
8993
7953
|
}
|
|
8994
7954
|
function cyclableSdkLookField(item) {
|
|
@@ -9686,6 +8646,10 @@ function EditableDraftPageRenderer(props) {
|
|
|
9686
8646
|
return /* @__PURE__ */ jsx(EditorPageRenderer, {
|
|
9687
8647
|
...pageRendererProps,
|
|
9688
8648
|
page: renderPage,
|
|
8649
|
+
wrapPage: (plan, rendered) => /* @__PURE__ */ jsx(PreviewRenderPlanProjection, {
|
|
8650
|
+
plan,
|
|
8651
|
+
children: rendered
|
|
8652
|
+
}),
|
|
9689
8653
|
runtimeJoins,
|
|
9690
8654
|
registry: allowInlineEditing ? editorRegistry : pageRendererProps.registry ?? clientComponentRegistry,
|
|
9691
8655
|
wrapBlock: allowInlineEditing ? wrapBlockWithProvider : pageRendererProps.wrapBlock,
|
|
@@ -10006,7 +8970,8 @@ function SdkPreviewModeRuntime(props) {
|
|
|
10006
8970
|
supabaseUrl: content.supabaseUrl,
|
|
10007
8971
|
siteFontStorageUrl,
|
|
10008
8972
|
designEditorEligibility: { kind: "sdk-page" },
|
|
10009
|
-
hideSiteStyleConfigurator: true
|
|
8973
|
+
hideSiteStyleConfigurator: true,
|
|
8974
|
+
themeSelectionJournalState: null
|
|
10010
8975
|
};
|
|
10011
8976
|
if (model.rendering.kind === "overrides-only") return /* @__PURE__ */ jsx(PreviewShell, {
|
|
10012
8977
|
...shellProps,
|