@riverbankcms/sdk 0.160.0 → 0.162.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (209) hide show
  1. package/dist/_dts/{BlocksIslandsHydrator-CoqeotCL.d.ts → BlocksIslandsHydrator-PZUoA872.d.ts} +1 -1
  2. package/dist/_dts/{Page-C0ENVLCF.d.ts → Page-CdQS6C7i.d.ts} +211 -9
  3. package/dist/_dts/{SdkPreviewMode-jZK0A49V.d.ts → SdkPreviewMode-CNGO-5f1.d.ts} +59 -92
  4. package/dist/_dts/{auth-contract-FPg0-2MC.d.ts → auth-contract-CgJ5nMaH.d.ts} +2 -0
  5. package/dist/_dts/{client-uMMuPq9V.d.ts → client-DGa53rjL.d.ts} +11 -3
  6. package/dist/_dts/{content-types-D6nXGqdQ.d.ts → content-types-K9R7P-KF.d.ts} +2 -2
  7. package/dist/_dts/{contracts-Bnmj1nxu.d.ts → contracts-CyBaPaIq.d.ts} +17 -5
  8. package/dist/_dts/{footerPageOutline-CeLjFX8b.d.ts → footerPageOutline-B6jmKmon.d.ts} +6 -6
  9. package/dist/_dts/{generatePageMetadata-nyU8q02J.d.ts → generatePageMetadata-iemoR3AN.d.ts} +2 -2
  10. package/dist/_dts/{index-BaaGBY1v.d.ts → index-8CN0Nd-Z.d.ts} +2 -2
  11. package/dist/_dts/{index-nVoi_74l.d.ts → index-BtnsA14K.d.ts} +10 -20
  12. package/dist/_dts/{index-lkpjIg5i.d.ts → index-C39F9KaB.d.ts} +13 -2
  13. package/dist/_dts/{index-C5xslEBn.d.ts → index-DEu85xBt.d.ts} +1 -1
  14. package/dist/_dts/{schema-D0bNcPWK.d.ts → index-DI2yaSPY.d.ts} +22873 -19918
  15. package/dist/_dts/{types-D8czmbQF.d.ts → index-Dbd0Sn0G.d.ts} +4356 -1827
  16. package/dist/_dts/{index-CEaKil7G.d.ts → index-Du1IRglc.d.ts} +2 -2
  17. package/dist/_dts/{index-DahMwisK.d.ts → index-Jlcq6w69.d.ts} +3 -3
  18. package/dist/_dts/{index-Bg64CkV-.d.ts → index-Wm62sXf2.d.ts} +4 -4
  19. package/dist/_dts/{loadContent-CYLmzvLq.d.ts → loadContent-BPfAAZDW.d.ts} +13 -10
  20. package/dist/_dts/{resolvePageContent-DqnxChOs.d.ts → resolvePageContent-DWbrtKf8.d.ts} +2 -2
  21. package/dist/_dts/sdk/src/bookings/index.d.ts +2 -2
  22. package/dist/_dts/sdk/src/client/types.d.ts +2 -2
  23. package/dist/_dts/sdk/src/client.d.ts +7 -7
  24. package/dist/_dts/sdk/src/config/index.d.ts +6 -6
  25. package/dist/_dts/sdk/src/config/template-validation.d.ts +1 -1
  26. package/dist/_dts/sdk/src/config/validation.d.ts +1 -1
  27. package/dist/_dts/sdk/src/index.d.ts +8 -8
  28. package/dist/_dts/sdk/src/manifest/index.d.ts +3 -3
  29. package/dist/_dts/sdk/src/metadata/index.d.ts +1 -1
  30. package/dist/_dts/sdk/src/navigation/index.d.ts +2 -2
  31. package/dist/_dts/sdk/src/next/index.d.ts +7 -7
  32. package/dist/_dts/sdk/src/next/middleware.d.ts +2 -2
  33. package/dist/_dts/sdk/src/page-converter/index.d.ts +3 -3
  34. package/dist/_dts/sdk/src/portal/client.d.ts +1 -1
  35. package/dist/_dts/sdk/src/prebuild/index.d.ts +1 -1
  36. package/dist/_dts/sdk/src/preview-next/before-render.d.ts +2 -2
  37. package/dist/_dts/sdk/src/preview-next/client/index.d.ts +2 -2
  38. package/dist/_dts/sdk/src/preview-next/client/runtime.d.ts +1 -1
  39. package/dist/_dts/sdk/src/preview-next/keep-alive.d.ts +1 -1
  40. package/dist/_dts/sdk/src/preview-next/session.d.ts +2 -2
  41. package/dist/_dts/sdk/src/rendering/client.d.ts +2 -2
  42. package/dist/_dts/sdk/src/rendering/index.d.ts +6 -6
  43. package/dist/_dts/sdk/src/rendering/islands/client.d.ts +1 -1
  44. package/dist/_dts/sdk/src/rendering/server.d.ts +2 -2
  45. package/dist/_dts/sdk/src/routing/index.d.ts +5 -5
  46. package/dist/_dts/sdk/src/server.d.ts +5 -5
  47. package/dist/_dts/sdk/src/theme/index.d.ts +1 -1
  48. package/dist/_dts/{session-Ba2CsnK5.d.ts → session-C_gtSFyZ.d.ts} +2 -1
  49. package/dist/_dts/{types-DSgmJ15W.d.ts → types-CVv2H4AT.d.ts} +7 -7
  50. package/dist/_dts/{types-CFrYuXYP.d.ts → types-CfNG5koF.d.ts} +4 -2
  51. package/dist/_dts/{types-Dm-KW7nj.d.ts → types-ClZ-BQL_.d.ts} +3 -3
  52. package/dist/_dts/{validation-Bmb4WnHg.d.ts → validation-BJ6Lf_Dr.d.ts} +4 -4
  53. package/dist/client/{BlocksIslandsHydrator-DZRKi6tT.mjs → BlocksIslandsHydrator-COqlgWYU.mjs} +23 -21
  54. package/dist/client/{BookingMailingListNote-C00sLLdL.mjs → BookingMailingListNote-CFYPDEHH.mjs} +1 -1
  55. package/dist/client/{CalendarNavigationChevron-CHSi9b3E.mjs → CalendarNavigationChevron-COBVxgHb.mjs} +6 -6
  56. package/dist/client/{CheckboxChoice-Bhm6RAUL.mjs → CheckboxChoice-C7X9dJ8A.mjs} +1 -1
  57. package/dist/client/{DemoBookingPortalAccess-CaN-7ui7.mjs → DemoBookingPortalAccess-CvT0E9AR.mjs} +26 -10
  58. package/dist/client/{DemoPortalSignInLink-ClxN5_xZ.mjs → DemoPortalSignInLink-EBOBN5dT.mjs} +1 -1
  59. package/dist/client/{EventCalendar.client-BncvSa1n.mjs → EventCalendar.client-U6pKcntV.mjs} +16 -17
  60. package/dist/client/{EventCombined.client-DluBxVVu.mjs → EventCombined.client-CNzwEHws.mjs} +8 -8
  61. package/dist/client/{EventEmbeddedCheckoutStep-BiJrMtfp.mjs → EventEmbeddedCheckoutStep-B9yAWV_k.mjs} +1 -1
  62. package/dist/client/{EventItem-CXhnT9pF.mjs → EventItem-M5rpaHxi.mjs} +4 -4
  63. package/dist/client/{EventListWeekNavigation-V-dtoDlD.mjs → EventListWeekNavigation-D4ieBLDY.mjs} +1 -1
  64. package/dist/client/{EventListing.client-DPO6SZbx.mjs → EventListing.client-B8F40Rmn.mjs} +3 -3
  65. package/dist/client/{EventListing.view-B-Yi5JZS.mjs → EventListing.view-k4lhuCn5.mjs} +15 -6
  66. package/dist/client/{EventRegistrationPayment-Dc3Fnlnw.mjs → EventRegistrationPayment-C3g8_Hqb.mjs} +25 -13
  67. package/dist/client/LocationMapActions-CAjt7qVo.mjs +62 -0
  68. package/dist/client/MapDrawingSvg-_aIK2ojv.mjs +200 -0
  69. package/dist/client/{Page-7PkzO04N.mjs → Page-DJBIQBOw.mjs} +2555 -536
  70. package/dist/client/{StepIndicator-DiD6euZ8.mjs → StepIndicator-CFacB1z6.mjs} +2 -2
  71. package/dist/client/{TabBarFragment-BHd8GN8y.mjs → TabBarFragment-BLsfQskO.mjs} +1 -1
  72. package/dist/client/ThemedButton-BWsDgjMC.mjs +2243 -0
  73. package/dist/client/{accordion-2m27DsIk.mjs → accordion-CtO2XF7M.mjs} +1 -1
  74. package/dist/client/{booking-form.client-BddWV5w1.mjs → booking-form.client-RICCQ0h2.mjs} +137 -60
  75. package/dist/client/{bookingForm-bcdXQjmw.mjs → bookingForm-SvjLPx8i.mjs} +4 -4
  76. package/dist/client/bookings.mjs +5 -5
  77. package/dist/client/{carousel-D7nj9I0y.mjs → carousel-BR-zCD3O.mjs} +2 -2
  78. package/dist/client/{carousel.client-AffDJo_s.mjs → carousel.client-CEWtoZd3.mjs} +1 -1
  79. package/dist/client/{cart-PN6yCw1H.mjs → cart-C6YpKbZZ.mjs} +3 -3
  80. package/dist/client/{cart.client-D4t1f0cJ.mjs → cart.client-dC938WrX.mjs} +1 -1
  81. package/dist/client/{checkout-CsTwXVSb.mjs → checkout-Dy9RlREI.mjs} +3 -3
  82. package/dist/client/{checkout.client-BhQE3zY7.mjs → checkout.client-CefG0d2F.mjs} +1 -1
  83. package/dist/client/client.mjs +37 -71
  84. package/dist/client/{context-BLAvalAa.mjs → context-BFwxgZpB.mjs} +28 -1
  85. package/dist/client/{cta-CUXhX_D7.mjs → cta-DtA42Xio.mjs} +1 -1
  86. package/dist/client/{dateFormatting-BHIHxNuo.mjs → dateFormatting-yP1B7F0O.mjs} +39 -2
  87. package/dist/client/{demoPortalMagicLink-R-awbk_0.mjs → demoPortalMagicLink-WOiT5Ryi.mjs} +1 -1
  88. package/dist/client/{enhanceHeaderSection-9Q93uvTo.mjs → enhanceHeaderSection-Dh8c_Lq-.mjs} +3 -3
  89. package/dist/client/{event-details.client-BS1WtG-a.mjs → event-details.client-BFgsLqTj.mjs} +3 -17
  90. package/dist/client/{event-registration.client-BXndwsET.mjs → event-registration.client-BaXZ1-Ky.mjs} +16 -16
  91. package/dist/client/{eventCalendar-HyoOt1Qz.mjs → eventCalendar-COLwF80U.mjs} +4 -4
  92. package/dist/client/{eventCombined-sdG5oEaH.mjs → eventCombined-D3Ltwu03.mjs} +4 -4
  93. package/dist/client/{eventDetails-FFAknE4w.mjs → eventDetails-CBrkimXu.mjs} +2 -2
  94. package/dist/client/{eventListing-CGK6urk3.mjs → eventListing-CedKVA1S.mjs} +4 -4
  95. package/dist/client/{eventRegistration-VhrvCs4l.mjs → eventRegistration-DkQQfR1b.mjs} +4 -4
  96. package/dist/client/{form-C-B5O_ko.mjs → form-XFy9uXSJ.mjs} +3 -3
  97. package/dist/client/{form.client-DoZVcl8d.mjs → form.client-B0iancFK.mjs} +4 -4
  98. package/dist/client/{form.parts-mttKpgif.mjs → form.parts-DMbolu9Y.mjs} +3 -3
  99. package/dist/client/{formatDate-xUSCknEO.mjs → formatDate-Jm5MQOCA.mjs} +1 -1
  100. package/dist/client/gifting/client.mjs +3 -3
  101. package/dist/client/{headerSection-BHUEXsaI.mjs → headerSection-WjlECjtV.mjs} +2 -2
  102. package/dist/client/{mediaAssets-BOj-Co0B.mjs → mediaAssets-BkoW_PEn.mjs} +1 -1
  103. package/dist/client/{mediaContext-DThoeEBU.mjs → mediaContext-CNzWmoA4.mjs} +1 -1
  104. package/dist/client/{newsletter-form.client-D_n0rftg.mjs → newsletter-form.client-D-XwJTjN.mjs} +5 -5
  105. package/dist/client/{newsletter-form.parts-DKHye4IE.mjs → newsletter-form.parts-H92f30y0.mjs} +2 -2
  106. package/dist/client/{newsletterForm-tEaYelzx.mjs → newsletterForm-DMuxzu6I.mjs} +3 -3
  107. package/dist/client/{noop-B610YKEx.mjs → noop-B3RNPVrt.mjs} +313 -3
  108. package/dist/client/portal/client.mjs +1116 -85
  109. package/dist/client/{product-detail.client-DUf5x5Jt.mjs → product-detail.client-B3HuuykE.mjs} +1 -1
  110. package/dist/client/{product-list.client-Cqp1BPTV.mjs → product-list.client-CzsDrHQO.mjs} +1 -1
  111. package/dist/client/{productDetail-B8bBiogP.mjs → productDetail-CbBUVWgd.mjs} +3 -3
  112. package/dist/client/{productList-BKN4D-1z.mjs → productList-vqOKH2mh.mjs} +3 -3
  113. package/dist/client/{propsDecoder-2nNZh2Oe.mjs → propsDecoder-CkSUep5a.mjs} +4 -28
  114. package/dist/client/{registry.server-BAm4RPNJ.mjs → registry.server-cZ24QwtW.mjs} +607 -210
  115. package/dist/client/rendering/client.mjs +28 -28
  116. package/dist/client/rendering/islands.mjs +1 -1
  117. package/dist/client/rendering.mjs +18 -9
  118. package/dist/client/{richText-coerce-Cv-qomNB.mjs → richText-coerce-DDcCKvBJ.mjs} +1 -1
  119. package/dist/client/{routeIslandApiConfig-C5u8MbAA.mjs → routeIslandApiConfig-DYBioANh.mjs} +1 -1
  120. package/dist/client/{ThemedButton-C22C9cCF.mjs → schema-DNHLlze-.mjs} +7307 -8363
  121. package/dist/client/{shop-DZNC0VKk.mjs → shop-CF0dhnfH.mjs} +3 -3
  122. package/dist/client/{shop-commerce-DdX4LSa3.mjs → shop-commerce-DQznNBEo.mjs} +11 -11
  123. package/dist/client/{shop-commerce-store-BJtrZov9.mjs → shop-commerce-store-Ba8zPlIg.mjs} +1 -1
  124. package/dist/client/{shop.client-DmDd-igg.mjs → shop.client-DqfYoqWH.mjs} +12 -12
  125. package/dist/client/{shop.interactive-5SnnDHz3.mjs → shop.interactive-CreQ0I7i.mjs} +38 -183
  126. package/dist/client/{shopShared-CPqUlAh9.mjs → shopShared-D-yh-P7g.mjs} +2 -2
  127. package/dist/client/site-styles-B9HgmY07.mjs +11619 -0
  128. package/dist/client/{timetableModel-C19rcHEw.mjs → timetableModel-DCdVErTJ.mjs} +149 -8
  129. package/dist/client/{useAvailableSlots-BjbJXotk.mjs → useAvailableSlots-Cvgdp2DH.mjs} +8 -11
  130. package/dist/client/{useBookingNowIso-CMgfL7YJ.mjs → useBookingNowIso-DrTnGNzD.mjs} +1 -1
  131. package/dist/client/{useDiscountApply-KG8jB7WC.mjs → useDiscountApply-CULjnXGl.mjs} +2 -2
  132. package/dist/client/{useDiscountCodeUi-DK2w_i0a.mjs → useDiscountCodeUi-Gn_m7e0o.mjs} +1 -1
  133. package/dist/client/{useEventPagination-DW6MCirb.mjs → useEventPagination-CsysCF22.mjs} +8 -21
  134. package/dist/client/{view-CseyBW07.mjs → view-BpBjo9Te.mjs} +71 -59
  135. package/dist/client/{view-CkUn3Y0Y.mjs → view-DMyTchi7.mjs} +4 -4
  136. package/dist/client/wizardSteps-BO2OmMO9.mjs +6604 -0
  137. package/dist/preview-next/before-render.mjs +7 -6
  138. package/dist/preview-next/chrome.css +2 -0
  139. package/dist/preview-next/client/{EventEmbeddedCheckoutStep-lUHBrzHv.mjs → EventEmbeddedCheckoutStep-DLsSmZbO.mjs} +2 -1
  140. package/dist/preview-next/client/LocationPickerEnvironment-QtSG2Bl-.mjs +138 -0
  141. package/dist/preview-next/client/MapLibreEditMap-B-rohNcG.mjs +488 -0
  142. package/dist/preview-next/client/{PreviewEditorSidebar-DWyUGCAG.mjs → PreviewEditorSidebar-ChrW9VEo.mjs} +269 -1100
  143. package/dist/preview-next/client/{PreviewEditorUI-Wq0b3Daw.mjs → PreviewEditorUI-VaHvYtrA.mjs} +10 -190
  144. package/dist/preview-next/client/{SdkPreviewModeRuntime-BtZPcwYV.mjs → SdkPreviewModeRuntime-Bz7jR6nl.mjs} +1 -1
  145. package/dist/preview-next/client/{SdkPreviewModeRuntime-wSI_R361.mjs → SdkPreviewModeRuntime-DWwktlWs.mjs} +639 -536
  146. package/dist/preview-next/client/{ThemedButton-DzeycIlD.mjs → ThemedButton-CHKOWXxl.mjs} +1706 -692
  147. package/dist/preview-next/client/lucide-react-CA9cpo0P.mjs +51984 -0
  148. package/dist/preview-next/client/maplibre-gl-DykfOYYn.mjs +34208 -0
  149. package/dist/preview-next/client/{SiteChromeCustomizeContext-Hc4pYnNe.mjs → previewAuthStore-C0VUwEHz.mjs} +81363 -136296
  150. package/dist/preview-next/client/{previewChromeSurface-Corq4AG7.mjs → previewChromeSurface-Dhyx2YrS.mjs} +1 -1
  151. package/dist/preview-next/client/result-BjJUoxUF.mjs +16 -0
  152. package/dist/preview-next/client/rolldown-runtime-CE6sIgz8.mjs +34 -0
  153. package/dist/preview-next/client/runtime.mjs +3 -3
  154. package/dist/preview-next/client/{sdk-runtime-CWymRWhK.mjs → sdk-runtime-C2GWOCyj.mjs} +1 -1
  155. package/dist/preview-next/client/siteStyleAccess-DHyzUpv4.mjs +12833 -0
  156. package/dist/preview-next/client/{spinner-C4If5Y-O.mjs → spinner-BeR2S8oG.mjs} +2 -1
  157. package/dist/preview-next/{constants-D8Ya7bO4.mjs → constants-Bf-vqdKH.mjs} +2 -1
  158. package/dist/preview-next/editor-base.css +2 -2
  159. package/dist/preview-next/keepAlive.mjs +3 -3
  160. package/dist/preview-next/middleware.mjs +7 -3
  161. package/dist/preview-next/{refresh-contract-CvmNqZ1Q.mjs → refresh-contract-uQ6BXgLJ.mjs} +5 -0
  162. package/dist/preview-next/{route-contract-8csADeIT.mjs → route-contract-CkrFDMrl.mjs} +434 -203
  163. package/dist/preview-next/{session-BgkrPqu0.mjs → session-P1R_ajT7.mjs} +12 -2
  164. package/dist/preview-next/session.mjs +1 -1
  165. package/dist/server/{Block.shared-D1_gonwM.mjs → Block.shared-DxvNGDig.mjs} +4 -4
  166. package/dist/server/{bindings-CFmJg5lm.mjs → bindings-BuhKvYkE.mjs} +2 -1
  167. package/dist/server/{client-DPsi0Dai.mjs → client-BobW6DOz.mjs} +39 -72
  168. package/dist/server/config-validation.mjs +1 -1
  169. package/dist/server/config.mjs +2 -2
  170. package/dist/server/{siteChromeOverlayClearance-DALIAMwo.mjs → effectiveNavLinkStyle-B-MKSt0p.mjs} +2060 -1680
  171. package/dist/server/index.mjs +3 -3
  172. package/dist/server/{loadContent-RMCcuVU_.mjs → loadContent-CCG_3mbY.mjs} +14 -5
  173. package/dist/server/loadPage-Bk9HDh9K.mjs +2 -0
  174. package/dist/server/{loadPage-DhDGzj7t.mjs → loadPage-jntGoMrf.mjs} +3 -2
  175. package/dist/server/next.mjs +9 -9
  176. package/dist/server/{overrideResolution-OxY5FMuy.mjs → overrideResolution-BBOlgn4Z.mjs} +1 -1
  177. package/dist/server/{overrides-Bz_A6sB9.mjs → overrides-DByQwIyW.mjs} +803 -412
  178. package/dist/server/page-converter.mjs +1 -1
  179. package/dist/server/{prebuild-B_1vrSru.mjs → prebuild-DrwcTk2t.mjs} +1 -1
  180. package/dist/server/prebuild.mjs +1 -1
  181. package/dist/server/{prefetchBlockData-B7ukYXXR.mjs → prefetchBlockData-LfgxSJYE.mjs} +156 -89
  182. package/dist/server/{publicProducts-Djbpc81A.mjs → publicProducts-8A3T5v4M.mjs} +685 -166
  183. package/dist/server/{registry-eFjKtEhF.mjs → registry-Digv02oV.mjs} +780 -1052
  184. package/dist/server/rendering/server.mjs +4 -4
  185. package/dist/server/rendering.mjs +8 -8
  186. package/dist/server/{resolveBlockData-DYvEa9c5.mjs → resolveBlockData-C23t8-77.mjs} +1 -1
  187. package/dist/server/routing.mjs +1 -1
  188. package/dist/server/{schema-C3dJ5UkL.mjs → schema-BiqpDRwB.mjs} +4805 -3561
  189. package/dist/server/server.mjs +3 -3
  190. package/dist/server/site-styles-DrkprQPL.mjs +755 -0
  191. package/dist/server/siteChromeOverlayClearance-BmKKkkbh.mjs +750 -0
  192. package/dist/server/{src-C5Mu-z0F.mjs → src-08GY1njw.mjs} +1060 -44
  193. package/dist/server/theme-bridge.mjs +1 -1
  194. package/dist/server/theme.mjs +1 -1
  195. package/dist/server/{themeAdmission-ruoyXb_0.mjs → themeAdmission-CSd_Vusz.mjs} +151 -53
  196. package/dist/server/{validation-B-Xar8QS.mjs → validation-DdUTkBOZ.mjs} +2 -2
  197. package/dist/server/{version-Bg7VHK3i.mjs → version-DdIOqIDe.mjs} +1 -1
  198. package/dist/styles/index.css +1029 -41
  199. package/package.json +1 -1
  200. package/dist/_dts/index-Blwl7yl6.d.ts +0 -13
  201. package/dist/client/LeafletStaticMap-ClZCCzAm.mjs +0 -135
  202. package/dist/client/location-map.client-Cylb_MHw.mjs +0 -28
  203. package/dist/client/location-map.view-Cx4Bl7ij.mjs +0 -345
  204. package/dist/client/locationMap-QnKJi-nZ.mjs +0 -15
  205. package/dist/client/renderableMediaAssetAdmission-DGjBr_e-.mjs +0 -152
  206. package/dist/client/wizardSteps-zgq10lN1.mjs +0 -17181
  207. package/dist/preview-next/client/siteStyleAccess-QZkJRHl5.mjs +0 -1359
  208. package/dist/server/loadPage-DUPP51C-.mjs +0 -2
  209. package/dist/server/media-CcHwZkdJ.mjs +0 -243
