@riverbankcms/sdk 0.173.0 → 0.174.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -1
- package/dist/_dts/{BlocksIslandsHydrator-O50mTMCY.d.ts → BlocksIslandsHydrator-GqVX3I8E.d.ts} +1 -1
- package/dist/_dts/{Page-Bk99sJwV.d.ts → Page-BhUH31M-.d.ts} +27 -16
- package/dist/_dts/{SdkPreviewMode-DzAue6Kj.d.ts → SdkPreviewMode-DBn2x0UL.d.ts} +14 -7
- package/dist/_dts/{client-ZlNEIvlU.d.ts → client-Cr-sOeSl.d.ts} +1 -1
- package/dist/_dts/{content-types-DBXPNc0h.d.ts → content-types-DKw1yJdN.d.ts} +2 -2
- package/dist/_dts/{contracts-D9bhu0bb.d.ts → contracts-CJ2O03nB.d.ts} +5 -4
- package/dist/_dts/{footerPageOutline-Bfap3soN.d.ts → footerPageOutline-DoGHHKr_.d.ts} +6 -6
- package/dist/_dts/{generatePageMetadata-DwCdg31h.d.ts → generatePageMetadata-CJGu4hoa.d.ts} +2 -2
- package/dist/_dts/{index-C611wjIL.d.ts → index--39uLjrr.d.ts} +1 -1
- package/dist/_dts/{index-CJzs-yIJ.d.ts → index-3GzargmS.d.ts} +2 -2
- package/dist/_dts/{index-Dq_AboWN.d.ts → index-Bq-488M7.d.ts} +1 -1
- package/dist/_dts/{index-KXh8FQ2s.d.ts → index-DQZ5L0Gb.d.ts} +2 -2
- package/dist/_dts/{index-DutLU2d2.d.ts → index-DYlfdT1O.d.ts} +2 -1
- package/dist/_dts/{index-BnatulTs.d.ts → index-DYsP4k6S.d.ts} +3 -3
- package/dist/_dts/{index-DW3eeNph.d.ts → index-DdEi2iXd.d.ts} +4 -4
- package/dist/_dts/{loadContent-Bde2y870.d.ts → loadContent-BVPagYmy.d.ts} +11 -11
- package/dist/_dts/{request-Bysk4QPI.d.ts → request-Be1E-H-V.d.ts} +3559 -1967
- package/dist/_dts/{resolveBlockData-ChbNvpSF.d.ts → resolveBlockData-D1pL25bD.d.ts} +5 -5
- package/dist/_dts/{resolvePageContent-CGa6QMgc.d.ts → resolvePageContent-B4sbTf96.d.ts} +2 -2
- package/dist/_dts/sdk/src/bookings/index.d.ts +2 -2
- package/dist/_dts/sdk/src/client/types.d.ts +2 -2
- package/dist/_dts/sdk/src/client.d.ts +9 -9
- package/dist/_dts/sdk/src/config/index.d.ts +6 -6
- package/dist/_dts/sdk/src/config/template-validation.d.ts +1 -1
- package/dist/_dts/sdk/src/config/validation.d.ts +1 -1
- package/dist/_dts/sdk/src/data/dataLoaderContext.d.ts +2 -2
- package/dist/_dts/sdk/src/data/resolveBlockData.d.ts +1 -1
- package/dist/_dts/sdk/src/data/types.d.ts +2 -2
- package/dist/_dts/sdk/src/index.d.ts +8 -8
- package/dist/_dts/sdk/src/manifest/index.d.ts +3 -3
- package/dist/_dts/sdk/src/metadata/index.d.ts +1 -1
- package/dist/_dts/sdk/src/navigation/index.d.ts +3 -3
- package/dist/_dts/sdk/src/next/index.d.ts +7 -7
- package/dist/_dts/sdk/src/next/middleware.d.ts +2 -2
- package/dist/_dts/sdk/src/page-converter/index.d.ts +3 -3
- package/dist/_dts/sdk/src/portal/client.d.ts +4 -2
- package/dist/_dts/sdk/src/prebuild/index.d.ts +1 -1
- package/dist/_dts/sdk/src/preview-next/before-render.d.ts +2 -2
- package/dist/_dts/sdk/src/preview-next/client/index.d.ts +2 -2
- package/dist/_dts/sdk/src/preview-next/client/runtime.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/client.d.ts +2 -2
- package/dist/_dts/sdk/src/rendering/components/pageShared.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/helpers/loadPage.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/helpers/pageRuntimeSupport.d.ts +13 -8
- package/dist/_dts/sdk/src/rendering/index.d.ts +6 -6
- package/dist/_dts/sdk/src/rendering/islands/client.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/server.d.ts +2 -2
- package/dist/_dts/sdk/src/rendering/themeAdmission.d.ts +1 -1
- package/dist/_dts/sdk/src/routing/index.d.ts +5 -5
- package/dist/_dts/sdk/src/server.d.ts +5 -5
- package/dist/_dts/sdk/src/spam-protection/index.d.ts +2 -2
- package/dist/_dts/sdk/src/theme/index.d.ts +36 -204
- package/dist/_dts/{types-BwitGNTl.d.ts → types-5MeDI1w8.d.ts} +7 -7
- package/dist/_dts/{types-BoEk9ZON.d.ts → types-Bm5_3VEd.d.ts} +3 -3
- package/dist/_dts/{types-kpp8XyXv.d.ts → types-CVoCc_Ia.d.ts} +2 -2
- package/dist/_dts/{validation-ChftKX-o.d.ts → validation-lEtYD-Rh.d.ts} +4 -4
- package/dist/client/{BlocksIslandsHydrator-BnUeSE3d.mjs → BlocksIslandsHydrator-DkflFLGQ.mjs} +17 -17
- package/dist/client/{BookingMailingListNote-LHQMODqB.mjs → BookingMailingListNote-CAyoiAGD.mjs} +10 -10
- package/dist/client/{BookingPanelArrangement-Be704P85.mjs → BookingPanelArrangement-C7yiJrxm.mjs} +1 -1
- package/dist/client/{BookingQuestionFields-BewbU_cV.mjs → BookingQuestionFields-DZMrGvBh.mjs} +3 -3
- package/dist/client/{CalendarNavigationChevron-BMZp3RS3.mjs → CalendarNavigationChevron-BPQU5Snc.mjs} +6 -6
- package/dist/client/{DemoBookingPortalAccess-CARUWQ_E.mjs → DemoBookingPortalAccess-BnEgvJas.mjs} +5 -5
- package/dist/client/{EventCalendar.client-CaI6upCX.mjs → EventCalendar.client-BiWQc28-.mjs} +9 -9
- package/dist/client/{EventCombined.client-CoRUaYHY.mjs → EventCombined.client-B_ytWQtn.mjs} +7 -7
- package/dist/client/{EventItem-Doe4KodB.mjs → EventItem-C-mxXpX_.mjs} +4 -4
- package/dist/client/{EventListWeekNavigation-CXWLKDfa.mjs → EventListWeekNavigation-Bm3Ap1Rd.mjs} +1 -1
- package/dist/client/{EventListing.client-DvJ5tGTx.mjs → EventListing.client-Bs_8im5_.mjs} +3 -3
- package/dist/client/{EventListing.view-BmfyK7S5.mjs → EventListing.view-CN7BjGgC.mjs} +6 -6
- package/dist/client/{EventRegistrationPayment-DwMlJB2V.mjs → EventRegistrationPayment-DPkRcSdw.mjs} +11 -10
- package/dist/client/{LocationMapActions-CdRPU6gp.mjs → LocationMapActions-BJT7MqP2.mjs} +1 -1
- package/dist/client/{MapDrawingSvg-DCLtxOnt.mjs → MapDrawingSvg-DCIwlON6.mjs} +1 -1
- package/dist/client/{Page-D46Dmr7b.mjs → Page--xJ23nA5.mjs} +629 -494
- package/dist/client/{StepIndicator-CrSZCZn1.mjs → StepIndicator-D391QRNc.mjs} +9 -8
- package/dist/client/{accessibleSurfaces-D4DhWo9j.mjs → accessibleSurfaces-DN8it_Cx.mjs} +35 -7
- package/dist/client/{accordion-P8xcfKxq.mjs → accordion-BQtTkDN8.mjs} +1 -1
- package/dist/client/{bookability-SargNwlO.mjs → bookability-CE637yDE.mjs} +1 -1
- package/dist/client/{booking-form.client-BM2s-NqR.mjs → booking-form.client-D9M7TKGV.mjs} +362 -47
- package/dist/client/{bookingForm-JnaZPZge.mjs → bookingForm-BsOS0sl9.mjs} +4 -4
- package/dist/client/bookings.mjs +6 -6
- package/dist/client/{boxStyleClassNames-Cahps5kR.mjs → boxStyleClassNames-CNDLpT06.mjs} +1 -1
- package/dist/client/{carousel-CQQ_m0KA.mjs → carousel-CPsW-FPh.mjs} +1 -1
- package/dist/client/{cart-0Q4fjw_K.mjs → cart-CwElmocm.mjs} +3 -3
- package/dist/client/{cart.client-BI0IaHX3.mjs → cart.client-RpqI56w8.mjs} +1 -1
- package/dist/client/{checkout-1J-3ftxF.mjs → checkout-CfMgqY8H.mjs} +3 -3
- package/dist/client/{checkout.client-DOGYDlDk.mjs → checkout.client-BpuPyOuJ.mjs} +1 -1
- package/dist/client/{checkoutUrls-CwHqcqzP.mjs → checkoutUrls-VeHY6WYj.mjs} +1 -1
- package/dist/client/client.mjs +158 -7
- package/dist/client/{context-D0KCgbOq.mjs → context-CNlesLfF.mjs} +1 -1
- package/dist/client/{course-CmOuoZHN.mjs → course-q1sA4Cj-.mjs} +2 -2
- package/dist/client/{creditProducts-BTRX4edc.mjs → creditProducts-KYMVIH3J.mjs} +2 -84
- package/dist/client/{dateFormatting-Dmfaczzq.mjs → dateFormatting-B73Ll0s4.mjs} +9 -1
- package/dist/client/{demoPortalMagicLink-CL7KGRta.mjs → demoPortalMagicLink-BVbLD4pi.mjs} +1 -1
- package/dist/client/{display-lL-YRApN.mjs → display-D8MW2b0e.mjs} +618 -397
- package/dist/client/{enhanceHeaderSection-B-eLGs2C.mjs → enhanceHeaderSection-BzjY6AiY.mjs} +3 -3
- package/dist/client/{event-details.client-DH1-Jxsh.mjs → event-details.client-CseTWUFC.mjs} +1 -1
- package/dist/client/{event-registration.client-GuuElczW.mjs → event-registration.client-b5TLxntR.mjs} +11 -11
- package/dist/client/{eventCalendar-BiCINPkV.mjs → eventCalendar-C-kJNIc9.mjs} +4 -4
- package/dist/client/{eventCombined-BtzmH6FW.mjs → eventCombined-BgHJGhwE.mjs} +4 -4
- package/dist/client/{eventDetails-BJpAD10-.mjs → eventDetails-CAwbreD0.mjs} +2 -2
- package/dist/client/{eventListing-jLB8iRqp.mjs → eventListing-_14atrj8.mjs} +4 -4
- package/dist/client/{eventRegistration-WhtpDEbq.mjs → eventRegistration-BOqSdstJ.mjs} +4 -4
- package/dist/client/{form-DO6qKH3M.mjs → form-DfAB-llc.mjs} +3 -3
- package/dist/client/{form.client-D12ljYiX.mjs → form.client-DN-I9_qC.mjs} +6 -6
- package/dist/client/{form.parts-C8QHaQOI.mjs → form.parts-t2Q1neM6.mjs} +1 -1
- package/dist/client/{formatDate-BnhfIpCa.mjs → formatDate-Dp7POa9Y.mjs} +1 -1
- package/dist/client/gifting/client.mjs +2 -2
- package/dist/client/{headerSection-BtFWtoUm.mjs → headerSection-Dces54pb.mjs} +2 -2
- package/dist/client/{newsletter-form.client-oHrqM_Ao.mjs → newsletter-form.client-D_YFUlR2.mjs} +9 -7
- package/dist/client/{newsletter-form.parts-D5U-FuVy.mjs → newsletter-form.parts-URO5Mn_I.mjs} +1 -1
- package/dist/client/{newsletterForm-CBYbFxSx.mjs → newsletterForm-_c9fKIzS.mjs} +3 -3
- package/dist/client/{noop-CN0o0yjH.mjs → noop-D5mFWXtN.mjs} +30 -6
- package/dist/client/portal/client.mjs +346 -272
- package/dist/client/{product-detail.client-d_sNCapC.mjs → product-detail.client-CVW1UIxJ.mjs} +1 -1
- package/dist/client/{product-list.client-DkSpw6WQ.mjs → product-list.client-CF9hO23G.mjs} +1 -1
- package/dist/client/{productDetail-DaqM-LgL.mjs → productDetail-C_qbmUuP.mjs} +3 -3
- package/dist/client/{productList-CMx4-XlG.mjs → productList-Df5qDD0z.mjs} +3 -3
- package/dist/client/{propsDecoder-BZbUKstC.mjs → propsDecoder-BiEyK2ii.mjs} +3 -3
- package/dist/client/{registry.server-Cdot3dMk.mjs → registry.server-ClcfWpvM.mjs} +28 -26
- package/dist/client/rendering/client.mjs +26 -26
- package/dist/client/rendering/islands.mjs +1 -1
- package/dist/client/rendering.mjs +17 -13
- package/dist/client/{richText-coerce-ByApwB4q.mjs → richText-coerce-C32cRQ03.mjs} +1 -1
- package/dist/client/{routeIslandApiConfig-DTET8f__.mjs → routeIslandApiConfig-DAypPzSo.mjs} +1 -1
- package/dist/client/{runtimeResponse-IkOwKZD0.mjs → runtimeResponse-9v8q2NBc.mjs} +1 -1
- package/dist/client/runtimeResponse-CVkM0dHy.mjs +3 -0
- package/dist/client/{shop-commerce-oDR76k1q.mjs → shop-commerce-Bw4_BXQg.mjs} +12 -12
- package/dist/client/{shop-commerce-store-DjoUpL3a.mjs → shop-commerce-store-Da6Ah-_4.mjs} +1 -1
- package/dist/client/{shop-discount-apply.state-WsGb9DD8.mjs → shop-discount-apply.state-DidgH7ow.mjs} +2 -2
- package/dist/client/{shop-Cy6xXDM7.mjs → shop-gteEpeO5.mjs} +3 -3
- package/dist/client/{shop.client-Brha4BSM.mjs → shop.client-CbbdjWWd.mjs} +13 -13
- package/dist/client/{shop.interactive-CXhYl0DW.mjs → shop.interactive-CKFORzux.mjs} +13 -20
- package/dist/client/{shopShared-JCa_SRhP.mjs → shopShared-C7QjoywZ.mjs} +2 -2
- package/dist/client/{timetableModel-CZeJwMxP.mjs → timetableModel-CtZiIj9q.mjs} +24 -14
- package/dist/client/{useAvailableSlots-DfbSkWop.mjs → useAvailableSlots-CUVRD1nx.mjs} +24 -4
- package/dist/client/{useDiscountApply-Dq-wjb1d.mjs → useDiscountApply-BZU5DWZQ.mjs} +1 -1
- package/dist/client/{useDiscountCodeUi-Cyy0meCH.mjs → useDiscountCodeUi-BuLgof7O.mjs} +1 -1
- package/dist/client/{useEventPagination-CCAGQHsD.mjs → useEventPagination-B4VPtSEF.mjs} +6 -6
- package/dist/client/{view-Sw075FOY.mjs → view-CvlTplao.mjs} +2 -2
- package/dist/client/{view-D6yebI4r.mjs → view-CxUpgcM6.mjs} +12 -10
- package/dist/preview-next/client/{LocationPickerEnvironment-D4F_5rnr.mjs → LocationPickerEnvironment-8iKKoYZr.mjs} +1 -1
- package/dist/preview-next/client/{MapLibreEditMap-BKMNxSEJ.mjs → MapLibreEditMap-AIUPN1Zx.mjs} +2 -2
- package/dist/preview-next/client/{PageSectionToolbar-DG2rXUmo.mjs → PageSectionToolbar-BFbSrDbi.mjs} +57 -144
- package/dist/preview-next/client/{PreviewEditorSidebar-BDY5vdHU.mjs → PreviewEditorSidebar-BtpzqQ-i.mjs} +758 -1279
- package/dist/preview-next/client/{PreviewEditorUI-CqZCfOaz.mjs → PreviewEditorUI-z22h-CCY.mjs} +29 -26
- package/dist/preview-next/client/{PreviewShell-Bv2HZ7JY.mjs → PreviewShell-BW3Qpoa_.mjs} +50 -30
- package/dist/preview-next/client/{SdkPreviewModeRuntime-BMTcR-MW.mjs → SdkPreviewModeRuntime-BvVeK1hR.mjs} +47 -19
- package/dist/preview-next/client/{lucide-react-BCNn8dEQ.mjs → lucide-react-Dfgl3Vtq.mjs} +7 -1
- package/dist/preview-next/client/{previewAssistantSlot-La6MerV_.mjs → previewAssistantSlot-BUqAh1FL.mjs} +100626 -51720
- package/dist/preview-next/client/{previewChromeRoot-BcOQqJIP.mjs → previewChromeRoot-NCy5zHO8.mjs} +1 -1
- package/dist/preview-next/client/runtime.mjs +3 -3
- package/dist/preview-next/client/{sdk-runtime-BkckHox4.mjs → sdk-runtime-CxmKDVGZ.mjs} +2 -2
- package/dist/preview-next/client/siteStyleAccess-B_UaDyJO.mjs +9356 -0
- package/dist/preview-next/client/{useAutosaveStatus-CPAHgGqI.mjs → useAutosaveStatus-BqmWvPLY.mjs} +2 -2
- package/dist/preview-next/client/{useOpenBlockForSetup-BDkuSZxQ.mjs → useOpenBlockForSetup-LAllV0rU.mjs} +8 -4
- package/dist/preview-next/container-responsive.css +117 -32
- package/dist/preview-next/keepAlive.mjs +1 -1
- package/dist/preview-next/middleware.mjs +1 -1
- package/dist/preview-next/{route-contract-CPV30ABr.mjs → route-contract-DV6SeCNv.mjs} +152 -2
- package/dist/server/{Block.shared-BaMMstO1.mjs → Block.shared-Ch2FKAvU.mjs} +10 -5
- package/dist/server/{ThemeScopeCore-D1NTXZdX.mjs → ThemeScopeCore-DFvjDVzi.mjs} +23 -6
- package/dist/server/{accessibleSurfaces-Dbd2__Le.mjs → accessibleSurfaces-CM3QANtw.mjs} +22 -5
- package/dist/server/{bindings-Dge4sqel.mjs → bindings-CQg2lzZn.mjs} +6 -4
- package/dist/server/{client-VVIQjC4r.mjs → client-aYRTVneD.mjs} +155 -4
- package/dist/server/config-validation.mjs +1 -1
- package/dist/server/config.mjs +2 -2
- package/dist/server/customCss-BGB8gMVb.mjs +210 -0
- package/dist/server/data/resolveBlockData.mjs +1 -1
- package/dist/server/index.mjs +2 -2
- package/dist/server/{loadContent-BIJb3WAK.mjs → loadContent-Cgpfr44e.mjs} +8 -9
- package/dist/server/{loadPage-DjTU19y7.mjs → loadPage-RDk10NMP.mjs} +3 -3
- package/dist/server/lookMediaFrame-CQtkvlDn.mjs +2528 -0
- package/dist/server/manifest.mjs +2 -2
- package/dist/server/next.mjs +9 -8
- package/dist/server/{overrideResolution-1Ru3NMQj.mjs → overrideResolution-VhhN94d8.mjs} +3 -4
- package/dist/server/page-converter.mjs +2 -2
- package/dist/server/{pageRenderPlan-CytPhrI9.mjs → pageRenderPlan-CkFTsxkd.mjs} +25 -17
- package/dist/server/{pageRuntimeSupport-DWspU5EZ.mjs → pageRuntimeSupport-CpAtzNxD.mjs} +14 -6
- package/dist/server/{pageShared-Bhx8bVe1.mjs → pageShared-B8yLPjs0.mjs} +371 -56
- package/dist/server/{parseThemeForPersistence-CtgRtvo3.mjs → parseThemeForPersistence-Cwqb5pZx.mjs} +2 -2
- package/dist/server/{portal-Ce1Prfl3.mjs → portal-BjVHMAUC.mjs} +1 -1
- package/dist/server/portal.mjs +1 -1
- package/dist/server/{prebuild-BjvFb0CA.mjs → prebuild-DOu6QceG.mjs} +1 -1
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/{prefetchBlockData-Db3stNpp.mjs → prefetchBlockData-CfOXFKYG.mjs} +2 -2
- package/dist/server/{registry-BMCfcev6.mjs → registry-34rkAfaU.mjs} +608 -3131
- package/dist/server/rendering/components/pageShared.mjs +1 -1
- package/dist/server/rendering/helpers/loadPage.mjs +1 -1
- package/dist/server/rendering/helpers/pageRuntimeSupport.mjs +2 -2
- package/dist/server/rendering/server.mjs +3 -3
- package/dist/server/rendering.mjs +7 -7
- package/dist/server/{resolveBlockData--yUbI-Ll.mjs → resolveBlockData-D7VeoWgr.mjs} +1 -1
- package/dist/server/{resolveButtonColourStates-CCPUY9Xh.mjs → resolveButtonColourStates--6yJp9Tq.mjs} +15 -4
- package/dist/server/{schema-D5Vfmqzw.mjs → schema-CUDHMirj.mjs} +46 -153
- package/dist/server/server.mjs +3 -3
- package/dist/server/{src-Cxucn-1P.mjs → src-DHK4JUlp.mjs} +4 -1
- package/dist/server/theme-bridge.mjs +21 -15
- package/dist/server/theme.mjs +2 -2
- package/dist/server/{three-pass-converter-Bsfdy_ZV.mjs → three-pass-converter-39SXCCnh.mjs} +1 -1
- package/dist/server/{titleSourceSchema-DwKJfMYb.mjs → titleSourceSchema-Cu-3PRvv.mjs} +0 -1
- package/dist/server/{validation-EgTtnTcY.mjs → validation-CLVKoJrX.mjs} +4 -4
- package/dist/server/{version-LjgU0Cq1.mjs → version-HVfdvBJ0.mjs} +1 -1
- package/dist/styles/index.css +935 -271
- package/package.json +1 -1
- package/dist/client/runtimeResponse-Wd6kwhE_.mjs +0 -3
- package/dist/preview-next/client/SiteChromeCustomizeButton-D1MGyN_Z.mjs +0 -55403
- package/dist/server/customCss-QymcmOZ-.mjs +0 -97
- package/dist/server/opaqueSurface-COEKXVwk.mjs +0 -54
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { n as __exportAll } from "./rolldown-runtime-CE6sIgz8.mjs";
|
|
3
|
-
import { $
|
|
4
|
-
import { $ as EllipsisVertical, A as LoaderCircle, B as ImageOff, E as Maximize2, G as FileText,
|
|
5
|
-
import { $ as
|
|
3
|
+
import { $ as useFooterComposerState, $a as getGeneratedBlockIconStyleState, $c as Button$1, $i as FEATURE_CARD_GENERATED_ICON_SIZE_PX, $l as mediaIdentifierSchema, $n as readSliderFieldUiConfig, $o as getGradientPreset, $s as DialogFooter, $t as listEntryPageContentSlots, $u as formatDateTime, A as usePreviewJoinOutcome, Ai as resolveImageUrlWithContext, An as lifecycleOutcomeMessage, Ao as sectionPhotoPresence, At as toRoutableLinkPayload, Au as knownSocialPlatformLabels, Bc as useId$1, Bn as withoutServerVersions, Bs as extractApiEnvelopeErrorDetails, Bt as derivePromotedFieldPlan, Bu as displayedValues, C as pageDesignLookTiles, Ci as toggleEventType, Cl as resolveButtonStyleSelection, Cn as recoveryConflictCopy, Co as DEFAULT_THEME_RESPONSIVE_MODE, Cs as normalizeRepeaterGridSpan, Cu as DEFAULT_MAILING_LIST_TARGETING, Ds as resolveRepeaterGridColumnsForBreakpoint, Dt as sendPageCommand, Du as parseMailchimpAudienceId, El as buttonStyleSelectionKey, Eo as resolveVisiblePromotedFieldPathsForEditorBlock, Es as resolveRepeaterGridBreakpointForWidth, Eu as parseBrevoListId, F as lookTilePosition, Fc as Arrow$1, Fi as buildResolveImageUrlContext, Fr as siblingPath$2, Ft as NewsletterFormClient, Gc as useDirection, Gi as normalizeOfferingsPreviewGroupOrder, Gn as createManifestFormAdapter, Go as getCuratedSiteStyle, Gt as hasVisibilityConditions, Gu as createEditorInsertBlockCommand, Hc as useFocusGuards, Hl as parseAspectRatioValue, Ho as defaultPolicyPageFlowPresetId, Ht as evaluateVisibility, Hu as pristineValueSync, I as lookTilesFor, Ic as Content$1, Il as paletteValueKey, Io as getHeaderLayout, Ir as withValueAtPath, Is as OPERATION_ID_HEADER, J as footerLayoutSelection, Jn as getFieldDefault, Jo as palettesForSiteStyle, Js as CalloutTitle, Jt as createBlock, Ju as editorBlockCollectionOwnerKey, Ka as admitLayoutGridForPlan, Kc as createCollection, Kl as mediaSchema, Kn as createManifestValidation, Ks as Callout, Kt as isNonEmptyValue, Ku as createEditorRemoveBlockCommand, La as BLOCK_BUTTON_ROLE_OPTIONS, Lc as Root2$1, Lo as getHeaderStyle, Lt as useImageResolveContextOptional, M as usePreviewRenderReadiness, Mc as Presence, Mt as updateFooterComposition, Mu as parsePublicProfile, Nc as Portal$1, Ni as resolveMediaSlot, Nt as footerCreditLine, Nu as publicProfileWeekdays, Oc as hideOthers, Oi as computeMediaTransformStyle, Os as resolveBlockTitle, Ot as missingReceiptError, Ou as parseMailchimpInterestId, Pc as Anchor, Pi as resolveMediaSlotContract, Pr as getAtPath, Pu as publishedContactDetails, Q as useFooterAuthoringOptional, Qa as getBlockIconSemanticId, Qi as themeRuntimeScopeProps, Ql as PUBLIC_FILE_FIELD_KINDS, Qn as readNumberFieldUiConfig, Qo as GRADIENT_PRESETS, Qs as DialogDescription$1, Qt as isSurfaceSlotBlockTarget, Qu as formatDate, R as selectedLookTile, Ra as isBlockButtonRole, Rc as createPopperScope, Ro as concretePaletteFromTheme, Rt as FormNodeClient, Si as readEventSelectionChips, Sl as findButtonStyleRecipe, Sn as useSidebarView, Ss as isRepeaterGridLayoutInvalid, Su as parseMailingListPlacementTargeting, Tl as updateButtonStyleSelectionChoice, Tn as unfinishedBlockCopy, Ts as resolveRepeaterGridAcceptedSpans, Tt as LeaseNoticeButtons, U as usePreviewAuth, Uc as DismissableLayer, Ui as inferLegacyOfferingsPreviewGroupOrder, Ul as resolveMediaTransformForAspect, Us as sidebarReturnView, Ut as getFieldIntent, Uu as syncStateOf, Vc as FocusScope, Vn as deriveEditorValuePublicationState, Vs as unwrapResponse, Vt as collectVisibleWhenWatchPaths, Vu as knownRevision, Wi as isOfferingsPreviewSourceKey, Wl as getDirectImageUrlForMediaAsset, Wn as initialBlockDraftValues, Wt as getWidgetKey, Wu as valueStatus, X as resolveFooterEngagementPreview, Xc as composeEventHandlers, Xi as buildThemeDataAttrs, Xn as normalizeFieldForCanonicalValidation, Xs as DialogClose, Xt as deleteBlock, Xu as unsafeAsEditorBlockId, Y as resolveFooterEngagementAuthoringState, Ya as isRichTextDoc, Yc as createContextScope, Yi as resolveOfferingsPreviewGroupOrderEntries, Yn as getRepeaterItemDefault, Ys as Dialog, Yt as createSlotBlock, Yu as editorBlockCollectionOwnersEqual, Z as FooterComposerProvider, Za as sanitizeHref, Zc as Primitive, Zn as getGroupChildFields, Zo as gradientToCss, Zs as DialogContent, Zt as deleteSlotBlock, Zu as unsafeAsEditorBlockValues, _l as resolveRepeaterGridRowFieldId, _n as resolveContentTitle, _s as buildRepeaterGridDropTargets, aa as toFeatureCardIconSuggestionInputs, ad as assertNever$1, ao as coerceInlineTextWithFallback, as as defaultSectionTransitionVariantForFamily, at as readFooterEngagementDraft, b as buildPageDesignEditorReadModelForBlocks, bi as chooseAllEvents, bl as buttonStyleHoverPreferenceValue, bn as useEditorUiStoreInstance, bo as buildThemeRuntime, bs as findFirstAvailableRepeaterGridPlacement, bu as unsafeAsFooterModuleId, cl as useShallow, cr as planBackgroundTransition, cs as sectionTransitionVariantForBoundaryOptionId, cu as generateUuidV4, d as cycleSiteChromeSelectionId, dd as expectParsedBrandedId, dl as canWriteLinkedEntry, dt as DONE, du as assessMailingListTargeting, ea as createFeatureCardIconKey, ec as DialogHeader, ed as parseBookingLocalDate, el as buttonVariants, en as listPageSurfaceContentSlots, eo as parseBlockIconValue, es as buildFontPreviewUrl, eu as asRecord, fc as Content, fl as readLinkedEntryLease, fs as appearancePresets, ft as runHeldLifecycle, fu as resolveMailingListDefaultDestination, gl as resolveRepeaterGridColumnFieldId, gn as resolvePageRouteSlug, gs as planLayoutGridColumnEdit, gu as parseFooterCompositionV1, hl as isAcceptedRepeaterGridSpan, hn as deriveRouteMetadataPresentation, ho as plainTextToInlineText, hs as isInternalResolvedLinkValue, hu as normalizeLegacyFooterContentToV1, i as usePreviewSidebarNavigation, ia as suggestSemanticIconForFeatureCard, id as toUtcIsoDateTimeString, in as blocksKeys, ir as imagePoolForOverride, is as findCuratedPalette, it as footerPartKey, jt as publishContentEntry, ju as knownSocialPlatforms, ki as resolveImageSourceSetWithContext, kt as footerMenuNavigationFacts, ku as parseNewsletterListId, li as getBlockDefinition, lr as rankBackgroundImagePoolItems, lt as useEntryController, lu as slugify$1, mc as Trigger$1, mi as buildNewsletterFormInteractiveIslandProps, mn as routeLifecycleContext, mu as deriveFooterEditorOverview, n as usePreviewAssistantSlot, na as parseFeatureCardGeneratedIconSizePx, nc as DialogTrigger, nd as resolveBookingTimeZoneId, nl as cva, nn as reorderSlotBlocks, no as parseGeneratedIconSetId, nt as footerHeaderStatus, nu as isBodyFontFamily, o as usePreviewPageDesignEditorState, od as parseMediaAssetId, ol as useComposedRefs, on as getDashboardUrl, or as parseBackgroundOverrideFromContent, os as sectionTransitionFamilies, ot as footerEngagementEventFields, pc as Root$2, pl as canEditorWrite, pt as useServerRefresh, pu as mailingListProviderName, q as buildFooterRuntimeViewModel, qa as deriveFieldValidationPlan, qc as useControllableState, qi as planOfferingPreviewCardSelection, ql as runtimeMediaSchema, qn as manifestFieldSectionOptions, qo as offeredSiteStyles, qs as CalloutDescription, qt as partitionFieldsByIntent, qu as createEditorReorderBlocksCommand, ra as resolveFeatureCardGeneratedIconSizePx, rd as parseUtcIsoDateTimeString, rl as createSlot, rn as withSlotCompositionHash, ro as parseSiteIconStyleGuideVersionId, rr as enabledBackgroundModes, rt as footerEngagementStarted, ru as asAppearancePresetId, s as usePreviewPageDesignRenderState, sc as DialogDescription, sl as cn, ss as sectionTransitionFamilyForBoundaryOptionId, st as parseFooterEngagementDraft, su as authoredValuesEqual, ta as getFeatureCardIconCompletion, tc as DialogTitle$1, td as resolveBookingBusinessTimeZone, tn as reorderBlocks, to as parseGeneratedIconAssetId, tr as canCycleBackgroundOverrideValue, u as useSiteChromeCustomizeOptional, uc as DialogTitle, ud as parseSiteId, ui as listBlockDescriptors, ul as isEdited, un as ApiRequestError, uo as inlineTextToPlainText, ur as resolveBackgroundCapability, v as useLiveFooterRuntime, va as buildFormInteractiveIslandProps, vc as usePortalContainer, vi as EVENT_SELECTION_SCOPE_OPTIONS, vl as resolveRepeaterGridSpanFieldId, vn as planLeaseNotice, vs as planRepeaterGridSpanChange, vu as resolveFooterSections, w as setPageDesignBlockBackground, wi as writeEventSelectionChips, wl as updateButtonStyleHoverPreference, ws as planRepeaterGridStartNewRow, wt as LeaseDiscardedNoticeView, wu as mailingListTargetingChoiceIds, xi as chooseScheduleScope, xl as buttonStyleSelectionParameterValue, xs as flowRepeaterGridItems, xu as planFooterLayout, yc as ReactRemoveScroll, yi as EVENT_SELECTION_TYPE_OPTIONS, yl as siteOptionSources, yn as useEditorUiStore, yo as parseFieldDefinition, ys as projectRepeaterGridLayout, yu as setFooterSectionSelected, zc as useSize, zl as isRotationDimensionSwap, zn as toEditorBlockItem, zo as concretePaletteToTheme, zt as BlockApiProvider } from "./previewAssistantSlot-BUqAh1FL.mjs";
|
|
4
|
+
import { $ as EllipsisVertical, A as LoaderCircle, B as ImageOff, E as Maximize2, G as FileText, Kt as err, L as Image, O as Lock, P as Link2, R as ImageUp, S as Palette, U as GripVertical, Z as EyeOff, _t as Box$1, b as PanelTop, bt as ArrowUpRight, c as Trash2, d as SlidersHorizontal, dt as ChevronRight, f as Settings, ft as ChevronLeft, g as RotateCcw, ht as Calendar$1, i as Video, it as Clock3, lt as CircleAlert, m as Rows3, mt as Check, n as X$1, nt as Copy, pt as ChevronDown, qt as ok, rt as Clock, s as TriangleAlert, t as lucide_react_exports, tt as Crop, u as Sparkles, v as Plus, x as PanelBottom, xt as ArrowDown, y as Pencil, yt as ArrowUp, z as ImagePlus } from "./lucide-react-Dfgl3Vtq.mjs";
|
|
5
|
+
import { $ as FieldFrame, B as useSiteOptionWidgetContext, Ct as clamp, D as SiteFontFaceStyles, Dt as Input, Et as NativeSelect, Ft as Content$2, H as useMediaEditor, It as List, J as SelectField, K as BlockContextProvider, L as siteColourCss, Lt as Root2$2, Mt as TabsContent, Nt as TabsList, Ot as FIELD_FOCUS_WITHIN_CLASS, Pt as TabsTrigger, Q as unmapValueFromSelect, R as locationWidgetOverrides, Rt as Trigger$2, St as usePrevious$1, Tt as FieldTrigger, X as mapCurrentValueForSelect, Y as hasEmptyOption, Z as mapOptionValueForSelect, _t as Select$1, at as ThemeScopeCore, bt as SelectTrigger, c as resolvePreviewSidebarChromeModel, d as dashboardLogoSettingsHref, et as FieldLabelText, f as HeaderMenuControls, gt as Textarea, i as resolvePreviewDashboardSetupHandoff, it as revealEditorElement, jt as Tabs, k as useRememberSiteFonts, kt as FIELD_SURFACE_CLASS, m as CustomizeBackgroundControlRows, mt as ChoiceTileGroup, nt as useField, o as resolvePreviewEditorGuidanceModel, p as isHeaderMenuSurfaceState, pt as CHOSEN_OPTION_CLASS, q as useBlockContext, r as buildPreviewDashboardSetupUrl, rt as useLinkedInlineTextField, t as canInspectSiteStyle, tt as hintWithCharacterLimit, u as SiteChromeSurfaceControls, vt as SelectContent, wt as SearchInput, xt as SelectValue, yt as SelectItem, z as SiteOptionWidgetProvider, zt as classifyKnownMimeType } from "./siteStyleAccess-B_UaDyJO.mjs";
|
|
6
6
|
import { J as paletteTokenNameSchema, V as hexColorSchema, W as paletteColorEntries, c as isKnownIconName, i as ThemedButtonSpecimen, l as isIconPickerPreset, o as getIconComponent, s as getIconPickerOptionsForPreset, tt as VARIANT_ROLES, u as resolveIconPickerPreset } from "./ThemedButton-CVYz7h68.mjs";
|
|
7
|
-
import { A as ScrollableDialogContent, C as EMPTY_DOC, D as resolveSdkFooterMode, F as resolveVideoSelectionIntentForMediaField, I as isSvgMimeType, M as Surface, N as surfaceVariants, P as emitMediaCropDebug, S as useRichTextEditor, T as InlineTextEditor, _ as MediaPickerMiniDialog, a as ArrangementOptionsBody, b as getRichTextImagePositionFromTarget, c as BackgroundChooser, d as gradientLabel, f as readBackgroundColorPaletteSnapshot, g as MediaEditor, h as getUnresolvedRichTextImageWarnings, i as ArrangementLookNote, j as ScrollableDialogShell, k as
|
|
7
|
+
import { A as ScrollableDialogContent, C as EMPTY_DOC, D as resolveSdkFooterMode, F as resolveVideoSelectionIntentForMediaField, I as isSvgMimeType, M as Surface, N as surfaceVariants, O as Switch, P as emitMediaCropDebug, S as useRichTextEditor, T as InlineTextEditor, _ as MediaPickerMiniDialog, a as ArrangementOptionsBody, b as getRichTextImagePositionFromTarget, c as BackgroundChooser, d as gradientLabel, f as readBackgroundColorPaletteSnapshot, g as MediaEditor, h as getUnresolvedRichTextImageWarnings, i as ArrangementLookNote, j as ScrollableDialogShell, k as SegmentedControl, l as BackgroundPreviewSwatch, m as useRichTextImageProjection, n as pageSectionIdFromBlockId, o as lookIsAutomatic, p as useSiteColourVariables, s as useArrangementToolbar, u as formatTokenLabel, v as MediaPickerMini, x as insertOrReplaceRichTextImage, y as RichTextEditorSurface } from "./PageSectionToolbar-BFbSrDbi.mjs";
|
|
8
8
|
import { n as TZDate } from "./src-DzXUmsyK.mjs";
|
|
9
|
-
import { i as useOptionalLocationPickerEnvironment, n as LocationPickerEnvironmentProvider } from "./LocationPickerEnvironment-
|
|
10
|
-
import { a as publicationLabel, o as Spinner, s as Separator, t as useAutosaveStatus } from "./useAutosaveStatus-
|
|
11
|
-
import { A as Tooltip, C as blockLookOwnedFieldPaths, D as showRawStyleFields, E as prepareBlockEditorManifest, F as DropdownMenu, H as DropdownMenuTrigger, I as DropdownMenuContent, L as DropdownMenuItem, M as TooltipProvider, N as TooltipTrigger, O as getBlockManifestFromSdkConfig, P as Badge, S as arrangementVisibilityValues, T as hideThemeV2RawStyleFields, V as DropdownMenuSeparator, _ as createFieldObservation, b as arrangementLookResolution, f as arrangementBlockControlsFor, g as isRecord$1, h as isObjectRecord, i as NEEDS_SETUP_LABEL, j as TooltipContent, k as mergeBlockDescriptors, l as needsSetupOf, m as createStoreBackend, n as resolveBlockManifest, o as blockNoticeLabel, p as arrangementLookNameFor, r as useBlockCustomizeControls, s as blockNoticeMessage, u as useBlockNotice, v as SdkConfigProvider, w as lookNotShownFieldIds, x as arrangementOwnedFieldIds, y as useSdkConfig } from "./useOpenBlockForSetup-
|
|
9
|
+
import { i as useOptionalLocationPickerEnvironment, n as LocationPickerEnvironmentProvider } from "./LocationPickerEnvironment-8iKKoYZr.mjs";
|
|
10
|
+
import { a as publicationLabel, o as Spinner, s as Separator, t as useAutosaveStatus } from "./useAutosaveStatus-BqmWvPLY.mjs";
|
|
11
|
+
import { A as Tooltip, C as blockLookOwnedFieldPaths, D as showRawStyleFields, E as prepareBlockEditorManifest, F as DropdownMenu, H as DropdownMenuTrigger, I as DropdownMenuContent, L as DropdownMenuItem, M as TooltipProvider, N as TooltipTrigger, O as getBlockManifestFromSdkConfig, P as Badge, S as arrangementVisibilityValues, T as hideThemeV2RawStyleFields, V as DropdownMenuSeparator, _ as createFieldObservation, b as arrangementLookResolution, f as arrangementBlockControlsFor, g as isRecord$1, h as isObjectRecord, i as NEEDS_SETUP_LABEL, j as TooltipContent, k as mergeBlockDescriptors, l as needsSetupOf, m as createStoreBackend, n as resolveBlockManifest, o as blockNoticeLabel, p as arrangementLookNameFor, r as useBlockCustomizeControls, s as blockNoticeMessage, u as useBlockNotice, v as SdkConfigProvider, w as lookNotShownFieldIds, x as arrangementOwnedFieldIds, y as useSdkConfig } from "./useOpenBlockForSetup-LAllV0rU.mjs";
|
|
12
12
|
import * as React$1 from "react";
|
|
13
13
|
import React, { Fragment, createContext, forwardRef, memo, useCallback, useContext, useEffect, useId, useImperativeHandle, useLayoutEffect, useMemo, useReducer, useRef, useState, useSyncExternalStore } from "react";
|
|
14
14
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -105,12 +105,12 @@ const CollapsibleTrigger = React$1.forwardRef(({ className, ...props }, ref) =>
|
|
|
105
105
|
...props
|
|
106
106
|
}));
|
|
107
107
|
CollapsibleTrigger.displayName = Trigger$1.displayName;
|
|
108
|
-
const CollapsibleContent = React$1.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(Content
|
|
108
|
+
const CollapsibleContent = React$1.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(Content, {
|
|
109
109
|
ref,
|
|
110
110
|
className: cn(["data-[state=closed]:overflow-hidden data-[state=open]:overflow-visible data-[state=closed]:h-0 data-[state=open]:h-auto", "data-[state=closed]:animate-collapsible-up data-[state=open]:animate-collapsible-down"].join(" "), className),
|
|
111
111
|
...props
|
|
112
112
|
}));
|
|
113
|
-
CollapsibleContent.displayName = Content
|
|
113
|
+
CollapsibleContent.displayName = Content.displayName;
|
|
114
114
|
//#endregion
|
|
115
115
|
//#region ../ui/src/editor-item-card-actions.tsx
|
|
116
116
|
/**
|
|
@@ -3216,7 +3216,7 @@ var PopoverContentImpl = React$1.forwardRef((props, forwardedRef) => {
|
|
|
3216
3216
|
onFocusOutside,
|
|
3217
3217
|
onDismiss: () => context.onOpenChange(false),
|
|
3218
3218
|
deferPointerDownOutside: true,
|
|
3219
|
-
children: /* @__PURE__ */ jsx(Content, {
|
|
3219
|
+
children: /* @__PURE__ */ jsx(Content$1, {
|
|
3220
3220
|
"data-state": getState(context.open),
|
|
3221
3221
|
role: "dialog",
|
|
3222
3222
|
id: context.contentId,
|
|
@@ -9706,7 +9706,7 @@ function createLayoutGridColumnEditBackend(backend, fields, base = "") {
|
|
|
9706
9706
|
}
|
|
9707
9707
|
//#endregion
|
|
9708
9708
|
//#region ../block-form/src/widgets/TextField/TextField.tsx
|
|
9709
|
-
function TextField
|
|
9709
|
+
function TextField({ path, backend, config }) {
|
|
9710
9710
|
const { value, error, setValue } = useField(path, backend);
|
|
9711
9711
|
return /* @__PURE__ */ jsx(FieldFrame, {
|
|
9712
9712
|
fieldPath: path,
|
|
@@ -9714,6 +9714,7 @@ function TextField$1({ path, backend, config }) {
|
|
|
9714
9714
|
required: config.required,
|
|
9715
9715
|
description: config.description,
|
|
9716
9716
|
error: error?.message,
|
|
9717
|
+
hint: hintWithCharacterLimit(value ?? "", config.maxLength),
|
|
9717
9718
|
children: ({ id }) => config.multiline ? /* @__PURE__ */ jsx(Textarea, {
|
|
9718
9719
|
id,
|
|
9719
9720
|
value: value ?? "",
|
|
@@ -11041,6 +11042,17 @@ function getDefaultValue(field) {
|
|
|
11041
11042
|
return getFieldDefault(field, { resolve: getDefaultValue });
|
|
11042
11043
|
}
|
|
11043
11044
|
//#endregion
|
|
11045
|
+
//#region ../block-form/src/widgets/RepeaterField/utils/addButtonNoun.ts
|
|
11046
|
+
/**
|
|
11047
|
+
* "Add button", "Add image": the item's name in sentence case after the verb.
|
|
11048
|
+
* A name that starts with an acronym ("FAQ") keeps its capitals.
|
|
11049
|
+
*/
|
|
11050
|
+
function addButtonNoun(itemLabel) {
|
|
11051
|
+
const label = itemLabel ?? "item";
|
|
11052
|
+
const [first = "", second = ""] = label;
|
|
11053
|
+
return second !== "" && second === second.toLowerCase() && second !== second.toUpperCase() ? first.toLowerCase() + label.slice(1) : label;
|
|
11054
|
+
}
|
|
11055
|
+
//#endregion
|
|
11044
11056
|
//#region ../block-form/src/widgets/RepeaterField/utils/buildItemLabel.ts
|
|
11045
11057
|
const UUID_LIKE_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
|
11046
11058
|
function getStringValue$1(value) {
|
|
@@ -11105,6 +11117,13 @@ function deriveLabelFromItem(itemFields, itemValue, sourceFieldId) {
|
|
|
11105
11117
|
}
|
|
11106
11118
|
return null;
|
|
11107
11119
|
}
|
|
11120
|
+
/** Nothing typed or chosen, however deep: what a row is before anyone's touched it. */
|
|
11121
|
+
function isBlankValue(value) {
|
|
11122
|
+
if (value == null) return true;
|
|
11123
|
+
if (typeof value === "string") return value.trim().length === 0;
|
|
11124
|
+
if (Array.isArray(value)) return value.every(isBlankValue);
|
|
11125
|
+
return typeof value === "object" && Object.values(value).every(isBlankValue);
|
|
11126
|
+
}
|
|
11108
11127
|
function buildItemLabel(field, index, backend, basePath) {
|
|
11109
11128
|
const itemValue = backend.getValue(`${basePath}.${index}`);
|
|
11110
11129
|
const normalizedItemValue = itemValue && typeof itemValue === "object" && !Array.isArray(itemValue) ? itemValue : null;
|
|
@@ -11116,9 +11135,12 @@ function buildItemLabel(field, index, backend, basePath) {
|
|
|
11116
11135
|
const label = sourceField ? readFieldDisplayValue(sourceField, value) : getStringValue$1(value);
|
|
11117
11136
|
if (label) return label;
|
|
11118
11137
|
}
|
|
11119
|
-
|
|
11120
|
-
|
|
11121
|
-
|
|
11138
|
+
return deriveLabelFromItem(itemFields, normalizedItemValue, source) ?? unnamedItemLabel(field, itemFields, normalizedItemValue, index);
|
|
11139
|
+
}
|
|
11140
|
+
/** A row with no words to show: "New question" until it has any, then "Question 2". */
|
|
11141
|
+
function unnamedItemLabel(field, itemFields, itemValue, index) {
|
|
11142
|
+
const itemLabel = field.itemLabel ?? "Item";
|
|
11143
|
+
return itemFields.length > 0 && itemFields.every((child) => isBlankValue(itemValue?.[child.id])) ? `New ${addButtonNoun(itemLabel)}` : `${itemLabel} ${index + 1}`;
|
|
11122
11144
|
}
|
|
11123
11145
|
//#endregion
|
|
11124
11146
|
//#region ../block-form/src/widgets/RepeaterField/utils/getRepeaterItemFields.ts
|
|
@@ -11880,58 +11902,6 @@ function RepeaterRowActions(props) {
|
|
|
11880
11902
|
return /* @__PURE__ */ jsx(EditorItemCardActions, { ...buildRepeaterRowActions(props) });
|
|
11881
11903
|
}
|
|
11882
11904
|
//#endregion
|
|
11883
|
-
//#region ../api/src/navigation/routableLink.ts
|
|
11884
|
-
/**
|
|
11885
|
-
* Prefer identifier-based links when available so links survive route/path updates.
|
|
11886
|
-
* Falls back to an internal route payload for legacy rows or incomplete data.
|
|
11887
|
-
*/
|
|
11888
|
-
function toRoutableLinkPayload(item) {
|
|
11889
|
-
switch (item.entityType) {
|
|
11890
|
-
case "page":
|
|
11891
|
-
if (item.identifier) return {
|
|
11892
|
-
kind: "page",
|
|
11893
|
-
identifier: item.identifier
|
|
11894
|
-
};
|
|
11895
|
-
return toResolvedInternalPayload(item);
|
|
11896
|
-
case "content":
|
|
11897
|
-
if (item.identifier && item.contentTypeKey) return {
|
|
11898
|
-
kind: "entry",
|
|
11899
|
-
contentType: item.contentTypeKey,
|
|
11900
|
-
identifier: item.identifier
|
|
11901
|
-
};
|
|
11902
|
-
return toResolvedInternalPayload(item);
|
|
11903
|
-
case "pageSurface": return toResolvedInternalPayload(item);
|
|
11904
|
-
default: return assertNever$1(item);
|
|
11905
|
-
}
|
|
11906
|
-
}
|
|
11907
|
-
function toResolvedInternalPayload(item) {
|
|
11908
|
-
return {
|
|
11909
|
-
kind: "internal",
|
|
11910
|
-
routeId: item.routeId,
|
|
11911
|
-
entityId: item.entityId,
|
|
11912
|
-
entityType: item.entityType,
|
|
11913
|
-
href: item.path ?? "/",
|
|
11914
|
-
title: item.title ?? item.draftTitle ?? "Untitled",
|
|
11915
|
-
typeLabel: item.typeLabel,
|
|
11916
|
-
contentTypeKey: item.contentTypeKey,
|
|
11917
|
-
contentTypeName: item.contentTypeName,
|
|
11918
|
-
updatedAt: item.updatedAt ?? null
|
|
11919
|
-
};
|
|
11920
|
-
}
|
|
11921
|
-
//#endregion
|
|
11922
|
-
//#region ../api/src/navigation.ts
|
|
11923
|
-
async function getNavigationMenus(apiClient, { siteId, options }) {
|
|
11924
|
-
try {
|
|
11925
|
-
return unwrapResponse(await apiClient({
|
|
11926
|
-
endpoint: "getNavigationMenus",
|
|
11927
|
-
params: { siteId },
|
|
11928
|
-
options
|
|
11929
|
-
}));
|
|
11930
|
-
} catch (error) {
|
|
11931
|
-
normalizeApiError(error, "Failed to fetch navigation menus");
|
|
11932
|
-
}
|
|
11933
|
-
}
|
|
11934
|
-
//#endregion
|
|
11935
11905
|
//#region ../media-editor/src/fieldUi.ts
|
|
11936
11906
|
function withRepeaterThumbnailMediaFieldUi(field, options) {
|
|
11937
11907
|
if (!field || field.type !== "media") return null;
|
|
@@ -13142,17 +13112,6 @@ function RepeaterLayoutGrid({ config, backend, basePath, items, minItems, onMove
|
|
|
13142
13112
|
});
|
|
13143
13113
|
}
|
|
13144
13114
|
//#endregion
|
|
13145
|
-
//#region ../block-form/src/widgets/RepeaterField/utils/addButtonNoun.ts
|
|
13146
|
-
/**
|
|
13147
|
-
* "Add button", "Add image": the item's name in sentence case after the verb.
|
|
13148
|
-
* A name that starts with an acronym ("FAQ") keeps its capitals.
|
|
13149
|
-
*/
|
|
13150
|
-
function addButtonNoun(itemLabel) {
|
|
13151
|
-
const label = itemLabel ?? "item";
|
|
13152
|
-
const [first = "", second = ""] = label;
|
|
13153
|
-
return second !== "" && second === second.toLowerCase() && second !== second.toUpperCase() ? first.toLowerCase() + label.slice(1) : label;
|
|
13154
|
-
}
|
|
13155
|
-
//#endregion
|
|
13156
13115
|
//#region ../block-form/src/widgets/RepeaterField/components/RepeaterThumbnailGrid.tsx
|
|
13157
13116
|
function getGridClassName(density) {
|
|
13158
13117
|
if (density === "compact") return "grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3";
|
|
@@ -21554,7 +21513,7 @@ function InlineTextControl({ path, config, value, error, onChange }) {
|
|
|
21554
21513
|
* These live in @riverbankcms/editor-blocks and are passed via FormRenderer.widgetOverrides.
|
|
21555
21514
|
*/
|
|
21556
21515
|
const WIDGET_COMPONENTS = {
|
|
21557
|
-
text: TextField
|
|
21516
|
+
text: TextField,
|
|
21558
21517
|
inlineText: InlineTextField$1,
|
|
21559
21518
|
number: NumberField,
|
|
21560
21519
|
select: SelectField,
|
|
@@ -21865,6 +21824,7 @@ function FormRendererContent(input) {
|
|
|
21865
21824
|
});
|
|
21866
21825
|
return props.blockKind ? /* @__PURE__ */ jsx(BlockContextProvider, {
|
|
21867
21826
|
blockKind: props.blockKind,
|
|
21827
|
+
mediaFrame: props.visibilityValues?.mediaFrame,
|
|
21868
21828
|
children: content
|
|
21869
21829
|
}) : content;
|
|
21870
21830
|
}
|
|
@@ -25905,20 +25865,37 @@ function UnreadableMediaField({ config }) {
|
|
|
25905
25865
|
children: /* @__PURE__ */ jsx(UnreadableMediaWarning, {})
|
|
25906
25866
|
});
|
|
25907
25867
|
}
|
|
25868
|
+
/** Derive the photo editor's presentation without changing its stored content. */
|
|
25869
|
+
function imageFieldPresentation(config, path, values, context) {
|
|
25870
|
+
const { blockKind, mediaFrame } = context ?? {};
|
|
25871
|
+
const { contract: slot, galleryFrame: frame } = resolveMediaSlot({
|
|
25872
|
+
blockKind,
|
|
25873
|
+
fieldPath: path,
|
|
25874
|
+
values,
|
|
25875
|
+
fieldAspectRatio: config.aspectRatio,
|
|
25876
|
+
fieldUi: config.ui,
|
|
25877
|
+
lookMediaFrame: mediaFrame
|
|
25878
|
+
});
|
|
25879
|
+
return {
|
|
25880
|
+
...editorPresentation(config),
|
|
25881
|
+
allowedKinds: config.mediaKinds ?? ["image"],
|
|
25882
|
+
previewAspectRatio: slot.edit.mode === "fixed-aspect" ? parseAspectRatioValue(slot.edit.aspectRatio) : void 0,
|
|
25883
|
+
previewBorderRadius: frame?.borderRadius,
|
|
25884
|
+
minSourceWidth: slot.edit.minSourceWidth,
|
|
25885
|
+
minSourceHeight: slot.edit.minSourceHeight,
|
|
25886
|
+
cropEditorMode: config.ui?.cropEditorMode ?? "dialog",
|
|
25887
|
+
cropEditorAutoOpen: config.ui?.cropEditorAutoOpen === true,
|
|
25888
|
+
videoPrepIntent: videoPrepIntentForMediaField(path, config.mediaKinds),
|
|
25889
|
+
videoSelectionIntent: videoSelectionIntentForMediaField(path, config.mediaKinds)
|
|
25890
|
+
};
|
|
25891
|
+
}
|
|
25908
25892
|
function MediaField(props) {
|
|
25909
25893
|
const { config, path, backend } = props;
|
|
25910
25894
|
const { admission, setValue } = useAdmittedField(props);
|
|
25911
25895
|
const blockContext = useBlockContext();
|
|
25912
25896
|
if (admission.kind === "unreadable") return /* @__PURE__ */ jsx(UnreadableMediaField, { config });
|
|
25913
25897
|
const { value } = admission;
|
|
25914
|
-
const
|
|
25915
|
-
blockKind: blockContext?.blockKind,
|
|
25916
|
-
fieldPath: path,
|
|
25917
|
-
values: asRecord(backend.getValues()),
|
|
25918
|
-
fieldAspectRatio: config.aspectRatio,
|
|
25919
|
-
fieldUi: config.ui
|
|
25920
|
-
});
|
|
25921
|
-
const previewAspectRatio = slot.edit.mode === "fixed-aspect" ? parseAspectRatioValue(slot.edit.aspectRatio) : void 0;
|
|
25898
|
+
const presentation = imageFieldPresentation(config, path, asRecord(backend.getValues()), blockContext);
|
|
25922
25899
|
const onChange = (next) => {
|
|
25923
25900
|
emitMediaCropDebug("MediaField", "change", {
|
|
25924
25901
|
path,
|
|
@@ -25937,15 +25914,7 @@ function MediaField(props) {
|
|
|
25937
25914
|
]),
|
|
25938
25915
|
value,
|
|
25939
25916
|
onChange,
|
|
25940
|
-
...
|
|
25941
|
-
allowedKinds: config.mediaKinds ?? ["image"],
|
|
25942
|
-
previewAspectRatio,
|
|
25943
|
-
minSourceWidth: slot.edit.minSourceWidth,
|
|
25944
|
-
minSourceHeight: slot.edit.minSourceHeight,
|
|
25945
|
-
cropEditorMode: config.ui?.cropEditorMode ?? "dialog",
|
|
25946
|
-
cropEditorAutoOpen: config.ui?.cropEditorAutoOpen === true,
|
|
25947
|
-
videoPrepIntent: videoPrepIntentForMediaField(path, config.mediaKinds),
|
|
25948
|
-
videoSelectionIntent: videoSelectionIntentForMediaField(path, config.mediaKinds)
|
|
25917
|
+
...presentation
|
|
25949
25918
|
})
|
|
25950
25919
|
});
|
|
25951
25920
|
}
|
|
@@ -26866,7 +26835,7 @@ function globalFieldsSummary(form) {
|
|
|
26866
26835
|
}
|
|
26867
26836
|
//#endregion
|
|
26868
26837
|
//#region ../editor-blocks/src/widgets/mailing-list-targeting/MailingListTargetingField.tsx
|
|
26869
|
-
const inputClass$
|
|
26838
|
+
const inputClass$1 = "w-full rounded-md border bg-background px-3 py-2 text-sm";
|
|
26870
26839
|
function useMailingListSetup() {
|
|
26871
26840
|
const { siteId, load, manageHref } = useMailingListTargetingContext();
|
|
26872
26841
|
const [loadState, setLoadState] = useState({ tag: "loading" });
|
|
@@ -27168,7 +27137,7 @@ function MailchimpAudience({ matched, setValue, name }) {
|
|
|
27168
27137
|
children: "Audience"
|
|
27169
27138
|
}), /* @__PURE__ */ jsxs("select", {
|
|
27170
27139
|
id: selectId,
|
|
27171
|
-
className: inputClass$
|
|
27140
|
+
className: inputClass$1,
|
|
27172
27141
|
value: matched.targeting.audienceId,
|
|
27173
27142
|
onChange: (event) => {
|
|
27174
27143
|
const audienceId = parseMailchimpAudienceId(event.target.value);
|
|
@@ -28461,246 +28430,343 @@ function planFooterEditorView(input) {
|
|
|
28461
28430
|
scopeLabel: "All pages",
|
|
28462
28431
|
shown: overview.selected.map((item) => sectionPlan(item.section, true, missingIds.has(item.section.id), input.canEdit)),
|
|
28463
28432
|
available: overview.available.map((item) => sectionPlan(item.section, false, false, input.canEdit)),
|
|
28464
|
-
|
|
28465
|
-
arrangement: input.arrangement,
|
|
28466
|
-
storedNavigationLayout: input.navigationLayout
|
|
28467
|
-
}))
|
|
28433
|
+
layout: planFooterLayout(renderable, { layout: input.layout })
|
|
28468
28434
|
};
|
|
28469
28435
|
}
|
|
28470
28436
|
//#endregion
|
|
28471
|
-
//#region ../content-editor/src/
|
|
28472
|
-
|
|
28473
|
-
|
|
28474
|
-
|
|
28475
|
-
|
|
28476
|
-
|
|
28477
|
-
|
|
28478
|
-
|
|
28479
|
-
|
|
28480
|
-
|
|
28481
|
-
|
|
28482
|
-
|
|
28483
|
-
|
|
28484
|
-
};
|
|
28485
|
-
case "set-intro": return {
|
|
28486
|
-
...draft,
|
|
28487
|
-
intro: event.intro
|
|
28488
|
-
};
|
|
28489
|
-
case "set-form": return draft.kind === "standard-contact" ? {
|
|
28490
|
-
...draft,
|
|
28491
|
-
formId: event.formId
|
|
28492
|
-
} : draft;
|
|
28493
|
-
case "set-mailing-targeting": return draft.kind === "mailing-list" ? {
|
|
28494
|
-
...draft,
|
|
28495
|
-
targeting: event.targeting
|
|
28496
|
-
} : draft;
|
|
28497
|
-
default: return assertNever$1(event);
|
|
28498
|
-
}
|
|
28499
|
-
}
|
|
28500
|
-
function createFooterEngagementDraft(section) {
|
|
28501
|
-
const shared = {
|
|
28502
|
-
treatment: section?.treatment ?? "integrated",
|
|
28503
|
-
heading: section?.heading ?? "Stay in touch",
|
|
28504
|
-
intro: section?.source.intro ?? ""
|
|
28505
|
-
};
|
|
28506
|
-
if (section?.source.kind === "standard-contact") return createStandardContactDraft(shared, section.source.formId);
|
|
28507
|
-
if (section?.source.kind === "mailing-list") return createMailingListDraft(shared, section.source);
|
|
28508
|
-
return createStandardContactDraft(shared, "");
|
|
28437
|
+
//#region ../content-editor/src/FooterBrandChoice.tsx
|
|
28438
|
+
const FOOTER_BRAND_COPY = {
|
|
28439
|
+
label: "Name or logo",
|
|
28440
|
+
name: "Name",
|
|
28441
|
+
logo: "Logo",
|
|
28442
|
+
both: "Name and logo",
|
|
28443
|
+
addLogoLink: "Add a logo in Settings",
|
|
28444
|
+
addLogoRest: " to show it here."
|
|
28445
|
+
};
|
|
28446
|
+
/** Stored footers that hid both (no longer offered) read as the name, which is what they now show. */
|
|
28447
|
+
function footerBrandChoice(section) {
|
|
28448
|
+
if (section.showLogo && section.showTitle) return "both";
|
|
28449
|
+
return section.showLogo ? "logo" : "name";
|
|
28509
28450
|
}
|
|
28510
|
-
function
|
|
28451
|
+
function withFooterBrandChoice(composition, choice) {
|
|
28511
28452
|
return {
|
|
28512
|
-
|
|
28513
|
-
|
|
28514
|
-
|
|
28453
|
+
...composition,
|
|
28454
|
+
sections: composition.sections.map((section) => section.kind === "brand" ? {
|
|
28455
|
+
...section,
|
|
28456
|
+
showLogo: choice !== "name",
|
|
28457
|
+
showTitle: choice !== "logo"
|
|
28458
|
+
} : section)
|
|
28515
28459
|
};
|
|
28516
28460
|
}
|
|
28517
|
-
|
|
28518
|
-
|
|
28519
|
-
|
|
28520
|
-
|
|
28521
|
-
|
|
28522
|
-
|
|
28461
|
+
/**
|
|
28462
|
+
* What sits at the top of the footer, as one choice. Hiding both isn't
|
|
28463
|
+
* offered (the brand row is removed from the footer instead), and with no
|
|
28464
|
+
* logo uploaded the footer shows the name whatever is chosen.
|
|
28465
|
+
*/
|
|
28466
|
+
function FooterBrandChoiceControl({ composition, hasLogo, manageSettingsHref, onChange }) {
|
|
28467
|
+
const brand = composition.sections.find((section) => section.kind === "brand" && section.selected);
|
|
28468
|
+
if (!brand) return null;
|
|
28469
|
+
const value = hasLogo ? footerBrandChoice(brand) : "name";
|
|
28470
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
28471
|
+
className: "space-y-1.5",
|
|
28472
|
+
children: [
|
|
28473
|
+
/* @__PURE__ */ jsx("div", {
|
|
28474
|
+
className: "text-sm font-medium",
|
|
28475
|
+
children: FOOTER_BRAND_COPY.label
|
|
28476
|
+
}),
|
|
28477
|
+
/* @__PURE__ */ jsx(SegmentedControl, {
|
|
28478
|
+
"aria-label": FOOTER_BRAND_COPY.label,
|
|
28479
|
+
size: "sm",
|
|
28480
|
+
className: "w-full",
|
|
28481
|
+
value,
|
|
28482
|
+
onValueChange: (choice) => onChange(withFooterBrandChoice(composition, choice)),
|
|
28483
|
+
options: [
|
|
28484
|
+
{
|
|
28485
|
+
value: "name",
|
|
28486
|
+
label: FOOTER_BRAND_COPY.name
|
|
28487
|
+
},
|
|
28488
|
+
{
|
|
28489
|
+
value: "logo",
|
|
28490
|
+
label: FOOTER_BRAND_COPY.logo,
|
|
28491
|
+
disabled: !hasLogo
|
|
28492
|
+
},
|
|
28493
|
+
{
|
|
28494
|
+
value: "both",
|
|
28495
|
+
label: FOOTER_BRAND_COPY.both,
|
|
28496
|
+
disabled: !hasLogo
|
|
28497
|
+
}
|
|
28498
|
+
]
|
|
28499
|
+
}),
|
|
28500
|
+
hasLogo ? null : /* @__PURE__ */ jsxs("p", {
|
|
28501
|
+
className: "text-xs text-muted-foreground",
|
|
28502
|
+
children: [/* @__PURE__ */ jsx("a", {
|
|
28503
|
+
className: "underline underline-offset-2",
|
|
28504
|
+
href: manageSettingsHref,
|
|
28505
|
+
children: FOOTER_BRAND_COPY.addLogoLink
|
|
28506
|
+
}), FOOTER_BRAND_COPY.addLogoRest]
|
|
28507
|
+
})
|
|
28508
|
+
]
|
|
28509
|
+
});
|
|
28510
|
+
}
|
|
28511
|
+
//#endregion
|
|
28512
|
+
//#region ../content-editor/src/FooterLiveTextField.tsx
|
|
28513
|
+
/**
|
|
28514
|
+
* One line or a few lines of footer text. The value and its saving belong to
|
|
28515
|
+
* the caller (the footer part hooks); this draws the field, saves on leaving it,
|
|
28516
|
+
* and says so when a save didn't go through.
|
|
28517
|
+
*/
|
|
28518
|
+
function FooterLiveTextField({ label, hint, optional = false, error, maxLength, multiline = false, value, onChange, live }) {
|
|
28519
|
+
return /* @__PURE__ */ jsx(FieldFrame, {
|
|
28520
|
+
label,
|
|
28521
|
+
hint,
|
|
28522
|
+
optional,
|
|
28523
|
+
error: error ?? null,
|
|
28524
|
+
children: ({ id, descriptionId, messageId }) => {
|
|
28525
|
+
const props = {
|
|
28526
|
+
id,
|
|
28527
|
+
"aria-describedby": [descriptionId, messageId].filter(Boolean).join(" ") || void 0,
|
|
28528
|
+
"aria-invalid": error ? true : void 0,
|
|
28529
|
+
maxLength,
|
|
28530
|
+
value,
|
|
28531
|
+
onBlur: live.flush
|
|
28532
|
+
};
|
|
28533
|
+
return multiline ? /* @__PURE__ */ jsx(Textarea, {
|
|
28534
|
+
...props,
|
|
28535
|
+
rows: 2,
|
|
28536
|
+
onChange: (event) => onChange(event.target.value)
|
|
28537
|
+
}) : /* @__PURE__ */ jsx(Input, {
|
|
28538
|
+
...props,
|
|
28539
|
+
onChange: (event) => onChange(event.target.value)
|
|
28540
|
+
});
|
|
28541
|
+
}
|
|
28542
|
+
});
|
|
28523
28543
|
}
|
|
28524
|
-
|
|
28544
|
+
/** Shown under a part's fields when its last save failed. What the owner typed stays in the fields. */
|
|
28545
|
+
function FooterLiveSaveFailure({ live }) {
|
|
28546
|
+
if (!live.failed) return null;
|
|
28547
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
28548
|
+
role: "alert",
|
|
28549
|
+
className: "flex items-center justify-between gap-3 text-sm text-destructive",
|
|
28550
|
+
children: [/* @__PURE__ */ jsx("span", { children: "That didn't save. Your changes are still here." }), /* @__PURE__ */ jsx(Button$1, {
|
|
28551
|
+
type: "button",
|
|
28552
|
+
variant: "outline",
|
|
28553
|
+
size: "sm",
|
|
28554
|
+
onClick: live.retry,
|
|
28555
|
+
children: "Try again"
|
|
28556
|
+
})]
|
|
28557
|
+
});
|
|
28558
|
+
}
|
|
28559
|
+
//#endregion
|
|
28560
|
+
//#region ../content-editor/src/useFooterPart.ts
|
|
28561
|
+
/** Forms dispatch edits; the composer owns their raw input, what it means, and its lifecycle. */
|
|
28562
|
+
function useFooterPartSave(part) {
|
|
28563
|
+
const composer = useFooterAuthoringOptional();
|
|
28564
|
+
if (!composer) throw new Error("Footer composer provider is missing");
|
|
28565
|
+
const key = footerPartKey({
|
|
28566
|
+
kind: part.kind,
|
|
28567
|
+
section: part.section,
|
|
28568
|
+
fields: {}
|
|
28569
|
+
});
|
|
28570
|
+
const edit = (draft, finalize) => {
|
|
28571
|
+
if (composer.compositionSnapshot?.kind !== "ready" || !composer.acceptingEdits) return;
|
|
28572
|
+
if (composer.fieldState.submit(draft) && finalize) composer.finalizeComposition();
|
|
28573
|
+
};
|
|
28525
28574
|
return {
|
|
28526
|
-
|
|
28527
|
-
|
|
28528
|
-
|
|
28575
|
+
composer,
|
|
28576
|
+
key,
|
|
28577
|
+
edit,
|
|
28578
|
+
shown: composer.compositionSnapshot?.kind === "ready" ? composer.compositionSnapshot.composition : null,
|
|
28579
|
+
live: {
|
|
28580
|
+
flush: composer.finalizeComposition,
|
|
28581
|
+
retry: () => composer.fieldState.retry(key),
|
|
28582
|
+
failed: composer.compositionDrafts.some((draft) => draft.identity.key === key && draft.status === "failed")
|
|
28583
|
+
}
|
|
28529
28584
|
};
|
|
28530
28585
|
}
|
|
28531
|
-
|
|
28532
|
-
|
|
28533
|
-
|
|
28534
|
-
kind: "mailing-list",
|
|
28535
|
-
targeting: source.targeting
|
|
28536
|
-
};
|
|
28537
|
-
}
|
|
28538
|
-
function parseFooterEngagementDraft(draft, currentId) {
|
|
28539
|
-
const source = draft.kind === "standard-contact" ? {
|
|
28540
|
-
kind: draft.kind,
|
|
28541
|
-
formId: draft.formId,
|
|
28542
|
-
intro: draft.intro || null
|
|
28543
|
-
} : createMailingListSource(draft);
|
|
28544
|
-
return parseFooterEngagementSection({
|
|
28545
|
-
id: currentId,
|
|
28586
|
+
/** The footer's contact form or mailing list part. Choices save at once; words save after a pause. */
|
|
28587
|
+
function useFooterEngagementPart(section) {
|
|
28588
|
+
const { composer, key, edit, shown, live } = useFooterPartSave({
|
|
28546
28589
|
kind: "engagement",
|
|
28547
|
-
|
|
28548
|
-
|
|
28549
|
-
|
|
28550
|
-
|
|
28551
|
-
|
|
28552
|
-
|
|
28553
|
-
|
|
28590
|
+
section
|
|
28591
|
+
});
|
|
28592
|
+
const typed = composer.fieldState.draft(key);
|
|
28593
|
+
const fields = typed?.kind === "engagement" ? typed.fields : {};
|
|
28594
|
+
const value = readFooterEngagementDraft(shown, fields, composer.engagementOptions);
|
|
28595
|
+
const dispatch = (event) => {
|
|
28596
|
+
const typing = event.type === "set-heading" || event.type === "set-intro";
|
|
28597
|
+
if (!typing) live.flush();
|
|
28598
|
+
edit({
|
|
28599
|
+
kind: "engagement",
|
|
28600
|
+
section,
|
|
28601
|
+
fields: footerEngagementEventFields(value, event)
|
|
28602
|
+
}, !typing);
|
|
28603
|
+
};
|
|
28554
28604
|
return {
|
|
28555
|
-
|
|
28556
|
-
|
|
28557
|
-
|
|
28605
|
+
value,
|
|
28606
|
+
dispatch,
|
|
28607
|
+
live,
|
|
28608
|
+
started: footerEngagementStarted(fields)
|
|
28609
|
+
};
|
|
28610
|
+
}
|
|
28611
|
+
/** A section's own heading and body text. */
|
|
28612
|
+
function useFooterSectionTextPart(module) {
|
|
28613
|
+
const { composer, key, edit, shown, live } = useFooterPartSave({
|
|
28614
|
+
kind: "section-text",
|
|
28615
|
+
section: module.id
|
|
28616
|
+
});
|
|
28617
|
+
const typed = composer.fieldState.draft(key);
|
|
28618
|
+
const value = {
|
|
28619
|
+
...shown?.sections.find((section) => section.id === module.id) ?? module,
|
|
28620
|
+
...typed?.kind === "section-text" ? typed.fields : {}
|
|
28621
|
+
};
|
|
28622
|
+
const change = (field, input) => {
|
|
28623
|
+
if (field === "content") return edit({
|
|
28624
|
+
kind: "section-text",
|
|
28625
|
+
section: module.id,
|
|
28626
|
+
fields: { content: input }
|
|
28627
|
+
}, false);
|
|
28628
|
+
edit({
|
|
28629
|
+
kind: "section-text",
|
|
28630
|
+
section: module.id,
|
|
28631
|
+
fields: { heading: typeof input === "string" ? input : null }
|
|
28632
|
+
}, false);
|
|
28633
|
+
};
|
|
28634
|
+
return {
|
|
28635
|
+
...live,
|
|
28636
|
+
value,
|
|
28637
|
+
change
|
|
28558
28638
|
};
|
|
28559
28639
|
}
|
|
28560
28640
|
//#endregion
|
|
28561
28641
|
//#region ../content-editor/src/FooterEngagementEditorFields.tsx
|
|
28562
|
-
|
|
28563
|
-
const
|
|
28564
|
-
|
|
28565
|
-
|
|
28566
|
-
|
|
28567
|
-
|
|
28568
|
-
|
|
28569
|
-
|
|
28570
|
-
|
|
28571
|
-
|
|
28572
|
-
|
|
28573
|
-
|
|
28574
|
-
|
|
28575
|
-
|
|
28576
|
-
|
|
28577
|
-
|
|
28578
|
-
|
|
28579
|
-
|
|
28580
|
-
|
|
28581
|
-
|
|
28582
|
-
|
|
28583
|
-
|
|
28584
|
-
|
|
28585
|
-
|
|
28586
|
-
|
|
28587
|
-
|
|
28588
|
-
|
|
28642
|
+
/** The signup / contact form panel's words, from the approved Phase 6 mockup. */
|
|
28643
|
+
const ENGAGEMENT_COPY = {
|
|
28644
|
+
mailingTitle: "Mailing list signup",
|
|
28645
|
+
contactTitle: "Contact form",
|
|
28646
|
+
choiceLabel: "Visitors can",
|
|
28647
|
+
mailingList: "Join your list",
|
|
28648
|
+
contactForm: "Send a message",
|
|
28649
|
+
headingLabel: "Heading",
|
|
28650
|
+
headingHint: "In Compact strip, this shows as a small label by the form.",
|
|
28651
|
+
introLabel: "A line under the heading",
|
|
28652
|
+
introHint: "Compact strip leaves this out to keep the strip short.",
|
|
28653
|
+
listNote: "The button text and privacy note come from your mailing list settings.",
|
|
28654
|
+
listSettings: "Mailing list settings",
|
|
28655
|
+
askOwner: "Ask the site's owner to change the mailing list settings.",
|
|
28656
|
+
notSetUpTitle: "You haven't set up a mailing list yet",
|
|
28657
|
+
notSetUpBody: "Once it's set up, the signup shows in your footer. Until then, visitors won't see it.",
|
|
28658
|
+
notSetUpAction: "Set up your mailing list",
|
|
28659
|
+
attentionTitle: "This signup isn't showing on your site",
|
|
28660
|
+
formAttentionTitle: "This form isn't showing on your site",
|
|
28661
|
+
formLabel: "Which form",
|
|
28662
|
+
formPlaceholder: "Choose a contact form",
|
|
28663
|
+
formFields: "Asks for",
|
|
28664
|
+
formOpen: "Edit this form",
|
|
28665
|
+
noFormsTitle: "You don't have a contact form yet",
|
|
28666
|
+
noFormsBody: "Make one in Forms, then choose it here.",
|
|
28667
|
+
noFormsAction: "Make a contact form",
|
|
28668
|
+
remove: "Remove from footer"
|
|
28669
|
+
};
|
|
28670
|
+
function StandardContactChoice({ dispatch, error, formId, manageFormsHref, options }) {
|
|
28671
|
+
const standardForms = options.forms.filter((form) => form.contactDefinition?.kind === "standard-contact");
|
|
28672
|
+
const selectedForm = standardForms.find((form) => form.id === formId);
|
|
28673
|
+
if (standardForms.length === 0) return /* @__PURE__ */ jsx(NoContactForms, {
|
|
28674
|
+
error,
|
|
28675
|
+
manageFormsHref
|
|
28676
|
+
});
|
|
28677
|
+
const fields = visibleFieldLabels(selectedForm);
|
|
28678
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
28679
|
+
className: "space-y-3",
|
|
28680
|
+
children: [/* @__PURE__ */ jsx(FieldFrame, {
|
|
28681
|
+
error,
|
|
28682
|
+
fieldPath: "engagement.formId",
|
|
28683
|
+
label: ENGAGEMENT_COPY.formLabel,
|
|
28684
|
+
hint: fields ? `${ENGAGEMENT_COPY.formFields}: ${fields}` : void 0,
|
|
28685
|
+
children: ({ id, descriptionId, messageId }) => /* @__PURE__ */ jsxs(NativeSelect, {
|
|
28686
|
+
id,
|
|
28687
|
+
"aria-describedby": describedBy(descriptionId, messageId),
|
|
28688
|
+
"aria-invalid": error ? true : void 0,
|
|
28689
|
+
onChange: (event) => dispatch({
|
|
28690
|
+
type: "set-form",
|
|
28691
|
+
formId: event.target.value
|
|
28692
|
+
}),
|
|
28693
|
+
value: formId,
|
|
28694
|
+
children: [/* @__PURE__ */ jsx("option", {
|
|
28695
|
+
value: "",
|
|
28696
|
+
children: ENGAGEMENT_COPY.formPlaceholder
|
|
28697
|
+
}), standardForms.map((form) => /* @__PURE__ */ jsx("option", {
|
|
28698
|
+
value: form.id,
|
|
28699
|
+
children: form.name
|
|
28700
|
+
}, form.id))]
|
|
28589
28701
|
})
|
|
28590
|
-
|
|
28702
|
+
}), selectedForm ? /* @__PURE__ */ jsx(Button$1, {
|
|
28703
|
+
asChild: true,
|
|
28704
|
+
variant: "link",
|
|
28705
|
+
size: "sm",
|
|
28706
|
+
className: "h-auto px-0",
|
|
28707
|
+
children: /* @__PURE__ */ jsx("a", {
|
|
28708
|
+
href: `${manageFormsHref.replace(/\/$/u, "")}/${selectedForm.id}`,
|
|
28709
|
+
children: ENGAGEMENT_COPY.formOpen
|
|
28710
|
+
})
|
|
28711
|
+
}) : null]
|
|
28591
28712
|
});
|
|
28592
28713
|
}
|
|
28593
|
-
|
|
28594
|
-
|
|
28595
|
-
|
|
28596
|
-
|
|
28597
|
-
maxLength: 80,
|
|
28598
|
-
onChange: (heading) => dispatch({
|
|
28599
|
-
type: "set-heading",
|
|
28600
|
-
heading
|
|
28601
|
-
}),
|
|
28602
|
-
path: "engagement.heading",
|
|
28603
|
-
value: draft.heading
|
|
28604
|
-
}), /* @__PURE__ */ jsx(TextField, {
|
|
28605
|
-
label: "Intro",
|
|
28606
|
-
maxLength: 240,
|
|
28607
|
-
multiline: true,
|
|
28608
|
-
onChange: (intro) => dispatch({
|
|
28609
|
-
type: "set-intro",
|
|
28610
|
-
intro
|
|
28611
|
-
}),
|
|
28612
|
-
path: "engagement.intro",
|
|
28613
|
-
value: draft.intro
|
|
28614
|
-
})] });
|
|
28714
|
+
/** The selected contact form's visible fields, for the hint under the picker. */
|
|
28715
|
+
function visibleFieldLabels(form) {
|
|
28716
|
+
if (form?.contactDefinition?.kind !== "standard-contact") return null;
|
|
28717
|
+
return form.contactDefinition.fields.filter((field) => field.visible).map((field) => field.label).join(" · ");
|
|
28615
28718
|
}
|
|
28616
|
-
function
|
|
28617
|
-
return /* @__PURE__ */ jsxs(
|
|
28719
|
+
function NoContactForms({ error, manageFormsHref }) {
|
|
28720
|
+
return /* @__PURE__ */ jsxs(Callout, {
|
|
28618
28721
|
className: "space-y-2",
|
|
28619
28722
|
children: [
|
|
28620
|
-
/* @__PURE__ */ jsx(
|
|
28621
|
-
|
|
28622
|
-
|
|
28623
|
-
|
|
28624
|
-
|
|
28625
|
-
|
|
28626
|
-
|
|
28627
|
-
|
|
28628
|
-
|
|
28629
|
-
type: "set-treatment",
|
|
28630
|
-
treatment: "integrated"
|
|
28631
|
-
})
|
|
28632
|
-
}),
|
|
28633
|
-
/* @__PURE__ */ jsx(RadioChoice, {
|
|
28634
|
-
checked: treatment === "separate-row",
|
|
28635
|
-
label: "Show it in a separate row",
|
|
28636
|
-
name: "engagement-treatment",
|
|
28637
|
-
onChange: () => dispatch({
|
|
28638
|
-
type: "set-treatment",
|
|
28639
|
-
treatment: "separate-row"
|
|
28723
|
+
/* @__PURE__ */ jsx(CalloutTitle, { children: ENGAGEMENT_COPY.noFormsTitle }),
|
|
28724
|
+
/* @__PURE__ */ jsx(CalloutDescription, { children: ENGAGEMENT_COPY.noFormsBody }),
|
|
28725
|
+
/* @__PURE__ */ jsx(EngagementError, { message: error }),
|
|
28726
|
+
/* @__PURE__ */ jsx(Button$1, {
|
|
28727
|
+
asChild: true,
|
|
28728
|
+
size: "sm",
|
|
28729
|
+
children: /* @__PURE__ */ jsx("a", {
|
|
28730
|
+
href: manageFormsHref,
|
|
28731
|
+
children: ENGAGEMENT_COPY.noFormsAction
|
|
28640
28732
|
})
|
|
28641
28733
|
})
|
|
28642
28734
|
]
|
|
28643
28735
|
});
|
|
28644
28736
|
}
|
|
28645
|
-
function
|
|
28646
|
-
|
|
28647
|
-
|
|
28648
|
-
|
|
28649
|
-
|
|
28650
|
-
|
|
28651
|
-
|
|
28652
|
-
|
|
28653
|
-
|
|
28654
|
-
|
|
28655
|
-
formId,
|
|
28656
|
-
selectedForm
|
|
28657
|
-
]);
|
|
28658
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
28659
|
-
className: "space-y-3",
|
|
28737
|
+
function EngagementError({ message }) {
|
|
28738
|
+
return message ? /* @__PURE__ */ jsx("p", {
|
|
28739
|
+
role: "alert",
|
|
28740
|
+
className: "text-sm text-destructive",
|
|
28741
|
+
children: message
|
|
28742
|
+
}) : null;
|
|
28743
|
+
}
|
|
28744
|
+
function MailingListChoice({ dispatch, draft, manageNewsletterHref, options }) {
|
|
28745
|
+
if (options.mailingList.tag !== "configured") return /* @__PURE__ */ jsxs(Callout, {
|
|
28746
|
+
className: "space-y-2",
|
|
28660
28747
|
children: [
|
|
28661
|
-
/* @__PURE__ */ jsx(
|
|
28662
|
-
|
|
28663
|
-
|
|
28664
|
-
|
|
28665
|
-
|
|
28666
|
-
|
|
28667
|
-
|
|
28668
|
-
|
|
28669
|
-
type: "set-form",
|
|
28670
|
-
formId: event.target.value
|
|
28671
|
-
}),
|
|
28672
|
-
value: formId,
|
|
28673
|
-
children: [/* @__PURE__ */ jsx("option", {
|
|
28674
|
-
value: "",
|
|
28675
|
-
children: "Choose a standard contact form"
|
|
28676
|
-
}), standardForms.map((form) => /* @__PURE__ */ jsx("option", {
|
|
28677
|
-
value: form.id,
|
|
28678
|
-
children: form.name
|
|
28679
|
-
}, form.id))]
|
|
28748
|
+
/* @__PURE__ */ jsx(CalloutTitle, { children: ENGAGEMENT_COPY.notSetUpTitle }),
|
|
28749
|
+
/* @__PURE__ */ jsx(CalloutDescription, { children: ENGAGEMENT_COPY.notSetUpBody }),
|
|
28750
|
+
options.canManageMailingListSetup ? /* @__PURE__ */ jsx(Button$1, {
|
|
28751
|
+
asChild: true,
|
|
28752
|
+
size: "sm",
|
|
28753
|
+
children: /* @__PURE__ */ jsx("a", {
|
|
28754
|
+
href: manageNewsletterHref,
|
|
28755
|
+
children: ENGAGEMENT_COPY.notSetUpAction
|
|
28680
28756
|
})
|
|
28681
|
-
}),
|
|
28682
|
-
selectedForm?.contactDefinition?.kind === "standard-contact" ? /* @__PURE__ */ jsx("div", {
|
|
28683
|
-
className: "rounded-md border p-3 text-xs text-muted-foreground",
|
|
28684
|
-
children: selectedForm.contactDefinition.fields.filter((field) => field.visible).map((field) => field.label).join(" · ")
|
|
28685
|
-
}) : null,
|
|
28686
|
-
selectedForm ? /* @__PURE__ */ jsx("a", {
|
|
28687
|
-
className: buttonClass$3,
|
|
28688
|
-
href: `${manageFormsHref.replace(/\/$/u, "")}/${selectedForm.id}`,
|
|
28689
|
-
children: "Open in Forms"
|
|
28690
|
-
}) : null
|
|
28757
|
+
}) : /* @__PURE__ */ jsx(CalloutDescription, { children: ENGAGEMENT_COPY.askOwner })
|
|
28691
28758
|
]
|
|
28692
28759
|
});
|
|
28693
|
-
}
|
|
28694
|
-
function MailingListChoice({ dispatch, draft, manageNewsletterHref, options }) {
|
|
28695
28760
|
return /* @__PURE__ */ jsxs("div", {
|
|
28696
28761
|
className: "space-y-3",
|
|
28697
28762
|
children: [
|
|
28698
|
-
|
|
28763
|
+
/* @__PURE__ */ jsx(MailingListGlobalSettingsSummary, { context: {
|
|
28699
28764
|
runtime: options.mailingList,
|
|
28700
28765
|
expectedProviderScope: options.expectedMailingListProviderScope,
|
|
28701
28766
|
confirmation: options.confirmation,
|
|
28702
28767
|
canManageSetup: options.canManageMailingListSetup
|
|
28703
|
-
} }),
|
|
28768
|
+
} }),
|
|
28769
|
+
/* @__PURE__ */ jsx(MailingListTargetingControl, {
|
|
28704
28770
|
context: options.mailingList,
|
|
28705
28771
|
targeting: draft.targeting,
|
|
28706
28772
|
name: "footer-mailing-list-targeting",
|
|
@@ -28708,84 +28774,53 @@ function MailingListChoice({ dispatch, draft, manageNewsletterHref, options }) {
|
|
|
28708
28774
|
type: "set-mailing-targeting",
|
|
28709
28775
|
targeting
|
|
28710
28776
|
})
|
|
28711
|
-
})] }) : /* @__PURE__ */ jsx("p", {
|
|
28712
|
-
className: "rounded-md border border-dashed p-3 text-sm text-muted-foreground",
|
|
28713
|
-
children: "Set up a mailing list before adding this footer form."
|
|
28714
28777
|
}),
|
|
28715
|
-
|
|
28716
|
-
className: buttonClass$3,
|
|
28717
|
-
href: manageNewsletterHref,
|
|
28718
|
-
children: "Manage mailing list"
|
|
28719
|
-
}) : /* @__PURE__ */ jsx("p", {
|
|
28778
|
+
/* @__PURE__ */ jsx("p", {
|
|
28720
28779
|
className: "text-xs text-muted-foreground",
|
|
28721
|
-
children:
|
|
28780
|
+
children: ENGAGEMENT_COPY.listNote
|
|
28722
28781
|
}),
|
|
28723
|
-
/* @__PURE__ */ jsx(
|
|
28782
|
+
options.canManageMailingListSetup ? /* @__PURE__ */ jsx(Button$1, {
|
|
28783
|
+
asChild: true,
|
|
28784
|
+
variant: "link",
|
|
28785
|
+
size: "sm",
|
|
28786
|
+
className: "h-auto px-0",
|
|
28787
|
+
children: /* @__PURE__ */ jsx("a", {
|
|
28788
|
+
href: manageNewsletterHref,
|
|
28789
|
+
children: ENGAGEMENT_COPY.listSettings
|
|
28790
|
+
})
|
|
28791
|
+
}) : /* @__PURE__ */ jsx("p", {
|
|
28724
28792
|
className: "text-xs text-muted-foreground",
|
|
28725
|
-
children:
|
|
28793
|
+
children: ENGAGEMENT_COPY.askOwner
|
|
28726
28794
|
})
|
|
28727
28795
|
]
|
|
28728
28796
|
});
|
|
28729
28797
|
}
|
|
28730
|
-
function TextField({ error, label, maxLength, multiline = false, onChange, path, value }) {
|
|
28731
|
-
return /* @__PURE__ */ jsx(FieldFrame, {
|
|
28732
|
-
error,
|
|
28733
|
-
fieldPath: path,
|
|
28734
|
-
label,
|
|
28735
|
-
children: ({ id, descriptionId, messageId }) => {
|
|
28736
|
-
const props = {
|
|
28737
|
-
id,
|
|
28738
|
-
"aria-describedby": describedBy(descriptionId, messageId),
|
|
28739
|
-
className: inputClass$1,
|
|
28740
|
-
maxLength,
|
|
28741
|
-
onChange: (event) => onChange(event.target.value),
|
|
28742
|
-
value
|
|
28743
|
-
};
|
|
28744
|
-
return multiline ? /* @__PURE__ */ jsx("textarea", { ...props }) : /* @__PURE__ */ jsx("input", { ...props });
|
|
28745
|
-
}
|
|
28746
|
-
});
|
|
28747
|
-
}
|
|
28748
|
-
function RadioChoice({ checked, label, name, onChange }) {
|
|
28749
|
-
return /* @__PURE__ */ jsxs("label", {
|
|
28750
|
-
className: "flex items-center gap-2 text-sm",
|
|
28751
|
-
children: [/* @__PURE__ */ jsx("input", {
|
|
28752
|
-
checked,
|
|
28753
|
-
name,
|
|
28754
|
-
onChange,
|
|
28755
|
-
type: "radio"
|
|
28756
|
-
}), label]
|
|
28757
|
-
});
|
|
28758
|
-
}
|
|
28759
28798
|
function describedBy(descriptionId, messageId) {
|
|
28760
28799
|
return [descriptionId, messageId].filter(Boolean).join(" ") || void 0;
|
|
28761
28800
|
}
|
|
28762
28801
|
//#endregion
|
|
28763
28802
|
//#region ../content-editor/src/FooterEngagementEditorPanel.tsx
|
|
28764
|
-
const buttonClass$2 = "rounded-md border bg-background px-3 py-2 text-sm font-medium hover:bg-muted";
|
|
28765
|
-
const primaryButtonClass$2 = "rounded-md bg-primary px-3 py-2 text-sm font-medium text-primary-foreground";
|
|
28766
28803
|
function FooterEngagementEditorPanel(props) {
|
|
28767
|
-
const { dispatch, draft, error,
|
|
28804
|
+
const { dispatch, draft, error, live } = useFooterEngagementDraft(props);
|
|
28805
|
+
const mailing = draft.kind === "mailing-list";
|
|
28768
28806
|
return /* @__PURE__ */ jsxs("div", {
|
|
28769
28807
|
className: "space-y-5",
|
|
28770
28808
|
children: [
|
|
28771
|
-
/* @__PURE__ */
|
|
28809
|
+
/* @__PURE__ */ jsx("h2", {
|
|
28772
28810
|
className: "font-semibold",
|
|
28773
|
-
children:
|
|
28774
|
-
}), /* @__PURE__ */ jsx("p", {
|
|
28775
|
-
className: "text-xs text-muted-foreground",
|
|
28776
|
-
children: "Preview the change here before applying it to every page."
|
|
28777
|
-
})] }),
|
|
28778
|
-
/* @__PURE__ */ jsx(ReadinessNotice, { readiness: props.readiness }),
|
|
28779
|
-
/* @__PURE__ */ jsx(EngagementKindChoice, {
|
|
28780
|
-
dispatch,
|
|
28781
|
-
kind: draft.kind
|
|
28811
|
+
children: mailing ? ENGAGEMENT_COPY.mailingTitle : ENGAGEMENT_COPY.contactTitle
|
|
28782
28812
|
}),
|
|
28783
|
-
/* @__PURE__ */ jsx(
|
|
28784
|
-
draft,
|
|
28785
|
-
error,
|
|
28813
|
+
/* @__PURE__ */ jsx(EngagementKindChoice, {
|
|
28814
|
+
kind: draft.kind,
|
|
28786
28815
|
dispatch
|
|
28787
28816
|
}),
|
|
28817
|
+
/* @__PURE__ */ jsx(RepairCallout, {
|
|
28818
|
+
mailing,
|
|
28819
|
+
options: props.options,
|
|
28820
|
+
readiness: props.readiness
|
|
28821
|
+
}),
|
|
28788
28822
|
draft.kind === "standard-contact" ? /* @__PURE__ */ jsx(StandardContactChoice, {
|
|
28823
|
+
error: fieldErrorMessage(error, "formId"),
|
|
28789
28824
|
formId: draft.formId,
|
|
28790
28825
|
manageFormsHref: props.manageFormsHref,
|
|
28791
28826
|
options: props.options,
|
|
@@ -28796,114 +28831,134 @@ function FooterEngagementEditorPanel(props) {
|
|
|
28796
28831
|
options: props.options,
|
|
28797
28832
|
dispatch
|
|
28798
28833
|
}),
|
|
28799
|
-
/* @__PURE__ */ jsx(
|
|
28800
|
-
|
|
28801
|
-
|
|
28802
|
-
|
|
28803
|
-
|
|
28804
|
-
candidate: props.candidate,
|
|
28805
|
-
onApply: props.onApply,
|
|
28806
|
-
onCancel: props.onCancel,
|
|
28807
|
-
onPreview: preview
|
|
28834
|
+
/* @__PURE__ */ jsx(EngagementTextFields, {
|
|
28835
|
+
draft,
|
|
28836
|
+
error,
|
|
28837
|
+
dispatch,
|
|
28838
|
+
live
|
|
28808
28839
|
}),
|
|
28809
|
-
|
|
28810
|
-
|
|
28811
|
-
|
|
28812
|
-
|
|
28813
|
-
children:
|
|
28840
|
+
/* @__PURE__ */ jsx(FooterLiveSaveFailure, { live }),
|
|
28841
|
+
/* @__PURE__ */ jsx(EngagementError, { message: generalErrorMessage(error) }),
|
|
28842
|
+
props.current !== null ? /* @__PURE__ */ jsx("div", {
|
|
28843
|
+
className: "border-t pt-4",
|
|
28844
|
+
children: /* @__PURE__ */ jsx(Button$1, {
|
|
28845
|
+
type: "button",
|
|
28846
|
+
variant: "outline",
|
|
28847
|
+
size: "sm",
|
|
28848
|
+
onClick: props.onRemove,
|
|
28849
|
+
children: ENGAGEMENT_COPY.remove
|
|
28850
|
+
})
|
|
28814
28851
|
}) : null
|
|
28815
28852
|
]
|
|
28816
28853
|
});
|
|
28817
28854
|
}
|
|
28818
|
-
function
|
|
28819
|
-
|
|
28820
|
-
|
|
28821
|
-
return {
|
|
28822
|
-
dispatch: useCallback((event) => setDraft((current) => reduceFooterEngagementDraft(current, event)), []),
|
|
28823
|
-
draft,
|
|
28824
|
-
error,
|
|
28825
|
-
preview: useCallback(() => {
|
|
28826
|
-
const parsed = parseFooterEngagementDraft(draft, props.current?.id ?? "engagement");
|
|
28827
|
-
if (!parsed.ok) {
|
|
28828
|
-
setError(parsed.error.message);
|
|
28829
|
-
return;
|
|
28830
|
-
}
|
|
28831
|
-
setError(null);
|
|
28832
|
-
props.onPreview(parsed.value);
|
|
28833
|
-
}, [draft, props])
|
|
28834
|
-
};
|
|
28835
|
-
}
|
|
28836
|
-
function ReadinessNotice({ readiness }) {
|
|
28837
|
-
return readiness.kind === "needs-repair" ? /* @__PURE__ */ jsx("p", {
|
|
28838
|
-
role: "alert",
|
|
28839
|
-
className: "rounded-md border p-3 text-sm",
|
|
28840
|
-
children: readiness.message
|
|
28841
|
-
}) : null;
|
|
28842
|
-
}
|
|
28843
|
-
function PreviewActions({ candidate, onApply, onCancel, onPreview }) {
|
|
28844
|
-
return candidate !== null ? /* @__PURE__ */ jsxs("div", {
|
|
28845
|
-
className: "space-y-3 rounded-lg border bg-muted/30 p-3",
|
|
28855
|
+
function EngagementKindChoice({ kind, dispatch }) {
|
|
28856
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
28857
|
+
className: "space-y-1.5",
|
|
28846
28858
|
children: [/* @__PURE__ */ jsx("div", {
|
|
28847
28859
|
className: "text-sm font-medium",
|
|
28848
|
-
|
|
28849
|
-
|
|
28850
|
-
|
|
28851
|
-
|
|
28852
|
-
|
|
28853
|
-
|
|
28854
|
-
|
|
28855
|
-
|
|
28856
|
-
|
|
28857
|
-
|
|
28858
|
-
|
|
28859
|
-
|
|
28860
|
-
|
|
28861
|
-
|
|
28860
|
+
id: "footer-engagement-kind",
|
|
28861
|
+
children: ENGAGEMENT_COPY.choiceLabel
|
|
28862
|
+
}), /* @__PURE__ */ jsx(SegmentedControl, {
|
|
28863
|
+
"aria-label": ENGAGEMENT_COPY.choiceLabel,
|
|
28864
|
+
size: "sm",
|
|
28865
|
+
className: "w-full",
|
|
28866
|
+
value: kind,
|
|
28867
|
+
onValueChange: (next) => dispatch({
|
|
28868
|
+
type: "select-kind",
|
|
28869
|
+
kind: next
|
|
28870
|
+
}),
|
|
28871
|
+
options: [{
|
|
28872
|
+
value: "mailing-list",
|
|
28873
|
+
label: ENGAGEMENT_COPY.mailingList
|
|
28874
|
+
}, {
|
|
28875
|
+
value: "standard-contact",
|
|
28876
|
+
label: ENGAGEMENT_COPY.contactForm
|
|
28877
|
+
}]
|
|
28862
28878
|
})]
|
|
28863
|
-
}) : /* @__PURE__ */ jsx("button", {
|
|
28864
|
-
className: primaryButtonClass$2,
|
|
28865
|
-
onClick: onPreview,
|
|
28866
|
-
type: "button",
|
|
28867
|
-
children: "Preview change"
|
|
28868
28879
|
});
|
|
28869
28880
|
}
|
|
28870
|
-
|
|
28871
|
-
|
|
28872
|
-
|
|
28873
|
-
|
|
28874
|
-
|
|
28875
|
-
|
|
28876
|
-
|
|
28877
|
-
|
|
28878
|
-
description: "Inline links use a full-width row; stacked links stay in a footer column.",
|
|
28879
|
-
children: ({ id, descriptionId }) => /* @__PURE__ */ jsxs("select", {
|
|
28880
|
-
id,
|
|
28881
|
-
"aria-describedby": descriptionId,
|
|
28882
|
-
className: selectClass,
|
|
28883
|
-
disabled: disabled || pending,
|
|
28884
|
-
"aria-busy": pending,
|
|
28885
|
-
value,
|
|
28886
|
-
onChange: (event) => onChange(event.target.value === "stack" ? "stack" : "inline-wrap"),
|
|
28887
|
-
children: [/* @__PURE__ */ jsx("option", {
|
|
28888
|
-
value: "stack",
|
|
28889
|
-
children: "Stacked"
|
|
28890
|
-
}), /* @__PURE__ */ jsx("option", {
|
|
28891
|
-
value: "inline-wrap",
|
|
28892
|
-
children: "Inline"
|
|
28893
|
-
})]
|
|
28894
|
-
})
|
|
28881
|
+
/** The mailing-list choice explains an unconfigured list itself, so this stays quiet then. */
|
|
28882
|
+
function RepairCallout({ mailing, options, readiness }) {
|
|
28883
|
+
if (readiness.kind !== "needs-repair") return null;
|
|
28884
|
+
if (mailing && options.mailingList.tag !== "configured") return null;
|
|
28885
|
+
return /* @__PURE__ */ jsxs(Callout, {
|
|
28886
|
+
tone: "warning",
|
|
28887
|
+
role: "alert",
|
|
28888
|
+
children: [/* @__PURE__ */ jsx(CalloutTitle, { children: mailing ? ENGAGEMENT_COPY.attentionTitle : ENGAGEMENT_COPY.formAttentionTitle }), /* @__PURE__ */ jsx(CalloutDescription, { children: readiness.message })]
|
|
28895
28889
|
});
|
|
28896
28890
|
}
|
|
28891
|
+
function EngagementTextFields({ draft, error, dispatch, live }) {
|
|
28892
|
+
const mailing = draft.kind === "mailing-list";
|
|
28893
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(FooterLiveTextField, {
|
|
28894
|
+
label: ENGAGEMENT_COPY.headingLabel,
|
|
28895
|
+
hint: mailing ? ENGAGEMENT_COPY.headingHint : void 0,
|
|
28896
|
+
error: fieldErrorMessage(error, "heading"),
|
|
28897
|
+
maxLength: 80,
|
|
28898
|
+
value: draft.heading,
|
|
28899
|
+
onChange: (heading) => dispatch({
|
|
28900
|
+
type: "set-heading",
|
|
28901
|
+
heading
|
|
28902
|
+
}),
|
|
28903
|
+
live
|
|
28904
|
+
}), /* @__PURE__ */ jsx(FooterLiveTextField, {
|
|
28905
|
+
label: ENGAGEMENT_COPY.introLabel,
|
|
28906
|
+
optional: true,
|
|
28907
|
+
hint: mailing ? ENGAGEMENT_COPY.introHint : void 0,
|
|
28908
|
+
error: fieldErrorMessage(error, "intro"),
|
|
28909
|
+
maxLength: 240,
|
|
28910
|
+
multiline: true,
|
|
28911
|
+
value: draft.intro,
|
|
28912
|
+
onChange: (intro) => dispatch({
|
|
28913
|
+
type: "set-intro",
|
|
28914
|
+
intro
|
|
28915
|
+
}),
|
|
28916
|
+
live
|
|
28917
|
+
})] });
|
|
28918
|
+
}
|
|
28919
|
+
function fieldErrorMessage(error, field) {
|
|
28920
|
+
return error?.field === field ? error.message : null;
|
|
28921
|
+
}
|
|
28922
|
+
/** Errors without a field of their own show below the choices. */
|
|
28923
|
+
function generalErrorMessage(error) {
|
|
28924
|
+
return error !== null && (error.field === null || error.field === "targeting") ? error.message : null;
|
|
28925
|
+
}
|
|
28926
|
+
/**
|
|
28927
|
+
* One draft for the whole panel. Choices (what visitors can do, which form or
|
|
28928
|
+
* list) save at once; the heading and intro save after a pause in typing, under
|
|
28929
|
+
* one text key per field so a run of typing joins one Undo step.
|
|
28930
|
+
*/
|
|
28931
|
+
function useFooterEngagementDraft(props) {
|
|
28932
|
+
const known = useRef(props.current?.id);
|
|
28933
|
+
if (props.current) known.current = props.current.id;
|
|
28934
|
+
const sectionId = known.current ?? unsafeAsFooterModuleId("engagement");
|
|
28935
|
+
const { value: draft, dispatch, live, started } = useFooterEngagementPart(sectionId);
|
|
28936
|
+
const parsed = parseFooterEngagementDraft(draft, sectionId);
|
|
28937
|
+
const error = parsed.ok ? null : parsed.error;
|
|
28938
|
+
return {
|
|
28939
|
+
dispatch,
|
|
28940
|
+
draft,
|
|
28941
|
+
error: props.current === null && !started && error?.field === "formId" ? null : error,
|
|
28942
|
+
live
|
|
28943
|
+
};
|
|
28944
|
+
}
|
|
28897
28945
|
//#endregion
|
|
28898
28946
|
//#region ../content-editor/src/FooterComposerOverview.tsx
|
|
28899
28947
|
const buttonClass$1 = "rounded-md border bg-background px-3 py-2 text-sm font-medium hover:bg-muted";
|
|
28900
28948
|
const primaryButtonClass$1 = "rounded-md bg-primary px-3 py-2 text-sm font-medium text-primary-foreground";
|
|
28901
28949
|
function SaveBadge({ state }) {
|
|
28902
28950
|
if (state === "idle") return null;
|
|
28951
|
+
const label = {
|
|
28952
|
+
saving: "Saving…",
|
|
28953
|
+
saved: "Saved",
|
|
28954
|
+
conflict: "Newer version loaded",
|
|
28955
|
+
failed: "Save failed",
|
|
28956
|
+
unsaved: "Not saved yet"
|
|
28957
|
+
}[state];
|
|
28903
28958
|
return /* @__PURE__ */ jsx("span", {
|
|
28904
28959
|
"aria-live": "polite",
|
|
28905
28960
|
className: "text-xs text-muted-foreground",
|
|
28906
|
-
children:
|
|
28961
|
+
children: label
|
|
28907
28962
|
});
|
|
28908
28963
|
}
|
|
28909
28964
|
function FooterPreview({ runtime }) {
|
|
@@ -28921,13 +28976,13 @@ function FooterPreview({ runtime }) {
|
|
|
28921
28976
|
className: "space-y-6",
|
|
28922
28977
|
disabled: true,
|
|
28923
28978
|
children: runtime.regions.map((region) => /* @__PURE__ */ jsx("div", {
|
|
28924
|
-
"data-footer-preview-region": region.
|
|
28925
|
-
className: region.
|
|
28979
|
+
"data-footer-preview-region": region.slot,
|
|
28980
|
+
className: region.slot === "base" ? "border-t border-white/15 pt-4" : "grid gap-6 md:grid-cols-2",
|
|
28926
28981
|
children: region.groups.map((group) => /* @__PURE__ */ jsx("div", {
|
|
28927
28982
|
className: "min-w-0 space-y-3 rounded-lg border border-white/15 p-4",
|
|
28928
28983
|
children: group.modules.map((module) => /* @__PURE__ */ jsx(FooterPreviewModule, { module }, module.id))
|
|
28929
28984
|
}, group.kind))
|
|
28930
|
-
}, region.
|
|
28985
|
+
}, region.slot))
|
|
28931
28986
|
})
|
|
28932
28987
|
})
|
|
28933
28988
|
});
|
|
@@ -29002,17 +29057,10 @@ function previewModuleLabel(module) {
|
|
|
29002
29057
|
function engagementLabel(engagement) {
|
|
29003
29058
|
return engagement.kind === "standard-contact" ? "Contact form" : "Mailing list signup";
|
|
29004
29059
|
}
|
|
29005
|
-
function FooterOverview({ credit, onCreditHiddenChange, plan, composition, onTarget, onChange, manageLinksHref, manageSettingsHref,
|
|
29060
|
+
function FooterOverview({ credit, onCreditHiddenChange, plan, composition, onTarget, onChange, manageLinksHref, manageSettingsHref, onEngagement, onAddEngagement }) {
|
|
29006
29061
|
return /* @__PURE__ */ jsxs("div", {
|
|
29007
29062
|
className: "space-y-5",
|
|
29008
29063
|
children: [
|
|
29009
|
-
onNavigationLayoutChange ? /* @__PURE__ */ jsx(FooterNavigationLayoutControl, {
|
|
29010
|
-
arrangement,
|
|
29011
|
-
value: navigationLayout,
|
|
29012
|
-
pending: navigationLayoutPending,
|
|
29013
|
-
disabled: navigationLayoutDisabled,
|
|
29014
|
-
onChange: onNavigationLayoutChange
|
|
29015
|
-
}) : null,
|
|
29016
29064
|
/* @__PURE__ */ jsx("h2", {
|
|
29017
29065
|
className: "font-semibold",
|
|
29018
29066
|
children: "Shown in footer"
|
|
@@ -29037,7 +29085,7 @@ function FooterOverview({ credit, onCreditHiddenChange, plan, composition, onTar
|
|
|
29037
29085
|
}),
|
|
29038
29086
|
/* @__PURE__ */ jsx(AddFooterEngagement, {
|
|
29039
29087
|
composition,
|
|
29040
|
-
|
|
29088
|
+
onAdd: onAddEngagement
|
|
29041
29089
|
})
|
|
29042
29090
|
]
|
|
29043
29091
|
});
|
|
@@ -29055,7 +29103,7 @@ function ShownFooterSections(props) {
|
|
|
29055
29103
|
})]
|
|
29056
29104
|
});
|
|
29057
29105
|
}
|
|
29058
|
-
function AddFooterEngagement({ composition,
|
|
29106
|
+
function AddFooterEngagement({ composition, onAdd }) {
|
|
29059
29107
|
if (composition.sections.some((section) => section.kind === "engagement")) return null;
|
|
29060
29108
|
return /* @__PURE__ */ jsxs("div", {
|
|
29061
29109
|
className: "flex items-center justify-between gap-3 rounded-lg border border-dashed p-3",
|
|
@@ -29064,7 +29112,7 @@ function AddFooterEngagement({ composition, onEngagement }) {
|
|
|
29064
29112
|
children: "Contact form or mailing list"
|
|
29065
29113
|
}), /* @__PURE__ */ jsx("button", {
|
|
29066
29114
|
className: buttonClass$1,
|
|
29067
|
-
onClick:
|
|
29115
|
+
onClick: onAdd,
|
|
29068
29116
|
type: "button",
|
|
29069
29117
|
children: "Add"
|
|
29070
29118
|
})]
|
|
@@ -29112,7 +29160,7 @@ function PlatformCreditSection({ place, credit, onHiddenChange }) {
|
|
|
29112
29160
|
}),
|
|
29113
29161
|
/* @__PURE__ */ jsx("div", {
|
|
29114
29162
|
className: "mt-1 text-xs text-muted-foreground",
|
|
29115
|
-
children: credit.kind === "optional" ? "Your plan lets you
|
|
29163
|
+
children: credit.kind === "optional" ? "Your plan lets you remove this line." : "Included with your Macadamia plan."
|
|
29116
29164
|
}),
|
|
29117
29165
|
credit.kind === "optional" ? /* @__PURE__ */ jsx("div", {
|
|
29118
29166
|
className: "mt-3 flex flex-wrap gap-2",
|
|
@@ -29121,7 +29169,7 @@ function PlatformCreditSection({ place, credit, onHiddenChange }) {
|
|
|
29121
29169
|
disabled: saving,
|
|
29122
29170
|
onClick: () => void change(true),
|
|
29123
29171
|
type: "button",
|
|
29124
|
-
children: "
|
|
29172
|
+
children: "Remove"
|
|
29125
29173
|
})
|
|
29126
29174
|
}) : null,
|
|
29127
29175
|
/* @__PURE__ */ jsx(CreditSaveFailure, { state })
|
|
@@ -29198,7 +29246,7 @@ function ShownFooterSection({ composition, item, manageLinksHref, manageSettings
|
|
|
29198
29246
|
className: buttonClass$1,
|
|
29199
29247
|
onClick: hide,
|
|
29200
29248
|
type: "button",
|
|
29201
|
-
children: "
|
|
29249
|
+
children: "Remove"
|
|
29202
29250
|
}),
|
|
29203
29251
|
/* @__PURE__ */ jsx(ShownSectionSourceActions, {
|
|
29204
29252
|
item,
|
|
@@ -29262,574 +29310,21 @@ function AvailableSection({ item, composition, onChange }) {
|
|
|
29262
29310
|
});
|
|
29263
29311
|
}
|
|
29264
29312
|
//#endregion
|
|
29265
|
-
//#region ../content-editor/src/footerEngagementEditor.ts
|
|
29266
|
-
function resolveFooterEngagementAuthoringState(section, options) {
|
|
29267
|
-
const resolution = resolveFooterEngagementPreview(section, options);
|
|
29268
|
-
if (resolution.kind === "none" || resolution.kind === "resolved") return { kind: "ready" };
|
|
29269
|
-
return {
|
|
29270
|
-
kind: "needs-repair",
|
|
29271
|
-
message: repairMessage(resolution.reason, section, options)
|
|
29272
|
-
};
|
|
29273
|
-
}
|
|
29274
|
-
function resolveFooterEngagementPreview(section, options) {
|
|
29275
|
-
if (section === null || !section.selected) return { kind: "none" };
|
|
29276
|
-
if (section.source.kind === "standard-contact") return resolveStandardContactPreview(section.id, section.source, options);
|
|
29277
|
-
return resolveMailingListPreview(section.id, section.source, options);
|
|
29278
|
-
}
|
|
29279
|
-
function resolveStandardContactPreview(sectionId, source, options) {
|
|
29280
|
-
const form = options.forms.find((candidate) => candidate.id === source.formId);
|
|
29281
|
-
if (form === void 0) return {
|
|
29282
|
-
kind: "needs-attention",
|
|
29283
|
-
reason: "missing-form"
|
|
29284
|
-
};
|
|
29285
|
-
if (form.contactDefinition.kind !== "standard-contact") return {
|
|
29286
|
-
kind: "needs-attention",
|
|
29287
|
-
reason: form.contactDefinition.kind === "invalid-contact" ? "invalid-form" : "wrong-form-kind"
|
|
29288
|
-
};
|
|
29289
|
-
return {
|
|
29290
|
-
kind: "resolved",
|
|
29291
|
-
sectionId,
|
|
29292
|
-
engagement: {
|
|
29293
|
-
kind: "standard-contact",
|
|
29294
|
-
intro: source.intro,
|
|
29295
|
-
runtime: { value: {
|
|
29296
|
-
id: form.id,
|
|
29297
|
-
schemaJson: { fields: form.contactDefinition.fields.filter((field) => field.visible).map((field) => ({
|
|
29298
|
-
id: field.id,
|
|
29299
|
-
label: field.label,
|
|
29300
|
-
required: field.required,
|
|
29301
|
-
type: standardContactFieldType(field.id)
|
|
29302
|
-
})) }
|
|
29303
|
-
} }
|
|
29304
|
-
}
|
|
29305
|
-
};
|
|
29306
|
-
}
|
|
29307
|
-
function resolveMailingListPreview(sectionId, source, options) {
|
|
29308
|
-
if (options.mailingList.tag !== "configured") return {
|
|
29309
|
-
kind: "needs-attention",
|
|
29310
|
-
reason: "destination-not-ready"
|
|
29311
|
-
};
|
|
29312
|
-
if (source.targeting.mode === "custom" && source.targeting.provider !== options.mailingList.provider.provider) return {
|
|
29313
|
-
kind: "needs-attention",
|
|
29314
|
-
reason: "destination-not-ready"
|
|
29315
|
-
};
|
|
29316
|
-
return {
|
|
29317
|
-
kind: "resolved",
|
|
29318
|
-
sectionId,
|
|
29319
|
-
engagement: {
|
|
29320
|
-
kind: "mailing-list",
|
|
29321
|
-
intro: source.intro,
|
|
29322
|
-
runtime: {
|
|
29323
|
-
mode: "preview",
|
|
29324
|
-
source: "preview",
|
|
29325
|
-
mailingList: options.mailingList,
|
|
29326
|
-
targeting: source.targeting
|
|
29327
|
-
}
|
|
29328
|
-
}
|
|
29329
|
-
};
|
|
29330
|
-
}
|
|
29331
|
-
function standardContactFieldType(fieldId) {
|
|
29332
|
-
switch (fieldId) {
|
|
29333
|
-
case "name": return "text";
|
|
29334
|
-
case "email": return "email";
|
|
29335
|
-
case "phone": return "tel";
|
|
29336
|
-
case "message": return "textarea";
|
|
29337
|
-
}
|
|
29338
|
-
}
|
|
29339
|
-
function repairMessage(reason, section, options) {
|
|
29340
|
-
if (section?.source.kind === "standard-contact") return "Choose an available standard contact form.";
|
|
29341
|
-
if (section?.source.kind === "mailing-list" && options.mailingList.tag === "not_configured") return "Set up a mailing list before using this footer form.";
|
|
29342
|
-
return {
|
|
29343
|
-
"missing-form": "Choose an available standard contact form.",
|
|
29344
|
-
"wrong-form-kind": "Choose an available standard contact form.",
|
|
29345
|
-
"invalid-form": "Choose an available standard contact form.",
|
|
29346
|
-
"destination-not-ready": "Choose an available mailing list."
|
|
29347
|
-
}[reason];
|
|
29348
|
-
}
|
|
29349
|
-
//#endregion
|
|
29350
29313
|
//#region ../content-editor/src/footerPreviewRuntime.ts
|
|
29351
29314
|
function buildFooterPreviewRuntime(input) {
|
|
29352
29315
|
return buildFooterRuntimeViewModel({
|
|
29353
29316
|
composition: input.composition,
|
|
29354
29317
|
publicProfile: input.publicProfile,
|
|
29355
|
-
businessAddress: input.
|
|
29318
|
+
businessAddress: input.businessAddress,
|
|
29356
29319
|
hasLogo: input.hasLogo,
|
|
29357
|
-
|
|
29320
|
+
...input.navigationFacts,
|
|
29358
29321
|
hasLegalPolicyNavigation: input.hasLegalPolicyNavigation,
|
|
29359
|
-
|
|
29360
|
-
|
|
29322
|
+
layout: input.layoutSelection.layout,
|
|
29323
|
+
offeredLayouts: input.layoutSelection.offeredLayouts,
|
|
29361
29324
|
engagement: input.engagement,
|
|
29362
|
-
attribution: input.attribution
|
|
29363
|
-
|
|
29364
|
-
}
|
|
29365
|
-
//#endregion
|
|
29366
|
-
//#region ../content-editor/src/session-journal/useJournalTargetRefresh.ts
|
|
29367
|
-
/** A display refresh follows a successful replay; it never supplies replay admission or a receipt. */
|
|
29368
|
-
function useJournalTargetRefresh(journal, target, refresh) {
|
|
29369
|
-
const latest = useRef(refresh);
|
|
29370
|
-
latest.current = refresh;
|
|
29371
|
-
useEffect(() => journal.store.subscribe((next, previous) => {
|
|
29372
|
-
if (previous.replay.kind !== "running" || next.replay.kind !== "idle" || next.cursor === previous.cursor) return;
|
|
29373
|
-
const change = previous.replay.request;
|
|
29374
|
-
if (change.kind !== target.kind || change.siteId !== target.siteId) return;
|
|
29375
|
-
if (!journalTrustAt(next, journalTargetKey(change))) return;
|
|
29376
|
-
Promise.resolve().then(() => latest.current()).catch((error) => {
|
|
29377
|
-
journal.dispatch({ kind: "display-held" });
|
|
29378
|
-
console.error("[editor] journal display refresh failed", error);
|
|
29379
|
-
});
|
|
29380
|
-
}), [
|
|
29381
|
-
journal,
|
|
29382
|
-
target.kind,
|
|
29383
|
-
target.siteId
|
|
29384
|
-
]);
|
|
29385
|
-
}
|
|
29386
|
-
//#endregion
|
|
29387
|
-
//#region ../content-editor/src/footerWriteStatus.ts
|
|
29388
|
-
/** One mounted-visit boundary excludes old receipts and hydration without recording another completion log. */
|
|
29389
|
-
function selectFooterWriteStatus(journal, mounted, siteId, includeTheme) {
|
|
29390
|
-
const facts = selectJournalWriteState(journal, [
|
|
29391
|
-
{
|
|
29392
|
-
kind: "footer-composition",
|
|
29393
|
-
siteId,
|
|
29394
|
-
expectedMailingListProviderScope: null
|
|
29395
|
-
},
|
|
29396
|
-
{
|
|
29397
|
-
kind: "public-profile",
|
|
29398
|
-
siteId
|
|
29399
|
-
},
|
|
29400
|
-
...includeTheme ? [{
|
|
29401
|
-
kind: "theme-selection",
|
|
29402
|
-
siteId,
|
|
29403
|
-
selectionId: null
|
|
29404
|
-
}] : []
|
|
29405
|
-
]);
|
|
29406
|
-
const success = facts.entries.some((entry) => receivedSinceMount(entry, mounted)) || facts.notice?.kind === "replayed" && journal.notice !== mounted.notice;
|
|
29407
|
-
return {
|
|
29408
|
-
saveState: facts.saving ? "saving" : facts.attentionNotice ? facts.attentionNotice.kind === "change" && facts.attentionNotice.reason === "conflict" ? "conflict" : "failed" : success ? "saved" : "idle",
|
|
29409
|
-
message: footerWriteMessage(facts.attentionNotice)
|
|
29410
|
-
};
|
|
29411
|
-
}
|
|
29412
|
-
function receivedSinceMount(entry, mounted) {
|
|
29413
|
-
if (entry.settlement.kind !== "settled") return false;
|
|
29414
|
-
const initial = mounted.entries.find((item) => item.edit.operationId === entry.edit.operationId)?.settlement;
|
|
29415
|
-
return initial?.kind !== "settled" || initial.receipt !== entry.settlement.receipt;
|
|
29416
|
-
}
|
|
29417
|
-
/** Keep footer/profile conflict wording at its existing location; theme and failures share journal copy. */
|
|
29418
|
-
function footerWriteMessage(notice) {
|
|
29419
|
-
if (notice?.kind === "change" && notice.reason === "conflict" && notice.during === "save") {
|
|
29420
|
-
if (notice.target.kind === "footer-composition") return "A newer footer was saved elsewhere. The latest version is shown; review it before trying again.";
|
|
29421
|
-
if (notice.target.kind === "public-profile") return "Shared details changed elsewhere. The latest version is shown; review it before trying again.";
|
|
29422
|
-
}
|
|
29423
|
-
return journalNoticeMessage(notice);
|
|
29424
|
-
}
|
|
29425
|
-
//#endregion
|
|
29426
|
-
//#region ../content-editor/src/useFooterComposerState.ts
|
|
29427
|
-
function useFooterComposerState({ apiClient, canEdit, initialTarget, initialTargetRequestId, navigationLayoutControl = {
|
|
29428
|
-
layout: "stack",
|
|
29429
|
-
pending: false,
|
|
29430
|
-
disabled: true
|
|
29431
|
-
}, includeThemeStatus = true, onSaved, rawSiteId }) {
|
|
29432
|
-
const siteId = useMemo(() => unsafeAsSiteId(rawSiteId), [rawSiteId]);
|
|
29433
|
-
const loaded = useFooterLoad(apiClient, rawSiteId, siteId);
|
|
29434
|
-
useFooterJournalRefresh(rawSiteId, loaded.load);
|
|
29435
|
-
const [target, setTarget] = useFooterEditorTarget(initialTarget, initialTargetRequestId);
|
|
29436
|
-
const session = useFooterSessionState(rawSiteId, canEdit, includeThemeStatus);
|
|
29437
|
-
const saveComposition = useCompositionSaver({
|
|
29438
|
-
apiClient,
|
|
29439
|
-
canEdit,
|
|
29440
|
-
compositionSnapshot: loaded.compositionSnapshot,
|
|
29441
|
-
engagementOptions: loaded.engagementOptions,
|
|
29442
|
-
onSaved,
|
|
29443
|
-
reobserve: loaded.reobserve,
|
|
29444
|
-
setCompositionSnapshot: loaded.setCompositionSnapshot,
|
|
29445
|
-
siteId
|
|
29325
|
+
attribution: input.attribution,
|
|
29326
|
+
...input.suppressSignup ? { suppressSignup: true } : {}
|
|
29446
29327
|
});
|
|
29447
|
-
const saveProfile = useProfileSaver({
|
|
29448
|
-
apiClient,
|
|
29449
|
-
canEdit,
|
|
29450
|
-
onSaved,
|
|
29451
|
-
reobserve: loaded.reobserve,
|
|
29452
|
-
profileSnapshot: loaded.profileSnapshot,
|
|
29453
|
-
setProfileSnapshot: loaded.setProfileSnapshot,
|
|
29454
|
-
siteId
|
|
29455
|
-
});
|
|
29456
|
-
const saveCreditHidden = useCreditSaver({
|
|
29457
|
-
apiClient,
|
|
29458
|
-
canEdit,
|
|
29459
|
-
credit: loaded.credit,
|
|
29460
|
-
onSaved,
|
|
29461
|
-
setCredit: loaded.setCredit,
|
|
29462
|
-
siteId
|
|
29463
|
-
});
|
|
29464
|
-
return {
|
|
29465
|
-
...loaded,
|
|
29466
|
-
...session,
|
|
29467
|
-
navigationLayoutControl,
|
|
29468
|
-
saveCreditHidden,
|
|
29469
|
-
saveComposition,
|
|
29470
|
-
saveProfile,
|
|
29471
|
-
siteId,
|
|
29472
|
-
target,
|
|
29473
|
-
setTarget
|
|
29474
|
-
};
|
|
29475
|
-
}
|
|
29476
|
-
/**
|
|
29477
|
-
* Hiding the platform credit is a site setting, not part of the composition or
|
|
29478
|
-
* its undo history. The line moves once the save lands, so a failure is
|
|
29479
|
-
* reported where the owner clicked.
|
|
29480
|
-
*/
|
|
29481
|
-
function useCreditSaver(options) {
|
|
29482
|
-
const { apiClient, canEdit, credit, onSaved, setCredit, siteId } = options;
|
|
29483
|
-
return useCallback(async (hidden) => {
|
|
29484
|
-
if (credit.kind !== "optional" || !footerAuthoringAllowed(canEdit, siteId)) return "failed";
|
|
29485
|
-
try {
|
|
29486
|
-
setCredit(await updateFooterCredit(apiClient, siteId, { hidden }));
|
|
29487
|
-
onSaved?.();
|
|
29488
|
-
return "saved";
|
|
29489
|
-
} catch {
|
|
29490
|
-
return "failed";
|
|
29491
|
-
}
|
|
29492
|
-
}, [
|
|
29493
|
-
apiClient,
|
|
29494
|
-
canEdit,
|
|
29495
|
-
credit,
|
|
29496
|
-
onSaved,
|
|
29497
|
-
setCredit,
|
|
29498
|
-
siteId
|
|
29499
|
-
]);
|
|
29500
|
-
}
|
|
29501
|
-
/** Status and admission are session facts; the only local marker is this mounted visit's start. */
|
|
29502
|
-
function useFooterSessionState(siteId, canEdit, includeThemeStatus) {
|
|
29503
|
-
const journal = useSessionJournal();
|
|
29504
|
-
const mounted = useMemo(() => journal.store.getState(), [journal, siteId]);
|
|
29505
|
-
const journalState = useStore(journal.store);
|
|
29506
|
-
const admission = useSiteEditorAdmission(siteId);
|
|
29507
|
-
return {
|
|
29508
|
-
...selectFooterWriteStatus(journalState, mounted, siteId, includeThemeStatus),
|
|
29509
|
-
canEdit: canEdit && editorAdmissionIsOpen(admission),
|
|
29510
|
-
authoringAllowed: () => footerAuthoringAllowed(canEdit, siteId)
|
|
29511
|
-
};
|
|
29512
|
-
}
|
|
29513
|
-
function useFooterEditorTarget(initialTarget, initialTargetRequestId) {
|
|
29514
|
-
const [target, setTarget] = useState(initialTarget ?? { kind: "overview" });
|
|
29515
|
-
const initialTargetRef = useRef(initialTarget);
|
|
29516
|
-
initialTargetRef.current = initialTarget;
|
|
29517
|
-
useEffect(() => {
|
|
29518
|
-
if (initialTargetRequestId !== void 0 && initialTargetRef.current) setTarget(initialTargetRef.current);
|
|
29519
|
-
}, [initialTargetRequestId]);
|
|
29520
|
-
return [target, setTarget];
|
|
29521
|
-
}
|
|
29522
|
-
function useFooterJournalRefresh(siteId, refresh) {
|
|
29523
|
-
const journal = useSessionJournal();
|
|
29524
|
-
useJournalTargetRefresh(journal, {
|
|
29525
|
-
kind: "footer-composition",
|
|
29526
|
-
siteId
|
|
29527
|
-
}, refresh);
|
|
29528
|
-
useJournalTargetRefresh(journal, {
|
|
29529
|
-
kind: "public-profile",
|
|
29530
|
-
siteId
|
|
29531
|
-
}, refresh);
|
|
29532
|
-
}
|
|
29533
|
-
function footerAuthoringAllowed(canEdit, siteId) {
|
|
29534
|
-
return canEdit && editorAdmissionIsOpen(editorAdmissionSession.read(siteId));
|
|
29535
|
-
}
|
|
29536
|
-
function footerErrorMessage(error, fallback = "The footer could not be loaded.") {
|
|
29537
|
-
return error instanceof Error ? error.message : fallback;
|
|
29538
|
-
}
|
|
29539
|
-
/** Everything the composer shows, read together so the screen never mixes two moments. */
|
|
29540
|
-
async function readFooterAuthoring(apiClient, rawSiteId, siteId) {
|
|
29541
|
-
const [composition, profile, navigation, engagement] = await Promise.all([
|
|
29542
|
-
getFooterComposition(apiClient, siteId),
|
|
29543
|
-
getPublicProfile(apiClient, siteId),
|
|
29544
|
-
getNavigationMenus(apiClient, { siteId: rawSiteId }),
|
|
29545
|
-
getFooterEngagementAuthoringOptions(apiClient, siteId)
|
|
29546
|
-
]);
|
|
29547
|
-
return {
|
|
29548
|
-
composition,
|
|
29549
|
-
profile,
|
|
29550
|
-
navigation,
|
|
29551
|
-
engagement
|
|
29552
|
-
};
|
|
29553
|
-
}
|
|
29554
|
-
/**
|
|
29555
|
-
* The platform credit as last confirmed. A reload that started before a credit
|
|
29556
|
-
* save landed must not undo it, so a read applies only if no save came since.
|
|
29557
|
-
*/
|
|
29558
|
-
function useCreditState() {
|
|
29559
|
-
const [credit, setCreditState] = useState({ kind: "not-shown" });
|
|
29560
|
-
const writes = useRef(0);
|
|
29561
|
-
return {
|
|
29562
|
-
credit,
|
|
29563
|
-
setCredit: useCallback((next) => {
|
|
29564
|
-
writes.current += 1;
|
|
29565
|
-
setCreditState(next);
|
|
29566
|
-
}, []),
|
|
29567
|
-
readCredit: useCallback(() => {
|
|
29568
|
-
const writesAtStart = writes.current;
|
|
29569
|
-
return (read) => {
|
|
29570
|
-
if (writes.current === writesAtStart) setCreditState(read);
|
|
29571
|
-
};
|
|
29572
|
-
}, [])
|
|
29573
|
-
};
|
|
29574
|
-
}
|
|
29575
|
-
function useFooterLoad(apiClient, rawSiteId, siteId) {
|
|
29576
|
-
const [compositionSnapshot, setCompositionSnapshot] = useState(null);
|
|
29577
|
-
const [profileSnapshot, setProfileSnapshot] = useState(null);
|
|
29578
|
-
const [navigationMenus, setNavigationMenus] = useState(null);
|
|
29579
|
-
const [engagementOptions, setEngagementOptions] = useState(null);
|
|
29580
|
-
const { credit, setCredit, readCredit } = useCreditState();
|
|
29581
|
-
const [loadError, setLoadError] = useState(null);
|
|
29582
|
-
const baseline = useFooterJournalBaseline(apiClient, rawSiteId, siteId);
|
|
29583
|
-
const load = useCallback(async () => {
|
|
29584
|
-
setLoadError(null);
|
|
29585
|
-
try {
|
|
29586
|
-
const applyCredit = readCredit();
|
|
29587
|
-
const { composition, profile, navigation, engagement } = await readFooterAuthoring(apiClient, rawSiteId, siteId);
|
|
29588
|
-
setCompositionSnapshot(composition);
|
|
29589
|
-
applyCredit(composition.credit);
|
|
29590
|
-
setProfileSnapshot(profile);
|
|
29591
|
-
baseline.observe(composition, profile);
|
|
29592
|
-
setNavigationMenus(navigation.menus);
|
|
29593
|
-
setEngagementOptions(engagement);
|
|
29594
|
-
} catch (error) {
|
|
29595
|
-
setLoadError(footerErrorMessage(error));
|
|
29596
|
-
}
|
|
29597
|
-
}, [
|
|
29598
|
-
apiClient,
|
|
29599
|
-
baseline,
|
|
29600
|
-
rawSiteId,
|
|
29601
|
-
readCredit,
|
|
29602
|
-
siteId
|
|
29603
|
-
]);
|
|
29604
|
-
useEffect(() => {
|
|
29605
|
-
load();
|
|
29606
|
-
}, [load]);
|
|
29607
|
-
return {
|
|
29608
|
-
credit,
|
|
29609
|
-
compositionSnapshot,
|
|
29610
|
-
engagementOptions,
|
|
29611
|
-
load,
|
|
29612
|
-
reobserve: baseline.reobserve,
|
|
29613
|
-
loadError,
|
|
29614
|
-
navigationMenus,
|
|
29615
|
-
profileSnapshot,
|
|
29616
|
-
setCompositionSnapshot,
|
|
29617
|
-
setCredit,
|
|
29618
|
-
setProfileSnapshot
|
|
29619
|
-
};
|
|
29620
|
-
}
|
|
29621
|
-
/**
|
|
29622
|
-
* Every read of the stored footer and profile is this session's baseline for both journal targets.
|
|
29623
|
-
* After an uncertain save the journal holds them; `reobserve` reads what is stored and lifts the hold
|
|
29624
|
-
* without replacing what is on screen.
|
|
29625
|
-
*/
|
|
29626
|
-
function useFooterJournalBaseline(apiClient, rawSiteId, siteId) {
|
|
29627
|
-
const journal = useSessionJournal();
|
|
29628
|
-
return useMemo(() => {
|
|
29629
|
-
const observe = (composition, profile) => {
|
|
29630
|
-
if (composition.kind === "ready") journal.observe({
|
|
29631
|
-
kind: "footer-composition",
|
|
29632
|
-
siteId: rawSiteId,
|
|
29633
|
-
expectedMailingListProviderScope: null,
|
|
29634
|
-
value: composition.composition,
|
|
29635
|
-
revision: composition.revision
|
|
29636
|
-
});
|
|
29637
|
-
if (profile.kind === "ready") journal.observe({
|
|
29638
|
-
kind: "public-profile",
|
|
29639
|
-
siteId: rawSiteId,
|
|
29640
|
-
value: profile.profile,
|
|
29641
|
-
revision: profile.revision
|
|
29642
|
-
});
|
|
29643
|
-
};
|
|
29644
|
-
const reobserve = async () => {
|
|
29645
|
-
const [composition, profile] = await Promise.all([getFooterComposition(apiClient, siteId), getPublicProfile(apiClient, siteId)]);
|
|
29646
|
-
observe(composition, profile);
|
|
29647
|
-
};
|
|
29648
|
-
return {
|
|
29649
|
-
observe,
|
|
29650
|
-
reobserve
|
|
29651
|
-
};
|
|
29652
|
-
}, [
|
|
29653
|
-
apiClient,
|
|
29654
|
-
journal,
|
|
29655
|
-
rawSiteId,
|
|
29656
|
-
siteId
|
|
29657
|
-
]);
|
|
29658
|
-
}
|
|
29659
|
-
function useOptimisticSave(siteId, snapshot, setSnapshot) {
|
|
29660
|
-
const latest = useRef({
|
|
29661
|
-
siteId,
|
|
29662
|
-
snapshot,
|
|
29663
|
-
confirmed: snapshot,
|
|
29664
|
-
request: null
|
|
29665
|
-
});
|
|
29666
|
-
if (latest.current.siteId !== siteId || latest.current.snapshot !== snapshot) latest.current = {
|
|
29667
|
-
siteId,
|
|
29668
|
-
snapshot,
|
|
29669
|
-
confirmed: snapshot,
|
|
29670
|
-
request: null
|
|
29671
|
-
};
|
|
29672
|
-
useEffect(() => () => {
|
|
29673
|
-
latest.current.request = null;
|
|
29674
|
-
}, []);
|
|
29675
|
-
return (candidate) => {
|
|
29676
|
-
const request = {};
|
|
29677
|
-
const confirmed = latest.current.confirmed;
|
|
29678
|
-
latest.current = {
|
|
29679
|
-
...latest.current,
|
|
29680
|
-
request
|
|
29681
|
-
};
|
|
29682
|
-
if (candidate) {
|
|
29683
|
-
latest.current.snapshot = candidate;
|
|
29684
|
-
setSnapshot(candidate);
|
|
29685
|
-
}
|
|
29686
|
-
const settle = (saved) => {
|
|
29687
|
-
if (latest.current.request !== request) return false;
|
|
29688
|
-
latest.current = {
|
|
29689
|
-
siteId,
|
|
29690
|
-
snapshot: saved,
|
|
29691
|
-
confirmed: saved,
|
|
29692
|
-
request: null
|
|
29693
|
-
};
|
|
29694
|
-
if (saved) setSnapshot(saved);
|
|
29695
|
-
return true;
|
|
29696
|
-
};
|
|
29697
|
-
return {
|
|
29698
|
-
settle,
|
|
29699
|
-
rollback: () => settle(confirmed)
|
|
29700
|
-
};
|
|
29701
|
-
};
|
|
29702
|
-
}
|
|
29703
|
-
function useCompositionSaver(options) {
|
|
29704
|
-
const journal = useSessionJournal();
|
|
29705
|
-
const begin = useOptimisticSave(options.siteId, options.compositionSnapshot, options.setCompositionSnapshot);
|
|
29706
|
-
return async (next, optimistic = true) => {
|
|
29707
|
-
const snapshot = options.compositionSnapshot;
|
|
29708
|
-
if (!footerAuthoringAllowed(options.canEdit, options.siteId) || snapshot?.kind !== "ready") return "failed";
|
|
29709
|
-
const captured = captureComposition(journal, options, snapshot, next);
|
|
29710
|
-
if (captured.reservation.kind === "busy") return "failed";
|
|
29711
|
-
const request = begin(optimistic ? {
|
|
29712
|
-
...snapshot,
|
|
29713
|
-
composition: next
|
|
29714
|
-
} : null);
|
|
29715
|
-
return saveCompositionRequest(options, next, snapshot.revision, request, {
|
|
29716
|
-
reservation: captured.reservation,
|
|
29717
|
-
change: captured.change
|
|
29718
|
-
});
|
|
29719
|
-
};
|
|
29720
|
-
}
|
|
29721
|
-
function captureComposition(journal, options, snapshot, next) {
|
|
29722
|
-
const change = {
|
|
29723
|
-
kind: "footer-composition",
|
|
29724
|
-
siteId: options.siteId,
|
|
29725
|
-
before: snapshot.composition,
|
|
29726
|
-
after: next,
|
|
29727
|
-
expectedMailingListProviderScope: options.engagementOptions?.expectedMailingListProviderScope ?? null
|
|
29728
|
-
};
|
|
29729
|
-
return {
|
|
29730
|
-
change,
|
|
29731
|
-
reservation: journal.accept({
|
|
29732
|
-
expectedRevision: snapshot.revision,
|
|
29733
|
-
...change,
|
|
29734
|
-
textKey: null,
|
|
29735
|
-
label: journalLabels.footer
|
|
29736
|
-
})
|
|
29737
|
-
};
|
|
29738
|
-
}
|
|
29739
|
-
async function saveCompositionRequest(options, next, baseRevision, request, captured) {
|
|
29740
|
-
try {
|
|
29741
|
-
if (!footerAuthoringAllowed(options.canEdit, options.siteId)) throw new JournalWriteRefused("Editor admission closed before the footer save");
|
|
29742
|
-
const result = await updateFooterComposition(options.apiClient, options.siteId, {
|
|
29743
|
-
composition: next,
|
|
29744
|
-
baseRevision,
|
|
29745
|
-
expectedMailingListProviderScope: options.engagementOptions?.expectedMailingListProviderScope ?? void 0
|
|
29746
|
-
});
|
|
29747
|
-
if (result.kind === "conflict") {
|
|
29748
|
-
if (result.authoritative.kind === "ready") captured.reservation.conflict({
|
|
29749
|
-
kind: "footer-composition",
|
|
29750
|
-
siteId: options.siteId,
|
|
29751
|
-
expectedMailingListProviderScope: captured.change.expectedMailingListProviderScope,
|
|
29752
|
-
value: result.authoritative.composition,
|
|
29753
|
-
revision: result.authoritative.revision
|
|
29754
|
-
});
|
|
29755
|
-
else captured.reservation.stale();
|
|
29756
|
-
request.settle(result.authoritative);
|
|
29757
|
-
return "conflict";
|
|
29758
|
-
}
|
|
29759
|
-
captured.reservation.settle({
|
|
29760
|
-
expectedRevision: baseRevision,
|
|
29761
|
-
revision: result.snapshot.revision,
|
|
29762
|
-
...captured.change,
|
|
29763
|
-
after: result.snapshot.composition
|
|
29764
|
-
});
|
|
29765
|
-
if (request.settle(result.snapshot)) options.onSaved?.();
|
|
29766
|
-
return "saved";
|
|
29767
|
-
} catch (error) {
|
|
29768
|
-
captured.reservation.fail(error);
|
|
29769
|
-
if (captured.reservation.held()) options.reobserve().catch(() => void 0);
|
|
29770
|
-
request.rollback();
|
|
29771
|
-
return "failed";
|
|
29772
|
-
}
|
|
29773
|
-
}
|
|
29774
|
-
function useProfileSaver(options) {
|
|
29775
|
-
const journal = useSessionJournal();
|
|
29776
|
-
const begin = useOptimisticSave(options.siteId, options.profileSnapshot, options.setProfileSnapshot);
|
|
29777
|
-
return async (next) => {
|
|
29778
|
-
const snapshot = options.profileSnapshot;
|
|
29779
|
-
if (!footerAuthoringAllowed(options.canEdit, options.siteId) || snapshot?.kind !== "ready") return;
|
|
29780
|
-
const change = {
|
|
29781
|
-
kind: "public-profile",
|
|
29782
|
-
siteId: options.siteId,
|
|
29783
|
-
before: snapshot.profile,
|
|
29784
|
-
after: next
|
|
29785
|
-
};
|
|
29786
|
-
const reservation = journal.accept({
|
|
29787
|
-
expectedRevision: snapshot.revision,
|
|
29788
|
-
...change,
|
|
29789
|
-
textKey: null,
|
|
29790
|
-
label: journalLabels.profile
|
|
29791
|
-
});
|
|
29792
|
-
if (reservation.kind === "busy") return;
|
|
29793
|
-
const request = begin({
|
|
29794
|
-
...snapshot,
|
|
29795
|
-
profile: next
|
|
29796
|
-
});
|
|
29797
|
-
await saveProfileRequest(options, next, snapshot.revision, request, {
|
|
29798
|
-
reservation,
|
|
29799
|
-
change
|
|
29800
|
-
});
|
|
29801
|
-
};
|
|
29802
|
-
}
|
|
29803
|
-
async function saveProfileRequest(options, next, baseRevision, request, captured) {
|
|
29804
|
-
try {
|
|
29805
|
-
if (!footerAuthoringAllowed(options.canEdit, options.siteId)) throw new JournalWriteRefused("Editor admission closed before the profile save");
|
|
29806
|
-
const result = await updatePublicProfile(options.apiClient, options.siteId, {
|
|
29807
|
-
profile: next,
|
|
29808
|
-
baseRevision
|
|
29809
|
-
});
|
|
29810
|
-
if (result.kind === "conflict") {
|
|
29811
|
-
if (result.authoritative.kind === "ready") captured.reservation.conflict({
|
|
29812
|
-
kind: "public-profile",
|
|
29813
|
-
siteId: options.siteId,
|
|
29814
|
-
value: result.authoritative.profile,
|
|
29815
|
-
revision: result.authoritative.revision
|
|
29816
|
-
});
|
|
29817
|
-
else captured.reservation.stale();
|
|
29818
|
-
request.settle(result.authoritative);
|
|
29819
|
-
return;
|
|
29820
|
-
}
|
|
29821
|
-
captured.reservation.settle({
|
|
29822
|
-
expectedRevision: baseRevision,
|
|
29823
|
-
revision: result.snapshot.revision,
|
|
29824
|
-
...captured.change,
|
|
29825
|
-
after: result.snapshot.profile
|
|
29826
|
-
});
|
|
29827
|
-
if (request.settle(result.snapshot)) options.onSaved?.();
|
|
29828
|
-
} catch (error) {
|
|
29829
|
-
captured.reservation.fail(error);
|
|
29830
|
-
if (captured.reservation.held()) options.reobserve().catch(() => void 0);
|
|
29831
|
-
request.rollback();
|
|
29832
|
-
}
|
|
29833
29328
|
}
|
|
29834
29329
|
//#endregion
|
|
29835
29330
|
//#region ../content-editor/src/FooterComposerPanel.tsx
|
|
@@ -29843,34 +29338,40 @@ const moduleFieldCatalog = [{
|
|
|
29843
29338
|
required: false,
|
|
29844
29339
|
maxLength: 80
|
|
29845
29340
|
}];
|
|
29846
|
-
|
|
29847
|
-
|
|
29848
|
-
|
|
29849
|
-
|
|
29850
|
-
|
|
29851
|
-
|
|
29852
|
-
|
|
29853
|
-
|
|
29854
|
-
|
|
29855
|
-
|
|
29856
|
-
|
|
29857
|
-
|
|
29858
|
-
|
|
29859
|
-
];
|
|
29860
|
-
if (module.kind === "supporting-text" || module.kind === "legal") return [...moduleFieldCatalog, {
|
|
29341
|
+
/** The heading field, with a note when this layout draws the section's heading as an icon. */
|
|
29342
|
+
function headingField(headingAsIcon) {
|
|
29343
|
+
const [heading] = moduleFieldCatalog;
|
|
29344
|
+
if (!heading) throw new Error("The footer heading field is missing");
|
|
29345
|
+
return headingAsIcon ? {
|
|
29346
|
+
...heading,
|
|
29347
|
+
description: SECTION_HEADING_AS_ICON
|
|
29348
|
+
} : heading;
|
|
29349
|
+
}
|
|
29350
|
+
const SECTION_HEADING_AS_ICON = "Shown as an icon in this layout.";
|
|
29351
|
+
function fieldsForModule(module, headingAsIcon) {
|
|
29352
|
+
const heading = headingField(headingAsIcon);
|
|
29353
|
+
if (module.kind === "supporting-text" || module.kind === "legal") return [heading, {
|
|
29861
29354
|
id: "content",
|
|
29862
29355
|
type: "richText",
|
|
29863
29356
|
label: module.kind === "legal" ? "Legal text" : "Supporting text"
|
|
29864
29357
|
}];
|
|
29865
|
-
return [
|
|
29358
|
+
return [heading];
|
|
29866
29359
|
}
|
|
29867
|
-
function FooterComposerPanel(
|
|
29868
|
-
|
|
29360
|
+
function FooterComposerPanel(props) {
|
|
29361
|
+
return useFooterAuthoringOptional() ? /* @__PURE__ */ jsx(FooterComposerContent, { ...props }) : /* @__PURE__ */ jsx(FooterComposerProvider, {
|
|
29362
|
+
apiClient: props.apiClient,
|
|
29363
|
+
rawSiteId: props.siteId,
|
|
29364
|
+
canEdit: props.canEdit ?? true,
|
|
29365
|
+
onSaved: props.onSaved,
|
|
29366
|
+
children: /* @__PURE__ */ jsx(FooterComposerContent, { ...props })
|
|
29367
|
+
}, props.siteId);
|
|
29368
|
+
}
|
|
29369
|
+
function FooterComposerContent({ apiClient, siteId: rawSiteId, customFooterMode, manageLinksHref, manageFormsHref = manageLinksHref.replace(/\/navigation$/u, "/forms"), manageNewsletterHref = manageLinksHref.replace(/\/navigation$/u, "/newsletter"), manageSettingsHref, widgets, layoutSelection, liveRuntime, appearanceControls, initialTarget, initialTargetRequestId, variant = "full", canEdit = true, onSaved, loadingFallback }) {
|
|
29370
|
+
const { businessAddress, authoringAllowed, canEdit: authoringEnabled, compositionSnapshot, engagementOptions, fieldState, retryFailedDrafts, acceptingEdits, load, loadError, writeStatus, compositionDrafts, profileDrafts, navigationMenus, profileSnapshot, credit, saveComposition, saveCreditHidden, saveProfile, setCompositionSnapshot, setTarget, siteId, target } = useFooterComposerState({
|
|
29869
29371
|
apiClient,
|
|
29870
29372
|
canEdit,
|
|
29871
29373
|
initialTarget,
|
|
29872
29374
|
initialTargetRequestId,
|
|
29873
|
-
navigationLayoutControl: suppliedNavigationControl,
|
|
29874
29375
|
includeThemeStatus: variant === "full",
|
|
29875
29376
|
onSaved,
|
|
29876
29377
|
rawSiteId
|
|
@@ -29896,96 +29397,101 @@ function FooterComposerPanel({ apiClient, siteId: rawSiteId, customFooterMode, m
|
|
|
29896
29397
|
}
|
|
29897
29398
|
});
|
|
29898
29399
|
return /* @__PURE__ */ jsx(ReadyFooterComposer, {
|
|
29400
|
+
businessAddress,
|
|
29899
29401
|
canEdit: authoringEnabled,
|
|
29900
29402
|
compositionSnapshot,
|
|
29901
29403
|
customFooterMode,
|
|
29902
29404
|
engagementOptions,
|
|
29903
|
-
|
|
29405
|
+
layoutSelection,
|
|
29406
|
+
liveRuntime,
|
|
29407
|
+
appearanceControls,
|
|
29904
29408
|
manageFormsHref,
|
|
29905
29409
|
manageLinksHref,
|
|
29906
29410
|
manageNewsletterHref,
|
|
29907
29411
|
manageSettingsHref,
|
|
29908
|
-
|
|
29909
|
-
|
|
29412
|
+
widgets,
|
|
29413
|
+
writeStatus,
|
|
29414
|
+
compositionDrafts,
|
|
29415
|
+
profileDrafts,
|
|
29416
|
+
retryFailedDrafts,
|
|
29417
|
+
acceptingEdits,
|
|
29910
29418
|
navigationMenus,
|
|
29911
29419
|
profileSnapshot,
|
|
29912
29420
|
credit,
|
|
29913
29421
|
saveComposition,
|
|
29914
29422
|
saveCreditHidden,
|
|
29915
29423
|
saveProfile,
|
|
29916
|
-
saveState,
|
|
29917
29424
|
setTarget,
|
|
29425
|
+
beginAddingEngagement: fieldState.beginAddingEngagement,
|
|
29918
29426
|
target,
|
|
29919
29427
|
variant
|
|
29920
29428
|
});
|
|
29921
29429
|
}
|
|
29922
29430
|
function ReadyFooterComposer(props) {
|
|
29923
|
-
const
|
|
29924
|
-
const { canEdit, compositionSnapshot, engagementOptions, arrangement, navigationLayoutControl, navigationMenus, profileSnapshot, target } = props;
|
|
29925
|
-
const candidateComposition = engagementCandidate === null ? null : upsertFooterEngagementSection(compositionSnapshot.composition, engagementCandidate);
|
|
29926
|
-
const previewComposition = candidateComposition?.ok === true ? candidateComposition.value : compositionSnapshot.composition;
|
|
29927
|
-
const candidateError = candidateComposition?.ok === false ? candidateComposition.error.message : null;
|
|
29431
|
+
const { canEdit, compositionSnapshot, engagementOptions, layoutSelection, navigationMenus, profileSnapshot, target } = props;
|
|
29928
29432
|
const currentEngagement = compositionSnapshot.composition.sections.find((section) => section.kind === "engagement") ?? null;
|
|
29929
|
-
const
|
|
29930
|
-
const
|
|
29931
|
-
const
|
|
29932
|
-
const
|
|
29933
|
-
|
|
29934
|
-
const plan = planFooterEditorView({
|
|
29935
|
-
composition: previewComposition,
|
|
29433
|
+
const engagementReadiness = resolveFooterEngagementAuthoringState(currentEngagement, engagementOptions);
|
|
29434
|
+
const resolvedEngagement = resolveFooterEngagementPreview(currentEngagement, engagementOptions);
|
|
29435
|
+
const navigationFacts = footerMenuNavigationFacts(navigationMenus);
|
|
29436
|
+
const previewRuntime = buildFooterPreviewRuntime({
|
|
29437
|
+
composition: compositionSnapshot.composition,
|
|
29936
29438
|
publicProfile: profileSnapshot.profile,
|
|
29937
|
-
|
|
29439
|
+
businessAddress: props.businessAddress,
|
|
29938
29440
|
hasLogo: profileSnapshot.hasLogo,
|
|
29939
|
-
|
|
29940
|
-
hasLegalPolicyNavigation,
|
|
29941
|
-
|
|
29942
|
-
|
|
29943
|
-
|
|
29944
|
-
navigationLayout: navigationLayoutControl.layout
|
|
29441
|
+
navigationFacts,
|
|
29442
|
+
hasLegalPolicyNavigation: navigationFacts.hasLegalPolicyNavigation,
|
|
29443
|
+
layoutSelection,
|
|
29444
|
+
engagement: resolvedEngagement,
|
|
29445
|
+
attribution: footerCreditLine(props.credit)
|
|
29945
29446
|
});
|
|
29946
|
-
const
|
|
29947
|
-
|
|
29447
|
+
const shownRuntime = props.liveRuntime ?? previewRuntime;
|
|
29448
|
+
const plan = planFooterEditorView({
|
|
29449
|
+
composition: compositionSnapshot.composition,
|
|
29948
29450
|
publicProfile: profileSnapshot.profile,
|
|
29949
29451
|
hasBusinessAddress: profileSnapshot.hasBusinessAddress,
|
|
29950
29452
|
hasLogo: profileSnapshot.hasLogo,
|
|
29951
|
-
hasMainNavigation,
|
|
29952
|
-
hasLegalPolicyNavigation,
|
|
29953
|
-
|
|
29954
|
-
|
|
29955
|
-
|
|
29956
|
-
attribution: footerCreditLine(props.credit)
|
|
29453
|
+
hasMainNavigation: navigationFacts.hasFooterNavigation,
|
|
29454
|
+
hasLegalPolicyNavigation: navigationFacts.hasLegalPolicyNavigation,
|
|
29455
|
+
hasEngagementSource: resolvedEngagement.kind === "resolved",
|
|
29456
|
+
canEdit,
|
|
29457
|
+
layout: shownRuntime.presentation.effective
|
|
29957
29458
|
});
|
|
29958
29459
|
const targetModule = target.kind === "module" ? compositionSnapshot.composition.sections.find((section) => section.id === target.moduleId) ?? null : null;
|
|
29959
29460
|
const editingEngagement = target.kind === "engagement" || targetModule?.kind === "engagement";
|
|
29461
|
+
const openPartKey = editingEngagement ? footerPartKey({
|
|
29462
|
+
kind: "engagement",
|
|
29463
|
+
section: unsafeAsFooterModuleId("engagement"),
|
|
29464
|
+
fields: {}
|
|
29465
|
+
}) : targetModule ? footerPartKey({
|
|
29466
|
+
kind: "section-text",
|
|
29467
|
+
section: targetModule.id,
|
|
29468
|
+
fields: {}
|
|
29469
|
+
}) : null;
|
|
29960
29470
|
const editor = /* @__PURE__ */ jsx(FooterEditorPane, {
|
|
29961
29471
|
...props,
|
|
29962
29472
|
currentEngagement,
|
|
29963
29473
|
editingEngagement,
|
|
29964
|
-
engagementCandidate,
|
|
29965
29474
|
engagementReadiness,
|
|
29966
29475
|
plan,
|
|
29967
|
-
|
|
29476
|
+
shownRuntime,
|
|
29968
29477
|
targetModule
|
|
29969
29478
|
});
|
|
29970
29479
|
return /* @__PURE__ */ jsx(FooterComposerLayout, {
|
|
29971
29480
|
customFooterMode: props.customFooterMode,
|
|
29972
29481
|
editor,
|
|
29973
|
-
|
|
29482
|
+
writeStatus: footerHeaderStatus(props.writeStatus, [...props.compositionDrafts, ...props.profileDrafts], openPartKey),
|
|
29483
|
+
retryFailedDrafts: props.retryFailedDrafts,
|
|
29974
29484
|
previewRuntime,
|
|
29975
|
-
saveState: props.saveState,
|
|
29976
|
-
showStagedPreview: engagementCandidate !== null,
|
|
29977
29485
|
variant: props.variant
|
|
29978
29486
|
});
|
|
29979
29487
|
}
|
|
29488
|
+
/** In the details strip the footer draws an icon where the section's heading would be. */
|
|
29489
|
+
function headingShownAsIcon(runtime, moduleId) {
|
|
29490
|
+
return runtime.regions.some((region) => region.slot === "strip" && region.groups.some((group) => group.modules.some((module) => module.id === moduleId)));
|
|
29491
|
+
}
|
|
29980
29492
|
function FooterEditorPane(props) {
|
|
29981
|
-
const applyEngagement = async () => {
|
|
29982
|
-
if (props.engagementCandidate === null) return;
|
|
29983
|
-
const next = upsertFooterEngagementSection(props.compositionSnapshot.composition, props.engagementCandidate);
|
|
29984
|
-
if (!next.ok) return;
|
|
29985
|
-
if (await props.saveComposition(next.value, false) !== "failed") props.setEngagementCandidate(null);
|
|
29986
|
-
};
|
|
29987
29493
|
return /* @__PURE__ */ jsxs("fieldset", {
|
|
29988
|
-
disabled: !props.canEdit,
|
|
29494
|
+
disabled: !props.canEdit || !props.acceptingEdits,
|
|
29989
29495
|
className: props.variant === "sidebar" ? "space-y-4 p-4" : "space-y-4 rounded-xl border bg-card p-4 lg:sticky lg:top-6 lg:self-start",
|
|
29990
29496
|
children: [
|
|
29991
29497
|
!props.canEdit ? /* @__PURE__ */ jsx("p", {
|
|
@@ -29998,45 +29504,21 @@ function FooterEditorPane(props) {
|
|
|
29998
29504
|
onClick: () => props.setTarget({ kind: "overview" }),
|
|
29999
29505
|
children: "← Footer overview"
|
|
30000
29506
|
}) : null,
|
|
30001
|
-
props.target.kind === "overview" ? /* @__PURE__ */ jsx(
|
|
30002
|
-
credit: props.credit,
|
|
30003
|
-
onCreditHiddenChange: props.saveCreditHidden,
|
|
30004
|
-
composition: props.compositionSnapshot.composition,
|
|
30005
|
-
manageLinksHref: props.manageLinksHref,
|
|
30006
|
-
manageSettingsHref: props.manageSettingsHref,
|
|
30007
|
-
onChange: props.saveComposition,
|
|
30008
|
-
onEngagement: () => props.setTarget({ kind: "engagement" }),
|
|
30009
|
-
onTarget: props.setTarget,
|
|
30010
|
-
plan: props.plan,
|
|
30011
|
-
navigationLayout: props.navigationLayoutControl.layout,
|
|
30012
|
-
navigationLayoutPending: props.navigationLayoutControl.pending,
|
|
30013
|
-
navigationLayoutDisabled: props.navigationLayoutControl.disabled,
|
|
30014
|
-
arrangement: props.arrangement,
|
|
30015
|
-
onNavigationLayoutChange: props.navigationLayoutControl.onChange
|
|
30016
|
-
}) : null,
|
|
29507
|
+
props.target.kind === "overview" ? /* @__PURE__ */ jsx(FooterOverviewPane, { ...props }) : null,
|
|
30017
29508
|
props.target.kind === "module" && !props.editingEngagement ? /* @__PURE__ */ jsx(ModuleEditor, {
|
|
30018
29509
|
module: props.targetModule,
|
|
30019
29510
|
composition: props.compositionSnapshot.composition,
|
|
30020
29511
|
onChange: props.saveComposition,
|
|
29512
|
+
headingAsIcon: props.targetModule ? headingShownAsIcon(props.shownRuntime, props.targetModule.id) : false,
|
|
29513
|
+
hasLogo: props.profileSnapshot.hasLogo,
|
|
29514
|
+
manageSettingsHref: props.manageSettingsHref,
|
|
29515
|
+
widgets: props.widgets,
|
|
30021
29516
|
onShared: (section) => props.setTarget({
|
|
30022
29517
|
kind: "shared-profile",
|
|
30023
29518
|
section
|
|
30024
29519
|
})
|
|
30025
29520
|
}) : null,
|
|
30026
|
-
props.editingEngagement ? /* @__PURE__ */ jsx(
|
|
30027
|
-
candidate: props.engagementCandidate,
|
|
30028
|
-
current: props.currentEngagement,
|
|
30029
|
-
manageFormsHref: props.manageFormsHref,
|
|
30030
|
-
manageNewsletterHref: props.manageNewsletterHref,
|
|
30031
|
-
onApply: applyEngagement,
|
|
30032
|
-
onCancel: () => props.setEngagementCandidate(null),
|
|
30033
|
-
onPreview: props.setEngagementCandidate,
|
|
30034
|
-
onRemove: async () => {
|
|
30035
|
-
if (await props.saveComposition(removeFooterEngagementSection(props.compositionSnapshot.composition), false) !== "failed") props.setEngagementCandidate(null);
|
|
30036
|
-
},
|
|
30037
|
-
options: props.engagementOptions,
|
|
30038
|
-
readiness: props.engagementReadiness
|
|
30039
|
-
}, `${props.engagementCandidate?.id ?? props.compositionSnapshot.revision}:${props.currentEngagement?.source.kind ?? "none"}`) : null,
|
|
29521
|
+
props.editingEngagement ? /* @__PURE__ */ jsx(FooterEngagementPane, { ...props }) : null,
|
|
30040
29522
|
props.target.kind === "shared-profile" ? /* @__PURE__ */ jsx(SharedProfileEditor, {
|
|
30041
29523
|
section: props.target.section,
|
|
30042
29524
|
profile: props.profileSnapshot.profile,
|
|
@@ -30046,40 +29528,74 @@ function FooterEditorPane(props) {
|
|
|
30046
29528
|
]
|
|
30047
29529
|
});
|
|
30048
29530
|
}
|
|
30049
|
-
function
|
|
29531
|
+
function FooterOverviewPane(props) {
|
|
29532
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [Boolean(props.appearanceControls) || props.plan.shown.some(({ section }) => section.kind === "brand") ? /* @__PURE__ */ jsxs("section", {
|
|
29533
|
+
"aria-label": "How it looks",
|
|
29534
|
+
className: "space-y-3",
|
|
29535
|
+
children: [props.appearanceControls, /* @__PURE__ */ jsx(FooterBrandChoiceControl, {
|
|
29536
|
+
composition: props.compositionSnapshot.composition,
|
|
29537
|
+
hasLogo: props.profileSnapshot.hasLogo,
|
|
29538
|
+
manageSettingsHref: props.manageSettingsHref,
|
|
29539
|
+
onChange: (composition) => void props.saveComposition(composition)
|
|
29540
|
+
})]
|
|
29541
|
+
}) : null, /* @__PURE__ */ jsx(FooterOverview, {
|
|
29542
|
+
credit: props.credit,
|
|
29543
|
+
onCreditHiddenChange: props.saveCreditHidden,
|
|
29544
|
+
composition: props.compositionSnapshot.composition,
|
|
29545
|
+
manageLinksHref: props.manageLinksHref,
|
|
29546
|
+
manageSettingsHref: props.manageSettingsHref,
|
|
29547
|
+
onChange: props.saveComposition,
|
|
29548
|
+
onEngagement: () => props.setTarget({ kind: "engagement" }),
|
|
29549
|
+
onAddEngagement: () => {
|
|
29550
|
+
props.beginAddingEngagement();
|
|
29551
|
+
props.setTarget({ kind: "engagement" });
|
|
29552
|
+
},
|
|
29553
|
+
onTarget: props.setTarget,
|
|
29554
|
+
plan: props.plan
|
|
29555
|
+
})] });
|
|
29556
|
+
}
|
|
29557
|
+
function FooterEngagementPane(props) {
|
|
29558
|
+
return /* @__PURE__ */ jsx(FooterEngagementEditorPanel, {
|
|
29559
|
+
current: props.currentEngagement,
|
|
29560
|
+
manageFormsHref: props.manageFormsHref,
|
|
29561
|
+
manageNewsletterHref: props.manageNewsletterHref,
|
|
29562
|
+
onRemove: () => {
|
|
29563
|
+
const id = props.currentEngagement?.id;
|
|
29564
|
+
const next = id ? setFooterSectionSelected(props.compositionSnapshot.composition, id, false) : null;
|
|
29565
|
+
if (next?.ok) props.saveComposition(next.value);
|
|
29566
|
+
props.setTarget({ kind: "overview" });
|
|
29567
|
+
},
|
|
29568
|
+
options: props.engagementOptions,
|
|
29569
|
+
readiness: props.engagementReadiness
|
|
29570
|
+
});
|
|
29571
|
+
}
|
|
29572
|
+
function FooterComposerLayout({ customFooterMode, editor, writeStatus, retryFailedDrafts, previewRuntime, variant }) {
|
|
30050
29573
|
if (variant === "sidebar") return /* @__PURE__ */ jsxs("div", {
|
|
30051
29574
|
className: "space-y-3",
|
|
30052
|
-
children: [
|
|
30053
|
-
|
|
30054
|
-
|
|
30055
|
-
|
|
30056
|
-
|
|
30057
|
-
|
|
30058
|
-
|
|
30059
|
-
|
|
30060
|
-
|
|
30061
|
-
|
|
30062
|
-
|
|
30063
|
-
|
|
30064
|
-
|
|
30065
|
-
|
|
30066
|
-
|
|
30067
|
-
|
|
30068
|
-
|
|
30069
|
-
|
|
30070
|
-
|
|
30071
|
-
|
|
30072
|
-
|
|
30073
|
-
|
|
30074
|
-
|
|
30075
|
-
|
|
30076
|
-
children: [/* @__PURE__ */ jsx("h2", {
|
|
30077
|
-
className: "text-sm font-semibold",
|
|
30078
|
-
children: "Staged footer preview"
|
|
30079
|
-
}), /* @__PURE__ */ jsx(FooterPreview, { runtime: previewRuntime })]
|
|
30080
|
-
}) : null,
|
|
30081
|
-
editor
|
|
30082
|
-
]
|
|
29575
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
29576
|
+
className: "border-b px-4 py-3",
|
|
29577
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
29578
|
+
className: "flex items-center gap-2",
|
|
29579
|
+
children: [
|
|
29580
|
+
/* @__PURE__ */ jsx("h1", {
|
|
29581
|
+
className: "font-semibold",
|
|
29582
|
+
children: "Footer"
|
|
29583
|
+
}),
|
|
29584
|
+
/* @__PURE__ */ jsx("span", {
|
|
29585
|
+
className: "rounded-full bg-muted px-2 py-0.5 text-xs",
|
|
29586
|
+
children: "All pages"
|
|
29587
|
+
}),
|
|
29588
|
+
/* @__PURE__ */ jsx(SaveBadge, { state: writeStatus.saveState })
|
|
29589
|
+
]
|
|
29590
|
+
}), writeStatus.retry ? /* @__PURE__ */ jsx(FooterLiveSaveFailure, { live: {
|
|
29591
|
+
failed: true,
|
|
29592
|
+
retry: retryFailedDrafts
|
|
29593
|
+
} }) : writeStatus.message ? /* @__PURE__ */ jsx("p", {
|
|
29594
|
+
role: "alert",
|
|
29595
|
+
className: "mt-2 text-xs text-destructive",
|
|
29596
|
+
children: writeStatus.message
|
|
29597
|
+
}) : null]
|
|
29598
|
+
}), editor]
|
|
30083
29599
|
});
|
|
30084
29600
|
return /* @__PURE__ */ jsxs("div", {
|
|
30085
29601
|
className: "grid gap-8 lg:grid-cols-[minmax(0,1fr)_22rem]",
|
|
@@ -30099,7 +29615,7 @@ function FooterComposerLayout({ customFooterMode, editor, message, previewRuntim
|
|
|
30099
29615
|
className: "rounded-full bg-muted px-2.5 py-1 text-xs font-medium",
|
|
30100
29616
|
children: "All pages"
|
|
30101
29617
|
}),
|
|
30102
|
-
/* @__PURE__ */ jsx(SaveBadge, { state: saveState })
|
|
29618
|
+
/* @__PURE__ */ jsx(SaveBadge, { state: writeStatus.saveState })
|
|
30103
29619
|
]
|
|
30104
29620
|
}), /* @__PURE__ */ jsx("p", {
|
|
30105
29621
|
className: "text-sm text-muted-foreground",
|
|
@@ -30115,119 +29631,103 @@ function FooterComposerLayout({ customFooterMode, editor, message, previewRuntim
|
|
|
30115
29631
|
customFooterMode === "none" || customFooterMode === "blocks" ? " currently inactive." : " shown alongside custom footer blocks."
|
|
30116
29632
|
]
|
|
30117
29633
|
}) : null,
|
|
30118
|
-
|
|
29634
|
+
writeStatus.retry ? /* @__PURE__ */ jsx(FooterLiveSaveFailure, { live: {
|
|
29635
|
+
failed: true,
|
|
29636
|
+
retry: retryFailedDrafts
|
|
29637
|
+
} }) : writeStatus.message ? /* @__PURE__ */ jsx("div", {
|
|
30119
29638
|
role: "alert",
|
|
30120
29639
|
className: "rounded-lg border border-destructive/40 bg-destructive/5 p-3 text-sm",
|
|
30121
|
-
children: message
|
|
29640
|
+
children: writeStatus.message
|
|
30122
29641
|
}) : null,
|
|
30123
29642
|
/* @__PURE__ */ jsx(FooterPreview, { runtime: previewRuntime })
|
|
30124
29643
|
]
|
|
30125
29644
|
}), editor]
|
|
30126
29645
|
});
|
|
30127
29646
|
}
|
|
30128
|
-
function ModuleEditor(
|
|
30129
|
-
|
|
30130
|
-
const backend = useMemo(() => createRHFBackend(form), [form]);
|
|
30131
|
-
if (module === null) return /* @__PURE__ */ jsx("p", {
|
|
29647
|
+
function ModuleEditor(props) {
|
|
29648
|
+
if (props.module === null) return /* @__PURE__ */ jsx("p", {
|
|
30132
29649
|
className: "text-sm",
|
|
30133
29650
|
children: "This section is no longer available."
|
|
30134
29651
|
});
|
|
30135
|
-
|
|
30136
|
-
|
|
30137
|
-
|
|
30138
|
-
|
|
30139
|
-
|
|
30140
|
-
|
|
30141
|
-
|
|
30142
|
-
|
|
30143
|
-
|
|
30144
|
-
|
|
30145
|
-
|
|
30146
|
-
|
|
30147
|
-
|
|
30148
|
-
|
|
30149
|
-
|
|
30150
|
-
|
|
30151
|
-
|
|
30152
|
-
|
|
30153
|
-
|
|
30154
|
-
|
|
30155
|
-
|
|
30156
|
-
|
|
30157
|
-
|
|
30158
|
-
|
|
30159
|
-
|
|
30160
|
-
|
|
30161
|
-
|
|
30162
|
-
|
|
30163
|
-
|
|
30164
|
-
|
|
30165
|
-
|
|
30166
|
-
|
|
30167
|
-
|
|
30168
|
-
|
|
30169
|
-
|
|
30170
|
-
|
|
30171
|
-
|
|
30172
|
-
|
|
30173
|
-
|
|
30174
|
-
className: "text-sm text-muted-foreground",
|
|
30175
|
-
children: "These are shared details. Changes apply everywhere they are used."
|
|
30176
|
-
}),
|
|
30177
|
-
/* @__PURE__ */ jsx("button", {
|
|
30178
|
-
type: "button",
|
|
30179
|
-
className: primaryButtonClass,
|
|
30180
|
-
onClick: () => onShared(section),
|
|
30181
|
-
children: "Edit shared details"
|
|
30182
|
-
})
|
|
30183
|
-
]
|
|
30184
|
-
});
|
|
30185
|
-
}
|
|
30186
|
-
if (module.kind === "business-address" || module.kind === "navigation" || module.kind === "legal-navigation") return /* @__PURE__ */ jsxs("form", {
|
|
29652
|
+
return /* @__PURE__ */ jsx(LiveModuleEditor, {
|
|
29653
|
+
...props,
|
|
29654
|
+
module: props.module
|
|
29655
|
+
}, props.module.id);
|
|
29656
|
+
}
|
|
29657
|
+
const moduleNotes = {
|
|
29658
|
+
"business-address": "This section uses the business address in General settings.",
|
|
29659
|
+
navigation: "Links are managed in Navigation.",
|
|
29660
|
+
"legal-navigation": "Links are managed in Navigation.",
|
|
29661
|
+
"supporting-text": "Only shown in the footer.",
|
|
29662
|
+
legal: "Only shown in the footer."
|
|
29663
|
+
};
|
|
29664
|
+
/**
|
|
29665
|
+
* A section's own words save as they're typed, like the rest of the footer:
|
|
29666
|
+
* a pause or leaving a field saves, under one text key per field so a run of
|
|
29667
|
+
* typing joins one Undo step. A change that doesn't validate shows why and
|
|
29668
|
+
* isn't sent; a failed save keeps what was typed.
|
|
29669
|
+
*/
|
|
29670
|
+
function LiveModuleEditor({ module, composition, onChange, onShared, headingAsIcon, hasLogo, manageSettingsHref, widgets }) {
|
|
29671
|
+
const live = useFooterSectionTextPart(module);
|
|
29672
|
+
const form = useForm({ values: live.value });
|
|
29673
|
+
const backend = {
|
|
29674
|
+
...useMemo(() => createRHFBackend(form), [form]),
|
|
29675
|
+
setValue: (path, value) => {
|
|
29676
|
+
const field = path.split(".")[0];
|
|
29677
|
+
if (field === "heading" || field === "content") live.change(field, value);
|
|
29678
|
+
}
|
|
29679
|
+
};
|
|
29680
|
+
const parsed = parseFooterCompositionV1({
|
|
29681
|
+
...composition,
|
|
29682
|
+
sections: composition.sections.map((section) => section.id === module.id ? {
|
|
29683
|
+
...section,
|
|
29684
|
+
...live.value
|
|
29685
|
+
} : section)
|
|
29686
|
+
});
|
|
29687
|
+
const error = parsed.ok ? null : parsed.error.message;
|
|
29688
|
+
const shared = module.kind === "contact" || module.kind === "opening-hours" || module.kind === "social-links" ? module.kind : null;
|
|
29689
|
+
const note = moduleNotes[module.kind];
|
|
29690
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
30187
29691
|
className: "space-y-4",
|
|
30188
|
-
onSubmit: form.handleSubmit(saveSection),
|
|
30189
29692
|
children: [
|
|
30190
29693
|
/* @__PURE__ */ jsx("h2", {
|
|
30191
29694
|
className: "font-semibold",
|
|
30192
29695
|
children: footerModuleLabel(module)
|
|
30193
29696
|
}),
|
|
30194
|
-
/* @__PURE__ */ jsx(
|
|
30195
|
-
|
|
30196
|
-
|
|
30197
|
-
|
|
29697
|
+
module.kind === "brand" ? /* @__PURE__ */ jsx(FooterBrandChoiceControl, {
|
|
29698
|
+
composition,
|
|
29699
|
+
hasLogo,
|
|
29700
|
+
manageSettingsHref,
|
|
29701
|
+
onChange: (next) => void onChange(next)
|
|
29702
|
+
}) : null,
|
|
29703
|
+
/* @__PURE__ */ jsx("div", {
|
|
29704
|
+
onBlur: live.flush,
|
|
29705
|
+
children: /* @__PURE__ */ jsx(FormRenderer, {
|
|
29706
|
+
dateContext: civilPickerDisplay.dateContext,
|
|
29707
|
+
fields: fieldsForModule(module, headingAsIcon),
|
|
29708
|
+
backend,
|
|
29709
|
+
widgetOverrides: widgets
|
|
29710
|
+
})
|
|
30198
29711
|
}),
|
|
30199
|
-
/* @__PURE__ */ jsx("p", {
|
|
29712
|
+
error ? /* @__PURE__ */ jsx("p", {
|
|
29713
|
+
role: "alert",
|
|
29714
|
+
className: "text-sm text-destructive",
|
|
29715
|
+
children: error
|
|
29716
|
+
}) : null,
|
|
29717
|
+
/* @__PURE__ */ jsx(FooterLiveSaveFailure, { live }),
|
|
29718
|
+
note ? /* @__PURE__ */ jsx("p", {
|
|
30200
29719
|
className: "text-sm text-muted-foreground",
|
|
30201
|
-
children:
|
|
30202
|
-
}),
|
|
30203
|
-
/* @__PURE__ */ jsx("
|
|
30204
|
-
|
|
30205
|
-
|
|
30206
|
-
|
|
30207
|
-
|
|
30208
|
-
]
|
|
30209
|
-
});
|
|
30210
|
-
return /* @__PURE__ */ jsxs("form", {
|
|
30211
|
-
className: "space-y-4",
|
|
30212
|
-
onSubmit: form.handleSubmit(saveSection),
|
|
30213
|
-
children: [
|
|
30214
|
-
/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("h2", {
|
|
30215
|
-
className: "font-semibold",
|
|
30216
|
-
children: footerModuleLabel(module)
|
|
30217
|
-
}), /* @__PURE__ */ jsx("p", {
|
|
30218
|
-
className: "text-xs text-muted-foreground",
|
|
30219
|
-
children: "Footer-local content"
|
|
30220
|
-
})] }),
|
|
30221
|
-
/* @__PURE__ */ jsx(FormRenderer, {
|
|
30222
|
-
dateContext: civilPickerDisplay.dateContext,
|
|
30223
|
-
fields: fieldsForModule(module),
|
|
30224
|
-
backend
|
|
30225
|
-
}),
|
|
30226
|
-
/* @__PURE__ */ jsx("button", {
|
|
30227
|
-
type: "submit",
|
|
29720
|
+
children: note
|
|
29721
|
+
}) : null,
|
|
29722
|
+
shared ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("p", {
|
|
29723
|
+
className: "text-sm text-muted-foreground",
|
|
29724
|
+
children: "These are shared details. Changes apply everywhere they're used."
|
|
29725
|
+
}), /* @__PURE__ */ jsx("button", {
|
|
29726
|
+
type: "button",
|
|
30228
29727
|
className: primaryButtonClass,
|
|
30229
|
-
|
|
30230
|
-
|
|
29728
|
+
onClick: () => onShared(shared),
|
|
29729
|
+
children: "Edit shared details"
|
|
29730
|
+
})] }) : null
|
|
30231
29731
|
]
|
|
30232
29732
|
});
|
|
30233
29733
|
}
|
|
@@ -30499,7 +29999,7 @@ function SocialLinksEditor({ profile, onChange }) {
|
|
|
30499
29999
|
children: "Social links"
|
|
30500
30000
|
}), /* @__PURE__ */ jsx("p", {
|
|
30501
30001
|
className: "text-xs text-muted-foreground",
|
|
30502
|
-
children: "Ordered public links. Changes apply everywhere they
|
|
30002
|
+
children: "Ordered public links. Changes apply everywhere they're used."
|
|
30503
30003
|
})] }),
|
|
30504
30004
|
links.map((link, index) => /* @__PURE__ */ jsxs("div", {
|
|
30505
30005
|
className: "space-y-2 rounded-lg border p-3",
|
|
@@ -33066,27 +32566,30 @@ function footerComposerNavigationProps(view, requestId) {
|
|
|
33066
32566
|
}
|
|
33067
32567
|
//#endregion
|
|
33068
32568
|
//#region ../preview-next/src/client/preview/PreviewFooterEditorPanel.tsx
|
|
33069
|
-
function PreviewFooterEditorPanel({ sdkConfig, apiClient, siteId, dashboardBaseUrl, theme, view, requestId, canEdit
|
|
33070
|
-
const
|
|
32569
|
+
function PreviewFooterEditorPanel({ sdkConfig, apiClient, siteId, dashboardBaseUrl, theme, view, requestId, canEdit }) {
|
|
32570
|
+
const liveRuntime = useLiveFooterRuntime();
|
|
33071
32571
|
const dashboardSiteUrl = `${dashboardBaseUrl?.replace(/\/$/u, "") ?? ""}/dashboard/sites/${siteId}`;
|
|
33072
|
-
return /* @__PURE__ */ jsx(
|
|
33073
|
-
apiClient,
|
|
32572
|
+
return /* @__PURE__ */ jsx(PreviewFormProvider, {
|
|
33074
32573
|
siteId,
|
|
33075
|
-
|
|
33076
|
-
|
|
33077
|
-
|
|
33078
|
-
|
|
33079
|
-
|
|
33080
|
-
|
|
33081
|
-
|
|
33082
|
-
|
|
33083
|
-
|
|
33084
|
-
|
|
32574
|
+
theme,
|
|
32575
|
+
previewClient: apiClient,
|
|
32576
|
+
children: /* @__PURE__ */ jsx(FooterComposerPanel, {
|
|
32577
|
+
apiClient,
|
|
32578
|
+
siteId,
|
|
32579
|
+
customFooterMode: resolveSdkFooterMode(sdkConfig),
|
|
32580
|
+
manageLinksHref: `${dashboardSiteUrl}/navigation`,
|
|
32581
|
+
manageSettingsHref: `${dashboardSiteUrl}/settings`,
|
|
32582
|
+
layoutSelection: footerLayoutSelection(theme),
|
|
32583
|
+
widgets: previewWidgetOverrides,
|
|
32584
|
+
liveRuntime: liveRuntime ?? void 0,
|
|
32585
|
+
appearanceControls: /* @__PURE__ */ jsx(SiteChromeSurfaceControls, { surface: "footer" }),
|
|
32586
|
+
loadingFallback: /* @__PURE__ */ jsx(ContentSpinner, { className: "py-8" }),
|
|
32587
|
+
...footerComposerNavigationProps(view, requestId),
|
|
32588
|
+
variant: "sidebar",
|
|
32589
|
+
canEdit
|
|
32590
|
+
})
|
|
33085
32591
|
});
|
|
33086
32592
|
}
|
|
33087
|
-
function footerComposerLayoutProps(theme) {
|
|
33088
|
-
return { arrangement: resolveFooterLayoutHints(theme).layoutVariant };
|
|
33089
|
-
}
|
|
33090
32593
|
//#endregion
|
|
33091
32594
|
//#region ../preview-next/src/client/preview/PreviewEditorGuidanceCard.tsx
|
|
33092
32595
|
function PreviewEditorGuidanceCard({ guidance, completeSetupDisabled, onCompleteSetup }) {
|
|
@@ -35275,10 +34778,9 @@ function StyleConfigurator({ siteId, apiClient, buttonStyleRepairs, onFocusedSur
|
|
|
35275
34778
|
const currentTypography = shown.theme.typography;
|
|
35276
34779
|
const currentHeaderLayout = getHeaderLayout(selection.headerLayoutId);
|
|
35277
34780
|
const currentHeaderStyle = getHeaderStyle(selection.headerStyleId);
|
|
35278
|
-
const currentFooterLook = findFooterLook(selection.footerLookId ?? chromeSelectionModels.footer.renderedLookId);
|
|
35279
34781
|
const headerSurfaceState = siteChromeCustomize.getSurfaceState("header");
|
|
35280
34782
|
const styleSelections = siteChromeCustomize.styleSelections;
|
|
35281
|
-
const { handlePreviewButtonStyle, handlePreviewHeaderLayout, handlePreviewHeaderStyle,
|
|
34783
|
+
const { handlePreviewButtonStyle, handlePreviewHeaderLayout, handlePreviewHeaderStyle, handlePreviewPalette, handleHeadingTypographyChange, handleBodyTypographyChange, handleTypographyScaleChange, handleTokenOverride, handleChooseSiteStyle } = controls;
|
|
35282
34784
|
if (expandedRow === "typography" && typographySurface.kind !== "overview") return /* @__PURE__ */ jsx("div", {
|
|
35283
34785
|
className: "flex h-full min-h-0 flex-col",
|
|
35284
34786
|
"data-style-configurator-focused-surface": true,
|
|
@@ -35352,24 +34854,6 @@ function StyleConfigurator({ siteId, apiClient, buttonStyleRepairs, onFocusedSur
|
|
|
35352
34854
|
onMenuFontSizeChange: siteChromeCustomize.setHeaderMenuFontSize
|
|
35353
34855
|
}) : null
|
|
35354
34856
|
}),
|
|
35355
|
-
/* @__PURE__ */ jsx(SiteChromeSelectionRow, {
|
|
35356
|
-
label: "Footer",
|
|
35357
|
-
ariaLabel: "Footer layout",
|
|
35358
|
-
defaultDescription: "Use the footer layout chosen for this site style.",
|
|
35359
|
-
expanded: expandedRow === "footer",
|
|
35360
|
-
onToggle: () => handleToggleRow("footer"),
|
|
35361
|
-
currentId: chromeSelectionModels.footer.renderedLookId,
|
|
35362
|
-
currentLabel: currentFooterLook?.label ?? "Unknown footer layout",
|
|
35363
|
-
scopeDescription: "Changes the footer layout on every page.",
|
|
35364
|
-
options: chromeSelectionModels.footer.options,
|
|
35365
|
-
diagnostics: chromeSelectionModels.footer.diagnostics,
|
|
35366
|
-
onCycle: (direction) => {
|
|
35367
|
-
const next = cycleSiteChromeSelectionId(chromeSelectionModels.footer.options, chromeSelectionModels.footer.renderedLookId, direction);
|
|
35368
|
-
if (next !== void 0) handlePreviewFooterLook(next);
|
|
35369
|
-
},
|
|
35370
|
-
onPreview: handlePreviewFooterLook,
|
|
35371
|
-
disabled
|
|
35372
|
-
}),
|
|
35373
34857
|
/* @__PURE__ */ jsx(ButtonStyleRow, {
|
|
35374
34858
|
expanded: expandedRow === "buttons",
|
|
35375
34859
|
onToggle: () => handleToggleRow("buttons"),
|
|
@@ -35429,10 +34913,6 @@ function useConfiguratorControls(owner) {
|
|
|
35429
34913
|
styleId
|
|
35430
34914
|
}, "immediate");
|
|
35431
34915
|
},
|
|
35432
|
-
handlePreviewFooterLook: (lookId) => choose?.({
|
|
35433
|
-
kind: "set-footer-look",
|
|
35434
|
-
lookId
|
|
35435
|
-
}, "immediate"),
|
|
35436
34916
|
handlePreviewPalette: (key) => {
|
|
35437
34917
|
const palette = findCuratedPalette(key);
|
|
35438
34918
|
if (palette) choose?.({
|
|
@@ -37153,8 +36633,7 @@ function SidebarTaskView({ props, view, requestId, uiStoreForBlockEditor, linked
|
|
|
37153
36633
|
theme: props.theme ?? null,
|
|
37154
36634
|
view,
|
|
37155
36635
|
requestId,
|
|
37156
|
-
canEdit
|
|
37157
|
-
onSaved: requestServerRefresh
|
|
36636
|
+
canEdit
|
|
37158
36637
|
});
|
|
37159
36638
|
case "assistant": return null;
|
|
37160
36639
|
case "linkedEntry": return linkedEntry ? /* @__PURE__ */ jsx(LinkedEntryEditorPanel, {
|