@riverbankcms/sdk 0.80.0 → 0.82.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/README.md +65 -3
- package/dist/{PreviewEditorSidebar-O4NDX5TP.css → PreviewEditorSidebar-JA4VIPSZ.css} +1 -1
- package/dist/{PreviewEditorSidebar-QZG37QIF.mjs → PreviewEditorSidebar-LHGK6RIO.mjs} +760 -711
- package/dist/{SdkPreviewModeRuntime-PBGALTMK.css → PreviewEditorUI-36T7QYV4.css} +1 -1
- package/dist/{PreviewEditorUI-AXIKSMZA.mjs → PreviewEditorUI-AXZG2SDC.mjs} +167 -28
- package/dist/{PreviewEditorUI-4JVDBZBS.css → SdkPreviewModeRuntime-FXKI6XNL.css} +1 -1
- package/dist/SdkPreviewModeRuntime-RNVRHFFR.mjs +8 -0
- package/dist/_dts/ai/src/contracts/proposals.d.ts +838 -262
- package/dist/_dts/altcha/src/AltchaWidget.d.ts +1 -1
- package/dist/_dts/api/src/analytics.d.ts +1 -1
- package/dist/_dts/api/src/bookingConfig.d.ts +4 -0
- package/dist/_dts/api/src/contentRuntime.d.ts +15 -3
- package/dist/_dts/api/src/contentTypes.d.ts +6 -0
- package/dist/_dts/api/src/courses.d.ts +1 -1
- package/dist/_dts/api/src/event-destination-policy.d.ts +17 -0
- package/dist/_dts/api/src/index.d.ts +6 -2
- package/dist/_dts/api/src/navigation/boundaries.d.ts +64 -0
- package/dist/_dts/api/src/navigation.d.ts +2 -0
- package/dist/_dts/api/src/publicExperienceEndpoints.d.ts +17 -12
- package/dist/_dts/api/src/siteGeneration.d.ts +1 -1
- package/dist/_dts/api/src/sitePlatformEndpoints.d.ts +7 -6
- package/dist/_dts/api/src/types.d.ts +1 -1
- 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/block-form/src/context/BlockContext.d.ts +1 -1
- package/dist/_dts/block-form/src/context/DisplayLabelResolverContext.d.ts +1 -1
- package/dist/_dts/block-form/src/context/FieldPreviewResolverContext.d.ts +2 -2
- package/dist/_dts/block-form/src/manifest/ManifestForm.d.ts +1 -1
- package/dist/_dts/block-form/src/palette/PaletteContext.d.ts +1 -1
- package/dist/_dts/block-form/src/sdk-config/SdkConfigContext.d.ts +1 -1
- package/dist/_dts/block-form/src/widgets/BackgroundColorWidget/BackgroundColorWidget.d.ts +2 -1
- package/dist/_dts/block-form/src/widgets/BackgroundGradientWidget/BackgroundGradientWidget.d.ts +1 -1
- package/dist/_dts/block-form/src/widgets/BooleanField/BooleanField.d.ts +1 -1
- package/dist/_dts/block-form/src/widgets/DateField/datePickerPopover.d.ts +1 -1
- package/dist/_dts/block-form/src/widgets/Field.d.ts +2 -2
- package/dist/_dts/block-form/src/widgets/FieldFrame.d.ts +3 -3
- package/dist/_dts/block-form/src/widgets/NumberField/NumberField.d.ts +1 -1
- package/dist/_dts/block-form/src/widgets/PresetOrCustomField/PresetOrCustomField.d.ts +1 -1
- package/dist/_dts/block-form/src/widgets/SdkSelectField/SdkSelectField.d.ts +1 -1
- package/dist/_dts/block-form/src/widgets/SelectField/SelectField.d.ts +1 -1
- package/dist/_dts/block-form/src/widgets/SelectWidget.d.ts +1 -1
- package/dist/_dts/block-form/src/widgets/SliderField/SliderField.d.ts +1 -1
- package/dist/_dts/block-form/src/widgets/TextField/TextField.d.ts +1 -1
- package/dist/_dts/block-form/src/widgets/TextInputWidget.d.ts +1 -1
- package/dist/_dts/block-form/src/widgets/ToggleWidget.d.ts +1 -1
- package/dist/_dts/block-form/src/widgets/stringDefaultValue.d.ts +1 -0
- package/dist/_dts/blocks/src/PageRenderer.d.ts +4 -1
- package/dist/_dts/blocks/src/contracts/proof-block-islands.d.ts +28 -44
- package/dist/_dts/blocks/src/index.d.ts +6 -4
- package/dist/_dts/blocks/src/portal/types.d.ts +1 -1
- package/dist/_dts/blocks/src/primitives/content/components/Button.d.ts +7 -7
- package/dist/_dts/blocks/src/primitives/content/components/RichText.d.ts +2 -1
- package/dist/_dts/blocks/src/primitives/content/components/Text.d.ts +2 -1
- package/dist/_dts/blocks/src/primitives/content/primitives.d.ts +4 -0
- package/dist/_dts/blocks/src/primitives/layout/Grid.d.ts +2 -1
- package/dist/_dts/blocks/src/primitives/layout/Inline.d.ts +2 -1
- package/dist/_dts/blocks/src/primitives/layout/Stack.d.ts +2 -1
- package/dist/_dts/blocks/src/server.d.ts +1 -1
- package/dist/_dts/blocks/src/system/blocks/appointment-booking.d.ts +592 -592
- package/dist/_dts/blocks/src/system/blocks/blog-listing.d.ts +592 -592
- package/dist/_dts/blocks/src/system/blocks/cart.d.ts +592 -592
- package/dist/_dts/blocks/src/system/blocks/checkout.d.ts +592 -592
- package/dist/_dts/blocks/src/system/blocks/collection.d.ts +592 -592
- package/dist/_dts/blocks/src/system/blocks/courses/shared/types.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 +397 -111
- package/dist/_dts/blocks/src/system/blocks/events/shared/types.d.ts +6 -15
- package/dist/_dts/blocks/src/system/blocks/faq.d.ts +592 -592
- package/dist/_dts/blocks/src/system/blocks/feature-card-icons.d.ts +1 -1
- 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/gifting.d.ts +592 -592
- package/dist/_dts/blocks/src/system/blocks/hero.d.ts +2 -0
- package/dist/_dts/blocks/src/system/blocks/image-gallery.d.ts +3 -0
- package/dist/_dts/blocks/src/system/blocks/location-map.d.ts +3 -3
- package/dist/_dts/blocks/src/system/blocks/media-text.d.ts +54 -54
- package/dist/_dts/blocks/src/system/blocks/offerings-preview/index.d.ts +21 -0
- package/dist/_dts/blocks/src/system/blocks/offerings-preview/model.d.ts +162 -0
- package/dist/_dts/blocks/src/system/blocks/product-detail.d.ts +592 -602
- package/dist/_dts/blocks/src/system/blocks/product-list.d.ts +592 -604
- package/dist/_dts/blocks/src/system/blocks/products/shared.d.ts +0 -4
- package/dist/_dts/blocks/src/system/blocks/shop.d.ts +592 -592
- package/dist/_dts/blocks/src/system/blocks/team-members.d.ts +2 -2
- package/dist/_dts/blocks/src/system/blocks/testimonials.d.ts +3 -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 +19 -5
- package/dist/_dts/blocks/src/system/customize/facets.d.ts +2 -2
- package/dist/_dts/blocks/src/system/data/index.d.ts +2 -0
- package/dist/_dts/blocks/src/system/data/linkedContentEntries.d.ts +102 -0
- package/dist/_dts/blocks/src/system/data/loaderEndpoints.d.ts +1 -1
- package/dist/_dts/blocks/src/system/defineBlock.d.ts +3 -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/manifest/schema.d.ts +71 -56
- 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/api/types.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/components/registry.client.d.ts +56 -74
- package/dist/_dts/blocks/src/system/runtime/components/runtime-backed-blocks.d.ts +27 -36
- 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/ImageResolveContext.d.ts +2 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/basic.d.ts +4 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.server.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-runtime-sources.d.ts +3 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/carousel.shared.d.ts +2 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/cart.client.d.ts +2 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/cart.server.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/checkout.client.d.ts +2 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/checkout.server.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/commerce/shared/display.d.ts +1 -5
- package/dist/_dts/blocks/src/system/runtime/nodes/commerce/shared/view.d.ts +10 -13
- package/dist/_dts/blocks/src/system/runtime/nodes/course-details/view.d.ts +3 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/course-details.server.d.ts +2 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/course-registration/BookingModeStep.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/course-registration/CourseRegistrationWizard.d.ts +2 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/course-registration/ErrorStep.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/course-registration/MembershipHero.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/course-registration/PaymentFailedStep.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/course-registration/PortalAuthSidebar.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/course-registration/StepIndicator.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/course-registration/SuccessStep.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/course-registration/VerifyingTimeoutStep.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/course-registration/WaitlistStep.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/course-registration/components.d.ts +5 -4
- package/dist/_dts/blocks/src/system/runtime/nodes/course-registration.client.d.ts +3 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/course-registration.server.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-details/CoursePricingDisplay.d.ts +2 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-details/view.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-details.client.d.ts +2 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/event-details.server.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/EventRegistrationSummaryBar.d.ts +2 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/EventRegistrationWizard.d.ts +2 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/EventRegistrationWizardActions.d.ts +2 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/EventRegistrationWizardContent.d.ts +2 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/EventSelectionStep.d.ts +2 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/OrderSummary.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/PastOccurrenceNotice.d.ts +2 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/SelectableOptionCard.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/StepIndicator.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/registrationDerivations.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/types.d.ts +1 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/utils.d.ts +2 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration.interactive.d.ts +12 -5
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration.server.d.ts +1 -1
- 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/EventListing.view.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/DateTimeTile.d.ts +2 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/DayEventsModal.d.ts +2 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/EventDetailModal.d.ts +2 -1
- 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/gifting.client.d.ts +2 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/gifting.server.d.ts +2 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/location-map.client.d.ts +2 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/location-map.server.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/location-map.shared.d.ts +4 -4
- package/dist/_dts/blocks/src/system/runtime/nodes/location-map.view.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/media.d.ts +29 -14
- package/dist/_dts/blocks/src/system/runtime/nodes/newsletter-form.server.d.ts +2 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/offerings-preview.d.ts +23 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/product-detail.client.d.ts +2 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/product-detail.server.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/product-list.client.d.ts +2 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/product-list.server.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/shared/MagicLinkForm.d.ts +2 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/shop-add-feedback.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/shop-commerce.d.ts +5 -4
- package/dist/_dts/blocks/src/system/runtime/nodes/shop-commerce.server.d.ts +5 -4
- package/dist/_dts/blocks/src/system/runtime/nodes/shop.client.d.ts +2 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/shop.interactive.d.ts +0 -17
- package/dist/_dts/blocks/src/system/runtime/nodes/shop.server.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/shop.types.d.ts +0 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/spinner.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/resolver.d.ts +13 -0
- package/dist/_dts/blocks/src/system/runtime/shared/components/ActionRow.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/shared/components/CheckIcon.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/shared/components/ClockIcon.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/shared/components/CrossIcon.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/shared/components/FeedbackMessage.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/shared/components/FieldValidationMessage.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/shared/components/MembershipHero.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/shared/components/StateIcon.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/shared/components/StepIndicator.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/shared/components/TerminalPanel.d.ts +1 -1
- 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/blocks/src/system/transforms/typed.d.ts +1 -1
- 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/components/ContentFieldsForm.d.ts +1 -1
- package/dist/_dts/content-editor/src/components/EditableBlockProvider.d.ts +1 -1
- package/dist/_dts/content-editor/src/controller/EntryControllerProvider.d.ts +1 -1
- 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/primitives/PreviewRichTextEditor.d.ts +6 -1
- package/dist/_dts/content-editor/src/primitives/PreviewTextEditor.d.ts +6 -1
- package/dist/_dts/content-editor/src/primitives/shared/activePreviewField.d.ts +2 -0
- package/dist/_dts/content-editor/src/primitives/shared/index.d.ts +1 -1
- package/dist/_dts/content-editor/src/primitives/shared/storeBinding.d.ts +3 -1
- package/dist/_dts/content-editor/src/primitives/shared/types.d.ts +5 -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 +67 -5
- 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/builtin-schemas.d.ts +0 -40
- package/dist/_dts/content-model/src/content-types/builtins.d.ts +43 -40
- package/dist/_dts/content-model/src/metadataConfig.d.ts +87 -47
- package/dist/_dts/content-model/src/templates/defaults.d.ts +0 -1
- package/dist/_dts/core/src/branded.d.ts +5 -0
- package/dist/_dts/core/src/event-pricing.d.ts +72 -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/db/src/generated/supabase/database.types.d.ts +27 -2
- package/dist/_dts/db/src/schemas/forms.d.ts +4 -4
- 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/BlockForm.d.ts +2 -1
- package/dist/_dts/editor-blocks/src/FormProvider.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/block-editor/AddBlockDivider.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/block-editor/BlockCard.d.ts +4 -4
- package/dist/_dts/editor-blocks/src/block-editor/BlockCardBody.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/block-editor/BlockCardHeader.d.ts +5 -5
- package/dist/_dts/editor-blocks/src/block-editor/BlockListContext.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/block-editor/BlockPickerDialog.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/block-editor/BlockThumbnail.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/block-editor/BlockTile.d.ts +2 -2
- package/dist/_dts/editor-blocks/src/block-editor/EmptyState.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/block-editor/EnhancedBlockPickerDialog.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/block-editor/FeatureCardIconsPanel.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/block-editor/GeneratedIconSetDialog.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/block-editor/HeaderActions.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/block-editor/SortableBlockItem.d.ts +4 -4
- 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/block-editor/types.d.ts +1 -0
- package/dist/_dts/editor-blocks/src/media/MediaField.d.ts +2 -2
- package/dist/_dts/editor-blocks/src/widgets/button/ButtonField.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/widgets/button/ButtonVariantField.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/widgets/button/context.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/widgets/content-type-select/ContentTypeSelectField.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/widgets/content-type-select/ContentTypeWidgetProvider.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/widgets/entry-picker/EntryPickerField.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/widgets/entry-picker/EntryPickerWidgetProvider.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/widgets/icon-picker/IconPickerField.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/widgets/index.d.ts +2 -0
- package/dist/_dts/editor-blocks/src/widgets/link/LinkPicker.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/widgets/link/LinkPickerDialog.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/widgets/link/LinkSummary.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/widgets/link/LinkWidget.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/widgets/link/LinkWidgetContext.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/widgets/offerings-preview/OfferingsPreviewGroupOrderField.d.ts +2 -0
- package/dist/_dts/editor-blocks/src/widgets/offerings-preview/OfferingsPreviewWidgetProvider.d.ts +10 -0
- package/dist/_dts/editor-blocks/src/widgets/offerings-preview/index.d.ts +3 -0
- package/dist/_dts/editor-blocks/src/widgets/offerings-preview/orderDomain.d.ts +29 -0
- package/dist/_dts/editor-blocks/src/widgets/reference/ReferenceField.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/widgets/reference/ReferenceWidgetProvider.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/widgets/rich-text/RichTextField.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/widgets/rich-text/RichTextWidgetProvider.d.ts +2 -2
- package/dist/_dts/editor-blocks/src/widgets/rich-text/useImagePicker.d.ts +2 -2
- 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/CropDialog.d.ts +1 -1
- package/dist/_dts/media-editor/src/CropDialogShell.d.ts +1 -1
- package/dist/_dts/media-editor/src/FileAssetPreview.d.ts +1 -1
- 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/MediaPreview.d.ts +1 -1
- package/dist/_dts/media-editor/src/context.d.ts +1 -1
- package/dist/_dts/media-editor/src/createMediaEditorProvider.d.ts +1 -1
- package/dist/_dts/media-editor/src/index.d.ts +1 -1
- package/dist/_dts/media-editor/src/provider.d.ts +1 -1
- package/dist/_dts/media-react/src/components/AuthenticatedImage.d.ts +1 -1
- package/dist/_dts/media-react/src/components/MediaLibrary.d.ts +1 -1
- package/dist/_dts/media-react/src/components/MediaPickerMini.d.ts +1 -1
- package/dist/_dts/preview-next/src/client/PreviewShellSmoke.d.ts +2 -1
- package/dist/_dts/preview-next/src/client/blocks/BlockToolbar.d.ts +7 -4
- package/dist/_dts/preview-next/src/client/blocks/BoundaryControl.d.ts +2 -1
- package/dist/_dts/preview-next/src/client/blocks/EditablePageRenderer.d.ts +7 -3
- 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/previewCustomizeControlPlan.d.ts +2 -2
- 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/layout/PreviewLayoutContext.d.ts +1 -1
- package/dist/_dts/preview-next/src/client/preview/EntryEditorPanel.d.ts +4 -2
- package/dist/_dts/preview-next/src/client/preview/LinkedEntryEditEventBridge.d.ts +1 -0
- package/dist/_dts/preview-next/src/client/preview/MaintenanceModeBadge.d.ts +1 -1
- package/dist/_dts/preview-next/src/client/preview/OnboardingThemeSwitcher.d.ts +2 -1
- package/dist/_dts/preview-next/src/client/preview/PageBlockEditorPanel.d.ts +6 -3
- package/dist/_dts/preview-next/src/client/preview/PageDesignEditorStateContext.d.ts +2 -2
- package/dist/_dts/preview-next/src/client/preview/PreviewAuthBanner.d.ts +2 -1
- package/dist/_dts/preview-next/src/client/preview/PreviewAuthInit.d.ts +1 -1
- package/dist/_dts/preview-next/src/client/preview/PreviewBlockCustomizeSelectionContext.d.ts +2 -2
- package/dist/_dts/preview-next/src/client/preview/PreviewChromeLayer.d.ts +20 -0
- package/dist/_dts/preview-next/src/client/preview/PreviewConfirmationDialog.d.ts +2 -1
- package/dist/_dts/preview-next/src/client/preview/PreviewDesignCoordinatorContext.d.ts +2 -2
- package/dist/_dts/preview-next/src/client/preview/PreviewDesignHistoryOrderContext.d.ts +13 -0
- package/dist/_dts/preview-next/src/client/preview/PreviewEditorGuidanceCard.d.ts +2 -1
- package/dist/_dts/preview-next/src/client/preview/PreviewEditorSidebar.d.ts +4 -3
- package/dist/_dts/preview-next/src/client/preview/PreviewEntryControllerProvider.d.ts +2 -2
- package/dist/_dts/preview-next/src/client/preview/PreviewOpenEditorButton.d.ts +3 -2
- package/dist/_dts/preview-next/src/client/preview/PreviewQueryProvider.d.ts +2 -2
- package/dist/_dts/preview-next/src/client/preview/PreviewShell.d.ts +21 -20
- package/dist/_dts/preview-next/src/client/preview/PreviewShellLayout.d.ts +4 -3
- package/dist/_dts/preview-next/src/client/preview/PreviewSidebarSection.d.ts +13 -0
- package/dist/_dts/preview-next/src/client/preview/PreviewViewportControls.d.ts +1 -1
- package/dist/_dts/preview-next/src/client/preview/PreviewZoomControls.d.ts +1 -1
- package/dist/_dts/preview-next/src/client/preview/SelectedBlockCustomizePanel.d.ts +2 -1
- package/dist/_dts/preview-next/src/client/preview/SiteChromeCustomizeButton.d.ts +2 -1
- package/dist/_dts/preview-next/src/client/preview/SiteChromeCustomizeContext.d.ts +60 -6
- package/dist/_dts/preview-next/src/client/preview/StyleConfigurator.d.ts +2 -1
- package/dist/_dts/preview-next/src/client/preview/StyleConfigurator.state.d.ts +14 -1
- package/dist/_dts/preview-next/src/client/preview/SubrouteNoticePanel.d.ts +2 -1
- package/dist/_dts/preview-next/src/client/preview/linkedEntryEditEvents.d.ts +9 -0
- package/dist/_dts/preview-next/src/client/preview/previewChromePlacement.d.ts +51 -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 +120 -0
- package/dist/_dts/preview-next/src/client/preview/siteChromeSavePlan.d.ts +30 -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/preview/themeOverlay.d.ts +2 -2
- package/dist/_dts/preview-next/src/client/sdk/SdkPreviewModeRuntime.d.ts +2 -1
- package/dist/_dts/preview-next/src/client/widgets/widgetAdapters.d.ts +2 -1
- package/dist/_dts/preview-next/src/client/widgets/widgetOverrides.d.ts +8 -5
- package/dist/_dts/preview-next/src/constants.d.ts +0 -1
- package/dist/_dts/sdk/src/__mocks__/next-cache.d.ts +4 -3
- package/dist/_dts/sdk/src/cli/commands/pull-dry-run.d.ts +1 -1
- package/dist/_dts/sdk/src/cli/config-loader.d.ts +3 -1
- package/dist/_dts/sdk/src/cli/content/reader.d.ts +6 -12
- package/dist/_dts/sdk/src/cli/site-commands/commandSurfaceDispatch.d.ts +1 -0
- package/dist/_dts/sdk/src/cli/site-commands/localBlockManifestResolver.d.ts +31 -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/cli/sync/validation.d.ts +7 -7
- package/dist/_dts/sdk/src/client/types.d.ts +36 -4
- package/dist/_dts/sdk/src/client.d.ts +1 -1
- package/dist/_dts/sdk/src/config/content-types.d.ts +3 -14
- package/dist/_dts/sdk/src/config/content-validation.d.ts +9 -214
- package/dist/_dts/sdk/src/config/types.d.ts +10 -1
- package/dist/_dts/sdk/src/config/validation.d.ts +24 -24
- package/dist/_dts/sdk/src/contracts/system-block-content.d.ts +30 -4
- package/dist/_dts/sdk/src/index.d.ts +1 -1
- package/dist/_dts/sdk/src/preview-next/client/index.d.ts +6 -6
- package/dist/_dts/sdk/src/preview-next/client/runtime.d.ts +4 -3
- package/dist/_dts/sdk/src/public-api/contracts.d.ts +39 -37
- package/dist/_dts/sdk/src/rendering/components/Block.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/components/Block.server.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/components/Layout.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/components/Page.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/components/Page.server.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/components/PageHydrationBootstrap.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/helpers/bindings.d.ts +10 -9
- package/dist/_dts/sdk/src/rendering/islands/enhancers/routeIslandApiConfig.d.ts +9 -0
- package/dist/_dts/sdk/src/rendering/islands/types.d.ts +6 -15
- package/dist/_dts/sdk/src/rendering/mediaAssets.d.ts +4 -0
- package/dist/_dts/sdk/src/rendering/primitives/RichText.d.ts +2 -1
- package/dist/_dts/sdk/src/server.d.ts +1 -1
- package/dist/_dts/sdk/src/theme-bridge/ThemeBridgeProvider.d.ts +1 -1
- 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/site-commands/src/commands.d.ts +69 -21
- package/dist/_dts/theme-core/src/ClientThemeScope.d.ts +1 -1
- package/dist/_dts/theme-core/src/ThemeFontLoader.d.ts +3 -2
- package/dist/_dts/theme-core/src/ThemeScope.d.ts +1 -1
- package/dist/_dts/theme-core/src/ThemeScopeCore.d.ts +1 -1
- package/dist/_dts/theme-core/src/accordions/types.d.ts +5 -5
- 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 +8 -7
- package/dist/_dts/theme-core/src/buttons/types.d.ts +26 -17
- package/dist/_dts/theme-core/src/cards/siteStyleDefaults.d.ts +44 -0
- package/dist/_dts/theme-core/src/cards/types.d.ts +5 -5
- package/dist/_dts/theme-core/src/generated/containerResponsiveThemeCss.d.ts +1 -1
- package/dist/_dts/theme-core/src/inputs/types.d.ts +2 -2
- package/dist/_dts/theme-core/src/interactive/baseSchema.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 +228 -198
- package/dist/_dts/theme-core/src/mock-themes/components/PaletteCard.d.ts +1 -1
- package/dist/_dts/theme-core/src/mock-themes/components/swatch.d.ts +1 -1
- package/dist/_dts/theme-core/src/navigation/presets.d.ts +1 -1
- package/dist/_dts/theme-core/src/navigation/types.d.ts +1 -1
- package/dist/_dts/theme-core/src/palette/variants/index.d.ts +15 -0
- package/dist/_dts/theme-core/src/palette/variants/types.d.ts +6 -6
- package/dist/_dts/theme-core/src/palette/variants/warm-dark.d.ts +27 -0
- package/dist/_dts/theme-core/src/schema.d.ts +273 -226
- package/dist/_dts/theme-core/src/shared/componentStyles.d.ts +2 -2
- 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/backgroundAppearance.d.ts +27 -0
- 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 +32 -16
- package/dist/_dts/theme-core/src/site-styles/generatedSchemas.d.ts +13 -9
- package/dist/_dts/theme-core/src/site-styles/headerLooks.d.ts +5 -0
- package/dist/_dts/theme-core/src/site-styles/index.d.ts +3 -0
- package/dist/_dts/theme-core/src/site-styles/logoBranding.d.ts +4 -4
- 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/rawStyleFields.d.ts +2 -0
- 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/siteChromeBackgrounds.d.ts +30 -0
- package/dist/_dts/theme-core/src/site-styles/sourceCatalogs.d.ts +10 -10
- package/dist/_dts/theme-core/src/site-styles/styleTags.d.ts +1 -1
- package/dist/_dts/theme-core/src/site-styles/tokenRecipes.d.ts +1 -1
- package/dist/_dts/theme-core/src/site-styles/types.d.ts +26 -6
- package/dist/_dts/theme-core/src/site-styles/typographyPresets.d.ts +16 -1
- package/dist/_dts/theme-core/src/tokens/themeColorTokens.d.ts +3 -3
- package/dist/_dts/ui/src/async-boundary.d.ts +1 -1
- package/dist/_dts/ui/src/badge.d.ts +1 -1
- package/dist/_dts/ui/src/button-group.d.ts +3 -3
- package/dist/_dts/ui/src/calendar.d.ts +2 -2
- package/dist/_dts/ui/src/card.d.ts +6 -6
- package/dist/_dts/ui/src/combobox.d.ts +1 -1
- package/dist/_dts/ui/src/command-multi-select.d.ts +1 -1
- package/dist/_dts/ui/src/content-spinner.d.ts +1 -1
- package/dist/_dts/ui/src/delayed-spinner.d.ts +1 -1
- package/dist/_dts/ui/src/dev-toolbar.d.ts +1 -1
- package/dist/_dts/ui/src/dialog.d.ts +10 -10
- package/dist/_dts/ui/src/dropdown-menu.d.ts +1 -1
- package/dist/_dts/ui/src/editor-drawer.d.ts +1 -1
- package/dist/_dts/ui/src/empty-state.d.ts +1 -1
- package/dist/_dts/ui/src/filter-button-group.d.ts +1 -1
- package/dist/_dts/ui/src/fixed-bottom-surface.d.ts +1 -1
- package/dist/_dts/ui/src/form.d.ts +7 -7
- package/dist/_dts/ui/src/label.d.ts +1 -1
- package/dist/_dts/ui/src/menubar.d.ts +16 -16
- package/dist/_dts/ui/src/navigation-tabs.d.ts +2 -2
- package/dist/_dts/ui/src/number-input.d.ts +1 -1
- package/dist/_dts/ui/src/palette/ColorChooserDialog.d.ts +1 -1
- package/dist/_dts/ui/src/palette/ColorSlotButton.d.ts +1 -1
- package/dist/_dts/ui/src/palette/ColorSwatchButton.d.ts +1 -1
- package/dist/_dts/ui/src/palette/PaletteTokenEditor.d.ts +1 -1
- package/dist/_dts/ui/src/resizable-split-pane.d.ts +1 -1
- package/dist/_dts/ui/src/select.d.ts +10 -10
- package/dist/_dts/ui/src/separator.d.ts +1 -1
- package/dist/_dts/ui/src/sheet.d.ts +9 -9
- package/dist/_dts/ui/src/spinner.d.ts +1 -1
- package/dist/_dts/ui/src/tooltip.d.ts +4 -4
- package/dist/{chunk-MPBNEVPB.mjs → chunk-2BUMISSH.mjs} +1 -1
- package/dist/{chunk-7PCYG6YV.mjs → chunk-6FWNF3DJ.mjs} +2086 -1128
- package/dist/{chunk-BBLZSQEY.mjs → chunk-FIREV57T.mjs} +14 -9
- package/dist/{chunk-5NZGBSJF.mjs → chunk-G35HOQEN.mjs} +2608 -2397
- package/dist/{chunk-HTB4BMKD.mjs → chunk-HKB6XVIP.mjs} +321 -113
- package/dist/{chunk-GYXKAUFV.mjs → chunk-XQR6THQJ.mjs} +27831 -17740
- package/dist/cli/index.mjs +4581 -2802
- package/dist/cli/init-docs/content/workflow-custom-block.md +5 -0
- package/dist/client/{accordion-QFZMNB7O.mjs → accordion-G34C45TW.mjs} +2 -2
- package/dist/client/{bookingForm-NCIXFWIG.mjs → bookingForm-BLBVKSAQ.mjs} +12 -12
- package/dist/client/bookings.mjs +321 -60
- package/dist/client/{carousel-EO4BJMWD.mjs → carousel-7ZVTBRMD.mjs} +3 -3
- package/dist/client/{cart-FTYCLYUW.mjs → cart-Q6S6LZUO.mjs} +8 -7
- package/dist/client/{checkout-NFGLVCOX.mjs → checkout-5QJLDE4I.mjs} +8 -7
- package/dist/client/{chunk-IWFZSQNZ.mjs → chunk-5PQH4Y75.mjs} +3 -3
- package/dist/client/{chunk-Y37KDO7P.mjs → chunk-CHAB5ACD.mjs} +5 -4
- package/dist/client/{chunk-VDS5YFLX.mjs → chunk-CSZGLBYR.mjs} +1 -1
- package/dist/client/{chunk-3PEDD5KJ.mjs → chunk-DVNUDUVT.mjs} +1 -1
- package/dist/client/{chunk-6GVVWSPU.mjs → chunk-EQKYMX4N.mjs} +348 -301
- package/dist/client/{chunk-YLMKMCSJ.mjs → chunk-GFSQNTRW.mjs} +1 -3
- package/dist/client/chunk-L4J5Y62O.mjs +18 -0
- package/dist/client/{chunk-PUOELU4O.mjs → chunk-RJHTCTCZ.mjs} +550 -262
- package/dist/client/{chunk-AUJ5DBZJ.mjs → chunk-S3MKFGOG.mjs} +170 -28
- package/dist/client/{chunk-CE7IBGVW.mjs → chunk-SBBSMFFG.mjs} +1 -1
- package/dist/client/{chunk-4W66ALYT.mjs → chunk-U2EW7RSR.mjs} +1 -1
- package/dist/client/{chunk-PYRBIURC.mjs → chunk-WJFHDTYF.mjs} +17 -34
- package/dist/client/{chunk-T6UIP6UZ.mjs → chunk-ZF4XEWDM.mjs} +1 -1
- package/dist/client/client.mjs +13449 -9393
- package/dist/client/{courseRegistration-2EORROPS.mjs → courseRegistration-VUG2JJDB.mjs} +13 -12
- package/dist/client/{eventCalendar-WZI4VL6N.mjs → eventCalendar-E7D2LD4N.mjs} +14 -14
- package/dist/client/{eventCombined-QCB2TCNL.mjs → eventCombined-FUZ2Z3CS.mjs} +14 -14
- package/dist/client/{eventDetails-TFTATAPH.mjs → eventDetails-QRITJAOW.mjs} +9 -9
- package/dist/client/{eventListing-A2CQEHEQ.mjs → eventListing-INMQMJZ5.mjs} +14 -14
- package/dist/client/{eventRegistration-OELPVLUY.mjs → eventRegistration-TOOJD4WU.mjs} +17 -15
- package/dist/client/{form-NTIFD6WQ.mjs → form-BOWN7ZNQ.mjs} +3 -3
- package/dist/client/{headerSection-7TBNKCLA.mjs → headerSection-HFQNZOUU.mjs} +55 -14
- package/dist/client/hooks.mjs +26989 -25527
- package/dist/client/{locationMap-LRLB5A3H.mjs → locationMap-VUZGC7Y5.mjs} +2 -2
- package/dist/client/{newsletterForm-XI52RZSN.mjs → newsletterForm-X2XQTPCB.mjs} +3 -3
- package/dist/client/{productDetail-GSNKBFLY.mjs → productDetail-TA7D2G2B.mjs} +8 -7
- package/dist/client/{productList-BGCGT4KZ.mjs → productList-AZOLOZKM.mjs} +8 -7
- package/dist/client/rendering/client.mjs +5518 -3869
- package/dist/client/rendering/islands.mjs +32 -20
- package/dist/client/rendering.mjs +14494 -10485
- package/dist/client/{shop-RQHUCLNY.mjs → shop-ZDLO7IIG.mjs} +8 -7
- package/dist/client/spam-protection.mjs +3 -5
- package/dist/preview-next/client/runtime.css +1 -1
- 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-CTWKNBDQ.mjs} +6 -6
- package/dist/{sdk-runtime-EEMNSB7J.css → sdk-runtime-JD4A6SU6.css} +1 -1
- package/dist/server/components.mjs +10475 -7369
- package/dist/server/config-validation.mjs +26616 -25360
- package/dist/server/config.mjs +26616 -25360
- package/dist/server/data.mjs +27048 -25586
- package/dist/server/index.mjs +109 -56
- package/dist/server/next.mjs +15424 -12076
- package/dist/server/page-converter.mjs +5570 -3107
- package/dist/server/prebuild.mjs +2 -1
- package/dist/server/rendering/server.mjs +10850 -7549
- package/dist/server/rendering.mjs +10855 -7554
- package/dist/server/routing.mjs +30134 -28531
- package/dist/server/server.mjs +27369 -25856
- package/dist/server/theme-bridge.mjs +902 -167
- package/dist/server/theme.mjs +197 -133
- package/dist/styles/index.css +606 -133
- package/package.json +16 -16
- 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,471 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { resolvePreviewDashboardSetupHandoff, buildPreviewDashboardSetupUrl, resolvePreviewSidebarChromeModel, resolvePreviewEditorGuidanceModel,
|
|
3
|
-
import {
|
|
4
|
-
import { usePreviewAuth, getDashboardUrl } from './chunk-
|
|
2
|
+
import { resolvePreviewDashboardSetupHandoff, buildPreviewDashboardSetupUrl, resolvePreviewSidebarChromeModel, resolvePreviewEditorGuidanceModel, previewWidgetOverrides, canInspectSiteStyle, mapContentSchemaToFormFields, PreviewFormProvider, usePreviewBlockCustomizeSelectionOptional, BlockEditor, canApplySiteStyle, useBlockCustomizeControls, MAX_QUICK_MANIFEST_FIELDS } from './chunk-G35HOQEN.mjs';
|
|
3
|
+
import { useEntryController, useEditorUiStoreInstance, useUISelector, resolvePreviewSidebarTab, unsafeAsEditorBlockId, Tabs, TabsList, TabsTrigger, Button, X, TabsContent, useEditorUiStore, deriveRouteMetadataPresentation, resolvePageRouteSlug, createManifestValidation, createStoreBackend, ManifestForm, previewAssistantEnabled, Collapsible, CollapsibleTrigger, ChevronRight, CollapsibleContent, ContentFieldsForm, usePreviewDesignCoordinator, useSiteChromeCustomizeOptional, resolveStyleConfiguratorInitialSnapshot, createStyleConfiguratorState, isPreviewingChange, createOptimisticActionRunner, syncStyleConfiguratorState, getCuratedSiteStyle, planSiteStylePreviewChange, openRow, previewSiteStyle, applyResolvedSelections, previewButtonPersonality, previewHeaderLayout, previewHeaderStyle, planSiteChromeLookSelection, previewFooterLook, previewPaletteVariant, previewTypographyPreset, setTypographyBodyFontOverride, setTypographyHeadingFontOverride, clearTypographyFontOverrides, paletteOverridesSchema, setPaletteOverrides, toggleRow, cancelPreview, dismissWarnings, dismissNotices, deriveStyleConfiguratorCapabilities, buildApplySiteStyleSelectionBody, markApplyFailed, selectionSnapshotFromApplySiteStyleSelectionResponse, styleConfiguratorHistoryEntryForPersistedSelection, markApplySaved, unwrapResponse, markApplySaving, findButtonPersonality, findPaletteVariant, findTypographyPreset, buildSiteChromeLookModels, getHeaderLayout, getHeaderStyle, findFooterLook, cycleSiteChromeLookId, footerLookCatalog, resolveContentTitle, foldSubroute, SUBROUTE_KINDS, Smartphone, Tablet, Monitor, Maximize2, cn, DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuItem, curatedSiteStyles, ChevronLeft, cycleableSiteChromeOptions, requireEntriesForCuratedChoices, buttonPersonalities, typographyPresets, paletteVariants, Select, SelectTrigger, SelectValue, SelectContent, SelectItem, FormRenderer, evaluateTypographyFontSlot, Callout, CalloutDescription, Separator, Surface, ColorPicker, Input } from './chunk-XQR6THQJ.mjs';
|
|
4
|
+
import { usePreviewAuth, getDashboardUrl } from './chunk-FIREV57T.mjs';
|
|
5
5
|
import './chunk-R7POPVJR.mjs';
|
|
6
6
|
import { useMemo, useRef, useCallback, useEffect, useState, useTransition, useSyncExternalStore, useId } from 'react';
|
|
7
7
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
8
8
|
import { useRouter } from 'next/navigation';
|
|
9
9
|
|
|
10
|
-
// ../editor-blocks/src/widgets/entry-picker/loaders.ts
|
|
11
|
-
function getStatusBadgeVariant(status) {
|
|
12
|
-
switch (status) {
|
|
13
|
-
case "published":
|
|
14
|
-
return "default";
|
|
15
|
-
case "draft":
|
|
16
|
-
return "secondary";
|
|
17
|
-
case "scheduled":
|
|
18
|
-
return "outline";
|
|
19
|
-
case "archived":
|
|
20
|
-
return "destructive";
|
|
21
|
-
default:
|
|
22
|
-
return "secondary";
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
function mapEntryPickerItems(entries, valueFrom) {
|
|
26
|
-
return entries.map((entry) => ({
|
|
27
|
-
value: valueFrom === "identifier" ? entry.identifier ?? entry.id : valueFrom === "slug" ? entry.slug ?? entry.id : entry.id,
|
|
28
|
-
label: entry.draftTitle || entry.title || entry.slug || entry.id,
|
|
29
|
-
id: entry.id,
|
|
30
|
-
identifier: entry.identifier ?? null,
|
|
31
|
-
slug: entry.slug ?? null,
|
|
32
|
-
badge: {
|
|
33
|
-
label: entry.status,
|
|
34
|
-
variant: getStatusBadgeVariant(entry.status)
|
|
35
|
-
}
|
|
36
|
-
}));
|
|
37
|
-
}
|
|
38
|
-
async function loadEntryPickerItems({
|
|
39
|
-
apiClient,
|
|
40
|
-
siteId,
|
|
41
|
-
contentType,
|
|
42
|
-
valueFrom
|
|
43
|
-
}) {
|
|
44
|
-
const result = await apiClient({
|
|
45
|
-
endpoint: "listContentEntries",
|
|
46
|
-
params: { siteId, type: contentType }
|
|
47
|
-
});
|
|
48
|
-
const { entries } = unwrapResponse(result);
|
|
49
|
-
return mapEntryPickerItems(entries, valueFrom);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
// ../editor-blocks/src/widgets/link/loaders.ts
|
|
53
|
-
async function loadRoutableContentItems({
|
|
54
|
-
apiClient,
|
|
55
|
-
siteId
|
|
56
|
-
}) {
|
|
57
|
-
const result = await apiClient({
|
|
58
|
-
endpoint: "getRoutableContent",
|
|
59
|
-
params: { siteId }
|
|
60
|
-
});
|
|
61
|
-
const payload = unwrapResponse(result);
|
|
62
|
-
return Array.isArray(payload?.items) ? payload.items : [];
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
// ../editor-blocks/src/widgets/reference/dynamicAdapters.ts
|
|
66
|
-
function createDynamicReferenceAdapters(staticAdapters, createDynamicContentAdapter) {
|
|
67
|
-
return new Proxy(staticAdapters, {
|
|
68
|
-
get(target, prop) {
|
|
69
|
-
if (typeof prop !== "string") {
|
|
70
|
-
return void 0;
|
|
71
|
-
}
|
|
72
|
-
if (prop in target) {
|
|
73
|
-
return target[prop];
|
|
74
|
-
}
|
|
75
|
-
const parsed = parseReferenceKind(prop);
|
|
76
|
-
if (parsed.kind === "dynamicContent") {
|
|
77
|
-
return createDynamicContentAdapter(parsed.contentTypeKey);
|
|
78
|
-
}
|
|
79
|
-
return void 0;
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
// ../editor-blocks/src/widgets/reference/loaders.ts
|
|
85
|
-
function defineReferenceLoader(referenceKind, loader) {
|
|
86
|
-
return Object.assign(loader, { referenceKind });
|
|
87
|
-
}
|
|
88
|
-
function formatStatusBadge(status) {
|
|
89
|
-
if (status === "published") {
|
|
90
|
-
return { label: "Published", variant: "default" };
|
|
91
|
-
}
|
|
92
|
-
if (status === "scheduled") {
|
|
93
|
-
return { label: "Scheduled", variant: "secondary" };
|
|
94
|
-
}
|
|
95
|
-
if (status === "archived") {
|
|
96
|
-
return { label: "Archived", variant: "outline" };
|
|
97
|
-
}
|
|
98
|
-
return { label: "Draft", variant: "outline" };
|
|
99
|
-
}
|
|
100
|
-
function hasSlug(entry) {
|
|
101
|
-
return entry.slug !== null;
|
|
102
|
-
}
|
|
103
|
-
var loadPostReferenceItems = defineReferenceLoader("post", async ({ apiClient, siteId }) => {
|
|
104
|
-
const result = await apiClient({
|
|
105
|
-
endpoint: "listContentEntries",
|
|
106
|
-
params: { siteId, type: "post" }
|
|
107
|
-
});
|
|
108
|
-
const { entries } = unwrapResponse(result);
|
|
109
|
-
return entries.filter(hasSlug).filter((entry) => entry.status === "published").map((entry) => ({
|
|
110
|
-
value: entry.slug,
|
|
111
|
-
label: entry.title || entry.slug || entry.id,
|
|
112
|
-
badge: formatStatusBadge(entry.status)
|
|
113
|
-
}));
|
|
114
|
-
});
|
|
115
|
-
var loadFormReferenceItems = defineReferenceLoader("form", async ({ apiClient, siteId }) => {
|
|
116
|
-
const result = await apiClient({
|
|
117
|
-
endpoint: "listForms",
|
|
118
|
-
params: { siteId }
|
|
119
|
-
});
|
|
120
|
-
const { forms } = unwrapResponse(result);
|
|
121
|
-
return forms.map((form) => ({
|
|
122
|
-
value: form.slug,
|
|
123
|
-
label: form.name
|
|
124
|
-
}));
|
|
125
|
-
});
|
|
126
|
-
var loadBookingFormReferenceItems = defineReferenceLoader("bookingForm", async ({ apiClient, siteId }) => {
|
|
127
|
-
const result = await apiClient({
|
|
128
|
-
endpoint: "listBookingForms",
|
|
129
|
-
params: { siteId }
|
|
130
|
-
});
|
|
131
|
-
const { forms } = unwrapResponse(result);
|
|
132
|
-
return forms.map((form) => ({
|
|
133
|
-
value: form.id,
|
|
134
|
-
label: form.name
|
|
135
|
-
}));
|
|
136
|
-
});
|
|
137
|
-
var loadAppointmentServiceReferenceItems = defineReferenceLoader(
|
|
138
|
-
"appointmentService",
|
|
139
|
-
async ({ apiClient, siteId }) => {
|
|
140
|
-
const result = await apiClient({
|
|
141
|
-
endpoint: "getAppointmentServicesReference",
|
|
142
|
-
params: { siteId }
|
|
143
|
-
});
|
|
144
|
-
const { options } = unwrapResponse(result);
|
|
145
|
-
return options.map((option) => ({
|
|
146
|
-
value: option.id,
|
|
147
|
-
label: option.label
|
|
148
|
-
}));
|
|
149
|
-
}
|
|
150
|
-
);
|
|
151
|
-
var loadAppointmentResourceReferenceItems = defineReferenceLoader(
|
|
152
|
-
"appointmentResource",
|
|
153
|
-
async ({ apiClient, siteId }) => {
|
|
154
|
-
const result = await apiClient({
|
|
155
|
-
endpoint: "getAppointmentResourcesReference",
|
|
156
|
-
params: { siteId }
|
|
157
|
-
});
|
|
158
|
-
const { options } = unwrapResponse(result);
|
|
159
|
-
return options.map((option) => ({
|
|
160
|
-
value: option.id,
|
|
161
|
-
label: option.label
|
|
162
|
-
}));
|
|
163
|
-
}
|
|
164
|
-
);
|
|
165
|
-
var loadPageReferenceItems = defineReferenceLoader("page", async ({ apiClient, siteId }) => {
|
|
166
|
-
const result = await apiClient({
|
|
167
|
-
endpoint: "getRoutableContent",
|
|
168
|
-
params: { siteId }
|
|
169
|
-
});
|
|
170
|
-
const { items } = unwrapResponse(result);
|
|
171
|
-
return items.filter((item) => item.entityType === "page").map((page) => ({
|
|
172
|
-
value: page.entityId,
|
|
173
|
-
label: page.title || "Untitled"
|
|
174
|
-
}));
|
|
175
|
-
});
|
|
176
|
-
var loadNewsletterListReferenceItems = defineReferenceLoader(
|
|
177
|
-
"newsletterList",
|
|
178
|
-
async ({ apiClient, siteId }) => {
|
|
179
|
-
const result = await apiClient({
|
|
180
|
-
endpoint: "listNewsletterLists",
|
|
181
|
-
params: { siteId }
|
|
182
|
-
});
|
|
183
|
-
const { lists } = unwrapResponse(result);
|
|
184
|
-
return lists.map((list) => ({
|
|
185
|
-
value: list.id,
|
|
186
|
-
label: list.name
|
|
187
|
-
}));
|
|
188
|
-
}
|
|
189
|
-
);
|
|
190
|
-
async function loadDynamicContentReferenceItems({
|
|
191
|
-
apiClient,
|
|
192
|
-
siteId,
|
|
193
|
-
contentTypeKey
|
|
194
|
-
}) {
|
|
195
|
-
const result = await apiClient({
|
|
196
|
-
endpoint: "listContentEntries",
|
|
197
|
-
params: { siteId, type: contentTypeKey }
|
|
198
|
-
});
|
|
199
|
-
const { entries } = unwrapResponse(result);
|
|
200
|
-
return entries.filter((entry) => entry.status === "published").map((entry) => ({
|
|
201
|
-
value: entry.id,
|
|
202
|
-
label: entry.title || entry.slug || entry.id,
|
|
203
|
-
badge: { label: "Published", variant: "default" }
|
|
204
|
-
}));
|
|
205
|
-
}
|
|
206
|
-
var referenceLoaders = {
|
|
207
|
-
post: loadPostReferenceItems,
|
|
208
|
-
form: loadFormReferenceItems,
|
|
209
|
-
bookingForm: loadBookingFormReferenceItems,
|
|
210
|
-
appointmentService: loadAppointmentServiceReferenceItems,
|
|
211
|
-
appointmentResource: loadAppointmentResourceReferenceItems,
|
|
212
|
-
page: loadPageReferenceItems,
|
|
213
|
-
newsletterList: loadNewsletterListReferenceItems
|
|
214
|
-
};
|
|
215
|
-
|
|
216
|
-
// ../preview-next/src/client/widgets/widgetAdapters.ts
|
|
217
|
-
var routableContentCache = /* @__PURE__ */ new Map();
|
|
218
|
-
var entryPickerCache = /* @__PURE__ */ new Map();
|
|
219
|
-
var referenceItemsCache = /* @__PURE__ */ new Map();
|
|
220
|
-
var dynamicReferenceItemsCache = /* @__PURE__ */ new Map();
|
|
221
|
-
var MAX_CACHE_ENTRIES = 50;
|
|
222
|
-
function setBoundedCache(map, key, value) {
|
|
223
|
-
if (!map.has(key) && map.size >= MAX_CACHE_ENTRIES) {
|
|
224
|
-
const firstKey = map.keys().next().value;
|
|
225
|
-
if (firstKey !== void 0) {
|
|
226
|
-
map.delete(firstKey);
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
map.set(key, value);
|
|
230
|
-
}
|
|
231
|
-
function createCachedDynamicContentReferenceAdapter(contentTypeKey, previewClient, fallbackSiteId) {
|
|
232
|
-
return {
|
|
233
|
-
labels: {
|
|
234
|
-
loading: "Loading entries\u2026",
|
|
235
|
-
select: "Select an entry",
|
|
236
|
-
empty: "No entries found",
|
|
237
|
-
emptySelection: "Select an entry to continue."
|
|
238
|
-
},
|
|
239
|
-
loadItems: async ({ siteId }) => {
|
|
240
|
-
const resolvedSiteId = siteId || fallbackSiteId;
|
|
241
|
-
if (!resolvedSiteId) {
|
|
242
|
-
return [];
|
|
243
|
-
}
|
|
244
|
-
const cacheKey = `${resolvedSiteId}:content:${contentTypeKey}`;
|
|
245
|
-
const cached = dynamicReferenceItemsCache.get(cacheKey);
|
|
246
|
-
if (cached) return cached;
|
|
247
|
-
const promise = (async () => {
|
|
248
|
-
try {
|
|
249
|
-
return await loadDynamicContentReferenceItems({
|
|
250
|
-
apiClient: previewClient,
|
|
251
|
-
siteId: resolvedSiteId,
|
|
252
|
-
contentTypeKey
|
|
253
|
-
});
|
|
254
|
-
} catch (error) {
|
|
255
|
-
dynamicReferenceItemsCache.delete(cacheKey);
|
|
256
|
-
throw error;
|
|
257
|
-
}
|
|
258
|
-
})();
|
|
259
|
-
setBoundedCache(dynamicReferenceItemsCache, cacheKey, promise);
|
|
260
|
-
return promise;
|
|
261
|
-
}
|
|
262
|
-
};
|
|
263
|
-
}
|
|
264
|
-
function createCachedReferenceAdapterLoader(kind, loader, previewClient, fallbackSiteId) {
|
|
265
|
-
return async ({ siteId }) => {
|
|
266
|
-
const resolvedSiteId = siteId || fallbackSiteId;
|
|
267
|
-
if (!resolvedSiteId) {
|
|
268
|
-
return [];
|
|
269
|
-
}
|
|
270
|
-
const cacheKey = `${kind}:${resolvedSiteId}`;
|
|
271
|
-
const cached = referenceItemsCache.get(cacheKey);
|
|
272
|
-
if (cached) return cached;
|
|
273
|
-
const promise = (async () => {
|
|
274
|
-
try {
|
|
275
|
-
return await loader({ apiClient: previewClient, siteId: resolvedSiteId });
|
|
276
|
-
} catch (error) {
|
|
277
|
-
referenceItemsCache.delete(cacheKey);
|
|
278
|
-
throw error;
|
|
279
|
-
}
|
|
280
|
-
})();
|
|
281
|
-
setBoundedCache(referenceItemsCache, cacheKey, promise);
|
|
282
|
-
return promise;
|
|
283
|
-
};
|
|
284
|
-
}
|
|
285
|
-
function createPreviewLinkAdapters(previewClient) {
|
|
286
|
-
return {
|
|
287
|
-
fetchRoutableContent: async (currentSiteId) => {
|
|
288
|
-
const cached = routableContentCache.get(currentSiteId);
|
|
289
|
-
if (cached) return cached;
|
|
290
|
-
const promise = (async () => {
|
|
291
|
-
try {
|
|
292
|
-
return await loadRoutableContentItems({ apiClient: previewClient, siteId: currentSiteId });
|
|
293
|
-
} catch (error) {
|
|
294
|
-
routableContentCache.delete(currentSiteId);
|
|
295
|
-
throw error;
|
|
296
|
-
}
|
|
297
|
-
})();
|
|
298
|
-
setBoundedCache(routableContentCache, currentSiteId, promise);
|
|
299
|
-
return promise;
|
|
300
|
-
}
|
|
301
|
-
};
|
|
302
|
-
}
|
|
303
|
-
function createPreviewEntryPickerAdapter(previewClient) {
|
|
304
|
-
return {
|
|
305
|
-
loadItems: async ({ siteId, contentType, valueFrom }) => {
|
|
306
|
-
if (!siteId || !contentType) return [];
|
|
307
|
-
const cacheKey = `${siteId}:${contentType}:${valueFrom ?? "id"}`;
|
|
308
|
-
const cached = entryPickerCache.get(cacheKey);
|
|
309
|
-
if (cached) return cached;
|
|
310
|
-
const request = (async () => {
|
|
311
|
-
try {
|
|
312
|
-
return await loadEntryPickerItems({
|
|
313
|
-
apiClient: previewClient,
|
|
314
|
-
siteId,
|
|
315
|
-
contentType,
|
|
316
|
-
valueFrom
|
|
317
|
-
});
|
|
318
|
-
} catch (error) {
|
|
319
|
-
entryPickerCache.delete(cacheKey);
|
|
320
|
-
throw error;
|
|
321
|
-
}
|
|
322
|
-
})();
|
|
323
|
-
setBoundedCache(entryPickerCache, cacheKey, request);
|
|
324
|
-
return request;
|
|
325
|
-
},
|
|
326
|
-
labels: {
|
|
327
|
-
loading: "Loading entries...",
|
|
328
|
-
select: "Select an entry",
|
|
329
|
-
empty: "No entries found",
|
|
330
|
-
emptySelection: "Select an entry to embed.",
|
|
331
|
-
noContentType: "Select a content type first."
|
|
332
|
-
}
|
|
333
|
-
};
|
|
334
|
-
}
|
|
335
|
-
var previewReferenceChrome = {
|
|
336
|
-
post: {
|
|
337
|
-
labels: {
|
|
338
|
-
loading: "Loading posts\u2026",
|
|
339
|
-
select: "Select a post",
|
|
340
|
-
empty: "No posts found",
|
|
341
|
-
emptySelection: "Select a post to continue."
|
|
342
|
-
}
|
|
343
|
-
},
|
|
344
|
-
form: {
|
|
345
|
-
labels: {
|
|
346
|
-
loading: "Loading forms\u2026",
|
|
347
|
-
select: "Select a form",
|
|
348
|
-
empty: "No forms found",
|
|
349
|
-
emptySelection: "Select a form to continue."
|
|
350
|
-
}
|
|
351
|
-
},
|
|
352
|
-
bookingForm: {
|
|
353
|
-
labels: {
|
|
354
|
-
loading: "Loading booking forms\u2026",
|
|
355
|
-
select: "Select a booking form",
|
|
356
|
-
empty: "No booking forms yet",
|
|
357
|
-
emptySelection: "Select a booking form to enable appointment booking."
|
|
358
|
-
}
|
|
359
|
-
},
|
|
360
|
-
appointmentService: {
|
|
361
|
-
labels: {
|
|
362
|
-
loading: "Loading appointment services\u2026",
|
|
363
|
-
select: "Select a service",
|
|
364
|
-
empty: "No services available",
|
|
365
|
-
emptySelection: "Select a service to enable booking."
|
|
366
|
-
}
|
|
367
|
-
},
|
|
368
|
-
appointmentResource: {
|
|
369
|
-
labels: {
|
|
370
|
-
loading: "Loading resources\u2026",
|
|
371
|
-
select: "Select a resource",
|
|
372
|
-
empty: "No resources available",
|
|
373
|
-
emptySelection: "Select a resource (optional)."
|
|
374
|
-
}
|
|
375
|
-
},
|
|
376
|
-
page: {
|
|
377
|
-
labels: {
|
|
378
|
-
loading: "Loading pages\u2026",
|
|
379
|
-
select: "Select a page",
|
|
380
|
-
empty: "No pages available",
|
|
381
|
-
emptySelection: "Select a page."
|
|
382
|
-
}
|
|
383
|
-
},
|
|
384
|
-
newsletterList: {
|
|
385
|
-
labels: {
|
|
386
|
-
loading: "Loading lists\u2026",
|
|
387
|
-
select: "Select a list",
|
|
388
|
-
empty: "No lists yet",
|
|
389
|
-
emptySelection: "Select a newsletter list to subscribe users to."
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
|
-
};
|
|
393
|
-
function createPreviewReferenceAdapters(previewClient, fallbackSiteId) {
|
|
394
|
-
const brandedFallbackSiteId = void 0;
|
|
395
|
-
const adapters = {};
|
|
396
|
-
for (const kind of BUILT_IN_REFERENCE_KINDS) {
|
|
397
|
-
adapters[kind] = {
|
|
398
|
-
loadItems: createCachedReferenceAdapterLoader(
|
|
399
|
-
kind,
|
|
400
|
-
referenceLoaders[kind],
|
|
401
|
-
previewClient,
|
|
402
|
-
brandedFallbackSiteId
|
|
403
|
-
),
|
|
404
|
-
labels: previewReferenceChrome[kind].labels
|
|
405
|
-
};
|
|
406
|
-
}
|
|
407
|
-
return createDynamicReferenceAdapters(
|
|
408
|
-
adapters,
|
|
409
|
-
(contentTypeKey) => createCachedDynamicContentReferenceAdapter(contentTypeKey, previewClient, brandedFallbackSiteId)
|
|
410
|
-
);
|
|
411
|
-
}
|
|
412
|
-
function PreviewFormProviderInner({ theme, children }) {
|
|
413
|
-
const { onPickImage, picker } = useRichTextImagePicker();
|
|
414
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
415
|
-
/* @__PURE__ */ jsx(RichTextWidgetProvider, { theme, onPickImage, children }),
|
|
416
|
-
picker
|
|
417
|
-
] });
|
|
418
|
-
}
|
|
419
|
-
function PreviewFormProvider({
|
|
420
|
-
siteId: rawSiteId,
|
|
421
|
-
theme = null,
|
|
422
|
-
previewClient,
|
|
423
|
-
bearerToken,
|
|
424
|
-
supabaseUrl,
|
|
425
|
-
mediaAssets,
|
|
426
|
-
sdkConfig,
|
|
427
|
-
children
|
|
428
|
-
}) {
|
|
429
|
-
const siteId = useMemo(() => expectParsedBrandedId(parseSiteId(rawSiteId)), [rawSiteId]);
|
|
430
|
-
const linkAdapters = useMemo(() => createPreviewLinkAdapters(previewClient), [previewClient]);
|
|
431
|
-
const entryPickerAdapter = useMemo(() => createPreviewEntryPickerAdapter(previewClient), [previewClient]);
|
|
432
|
-
const referenceAdapters = useMemo(
|
|
433
|
-
() => createPreviewReferenceAdapters(previewClient),
|
|
434
|
-
[previewClient]
|
|
435
|
-
);
|
|
436
|
-
const paletteTokens = useMemo(() => {
|
|
437
|
-
if (!theme) return void 0;
|
|
438
|
-
try {
|
|
439
|
-
const runtime = buildThemeRuntime(theme);
|
|
440
|
-
return runtime.paletteTokens;
|
|
441
|
-
} catch {
|
|
442
|
-
return void 0;
|
|
443
|
-
}
|
|
444
|
-
}, [theme]);
|
|
445
|
-
return /* @__PURE__ */ jsx(SdkConfigProvider, { sdkConfig: sdkConfig ?? null, children: /* @__PURE__ */ jsx(PaletteProvider, { tokens: paletteTokens, children: /* @__PURE__ */ jsx(LinkWidgetProvider, { siteId, adapters: linkAdapters, children: /* @__PURE__ */ jsx(ReferenceWidgetProvider, { siteId, adapters: referenceAdapters, children: /* @__PURE__ */ jsx(EntryPickerWidgetProvider, { siteId, adapter: entryPickerAdapter, children: /* @__PURE__ */ jsx(
|
|
446
|
-
MediaEditorProvider,
|
|
447
|
-
{
|
|
448
|
-
siteId,
|
|
449
|
-
apiClient: previewClient,
|
|
450
|
-
bearerToken,
|
|
451
|
-
supabaseUrl,
|
|
452
|
-
mediaAssets,
|
|
453
|
-
children: /* @__PURE__ */ jsx(ButtonWidgetProvider, { buttonSystem: theme?.buttons ?? null, children: /* @__PURE__ */ jsx(PreviewFormProviderInner, { theme, children }) })
|
|
454
|
-
}
|
|
455
|
-
) }) }) }) }) });
|
|
456
|
-
}
|
|
457
|
-
var previewWidgetOverrides = {
|
|
458
|
-
link: LinkField,
|
|
459
|
-
file: FileField,
|
|
460
|
-
media: MediaField,
|
|
461
|
-
richText: RichTextField,
|
|
462
|
-
reference: ReferenceField,
|
|
463
|
-
backgroundColor: BackgroundColorField,
|
|
464
|
-
backgroundGradient: BackgroundGradientField,
|
|
465
|
-
entryPicker: EntryPickerField,
|
|
466
|
-
iconPicker: IconPickerField,
|
|
467
|
-
buttonVariant: ButtonVariantField
|
|
468
|
-
};
|
|
469
10
|
function PreviewZoomControls({ zoom, onZoomChange, disabled }) {
|
|
470
11
|
return /* @__PURE__ */ jsxs(
|
|
471
12
|
Select,
|
|
@@ -550,6 +91,25 @@ function PreviewViewportControls({
|
|
|
550
91
|
showZoomControls ? /* @__PURE__ */ jsx(PreviewZoomControls, { zoom, onZoomChange }) : null
|
|
551
92
|
] });
|
|
552
93
|
}
|
|
94
|
+
function PreviewSidebarSection({
|
|
95
|
+
label,
|
|
96
|
+
defaultOpen = false,
|
|
97
|
+
openRequestId = null,
|
|
98
|
+
children
|
|
99
|
+
}) {
|
|
100
|
+
const [open, setOpen] = useState(defaultOpen || openRequestId !== null);
|
|
101
|
+
useEffect(() => {
|
|
102
|
+
if (openRequestId === null) return;
|
|
103
|
+
setOpen(true);
|
|
104
|
+
}, [openRequestId]);
|
|
105
|
+
return /* @__PURE__ */ jsx(Collapsible, { open, onOpenChange: setOpen, children: /* @__PURE__ */ jsxs("div", { className: "border-b", children: [
|
|
106
|
+
/* @__PURE__ */ jsx(CollapsibleTrigger, { asChild: true, children: /* @__PURE__ */ jsxs("div", { className: "flex cursor-pointer items-center gap-2 px-4 py-3 hover:bg-accent/40", children: [
|
|
107
|
+
/* @__PURE__ */ jsx(ChevronRight, { className: `h-4 w-4 transition ${open ? "rotate-90" : ""}` }),
|
|
108
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm font-semibold", children: label })
|
|
109
|
+
] }) }),
|
|
110
|
+
/* @__PURE__ */ jsx(CollapsibleContent, { children })
|
|
111
|
+
] }) });
|
|
112
|
+
}
|
|
553
113
|
function SubrouteNotice({ model }) {
|
|
554
114
|
return /* @__PURE__ */ jsxs("div", { className: "border-b bg-amber-50 px-4 py-3 text-amber-950", children: [
|
|
555
115
|
/* @__PURE__ */ jsx("p", { className: "text-sm font-semibold", children: model.title }),
|
|
@@ -607,6 +167,7 @@ function EntryEditorPanel({
|
|
|
607
167
|
supabaseUrl,
|
|
608
168
|
entrySubrouteContext,
|
|
609
169
|
metadataPanel,
|
|
170
|
+
linkedEntrySection,
|
|
610
171
|
mediaAssets,
|
|
611
172
|
widgets,
|
|
612
173
|
viewportMode,
|
|
@@ -659,6 +220,14 @@ function EntryEditorPanel({
|
|
|
659
220
|
) }),
|
|
660
221
|
subrouteNotice ? /* @__PURE__ */ jsx(SubrouteNotice, { model: subrouteNotice }) : null,
|
|
661
222
|
/* @__PURE__ */ jsxs("div", { className: "min-h-0 flex-1 space-y-0 overflow-auto", children: [
|
|
223
|
+
linkedEntrySection ? /* @__PURE__ */ jsx(
|
|
224
|
+
PreviewSidebarSection,
|
|
225
|
+
{
|
|
226
|
+
label: linkedEntrySection.label,
|
|
227
|
+
openRequestId: linkedEntrySection.openRequestId,
|
|
228
|
+
children: linkedEntrySection.content
|
|
229
|
+
}
|
|
230
|
+
) : null,
|
|
662
231
|
contentTypeSchema && entryData.type ? /* @__PURE__ */ jsx(Collapsible, { open: contentOpen, onOpenChange: setContentOpen, children: /* @__PURE__ */ jsxs("div", { className: "border-b", children: [
|
|
663
232
|
/* @__PURE__ */ jsx(CollapsibleTrigger, { asChild: true, children: /* @__PURE__ */ jsxs("div", { className: "flex cursor-pointer items-center gap-2 px-4 py-3 hover:bg-accent/40", children: [
|
|
664
233
|
/* @__PURE__ */ jsx(ChevronRight, { className: `h-4 w-4 transition ${contentOpen ? "rotate-90" : ""}` }),
|
|
@@ -812,7 +381,7 @@ function SelectedBlockCustomizeFields({
|
|
|
812
381
|
)
|
|
813
382
|
] }) : null,
|
|
814
383
|
panelFields.length > 0 ? /* @__PURE__ */ jsxs("section", { className: "space-y-3", children: [
|
|
815
|
-
/* @__PURE__ */ jsx("div", { className: "text-xs font-medium uppercase text-muted-foreground", children: "More
|
|
384
|
+
/* @__PURE__ */ jsx("div", { className: "text-xs font-medium uppercase text-muted-foreground", children: "More controls" }),
|
|
816
385
|
/* @__PURE__ */ jsx(
|
|
817
386
|
FormRenderer,
|
|
818
387
|
{
|
|
@@ -853,9 +422,11 @@ function PageBlockEditorPanel({
|
|
|
853
422
|
blockEditorRef,
|
|
854
423
|
onBlocksChange,
|
|
855
424
|
metadataPanel,
|
|
425
|
+
linkedEntrySection,
|
|
856
426
|
designPanel,
|
|
857
427
|
sdkConfig,
|
|
858
428
|
mediaAssets,
|
|
429
|
+
bookingOfferingPresets,
|
|
859
430
|
viewportMode,
|
|
860
431
|
viewportWidth,
|
|
861
432
|
zoom,
|
|
@@ -870,6 +441,17 @@ function PageBlockEditorPanel({
|
|
|
870
441
|
const [detailsOpen, setDetailsOpen] = useState(false);
|
|
871
442
|
const selectionKind = customizeSelection?.selection.kind;
|
|
872
443
|
const selectionRequestId = customizeSelection?.selection.kind === "selected" ? customizeSelection.selection.requestId : 0;
|
|
444
|
+
const handleCustomizeBlock = useCallback(
|
|
445
|
+
(blockId) => {
|
|
446
|
+
customizeSelection?.inspectBlock(blockId);
|
|
447
|
+
setCustomizeOpen(true);
|
|
448
|
+
},
|
|
449
|
+
[customizeSelection]
|
|
450
|
+
);
|
|
451
|
+
const blockActionPresentation = useMemo(
|
|
452
|
+
() => customizeSelection ? { kind: "menu", customize: { kind: "external", onSelect: handleCustomizeBlock } } : { kind: "menu", customize: { kind: "modal" } },
|
|
453
|
+
[customizeSelection, handleCustomizeBlock]
|
|
454
|
+
);
|
|
873
455
|
useEffect(() => {
|
|
874
456
|
if (selectionKind === "selected") {
|
|
875
457
|
setCustomizeOpen(true);
|
|
@@ -896,8 +478,17 @@ function PageBlockEditorPanel({
|
|
|
896
478
|
bearerToken,
|
|
897
479
|
supabaseUrl,
|
|
898
480
|
mediaAssets,
|
|
481
|
+
bookingOfferingPresets,
|
|
899
482
|
sdkConfig: sdkConfig ?? null,
|
|
900
483
|
children: /* @__PURE__ */ jsxs("div", { className: "min-h-0 flex-1 space-y-0 overflow-auto", children: [
|
|
484
|
+
linkedEntrySection ? /* @__PURE__ */ jsx(
|
|
485
|
+
PreviewSidebarSection,
|
|
486
|
+
{
|
|
487
|
+
label: linkedEntrySection.label,
|
|
488
|
+
openRequestId: linkedEntrySection.openRequestId,
|
|
489
|
+
children: linkedEntrySection.content
|
|
490
|
+
}
|
|
491
|
+
) : null,
|
|
901
492
|
designPanel ? /* @__PURE__ */ jsx(Collapsible, { open: designOpen, onOpenChange: setDesignOpen, children: /* @__PURE__ */ jsxs("div", { className: "border-b", children: [
|
|
902
493
|
/* @__PURE__ */ jsx(CollapsibleTrigger, { asChild: true, children: /* @__PURE__ */ jsxs("div", { className: "flex cursor-pointer items-center gap-2 px-4 py-3 hover:bg-accent/40", children: [
|
|
903
494
|
/* @__PURE__ */ jsx(ChevronRight, { className: `h-4 w-4 transition ${designOpen ? "rotate-90" : ""}` }),
|
|
@@ -935,10 +526,10 @@ function PageBlockEditorPanel({
|
|
|
935
526
|
uiStore: uiStoreForBlockEditor,
|
|
936
527
|
apiClient,
|
|
937
528
|
onBlocksChange,
|
|
529
|
+
actionPresentation: blockActionPresentation,
|
|
938
530
|
widgetOverrides: previewWidgetOverrides,
|
|
939
531
|
sdkConfig: sdkConfig ?? null,
|
|
940
|
-
reorderControlMode: "drag-handle-only"
|
|
941
|
-
actionControlMode: "menu"
|
|
532
|
+
reorderControlMode: "drag-handle-only"
|
|
942
533
|
},
|
|
943
534
|
pageId
|
|
944
535
|
) }) })
|
|
@@ -1184,25 +775,6 @@ function ContrastSwatch({ hex, label }) {
|
|
|
1184
775
|
] })
|
|
1185
776
|
] });
|
|
1186
777
|
}
|
|
1187
|
-
|
|
1188
|
-
// ../preview-next/src/client/preview/styleConfiguratorApplyPayload.ts
|
|
1189
|
-
function buildApplySiteStyleSelectionBody(input) {
|
|
1190
|
-
return {
|
|
1191
|
-
siteStyleId: input.previewed.siteStyleId,
|
|
1192
|
-
buttonPersonalityId: input.previewed.buttonPersonalityId,
|
|
1193
|
-
paletteVariantId: input.previewed.paletteVariantId,
|
|
1194
|
-
paletteOverrides: input.previewed.paletteOverrides,
|
|
1195
|
-
typographyPresetId: input.previewed.typographyPresetId,
|
|
1196
|
-
typographyBodyFontOverride: input.previewed.typographyBodyFontOverride,
|
|
1197
|
-
typographyHeadingFontOverride: input.previewed.typographyHeadingFontOverride,
|
|
1198
|
-
headerLookId: input.previewed.headerLookId,
|
|
1199
|
-
headerLayoutId: input.previewed.headerLayoutId,
|
|
1200
|
-
headerStyleId: input.previewed.headerStyleId,
|
|
1201
|
-
footerLookId: input.previewed.footerLookId,
|
|
1202
|
-
baseSelectionVersion: input.base.selectionVersion,
|
|
1203
|
-
selectionId: input.selectionId ?? null
|
|
1204
|
-
};
|
|
1205
|
-
}
|
|
1206
778
|
var MAX_FONT_RESULTS_WHEN_SEARCHING = 12;
|
|
1207
779
|
var MAX_FONT_RESULTS_WHEN_BROWSING = 8;
|
|
1208
780
|
var PALETTE_BRAND_ROLES = [
|
|
@@ -1239,6 +811,8 @@ function StyleConfigurator({
|
|
|
1239
811
|
}) {
|
|
1240
812
|
const router = useRouter();
|
|
1241
813
|
const previewDesign = usePreviewDesignCoordinator();
|
|
814
|
+
const siteChromeCustomize = useSiteChromeCustomizeOptional();
|
|
815
|
+
const setSiteStyleStagedPreviewActive = siteChromeCustomize?.siteStyleHistory.setStagedPreviewActive;
|
|
1242
816
|
const {
|
|
1243
817
|
applyFailed,
|
|
1244
818
|
applyStarted,
|
|
@@ -1258,12 +832,20 @@ function StyleConfigurator({
|
|
|
1258
832
|
headerSelectionContext,
|
|
1259
833
|
footerSelectionContext
|
|
1260
834
|
}),
|
|
1261
|
-
[
|
|
835
|
+
[
|
|
836
|
+
footerSelectionContext,
|
|
837
|
+
headerSelectionContext,
|
|
838
|
+
theme,
|
|
839
|
+
initialSelections,
|
|
840
|
+
selectionUpdatedAt,
|
|
841
|
+
selectionVersion
|
|
842
|
+
]
|
|
1262
843
|
);
|
|
1263
844
|
const [state, setState] = useState(
|
|
1264
845
|
() => baseSnapshot ? createStyleConfiguratorState(baseSnapshot) : null
|
|
1265
846
|
);
|
|
1266
847
|
const hasLoadedState = state !== null;
|
|
848
|
+
const hasStagedSiteStylePreview = state ? isPreviewingChange(state) : false;
|
|
1267
849
|
const stateRef = useRef(state);
|
|
1268
850
|
const clearPreviewRef = useRef(clearPreview);
|
|
1269
851
|
const runnerRef = useRef(createOptimisticActionRunner());
|
|
@@ -1274,9 +856,18 @@ function StyleConfigurator({
|
|
|
1274
856
|
useEffect(() => {
|
|
1275
857
|
clearPreviewRef.current = clearPreview;
|
|
1276
858
|
}, [clearPreview]);
|
|
859
|
+
useEffect(() => {
|
|
860
|
+
if (!setSiteStyleStagedPreviewActive) return;
|
|
861
|
+
setSiteStyleStagedPreviewActive(hasStagedSiteStylePreview);
|
|
862
|
+
return () => {
|
|
863
|
+
setSiteStyleStagedPreviewActive(false);
|
|
864
|
+
};
|
|
865
|
+
}, [hasStagedSiteStylePreview, setSiteStyleStagedPreviewActive]);
|
|
1277
866
|
useEffect(() => {
|
|
1278
867
|
if (!baseSnapshot) return;
|
|
1279
|
-
setState(
|
|
868
|
+
setState(
|
|
869
|
+
(current) => current ? syncStyleConfiguratorState(current, baseSnapshot) : createStyleConfiguratorState(baseSnapshot)
|
|
870
|
+
);
|
|
1280
871
|
}, [baseSnapshot]);
|
|
1281
872
|
useEffect(() => {
|
|
1282
873
|
if (!state || !baseSnapshot) {
|
|
@@ -1300,7 +891,15 @@ function StyleConfigurator({
|
|
|
1300
891
|
footerSelectionContext
|
|
1301
892
|
});
|
|
1302
893
|
previewTheme("style-configurator", result.themeOverlay, "site-style");
|
|
1303
|
-
}, [
|
|
894
|
+
}, [
|
|
895
|
+
state,
|
|
896
|
+
baseSnapshot,
|
|
897
|
+
clearPreview,
|
|
898
|
+
previewTheme,
|
|
899
|
+
headerSelectionContext,
|
|
900
|
+
footerSelectionContext,
|
|
901
|
+
theme
|
|
902
|
+
]);
|
|
1304
903
|
useEffect(() => {
|
|
1305
904
|
const runner = runnerRef.current;
|
|
1306
905
|
return () => {
|
|
@@ -1314,34 +913,44 @@ function StyleConfigurator({
|
|
|
1314
913
|
setState((current) => {
|
|
1315
914
|
if (!current) return current;
|
|
1316
915
|
appliedExpandedRowRequestIdRef.current = expandedRowRequest.id;
|
|
1317
|
-
return openRow(
|
|
916
|
+
return openRow(
|
|
917
|
+
current,
|
|
918
|
+
expandedRowRequest.row === "header" ? "header-layout" : expandedRowRequest.row
|
|
919
|
+
);
|
|
1318
920
|
});
|
|
1319
921
|
}, [expandedRowRequest, hasLoadedState]);
|
|
1320
|
-
const handlePreviewSiteStyle = useCallback(
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
922
|
+
const handlePreviewSiteStyle = useCallback(
|
|
923
|
+
(siteStyleId) => {
|
|
924
|
+
setState((current) => {
|
|
925
|
+
if (!current) return current;
|
|
926
|
+
const next = previewSiteStyle(current, siteStyleId);
|
|
927
|
+
const siteStyle = getCuratedSiteStyle(siteStyleId);
|
|
928
|
+
if (!siteStyle) return next;
|
|
929
|
+
const result = planSiteStylePreviewChange({
|
|
930
|
+
siteStyle,
|
|
931
|
+
selection: next.previewed,
|
|
932
|
+
baseTheme: theme,
|
|
933
|
+
headerSelectionContext,
|
|
934
|
+
footerSelectionContext
|
|
935
|
+
});
|
|
936
|
+
return applyResolvedSelections(next, {
|
|
937
|
+
resolved: result.resolvedSelections,
|
|
938
|
+
warnings: result.warnings
|
|
939
|
+
});
|
|
1336
940
|
});
|
|
1337
|
-
}
|
|
1338
|
-
|
|
941
|
+
},
|
|
942
|
+
[footerSelectionContext, headerSelectionContext, theme]
|
|
943
|
+
);
|
|
1339
944
|
const handlePreviewPersonality = useCallback((id) => {
|
|
1340
|
-
setState(
|
|
945
|
+
setState(
|
|
946
|
+
(current) => current ? previewButtonPersonality(current, id) : current
|
|
947
|
+
);
|
|
1341
948
|
}, []);
|
|
1342
949
|
const handlePreviewHeaderLayout = useCallback((id) => {
|
|
1343
950
|
if (!id) return;
|
|
1344
|
-
setState(
|
|
951
|
+
setState(
|
|
952
|
+
(current) => current ? previewHeaderLayout(current, id) : current
|
|
953
|
+
);
|
|
1345
954
|
}, []);
|
|
1346
955
|
const handlePreviewHeaderStyle = useCallback((id) => {
|
|
1347
956
|
if (!id) return;
|
|
@@ -1350,34 +959,54 @@ function StyleConfigurator({
|
|
|
1350
959
|
const handlePreviewFooterLook = useCallback((id) => {
|
|
1351
960
|
const plan = planSiteChromeLookSelection({ surface: "footer", lookId: id });
|
|
1352
961
|
if (plan.kind !== "footer") return;
|
|
1353
|
-
setState(
|
|
962
|
+
setState(
|
|
963
|
+
(current) => current ? previewFooterLook(current, plan.next.footerLookId) : current
|
|
964
|
+
);
|
|
1354
965
|
}, []);
|
|
1355
966
|
const handlePreviewPalette = useCallback((id) => {
|
|
1356
|
-
setState(
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
setState((current) => current ? previewTypographyPreset(current, id) : current);
|
|
967
|
+
setState(
|
|
968
|
+
(current) => current ? previewPaletteVariant(current, id) : current
|
|
969
|
+
);
|
|
1360
970
|
}, []);
|
|
971
|
+
const handlePreviewTypographyPreset = useCallback(
|
|
972
|
+
(id) => {
|
|
973
|
+
setState(
|
|
974
|
+
(current) => current ? previewTypographyPreset(current, id) : current
|
|
975
|
+
);
|
|
976
|
+
},
|
|
977
|
+
[]
|
|
978
|
+
);
|
|
1361
979
|
const handleBodyFontOverride = useCallback((fontFamily) => {
|
|
1362
|
-
setState(
|
|
980
|
+
setState(
|
|
981
|
+
(current) => current ? setTypographyBodyFontOverride(current, fontFamily) : current
|
|
982
|
+
);
|
|
1363
983
|
}, []);
|
|
1364
984
|
const handleHeadingFontOverride = useCallback((fontFamily) => {
|
|
1365
|
-
setState(
|
|
985
|
+
setState(
|
|
986
|
+
(current) => current ? setTypographyHeadingFontOverride(current, fontFamily) : current
|
|
987
|
+
);
|
|
1366
988
|
}, []);
|
|
1367
989
|
const handleClearTypographyOverrides = useCallback(() => {
|
|
1368
|
-
setState(
|
|
990
|
+
setState(
|
|
991
|
+
(current) => current ? clearTypographyFontOverrides(current) : current
|
|
992
|
+
);
|
|
1369
993
|
}, []);
|
|
1370
994
|
const handleTokenOverride = useCallback((role, hex) => {
|
|
1371
995
|
setState((current) => {
|
|
1372
996
|
if (!current) return current;
|
|
1373
|
-
const next = {
|
|
997
|
+
const next = {
|
|
998
|
+
...current.previewed.paletteOverrides ?? {},
|
|
999
|
+
[role]: hex
|
|
1000
|
+
};
|
|
1374
1001
|
const parsed = paletteOverridesSchema.safeParse(next);
|
|
1375
1002
|
if (!parsed.success) return current;
|
|
1376
1003
|
return setPaletteOverrides(current, parsed.data);
|
|
1377
1004
|
});
|
|
1378
1005
|
}, []);
|
|
1379
1006
|
const handleResetOverrides = useCallback(() => {
|
|
1380
|
-
setState(
|
|
1007
|
+
setState(
|
|
1008
|
+
(current) => current ? setPaletteOverrides(current, null) : current
|
|
1009
|
+
);
|
|
1381
1010
|
}, []);
|
|
1382
1011
|
const handleToggleRow = useCallback((row) => {
|
|
1383
1012
|
setState((current) => current ? toggleRow(current, row) : current);
|
|
@@ -1394,6 +1023,7 @@ function StyleConfigurator({
|
|
|
1394
1023
|
const handleApply = useCallback(async () => {
|
|
1395
1024
|
const live = stateRef.current;
|
|
1396
1025
|
if (!live || !isPreviewingChange(live)) return;
|
|
1026
|
+
if (!deriveStyleConfiguratorCapabilities(live).canApplyStaged) return;
|
|
1397
1027
|
const previewed = live.previewed;
|
|
1398
1028
|
const siteStyle = getCuratedSiteStyle(previewed.siteStyleId);
|
|
1399
1029
|
if (!siteStyle) return;
|
|
@@ -1433,23 +1063,22 @@ function StyleConfigurator({
|
|
|
1433
1063
|
return unwrapResponse(response);
|
|
1434
1064
|
},
|
|
1435
1065
|
onSuccess: (saved) => {
|
|
1066
|
+
const persisted = selectionSnapshotFromApplySiteStyleSelectionResponse(
|
|
1067
|
+
saved,
|
|
1068
|
+
previewed
|
|
1069
|
+
);
|
|
1070
|
+
const historyEntry = styleConfiguratorHistoryEntryForPersistedSelection(
|
|
1071
|
+
live,
|
|
1072
|
+
persisted
|
|
1073
|
+
);
|
|
1436
1074
|
setState(
|
|
1437
|
-
(current) => current ? markApplySaved(current,
|
|
1438
|
-
siteStyleId: previewed.siteStyleId,
|
|
1439
|
-
selectionVersion: saved.selectionVersion,
|
|
1440
|
-
selectionUpdatedAt: saved.selectionUpdatedAt ?? previewed.selectionUpdatedAt ?? null,
|
|
1441
|
-
buttonPersonalityId: saved.buttonPersonalityId,
|
|
1442
|
-
paletteVariantId: saved.paletteVariantId,
|
|
1443
|
-
paletteOverrides: saved.paletteOverrides ?? null,
|
|
1444
|
-
typographyPresetId: saved.typographyPresetId,
|
|
1445
|
-
typographyBodyFontOverride: saved.typographyBodyFontOverride,
|
|
1446
|
-
typographyHeadingFontOverride: saved.typographyHeadingFontOverride,
|
|
1447
|
-
headerLookId: saved.headerLookId,
|
|
1448
|
-
headerLayoutId: saved.headerLayoutId,
|
|
1449
|
-
headerStyleId: saved.headerStyleId,
|
|
1450
|
-
footerLookId: saved.footerLookId
|
|
1451
|
-
}) : current
|
|
1075
|
+
(current) => current ? markApplySaved(current, persisted) : current
|
|
1452
1076
|
);
|
|
1077
|
+
if (historyEntry) {
|
|
1078
|
+
siteChromeCustomize?.siteStyleHistory.recordAppliedSelection(
|
|
1079
|
+
historyEntry
|
|
1080
|
+
);
|
|
1081
|
+
}
|
|
1453
1082
|
applySucceeded("style-configurator");
|
|
1454
1083
|
startRefreshTransition(() => {
|
|
1455
1084
|
router.refresh();
|
|
@@ -1464,7 +1093,13 @@ function StyleConfigurator({
|
|
|
1464
1093
|
});
|
|
1465
1094
|
}
|
|
1466
1095
|
const message = applyError.message;
|
|
1467
|
-
setState(
|
|
1096
|
+
setState(
|
|
1097
|
+
(current) => current ? markApplyFailed(
|
|
1098
|
+
current,
|
|
1099
|
+
message,
|
|
1100
|
+
applyError.kind === "stale" ? "stale" : "retryable"
|
|
1101
|
+
) : current
|
|
1102
|
+
);
|
|
1468
1103
|
}
|
|
1469
1104
|
});
|
|
1470
1105
|
}, [
|
|
@@ -1476,6 +1111,7 @@ function StyleConfigurator({
|
|
|
1476
1111
|
applySucceeded,
|
|
1477
1112
|
router,
|
|
1478
1113
|
selectionId,
|
|
1114
|
+
siteChromeCustomize?.siteStyleHistory,
|
|
1479
1115
|
siteId,
|
|
1480
1116
|
startRefreshTransition,
|
|
1481
1117
|
theme
|
|
@@ -1484,14 +1120,19 @@ function StyleConfigurator({
|
|
|
1484
1120
|
return /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: "Loading design controls..." });
|
|
1485
1121
|
}
|
|
1486
1122
|
const applyAllowed = canApplySiteStyle(siteStyleAccess);
|
|
1123
|
+
const stagedCapabilities = deriveStyleConfiguratorCapabilities(state);
|
|
1487
1124
|
const previewingChange = isPreviewingChange(state);
|
|
1488
|
-
const saving =
|
|
1125
|
+
const saving = stagedCapabilities.isApplyingStaged || isRefreshPending;
|
|
1489
1126
|
const currentSiteStyle = getCuratedSiteStyle(state.previewed.siteStyleId);
|
|
1490
1127
|
if (!currentSiteStyle) {
|
|
1491
1128
|
return /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: "This site uses a Site Style that cannot be configured here." });
|
|
1492
1129
|
}
|
|
1493
|
-
const currentPersonality = findButtonPersonality(
|
|
1494
|
-
|
|
1130
|
+
const currentPersonality = findButtonPersonality(
|
|
1131
|
+
state.previewed.buttonPersonalityId
|
|
1132
|
+
);
|
|
1133
|
+
const currentPaletteVariant = findPaletteVariant(
|
|
1134
|
+
state.previewed.paletteVariantId
|
|
1135
|
+
);
|
|
1495
1136
|
const currentTypographyPreset = state.previewed.typographyPresetId ? findTypographyPreset(state.previewed.typographyPresetId) : null;
|
|
1496
1137
|
const chromeLookModels = buildSiteChromeLookModels({
|
|
1497
1138
|
state,
|
|
@@ -1503,8 +1144,20 @@ function StyleConfigurator({
|
|
|
1503
1144
|
const currentHeaderStyle = getHeaderStyle(state.previewed.headerStyleId);
|
|
1504
1145
|
const currentFooterLook = state.previewed.footerLookId ? findFooterLook(state.previewed.footerLookId) : findFooterLook(chromeLookModels.footer.renderedLookId);
|
|
1505
1146
|
return /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
|
|
1506
|
-
state.warnings.length > 0 ? /* @__PURE__ */ jsx(
|
|
1507
|
-
|
|
1147
|
+
state.warnings.length > 0 ? /* @__PURE__ */ jsx(
|
|
1148
|
+
WarningNotice,
|
|
1149
|
+
{
|
|
1150
|
+
warnings: state.warnings,
|
|
1151
|
+
onDismiss: handleDismissWarnings
|
|
1152
|
+
}
|
|
1153
|
+
) : null,
|
|
1154
|
+
state.notices.length > 0 ? /* @__PURE__ */ jsx(
|
|
1155
|
+
NoticeBanner,
|
|
1156
|
+
{
|
|
1157
|
+
notices: state.notices,
|
|
1158
|
+
onDismiss: handleDismissNotices
|
|
1159
|
+
}
|
|
1160
|
+
) : null,
|
|
1508
1161
|
/* @__PURE__ */ jsx(
|
|
1509
1162
|
SiteStyleRow,
|
|
1510
1163
|
{
|
|
@@ -1529,7 +1182,11 @@ function StyleConfigurator({
|
|
|
1529
1182
|
options: chromeLookModels.headerLayout.options,
|
|
1530
1183
|
diagnostics: [],
|
|
1531
1184
|
onCycle: (direction) => {
|
|
1532
|
-
const next = cycleSiteChromeLookId(
|
|
1185
|
+
const next = cycleSiteChromeLookId(
|
|
1186
|
+
chromeLookModels.headerLayout.options,
|
|
1187
|
+
state.previewed.headerLayoutId,
|
|
1188
|
+
direction
|
|
1189
|
+
);
|
|
1533
1190
|
if (next !== void 0) handlePreviewHeaderLayout(next);
|
|
1534
1191
|
},
|
|
1535
1192
|
onPreview: handlePreviewHeaderLayout,
|
|
@@ -1550,7 +1207,11 @@ function StyleConfigurator({
|
|
|
1550
1207
|
options: chromeLookModels.headerStyle.options,
|
|
1551
1208
|
diagnostics: [],
|
|
1552
1209
|
onCycle: (direction) => {
|
|
1553
|
-
const next = cycleSiteChromeLookId(
|
|
1210
|
+
const next = cycleSiteChromeLookId(
|
|
1211
|
+
chromeLookModels.headerStyle.options,
|
|
1212
|
+
state.previewed.headerStyleId,
|
|
1213
|
+
direction
|
|
1214
|
+
);
|
|
1554
1215
|
if (next !== void 0) handlePreviewHeaderStyle(next);
|
|
1555
1216
|
},
|
|
1556
1217
|
onPreview: handlePreviewHeaderStyle,
|
|
@@ -1572,7 +1233,11 @@ function StyleConfigurator({
|
|
|
1572
1233
|
options: chromeLookModels.footer.options,
|
|
1573
1234
|
diagnostics: chromeLookModels.footer.diagnostics,
|
|
1574
1235
|
onCycle: (direction) => {
|
|
1575
|
-
const next = cycleSiteChromeLookId(
|
|
1236
|
+
const next = cycleSiteChromeLookId(
|
|
1237
|
+
chromeLookModels.footer.options,
|
|
1238
|
+
state.previewed.footerLookId,
|
|
1239
|
+
direction
|
|
1240
|
+
);
|
|
1576
1241
|
if (next !== void 0) handlePreviewFooterLook(next);
|
|
1577
1242
|
},
|
|
1578
1243
|
onPreview: handlePreviewFooterLook,
|
|
@@ -1635,14 +1300,40 @@ function StyleConfigurator({
|
|
|
1635
1300
|
}
|
|
1636
1301
|
) : null,
|
|
1637
1302
|
previewingChange ? /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 pt-2", children: [
|
|
1638
|
-
/* @__PURE__ */ jsx(
|
|
1639
|
-
|
|
1303
|
+
/* @__PURE__ */ jsx(
|
|
1304
|
+
Button,
|
|
1305
|
+
{
|
|
1306
|
+
type: "button",
|
|
1307
|
+
size: "sm",
|
|
1308
|
+
variant: "outline",
|
|
1309
|
+
onClick: handleCancel,
|
|
1310
|
+
disabled: !stagedCapabilities.canCancelStaged || saving,
|
|
1311
|
+
children: "Cancel"
|
|
1312
|
+
}
|
|
1313
|
+
),
|
|
1314
|
+
applyAllowed ? /* @__PURE__ */ jsx(
|
|
1315
|
+
Button,
|
|
1316
|
+
{
|
|
1317
|
+
type: "button",
|
|
1318
|
+
size: "sm",
|
|
1319
|
+
onClick: handleApply,
|
|
1320
|
+
disabled: !stagedCapabilities.canApplyStaged || saving,
|
|
1321
|
+
children: saving ? "Applying\u2026" : "Apply"
|
|
1322
|
+
}
|
|
1323
|
+
) : /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: "Preview only \u2014 ask an admin to apply." })
|
|
1640
1324
|
] }) : null,
|
|
1641
1325
|
state.saveStatus.kind === "saved" ? /* @__PURE__ */ jsx("p", { className: "text-xs text-success", children: "Saved." }) : null,
|
|
1642
1326
|
state.saveStatus.kind === "failed" ? /* @__PURE__ */ jsx("p", { className: "text-xs text-destructive", children: state.saveStatus.message }) : null
|
|
1643
1327
|
] });
|
|
1644
1328
|
}
|
|
1645
|
-
function StyleRowFrame({
|
|
1329
|
+
function StyleRowFrame({
|
|
1330
|
+
label,
|
|
1331
|
+
currentLabel,
|
|
1332
|
+
swatch,
|
|
1333
|
+
expanded,
|
|
1334
|
+
onToggle,
|
|
1335
|
+
children
|
|
1336
|
+
}) {
|
|
1646
1337
|
return /* @__PURE__ */ jsx(Collapsible, { open: expanded, onOpenChange: onToggle, children: /* @__PURE__ */ jsxs("div", { className: "rounded-md border bg-background", children: [
|
|
1647
1338
|
/* @__PURE__ */ jsx(CollapsibleTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
1648
1339
|
"button",
|
|
@@ -1651,7 +1342,12 @@ function StyleRowFrame({ label, currentLabel, swatch, expanded, onToggle, childr
|
|
|
1651
1342
|
className: "flex w-full items-center gap-2 px-3 py-2 text-left hover:bg-accent/30",
|
|
1652
1343
|
"aria-expanded": expanded,
|
|
1653
1344
|
children: [
|
|
1654
|
-
/* @__PURE__ */ jsx(
|
|
1345
|
+
/* @__PURE__ */ jsx(
|
|
1346
|
+
ChevronRight,
|
|
1347
|
+
{
|
|
1348
|
+
className: cn("h-4 w-4 transition", expanded && "rotate-90")
|
|
1349
|
+
}
|
|
1350
|
+
),
|
|
1655
1351
|
/* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
1656
1352
|
/* @__PURE__ */ jsx("div", { className: "text-xs uppercase tracking-wide text-muted-foreground", children: label }),
|
|
1657
1353
|
/* @__PURE__ */ jsx("div", { className: "truncate text-sm font-medium", children: currentLabel })
|
|
@@ -1670,35 +1366,86 @@ function StyleRowFrame({ label, currentLabel, swatch, expanded, onToggle, childr
|
|
|
1670
1366
|
/* @__PURE__ */ jsx(CollapsibleContent, { children: /* @__PURE__ */ jsx("div", { className: "border-t px-3 py-3", children }) })
|
|
1671
1367
|
] }) });
|
|
1672
1368
|
}
|
|
1673
|
-
function SiteStyleRow({
|
|
1674
|
-
|
|
1675
|
-
|
|
1369
|
+
function SiteStyleRow({
|
|
1370
|
+
expanded,
|
|
1371
|
+
onToggle,
|
|
1372
|
+
current,
|
|
1373
|
+
onPreview,
|
|
1374
|
+
disabled
|
|
1375
|
+
}) {
|
|
1376
|
+
return /* @__PURE__ */ jsx(
|
|
1377
|
+
StyleRowFrame,
|
|
1676
1378
|
{
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1379
|
+
label: "Site style",
|
|
1380
|
+
currentLabel: current.name,
|
|
1381
|
+
expanded,
|
|
1382
|
+
onToggle,
|
|
1383
|
+
children: /* @__PURE__ */ jsx(
|
|
1384
|
+
"ul",
|
|
1385
|
+
{
|
|
1386
|
+
role: "radiogroup",
|
|
1387
|
+
"aria-label": "Site style",
|
|
1388
|
+
className: "list-none space-y-1 p-0",
|
|
1389
|
+
children: curatedSiteStyles.map((style) => /* @__PURE__ */ jsx(
|
|
1390
|
+
PickerOption,
|
|
1391
|
+
{
|
|
1392
|
+
selected: style.id === current.id,
|
|
1393
|
+
label: style.name,
|
|
1394
|
+
description: style.description,
|
|
1395
|
+
onSelect: () => onPreview(style.id),
|
|
1396
|
+
disabled
|
|
1397
|
+
},
|
|
1398
|
+
style.id
|
|
1399
|
+
))
|
|
1400
|
+
}
|
|
1401
|
+
)
|
|
1402
|
+
}
|
|
1403
|
+
);
|
|
1685
1404
|
}
|
|
1686
|
-
function PersonalityRow({
|
|
1405
|
+
function PersonalityRow({
|
|
1406
|
+
expanded,
|
|
1407
|
+
onToggle,
|
|
1408
|
+
siteStyle,
|
|
1409
|
+
currentId,
|
|
1410
|
+
currentLabel,
|
|
1411
|
+
onPreview,
|
|
1412
|
+
disabled
|
|
1413
|
+
}) {
|
|
1687
1414
|
const options = useMemo(
|
|
1688
|
-
() => requireEntriesForCuratedChoices(
|
|
1415
|
+
() => requireEntriesForCuratedChoices(
|
|
1416
|
+
buttonPersonalities,
|
|
1417
|
+
siteStyle.buttonPersonalityChoices
|
|
1418
|
+
),
|
|
1689
1419
|
[siteStyle.buttonPersonalityChoices]
|
|
1690
1420
|
);
|
|
1691
|
-
return /* @__PURE__ */ jsx(
|
|
1692
|
-
|
|
1421
|
+
return /* @__PURE__ */ jsx(
|
|
1422
|
+
StyleRowFrame,
|
|
1693
1423
|
{
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1424
|
+
label: "Button style",
|
|
1425
|
+
currentLabel,
|
|
1426
|
+
expanded,
|
|
1427
|
+
onToggle,
|
|
1428
|
+
children: /* @__PURE__ */ jsx(
|
|
1429
|
+
"ul",
|
|
1430
|
+
{
|
|
1431
|
+
role: "radiogroup",
|
|
1432
|
+
"aria-label": "Button style",
|
|
1433
|
+
className: "list-none space-y-1 p-0",
|
|
1434
|
+
children: options.map((personality) => /* @__PURE__ */ jsx(
|
|
1435
|
+
PickerOption,
|
|
1436
|
+
{
|
|
1437
|
+
selected: personality.id === currentId,
|
|
1438
|
+
label: personality.name,
|
|
1439
|
+
description: personality.description,
|
|
1440
|
+
onSelect: () => onPreview(personality.id),
|
|
1441
|
+
disabled
|
|
1442
|
+
},
|
|
1443
|
+
personality.id
|
|
1444
|
+
))
|
|
1445
|
+
}
|
|
1446
|
+
)
|
|
1447
|
+
}
|
|
1448
|
+
);
|
|
1702
1449
|
}
|
|
1703
1450
|
function TypographyRow({
|
|
1704
1451
|
expanded,
|
|
@@ -1716,63 +1463,83 @@ function TypographyRow({
|
|
|
1716
1463
|
disabled
|
|
1717
1464
|
}) {
|
|
1718
1465
|
const options = useMemo(
|
|
1719
|
-
() => requireEntriesForCuratedChoices(
|
|
1466
|
+
() => requireEntriesForCuratedChoices(
|
|
1467
|
+
typographyPresets,
|
|
1468
|
+
siteStyle.typographyPresetChoices
|
|
1469
|
+
),
|
|
1720
1470
|
[siteStyle.typographyPresetChoices]
|
|
1721
1471
|
);
|
|
1722
1472
|
const fontCatalog = useFontCatalog(apiClient, expanded);
|
|
1723
1473
|
const selectedPreset = currentPresetId ? findTypographyPreset(currentPresetId) : null;
|
|
1724
|
-
return /* @__PURE__ */ jsxs(
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
},
|
|
1734
|
-
preset.id
|
|
1735
|
-
)) }),
|
|
1736
|
-
/* @__PURE__ */ jsxs("div", { className: "mt-3 space-y-3 border-t pt-3", children: [
|
|
1737
|
-
selectedPreset ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1474
|
+
return /* @__PURE__ */ jsxs(
|
|
1475
|
+
StyleRowFrame,
|
|
1476
|
+
{
|
|
1477
|
+
label: "Typography",
|
|
1478
|
+
currentLabel,
|
|
1479
|
+
expanded,
|
|
1480
|
+
onToggle,
|
|
1481
|
+
children: [
|
|
1482
|
+
currentPresetId === null ? /* @__PURE__ */ jsx("div", { className: "mb-3 rounded-md border border-muted-foreground/20 bg-muted/30 px-3 py-2 text-xs text-muted-foreground", children: "Current custom setup" }) : null,
|
|
1738
1483
|
/* @__PURE__ */ jsx(
|
|
1739
|
-
|
|
1484
|
+
"ul",
|
|
1740
1485
|
{
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1486
|
+
role: "radiogroup",
|
|
1487
|
+
"aria-label": "Typography preset",
|
|
1488
|
+
className: "space-y-1",
|
|
1489
|
+
children: options.map((preset) => /* @__PURE__ */ jsx(
|
|
1490
|
+
TypographyPresetOption,
|
|
1491
|
+
{
|
|
1492
|
+
preset,
|
|
1493
|
+
selected: preset.id === currentPresetId,
|
|
1494
|
+
onSelect: () => onPreviewPreset(preset.id),
|
|
1495
|
+
disabled
|
|
1496
|
+
},
|
|
1497
|
+
preset.id
|
|
1498
|
+
))
|
|
1748
1499
|
}
|
|
1749
1500
|
),
|
|
1750
|
-
/* @__PURE__ */
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1501
|
+
/* @__PURE__ */ jsxs("div", { className: "mt-3 space-y-3 border-t pt-3", children: [
|
|
1502
|
+
selectedPreset ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1503
|
+
/* @__PURE__ */ jsx(
|
|
1504
|
+
TypographyFontSlotPicker,
|
|
1505
|
+
{
|
|
1506
|
+
label: "Body font",
|
|
1507
|
+
slot: "body",
|
|
1508
|
+
preset: selectedPreset,
|
|
1509
|
+
catalog: fontCatalog,
|
|
1510
|
+
value: bodyFontOverride,
|
|
1511
|
+
onChange: onBodyFontOverride,
|
|
1512
|
+
disabled
|
|
1513
|
+
}
|
|
1514
|
+
),
|
|
1515
|
+
/* @__PURE__ */ jsx(
|
|
1516
|
+
TypographyFontSlotPicker,
|
|
1517
|
+
{
|
|
1518
|
+
label: "Heading font",
|
|
1519
|
+
slot: "heading",
|
|
1520
|
+
preset: selectedPreset,
|
|
1521
|
+
catalog: fontCatalog,
|
|
1522
|
+
value: headingFontOverride,
|
|
1523
|
+
onChange: onHeadingFontOverride,
|
|
1524
|
+
disabled
|
|
1525
|
+
}
|
|
1526
|
+
)
|
|
1527
|
+
] }) : /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: "Choose a typography preset to use curated font overrides." }),
|
|
1528
|
+
/* @__PURE__ */ jsx(
|
|
1529
|
+
Button,
|
|
1530
|
+
{
|
|
1531
|
+
type: "button",
|
|
1532
|
+
size: "sm",
|
|
1533
|
+
variant: "outline",
|
|
1534
|
+
onClick: onClearOverrides,
|
|
1535
|
+
disabled: disabled || !bodyFontOverride && !headingFontOverride,
|
|
1536
|
+
children: "Use preset fonts"
|
|
1537
|
+
}
|
|
1538
|
+
)
|
|
1539
|
+
] })
|
|
1540
|
+
]
|
|
1541
|
+
}
|
|
1542
|
+
);
|
|
1776
1543
|
}
|
|
1777
1544
|
function TypographyPresetOption({
|
|
1778
1545
|
preset,
|
|
@@ -1817,7 +1584,10 @@ function TypographyFontSlotPicker({
|
|
|
1817
1584
|
const [query, setQuery] = useState("");
|
|
1818
1585
|
const defaultFont = primaryFontFamily(preset.defaultFonts[slot]);
|
|
1819
1586
|
const selectedFamily = value ?? defaultFont;
|
|
1820
|
-
const recordsByFamily = useMemo(
|
|
1587
|
+
const recordsByFamily = useMemo(
|
|
1588
|
+
() => indexFontsByFamily(catalog.fonts),
|
|
1589
|
+
[catalog.fonts]
|
|
1590
|
+
);
|
|
1821
1591
|
const selectedFit = evaluateTypographyFontSlot({
|
|
1822
1592
|
slot,
|
|
1823
1593
|
policy: preset.slotPolicies[slot],
|
|
@@ -1830,8 +1600,15 @@ function TypographyFontSlotPicker({
|
|
|
1830
1600
|
);
|
|
1831
1601
|
const browseOptions = useMemo(() => {
|
|
1832
1602
|
const normalizedQuery = query.trim().toLowerCase();
|
|
1833
|
-
const source = normalizedQuery.length > 0 ? catalog.fonts.filter(
|
|
1834
|
-
|
|
1603
|
+
const source = normalizedQuery.length > 0 ? catalog.fonts.filter(
|
|
1604
|
+
(font) => font.family.toLowerCase().includes(normalizedQuery)
|
|
1605
|
+
) : catalog.fonts;
|
|
1606
|
+
return [...source].sort(
|
|
1607
|
+
(a, b) => sortFontForPresetSlot(a, b, slot, preset, recordsByFamily)
|
|
1608
|
+
).slice(
|
|
1609
|
+
0,
|
|
1610
|
+
normalizedQuery.length > 0 ? MAX_FONT_RESULTS_WHEN_SEARCHING : MAX_FONT_RESULTS_WHEN_BROWSING
|
|
1611
|
+
);
|
|
1835
1612
|
}, [catalog.fonts, preset, query, recordsByFamily, slot]);
|
|
1836
1613
|
return /* @__PURE__ */ jsxs("section", { className: "space-y-2", "aria-label": label, children: [
|
|
1837
1614
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-3", children: [
|
|
@@ -1943,7 +1720,9 @@ function FontFamilyOption({
|
|
|
1943
1720
|
}
|
|
1944
1721
|
);
|
|
1945
1722
|
}
|
|
1946
|
-
function TypographyFontFitBadge({
|
|
1723
|
+
function TypographyFontFitBadge({
|
|
1724
|
+
fit
|
|
1725
|
+
}) {
|
|
1947
1726
|
return /* @__PURE__ */ jsx(
|
|
1948
1727
|
"span",
|
|
1949
1728
|
{
|
|
@@ -1961,7 +1740,10 @@ function TypographyFontFitBadge({ fit }) {
|
|
|
1961
1740
|
);
|
|
1962
1741
|
}
|
|
1963
1742
|
function useFontCatalog(apiClient, enabled) {
|
|
1964
|
-
const [catalog, setCatalog] = useState({
|
|
1743
|
+
const [catalog, setCatalog] = useState({
|
|
1744
|
+
kind: "idle",
|
|
1745
|
+
fonts: []
|
|
1746
|
+
});
|
|
1965
1747
|
const requestedClientRef = useRef(null);
|
|
1966
1748
|
useEffect(() => {
|
|
1967
1749
|
if (!enabled) return;
|
|
@@ -2125,60 +1907,86 @@ function SiteChromeLookRow({
|
|
|
2125
1907
|
onPreview,
|
|
2126
1908
|
disabled
|
|
2127
1909
|
}) {
|
|
2128
|
-
return /* @__PURE__ */ jsxs(
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
1910
|
+
return /* @__PURE__ */ jsxs(
|
|
1911
|
+
StyleRowFrame,
|
|
1912
|
+
{
|
|
1913
|
+
label,
|
|
1914
|
+
currentLabel,
|
|
1915
|
+
expanded,
|
|
1916
|
+
onToggle,
|
|
1917
|
+
children: [
|
|
1918
|
+
/* @__PURE__ */ jsxs("div", { className: "mb-3 flex items-start justify-between gap-3", children: [
|
|
1919
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: scopeDescription }),
|
|
1920
|
+
/* @__PURE__ */ jsxs("div", { className: "flex shrink-0 items-center overflow-hidden rounded-full border bg-background", children: [
|
|
1921
|
+
/* @__PURE__ */ jsx(
|
|
1922
|
+
"button",
|
|
1923
|
+
{
|
|
1924
|
+
type: "button",
|
|
1925
|
+
onClick: () => onCycle("prev"),
|
|
1926
|
+
className: "grid h-8 w-8 place-items-center hover:bg-muted disabled:cursor-not-allowed disabled:opacity-50",
|
|
1927
|
+
"aria-label": `Previous ${label.toLowerCase()}`,
|
|
1928
|
+
disabled: disabled || cycleableSiteChromeOptions(options).length <= 1,
|
|
1929
|
+
children: /* @__PURE__ */ jsx(ChevronLeft, { size: 14 })
|
|
1930
|
+
}
|
|
1931
|
+
),
|
|
1932
|
+
/* @__PURE__ */ jsx(
|
|
1933
|
+
"button",
|
|
1934
|
+
{
|
|
1935
|
+
type: "button",
|
|
1936
|
+
onClick: () => onCycle("next"),
|
|
1937
|
+
className: "grid h-8 w-8 place-items-center border-l hover:bg-muted disabled:cursor-not-allowed disabled:opacity-50",
|
|
1938
|
+
"aria-label": `Next ${label.toLowerCase()}`,
|
|
1939
|
+
disabled: disabled || cycleableSiteChromeOptions(options).length <= 1,
|
|
1940
|
+
children: /* @__PURE__ */ jsx(ChevronRight, { size: 14 })
|
|
1941
|
+
}
|
|
1942
|
+
)
|
|
1943
|
+
] })
|
|
1944
|
+
] }),
|
|
1945
|
+
diagnostics.length > 0 ? /* @__PURE__ */ jsx("ul", { className: "mb-3 list-none space-y-1 p-0 text-xs text-amber-700", children: diagnostics.map((diagnostic) => /* @__PURE__ */ jsx("li", { children: diagnostic }, diagnostic)) }) : null,
|
|
2143
1946
|
/* @__PURE__ */ jsx(
|
|
2144
|
-
"
|
|
1947
|
+
"ul",
|
|
2145
1948
|
{
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
className: "
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
1949
|
+
role: "radiogroup",
|
|
1950
|
+
"aria-label": ariaLabel,
|
|
1951
|
+
className: "list-none space-y-1 p-0",
|
|
1952
|
+
children: options.map((look) => /* @__PURE__ */ jsx(
|
|
1953
|
+
PickerOption,
|
|
1954
|
+
{
|
|
1955
|
+
selected: look.id === currentId,
|
|
1956
|
+
label: look.label,
|
|
1957
|
+
description: look.description,
|
|
1958
|
+
onSelect: () => onPreview(look.id),
|
|
1959
|
+
disabled: disabled || !look.available
|
|
1960
|
+
},
|
|
1961
|
+
look.id ?? "site-style-default"
|
|
1962
|
+
))
|
|
2152
1963
|
}
|
|
2153
1964
|
)
|
|
2154
|
-
]
|
|
2155
|
-
|
|
2156
|
-
diagnostics.length > 0 ? /* @__PURE__ */ jsx("ul", { className: "mb-3 list-none space-y-1 p-0 text-xs text-amber-700", children: diagnostics.map((diagnostic) => /* @__PURE__ */ jsx("li", { children: diagnostic }, diagnostic)) }) : null,
|
|
2157
|
-
/* @__PURE__ */ jsx("ul", { role: "radiogroup", "aria-label": ariaLabel, className: "list-none space-y-1 p-0", children: options.map((look) => /* @__PURE__ */ jsx(
|
|
2158
|
-
PickerOption,
|
|
2159
|
-
{
|
|
2160
|
-
selected: look.id === currentId,
|
|
2161
|
-
label: look.label,
|
|
2162
|
-
description: look.description,
|
|
2163
|
-
onSelect: () => onPreview(look.id),
|
|
2164
|
-
disabled: disabled || !look.available
|
|
2165
|
-
},
|
|
2166
|
-
look.id ?? "site-style-default"
|
|
2167
|
-
)) })
|
|
2168
|
-
] });
|
|
2169
|
-
}
|
|
2170
|
-
function PaletteRow({ expanded, onToggle, siteStyle, currentId, currentLabel, currentSwatch, onPreview, disabled }) {
|
|
2171
|
-
const options = useMemo(
|
|
2172
|
-
() => {
|
|
2173
|
-
const recommended = requireEntriesForCuratedChoices(paletteVariants, siteStyle.paletteVariantChoices);
|
|
2174
|
-
if (recommended.some((variant) => variant.id === currentId)) {
|
|
2175
|
-
return recommended;
|
|
2176
|
-
}
|
|
2177
|
-
const current = findPaletteVariant(currentId);
|
|
2178
|
-
return current ? [current, ...recommended] : recommended;
|
|
2179
|
-
},
|
|
2180
|
-
[currentId, siteStyle.paletteVariantChoices]
|
|
1965
|
+
]
|
|
1966
|
+
}
|
|
2181
1967
|
);
|
|
1968
|
+
}
|
|
1969
|
+
function PaletteRow({
|
|
1970
|
+
expanded,
|
|
1971
|
+
onToggle,
|
|
1972
|
+
siteStyle,
|
|
1973
|
+
currentId,
|
|
1974
|
+
currentLabel,
|
|
1975
|
+
currentSwatch,
|
|
1976
|
+
onPreview,
|
|
1977
|
+
disabled
|
|
1978
|
+
}) {
|
|
1979
|
+
const options = useMemo(() => {
|
|
1980
|
+
const recommended = requireEntriesForCuratedChoices(
|
|
1981
|
+
paletteVariants,
|
|
1982
|
+
siteStyle.paletteVariantChoices
|
|
1983
|
+
);
|
|
1984
|
+
if (recommended.some((variant) => variant.id === currentId)) {
|
|
1985
|
+
return recommended;
|
|
1986
|
+
}
|
|
1987
|
+
const current = findPaletteVariant(currentId);
|
|
1988
|
+
return current ? [current, ...recommended] : recommended;
|
|
1989
|
+
}, [currentId, siteStyle.paletteVariantChoices]);
|
|
2182
1990
|
return /* @__PURE__ */ jsxs(
|
|
2183
1991
|
StyleRowFrame,
|
|
2184
1992
|
{
|
|
@@ -2189,26 +1997,44 @@ function PaletteRow({ expanded, onToggle, siteStyle, currentId, currentLabel, cu
|
|
|
2189
1997
|
onToggle,
|
|
2190
1998
|
children: [
|
|
2191
1999
|
/* @__PURE__ */ jsx("p", { className: "mb-3 text-xs text-muted-foreground", children: "These palette bases are recommended for the current Site Style. Choose a base here, then edit exact colours in Palette colours." }),
|
|
2192
|
-
/* @__PURE__ */ jsx(
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2000
|
+
/* @__PURE__ */ jsx(
|
|
2001
|
+
"ul",
|
|
2002
|
+
{
|
|
2003
|
+
role: "radiogroup",
|
|
2004
|
+
"aria-label": "Palette",
|
|
2005
|
+
className: "list-none space-y-1 p-0",
|
|
2006
|
+
children: options.map((variant) => {
|
|
2007
|
+
const primaryHex = variant.colors.find(
|
|
2008
|
+
(c) => c.name === "primary"
|
|
2009
|
+
)?.hex;
|
|
2010
|
+
return /* @__PURE__ */ jsx(
|
|
2011
|
+
PickerOption,
|
|
2012
|
+
{
|
|
2013
|
+
selected: variant.id === currentId,
|
|
2014
|
+
label: variant.name,
|
|
2015
|
+
description: variant.description,
|
|
2016
|
+
swatch: primaryHex,
|
|
2017
|
+
onSelect: () => onPreview(variant.id),
|
|
2018
|
+
disabled
|
|
2019
|
+
},
|
|
2020
|
+
variant.id
|
|
2021
|
+
);
|
|
2022
|
+
})
|
|
2023
|
+
}
|
|
2024
|
+
)
|
|
2207
2025
|
]
|
|
2208
2026
|
}
|
|
2209
2027
|
);
|
|
2210
2028
|
}
|
|
2211
|
-
function ColoursRow({
|
|
2029
|
+
function ColoursRow({
|
|
2030
|
+
expanded,
|
|
2031
|
+
onToggle,
|
|
2032
|
+
variant,
|
|
2033
|
+
overrides,
|
|
2034
|
+
onTokenChange,
|
|
2035
|
+
onReset,
|
|
2036
|
+
disabled
|
|
2037
|
+
}) {
|
|
2212
2038
|
const mergedPalette = useMemo(() => {
|
|
2213
2039
|
return variant.colors.map((color) => ({
|
|
2214
2040
|
name: color.name,
|
|
@@ -2252,7 +2078,14 @@ function ColoursRow({ expanded, onToggle, variant, overrides, onTokenChange, onR
|
|
|
2252
2078
|
}
|
|
2253
2079
|
);
|
|
2254
2080
|
}
|
|
2255
|
-
function PickerOption({
|
|
2081
|
+
function PickerOption({
|
|
2082
|
+
selected,
|
|
2083
|
+
label,
|
|
2084
|
+
description,
|
|
2085
|
+
swatch,
|
|
2086
|
+
onSelect,
|
|
2087
|
+
disabled
|
|
2088
|
+
}) {
|
|
2256
2089
|
return /* @__PURE__ */ jsx("li", { className: "list-none", children: /* @__PURE__ */ jsxs(
|
|
2257
2090
|
"button",
|
|
2258
2091
|
{
|
|
@@ -2303,16 +2136,30 @@ function isRecord(value) {
|
|
|
2303
2136
|
return typeof value === "object" && value !== null;
|
|
2304
2137
|
}
|
|
2305
2138
|
function WarningNotice({ warnings, onDismiss }) {
|
|
2306
|
-
return /* @__PURE__ */ jsxs(
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2139
|
+
return /* @__PURE__ */ jsxs(
|
|
2140
|
+
"div",
|
|
2141
|
+
{
|
|
2142
|
+
role: "status",
|
|
2143
|
+
className: "rounded-md border border-warning/40 bg-warning/10 px-3 py-2 text-xs text-warning-foreground",
|
|
2144
|
+
children: [
|
|
2145
|
+
/* @__PURE__ */ jsx("ul", { className: "space-y-1", children: warnings.map((warning, index) => /* @__PURE__ */ jsx("li", { children: describeWarning(warning) }, `${warning.kind}-${index}`)) }),
|
|
2146
|
+
/* @__PURE__ */ jsx("button", { type: "button", onClick: onDismiss, className: "mt-2 underline", children: "Dismiss" })
|
|
2147
|
+
]
|
|
2148
|
+
}
|
|
2149
|
+
);
|
|
2310
2150
|
}
|
|
2311
2151
|
function NoticeBanner({ notices, onDismiss }) {
|
|
2312
|
-
return /* @__PURE__ */ jsxs(
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2152
|
+
return /* @__PURE__ */ jsxs(
|
|
2153
|
+
"div",
|
|
2154
|
+
{
|
|
2155
|
+
role: "status",
|
|
2156
|
+
className: "rounded-md border border-muted-foreground/20 bg-muted/40 px-3 py-2 text-xs",
|
|
2157
|
+
children: [
|
|
2158
|
+
/* @__PURE__ */ jsx("ul", { className: "space-y-1", children: notices.map((notice, index) => /* @__PURE__ */ jsx("li", { children: describeNotice(notice) }, `${notice.kind}-${index}`)) }),
|
|
2159
|
+
/* @__PURE__ */ jsx("button", { type: "button", onClick: onDismiss, className: "mt-2 underline", children: "Dismiss" })
|
|
2160
|
+
]
|
|
2161
|
+
}
|
|
2162
|
+
);
|
|
2316
2163
|
}
|
|
2317
2164
|
function describeNotice(notice) {
|
|
2318
2165
|
switch (notice.kind) {
|
|
@@ -2371,6 +2218,7 @@ function PreviewEditorSidebar({
|
|
|
2371
2218
|
assistantPanel,
|
|
2372
2219
|
sdkConfig,
|
|
2373
2220
|
mediaAssets,
|
|
2221
|
+
bookingOfferingPresets,
|
|
2374
2222
|
siteStyleAccess = { kind: "hidden" },
|
|
2375
2223
|
activeTab,
|
|
2376
2224
|
onTabChange,
|
|
@@ -2393,6 +2241,11 @@ function PreviewEditorSidebar({
|
|
|
2393
2241
|
[uiStore]
|
|
2394
2242
|
);
|
|
2395
2243
|
const focusRequest = useUISelector(uiStore, (s) => s.focusRequest);
|
|
2244
|
+
const activeLinkedEntrySnapshot = useUISelector(
|
|
2245
|
+
uiStore,
|
|
2246
|
+
(s) => s.linkedEntries.getSelectedSnapshot()
|
|
2247
|
+
);
|
|
2248
|
+
const previewInspection = useUISelector(uiStore, (s) => s.previewInspection);
|
|
2396
2249
|
const { canEdit } = usePreviewAuth();
|
|
2397
2250
|
const dashboardSetupHandoff = useMemo(
|
|
2398
2251
|
() => resolvePreviewDashboardSetupHandoff(),
|
|
@@ -2462,8 +2315,33 @@ function PreviewEditorSidebar({
|
|
|
2462
2315
|
}, [focusRequest, uiStore]);
|
|
2463
2316
|
const metadataSectionContent = useMemo(() => {
|
|
2464
2317
|
if (!pageId && !entryData) return null;
|
|
2465
|
-
return /* @__PURE__ */ jsx(
|
|
2466
|
-
|
|
2318
|
+
return /* @__PURE__ */ jsx(
|
|
2319
|
+
PreviewMetadataPanel,
|
|
2320
|
+
{
|
|
2321
|
+
ownerKind: entryData ? "content" : "page",
|
|
2322
|
+
contentTypeKey: entryData?.type ?? null,
|
|
2323
|
+
entry: controller.entry
|
|
2324
|
+
}
|
|
2325
|
+
);
|
|
2326
|
+
}, [controller.entry, entryData, pageId]);
|
|
2327
|
+
const linkedEntrySection = buildLinkedEntrySidebarSection({
|
|
2328
|
+
snapshot: activeLinkedEntrySnapshot,
|
|
2329
|
+
inspection: previewInspection,
|
|
2330
|
+
renderContent: (snapshot) => /* @__PURE__ */ jsx(
|
|
2331
|
+
LinkedEntryEditorPanel,
|
|
2332
|
+
{
|
|
2333
|
+
siteId,
|
|
2334
|
+
apiClient,
|
|
2335
|
+
bearerToken,
|
|
2336
|
+
supabaseUrl,
|
|
2337
|
+
theme,
|
|
2338
|
+
mediaAssets,
|
|
2339
|
+
widgets: contentFormWidgets,
|
|
2340
|
+
entry: snapshot,
|
|
2341
|
+
fields: findLinkedEntryManifestFieldsFromSnapshot(snapshot)
|
|
2342
|
+
}
|
|
2343
|
+
)
|
|
2344
|
+
});
|
|
2467
2345
|
const editorPanel = entryData ? /* @__PURE__ */ jsx(
|
|
2468
2346
|
EntryEditorPanel,
|
|
2469
2347
|
{
|
|
@@ -2479,6 +2357,7 @@ function PreviewEditorSidebar({
|
|
|
2479
2357
|
supabaseUrl,
|
|
2480
2358
|
entrySubrouteContext,
|
|
2481
2359
|
metadataPanel: metadataSectionContent,
|
|
2360
|
+
linkedEntrySection,
|
|
2482
2361
|
mediaAssets,
|
|
2483
2362
|
widgets: contentFormWidgets,
|
|
2484
2363
|
viewportMode,
|
|
@@ -2534,6 +2413,8 @@ function PreviewEditorSidebar({
|
|
|
2534
2413
|
) : null,
|
|
2535
2414
|
sdkConfig: sdkConfig ?? null,
|
|
2536
2415
|
mediaAssets,
|
|
2416
|
+
bookingOfferingPresets,
|
|
2417
|
+
linkedEntrySection,
|
|
2537
2418
|
viewportMode,
|
|
2538
2419
|
viewportWidth,
|
|
2539
2420
|
zoom,
|
|
@@ -2616,14 +2497,32 @@ function PreviewEditorSidebar({
|
|
|
2616
2497
|
);
|
|
2617
2498
|
}
|
|
2618
2499
|
function PreviewMetadataPanel({
|
|
2619
|
-
|
|
2500
|
+
ownerKind,
|
|
2501
|
+
contentTypeKey,
|
|
2502
|
+
entry
|
|
2620
2503
|
}) {
|
|
2621
2504
|
const uiStore = useEditorUiStoreInstance();
|
|
2622
|
-
const
|
|
2623
|
-
|
|
2624
|
-
|
|
2505
|
+
const currentSlug = useEditorUiStore(
|
|
2506
|
+
(state) => state.metadata.getAtPath("draftSlug")
|
|
2507
|
+
) ?? void 0;
|
|
2508
|
+
const metadataPresentation = useMemo(() => {
|
|
2509
|
+
if (ownerKind === "content") {
|
|
2510
|
+
return deriveRouteMetadataPresentation(
|
|
2511
|
+
{ kind: "content", typeKey: contentTypeKey },
|
|
2512
|
+
{ omitTitle: true }
|
|
2513
|
+
);
|
|
2514
|
+
}
|
|
2515
|
+
const routeSlug = resolvePageRouteSlug(entry, currentSlug);
|
|
2516
|
+
if (!routeSlug) {
|
|
2517
|
+
throw new Error("Expected routable page entry for preview metadata");
|
|
2518
|
+
}
|
|
2519
|
+
return deriveRouteMetadataPresentation(
|
|
2520
|
+
{ kind: "page", routeSlug },
|
|
2521
|
+
{ omitTitle: true }
|
|
2625
2522
|
);
|
|
2626
|
-
}, [contentTypeKey]);
|
|
2523
|
+
}, [contentTypeKey, currentSlug, entry, ownerKind]);
|
|
2524
|
+
const manifest = metadataPresentation.manifest;
|
|
2525
|
+
const isHomepage = metadataPresentation.kind === "page-homepage";
|
|
2627
2526
|
const validation = useMemo(
|
|
2628
2527
|
() => createManifestValidation(manifest),
|
|
2629
2528
|
[manifest]
|
|
@@ -2642,14 +2541,164 @@ function PreviewMetadataPanel({
|
|
|
2642
2541
|
}),
|
|
2643
2542
|
[uiStore, validation]
|
|
2644
2543
|
);
|
|
2645
|
-
return /* @__PURE__ */
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2544
|
+
return /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
2545
|
+
isHomepage ? /* @__PURE__ */ jsx("div", { className: "inline-flex rounded-md bg-muted px-2 py-1 text-xs font-medium text-muted-foreground", children: "Homepage" }) : null,
|
|
2546
|
+
/* @__PURE__ */ jsx(
|
|
2547
|
+
ManifestForm,
|
|
2548
|
+
{
|
|
2549
|
+
manifest,
|
|
2550
|
+
backend,
|
|
2551
|
+
className: "space-y-4"
|
|
2552
|
+
}
|
|
2553
|
+
)
|
|
2554
|
+
] });
|
|
2555
|
+
}
|
|
2556
|
+
function LinkedEntryEditorPanel({
|
|
2557
|
+
siteId,
|
|
2558
|
+
apiClient,
|
|
2559
|
+
bearerToken,
|
|
2560
|
+
supabaseUrl,
|
|
2561
|
+
theme,
|
|
2562
|
+
mediaAssets,
|
|
2563
|
+
widgets,
|
|
2564
|
+
entry,
|
|
2565
|
+
fields
|
|
2566
|
+
}) {
|
|
2567
|
+
const uiStore = useEditorUiStoreInstance();
|
|
2568
|
+
const linkedEntriesAutosave = useUISelector(
|
|
2569
|
+
uiStore,
|
|
2570
|
+
(state) => state.autosave.linkedEntries
|
|
2571
|
+
);
|
|
2572
|
+
const manifest = useMemo(
|
|
2573
|
+
() => ({
|
|
2574
|
+
name: `linked-content-${entry.meta.contentTypeKey}`,
|
|
2575
|
+
version: "1.0",
|
|
2576
|
+
title: entry.meta.contentTypeLabel,
|
|
2577
|
+
component: "content-form",
|
|
2578
|
+
description: "",
|
|
2579
|
+
fields,
|
|
2580
|
+
slots: []
|
|
2581
|
+
}),
|
|
2582
|
+
[entry.meta.contentTypeKey, entry.meta.contentTypeLabel, fields]
|
|
2583
|
+
);
|
|
2584
|
+
const validation = useMemo(
|
|
2585
|
+
() => createManifestValidation(manifest, { widgets }),
|
|
2586
|
+
[manifest, widgets]
|
|
2587
|
+
);
|
|
2588
|
+
const backend = useMemo(
|
|
2589
|
+
() => createStoreBackend({
|
|
2590
|
+
scope: "linkedContent",
|
|
2591
|
+
store: uiStore,
|
|
2592
|
+
validateFn: (values) => {
|
|
2593
|
+
const result = validation.schema.safeParse(values);
|
|
2594
|
+
return result.success ? [] : result.error.issues;
|
|
2595
|
+
}
|
|
2596
|
+
}),
|
|
2597
|
+
[uiStore, validation]
|
|
2598
|
+
);
|
|
2599
|
+
const syncState = entry.syncState;
|
|
2600
|
+
const errorMessage = syncState.kind === "failed" ? syncState.error : null;
|
|
2601
|
+
const dirty = syncState.kind === "pending" || syncState.kind === "failed";
|
|
2602
|
+
const isSaving = linkedEntriesAutosave.status === "saving" && dirty;
|
|
2603
|
+
const displayTitle = resolveContentTitle(
|
|
2604
|
+
entry.current ?? entry.baseline ?? null,
|
|
2605
|
+
entry.meta.titleField,
|
|
2606
|
+
entry.meta.title
|
|
2607
|
+
);
|
|
2608
|
+
return /* @__PURE__ */ jsxs("div", { className: "bg-muted/20", children: [
|
|
2609
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-3 px-4 py-3", children: [
|
|
2610
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
|
|
2611
|
+
/* @__PURE__ */ jsx("div", { className: "truncate text-sm font-medium", children: displayTitle }),
|
|
2612
|
+
/* @__PURE__ */ jsx("p", { className: "mt-1 text-xs leading-5 text-muted-foreground", children: "Changes update this linked entry wherever it appears." })
|
|
2613
|
+
] }),
|
|
2614
|
+
/* @__PURE__ */ jsx("div", { className: "flex shrink-0 items-center gap-2", children: /* @__PURE__ */ jsx(
|
|
2615
|
+
Button,
|
|
2616
|
+
{
|
|
2617
|
+
type: "button",
|
|
2618
|
+
variant: "outline",
|
|
2619
|
+
size: "sm",
|
|
2620
|
+
onClick: () => {
|
|
2621
|
+
if (dirty) {
|
|
2622
|
+
uiStore.getState().linkedEntries.discard(entry.meta.entryId);
|
|
2623
|
+
} else {
|
|
2624
|
+
uiStore.getState().linkedEntries.close();
|
|
2625
|
+
}
|
|
2626
|
+
},
|
|
2627
|
+
children: dirty ? "Discard" : "Close"
|
|
2628
|
+
}
|
|
2629
|
+
) })
|
|
2630
|
+
] }),
|
|
2631
|
+
/* @__PURE__ */ jsxs("div", { className: "px-4 pb-4", children: [
|
|
2632
|
+
errorMessage ? /* @__PURE__ */ jsx("div", { className: "mb-3 rounded-md border border-red-500 bg-red-50 px-3 py-2 text-sm text-red-700", children: errorMessage }) : isSaving ? /* @__PURE__ */ jsx("div", { className: "mb-3 rounded-md border border-sky-500 bg-sky-50 px-3 py-2 text-sm text-sky-700", children: "Saving changes" }) : null,
|
|
2633
|
+
/* @__PURE__ */ jsx(
|
|
2634
|
+
PreviewFormProvider,
|
|
2635
|
+
{
|
|
2636
|
+
siteId,
|
|
2637
|
+
theme: theme ?? null,
|
|
2638
|
+
previewClient: apiClient,
|
|
2639
|
+
bearerToken,
|
|
2640
|
+
supabaseUrl,
|
|
2641
|
+
mediaAssets,
|
|
2642
|
+
children: /* @__PURE__ */ jsx(
|
|
2643
|
+
ManifestForm,
|
|
2644
|
+
{
|
|
2645
|
+
manifest,
|
|
2646
|
+
backend,
|
|
2647
|
+
widgetOverrides: widgets,
|
|
2648
|
+
className: "space-y-4"
|
|
2649
|
+
}
|
|
2650
|
+
)
|
|
2651
|
+
}
|
|
2652
|
+
)
|
|
2653
|
+
] })
|
|
2654
|
+
] });
|
|
2655
|
+
}
|
|
2656
|
+
function buildLinkedEntrySidebarSection(input) {
|
|
2657
|
+
const { snapshot, inspection, renderContent } = input;
|
|
2658
|
+
if (!snapshot || inspection.kind !== "linked-entry") return null;
|
|
2659
|
+
if (snapshot.meta.entryId !== inspection.entryId) return null;
|
|
2660
|
+
return {
|
|
2661
|
+
label: snapshot.meta.contentTypeLabel,
|
|
2662
|
+
openRequestId: inspection.requestId,
|
|
2663
|
+
content: renderContent(snapshot)
|
|
2664
|
+
};
|
|
2665
|
+
}
|
|
2666
|
+
function findLinkedEntryManifestFieldsFromSnapshot(snapshot) {
|
|
2667
|
+
return snapshot.meta.fields.flatMap((field) => {
|
|
2668
|
+
if (typeof field.id !== "string" || typeof field.type !== "string") {
|
|
2669
|
+
return [];
|
|
2651
2670
|
}
|
|
2652
|
-
|
|
2671
|
+
const base = {
|
|
2672
|
+
id: field.id,
|
|
2673
|
+
label: fieldIdToLabel(field.id),
|
|
2674
|
+
required: false
|
|
2675
|
+
};
|
|
2676
|
+
switch (field.type) {
|
|
2677
|
+
case "text":
|
|
2678
|
+
return [{ ...base, type: "text", multiline: false }];
|
|
2679
|
+
case "textarea":
|
|
2680
|
+
return [{ ...base, type: "text", multiline: true }];
|
|
2681
|
+
case "richText":
|
|
2682
|
+
return [{ ...base, type: "richText" }];
|
|
2683
|
+
case "number":
|
|
2684
|
+
return [{ ...base, type: "number" }];
|
|
2685
|
+
case "boolean":
|
|
2686
|
+
return [{ ...base, type: "boolean" }];
|
|
2687
|
+
case "date":
|
|
2688
|
+
return [{ ...base, type: "date" }];
|
|
2689
|
+
case "datetime":
|
|
2690
|
+
return [{ ...base, type: "datetime" }];
|
|
2691
|
+
case "url":
|
|
2692
|
+
return [{ ...base, type: "url", allowRelative: false }];
|
|
2693
|
+
case "link":
|
|
2694
|
+
return [{ ...base, type: "link" }];
|
|
2695
|
+
default:
|
|
2696
|
+
return [];
|
|
2697
|
+
}
|
|
2698
|
+
});
|
|
2699
|
+
}
|
|
2700
|
+
function fieldIdToLabel(fieldId) {
|
|
2701
|
+
return fieldId.replace(/([a-z0-9])([A-Z])/g, "$1 $2").split(/[-_\s]+/).filter((part) => part.length > 0).map((part) => part.charAt(0).toUpperCase() + part.slice(1).toLowerCase()).join(" ");
|
|
2653
2702
|
}
|
|
2654
2703
|
|
|
2655
2704
|
export { PreviewEditorSidebar };
|