@@ -1,8 +1,10 @@
1
1
  "use client";
2
- import { A as resolveButtonStyleSelection, D as buttonStyleSelectionParameterValue, E as buttonStyleHoverPreferenceValue, F as buttonStyleSelectionsEqual, Jr as getSiteFontsStorageUrl, Kr as buildFontPreviewUrl, M as updateButtonStyleSelectionChoice, N as buttonStyleSelectionKey, Yn as paletteColorEntries, Yr as VARIANT_ROLES, Zn as paletteColorsSchema, i as ThemedButtonSpecimen, j as updateButtonStyleHoverPreference, k as findButtonStyleRecipe, ki as parseSiteId, qr as generateFontFaceCss, yi as expectParsedBrandedId } from "./ThemedButton-DzeycIlD.mjs";
3
- import { $t as RichTextWidgetProvider, A as cancelPreview, As as formatDate, B as planStyleSwitch, Bo as DropdownMenuSeparator, Bt as MailingListTargetingProvider, C as reportPreviewDesignError, Co as TabsContent, Cr as enabledBackgroundModes, D as selectionSnapshotFromApplySiteStyleSelectionResponse, Da as defaultFooterPreferences, Dr as planBackgroundTransition, Ds as syncStateOf, Dt as LinkedEntryLeaseBanner, E as buildApplySiteStyleSelectionBody, Ea as replaceSiteStyleCompilationPlan, Es as displayedValues, F as markApplyFailed, Fn as canWriteLinkedEntry, Fo as Surface, Fs as assertNever$1, Ft as SiteOptionWidgetProvider, G as previewHeaderStyle, Gn as civilPickerDisplay, Gt as ButtonVariantField, H as previewCuratedPalette, Ht as IconPickerField, I as markApplySaved, Io as DropdownMenu, It as OfferingsPreviewGroupOrderField, J as setPaletteColors, Jn as listPageSurfaceContentSlots, Jo as Smartphone, Jt as MediaField, K as resetTypographyToSaved, Kt as ButtonWidgetProvider, L as markApplySaving, Ln as PaletteProvider, Lo as DropdownMenuContent, Lt as OfferingsPreviewWidgetProvider, M as deriveStyleConfiguratorCapabilities, Mo as Collapsible, Ms as parseUtcIsoDateTimeString, Mt as createSiteOptionApiLoader, N as dismissWarnings, No as CollapsibleContent, Nr as resolveSdkFooterMode, Ns as resolveBookingBusinessTimeZone, Nt as createSiteOptionWidgetAdapters, O as applyResolvedSelections, Or as rankBackgroundImagePoolItems, Os as valueStatus, P as isPreviewingChange, Pn as isEdited, Po as CollapsibleTrigger, Pt as SiteOptionPickerField, Qt as RichTextField, R as openRow, Rn as usePalette, Ro as DropdownMenuItem, Rt as MailingListTargetingField, S as PREVIEW_DESIGN_SAVE_ERROR_MESSAGE, Sa as defaultHeaderLogoContext, Sn as useEditorUiStoreInstance, So as Tabs, St as useAutosaveStatus, T as usePreviewAuthoringAdmission, To as TabsTrigger, Tr as parseBackgroundOverrideFromContent, U as previewFooterLook, Un as FormRenderer, Uo as X$1, Ut as EntryPickerField, V as previewButtonStyle, Vn as createManifestValidation, Vo as DropdownMenuTrigger, Vt as InlineTextField, W as previewHeaderLayout, Wt as EntryPickerWidgetProvider, X as syncStyleConfiguratorState, Xt as ReferenceWidgetProvider, Y as styleConfiguratorHistoryEntryForPersistedSelection, Yn as blocksKeys, Yo as SlidersHorizontal, Yr as buildThemeRuntime, Yt as ReferenceField, Z as toggleRow, Zt as useRichTextImagePicker, _ as usePreviewPageDesignEditorState, _a as getGradientPreset, _n as parseReferenceKind, _o as SearchInput, _r as mapCurrentValueForSelect, _t as useEntryController, a as usePreviewDesignCoordinator, an as BlockSourceLine, ba as getHeaderLayout, bn as resolveContentTitle, bo as PopoverTrigger, c as buildSiteChromeSelectionModels, ct as resolveFooterLayoutHints, d as createOptimisticActionRunner, do as SelectContent, ds as ChevronDown, ea as compileReplacementSiteThemeFromSelections, f as resolveStyleConfiguratorInitialSnapshot, fa as offeredSiteStyles, fo as SelectItem, fs as Check, ga as GRADIENT_PRESETS, gn as isAdapterReferenceKind, go as CalloutDescription, gr as hasEmptyOption, gs as useField, ha as gradientToCss, hn as BUILT_IN_REFERENCE_KINDS, ho as Callout, hr as useSdkConfig, hs as cn, in as BlockEditor, j as createStyleConfiguratorState, jn as toEditorBlockItem, jr as ThemeScope, js as parseBookingLocalDate, k as applyTypographyDraftPatch, kr as resolveBackgroundCapability, l as cycleSiteChromeSelectionId, lr as unwrapResponse, ls as ChevronRight, mn as routeLifecycleContext, mo as SelectValue, mr as SdkConfigProvider, mt as useUISelector, n as useSiteChromeCustomizeOptional, nn as LinkField, ns as Maximize2, nt as usePreviewAuth, oo as FieldFrame, ot as FooterComposerPanel, pa as palettesForSiteStyle, po as SelectTrigger, pr as createStoreBackend, ps as Button, pt as ContentFieldsForm, q as restageSelectionChanges, qn as listEntryPageContentSlots, qo as Tablet, qt as FileField, r as StyleSwitchSummary, rn as LinkWidgetProvider, rr as getDashboardUrl, ta as compileUpdatedSiteThemeFromSelections, ts as Monitor, u as planSiteChromeSelection, ua as getCuratedSiteStyle, uo as Select, us as ChevronLeft, vn as deriveRouteMetadataPresentation, vo as Popover, vr as mapOptionValueForSelect, w as acceptStyleSelection, wo as TabsList, wr as imagePoolForOverride, xa as getHeaderStyle, xn as useEditorUiStore, xo as Input, xr as canCycleBackgroundOverrideValue, ya as findFooterLook, yn as resolvePageRouteSlug, yo as PopoverContent, yr as unmapValueFromSelect, yt as useOptionalSessionJournal, z as palettePreviewProjection, zn as ManifestForm, zo as DropdownMenuLabel, zt as loadMailingListAuthoringContext } from "./SiteChromeCustomizeContext-Hc4pYnNe.mjs";
4
- import { n as Separator, t as Spinner } from "./spinner-C4If5Y-O.mjs";
5
- import { C as pageDesignLookPosition, D as formatTokenLabel, E as BackgroundPreviewSwatch, M as usePreviewBlockCustomizeSelectionOptional, O as gradientLabel, T as BackgroundChooser, _ as lookIsAutomatic, b as useArrangementToolbar, c as resolvePreviewSidebarChromeModel, d as useBlockCustomizeControls, f as ArrangementLookNote, h as ArrangementOptionsBody, i as resolvePreviewDashboardSetupHandoff, k as readBackgroundColorPaletteSnapshot, o as resolvePreviewEditorGuidanceModel, r as buildPreviewDashboardSetupUrl, t as canInspectSiteStyle, u as usePreviewSiteFontStorageUrl, v as lookPosition, w as setPageDesignBlockBackground, x as CustomizeBackgroundControlRows } from "./siteStyleAccess-QZkJRHl5.mjs";
2
+ import { A as resolveButtonStyleSelection, D as buttonStyleSelectionParameterValue, E as buttonStyleHoverPreferenceValue, F as buttonStyleSelectionsEqual, M as updateButtonStyleSelectionChoice, N as buttonStyleSelectionKey, Oi as expectParsedBrandedId, i as ThemedButtonSpecimen, j as updateButtonStyleHoverPreference, k as findButtonStyleRecipe, ri as VARIANT_ROLES, rr as paletteColorsSchema, tr as paletteColorEntries, zi as parseSiteId } from "./ThemedButton-CHKOWXxl.mjs";
3
+ import { $ as MailingListTargetingField, $a as replaceSiteStyleCompilationPlan, $s as parseBookingLocalDate, An as getDashboardUrl, Bo as CalloutDescription, Bt as useEditorUiStore, Cr as buildThemeRuntime, D as JournalWriteRefused, Fo as SelectItem, Fs as useField, Ft as isAdapterReferenceKind, Ga as getHeaderLayout, Gn as useSdkConfig, Go as Input, H as LinkedEntryLeaseBanner, Hn as createStoreBackend, Ho as Popover, Ia as gradientToCss, Io as SelectTrigger, It as parseReferenceKind, J as SiteOptionPickerField, Jn as mapCurrentValueForSelect, Js as syncStateOf, K as createSiteOptionApiLoader, Ka as getHeaderStyle, Ks as displayedValues, La as GRADIENT_PRESETS, Lo as SelectValue, Lt as deriveRouteMetadataPresentation, Na as offeredSiteStyles, No as Select, Nt as routeLifecycleContext, Oo as FieldFrame, P as useAutosaveStatus, Pa as palettesForSiteStyle, Po as SelectContent, Ps as cn, Pt as BUILT_IN_REFERENCE_KINDS, Q as OfferingsPreviewWidgetProvider, Qn as ThemeScope, Qo as TabsTrigger, Qs as formatDate, Qt as toEditorBlockItem, Rn as unwrapResponse, Rt as resolvePageRouteSlug, St as BlockSourceLine, Uo as PopoverContent, Va as findFooterLook, Vt as useEditorUiStoreInstance, Wn as SdkConfigProvider, Wo as PopoverTrigger, Xn as unmapValueFromSelect, Xo as TabsContent, Y as SiteOptionWidgetProvider, Yn as mapOptionValueForSelect, Yo as Tabs, Ys as valueStatus, Z as OfferingsPreviewGroupOrderField, Zo as TabsList, _ as useUISelector, _s as DropdownMenuItem, a as usePreviewAuth, an as canWriteLinkedEntry, at as EntryPickerWidgetProvider, b as useEntryController, bn as listPageSurfaceContentSlots, bs as DropdownMenuTrigger, bt as LinkWidgetProvider, cn as usePalette, ct as ButtonVariantField, d as resolveFooterLayoutHints, dn as createManifestValidation, ds as Collapsible, dt as MediaField, ec as parseUtcIsoDateTimeString, eo as defaultFooterPreferences, et as loadMailingListAuthoringContext, fa as themePalettesEqual, fs as CollapsibleContent, ft as ReferenceField, g as ContentFieldsForm, gs as DropdownMenuContent, gt as RichTextWidgetProvider, hn as civilPickerDisplay, hs as DropdownMenu, ht as RichTextField, it as EntryPickerField, js as Button, ka as getCuratedSiteStyle, l as FooterComposerPanel, ln as ManifestForm, lt as ButtonWidgetProvider, ms as Surface, mt as useRichTextImagePicker, na as compileUpdatedSiteThemeFromSelections, nt as InlineTextField, ot as ContentTypeSelectField, pn as FormRenderer, ps as CollapsibleTrigger, pt as ReferenceWidgetProvider, q as createSiteOptionWidgetAdapters, qa as defaultHeaderLogoContext, qn as hasEmptyOption, rc as assertNever$1, rn as isEdited, rt as IconPickerField, sn as PaletteProvider, st as ContentTypeWidgetProvider, ta as compileReplacementSiteThemeFromSelections, tc as resolveBookingBusinessTimeZone, tr as resolveSdkFooterMode, tt as MailingListTargetingProvider, ut as FileField, vs as DropdownMenuLabel, w as useSessionJournal, xn as blocksKeys, xt as BlockEditor, yn as listEntryPageContentSlots, ys as DropdownMenuSeparator, yt as LinkField, za as getGradientPreset, zo as Callout, zt as resolveContentTitle } from "./previewAuthStore-C0VUwEHz.mjs";
4
+ import { D as Maximize2, T as Monitor, dt as ChevronDown, f as Smartphone, ft as Check, l as Tablet, lt as ChevronRight, n as X$1, ut as ChevronLeft } from "./lucide-react-CA9cpo0P.mjs";
5
+ import { $ as useBlockCustomizeControls, A as createStyleConfiguratorState, At as locationWidgetOverrides, B as previewButtonStyle, Ct as BackgroundPreviewSwatch, D as applyResolvedSelections, E as planSiteChromeSelection, Et as readBackgroundColorPaletteSnapshot, F as markApplySaved, Ft as planBackgroundTransition, G as resetTypographyToSaved, H as previewFooterLook, I as markApplySaving, It as rankBackgroundImagePoolItems, J as syncStyleConfiguratorState, K as restageSelectionChanges, L as openRow, Lt as resolveBackgroundCapability, M as dismissWarnings, Mt as enabledBackgroundModes, N as isPreviewingChange, Nt as imagePoolForOverride, O as applyTypographyDraftPatch, P as markApplyFailed, Pt as parseBackgroundOverrideFromContent, Q as resolveStyleConfiguratorInitialSnapshot, R as palettePreviewProjection, St as BackgroundChooser, T as cycleSiteChromeSelectionId, Tt as gradientLabel, U as previewHeaderLayout, V as previewCuratedPalette, W as previewHeaderStyle, X as typographyObjectsEqual, Y as toggleRow, Z as createOptimisticActionRunner, _t as setPageDesignBlockBackground, at as lookIsAutomatic, bt as lookTilePosition, c as resolvePreviewSidebarChromeModel, ct as usePreviewPageDesignEditorState, d as TypographyOverviewContent, dt as acceptStyleSelection, et as ArrangementLookNote, f as typographyOverviewSurface, ft as usePreviewAuthoringAdmission, g as primaryFontFamily, gt as pageDesignLookTiles, i as resolvePreviewDashboardSetupHandoff, j as deriveStyleConfiguratorCapabilities, jt as canCycleBackgroundOverrideValue, k as cancelPreview, kt as usePreviewBlockCustomizeSelectionOptional, l as TypographyFontPickerTakeover, lt as PREVIEW_DESIGN_SAVE_ERROR_MESSAGE, m as TypographyThemeFontStyles, o as resolvePreviewEditorGuidanceModel, ot as useArrangementToolbar, p as useTypographyFontCatalog, pt as CustomizeBackgroundControlRows, q as setPaletteColors, r as buildPreviewDashboardSetupUrl, rt as ArrangementOptionsBody, t as canInspectSiteStyle, u as TypographyAdvancedTakeover, ut as reportPreviewDesignError, v as useSiteChromeCustomizeOptional, w as buildSiteChromeSelectionModels, wt as formatTokenLabel, x as usePreviewDesignCoordinator, xt as selectedLookTile, y as StyleSwitchSummary, z as planStyleSwitch } from "./siteStyleAccess-DHyzUpv4.mjs";
6
+ import { i as useOptionalLocationPickerEnvironment, n as LocationPickerEnvironmentProvider } from "./LocationPickerEnvironment-QtSG2Bl-.mjs";
7
+ import { n as Separator, t as Spinner } from "./spinner-BeR2S8oG.mjs";
6
8
  import React, { createContext, forwardRef, useCallback, useContext, useEffect, useId, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore, useTransition } from "react";
