@riverbankcms/sdk 0.172.0 → 0.174.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 (215) hide show
  1. package/README.md +6 -1
  2. package/dist/_dts/{BlocksIslandsHydrator-DtrzTJ77.d.ts → BlocksIslandsHydrator-GqVX3I8E.d.ts} +1 -1
  3. package/dist/_dts/{Page-DViYbakk.d.ts → Page-BhUH31M-.d.ts} +27 -16
  4. package/dist/_dts/{SdkPreviewMode-D-5OeDbT.d.ts → SdkPreviewMode-DBn2x0UL.d.ts} +14 -7
  5. package/dist/_dts/{client-DZBOzd3U.d.ts → client-Cr-sOeSl.d.ts} +1002 -139
  6. package/dist/_dts/{content-types-DS3DrYn_.d.ts → content-types-DKw1yJdN.d.ts} +2 -2
  7. package/dist/_dts/{contracts-C3QGPCUf.d.ts → contracts-CJ2O03nB.d.ts} +6 -4
  8. package/dist/_dts/{footerPageOutline-D9Q7VIul.d.ts → footerPageOutline-DoGHHKr_.d.ts} +6 -6
  9. package/dist/_dts/{generatePageMetadata-R7NeFT1u.d.ts → generatePageMetadata-CJGu4hoa.d.ts} +2 -2
  10. package/dist/_dts/{index-Dns7OHyl.d.ts → index--39uLjrr.d.ts} +1 -1
  11. package/dist/_dts/{index-Da4UMgbs.d.ts → index-3GzargmS.d.ts} +2 -2
  12. package/dist/_dts/{index-DkFV_1Bc.d.ts → index-Bq-488M7.d.ts} +1 -1
  13. package/dist/_dts/{index-BnMavhoh.d.ts → index-DQZ5L0Gb.d.ts} +2 -2
  14. package/dist/_dts/{index-C0zjLMAW.d.ts → index-DYlfdT1O.d.ts} +2 -1
  15. package/dist/_dts/{index-CpOkfBt1.d.ts → index-DYsP4k6S.d.ts} +3 -3
  16. package/dist/_dts/{index-MuMYjetm.d.ts → index-DdEi2iXd.d.ts} +4 -4
  17. package/dist/_dts/{loadContent-DJmXHzfi.d.ts → loadContent-BVPagYmy.d.ts} +11 -11
  18. package/dist/_dts/{request-wQ28JWbr.d.ts → request-Be1E-H-V.d.ts} +4892 -1720
  19. package/dist/_dts/{resolveBlockData-C-IP53u9.d.ts → resolveBlockData-D1pL25bD.d.ts} +5 -5
  20. package/dist/_dts/{resolvePageContent-Cc4zqaEC.d.ts → resolvePageContent-B4sbTf96.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 +9 -9
  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/data/dataLoaderContext.d.ts +2 -2
  28. package/dist/_dts/sdk/src/data/resolveBlockData.d.ts +1 -1
  29. package/dist/_dts/sdk/src/data/types.d.ts +2 -2
  30. package/dist/_dts/sdk/src/index.d.ts +8 -8
  31. package/dist/_dts/sdk/src/manifest/index.d.ts +3 -3
  32. package/dist/_dts/sdk/src/metadata/index.d.ts +1 -1
  33. package/dist/_dts/sdk/src/navigation/index.d.ts +6 -2
  34. package/dist/_dts/sdk/src/next/index.d.ts +7 -7
  35. package/dist/_dts/sdk/src/next/middleware.d.ts +2 -2
  36. package/dist/_dts/sdk/src/page-converter/index.d.ts +3 -3
  37. package/dist/_dts/sdk/src/portal/client.d.ts +4 -2
  38. package/dist/_dts/sdk/src/prebuild/index.d.ts +1 -1
  39. package/dist/_dts/sdk/src/preview-next/before-render.d.ts +2 -2
  40. package/dist/_dts/sdk/src/preview-next/client/index.d.ts +2 -2
  41. package/dist/_dts/sdk/src/preview-next/client/runtime.d.ts +1 -1
  42. package/dist/_dts/sdk/src/rendering/client.d.ts +2 -2
  43. package/dist/_dts/sdk/src/rendering/components/pageShared.d.ts +1 -1
  44. package/dist/_dts/sdk/src/rendering/helpers/loadPage.d.ts +1 -1
  45. package/dist/_dts/sdk/src/rendering/helpers/pageRuntimeSupport.d.ts +13 -8
  46. package/dist/_dts/sdk/src/rendering/index.d.ts +6 -6
  47. package/dist/_dts/sdk/src/rendering/islands/client.d.ts +1 -1
  48. package/dist/_dts/sdk/src/rendering/server.d.ts +2 -2
  49. package/dist/_dts/sdk/src/rendering/themeAdmission.d.ts +1 -1
  50. package/dist/_dts/sdk/src/routing/index.d.ts +5 -5
  51. package/dist/_dts/sdk/src/server.d.ts +5 -5
  52. package/dist/_dts/sdk/src/spam-protection/index.d.ts +2 -2
  53. package/dist/_dts/sdk/src/theme/index.d.ts +36 -204
  54. package/dist/_dts/{types-CpjyP5I4.d.ts → types-5MeDI1w8.d.ts} +7 -7
  55. package/dist/_dts/{types-DrinAfeW.d.ts → types-Bm5_3VEd.d.ts} +3 -3
  56. package/dist/_dts/{types-ZuZoGsZV.d.ts → types-CVoCc_Ia.d.ts} +2 -2
  57. package/dist/_dts/{validation-CIZ_fP5l.d.ts → validation-lEtYD-Rh.d.ts} +4 -4
  58. package/dist/client/{BlocksIslandsHydrator-UFmQB1BE.mjs → BlocksIslandsHydrator-DkflFLGQ.mjs} +17 -17
  59. package/dist/client/{BookingMailingListNote-VjRYhx1c.mjs → BookingMailingListNote-CAyoiAGD.mjs} +18 -12
  60. package/dist/client/{BookingPanelArrangement-DpqnRo-t.mjs → BookingPanelArrangement-C7yiJrxm.mjs} +1 -1
  61. package/dist/client/{BookingQuestionFields-CzOT8ZWo.mjs → BookingQuestionFields-DZMrGvBh.mjs} +3 -3
  62. package/dist/client/{CalendarNavigationChevron-CNckKZct.mjs → CalendarNavigationChevron-BPQU5Snc.mjs} +41 -34
  63. package/dist/client/{DemoBookingPortalAccess-CmZLVXOy.mjs → DemoBookingPortalAccess-BnEgvJas.mjs} +22 -22
  64. package/dist/client/{EventCalendar.client-BU-SxLCn.mjs → EventCalendar.client-BiWQc28-.mjs} +11 -10
  65. package/dist/client/{EventCombined.client-f28VltfY.mjs → EventCombined.client-B_ytWQtn.mjs} +10 -9
  66. package/dist/client/{EventItem-sKBofjiW.mjs → EventItem-C-mxXpX_.mjs} +25 -16
  67. package/dist/client/{EventListWeekNavigation-IAcax47T.mjs → EventListWeekNavigation-Bm3Ap1Rd.mjs} +1 -1
  68. package/dist/client/{EventListing.client-BEtnRvZr.mjs → EventListing.client-Bs_8im5_.mjs} +3 -3
  69. package/dist/client/{EventListing.view-BZ4l_rmT.mjs → EventListing.view-CN7BjGgC.mjs} +37 -14
  70. package/dist/client/{EventRegistrationPayment-BWb295cD.mjs → EventRegistrationPayment-DPkRcSdw.mjs} +848 -146
  71. package/dist/client/{LocationMapActions-Hsj2HC_1.mjs → LocationMapActions-BJT7MqP2.mjs} +1 -1
  72. package/dist/client/{MapDrawingSvg-C7E7Lyfa.mjs → MapDrawingSvg-DCIwlON6.mjs} +1 -1
  73. package/dist/client/{Page-Ds1s3DuC.mjs → Page--xJ23nA5.mjs} +1160 -521
  74. package/dist/client/{StepIndicator-CSCyAaKY.mjs → StepIndicator-D391QRNc.mjs} +85 -13
  75. package/dist/client/{accessibleSurfaces-OsAseM7H.mjs → accessibleSurfaces-DN8it_Cx.mjs} +36 -27
  76. package/dist/client/{accordion-DgwFZJSx.mjs → accordion-BQtTkDN8.mjs} +1 -1
  77. package/dist/client/bookability-CE637yDE.mjs +17 -0
  78. package/dist/client/{booking-form.client-CKY9oksp.mjs → booking-form.client-D9M7TKGV.mjs} +362 -47
  79. package/dist/client/{bookingForm-CsHhcdSF.mjs → bookingForm-BsOS0sl9.mjs} +4 -4
  80. package/dist/client/bookings.mjs +6 -6
  81. package/dist/client/{boxStyleClassNames-B1Z_TGAe.mjs → boxStyleClassNames-CNDLpT06.mjs} +1 -1
  82. package/dist/client/{carousel-0sw2Kc3a.mjs → carousel-CPsW-FPh.mjs} +1 -1
  83. package/dist/client/{cart-CPfvMDGJ.mjs → cart-CwElmocm.mjs} +3 -3
  84. package/dist/client/{cart.client-BJBPUTmg.mjs → cart.client-RpqI56w8.mjs} +1 -1
  85. package/dist/client/{checkout-DU4JFjGT.mjs → checkout-CfMgqY8H.mjs} +3 -3
  86. package/dist/client/{checkout.client-BbNCO4xa.mjs → checkout.client-BpuPyOuJ.mjs} +1 -1
  87. package/dist/client/{checkoutUrls-BQ3OlWlM.mjs → checkoutUrls-VeHY6WYj.mjs} +1 -1
  88. package/dist/client/client.mjs +206 -7
  89. package/dist/client/{context-xNC1Cyjw.mjs → context-CNlesLfF.mjs} +81 -14
  90. package/dist/client/{cta-CNVQHLKs.mjs → course-q1sA4Cj-.mjs} +77 -3
  91. package/dist/client/{creditProducts-BTRX4edc.mjs → creditProducts-KYMVIH3J.mjs} +2 -84
  92. package/dist/client/{dateFormatting-B6ea-egy.mjs → dateFormatting-B73Ll0s4.mjs} +9 -1
  93. package/dist/client/{demoPortalMagicLink-BhjGxhX3.mjs → demoPortalMagicLink-BVbLD4pi.mjs} +1 -1
  94. package/dist/client/{display-B5DfNb6A.mjs → display-D8MW2b0e.mjs} +3076 -819
  95. package/dist/client/{enhanceHeaderSection-BFcHLuqk.mjs → enhanceHeaderSection-BzjY6AiY.mjs} +3 -3
  96. package/dist/client/{event-details.client-WHT5GLn2.mjs → event-details.client-CseTWUFC.mjs} +1 -1
  97. package/dist/client/{event-registration.client-CmnRKELC.mjs → event-registration.client-b5TLxntR.mjs} +1315 -553
  98. package/dist/client/{eventCalendar-2NbdCyov.mjs → eventCalendar-C-kJNIc9.mjs} +4 -4
  99. package/dist/client/{eventCombined-D1lH1n2T.mjs → eventCombined-BgHJGhwE.mjs} +4 -4
  100. package/dist/client/{eventDetails-BHvnF2Tw.mjs → eventDetails-CAwbreD0.mjs} +2 -2
  101. package/dist/client/{eventListing-EhSDk4UL.mjs → eventListing-_14atrj8.mjs} +4 -4
  102. package/dist/client/{eventRegistration-z_0jN_KS.mjs → eventRegistration-BOqSdstJ.mjs} +4 -4
  103. package/dist/client/{form-BfChzSkS.mjs → form-DfAB-llc.mjs} +3 -3
  104. package/dist/client/{form.client-D1zehtPk.mjs → form.client-DN-I9_qC.mjs} +6 -6
  105. package/dist/client/{form.parts-rMDlUQIv.mjs → form.parts-t2Q1neM6.mjs} +1 -1
  106. package/dist/client/{formatDate-ymSVT9Y5.mjs → formatDate-Dp7POa9Y.mjs} +1 -1
  107. package/dist/client/gifting/client.mjs +2 -2
  108. package/dist/client/{headerSection-BX9bQ84k.mjs → headerSection-Dces54pb.mjs} +2 -2
  109. package/dist/client/{newsletter-form.client-DMbuJCtJ.mjs → newsletter-form.client-D_YFUlR2.mjs} +9 -7
  110. package/dist/client/{newsletter-form.parts-BxrVsoI0.mjs → newsletter-form.parts-URO5Mn_I.mjs} +1 -1
  111. package/dist/client/{newsletterForm-B_I3FJFS.mjs → newsletterForm-_c9fKIzS.mjs} +3 -3
  112. package/dist/client/{noop-CamIX2yK.mjs → noop-D5mFWXtN.mjs} +139 -12
  113. package/dist/client/portal/client.mjs +346 -272
  114. package/dist/client/{product-detail.client-qxuiYCof.mjs → product-detail.client-CVW1UIxJ.mjs} +1 -1
  115. package/dist/client/{product-list.client-CDL-jihv.mjs → product-list.client-CF9hO23G.mjs} +1 -1
  116. package/dist/client/{productDetail-B97m0uZy.mjs → productDetail-C_qbmUuP.mjs} +3 -3
  117. package/dist/client/{productList-DE4vSSG_.mjs → productList-Df5qDD0z.mjs} +3 -3
  118. package/dist/client/{propsDecoder-BTde6Syh.mjs → propsDecoder-BiEyK2ii.mjs} +3 -3
  119. package/dist/client/{registry.server-Cn8XjRte.mjs → registry.server-ClcfWpvM.mjs} +93 -63
  120. package/dist/client/rendering/client.mjs +26 -26
  121. package/dist/client/rendering/islands.mjs +1 -1
  122. package/dist/client/rendering.mjs +34 -61
  123. package/dist/client/{richText-coerce-Bcl3vTb4.mjs → richText-coerce-C32cRQ03.mjs} +1 -1
  124. package/dist/client/{routeIslandApiConfig-BjRoLoMD.mjs → routeIslandApiConfig-DAypPzSo.mjs} +1 -1
  125. package/dist/client/{runtimeResponse-B-lrAGhX.mjs → runtimeResponse-9v8q2NBc.mjs} +1 -1
  126. package/dist/client/runtimeResponse-CVkM0dHy.mjs +3 -0
  127. package/dist/client/{shop-commerce-BsY7a71m.mjs → shop-commerce-Bw4_BXQg.mjs} +12 -11
  128. package/dist/client/{shop-commerce-store-BZ5j90HD.mjs → shop-commerce-store-Da6Ah-_4.mjs} +1 -1
  129. package/dist/client/shop-discount-apply.state-DidgH7ow.mjs +166 -0
  130. package/dist/client/{shop-BC4H0oYT.mjs → shop-gteEpeO5.mjs} +3 -3
  131. package/dist/client/{shop.client-WgGVGelc.mjs → shop.client-CbbdjWWd.mjs} +13 -12
  132. package/dist/client/{shop.interactive-Bb67gPLL.mjs → shop.interactive-CKFORzux.mjs} +45 -29
  133. package/dist/client/{shopShared-BE6TEk2A.mjs → shopShared-C7QjoywZ.mjs} +2 -2
  134. package/dist/client/stable-json-D0XAEIXc.mjs +22 -0
  135. package/dist/client/{timetableModel-Bbz_ECL5.mjs → timetableModel-CtZiIj9q.mjs} +25 -15
  136. package/dist/client/{useAvailableSlots-CdP14E_b.mjs → useAvailableSlots-CUVRD1nx.mjs} +39 -8
  137. package/dist/client/{useDiscountApply-DvOSso2l.mjs → useDiscountApply-BZU5DWZQ.mjs} +4 -167
  138. package/dist/client/{useDiscountCodeUi-B4fRd2jy.mjs → useDiscountCodeUi-BuLgof7O.mjs} +1 -1
  139. package/dist/client/{useEventPagination-M3jC8lgP.mjs → useEventPagination-B4VPtSEF.mjs} +6 -6
  140. package/dist/client/{view-DNNNbnNj.mjs → view-CvlTplao.mjs} +2 -2
  141. package/dist/client/{view-B0TFnP4y.mjs → view-CxUpgcM6.mjs} +56 -34
  142. package/dist/preview-next/client/{LocationPickerEnvironment-D4F_5rnr.mjs → LocationPickerEnvironment-8iKKoYZr.mjs} +1 -1
  143. package/dist/preview-next/client/{MapLibreEditMap-BKMNxSEJ.mjs → MapLibreEditMap-AIUPN1Zx.mjs} +2 -2
  144. package/dist/preview-next/client/{PageSectionToolbar-D59tHj_L.mjs → PageSectionToolbar-BFbSrDbi.mjs} +80 -160
  145. package/dist/preview-next/client/{PreviewEditorSidebar-CjOIZlUk.mjs → PreviewEditorSidebar-BtpzqQ-i.mjs} +780 -1634
  146. package/dist/preview-next/client/{PreviewEditorUI--kS9Cwsc.mjs → PreviewEditorUI-z22h-CCY.mjs} +29 -26
  147. package/dist/preview-next/client/{PreviewShell-Bi8-rclb.mjs → PreviewShell-BW3Qpoa_.mjs} +52 -32
  148. package/dist/preview-next/client/{SdkPreviewModeRuntime-CWTUw-3L.mjs → SdkPreviewModeRuntime-BvVeK1hR.mjs} +47 -69
  149. package/dist/preview-next/client/{lucide-react-BCNn8dEQ.mjs → lucide-react-Dfgl3Vtq.mjs} +7 -1
  150. package/dist/preview-next/client/{previewAssistantSlot-Caofnr1Z.mjs → previewAssistantSlot-BUqAh1FL.mjs} +98429 -46667
  151. package/dist/preview-next/client/{previewChromeRoot-CbAI_jSH.mjs → previewChromeRoot-NCy5zHO8.mjs} +1 -1
  152. package/dist/preview-next/client/runtime.mjs +3 -3
  153. package/dist/preview-next/client/{sdk-runtime-DY65_hLk.mjs → sdk-runtime-CxmKDVGZ.mjs} +2 -2
  154. package/dist/preview-next/client/siteStyleAccess-B_UaDyJO.mjs +9356 -0
  155. package/dist/preview-next/client/{useAutosaveStatus-CakNU3lp.mjs → useAutosaveStatus-BqmWvPLY.mjs} +2 -2
  156. package/dist/preview-next/client/{useOpenBlockForSetup-CCEMkosU.mjs → useOpenBlockForSetup-LAllV0rU.mjs} +8 -4
  157. package/dist/preview-next/container-responsive.css +117 -32
  158. package/dist/preview-next/keepAlive.mjs +1 -1
  159. package/dist/preview-next/middleware.mjs +1 -1
  160. package/dist/preview-next/{route-contract-DsKDQoVW.mjs → route-contract-DV6SeCNv.mjs} +200 -2
  161. package/dist/server/{Block.shared-D7Qy9F4a.mjs → Block.shared-Ch2FKAvU.mjs} +11 -6
  162. package/dist/server/{ThemeScopeCore-D1NTXZdX.mjs → ThemeScopeCore-DFvjDVzi.mjs} +23 -6
  163. package/dist/server/{accessibleSurfaces-Dbd2__Le.mjs → accessibleSurfaces-CM3QANtw.mjs} +22 -5
  164. package/dist/server/{bindings-Bp6OnR3n.mjs → bindings-CQg2lzZn.mjs} +6 -4
  165. package/dist/server/{client-dROAfMRa.mjs → client-aYRTVneD.mjs} +205 -6
  166. package/dist/server/config-validation.mjs +1 -1
  167. package/dist/server/config.mjs +2 -2
  168. package/dist/server/customCss-BGB8gMVb.mjs +210 -0
  169. package/dist/server/data/resolveBlockData.mjs +1 -1
  170. package/dist/server/{identity-20XHqyuO.mjs → identity-DQD_8lNO.mjs} +1 -1
  171. package/dist/server/index.mjs +3 -3
  172. package/dist/server/{loadContent-zOIrtqz-.mjs → loadContent-Cgpfr44e.mjs} +8 -10
  173. package/dist/server/{loadPage-vwFiq1Rk.mjs → loadPage-RDk10NMP.mjs} +3 -3
  174. package/dist/server/lookMediaFrame-CQtkvlDn.mjs +2528 -0
  175. package/dist/server/manifest.mjs +2 -2
  176. package/dist/server/{media-Brn9FW5s.mjs → media-luf7RF22.mjs} +2 -2
  177. package/dist/server/{navigation-DAwbICEL.mjs → navigation-iC_hXjJI.mjs} +3 -1
  178. package/dist/server/navigation.mjs +1 -1
  179. package/dist/server/next.mjs +9 -8
  180. package/dist/server/{overrideResolution-DjboggbB.mjs → overrideResolution-VhhN94d8.mjs} +3 -4
  181. package/dist/server/page-converter.mjs +2 -2
  182. package/dist/server/{pageRenderPlan-BR4t1rOw.mjs → pageRenderPlan-CkFTsxkd.mjs} +166 -42
  183. package/dist/server/{pageRuntimeSupport-BKo6XVK-.mjs → pageRuntimeSupport-CpAtzNxD.mjs} +15 -7
  184. package/dist/server/{pageShared-BJjptSGp.mjs → pageShared-B8yLPjs0.mjs} +531 -117
  185. package/dist/server/{parseThemeForPersistence-B18KDEue.mjs → parseThemeForPersistence-Cwqb5pZx.mjs} +2 -2
  186. package/dist/server/{portal-Ce1Prfl3.mjs → portal-BjVHMAUC.mjs} +1 -1
  187. package/dist/server/portal.mjs +1 -1
  188. package/dist/server/{prebuild-CntSkZQI.mjs → prebuild-DOu6QceG.mjs} +1 -1
  189. package/dist/server/prebuild.mjs +1 -1
  190. package/dist/server/{prefetchBlockData-BM9Ds0OQ.mjs → prefetchBlockData-CfOXFKYG.mjs} +3 -3
  191. package/dist/server/{registry-wYH0LH5f.mjs → registry-34rkAfaU.mjs} +1409 -3314
  192. package/dist/server/rendering/components/pageShared.mjs +1 -1
  193. package/dist/server/rendering/helpers/loadPage.mjs +1 -1
  194. package/dist/server/rendering/helpers/pageRuntimeSupport.mjs +2 -2
  195. package/dist/server/rendering/server.mjs +3 -3
  196. package/dist/server/rendering.mjs +8 -8
  197. package/dist/server/{resolveBlockData-Bu_p4HxZ.mjs → resolveBlockData-D7VeoWgr.mjs} +1 -1
  198. package/dist/server/{resolveButtonColourStates-CCPUY9Xh.mjs → resolveButtonColourStates--6yJp9Tq.mjs} +15 -4
  199. package/dist/server/{responseMedia-t6gs0cB7.mjs → responseMedia-DpBC1hTM.mjs} +1 -1
  200. package/dist/server/{schema-BFOqYIMQ.mjs → schema-CUDHMirj.mjs} +440 -154
  201. package/dist/server/server.mjs +3 -3
  202. package/dist/server/{src-Cxucn-1P.mjs → src-DHK4JUlp.mjs} +4 -1
  203. package/dist/server/theme-bridge.mjs +21 -15
  204. package/dist/server/theme.mjs +2 -2
  205. package/dist/server/{three-pass-converter-Bsfdy_ZV.mjs → three-pass-converter-39SXCCnh.mjs} +1 -1
  206. package/dist/server/{titleSourceSchema-DwKJfMYb.mjs → titleSourceSchema-Cu-3PRvv.mjs} +0 -1
  207. package/dist/server/{validation-DAQdPDku.mjs → validation-CLVKoJrX.mjs} +5 -5
  208. package/dist/server/{version-DAB0O3yx.mjs → version-HVfdvBJ0.mjs} +1 -1
  209. package/dist/styles/index.css +1038 -200
  210. package/package.json +1 -1
  211. package/dist/client/runtimeResponse-CPcA8xSm.mjs +0 -3
  212. package/dist/preview-next/client/SiteChromeCustomizeButton-CrgS3I8d.mjs +0 -53534
  213. package/dist/server/customCss-QymcmOZ-.mjs +0 -97
  214. package/dist/server/opaqueSurface-COEKXVwk.mjs +0 -54
  215. package/dist/server/rich-text-CRcONdyM.mjs +0 -33
@@ -1,14 +1,14 @@
1
1
  "use client";
2
2
  import { n as __exportAll } from "./rolldown-runtime-CE6sIgz8.mjs";
3
- import { $_ as authoredValuesEqual, $d as deriveFieldValidationPlan, $h as isAcceptedRepeaterGridSpan, $l as suggestSemanticIconForFeatureCard, $n as getAtPath, $t as useSidebarView, A as usePreviewRenderReadiness, A_ as getDirectImageUrlForMediaAsset, Ah as useControllableState, Ai as chooseScheduleScope, An as getGroupChildFields, At as listPageSurfaceContentSlots, Ay as parseSiteId, B_ as asRecord, Bh as createSlot, Bm as DialogHeader, Br as buildNewsletterFormInteractiveIslandProps, Bv as createEditorRemoveBlockCommand, Ca as resolveMediaSlotContract, Cf as plainTextToInlineText, Ch as useId$1, Cm as unwrapResponse, Cn as initialBlockDraftValues, Cp as sectionTransitionFamilies, Ct as partitionFieldsByIntent, Cv as knownSocialPlatformLabels, Cy as assertNever$1, Df as parseFieldDefinition, Di as EVENT_SELECTION_SCOPE_OPTIONS, Dm as journalTargetKey, Dn as getFieldDefault, Dt as deleteSlotBlock, Dv as publishedContactDetails, Eh as DismissableLayer, Em as journalLabels, En as manifestFieldSectionOptions, Et as deleteBlock, Ev as publicProfileWeekdays, Ey as parseMediaAssetId, Ff as sectionPhotoPresence, Fm as Dialog, Ft as normalizeApiError, Fv as knownRevision, G_ as asAppearancePresetId, Gf as concretePaletteFromTheme, Gh as useShallow, Gp as flowRepeaterGridItems, Gt as routeLifecycleContext, Gv as unsafeAsEditorBlockValues, Hm as DialogTrigger, Hn as rankBackgroundImagePoolItems, Hp as planRepeaterGridSpanChange, Hv as editorBlockCollectionOwnerKey, I as selectedLookTile, Ih as Button$1, Im as DialogClose, In as enabledBackgroundModes, Iv as pristineValueSync, J as runHeldLifecycle, Jh as canWriteLinkedEntry, Jl as createFeatureCardIconKey, Jp as planRepeaterGridStartNewRow, Jt as resolveContentTitle, Kf as concretePaletteToTheme, Kl as FEATURE_CARD_GENERATED_ICON_SIZE_PX, Kp as isRepeaterGridLayoutInvalid, Kt as deriveRouteMetadataPresentation, Kv as formatDate, Lh as buttonVariants, Lm as DialogContent, Ln as imagePoolForOverride, Lt as getDashboardUrl, Lv as syncStateOf, M_ as mediaSchema, Mh as createContextScope, Mi as toggleEventType, Mm as Callout, Mn as readSliderFieldUiConfig, Mr as getBlockDefinition, Mt as reorderSlotBlocks, My as expectParsedBrandedId, N as lookTilePosition, N_ as runtimeMediaSchema, Nh as composeEventHandlers, Ni as writeEventSelectionChips, Nm as CalloutDescription, Nr as listBlockDescriptors, Nt as withSlotCompositionHash, O as usePreviewJoinOutcome, O_ as parseAspectRatioValue, Oh as useDirection, Oi as EVENT_SELECTION_TYPE_OPTIONS, Om as journalTrustAt, On as getRepeaterItemDefault, Ot as isSurfaceSlotBlockTarget, P as lookTilesFor, Ph as Primitive, Pm as CalloutTitle, Pn as canCycleBackgroundOverrideValue, Pt as blocksKeys, Pv as displayedValues, Qd as admitLayoutGridForPlan, Qf as defaultPolicyPageFlowPresetId, R_ as PUBLIC_FILE_FIELD_KINDS, Rm as DialogDescription$1, Rp as isInternalResolvedLinkValue, Rv as valueStatus, S as setPageDesignBlockBackground, Sh as useSize, Sm as extractApiEnvelopeErrorDetails, So as planOfferingPreviewCardSelection, Sp as defaultSectionTransitionVariantForFamily, St as isNonEmptyValue, Sv as parseNewsletterListId, T_ as isRotationDimensionSwap, Td as isBlockButtonRole, Th as useFocusGuards, Tm as sidebarReturnView, Tn as createManifestValidation, Tp as sectionTransitionVariantForBoundaryOptionId, Tt as createSlotBlock, Tv as parsePublicProfile, Uf as getHeaderLayout, Uh as useComposedRefs, Un as resolveBackgroundCapability, Up as projectRepeaterGridLayout, Uv as editorBlockCollectionOwnersEqual, V as usePreviewAuth, V_ as getFontWidthRange, Vm as DialogTitle$1, Vn as planBackgroundTransition, Vp as buildRepeaterGridDropTargets, Vt as ApiRequestError, Vv as createEditorReorderBlocksCommand, W as useEntryController, Wf as getHeaderStyle, Wh as cn, Wp as findFirstAvailableRepeaterGridPlacement, Wv as unsafeAsEditorBlockId, X as useServerRefresh, Xh as canEditorWrite, Xl as parseFeatureCardGeneratedIconSizePx, Xm as DialogTitle, Xp as resolveRepeaterGridBreakpointForWidth, Xt as useEditorUiStore, Yh as readLinkedEntryLease, Yl as getFeatureCardIconCompletion, Yp as resolveRepeaterGridAcceptedSpans, Yt as planLeaseNotice, Z as useSessionJournal, Zl as resolveFeatureCardGeneratedIconSizePx, Zp as resolveRepeaterGridColumnsForBreakpoint, Zt as useEditorUiStoreInstance, _a as resolveImageSourceSetWithContext, _h as Anchor, _n as useStore, _o as isOfferingsPreviewSourceKey, _t as collectVisibleWhenWatchPaths, _v as mailingListTargetingChoiceIds, af as getBlockIconSemanticId, ag as buttonStyleSelectionParameterValue, ay as parseBookingLocalDate, bh as Root2$1, bn as deriveEditorValuePublicationState, bt as getWidgetKey, bv as parseMailchimpAudienceId, cg as updateButtonStyleHoverPreference, cn as journalNoticeMessage, cp as gradientToCss, ct as LeaseNoticeButtons, cy as resolveBookingTimeZoneId, d as cycleSiteChromeSelectionId, d_ as paletteValueKey, df as parseSiteIconStyleGuideVersionId, dh as hideOthers, dp as findCuratedPalette, dt as JournalWriteRefused, dv as assessMailingListTargeting, dy as toUtcIsoDateTimeString, eg as resolveRepeaterGridColumnFieldId, en as recoveryConflictCopy, er as siblingPath$2, eu as toFeatureCardIconSuggestionInputs, fm as editorAdmissionSession, fv as resolveMailingListDefaultDestination, gh as Portal$1, go as inferLegacyOfferingsPreviewGroupOrder, gt as derivePromotedFieldPlan, gv as DEFAULT_MAILING_LIST_TARGETING, hh as Presence, ht as publishContentEntry, i as usePreviewSidebarNavigation, ig as buttonStyleHoverPreferenceValue, im as resolveBlockTitle, ip as palettesForSiteStyle, jf as resolveVisiblePromotedFieldPathsForEditorBlock, ji as readEventSelectionChips, jn as readNumberFieldUiConfig, jp as appearancePresets, jt as reorderBlocks, ju as buildFormInteractiveIslandProps, jy as unsafeAsSiteId, k_ as resolveMediaTransformForAspect, kh as createCollection, ki as chooseAllEvents, kn as normalizeFieldForCanonicalValidation, kt as listEntryPageContentSlots, lf as parseGeneratedIconAssetId, lg as updateButtonStyleSelectionChoice, lm as editorAdmissionIsOpen, ln as lifecycleOutcomeMessage, lp as GRADIENT_PRESETS, mm as OPERATION_ID_HEADER, mp as findFooterLook, mt as missingReceiptError, mv as parseMailingListPlacementTargeting, n as usePreviewAssistantSlot, ng as resolveRepeaterGridSpanFieldId, nh as ReactRemoveScroll, nn as unfinishedBlockCopy, o as usePreviewPageDesignEditorState, of as getGeneratedBlockIconStyleState, og as findButtonStyleRecipe, ov as generateUuidV4, pa as computeMediaTransformStyle, pf as coerceInlineTextWithFallback, pt as sendPageCommand, pv as mailingListProviderName, q as DONE, qh as isEdited, qm as DialogDescription, qp as normalizeRepeaterGridSpan, qt as resolvePageRouteSlug, qv as formatDateTime, rf as sanitizeHref, rg as siteOptionSources, rp as offeredSiteStyles, s as usePreviewPageDesignRenderState, sf as parseBlockIconValue, sg as resolveButtonStyleSelection, sn as selectJournalWriteState, st as LeaseDiscardedNoticeView, sv as slugify$1, sy as resolveBookingBusinessTimeZone, tf as isRichTextDoc, tg as resolveRepeaterGridRowFieldId, th as usePortalContainer, tp as getCuratedSiteStyle, tr as withValueAtPath, u as useSiteChromeCustomizeOptional, uf as parseGeneratedIconSetId, ug as buttonStyleSelectionKey, up as getGradientPreset, uy as parseUtcIsoDateTimeString, v as buildPageDesignEditorReadModelForBlocks, va as resolveImageUrlWithContext, vf as inlineTextToPlainText, vh as Arrow$1, vn as toEditorBlockItem, vo as normalizeOfferingsPreviewGroupOrder, vt as evaluateVisibility, wa as buildResolveImageUrlContext, wd as BLOCK_BUTTON_ROLE_OPTIONS, wh as FocusScope, wn as createManifestFormAdapter, wo as resolveOfferingsPreviewGroupOrderEntries, wp as sectionTransitionFamilyForBoundaryOptionId, wt as createBlock, wv as knownSocialPlatforms, x as pageDesignLookTiles, xh as createPopperScope, xt as hasVisibilityConditions, xv as parseMailchimpInterestId, yh as Content, yn as withoutServerVersions, yt as getFieldIntent, yv as parseBrevoListId, z_ as mediaIdentifierSchema, zh as cva, zm as DialogFooter, zn as parseBackgroundOverrideFromContent, zp as planLayoutGridColumnEdit, zv as createEditorInsertBlockCommand } from "./previewAssistantSlot-Caofnr1Z.mjs";
4
- import { $ as EllipsisVertical, A as LoaderCircle, B as ImageOff, E as Maximize2, G as FileText, Gt as err, Kt as ok, L as Image, O as Lock, P as Link2, R as ImageUp, S as Palette, U as GripVertical, Z as EyeOff, _t as Box$1, b as PanelTop, bt as ArrowUpRight, c as Trash2, d as SlidersHorizontal, dt as ChevronRight, f as Settings, ft as ChevronLeft, g as RotateCcw, ht as Calendar$1, i as Video, it as Clock3, lt as CircleAlert, m as Rows3, mt as Check, n as X$1, nt as Copy, pt as ChevronDown, rt as Clock, s as TriangleAlert, t as lucide_react_exports, tt as Crop, u as Sparkles, v as Plus, x as PanelBottom, xt as ArrowDown, y as Pencil, yt as ArrowUp, z as ImagePlus } from "./lucide-react-BCNn8dEQ.mjs";
5
- import { $t as Textarea, An as removeFooterEngagementSection, C as HeaderMenuControls, Cn as Trigger$1, Dn as normalizeLegacyFooterContentToV1, En as deriveFooterEditorOverview, Fn as footerArrangementPolicy, G as useSiteOptionWidgetContext, Gt as buildThemeRuntime, H as resolveFooterLayoutHints, Ht as buildThemeDataAttrs, I as siteColourCss, In as planFooterArrangement, J as getPublicProfile, Jt as DEFAULT_THEME_RESPONSIVE_MODE, K as getFooterComposition, Kt as escapeStyleContent, L as locationWidgetOverrides, Mn as setFooterSectionSelected, Nn as upsertFooterEngagementSection, On as parseFooterEngagementSection, Pn as validateFooterComposition, Q as footerCreditLine, S as useSiteFontStorageUrl, Sn as Root$2, St as ThemeScopeCore, Tn as classifyKnownMimeType, V as buildFooterRuntimeViewModel, W as SiteOptionWidgetProvider, Wt as themeRuntimeScopeProps, X as updateFooterCredit, Xt as CHOSEN_OPTION_CLASS, Y as updateFooterComposition, Z as updatePublicProfile, Zt as ChoiceTileGroup, _n as Content$2, _t as FieldFrame, an as usePrevious$1, at as NewsletterFormClient, b as resolvePreviewSidebarChromeModel, bn as Trigger$2, bt as useLinkedInlineTextField, cn as FieldTrigger, ct as FormNodeClient, d as CustomizeBackgroundControlRows, dn as FIELD_SURFACE_CLASS, dt as useBlockContext, en as Select$1, et as useMediaEditor, ft as SelectField, g as resolvePreviewDashboardSetupHandoff, gn as TabsTrigger, gt as unmapValueFromSelect, h as buildPreviewDashboardSetupUrl, hn as TabsList, ht as mapOptionValueForSelect, in as SelectValue, jn as resolveFooterSections, ln as Input, lt as BlockApiProvider, mn as TabsContent, mt as mapCurrentValueForSelect, n as SiteChromeSurfaceControls, nn as SelectItem, on as clamp, p as canInspectSiteStyle, pn as Tabs, pt as hasEmptyOption, q as getFooterEngagementAuthoringOptions, r as dashboardLogoSettingsHref, rn as SelectTrigger, sn as SearchInput, st as useImageResolveContextOptional, tn as SelectContent, un as FIELD_FOCUS_WITHIN_CLASS, ut as BlockContextProvider, v as resolvePreviewEditorGuidanceModel, vn as List, vt as FieldLabelText, w as isHeaderMenuSurfaceState, xn as Content$1, xt as revealEditorElement, yn as Root2$2, yt as useField, z as useSiteEditorAdmission } from "./SiteChromeCustomizeButton-CrgS3I8d.mjs";
3
+ import { $ as useFooterComposerState, $a as getGeneratedBlockIconStyleState, $c as Button$1, $i as FEATURE_CARD_GENERATED_ICON_SIZE_PX, $l as mediaIdentifierSchema, $n as readSliderFieldUiConfig, $o as getGradientPreset, $s as DialogFooter, $t as listEntryPageContentSlots, $u as formatDateTime, A as usePreviewJoinOutcome, Ai as resolveImageUrlWithContext, An as lifecycleOutcomeMessage, Ao as sectionPhotoPresence, At as toRoutableLinkPayload, Au as knownSocialPlatformLabels, Bc as useId$1, Bn as withoutServerVersions, Bs as extractApiEnvelopeErrorDetails, Bt as derivePromotedFieldPlan, Bu as displayedValues, C as pageDesignLookTiles, Ci as toggleEventType, Cl as resolveButtonStyleSelection, Cn as recoveryConflictCopy, Co as DEFAULT_THEME_RESPONSIVE_MODE, Cs as normalizeRepeaterGridSpan, Cu as DEFAULT_MAILING_LIST_TARGETING, Ds as resolveRepeaterGridColumnsForBreakpoint, Dt as sendPageCommand, Du as parseMailchimpAudienceId, El as buttonStyleSelectionKey, Eo as resolveVisiblePromotedFieldPathsForEditorBlock, Es as resolveRepeaterGridBreakpointForWidth, Eu as parseBrevoListId, F as lookTilePosition, Fc as Arrow$1, Fi as buildResolveImageUrlContext, Fr as siblingPath$2, Ft as NewsletterFormClient, Gc as useDirection, Gi as normalizeOfferingsPreviewGroupOrder, Gn as createManifestFormAdapter, Go as getCuratedSiteStyle, Gt as hasVisibilityConditions, Gu as createEditorInsertBlockCommand, Hc as useFocusGuards, Hl as parseAspectRatioValue, Ho as defaultPolicyPageFlowPresetId, Ht as evaluateVisibility, Hu as pristineValueSync, I as lookTilesFor, Ic as Content$1, Il as paletteValueKey, Io as getHeaderLayout, Ir as withValueAtPath, Is as OPERATION_ID_HEADER, J as footerLayoutSelection, Jn as getFieldDefault, Jo as palettesForSiteStyle, Js as CalloutTitle, Jt as createBlock, Ju as editorBlockCollectionOwnerKey, Ka as admitLayoutGridForPlan, Kc as createCollection, Kl as mediaSchema, Kn as createManifestValidation, Ks as Callout, Kt as isNonEmptyValue, Ku as createEditorRemoveBlockCommand, La as BLOCK_BUTTON_ROLE_OPTIONS, Lc as Root2$1, Lo as getHeaderStyle, Lt as useImageResolveContextOptional, M as usePreviewRenderReadiness, Mc as Presence, Mt as updateFooterComposition, Mu as parsePublicProfile, Nc as Portal$1, Ni as resolveMediaSlot, Nt as footerCreditLine, Nu as publicProfileWeekdays, Oc as hideOthers, Oi as computeMediaTransformStyle, Os as resolveBlockTitle, Ot as missingReceiptError, Ou as parseMailchimpInterestId, Pc as Anchor, Pi as resolveMediaSlotContract, Pr as getAtPath, Pu as publishedContactDetails, Q as useFooterAuthoringOptional, Qa as getBlockIconSemanticId, Qi as themeRuntimeScopeProps, Ql as PUBLIC_FILE_FIELD_KINDS, Qn as readNumberFieldUiConfig, Qo as GRADIENT_PRESETS, Qs as DialogDescription$1, Qt as isSurfaceSlotBlockTarget, Qu as formatDate, R as selectedLookTile, Ra as isBlockButtonRole, Rc as createPopperScope, Ro as concretePaletteFromTheme, Rt as FormNodeClient, Si as readEventSelectionChips, Sl as findButtonStyleRecipe, Sn as useSidebarView, Ss as isRepeaterGridLayoutInvalid, Su as parseMailingListPlacementTargeting, Tl as updateButtonStyleSelectionChoice, Tn as unfinishedBlockCopy, Ts as resolveRepeaterGridAcceptedSpans, Tt as LeaseNoticeButtons, U as usePreviewAuth, Uc as DismissableLayer, Ui as inferLegacyOfferingsPreviewGroupOrder, Ul as resolveMediaTransformForAspect, Us as sidebarReturnView, Ut as getFieldIntent, Uu as syncStateOf, Vc as FocusScope, Vn as deriveEditorValuePublicationState, Vs as unwrapResponse, Vt as collectVisibleWhenWatchPaths, Vu as knownRevision, Wi as isOfferingsPreviewSourceKey, Wl as getDirectImageUrlForMediaAsset, Wn as initialBlockDraftValues, Wt as getWidgetKey, Wu as valueStatus, X as resolveFooterEngagementPreview, Xc as composeEventHandlers, Xi as buildThemeDataAttrs, Xn as normalizeFieldForCanonicalValidation, Xs as DialogClose, Xt as deleteBlock, Xu as unsafeAsEditorBlockId, Y as resolveFooterEngagementAuthoringState, Ya as isRichTextDoc, Yc as createContextScope, Yi as resolveOfferingsPreviewGroupOrderEntries, Yn as getRepeaterItemDefault, Ys as Dialog, Yt as createSlotBlock, Yu as editorBlockCollectionOwnersEqual, Z as FooterComposerProvider, Za as sanitizeHref, Zc as Primitive, Zn as getGroupChildFields, Zo as gradientToCss, Zs as DialogContent, Zt as deleteSlotBlock, Zu as unsafeAsEditorBlockValues, _l as resolveRepeaterGridRowFieldId, _n as resolveContentTitle, _s as buildRepeaterGridDropTargets, aa as toFeatureCardIconSuggestionInputs, ad as assertNever$1, ao as coerceInlineTextWithFallback, as as defaultSectionTransitionVariantForFamily, at as readFooterEngagementDraft, b as buildPageDesignEditorReadModelForBlocks, bi as chooseAllEvents, bl as buttonStyleHoverPreferenceValue, bn as useEditorUiStoreInstance, bo as buildThemeRuntime, bs as findFirstAvailableRepeaterGridPlacement, bu as unsafeAsFooterModuleId, cl as useShallow, cr as planBackgroundTransition, cs as sectionTransitionVariantForBoundaryOptionId, cu as generateUuidV4, d as cycleSiteChromeSelectionId, dd as expectParsedBrandedId, dl as canWriteLinkedEntry, dt as DONE, du as assessMailingListTargeting, ea as createFeatureCardIconKey, ec as DialogHeader, ed as parseBookingLocalDate, el as buttonVariants, en as listPageSurfaceContentSlots, eo as parseBlockIconValue, es as buildFontPreviewUrl, eu as asRecord, fc as Content, fl as readLinkedEntryLease, fs as appearancePresets, ft as runHeldLifecycle, fu as resolveMailingListDefaultDestination, gl as resolveRepeaterGridColumnFieldId, gn as resolvePageRouteSlug, gs as planLayoutGridColumnEdit, gu as parseFooterCompositionV1, hl as isAcceptedRepeaterGridSpan, hn as deriveRouteMetadataPresentation, ho as plainTextToInlineText, hs as isInternalResolvedLinkValue, hu as normalizeLegacyFooterContentToV1, i as usePreviewSidebarNavigation, ia as suggestSemanticIconForFeatureCard, id as toUtcIsoDateTimeString, in as blocksKeys, ir as imagePoolForOverride, is as findCuratedPalette, it as footerPartKey, jt as publishContentEntry, ju as knownSocialPlatforms, ki as resolveImageSourceSetWithContext, kt as footerMenuNavigationFacts, ku as parseNewsletterListId, li as getBlockDefinition, lr as rankBackgroundImagePoolItems, lt as useEntryController, lu as slugify$1, mc as Trigger$1, mi as buildNewsletterFormInteractiveIslandProps, mn as routeLifecycleContext, mu as deriveFooterEditorOverview, n as usePreviewAssistantSlot, na as parseFeatureCardGeneratedIconSizePx, nc as DialogTrigger, nd as resolveBookingTimeZoneId, nl as cva, nn as reorderSlotBlocks, no as parseGeneratedIconSetId, nt as footerHeaderStatus, nu as isBodyFontFamily, o as usePreviewPageDesignEditorState, od as parseMediaAssetId, ol as useComposedRefs, on as getDashboardUrl, or as parseBackgroundOverrideFromContent, os as sectionTransitionFamilies, ot as footerEngagementEventFields, pc as Root$2, pl as canEditorWrite, pt as useServerRefresh, pu as mailingListProviderName, q as buildFooterRuntimeViewModel, qa as deriveFieldValidationPlan, qc as useControllableState, qi as planOfferingPreviewCardSelection, ql as runtimeMediaSchema, qn as manifestFieldSectionOptions, qo as offeredSiteStyles, qs as CalloutDescription, qt as partitionFieldsByIntent, qu as createEditorReorderBlocksCommand, ra as resolveFeatureCardGeneratedIconSizePx, rd as parseUtcIsoDateTimeString, rl as createSlot, rn as withSlotCompositionHash, ro as parseSiteIconStyleGuideVersionId, rr as enabledBackgroundModes, rt as footerEngagementStarted, ru as asAppearancePresetId, s as usePreviewPageDesignRenderState, sc as DialogDescription, sl as cn, ss as sectionTransitionFamilyForBoundaryOptionId, st as parseFooterEngagementDraft, su as authoredValuesEqual, ta as getFeatureCardIconCompletion, tc as DialogTitle$1, td as resolveBookingBusinessTimeZone, tn as reorderBlocks, to as parseGeneratedIconAssetId, tr as canCycleBackgroundOverrideValue, u as useSiteChromeCustomizeOptional, uc as DialogTitle, ud as parseSiteId, ui as listBlockDescriptors, ul as isEdited, un as ApiRequestError, uo as inlineTextToPlainText, ur as resolveBackgroundCapability, v as useLiveFooterRuntime, va as buildFormInteractiveIslandProps, vc as usePortalContainer, vi as EVENT_SELECTION_SCOPE_OPTIONS, vl as resolveRepeaterGridSpanFieldId, vn as planLeaseNotice, vs as planRepeaterGridSpanChange, vu as resolveFooterSections, w as setPageDesignBlockBackground, wi as writeEventSelectionChips, wl as updateButtonStyleHoverPreference, ws as planRepeaterGridStartNewRow, wt as LeaseDiscardedNoticeView, wu as mailingListTargetingChoiceIds, xi as chooseScheduleScope, xl as buttonStyleSelectionParameterValue, xs as flowRepeaterGridItems, xu as planFooterLayout, yc as ReactRemoveScroll, yi as EVENT_SELECTION_TYPE_OPTIONS, yl as siteOptionSources, yn as useEditorUiStore, yo as parseFieldDefinition, ys as projectRepeaterGridLayout, yu as setFooterSectionSelected, zc as useSize, zl as isRotationDimensionSwap, zn as toEditorBlockItem, zo as concretePaletteToTheme, zt as BlockApiProvider } from "./previewAssistantSlot-BUqAh1FL.mjs";
4
+ import { $ as EllipsisVertical, A as LoaderCircle, B as ImageOff, E as Maximize2, G as FileText, Kt as err, L as Image, O as Lock, P as Link2, R as ImageUp, S as Palette, U as GripVertical, Z as EyeOff, _t as Box$1, b as PanelTop, bt as ArrowUpRight, c as Trash2, d as SlidersHorizontal, dt as ChevronRight, f as Settings, ft as ChevronLeft, g as RotateCcw, ht as Calendar$1, i as Video, it as Clock3, lt as CircleAlert, m as Rows3, mt as Check, n as X$1, nt as Copy, pt as ChevronDown, qt as ok, rt as Clock, s as TriangleAlert, t as lucide_react_exports, tt as Crop, u as Sparkles, v as Plus, x as PanelBottom, xt as ArrowDown, y as Pencil, yt as ArrowUp, z as ImagePlus } from "./lucide-react-Dfgl3Vtq.mjs";
5
+ import { $ as FieldFrame, B as useSiteOptionWidgetContext, Ct as clamp, D as SiteFontFaceStyles, Dt as Input, Et as NativeSelect, Ft as Content$2, H as useMediaEditor, It as List, J as SelectField, K as BlockContextProvider, L as siteColourCss, Lt as Root2$2, Mt as TabsContent, Nt as TabsList, Ot as FIELD_FOCUS_WITHIN_CLASS, Pt as TabsTrigger, Q as unmapValueFromSelect, R as locationWidgetOverrides, Rt as Trigger$2, St as usePrevious$1, Tt as FieldTrigger, X as mapCurrentValueForSelect, Y as hasEmptyOption, Z as mapOptionValueForSelect, _t as Select$1, at as ThemeScopeCore, bt as SelectTrigger, c as resolvePreviewSidebarChromeModel, d as dashboardLogoSettingsHref, et as FieldLabelText, f as HeaderMenuControls, gt as Textarea, i as resolvePreviewDashboardSetupHandoff, it as revealEditorElement, jt as Tabs, k as useRememberSiteFonts, kt as FIELD_SURFACE_CLASS, m as CustomizeBackgroundControlRows, mt as ChoiceTileGroup, nt as useField, o as resolvePreviewEditorGuidanceModel, p as isHeaderMenuSurfaceState, pt as CHOSEN_OPTION_CLASS, q as useBlockContext, r as buildPreviewDashboardSetupUrl, rt as useLinkedInlineTextField, t as canInspectSiteStyle, tt as hintWithCharacterLimit, u as SiteChromeSurfaceControls, vt as SelectContent, wt as SearchInput, xt as SelectValue, yt as SelectItem, z as SiteOptionWidgetProvider, zt as classifyKnownMimeType } from "./siteStyleAccess-B_UaDyJO.mjs";
6
6
  import { J as paletteTokenNameSchema, V as hexColorSchema, W as paletteColorEntries, c as isKnownIconName, i as ThemedButtonSpecimen, l as isIconPickerPreset, o as getIconComponent, s as getIconPickerOptionsForPreset, tt as VARIANT_ROLES, u as resolveIconPickerPreset } from "./ThemedButton-CVYz7h68.mjs";
7
- import { A as ScrollableDialogContent, C as EMPTY_DOC, D as resolveSdkFooterMode, F as resolveVideoSelectionIntentForMediaField, I as isSvgMimeType, M as Surface, N as surfaceVariants, P as emitMediaCropDebug, S as useRichTextEditor, T as InlineTextEditor, _ as MediaPickerMiniDialog, a as ArrangementOptionsBody, b as getRichTextImagePositionFromTarget, c as BackgroundChooser, d as gradientLabel, f as readBackgroundColorPaletteSnapshot, g as MediaEditor, h as getUnresolvedRichTextImageWarnings, i as ArrangementLookNote, j as ScrollableDialogShell, k as Switch, l as BackgroundPreviewSwatch, m as useRichTextImageProjection, n as pageSectionIdFromBlockId, o as lookIsAutomatic, p as useSiteColourVariables, s as useArrangementToolbar, u as formatTokenLabel, v as MediaPickerMini, x as insertOrReplaceRichTextImage, y as RichTextEditorSurface } from "./PageSectionToolbar-D59tHj_L.mjs";
7
+ import { A as ScrollableDialogContent, C as EMPTY_DOC, D as resolveSdkFooterMode, F as resolveVideoSelectionIntentForMediaField, I as isSvgMimeType, M as Surface, N as surfaceVariants, O as Switch, P as emitMediaCropDebug, S as useRichTextEditor, T as InlineTextEditor, _ as MediaPickerMiniDialog, a as ArrangementOptionsBody, b as getRichTextImagePositionFromTarget, c as BackgroundChooser, d as gradientLabel, f as readBackgroundColorPaletteSnapshot, g as MediaEditor, h as getUnresolvedRichTextImageWarnings, i as ArrangementLookNote, j as ScrollableDialogShell, k as SegmentedControl, l as BackgroundPreviewSwatch, m as useRichTextImageProjection, n as pageSectionIdFromBlockId, o as lookIsAutomatic, p as useSiteColourVariables, s as useArrangementToolbar, u as formatTokenLabel, v as MediaPickerMini, x as insertOrReplaceRichTextImage, y as RichTextEditorSurface } from "./PageSectionToolbar-BFbSrDbi.mjs";
8
8
  import { n as TZDate } from "./src-DzXUmsyK.mjs";
9
- import { i as useOptionalLocationPickerEnvironment, n as LocationPickerEnvironmentProvider } from "./LocationPickerEnvironment-D4F_5rnr.mjs";
10
- import { a as publicationLabel, o as Spinner, s as Separator, t as useAutosaveStatus } from "./useAutosaveStatus-CakNU3lp.mjs";
11
- import { A as Tooltip, C as blockLookOwnedFieldPaths, D as showRawStyleFields, E as prepareBlockEditorManifest, F as DropdownMenu, H as DropdownMenuTrigger, I as DropdownMenuContent, L as DropdownMenuItem, M as TooltipProvider, N as TooltipTrigger, O as getBlockManifestFromSdkConfig, P as Badge, S as arrangementVisibilityValues, T as hideThemeV2RawStyleFields, V as DropdownMenuSeparator, _ as createFieldObservation, b as arrangementLookResolution, f as arrangementBlockControlsFor, g as isRecord$1, h as isObjectRecord, i as NEEDS_SETUP_LABEL, j as TooltipContent, k as mergeBlockDescriptors, l as needsSetupOf, m as createStoreBackend, n as resolveBlockManifest, o as blockNoticeLabel, p as arrangementLookNameFor, r as useBlockCustomizeControls, s as blockNoticeMessage, u as useBlockNotice, v as SdkConfigProvider, w as lookNotShownFieldIds, x as arrangementOwnedFieldIds, y as useSdkConfig } from "./useOpenBlockForSetup-CCEMkosU.mjs";
9
+ import { i as useOptionalLocationPickerEnvironment, n as LocationPickerEnvironmentProvider } from "./LocationPickerEnvironment-8iKKoYZr.mjs";
10
+ import { a as publicationLabel, o as Spinner, s as Separator, t as useAutosaveStatus } from "./useAutosaveStatus-BqmWvPLY.mjs";
11
+ import { A as Tooltip, C as blockLookOwnedFieldPaths, D as showRawStyleFields, E as prepareBlockEditorManifest, F as DropdownMenu, H as DropdownMenuTrigger, I as DropdownMenuContent, L as DropdownMenuItem, M as TooltipProvider, N as TooltipTrigger, O as getBlockManifestFromSdkConfig, P as Badge, S as arrangementVisibilityValues, T as hideThemeV2RawStyleFields, V as DropdownMenuSeparator, _ as createFieldObservation, b as arrangementLookResolution, f as arrangementBlockControlsFor, g as isRecord$1, h as isObjectRecord, i as NEEDS_SETUP_LABEL, j as TooltipContent, k as mergeBlockDescriptors, l as needsSetupOf, m as createStoreBackend, n as resolveBlockManifest, o as blockNoticeLabel, p as arrangementLookNameFor, r as useBlockCustomizeControls, s as blockNoticeMessage, u as useBlockNotice, v as SdkConfigProvider, w as lookNotShownFieldIds, x as arrangementOwnedFieldIds, y as useSdkConfig } from "./useOpenBlockForSetup-LAllV0rU.mjs";
12
12
  import * as React$1 from "react";
13
13
  import React, { Fragment, createContext, forwardRef, memo, useCallback, useContext, useEffect, useId, useImperativeHandle, useLayoutEffect, useMemo, useReducer, useRef, useState, useSyncExternalStore } from "react";
14
14
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
@@ -105,12 +105,12 @@ const CollapsibleTrigger = React$1.forwardRef(({ className, ...props }, ref) =>
105
105
  ...props
106
106
  }));
