@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.
- package/CHANGELOG.md +17 -0
- package/dist/{PreviewEditorSidebar-O-V6Pl5a.mjs → PreviewEditorSidebar-kg2r2Fyi.mjs} +4 -4
- package/dist/{PreviewEditorUI-1UlX_9cw.mjs → PreviewEditorUI-sWMLp5dT.mjs} +3 -3
- package/dist/{PreviewQueryProvider-BxGwdOCV.mjs → PreviewQueryProvider-Cg51xq1w.mjs} +1 -1
- package/dist/{SdkPreviewModeRuntime-DYbA_4iv.mjs → SdkPreviewModeRuntime-h2ti3Hch.mjs} +280 -182
- package/dist/{SiteChromeCustomizeContext-CNTKQ9nx.mjs → SiteChromeCustomizeContext-DEACFH9m.mjs} +1330 -734
- package/dist/_dts/ai/src/contracts/proposals.d.ts +924 -0
- package/dist/_dts/ai/src/contracts/siteStyleProposalSchemas.d.ts +84 -0
- package/dist/_dts/api/src/bookingConfig.d.ts +8 -1
- package/dist/_dts/api/src/bookingManagementEndpoints.d.ts +8 -14
- package/dist/_dts/api/src/bookingManagementEventEndpointTypes.d.ts +45 -1
- package/dist/_dts/api/src/clientErrorReporting.d.ts +50 -0
- package/dist/_dts/api/src/communications.d.ts +20 -4
- package/dist/_dts/api/src/contentRuntime.d.ts +3 -7
- package/dist/_dts/api/src/endpoints.d.ts +223 -88
- package/dist/_dts/api/src/event-visibility.d.ts +20 -0
- package/dist/_dts/api/src/eventManagementContracts.d.ts +56 -3
- package/dist/_dts/api/src/eventManagementEndpointDefinitions.d.ts +24 -0
- package/dist/_dts/api/src/eventPageWords.d.ts +19 -0
- package/dist/_dts/api/src/eventSeriesRegistrationEndpointDefinitions.d.ts +14 -0
- package/dist/_dts/api/src/index.d.ts +7 -1
- package/dist/_dts/api/src/indexCoreTypes.d.ts +1 -1
- package/dist/_dts/api/src/indexExtendedTypes.d.ts +1 -1
- package/dist/_dts/api/src/launchReadiness.d.ts +20 -2
- package/dist/_dts/api/src/launchRequirementPriority.d.ts +3 -0
- package/dist/_dts/api/src/newsletterCampaignCommandEndpoints.d.ts +13 -0
- package/dist/_dts/api/src/newsletterEndpointDefinitions.d.ts +42 -0
- package/dist/_dts/api/src/occurrenceScheduling.d.ts +10 -0
- package/dist/_dts/api/src/pageSurfaceEndpoints.d.ts +44 -0
- package/dist/_dts/api/src/participantMessaging.d.ts +11 -1
- package/dist/_dts/api/src/sdk-event-upsert.d.ts +40 -1
- package/dist/_dts/api/src/sdkContracts.d.ts +3 -42
- package/dist/_dts/api/src/sdkCourseBooking.d.ts +30 -0
- package/dist/_dts/api/src/sdkEventEndpointDefinitions.d.ts +76 -0
- package/dist/_dts/api/src/sdkEventLifecycle.d.ts +37 -0
- package/dist/_dts/api/src/sdkManagedEventContracts.d.ts +18 -0
- package/dist/_dts/api/src/sdkPageDesign.d.ts +388 -0
- package/dist/_dts/api/src/sdkPageDesignEndpointDefinitions.d.ts +22 -0
- package/dist/_dts/api/src/sdkPullEventContracts.d.ts +46 -0
- package/dist/_dts/api/src/siteAddressEndpoints.d.ts +29 -0
- package/dist/_dts/api/src/siteManagementEndpointDefinitions.d.ts +49 -0
- package/dist/_dts/api/src/siteManagementEndpoints.d.ts +2 -32
- package/dist/_dts/api/src/siteOnboarding.d.ts +75 -9
- package/dist/_dts/api/src/sitePlatformEndpoints.d.ts +1 -1
- package/dist/_dts/api/src/types.d.ts +7 -1
- package/dist/_dts/api/src/wholeSeriesRuns.d.ts +14 -0
- package/dist/_dts/blocks/src/index.d.ts +2 -0
- package/dist/_dts/blocks/src/pageRenderAdmission.d.ts +10 -0
- package/dist/_dts/blocks/src/pageRendererContracts.d.ts +3 -1
- package/dist/_dts/blocks/src/system/blocks/events/shared/schemas.d.ts +27 -5
- package/dist/_dts/blocks/src/system/blocks/events/shared/types.d.ts +14 -1
- package/dist/_dts/blocks/src/system/icons/social.d.ts +1 -1
- package/dist/_dts/blocks/src/system/registry.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/eventSourceRecovery.d.ts +1 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/eventCollectionContract.d.ts +20 -4
- package/dist/_dts/blocks/src/system/runtime/nodes/form.fields.d.ts +5 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/newsletter-form.block-submission.d.ts +36 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/newsletter-form.client.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/newsletter-form.interactive.d.ts +6 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/newsletter-form.parts.d.ts +46 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/newsletter-form.types.d.ts +2 -1
- package/dist/_dts/blocks/src/system/runtime/resolver.d.ts +2 -1
- package/dist/_dts/blocks/src/system/runtime/shared/components/CheckboxChoice.d.ts +18 -0
- package/dist/_dts/blocks/src/system/runtime/shared/components/index.d.ts +1 -0
- package/dist/_dts/content-editor/src/index.d.ts +1 -0
- package/dist/_dts/content-editor/src/primitives/previewEditableOutline.d.ts +2 -0
- package/dist/_dts/content-editor/src/ui/editorBlockEquality.d.ts +3 -0
- package/dist/_dts/content-editor/src/ui/editorSnapshot.d.ts +3 -5
- package/dist/_dts/core/src/block-content-identity.d.ts +5 -0
- package/dist/_dts/core/src/editor-state.d.ts +2 -7
- package/dist/_dts/core/src/index.d.ts +1 -0
- package/dist/_dts/core/src/mailing-list-submission.d.ts +3 -1
- package/dist/_dts/core/src/public-event-booking-availability.d.ts +20 -1
- package/dist/_dts/core/src/public-profile.d.ts +3 -1
- package/dist/_dts/db/src/generated/supabase/database.types.d.ts +49 -2
- package/dist/_dts/editor-blocks/src/BlockEditor.d.ts +3 -0
- package/dist/_dts/editor-blocks/src/block-editor/EmptyState.d.ts +13 -1
- package/dist/_dts/editor-blocks/src/block-editor/types.d.ts +2 -8
- package/dist/_dts/editor-blocks/src/index.d.ts +1 -0
- package/dist/_dts/preview-next/src/client/blocks/composer/types.d.ts +3 -4
- package/dist/_dts/preview-next/src/client/preview/PreviewEntryControllerProvider.d.ts +1 -2
- package/dist/_dts/sdk/src/next/renderSdkContent.d.ts +0 -1
- package/dist/_dts/sdk/src/rendering/blocks-page-renderer.d.ts +2 -2
- package/dist/_dts/sdk/src/rendering/components/pageShared.d.ts +2 -2
- package/dist/_dts/sdk/src/rendering/helpers/loadContent.d.ts +6 -1
- package/dist/_dts/sdk/src/rendering/helpers/loadPage.d.ts +5 -2
- package/dist/_dts/sdk/src/rendering/helpers/pageRuntimeSupport.d.ts +6 -1
- package/dist/_dts/sdk/src/rendering/helpers/templateContent.d.ts +2 -0
- package/dist/_dts/sdk/src/rendering/hooks/useContent.d.ts +5 -1
- package/dist/_dts/sdk/src/rendering/hooks/usePage.d.ts +5 -1
- package/dist/_dts/sdk/src/version.d.ts +1 -1
- package/dist/_dts/surfaces/src/index.d.ts +9 -0
- package/dist/_dts/theme-core/src/generated/containerResponsiveThemeCss.d.ts +1 -1
- package/dist/_dts/theme-core/src/inputs/checkable.d.ts +42 -0
- package/dist/_dts/theme-core/src/inputs/inputGroup.d.ts +19 -0
- package/dist/_dts/ui/src/navigation-tabs.d.ts +2 -1
- package/dist/client/{BookingConsentAgreement-DlVOmpW4.mjs → BookingConsentAgreement-BQKL045f.mjs} +2 -2
- package/dist/client/CheckboxChoice--W2n6yKs.mjs +24 -0
- package/dist/client/{DiscountCodeDisclosure-T9q623PQ.mjs → DiscountCodeDisclosure-CsOtjFY7.mjs} +1 -1
- package/dist/client/{EventCombined.client-DnsUeONl.mjs → EventCombined.client-BdRjVbhH.mjs} +6 -6
- package/dist/client/{EventListing.client-CNBFqJS4.mjs → EventListing.client-DBxC6xOU.mjs} +2 -2
- package/dist/client/{LeafletStaticMap-C7higg52.mjs → LeafletStaticMap-mHEJKrTs.mjs} +1 -1
- package/dist/client/{ThemedButton-LAJTNrS8.mjs → ThemedButton-CE5KYT6z.mjs} +1 -1
- package/dist/client/{accordion-BcNF9TjX.mjs → accordion-BEQNSptH.mjs} +1 -1
- package/dist/client/{bookingForm-BUaQ3S03.mjs → bookingForm-AMr-s5vw.mjs} +33 -52
- package/dist/client/bookings.mjs +48 -46
- package/dist/client/{carousel-CTdF6e0V.mjs → carousel-Bbt_QgJy.mjs} +1 -1
- package/dist/client/{cart-pGtyf_XU.mjs → cart-CnWi30zJ.mjs} +3 -3
- package/dist/client/{checkout-Da9WSn7Y.mjs → checkout-f3nkWgd4.mjs} +3 -3
- package/dist/client/client.mjs +1611 -815
- package/dist/client/{context-BFeY_Wbm.mjs → context-Bc8T6pCe.mjs} +1 -1
- package/dist/client/{dates-BhwVSxDg.mjs → dates-DUsCEzLb.mjs} +2 -3
- package/dist/client/{eventCalendar-BAtdnR4s.mjs → eventCalendar-CKwgXui5.mjs} +9 -9
- package/dist/client/{eventCombined-RksA3tRC.mjs → eventCombined-CBAOSTGR.mjs} +4 -4
- package/dist/client/{eventDetails-BB9hB4wR.mjs → eventDetails-Dh-_WiBD.mjs} +4 -4
- package/dist/client/{eventListing-BpJBkviM.mjs → eventListing-CA3frIH5.mjs} +4 -4
- package/dist/client/{eventRegistration-B18jFq_o.mjs → eventRegistration-BHtsgdcg.mjs} +21 -22
- package/dist/client/{form-Dodt8Y8t.mjs → form-C2h3YAcg.mjs} +135 -104
- package/dist/client/{headerSection-B0qj9ttg.mjs → headerSection-lwMuMTH9.mjs} +3 -3
- package/dist/client/hooks.mjs +489 -65
- package/dist/client/{locationMap-gn-iMk7a.mjs → locationMap-DJ2bLODV.mjs} +3 -3
- package/dist/client/{newsletterForm-oByLdFkr.mjs → newsletterForm-8Pu5K32g.mjs} +203 -101
- package/dist/client/{pricing-BOU0_Hai.mjs → pricing-HHx3IgBz.mjs} +1 -1
- package/dist/client/{productDetail-D9v1zH2j.mjs → productDetail-C_1odnAf.mjs} +3 -3
- package/dist/client/{productList-D-mItx1n.mjs → productList-CtCv-Nmx.mjs} +3 -3
- package/dist/client/{propsDecoder-C3TP_z4x.mjs → propsDecoder-Dcgsncxb.mjs} +40 -23
- package/dist/client/rendering/client.mjs +490 -457
- package/dist/client/rendering/islands.mjs +17 -17
- package/dist/client/rendering.mjs +1515 -628
- package/dist/client/{routeIslandApiConfig-DzN1W0sq.mjs → routeIslandApiConfig-CWLP7wu3.mjs} +1 -1
- package/dist/client/{scrollToBlock-CWs8EIdo.mjs → scrollToBlock-BNgaEUpo.mjs} +1 -1
- package/dist/client/{shop-Dufw7N7o.mjs → shop-DQXrQ8kJ.mjs} +7 -7
- package/dist/client/{shop-commerce-gklw_hLF.mjs → shop-commerce-B88zmWWo.mjs} +6 -6
- package/dist/client/{shop-commerce-store-Sf1eyTaZ.mjs → shop-commerce-store-DtSfkKuX.mjs} +1 -1
- package/dist/client/{shopShared-B5nyA41S.mjs → shopShared-cuaONpkJ.mjs} +4 -4
- package/dist/client/{useEventFilters-CLL829vy.mjs → useEventFilters-Bukew6Gb.mjs} +6 -6
- package/dist/preview-next/before-render.mjs +368 -103
- package/dist/preview-next/client/runtime.mjs +4 -4
- package/dist/preview-next/editor-base.css +11 -0
- package/dist/preview-next/keepAlive.mjs +328 -103
- package/dist/preview-next/middleware.mjs +329 -103
- package/dist/{previewAuthStore-BxAFlu-j.mjs → previewAuthStore-h5IgbSp4.mjs} +353 -103
- package/dist/{sdk-runtime-D0uZFev7.mjs → sdk-runtime-DTc1uIXn.mjs} +2 -2
- package/dist/{separator-EvdCAn4V.mjs → separator-BpHS1KZK.mjs} +1 -1
- package/dist/server/components.mjs +1376 -331
- package/dist/server/config-validation.mjs +405 -27
- package/dist/server/config.mjs +405 -27
- package/dist/server/data.mjs +405 -27
- package/dist/server/index.mjs +370 -104
- package/dist/server/next.mjs +1430 -463
- package/dist/server/page-converter.mjs +36 -25
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/rendering/server.mjs +1374 -331
- package/dist/server/rendering.mjs +1436 -364
- package/dist/server/routing.mjs +476 -43
- package/dist/server/server.mjs +504 -169
- package/dist/server/theme-bridge.mjs +467 -111
- package/dist/styles/index.css +186 -65
- package/package.json +1 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { $i as
|
|
3
|
-
import { i as useOptionalPreviewLayout, t as PreviewQueryProvider } from "./PreviewQueryProvider-
|
|
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-
|
|
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(
|
|
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: [
|
|
8673
|
-
|
|
8674
|
-
|
|
8675
|
-
|
|
8676
|
-
|
|
8677
|
-
|
|
8678
|
-
|
|
8679
|
-
|
|
8680
|
-
|
|
8681
|
-
|
|
8682
|
-
|
|
8683
|
-
|
|
8684
|
-
|
|
8685
|
-
|
|
8686
|
-
|
|
8687
|
-
|
|
8688
|
-
|
|
8689
|
-
|
|
8690
|
-
|
|
8691
|
-
|
|
8692
|
-
|
|
8693
|
-
|
|
8694
|
-
|
|
8695
|
-
|
|
8696
|
-
|
|
8697
|
-
|
|
8698
|
-
|
|
8699
|
-
|
|
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
|
-
|
|
8761
|
-
|
|
8762
|
-
|
|
8763
|
-
|
|
8764
|
-
|
|
8765
|
-
|
|
8766
|
-
|
|
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
|
-
|
|
8771
|
-
|
|
8772
|
-
|
|
8773
|
-
|
|
8774
|
-
|
|
8775
|
-
|
|
8776
|
-
|
|
8777
|
-
|
|
8778
|
-
|
|
8779
|
-
|
|
8780
|
-
|
|
8781
|
-
|
|
8782
|
-
|
|
8783
|
-
|
|
8784
|
-
|
|
8785
|
-
|
|
8786
|
-
|
|
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(
|
|
9054
|
+
const modules = root.querySelectorAll(FOOTER_MODULE_SELECTOR);
|
|
8968
9055
|
for (const module of modules) {
|
|
8969
|
-
module.
|
|
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
|
|
8975
|
-
|
|
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
|
-
|
|
8999
|
-
|
|
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
|
|
9003
|
-
if (
|
|
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: [
|
|
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-
|
|
9389
|
+
return { default: (await import("./PreviewEditorSidebar-kg2r2Fyi.mjs")).PreviewEditorSidebar };
|
|
9304
9390
|
});
|
|
9305
9391
|
const PreviewEditorUI = React.lazy(async () => {
|
|
9306
|
-
return { default: (await import("./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 =
|
|
10153
|
+
const baseline = blockBaseline(block, snap);
|
|
10067
10154
|
return {
|
|
10068
10155
|
id,
|
|
10069
|
-
|
|
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:
|
|
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 ??
|
|
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
|
-
|
|
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
|
|
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(
|
|
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,
|