@riverbankcms/sdk 0.159.0 → 0.161.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (218) hide show
  1. package/README.md +4 -4
  2. package/dist/_dts/{BlocksIslandsHydrator-Cj1i1Yhh.d.ts → BlocksIslandsHydrator-Bx4kLiTA.d.ts} +1 -1
  3. package/dist/_dts/{Page-Cgzbv22M.d.ts → Page-Dm7_P13o.d.ts} +217 -8
  4. package/dist/_dts/{SdkPreviewMode-BC_FGc6b.d.ts → SdkPreviewMode-D7HdWWwF.d.ts} +55 -127
  5. package/dist/_dts/{auth-contract-FPg0-2MC.d.ts → auth-contract-CgJ5nMaH.d.ts} +2 -0
  6. package/dist/_dts/{client-BOK-YHVJ.d.ts → client-Ep0jI9eE.d.ts} +1 -1
  7. package/dist/_dts/{content-types-CsrYWxq_.d.ts → content-types-BgAzCrBc.d.ts} +18 -18
  8. package/dist/_dts/{contracts-ClgMD-9g.d.ts → contracts-DUiOnj9e.d.ts} +10 -6
  9. package/dist/_dts/{footerPageOutline-C_IDuELl.d.ts → footerPageOutline-B-uXamTG.d.ts} +6 -6
  10. package/dist/_dts/{generatePageMetadata-B7bhYSWx.d.ts → generatePageMetadata-BDkZYEcS.d.ts} +2 -2
  11. package/dist/_dts/index-BQDBQvdu.d.ts +13 -0
  12. package/dist/_dts/index-BVkP8f70.d.ts +66 -0
  13. package/dist/_dts/{index-Dt3XSGzY.d.ts → index-CF6Cjs7b.d.ts} +2 -2
  14. package/dist/_dts/{index-Ci1PEk82.d.ts → index-CSsfq6KG.d.ts} +3 -17
  15. package/dist/_dts/{index-BZ4fb2zz.d.ts → index-D_8uz4OP.d.ts} +3 -3
  16. package/dist/_dts/{index-CcaG6O13.d.ts → index-DvKQA6AZ.d.ts} +4 -4
  17. package/dist/_dts/{index-DMOfW1A7.d.ts → index-KPrWM0KF.d.ts} +2 -2
  18. package/dist/_dts/{index-DzUdUaJ-.d.ts → index-ylivB7Jj.d.ts} +2 -2
  19. package/dist/_dts/{loadContent-C1JI2pG0.d.ts → loadContent-DTjKOO-T.d.ts} +19 -10
  20. package/dist/_dts/{resolvePageContent-BtRUtrJa.d.ts → resolvePageContent-C1vA5c5w.d.ts} +2 -2
  21. package/dist/_dts/{constants-DkcKHMX-.d.ts → runtime-BY8DQBbT.d.ts} +10 -16
  22. package/dist/_dts/{hosted-booking-appearance-ChGCQYdQ.d.ts → schema-BHu0PYWl.d.ts} +25911 -23567
  23. package/dist/_dts/sdk/src/bookings/index.d.ts +2 -2
  24. package/dist/_dts/sdk/src/client/types.d.ts +2 -2
  25. package/dist/_dts/sdk/src/client.d.ts +13 -7
  26. package/dist/_dts/sdk/src/config/index.d.ts +6 -6
  27. package/dist/_dts/sdk/src/config/template-validation.d.ts +1 -1
  28. package/dist/_dts/sdk/src/config/validation.d.ts +1 -1
  29. package/dist/_dts/sdk/src/index.d.ts +8 -8
  30. package/dist/_dts/sdk/src/manifest/index.d.ts +6 -6
  31. package/dist/_dts/sdk/src/metadata/index.d.ts +1 -1
  32. package/dist/_dts/sdk/src/navigation/index.d.ts +2 -2
  33. package/dist/_dts/sdk/src/next/index.d.ts +7 -7
  34. package/dist/_dts/sdk/src/next/middleware.d.ts +2 -2
  35. package/dist/_dts/sdk/src/page-converter/index.d.ts +10 -28
  36. package/dist/_dts/sdk/src/portal/client.d.ts +1 -1
  37. package/dist/_dts/sdk/src/prebuild/index.d.ts +1 -1
  38. package/dist/_dts/sdk/src/preview-next/before-render.d.ts +2 -2
  39. package/dist/_dts/sdk/src/preview-next/client/index.d.ts +2 -2
  40. package/dist/_dts/sdk/src/preview-next/client/runtime.d.ts +1 -1
  41. package/dist/_dts/sdk/src/preview-next/keep-alive.d.ts +1 -1
  42. package/dist/_dts/sdk/src/preview-next/session.d.ts +2 -2
  43. package/dist/_dts/sdk/src/rendering/client.d.ts +2 -2
  44. package/dist/_dts/sdk/src/rendering/index.d.ts +6 -6
  45. package/dist/_dts/sdk/src/rendering/islands/client.d.ts +1 -1
  46. package/dist/_dts/sdk/src/rendering/server.d.ts +2 -2
  47. package/dist/_dts/sdk/src/routing/index.d.ts +5 -5
  48. package/dist/_dts/sdk/src/server.d.ts +5 -5
  49. package/dist/_dts/sdk/src/theme/index.d.ts +1 -1
  50. package/dist/_dts/{session-Ba2CsnK5.d.ts → session-C_gtSFyZ.d.ts} +2 -1
  51. package/dist/_dts/{navigation-BnV_hOZy.d.ts → types-BR1Yboa9.d.ts} +15530 -16017
  52. package/dist/_dts/{types-CMFIZGUI.d.ts → types-CJXTCF_F.d.ts} +10 -13
  53. package/dist/_dts/{types-CI9dYWJ8.d.ts → types-D02ngcUH.d.ts} +4 -2
  54. package/dist/_dts/{types--oWXIfyz.d.ts → types-ZGUiHpDE.d.ts} +7 -7
  55. package/dist/_dts/{validation-Ct-GL0eA.d.ts → validation-BaV565gb.d.ts} +4 -4
  56. package/dist/client/{BlocksIslandsHydrator-DKS8Ba30.mjs → BlocksIslandsHydrator-DTExCJsb.mjs} +22 -21
  57. package/dist/client/{BookingMailingListNote-Cg9v6d7Y.mjs → BookingMailingListNote-BDpxmn1p.mjs} +2 -2
  58. package/dist/client/{CalendarNavigationChevron-BoVCTUXy.mjs → CalendarNavigationChevron-PeCiL82X.mjs} +6 -6
  59. package/dist/client/{CheckboxChoice-BF9eCNno.mjs → CheckboxChoice-DWexRLf6.mjs} +1 -1
  60. package/dist/client/{DemoBookingPortalAccess-BxRVCJG3.mjs → DemoBookingPortalAccess-3zmIqakW.mjs} +6 -6
  61. package/dist/client/{DemoPortalSignInLink-DHxYgkT6.mjs → DemoPortalSignInLink-GHi-8BW5.mjs} +1 -1
  62. package/dist/client/{EventCalendar.client-BI-kvwXf.mjs → EventCalendar.client-BxQLY5cX.mjs} +10 -9
  63. package/dist/client/{EventCombined.client-DIvnoN5l.mjs → EventCombined.client-B5bmQ03b.mjs} +8 -8
  64. package/dist/client/{EventEmbeddedCheckoutStep-B3XUyNY9.mjs → EventEmbeddedCheckoutStep-CgMZ9TeU.mjs} +1 -1
  65. package/dist/client/{EventItem-BRMtEaa6.mjs → EventItem-BEx-qiDE.mjs} +11 -6
  66. package/dist/client/{EventListWeekNavigation-B8DzAUDa.mjs → EventListWeekNavigation-CyH5tA6Y.mjs} +1 -1
  67. package/dist/client/{EventListing.client-Bo4qzQi0.mjs → EventListing.client-D3uySdGP.mjs} +3 -3
  68. package/dist/client/{EventListing.view-D2vemnCx.mjs → EventListing.view-9RFrBejr.mjs} +31 -15
  69. package/dist/client/{EventRegistrationPayment-e5XWtygG.mjs → EventRegistrationPayment-CG2tQx8K.mjs} +92 -99
  70. package/dist/client/LocationMapActions-Wsr83Q7q.mjs +268 -0
  71. package/dist/client/{Page-Dqpv9Ggi.mjs → Page-Bf2nPACI.mjs} +2673 -2290
  72. package/dist/client/{StepIndicator-BrvKa_8H.mjs → StepIndicator-CZweb1vs.mjs} +3 -3
  73. package/dist/client/{TabBarFragment-DvzIV75f.mjs → TabBarFragment-Bkgz67gt.mjs} +1 -1
  74. package/dist/client/ThemedButton-CnyL3s1A.mjs +2243 -0
  75. package/dist/client/{accordion-ByLpb4Dz.mjs → accordion-TcimLLRQ.mjs} +1 -1
  76. package/dist/client/{booking-form.client-BLndwxpx.mjs → booking-form.client-q-RpJ4aF.mjs} +13 -13
  77. package/dist/client/{bookingForm-CTxTEgHX.mjs → bookingForm-DjGfk3Wj.mjs} +4 -4
  78. package/dist/client/bookings.mjs +6 -6
  79. package/dist/client/{carousel-C8ef0vnT.mjs → carousel-CGAk6j0m.mjs} +2 -2
  80. package/dist/client/{carousel.client-BJGoJVtg.mjs → carousel.client-ArlGmYWV.mjs} +1 -1
  81. package/dist/client/{cart-BpH6jkUO.mjs → cart-D_h3rAZ2.mjs} +3 -3
  82. package/dist/client/{cart.client-DV78Td13.mjs → cart.client-DHOxZbJ7.mjs} +1 -1
  83. package/dist/client/{checkout-BJVb2RpL.mjs → checkout-tC-3CzuM.mjs} +3 -3
  84. package/dist/client/{checkout.client-CqGPXPSm.mjs → checkout.client-DsBb2Pkm.mjs} +1 -1
  85. package/dist/client/client.mjs +28 -15
  86. package/dist/client/{context-BRgBWthI.mjs → context-9ZfMb6GA.mjs} +1 -1
  87. package/dist/client/{cta-D8ucLsvX.mjs → cta-D-ZqL7-e.mjs} +2 -1
  88. package/dist/client/{dateFormatting-LeKNQ-iX.mjs → dateFormatting-BCwLqYpW.mjs} +1 -1
  89. package/dist/client/{demoPortalMagicLink-CjstiFPh.mjs → demoPortalMagicLink-BxkSS9fx.mjs} +1 -1
  90. package/dist/client/{enhanceHeaderSection-BaQJyI9x.mjs → enhanceHeaderSection-xg6to91E.mjs} +3 -3
  91. package/dist/client/{event-details.client-CYNQYOsP.mjs → event-details.client-C670TgRd.mjs} +2 -17
  92. package/dist/client/{event-registration.client-DDqSpN36.mjs → event-registration.client-C6GApWTB.mjs} +17 -17
  93. package/dist/client/{eventCalendar-3vQtuC9X.mjs → eventCalendar-CWc0dg9i.mjs} +4 -4
  94. package/dist/client/{eventCombined-CEJFMjqV.mjs → eventCombined-D4DbOrvQ.mjs} +4 -4
  95. package/dist/client/{eventDetails-nGh47jef.mjs → eventDetails-C2DfmbC0.mjs} +2 -2
  96. package/dist/client/{eventListing-BL3Ptb83.mjs → eventListing-C_yXmHyz.mjs} +4 -4
  97. package/dist/client/{eventRegistration-DDSO6KB2.mjs → eventRegistration-DJuaCB-O.mjs} +4 -4
  98. package/dist/client/{form-DjNLfy2Z.mjs → form-QZhtdFHA.mjs} +3 -3
  99. package/dist/client/{form.client-Cj0By6ot.mjs → form.client-CgvPACwG.mjs} +5 -5
  100. package/dist/client/{form.parts-DyA9C5Hy.mjs → form.parts-2uI0-5N-.mjs} +3 -3
  101. package/dist/client/{formatDate-CZo0MPTA.mjs → formatDate-Danr0Nk4.mjs} +1 -1
  102. package/dist/client/gifting/client.mjs +3 -3
  103. package/dist/client/{headerSection-JjSq6Mzp.mjs → headerSection-DJdlLdvZ.mjs} +2 -2
  104. package/dist/client/{mediaAssets-BOj-Co0B.mjs → mediaAssets-BvjcAZpS.mjs} +1 -1
  105. package/dist/client/mediaContext-jPeJ2PmJ.mjs +10801 -0
  106. package/dist/client/{newsletter-form.client-C2EgEBP1.mjs → newsletter-form.client-Cbepz2KU.mjs} +8 -8
  107. package/dist/client/{newsletter-form.parts-CaldoFmi.mjs → newsletter-form.parts-DN8oMCQ0.mjs} +2 -2
  108. package/dist/client/{newsletterForm-hm7L17LM.mjs → newsletterForm-wjLtW-wq.mjs} +3 -3
  109. package/dist/client/{noop-M8FTSgm2.mjs → noop-B7H6gCbj.mjs} +306 -5
  110. package/dist/client/portal/client.mjs +4560 -115
  111. package/dist/client/{product-detail.client-y86uwzEI.mjs → product-detail.client-CYTR165c.mjs} +1 -1
  112. package/dist/client/{product-list.client-_JBndYZT.mjs → product-list.client-B4vTvag8.mjs} +1 -1
  113. package/dist/client/{productDetail-D-9fb2cW.mjs → productDetail-k8LEMSWn.mjs} +3 -3
  114. package/dist/client/{productList-BSRlnwBW.mjs → productList-DEo8Bqoe.mjs} +3 -3
  115. package/dist/client/{propsDecoder-DhbGL302.mjs → propsDecoder-G0j0HXBO.mjs} +3 -28
  116. package/dist/client/{registry.server-BaX0hxf5.mjs → registry.server-BTmSXE3D.mjs} +1154 -997
  117. package/dist/client/rendering/client.mjs +28 -28
  118. package/dist/client/rendering/islands.mjs +1 -1
  119. package/dist/client/rendering.mjs +57 -32
  120. package/dist/client/{richText-coerce-Cny2Ukb6.mjs → richText-coerce-B19taoH6.mjs} +1 -1
  121. package/dist/client/{routeIslandApiConfig-96er7pIx.mjs → routeIslandApiConfig-Chu5BHra.mjs} +1 -1
  122. package/dist/client/{ThemedButton-DVBC_pS9.mjs → schema-C-m8XHuW.mjs} +1123 -2362
  123. package/dist/client/{shop-CnIJfdZA.mjs → shop-RGWa43H7.mjs} +3 -3
  124. package/dist/client/{shop-commerce-CsLwzq5O.mjs → shop-commerce-TJYCBO_H.mjs} +12 -12
  125. package/dist/client/{shop-commerce-store--O8GRBwr.mjs → shop-commerce-store-CjCcUB_o.mjs} +1 -1
  126. package/dist/client/{shop.client-BcaJ-acA.mjs → shop.client-tsKfZw1W.mjs} +15 -15
  127. package/dist/client/{shop.interactive-BxL_bshW.mjs → shop.interactive-CVqLAU53.mjs} +370 -189
  128. package/dist/client/{shopShared-VZjPOfCX.mjs → shopShared-C3lHMz_R.mjs} +2 -2
  129. package/dist/client/{src-7cXhT0G_.mjs → src-VIsPY-kw.mjs} +6 -1
  130. package/dist/client/timetableModel-V2ifvGGy.mjs +1100 -0
  131. package/dist/client/{useAvailableSlots-pTXuY3jV.mjs → useAvailableSlots-D1X69-pN.mjs} +4 -4
  132. package/dist/client/{useBookingNowIso-D14J-EhJ.mjs → useBookingNowIso-Ch30jino.mjs} +1 -1
  133. package/dist/client/{useDiscountApply-o5sIVZ2u.mjs → useDiscountApply-Bwzr1RjV.mjs} +3 -3
  134. package/dist/client/{useDiscountCodeUi-DJhFP_rg.mjs → useDiscountCodeUi-BimJbFC7.mjs} +1 -1
  135. package/dist/client/{useEventPagination-DMmNf2FP.mjs → useEventPagination-CLAS0upd.mjs} +12 -24
  136. package/dist/client/uuid-BETKW8rS.mjs +12 -0
  137. package/dist/client/{view-BgPql2yH2.mjs → view-BUh4LnLS.mjs} +4 -4
  138. package/dist/client/{view-D1R3Lk05.mjs → view-Dj_FZHmg.mjs} +19 -15
  139. package/dist/client/wizardSteps-BkZc-hKH.mjs +6598 -0
  140. package/dist/preview-next/before-render.mjs +5 -4
  141. package/dist/preview-next/chrome.css +2 -0
  142. package/dist/preview-next/client/{EventEmbeddedCheckoutStep-BFlBqSu4.mjs → EventEmbeddedCheckoutStep-CwerMfzn.mjs} +2 -1
  143. package/dist/preview-next/client/LocationPickerEnvironment-QtSG2Bl-.mjs +138 -0
  144. package/dist/preview-next/client/MapLibreEditMap-B-rohNcG.mjs +488 -0
  145. package/dist/preview-next/client/{PreviewEditorSidebar-DADCj_ET.mjs → PreviewEditorSidebar-Dvq-RW9-.mjs} +1328 -171
  146. package/dist/preview-next/client/{PreviewEditorUI-La40Dmmh.mjs → PreviewEditorUI-BdFjS39R.mjs} +53 -79
  147. package/dist/preview-next/client/{SdkPreviewModeRuntime-406Hw9zY.mjs → SdkPreviewModeRuntime-BEfHln1E.mjs} +1249 -2551
  148. package/dist/preview-next/client/{SdkPreviewModeRuntime-CWN44I_B.mjs → SdkPreviewModeRuntime-CjkGh1IG.mjs} +1 -1
  149. package/dist/preview-next/client/{SiteChromeCustomizeContext-BdwEZoo9.mjs → SiteChromeCustomizeContext-CDbxk_qZ.mjs} +117481 -162497
  150. package/dist/preview-next/client/{ThemedButton-BEOPss9H.mjs → ThemedButton-b14Bv03E.mjs} +1253 -403
  151. package/dist/preview-next/client/lucide-react-CA9cpo0P.mjs +51984 -0
  152. package/dist/preview-next/client/maplibre-gl-DykfOYYn.mjs +34208 -0
  153. package/dist/preview-next/client/{previewChromeSurface-BVUKIYG0.mjs → previewChromeSurface-Dd1_mNIg.mjs} +3 -8
  154. package/dist/preview-next/client/result-BjJUoxUF.mjs +16 -0
  155. package/dist/preview-next/client/rolldown-runtime-CE6sIgz8.mjs +34 -0
  156. package/dist/preview-next/client/runtime.mjs +3 -3
  157. package/dist/preview-next/client/{sdk-runtime-Cy9AKPy5.mjs → sdk-runtime-B-CXyGVb.mjs} +1 -1
  158. package/dist/preview-next/client/siteStyleAccess-Kqk0j0dE.mjs +5812 -0
  159. package/dist/preview-next/client/{spinner-Bhpzz2vO.mjs → spinner-CGxS8Ns-.mjs} +2 -1
  160. package/dist/preview-next/{constants-D8Ya7bO4.mjs → constants-Bf-vqdKH.mjs} +2 -1
  161. package/dist/preview-next/editor-base.css +64 -2
  162. package/dist/preview-next/editor-chrome.css +85 -0
  163. package/dist/preview-next/keepAlive.mjs +2 -2
  164. package/dist/preview-next/middleware.mjs +7 -3
  165. package/dist/preview-next/{route-contract-DM22uOXM.mjs → route-contract-hLg-yjQN.mjs} +190 -116
  166. package/dist/preview-next/{session-BgkrPqu0.mjs → session-P1R_ajT7.mjs} +12 -2
  167. package/dist/preview-next/session.mjs +1 -1
  168. package/dist/server/{Block.shared-DB6fb1pR.mjs → Block.shared-CeTd2saO.mjs} +6 -6
  169. package/dist/server/{bindings-z2daXp-2.mjs → bindings-C5YpKuKt.mjs} +3 -2
  170. package/dist/server/{client-Cv-osXoU.mjs → client-Cv26lZQ4.mjs} +14 -10
  171. package/dist/server/config-template-validation.mjs +50 -10
  172. package/dist/server/config-validation.mjs +1 -1
  173. package/dist/server/config.mjs +2 -2
  174. package/dist/server/{siteChromeOverlayClearance-BangtD8A.mjs → effectiveNavLinkStyle-CGvGr3yD.mjs} +572 -1078
  175. package/dist/server/index.mjs +3 -3
  176. package/dist/server/{loadContent-BNMDYCm8.mjs → loadContent-C8a0b-cC.mjs} +40 -21
  177. package/dist/server/loadPage--DXBwI8V.mjs +2 -0
  178. package/dist/server/{loadPage-CjA_F_AF.mjs → loadPage-BW7dklu3.mjs} +9 -5
  179. package/dist/server/manifest.mjs +1 -1
  180. package/dist/server/next.mjs +9 -9
  181. package/dist/server/{overrideResolution-CGodrtqi.mjs → overrideResolution-tIuqmJB3.mjs} +1 -1
  182. package/dist/server/{overrides-DxRC724a.mjs → overrides-D1fiPOKF.mjs} +1158 -754
  183. package/dist/server/page-converter.mjs +8 -10
  184. package/dist/server/{prebuild-C6bhjRKT.mjs → prebuild--fO0E2tr.mjs} +1 -1
  185. package/dist/server/prebuild.mjs +1 -1
  186. package/dist/server/{prefetchBlockData-DZ5Fq_-r.mjs → prefetchBlockData-CqJnokWJ.mjs} +968 -968
  187. package/dist/server/{publicProducts-C3meXS2o.mjs → publicProducts-CvvZ4JIe.mjs} +207 -132
  188. package/dist/server/{blocks-BaG8Qpaa.mjs → registry-BVfCqaCq.mjs} +2853 -2799
  189. package/dist/server/rendering/server.mjs +4 -4
  190. package/dist/server/rendering.mjs +8 -8
  191. package/dist/server/{resolveBlockData-CbGDakvp.mjs → resolveBlockData-DPNvhXEz.mjs} +6 -3
  192. package/dist/server/routing.mjs +1 -1
  193. package/dist/server/{schema-Bs735S27.mjs → schema-CD4peO7m.mjs} +2441 -1401
  194. package/dist/server/server.mjs +3 -3
  195. package/dist/server/site-styles-H-EvTJiW.mjs +787 -0
  196. package/dist/server/siteChromeOverlayClearance-DNC2k1U0.mjs +750 -0
  197. package/dist/server/{src-B935_bzN.mjs → src-ILxc6pid.mjs} +427 -190
  198. package/dist/server/theme-bridge.mjs +1 -1
  199. package/dist/server/theme.mjs +1 -1
  200. package/dist/server/{themeAdmission-DK2YBNqy.mjs → themeAdmission-BNHIXiUj.mjs} +117 -26
  201. package/dist/server/{three-pass-converter-CmmchOFC.mjs → three-pass-converter-Chnb1XD-.mjs} +2 -58
  202. package/dist/server/{validation-BtHE2S_D.mjs → validation-B1ieVemg.mjs} +22 -63
  203. package/dist/server/{version-CNCdL6id.mjs → version-BQK44wFg.mjs} +1 -1
  204. package/dist/styles/index.css +235 -0
  205. package/package.json +8 -3
  206. package/dist/_dts/index-CXsnaCGe.d.ts +0 -10
  207. package/dist/_dts/index-cnymEAZY.d.ts +0 -1
  208. package/dist/client/LeafletStaticMap-dlapZ6mi.mjs +0 -135
  209. package/dist/client/location-map.client-DRN1JePj.mjs +0 -28
  210. package/dist/client/location-map.view-CuCvQdvp.mjs +0 -282
  211. package/dist/client/locationMap-B9srHHzZ.mjs +0 -15
  212. package/dist/client/mediaContext-DThoeEBU.mjs +0 -136
  213. package/dist/client/renderableMediaAssetAdmission-DGjBr_e-.mjs +0 -152
  214. package/dist/client/timetableModel-D09jPdue.mjs +0 -480
  215. package/dist/client/wizardSteps-C0TsNqJc.mjs +0 -17049
  216. package/dist/preview-next/client/siteStyleAccess-CFMmoMZb.mjs +0 -1326
  217. package/dist/server/loadPage-jade28Xh.mjs +0 -2
  218. package/dist/server/media-CcHwZkdJ.mjs +0 -243
