@riverbankcms/sdk 0.158.0 → 0.160.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -6
- package/dist/_dts/{BlocksIslandsHydrator-BgNBtEai.d.ts → BlocksIslandsHydrator-CoqeotCL.d.ts} +1 -1
- package/dist/_dts/{Page-DpCo8zXD.d.ts → Page-C0ENVLCF.d.ts} +13 -6
- package/dist/_dts/{SdkPreviewMode-Bv2TMscG.d.ts → SdkPreviewMode-jZK0A49V.d.ts} +54 -126
- package/dist/_dts/{client-B960v2gW.d.ts → client-uMMuPq9V.d.ts} +23 -1
- package/dist/_dts/{content-types-CN0Wy8V6.d.ts → content-types-D6nXGqdQ.d.ts} +18 -18
- package/dist/_dts/{contracts-BFUrby76.d.ts → contracts-Bnmj1nxu.d.ts} +6 -5
- package/dist/_dts/{footerPageOutline-CmoqleLS.d.ts → footerPageOutline-CeLjFX8b.d.ts} +6 -6
- package/dist/_dts/{generatePageMetadata-Dkvivc3R.d.ts → generatePageMetadata-nyU8q02J.d.ts} +5 -2
- package/dist/_dts/{index-DPfI2t5A.d.ts → index-BaaGBY1v.d.ts} +2 -2
- package/dist/_dts/{index-DCNu_8it.d.ts → index-Bg64CkV-.d.ts} +4 -4
- package/dist/_dts/index-Blwl7yl6.d.ts +13 -0
- package/dist/_dts/{index-DaS_z6ir.d.ts → index-C5xslEBn.d.ts} +2 -2
- package/dist/_dts/{index-DpgkhY-a.d.ts → index-CEaKil7G.d.ts} +2 -2
- package/dist/_dts/{index-Ba6RmuxX.d.ts → index-DahMwisK.d.ts} +3 -3
- package/dist/_dts/index-lkpjIg5i.d.ts +66 -0
- package/dist/_dts/{index-DfkFWUxt.d.ts → index-nVoi_74l.d.ts} +2 -2
- package/dist/_dts/{loadContent-DvvKF4nB.d.ts → loadContent-CYLmzvLq.d.ts} +16 -7
- package/dist/_dts/{resolvePageContent-D0lGwVD6.d.ts → resolvePageContent-DqnxChOs.d.ts} +2 -2
- package/dist/_dts/{constants-DkcKHMX-.d.ts → runtime-BY8DQBbT.d.ts} +10 -16
- package/dist/_dts/{hosted-booking-appearance-BIbit60h.d.ts → schema-D0bNcPWK.d.ts} +6921 -6768
- 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 +12 -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 +6 -6
- package/dist/_dts/sdk/src/metadata/index.d.ts +8 -2
- package/dist/_dts/sdk/src/navigation/index.d.ts +2 -2
- package/dist/_dts/sdk/src/next/index.d.ts +7 -7
- package/dist/_dts/sdk/src/next/middleware.d.ts +2 -2
- package/dist/_dts/sdk/src/page-converter/index.d.ts +10 -28
- package/dist/_dts/sdk/src/portal/client.d.ts +1 -1
- package/dist/_dts/sdk/src/prebuild/index.d.ts +1 -1
- package/dist/_dts/sdk/src/preview-next/before-render.d.ts +2 -2
- package/dist/_dts/sdk/src/preview-next/client/index.d.ts +2 -2
- package/dist/_dts/sdk/src/preview-next/client/runtime.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/client.d.ts +2 -2
- package/dist/_dts/sdk/src/rendering/index.d.ts +6 -6
- package/dist/_dts/sdk/src/rendering/islands/client.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/server.d.ts +2 -2
- package/dist/_dts/sdk/src/routing/index.d.ts +5 -5
- package/dist/_dts/sdk/src/server.d.ts +5 -5
- package/dist/_dts/sdk/src/theme/index.d.ts +1 -1
- package/dist/_dts/{types-BJrRUaY7.d.ts → types-CFrYuXYP.d.ts} +2 -2
- package/dist/_dts/{navigation-n-eTVTIQ.d.ts → types-D8czmbQF.d.ts} +15430 -16836
- package/dist/_dts/{types-BY7PgnDi.d.ts → types-DSgmJ15W.d.ts} +7 -7
- package/dist/_dts/{types-maEnXL6Z.d.ts → types-Dm-KW7nj.d.ts} +10 -13
- package/dist/_dts/{validation-BjuVrMrs.d.ts → validation-Bmb4WnHg.d.ts} +4 -4
- package/dist/client/{BlocksIslandsHydrator-WRLS96Ev.mjs → BlocksIslandsHydrator-DZRKi6tT.mjs} +17 -17
- package/dist/client/{BookingMailingListNote-eovghMPa.mjs → BookingMailingListNote-C00sLLdL.mjs} +2 -2
- package/dist/client/{CalendarNavigationChevron-CIcMQRc1.mjs → CalendarNavigationChevron-CHSi9b3E.mjs} +6 -6
- package/dist/client/{CheckboxChoice-BF9eCNno.mjs → CheckboxChoice-Bhm6RAUL.mjs} +1 -1
- package/dist/client/{DemoBookingPortalAccess-CdnFgDyQ.mjs → DemoBookingPortalAccess-CaN-7ui7.mjs} +6 -6
- package/dist/client/{DemoPortalSignInLink-DHxYgkT6.mjs → DemoPortalSignInLink-ClxN5_xZ.mjs} +1 -1
- package/dist/client/{EventCalendar.client-Dc-ZLxKo.mjs → EventCalendar.client-BncvSa1n.mjs} +10 -9
- package/dist/client/{EventCombined.client-C93XqRIv.mjs → EventCombined.client-DluBxVVu.mjs} +8 -8
- package/dist/client/{EventEmbeddedCheckoutStep-B3XUyNY9.mjs → EventEmbeddedCheckoutStep-BiJrMtfp.mjs} +1 -1
- package/dist/client/{EventItem-DnCTygqk.mjs → EventItem-CXhnT9pF.mjs} +11 -6
- package/dist/client/{EventListWeekNavigation-9h97heuQ.mjs → EventListWeekNavigation-V-dtoDlD.mjs} +1 -1
- package/dist/client/{EventListing.client-DFKlQvvs.mjs → EventListing.client-DPO6SZbx.mjs} +3 -3
- package/dist/client/{EventListing.view-pAuTDyrP.mjs → EventListing.view-B-Yi5JZS.mjs} +7 -7
- package/dist/client/{EventRegistrationPayment-rgKlBvhP.mjs → EventRegistrationPayment-Dc3Fnlnw.mjs} +189 -176
- package/dist/client/{LeafletStaticMap-3XiWSgy0.mjs → LeafletStaticMap-ClZCCzAm.mjs} +1 -1
- package/dist/client/{Page-BmpeAwID.mjs → Page-7PkzO04N.mjs} +1949 -2074
- package/dist/client/{StepIndicator-qEq6X5zP.mjs → StepIndicator-DiD6euZ8.mjs} +3 -3
- package/dist/client/{TabBarFragment-DvzIV75f.mjs → TabBarFragment-BHd8GN8y.mjs} +1 -1
- package/dist/client/{ThemedButton-DVBC_pS9.mjs → ThemedButton-C22C9cCF.mjs} +174 -93
- package/dist/client/{accordion-DeObOasQ.mjs → accordion-2m27DsIk.mjs} +1 -1
- package/dist/client/{booking-form.client-DfWeF0lj.mjs → booking-form.client-BddWV5w1.mjs} +12 -12
- package/dist/client/{bookingForm-TnzIBHx2.mjs → bookingForm-bcdXQjmw.mjs} +4 -4
- package/dist/client/bookings.mjs +6 -6
- package/dist/client/{carousel-kkFnbr5Z.mjs → carousel-D7nj9I0y.mjs} +2 -2
- package/dist/client/{carousel.client-BJGoJVtg.mjs → carousel.client-AffDJo_s.mjs} +1 -1
- package/dist/client/{cart-BAXNbFux.mjs → cart-PN6yCw1H.mjs} +3 -3
- package/dist/client/{cart.client-BczxUF70.mjs → cart.client-D4t1f0cJ.mjs} +1 -1
- package/dist/client/{checkout-C5NRhPeP.mjs → checkout-CsTwXVSb.mjs} +3 -3
- package/dist/client/{checkout.client-BuDk3Td9.mjs → checkout.client-BhQE3zY7.mjs} +1 -1
- package/dist/client/client.mjs +25 -13
- package/dist/client/{context-CVsgML69.mjs → context-BLAvalAa.mjs} +1 -1
- package/dist/client/{cta-BWnUuJce.mjs → cta-CUXhX_D7.mjs} +2 -1
- package/dist/client/dateFormatting-BHIHxNuo.mjs +61 -0
- package/dist/client/{demoPortalMagicLink-CUlwvmxf.mjs → demoPortalMagicLink-R-awbk_0.mjs} +1 -1
- package/dist/client/{enhanceHeaderSection-Cw8nnFj-.mjs → enhanceHeaderSection-9Q93uvTo.mjs} +3 -3
- package/dist/client/{event-details.client-Bl0E_6Vi.mjs → event-details.client-BS1WtG-a.mjs} +2 -2
- package/dist/client/{event-registration.client-DmfLg_LC.mjs → event-registration.client-BXndwsET.mjs} +35 -21
- package/dist/client/{eventCalendar-D1Dwb9VA.mjs → eventCalendar-HyoOt1Qz.mjs} +4 -4
- package/dist/client/{eventCombined-DfsqY1qR.mjs → eventCombined-sdG5oEaH.mjs} +4 -4
- package/dist/client/{eventDetails-BmugDVoa.mjs → eventDetails-FFAknE4w.mjs} +2 -2
- package/dist/client/{eventListing-BPAGJi3C.mjs → eventListing-CGK6urk3.mjs} +4 -4
- package/dist/client/{eventRegistration-DBlz_x6u.mjs → eventRegistration-VhrvCs4l.mjs} +4 -4
- package/dist/client/{form-DVu3ZMjx.mjs → form-C-B5O_ko.mjs} +3 -3
- package/dist/client/{form.client-QZUyABIY.mjs → form.client-DoZVcl8d.mjs} +5 -5
- package/dist/client/{form.parts-Bs0F3v08.mjs → form.parts-mttKpgif.mjs} +3 -3
- package/dist/client/{formatDate-BD9D3dgo.mjs → formatDate-xUSCknEO.mjs} +1 -1
- package/dist/client/gifting/client.mjs +3 -3
- package/dist/client/{headerSection-BQwWW4Yy.mjs → headerSection-BHUEXsaI.mjs} +2 -2
- package/dist/client/{location-map.client-upKuwABk.mjs → location-map.client-Cylb_MHw.mjs} +2 -2
- package/dist/client/{location-map.view-RuBCD10O.mjs → location-map.view-Cx4Bl7ij.mjs} +69 -6
- package/dist/client/{locationMap-1sCbsk0V.mjs → locationMap-QnKJi-nZ.mjs} +2 -2
- package/dist/client/{newsletter-form.client-DBTU3oNv.mjs → newsletter-form.client-D_n0rftg.mjs} +8 -8
- package/dist/client/{newsletter-form.parts-C9I9JBhe.mjs → newsletter-form.parts-DKHye4IE.mjs} +2 -2
- package/dist/client/{newsletterForm-DTPtTxxG.mjs → newsletterForm-tEaYelzx.mjs} +3 -3
- package/dist/client/{noop-DMFt3KdC.mjs → noop-B610YKEx.mjs} +12 -5
- package/dist/client/portal/client.mjs +4562 -174
- package/dist/client/{product-detail.client-BX7M5o6p.mjs → product-detail.client-DUf5x5Jt.mjs} +1 -1
- package/dist/client/{product-list.client-i32QNY4c.mjs → product-list.client-Cqp1BPTV.mjs} +1 -1
- package/dist/client/{productDetail-DWjE9zm7.mjs → productDetail-B8bBiogP.mjs} +3 -3
- package/dist/client/{productList-DZH9_brv.mjs → productList-BKN4D-1z.mjs} +3 -3
- package/dist/client/{propsDecoder-CTzHkEkh.mjs → propsDecoder-2nNZh2Oe.mjs} +3 -3
- package/dist/client/{registry.server-vJ5FlscU.mjs → registry.server-BAm4RPNJ.mjs} +856 -872
- package/dist/client/rendering/client.mjs +27 -26
- package/dist/client/rendering/islands.mjs +1 -1
- package/dist/client/rendering.mjs +47 -28
- package/dist/client/{richText-coerce-DXAmC72p.mjs → richText-coerce-Cv-qomNB.mjs} +1 -1
- package/dist/client/{routeIslandApiConfig-CmC7ygin.mjs → routeIslandApiConfig-C5u8MbAA.mjs} +1 -1
- package/dist/client/{shop-C7eL3B37.mjs → shop-DZNC0VKk.mjs} +3 -3
- package/dist/client/{shop-commerce-D8oRN0QJ.mjs → shop-commerce-DdX4LSa3.mjs} +12 -12
- package/dist/client/{shop-commerce-store-CRnQ4M18.mjs → shop-commerce-store-BJtrZov9.mjs} +1 -1
- package/dist/client/{shop.client-X6d6KVmA.mjs → shop.client-DmDd-igg.mjs} +16 -15
- package/dist/client/{shop.interactive-DBMeM8VD.mjs → shop.interactive-5SnnDHz3.mjs} +402 -35
- package/dist/client/{shopShared-Y182kN_s.mjs → shopShared-CPqUlAh9.mjs} +2 -2
- package/dist/client/{src-7cXhT0G_.mjs → src-VIsPY-kw.mjs} +6 -1
- package/dist/client/timetableModel-C19rcHEw.mjs +960 -0
- package/dist/client/{useAvailableSlots-BDV6MHgJ.mjs → useAvailableSlots-BjbJXotk.mjs} +3 -3
- package/dist/client/{useBookingNowIso-DgJEv3ZY.mjs → useBookingNowIso-CMgfL7YJ.mjs} +1 -1
- package/dist/client/{useDiscountApply-BTu9EeT7.mjs → useDiscountApply-KG8jB7WC.mjs} +2 -2
- package/dist/client/{useDiscountCodeUi-BfZxdxI-.mjs → useDiscountCodeUi-DK2w_i0a.mjs} +1 -1
- package/dist/client/{useEventPagination-pnvdHGeQ.mjs → useEventPagination-DW6MCirb.mjs} +11 -10
- package/dist/client/uuid-BETKW8rS.mjs +12 -0
- package/dist/client/{view-hJr_L4QC2.mjs → view-CkUn3Y0Y.mjs} +4 -4
- package/dist/client/{view-BPEa6Okm.mjs → view-CseyBW07.mjs} +15 -70
- package/dist/client/{wizardSteps-HdyGoIG3.mjs → wizardSteps-zgq10lN1.mjs} +262 -65
- package/dist/preview-next/before-render.mjs +1 -1
- package/dist/preview-next/client/{EventEmbeddedCheckoutStep-BFlBqSu4.mjs → EventEmbeddedCheckoutStep-lUHBrzHv.mjs} +1 -1
- package/dist/preview-next/client/{PreviewEditorSidebar-CXRUbqMp.mjs → PreviewEditorSidebar-DWyUGCAG.mjs} +1217 -107
- package/dist/preview-next/client/{PreviewEditorUI-CxjEV0Fm.mjs → PreviewEditorUI-Wq0b3Daw.mjs} +52 -79
- package/dist/preview-next/client/{SdkPreviewModeRuntime-XdQSGGj_.mjs → SdkPreviewModeRuntime-BtZPcwYV.mjs} +1 -1
- package/dist/preview-next/client/{SdkPreviewModeRuntime-BxI12BBS.mjs → SdkPreviewModeRuntime-wSI_R361.mjs} +720 -2035
- package/dist/preview-next/client/{SiteChromeCustomizeContext-CfRQRwpH.mjs → SiteChromeCustomizeContext-Hc4pYnNe.mjs} +14365 -8155
- package/dist/preview-next/client/{ThemedButton-BEOPss9H.mjs → ThemedButton-DzeycIlD.mjs} +204 -93
- package/dist/preview-next/client/{previewChromeSurface-CH7hd5n7.mjs → previewChromeSurface-Corq4AG7.mjs} +3 -8
- package/dist/preview-next/client/runtime.mjs +3 -3
- package/dist/preview-next/client/{sdk-runtime-C6xEU1LI.mjs → sdk-runtime-CWymRWhK.mjs} +1 -1
- package/dist/preview-next/client/siteStyleAccess-QZkJRHl5.mjs +1359 -0
- package/dist/preview-next/client/{spinner-BTf1CZmy.mjs → spinner-C4If5Y-O.mjs} +1 -1
- package/dist/preview-next/editor-base.css +62 -0
- package/dist/preview-next/editor-chrome.css +85 -0
- package/dist/preview-next/keepAlive.mjs +1 -1
- package/dist/preview-next/middleware.mjs +1 -1
- package/dist/preview-next/{route-contract-DM22uOXM.mjs → route-contract-8csADeIT.mjs} +149 -112
- package/dist/server/{Block.shared-DLoilC2J.mjs → Block.shared-D1_gonwM.mjs} +6 -6
- package/dist/server/{bindings-C7DKLVx_.mjs → bindings-CFmJg5lm.mjs} +2 -2
- package/dist/server/{client-CU4wlMLE.mjs → client-DPsi0Dai.mjs} +9 -7
- package/dist/server/config-template-validation.mjs +50 -10
- package/dist/server/config-validation.mjs +1 -1
- package/dist/server/config.mjs +2 -2
- package/dist/server/{generatePageMetadata-CPvssVOp.mjs → generatePageMetadata-DB_lbrZ7.mjs} +28 -2
- package/dist/server/index.mjs +2 -2
- package/dist/server/{loadContent-DmQ4BiiQ.mjs → loadContent-RMCcuVU_.mjs} +33 -20
- package/dist/server/loadPage-DUPP51C-.mjs +2 -0
- package/dist/server/{loadPage-BBkDQA57.mjs → loadPage-DhDGzj7t.mjs} +8 -5
- package/dist/server/manifest.mjs +1 -1
- package/dist/server/metadata.mjs +2 -2
- package/dist/server/next.mjs +13 -12
- package/dist/server/{overrideResolution-ByeAbLSO.mjs → overrideResolution-OxY5FMuy.mjs} +1 -1
- package/dist/server/{overrides-BcA6ZPWf.mjs → overrides-Bz_A6sB9.mjs} +586 -518
- package/dist/server/page-converter.mjs +8 -10
- package/dist/server/{prebuild-8T-m7XjB.mjs → prebuild-B_1vrSru.mjs} +1 -1
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/{prefetchBlockData-Bjya-X9t.mjs → prefetchBlockData-B7ukYXXR.mjs} +841 -887
- package/dist/server/{publicProducts-C3meXS2o.mjs → publicProducts-Djbpc81A.mjs} +166 -129
- package/dist/server/{blocks-jlIm0PWc.mjs → registry-eFjKtEhF.mjs} +2349 -1716
- package/dist/server/rendering/server.mjs +4 -4
- package/dist/server/rendering.mjs +7 -7
- package/dist/server/{resolveBlockData-D0ow8PRJ.mjs → resolveBlockData-DYvEa9c5.mjs} +6 -3
- package/dist/server/routing.mjs +1 -1
- package/dist/server/{schema-Bs735S27.mjs → schema-C3dJ5UkL.mjs} +148 -88
- package/dist/server/server.mjs +3 -3
- package/dist/server/{siteChromeOverlayClearance-BangtD8A.mjs → siteChromeOverlayClearance-DALIAMwo.mjs} +108 -11
- package/dist/server/{src-B935_bzN.mjs → src-C5Mu-z0F.mjs} +268 -189
- package/dist/server/theme-bridge.mjs +1 -1
- package/dist/server/theme.mjs +1 -1
- package/dist/server/{themeAdmission-D2-BnmDO.mjs → themeAdmission-ruoyXb_0.mjs} +9 -7
- package/dist/server/{three-pass-converter-CmmchOFC.mjs → three-pass-converter-Chnb1XD-.mjs} +2 -58
- package/dist/server/{validation-Cm41pDUB.mjs → validation-B-Xar8QS.mjs} +22 -63
- package/dist/server/{version-Bo9C3McI.mjs → version-Bg7VHK3i.mjs} +1 -1
- package/dist/styles/index.css +78 -0
- package/package.json +8 -3
- package/dist/_dts/index-CXsnaCGe.d.ts +0 -10
- package/dist/_dts/index-cnymEAZY.d.ts +0 -1
- package/dist/client/timetableModel-D7PwpaBY.mjs +0 -480
- package/dist/preview-next/client/siteStyleAccess-CRXaC2oL.mjs +0 -1326
- package/dist/server/loadPage-ZrcfjG3X.mjs +0 -2
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { D as ok, E as err, S as parseUserId, a as mediaSchema, b as parseSiteId, d as indexRenderableMediaAssets, f as resolveManagedMediaReference, g as parseApiKeyId, s as runtimeMediaSchema, u as renderableMediaAssetSchema, x as parseSiteTermsVersionId } from "./media-CcHwZkdJ.mjs";
|
|
2
2
|
import { t as assertNever } from "./assert-never-ku-PUn9U.mjs";
|
|
3
|
-
import {
|
|
4
|
-
import { d as SUPPORTED_LOADER_ENDPOINTS$1, n as parsePublicProductCategorySelector, r as isRecord$3 } from "./publicProducts-
|
|
5
|
-
import { En as defaultThemeTokens, Ht as makeBoundaryId, Qt as resolveSurface, jt as asSiteStyleId, kt as asLayoutVariantKey, lt as stripStaleTransitionStyleGroup, r as themeSchema, wt as asDesignBlockId } from "./schema-
|
|
6
|
-
import {
|
|
3
|
+
import { $i as resolveSectionBackground, Ai as RESOLVED_INTERNAL_LINK_ENTITY_TYPES, Ar as boxStylesTransforms, Bn as resolveDateRuntimeContext, Bt as buildEventListWeek, Di as validateSdkBlockDeclaration, Ei as sdkBlockPresentationShape, Fr as parseBackgroundOverlay, Gi as resolveModeArrangement, Gr as lookCarouselRegionTransform, Gt as eventCalendarWeekStart, Hi as arrangementManifestFromVariants, Hn as headerRuntimeTransforms, Hr as standardImageShapeOptions, Ir as parseRuntimeBackgroundContent, Ji as composeBoundary, Jn as formattingTransforms, Jr as lookSkinSlotTransform, Ki as resolvePublishedLook, Kn as resolveHeroTitleLength, Kr as lookLeadSlotTransform, Lr as resolveSurfaceForegroundStyles, Oa as toUtcIsoDateTimeString, Oi as NodeSchema, P as projectRecurringSchedule, Pr as parseBackgroundContent, Qi as parseCanonicalRuntimeBackground, Rn as contentTransforms, Rr as resolveBackgroundColorValue, Sa as getLocalScheduleDate, Ti as validateManifestLookField, U as calendarWindowQuerySchema, Ui as readStoredMode, Un as chromeLogoTransforms, Ur as BACKGROUND_POSITION_PRESET_VALUES, Vi as augmentManifest, Vn as mediaTransforms, W as resolveCalendarReadProfile, Wi as resolveEffectiveArrangement, Wn as layoutTransforms, Wr as getAnchorClasses, Xi as deriveSectionGround, Xr as createTransformRegistry, Yi as sectionFactsForContent, Yr as asPartialObject, Zi as heroPhotoPaintsGround, Zr as runTransforms, _t as eventCalendarListGroupingDecision, bi as builtInBlockKindsSchema, bt as resolveEventCalendarReadPlan, fa as parseMailingListProviderScope, ft as resolveEventSelection, ki as bindingSchema, lr as standardAspectRatioOptions, qi as boundaryLayout, qn as uiTransforms, qr as lookQuoteLimitTransform, t as getBlockDefinition, tt as computeMediaTransformStyle, vi as blockCategoryEnum, vt as eventCalendarListLayoutCompatibleDisplayModeValues, xi as fieldSchema, yi as blockSectionDeclarationShape, yt as eventCalendarListLayoutOptions, zn as readRuntimeNow } from "./registry-eFjKtEhF.mjs";
|
|
4
|
+
import { d as SUPPORTED_LOADER_ENDPOINTS$1, n as parsePublicProductCategorySelector, r as isRecord$3 } from "./publicProducts-Djbpc81A.mjs";
|
|
5
|
+
import { En as defaultThemeTokens, Ht as makeBoundaryId, Qt as resolveSurface, jt as asSiteStyleId, kt as asLayoutVariantKey, lt as stripStaleTransitionStyleGroup, r as themeSchema, wt as asDesignBlockId } from "./schema-C3dJ5UkL.mjs";
|
|
6
|
+
import { C as getGradientPreset, G as cardListFamilyBlocks, K as cardListKnobBlocks, M as resolveItemSurface, N as resolveLookSlotSurfaces, S as gradientToCss, T as deriveSiteStyleBlockPolicy, W as resolveEffectiveKnobs, j as arrangementSlotNames, w as parseGradientPresetId } from "./siteChromeOverlayClearance-DALIAMwo.mjs";
|
|
7
7
|
import { i as isObjectRecord, t as RichTextDocSchema } from "./richTextSchema-YYc85FX4.mjs";
|
|
8
8
|
import { i as resolveRouteTargetForStage$1 } from "./dist-Xevqwf1U.mjs";
|
|
9
9
|
import { z } from "zod";
|
|
@@ -369,6 +369,13 @@ function resolveSiteVerticalBookingConfig(rawConfig) {
|
|
|
369
369
|
};
|
|
370
370
|
}
|
|
371
371
|
//#endregion
|
|
372
|
+
//#region ../blocks/src/system/data/selectBlockContent.ts
|
|
373
|
+
/** Canonical admitted content: legacy publishedContent never selects a version. */
|
|
374
|
+
function selectBlockContent(block, stage = "published") {
|
|
375
|
+
const source = stage === "preview" && block.draftContent ? block.draftContent : block.content;
|
|
376
|
+
return isObjectRecord(source) ? stripStaleTransitionStyleGroup(source) : {};
|
|
377
|
+
}
|
|
378
|
+
//#endregion
|
|
372
379
|
//#region ../blocks/src/system/manifest/variantKey.ts
|
|
373
380
|
/** Parse stored content only; defaults belong to resolveEffectiveArrangement. */
|
|
374
381
|
function parseStoredVariant(manifest, content) {
|
|
@@ -380,274 +387,298 @@ function parseStoredVariant(manifest, content) {
|
|
|
380
387
|
} : { kind: "absent" };
|
|
381
388
|
}
|
|
382
389
|
//#endregion
|
|
383
|
-
//#region ../blocks/src/
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
if (!isRecord$1(payload)) return payload;
|
|
387
|
-
const response = payload;
|
|
388
|
-
if (!Array.isArray(response.entries)) return payload;
|
|
389
|
-
const contentType = parsePublicContentTypeMeta(response.contentType);
|
|
390
|
-
if (!contentType) return response.entries;
|
|
391
|
-
return response.entries.map((entry) => enrichLinkedContentEntry(entry, contentType));
|
|
392
|
-
}
|
|
393
|
-
function getLinkedContentEntryMeta(value) {
|
|
394
|
-
if (!isRecord$1(value)) return null;
|
|
395
|
-
const candidate = value[LINKED_CONTENT_ENTRY_META_KEY];
|
|
396
|
-
return isLinkedContentEntryMeta(candidate) ? candidate : null;
|
|
397
|
-
}
|
|
398
|
-
function buildLinkedContentEditTarget(input) {
|
|
399
|
-
const { entry, sourceBlockId, sourceBlockKind, itemIndex } = input;
|
|
400
|
-
if (!isRecord$1(entry)) return null;
|
|
401
|
-
const meta = getLinkedContentEntryMeta(entry);
|
|
402
|
-
if (!meta || meta.support.kind !== "supported") return null;
|
|
403
|
-
const content = isRecord$1(entry.content) ? entry.content : {};
|
|
390
|
+
//#region ../blocks/src/pageRenderAdmission.ts
|
|
391
|
+
function toPresentationPage(page) {
|
|
392
|
+
if (!page) return null;
|
|
404
393
|
return {
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
394
|
+
...page,
|
|
395
|
+
blocks: page.blocks.map((block) => {
|
|
396
|
+
const presentationMetadata = {
|
|
397
|
+
id: block.id,
|
|
398
|
+
kind: block.kind,
|
|
399
|
+
purpose: block.purpose,
|
|
400
|
+
...block.contentVersionId ? { contentVersionId: block.contentVersionId } : {},
|
|
401
|
+
...block.draftContentId !== void 0 ? { draftContentId: block.draftContentId } : {},
|
|
402
|
+
publishedPlacement: block.publishedPlacement,
|
|
403
|
+
...block.bindings ? { bindings: block.bindings } : {}
|
|
404
|
+
};
|
|
405
|
+
return block.admission.kind === "renderable" ? {
|
|
406
|
+
...presentationMetadata,
|
|
407
|
+
content: block.admission.content,
|
|
408
|
+
presentationAdmission: { kind: "renderable" }
|
|
409
|
+
} : {
|
|
410
|
+
...presentationMetadata,
|
|
411
|
+
presentationAdmission: {
|
|
412
|
+
kind: "invalid",
|
|
413
|
+
error: block.admission.error
|
|
414
|
+
}
|
|
415
|
+
};
|
|
416
|
+
})
|
|
416
417
|
};
|
|
417
418
|
}
|
|
418
|
-
function
|
|
419
|
-
|
|
420
|
-
if (!meta) return {
|
|
421
|
-
kind: "read-only",
|
|
422
|
-
reason: "missing-entry-meta"
|
|
423
|
-
};
|
|
424
|
-
if (meta.support.kind !== "supported") return {
|
|
425
|
-
kind: "read-only",
|
|
426
|
-
reason: "unsupported-content-type"
|
|
427
|
-
};
|
|
428
|
-
const source = resolveLinkedEntryFieldSource(meta, input.displayPath);
|
|
429
|
-
if (!source) return {
|
|
430
|
-
kind: "read-only",
|
|
431
|
-
reason: "unmapped-display-path"
|
|
432
|
-
};
|
|
433
|
-
if (source.kind === "read-only") return {
|
|
434
|
-
kind: "read-only",
|
|
435
|
-
reason: source.reason
|
|
436
|
-
};
|
|
437
|
-
const field = meta.contentType.fields.find((candidate) => candidate.id === source.fieldPath);
|
|
438
|
-
if (!field) return {
|
|
439
|
-
kind: "read-only",
|
|
440
|
-
reason: "missing-field-schema"
|
|
441
|
-
};
|
|
442
|
-
const fieldType = resolvePreviewLinkedEntryInlineFieldType(field.type);
|
|
443
|
-
if (!fieldType || fieldType !== source.fieldType) return {
|
|
444
|
-
kind: "read-only",
|
|
445
|
-
reason: "unsupported-field-type"
|
|
446
|
-
};
|
|
447
|
-
if (input.renderedNodeType === "richText" && fieldType !== "richText") return {
|
|
448
|
-
kind: "read-only",
|
|
449
|
-
reason: "unsupported-field-type"
|
|
450
|
-
};
|
|
451
|
-
if (input.renderedNodeType === "text" && fieldType !== "text") return {
|
|
452
|
-
kind: "read-only",
|
|
453
|
-
reason: "unsupported-field-type"
|
|
454
|
-
};
|
|
419
|
+
function toEditorPresentationPage(page) {
|
|
420
|
+
if (!page) return null;
|
|
455
421
|
return {
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
fieldType
|
|
463
|
-
}
|
|
422
|
+
...page,
|
|
423
|
+
blocks: page.blocks.map((block) => ({
|
|
424
|
+
...block,
|
|
425
|
+
publishedPlacement: block.publishedPlacement,
|
|
426
|
+
presentationAdmission: { kind: "editor" }
|
|
427
|
+
}))
|
|
464
428
|
};
|
|
465
429
|
}
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
const title = typeof entry.title === "string" && entry.title.trim().length > 0 ? entry.title : entryId;
|
|
471
|
-
const optimisticHash = typeof entry.optimisticHash === "string" && entry.optimisticHash.length > 0 ? entry.optimisticHash : null;
|
|
472
|
-
const content = isRecord$1(entry.content) ? entry.content : {};
|
|
473
|
-
const meta = {
|
|
474
|
-
kind: "linked-content-entry",
|
|
475
|
-
entryId,
|
|
476
|
-
contentTypeKey: contentType.key,
|
|
477
|
-
contentTypeLabel: contentTypeKeyToLabel(contentType.key),
|
|
478
|
-
title,
|
|
479
|
-
optimisticHash,
|
|
480
|
-
support: resolveLinkedContentEditSupport(contentType),
|
|
481
|
-
contentType,
|
|
482
|
-
fieldSources: deriveLinkedEntryFieldSources(entry, contentType, content)
|
|
483
|
-
};
|
|
484
|
-
return {
|
|
485
|
-
...entry,
|
|
486
|
-
[LINKED_CONTENT_ENTRY_META_KEY]: meta
|
|
487
|
-
};
|
|
430
|
+
//#endregion
|
|
431
|
+
//#region ../blocks/src/system/customize/facets.ts
|
|
432
|
+
function defineCustomizeFacet(definition) {
|
|
433
|
+
return definition;
|
|
488
434
|
}
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
fieldPath: field.id,
|
|
517
|
-
fieldType
|
|
518
|
-
});
|
|
435
|
+
const eventCalendarListLayoutFacet = defineCustomizeFacet({
|
|
436
|
+
blockKind: "block.event-calendar",
|
|
437
|
+
id: "eventCalendar.listLayout",
|
|
438
|
+
label: "List style",
|
|
439
|
+
legacyOnly: true,
|
|
440
|
+
values: eventCalendarListLayoutOptions.map((option) => ({
|
|
441
|
+
value: option.id,
|
|
442
|
+
label: option.label
|
|
443
|
+
})),
|
|
444
|
+
defaultValue: "stack",
|
|
445
|
+
target: { kind: "event-calendar-list-layout-content" },
|
|
446
|
+
appliesToLayoutVariants: eventCalendarListLayoutCompatibleDisplayModeValues
|
|
447
|
+
});
|
|
448
|
+
const fixedKnob = (blockKind, id, label, values, defaultValue, ordered = false, boolean = false) => ({
|
|
449
|
+
blockKind,
|
|
450
|
+
id,
|
|
451
|
+
label,
|
|
452
|
+
values,
|
|
453
|
+
defaultValue,
|
|
454
|
+
knob: {
|
|
455
|
+
kind: "fixed",
|
|
456
|
+
ordered
|
|
457
|
+
},
|
|
458
|
+
target: {
|
|
459
|
+
kind: "content-field",
|
|
460
|
+
field: id,
|
|
461
|
+
...boolean ? { boolean: true } : {}
|
|
519
462
|
}
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
kind: "
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
function resolveLinkedEntryFieldSource(meta, displayPath) {
|
|
535
|
-
return meta.fieldSources.find((candidate) => candidate.displayPath === displayPath) ?? null;
|
|
536
|
-
}
|
|
537
|
-
function resolvePreviewLinkedEntryInlineFieldType(fieldType) {
|
|
538
|
-
if (fieldType === "richText") return "richText";
|
|
539
|
-
if (fieldType === "text" || fieldType === "textarea") return "text";
|
|
540
|
-
return null;
|
|
541
|
-
}
|
|
542
|
-
function resolveLinkedContentEditSupport(contentType) {
|
|
543
|
-
if (contentType.fields.length === 0) return {
|
|
544
|
-
kind: "unsupported-missing-schema",
|
|
545
|
-
reason: "Content type has no public field metadata."
|
|
546
|
-
};
|
|
547
|
-
const metadata = contentType.previewLinkedEntryEditing;
|
|
548
|
-
if (!metadata) return {
|
|
549
|
-
kind: "unsupported-content-type",
|
|
550
|
-
reason: "Content type has not enabled linked-entry preview editing."
|
|
551
|
-
};
|
|
552
|
-
switch (metadata.kind) {
|
|
553
|
-
case "generic": return { kind: "supported" };
|
|
554
|
-
case "unsupported-domain-backed": return {
|
|
555
|
-
kind: "unsupported-domain-backed",
|
|
556
|
-
reason: metadata.reason
|
|
557
|
-
};
|
|
558
|
-
default: return assertNever(metadata);
|
|
463
|
+
});
|
|
464
|
+
const textKnob = (id, label, maxLength) => ({
|
|
465
|
+
blockKind: "block.hero",
|
|
466
|
+
id,
|
|
467
|
+
label,
|
|
468
|
+
values: [],
|
|
469
|
+
defaultValue: "",
|
|
470
|
+
knob: {
|
|
471
|
+
kind: "text",
|
|
472
|
+
maxLength
|
|
473
|
+
},
|
|
474
|
+
target: {
|
|
475
|
+
kind: "content-field",
|
|
476
|
+
field: id
|
|
559
477
|
}
|
|
478
|
+
});
|
|
479
|
+
const onOff = [{
|
|
480
|
+
value: "true",
|
|
481
|
+
label: "On"
|
|
482
|
+
}, {
|
|
483
|
+
value: "false",
|
|
484
|
+
label: "Off"
|
|
485
|
+
}];
|
|
486
|
+
const systemCustomizeFacetDefinitions = [
|
|
487
|
+
eventCalendarListLayoutFacet,
|
|
488
|
+
fixedKnob("block.offerings-preview", "dates", "Dates", [{
|
|
489
|
+
value: "summary",
|
|
490
|
+
label: "Summary"
|
|
491
|
+
}, {
|
|
492
|
+
value: "next-dates",
|
|
493
|
+
label: "Next dates"
|
|
494
|
+
}], "summary"),
|
|
495
|
+
{
|
|
496
|
+
...fixedKnob("block.feature-cards", "actionStyle", "Item actions", [{
|
|
497
|
+
value: "button",
|
|
498
|
+
label: "Button"
|
|
499
|
+
}, {
|
|
500
|
+
value: "link",
|
|
501
|
+
label: "Link"
|
|
502
|
+
}], "button"),
|
|
503
|
+
blockKinds: cardListKnobBlocks
|
|
504
|
+
},
|
|
505
|
+
fixedKnob("block.testimonials", "quoteCount", "How many quotes", [
|
|
506
|
+
{
|
|
507
|
+
value: "1",
|
|
508
|
+
label: "1"
|
|
509
|
+
},
|
|
510
|
+
{
|
|
511
|
+
value: "2",
|
|
512
|
+
label: "2"
|
|
513
|
+
},
|
|
514
|
+
{
|
|
515
|
+
value: "3",
|
|
516
|
+
label: "3"
|
|
517
|
+
},
|
|
518
|
+
{
|
|
519
|
+
value: "all",
|
|
520
|
+
label: "All"
|
|
521
|
+
}
|
|
522
|
+
], "3", true),
|
|
523
|
+
fixedKnob("block.testimonials", "tilt", "Tilt the small cards", onOff, "true", false, true),
|
|
524
|
+
{
|
|
525
|
+
...fixedKnob("block.testimonials", "archFrame", "Arch frame", onOff, "true", false, true),
|
|
526
|
+
blockKinds: [
|
|
527
|
+
"block.testimonials",
|
|
528
|
+
"block.newsletter-signup",
|
|
529
|
+
"block.form"
|
|
530
|
+
]
|
|
531
|
+
},
|
|
532
|
+
fixedKnob("block.hero", "candleGlow", "Candle glow", onOff, "true", false, true),
|
|
533
|
+
fixedKnob("block.hero", "columnGuides", "Column guides", onOff, "true", false, true),
|
|
534
|
+
fixedKnob("block.hero", "titleSize", "Headline size", [
|
|
535
|
+
{
|
|
536
|
+
value: "quiet",
|
|
537
|
+
label: "Quieter"
|
|
538
|
+
},
|
|
539
|
+
{
|
|
540
|
+
value: "auto",
|
|
541
|
+
label: "Standard"
|
|
542
|
+
},
|
|
543
|
+
{
|
|
544
|
+
value: "display",
|
|
545
|
+
label: "Louder"
|
|
546
|
+
}
|
|
547
|
+
], "auto", true),
|
|
548
|
+
fixedKnob("block.hero", "imagePosition", "Photo side", [{
|
|
549
|
+
value: "left",
|
|
550
|
+
label: "Left"
|
|
551
|
+
}, {
|
|
552
|
+
value: "right",
|
|
553
|
+
label: "Right"
|
|
554
|
+
}], "right"),
|
|
555
|
+
fixedKnob("block.intro", "imageShape", "Media shape", standardImageShapeOptions, "default"),
|
|
556
|
+
fixedKnob("block.intro", "imagePosition", "Photo side", [{
|
|
557
|
+
value: "left",
|
|
558
|
+
label: "Left"
|
|
559
|
+
}, {
|
|
560
|
+
value: "right",
|
|
561
|
+
label: "Right"
|
|
562
|
+
}], "left"),
|
|
563
|
+
fixedKnob("block.media-text", "imagePosition", "Photo side", [{
|
|
564
|
+
value: "left",
|
|
565
|
+
label: "Left"
|
|
566
|
+
}, {
|
|
567
|
+
value: "right",
|
|
568
|
+
label: "Right"
|
|
569
|
+
}], "left"),
|
|
570
|
+
fixedKnob("block.media-text", "imageShape", "Media shape", standardImageShapeOptions, "default"),
|
|
571
|
+
fixedKnob("block.media-text", "aspectRatio", "Media aspect ratio", standardAspectRatioOptions, "auto"),
|
|
572
|
+
textKnob("stickerLine", "Sticker line", 32),
|
|
573
|
+
textKnob("smallCaption", "Small caption", 24),
|
|
574
|
+
{
|
|
575
|
+
...fixedKnob("block.feature-cards", "showPhotos", "Show photos", onOff, "true", false, true),
|
|
576
|
+
blockKinds: cardListFamilyBlocks
|
|
577
|
+
},
|
|
578
|
+
fixedKnob("block.event-calendar", "showPhotos", "Photos", [{
|
|
579
|
+
value: "true",
|
|
580
|
+
label: "Show"
|
|
581
|
+
}, {
|
|
582
|
+
value: "false",
|
|
583
|
+
label: "Hide"
|
|
584
|
+
}], "true", false, true),
|
|
585
|
+
{
|
|
586
|
+
...fixedKnob("block.feature-cards", "cardMarker", "Item markers", [
|
|
587
|
+
{
|
|
588
|
+
value: "icons",
|
|
589
|
+
label: "Icons"
|
|
590
|
+
},
|
|
591
|
+
{
|
|
592
|
+
value: "numbers",
|
|
593
|
+
label: "Numbers"
|
|
594
|
+
},
|
|
595
|
+
{
|
|
596
|
+
value: "none",
|
|
597
|
+
label: "None"
|
|
598
|
+
}
|
|
599
|
+
], "icons"),
|
|
600
|
+
blockKinds: cardListFamilyBlocks
|
|
601
|
+
},
|
|
602
|
+
fixedKnob("block.event-calendar", "showCapacity", "Show places left", onOff, "true", false, true)
|
|
603
|
+
];
|
|
604
|
+
systemCustomizeFacetDefinitions.map((definition) => definition.id);
|
|
605
|
+
Array.from(new Set(systemCustomizeFacetDefinitions.flatMap((definition) => definition.values.map((option) => option.value))));
|
|
606
|
+
function systemCustomizeFacetDefinitionsForBlock(blockKind) {
|
|
607
|
+
return systemCustomizeFacetDefinitions.filter((definition) => definition.blockKind === blockKind || "blockKinds" in definition && definition.blockKinds?.some((kind) => kind === blockKind));
|
|
560
608
|
}
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
609
|
+
//#endregion
|
|
610
|
+
//#region ../blocks/src/system/customize/arrangementKnobs.ts
|
|
611
|
+
/**
|
|
612
|
+
* Content stage for knobs, shared by the renderer and the editor so what the
|
|
613
|
+
* options show and what renders can't disagree. Knob buffets are the block's
|
|
614
|
+
* customise facets; the Look exposes, forces or narrows them and the style's
|
|
615
|
+
* offer can only remove or narrow further.
|
|
616
|
+
*/
|
|
617
|
+
function resolveArrangementKnobs(input) {
|
|
618
|
+
const length = input.blockKind === "block.hero" ? resolveHeroTitleLength({ ...input.content }, "look") : null;
|
|
619
|
+
const exposure = arrangementKnobExposure(input.blockKind, input.look, length);
|
|
570
620
|
return {
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
621
|
+
length,
|
|
622
|
+
exposure,
|
|
623
|
+
knobs: resolveEffectiveKnobs({
|
|
624
|
+
exposure,
|
|
625
|
+
content: normalizedHeadlinePreference(input.content)
|
|
626
|
+
})
|
|
575
627
|
};
|
|
576
628
|
}
|
|
577
|
-
function
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
}
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
fileKinds: parseStringArray(value.fileKinds)
|
|
596
|
-
}];
|
|
597
|
-
}
|
|
598
|
-
function parseStringArray(value) {
|
|
599
|
-
if (value === null || typeof value === "undefined") return null;
|
|
600
|
-
if (!Array.isArray(value)) return null;
|
|
601
|
-
return value.filter((item) => typeof item === "string");
|
|
602
|
-
}
|
|
603
|
-
function isLinkedContentEntryMeta(value) {
|
|
604
|
-
if (!isRecord$1(value)) return false;
|
|
605
|
-
if (value.kind !== "linked-content-entry") return false;
|
|
606
|
-
if (typeof value.entryId !== "string") return false;
|
|
607
|
-
if (typeof value.contentTypeKey !== "string") return false;
|
|
608
|
-
if (typeof value.contentTypeLabel !== "string") return false;
|
|
609
|
-
if (typeof value.title !== "string") return false;
|
|
610
|
-
if (!(value.optimisticHash === null || typeof value.optimisticHash === "string")) return false;
|
|
611
|
-
if (!isRecord$1(value.contentType)) return false;
|
|
612
|
-
if (!isLinkedEntryFieldSourceArray(value.fieldSources)) return false;
|
|
613
|
-
return isLinkedContentEditSupport(value.support);
|
|
629
|
+
function arrangementKnobExposure(blockKind, look, length) {
|
|
630
|
+
return systemCustomizeFacetDefinitionsForBlock(blockKind).flatMap((facet) => {
|
|
631
|
+
if (facet.knob === void 0 || facet.target.kind !== "content-field") return [];
|
|
632
|
+
const id = facet.target.field;
|
|
633
|
+
return [{
|
|
634
|
+
definition: {
|
|
635
|
+
id,
|
|
636
|
+
defaultValue: (look.look.structure.knobDefaults ?? {})[id] ?? facet.defaultValue,
|
|
637
|
+
values: facet.values.map((value) => value.value),
|
|
638
|
+
...knobKindMetadata(facet.knob)
|
|
639
|
+
},
|
|
640
|
+
exposed: exposedKnobIds(look).includes(id),
|
|
641
|
+
forced: look.look.structure.forcedKnobs?.[id],
|
|
642
|
+
lookValues: look.look.structure.knobValues?.[id],
|
|
643
|
+
styleValues: look.knobValues[id],
|
|
644
|
+
lengthValues: id === "titleSize" ? headlineAllowedValues(length) : void 0
|
|
645
|
+
}];
|
|
646
|
+
});
|
|
614
647
|
}
|
|
615
|
-
function
|
|
616
|
-
return
|
|
648
|
+
function knobKindMetadata(knob) {
|
|
649
|
+
return knob.kind === "fixed" ? { ordered: knob.ordered } : {
|
|
650
|
+
ordered: false,
|
|
651
|
+
textMaxLength: knob.maxLength
|
|
652
|
+
};
|
|
617
653
|
}
|
|
618
|
-
function
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
case "
|
|
623
|
-
|
|
624
|
-
|
|
654
|
+
function headlineAllowedValues(length) {
|
|
655
|
+
switch (length) {
|
|
656
|
+
case "long": return ["quiet"];
|
|
657
|
+
case "medium": return ["quiet", "auto"];
|
|
658
|
+
case "short": return [
|
|
659
|
+
"quiet",
|
|
660
|
+
"auto",
|
|
661
|
+
"display"
|
|
662
|
+
];
|
|
663
|
+
case null: return;
|
|
625
664
|
}
|
|
626
665
|
}
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
case "
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
case "
|
|
635
|
-
|
|
636
|
-
|
|
666
|
+
/** `titleSize` keeps its five stored values; under a Look they read as three steps. */
|
|
667
|
+
function normalizedHeadlinePreference(content) {
|
|
668
|
+
switch (content.titleSize) {
|
|
669
|
+
case "editorial": return {
|
|
670
|
+
...content,
|
|
671
|
+
titleSize: "auto"
|
|
672
|
+
};
|
|
673
|
+
case "poster": return {
|
|
674
|
+
...content,
|
|
675
|
+
titleSize: "display"
|
|
676
|
+
};
|
|
677
|
+
default: return content;
|
|
637
678
|
}
|
|
638
679
|
}
|
|
639
|
-
function
|
|
640
|
-
|
|
641
|
-
switch (value.kind) {
|
|
642
|
-
case "supported": return true;
|
|
643
|
-
case "unsupported-domain-backed":
|
|
644
|
-
case "unsupported-content-type":
|
|
645
|
-
case "unsupported-missing-schema": return typeof value.reason === "string";
|
|
646
|
-
default: return false;
|
|
647
|
-
}
|
|
648
|
-
}
|
|
649
|
-
function isRecord$1(value) {
|
|
650
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
680
|
+
function exposedKnobIds(look) {
|
|
681
|
+
return [...look.look.structure.knobs, ...look.addKnobs ?? []].filter((id) => !look.removeKnobs.some((removed) => removed === id));
|
|
651
682
|
}
|
|
652
683
|
//#endregion
|
|
653
684
|
//#region ../blocks/src/system/transforms/registry/offeringsPreview.ts
|
|
@@ -979,7 +1010,11 @@ const eventCalendarSelectionParam = {
|
|
|
979
1010
|
return key === "seriesIds" ? void 0 : content[key];
|
|
980
1011
|
}
|
|
981
1012
|
};
|
|
982
|
-
const readJobSchema = z.object({ job: z.enum([
|
|
1013
|
+
const readJobSchema = z.object({ job: z.enum([
|
|
1014
|
+
"list",
|
|
1015
|
+
"calendar",
|
|
1016
|
+
"schedule"
|
|
1017
|
+
]) });
|
|
983
1018
|
const eventCalendarReadProfile = {
|
|
984
1019
|
id: "events.calendarReadProfile",
|
|
985
1020
|
kind: "formatter",
|
|
@@ -995,7 +1030,7 @@ const eventCalendarReadEnabled = {
|
|
|
995
1030
|
schema: readJobSchema,
|
|
996
1031
|
run(value, options) {
|
|
997
1032
|
const plan = resolveEventCalendarReadPlan(asPartialObject(value) ?? {});
|
|
998
|
-
return plan.jobs ===
|
|
1033
|
+
return plan.jobs === options.job || plan.jobs === "both" && options.job !== "schedule";
|
|
999
1034
|
}
|
|
1000
1035
|
};
|
|
1001
1036
|
//#endregion
|
|
@@ -1047,383 +1082,274 @@ const builtinTransformDefinitions = [
|
|
|
1047
1082
|
];
|
|
1048
1083
|
const defaultTransforms = createTransformRegistry(builtinTransformDefinitions);
|
|
1049
1084
|
//#endregion
|
|
1050
|
-
//#region ../blocks/src/
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
* it (last omitted→C). Nothing visual is carried: the survivors are composed
|
|
1060
|
-
* from their own content afterwards.
|
|
1061
|
-
*
|
|
1062
|
-
* `survivors` are compared by identity against `originalBlocks`.
|
|
1063
|
-
*/
|
|
1064
|
-
function retargetJoinsAcrossOmissions(input) {
|
|
1065
|
-
const { joins, originalBlocks, survivingBlocks } = input;
|
|
1066
|
-
if (joins.length === 0) return joins;
|
|
1067
|
-
if (originalBlocks.every((block) => survivingBlocks.has(block))) return joins;
|
|
1068
|
-
const byPair = joinsByPair(joins);
|
|
1069
|
-
const retargeted = [];
|
|
1070
|
-
let previousSurvivor = null;
|
|
1071
|
-
let run = [];
|
|
1072
|
-
for (const block of originalBlocks) {
|
|
1073
|
-
if (!survivingBlocks.has(block)) {
|
|
1074
|
-
run.push(block);
|
|
1075
|
-
continue;
|
|
1076
|
-
}
|
|
1077
|
-
if (previousSurvivor?.id && block.id) {
|
|
1078
|
-
const join = run.length === 0 ? byPair.get(pairKey(previousSurvivor.id, block.id)) : joinAcrossRun(byPair, previousSurvivor.id, block.id, run);
|
|
1079
|
-
if (join) retargeted.push(join);
|
|
1080
|
-
}
|
|
1081
|
-
previousSurvivor = block;
|
|
1082
|
-
run = [];
|
|
1083
|
-
}
|
|
1084
|
-
return retargeted;
|
|
1085
|
-
}
|
|
1086
|
-
function joinAcrossRun(byPair, previousBlockId, nextBlockId, run) {
|
|
1087
|
-
const firstOmittedId = run[0]?.id;
|
|
1088
|
-
const lastOmittedId = run[run.length - 1]?.id;
|
|
1089
|
-
const entering = firstOmittedId ? byPair.get(pairKey(previousBlockId, firstOmittedId)) : void 0;
|
|
1090
|
-
const exiting = lastOmittedId ? byPair.get(pairKey(lastOmittedId, nextBlockId)) : void 0;
|
|
1091
|
-
const donor = entering ?? exiting;
|
|
1092
|
-
return donor ? {
|
|
1093
|
-
previousBlockId,
|
|
1094
|
-
nextBlockId,
|
|
1095
|
-
treatment: donor.treatment
|
|
1096
|
-
} : void 0;
|
|
1085
|
+
//#region ../blocks/src/system/data/linkedContentEntries.ts
|
|
1086
|
+
const LINKED_CONTENT_ENTRY_META_KEY = "__rbLinkedContentEntry";
|
|
1087
|
+
function coerceLinkedContentEntriesPayload(payload) {
|
|
1088
|
+
if (!isRecord$1(payload)) return payload;
|
|
1089
|
+
const response = payload;
|
|
1090
|
+
if (!Array.isArray(response.entries)) return payload;
|
|
1091
|
+
const contentType = parsePublicContentTypeMeta(response.contentType);
|
|
1092
|
+
if (!contentType) return response.entries;
|
|
1093
|
+
return response.entries.map((entry) => enrichLinkedContentEntry(entry, contentType));
|
|
1097
1094
|
}
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
*/
|
|
1103
|
-
function composePageJoins(input) {
|
|
1104
|
-
const byPair = joinsByPair(input.joins);
|
|
1105
|
-
return input.survivors.flatMap((previous, index) => {
|
|
1106
|
-
const next = input.survivors[index + 1];
|
|
1107
|
-
if (!next || !previous.id || !next.id) return [];
|
|
1108
|
-
const join = byPair.get(pairKey(previous.id, next.id));
|
|
1109
|
-
return [{
|
|
1110
|
-
previousBlockId: previous.id,
|
|
1111
|
-
nextBlockId: next.id,
|
|
1112
|
-
join: join ? composeJoin(join, previous, next) : null
|
|
1113
|
-
}];
|
|
1114
|
-
});
|
|
1095
|
+
function getLinkedContentEntryMeta(value) {
|
|
1096
|
+
if (!isRecord$1(value)) return null;
|
|
1097
|
+
const candidate = value[LINKED_CONTENT_ENTRY_META_KEY];
|
|
1098
|
+
return isLinkedContentEntryMeta(candidate) ? candidate : null;
|
|
1115
1099
|
}
|
|
1116
|
-
function
|
|
1100
|
+
function buildLinkedContentEditTarget(input) {
|
|
1101
|
+
const { entry, sourceBlockId, sourceBlockKind, itemIndex } = input;
|
|
1102
|
+
if (!isRecord$1(entry)) return null;
|
|
1103
|
+
const meta = getLinkedContentEntryMeta(entry);
|
|
1104
|
+
if (!meta || meta.support.kind !== "supported") return null;
|
|
1105
|
+
const content = isRecord$1(entry.content) ? entry.content : {};
|
|
1117
1106
|
return {
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1107
|
+
kind: "linked-content-entry",
|
|
1108
|
+
entryId: meta.entryId,
|
|
1109
|
+
contentTypeKey: meta.contentTypeKey,
|
|
1110
|
+
contentTypeLabel: meta.contentTypeLabel,
|
|
1111
|
+
title: meta.title,
|
|
1112
|
+
optimisticHash: meta.optimisticHash,
|
|
1113
|
+
sourceBlockId: sourceBlockId ?? null,
|
|
1114
|
+
sourceBlockKind: sourceBlockKind ?? null,
|
|
1115
|
+
itemIndex,
|
|
1116
|
+
content: { ...content },
|
|
1117
|
+
contentType: meta.contentType
|
|
1123
1118
|
};
|
|
1124
1119
|
}
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
if (!
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1120
|
+
function resolveLinkedEntryInlineFieldEligibility(input) {
|
|
1121
|
+
const meta = getLinkedContentEntryMeta(input.entry);
|
|
1122
|
+
if (!meta) return {
|
|
1123
|
+
kind: "read-only",
|
|
1124
|
+
reason: "missing-entry-meta"
|
|
1125
|
+
};
|
|
1126
|
+
if (meta.support.kind !== "supported") return {
|
|
1127
|
+
kind: "read-only",
|
|
1128
|
+
reason: "unsupported-content-type"
|
|
1129
|
+
};
|
|
1130
|
+
const source = resolveLinkedEntryFieldSource(meta, input.displayPath);
|
|
1131
|
+
if (!source) return {
|
|
1132
|
+
kind: "read-only",
|
|
1133
|
+
reason: "unmapped-display-path"
|
|
1134
|
+
};
|
|
1135
|
+
if (source.kind === "read-only") return {
|
|
1136
|
+
kind: "read-only",
|
|
1137
|
+
reason: source.reason
|
|
1138
|
+
};
|
|
1139
|
+
const field = meta.contentType.fields.find((candidate) => candidate.id === source.fieldPath);
|
|
1140
|
+
if (!field) return {
|
|
1141
|
+
kind: "read-only",
|
|
1142
|
+
reason: "missing-field-schema"
|
|
1143
|
+
};
|
|
1144
|
+
const fieldType = resolvePreviewLinkedEntryInlineFieldType(field.type);
|
|
1145
|
+
if (!fieldType || fieldType !== source.fieldType) return {
|
|
1146
|
+
kind: "read-only",
|
|
1147
|
+
reason: "unsupported-field-type"
|
|
1148
|
+
};
|
|
1149
|
+
if (input.renderedNodeType === "richText" && fieldType !== "richText") return {
|
|
1150
|
+
kind: "read-only",
|
|
1151
|
+
reason: "unsupported-field-type"
|
|
1152
|
+
};
|
|
1153
|
+
if (input.renderedNodeType === "text" && fieldType !== "text") return {
|
|
1154
|
+
kind: "read-only",
|
|
1155
|
+
reason: "unsupported-field-type"
|
|
1156
|
+
};
|
|
1145
1157
|
return {
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
publishedPlacement: block.publishedPlacement,
|
|
1155
|
-
...block.bindings ? { bindings: block.bindings } : {}
|
|
1156
|
-
};
|
|
1157
|
-
return block.admission.kind === "renderable" ? {
|
|
1158
|
-
...presentationMetadata,
|
|
1159
|
-
content: block.admission.content,
|
|
1160
|
-
presentationAdmission: { kind: "renderable" }
|
|
1161
|
-
} : {
|
|
1162
|
-
...presentationMetadata,
|
|
1163
|
-
presentationAdmission: {
|
|
1164
|
-
kind: "invalid",
|
|
1165
|
-
error: block.admission.error
|
|
1166
|
-
}
|
|
1167
|
-
};
|
|
1168
|
-
})
|
|
1158
|
+
kind: "editable",
|
|
1159
|
+
displayPath: input.displayPath,
|
|
1160
|
+
write: {
|
|
1161
|
+
kind: "linked-entry-write-field",
|
|
1162
|
+
entryId: meta.entryId,
|
|
1163
|
+
fieldPath: source.fieldPath,
|
|
1164
|
+
fieldType
|
|
1165
|
+
}
|
|
1169
1166
|
};
|
|
1170
1167
|
}
|
|
1171
|
-
function
|
|
1172
|
-
if (!
|
|
1168
|
+
function enrichLinkedContentEntry(entry, contentType) {
|
|
1169
|
+
if (!isRecord$1(entry)) return entry;
|
|
1170
|
+
const entryId = typeof entry.id === "string" ? entry.id : null;
|
|
1171
|
+
if (!entryId) return entry;
|
|
1172
|
+
const title = typeof entry.title === "string" && entry.title.trim().length > 0 ? entry.title : entryId;
|
|
1173
|
+
const optimisticHash = typeof entry.optimisticHash === "string" && entry.optimisticHash.length > 0 ? entry.optimisticHash : null;
|
|
1174
|
+
const content = isRecord$1(entry.content) ? entry.content : {};
|
|
1175
|
+
const meta = {
|
|
1176
|
+
kind: "linked-content-entry",
|
|
1177
|
+
entryId,
|
|
1178
|
+
contentTypeKey: contentType.key,
|
|
1179
|
+
contentTypeLabel: contentTypeKeyToLabel(contentType.key),
|
|
1180
|
+
title,
|
|
1181
|
+
optimisticHash,
|
|
1182
|
+
support: resolveLinkedContentEditSupport(contentType),
|
|
1183
|
+
contentType,
|
|
1184
|
+
fieldSources: deriveLinkedEntryFieldSources(entry, contentType, content)
|
|
1185
|
+
};
|
|
1173
1186
|
return {
|
|
1174
|
-
...
|
|
1175
|
-
|
|
1176
|
-
...block,
|
|
1177
|
-
publishedPlacement: block.publishedPlacement,
|
|
1178
|
-
presentationAdmission: { kind: "editor" }
|
|
1179
|
-
}))
|
|
1187
|
+
...entry,
|
|
1188
|
+
[LINKED_CONTENT_ENTRY_META_KEY]: meta
|
|
1180
1189
|
};
|
|
1181
1190
|
}
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
value: option.id,
|
|
1194
|
-
label: option.label
|
|
1195
|
-
})),
|
|
1196
|
-
defaultValue: "stack",
|
|
1197
|
-
target: { kind: "event-calendar-list-layout-content" },
|
|
1198
|
-
appliesToLayoutVariants: eventCalendarListLayoutCompatibleDisplayModeValues
|
|
1199
|
-
});
|
|
1200
|
-
const fixedKnob = (blockKind, id, label, values, defaultValue, ordered = false, boolean = false) => ({
|
|
1201
|
-
blockKind,
|
|
1202
|
-
id,
|
|
1203
|
-
label,
|
|
1204
|
-
values,
|
|
1205
|
-
defaultValue,
|
|
1206
|
-
knob: {
|
|
1207
|
-
kind: "fixed",
|
|
1208
|
-
ordered
|
|
1209
|
-
},
|
|
1210
|
-
target: {
|
|
1211
|
-
kind: "content-field",
|
|
1212
|
-
field: id,
|
|
1213
|
-
...boolean ? { boolean: true } : {}
|
|
1214
|
-
}
|
|
1215
|
-
});
|
|
1216
|
-
const textKnob = (id, label, maxLength) => ({
|
|
1217
|
-
blockKind: "block.hero",
|
|
1218
|
-
id,
|
|
1219
|
-
label,
|
|
1220
|
-
values: [],
|
|
1221
|
-
defaultValue: "",
|
|
1222
|
-
knob: {
|
|
1223
|
-
kind: "text",
|
|
1224
|
-
maxLength
|
|
1225
|
-
},
|
|
1226
|
-
target: {
|
|
1227
|
-
kind: "content-field",
|
|
1228
|
-
field: id
|
|
1229
|
-
}
|
|
1230
|
-
});
|
|
1231
|
-
const onOff = [{
|
|
1232
|
-
value: "true",
|
|
1233
|
-
label: "On"
|
|
1234
|
-
}, {
|
|
1235
|
-
value: "false",
|
|
1236
|
-
label: "Off"
|
|
1237
|
-
}];
|
|
1238
|
-
const systemCustomizeFacetDefinitions = [
|
|
1239
|
-
eventCalendarListLayoutFacet,
|
|
1240
|
-
fixedKnob("block.offerings-preview", "dates", "Dates", [{
|
|
1241
|
-
value: "summary",
|
|
1242
|
-
label: "Summary"
|
|
1243
|
-
}, {
|
|
1244
|
-
value: "next-dates",
|
|
1245
|
-
label: "Next dates"
|
|
1246
|
-
}], "summary"),
|
|
1247
|
-
{
|
|
1248
|
-
...fixedKnob("block.feature-cards", "actionStyle", "Item actions", [{
|
|
1249
|
-
value: "button",
|
|
1250
|
-
label: "Button"
|
|
1251
|
-
}, {
|
|
1252
|
-
value: "link",
|
|
1253
|
-
label: "Link"
|
|
1254
|
-
}], "button"),
|
|
1255
|
-
blockKinds: cardListKnobBlocks
|
|
1256
|
-
},
|
|
1257
|
-
fixedKnob("block.testimonials", "quoteCount", "How many quotes", [
|
|
1258
|
-
{
|
|
1259
|
-
value: "1",
|
|
1260
|
-
label: "1"
|
|
1261
|
-
},
|
|
1262
|
-
{
|
|
1263
|
-
value: "2",
|
|
1264
|
-
label: "2"
|
|
1265
|
-
},
|
|
1266
|
-
{
|
|
1267
|
-
value: "3",
|
|
1268
|
-
label: "3"
|
|
1269
|
-
},
|
|
1270
|
-
{
|
|
1271
|
-
value: "all",
|
|
1272
|
-
label: "All"
|
|
1273
|
-
}
|
|
1274
|
-
], "3", true),
|
|
1275
|
-
fixedKnob("block.testimonials", "tilt", "Tilt the small cards", onOff, "true", false, true),
|
|
1276
|
-
{
|
|
1277
|
-
...fixedKnob("block.testimonials", "archFrame", "Arch frame", onOff, "true", false, true),
|
|
1278
|
-
blockKinds: [
|
|
1279
|
-
"block.testimonials",
|
|
1280
|
-
"block.newsletter-signup",
|
|
1281
|
-
"block.form"
|
|
1282
|
-
]
|
|
1283
|
-
},
|
|
1284
|
-
fixedKnob("block.hero", "candleGlow", "Candle glow", onOff, "true", false, true),
|
|
1285
|
-
fixedKnob("block.hero", "columnGuides", "Column guides", onOff, "true", false, true),
|
|
1286
|
-
fixedKnob("block.hero", "titleSize", "Headline size", [
|
|
1287
|
-
{
|
|
1288
|
-
value: "quiet",
|
|
1289
|
-
label: "Quieter"
|
|
1290
|
-
},
|
|
1291
|
-
{
|
|
1292
|
-
value: "auto",
|
|
1293
|
-
label: "Standard"
|
|
1294
|
-
},
|
|
1295
|
-
{
|
|
1296
|
-
value: "display",
|
|
1297
|
-
label: "Louder"
|
|
1191
|
+
function deriveLinkedEntryFieldSources(entry, contentType, content) {
|
|
1192
|
+
const sources = [];
|
|
1193
|
+
for (const field of contentType.fields) {
|
|
1194
|
+
const fieldType = resolvePreviewLinkedEntryInlineFieldType(field.type);
|
|
1195
|
+
if (!fieldType) {
|
|
1196
|
+
sources.push({
|
|
1197
|
+
kind: "read-only",
|
|
1198
|
+
displayPath: `content.${field.id}`,
|
|
1199
|
+
reason: "unsupported-field-type"
|
|
1200
|
+
});
|
|
1201
|
+
continue;
|
|
1298
1202
|
}
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
}
|
|
1330
|
-
|
|
1331
|
-
...fixedKnob("block.feature-cards", "cardMarker", "Item markers", [
|
|
1332
|
-
{
|
|
1333
|
-
value: "icons",
|
|
1334
|
-
label: "Icons"
|
|
1335
|
-
},
|
|
1336
|
-
{
|
|
1337
|
-
value: "numbers",
|
|
1338
|
-
label: "Numbers"
|
|
1339
|
-
},
|
|
1340
|
-
{
|
|
1341
|
-
value: "none",
|
|
1342
|
-
label: "None"
|
|
1343
|
-
}
|
|
1344
|
-
], "icons"),
|
|
1345
|
-
blockKinds: cardListFamilyBlocks
|
|
1346
|
-
},
|
|
1347
|
-
fixedKnob("block.event-calendar", "showCapacity", "Show places left", onOff, "true", false, true)
|
|
1348
|
-
];
|
|
1349
|
-
systemCustomizeFacetDefinitions.map((definition) => definition.id);
|
|
1350
|
-
Array.from(new Set(systemCustomizeFacetDefinitions.flatMap((definition) => definition.values.map((option) => option.value))));
|
|
1351
|
-
function systemCustomizeFacetDefinitionsForBlock(blockKind) {
|
|
1352
|
-
return systemCustomizeFacetDefinitions.filter((definition) => definition.blockKind === blockKind || "blockKinds" in definition && definition.blockKinds?.some((kind) => kind === blockKind));
|
|
1203
|
+
sources.push({
|
|
1204
|
+
kind: "content-field",
|
|
1205
|
+
displayPath: `content.${field.id}`,
|
|
1206
|
+
fieldPath: field.id,
|
|
1207
|
+
fieldType
|
|
1208
|
+
});
|
|
1209
|
+
if (field.id === "excerpt" && fieldType === "text" && typeof entry.excerpt === "string" && typeof content.excerpt === "string" && entry.excerpt === content.excerpt) sources.push({
|
|
1210
|
+
kind: "content-field",
|
|
1211
|
+
displayPath: "excerpt",
|
|
1212
|
+
fieldPath: "excerpt",
|
|
1213
|
+
fieldType
|
|
1214
|
+
});
|
|
1215
|
+
if (field.id === contentType.titleField && fieldType === "text" && typeof entry.title === "string" && typeof content[field.id] === "string" && entry.title === content[field.id]) sources.push({
|
|
1216
|
+
kind: "content-field",
|
|
1217
|
+
displayPath: "title",
|
|
1218
|
+
fieldPath: field.id,
|
|
1219
|
+
fieldType
|
|
1220
|
+
});
|
|
1221
|
+
}
|
|
1222
|
+
for (const displayPath of [
|
|
1223
|
+
"title",
|
|
1224
|
+
"slug",
|
|
1225
|
+
"path",
|
|
1226
|
+
"publishedAt",
|
|
1227
|
+
"status",
|
|
1228
|
+
"image"
|
|
1229
|
+
]) if (displayPath in entry && !sources.some((source) => source.displayPath === displayPath)) sources.push({
|
|
1230
|
+
kind: "read-only",
|
|
1231
|
+
displayPath,
|
|
1232
|
+
reason: displayPath === "image" ? "derived-field" : "route-field"
|
|
1233
|
+
});
|
|
1234
|
+
return sources;
|
|
1353
1235
|
}
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
function
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
})
|
|
1236
|
+
function resolveLinkedEntryFieldSource(meta, displayPath) {
|
|
1237
|
+
return meta.fieldSources.find((candidate) => candidate.displayPath === displayPath) ?? null;
|
|
1238
|
+
}
|
|
1239
|
+
function resolvePreviewLinkedEntryInlineFieldType(fieldType) {
|
|
1240
|
+
if (fieldType === "richText") return "richText";
|
|
1241
|
+
if (fieldType === "text" || fieldType === "textarea") return "text";
|
|
1242
|
+
return null;
|
|
1243
|
+
}
|
|
1244
|
+
function resolveLinkedContentEditSupport(contentType) {
|
|
1245
|
+
if (contentType.fields.length === 0) return {
|
|
1246
|
+
kind: "unsupported-missing-schema",
|
|
1247
|
+
reason: "Content type has no public field metadata."
|
|
1248
|
+
};
|
|
1249
|
+
const metadata = contentType.previewLinkedEntryEditing;
|
|
1250
|
+
if (!metadata) return {
|
|
1251
|
+
kind: "unsupported-content-type",
|
|
1252
|
+
reason: "Content type has not enabled linked-entry preview editing."
|
|
1372
1253
|
};
|
|
1254
|
+
switch (metadata.kind) {
|
|
1255
|
+
case "generic": return { kind: "supported" };
|
|
1256
|
+
case "unsupported-domain-backed": return {
|
|
1257
|
+
kind: "unsupported-domain-backed",
|
|
1258
|
+
reason: metadata.reason
|
|
1259
|
+
};
|
|
1260
|
+
default: return assertNever(metadata);
|
|
1261
|
+
}
|
|
1373
1262
|
}
|
|
1374
|
-
function
|
|
1375
|
-
return
|
|
1376
|
-
if (facet.knob === void 0 || facet.target.kind !== "content-field") return [];
|
|
1377
|
-
const id = facet.target.field;
|
|
1378
|
-
return [{
|
|
1379
|
-
definition: {
|
|
1380
|
-
id,
|
|
1381
|
-
defaultValue: (look.look.structure.knobDefaults ?? {})[id] ?? facet.defaultValue,
|
|
1382
|
-
values: facet.values.map((value) => value.value),
|
|
1383
|
-
...knobKindMetadata(facet.knob)
|
|
1384
|
-
},
|
|
1385
|
-
exposed: exposedKnobIds(look).includes(id),
|
|
1386
|
-
forced: look.look.structure.forcedKnobs?.[id],
|
|
1387
|
-
lookValues: look.look.structure.knobValues?.[id],
|
|
1388
|
-
styleValues: look.knobValues[id],
|
|
1389
|
-
lengthValues: id === "titleSize" ? headlineAllowedValues(length) : void 0
|
|
1390
|
-
}];
|
|
1391
|
-
});
|
|
1263
|
+
function contentTypeKeyToLabel(key) {
|
|
1264
|
+
return (key.endsWith("ies") ? `${key.slice(0, -3)}y` : key.endsWith("s") ? key.slice(0, -1) : key).split(/[-_\s]+/).filter((part) => part.length > 0).map((part, index) => index === 0 ? capitalize(part) : part.toLowerCase()).join(" ");
|
|
1392
1265
|
}
|
|
1393
|
-
function
|
|
1394
|
-
return
|
|
1395
|
-
|
|
1396
|
-
|
|
1266
|
+
function capitalize(value) {
|
|
1267
|
+
return value.charAt(0).toUpperCase() + value.slice(1).toLowerCase();
|
|
1268
|
+
}
|
|
1269
|
+
function parsePublicContentTypeMeta(value) {
|
|
1270
|
+
if (!isRecord$1(value)) return null;
|
|
1271
|
+
if (typeof value.key !== "string" || value.key.trim().length === 0) return null;
|
|
1272
|
+
return {
|
|
1273
|
+
key: value.key,
|
|
1274
|
+
titleField: typeof value.titleField === "string" ? value.titleField : null,
|
|
1275
|
+
fields: Array.isArray(value.fields) ? value.fields.flatMap(parsePublicContentTypeFieldMeta) : [],
|
|
1276
|
+
previewLinkedEntryEditing: parsePublicContentTypeLinkedEntryEditing(value.previewLinkedEntryEditing)
|
|
1397
1277
|
};
|
|
1398
1278
|
}
|
|
1399
|
-
function
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
case "
|
|
1403
|
-
case "
|
|
1404
|
-
"
|
|
1405
|
-
"
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
case null: return;
|
|
1279
|
+
function parsePublicContentTypeLinkedEntryEditing(value) {
|
|
1280
|
+
if (!isRecord$1(value) || typeof value.kind !== "string") return null;
|
|
1281
|
+
switch (value.kind) {
|
|
1282
|
+
case "generic": return { kind: "generic" };
|
|
1283
|
+
case "unsupported-domain-backed": return {
|
|
1284
|
+
kind: "unsupported-domain-backed",
|
|
1285
|
+
reason: typeof value.reason === "string" ? value.reason : "Domain-backed entries need a dedicated editor workflow."
|
|
1286
|
+
};
|
|
1287
|
+
default: return null;
|
|
1409
1288
|
}
|
|
1410
1289
|
}
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1290
|
+
function parsePublicContentTypeFieldMeta(value) {
|
|
1291
|
+
if (!isRecord$1(value)) return [];
|
|
1292
|
+
if (typeof value.id !== "string" || typeof value.type !== "string") return [];
|
|
1293
|
+
return [{
|
|
1294
|
+
id: value.id,
|
|
1295
|
+
type: value.type,
|
|
1296
|
+
mediaKinds: parseStringArray(value.mediaKinds),
|
|
1297
|
+
fileKinds: parseStringArray(value.fileKinds)
|
|
1298
|
+
}];
|
|
1299
|
+
}
|
|
1300
|
+
function parseStringArray(value) {
|
|
1301
|
+
if (value === null || typeof value === "undefined") return null;
|
|
1302
|
+
if (!Array.isArray(value)) return null;
|
|
1303
|
+
return value.filter((item) => typeof item === "string");
|
|
1304
|
+
}
|
|
1305
|
+
function isLinkedContentEntryMeta(value) {
|
|
1306
|
+
if (!isRecord$1(value)) return false;
|
|
1307
|
+
if (value.kind !== "linked-content-entry") return false;
|
|
1308
|
+
if (typeof value.entryId !== "string") return false;
|
|
1309
|
+
if (typeof value.contentTypeKey !== "string") return false;
|
|
1310
|
+
if (typeof value.contentTypeLabel !== "string") return false;
|
|
1311
|
+
if (typeof value.title !== "string") return false;
|
|
1312
|
+
if (!(value.optimisticHash === null || typeof value.optimisticHash === "string")) return false;
|
|
1313
|
+
if (!isRecord$1(value.contentType)) return false;
|
|
1314
|
+
if (!isLinkedEntryFieldSourceArray(value.fieldSources)) return false;
|
|
1315
|
+
return isLinkedContentEditSupport(value.support);
|
|
1316
|
+
}
|
|
1317
|
+
function isLinkedEntryFieldSourceArray(value) {
|
|
1318
|
+
return Array.isArray(value) && value.every(isLinkedEntryFieldSource);
|
|
1319
|
+
}
|
|
1320
|
+
function isLinkedEntryFieldSource(value) {
|
|
1321
|
+
if (!isRecord$1(value)) return false;
|
|
1322
|
+
if (typeof value.displayPath !== "string") return false;
|
|
1323
|
+
switch (value.kind) {
|
|
1324
|
+
case "content-field": return typeof value.fieldPath === "string" && (value.fieldType === "text" || value.fieldType === "richText");
|
|
1325
|
+
case "read-only": return isLinkedEntryInlineFieldReadOnlyReason(value.reason);
|
|
1326
|
+
default: return false;
|
|
1423
1327
|
}
|
|
1424
1328
|
}
|
|
1425
|
-
function
|
|
1426
|
-
|
|
1329
|
+
function isLinkedEntryInlineFieldReadOnlyReason(value) {
|
|
1330
|
+
switch (value) {
|
|
1331
|
+
case "missing-entry-meta":
|
|
1332
|
+
case "unsupported-content-type":
|
|
1333
|
+
case "missing-field-schema":
|
|
1334
|
+
case "unsupported-field-type":
|
|
1335
|
+
case "unmapped-display-path":
|
|
1336
|
+
case "route-field":
|
|
1337
|
+
case "derived-field": return true;
|
|
1338
|
+
default: return false;
|
|
1339
|
+
}
|
|
1340
|
+
}
|
|
1341
|
+
function isLinkedContentEditSupport(value) {
|
|
1342
|
+
if (!isRecord$1(value) || typeof value.kind !== "string") return false;
|
|
1343
|
+
switch (value.kind) {
|
|
1344
|
+
case "supported": return true;
|
|
1345
|
+
case "unsupported-domain-backed":
|
|
1346
|
+
case "unsupported-content-type":
|
|
1347
|
+
case "unsupported-missing-schema": return typeof value.reason === "string";
|
|
1348
|
+
default: return false;
|
|
1349
|
+
}
|
|
1350
|
+
}
|
|
1351
|
+
function isRecord$1(value) {
|
|
1352
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
1427
1353
|
}
|
|
1428
1354
|
//#endregion
|
|
1429
1355
|
//#region ../blocks/src/sdkBlockTransform.ts
|
|
@@ -1452,7 +1378,8 @@ function transformSdkBlockToManifest(sdkBlock) {
|
|
|
1452
1378
|
variants: sdkBlock.variants,
|
|
1453
1379
|
defaultVariant: sdkBlock.defaultVariant,
|
|
1454
1380
|
variantOptions: sdkBlock.variantOptions,
|
|
1455
|
-
|
|
1381
|
+
promotedFields: sdkBlock.promotedFields,
|
|
1382
|
+
lookField: sdkBlock.lookField,
|
|
1456
1383
|
behaviours: {
|
|
1457
1384
|
supportsThemeSwitching: true,
|
|
1458
1385
|
inlineEditing: hasLayout,
|
|
@@ -1527,30 +1454,122 @@ function planCustomBlockRegistryResolution({ sdkConfig, customBlocks = [], polic
|
|
|
1527
1454
|
}
|
|
1528
1455
|
}
|
|
1529
1456
|
}
|
|
1530
|
-
function createCustomBlockRegistry({ sdkConfig, customBlocks = [], policy = defaultCustomBlockSourcePolicy, onConflict }) {
|
|
1531
|
-
const plan = planCustomBlockRegistryResolution({
|
|
1532
|
-
sdkConfig,
|
|
1533
|
-
customBlocks,
|
|
1534
|
-
policy
|
|
1457
|
+
function createCustomBlockRegistry({ sdkConfig, customBlocks = [], policy = defaultCustomBlockSourcePolicy, onConflict }) {
|
|
1458
|
+
const plan = planCustomBlockRegistryResolution({
|
|
1459
|
+
sdkConfig,
|
|
1460
|
+
customBlocks,
|
|
1461
|
+
policy
|
|
1462
|
+
});
|
|
1463
|
+
const entriesByKind = new Map(plan.entries.map((entry) => [entry.blockKind, entry]));
|
|
1464
|
+
for (const conflict of plan.conflicts) onConflict?.(`Using ${sourceLabel(conflict.winner)} custom block "${conflict.blockKind}" - ${sourceLabel(conflict.loser)} block is fallback only`);
|
|
1465
|
+
return {
|
|
1466
|
+
entries: plan.entries,
|
|
1467
|
+
conflicts: plan.conflicts,
|
|
1468
|
+
findManifest: (blockKind) => {
|
|
1469
|
+
if (!isCustomBlockKind(blockKind)) return void 0;
|
|
1470
|
+
return entriesByKind.get(blockKind);
|
|
1471
|
+
}
|
|
1472
|
+
};
|
|
1473
|
+
}
|
|
1474
|
+
function sourceLabel(source) {
|
|
1475
|
+
switch (source.kind) {
|
|
1476
|
+
case "managed-database": return "DB";
|
|
1477
|
+
case "sdk-synced": return "SDK-synced DB";
|
|
1478
|
+
case "sdk-config": return "SDK config";
|
|
1479
|
+
default: return assertNever(source);
|
|
1480
|
+
}
|
|
1481
|
+
}
|
|
1482
|
+
//#endregion
|
|
1483
|
+
//#region ../blocks/src/pageRenderJoins.ts
|
|
1484
|
+
/**
|
|
1485
|
+
* Re-points joins across omitted blocks. Pure over joins.
|
|
1486
|
+
*
|
|
1487
|
+
* Joins are keyed by adjacent block-id pairs, so dropping B from [A, B, C]
|
|
1488
|
+
* removes the A→C join as well as B's own, because no A→C join was ever
|
|
1489
|
+
* resolved. For each surviving pair the original join is kept when the pair
|
|
1490
|
+
* was already adjacent. Across a gap, the treatment comes from the join
|
|
1491
|
+
* entering the omitted run (A→first omitted), falling back to the one leaving
|
|
1492
|
+
* it (last omitted→C). Nothing visual is carried: the survivors are composed
|
|
1493
|
+
* from their own content afterwards.
|
|
1494
|
+
*
|
|
1495
|
+
* `survivors` are compared by identity against `originalBlocks`.
|
|
1496
|
+
*/
|
|
1497
|
+
function retargetJoinsAcrossOmissions(input) {
|
|
1498
|
+
const { joins, originalBlocks, survivingBlocks } = input;
|
|
1499
|
+
if (joins.length === 0) return joins;
|
|
1500
|
+
if (originalBlocks.every((block) => survivingBlocks.has(block))) return joins;
|
|
1501
|
+
const byPair = joinsByPair(joins);
|
|
1502
|
+
const retargeted = [];
|
|
1503
|
+
let previousSurvivor = null;
|
|
1504
|
+
let run = [];
|
|
1505
|
+
for (const block of originalBlocks) {
|
|
1506
|
+
if (!survivingBlocks.has(block)) {
|
|
1507
|
+
run.push(block);
|
|
1508
|
+
continue;
|
|
1509
|
+
}
|
|
1510
|
+
if (previousSurvivor?.id && block.id) {
|
|
1511
|
+
const join = run.length === 0 ? byPair.get(pairKey(previousSurvivor.id, block.id)) : joinAcrossRun(byPair, previousSurvivor.id, block.id, run);
|
|
1512
|
+
if (join) retargeted.push(join);
|
|
1513
|
+
}
|
|
1514
|
+
previousSurvivor = block;
|
|
1515
|
+
run = [];
|
|
1516
|
+
}
|
|
1517
|
+
return retargeted;
|
|
1518
|
+
}
|
|
1519
|
+
function joinAcrossRun(byPair, previousBlockId, nextBlockId, run) {
|
|
1520
|
+
const firstOmittedId = run[0]?.id;
|
|
1521
|
+
const lastOmittedId = run[run.length - 1]?.id;
|
|
1522
|
+
const entering = firstOmittedId ? byPair.get(pairKey(previousBlockId, firstOmittedId)) : void 0;
|
|
1523
|
+
const exiting = lastOmittedId ? byPair.get(pairKey(lastOmittedId, nextBlockId)) : void 0;
|
|
1524
|
+
const donor = entering ?? exiting;
|
|
1525
|
+
return donor ? {
|
|
1526
|
+
previousBlockId,
|
|
1527
|
+
nextBlockId,
|
|
1528
|
+
treatment: donor.treatment
|
|
1529
|
+
} : void 0;
|
|
1530
|
+
}
|
|
1531
|
+
/**
|
|
1532
|
+
* The single composition site. For every adjacent pair of survivors with ids,
|
|
1533
|
+
* finds its join and composes it from both survivors' final content: what
|
|
1534
|
+
* each paints with and the frame each draws.
|
|
1535
|
+
*/
|
|
1536
|
+
function composePageJoins(input) {
|
|
1537
|
+
const byPair = joinsByPair(input.joins);
|
|
1538
|
+
return input.survivors.flatMap((previous, index) => {
|
|
1539
|
+
const next = input.survivors[index + 1];
|
|
1540
|
+
if (!next || !previous.id || !next.id) return [];
|
|
1541
|
+
const join = byPair.get(pairKey(previous.id, next.id));
|
|
1542
|
+
return [{
|
|
1543
|
+
previousBlockId: previous.id,
|
|
1544
|
+
nextBlockId: next.id,
|
|
1545
|
+
join: join ? composeJoin(join, previous, next) : null
|
|
1546
|
+
}];
|
|
1535
1547
|
});
|
|
1536
|
-
|
|
1537
|
-
|
|
1548
|
+
}
|
|
1549
|
+
function composeJoin(join, previous, next) {
|
|
1538
1550
|
return {
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
}
|
|
1551
|
+
boundaryId: pairKey(join.previousBlockId, join.nextBlockId),
|
|
1552
|
+
previousBlockId: join.previousBlockId,
|
|
1553
|
+
nextBlockId: join.nextBlockId,
|
|
1554
|
+
treatment: join.treatment,
|
|
1555
|
+
outcome: composeBoundary(sectionFactsForContent(previous.content), sectionFactsForContent(next.content))
|
|
1545
1556
|
};
|
|
1546
1557
|
}
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1558
|
+
/** Placement, reserves and paint for a join that draws; null otherwise. */
|
|
1559
|
+
function renderedJoinLayout(join) {
|
|
1560
|
+
if (!join || join.outcome.kind !== "shown") return null;
|
|
1561
|
+
return boundaryLayout(join.treatment, join.outcome.composition);
|
|
1562
|
+
}
|
|
1563
|
+
/** Joins with a missing id on either side cannot sit between two blocks. */
|
|
1564
|
+
function joinsByPair(joins) {
|
|
1565
|
+
return new Map(joins.flatMap((join) => join.previousBlockId && join.nextBlockId ? [[pairKey(join.previousBlockId, join.nextBlockId), join]] : []));
|
|
1566
|
+
}
|
|
1567
|
+
/** Slot lookup key for an adjacent pair, in the one boundary-id scheme. */
|
|
1568
|
+
function joinSlotKey(previousBlockId, nextBlockId) {
|
|
1569
|
+
return pairKey(previousBlockId, nextBlockId);
|
|
1570
|
+
}
|
|
1571
|
+
function pairKey(previousBlockId, nextBlockId) {
|
|
1572
|
+
return makeBoundaryId(asDesignBlockId(previousBlockId), asDesignBlockId(nextBlockId));
|
|
1554
1573
|
}
|
|
1555
1574
|
//#endregion
|
|
1556
1575
|
//#region ../blocks/src/pageRenderPlan.ts
|
|
@@ -1708,8 +1727,7 @@ function getBlockOverride(blockKind, overrides) {
|
|
|
1708
1727
|
* `site-style-transition-*` styleGroup is dropped; authored values survive.
|
|
1709
1728
|
*/
|
|
1710
1729
|
function getRenderableContent(block, previewStage = "published") {
|
|
1711
|
-
|
|
1712
|
-
return isObjectRecord(source) ? stripStaleTransitionStyleGroup(source) : {};
|
|
1730
|
+
return selectBlockContent(block, previewStage);
|
|
1713
1731
|
}
|
|
1714
1732
|
function arrangementRuntime(content) {
|
|
1715
1733
|
const value = content._arrangementLooks;
|
|
@@ -1979,67 +1997,6 @@ function heroPhotoGround(entry) {
|
|
|
1979
1997
|
return entry.kind === "renderable" && entry.block.kind === "block.hero" ? { paintsGround: heroPhotoPaintsGround(entry.effectiveArrangementKey ?? void 0) } : void 0;
|
|
1980
1998
|
}
|
|
1981
1999
|
//#endregion
|
|
1982
|
-
//#region ../theme-core/src/footer/mode.ts
|
|
1983
|
-
const footerModeSchema = z.enum([
|
|
1984
|
-
"default",
|
|
1985
|
-
"blocks",
|
|
1986
|
-
"default+blocks",
|
|
1987
|
-
"none"
|
|
1988
|
-
]);
|
|
1989
|
-
/** Reads only SDK footer intent; unrelated config and theme fields are not authorities. */
|
|
1990
|
-
function resolveSdkFooterMode(config) {
|
|
1991
|
-
const parsed = z.object({ layout: z.object({ footerMode: footerModeSchema.optional() }).optional() }).safeParse(config);
|
|
1992
|
-
return parsed.success ? parsed.data.layout?.footerMode ?? "default" : "default";
|
|
1993
|
-
}
|
|
1994
|
-
z.object({
|
|
1995
|
-
variant: z.enum([
|
|
1996
|
-
"simple",
|
|
1997
|
-
"columns",
|
|
1998
|
-
"split",
|
|
1999
|
-
"centred"
|
|
2000
|
-
]),
|
|
2001
|
-
showLogoText: z.boolean().optional(),
|
|
2002
|
-
logo: z.object({
|
|
2003
|
-
showLogo: z.boolean().optional(),
|
|
2004
|
-
showLogoText: z.boolean().optional()
|
|
2005
|
-
}).optional()
|
|
2006
|
-
});
|
|
2007
|
-
/**
|
|
2008
|
-
* Resolve what to render for the footer given the current mode and whether the
|
|
2009
|
-
* site is SDK-managed.
|
|
2010
|
-
*
|
|
2011
|
-
* Backwards compatible: missing/undefined mode is treated as 'default'.
|
|
2012
|
-
*/
|
|
2013
|
-
function resolveFooterRenderPlan(params) {
|
|
2014
|
-
if (!params.isSdkSite) return {
|
|
2015
|
-
mode: "default",
|
|
2016
|
-
renderDefaultFooter: true,
|
|
2017
|
-
renderFooterBlocks: false
|
|
2018
|
-
};
|
|
2019
|
-
switch (params.mode ?? "default") {
|
|
2020
|
-
case "blocks": return {
|
|
2021
|
-
mode: "blocks",
|
|
2022
|
-
renderDefaultFooter: false,
|
|
2023
|
-
renderFooterBlocks: true
|
|
2024
|
-
};
|
|
2025
|
-
case "default+blocks": return {
|
|
2026
|
-
mode: "default+blocks",
|
|
2027
|
-
renderDefaultFooter: true,
|
|
2028
|
-
renderFooterBlocks: true
|
|
2029
|
-
};
|
|
2030
|
-
case "none": return {
|
|
2031
|
-
mode: "none",
|
|
2032
|
-
renderDefaultFooter: false,
|
|
2033
|
-
renderFooterBlocks: false
|
|
2034
|
-
};
|
|
2035
|
-
default: return {
|
|
2036
|
-
mode: "default",
|
|
2037
|
-
renderDefaultFooter: true,
|
|
2038
|
-
renderFooterBlocks: false
|
|
2039
|
-
};
|
|
2040
|
-
}
|
|
2041
|
-
}
|
|
2042
|
-
//#endregion
|
|
2043
2000
|
//#region ../blocks/src/system/data/utils.ts
|
|
2044
2001
|
/**
|
|
2045
2002
|
* Normalize data loaders from block definition
|
|
@@ -2052,20 +2009,6 @@ function normalizeDataLoaders(def) {
|
|
|
2052
2009
|
}));
|
|
2053
2010
|
}
|
|
2054
2011
|
/**
|
|
2055
|
-
* Normalize block content for data loading.
|
|
2056
|
-
* Priority: draftContent > content > publishedContent
|
|
2057
|
-
*/
|
|
2058
|
-
function normalizeContent(block) {
|
|
2059
|
-
const source = block.draftContent ?? block.content ?? block.publishedContent ?? {};
|
|
2060
|
-
if (!isObjectRecord(source)) return {};
|
|
2061
|
-
if ("data" in source) {
|
|
2062
|
-
const data = source.data;
|
|
2063
|
-
if (isObjectRecord(data)) return data;
|
|
2064
|
-
if (data === null || data === void 0) return {};
|
|
2065
|
-
}
|
|
2066
|
-
return source;
|
|
2067
|
-
}
|
|
2068
|
-
/**
|
|
2069
2012
|
* Normalize params for API calls.
|
|
2070
2013
|
* Converts supplied values to strings, preserving absent versus explicitly empty params.
|
|
2071
2014
|
*/
|
|
@@ -2331,101 +2274,109 @@ function shouldSkipResolvedLoader(input) {
|
|
|
2331
2274
|
if (input.loader.requiredParams?.some((param) => !input.params[param]?.trim())) return true;
|
|
2332
2275
|
return Boolean(input.isValidEndpoint && !input.isValidEndpoint(input.endpoint));
|
|
2333
2276
|
}
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
const { now, dateContext } = admitLoaderDateRuntime(context);
|
|
2360
|
-
const results = {};
|
|
2361
|
-
const loaderFailures = {};
|
|
2362
|
-
const tasks = [];
|
|
2363
|
-
for (const block of page.blocks) {
|
|
2364
|
-
const blockId = block.id;
|
|
2365
|
-
if (!blockId) continue;
|
|
2366
|
-
let loaders;
|
|
2367
|
-
const def = getBlockDefinition$1(block.kind);
|
|
2368
|
-
if (def) loaders = normalizeDataLoaders(def);
|
|
2369
|
-
else if (getCustomBlockLoaders) {
|
|
2370
|
-
const customLoaders = getCustomBlockLoaders(block.kind);
|
|
2371
|
-
loaders = customLoaders ? Object.entries(customLoaders).map(([key, loader]) => ({
|
|
2372
|
-
key,
|
|
2373
|
-
loader
|
|
2374
|
-
})) : [];
|
|
2375
|
-
} else loaders = [];
|
|
2376
|
-
loaders = projectDataLoaders(loaders, shouldLoad, blockId, block.kind);
|
|
2377
|
-
if (loaders.length === 0) continue;
|
|
2378
|
-
const root = {
|
|
2379
|
-
...context.root ?? {},
|
|
2277
|
+
async function prefetchBlockDataWithFailures$1(page, context, options) {
|
|
2278
|
+
const runtime = admitLoaderDateRuntime(context);
|
|
2279
|
+
const blocks = page.blocks.flatMap((block) => block.id ? [planBlockRequests(block, block.id, context, options, runtime)] : []);
|
|
2280
|
+
return {
|
|
2281
|
+
...projectLoaderOutcomes(blocks, await Promise.all(blocks.flatMap((block) => block.requests.map((request) => executeLoaderRequest(request, options))))),
|
|
2282
|
+
loaderSnapshot: {
|
|
2283
|
+
stage: context.previewStage === "preview" ? "draft" : "published",
|
|
2284
|
+
blocks: Object.fromEntries(blocks.map((block) => [block.id, {
|
|
2285
|
+
kind: block.kind,
|
|
2286
|
+
content: block.content,
|
|
2287
|
+
requests: Object.fromEntries(block.requests.map(({ key, endpoint, params }) => [key, {
|
|
2288
|
+
endpoint,
|
|
2289
|
+
params
|
|
2290
|
+
}]))
|
|
2291
|
+
}]))
|
|
2292
|
+
}
|
|
2293
|
+
};
|
|
2294
|
+
}
|
|
2295
|
+
function planBlockRequests(block, id, context, options, runtime) {
|
|
2296
|
+
const definition = (options.getBlockDefinition ?? getBlockDefinition)(block.kind);
|
|
2297
|
+
const loaders = definition ? normalizeDataLoaders(definition) : customLoaders(block.kind, options);
|
|
2298
|
+
const vm = {
|
|
2299
|
+
content: plannedLoaderContent(block, definition, context),
|
|
2300
|
+
$root: {
|
|
2301
|
+
...context.root,
|
|
2380
2302
|
siteId: context.siteId,
|
|
2381
2303
|
pageId: context.pageId,
|
|
2382
2304
|
previewStage: context.previewStage
|
|
2305
|
+
}
|
|
2306
|
+
};
|
|
2307
|
+
const requests = projectDataLoaders(loaders, options.shouldLoad, id, block.kind).flatMap((entry) => {
|
|
2308
|
+
const request = planLoaderRequest(entry, block, id, vm, options, runtime);
|
|
2309
|
+
return request ? [request] : [];
|
|
2310
|
+
});
|
|
2311
|
+
return {
|
|
2312
|
+
id,
|
|
2313
|
+
kind: block.kind,
|
|
2314
|
+
content: selectBlockContent(block, context.previewStage),
|
|
2315
|
+
requests
|
|
2316
|
+
};
|
|
2317
|
+
}
|
|
2318
|
+
function customLoaders(kind, options) {
|
|
2319
|
+
return Object.entries(options.getCustomBlockLoaders?.(kind) ?? {}).map(([key, loader]) => ({
|
|
2320
|
+
key,
|
|
2321
|
+
loader
|
|
2322
|
+
}));
|
|
2323
|
+
}
|
|
2324
|
+
function planLoaderRequest({ key, loader }, block, blockId, vm, options, runtime) {
|
|
2325
|
+
if (loader.mode === "client") return null;
|
|
2326
|
+
const resolve = options.resolveParamsBindings ?? resolveParamsBindings;
|
|
2327
|
+
const coordinates = { blockKind: block.kind };
|
|
2328
|
+
if (loader.when !== void 0 && resolve(loader.when, vm, coordinates, runtime.dateContext, runtime.now) !== true) return null;
|
|
2329
|
+
const params = normalizeParams(resolve(loader.params, vm, coordinates, runtime.dateContext, runtime.now));
|
|
2330
|
+
if (shouldSkipResolvedLoader({
|
|
2331
|
+
loader,
|
|
2332
|
+
endpoint: loader.endpoint,
|
|
2333
|
+
params,
|
|
2334
|
+
isValidEndpoint: options.isValidEndpoint
|
|
2335
|
+
})) return null;
|
|
2336
|
+
return {
|
|
2337
|
+
blockId,
|
|
2338
|
+
blockKind: block.kind,
|
|
2339
|
+
key,
|
|
2340
|
+
endpoint: loader.endpoint,
|
|
2341
|
+
params
|
|
2342
|
+
};
|
|
2343
|
+
}
|
|
2344
|
+
async function executeLoaderRequest(request, options) {
|
|
2345
|
+
try {
|
|
2346
|
+
return {
|
|
2347
|
+
kind: "loaded",
|
|
2348
|
+
request,
|
|
2349
|
+
data: await fetchLoaderData(options.apiClient, request.endpoint, request.params)
|
|
2383
2350
|
};
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2351
|
+
} catch (error) {
|
|
2352
|
+
options.onError?.(error, {
|
|
2353
|
+
block: request.blockKind,
|
|
2354
|
+
loader: request.key
|
|
2355
|
+
});
|
|
2356
|
+
return {
|
|
2357
|
+
kind: "failed",
|
|
2358
|
+
request
|
|
2387
2359
|
};
|
|
2388
|
-
for (const { key, loader } of loaders) {
|
|
2389
|
-
if (loader.mode === "client") continue;
|
|
2390
|
-
if (typeof loader.when !== "undefined") {
|
|
2391
|
-
if (resolveParamsBindings$1(loader.when, vm, { blockKind: block.kind }, dateContext, now) !== true) continue;
|
|
2392
|
-
}
|
|
2393
|
-
const params = normalizeParams(resolveParamsBindings$1(loader.params, vm, { blockKind: block.kind }, dateContext, now));
|
|
2394
|
-
const endpoint = loader.endpoint;
|
|
2395
|
-
if (shouldSkipResolvedLoader({
|
|
2396
|
-
loader,
|
|
2397
|
-
endpoint,
|
|
2398
|
-
params,
|
|
2399
|
-
isValidEndpoint
|
|
2400
|
-
})) continue;
|
|
2401
|
-
tasks.push((async () => {
|
|
2402
|
-
try {
|
|
2403
|
-
const data = await fetchLoaderData(apiClient, endpoint, params);
|
|
2404
|
-
const blockResults = results[blockId] ?? (results[blockId] = {});
|
|
2405
|
-
blockResults[key] = data;
|
|
2406
|
-
} catch (error) {
|
|
2407
|
-
const blockFailures = loaderFailures[blockId] ?? (loaderFailures[blockId] = {});
|
|
2408
|
-
blockFailures[key] = {
|
|
2409
|
-
endpoint,
|
|
2410
|
-
params
|
|
2411
|
-
};
|
|
2412
|
-
if (onError) onError(error, {
|
|
2413
|
-
block: block.kind,
|
|
2414
|
-
loader: key
|
|
2415
|
-
});
|
|
2416
|
-
}
|
|
2417
|
-
})());
|
|
2418
|
-
}
|
|
2419
2360
|
}
|
|
2420
|
-
|
|
2361
|
+
}
|
|
2362
|
+
function projectLoaderOutcomes(blocks, outcomes) {
|
|
2421
2363
|
return {
|
|
2422
|
-
resolvedData:
|
|
2423
|
-
|
|
2364
|
+
resolvedData: Object.fromEntries(blocks.flatMap((block) => {
|
|
2365
|
+
const values = outcomes.flatMap((outcome) => outcome.request.blockId === block.id && outcome.kind === "loaded" ? [[outcome.request.key, outcome.data]] : []);
|
|
2366
|
+
return values.length ? [[block.id, Object.fromEntries(values)]] : [];
|
|
2367
|
+
})),
|
|
2368
|
+
loaderFailures: Object.fromEntries(blocks.flatMap((block) => {
|
|
2369
|
+
const values = outcomes.flatMap((outcome) => outcome.request.blockId === block.id && outcome.kind === "failed" ? [[outcome.request.key, {
|
|
2370
|
+
endpoint: outcome.request.endpoint,
|
|
2371
|
+
params: outcome.request.params
|
|
2372
|
+
}]] : []);
|
|
2373
|
+
return values.length ? [[block.id, Object.fromEntries(values)]] : [];
|
|
2374
|
+
}))
|
|
2424
2375
|
};
|
|
2425
2376
|
}
|
|
2426
2377
|
/** Prefetch executes the render-plan content stage before resolving loader bindings. */
|
|
2427
2378
|
function plannedLoaderContent(block, definition, context) {
|
|
2428
|
-
const content =
|
|
2379
|
+
const content = selectBlockContent(block, context.previewStage);
|
|
2429
2380
|
if (!definition || content._arrangementLooks === void 0) return content;
|
|
2430
2381
|
return planArrangementContent(block.kind, definition.manifest, content, context.previewStage === "preview" ? "authoring" : "public");
|
|
2431
2382
|
}
|
|
@@ -2502,6 +2453,67 @@ function normalizeLoaderParams(endpoint, params, context) {
|
|
|
2502
2453
|
ensureSiteId(out, context);
|
|
2503
2454
|
return out;
|
|
2504
2455
|
}
|
|
2456
|
+
//#endregion
|
|
2457
|
+
//#region ../theme-core/src/footer/mode.ts
|
|
2458
|
+
const footerModeSchema = z.enum([
|
|
2459
|
+
"default",
|
|
2460
|
+
"blocks",
|
|
2461
|
+
"default+blocks",
|
|
2462
|
+
"none"
|
|
2463
|
+
]);
|
|
2464
|
+
/** Reads only SDK footer intent; unrelated config and theme fields are not authorities. */
|
|
2465
|
+
function resolveSdkFooterMode(config) {
|
|
2466
|
+
const parsed = z.object({ layout: z.object({ footerMode: footerModeSchema.optional() }).optional() }).safeParse(config);
|
|
2467
|
+
return parsed.success ? parsed.data.layout?.footerMode ?? "default" : "default";
|
|
2468
|
+
}
|
|
2469
|
+
z.object({
|
|
2470
|
+
variant: z.enum([
|
|
2471
|
+
"simple",
|
|
2472
|
+
"columns",
|
|
2473
|
+
"split",
|
|
2474
|
+
"centred"
|
|
2475
|
+
]),
|
|
2476
|
+
showLogoText: z.boolean().optional(),
|
|
2477
|
+
logo: z.object({
|
|
2478
|
+
showLogo: z.boolean().optional(),
|
|
2479
|
+
showLogoText: z.boolean().optional()
|
|
2480
|
+
}).optional()
|
|
2481
|
+
});
|
|
2482
|
+
/**
|
|
2483
|
+
* Resolve what to render for the footer given the current mode and whether the
|
|
2484
|
+
* site is SDK-managed.
|
|
2485
|
+
*
|
|
2486
|
+
* Backwards compatible: missing/undefined mode is treated as 'default'.
|
|
2487
|
+
*/
|
|
2488
|
+
function resolveFooterRenderPlan(params) {
|
|
2489
|
+
if (!params.isSdkSite) return {
|
|
2490
|
+
mode: "default",
|
|
2491
|
+
renderDefaultFooter: true,
|
|
2492
|
+
renderFooterBlocks: false
|
|
2493
|
+
};
|
|
2494
|
+
switch (params.mode ?? "default") {
|
|
2495
|
+
case "blocks": return {
|
|
2496
|
+
mode: "blocks",
|
|
2497
|
+
renderDefaultFooter: false,
|
|
2498
|
+
renderFooterBlocks: true
|
|
2499
|
+
};
|
|
2500
|
+
case "default+blocks": return {
|
|
2501
|
+
mode: "default+blocks",
|
|
2502
|
+
renderDefaultFooter: true,
|
|
2503
|
+
renderFooterBlocks: true
|
|
2504
|
+
};
|
|
2505
|
+
case "none": return {
|
|
2506
|
+
mode: "none",
|
|
2507
|
+
renderDefaultFooter: false,
|
|
2508
|
+
renderFooterBlocks: false
|
|
2509
|
+
};
|
|
2510
|
+
default: return {
|
|
2511
|
+
mode: "default",
|
|
2512
|
+
renderDefaultFooter: true,
|
|
2513
|
+
renderFooterBlocks: false
|
|
2514
|
+
};
|
|
2515
|
+
}
|
|
2516
|
+
}
|
|
2505
2517
|
z.object({ refreshToken: z.string().min(1).max(4096) }).strict();
|
|
2506
2518
|
z.object({
|
|
2507
2519
|
accessToken: z.string().min(1).max(4096),
|
|
@@ -2760,48 +2772,13 @@ const sdkCustomBlockInputSchema = z.object({
|
|
|
2760
2772
|
fields: fieldDefinitionInputSchema.array().min(1),
|
|
2761
2773
|
dataLoaders: sdkDataLoadersSchema,
|
|
2762
2774
|
layout: NodeSchema.optional(),
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
previewCustomize: previewCustomizeManifestCurationSchema.optional()
|
|
2771
|
-
}).superRefine((data, ctx) => {
|
|
2772
|
-
if (data.titleSource) (Array.isArray(data.titleSource) ? data.titleSource : [data.titleSource]).forEach((source, index) => {
|
|
2773
|
-
if (!data.fields.some((field) => field.id === source)) ctx.addIssue({
|
|
2774
|
-
code: z.ZodIssueCode.custom,
|
|
2775
|
-
message: `titleSource must reference a valid field ID (got "${source}")`,
|
|
2776
|
-
path: Array.isArray(data.titleSource) ? ["titleSource", index] : ["titleSource"]
|
|
2777
|
-
});
|
|
2778
|
-
});
|
|
2779
|
-
if (data.layout && data.variants) ctx.addIssue({
|
|
2780
|
-
code: z.ZodIssueCode.custom,
|
|
2781
|
-
message: "Custom block must define either `layout` or `variants`, not both",
|
|
2782
|
-
path: ["variants"]
|
|
2783
|
-
});
|
|
2784
|
-
if (data.variants) {
|
|
2785
|
-
if (Object.keys(data.variants).length === 0) ctx.addIssue({
|
|
2786
|
-
code: z.ZodIssueCode.custom,
|
|
2787
|
-
message: "`variants` must contain at least one variant key",
|
|
2788
|
-
path: ["variants"]
|
|
2789
|
-
});
|
|
2790
|
-
if (data.defaultVariant && !Object.prototype.hasOwnProperty.call(data.variants, data.defaultVariant)) ctx.addIssue({
|
|
2791
|
-
code: z.ZodIssueCode.custom,
|
|
2792
|
-
message: "`defaultVariant` must be a key present in `variants`",
|
|
2793
|
-
path: ["defaultVariant"]
|
|
2794
|
-
});
|
|
2795
|
-
if (data.variantOptions) {
|
|
2796
|
-
for (const key of Object.keys(data.variantOptions)) if (!Object.prototype.hasOwnProperty.call(data.variants, key)) ctx.addIssue({
|
|
2797
|
-
code: z.ZodIssueCode.custom,
|
|
2798
|
-
message: "`variantOptions` key must exist in `variants`",
|
|
2799
|
-
path: ["variantOptions", key]
|
|
2800
|
-
});
|
|
2801
|
-
}
|
|
2802
|
-
}
|
|
2803
|
-
});
|
|
2804
|
-
const sdkBlockFieldExtensionInputSchema = z.object({ fields: fieldDefinitionInputSchema.array().min(1) });
|
|
2775
|
+
...sdkBlockPresentationShape,
|
|
2776
|
+
...blockSectionDeclarationShape
|
|
2777
|
+
}).superRefine(validateManifestLookField).superRefine(validateSdkBlockDeclaration);
|
|
2778
|
+
const sdkBlockFieldExtensionInputSchema = z.object({
|
|
2779
|
+
fields: fieldDefinitionInputSchema.array().min(1),
|
|
2780
|
+
...blockSectionDeclarationShape
|
|
2781
|
+
}).superRefine(validateManifestLookField);
|
|
2805
2782
|
const sdkBlockFieldExtensionsInputSchema = z.record(z.string().min(1), sdkBlockFieldExtensionInputSchema);
|
|
2806
2783
|
const sdkThemePaletteSchema = z.record(z.string(), z.string());
|
|
2807
2784
|
const sdkThemeConfigSchema = z.object({ palette: sdkThemePaletteSchema });
|
|
@@ -2906,6 +2883,7 @@ const sdkWorkflowsSchema = z.array(sdkWorkflowConfigSchema).max(50, "Maximum 50
|
|
|
2906
2883
|
}, { message: "Workflow IDs must be unique" }).optional();
|
|
2907
2884
|
const riverbankSiteConfigInputSchema = z.object({
|
|
2908
2885
|
siteId: z.string().uuid(),
|
|
2886
|
+
builtInBlocks: builtInBlockKindsSchema.optional(),
|
|
2909
2887
|
previewUrl: z.string().url().optional(),
|
|
2910
2888
|
liveUrl: z.string().url().optional(),
|
|
2911
2889
|
theme: sdkThemeConfigSchema.optional(),
|
|
@@ -3652,6 +3630,11 @@ function isNavigationMenuValidationItem(value) {
|
|
|
3652
3630
|
}
|
|
3653
3631
|
//#endregion
|
|
3654
3632
|
//#region ../api/src/aiPlayground.ts
|
|
3633
|
+
const PreparedPagePreconditionSchema = z.object({
|
|
3634
|
+
schemaVersion: z.literal(1),
|
|
3635
|
+
pageId: z.string().uuid(),
|
|
3636
|
+
fingerprint: z.string().regex(/^[a-f0-9]{64}$/)
|
|
3637
|
+
}).strict();
|
|
3655
3638
|
/**
|
|
3656
3639
|
* RFC-6902 JSON Patch Operations
|
|
3657
3640
|
* Standard JSON Patch format for AI Playground content updates
|
|
@@ -3701,7 +3684,7 @@ const Rfc6902PatchOp = z.discriminatedUnion("op", [
|
|
|
3701
3684
|
})
|
|
3702
3685
|
]);
|
|
3703
3686
|
z.object({ request: z.string().min(1).max(2e3) });
|
|
3704
|
-
const
|
|
3687
|
+
const ModelMultiPagePatchEnvelope = z.object({
|
|
3705
3688
|
pageId: z.string(),
|
|
3706
3689
|
blockId: z.string().optional(),
|
|
3707
3690
|
blockKind: z.string().optional(),
|
|
@@ -3710,12 +3693,15 @@ const MultiPagePatchEnvelope = z.object({
|
|
|
3710
3693
|
rationale: z.string(),
|
|
3711
3694
|
currentContent: z.record(z.string(), z.unknown()).optional()
|
|
3712
3695
|
});
|
|
3713
|
-
z.object({
|
|
3714
|
-
patches: z.array(
|
|
3696
|
+
const ModelMultiPageUpdateResponse = z.object({
|
|
3697
|
+
patches: z.array(ModelMultiPagePatchEnvelope),
|
|
3715
3698
|
assistantMessage: z.string(),
|
|
3716
3699
|
pagesModified: z.number(),
|
|
3717
3700
|
toolCallsUsed: z.number()
|
|
3718
3701
|
});
|
|
3702
|
+
/** Server-stamped wire proposals always carry their original page evidence. */
|
|
3703
|
+
const MultiPagePatchEnvelope = ModelMultiPagePatchEnvelope.extend({ preparedAgainst: PreparedPagePreconditionSchema });
|
|
3704
|
+
ModelMultiPageUpdateResponse.extend({ patches: z.array(MultiPagePatchEnvelope) });
|
|
3719
3705
|
//#endregion
|
|
3720
3706
|
//#region ../api/src/siteTerms.ts
|
|
3721
3707
|
const versionIdSchema = z.string().uuid().transform((value, ctx) => {
|
|
@@ -3798,10 +3784,6 @@ const SUPPORTED_LOADER_ENDPOINTS = SUPPORTED_LOADER_ENDPOINTS$1;
|
|
|
3798
3784
|
function isSupportedLoaderEndpoint(endpoint) {
|
|
3799
3785
|
return SUPPORTED_LOADER_ENDPOINTS.includes(endpoint);
|
|
3800
3786
|
}
|
|
3801
|
-
const defaultPrefetchBlockDataDeps = {
|
|
3802
|
-
prefetchBlockDataCore: prefetchBlockData$1,
|
|
3803
|
-
normalizeLoaderParams
|
|
3804
|
-
};
|
|
3805
3787
|
const ENTRY_REF_KEYS = [
|
|
3806
3788
|
"identifier",
|
|
3807
3789
|
"entryIdentifier",
|
|
@@ -4042,42 +4024,17 @@ async function getPublicWeeklySlotAvailability({ client, params }) {
|
|
|
4042
4024
|
timezone: readStringParam(params, "timezone")
|
|
4043
4025
|
});
|
|
4044
4026
|
}
|
|
4045
|
-
/**
|
|
4046
|
-
|
|
4047
|
-
|
|
4048
|
-
*
|
|
4049
|
-
* Supports both system blocks and SDK custom blocks with data loaders.
|
|
4050
|
-
*
|
|
4051
|
-
* @example
|
|
4052
|
-
* ```typescript
|
|
4053
|
-
* import { createRiverbankClient } from '@riverbankcms/sdk';
|
|
4054
|
-
* import { prefetchBlockData } from './prefetchBlockData'; // Internal renderer helper
|
|
4055
|
-
*
|
|
4056
|
-
* const client = createRiverbankClient({ apiKey, baseUrl });
|
|
4057
|
-
* const page = await client.getPage({ siteId, path: '/' });
|
|
4058
|
-
*
|
|
4059
|
-
* // Basic usage (system blocks only)
|
|
4060
|
-
* const blockData = await prefetchBlockData(page.outline, {
|
|
4061
|
-
* siteId: page.siteId,
|
|
4062
|
-
* pageId: page.id,
|
|
4063
|
-
* }, client);
|
|
4064
|
-
*
|
|
4065
|
-
* // With custom blocks from SDK config
|
|
4066
|
-
* const blockData = await prefetchBlockData(page.outline, context, client, {
|
|
4067
|
-
* customBlocks: site.sdkConfig?.customBlocks,
|
|
4068
|
-
* });
|
|
4069
|
-
* ```
|
|
4070
|
-
*/
|
|
4071
|
-
async function prefetchBlockData(page, context, client, options) {
|
|
4072
|
-
return prefetchBlockDataWithDeps(defaultPrefetchBlockDataDeps, page, context, client, options);
|
|
4027
|
+
/** Rendering consumers retain the request identity with the loaded values. */
|
|
4028
|
+
async function prefetchBlockDataWithFailures(page, context, client, options) {
|
|
4029
|
+
return prefetchBlockDataWithFailures$1(page, context, sdkPrefetchOptions(normalizeLoaderParams, context, client, options));
|
|
4073
4030
|
}
|
|
4074
|
-
|
|
4031
|
+
function sdkPrefetchOptions(normalize, context, client, options) {
|
|
4075
4032
|
const { customBlocks } = options ?? {};
|
|
4076
4033
|
const customBlockMap = new Map((customBlocks ?? []).map((block) => [block.id, block]));
|
|
4077
|
-
return
|
|
4034
|
+
return {
|
|
4078
4035
|
apiClient: async ({ endpoint, params }) => {
|
|
4079
4036
|
if (!isSupportedLoaderEndpoint(endpoint)) throw new Error(`Unsupported loader endpoint: ${endpoint}. SDK only supports: ${SUPPORTED_LOADER_ENDPOINTS.join(", ")}`);
|
|
4080
|
-
const resolvedParams =
|
|
4037
|
+
const resolvedParams = normalize(endpoint, params, context);
|
|
4081
4038
|
return materializeLoaderMedia(await loaderAdapters[endpoint]({
|
|
4082
4039
|
client,
|
|
4083
4040
|
params: resolvedParams
|
|
@@ -4091,20 +4048,17 @@ async function prefetchBlockDataWithDeps(deps, page, context, client, options) {
|
|
|
4091
4048
|
error
|
|
4092
4049
|
});
|
|
4093
4050
|
},
|
|
4094
|
-
getCustomBlockLoaders: (
|
|
4095
|
-
|
|
4096
|
-
|
|
4097
|
-
|
|
4098
|
-
|
|
4099
|
-
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
|
|
4103
|
-
|
|
4104
|
-
|
|
4105
|
-
return loaders;
|
|
4106
|
-
}
|
|
4107
|
-
});
|
|
4051
|
+
getCustomBlockLoaders: (kind) => sdkCustomLoaders(customBlockMap.get(kind))
|
|
4052
|
+
};
|
|
4053
|
+
}
|
|
4054
|
+
function sdkCustomLoaders(block) {
|
|
4055
|
+
return block?.dataLoaders ? Object.fromEntries(Object.entries(block.dataLoaders).map(([key, loader]) => [key, {
|
|
4056
|
+
endpoint: loader.endpoint,
|
|
4057
|
+
params: loader.params,
|
|
4058
|
+
requiredParams: loader.requiredParams,
|
|
4059
|
+
mode: loader.mode,
|
|
4060
|
+
when: loader.when
|
|
4061
|
+
}])) : void 0;
|
|
4108
4062
|
}
|
|
4109
4063
|
//#endregion
|
|
4110
|
-
export { resolvePageRouteTarget as C, parseStoredVariant as D,
|
|
4064
|
+
export { resolvePageRouteTarget as C, parseStoredVariant as D, toPresentationPage as E, isCanonicalRichTextDoc as O, resolveEntryRouteTarget as S, toEditorPresentationPage as T, buildLinkedContentEditTarget as _, SDK_WORKFLOW_ENDPOINT_PATTERN as a, defaultTransforms as b, navigationLinkInputSchemaOptions as c, resolveSdkFooterMode as d, buildPageRenderPlan as f, retargetJoinsAcrossOmissions as g, renderedJoinLayout as h, collectPortalLinkStats as i, footerModeSchema as l, joinSlotKey as m, prefetchBlockDataWithFailures as n, SDK_WORKFLOW_ID_PATTERN as o, composePageJoins as p, collectCartLinkStats as r, loaderFallbackScalarSchema as s, SUPPORTED_LOADER_ENDPOINTS as t, resolveFooterRenderPlan as u, resolveLinkedEntryInlineFieldEligibility as v, resolveRouteTarget as w, resolveAuthoredLinkHref as x, builtinTransformDefinitions as y };
|