@riverbankcms/sdk 0.182.0 → 0.184.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 (231) hide show
  1. package/CHANGELOG.md +79 -0
  2. package/README.md +83 -4
  3. package/dist/_dts/{BlocksIslandsHydrator-Bvw2bUif.d.ts → BlocksIslandsHydrator-DjBTJYiF.d.ts} +1 -1
  4. package/dist/_dts/{Page-B2EAT-bE.d.ts → Page-BpXEM2ET.d.ts} +7 -7
  5. package/dist/_dts/{SdkPreviewMode-D0vww6rh.d.ts → SdkPreviewMode-Bb3h7KRE.d.ts} +2 -2
  6. package/dist/_dts/{client-D6T430bk.d.ts → client-DgTRRtl_.d.ts} +14 -1
  7. package/dist/_dts/{content-types-wZVWccC6.d.ts → content-types-DZQJp_ak.d.ts} +9 -16
  8. package/dist/_dts/{contracts-B-vtOcr8.d.ts → contracts-Ww1fmd-c.d.ts} +3 -3
  9. package/dist/_dts/{generatePageMetadata-CxfwHE6z.d.ts → generatePageMetadata-BGc7dju6.d.ts} +2 -2
  10. package/dist/_dts/{index-CciRW_w1.d.ts → index-BECaUNYs.d.ts} +2 -2
  11. package/dist/_dts/{index-CEyYMhLJ.d.ts → index-Cc85KVLW.d.ts} +3 -3
  12. package/dist/_dts/{index-CQrb3Ccc.d.ts → index-Cni4jykw.d.ts} +4 -4
  13. package/dist/_dts/{index-DIU-wL1M.d.ts → index-DxxTQ_0V.d.ts} +2 -2
  14. package/dist/_dts/{index-Cqxis-nv.d.ts → index-W9-7djG3.d.ts} +1 -1
  15. package/dist/_dts/{index-DqPKdeTk.d.ts → index-ukS-Ffem.d.ts} +1 -1
  16. package/dist/_dts/{loadContent-D0wrxiSp.d.ts → loadContent-BlSWTlbD.d.ts} +7 -7
  17. package/dist/_dts/{request-DEwxUSw8.d.ts → request-CZz2BoXJ.d.ts} +89478 -88093
  18. package/dist/_dts/{resolveBlockData-VaG_MYbN.d.ts → resolveBlockData-D12HXnS3.d.ts} +5 -5
  19. package/dist/_dts/{resolvePageContent-DTwklC_v.d.ts → resolvePageContent-BteMsSGP.d.ts} +1 -1
  20. package/dist/_dts/sdk/src/bookings/index.d.ts +2 -2
  21. package/dist/_dts/sdk/src/client/types.d.ts +2 -2
  22. package/dist/_dts/sdk/src/client.d.ts +7 -7
  23. package/dist/_dts/sdk/src/config/index.d.ts +7 -7
  24. package/dist/_dts/sdk/src/config/template-validation.d.ts +1 -1
  25. package/dist/_dts/sdk/src/config/validation.d.ts +1 -1
  26. package/dist/_dts/sdk/src/data/dataLoaderContext.d.ts +2 -2
  27. package/dist/_dts/sdk/src/data/resolveBlockData.d.ts +1 -1
  28. package/dist/_dts/sdk/src/data/types.d.ts +2 -2
  29. package/dist/_dts/sdk/src/gifting/client.d.ts +1 -1
  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 +3 -3
  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 +1 -1
  38. package/dist/_dts/sdk/src/portal/index.d.ts +10 -2
  39. package/dist/_dts/sdk/src/prebuild/index.d.ts +1 -1
  40. package/dist/_dts/sdk/src/preview-next/before-render.d.ts +2 -2
  41. package/dist/_dts/sdk/src/preview-next/client/index.d.ts +2 -2
  42. package/dist/_dts/sdk/src/preview-next/client/runtime.d.ts +1 -1
  43. package/dist/_dts/sdk/src/rendering/client.d.ts +2 -2
  44. package/dist/_dts/sdk/src/rendering/components/pageShared.d.ts +1 -1
  45. package/dist/_dts/sdk/src/rendering/helpers/loadPage.d.ts +1 -1
  46. package/dist/_dts/sdk/src/rendering/helpers/pageRuntimeSupport.d.ts +4 -4
  47. package/dist/_dts/sdk/src/rendering/index.d.ts +6 -6
  48. package/dist/_dts/sdk/src/rendering/islands/client.d.ts +1 -1
  49. package/dist/_dts/sdk/src/rendering/server.d.ts +2 -2
  50. package/dist/_dts/sdk/src/rendering/themeAdmission.d.ts +1 -1
  51. package/dist/_dts/sdk/src/routing/index.d.ts +6 -6
  52. package/dist/_dts/sdk/src/server.d.ts +5 -5
  53. package/dist/_dts/sdk/src/spam-protection/index.d.ts +2 -2
  54. package/dist/_dts/sdk/src/theme/index.d.ts +126 -2
  55. package/dist/_dts/{serviceBookingOutline-DtQuFlID.d.ts → serviceBookingOutline-aTlOvO3U.d.ts} +16 -8
  56. package/dist/_dts/{types-B3RjeBLV.d.ts → types-Bi7R07RX.d.ts} +45 -4
  57. package/dist/_dts/{types-BvUSGQrw.d.ts → types-CCcQlRBi.d.ts} +22 -12
  58. package/dist/_dts/{types-CkRFtBqd.d.ts → types-Du4aMnWC.d.ts} +13 -15
  59. package/dist/_dts/{validation-BZA3DhcV.d.ts → validation-CjCWVmwe.d.ts} +4 -4
  60. package/dist/client/{BlocksIslandsHydrator-CQMf0HdN.mjs → BlocksIslandsHydrator-CFLWxjxR.mjs} +22 -18
  61. package/dist/client/{BookingMailingListNote-7kdvuPow.mjs → BookingMailingListNote-C4LcfwyA.mjs} +8 -8
  62. package/dist/client/{BookingQuestionFields-BJI7mZuV.mjs → BookingQuestionFields-DdcmoHqQ.mjs} +2 -2
  63. package/dist/client/{CalendarAction-D_Glwvz2.mjs → CalendarAction-DYGewmvh.mjs} +1 -1
  64. package/dist/client/{CalendarNavigationChevron-DPUD6wjy.mjs → CalendarNavigationChevron-ZfrUiiiI.mjs} +25 -8
  65. package/dist/client/{CheckboxChoice-C8i4NraK.mjs → CheckboxChoice-CTMIII37.mjs} +1 -1
  66. package/dist/client/{DemoBookingPortalAccess-8kwNF9HN.mjs → DemoBookingPortalAccess-pzkGVkgG.mjs} +7 -5
  67. package/dist/client/{EventCalendar.client-Dhb14bcC.mjs → EventCalendar.client-Ct1B3xI4.mjs} +10 -10
  68. package/dist/client/{EventCombined.client-C1jEZBN9.mjs → EventCombined.client-DgfNtcgW.mjs} +9 -9
  69. package/dist/client/{EventEmbeddedCheckoutStep-BGkbUhuw.mjs → EventEmbeddedCheckoutStep-CjoaG1zy.mjs} +1 -1
  70. package/dist/client/{EventItem-Bb0ppG2N.mjs → EventItem-KGKkK19N.mjs} +29 -14
  71. package/dist/client/{EventListWeekNavigation-DMryCaNV.mjs → EventListWeekNavigation-Ba9ezxuC.mjs} +1 -1
  72. package/dist/client/{EventListing.client-BuH5kKA3.mjs → EventListing.client-xFKRDLwC.mjs} +3 -3
  73. package/dist/client/{EventListing.view-DsqvuulZ.mjs → EventListing.view-Dy36vWHi.mjs} +84 -7
  74. package/dist/client/{EventRegistrationPayment-D4FvQSFF.mjs → EventRegistrationPayment-Dth9L00x.mjs} +118 -76
  75. package/dist/client/{Page-sV6BJkXX.mjs → Page-DB5KODiu.mjs} +4491 -1398
  76. package/dist/client/{ProtectedSubmitButton-BNnKuir8.mjs → ProtectedSubmitButton-CY6u5sQa.mjs} +1 -1
  77. package/dist/client/{SiteTermsAgreementField-VfSd6JU-.mjs → SiteTermsAgreementField-BDVP_HeK.mjs} +3 -3
  78. package/dist/client/{StepIndicator-B6o5B7g3.mjs → StepIndicator-CLgDVzCs.mjs} +1 -1
  79. package/dist/client/{StepIndicator-BTqO7cJl.mjs → StepIndicator-DRyZ8igu.mjs} +7 -7
  80. package/dist/client/{ThemedButton-PFOhXktM.mjs → ThemedButton-C4rCsPCt.mjs} +52 -10
  81. package/dist/client/{accessibleSurfaces-BogaGutk.mjs → accessibleSurfaces-CqroimVQ.mjs} +1024 -619
  82. package/dist/client/{accordion-6cuswD_s.mjs → accordion-BQYRP5xV.mjs} +1 -1
  83. package/dist/client/{booking-form.client-BOMe_SKi.mjs → booking-form.client-B7ckDuOC.mjs} +191 -71
  84. package/dist/client/{bookingForm-DSCH-VHo.mjs → bookingForm-BeD4650p.mjs} +7 -6
  85. package/dist/client/bookings.mjs +5 -5
  86. package/dist/client/{boxStyleClassNames-BFuqZCfz.mjs → boxStyleClassNames-CA7FirMH.mjs} +2 -2
  87. package/dist/client/buttonParts-C39GC0kz.mjs +1518 -0
  88. package/dist/client/{carousel-CGyQVV1M.mjs → carousel-DJ9Aa1m3.mjs} +2 -2
  89. package/dist/client/{carousel.client-BtLwHefX.mjs → carousel.client-DKWqVHHh.mjs} +1 -1
  90. package/dist/client/{cart-BYOe7MCh.mjs → cart-DdCenbTy.mjs} +3 -3
  91. package/dist/client/{cart.client-BKFkaXdV.mjs → cart.client-BQm06qNw.mjs} +1 -1
  92. package/dist/client/{checkout-Dwd7Di77.mjs → checkout-45wPQULN.mjs} +3 -3
  93. package/dist/client/{checkout.client-C25hpi-z.mjs → checkout.client-bSv4cc5z.mjs} +1 -1
  94. package/dist/client/{checkoutUrls-tG788sw0.mjs → checkoutUrls-CwlaMl3W.mjs} +1 -1
  95. package/dist/client/client.mjs +460 -119
  96. package/dist/client/{constants-DdxFG3Ic.mjs → constants-DXV4KR7l.mjs} +1 -1
  97. package/dist/client/{context-Hi1RuYEM.mjs → context-lCPfX-xe.mjs} +15 -5
  98. package/dist/client/{dateFormatting-C8vBCHuo.mjs → dateFormatting-HvfmS_cH.mjs} +1 -1
  99. package/dist/client/{demoPortalMagicLink-BAL5UIDG.mjs → demoPortalMagicLink-Ce3Gyin_.mjs} +1 -1
  100. package/dist/client/{enhanceHeaderSection-Dv1Lr9kJ.mjs → enhanceHeaderSection-CGcDE9aE.mjs} +4 -4
  101. package/dist/client/{event-registration.client-dB_Z7bb-.mjs → event-registration.client-DlPfn4YG.mjs} +52 -29
  102. package/dist/client/{eventCalendar-CQnRA4Ww.mjs → eventCalendar-CioAdryV.mjs} +4 -4
  103. package/dist/client/{eventCombined-BDOG1hVp.mjs → eventCombined-Dwt0G6ez.mjs} +4 -4
  104. package/dist/client/{eventListing-DSVmhy9n.mjs → eventListing-B3H9ifOC.mjs} +4 -4
  105. package/dist/client/{eventRegistration-CD5mRtEH.mjs → eventRegistration-Do7cAhXb.mjs} +7 -6
  106. package/dist/client/{form-DWnlEVSK.mjs → form-CsqzgC6v.mjs} +3 -3
  107. package/dist/client/{form.client-D7zmeqNI.mjs → form.client-DVDB7hY6.mjs} +5 -5
  108. package/dist/client/{form.parts-C-G6N_MK.mjs → form.parts-1q2rzSYt.mjs} +3 -3
  109. package/dist/client/gifting/client.mjs +16 -9
  110. package/dist/client/{gifting-Cn0jidP5.mjs → gifting-BrXQGX-k.mjs} +4 -4
  111. package/dist/client/{gifting.client-DVo1YFLs.mjs → gifting.client--zAjnY5N.mjs} +155 -85
  112. package/dist/client/gifting.interactive-CrwHpUJG.mjs +207 -0
  113. package/dist/client/gifting.parts-CcKdDaQq.mjs +124 -0
  114. package/dist/client/{headerSection-DjQuj_6v.mjs → headerSection-DlcDH4bi.mjs} +2 -2
  115. package/dist/client/{noop-jesvJXEE.mjs → islands-dMh0Oxli.mjs} +16103 -7965
  116. package/dist/client/{newsletter-form.client-rIYPziZC.mjs → newsletter-form.client-BxA1PsdS.mjs} +6 -6
  117. package/dist/client/{newsletter-form.interactive-DVt3enLr.mjs → newsletter-form.interactive-D0iRg7p2.mjs} +229 -197
  118. package/dist/client/{newsletter-form.parts-CH6dGfdn.mjs → newsletter-form.parts-Dmuklz0r.mjs} +2 -2
  119. package/dist/client/{newsletterForm-Cg8cBDHd.mjs → newsletterForm-CBzvgIfg.mjs} +3 -3
  120. package/dist/client/portal/client.mjs +51 -35
  121. package/dist/client/{portalOrders-oEoTvzkW.mjs → portalOrders-tCxS04g0.mjs} +3 -2
  122. package/dist/client/{portalRoutes-ByyVZfVq.mjs → portalRoutes-DiGibcZI.mjs} +31 -9
  123. package/dist/client/portalSession-0XhXyTxT.mjs +41 -0
  124. package/dist/client/{product-detail.client-5aHq-vuu.mjs → product-detail.client-D9MP8hvH.mjs} +1 -1
  125. package/dist/client/{product-list.client-CyAk5rnC.mjs → product-list.client-wCz1qcUY.mjs} +1 -1
  126. package/dist/client/{productDetail-B8aZ2mqY.mjs → productDetail-D9-fCY6c.mjs} +3 -3
  127. package/dist/client/{productList-BuLemmod.mjs → productList-PJyxXSac.mjs} +3 -3
  128. package/dist/client/{propsDecoder-0Unsqn3R.mjs → propsDecoder-B8lrKGPw.mjs} +4 -2
  129. package/dist/client/{registry.server-DzvtVVD0.mjs → registry.server-CI63JVHW.mjs} +2444 -1078
  130. package/dist/client/rendering/client.mjs +32 -28
  131. package/dist/client/rendering/islands.mjs +1 -1
  132. package/dist/client/rendering.mjs +5 -5
  133. package/dist/client/{richText-coerce-Bnng7JFA.mjs → richText-coerce-Jt9hDHdh.mjs} +2 -2
  134. package/dist/client/{routeIslandApiConfig-BGfcc9sk.mjs → routeIslandApiConfig-ZSPcJWx1.mjs} +1 -1
  135. package/dist/client/runtimeResponse-DlPBWBd9.mjs +3 -0
  136. package/dist/client/{runtimeResponse-DAPVRToN.mjs → runtimeResponse-_iW9oEYc.mjs} +1 -1
  137. package/dist/client/{shop-GuMqnDL-.mjs → shop-CbdJlWOw.mjs} +3 -3
  138. package/dist/client/{shop-commerce-D5bDY1o1.mjs → shop-commerce-BqLbzUUn.mjs} +47 -28
  139. package/dist/client/{shop-commerce-store-B7sHnLwI.mjs → shop-commerce-store-BT0-zRqN.mjs} +1 -1
  140. package/dist/client/{shop-discount-apply.state-Dos2zdC2.mjs → shop-discount-apply.state-Cws0lnSb.mjs} +2 -2
  141. package/dist/client/{shop.client-uvj5GDZb.mjs → shop.client-0cNErhJT.mjs} +54 -24
  142. package/dist/client/{shopShared-3giNWE3H.mjs → shopShared-COuQ2MhQ.mjs} +2 -2
  143. package/dist/client/spam-protection.mjs +1 -1
  144. package/dist/client/{src-CmXh3JWs.mjs → src-Do_s2lqH.mjs} +11 -18
  145. package/dist/client/{timetableModel-GA-hn1qM.mjs → timetableModel-DqI6U1BS.mjs} +11 -8
  146. package/dist/client/{urlParams-C2QHo1Pa.mjs → useAutomaticDiscountPreview-CeVUVzGf.mjs} +44 -1
  147. package/dist/client/{useAvailableSlots-CBneCxbG.mjs → useAvailableSlots-B0mjVhZr.mjs} +2 -2
  148. package/dist/client/{useDiscountCodeUi-D0kGF0C7.mjs → useDiscountCodeUi-B_hfgdAP.mjs} +6 -2
  149. package/dist/client/{useEventPagination-xX8n_Tuu.mjs → useEventPagination-Ct4A6iR1.mjs} +14 -16
  150. package/dist/client/{view-DOyZc-DF.mjs → view-Cj151w4m.mjs} +24 -9
  151. package/dist/client/{wizardSteps-B952ify5.mjs → wizardSteps-B3gsXNnb.mjs} +283 -222
  152. package/dist/preview-next/client/{EventEmbeddedCheckoutStep-aRJjq4x8.mjs → EventEmbeddedCheckoutStep-CVy9oapv.mjs} +1 -1
  153. package/dist/preview-next/client/{LocationPickerEnvironment-BW3dRFIv.mjs → LocationPickerEnvironment-DuRUwUrK.mjs} +1 -1
  154. package/dist/preview-next/client/{MapLibreEditMap-Db9BHyXh.mjs → MapLibreEditMap-CdSDYBq9.mjs} +2 -2
  155. package/dist/preview-next/client/{PageSectionToolbar-BI3UCdpu.mjs → PageSectionToolbar-Dv4CW0AQ.mjs} +952 -138
  156. package/dist/preview-next/client/{PreviewEditorSidebar-jkfLVOgY.mjs → PreviewEditorSidebar-B7WW58uE.mjs} +4774 -2040
  157. package/dist/preview-next/client/{PreviewEditorUI-DwJQs4hM.mjs → PreviewEditorUI-BnJ1ughv.mjs} +71 -47
  158. package/dist/preview-next/client/{PreviewShell-BAxAkuz8.mjs → PreviewShell-C7qWzAe4.mjs} +72 -40
  159. package/dist/preview-next/client/{SdkPreviewModeRuntime-0UVB-39f.mjs → SdkPreviewModeRuntime-CYi4UHtG.mjs} +135 -30
  160. package/dist/preview-next/client/{ThemedButton-CVYz7h68.mjs → ThemedButton-CRgbU75r.mjs} +799 -17
  161. package/dist/preview-next/client/{lucide-react-00FF_oar.mjs → lucide-react-B4c6U3ZU.mjs} +11 -1
  162. package/dist/preview-next/client/{previewAssistantSlot-BgiYk3PB.mjs → previewAssistantSlot-DrUoRNu9.mjs} +24203 -9291
  163. package/dist/preview-next/client/{previewChromeRoot-tieNdF3E.mjs → previewChromeRoot-CEYp90mM.mjs} +3 -90
  164. package/dist/preview-next/client/runtime.mjs +3 -3
  165. package/dist/preview-next/client/{sdk-runtime-DXb_Evl0.mjs → sdk-runtime-DnO2_c0A.mjs} +2 -2
  166. package/dist/preview-next/client/{siteStyleAccess-BlN0jt2c.mjs → siteStyleAccess-B3PwHw2z.mjs} +46 -11
  167. package/dist/preview-next/client/{useAutosaveStatus-BUEPA4oL.mjs → useAutosaveStatus-DrdQ4ier.mjs} +49 -3
  168. package/dist/preview-next/client/{useOpenBlockForSetup-BVfr5P--.mjs → useOpenBlockForSetup-kuGRKaRL.mjs} +2008 -448
  169. package/dist/preview-next/container-responsive.css +469 -2
  170. package/dist/preview-next/editor-chrome.css +23 -2
  171. package/dist/preview-next/keepAlive.mjs +1 -1
  172. package/dist/preview-next/middleware.mjs +1 -1
  173. package/dist/preview-next/{route-contract-BHTBA48n.mjs → route-contract-CwrXkLT3.mjs} +177 -43
  174. package/dist/server/{Block.shared-hGoyEdjJ.mjs → Block.shared-C5ucphCJ.mjs} +5 -5
  175. package/dist/server/{ThemeScopeCore-BfUCTOwj.mjs → ThemeScopeCore-DvbqYXdK.mjs} +46 -10
  176. package/dist/server/{accessibleSurfaces-Dskni4Xj.mjs → accessibleSurfaces-CAcf1lHT.mjs} +732 -176
  177. package/dist/server/{accordions-By_0Ykks.mjs → accordions-DjcsqjCK.mjs} +1 -1
  178. package/dist/server/{bindings-DMJH4bvo.mjs → bindings-CFw4M-gZ.mjs} +69 -248
  179. package/dist/server/{client-DrwlRNAH.mjs → client-D0XCgITW.mjs} +488 -119
  180. package/dist/server/config-validation.mjs +1 -1
  181. package/dist/server/config.mjs +2 -2
  182. package/dist/server/{constants-CeMywaiD.mjs → constants-BZduY8jG.mjs} +31 -8
  183. package/dist/server/data/resolveBlockData.mjs +1 -1
  184. package/dist/server/index.mjs +4 -4
  185. package/dist/server/{loadContent-D0prFflT.mjs → loadContent-C-qyB8Tq.mjs} +11 -10
  186. package/dist/server/{loadPage-CBLke9pJ.mjs → loadPage-BpKKmi8E.mjs} +3 -3
  187. package/dist/server/lookMediaFrame-EFws7tAj.mjs +31835 -0
  188. package/dist/server/manifest.mjs +2 -2
  189. package/dist/server/{navigation-wrcuWmgp.mjs → navigation-DYkuiNXa.mjs} +1 -1
  190. package/dist/server/navigation.mjs +1 -1
  191. package/dist/server/next.mjs +9 -9
  192. package/dist/server/{overrideResolution-DUgCEH8z.mjs → overrideResolution-DmZn4xUE.mjs} +1 -1
  193. package/dist/server/page-converter.mjs +18 -5
  194. package/dist/server/{pageRenderPlan-BHrmogsW.mjs → pageRenderPlan-DRB7cUZ0.mjs} +674 -298
  195. package/dist/server/{pageRuntimeSupport-D2-YMRei.mjs → pageRuntimeSupport-Uv1xDieJ.mjs} +13 -6
  196. package/dist/server/{pageShared-CG8O31Eo.mjs → pageShared-BdQF875z.mjs} +911 -516
  197. package/dist/server/{parseThemeForPersistence-CrPlbJEN.mjs → parseThemeForPersistence-CwcWZL7u.mjs} +3 -3
  198. package/dist/server/{portal-pG_uhsI2.mjs → portal-BQ8qiQnk.mjs} +22 -2
  199. package/dist/server/portal.mjs +3 -3
  200. package/dist/server/{prebuild-C8Amvzce.mjs → prebuild-B51QZVNe.mjs} +1 -1
  201. package/dist/server/prebuild.mjs +1 -1
  202. package/dist/server/{prefetchBlockData-BxUETRIZ.mjs → prefetchBlockData-CppDAfJW.mjs} +4 -4
  203. package/dist/server/{registry-Cc88-23f.mjs → registry-Bf4W8Qa7.mjs} +7585 -24378
  204. package/dist/server/rendering/components/pageShared.mjs +1 -1
  205. package/dist/server/rendering/helpers/loadPage.mjs +1 -1
  206. package/dist/server/rendering/helpers/pageRuntimeSupport.mjs +1 -1
  207. package/dist/server/rendering/server.mjs +4 -4
  208. package/dist/server/rendering.mjs +10 -10
  209. package/dist/server/{resolveBlockData-OG3KOkig.mjs → resolveBlockData-DMHAZooQ.mjs} +2 -2
  210. package/dist/server/{expandPalette-ehuW8r2g.mjs → resolveButtonColourStates-BMtAAPzp.mjs} +1670 -1346
  211. package/dist/server/{responseMedia-IfH65QAH.mjs → responseMedia-DKYfR518.mjs} +1 -1
  212. package/dist/server/{schema-CwfxQjc4.mjs → schema-DGaihVwp.mjs} +300 -29
  213. package/dist/server/server.mjs +3 -3
  214. package/dist/server/{servicePageContent-BcFuhhD7.mjs → servicePageContent-CRvmreX7.mjs} +40 -16
  215. package/dist/server/theme-bridge.mjs +5 -4
  216. package/dist/server/theme.mjs +2 -2
  217. package/dist/server/{three-pass-converter-DPaUPTfl.mjs → three-pass-converter-mcy2E1Yd.mjs} +2 -2
  218. package/dist/server/{titleSourceSchema-NhK6azFS.mjs → titleSourceSchema-B2qFOUwZ.mjs} +4 -5
  219. package/dist/server/{typeGuards-CTW_9AXq.mjs → typeGuards-DZOaGTEv.mjs} +126 -126
  220. package/dist/server/{types-BKaBZFjD.mjs → types-C_S0pWbR.mjs} +487 -9
  221. package/dist/server/{validation-BovmbS8N.mjs → validation-CUtNT_EZ.mjs} +14 -10
  222. package/dist/server/{version-hws4hgyX.mjs → version-DebJQ4zn.mjs} +1 -1
  223. package/dist/server/{video-Cdr3wh-q.mjs → video-DBaeSawZ.mjs} +1 -1
  224. package/dist/styles/index.css +2987 -168
  225. package/package.json +1 -1
  226. package/dist/client/gifting.parts-Bak93gD2.mjs +0 -86
  227. package/dist/client/runtimeResponse-nXT8VAMl.mjs +0 -3
  228. package/dist/client/types-BEaKfam_.mjs +0 -778
  229. package/dist/server/customCss-C9kgPHvr.mjs +0 -247
  230. package/dist/server/lookMediaFrame-H0fi4bJk.mjs +0 -2701
  231. package/dist/server/media-gvfIw3z8.mjs +0 -216
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import { r as __toESM, t as __commonJSMin } from "./rolldown-runtime-CE6sIgz8.mjs";
3
- import { $l as getDirectImageUrlForMediaAsset, Ac as __awaiter, Ai as resolveMediaStorageUrl, Co as replaceInlineTextRange, Dc as usePortalContainer, Di as computeMediaTransformStyle, E as selectedImageFromRenderableAsset, Ei as getRichTextImageSize, F as lookTilePosition, Fc as __spreadArray, Ic as __spreadArrays, Jc as useSize, Jl as isRotationDimensionSwap, L as nextLookTilePin, Mc as __generator, Nc as __read, P as lookPositionLabel, Pc as __rest, Ql as resolveMediaTransformForAspect, S as pageDesignLookPosition, So as removeInlineTextMarkFromRange, T as selectedImageFromMediaValue, Xl as formatAspectRatioToken, Xs as selectedCanvasBlockId, Yl as normalizeRightAngle, Ys as unwrapResponse, Zl as parseAspectRatioValue, Zo as getCuratedSiteStyle, _c as DialogOverlay, _d as unsafeAsPositiveByteCount, _u as generateUuidV4, ad as unsafeAsEditorBlockId, al as composeEventHandlers, bn as useEditorUiStore, cl as Button, cu as mediaIdentifierSchema, dl as cva, ds as getGradientPreset, ec as Callout, eu as getImageUrl, fc as overlayScrimClass, gc as DialogDescription, gd as unsafeAsMediaAssetId, gl as cn$2, go as inlineTextToPlainText, gu as authoredValuesEqual, hc as DialogContent, hl as useComposedRefs, ho as inlineTextHighlightTones, i as usePreviewSidebarNavigation, ic as Dialog, ii as getBlockDefinition, il as createContextScope, j as usePreviewRenderBackgrounds, jc as __extends, ji as SECTION_BACKGROUND_MIN_SOURCE_WIDTH, kc as __assign, ki as resolveImageUrlWithContext, lc as DialogHeader, ls as gradientToCss, mc as DialogClose, md as assertNever, mo as inlineTextEqual, mu as asLayoutVariantKey, nl as useControllableState, o as usePreviewPageDesignEditorState, oc as DialogContent$1, ol as Primitive, on as getDashboardBaseUrl, ou as resolveManagedMediaReference, po as inlineTextAccentTones, rc as Spinner, ro as richTextVariantCapabilities, rr as defaultBackgroundOverrideForMode, sc as DialogDescription$1, ta as readThemeScopeContext, to as RichTextDocSchema, tr as backgroundColorTokens, uc as DialogTitle$1, ul as useControlReadiness, uo as applyInlineTextMarkToRange, ur as rankBackgroundImagePoolItems, vc as DialogPortal, vo as normalizeInlineText, wo as truncateInlineText, x as cyclePageDesignBlockLook, xn as useEditorUiStoreInstance, xo as plainTextToInlineText, xs as assertNever$1, yc as DialogTitle, yo as normalizeInlineTextMarks, zl as surfaceForegroundValue } from "./previewAssistantSlot-BgiYk3PB.mjs";
4
- import { A as List, F as Info, G as FileSpreadsheet, I as Image, J as FileArchive, K as FilePlay, Kt as err, L as ImageUp, M as Link$1, P as Italic$1, S as Palette, U as File, V as Highlighter, W as FileText, X as EyeOff, _t as Bold$1, a as Upload, c as Trash2, et as Crop, j as ListOrdered, n as X, pt as Check, q as FileHeadphone, qt as ok, s as TriangleAlert, xt as Archive, y as Pencil } from "./lucide-react-00FF_oar.mjs";
5
- import { At as useFieldDescribedBy, Dt as Input, E as usePreviewCompiledThemeOptional, G as TransferError, H as useMediaEditor, L as siteColourCss, S as planBlockToolbarPlacement, St as usePrevious, U as useMediaEditorOptional, W as useApiMediaUploader, _ as PreviewChromeFloatingControl, _t as Select, b as measureSiteTopChromeClearance, bt as SelectTrigger, ct as EditorCanvasChoiceChip, dt as EditorInsertionMarker, ft as EditorSelectionFrame, h as CustomizeBackgroundColorPicker, lt as EditorCanvasCycleChip, pt as CHOSEN_OPTION_CLASS, st as EditorCanvasChipRow, ut as EditorCanvasNameChip, vt as SelectContent, xt as SelectValue, y as readThemeCustomProperties, yt as SelectItem, zt as classifyKnownMimeType } from "./siteStyleAccess-BlN0jt2c.mjs";
6
- import { A as Tooltip, F as DropdownMenu, H as DropdownMenuTrigger, I as DropdownMenuContent, L as DropdownMenuItem, M as TooltipProvider, N as TooltipTrigger, P as Badge, a as blockNoticeAction, d as arrangementBackgroundControlFor, f as arrangementBlockControlsFor, j as TooltipContent, o as blockNoticeLabel, r as useBlockCustomizeControls, s as blockNoticeMessage, t as useOpenBlockForSetup, u as useBlockNotice } from "./useOpenBlockForSetup-BVfr5P--.mjs";
3
+ import { $d as unsafeAsEditorBlockId, $o as sectionColourRequestUnchanged, Ai as resolveMediaStorageUrl, Ao as removeInlineTextMarkFromRange, As as lookDefinitionForId, Bc as Callout, C as selectedImageFromMediaValue, Co as inlineTextHighlightTones, Di as computeMediaTransformStyle, Do as normalizeInlineTextMarks, Ei as getRichTextImageSize, Eo as normalizeInlineText, F as lookTilesFor, Fc as selectedCanvasBlockId, Fi as resolveArrangementKnobs, Fs as getCuratedSiteStyle, Gl as composeEventHandlers, Gu as parseAspectRatioValue, Hl as useControllableState, Hu as isRotationDimensionSwap, I as nextLookTilePin, Jl as Button, Ju as getImageUrl, Kc as DialogContent, Kl as Primitive, Ku as resolveMediaTransformForAspect, Li as isSystemCustomizeFacetId, Mc as isAddingBlockView, Mo as truncateInlineText, N as lookPositionLabel, Nu as surfaceForegroundValue, P as lookTilePosition, Pi as arrangementKnobChoices, Pl as useSize, Qc as overlayScrimClass, Qo as sectionColourChoice, Qs as sectionOwnerStyleChoices, Sl as __spreadArrays, Sn as useEditorUiStoreInstance, So as inlineTextEqual, Uc as Spinner, Us as getGradientPreset, Uu as normalizeRightAngle, Vi as systemCustomizeFacetStoredValue, Vo as styleDefaultPhotoShape, Vs as gradientToCss, Wc as Dialog, Wl as createContextScope, Wu as formatAspectRatioToken, Xc as DialogTitle, Xl as useControlReadiness, Xo as recommendedBackgrounds, Xs as photoShapeDrawing, Yc as DialogHeader, Ys as isDrawnImageShape, Zl as cva, _l as __extends, _s as sectionPhotoPresence, ai as getBlockDefinition, al as DialogTitle$1, b as pageDesignLookPosition, bl as __rest, bs as resolveEditorArrangementLook, cd as asLayoutVariantKey, dd as generateUuidV4, do as richTextVariantCapabilities, ds as decideSectionPhoto, ed as resolveManagedMediaReference, el as DialogClose, ff as unsafeAsMediaAssetId, fs as sectionKeepsPhotoBesideText, gl as __awaiter, hl as __assign, i as usePreviewSidebarNavigation, il as DialogPortal, in as getDashboardBaseUrl, jc as unwrapResponse, ji as SECTION_BACKGROUND_MIN_SOURCE_WIDTH, jo as replaceInlineTextRange, ki as resolveImageUrlWithContext, ko as plainTextToInlineText, kr as EDITOR_PART_ATTRIBUTE, lo as RichTextDocSchema, lr as rankBackgroundImagePoolItems, nc as assertNever$1, nd as mediaIdentifierSchema, nl as DialogDescription$1, nu as cn$2, o as usePreviewPageDesignEditorState, pf as unsafeAsPositiveByteCount, pl as usePortalContainer, qc as DialogDescription, qu as getDirectImageUrlForMediaAsset, ra as readThemeScopeContext, rl as DialogOverlay, rr as defaultBackgroundOverrideForMode, sr as parseCanonicalSectionBackground, tc as lookModes, tl as DialogContent$1, tr as backgroundColorTokens, tu as useComposedRefs, ud as authoredValuesEqual, uf as assertNever, ur as resolveBackgroundCapability, vl as __generator, vo as applyInlineTextMarkToRange, w as selectedImageFromRenderableAsset, wo as inlineTextToPlainText, xl as __spreadArray, xn as useEditorUiStore, xo as inlineTextAccentTones, y as cyclePageDesignBlockLook, yl as __read, zi as systemCustomizeFacetDefinitionForBlock } from "./previewAssistantSlot-DrUoRNu9.mjs";
4
+ import { C as Palette, G as File, I as Italic$1, J as FilePlay, K as FileText, L as Info, M as List, N as ListOrdered, P as Link$1, Q as EyeOff, Qt as ok, R as Image, Tt as Archive, U as Highlighter, X as FileArchive, Y as FileHeadphone, Zt as err, b as Pencil, c as TriangleAlert, ft as ChevronRight, ht as Check, l as Trash2, n as X, nt as Crop, o as Upload, pt as ChevronLeft, q as FileSpreadsheet, yt as Bold$1, z as ImageUp } from "./lucide-react-B4c6U3ZU.mjs";
5
+ import { At as Input, Ct as SelectTrigger, G as TransferError, H as useMediaEditor, Ht as classifyKnownMimeType, Nt as useFieldDescribedBy, S as planBlockToolbarPlacement, St as SelectItem, Tt as usePrevious, U as useMediaEditorOptional, W as useApiMediaUploader, _ as PreviewChromeFloatingControl, _t as RadioGroupItem, b as measureSiteTopChromeClearance, bt as Select, ct as EditorCanvasChoiceChip, dt as EditorInsertionMarker, ft as EditorPartFrame, gt as RadioGroup, h as CustomizeBackgroundColorPicker, lt as EditorCanvasCycleChip, mt as CHOSEN_OPTION_CLASS, pt as EditorSelectionFrame, st as EditorCanvasChipRow, ut as EditorCanvasNameChip, wt as SelectValue, xt as SelectContent, y as readThemeCustomProperties } from "./siteStyleAccess-B3PwHw2z.mjs";
6
+ import { A as arrangementBlockMode, J as resolvePromotedFields, P as placedFields, _t as DropdownMenuTrigger, a as blockNoticeAction, at as Tooltip, ct as TooltipTrigger, dt as DropdownMenuContent, ft as DropdownMenuItem, lt as Badge, o as blockNoticeLabel, ot as TooltipContent, r as useBlockCustomizeControls, s as blockNoticeMessage, st as TooltipProvider, t as useOpenBlockForSetup, u as useBlockNotice, ut as DropdownMenu } from "./useOpenBlockForSetup-kuGRKaRL.mjs";
7
7
  import * as React$1 from "react";