@@ -1,9 +1,9 @@
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";
1
+ import { Pt as asDesignBlockId, Qt as makeBoundaryId, Rn as defaultThemeTokens, Tr as ok, Vt as asSiteStyleId, _t as resolveManagedMediaReference, br as parseUserId, cn as parseResolvedSurface, dt as mediaSchema, gt as indexRenderableMediaAssets, ht as renderableMediaAssetSchema, ln as parseSurfaceTree, lt as stripStaleTransitionStyleGroup, mr as parseApiKeyId, pt as runtimeMediaSchema, r as themeSchema, un as resolveSurface, vr as parseSiteId, wn as mapDrawingStyle, wr as err, yr as parseSiteTermsVersionId, zt as asLayoutVariantKey } from "./schema-CD4peO7m.mjs";
2
2
  import { t as assertNever } from "./assert-never-ku-PUn9U.mjs";
3
- import { Ar as parseRuntimeBackgroundContent, B as calendarWindowQuerySchema, Bi as boundaryLayout, Br as lookLeadSlotTransform, Ci as RESOLVED_INTERNAL_LINK_ENTITY_TYPES, Fi as arrangementManifestFromVariants, Fn as contentTransforms, Gi as parseCanonicalRuntimeBackground, Gr as runTransforms, Hi as sectionFactsForContent, Hn as uiTransforms, Hr as lookSkinSlotTransform, Ht as eventCalendarWeekStart, Ii as readStoredMode, In as mediaTransforms, Ir as standardImageShapeOptions, Ki as resolveSectionBackground, Kr as getBlockDefinition, Li as resolveEffectiveArrangement, Ln as headerRuntimeTransforms, Lr as BACKGROUND_POSITION_PRESET_VALUES, Lt as buildEventListWeek, Mr as resolveBackgroundColorValue, O as projectRecurringSchedule, Or as parseBackgroundContent, Pi as augmentManifest, Q as computeMediaTransformStyle, Ri as resolveModeArrangement, Rn as chromeLogoTransforms, Rr as getAnchorClasses, Si as bindingSchema, Ui as deriveSectionGround, Un as formattingTransforms, Ur as asPartialObject, V as resolveCalendarReadProfile, Vi as composeBoundary, Vn as resolveHeroTitleLength, Vr as lookQuoteLimitTransform, Wi as heroPhotoPaintsGround, Wr as createTransformRegistry, Xi as resolveDateRuntimeContext, Yi as readRuntimeNow, _t as resolveEventCalendarReadPlan, bi as previewCustomizeManifestCurationSchema, gi as fieldSchema, gt as eventCalendarListLayoutOptions, hi as blockCategoryEnum, ht as eventCalendarListLayoutCompatibleDisplayModeValues, jr as resolveSurfaceForegroundStyles, kr as parseBackgroundOverlay, lt as resolveEventSelection, mt as eventCalendarListGroupingDecision, pa as getLocalScheduleDate, ra as parseMailingListProviderScope, rr as standardAspectRatioOptions, wr as boxStylesTransforms, xi as NodeSchema, ya as toUtcIsoDateTimeString, zi as resolvePublishedLook, zn as layoutTransforms, zr as lookCarouselRegionTransform } from "./blocks-BaG8Qpaa.mjs";
4
- import { d as SUPPORTED_LOADER_ENDPOINTS$1, n as parsePublicProductCategorySelector, r as isRecord$3 } from "./publicProducts-C3meXS2o.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-Bs735S27.mjs";
6
- import { B as resolveEffectiveKnobs, C as getGradientPreset, H as cardListKnobBlocks, M as resolveItemSurface, N as resolveLookSlotSurfaces, S as gradientToCss, T as deriveSiteStyleBlockPolicy, V as cardListFamilyBlocks, j as arrangementSlotNames, w as parseGradientPresetId } from "./siteChromeOverlayClearance-BangtD8A.mjs";
3
+ import { $r as runTransforms, Ai as NodeSchema, Bn as resolveDateRuntimeContext, Br as resolveBackgroundColorValue, Bt as buildEventListWeek, Ci as fieldSchema, Di as validateManifestLookField, Fr as parseBackgroundContent, Gr as BACKGROUND_POSITION_PRESET_VALUES, Gt as eventCalendarWeekStart, Hn as headerRuntimeTransforms, Ir as parseBackgroundOverlay, Jn as formattingTransforms, Jr as lookLeadSlotTransform, Kn as resolveHeroTitleLength, Kr as getAnchorClasses, Lr as parseRuntimeBackgroundContent, Mi as RESOLVED_INTERNAL_LINK_ENTITY_TYPES, Oi as sdkBlockPresentationShape, P as projectRecurringSchedule, Qr as createTransformRegistry, Rn as contentTransforms, Rr as resolveSectionSurfaceForeground, Si as builtInBlockKindsSchema, U as calendarWindowQuerySchema, Ui as augmentManifest, Un as chromeLogoTransforms, Vn as mediaTransforms, W as resolveCalendarReadProfile, Wn as layoutTransforms, Wr as standardImageShapeOptions, Xr as lookSkinSlotTransform, Yr as lookQuoteLimitTransform, Zr as asPartialObject, _t as eventCalendarListGroupingDecision, bi as blockCategoryEnum, bt as resolveEventCalendarReadPlan, ft as resolveEventSelection, ji as bindingSchema, jr as boxStylesTransforms, ki as validateSdkBlockDeclaration, na as parseMailingListProviderScope, oa as locationValueSchema, qn as uiTransforms, qr as lookCarouselRegionTransform, t as getBlockDefinition, tt as computeMediaTransformStyle, ur as standardAspectRatioOptions, va as getLocalScheduleDate, vt as eventCalendarListLayoutCompatibleDisplayModeValues, wa as toUtcIsoDateTimeString, xi as blockSectionDeclarationShape, yt as eventCalendarListLayoutOptions, zn as readRuntimeNow, zr as resolveSurfaceForegroundStyles } from "./registry-BVfCqaCq.mjs";
4
+ import { d as SUPPORTED_LOADER_ENDPOINTS$1, n as parsePublicProductCategorySelector, r as isRecord$3 } from "./publicProducts-CvvZ4JIe.mjs";
5
+ import { B as resolveEffectiveKnobs, E as parseGradientPresetId, H as cardListKnobBlocks, T as getGradientPreset, V as cardListFamilyBlocks, _ as resolveEffectiveArrangement, b as deriveSiteStyleBlockPolicy, f as arrangementSlotNames, g as readStoredMode, h as arrangementManifestFromVariants, m as resolveLookSlotSurfaces, p as resolveItemSurface, v as resolveModeArrangement, w as gradientToCss, y as resolvePublishedLook } from "./effectiveNavLinkStyle-CGvGr3yD.mjs";
6
+ import { a as heroPhotoPaintsGround, i as deriveSectionGround, n as composeBoundary, o as parseCanonicalRuntimeBackground, r as sectionFactsForContent, s as resolveSectionBackground, t as boundaryLayout } from "./site-styles-H-EvTJiW.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,358 +387,382 @@ function parseStoredVariant(manifest, content) {
380
387
  } : { kind: "absent" };
