@riverbankcms/sdk 0.145.0 → 0.146.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (159) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/{PreviewEditorSidebar-O-V6Pl5a.mjs → PreviewEditorSidebar-kg2r2Fyi.mjs} +4 -4
  3. package/dist/{PreviewEditorUI-1UlX_9cw.mjs → PreviewEditorUI-sWMLp5dT.mjs} +3 -3
  4. package/dist/{PreviewQueryProvider-BxGwdOCV.mjs → PreviewQueryProvider-Cg51xq1w.mjs} +1 -1
  5. package/dist/{SdkPreviewModeRuntime-DYbA_4iv.mjs → SdkPreviewModeRuntime-h2ti3Hch.mjs} +280 -182
  6. package/dist/{SiteChromeCustomizeContext-CNTKQ9nx.mjs → SiteChromeCustomizeContext-DEACFH9m.mjs} +1330 -734
  7. package/dist/_dts/ai/src/contracts/proposals.d.ts +924 -0
  8. package/dist/_dts/ai/src/contracts/siteStyleProposalSchemas.d.ts +84 -0
  9. package/dist/_dts/api/src/bookingConfig.d.ts +8 -1
  10. package/dist/_dts/api/src/bookingManagementEndpoints.d.ts +8 -14
  11. package/dist/_dts/api/src/bookingManagementEventEndpointTypes.d.ts +45 -1
  12. package/dist/_dts/api/src/clientErrorReporting.d.ts +50 -0
  13. package/dist/_dts/api/src/communications.d.ts +20 -4
  14. package/dist/_dts/api/src/contentRuntime.d.ts +3 -7
  15. package/dist/_dts/api/src/endpoints.d.ts +223 -88
  16. package/dist/_dts/api/src/event-visibility.d.ts +20 -0
  17. package/dist/_dts/api/src/eventManagementContracts.d.ts +56 -3
  18. package/dist/_dts/api/src/eventManagementEndpointDefinitions.d.ts +24 -0
  19. package/dist/_dts/api/src/eventPageWords.d.ts +19 -0
  20. package/dist/_dts/api/src/eventSeriesRegistrationEndpointDefinitions.d.ts +14 -0
  21. package/dist/_dts/api/src/index.d.ts +7 -1
  22. package/dist/_dts/api/src/indexCoreTypes.d.ts +1 -1
  23. package/dist/_dts/api/src/indexExtendedTypes.d.ts +1 -1
  24. package/dist/_dts/api/src/launchReadiness.d.ts +20 -2
  25. package/dist/_dts/api/src/launchRequirementPriority.d.ts +3 -0
  26. package/dist/_dts/api/src/newsletterCampaignCommandEndpoints.d.ts +13 -0
  27. package/dist/_dts/api/src/newsletterEndpointDefinitions.d.ts +42 -0
  28. package/dist/_dts/api/src/occurrenceScheduling.d.ts +10 -0
  29. package/dist/_dts/api/src/pageSurfaceEndpoints.d.ts +44 -0
  30. package/dist/_dts/api/src/participantMessaging.d.ts +11 -1
  31. package/dist/_dts/api/src/sdk-event-upsert.d.ts +40 -1
  32. package/dist/_dts/api/src/sdkContracts.d.ts +3 -42
  33. package/dist/_dts/api/src/sdkCourseBooking.d.ts +30 -0
  34. package/dist/_dts/api/src/sdkEventEndpointDefinitions.d.ts +76 -0
  35. package/dist/_dts/api/src/sdkEventLifecycle.d.ts +37 -0
  36. package/dist/_dts/api/src/sdkManagedEventContracts.d.ts +18 -0
  37. package/dist/_dts/api/src/sdkPageDesign.d.ts +388 -0
  38. package/dist/_dts/api/src/sdkPageDesignEndpointDefinitions.d.ts +22 -0
  39. package/dist/_dts/api/src/sdkPullEventContracts.d.ts +46 -0
  40. package/dist/_dts/api/src/siteAddressEndpoints.d.ts +29 -0
  41. package/dist/_dts/api/src/siteManagementEndpointDefinitions.d.ts +49 -0
  42. package/dist/_dts/api/src/siteManagementEndpoints.d.ts +2 -32
  43. package/dist/_dts/api/src/siteOnboarding.d.ts +75 -9
  44. package/dist/_dts/api/src/sitePlatformEndpoints.d.ts +1 -1
  45. package/dist/_dts/api/src/types.d.ts +7 -1
  46. package/dist/_dts/api/src/wholeSeriesRuns.d.ts +14 -0
  47. package/dist/_dts/blocks/src/index.d.ts +2 -0
  48. package/dist/_dts/blocks/src/pageRenderAdmission.d.ts +10 -0
  49. package/dist/_dts/blocks/src/pageRendererContracts.d.ts +3 -1
  50. package/dist/_dts/blocks/src/system/blocks/events/shared/schemas.d.ts +27 -5
  51. package/dist/_dts/blocks/src/system/blocks/events/shared/types.d.ts +14 -1
  52. package/dist/_dts/blocks/src/system/icons/social.d.ts +1 -1
  53. package/dist/_dts/blocks/src/system/registry.d.ts +1 -1
  54. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/eventSourceRecovery.d.ts +1 -0
  55. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/eventCollectionContract.d.ts +20 -4
  56. package/dist/_dts/blocks/src/system/runtime/nodes/form.fields.d.ts +5 -0
  57. package/dist/_dts/blocks/src/system/runtime/nodes/newsletter-form.block-submission.d.ts +36 -0
  58. package/dist/_dts/blocks/src/system/runtime/nodes/newsletter-form.client.d.ts +1 -1
  59. package/dist/_dts/blocks/src/system/runtime/nodes/newsletter-form.interactive.d.ts +6 -1
  60. package/dist/_dts/blocks/src/system/runtime/nodes/newsletter-form.parts.d.ts +46 -0
  61. package/dist/_dts/blocks/src/system/runtime/nodes/newsletter-form.types.d.ts +2 -1
  62. package/dist/_dts/blocks/src/system/runtime/resolver.d.ts +2 -1
  63. package/dist/_dts/blocks/src/system/runtime/shared/components/CheckboxChoice.d.ts +18 -0
  64. package/dist/_dts/blocks/src/system/runtime/shared/components/index.d.ts +1 -0
  65. package/dist/_dts/content-editor/src/index.d.ts +1 -0
  66. package/dist/_dts/content-editor/src/primitives/previewEditableOutline.d.ts +2 -0
  67. package/dist/_dts/content-editor/src/ui/editorBlockEquality.d.ts +3 -0
  68. package/dist/_dts/content-editor/src/ui/editorSnapshot.d.ts +3 -5
  69. package/dist/_dts/core/src/block-content-identity.d.ts +5 -0
  70. package/dist/_dts/core/src/editor-state.d.ts +2 -7
  71. package/dist/_dts/core/src/index.d.ts +1 -0
  72. package/dist/_dts/core/src/mailing-list-submission.d.ts +3 -1
  73. package/dist/_dts/core/src/public-event-booking-availability.d.ts +20 -1
  74. package/dist/_dts/core/src/public-profile.d.ts +3 -1
  75. package/dist/_dts/db/src/generated/supabase/database.types.d.ts +49 -2
  76. package/dist/_dts/editor-blocks/src/BlockEditor.d.ts +3 -0
  77. package/dist/_dts/editor-blocks/src/block-editor/EmptyState.d.ts +13 -1
  78. package/dist/_dts/editor-blocks/src/block-editor/types.d.ts +2 -8
  79. package/dist/_dts/editor-blocks/src/index.d.ts +1 -0
  80. package/dist/_dts/preview-next/src/client/blocks/composer/types.d.ts +3 -4
  81. package/dist/_dts/preview-next/src/client/preview/PreviewEntryControllerProvider.d.ts +1 -2
  82. package/dist/_dts/sdk/src/next/renderSdkContent.d.ts +0 -1
  83. package/dist/_dts/sdk/src/rendering/blocks-page-renderer.d.ts +2 -2
  84. package/dist/_dts/sdk/src/rendering/components/pageShared.d.ts +2 -2
  85. package/dist/_dts/sdk/src/rendering/helpers/loadContent.d.ts +6 -1
  86. package/dist/_dts/sdk/src/rendering/helpers/loadPage.d.ts +5 -2
  87. package/dist/_dts/sdk/src/rendering/helpers/pageRuntimeSupport.d.ts +6 -1
  88. package/dist/_dts/sdk/src/rendering/helpers/templateContent.d.ts +2 -0
  89. package/dist/_dts/sdk/src/rendering/hooks/useContent.d.ts +5 -1
  90. package/dist/_dts/sdk/src/rendering/hooks/usePage.d.ts +5 -1
  91. package/dist/_dts/sdk/src/version.d.ts +1 -1
  92. package/dist/_dts/surfaces/src/index.d.ts +9 -0
  93. package/dist/_dts/theme-core/src/generated/containerResponsiveThemeCss.d.ts +1 -1
  94. package/dist/_dts/theme-core/src/inputs/checkable.d.ts +42 -0
  95. package/dist/_dts/theme-core/src/inputs/inputGroup.d.ts +19 -0
  96. package/dist/_dts/ui/src/navigation-tabs.d.ts +2 -1
  97. package/dist/client/{BookingConsentAgreement-DlVOmpW4.mjs → BookingConsentAgreement-BQKL045f.mjs} +2 -2
  98. package/dist/client/CheckboxChoice--W2n6yKs.mjs +24 -0
  99. package/dist/client/{DiscountCodeDisclosure-T9q623PQ.mjs → DiscountCodeDisclosure-CsOtjFY7.mjs} +1 -1
  100. package/dist/client/{EventCombined.client-DnsUeONl.mjs → EventCombined.client-BdRjVbhH.mjs} +6 -6
  101. package/dist/client/{EventListing.client-CNBFqJS4.mjs → EventListing.client-DBxC6xOU.mjs} +2 -2
  102. package/dist/client/{LeafletStaticMap-C7higg52.mjs → LeafletStaticMap-mHEJKrTs.mjs} +1 -1
  103. package/dist/client/{ThemedButton-LAJTNrS8.mjs → ThemedButton-CE5KYT6z.mjs} +1 -1
  104. package/dist/client/{accordion-BcNF9TjX.mjs → accordion-BEQNSptH.mjs} +1 -1
  105. package/dist/client/{bookingForm-BUaQ3S03.mjs → bookingForm-AMr-s5vw.mjs} +33 -52
  106. package/dist/client/bookings.mjs +48 -46
  107. package/dist/client/{carousel-CTdF6e0V.mjs → carousel-Bbt_QgJy.mjs} +1 -1
  108. package/dist/client/{cart-pGtyf_XU.mjs → cart-CnWi30zJ.mjs} +3 -3
  109. package/dist/client/{checkout-Da9WSn7Y.mjs → checkout-f3nkWgd4.mjs} +3 -3
  110. package/dist/client/client.mjs +1611 -815
  111. package/dist/client/{context-BFeY_Wbm.mjs → context-Bc8T6pCe.mjs} +1 -1
  112. package/dist/client/{dates-BhwVSxDg.mjs → dates-DUsCEzLb.mjs} +2 -3
  113. package/dist/client/{eventCalendar-BAtdnR4s.mjs → eventCalendar-CKwgXui5.mjs} +9 -9
  114. package/dist/client/{eventCombined-RksA3tRC.mjs → eventCombined-CBAOSTGR.mjs} +4 -4
  115. package/dist/client/{eventDetails-BB9hB4wR.mjs → eventDetails-Dh-_WiBD.mjs} +4 -4
  116. package/dist/client/{eventListing-BpJBkviM.mjs → eventListing-CA3frIH5.mjs} +4 -4
  117. package/dist/client/{eventRegistration-B18jFq_o.mjs → eventRegistration-BHtsgdcg.mjs} +21 -22
  118. package/dist/client/{form-Dodt8Y8t.mjs → form-C2h3YAcg.mjs} +135 -104
  119. package/dist/client/{headerSection-B0qj9ttg.mjs → headerSection-lwMuMTH9.mjs} +3 -3
  120. package/dist/client/hooks.mjs +489 -65
  121. package/dist/client/{locationMap-gn-iMk7a.mjs → locationMap-DJ2bLODV.mjs} +3 -3
  122. package/dist/client/{newsletterForm-oByLdFkr.mjs → newsletterForm-8Pu5K32g.mjs} +203 -101
  123. package/dist/client/{pricing-BOU0_Hai.mjs → pricing-HHx3IgBz.mjs} +1 -1
  124. package/dist/client/{productDetail-D9v1zH2j.mjs → productDetail-C_1odnAf.mjs} +3 -3
  125. package/dist/client/{productList-D-mItx1n.mjs → productList-CtCv-Nmx.mjs} +3 -3
  126. package/dist/client/{propsDecoder-C3TP_z4x.mjs → propsDecoder-Dcgsncxb.mjs} +40 -23
  127. package/dist/client/rendering/client.mjs +490 -457
  128. package/dist/client/rendering/islands.mjs +17 -17
  129. package/dist/client/rendering.mjs +1515 -628
  130. package/dist/client/{routeIslandApiConfig-DzN1W0sq.mjs → routeIslandApiConfig-CWLP7wu3.mjs} +1 -1
  131. package/dist/client/{scrollToBlock-CWs8EIdo.mjs → scrollToBlock-BNgaEUpo.mjs} +1 -1
  132. package/dist/client/{shop-Dufw7N7o.mjs → shop-DQXrQ8kJ.mjs} +7 -7
  133. package/dist/client/{shop-commerce-gklw_hLF.mjs → shop-commerce-B88zmWWo.mjs} +6 -6
  134. package/dist/client/{shop-commerce-store-Sf1eyTaZ.mjs → shop-commerce-store-DtSfkKuX.mjs} +1 -1
  135. package/dist/client/{shopShared-B5nyA41S.mjs → shopShared-cuaONpkJ.mjs} +4 -4
  136. package/dist/client/{useEventFilters-CLL829vy.mjs → useEventFilters-Bukew6Gb.mjs} +6 -6
  137. package/dist/preview-next/before-render.mjs +368 -103
  138. package/dist/preview-next/client/runtime.mjs +4 -4
  139. package/dist/preview-next/editor-base.css +11 -0
  140. package/dist/preview-next/keepAlive.mjs +328 -103
  141. package/dist/preview-next/middleware.mjs +329 -103
  142. package/dist/{previewAuthStore-BxAFlu-j.mjs → previewAuthStore-h5IgbSp4.mjs} +353 -103
  143. package/dist/{sdk-runtime-D0uZFev7.mjs → sdk-runtime-DTc1uIXn.mjs} +2 -2
  144. package/dist/{separator-EvdCAn4V.mjs → separator-BpHS1KZK.mjs} +1 -1
  145. package/dist/server/components.mjs +1376 -331
  146. package/dist/server/config-validation.mjs +405 -27
  147. package/dist/server/config.mjs +405 -27
  148. package/dist/server/data.mjs +405 -27
  149. package/dist/server/index.mjs +370 -104
  150. package/dist/server/next.mjs +1430 -463
  151. package/dist/server/page-converter.mjs +36 -25
  152. package/dist/server/prebuild.mjs +1 -1
  153. package/dist/server/rendering/server.mjs +1374 -331
  154. package/dist/server/rendering.mjs +1436 -364
  155. package/dist/server/routing.mjs +476 -43
  156. package/dist/server/server.mjs +504 -169
  157. package/dist/server/theme-bridge.mjs +467 -111
  158. package/dist/styles/index.css +186 -65
  159. package/package.json +1 -1