8
8
  import React, { Component, createContext, createRef, forwardRef, useCallback, useContext, useDebugValue, useEffect, useId, useImperativeHandle, useLayoutEffect, useMemo, useRef, useState } from "react";
9
9
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
@@ -217,67 +217,333 @@ function Surface({ className, variant, radius, padding, ...props }) {
217
217
  });
218
218
  }
219
219
  //#endregion
220
+ //#region ../ui/src/editor-view-header.tsx
221
+ /**
222
+ * The top of every sidebar view: an optional way back, the view's icon and
223
+ * name, a line saying what it is, and the view's own actions.
224
+ * Full-screen phone dialogs can use just the back link, above their existing title.
225
+ */
226
+ function EditorViewHeader({ back, icon, title, subtitle, actions, children, bareIcon = false, wrapTitle = false, backClassName }) {
227
+ return /* @__PURE__ */ jsxs("header", {
228
+ className: "shrink-0 border-b bg-editor-chrome-surface px-4 pb-3 pt-3.5",
229
+ "data-testid": "preview-sidebar-view-header",
230
+ children: [
231
+ back ? /* @__PURE__ */ jsxs("button", {
232
+ type: "button",
233
+ onClick: back.onBack,
234
+ className: `mb-1.5 inline-flex max-w-full items-center gap-1 rounded-md text-[13px] font-medium text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring ${backClassName ?? ""}`,
235
+ "data-testid": "preview-sidebar-back",
236
+ children: [/* @__PURE__ */ jsx(ChevronLeft, {
237
+ className: "h-3.5 w-3.5 shrink-0",
238
+ "aria-hidden": "true"
239
+ }), /* @__PURE__ */ jsx("span", {
240
+ className: "truncate",
241
+ children: back.label
242
+ })]
243
+ }) : null,
244
+ /* @__PURE__ */ jsx(EditorViewTitle, {
245
+ icon,
246
+ title,
247
+ subtitle,
248
+ actions,
249
+ bareIcon,
250
+ wrapTitle
251
+ }),
252
+ children
253
+ ]
254
+ });
255
+ }
256
+ /**
257
+ * A row that opens another sidebar view, such as Site style or Page settings
258
+ * on the page view, or a section's break. The icon can be a small drawing.
259
+ */
260
+ function EditorNavRow({ icon, title, description, onSelect, testId, wrapDescription = false }) {
261
+ return /* @__PURE__ */ jsxs("button", {
262
+ type: "button",
263
+ onClick: onSelect,
264
+ "data-testid": testId,
265
+ className: "flex w-full items-center gap-3 rounded-xl border bg-card px-3.5 py-3 text-left transition-colors hover:border-foreground/25 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring [&>svg:first-child]:h-[18px] [&>svg:first-child]:w-[18px]",
266
+ children: [
267
+ icon,
268
+ /* @__PURE__ */ jsxs("span", {
269
+ className: "min-w-0 flex-1",
270
+ children: [/* @__PURE__ */ jsx("span", {
271
+ className: "block text-sm font-semibold",
272
+ children: title
273
+ }), /* @__PURE__ */ jsx("span", {
274
+ className: cn$2("block text-[12.5px] text-muted-foreground", wrapDescription ? "leading-snug" : "truncate"),
275
+ children: description
276
+ })]
277
+ }),
278
+ /* @__PURE__ */ jsx(ChevronRight, {
279
+ className: "h-4 w-4 shrink-0 text-muted-foreground",
280
+ "aria-hidden": "true"
281
+ })
282
+ ]
283
+ });
284
+ }
285
+ function EditorViewTitle({ icon, title, subtitle, actions, bareIcon, wrapTitle }) {
286
+ return title ? /* @__PURE__ */ jsxs("div", {
287
+ className: "flex items-start gap-2.5",
288
+ children: [
289
+ icon ? /* @__PURE__ */ jsx("span", {
290
+ className: `flex h-[34px] w-[34px] shrink-0 items-center justify-center text-foreground ${bareIcon ? "" : "rounded-[10px] bg-muted [&_svg]:h-4 [&_svg]:w-4"}`,
291
+ "aria-hidden": "true",
292
+ children: icon
293
+ }) : null,
294
+ /* @__PURE__ */ jsxs("div", {
295
+ className: "flex min-h-[34px] min-w-0 flex-1 flex-col justify-center",
296
+ children: [/* @__PURE__ */ jsx("div", {
297
+ role: "heading",
298
+ "aria-level": 2,
299
+ className: `${wrapTitle ? "break-words" : "truncate"} text-base font-bold leading-5 tracking-[-0.005em]`,
300
+ children: title
301
+ }), subtitle ? /* @__PURE__ */ jsx("div", {
302
+ className: "mt-0.5 text-[12.5px] text-muted-foreground",
303
+ children: subtitle
304
+ }) : null]
305
+ }),
306
+ actions ? /* @__PURE__ */ jsx("div", {
307
+ className: "ml-auto flex shrink-0 items-center gap-0.5",
308
+ children: actions
309
+ }) : null
310
+ ]
311
+ }) : null;
312
+ }
313
+ //#endregion
314
+ //#region ../ui/src/mobile-dialog-changes.ts
315
+ function needsDiscardConfirmation(changes, observed) {
316
+ switch (changes.kind) {
317
+ case "read-only": return false;
318
+ case "unavailable": return observed.fieldChanged;
319
+ case "draft": return observed.initialDraft !== void 0 && observed.initialDraft !== JSON.stringify(changes.value);
320
+ }
321
+ }
322
+ /**
323
+ * Capture before the first edit, so loading defaults isn't mistaken for a person's change.
324
+ * `fieldChanged` is only for dialogs that can't share a draft: an untouched one closes without asking.
325
+ */
326
+ function useMobileDialogChanges(changes) {
327
+ const observed = React$1.useRef({
328
+ initialDraft: void 0,
329
+ fieldChanged: false
330
+ });
331
+ const capture = () => {
332
+ if (observed.current.initialDraft === void 0 && changes?.kind === "draft") observed.current.initialDraft = JSON.stringify(changes.value);
333
+ };
334
+ const fieldChanged = () => {
335
+ capture();
336
+ observed.current.fieldChanged = true;
337
+ };
338
+ const reset = () => {
339
+ observed.current = {
340
+ initialDraft: void 0,
341
+ fieldChanged: false
342
+ };
343
+ };
344
+ const needsConfirmation = () => changes ? needsDiscardConfirmation(changes, observed.current) : false;
345
+ return {
346
+ capture,
347
+ fieldChanged,
348
+ reset,
349
+ needsConfirmation
350
+ };
351
+ }
352
+ //#endregion
220
353
  //#region ../ui/src/scrollable-dialog-shell.tsx
