@riverbankcms/sdk 0.152.0 → 0.153.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 +15 -0
- package/dist/{EventEmbeddedCheckoutStep-DVQXWFm6.mjs → EventEmbeddedCheckoutStep-veN-QiAE.mjs} +1 -1
- package/dist/{PreviewEditorSidebar-Dr4NJi3Q.mjs → PreviewEditorSidebar-jI_4DTZY.mjs} +4 -4
- package/dist/{PreviewEditorUI-DSZXQbyh.mjs → PreviewEditorUI-ORkVZhfu.mjs} +3 -3
- package/dist/{SdkPreviewModeRuntime-Dl4GyMc3.mjs → SdkPreviewModeRuntime-DaNqevI1.mjs} +221 -115
- package/dist/{SiteChromeCustomizeContext-DgBe-FlM.mjs → SiteChromeCustomizeContext-CgNuBHC0.mjs} +1798 -2024
- package/dist/{ThemedButton-B8ViBnLK.mjs → ThemedButton-X2UxhW6F.mjs} +213 -38
- package/dist/_dts/ai/src/contracts/proposals.d.ts +52 -52
- package/dist/_dts/ai/src/contracts/siteStyleProposalSchemas.d.ts +2357 -7859
- package/dist/_dts/api/src/communications.d.ts +19 -5
- package/dist/_dts/api/src/indexExtendedTypes.d.ts +1 -1
- package/dist/_dts/api/src/sdkThemeWire.d.ts +186 -1434
- package/dist/_dts/api/src/shared-contracts.d.ts +10 -0
- package/dist/_dts/api/src/siteInfrastructure.d.ts +2 -1
- package/dist/_dts/api/src/teamMembers.d.ts +2 -27
- package/dist/_dts/block-form/src/widgets/RepeaterField/components/layoutGridDomain.d.ts +3 -13
- package/dist/_dts/blocks/src/contracts/index.d.ts +1 -0
- package/dist/_dts/blocks/src/index.d.ts +1 -0
- package/dist/_dts/blocks/src/lib/media.d.ts +1 -0
- package/dist/_dts/blocks/src/lib/picsum.d.ts +2 -2
- package/dist/_dts/blocks/src/pageRendererContracts.d.ts +2 -1
- package/dist/_dts/blocks/src/system/blocks/events/eventSelectionFields.d.ts +1 -1
- package/dist/_dts/blocks/src/system/blocks/events/shared/schemas.d.ts +196 -804
- package/dist/_dts/blocks/src/system/blocks/events/shared/types.d.ts +2 -2
- package/dist/_dts/blocks/src/system/blocks/location-map.d.ts +1 -1
- package/dist/_dts/blocks/src/system/blocks/media-text.d.ts +45 -45
- package/dist/_dts/blocks/src/system/blocks/shared/teamMembers.d.ts +4 -7
- package/dist/_dts/blocks/src/system/blocks/team-members.d.ts +2 -2
- package/dist/_dts/blocks/src/system/customize/backgrounds.d.ts +6 -6
- package/dist/_dts/blocks/src/system/fields/backgroundContent.d.ts +377 -1
- package/dist/_dts/blocks/src/system/helpers/backgroundMedia.d.ts +6 -2
- package/dist/_dts/blocks/src/system/helpers/resolveBackground.d.ts +3 -3
- package/dist/_dts/blocks/src/system/layout/repeaterGrid.d.ts +12 -5
- package/dist/_dts/blocks/src/system/manifest/fieldValidation/index.d.ts +3 -3
- package/dist/_dts/blocks/src/system/manifest/schema.d.ts +24 -24
- package/dist/_dts/blocks/src/system/manifest/validation.d.ts +2 -0
- package/dist/_dts/blocks/src/system/node/fragments/lookSlot.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/hooks/useBookingFlowController.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/hooks/useHeadlessBookingFlow.d.ts +2 -0
- package/dist/_dts/blocks/src/system/runtime/lookSurfaces.d.ts +2 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/ImageResolveContext.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/appointment-services.d.ts +50 -202
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.headless.state.d.ts +28 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-details/lookPresentation.d.ts +2 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/event-details/presentation.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/CardListItem.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/eventCollectionContract.d.ts +276 -884
- package/dist/_dts/blocks/src/system/runtime/nodes/file-download.d.ts +3 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/media.d.ts +22 -90
- package/dist/_dts/blocks/src/system/runtime/nodes/mediaContext.d.ts +69 -0
- package/dist/_dts/blocks/src/system/transforms/registry/index.d.ts +1 -0
- package/dist/_dts/blocks/src/system/transforms/registry/links.d.ts +3 -3
- package/dist/_dts/content-model/src/content-types/schema.d.ts +3 -3
- package/dist/_dts/core/src/mailing-list-runtime.d.ts +2 -2
- package/dist/_dts/core/src/mailing-list-setup-parser.d.ts +9 -1
- package/dist/_dts/core/src/mailing-list-setup.d.ts +9 -1
- package/dist/_dts/core/src/mailing-list-submission.d.ts +1 -1
- package/dist/_dts/core/src/mailing-list-targeting.d.ts +9 -1
- package/dist/_dts/db/src/generated/supabase/database.types.d.ts +55 -4
- package/dist/_dts/editor-blocks/src/index.d.ts +1 -0
- package/dist/_dts/editor-blocks/src/media/MediaField.d.ts +2 -2
- package/dist/_dts/editor-blocks/src/media/admitEditorMediaField.d.ts +4 -0
- package/dist/_dts/editor-blocks/src/widgets/mailing-list-targeting/targetingState.d.ts +2 -2
- package/dist/_dts/media-core/src/assetsInUseSummary.d.ts +6 -0
- package/dist/_dts/media-core/src/contentMediaAudit.d.ts +3 -2
- package/dist/_dts/media-core/src/index.d.ts +4 -0
- package/dist/_dts/media-core/src/media.d.ts +406 -0
- package/dist/_dts/media-core/src/mediaIdentifierSchema.d.ts +3 -0
- package/dist/_dts/media-core/src/mediaKinds.d.ts +2 -0
- package/dist/_dts/media-core/src/mediaUsageProjection.d.ts +13 -1
- package/dist/_dts/media-core/src/mediaWriteNormalizer.d.ts +2 -6
- package/dist/_dts/media-core/src/portableMediaReferences.d.ts +8 -21
- package/dist/_dts/media-core/src/renderableMediaAsset.d.ts +28 -14
- package/dist/_dts/media-core/src/renderableMediaAssetAdmission.d.ts +15 -0
- package/dist/_dts/media-editor/src/CropDialog.d.ts +6 -3
- package/dist/_dts/media-editor/src/MediaEditor.d.ts +2 -1
- package/dist/_dts/media-editor/src/MediaPreview.d.ts +3 -3
- package/dist/_dts/media-editor/src/cropEditorSource.d.ts +5 -7
- package/dist/_dts/media-editor/src/editorMediaState.d.ts +29 -0
- package/dist/_dts/media-editor/src/mediaSelection.d.ts +1 -2
- package/dist/_dts/media-editor/src/runtimeMediaAssetState.d.ts +4 -5
- package/dist/_dts/media-editor/src/types.d.ts +1 -1
- package/dist/_dts/media-editor/src/utils.d.ts +0 -1
- package/dist/_dts/media-react/src/components/cropChangePolicy.d.ts +4 -1
- package/dist/_dts/media-react/src/components/cropGeometry.d.ts +1 -0
- package/dist/_dts/media-react/src/components/useImageCropperController.d.ts +1 -0
- package/dist/_dts/preview-next/src/client/blocks/BlockBackgroundChooser.d.ts +2 -1
- package/dist/_dts/preview-next/src/client/blocks/previewCustomizeSelectedMedia.d.ts +11 -12
- package/dist/_dts/sdk/src/contracts/content.d.ts +2 -45
- package/dist/_dts/sdk/src/contracts/index.d.ts +1 -1
- package/dist/_dts/sdk/src/contracts/rendering.d.ts +3 -3
- package/dist/_dts/sdk/src/index.d.ts +1 -0
- package/dist/_dts/sdk/src/rendering/image.d.ts +5 -5
- package/dist/_dts/sdk/src/rendering/index.d.ts +2 -1
- package/dist/_dts/sdk/src/rendering/link.d.ts +3 -7
- package/dist/_dts/sdk/src/rendering/mediaAssets.d.ts +2 -4
- package/dist/_dts/sdk/src/version.d.ts +1 -1
- package/dist/_dts/theme-core/src/accordions/types.d.ts +1 -1
- package/dist/_dts/theme-core/src/boxBackgroundSchema.d.ts +397 -26
- package/dist/_dts/theme-core/src/buttons/types.d.ts +21 -21
- package/dist/_dts/theme-core/src/cards/types.d.ts +34 -34
- package/dist/_dts/theme-core/src/inputs/types.d.ts +3 -3
- package/dist/_dts/theme-core/src/lib/media.d.ts +2 -616
- package/dist/_dts/theme-core/src/mock-themes/all.d.ts +261 -2619
- package/dist/_dts/theme-core/src/palette/curated/types.d.ts +1 -1
- package/dist/_dts/theme-core/src/schema.d.ts +548 -3187
- package/dist/_dts/theme-core/src/site-styles/backgroundAppearance.d.ts +2 -2
- package/dist/_dts/theme-core/src/site-styles/runtimeBackgroundResolution.d.ts +9 -9
- package/dist/_dts/theme-core/src/site-styles/styleTags.d.ts +1 -1
- package/dist/_dts/theme-core/src/site-styles/tokenRecipes.d.ts +1 -1
- package/dist/_dts/theme-core/src/styles/skinTokens.d.ts +2 -2
- package/dist/_dts/theme-core/src/typography/schema.d.ts +2 -2
- package/dist/client/{BookingMailingListNote-CBuMKN0w.mjs → BookingMailingListNote-DrchYW1m.mjs} +2 -2
- package/dist/client/{CardListItem-Dc9XTXhB.mjs → CardListItem-CC_GVmF6.mjs} +5 -4
- package/dist/client/{CheckboxChoice-CIqx_o0E.mjs → CheckboxChoice-Dq30m3DO.mjs} +1 -1
- package/dist/client/{DemoBookingPortalAccess-D3VQ_kLj.mjs → DemoBookingPortalAccess-ojwbVUmx.mjs} +2 -2
- package/dist/client/{EventCombined.client-BHGEKise.mjs → EventCombined.client-DyN0v0Xk.mjs} +5 -6
- package/dist/client/{EventEmbeddedCheckoutStep-Bo1Cm23R.mjs → EventEmbeddedCheckoutStep-CgfpKc3n.mjs} +2 -2
- package/dist/client/{EventListing.client-D5OQgVPr.mjs → EventListing.client-CuOuvYMz.mjs} +2 -2
- package/dist/client/{LeafletStaticMap-CLL5cWrr.mjs → LeafletStaticMap-B0WhRr3j.mjs} +1 -1
- package/dist/client/{RichText-BoDmnopf.mjs → RichText-C1fIXBzA.mjs} +45 -32
- package/dist/client/{ThemedButton-Ciltp0IK.mjs → ThemedButton-B7HFqFBg.mjs} +1 -2
- package/dist/client/{accordion-DOkRS64-.mjs → accordion-DCDVWSye.mjs} +1 -1
- package/dist/client/{bookingForm-wlMVwo9h.mjs → bookingForm-BJ3C4GlM.mjs} +42 -15
- package/dist/client/bookings.mjs +116989 -22191
- package/dist/client/{carousel-CGWk-Z0u.mjs → carousel-BSCBhfHY.mjs} +2 -2
- package/dist/client/{carousel.client-kX5mN1Eg.mjs → carousel.client-GEtOGsxo.mjs} +1 -1
- package/dist/client/{cart-OBBPlaH4.mjs → cart-Yv-aAtck.mjs} +3 -3
- package/dist/client/{checkout-Bmw2WjQX.mjs → checkout-B9xDkl30.mjs} +3 -3
- package/dist/client/client.mjs +17577 -17361
- package/dist/client/{context-BI77UFAn.mjs → context-BOGe3rIA.mjs} +1 -1
- package/dist/client/{eventCalendar-qkej2Edn.mjs → eventCalendar-D6M0T9hs.mjs} +8 -9
- package/dist/client/{eventCombined-DApKHvat.mjs → eventCombined-NM4UFBq8.mjs} +4 -4
- package/dist/client/{eventDetails-BQyUDPH0.mjs → eventDetails-f_FhV4O8.mjs} +3 -3
- package/dist/client/{eventListing-CeAnshlZ.mjs → eventListing-WLkfAROh.mjs} +4 -4
- package/dist/client/{eventRegistration-C3A3NyBO.mjs → eventRegistration-D3ejfLvW.mjs} +10 -10
- package/dist/client/{form-DW8rU7jO.mjs → form-D5Or2Jyu.mjs} +4 -5
- package/dist/client/{headerSection-CkIhsoNm.mjs → headerSection-hWgnv27V.mjs} +3 -3
- package/dist/client/hooks.mjs +16014 -15751
- package/dist/client/{locationMap-D4O8wbli.mjs → locationMap-Di1K0O2S.mjs} +3 -4
- package/dist/client/{media-C5K_0xPd.mjs → media-D29-F1u_.mjs} +183 -362
- package/dist/client/mediaContext-CwbbimYB.mjs +135 -0
- package/dist/client/{newsletterForm-B7IxSPuz.mjs → newsletterForm-CwxcwTNO.mjs} +4 -4
- package/dist/client/{productDetail-Bqxpwy5N.mjs → productDetail-BLSnhPdA.mjs} +3 -3
- package/dist/client/{productList-u9Lz8V15.mjs → productList-oGytONOX.mjs} +3 -3
- package/dist/client/{propsDecoder-Bf1jucUp.mjs → propsDecoder-lf_dTeZS.mjs} +1467 -125
- package/dist/client/renderableMediaAssetAdmission-CHkXYDC_.mjs +143 -0
- package/dist/client/rendering/client.mjs +10855 -10689
- package/dist/client/rendering/islands.mjs +20 -23
- package/dist/client/rendering.mjs +18411 -18181
- package/dist/client/{routeIslandApiConfig-BgP-aPMl.mjs → routeIslandApiConfig-Bc_WVPS8.mjs} +1 -1
- package/dist/client/{shop-B_eykR-_.mjs → shop-BQ3bR7fA.mjs} +7 -7
- package/dist/client/{shop-commerce-CT0APkFV.mjs → shop-commerce-DDPll6ZC.mjs} +8 -8
- package/dist/client/{shop-commerce-store-DcvZxdEK.mjs → shop-commerce-store-DO-e1pTe.mjs} +1 -1
- package/dist/client/{shopShared-BVJOiUiJ.mjs → shopShared-BylM9jh1.mjs} +5 -5
- package/dist/client/{useDiscountCodeUi-DPmYDunz.mjs → useDiscountCodeUi-B1Puub2v.mjs} +1 -1
- package/dist/client/{useEventPagination-8-U55vH5.mjs → useEventPagination-BBhkmQaT.mjs} +6 -7
- package/dist/preview-next/before-render.mjs +89 -4
- package/dist/preview-next/client/runtime.mjs +3 -3
- package/dist/{sdk-runtime-C5jPdSrk.mjs → sdk-runtime-DWCvhJGu.mjs} +1 -1
- package/dist/server/components.mjs +18663 -18510
- package/dist/server/config-validation.mjs +450 -215
- package/dist/server/config.mjs +450 -215
- package/dist/server/data.mjs +15940 -15705
- package/dist/server/index.mjs +227 -2
- package/dist/server/next.mjs +18643 -18490
- package/dist/server/page-converter.mjs +12588 -12477
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/rendering/server.mjs +18007 -17855
- package/dist/server/rendering.mjs +18677 -18516
- package/dist/server/routing.mjs +17747 -17469
- package/dist/server/server.mjs +539 -276
- package/dist/server/theme-bridge.mjs +154 -37
- package/dist/server/theme.mjs +154 -37
- package/dist/{spinner-B-ab2rJp.mjs → spinner-BYM-Y81w.mjs} +1 -1
- package/package.json +1 -1
- package/dist/client/aspectTransforms-D-TnDdq4.mjs +0 -93
- package/dist/client/colorStyles-ECDNPE_P.mjs +0 -1253
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { G as corners, H as parseThemeForPersistence,
|
|
2
|
+
import { $n as renderableMediaAssetSchema$1, Ar as makeBoundaryId, Cn as defaultThemeTokens, G as corners, H as parseThemeForPersistence, Qn as buildRenderableMediaAssetIndex, Ri as __exportAll, Si as parseSiteId, Un as paletteColorsSchema, Wn as paletteModeSchema, Xt as resolveSurface, _t as stripStaleTransitionStyleGroup, an as textColorStyle, ar as resolveSdkFooterMode, dr as asDesignBlockId, er as indexRenderableMediaAssets, fi as expectParsedBrandedId, gr as asLayoutVariantKey, nr as mediaIdentifierSchema$2, pt as isThemeV2NormalEditorRawStyleFieldName, tr as resolveManagedMediaReference, vr as asSiteStyleId, yr as assertNever$1 } from "./ThemedButton-X2UxhW6F.mjs";
|
|
3
3
|
import { i as useOptionalPreviewLayout, t as PreviewQueryProvider } from "./PreviewQueryProvider-AR9eEn7j.mjs";
|
|
4
|
-
import { $ as backgroundColorTokens, $a as Tabs, $i as defineFragment, $n as createRoutingHelpers, $o as parseFooterModuleId, $r as normalizeOfferingsPreviewItemLimit, $t as FileField, Aa as sectionFactsForContent, Ai as
|
|
4
|
+
import { $ as backgroundColorTokens, $a as Tabs, $i as defineFragment, $n as createRoutingHelpers, $o as parseFooterModuleId, $r as normalizeOfferingsPreviewItemLimit, $t as FileField, Aa as sectionFactsForContent, Ai as resolveImageUrlWithContext, An as mapOptionValueForSelect, Ar as SITE_CHROME_VISIBLE_HEADER_SELECTOR, At as createEditorApiClientFactory, Bi as blogFeaturedPostFragment, Bn as createManifestFormAdapter, Br as systemCustomizeFacetDefinitionsForBlock, Bt as SiteOptionPickerField, Ci as coerceInlineTextWithFallback, Cn as clientComponentRegistry, Cr as containerResponsiveThemeCss, Ct as useUISelector, Da as resolveLookSlotSurfaces, Di as LINKED_CONTENT_ENTRY_META_KEY, Dn as useSdkConfig, Do as SlidersHorizontal, Dr as normalizeBlockContent, Dt as useEntryEditorController, Ea as resolveItemSurface, Ei as plainTextToInlineText, En as SdkConfigProvider, Er as getBlockDefinition, Fa as deriveSectionGround, Fi as richTextFragment, Fn as prepareBlockEditorManifest, Fr as compileManifestContentContract, Ft as EditLeaseDiscardedNotice, G as PreviewPageDesignEditorStateProvider, Ga as SelectValue, Gi as testimonialsHeadingFragment, Gn as getBlockManifestFromSdkConfig, Go as Button, Gr as getResponsiveScopeSpec, Gt as loadMailingListAuthoringContext, H as arrangementBlockControlsFor, Ha as SelectContent, Hi as formEmbedFragment, Ho as ChevronLeft, Hr as systemCustomizeFacetNextValue, Ht as OfferingsPreviewGroupOrderField, Ia as parseCanonicalRuntimeBackground, Ii as headingFragment, In as stripTopLevelRoutingUi, Io as Info, Ir as validateManifestDraft, It as EditLeaseModal, Ji as ctaRowFragment, Jo as baselineRevisionOf, Jr as getDefaultComponentRegistry, Jt as IconPickerField, K as usePreviewPageDesignEditorState, Ki as ctaCopyFragment, Kn as ApiRequestError, Kr as escapeStyleContent, Kt as MailingListTargetingProvider, La as resolveSectionBackground, Li as cardFragment, Ln as evaluateVisibility, Lo as Image, Lr as resolveArrangementKnobs, Lt as EditorWriteSurface, Ma as sectionTransitionFamilies, Mi as buildResolveImageUrlContext, Mn as FieldFrame, Mr as planSiteOverlayHeaderClearance, Mt as useRetentionTicks, Na as sectionTransitionFamilyForBoundaryOptionId, Ni as getCurrentResolveImageUrlContext, Nn as useField, Nr as visibleHeaderClearancePx, Nt as VIEWING_PARTICIPATION, Oa as boundaryLayout, Oi as coerceLinkedContentEntriesPayload, On as hasEmptyOption, Oo as RotateCcw, Or as offeringsPreviewBlockDefinition, Pa as sectionTransitionVariantForBoundaryOptionId, Pi as setContextResolveImageUrlContext, Pn as hideThemeV2RawStyleFields, Pr as parseStoredVariant, Qi as bodyCopyFragment, Qn as API_ENDPOINTS, Qo as buildMailingListSignupBlockSourceRef, Qr as buildOfferingsPreviewRenderStates, Qt as ButtonWidgetProvider, Ri as faqAccordionFragment, Rn as getFieldIntent, Ro as GripVertical, Rr as systemCustomizeFacetAppliesToLayoutVariant, Rt as createSiteOptionApiLoader, Si as planSiteChromePlacement, Sn as useApiMediaUploader, Sr as ThemeScope, Ta as arrangementSlotNames, Ti as isInlineTextEmpty, Tn as BlockApiProvider, Tr as makeDefaultBlockComponent, Tt as EntryControllerProvider, U as arrangementOwnedFieldIds, Ua as SelectItem, Ui as formCopyFragment, Ur as buildThemeRuntime, Ut as OfferingsPreviewWidgetProvider, V as arrangementBackgroundControlFor, Va as Select, Vi as singleButtonFragment, Vo as ChevronRight, Vr as systemCustomizeFacetLabelForValue, Vt as SiteOptionWidgetProvider, W as nextArrangementLookPin, Wa as SelectTrigger, Wi as testimonialsCarouselFragment, Wn as blocksKeys, Wr as DEFAULT_THEME_RESPONSIVE_MODE, Wt as MailingListTargetingField, Xi as ctaButton, Xn as SURFACE_IDS, Xr as buildItemDataMap, Xt as EntryPickerWidgetProvider, Yi as heroCopyFragment, Yn as SURFACE_DOCUMENT_DATA_ATTRIBUTE, Yo as isEdited, Yr as buildOfferingsCatalogueState, Yt as EntryPickerField, Zi as runTransforms, Zn as resolveSurfaceDocumentAttributes, Zo as canEditorWrite, Zr as OFFERINGS_PREVIEW_EVENT_PRESET_DEFINITIONS, Zt as ButtonVariantField, _a as surfaceResolutionContextFromTheme, _i as resolveEntryRouteTarget, _n as decodePublicProductCategorySelectorQuery, _r as renderedFieldChanges, _t as renderSiteChromeBlock, aa as compileEditorModelRuntime, ai as parseGeneratedIconSetId, an as RichTextWidgetProvider, ao as DialogDescription, as as parseEditLeaseScope, at as planBackgroundOverride, ba as getGradientPreset, bi as isObjectRecord, bn as MediaEditorContextProvider, bo as X, br as unsafeAsLinkedContentEntryId, bt as PreviewTextEditor, c as PreviewDesignCoordinatorProvider, ca as readStoredMode, ci as Text$1, cn as LinkField, co as DialogTitle, cr as unwrapResponse, ct as resolveBackgroundCapability, d as usePreviewThemeOverlay, da as resolvePublishedLook, di as siblingPath, dn as PaletteProvider, dr as useOptionalEditorUiStoreInstance, dt as initPreviewAuth, ea as bindingSchema, ei as resolveOfferingsPreviewGroups, en as MediaField, eo as TabsContent, er as createSnapshotFromPageRecord, es as parseMailingListPlacementTargeting, et as canCycleBackgroundOverrideValue, fa as componentRuntimeRulesForTheme, fi as defaultTransforms, fn as usePalette, ft as registerPreviewRenewalFetcher, gi as isRichTextDoc, gn as MediaEditor, gr as renderSourceFor, hi as bookingConsentCarrierSchema, hn as createStoreBackend, hr as remoteDraftValues, ht as usePreviewToken, ia as applyCompiledRuntimeFieldsToContent, ii as parseGeneratedIconAssetId, in as RichTextField, io as DialogContent, ir as parseReferenceKind, is as selectedContentVersionId, it as parseBackgroundOverrideFromContent, ja as defaultSectionTransitionVariantForFamily, ji as SECTION_BACKGROUND_MIN_SOURCE_WIDTH, jn as unmapValueFromSelect, jr as SITE_OVERLAY_HEADER_CLEARANCE_CSS_VAR, jt as createPageSurfaceEditorServices, ka as composeBoundary, ki as getLinkedContentEntryMeta, kn as mapCurrentValueForSelect, kr as projectRecurringSchedule, la as resolveEffectiveArrangement, li as RichText$1, ln as LinkWidgetProvider, lr as useEditorUiStore, ls as unsafeAsEditorBlockId, lt as resolvePreviewSidebarTab, ma as getCuratedSiteStyle, mi as publicEventsArraySchema, mn as FormRenderer, mr as planLinkedSaveHandoverRetention, mt as usePreviewAuth, n as useSiteChromeCustomizeOptional, na as blockLookFromContent, nn as ReferenceWidgetProvider, no as TabsTrigger, nr as BUILT_IN_REFERENCE_KINDS, ns as NO_BLOCK_VERSIONS, nt as enabledBackgroundModes, oa as formatSiteChromeBackgroundTokenLabel, oi as renderInlineText, on as EditorProvider, oo as DialogFooter, ot as planBackgroundTransition, pa as designRuntimeRulesForTheme, pi as calendarWindowQuerySchema, pr as activeLinkedSaveHandover, pt as renewPreviewSession, q as PreviewDesignHistoryOrderProvider, qi as heroCtaRowFragment, qo as cn, qr as mergeContentWithBlockStyleOverrides, qt as InlineTextField, ra as readBlockComposition, ri as parseBlockIconValue, rn as useRichTextImagePicker, ro as Dialog, rs as readEditorBlockVersionsFromPlacement, rt as imagePoolForOverride, sa as arrangementManifestFromVariants, si as logger, sn as useEditor, so as DialogHeader, st as rankBackgroundImagePoolItems, t as SiteChromeCustomizeProvider, ta as arrangementHooksFromContent, ti as buildAppointmentServicesView, tn as ReferenceField, to as TabsList, ts as sameMailingListPlacementTargeting, tt as defaultBackgroundOverrideForMode, u as PreviewThemeOverlayProvider, ua as resolveModeArrangement, ui as getAtPath, ur as useEditorUiStoreInstance, us as assertNever$2, ut as createGuardedPreviewApiClient, va as gradientToCss, vi as resolvePageRouteTarget, vn as DEFAULT_LAUNCH_READINESS_INPUT, vr as resolveRenderedValues, vt as PreviewRichTextEditor, wi as inlineTextToPlainText, wn as ImageResolveContextProvider, wr as createCustomBlockRegistry, wt as EditableBlockProvider, xa as deriveSiteStyleBlockPolicy, xi as isRecord$8, xn as useMediaEditorOptional, xo as Upload, xr as isSupportedLoaderEndpoint, xt as PREVIEW_EDITABLE_OUTLINE, ya as GRADIENT_PRESETS, yi as resolveRouteTarget, yn as deriveLaunchReadiness, yt as PreviewInlineTextEditor, zi as faqHeadingFragment, zn as isHeaderField, zr as systemCustomizeFacetCurrentValue, zt as createSiteOptionWidgetAdapters } from "./SiteChromeCustomizeContext-CgNuBHC0.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";
|
|
@@ -3126,12 +3126,22 @@ function err(error) {
|
|
|
3126
3126
|
error
|
|
3127
3127
|
};
|
|
3128
3128
|
}
|
|
3129
|
+
const UUID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
3130
|
+
function parseUuidBrand(value, unsafeConstructor) {
|
|
3131
|
+
if (typeof value !== "string") return err({ kind: "not_string" });
|
|
3132
|
+
const normalized = value.trim().toLowerCase();
|
|
3133
|
+
if (normalized.length === 0) return err({ kind: "empty_string" });
|
|
3134
|
+
if (!UUID_PATTERN.test(normalized)) return err({ kind: "invalid_uuid" });
|
|
3135
|
+
return ok(unsafeConstructor(normalized));
|
|
3136
|
+
}
|
|
3129
3137
|
const unsafeAsSiteId = (id) => id;
|
|
3138
|
+
const unsafeAsMediaAssetId = (id) => id;
|
|
3130
3139
|
const unsafeAsStorageBucketName = (value) => value;
|
|
3131
3140
|
const unsafeAsBookingSessionId = (id) => id;
|
|
3132
3141
|
const unsafeAsEntitlementId = (id) => id;
|
|
3133
3142
|
const unsafeAsSiteFontId = (id) => id;
|
|
3134
3143
|
const unsafeAsBookingRequirementId = (id) => id;
|
|
3144
|
+
const parseMediaAssetId = (value) => parseUuidBrand(value, unsafeAsMediaAssetId);
|
|
3135
3145
|
function fromArray(items) {
|
|
3136
3146
|
const [first, ...rest] = items;
|
|
3137
3147
|
if (first === void 0) return err("empty_array");
|
|
@@ -3612,6 +3622,129 @@ function parseCanonicalMediaIdentifier(value) {
|
|
|
3612
3622
|
});
|
|
3613
3623
|
return parsed;
|
|
3614
3624
|
}
|
|
3625
|
+
/** Strict stored-reference admission delegates the canonical identifier decision. */
|
|
3626
|
+
const mediaIdentifierSchema$1 = z.string().transform((value, context) => {
|
|
3627
|
+
const parsed = parseCanonicalMediaIdentifier(value);
|
|
3628
|
+
if (parsed.ok) return parsed.value;
|
|
3629
|
+
context.addIssue({
|
|
3630
|
+
code: "custom",
|
|
3631
|
+
message: "Expected a canonical media identifier"
|
|
3632
|
+
});
|
|
3633
|
+
return z.NEVER;
|
|
3634
|
+
});
|
|
3635
|
+
const mediaTypeDiscriminants = [
|
|
3636
|
+
"image",
|
|
3637
|
+
"video",
|
|
3638
|
+
"audio",
|
|
3639
|
+
"document",
|
|
3640
|
+
"spreadsheet",
|
|
3641
|
+
"archive"
|
|
3642
|
+
];
|
|
3643
|
+
const mediaAssetIdSchema = z.string().transform((value, context) => {
|
|
3644
|
+
const parsed = parseMediaAssetId(value);
|
|
3645
|
+
if (parsed.ok) return parsed.value;
|
|
3646
|
+
context.addIssue({
|
|
3647
|
+
code: "custom",
|
|
3648
|
+
message: "Expected a media asset ID"
|
|
3649
|
+
});
|
|
3650
|
+
return z.NEVER;
|
|
3651
|
+
});
|
|
3652
|
+
const nonemptyStorageValue = z.string().refine((value) => value.trim().length > 0);
|
|
3653
|
+
const renderableMediaAssetSchema = z.object({
|
|
3654
|
+
id: mediaAssetIdSchema,
|
|
3655
|
+
identifier: mediaIdentifierSchema$1,
|
|
3656
|
+
storageBucket: nonemptyStorageValue,
|
|
3657
|
+
storagePath: nonemptyStorageValue,
|
|
3658
|
+
mimeType: nonemptyStorageValue,
|
|
3659
|
+
filename: z.string().optional(),
|
|
3660
|
+
width: z.number().positive().nullable(),
|
|
3661
|
+
height: z.number().positive().nullable()
|
|
3662
|
+
});
|
|
3663
|
+
const hotspotSchema = z.object({
|
|
3664
|
+
x: z.number().min(0).max(1),
|
|
3665
|
+
y: z.number().min(0).max(1),
|
|
3666
|
+
radius: z.number().optional()
|
|
3667
|
+
});
|
|
3668
|
+
const rotationSchema = z.union([
|
|
3669
|
+
z.literal(0),
|
|
3670
|
+
z.literal(90),
|
|
3671
|
+
z.literal(180),
|
|
3672
|
+
z.literal(270)
|
|
3673
|
+
]);
|
|
3674
|
+
const rectSchema = z.tuple([
|
|
3675
|
+
z.number(),
|
|
3676
|
+
z.number(),
|
|
3677
|
+
z.number(),
|
|
3678
|
+
z.number()
|
|
3679
|
+
]);
|
|
3680
|
+
const aspectCropSchema = z.object({
|
|
3681
|
+
aspect: z.preprocess((value) => value == null ? void 0 : value, z.string().optional()),
|
|
3682
|
+
rect: z.preprocess((value) => value == null ? void 0 : value, rectSchema.optional()),
|
|
3683
|
+
hotspot: z.preprocess((value) => value == null ? void 0 : value, hotspotSchema.optional()),
|
|
3684
|
+
rotation: z.preprocess((value) => value == null ? void 0 : value, rotationSchema.optional())
|
|
3685
|
+
});
|
|
3686
|
+
const transformSchema = z.object({
|
|
3687
|
+
aspectCrops: z.preprocess((value) => {
|
|
3688
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return;
|
|
3689
|
+
return value;
|
|
3690
|
+
}, z.record(z.string(), aspectCropSchema.catch({}))).optional(),
|
|
3691
|
+
rect: rectSchema.optional(),
|
|
3692
|
+
hotspot: hotspotSchema.optional(),
|
|
3693
|
+
rotation: rotationSchema.optional()
|
|
3694
|
+
});
|
|
3695
|
+
const mediaPosterSchema = z.discriminatedUnion("tag", [z.object({
|
|
3696
|
+
tag: z.literal("media"),
|
|
3697
|
+
identifier: mediaIdentifierSchema$1
|
|
3698
|
+
}).strict(), z.object({
|
|
3699
|
+
tag: z.literal("external-src"),
|
|
3700
|
+
src: z.string().url()
|
|
3701
|
+
}).strict()]);
|
|
3702
|
+
const mediaUsageShape = {
|
|
3703
|
+
purpose: z.string().optional(),
|
|
3704
|
+
placeholder: z.boolean().default(true).optional(),
|
|
3705
|
+
alt: z.string().optional(),
|
|
3706
|
+
filename: z.string().optional(),
|
|
3707
|
+
width: z.number().optional(),
|
|
3708
|
+
height: z.number().optional(),
|
|
3709
|
+
poster: mediaPosterSchema.optional(),
|
|
3710
|
+
transform: transformSchema.optional()
|
|
3711
|
+
};
|
|
3712
|
+
const environmentExclusions = {
|
|
3713
|
+
assetId: z.never().optional(),
|
|
3714
|
+
id: z.never().optional(),
|
|
3715
|
+
src: z.never().optional(),
|
|
3716
|
+
storageBucket: z.never().optional(),
|
|
3717
|
+
storagePath: z.never().optional(),
|
|
3718
|
+
mimeType: z.never().optional()
|
|
3719
|
+
};
|
|
3720
|
+
const mediaBaseSchema = z.object({
|
|
3721
|
+
...mediaUsageShape,
|
|
3722
|
+
...environmentExclusions,
|
|
3723
|
+
identifier: mediaIdentifierSchema$1
|
|
3724
|
+
}).strict();
|
|
3725
|
+
mediaBaseSchema.extend({ type: z.literal("image") });
|
|
3726
|
+
mediaBaseSchema.extend({ type: z.literal("video") });
|
|
3727
|
+
const mediaSchema = mediaBaseSchema.extend({ type: z.enum(mediaTypeDiscriminants) });
|
|
3728
|
+
const externalMediaSchema = z.object({
|
|
3729
|
+
...mediaUsageShape,
|
|
3730
|
+
...environmentExclusions,
|
|
3731
|
+
type: z.enum(mediaTypeDiscriminants),
|
|
3732
|
+
src: z.string().min(1),
|
|
3733
|
+
identifier: z.never().optional()
|
|
3734
|
+
}).strict();
|
|
3735
|
+
const assetMediaSchema = z.object({
|
|
3736
|
+
...mediaUsageShape,
|
|
3737
|
+
...environmentExclusions,
|
|
3738
|
+
type: z.enum(mediaTypeDiscriminants),
|
|
3739
|
+
asset: renderableMediaAssetSchema,
|
|
3740
|
+
identifier: z.never().optional()
|
|
3741
|
+
}).strict();
|
|
3742
|
+
z.union([
|
|
3743
|
+
mediaSchema,
|
|
3744
|
+
externalMediaSchema,
|
|
3745
|
+
assetMediaSchema
|
|
3746
|
+
]);
|
|
3747
|
+
new Set(mediaTypeDiscriminants);
|
|
3615
3748
|
const MEDIA_KINDS = [
|
|
3616
3749
|
"image",
|
|
3617
3750
|
"video",
|
|
@@ -4063,22 +4196,25 @@ function upsertById(assets, asset) {
|
|
|
4063
4196
|
return next;
|
|
4064
4197
|
}
|
|
4065
4198
|
function createRuntimeMediaAssetState(siteId, baseAssets) {
|
|
4199
|
+
const mediaAssetIndex = buildRenderableMediaAssetIndex(baseAssets);
|
|
4066
4200
|
return {
|
|
4067
4201
|
siteId,
|
|
4068
|
-
baseAssets:
|
|
4069
|
-
registeredAssets: []
|
|
4202
|
+
baseAssets: mediaAssetIndex?.assets ?? [],
|
|
4203
|
+
registeredAssets: [],
|
|
4204
|
+
mediaAssetIndex
|
|
4070
4205
|
};
|
|
4071
4206
|
}
|
|
4072
4207
|
function reduceRuntimeMediaAssetState(state, action) {
|
|
4073
4208
|
switch (action.type) {
|
|
4074
4209
|
case "siteSnapshotReplaced": {
|
|
4075
|
-
|
|
4076
|
-
|
|
4210
|
+
const { snapshot } = action;
|
|
4211
|
+
if (snapshot.siteId !== state.siteId) return snapshot;
|
|
4212
|
+
const nextBaseAssets = snapshot.baseAssets;
|
|
4077
4213
|
if (areEqualAssetLists(nextBaseAssets, state.baseAssets)) return state;
|
|
4078
4214
|
return {
|
|
4079
|
-
|
|
4215
|
+
...state,
|
|
4080
4216
|
baseAssets: nextBaseAssets,
|
|
4081
|
-
|
|
4217
|
+
mediaAssetIndex: state.registeredAssets.length ? indexRenderableMediaAssets(dedupeById([...nextBaseAssets, ...state.registeredAssets])) : snapshot.mediaAssetIndex
|
|
4082
4218
|
};
|
|
4083
4219
|
}
|
|
4084
4220
|
case "assetRegistered":
|
|
@@ -4087,31 +4223,11 @@ function reduceRuntimeMediaAssetState(state, action) {
|
|
|
4087
4223
|
if (nextRegisteredAssets === state.registeredAssets) return state;
|
|
4088
4224
|
return {
|
|
4089
4225
|
...state,
|
|
4090
|
-
registeredAssets: nextRegisteredAssets
|
|
4226
|
+
registeredAssets: nextRegisteredAssets,
|
|
4227
|
+
mediaAssetIndex: indexRenderableMediaAssets(dedupeById([...state.baseAssets, ...nextRegisteredAssets]))
|
|
4091
4228
|
};
|
|
4092
4229
|
}
|
|
4093
4230
|
}
|
|
4094
|
-
/**
|
|
4095
|
-
* Returns a freshly deduped merge of base and runtime assets.
|
|
4096
|
-
* Callers should memoize the result if referential stability matters downstream.
|
|
4097
|
-
*/
|
|
4098
|
-
function selectRuntimeMediaAssets(state) {
|
|
4099
|
-
return dedupeById([...state.baseAssets, ...state.registeredAssets]);
|
|
4100
|
-
}
|
|
4101
|
-
function createRuntimeMediaAssetSnapshotKey(siteId, assets) {
|
|
4102
|
-
return JSON.stringify({
|
|
4103
|
-
siteId,
|
|
4104
|
-
assets: dedupeById(assets).map((asset) => ({
|
|
4105
|
-
id: asset.id,
|
|
4106
|
-
identifier: asset.identifier ?? null,
|
|
4107
|
-
storageBucket: asset.storageBucket ?? null,
|
|
4108
|
-
storagePath: asset.storagePath ?? null,
|
|
4109
|
-
width: asset.width ?? null,
|
|
4110
|
-
height: asset.height ?? null,
|
|
4111
|
-
mimeType: asset.mimeType ?? null
|
|
4112
|
-
}))
|
|
4113
|
-
});
|
|
4114
|
-
}
|
|
4115
4231
|
//#endregion
|
|
4116
4232
|
//#region ../media-editor/src/provider.tsx
|
|
4117
4233
|
const DEFAULT_MEDIA_BUCKET = process.env.NEXT_PUBLIC_MEDIA_BUCKET ?? "media";
|
|
@@ -4128,15 +4244,14 @@ function toRuntimeMediaAssetIndexItem(asset) {
|
|
|
4128
4244
|
};
|
|
4129
4245
|
}
|
|
4130
4246
|
function MediaEditorProvider({ siteId, apiClient, children, bucket = DEFAULT_MEDIA_BUCKET, getPublicUrl, augmentRequest, uploaderOptions, bearerToken, supabaseUrl, mediaAssets }) {
|
|
4131
|
-
const
|
|
4132
|
-
const [runtimeMediaAssetState, dispatchRuntimeMediaAssetAction] = useReducer(reduceRuntimeMediaAssetState,
|
|
4247
|
+
const snapshot = useMemo(() => createRuntimeMediaAssetState(siteId, mediaAssets ?? []), [mediaAssets, siteId]);
|
|
4248
|
+
const [runtimeMediaAssetState, dispatchRuntimeMediaAssetAction] = useReducer(reduceRuntimeMediaAssetState, snapshot);
|
|
4133
4249
|
useEffect(() => {
|
|
4134
4250
|
dispatchRuntimeMediaAssetAction({
|
|
4135
4251
|
type: "siteSnapshotReplaced",
|
|
4136
|
-
|
|
4137
|
-
baseAssets: mediaAssets ?? []
|
|
4252
|
+
snapshot
|
|
4138
4253
|
});
|
|
4139
|
-
}, [
|
|
4254
|
+
}, [snapshot]);
|
|
4140
4255
|
const repo = useMemo(() => {
|
|
4141
4256
|
const clientFn = (request) => {
|
|
4142
4257
|
return apiClient(augmentRequest ? augmentRequest(request, { siteId }) : request);
|
|
@@ -4155,11 +4270,12 @@ function MediaEditorProvider({ siteId, apiClient, children, bucket = DEFAULT_MED
|
|
|
4155
4270
|
const imageResolveContext = useMemo(() => buildResolveImageUrlContext({
|
|
4156
4271
|
siteId,
|
|
4157
4272
|
supabaseUrl: supabaseUrl ?? (DEFAULT_SUPABASE_URL || void 0),
|
|
4158
|
-
|
|
4273
|
+
mediaAssetIndex: runtimeMediaAssetState.siteId === siteId ? runtimeMediaAssetState.mediaAssetIndex : snapshot.mediaAssetIndex
|
|
4159
4274
|
}), [
|
|
4160
4275
|
runtimeMediaAssetState,
|
|
4161
4276
|
siteId,
|
|
4162
|
-
supabaseUrl
|
|
4277
|
+
supabaseUrl,
|
|
4278
|
+
snapshot
|
|
4163
4279
|
]);
|
|
4164
4280
|
const resolvedSupabaseUrl = imageResolveContext.supabaseUrl;
|
|
4165
4281
|
const registerMediaAsset = useCallback((asset) => {
|
|
@@ -4167,7 +4283,7 @@ function MediaEditorProvider({ siteId, apiClient, children, bucket = DEFAULT_MED
|
|
|
4167
4283
|
dispatchRuntimeMediaAssetAction({
|
|
4168
4284
|
type: "assetRegistered",
|
|
4169
4285
|
siteId,
|
|
4170
|
-
asset: toRuntimeMediaAssetIndexItem(asset)
|
|
4286
|
+
asset: renderableMediaAssetSchema$1.parse(toRuntimeMediaAssetIndexItem(asset))
|
|
4171
4287
|
});
|
|
4172
4288
|
}, [siteId]);
|
|
4173
4289
|
const computePublicUrl = useCallback((asset) => {
|
|
@@ -8485,10 +8601,10 @@ function resolveShellThemeRoles(props) {
|
|
|
8485
8601
|
}
|
|
8486
8602
|
const previewContainerResponsiveEnabled = process.env.NEXT_PUBLIC_ENABLE_PREVIEW_CONTAINER_RESPONSIVE !== "false";
|
|
8487
8603
|
const PreviewEditorSidebar = React.lazy(async () => {
|
|
8488
|
-
return { default: (await import("./PreviewEditorSidebar-
|
|
8604
|
+
return { default: (await import("./PreviewEditorSidebar-jI_4DTZY.mjs")).PreviewEditorSidebar };
|
|
8489
8605
|
});
|
|
8490
8606
|
const PreviewEditorUI = React.lazy(async () => {
|
|
8491
|
-
return { default: (await import("./PreviewEditorUI-
|
|
8607
|
+
return { default: (await import("./PreviewEditorUI-ORkVZhfu.mjs")).PreviewEditorUI };
|
|
8492
8608
|
});
|
|
8493
8609
|
const previewPaneContainmentStyle = {
|
|
8494
8610
|
contain: "layout paint",
|
|
@@ -9772,48 +9888,40 @@ function isRecord(value) {
|
|
|
9772
9888
|
}
|
|
9773
9889
|
//#endregion
|
|
9774
9890
|
//#region ../preview-next/src/client/blocks/previewCustomizeSelectedMedia.ts
|
|
9775
|
-
function selectedImageFromMediaValue(value) {
|
|
9776
|
-
if (value?.type !== "image"
|
|
9777
|
-
const
|
|
9778
|
-
|
|
9779
|
-
|
|
9780
|
-
|
|
9781
|
-
|
|
9782
|
-
|
|
9783
|
-
|
|
9784
|
-
|
|
9785
|
-
|
|
9786
|
-
|
|
9787
|
-
|
|
9788
|
-
|
|
9891
|
+
function selectedImageFromMediaValue(value, index) {
|
|
9892
|
+
if (value?.type !== "image") return null;
|
|
9893
|
+
const resolved = resolveManagedMediaReference(value, index);
|
|
9894
|
+
return resolved.kind === "resolved" ? {
|
|
9895
|
+
reference: value,
|
|
9896
|
+
imageAsset: resolved.asset
|
|
9897
|
+
} : null;
|
|
9898
|
+
}
|
|
9899
|
+
function selectedImageFromRenderableAsset(source) {
|
|
9900
|
+
const asset = renderableMediaAssetSchema$1.parse({
|
|
9901
|
+
...source,
|
|
9902
|
+
width: source.width ?? null,
|
|
9903
|
+
height: source.height ?? null
|
|
9904
|
+
});
|
|
9789
9905
|
return {
|
|
9790
|
-
|
|
9791
|
-
|
|
9906
|
+
reference: {
|
|
9907
|
+
type: "image",
|
|
9908
|
+
identifier: mediaIdentifierSchema$2.parse(asset.identifier)
|
|
9909
|
+
},
|
|
9910
|
+
imageAsset: asset
|
|
9792
9911
|
};
|
|
9793
9912
|
}
|
|
9794
9913
|
function imagePoolWithSelectedImage(input) {
|
|
9795
|
-
|
|
9796
|
-
|
|
9914
|
+
const selection = input.selectedImage;
|
|
9915
|
+
if (input.override.kind !== "image" || selection?.reference.identifier !== input.override.reference.identifier) return input.imagePool;
|
|
9797
9916
|
return [{
|
|
9798
|
-
|
|
9917
|
+
reference: input.override.reference,
|
|
9799
9918
|
source: "general-media",
|
|
9800
|
-
mediaAsset:
|
|
9801
|
-
}, ...input.imagePool.filter((item) => item.
|
|
9919
|
+
mediaAsset: selection.imageAsset
|
|
9920
|
+
}, ...input.imagePool.filter((item) => item.reference.identifier !== selection.reference.identifier)];
|
|
9802
9921
|
}
|
|
9803
|
-
function
|
|
9804
|
-
if (input.selectedImage?.
|
|
9805
|
-
return input.imagePool?.find((item) => item.
|
|
9806
|
-
}
|
|
9807
|
-
function renderableImageAssetFromSource(asset) {
|
|
9808
|
-
return {
|
|
9809
|
-
id: asset.id,
|
|
9810
|
-
...typeof asset.identifier === "string" ? { identifier: asset.identifier } : {},
|
|
9811
|
-
...typeof asset.storageBucket === "string" ? { storageBucket: asset.storageBucket } : {},
|
|
9812
|
-
...typeof asset.storagePath === "string" ? { storagePath: asset.storagePath } : {},
|
|
9813
|
-
...typeof asset.width === "number" ? { width: asset.width } : {},
|
|
9814
|
-
...typeof asset.height === "number" ? { height: asset.height } : {},
|
|
9815
|
-
...typeof asset.mimeType === "string" ? { mimeType: asset.mimeType } : {}
|
|
9816
|
-
};
|
|
9922
|
+
function selectedOrPooledImageAssetForReference(input) {
|
|
9923
|
+
if (input.selectedImage?.reference.identifier === input.reference.identifier) return input.selectedImage.imageAsset;
|
|
9924
|
+
return input.imagePool?.find((item) => item.reference.identifier === input.reference.identifier)?.mediaAsset;
|
|
9817
9925
|
}
|
|
9818
9926
|
//#endregion
|
|
9819
9927
|
//#region ../preview-next/src/client/blocks/previewCustomizeActions.ts
|
|
@@ -9873,9 +9981,9 @@ function setPageDesignBlockBackground(input) {
|
|
|
9873
9981
|
imagePool
|
|
9874
9982
|
}), input.override);
|
|
9875
9983
|
if (plan.kind !== "apply") return null;
|
|
9876
|
-
const imageAsset = plan.override.kind === "image" ?
|
|
9984
|
+
const imageAsset = plan.override.kind === "image" ? selectedOrPooledImageAssetForReference({
|
|
9877
9985
|
imagePool: input.imagePool,
|
|
9878
|
-
|
|
9986
|
+
reference: plan.override.reference,
|
|
9879
9987
|
selectedImage: input.selectedImage
|
|
9880
9988
|
}) : void 0;
|
|
9881
9989
|
return {
|
|
@@ -10411,7 +10519,7 @@ function useMediaQuery(query) {
|
|
|
10411
10519
|
}
|
|
10412
10520
|
//#endregion
|
|
10413
10521
|
//#region ../preview-next/src/client/blocks/BlockBackgroundChooser.tsx
|
|
10414
|
-
function BackgroundChooser({ capability, current, imagePoolStatus, onChoose }) {
|
|
10522
|
+
function BackgroundChooser({ editingSlot, capability, current, imagePoolStatus, onChoose }) {
|
|
10415
10523
|
const chooseFromClick = (override) => (event) => {
|
|
10416
10524
|
event.preventDefault();
|
|
10417
10525
|
event.stopPropagation();
|
|
@@ -10431,6 +10539,7 @@ function BackgroundChooser({ capability, current, imagePoolStatus, onChoose }) {
|
|
|
10431
10539
|
chooseFromClick
|
|
10432
10540
|
}) : null,
|
|
10433
10541
|
current.kind === "image" ? /* @__PURE__ */ jsx(BackgroundImageOptions, {
|
|
10542
|
+
editingSlot,
|
|
10434
10543
|
capability,
|
|
10435
10544
|
current,
|
|
10436
10545
|
imagePoolStatus,
|
|
@@ -10546,7 +10655,7 @@ function SelectedGradient({ gradientId, onReset }) {
|
|
|
10546
10655
|
}) : null]
|
|
10547
10656
|
});
|
|
10548
10657
|
}
|
|
10549
|
-
function BackgroundImageOptions({ capability, current, imagePoolStatus, onChoose, chooseFromClick }) {
|
|
10658
|
+
function BackgroundImageOptions({ editingSlot, capability, current, imagePoolStatus, onChoose, chooseFromClick }) {
|
|
10550
10659
|
const mediaEditorContext = useMediaEditorOptional();
|
|
10551
10660
|
const [mediaPickerOpenKey, setMediaPickerOpenKey] = useState(0);
|
|
10552
10661
|
if (!capability.modes.includes("image")) return null;
|
|
@@ -10561,18 +10670,19 @@ function BackgroundImageOptions({ capability, current, imagePoolStatus, onChoose
|
|
|
10561
10670
|
className: "space-y-1",
|
|
10562
10671
|
children: images.map((item) => /* @__PURE__ */ jsx(ImagePoolButton, {
|
|
10563
10672
|
item,
|
|
10564
|
-
selected: current.
|
|
10673
|
+
selected: current.reference.identifier === item.reference.identifier,
|
|
10565
10674
|
thumbnailUrl: backgroundImagePreviewUrl(item, mediaEditorContext),
|
|
10566
10675
|
onClick: chooseFromClick({
|
|
10567
10676
|
kind: "image",
|
|
10568
|
-
|
|
10677
|
+
reference: item.reference
|
|
10569
10678
|
})
|
|
10570
|
-
}, `${item.source}:${item.
|
|
10679
|
+
}, `${item.source}:${item.reference.identifier}`))
|
|
10571
10680
|
}) : /* @__PURE__ */ jsx("p", {
|
|
10572
10681
|
className: "text-xs text-muted-foreground",
|
|
10573
10682
|
children: imagePoolStatus === "loading" ? "Loading images..." : "No background-ready images yet."
|
|
10574
10683
|
}),
|
|
10575
10684
|
mediaPickerOpenKey > 0 && mediaEditorContext ? /* @__PURE__ */ jsx(BackgroundMediaPicker, {
|
|
10685
|
+
editingSlot,
|
|
10576
10686
|
openKey: mediaPickerOpenKey,
|
|
10577
10687
|
onChoose,
|
|
10578
10688
|
onDone: () => setMediaPickerOpenKey(0)
|
|
@@ -10618,19 +10728,21 @@ function ImagePoolButton({ item, selected, thumbnailUrl, onClick }) {
|
|
|
10618
10728
|
})
|
|
10619
10729
|
});
|
|
10620
10730
|
}
|
|
10621
|
-
function BackgroundMediaPicker({ openKey, onChoose, onDone }) {
|
|
10731
|
+
function BackgroundMediaPicker({ editingSlot, openKey, onChoose, onDone }) {
|
|
10732
|
+
const mediaEditorContext = useMediaEditorOptional();
|
|
10622
10733
|
const chooseMediaValue = (value) => {
|
|
10623
|
-
const selectedImage = selectedImageFromMediaValue(value);
|
|
10734
|
+
const selectedImage = selectedImageFromMediaValue(value, mediaEditorContext?.imageResolveContext.mediaAssetIndex);
|
|
10624
10735
|
if (!selectedImage) return;
|
|
10625
10736
|
onChoose({
|
|
10626
10737
|
kind: "image",
|
|
10627
|
-
|
|
10738
|
+
reference: selectedImage.reference
|
|
10628
10739
|
}, { selectedImage });
|
|
10629
10740
|
onDone();
|
|
10630
10741
|
};
|
|
10631
10742
|
return /* @__PURE__ */ jsx("div", {
|
|
10632
10743
|
onClick: (event) => event.stopPropagation(),
|
|
10633
10744
|
children: /* @__PURE__ */ jsx(MediaEditor, {
|
|
10745
|
+
editingSlot,
|
|
10634
10746
|
value: void 0,
|
|
10635
10747
|
onChange: chooseMediaValue,
|
|
10636
10748
|
allowedKinds: ["image"],
|
|
@@ -10644,10 +10756,11 @@ function BackgroundMediaPicker({ openKey, onChoose, onDone }) {
|
|
|
10644
10756
|
},
|
|
10645
10757
|
onUploadComplete: (asset) => {
|
|
10646
10758
|
if (backgroundMediaPickerAssetSelection(asset).tag === "disabled") return;
|
|
10759
|
+
const selectedImage = selectedImageFromRenderableAsset(asset);
|
|
10647
10760
|
onChoose({
|
|
10648
10761
|
kind: "image",
|
|
10649
|
-
|
|
10650
|
-
}, { selectedImage
|
|
10762
|
+
reference: selectedImage.reference
|
|
10763
|
+
}, { selectedImage });
|
|
10651
10764
|
onDone();
|
|
10652
10765
|
}
|
|
10653
10766
|
}, openKey)
|
|
@@ -10673,7 +10786,7 @@ function BackgroundPreviewSwatch({ override, imagePool }) {
|
|
|
10673
10786
|
style: { backgroundImage: gradientPreviewCss(override.gradientId) }
|
|
10674
10787
|
});
|
|
10675
10788
|
case "image":
|
|
10676
|
-
const imageItem = imagePool.find((item) => item.
|
|
10789
|
+
const imageItem = imagePool.find((item) => item.reference.identifier === override.reference.identifier);
|
|
10677
10790
|
const thumbnailUrl = imageItem ? backgroundImagePreviewUrl(imageItem, mediaEditorContext) : void 0;
|
|
10678
10791
|
return /* @__PURE__ */ jsx("span", {
|
|
10679
10792
|
className: `${baseClassName} bg-muted`,
|
|
@@ -10690,13 +10803,7 @@ function backgroundImagePreviewUrl(item, mediaEditorContext) {
|
|
|
10690
10803
|
if (!asset) return void 0;
|
|
10691
10804
|
return resolveImageUrlWithContext({
|
|
10692
10805
|
type: "image",
|
|
10693
|
-
|
|
10694
|
-
...asset.identifier ? { identifier: asset.identifier } : {},
|
|
10695
|
-
storageBucket: asset.storageBucket,
|
|
10696
|
-
storagePath: asset.storagePath,
|
|
10697
|
-
...asset.width != null ? { width: asset.width } : {},
|
|
10698
|
-
...asset.height != null ? { height: asset.height } : {},
|
|
10699
|
-
mimeType: asset.mimeType
|
|
10806
|
+
asset
|
|
10700
10807
|
}, {
|
|
10701
10808
|
width: 72,
|
|
10702
10809
|
height: 48,
|
|
@@ -10790,7 +10897,7 @@ function BlockToolbar({ blockId, blockKind, content, bookingOfferingPresets, the
|
|
|
10790
10897
|
const backgroundCycleImagePool = useMemo(() => {
|
|
10791
10898
|
if (currentBackground.kind === "supported" && currentBackground.override.kind === "image") {
|
|
10792
10899
|
const currentOverride = currentBackground.override;
|
|
10793
|
-
if (!backgroundImagePool.some((item) => item.
|
|
10900
|
+
if (!backgroundImagePool.some((item) => item.reference.identifier === currentOverride.reference.identifier)) return rankBackgroundImagePoolItems(dedupeBackgroundImagePool([...imagePoolForOverride(currentOverride), ...backgroundImagePool]));
|
|
10794
10901
|
}
|
|
10795
10902
|
return rankBackgroundImagePoolItems(backgroundImagePool);
|
|
10796
10903
|
}, [backgroundImagePool, currentBackground]);
|
|
@@ -10998,6 +11105,7 @@ function BlockToolbar({ blockId, blockKind, content, bookingOfferingPresets, the
|
|
|
10998
11105
|
enabledBackgroundModeList,
|
|
10999
11106
|
handleBackgroundCycle,
|
|
11000
11107
|
imagePoolStatus: backgroundImagePoolStatus,
|
|
11108
|
+
editingSlot: `${blockId}:_sectionStyles.background.image`,
|
|
11001
11109
|
mergedBackgroundImagePool,
|
|
11002
11110
|
onChooseBackgroundOverride: chooseBackgroundOverride,
|
|
11003
11111
|
onToggleBackgroundChooser: () => setBackgroundChooserOpen((open) => !open)
|
|
@@ -11207,6 +11315,7 @@ function renderBlockCustomizeBuiltinRow(row, context) {
|
|
|
11207
11315
|
context.onToggleBackgroundChooser();
|
|
11208
11316
|
},
|
|
11209
11317
|
chooser: /* @__PURE__ */ jsx(BackgroundChooser, {
|
|
11318
|
+
editingSlot: context.editingSlot,
|
|
11210
11319
|
capability: context.backgroundCapability,
|
|
11211
11320
|
current: context.currentBackground.override,
|
|
11212
11321
|
imagePoolStatus: context.imagePoolStatus,
|
|
@@ -11300,7 +11409,7 @@ function backgroundOverrideValueLabel(override, imagePool) {
|
|
|
11300
11409
|
case "default": return "No colour chosen";
|
|
11301
11410
|
case "color": return formatTokenLabel(override.token);
|
|
11302
11411
|
case "gradient": return gradientLabel(override.gradientId);
|
|
11303
|
-
case "image": return imagePool.find((item) => item.
|
|
11412
|
+
case "image": return imagePool.find((item) => item.reference.identifier === override.reference.identifier)?.label ?? "Image";
|
|
11304
11413
|
}
|
|
11305
11414
|
}
|
|
11306
11415
|
function backgroundModeLabel(mode) {
|
|
@@ -11322,24 +11431,21 @@ function readBackgroundColorPaletteSnapshot() {
|
|
|
11322
11431
|
return entries.length > 0 ? Object.fromEntries(entries) : null;
|
|
11323
11432
|
}
|
|
11324
11433
|
function dedupeBackgroundImagePool(items) {
|
|
11325
|
-
|
|
11326
|
-
|
|
11327
|
-
|
|
11328
|
-
|
|
11329
|
-
|
|
11330
|
-
|
|
11331
|
-
|
|
11332
|
-
|
|
11333
|
-
|
|
11334
|
-
|
|
11335
|
-
|
|
11336
|
-
|
|
11337
|
-
|
|
11338
|
-
|
|
11339
|
-
|
|
11340
|
-
deduped.push(item);
|
|
11341
|
-
}
|
|
11342
|
-
return deduped;
|
|
11434
|
+
return Array.from(items.reduce((pool, item) => {
|
|
11435
|
+
const key = item.reference.identifier;
|
|
11436
|
+
const existing = pool.get(key);
|
|
11437
|
+
const decided = existing ? existing.source === "current" ? {
|
|
11438
|
+
...existing,
|
|
11439
|
+
mediaAsset: existing.mediaAsset ?? item.mediaAsset,
|
|
11440
|
+
label: existing.label ?? item.label,
|
|
11441
|
+
rank: existing.rank ?? item.rank
|
|
11442
|
+
} : {
|
|
11443
|
+
...existing,
|
|
11444
|
+
label: existing.label ?? item.label,
|
|
11445
|
+
rank: existing.rank ?? item.rank
|
|
11446
|
+
} : item;
|
|
11447
|
+
return new Map([...pool, [key, decided]]);
|
|
11448
|
+
}, /* @__PURE__ */ new Map()).values());
|
|
11343
11449
|
}
|
|
11344
11450
|
//#endregion
|
|
11345
11451
|
//#region ../preview-next/src/client/blocks/BoundaryControl.tsx
|