@@ -1,12 +1,12 @@
1
1
  "use client";
2
- import { $i as attachRenderableMediaAssetFields, $n as LINKED_CONTENT_ENTRY_META_KEY, $r as ctaButton, Aa as DialogContent, Ai as corners, An as containerResponsiveThemeCss, Ar as surfaceResolutionContextFromTheme, At as RichTextField, Bn as compileManifestContentContract, Br as autoDesignChoice, Bt as getBlockManifestFromSdkConfig, Ci as BlockApiProvider, Cn as deriveLaunchReadiness, Co as expectParsedBrandedId, Cr as formatSiteChromeBackgroundTokenLabel, Ct as ButtonVariantField, Da as TabsList, Di as bookingConsentCarrierSchema, Dn as useApiMediaUploader, Dt as ReferenceField, Ea as TabsContent, Ei as eventCalendarListLayoutOptions, En as useMediaEditorOptional, Eo as __exportAll, Er as componentRuntimeRulesForTheme, Et as MediaField, Fi as assertNever$1, Fn as SITE_CHROME_VISIBLE_HEADER_SELECTOR, Fr as GRADIENT_PRESETS, Ft as LinkWidgetProvider, G as confirmAutosaveBatch, Gi as defaultThemeTokens, Gn as escapeStyleContent, Gr as boundaryTreatmentForBoundaryOptionId, Gt as canRedoHistory, Hn as buildThemeRuntime, Hr as boundaryLayout, Ht as useEditorUiStore, Ii as makeBoundaryId, In as SITE_OVERLAY_HEADER_CLEARANCE_CSS_VAR, Ir as GRADIENT_PRESET_IDS, J as idleEditorTransactionQueueState, Ja as cn, Jn as getDefaultComponentRegistry, Jr as sectionTransitionFamilyForBoundaryOptionId, Jt as pushHistoryEntry, K as deriveTransactionCapabilities, Ka as Button, Ki as parseThemeForPersistence, Kn as mergeContentWithBlockStyleOverrides, Kr as defaultSectionTransitionVariantForFamily, Kt as canUndoHistory, Ln as planSiteOverlayHeaderClearance, Lr as getGradientPreset, Lt as hideThemeV2RawStyleFields, Ma as DialogFooter, Mi as pageDesignEditorBackgroundOverrideOwner, Mn as makeDefaultBlockComponent, Mt as EditorProvider, Na as DialogHeader, Ni as stripStaleTransitionStyleGroup, Nn as getBlockDefinition, Nt as useEditor, Oa as TabsTrigger, Oi as isObjectRecord, On as isSupportedLoaderEndpoint, Or as designRuntimeRulesForTheme, Ot as ReferenceWidgetProvider, Pa as DialogTitle, Pi as asDesignBlockId, Pn as projectRecurringSchedule, Pr as gradientToCss, Pt as LinkField, Q as resolvePreviewSidebarTab, Qi as resolveSdkFooterMode, Qn as resolveRouteTarget, Qr as parseBackgroundAppearanceColorToken, Qt as recordsEqual, Rn as visibleHeaderClearancePx, Rr as parseGradientPresetId, Rt as prepareBlockEditorManifest, Si as siblingPath, Sn as DEFAULT_LAUNCH_READINESS_INPUT, So as assertNever$2, Sr as compileEditorModelRuntime, St as EntryPickerWidgetProvider, Ta as Tabs, Ti as eventCalendarListLayoutCompatibleDisplayModeValues, Tn as MediaEditorContextProvider, To as parseSiteId, Tr as resolvePageDesignEditorBoundaryForChoice, Tt as FileField, Un as DEFAULT_THEME_RESPONSIVE_MODE, Ur as composeBoundary, Ut as useEditorUiStoreInstance, Vn as validateManifestDraft, Vr as userPinnedDesignChoice, W as beginAutosaveBatch, Wi as textColorStyle, Wn as getResponsiveScopeSpec, Wr as sectionFactsForContent, Wt as useOptionalEditorUiStoreInstance, Xa as Upload, Xi as paletteColorsSchema, Xn as resolveEntryRouteTarget, Xr as backgroundAppearanceColorTokenNames, Xt as undoHistory, Y as rejectAutosaveBatch, Ya as X, Yn as defaultTransforms, Yr as sectionTransitionVariantForBoundaryOptionId, Yt as redoHistory, Zi as paletteModeSchema, Zn as resolvePageRouteTarget, Zr as backgroundAppearanceQuickColorTokenNames, Zt as unsafeAsLinkedContentEntryId, _ as reportPreviewDesignError, _a as SelectValue, _i as getCurrentResolveImageUrlContext, _n as MediaEditor, _r as ctaRowFragment, _t as loadMailingListAuthoringContext, aa as mapCurrentValueForSelect, ai as parseBlockIconValue, an as parseReferenceKind, ar as headingFragment, at as useUISelector, bi as SECTION_BACKGROUND_MIN_SOURCE_WIDTH, bo as unsafeAsEditorBlockId, br as defineFragment, bt as IconPickerField, ca as FieldFrame, cr as faqHeadingFragment, d as PreviewDesignCoordinatorProvider, di as coerceInlineTextWithFallback, do as Image, dr as formEmbedFragment, dt as createSiteOptionWidgetAdapters, ea as getFieldIntent, ei as bindingSchema, en as useDebouncedLatestSave, er as coerceLinkedContentEntriesPayload, et as renderSiteChromeBlock, fi as inlineTextToPlainText, fn as createManifestFormAdapter, fo as GripVertical, fr as formCopyFragment, ft as SiteOptionPickerField, g as PREVIEW_DESIGN_SAVE_ERROR_MESSAGE, ga as SelectTrigger, gi as buildResolveImageUrlContext, gn as createStoreBackend, go as ChevronLeft, gr as heroCtaRowFragment, gt as MailingListTargetingField, h as PREVIEW_DESIGN_LOAD_ERROR_MESSAGE, ha as SelectItem, hi as RichText$1, hn as evaluateVisibility, ho as ChevronRight, hr as ctaCopyFragment, ht as OfferingsPreviewWidgetProvider, i as usePreviewDesignHistoryOrder, ia as hasEmptyOption, ii as runTransforms, ir as richTextFragment, ja as DialogDescription, ji as isThemeV2NormalEditorRawStyleFieldName, jn as createCustomBlockRegistry, jt as RichTextWidgetProvider, ka as Dialog, ki as isRecord$11, kn as ThemeScope, kt as useRichTextImagePicker, la as useField, li as renderInlineText, ln as PaletteProvider, lr as blogFeaturedPostFragment, lt as useEntryEditorController, m as usePreviewThemeOverlay, ma as SelectContent, mi as Text$1, mn as FormRenderer, mr as testimonialsHeadingFragment, mt as OfferingsPreviewGroupOrderField, n as useSiteChromeCustomizeOptional, na as SdkConfigProvider, ni as planSiteChromePlacement, nn as createSnapshotFromPageRecord, nr as clientComponentRegistry, nt as PreviewInlineTextEditor, oa as mapOptionValueForSelect, oi as parseGeneratedIconAssetId, or as cardFragment, ot as EditableBlockProvider, p as PreviewThemeOverlayProvider, pa as Select, pi as isInlineTextEmpty, pr as testimonialsCarouselFragment, pt as SiteOptionWidgetProvider, q as enqueueTransaction, qi as ORDINARY_TEXT_MIN_CONTRAST_RATIO, qn as readBlockComposition, qr as sectionTransitionFamilies, qt as createHistoryState, r as PreviewDesignHistoryOrderProvider, ra as useSdkConfig, ri as parseBackgroundContent, rn as BUILT_IN_REFERENCE_KINDS, ro as RotateCcw, rr as ImageResolveContextProvider, rt as PreviewTextEditor, sa as unmapValueFromSelect, si as parseGeneratedIconSetId, sr as faqAccordionFragment, st as EntryControllerProvider, t as SiteChromeCustomizeProvider, ta as isHeaderField, tn as createRoutingHelpers, tr as getLinkedContentEntryMeta, tt as PreviewRichTextEditor, ui as logger, un as usePalette, ur as singleButtonFragment, ut as createSiteOptionApiLoader, vi as resolveImageUrlWithContext, vn as applyPageDesignEditorAction, vr as heroCopyFragment, vt as MailingListTargetingProvider, wi as calendarWindowQuerySchema, wn as AMBIENT_BACKGROUND_ROLES, wo as parseMediaAssetId, wr as planPageDesignLayoutLookCompatibility, wt as ButtonWidgetProvider, xi as getAtPath, xn as decodePublicProductCategorySelectorQuery, xo as unsafeAsEditorBlockValues, xr as applyCompiledRuntimeFieldsToContent, xt as EntryPickerField, yi as setContextResolveImageUrlContext, yn as getPageDesignEditorState, yo as parseFooterModuleId, yr as bodyCopyFragment, yt as InlineTextField, zn as resolveVariantKey, zt as stripTopLevelRoutingUi } from "./SiteChromeCustomizeContext-CNTKQ9nx.mjs";
3
- import { i as useOptionalPreviewLayout, t as PreviewQueryProvider } from "./PreviewQueryProvider-BxGwdOCV.mjs";
4
- import { _ as API_ENDPOINTS, a as usePreviewToken, c as createBearerAPIClient, d as unwrapResponse, g as resolveSurfaceDocumentAttributes, h as SURFACE_IDS, i as usePreviewAuthFetch, m as SURFACE_DOCUMENT_DATA_ATTRIBUTE, n as markPreviewAuthExpired, o as isPreviewRuntimeSessionEditable, r as usePreviewAuth, s as ApiRequestError, t as initPreviewAuth } from "./previewAuthStore-BxAFlu-j.mjs";
2
+ import { $i as resolveSdkFooterMode, $n as resolveRouteTarget, $r as parseBackgroundAppearanceColorToken, $t as recordsEqual, Aa as Dialog, Ai as isRecord$11, An as ThemeScope, Ao as __exportAll, At as useRichTextImagePicker, Bn as resolveVariantKey, Bt as stripTopLevelRoutingUi, Ci as siblingPath, Cn as DEFAULT_LAUNCH_READINESS_INPUT, Co as parseMailingListPlacementTargeting, Cr as compileEditorModelRuntime, Ct as EntryPickerWidgetProvider, Da as TabsContent, Di as eventCalendarListLayoutOptions, Dn as useMediaEditorOptional, Do as expectParsedBrandedId, Dr as componentRuntimeRulesForTheme, Dt as MediaField, Ea as Tabs, Ei as eventCalendarListLayoutCompatibleDisplayModeValues, En as MediaEditorContextProvider, Eo as assertNever$2, Er as resolvePageDesignEditorBoundaryForChoice, Et as FileField, Fa as DialogTitle, Fi as asDesignBlockId, Fn as projectRecurringSchedule, Fr as gradientToCss, Ft as LinkField, G as confirmAutosaveBatch, Gi as textColorStyle, Gn as getResponsiveScopeSpec, Gr as sectionFactsForContent, Gt as useOptionalEditorUiStoreInstance, Hn as validateManifestDraft, Hr as userPinnedDesignChoice, Ii as assertNever$1, In as SITE_CHROME_VISIBLE_HEADER_SELECTOR, Ir as GRADIENT_PRESETS, It as LinkWidgetProvider, J as idleEditorTransactionQueueState, Ji as ORDINARY_TEXT_MIN_CONTRAST_RATIO, Jn as readBlockComposition, Jr as sectionTransitionFamilies, Jt as createHistoryState, K as deriveTransactionCapabilities, Ki as defaultThemeTokens, Kn as escapeStyleContent, Kr as boundaryTreatmentForBoundaryOptionId, Kt as canRedoHistory, Li as makeBoundaryId, Ln as SITE_OVERLAY_HEADER_CLEARANCE_CSS_VAR, Lr as GRADIENT_PRESET_IDS, Ma as DialogDescription, Mi as isThemeV2NormalEditorRawStyleFieldName, Mn as createCustomBlockRegistry, Mt as RichTextWidgetProvider, Na as DialogFooter, Ni as pageDesignEditorBackgroundOverrideOwner, Nn as makeDefaultBlockComponent, Nt as EditorProvider, Oa as TabsList, Oi as bookingConsentCarrierSchema, On as useApiMediaUploader, Oo as parseMediaAssetId, Ot as ReferenceField, Pa as DialogHeader, Pi as stripStaleTransitionStyleGroup, Pn as getBlockDefinition, Pt as useEditor, Q as resolvePreviewSidebarTab, Qi as paletteModeSchema, Qn as resolvePageRouteTarget, Qr as backgroundAppearanceQuickColorTokenNames, Qt as unsafeAsLinkedContentEntryId, Rn as planSiteOverlayHeaderClearance, Rr as getGradientPreset, Rt as hideThemeV2RawStyleFields, Si as getAtPath, Sn as decodePublicProductCategorySelectorQuery, So as parseFooterModuleId, Sr as applyCompiledRuntimeFieldsToContent, St as EntryPickerField, Ti as calendarWindowQuerySchema, Tn as AMBIENT_BACKGROUND_ROLES, To as unsafeAsEditorBlockValues, Tr as planPageDesignLayoutLookCompatibility, Tt as ButtonWidgetProvider, Un as buildThemeRuntime, Ur as boundaryLayout, Ut as useEditorUiStore, Vn as compileManifestContentContract, Vr as autoDesignChoice, Vt as getBlockManifestFromSdkConfig, W as beginAutosaveBatch, Wn as DEFAULT_THEME_RESPONSIVE_MODE, Wr as composeBoundary, Wt as useEditorUiStoreInstance, Xa as X, Xn as defaultTransforms, Xr as sectionTransitionVariantForBoundaryOptionId, Xt as redoHistory, Y as rejectAutosaveBatch, Ya as cn, Yn as getDefaultComponentRegistry, Yr as sectionTransitionFamilyForBoundaryOptionId, Yt as pushHistoryEntry, Za as Upload, Zi as paletteColorsSchema, Zn as resolveEntryRouteTarget, Zr as backgroundAppearanceColorTokenNames, Zt as undoHistory, _ as reportPreviewDesignError, _a as SelectTrigger, _i as buildResolveImageUrlContext, _n as createStoreBackend, _o as ChevronLeft, _r as heroCtaRowFragment, _t as MailingListTargetingField, aa as hasEmptyOption, ai as runTransforms, ar as richTextFragment, bi as setContextResolveImageUrlContext, bn as getPageDesignEditorState, bo as buildMailingListSignupBlockSourceRef, br as bodyCopyFragment, bt as InlineTextField, ca as unmapValueFromSelect, ci as parseGeneratedIconSetId, cr as faqAccordionFragment, ct as EntryControllerProvider, d as PreviewDesignCoordinatorProvider, di as logger, dn as usePalette, dr as singleButtonFragment, dt as createSiteOptionApiLoader, ea as attachRenderableMediaAssetFields, ei as ctaButton, er as LINKED_CONTENT_ENTRY_META_KEY, et as renderSiteChromeBlock, fi as coerceInlineTextWithFallback, fo as Image, fr as formEmbedFragment, ft as createSiteOptionWidgetAdapters, g as PREVIEW_DESIGN_SAVE_ERROR_MESSAGE, ga as SelectItem, gi as RichText$1, gn as evaluateVisibility, go as ChevronRight, gr as ctaCopyFragment, gt as OfferingsPreviewWidgetProvider, h as PREVIEW_DESIGN_LOAD_ERROR_MESSAGE, ha as SelectContent, hi as Text$1, hn as FormRenderer, hr as testimonialsHeadingFragment, ht as OfferingsPreviewGroupOrderField, i as usePreviewDesignHistoryOrder, ia as useSdkConfig, ii as parseBackgroundContent, in as BUILT_IN_REFERENCE_KINDS, io as RotateCcw, ir as ImageResolveContextProvider, it as PREVIEW_EDITABLE_OUTLINE, ja as DialogContent, ji as corners, jn as containerResponsiveThemeCss, jr as surfaceResolutionContextFromTheme, jt as RichTextField, ka as TabsTrigger, ki as isObjectRecord, kn as isSupportedLoaderEndpoint, ko as parseSiteId, kr as designRuntimeRulesForTheme, kt as ReferenceWidgetProvider, la as FieldFrame, lr as faqHeadingFragment, m as usePreviewThemeOverlay, ma as Select, mi as isInlineTextEmpty, mr as testimonialsCarouselFragment, mt as SiteOptionWidgetProvider, n as useSiteChromeCustomizeOptional, na as isHeaderField, nn as createRoutingHelpers, nr as getLinkedContentEntryMeta, nt as PreviewInlineTextEditor, oa as mapCurrentValueForSelect, oi as parseBlockIconValue, on as parseReferenceKind, or as headingFragment, ot as useUISelector, p as PreviewThemeOverlayProvider, pi as inlineTextToPlainText, pn as createManifestFormAdapter, po as GripVertical, pr as formCopyFragment, pt as SiteOptionPickerField, q as enqueueTransaction, qa as Button, qi as parseThemeForPersistence, qn as mergeContentWithBlockStyleOverrides, qr as defaultSectionTransitionVariantForFamily, qt as canUndoHistory, r as PreviewDesignHistoryOrderProvider, ra as SdkConfigProvider, ri as planSiteChromePlacement, rn as createSnapshotFromPageRecord, rr as clientComponentRegistry, rt as PreviewTextEditor, sa as mapOptionValueForSelect, si as parseGeneratedIconAssetId, sr as cardFragment, st as EditableBlockProvider, t as SiteChromeCustomizeProvider, ta as getFieldIntent, ti as bindingSchema, tn as useDebouncedLatestSave, tr as coerceLinkedContentEntriesPayload, tt as PreviewRichTextEditor, ua as useField, ui as renderInlineText, un as PaletteProvider, ur as blogFeaturedPostFragment, ut as useEntryEditorController, va as SelectValue, vi as getCurrentResolveImageUrlContext, vn as MediaEditor, vr as ctaRowFragment, vt as loadMailingListAuthoringContext, wi as BlockApiProvider, wn as deriveLaunchReadiness, wo as unsafeAsEditorBlockId, wr as formatSiteChromeBackgroundTokenLabel, wt as ButtonVariantField, xi as SECTION_BACKGROUND_MIN_SOURCE_WIDTH, xo as sameMailingListPlacementTargeting, xr as defineFragment, xt as IconPickerField, yi as resolveImageUrlWithContext, yn as applyPageDesignEditorAction, yr as heroCopyFragment, yt as MailingListTargetingProvider, zn as visibleHeaderClearancePx, zr as parseGradientPresetId, zt as prepareBlockEditorManifest } from "./SiteChromeCustomizeContext-DEACFH9m.mjs";
3
+ import { i as useOptionalPreviewLayout, t as PreviewQueryProvider } from "./PreviewQueryProvider-Cg51xq1w.mjs";
4
+ import { _ as API_ENDPOINTS, a as usePreviewToken, c as createBearerAPIClient, d as unwrapResponse, g as resolveSurfaceDocumentAttributes, h as SURFACE_IDS, i as usePreviewAuthFetch, m as SURFACE_DOCUMENT_DATA_ATTRIBUTE, n as markPreviewAuthExpired, o as isPreviewRuntimeSessionEditable, r as usePreviewAuth, s as ApiRequestError, t as initPreviewAuth } from "./previewAuthStore-h5IgbSp4.mjs";
5
5
  import * as React$1 from "react";