221
- function ScrollableDialogShell({ header, footer, children, mobileFullscreen = false, desktopMaxWidth = "sm:max-w-3xl", desktopHeight = "sm:h-[80vh]", maxWidth = "max-w-3xl", height = "h-[80vh]", disableMotion = false, showCloseButton = true, className, headerClassName, bodyClassName, footerClassName, wrapContent, ...props }) {
222
- const portalContainer = usePortalContainer();
223
- const inner = /* @__PURE__ */ jsxs(Fragment$1, { children: [
354
+ function useDialogNavigation(props) {
355
+ const closeRef = React$1.useRef(null);
356
+ const [confirmDiscard, setConfirmDiscard] = React$1.useState(false);
357
+ const changes = useMobileDialogChanges(props.mobileChanges);
358
+ const leave = () => {
359
+ if (changes.needsConfirmation()) setConfirmDiscard(true);
360
+ else closeRef.current?.click();
361
+ };
362
+ const guardEscape = (event) => {
363
+ props.onEscapeKeyDown?.(event);
364
+ if (!event.defaultPrevented && props.mobileFullscreen) {
365
+ event.preventDefault();
366
+ leave();
367
+ }
368
+ };
369
+ const guardPointerOutside = (event) => {
370
+ props.onPointerDownOutside?.(event);
371
+ if (!event.defaultPrevented && changes.needsConfirmation()) {
372
+ event.preventDefault();
373
+ setConfirmDiscard(true);
374
+ }
375
+ };
376
+ const guardFocusOutside = (event) => {
377
+ props.onFocusOutside?.(event);
378
+ if (changes.needsConfirmation()) event.preventDefault();
379
+ };
380
+ return {
381
+ closeRef,
382
+ confirmDiscard,
383
+ setConfirmDiscard,
384
+ changes,
385
+ leave,
386
+ guardEscape,
387
+ guardPointerOutside,
388
+ guardFocusOutside
389
+ };
390
+ }
391
+ function DiscardDialog({ navigation }) {
392
+ if (!navigation.confirmDiscard) return null;
393
+ return /* @__PURE__ */ jsx(Dialog, {
394
+ open: true,
395
+ onOpenChange: navigation.setConfirmDiscard,
396
+ children: /* @__PURE__ */ jsxs(DialogContent, {
397
+ showCloseButton: false,
398
+ children: [
399
+ /* @__PURE__ */ jsx(DialogTitle, { children: "Discard these changes?" }),
400
+ /* @__PURE__ */ jsx(DialogDescription, { children: "Your changes won’t be saved." }),
401
+ /* @__PURE__ */ jsxs("div", {
402
+ className: "flex flex-col gap-2 sm:flex-row sm:justify-end",
403
+ children: [/* @__PURE__ */ jsx(Button, {
404
+ variant: "secondary",
405
+ onClick: () => navigation.setConfirmDiscard(false),
406
+ children: "Keep editing"
407
+ }), /* @__PURE__ */ jsx(Button, {
408
+ variant: "destructive",
409
+ onClick: () => {
410
+ navigation.setConfirmDiscard(false);
411
+ navigation.closeRef.current?.click();
412
+ },
413
+ children: "Discard changes"
414
+ })]
415
+ })
416
+ ]
417
+ })
418
+ });
419
+ }
420
+ function DialogFooter({ footer, mobileFullscreen, footerClassName }) {
421
+ if (!footer) return null;
422
+ return /* @__PURE__ */ jsx("div", {
423
+ "data-slot": "scrollable-dialog-footer",
424
+ className: cn$2("flex-shrink-0 border-t px-4 py-3 sm:px-6 sm:py-4", mobileFullscreen && "max-sm:pb-[max(0.75rem,env(safe-area-inset-bottom))] max-sm:[&_button]:w-full max-sm:[&_[data-dialog-dismiss]]:hidden", footerClassName),
425
+ children: /* @__PURE__ */ jsx("div", {
426
+ className: "flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
427
+ children: footer
428
+ })
429
+ });
430
+ }
431
+ const closeButtonClass = "ring-offset-background focus:ring-ring rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4";
432
+ function CloseButton({ options, navigation }) {
433
+ const content = /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(X, {}), /* @__PURE__ */ jsx("span", {
434
+ className: "sr-only",
435
+ children: "Close"
436
+ })] });
437
+ if (!options.mobileFullscreen) return /* @__PURE__ */ jsx(DialogClose, {
438
+ "data-slot": "dialog-close",
439
+ className: closeButtonClass,
440
+ children: content
441
+ });
442
+ return /* @__PURE__ */ jsx("button", {
443
+ type: "button",
444
+ "data-slot": "dialog-close",
445
+ onClick: navigation.leave,
446
+ className: cn$2("hidden sm:inline-flex", closeButtonClass),
447
+ children: content
448
+ });
449
+ }
450
+ function DialogSections({ options, navigation }) {
451
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [
452
+ options.mobileFullscreen ? /* @__PURE__ */ jsx("div", {
453
+ className: "shrink-0 sm:hidden",
454
+ children: /* @__PURE__ */ jsx(EditorViewHeader, { back: {
455
+ label: options.backLabel,
456
+ onBack: navigation.leave
457
+ } })
458
+ }) : null,
459
+ /* @__PURE__ */ jsx(DialogClose, {
460
+ ref: navigation.closeRef,
461
+ className: "hidden",
462
+ "aria-hidden": "true",
463
+ tabIndex: -1
464
+ }),
224
465
  /* @__PURE__ */ jsx("div", {
225
466
  "data-slot": "scrollable-dialog-header",
226
- className: cn$2("flex-shrink-0 border-b px-4 py-3 sm:px-6 sm:py-4", headerClassName),
467
+ className: cn$2("flex-shrink-0 border-b px-4 py-3 sm:px-6 sm:py-4", options.headerClassName),
227
468
  children: /* @__PURE__ */ jsxs("div", {
228
469
  className: "flex items-start justify-between gap-4",
229
- children: [header, showCloseButton && /* @__PURE__ */ jsxs(DialogClose, {
230
- "data-slot": "dialog-close",
231
- className: "ring-offset-background focus:ring-ring rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
232
- children: [/* @__PURE__ */ jsx(X, {}), /* @__PURE__ */ jsx("span", {
233
- className: "sr-only",
234
- children: "Close"
235
- })]
236
- })]
470
+ children: [options.header, options.showCloseButton !== false ? /* @__PURE__ */ jsx(CloseButton, {
471
+ options,
472
+ navigation
473
+ }) : null]
237
474
  })
238
475
  }),
239
476
  /* @__PURE__ */ jsx("div", {
240
477
  "data-slot": "scrollable-dialog-body",
241
- className: cn$2("flex-1 overflow-y-auto px-4 py-4 sm:px-6", bodyClassName),
242
- children
478
+ className: cn$2("min-h-0 flex-1 overflow-y-auto px-4 py-4 sm:px-6", options.bodyClassName),
479
+ children: options.children
243
480
  }),
244
- footer ? /* @__PURE__ */ jsx("div", {
245
- "data-slot": "scrollable-dialog-footer",
246
- className: cn$2("flex-shrink-0 border-t px-4 py-3 sm:px-6 sm:py-4", footerClassName),
247
- children: /* @__PURE__ */ jsx("div", {
248
- className: "flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
249
- children: footer
250
- })
251
- }) : null
481
+ /* @__PURE__ */ jsx(DialogFooter, { ...options }),
482
+ /* @__PURE__ */ jsx(DiscardDialog, { navigation })
252
483
  ] });
