@riverbankcms/sdk 0.171.0 → 0.171.1
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/dist/_dts/{BlocksIslandsHydrator-xuFmD41p.d.ts → BlocksIslandsHydrator-D-6cWDDC.d.ts} +1 -1
- package/dist/_dts/{Page-4fzXy8H9.d.ts → Page-4jkUDm4D.d.ts} +7 -7
- package/dist/_dts/{SdkPreviewMode-BlHgMsc8.d.ts → SdkPreviewMode-DEvzvovi.d.ts} +2 -2
- package/dist/_dts/{client-BPoU758C.d.ts → client-CXPH5esD.d.ts} +1 -1
- package/dist/_dts/{content-types-TnkhoSls.d.ts → content-types-DsCr4-ny.d.ts} +2 -2
- package/dist/_dts/{contracts-7wrMA79U.d.ts → contracts-BlmXM7xP.d.ts} +3 -3
- package/dist/_dts/{footerPageOutline-DaOsPQ_Q.d.ts → footerPageOutline-BA0DnxWU.d.ts} +6 -6
- package/dist/_dts/{generatePageMetadata-D9aDEzKK.d.ts → generatePageMetadata-B7IRJCFG.d.ts} +2 -2
- package/dist/_dts/{index-CZKSUcDs.d.ts → index-B3gfKNI-.d.ts} +4 -4
- package/dist/_dts/{index-DDKJfaLY.d.ts → index-BQPJbOkU.d.ts} +2 -2
- package/dist/_dts/{index-W9R3Bnf2.d.ts → index-BZ8-c4iQ.d.ts} +3 -3
- package/dist/_dts/{index-Cbw0IiY7.d.ts → index-C9_OTCFQ.d.ts} +2 -2
- package/dist/_dts/{index-585vn6qb.d.ts → index-DScYSl03.d.ts} +1 -1
- package/dist/_dts/{index-DNCDENic.d.ts → index-DlABXDte.d.ts} +1 -1
- package/dist/_dts/{index-ChNbrcgD.d.ts → index-Sua-7CF1.d.ts} +1 -1
- package/dist/_dts/{loadContent-DPyNAJym.d.ts → loadContent-Dx4fW3Pa.d.ts} +7 -7
- package/dist/_dts/{request-jXTRN1Y4.d.ts → request-DUTkELQn.d.ts} +74581 -74248
- package/dist/_dts/{resolveBlockData-BbvE-gsZ.d.ts → resolveBlockData-Cze35i_N.d.ts} +5 -5
- package/dist/_dts/{resolvePageContent-BBgih00D.d.ts → resolvePageContent-zf6-E-C3.d.ts} +2 -2
- package/dist/_dts/sdk/src/bookings/index.d.ts +2 -2
- package/dist/_dts/sdk/src/client/types.d.ts +2 -2
- package/dist/_dts/sdk/src/client.d.ts +7 -7
- package/dist/_dts/sdk/src/config/index.d.ts +6 -6
- package/dist/_dts/sdk/src/config/template-validation.d.ts +1 -1
- package/dist/_dts/sdk/src/config/validation.d.ts +1 -1
- package/dist/_dts/sdk/src/data/dataLoaderContext.d.ts +2 -2
- package/dist/_dts/sdk/src/data/resolveBlockData.d.ts +1 -1
- package/dist/_dts/sdk/src/data/types.d.ts +2 -2
- package/dist/_dts/sdk/src/index.d.ts +8 -8
- package/dist/_dts/sdk/src/manifest/index.d.ts +3 -3
- package/dist/_dts/sdk/src/metadata/index.d.ts +1 -1
- package/dist/_dts/sdk/src/navigation/index.d.ts +2 -2
- package/dist/_dts/sdk/src/next/index.d.ts +7 -7
- package/dist/_dts/sdk/src/next/middleware.d.ts +2 -2
- package/dist/_dts/sdk/src/page-converter/index.d.ts +3 -3
- package/dist/_dts/sdk/src/portal/client.d.ts +1 -1
- package/dist/_dts/sdk/src/prebuild/index.d.ts +1 -1
- package/dist/_dts/sdk/src/preview-next/before-render.d.ts +2 -2
- package/dist/_dts/sdk/src/preview-next/client/index.d.ts +2 -2
- package/dist/_dts/sdk/src/preview-next/client/runtime.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/client.d.ts +2 -2
- package/dist/_dts/sdk/src/rendering/components/pageShared.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/helpers/loadPage.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/helpers/pageRuntimeSupport.d.ts +4 -4
- package/dist/_dts/sdk/src/rendering/index.d.ts +6 -6
- package/dist/_dts/sdk/src/rendering/islands/client.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/server.d.ts +2 -2
- package/dist/_dts/sdk/src/rendering/themeAdmission.d.ts +1 -1
- package/dist/_dts/sdk/src/routing/index.d.ts +5 -5
- package/dist/_dts/sdk/src/server.d.ts +5 -5
- package/dist/_dts/sdk/src/spam-protection/index.d.ts +2 -2
- package/dist/_dts/sdk/src/theme/index.d.ts +1 -1
- package/dist/_dts/{types-kWvBwYK6.d.ts → types-BCzfYDW2.d.ts} +7 -7
- package/dist/_dts/{types-BXuVxDYo.d.ts → types-CPHk5Voq.d.ts} +2 -2
- package/dist/_dts/{types-DEAKoDNi.d.ts → types-JD-36x3P.d.ts} +3 -3
- package/dist/_dts/{validation-BAO0_ntM.d.ts → validation-0MyQlzWJ.d.ts} +4 -4
- package/dist/client/{BlocksIslandsHydrator-DfMsMIej.mjs → BlocksIslandsHydrator-vTHQyBQF.mjs} +17 -17
- package/dist/client/{BookingMailingListNote-aaSicywS.mjs → BookingMailingListNote-Blge9FJo.mjs} +2 -2
- package/dist/client/{BookingPanelArrangement-OgftZ9QC.mjs → BookingPanelArrangement-wm6eeuin.mjs} +1 -1
- package/dist/client/{CalendarNavigationChevron-iMWrY6Hz.mjs → CalendarNavigationChevron-DRH9qFny.mjs} +4 -4
- package/dist/client/{DemoBookingPortalAccess-BCumOTLY.mjs → DemoBookingPortalAccess-DPGZArG9.mjs} +1 -1
- package/dist/client/{EventCalendar.client-kh7mkYnW.mjs → EventCalendar.client-FGg6yCLH.mjs} +7 -7
- package/dist/client/{EventCombined.client-DXD5i0Ar.mjs → EventCombined.client-218_Gqgp.mjs} +4 -4
- package/dist/client/{EventItem-BnwcoFQN.mjs → EventItem-DKdZSW_R.mjs} +4 -4
- package/dist/client/{EventListWeekNavigation-DuG6z02f.mjs → EventListWeekNavigation-DZJ5qBhg.mjs} +1 -1
- package/dist/client/{EventListing.client-18yfHrcr.mjs → EventListing.client-CCdsrqHc.mjs} +3 -3
- package/dist/client/{EventListing.view-BM7rTVSL.mjs → EventListing.view-BVoHnVZA.mjs} +5 -5
- package/dist/client/{EventRegistrationPayment-D5J3DR0x.mjs → EventRegistrationPayment-BVxHCnxs.mjs} +4 -4
- package/dist/client/{Page-DH2sm4Cf.mjs → Page-CT4HaEMr.mjs} +19 -24
- package/dist/client/{StepIndicator-CsRlU46Y.mjs → StepIndicator-DRJy4eU3.mjs} +4 -4
- package/dist/client/{accessibleSurfaces-Bbn1-jJ8.mjs → accessibleSurfaces-BnyVRqdU.mjs} +21 -24
- package/dist/client/{accordion-DT4MD3Np.mjs → accordion-BOApxi9U.mjs} +1 -1
- package/dist/client/{booking-form.client-DdqNQNCa.mjs → booking-form.client-DDf8Lmo5.mjs} +6 -6
- package/dist/client/{bookingForm-CLN396HU.mjs → bookingForm-DWrgG-Xx.mjs} +3 -3
- package/dist/client/bookings.mjs +3 -3
- package/dist/client/{boxStyleClassNames-iLF_3KX9.mjs → boxStyleClassNames-7MVCNWgc.mjs} +1 -1
- package/dist/client/{carousel-DFLomCGm.mjs → carousel-DeI76SEP.mjs} +1 -1
- package/dist/client/{cart-BozMM5NK.mjs → cart-D_uxULCO.mjs} +3 -3
- package/dist/client/{cart.client-CqOOxPbW.mjs → cart.client-BxSMse88.mjs} +1 -1
- package/dist/client/{checkout-CTWF5nbB.mjs → checkout-DIbh4g5e.mjs} +3 -3
- package/dist/client/{checkout.client-CpqxN8e0.mjs → checkout.client-x4Lkw8-E.mjs} +1 -1
- package/dist/client/{checkoutUrls-Ccg6yfjq.mjs → checkoutUrls-DqN3L-kl.mjs} +1 -1
- package/dist/client/client.mjs +20 -6
- package/dist/client/{cta-pzQkBLgS.mjs → cta-CP9l112u.mjs} +1 -1
- package/dist/client/{display-Cl6mgSJa.mjs → display-ChgDe9Da.mjs} +1 -1
- package/dist/client/{enhanceHeaderSection-CJCl0HJC.mjs → enhanceHeaderSection-BEjg_h_6.mjs} +3 -3
- package/dist/client/{event-details.client-Pn9Kxh3I.mjs → event-details.client-COmbQ3mc.mjs} +1 -1
- package/dist/client/{event-registration.client-BAmBdWXE.mjs → event-registration.client-BvQG3qEY.mjs} +7 -7
- package/dist/client/{eventCalendar-C5Bh2L8L.mjs → eventCalendar-DiitbUpV.mjs} +3 -3
- package/dist/client/{eventCombined-dELKxxIe.mjs → eventCombined-Da9Z8KDq.mjs} +3 -3
- package/dist/client/{eventDetails-Do9D_fJ_.mjs → eventDetails-Cf-kg7d6.mjs} +2 -2
- package/dist/client/{eventListing-B2HTUWLq.mjs → eventListing-xwXgVp7a.mjs} +3 -3
- package/dist/client/{eventRegistration-ByOJnqGc.mjs → eventRegistration-hlFYlgTA.mjs} +3 -3
- package/dist/client/{form-DX70QG-J.mjs → form-ERv_X_oZ.mjs} +2 -2
- package/dist/client/{form.client-CJoqBrS6.mjs → form.client-Cz24FYNj.mjs} +2 -2
- package/dist/client/{form.parts-DTof9pL3.mjs → form.parts-DeaH4kIe.mjs} +1 -1
- package/dist/client/{headerSection-CJuPX_1K.mjs → headerSection-CJvt0ZP4.mjs} +2 -2
- package/dist/client/{newsletter-form.client-CqzNjOft.mjs → newsletter-form.client-WuGDEzdD.mjs} +3 -3
- package/dist/client/{newsletter-form.parts-DjJsFms2.mjs → newsletter-form.parts-DhnW6tdB.mjs} +1 -1
- package/dist/client/{newsletterForm-D1MHoPbh.mjs → newsletterForm-DxG7NV8U.mjs} +2 -2
- package/dist/client/{product-detail.client-DOQ7El1d.mjs → product-detail.client-DsSfbmdV.mjs} +1 -1
- package/dist/client/{product-list.client-CmxOZbzL.mjs → product-list.client-Byzow88i.mjs} +1 -1
- package/dist/client/{productDetail-BN3zv5sa.mjs → productDetail-iXkmQpxG.mjs} +3 -3
- package/dist/client/{productList-GN_Id4bF.mjs → productList-HoFGQXFl.mjs} +3 -3
- package/dist/client/{propsDecoder-BdmzM3D5.mjs → propsDecoder-CH2-LJME.mjs} +2 -2
- package/dist/client/{registry.server-BOyra8CA.mjs → registry.server-ed20Q7bV.mjs} +22 -21
- package/dist/client/rendering/client.mjs +21 -21
- package/dist/client/rendering/islands.mjs +1 -1
- package/dist/client/rendering.mjs +6 -6
- package/dist/client/{routeIslandApiConfig-DnaJ8PQc.mjs → routeIslandApiConfig-CBUO-xuz.mjs} +1 -1
- package/dist/client/{runtimeResponse-BN8PoIVp.mjs → runtimeResponse-3brbt2Jq.mjs} +1 -1
- package/dist/client/runtimeResponse-CTarP5K6.mjs +3 -0
- package/dist/client/{shop-LjBLDBqF.mjs → shop-DXyeSNgi.mjs} +3 -3
- package/dist/client/{shop-commerce-B8aZTdRJ.mjs → shop-commerce--klkHNzu.mjs} +7 -7
- package/dist/client/{shop-commerce-store-C1FtHYl7.mjs → shop-commerce-store-BdpIWdc4.mjs} +1 -1
- package/dist/client/{shop.client-D0qZ3KZp.mjs → shop.client-Sv7QVDmj.mjs} +7 -7
- package/dist/client/{shop.interactive-DAKyWK1B.mjs → shop.interactive-C0IjiWOs.mjs} +1 -1
- package/dist/client/{shopShared-CztcSe9i.mjs → shopShared-Jt4TzcAG.mjs} +1 -1
- package/dist/client/{timetableModel-D1jDTbms.mjs → timetableModel-BxbnEJCi.mjs} +5 -5
- package/dist/client/{useDiscountApply-CHGYDxdM.mjs → useDiscountApply-dToQs9oY.mjs} +1 -1
- package/dist/client/{useDiscountCodeUi-Dew9UAEy.mjs → useDiscountCodeUi-C_aa_H69.mjs} +1 -1
- package/dist/client/{useEventPagination-BpC7-ksE.mjs → useEventPagination--MFZBoJt.mjs} +4 -4
- package/dist/client/{view-ShYH3WXh.mjs → view-C_brMDU2.mjs} +2 -2
- package/dist/client/{view-BxeiAL3c.mjs → view-DhEwiTJG.mjs} +3 -3
- package/dist/preview-next/client/{LocationPickerEnvironment-lW2aLGWd.mjs → LocationPickerEnvironment-OwAxA2C0.mjs} +1 -1
- package/dist/preview-next/client/{MapLibreEditMap-C9InQJpd.mjs → MapLibreEditMap-CaUOTCSh.mjs} +2 -2
- package/dist/preview-next/client/{PageSectionToolbar-DsSqwrMS.mjs → PageSectionToolbar-Dfi8Y3AI.mjs} +308 -388
- package/dist/preview-next/client/{PreviewEditorSidebar-BEEWzXnU.mjs → PreviewEditorSidebar-DJlX4sXP.mjs} +668 -353
- package/dist/preview-next/client/{PreviewEditorUI-C86Out4V.mjs → PreviewEditorUI-FVAibBlC.mjs} +126 -137
- package/dist/preview-next/client/{PreviewShell-CBWYjBvQ.mjs → PreviewShell-9eAon7Z8.mjs} +8 -8
- package/dist/preview-next/client/{SdkPreviewModeRuntime-o-mVqWLx.mjs → SdkPreviewModeRuntime-Byf-KW1x.mjs} +13 -16
- package/dist/preview-next/client/{SiteChromeCustomizeButton-H_ciMNHA.mjs → SiteChromeCustomizeButton-eU-zMftO.mjs} +1357 -39
- package/dist/preview-next/client/{lucide-react-DygTyy7K.mjs → lucide-react-X0DjcFij.mjs} +1 -1
- package/dist/preview-next/client/{previewAssistantSlot-CuOcsG_N.mjs → previewAssistantSlot-3FZrzbK8.mjs} +1808 -2832
- package/dist/preview-next/client/{previewChromeRoot-DPeV7KaP.mjs → previewChromeRoot-C4gyNQXE.mjs} +1 -1
- package/dist/preview-next/client/runtime.mjs +3 -3
- package/dist/preview-next/client/{sdk-runtime-zTTFZ4MM.mjs → sdk-runtime-DtyRbz4E.mjs} +2 -2
- package/dist/preview-next/client/{useAutosaveStatus-DNA1Q4L1.mjs → useAutosaveStatus-OIMkhbkP.mjs} +2 -2
- package/dist/preview-next/client/{useOpenBlockForSetup-BdnMlHC6.mjs → useOpenBlockForSetup-BNG9P9sM.mjs} +109 -6
- package/dist/preview-next/editor-base.css +14 -4
- package/dist/preview-next/keepAlive.mjs +1 -1
- package/dist/preview-next/middleware.mjs +1 -1
- package/dist/preview-next/{route-contract-CtSgU8UZ.mjs → route-contract-BLY4ycq6.mjs} +16 -2
- package/dist/server/{Block.shared-ifgaBglp.mjs → Block.shared-BC3jPIP4.mjs} +4 -4
- package/dist/server/{ThemeScopeCore-DGDOH6OU.mjs → ThemeScopeCore-B7Ey6AWT.mjs} +4 -4
- package/dist/server/{accessibleSurfaces-BuPNCWAK.mjs → accessibleSurfaces-BxsHs-jf.mjs} +1 -1
- package/dist/server/{bindings-CiYpie1M.mjs → bindings-xQ9v3zrn.mjs} +4 -4
- package/dist/server/{client-ngWuFsmN.mjs → client-DCwLR0kQ.mjs} +18 -4
- package/dist/server/config-validation.mjs +1 -1
- package/dist/server/config.mjs +1 -1
- package/dist/server/data/resolveBlockData.mjs +1 -1
- package/dist/server/index.mjs +2 -2
- package/dist/server/{loadContent-DeLQeJAZ.mjs → loadContent-C4I3ltU_.mjs} +5 -5
- package/dist/server/{loadPage-D4J747FQ.mjs → loadPage-COvxWN0r.mjs} +2 -2
- package/dist/server/next.mjs +6 -6
- package/dist/server/{opaqueSurface-ukEz1BaM.mjs → opaqueSurface-QiUjZmEV.mjs} +2 -2
- package/dist/server/{overrideResolution-DSuVkpqm.mjs → overrideResolution-BqQg6Iws.mjs} +1 -1
- package/dist/server/page-converter.mjs +1 -1
- package/dist/server/{pageRenderPlan-DFv3h4Ib.mjs → pageRenderPlan-CVCGTj5S.mjs} +4 -4
- package/dist/server/{pageRuntimeSupport-yHaRNWMj.mjs → pageRuntimeSupport-C7Be9suN.mjs} +2 -2
- package/dist/server/{pageShared-CAZD0LcY.mjs → pageShared-H_bSBPLd.mjs} +10 -10
- package/dist/server/{parseThemeForPersistence-Dl7LIBJq.mjs → parseThemeForPersistence-Bk0o95m6.mjs} +2 -2
- package/dist/server/{prebuild-BKOCND3b.mjs → prebuild-HQNOeCs9.mjs} +1 -1
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/{prefetchBlockData-GIoExi8A.mjs → prefetchBlockData-CbRsnhta.mjs} +2 -2
- package/dist/server/{registry-BogXzcOD.mjs → registry-CaeRTf4E.mjs} +18 -22
- package/dist/server/rendering/components/pageShared.mjs +1 -1
- package/dist/server/rendering/helpers/loadPage.mjs +1 -1
- package/dist/server/rendering/helpers/pageRuntimeSupport.mjs +1 -1
- package/dist/server/rendering/server.mjs +3 -3
- package/dist/server/rendering.mjs +7 -7
- package/dist/server/{resolveBlockData-CT4YSBve.mjs → resolveBlockData-CUMjWbXQ.mjs} +1 -1
- package/dist/server/{resolveButtonColourStates-DVISOQD9.mjs → resolveButtonColourStates-euZnRMIu.mjs} +21 -24
- package/dist/server/{schema-C92Q8y0-.mjs → schema-CxBsE9Dv.mjs} +1 -1
- package/dist/server/server.mjs +3 -3
- package/dist/server/theme-bridge.mjs +2 -2
- package/dist/server/theme.mjs +2 -2
- package/dist/server/{validation-vSBCWU3w.mjs → validation-CvmhnkDr.mjs} +3 -3
- package/dist/server/{version-Cw5vFmUY.mjs → version-Clp2evCf.mjs} +1 -1
- package/package.json +1 -1
- package/dist/client/runtimeResponse-B1-cyLXt.mjs +0 -3
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { n as __exportAll } from "./rolldown-runtime-CE6sIgz8.mjs";
|
|
3
|
-
import { $
|
|
4
|
-
import {
|
|
5
|
-
import { $ as useMediaEditor, $t as
|
|
3
|
+
import { $d as inlineTextToPlainText, $m as Arrow$1, $t as useEditorUiStore, A as usePreviewRenderReadiness, Aa as resolveImageSourceSetWithContext, Ah as readLinkedEntryLease, Ai as EVENT_SELECTION_TYPE_OPTIONS, An as getFieldDefault, Ap as resolveRepeaterGridAcceptedSpans, At as deleteSlotBlock, Bd as getBlockIconSemanticId, Bh as buttonStyleSelectionParameterValue, Bn as imagePoolForOverride, Bt as getDashboardUrl, Bv as parseBookingLocalDate, Cm as DialogTrigger, Cn as deriveEditorValuePublicationState, Cp as planRepeaterGridSpanChange, Ct as getWidgetKey, Cv as editorBlockCollectionOwnerKey, Df as concretePaletteToTheme, Dn as createManifestFormAdapter, Dp as isRepeaterGridLayoutInvalid, Dt as createBlock, Dv as formatDate, Ea as computeMediaTransformStyle, Ef as concretePaletteFromTheme, Eh as useShallow, En as initialBlockDraftValues, Ep as flowRepeaterGridItems, Et as partitionFieldsByIntent, Ev as unsafeAsEditorBlockValues, Fh as resolveRepeaterGridColumnFieldId, Fi as writeEventSelectionChips, Fn as readSliderFieldUiConfig, Ft as reorderSlotBlocks, Gd as parseGeneratedIconSetId, Gf as getGradientPreset, Gg as paletteValueKey, Gh as buttonStyleSelectionKey, Gn as rankBackgroundImagePoolItems, Gv as parseUtcIsoDateTimeString, H_ as slugify$1, Hd as parseBlockIconValue, Hh as resolveButtonStyleSelection, Hn as parseBackgroundOverrideFromContent, Hv as resolveBookingBusinessTimeZone, I as selectedLookTile, Ia as resolveMediaSlotContract, Id as isRichTextDoc, If as getCuratedSiteStyle, Ih as resolveRepeaterGridRowFieldId, Im as usePortalContainer, It as withSlotCompositionHash, J as runHeldLifecycle, J_ as mailingListProviderName, Jd as coerceInlineTextWithFallback, Jl as parseFeatureCardGeneratedIconSizePx, Jt as routeLifecycleContext, K_ as assessMailingListTargeting, Kd as parseSiteIconStyleGuideVersionId, Kf as findCuratedPalette, Kl as createFeatureCardIconKey, Km as hideOthers, Kn as resolveBackgroundCapability, Kv as toUtcIsoDateTimeString, La as buildResolveImageUrlContext, Lh as resolveRepeaterGridSpanFieldId, Lm as ReactRemoveScroll, Ln as canCycleBackgroundOverrideValue, Lt as blocksKeys, Mi as chooseScheduleScope, Mn as normalizeFieldForCanonicalValidation, Mp as resolveRepeaterGridColumnsForBreakpoint, Mt as listEntryPageContentSlots, N as lookTilePosition, N_ as authoredValuesEqual, Nd as admitLayoutGridForPlan, Nf as defaultPolicyPageFlowPresetId, Ni as readEventSelectionChips, Nn as getGroupChildFields, Nr as getBlockDefinition, Nt as listPageSurfaceContentSlots, O as usePreviewJoinOutcome, Oh as isEdited, Om as DialogDescription, On as createManifestValidation, Op as normalizeRepeaterGridSpan, Ot as createSlotBlock, Ou as buildFormInteractiveIslandProps, Ov as formatDateTime, P as lookTilesFor, Pd as deriveFieldValidationPlan, Ph as isAcceptedRepeaterGridSpan, Pi as toggleEventType, Pn as readNumberFieldUiConfig, Pr as listBlockDescriptors, Pt as reorderBlocks, Q_ as mailingListTargetingChoiceIds, Ql as toFeatureCardIconSuggestionInputs, Qm as Anchor, Qt as planLeaseNotice, Rd as sanitizeHref, Rf as offeredSiteStyles, Rh as siteOptionSources, Rt as normalizeApiError, S as setPageDesignBlockBackground, Sm as DialogTitle$1, Sn as withoutServerVersions, Sp as buildRepeaterGridDropTargets, St as getFieldIntent, Sv as createEditorReorderBlocksCommand, T_ as asAppearancePresetId, Tf as getHeaderStyle, Th as cn, Tp as findFirstAvailableRepeaterGridPlacement, Tt as isNonEmptyValue, Tv as unsafeAsEditorBlockId, Uf as gradientToCss, Uh as updateButtonStyleHoverPreference, Uv as resolveBookingTimeZoneId, V as usePreviewAuth, V_ as generateUuidV4, Vd as getGeneratedBlockIconStyleState, Vh as findButtonStyleRecipe, Vr as buildNewsletterFormInteractiveIslandProps, W as useEntryController, Wd as parseGeneratedIconAssetId, Wf as GRADIENT_PRESETS, Wh as updateButtonStyleSelectionChoice, Wl as FEATURE_CARD_GENERATED_ICON_SIZE_PX, Wn as planBackgroundTransition, Wp as editorAdmissionIsOpen, Wt as ApiRequestError, X as useServerRefresh, Xm as Presence, Xt as resolvePageRouteSlug, Y_ as parseMailingListPlacementTargeting, Yf as findFooterLook, Yl as resolveFeatureCardGeneratedIconSizePx, Yp as OPERATION_ID_HEADER, Yt as deriveRouteMetadataPresentation, Z as useSessionJournal, Z_ as DEFAULT_MAILING_LIST_TARGETING, Zl as suggestSemanticIconForFeatureCard, Zm as Portal$1, Zt as resolveContentTitle, _h as Button$1, _m as DialogClose, _t as collectVisibleWhenWatchPaths, _v as pristineValueSync, a_ as isRotationDimensionSwap, ad as BLOCK_BUTTON_ROLE_OPTIONS, ah as FocusScope, an as unfinishedBlockCopy, ap as sectionTransitionFamilyForBoundaryOptionId, ar as siblingPath$2, av as knownSocialPlatforms, b_ as asRecord, bh as cva, bm as DialogFooter, bn as useStore, bp as planLayoutGridColumnEdit, bt as evaluateVisibleWhenPredicate, bv as createEditorInsertBlockCommand, c_ as parseAspectRatioValue, cf as parseFieldDefinition, cm as journalTargetKey, ct as LeaseNoticeButtons, cv as publishedContactDetails, d as cycleSiteChromeSelectionId, dh as useControllableState, dn as journalNoticeMessage, do as normalizeOfferingsPreviewGroupOrder, dt as JournalWriteRefused, dy as parseSiteId, eh as Content, en as useEditorUiStoreInstance, ev as parseBrevoListId, f_ as mediaSchema, fn as lifecycleOutcomeMessage, fp as appearancePresets, fy as unsafeAsSiteId, gf as sectionPhotoPresence, gm as Dialog, go as resolveOfferingsPreviewGroupOrderEntries, gt as derivePromotedFieldPlan, gv as knownRevision, hh as Primitive, hm as CalloutTitle, ht as publishContentEntry, hv as displayedValues, i as usePreviewSidebarNavigation, if as plainTextToInlineText, ih as useId$1, im as unwrapResponse, ip as sectionTransitionFamilies, ir as getAtPath, iv as knownSocialPlatformLabels, iy as assertNever$1, ja as resolveImageUrlWithContext, jh as canEditorWrite, ji as chooseAllEvents, jm as DialogTitle, jn as getRepeaterItemDefault, jp as resolveRepeaterGridBreakpointForWidth, jt as isSurfaceSlotBlockTarget, kh as canWriteLinkedEntry, ki as EVENT_SELECTION_SCOPE_OPTIONS, kn as manifestFieldSectionOptions, kp as planRepeaterGridStartNewRow, kt as deleteBlock, l_ as resolveMediaTransformForAspect, lh as useDirection, lm as journalTrustAt, lo as inferLegacyOfferingsPreviewGroupOrder, mh as composeEventHandlers, mm as CalloutDescription, mo as planOfferingPreviewCardSelection, mt as missingReceiptError, n as usePreviewAssistantSlot, nh as createPopperScope, nn as useSidebarView, nv as parseMailchimpInterestId, o as usePreviewPageDesignEditorState, od as isBlockButtonRole, oh as useFocusGuards, om as sidebarReturnView, op as sectionTransitionVariantForBoundaryOptionId, or as withValueAtPath, ov as parsePublicProfile, p_ as runtimeMediaSchema, pf as resolveVisiblePromotedFieldPathsForEditorBlock, ph as createContextScope, pm as Callout, pt as sendPageCommand, py as expectParsedBrandedId, q as DONE, q_ as resolveMailingListDefaultDestination, ql as getFeatureCardIconCompletion, qp as editorAdmissionSession, rh as useSize, rm as extractApiEnvelopeErrorDetails, rn as recoveryConflictCopy, rp as defaultSectionTransitionVariantForFamily, rv as parseNewsletterListId, s as usePreviewPageDesignRenderState, sh as DismissableLayer, sm as journalLabels, st as LeaseDiscardedNoticeView, sv as publicProfileWeekdays, sy as parseMediaAssetId, th as Root2$1, tv as parseMailchimpAudienceId, u as useSiteChromeCustomizeOptional, u_ as getDirectImageUrlForMediaAsset, uh as createCollection, un as selectJournalWriteState, uo as isOfferingsPreviewSourceKey, v as buildPageDesignEditorReadModelForBlocks, v_ as PUBLIC_FILE_FIELD_KINDS, vh as buttonVariants, vm as DialogContent, vt as evaluateVisibility, vv as syncStateOf, wf as getHeaderLayout, wh as useComposedRefs, wp as projectRepeaterGridLayout, wt as hasVisibilityConditions, wv as editorBlockCollectionOwnersEqual, x as pageDesignLookTiles, x_ as getFontWidthRange, xh as createSlot, xm as DialogHeader, xn as toEditorBlockItem, xt as getVisibleWhenPredicates, xv as createEditorRemoveBlockCommand, y_ as mediaIdentifierSchema, ym as DialogDescription$1, yp as isInternalResolvedLinkValue, yt as evaluateVisibleWhen, yv as valueStatus, zf as palettesForSiteStyle, zh as buttonStyleHoverPreferenceValue, zn as enabledBackgroundModes, zp as resolveBlockTitle } from "./previewAssistantSlot-3FZrzbK8.mjs";
|
|
4
|
+
import { A as LoaderCircle, B as ImageOff, E as Maximize2, G as FileText, Gt as ok, L as Image, O as Lock, P as Link2, Q as EllipsisVertical, R as ImageUp, S as Palette, U as GripVertical, Wt as err, Z as EyeOff, b as PanelTop, bt as ArrowDown, c as Trash2, ct as CircleAlert, d as SlidersHorizontal, dt as ChevronLeft, et as Crop, f as Settings, ft as ChevronDown, g as RotateCcw, gt as Box$1, i as Video, m as Rows3, mt as Calendar$1, n as X$1, nt as Clock, pt as Check, rt as Clock3, s as TriangleAlert, t as lucide_react_exports, tt as Copy, u as Sparkles, ut as ChevronRight, v as Plus, vt as ArrowUp, x as PanelBottom, y as Pencil, yt as ArrowUpRight, z as ImagePlus } from "./lucide-react-X0DjcFij.mjs";
|
|
5
|
+
import { $ as useMediaEditor, $t as SelectItem, An as upsertFooterEngagementSection, B as buildFooterRuntimeViewModel, C as isHeaderMenuSurfaceState, Cn as deriveFooterEditorOverview, Dn as removeFooterEngagementSection, F as siteColourCss, G as getFooterComposition, Gt as DEFAULT_THEME_RESPONSIVE_MODE, Ht as buildThemeRuntime, I as locationWidgetOverrides, J as updateFooterComposition, Jt as ChoiceTileGroup, K as getFooterEngagementAuthoringOptions, Mn as footerArrangementPolicy, Nn as planFooterArrangement, On as resolveFooterSections, Qt as SelectContent, R as useSiteEditorAdmission, S as HeaderMenuControls, Sn as classifyKnownMimeType, Tn as parseFooterEngagementSection, U as SiteOptionWidgetProvider, Ut as escapeStyleContent, V as resolveFooterLayoutHints, Vt as themeRuntimeScopeProps, W as useSiteOptionWidgetContext, X as updatePublicProfile, Xt as Textarea, Y as updateFooterCredit, Z as footerCreditLine, Zt as Select$1, _ as resolvePreviewEditorGuidanceModel, _n as Trigger$2, _t as FieldLabelText, an as FieldTrigger, bn as Trigger$1, bt as revealEditorElement, cn as FIELD_SURFACE_CLASS, ct as BlockApiProvider, dn as TabsContent, dt as SelectField, en as SelectTrigger, f as canInspectSiteStyle, fn as TabsList, ft as hasEmptyOption, gn as Root2$2, gt as FieldFrame, h as resolvePreviewDashboardSetupHandoff, hn as List, ht as unmapValueFromSelect, in as SearchInput, it as NewsletterFormClient, jn as validateFooterComposition, kn as setFooterSectionSelected, lt as BlockContextProvider, m as buildPreviewDashboardSetupUrl, mn as Content$2, mt as mapOptionValueForSelect, n as SiteChromeSurfaceControls, nn as usePrevious$1, on as Input, ot as useImageResolveContextOptional, pn as TabsTrigger, pt as mapCurrentValueForSelect, q as getPublicProfile, qt as CHOSEN_OPTION_CLASS, rn as clamp, sn as FIELD_FOCUS_WITHIN_CLASS, st as FormNodeClient, tn as SelectValue, u as CustomizeBackgroundControlRows, un as Tabs, ut as useBlockContext, vn as Content$1, vt as useField, wn as normalizeLegacyFooterContentToV1, x as useSiteFontStorageUrl, xt as ThemeScopeCore, y as resolvePreviewSidebarChromeModel, yn as Root$2, yt as useLinkedInlineTextField, zt as buildThemeDataAttrs } from "./SiteChromeCustomizeButton-eU-zMftO.mjs";
|
|
6
6
|
import { J as paletteTokenNameSchema, V as hexColorSchema, W as paletteColorEntries, c as isKnownIconName, i as ThemedButtonSpecimen, l as isIconPickerPreset, o as getIconComponent, s as getIconPickerOptionsForPreset, tt as VARIANT_ROLES, u as resolveIconPickerPreset } from "./ThemedButton-CKYjeU_M.mjs";
|
|
7
|
-
import { A as ScrollableDialogContent, C as EMPTY_DOC, D as resolveSdkFooterMode,
|
|
7
|
+
import { A as ScrollableDialogContent, C as EMPTY_DOC, D as resolveSdkFooterMode, F as resolveVideoSelectionIntentForMediaField, I as isSvgMimeType, M as Surface, N as surfaceVariants, P as emitMediaCropDebug, S as useRichTextEditor, T as InlineTextEditor, _ as MediaPickerMiniDialog, a as ArrangementOptionsBody, b as getRichTextImagePositionFromTarget, c as BackgroundChooser, d as gradientLabel, f as readBackgroundColorPaletteSnapshot, g as MediaEditor, h as getUnresolvedRichTextImageWarnings, i as ArrangementLookNote, j as ScrollableDialogShell, k as Switch, l as BackgroundPreviewSwatch, m as useRichTextImageProjection, n as pageSectionIdFromBlockId, o as lookIsAutomatic, p as useSiteColourVariables, s as useArrangementToolbar, u as formatTokenLabel, v as MediaPickerMini, x as insertOrReplaceRichTextImage, y as RichTextEditorSurface } from "./PageSectionToolbar-Dfi8Y3AI.mjs";
|
|
8
8
|
import { n as TZDate } from "./src-DzXUmsyK.mjs";
|
|
9
|
-
import { i as useOptionalLocationPickerEnvironment, n as LocationPickerEnvironmentProvider } from "./LocationPickerEnvironment-
|
|
10
|
-
import { a as publicationLabel, o as Spinner, s as Separator, t as useAutosaveStatus } from "./useAutosaveStatus-
|
|
11
|
-
import { A as TooltipProvider, C as hideThemeV2RawStyleFields, D as mergeBlockDescriptors, E as getBlockManifestFromSdkConfig, F as
|
|
9
|
+
import { i as useOptionalLocationPickerEnvironment, n as LocationPickerEnvironmentProvider } from "./LocationPickerEnvironment-OwAxA2C0.mjs";
|
|
10
|
+
import { a as publicationLabel, o as Spinner, s as Separator, t as useAutosaveStatus } from "./useAutosaveStatus-OIMkhbkP.mjs";
|
|
11
|
+
import { A as TooltipProvider, B as DropdownMenuTrigger, C as hideThemeV2RawStyleFields, D as mergeBlockDescriptors, E as getBlockManifestFromSdkConfig, F as DropdownMenuItem, M as Badge, N as DropdownMenu, O as Tooltip, P as DropdownMenuContent, S as lookNotShownFieldIds, T as showRawStyleFields, _ as useSdkConfig, b as arrangementVisibilityValues, c as useBlockNeedsSetup, d as arrangementLookNameFor, f as createStoreBackend, g as SdkConfigProvider, h as createFieldObservation, i as NEEDS_SETUP_LABEL, j as TooltipTrigger, k as TooltipContent, m as isRecord$1, n as resolveBlockManifest, o as needsSetupMessage, p as isObjectRecord, r as useBlockCustomizeControls, s as needsSetupOf, u as arrangementBlockControlsFor, v as arrangementLookResolution, w as prepareBlockEditorManifest, x as blockLookOwnedFieldPaths, y as arrangementOwnedFieldIds, z as DropdownMenuSeparator } from "./useOpenBlockForSetup-BNG9P9sM.mjs";
|
|
12
12
|
import * as React$1 from "react";
|
|
13
13
|
import React, { Fragment, createContext, forwardRef, memo, useCallback, useContext, useEffect, useId, useImperativeHandle, useLayoutEffect, useMemo, useReducer, useRef, useState, useSyncExternalStore } from "react";
|
|
14
14
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -61,53 +61,6 @@ function CopyButton({ value, label, className, size = "sm", withText = false, on
|
|
|
61
61
|
});
|
|
62
62
|
}
|
|
63
63
|
//#endregion
|
|
64
|
-
//#region ../ui/src/surface.tsx
|
|
65
|
-
const surfaceVariants = cva("text-card-foreground", {
|
|
66
|
-
variants: {
|
|
67
|
-
variant: {
|
|
68
|
-
default: "bg-muted",
|
|
69
|
-
background: "bg-background",
|
|
70
|
-
/**
|
|
71
|
-
* The dark band (Macadamia's ink). `surface-inverse` remaps the
|
|
72
|
-
* button, focus and muted-text tokens inside it, so shared controls
|
|
73
|
-
* read light-on-dark without per-use overrides. Don't nest light
|
|
74
|
-
* surfaces inside it: they'd inherit the remapped tokens.
|
|
75
|
-
*/
|
|
76
|
-
inverse: "surface-inverse bg-inverse text-inverse-foreground"
|
|
77
|
-
},
|
|
78
|
-
radius: {
|
|
79
|
-
sm: "rounded-sm",
|
|
80
|
-
xl: "rounded-xl",
|
|
81
|
-
lg: "rounded-lg",
|
|
82
|
-
md: "rounded-md",
|
|
83
|
-
none: "rounded-none",
|
|
84
|
-
flushMobile: "rounded-none md:rounded-xl"
|
|
85
|
-
},
|
|
86
|
-
padding: {
|
|
87
|
-
none: "",
|
|
88
|
-
sm: "p-3",
|
|
89
|
-
md: "p-4",
|
|
90
|
-
lg: "p-6"
|
|
91
|
-
}
|
|
92
|
-
},
|
|
93
|
-
defaultVariants: {
|
|
94
|
-
variant: "default",
|
|
95
|
-
radius: "xl",
|
|
96
|
-
padding: "none"
|
|
97
|
-
}
|
|
98
|
-
});
|
|
99
|
-
function Surface({ className, variant, radius, padding, ...props }) {
|
|
100
|
-
return /* @__PURE__ */ jsx("div", {
|
|
101
|
-
"data-slot": "surface",
|
|
102
|
-
className: cn(surfaceVariants({
|
|
103
|
-
variant,
|
|
104
|
-
radius,
|
|
105
|
-
padding
|
|
106
|
-
}), className),
|
|
107
|
-
...props
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
//#endregion
|
|
111
64
|
//#region ../ui/src/card.tsx
|
|
112
65
|
const cardLayoutVariants = cva("flex flex-col", {
|
|
113
66
|
variants: { size: {
|
|
@@ -125,7 +78,7 @@ function Card({ className, variant = "default", size = "default", radius = "xl",
|
|
|
125
78
|
variant,
|
|
126
79
|
radius,
|
|
127
80
|
padding: "none"
|
|
128
|
-
}), variant === "default" ? "bg-[var(--card-surface,#ffffff)] border-0 shadow-[var(--card-shadow,var(--card-glow-shadow))]" : null, cardLayoutVariants({ size }), className),
|
|
81
|
+
}), variant === "default" ? "bg-[var(--card-surface,#ffffff)] border-0 shadow-[var(--card-shadow,var(--card-glow-shadow))]" : null, cardLayoutVariants({ size }), "has-[>[data-slot=card-footer][data-variant=bar]:last-child]:pb-0", className),
|
|
129
82
|
...props
|
|
130
83
|
});
|
|
131
84
|
}
|
|
@@ -136,6 +89,13 @@ function CardContent({ className, ...props }) {
|
|
|
136
89
|
...props
|
|
137
90
|
});
|
|
138
91
|
}
|
|
92
|
+
cva("flex items-center px-6", {
|
|
93
|
+
variants: { variant: {
|
|
94
|
+
default: "[.border-t]:pt-6",
|
|
95
|
+
bar: "flex-wrap-reverse gap-2.5 rounded-b-[inherit] border-t border-border/60 bg-muted/50 py-3"
|
|
96
|
+
} },
|
|
97
|
+
defaultVariants: { variant: "default" }
|
|
98
|
+
});
|
|
139
99
|
//#endregion
|
|
140
100
|
//#region ../ui/src/collapsible.tsx
|
|
141
101
|
const Collapsible = Root$2;
|
|
@@ -152,169 +112,14 @@ const CollapsibleContent = React$1.forwardRef(({ className, ...props }, ref) =>
|
|
|
152
112
|
}));
|
|
153
113
|
CollapsibleContent.displayName = Content$1.displayName;
|
|
154
114
|
//#endregion
|
|
155
|
-
//#region ../ui/src/editor-item-card.tsx
|
|
156
|
-
const EditorItemContainerContext = React$1.createContext(false);
|
|
157
|
-
const EditorItemListContext = React$1.createContext(false);
|
|
158
|
-
/**
|
|
159
|
-
* The list an editor's item cards sit in, with any insert dividers between
|
|
160
|
-
* them. From 640px up the items are cards. Inside a container below 640px
|
|
161
|
-
* they become rows split by lines that run to the container's edges, and the
|
|
162
|
-
* open row is shaded with an accent line down its left, so a phone never
|
|
163
|
-
* shows a card inside a card. A list straight on the page keeps its cards.
|
|
164
|
-
*/
|
|
165
|
-
function EditorItemList({ className, children, ...props }) {
|
|
166
|
-
const rows = React$1.useContext(EditorItemContainerContext);
|
|
167
|
-
return /* @__PURE__ */ jsx(EditorItemListContext.Provider, {
|
|
168
|
-
value: rows,
|
|
169
|
-
children: /* @__PURE__ */ jsx("div", {
|
|
170
|
-
...props,
|
|
171
|
-
"data-slot": "editor-item-list",
|
|
172
|
-
"data-phone-rows": rows ? "" : void 0,
|
|
173
|
-
className: cn("flex flex-col", className, rows && "max-sm:-mx-3 max-sm:gap-0 max-sm:border-b"),
|
|
174
|
-
children
|
|
175
|
-
})
|
|
176
|
-
});
|
|
177
|
-
}
|
|
178
|
-
const PHONE_ROW = "max-sm:rounded-none max-sm:border-t max-sm:border-border max-sm:shadow-none max-sm:ring-inset";
|
|
179
|
-
const PHONE_ROW_CLOSED = "max-sm:bg-transparent";
|
|
180
|
-
const PHONE_ROW_OPEN = "max-sm:border-l-[3px] max-sm:border-l-primary max-sm:bg-muted/60";
|
|
181
|
-
function editorItemCardClassName(input) {
|
|
182
|
-
const open = input.disclosure.kind === "collapsible" && input.disclosure.open;
|
|
183
|
-
return cn("w-full p-0 transition-colors", input.state === "error" && "ring-2 ring-destructive", input.phoneRow && [PHONE_ROW, open ? PHONE_ROW_OPEN : PHONE_ROW_CLOSED], input.className);
|
|
184
|
-
}
|
|
185
|
-
function EditorItemCard({ title, subtitle, icon, titleAdornment, state = "default", disclosure: requestedDisclosure, affordances, interactive = true, testIdPrefix = "editor-item-card", children, className, ...rootProps }) {
|
|
186
|
-
const generatedContentId = React$1.useId();
|
|
187
|
-
const hasContent = children !== void 0 && children !== null && children !== false;
|
|
188
|
-
const disclosure = hasContent ? requestedDisclosure : { kind: "static" };
|
|
189
|
-
const contentId = disclosure.kind === "collapsible" ? disclosure.contentId ?? generatedContentId : void 0;
|
|
190
|
-
const phoneRow = React$1.useContext(EditorItemListContext);
|
|
191
|
-
return /* @__PURE__ */ jsx(Card, {
|
|
192
|
-
...rootProps,
|
|
193
|
-
size: "none",
|
|
194
|
-
"data-editor-item-card": "",
|
|
195
|
-
"data-phone-row": phoneRow ? "" : void 0,
|
|
196
|
-
"data-error": state === "error" ? "true" : void 0,
|
|
197
|
-
"data-editor-block-highlight": state === "highlighted" ? "true" : void 0,
|
|
198
|
-
className: editorItemCardClassName({
|
|
199
|
-
state,
|
|
200
|
-
phoneRow,
|
|
201
|
-
disclosure,
|
|
202
|
-
className
|
|
203
|
-
}),
|
|
204
|
-
children: /* @__PURE__ */ jsx(EditorItemCardBody, {
|
|
205
|
-
disclosure,
|
|
206
|
-
contentId,
|
|
207
|
-
header: /* @__PURE__ */ jsx(EditorItemCardHeader, {
|
|
208
|
-
title,
|
|
209
|
-
subtitle,
|
|
210
|
-
icon,
|
|
211
|
-
titleAdornment,
|
|
212
|
-
disclosure,
|
|
213
|
-
contentId,
|
|
214
|
-
affordances,
|
|
215
|
-
interactive,
|
|
216
|
-
testIdPrefix
|
|
217
|
-
}),
|
|
218
|
-
children: hasContent ? children : null
|
|
219
|
-
})
|
|
220
|
-
});
|
|
221
|
-
}
|
|
222
|
-
function EditorItemCardBody({ disclosure, contentId, header, children }) {
|
|
223
|
-
const content = children ? /* @__PURE__ */ jsx(EditorItemContainerContext.Provider, {
|
|
224
|
-
value: true,
|
|
225
|
-
children: /* @__PURE__ */ jsx(EditorItemListContext.Provider, {
|
|
226
|
-
value: false,
|
|
227
|
-
children
|
|
228
|
-
})
|
|
229
|
-
}) : null;
|
|
230
|
-
if (disclosure.kind === "static") return /* @__PURE__ */ jsxs(Fragment$1, { children: [header, content] });
|
|
231
|
-
return /* @__PURE__ */ jsxs(Collapsible, {
|
|
232
|
-
open: disclosure.open,
|
|
233
|
-
onOpenChange: disclosure.onOpenChange,
|
|
234
|
-
children: [header, content ? /* @__PURE__ */ jsx(CollapsibleContent, {
|
|
235
|
-
id: contentId,
|
|
236
|
-
children: content
|
|
237
|
-
}) : null]
|
|
238
|
-
});
|
|
239
|
-
}
|
|
240
|
-
function EditorItemCardIcon({ icon, testIdPrefix }) {
|
|
241
|
-
if (!icon) return null;
|
|
242
|
-
return /* @__PURE__ */ jsx("span", {
|
|
243
|
-
"aria-hidden": "true",
|
|
244
|
-
className: "shrink-0 text-muted-foreground",
|
|
245
|
-
"data-testid": `${testIdPrefix}-icon`,
|
|
246
|
-
children: icon
|
|
247
|
-
});
|
|
248
|
-
}
|
|
249
|
-
function EditorItemCardHeader({ title, subtitle, icon, titleAdornment, disclosure, contentId, affordances, interactive, testIdPrefix }) {
|
|
250
|
-
const subtitleId = React$1.useId();
|
|
251
|
-
const adornmentId = React$1.useId();
|
|
252
|
-
const describedBy = [subtitle ? subtitleId : null, titleAdornment ? adornmentId : null].filter(Boolean).join(" ") || void 0;
|
|
253
|
-
const titleBlock = /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
254
|
-
/* @__PURE__ */ jsx(EditorItemCardIcon, {
|
|
255
|
-
icon,
|
|
256
|
-
testIdPrefix
|
|
257
|
-
}),
|
|
258
|
-
/* @__PURE__ */ jsxs("span", {
|
|
259
|
-
className: "block min-w-0 flex-1 overflow-hidden",
|
|
260
|
-
"data-testid": `${testIdPrefix}-title-shell`,
|
|
261
|
-
children: [/* @__PURE__ */ jsx("span", {
|
|
262
|
-
"data-slot": "card-title",
|
|
263
|
-
className: "block truncate text-base font-semibold leading-none",
|
|
264
|
-
"data-testid": `${testIdPrefix}-title`,
|
|
265
|
-
children: title
|
|
266
|
-
}), subtitle ? /* @__PURE__ */ jsx("span", {
|
|
267
|
-
id: subtitleId,
|
|
268
|
-
className: "block truncate text-xs text-muted-foreground",
|
|
269
|
-
"data-testid": `${testIdPrefix}-subtitle`,
|
|
270
|
-
children: subtitle
|
|
271
|
-
}) : null]
|
|
272
|
-
}),
|
|
273
|
-
titleAdornment ? /* @__PURE__ */ jsx("span", {
|
|
274
|
-
id: adornmentId,
|
|
275
|
-
className: "shrink-0",
|
|
276
|
-
children: titleAdornment
|
|
277
|
-
}) : null
|
|
278
|
-
] });
|
|
279
|
-
return /* @__PURE__ */ jsx("fieldset", {
|
|
280
|
-
className: "contents",
|
|
281
|
-
disabled: !interactive,
|
|
282
|
-
children: /* @__PURE__ */ jsxs("div", {
|
|
283
|
-
"data-slot": "editor-item-card-header",
|
|
284
|
-
"data-testid": `${testIdPrefix}-header`,
|
|
285
|
-
className: "flex flex-wrap items-start gap-1 px-2 py-2",
|
|
286
|
-
children: [/* @__PURE__ */ jsxs("div", {
|
|
287
|
-
className: "flex min-w-0 flex-1 items-center gap-2",
|
|
288
|
-
children: [affordances.kind === "full" ? affordances.dragHandle : null, disclosure.kind === "collapsible" ? /* @__PURE__ */ jsxs("button", {
|
|
289
|
-
type: "button",
|
|
290
|
-
className: "flex min-w-0 flex-1 items-center gap-2 rounded-md text-left outline-none transition-colors hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-wait disabled:opacity-60",
|
|
291
|
-
"aria-expanded": disclosure.open,
|
|
292
|
-
"aria-controls": contentId,
|
|
293
|
-
"aria-label": `${disclosure.open ? "Collapse" : "Expand"} ${title}`,
|
|
294
|
-
"aria-describedby": describedBy,
|
|
295
|
-
onClick: () => disclosure.onOpenChange(!disclosure.open),
|
|
296
|
-
children: [/* @__PURE__ */ jsx(ChevronRight, {
|
|
297
|
-
"aria-hidden": "true",
|
|
298
|
-
className: cn("h-4 w-4 shrink-0 transition", disclosure.open && "rotate-90")
|
|
299
|
-
}), titleBlock]
|
|
300
|
-
}) : /* @__PURE__ */ jsx("div", {
|
|
301
|
-
className: "flex min-w-0 flex-1 items-center gap-2 px-1",
|
|
302
|
-
children: titleBlock
|
|
303
|
-
})]
|
|
304
|
-
}), affordances.kind === "full" && affordances.actions ? /* @__PURE__ */ jsx(EditorItemCardActions, {
|
|
305
|
-
testId: `${testIdPrefix}-actions`,
|
|
306
|
-
...affordances.actions
|
|
307
|
-
}) : null]
|
|
308
|
-
})
|
|
309
|
-
});
|
|
310
|
-
}
|
|
115
|
+
//#region ../ui/src/editor-item-card-actions.tsx
|
|
311
116
|
/**
|
|
312
117
|
* The action row, usable on its own by item presentations that aren't a
|
|
313
118
|
* header card (for example a thumbnail tile).
|
|
314
119
|
*/
|
|
315
120
|
function EditorItemCardActions({ move, slot, inline, menu, className, testId }) {
|
|
316
121
|
return /* @__PURE__ */ jsxs("div", {
|
|
317
|
-
className: cn("ml-auto flex shrink-0 flex-wrap items-center justify-end gap-1
|
|
122
|
+
className: cn("ml-auto flex shrink-0 flex-wrap items-center justify-end gap-1", className),
|
|
318
123
|
"data-testid": testId,
|
|
319
124
|
onClick: (event) => event.stopPropagation(),
|
|
320
125
|
children: [
|
|
@@ -330,32 +135,35 @@ function EditorItemCardActions({ move, slot, inline, menu, className, testId })
|
|
|
330
135
|
control: action,
|
|
331
136
|
icon: action.icon
|
|
332
137
|
}, action.key)),
|
|
333
|
-
menu ? /* @__PURE__ */
|
|
334
|
-
asChild: true,
|
|
335
|
-
children: /* @__PURE__ */ jsx(Button$1, {
|
|
336
|
-
ref: menu.ref,
|
|
337
|
-
type: "button",
|
|
338
|
-
variant: "ghost",
|
|
339
|
-
size: "icon",
|
|
340
|
-
disabled: menu.disabled,
|
|
341
|
-
"aria-label": menu.label,
|
|
342
|
-
title: "More actions",
|
|
343
|
-
children: /* @__PURE__ */ jsx(EllipsisVertical, { className: "h-4 w-4" })
|
|
344
|
-
})
|
|
345
|
-
}), /* @__PURE__ */ jsx(DropdownMenuContent, {
|
|
346
|
-
align: "end",
|
|
347
|
-
className: "w-44",
|
|
348
|
-
onCloseAutoFocus: menu.onCloseAutoFocus,
|
|
349
|
-
children: menu.groups.filter((group) => group.items.length > 0).map((group, index) => /* @__PURE__ */ jsxs(React$1.Fragment, { children: [index > 0 ? /* @__PURE__ */ jsx(DropdownMenuSeparator, {}) : null, group.items.map((item) => /* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
350
|
-
disabled: item.disabled,
|
|
351
|
-
tone: item.tone ?? "default",
|
|
352
|
-
onSelect: item.onSelect,
|
|
353
|
-
children: [item.icon, item.label]
|
|
354
|
-
}, item.key))] }, group.key))
|
|
355
|
-
})] }) : null
|
|
138
|
+
menu ? /* @__PURE__ */ jsx(EditorItemCardMenuButton, { menu }) : null
|
|
356
139
|
]
|
|
357
140
|
});
|
|
358
141
|
}
|
|
142
|
+
function EditorItemCardMenuButton({ menu }) {
|
|
143
|
+
return /* @__PURE__ */ jsxs(DropdownMenu, { children: [/* @__PURE__ */ jsx(DropdownMenuTrigger, {
|
|
144
|
+
asChild: true,
|
|
145
|
+
children: /* @__PURE__ */ jsx(Button$1, {
|
|
146
|
+
ref: menu.ref,
|
|
147
|
+
type: "button",
|
|
148
|
+
variant: "ghost",
|
|
149
|
+
size: "icon",
|
|
150
|
+
disabled: menu.disabled,
|
|
151
|
+
"aria-label": menu.label,
|
|
152
|
+
title: "More actions",
|
|
153
|
+
children: /* @__PURE__ */ jsx(EllipsisVertical, { className: "h-4 w-4" })
|
|
154
|
+
})
|
|
155
|
+
}), /* @__PURE__ */ jsx(DropdownMenuContent, {
|
|
156
|
+
align: "end",
|
|
157
|
+
className: "w-44",
|
|
158
|
+
onCloseAutoFocus: menu.onCloseAutoFocus,
|
|
159
|
+
children: menu.groups.filter((group) => group.items.length > 0).map((group, index) => /* @__PURE__ */ jsxs(React$1.Fragment, { children: [index > 0 ? /* @__PURE__ */ jsx(DropdownMenuSeparator, {}) : null, group.items.map((item) => /* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
160
|
+
disabled: item.disabled,
|
|
161
|
+
tone: item.tone ?? "default",
|
|
162
|
+
onSelect: item.onSelect,
|
|
163
|
+
children: [item.icon, item.label]
|
|
164
|
+
}, item.key))] }, group.key))
|
|
165
|
+
})] });
|
|
166
|
+
}
|
|
359
167
|
function EditorItemCardIconButton({ control, icon }) {
|
|
360
168
|
return /* @__PURE__ */ jsx(Button$1, {
|
|
361
169
|
ref: control.ref,
|
|
@@ -377,23 +185,283 @@ const EditorItemCardDragHandle = React$1.forwardRef(function EditorItemCardDragH
|
|
|
377
185
|
"aria-label": ariaLabel,
|
|
378
186
|
title,
|
|
379
187
|
disabled: concealed || disabled,
|
|
380
|
-
className: cn("shrink-0 rounded p-1 transition-opacity focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", concealed ? "pointer-events-none cursor-not-allowed opacity-0" : "cursor-grab text-muted-foreground opacity-100 hover:text-foreground active:cursor-grabbing", className),
|
|
188
|
+
className: cn("shrink-0 rounded p-1 transition-opacity focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", concealed ? "pointer-events-none cursor-not-allowed opacity-0" : "cursor-grab text-muted-foreground/60 opacity-100 hover:text-foreground active:cursor-grabbing", className),
|
|
381
189
|
children: /* @__PURE__ */ jsx(GripVertical, { className: "h-4 w-4" })
|
|
382
190
|
});
|
|
383
191
|
});
|
|
192
|
+
//#endregion
|
|
193
|
+
//#region ../ui/src/editor-item-nesting.tsx
|
|
194
|
+
/**
|
|
195
|
+
* How editor items nest, so an editor never shows cards inside cards. An item
|
|
196
|
+
* straight on the page is a card. Lists inside it are rows in a tinted well,
|
|
197
|
+
* opening in place. A list one level deeper shows as a single summary row,
|
|
198
|
+
* and opens by swapping the outer card's contents for it, with a path back.
|
|
199
|
+
*/
|
|
200
|
+
const EditorItemDepthContext = React$1.createContext(0);
|
|
201
|
+
const EditorItemRowsContext = React$1.createContext(false);
|
|
202
|
+
const EditorItemPathContext = React$1.createContext([]);
|
|
203
|
+
const EditorItemDrillContext = React$1.createContext(null);
|
|
204
|
+
/**
|
|
205
|
+
* The list an editor's item cards sit in, with any insert dividers between
|
|
206
|
+
* them. Straight on the page its items are cards. Inside a card they're rows
|
|
207
|
+
* in a tinted well, split by hairlines.
|
|
208
|
+
*/
|
|
209
|
+
function EditorItemList({ className, children, ...props }) {
|
|
210
|
+
if (React$1.useContext(EditorItemDepthContext) >= 1) return /* @__PURE__ */ jsx(EditorItemRowList, {
|
|
211
|
+
className,
|
|
212
|
+
...props,
|
|
213
|
+
children
|
|
214
|
+
});
|
|
215
|
+
return /* @__PURE__ */ jsx(EditorItemRowsContext.Provider, {
|
|
216
|
+
value: false,
|
|
217
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
218
|
+
...props,
|
|
219
|
+
"data-slot": "editor-item-list",
|
|
220
|
+
className: cn("flex flex-col", className),
|
|
221
|
+
children
|
|
222
|
+
})
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
function EditorItemRowList({ className, children, ...props }) {
|
|
226
|
+
return /* @__PURE__ */ jsx(EditorItemRowsContext.Provider, {
|
|
227
|
+
value: true,
|
|
228
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
229
|
+
...props,
|
|
230
|
+
"data-slot": "editor-item-list",
|
|
231
|
+
"data-rows": "",
|
|
232
|
+
className: cn("flex flex-col overflow-hidden rounded-[14px] bg-muted px-1 pb-1", className, "gap-0"),
|
|
233
|
+
children
|
|
234
|
+
})
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
function drillSummaryText(itemCount) {
|
|
238
|
+
if (itemCount === void 0) return "Open";
|
|
239
|
+
return itemCount === 1 ? "1 item" : `${itemCount} items`;
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* A list editor inside an item. Two levels in, it shows as one summary row
|
|
243
|
+
* and opens on its own in place of the outer card's contents, everything in
|
|
244
|
+
* it together, so nothing it needs is left behind. Nearer the top it simply
|
|
245
|
+
* draws in place.
|
|
246
|
+
*/
|
|
247
|
+
function EditorItemNestedList(props) {
|
|
248
|
+
const depth = React$1.useContext(EditorItemDepthContext);
|
|
249
|
+
const drill = React$1.useContext(EditorItemDrillContext);
|
|
250
|
+
if (depth >= 2 && drill) return /* @__PURE__ */ jsx(EditorItemDrillList, {
|
|
251
|
+
drill,
|
|
252
|
+
...props
|
|
253
|
+
});
|
|
254
|
+
return /* @__PURE__ */ jsx(Fragment$1, { children: props.children });
|
|
255
|
+
}
|
|
256
|
+
function EditorItemDrillList({ drill, label = "Items", itemCount, summary, revealed = false, children }) {
|
|
257
|
+
const key = React$1.useId();
|
|
258
|
+
const path = React$1.useContext(EditorItemPathContext);
|
|
259
|
+
const summaryRef = React$1.useRef(null);
|
|
260
|
+
const position = drill.stack.findIndex((entry) => entry.key === key);
|
|
261
|
+
const { open, close } = drill;
|
|
262
|
+
const fullPath = React$1.useMemo(() => [...path, label], [path, label]);
|
|
263
|
+
const openHere = React$1.useCallback(() => open({
|
|
264
|
+
key,
|
|
265
|
+
path: fullPath,
|
|
266
|
+
returnFocus: () => summaryRef.current?.focus()
|
|
267
|
+
}), [
|
|
268
|
+
open,
|
|
269
|
+
key,
|
|
270
|
+
fullPath
|
|
271
|
+
]);
|
|
272
|
+
React$1.useEffect(() => {
|
|
273
|
+
if (revealed) openHere();
|
|
274
|
+
}, [revealed, openHere]);
|
|
275
|
+
React$1.useEffect(() => () => close(key), [close, key]);
|
|
276
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(EditorItemDrillSummary, {
|
|
277
|
+
ref: summaryRef,
|
|
278
|
+
label,
|
|
279
|
+
onOpen: openHere,
|
|
280
|
+
children: summary ?? drillSummaryText(itemCount)
|
|
281
|
+
}), position >= 0 && drill.slot ? createPortal(/* @__PURE__ */ jsx("div", {
|
|
282
|
+
hidden: position !== drill.stack.length - 1,
|
|
283
|
+
children: /* @__PURE__ */ jsx(EditorItemPathContext.Provider, {
|
|
284
|
+
value: fullPath,
|
|
285
|
+
children: /* @__PURE__ */ jsx(EditorItemDepthContext.Provider, {
|
|
286
|
+
value: 1,
|
|
287
|
+
children
|
|
288
|
+
})
|
|
289
|
+
})
|
|
290
|
+
}), drill.slot) : null] });
|
|
291
|
+
}
|
|
292
|
+
function EditorItemDrillSummary({ ref, label, onOpen, children }) {
|
|
293
|
+
const summaryId = React$1.useId();
|
|
294
|
+
return /* @__PURE__ */ jsxs("button", {
|
|
295
|
+
ref,
|
|
296
|
+
type: "button",
|
|
297
|
+
"data-slot": "editor-item-drill-summary",
|
|
298
|
+
className: "flex w-full items-center gap-2.5 rounded-[10px] border border-border bg-card px-3 py-2.5 text-left text-sm outline-none transition-colors hover:bg-muted/50 focus-visible:ring-2 focus-visible:ring-ring",
|
|
299
|
+
"aria-label": `Edit ${label}`,
|
|
300
|
+
"aria-describedby": summaryId,
|
|
301
|
+
onClick: onOpen,
|
|
302
|
+
children: [
|
|
303
|
+
/* @__PURE__ */ jsx("span", {
|
|
304
|
+
id: summaryId,
|
|
305
|
+
className: "min-w-0 flex-1 truncate",
|
|
306
|
+
children
|
|
307
|
+
}),
|
|
308
|
+
/* @__PURE__ */ jsx("span", {
|
|
309
|
+
className: "shrink-0 font-medium text-primary",
|
|
310
|
+
children: "Edit"
|
|
311
|
+
}),
|
|
312
|
+
/* @__PURE__ */ jsx(ChevronRight, {
|
|
313
|
+
"aria-hidden": "true",
|
|
314
|
+
className: "h-4 w-4 shrink-0 text-primary"
|
|
315
|
+
})
|
|
316
|
+
]
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
/**
|
|
320
|
+
* The outer card's drill-in: which deep lists are open, and where they draw.
|
|
321
|
+
* Closing the card unmounts its body, and each open list closes itself as it
|
|
322
|
+
* goes, so the stack needs no resetting of its own.
|
|
323
|
+
*/
|
|
324
|
+
function useEditorItemDrillHost() {
|
|
325
|
+
const [stack, setStack] = React$1.useState([]);
|
|
326
|
+
const [slot, setSlot] = React$1.useState(null);
|
|
327
|
+
const open = React$1.useCallback((entry) => {
|
|
328
|
+
setStack((previous) => [...previous.filter((candidate) => candidate.key !== entry.key), entry]);
|
|
329
|
+
}, []);
|
|
330
|
+
const close = React$1.useCallback((key) => {
|
|
331
|
+
setStack((previous) => previous.some((entry) => entry.key === key) ? previous.filter((entry) => entry.key !== key) : previous);
|
|
332
|
+
}, []);
|
|
333
|
+
const back = React$1.useCallback(() => {
|
|
334
|
+
const top = stack[stack.length - 1];
|
|
335
|
+
if (!top) return;
|
|
336
|
+
close(top.key);
|
|
337
|
+
window.requestAnimationFrame(top.returnFocus);
|
|
338
|
+
}, [close, stack]);
|
|
339
|
+
return React$1.useMemo(() => ({
|
|
340
|
+
stack,
|
|
341
|
+
slot,
|
|
342
|
+
open,
|
|
343
|
+
close,
|
|
344
|
+
back,
|
|
345
|
+
setSlot
|
|
346
|
+
}), [
|
|
347
|
+
stack,
|
|
348
|
+
slot,
|
|
349
|
+
open,
|
|
350
|
+
close,
|
|
351
|
+
back
|
|
352
|
+
]);
|
|
353
|
+
}
|
|
354
|
+
/** Where a card sits. */
|
|
355
|
+
function useEditorItemPlacement() {
|
|
356
|
+
return {
|
|
357
|
+
outer: React$1.useContext(EditorItemDepthContext) === 0,
|
|
358
|
+
row: React$1.useContext(EditorItemRowsContext)
|
|
359
|
+
};
|
|
360
|
+
}
|
|
361
|
+
/** A card's body, one level deeper than the card. The list the card sits in doesn't reach into it. */
|
|
362
|
+
function EditorItemNestedBody({ title, host, children }) {
|
|
363
|
+
const depth = React$1.useContext(EditorItemDepthContext);
|
|
364
|
+
const path = React$1.useContext(EditorItemPathContext);
|
|
365
|
+
const parentDrill = React$1.useContext(EditorItemDrillContext);
|
|
366
|
+
const childPath = React$1.useMemo(() => [...path, title], [path, title]);
|
|
367
|
+
return /* @__PURE__ */ jsx(EditorItemRowsContext.Provider, {
|
|
368
|
+
value: false,
|
|
369
|
+
children: /* @__PURE__ */ jsx(EditorItemDepthContext.Provider, {
|
|
370
|
+
value: depth + 1,
|
|
371
|
+
children: /* @__PURE__ */ jsx(EditorItemPathContext.Provider, {
|
|
372
|
+
value: childPath,
|
|
373
|
+
children: /* @__PURE__ */ jsx(EditorItemDrillContext.Provider, {
|
|
374
|
+
value: host ?? parentDrill,
|
|
375
|
+
children
|
|
376
|
+
})
|
|
377
|
+
})
|
|
378
|
+
})
|
|
379
|
+
});
|
|
380
|
+
}
|
|
381
|
+
/** Stands in for the outer card's header while a deep list is open: where you are, and the way back. */
|
|
382
|
+
function EditorItemDrillPath({ drill, testIdPrefix }) {
|
|
383
|
+
const top = drill.stack[drill.stack.length - 1];
|
|
384
|
+
const backRef = React$1.useRef(null);
|
|
385
|
+
const key = top?.key;
|
|
386
|
+
React$1.useEffect(() => {
|
|
387
|
+
if (key) backRef.current?.focus();
|
|
388
|
+
}, [key]);
|
|
389
|
+
if (!top) return /* @__PURE__ */ jsx(Fragment$1, {});
|
|
390
|
+
const previous = drill.stack[drill.stack.length - 2];
|
|
391
|
+
const backTo = previous?.path[previous.path.length - 1] ?? top.path[0] ?? "";
|
|
392
|
+
const [, ...rest] = top.path;
|
|
393
|
+
return /* @__PURE__ */ jsxs("nav", {
|
|
394
|
+
"aria-label": "Where you are",
|
|
395
|
+
"data-slot": "editor-item-drill-path",
|
|
396
|
+
"data-testid": `${testIdPrefix}-drill-path`,
|
|
397
|
+
className: "flex min-w-0 items-center gap-1.5 rounded-t-[16px] border-b border-border/70 bg-muted/50 py-2 pl-1.5 pr-3",
|
|
398
|
+
children: [/* @__PURE__ */ jsxs(Button$1, {
|
|
399
|
+
ref: backRef,
|
|
400
|
+
type: "button",
|
|
401
|
+
variant: "ghost",
|
|
402
|
+
size: "sm",
|
|
403
|
+
className: "shrink-0 px-1.5 text-primary",
|
|
404
|
+
onClick: drill.back,
|
|
405
|
+
"aria-label": `Back to ${backTo}`,
|
|
406
|
+
children: [/* @__PURE__ */ jsx(ChevronLeft, { "aria-hidden": "true" }), backTo]
|
|
407
|
+
}), rest.map((part, index) => /* @__PURE__ */ jsxs(React$1.Fragment, { children: [/* @__PURE__ */ jsx("span", {
|
|
408
|
+
"aria-hidden": "true",
|
|
409
|
+
className: "text-muted-foreground/60",
|
|
410
|
+
children: "/"
|
|
411
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
412
|
+
className: cn("truncate text-sm", index === rest.length - 1 ? "font-semibold" : "text-muted-foreground"),
|
|
413
|
+
children: part
|
|
414
|
+
})] }, `${index}-${part}`))]
|
|
415
|
+
});
|
|
416
|
+
}
|
|
417
|
+
/** Where a deep list draws inside its outer card. */
|
|
418
|
+
function EditorItemDrillSlot({ host }) {
|
|
419
|
+
return /* @__PURE__ */ jsx("div", {
|
|
420
|
+
ref: host.setSlot,
|
|
421
|
+
hidden: host.stack.length === 0,
|
|
422
|
+
"data-slot": "editor-item-drill",
|
|
423
|
+
className: "p-3"
|
|
424
|
+
});
|
|
425
|
+
}
|
|
426
|
+
/**
|
|
427
|
+
* Escape goes back from an open deep list. The list draws through a portal,
|
|
428
|
+
* so its key events reach the outer card through React rather than the DOM;
|
|
429
|
+
* the card handles them, for its own path bar and slot only, and leaves
|
|
430
|
+
* Escape to any control inside that took it first.
|
|
431
|
+
*/
|
|
432
|
+
function handleEditorItemDrillEscape(event, host) {
|
|
433
|
+
if (event.key !== "Escape" || event.defaultPrevented || host.stack.length === 0) return;
|
|
434
|
+
const target = event.target;
|
|
435
|
+
if (!(target instanceof Element) || !event.currentTarget.contains(target)) return;
|
|
436
|
+
if (!target.closest("[data-slot=\"editor-item-drill\"], [data-slot=\"editor-item-drill-path\"]")) return;
|
|
437
|
+
event.preventDefault();
|
|
438
|
+
event.stopPropagation();
|
|
439
|
+
host.back();
|
|
440
|
+
}
|
|
441
|
+
/**
|
|
442
|
+
* The parts of the page an editor's form draws into: its own element and,
|
|
443
|
+
* while a list inside it is open on its own, the outer card's slot for that
|
|
444
|
+
* list. For an editor that tracks focus or finds fields by looking in the DOM.
|
|
445
|
+
*/
|
|
446
|
+
function editorItemFormSurfaces(root) {
|
|
447
|
+
const slot = root.closest("[data-editor-item-card]")?.querySelector("[data-slot=\"editor-item-drill\"]");
|
|
448
|
+
return slot && !root.contains(slot) ? [root, slot] : [root];
|
|
449
|
+
}
|
|
384
450
|
/**
|
|
385
451
|
* The gap between two items in an editor. Its insert actions appear when the
|
|
386
452
|
* gap is hovered or when keyboard focus reaches it. Touch screens can't
|
|
387
453
|
* hover, so there they always show.
|
|
388
|
-
*
|
|
389
|
-
*
|
|
454
|
+
* Between rows in a well there's no gap: the divider sits on the hairline
|
|
455
|
+
* and its button floats over it. Touch screens skip it there, and the list's
|
|
456
|
+
* own add button does the inserting.
|
|
390
457
|
*/
|
|
391
458
|
function EditorItemInsertDivider({ actions, touch = "label" }) {
|
|
392
|
-
const
|
|
459
|
+
const inRows = React$1.useContext(EditorItemRowsContext);
|
|
393
460
|
const iconOnlyOnTouch = touch === "icon" && actions.length === 1;
|
|
461
|
+
if (inRows) return /* @__PURE__ */ jsx(EditorItemRowInsertDivider, { actions });
|
|
394
462
|
return /* @__PURE__ */ jsxs("div", {
|
|
395
463
|
"data-slot": "editor-item-insert-divider",
|
|
396
|
-
className:
|
|
464
|
+
className: "relative flex h-8 w-full items-center justify-center opacity-0 transition-opacity focus-within:opacity-100 hover:opacity-100 pointer-coarse:opacity-100",
|
|
397
465
|
children: [/* @__PURE__ */ jsx("div", { className: "w-full border-b" }), /* @__PURE__ */ jsx("div", {
|
|
398
466
|
className: "pointer-events-none absolute inset-0 flex flex-wrap items-center justify-center gap-2",
|
|
399
467
|
children: actions.map((action) => /* @__PURE__ */ jsxs(Button$1, {
|
|
@@ -413,6 +481,244 @@ function EditorItemInsertDivider({ actions, touch = "label" }) {
|
|
|
413
481
|
})]
|
|
414
482
|
});
|
|
415
483
|
}
|
|
484
|
+
function EditorItemRowInsertDivider({ actions }) {
|
|
485
|
+
return /* @__PURE__ */ jsx("div", {
|
|
486
|
+
"data-slot": "editor-item-insert-divider",
|
|
487
|
+
className: "relative z-10 h-0 pointer-coarse:hidden",
|
|
488
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
489
|
+
className: "absolute inset-x-0 -top-2 flex h-4 items-center justify-center gap-2 opacity-0 transition-opacity focus-within:opacity-100 hover:opacity-100",
|
|
490
|
+
children: actions.map((action) => /* @__PURE__ */ jsxs(Button$1, {
|
|
491
|
+
type: "button",
|
|
492
|
+
size: "sm",
|
|
493
|
+
variant: "secondary",
|
|
494
|
+
className: "h-6 px-2 text-xs shadow-sm",
|
|
495
|
+
onClick: action.onSelect,
|
|
496
|
+
children: [/* @__PURE__ */ jsx(Plus, {
|
|
497
|
+
className: "mr-1 h-3.5 w-3.5",
|
|
498
|
+
"aria-hidden": "true"
|
|
499
|
+
}), action.label]
|
|
500
|
+
}, action.label))
|
|
501
|
+
})
|
|
502
|
+
});
|
|
503
|
+
}
|
|
504
|
+
//#endregion
|
|
505
|
+
//#region ../ui/src/editor-item-card.tsx
|
|
506
|
+
const ROW = "rounded-none bg-transparent [--card-shadow:0_-1px_0_0_var(--color-border)]";
|
|
507
|
+
function editorItemCardClassName(input) {
|
|
508
|
+
return cn("w-full p-0 transition-colors", input.row ? ROW : "rounded-[16px]", input.state === "error" && "ring-2 ring-destructive", input.row && input.state === "error" && "ring-inset", input.className);
|
|
509
|
+
}
|
|
510
|
+
function editorItemCardData(state, row) {
|
|
511
|
+
return {
|
|
512
|
+
"data-editor-item-card": "",
|
|
513
|
+
"data-row": row ? "" : void 0,
|
|
514
|
+
"data-error": state === "error" ? "true" : void 0,
|
|
515
|
+
"data-editor-block-highlight": state === "highlighted" ? "true" : void 0
|
|
516
|
+
};
|
|
517
|
+
}
|
|
518
|
+
function isOpen(disclosure) {
|
|
519
|
+
return disclosure.kind === "static" || disclosure.open;
|
|
520
|
+
}
|
|
521
|
+
function hasNode(children) {
|
|
522
|
+
return children !== void 0 && children !== null && children !== false;
|
|
523
|
+
}
|
|
524
|
+
/** With nothing to disclose, an expand button would toggle nothing. */
|
|
525
|
+
function effectiveDisclosure(requested, hasContent, generatedId) {
|
|
526
|
+
if (!hasContent || requested.kind === "static") return {
|
|
527
|
+
disclosure: { kind: "static" },
|
|
528
|
+
contentId: void 0
|
|
529
|
+
};
|
|
530
|
+
return {
|
|
531
|
+
disclosure: requested,
|
|
532
|
+
contentId: requested.contentId ?? generatedId
|
|
533
|
+
};
|
|
534
|
+
}
|
|
535
|
+
/** An outer card hosts the deep lists inside it; a row draws inside the one it sits in. */
|
|
536
|
+
function EditorItemCard(props) {
|
|
537
|
+
const placement = useEditorItemPlacement();
|
|
538
|
+
if (placement.outer) return /* @__PURE__ */ jsx(OuterEditorItemCard, { ...props });
|
|
539
|
+
return /* @__PURE__ */ jsx(EditorItemCardView, {
|
|
540
|
+
...props,
|
|
541
|
+
row: placement.row,
|
|
542
|
+
host: null
|
|
543
|
+
});
|
|
544
|
+
}
|
|
545
|
+
function OuterEditorItemCard({ onKeyDown, ...props }) {
|
|
546
|
+
const host = useEditorItemDrillHost();
|
|
547
|
+
return /* @__PURE__ */ jsx(EditorItemCardView, {
|
|
548
|
+
...props,
|
|
549
|
+
row: false,
|
|
550
|
+
host,
|
|
551
|
+
onKeyDown: (event) => {
|
|
552
|
+
onKeyDown?.(event);
|
|
553
|
+
handleEditorItemDrillEscape(event, host);
|
|
554
|
+
}
|
|
555
|
+
});
|
|
556
|
+
}
|
|
557
|
+
function EditorItemCardView({ title, subtitle, icon, titleAdornment, state = "default", disclosure: requestedDisclosure, affordances, interactive = true, testIdPrefix = "editor-item-card", children, className, row, host, ...rootProps }) {
|
|
558
|
+
const generatedContentId = React$1.useId();
|
|
559
|
+
const hasContent = hasNode(children);
|
|
560
|
+
const { disclosure, contentId } = effectiveDisclosure(requestedDisclosure, hasContent, generatedContentId);
|
|
561
|
+
const header = host && host.stack.length > 0 ? /* @__PURE__ */ jsx(EditorItemDrillPath, {
|
|
562
|
+
drill: host,
|
|
563
|
+
testIdPrefix
|
|
564
|
+
}) : /* @__PURE__ */ jsx(EditorItemCardHeader, {
|
|
565
|
+
title,
|
|
566
|
+
subtitle,
|
|
567
|
+
icon,
|
|
568
|
+
titleAdornment,
|
|
569
|
+
disclosure,
|
|
570
|
+
contentId,
|
|
571
|
+
affordances,
|
|
572
|
+
interactive,
|
|
573
|
+
testIdPrefix,
|
|
574
|
+
row,
|
|
575
|
+
showsBody: hasContent && isOpen(disclosure)
|
|
576
|
+
});
|
|
577
|
+
return /* @__PURE__ */ jsx(Card, {
|
|
578
|
+
...rootProps,
|
|
579
|
+
size: "none",
|
|
580
|
+
...editorItemCardData(state, row),
|
|
581
|
+
className: editorItemCardClassName({
|
|
582
|
+
state,
|
|
583
|
+
row,
|
|
584
|
+
className
|
|
585
|
+
}),
|
|
586
|
+
children: /* @__PURE__ */ jsx(EditorItemCardBody, {
|
|
587
|
+
disclosure,
|
|
588
|
+
contentId,
|
|
589
|
+
header,
|
|
590
|
+
host,
|
|
591
|
+
children: hasContent ? /* @__PURE__ */ jsx(EditorItemNestedBody, {
|
|
592
|
+
title,
|
|
593
|
+
host,
|
|
594
|
+
children
|
|
595
|
+
}) : null
|
|
596
|
+
})
|
|
597
|
+
});
|
|
598
|
+
}
|
|
599
|
+
/**
|
|
600
|
+
* The card's content, and the slot a deep list draws into. While one is open
|
|
601
|
+
* the usual content stays mounted but hidden, because the open list is part
|
|
602
|
+
* of it and draws through a portal.
|
|
603
|
+
*/
|
|
604
|
+
function EditorItemCardBody({ disclosure, contentId, header, host, children }) {
|
|
605
|
+
const content = children ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("div", {
|
|
606
|
+
hidden: host !== null && host.stack.length > 0,
|
|
607
|
+
children
|
|
608
|
+
}), host ? /* @__PURE__ */ jsx(EditorItemDrillSlot, { host }) : null] }) : null;
|
|
609
|
+
if (disclosure.kind === "static") return /* @__PURE__ */ jsxs(Fragment$1, { children: [header, content] });
|
|
610
|
+
return /* @__PURE__ */ jsxs(Collapsible, {
|
|
611
|
+
open: disclosure.open,
|
|
612
|
+
onOpenChange: disclosure.onOpenChange,
|
|
613
|
+
children: [header, content ? /* @__PURE__ */ jsx(CollapsibleContent, {
|
|
614
|
+
id: contentId,
|
|
615
|
+
children: content
|
|
616
|
+
}) : null]
|
|
617
|
+
});
|
|
618
|
+
}
|
|
619
|
+
function EditorItemCardIcon({ icon, row, testIdPrefix }) {
|
|
620
|
+
if (!icon) return null;
|
|
621
|
+
return /* @__PURE__ */ jsx("span", {
|
|
622
|
+
"aria-hidden": "true",
|
|
623
|
+
className: cn("shrink-0", row ? "text-muted-foreground" : "inline-flex size-8 items-center justify-center rounded-[9px] bg-primary/10 text-primary"),
|
|
624
|
+
"data-testid": `${testIdPrefix}-icon`,
|
|
625
|
+
children: icon
|
|
626
|
+
});
|
|
627
|
+
}
|
|
628
|
+
function EditorItemCardTitle({ title, subtitle, subtitleId, row, open, testIdPrefix }) {
|
|
629
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
630
|
+
className: "block min-w-0 flex-1 overflow-hidden",
|
|
631
|
+
"data-testid": `${testIdPrefix}-title-shell`,
|
|
632
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
633
|
+
"data-slot": "card-title",
|
|
634
|
+
className: cn("line-clamp-2 break-words leading-tight", row ? "text-sm" : "text-[15px]", row && !open ? "font-medium" : "font-semibold"),
|
|
635
|
+
"data-testid": `${testIdPrefix}-title`,
|
|
636
|
+
children: title
|
|
637
|
+
}), subtitle ? /* @__PURE__ */ jsx("span", {
|
|
638
|
+
id: subtitleId,
|
|
639
|
+
className: cn("mt-0.5 block truncate text-muted-foreground", row ? "text-xs" : "text-[13px]"),
|
|
640
|
+
"data-testid": `${testIdPrefix}-subtitle`,
|
|
641
|
+
children: subtitle
|
|
642
|
+
}) : null]
|
|
643
|
+
});
|
|
644
|
+
}
|
|
645
|
+
function headerClassName(row, showsBody) {
|
|
646
|
+
return cn("flex flex-wrap items-center gap-1", row ? "py-1.5 pl-0.5 pr-1" : "py-2.5 pl-1.5 pr-2", !row && showsBody && "border-b border-border/70");
|
|
647
|
+
}
|
|
648
|
+
function EditorItemCardHeader(props) {
|
|
649
|
+
const { affordances, row, testIdPrefix } = props;
|
|
650
|
+
const full = affordances.kind === "full" ? affordances : null;
|
|
651
|
+
return /* @__PURE__ */ jsx("fieldset", {
|
|
652
|
+
className: "contents",
|
|
653
|
+
disabled: !props.interactive,
|
|
654
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
655
|
+
"data-slot": "editor-item-card-header",
|
|
656
|
+
"data-testid": `${testIdPrefix}-header`,
|
|
657
|
+
className: headerClassName(row, props.showsBody),
|
|
658
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
659
|
+
className: cn("flex min-w-0 flex-1 items-center", row ? "gap-1.5" : "gap-2"),
|
|
660
|
+
children: [full?.dragHandle, /* @__PURE__ */ jsx(EditorItemCardTrigger, { ...props })]
|
|
661
|
+
}), full?.actions ? /* @__PURE__ */ jsx(EditorItemCardActions, {
|
|
662
|
+
testId: `${testIdPrefix}-actions`,
|
|
663
|
+
...full.actions
|
|
664
|
+
}) : null]
|
|
665
|
+
})
|
|
666
|
+
});
|
|
667
|
+
}
|
|
668
|
+
/** The ids of the parts that are shown, or undefined when none are. */
|
|
669
|
+
function describedByIds(parts) {
|
|
670
|
+
const ids = parts.filter(([shown]) => Boolean(shown)).map(([, id]) => id);
|
|
671
|
+
return ids.length > 0 ? ids.join(" ") : void 0;
|
|
672
|
+
}
|
|
673
|
+
/**
|
|
674
|
+
* The title block, as the disclosure's trigger when the card opens. The
|
|
675
|
+
* trigger wraps only the title and chevron. The drag handle and actions are
|
|
676
|
+
* siblings, so using them can never toggle the card.
|
|
677
|
+
*/
|
|
678
|
+
function EditorItemCardTrigger(props) {
|
|
679
|
+
const { title, subtitle, titleAdornment, disclosure, row, testIdPrefix } = props;
|
|
680
|
+
const subtitleId = React$1.useId();
|
|
681
|
+
const adornmentId = React$1.useId();
|
|
682
|
+
const open = disclosure.kind === "collapsible" && disclosure.open;
|
|
683
|
+
const titleBlock = /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
684
|
+
/* @__PURE__ */ jsx(EditorItemCardIcon, {
|
|
685
|
+
icon: props.icon,
|
|
686
|
+
row,
|
|
687
|
+
testIdPrefix
|
|
688
|
+
}),
|
|
689
|
+
/* @__PURE__ */ jsx(EditorItemCardTitle, {
|
|
690
|
+
title,
|
|
691
|
+
subtitle,
|
|
692
|
+
subtitleId,
|
|
693
|
+
row,
|
|
694
|
+
open,
|
|
695
|
+
testIdPrefix
|
|
696
|
+
}),
|
|
697
|
+
titleAdornment ? /* @__PURE__ */ jsx("span", {
|
|
698
|
+
id: adornmentId,
|
|
699
|
+
className: "shrink-0",
|
|
700
|
+
children: titleAdornment
|
|
701
|
+
}) : null
|
|
702
|
+
] });
|
|
703
|
+
if (disclosure.kind === "static") return /* @__PURE__ */ jsx("div", {
|
|
704
|
+
className: cn("flex min-w-0 flex-1 items-center px-1 py-1", row ? "gap-2" : "gap-2.5"),
|
|
705
|
+
children: titleBlock
|
|
706
|
+
});
|
|
707
|
+
const describedBy = describedByIds([[subtitle, subtitleId], [titleAdornment, adornmentId]]);
|
|
708
|
+
return /* @__PURE__ */ jsxs("button", {
|
|
709
|
+
type: "button",
|
|
710
|
+
className: cn("flex min-w-0 flex-1 items-center rounded-md py-1 text-left outline-none transition-colors hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-wait disabled:opacity-60", row ? "gap-2" : "gap-2.5"),
|
|
711
|
+
"aria-expanded": disclosure.open,
|
|
712
|
+
"aria-controls": props.contentId,
|
|
713
|
+
"aria-label": `${disclosure.open ? "Collapse" : "Expand"} ${title}`,
|
|
714
|
+
"aria-describedby": describedBy,
|
|
715
|
+
onClick: () => disclosure.onOpenChange(!disclosure.open),
|
|
716
|
+
children: [titleBlock, /* @__PURE__ */ jsx(ChevronDown, {
|
|
717
|
+
"aria-hidden": "true",
|
|
718
|
+
className: cn("h-4 w-4 shrink-0 text-muted-foreground transition", disclosure.open && "rotate-180")
|
|
719
|
+
})]
|
|
720
|
+
});
|
|
721
|
+
}
|
|
416
722
|
//#endregion
|
|
417
723
|
//#region ../ui/src/editor-outline-row.tsx
|
|
418
724
|
function EditorOutlineRow({ title, subtitle, icon, badge, attention, selected = false, dragHandle, menu, onSelect, selectLabel, selectRef, testIdPrefix = "editor-outline-row", className, ...props }) {
|
|
@@ -2609,7 +2915,7 @@ var Root$1 = Label$1;
|
|
|
2609
2915
|
function Label({ className, ...props }) {
|
|
2610
2916
|
return /* @__PURE__ */ jsx(Root$1, {
|
|
2611
2917
|
"data-slot": "label",
|
|
2612
|
-
className: cn("flex items-center gap-2 leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50", className),
|
|
2918
|
+
className: cn("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50", className),
|
|
2613
2919
|
...props
|
|
2614
2920
|
});
|
|
2615
2921
|
}
|
|
@@ -4598,7 +4904,7 @@ function EditorNavRow({ icon, title, description, onSelect, testId }) {
|
|
|
4598
4904
|
type: "button",
|
|
4599
4905
|
onClick: onSelect,
|
|
4600
4906
|
"data-testid": testId,
|
|
4601
|
-
className: "flex w-full items-center gap-3 rounded-
|
|
4907
|
+
className: "flex w-full items-center gap-3 rounded-xl border bg-card px-3.5 py-3 text-left transition-colors hover:border-foreground/25 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring [&>svg:first-child]:h-[18px] [&>svg:first-child]:w-[18px]",
|
|
4602
4908
|
children: [
|
|
4603
4909
|
icon,
|
|
4604
4910
|
/* @__PURE__ */ jsxs("span", {
|
|
@@ -9460,32 +9766,23 @@ function BlockSourceLine({ source, siteId, dashboardBaseUrl = "", getValue = ()
|
|
|
9460
9766
|
//#region ../block-form/src/widgets/LookField.tsx
|
|
9461
9767
|
function LookField({ config, path, backend }) {
|
|
9462
9768
|
const { value, setValue, error } = useField(path, backend);
|
|
9769
|
+
const current = value ?? config.defaultValue;
|
|
9463
9770
|
return /* @__PURE__ */ jsx(FieldFrame, {
|
|
9464
9771
|
label: config.label,
|
|
9465
9772
|
description: config.description,
|
|
9466
9773
|
required: config.required,
|
|
9467
9774
|
error: error?.message,
|
|
9468
|
-
children: ({ id,
|
|
9775
|
+
children: ({ id, describedBy }) => /* @__PURE__ */ jsx(ChoiceTileGroup, {
|
|
9469
9776
|
id,
|
|
9470
|
-
|
|
9471
|
-
|
|
9472
|
-
"aria-describedby": messageId,
|
|
9473
|
-
className: "grid grid-cols-2 gap-2",
|
|
9777
|
+
label: config.label,
|
|
9778
|
+
describedBy,
|
|
9474
9779
|
"data-field-path": path,
|
|
9475
|
-
|
|
9476
|
-
|
|
9477
|
-
|
|
9478
|
-
"aria-checked": (value ?? config.defaultValue) === option.value,
|
|
9479
|
-
className: lookOptionClass((value ?? config.defaultValue) === option.value),
|
|
9480
|
-
onClick: () => setValue(option.value),
|
|
9481
|
-
children: option.label
|
|
9482
|
-
}, option.value))
|
|
9780
|
+
options: config.options,
|
|
9781
|
+
value: typeof current === "string" ? current : null,
|
|
9782
|
+
onValueChange: setValue
|
|
9483
9783
|
})
|
|
9484
9784
|
});
|
|
9485
9785
|
}
|
|
9486
|
-
function lookOptionClass(selected) {
|
|
9487
|
-
return ["min-h-10 rounded-md border px-2.5 py-2 text-left text-xs font-medium leading-4 text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", selected ? "border-foreground ring-1 ring-foreground" : "border-border bg-background hover:bg-muted"].join(" ");
|
|
9488
|
-
}
|
|
9489
9786
|
//#endregion
|
|
9490
9787
|
//#region ../block-form/src/widgets/RepeaterField/components/layoutGridDomain.ts
|
|
9491
9788
|
const MIN_GRID_UNIT = 1;
|
|
@@ -12890,7 +13187,7 @@ function getLayoutGridItemFields(config, backend, rowPath) {
|
|
|
12890
13187
|
function getGridGapClassName(density) {
|
|
12891
13188
|
return density === "compact" ? "gap-3" : "gap-4";
|
|
12892
13189
|
}
|
|
12893
|
-
function RepeaterLayoutGrid({ config, backend, basePath, items, minItems, onMove, onRemove, renderChild, presentation, onCapacityContextChange }) {
|
|
13190
|
+
function RepeaterLayoutGrid({ config, backend, basePath, items, minItems, onMove, onRemove, renderChild, presentation, onCapacityContextChange, mediaPickerAutoOpenRequest, onMediaPickerAutoOpenHandled }) {
|
|
12894
13191
|
const { containerRef, containerWidth, breakpoint, canUsePointerDrag: canDrag } = useRepeaterPointerDragCapability(items.length);
|
|
12895
13192
|
const hiddenDetailFieldIds = useMemo(() => /* @__PURE__ */ new Set([presentation.rowField, presentation.columnField]), [presentation.columnField, presentation.rowField]);
|
|
12896
13193
|
const values = backend.getValues();
|
|
@@ -12998,7 +13295,7 @@ function RepeaterLayoutGrid({ config, backend, basePath, items, minItems, onMove
|
|
|
12998
13295
|
onMove
|
|
12999
13296
|
]);
|
|
13000
13297
|
const removeGridItem = (index) => {
|
|
13001
|
-
if (layout.placementPolicy === "flow"
|
|
13298
|
+
if (layout.placementPolicy === "flow") {
|
|
13002
13299
|
const [first, ...rest] = flowRepeaterGridItems(layoutItems.filter((item) => item.id !== items[index]?.id), layout.columns);
|
|
13003
13300
|
if (first) applyGridMove({
|
|
13004
13301
|
kind: "move",
|
|
@@ -13161,7 +13458,9 @@ function RepeaterLayoutGrid({ config, backend, basePath, items, minItems, onMove
|
|
|
13161
13458
|
onMoveUp: () => moveItemToAdjacentVisualSlot(placement.id, -1),
|
|
13162
13459
|
onMoveDown: () => moveItemToAdjacentVisualSlot(placement.id, 1),
|
|
13163
13460
|
disableMoveUp: !moveAvailability?.canMoveEarlier,
|
|
13164
|
-
disableMoveDown: !moveAvailability?.canMoveLater
|
|
13461
|
+
disableMoveDown: !moveAvailability?.canMoveLater,
|
|
13462
|
+
mediaPickerAutoOpenRequest: mediaPickerAutoOpenRequest?.targetIndex === index ? { requestId: mediaPickerAutoOpenRequest.requestId } : null,
|
|
13463
|
+
onMediaPickerAutoOpenHandled
|
|
13165
13464
|
})
|
|
13166
13465
|
})
|
|
13167
13466
|
}, placement.id);
|
|
@@ -13295,6 +13594,7 @@ function RepeaterField({ path, backend, config, renderChild }) {
|
|
|
13295
13594
|
const registeredHostActions = useRepeaterHostActions(path);
|
|
13296
13595
|
const fieldState = backend.getFieldState(path);
|
|
13297
13596
|
const isVisible = useRepeaterVisibility(config, backend, path);
|
|
13597
|
+
const focusPath = useFormFocusPath();
|
|
13298
13598
|
const presentation = resolveRepeaterPresentation(config);
|
|
13299
13599
|
const polymorphicWarnOnceRef = useRef(false);
|
|
13300
13600
|
const labelFieldWarnOnceRef = useRef(false);
|
|
@@ -13361,6 +13661,9 @@ function RepeaterField({ path, backend, config, renderChild }) {
|
|
|
13361
13661
|
index: nextIndex
|
|
13362
13662
|
};
|
|
13363
13663
|
};
|
|
13664
|
+
const handleMediaPickerAutoOpenHandled = (requestId) => {
|
|
13665
|
+
setMediaPickerAutoOpenRequest((current) => current?.requestId === requestId ? null : current);
|
|
13666
|
+
};
|
|
13364
13667
|
const handleMove = (from, to) => {
|
|
13365
13668
|
if (to < 0 || to >= repeaterOps.items.length) return;
|
|
13366
13669
|
repeaterOps.move(from, to);
|
|
@@ -13371,73 +13674,77 @@ function RepeaterField({ path, backend, config, renderChild }) {
|
|
|
13371
13674
|
if (!isVisible || !renderChild) return null;
|
|
13372
13675
|
return /* @__PURE__ */ jsxs("div", {
|
|
13373
13676
|
"data-field-path": path,
|
|
13374
|
-
children: [
|
|
13375
|
-
|
|
13376
|
-
|
|
13377
|
-
|
|
13378
|
-
|
|
13379
|
-
|
|
13380
|
-
|
|
13381
|
-
|
|
13382
|
-
|
|
13383
|
-
|
|
13384
|
-
|
|
13385
|
-
|
|
13386
|
-
|
|
13387
|
-
|
|
13388
|
-
|
|
13389
|
-
|
|
13390
|
-
|
|
13391
|
-
|
|
13392
|
-
|
|
13393
|
-
|
|
13394
|
-
|
|
13395
|
-
|
|
13396
|
-
|
|
13397
|
-
|
|
13398
|
-
|
|
13399
|
-
|
|
13400
|
-
|
|
13401
|
-
|
|
13402
|
-
|
|
13403
|
-
|
|
13404
|
-
|
|
13405
|
-
|
|
13406
|
-
|
|
13407
|
-
|
|
13408
|
-
|
|
13409
|
-
|
|
13410
|
-
|
|
13411
|
-
|
|
13412
|
-
|
|
13413
|
-
|
|
13414
|
-
|
|
13415
|
-
|
|
13416
|
-
|
|
13417
|
-
|
|
13418
|
-
|
|
13419
|
-
|
|
13420
|
-
|
|
13421
|
-
|
|
13422
|
-
|
|
13423
|
-
|
|
13424
|
-
|
|
13425
|
-
|
|
13426
|
-
|
|
13427
|
-
|
|
13428
|
-
|
|
13429
|
-
|
|
13430
|
-
|
|
13431
|
-
|
|
13677
|
+
children: [/* @__PURE__ */ jsx(RepeaterHeader, {
|
|
13678
|
+
label: shownLabel(config),
|
|
13679
|
+
description: config.description,
|
|
13680
|
+
required: config.required
|
|
13681
|
+
}), /* @__PURE__ */ jsxs(EditorItemNestedList, {
|
|
13682
|
+
label: config.label,
|
|
13683
|
+
itemCount: repeaterOps.items.length,
|
|
13684
|
+
revealed: focusPathIsWithin(focusPath, path),
|
|
13685
|
+
children: [
|
|
13686
|
+
useLayoutGrid ? /* @__PURE__ */ jsx(RepeaterLayoutGrid, {
|
|
13687
|
+
config,
|
|
13688
|
+
backend,
|
|
13689
|
+
basePath: path,
|
|
13690
|
+
items: repeaterOps.items,
|
|
13691
|
+
minItems,
|
|
13692
|
+
onMove: handleMove,
|
|
13693
|
+
onRemove: handleRemove,
|
|
13694
|
+
renderChild,
|
|
13695
|
+
presentation,
|
|
13696
|
+
onCapacityContextChange: onLayoutGridCapacityContextChange,
|
|
13697
|
+
mediaPickerAutoOpenRequest,
|
|
13698
|
+
onMediaPickerAutoOpenHandled: handleMediaPickerAutoOpenHandled
|
|
13699
|
+
}) : useThumbnailGrid ? /* @__PURE__ */ jsx(RepeaterThumbnailGrid, {
|
|
13700
|
+
config,
|
|
13701
|
+
backend,
|
|
13702
|
+
basePath: path,
|
|
13703
|
+
items: repeaterOps.items,
|
|
13704
|
+
minItems,
|
|
13705
|
+
onAdd: () => handleAdd(void 0, { kind: "open-thumbnail-media-picker" }),
|
|
13706
|
+
mediaPickerAutoOpenRequest,
|
|
13707
|
+
onMediaPickerAutoOpenHandled: handleMediaPickerAutoOpenHandled,
|
|
13708
|
+
onMove: handleMove,
|
|
13709
|
+
onRemove: handleRemove,
|
|
13710
|
+
renderChild,
|
|
13711
|
+
presentation
|
|
13712
|
+
}) : showHostEmptyState ? /* @__PURE__ */ jsx("div", {
|
|
13713
|
+
ref: emptyStateRef,
|
|
13714
|
+
children: hostActions.emptyState
|
|
13715
|
+
}) : /* @__PURE__ */ jsx(RepeaterList, {
|
|
13716
|
+
config,
|
|
13717
|
+
backend,
|
|
13718
|
+
basePath: path,
|
|
13719
|
+
items: repeaterOps.items,
|
|
13720
|
+
minItems,
|
|
13721
|
+
maxItems,
|
|
13722
|
+
onMove: handleMove,
|
|
13723
|
+
onRemove: handleRemove,
|
|
13724
|
+
renderChild,
|
|
13725
|
+
focusFallbackRef: addButtonRef,
|
|
13726
|
+
hostActions
|
|
13727
|
+
}),
|
|
13728
|
+
showAddControls ? /* @__PURE__ */ jsx(RepeaterAddControls, {
|
|
13729
|
+
buttonRef: addButtonRef,
|
|
13730
|
+
disabled: addDisabled,
|
|
13731
|
+
config,
|
|
13732
|
+
hostActions,
|
|
13733
|
+
canAddType: (typeKey) => !useLayoutGrid || Boolean(polymorphicTypeCanAdd.get(typeKey)),
|
|
13734
|
+
onAdd: (typeKey) => {
|
|
13735
|
+
if (!typeKey && hostActions.requestAdd) {
|
|
13736
|
+
hostActions.requestAdd(repeaterOps.items.length);
|
|
13737
|
+
return;
|
|
13738
|
+
}
|
|
13739
|
+
handleAdd(typeKey, useLayoutGrid ? { kind: "open-thumbnail-media-picker" } : noAddFollowUp);
|
|
13432
13740
|
}
|
|
13433
|
-
|
|
13434
|
-
|
|
13435
|
-
|
|
13436
|
-
|
|
13437
|
-
|
|
13438
|
-
|
|
13439
|
-
|
|
13440
|
-
]
|
|
13741
|
+
}) : null,
|
|
13742
|
+
/* @__PURE__ */ jsx(RepeaterError, {
|
|
13743
|
+
error: fieldState.error,
|
|
13744
|
+
fieldPath: path
|
|
13745
|
+
})
|
|
13746
|
+
]
|
|
13747
|
+
})]
|
|
13441
13748
|
});
|
|
13442
13749
|
}
|
|
13443
13750
|
/** Host actions apply to plain stacked lists of one item type only. */
|
|
@@ -22218,7 +22525,7 @@ function BackgroundGradientWidget({ label, value, onChange, description, error,
|
|
|
22218
22525
|
"aria-label": `${preset.name}, ${kindLabel} gradient`,
|
|
22219
22526
|
"aria-pressed": isSelected,
|
|
22220
22527
|
onClick: () => handleSelectPreset(preset.id),
|
|
22221
|
-
className: cn("group flex flex-col gap-2 rounded-md border p-2 text-left transition", isSelected ?
|
|
22528
|
+
className: cn("group flex flex-col gap-2 rounded-md border p-2 text-left transition", isSelected ? CHOSEN_OPTION_CLASS : "border-muted-foreground/30 bg-background hover:bg-muted/40"),
|
|
22222
22529
|
children: [/* @__PURE__ */ jsx("span", {
|
|
22223
22530
|
"aria-hidden": "true",
|
|
22224
22531
|
className: "h-16 w-full rounded-sm",
|
|
@@ -22425,7 +22732,7 @@ function BlockForm({ siteId, block, manifest, uiStore, hasRecoveryConflict = fal
|
|
|
22425
22732
|
onBlurCapture: (event) => {
|
|
22426
22733
|
const root = formRootRef.current;
|
|
22427
22734
|
const nextTarget = event.relatedTarget;
|
|
22428
|
-
if (!root || !(nextTarget instanceof HTMLElement) || !root
|
|
22735
|
+
if (!root || !(nextTarget instanceof HTMLElement) || !formContains(root, nextTarget)) {
|
|
22429
22736
|
uiStore.getState().setActivePreviewField(null);
|
|
22430
22737
|
return;
|
|
22431
22738
|
}
|
|
@@ -22483,7 +22790,7 @@ function useBlockFormFocus({ enabled, focusSignal, formRootRef, onFocusHandled }
|
|
|
22483
22790
|
const timer = window.setTimeout(() => {
|
|
22484
22791
|
const root = formRootRef.current;
|
|
22485
22792
|
if (!root) return onFocusHandled?.(focusSignal.requestId);
|
|
22486
|
-
const target = path ? root
|
|
22793
|
+
const target = path ? findInForm(root, `[data-field-path="${path}"]`) ?? root : root;
|
|
22487
22794
|
const disclosure = target.closest("details");
|
|
22488
22795
|
if (disclosure) disclosure.open = true;
|
|
22489
22796
|
try {
|
|
@@ -22507,6 +22814,16 @@ function useBlockFormFocus({ enabled, focusSignal, formRootRef, onFocusHandled }
|
|
|
22507
22814
|
onFocusHandled
|
|
22508
22815
|
]);
|
|
22509
22816
|
}
|
|
22817
|
+
function formContains(root, node) {
|
|
22818
|
+
return editorItemFormSurfaces(root).some((surface) => surface.contains(node));
|
|
22819
|
+
}
|
|
22820
|
+
function findInForm(root, selector) {
|
|
22821
|
+
for (const surface of editorItemFormSurfaces(root)) {
|
|
22822
|
+
const found = surface.querySelector(selector);
|
|
22823
|
+
if (found) return found;
|
|
22824
|
+
}
|
|
22825
|
+
return null;
|
|
22826
|
+
}
|
|
22510
22827
|
function normalizeFocusPath(path) {
|
|
22511
22828
|
if (!path) return null;
|
|
22512
22829
|
return (path.startsWith("content.") ? path.slice(8) : path).replace(/\[(\d+)\]/g, ".$1");
|
|
@@ -22514,7 +22831,7 @@ function normalizeFocusPath(path) {
|
|
|
22514
22831
|
function resolvePreviewFieldPathForTarget(target, root) {
|
|
22515
22832
|
if (!(target instanceof HTMLElement)) return null;
|
|
22516
22833
|
const fieldElement = target.closest("[data-field-path]");
|
|
22517
|
-
if (!fieldElement || !root
|
|
22834
|
+
if (!fieldElement || !formContains(root, fieldElement)) return null;
|
|
22518
22835
|
const fieldPath = fieldElement.dataset.fieldPath;
|
|
22519
22836
|
if (!fieldPath) return null;
|
|
22520
22837
|
const normalizedPath = normalizeFocusPath(fieldPath);
|
|
@@ -23314,7 +23631,7 @@ function FeatureCardIconsPanel({ block, uiStore, currentStyleGuideVersionId, ico
|
|
|
23314
23631
|
//#region ../editor-blocks/src/block-editor/BlockCardBody.tsx
|
|
23315
23632
|
function BlockCardBody({ siteId, renderPreviewLink, block, manifest, uiStore, hasRecoveryConflict, focusSignal, onFocusHandled, onBlockSave, theme, widgetOverrides, hideThemeV2RawStyleFields = false, pageDesignBlock = null, currentStyleGuideVersionId, iconStyleGuideSummary, iconStyleGuideEditHref, onGenerateIconSet }) {
|
|
23316
23633
|
return /* @__PURE__ */ jsxs(CardContent, {
|
|
23317
|
-
className: "space-y-4 pb-6 max-sm:px-3 max-sm:pb-3",
|
|
23634
|
+
className: "space-y-4 pb-6 pt-5 max-sm:px-3 max-sm:pb-3 max-sm:pt-4",
|
|
23318
23635
|
children: [/* @__PURE__ */ jsx(FeatureCardIconsPanel, {
|
|
23319
23636
|
block,
|
|
23320
23637
|
uiStore,
|
|
@@ -28432,6 +28749,10 @@ function sourceAvailability(input) {
|
|
|
28432
28749
|
hasEngagementSource: input.hasEngagementSource ?? false
|
|
28433
28750
|
};
|
|
28434
28751
|
}
|
|
28752
|
+
function missingSourceStatus(section) {
|
|
28753
|
+
if (section.kind === "supporting-text" || section.kind === "legal") return "Add text to show this section on the public site.";
|
|
28754
|
+
return section.kind === "legal-navigation" ? "Shows on the public site once you add a legal link." : "Hidden on the public site until its details are added.";
|
|
28755
|
+
}
|
|
28435
28756
|
function sectionPlan(section, selected, missingSource, canEdit) {
|
|
28436
28757
|
const actions = canEdit ? [
|
|
28437
28758
|
"edit",
|
|
@@ -28445,7 +28766,7 @@ function sectionPlan(section, selected, missingSource, canEdit) {
|
|
|
28445
28766
|
selected,
|
|
28446
28767
|
source: sourceFor(section),
|
|
28447
28768
|
availability: missingSource ? "missing-source" : "ready",
|
|
28448
|
-
status: missingSource ? section
|
|
28769
|
+
status: missingSource ? missingSourceStatus(section) : null,
|
|
28449
28770
|
actions
|
|
28450
28771
|
};
|
|
28451
28772
|
}
|
|
@@ -32761,7 +33082,7 @@ function LookChoiceTile({ tile, colours, onChoose, defaultBadge = "Default" }) {
|
|
|
32761
33082
|
"aria-pressed": tile.selected,
|
|
32762
33083
|
onClick: () => onChoose(tile.pin),
|
|
32763
33084
|
"aria-description": tile.isDefault && tile.key !== "style-default" ? defaultBadge : void 0,
|
|
32764
|
-
className: cn("relative flex min-w-0 flex-col gap-1.5 rounded-[14px] border bg-card p-1.5 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", tile.selected ?
|
|
33085
|
+
className: cn("relative flex min-w-0 flex-col gap-1.5 rounded-[14px] border bg-card p-1.5 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", tile.selected ? CHOSEN_OPTION_CLASS : "border-border hover:border-foreground/30"),
|
|
32765
33086
|
children: [
|
|
32766
33087
|
tile.thumbnail ? /* @__PURE__ */ jsx(LookThumbnailView, {
|
|
32767
33088
|
thumbnail: tile.thumbnail,
|
|
@@ -33523,7 +33844,7 @@ function ButtonHoverRoleEditor({ id, role, groupName, control, current, preferen
|
|
|
33523
33844
|
}
|
|
33524
33845
|
function HoverChoice({ role, groupName, parameter, value, label, checked, current, onPreview }) {
|
|
33525
33846
|
return /* @__PURE__ */ jsxs("label", {
|
|
33526
|
-
className: cn("flex cursor-pointer items-center gap-2 rounded-md border px-2 py-2 text-xs has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-ring", checked ?
|
|
33847
|
+
className: cn("flex cursor-pointer items-center gap-2 rounded-md border px-2 py-2 text-xs has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-ring", checked ? CHOSEN_OPTION_CLASS : "border-border"),
|
|
33527
33848
|
children: [/* @__PURE__ */ jsx("input", {
|
|
33528
33849
|
type: "radio",
|
|
33529
33850
|
"data-testid": `button-hover-choice-${role}-${value ?? "recommended"}`,
|
|
@@ -33582,7 +33903,7 @@ function ButtonStylePicker({ selections, current, previewTheme, onPreview, disab
|
|
|
33582
33903
|
const optionRecipe = findButtonStyleRecipe(selection.styleId);
|
|
33583
33904
|
const selected = selection.styleId === current.styleId;
|
|
33584
33905
|
return /* @__PURE__ */ jsxs("label", {
|
|
33585
|
-
className: cn("relative block cursor-pointer rounded-md border p-2 transition has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-ring has-[:focus-visible]:ring-offset-2", selected ?
|
|
33906
|
+
className: cn("relative block cursor-pointer rounded-md border p-2 transition has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-ring has-[:focus-visible]:ring-offset-2", selected ? CHOSEN_OPTION_CLASS : "border-border bg-background hover:border-foreground/40 hover:bg-accent/20", disabled && "cursor-not-allowed opacity-60"),
|
|
33586
33907
|
children: [
|
|
33587
33908
|
/* @__PURE__ */ jsx("input", {
|
|
33588
33909
|
type: "radio",
|
|
@@ -33634,7 +33955,7 @@ function ButtonStyleChoiceControl({ control, current, onPreview, disabled }) {
|
|
|
33634
33955
|
}), /* @__PURE__ */ jsx("div", {
|
|
33635
33956
|
className: "grid grid-cols-2 gap-2",
|
|
33636
33957
|
children: control.options.map((option) => /* @__PURE__ */ jsxs("label", {
|
|
33637
|
-
className: cn("relative cursor-pointer rounded-md border px-2 py-1.5 text-center text-xs has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-ring has-[:focus-visible]:ring-offset-2", currentValue === option.value ?
|
|
33958
|
+
className: cn("relative cursor-pointer rounded-md border px-2 py-1.5 text-center text-xs has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-ring has-[:focus-visible]:ring-offset-2", currentValue === option.value ? CHOSEN_OPTION_CLASS : "border-border hover:border-foreground/40"),
|
|
33638
33959
|
children: [/* @__PURE__ */ jsx("input", {
|
|
33639
33960
|
type: "radio",
|
|
33640
33961
|
name: `button-style-${current.styleId}-${control.parameter}`,
|
|
@@ -33787,7 +34108,7 @@ function PickerOption({ selected, label, description, swatch, onSelect, disabled
|
|
|
33787
34108
|
"aria-checked": selected,
|
|
33788
34109
|
onClick: onSelect,
|
|
33789
34110
|
disabled,
|
|
33790
|
-
className: cn("flex w-full items-center gap-3 rounded-md border px-3 py-2 text-left transition", selected ?
|
|
34111
|
+
className: cn("flex w-full items-center gap-3 rounded-md border px-3 py-2 text-left transition", selected ? CHOSEN_OPTION_CLASS : "border-transparent bg-background hover:border-foreground/40 hover:bg-accent/20", disabled && "cursor-not-allowed opacity-60"),
|
|
33791
34112
|
children: [swatch ? /* @__PURE__ */ jsx("span", {
|
|
33792
34113
|
className: "h-5 w-5 shrink-0 rounded-full border border-black/10",
|
|
33793
34114
|
style: { backgroundColor: swatch },
|
|
@@ -34658,18 +34979,12 @@ function TypographyColorTokenControl({ value, onChange, disabled }) {
|
|
|
34658
34979
|
" (outside quick choices)"
|
|
34659
34980
|
]
|
|
34660
34981
|
}) : null
|
|
34661
|
-
] }), /* @__PURE__ */ jsx(
|
|
34662
|
-
|
|
34663
|
-
|
|
34664
|
-
|
|
34665
|
-
|
|
34666
|
-
|
|
34667
|
-
className: "justify-start text-xs",
|
|
34668
|
-
"aria-pressed": value.kind === "curated" && value.value === option.value,
|
|
34669
|
-
onClick: () => onChange(option.value),
|
|
34670
|
-
disabled,
|
|
34671
|
-
children: option.label
|
|
34672
|
-
}, option.value))
|
|
34982
|
+
] }), /* @__PURE__ */ jsx(ChoiceTileGroup, {
|
|
34983
|
+
label: "Default heading color",
|
|
34984
|
+
options: headingColorTokenOptions,
|
|
34985
|
+
value: value.kind === "curated" ? value.value : null,
|
|
34986
|
+
onValueChange: onChange,
|
|
34987
|
+
disabled
|
|
34673
34988
|
})]
|
|
34674
34989
|
});
|
|
34675
34990
|
}
|
|
@@ -35645,7 +35960,7 @@ function CuratedPaletteGroup({ label, items, selectedValueKey, offset, optionPro
|
|
|
35645
35960
|
type: "button",
|
|
35646
35961
|
"aria-label": `${item.name}. ${item.description}`,
|
|
35647
35962
|
disabled,
|
|
35648
|
-
className: cn("relative h-10 overflow-hidden rounded-md border p-0.5 outline-none transition focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50", item.valueKey === selectedValueKey ?
|
|
35963
|
+
className: cn("relative h-10 overflow-hidden rounded-md border p-0.5 outline-none transition focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50", item.valueKey === selectedValueKey ? CHOSEN_OPTION_CLASS : "border-border hover:border-foreground/60"),
|
|
35649
35964
|
children: [/* @__PURE__ */ jsx("span", {
|
|
35650
35965
|
className: "grid h-full grid-cols-5 overflow-hidden rounded-[3px]",
|
|
35651
35966
|
"aria-hidden": "true",
|
|
@@ -35862,7 +36177,7 @@ function SelectedBlockModeControl(props) {
|
|
|
35862
36177
|
role: "radio",
|
|
35863
36178
|
"aria-checked": mode.current === option.mode,
|
|
35864
36179
|
onClick: () => toolbar.chooseMode(option.mode),
|
|
35865
|
-
className: `flex-1 truncate rounded-full px-2 py-1.5 text-[13px] font-semibold focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring ${mode.current === option.mode ? "bg-
|
|
36180
|
+
className: `flex-1 truncate rounded-full px-2 py-1.5 text-[13px] font-semibold focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring ${mode.current === option.mode ? "bg-primary text-primary-foreground" : "text-foreground hover:bg-background/70"}`,
|
|
35866
36181
|
children: option.label
|
|
35867
36182
|
}, option.mode))
|
|
35868
36183
|
})]
|
|
@@ -36173,7 +36488,7 @@ function Choice({ label, chosen, chip = false, onChoose }) {
|
|
|
36173
36488
|
role: "radio",
|
|
36174
36489
|
"aria-checked": chosen,
|
|
36175
36490
|
onClick: onChoose,
|
|
36176
|
-
className: cn("truncate rounded-full text-[13px] font-semibold focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", chip ? "border px-2.5 py-1" : "flex-1 px-2 py-1.5", chosen ? "
|
|
36491
|
+
className: cn("truncate rounded-full text-[13px] font-semibold focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", chip ? "border px-2.5 py-1" : "flex-1 px-2 py-1.5", chosen ? chip ? CHOSEN_OPTION_CLASS : "bg-primary text-primary-foreground" : chip ? "border-border hover:bg-muted" : "text-foreground hover:bg-background/70"),
|
|
36177
36492
|
children: label
|
|
36178
36493
|
});
|
|
36179
36494
|
}
|