7
9
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
8
10
  import { useQuery, useQueryClient } from "@tanstack/react-query";
@@ -1677,6 +1679,20 @@ function createPreviewReferenceAdapters(previewClient, fallbackSiteId) {
1677
1679
  };
1678
1680
  return createDynamicReferenceAdapters(adapters, (contentTypeKey) => createCachedDynamicContentReferenceAdapter(contentTypeKey, previewClient, brandedFallbackSiteId));
1679
1681
  }
1682
+ /** The same content-type select as the dashboard, using the authenticated preview transport. */
1683
+ function createPreviewContentTypeAdapter(apiClient) {
1684
+ return { loadContentTypes: async ({ siteId }) => {
1685
+ return unwrapResponse(await apiClient({
1686
+ endpoint: "listContentTypes",
1687
+ params: { siteId }
1688
+ })).contentTypes.map((content) => ({
1689
+ key: content.key,
1690
+ name: content.name,
1691
+ description: content.description ?? void 0,
1692
+ hasPages: content.hasPages ?? false
1693
+ }));
1694
+ } };
1695
+ }
1680
1696
  //#endregion
1681
1697
  //#region ../preview-next/src/client/widgets/widgetOverrides.tsx
1682
1698
  function PreviewFormProviderInner({ theme, children }) {
@@ -1694,7 +1710,10 @@ function PreviewFormProviderInner({ theme, children }) {
1694
1710
  */
1695
1711
  function PreviewFormProvider({ siteId: rawSiteId, theme = null, previewClient, bookingOfferingPresets, sdkConfig, children }) {
1696
1712
  const siteId = useMemo(() => expectParsedBrandedId(parseSiteId(rawSiteId)), [rawSiteId]);
1713
+ const locationHost = useOptionalLocationPickerEnvironment();
1714
+ const locationClient = locationHost?.siteId === siteId ? locationHost.apiClient : previewClient;
1697
1715
  const linkAdapters = useMemo(() => createPreviewLinkAdapters(previewClient), [previewClient]);
1716
+ const contentTypeAdapter = useMemo(() => createPreviewContentTypeAdapter(previewClient), [previewClient]);
1698
1717
  const entryPickerAdapter = useMemo(() => createPreviewEntryPickerAdapter(previewClient), [previewClient]);
1699
1718
  const siteOptionAdapters = useMemo(() => createPreviewSiteOptionAdapters(previewClient), [previewClient]);
1700
1719
  const referenceAdapters = useMemo(() => createPreviewReferenceAdapters(previewClient), [previewClient]);
@@ -1706,35 +1725,43 @@ function PreviewFormProvider({ siteId: rawSiteId, theme = null, previewClient, b
1706
1725
  return;
1707
1726
  }
1708
1727
  }, [theme]);
1709
- return /* @__PURE__ */ jsx(SdkConfigProvider, {
1710
- sdkConfig: sdkConfig ?? null,
1711
- children: /* @__PURE__ */ jsx(PaletteProvider, {
1712
- tokens: paletteTokens,
1713
- children: /* @__PURE__ */ jsx(LinkWidgetProvider, {
1714
- siteId,
1715
- adapters: linkAdapters,
1716
- children: /* @__PURE__ */ jsx(ReferenceWidgetProvider, {
1717
- siteId,
1718
- adapters: referenceAdapters,
1719
- children: /* @__PURE__ */ jsx(EntryPickerWidgetProvider, {
1728
+ return /* @__PURE__ */ jsx(LocationPickerEnvironmentProvider, {
1729
+ siteId,
1730
+ apiClient: locationClient,
1731
+ children: /* @__PURE__ */ jsx(ContentTypeWidgetProvider, {
1732
+ siteId,
1733
+ adapter: contentTypeAdapter,
1734
+ children: /* @__PURE__ */ jsx(SdkConfigProvider, {
1735
+ sdkConfig: sdkConfig ?? null,
1736
+ children: /* @__PURE__ */ jsx(PaletteProvider, {
1737
+ tokens: paletteTokens,
1738
+ children: /* @__PURE__ */ jsx(LinkWidgetProvider, {
1720
1739
  siteId,
1721
- adapter: entryPickerAdapter,
1722
- children: /* @__PURE__ */ jsx(SiteOptionWidgetProvider, {
1740
+ adapters: linkAdapters,
1741
+ children: /* @__PURE__ */ jsx(ReferenceWidgetProvider, {
1723
1742
  siteId,
1724
- adapters: siteOptionAdapters,
1725
- children: /* @__PURE__ */ jsx(MailingListTargetingProvider, {
1743
+ adapters: referenceAdapters,
1744
+ children: /* @__PURE__ */ jsx(EntryPickerWidgetProvider, {
1726
1745
  siteId,
1727
- load: (targetSiteId) => loadMailingListAuthoringContext({
1728
- apiClient: previewClient,
1729
- siteId: targetSiteId
1730
- }),
1731
- children: /* @__PURE__ */ jsx(ButtonWidgetProvider, {
1732
- buttonSystem: theme?.buttons ?? null,
1733
- children: /* @__PURE__ */ jsx(OfferingsPreviewWidgetProvider, {
1734
- bookingOfferingPresets,
1735
- children: /* @__PURE__ */ jsx(PreviewFormProviderInner, {
1736
- theme,
1737
- children
1746
+ adapter: entryPickerAdapter,
1747
+ children: /* @__PURE__ */ jsx(SiteOptionWidgetProvider, {
1748
+ siteId,
1749
+ adapters: siteOptionAdapters,
1750
+ children: /* @__PURE__ */ jsx(MailingListTargetingProvider, {
1751
+ siteId,
1752
+ load: (targetSiteId) => loadMailingListAuthoringContext({
1753
+ apiClient: previewClient,
1754
+ siteId: targetSiteId
1755
+ }),
1756
+ children: /* @__PURE__ */ jsx(ButtonWidgetProvider, {
1757
+ buttonSystem: theme?.buttons ?? null,
1758
+ children: /* @__PURE__ */ jsx(OfferingsPreviewWidgetProvider, {
1759
+ bookingOfferingPresets,
1760
+ children: /* @__PURE__ */ jsx(PreviewFormProviderInner, {
1761
+ theme,
1762
+ children
1763
+ })
1764
+ })
1738
1765
  })
1739
1766
  })
1740
1767
  })
@@ -1747,6 +1774,8 @@ function PreviewFormProvider({ siteId: rawSiteId, theme = null, previewClient, b
1747
1774
  });
1748
1775
  }
1749
1776
  const previewWidgetOverrides = {
1777
+ ...locationWidgetOverrides,
1778
+ contentTypeSelect: ContentTypeSelectField,
1750
1779
  link: LinkField,
1751
1780
  file: FileField,
1752
1781
  media: MediaField,
@@ -2574,7 +2603,7 @@ function mergedImagePool(current, pool) {
2574
2603
  }
2575
2604
  function backgroundModeLabel(mode) {
2576
2605
  return {
2577
- default: "From the style",
2606
+ default: "Set by your site style",
2578
2607
  color: "Colour",
2579
2608
  gradient: "Gradient",
2580
2609
  image: "Photo"
@@ -2582,7 +2611,7 @@ function backgroundModeLabel(mode) {
2582
2611
  }
2583
2612
  function backgroundValueLabel(override, pool) {
2584
2613
  switch (override.kind) {
2585
- case "default": return "No colour chosen";
2614
+ case "default": return "Your site style’s colour";
2586
2615
  case "color": return formatTokenLabel(override.token);
2587
2616
  case "gradient": return gradientLabel(override.gradientId);
2588
2617
  case "image": return pool.find((item) => item.reference.identifier === override.reference.identifier)?.label ?? "Image";
@@ -2600,19 +2629,19 @@ function useLoadBackgroundImages(supportsImages, context) {
2600
2629
  //#endregion
2601
2630
  //#region ../preview-next/src/client/preview/SelectedBlockLookControls.tsx
2602
2631
  function SelectedBlockLookControls(props) {
2603
- const { toolbar, chooseLook, historyFailure } = useLookSectionActions(props);
2632
+ const { toolbar, chooseLook, failureMessage } = useLookSectionActions(props);
2604
2633
  if (!props.designBlock) return null;
2605
2634
  return /* @__PURE__ */ jsxs("div", {
2606
2635
  className: "space-y-4",
2607
2636
  children: [
2608
- historyFailure ? /* @__PURE__ */ jsx("p", {
2637
+ failureMessage ? /* @__PURE__ */ jsx("p", {
2609
2638
  role: "alert",
2610
2639
  className: "text-xs text-red-700",
2611
- children: historyFailure
2640
+ children: failureMessage
2612
2641
  }) : null,
2613
2642
  /* @__PURE__ */ jsx(BlockLookChoices, {
2614
2643
  block: props.designBlock,
2615
- look: toolbar?.controls.look,
2644
+ arrangement: toolbar?.controls,
2616
2645
  onChoose: chooseLook
2617
2646
  }),
2618
2647
  toolbar ? /* @__PURE__ */ jsx(ArrangementLookNote, {
@@ -2634,7 +2663,7 @@ function SelectedBlockLookControls(props) {
2634
2663
  });
2635
2664
  }
2636
2665
  function useLookSectionActions({ blockId, content, designBlock }) {
2637
- const { state, applyAction, historyFailure, backgroundImagePool = [] } = usePreviewPageDesignEditorState();
2666
+ const { state, applyAction, saveFailure, backgroundImagePool = [] } = usePreviewPageDesignEditorState();
2638
2667
  const uiStore = useEditorUiStoreInstance();
2639
2668
  const save = (action) => {
2640
2669
  applyAction(action, { runtimeContent: content });
@@ -2671,12 +2700,13 @@ function useLookSectionActions({ blockId, content, designBlock }) {
2671
2700
  return {
2672
2701
  toolbar,
2673
2702
  chooseLook,
2674
- historyFailure
2703
+ failureMessage: saveFailure
2675
2704
  };
2676
2705
  }
2677
- function BlockLookChoices({ block, look, onChoose }) {
2706
+ function BlockLookChoices({ block, arrangement, onChoose }) {
2678
2707
  const [changing, setChanging] = useState(false);
2679
- if (!block.availableLooks.length) return null;
2708
+ const tiles = arrangement?.tiles ?? pageDesignLookTiles(block);
2709
+ if (!tiles.length) return null;
2680
2710
  const choose = (id) => {
2681
2711
  onChoose(id);
2682
2712
  setChanging(false);
@@ -2684,61 +2714,79 @@ function BlockLookChoices({ block, look, onChoose }) {
2684
2714
  return /* @__PURE__ */ jsxs("div", {
2685
2715
  className: "space-y-2",
2686
2716
  children: [/* @__PURE__ */ jsx(BlockLookCard, {
2687
- block,
2688
- look,
2717
+ card: lookCardFor(tiles, arrangement?.look ?? null),
2689
2718
  changing,
2690
2719
  onChange: () => setChanging((value) => !value)
2691
2720
  }), changing ? /* @__PURE__ */ jsx(BlockLookTiles, {
2692
- block,
2721
+ tiles,
2693
2722
  onChoose: choose
2694
2723
  }) : null]
2695
2724
  });
2696
2725
  }
2697
- function BlockLookCard({ block, look, changing, onChange }) {
2698
- const preset = pageDesignLookPosition(block);
2699
- const name = look?.lookName ?? preset.lookName;
2700
- const position = look ? lookPosition(look) : preset.position;
2726
+ /** What the Look card says, read from the same tiles the chooser lists. */
2727
+ function lookCardFor(tiles, look) {
2728
+ return {
2729
+ name: look?.lookName ?? selectedLookTile(tiles)?.label ?? "Default",
2730
+ automatic: look ? lookIsAutomatic(look) : false,
2731
+ position: lookTilePosition(tiles),
2732
+ canChange: tiles.length > 1
2733
+ };
2734
+ }
2735
+ function BlockLookCard({ card, changing, onChange }) {
2701
2736
  return /* @__PURE__ */ jsxs("div", {
2702
2737
  className: "flex items-center gap-3 rounded-lg border border-border bg-background px-3 py-2.5",
2703
2738
  children: [/* @__PURE__ */ jsxs("div", {
2704
2739
  className: "min-w-0 flex-1",
2705
2740
  children: [/* @__PURE__ */ jsxs("div", {
2706
2741
  className: "truncate text-sm font-semibold leading-5 text-foreground",
2707
- children: [look && lookIsAutomatic(look) ? "Automatic · " : "", name]
2708
- }), position ? /* @__PURE__ */ jsxs("div", {
2742
+ children: [card.automatic ? "Default · " : "", card.name]
2743
+ }), card.position ? /* @__PURE__ */ jsxs("div", {
2709
2744
  className: "text-xs leading-4 text-muted-foreground",
2710
- children: [position, " Looks"]
2745
+ children: [card.position, " Looks"]
2711
2746
  }) : null]
2712
- }), /* @__PURE__ */ jsx("button", {
2747
+ }), card.canChange ? /* @__PURE__ */ jsx("button", {
2713
2748
  type: "button",
2714
2749
  "aria-expanded": changing,
2715
2750
  className: lookChangeButtonClass,
2716
2751
  onClick: onChange,
2717
2752
  children: "Change"
2718
- })]
2753
+ }) : null]
2719
2754
  });
2720
2755
  }
2721
- function BlockLookTiles({ block, onChoose }) {
2722
- const current = block.look.effectiveValue;
2723
- return /* @__PURE__ */ jsxs("div", {
2756
+ function BlockLookTiles({ tiles, onChoose }) {
2757
+ return /* @__PURE__ */ jsx("div", {
2724
2758
  className: "grid grid-cols-2 gap-1.5",
2725
- children: [/* @__PURE__ */ jsx("button", {
2726
- type: "button",
2727
- className: lookTileClass(false),
2728
- onClick: () => onChoose(null),
2759
+ role: "group",
2760
+ "aria-label": "Looks",
2761
+ children: tiles.map((tile) => /* @__PURE__ */ jsx(LookTileButton, {
2762
+ tile,
2763
+ onChoose
2764
+ }, tile.key))
2765
+ });
2766
+ }
2767
+ /** The badge is a description, so the tile is still named for its Look alone. */
2768
+ function LookTileButton({ tile, onChoose }) {
2769
+ const badged = tile.isDefault && tile.key !== "style-default";
2770
+ return /* @__PURE__ */ jsxs("button", {
2771
+ type: "button",
2772
+ "aria-pressed": tile.selected,
2773
+ "aria-description": badged ? "Default" : void 0,
2774
+ className: lookTileClass(tile.selected),
2775
+ onClick: () => onChoose(tile.pin),
2776
+ children: [/* @__PURE__ */ jsx("span", {
2777
+ className: "min-w-0 flex-1",
2778
+ children: tile.label
2779
+ }), badged ? /* @__PURE__ */ jsx("span", {
2780
+ "aria-hidden": "true",
2781
+ className: lookDefaultBadgeClass,
2729
2782
  children: "Default"
2730
- }), block.availableLooks.map((look) => /* @__PURE__ */ jsx("button", {
2731
- type: "button",
2732
- "aria-pressed": look.id === current,
2733
- className: lookTileClass(look.id === current),
2734
- onClick: () => onChoose(look.id),
2735
- children: look.label
2736
- }, look.id))]
2783
+ }) : null]
2737
2784
  });
2738
2785
  }
2739
2786
  const lookChangeButtonClass = "shrink-0 rounded-full border border-border bg-background px-3 py-1 text-xs font-medium text-foreground hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring";
2787
+ const lookDefaultBadgeClass = "shrink-0 rounded-full bg-muted px-1.5 py-0.5 text-[10px] font-semibold leading-3 text-muted-foreground";
2740
2788
  function lookTileClass(selected) {
2741
- return ["min-h-10 rounded-md border px-2.5 py-2 text-left text-xs font-medium leading-4 text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", selected ? "border-foreground ring-1 ring-foreground" : "border-border bg-background hover:bg-muted"].join(" ");
2789
+ return ["flex min-h-10 items-center gap-1.5 rounded-md border px-2.5 py-2 text-left text-xs font-medium leading-4 text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", selected ? "border-foreground ring-1 ring-foreground" : "border-border bg-background hover:bg-muted"].join(" ");
2742
2790
  }
2743
2791
  //#endregion
2744
2792
  //#region ../preview-next/src/client/preview/SelectedBlockCustomizePanel.tsx
@@ -2795,7 +2843,6 @@ function SelectedBlockCustomizeFields({ block, blockId, uiStoreForBlockEditor, t
2795
2843
  fields,
2796
2844
  backend,
2797
2845
  sectionPlan,
2798
- sectionOptions: { lookField: manifest.lookField },
2799
2846
  widgetOverrides: previewWidgetOverrides,
2800
2847
  blockKind: block.kind,
2801
2848
  lookContent: customizeControls.lookSource.kind === "sdk" || !designBlock ? void 0 : /* @__PURE__ */ jsx(SelectedBlockLookControls, {
@@ -3066,13 +3113,14 @@ function DesignSection({ panel, takeover, controls }) {
3066
3113
  }
3067
3114
  //#endregion
3068
3115
  //#region ../preview-next/src/client/preview/PreviewFooterEditorPanel.tsx
3069
- function PreviewFooterEditorPanel({ sdkConfig, apiClient, siteId, dashboardBaseUrl, theme, selectionId, selectionVersion, siteStyleAccess, inspection, canEdit, onSaved }) {
3116
+ function PreviewFooterEditorPanel({ sdkConfig, apiClient, siteId, dashboardBaseUrl, theme, selectionId, journalState, selectionVersion, siteStyleAccess, inspection, canEdit, onSaved }) {
3070
3117
  const footerPreferences = useSiteChromeCustomizeOptional()?.getFooterPreferences();
3071
3118
  const dashboardSiteUrl = `${dashboardBaseUrl?.replace(/\/$/u, "") ?? ""}/dashboard/sites/${siteId}`;
3072
3119
  const navigationLayoutAccess = footerNavigationAccess({
3073
3120
  theme,
3074
3121
  selectionId,
3075
3122
  selectionVersion,
3123
+ journalState,
3076
3124
  siteStyleAccess,
3077
3125
  footerPreferences
3078
3126
  });
@@ -3099,8 +3147,9 @@ function footerComposerLayoutProps(theme) {
3099
3147
  };
3100
3148
  }
3101
3149
  function footerNavigationAccess(input) {
3102
- return input.siteStyleAccess.kind === "apply-allowed" && input.theme && input.footerPreferences && input.selectionVersion !== null ? {
3150
+ return input.siteStyleAccess.kind === "apply-allowed" && input.theme && input.footerPreferences && input.selectionVersion !== null && input.journalState !== null ? {
3103
3151
  kind: "editable",
3152
+ journalState: input.journalState,
3104
3153
  theme: input.theme,
3105
3154
  selectionId: input.selectionId,
3106
3155
  selectionVersion: input.selectionVersion,
@@ -3701,6 +3750,40 @@ function ButtonStylePreviewPair({ selection, previewTheme, compact = false }) {
3701
3750
  });
3702
3751
  }
3703
3752
  //#endregion
3753
+ //#region ../preview-next/src/client/selection/useRadioOptions.ts
3754
+ /** The step an arrow key takes through a radio group, or 0 for any other key. */
3755
+ function radioArrowStep(key) {
3756
+ if (key === "ArrowDown" || key === "ArrowRight") return 1;
3757
+ if (key === "ArrowUp" || key === "ArrowLeft") return -1;
3758
+ return 0;
3759
+ }
3760
+ /**
3761
+ * The behaviour of a group of radio buttons drawn as ordinary buttons: a
3762
+ * click selects, and an arrow key selects the neighbouring option and moves
3763
+ * focus to it, wrapping at either end. The caller owns the look and the
3764
+ * `role="radiogroup"` container; options are addressed by their position in
3765
+ * the group, across any sections the group is drawn in.
3766
+ */
3767
+ function useRadioOptions(count, onSelect) {
3768
+ const optionRefs = useRef([]);
3769
+ return (index, checked) => ({
3770
+ role: "radio",
3771
+ "aria-checked": checked,
3772
+ ref: (element) => {
3773
+ optionRefs.current[index] = element;
3774
+ },
3775
+ onClick: () => onSelect(index),
3776
+ onKeyDown: (event) => {
3777
+ const step = radioArrowStep(event.key);
3778
+ if (count === 0 || step === 0) return;
3779
+ event.preventDefault();
3780
+ const nextIndex = (index + step + count) % count;
3781
+ onSelect(nextIndex);
3782
+ optionRefs.current[nextIndex]?.focus();
3783
+ }
3784
+ });
3785
+ }
3786
+ //#endregion
3704
3787
  //#region ../preview-next/src/client/preview/StyleConfigurator.rows.tsx
3705
3788
  function StyleRowFrame({ label, currentLabel, currentSummary, swatch, expanded, onToggle, children }) {
3706
3789
  return /* @__PURE__ */ jsx(Collapsible, {
@@ -4014,963 +4097,65 @@ function replacementCompilationPlan(input) {
4014
4097
  });
4015
4098
  }
4016
4099
  //#endregion
4017
- //#region ../preview-next/src/client/preview/typographyFontCatalog.ts
4018
- const typographyFontCategories = [
4019
- {
4020
- value: "all",
4021
- label: "All"
4022
- },
4023
- {
4024
- value: "sans-serif",
4025
- label: "Sans"
4026
- },
4027
- {
4028
- value: "serif",
4029
- label: "Serif"
4030
- },
4031
- {
4032
- value: "display",
4033
- label: "Display"
4034
- },
4035
- {
4036
- value: "handwriting",
4037
- label: "Handwriting"
4038
- },
4039
- {
4040
- value: "monospace",
4041
- label: "Mono"
4042
- }
4043
- ];
4044
- function buildTypographyFontCatalog(input) {
4045
- const normalizedQuery = input.query.trim().toLocaleLowerCase();
4046
- const site = input.siteFonts.map(siteFontOption).filter((option) => fontOptionMatches(option, normalizedQuery, input.category)).sort(compareFontOptionsAlphabetically);
4047
- const siteFamilies = new Set(input.siteFonts.map((font) => familyKey(font.familyName)));
4048
- return {
4049
- site,
4050
- google: input.googleFonts.map(googleFontOption).filter((option) => !siteFamilies.has(familyKey(option.family))).filter((option) => fontOptionMatches(option, normalizedQuery, input.category)).sort(compareGoogleOptions)
4051
- };
4052
- }
4053
- function visibleTypographyFontOptions(input) {
4054
- const initial = input.options.slice(0, input.limit);
4055
- if (input.limit <= 0 || initial.some((option) => familyKey(option.family) === familyKey(input.selectedFamily))) return initial;
4056
- const selected = input.options.find((option) => familyKey(option.family) === familyKey(input.selectedFamily));
4057
- if (!selected) return initial;
4058
- return [...initial.slice(0, Math.max(0, input.limit - 1)), selected];
4059
- }
4060
- function fontOptionForFamily(family, catalog) {
4061
- const key = familyKey(primaryFontFamily(family));
4062
- const site = catalog.siteFonts.find((font) => familyKey(font.familyName) === key);
4063
- if (site) return siteFontOption(site);
4064
- const google = catalog.googleFonts.find((font) => familyKey(font.family) === key);
4065
- return google ? googleFontOption(google) : null;
4066
- }
4067
- function primaryFontFamily(cssFamily) {
4068
- return cssFamily.split(",")[0]?.trim().replace(/^["']|["']$/gu, "") || cssFamily;
4069
- }
4070
- function siteFontOption(font) {
4071
- return {
4072
- source: "site",
4073
- family: font.familyName,
4074
- label: font.displayName ?? font.familyName,
4075
- category: normalizeCategory(font.category),
4076
- siteFont: font
4077
- };
4078
- }
4079
- function googleFontOption(font) {
4080
- return {
4081
- source: "google",
4082
- family: font.family,
4083
- label: font.family,
4084
- category: normalizeCategory(font.category),
4085
- googleFont: font
4086
- };
4087
- }
4088
- function normalizeCategory(category) {
4089
- switch (category) {
4090
- case "sans-serif":
4091
- case "serif":
4092
- case "display":
4093
- case "handwriting":
4094
- case "monospace": return category;
4095
- default: return null;
4096
- }
4097
- }
4098
- function fontOptionMatches(option, normalizedQuery, category) {
4099
- const matchesQuery = normalizedQuery.length === 0 || option.family.toLocaleLowerCase().includes(normalizedQuery) || option.label.toLocaleLowerCase().includes(normalizedQuery);
4100
- const matchesCategory = category === "all" || option.category === category;
4101
- return matchesQuery && matchesCategory;
4102
- }
4103
- function compareGoogleOptions(left, right) {
4104
- if (left.source !== "google" || right.source !== "google") return compareFontOptionsAlphabetically(left, right);
4105
- return (left.googleFont.popularity ?? Number.POSITIVE_INFINITY) - (right.googleFont.popularity ?? Number.POSITIVE_INFINITY) || compareFontOptionsAlphabetically(left, right);
4106
- }
4107
- function compareFontOptionsAlphabetically(left, right) {
4108
- return left.label.localeCompare(right.label);
4109
- }
4110
- function familyKey(family) {
4111
- return family.trim().toLocaleLowerCase();
4112
- }
4113
- //#endregion
4114
- //#region ../preview-next/src/client/preview/siteFontPreview.tsx
4115
- function buildSiteFontFaceCss(siteFonts, siteFontStorageUrl) {
4116
- if (!siteFontStorageUrl || siteFonts.length === 0) return "";
4117
- return generateFontFaceCss([...siteFonts], getSiteFontsStorageUrl(siteFontStorageUrl));
4118
- }
4119
- function SiteFontFaceStyles({ siteFonts }) {
4120
- const siteFontStorageUrl = usePreviewSiteFontStorageUrl();
4121
- const css = useMemo(() => buildSiteFontFaceCss(siteFonts, siteFontStorageUrl), [siteFontStorageUrl, siteFonts]);
4122
- return css ? /* @__PURE__ */ jsx("style", {
4123
- "data-typography-site-fonts": true,
4124
- children: css
4125
- }) : null;
4126
- }
4127
- //#endregion
4128
- //#region ../preview-next/src/client/preview/StyleConfigurator.typography.tsx
4129
- const typographyOverviewSurface = { kind: "overview" };
4130
- function useTypographyFontCatalog(apiClient, siteId, enabled) {
4131
- const [google, setGoogle] = useState({
4132
- kind: "idle",
4133
- value: []
4134
- });
4135
- const [site, setSite] = useState({
4136
- kind: "idle",
4137
- value: []
4138
- });
4139
- const googleRequestRef = useRef(null);
4140
- const siteRequestRef = useRef(null);
4141
- useEffect(() => {
4142
- if (!enabled) return;
4143
- if (googleRequestRef.current?.apiClient === apiClient) return;
4144
- let cancelled = false;
4145
- googleRequestRef.current = {
4146
- apiClient,
4147
- status: "loading"
4148
- };
4149
- setGoogle((current) => ({
4150
- kind: "loading",
4151
- value: current.value
4152
- }));
4153
- async function loadGoogleFonts() {
4154
- try {
4155
- const value = unwrapResponse(await apiClient({ endpoint: "listFonts" }));
4156
- if (!cancelled) {
4157
- googleRequestRef.current = {
4158
- apiClient,
4159
- status: "loaded"
4160
- };
4161
- setGoogle({
4162
- kind: "loaded",
4163
- value: Array.isArray(value) ? value : []
4164
- });
4165
- }
4166
- } catch (error) {
4167
- if (!cancelled) {
4168
- googleRequestRef.current = null;
4169
- setGoogle({
4170
- kind: "failed",
4171
- value: [],
4172
- message: errorMessage(error, "Unable to load Google Fonts.")
4173
- });
4174
- }
4175
- }
4176
- }
4177
- loadGoogleFonts();
4178
- return () => {
4179
- cancelled = true;
4180
- if (googleRequestRef.current?.status === "loading") googleRequestRef.current = null;
4181
- };
4182
- }, [apiClient, enabled]);
4183
- useEffect(() => {
4184
- if (!enabled) return;
4185
- if (siteRequestRef.current?.apiClient === apiClient && siteRequestRef.current.siteId === siteId) return;
4186
- let cancelled = false;
4187
- siteRequestRef.current = {
4188
- apiClient,
4189
- siteId,
4190
- status: "loading"
4191
- };
4192
- setSite((current) => ({
4193
- kind: "loading",
4194
- value: current.value
4195
- }));
4196
- async function loadSiteFonts() {
4197
- try {
4198
- const value = unwrapResponse(await apiClient({
4199
- endpoint: "listSiteFonts",
4200
- params: { siteId }
4201
- }));
4202
- if (!cancelled) {
4203
- siteRequestRef.current = {
4204
- apiClient,
4205
- siteId,
4206
- status: "loaded"
4207
- };
4208
- setSite({
4209
- kind: "loaded",
4210
- value: Array.isArray(value?.fonts) ? value.fonts : []
4211
- });
4212
- }
4213
- } catch (error) {
4214
- if (!cancelled) {
4215
- siteRequestRef.current = null;
4216
- setSite({
4217
- kind: "failed",
4218
- value: [],
4219
- message: errorMessage(error, "Unable to load your fonts.")
4220
- });
4221
- }
4222
- }
4223
- }
4224
- loadSiteFonts();
4225
- return () => {
4226
- cancelled = true;
4227
- if (siteRequestRef.current?.status === "loading") siteRequestRef.current = null;
4228
- };
4229
- }, [
4230
- apiClient,
4231
- enabled,
4232
- siteId
4233
- ]);
4234
- return {
4235
- google,
4236
- site
4237
- };
4238
- }
4239
- function TypographyOverviewContent({ typography, catalog, onChooseFont, onOpenAdvanced, onReset, disabled }) {
4240
- return /* @__PURE__ */ jsxs("div", {
4241
- className: "space-y-3",
4242
- children: [
4243
- /* @__PURE__ */ jsxs("div", {
4244
- className: "space-y-2",
4245
- children: [/* @__PURE__ */ jsx(TypographyRoleSummary, {
4246
- slot: "heading",
4247
- family: typography.headings.default.family,
4248
- catalog,
4249
- onChoose: () => onChooseFont("heading"),
4250
- disabled
4251
- }), /* @__PURE__ */ jsx(TypographyRoleSummary, {
4252
- slot: "body",
4253
- family: typography.body.family,
4254
- catalog,
4255
- onChoose: () => onChooseFont("body"),
4256
- disabled
4257
- })]
4258
- }),
4259
- /* @__PURE__ */ jsxs("div", {
4260
- className: "flex items-center gap-2 border-t pt-3",
4261
- children: [/* @__PURE__ */ jsxs(Button, {
4262
- type: "button",
4263
- size: "sm",
4264
- variant: "outline",
4265
- className: "flex-1 justify-between",
4266
- onClick: onOpenAdvanced,
4267
- disabled,
4268
- children: [/* @__PURE__ */ jsxs("span", {
4269
- className: "inline-flex items-center gap-2",
4270
- children: [/* @__PURE__ */ jsx(SlidersHorizontal, {
4271
- className: "h-3.5 w-3.5",
4272
- "aria-hidden": "true"
4273
- }), "Advanced typography"]
4274
- }), /* @__PURE__ */ jsx(ChevronRight, {
4275
- className: "h-3.5 w-3.5",
4276
- "aria-hidden": "true"
4277
- })]
4278
- }), /* @__PURE__ */ jsx(Button, {
4279
- type: "button",
4280
- size: "sm",
4281
- variant: "ghost",
4282
- onClick: onReset,
4283
- disabled,
4284
- children: "Reset"
4285
- })]
4286
- }),
4287
- /* @__PURE__ */ jsx(SiteFontFaceStyles, { siteFonts: catalog.site.value })
4288
- ]
4289
- });
4290
- }
4291
- function TypographyRoleSummary({ slot, family, catalog, onChoose, disabled }) {
4292
- const primaryFamily = primaryFontFamily(family);
4293
- const option = fontOptionForFamily(primaryFamily, {
4294
- googleFonts: catalog.google.value,
4295
- siteFonts: catalog.site.value
4296
- });
4297
- const label = slot === "heading" ? "Heading" : "Body";
4298
- return /* @__PURE__ */ jsxs("button", {
4299
- type: "button",
4300
- className: "group flex w-full items-center gap-3 rounded-md border bg-background px-3 py-3 text-left transition hover:border-foreground/30 hover:bg-accent/20 disabled:cursor-not-allowed disabled:opacity-50",
4301
- "aria-label": `Choose ${label.toLocaleLowerCase()} font, currently ${primaryFamily}`,
4302
- onClick: onChoose,
4303
- disabled,
4304
- children: [
4305
- /* @__PURE__ */ jsx(FontPreviewText, {
4306
- family: primaryFamily,
4307
- source: option?.source ?? "unknown",
4308
- className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-md bg-muted/70 text-xl",
4309
- children: slot === "heading" ? "Hh" : "Aa"
4310
- }),
4311
- /* @__PURE__ */ jsxs("span", {
4312
- className: "min-w-0 flex-1",
4313
- children: [/* @__PURE__ */ jsx("span", {
4314
- className: "block text-xs font-medium text-muted-foreground",
4315
- children: label
4316
- }), /* @__PURE__ */ jsx(FontPreviewText, {
4317
- family: primaryFamily,
4318
- source: option?.source ?? "unknown",
4319
- className: "block truncate text-base",
4320
- children: primaryFamily
4321
- })]
4322
- }),
4323
- /* @__PURE__ */ jsx(ChevronRight, {
4324
- className: "h-4 w-4 shrink-0 text-muted-foreground transition group-hover:text-foreground",
4325
- "aria-hidden": "true"
4326
- })
4327
- ]
4100
+ //#region ../preview-next/src/client/preview/styleConfiguratorApplyPayload.ts
4101
+ function buildApplySiteStyleSelectionBody(input) {
4102
+ const styleChanged = input.base.siteStyleId !== input.previewed.siteStyleId;
4103
+ const changes = [];
4104
+ if (styleChanged) changes.push({
4105
+ kind: "set-site-style",
4106
+ siteStyleId: input.previewed.siteStyleId
4328
4107
  });
4329
- }
4330
- function TypographyFontPickerTakeover({ slot, value, catalog, onBack, onChange, disabled }) {
4331
- const [query, setQuery] = useState("");
4332
- const [category, setCategory] = useState("all");
4333
- const [visibleGoogleCount, setVisibleGoogleCount] = useState(24);
4334
- const selectedFamily = primaryFontFamily(value);
4335
- const catalogResult = useMemo(() => buildTypographyFontCatalog({
4336
- googleFonts: catalog.google.value,
4337
- siteFonts: catalog.site.value,
4338
- query,
4339
- category
4340
- }), [
4341
- catalog.google.value,
4342
- catalog.site.value,
4343
- category,
4344
- query
4345
- ]);
4346
- const searching = query.trim().length > 0;
4347
- const visibleGoogle = searching ? catalogResult.google : visibleTypographyFontOptions({
4348
- options: catalogResult.google,
4349
- selectedFamily,
4350
- limit: visibleGoogleCount
4108
+ if (styleChanged || !buttonStyleSelectionsEqual(input.base.buttonStyleSelection, input.previewed.buttonStyleSelection)) changes.push({
4109
+ kind: "set-button-style",
4110
+ buttonStyleSelection: input.previewed.buttonStyleSelection
4351
4111
  });
4352
- const hasMore = !searching && visibleGoogle.length < catalogResult.google.length;
4353
- const title = slot === "heading" ? "Heading font" : "Body font";
4354
- useEffect(() => {
4355
- setVisibleGoogleCount(24);
4356
- }, [category, slot]);
4357
- return /* @__PURE__ */ jsxs("section", {
4358
- "aria-label": title,
4359
- className: "flex min-h-0 flex-1 flex-col overflow-hidden bg-background",
4360
- children: [
4361
- /* @__PURE__ */ jsxs("header", {
4362
- className: "shrink-0 space-y-3 border-b p-3",
4363
- children: [
4364
- /* @__PURE__ */ jsxs("div", {
4365
- className: "flex items-center gap-2",
4366
- children: [/* @__PURE__ */ jsx(Button, {
4367
- type: "button",
4368
- size: "icon",
4369
- variant: "ghost",
4370
- className: "h-8 w-8 shrink-0",
4371
- onClick: onBack,
4372
- "aria-label": "Back to typography",
4373
- children: /* @__PURE__ */ jsx(ChevronLeft, {
4374
- className: "h-4 w-4",
4375
- "aria-hidden": "true"
4376
- })
4377
- }), /* @__PURE__ */ jsxs("div", {
4378
- className: "min-w-0",
4379
- children: [/* @__PURE__ */ jsx("h2", {
4380
- className: "text-sm font-semibold",
4381
- children: title
4382
- }), /* @__PURE__ */ jsxs("p", {
4383
- className: "truncate text-xs text-muted-foreground",
4384
- children: ["Current: ", selectedFamily]
4385
- })]
4386
- })]
4387
- }),
4388
- /* @__PURE__ */ jsx(SearchInput, {
4389
- value: query,
4390
- onChange: (event) => setQuery(event.currentTarget.value),
4391
- placeholder: "Search fonts",
4392
- "aria-label": `Search ${slot} fonts`,
4393
- disabled
4394
- }),
4395
- /* @__PURE__ */ jsx("div", {
4396
- role: "group",
4397
- "aria-label": "Font category",
4398
- className: "flex gap-1 overflow-x-auto pb-0.5",
4399
- children: typographyFontCategories.map((option) => /* @__PURE__ */ jsx(Button, {
4400
- type: "button",
4401
- size: "sm",
4402
- variant: category === option.value ? "secondary" : "ghost",
4403
- className: "h-7 shrink-0 px-2 text-xs",
4404
- "aria-pressed": category === option.value,
4405
- onClick: () => setCategory(option.value),
4406
- disabled,
4407
- children: option.label
4408
- }, option.value))
4409
- })
4410
- ]
4411
- }),
4412
- /* @__PURE__ */ jsxs("div", {
4413
- "data-typography-font-catalog-scroll": true,
4414
- className: "min-h-0 flex-1 overflow-y-auto overscroll-contain p-2",
4415
- children: [
4416
- /* @__PURE__ */ jsx(FontCatalogFeedback, { catalog }),
4417
- catalogResult.site.length > 0 ? /* @__PURE__ */ jsx(FontOptionSection, {
4418
- label: "Your fonts",
4419
- children: catalogResult.site.map((option) => /* @__PURE__ */ jsx(TypographyFontOptionRow, {
4420
- option,
4421
- selected: familyMatches(selectedFamily, option.family),
4422
- onSelect: () => onChange(option.family),
4423
- disabled
4424
- }, `site:${option.family}`))
4425
- }) : null,
4426
- visibleGoogle.length > 0 ? /* @__PURE__ */ jsxs(FontOptionSection, {
4427
- label: searching ? "Matching fonts" : "Popular fonts",
4428
- children: [visibleGoogle.map((option) => /* @__PURE__ */ jsx(TypographyFontOptionRow, {
4429
- option,
4430
- selected: familyMatches(selectedFamily, option.family),
4431
- onSelect: () => onChange(option.family),
4432
- disabled
4433
- }, `google:${option.family}`)), hasMore ? /* @__PURE__ */ jsx(Button, {
4434
- type: "button",
4435
- size: "sm",
4436
- variant: "ghost",
4437
- className: "mt-1 w-full",
4438
- onClick: () => setVisibleGoogleCount((count) => count + 24),
4439
- disabled,
4440
- children: "Show more fonts"
4441
- }) : null]
4442
- }) : catalog.google.kind === "loaded" && catalog.site.kind === "loaded" ? /* @__PURE__ */ jsx("p", {
4443
- className: "px-2 py-8 text-center text-sm text-muted-foreground",
4444
- children: "No fonts match your search."
4445
- }) : null
4446
- ]
4447
- }),
4448
- /* @__PURE__ */ jsx(SiteFontFaceStyles, { siteFonts: catalog.site.value })
4449
- ]
4112
+ if (styleChanged || !themePalettesEqual(input.base.palette, input.previewed.palette)) changes.push({
4113
+ kind: "set-palette",
4114
+ palette: input.previewed.palette
4450
4115
  });
4451
- }
4452
- function FontOptionSection({ label, children }) {
4453
- return /* @__PURE__ */ jsxs("section", {
4454
- "aria-label": label,
4455
- className: "mb-3 last:mb-0",
4456
- children: [/* @__PURE__ */ jsx("h3", {
4457
- className: "sticky top-0 z-[1] bg-background px-2 py-1.5 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",
4458
- children: label
4459
- }), /* @__PURE__ */ jsx("div", {
4460
- className: "space-y-0.5",
4461
- children
4462
- })]
4463
- });
4464
- }
4465
- function TypographyFontOptionRow({ option, selected, onSelect, disabled }) {
4466
- return /* @__PURE__ */ jsxs("button", {
4467
- type: "button",
4468
- "aria-pressed": selected,
4469
- "aria-label": option.label,
4470
- className: cn("flex min-h-11 w-full items-center gap-3 rounded-md border border-transparent px-3 py-2 text-left transition disabled:cursor-not-allowed disabled:opacity-50", selected ? "border-primary/60 bg-primary/10" : "hover:border-border hover:bg-accent/30"),
4471
- onClick: onSelect,
4472
- disabled,
4473
- children: [/* @__PURE__ */ jsx(FontPreviewText, {
4474
- family: option.family,
4475
- source: option.source,
4476
- className: "min-w-0 flex-1 truncate text-base",
4477
- children: option.label
4478
- }), selected ? /* @__PURE__ */ jsx(Check, {
4479
- className: "h-4 w-4 shrink-0 text-primary",
4480
- "aria-hidden": "true"
4481
- }) : null]
4116
+ if (styleChanged || !typographyObjectsEqual(input.base.typography, input.previewed.typography)) changes.push({
4117
+ kind: "set-typography",
4118
+ typography: input.previewed.typography
4482
4119
  });
4483
- }
4484
- function FontCatalogFeedback({ catalog }) {
4485
- if ((catalog.google.kind === "loading" || catalog.google.kind === "idle") && catalog.google.value.length === 0) return /* @__PURE__ */ jsx("p", {
4486
- className: "px-2 py-6 text-center text-sm text-muted-foreground",
4487
- children: "Loading font catalog…"
4488
- });
4489
- const failureMessages = [catalog.site.kind === "failed" ? catalog.site.message : null, catalog.google.kind === "failed" ? catalog.google.message : null].filter((message) => message !== null);
4490
- if (failureMessages.length > 0) return /* @__PURE__ */ jsx("div", {
4491
- className: "mb-2 space-y-1",
4492
- children: failureMessages.map((message) => /* @__PURE__ */ jsx("p", {
4493
- className: "rounded-md bg-muted/60 px-3 py-2 text-xs text-muted-foreground",
4494
- children: message
4495
- }, message))
4496
- });
4497
- return null;
4498
- }
4499
- function TypographyAdvancedTakeover({ typography, catalog, onBack, onHeadingChange, onBodyChange, onScaleChange, disabled }) {
4500
- const headingOption = fontOptionForFamily(typography.headings.default.family, {
4501
- googleFonts: catalog.google.value,
4502
- siteFonts: catalog.site.value
4503
- });
4504
- const bodyOption = fontOptionForFamily(typography.body.family, {
4505
- googleFonts: catalog.google.value,
4506
- siteFonts: catalog.site.value
4507
- });
4508
- const headingWeightWarning = unsupportedWeightMessage(headingOption, typography.headings.default.weight, typography.headings.default.italic === true ? "italic" : "normal");
4509
- const bodyWeightWarning = unsupportedWeightMessage(bodyOption, typography.body.weight, "normal");
4510
- return /* @__PURE__ */ jsxs("section", {
4511
- "aria-label": "Advanced typography",
4512
- className: "flex min-h-0 flex-1 flex-col overflow-hidden bg-background",
4513
- children: [
4514
- /* @__PURE__ */ jsxs("header", {
4515
- className: "flex items-center gap-2 border-b p-3",
4516
- children: [/* @__PURE__ */ jsx(Button, {
4517
- type: "button",
4518
- size: "icon",
4519
- variant: "ghost",
4520
- className: "h-8 w-8 shrink-0",
4521
- onClick: onBack,
4522
- "aria-label": "Back to typography",
4523
- children: /* @__PURE__ */ jsx(ChevronLeft, {
4524
- className: "h-4 w-4",
4525
- "aria-hidden": "true"
4526
- })
4527
- }), /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("h2", {
4528
- className: "text-sm font-semibold",
4529
- children: "Advanced typography"
4530
- }), /* @__PURE__ */ jsx("p", {
4531
- className: "text-xs text-muted-foreground",
4532
- children: "Fine-tune the type system."
4533
- })] })]
4534
- }),
4535
- /* @__PURE__ */ jsxs("div", {
4536
- className: "min-h-0 flex-1 space-y-2 overflow-y-auto p-3",
4537
- children: [/* @__PURE__ */ jsxs(TypographyDisclosure, {
4538
- label: "Heading",
4539
- defaultOpen: true,
4540
- children: [
4541
- /* @__PURE__ */ jsx(TypographySelectControl, {
4542
- label: "Weight",
4543
- value: typography.headings.default.weight,
4544
- options: typographyWeightOptions,
4545
- onChange: (weight) => onHeadingChange({ weight }),
4546
- disabled
4547
- }),
4548
- headingWeightWarning ? /* @__PURE__ */ jsx(ContextualFontWarning, { message: headingWeightWarning }) : null,
4549
- /* @__PURE__ */ jsx(TypographySelectControl, {
4550
- label: "Line height",
4551
- value: typography.headings.default.lineHeight,
4552
- options: typographyLineHeightOptions,
4553
- onChange: (lineHeight) => onHeadingChange({ lineHeight }),
4554
- disabled
4555
- }),
4556
- /* @__PURE__ */ jsx(TypographySelectControl, {
4557
- label: "Letter spacing",
4558
- value: typography.headings.default.letterSpacing,
4559
- options: typographyLetterSpacingOptions,
4560
- onChange: (letterSpacing) => onHeadingChange({ letterSpacing }),
4561
- disabled
4562
- }),
4563
- /* @__PURE__ */ jsx(TypographySelectControl, {
4564
- label: "Scale",
4565
- value: normalizeTypographyScaleForControl(typography.scale),
4566
- options: typographyScaleOptions,
4567
- onChange: onScaleChange,
4568
- disabled
4569
- }),
4570
- /* @__PURE__ */ jsx(HeadingCaseControl, {
4571
- value: typography.headings.default.case,
4572
- onChange: (value) => onHeadingChange({ case: value }),
4573
- disabled
4574
- }),
4575
- /* @__PURE__ */ jsxs("button", {
4576
- type: "button",
4577
- className: "flex w-full items-center justify-between rounded-md border px-3 py-2 text-sm disabled:cursor-not-allowed disabled:opacity-50",
4578
- "aria-pressed": typography.headings.default.italic === true,
4579
- onClick: () => onHeadingChange({ italic: typography.headings.default.italic === true ? null : true }),
4580
- disabled,
4581
- children: ["Italic headings", /* @__PURE__ */ jsx("span", {
4582
- className: "text-xs text-muted-foreground",
4583
- children: typography.headings.default.italic === true ? "On" : "Default"
4584
- })]
4585
- }),
4586
- /* @__PURE__ */ jsx(TypographyColorTokenControl, {
4587
- value: normalizeHeadingColorTokenForControl(typography.headings.default.colorToken),
4588
- onChange: (colorToken) => onHeadingChange({ colorToken: colorToken === "text" ? null : colorToken }),
4589
- disabled
4590
- })
4591
- ]
4592
- }), /* @__PURE__ */ jsxs(TypographyDisclosure, {
4593
- label: "Body",
4594
- children: [
4595
- /* @__PURE__ */ jsx(TypographySelectControl, {
4596
- label: "Size",
4597
- value: typography.body.size,
4598
- options: bodySizeOptions,
4599
- onChange: (size) => onBodyChange({ size }),
4600
- disabled
4601
- }),
4602
- /* @__PURE__ */ jsx(TypographySelectControl, {
4603
- label: "Weight",
4604
- value: typography.body.weight,
4605
- options: typographyWeightOptions,
4606
- onChange: (weight) => onBodyChange({ weight }),
4607
- disabled
4608
- }),
4609
- bodyWeightWarning ? /* @__PURE__ */ jsx(ContextualFontWarning, { message: bodyWeightWarning }) : null,
4610
- /* @__PURE__ */ jsx(TypographySelectControl, {
4611
- label: "Line height",
4612
- value: typography.body.lineHeight,
4613
- options: typographyLineHeightOptions,
4614
- onChange: (lineHeight) => onBodyChange({ lineHeight }),
4615
- disabled
4616
- }),
4617
- /* @__PURE__ */ jsx(TypographySelectControl, {
4618
- label: "Letter spacing",
4619
- value: typography.body.letterSpacing,
4620
- options: typographyLetterSpacingOptions,
4621
- onChange: (letterSpacing) => onBodyChange({ letterSpacing }),
4622
- disabled
4623
- })
4624
- ]
4625
- })]
4626
- }),
4627
- /* @__PURE__ */ jsx(SiteFontFaceStyles, { siteFonts: catalog.site.value })
4628
- ]
4629
- });
4630
- }
4631
- function TypographyDisclosure({ label, defaultOpen = false, children }) {
4632
- const [open, setOpen] = useState(defaultOpen);
4633
- return /* @__PURE__ */ jsx(Collapsible, {
4634
- open,
4635
- onOpenChange: setOpen,
4636
- children: /* @__PURE__ */ jsxs("div", {
4637
- className: "rounded-md border bg-muted/10",
4638
- children: [/* @__PURE__ */ jsx(CollapsibleTrigger, {
4639
- asChild: true,
4640
- children: /* @__PURE__ */ jsxs("button", {
4641
- type: "button",
4642
- className: "flex w-full items-center gap-2 px-3 py-2 text-left text-sm font-medium hover:bg-accent/30",
4643
- "aria-expanded": open,
4644
- children: [/* @__PURE__ */ jsx(ChevronRight, {
4645
- className: cn("h-4 w-4 transition", open && "rotate-90"),
4646
- "aria-hidden": "true"
4647
- }), label]
4648
- })
4649
- }), /* @__PURE__ */ jsx(CollapsibleContent, { children: /* @__PURE__ */ jsx("div", {
4650
- className: "space-y-3 border-t px-3 py-3",
4651
- children
4652
- }) })]
4653
- })
4654
- });
4655
- }
4656
- function TypographySelectControl({ label, value, options, onChange, disabled }) {
4657
- return /* @__PURE__ */ jsxs("label", {
4658
- className: "block space-y-1",
4659
- children: [/* @__PURE__ */ jsx("span", {
4660
- className: "text-xs font-medium text-muted-foreground",
4661
- children: label
4662
- }), /* @__PURE__ */ jsxs(Select, {
4663
- value,
4664
- onValueChange: (next) => {
4665
- const option = options.find((candidate) => candidate.value === next);
4666
- if (option) onChange(option.value);
4667
- },
4668
- disabled,
4669
- children: [/* @__PURE__ */ jsx(SelectTrigger, {
4670
- size: "sm",
4671
- className: "w-full",
4672
- "aria-label": label,
4673
- children: /* @__PURE__ */ jsx(SelectValue, {})
4674
- }), /* @__PURE__ */ jsx(SelectContent, { children: options.map((option) => /* @__PURE__ */ jsx(SelectItem, {
4675
- value: option.value,
4676
- children: option.label
4677
- }, option.value)) })]
4678
- })]
4679
- });
4680
- }
4681
- function HeadingCaseControl({ value, onChange, disabled }) {
4682
- const options = [
4683
- {
4684
- value: "default",
4685
- label: "Default",
4686
- resolved: null
4687
- },
4688
- {
4689
- value: "normal",
4690
- label: "Normal",
4691
- resolved: "normal"
4692
- },
4693
- {
4694
- value: "uppercase",
4695
- label: "Uppercase",
4696
- resolved: "uppercase"
4697
- },
4698
- {
4699
- value: "smallCaps",
4700
- label: "Small caps",
4701
- resolved: "smallCaps"
4120
+ if (styleChanged || input.base.headerLayoutId !== input.previewed.headerLayoutId || input.base.headerStyleId !== input.previewed.headerStyleId) changes.push({
4121
+ kind: "set-header",
4122
+ selection: {
4123
+ kind: "canonical",
4124
+ layoutId: input.previewed.headerLayoutId,
4125
+ styleId: input.previewed.headerStyleId
4702
4126
  }
4703
- ];
4704
- return /* @__PURE__ */ jsxs("label", {
4705
- className: "block space-y-1",
4706
- children: [/* @__PURE__ */ jsx("span", {
4707
- className: "text-xs font-medium text-muted-foreground",
4708
- children: "Case"
4709
- }), /* @__PURE__ */ jsxs(Select, {
4710
- value: value ?? "default",
4711
- onValueChange: (next) => {
4712
- const option = options.find((candidate) => candidate.value === next);
4713
- if (option) onChange(option.resolved);
4714
- },
4715
- disabled,
4716
- children: [/* @__PURE__ */ jsx(SelectTrigger, {
4717
- size: "sm",
4718
- className: "w-full",
4719
- "aria-label": "Heading case",
4720
- children: /* @__PURE__ */ jsx(SelectValue, {})
4721
- }), /* @__PURE__ */ jsx(SelectContent, { children: options.map((option) => /* @__PURE__ */ jsx(SelectItem, {
4722
- value: option.value,
4723
- children: option.label
4724
- }, option.value)) })]
4725
- })]
4726
4127
  });
4727
- }
4728
- function TypographyColorTokenControl({ value, onChange, disabled }) {
4729
- return /* @__PURE__ */ jsxs("section", {
4730
- className: "space-y-2",
4731
- "aria-label": "Default heading color",
4732
- children: [/* @__PURE__ */ jsxs("div", { children: [
4733
- /* @__PURE__ */ jsx("div", {
4734
- className: "text-xs font-medium text-muted-foreground",
4735
- children: "Default heading color"
4736
- }),
4737
- /* @__PURE__ */ jsx("p", {
4738
- className: "text-[11px] text-muted-foreground",
4739
- children: "Sections may override this for readability."
4740
- }),
4741
- value.kind === "existing" ? /* @__PURE__ */ jsxs("p", {
4742
- className: "mt-1 text-[11px] text-muted-foreground",
4743
- children: [
4744
- "Current: ",
4745
- formatColorTokenLabel(value.value),
4746
- " (outside quick choices)"
4747
- ]
4748
- }) : null
4749
- ] }), /* @__PURE__ */ jsx("div", {
4750
- className: "grid grid-cols-2 gap-1",
4751
- children: headingColorTokenOptions.map((option) => /* @__PURE__ */ jsx(Button, {
4752
- type: "button",
4753
- size: "sm",
4754
- variant: value.kind === "curated" && value.value === option.value ? "secondary" : "outline",
4755
- className: "justify-start text-xs",
4756
- "aria-pressed": value.kind === "curated" && value.value === option.value,
4757
- onClick: () => onChange(option.value),
4758
- disabled,
4759
- children: option.label
4760
- }, option.value))
4761
- })]
4762
- });
4763
- }
4764
- function ContextualFontWarning({ message }) {
4765
- return /* @__PURE__ */ jsx("p", {
4766
- className: "rounded-md bg-warning/10 px-2 py-1.5 text-xs text-muted-foreground",
4767
- children: message
4128
+ if (styleChanged || input.base.footerLookId !== input.previewed.footerLookId) changes.push({
4129
+ kind: "set-footer-look",
4130
+ footerLookId: input.previewed.footerLookId
4768
4131
  });
4769
- }
4770
- function FontPreviewText({ family, source, className, children }) {
4771
- const elementRef = useRef(null);
4772
- const [visible, setVisible] = useState(() => typeof globalThis.IntersectionObserver !== "function");
4773
- useEffect(() => {
4774
- if (visible || source !== "google") return;
4775
- const element = elementRef.current;
4776
- if (!element || typeof globalThis.IntersectionObserver !== "function") {
4777
- setVisible(true);
4778
- return;
4132
+ const [first, ...rest] = changes;
4133
+ if (!first) return {
4134
+ ok: false,
4135
+ error: "no-selection-changes"
4136
+ };
4137
+ return {
4138
+ ok: true,
4139
+ body: {
4140
+ baseSelectionVersion: input.base.selectionVersion,
4141
+ selectionId: input.selectionId ?? null,
4142
+ changes: [first, ...rest]
4779
4143
  }
4780
- const observer = new globalThis.IntersectionObserver((entries) => {
4781
- if (!entries.some((entry) => entry.isIntersecting)) return;
4782
- setVisible(true);
4783
- observer.disconnect();
4784
- }, { rootMargin: "160px 0px" });
4785
- observer.observe(element);
4786
- return () => observer.disconnect();
4787
- }, [source, visible]);
4788
- useEffect(() => {
4789
- if (!visible || source !== "google") return;
4790
- ensureGoogleFontPreviewLink(family);
4791
- }, [
4792
- family,
4793
- source,
4794
- visible
4795
- ]);
4796
- return /* @__PURE__ */ jsx("span", {
4797
- ref: elementRef,
4798
- className,
4799
- style: source === "site" || source === "google" ? { fontFamily: quoteFontFamily(family) } : void 0,
4800
- children
4801
- });
4802
- }
4803
- function ensureGoogleFontPreviewLink(family) {
4804
- const url = buildFontPreviewUrl(family);
4805
- if (Array.from(document.head.querySelectorAll("link[data-font-preview]")).some((link) => link.href === url)) return;
4806
- const link = document.createElement("link");
4807
- link.rel = "stylesheet";
4808
- link.href = url;
4809
- link.dataset.fontPreview = family;
4810
- document.head.appendChild(link);
4811
- }
4812
- function unsupportedWeightMessage(option, weight, style) {
4813
- if (!option) return null;
4814
- const numericWeight = semanticFontWeight(weight);
4815
- if (option.source === "site") {
4816
- const font = option.siteFont;
4817
- if (font.isVariable && font.variableWeightMin !== null && font.variableWeightMax !== null) return numericWeight >= font.variableWeightMin && numericWeight <= font.variableWeightMax && font.files.some((file) => file.style === style) ? null : unsupportedFontStyleMessage(option.label, style);
4818
- return font.files.some((file) => file.weight === numericWeight && file.style === style) ? null : unsupportedFontStyleMessage(option.label, style);
4819
- }
4820
- const variants = new Set(option.googleFont.variants);
4821
- return (style === "italic" ? variants.has(numericWeight === 400 ? "italic" : `${numericWeight}italic`) : variants.has(String(numericWeight)) || numericWeight === 400 && variants.has("regular")) ? null : unsupportedFontStyleMessage(option.label, style);
4822
- }
4823
- function unsupportedFontStyleMessage(family, style) {
4824
- return style === "italic" ? `${family} may not include italics at this weight.` : `${family} may not include this weight.`;
4825
- }
4826
- function semanticFontWeight(weight) {
4827
- switch (weight) {
4828
- case "light": return 300;
4829
- case "regular": return 400;
4830
- case "medium": return 500;
4831
- case "semibold": return 600;
4832
- case "bold": return 700;
4833
- }
4834
- }
4835
- function normalizeTypographyScaleForControl(scale) {
4836
- switch (scale) {
4837
- case "compact":
4838
- case "balanced":
4839
- case "spacious": return scale;
4840
- case "minorThird": return "compact";
4841
- case "majorThird": return "balanced";
4842
- case "perfectFourth": return "spacious";
4843
- }
4844
- }
4845
- function normalizeHeadingColorTokenForControl(value) {
4846
- switch (value) {
4847
- case "primary":
4848
- case "secondary":
4849
- case "accent": return {
4850
- kind: "curated",
4851
- value
4852
- };
4853
- case "text":
4854
- case void 0:
4855
- case null: return {
4856
- kind: "curated",
4857
- value: "text"
4858
- };
4859
- default: return {
4860
- kind: "existing",
4861
- value
4862
- };
4863
- }
4864
- }
4865
- function formatColorTokenLabel(value) {
4866
- const words = value.replace(/([a-z])([A-Z])/gu, "$1 $2").replace(/[-_]+/gu, " ").toLocaleLowerCase();
4867
- return `${words.charAt(0).toLocaleUpperCase()}${words.slice(1)}`;
4868
- }
4869
- function familyMatches(left, right) {
4870
- return left.toLocaleLowerCase() === right.toLocaleLowerCase();
4871
- }
4872
- function quoteFontFamily(family) {
4873
- return `"${family.replace(/["\\]/gu, "")}", sans-serif`;
4144
+ };
4874
4145
  }
4875
- function errorMessage(error, fallback) {
4876
- return error instanceof Error && error.message ? error.message : fallback;
4146
+ function selectionSnapshotFromApplySiteStyleSelectionResponse(saved, fallback) {
4147
+ return {
4148
+ siteStyleId: saved.siteStyleId,
4149
+ selectionVersion: saved.selectionVersion,
4150
+ selectionUpdatedAt: saved.selectionUpdatedAt ?? fallback.selectionUpdatedAt ?? null,
4151
+ buttonStyleSelection: saved.buttonStyleSelection,
4152
+ palette: saved.theme.palette,
4153
+ typography: saved.theme.typography,
4154
+ headerLayoutId: saved.headerLayoutId,
4155
+ headerStyleId: saved.headerStyleId,
4156
+ footerLookId: saved.footerLookId
4157
+ };
4877
4158
  }
4878
- const typographyWeightOptions = [
4879
- {
4880
- value: "light",
4881
- label: "Light"
4882
- },
4883
- {
4884
- value: "regular",
4885
- label: "Regular"
4886
- },
4887
- {
4888
- value: "medium",
4889
- label: "Medium"
4890
- },
4891
- {
4892
- value: "semibold",
4893
- label: "Semibold"
4894
- },
4895
- {
4896
- value: "bold",
4897
- label: "Bold"
4898
- }
4899
- ];
4900
- const typographyLineHeightOptions = [
4901
- {
4902
- value: "normal",
4903
- label: "Normal"
4904
- },
4905
- {
4906
- value: "relaxed",
4907
- label: "Relaxed"
4908
- },
4909
- {
4910
- value: "loose",
4911
- label: "Loose"
4912
- }
4913
- ];
4914
- const typographyLetterSpacingOptions = [
4915
- {
4916
- value: "tight",
4917
- label: "Tight"
4918
- },
4919
- {
4920
- value: "normal",
4921
- label: "Normal"
4922
- },
4923
- {
4924
- value: "loose",
4925
- label: "Loose"
4926
- }
4927
- ];
4928
- const bodySizeOptions = [
4929
- {
4930
- value: "md",
4931
- label: "Medium"
4932
- },
4933
- {
4934
- value: "lg",
4935
- label: "Large"
4936
- },
4937
- {
4938
- value: "xl",
4939
- label: "Extra large"
4940
- }
4941
- ];
4942
- const typographyScaleOptions = [
4943
- {
4944
- value: "compact",
4945
- label: "Compact"
4946
- },
4947
- {
4948
- value: "balanced",
4949
- label: "Balanced"
4950
- },
4951
- {
4952
- value: "spacious",
4953
- label: "Spacious"
4954
- }
4955
- ];
4956
- const headingColorTokenOptions = [
4957
- {
4958
- value: "text",
4959
- label: "Default text"
4960
- },
4961
- {
4962
- value: "primary",
4963
- label: "Primary"
4964
- },
4965
- {
4966
- value: "secondary",
4967
- label: "Secondary"
4968
- },
4969
- {
4970
- value: "accent",
4971
- label: "Accent"
4972
- }
4973
- ];
4974
4159
  //#endregion
4975
4160
  //#region ../preview-next/src/client/preview/StyleConfigurator.tsx
4976
4161
  const PALETTE_BRAND_ROLES = [
@@ -5032,15 +4217,14 @@ const PALETTE_SURFACE_ROLES = [
5032
4217
  }
5033
4218
  ];
5034
4219
  function StyleConfigurator({ siteId, apiClient, theme, selectionId, selectionVersion = null, selectionUpdatedAt, initialSelections, buttonStyleRepairs, headerLogoContext, onFocusedSurfaceChange }) {
5035
- const journal = useOptionalSessionJournal();
4220
+ const journal = useSessionJournal();
5036
4221
  const authoringAllowed = usePreviewAuthoringAdmission();
5037
4222
  const designOpenRequest = usePreviewDesignOpenRequest();
5038
4223
  const router = useRouter();
5039
4224
  const previewDesign = usePreviewDesignCoordinator();
5040
4225
  const siteChromeCustomize = useSiteChromeCustomizeOptional();
5041
4226
  const footerPreferences = siteChromeCustomize ? siteChromeCustomize.getFooterPreferences() : defaultFooterPreferences;
5042
- const siteStyleHistory = siteChromeCustomize?.siteStyleHistory;
5043
- const setSiteStyleStagedPreviewActive = siteStyleHistory?.setStagedPreviewActive;
4227
+ const styleSelections = siteChromeCustomize?.styleSelections;
5044
4228
  const { applyFailed, applyStarted, applySucceeded, clearPreview, previewTheme } = previewDesign;
5045
4229
  const [isRefreshPending, startRefreshTransition] = useTransition();
5046
4230
  const baseSnapshot = useMemo(() => resolveStyleConfiguratorInitialSnapshot({
@@ -5062,7 +4246,6 @@ function StyleConfigurator({ siteId, apiClient, theme, selectionId, selectionVer
5062
4246
  const [typographySurface, setTypographySurface] = useState(typographyOverviewSurface);
5063
4247
  const fontCatalog = useTypographyFontCatalog(apiClient, siteId, state?.expandedRow === "typography");
5064
4248
  const hasLoadedState = state !== null;
5065
- const hasStagedSiteStylePreview = state ? isPreviewingChange(state) : false;
5066
4249
  const hasFocusedTypographySurface = state?.expandedRow === "typography" && typographySurface.kind !== "overview";
5067
4250
  const stateRef = useRef(state);
5068
4251
  const clearPreviewRef = useRef(clearPreview);
@@ -5083,13 +4266,6 @@ function StyleConfigurator({ siteId, apiClient, theme, selectionId, selectionVer
5083
4266
  useEffect(() => {
5084
4267
  clearPreviewRef.current = clearPreview;
5085
4268
  }, [clearPreview]);
5086
- useEffect(() => {
5087
- if (!setSiteStyleStagedPreviewActive) return;
5088
- setSiteStyleStagedPreviewActive(hasStagedSiteStylePreview);
5089
- return () => {
5090
- setSiteStyleStagedPreviewActive(false);
5091
- };
5092
- }, [hasStagedSiteStylePreview, setSiteStyleStagedPreviewActive]);
5093
4269
  useEffect(() => {
5094
4270
  if (!baseSnapshot) return;
5095
4271
  setState((current) => current ? syncStyleConfiguratorState(current, baseSnapshot) : createStyleConfiguratorState(baseSnapshot));
@@ -5235,11 +4411,9 @@ function StyleConfigurator({ siteId, apiClient, theme, selectionId, selectionVer
5235
4411
  if (!getCuratedSiteStyle(previewed.siteStyleId)) return;
5236
4412
  const reservation = acceptStyleSelection(journal, {
5237
4413
  siteId,
5238
- selectionId: selectionId ?? null,
5239
- before: live.base,
5240
- after: previewed
4414
+ selectionId: selectionId ?? null
5241
4415
  });
5242
- if (reservation?.kind === "busy") return;
4416
+ if (!reservation || reservation.kind === "busy") return;
5243
4417
  await runnerRef.current.run({
5244
4418
  optimistic: () => {
5245
4419
  applyStarted("style-configurator");
@@ -5247,36 +4421,35 @@ function StyleConfigurator({ siteId, apiClient, theme, selectionId, selectionVer
5247
4421
  },
5248
4422
  network: async () => {
5249
4423
  const saved = await persistStyleSelection(apiClient, siteId, selectionId, live, authoringAllowed).catch((error) => {
5250
- reservation?.refuse("reconcile");
4424
+ reservation?.fail(error);
5251
4425
  throw error;
5252
4426
  });
5253
- if (saved.journal) reservation?.settle({
5254
- revisionKind: "counter",
4427
+ reservation.settle({
5255
4428
  expectedRevision: saved.journal.expectedRevision,
5256
4429
  revision: saved.journal.revision,
5257
- change: {
5258
- kind: "theme-selection",
5259
- siteId,
5260
- selectionId: saved.journal.selectionId,
5261
- before: saved.journal.before,
5262
- after: saved.journal.after
5263
- }
4430
+ kind: "theme-selection",
4431
+ siteId,
4432
+ selectionId: saved.journal.selectionId,
4433
+ before: saved.journal.before,
4434
+ after: saved.journal.after
5264
4435
  });
5265
- else reservation?.refuse("reconcile");
5266
4436
  return saved;
5267
4437
  },
5268
4438
  onSuccess: (saved) => {
5269
4439
  const persisted = selectionSnapshotFromApplySiteStyleSelectionResponse(saved, previewed);
5270
- const historyEntry = styleConfiguratorHistoryEntryForPersistedSelection(live, persisted);
5271
4440
  setState((current) => current ? restageSelectionChanges(markApplySaved(current, persisted), restage?.staged ?? {}) : current);
5272
- if (historyEntry && !journal) siteStyleHistory?.recordAppliedSelection(historyEntry);
4441
+ styleSelections?.applied({
4442
+ via: "choice",
4443
+ from: live.base.siteStyleId,
4444
+ to: persisted.siteStyleId
4445
+ });
5273
4446
  applySucceeded("style-configurator");
5274
4447
  startRefreshTransition(() => {
5275
4448
  router.refresh();
5276
4449
  });
5277
4450
  },
5278
4451
  onError: (error) => {
5279
- reservation?.refuse("reconcile");
4452
+ reservation?.fail(error);
5280
4453
  applyFailed("style-configurator");
5281
4454
  const applyError = classifyStyleApplyError(error);
5282
4455
  if (applyError.kind === "stale") startRefreshTransition(() => {
@@ -5296,7 +4469,7 @@ function StyleConfigurator({ siteId, apiClient, theme, selectionId, selectionVer
5296
4469
  applySucceeded,
5297
4470
  router,
5298
4471
  selectionId,
5299
- siteStyleHistory,
4472
+ styleSelections,
5300
4473
  siteId,
5301
4474
  startRefreshTransition
5302
4475
  ]);
@@ -5356,38 +4529,49 @@ function StyleConfigurator({ siteId, apiClient, theme, selectionId, selectionVer
5356
4529
  if (state.expandedRow === "typography" && typographySurface.kind !== "overview") return /* @__PURE__ */ jsxs("div", {
5357
4530
  className: "flex h-full min-h-0 flex-col",
5358
4531
  "data-style-configurator-focused-surface": true,
5359
- children: [typographySurface.kind === "font-picker" ? /* @__PURE__ */ jsx(TypographyFontPickerTakeover, {
5360
- slot: typographySurface.slot,
5361
- value: typographySurface.slot === "heading" ? currentTypography.headings.default.family : currentTypography.body.family,
5362
- catalog: fontCatalog,
5363
- onBack: () => setTypographySurface(typographyOverviewSurface),
5364
- onChange: (family) => typographySurface.slot === "heading" ? handleHeadingTypographyChange({ family }) : handleBodyTypographyChange({ family }),
5365
- disabled: aggregateMutationControlsDisabled
5366
- }) : /* @__PURE__ */ jsx(TypographyAdvancedTakeover, {
5367
- typography: currentTypography,
5368
- catalog: fontCatalog,
5369
- onBack: () => setTypographySurface(typographyOverviewSurface),
5370
- onHeadingChange: handleHeadingTypographyChange,
5371
- onBodyChange: handleBodyTypographyChange,
5372
- onScaleChange: handleTypographyScaleChange,
5373
- disabled: aggregateMutationControlsDisabled
5374
- }), /* @__PURE__ */ jsx("div", {
5375
- className: "shrink-0 px-3 pb-3",
5376
- children: /* @__PURE__ */ jsx(StyleConfiguratorSaveControls, {
5377
- previewingChange,
5378
- saving,
5379
- canCancel: stagedCapabilities.canCancelStaged,
5380
- canApply: stagedCapabilities.canApplyStaged,
5381
- saveStatus: state.saveStatus,
5382
- onCancel: handleCancel,
5383
- onApply: () => void handleApply(),
5384
- onRetry: () => void handleApply()
4532
+ children: [
4533
+ /* @__PURE__ */ jsx(TypographyThemeFontStyles, {
4534
+ theme: currentPreviewPlan.themeOverlay,
4535
+ siteFonts: fontCatalog.site.value
4536
+ }),
4537
+ typographySurface.kind === "font-picker" ? /* @__PURE__ */ jsx(TypographyFontPickerTakeover, {
4538
+ slot: typographySurface.slot,
4539
+ value: typographySurface.slot === "heading" ? currentTypography.headings.default.family : currentTypography.body.family,
4540
+ catalog: fontCatalog,
4541
+ onBack: () => setTypographySurface(typographyOverviewSurface),
4542
+ onChange: (family) => typographySurface.slot === "heading" ? handleHeadingTypographyChange({ family }) : handleBodyTypographyChange({ family }),
4543
+ disabled: aggregateMutationControlsDisabled
4544
+ }) : /* @__PURE__ */ jsx(TypographyAdvancedTakeover, {
4545
+ typography: currentTypography,
4546
+ catalog: fontCatalog,
4547
+ onBack: () => setTypographySurface(typographyOverviewSurface),
4548
+ onHeadingChange: handleHeadingTypographyChange,
4549
+ onBodyChange: handleBodyTypographyChange,
4550
+ onScaleChange: handleTypographyScaleChange,
4551
+ disabled: aggregateMutationControlsDisabled
4552
+ }),
4553
+ /* @__PURE__ */ jsx("div", {
4554
+ className: "shrink-0 px-3 pb-3",
4555
+ children: /* @__PURE__ */ jsx(StyleConfiguratorSaveControls, {
4556
+ previewingChange,
4557
+ saving,
4558
+ canCancel: stagedCapabilities.canCancelStaged,
4559
+ canApply: stagedCapabilities.canApplyStaged,
4560
+ saveStatus: state.saveStatus,
4561
+ onCancel: handleCancel,
4562
+ onApply: () => void handleApply(),
4563
+ onRetry: () => void handleApply()
4564
+ })
5385
4565
  })
5386
- })]
4566
+ ]
5387
4567
  });
5388
4568
  return /* @__PURE__ */ jsxs("div", {
5389
4569
  className: "space-y-3",
5390
4570
  children: [
4571
+ /* @__PURE__ */ jsx(TypographyThemeFontStyles, {
4572
+ theme: currentPreviewPlan.themeOverlay,
4573
+ siteFonts: fontCatalog.site.value
4574
+ }),
5391
4575
  state.warnings.length > 0 ? /* @__PURE__ */ jsx(StyleConfiguratorWarningNotice, {
5392
4576
  warnings: state.warnings,
5393
4577
  onDismiss: handleDismissWarnings
@@ -5399,7 +4583,7 @@ function StyleConfigurator({ siteId, apiClient, theme, selectionId, selectionVer
5399
4583
  onPreview: handleChooseSiteStyle,
5400
4584
  disabled: aggregateMutationControlsDisabled
5401
4585
  }),
5402
- /* @__PURE__ */ jsx(StyleSwitchSummary, { history: siteStyleHistory }),
4586
+ /* @__PURE__ */ jsx(StyleSwitchSummary, { selection: styleSelections }),
5403
4587
  /* @__PURE__ */ jsx(SiteChromeSelectionRow, {
5404
4588
  label: "Header layout",
5405
4589
  ariaLabel: "Header layout",
@@ -5673,20 +4857,12 @@ function paletteLibrary(siteStyle, siteSlug, selectedKey) {
5673
4857
  };
5674
4858
  }
5675
4859
  function PaletteLibrary({ library, selectedValueKey, onPreview, disabled }) {
5676
- const optionRefs = useRef([]);
5677
4860
  const { suggested, more } = library;
5678
4861
  const items = [...suggested, ...more];
5679
- const onOptionKeyDown = (event, index) => {
5680
- if (items.length === 0) return;
5681
- const direction = event.key === "ArrowDown" || event.key === "ArrowRight" ? 1 : event.key === "ArrowUp" || event.key === "ArrowLeft" ? -1 : 0;
5682
- if (direction === 0) return;
5683
- event.preventDefault();
5684
- const nextIndex = (index + direction + items.length) % items.length;
5685
- const next = items[nextIndex];
5686
- if (!next) return;
5687
- onPreview(next.valueKey);
5688
- optionRefs.current[nextIndex]?.focus();
5689
- };
4862
+ const optionProps = useRadioOptions(items.length, (index) => {
4863
+ const item = items[index];
4864
+ if (item) onPreview(item.valueKey);
4865
+ });
5690
4866
  return /* @__PURE__ */ jsx("div", {
5691
4867
  role: "radiogroup",
5692
4868
  "aria-label": "Palette library",
@@ -5702,14 +4878,12 @@ function PaletteLibrary({ library, selectedValueKey, onPreview, disabled }) {
5702
4878
  }].map((group) => /* @__PURE__ */ jsx(CuratedPaletteGroup, {
5703
4879
  ...group,
5704
4880
  selectedValueKey,
5705
- optionRefs,
5706
- onPreview,
5707
- onOptionKeyDown,
4881
+ optionProps,
5708
4882
  disabled
5709
4883
  }, group.label))
5710
4884
  });
5711
4885
  }
5712
- function CuratedPaletteGroup({ label, items, selectedValueKey, offset, optionRefs, onPreview, onOptionKeyDown, disabled }) {
4886
+ function CuratedPaletteGroup({ label, items, selectedValueKey, offset, optionProps, disabled }) {
5713
4887
  if (items.length === 0) return null;
5714
4888
  return /* @__PURE__ */ jsxs("section", {
5715
4889
  "aria-label": label,
@@ -5719,16 +4893,10 @@ function CuratedPaletteGroup({ label, items, selectedValueKey, offset, optionRef
5719
4893
  }), /* @__PURE__ */ jsx("div", {
5720
4894
  className: "grid grid-cols-4 gap-2",
5721
4895
  children: items.map((item, index) => /* @__PURE__ */ jsxs("button", {
5722
- ref: (element) => {
5723
- optionRefs.current[offset + index] = element;
5724
- },
4896
+ ...optionProps(offset + index, item.valueKey === selectedValueKey),
5725
4897
  type: "button",
5726
- role: "radio",
5727
4898
  "aria-label": `${item.name}. ${item.description}`,
5728
- "aria-checked": item.valueKey === selectedValueKey,
5729
4899
  disabled,
5730
- onClick: () => onPreview(item.valueKey),
5731
- onKeyDown: (event) => onOptionKeyDown(event, offset + index),
5732
4900
  className: cn("relative h-10 overflow-hidden rounded-md border p-0.5 outline-none transition focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50", item.valueKey === selectedValueKey ? "border-foreground ring-1 ring-foreground" : "border-border hover:border-foreground/60"),
5733
4901
  children: [/* @__PURE__ */ jsx("span", {
5734
4902
  className: "grid h-full grid-cols-5 overflow-hidden rounded-[3px]",
@@ -5834,7 +5002,7 @@ function withResolvedSiteStyleSelections(input) {
5834
5002
  });
5835
5003
  }
5836
5004
  async function persistStyleSelection(apiClient, siteId, selectionId, live, admitted) {
5837
- if (!admitted()) throw new Error("Editor admission closed before the style save");
5005
+ if (!admitted()) throw new JournalWriteRefused("Editor admission closed before the style save");
5838
5006
  const body = buildApplySiteStyleSelectionBody({
5839
5007
  base: live.base,
5840
5008
  previewed: live.previewed,
@@ -5849,7 +5017,7 @@ async function persistStyleSelection(apiClient, siteId, selectionId, live, admit
5849
5017
  }
5850
5018
  //#endregion
5851
5019
  //#region ../preview-next/src/client/preview/PreviewEditorSidebar.tsx
5852
- function PreviewEditorSidebar({ surfaceId, siteId, dashboardBaseUrl = null, pageId, pageNodeType, entryData, contentTypeSchema, referenceContentTypeKeys = [], draftContent, currentTemplate, theme, themeId = null, themeSelectionId = null, themeSelectionVersion = null, themeSelectionUpdatedAt = null, themeSelectionButtonStyleSelection = null, themeSelectionButtonStyleRepairs, themeSelectionHeaderSelection = null, themeSelectionFooterLookId = null, themeSelectionHeaderLogo, apiClient, entrySubrouteContext, sdkConfig, bookingOfferingPresets, siteStyleAccess = { kind: "hidden" }, onClose, onFooterSaved, viewportMode, viewportWidth, zoom, onViewportModeChange, onViewportWidthChange, onZoomChange }) {
5020
+ function PreviewEditorSidebar({ surfaceId, siteId, dashboardBaseUrl = null, pageId, pageNodeType, entryData, contentTypeSchema, referenceContentTypeKeys = [], draftContent, currentTemplate, theme, themeId = null, themeSelectionId = null, themeSelectionJournalState, themeSelectionVersion = null, themeSelectionUpdatedAt = null, themeSelectionButtonStyleSelection = null, themeSelectionButtonStyleRepairs, themeSelectionHeaderSelection = null, themeSelectionFooterLookId = null, themeSelectionHeaderLogo, apiClient, entrySubrouteContext, sdkConfig, bookingOfferingPresets, siteStyleAccess = { kind: "hidden" }, onClose, onFooterSaved, viewportMode, viewportWidth, zoom, onViewportModeChange, onViewportWidthChange, onZoomChange }) {
5853
5021
  const controller = useEntryController();
5854
5022
  const controllerBlocks = controller.blocks;
5855
5023
  const uiStore = useEditorUiStoreInstance();
@@ -5923,6 +5091,7 @@ function PreviewEditorSidebar({ surfaceId, siteId, dashboardBaseUrl = null, page
5923
5091
  dashboardBaseUrl,
5924
5092
  theme: theme ?? null,
5925
5093
  selectionId: themeSelectionId,
5094
+ journalState: themeSelectionJournalState,
5926
5095
  selectionVersion: themeSelectionVersion,
5927
5096
  siteStyleAccess,
5928
5097
  inspection: footerInspection,