484
+ }
485
+ function shellClasses(options) {
486
+ return cn$2("bg-background flex flex-col", !options.disableMotion && "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 duration-200", options.mobileFullscreen ? cn$2("fixed inset-0 left-0 top-0 z-50 translate-x-0 translate-y-0 h-dvh w-full max-w-full rounded-none border-0 shadow-lg", "sm:inset-auto sm:top-[50%] sm:left-[50%] sm:w-full sm:max-w-[calc(100%-2rem)] sm:translate-x-[-50%] sm:translate-y-[-50%] sm:rounded-lg sm:border", options.desktopMaxWidth ?? "sm:max-w-3xl", options.desktopHeight ?? "sm:h-[80vh]") : cn$2("fixed top-[50%] left-[50%] z-50 translate-x-[-50%] translate-y-[-50%] w-full max-w-[calc(100%-2rem)] rounded-lg border shadow-lg", options.maxWidth ?? "max-w-3xl", options.height ?? "h-[80vh]"), options.className);
487
+ }
488
+ function ScrollableDialogShell(options) {
489
+ const portalContainer = usePortalContainer();
490
+ const navigation = useDialogNavigation(options);
491
+ const { header: _header, footer: _footer, children: _children, mobileFullscreen: _mobileFullscreen, backLabel: _backLabel, mobileChanges: _mobileChanges, desktopMaxWidth: _desktopMaxWidth, desktopHeight: _desktopHeight, maxWidth: _maxWidth, height: _height, disableMotion: _disableMotion, showCloseButton: _showCloseButton, className: _className, headerClassName: _headerClassName, bodyClassName: _bodyClassName, footerClassName: _footerClassName, wrapContent, ...props } = options;
492
+ const sections = /* @__PURE__ */ jsx(DialogSections, {
493
+ options,
494
+ navigation
495
+ });
253
496
  return /* @__PURE__ */ jsxs(DialogPortal, {
254
497
  "data-slot": "dialog-portal",
255
498
  container: portalContainer,
256
499
  children: [/* @__PURE__ */ jsx(DialogOverlay, {
257
500
  "data-slot": "dialog-overlay",
258
501
  className: overlayScrimClass
259
- }), /* @__PURE__ */ jsx(DialogContent, {
502
+ }), /* @__PURE__ */ jsx(DialogContent$1, {
260
503
  "data-slot": "scrollable-dialog-shell",
261
- className: cn$2("bg-background", !disableMotion && "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95", mobileFullscreen ? cn$2("fixed inset-0 left-0 top-0 z-50 translate-x-0 translate-y-0", "h-svh w-full max-w-full rounded-none border-0 shadow-lg", !disableMotion && "duration-200", "sm:inset-auto sm:top-[50%] sm:left-[50%] sm:w-full sm:max-w-[calc(100%-2rem)] sm:translate-x-[-50%] sm:translate-y-[-50%] sm:rounded-lg sm:border", desktopMaxWidth, desktopHeight) : cn$2("fixed top-[50%] left-[50%] z-50 translate-x-[-50%] translate-y-[-50%]", "w-full max-w-[calc(100%-2rem)] rounded-lg border shadow-lg", !disableMotion && "duration-200", maxWidth, height), "flex flex-col", className),
262
504
  ...props,
263
- children: wrapContent ? wrapContent(inner) : inner
505
+ className: shellClasses(options),
506
+ onPointerDownCapture: (event) => {
507
+ navigation.changes.capture();
508
+ props.onPointerDownCapture?.(event);
509
+ },
510
+ onKeyDownCapture: (event) => {
511
+ navigation.changes.capture();
512
+ props.onKeyDownCapture?.(event);
513
+ },
514
+ onChangeCapture: (event) => {
515
+ navigation.changes.fieldChanged();
516
+ props.onChangeCapture?.(event);
517
+ },
518
+ onInputCapture: (event) => {
519
+ navigation.changes.fieldChanged();
520
+ props.onInputCapture?.(event);
521
+ },
522
+ onOpenAutoFocus: (event) => {
523
+ navigation.changes.reset();
524
+ props.onOpenAutoFocus?.(event);
525
+ },
526
+ onEscapeKeyDown: navigation.guardEscape,
527
+ onPointerDownOutside: navigation.guardPointerOutside,
528
+ onFocusOutside: navigation.guardFocusOutside,
529
+ children: wrapContent ? wrapContent(sections) : sections
264
530
  })]
265
531
  });
266
532
  }