381
388
  }
382
389
  //#endregion
383
- //#region ../blocks/src/system/data/linkedContentEntries.ts
384
- const LINKED_CONTENT_ENTRY_META_KEY = "__rbLinkedContentEntry";
385
- function coerceLinkedContentEntriesPayload(payload) {
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
- kind: "linked-content-entry",
406
- entryId: meta.entryId,
407
- contentTypeKey: meta.contentTypeKey,
408
- contentTypeLabel: meta.contentTypeLabel,
409
- title: meta.title,
410
- optimisticHash: meta.optimisticHash,
411
- sourceBlockId: sourceBlockId ?? null,
412
- sourceBlockKind: sourceBlockKind ?? null,
413
- itemIndex,
414
- content: { ...content },
415
- contentType: meta.contentType
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 resolveLinkedEntryInlineFieldEligibility(input) {
419
- const meta = getLinkedContentEntryMeta(input.entry);
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
- kind: "editable",
457
- displayPath: input.displayPath,
458
- write: {
459
- kind: "linked-entry-write-field",
460
- entryId: meta.entryId,
461
- fieldPath: source.fieldPath,
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
- function enrichLinkedContentEntry(entry, contentType) {
467
- if (!isRecord$1(entry)) return entry;
468
- const entryId = typeof entry.id === "string" ? entry.id : null;
469
- if (!entryId) return entry;
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
- };
430
+ //#endregion
431
+ //#region ../blocks/src/system/customize/arrangementKnobs.ts
432
+ /**
433
+ * Content stage for knobs, shared by the renderer and the editor so what the
434
+ * options show and what renders can't disagree. Knob buffets are the block's
435
+ * customise facets; the Look exposes, forces or narrows them and the style's
436
+ * offer can only remove or narrow further.
437
+ */
438
+ function resolveArrangementKnobs(input) {
439
+ const length = input.blockKind === "block.hero" ? resolveHeroTitleLength({ ...input.content }, "look") : null;
440
+ const exposure = arrangementKnobExposure(input.blockKind, input.look, length);
484
441
  return {
485
- ...entry,
486
- [LINKED_CONTENT_ENTRY_META_KEY]: meta
442
+ length,
443
+ exposure,
444
+ knobs: resolveEffectiveKnobs({
445
+ exposure,
446
+ content: normalizedHeadlinePreference(input.content)
447
+ })
487
448
  };
488
449
  }
489
- function deriveLinkedEntryFieldSources(entry, contentType, content) {
490
- const sources = [];
491
- for (const field of contentType.fields) {
492
- const fieldType = resolvePreviewLinkedEntryInlineFieldType(field.type);
493
- if (!fieldType) {
494
- sources.push({
495
- kind: "read-only",
496
- displayPath: `content.${field.id}`,
497
- reason: "unsupported-field-type"
498
- });
499
- continue;
500
- }
501
- sources.push({
502
- kind: "content-field",
503
- displayPath: `content.${field.id}`,
504
- fieldPath: field.id,
505
- fieldType
506
- });
507
- if (field.id === "excerpt" && fieldType === "text" && typeof entry.excerpt === "string" && typeof content.excerpt === "string" && entry.excerpt === content.excerpt) sources.push({
508
- kind: "content-field",
509
- displayPath: "excerpt",
510
- fieldPath: "excerpt",
511
- fieldType
512
- });
513
- if (field.id === contentType.titleField && fieldType === "text" && typeof entry.title === "string" && typeof content[field.id] === "string" && entry.title === content[field.id]) sources.push({
514
- kind: "content-field",
515
- displayPath: "title",
516
- fieldPath: field.id,
517
- fieldType
518
- });
519
- }
520
- for (const displayPath of [
521
- "title",
522
- "slug",
523
- "path",
524
- "publishedAt",
525
- "status",
526
- "image"
527
- ]) if (displayPath in entry && !sources.some((source) => source.displayPath === displayPath)) sources.push({
528
- kind: "read-only",
529
- displayPath,
530
- reason: displayPath === "image" ? "derived-field" : "route-field"
450
+ function arrangementKnobExposure(blockKind, look, length) {
451
+ return systemCustomizeFacetDefinitionsForBlock(blockKind).flatMap((facet) => {
452
+ if (facet.knob === void 0 || facet.target.kind !== "content-field") return [];
453
+ const id = facet.target.field;
454
+ return [{
455
+ definition: {
456
+ id,
457
+ defaultValue: (look.look.structure.knobDefaults ?? {})[id] ?? facet.defaultValue,
458
+ values: facet.values.map((value) => value.value),
459
+ ...knobKindMetadata(facet.knob)
460
+ },
461
+ exposed: exposedKnobIds(look).includes(id),
462
+ forced: look.look.structure.forcedKnobs?.[id],
463
+ lookValues: look.look.structure.knobValues?.[id],
464
+ styleValues: look.knobValues[id],
465
+ lengthValues: id === "titleSize" ? headlineAllowedValues(length) : void 0
466
+ }];
531
467
  });
532
- return sources;
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
468
  }
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."
469
+ function knobKindMetadata(knob) {
470
+ return knob.kind === "fixed" ? { ordered: knob.ordered } : {
471
+ ordered: false,
472
+ textMaxLength: knob.maxLength
551
473
  };
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);
559
- }
560
474
  }
561
- function contentTypeKeyToLabel(key) {
562
- 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(" ");
563
- }
564
- function capitalize(value) {
565
- return value.charAt(0).toUpperCase() + value.slice(1).toLowerCase();
475
+ function headlineAllowedValues(length) {
476
+ switch (length) {
477
+ case "long": return ["quiet"];
478
+ case "medium": return ["quiet", "auto"];
479
+ case "short": return [
480
+ "quiet",
481
+ "auto",
482
+ "display"
483
+ ];
484
+ case null: return;
485
+ }
566
486
  }
567
- function parsePublicContentTypeMeta(value) {
568
- if (!isRecord$1(value)) return null;
569
- if (typeof value.key !== "string" || value.key.trim().length === 0) return null;
570
- return {
571
- key: value.key,
572
- titleField: typeof value.titleField === "string" ? value.titleField : null,
573
- fields: Array.isArray(value.fields) ? value.fields.flatMap(parsePublicContentTypeFieldMeta) : [],
574
- previewLinkedEntryEditing: parsePublicContentTypeLinkedEntryEditing(value.previewLinkedEntryEditing)
575
- };
576
- }
577
- function parsePublicContentTypeLinkedEntryEditing(value) {
578
- if (!isRecord$1(value) || typeof value.kind !== "string") return null;
579
- switch (value.kind) {
580
- case "generic": return { kind: "generic" };
581
- case "unsupported-domain-backed": return {
582
- kind: "unsupported-domain-backed",
583
- reason: typeof value.reason === "string" ? value.reason : "Domain-backed entries need a dedicated editor workflow."
487
+ /** `titleSize` keeps its five stored values; under a Look they read as three steps. */
488
+ function normalizedHeadlinePreference(content) {
489
+ switch (content.titleSize) {
490
+ case "editorial": return {
491
+ ...content,
492
+ titleSize: "auto"
584
493
  };
585
- default: return null;
586
- }
587
- }
588
- function parsePublicContentTypeFieldMeta(value) {
589
- if (!isRecord$1(value)) return [];
590
- if (typeof value.id !== "string" || typeof value.type !== "string") return [];
591
- return [{
592
- id: value.id,
593
- type: value.type,
594
- mediaKinds: parseStringArray(value.mediaKinds),
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);
614
- }
615
- function isLinkedEntryFieldSourceArray(value) {
616
- return Array.isArray(value) && value.every(isLinkedEntryFieldSource);
617
- }
618
- function isLinkedEntryFieldSource(value) {
619
- if (!isRecord$1(value)) return false;
620
- if (typeof value.displayPath !== "string") return false;
621
- switch (value.kind) {
622
- case "content-field": return typeof value.fieldPath === "string" && (value.fieldType === "text" || value.fieldType === "richText");
623
- case "read-only": return isLinkedEntryInlineFieldReadOnlyReason(value.reason);
624
- default: return false;
625
- }
626
- }
627
- function isLinkedEntryInlineFieldReadOnlyReason(value) {
628
- switch (value) {
629
- case "missing-entry-meta":
630
- case "unsupported-content-type":
631
- case "missing-field-schema":
632
- case "unsupported-field-type":
633
- case "unmapped-display-path":
634
- case "route-field":
635
- case "derived-field": return true;
636
- default: return false;
637
- }
638
- }
639
- function isLinkedContentEditSupport(value) {
640
- if (!isRecord$1(value) || typeof value.kind !== "string") return false;
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);
651
- }
652
- //#endregion
653
- //#region ../blocks/src/system/transforms/registry/offeringsPreview.ts
654
- /** Reuse the existing occurrence read for the date strip and card date rows. */
655
- const offeringsPreviewDatesReadEnabled = {
656
- id: "events.offeringsPreviewDatesReadEnabled",
657
- kind: "formatter",
658
- summary: "Load one occurrence batch for catalogue dates or next-date cards",
659
- run(value) {
660
- const content = asPartialObject(value);
661
- const dates = asPartialObject(asPartialObject(content?._effectiveKnobs)?.dates);
662
- return content?.displayMode === "catalogue" || dates?.value === "next-dates";
663
- }
664
- };
665
- //#endregion
666
- //#region ../blocks/src/system/helpers/backgroundMedia.ts
667
- function resolveBackgroundMedia(input) {
668
- const parsedMedia = runtimeMediaSchema.safeParse(input.image);
669
- if (!parsedMedia.success) return null;
670
- switch (parsedMedia.data.type) {
671
- case "image":
672
- case "video": return {
673
- ...parsedMedia.data,
674
- type: parsedMedia.data.type
494
+ case "poster": return {
495
+ ...content,
496
+ titleSize: "display"
675
497
  };
676
- case "audio":
677
- case "document":
678
- case "spreadsheet":
679
- case "archive": return null;
498
+ default: return content;
680
499
  }
681
500
  }
682
- function backgroundVideoMobileClassNames(input) {
683
- if (resolveBackgroundMedia(input)?.type !== "video") return "";
684
- return input.showVideoOnMobile === true ? "" : "rb-hidden rb-md-block";
501
+ function exposedKnobIds(look) {
502
+ return [...look.look.structure.knobs, ...look.addKnobs ?? []].filter((id) => !look.removeKnobs.some((removed) => removed === id));
685
503
  }
686
504
  //#endregion
687
- //#region ../blocks/src/system/transforms/registry/background.ts
688
- const isString = (value) => typeof value === "string" && value.trim().length > 0;
689
- const isNumber = (value) => typeof value === "number" && !isNaN(value);
690
- function backgroundMotionClassNames(input) {
691
- return input.motion === "fixed-frame" ? "rb-bg-motion-fixed-frame" : "";
692
- }
693
- function appendBackgroundMediaClasses(baseClassName, input) {
694
- return [
695
- baseClassName,
696
- backgroundMotionClassNames(input),
697
- backgroundVideoMobileClassNames(input)
698
- ].filter(Boolean).join(" ");
699
- }
700
- function gradientPresetCss(value) {
701
- const presetId = parseGradientPresetId(value);
702
- if (!presetId) return null;
703
- const preset = getGradientPreset(presetId);
704
- return gradientToCss(preset, Object.fromEntries(preset.stops.map((stop) => [stop.color, `rgb(var(--tb-${stop.color}))`])));
505
+ //#region ../blocks/src/system/customize/facets.ts
506
+ function defineCustomizeFacet(definition) {
507
+ return definition;
705
508
  }
706
- const backgroundTransforms = [
707
- {
708
- id: "background.resolveMedia",
709
- kind: "formatter",
710
- summary: "Resolve media only from a canonical image or video background",
711
- run: (value) => parseMediaBackground(value)?.image ?? null
509
+ const eventCalendarListLayoutFacet = defineCustomizeFacet({
510
+ blockKind: "block.event-calendar",
511
+ id: "eventCalendar.listLayout",
512
+ label: "List style",
513
+ legacyOnly: true,
514
+ values: eventCalendarListLayoutOptions.map((option) => ({
515
+ value: option.id,
516
+ label: option.label
517
+ })),
518
+ defaultValue: "stack",
519
+ target: { kind: "event-calendar-list-layout-content" },
520
+ appliesToLayoutVariants: eventCalendarListLayoutCompatibleDisplayModeValues
521
+ });
522
+ const fixedKnob = (blockKind, id, label, values, defaultValue, ordered = false, boolean = false) => ({
523
+ blockKind,
524
+ id,
525
+ label,
526
+ values,
527
+ defaultValue,
528
+ knob: {
529
+ kind: "fixed",
530
+ ordered
712
531
  },
713
- {
714
- id: "background.resolveStyle",
715
- kind: "formatter",
716
- summary: "Resolve inline styles for background color/gradient layers",
717
- run: (value, options, context) => {
718
- const fallbackToken = options?.fallbackToken;
719
- return resolveBackgroundLayerStyle(value, fallbackToken, context);
720
- }
532
+ target: {
533
+ kind: "content-field",
534
+ field: id,
535
+ ...boolean ? { boolean: true } : {}
536
+ }
537
+ });
538
+ const textKnob = (id, label, maxLength) => ({
539
+ blockKind: "block.hero",
540
+ id,
541
+ label,
542
+ values: [],
543
+ defaultValue: "",
544
+ knob: {
545
+ kind: "text",
546
+ maxLength
721
547
  },
548
+ target: {
549
+ kind: "content-field",
550
+ field: id
551
+ }
552
+ });
553
+ const onOff = [{
554
+ value: "true",
555
+ label: "On"
556
+ }, {
557
+ value: "false",
558
+ label: "Off"
559
+ }];
560
+ const systemCustomizeFacetDefinitions = [
561
+ eventCalendarListLayoutFacet,
562
+ fixedKnob("block.offerings-preview", "dates", "Dates", [{
563
+ value: "summary",
564
+ label: "Summary"
565
+ }, {
566
+ value: "next-dates",
567
+ label: "Next dates"
568
+ }], "summary"),
722
569
  {
723
- id: "background.resolveColorsStyle",
724
- kind: "formatter",
725
- summary: "Resolve surface foreground colors from a background object into scoped CSS vars",
726
- run: (value, options, context) => asPartialObject(options)?.arrangementInherits === true && context.data?._lookSlots !== void 0 ? {} : resolveSurfaceForegroundStyles(value, context)
570
+ ...fixedKnob("block.feature-cards", "actionStyle", "Item actions", [{
571
+ value: "button",
572
+ label: "Button"
573
+ }, {
574
+ value: "link",
575
+ label: "Link"
576
+ }], "button"),
577
+ blockKinds: cardListKnobBlocks
727
578
  },
579
+ fixedKnob("block.testimonials", "quoteCount", "How many quotes", [
580
+ {
581
+ value: "1",
582
+ label: "1"
583
+ },
584
+ {
585
+ value: "2",
586
+ label: "2"
587
+ },
588
+ {
589
+ value: "3",
590
+ label: "3"
591
+ },
592
+ {
593
+ value: "all",
594
+ label: "All"
595
+ }
596
+ ], "3", true),
597
+ fixedKnob("block.testimonials", "tilt", "Tilt the small cards", onOff, "true", false, true),
728
598
  {
729
- id: "background.resolveFrameClassName",
730
- kind: "formatter",
731
- summary: "Resolve clipping on a decorative background frame without clipping foreground content",
732
- run: (value, options) => {
733
- const baseClass = options?.baseClass?.trim() ?? "";
734
- const input = parseMediaBackground(value);
599
+ ...fixedKnob("block.testimonials", "archFrame", "Arch frame", onOff, "true", false, true),
600
+ blockKinds: [
601
+ "block.testimonials",
602
+ "block.newsletter-signup",
603
+ "block.form"
604
+ ]
605
+ },
606
+ fixedKnob("block.hero", "candleGlow", "Candle glow", onOff, "true", false, true),
607
+ fixedKnob("block.hero", "columnGuides", "Column guides", onOff, "true", false, true),
608
+ fixedKnob("block.hero", "titleSize", "Headline size", [
609
+ {
610
+ value: "quiet",
611
+ label: "Quieter"
612
+ },
613
+ {
614
+ value: "auto",
615
+ label: "Standard"
616
+ },
617
+ {
618
+ value: "display",
619
+ label: "Louder"
620
+ }
621
+ ], "auto", true),
622
+ fixedKnob("block.hero", "imagePosition", "Photo side", [{
623
+ value: "left",
624
+ label: "Left"
625
+ }, {
626
+ value: "right",
627
+ label: "Right"
628
+ }], "right"),
629
+ fixedKnob("block.intro", "imageShape", "Media shape", standardImageShapeOptions, "default"),
630
+ fixedKnob("block.intro", "imagePosition", "Photo side", [{
631
+ value: "left",
632
+ label: "Left"
633
+ }, {
634
+ value: "right",
635
+ label: "Right"
636
+ }], "left"),
637
+ fixedKnob("block.media-text", "imagePosition", "Photo side", [{
638
+ value: "left",
639
+ label: "Left"
640
+ }, {
641
+ value: "right",
642
+ label: "Right"
643
+ }], "left"),
644
+ fixedKnob("block.media-text", "imageShape", "Media shape", standardImageShapeOptions, "default"),
645
+ fixedKnob("block.media-text", "aspectRatio", "Media aspect ratio", standardAspectRatioOptions, "auto"),
646
+ textKnob("stickerLine", "Sticker line", 32),
647
+ textKnob("smallCaption", "Small caption", 24),
648
+ {
649
+ ...fixedKnob("block.feature-cards", "showPhotos", "Show photos", onOff, "true", false, true),
650
+ blockKinds: cardListFamilyBlocks
651
+ },
652
+ fixedKnob("block.event-calendar", "showPhotos", "Photos", [{
653
+ value: "true",
654
+ label: "Show"
655
+ }, {
656
+ value: "false",
657
+ label: "Hide"
658
+ }], "true", false, true),
659
+ {
660
+ ...fixedKnob("block.feature-cards", "cardMarker", "Item markers", [
661
+ {
662
+ value: "icons",
663
+ label: "Icons"
664
+ },
665
+ {
666
+ value: "numbers",
667
+ label: "Numbers"
668
+ },
669
+ {
670
+ value: "none",
671
+ label: "None"
672
+ }
673
+ ], "icons"),
674
+ blockKinds: cardListFamilyBlocks
675
+ },
676
+ fixedKnob("block.event-calendar", "showCapacity", "Show places left", onOff, "true", false, true)
677
+ ];
678
+ systemCustomizeFacetDefinitions.map((definition) => definition.id);
679
+ Array.from(new Set(systemCustomizeFacetDefinitions.flatMap((definition) => definition.values.map((option) => option.value))));
680
+ function systemCustomizeFacetDefinitionsForBlock(blockKind) {
681
+ return systemCustomizeFacetDefinitions.filter((definition) => definition.blockKind === blockKind || "blockKinds" in definition && definition.blockKinds?.some((kind) => kind === blockKind));
682
+ }
683
+ //#endregion
684
+ //#region ../blocks/src/system/transforms/registry/offeringsPreview.ts
685
+ /** Reuse the existing occurrence read for the date strip and card date rows. */
686
+ const offeringsPreviewDatesReadEnabled = {
687
+ id: "events.offeringsPreviewDatesReadEnabled",
688
+ kind: "formatter",
689
+ summary: "Load one occurrence batch for catalogue dates or next-date cards",
690
+ run(value) {
691
+ const content = asPartialObject(value);
692
+ const dates = asPartialObject(asPartialObject(content?._effectiveKnobs)?.dates);
693
+ return content?.displayMode === "catalogue" || dates?.value === "next-dates";
694
+ }
695
+ };
696
+ //#endregion
697
+ //#region ../blocks/src/system/helpers/backgroundMedia.ts
698
+ function resolveBackgroundMedia(input) {
699
+ const parsedMedia = runtimeMediaSchema.safeParse(input.image);
700
+ if (!parsedMedia.success) return null;
701
+ switch (parsedMedia.data.type) {
702
+ case "image":
703
+ case "video": return {
704
+ ...parsedMedia.data,
705
+ type: parsedMedia.data.type
706
+ };
707
+ case "audio":
708
+ case "document":
709
+ case "spreadsheet":
710
+ case "archive": return null;
711
+ }
712
+ }
713
+ function backgroundVideoMobileClassNames(input) {
714
+ if (resolveBackgroundMedia(input)?.type !== "video") return "";
715
+ return input.showVideoOnMobile === true ? "" : "rb-hidden rb-md-block";
716
+ }
717
+ //#endregion
718
+ //#region ../blocks/src/system/transforms/registry/background.ts
719
+ const isString = (value) => typeof value === "string" && value.trim().length > 0;
720
+ const isNumber = (value) => typeof value === "number" && !isNaN(value);
721
+ function backgroundMotionClassNames(input) {
722
+ return input.motion === "fixed-frame" ? "rb-bg-motion-fixed-frame" : "";
723
+ }
724
+ function appendBackgroundMediaClasses(baseClassName, input) {
725
+ return [
726
+ baseClassName,
727
+ backgroundMotionClassNames(input),
728
+ backgroundVideoMobileClassNames(input)
729
+ ].filter(Boolean).join(" ");
730
+ }
731
+ function gradientPresetCss(value) {
732
+ const presetId = parseGradientPresetId(value);
733
+ if (!presetId) return null;
734
+ const preset = getGradientPreset(presetId);
735
+ return gradientToCss(preset, Object.fromEntries(preset.stops.map((stop) => [stop.color, `rgb(var(--tb-${stop.color}))`])));
736
+ }
737
+ const backgroundTransforms = [
738
+ {
739
+ id: "background.resolveMedia",
740
+ kind: "formatter",
741
+ summary: "Resolve media only from a canonical image or video background",
742
+ run: (value) => parseMediaBackground(value)?.image ?? null
743
+ },
744
+ {
745
+ id: "background.resolveStyle",
746
+ kind: "formatter",
747
+ summary: "Resolve inline styles for background color/gradient layers",
748
+ run: (value, options, context) => {
749
+ const fallbackToken = options?.fallbackToken;
750
+ return resolveBackgroundLayerStyle(value, fallbackToken, context);
751
+ }
752
+ },
753
+ {
754
+ id: "background.resolveColorsStyle",
755
+ kind: "formatter",
756
+ summary: "Resolve surface foreground colors from a background object into scoped CSS vars",
757
+ run: (value, options, context) => asPartialObject(options)?.arrangementInherits === true && context.data?._lookSlots !== void 0 ? {} : resolveSurfaceForegroundStyles(value, context)
758
+ },
759
+ {
760
+ id: "background.resolveFrameClassName",
761
+ kind: "formatter",
762
+ summary: "Resolve clipping on a decorative background frame without clipping foreground content",
763
+ run: (value, options) => {
764
+ const baseClass = options?.baseClass?.trim() ?? "";
765
+ const input = parseMediaBackground(value);
735
766
  if (!input) return `${baseClass} rb-overflow-hidden`.trim();
736
767
  if (input.overflow === true) return `${baseClass} rb-overflow-visible`.trim();
737
768
  const objectFit = input.objectFit ?? null;
@@ -959,6 +990,29 @@ function resolveAuthoredLinkHref(value, context = {}) {
959
990
  function resolvePreResolvedLink(link) {
960
991
  return !(typeof link.kind === "string" ? link.kind : null) && typeof link.href === "string" ? resolveExternalLink(link) : null;
961
992
  }
993
+ //#endregion
994
+ //#region ../blocks/src/system/transforms/registry/mapDrawing.ts
995
+ /**
996
+ * Map tokens for the section ground a drawing sits on. The value is the
997
+ * section's `_sectionStyles.background`, resolved by the same owner as the
998
+ * section's own foreground; theme-core decides every map colour from it.
999
+ */
1000
+ const mapDrawingStyleTransform = {
1001
+ id: "mapDrawing.resolveStyle",
1002
+ kind: "formatter",
1003
+ summary: "Resolve map drawing tokens from the section ground and site style",
1004
+ run: (value, options, context) => mapDrawingStyle({
1005
+ foreground: resolveSectionSurfaceForeground(value ?? sectionFallbackBackground(options?.fallbackToken), context, { fallbackToken: options?.fallbackToken }),
1006
+ palette: context.theme.palette,
1007
+ skin: context.theme.skin
1008
+ })
1009
+ };
1010
+ function sectionFallbackBackground(token) {
1011
+ return token === void 0 ? void 0 : {
1012
+ type: "color",
1013
+ color: token
1014
+ };
1015
+ }
962
1016
  const eventCalendarSelectionParam = {
963
1017
  id: "events.calendarSelectionParam",
964
1018
  kind: "formatter",
@@ -979,7 +1033,11 @@ const eventCalendarSelectionParam = {
979
1033
  return key === "seriesIds" ? void 0 : content[key];
980
1034
  }
981
1035
  };
982
- const readJobSchema = z.object({ job: z.enum(["list", "calendar"]) });
1036
+ const readJobSchema = z.object({ job: z.enum([
1037
+ "list",
1038
+ "calendar",
1039
+ "schedule"
1040
+ ]) });
983
1041
  const eventCalendarReadProfile = {
984
1042
  id: "events.calendarReadProfile",
985
1043
  kind: "formatter",
@@ -995,7 +1053,7 @@ const eventCalendarReadEnabled = {
995
1053
  schema: readJobSchema,
996
1054
  run(value, options) {
997
1055
  const plan = resolveEventCalendarReadPlan(asPartialObject(value) ?? {});
998
- return plan.jobs === "both" || plan.jobs === options.job;
1056
+ return plan.jobs === options.job || plan.jobs === "both" && options.job !== "schedule";
999
1057
  }
1000
1058
  };
1001
1059
  //#endregion
@@ -1043,387 +1101,279 @@ const builtinTransformDefinitions = [
1043
1101
  ...linksTransforms,
1044
1102
  ...boxStylesTransforms,
1045
1103
  ...contentTransforms,
1046
- ...headerRuntimeTransforms
1104
+ ...headerRuntimeTransforms,
1105
+ mapDrawingStyleTransform
1047
1106
  ];
1048
1107
  const defaultTransforms = createTransformRegistry(builtinTransformDefinitions);
1049
1108
  //#endregion
1050
- //#region ../blocks/src/pageRenderJoins.ts
1051
- /**
1052
- * Re-points joins across omitted blocks. Pure over joins.
1053
- *
1054
- * Joins are keyed by adjacent block-id pairs, so dropping B from [A, B, C]
1055
- * removes the A→C join as well as B's own, because no A→C join was ever
1056
- * resolved. For each surviving pair the original join is kept when the pair
1057
- * was already adjacent. Across a gap, the treatment comes from the join
1058
- * entering the omitted run (A→first omitted), falling back to the one leaving
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;
1109
+ //#region ../blocks/src/system/data/linkedContentEntries.ts
1110
+ const LINKED_CONTENT_ENTRY_META_KEY = "__rbLinkedContentEntry";
1111
+ function coerceLinkedContentEntriesPayload(payload) {
1112
+ if (!isRecord$1(payload)) return payload;
1113
+ const response = payload;
1114
+ if (!Array.isArray(response.entries)) return payload;
1115
+ const contentType = parsePublicContentTypeMeta(response.contentType);
1116
+ if (!contentType) return response.entries;
1117
+ return response.entries.map((entry) => enrichLinkedContentEntry(entry, contentType));
1097
1118
  }
1098
- /**
1099
- * The single composition site. For every adjacent pair of survivors with ids,
1100
- * finds its join and composes it from both survivors' final content: what
1101
- * each paints with and the frame each draws.
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
- });
1119
+ function getLinkedContentEntryMeta(value) {
1120
+ if (!isRecord$1(value)) return null;
1121
+ const candidate = value[LINKED_CONTENT_ENTRY_META_KEY];
1122
+ return isLinkedContentEntryMeta(candidate) ? candidate : null;
1115
1123
  }
1116
- function composeJoin(join, previous, next) {
1124
+ function buildLinkedContentEditTarget(input) {
1125
+ const { entry, sourceBlockId, sourceBlockKind, itemIndex } = input;
1126
+ if (!isRecord$1(entry)) return null;
1127
+ const meta = getLinkedContentEntryMeta(entry);
1128
+ if (!meta || meta.support.kind !== "supported") return null;
1129
+ const content = isRecord$1(entry.content) ? entry.content : {};
1117
1130
  return {
1118
- boundaryId: pairKey(join.previousBlockId, join.nextBlockId),
1119
- previousBlockId: join.previousBlockId,
1120
- nextBlockId: join.nextBlockId,
1121
- treatment: join.treatment,
1122
- outcome: composeBoundary(sectionFactsForContent(previous.content), sectionFactsForContent(next.content))
1131
+ kind: "linked-content-entry",
1132
+ entryId: meta.entryId,
1133
+ contentTypeKey: meta.contentTypeKey,
1134
+ contentTypeLabel: meta.contentTypeLabel,
1135
+ title: meta.title,
1136
+ optimisticHash: meta.optimisticHash,
1137
+ sourceBlockId: sourceBlockId ?? null,
1138
+ sourceBlockKind: sourceBlockKind ?? null,
1139
+ itemIndex,
1140
+ content: { ...content },
1141
+ contentType: meta.contentType
1123
1142
  };
1124
1143
  }
1125
- /** Placement, reserves and paint for a join that draws; null otherwise. */
1126
- function renderedJoinLayout(join) {
1127
- if (!join || join.outcome.kind !== "shown") return null;
1128
- return boundaryLayout(join.treatment, join.outcome.composition);
1129
- }
1130
- /** Joins with a missing id on either side cannot sit between two blocks. */
1131
- function joinsByPair(joins) {
1132
- return new Map(joins.flatMap((join) => join.previousBlockId && join.nextBlockId ? [[pairKey(join.previousBlockId, join.nextBlockId), join]] : []));
1133
- }
1134
- /** Slot lookup key for an adjacent pair, in the one boundary-id scheme. */
1135
- function joinSlotKey(previousBlockId, nextBlockId) {
1136
- return pairKey(previousBlockId, nextBlockId);
1137
- }
1138
- function pairKey(previousBlockId, nextBlockId) {
1139
- return makeBoundaryId(asDesignBlockId(previousBlockId), asDesignBlockId(nextBlockId));
1140
- }
1141
- //#endregion
1142
- //#region ../blocks/src/pageRenderAdmission.ts
1143
- function toPresentationPage(page) {
1144
- if (!page) return null;
1144
+ function resolveLinkedEntryInlineFieldEligibility(input) {
1145
+ const meta = getLinkedContentEntryMeta(input.entry);
1146
+ if (!meta) return {
1147
+ kind: "read-only",
1148
+ reason: "missing-entry-meta"
1149
+ };
1150
+ if (meta.support.kind !== "supported") return {
1151
+ kind: "read-only",
1152
+ reason: "unsupported-content-type"
1153
+ };
1154
+ const source = resolveLinkedEntryFieldSource(meta, input.displayPath);
1155
+ if (!source) return {
1156
+ kind: "read-only",
1157
+ reason: "unmapped-display-path"
1158
+ };
1159
+ if (source.kind === "read-only") return {
1160
+ kind: "read-only",
1161
+ reason: source.reason
1162
+ };
1163
+ const field = meta.contentType.fields.find((candidate) => candidate.id === source.fieldPath);
1164
+ if (!field) return {
1165
+ kind: "read-only",
1166
+ reason: "missing-field-schema"
1167
+ };
1168
+ const fieldType = resolvePreviewLinkedEntryInlineFieldType(field.type);
1169
+ if (!fieldType || fieldType !== source.fieldType) return {
1170
+ kind: "read-only",
1171
+ reason: "unsupported-field-type"
1172
+ };
1173
+ if (input.renderedNodeType === "richText" && fieldType !== "richText") return {
1174
+ kind: "read-only",
1175
+ reason: "unsupported-field-type"
1176
+ };
1177
+ if (input.renderedNodeType === "text" && fieldType !== "text") return {
1178
+ kind: "read-only",
1179
+ reason: "unsupported-field-type"
1180
+ };
1145
1181
  return {
1146
- ...page,
1147
- blocks: page.blocks.map((block) => {
1148
- const presentationMetadata = {
1149
- id: block.id,
1150
- kind: block.kind,
1151
- purpose: block.purpose,
1152
- ...block.contentVersionId ? { contentVersionId: block.contentVersionId } : {},
1153
- ...block.draftContentId !== void 0 ? { draftContentId: block.draftContentId } : {},
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
- })
1182
+ kind: "editable",
1183
+ displayPath: input.displayPath,
1184
+ write: {
1185
+ kind: "linked-entry-write-field",
1186
+ entryId: meta.entryId,
1187
+ fieldPath: source.fieldPath,
1188
+ fieldType
1189
+ }
1169
1190
  };
1170
1191
  }
1171
- function toEditorPresentationPage(page) {
1172
- if (!page) return null;
1192
+ function enrichLinkedContentEntry(entry, contentType) {
1193
+ if (!isRecord$1(entry)) return entry;
1194
+ const entryId = typeof entry.id === "string" ? entry.id : null;
1195
+ if (!entryId) return entry;
1196
+ const title = typeof entry.title === "string" && entry.title.trim().length > 0 ? entry.title : entryId;
1197
+ const optimisticHash = typeof entry.optimisticHash === "string" && entry.optimisticHash.length > 0 ? entry.optimisticHash : null;
1198
+ const content = isRecord$1(entry.content) ? entry.content : {};
1199
+ const meta = {
1200
+ kind: "linked-content-entry",
1201
+ entryId,
1202
+ contentTypeKey: contentType.key,
1203
+ contentTypeLabel: contentTypeKeyToLabel(contentType.key),
1204
+ title,
1205
+ optimisticHash,
1206
+ support: resolveLinkedContentEditSupport(contentType),
1207
+ contentType,
1208
+ fieldSources: deriveLinkedEntryFieldSources(entry, contentType, content)
1209
+ };
1173
1210
  return {
1174
- ...page,
1175
- blocks: page.blocks.map((block) => ({
1176
- ...block,
1177
- publishedPlacement: block.publishedPlacement,
1178
- presentationAdmission: { kind: "editor" }
1179
- }))
1211
+ ...entry,
1212
+ [LINKED_CONTENT_ENTRY_META_KEY]: meta
1180
1213
  };
1181
1214
  }
1182
- //#endregion
1183
- //#region ../blocks/src/system/customize/facets.ts
1184
- function defineCustomizeFacet(definition) {
1185
- return definition;
1186
- }
1187
- const eventCalendarListLayoutFacet = defineCustomizeFacet({
1188
- blockKind: "block.event-calendar",
1189
- id: "eventCalendar.listLayout",
1190
- label: "List style",
1191
- legacyOnly: true,
1192
- values: eventCalendarListLayoutOptions.map((option) => ({
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"
1215
+ function deriveLinkedEntryFieldSources(entry, contentType, content) {
1216
+ const sources = [];
1217
+ for (const field of contentType.fields) {
1218
+ const fieldType = resolvePreviewLinkedEntryInlineFieldType(field.type);
1219
+ if (!fieldType) {
1220
+ sources.push({
1221
+ kind: "read-only",
1222
+ displayPath: `content.${field.id}`,
1223
+ reason: "unsupported-field-type"
1224
+ });
1225
+ continue;
1298
1226
  }
1299
- ], "auto", true),
1300
- fixedKnob("block.hero", "imagePosition", "Photo side", [{
1301
- value: "left",
1302
- label: "Left"
1303
- }, {
1304
- value: "right",
1305
- label: "Right"
1306
- }], "right"),
1307
- fixedKnob("block.intro", "imageShape", "Media shape", standardImageShapeOptions, "default"),
1308
- fixedKnob("block.intro", "imagePosition", "Photo side", [{
1309
- value: "left",
1310
- label: "Left"
1311
- }, {
1312
- value: "right",
1313
- label: "Right"
1314
- }], "left"),
1315
- fixedKnob("block.media-text", "imagePosition", "Photo side", [{
1316
- value: "left",
1317
- label: "Left"
1318
- }, {
1319
- value: "right",
1320
- label: "Right"
1321
- }], "left"),
1322
- fixedKnob("block.media-text", "imageShape", "Media shape", standardImageShapeOptions, "default"),
1323
- fixedKnob("block.media-text", "aspectRatio", "Media aspect ratio", standardAspectRatioOptions, "auto"),
1324
- textKnob("stickerLine", "Sticker line", 32),
1325
- textKnob("smallCaption", "Small caption", 24),
1326
- {
1327
- ...fixedKnob("block.feature-cards", "showPhotos", "Show photos", onOff, "true", false, true),
1328
- blockKinds: cardListFamilyBlocks
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));
1227
+ sources.push({
1228
+ kind: "content-field",
1229
+ displayPath: `content.${field.id}`,
1230
+ fieldPath: field.id,
1231
+ fieldType
1232
+ });
1233
+ if (field.id === "excerpt" && fieldType === "text" && typeof entry.excerpt === "string" && typeof content.excerpt === "string" && entry.excerpt === content.excerpt) sources.push({
1234
+ kind: "content-field",
1235
+ displayPath: "excerpt",
1236
+ fieldPath: "excerpt",
1237
+ fieldType
1238
+ });
1239
+ if (field.id === contentType.titleField && fieldType === "text" && typeof entry.title === "string" && typeof content[field.id] === "string" && entry.title === content[field.id]) sources.push({
1240
+ kind: "content-field",
1241
+ displayPath: "title",
1242
+ fieldPath: field.id,
1243
+ fieldType
1244
+ });
1245
+ }
1246
+ for (const displayPath of [
1247
+ "title",
1248
+ "slug",
1249
+ "path",
1250
+ "publishedAt",
1251
+ "status",
1252
+ "image"
1253
+ ]) if (displayPath in entry && !sources.some((source) => source.displayPath === displayPath)) sources.push({
1254
+ kind: "read-only",
1255
+ displayPath,
1256
+ reason: displayPath === "image" ? "derived-field" : "route-field"
1257
+ });
1258
+ return sources;
1353
1259
  }
1354
- //#endregion
1355
- //#region ../blocks/src/system/customize/arrangementKnobs.ts
1356
- /**
1357
- * Content stage for knobs, shared by the renderer and the editor so what the
1358
- * options show and what renders can't disagree. Knob buffets are the block's
1359
- * customise facets; the Look exposes, forces or narrows them and the style's
1360
- * offer can only remove or narrow further.
1361
- */
1362
- function resolveArrangementKnobs(input) {
1363
- const length = input.blockKind === "block.hero" ? resolveHeroTitleLength({ ...input.content }, "look") : null;
1364
- const exposure = arrangementKnobExposure(input.blockKind, input.look, length);
1365
- return {
1366
- length,
1367
- exposure,
1368
- knobs: resolveEffectiveKnobs({
1369
- exposure,
1370
- content: normalizedHeadlinePreference(input.content)
1371
- })
1260
+ function resolveLinkedEntryFieldSource(meta, displayPath) {
1261
+ return meta.fieldSources.find((candidate) => candidate.displayPath === displayPath) ?? null;
1262
+ }
1263
+ function resolvePreviewLinkedEntryInlineFieldType(fieldType) {
1264
+ if (fieldType === "richText") return "richText";
1265
+ if (fieldType === "text" || fieldType === "textarea") return "text";
1266
+ return null;
1267
+ }
1268
+ function resolveLinkedContentEditSupport(contentType) {
1269
+ if (contentType.fields.length === 0) return {
1270
+ kind: "unsupported-missing-schema",
1271
+ reason: "Content type has no public field metadata."
1372
1272
  };
1273
+ const metadata = contentType.previewLinkedEntryEditing;
1274
+ if (!metadata) return {
1275
+ kind: "unsupported-content-type",
1276
+ reason: "Content type has not enabled linked-entry preview editing."
1277
+ };
1278
+ switch (metadata.kind) {
1279
+ case "generic": return { kind: "supported" };
1280
+ case "unsupported-domain-backed": return {
1281
+ kind: "unsupported-domain-backed",
1282
+ reason: metadata.reason
1283
+ };
1284
+ default: return assertNever(metadata);
1285
+ }
1373
1286
  }
1374
- function arrangementKnobExposure(blockKind, look, length) {
1375
- return systemCustomizeFacetDefinitionsForBlock(blockKind).flatMap((facet) => {
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
- });
1287
+ function contentTypeKeyToLabel(key) {
1288
+ 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
1289
  }
1393
- function knobKindMetadata(knob) {
1394
- return knob.kind === "fixed" ? { ordered: knob.ordered } : {
1395
- ordered: false,
1396
- textMaxLength: knob.maxLength
1290
+ function capitalize(value) {
1291
+ return value.charAt(0).toUpperCase() + value.slice(1).toLowerCase();
1292
+ }
1293
+ function parsePublicContentTypeMeta(value) {
1294
+ if (!isRecord$1(value)) return null;
1295
+ if (typeof value.key !== "string" || value.key.trim().length === 0) return null;
1296
+ return {
1297
+ key: value.key,
1298
+ titleField: typeof value.titleField === "string" ? value.titleField : null,
1299
+ fields: Array.isArray(value.fields) ? value.fields.flatMap(parsePublicContentTypeFieldMeta) : [],
1300
+ previewLinkedEntryEditing: parsePublicContentTypeLinkedEntryEditing(value.previewLinkedEntryEditing)
1397
1301
  };
1398
1302
  }
1399
- function headlineAllowedValues(length) {
1400
- switch (length) {
1401
- case "long": return ["quiet"];
1402
- case "medium": return ["quiet", "auto"];
1403
- case "short": return [
1404
- "quiet",
1405
- "auto",
1406
- "display"
1407
- ];
1408
- case null: return;
1303
+ function parsePublicContentTypeLinkedEntryEditing(value) {
1304
+ if (!isRecord$1(value) || typeof value.kind !== "string") return null;
1305
+ switch (value.kind) {
1306
+ case "generic": return { kind: "generic" };
1307
+ case "unsupported-domain-backed": return {
1308
+ kind: "unsupported-domain-backed",
1309
+ reason: typeof value.reason === "string" ? value.reason : "Domain-backed entries need a dedicated editor workflow."
1310
+ };
1311
+ default: return null;
1409
1312
  }
1410
1313
  }
1411
- /** `titleSize` keeps its five stored values; under a Look they read as three steps. */
1412
- function normalizedHeadlinePreference(content) {
1413
- switch (content.titleSize) {
1414
- case "editorial": return {
1415
- ...content,
1416
- titleSize: "auto"
1417
- };
1418
- case "poster": return {
1419
- ...content,
1420
- titleSize: "display"
1421
- };
1422
- default: return content;
1314
+ function parsePublicContentTypeFieldMeta(value) {
1315
+ if (!isRecord$1(value)) return [];
1316
+ if (typeof value.id !== "string" || typeof value.type !== "string") return [];
1317
+ return [{
1318
+ id: value.id,
1319
+ type: value.type,
1320
+ mediaKinds: parseStringArray(value.mediaKinds),
1321
+ fileKinds: parseStringArray(value.fileKinds)
1322
+ }];
1323
+ }
1324
+ function parseStringArray(value) {
1325
+ if (value === null || typeof value === "undefined") return null;
1326
+ if (!Array.isArray(value)) return null;
1327
+ return value.filter((item) => typeof item === "string");
1328
+ }
1329
+ function isLinkedContentEntryMeta(value) {
1330
+ if (!isRecord$1(value)) return false;
1331
+ if (value.kind !== "linked-content-entry") return false;
1332
+ if (typeof value.entryId !== "string") return false;
1333
+ if (typeof value.contentTypeKey !== "string") return false;
1334
+ if (typeof value.contentTypeLabel !== "string") return false;
1335
+ if (typeof value.title !== "string") return false;
1336
+ if (!(value.optimisticHash === null || typeof value.optimisticHash === "string")) return false;
1337
+ if (!isRecord$1(value.contentType)) return false;
1338
+ if (!isLinkedEntryFieldSourceArray(value.fieldSources)) return false;
1339
+ return isLinkedContentEditSupport(value.support);
1340
+ }
1341
+ function isLinkedEntryFieldSourceArray(value) {
1342
+ return Array.isArray(value) && value.every(isLinkedEntryFieldSource);
1343
+ }
1344
+ function isLinkedEntryFieldSource(value) {
1345
+ if (!isRecord$1(value)) return false;
1346
+ if (typeof value.displayPath !== "string") return false;
1347
+ switch (value.kind) {
1348
+ case "content-field": return typeof value.fieldPath === "string" && (value.fieldType === "text" || value.fieldType === "richText");
1349
+ case "read-only": return isLinkedEntryInlineFieldReadOnlyReason(value.reason);
1350
+ default: return false;
1423
1351
  }
1424
1352
  }
1425
- function exposedKnobIds(look) {
1426
- return [...look.look.structure.knobs, ...look.addKnobs ?? []].filter((id) => !look.removeKnobs.some((removed) => removed === id));
1353
+ function isLinkedEntryInlineFieldReadOnlyReason(value) {
1354
+ switch (value) {
1355
+ case "missing-entry-meta":
1356
+ case "unsupported-content-type":
1357
+ case "missing-field-schema":
1358
+ case "unsupported-field-type":
1359
+ case "unmapped-display-path":
1360
+ case "route-field":
1361
+ case "derived-field": return true;
1362
+ default: return false;
1363
+ }
1364
+ }
1365
+ function isLinkedContentEditSupport(value) {
1366
+ if (!isRecord$1(value) || typeof value.kind !== "string") return false;
1367
+ switch (value.kind) {
1368
+ case "supported": return true;
1369
+ case "unsupported-domain-backed":
1370
+ case "unsupported-content-type":
1371
+ case "unsupported-missing-schema": return typeof value.reason === "string";
1372
+ default: return false;
1373
+ }
1374
+ }
1375
+ function isRecord$1(value) {
1376
+ return typeof value === "object" && value !== null && !Array.isArray(value);
1427
1377
  }
1428
1378
  //#endregion
1429
1379
  //#region ../blocks/src/sdkBlockTransform.ts
@@ -1452,7 +1402,8 @@ function transformSdkBlockToManifest(sdkBlock) {
1452
1402
  variants: sdkBlock.variants,
1453
1403
  defaultVariant: sdkBlock.defaultVariant,
1454
1404
  variantOptions: sdkBlock.variantOptions,
1455
- previewCustomize: sdkBlock.previewCustomize,
1405
+ promotedFields: sdkBlock.promotedFields,
1406
+ lookField: sdkBlock.lookField,
1456
1407
  behaviours: {
1457
1408
  supportsThemeSwitching: true,
1458
1409
  inlineEditing: hasLayout,
@@ -1533,24 +1484,116 @@ function createCustomBlockRegistry({ sdkConfig, customBlocks = [], policy = defa
1533
1484
  customBlocks,
1534
1485
  policy
1535
1486
  });
1536
- const entriesByKind = new Map(plan.entries.map((entry) => [entry.blockKind, entry]));
1537
- for (const conflict of plan.conflicts) onConflict?.(`Using ${sourceLabel(conflict.winner)} custom block "${conflict.blockKind}" - ${sourceLabel(conflict.loser)} block is fallback only`);
1487
+ const entriesByKind = new Map(plan.entries.map((entry) => [entry.blockKind, entry]));
1488
+ for (const conflict of plan.conflicts) onConflict?.(`Using ${sourceLabel(conflict.winner)} custom block "${conflict.blockKind}" - ${sourceLabel(conflict.loser)} block is fallback only`);
1489
+ return {
1490
+ entries: plan.entries,
1491
+ conflicts: plan.conflicts,
1492
+ findManifest: (blockKind) => {
1493
+ if (!isCustomBlockKind(blockKind)) return void 0;
1494
+ return entriesByKind.get(blockKind);
1495
+ }
1496
+ };
1497
+ }
1498
+ function sourceLabel(source) {
1499
+ switch (source.kind) {
1500
+ case "managed-database": return "DB";
1501
+ case "sdk-synced": return "SDK-synced DB";
1502
+ case "sdk-config": return "SDK config";
1503
+ default: return assertNever(source);
1504
+ }
1505
+ }
1506
+ //#endregion
1507
+ //#region ../blocks/src/pageRenderJoins.ts
1508
+ /**
1509
+ * Re-points joins across omitted blocks. Pure over joins.
1510
+ *
1511
+ * Joins are keyed by adjacent block-id pairs, so dropping B from [A, B, C]
1512
+ * removes the A→C join as well as B's own, because no A→C join was ever
1513
+ * resolved. For each surviving pair the original join is kept when the pair
1514
+ * was already adjacent. Across a gap, the treatment comes from the join
1515
+ * entering the omitted run (A→first omitted), falling back to the one leaving
1516
+ * it (last omitted→C). Nothing visual is carried: the survivors are composed
1517
+ * from their own content afterwards.
1518
+ *
1519
+ * `survivors` are compared by identity against `originalBlocks`.
1520
+ */
1521
+ function retargetJoinsAcrossOmissions(input) {
1522
+ const { joins, originalBlocks, survivingBlocks } = input;
1523
+ if (joins.length === 0) return joins;
1524
+ if (originalBlocks.every((block) => survivingBlocks.has(block))) return joins;
1525
+ const byPair = joinsByPair(joins);
1526
+ const retargeted = [];
1527
+ let previousSurvivor = null;
1528
+ let run = [];
1529
+ for (const block of originalBlocks) {
1530
+ if (!survivingBlocks.has(block)) {
1531
+ run.push(block);
1532
+ continue;
1533
+ }
1534
+ if (previousSurvivor?.id && block.id) {
1535
+ const join = run.length === 0 ? byPair.get(pairKey(previousSurvivor.id, block.id)) : joinAcrossRun(byPair, previousSurvivor.id, block.id, run);
1536
+ if (join) retargeted.push(join);
1537
+ }
1538
+ previousSurvivor = block;
1539
+ run = [];
1540
+ }
1541
+ return retargeted;
1542
+ }
1543
+ function joinAcrossRun(byPair, previousBlockId, nextBlockId, run) {
1544
+ const firstOmittedId = run[0]?.id;
1545
+ const lastOmittedId = run[run.length - 1]?.id;
1546
+ const entering = firstOmittedId ? byPair.get(pairKey(previousBlockId, firstOmittedId)) : void 0;
1547
+ const exiting = lastOmittedId ? byPair.get(pairKey(lastOmittedId, nextBlockId)) : void 0;
1548
+ const donor = entering ?? exiting;
1549
+ return donor ? {
1550
+ previousBlockId,
1551
+ nextBlockId,
1552
+ treatment: donor.treatment
1553
+ } : void 0;
1554
+ }
1555
+ /**
1556
+ * The single composition site. For every adjacent pair of survivors with ids,
1557
+ * finds its join and composes it from both survivors' final content: what
1558
+ * each paints with and the frame each draws.
1559
+ */
1560
+ function composePageJoins(input) {
1561
+ const byPair = joinsByPair(input.joins);
1562
+ return input.survivors.flatMap((previous, index) => {
1563
+ const next = input.survivors[index + 1];
1564
+ if (!next || !previous.id || !next.id) return [];
1565
+ const join = byPair.get(pairKey(previous.id, next.id));
1566
+ return [{
1567
+ previousBlockId: previous.id,
1568
+ nextBlockId: next.id,
1569
+ join: join ? composeJoin(join, previous, next) : null
1570
+ }];
1571
+ });
1572
+ }
1573
+ function composeJoin(join, previous, next) {
1538
1574
  return {
1539
- entries: plan.entries,
1540
- conflicts: plan.conflicts,
1541
- findManifest: (blockKind) => {
1542
- if (!isCustomBlockKind(blockKind)) return void 0;
1543
- return entriesByKind.get(blockKind);
1544
- }
1575
+ boundaryId: pairKey(join.previousBlockId, join.nextBlockId),
1576
+ previousBlockId: join.previousBlockId,
1577
+ nextBlockId: join.nextBlockId,
1578
+ treatment: join.treatment,
1579
+ outcome: composeBoundary(sectionFactsForContent(previous.content), sectionFactsForContent(next.content))
1545
1580
  };
1546
1581
  }
1547
- function sourceLabel(source) {
1548
- switch (source.kind) {
1549
- case "managed-database": return "DB";
1550
- case "sdk-synced": return "SDK-synced DB";
1551
- case "sdk-config": return "SDK config";
1552
- default: return assertNever(source);
1553
- }
1582
+ /** Placement, reserves and paint for a join that draws; null otherwise. */
1583
+ function renderedJoinLayout(join) {
1584
+ if (!join || join.outcome.kind !== "shown") return null;
1585
+ return boundaryLayout(join.treatment, join.outcome.composition);
1586
+ }
1587
+ /** Joins with a missing id on either side cannot sit between two blocks. */
1588
+ function joinsByPair(joins) {
1589
+ return new Map(joins.flatMap((join) => join.previousBlockId && join.nextBlockId ? [[pairKey(join.previousBlockId, join.nextBlockId), join]] : []));
1590
+ }
1591
+ /** Slot lookup key for an adjacent pair, in the one boundary-id scheme. */
1592
+ function joinSlotKey(previousBlockId, nextBlockId) {
1593
+ return pairKey(previousBlockId, nextBlockId);
1594
+ }
1595
+ function pairKey(previousBlockId, nextBlockId) {
1596
+ return makeBoundaryId(asDesignBlockId(previousBlockId), asDesignBlockId(nextBlockId));
1554
1597
  }
1555
1598
  //#endregion
1556
1599
  //#region ../blocks/src/pageRenderPlan.ts
@@ -1708,16 +1751,34 @@ function getBlockOverride(blockKind, overrides) {
1708
1751
  * `site-style-transition-*` styleGroup is dropped; authored values survive.
1709
1752
  */
1710
1753
  function getRenderableContent(block, previewStage = "published") {
1711
- const source = previewStage === "preview" && block.draftContent ? block.draftContent : block.content ?? {};
1712
- return isObjectRecord(source) ? stripStaleTransitionStyleGroup(source) : {};
1754
+ return selectBlockContent(block, previewStage);
1713
1755
  }
1714
1756
  function arrangementRuntime(content) {
1715
- const value = content._arrangementLooks;
1716
- return isObjectRecord(value) && isObjectRecord(value.byMode) && Array.isArray(value.available) && Array.isArray(value.rhythm) ? value : null;
1757
+ const value = parseSurfaceTree(content._arrangementLooks);
1758
+ return isObjectRecord(value) && isObjectRecord(value.byMode) && Array.isArray(value.available) && Array.isArray(value.rhythm) ? restoreArrangementRuntime(value) : null;
1759
+ }
1760
+ /** JSON transports carry resolver inputs; rebuild every surface at this boundary. */
1761
+ function restoreCompiledLook(look) {
1762
+ return {
1763
+ ...look,
1764
+ itemSurfaces: Object.fromEntries(Object.entries(look.itemSurfaces).map(([slot, surface]) => [slot, parseResolvedSurface(surface)])),
1765
+ ...look.roleSurfaces ? { roleSurfaces: {
1766
+ card: parseResolvedSurface(look.roleSurfaces.card),
1767
+ statement: parseResolvedSurface(look.roleSurfaces.statement),
1768
+ highlight: parseResolvedSurface(look.roleSurfaces.highlight)
1769
+ } } : {}
1770
+ };
1771
+ }
1772
+ function restoreArrangementRuntime(runtime) {
1773
+ return {
1774
+ ...runtime,
1775
+ available: runtime.available.map(restoreCompiledLook),
1776
+ byMode: Object.fromEntries(Object.entries(runtime.byMode).map(([mode, look]) => [mode, restoreCompiledLook(look)]))
1777
+ };
1717
1778
  }
1718
1779
  function effectiveLookFromContent(content) {
1719
1780
  const value = content._effectiveLook;
1720
- return isObjectRecord(value) && isObjectRecord(value.look) ? value : null;
1781
+ return isObjectRecord(value) && isObjectRecord(value.look) ? restoreCompiledLook(value) : null;
1721
1782
  }
1722
1783
  function planArrangementContent(blockKind, manifest, content, audience) {
1723
1784
  const runtime = arrangementRuntime(content);
@@ -1760,6 +1821,7 @@ function planArrangementContent(blockKind, manifest, content, audience) {
1760
1821
  }),
1761
1822
  ...arrangementPanelContent(activeContent, effective, mode),
1762
1823
  ...arrangementQuoteContent(blockKind, effective, values),
1824
+ _arrangementLooks: runtime,
1763
1825
  _effectiveLook: effective,
1764
1826
  _lookHooks: arrangementContentHooks(effective, mode, length, {
1765
1827
  ...facts,
@@ -1819,7 +1881,8 @@ function arrangementContentFacts(content) {
1819
1881
  facts: Array.isArray(content.facts) && content.facts.length > 0,
1820
1882
  featured,
1821
1883
  outcome: typeof content.outcome === "string" && content.outcome.length > 0,
1822
- figure: typeof content.figure === "string" && content.figure.trim().length > 0
1884
+ figure: typeof content.figure === "string" && content.figure.trim().length > 0,
1885
+ entrance: isObjectRecord(content.entrancePhoto)
1823
1886
  }
1824
1887
  };
1825
1888
  }
@@ -1828,7 +1891,7 @@ function arrangementPhotoCount(content) {
1828
1891
  if (Array.isArray(content.cards)) return content.cards.filter((card) => isObjectRecord(card) && isObjectRecord(card.media)).length;
1829
1892
  if (Array.isArray(content.members)) return content.members.filter((member) => isObjectRecord(member) && isObjectRecord(member.photo)).length;
1830
1893
  if (Array.isArray(content.images)) return content.images.filter((item) => isObjectRecord(item) && isObjectRecord(item.image)).length;
1831
- if (isObjectRecord(content.media)) return 1;
1894
+ if (isObjectRecord(content.media) || isObjectRecord(content.entrancePhoto)) return 1;
1832
1895
  const section = isObjectRecord(content._sectionStyles) ? content._sectionStyles : {};
1833
1896
  return isObjectRecord((isObjectRecord(section.background) ? section.background : {}).image) ? 1 : 0;
1834
1897
  }
@@ -1979,67 +2042,6 @@ function heroPhotoGround(entry) {
1979
2042
  return entry.kind === "renderable" && entry.block.kind === "block.hero" ? { paintsGround: heroPhotoPaintsGround(entry.effectiveArrangementKey ?? void 0) } : void 0;
1980
2043
  }
1981
2044
  //#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
2045
  //#region ../blocks/src/system/data/utils.ts
2044
2046
  /**
2045
2047
  * Normalize data loaders from block definition
@@ -2052,20 +2054,6 @@ function normalizeDataLoaders(def) {
2052
2054
  }));
2053
2055
  }
2054
2056
  /**
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
2057
  * Normalize params for API calls.
2070
2058
  * Converts supplied values to strings, preserving absent versus explicitly empty params.
2071
2059
  */
@@ -2331,101 +2319,109 @@ function shouldSkipResolvedLoader(input) {
2331
2319
  if (input.loader.requiredParams?.some((param) => !input.params[param]?.trim())) return true;
2332
2320
  return Boolean(input.isValidEndpoint && !input.isValidEndpoint(input.endpoint));
2333
2321
  }
2334
- /**
2335
- * Core data prefetching logic (framework-agnostic).
2336
- *
2337
- * This function is shared between frontend and SDK implementations.
2338
- * It handles:
2339
- * - Extracting data loaders from block definitions
2340
- * - Resolving loader params with block content
2341
- * - Executing server-mode loaders in parallel
2342
- * - Organizing results by block ID and loader key
2343
- *
2344
- * @example
2345
- * ```typescript
2346
- * const resolved = await prefetchBlockData(page, context, {
2347
- * apiClient: async ({ endpoint, params }) => {
2348
- * return await myApiClient({ endpoint, params });
2349
- * },
2350
- * isValidEndpoint: (endpoint) => endpoint in API_ENDPOINTS,
2351
- * });
2352
- * ```
2353
- */
2354
- async function prefetchBlockData$1(page, context, options) {
2355
- return (await prefetchBlockDataWithFailures(page, context, options)).resolvedData;
2356
- }
2357
- async function prefetchBlockDataWithFailures(page, context, options) {
2358
- const { apiClient, isValidEndpoint, onError, getCustomBlockLoaders, getBlockDefinition: getBlockDefinition$1 = getBlockDefinition, resolveParamsBindings: resolveParamsBindings$1 = resolveParamsBindings, shouldLoad } = options;
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 ?? {},
2322
+ async function prefetchBlockDataWithFailures$1(page, context, options) {
2323
+ const runtime = admitLoaderDateRuntime(context);
2324
+ const blocks = page.blocks.flatMap((block) => block.id ? [planBlockRequests(block, block.id, context, options, runtime)] : []);
2325
+ return {
2326
+ ...projectLoaderOutcomes(blocks, await Promise.all(blocks.flatMap((block) => block.requests.map((request) => executeLoaderRequest(request, options))))),
2327
+ loaderSnapshot: {
2328
+ stage: context.previewStage === "preview" ? "draft" : "published",
2329
+ blocks: Object.fromEntries(blocks.map((block) => [block.id, {
2330
+ kind: block.kind,
2331
+ content: block.content,
2332
+ requests: Object.fromEntries(block.requests.map(({ key, endpoint, params }) => [key, {
2333
+ endpoint,
2334
+ params
2335
+ }]))
2336
+ }]))
2337
+ }
2338
+ };
2339
+ }
2340
+ function planBlockRequests(block, id, context, options, runtime) {
2341
+ const definition = (options.getBlockDefinition ?? getBlockDefinition)(block.kind);
2342
+ const loaders = definition ? normalizeDataLoaders(definition) : customLoaders(block.kind, options);
2343
+ const vm = {
2344
+ content: plannedLoaderContent(block, definition, context),
2345
+ $root: {
2346
+ ...context.root,
2380
2347
  siteId: context.siteId,
2381
2348
  pageId: context.pageId,
2382
2349
  previewStage: context.previewStage
2350
+ }
2351
+ };
2352
+ const requests = projectDataLoaders(loaders, options.shouldLoad, id, block.kind).flatMap((entry) => {
2353
+ const request = planLoaderRequest(entry, block, id, vm, options, runtime);
2354
+ return request ? [request] : [];
2355
+ });
2356
+ return {
2357
+ id,
2358
+ kind: block.kind,
2359
+ content: selectBlockContent(block, context.previewStage),
2360
+ requests
2361
+ };
2362
+ }
2363
+ function customLoaders(kind, options) {
2364
+ return Object.entries(options.getCustomBlockLoaders?.(kind) ?? {}).map(([key, loader]) => ({
2365
+ key,
2366
+ loader
2367
+ }));
2368
+ }
2369
+ function planLoaderRequest({ key, loader }, block, blockId, vm, options, runtime) {
2370
+ if (loader.mode === "client") return null;
2371
+ const resolve = options.resolveParamsBindings ?? resolveParamsBindings;
2372
+ const coordinates = { blockKind: block.kind };
2373
+ if (loader.when !== void 0 && resolve(loader.when, vm, coordinates, runtime.dateContext, runtime.now) !== true) return null;
2374
+ const params = normalizeParams(resolve(loader.params, vm, coordinates, runtime.dateContext, runtime.now));
2375
+ if (shouldSkipResolvedLoader({
2376
+ loader,
2377
+ endpoint: loader.endpoint,
2378
+ params,
2379
+ isValidEndpoint: options.isValidEndpoint
2380
+ })) return null;
2381
+ return {
2382
+ blockId,
2383
+ blockKind: block.kind,
2384
+ key,
2385
+ endpoint: loader.endpoint,
2386
+ params
2387
+ };
2388
+ }
2389
+ async function executeLoaderRequest(request, options) {
2390
+ try {
2391
+ return {
2392
+ kind: "loaded",
2393
+ request,
2394
+ data: await fetchLoaderData(options.apiClient, request.endpoint, request.params)
2383
2395
  };
2384
- const vm = {
2385
- content: plannedLoaderContent(block, def, context),
2386
- $root: root
2396
+ } catch (error) {
2397
+ options.onError?.(error, {
2398
+ block: request.blockKind,
2399
+ loader: request.key
2400
+ });
2401
+ return {
2402
+ kind: "failed",
2403
+ request
2387
2404
  };
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
2405
  }
2420
- if (tasks.length > 0) await Promise.all(tasks);
2406
+ }
2407
+ function projectLoaderOutcomes(blocks, outcomes) {
2421
2408
  return {
2422
- resolvedData: results,
2423
- loaderFailures
2409
+ resolvedData: Object.fromEntries(blocks.flatMap((block) => {
2410
+ const values = outcomes.flatMap((outcome) => outcome.request.blockId === block.id && outcome.kind === "loaded" ? [[outcome.request.key, outcome.data]] : []);
2411
+ return values.length ? [[block.id, Object.fromEntries(values)]] : [];
2412
+ })),
2413
+ loaderFailures: Object.fromEntries(blocks.flatMap((block) => {
2414
+ const values = outcomes.flatMap((outcome) => outcome.request.blockId === block.id && outcome.kind === "failed" ? [[outcome.request.key, {
2415
+ endpoint: outcome.request.endpoint,
2416
+ params: outcome.request.params
2417
+ }]] : []);
2418
+ return values.length ? [[block.id, Object.fromEntries(values)]] : [];
2419
+ }))
2424
2420
  };
2425
2421
  }
2426
2422
  /** Prefetch executes the render-plan content stage before resolving loader bindings. */
2427
2423
  function plannedLoaderContent(block, definition, context) {
2428
- const content = normalizeContent(block);
2424
+ const content = selectBlockContent(block, context.previewStage);
2429
2425
  if (!definition || content._arrangementLooks === void 0) return content;
2430
2426
  return planArrangementContent(block.kind, definition.manifest, content, context.previewStage === "preview" ? "authoring" : "public");
2431
2427
  }
@@ -2502,6 +2498,67 @@ function normalizeLoaderParams(endpoint, params, context) {
2502
2498
  ensureSiteId(out, context);
2503
2499
  return out;
2504
2500
  }
2501
+ //#endregion
2502
+ //#region ../theme-core/src/footer/mode.ts
2503
+ const footerModeSchema = z.enum([
2504
+ "default",
2505
+ "blocks",
2506
+ "default+blocks",
2507
+ "none"
2508
+ ]);
2509
+ /** Reads only SDK footer intent; unrelated config and theme fields are not authorities. */
2510
+ function resolveSdkFooterMode(config) {
2511
+ const parsed = z.object({ layout: z.object({ footerMode: footerModeSchema.optional() }).optional() }).safeParse(config);
2512
+ return parsed.success ? parsed.data.layout?.footerMode ?? "default" : "default";
2513
+ }
2514
+ z.object({
2515
+ variant: z.enum([
2516
+ "simple",
2517
+ "columns",
2518
+ "split",
2519
+ "centred"
2520
+ ]),
2521
+ showLogoText: z.boolean().optional(),
2522
+ logo: z.object({
2523
+ showLogo: z.boolean().optional(),
2524
+ showLogoText: z.boolean().optional()
2525
+ }).optional()
2526
+ });
2527
+ /**
2528
+ * Resolve what to render for the footer given the current mode and whether the
2529
+ * site is SDK-managed.
2530
+ *
2531
+ * Backwards compatible: missing/undefined mode is treated as 'default'.
2532
+ */
2533
+ function resolveFooterRenderPlan(params) {
2534
+ if (!params.isSdkSite) return {
2535
+ mode: "default",
2536
+ renderDefaultFooter: true,
2537
+ renderFooterBlocks: false
2538
+ };
2539
+ switch (params.mode ?? "default") {
2540
+ case "blocks": return {
2541
+ mode: "blocks",
2542
+ renderDefaultFooter: false,
2543
+ renderFooterBlocks: true
2544
+ };
2545
+ case "default+blocks": return {
2546
+ mode: "default+blocks",
2547
+ renderDefaultFooter: true,
2548
+ renderFooterBlocks: true
2549
+ };
2550
+ case "none": return {
2551
+ mode: "none",
2552
+ renderDefaultFooter: false,
2553
+ renderFooterBlocks: false
2554
+ };
2555
+ default: return {
2556
+ mode: "default",
2557
+ renderDefaultFooter: true,
2558
+ renderFooterBlocks: false
2559
+ };
2560
+ }
2561
+ }
2505
2562
  z.object({ refreshToken: z.string().min(1).max(4096) }).strict();
2506
2563
  z.object({
2507
2564
  accessToken: z.string().min(1).max(4096),
@@ -2760,48 +2817,13 @@ const sdkCustomBlockInputSchema = z.object({
2760
2817
  fields: fieldDefinitionInputSchema.array().min(1),
2761
2818
  dataLoaders: sdkDataLoadersSchema,
2762
2819
  layout: NodeSchema.optional(),
2763
- variants: z.record(z.string().min(1), NodeSchema).optional(),
2764
- defaultVariant: z.string().min(1).optional(),
2765
- variantOptions: z.record(z.string().min(1), z.object({
2766
- label: z.string().min(1).optional(),
2767
- description: z.string().min(1).optional(),
2768
- icon: z.string().min(1).optional()
2769
- })).optional(),
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) });
2820
+ ...sdkBlockPresentationShape,
2821
+ ...blockSectionDeclarationShape
2822
+ }).superRefine(validateManifestLookField).superRefine(validateSdkBlockDeclaration);
2823
+ const sdkBlockFieldExtensionInputSchema = z.object({
2824
+ fields: fieldDefinitionInputSchema.array().min(1),
2825
+ ...blockSectionDeclarationShape
2826
+ }).superRefine(validateManifestLookField);
2805
2827
  const sdkBlockFieldExtensionsInputSchema = z.record(z.string().min(1), sdkBlockFieldExtensionInputSchema);
2806
2828
  const sdkThemePaletteSchema = z.record(z.string(), z.string());
2807
2829
  const sdkThemeConfigSchema = z.object({ palette: sdkThemePaletteSchema });
@@ -2906,6 +2928,7 @@ const sdkWorkflowsSchema = z.array(sdkWorkflowConfigSchema).max(50, "Maximum 50
2906
2928
  }, { message: "Workflow IDs must be unique" }).optional();
2907
2929
  const riverbankSiteConfigInputSchema = z.object({
2908
2930
  siteId: z.string().uuid(),
2931
+ builtInBlocks: builtInBlockKindsSchema.optional(),
2909
2932
  previewUrl: z.string().url().optional(),
2910
2933
  liveUrl: z.string().url().optional(),
2911
2934
  theme: sdkThemeConfigSchema.optional(),
@@ -3319,11 +3342,12 @@ const appointmentSetupVenueChoiceSchema = z.discriminatedUnion("kind", [
3319
3342
  title: z.string().trim().min(1),
3320
3343
  description: z.string().nullable(),
3321
3344
  timezone: z.string().trim().min(1).nullable(),
3322
- addressJson: z.record(z.string(), z.unknown()),
3345
+ locationValue: locationValueSchema.nullable().optional(),
3346
+ addressJson: z.record(z.string(), z.unknown()).optional(),
3323
3347
  locationJson: z.object({
3324
3348
  lat: z.number(),
3325
3349
  lng: z.number()
3326
- }).nullable()
3350
+ }).nullable().optional()
3327
3351
  })
3328
3352
  ]);
3329
3353
  const appointmentSetupPaymentDraftSchema = z.discriminatedUnion("kind", [
@@ -3652,6 +3676,11 @@ function isNavigationMenuValidationItem(value) {
3652
3676
  }
3653
3677
  //#endregion
3654
3678
  //#region ../api/src/aiPlayground.ts
3679
+ const PreparedPagePreconditionSchema = z.object({
3680
+ schemaVersion: z.literal(1),
3681
+ pageId: z.string().uuid(),
3682
+ fingerprint: z.string().regex(/^[a-f0-9]{64}$/)
3683
+ }).strict();
3655
3684
  /**
3656
3685
  * RFC-6902 JSON Patch Operations
3657
3686
  * Standard JSON Patch format for AI Playground content updates
@@ -3701,7 +3730,7 @@ const Rfc6902PatchOp = z.discriminatedUnion("op", [
3701
3730
  })
3702
3731
  ]);
3703
3732
  z.object({ request: z.string().min(1).max(2e3) });
3704
- const MultiPagePatchEnvelope = z.object({
3733
+ const ModelMultiPagePatchEnvelope = z.object({
3705
3734
  pageId: z.string(),
3706
3735
  blockId: z.string().optional(),
3707
3736
  blockKind: z.string().optional(),
@@ -3710,12 +3739,15 @@ const MultiPagePatchEnvelope = z.object({
3710
3739
  rationale: z.string(),
3711
3740
  currentContent: z.record(z.string(), z.unknown()).optional()
3712
3741
  });
3713
- z.object({
3714
- patches: z.array(MultiPagePatchEnvelope),
3742
+ const ModelMultiPageUpdateResponse = z.object({
3743
+ patches: z.array(ModelMultiPagePatchEnvelope),
3715
3744
  assistantMessage: z.string(),
3716
3745
  pagesModified: z.number(),
3717
3746
  toolCallsUsed: z.number()
3718
3747
  });
3748
+ /** Server-stamped wire proposals always carry their original page evidence. */
3749
+ const MultiPagePatchEnvelope = ModelMultiPagePatchEnvelope.extend({ preparedAgainst: PreparedPagePreconditionSchema });
3750
+ ModelMultiPageUpdateResponse.extend({ patches: z.array(MultiPagePatchEnvelope) });
3719
3751
  //#endregion
3720
3752
  //#region ../api/src/siteTerms.ts
3721
3753
  const versionIdSchema = z.string().uuid().transform((value, ctx) => {
@@ -3798,10 +3830,6 @@ const SUPPORTED_LOADER_ENDPOINTS = SUPPORTED_LOADER_ENDPOINTS$1;
3798
3830
  function isSupportedLoaderEndpoint(endpoint) {
3799
3831
  return SUPPORTED_LOADER_ENDPOINTS.includes(endpoint);
3800
3832
  }
3801
- const defaultPrefetchBlockDataDeps = {
3802
- prefetchBlockDataCore: prefetchBlockData$1,
3803
- normalizeLoaderParams
3804
- };
3805
3833
  const ENTRY_REF_KEYS = [
3806
3834
  "identifier",
3807
3835
  "entryIdentifier",
@@ -4042,42 +4070,17 @@ async function getPublicWeeklySlotAvailability({ client, params }) {
4042
4070
  timezone: readStringParam(params, "timezone")
4043
4071
  });
4044
4072
  }
4045
- /**
4046
- * Prefetch block data for SDK-based applications.
4047
- * Maps loader endpoints to corresponding SDK client methods.
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);
4073
+ /** Rendering consumers retain the request identity with the loaded values. */
4074
+ async function prefetchBlockDataWithFailures(page, context, client, options) {
4075
+ return prefetchBlockDataWithFailures$1(page, context, sdkPrefetchOptions(normalizeLoaderParams, context, client, options));
4073
4076
  }
4074
- async function prefetchBlockDataWithDeps(deps, page, context, client, options) {
4077
+ function sdkPrefetchOptions(normalize, context, client, options) {
4075
4078
  const { customBlocks } = options ?? {};
4076
4079
  const customBlockMap = new Map((customBlocks ?? []).map((block) => [block.id, block]));
4077
- return deps.prefetchBlockDataCore(page, context, {
4080
+ return {
4078
4081
  apiClient: async ({ endpoint, params }) => {
4079
4082
  if (!isSupportedLoaderEndpoint(endpoint)) throw new Error(`Unsupported loader endpoint: ${endpoint}. SDK only supports: ${SUPPORTED_LOADER_ENDPOINTS.join(", ")}`);
4080
- const resolvedParams = deps.normalizeLoaderParams(endpoint, params, context);
4083
+ const resolvedParams = normalize(endpoint, params, context);
4081
4084
  return materializeLoaderMedia(await loaderAdapters[endpoint]({
4082
4085
  client,
4083
4086
  params: resolvedParams
@@ -4091,20 +4094,17 @@ async function prefetchBlockDataWithDeps(deps, page, context, client, options) {
4091
4094
  error
4092
4095
  });
4093
4096
  },
4094
- getCustomBlockLoaders: (blockKind) => {
4095
- const customBlock = customBlockMap.get(blockKind);
4096
- if (!customBlock?.dataLoaders) return void 0;
4097
- const loaders = {};
4098
- for (const [key, loader] of Object.entries(customBlock.dataLoaders)) loaders[key] = {
4099
- endpoint: loader.endpoint,
4100
- params: loader.params,
4101
- requiredParams: loader.requiredParams,
4102
- mode: loader.mode,
4103
- when: loader.when
4104
- };
4105
- return loaders;
4106
- }
4107
- });
4097
+ getCustomBlockLoaders: (kind) => sdkCustomLoaders(customBlockMap.get(kind))
4098
+ };
4099
+ }
4100
+ function sdkCustomLoaders(block) {
4101
+ return block?.dataLoaders ? Object.fromEntries(Object.entries(block.dataLoaders).map(([key, loader]) => [key, {
4102
+ endpoint: loader.endpoint,
4103
+ params: loader.params,
4104
+ requiredParams: loader.requiredParams,
4105
+ mode: loader.mode,
4106
+ when: loader.when
4107
+ }])) : void 0;
4108
4108
  }
4109
4109
  //#endregion
4110
- export { resolvePageRouteTarget as C, parseStoredVariant as D, resolveLinkedEntryInlineFieldEligibility as E, isCanonicalRichTextDoc as O, resolveEntryRouteTarget as S, buildLinkedContentEditTarget as T, renderedJoinLayout as _, SDK_WORKFLOW_ENDPOINT_PATTERN as a, defaultTransforms as b, navigationLinkInputSchemaOptions as c, resolveSdkFooterMode as d, buildPageRenderPlan as f, joinSlotKey as g, composePageJoins as h, collectPortalLinkStats as i, footerModeSchema as l, toPresentationPage as m, prefetchBlockData as n, SDK_WORKFLOW_ID_PATTERN as o, toEditorPresentationPage as p, collectCartLinkStats as r, loaderFallbackScalarSchema as s, SUPPORTED_LOADER_ENDPOINTS as t, resolveFooterRenderPlan as u, retargetJoinsAcrossOmissions as v, resolveRouteTarget as w, resolveAuthoredLinkHref as x, builtinTransformDefinitions as y };
4110
+ 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 };