6
6
  import React, { Children, Fragment, cloneElement, createContext, isValidElement, useCallback, useContext, useEffect, useId, useLayoutEffect, useMemo, useReducer, useRef, useState } from "react";
7
7
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
8
- import { createPortal } from "react-dom";
9
8
  import { z } from "zod";
9
+ import { createPortal } from "react-dom";
10
10
  //#region ../ui/src/fixed-bottom-surface.tsx
11
11
  const SURFACE_CLASS_BY_VARIANT = {
12
12
  light: "z-40 border-t border-border bg-editor-chrome-surface text-foreground",
@@ -990,6 +990,39 @@ function resolveBlockData(blockId, dataLoaders, dataContext, routes) {
990
990
  return dataLoaders && typeof dataLoaders === "object" && Object.keys(dataLoaders).length > 0 ? {} : void 0;
991
991
  }
992
992
  //#endregion
993
+ //#region ../blocks/src/system/runtime/nodes/newsletter-form.block-submission.ts
994
+ /** Authorise one block source for both public and preview rendering. */
995
+ function planNewsletterBlockSubmission(placement) {
996
+ if (placement.stage === "published") {
997
+ const sourceRef = buildMailingListSignupBlockSourceRef(placement.blockId, placement.selectedContentVersionId);
998
+ return sourceRef ? {
999
+ tag: "ready",
1000
+ sourceRef
1001
+ } : { tag: "unavailable" };
1002
+ }
1003
+ if (placement.publishedPlacement) return planNewsletterPreviewSubmission({
1004
+ blockId: placement.blockId,
1005
+ publishedContentId: placement.publishedPlacement.id,
1006
+ renderedContent: placement.renderedContent,
1007
+ publishedContent: placement.publishedPlacement.content
1008
+ });
1009
+ if (placement.stage === "preview") return { tag: "unpublished-form" };
1010
+ return { tag: "unavailable" };
1011
+ }
1012
+ /** Decide whether the visible draft can safely cite the published placement. */
1013
+ function planNewsletterPreviewSubmission(placement) {
1014
+ if (!placement.publishedContentId) return { tag: "unpublished-form" };
1015
+ if (!placement.publishedContent) return { tag: "unpublished-settings" };
1016
+ const draft = parseMailingListPlacementTargeting(placement.renderedContent.targeting ?? { mode: "default" });
1017
+ const published = parseMailingListPlacementTargeting(placement.publishedContent.targeting);
1018
+ if (!draft.ok || !published.ok || !sameMailingListPlacementTargeting(draft.value, published.value)) return { tag: "unpublished-settings" };
1019
+ const sourceRef = buildMailingListSignupBlockSourceRef(placement.blockId, placement.publishedContentId);
1020
+ return sourceRef ? {
1021
+ tag: "ready",
1022
+ sourceRef
1023
+ } : { tag: "unpublished-settings" };
1024
+ }
1025
+ //#endregion
993
1026
  //#region ../blocks/src/pageRenderPreparation.ts
994
1027
  /**
995
1028
  * Stage two of the render plan.
@@ -1118,9 +1151,20 @@ function buildBlockOverrideProps(input) {
1118
1151
  imageResolveContext: input.imageResolveContext,
1119
1152
  blockId: block.id ?? null,
1120
1153
  contentVersionId: block.contentVersionId ?? null,
1154
+ ...newsletterBlockProps(block, input.content, dataContext?.previewStage),
1121
1155
  blockKind: block.kind
1122
1156
  };
1123
1157
  }
1158
+ function newsletterBlockProps(block, renderedContent, stage) {
1159
+ if (block.kind !== "block.newsletter-signup") return {};
1160
+ return { newsletterBlockSubmission: planNewsletterBlockSubmission({
1161
+ blockId: block.id,
1162
+ selectedContentVersionId: block.contentVersionId ?? null,
1163
+ publishedPlacement: block.publishedPlacement ?? null,
1164
+ renderedContent,
1165
+ stage
1166
+ }) };
1167
+ }
1124
1168
  /** Site, transport and session context a block needs to call back to the API. */
1125
1169
  function blockSessionProps(dataContext) {
1126
1170
  return {
@@ -7016,6 +7060,20 @@ const PAGE_CONTENT_TYPE_SCHEMA = {
7016
7060
  };
7017
7061
  //#endregion
7018
7062
  //#region ../preview-next/src/client/preview/PreviewEntryControllerProvider.tsx
7063
+ function toEditorInitialBlock(block, index) {
7064
+ return {
7065
+ id: block.id,
7066
+ draftContentId: block.draftContentId ?? null,
7067
+ publishedContentId: block.publishedContentId ?? null,
7068
+ kind: block.kind,
7069
+ orderIndex: typeof block.orderIndex === "number" ? block.orderIndex : index,
7070
+ content: block.content ?? null,
7071
+ draftContent: block.draftContent ?? null,
7072
+ publishedContent: block.publishedContent ?? null,
7073
+ bindings: block.bindings ?? null,
7074
+ optimisticHash: block.optimisticHash ?? null
7075
+ };
7076
+ }
7019
7077
  function PreviewEntryControllerProvider({ children, siteId, pageId, routeId: providedRouteId, entryData, contentTypeSchema, draftContent, initialStatus = "draft", initialBlocks, pageMetadata, apiClient }) {
7020
7078
  const { isEditingMode } = useEditor();
7021
7079
  const schema = contentTypeSchema ?? PAGE_CONTENT_TYPE_SCHEMA;
@@ -7076,17 +7134,7 @@ function PreviewEntryControllerProvider({ children, siteId, pageId, routeId: pro
7076
7134
  schema
7077
7135
  ]);
7078
7136
  const normalizedInitialBlocks = useMemo(() => {
7079
- return (initialBlocks ?? []).map((b, index) => ({
7080
- id: b.id ?? null,
7081
- contentVersionId: b.contentVersionId ?? null,
7082
- kind: b.kind,
7083
- orderIndex: typeof b.orderIndex === "number" ? b.orderIndex : index,
7084
- content: b.content ?? null,
7085
- draftContent: b.draftContent ?? null,
7086
- publishedContent: b.publishedContent ?? null,
7087
- bindings: b.bindings ?? null,
7088
- optimisticHash: b.optimisticHash ?? null
7089
- }));
7137
+ return (initialBlocks ?? []).map(toEditorInitialBlock);
7090
7138
  }, [initialBlocks]);
7091
7139
  const entityId = pageId || entryData?.id || "";
7092
7140
  const entityType = entryData ? entryData.type : "page";
@@ -8603,7 +8651,7 @@ function CustomizeBackgroundControlRows({ modeLabel, valueLabel, valueAriaLabel,
8603
8651
  }
8604
8652
  //#endregion
8605
8653
  //#region ../preview-next/src/client/preview/SiteChromeCustomizeButton.tsx
8606
- function SiteChromeCustomizeButton({ surface, containerClassName = "pointer-events-auto absolute right-2 top-2 z-50 opacity-0 transition group-focus-within/site-chrome:opacity-100 group-hover/site-chrome:opacity-100" }) {
8654
+ function SiteChromeCustomizeButton({ surface, containerClassName = "pointer-events-auto absolute right-2 top-2 z-50 flex gap-1 opacity-0 transition group-focus-within/site-chrome:opacity-100 group-hover/site-chrome:opacity-100" }) {
8607
8655
  const customize = useSiteChromeCustomizeOptional();
8608
8656
  const editorUiStore = useOptionalEditorUiStoreInstance();
8609
8657
  const popover = useCustomizePopoverController();
@@ -8669,121 +8717,136 @@ function SiteChromeCustomizeButton({ surface, containerClassName = "pointer-even
8669
8717
  }),
8670
8718
  fallbackClassName: containerClassName,
8671
8719
  forceVisible: popover.open,
8672
- children: [/* @__PURE__ */ jsx(CustomizePillButton, {
8673
- buttonRef: popover.buttonRef,
8674
- ariaLabel: `Customize ${surface}`,
8675
- open: popover.open,
8676
- controlsId: popover.panelId,
8677
- onClick: popover.toggle,
8678
- disabled: !hasCustomizeControls
8679
- }), popover.open && surfaceState.kind === "available" ? /* @__PURE__ */ jsxs(CustomizePopoverShell, {
8680
- panelId: popover.panelId,
8681
- descriptionId: popover.descriptionId,
8682
- dialogLabel: `Customize ${surface}`,
8683
- eyebrow: "Site",
8684
- title: surfaceState.label,
8685
- dialogRef: popover.dialogRef,
8686
- closeButtonRef: popover.registerInitialFocus,
8687
- onClose: popover.close,
8688
- onKeyDown: popover.handleDialogKeyDown,
8689
- side: popoverSide,
8690
- children: [
8691
- controlPlan.cycleRows.map((row) => /* @__PURE__ */ jsx(CustomizeCycleRow, { ...row }, row.label)),
8692
- background?.available ? /* @__PURE__ */ jsx(SiteChromeBackgroundControl, {
8693
- background,
8694
- applyAllowed: surfaceState.applyAllowed,
8695
- chooserOpen: backgroundChooserOpen,
8696
- onToggleChooser: (event) => {
8697
- event.preventDefault();
8698
- event.stopPropagation();
8699
- setBackgroundChooserOpen((open) => !open);
8700
- },
8701
- onCycleMode: (direction, event) => {
8702
- event.preventDefault();
8703
- event.stopPropagation();
8704
- chooseSiteChromeBackgroundMode({
8705
- background,
8706
- direction,
8707
- onChoose: (override) => customize?.chooseSurfaceBackground(surfaceState.surface, override)
8708
- });
8709
- },
8710
- onCycleValue: (direction, event) => {
8711
- event.preventDefault();
8712
- event.stopPropagation();
8713
- customize?.cycleSurfaceBackground(surfaceState.surface, direction);
8714
- },
8715
- onChoose: (override) => customize?.chooseSurfaceBackground(surfaceState.surface, override)
8716
- }) : null,
8717
- surfaceState.surface === "header" ? /* @__PURE__ */ jsxs("div", {
8718
- className: "grid grid-cols-2 gap-2 border-t pt-3",
8719
- children: [/* @__PURE__ */ jsxs("label", {
8720
- className: "block text-xs font-medium text-muted-foreground",
8721
- children: [/* @__PURE__ */ jsx("span", { children: "Display" }), /* @__PURE__ */ jsx("select", {
8722
- className: "mt-1 h-8 w-full rounded-md border bg-background px-2 text-sm text-foreground disabled:cursor-not-allowed disabled:opacity-50",
8723
- value: surfaceState.brandDisplay,
8724
- onChange: (event) => {
8725
- event.stopPropagation();
8726
- customize?.setHeaderBrandDisplay(event.currentTarget.value);
8727
- },
8728
- disabled: !surfaceState.applyAllowed,
8729
- children: surfaceState.brandDisplayOptions.map((option) => /* @__PURE__ */ jsx("option", {
8730
- value: option.value,
8731
- disabled: option.disabled,
8732
- children: option.label
8733
- }, option.value))
8734
- })]
8735
- }), /* @__PURE__ */ jsxs("label", {
8736
- className: "block text-xs font-medium text-muted-foreground",
8737
- children: [/* @__PURE__ */ jsx("span", { children: surfaceState.brandSizeLabel }), /* @__PURE__ */ jsx("select", {
8738
- className: "mt-1 h-8 w-full rounded-md border bg-background px-2 text-sm text-foreground disabled:cursor-not-allowed disabled:opacity-50",
8739
- value: surfaceState.logoSize,
8740
- onChange: (event) => {
8741
- event.stopPropagation();
8742
- customize?.setHeaderLogoSize(event.currentTarget.value);
8743
- },
8744
- disabled: !surfaceState.applyAllowed,
8745
- children: surfaceState.logoSizeOptions.map((option) => /* @__PURE__ */ jsx("option", {
8746
- value: option.value,
8747
- children: option.label
8748
- }, option.value))
8749
- })]
8750
- })]
8751
- }) : null,
8752
- editorUiStore && (surfaceState.surface === "footer" || customize?.canOpenDesignEditor === true) ? /* @__PURE__ */ jsx("div", {
8753
- className: "border-t pt-2",
8754
- children: /* @__PURE__ */ jsx("button", {
8755
- type: "button",
8756
- className: "w-full rounded-md border bg-background px-3 py-2 text-sm font-medium hover:bg-muted",
8757
- onClick: (event) => {
8720
+ children: [
8721
+ /* @__PURE__ */ jsx(CustomizePillButton, {
8722
+ buttonRef: popover.buttonRef,
8723
+ ariaLabel: `Customize ${surface}`,
8724
+ open: popover.open,
8725
+ controlsId: popover.panelId,
8726
+ onClick: popover.toggle,
8727
+ disabled: !hasCustomizeControls
8728
+ }),
8729
+ surface === "footer" ? /* @__PURE__ */ jsx(FooterEditPill, {}) : null,
8730
+ popover.open && surfaceState.kind === "available" ? /* @__PURE__ */ jsxs(CustomizePopoverShell, {
8731
+ panelId: popover.panelId,
8732
+ descriptionId: popover.descriptionId,
8733
+ dialogLabel: `Customize ${surface}`,
8734
+ eyebrow: "Site",
8735
+ title: surfaceState.label,
8736
+ dialogRef: popover.dialogRef,
8737
+ closeButtonRef: popover.registerInitialFocus,
8738
+ onClose: popover.close,
8739
+ onKeyDown: popover.handleDialogKeyDown,
8740
+ side: popoverSide,
8741
+ children: [
8742
+ controlPlan.cycleRows.map((row) => /* @__PURE__ */ jsx(CustomizeCycleRow, { ...row }, row.label)),
8743
+ background?.available ? /* @__PURE__ */ jsx(SiteChromeBackgroundControl, {
8744
+ background,
8745
+ applyAllowed: surfaceState.applyAllowed,
8746
+ chooserOpen: backgroundChooserOpen,
8747
+ onToggleChooser: (event) => {
8758
8748
  event.preventDefault();
8759
8749
  event.stopPropagation();
8760
- if (surfaceState.surface === "footer") editorUiStore.getState().openPreviewEditor({
8761
- kind: "footer",
8762
- target: "overview"
8763
- });
8764
- else editorUiStore.getState().openPreviewEditor({
8765
- kind: "design",
8766
- row: "header-style"
8750
+ setBackgroundChooserOpen((open) => !open);
8751
+ },
8752
+ onCycleMode: (direction, event) => {
8753
+ event.preventDefault();
8754
+ event.stopPropagation();
8755
+ chooseSiteChromeBackgroundMode({
8756
+ background,
8757
+ direction,
8758
+ onChoose: (override) => customize?.chooseSurfaceBackground(surfaceState.surface, override)
8767
8759
  });
8768
- popover.close();
8769
8760
  },
8770
- children: surfaceState.surface === "footer" ? "Edit footer" : "More options"
8771
- })
8772
- }) : null,
8773
- surfaceState.diagnostics.length > 0 ? /* @__PURE__ */ jsx("ul", {
8774
- className: "space-y-1 text-xs text-amber-700",
8775
- children: surfaceState.diagnostics.map((diagnostic) => /* @__PURE__ */ jsx("li", { children: diagnostic }, diagnostic))
8776
- }) : null,
8777
- surfaceState.failure ? /* @__PURE__ */ jsx("p", {
8778
- className: "text-xs text-red-700",
8779
- children: surfaceState.failure
8780
- }) : null,
8781
- !surfaceState.applyAllowed ? /* @__PURE__ */ jsx("p", {
8782
- className: "text-xs text-muted-foreground",
8783
- children: "Preview only - ask an admin to apply."
8784
- }) : null
8785
- ]
8786
- }) : null]
8761
+ onCycleValue: (direction, event) => {
8762
+ event.preventDefault();
8763
+ event.stopPropagation();
8764
+ customize?.cycleSurfaceBackground(surfaceState.surface, direction);
8765
+ },
8766
+ onChoose: (override) => customize?.chooseSurfaceBackground(surfaceState.surface, override)
8767
+ }) : null,
8768
+ surfaceState.surface === "header" ? /* @__PURE__ */ jsxs("div", {
8769
+ className: "grid grid-cols-2 gap-2 border-t pt-3",
8770
+ children: [/* @__PURE__ */ jsxs("label", {
8771
+ className: "block text-xs font-medium text-muted-foreground",
8772
+ children: [/* @__PURE__ */ jsx("span", { children: "Display" }), /* @__PURE__ */ jsx("select", {
8773
+ className: "mt-1 h-8 w-full rounded-md border bg-background px-2 text-sm text-foreground disabled:cursor-not-allowed disabled:opacity-50",
8774
+ value: surfaceState.brandDisplay,
8775
+ onChange: (event) => {
8776
+ event.stopPropagation();
8777
+ customize?.setHeaderBrandDisplay(event.currentTarget.value);
8778
+ },
8779
+ disabled: !surfaceState.applyAllowed,
8780
+ children: surfaceState.brandDisplayOptions.map((option) => /* @__PURE__ */ jsx("option", {
8781
+ value: option.value,
8782
+ disabled: option.disabled,
8783
+ children: option.label
8784
+ }, option.value))
8785
+ })]
8786
+ }), /* @__PURE__ */ jsxs("label", {
8787
+ className: "block text-xs font-medium text-muted-foreground",
8788
+ children: [/* @__PURE__ */ jsx("span", { children: surfaceState.brandSizeLabel }), /* @__PURE__ */ jsx("select", {
8789
+ className: "mt-1 h-8 w-full rounded-md border bg-background px-2 text-sm text-foreground disabled:cursor-not-allowed disabled:opacity-50",
8790
+ value: surfaceState.logoSize,
8791
+ onChange: (event) => {
8792
+ event.stopPropagation();
8793
+ customize?.setHeaderLogoSize(event.currentTarget.value);
8794
+ },
8795
+ disabled: !surfaceState.applyAllowed,
8796
+ children: surfaceState.logoSizeOptions.map((option) => /* @__PURE__ */ jsx("option", {
8797
+ value: option.value,
8798
+ children: option.label
8799
+ }, option.value))
8800
+ })]
8801
+ })]
8802
+ }) : null,
8803
+ editorUiStore && surfaceState.surface === "header" && customize?.canOpenDesignEditor === true ? /* @__PURE__ */ jsx("div", {
8804
+ className: "border-t pt-2",
8805
+ children: /* @__PURE__ */ jsx("button", {
8806
+ type: "button",
8807
+ className: "w-full rounded-md border bg-background px-3 py-2 text-sm font-medium hover:bg-muted",
8808
+ onClick: (event) => {
8809
+ event.preventDefault();
8810
+ event.stopPropagation();
8811
+ editorUiStore.getState().openPreviewEditor({
8812
+ kind: "design",
8813
+ row: "header-style"
8814
+ });
8815
+ popover.close();
8816
+ },
8817
+ children: "More options"
8818
+ })
8819
+ }) : null,
8820
+ surfaceState.diagnostics.length > 0 ? /* @__PURE__ */ jsx("ul", {
8821
+ className: "space-y-1 text-xs text-amber-700",
8822
+ children: surfaceState.diagnostics.map((diagnostic) => /* @__PURE__ */ jsx("li", { children: diagnostic }, diagnostic))
8823
+ }) : null,
8824
+ surfaceState.failure ? /* @__PURE__ */ jsx("p", {
8825
+ className: "text-xs text-red-700",
8826
+ children: surfaceState.failure
8827
+ }) : null,
8828
+ !surfaceState.applyAllowed ? /* @__PURE__ */ jsx("p", {
8829
+ className: "text-xs text-muted-foreground",
8830
+ children: "Preview only - ask an admin to apply."
8831
+ }) : null
8832
+ ]
8833
+ }) : null
8834
+ ]
8835
+ });
8836
+ }
8837
+ /** Opens the footer composer, matching the block toolbar's Edit pill. */
8838
+ function FooterEditPill() {
8839
+ const editorUiStore = useOptionalEditorUiStoreInstance();
8840
+ if (!editorUiStore) return null;
8841
+ return /* @__PURE__ */ jsx("button", {
8842
+ type: "button",
8843
+ className: previewCustomizePillButtonClassName,
8844
+ "aria-label": "Edit footer",
8845
+ onClick: () => editorUiStore.getState().openPreviewEditor({
8846
+ kind: "footer",
8847
+ target: "overview"
8848
+ }),
8849
+ children: "Edit"
8787
8850
  });
8788
8851
  }
8789
8852
  const POPOVER_VIEWPORT_GUTTER_PX = 16;
@@ -8957,36 +9020,52 @@ function FooterModuleInspectionSurface({ children }) {
8957
9020
  children
8958
9021
  }) : /* @__PURE__ */ jsx(Fragment$1, { children });
8959
9022
  }
9023
+ const FOOTER_MODULE_SELECTOR = "[data-preview-footer-module-id]";
9024
+ /**
9025
+ * Footer sections are edited like in-place text: hovering one, or keyboard
9026
+ * focus anywhere inside it, draws the preview's standard dashed outline.
9027
+ *
9028
+ * - A section with nothing interactive inside (logo, text) is itself a
9029
+ * button: click, Enter or Space opens the footer composer on it.
9030
+ * - A section holding links or form controls is a labelled group, never a
9031
+ * button (no nested interactive content, no extra tab stop). Activating one
9032
+ * of its links, by click or Enter, opens the section; form controls (the
9033
+ * footer signup form) keep working.
9034
+ *
9035
+ * The footer-wide Edit and Customize pills live in SiteChromeCustomizeButton.
9036
+ */
9037
+ const footerModuleAffordanceCss = `
9038
+ ${FOOTER_MODULE_SELECTOR} {
9039
+ cursor: pointer;
9040
+ border-radius: 2px;
9041
+ }
9042
+ ${FOOTER_MODULE_SELECTOR}:hover,
9043
+ ${FOOTER_MODULE_SELECTOR}:focus-visible,
9044
+ ${FOOTER_MODULE_SELECTOR}:has(:focus-visible) {
9045
+ outline: ${PREVIEW_EDITABLE_OUTLINE};
9046
+ outline-offset: 2px;
9047
+ }
9048
+ `;
8960
9049
  function EnabledFooterModuleInspectionSurface({ children, editorUiStore }) {
8961
9050
  const rootRef = useRef(null);
8962
- const [active, setActive] = useState(null);
8963
- const [position, setPosition] = useState(null);
8964
9051
  useEffect(() => {
8965
9052
  const root = rootRef.current;
8966
9053
  if (!root) return;
8967
- const modules = root.querySelectorAll("[data-preview-footer-module-id]");
9054
+ const modules = root.querySelectorAll(FOOTER_MODULE_SELECTOR);
8968
9055
  for (const module of modules) {
8969
- module.tabIndex = 0;
9056
+ if (module.querySelector(INTERACTIVE_CONTENT_SELECTOR)) {
9057
+ module.setAttribute("role", "group");
9058
+ module.removeAttribute("tabindex");
9059
+ } else {
9060
+ module.setAttribute("role", "button");
9061
+ module.tabIndex = 0;
9062
+ }
8970
9063
  const label = module.dataset.previewFooterModuleId?.replace(/-/gu, " ") ?? "footer section";
8971
9064
  module.setAttribute("aria-label", `Edit ${label}`);
8972
9065
  }
8973
9066
  }, [children]);
8974
- const activateElement = (element) => {
8975
- if (!element) return;
8976
- const parsed = parseFooterModuleId(element.dataset.previewFooterModuleId);
8977
- if (!parsed.ok) return;
8978
- const label = element.dataset.previewFooterModuleId?.replace(/-/gu, " ") ?? "footer section";
8979
- const rect = element.getBoundingClientRect();
8980
- setActive({
8981
- moduleId: parsed.value,
8982
- label
8983
- });
8984
- setPosition({
8985
- top: Math.max(8, rect.top + 8),
8986
- left: Math.max(8, rect.right - 64)
8987
- });
8988
- };
8989
- const inspect = (moduleId) => {
9067
+ const inspect = (moduleId, event) => {
9068
+ event.preventDefault();
8990
9069
  editorUiStore.getState().openPreviewEditor({
8991
9070
  kind: "footer",
8992
9071
  target: { moduleId }
@@ -8995,27 +9074,34 @@ function EnabledFooterModuleInspectionSurface({ children, editorUiStore }) {
8995
9074
  return /* @__PURE__ */ jsxs("div", {
8996
9075
  ref: rootRef,
8997
9076
  style: { display: "contents" },
8998
- onMouseOver: (event) => activateElement(event.target.closest("[data-preview-footer-module-id]")),
8999
- onFocusCapture: (event) => activateElement(event.target.closest("[data-preview-footer-module-id]")),
9077
+ onClick: (event) => {
9078
+ const moduleId = footerModuleIdForClick(event.target);
9079
+ if (moduleId) inspect(moduleId, event);
9080
+ },
9000
9081
  onKeyDown: (event) => {
9001
9082
  if (event.key !== "Enter" && event.key !== " ") return;
9002
- const element = event.target.closest("[data-preview-footer-module-id]");
9003
- if (!element) return;
9004
- const parsed = parseFooterModuleId(element.dataset.previewFooterModuleId);
9005
- if (!parsed.ok) return;
9006
- event.preventDefault();
9007
- inspect(parsed.value);
9083
+ const moduleId = footerModuleIdForKey(event.target);
9084
+ if (moduleId) inspect(moduleId, event);
9008
9085
  },
9009
- children: [children, active && position ? /* @__PURE__ */ jsx("button", {
9010
- type: "button",
9011
- className: "pointer-events-auto fixed z-[75] rounded-full border bg-background px-3 py-1.5 text-xs font-medium text-foreground shadow-md",
9012
- style: position,
9013
- "aria-label": `Edit ${active.label}`,
9014
- onClick: () => inspect(active.moduleId),
9015
- children: "Edit"
9016
- }) : null]
9086
+ children: [/* @__PURE__ */ jsx("style", { children: footerModuleAffordanceCss }), children]
9017
9087
  });
9018
9088
  }
9089
+ const FORM_CONTROL_SELECTOR = "input, select, textarea, button, label";
9090
+ const INTERACTIVE_CONTENT_SELECTOR = `a[href], ${FORM_CONTROL_SELECTOR}`;
9091
+ function footerModuleIdOf(element) {
9092
+ if (!(element instanceof HTMLElement)) return null;
9093
+ const parsed = parseFooterModuleId(element.dataset.previewFooterModuleId);
9094
+ return parsed.ok ? parsed.value : null;
9095
+ }
9096
+ /** The footer section a click should open, or null to let the click through. */
9097
+ function footerModuleIdForClick(target) {
9098
+ if (!(target instanceof Element) || target.closest(FORM_CONTROL_SELECTOR)) return null;
9099
+ return footerModuleIdOf(target.closest(FOOTER_MODULE_SELECTOR));
9100
+ }
9101
+ /** Enter/Space only opens a section when the section itself has focus. */
9102
+ function footerModuleIdForKey(target) {
9103
+ return target instanceof Element && target.matches(FOOTER_MODULE_SELECTOR) ? footerModuleIdOf(target) : null;
9104
+ }
9019
9105
  function isHostElement(child) {
9020
9106
  return typeof child.type === "string";
9021
9107
  }
@@ -9300,10 +9386,10 @@ function resolveShellThemeRoles(props) {
9300
9386
  }
9301
9387
  const previewContainerResponsiveEnabled = process.env.NEXT_PUBLIC_ENABLE_PREVIEW_CONTAINER_RESPONSIVE !== "false";
9302
9388
  const PreviewEditorSidebar = React.lazy(async () => {
9303
- return { default: (await import("./PreviewEditorSidebar-O-V6Pl5a.mjs")).PreviewEditorSidebar };
9389
+ return { default: (await import("./PreviewEditorSidebar-kg2r2Fyi.mjs")).PreviewEditorSidebar };
9304
9390
  });
9305
9391
  const PreviewEditorUI = React.lazy(async () => {
9306
- return { default: (await import("./PreviewEditorUI-1UlX_9cw.mjs")).PreviewEditorUI };
9392
+ return { default: (await import("./PreviewEditorUI-sWMLp5dT.mjs")).PreviewEditorUI };
9307
9393
  });
9308
9394
  const previewPaneContainmentStyle = {
9309
9395
  contain: "layout paint",
@@ -10059,25 +10145,30 @@ function getDraftSnapshots(uiStore) {
10059
10145
  return new Map(snapshots.map((snap) => [snap.id, snap]));
10060
10146
  }
10061
10147
  function mergeBlockWithDraft(block, draftMap, index, projections = [], linkedEntryOverlays = EMPTY_LINKED_ENTRY_OVERLAY) {
10148
+ const { draftContentId = null, publishedContentId = null } = block;
10062
10149
  const id = block.id ?? null;
10063
10150
  const editorBlockId = id ? unsafeAsEditorBlockId(id) : null;
10064
10151
  const snap = editorBlockId ? draftMap.get(editorBlockId) ?? null : null;
10065
10152
  const draftContent = editorBlockId ? readProjectedDraftRenderContent(block, editorBlockId, snap, projections) : null;
10066
- const baseline = snap?.baseline ?? block.content ?? block.publishedContent ?? null;
10153
+ const baseline = blockBaseline(block, snap);
10067
10154
  return {
10068
10155
  id,
10069
- contentVersionId: block.contentVersionId ?? null,
10156
+ draftContentId,
10157
+ publishedContentId,
10070
10158
  kind: block.kind,
10071
10159
  purpose: "content",
10072
10160
  orderIndex: block.orderIndex ?? index,
10073
10161
  content: renderContent(block, baseline, projections, linkedEntryOverlays),
10074
10162
  draftContent: renderContent(block, draftContent, projections, linkedEntryOverlays),
10075
- publishedContent: renderContent(block, block.publishedContent ?? null, projections, EMPTY_LINKED_ENTRY_OVERLAY),
10163
+ publishedContent: block.publishedContent ?? null,
10076
10164
  bindings: block.bindings ?? null
10077
10165
  };
10078
10166
  }
10079
10167
  function readProjectedDraftRenderContent(block, editorBlockId, snap, projections) {
10080
- return applyPreviewContentFieldProjections(editorBlockId, snap?.current ?? snap?.baseline ?? block.content ?? block.publishedContent ?? null, projections);
10168
+ return applyPreviewContentFieldProjections(editorBlockId, snap?.current ?? blockBaseline(block, snap), projections);
10169
+ }
10170
+ function blockBaseline(block, snapshot) {
10171
+ return snapshot?.baseline ?? block.content ?? block.publishedContent ?? null;
10081
10172
  }
10082
10173
  function renderContent(block, content, projections, linkedEntryOverlays) {
10083
10174
  return applyPreviewRuntimeContentProjections(block, applyLinkedEntryRenderOverlay(content, linkedEntryOverlays), projections);
@@ -10087,7 +10178,9 @@ function renderContent(block, content, projections, linkedEntryOverlays) {
10087
10178
  function transformToPageBlock(enriched) {
10088
10179
  return {
10089
10180
  id: enriched.id,
10090
- ...enriched.contentVersionId !== null ? { contentVersionId: enriched.contentVersionId } : {},
10181
+ draftContentId: enriched.draftContentId,
10182
+ publishedContentId: enriched.publishedContentId,
10183
+ contentVersionId: enriched.draftContentId ?? enriched.publishedContentId,
10091
10184
  kind: enriched.kind,
10092
10185
  purpose: enriched.purpose,
10093
10186
  content: enriched.content ?? {},
@@ -11308,7 +11401,7 @@ function BoundaryControl({ previousBlockId, nextBlockId, previousBlockKind, next
11308
11401
  /* @__PURE__ */ jsx("div", { className: "absolute inset-0 bg-sky-500/10 opacity-0 transition-opacity duration-150 group-hover/boundary:opacity-100 group-focus-within/boundary:opacity-100" }),
11309
11402
  /* @__PURE__ */ jsx("button", {
11310
11403
  type: "button",
11311
- className: "pointer-events-auto absolute inset-0 z-10 flex items-center justify-center opacity-0 transition hover:opacity-100 focus:opacity-100 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-sky-300 group-hover/boundary:opacity-100 group-focus-within/boundary:opacity-100",
11404
+ className: "pointer-events-auto relative z-10 flex h-11 min-w-11 items-center justify-center rounded-full opacity-0 transition hover:opacity-100 focus:opacity-100 focus:outline-none focus-visible:ring-2 focus-visible:ring-sky-300 group-hover/boundary:opacity-100 group-focus-within/boundary:opacity-100",
11312
11405
  "aria-controls": open ? panelId : void 0,
11313
11406
  "aria-expanded": open,
11314
11407
  "aria-haspopup": "dialog",
@@ -12109,6 +12202,21 @@ var SdkPreviewModeRuntime_exports = /* @__PURE__ */ __exportAll({ SdkPreviewMode
12109
12202
  function isSdkCustomBlockArray(value) {
12110
12203
  return Array.isArray(value);
12111
12204
  }
12205
+ function toPreviewBlock(block, index) {
12206
+ const publishedContent = block.publishedContent;
12207
+ return {
12208
+ id: block.id,
12209
+ draftContentId: typeof block.draftContentId === "string" ? block.draftContentId : null,
12210
+ publishedContentId: typeof block.publishedContentId === "string" ? block.publishedContentId : null,
12211
+ kind: block.kind,
12212
+ purpose: block.purpose,
12213
+ orderIndex: index,
12214
+ content: block.content ?? null,
12215
+ draftContent: block.draftContent ?? null,
12216
+ publishedContent: publishedContent && typeof publishedContent === "object" && !Array.isArray(publishedContent) ? publishedContent : null,
12217
+ bindings: block.bindings ?? null
12218
+ };
12219
+ }
12112
12220
  function getSdkConfigForPreview(value) {
12113
12221
  if (!value || typeof value !== "object") return null;
12114
12222
  if (!("customBlocks" in value)) return { layout: { footerMode: resolveSdkFooterMode(value) } };
@@ -12212,17 +12320,7 @@ function resolveSdkPreviewRuntimeModel(props) {
12212
12320
  const routeMap = content.routeMap ?? void 0;
12213
12321
  const sdkConfig = getSdkConfigForPreview(content.sdkConfig);
12214
12322
  const customBlocks = isSdkCustomBlockArray(content.customBlocks) ? content.customBlocks : null;
12215
- const initialBlocks = (page.blocks ?? []).map((block, index) => ({
12216
- id: block.id ?? null,
12217
- contentVersionId: typeof block.contentVersionId === "string" ? block.contentVersionId : null,
12218
- kind: block.kind,
12219
- purpose: block.purpose ?? null,
12220
- orderIndex: index,
12221
- content: block.content ?? null,
12222
- draftContent: block.draftContent ?? null,
12223
- publishedContent: null,
12224
- bindings: block.bindings ?? null
12225
- }));
12323
+ const initialBlocks = (page.blocks ?? []).map(toPreviewBlock);
12226
12324
  const commonModel = {
12227
12325
  content,
12228
12326
  customBlocks,