267
533
  //#endregion
268
534
  //#region ../ui/src/scrollable-dialog.tsx
269
- function ScrollableDialogContent({ title, description, footer, children, mobileFullscreen, desktopMaxWidth, desktopHeight, maxWidth, height, disableMotion, showCloseButton, className, headerClassName, bodyClassName, footerClassName, ["aria-describedby"]: ariaDescribedBy, ...props }) {
535
+ function ScrollableDialogContent({ title, description, footer, children, desktopMaxWidth, desktopHeight, maxWidth, height, disableMotion, showCloseButton, className, headerClassName, bodyClassName, footerClassName, ["aria-describedby"]: ariaDescribedBy, ...props }) {
270
536
  const descriptionId = React$1.useId();
271
537
  return /* @__PURE__ */ jsx(ScrollableDialogShell, {
272
538
  "data-slot": "scrollable-dialog-content",
273
539
  "aria-describedby": ariaDescribedBy ?? (description ? descriptionId : void 0),
274
540
  header: /* @__PURE__ */ jsxs("div", {
275
541
  className: "flex flex-col gap-1.5",
276
- children: [/* @__PURE__ */ jsx(DialogTitle, {
542
+ children: [/* @__PURE__ */ jsx(DialogTitle$1, {
277
543
  "data-slot": "dialog-title",
278
544
  className: "text-lg leading-none font-semibold",
279
545
  children: title
280
- }), description ? /* @__PURE__ */ jsx(DialogDescription, {
546
+ }), description ? /* @__PURE__ */ jsx(DialogDescription$1, {
281
547
  id: descriptionId,
282
548
  "data-slot": "dialog-description",
283
549
  className: "text-muted-foreground text-sm",
@@ -285,7 +551,6 @@ function ScrollableDialogContent({ title, description, footer, children, mobileF
285
551
  }) : null]
286
552
  }),
287
553
  footer,
288
- mobileFullscreen,
289
554
  desktopMaxWidth,
290
555
  desktopHeight,
291
556
  maxWidth,
@@ -561,6 +826,62 @@ function progressPercentage(value, max) {
561
826
  return Math.min(Math.max(max > 0 ? value / max * 100 : 0, 0), 100);
562
827
  }
563
828
  //#endregion
829
+ //#region ../ui/src/preview-tile-group.tsx
830
+ const COLUMNS = {
831
+ 2: "grid-cols-2",
832
+ 4: "grid-cols-4",
833
+ 5: "grid-cols-5",
834
+ 6: "grid-cols-6",
835
+ 7: "grid-cols-7"
836
+ };
837
+ const DRAWING = {
838
+ swatch: "aspect-square",
839
+ tile: "aspect-square",
840
+ wide: "aspect-[3/1]"
841
+ };
842
+ const TILE_CLASS = [
843
+ "flex min-w-0 cursor-pointer flex-col items-stretch gap-1 rounded-md border border-border bg-background p-1 text-left transition-colors hover:bg-muted",
844
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1",
845
+ "disabled:cursor-not-allowed disabled:opacity-50"
846
+ ].join(" ");
847
+ const defaultColumns = (size) => size === "swatch" ? 6 : size === "wide" ? 2 : 4;
848
+ /**
849
+ * A single choice between things the owner has to see rather than read: a
850
+ * background, a section break in the site's colours, a photo shape. Each tile
851
+ * holds the caller's drawing, with its name under it or kept for screen
852
+ * readers only. Every tile in a row is the same height, however its name
853
+ * wraps. The chosen tile carries CHOSEN_OPTION_CLASS. It's a radio group:
854
+ * Tab reaches the chosen tile and the arrow keys move between tiles.
855
+ */
856
+ function PreviewTileGroup({ label, options, value, onValueChange, size = "tile", labels = size === "swatch" ? "hidden" : "visible", columns = defaultColumns(size), describedBy, className }) {
857
+ const hidden = labels === "hidden";
858
+ return /* @__PURE__ */ jsx(RadioGroup, {
859
+ "aria-label": label,
860
+ "aria-describedby": describedBy,
861
+ value: value ?? "",
862
+ onValueChange: (next) => {
863
+ const chosen = options.find((option) => option.value === next);
864
+ if (chosen) onValueChange(chosen.value);
865
+ },
866
+ className: cn$2("grid auto-rows-fr gap-1.5", COLUMNS[columns], className),
867
+ children: options.map((option) => /* @__PURE__ */ jsxs(RadioGroupItem, {
868
+ value: option.value,
869
+ disabled: option.disabled,
870
+ "aria-label": hidden ? option.label : void 0,
871
+ title: hidden ? option.label : void 0,
872
+ className: cn$2(TILE_CLASS, option.value === value && "border-primary bg-primary/5 ring-1 ring-primary hover:bg-primary/10"),
873
+ children: [/* @__PURE__ */ jsx("span", {
874
+ "aria-hidden": "true",
875
+ className: cn$2("block w-full overflow-hidden rounded-[5px] border border-black/10 [&>svg]:block [&>svg]:size-full", DRAWING[size]),
876
+ children: option.preview
877
+ }), hidden ? null : /* @__PURE__ */ jsx("span", {
878
+ className: "px-0.5 pb-0.5 text-xs font-medium leading-4 text-foreground",
879
+ children: option.label
880
+ })]
881
+ }, option.value))
882
+ });
883
+ }
884
+ //#endregion
564
885
  //#region ../theme-core/src/footer/mode.ts
565
886
  /** Reads only SDK footer intent; unrelated config and theme fields are not authorities. */
566
887
  function resolveSdkFooterMode(config) {
@@ -21885,10 +22206,10 @@ function LinkPopover({ editor, tone = "dark", initialItems, loadItems }) {
21885
22206
  }), /* @__PURE__ */ jsx(Dialog, {
21886
22207
  open,
21887
22208
  onOpenChange: setOpen,
21888
- children: /* @__PURE__ */ jsxs(DialogContent$1, {
22209
+ children: /* @__PURE__ */ jsxs(DialogContent, {
21889
22210
  "data-rb-document-toolbar": richTextDocumentOwner(editor),
21890
22211
  className: "max-h-[85vh] w-[calc(100vw-2rem)] max-w-2xl overflow-hidden overflow-y-auto",
21891
- children: [/* @__PURE__ */ jsxs(DialogHeader, { children: [/* @__PURE__ */ jsx(DialogTitle$1, { children: "Choose link" }), /* @__PURE__ */ jsx(DialogDescription$1, { children: "Select an internal page, an external URL, or a custom path." })] }), /* @__PURE__ */ jsxs("div", {
22212
+ children: [/* @__PURE__ */ jsxs(DialogHeader, { children: [/* @__PURE__ */ jsx(DialogTitle, { children: "Choose link" }), /* @__PURE__ */ jsx(DialogDescription, { children: "Select an internal page, an external URL, or a custom path." })] }), /* @__PURE__ */ jsxs("div", {
21892
22213
  className: "min-w-0 space-y-3",
21893
22214
  onKeyDown: applyOnEnter,
21894
22215
  children: [
@@ -22172,6 +22493,25 @@ function RichTextEditorSurface({ editor, config, isEmpty, className, contentClas
22172
22493
  });
22173
22494
  }
22174
22495
  //#endregion
22496
+ //#region ../block-form/src/editing/canvasPart.ts
22497
+ /**
22498
+ * Whether a part of the block on the canvas leads anywhere, and what its
22499
+ * setting is called. The plan decides where the field is; a part whose field
22500
+ * the form doesn't offer (hidden by a condition, owned by the Look, or not
22501
+ * the block's own) leads nowhere, and the canvas treats a click on it as a
22502
+ * click on the block. A field the form places itself is named as the form
22503
+ * names it (the hero's section photo is "Photo" there, not "Background
22504
+ * image"); a part nested inside one (a card's image) is named by its own field.
22505
+ */
22506
+ function canvasPartOf(plan, fieldPath) {
22507
+ if (plan.destinationOf(fieldPath).kind === "unavailable") return null;
22508
+ const field = placedFields(plan.layout).find((item) => item.path === fieldPath)?.field ?? resolvePromotedFields([...plan.fields], [fieldPath], () => void 0)[0]?.field;
22509
+ return field ? {
22510
+ path: fieldPath,
22511
+ label: field.label
22512
+ } : null;
22513
+ }
22514
+ //#endregion
22175
22515
  //#region ../media-react/src/hooks/useMediaSearch.ts
22176
22516
  const DEFAULT_PAGE_SIZE = 30;
22177
22517
  const useMediaSearch = ({ repo, siteId, initialQuery = "", pageSize = DEFAULT_PAGE_SIZE, filters, filtersKey }) => {
@@ -30009,7 +30349,7 @@ const MediaEditor = ({ editingSlot, value, onChange, allowedKinds, previewAspect
30009
30349
  });
30010
30350
  const uploader = uploadIntent === void 0 && videoPrepIntent === void 0 ? context.uploader : scopedUploader;
30011
30351
  const resolvedAllowedKinds = useMemo(() => resolveAllowedMediaKinds({ allowedKinds }), [allowedKinds]);
30012
- const [pickerOpen, setPickerOpen] = useState(false);
30352
+ const [pickerOpen, setPickerOpen] = useState(mediaPickerAutoOpen);
30013
30353
  const [cropOpen, setCropOpen] = useState(false);
30014
30354
  const videoSlotPolicy = useMemo(() => deriveVideoSlotPolicy(videoSelectionIntent), [videoSelectionIntent]);
30015
30355
  const PickerMiniComponent = components?.MediaPickerMini ?? MediaPickerMini;
@@ -30032,7 +30372,7 @@ const MediaEditor = ({ editingSlot, value, onChange, allowedKinds, previewAspect
30032
30372
  onMediaPickerOpenChange?.(true);
30033
30373
  }, [mediaPickerAutoOpen, onMediaPickerOpenChange]);
30034
30374
  useEffect(() => {
30035
- if (mediaPickerAutoOpen) {
30375
+ if (pickerOpen) {
30036
30376
  setCropOpen(false);
30037
30377
  return;
30038
30378
  }
@@ -30044,7 +30384,7 @@ const MediaEditor = ({ editingSlot, value, onChange, allowedKinds, previewAspect
30044
30384
  }, [
30045
30385
  cropEditorAutoOpen,
30046
30386
  cropEditorMode,
30047
- mediaPickerAutoOpen,
30387
+ pickerOpen,
30048
30388
  mediaState.crop.kind,
30049
30389
  value
30050
30390
  ]);
@@ -30319,14 +30659,255 @@ function useRichTextImageProjection(fallbackSiteId) {
30319
30659
  }), [imageResolveContext, fallbackSiteId]);
30320
30660
  }
30321
30661
  //#endregion
30322
- //#region ../preview-next/src/client/preview/siteColourVariables.ts
30662
+ //#region ../preview-next/src/client/blocks/arrangementControlsModel.ts
30323
30663
  /**
30324
- * The colour variables the site canvas paints with, for preview controls that
30325
- * sit outside it (the sidebar, popovers) and show the site's colours. They
30326
- * follow the theme the preview shows, so a palette change is reflected too.
30664
+ * Decides the arrangement-Look controls for one block from the editor read
30665
+ * model and the content the editor holds. Null means the block's style uses
30666
+ * the legacy catalogue, so the legacy controls apply unchanged.
30327
30667
  */
30328
- function useSiteColourVariables() {
30329
- return usePreviewCompiledThemeOptional()?.colourVariables ?? null;
30668
+ function arrangementBlockControlsFor(input) {
30669
+ const selection = input.block.arrangementLookSelection;
30670
+ if (!selection) return null;
30671
+ const mode = arrangementBlockMode(input.block);
30672
+ const pin = pinnedLookId(input.block);
30673
+ const offered = offeredLooksForMode(selection, mode);
30674
+ const resolved = resolveEditorArrangementLook(selection, mode, pin);
30675
+ const effective = resolved.kind === "none" || resolved.kind === "recipe" ? null : resolved.look;
30676
+ const knobState = effective ? resolveArrangementKnobs({
30677
+ blockKind: input.block.blockKind,
30678
+ look: compiledKnobLook(selection.style.offers, effective),
30679
+ content: input.content
30680
+ }) : null;
30681
+ return {
30682
+ look: lookPosition(resolved, input.block),
30683
+ tiles: lookTilesFor({
30684
+ looks: offered,
30685
+ defaultLookId: resolvedLookId(resolveEditorArrangementLook(selection, mode, null)),
30686
+ shownLookId: effective?.id ?? null
30687
+ }),
30688
+ mode: modeSwitch(input.block, selection.available, mode),
30689
+ knobs: knobState ? knobControls(input.block.blockKind, knobState.exposure, knobState.knobs, input.content, effective?.structure.knobDescriptions).map((control) => photoShapeControl(control, effective ? styleDefaultPhotoShape(effective.structure.mediaFrame, selection.style.skin) : null)) : [],
30690
+ headlineHint: knobState ? headlineHint(knobState.knobs, knobState.length) : null
30691
+ };
30692
+ }
30693
+ /** The name of the Look a block shows, for the page outline. Null on a legacy style. */
30694
+ function arrangementLookNameFor(block) {
30695
+ const selection = block.arrangementLookSelection;
30696
+ if (!selection) return null;
30697
+ return lookPosition(resolveEditorArrangementLook(selection, arrangementBlockMode(block), pinnedLookId(block)), block)?.lookName ?? null;
30698
+ }
30699
+ /** The Look a resolution renders; unpinned, that's the style's own pick. */
30700
+ function resolvedLookId(resolved) {
30701
+ return resolved.kind === "none" || resolved.kind === "recipe" ? null : resolved.look.id;
30702
+ }
30703
+ function pinnedLookId(block) {
30704
+ return block.look.kind === "user-pinned" ? block.look.value : null;
30705
+ }
30706
+ /** Offer order, as the resolver uses it, for the Looks that support the mode. */
30707
+ function offeredLooksForMode(selection, mode) {
30708
+ return selection.style.offers.flatMap((offer) => {
30709
+ const look = selection.available.find((candidate) => candidate.id === offer.id);
30710
+ return look && lookModes(look).includes(mode) ? [look] : [];
30711
+ });
30712
+ }
30713
+ function compiledKnobLook(offers, look) {
30714
+ const offer = offers.find((candidate) => candidate.id === look.id);
30715
+ return {
30716
+ look,
30717
+ addKnobs: offer?.addKnobs ?? [],
30718
+ removeKnobs: offer?.removeKnobs ?? [],
30719
+ knobValues: offer?.knobValues ?? {}
30720
+ };
30721
+ }
30722
+ function lookPosition(resolved, block) {
30723
+ switch (resolved.kind) {
30724
+ case "offered": return resolved.source === "auto" ? {
30725
+ kind: "automatic",
30726
+ lookName: resolved.look.label
30727
+ } : {
30728
+ kind: "pinned",
30729
+ lookName: resolved.look.label
30730
+ };
30731
+ case "style-fallback": return {
30732
+ kind: "style-fallback",
30733
+ requestedName: lookName(resolved.requested),
30734
+ lookName: resolved.look.label
30735
+ };
30736
+ case "mode-mismatch": return {
30737
+ kind: "mode-mismatch",
30738
+ requestedName: lookName(resolved.requested),
30739
+ requestedModeLabel: requestedModeLabel(block, resolved.requested),
30740
+ lookName: resolved.look.label
30741
+ };
30742
+ case "recipe":
30743
+ case "none": return null;
30744
+ }
30745
+ }
30746
+ /** The requested Look may be one this style doesn't offer, so read the shared catalogue. */
30747
+ function lookName(id) {
30748
+ return lookDefinitionForId(id)?.label ?? "your chosen Look";
30749
+ }
30750
+ function requestedModeLabel(block, id) {
30751
+ const look = lookDefinitionForId(id);
30752
+ const mode = look ? lookModes(look).find((candidate) => candidate !== null) : void 0;
30753
+ return mode ? modeLabel(block, mode) : "another";
30754
+ }
30755
+ function modeSwitch(block, available, current) {
30756
+ if (current === null) return null;
30757
+ const modesWithLooks = available.flatMap((look) => lookModes(look)).filter((mode) => mode !== null);
30758
+ const modes = [...new Set(modesWithLooks)];
30759
+ return modes.length > 1 ? {
30760
+ current,
30761
+ options: modes.map((mode) => ({
30762
+ mode,
30763
+ label: modeLabel(block, mode)
30764
+ }))
30765
+ } : null;
30766
+ }
30767
+ function modeLabel(block, mode) {
30768
+ const meaning = getBlockDefinition(block.blockKind)?.manifest.variantMeaning;
30769
+ return (meaning?.kind === "mode" ? meaning.modeLabels?.[mode] : void 0) ?? block.availableLayouts.find((layout) => layout.id === mode)?.label ?? mode.charAt(0).toUpperCase() + mode.slice(1);
30770
+ }
30771
+ function knobControls(blockKind, exposure, knobs, content, descriptions = {}) {
30772
+ return exposure.flatMap((entry) => {
30773
+ const knob = knobs[entry.definition.id];
30774
+ const facet = shownKnobFacet(blockKind, entry, knob);
30775
+ if (!facet || !knob || knob.kind === "kept") return [];
30776
+ const control = knobControl(entry, knob, facet, systemCustomizeFacetStoredValue(facet, { ...content }));
30777
+ const description = descriptions[entry.definition.id] ?? facet.description;
30778
+ return [control.kind === "choice" && description !== void 0 ? {
30779
+ ...control,
30780
+ description
30781
+ } : control];
30782
+ });
30783
+ }
30784
+ /** Only knobs the current Look exposes and doesn't force get a control. */
30785
+ function shownKnobFacet(blockKind, entry, knob) {
30786
+ const id = entry.definition.id;
30787
+ if (entry.definition.textMaxLength === void 0 && arrangementKnobChoices(entry).length <= 1 || !entry.exposed || entry.forced !== void 0 || !knob || knob.kind === "kept" || !isSystemCustomizeFacetId(id)) return null;
30788
+ return systemCustomizeFacetDefinitionForBlock(blockKind, id);
30789
+ }
30790
+ function knobControl(entry, knob, facet, stored) {
30791
+ if (entry.definition.textMaxLength !== void 0) return {
30792
+ kind: "text",
30793
+ facetId: facet.id,
30794
+ label: facet.label,
30795
+ value: knob.value,
30796
+ stored,
30797
+ maxLength: entry.definition.textMaxLength
30798
+ };
30799
+ const choices = arrangementKnobChoices(entry);
30800
+ const preference = knob.kind === "clamped" && knob.reason === "length" && choices.includes(knob.stored) ? knob.stored : knob.value;
30801
+ const labelOf = (value) => facet.values.find((option) => option.value === value)?.label ?? value;
30802
+ return {
30803
+ kind: "choice",
30804
+ presentation: knobPresentation(facet, choices),
30805
+ facetId: facet.id,
30806
+ label: facet.label,
30807
+ value: preference,
30808
+ stored,
30809
+ notOffered: knob.kind === "clamped" && knob.reason !== "length" ? {
30810
+ by: knob.reason,
30811
+ choice: labelOf(knob.stored),
30812
+ shows: labelOf(knob.value)
30813
+ } : null,
30814
+ options: choices.map((value) => ({
30815
+ value,
30816
+ label: labelOf(value)
30817
+ }))
30818
+ };
30819
+ }
30820
+ /** On/off knobs store `'true'` and `'false'`; the switch is on for `'true'`. */
30821
+ function knobPresentation(facet, choices) {
30822
+ if (facet.target.kind === "content-field" && facet.target.boolean === true && choices.length === 2 && choices.includes("true") && choices.includes("false")) return "switch";
30823
+ return choices.length <= 3 ? "segments" : "menu";
30824
+ }
30825
+ /** The photo shape knob is drawn, so it carries the shape the style gives while the owner leaves it alone. */
30826
+ function photoShapeControl(control, styleShape) {
30827
+ if (control.kind !== "choice" || control.facetId !== "imageShape") return control;
30828
+ const { presentation: _presentation, options, ...rest } = control;
30829
+ return {
30830
+ ...rest,
30831
+ kind: "photo-shape",
30832
+ styleShape,
30833
+ options: options.flatMap((option) => isDrawnImageShape(option.value) ? [{
30834
+ value: option.value,
30835
+ label: option.label
30836
+ }] : [])
30837
+ };
30838
+ }
30839
+ function headlineHint(knobs, length) {
30840
+ const headline = knobs.titleSize;
30841
+ return headline?.kind === "clamped" && headline.reason === "length" && length !== null && length !== "short" ? { length } : null;
30842
+ }
30843
+ function arrangementBackgroundControlFor(input) {
30844
+ const selection = input.block.arrangementLookSelection;
30845
+ if (!selection || input.block.backgroundSupport.kind === "unsupported") return null;
30846
+ const photo = decideSectionPhoto({
30847
+ block: input.block,
30848
+ sectionPhoto: getBlockDefinition(input.block.blockKind)?.manifest.sectionPhoto,
30849
+ draftPhoto: sectionPhotoPresence(input.content)
30850
+ });
30851
+ if (photo.kind === "arrangement" && photo.use === "behind") return null;
30852
+ const keepsPhoto = sectionKeepsPhotoBesideText(photo);
30853
+ const stored = storedSectionColour({ ...input.content });
30854
+ if (stored.kind === "photo" && !keepsPhoto) return { kind: "held-by-photo" };
30855
+ return groundsControl({
30856
+ block: input.block,
30857
+ style: selection.style,
30858
+ content: input.content,
30859
+ stored,
30860
+ keepsPhoto
30861
+ });
30862
+ }
30863
+ function groundsControl(input) {
30864
+ const grounds = recommendedBackgrounds(input.style);
30865
+ const choices = sectionOwnerStyleChoices(input.content);
30866
+ return {
30867
+ kind: "grounds",
30868
+ grounds,
30869
+ keepsPhoto: input.keepsPhoto,
30870
+ colour: sectionColourChoice({
30871
+ groundName: storedGroundName(choices.ground),
30872
+ background: input.stored.kind === "colour" || input.stored.kind === "gradient" ? input.stored : null
30873
+ }, grounds),
30874
+ treatment: choices.treatment ?? null,
30875
+ finishes: input.style.finishes ?? null,
30876
+ colourTokens: resolveBackgroundCapability({
30877
+ block: input.block,
30878
+ imagePool: []
30879
+ }).colorTokens ?? []
30880
+ };
30881
+ }
30882
+ /** The owner's ground as stored: a name, null for a palette colour, undefined when nothing was stored. */
30883
+ function storedGroundName(ground) {
30884
+ return ground === void 0 ? void 0 : ground?.name ?? null;
30885
+ }
30886
+ /** The colour or photo a section's stored background paints. */
30887
+ function storedSectionColour(content) {
30888
+ const stored = parseCanonicalSectionBackground(content);
30889
+ switch (stored.kind) {
30890
+ case "none": return { kind: "none" };
30891
+ case "block-authored": return blockAuthoredPaint(stored.background);
30892
+ case "page-design-override": return overridePaint(stored);
30893
+ }
30894
+ }
30895
+ function blockAuthoredPaint(background) {
30896
+ if (background.type === "image" || background.type === "video") return { kind: "photo" };
30897
+ if (background.type === "gradient") return { kind: "gradient" };
30898
+ return background.type === "color" && background.color ? {
30899
+ kind: "colour",
30900
+ token: background.color
30901
+ } : { kind: "none" };
30902
+ }
30903
+ function overridePaint(stored) {
30904
+ const override = stored.parsed.kind === "supported" ? stored.parsed.override : null;
30905
+ if (override?.kind === "image") return { kind: "photo" };
30906
+ if (override?.kind === "gradient") return { kind: "gradient" };
30907
+ return override?.kind === "color" ? {
30908
+ kind: "colour",
30909
+ token: override.token
30910
+ } : { kind: "none" };
30330
30911
  }
30331
30912
  //#endregion
30332
30913
  //#region ../preview-next/src/client/blocks/BlockBackgroundChooser.tsx
@@ -30690,20 +31271,19 @@ function readBackgroundColorPaletteSnapshot() {
30690
31271
  /**
30691
31272
  * The block toolbar's state and actions on a style built from arrangement
30692
31273
  * Looks. Every change goes through the customise history the legacy controls
30693
- * use: Looks as set-look, modes as set-layout, knobs as set-block-facet and
30694
- * backgrounds as set-background. Null on a legacy style.
31274
+ * use: Looks as set-look, modes as set-layout, knobs as set-block-facet,
31275
+ * backgrounds as set-background and finishes as set-treatment. Null on a
31276
+ * legacy style.
30695
31277
  */
30696
31278
  function useArrangementToolbar(input) {
30697
31279
  const { designBlock, content } = input;
30698
- const backgrounds = usePreviewRenderBackgrounds();
30699
31280
  const controls = useMemo(() => designBlock ? arrangementBlockControlsFor({
30700
31281
  block: designBlock,
30701
31282
  content
30702
31283
  }) : null, [content, designBlock]);
30703
31284
  const background = designBlock ? arrangementBackgroundControlFor({
30704
31285
  block: designBlock,
30705
- content,
30706
- decidedBackground: backgrounds?.get(designBlock.blockId) ?? null
31286
+ content
30707
31287
  }) : null;
30708
31288
  const [modeNotice, setModeNotice] = useState(null);
30709
31289
  if (!designBlock || !controls) return null;
@@ -30742,12 +31322,43 @@ function useArrangementToolbar(input) {
30742
31322
  baseContentId
30743
31323
  });
30744
31324
  },
30745
- chooseSurface: (surfaceName) => {
30746
- const option = background?.kind === "surfaces" ? background.options.find((candidate) => candidate.name === surfaceName) : void 0;
30747
- if (surfaceName === null) input.chooseBackground({ kind: "default" });
30748
- else if (option) input.chooseBackground({
30749
- kind: "color",
30750
- token: option.token
31325
+ chooseGround: (name) => {
31326
+ if (background?.kind !== "grounds" || sectionColourRequestUnchanged(background.colour, name === null ? { kind: "style" } : {
31327
+ kind: "ground",
31328
+ name
31329
+ })) return;
31330
+ input.save({
31331
+ kind: "set-background",
31332
+ blockId: designBlock.blockId,
31333
+ override: name === null ? { kind: "default" } : {
31334
+ kind: "ground",
31335
+ name
31336
+ },
31337
+ baseContentId
31338
+ });
31339
+ },
31340
+ chooseColour: (token) => {
31341
+ if (background?.kind !== "grounds" || sectionColourRequestUnchanged(background.colour, {
31342
+ kind: "colour",
31343
+ token
31344
+ })) return;
31345
+ const offered = background.colourTokens.find((candidate) => candidate === token);
31346
+ if (offered) input.save({
31347
+ kind: "set-background",
31348
+ blockId: designBlock.blockId,
31349
+ override: {
31350
+ kind: "color",
31351
+ token: offered
31352
+ },
31353
+ baseContentId
31354
+ });
31355
+ },
31356
+ chooseTreatment: (treatment) => {
31357
+ input.save({
31358
+ kind: "set-treatment",
31359
+ blockId: designBlock.blockId,
31360
+ treatment,
31361
+ baseContentId
30751
31362
  });
30752
31363
  },
30753
31364
  editHeadline: () => input.openField(headlineFieldPath(designBlock.blockKind))
@@ -30811,7 +31422,8 @@ function ArrangementLookNote({ look, styleName }) {
30811
31422
  }), /* @__PURE__ */ jsx("span", { children: message })]
30812
31423
  });
30813
31424
  }
30814
- function ArrangementOptionsBody({ controls, styleName, background, onChooseKnob, onChooseSurface, onEditHeadline }) {
31425
+ function ArrangementOptionsBody({ controls, styleName, background, onChooseKnob, onEditHeadline }) {
31426
+ const shapes = controls.knobs.filter((control) => control.kind === "photo-shape");
30815
31427
  const choices = controls.knobs.filter((control) => control.kind === "choice");
30816
31428
  const flourishes = controls.knobs.filter((control) => control.kind === "text");
30817
31429
  return /* @__PURE__ */ jsxs(Fragment$1, { children: [
@@ -30819,17 +31431,20 @@ function ArrangementOptionsBody({ controls, styleName, background, onChooseKnob,
30819
31431
  length: controls.headlineHint.length,
30820
31432
  onEdit: onEditHeadline
30821
31433
  }) : null,
30822
- choices.length > 0 || background ? /* @__PURE__ */ jsxs("div", {
31434
+ shapes.map((control) => /* @__PURE__ */ jsx(PhotoShapeChoice, {
31435
+ control,
31436
+ styleName,
31437
+ onChoose: onChooseKnob
31438
+ }, control.facetId)),
31439
+ choices.length > 0 ? /* @__PURE__ */ jsx("div", {
30823
31440
  className: "space-y-3",
30824
- children: [choices.map((control) => /* @__PURE__ */ jsx(KnobChoice, {
31441
+ children: choices.map((control) => /* @__PURE__ */ jsx(KnobChoice, {
30825
31442
  control,
30826
31443
  styleName,
30827
31444
  onChoose: onChooseKnob
30828
- }, control.facetId)), background ? /* @__PURE__ */ jsx(SectionBackgroundChoice, {
30829
- background,
30830
- onChoose: onChooseSurface
30831
- }) : null]
31445
+ }, control.facetId))
30832
31446
  }) : null,
31447
+ background,
30833
31448
  flourishes.length > 0 ? /* @__PURE__ */ jsxs("div", {
30834
31449
  className: "space-y-3",
30835
31450
  children: [/* @__PURE__ */ jsx("p", {
@@ -30842,6 +31457,108 @@ function ArrangementOptionsBody({ controls, styleName, background, onChooseKnob,
30842
31457
  }) : null
30843
31458
  ] });
30844
31459
  }
31460
+ /**
31461
+ * "Photo shape": eight drawn tiles in two rows. While the style picks, its
31462
+ * shape shows chosen; a shape chosen here offers the way back to the default.
31463
+ */
31464
+ function PhotoShapeChoice({ control, styleName, onChoose }) {
31465
+ const styleDefault = control.value === "default";
31466
+ const shown = styleDefault ? control.styleShape : control.options.find((option) => option.value === control.value)?.value ?? null;
31467
+ return /* @__PURE__ */ jsxs("div", {
31468
+ className: "space-y-2",
31469
+ "data-photo-shape": "",
31470
+ children: [
31471
+ /* @__PURE__ */ jsx("div", {
31472
+ className: "text-sm font-semibold leading-5 text-foreground",
31473
+ children: control.label
31474
+ }),
31475
+ /* @__PURE__ */ jsx(PreviewTileGroup, {
31476
+ label: control.label,
31477
+ size: "tile",
31478
+ columns: 4,
31479
+ value: shown,
31480
+ onValueChange: (shape) => {
31481
+ if (shape !== control.value) onChoose(control, shape);
31482
+ },
31483
+ options: control.options.map((option) => ({
31484
+ value: option.value,
31485
+ label: option.label,
31486
+ preview: /* @__PURE__ */ jsx(PhotoShapeDrawing, { shape: option.value })
31487
+ }))
31488
+ }),
31489
+ styleDefault ? /* @__PURE__ */ jsx("p", {
31490
+ className: "text-[12.5px] text-muted-foreground",
31491
+ children: "Your site style picks this shape."
31492
+ }) : /* @__PURE__ */ jsxs("p", {
31493
+ className: "text-[12.5px] leading-snug text-muted-foreground",
31494
+ children: [
31495
+ "Chosen for this section.",
31496
+ " ",
31497
+ /* @__PURE__ */ jsx(Button, {
31498
+ variant: "link",
31499
+ size: "sm",
31500
+ className: "h-auto p-0 text-[12.5px]",
31501
+ onClick: () => onChoose(control, "default"),
31502
+ children: "Use default shape"
31503
+ })
31504
+ ]
31505
+ }),
31506
+ control.notOffered ? /* @__PURE__ */ jsxs("p", {
31507
+ className: "text-[11px] text-muted-foreground",
31508
+ children: [
31509
+ control.notOffered.by === "style" ? styleName : "This Look",
31510
+ " doesn’t offer ",
31511
+ control.notOffered.choice,
31512
+ ", so it shows ",
31513
+ control.notOffered.shows,
31514
+ "."
31515
+ ]
31516
+ }) : null
31517
+ ]
31518
+ });
31519
+ }
31520
+ /** A plain hillside photo cut to a shape, as the catalogue draws it. */
31521
+ function PhotoShapeDrawing({ shape }) {
31522
+ const { aspectRatio, ...cut } = photoShapeDrawing(shape);
31523
+ return /* @__PURE__ */ jsx("span", {
31524
+ className: "flex h-full w-full items-center justify-center bg-muted/40 p-[12%]",
31525
+ children: /* @__PURE__ */ jsx("span", {
31526
+ className: "block max-h-full overflow-hidden",
31527
+ style: {
31528
+ ...cut,
31529
+ aspectRatio: aspectRatio ?? "1 / 1",
31530
+ height: "100%"
31531
+ },
31532
+ children: /* @__PURE__ */ jsxs("svg", {
31533
+ viewBox: "0 0 100 100",
31534
+ preserveAspectRatio: "xMidYMid slice",
31535
+ className: "block h-full w-full",
31536
+ children: [
31537
+ /* @__PURE__ */ jsx("rect", {
31538
+ width: "100",
31539
+ height: "100",
31540
+ fill: "#e9d9bf"
31541
+ }),
31542
+ /* @__PURE__ */ jsx("circle", {
31543
+ cx: "68",
31544
+ cy: "34",
31545
+ r: "10",
31546
+ fill: "#e8b886"
31547
+ }),
31548
+ /* @__PURE__ */ jsx("path", {
31549
+ d: "M0 70 C20 54 40 52 60 62 S90 66 100 58 V100 H0 Z",
31550
+ fill: "#72765c",
31551
+ opacity: "0.75"
31552
+ }),
31553
+ /* @__PURE__ */ jsx("path", {
31554
+ d: "M0 82 C24 72 48 74 70 82 S94 86 100 80 V100 H0 Z",
31555
+ fill: "#5b5f48"
31556
+ })
31557
+ ]
31558
+ })
31559
+ })
31560
+ });
31561
+ }
30845
31562
  function HeadlineHint({ length, onEdit }) {
30846
31563
  return /* @__PURE__ */ jsxs("p", {
30847
31564
  className: "flex gap-1.5 rounded-md bg-muted/60 p-2 text-xs leading-4",
@@ -30990,70 +31707,6 @@ function KnobText({ control, onChange }) {
30990
31707
  })
30991
31708
  ] });
30992
31709
  }
30993
- const STYLE_BACKGROUND_VALUE = "style";
30994
- const surfaceValue = (name) => `surface:${name}`;
30995
- /**
30996
- * The section background as one menu row. Each choice shows the colour it
30997
- * paints in this site's palette; the style's own choice shows the colour the
30998
- * page rhythm gives this section.
30999
- */
31000
- function SectionBackgroundChoice({ background, onChoose }) {
31001
- const id = React.useId();
31002
- const colours = useSiteColourVariables();
31003
- if (background.kind === "held-by-photo") return /* @__PURE__ */ jsx(LookControlRow, {
31004
- label: "Background",
31005
- labelId: `${id}-label`,
31006
- description: null,
31007
- children: /* @__PURE__ */ jsx("span", {
31008
- className: "text-right text-xs text-muted-foreground",
31009
- children: background.photo === "section-photo" ? "Uses your style’s background while the section has a photo" : "Uses the section’s photo"
31010
- })
31011
- });
31012
- const rhythmColour = background.rhythm ? siteColourCss(colours, background.rhythm.token) : null;
31013
- return /* @__PURE__ */ jsx(LookControlRow, {
31014
- label: "Background",
31015
- labelId: `${id}-label`,
31016
- description: null,
31017
- children: /* @__PURE__ */ jsxs(Select, {
31018
- value: background.selected === null ? STYLE_BACKGROUND_VALUE : surfaceValue(background.selected),
31019
- onValueChange: (value) => onChoose(value === STYLE_BACKGROUND_VALUE ? null : value.slice(surfaceValue("").length)),
31020
- children: [/* @__PURE__ */ jsx(SelectTrigger, {
31021
- size: "sm",
31022
- "aria-labelledby": `${id}-label`,
31023
- className: lookMenuTriggerClass,
31024
- children: /* @__PURE__ */ jsx(SelectValue, {})
31025
- }), /* @__PURE__ */ jsxs(SelectContent, {
31026
- align: "end",
31027
- children: [/* @__PURE__ */ jsxs(SelectItem, {
31028
- value: STYLE_BACKGROUND_VALUE,
31029
- children: [/* @__PURE__ */ jsx(BackgroundSwatch, {
31030
- colour: rhythmColour,
31031
- fallback: `linear-gradient(135deg, ${siteColourCss(colours, "background")} 50%, ${siteColourCss(colours, "muted")} 50%)`
31032
- }), /* @__PURE__ */ jsx("span", {
31033
- className: "min-w-0 truncate",
31034
- children: "Chosen by your site style"
31035
- })]
31036
- }), background.options.map((option) => /* @__PURE__ */ jsxs(SelectItem, {
31037
- value: surfaceValue(option.name),
31038
- children: [/* @__PURE__ */ jsx(BackgroundSwatch, {
31039
- colour: siteColourCss(colours, option.token),
31040
- fallback: null
31041
- }), /* @__PURE__ */ jsx("span", {
31042
- className: "min-w-0 truncate",
31043
- children: option.label
31044
- })]
31045
- }, option.name))]
31046
- })]
31047
- })
31048
- });
31049
- }
31050
- function BackgroundSwatch({ colour, fallback }) {
31051
- return /* @__PURE__ */ jsx("span", {
31052
- "aria-hidden": "true",
31053
- className: "size-4 shrink-0 rounded-[5px] border border-border",
31054
- style: colour ? { backgroundColor: colour } : fallback ? { backgroundImage: fallback } : void 0
31055
- });
31056
- }
31057
31710
  /** Matches the sidebar's field labels, so Look controls read as part of the form. */
31058
31711
  const lookControlLabelClass = "mb-1.5 text-sm font-semibold leading-5 text-foreground";
31059
31712
  /** The chosen value truncates rather than overflowing a narrow sidebar. */
@@ -31071,12 +31724,160 @@ function arrangementLookNote(look, styleName) {
31071
31724
  }
31072
31725
  }
31073
31726
  //#endregion
31727
+ //#region ../preview-next/src/client/blocks/blockParts.tsx
31728
+ /**
31729
+ * The marked part an event landed on, inside this block. Text the editor
31730
+ * edits in place is never a part, even inside a marked element: a click
31731
+ * there keeps editing it where it is.
31732
+ */
31733
+ function partAt(target, block) {
31734
+ if (!(target instanceof Element) || target.closest("[contenteditable=\"true\"]")) return null;
31735
+ const element = target.closest(`[${EDITOR_PART_ATTRIBUTE}]`);
31736
+ const fieldPath = element?.getAttribute(EDITOR_PART_ATTRIBUTE);
31737
+ return element && fieldPath && block.contains(element) ? {
31738
+ element,
31739
+ fieldPath
31740
+ } : null;
31741
+ }
31742
+ /**
31743
+ * The parts of a selected block on the canvas. The block's editing plan
31744
+ * decides which parts lead anywhere and what they're called; a part that
31745
+ * leads nowhere gets no frame, and a click on it is a click on the block.
31746
+ */
31747
+ function useBlockParts(input) {
31748
+ const { plan, blockElement, selected, openField } = input;
31749
+ const [chosen, setChosen] = useState(null);
31750
+ const hovered = useHoveredPart(plan, selected ? blockElement : null);
31751
+ const shownPart = useCallback((hit) => {
31752
+ const part = hit && plan ? canvasPartOf(plan, hit.fieldPath) : null;
31753
+ return hit && part ? {
31754
+ element: hit.element,
31755
+ part
31756
+ } : null;
31757
+ }, [plan]);
31758
+ const click = useCallback((hit) => {
31759
+ const shown = shownPart(hit);
31760
+ setChosen(shown);
31761
+ if (shown) openField(shown.part.path);
31762
+ return shown !== null;
31763
+ }, [openField, shownPart]);
31764
+ useEffect(() => {
31765
+ if (!selected) setChosen(null);
31766
+ }, [selected]);
31767
+ return {
31768
+ click,
31769
+ frames: selected && blockElement ? createPortal(/* @__PURE__ */ jsxs(Fragment$1, { children: [hovered && hovered.element !== chosen?.element ? /* @__PURE__ */ jsx(PartFrame, {
31770
+ block: blockElement,
31771
+ shown: hovered,
31772
+ state: "hover"
31773
+ }) : null, chosen ? /* @__PURE__ */ jsx(PartFrame, {
31774
+ block: blockElement,
31775
+ shown: chosen,
31776
+ state: "chosen"
31777
+ }) : null] }), blockElement) : null
31778
+ };
31779
+ }
31780
+ /** The part under the pointer while the block is selected, if it leads to a setting. */
31781
+ function useHoveredPart(plan, block) {
31782
+ const [hovered, setHovered] = useState(null);
31783
+ useEffect(() => {
31784
+ setHovered(null);
31785
+ if (!block || !plan) return;
31786
+ const over = (event) => {
31787
+ const hit = partAt(event.target, block);
31788
+ const part = hit ? canvasPartOf(plan, hit.fieldPath) : null;
31789
+ setHovered((current) => hit && part ? sameShownPart(current, hit.element, part) ?? {
31790
+ element: hit.element,
31791
+ part
31792
+ } : null);
31793
+ };
31794
+ const leave = () => setHovered(null);
31795
+ block.addEventListener("pointerover", over);
31796
+ block.addEventListener("pointerleave", leave);
31797
+ return () => {
31798
+ block.removeEventListener("pointerover", over);
31799
+ block.removeEventListener("pointerleave", leave);
31800
+ };
31801
+ }, [block, plan]);
31802
+ return hovered;
31803
+ }
31804
+ /** Keeps the same state while the pointer moves within one part, so nothing re-renders. */
31805
+ function sameShownPart(current, element, part) {
31806
+ return current && current.element === element && current.part.label === part.label ? current : null;
31807
+ }
31808
+ /**
31809
+ * The frame sits in a box over the part, placed inside the block (which the
31810
+ * selection frame already relies on being positioned). The box follows the
31811
+ * part as the page reflows, a carousel scrolls or slides by transform, or an
31812
+ * animation moves it.
31813
+ */
31814
+ function PartFrame({ block, shown, state }) {
31815
+ const box = usePartBox(block, shown.element);
31816
+ if (!box) return null;
31817
+ return /* @__PURE__ */ jsx("div", {
31818
+ style: {
31819
+ position: "absolute",
31820
+ pointerEvents: "none",
31821
+ zIndex: 10,
31822
+ ...box
31823
+ },
31824
+ "data-editor-part-box": shown.part.path,
31825
+ children: /* @__PURE__ */ jsx(EditorPartFrame, {
31826
+ label: shown.part.label,
31827
+ state
31828
+ })
31829
+ });
31830
+ }
31831
+ /**
31832
+ * Measured every frame while the frame is shown. Carousels and moving rows
31833
+ * move parts with transforms, which neither resize nor scroll anything, so
31834
+ * only watching for movement keeps the frame on its part. One frame is shown
31835
+ * at a time, and nothing re-renders unless the box changed.
31836
+ */
31837
+ function usePartBox(block, part) {
31838
+ const [box, setBox] = useState(null);
31839
+ useLayoutEffect(() => {
31840
+ let frame = 0;
31841
+ const measure = () => {
31842
+ const next = part.isConnected ? partBoxWithin(block, part) : null;
31843
+ setBox((current) => sameBox(current, next) ? current : next);
31844
+ frame = requestAnimationFrame(measure);
31845
+ };
31846
+ measure();
31847
+ return () => cancelAnimationFrame(frame);
31848
+ }, [block, part]);
31849
+ return box;
31850
+ }
31851
+ function sameBox(a, b) {
31852
+ if (a === null || b === null) return a === b;
31853
+ return a.top === b.top && a.left === b.left && a.width === b.width && a.height === b.height;
31854
+ }
31855
+ /**
31856
+ * Where the part is, measured from the block's padding edge, which its
31857
+ * absolutely placed children start from, in the block's own CSS pixels. The
31858
+ * preview zooms the page (CSS `zoom`), and screen measurements are after the
31859
+ * zoom, so they're scaled back before they become offsets inside the block.
31860
+ */
31861
+ function partBoxWithin(block, part) {
31862
+ const outer = block.getBoundingClientRect();
31863
+ const inner = part.getBoundingClientRect();
31864
+ const scale = block.offsetWidth > 0 && outer.width > 0 ? outer.width / block.offsetWidth : 1;
31865
+ return {
31866
+ top: (inner.top - outer.top) / scale - block.clientTop,
31867
+ left: (inner.left - outer.left) / scale - block.clientLeft,
31868
+ width: inner.width / scale,
31869
+ height: inner.height / scale
31870
+ };
31871
+ }
31872
+ //#endregion
31074
31873
  //#region ../preview-next/src/client/blocks/useBlockSelection.ts
31075
31874
  const PHONE_VIEWPORT_QUERY = "(max-width: 639px)";
31076
31875
  /**
31077
31876
  * Click to select: a click anywhere in the block selects it, so its controls
31078
- * stay put instead of only showing on hover. A click on an empty placeholder
31079
- * also opens the side panel on the field that fills it.
31877
+ * stay put instead of only showing on hover. The click also goes to
31878
+ * `onPart`, with the marked part it landed on (a heading, a button, a photo,
31879
+ * an empty placeholder), so the block can open that part's setting. When it
31880
+ * does, the click is the editor's and the site's own action doesn't run.
31080
31881
  *
31081
31882
  * A page section on a full event page is selected the same way, but its
31082
31883
  * template places it, so it's selected as a page section rather than as one
@@ -31086,8 +31887,8 @@ function useBlockSelection(input) {
31086
31887
  const probeRef = useRef(null);
31087
31888
  const selection = usePreviewSidebarNavigation();
31088
31889
  const selectBlock = input.kind === "pageSection" ? selection.selectPageSection : selection.selectBlock;
31089
- const onOpenFieldRef = useRef(input.onOpenField);
31090
- onOpenFieldRef.current = input.onOpenField;
31890
+ const onPartRef = useRef(input.onPart);
31891
+ onPartRef.current = input.onPart;
31091
31892
  const phone = useMediaQuery(PHONE_VIEWPORT_QUERY);
31092
31893
  const [blockElement, setBlockElement] = useState(null);
31093
31894
  useEffect(() => {
@@ -31096,8 +31897,9 @@ function useBlockSelection(input) {
31096
31897
  if (!block || !selectBlock) return;
31097
31898
  const handleClick = (event) => {
31098
31899
  selectBlock(input.blockId);
31099
- const fieldPath = (event.target instanceof Element ? event.target.closest("[data-placeholder-field]") : null)?.dataset.placeholderField;
31100
- if (fieldPath) onOpenFieldRef.current(fieldPath);
31900
+ if (!onPartRef.current(partAt(event.target, block))) return;
31901
+ event.preventDefault();
31902
+ event.stopPropagation();
31101
31903
  };
31102
31904
  block.addEventListener("click", handleClick);
31103
31905
  return () => block.removeEventListener("click", handleClick);
@@ -31136,6 +31938,7 @@ function BlockReadinessNote({ notice, element, blockName, onOpen }) {
31136
31938
  const Icon = warning ? TriangleAlert : EyeOff;
31137
31939
  const label = blockNoticeLabel(notice);
31138
31940
  return createPortal(/* @__PURE__ */ jsx("div", {
31941
+ "data-preview-readiness-note-host": "",
31139
31942
  className: "builder-dashboard-chrome-theme absolute left-4 top-4 z-20 max-w-[22rem] overflow-hidden rounded-md bg-background text-left font-sans shadow-md",
31140
31943
  children: /* @__PURE__ */ jsxs(Callout, {
31141
31944
  tone: warning ? "warning" : "default",
@@ -31199,7 +32002,7 @@ function insertionEdgeFor(input) {
31199
32002
  function useInsertionEdge(blockId) {
31200
32003
  return useEditorUiStore((state) => {
31201
32004
  const view = state.sidebarNavigation.view;
31202
- if (view.kind !== "addBlock" && view.kind !== "chooseLook") return null;
32005
+ if (!isAddingBlockView(view)) return null;
31203
32006
  if (!authoredValuesEqual(view.anchor.owner, state.structure.getOwner())) return null;
31204
32007
  const blocks = state.structure.getList();
31205
32008
  return insertionEdgeFor({
@@ -31250,7 +32053,7 @@ function revealWhenShown(marker) {
31250
32053
  //#endregion
31251
32054
  //#region ../preview-next/src/client/blocks/BlockToolbar.tsx
31252
32055
  function BlockToolbar(input) {
31253
- const { selection, controls, toolbar, open, openField, cycleSdk, cycleRecipe } = useBlockToolbar(input);
32056
+ const { selection, controls, toolbar, parts, open, openField, cycleSdk, cycleRecipe } = useBlockToolbar(input);
31254
32057
  const notice = useBlockNotice(input.blockId);
31255
32058
  const name = controls.manifest?.title ?? getBlockDefinition(input.blockKind)?.manifest.title ?? input.blockKind;
31256
32059
  const row = /* @__PURE__ */ jsxs(EditorCanvasChipRow, {
@@ -31282,6 +32085,7 @@ function BlockToolbar(input) {
31282
32085
  selected: selection.selected,
31283
32086
  element: selection.blockElement
31284
32087
  }),
32088
+ parts.frames,
31285
32089
  /* @__PURE__ */ jsx(BlockReadinessNote, {
31286
32090
  notice,
31287
32091
  element: selection.blockElement,
@@ -31312,9 +32116,10 @@ function useBlockToolbar(input) {
31312
32116
  const opener = useOpenBlockForSetup();
31313
32117
  const open = () => opener.open(editorBlockId);
31314
32118
  const openField = (fieldPath) => opener.openField(editorBlockId, fieldPath);
32119
+ const partClick = useRef(() => false);
31315
32120
  const selection = useBlockSelection({
31316
32121
  blockId: editorBlockId,
31317
- onOpenField: openField
32122
+ onPart: (hit) => partClick.current(hit)
31318
32123
  });
31319
32124
  const controls = useBlockCustomizeControls({
31320
32125
  blockId: editorBlockId,
@@ -31323,6 +32128,13 @@ function useBlockToolbar(input) {
31323
32128
  uiStore,
31324
32129
  theme: input.theme
31325
32130
  });
32131
+ const parts = useBlockParts({
32132
+ plan: controls.plan,
32133
+ blockElement: selection.blockElement,
32134
+ selected: selection.selected,
32135
+ openField
32136
+ });
32137
+ partClick.current = parts.click;
31326
32138
  const { state, applyAction } = usePreviewPageDesignEditorState();
31327
32139
  const toolbar = useArrangementToolbar({
31328
32140
  designBlock: controls.designBlock,
@@ -31332,7 +32144,6 @@ function useBlockToolbar(input) {
31332
32144
  save: (action) => {
31333
32145
  applyAction(action, { runtimeContent: values });
31334
32146
  },
31335
- chooseBackground: open,
31336
32147
  openField
31337
32148
  });
31338
32149
  const cycleSdk = (direction) => cycleSdkLook(controls, direction);
@@ -31345,6 +32156,7 @@ function useBlockToolbar(input) {
31345
32156
  selection,
31346
32157
  controls,
31347
32158
  toolbar,
32159
+ parts,
31348
32160
  open,
31349
32161
  openField,
31350
32162
  cycleSdk,
@@ -31427,6 +32239,8 @@ function pageSectionIdFromBlockId(blockId) {
31427
32239
  function sectionName(content) {
31428
32240
  return (typeof content.title === "string" ? content.title : typeof content.heading === "string" ? content.heading : "").trim() || "Page section";
31429
32241
  }
32242
+ /** A page section's parts are filled in from the dashboard, so none of them opens anything here. */
32243
+ const leadsNowhere = () => false;
31430
32244
  /**
31431
32245
  * A page section on a full event page (#1703 B4b). It can be selected, and
31432
32246
  * its chip opens the section's look in the sidebar. Nothing else here: the
@@ -31437,7 +32251,7 @@ function PageSectionToolbar({ blockId, content }) {
31437
32251
  const { openPageSection } = usePreviewSidebarNavigation();
31438
32252
  const selection = useBlockSelection({
31439
32253
  blockId: editorBlockId,
31440
- onOpenField: () => void 0,
32254
+ onPart: leadsNowhere,
31441
32255
  kind: "pageSection"
31442
32256
  });
31443
32257
  const name = sectionName(content);
@@ -31466,4 +32280,4 @@ function PageSectionToolbar({ blockId, content }) {
31466
32280
  ] });
31467
32281
  }
31468
32282
  //#endregion
31469
- export { SegmentedControl as A, EMPTY_DOC as C, resolveSdkFooterMode as D, decideDocumentReplacement as E, emitMediaCropDebug as F, resolveVideoSelectionIntentForMediaField as I, isSvgMimeType as L, ScrollableDialogShell as M, Surface as N, Switch as O, surfaceVariants as P, useRichTextEditor as S, InlineTextEditor as T, MediaPickerMiniDialog as _, ArrangementOptionsBody as a, getRichTextImagePositionFromTarget as b, BackgroundChooser as c, gradientLabel as d, readBackgroundColorPaletteSnapshot as f, MediaEditor as g, getUnresolvedRichTextImageWarnings as h, ArrangementLookNote as i, ScrollableDialogContent as j, ContentSpinner as k, BackgroundPreviewSwatch as l, useRichTextImageProjection as m, pageSectionIdFromBlockId as n, lookIsAutomatic as o, useSiteColourVariables as p, BlockToolbar as r, useArrangementToolbar as s, PageSectionToolbar as t, formatTokenLabel as u, MediaPickerMini as v, parseRichTextDoc as w, insertOrReplaceRichTextImage as x, RichTextEditorSurface as y };
32283
+ export { Switch as A, resolveVideoSelectionIntentForMediaField as B, useRichTextEditor as C, decideDocumentReplacement as D, InlineTextEditor as E, EditorNavRow as F, EditorViewHeader as I, Surface as L, SegmentedControl as M, ScrollableDialogContent as N, resolveSdkFooterMode as O, ScrollableDialogShell as P, surfaceVariants as R, insertOrReplaceRichTextImage as S, parseRichTextDoc as T, isSvgMimeType as V, MediaEditor as _, ArrangementOptionsBody as a, RichTextEditorSurface as b, BackgroundChooser as c, gradientLabel as d, readBackgroundColorPaletteSnapshot as f, getUnresolvedRichTextImageWarnings as g, useRichTextImageProjection as h, ArrangementLookNote as i, ContentSpinner as j, PreviewTileGroup as k, BackgroundPreviewSwatch as l, arrangementLookNameFor as m, pageSectionIdFromBlockId as n, lookIsAutomatic as o, arrangementBlockControlsFor as p, BlockToolbar as r, useArrangementToolbar as s, PageSectionToolbar as t, formatTokenLabel as u, MediaPickerMiniDialog as v, EMPTY_DOC as w, getRichTextImagePositionFromTarget as x, MediaPickerMini as y, emitMediaCropDebug as z };