@riverbankcms/sdk 0.80.0 → 0.81.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{PreviewEditorSidebar-QZG37QIF.mjs → PreviewEditorSidebar-RDCMEXIJ.mjs} +763 -255
- package/dist/{PreviewEditorUI-AXIKSMZA.mjs → PreviewEditorUI-NYGQ6K7B.mjs} +170 -29
- package/dist/SdkPreviewModeRuntime-AKCSCZEC.mjs +8 -0
- package/dist/_dts/api/src/contentRuntime.d.ts +12 -0
- package/dist/_dts/api/src/contentTypes.d.ts +6 -0
- package/dist/_dts/api/src/index.d.ts +2 -2
- package/dist/_dts/api/src/publicExperienceEndpoints.d.ts +53 -0
- package/dist/_dts/block-form/src/backend/store-backend.d.ts +3 -1
- package/dist/_dts/block-form/src/backend/types.d.ts +3 -3
- package/dist/_dts/blocks/src/PageRenderer.d.ts +3 -0
- package/dist/_dts/blocks/src/contracts/proof-block-islands.d.ts +20 -28
- package/dist/_dts/blocks/src/index.d.ts +6 -4
- package/dist/_dts/blocks/src/primitives/content/components/Text.d.ts +1 -1
- package/dist/_dts/blocks/src/primitives/content/primitives.d.ts +1 -0
- package/dist/_dts/blocks/src/server.d.ts +1 -1
- package/dist/_dts/blocks/src/system/blocks/events/event-calendar.d.ts +3 -2
- package/dist/_dts/blocks/src/system/blocks/events/shared/schemas.d.ts +135 -0
- package/dist/_dts/blocks/src/system/blocks/events/shared/types.d.ts +5 -0
- package/dist/_dts/blocks/src/system/blocks/feature-cards.d.ts +2 -0
- package/dist/_dts/blocks/src/system/blocks/form.d.ts +20 -1
- package/dist/_dts/blocks/src/system/blocks/hero.d.ts +2 -0
- package/dist/_dts/blocks/src/system/blocks/offerings-preview/index.d.ts +19 -0
- package/dist/_dts/blocks/src/system/blocks/offerings-preview/model.d.ts +134 -0
- package/dist/_dts/blocks/src/system/componentFactory.d.ts +1 -0
- package/dist/_dts/blocks/src/system/constants/background.d.ts +1 -1
- package/dist/_dts/blocks/src/system/constants/blockKinds.d.ts +1 -1
- package/dist/_dts/blocks/src/system/customize/backgrounds.d.ts +13 -3
- package/dist/_dts/blocks/src/system/data/index.d.ts +2 -0
- package/dist/_dts/blocks/src/system/data/linkedContentEntries.d.ts +64 -0
- package/dist/_dts/blocks/src/system/data/loaderEndpoints.d.ts +1 -1
- package/dist/_dts/blocks/src/system/designCapabilities.d.ts +2 -2
- package/dist/_dts/blocks/src/system/fields/boxStyles.d.ts +6 -1
- package/dist/_dts/blocks/src/system/fragments/library/faqHeading.d.ts +0 -1
- package/dist/_dts/blocks/src/system/media/slotContracts.d.ts +2 -0
- package/dist/_dts/blocks/src/system/node/types.d.ts +8 -1
- package/dist/_dts/blocks/src/system/node/validation-constants.d.ts +1 -1
- package/dist/_dts/blocks/src/system/registry.d.ts +1 -0
- package/dist/_dts/blocks/src/system/runtime/components/registry.client.d.ts +44 -50
- package/dist/_dts/blocks/src/system/runtime/components/runtime-backed-blocks.d.ts +21 -24
- package/dist/_dts/blocks/src/system/runtime/headingDecoration.d.ts +21 -0
- package/dist/_dts/blocks/src/system/runtime/hooks/useCalendarEvents.d.ts +45 -14
- package/dist/_dts/blocks/src/system/runtime/hooks/useEventFilters.d.ts +2 -9
- package/dist/_dts/blocks/src/system/runtime/hooks/useEventPagination.d.ts +1 -10
- package/dist/_dts/blocks/src/system/runtime/nodes/basic.d.ts +1 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/events/EventCalendar.interactive.d.ts +21 -16
- package/dist/_dts/blocks/src/system/runtime/nodes/events/EventCombined.client.d.ts +3 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/events/EventCombined.interactive.d.ts +21 -16
- package/dist/_dts/blocks/src/system/runtime/nodes/events/EventListing.interactive.d.ts +17 -28
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/EventPaginatedListView.client.d.ts +2 -3
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/WeekAgendaView.d.ts +3 -3
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/listOptions.d.ts +50 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/utils.d.ts +2 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/media.d.ts +29 -14
- package/dist/_dts/blocks/src/system/runtime/nodes/offerings-preview.d.ts +21 -0
- package/dist/_dts/blocks/src/system/runtime/resolver.d.ts +7 -0
- package/dist/_dts/blocks/src/system/transforms/registry/_utils/sectionForegroundStyles.d.ts +2 -0
- package/dist/_dts/blocks/src/system/transforms/registry/boxStyles.d.ts +4 -2
- package/dist/_dts/calendar/src/grid.d.ts +27 -0
- package/dist/_dts/calendar/src/index.d.ts +2 -2
- package/dist/_dts/content-editor/src/controller/useAutosaveTriggers.d.ts +3 -1
- package/dist/_dts/content-editor/src/editorTransactionState.d.ts +1 -0
- package/dist/_dts/content-editor/src/hooks/autosaveScopePlanning.d.ts +26 -0
- package/dist/_dts/content-editor/src/hooks/publishability.d.ts +1 -0
- package/dist/_dts/content-editor/src/hooks/useLinkedEntryAutosave.d.ts +23 -0
- package/dist/_dts/content-editor/src/hooks/useReactiveToolbar.d.ts +1 -1
- package/dist/_dts/content-editor/src/hooks/useSimpleAutosave.d.ts +2 -2
- package/dist/_dts/content-editor/src/index.d.ts +3 -1
- package/dist/_dts/content-editor/src/lib/json.d.ts +2 -0
- package/dist/_dts/content-editor/src/linkedEntries/domain.d.ts +8 -0
- package/dist/_dts/content-editor/src/ui/editorSnapshot.d.ts +58 -0
- package/dist/_dts/content-editor/src/ui/editorTransactionState.d.ts +93 -0
- package/dist/_dts/content-editor/src/ui/editorUiStore.d.ts +60 -3
- package/dist/_dts/content-editor/src/ui/stores/autosaveStore.d.ts +2 -0
- package/dist/_dts/content-editor/src/ui/stores/types.d.ts +1 -1
- package/dist/_dts/content-model/src/content-types/builtins.d.ts +43 -0
- package/dist/_dts/content-model/src/metadataConfig.d.ts +87 -47
- package/dist/_dts/core/src/branded.d.ts +5 -0
- package/dist/_dts/core/src/index.d.ts +1 -0
- package/dist/_dts/core/src/stable-json.d.ts +1 -0
- package/dist/_dts/editor/src/EditorProvider.d.ts +26 -0
- package/dist/_dts/editor/src/chrome/EditorChrome.d.ts +26 -0
- package/dist/_dts/editor/src/chrome/EditorStatusBar.d.ts +45 -0
- package/dist/_dts/editor/src/chrome/statusBarPresentation.d.ts +25 -0
- package/dist/_dts/editor/src/components/EditingToggle.d.ts +9 -0
- package/dist/_dts/editor/src/hooks/useEditableElement.d.ts +18 -0
- package/dist/_dts/editor/src/index.d.ts +29 -0
- package/dist/_dts/editor/src/inline/InlineTextEditor.d.ts +1 -0
- package/dist/_dts/editor/src/lib/utils.d.ts +1 -0
- package/dist/_dts/editor/src/primitives/EditorPrimitivesProvider.d.ts +20 -0
- package/dist/_dts/editor/src/primitives/InlineFieldContext.d.ts +11 -0
- package/dist/_dts/editor/src/primitives/SaveContext.d.ts +12 -0
- package/dist/_dts/editor/src/primitives/helpers.d.ts +1 -0
- package/dist/_dts/editor/src/primitives/rich-text/RichTextEditorSurface.d.ts +26 -0
- package/dist/_dts/editor/src/primitives/rich-text/RichTextToolbar.d.ts +16 -0
- package/dist/_dts/editor/src/primitives/rich-text/config.d.ts +23 -0
- package/dist/_dts/editor/src/primitives/rich-text/extensions/RichTextImage.d.ts +2 -0
- package/dist/_dts/editor/src/primitives/rich-text/extensions/RichTextLink.d.ts +1 -0
- package/dist/_dts/editor/src/primitives/rich-text/imageActions.d.ts +22 -0
- package/dist/_dts/editor/src/primitives/rich-text/sanitize.d.ts +23 -0
- package/dist/_dts/editor/src/primitives/rich-text/toolbar/BlockTypeDropdown.d.ts +6 -0
- package/dist/_dts/editor/src/primitives/rich-text/toolbar/LinkPopover.d.ts +10 -0
- package/dist/_dts/editor/src/primitives/rich-text/toolbar/ToolbarIconButton.d.ts +11 -0
- package/dist/_dts/editor/src/primitives/rich-text/toolbar/linkPopoverUtils.d.ts +58 -0
- package/dist/_dts/editor/src/primitives/rich-text/useRichTextEditor.d.ts +19 -0
- package/dist/_dts/editor/src/primitives/rich-text/utils.d.ts +20 -0
- package/dist/_dts/editor/src/utils/optimisticTokens.d.ts +27 -0
- package/dist/_dts/editor-blocks/src/BlockEditor.d.ts +2 -2
- package/dist/_dts/editor-blocks/src/block-editor/BlockCard.d.ts +3 -3
- package/dist/_dts/editor-blocks/src/block-editor/BlockCardHeader.d.ts +4 -4
- package/dist/_dts/editor-blocks/src/block-editor/SortableBlockItem.d.ts +2 -2
- package/dist/_dts/editor-blocks/src/block-editor/actionPresentation.d.ts +15 -0
- package/dist/_dts/editor-blocks/src/block-editor/blockHeaderActionPlan.d.ts +49 -0
- package/dist/_dts/editor-blocks/src/widgets/index.d.ts +1 -0
- package/dist/_dts/editor-blocks/src/widgets/rich-text/RichTextWidgetProvider.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/widgets/rich-text/useImagePicker.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/widgets/site-option-picker/SiteOptionPickerField.d.ts +3 -0
- package/dist/_dts/editor-blocks/src/widgets/site-option-picker/SiteOptionWidgetProvider.d.ts +14 -0
- package/dist/_dts/editor-blocks/src/widgets/site-option-picker/index.d.ts +6 -0
- package/dist/_dts/editor-blocks/src/widgets/site-option-picker/loaders.d.ts +51 -0
- package/dist/_dts/editor-blocks/src/widgets/site-option-picker/types.d.ts +20 -0
- package/dist/_dts/editor-blocks/src/widgets/site-option-picker/utils.d.ts +5 -0
- package/dist/_dts/media-core/src/index.d.ts +1 -0
- package/dist/_dts/media-core/src/renderableMediaAsset.d.ts +18 -0
- package/dist/_dts/media-editor/src/MediaEditor.d.ts +4 -1
- package/dist/_dts/media-editor/src/MediaPickerDialog.d.ts +2 -1
- package/dist/_dts/media-editor/src/index.d.ts +1 -1
- package/dist/_dts/preview-next/src/client/blocks/BlockToolbar.d.ts +3 -2
- package/dist/_dts/preview-next/src/client/blocks/EditablePageRenderer.d.ts +5 -1
- package/dist/_dts/preview-next/src/client/blocks/blockCustomizePopoverRows.d.ts +25 -0
- package/dist/_dts/preview-next/src/client/blocks/composer/mergeDrafts.d.ts +2 -1
- package/dist/_dts/preview-next/src/client/blocks/composer/types.d.ts +4 -30
- package/dist/_dts/preview-next/src/client/blocks/linkedEntryRenderOverlay.d.ts +11 -0
- package/dist/_dts/preview-next/src/client/blocks/previewCustomizeActions.d.ts +3 -9
- package/dist/_dts/preview-next/src/client/blocks/useBlockCustomizeControls.d.ts +2 -1
- package/dist/_dts/preview-next/src/client/index.d.ts +0 -1
- package/dist/_dts/preview-next/src/client/preview/EntryEditorPanel.d.ts +3 -1
- package/dist/_dts/preview-next/src/client/preview/LinkedEntryEditEventBridge.d.ts +1 -0
- package/dist/_dts/preview-next/src/client/preview/PageBlockEditorPanel.d.ts +3 -1
- package/dist/_dts/preview-next/src/client/preview/PreviewChromeLayer.d.ts +20 -0
- package/dist/_dts/preview-next/src/client/preview/PreviewDesignHistoryOrderContext.d.ts +13 -0
- package/dist/_dts/preview-next/src/client/preview/PreviewOpenEditorButton.d.ts +1 -1
- package/dist/_dts/preview-next/src/client/preview/PreviewShell.d.ts +19 -19
- package/dist/_dts/preview-next/src/client/preview/PreviewSidebarSection.d.ts +13 -0
- package/dist/_dts/preview-next/src/client/preview/SiteChromeCustomizeContext.d.ts +47 -4
- package/dist/_dts/preview-next/src/client/preview/StyleConfigurator.state.d.ts +14 -1
- package/dist/_dts/preview-next/src/client/preview/linkedEntryEditEvents.d.ts +5 -0
- package/dist/_dts/preview-next/src/client/preview/previewChromePlacement.d.ts +46 -0
- package/dist/_dts/preview-next/src/client/preview/previewCustomizeControls.d.ts +68 -0
- package/dist/_dts/preview-next/src/client/preview/previewCustomizeHistory.d.ts +8 -1
- package/dist/_dts/preview-next/src/client/preview/previewCustomizeWorkflowState.d.ts +11 -9
- package/dist/_dts/preview-next/src/client/preview/previewDesignHistoryOrder.d.ts +18 -0
- package/dist/_dts/preview-next/src/client/preview/previewUndoDomains.d.ts +1 -1
- package/dist/_dts/preview-next/src/client/preview/siteChromeBrandPreferences.d.ts +41 -0
- package/dist/_dts/preview-next/src/client/preview/siteChromeQuickControlHistoryState.d.ts +101 -0
- package/dist/_dts/preview-next/src/client/preview/siteChromeSavePlan.d.ts +29 -0
- package/dist/_dts/preview-next/src/client/preview/siteStyleHistoryState.d.ts +55 -0
- package/dist/_dts/preview-next/src/client/preview/styleConfiguratorApplyPayload.d.ts +1 -0
- package/dist/_dts/preview-next/src/client/widgets/widgetAdapters.d.ts +2 -1
- package/dist/_dts/preview-next/src/client/widgets/widgetOverrides.d.ts +3 -2
- package/dist/_dts/preview-next/src/constants.d.ts +0 -1
- package/dist/_dts/sdk/src/cli/config-loader.d.ts +3 -1
- package/dist/_dts/sdk/src/cli/content/reader.d.ts +5 -3
- package/dist/_dts/sdk/src/cli/site-commands/commandSurfaceDispatch.d.ts +1 -0
- package/dist/_dts/sdk/src/cli/site-commands/pageCommands.d.ts +3 -1
- package/dist/_dts/sdk/src/cli/site-commands/pushExecution.d.ts +1 -0
- package/dist/_dts/sdk/src/config/types.d.ts +1 -1
- package/dist/_dts/sdk/src/config/validation.d.ts +3 -3
- package/dist/_dts/sdk/src/contracts/system-block-content.d.ts +28 -2
- package/dist/_dts/sdk/src/public-api/contracts.d.ts +10 -0
- package/dist/_dts/sdk/src/rendering/islands/types.d.ts +42 -0
- package/dist/_dts/sdk/src/rendering/mediaAssets.d.ts +4 -0
- package/dist/_dts/sdk/src/types/block-kinds.d.ts +1 -1
- package/dist/_dts/sdk/src/version.d.ts +1 -1
- package/dist/_dts/theme-core/src/buttons/constants.d.ts +26 -1
- package/dist/_dts/theme-core/src/buttons/personalities/index.d.ts +11 -0
- package/dist/_dts/theme-core/src/buttons/personalities/joy-stamp.d.ts +22 -0
- package/dist/_dts/theme-core/src/buttons/personalities/types.d.ts +1 -0
- package/dist/_dts/theme-core/src/buttons/types.d.ts +9 -0
- package/dist/_dts/theme-core/src/cards/siteStyleDefaults.d.ts +44 -0
- package/dist/_dts/theme-core/src/generated/containerResponsiveThemeCss.d.ts +1 -1
- package/dist/_dts/theme-core/src/interactive/types.d.ts +10 -0
- package/dist/_dts/theme-core/src/mock-themes/all.d.ts +27 -6
- package/dist/_dts/theme-core/src/palette/variants/index.d.ts +15 -0
- package/dist/_dts/theme-core/src/palette/variants/warm-dark.d.ts +27 -0
- package/dist/_dts/theme-core/src/schema.d.ts +40 -3
- package/dist/_dts/theme-core/src/site-styles/accessibleSurfaces.d.ts +4 -1
- package/dist/_dts/theme-core/src/site-styles/appearancePresetCatalog.d.ts +87 -31
- package/dist/_dts/theme-core/src/site-styles/appearancePresetResolution.d.ts +6 -2
- package/dist/_dts/theme-core/src/site-styles/blockAppearancePresets.d.ts +87 -31
- package/dist/_dts/theme-core/src/site-styles/curatedSiteStyles.d.ts +30 -1
- package/dist/_dts/theme-core/src/site-styles/designState.d.ts +18 -2
- package/dist/_dts/theme-core/src/site-styles/generatedSchemas.d.ts +6 -2
- package/dist/_dts/theme-core/src/site-styles/headerLooks.d.ts +5 -0
- package/dist/_dts/theme-core/src/site-styles/index.d.ts +1 -0
- package/dist/_dts/theme-core/src/site-styles/pageDesignEditorModel.d.ts +3 -23
- package/dist/_dts/theme-core/src/site-styles/pageDesignIntent.d.ts +276 -4
- package/dist/_dts/theme-core/src/site-styles/runtimeCompiler.d.ts +33 -3
- package/dist/_dts/theme-core/src/site-styles/sectionTransitions.d.ts +508 -0
- package/dist/_dts/theme-core/src/site-styles/sourceCatalogs.d.ts +10 -10
- package/dist/_dts/theme-core/src/site-styles/types.d.ts +24 -6
- package/dist/_dts/theme-core/src/site-styles/typographyPresets.d.ts +16 -1
- package/dist/{chunk-7PCYG6YV.mjs → chunk-3PTVPAT4.mjs} +1863 -1099
- package/dist/{chunk-5NZGBSJF.mjs → chunk-3QWQ2MUQ.mjs} +469 -1000
- package/dist/{chunk-HTB4BMKD.mjs → chunk-3VT7LZY2.mjs} +321 -113
- package/dist/{chunk-MPBNEVPB.mjs → chunk-4T5JIPWY.mjs} +1 -1
- package/dist/{chunk-BBLZSQEY.mjs → chunk-E3NZYEKF.mjs} +1 -7
- package/dist/{chunk-GYXKAUFV.mjs → chunk-WUHKQBB6.mjs} +9509 -2658
- package/dist/cli/index.mjs +1347 -324
- package/dist/client/{accordion-QFZMNB7O.mjs → accordion-SFIIZWNH.mjs} +2 -2
- package/dist/client/{bookingForm-NCIXFWIG.mjs → bookingForm-CFKZVWGA.mjs} +5 -5
- package/dist/client/bookings.mjs +281 -19
- package/dist/client/{carousel-EO4BJMWD.mjs → carousel-ELXWSBLA.mjs} +3 -3
- package/dist/client/{cart-FTYCLYUW.mjs → cart-6SSCPYY5.mjs} +6 -6
- package/dist/client/{checkout-NFGLVCOX.mjs → checkout-UFQ34HPV.mjs} +6 -6
- package/dist/client/{chunk-6GVVWSPU.mjs → chunk-76JUETXQ.mjs} +139 -186
- package/dist/client/{chunk-AUJ5DBZJ.mjs → chunk-7BXX7WXH.mjs} +112 -28
- package/dist/client/{chunk-IWFZSQNZ.mjs → chunk-G56BSZAM.mjs} +2 -2
- package/dist/client/{chunk-VDS5YFLX.mjs → chunk-IUEDYLFJ.mjs} +1 -1
- package/dist/client/{chunk-PYRBIURC.mjs → chunk-NP47RHIX.mjs} +5 -5
- package/dist/client/{chunk-PUOELU4O.mjs → chunk-NX6X3GRF.mjs} +330 -80
- package/dist/client/{chunk-Y37KDO7P.mjs → chunk-PA2LJH2M.mjs} +2 -2
- package/dist/client/{chunk-CE7IBGVW.mjs → chunk-RMWMT3ZD.mjs} +1 -1
- package/dist/client/{chunk-4W66ALYT.mjs → chunk-TCJS3NY5.mjs} +1 -1
- package/dist/client/{chunk-T6UIP6UZ.mjs → chunk-V6XI4M2Q.mjs} +1 -1
- package/dist/client/client.mjs +5924 -3138
- package/dist/client/{courseRegistration-2EORROPS.mjs → courseRegistration-HJIISAAG.mjs} +5 -5
- package/dist/client/{eventCalendar-WZI4VL6N.mjs → eventCalendar-F6YVUCZR.mjs} +7 -7
- package/dist/client/{eventCombined-QCB2TCNL.mjs → eventCombined-B5DSTIOK.mjs} +7 -7
- package/dist/client/{eventDetails-TFTATAPH.mjs → eventDetails-SEJDDHQC.mjs} +7 -7
- package/dist/client/{eventListing-A2CQEHEQ.mjs → eventListing-TPMWIIBO.mjs} +7 -7
- package/dist/client/{eventRegistration-OELPVLUY.mjs → eventRegistration-QU6W2PV6.mjs} +7 -7
- package/dist/client/{form-NTIFD6WQ.mjs → form-LVTYNTDE.mjs} +2 -2
- package/dist/client/{headerSection-7TBNKCLA.mjs → headerSection-SO3MFC4U.mjs} +54 -13
- package/dist/client/hooks.mjs +2266 -1179
- package/dist/client/{locationMap-LRLB5A3H.mjs → locationMap-5E5FLAKO.mjs} +2 -2
- package/dist/client/{newsletterForm-XI52RZSN.mjs → newsletterForm-GN32JEBQ.mjs} +2 -2
- package/dist/client/{productDetail-GSNKBFLY.mjs → productDetail-Q346KSVR.mjs} +6 -6
- package/dist/client/{productList-BGCGT4KZ.mjs → productList-DTDMQYGZ.mjs} +6 -6
- package/dist/client/rendering/client.mjs +4618 -3318
- package/dist/client/rendering/islands.mjs +32 -20
- package/dist/client/rendering.mjs +4898 -2108
- package/dist/client/{shop-RQHUCLNY.mjs → shop-OFUW7KPN.mjs} +6 -6
- package/dist/preview-next/client/runtime.mjs +5 -5
- package/dist/preview-next/constants.mjs +0 -2
- package/dist/preview-next/index.mjs +0 -2
- package/dist/{sdk-runtime-A4LHT2RS.mjs → sdk-runtime-2GIX6I7X.mjs} +6 -6
- package/dist/server/components.mjs +4377 -1852
- package/dist/server/config-validation.mjs +2283 -1303
- package/dist/server/config.mjs +2283 -1303
- package/dist/server/data.mjs +2267 -1180
- package/dist/server/index.mjs +2 -1
- package/dist/server/next.mjs +4394 -1773
- package/dist/server/page-converter.mjs +1999 -1015
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/rendering/server.mjs +4482 -1857
- package/dist/server/rendering.mjs +4484 -1859
- package/dist/server/routing.mjs +2302 -1120
- package/dist/server/server.mjs +2284 -1197
- package/dist/server/theme-bridge.mjs +757 -85
- package/dist/server/theme.mjs +69 -4
- package/dist/styles/index.css +474 -65
- package/package.json +1 -1
- package/dist/SdkPreviewModeRuntime-XE5M4UKM.mjs +0 -8
- package/dist/_dts/editor-blocks/src/block-editor/actionControlMode.d.ts +0 -2
- package/dist/_dts/preview-next/src/client/preview/previewSurface.d.ts +0 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { KeyboardCode, getBlockDefinition, CSS, useSdkConfig, unwrapResponse, parseSiteIconStyleGuideVersionId, parseBlockIconValue, listBlockDescriptors, useSensor, PointerSensor, useSensors, deleteBlock, createEditorRemoveBlockCommand, unsafeAsEditorBlockId, DndContext, closestCenter, Button, Plus, useDroppable, useDraggable, useCombinedRefs, isKeyboardEvent, createCustomBlockRegistry, Card, cn, Collapsible, CollapsibleContent, listContentTypes, mergeBlockDescriptorsWithRegistry, createBlock, createEditorReorderBlocksCommand, reorderBlocks, mutateBlockContent, useDndContext, useUniqueId, useIsomorphicLayoutEffect, EmptyState, Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription, Search, getClientRect, resolveBlockTitle, CardHeader, GripVertical, ChevronRight, CardTitle, ArrowUp, ArrowDown, DropdownMenu, DropdownMenuTrigger, EllipsisVertical, DropdownMenuContent,
|
|
3
|
-
import React2, { createContext, memo, useMemo, useState, useRef, useEffect, forwardRef, useCallback, useImperativeHandle, useContext, useSyncExternalStore, useLayoutEffect, useReducer } from 'react';
|
|
2
|
+
import { KeyboardCode, getBlockDefinition, CSS, useSdkConfig, unwrapResponse, parseSiteIconStyleGuideVersionId, parseBlockIconValue, listBlockDescriptors, useSensor, PointerSensor, useSensors, deleteBlock, createEditorRemoveBlockCommand, unsafeAsEditorBlockId, DndContext, closestCenter, Button, Plus, useDroppable, useDraggable, useCombinedRefs, isKeyboardEvent, createCustomBlockRegistry, Card, cn, Collapsible, CollapsibleContent, listContentTypes, mergeBlockDescriptorsWithRegistry, createBlock, createEditorReorderBlocksCommand, reorderBlocks, mutateBlockContent, useDndContext, useUniqueId, useIsomorphicLayoutEffect, EmptyState, Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription, Search, getClientRect, resolveBlockTitle, CardHeader, GripVertical, ChevronRight, CardTitle, ArrowUp, ArrowDown, DropdownMenu, DropdownMenuTrigger, EllipsisVertical, DropdownMenuContent, DropdownMenuSeparator, DropdownMenuItem, Copy, Trash2, DialogFooter, DialogClose, CardContent, createEditorInsertBlockCommand, LoaderCircle, ChevronDown, getFeatureCardIconCompletion, toFeatureCardIconSuggestionInputs, getBlockIconSemanticFallbackId, suggestSemanticIconForFeatureCard, getGeneratedBlockIconStyleState, assertNever, createManifestFormAdapter, getModalConfig, createStoreBackend, validateBlockManifestIssues, isNonEmptyValue, Settings, ScrollableDialogContent, FormRenderer, Tabs, TabsList, TabsTrigger, TabsContent, RotateCcw, ImagePlus, Sparkles, Textarea, Callout, CalloutDescription, normalEditorCuratedPromotedFieldPaths, resolveVisiblePromotedFieldPathsForEditorBlock, CalloutTitle, unfinishedBlockCopy, recoveryConflictCopy, ManifestForm, unsafeAsEditorBlockValues, Box, mergeManifestWithSdkOptions, augmentManifestWithStyleGroups, suggestFeatureCardSemanticIcons, applyFeatureCardIconSuggestions, createFeatureCardIconKey, lucide_react_exports, isThemeV2NormalEditorRawStylePath, getFieldIntent, isHeaderField, isThemeV2NormalEditorRawStyleFieldName, useEditorUiStoreInstance, useUISelector, useField, useMediaEditorOptional, useRichTextEditor, FieldFrame, RichTextEditorSurface, ThemeScope, isObjectRecord, EMPTY_DOC, useMediaEditor, MediaPickerMini, MediaPickerDialog, useAsyncPickerOptions, resolvePickerSelectionLabel, shouldShowPickerSearch, normalizePickerSearchThreshold, Combobox, Badge, useBlockContext, resolveMediaSlotContract, asRecord, parseAspectRatioValue, MediaEditor, PUBLIC_FILE_FIELD_KINDS, Select, SelectTrigger, SelectValue, SelectContent, SelectItem, useBackendWatch, resolveIconPickerPreset, isIconPickerPreset, getIconPickerOptionsForPreset, isKnownIconName, getIconComponent, CommandMultiSelect, getRichTextImagePositionFromTarget, insertOrReplaceRichTextImage, emitMediaCropDebug, Pencil, resolveVideoSelectionIntentForMediaField, siteOptionSources, evaluateVisibility, Root2, List, Trigger, Content, Input, Check, Label, isInternalResolvedLinkValue, resolveImageUrlWithContext, getDirectImageUrlForMediaAsset, isSvgMimeType, toRoutableLinkPayload, classifyKnownMimeType } from './chunk-WUHKQBB6.mjs';
|
|
3
|
+
import React2, { createContext, memo, useMemo, useState, useRef, useEffect, forwardRef, useCallback, useImperativeHandle, useContext, useSyncExternalStore, useLayoutEffect, Fragment as Fragment$1, useReducer } from 'react';
|
|
4
4
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
5
5
|
|
|
6
6
|
// ../preview-next/src/client/preview/previewChromeSurfacePolicy.ts
|
|
@@ -277,7 +277,7 @@ function parseReferenceKind(referenceKind) {
|
|
|
277
277
|
}
|
|
278
278
|
|
|
279
279
|
// ../content-model/src/contentManifest.ts
|
|
280
|
-
function
|
|
280
|
+
function assertNever2(value) {
|
|
281
281
|
throw new Error(`Unhandled content field mapping decision: ${JSON.stringify(value)}`);
|
|
282
282
|
}
|
|
283
283
|
function resolveContentReferenceKind(field) {
|
|
@@ -408,7 +408,7 @@ function toFieldDefinition(field, context = {}) {
|
|
|
408
408
|
valueFrom: mapping.valueFrom
|
|
409
409
|
};
|
|
410
410
|
default:
|
|
411
|
-
return
|
|
411
|
+
return assertNever2(mapping);
|
|
412
412
|
}
|
|
413
413
|
}
|
|
414
414
|
case "link":
|
|
@@ -551,19 +551,22 @@ var PreviewBlockCustomizeSelectionContext = createContext(null);
|
|
|
551
551
|
function PreviewBlockCustomizeSelectionProvider({
|
|
552
552
|
children
|
|
553
553
|
}) {
|
|
554
|
-
const
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
setSelection((current) => ({
|
|
554
|
+
const uiStore = useEditorUiStoreInstance();
|
|
555
|
+
const previewInspection = useUISelector(uiStore, (state) => state.previewInspection);
|
|
556
|
+
const selection = useMemo(
|
|
557
|
+
() => previewInspection.kind === "block-customize" ? {
|
|
559
558
|
kind: "selected",
|
|
560
|
-
blockId,
|
|
561
|
-
requestId:
|
|
562
|
-
}
|
|
563
|
-
|
|
559
|
+
blockId: previewInspection.blockId,
|
|
560
|
+
requestId: previewInspection.requestId
|
|
561
|
+
} : { kind: "none" },
|
|
562
|
+
[previewInspection]
|
|
563
|
+
);
|
|
564
|
+
const inspectBlock = useCallback((blockId) => {
|
|
565
|
+
uiStore.getState().inspectBlock(blockId);
|
|
566
|
+
}, [uiStore]);
|
|
564
567
|
const clearInspection = useCallback(() => {
|
|
565
|
-
|
|
566
|
-
}, []);
|
|
568
|
+
uiStore.getState().clearPreviewInspection();
|
|
569
|
+
}, [uiStore]);
|
|
567
570
|
const value = useMemo(
|
|
568
571
|
() => ({
|
|
569
572
|
selection,
|
|
@@ -2127,8 +2130,10 @@ function useBlockReorder({
|
|
|
2127
2130
|
return { reorderId, handleMove, onDragEnd };
|
|
2128
2131
|
}
|
|
2129
2132
|
|
|
2130
|
-
// ../editor-blocks/src/block-editor/
|
|
2131
|
-
var
|
|
2133
|
+
// ../editor-blocks/src/block-editor/actionPresentation.ts
|
|
2134
|
+
var DEFAULT_BLOCK_ACTION_PRESENTATION = {
|
|
2135
|
+
kind: "inline"
|
|
2136
|
+
};
|
|
2132
2137
|
|
|
2133
2138
|
// ../editor-blocks/src/block-editor/reorderControlMode.ts
|
|
2134
2139
|
var DEFAULT_REORDER_CONTROL_MODE = "full";
|
|
@@ -3184,8 +3189,8 @@ function BlockSettingsModal({
|
|
|
3184
3189
|
setOpen(true);
|
|
3185
3190
|
},
|
|
3186
3191
|
disabled: !hasDraftSnapshot,
|
|
3187
|
-
"aria-label": "
|
|
3188
|
-
title: "
|
|
3192
|
+
"aria-label": "Customize block",
|
|
3193
|
+
title: "Customize block",
|
|
3189
3194
|
children: /* @__PURE__ */ jsx(Settings, { className: "h-4 w-4" })
|
|
3190
3195
|
}
|
|
3191
3196
|
) : null,
|
|
@@ -3209,7 +3214,7 @@ function BlockSettingsModal({
|
|
|
3209
3214
|
!directSectionStylesModal ? /* @__PURE__ */ jsx(Dialog, { open, onOpenChange: setOpen, children: /* @__PURE__ */ jsx(
|
|
3210
3215
|
ScrollableDialogContent,
|
|
3211
3216
|
{
|
|
3212
|
-
title: "
|
|
3217
|
+
title: "Customize block",
|
|
3213
3218
|
footer: /* @__PURE__ */ jsx(Button, { type: "button", onClick: () => setOpen(false), children: "Done" }),
|
|
3214
3219
|
children: /* @__PURE__ */ jsxs(Tabs, { defaultValue: defaultTab, className: "w-full", children: [
|
|
3215
3220
|
/* @__PURE__ */ jsx(TabsList, { className: cn("mb-1"), children: visibleTabs.map((tab) => /* @__PURE__ */ jsx(TabsTrigger, { value: tab.id, children: tab.label }, tab.id)) }),
|
|
@@ -3244,6 +3249,124 @@ function useDraftContent(uiStore, blockId) {
|
|
|
3244
3249
|
}, [uiStore, blockId]);
|
|
3245
3250
|
return content;
|
|
3246
3251
|
}
|
|
3252
|
+
|
|
3253
|
+
// ../editor-blocks/src/block-editor/blockHeaderActionPlan.ts
|
|
3254
|
+
function deriveBlockHeaderActionPlan({
|
|
3255
|
+
actionPresentation,
|
|
3256
|
+
blockId,
|
|
3257
|
+
settingsAvailable,
|
|
3258
|
+
featureCardIconActionsAvailable,
|
|
3259
|
+
featureCardIconsComplete,
|
|
3260
|
+
generatedIconSetActionsAvailable,
|
|
3261
|
+
hasStaleGeneratedIcons,
|
|
3262
|
+
featureCardIconDialogCardsCount,
|
|
3263
|
+
duplicateAvailable,
|
|
3264
|
+
duplicateDisabled,
|
|
3265
|
+
deleteAvailable,
|
|
3266
|
+
deleteDisabled
|
|
3267
|
+
}) {
|
|
3268
|
+
const customizeAction = deriveCustomizeAction({
|
|
3269
|
+
actionPresentation,
|
|
3270
|
+
blockId,
|
|
3271
|
+
settingsAvailable
|
|
3272
|
+
});
|
|
3273
|
+
const layout = actionPresentation.kind;
|
|
3274
|
+
if (layout === "inline") {
|
|
3275
|
+
return {
|
|
3276
|
+
layout,
|
|
3277
|
+
customizeAction,
|
|
3278
|
+
menuGroups: [],
|
|
3279
|
+
hasMenuActions: false
|
|
3280
|
+
};
|
|
3281
|
+
}
|
|
3282
|
+
const menuGroups = [];
|
|
3283
|
+
if (customizeAction) {
|
|
3284
|
+
menuGroups.push({
|
|
3285
|
+
id: "customize",
|
|
3286
|
+
actions: [customizeAction]
|
|
3287
|
+
});
|
|
3288
|
+
}
|
|
3289
|
+
const iconActions = deriveIconActions({
|
|
3290
|
+
featureCardIconActionsAvailable,
|
|
3291
|
+
featureCardIconsComplete,
|
|
3292
|
+
generatedIconSetActionsAvailable,
|
|
3293
|
+
hasStaleGeneratedIcons,
|
|
3294
|
+
featureCardIconDialogCardsCount
|
|
3295
|
+
});
|
|
3296
|
+
if (iconActions.length > 0) {
|
|
3297
|
+
menuGroups.push({
|
|
3298
|
+
id: "icons",
|
|
3299
|
+
actions: iconActions
|
|
3300
|
+
});
|
|
3301
|
+
}
|
|
3302
|
+
const structureActions = deriveStructureActions({
|
|
3303
|
+
duplicateAvailable,
|
|
3304
|
+
duplicateDisabled,
|
|
3305
|
+
deleteAvailable,
|
|
3306
|
+
deleteDisabled
|
|
3307
|
+
});
|
|
3308
|
+
if (structureActions.length > 0) {
|
|
3309
|
+
menuGroups.push({
|
|
3310
|
+
id: "structure",
|
|
3311
|
+
actions: structureActions
|
|
3312
|
+
});
|
|
3313
|
+
}
|
|
3314
|
+
return {
|
|
3315
|
+
layout,
|
|
3316
|
+
customizeAction,
|
|
3317
|
+
menuGroups,
|
|
3318
|
+
hasMenuActions: menuGroups.length > 0
|
|
3319
|
+
};
|
|
3320
|
+
}
|
|
3321
|
+
function deriveCustomizeAction({
|
|
3322
|
+
actionPresentation,
|
|
3323
|
+
blockId,
|
|
3324
|
+
settingsAvailable
|
|
3325
|
+
}) {
|
|
3326
|
+
if (actionPresentation.kind === "inline") {
|
|
3327
|
+
return settingsAvailable ? { kind: "customize", presentation: "modal" } : null;
|
|
3328
|
+
}
|
|
3329
|
+
switch (actionPresentation.customize.kind) {
|
|
3330
|
+
case "modal":
|
|
3331
|
+
return settingsAvailable ? { kind: "customize", presentation: "modal" } : null;
|
|
3332
|
+
case "external":
|
|
3333
|
+
return blockId ? { kind: "customize", presentation: "external", blockId } : null;
|
|
3334
|
+
default:
|
|
3335
|
+
return assertNever(actionPresentation.customize);
|
|
3336
|
+
}
|
|
3337
|
+
}
|
|
3338
|
+
function deriveIconActions({
|
|
3339
|
+
featureCardIconActionsAvailable,
|
|
3340
|
+
featureCardIconsComplete,
|
|
3341
|
+
generatedIconSetActionsAvailable,
|
|
3342
|
+
hasStaleGeneratedIcons,
|
|
3343
|
+
featureCardIconDialogCardsCount
|
|
3344
|
+
}) {
|
|
3345
|
+
if (!featureCardIconActionsAvailable) {
|
|
3346
|
+
return [];
|
|
3347
|
+
}
|
|
3348
|
+
return [
|
|
3349
|
+
{ kind: "suggest-icons", disabled: featureCardIconsComplete },
|
|
3350
|
+
...generatedIconSetActionsAvailable ? [
|
|
3351
|
+
{
|
|
3352
|
+
kind: "generated-icon-set",
|
|
3353
|
+
disabled: featureCardIconDialogCardsCount === 0,
|
|
3354
|
+
stale: hasStaleGeneratedIcons
|
|
3355
|
+
}
|
|
3356
|
+
] : []
|
|
3357
|
+
];
|
|
3358
|
+
}
|
|
3359
|
+
function deriveStructureActions({
|
|
3360
|
+
duplicateAvailable,
|
|
3361
|
+
duplicateDisabled,
|
|
3362
|
+
deleteAvailable,
|
|
3363
|
+
deleteDisabled
|
|
3364
|
+
}) {
|
|
3365
|
+
return [
|
|
3366
|
+
...duplicateAvailable ? [{ kind: "duplicate", disabled: duplicateDisabled }] : [],
|
|
3367
|
+
...deleteAvailable ? [{ kind: "delete", disabled: deleteDisabled }] : []
|
|
3368
|
+
];
|
|
3369
|
+
}
|
|
3247
3370
|
function BlockCardHeader({
|
|
3248
3371
|
block,
|
|
3249
3372
|
manifest,
|
|
@@ -3263,7 +3386,7 @@ function BlockCardHeader({
|
|
|
3263
3386
|
theme,
|
|
3264
3387
|
hideThemeV2RawStyleFields: hideThemeV2RawStyleFields2 = false,
|
|
3265
3388
|
reorderControlMode = "full",
|
|
3266
|
-
|
|
3389
|
+
actionPresentation = DEFAULT_BLOCK_ACTION_PRESENTATION,
|
|
3267
3390
|
currentStyleGuideVersionId,
|
|
3268
3391
|
iconStyleGuideSummary,
|
|
3269
3392
|
iconStyleGuideEditHref,
|
|
@@ -3275,7 +3398,6 @@ function BlockCardHeader({
|
|
|
3275
3398
|
const [generateIconSetDialogOpen, setGenerateIconSetDialogOpen] = useState(false);
|
|
3276
3399
|
const [settingsAvailable, setSettingsAvailable] = useState(true);
|
|
3277
3400
|
const showMoveButtons = shouldShowMoveButtons(reorderControlMode);
|
|
3278
|
-
const showActionsMenu = actionControlMode === "menu";
|
|
3279
3401
|
const baselineContent = useDraftContent(
|
|
3280
3402
|
uiStore,
|
|
3281
3403
|
typeof block.id === "string" ? unsafeAsEditorBlockId(block.id) : null
|
|
@@ -3290,7 +3412,6 @@ function BlockCardHeader({
|
|
|
3290
3412
|
const featureCardIconStatus = supportsIconActions ? getFeatureCardIconStatus(currentContent ?? block.draftContent ?? contentToUse) : null;
|
|
3291
3413
|
const featureCardIconActionsAvailable = Boolean(blockId) && supportsIconActions && (featureCardIconStatus?.totalCards ?? 0) > 0;
|
|
3292
3414
|
const featureCardIconsComplete = featureCardIconStatus !== null && featureCardIconStatus.totalCards > 0 && featureCardIconStatus.cardsWithIcons >= featureCardIconStatus.totalCards;
|
|
3293
|
-
const featureCardSuggestionActionAvailable = featureCardIconActionsAvailable && !featureCardIconsComplete;
|
|
3294
3415
|
const generatedIconSetActionsAvailable = featureCardIconActionsAvailable && Boolean(onGenerateIconSet);
|
|
3295
3416
|
const featureCardIconContent = currentContent ?? block.draftContent ?? contentToUse;
|
|
3296
3417
|
const featureCardIconDialogCards = supportsIconActions ? getFeatureCardIconDialogCards(featureCardIconContent) : [];
|
|
@@ -3316,8 +3437,22 @@ function BlockCardHeader({
|
|
|
3316
3437
|
contentToUse,
|
|
3317
3438
|
block.kind
|
|
3318
3439
|
);
|
|
3319
|
-
const
|
|
3320
|
-
|
|
3440
|
+
const actionPlan = deriveBlockHeaderActionPlan({
|
|
3441
|
+
actionPresentation,
|
|
3442
|
+
blockId,
|
|
3443
|
+
settingsAvailable,
|
|
3444
|
+
featureCardIconActionsAvailable,
|
|
3445
|
+
featureCardIconsComplete,
|
|
3446
|
+
generatedIconSetActionsAvailable,
|
|
3447
|
+
hasStaleGeneratedIcons,
|
|
3448
|
+
featureCardIconDialogCardsCount: featureCardIconDialogCards.length,
|
|
3449
|
+
duplicateAvailable: Boolean(onDuplicate),
|
|
3450
|
+
duplicateDisabled: isMoving || !block.id,
|
|
3451
|
+
deleteAvailable: Boolean(onDelete),
|
|
3452
|
+
deleteDisabled: !block.id
|
|
3453
|
+
});
|
|
3454
|
+
const showActionsMenu = actionPlan.layout === "menu";
|
|
3455
|
+
const settingsModal = actionPresentation.kind === "menu" && actionPresentation.customize.kind === "external" ? null : /* @__PURE__ */ jsx(
|
|
3321
3456
|
BlockSettingsModal,
|
|
3322
3457
|
{
|
|
3323
3458
|
block,
|
|
@@ -3332,6 +3467,41 @@ function BlockCardHeader({
|
|
|
3332
3467
|
onAvailabilityChange: showActionsMenu ? setSettingsAvailable : void 0
|
|
3333
3468
|
}
|
|
3334
3469
|
);
|
|
3470
|
+
function handleMenuAction(action) {
|
|
3471
|
+
switch (action.kind) {
|
|
3472
|
+
case "customize":
|
|
3473
|
+
if (action.presentation === "external") {
|
|
3474
|
+
if (actionPresentation.kind === "menu" && actionPresentation.customize.kind === "external") {
|
|
3475
|
+
actionPresentation.customize.onSelect(action.blockId);
|
|
3476
|
+
}
|
|
3477
|
+
return;
|
|
3478
|
+
}
|
|
3479
|
+
setSettingsDialogOpen(true);
|
|
3480
|
+
return;
|
|
3481
|
+
case "suggest-icons":
|
|
3482
|
+
if (!blockId || action.disabled) return;
|
|
3483
|
+
applyCuratedFeatureCardIconSuggestions({
|
|
3484
|
+
blockId,
|
|
3485
|
+
content: currentContent ?? block.draftContent ?? contentToUse,
|
|
3486
|
+
drafts: uiStore.getState().drafts
|
|
3487
|
+
});
|
|
3488
|
+
return;
|
|
3489
|
+
case "generated-icon-set":
|
|
3490
|
+
if (action.disabled) return;
|
|
3491
|
+
setGenerateIconSetDialogOpen(true);
|
|
3492
|
+
return;
|
|
3493
|
+
case "duplicate":
|
|
3494
|
+
if (block.id && onDuplicate && !action.disabled) {
|
|
3495
|
+
onDuplicate(block.id);
|
|
3496
|
+
}
|
|
3497
|
+
return;
|
|
3498
|
+
case "delete":
|
|
3499
|
+
if (!action.disabled) {
|
|
3500
|
+
setDeleteDialogOpen(true);
|
|
3501
|
+
}
|
|
3502
|
+
return;
|
|
3503
|
+
}
|
|
3504
|
+
}
|
|
3335
3505
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3336
3506
|
/* @__PURE__ */ jsxs(CardHeader, { className: "flex flex-wrap items-start gap-1 px-2 py-2", "data-testid": "block-card-header", children: [
|
|
3337
3507
|
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: [
|
|
@@ -3415,78 +3585,28 @@ function BlockCardHeader({
|
|
|
3415
3585
|
type: "button",
|
|
3416
3586
|
variant: "ghost",
|
|
3417
3587
|
size: "icon",
|
|
3418
|
-
disabled: !hasMenuActions,
|
|
3588
|
+
disabled: !actionPlan.hasMenuActions,
|
|
3419
3589
|
"aria-label": `More actions for ${displayTitle}`,
|
|
3420
3590
|
title: "More actions",
|
|
3421
3591
|
children: /* @__PURE__ */ jsx(EllipsisVertical, { className: "h-4 w-4" })
|
|
3422
3592
|
}
|
|
3423
3593
|
) }),
|
|
3424
|
-
/* @__PURE__ */
|
|
3425
|
-
|
|
3426
|
-
|
|
3427
|
-
"Settings"
|
|
3428
|
-
] }) : null,
|
|
3429
|
-
featureCardIconActionsAvailable ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3430
|
-
settingsAvailable ? /* @__PURE__ */ jsx(DropdownMenuSeparator, {}) : null,
|
|
3431
|
-
/* @__PURE__ */ jsxs(
|
|
3432
|
-
DropdownMenuItem,
|
|
3433
|
-
{
|
|
3434
|
-
disabled: !blockId || featureCardIconsComplete,
|
|
3435
|
-
onSelect: () => {
|
|
3436
|
-
if (!blockId) return;
|
|
3437
|
-
applyCuratedFeatureCardIconSuggestions({
|
|
3438
|
-
blockId,
|
|
3439
|
-
content: currentContent ?? block.draftContent ?? contentToUse,
|
|
3440
|
-
drafts: uiStore.getState().drafts
|
|
3441
|
-
});
|
|
3442
|
-
},
|
|
3443
|
-
children: [
|
|
3444
|
-
/* @__PURE__ */ jsx(Sparkles, { className: "mr-2 h-4 w-4" }),
|
|
3445
|
-
"Suggest icons"
|
|
3446
|
-
]
|
|
3447
|
-
}
|
|
3448
|
-
),
|
|
3449
|
-
generatedIconSetActionsAvailable ? /* @__PURE__ */ jsxs(
|
|
3450
|
-
DropdownMenuItem,
|
|
3451
|
-
{
|
|
3452
|
-
disabled: !blockId || featureCardIconDialogCards.length === 0,
|
|
3453
|
-
onSelect: () => setGenerateIconSetDialogOpen(true),
|
|
3454
|
-
children: [
|
|
3455
|
-
hasStaleGeneratedIcons ? /* @__PURE__ */ jsx(RotateCcw, { className: "mr-2 h-4 w-4" }) : /* @__PURE__ */ jsx(ImagePlus, { className: "mr-2 h-4 w-4" }),
|
|
3456
|
-
hasStaleGeneratedIcons ? "Regenerate icon set" : "Generate icon set"
|
|
3457
|
-
]
|
|
3458
|
-
}
|
|
3459
|
-
) : null
|
|
3460
|
-
] }) : null,
|
|
3461
|
-
(settingsAvailable || featureCardIconActionsAvailable) && (onDuplicate || onDelete) ? /* @__PURE__ */ jsx(DropdownMenuSeparator, {}) : null,
|
|
3462
|
-
onDuplicate ? /* @__PURE__ */ jsxs(
|
|
3463
|
-
DropdownMenuItem,
|
|
3464
|
-
{
|
|
3465
|
-
disabled: isMoving || !block.id,
|
|
3466
|
-
onSelect: () => {
|
|
3467
|
-
if (block.id) {
|
|
3468
|
-
onDuplicate(block.id);
|
|
3469
|
-
}
|
|
3470
|
-
},
|
|
3471
|
-
children: [
|
|
3472
|
-
/* @__PURE__ */ jsx(Copy, { className: "mr-2 h-4 w-4" }),
|
|
3473
|
-
"Duplicate"
|
|
3474
|
-
]
|
|
3475
|
-
}
|
|
3476
|
-
) : null,
|
|
3477
|
-
onDelete ? /* @__PURE__ */ jsxs(
|
|
3594
|
+
/* @__PURE__ */ jsx(DropdownMenuContent, { align: "end", className: "w-44", children: actionPlan.menuGroups.map((group, index) => /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
3595
|
+
index > 0 ? /* @__PURE__ */ jsx(DropdownMenuSeparator, {}) : null,
|
|
3596
|
+
group.actions.map((action) => /* @__PURE__ */ jsxs(
|
|
3478
3597
|
DropdownMenuItem,
|
|
3479
3598
|
{
|
|
3480
|
-
disabled:
|
|
3481
|
-
className: "text-destructive focus:text-destructive",
|
|
3482
|
-
onSelect: () =>
|
|
3599
|
+
disabled: "disabled" in action ? action.disabled : false,
|
|
3600
|
+
className: action.kind === "delete" ? "text-destructive focus:text-destructive" : void 0,
|
|
3601
|
+
onSelect: () => handleMenuAction(action),
|
|
3483
3602
|
children: [
|
|
3484
|
-
|
|
3485
|
-
|
|
3603
|
+
menuActionIcon(action),
|
|
3604
|
+
menuActionLabel(action)
|
|
3486
3605
|
]
|
|
3487
|
-
}
|
|
3488
|
-
|
|
3489
|
-
|
|
3606
|
+
},
|
|
3607
|
+
action.kind
|
|
3608
|
+
))
|
|
3609
|
+
] }, group.id)) })
|
|
3490
3610
|
] }),
|
|
3491
3611
|
settingsModal
|
|
3492
3612
|
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -3570,6 +3690,38 @@ function BlockCardHeader({
|
|
|
3570
3690
|
) : null
|
|
3571
3691
|
] });
|
|
3572
3692
|
}
|
|
3693
|
+
function menuActionIcon(action) {
|
|
3694
|
+
switch (action.kind) {
|
|
3695
|
+
case "customize":
|
|
3696
|
+
return /* @__PURE__ */ jsx(Settings, { className: "mr-2 h-4 w-4" });
|
|
3697
|
+
case "suggest-icons":
|
|
3698
|
+
return /* @__PURE__ */ jsx(Sparkles, { className: "mr-2 h-4 w-4" });
|
|
3699
|
+
case "generated-icon-set":
|
|
3700
|
+
return action.stale ? /* @__PURE__ */ jsx(RotateCcw, { className: "mr-2 h-4 w-4" }) : /* @__PURE__ */ jsx(ImagePlus, { className: "mr-2 h-4 w-4" });
|
|
3701
|
+
case "duplicate":
|
|
3702
|
+
return /* @__PURE__ */ jsx(Copy, { className: "mr-2 h-4 w-4" });
|
|
3703
|
+
case "delete":
|
|
3704
|
+
return /* @__PURE__ */ jsx(Trash2, { className: "mr-2 h-4 w-4" });
|
|
3705
|
+
default:
|
|
3706
|
+
return assertNever(action);
|
|
3707
|
+
}
|
|
3708
|
+
}
|
|
3709
|
+
function menuActionLabel(action) {
|
|
3710
|
+
switch (action.kind) {
|
|
3711
|
+
case "customize":
|
|
3712
|
+
return "Customize";
|
|
3713
|
+
case "suggest-icons":
|
|
3714
|
+
return "Suggest icons";
|
|
3715
|
+
case "generated-icon-set":
|
|
3716
|
+
return action.stale ? "Regenerate icon set" : "Generate icon set";
|
|
3717
|
+
case "duplicate":
|
|
3718
|
+
return "Duplicate";
|
|
3719
|
+
case "delete":
|
|
3720
|
+
return "Delete";
|
|
3721
|
+
default:
|
|
3722
|
+
return assertNever(action);
|
|
3723
|
+
}
|
|
3724
|
+
}
|
|
3573
3725
|
function BlockCard({
|
|
3574
3726
|
siteId,
|
|
3575
3727
|
block,
|
|
@@ -3595,7 +3747,7 @@ function BlockCard({
|
|
|
3595
3747
|
hideThemeV2RawStyleFields: hideThemeV2RawStyleFields2 = false,
|
|
3596
3748
|
pageDesignBlock = null,
|
|
3597
3749
|
reorderControlMode = DEFAULT_REORDER_CONTROL_MODE,
|
|
3598
|
-
|
|
3750
|
+
actionPresentation = DEFAULT_BLOCK_ACTION_PRESENTATION,
|
|
3599
3751
|
currentStyleGuideVersionId,
|
|
3600
3752
|
iconStyleGuideSummary,
|
|
3601
3753
|
iconStyleGuideEditHref,
|
|
@@ -3631,7 +3783,7 @@ function BlockCard({
|
|
|
3631
3783
|
theme,
|
|
3632
3784
|
hideThemeV2RawStyleFields: hideThemeV2RawStyleFields2,
|
|
3633
3785
|
reorderControlMode,
|
|
3634
|
-
|
|
3786
|
+
actionPresentation,
|
|
3635
3787
|
currentStyleGuideVersionId,
|
|
3636
3788
|
iconStyleGuideSummary,
|
|
3637
3789
|
iconStyleGuideEditHref,
|
|
@@ -3690,7 +3842,7 @@ var SortableBlockItem = memo(function SortableBlockItem2({
|
|
|
3690
3842
|
hideThemeV2RawStyleFields: hideThemeV2RawStyleFields2 = false,
|
|
3691
3843
|
pageDesignBlock = null,
|
|
3692
3844
|
reorderControlMode = DEFAULT_REORDER_CONTROL_MODE,
|
|
3693
|
-
|
|
3845
|
+
actionPresentation = DEFAULT_BLOCK_ACTION_PRESENTATION,
|
|
3694
3846
|
currentStyleGuideVersionId,
|
|
3695
3847
|
iconStyleGuideSummary,
|
|
3696
3848
|
iconStyleGuideEditHref,
|
|
@@ -3778,7 +3930,7 @@ var SortableBlockItem = memo(function SortableBlockItem2({
|
|
|
3778
3930
|
hideThemeV2RawStyleFields: hideThemeV2RawStyleFields2,
|
|
3779
3931
|
pageDesignBlock,
|
|
3780
3932
|
reorderControlMode,
|
|
3781
|
-
|
|
3933
|
+
actionPresentation,
|
|
3782
3934
|
currentStyleGuideVersionId,
|
|
3783
3935
|
iconStyleGuideSummary,
|
|
3784
3936
|
iconStyleGuideEditHref,
|
|
@@ -3811,7 +3963,7 @@ var BlockEditor = forwardRef(
|
|
|
3811
3963
|
sdkConfig = null,
|
|
3812
3964
|
customBlocks = [],
|
|
3813
3965
|
reorderControlMode = DEFAULT_REORDER_CONTROL_MODE,
|
|
3814
|
-
|
|
3966
|
+
actionPresentation = DEFAULT_BLOCK_ACTION_PRESENTATION
|
|
3815
3967
|
}, ref) {
|
|
3816
3968
|
const [blockList, setBlockList] = useState(
|
|
3817
3969
|
() => normalizeBlockListInitial(blocks)
|
|
@@ -4269,7 +4421,7 @@ var BlockEditor = forwardRef(
|
|
|
4269
4421
|
hideThemeV2RawStyleFields: hideThemeV2RawStyleFields2,
|
|
4270
4422
|
pageDesignBlock: block.id ? pageDesignBlockById.get(block.id) ?? null : null,
|
|
4271
4423
|
reorderControlMode,
|
|
4272
|
-
|
|
4424
|
+
actionPresentation,
|
|
4273
4425
|
currentStyleGuideVersionId: iconStyleGuide?.versionId ?? null,
|
|
4274
4426
|
iconStyleGuideSummary: iconStyleGuide?.summary ?? null,
|
|
4275
4427
|
iconStyleGuideEditHref: iconStyleGuide?.editHref ?? null,
|
|
@@ -5814,943 +5966,260 @@ function IconPickerField({ path, backend, config }) {
|
|
|
5814
5966
|
}
|
|
5815
5967
|
) });
|
|
5816
5968
|
}
|
|
5817
|
-
createContext(null);
|
|
5818
|
-
|
|
5819
|
-
|
|
5820
|
-
|
|
5821
|
-
|
|
5822
|
-
|
|
5823
|
-
}
|
|
5824
|
-
return JSON.parse(JSON.stringify(value));
|
|
5825
|
-
}
|
|
5826
|
-
function decodePointerSegment(segment) {
|
|
5827
|
-
return segment.replace(/~1/g, "/").replace(/~0/g, "~");
|
|
5969
|
+
var SiteOptionWidgetContext = createContext(null);
|
|
5970
|
+
function SiteOptionWidgetProvider({
|
|
5971
|
+
siteId,
|
|
5972
|
+
adapters,
|
|
5973
|
+
children
|
|
5974
|
+
}) {
|
|
5975
|
+
return /* @__PURE__ */ jsx(SiteOptionWidgetContext.Provider, { value: { siteId, adapters }, children });
|
|
5828
5976
|
}
|
|
5829
|
-
function
|
|
5830
|
-
|
|
5831
|
-
if (!
|
|
5832
|
-
throw new Error(
|
|
5977
|
+
function useSiteOptionWidgetContext() {
|
|
5978
|
+
const ctx = useContext(SiteOptionWidgetContext);
|
|
5979
|
+
if (!ctx) {
|
|
5980
|
+
throw new Error("useSiteOptionWidgetContext must be used within SiteOptionWidgetProvider");
|
|
5833
5981
|
}
|
|
5834
|
-
return
|
|
5835
|
-
}
|
|
5836
|
-
function isJsonObject(value) {
|
|
5837
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
5982
|
+
return ctx;
|
|
5838
5983
|
}
|
|
5839
|
-
|
|
5840
|
-
|
|
5841
|
-
|
|
5842
|
-
|
|
5843
|
-
|
|
5844
|
-
const key = segments[segments.length - 1];
|
|
5845
|
-
if (key === void 0) {
|
|
5846
|
-
throw new Error("Invalid path (missing key)");
|
|
5984
|
+
|
|
5985
|
+
// ../editor-blocks/src/widgets/site-option-picker/utils.ts
|
|
5986
|
+
function normalizeSiteOptionMultiValue(value) {
|
|
5987
|
+
if (Array.isArray(value)) {
|
|
5988
|
+
return value.filter((entry) => typeof entry === "string" && entry.trim().length > 0);
|
|
5847
5989
|
}
|
|
5848
|
-
|
|
5849
|
-
|
|
5850
|
-
|
|
5851
|
-
throw new Error(`Invalid path: ${pointer}`);
|
|
5852
|
-
}
|
|
5853
|
-
if (Array.isArray(container)) {
|
|
5854
|
-
const index = Number.parseInt(segment, 10);
|
|
5855
|
-
if (!Number.isFinite(index) || String(index) !== segment) {
|
|
5856
|
-
throw new Error(`Invalid array index "${segment}" in path: ${pointer}`);
|
|
5857
|
-
}
|
|
5858
|
-
container = container[index];
|
|
5859
|
-
continue;
|
|
5860
|
-
}
|
|
5861
|
-
if (isJsonObject(container)) {
|
|
5862
|
-
container = container[segment];
|
|
5863
|
-
continue;
|
|
5864
|
-
}
|
|
5865
|
-
throw new Error(`Invalid container for path: ${pointer}`);
|
|
5990
|
+
if (typeof value === "string") {
|
|
5991
|
+
const trimmed = value.trim();
|
|
5992
|
+
return trimmed ? [trimmed] : [];
|
|
5866
5993
|
}
|
|
5867
|
-
return
|
|
5994
|
+
return [];
|
|
5868
5995
|
}
|
|
5869
|
-
function
|
|
5870
|
-
|
|
5871
|
-
|
|
5872
|
-
|
|
5873
|
-
return;
|
|
5874
|
-
}
|
|
5875
|
-
const index = Number.parseInt(key, 10);
|
|
5876
|
-
if (!Number.isFinite(index) || String(index) !== key) {
|
|
5877
|
-
throw new Error(`Invalid array index "${key}" in path: ${pointer}`);
|
|
5878
|
-
}
|
|
5879
|
-
if (index < 0 || index > container.length) {
|
|
5880
|
-
throw new Error(`Array index out of bounds "${key}" in path: ${pointer}`);
|
|
5881
|
-
}
|
|
5882
|
-
container.splice(index, 0, value);
|
|
5883
|
-
return;
|
|
5884
|
-
}
|
|
5885
|
-
if (isJsonObject(container)) {
|
|
5886
|
-
container[key] = value;
|
|
5887
|
-
return;
|
|
5996
|
+
function getSiteOptionSource(config) {
|
|
5997
|
+
const raw = (config.ui ?? {}).siteOptionSource;
|
|
5998
|
+
if (typeof raw !== "string") {
|
|
5999
|
+
return null;
|
|
5888
6000
|
}
|
|
5889
|
-
|
|
6001
|
+
const trimmed = raw.trim();
|
|
6002
|
+
return siteOptionSources.includes(trimmed) ? trimmed : null;
|
|
5890
6003
|
}
|
|
5891
|
-
function
|
|
5892
|
-
|
|
5893
|
-
const index = Number.parseInt(key, 10);
|
|
5894
|
-
if (!Number.isFinite(index) || String(index) !== key) {
|
|
5895
|
-
throw new Error(`Invalid array index "${key}" in path: ${pointer}`);
|
|
5896
|
-
}
|
|
5897
|
-
if (index < 0 || index >= container.length) {
|
|
5898
|
-
throw new Error(`Array index out of bounds "${key}" in path: ${pointer}`);
|
|
5899
|
-
}
|
|
5900
|
-
container[index] = value;
|
|
5901
|
-
return;
|
|
5902
|
-
}
|
|
5903
|
-
if (isJsonObject(container)) {
|
|
5904
|
-
if (!(key in container)) {
|
|
5905
|
-
throw new Error(`Cannot replace missing key "${key}" in path: ${pointer}`);
|
|
5906
|
-
}
|
|
5907
|
-
container[key] = value;
|
|
5908
|
-
return;
|
|
5909
|
-
}
|
|
5910
|
-
throw new Error(`Invalid container for path: ${pointer}`);
|
|
6004
|
+
function getSearchThreshold(config) {
|
|
6005
|
+
return normalizePickerSearchThreshold((config.ui ?? {}).searchThreshold);
|
|
5911
6006
|
}
|
|
5912
|
-
function
|
|
5913
|
-
|
|
5914
|
-
|
|
5915
|
-
|
|
5916
|
-
|
|
5917
|
-
|
|
5918
|
-
|
|
5919
|
-
|
|
6007
|
+
function SiteOptionPickerField({
|
|
6008
|
+
path,
|
|
6009
|
+
backend,
|
|
6010
|
+
config
|
|
6011
|
+
}) {
|
|
6012
|
+
const { value, error, setValue } = useField(path, backend);
|
|
6013
|
+
const { siteId, adapters } = useSiteOptionWidgetContext();
|
|
6014
|
+
const source = getSiteOptionSource(config);
|
|
6015
|
+
const searchThreshold = getSearchThreshold(config);
|
|
6016
|
+
const adapter = useMemo(() => {
|
|
6017
|
+
if (!adapters || !source) return null;
|
|
6018
|
+
return adapters[source] ?? null;
|
|
6019
|
+
}, [adapters, source]);
|
|
6020
|
+
const labels = useMemo(() => {
|
|
6021
|
+
const defaults = {
|
|
6022
|
+
loading: "Loading options...",
|
|
6023
|
+
select: config.multiple ? "Select options" : "Select an option",
|
|
6024
|
+
empty: "No options available",
|
|
6025
|
+
emptySelection: config.multiple ? "No selections yet." : "No selection yet."
|
|
6026
|
+
};
|
|
6027
|
+
return { ...defaults, ...adapter?.labels ?? {} };
|
|
6028
|
+
}, [adapter, config.multiple]);
|
|
6029
|
+
const loadItems = useCallback(async () => {
|
|
6030
|
+
if (!adapter || !siteId || !source) {
|
|
6031
|
+
return [];
|
|
5920
6032
|
}
|
|
5921
|
-
|
|
5922
|
-
|
|
6033
|
+
return adapter.loadItems({ siteId, source });
|
|
6034
|
+
}, [adapter, siteId, source]);
|
|
6035
|
+
const { options: items, isLoading, errorMessage: loadError } = useAsyncPickerOptions({
|
|
6036
|
+
enabled: Boolean(adapter && siteId && source),
|
|
6037
|
+
loadOptions: loadItems
|
|
6038
|
+
});
|
|
6039
|
+
if (!adapter || !siteId || !source) {
|
|
6040
|
+
return /* @__PURE__ */ jsx(FieldFrame, { label: config.label, description: config.description, error: error?.message, children: () => /* @__PURE__ */ jsx("div", { className: "rounded-lg border border-dashed bg-muted/10 p-4 text-sm text-muted-foreground", children: "This field type is not supported yet." }) });
|
|
5923
6041
|
}
|
|
5924
|
-
|
|
5925
|
-
|
|
5926
|
-
|
|
5927
|
-
|
|
5928
|
-
|
|
5929
|
-
return
|
|
6042
|
+
const manageLink = adapter.renderManageLink?.({ siteId, source });
|
|
6043
|
+
const showSearch = shouldShowPickerSearch(items.length, searchThreshold);
|
|
6044
|
+
const helperText = loadError ? loadError : isLoading ? labels.loading : void 0;
|
|
6045
|
+
if (config.multiple) {
|
|
6046
|
+
const selectedValues = normalizeSiteOptionMultiValue(value);
|
|
6047
|
+
return /* @__PURE__ */ jsx(
|
|
6048
|
+
FieldFrame,
|
|
6049
|
+
{
|
|
6050
|
+
label: config.label,
|
|
6051
|
+
description: config.description,
|
|
6052
|
+
error: error?.message,
|
|
6053
|
+
hint: helperText ?? labels.emptySelection,
|
|
6054
|
+
children: () => /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
6055
|
+
/* @__PURE__ */ jsx(
|
|
6056
|
+
CommandMultiSelect,
|
|
6057
|
+
{
|
|
6058
|
+
items: items.map((item) => ({
|
|
6059
|
+
id: item.value,
|
|
6060
|
+
label: item.label,
|
|
6061
|
+
subtitle: item.subtitle
|
|
6062
|
+
})),
|
|
6063
|
+
values: selectedValues,
|
|
6064
|
+
onValuesChange: (nextValues) => setValue(nextValues),
|
|
6065
|
+
placeholder: labels.select,
|
|
6066
|
+
emptySelectionLabel: labels.emptySelection,
|
|
6067
|
+
emptyLabel: labels.empty,
|
|
6068
|
+
isLoading,
|
|
6069
|
+
error: loadError,
|
|
6070
|
+
selectedSummary: (selectedItems) => selectedItems.length === 1 ? selectedItems[0]?.label ?? "1 selected" : `${selectedItems.length} selected`,
|
|
6071
|
+
showSearch,
|
|
6072
|
+
searchPlaceholder: `Search ${config.label.toLowerCase()}...`
|
|
6073
|
+
}
|
|
6074
|
+
),
|
|
6075
|
+
manageLink ? /* @__PURE__ */ jsx("div", { className: "flex justify-end", children: manageLink }) : null
|
|
6076
|
+
] })
|
|
6077
|
+
}
|
|
6078
|
+
);
|
|
5930
6079
|
}
|
|
5931
|
-
|
|
5932
|
-
|
|
5933
|
-
|
|
5934
|
-
|
|
5935
|
-
|
|
5936
|
-
const { container, key } = getContainerAndKey(next, op.path);
|
|
5937
|
-
if (op.op === "add") {
|
|
5938
|
-
applyAdd(container, key, op.value, op.path);
|
|
5939
|
-
continue;
|
|
5940
|
-
}
|
|
5941
|
-
if (op.op === "replace") {
|
|
5942
|
-
applyReplace(container, key, op.value, op.path);
|
|
5943
|
-
continue;
|
|
5944
|
-
}
|
|
5945
|
-
applyRemove(container, key, op.path);
|
|
5946
|
-
}
|
|
5947
|
-
return next;
|
|
5948
|
-
}
|
|
5949
|
-
var PreviewThemeOverlayContext = createContext(null);
|
|
5950
|
-
var NO_THEME_OVERLAY = { kind: "none" };
|
|
5951
|
-
function isDebugEnabled() {
|
|
5952
|
-
return process.env.NEXT_PUBLIC_AI_ASSISTANT_DEBUG === "1";
|
|
5953
|
-
}
|
|
5954
|
-
function PreviewThemeOverlayProvider({ baseTheme, children }) {
|
|
5955
|
-
const [overlay, setOverlay] = useState(NO_THEME_OVERLAY);
|
|
5956
|
-
const overlayOps = overlay.kind === "patch" ? [...overlay.ops] : null;
|
|
5957
|
-
const overlayOpsSource = overlay.kind === "patch" ? overlay.source : null;
|
|
5958
|
-
const overrideTheme = overlay.kind === "theme" ? overlay.theme : null;
|
|
5959
|
-
const overrideThemeSource = overlay.kind === "theme" ? overlay.source : null;
|
|
5960
|
-
const setOverlayOps = useCallback(
|
|
5961
|
-
(ops, options) => {
|
|
5962
|
-
setOverlay((current) => {
|
|
5963
|
-
if (ops === null) {
|
|
5964
|
-
if (current.kind !== "patch") return current;
|
|
5965
|
-
if (options?.source && current.source !== options.source) return current;
|
|
5966
|
-
return NO_THEME_OVERLAY;
|
|
5967
|
-
}
|
|
5968
|
-
return {
|
|
5969
|
-
kind: "patch",
|
|
5970
|
-
source: options?.source ?? "unknown",
|
|
5971
|
-
ops
|
|
5972
|
-
};
|
|
5973
|
-
});
|
|
5974
|
-
},
|
|
5975
|
-
[]
|
|
5976
|
-
);
|
|
5977
|
-
const setOverrideTheme = useCallback(
|
|
5978
|
-
(theme, options) => {
|
|
5979
|
-
setOverlay((current) => {
|
|
5980
|
-
if (theme === null) {
|
|
5981
|
-
if (current.kind !== "theme") return current;
|
|
5982
|
-
if (options?.source && current.source !== options.source) return current;
|
|
5983
|
-
return NO_THEME_OVERLAY;
|
|
5984
|
-
}
|
|
5985
|
-
return {
|
|
5986
|
-
kind: "theme",
|
|
5987
|
-
source: options?.source ?? "unknown",
|
|
5988
|
-
theme
|
|
5989
|
-
};
|
|
5990
|
-
});
|
|
5991
|
-
},
|
|
5992
|
-
[]
|
|
6080
|
+
const currentValue = typeof value === "string" ? value : "";
|
|
6081
|
+
const selectionLabel = resolvePickerSelectionLabel(
|
|
6082
|
+
currentValue || null,
|
|
6083
|
+
items,
|
|
6084
|
+
({ value: value2, options }) => adapter.formatSelectionLabel?.({ value: value2, items: options }) ?? value2
|
|
5993
6085
|
);
|
|
5994
|
-
|
|
5995
|
-
|
|
5996
|
-
|
|
5997
|
-
|
|
5998
|
-
|
|
5999
|
-
|
|
6000
|
-
|
|
6001
|
-
|
|
6002
|
-
|
|
6003
|
-
|
|
6004
|
-
|
|
6005
|
-
|
|
6006
|
-
|
|
6007
|
-
|
|
6008
|
-
|
|
6009
|
-
|
|
6010
|
-
|
|
6011
|
-
|
|
6012
|
-
|
|
6013
|
-
|
|
6014
|
-
|
|
6086
|
+
return /* @__PURE__ */ jsx(
|
|
6087
|
+
FieldFrame,
|
|
6088
|
+
{
|
|
6089
|
+
label: config.label,
|
|
6090
|
+
description: config.description,
|
|
6091
|
+
error: error?.message,
|
|
6092
|
+
hint: helperText ?? (selectionLabel ? `Selected: ${selectionLabel}` : labels.emptySelection),
|
|
6093
|
+
children: ({ id, messageId }) => /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
6094
|
+
/* @__PURE__ */ jsx(
|
|
6095
|
+
Combobox,
|
|
6096
|
+
{
|
|
6097
|
+
id,
|
|
6098
|
+
"aria-describedby": messageId || void 0,
|
|
6099
|
+
items: items.map((item) => ({
|
|
6100
|
+
id: item.value,
|
|
6101
|
+
label: item.label,
|
|
6102
|
+
item
|
|
6103
|
+
})),
|
|
6104
|
+
value: currentValue || void 0,
|
|
6105
|
+
onSelect: (entry) => setValue(entry?.id ?? ""),
|
|
6106
|
+
placeholder: isLoading ? labels.loading : labels.select,
|
|
6107
|
+
emptyMessage: labels.empty,
|
|
6108
|
+
clearLabel: "Clear",
|
|
6109
|
+
search: showSearch,
|
|
6110
|
+
searchInputAriaLabel: `Search ${config.label}`,
|
|
6111
|
+
disabled: Boolean(isLoading || loadError)
|
|
6112
|
+
}
|
|
6113
|
+
),
|
|
6114
|
+
manageLink ? /* @__PURE__ */ jsx("div", { className: "flex justify-end", children: manageLink }) : null
|
|
6115
|
+
] })
|
|
6015
6116
|
}
|
|
6016
|
-
}, [baseTheme, overlay]);
|
|
6017
|
-
const value = useMemo(
|
|
6018
|
-
() => ({
|
|
6019
|
-
baseTheme,
|
|
6020
|
-
overlay,
|
|
6021
|
-
overlayOps,
|
|
6022
|
-
overlayOpsSource,
|
|
6023
|
-
setOverlayOps,
|
|
6024
|
-
overrideTheme,
|
|
6025
|
-
overrideThemeSource,
|
|
6026
|
-
setOverrideTheme,
|
|
6027
|
-
effectiveTheme,
|
|
6028
|
-
clearOverlay
|
|
6029
|
-
}),
|
|
6030
|
-
[
|
|
6031
|
-
baseTheme,
|
|
6032
|
-
clearOverlay,
|
|
6033
|
-
effectiveTheme,
|
|
6034
|
-
overlay,
|
|
6035
|
-
overlayOps,
|
|
6036
|
-
overlayOpsSource,
|
|
6037
|
-
overrideTheme,
|
|
6038
|
-
overrideThemeSource,
|
|
6039
|
-
setOverlayOps,
|
|
6040
|
-
setOverrideTheme
|
|
6041
|
-
]
|
|
6042
6117
|
);
|
|
6043
|
-
return /* @__PURE__ */ jsx(PreviewThemeOverlayContext.Provider, { value, children });
|
|
6044
6118
|
}
|
|
6045
|
-
|
|
6046
|
-
|
|
6047
|
-
|
|
6048
|
-
|
|
6119
|
+
createContext(null);
|
|
6120
|
+
|
|
6121
|
+
// ../editor-blocks/src/widgets/site-option-picker/loaders.ts
|
|
6122
|
+
var siteOptionWidgetLabels = {
|
|
6123
|
+
eventCategories: {
|
|
6124
|
+
loading: "Loading categories...",
|
|
6125
|
+
select: "Select categories",
|
|
6126
|
+
empty: "No categories yet",
|
|
6127
|
+
emptySelection: "Choose which event categories to include."
|
|
6128
|
+
},
|
|
6129
|
+
venues: {
|
|
6130
|
+
loading: "Loading venues...",
|
|
6131
|
+
select: "Select a venue",
|
|
6132
|
+
empty: "No venues yet",
|
|
6133
|
+
emptySelection: "Choose a venue to restrict this block."
|
|
6134
|
+
},
|
|
6135
|
+
staffMembers: {
|
|
6136
|
+
loading: "Loading staff...",
|
|
6137
|
+
select: "Select a staff member",
|
|
6138
|
+
empty: "No staff yet",
|
|
6139
|
+
emptySelection: "Choose a staff member to restrict this block."
|
|
6049
6140
|
}
|
|
6050
|
-
|
|
6141
|
+
};
|
|
6142
|
+
function mapEventCategoriesToSiteOptionItems(payload) {
|
|
6143
|
+
return payload.categories.map((category) => ({
|
|
6144
|
+
value: category.id,
|
|
6145
|
+
label: category.name,
|
|
6146
|
+
subtitle: category.identifier
|
|
6147
|
+
}));
|
|
6051
6148
|
}
|
|
6052
|
-
|
|
6053
|
-
|
|
6054
|
-
|
|
6055
|
-
|
|
6056
|
-
|
|
6057
|
-
|
|
6058
|
-
|
|
6059
|
-
|
|
6060
|
-
|
|
6061
|
-
|
|
6062
|
-
|
|
6063
|
-
|
|
6064
|
-
|
|
6065
|
-
|
|
6066
|
-
|
|
6149
|
+
function mapVenuesToSiteOptionItems(payload) {
|
|
6150
|
+
return payload.map((venue) => ({
|
|
6151
|
+
value: venue.id,
|
|
6152
|
+
label: venue.title
|
|
6153
|
+
}));
|
|
6154
|
+
}
|
|
6155
|
+
function mapStaffMembersToSiteOptionItems(payload) {
|
|
6156
|
+
return payload.resources.map((staffMember) => ({
|
|
6157
|
+
value: staffMember.id,
|
|
6158
|
+
label: staffMember.displayName,
|
|
6159
|
+
subtitle: staffMember.bio ?? void 0
|
|
6160
|
+
}));
|
|
6161
|
+
}
|
|
6162
|
+
async function loadSiteOptionItemsFromApi({
|
|
6163
|
+
apiClient,
|
|
6164
|
+
siteId,
|
|
6165
|
+
source
|
|
6166
|
+
}) {
|
|
6167
|
+
switch (source) {
|
|
6168
|
+
case "eventCategories": {
|
|
6169
|
+
const result = await apiClient({
|
|
6170
|
+
endpoint: "listEventCategories",
|
|
6171
|
+
params: { siteId }
|
|
6067
6172
|
});
|
|
6068
|
-
|
|
6069
|
-
|
|
6070
|
-
|
|
6071
|
-
|
|
6072
|
-
|
|
6073
|
-
|
|
6074
|
-
}, {
|
|
6075
|
-
kind: "set-theme",
|
|
6076
|
-
source: command.producer,
|
|
6077
|
-
theme: command.theme
|
|
6173
|
+
return mapEventCategoriesToSiteOptionItems(unwrapResponse(result));
|
|
6174
|
+
}
|
|
6175
|
+
case "venues": {
|
|
6176
|
+
const result = await apiClient({
|
|
6177
|
+
endpoint: "listVenues",
|
|
6178
|
+
params: { siteId }
|
|
6078
6179
|
});
|
|
6079
|
-
|
|
6080
|
-
|
|
6081
|
-
|
|
6082
|
-
|
|
6083
|
-
|
|
6084
|
-
|
|
6085
|
-
}
|
|
6086
|
-
return
|
|
6087
|
-
|
|
6088
|
-
if (state.kind === "idle") {
|
|
6089
|
-
return accepted(state, { kind: "none" });
|
|
6090
|
-
}
|
|
6091
|
-
return accepted(NO_PREVIEW_DESIGN_STATE, { kind: "clear" });
|
|
6092
|
-
case "apply-started":
|
|
6093
|
-
if (state.kind === "idle") {
|
|
6094
|
-
return ignored(state, "no-active-preview");
|
|
6095
|
-
}
|
|
6096
|
-
if (state.owner !== command.producer) {
|
|
6097
|
-
return ignored(state, "producer-does-not-own-preview");
|
|
6098
|
-
}
|
|
6099
|
-
return accepted({ ...state, apply: "pending" }, { kind: "none" });
|
|
6100
|
-
case "apply-succeeded":
|
|
6101
|
-
if (state.kind === "idle") {
|
|
6102
|
-
return ignored(state, "apply-event-for-displaced-preview");
|
|
6103
|
-
}
|
|
6104
|
-
if (state.owner !== command.producer) {
|
|
6105
|
-
return ignored(state, "apply-event-for-displaced-preview");
|
|
6106
|
-
}
|
|
6107
|
-
return accepted(NO_PREVIEW_DESIGN_STATE, { kind: "clear" });
|
|
6108
|
-
case "apply-failed":
|
|
6109
|
-
if (state.kind === "idle") {
|
|
6110
|
-
return ignored(state, "apply-event-for-displaced-preview");
|
|
6111
|
-
}
|
|
6112
|
-
if (state.owner !== command.producer) {
|
|
6113
|
-
return ignored(state, "apply-event-for-displaced-preview");
|
|
6114
|
-
}
|
|
6115
|
-
return accepted({ ...state, apply: "idle" }, { kind: "none" });
|
|
6180
|
+
return mapVenuesToSiteOptionItems(unwrapResponse(result));
|
|
6181
|
+
}
|
|
6182
|
+
case "staffMembers": {
|
|
6183
|
+
const result = await apiClient({
|
|
6184
|
+
endpoint: "listAppointmentResources",
|
|
6185
|
+
params: { siteId }
|
|
6186
|
+
});
|
|
6187
|
+
return mapStaffMembersToSiteOptionItems(unwrapResponse(result));
|
|
6188
|
+
}
|
|
6116
6189
|
default:
|
|
6117
|
-
return
|
|
6190
|
+
return assertNever(source);
|
|
6118
6191
|
}
|
|
6119
6192
|
}
|
|
6120
|
-
function
|
|
6121
|
-
return
|
|
6122
|
-
}
|
|
6123
|
-
function accepted(state, effect) {
|
|
6124
|
-
return {
|
|
6125
|
-
kind: "accepted",
|
|
6126
|
-
state,
|
|
6127
|
-
effect
|
|
6128
|
-
};
|
|
6193
|
+
function createSiteOptionApiLoader(apiClient) {
|
|
6194
|
+
return (args) => loadSiteOptionItemsFromApi({ apiClient, ...args });
|
|
6129
6195
|
}
|
|
6130
|
-
function
|
|
6196
|
+
function createSiteOptionWidgetAdapters({
|
|
6197
|
+
loadItems,
|
|
6198
|
+
mapLoadError,
|
|
6199
|
+
renderManageLink
|
|
6200
|
+
}) {
|
|
6131
6201
|
return {
|
|
6132
|
-
|
|
6133
|
-
|
|
6134
|
-
|
|
6202
|
+
eventCategories: createSiteOptionWidgetAdapter("eventCategories", loadItems, mapLoadError, renderManageLink),
|
|
6203
|
+
venues: createSiteOptionWidgetAdapter("venues", loadItems, mapLoadError, renderManageLink),
|
|
6204
|
+
staffMembers: createSiteOptionWidgetAdapter("staffMembers", loadItems, mapLoadError, renderManageLink)
|
|
6135
6205
|
};
|
|
6136
6206
|
}
|
|
6137
|
-
|
|
6138
|
-
function PreviewDesignCoordinatorProvider({ children }) {
|
|
6139
|
-
const themeOverlay = usePreviewThemeOverlay();
|
|
6140
|
-
const {
|
|
6141
|
-
baseTheme,
|
|
6142
|
-
clearOverlay,
|
|
6143
|
-
overlay,
|
|
6144
|
-
setOverlayOps,
|
|
6145
|
-
setOverrideTheme
|
|
6146
|
-
} = themeOverlay;
|
|
6147
|
-
const [state, setState] = useState(NO_PREVIEW_DESIGN_STATE);
|
|
6148
|
-
const stateRef = useRef(state);
|
|
6149
|
-
const previousBaseThemeRef = useRef(null);
|
|
6150
|
-
useEffect(() => {
|
|
6151
|
-
stateRef.current = state;
|
|
6152
|
-
}, [state]);
|
|
6153
|
-
const dispatch = useCallback(
|
|
6154
|
-
(command) => {
|
|
6155
|
-
const transition = transitionPreviewDesignState(stateRef.current, command);
|
|
6156
|
-
if (transition.kind === "accepted") {
|
|
6157
|
-
stateRef.current = transition.state;
|
|
6158
|
-
setState(transition.state);
|
|
6159
|
-
switch (transition.effect.kind) {
|
|
6160
|
-
case "none":
|
|
6161
|
-
break;
|
|
6162
|
-
case "clear":
|
|
6163
|
-
clearOverlay();
|
|
6164
|
-
break;
|
|
6165
|
-
case "set-patch":
|
|
6166
|
-
setOverlayOps([...transition.effect.ops], {
|
|
6167
|
-
source: transition.effect.source
|
|
6168
|
-
});
|
|
6169
|
-
break;
|
|
6170
|
-
case "set-theme":
|
|
6171
|
-
setOverrideTheme(transition.effect.theme, {
|
|
6172
|
-
source: transition.effect.source
|
|
6173
|
-
});
|
|
6174
|
-
break;
|
|
6175
|
-
default:
|
|
6176
|
-
assertNever2(transition.effect, "Unhandled preview design overlay effect");
|
|
6177
|
-
}
|
|
6178
|
-
}
|
|
6179
|
-
return transition;
|
|
6180
|
-
},
|
|
6181
|
-
[clearOverlay, setOverlayOps, setOverrideTheme]
|
|
6182
|
-
);
|
|
6183
|
-
useEffect(() => {
|
|
6184
|
-
if (previousBaseThemeRef.current && previousBaseThemeRef.current !== baseTheme) {
|
|
6185
|
-
dispatch({ kind: "base-theme-changed" });
|
|
6186
|
-
}
|
|
6187
|
-
previousBaseThemeRef.current = baseTheme;
|
|
6188
|
-
}, [baseTheme, dispatch]);
|
|
6189
|
-
const previewTheme = useCallback(
|
|
6190
|
-
(producer, theme, sourcePlan) => dispatch({ kind: "preview-theme", producer, theme, sourcePlan }),
|
|
6191
|
-
[dispatch]
|
|
6192
|
-
);
|
|
6193
|
-
const previewThemePatch = useCallback(
|
|
6194
|
-
(producer, ops) => dispatch({ kind: "preview-theme-patch", producer, ops }),
|
|
6195
|
-
[dispatch]
|
|
6196
|
-
);
|
|
6197
|
-
const clearPreview = useCallback(
|
|
6198
|
-
(producer) => dispatch({ kind: "clear-preview", producer }),
|
|
6199
|
-
[dispatch]
|
|
6200
|
-
);
|
|
6201
|
-
const applyStarted = useCallback(
|
|
6202
|
-
(producer) => dispatch({ kind: "apply-started", producer }),
|
|
6203
|
-
[dispatch]
|
|
6204
|
-
);
|
|
6205
|
-
const applySucceeded = useCallback(
|
|
6206
|
-
(producer) => dispatch({ kind: "apply-succeeded", producer }),
|
|
6207
|
-
[dispatch]
|
|
6208
|
-
);
|
|
6209
|
-
const applyFailed = useCallback(
|
|
6210
|
-
(producer) => dispatch({ kind: "apply-failed", producer }),
|
|
6211
|
-
[dispatch]
|
|
6212
|
-
);
|
|
6213
|
-
const value = useMemo(
|
|
6214
|
-
() => ({
|
|
6215
|
-
state,
|
|
6216
|
-
overlay,
|
|
6217
|
-
dispatch,
|
|
6218
|
-
previewTheme,
|
|
6219
|
-
previewThemePatch,
|
|
6220
|
-
clearPreview,
|
|
6221
|
-
applyStarted,
|
|
6222
|
-
applySucceeded,
|
|
6223
|
-
applyFailed
|
|
6224
|
-
}),
|
|
6225
|
-
[
|
|
6226
|
-
applyFailed,
|
|
6227
|
-
applyStarted,
|
|
6228
|
-
applySucceeded,
|
|
6229
|
-
clearPreview,
|
|
6230
|
-
dispatch,
|
|
6231
|
-
previewTheme,
|
|
6232
|
-
previewThemePatch,
|
|
6233
|
-
state,
|
|
6234
|
-
overlay
|
|
6235
|
-
]
|
|
6236
|
-
);
|
|
6237
|
-
return /* @__PURE__ */ jsx(PreviewDesignCoordinatorContext.Provider, { value, children });
|
|
6238
|
-
}
|
|
6239
|
-
function usePreviewDesignCoordinator() {
|
|
6240
|
-
const ctx = useContext(PreviewDesignCoordinatorContext);
|
|
6241
|
-
if (!ctx) {
|
|
6242
|
-
throw new Error("usePreviewDesignCoordinator must be used within PreviewDesignCoordinatorProvider");
|
|
6243
|
-
}
|
|
6244
|
-
return ctx;
|
|
6245
|
-
}
|
|
6246
|
-
|
|
6247
|
-
// ../preview-next/src/client/blocks/runOptimisticCustomizeAction.ts
|
|
6248
|
-
function createOptimisticActionRunner() {
|
|
6249
|
-
let latest = 0;
|
|
6207
|
+
function createSiteOptionWidgetAdapter(source, loadItems, mapLoadError, renderManageLink) {
|
|
6250
6208
|
return {
|
|
6251
|
-
|
|
6252
|
-
|
|
6253
|
-
|
|
6254
|
-
|
|
6209
|
+
labels: siteOptionWidgetLabels[source],
|
|
6210
|
+
renderManageLink: renderManageLink?.[source],
|
|
6211
|
+
loadItems: async ({ siteId }) => {
|
|
6212
|
+
if (!siteId) return [];
|
|
6213
|
+
const args = { siteId, source };
|
|
6255
6214
|
try {
|
|
6256
|
-
|
|
6257
|
-
if (seq !== latest) return seq;
|
|
6258
|
-
action.onSuccess(success);
|
|
6215
|
+
return await loadItems(args);
|
|
6259
6216
|
} catch (error) {
|
|
6260
|
-
|
|
6261
|
-
action.onError(error);
|
|
6217
|
+
throw mapLoadError ? mapLoadError(error, args) : error;
|
|
6262
6218
|
}
|
|
6263
|
-
return seq;
|
|
6264
|
-
},
|
|
6265
|
-
invalidate() {
|
|
6266
|
-
latest += 1;
|
|
6267
|
-
},
|
|
6268
|
-
current() {
|
|
6269
|
-
return latest;
|
|
6270
6219
|
}
|
|
6271
6220
|
};
|
|
6272
6221
|
}
|
|
6273
6222
|
|
|
6274
|
-
// ../preview-next/src/client/preview/StyleConfigurator.state.ts
|
|
6275
|
-
function createStyleConfiguratorState(base) {
|
|
6276
|
-
return {
|
|
6277
|
-
base,
|
|
6278
|
-
previewed: base,
|
|
6279
|
-
saveStatus: { kind: "idle" },
|
|
6280
|
-
warnings: [],
|
|
6281
|
-
notices: [],
|
|
6282
|
-
paletteOverrideDrafts: paletteOverrideDraftsFromSnapshot(base),
|
|
6283
|
-
expandedRow: null
|
|
6284
|
-
};
|
|
6285
|
-
}
|
|
6286
|
-
function openRow(state, row) {
|
|
6287
|
-
return state.expandedRow === row ? state : { ...state, expandedRow: row };
|
|
6288
|
-
}
|
|
6289
|
-
function isPreviewingChange(state) {
|
|
6290
|
-
return !selectionSnapshotsEqual(state.base, state.previewed);
|
|
6291
|
-
}
|
|
6292
|
-
function previewSiteStyle(state, siteStyleId) {
|
|
6293
|
-
return {
|
|
6294
|
-
...state,
|
|
6295
|
-
previewed: { ...state.previewed, siteStyleId },
|
|
6296
|
-
saveStatus: { kind: "idle" }
|
|
6297
|
-
};
|
|
6298
|
-
}
|
|
6299
|
-
function previewButtonPersonality(state, buttonPersonalityId) {
|
|
6300
|
-
return {
|
|
6301
|
-
...state,
|
|
6302
|
-
previewed: { ...state.previewed, buttonPersonalityId },
|
|
6303
|
-
saveStatus: { kind: "idle" }
|
|
6304
|
-
};
|
|
6305
|
-
}
|
|
6306
|
-
function previewHeaderLayout(state, headerLayoutId) {
|
|
6307
|
-
const headerStyleId = deriveNearestCompatibleHeaderStyle(
|
|
6308
|
-
state.previewed.headerStyleId,
|
|
6309
|
-
headerLayoutId
|
|
6310
|
-
);
|
|
6311
|
-
return previewHeaderSelection(state, { headerLayoutId, headerStyleId });
|
|
6312
|
-
}
|
|
6313
|
-
function previewHeaderStyle(state, headerStyleId) {
|
|
6314
|
-
return previewHeaderSelection(state, {
|
|
6315
|
-
headerLayoutId: state.previewed.headerLayoutId,
|
|
6316
|
-
headerStyleId
|
|
6317
|
-
});
|
|
6318
|
-
}
|
|
6319
|
-
function previewFooterLook(state, footerLookId) {
|
|
6320
|
-
return {
|
|
6321
|
-
...state,
|
|
6322
|
-
previewed: { ...state.previewed, footerLookId },
|
|
6323
|
-
saveStatus: { kind: "idle" }
|
|
6324
|
-
};
|
|
6325
|
-
}
|
|
6326
|
-
function previewTypographyPreset(state, typographyPresetId) {
|
|
6327
|
-
return {
|
|
6328
|
-
...state,
|
|
6329
|
-
previewed: { ...state.previewed, typographyPresetId },
|
|
6330
|
-
saveStatus: { kind: "idle" }
|
|
6331
|
-
};
|
|
6332
|
-
}
|
|
6333
|
-
function setTypographyBodyFontOverride(state, typographyBodyFontOverride) {
|
|
6334
|
-
return {
|
|
6335
|
-
...state,
|
|
6336
|
-
previewed: { ...state.previewed, typographyBodyFontOverride },
|
|
6337
|
-
saveStatus: { kind: "idle" }
|
|
6338
|
-
};
|
|
6339
|
-
}
|
|
6340
|
-
function setTypographyHeadingFontOverride(state, typographyHeadingFontOverride) {
|
|
6341
|
-
return {
|
|
6342
|
-
...state,
|
|
6343
|
-
previewed: { ...state.previewed, typographyHeadingFontOverride },
|
|
6344
|
-
saveStatus: { kind: "idle" }
|
|
6345
|
-
};
|
|
6346
|
-
}
|
|
6347
|
-
function clearTypographyFontOverrides(state) {
|
|
6348
|
-
return {
|
|
6349
|
-
...state,
|
|
6350
|
-
previewed: {
|
|
6351
|
-
...state.previewed,
|
|
6352
|
-
typographyBodyFontOverride: null,
|
|
6353
|
-
typographyHeadingFontOverride: null
|
|
6354
|
-
},
|
|
6355
|
-
saveStatus: { kind: "idle" }
|
|
6356
|
-
};
|
|
6357
|
-
}
|
|
6358
|
-
function previewPaletteVariant(state, paletteVariantId) {
|
|
6359
|
-
return movePreviewToPaletteVariant(state, paletteVariantId);
|
|
6360
|
-
}
|
|
6361
|
-
function setPaletteOverrides(state, paletteOverrides) {
|
|
6362
|
-
const paletteOverrideDrafts = withPaletteOverrideDraft(
|
|
6363
|
-
state.paletteOverrideDrafts,
|
|
6364
|
-
state.previewed.paletteVariantId,
|
|
6365
|
-
paletteOverrides
|
|
6366
|
-
);
|
|
6367
|
-
return {
|
|
6368
|
-
...state,
|
|
6369
|
-
previewed: { ...state.previewed, paletteOverrides },
|
|
6370
|
-
paletteOverrideDrafts,
|
|
6371
|
-
saveStatus: { kind: "idle" }
|
|
6372
|
-
};
|
|
6373
|
-
}
|
|
6374
|
-
function applyResolvedSelections(state, input) {
|
|
6375
|
-
const paletteScoped = movePreviewToPaletteVariant(state, input.resolved.paletteVariantId);
|
|
6376
|
-
return {
|
|
6377
|
-
...paletteScoped,
|
|
6378
|
-
previewed: {
|
|
6379
|
-
...paletteScoped.previewed,
|
|
6380
|
-
buttonPersonalityId: input.resolved.buttonPersonalityId,
|
|
6381
|
-
headerLayoutId: input.resolved.headerLayoutId,
|
|
6382
|
-
headerStyleId: input.resolved.headerStyleId,
|
|
6383
|
-
headerLookId: input.resolved.headerLookId,
|
|
6384
|
-
typographyPresetId: input.resolved.typographyPresetId,
|
|
6385
|
-
typographyBodyFontOverride: input.resolved.typographyBodyFontOverride,
|
|
6386
|
-
typographyHeadingFontOverride: input.resolved.typographyHeadingFontOverride
|
|
6387
|
-
},
|
|
6388
|
-
warnings: input.warnings
|
|
6389
|
-
};
|
|
6390
|
-
}
|
|
6391
|
-
function cancelPreview(state) {
|
|
6392
|
-
return {
|
|
6393
|
-
...state,
|
|
6394
|
-
previewed: state.base,
|
|
6395
|
-
saveStatus: { kind: "idle" },
|
|
6396
|
-
warnings: [],
|
|
6397
|
-
notices: [],
|
|
6398
|
-
paletteOverrideDrafts: paletteOverrideDraftsFromSnapshot(state.base)
|
|
6399
|
-
};
|
|
6400
|
-
}
|
|
6401
|
-
function markApplySaving(state) {
|
|
6402
|
-
return { ...state, saveStatus: { kind: "saving" } };
|
|
6403
|
-
}
|
|
6404
|
-
function markApplySaved(state, persisted) {
|
|
6405
|
-
return {
|
|
6406
|
-
...state,
|
|
6407
|
-
base: persisted,
|
|
6408
|
-
previewed: persisted,
|
|
6409
|
-
saveStatus: { kind: "saved" },
|
|
6410
|
-
warnings: [],
|
|
6411
|
-
notices: [],
|
|
6412
|
-
paletteOverrideDrafts: paletteOverrideDraftsFromSnapshot(persisted)
|
|
6413
|
-
};
|
|
6414
|
-
}
|
|
6415
|
-
function markApplyFailed(state, message) {
|
|
6416
|
-
return {
|
|
6417
|
-
...state,
|
|
6418
|
-
saveStatus: { kind: "failed", message }
|
|
6419
|
-
};
|
|
6420
|
-
}
|
|
6421
|
-
function toggleRow(state, row) {
|
|
6422
|
-
return {
|
|
6423
|
-
...state,
|
|
6424
|
-
expandedRow: state.expandedRow === row ? null : row
|
|
6425
|
-
};
|
|
6426
|
-
}
|
|
6427
|
-
function dismissWarnings(state) {
|
|
6428
|
-
if (state.warnings.length === 0) return state;
|
|
6429
|
-
return { ...state, warnings: [] };
|
|
6430
|
-
}
|
|
6431
|
-
function dismissNotices(state) {
|
|
6432
|
-
if (state.notices.length === 0) return state;
|
|
6433
|
-
return { ...state, notices: [] };
|
|
6434
|
-
}
|
|
6435
|
-
function syncStyleConfiguratorState(state, base) {
|
|
6436
|
-
if (selectionSnapshotsEqual(state.base, base)) return state;
|
|
6437
|
-
if (selectionSnapshotsEqual(state.previewed, base)) {
|
|
6438
|
-
return {
|
|
6439
|
-
...state,
|
|
6440
|
-
base,
|
|
6441
|
-
saveStatus: state.saveStatus.kind === "saving" ? { kind: "saved" } : state.saveStatus,
|
|
6442
|
-
warnings: [],
|
|
6443
|
-
notices: [],
|
|
6444
|
-
paletteOverrideDrafts: paletteOverrideDraftsFromSnapshot(base)
|
|
6445
|
-
};
|
|
6446
|
-
}
|
|
6447
|
-
return {
|
|
6448
|
-
...state,
|
|
6449
|
-
base,
|
|
6450
|
-
previewed: base,
|
|
6451
|
-
saveStatus: { kind: "idle" },
|
|
6452
|
-
warnings: [],
|
|
6453
|
-
notices: [],
|
|
6454
|
-
paletteOverrideDrafts: paletteOverrideDraftsFromSnapshot(base)
|
|
6455
|
-
};
|
|
6456
|
-
}
|
|
6457
|
-
function movePreviewToPaletteVariant(state, paletteVariantId) {
|
|
6458
|
-
if (state.previewed.paletteVariantId === paletteVariantId) {
|
|
6459
|
-
return {
|
|
6460
|
-
...state,
|
|
6461
|
-
saveStatus: { kind: "idle" }
|
|
6462
|
-
};
|
|
6463
|
-
}
|
|
6464
|
-
const paletteOverrideDrafts = withPaletteOverrideDraft(
|
|
6465
|
-
state.paletteOverrideDrafts,
|
|
6466
|
-
state.previewed.paletteVariantId,
|
|
6467
|
-
state.previewed.paletteOverrides
|
|
6468
|
-
);
|
|
6469
|
-
const restoredOverrides = paletteOverrideDrafts[paletteVariantId] ?? null;
|
|
6470
|
-
return {
|
|
6471
|
-
...state,
|
|
6472
|
-
previewed: {
|
|
6473
|
-
...state.previewed,
|
|
6474
|
-
paletteVariantId,
|
|
6475
|
-
paletteOverrides: restoredOverrides
|
|
6476
|
-
},
|
|
6477
|
-
paletteOverrideDrafts,
|
|
6478
|
-
notices: appendPaletteOverrideScopeNotice(state.notices, {
|
|
6479
|
-
previousOverrides: state.previewed.paletteOverrides,
|
|
6480
|
-
restoredOverrides
|
|
6481
|
-
}),
|
|
6482
|
-
saveStatus: { kind: "idle" }
|
|
6483
|
-
};
|
|
6484
|
-
}
|
|
6485
|
-
function previewHeaderSelection(state, selection) {
|
|
6486
|
-
const headerStyleId = deriveNearestCompatibleHeaderStyle(
|
|
6487
|
-
selection.headerStyleId,
|
|
6488
|
-
selection.headerLayoutId
|
|
6489
|
-
);
|
|
6490
|
-
const headerLookId = findLegacyHeaderLookIdForSelection({
|
|
6491
|
-
layoutId: selection.headerLayoutId,
|
|
6492
|
-
styleId: headerStyleId
|
|
6493
|
-
});
|
|
6494
|
-
return {
|
|
6495
|
-
...state,
|
|
6496
|
-
previewed: {
|
|
6497
|
-
...state.previewed,
|
|
6498
|
-
headerLayoutId: selection.headerLayoutId,
|
|
6499
|
-
headerStyleId,
|
|
6500
|
-
headerLookId
|
|
6501
|
-
},
|
|
6502
|
-
saveStatus: { kind: "idle" }
|
|
6503
|
-
};
|
|
6504
|
-
}
|
|
6505
|
-
function withPaletteOverrideDraft(drafts, paletteVariantId, paletteOverrides) {
|
|
6506
|
-
const next = { ...drafts };
|
|
6507
|
-
if (paletteOverrides === null) {
|
|
6508
|
-
delete next[paletteVariantId];
|
|
6509
|
-
} else {
|
|
6510
|
-
next[paletteVariantId] = paletteOverrides;
|
|
6511
|
-
}
|
|
6512
|
-
return next;
|
|
6513
|
-
}
|
|
6514
|
-
function paletteOverrideDraftsFromSnapshot(snapshot) {
|
|
6515
|
-
return snapshot.paletteOverrides ? { [snapshot.paletteVariantId]: snapshot.paletteOverrides } : {};
|
|
6516
|
-
}
|
|
6517
|
-
function appendPaletteOverrideScopeNotice(notices, input) {
|
|
6518
|
-
const kind = input.restoredOverrides !== null ? "palette-overrides-restored" : input.previousOverrides !== null ? "palette-overrides-hidden" : null;
|
|
6519
|
-
if (!kind || notices.some((notice) => notice.kind === kind)) {
|
|
6520
|
-
return notices;
|
|
6521
|
-
}
|
|
6522
|
-
return [...notices, { kind }];
|
|
6523
|
-
}
|
|
6524
|
-
function selectionSnapshotsEqual(a, b) {
|
|
6525
|
-
return a.siteStyleId === b.siteStyleId && a.selectionVersion === b.selectionVersion && a.selectionUpdatedAt === b.selectionUpdatedAt && a.headerLayoutId === b.headerLayoutId && a.headerStyleId === b.headerStyleId && a.headerLookId === b.headerLookId && a.footerLookId === b.footerLookId && a.buttonPersonalityId === b.buttonPersonalityId && a.paletteVariantId === b.paletteVariantId && a.typographyPresetId === b.typographyPresetId && a.typographyBodyFontOverride === b.typographyBodyFontOverride && a.typographyHeadingFontOverride === b.typographyHeadingFontOverride && paletteOverridesEqual(a.paletteOverrides, b.paletteOverrides);
|
|
6526
|
-
}
|
|
6527
|
-
function paletteOverridesEqual(a, b) {
|
|
6528
|
-
if (a === b) return true;
|
|
6529
|
-
if (!a || !b) return false;
|
|
6530
|
-
const keysA = Object.keys(a);
|
|
6531
|
-
const keysB = Object.keys(b);
|
|
6532
|
-
if (keysA.length !== keysB.length) return false;
|
|
6533
|
-
return keysA.every((key) => a[key] === b[key]);
|
|
6534
|
-
}
|
|
6535
|
-
|
|
6536
|
-
// ../preview-next/src/client/preview/siteChromeLookRows.ts
|
|
6537
|
-
function buildSiteChromeLookModels(input) {
|
|
6538
|
-
const selection = input.state.previewed;
|
|
6539
|
-
const common = {
|
|
6540
|
-
siteStyle: input.siteStyle,
|
|
6541
|
-
buttonPersonalityId: selection.buttonPersonalityId,
|
|
6542
|
-
paletteVariantId: selection.paletteVariantId,
|
|
6543
|
-
paletteOverrides: selection.paletteOverrides,
|
|
6544
|
-
headerLayoutId: selection.headerLayoutId,
|
|
6545
|
-
headerStyleId: selection.headerStyleId,
|
|
6546
|
-
headerLookId: selection.headerLookId,
|
|
6547
|
-
footerLookId: selection.footerLookId,
|
|
6548
|
-
headerSelectionContext: input.headerSelectionContext,
|
|
6549
|
-
footerSelectionContext: input.footerSelectionContext
|
|
6550
|
-
};
|
|
6551
|
-
const current = compileSiteThemeFromSelections(common);
|
|
6552
|
-
const renderedHeaderLayoutId = current.resolvedSelections.headerLayoutId;
|
|
6553
|
-
const renderedHeaderStyleId = current.resolvedSelections.headerStyleId;
|
|
6554
|
-
return {
|
|
6555
|
-
headerLayout: {
|
|
6556
|
-
renderedLayoutId: renderedHeaderLayoutId,
|
|
6557
|
-
options: getOrderedHeaderLayoutIdsForCuration(input.siteStyle).map(
|
|
6558
|
-
(layoutId) => {
|
|
6559
|
-
const layout = getHeaderLayout(layoutId);
|
|
6560
|
-
return {
|
|
6561
|
-
id: layoutId,
|
|
6562
|
-
label: layout?.label ?? layoutId,
|
|
6563
|
-
description: layout?.description,
|
|
6564
|
-
available: true
|
|
6565
|
-
};
|
|
6566
|
-
}
|
|
6567
|
-
)
|
|
6568
|
-
},
|
|
6569
|
-
headerStyle: {
|
|
6570
|
-
renderedStyleId: renderedHeaderStyleId,
|
|
6571
|
-
options: getOrderedHeaderStyleIdsForLayout(
|
|
6572
|
-
input.siteStyle,
|
|
6573
|
-
selection.headerLayoutId
|
|
6574
|
-
).map((styleId) => {
|
|
6575
|
-
const style = getHeaderStyle(styleId);
|
|
6576
|
-
return {
|
|
6577
|
-
id: styleId,
|
|
6578
|
-
label: style?.label ?? styleId,
|
|
6579
|
-
description: style?.description,
|
|
6580
|
-
available: true
|
|
6581
|
-
};
|
|
6582
|
-
})
|
|
6583
|
-
},
|
|
6584
|
-
footer: {
|
|
6585
|
-
renderedLookId: current.resolvedSelections.footerLookId,
|
|
6586
|
-
options: [
|
|
6587
|
-
{
|
|
6588
|
-
id: null,
|
|
6589
|
-
label: "Site style default",
|
|
6590
|
-
description: "Use the footer chosen for this site style.",
|
|
6591
|
-
available: true
|
|
6592
|
-
},
|
|
6593
|
-
...footerLookCatalog.map((look) => {
|
|
6594
|
-
const result = compileSiteThemeFromSelections({
|
|
6595
|
-
...common,
|
|
6596
|
-
footerLookId: look.id
|
|
6597
|
-
});
|
|
6598
|
-
const rejected = result.footerSelection.rejected.find(
|
|
6599
|
-
(item) => item.lookId === look.id
|
|
6600
|
-
);
|
|
6601
|
-
return {
|
|
6602
|
-
id: look.id,
|
|
6603
|
-
label: look.label,
|
|
6604
|
-
description: rejected ? rejected.reasons.map(footerLookRejectionReasonLabel).join(" ") : void 0,
|
|
6605
|
-
available: !rejected
|
|
6606
|
-
};
|
|
6607
|
-
})
|
|
6608
|
-
],
|
|
6609
|
-
diagnostics: diagnosticsForRequestedFooterSelection(
|
|
6610
|
-
selection.footerLookId,
|
|
6611
|
-
current.resolvedSelections.footerLookId,
|
|
6612
|
-
current.footerSelection.rejected
|
|
6613
|
-
)
|
|
6614
|
-
}
|
|
6615
|
-
};
|
|
6616
|
-
}
|
|
6617
|
-
function cycleSiteChromeLookId(options, currentId, direction) {
|
|
6618
|
-
const cycleable = cycleableSiteChromeOptions(options);
|
|
6619
|
-
if (cycleable.length <= 1) return void 0;
|
|
6620
|
-
const currentIndex = cycleable.findIndex((option) => option.id === currentId);
|
|
6621
|
-
const safeIndex = currentIndex === -1 ? 0 : currentIndex;
|
|
6622
|
-
const nextIndex = direction === "next" ? (safeIndex + 1) % cycleable.length : safeIndex === 0 ? cycleable.length - 1 : safeIndex - 1;
|
|
6623
|
-
return cycleable[nextIndex]?.id;
|
|
6624
|
-
}
|
|
6625
|
-
function cycleableSiteChromeOptions(options) {
|
|
6626
|
-
return options.filter((option) => option.available);
|
|
6627
|
-
}
|
|
6628
|
-
function planSiteChromeLookSelection(command) {
|
|
6629
|
-
if (command.surface === "header") {
|
|
6630
|
-
const headerLookId = findLegacyHeaderLookIdForSelection({
|
|
6631
|
-
layoutId: command.layoutId,
|
|
6632
|
-
styleId: command.styleId
|
|
6633
|
-
});
|
|
6634
|
-
const lookCommand2 = headerLookId ? {
|
|
6635
|
-
kind: "select",
|
|
6636
|
-
surface: { kind: "site-header" },
|
|
6637
|
-
lookId: headerLookId
|
|
6638
|
-
} : {
|
|
6639
|
-
kind: "clear",
|
|
6640
|
-
surface: { kind: "site-header" }
|
|
6641
|
-
};
|
|
6642
|
-
return {
|
|
6643
|
-
kind: "header",
|
|
6644
|
-
writePlan: writePlanForLookCustomizationCommand(lookCommand2),
|
|
6645
|
-
next: {
|
|
6646
|
-
headerLayoutId: command.layoutId,
|
|
6647
|
-
headerStyleId: command.styleId,
|
|
6648
|
-
headerLookId
|
|
6649
|
-
}
|
|
6650
|
-
};
|
|
6651
|
-
}
|
|
6652
|
-
const lookCommand = command.lookId ? {
|
|
6653
|
-
kind: "select",
|
|
6654
|
-
surface: { kind: "site-footer" },
|
|
6655
|
-
lookId: command.lookId
|
|
6656
|
-
} : {
|
|
6657
|
-
kind: "clear",
|
|
6658
|
-
surface: { kind: "site-footer" }
|
|
6659
|
-
};
|
|
6660
|
-
return {
|
|
6661
|
-
kind: "footer",
|
|
6662
|
-
writePlan: writePlanForLookCustomizationCommand(lookCommand),
|
|
6663
|
-
next: { footerLookId: command.lookId }
|
|
6664
|
-
};
|
|
6665
|
-
}
|
|
6666
|
-
function diagnosticsForRequestedFooterSelection(requestedLookId, renderedLookId, rejected) {
|
|
6667
|
-
if (!requestedLookId || requestedLookId === renderedLookId) return [];
|
|
6668
|
-
const rejectedRequest = rejected.find(
|
|
6669
|
-
(item) => item.lookId === requestedLookId
|
|
6670
|
-
);
|
|
6671
|
-
return rejectedRequest?.reasons.map(footerLookRejectionReasonLabel) ?? [];
|
|
6672
|
-
}
|
|
6673
|
-
|
|
6674
|
-
// ../preview-next/src/client/preview/typographySelectionInput.ts
|
|
6675
|
-
function typographySelectionInputForSnapshot(snapshot, theme) {
|
|
6676
|
-
if (snapshot.typographyPresetId === null && theme?.typography) {
|
|
6677
|
-
return {
|
|
6678
|
-
typographySelection: {
|
|
6679
|
-
kind: "custom",
|
|
6680
|
-
typography: theme.typography
|
|
6681
|
-
}
|
|
6682
|
-
};
|
|
6683
|
-
}
|
|
6684
|
-
return {
|
|
6685
|
-
typographyPresetId: snapshot.typographyPresetId,
|
|
6686
|
-
typographyBodyFontOverride: snapshot.typographyBodyFontOverride,
|
|
6687
|
-
typographyHeadingFontOverride: snapshot.typographyHeadingFontOverride
|
|
6688
|
-
};
|
|
6689
|
-
}
|
|
6690
|
-
|
|
6691
|
-
// ../preview-next/src/client/preview/styleConfiguratorSnapshot.ts
|
|
6692
|
-
function resolveStyleConfiguratorInitialSnapshot(input) {
|
|
6693
|
-
const themeSiteStyleId = siteStyleIdFromTheme(input.theme);
|
|
6694
|
-
if (!themeSiteStyleId) return null;
|
|
6695
|
-
const siteStyle = getCuratedSiteStyle(themeSiteStyleId);
|
|
6696
|
-
if (!siteStyle) return null;
|
|
6697
|
-
const compiled = compileSiteThemeFromSelections({
|
|
6698
|
-
siteStyle,
|
|
6699
|
-
buttonPersonalityId: input.initialSelections.buttonPersonalityId,
|
|
6700
|
-
paletteVariantId: input.initialSelections.paletteVariantId,
|
|
6701
|
-
paletteOverrides: input.initialSelections.paletteOverrides,
|
|
6702
|
-
headerLayoutId: input.initialSelections.headerLayoutId ?? null,
|
|
6703
|
-
headerStyleId: input.initialSelections.headerStyleId ?? null,
|
|
6704
|
-
...typographySelectionInputForSnapshot(input.initialSelections, input.theme),
|
|
6705
|
-
headerLookId: input.initialSelections.headerLookId ?? null,
|
|
6706
|
-
footerLookId: input.initialSelections.footerLookId ?? null,
|
|
6707
|
-
headerSelectionContext: input.headerSelectionContext,
|
|
6708
|
-
footerSelectionContext: input.footerSelectionContext
|
|
6709
|
-
});
|
|
6710
|
-
const paletteChanged = input.initialSelections.paletteVariantId !== null && compiled.resolvedSelections.paletteVariantId !== input.initialSelections.paletteVariantId;
|
|
6711
|
-
return {
|
|
6712
|
-
siteStyleId: siteStyle.id,
|
|
6713
|
-
selectionVersion: input.initialSelections.selectionVersion ?? 0,
|
|
6714
|
-
selectionUpdatedAt: input.initialSelections.selectionUpdatedAt ?? null,
|
|
6715
|
-
headerLayoutId: compiled.resolvedSelections.headerLayoutId,
|
|
6716
|
-
headerStyleId: compiled.resolvedSelections.headerStyleId,
|
|
6717
|
-
headerLookId: compiled.requestedSelections.headerLookId,
|
|
6718
|
-
footerLookId: compiled.requestedSelections.footerLookId,
|
|
6719
|
-
buttonPersonalityId: compiled.resolvedSelections.buttonPersonalityId,
|
|
6720
|
-
paletteVariantId: compiled.resolvedSelections.paletteVariantId,
|
|
6721
|
-
paletteOverrides: paletteChanged ? null : input.initialSelections.paletteOverrides,
|
|
6722
|
-
typographyPresetId: compiled.resolvedSelections.typographyPresetId,
|
|
6723
|
-
typographyBodyFontOverride: compiled.resolvedSelections.typographyBodyFontOverride,
|
|
6724
|
-
typographyHeadingFontOverride: compiled.resolvedSelections.typographyHeadingFontOverride
|
|
6725
|
-
};
|
|
6726
|
-
}
|
|
6727
|
-
|
|
6728
|
-
// ../preview-next/src/client/preview/siteStylePreviewPlanner.ts
|
|
6729
|
-
function planSiteStylePreviewChange(input) {
|
|
6730
|
-
const compiled = compileSiteThemeFromSelections({
|
|
6731
|
-
siteStyle: input.siteStyle,
|
|
6732
|
-
buttonPersonalityId: input.selection.buttonPersonalityId,
|
|
6733
|
-
paletteVariantId: input.selection.paletteVariantId,
|
|
6734
|
-
paletteOverrides: input.selection.paletteOverrides,
|
|
6735
|
-
...typographySelectionInputForSnapshot(input.selection, input.baseTheme),
|
|
6736
|
-
headerLayoutId: input.selection.headerLayoutId,
|
|
6737
|
-
headerStyleId: input.selection.headerStyleId,
|
|
6738
|
-
headerLookId: input.selection.headerLookId,
|
|
6739
|
-
footerLookId: input.selection.footerLookId,
|
|
6740
|
-
headerSelectionContext: input.headerSelectionContext,
|
|
6741
|
-
footerSelectionContext: input.footerSelectionContext
|
|
6742
|
-
});
|
|
6743
|
-
return {
|
|
6744
|
-
themeOverlay: compiled.theme,
|
|
6745
|
-
resolvedSelections: compiled.resolvedSelections,
|
|
6746
|
-
chromeSelection: {
|
|
6747
|
-
headerLookId: input.selection.headerLookId,
|
|
6748
|
-
footerLookId: input.selection.footerLookId
|
|
6749
|
-
},
|
|
6750
|
-
warnings: compiled.warnings
|
|
6751
|
-
};
|
|
6752
|
-
}
|
|
6753
|
-
|
|
6754
6223
|
// ../preview-next/src/client/blocks/previewCustomizeControlPlan.ts
|
|
6755
6224
|
var ABSOLUTE_MAX_QUICK_FIELDS = 3;
|
|
6756
6225
|
var QUICK_FIELD_PRIORITY_BY_BLOCK_KIND = {
|
|
@@ -6949,7 +6418,7 @@ function useBlockCustomizeControls({
|
|
|
6949
6418
|
return createStoreBackend({
|
|
6950
6419
|
scope: "blocks",
|
|
6951
6420
|
store: uiStore,
|
|
6952
|
-
blockId
|
|
6421
|
+
blockId,
|
|
6953
6422
|
validateFn: (values) => validateBlockManifestIssues(preparedManifest.validationManifest, values, "strict")
|
|
6954
6423
|
});
|
|
6955
6424
|
}, [blockId, preparedManifest, uiStore]);
|
|
@@ -6976,12 +6445,12 @@ function resolveQuickFieldBudget({
|
|
|
6976
6445
|
if (typeof maxPopoverRows !== "number") {
|
|
6977
6446
|
return cappedRequested;
|
|
6978
6447
|
}
|
|
6979
|
-
const
|
|
6980
|
-
const availableRows = maxPopoverRows - builtInPopoverRows -
|
|
6448
|
+
const customizeRowCount = hasOverflowControls ? 1 : 0;
|
|
6449
|
+
const availableRows = maxPopoverRows - builtInPopoverRows - customizeRowCount;
|
|
6981
6450
|
return Math.max(0, Math.min(cappedRequested, availableRows));
|
|
6982
6451
|
}
|
|
6983
6452
|
function resolveBlockManifest(blockKind, sdkConfig) {
|
|
6984
6453
|
return getBlockManifestFromSdkConfig(blockKind, sdkConfig) ?? getBlockDefinition(blockKind)?.manifest ?? null;
|
|
6985
6454
|
}
|
|
6986
6455
|
|
|
6987
|
-
export { BUILT_IN_REFERENCE_KINDS, BlockEditor, ButtonVariantField, ButtonWidgetProvider, EntryPickerField, EntryPickerWidgetProvider, FileField, IconPickerField, LinkField, LinkWidgetProvider, MAX_CUSTOMIZE_POPOVER_ROWS, MAX_QUICK_MANIFEST_FIELDS, MediaField, PreviewBlockCustomizeSelectionProvider,
|
|
6456
|
+
export { BUILT_IN_REFERENCE_KINDS, BlockEditor, ButtonVariantField, ButtonWidgetProvider, EntryPickerField, EntryPickerWidgetProvider, FileField, IconPickerField, LinkField, LinkWidgetProvider, MAX_CUSTOMIZE_POPOVER_ROWS, MAX_QUICK_MANIFEST_FIELDS, MediaField, PreviewBlockCustomizeSelectionProvider, ReferenceField, ReferenceWidgetProvider, RichTextField, RichTextWidgetProvider, SiteOptionPickerField, SiteOptionWidgetProvider, buildPreviewDashboardSetupUrl, canApplySiteStyle, canInspectSiteStyle, createSiteOptionApiLoader, createSiteOptionWidgetAdapters, mapContentSchemaToFormFields, parseReferenceKind, resolvePreviewDashboardSetupHandoff, resolvePreviewEditorGuidanceModel, resolvePreviewSetupBannerModel, resolvePreviewSidebarChromeModel, resolveSiteStyleAccess, sanitizeDashboardPath, useBlockCustomizeControls, usePreviewBlockCustomizeSelectionOptional, useRichTextImagePicker };
|