107
107
  CollapsibleTrigger.displayName = Trigger$1.displayName;
108
- const CollapsibleContent = React$1.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(Content$1, {
108
+ const CollapsibleContent = React$1.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(Content, {
109
109
  ref,
110
110
  className: cn(["data-[state=closed]:overflow-hidden data-[state=open]:overflow-visible data-[state=closed]:h-0 data-[state=open]:h-auto", "data-[state=closed]:animate-collapsible-up data-[state=open]:animate-collapsible-down"].join(" "), className),
111
111
  ...props
112
112
  }));
113
- CollapsibleContent.displayName = Content$1.displayName;
113
+ CollapsibleContent.displayName = Content.displayName;
114
114
  //#endregion
115
115
  //#region ../ui/src/editor-item-card-actions.tsx
116
116
  /**
@@ -3216,7 +3216,7 @@ var PopoverContentImpl = React$1.forwardRef((props, forwardedRef) => {
3216
3216
  onFocusOutside,
3217
3217
  onDismiss: () => context.onOpenChange(false),
3218
3218
  deferPointerDownOutside: true,
3219
- children: /* @__PURE__ */ jsx(Content, {
3219
+ children: /* @__PURE__ */ jsx(Content$1, {
3220
3220
  "data-state": getState(context.open),
3221
3221
  role: "dialog",
3222
3222
  id: context.contentId,
@@ -8037,106 +8037,6 @@ const automaticPageDocumentIntent = {
8037
8037
  boundaryPins: []
8038
8038
  };
8039
8039
  //#endregion
8040
- //#region ../theme-core/src/fonts/types.ts
8041
- /**
8042
- * The Supabase storage bucket name for site fonts
8043
- */
8044
- const SITE_FONTS_BUCKET = "site-fonts";
8045
- /**
8046
- * Construct the storage base URL for site fonts
8047
- *
8048
- * @param supabaseUrl - The Supabase project URL (e.g., https://xxx.supabase.co)
8049
- * @returns The full storage URL for the site-fonts bucket
8050
- *
8051
- * @example
8052
- * ```ts
8053
- * const storageUrl = getSiteFontsStorageUrl('https://xxx.supabase.co')
8054
- * // Returns: 'https://xxx.supabase.co/storage/v1/object/public/site-fonts'
8055
- * ```
8056
- */
8057
- function getSiteFontsStorageUrl(supabaseUrl) {
8058
- return `${supabaseUrl}/storage/v1/object/public/${SITE_FONTS_BUCKET}`;
8059
- }
8060
- /**
8061
- * Build a lightweight Google Fonts stylesheet URL for a family-name preview.
8062
- * The text subset keeps catalog rows cheap while still rendering the name in
8063
- * the typeface being chosen. Pass `text` when the preview draws something
8064
- * other than the name (a sample heading, "Aa"); its letters are deduplicated.
8065
- */
8066
- function buildFontPreviewUrl(family, text = family) {
8067
- return `https://fonts.googleapis.com/css2?family=${encodeURIComponent(family).replace(/%20/gu, "+")}&display=swap&text=${encodeURIComponent(text === family ? family : [...new Set(text)].join(""))}`;
8068
- }
8069
- /**
8070
- * Escape a string for use in CSS font-family declaration
8071
- * Escapes quotes, backslashes, and newlines
8072
- */
8073
- function escapeCssFontFamily(name) {
8074
- return name.replace(/\\/g, "\\\\").replace(/'/g, "\\'").replace(/"/g, "\\\"").replace(/\n/g, "\\n").replace(/\r/g, "\\r");
8075
- }
8076
- /**
8077
- * Encode storage path segments for use in URLs
8078
- * Encodes each path segment individually to handle special characters
8079
- */
8080
- function encodeStoragePath(storagePath) {
8081
- return storagePath.split("/").map((segment) => encodeURIComponent(segment)).join("/");
8082
- }
8083
- /**
8084
- * Generate @font-face CSS for a single font file
8085
- */
8086
- function generateFontFaceForFile(familyName, file, storageBaseUrl) {
8087
- return `@font-face {
8088
- font-family: '${escapeCssFontFamily(familyName)}';
8089
- src: url('${`${storageBaseUrl}/${encodeStoragePath(file.storagePath)}`}') format('woff2');
8090
- font-weight: ${file.weight};
8091
- font-style: ${file.style};
8092
- font-display: swap;
8093
- }`;
8094
- }
8095
- /**
8096
- * Generate @font-face CSS for a variable font
8097
- */
8098
- function generateFontFaceForVariableFont(familyName, file, weightMin, weightMax, storageBaseUrl) {
8099
- return `@font-face {
8100
- font-family: '${escapeCssFontFamily(familyName)}';
8101
- src: url('${`${storageBaseUrl}/${encodeStoragePath(file.storagePath)}`}') format('woff2');
8102
- font-weight: ${weightMin} ${weightMax};
8103
- font-style: ${file.style};
8104
- font-display: swap;
8105
- }`;
8106
- }
8107
- /**
8108
- * Generate all @font-face rules for custom fonts
8109
- *
8110
- * @param fonts - Array of custom fonts
8111
- * @param storageBaseUrl - Base URL for storage (e.g., https://xxx.supabase.co/storage/v1/object/public/site-fonts)
8112
- * @returns CSS string with all @font-face rules
8113
- */
8114
- function generateFontFaceCss(fonts, storageBaseUrl) {
8115
- const rules = [];
8116
- const seenFamilies = /* @__PURE__ */ new Set();
8117
- for (const font of fonts) {
8118
- if (seenFamilies.has(font.familyName)) continue;
8119
- seenFamilies.add(font.familyName);
8120
- if (font.isVariable && font.variableWeightMin && font.variableWeightMax) {
8121
- const normalFile = font.files.find((f) => f.style === "normal");
8122
- const italicFile = font.files.find((f) => f.style === "italic");
8123
- if (normalFile) rules.push(generateFontFaceForVariableFont(font.familyName, normalFile, font.variableWeightMin, font.variableWeightMax, storageBaseUrl));
8124
- if (italicFile) rules.push(generateFontFaceForVariableFont(font.familyName, italicFile, font.variableWeightMin, font.variableWeightMax, storageBaseUrl));
8125
- } else for (const file of font.files) rules.push(generateFontFaceForFile(font.familyName, file, storageBaseUrl));
8126
- }
8127
- return rules.join("\n\n");
8128
- }
8129
- /** CSS2 axis tuples are sorted normal-first, then real italic weights. */
8130
- function buildGoogleFontFamilyQuery(family, weights, italics = [], widthRange) {
8131
- const name = encodeURIComponent(family.replace(/\s+/g, "+")).replace(/%2B/g, "+");
8132
- const normal = [...new Set(weights)].sort((a, b) => a - b);
8133
- const width = widthRange ? `${widthRange.min}..${widthRange.max},` : "";
8134
- const axes = widthRange ? "wdth,wght" : "wght";
8135
- if (italics.length === 0) return `family=${name}:${axes}@${normal.map((weight) => `${width}${weight}`).join(";")}`;
8136
- const italic = [...new Set(italics)].sort((a, b) => a - b);
8137
- return `family=${name}:ital,${axes}@${[...normal.map((weight) => `0,${width}${weight}`), ...italic.map((weight) => `1,${width}${weight}`)].join(";")}`;
8138
- }
8139
- //#endregion
8140
8040
  //#region ../blocks/src/subroutes/formatDate.ts
8141
8041
  /** Occurrence instants name the occurrence-local day; civil keys preserve their day. */
8142
8042
  function formatOccurrenceDate(iso, context) {
@@ -8229,215 +8129,6 @@ function ThemeScope({ theme, children, themeId = "theme-default", responsiveMode
8229
8129
  });
8230
8130
  }
8231
8131
  //#endregion
8232
- //#region ../theme-core/src/ThemeFontLoader.tsx
8233
- /**
8234
- * Map typography weight names to numeric CSS font-weight values.
8235
- * These values correspond to the weight enum in schema.ts (typographyStyleSchema).
8236
- * Keep in sync if new weight options are added to the schema.
8237
- */
8238
- const WEIGHT_MAP = {
8239
- light: 300,
8240
- regular: 400,
8241
- medium: 500,
8242
- semibold: 600,
8243
- bold: 700,
8244
- black: 800
8245
- };
8246
- function resolveNamedWeight(weight) {
8247
- if (typeof weight === "number" && Number.isFinite(weight)) return weight;
8248
- if (typeof weight !== "string") return null;
8249
- return WEIGHT_MAP[weight] ?? null;
8250
- }
8251
- /**
8252
- * Extract the primary font family from a CSS font-family stack
8253
- * e.g., "Inter, system-ui, sans-serif" -> "Inter"
8254
- */
8255
- function extractPrimaryFont(family) {
8256
- return (family.split(",")[0] ?? "").trim().replace(/^["']|["']$/g, "");
8257
- }
8258
- function collectFontFamilies(typography) {
8259
- return new Set([
8260
- typography.body.family,
8261
- typography.headings.default.family,
8262
- ...typography.eyebrow?.width != null ? [typography.eyebrow.family] : [],
8263
- ...typography.smallHeading ? [typography.smallHeading.family] : []
8264
- ].map(extractPrimaryFont).filter(Boolean));
8265
- }
8266
- /**
8267
- * Collect font weights per font family from typography config
8268
- * Returns a Map of font family -> Set of numeric weights
8269
- */
8270
- function collectFontWeights(typography, buttonFontWeight, extraBodyFontWeights, extraHeadingFontWeights) {
8271
- const bodyFamily = extractPrimaryFont(typography.body.family);
8272
- const headingFamily = extractPrimaryFont(typography.headings.default.family);
8273
- const headingStyles = [typography.headings.default, ...[
8274
- "h1",
8275
- "h2",
8276
- "h3",
8277
- "h4",
8278
- "h5",
8279
- "h6"
8280
- ].map((level) => typography.headings[level])];
8281
- const entries = [
8282
- ...typography.smallHeading ? [{
8283
- family: extractPrimaryFont(typography.smallHeading.family),
8284
- weights: [resolveNamedWeight(typography.smallHeading.weight)]
8285
- }] : [],
8286
- {
8287
- family: bodyFamily,
8288
- weights: [
8289
- resolveNamedWeight(typography.body.weight),
8290
- buttonFontWeight,
8291
- ...extraBodyFontWeights ?? []
8292
- ]
8293
- },
8294
- {
8295
- family: headingFamily,
8296
- weights: [...headingStyles.map((style) => resolveNamedWeight(style?.weight)), ...extraHeadingFontWeights ?? []]
8297
- },
8298
- ...typography.eyebrow?.width != null ? [{
8299
- family: extractPrimaryFont(typography.eyebrow.family),
8300
- weights: [resolveNamedWeight(typography.eyebrow.weight) ?? 600]
8301
- }] : []
8302
- ];
8303
- return new Map([...collectFontFamilies(typography)].map((family) => [family, /* @__PURE__ */ new Set([400, ...entries.filter((entry) => entry.family === family).flatMap((entry) => entry.weights).filter((weight) => typeof weight === "number" && Number.isFinite(weight))])]));
8304
- }
8305
- /**
8306
- * Build Google Fonts CSS2 API URL for the given typography config.
8307
- * Includes all font weights used by the theme so they load correctly.
8308
- */
8309
- function buildGoogleFontsUrl(typography, buttonFontWeight, extraBodyFontWeights, extraHeadingFontWeights, italicWeights = {}, customFonts = []) {
8310
- const families = collectFontFamilies(typography);
8311
- if (families.size === 0) return null;
8312
- const fontWeights = collectFontWeights(typography, buttonFontWeight, extraBodyFontWeights, extraHeadingFontWeights);
8313
- const familyParams = Array.from(families).filter((family) => !findCustomFont(family, customFonts)).map((family) => {
8314
- const weights = fontWeights.get(family);
8315
- return buildGoogleFontFamilyQuery(family, weights ? Array.from(weights).sort((a, b) => a - b) : [400], italicWeights[family] ?? [], usedFontWidthRange(typography, family));
8316
- }).join("&");
8317
- return familyParams ? `https://fonts.googleapis.com/css2?${familyParams}&display=swap` : null;
8318
- }
8319
- /**
8320
- * Find a custom font by family name (case-insensitive match)
8321
- */
8322
- function findCustomFont(familyName, customFonts) {
8323
- const normalized = familyName.toLowerCase();
8324
- return customFonts.find((f) => f.familyName.toLowerCase() === normalized);
8325
- }
8326
- function usedFontWidthRange(typography, family) {
8327
- const bodyUsesWidth = extractPrimaryFont(typography.body.family) === family && typography.body.width != null;
8328
- const headingUsesWidth = extractPrimaryFont(typography.headings.default.family) === family && [typography.headings.default, ...[
8329
- "h1",
8330
- "h2",
8331
- "h3",
8332
- "h4",
8333
- "h5",
8334
- "h6"
8335
- ].map((level) => typography.headings[level])].some((style) => style?.width != null);
8336
- const eyebrowUsesWidth = typography.eyebrow?.width != null && extractPrimaryFont(typography.eyebrow.family) === family;
8337
- return bodyUsesWidth || headingUsesWidth || eyebrowUsesWidth ? getFontWidthRange(family) : void 0;
8338
- }
8339
- function ThemeFontLoader({ typography, buttonFontWeight, extraBodyFontWeights, extraHeadingFontWeights, italicBodyFontWeights, italicHeadingFontWeights, customFonts, storageBaseUrl }) {
8340
- const italicWeights = React$1.useMemo(() => {
8341
- const body = extractPrimaryFont(typography.body.family);
8342
- const heading = extractPrimaryFont(typography.headings.default.family);
8343
- return {
8344
- [body]: italicBodyFontWeights ?? [],
8345
- [heading]: [...body === heading ? italicBodyFontWeights ?? [] : [], ...italicHeadingFontWeights ?? []]
8346
- };
8347
- }, [
8348
- typography,
8349
- italicBodyFontWeights,
8350
- italicHeadingFontWeights
8351
- ]);
8352
- const googleFontsUrl = React$1.useMemo(() => buildGoogleFontsUrl(typography, buttonFontWeight, extraBodyFontWeights, extraHeadingFontWeights, italicWeights, customFonts), [
8353
- typography,
8354
- buttonFontWeight,
8355
- extraBodyFontWeights,
8356
- extraHeadingFontWeights,
8357
- customFonts,
8358
- italicWeights
8359
- ]);
8360
- const customFontCss = React$1.useMemo(() => {
8361
- if (!customFonts || customFonts.length === 0 || !storageBaseUrl) return null;
8362
- const families = collectFontFamilies(typography);
8363
- const usedCustomFonts = [];
8364
- for (const familyName of families) {
8365
- const customFont = findCustomFont(familyName, customFonts);
8366
- if (customFont) usedCustomFonts.push(customFont);
8367
- }
8368
- if (usedCustomFonts.length === 0) return null;
8369
- return generateFontFaceCss(usedCustomFonts, storageBaseUrl);
8370
- }, [
8371
- typography,
8372
- customFonts,
8373
- storageBaseUrl
8374
- ]);
8375
- const hasGoogleFonts = !!googleFontsUrl;
8376
- const hasCustomFonts = !!customFontCss;
8377
- if (!hasGoogleFonts && !hasCustomFonts) return null;
8378
- return /* @__PURE__ */ jsxs(Fragment$1, { children: [hasCustomFonts && /* @__PURE__ */ jsx("style", { dangerouslySetInnerHTML: { __html: escapeStyleContent(customFontCss) } }), hasGoogleFonts && /* @__PURE__ */ jsxs(Fragment$1, { children: [
8379
- /* @__PURE__ */ jsx("link", {
8380
- rel: "preconnect",
8381
- href: "https://fonts.googleapis.com"
8382
- }),
8383
- /* @__PURE__ */ jsx("link", {
8384
- rel: "preconnect",
8385
- href: "https://fonts.gstatic.com",
8386
- crossOrigin: ""
8387
- }),
8388
- /* @__PURE__ */ jsx("link", {
8389
- rel: "stylesheet",
8390
- href: googleFontsUrl
8391
- })
8392
- ] })] });
8393
- }
8394
- function getThemeFontLoadingOptions(theme) {
8395
- const buttonFontWeight = typeof theme.buttons?.global?.fontWeight === "number" ? theme.buttons.global.fontWeight : void 0;
8396
- const fontLoading = themeFontLoading(theme);
8397
- const extraBody = new Set(fontLoading.extraBodyFontWeights);
8398
- const extraHeading = new Set(fontLoading.extraHeadingFontWeights);
8399
- const labelWeight = resolveNamedWeight(theme.inputs?.label?.fontWeight);
8400
- if (labelWeight && labelWeight !== 400) extraBody.add(labelWeight);
8401
- const addNavLinkWeight = (options) => {
8402
- const weight = resolveNamedWeight(options?.fontWeight);
8403
- if (!weight || weight === 400) return;
8404
- if (options?.typography === "heading") extraHeading.add(weight);
8405
- else extraBody.add(weight);
8406
- };
8407
- const navFontRole = theme.header?.navFontRole;
8408
- if (navFontRole) addNavLinkWeight({
8409
- typography: navFontRole,
8410
- fontWeight: theme.header.navLinkStyle?.fontWeight ?? theme.header.navWeight
8411
- });
8412
- else addNavLinkWeight(theme.header?.navLinkStyle);
8413
- addNavLinkWeight(theme.footer?.navLinkStyle);
8414
- return {
8415
- buttonFontWeight,
8416
- italicBodyFontWeights: fontLoading.italicBodyFontWeights,
8417
- italicHeadingFontWeights: fontLoading.italicHeadingFontWeights,
8418
- extraBodyFontWeights: extraBody.size > 0 ? Array.from(extraBody).sort((a, b) => a - b) : void 0,
8419
- extraHeadingFontWeights: extraHeading.size > 0 ? Array.from(extraHeading).sort((a, b) => a - b) : void 0
8420
- };
8421
- }
8422
- function ThemeFontLoaderFromTheme({ theme, customFonts, storageBaseUrl }) {
8423
- const typography = theme.typography;
8424
- if (!typography) return null;
8425
- const { buttonFontWeight, extraBodyFontWeights, extraHeadingFontWeights, italicBodyFontWeights, italicHeadingFontWeights } = getThemeFontLoadingOptions(theme);
8426
- return /* @__PURE__ */ jsx(ThemeFontLoader, {
8427
- typography,
8428
- buttonFontWeight,
8429
- extraBodyFontWeights,
8430
- extraHeadingFontWeights,
8431
- italicBodyFontWeights,
8432
- italicHeadingFontWeights,
8433
- customFonts,
8434
- storageBaseUrl
8435
- });
8436
- }
8437
- function themeFontLoading(theme) {
8438
- return theme.fontLoading ?? {};
8439
- }
8440
- //#endregion
8441
8132
  //#region ../content-model/src/content-types/entryValidation.ts
8442
8133
  function hasRepeaterVariants(field) {
8443
8134
  return field.itemTypes !== void 0;
@@ -10015,7 +9706,7 @@ function createLayoutGridColumnEditBackend(backend, fields, base = "") {
10015
9706
  }
10016
9707
  //#endregion
10017
9708
  //#region ../block-form/src/widgets/TextField/TextField.tsx
10018
- function TextField$1({ path, backend, config }) {
9709
+ function TextField({ path, backend, config }) {
10019
9710
  const { value, error, setValue } = useField(path, backend);
10020
9711
  return /* @__PURE__ */ jsx(FieldFrame, {
10021
9712
  fieldPath: path,
@@ -10023,6 +9714,7 @@ function TextField$1({ path, backend, config }) {
10023
9714
  required: config.required,
10024
9715
  description: config.description,
10025
9716
  error: error?.message,
9717
+ hint: hintWithCharacterLimit(value ?? "", config.maxLength),
10026
9718
  children: ({ id }) => config.multiline ? /* @__PURE__ */ jsx(Textarea, {
10027
9719
  id,
10028
9720
  value: value ?? "",
@@ -11350,6 +11042,17 @@ function getDefaultValue(field) {
11350
11042
  return getFieldDefault(field, { resolve: getDefaultValue });
11351
11043
  }
11352
11044
  //#endregion
11045
+ //#region ../block-form/src/widgets/RepeaterField/utils/addButtonNoun.ts
11046
+ /**
11047
+ * "Add button", "Add image": the item's name in sentence case after the verb.
11048
+ * A name that starts with an acronym ("FAQ") keeps its capitals.
11049
+ */
11050
+ function addButtonNoun(itemLabel) {
11051
+ const label = itemLabel ?? "item";
11052
+ const [first = "", second = ""] = label;
11053
+ return second !== "" && second === second.toLowerCase() && second !== second.toUpperCase() ? first.toLowerCase() + label.slice(1) : label;
11054
+ }
11055
+ //#endregion
11353
11056
  //#region ../block-form/src/widgets/RepeaterField/utils/buildItemLabel.ts
11354
11057
  const UUID_LIKE_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
11355
11058
  function getStringValue$1(value) {
@@ -11414,6 +11117,13 @@ function deriveLabelFromItem(itemFields, itemValue, sourceFieldId) {
11414
11117
  }
11415
11118
  return null;
11416
11119
  }
11120
+ /** Nothing typed or chosen, however deep: what a row is before anyone's touched it. */
11121
+ function isBlankValue(value) {
11122
+ if (value == null) return true;
11123
+ if (typeof value === "string") return value.trim().length === 0;
11124
+ if (Array.isArray(value)) return value.every(isBlankValue);
11125
+ return typeof value === "object" && Object.values(value).every(isBlankValue);
11126
+ }
11417
11127
  function buildItemLabel(field, index, backend, basePath) {
11418
11128
  const itemValue = backend.getValue(`${basePath}.${index}`);
11419
11129
  const normalizedItemValue = itemValue && typeof itemValue === "object" && !Array.isArray(itemValue) ? itemValue : null;
@@ -11425,9 +11135,12 @@ function buildItemLabel(field, index, backend, basePath) {
11425
11135
  const label = sourceField ? readFieldDisplayValue(sourceField, value) : getStringValue$1(value);
11426
11136
  if (label) return label;
11427
11137
  }
11428
- const derived = deriveLabelFromItem(itemFields, normalizedItemValue, source);
11429
- if (derived) return derived;
11430
- return `${field.itemLabel ?? "Item"} ${index + 1}`;
11138
+ return deriveLabelFromItem(itemFields, normalizedItemValue, source) ?? unnamedItemLabel(field, itemFields, normalizedItemValue, index);
11139
+ }
11140
+ /** A row with no words to show: "New question" until it has any, then "Question 2". */
11141
+ function unnamedItemLabel(field, itemFields, itemValue, index) {
11142
+ const itemLabel = field.itemLabel ?? "Item";
11143
+ return itemFields.length > 0 && itemFields.every((child) => isBlankValue(itemValue?.[child.id])) ? `New ${addButtonNoun(itemLabel)}` : `${itemLabel} ${index + 1}`;
11431
11144
  }
11432
11145
  //#endregion
11433
11146
  //#region ../block-form/src/widgets/RepeaterField/utils/getRepeaterItemFields.ts
@@ -12189,58 +11902,6 @@ function RepeaterRowActions(props) {
12189
11902
  return /* @__PURE__ */ jsx(EditorItemCardActions, { ...buildRepeaterRowActions(props) });
12190
11903
  }
12191
11904
  //#endregion
12192
- //#region ../api/src/navigation/routableLink.ts
12193
- /**
12194
- * Prefer identifier-based links when available so links survive route/path updates.
12195
- * Falls back to an internal route payload for legacy rows or incomplete data.
12196
- */
12197
- function toRoutableLinkPayload(item) {
12198
- switch (item.entityType) {
12199
- case "page":
12200
- if (item.identifier) return {
12201
- kind: "page",
12202
- identifier: item.identifier
12203
- };
12204
- return toResolvedInternalPayload(item);
12205
- case "content":
12206
- if (item.identifier && item.contentTypeKey) return {
12207
- kind: "entry",
12208
- contentType: item.contentTypeKey,
12209
- identifier: item.identifier
12210
- };
12211
- return toResolvedInternalPayload(item);
12212
- case "pageSurface": return toResolvedInternalPayload(item);
12213
- default: return assertNever$1(item);
12214
- }
12215
- }
12216
- function toResolvedInternalPayload(item) {
12217
- return {
12218
- kind: "internal",
12219
- routeId: item.routeId,
12220
- entityId: item.entityId,
12221
- entityType: item.entityType,
12222
- href: item.path ?? "/",
12223
- title: item.title ?? item.draftTitle ?? "Untitled",
12224
- typeLabel: item.typeLabel,
12225
- contentTypeKey: item.contentTypeKey,
12226
- contentTypeName: item.contentTypeName,
12227
- updatedAt: item.updatedAt ?? null
12228
- };
12229
- }
12230
- //#endregion
12231
- //#region ../api/src/navigation.ts
12232
- async function getNavigationMenus(apiClient, { siteId, options }) {
12233
- try {
12234
- return unwrapResponse(await apiClient({
12235
- endpoint: "getNavigationMenus",
12236
- params: { siteId },
12237
- options
12238
- }));
12239
- } catch (error) {
12240
- normalizeApiError(error, "Failed to fetch navigation menus");
12241
- }
12242
- }
12243
- //#endregion
12244
11905
  //#region ../media-editor/src/fieldUi.ts
12245
11906
  function withRepeaterThumbnailMediaFieldUi(field, options) {
12246
11907
  if (!field || field.type !== "media") return null;
@@ -13451,17 +13112,6 @@ function RepeaterLayoutGrid({ config, backend, basePath, items, minItems, onMove
13451
13112
  });
13452
13113
  }
13453
13114
  //#endregion
13454
- //#region ../block-form/src/widgets/RepeaterField/utils/addButtonNoun.ts
13455
- /**
13456
- * "Add button", "Add image": the item's name in sentence case after the verb.
13457
- * A name that starts with an acronym ("FAQ") keeps its capitals.
13458
- */
13459
- function addButtonNoun(itemLabel) {
13460
- const label = itemLabel ?? "item";
13461
- const [first = "", second = ""] = label;
13462
- return second !== "" && second === second.toLowerCase() && second !== second.toUpperCase() ? first.toLowerCase() + label.slice(1) : label;
13463
- }
13464
- //#endregion
13465
13115
  //#region ../block-form/src/widgets/RepeaterField/components/RepeaterThumbnailGrid.tsx
13466
13116
  function getGridClassName(density) {
13467
13117
  if (density === "compact") return "grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3";
@@ -21036,6 +20686,7 @@ function DatePickerPopover({ selectedDate, onSelectDate, onOpenChange, placehold
21036
20686
  labels: calendarLabels,
21037
20687
  locale: calendarLocale,
21038
20688
  selected: selectedDate ?? void 0,
20689
+ defaultMonth: selectedDate ?? void 0,
21039
20690
  onSelect: handleSelect,
21040
20691
  initialFocus: true,
21041
20692
  disabled
@@ -21862,7 +21513,7 @@ function InlineTextControl({ path, config, value, error, onChange }) {
21862
21513
  * These live in @riverbankcms/editor-blocks and are passed via FormRenderer.widgetOverrides.
21863
21514
  */
21864
21515
  const WIDGET_COMPONENTS = {
21865
- text: TextField$1,
21516
+ text: TextField,
21866
21517
  inlineText: InlineTextField$1,
21867
21518
  number: NumberField,
21868
21519
  select: SelectField,
@@ -22173,6 +21824,7 @@ function FormRendererContent(input) {
22173
21824
  });
22174
21825
  return props.blockKind ? /* @__PURE__ */ jsx(BlockContextProvider, {
22175
21826
  blockKind: props.blockKind,
21827
+ mediaFrame: props.visibilityValues?.mediaFrame,
22176
21828
  children: content
22177
21829
  }) : content;
22178
21830
  }
@@ -25836,7 +25488,7 @@ function RichTextField({ path, backend, config }) {
25836
25488
  editor,
25837
25489
  config: editorConfig,
25838
25490
  isEmpty,
25839
- placeholderText: "Add text",
25491
+ placeholderText: config.ui?.placeholder ?? "Add text",
25840
25492
  onPickImage,
25841
25493
  linkItems,
25842
25494
  onRequestLinkItems: loadLinkItems,
@@ -25851,7 +25503,7 @@ function RichTextField({ path, backend, config }) {
25851
25503
  });
25852
25504
  }
25853
25505
  function toEditorContent(value) {
25854
- if (value === void 0) return EMPTY_DOC;
25506
+ if (value == null) return EMPTY_DOC;
25855
25507
  if (!isRichTextDoc(value)) throw new TypeError("Rich-text editor requires a canonical TipTap document");
25856
25508
  return value;
25857
25509
  }
@@ -26213,20 +25865,37 @@ function UnreadableMediaField({ config }) {
26213
25865
  children: /* @__PURE__ */ jsx(UnreadableMediaWarning, {})
26214
25866
  });
26215
25867
  }
25868
+ /** Derive the photo editor's presentation without changing its stored content. */
25869
+ function imageFieldPresentation(config, path, values, context) {
25870
+ const { blockKind, mediaFrame } = context ?? {};
25871
+ const { contract: slot, galleryFrame: frame } = resolveMediaSlot({
25872
+ blockKind,
25873
+ fieldPath: path,
25874
+ values,
25875
+ fieldAspectRatio: config.aspectRatio,
25876
+ fieldUi: config.ui,
25877
+ lookMediaFrame: mediaFrame
25878
+ });
25879
+ return {
25880
+ ...editorPresentation(config),
25881
+ allowedKinds: config.mediaKinds ?? ["image"],
25882
+ previewAspectRatio: slot.edit.mode === "fixed-aspect" ? parseAspectRatioValue(slot.edit.aspectRatio) : void 0,
25883
+ previewBorderRadius: frame?.borderRadius,
25884
+ minSourceWidth: slot.edit.minSourceWidth,
25885
+ minSourceHeight: slot.edit.minSourceHeight,
25886
+ cropEditorMode: config.ui?.cropEditorMode ?? "dialog",
25887
+ cropEditorAutoOpen: config.ui?.cropEditorAutoOpen === true,
25888
+ videoPrepIntent: videoPrepIntentForMediaField(path, config.mediaKinds),
25889
+ videoSelectionIntent: videoSelectionIntentForMediaField(path, config.mediaKinds)
25890
+ };
25891
+ }
26216
25892
  function MediaField(props) {
26217
25893
  const { config, path, backend } = props;
26218
25894
  const { admission, setValue } = useAdmittedField(props);
26219
25895
  const blockContext = useBlockContext();
26220
25896
  if (admission.kind === "unreadable") return /* @__PURE__ */ jsx(UnreadableMediaField, { config });
26221
25897
  const { value } = admission;
26222
- const slot = resolveMediaSlotContract({
26223
- blockKind: blockContext?.blockKind,
26224
- fieldPath: path,
26225
- values: asRecord(backend.getValues()),
26226
- fieldAspectRatio: config.aspectRatio,
26227
- fieldUi: config.ui
26228
- });
26229
- const previewAspectRatio = slot.edit.mode === "fixed-aspect" ? parseAspectRatioValue(slot.edit.aspectRatio) : void 0;
25898
+ const presentation = imageFieldPresentation(config, path, asRecord(backend.getValues()), blockContext);
26230
25899
  const onChange = (next) => {
26231
25900
  emitMediaCropDebug("MediaField", "change", {
26232
25901
  path,
@@ -26245,15 +25914,7 @@ function MediaField(props) {
26245
25914
  ]),
26246
25915
  value,
26247
25916
  onChange,
26248
- ...editorPresentation(config),
26249
- allowedKinds: config.mediaKinds ?? ["image"],
26250
- previewAspectRatio,
26251
- minSourceWidth: slot.edit.minSourceWidth,
26252
- minSourceHeight: slot.edit.minSourceHeight,
26253
- cropEditorMode: config.ui?.cropEditorMode ?? "dialog",
26254
- cropEditorAutoOpen: config.ui?.cropEditorAutoOpen === true,
26255
- videoPrepIntent: videoPrepIntentForMediaField(path, config.mediaKinds),
26256
- videoSelectionIntent: videoSelectionIntentForMediaField(path, config.mediaKinds)
25917
+ ...presentation
26257
25918
  })
26258
25919
  });
26259
25920
  }
@@ -27174,7 +26835,7 @@ function globalFieldsSummary(form) {
27174
26835
  }
27175
26836
  //#endregion
27176
26837
  //#region ../editor-blocks/src/widgets/mailing-list-targeting/MailingListTargetingField.tsx
27177
- const inputClass$2 = "w-full rounded-md border bg-background px-3 py-2 text-sm";
26838
+ const inputClass$1 = "w-full rounded-md border bg-background px-3 py-2 text-sm";
27178
26839
  function useMailingListSetup() {
27179
26840
  const { siteId, load, manageHref } = useMailingListTargetingContext();
27180
26841
  const [loadState, setLoadState] = useState({ tag: "loading" });
@@ -27476,7 +27137,7 @@ function MailchimpAudience({ matched, setValue, name }) {
27476
27137
  children: "Audience"
27477
27138
  }), /* @__PURE__ */ jsxs("select", {
27478
27139
  id: selectId,
27479
- className: inputClass$2,
27140
+ className: inputClass$1,
27480
27141
  value: matched.targeting.audienceId,
27481
27142
  onChange: (event) => {
27482
27143
  const audienceId = parseMailchimpAudienceId(event.target.value);
@@ -28769,246 +28430,343 @@ function planFooterEditorView(input) {
28769
28430
  scopeLabel: "All pages",
28770
28431
  shown: overview.selected.map((item) => sectionPlan(item.section, true, missingIds.has(item.section.id), input.canEdit)),
28771
28432
  available: overview.available.map((item) => sectionPlan(item.section, false, false, input.canEdit)),
28772
- arrangement: planFooterArrangement(renderable, footerArrangementPolicy({
28773
- arrangement: input.arrangement,
28774
- storedNavigationLayout: input.navigationLayout
28775
- }))
28433
+ layout: planFooterLayout(renderable, { layout: input.layout })
28776
28434
  };
28777
28435
  }
28778
28436
  //#endregion
28779
- //#region ../content-editor/src/footerEngagementDraft.ts
28780
- function reduceFooterEngagementDraft(draft, event) {
28781
- switch (event.type) {
28782
- case "select-kind":
28783
- if (event.kind === draft.kind) return draft;
28784
- return event.kind === "standard-contact" ? createStandardContactDraft(sharedDraftFields(draft), "") : createEmptyMailingListDraft(sharedDraftFields(draft));
28785
- case "set-treatment": return {
28786
- ...draft,
28787
- treatment: event.treatment
28788
- };
28789
- case "set-heading": return {
28790
- ...draft,
28791
- heading: event.heading
28792
- };
28793
- case "set-intro": return {
28794
- ...draft,
28795
- intro: event.intro
28796
- };
28797
- case "set-form": return draft.kind === "standard-contact" ? {
28798
- ...draft,
28799
- formId: event.formId
28800
- } : draft;
28801
- case "set-mailing-targeting": return draft.kind === "mailing-list" ? {
28802
- ...draft,
28803
- targeting: event.targeting
28804
- } : draft;
28805
- default: return assertNever$1(event);
28806
- }
28807
- }
28808
- function createFooterEngagementDraft(section) {
28809
- const shared = {
28810
- treatment: section?.treatment ?? "integrated",
28811
- heading: section?.heading ?? "Stay in touch",
28812
- intro: section?.source.intro ?? ""
28813
- };
28814
- if (section?.source.kind === "standard-contact") return createStandardContactDraft(shared, section.source.formId);
28815
- if (section?.source.kind === "mailing-list") return createMailingListDraft(shared, section.source);
28816
- return createStandardContactDraft(shared, "");
28437
+ //#region ../content-editor/src/FooterBrandChoice.tsx
28438
+ const FOOTER_BRAND_COPY = {
28439
+ label: "Name or logo",
28440
+ name: "Name",
28441
+ logo: "Logo",
28442
+ both: "Name and logo",
28443
+ addLogoLink: "Add a logo in Settings",
28444
+ addLogoRest: " to show it here."
28445
+ };
28446
+ /** Stored footers that hid both (no longer offered) read as the name, which is what they now show. */
28447
+ function footerBrandChoice(section) {
28448
+ if (section.showLogo && section.showTitle) return "both";
28449
+ return section.showLogo ? "logo" : "name";
28817
28450
  }
28818
- function sharedDraftFields(draft) {
28451
+ function withFooterBrandChoice(composition, choice) {
28819
28452
  return {
28820
- treatment: draft.treatment,
28821
- heading: draft.heading,
28822
- intro: draft.intro
28453
+ ...composition,
28454
+ sections: composition.sections.map((section) => section.kind === "brand" ? {
28455
+ ...section,
28456
+ showLogo: choice !== "name",
28457
+ showTitle: choice !== "logo"
28458
+ } : section)
28823
28459
  };
28824
28460
  }
28825
- function createStandardContactDraft(shared, formId) {
28826
- return {
28827
- ...shared,
28828
- kind: "standard-contact",
28829
- formId
28830
- };
28461
+ /**
28462
+ * What sits at the top of the footer, as one choice. Hiding both isn't
28463
+ * offered (the brand row is removed from the footer instead), and with no
28464
+ * logo uploaded the footer shows the name whatever is chosen.
28465
+ */
28466
+ function FooterBrandChoiceControl({ composition, hasLogo, manageSettingsHref, onChange }) {
28467
+ const brand = composition.sections.find((section) => section.kind === "brand" && section.selected);
28468
+ if (!brand) return null;
28469
+ const value = hasLogo ? footerBrandChoice(brand) : "name";
28470
+ return /* @__PURE__ */ jsxs("div", {
28471
+ className: "space-y-1.5",
28472
+ children: [
28473
+ /* @__PURE__ */ jsx("div", {
28474
+ className: "text-sm font-medium",
28475
+ children: FOOTER_BRAND_COPY.label
28476
+ }),
28477
+ /* @__PURE__ */ jsx(SegmentedControl, {
28478
+ "aria-label": FOOTER_BRAND_COPY.label,
28479
+ size: "sm",
28480
+ className: "w-full",
28481
+ value,
28482
+ onValueChange: (choice) => onChange(withFooterBrandChoice(composition, choice)),
28483
+ options: [
28484
+ {
28485
+ value: "name",
28486
+ label: FOOTER_BRAND_COPY.name
28487
+ },
28488
+ {
28489
+ value: "logo",
28490
+ label: FOOTER_BRAND_COPY.logo,
28491
+ disabled: !hasLogo
28492
+ },
28493
+ {
28494
+ value: "both",
28495
+ label: FOOTER_BRAND_COPY.both,
28496
+ disabled: !hasLogo
28497
+ }
28498
+ ]
28499
+ }),
28500
+ hasLogo ? null : /* @__PURE__ */ jsxs("p", {
28501
+ className: "text-xs text-muted-foreground",
28502
+ children: [/* @__PURE__ */ jsx("a", {
28503
+ className: "underline underline-offset-2",
28504
+ href: manageSettingsHref,
28505
+ children: FOOTER_BRAND_COPY.addLogoLink
28506
+ }), FOOTER_BRAND_COPY.addLogoRest]
28507
+ })
28508
+ ]
28509
+ });
28831
28510
  }
28832
- function createEmptyMailingListDraft(shared) {
28511
+ //#endregion
28512
+ //#region ../content-editor/src/FooterLiveTextField.tsx
28513
+ /**
28514
+ * One line or a few lines of footer text. The value and its saving belong to
28515
+ * the caller (the footer part hooks); this draws the field, saves on leaving it,
28516
+ * and says so when a save didn't go through.
28517
+ */
28518
+ function FooterLiveTextField({ label, hint, optional = false, error, maxLength, multiline = false, value, onChange, live }) {
28519
+ return /* @__PURE__ */ jsx(FieldFrame, {
28520
+ label,
28521
+ hint,
28522
+ optional,
28523
+ error: error ?? null,
28524
+ children: ({ id, descriptionId, messageId }) => {
28525
+ const props = {
28526
+ id,
28527
+ "aria-describedby": [descriptionId, messageId].filter(Boolean).join(" ") || void 0,
28528
+ "aria-invalid": error ? true : void 0,
28529
+ maxLength,
28530
+ value,
28531
+ onBlur: live.flush
28532
+ };
28533
+ return multiline ? /* @__PURE__ */ jsx(Textarea, {
28534
+ ...props,
28535
+ rows: 2,
28536
+ onChange: (event) => onChange(event.target.value)
28537
+ }) : /* @__PURE__ */ jsx(Input, {
28538
+ ...props,
28539
+ onChange: (event) => onChange(event.target.value)
28540
+ });
28541
+ }
28542
+ });
28543
+ }
28544
+ /** Shown under a part's fields when its last save failed. What the owner typed stays in the fields. */
28545
+ function FooterLiveSaveFailure({ live }) {
28546
+ if (!live.failed) return null;
28547
+ return /* @__PURE__ */ jsxs("div", {
28548
+ role: "alert",
28549
+ className: "flex items-center justify-between gap-3 text-sm text-destructive",
28550
+ children: [/* @__PURE__ */ jsx("span", { children: "That didn't save. Your changes are still here." }), /* @__PURE__ */ jsx(Button$1, {
28551
+ type: "button",
28552
+ variant: "outline",
28553
+ size: "sm",
28554
+ onClick: live.retry,
28555
+ children: "Try again"
28556
+ })]
28557
+ });
28558
+ }
28559
+ //#endregion
28560
+ //#region ../content-editor/src/useFooterPart.ts
28561
+ /** Forms dispatch edits; the composer owns their raw input, what it means, and its lifecycle. */
28562
+ function useFooterPartSave(part) {
28563
+ const composer = useFooterAuthoringOptional();
28564
+ if (!composer) throw new Error("Footer composer provider is missing");
28565
+ const key = footerPartKey({
28566
+ kind: part.kind,
28567
+ section: part.section,
28568
+ fields: {}
28569
+ });
28570
+ const edit = (draft, finalize) => {
28571
+ if (composer.compositionSnapshot?.kind !== "ready" || !composer.acceptingEdits) return;
28572
+ if (composer.fieldState.submit(draft) && finalize) composer.finalizeComposition();
28573
+ };
28833
28574
  return {
28834
- ...shared,
28835
- kind: "mailing-list",
28836
- targeting: { mode: "default" }
28575
+ composer,
28576
+ key,
28577
+ edit,
28578
+ shown: composer.compositionSnapshot?.kind === "ready" ? composer.compositionSnapshot.composition : null,
28579
+ live: {
28580
+ flush: composer.finalizeComposition,
28581
+ retry: () => composer.fieldState.retry(key),
28582
+ failed: composer.compositionDrafts.some((draft) => draft.identity.key === key && draft.status === "failed")
28583
+ }
28837
28584
  };
28838
28585
  }
28839
- function createMailingListDraft(shared, source) {
28840
- return {
28841
- ...shared,
28842
- kind: "mailing-list",
28843
- targeting: source.targeting
28844
- };
28845
- }
28846
- function parseFooterEngagementDraft(draft, currentId) {
28847
- const source = draft.kind === "standard-contact" ? {
28848
- kind: draft.kind,
28849
- formId: draft.formId,
28850
- intro: draft.intro || null
28851
- } : createMailingListSource(draft);
28852
- return parseFooterEngagementSection({
28853
- id: currentId,
28586
+ /** The footer's contact form or mailing list part. Choices save at once; words save after a pause. */
28587
+ function useFooterEngagementPart(section) {
28588
+ const { composer, key, edit, shown, live } = useFooterPartSave({
28854
28589
  kind: "engagement",
28855
- heading: draft.heading,
28856
- selected: true,
28857
- treatment: draft.treatment,
28858
- source
28859
- });
28860
- }
28861
- function createMailingListSource(draft) {
28590
+ section
28591
+ });
28592
+ const typed = composer.fieldState.draft(key);
28593
+ const fields = typed?.kind === "engagement" ? typed.fields : {};
28594
+ const value = readFooterEngagementDraft(shown, fields, composer.engagementOptions);
28595
+ const dispatch = (event) => {
28596
+ const typing = event.type === "set-heading" || event.type === "set-intro";
28597
+ if (!typing) live.flush();
28598
+ edit({
28599
+ kind: "engagement",
28600
+ section,
28601
+ fields: footerEngagementEventFields(value, event)
28602
+ }, !typing);
28603
+ };
28604
+ return {
28605
+ value,
28606
+ dispatch,
28607
+ live,
28608
+ started: footerEngagementStarted(fields)
28609
+ };
28610
+ }
28611
+ /** A section's own heading and body text. */
28612
+ function useFooterSectionTextPart(module) {
28613
+ const { composer, key, edit, shown, live } = useFooterPartSave({
28614
+ kind: "section-text",
28615
+ section: module.id
28616
+ });
28617
+ const typed = composer.fieldState.draft(key);
28618
+ const value = {
28619
+ ...shown?.sections.find((section) => section.id === module.id) ?? module,
28620
+ ...typed?.kind === "section-text" ? typed.fields : {}
28621
+ };
28622
+ const change = (field, input) => {
28623
+ if (field === "content") return edit({
28624
+ kind: "section-text",
28625
+ section: module.id,
28626
+ fields: { content: input }
28627
+ }, false);
28628
+ edit({
28629
+ kind: "section-text",
28630
+ section: module.id,
28631
+ fields: { heading: typeof input === "string" ? input : null }
28632
+ }, false);
28633
+ };
28862
28634
  return {
28863
- kind: "mailing-list",
28864
- targeting: draft.targeting,
28865
- intro: draft.intro || null
28635
+ ...live,
28636
+ value,
28637
+ change
28866
28638
  };
28867
28639
  }
28868
28640
  //#endregion
28869
28641
  //#region ../content-editor/src/FooterEngagementEditorFields.tsx
28870
- const inputClass$1 = "w-full rounded-md border bg-background px-3 py-2 text-sm";
28871
- const buttonClass$3 = "rounded-md border bg-background px-3 py-2 text-sm font-medium hover:bg-muted";
28872
- function EngagementKindChoice({ dispatch, kind }) {
28873
- return /* @__PURE__ */ jsxs("fieldset", {
28874
- className: "space-y-2",
28875
- children: [
28876
- /* @__PURE__ */ jsx("legend", {
28877
- className: "text-sm font-medium",
28878
- children: "What should visitors do?"
28879
- }),
28880
- /* @__PURE__ */ jsx(RadioChoice, {
28881
- checked: kind === "standard-contact",
28882
- label: "Send a message",
28883
- name: "engagement-kind",
28884
- onChange: () => dispatch({
28885
- type: "select-kind",
28886
- kind: "standard-contact"
28887
- })
28888
- }),
28889
- /* @__PURE__ */ jsx(RadioChoice, {
28890
- checked: kind === "mailing-list",
28891
- label: "Join a mailing list",
28892
- name: "engagement-kind",
28893
- onChange: () => dispatch({
28894
- type: "select-kind",
28895
- kind: "mailing-list"
28896
- })
28642
+ /** The signup / contact form panel's words, from the approved Phase 6 mockup. */
28643
+ const ENGAGEMENT_COPY = {
28644
+ mailingTitle: "Mailing list signup",
28645
+ contactTitle: "Contact form",
28646
+ choiceLabel: "Visitors can",
28647
+ mailingList: "Join your list",
28648
+ contactForm: "Send a message",
28649
+ headingLabel: "Heading",
28650
+ headingHint: "In Compact strip, this shows as a small label by the form.",
28651
+ introLabel: "A line under the heading",
28652
+ introHint: "Compact strip leaves this out to keep the strip short.",
28653
+ listNote: "The button text and privacy note come from your mailing list settings.",
28654
+ listSettings: "Mailing list settings",
28655
+ askOwner: "Ask the site's owner to change the mailing list settings.",
28656
+ notSetUpTitle: "You haven't set up a mailing list yet",
28657
+ notSetUpBody: "Once it's set up, the signup shows in your footer. Until then, visitors won't see it.",
28658
+ notSetUpAction: "Set up your mailing list",
28659
+ attentionTitle: "This signup isn't showing on your site",
28660
+ formAttentionTitle: "This form isn't showing on your site",
28661
+ formLabel: "Which form",
28662
+ formPlaceholder: "Choose a contact form",
28663
+ formFields: "Asks for",
28664
+ formOpen: "Edit this form",
28665
+ noFormsTitle: "You don't have a contact form yet",
28666
+ noFormsBody: "Make one in Forms, then choose it here.",
28667
+ noFormsAction: "Make a contact form",
28668
+ remove: "Remove from footer"
28669
+ };
28670
+ function StandardContactChoice({ dispatch, error, formId, manageFormsHref, options }) {
28671
+ const standardForms = options.forms.filter((form) => form.contactDefinition?.kind === "standard-contact");
28672
+ const selectedForm = standardForms.find((form) => form.id === formId);
28673
+ if (standardForms.length === 0) return /* @__PURE__ */ jsx(NoContactForms, {
28674
+ error,
28675
+ manageFormsHref
28676
+ });
28677
+ const fields = visibleFieldLabels(selectedForm);
28678
+ return /* @__PURE__ */ jsxs("div", {
28679
+ className: "space-y-3",
28680
+ children: [/* @__PURE__ */ jsx(FieldFrame, {
28681
+ error,
28682
+ fieldPath: "engagement.formId",
28683
+ label: ENGAGEMENT_COPY.formLabel,
28684
+ hint: fields ? `${ENGAGEMENT_COPY.formFields}: ${fields}` : void 0,
28685
+ children: ({ id, descriptionId, messageId }) => /* @__PURE__ */ jsxs(NativeSelect, {
28686
+ id,
28687
+ "aria-describedby": describedBy(descriptionId, messageId),
28688
+ "aria-invalid": error ? true : void 0,
28689
+ onChange: (event) => dispatch({
28690
+ type: "set-form",
28691
+ formId: event.target.value
28692
+ }),
28693
+ value: formId,
28694
+ children: [/* @__PURE__ */ jsx("option", {
28695
+ value: "",
28696
+ children: ENGAGEMENT_COPY.formPlaceholder
28697
+ }), standardForms.map((form) => /* @__PURE__ */ jsx("option", {
28698
+ value: form.id,
28699
+ children: form.name
28700
+ }, form.id))]
28897
28701
  })
28898
- ]
28702
+ }), selectedForm ? /* @__PURE__ */ jsx(Button$1, {
28703
+ asChild: true,
28704
+ variant: "link",
28705
+ size: "sm",
28706
+ className: "h-auto px-0",
28707
+ children: /* @__PURE__ */ jsx("a", {
28708
+ href: `${manageFormsHref.replace(/\/$/u, "")}/${selectedForm.id}`,
28709
+ children: ENGAGEMENT_COPY.formOpen
28710
+ })
28711
+ }) : null]
28899
28712
  });
28900
28713
  }
28901
- function EngagementCopyFields({ dispatch, draft, error }) {
28902
- return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(TextField, {
28903
- error,
28904
- label: "Heading",
28905
- maxLength: 80,
28906
- onChange: (heading) => dispatch({
28907
- type: "set-heading",
28908
- heading
28909
- }),
28910
- path: "engagement.heading",
28911
- value: draft.heading
28912
- }), /* @__PURE__ */ jsx(TextField, {
28913
- label: "Intro",
28914
- maxLength: 240,
28915
- multiline: true,
28916
- onChange: (intro) => dispatch({
28917
- type: "set-intro",
28918
- intro
28919
- }),
28920
- path: "engagement.intro",
28921
- value: draft.intro
28922
- })] });
28714
+ /** The selected contact form's visible fields, for the hint under the picker. */
28715
+ function visibleFieldLabels(form) {
28716
+ if (form?.contactDefinition?.kind !== "standard-contact") return null;
28717
+ return form.contactDefinition.fields.filter((field) => field.visible).map((field) => field.label).join(" · ");
28923
28718
  }
28924
- function EngagementPlacementChoice({ dispatch, treatment }) {
28925
- return /* @__PURE__ */ jsxs("fieldset", {
28719
+ function NoContactForms({ error, manageFormsHref }) {
28720
+ return /* @__PURE__ */ jsxs(Callout, {
28926
28721
  className: "space-y-2",
28927
28722
  children: [
28928
- /* @__PURE__ */ jsx("legend", {
28929
- className: "text-sm font-medium",
28930
- children: "Placement"
28931
- }),
28932
- /* @__PURE__ */ jsx(RadioChoice, {
28933
- checked: treatment === "integrated",
28934
- label: "Part of the footer",
28935
- name: "engagement-treatment",
28936
- onChange: () => dispatch({
28937
- type: "set-treatment",
28938
- treatment: "integrated"
28939
- })
28940
- }),
28941
- /* @__PURE__ */ jsx(RadioChoice, {
28942
- checked: treatment === "separate-row",
28943
- label: "Show it in a separate row",
28944
- name: "engagement-treatment",
28945
- onChange: () => dispatch({
28946
- type: "set-treatment",
28947
- treatment: "separate-row"
28723
+ /* @__PURE__ */ jsx(CalloutTitle, { children: ENGAGEMENT_COPY.noFormsTitle }),
28724
+ /* @__PURE__ */ jsx(CalloutDescription, { children: ENGAGEMENT_COPY.noFormsBody }),
28725
+ /* @__PURE__ */ jsx(EngagementError, { message: error }),
28726
+ /* @__PURE__ */ jsx(Button$1, {
28727
+ asChild: true,
28728
+ size: "sm",
28729
+ children: /* @__PURE__ */ jsx("a", {
28730
+ href: manageFormsHref,
28731
+ children: ENGAGEMENT_COPY.noFormsAction
28948
28732
  })
28949
28733
  })
28950
28734
  ]
28951
28735
  });
28952
28736
  }
28953
- function StandardContactChoice({ dispatch, formId, manageFormsHref, options }) {
28954
- const standardForms = options.forms.filter((form) => form.contactDefinition?.kind === "standard-contact");
28955
- const selectedForm = standardForms.find((form) => form.id === formId);
28956
- useEffect(() => {
28957
- if (formId && !selectedForm) dispatch({
28958
- type: "set-form",
28959
- formId: ""
28960
- });
28961
- }, [
28962
- dispatch,
28963
- formId,
28964
- selectedForm
28965
- ]);
28966
- return /* @__PURE__ */ jsxs("div", {
28967
- className: "space-y-3",
28737
+ function EngagementError({ message }) {
28738
+ return message ? /* @__PURE__ */ jsx("p", {
28739
+ role: "alert",
28740
+ className: "text-sm text-destructive",
28741
+ children: message
28742
+ }) : null;
28743
+ }
28744
+ function MailingListChoice({ dispatch, draft, manageNewsletterHref, options }) {
28745
+ if (options.mailingList.tag !== "configured") return /* @__PURE__ */ jsxs(Callout, {
28746
+ className: "space-y-2",
28968
28747
  children: [
28969
- /* @__PURE__ */ jsx(FieldFrame, {
28970
- fieldPath: "engagement.formId",
28971
- label: "Contact form",
28972
- children: ({ id, descriptionId, messageId }) => /* @__PURE__ */ jsxs("select", {
28973
- id,
28974
- "aria-describedby": describedBy(descriptionId, messageId),
28975
- className: inputClass$1,
28976
- onChange: (event) => dispatch({
28977
- type: "set-form",
28978
- formId: event.target.value
28979
- }),
28980
- value: formId,
28981
- children: [/* @__PURE__ */ jsx("option", {
28982
- value: "",
28983
- children: "Choose a standard contact form"
28984
- }), standardForms.map((form) => /* @__PURE__ */ jsx("option", {
28985
- value: form.id,
28986
- children: form.name
28987
- }, form.id))]
28748
+ /* @__PURE__ */ jsx(CalloutTitle, { children: ENGAGEMENT_COPY.notSetUpTitle }),
28749
+ /* @__PURE__ */ jsx(CalloutDescription, { children: ENGAGEMENT_COPY.notSetUpBody }),
28750
+ options.canManageMailingListSetup ? /* @__PURE__ */ jsx(Button$1, {
28751
+ asChild: true,
28752
+ size: "sm",
28753
+ children: /* @__PURE__ */ jsx("a", {
28754
+ href: manageNewsletterHref,
28755
+ children: ENGAGEMENT_COPY.notSetUpAction
28988
28756
  })
28989
- }),
28990
- selectedForm?.contactDefinition?.kind === "standard-contact" ? /* @__PURE__ */ jsx("div", {
28991
- className: "rounded-md border p-3 text-xs text-muted-foreground",
28992
- children: selectedForm.contactDefinition.fields.filter((field) => field.visible).map((field) => field.label).join(" · ")
28993
- }) : null,
28994
- selectedForm ? /* @__PURE__ */ jsx("a", {
28995
- className: buttonClass$3,
28996
- href: `${manageFormsHref.replace(/\/$/u, "")}/${selectedForm.id}`,
28997
- children: "Open in Forms"
28998
- }) : null
28757
+ }) : /* @__PURE__ */ jsx(CalloutDescription, { children: ENGAGEMENT_COPY.askOwner })
28999
28758
  ]
29000
28759
  });
29001
- }
29002
- function MailingListChoice({ dispatch, draft, manageNewsletterHref, options }) {
29003
28760
  return /* @__PURE__ */ jsxs("div", {
29004
28761
  className: "space-y-3",
29005
28762
  children: [
29006
- options.mailingList.tag === "configured" ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(MailingListGlobalSettingsSummary, { context: {
28763
+ /* @__PURE__ */ jsx(MailingListGlobalSettingsSummary, { context: {
29007
28764
  runtime: options.mailingList,
29008
28765
  expectedProviderScope: options.expectedMailingListProviderScope,
29009
28766
  confirmation: options.confirmation,
29010
28767
  canManageSetup: options.canManageMailingListSetup
29011
- } }), /* @__PURE__ */ jsx(MailingListTargetingControl, {
28768
+ } }),
28769
+ /* @__PURE__ */ jsx(MailingListTargetingControl, {
29012
28770
  context: options.mailingList,
29013
28771
  targeting: draft.targeting,
29014
28772
  name: "footer-mailing-list-targeting",
@@ -29016,84 +28774,53 @@ function MailingListChoice({ dispatch, draft, manageNewsletterHref, options }) {
29016
28774
  type: "set-mailing-targeting",
29017
28775
  targeting
29018
28776
  })
29019
- })] }) : /* @__PURE__ */ jsx("p", {
29020
- className: "rounded-md border border-dashed p-3 text-sm text-muted-foreground",
29021
- children: "Set up a mailing list before adding this footer form."
29022
28777
  }),
29023
- options.canManageMailingListSetup ? /* @__PURE__ */ jsx("a", {
29024
- className: buttonClass$3,
29025
- href: manageNewsletterHref,
29026
- children: "Manage mailing list"
29027
- }) : /* @__PURE__ */ jsx("p", {
28778
+ /* @__PURE__ */ jsx("p", {
29028
28779
  className: "text-xs text-muted-foreground",
29029
- children: "Ask an administrator to change shared form settings."
28780
+ children: ENGAGEMENT_COPY.listNote
29030
28781
  }),
29031
- /* @__PURE__ */ jsx("div", {
28782
+ options.canManageMailingListSetup ? /* @__PURE__ */ jsx(Button$1, {
28783
+ asChild: true,
28784
+ variant: "link",
28785
+ size: "sm",
28786
+ className: "h-auto px-0",
28787
+ children: /* @__PURE__ */ jsx("a", {
28788
+ href: manageNewsletterHref,
28789
+ children: ENGAGEMENT_COPY.listSettings
28790
+ })
28791
+ }) : /* @__PURE__ */ jsx("p", {
29032
28792
  className: "text-xs text-muted-foreground",
29033
- children: "Form fields, button text, privacy note and confirmation are managed in Mailing list setup."
28793
+ children: ENGAGEMENT_COPY.askOwner
29034
28794
  })
29035
28795
  ]
29036
28796
  });
29037
28797
  }
29038
- function TextField({ error, label, maxLength, multiline = false, onChange, path, value }) {
29039
- return /* @__PURE__ */ jsx(FieldFrame, {
29040
- error,
29041
- fieldPath: path,
29042
- label,
29043
- children: ({ id, descriptionId, messageId }) => {
29044
- const props = {
29045
- id,
29046
- "aria-describedby": describedBy(descriptionId, messageId),
29047
- className: inputClass$1,
29048
- maxLength,
29049
- onChange: (event) => onChange(event.target.value),
29050
- value
29051
- };
29052
- return multiline ? /* @__PURE__ */ jsx("textarea", { ...props }) : /* @__PURE__ */ jsx("input", { ...props });
29053
- }
29054
- });
29055
- }
29056
- function RadioChoice({ checked, label, name, onChange }) {
29057
- return /* @__PURE__ */ jsxs("label", {
29058
- className: "flex items-center gap-2 text-sm",
29059
- children: [/* @__PURE__ */ jsx("input", {
29060
- checked,
29061
- name,
29062
- onChange,
29063
- type: "radio"
29064
- }), label]
29065
- });
29066
- }
29067
28798
  function describedBy(descriptionId, messageId) {
29068
28799
  return [descriptionId, messageId].filter(Boolean).join(" ") || void 0;
29069
28800
  }
29070
28801
  //#endregion
29071
28802
  //#region ../content-editor/src/FooterEngagementEditorPanel.tsx
29072
- const buttonClass$2 = "rounded-md border bg-background px-3 py-2 text-sm font-medium hover:bg-muted";
29073
- const primaryButtonClass$2 = "rounded-md bg-primary px-3 py-2 text-sm font-medium text-primary-foreground";
29074
28803
  function FooterEngagementEditorPanel(props) {
29075
- const { dispatch, draft, error, preview } = useFooterEngagementDraft(props);
28804
+ const { dispatch, draft, error, live } = useFooterEngagementDraft(props);
28805
+ const mailing = draft.kind === "mailing-list";
29076
28806
  return /* @__PURE__ */ jsxs("div", {
29077
28807
  className: "space-y-5",
29078
28808
  children: [
29079
- /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("h2", {
28809
+ /* @__PURE__ */ jsx("h2", {
29080
28810
  className: "font-semibold",
29081
- children: "Footer contact"
29082
- }), /* @__PURE__ */ jsx("p", {
29083
- className: "text-xs text-muted-foreground",
29084
- children: "Preview the change here before applying it to every page."
29085
- })] }),
29086
- /* @__PURE__ */ jsx(ReadinessNotice, { readiness: props.readiness }),
29087
- /* @__PURE__ */ jsx(EngagementKindChoice, {
29088
- dispatch,
29089
- kind: draft.kind
28811
+ children: mailing ? ENGAGEMENT_COPY.mailingTitle : ENGAGEMENT_COPY.contactTitle
29090
28812
  }),
29091
- /* @__PURE__ */ jsx(EngagementCopyFields, {
29092
- draft,
29093
- error,
28813
+ /* @__PURE__ */ jsx(EngagementKindChoice, {
28814
+ kind: draft.kind,
29094
28815
  dispatch
29095
28816
  }),
28817
+ /* @__PURE__ */ jsx(RepairCallout, {
28818
+ mailing,
28819
+ options: props.options,
28820
+ readiness: props.readiness
28821
+ }),
29096
28822
  draft.kind === "standard-contact" ? /* @__PURE__ */ jsx(StandardContactChoice, {
28823
+ error: fieldErrorMessage(error, "formId"),
29097
28824
  formId: draft.formId,
29098
28825
  manageFormsHref: props.manageFormsHref,
29099
28826
  options: props.options,
@@ -29104,114 +28831,134 @@ function FooterEngagementEditorPanel(props) {
29104
28831
  options: props.options,
29105
28832
  dispatch
29106
28833
  }),
29107
- /* @__PURE__ */ jsx(EngagementPlacementChoice, {
29108
- treatment: draft.treatment,
29109
- dispatch
29110
- }),
29111
- /* @__PURE__ */ jsx(PreviewActions, {
29112
- candidate: props.candidate,
29113
- onApply: props.onApply,
29114
- onCancel: props.onCancel,
29115
- onPreview: preview
28834
+ /* @__PURE__ */ jsx(EngagementTextFields, {
28835
+ draft,
28836
+ error,
28837
+ dispatch,
28838
+ live
29116
28839
  }),
29117
- props.current !== null ? /* @__PURE__ */ jsx("button", {
29118
- className: buttonClass$2,
29119
- onClick: props.onRemove,
29120
- type: "button",
29121
- children: "Remove from footer"
28840
+ /* @__PURE__ */ jsx(FooterLiveSaveFailure, { live }),
28841
+ /* @__PURE__ */ jsx(EngagementError, { message: generalErrorMessage(error) }),
28842
+ props.current !== null ? /* @__PURE__ */ jsx("div", {
28843
+ className: "border-t pt-4",
28844
+ children: /* @__PURE__ */ jsx(Button$1, {
28845
+ type: "button",
28846
+ variant: "outline",
28847
+ size: "sm",
28848
+ onClick: props.onRemove,
28849
+ children: ENGAGEMENT_COPY.remove
28850
+ })
29122
28851
  }) : null
29123
28852
  ]
29124
28853
  });
29125
28854
  }
29126
- function useFooterEngagementDraft(props) {
29127
- const [draft, setDraft] = useState(() => createFooterEngagementDraft(props.candidate ?? props.current));
29128
- const [error, setError] = useState(null);
29129
- return {
29130
- dispatch: useCallback((event) => setDraft((current) => reduceFooterEngagementDraft(current, event)), []),
29131
- draft,
29132
- error,
29133
- preview: useCallback(() => {
29134
- const parsed = parseFooterEngagementDraft(draft, props.current?.id ?? "engagement");
29135
- if (!parsed.ok) {
29136
- setError(parsed.error.message);
29137
- return;
29138
- }
29139
- setError(null);
29140
- props.onPreview(parsed.value);
29141
- }, [draft, props])
29142
- };
29143
- }
29144
- function ReadinessNotice({ readiness }) {
29145
- return readiness.kind === "needs-repair" ? /* @__PURE__ */ jsx("p", {
29146
- role: "alert",
29147
- className: "rounded-md border p-3 text-sm",
29148
- children: readiness.message
29149
- }) : null;
29150
- }
29151
- function PreviewActions({ candidate, onApply, onCancel, onPreview }) {
29152
- return candidate !== null ? /* @__PURE__ */ jsxs("div", {
29153
- className: "space-y-3 rounded-lg border bg-muted/30 p-3",
28855
+ function EngagementKindChoice({ kind, dispatch }) {
28856
+ return /* @__PURE__ */ jsxs("div", {
28857
+ className: "space-y-1.5",
29154
28858
  children: [/* @__PURE__ */ jsx("div", {
29155
28859
  className: "text-sm font-medium",
29156
- children: "Preview ready"
29157
- }), /* @__PURE__ */ jsxs("div", {
29158
- className: "flex gap-2",
29159
- children: [/* @__PURE__ */ jsx("button", {
29160
- className: primaryButtonClass$2,
29161
- onClick: onApply,
29162
- type: "button",
29163
- children: "Apply to footer"
29164
- }), /* @__PURE__ */ jsx("button", {
29165
- className: buttonClass$2,
29166
- onClick: onCancel,
29167
- type: "button",
29168
- children: "Cancel"
29169
- })]
28860
+ id: "footer-engagement-kind",
28861
+ children: ENGAGEMENT_COPY.choiceLabel
28862
+ }), /* @__PURE__ */ jsx(SegmentedControl, {
28863
+ "aria-label": ENGAGEMENT_COPY.choiceLabel,
28864
+ size: "sm",
28865
+ className: "w-full",
28866
+ value: kind,
28867
+ onValueChange: (next) => dispatch({
28868
+ type: "select-kind",
28869
+ kind: next
28870
+ }),
28871
+ options: [{
28872
+ value: "mailing-list",
28873
+ label: ENGAGEMENT_COPY.mailingList
28874
+ }, {
28875
+ value: "standard-contact",
28876
+ label: ENGAGEMENT_COPY.contactForm
28877
+ }]
29170
28878
  })]
29171
- }) : /* @__PURE__ */ jsx("button", {
29172
- className: primaryButtonClass$2,
29173
- onClick: onPreview,
29174
- type: "button",
29175
- children: "Preview change"
29176
28879
  });
29177
28880
  }
29178
- //#endregion
29179
- //#region ../content-editor/src/FooterNavigationLayoutControl.tsx
29180
- const selectClass = "w-full rounded-md border bg-background px-3 py-2 text-sm";
29181
- function FooterNavigationLayoutControl({ value, arrangement, onChange, pending = false, disabled = false }) {
29182
- if (arrangement === "centred") return null;
29183
- return /* @__PURE__ */ jsx(FieldFrame, {
29184
- id: "footer-navigation-layout",
29185
- label: "Link layout",
29186
- description: "Inline links use a full-width row; stacked links stay in a footer column.",
29187
- children: ({ id, descriptionId }) => /* @__PURE__ */ jsxs("select", {
29188
- id,
29189
- "aria-describedby": descriptionId,
29190
- className: selectClass,
29191
- disabled: disabled || pending,
29192
- "aria-busy": pending,
29193
- value,
29194
- onChange: (event) => onChange(event.target.value === "stack" ? "stack" : "inline-wrap"),
29195
- children: [/* @__PURE__ */ jsx("option", {
29196
- value: "stack",
29197
- children: "Stacked"
29198
- }), /* @__PURE__ */ jsx("option", {
29199
- value: "inline-wrap",
29200
- children: "Inline"
29201
- })]
29202
- })
28881
+ /** The mailing-list choice explains an unconfigured list itself, so this stays quiet then. */
28882
+ function RepairCallout({ mailing, options, readiness }) {
28883
+ if (readiness.kind !== "needs-repair") return null;
28884
+ if (mailing && options.mailingList.tag !== "configured") return null;
28885
+ return /* @__PURE__ */ jsxs(Callout, {
28886
+ tone: "warning",
28887
+ role: "alert",
28888
+ children: [/* @__PURE__ */ jsx(CalloutTitle, { children: mailing ? ENGAGEMENT_COPY.attentionTitle : ENGAGEMENT_COPY.formAttentionTitle }), /* @__PURE__ */ jsx(CalloutDescription, { children: readiness.message })]
29203
28889
  });
29204
28890
  }
28891
+ function EngagementTextFields({ draft, error, dispatch, live }) {
28892
+ const mailing = draft.kind === "mailing-list";
28893
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(FooterLiveTextField, {
28894
+ label: ENGAGEMENT_COPY.headingLabel,
28895
+ hint: mailing ? ENGAGEMENT_COPY.headingHint : void 0,
28896
+ error: fieldErrorMessage(error, "heading"),
28897
+ maxLength: 80,
28898
+ value: draft.heading,
28899
+ onChange: (heading) => dispatch({
28900
+ type: "set-heading",
28901
+ heading
28902
+ }),
28903
+ live
28904
+ }), /* @__PURE__ */ jsx(FooterLiveTextField, {
28905
+ label: ENGAGEMENT_COPY.introLabel,
28906
+ optional: true,
28907
+ hint: mailing ? ENGAGEMENT_COPY.introHint : void 0,
28908
+ error: fieldErrorMessage(error, "intro"),
28909
+ maxLength: 240,
28910
+ multiline: true,
28911
+ value: draft.intro,
28912
+ onChange: (intro) => dispatch({
28913
+ type: "set-intro",
28914
+ intro
28915
+ }),
28916
+ live
28917
+ })] });
28918
+ }
28919
+ function fieldErrorMessage(error, field) {
28920
+ return error?.field === field ? error.message : null;
28921
+ }
28922
+ /** Errors without a field of their own show below the choices. */
28923
+ function generalErrorMessage(error) {
28924
+ return error !== null && (error.field === null || error.field === "targeting") ? error.message : null;
28925
+ }
28926
+ /**
28927
+ * One draft for the whole panel. Choices (what visitors can do, which form or
28928
+ * list) save at once; the heading and intro save after a pause in typing, under
28929
+ * one text key per field so a run of typing joins one Undo step.
28930
+ */
28931
+ function useFooterEngagementDraft(props) {
28932
+ const known = useRef(props.current?.id);
28933
+ if (props.current) known.current = props.current.id;
28934
+ const sectionId = known.current ?? unsafeAsFooterModuleId("engagement");
28935
+ const { value: draft, dispatch, live, started } = useFooterEngagementPart(sectionId);
28936
+ const parsed = parseFooterEngagementDraft(draft, sectionId);
28937
+ const error = parsed.ok ? null : parsed.error;
28938
+ return {
28939
+ dispatch,
28940
+ draft,
28941
+ error: props.current === null && !started && error?.field === "formId" ? null : error,
28942
+ live
28943
+ };
28944
+ }
29205
28945
  //#endregion
29206
28946
  //#region ../content-editor/src/FooterComposerOverview.tsx
29207
28947
  const buttonClass$1 = "rounded-md border bg-background px-3 py-2 text-sm font-medium hover:bg-muted";
29208
28948
  const primaryButtonClass$1 = "rounded-md bg-primary px-3 py-2 text-sm font-medium text-primary-foreground";
29209
28949
  function SaveBadge({ state }) {
29210
28950
  if (state === "idle") return null;
28951
+ const label = {
28952
+ saving: "Saving…",
28953
+ saved: "Saved",
28954
+ conflict: "Newer version loaded",
28955
+ failed: "Save failed",
28956
+ unsaved: "Not saved yet"
28957
+ }[state];
29211
28958
  return /* @__PURE__ */ jsx("span", {
29212
28959
  "aria-live": "polite",
29213
28960
  className: "text-xs text-muted-foreground",
29214
- children: state === "saving" ? "Saving…" : state === "saved" ? "Saved" : state === "conflict" ? "Newer version loaded" : "Save failed"
28961
+ children: label
29215
28962
  });
29216
28963
  }
29217
28964
  function FooterPreview({ runtime }) {
@@ -29229,13 +28976,13 @@ function FooterPreview({ runtime }) {
29229
28976
  className: "space-y-6",
29230
28977
  disabled: true,
29231
28978
  children: runtime.regions.map((region) => /* @__PURE__ */ jsx("div", {
29232
- "data-footer-preview-region": region.kind,
29233
- className: region.kind === "bottom" ? "border-t border-white/15 pt-4" : "grid gap-6 md:grid-cols-2",
28979
+ "data-footer-preview-region": region.slot,
28980
+ className: region.slot === "base" ? "border-t border-white/15 pt-4" : "grid gap-6 md:grid-cols-2",
29234
28981
  children: region.groups.map((group) => /* @__PURE__ */ jsx("div", {
29235
28982
  className: "min-w-0 space-y-3 rounded-lg border border-white/15 p-4",
29236
28983
  children: group.modules.map((module) => /* @__PURE__ */ jsx(FooterPreviewModule, { module }, module.id))
29237
28984
  }, group.kind))
29238
- }, region.kind))
28985
+ }, region.slot))
29239
28986
  })
29240
28987
  })
29241
28988
  });
@@ -29310,17 +29057,10 @@ function previewModuleLabel(module) {
29310
29057
  function engagementLabel(engagement) {
29311
29058
  return engagement.kind === "standard-contact" ? "Contact form" : "Mailing list signup";
29312
29059
  }
29313
- function FooterOverview({ credit, onCreditHiddenChange, plan, composition, onTarget, onChange, manageLinksHref, manageSettingsHref, navigationLayout, arrangement, onEngagement, onNavigationLayoutChange, navigationLayoutPending, navigationLayoutDisabled }) {
29060
+ function FooterOverview({ credit, onCreditHiddenChange, plan, composition, onTarget, onChange, manageLinksHref, manageSettingsHref, onEngagement, onAddEngagement }) {
29314
29061
  return /* @__PURE__ */ jsxs("div", {
29315
29062
  className: "space-y-5",
29316
29063
  children: [
29317
- onNavigationLayoutChange ? /* @__PURE__ */ jsx(FooterNavigationLayoutControl, {
29318
- arrangement,
29319
- value: navigationLayout,
29320
- pending: navigationLayoutPending,
29321
- disabled: navigationLayoutDisabled,
29322
- onChange: onNavigationLayoutChange
29323
- }) : null,
29324
29064
  /* @__PURE__ */ jsx("h2", {
29325
29065
  className: "font-semibold",
29326
29066
  children: "Shown in footer"
@@ -29345,7 +29085,7 @@ function FooterOverview({ credit, onCreditHiddenChange, plan, composition, onTar
29345
29085
  }),
29346
29086
  /* @__PURE__ */ jsx(AddFooterEngagement, {
29347
29087
  composition,
29348
- onEngagement
29088
+ onAdd: onAddEngagement
29349
29089
  })
29350
29090
  ]
29351
29091
  });
@@ -29363,7 +29103,7 @@ function ShownFooterSections(props) {
29363
29103
  })]
29364
29104
  });
29365
29105
  }
29366
- function AddFooterEngagement({ composition, onEngagement }) {
29106
+ function AddFooterEngagement({ composition, onAdd }) {
29367
29107
  if (composition.sections.some((section) => section.kind === "engagement")) return null;
29368
29108
  return /* @__PURE__ */ jsxs("div", {
29369
29109
  className: "flex items-center justify-between gap-3 rounded-lg border border-dashed p-3",
@@ -29372,7 +29112,7 @@ function AddFooterEngagement({ composition, onEngagement }) {
29372
29112
  children: "Contact form or mailing list"
29373
29113
  }), /* @__PURE__ */ jsx("button", {
29374
29114
  className: buttonClass$1,
29375
- onClick: onEngagement,
29115
+ onClick: onAdd,
29376
29116
  type: "button",
29377
29117
  children: "Add"
29378
29118
  })]
@@ -29420,7 +29160,7 @@ function PlatformCreditSection({ place, credit, onHiddenChange }) {
29420
29160
  }),
29421
29161
  /* @__PURE__ */ jsx("div", {
29422
29162
  className: "mt-1 text-xs text-muted-foreground",
29423
- children: credit.kind === "optional" ? "Your plan lets you hide this line." : "Included with your Macadamia plan."
29163
+ children: credit.kind === "optional" ? "Your plan lets you remove this line." : "Included with your Macadamia plan."
29424
29164
  }),
29425
29165
  credit.kind === "optional" ? /* @__PURE__ */ jsx("div", {
29426
29166
  className: "mt-3 flex flex-wrap gap-2",
@@ -29429,7 +29169,7 @@ function PlatformCreditSection({ place, credit, onHiddenChange }) {
29429
29169
  disabled: saving,
29430
29170
  onClick: () => void change(true),
29431
29171
  type: "button",
29432
- children: "Hide"
29172
+ children: "Remove"
29433
29173
  })
29434
29174
  }) : null,
29435
29175
  /* @__PURE__ */ jsx(CreditSaveFailure, { state })
@@ -29506,7 +29246,7 @@ function ShownFooterSection({ composition, item, manageLinksHref, manageSettings
29506
29246
  className: buttonClass$1,
29507
29247
  onClick: hide,
29508
29248
  type: "button",
29509
- children: "Hide"
29249
+ children: "Remove"
29510
29250
  }),
29511
29251
  /* @__PURE__ */ jsx(ShownSectionSourceActions, {
29512
29252
  item,
@@ -29570,574 +29310,21 @@ function AvailableSection({ item, composition, onChange }) {
29570
29310
  });
29571
29311
  }
29572
29312
  //#endregion
29573
- //#region ../content-editor/src/footerEngagementEditor.ts
29574
- function resolveFooterEngagementAuthoringState(section, options) {
29575
- const resolution = resolveFooterEngagementPreview(section, options);
29576
- if (resolution.kind === "none" || resolution.kind === "resolved") return { kind: "ready" };
29577
- return {
29578
- kind: "needs-repair",
29579
- message: repairMessage(resolution.reason, section, options)
29580
- };
29581
- }
29582
- function resolveFooterEngagementPreview(section, options) {
29583
- if (section === null || !section.selected) return { kind: "none" };
29584
- if (section.source.kind === "standard-contact") return resolveStandardContactPreview(section.id, section.source, options);
29585
- return resolveMailingListPreview(section.id, section.source, options);
29586
- }
29587
- function resolveStandardContactPreview(sectionId, source, options) {
29588
- const form = options.forms.find((candidate) => candidate.id === source.formId);
29589
- if (form === void 0) return {
29590
- kind: "needs-attention",
29591
- reason: "missing-form"
29592
- };
29593
- if (form.contactDefinition.kind !== "standard-contact") return {
29594
- kind: "needs-attention",
29595
- reason: form.contactDefinition.kind === "invalid-contact" ? "invalid-form" : "wrong-form-kind"
29596
- };
29597
- return {
29598
- kind: "resolved",
29599
- sectionId,
29600
- engagement: {
29601
- kind: "standard-contact",
29602
- intro: source.intro,
29603
- runtime: { value: {
29604
- id: form.id,
29605
- schemaJson: { fields: form.contactDefinition.fields.filter((field) => field.visible).map((field) => ({
29606
- id: field.id,
29607
- label: field.label,
29608
- required: field.required,
29609
- type: standardContactFieldType(field.id)
29610
- })) }
29611
- } }
29612
- }
29613
- };
29614
- }
29615
- function resolveMailingListPreview(sectionId, source, options) {
29616
- if (options.mailingList.tag !== "configured") return {
29617
- kind: "needs-attention",
29618
- reason: "destination-not-ready"
29619
- };
29620
- if (source.targeting.mode === "custom" && source.targeting.provider !== options.mailingList.provider.provider) return {
29621
- kind: "needs-attention",
29622
- reason: "destination-not-ready"
29623
- };
29624
- return {
29625
- kind: "resolved",
29626
- sectionId,
29627
- engagement: {
29628
- kind: "mailing-list",
29629
- intro: source.intro,
29630
- runtime: {
29631
- mode: "preview",
29632
- source: "preview",
29633
- mailingList: options.mailingList,
29634
- targeting: source.targeting
29635
- }
29636
- }
29637
- };
29638
- }
29639
- function standardContactFieldType(fieldId) {
29640
- switch (fieldId) {
29641
- case "name": return "text";
29642
- case "email": return "email";
29643
- case "phone": return "tel";
29644
- case "message": return "textarea";
29645
- }
29646
- }
29647
- function repairMessage(reason, section, options) {
29648
- if (section?.source.kind === "standard-contact") return "Choose an available standard contact form.";
29649
- if (section?.source.kind === "mailing-list" && options.mailingList.tag === "not_configured") return "Set up a mailing list before using this footer form.";
29650
- return {
29651
- "missing-form": "Choose an available standard contact form.",
29652
- "wrong-form-kind": "Choose an available standard contact form.",
29653
- "invalid-form": "Choose an available standard contact form.",
29654
- "destination-not-ready": "Choose an available mailing list."
29655
- }[reason];
29656
- }
29657
- //#endregion
29658
29313
  //#region ../content-editor/src/footerPreviewRuntime.ts
29659
29314
  function buildFooterPreviewRuntime(input) {
29660
29315
  return buildFooterRuntimeViewModel({
29661
29316
  composition: input.composition,
29662
29317
  publicProfile: input.publicProfile,
29663
- businessAddress: input.hasBusinessAddress ? "Business address" : null,
29318
+ businessAddress: input.businessAddress,
29664
29319
  hasLogo: input.hasLogo,
29665
- hasFooterNavigation: input.hasMainNavigation,
29320
+ ...input.navigationFacts,
29666
29321
  hasLegalPolicyNavigation: input.hasLegalPolicyNavigation,
29667
- layoutVariant: input.arrangement,
29668
- navigationLayout: input.navigationLayout,
29322
+ layout: input.layoutSelection.layout,
29323
+ offeredLayouts: input.layoutSelection.offeredLayouts,
29669
29324
  engagement: input.engagement,
29670
- attribution: input.attribution
29671
- });
29672
- }
29673
- //#endregion
29674
- //#region ../content-editor/src/session-journal/useJournalTargetRefresh.ts
29675
- /** A display refresh follows a successful replay; it never supplies replay admission or a receipt. */
29676
- function useJournalTargetRefresh(journal, target, refresh) {
29677
- const latest = useRef(refresh);
29678
- latest.current = refresh;
29679
- useEffect(() => journal.store.subscribe((next, previous) => {
29680
- if (previous.replay.kind !== "running" || next.replay.kind !== "idle" || next.cursor === previous.cursor) return;
29681
- const change = previous.replay.request;
29682
- if (change.kind !== target.kind || change.siteId !== target.siteId) return;
29683
- if (!journalTrustAt(next, journalTargetKey(change))) return;
29684
- Promise.resolve().then(() => latest.current()).catch((error) => {
29685
- journal.dispatch({ kind: "display-held" });
29686
- console.error("[editor] journal display refresh failed", error);
29687
- });
29688
- }), [
29689
- journal,
29690
- target.kind,
29691
- target.siteId
29692
- ]);
29693
- }
29694
- //#endregion
29695
- //#region ../content-editor/src/footerWriteStatus.ts
29696
- /** One mounted-visit boundary excludes old receipts and hydration without recording another completion log. */
29697
- function selectFooterWriteStatus(journal, mounted, siteId, includeTheme) {
29698
- const facts = selectJournalWriteState(journal, [
29699
- {
29700
- kind: "footer-composition",
29701
- siteId,
29702
- expectedMailingListProviderScope: null
29703
- },
29704
- {
29705
- kind: "public-profile",
29706
- siteId
29707
- },
29708
- ...includeTheme ? [{
29709
- kind: "theme-selection",
29710
- siteId,
29711
- selectionId: null
29712
- }] : []
29713
- ]);
29714
- const success = facts.entries.some((entry) => receivedSinceMount(entry, mounted)) || facts.notice?.kind === "replayed" && journal.notice !== mounted.notice;
29715
- return {
29716
- saveState: facts.saving ? "saving" : facts.attentionNotice ? facts.attentionNotice.kind === "change" && facts.attentionNotice.reason === "conflict" ? "conflict" : "failed" : success ? "saved" : "idle",
29717
- message: footerWriteMessage(facts.attentionNotice)
29718
- };
29719
- }
29720
- function receivedSinceMount(entry, mounted) {
29721
- if (entry.settlement.kind !== "settled") return false;
29722
- const initial = mounted.entries.find((item) => item.edit.operationId === entry.edit.operationId)?.settlement;
29723
- return initial?.kind !== "settled" || initial.receipt !== entry.settlement.receipt;
29724
- }
29725
- /** Keep footer/profile conflict wording at its existing location; theme and failures share journal copy. */
29726
- function footerWriteMessage(notice) {
29727
- if (notice?.kind === "change" && notice.reason === "conflict" && notice.during === "save") {
29728
- if (notice.target.kind === "footer-composition") return "A newer footer was saved elsewhere. The latest version is shown; review it before trying again.";
29729
- if (notice.target.kind === "public-profile") return "Shared details changed elsewhere. The latest version is shown; review it before trying again.";
29730
- }
29731
- return journalNoticeMessage(notice);
29732
- }
29733
- //#endregion
29734
- //#region ../content-editor/src/useFooterComposerState.ts
29735
- function useFooterComposerState({ apiClient, canEdit, initialTarget, initialTargetRequestId, navigationLayoutControl = {
29736
- layout: "stack",
29737
- pending: false,
29738
- disabled: true
29739
- }, includeThemeStatus = true, onSaved, rawSiteId }) {
29740
- const siteId = useMemo(() => unsafeAsSiteId(rawSiteId), [rawSiteId]);
29741
- const loaded = useFooterLoad(apiClient, rawSiteId, siteId);
29742
- useFooterJournalRefresh(rawSiteId, loaded.load);
29743
- const [target, setTarget] = useFooterEditorTarget(initialTarget, initialTargetRequestId);
29744
- const session = useFooterSessionState(rawSiteId, canEdit, includeThemeStatus);
29745
- const saveComposition = useCompositionSaver({
29746
- apiClient,
29747
- canEdit,
29748
- compositionSnapshot: loaded.compositionSnapshot,
29749
- engagementOptions: loaded.engagementOptions,
29750
- onSaved,
29751
- reobserve: loaded.reobserve,
29752
- setCompositionSnapshot: loaded.setCompositionSnapshot,
29753
- siteId
29754
- });
29755
- const saveProfile = useProfileSaver({
29756
- apiClient,
29757
- canEdit,
29758
- onSaved,
29759
- reobserve: loaded.reobserve,
29760
- profileSnapshot: loaded.profileSnapshot,
29761
- setProfileSnapshot: loaded.setProfileSnapshot,
29762
- siteId
29763
- });
29764
- const saveCreditHidden = useCreditSaver({
29765
- apiClient,
29766
- canEdit,
29767
- credit: loaded.credit,
29768
- onSaved,
29769
- setCredit: loaded.setCredit,
29770
- siteId
29771
- });
29772
- return {
29773
- ...loaded,
29774
- ...session,
29775
- navigationLayoutControl,
29776
- saveCreditHidden,
29777
- saveComposition,
29778
- saveProfile,
29779
- siteId,
29780
- target,
29781
- setTarget
29782
- };
29783
- }
29784
- /**
29785
- * Hiding the platform credit is a site setting, not part of the composition or
29786
- * its undo history. The line moves once the save lands, so a failure is
29787
- * reported where the owner clicked.
29788
- */
29789
- function useCreditSaver(options) {
29790
- const { apiClient, canEdit, credit, onSaved, setCredit, siteId } = options;
29791
- return useCallback(async (hidden) => {
29792
- if (credit.kind !== "optional" || !footerAuthoringAllowed(canEdit, siteId)) return "failed";
29793
- try {
29794
- setCredit(await updateFooterCredit(apiClient, siteId, { hidden }));
29795
- onSaved?.();
29796
- return "saved";
29797
- } catch {
29798
- return "failed";
29799
- }
29800
- }, [
29801
- apiClient,
29802
- canEdit,
29803
- credit,
29804
- onSaved,
29805
- setCredit,
29806
- siteId
29807
- ]);
29808
- }
29809
- /** Status and admission are session facts; the only local marker is this mounted visit's start. */
29810
- function useFooterSessionState(siteId, canEdit, includeThemeStatus) {
29811
- const journal = useSessionJournal();
29812
- const mounted = useMemo(() => journal.store.getState(), [journal, siteId]);
29813
- const journalState = useStore(journal.store);
29814
- const admission = useSiteEditorAdmission(siteId);
29815
- return {
29816
- ...selectFooterWriteStatus(journalState, mounted, siteId, includeThemeStatus),
29817
- canEdit: canEdit && editorAdmissionIsOpen(admission),
29818
- authoringAllowed: () => footerAuthoringAllowed(canEdit, siteId)
29819
- };
29820
- }
29821
- function useFooterEditorTarget(initialTarget, initialTargetRequestId) {
29822
- const [target, setTarget] = useState(initialTarget ?? { kind: "overview" });
29823
- const initialTargetRef = useRef(initialTarget);
29824
- initialTargetRef.current = initialTarget;
29825
- useEffect(() => {
29826
- if (initialTargetRequestId !== void 0 && initialTargetRef.current) setTarget(initialTargetRef.current);
29827
- }, [initialTargetRequestId]);
29828
- return [target, setTarget];
29829
- }
29830
- function useFooterJournalRefresh(siteId, refresh) {
29831
- const journal = useSessionJournal();
29832
- useJournalTargetRefresh(journal, {
29833
- kind: "footer-composition",
29834
- siteId
29835
- }, refresh);
29836
- useJournalTargetRefresh(journal, {
29837
- kind: "public-profile",
29838
- siteId
29839
- }, refresh);
29840
- }
29841
- function footerAuthoringAllowed(canEdit, siteId) {
29842
- return canEdit && editorAdmissionIsOpen(editorAdmissionSession.read(siteId));
29843
- }
29844
- function footerErrorMessage(error, fallback = "The footer could not be loaded.") {
29845
- return error instanceof Error ? error.message : fallback;
29846
- }
29847
- /** Everything the composer shows, read together so the screen never mixes two moments. */
29848
- async function readFooterAuthoring(apiClient, rawSiteId, siteId) {
29849
- const [composition, profile, navigation, engagement] = await Promise.all([
29850
- getFooterComposition(apiClient, siteId),
29851
- getPublicProfile(apiClient, siteId),
29852
- getNavigationMenus(apiClient, { siteId: rawSiteId }),
29853
- getFooterEngagementAuthoringOptions(apiClient, siteId)
29854
- ]);
29855
- return {
29856
- composition,
29857
- profile,
29858
- navigation,
29859
- engagement
29860
- };
29861
- }
29862
- /**
29863
- * The platform credit as last confirmed. A reload that started before a credit
29864
- * save landed must not undo it, so a read applies only if no save came since.
29865
- */
29866
- function useCreditState() {
29867
- const [credit, setCreditState] = useState({ kind: "not-shown" });
29868
- const writes = useRef(0);
29869
- return {
29870
- credit,
29871
- setCredit: useCallback((next) => {
29872
- writes.current += 1;
29873
- setCreditState(next);
29874
- }, []),
29875
- readCredit: useCallback(() => {
29876
- const writesAtStart = writes.current;
29877
- return (read) => {
29878
- if (writes.current === writesAtStart) setCreditState(read);
29879
- };
29880
- }, [])
29881
- };
29882
- }
29883
- function useFooterLoad(apiClient, rawSiteId, siteId) {
29884
- const [compositionSnapshot, setCompositionSnapshot] = useState(null);
29885
- const [profileSnapshot, setProfileSnapshot] = useState(null);
29886
- const [navigationMenus, setNavigationMenus] = useState(null);
29887
- const [engagementOptions, setEngagementOptions] = useState(null);
29888
- const { credit, setCredit, readCredit } = useCreditState();
29889
- const [loadError, setLoadError] = useState(null);
29890
- const baseline = useFooterJournalBaseline(apiClient, rawSiteId, siteId);
29891
- const load = useCallback(async () => {
29892
- setLoadError(null);
29893
- try {
29894
- const applyCredit = readCredit();
29895
- const { composition, profile, navigation, engagement } = await readFooterAuthoring(apiClient, rawSiteId, siteId);
29896
- setCompositionSnapshot(composition);
29897
- applyCredit(composition.credit);
29898
- setProfileSnapshot(profile);
29899
- baseline.observe(composition, profile);
29900
- setNavigationMenus(navigation.menus);
29901
- setEngagementOptions(engagement);
29902
- } catch (error) {
29903
- setLoadError(footerErrorMessage(error));
29904
- }
29905
- }, [
29906
- apiClient,
29907
- baseline,
29908
- rawSiteId,
29909
- readCredit,
29910
- siteId
29911
- ]);
29912
- useEffect(() => {
29913
- load();
29914
- }, [load]);
29915
- return {
29916
- credit,
29917
- compositionSnapshot,
29918
- engagementOptions,
29919
- load,
29920
- reobserve: baseline.reobserve,
29921
- loadError,
29922
- navigationMenus,
29923
- profileSnapshot,
29924
- setCompositionSnapshot,
29925
- setCredit,
29926
- setProfileSnapshot
29927
- };
29928
- }
29929
- /**
29930
- * Every read of the stored footer and profile is this session's baseline for both journal targets.
29931
- * After an uncertain save the journal holds them; `reobserve` reads what is stored and lifts the hold
29932
- * without replacing what is on screen.
29933
- */
29934
- function useFooterJournalBaseline(apiClient, rawSiteId, siteId) {
29935
- const journal = useSessionJournal();
29936
- return useMemo(() => {
29937
- const observe = (composition, profile) => {
29938
- if (composition.kind === "ready") journal.observe({
29939
- kind: "footer-composition",
29940
- siteId: rawSiteId,
29941
- expectedMailingListProviderScope: null,
29942
- value: composition.composition,
29943
- revision: composition.revision
29944
- });
29945
- if (profile.kind === "ready") journal.observe({
29946
- kind: "public-profile",
29947
- siteId: rawSiteId,
29948
- value: profile.profile,
29949
- revision: profile.revision
29950
- });
29951
- };
29952
- const reobserve = async () => {
29953
- const [composition, profile] = await Promise.all([getFooterComposition(apiClient, siteId), getPublicProfile(apiClient, siteId)]);
29954
- observe(composition, profile);
29955
- };
29956
- return {
29957
- observe,
29958
- reobserve
29959
- };
29960
- }, [
29961
- apiClient,
29962
- journal,
29963
- rawSiteId,
29964
- siteId
29965
- ]);
29966
- }
29967
- function useOptimisticSave(siteId, snapshot, setSnapshot) {
29968
- const latest = useRef({
29969
- siteId,
29970
- snapshot,
29971
- confirmed: snapshot,
29972
- request: null
29325
+ attribution: input.attribution,
29326
+ ...input.suppressSignup ? { suppressSignup: true } : {}
29973
29327
  });
29974
- if (latest.current.siteId !== siteId || latest.current.snapshot !== snapshot) latest.current = {
29975
- siteId,
29976
- snapshot,
29977
- confirmed: snapshot,
29978
- request: null
29979
- };
29980
- useEffect(() => () => {
29981
- latest.current.request = null;
29982
- }, []);
29983
- return (candidate) => {
29984
- const request = {};
29985
- const confirmed = latest.current.confirmed;
29986
- latest.current = {
29987
- ...latest.current,
29988
- request
29989
- };
29990
- if (candidate) {
29991
- latest.current.snapshot = candidate;
29992
- setSnapshot(candidate);
29993
- }
29994
- const settle = (saved) => {
29995
- if (latest.current.request !== request) return false;
29996
- latest.current = {
29997
- siteId,
29998
- snapshot: saved,
29999
- confirmed: saved,
30000
- request: null
30001
- };
30002
- if (saved) setSnapshot(saved);
30003
- return true;
30004
- };
30005
- return {
30006
- settle,
30007
- rollback: () => settle(confirmed)
30008
- };
30009
- };
30010
- }
30011
- function useCompositionSaver(options) {
30012
- const journal = useSessionJournal();
30013
- const begin = useOptimisticSave(options.siteId, options.compositionSnapshot, options.setCompositionSnapshot);
30014
- return async (next, optimistic = true) => {
30015
- const snapshot = options.compositionSnapshot;
30016
- if (!footerAuthoringAllowed(options.canEdit, options.siteId) || snapshot?.kind !== "ready") return "failed";
30017
- const captured = captureComposition(journal, options, snapshot, next);
30018
- if (captured.reservation.kind === "busy") return "failed";
30019
- const request = begin(optimistic ? {
30020
- ...snapshot,
30021
- composition: next
30022
- } : null);
30023
- return saveCompositionRequest(options, next, snapshot.revision, request, {
30024
- reservation: captured.reservation,
30025
- change: captured.change
30026
- });
30027
- };
30028
- }
30029
- function captureComposition(journal, options, snapshot, next) {
30030
- const change = {
30031
- kind: "footer-composition",
30032
- siteId: options.siteId,
30033
- before: snapshot.composition,
30034
- after: next,
30035
- expectedMailingListProviderScope: options.engagementOptions?.expectedMailingListProviderScope ?? null
30036
- };
30037
- return {
30038
- change,
30039
- reservation: journal.accept({
30040
- expectedRevision: snapshot.revision,
30041
- ...change,
30042
- textKey: null,
30043
- label: journalLabels.footer
30044
- })
30045
- };
30046
- }
30047
- async function saveCompositionRequest(options, next, baseRevision, request, captured) {
30048
- try {
30049
- if (!footerAuthoringAllowed(options.canEdit, options.siteId)) throw new JournalWriteRefused("Editor admission closed before the footer save");
30050
- const result = await updateFooterComposition(options.apiClient, options.siteId, {
30051
- composition: next,
30052
- baseRevision,
30053
- expectedMailingListProviderScope: options.engagementOptions?.expectedMailingListProviderScope ?? void 0
30054
- });
30055
- if (result.kind === "conflict") {
30056
- if (result.authoritative.kind === "ready") captured.reservation.conflict({
30057
- kind: "footer-composition",
30058
- siteId: options.siteId,
30059
- expectedMailingListProviderScope: captured.change.expectedMailingListProviderScope,
30060
- value: result.authoritative.composition,
30061
- revision: result.authoritative.revision
30062
- });
30063
- else captured.reservation.stale();
30064
- request.settle(result.authoritative);
30065
- return "conflict";
30066
- }
30067
- captured.reservation.settle({
30068
- expectedRevision: baseRevision,
30069
- revision: result.snapshot.revision,
30070
- ...captured.change,
30071
- after: result.snapshot.composition
30072
- });
30073
- if (request.settle(result.snapshot)) options.onSaved?.();
30074
- return "saved";
30075
- } catch (error) {
30076
- captured.reservation.fail(error);
30077
- if (captured.reservation.held()) options.reobserve().catch(() => void 0);
30078
- request.rollback();
30079
- return "failed";
30080
- }
30081
- }
30082
- function useProfileSaver(options) {
30083
- const journal = useSessionJournal();
30084
- const begin = useOptimisticSave(options.siteId, options.profileSnapshot, options.setProfileSnapshot);
30085
- return async (next) => {
30086
- const snapshot = options.profileSnapshot;
30087
- if (!footerAuthoringAllowed(options.canEdit, options.siteId) || snapshot?.kind !== "ready") return;
30088
- const change = {
30089
- kind: "public-profile",
30090
- siteId: options.siteId,
30091
- before: snapshot.profile,
30092
- after: next
30093
- };
30094
- const reservation = journal.accept({
30095
- expectedRevision: snapshot.revision,
30096
- ...change,
30097
- textKey: null,
30098
- label: journalLabels.profile
30099
- });
30100
- if (reservation.kind === "busy") return;
30101
- const request = begin({
30102
- ...snapshot,
30103
- profile: next
30104
- });
30105
- await saveProfileRequest(options, next, snapshot.revision, request, {
30106
- reservation,
30107
- change
30108
- });
30109
- };
30110
- }
30111
- async function saveProfileRequest(options, next, baseRevision, request, captured) {
30112
- try {
30113
- if (!footerAuthoringAllowed(options.canEdit, options.siteId)) throw new JournalWriteRefused("Editor admission closed before the profile save");
30114
- const result = await updatePublicProfile(options.apiClient, options.siteId, {
30115
- profile: next,
30116
- baseRevision
30117
- });
30118
- if (result.kind === "conflict") {
30119
- if (result.authoritative.kind === "ready") captured.reservation.conflict({
30120
- kind: "public-profile",
30121
- siteId: options.siteId,
30122
- value: result.authoritative.profile,
30123
- revision: result.authoritative.revision
30124
- });
30125
- else captured.reservation.stale();
30126
- request.settle(result.authoritative);
30127
- return;
30128
- }
30129
- captured.reservation.settle({
30130
- expectedRevision: baseRevision,
30131
- revision: result.snapshot.revision,
30132
- ...captured.change,
30133
- after: result.snapshot.profile
30134
- });
30135
- if (request.settle(result.snapshot)) options.onSaved?.();
30136
- } catch (error) {
30137
- captured.reservation.fail(error);
30138
- if (captured.reservation.held()) options.reobserve().catch(() => void 0);
30139
- request.rollback();
30140
- }
30141
29328
  }
30142
29329
  //#endregion
30143
29330
  //#region ../content-editor/src/FooterComposerPanel.tsx
@@ -30151,34 +29338,40 @@ const moduleFieldCatalog = [{
30151
29338
  required: false,
30152
29339
  maxLength: 80
30153
29340
  }];
30154
- function fieldsForModule(module) {
30155
- if (module.kind === "brand") return [
30156
- ...moduleFieldCatalog,
30157
- {
30158
- id: "showLogo",
30159
- type: "boolean",
30160
- label: "Show logo"
30161
- },
30162
- {
30163
- id: "showTitle",
30164
- type: "boolean",
30165
- label: "Show site title"
30166
- }
30167
- ];
30168
- if (module.kind === "supporting-text" || module.kind === "legal") return [...moduleFieldCatalog, {
29341
+ /** The heading field, with a note when this layout draws the section's heading as an icon. */
29342
+ function headingField(headingAsIcon) {
29343
+ const [heading] = moduleFieldCatalog;
29344
+ if (!heading) throw new Error("The footer heading field is missing");
29345
+ return headingAsIcon ? {
29346
+ ...heading,
29347
+ description: SECTION_HEADING_AS_ICON
29348
+ } : heading;
29349
+ }
29350
+ const SECTION_HEADING_AS_ICON = "Shown as an icon in this layout.";
29351
+ function fieldsForModule(module, headingAsIcon) {
29352
+ const heading = headingField(headingAsIcon);
29353
+ if (module.kind === "supporting-text" || module.kind === "legal") return [heading, {
30169
29354
  id: "content",
30170
29355
  type: "richText",
30171
29356
  label: module.kind === "legal" ? "Legal text" : "Supporting text"
30172
29357
  }];
30173
- return [...moduleFieldCatalog];
29358
+ return [heading];
30174
29359
  }
30175
- function FooterComposerPanel({ apiClient, siteId: rawSiteId, customFooterMode, manageLinksHref, manageFormsHref = manageLinksHref.replace(/\/navigation$/u, "/forms"), manageNewsletterHref = manageLinksHref.replace(/\/navigation$/u, "/newsletter"), manageSettingsHref, arrangement, navigationLayoutControl: suppliedNavigationControl, initialTarget, initialTargetRequestId, variant = "full", canEdit = true, onSaved, loadingFallback }) {
30176
- const { authoringAllowed, canEdit: authoringEnabled, compositionSnapshot, engagementOptions, load, loadError, message, navigationLayoutControl, navigationMenus, profileSnapshot, credit, saveComposition, saveCreditHidden, saveProfile, saveState, setCompositionSnapshot, setTarget, siteId, target } = useFooterComposerState({
29360
+ function FooterComposerPanel(props) {
29361
+ return useFooterAuthoringOptional() ? /* @__PURE__ */ jsx(FooterComposerContent, { ...props }) : /* @__PURE__ */ jsx(FooterComposerProvider, {
29362
+ apiClient: props.apiClient,
29363
+ rawSiteId: props.siteId,
29364
+ canEdit: props.canEdit ?? true,
29365
+ onSaved: props.onSaved,
29366
+ children: /* @__PURE__ */ jsx(FooterComposerContent, { ...props })
29367
+ }, props.siteId);
29368
+ }
29369
+ function FooterComposerContent({ apiClient, siteId: rawSiteId, customFooterMode, manageLinksHref, manageFormsHref = manageLinksHref.replace(/\/navigation$/u, "/forms"), manageNewsletterHref = manageLinksHref.replace(/\/navigation$/u, "/newsletter"), manageSettingsHref, widgets, layoutSelection, liveRuntime, appearanceControls, initialTarget, initialTargetRequestId, variant = "full", canEdit = true, onSaved, loadingFallback }) {
29370
+ const { businessAddress, authoringAllowed, canEdit: authoringEnabled, compositionSnapshot, engagementOptions, fieldState, retryFailedDrafts, acceptingEdits, load, loadError, writeStatus, compositionDrafts, profileDrafts, navigationMenus, profileSnapshot, credit, saveComposition, saveCreditHidden, saveProfile, setCompositionSnapshot, setTarget, siteId, target } = useFooterComposerState({
30177
29371
  apiClient,
30178
29372
  canEdit,
30179
29373
  initialTarget,
30180
29374
  initialTargetRequestId,
30181
- navigationLayoutControl: suppliedNavigationControl,
30182
29375
  includeThemeStatus: variant === "full",
30183
29376
  onSaved,
30184
29377
  rawSiteId
@@ -30204,96 +29397,101 @@ function FooterComposerPanel({ apiClient, siteId: rawSiteId, customFooterMode, m
30204
29397
  }
30205
29398
  });
30206
29399
  return /* @__PURE__ */ jsx(ReadyFooterComposer, {
29400
+ businessAddress,
30207
29401
  canEdit: authoringEnabled,
30208
29402
  compositionSnapshot,
30209
29403
  customFooterMode,
30210
29404
  engagementOptions,
30211
- arrangement,
29405
+ layoutSelection,
29406
+ liveRuntime,
29407
+ appearanceControls,
30212
29408
  manageFormsHref,
30213
29409
  manageLinksHref,
30214
29410
  manageNewsletterHref,
30215
29411
  manageSettingsHref,
30216
- message,
30217
- navigationLayoutControl,
29412
+ widgets,
29413
+ writeStatus,
29414
+ compositionDrafts,
29415
+ profileDrafts,
29416
+ retryFailedDrafts,
29417
+ acceptingEdits,
30218
29418
  navigationMenus,
30219
29419
  profileSnapshot,
30220
29420
  credit,
30221
29421
  saveComposition,
30222
29422
  saveCreditHidden,
30223
29423
  saveProfile,
30224
- saveState,
30225
29424
  setTarget,
29425
+ beginAddingEngagement: fieldState.beginAddingEngagement,
30226
29426
  target,
30227
29427
  variant
30228
29428
  });
30229
29429
  }
30230
29430
  function ReadyFooterComposer(props) {
30231
- const [engagementCandidate, setEngagementCandidate] = useState(null);
30232
- const { canEdit, compositionSnapshot, engagementOptions, arrangement, navigationLayoutControl, navigationMenus, profileSnapshot, target } = props;
30233
- const candidateComposition = engagementCandidate === null ? null : upsertFooterEngagementSection(compositionSnapshot.composition, engagementCandidate);
30234
- const previewComposition = candidateComposition?.ok === true ? candidateComposition.value : compositionSnapshot.composition;
30235
- const candidateError = candidateComposition?.ok === false ? candidateComposition.error.message : null;
29431
+ const { canEdit, compositionSnapshot, engagementOptions, layoutSelection, navigationMenus, profileSnapshot, target } = props;
30236
29432
  const currentEngagement = compositionSnapshot.composition.sections.find((section) => section.kind === "engagement") ?? null;
30237
- const previewEngagement = previewComposition.sections.find((section) => section.kind === "engagement") ?? null;
30238
- const engagementReadiness = resolveFooterEngagementAuthoringState(previewEngagement, engagementOptions);
30239
- const resolvedEngagement = resolveFooterEngagementPreview(previewEngagement, engagementOptions);
30240
- const hasMainNavigation = navigationMenus.some((menu) => menu.location === "footer" && menu.items.length > 0);
30241
- const hasLegalPolicyNavigation = navigationMenus.some((menu) => menu.location === "legal" && menu.items.length > 0);
30242
- const plan = planFooterEditorView({
30243
- composition: previewComposition,
29433
+ const engagementReadiness = resolveFooterEngagementAuthoringState(currentEngagement, engagementOptions);
29434
+ const resolvedEngagement = resolveFooterEngagementPreview(currentEngagement, engagementOptions);
29435
+ const navigationFacts = footerMenuNavigationFacts(navigationMenus);
29436
+ const previewRuntime = buildFooterPreviewRuntime({
29437
+ composition: compositionSnapshot.composition,
30244
29438
  publicProfile: profileSnapshot.profile,
30245
- hasBusinessAddress: profileSnapshot.hasBusinessAddress,
29439
+ businessAddress: props.businessAddress,
30246
29440
  hasLogo: profileSnapshot.hasLogo,
30247
- hasMainNavigation,
30248
- hasLegalPolicyNavigation,
30249
- hasEngagementSource: resolvedEngagement.kind === "resolved",
30250
- canEdit,
30251
- arrangement,
30252
- navigationLayout: navigationLayoutControl.layout
29441
+ navigationFacts,
29442
+ hasLegalPolicyNavigation: navigationFacts.hasLegalPolicyNavigation,
29443
+ layoutSelection,
29444
+ engagement: resolvedEngagement,
29445
+ attribution: footerCreditLine(props.credit)
30253
29446
  });
30254
- const previewRuntime = buildFooterPreviewRuntime({
30255
- composition: previewComposition,
29447
+ const shownRuntime = props.liveRuntime ?? previewRuntime;
29448
+ const plan = planFooterEditorView({
29449
+ composition: compositionSnapshot.composition,
30256
29450
  publicProfile: profileSnapshot.profile,
30257
29451
  hasBusinessAddress: profileSnapshot.hasBusinessAddress,
30258
29452
  hasLogo: profileSnapshot.hasLogo,
30259
- hasMainNavigation,
30260
- hasLegalPolicyNavigation,
30261
- arrangement,
30262
- navigationLayout: navigationLayoutControl.layout,
30263
- engagement: resolvedEngagement,
30264
- attribution: footerCreditLine(props.credit)
29453
+ hasMainNavigation: navigationFacts.hasFooterNavigation,
29454
+ hasLegalPolicyNavigation: navigationFacts.hasLegalPolicyNavigation,
29455
+ hasEngagementSource: resolvedEngagement.kind === "resolved",
29456
+ canEdit,
29457
+ layout: shownRuntime.presentation.effective
30265
29458
  });
30266
29459
  const targetModule = target.kind === "module" ? compositionSnapshot.composition.sections.find((section) => section.id === target.moduleId) ?? null : null;
30267
29460
  const editingEngagement = target.kind === "engagement" || targetModule?.kind === "engagement";
29461
+ const openPartKey = editingEngagement ? footerPartKey({
29462
+ kind: "engagement",
29463
+ section: unsafeAsFooterModuleId("engagement"),
29464
+ fields: {}
29465
+ }) : targetModule ? footerPartKey({
29466
+ kind: "section-text",
29467
+ section: targetModule.id,
29468
+ fields: {}
29469
+ }) : null;
30268
29470
  const editor = /* @__PURE__ */ jsx(FooterEditorPane, {
30269
29471
  ...props,
30270
29472
  currentEngagement,
30271
29473
  editingEngagement,
30272
- engagementCandidate,
30273
29474
  engagementReadiness,
30274
29475
  plan,
30275
- setEngagementCandidate,
29476
+ shownRuntime,
30276
29477
  targetModule
30277
29478
  });
30278
29479
  return /* @__PURE__ */ jsx(FooterComposerLayout, {
30279
29480
  customFooterMode: props.customFooterMode,
30280
29481
  editor,
30281
- message: candidateError ?? props.message,
29482
+ writeStatus: footerHeaderStatus(props.writeStatus, [...props.compositionDrafts, ...props.profileDrafts], openPartKey),
29483
+ retryFailedDrafts: props.retryFailedDrafts,
30282
29484
  previewRuntime,
30283
- saveState: props.saveState,
30284
- showStagedPreview: engagementCandidate !== null,
30285
29485
  variant: props.variant
30286
29486
  });
30287
29487
  }
29488
+ /** In the details strip the footer draws an icon where the section's heading would be. */
29489
+ function headingShownAsIcon(runtime, moduleId) {
29490
+ return runtime.regions.some((region) => region.slot === "strip" && region.groups.some((group) => group.modules.some((module) => module.id === moduleId)));
29491
+ }
30288
29492
  function FooterEditorPane(props) {
30289
- const applyEngagement = async () => {
30290
- if (props.engagementCandidate === null) return;
30291
- const next = upsertFooterEngagementSection(props.compositionSnapshot.composition, props.engagementCandidate);
30292
- if (!next.ok) return;
30293
- if (await props.saveComposition(next.value, false) !== "failed") props.setEngagementCandidate(null);
30294
- };
30295
29493
  return /* @__PURE__ */ jsxs("fieldset", {
30296
- disabled: !props.canEdit,
29494
+ disabled: !props.canEdit || !props.acceptingEdits,
30297
29495
  className: props.variant === "sidebar" ? "space-y-4 p-4" : "space-y-4 rounded-xl border bg-card p-4 lg:sticky lg:top-6 lg:self-start",
30298
29496
  children: [
30299
29497
  !props.canEdit ? /* @__PURE__ */ jsx("p", {
@@ -30306,45 +29504,21 @@ function FooterEditorPane(props) {
30306
29504
  onClick: () => props.setTarget({ kind: "overview" }),
30307
29505
  children: "← Footer overview"
30308
29506
  }) : null,
30309
- props.target.kind === "overview" ? /* @__PURE__ */ jsx(FooterOverview, {
30310
- credit: props.credit,
30311
- onCreditHiddenChange: props.saveCreditHidden,
30312
- composition: props.compositionSnapshot.composition,
30313
- manageLinksHref: props.manageLinksHref,
30314
- manageSettingsHref: props.manageSettingsHref,
30315
- onChange: props.saveComposition,
30316
- onEngagement: () => props.setTarget({ kind: "engagement" }),
30317
- onTarget: props.setTarget,
30318
- plan: props.plan,
30319
- navigationLayout: props.navigationLayoutControl.layout,
30320
- navigationLayoutPending: props.navigationLayoutControl.pending,
30321
- navigationLayoutDisabled: props.navigationLayoutControl.disabled,
30322
- arrangement: props.arrangement,
30323
- onNavigationLayoutChange: props.navigationLayoutControl.onChange
30324
- }) : null,
29507
+ props.target.kind === "overview" ? /* @__PURE__ */ jsx(FooterOverviewPane, { ...props }) : null,
30325
29508
  props.target.kind === "module" && !props.editingEngagement ? /* @__PURE__ */ jsx(ModuleEditor, {
30326
29509
  module: props.targetModule,
30327
29510
  composition: props.compositionSnapshot.composition,
30328
29511
  onChange: props.saveComposition,
29512
+ headingAsIcon: props.targetModule ? headingShownAsIcon(props.shownRuntime, props.targetModule.id) : false,
29513
+ hasLogo: props.profileSnapshot.hasLogo,
29514
+ manageSettingsHref: props.manageSettingsHref,
29515
+ widgets: props.widgets,
30329
29516
  onShared: (section) => props.setTarget({
30330
29517
  kind: "shared-profile",
30331
29518
  section
30332
29519
  })
30333
29520
  }) : null,
30334
- props.editingEngagement ? /* @__PURE__ */ jsx(FooterEngagementEditorPanel, {
30335
- candidate: props.engagementCandidate,
30336
- current: props.currentEngagement,
30337
- manageFormsHref: props.manageFormsHref,
30338
- manageNewsletterHref: props.manageNewsletterHref,
30339
- onApply: applyEngagement,
30340
- onCancel: () => props.setEngagementCandidate(null),
30341
- onPreview: props.setEngagementCandidate,
30342
- onRemove: async () => {
30343
- if (await props.saveComposition(removeFooterEngagementSection(props.compositionSnapshot.composition), false) !== "failed") props.setEngagementCandidate(null);
30344
- },
30345
- options: props.engagementOptions,
30346
- readiness: props.engagementReadiness
30347
- }, `${props.engagementCandidate?.id ?? props.compositionSnapshot.revision}:${props.currentEngagement?.source.kind ?? "none"}`) : null,
29521
+ props.editingEngagement ? /* @__PURE__ */ jsx(FooterEngagementPane, { ...props }) : null,
30348
29522
  props.target.kind === "shared-profile" ? /* @__PURE__ */ jsx(SharedProfileEditor, {
30349
29523
  section: props.target.section,
30350
29524
  profile: props.profileSnapshot.profile,
@@ -30354,40 +29528,74 @@ function FooterEditorPane(props) {
30354
29528
  ]
30355
29529
  });
30356
29530
  }
30357
- function FooterComposerLayout({ customFooterMode, editor, message, previewRuntime, saveState, showStagedPreview, variant }) {
29531
+ function FooterOverviewPane(props) {
29532
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [Boolean(props.appearanceControls) || props.plan.shown.some(({ section }) => section.kind === "brand") ? /* @__PURE__ */ jsxs("section", {
29533
+ "aria-label": "How it looks",
29534
+ className: "space-y-3",
29535
+ children: [props.appearanceControls, /* @__PURE__ */ jsx(FooterBrandChoiceControl, {
29536
+ composition: props.compositionSnapshot.composition,
29537
+ hasLogo: props.profileSnapshot.hasLogo,
29538
+ manageSettingsHref: props.manageSettingsHref,
29539
+ onChange: (composition) => void props.saveComposition(composition)
29540
+ })]
29541
+ }) : null, /* @__PURE__ */ jsx(FooterOverview, {
29542
+ credit: props.credit,
29543
+ onCreditHiddenChange: props.saveCreditHidden,
29544
+ composition: props.compositionSnapshot.composition,
29545
+ manageLinksHref: props.manageLinksHref,
29546
+ manageSettingsHref: props.manageSettingsHref,
29547
+ onChange: props.saveComposition,
29548
+ onEngagement: () => props.setTarget({ kind: "engagement" }),
29549
+ onAddEngagement: () => {
29550
+ props.beginAddingEngagement();
29551
+ props.setTarget({ kind: "engagement" });
29552
+ },
29553
+ onTarget: props.setTarget,
29554
+ plan: props.plan
29555
+ })] });
29556
+ }
29557
+ function FooterEngagementPane(props) {
29558
+ return /* @__PURE__ */ jsx(FooterEngagementEditorPanel, {
29559
+ current: props.currentEngagement,
29560
+ manageFormsHref: props.manageFormsHref,
29561
+ manageNewsletterHref: props.manageNewsletterHref,
29562
+ onRemove: () => {
29563
+ const id = props.currentEngagement?.id;
29564
+ const next = id ? setFooterSectionSelected(props.compositionSnapshot.composition, id, false) : null;
29565
+ if (next?.ok) props.saveComposition(next.value);
29566
+ props.setTarget({ kind: "overview" });
29567
+ },
29568
+ options: props.engagementOptions,
29569
+ readiness: props.engagementReadiness
29570
+ });
29571
+ }
29572
+ function FooterComposerLayout({ customFooterMode, editor, writeStatus, retryFailedDrafts, previewRuntime, variant }) {
30358
29573
  if (variant === "sidebar") return /* @__PURE__ */ jsxs("div", {
30359
29574
  className: "space-y-3",
30360
- children: [
30361
- /* @__PURE__ */ jsxs("div", {
30362
- className: "border-b px-4 py-3",
30363
- children: [/* @__PURE__ */ jsxs("div", {
30364
- className: "flex items-center gap-2",
30365
- children: [
30366
- /* @__PURE__ */ jsx("h1", {
30367
- className: "font-semibold",
30368
- children: "Footer"
30369
- }),
30370
- /* @__PURE__ */ jsx("span", {
30371
- className: "rounded-full bg-muted px-2 py-0.5 text-xs",
30372
- children: "All pages"
30373
- }),
30374
- /* @__PURE__ */ jsx(SaveBadge, { state: saveState })
30375
- ]
30376
- }), message ? /* @__PURE__ */ jsx("p", {
30377
- role: "alert",
30378
- className: "mt-2 text-xs text-destructive",
30379
- children: message
30380
- }) : null]
30381
- }),
30382
- showStagedPreview ? /* @__PURE__ */ jsxs("div", {
30383
- className: "space-y-2 px-4",
30384
- children: [/* @__PURE__ */ jsx("h2", {
30385
- className: "text-sm font-semibold",
30386
- children: "Staged footer preview"
30387
- }), /* @__PURE__ */ jsx(FooterPreview, { runtime: previewRuntime })]
30388
- }) : null,
30389
- editor
30390
- ]
29575
+ children: [/* @__PURE__ */ jsxs("div", {
29576
+ className: "border-b px-4 py-3",
29577
+ children: [/* @__PURE__ */ jsxs("div", {
29578
+ className: "flex items-center gap-2",
29579
+ children: [
29580
+ /* @__PURE__ */ jsx("h1", {
29581
+ className: "font-semibold",
29582
+ children: "Footer"
29583
+ }),
29584
+ /* @__PURE__ */ jsx("span", {
29585
+ className: "rounded-full bg-muted px-2 py-0.5 text-xs",
29586
+ children: "All pages"
29587
+ }),
29588
+ /* @__PURE__ */ jsx(SaveBadge, { state: writeStatus.saveState })
29589
+ ]
29590
+ }), writeStatus.retry ? /* @__PURE__ */ jsx(FooterLiveSaveFailure, { live: {
29591
+ failed: true,
29592
+ retry: retryFailedDrafts
29593
+ } }) : writeStatus.message ? /* @__PURE__ */ jsx("p", {
29594
+ role: "alert",
29595
+ className: "mt-2 text-xs text-destructive",
29596
+ children: writeStatus.message
29597
+ }) : null]
29598
+ }), editor]
30391
29599
  });
30392
29600
  return /* @__PURE__ */ jsxs("div", {
30393
29601
  className: "grid gap-8 lg:grid-cols-[minmax(0,1fr)_22rem]",
@@ -30407,7 +29615,7 @@ function FooterComposerLayout({ customFooterMode, editor, message, previewRuntim
30407
29615
  className: "rounded-full bg-muted px-2.5 py-1 text-xs font-medium",
30408
29616
  children: "All pages"
30409
29617
  }),
30410
- /* @__PURE__ */ jsx(SaveBadge, { state: saveState })
29618
+ /* @__PURE__ */ jsx(SaveBadge, { state: writeStatus.saveState })
30411
29619
  ]
30412
29620
  }), /* @__PURE__ */ jsx("p", {
30413
29621
  className: "text-sm text-muted-foreground",
@@ -30423,119 +29631,103 @@ function FooterComposerLayout({ customFooterMode, editor, message, previewRuntim
30423
29631
  customFooterMode === "none" || customFooterMode === "blocks" ? " currently inactive." : " shown alongside custom footer blocks."
30424
29632
  ]
30425
29633
  }) : null,
30426
- message ? /* @__PURE__ */ jsx("div", {
29634
+ writeStatus.retry ? /* @__PURE__ */ jsx(FooterLiveSaveFailure, { live: {
29635
+ failed: true,
29636
+ retry: retryFailedDrafts
29637
+ } }) : writeStatus.message ? /* @__PURE__ */ jsx("div", {
30427
29638
  role: "alert",
30428
29639
  className: "rounded-lg border border-destructive/40 bg-destructive/5 p-3 text-sm",
30429
- children: message
29640
+ children: writeStatus.message
30430
29641
  }) : null,
30431
29642
  /* @__PURE__ */ jsx(FooterPreview, { runtime: previewRuntime })
30432
29643
  ]
30433
29644
  }), editor]
30434
29645
  });
30435
29646
  }
30436
- function ModuleEditor({ module, composition, onChange, onShared }) {
30437
- const form = useForm({ values: module ? { ...module } : {} });
30438
- const backend = useMemo(() => createRHFBackend(form), [form]);
30439
- if (module === null) return /* @__PURE__ */ jsx("p", {
29647
+ function ModuleEditor(props) {
29648
+ if (props.module === null) return /* @__PURE__ */ jsx("p", {
30440
29649
  className: "text-sm",
30441
29650
  children: "This section is no longer available."
30442
29651
  });
30443
- const saveSection = (values) => {
30444
- const sections = composition.sections.map((candidate) => candidate.id === module.id ? {
30445
- ...candidate,
30446
- ...values,
30447
- id: candidate.id,
30448
- kind: candidate.kind
30449
- } : candidate);
30450
- const parsed = validateFooterComposition({
30451
- ...composition,
30452
- sections
30453
- });
30454
- if (parsed.ok) onChange(parsed.value);
30455
- };
30456
- if (module.kind === "contact" || module.kind === "opening-hours" || module.kind === "social-links") {
30457
- const section = module.kind;
30458
- return /* @__PURE__ */ jsxs("div", {
30459
- className: "space-y-4",
30460
- children: [
30461
- /* @__PURE__ */ jsxs("form", {
30462
- className: "space-y-3",
30463
- onSubmit: form.handleSubmit(saveSection),
30464
- children: [
30465
- /* @__PURE__ */ jsx("h2", {
30466
- className: "font-semibold",
30467
- children: footerModuleLabel(module)
30468
- }),
30469
- /* @__PURE__ */ jsx(FormRenderer, {
30470
- dateContext: civilPickerDisplay.dateContext,
30471
- fields: moduleFieldCatalog,
30472
- backend
30473
- }),
30474
- /* @__PURE__ */ jsx("button", {
30475
- type: "submit",
30476
- className: buttonClass,
30477
- children: "Save heading"
30478
- })
30479
- ]
30480
- }),
30481
- /* @__PURE__ */ jsx("p", {
30482
- className: "text-sm text-muted-foreground",
30483
- children: "These are shared details. Changes apply everywhere they are used."
30484
- }),
30485
- /* @__PURE__ */ jsx("button", {
30486
- type: "button",
30487
- className: primaryButtonClass,
30488
- onClick: () => onShared(section),
30489
- children: "Edit shared details"
30490
- })
30491
- ]
30492
- });
30493
- }
30494
- if (module.kind === "business-address" || module.kind === "navigation" || module.kind === "legal-navigation") return /* @__PURE__ */ jsxs("form", {
29652
+ return /* @__PURE__ */ jsx(LiveModuleEditor, {
29653
+ ...props,
29654
+ module: props.module
29655
+ }, props.module.id);
29656
+ }
29657
+ const moduleNotes = {
29658
+ "business-address": "This section uses the business address in General settings.",
29659
+ navigation: "Links are managed in Navigation.",
29660
+ "legal-navigation": "Links are managed in Navigation.",
29661
+ "supporting-text": "Only shown in the footer.",
29662
+ legal: "Only shown in the footer."
29663
+ };
29664
+ /**
29665
+ * A section's own words save as they're typed, like the rest of the footer:
29666
+ * a pause or leaving a field saves, under one text key per field so a run of
29667
+ * typing joins one Undo step. A change that doesn't validate shows why and
29668
+ * isn't sent; a failed save keeps what was typed.
29669
+ */
29670
+ function LiveModuleEditor({ module, composition, onChange, onShared, headingAsIcon, hasLogo, manageSettingsHref, widgets }) {
29671
+ const live = useFooterSectionTextPart(module);
29672
+ const form = useForm({ values: live.value });
29673
+ const backend = {
29674
+ ...useMemo(() => createRHFBackend(form), [form]),
29675
+ setValue: (path, value) => {
29676
+ const field = path.split(".")[0];
29677
+ if (field === "heading" || field === "content") live.change(field, value);
29678
+ }
29679
+ };
29680
+ const parsed = parseFooterCompositionV1({
29681
+ ...composition,
29682
+ sections: composition.sections.map((section) => section.id === module.id ? {
29683
+ ...section,
29684
+ ...live.value
29685
+ } : section)
29686
+ });
29687
+ const error = parsed.ok ? null : parsed.error.message;
29688
+ const shared = module.kind === "contact" || module.kind === "opening-hours" || module.kind === "social-links" ? module.kind : null;
29689
+ const note = moduleNotes[module.kind];
29690
+ return /* @__PURE__ */ jsxs("div", {
30495
29691
  className: "space-y-4",
30496
- onSubmit: form.handleSubmit(saveSection),
30497
29692
  children: [
30498
29693
  /* @__PURE__ */ jsx("h2", {
30499
29694
  className: "font-semibold",
30500
29695
  children: footerModuleLabel(module)
30501
29696
  }),
30502
- /* @__PURE__ */ jsx(FormRenderer, {
30503
- dateContext: civilPickerDisplay.dateContext,
30504
- fields: moduleFieldCatalog,
30505
- backend
29697
+ module.kind === "brand" ? /* @__PURE__ */ jsx(FooterBrandChoiceControl, {
29698
+ composition,
29699
+ hasLogo,
29700
+ manageSettingsHref,
29701
+ onChange: (next) => void onChange(next)
29702
+ }) : null,
29703
+ /* @__PURE__ */ jsx("div", {
29704
+ onBlur: live.flush,
29705
+ children: /* @__PURE__ */ jsx(FormRenderer, {
29706
+ dateContext: civilPickerDisplay.dateContext,
29707
+ fields: fieldsForModule(module, headingAsIcon),
29708
+ backend,
29709
+ widgetOverrides: widgets
29710
+ })
30506
29711
  }),
30507
- /* @__PURE__ */ jsx("p", {
29712
+ error ? /* @__PURE__ */ jsx("p", {
29713
+ role: "alert",
29714
+ className: "text-sm text-destructive",
29715
+ children: error
29716
+ }) : null,
29717
+ /* @__PURE__ */ jsx(FooterLiveSaveFailure, { live }),
29718
+ note ? /* @__PURE__ */ jsx("p", {
30508
29719
  className: "text-sm text-muted-foreground",
30509
- children: module.kind === "business-address" ? "This section uses the business address in General settings." : "Links are managed in Navigation."
30510
- }),
30511
- /* @__PURE__ */ jsx("button", {
30512
- type: "submit",
30513
- className: primaryButtonClass,
30514
- children: "Save heading"
30515
- })
30516
- ]
30517
- });
30518
- return /* @__PURE__ */ jsxs("form", {
30519
- className: "space-y-4",
30520
- onSubmit: form.handleSubmit(saveSection),
30521
- children: [
30522
- /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("h2", {
30523
- className: "font-semibold",
30524
- children: footerModuleLabel(module)
30525
- }), /* @__PURE__ */ jsx("p", {
30526
- className: "text-xs text-muted-foreground",
30527
- children: "Footer-local content"
30528
- })] }),
30529
- /* @__PURE__ */ jsx(FormRenderer, {
30530
- dateContext: civilPickerDisplay.dateContext,
30531
- fields: fieldsForModule(module),
30532
- backend
30533
- }),
30534
- /* @__PURE__ */ jsx("button", {
30535
- type: "submit",
29720
+ children: note
29721
+ }) : null,
29722
+ shared ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("p", {
29723
+ className: "text-sm text-muted-foreground",
29724
+ children: "These are shared details. Changes apply everywhere they're used."
29725
+ }), /* @__PURE__ */ jsx("button", {
29726
+ type: "button",
30536
29727
  className: primaryButtonClass,
30537
- children: "Save section"
30538
- })
29728
+ onClick: () => onShared(shared),
29729
+ children: "Edit shared details"
29730
+ })] }) : null
30539
29731
  ]
30540
29732
  });
30541
29733
  }
@@ -30807,7 +29999,7 @@ function SocialLinksEditor({ profile, onChange }) {
30807
29999
  children: "Social links"
30808
30000
  }), /* @__PURE__ */ jsx("p", {
30809
30001
  className: "text-xs text-muted-foreground",
30810
- children: "Ordered public links. Changes apply everywhere they are used."
30002
+ children: "Ordered public links. Changes apply everywhere they're used."
30811
30003
  })] }),
30812
30004
  links.map((link, index) => /* @__PURE__ */ jsxs("div", {
30813
30005
  className: "space-y-2 rounded-lg border p-3",
@@ -33374,27 +32566,30 @@ function footerComposerNavigationProps(view, requestId) {
33374
32566
  }
33375
32567
  //#endregion
33376
32568
  //#region ../preview-next/src/client/preview/PreviewFooterEditorPanel.tsx
33377
- function PreviewFooterEditorPanel({ sdkConfig, apiClient, siteId, dashboardBaseUrl, theme, view, requestId, canEdit, onSaved }) {
33378
- const navigationLayoutControl = useSiteChromeCustomizeOptional()?.footerNavigationControl;
32569
+ function PreviewFooterEditorPanel({ sdkConfig, apiClient, siteId, dashboardBaseUrl, theme, view, requestId, canEdit }) {
32570
+ const liveRuntime = useLiveFooterRuntime();
33379
32571
  const dashboardSiteUrl = `${dashboardBaseUrl?.replace(/\/$/u, "") ?? ""}/dashboard/sites/${siteId}`;
33380
- return /* @__PURE__ */ jsx(FooterComposerPanel, {
33381
- apiClient,
32572
+ return /* @__PURE__ */ jsx(PreviewFormProvider, {
33382
32573
  siteId,
33383
- customFooterMode: resolveSdkFooterMode(sdkConfig),
33384
- manageLinksHref: `${dashboardSiteUrl}/navigation`,
33385
- manageSettingsHref: `${dashboardSiteUrl}/settings`,
33386
- ...footerComposerLayoutProps(theme),
33387
- navigationLayoutControl,
33388
- loadingFallback: /* @__PURE__ */ jsx(ContentSpinner, { className: "py-8" }),
33389
- ...footerComposerNavigationProps(view, requestId),
33390
- variant: "sidebar",
33391
- canEdit,
33392
- onSaved
32574
+ theme,
32575
+ previewClient: apiClient,
32576
+ children: /* @__PURE__ */ jsx(FooterComposerPanel, {
32577
+ apiClient,
32578
+ siteId,
32579
+ customFooterMode: resolveSdkFooterMode(sdkConfig),
32580
+ manageLinksHref: `${dashboardSiteUrl}/navigation`,
32581
+ manageSettingsHref: `${dashboardSiteUrl}/settings`,
32582
+ layoutSelection: footerLayoutSelection(theme),
32583
+ widgets: previewWidgetOverrides,
32584
+ liveRuntime: liveRuntime ?? void 0,
32585
+ appearanceControls: /* @__PURE__ */ jsx(SiteChromeSurfaceControls, { surface: "footer" }),
32586
+ loadingFallback: /* @__PURE__ */ jsx(ContentSpinner, { className: "py-8" }),
32587
+ ...footerComposerNavigationProps(view, requestId),
32588
+ variant: "sidebar",
32589
+ canEdit
32590
+ })
33393
32591
  });
33394
32592
  }
33395
- function footerComposerLayoutProps(theme) {
33396
- return { arrangement: resolveFooterLayoutHints(theme).layoutVariant };
33397
- }
33398
32593
  //#endregion
33399
32594
  //#region ../preview-next/src/client/preview/PreviewEditorGuidanceCard.tsx
33400
32595
  function PreviewEditorGuidanceCard({ guidance, completeSetupDisabled, onCompleteSetup }) {
@@ -34383,22 +33578,23 @@ const typographyFontCategories = [
34383
33578
  }
34384
33579
  ];
34385
33580
  /**
34386
- * Display and handwriting faces are drawn for a few large words. Set as
34387
- * paragraphs and navigation they're hard to read, so the body slot doesn't
34388
- * offer them. A site's own uploaded fonts stay on offer, because someone chose
34389
- * those on purpose, and so do fonts Google hasn't given a category.
33581
+ * Body text is paragraphs, menus and buttons, so the body slot offers only
33582
+ * Google families built for reading (`isBodyFontFamily`, the same rule the
33583
+ * server applies). A site's own uploaded fonts stay on offer, because someone
33584
+ * chose those on purpose. Headings offer everything.
34390
33585
  */
34391
- const headingOnlyCategories = /* @__PURE__ */ new Set(["display", "handwriting"]);
33586
+ const headingOnlyCategories = /* @__PURE__ */ new Set([
33587
+ "display",
33588
+ "handwriting",
33589
+ "monospace"
33590
+ ]);
34392
33591
  /** The category filters a slot shows: the body slot leaves out the ones it doesn't offer. */
34393
33592
  function typographyFontCategoriesForSlot(slot) {
34394
33593
  return slot === "body" ? typographyFontCategories.filter((option) => !headingOnlyCategories.has(option.value)) : typographyFontCategories;
34395
33594
  }
34396
- function fontOptionSuitsSlot(option, slot) {
34397
- return slot === "heading" || option.source === "site" || option.category === null || !headingOnlyCategories.has(option.category);
34398
- }
34399
33595
  /** The Google families a slot can offer, before any search or category. */
34400
33596
  function googleFontsForSlot(googleFonts, slot) {
34401
- return googleFonts.filter((font) => !/^material (?:icons|symbols)(?:\s|$)/iu.test(font.family.trim())).filter((font) => fontOptionSuitsSlot(googleFontOption(font), slot));
33597
+ return googleFonts.filter((font) => !/^material (?:icons|symbols)(?:\s|$)/iu.test(font.family.trim())).filter((font) => slot === "heading" || isBodyFontFamily(font.family));
34402
33598
  }
34403
33599
  /** The name a category goes by, on its filter and beside a font in the list. */
34404
33600
  function typographyFontCategoryLabel(category) {
@@ -34515,29 +33711,6 @@ function familyKey(family) {
34515
33711
  return family.trim().toLocaleLowerCase();
34516
33712
  }
34517
33713
  //#endregion
34518
- //#region ../preview-next/src/client/fonts/siteFontPreview.tsx
34519
- /** Load complete faces for the staged theme, separately from picker subsets. */
34520
- function TypographyThemeFontStyles({ theme, siteFonts }) {
34521
- const siteFontStorageUrl = useSiteFontStorageUrl();
34522
- return /* @__PURE__ */ jsx(ThemeFontLoaderFromTheme, {
34523
- theme,
34524
- customFonts: [...siteFonts],
34525
- storageBaseUrl: siteFontStorageUrl ? getSiteFontsStorageUrl(siteFontStorageUrl) : void 0
34526
- });
34527
- }
34528
- function buildSiteFontFaceCss(siteFonts, siteFontStorageUrl) {
34529
- if (!siteFontStorageUrl || siteFonts.length === 0) return "";
34530
- return generateFontFaceCss([...siteFonts], getSiteFontsStorageUrl(siteFontStorageUrl));
34531
- }
34532
- function SiteFontFaceStyles({ siteFonts }) {
34533
- const siteFontStorageUrl = useSiteFontStorageUrl();
34534
- const css = useMemo(() => buildSiteFontFaceCss(siteFonts, siteFontStorageUrl), [siteFontStorageUrl, siteFonts]);
34535
- return css ? /* @__PURE__ */ jsx("style", {
34536
- "data-typography-site-fonts": true,
34537
- children: css
34538
- }) : null;
34539
- }
34540
- //#endregion
34541
33714
  //#region ../preview-next/src/client/fonts/TypographyEditor.tsx
34542
33715
  const typographyOverviewSurface = { kind: "overview" };
34543
33716
  function useTypographyFontCatalog(apiClient, siteId, enabled) {
@@ -34551,6 +33724,7 @@ function useTypographyFontCatalog(apiClient, siteId, enabled) {
34551
33724
  });
34552
33725
  const googleRequestRef = useRef(null);
34553
33726
  const siteRequestRef = useRef(null);
33727
+ const rememberSiteFonts = useRememberSiteFonts();
34554
33728
  useEffect(() => {
34555
33729
  if (!enabled) return;
34556
33730
  if (googleRequestRef.current?.apiClient === apiClient) return;
@@ -34618,10 +33792,12 @@ function useTypographyFontCatalog(apiClient, siteId, enabled) {
34618
33792
  siteId: requestedSiteId,
34619
33793
  status: "loaded"
34620
33794
  };
33795
+ const fonts = Array.isArray(value?.fonts) ? value.fonts : [];
34621
33796
  setSite({
34622
33797
  kind: "loaded",
34623
- value: Array.isArray(value?.fonts) ? value.fonts : []
33798
+ value: fonts
34624
33799
  });
33800
+ rememberSiteFonts(fonts);
34625
33801
  }
34626
33802
  } catch (error) {
34627
33803
  if (!cancelled) {
@@ -34642,7 +33818,8 @@ function useTypographyFontCatalog(apiClient, siteId, enabled) {
34642
33818
  }, [
34643
33819
  apiClient,
34644
33820
  enabled,
34645
- siteId
33821
+ siteId,
33822
+ rememberSiteFonts
34646
33823
  ]);
34647
33824
  return {
34648
33825
  google,
@@ -35601,17 +34778,13 @@ function StyleConfigurator({ siteId, apiClient, buttonStyleRepairs, onFocusedSur
35601
34778
  const currentTypography = shown.theme.typography;
35602
34779
  const currentHeaderLayout = getHeaderLayout(selection.headerLayoutId);
35603
34780
  const currentHeaderStyle = getHeaderStyle(selection.headerStyleId);
35604
- const currentFooterLook = findFooterLook(selection.footerLookId ?? chromeSelectionModels.footer.renderedLookId);
35605
34781
  const headerSurfaceState = siteChromeCustomize.getSurfaceState("header");
35606
34782
  const styleSelections = siteChromeCustomize.styleSelections;
35607
- const { handlePreviewButtonStyle, handlePreviewHeaderLayout, handlePreviewHeaderStyle, handlePreviewFooterLook, handlePreviewPalette, handleHeadingTypographyChange, handleBodyTypographyChange, handleTypographyScaleChange, handleTokenOverride, handleChooseSiteStyle } = controls;
35608
- if (expandedRow === "typography" && typographySurface.kind !== "overview") return /* @__PURE__ */ jsxs("div", {
34783
+ const { handlePreviewButtonStyle, handlePreviewHeaderLayout, handlePreviewHeaderStyle, handlePreviewPalette, handleHeadingTypographyChange, handleBodyTypographyChange, handleTypographyScaleChange, handleTokenOverride, handleChooseSiteStyle } = controls;
34784
+ if (expandedRow === "typography" && typographySurface.kind !== "overview") return /* @__PURE__ */ jsx("div", {
35609
34785
  className: "flex h-full min-h-0 flex-col",
35610
34786
  "data-style-configurator-focused-surface": true,
35611
- children: [/* @__PURE__ */ jsx(TypographyThemeFontStyles, {
35612
- theme: shown.theme,
35613
- siteFonts: fontCatalog.site.value
35614
- }), typographySurface.kind === "font-picker" ? /* @__PURE__ */ jsx(TypographyFontPickerTakeover, {
34787
+ children: typographySurface.kind === "font-picker" ? /* @__PURE__ */ jsx(TypographyFontPickerTakeover, {
35615
34788
  slot: typographySurface.slot,
35616
34789
  value: typographySurface.slot === "heading" ? currentTypography.headings.default.family : currentTypography.body.family,
35617
34790
  catalog: fontCatalog,
@@ -35626,15 +34799,11 @@ function StyleConfigurator({ siteId, apiClient, buttonStyleRepairs, onFocusedSur
35626
34799
  onBodyChange: handleBodyTypographyChange,
35627
34800
  onScaleChange: handleTypographyScaleChange,
35628
34801
  disabled
35629
- })]
34802
+ })
35630
34803
  });
35631
34804
  return /* @__PURE__ */ jsxs("div", {
35632
34805
  className: "space-y-3",
35633
34806
  children: [
35634
- /* @__PURE__ */ jsx(TypographyThemeFontStyles, {
35635
- theme: shown.theme,
35636
- siteFonts: fontCatalog.site.value
35637
- }),
35638
34807
  /* @__PURE__ */ jsx(SiteStyleRow, {
35639
34808
  expanded: expandedRow === "style",
35640
34809
  onToggle: () => handleToggleRow("style"),
@@ -35685,24 +34854,6 @@ function StyleConfigurator({ siteId, apiClient, buttonStyleRepairs, onFocusedSur
35685
34854
  onMenuFontSizeChange: siteChromeCustomize.setHeaderMenuFontSize
35686
34855
  }) : null
35687
34856
  }),
35688
- /* @__PURE__ */ jsx(SiteChromeSelectionRow, {
35689
- label: "Footer",
35690
- ariaLabel: "Footer layout",
35691
- defaultDescription: "Use the footer layout chosen for this site style.",
35692
- expanded: expandedRow === "footer",
35693
- onToggle: () => handleToggleRow("footer"),
35694
- currentId: chromeSelectionModels.footer.renderedLookId,
35695
- currentLabel: currentFooterLook?.label ?? "Unknown footer layout",
35696
- scopeDescription: "Changes the footer layout on every page.",
35697
- options: chromeSelectionModels.footer.options,
35698
- diagnostics: chromeSelectionModels.footer.diagnostics,
35699
- onCycle: (direction) => {
35700
- const next = cycleSiteChromeSelectionId(chromeSelectionModels.footer.options, chromeSelectionModels.footer.renderedLookId, direction);
35701
- if (next !== void 0) handlePreviewFooterLook(next);
35702
- },
35703
- onPreview: handlePreviewFooterLook,
35704
- disabled
35705
- }),
35706
34857
  /* @__PURE__ */ jsx(ButtonStyleRow, {
35707
34858
  expanded: expandedRow === "buttons",
35708
34859
  onToggle: () => handleToggleRow("buttons"),
@@ -35762,10 +34913,6 @@ function useConfiguratorControls(owner) {
35762
34913
  styleId
35763
34914
  }, "immediate");
35764
34915
  },
35765
- handlePreviewFooterLook: (lookId) => choose?.({
35766
- kind: "set-footer-look",
35767
- lookId
35768
- }, "immediate"),
35769
34916
  handlePreviewPalette: (key) => {
35770
34917
  const palette = findCuratedPalette(key);
35771
34918
  if (palette) choose?.({
@@ -37486,8 +36633,7 @@ function SidebarTaskView({ props, view, requestId, uiStoreForBlockEditor, linked
37486
36633
  theme: props.theme ?? null,
37487
36634
  view,
37488
36635
  requestId,
37489
- canEdit,
37490
- onSaved: requestServerRefresh
36636
+ canEdit
37491
36637
  });
37492
36638
  case "assistant": return null;
37493
36639
  case "linkedEntry": return linkedEntry ? /* @__PURE__ */ jsx(LinkedEntryEditorPanel, {