@riverbankcms/sdk 0.129.1 → 0.130.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +85 -0
- package/README.md +33 -11
- package/dist/{PreviewEditorSidebar-DceRseRV.mjs → PreviewEditorSidebar-BY-1QdE2.mjs} +327 -250
- package/dist/{PreviewEditorUI-BNunq3kk.mjs → PreviewEditorUI-BS34jI9_.mjs} +3 -3
- package/dist/{PreviewQueryProvider-B1kbhaJD.mjs → PreviewQueryProvider-BD0kOjtI.mjs} +1 -1
- package/dist/{SdkPreviewModeRuntime-Bt87-62u.mjs → SdkPreviewModeRuntime-B1pWnhu-.mjs} +235 -211
- package/dist/{SiteChromeCustomizeContext-BLl-OlL4.mjs → SiteChromeCustomizeContext-BhUG_72i.mjs} +12981 -11912
- package/dist/_dts/ai/src/contracts/proposalPrimitives.d.ts +52 -0
- package/dist/_dts/ai/src/contracts/proposals.d.ts +5256 -29129
- package/dist/_dts/ai/src/contracts/siteStyleProposalSchemas.d.ts +33429 -0
- package/dist/_dts/api/src/accountApi.d.ts +213 -0
- package/dist/_dts/api/src/accountEndpointDefinitions.d.ts +30 -0
- package/dist/_dts/api/src/accountEndpoints.d.ts +254 -0
- package/dist/_dts/api/src/apiCallParams.d.ts +60 -0
- package/dist/_dts/api/src/appointmentSetup.d.ts +21 -9
- package/dist/_dts/api/src/bookingConfig.d.ts +12 -64
- package/dist/_dts/api/src/bookingManagementEndpoints.d.ts +17 -16
- package/dist/_dts/api/src/bookingManagementEventEndpointTypes.d.ts +15 -0
- package/dist/_dts/api/src/bookingRecords.d.ts +1 -0
- package/dist/_dts/api/src/bookingSettingsSections.d.ts +9 -0
- package/dist/_dts/api/src/bookingVerticals.d.ts +2 -2
- package/dist/_dts/api/src/commercePortalEndpoints.d.ts +2 -0
- package/dist/_dts/api/src/contentRuntime.d.ts +3 -5
- package/dist/_dts/api/src/endpoints.d.ts +1355 -1318
- package/dist/_dts/api/src/event-destination-policy.d.ts +1 -1
- package/dist/_dts/api/src/eventManagementContracts.d.ts +152 -0
- package/dist/_dts/api/src/eventManagementEndpointDefinitions.d.ts +26 -0
- package/dist/_dts/api/src/eventSeriesPresentationPreset.d.ts +12 -0
- package/dist/_dts/api/src/index.d.ts +12 -3
- package/dist/_dts/api/src/indexCoreTypes.d.ts +1 -0
- package/dist/_dts/api/src/indexExtendedTypes.d.ts +1 -0
- package/dist/_dts/api/src/oauth.d.ts +8 -0
- package/dist/_dts/api/src/preview-auth.d.ts +26 -0
- package/dist/_dts/api/src/publicExperience/commerceEndpoints.d.ts +22 -47
- package/dist/_dts/api/src/publicExperience/eventEndpoints.d.ts +5 -5
- package/dist/_dts/api/src/publicExperience/wholeSeriesEndpoints.d.ts +0 -1
- package/dist/_dts/api/src/sdk-event-schedule.d.ts +5 -0
- package/dist/_dts/api/src/sdk-event-upsert.d.ts +114 -20
- package/dist/_dts/api/src/sdkBlockUpsertContracts.d.ts +48 -0
- package/dist/_dts/api/src/sdkContracts.d.ts +43 -79
- package/dist/_dts/api/src/sdkEventCategoryContracts.d.ts +9 -0
- package/dist/_dts/api/src/sdkManagedEventContracts.d.ts +35 -0
- package/dist/_dts/api/src/sdkThemeWire.d.ts +2256 -302
- package/dist/_dts/api/src/settings/permissions.d.ts +2 -2
- package/dist/_dts/api/src/siteApiKeyEndpointDefinitions.d.ts +66 -0
- package/dist/_dts/api/src/siteInfrastructure.d.ts +3 -3
- package/dist/_dts/api/src/siteOperations.d.ts +1 -1
- package/dist/_dts/api/src/sitePlatformEndpoints.d.ts +17 -4
- package/dist/_dts/api/src/siteRuntimeEndpoints.d.ts +23 -37
- package/dist/_dts/api/src/types.d.ts +7 -59
- package/dist/_dts/block-form/src/client/index.d.ts +15 -23
- package/dist/_dts/block-form/src/index.d.ts +23 -22
- package/dist/_dts/blocks/src/contracts/index.d.ts +2 -0
- package/dist/_dts/blocks/src/contracts/non-block-islands.d.ts +6 -8
- package/dist/_dts/blocks/src/contracts/proof-block-islands.d.ts +36 -14
- package/dist/_dts/blocks/src/index.d.ts +5 -3
- package/dist/_dts/blocks/src/lib/media.d.ts +9 -539
- package/dist/_dts/blocks/src/primitives/layout/Grid.d.ts +18 -1
- package/dist/_dts/blocks/src/system/blocks/appointment-booking.d.ts +1 -0
- package/dist/_dts/blocks/src/system/blocks/events/shared/filtering.d.ts +1 -1
- package/dist/_dts/blocks/src/system/blocks/events/shared/schemas.d.ts +61 -0
- package/dist/_dts/blocks/src/system/blocks/events/shared/types.d.ts +24 -22
- package/dist/_dts/blocks/src/system/blocks/feature-cards.d.ts +25 -1
- package/dist/_dts/blocks/src/system/blocks/location-map.d.ts +3 -2
- package/dist/_dts/blocks/src/system/blocks/media-text.d.ts +142 -120
- package/dist/_dts/blocks/src/system/blocks/shop.d.ts +2 -2
- package/dist/_dts/blocks/src/system/blocks/shop.shared.d.ts +37 -4
- package/dist/_dts/blocks/src/system/blocks/site-footer-nav-groups-layout.d.ts +1 -1
- package/dist/_dts/blocks/src/system/blocks/site-footer-runtime.d.ts +3 -0
- package/dist/_dts/blocks/src/system/blocks/site-header.d.ts +0 -1
- package/dist/_dts/blocks/src/system/blocks/team-members.d.ts +4 -63
- package/dist/_dts/blocks/src/system/componentFactory.d.ts +5 -5
- package/dist/_dts/blocks/src/system/customize/backgrounds.d.ts +9 -9
- package/dist/_dts/blocks/src/system/customize/serializeBackgroundOverride.d.ts +3 -0
- package/dist/_dts/blocks/src/system/fields/background.d.ts +2 -20
- package/dist/_dts/blocks/src/system/fields/backgroundContent.d.ts +17 -0
- package/dist/_dts/blocks/src/system/fields/backgroundContentAudit.d.ts +20 -0
- package/dist/_dts/blocks/src/system/fields/boxStyles.d.ts +18 -34
- package/dist/_dts/blocks/src/system/fields/gridLayout.d.ts +20 -0
- package/dist/_dts/blocks/src/system/fragments/builder.d.ts +1 -0
- package/dist/_dts/blocks/src/system/fragments/types.d.ts +1 -0
- package/dist/_dts/blocks/src/system/helpers/index.d.ts +1 -1
- package/dist/_dts/blocks/src/system/helpers/resolveBackground.d.ts +10 -45
- package/dist/_dts/blocks/src/system/manifest/fieldValidation/index.d.ts +7 -4
- package/dist/_dts/blocks/src/system/manifest/fieldValidation/writeCanonicalization.d.ts +4 -0
- package/dist/_dts/blocks/src/system/manifest/schema.d.ts +123 -55
- package/dist/_dts/blocks/src/system/node/fragments/classNameBinding.d.ts +6 -1
- package/dist/_dts/blocks/src/system/node/fragments/styledCard.d.ts +31 -0
- package/dist/_dts/blocks/src/system/registry.d.ts +2 -0
- package/dist/_dts/blocks/src/system/runtime/api/endpoints.d.ts +4 -0
- package/dist/_dts/blocks/src/system/runtime/api/types/courses.d.ts +0 -1
- package/dist/_dts/blocks/src/system/runtime/api/types/events.d.ts +0 -1
- package/dist/_dts/blocks/src/system/runtime/api/types/shop.d.ts +2 -37
- package/dist/_dts/blocks/src/system/runtime/components/registry.client.d.ts +61 -24
- package/dist/_dts/blocks/src/system/runtime/components/runtime-backed-blocks.d.ts +30 -12
- package/dist/_dts/blocks/src/system/runtime/header/enhanceHeaderSection.d.ts +3 -5
- package/dist/_dts/blocks/src/system/runtime/header/headerScrollRuntime.d.ts +2 -0
- package/dist/_dts/blocks/src/system/runtime/header/runtimeContract.d.ts +22 -0
- package/dist/_dts/blocks/src/system/runtime/hooks/useHeadlessBookingFlow.state.d.ts +4 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.headless.state.d.ts +24 -8
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.server.d.ts +8 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.validationErrors.d.ts +17 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/commerce/shared/display.d.ts +9 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/commerce/shared/view.d.ts +3 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/event-registration.headless.planning.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/eventScope.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration.server.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/eventCollectionContract.d.ts +42 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/utils.d.ts +4 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/header-section.client.d.ts +2 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/header-section.frame.d.ts +21 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/header-section.server.d.ts +2 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/shop.interactive.d.ts +41 -12
- package/dist/_dts/blocks/src/system/runtime/nodes/shop.pass-contract.d.ts +3 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/shop.state.d.ts +3 -3
- package/dist/_dts/blocks/src/system/runtime/shared/components/FeedbackMessage.d.ts +17 -1
- package/dist/_dts/blocks/src/system/runtime/shared/components/index.d.ts +1 -1
- package/dist/_dts/blocks/src/system/spacing.d.ts +1 -1
- package/dist/_dts/blocks/src/system/transforms/registry/_utils/boxStyleClassNames.d.ts +90 -0
- package/dist/_dts/blocks/src/system/transforms/registry/_utils/surfaceForegroundStyles.d.ts +7 -1
- package/dist/_dts/blocks/src/system/transforms/registry/background.d.ts +1 -1
- package/dist/_dts/blocks/src/system/transforms/registry/boxStyles.d.ts +29 -1
- package/dist/_dts/blocks/src/system/transforms/registry/core.d.ts +4 -1
- package/dist/_dts/blocks/src/system/transforms/registry/headerRuntime.d.ts +3 -0
- package/dist/_dts/blocks/src/system/transforms/registry/index.d.ts +2 -1
- package/dist/_dts/blocks/src/system/transforms/registry/layout.d.ts +4 -40
- package/dist/_dts/blocks/src/system/transforms/typed.d.ts +41 -43
- package/dist/_dts/content-editor/src/FooterComposerOverview.d.ts +4 -2
- package/dist/_dts/content-editor/src/FooterComposerPanel.d.ts +2 -17
- package/dist/_dts/content-editor/src/FooterNavigationLayoutControl.d.ts +5 -0
- package/dist/_dts/content-editor/src/components/ContentFieldsForm.d.ts +2 -2
- package/dist/_dts/content-editor/src/footerComposer.d.ts +2 -1
- package/dist/_dts/content-editor/src/footerComposerPanelTypes.d.ts +21 -0
- package/dist/_dts/content-editor/src/footerPreviewRuntime.d.ts +2 -1
- package/dist/_dts/content-editor/src/useFooterComposerState.d.ts +11 -1
- package/dist/_dts/content-editor/src/useFooterNavigationLayout.d.ts +26 -0
- package/dist/_dts/content-model/src/content-types/builtin-schemas.d.ts +6 -6
- package/dist/_dts/content-model/src/content-types/builtins.d.ts +6 -6
- package/dist/_dts/content-model/src/templates/defaults.d.ts +7 -0
- package/dist/_dts/core/src/booking-date-time.d.ts +2 -2
- package/dist/_dts/core/src/booking-time-zone.d.ts +6 -0
- package/dist/_dts/core/src/branded.d.ts +4 -0
- package/dist/_dts/core/src/event-page-surface-subject.d.ts +25 -4
- package/dist/_dts/core/src/footer-composition-types.d.ts +4 -4
- package/dist/_dts/core/src/footer-navigation-layout.d.ts +4 -0
- package/dist/_dts/core/src/index.d.ts +4 -0
- package/dist/_dts/core/src/public-event-booking-availability.d.ts +8 -0
- package/dist/_dts/core/src/secret.d.ts +44 -0
- package/dist/_dts/db/src/generated/supabase/database.types.d.ts +379 -18
- package/dist/_dts/editor-blocks/src/BlockEditor.d.ts +2 -1
- package/dist/_dts/editor-blocks/src/BlockForm.d.ts +2 -2
- package/dist/_dts/editor-blocks/src/block-editor/BlockCard.d.ts +2 -2
- package/dist/_dts/editor-blocks/src/block-editor/BlockCardBody.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/block-editor/BlockCardHeader.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/block-editor/SortableBlockItem.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/block-editor/hooks/useBlockValidationManifests.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/block-editor/preparedManifest.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/blockPayload.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/index.d.ts +2 -2
- 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/index.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/entry-picker/EntryPickerField.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/widgets/entry-picker/index.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/inline-text/InlineTextField.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/widgets/link/LinkField.d.ts +2 -2
- package/dist/_dts/editor-blocks/src/widgets/offerings-preview/OfferingsPreviewGroupOrderField.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/widgets/reference/ReferenceField.d.ts +2 -2
- package/dist/_dts/editor-blocks/src/widgets/rich-text/RichTextField.d.ts +2 -2
- package/dist/_dts/editor-blocks/src/widgets/site-option-picker/SiteOptionPickerField.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/widgets/site-option-picker/utils.d.ts +1 -1
- package/dist/_dts/preview-next/src/client/blocks/useBlockCustomizeControls.d.ts +1 -1
- package/dist/_dts/preview-next/src/client/preview/EntryEditorPanel.d.ts +1 -1
- package/dist/_dts/preview-next/src/client/preview/EntrySlotBlockEditorPanel.d.ts +1 -1
- package/dist/_dts/preview-next/src/client/preview/FooterSidebarDisclosure.d.ts +8 -0
- package/dist/_dts/preview-next/src/client/preview/PageBlockEditorPanel.d.ts +5 -5
- package/dist/_dts/preview-next/src/client/preview/PreviewEditorSidebar.d.ts +15 -17
- package/dist/_dts/preview-next/src/client/preview/PreviewFooterEditorPanel.d.ts +20 -0
- package/dist/_dts/preview-next/src/client/preview/PreviewShell.d.ts +5 -5
- package/dist/_dts/preview-next/src/client/preview/PreviewShellLayout.d.ts +3 -5
- package/dist/_dts/preview-next/src/client/preview/PreviewSiteFontStorageContext.d.ts +6 -0
- package/dist/_dts/preview-next/src/client/preview/SiteChromeCustomizeContext.d.ts +4 -4
- package/dist/_dts/preview-next/src/client/preview/StyleConfigurator.d.ts +3 -5
- package/dist/_dts/preview-next/src/client/preview/StyleConfigurator.state.d.ts +6 -7
- package/dist/_dts/preview-next/src/client/preview/siteChromeBrandPreferences.d.ts +7 -7
- package/dist/_dts/preview-next/src/client/preview/siteChromeCustomizeTypes.d.ts +4 -4
- package/dist/_dts/preview-next/src/client/preview/siteChromeQuickControlHistoryState.d.ts +2 -2
- package/dist/_dts/preview-next/src/client/preview/siteChromeSavePlan.d.ts +12 -11
- package/dist/_dts/preview-next/src/client/preview/siteChromeSelectionRows.d.ts +53 -0
- package/dist/_dts/preview-next/src/client/preview/siteFontPreview.d.ts +5 -0
- package/dist/_dts/preview-next/src/client/preview/siteStyleAccess.d.ts +1 -6
- package/dist/_dts/preview-next/src/client/preview/siteStylePreviewPlanner.d.ts +6 -15
- package/dist/_dts/preview-next/src/client/preview/styleConfiguratorSnapshot.d.ts +4 -6
- package/dist/_dts/preview-next/src/client/sdk/contentStorage.d.ts +10 -0
- package/dist/_dts/preview-next/src/client/widgets/widgetOverrides.d.ts +1 -1
- package/dist/_dts/preview-next/src/index.d.ts +1 -0
- package/dist/_dts/preview-next/src/keepAlive.d.ts +3 -5
- package/dist/_dts/preview-next/src/refresh-contract.d.ts +1 -0
- package/dist/_dts/preview-next/src/route-contract.d.ts +7 -0
- package/dist/_dts/sdk/src/config/types.d.ts +1 -0
- package/dist/_dts/sdk/src/config/validation.d.ts +2 -0
- package/dist/_dts/sdk/src/contracts/index.d.ts +1 -1
- package/dist/_dts/sdk/src/contracts/system-block-content.d.ts +64 -79
- package/dist/_dts/sdk/src/next/catch-all-theme-admission.d.ts +23 -0
- package/dist/_dts/sdk/src/next/index.d.ts +8 -6
- package/dist/_dts/sdk/src/next/resolveTheme.d.ts +1 -2
- package/dist/_dts/sdk/src/next/types.d.ts +10 -0
- package/dist/_dts/sdk/src/preview-next/keep-alive.d.ts +1 -1
- package/dist/_dts/sdk/src/public-api/contracts.d.ts +2 -16
- package/dist/_dts/sdk/src/rendering/components/Layout.d.ts +4 -3
- package/dist/_dts/sdk/src/rendering/helpers/loadContent.d.ts +5 -3
- package/dist/_dts/sdk/src/rendering/helpers/pageRuntimeSupport.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/hooks/useContent.d.ts +4 -2
- package/dist/_dts/sdk/src/rendering/index.d.ts +3 -1
- package/dist/_dts/sdk/src/rendering/islands/types.d.ts +15 -2
- package/dist/_dts/sdk/src/rendering/server.d.ts +2 -0
- package/dist/_dts/sdk/src/rendering/themeAdmission.d.ts +11 -0
- package/dist/_dts/sdk/src/theme-bridge/types.d.ts +4 -2
- package/dist/_dts/sdk/src/version.d.ts +1 -1
- package/dist/_dts/theme-core/src/blockOverrides.d.ts +1 -1
- package/dist/_dts/theme-core/src/boxBackgroundSchema.d.ts +184 -0
- package/dist/_dts/theme-core/src/buttons/buttonColourContract.d.ts +96 -0
- package/dist/_dts/theme-core/src/buttons/buttonSurfaceContext.d.ts +78 -0
- package/dist/_dts/theme-core/src/buttons/index.d.ts +1 -0
- package/dist/_dts/theme-core/src/buttons/parseThemeForPersistence.d.ts +2 -2
- package/dist/_dts/theme-core/src/buttons/resolveButtonColourStates.d.ts +9 -57
- package/dist/_dts/theme-core/src/buttons/resolvedButtonCss.d.ts +6 -3
- package/dist/_dts/theme-core/src/buttons/styles/domain.d.ts +8 -7
- package/dist/_dts/theme-core/src/buttons/styles/recipes/quietArrow.d.ts +1 -0
- package/dist/_dts/theme-core/src/buttons/styles/recipes/staticRecipes.d.ts +11 -0
- package/dist/_dts/theme-core/src/buttons/styles/registry.d.ts +12 -0
- package/dist/_dts/theme-core/src/buttons/styles/selection.d.ts +5 -0
- package/dist/_dts/theme-core/src/buttons/types.d.ts +51 -4
- package/dist/_dts/theme-core/src/cards/core.d.ts +54 -10
- package/dist/_dts/theme-core/src/cards/decorations.d.ts +33 -0
- package/dist/_dts/theme-core/src/cards/generateDefaultCardSystem.d.ts +7 -2
- package/dist/_dts/theme-core/src/cards/index.d.ts +3 -0
- package/dist/_dts/theme-core/src/cards/openCardVariant.d.ts +24 -0
- package/dist/_dts/theme-core/src/cards/roles.d.ts +38 -0
- package/dist/_dts/theme-core/src/cards/siteStyleDefaults.d.ts +53 -8
- package/dist/_dts/theme-core/src/cards/types.d.ts +489 -21
- package/dist/_dts/theme-core/src/generated/containerResponsiveThemeCss.d.ts +1 -1
- package/dist/_dts/theme-core/src/header/legacyHeaderVariant.d.ts +59 -0
- package/dist/_dts/theme-core/src/header/paintTargets.d.ts +2 -2
- package/dist/_dts/theme-core/src/header/scrollTreatment.d.ts +3 -2
- package/dist/_dts/theme-core/src/lib/media.d.ts +583 -10
- package/dist/_dts/theme-core/src/mock-themes/all.d.ts +5085 -1524
- package/dist/_dts/theme-core/src/palette/utils/contrast.d.ts +1 -0
- package/dist/_dts/theme-core/src/palette/utils/opaqueSurfaceColor.d.ts +6 -0
- package/dist/_dts/theme-core/src/runtime/buildThemeRuntimeFromBridge.d.ts +1 -1
- package/dist/_dts/theme-core/src/schema.d.ts +5300 -2019
- package/dist/_dts/theme-core/src/site-styles/appearancePresetCatalog.d.ts +84 -102
- package/dist/_dts/theme-core/src/site-styles/appearancePresetResolution.d.ts +12 -1
- package/dist/_dts/theme-core/src/site-styles/appearancePresetTypes.d.ts +9 -4
- package/dist/_dts/theme-core/src/site-styles/backgroundAppearance.d.ts +0 -20
- package/dist/_dts/theme-core/src/site-styles/blockAppearancePresets.d.ts +84 -102
- package/dist/_dts/theme-core/src/site-styles/cardRoleVocabulary.d.ts +48 -0
- package/dist/_dts/theme-core/src/site-styles/compilationPlan.d.ts +6 -14
- package/dist/_dts/theme-core/src/site-styles/curatedSiteStyles.d.ts +29 -102
- package/dist/_dts/theme-core/src/site-styles/customizableSurfaces.d.ts +3 -76
- package/dist/_dts/theme-core/src/site-styles/designState.d.ts +21 -385
- package/dist/_dts/theme-core/src/site-styles/generatedDesignPipeline.d.ts +3 -7
- package/dist/_dts/theme-core/src/site-styles/generatedDesignPipelineHelpers.d.ts +17 -0
- package/dist/_dts/theme-core/src/site-styles/generatedSchemas.d.ts +10 -18
- package/dist/_dts/theme-core/src/site-styles/headerLayoutCatalog.d.ts +281 -0
- package/dist/_dts/theme-core/src/site-styles/headerLayoutResolution.d.ts +13 -0
- package/dist/_dts/theme-core/src/site-styles/headerLayoutStyles.d.ts +6 -0
- package/dist/_dts/theme-core/src/site-styles/{headerLookTypes.d.ts → headerLayoutTypes.d.ts} +18 -90
- package/dist/_dts/theme-core/src/site-styles/headerNavStyles.d.ts +6 -0
- package/dist/_dts/theme-core/src/site-styles/headerOpeningForeground.d.ts +7 -11
- package/dist/_dts/theme-core/src/site-styles/headerOpeningSection.d.ts +2 -4
- package/dist/_dts/theme-core/src/site-styles/headerStyleCompiler.d.ts +2 -2
- package/dist/_dts/theme-core/src/site-styles/imageSurfaceBackground.d.ts +14 -0
- package/dist/_dts/theme-core/src/site-styles/index.d.ts +6 -1
- package/dist/_dts/theme-core/src/site-styles/pageDesignAppearanceAvailability.d.ts +3 -0
- package/dist/_dts/theme-core/src/site-styles/pageDesignEditorCapabilities.d.ts +22 -0
- package/dist/_dts/theme-core/src/site-styles/pageDesignEditorModel.d.ts +9 -8
- package/dist/_dts/theme-core/src/site-styles/pageDesignIntentEquality.d.ts +3 -0
- package/dist/_dts/theme-core/src/site-styles/previewCompiler.d.ts +14 -41
- package/dist/_dts/theme-core/src/site-styles/previewRuntimeCapabilities.d.ts +19 -0
- package/dist/_dts/theme-core/src/site-styles/runtimeBackgroundResolution.d.ts +32 -0
- package/dist/_dts/theme-core/src/site-styles/runtimeCompiler.d.ts +9 -68
- package/dist/_dts/theme-core/src/site-styles/siteChromeNavPreferences.d.ts +1 -1
- package/dist/_dts/theme-core/src/site-styles/sourceCatalogs.d.ts +13 -12
- package/dist/_dts/theme-core/src/site-styles/types.d.ts +50 -39
- package/dist/_dts/theme-core/src/siteChromePlanning.d.ts +9 -9
- package/dist/_dts/theme-core/src/status/generateStatusCss.d.ts +1 -0
- package/dist/_dts/theme-core/src/surfaces/index.d.ts +1 -0
- package/dist/_dts/theme-core/src/surfaces/resolveSurfaceForeground.d.ts +39 -0
- package/dist/_dts/ui/src/navigation-tabs.d.ts +3 -2
- package/dist/client/{CourseRegistrationWizard-xRmA7REV.mjs → CourseRegistrationWizard-DGW9F0SQ.mjs} +7 -7
- package/dist/client/{DiscountCodeDisclosure-B9vriL5C.mjs → DiscountCodeDisclosure-BPZ-yfGI.mjs} +1 -1
- package/dist/client/{EventCombined.client-BgVnVTlz.mjs → EventCombined.client-Cjt3kKYR.mjs} +4 -4
- package/dist/client/{EventListing.client-CqdsO7jO.mjs → EventListing.client-DY9dn6Fh.mjs} +2 -2
- package/dist/client/{FeedbackMessage-ByMrs3cr.mjs → FeedbackMessage-CtLvvS_d.mjs} +15 -3
- package/dist/client/{LeafletStaticMap-CKPxot9M.mjs → LeafletStaticMap--2c61XYn.mjs} +1 -1
- package/dist/client/{StepIndicator-DGCYuBJ1.mjs → StepIndicator-CLjQhkDb.mjs} +3 -3
- package/dist/client/{accordion-BfN5Eqd-.mjs → accordion-_boYwHHi.mjs} +1 -1
- package/dist/client/{bookingForm-DOvCpBFP.mjs → bookingForm--AqEfyBX.mjs} +56 -39
- package/dist/client/bookings.mjs +1348 -1157
- package/dist/client/{carousel-DPNmiH0f.mjs → carousel-CVI2dqZr.mjs} +2 -2
- package/dist/client/{carousel.client-CpwTUhIo.mjs → carousel.client-59G_WMr4.mjs} +1 -1
- package/dist/client/{cart--egVXlrR.mjs → cart-DR6IiPz9.mjs} +3 -3
- package/dist/client/{checkout-DywWtMcq.mjs → checkout-CsrGAfQt.mjs} +3 -3
- package/dist/client/client.mjs +20935 -19889
- package/dist/client/{colorStyles-BWpj_h4C.mjs → colorStyles-CrxJrPjJ.mjs} +277 -1
- package/dist/client/{context-CJz1Vlsz.mjs → context-B83PiNzm.mjs} +6 -21
- package/dist/client/{courseRegistration-Dk9qFVwt.mjs → courseRegistration-aNJVaLa3.mjs} +3 -3
- package/dist/client/{eventCalendar-Bkz2HjlS.mjs → eventCalendar-OZ7h59VN.mjs} +6 -6
- package/dist/client/{eventCombined-D4kipYWg.mjs → eventCombined-BbJ6bFKz.mjs} +3 -3
- package/dist/client/{eventDetails-Dz_5ix2Q.mjs → eventDetails-BLyUBiCT.mjs} +3 -3
- package/dist/client/{eventListing-D0vm-zST.mjs → eventListing-DuP1yhBS.mjs} +3 -3
- package/dist/client/{eventRegistration-Cw1E4Q4p.mjs → eventRegistration-BXyECPa-.mjs} +11 -12
- package/dist/client/{form-C2Zf1n3K.mjs → form-BA4t3kKU.mjs} +4 -4
- package/dist/client/{headerSection-CP05gzdc.mjs → headerSection-CpNaJxhW.mjs} +151 -104
- package/dist/client/hooks.mjs +6328 -6104
- package/dist/client/{locationMap-Cl3x9PYJ.mjs → locationMap-3HGMCL7_.mjs} +3 -3
- package/dist/client/{media-CNE1Z-wb.mjs → media-BOHuueS5.mjs} +16 -4
- package/dist/client/{newsletterForm-DyEJoClm.mjs → newsletterForm-C2s6Mw67.mjs} +4 -4
- package/dist/client/{pricing-DGuNR1W4.mjs → pricing-BiqIMgZk.mjs} +1 -1
- package/dist/client/{productDetail-Cq-HrGew.mjs → productDetail-C9joWhdE.mjs} +3 -3
- package/dist/client/{productList-DbB3jwqd.mjs → productList-CjzdU3pB.mjs} +3 -3
- package/dist/client/{propsDecoder-CiTuhUwY.mjs → propsDecoder-CBPGXEYX.mjs} +2480 -2478
- package/dist/client/rendering/client.mjs +5371 -6741
- package/dist/client/rendering/islands.mjs +20 -20
- package/dist/client/rendering.mjs +18616 -17447
- package/dist/client/{scrollToBlock-CShkRqab.mjs → scrollToBlock-DZ73aEX6.mjs} +1 -1
- package/dist/client/{shop-Cu4Ib-ZA.mjs → shop-CQRai7hj.mjs} +36 -25
- package/dist/client/{shop-commerce-BzpsOdh7.mjs → shop-commerce-hP9UboOx.mjs} +8 -8
- package/dist/client/{shop-commerce-store-DaE7Fhj8.mjs → shop-commerce-store-DiD5a32e.mjs} +1 -1
- package/dist/client/{shopShared-cF0c20vB.mjs → shopShared-DP8DXTkF.mjs} +12 -6
- package/dist/client/{useEventFilters-QZ3HMgaJ.mjs → useEventFilters-pF_OJNQP.mjs} +137 -81
- package/dist/client/{usePolling-BKf0GcE-.mjs → usePolling-Cls91SD2.mjs} +2 -2
- package/dist/preview-next/before-render.mjs +202 -129
- package/dist/preview-next/client/runtime.mjs +4 -4
- package/dist/preview-next/keepAlive.mjs +7406 -29
- package/dist/preview-next/middleware.mjs +196 -128
- package/dist/{previewAuthStore-BesgU5Xu.mjs → previewAuthStore-CX1C_KJ4.mjs} +195 -128
- package/dist/{sdk-runtime-C20CVWbb.mjs → sdk-runtime-5CcPAI14.mjs} +2 -2
- package/dist/{separator-BE3NCquy.mjs → separator-BXlYN_gr.mjs} +1 -1
- package/dist/server/components.mjs +22644 -21375
- package/dist/server/config-validation.mjs +6507 -6309
- package/dist/server/config.mjs +6511 -6313
- package/dist/server/data.mjs +6311 -6104
- package/dist/server/date-time.mjs +22 -13
- package/dist/server/index.mjs +196 -129
- package/dist/server/next.mjs +22782 -21578
- package/dist/server/page-converter.mjs +4769 -6213
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/rendering/server.mjs +20525 -20291
- package/dist/server/rendering.mjs +22677 -21389
- package/dist/server/routing.mjs +6651 -5398
- package/dist/server/server.mjs +6389 -6256
- package/dist/server/theme-bridge.mjs +2251 -2465
- package/dist/server/theme.mjs +974 -642
- package/dist/styles/index.css +317 -337
- package/package.json +3 -2
- package/dist/_dts/block-form/src/client/blockDraftSaveability.d.ts +0 -1
- package/dist/_dts/block-form/src/widgets/index.d.ts +0 -20
- package/dist/_dts/blocks/src/system/runtime/api/requestBody.d.ts +0 -7
- package/dist/_dts/preview-next/src/client/preview/siteChromeLookRows.d.ts +0 -66
- package/dist/_dts/theme-core/src/site-styles/headerLayoutStyleCatalog.d.ts +0 -254
- package/dist/_dts/theme-core/src/site-styles/headerLegacyLooks.d.ts +0 -372
- package/dist/_dts/theme-core/src/site-styles/headerLookBranding.d.ts +0 -106
- package/dist/_dts/theme-core/src/site-styles/headerLookSelection.d.ts +0 -2
- package/dist/_dts/theme-core/src/site-styles/headerLooks.d.ts +0 -7
- package/dist/_dts/theme-core/src/site-styles/headerStyleCompilerPrimitives.d.ts +0 -23
- package/dist/client/clsx-DgIEfj3H.mjs +0 -16
package/dist/client/bookings.mjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import * as React$1 from "react";
|
|
3
3
|
import React, { createContext, createElement, useCallback, useContext, useEffect, useId, useLayoutEffect, useMemo, useReducer, useRef, useState, useSyncExternalStore } from "react";
|
|
4
4
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
-
import
|
|
5
|
+
import { z } from "zod";
|
|
6
6
|
//#region \0rolldown/runtime.js
|
|
7
7
|
var __defProp = Object.defineProperty;
|
|
8
8
|
var __esmMin = (fn, res, err) => () => {
|
|
@@ -98,7 +98,7 @@ function ze() {
|
|
|
98
98
|
/* @__PURE__ */ Te(P)
|
|
99
99
|
);
|
|
100
100
|
}
|
|
101
|
-
function z$
|
|
101
|
+
function z$1(e) {
|
|
102
102
|
if (L) {
|
|
103
103
|
if (/* @__PURE__ */ Te(P) !== null) throw Tt(), Je;
|
|
104
104
|
P = e;
|
|
@@ -1778,11 +1778,11 @@ function ha(e, t) {
|
|
|
1778
1778
|
var mt = we(Dr, 2);
|
|
1779
1779
|
let Pr;
|
|
1780
1780
|
var We = X(mt);
|
|
1781
|
-
en(We), We.__change = ui, z$
|
|
1781
|
+
en(We), We.__change = ui, z$1(mt);
|
|
1782
1782
|
var Ut = we(mt, 2), wi = X(Ut);
|
|
1783
1783
|
var pi = (n) => {
|
|
1784
1784
|
var u = na(), _ = Gr(u);
|
|
1785
|
-
Ge(X(_), () => c(re).verified), z$
|
|
1785
|
+
Ge(X(_), () => c(re).verified), z$1(_);
|
|
1786
1786
|
var T = we(_, 2);
|
|
1787
1787
|
en(T), Pe(() => {
|
|
1788
1788
|
se(T, "name", V()), jo(T, c(Le));
|
|
@@ -1790,10 +1790,10 @@ function ha(e, t) {
|
|
|
1790
1790
|
}, bi = (n, u) => {
|
|
1791
1791
|
var _ = (T) => {
|
|
1792
1792
|
var E = ia();
|
|
1793
|
-
Ge(X(E), () => c(re).verifying), z$
|
|
1793
|
+
Ge(X(E), () => c(re).verifying), z$1(E), ne(T, E);
|
|
1794
1794
|
}, y = (T) => {
|
|
1795
1795
|
var E = oa();
|
|
1796
|
-
Ge(X(E), () => c(re).label), z$
|
|
1796
|
+
Ge(X(E), () => c(re).label), z$1(E), Pe(() => se(E, "for", c(cr))), ne(T, E);
|
|
1797
1797
|
};
|
|
1798
1798
|
$e(n, (T) => {
|
|
1799
1799
|
c(C) === b.VERIFYING ? T(_) : T(y, !1);
|
|
@@ -1802,30 +1802,30 @@ function ha(e, t) {
|
|
|
1802
1802
|
$e(wi, (n) => {
|
|
1803
1803
|
c(C) === b.VERIFIED ? n(pi) : n(bi, !1);
|
|
1804
1804
|
});
|
|
1805
|
-
z$
|
|
1805
|
+
z$1(Ut);
|
|
1806
1806
|
var yi = we(Ut, 2);
|
|
1807
1807
|
var Ei = (n) => {
|
|
1808
1808
|
var u = aa(), _ = X(u);
|
|
1809
|
-
se(_, "href", sr), z$
|
|
1809
|
+
se(_, "href", sr), z$1(u), Pe(() => se(_, "aria-label", c(re).ariaLinkLabel)), ne(n, u);
|
|
1810
1810
|
};
|
|
1811
1811
|
$e(yi, (n) => {
|
|
1812
1812
|
(N() !== !0 || c(Dt)) && n(Ei);
|
|
1813
1813
|
});
|
|
1814
|
-
z$
|
|
1814
|
+
z$1(Mt);
|
|
1815
1815
|
var Or = we(Mt, 2);
|
|
1816
1816
|
var xi = (n) => {
|
|
1817
1817
|
var u = fa(), _ = we(X(u), 2);
|
|
1818
1818
|
var y = (E) => {
|
|
1819
1819
|
var p = la();
|
|
1820
|
-
Ge(X(p), () => c(re).expired), z$
|
|
1820
|
+
Ge(X(p), () => c(re).expired), z$1(p), Pe(() => se(p, "title", c(He))), ne(E, p);
|
|
1821
1821
|
}, T = (E) => {
|
|
1822
1822
|
var p = sa();
|
|
1823
|
-
Ge(X(p), () => c(re).error), z$
|
|
1823
|
+
Ge(X(p), () => c(re).error), z$1(p), Pe(() => se(p, "title", c(He))), ne(E, p);
|
|
1824
1824
|
};
|
|
1825
1825
|
$e(_, (E) => {
|
|
1826
1826
|
c(C) === b.EXPIRED ? E(y) : E(T, !1);
|
|
1827
1827
|
});
|
|
1828
|
-
z$
|
|
1828
|
+
z$1(u), ne(n, u);
|
|
1829
1829
|
};
|
|
1830
1830
|
$e(Or, (n) => {
|
|
1831
1831
|
(c(He) || c(C) === b.EXPIRED) && n(xi);
|
|
@@ -1833,7 +1833,7 @@ function ha(e, t) {
|
|
|
1833
1833
|
var Fr = we(Or, 2);
|
|
1834
1834
|
var $i = (n) => {
|
|
1835
1835
|
var u = ua(), _ = X(u);
|
|
1836
|
-
Ge(X(_), () => c(re).footer), z$
|
|
1836
|
+
Ge(X(_), () => c(re).footer), z$1(_), z$1(u), ne(n, u);
|
|
1837
1837
|
};
|
|
1838
1838
|
$e(Fr, (n) => {
|
|
1839
1839
|
c(re).footer && (k() !== !0 || c(Dt)) && n($i);
|
|
@@ -1846,7 +1846,7 @@ function ha(e, t) {
|
|
|
1846
1846
|
$e(ki, (n) => {
|
|
1847
1847
|
v() && n(Ci);
|
|
1848
1848
|
});
|
|
1849
|
-
return z$
|
|
1849
|
+
return z$1(ot), nn(ot, (n) => D(B, n), () => c(B)), Pe((n) => {
|
|
1850
1850
|
se(ot, "data-state", c(C)), se(ot, "data-floating", v()), Pr = Fo(mt, 1, "altcha-checkbox", null, Pr, n), se(We, "id", c(cr)), We.required = r() !== "onsubmit" && (!v() || r() !== "off");
|
|
1851
1851
|
}, [() => ({ "altcha-hidden": c(C) === b.VERIFYING })]), So("invalid", We, br), Bo(We, () => c(Be), (n) => D(Be, n)), ne(e, Nr), Yn({
|
|
1852
1852
|
clarify: rt,
|
|
@@ -2465,23 +2465,6 @@ function createDeduplicationCache(options = {}) {
|
|
|
2465
2465
|
};
|
|
2466
2466
|
}
|
|
2467
2467
|
//#endregion
|
|
2468
|
-
//#region ../blocks/src/system/runtime/api/requestBody.ts
|
|
2469
|
-
function omitUndefinedOverrides(overrides) {
|
|
2470
|
-
return Object.fromEntries(Object.entries(overrides).filter(([, value]) => value !== void 0));
|
|
2471
|
-
}
|
|
2472
|
-
/**
|
|
2473
|
-
* Forward a typed request body unchanged, then apply a small set of explicit overrides.
|
|
2474
|
-
*
|
|
2475
|
-
* Undefined override values are stripped before merging so callers do not accidentally
|
|
2476
|
-
* clobber an existing field when they mean "no override".
|
|
2477
|
-
*/
|
|
2478
|
-
function withRequestOverrides(body, overrides) {
|
|
2479
|
-
return {
|
|
2480
|
-
...body,
|
|
2481
|
-
...omitUndefinedOverrides(overrides)
|
|
2482
|
-
};
|
|
2483
|
-
}
|
|
2484
|
-
//#endregion
|
|
2485
2468
|
//#region ../blocks/src/system/runtime/api/endpoints.ts
|
|
2486
2469
|
/**
|
|
2487
2470
|
* Build endpoint path with parameter substitution
|
|
@@ -2567,7 +2550,8 @@ const EVENTS = {
|
|
|
2567
2550
|
register: {
|
|
2568
2551
|
path: "/public/sites/{siteId}/events/register",
|
|
2569
2552
|
method: "POST",
|
|
2570
|
-
authScope: "portal"
|
|
2553
|
+
authScope: "portal",
|
|
2554
|
+
skipPreviewStage: true
|
|
2571
2555
|
},
|
|
2572
2556
|
checkout: {
|
|
2573
2557
|
path: "/public/sites/{siteId}/events/checkout",
|
|
@@ -2591,7 +2575,8 @@ const WHOLE_SERIES = {
|
|
|
2591
2575
|
enroll: {
|
|
2592
2576
|
path: "/public/sites/{siteId}/dated-offerings/whole-series/enroll",
|
|
2593
2577
|
method: "POST",
|
|
2594
|
-
authScope: "portal"
|
|
2578
|
+
authScope: "portal",
|
|
2579
|
+
skipPreviewStage: true
|
|
2595
2580
|
},
|
|
2596
2581
|
checkout: {
|
|
2597
2582
|
path: "/public/sites/{siteId}/dated-offerings/whole-series/checkout",
|
|
@@ -2877,7 +2862,7 @@ var BlockApiError = class extends Error {
|
|
|
2877
2862
|
this.name = "BlockApiError";
|
|
2878
2863
|
}
|
|
2879
2864
|
};
|
|
2880
|
-
function isRecord$
|
|
2865
|
+
function isRecord$7(value) {
|
|
2881
2866
|
return typeof value === "object" && value !== null;
|
|
2882
2867
|
}
|
|
2883
2868
|
function isJsonResponseContentType(contentType) {
|
|
@@ -2901,8 +2886,8 @@ async function parseJsonBody(response) {
|
|
|
2901
2886
|
}
|
|
2902
2887
|
}
|
|
2903
2888
|
function getBlockApiErrorDetails(data) {
|
|
2904
|
-
if (!isRecord$
|
|
2905
|
-
const nestedError = isRecord$
|
|
2889
|
+
if (!isRecord$7(data)) return {};
|
|
2890
|
+
const nestedError = isRecord$7(data.error) ? data.error : void 0;
|
|
2906
2891
|
return {
|
|
2907
2892
|
message: typeof nestedError?.message === "string" ? nestedError.message : typeof data.message === "string" ? data.message : void 0,
|
|
2908
2893
|
code: typeof nestedError?.code === "string" ? nestedError.code : typeof data.code === "string" ? data.code : void 0
|
|
@@ -3169,7 +3154,7 @@ function createBlockApi(config) {
|
|
|
3169
3154
|
const path = buildPath(EVENTS.register.path, { siteId: sid });
|
|
3170
3155
|
return request(EVENTS.register, {
|
|
3171
3156
|
path,
|
|
3172
|
-
body:
|
|
3157
|
+
body: data
|
|
3173
3158
|
});
|
|
3174
3159
|
},
|
|
3175
3160
|
async createEventCheckout(data) {
|
|
@@ -3202,7 +3187,7 @@ function createBlockApi(config) {
|
|
|
3202
3187
|
const path = buildPath(WHOLE_SERIES.enroll.path, { siteId: sid });
|
|
3203
3188
|
return request(WHOLE_SERIES.enroll, {
|
|
3204
3189
|
path,
|
|
3205
|
-
body:
|
|
3190
|
+
body: data
|
|
3206
3191
|
});
|
|
3207
3192
|
},
|
|
3208
3193
|
async checkWholeSeriesEligibility(data) {
|
|
@@ -3833,18 +3818,32 @@ function isFreePublicEventPriceDisplay(display) {
|
|
|
3833
3818
|
}
|
|
3834
3819
|
//#endregion
|
|
3835
3820
|
//#region ../core/src/event-page-surface-subject.ts
|
|
3821
|
+
function createEventSeriesPageSurfaceSubject(eventSeriesId, bookingScope) {
|
|
3822
|
+
return bookingScope === "whole_series" ? {
|
|
3823
|
+
kind: "eventSeries",
|
|
3824
|
+
eventSeriesId,
|
|
3825
|
+
bookingScope,
|
|
3826
|
+
isWholeSeriesBooking: true
|
|
3827
|
+
} : {
|
|
3828
|
+
kind: "eventSeries",
|
|
3829
|
+
eventSeriesId,
|
|
3830
|
+
bookingScope
|
|
3831
|
+
};
|
|
3832
|
+
}
|
|
3836
3833
|
function parseEventPageSurfaceSubject(value) {
|
|
3837
|
-
if (!isRecord$
|
|
3834
|
+
if (!isRecord$6(value)) return err$1({ kind: "notObject" });
|
|
3838
3835
|
switch (value.kind) {
|
|
3839
3836
|
case "eventSeries": {
|
|
3840
3837
|
const eventSeriesId = parseEventSeriesId(value.eventSeriesId);
|
|
3841
|
-
|
|
3842
|
-
kind: "eventSeries",
|
|
3843
|
-
eventSeriesId: eventSeriesId.value
|
|
3844
|
-
}) : err$1({
|
|
3838
|
+
if (!eventSeriesId.ok) return err$1({
|
|
3845
3839
|
kind: "invalidEventSeriesId",
|
|
3846
3840
|
error: eventSeriesId.error
|
|
3847
3841
|
});
|
|
3842
|
+
if (value.bookingScope !== "single_occurrence" && value.bookingScope !== "whole_series") return err$1({
|
|
3843
|
+
kind: "invalidEventSeriesBookingScope",
|
|
3844
|
+
bookingScope: value.bookingScope
|
|
3845
|
+
});
|
|
3846
|
+
return ok(createEventSeriesPageSurfaceSubject(eventSeriesId.value, value.bookingScope));
|
|
3848
3847
|
}
|
|
3849
3848
|
case "eventOffering": {
|
|
3850
3849
|
const eventOfferingId = parseEventOfferingId(value.eventOfferingId);
|
|
@@ -3877,7 +3876,7 @@ function parseEventPageSurfaceSubject(value) {
|
|
|
3877
3876
|
});
|
|
3878
3877
|
}
|
|
3879
3878
|
}
|
|
3880
|
-
function isRecord$
|
|
3879
|
+
function isRecord$6(value) {
|
|
3881
3880
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
3882
3881
|
}
|
|
3883
3882
|
//#endregion
|
|
@@ -3959,36 +3958,46 @@ function assertNever$1(value) {
|
|
|
3959
3958
|
throw new Error(`Unexpected value: ${String(value)}`);
|
|
3960
3959
|
}
|
|
3961
3960
|
//#endregion
|
|
3962
|
-
//#region ../core/src/booking-
|
|
3963
|
-
const
|
|
3964
|
-
const FALLBACK_TIMEZONE = "UTC";
|
|
3965
|
-
const LOCAL_DATE_PATTERN = /^(?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2})$/u;
|
|
3966
|
-
const DATE_TIME_FORMATTER_CACHE_LIMIT = 100;
|
|
3967
|
-
const dateTimeFormatterCache = /* @__PURE__ */ new Map();
|
|
3961
|
+
//#region ../core/src/booking-time-zone.ts
|
|
3962
|
+
const TIME_ZONE_VALIDITY_CACHE_LIMIT = 100;
|
|
3968
3963
|
const timeZoneValidityCache = /* @__PURE__ */ new Map();
|
|
3969
|
-
|
|
3970
|
-
|
|
3964
|
+
const NUMERIC_OFFSET_TIME_ZONE_PATTERN = /^(?:[+-]\d{2}(?::?\d{2})?|(?:UTC|GMT)[+-]\d{1,2}(?::?\d{2})?)$/iu;
|
|
3965
|
+
function isValidBookingTimeZone(timeZone) {
|
|
3966
|
+
const normalized = timeZone.trim();
|
|
3967
|
+
if (NUMERIC_OFFSET_TIME_ZONE_PATTERN.test(normalized)) return false;
|
|
3968
|
+
const cached = timeZoneValidityCache.get(normalized);
|
|
3971
3969
|
if (cached !== void 0) return cached;
|
|
3972
3970
|
let isValid;
|
|
3973
3971
|
try {
|
|
3974
|
-
new Intl.DateTimeFormat(
|
|
3972
|
+
new Intl.DateTimeFormat("en-US", { timeZone: normalized }).format(/* @__PURE__ */ new Date());
|
|
3975
3973
|
isValid = true;
|
|
3976
3974
|
} catch {
|
|
3977
3975
|
isValid = false;
|
|
3978
3976
|
}
|
|
3979
|
-
if (timeZoneValidityCache.size >=
|
|
3980
|
-
timeZoneValidityCache.set(
|
|
3977
|
+
if (timeZoneValidityCache.size >= TIME_ZONE_VALIDITY_CACHE_LIMIT) timeZoneValidityCache.clear();
|
|
3978
|
+
timeZoneValidityCache.set(normalized, isValid);
|
|
3981
3979
|
return isValid;
|
|
3982
3980
|
}
|
|
3981
|
+
function parseBookingTimeZone(timeZone) {
|
|
3982
|
+
if (typeof timeZone !== "string") return err$1("invalid-time-zone");
|
|
3983
|
+
const normalized = timeZone.trim();
|
|
3984
|
+
if (normalized.length === 0 || NUMERIC_OFFSET_TIME_ZONE_PATTERN.test(normalized) || !isValidBookingTimeZone(normalized)) return err$1("invalid-time-zone");
|
|
3985
|
+
return ok(normalized);
|
|
3986
|
+
}
|
|
3987
|
+
//#endregion
|
|
3988
|
+
//#region ../core/src/booking-date-time.ts
|
|
3989
|
+
const DEFAULT_LOCALE = "en-US";
|
|
3990
|
+
const FALLBACK_TIMEZONE = "UTC";
|
|
3991
|
+
const LOCAL_DATE_PATTERN = /^(?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2})$/u;
|
|
3992
|
+
const DATE_TIME_FORMATTER_CACHE_LIMIT = 100;
|
|
3993
|
+
const dateTimeFormatterCache = /* @__PURE__ */ new Map();
|
|
3983
3994
|
function getSafeTimeZone(timeZone) {
|
|
3984
3995
|
const normalized = typeof timeZone === "string" ? timeZone.trim() : "";
|
|
3985
|
-
return normalized.length > 0 &&
|
|
3996
|
+
return normalized.length > 0 && isValidBookingTimeZone(normalized) ? normalized : FALLBACK_TIMEZONE;
|
|
3986
3997
|
}
|
|
3987
3998
|
function parseStrictBookingTimeZone(timeZone) {
|
|
3988
|
-
|
|
3989
|
-
|
|
3990
|
-
if (normalized.length === 0 || !isValidTimeZone(normalized)) return null;
|
|
3991
|
-
return normalized;
|
|
3999
|
+
const parsed = parseBookingTimeZone(timeZone);
|
|
4000
|
+
return parsed.ok ? parsed.value : null;
|
|
3992
4001
|
}
|
|
3993
4002
|
function formatParseError(error) {
|
|
3994
4003
|
switch (error.reason) {
|
|
@@ -4041,7 +4050,7 @@ function toBookingTimeZone(timeZone) {
|
|
|
4041
4050
|
function resolveBookingTimeZoneId(...candidates) {
|
|
4042
4051
|
for (const candidate of candidates) {
|
|
4043
4052
|
const normalized = typeof candidate === "string" ? candidate.trim() : "";
|
|
4044
|
-
if (normalized &&
|
|
4053
|
+
if (normalized && isValidBookingTimeZone(normalized)) return normalized;
|
|
4045
4054
|
}
|
|
4046
4055
|
return FALLBACK_TIMEZONE;
|
|
4047
4056
|
}
|
|
@@ -4333,12 +4342,12 @@ function resolveBookingSiteId(siteId, form) {
|
|
|
4333
4342
|
return siteId || form?.siteId || "";
|
|
4334
4343
|
}
|
|
4335
4344
|
function normalizeBookingFormConfig(form) {
|
|
4336
|
-
if (!isRecord$
|
|
4345
|
+
if (!isRecord$5(form)) return null;
|
|
4337
4346
|
const id = readNonEmptyString(form.id);
|
|
4338
4347
|
const name = readNonEmptyString(form.name);
|
|
4339
4348
|
if (!id || !name) return null;
|
|
4340
|
-
const schemaSource = isRecord$
|
|
4341
|
-
const settingsSource = isRecord$
|
|
4349
|
+
const schemaSource = isRecord$5(form.schema) ? form.schema : isRecord$5(form.schemaJson) ? form.schemaJson : null;
|
|
4350
|
+
const settingsSource = isRecord$5(form.settings) ? form.settings : isRecord$5(form.settingsJson) ? form.settingsJson : null;
|
|
4342
4351
|
return {
|
|
4343
4352
|
id,
|
|
4344
4353
|
name,
|
|
@@ -4358,8 +4367,8 @@ function normalizeBookingServices(services) {
|
|
|
4358
4367
|
};
|
|
4359
4368
|
if (!services) return [];
|
|
4360
4369
|
if (Array.isArray(services)) return services.filter(isBookingFormService).map(normalizeService);
|
|
4361
|
-
if (isRecord$
|
|
4362
|
-
return isRecord$
|
|
4370
|
+
if (isRecord$5(services) && "services" in services) return Array.isArray(services.services) ? services.services.filter(isBookingFormService).map(normalizeService) : [];
|
|
4371
|
+
return isRecord$5(services) ? Object.values(services).filter(isBookingFormService).map(normalizeService) : [];
|
|
4363
4372
|
}
|
|
4364
4373
|
function normalizeBookingSchema(value) {
|
|
4365
4374
|
if (!value) return void 0;
|
|
@@ -4370,7 +4379,7 @@ function normalizeBookingSchema(value) {
|
|
|
4370
4379
|
};
|
|
4371
4380
|
}
|
|
4372
4381
|
function readBookingFormField(value) {
|
|
4373
|
-
if (!isRecord$
|
|
4382
|
+
if (!isRecord$5(value)) return null;
|
|
4374
4383
|
const id = readNonEmptyString(value.id);
|
|
4375
4384
|
const label = readNonEmptyString(value.label);
|
|
4376
4385
|
const type = readBookingFieldType(value.type);
|
|
@@ -4414,7 +4423,7 @@ function readBookingFieldOptions(value) {
|
|
|
4414
4423
|
return options.length > 0 ? options : void 0;
|
|
4415
4424
|
}
|
|
4416
4425
|
function readBookingFieldOption(value) {
|
|
4417
|
-
if (!isRecord$
|
|
4426
|
+
if (!isRecord$5(value)) return null;
|
|
4418
4427
|
const optionValue = readNonEmptyString(value.value);
|
|
4419
4428
|
const label = readNonEmptyString(value.label);
|
|
4420
4429
|
return optionValue && label ? {
|
|
@@ -4434,7 +4443,7 @@ function normalizeBookingSettings(value) {
|
|
|
4434
4443
|
};
|
|
4435
4444
|
}
|
|
4436
4445
|
function isBookingFormService(value) {
|
|
4437
|
-
return isRecord$
|
|
4446
|
+
return isRecord$5(value) && typeof value.id === "string" && typeof value.siteId === "string" && typeof value.title === "string";
|
|
4438
4447
|
}
|
|
4439
4448
|
function collectBookingCustomFields(data) {
|
|
4440
4449
|
const customFields = {};
|
|
@@ -4484,7 +4493,7 @@ function readStringArray(value) {
|
|
|
4484
4493
|
const strings = value.filter((item) => typeof item === "string");
|
|
4485
4494
|
return strings.length > 0 ? strings : void 0;
|
|
4486
4495
|
}
|
|
4487
|
-
function isRecord$
|
|
4496
|
+
function isRecord$5(value) {
|
|
4488
4497
|
return typeof value === "object" && value !== null;
|
|
4489
4498
|
}
|
|
4490
4499
|
function getBookingServicePaymentSelectionMode(service) {
|
|
@@ -5701,8 +5710,12 @@ function formatScheduleDate(isoString, locale) {
|
|
|
5701
5710
|
return new Intl.DateTimeFormat(locale, { dateStyle: "medium" }).format(date);
|
|
5702
5711
|
}
|
|
5703
5712
|
//#endregion
|
|
5704
|
-
//#region ../blocks/src/system/runtime/nodes/booking-form.
|
|
5705
|
-
|
|
5713
|
+
//#region ../blocks/src/system/runtime/nodes/booking-form.validationErrors.ts
|
|
5714
|
+
function omitRecordKey(record, key) {
|
|
5715
|
+
if (!(key in record)) return record;
|
|
5716
|
+
const { [key]: _removed, ...rest } = record;
|
|
5717
|
+
return rest;
|
|
5718
|
+
}
|
|
5706
5719
|
function createEmptyBookingValidationErrors() {
|
|
5707
5720
|
return {
|
|
5708
5721
|
formError: null,
|
|
@@ -5737,6 +5750,9 @@ function clearBookingFieldError(errors, fieldId) {
|
|
|
5737
5750
|
fieldErrors: omitRecordKey(errors.fieldErrors, fieldId)
|
|
5738
5751
|
};
|
|
5739
5752
|
}
|
|
5753
|
+
//#endregion
|
|
5754
|
+
//#region ../blocks/src/system/runtime/nodes/booking-form.headless.state.ts
|
|
5755
|
+
const unsafeAsBookingFieldId = (id) => id;
|
|
5740
5756
|
function createInitialBookingFlowReducerState(input) {
|
|
5741
5757
|
const initialData = input.initialData ?? {};
|
|
5742
5758
|
return {
|
|
@@ -5748,6 +5764,7 @@ function createInitialBookingFlowReducerState(input) {
|
|
|
5748
5764
|
selectedSlot: null,
|
|
5749
5765
|
fieldValues: collectInitialFieldValues(initialData),
|
|
5750
5766
|
touchedFields: {},
|
|
5767
|
+
attemptedStepIds: {},
|
|
5751
5768
|
discountCode: toOptionalString(initialData.discountCode) ?? "",
|
|
5752
5769
|
selectedSlidingAmountInput: toOptionalString(initialData.selectedSlidingAmountInput) ?? "",
|
|
5753
5770
|
selectedCollectionOptionKind: toSelectedCollectionOptionKind(initialData.selectedCollectionOptionKind),
|
|
@@ -5789,6 +5806,25 @@ function toOptionalCustomerPassId(value) {
|
|
|
5789
5806
|
function isBookingFieldValue(value) {
|
|
5790
5807
|
return value === null || typeof value === "string" || typeof value === "number" || typeof value === "boolean" || Array.isArray(value) && value.every((item) => typeof item === "string");
|
|
5791
5808
|
}
|
|
5809
|
+
/**
|
|
5810
|
+
* Send the flow back to the date step when the slot it was holding went away,
|
|
5811
|
+
* leaving a scoped feedback message. A completed booking is left alone.
|
|
5812
|
+
*/
|
|
5813
|
+
function applyAvailabilitySelectionInvalidation(state, invalidation) {
|
|
5814
|
+
if (state.phase !== "editing") return state;
|
|
5815
|
+
return {
|
|
5816
|
+
...state,
|
|
5817
|
+
currentStepId: "datetime-selection",
|
|
5818
|
+
selectedDate: invalidation.kind === "date_unavailable" ? void 0 : state.selectedDate,
|
|
5819
|
+
selectedSlot: null,
|
|
5820
|
+
feedback: {
|
|
5821
|
+
kind: "error",
|
|
5822
|
+
scope: "availability",
|
|
5823
|
+
message: invalidation.message
|
|
5824
|
+
},
|
|
5825
|
+
validationErrors: clearBookingFormError(state.validationErrors)
|
|
5826
|
+
};
|
|
5827
|
+
}
|
|
5792
5828
|
function bookingFlowReducer(state, event) {
|
|
5793
5829
|
switch (event.type) {
|
|
5794
5830
|
case "service-selected": return {
|
|
@@ -5837,6 +5873,13 @@ function bookingFlowReducer(state, event) {
|
|
|
5837
5873
|
[event.fieldId]: true
|
|
5838
5874
|
}
|
|
5839
5875
|
};
|
|
5876
|
+
case "step-advance-attempted": return state.attemptedStepIds[event.stepId] ? state : {
|
|
5877
|
+
...state,
|
|
5878
|
+
attemptedStepIds: {
|
|
5879
|
+
...state.attemptedStepIds,
|
|
5880
|
+
[event.stepId]: true
|
|
5881
|
+
}
|
|
5882
|
+
};
|
|
5840
5883
|
case "payment-option-selected": return {
|
|
5841
5884
|
...state,
|
|
5842
5885
|
selectedCollectionOptionKind: event.kind ?? void 0,
|
|
@@ -5883,20 +5926,7 @@ function bookingFlowReducer(state, event) {
|
|
|
5883
5926
|
phase: event.feedback.kind === "success" ? "completed" : "editing",
|
|
5884
5927
|
feedback: event.feedback
|
|
5885
5928
|
};
|
|
5886
|
-
case "availability-selection-invalidated":
|
|
5887
|
-
if (state.phase !== "editing") return state;
|
|
5888
|
-
return {
|
|
5889
|
-
...state,
|
|
5890
|
-
currentStepId: "datetime-selection",
|
|
5891
|
-
selectedDate: event.invalidation.kind === "date_unavailable" ? void 0 : state.selectedDate,
|
|
5892
|
-
selectedSlot: null,
|
|
5893
|
-
feedback: {
|
|
5894
|
-
kind: "error",
|
|
5895
|
-
scope: "availability",
|
|
5896
|
-
message: event.invalidation.message
|
|
5897
|
-
},
|
|
5898
|
-
validationErrors: clearBookingFormError(state.validationErrors)
|
|
5899
|
-
};
|
|
5929
|
+
case "availability-selection-invalidated": return applyAvailabilitySelectionInvalidation(state, event.invalidation);
|
|
5900
5930
|
case "feedback-cleared": return {
|
|
5901
5931
|
...state,
|
|
5902
5932
|
phase: "editing",
|
|
@@ -6127,6 +6157,7 @@ function deriveBookingFlowSteps(input) {
|
|
|
6127
6157
|
requiresResourceSelection: input.requiresResourceSelection,
|
|
6128
6158
|
paymentResolution: stepResolution.paymentResolution
|
|
6129
6159
|
}));
|
|
6160
|
+
const attemptedStepIds = input.attemptedStepIds ?? {};
|
|
6130
6161
|
const steps = stepPlan.map((step, index) => {
|
|
6131
6162
|
const validation = validations.get(step.id) ?? { ok: true };
|
|
6132
6163
|
const state = index < currentStepIndex ? "complete" : index === currentStepIndex ? "active" : "available";
|
|
@@ -6136,7 +6167,7 @@ function deriveBookingFlowSteps(input) {
|
|
|
6136
6167
|
state,
|
|
6137
6168
|
index,
|
|
6138
6169
|
visibleIndex: index,
|
|
6139
|
-
errors: validation.ok ? createEmptyBookingValidationErrors() : validation.errors,
|
|
6170
|
+
errors: validation.ok || !attemptedStepIds[step.id] ? createEmptyBookingValidationErrors() : validation.errors,
|
|
6140
6171
|
canEnter: index <= currentStepIndex,
|
|
6141
6172
|
canLeave: validation.ok
|
|
6142
6173
|
};
|
|
@@ -6405,13 +6436,8 @@ function isBlankFieldValue(value) {
|
|
|
6405
6436
|
if (Array.isArray(value)) return value.length === 0;
|
|
6406
6437
|
return false;
|
|
6407
6438
|
}
|
|
6408
|
-
function omitRecordKey(record, key) {
|
|
6409
|
-
if (!(key in record)) return record;
|
|
6410
|
-
const { [key]: _removed, ...rest } = record;
|
|
6411
|
-
return rest;
|
|
6412
|
-
}
|
|
6413
6439
|
function readAppointmentBookingOverrideData(value) {
|
|
6414
|
-
if (!isRecord$
|
|
6440
|
+
if (!isRecord$4(value)) return null;
|
|
6415
6441
|
const services = normalizeBookingServices(value.services);
|
|
6416
6442
|
return {
|
|
6417
6443
|
form: normalizeBookingFormConfig(value.form),
|
|
@@ -6426,7 +6452,7 @@ function createOverrideInputError(reason, message, warnInDev = false) {
|
|
|
6426
6452
|
message
|
|
6427
6453
|
};
|
|
6428
6454
|
}
|
|
6429
|
-
function isRecord$
|
|
6455
|
+
function isRecord$4(value) {
|
|
6430
6456
|
return typeof value === "object" && value !== null;
|
|
6431
6457
|
}
|
|
6432
6458
|
//#endregion
|
|
@@ -6508,9 +6534,11 @@ function useHeadlessBookingFlow(options) {
|
|
|
6508
6534
|
currentStepId: state.currentStepId,
|
|
6509
6535
|
requiresServiceSelection: options.requiresServiceSelection,
|
|
6510
6536
|
requiresResourceSelection: options.requiresResourceSelection,
|
|
6511
|
-
enableAppointmentPackages: options.enableAppointmentPackages
|
|
6537
|
+
enableAppointmentPackages: options.enableAppointmentPackages,
|
|
6538
|
+
attemptedStepIds: state.attemptedStepIds
|
|
6512
6539
|
}), [
|
|
6513
6540
|
data,
|
|
6541
|
+
state.attemptedStepIds,
|
|
6514
6542
|
defaultServiceId,
|
|
6515
6543
|
defaultResourceId,
|
|
6516
6544
|
options.enableAppointmentPackages,
|
|
@@ -6862,6 +6890,10 @@ function useHeadlessBookingFlow(options) {
|
|
|
6862
6890
|
if (!latest.currentStep) return { ok: true };
|
|
6863
6891
|
const validation = latest.validations.get(latest.currentStep.id) ?? { ok: true };
|
|
6864
6892
|
if (!validation.ok) {
|
|
6893
|
+
dispatch({
|
|
6894
|
+
type: "step-advance-attempted",
|
|
6895
|
+
stepId: latest.currentStep.id
|
|
6896
|
+
});
|
|
6865
6897
|
dispatch({
|
|
6866
6898
|
type: "validation-errors-set",
|
|
6867
6899
|
errors: validation.errors
|
|
@@ -7416,7 +7448,7 @@ const PALETTE_TOKEN_NAMES = [
|
|
|
7416
7448
|
"text",
|
|
7417
7449
|
"border"
|
|
7418
7450
|
];
|
|
7419
|
-
const paletteTokenNameSchema = z
|
|
7451
|
+
const paletteTokenNameSchema = z.enum(PALETTE_TOKEN_NAMES);
|
|
7420
7452
|
const themeColorBaseTokenNames = [
|
|
7421
7453
|
...PALETTE_TOKEN_NAMES,
|
|
7422
7454
|
...blockColorTokenNames,
|
|
@@ -7461,7 +7493,7 @@ function parseThemeColorToken(value) {
|
|
|
7461
7493
|
if (!isThemeColorToken(value)) return null;
|
|
7462
7494
|
return value.trim();
|
|
7463
7495
|
}
|
|
7464
|
-
const themeColorTokenSchema = z
|
|
7496
|
+
const themeColorTokenSchema = z.string().min(1).refine((value) => Boolean(isThemeColorToken(value)), "Expected a known Theme V2 color token");
|
|
7465
7497
|
//#endregion
|
|
7466
7498
|
//#region ../theme-core/src/buttons/types.ts
|
|
7467
7499
|
/**
|
|
@@ -7483,7 +7515,7 @@ const VARIANT_ROLES = [
|
|
|
7483
7515
|
* IDs become class selectors, so keep the contract deliberately narrower than
|
|
7484
7516
|
* an arbitrary string and shared with every authoring/runtime boundary.
|
|
7485
7517
|
*/
|
|
7486
|
-
const buttonVariantIdSchema = z
|
|
7518
|
+
const buttonVariantIdSchema = z.string().min(1).max(50).regex(/^[a-z0-9-]+$/, "Button variant IDs may contain lowercase letters, numbers, and hyphens only").refine((value) => value !== "link" && value !== "tertiary", { message: "Retired button role IDs are not valid variant IDs" });
|
|
7487
7519
|
function parseOpaqueButtonColourToken(value) {
|
|
7488
7520
|
const token = parseThemeColorToken(value);
|
|
7489
7521
|
if (token === null) return null;
|
|
@@ -7498,8 +7530,8 @@ const opaqueButtonColourTokenSchema = themeColorTokenSchema.refine((value) => pa
|
|
|
7498
7530
|
if (token === null) throw new Error("Invariant: opaque button token passed its schema");
|
|
7499
7531
|
return token;
|
|
7500
7532
|
});
|
|
7501
|
-
const buttonShadeAmountSchema = z
|
|
7502
|
-
const buttonShadowIntensitySchema = z
|
|
7533
|
+
const buttonShadeAmountSchema = z.number().finite().min(0).max(900).multipleOf(100);
|
|
7534
|
+
const buttonShadowIntensitySchema = z.enum([
|
|
7503
7535
|
"subtle",
|
|
7504
7536
|
"medium",
|
|
7505
7537
|
"strong"
|
|
@@ -7511,153 +7543,176 @@ const buttonShadowIntensitySchema = z$1.enum([
|
|
|
7511
7543
|
* this closed union so unsupported effect IDs, unknown option keys, and unsafe
|
|
7512
7544
|
* CSS values cannot become representable after the schema boundary.
|
|
7513
7545
|
*/
|
|
7514
|
-
const buttonEffectApplicationSchema = z
|
|
7515
|
-
z
|
|
7516
|
-
effectId: z
|
|
7517
|
-
options: z
|
|
7546
|
+
const buttonEffectApplicationSchema = z.discriminatedUnion("effectId", [
|
|
7547
|
+
z.strictObject({
|
|
7548
|
+
effectId: z.literal("darken-background"),
|
|
7549
|
+
options: z.strictObject({ amount: buttonShadeAmountSchema.optional() }).optional()
|
|
7518
7550
|
}),
|
|
7519
|
-
z
|
|
7520
|
-
effectId: z
|
|
7521
|
-
options: z
|
|
7551
|
+
z.strictObject({
|
|
7552
|
+
effectId: z.literal("lighten-background"),
|
|
7553
|
+
options: z.strictObject({ amount: buttonShadeAmountSchema.optional() }).optional()
|
|
7522
7554
|
}),
|
|
7523
|
-
z
|
|
7524
|
-
effectId: z
|
|
7525
|
-
options: z
|
|
7555
|
+
z.strictObject({
|
|
7556
|
+
effectId: z.literal("background-on-hover"),
|
|
7557
|
+
options: z.strictObject({ colorToken: opaqueButtonColourTokenSchema.optional() }).optional()
|
|
7526
7558
|
}),
|
|
7527
|
-
z
|
|
7528
|
-
effectId: z
|
|
7529
|
-
options: z
|
|
7559
|
+
z.strictObject({
|
|
7560
|
+
effectId: z.literal("animated-gradient"),
|
|
7561
|
+
options: z.strictObject({ direction: z.enum(["horizontal", "vertical"]).optional() }).optional()
|
|
7530
7562
|
}),
|
|
7531
|
-
z
|
|
7532
|
-
effectId: z
|
|
7533
|
-
options: z
|
|
7563
|
+
z.strictObject({
|
|
7564
|
+
effectId: z.literal("drop-shadow"),
|
|
7565
|
+
options: z.strictObject({ intensity: buttonShadowIntensitySchema.optional() }).optional()
|
|
7534
7566
|
}),
|
|
7535
|
-
z
|
|
7536
|
-
effectId: z
|
|
7537
|
-
options: z
|
|
7567
|
+
z.strictObject({
|
|
7568
|
+
effectId: z.literal("inner-shadow"),
|
|
7569
|
+
options: z.strictObject({}).optional()
|
|
7538
7570
|
}),
|
|
7539
|
-
z
|
|
7540
|
-
effectId: z
|
|
7541
|
-
options: z
|
|
7542
|
-
mode: z
|
|
7571
|
+
z.strictObject({
|
|
7572
|
+
effectId: z.literal("neumorphic-shadow"),
|
|
7573
|
+
options: z.strictObject({
|
|
7574
|
+
mode: z.enum(["raised", "pressed"]).optional(),
|
|
7543
7575
|
intensity: buttonShadowIntensitySchema.optional()
|
|
7544
7576
|
}).optional()
|
|
7545
7577
|
}),
|
|
7546
|
-
z
|
|
7547
|
-
effectId: z
|
|
7548
|
-
options: z
|
|
7578
|
+
z.strictObject({
|
|
7579
|
+
effectId: z.literal("retro-3d-shadow"),
|
|
7580
|
+
options: z.strictObject({}).optional()
|
|
7549
7581
|
}),
|
|
7550
|
-
z
|
|
7551
|
-
effectId: z
|
|
7552
|
-
options: z
|
|
7582
|
+
z.strictObject({
|
|
7583
|
+
effectId: z.literal("scale-up"),
|
|
7584
|
+
options: z.strictObject({ scale: z.enum([
|
|
7553
7585
|
"1.02",
|
|
7554
7586
|
"1.03",
|
|
7555
7587
|
"1.05",
|
|
7556
7588
|
"1.10"
|
|
7557
7589
|
]).optional() }).optional()
|
|
7558
7590
|
}),
|
|
7559
|
-
z
|
|
7560
|
-
effectId: z
|
|
7561
|
-
options: z
|
|
7591
|
+
z.strictObject({
|
|
7592
|
+
effectId: z.literal("scale-down"),
|
|
7593
|
+
options: z.strictObject({ scale: z.enum([
|
|
7562
7594
|
"0.90",
|
|
7563
7595
|
"0.95",
|
|
7564
7596
|
"0.97",
|
|
7565
7597
|
"0.98"
|
|
7566
7598
|
]).optional() }).optional()
|
|
7567
7599
|
}),
|
|
7568
|
-
z
|
|
7569
|
-
effectId: z
|
|
7570
|
-
options: z
|
|
7600
|
+
z.strictObject({
|
|
7601
|
+
effectId: z.literal("lift"),
|
|
7602
|
+
options: z.strictObject({ amount: z.enum([
|
|
7571
7603
|
"0.25",
|
|
7572
7604
|
"0.5",
|
|
7573
7605
|
"1"
|
|
7574
7606
|
]).optional() }).optional()
|
|
7575
7607
|
}),
|
|
7576
|
-
z
|
|
7577
|
-
effectId: z
|
|
7578
|
-
options: z
|
|
7608
|
+
z.strictObject({
|
|
7609
|
+
effectId: z.literal("press-down"),
|
|
7610
|
+
options: z.strictObject({}).optional()
|
|
7579
7611
|
}),
|
|
7580
|
-
z
|
|
7581
|
-
effectId: z
|
|
7582
|
-
options: z
|
|
7612
|
+
z.strictObject({
|
|
7613
|
+
effectId: z.literal("pop"),
|
|
7614
|
+
options: z.strictObject({ intensity: z.enum([
|
|
7583
7615
|
"subtle",
|
|
7584
7616
|
"medium",
|
|
7585
7617
|
"dramatic"
|
|
7586
7618
|
]).optional() }).optional()
|
|
7587
7619
|
}),
|
|
7588
|
-
z
|
|
7589
|
-
effectId: z
|
|
7590
|
-
options: z
|
|
7591
|
-
height: z
|
|
7592
|
-
origin: z
|
|
7620
|
+
z.strictObject({
|
|
7621
|
+
effectId: z.literal("border-bottom-grow"),
|
|
7622
|
+
options: z.strictObject({
|
|
7623
|
+
height: z.union([z.literal(1), z.literal(2)]).optional(),
|
|
7624
|
+
origin: z.enum([
|
|
7593
7625
|
"left",
|
|
7594
7626
|
"center",
|
|
7595
7627
|
"right"
|
|
7596
7628
|
]).optional()
|
|
7597
7629
|
}).optional()
|
|
7598
7630
|
}),
|
|
7599
|
-
z
|
|
7600
|
-
effectId: z
|
|
7601
|
-
options: z
|
|
7631
|
+
z.strictObject({
|
|
7632
|
+
effectId: z.literal("sketchy-border"),
|
|
7633
|
+
options: z.strictObject({ intensity: buttonShadowIntensitySchema.optional() }).optional()
|
|
7602
7634
|
})
|
|
7603
7635
|
]);
|
|
7604
|
-
const cornerStyleSchema = z
|
|
7636
|
+
const cornerStyleSchema = z.enum([
|
|
7605
7637
|
"square",
|
|
7606
7638
|
"rounded",
|
|
7607
7639
|
"pill"
|
|
7608
7640
|
]);
|
|
7609
|
-
const shadowSizeSchema = z
|
|
7641
|
+
const shadowSizeSchema = z.enum([
|
|
7610
7642
|
"none",
|
|
7611
7643
|
"low",
|
|
7612
7644
|
"medium",
|
|
7613
7645
|
"high"
|
|
7614
7646
|
]);
|
|
7615
|
-
const textTransformSchema = z
|
|
7647
|
+
const textTransformSchema = z.enum([
|
|
7616
7648
|
"none",
|
|
7617
7649
|
"uppercase",
|
|
7618
7650
|
"lowercase",
|
|
7619
7651
|
"capitalize"
|
|
7620
7652
|
]);
|
|
7621
|
-
const fontWeightSchema = z
|
|
7622
|
-
z
|
|
7623
|
-
z
|
|
7624
|
-
z
|
|
7653
|
+
const fontWeightSchema = z.union([
|
|
7654
|
+
z.literal(500),
|
|
7655
|
+
z.literal(600),
|
|
7656
|
+
z.literal(700)
|
|
7625
7657
|
]);
|
|
7626
|
-
const buttonTypographySchema = z
|
|
7627
|
-
const letterSpacingSchema = z
|
|
7658
|
+
const buttonTypographySchema = z.enum(["body", "heading"]);
|
|
7659
|
+
const letterSpacingSchema = z.enum([
|
|
7628
7660
|
"tight",
|
|
7629
7661
|
"normal",
|
|
7630
7662
|
"loose"
|
|
7631
7663
|
]);
|
|
7632
|
-
const hoverTransformSchema = z
|
|
7664
|
+
const hoverTransformSchema = z.enum([
|
|
7633
7665
|
"none",
|
|
7634
7666
|
"lift",
|
|
7635
7667
|
"scale",
|
|
7636
7668
|
"press"
|
|
7637
7669
|
]);
|
|
7638
|
-
z
|
|
7639
|
-
const buttonPaddingPresetSchema = z
|
|
7670
|
+
z.enum(["none", "token"]);
|
|
7671
|
+
const buttonPaddingPresetSchema = z.enum([
|
|
7640
7672
|
"compact",
|
|
7641
7673
|
"default",
|
|
7642
7674
|
"spacious"
|
|
7643
7675
|
]);
|
|
7644
|
-
const gradientStyleSchema = z
|
|
7676
|
+
const gradientStyleSchema = z.enum([
|
|
7645
7677
|
"linear",
|
|
7646
7678
|
"radial",
|
|
7647
7679
|
"conic"
|
|
7648
7680
|
]);
|
|
7649
|
-
const gradientSharpnessSchema = z
|
|
7681
|
+
const gradientSharpnessSchema = z.enum([
|
|
7650
7682
|
"smooth",
|
|
7651
7683
|
"medium",
|
|
7652
7684
|
"hard"
|
|
7653
7685
|
]);
|
|
7654
|
-
const prioritySchema = z
|
|
7655
|
-
z
|
|
7656
|
-
z
|
|
7657
|
-
z
|
|
7686
|
+
const prioritySchema = z.union([
|
|
7687
|
+
z.literal(1),
|
|
7688
|
+
z.literal(2),
|
|
7689
|
+
z.literal(3)
|
|
7658
7690
|
]);
|
|
7659
|
-
z
|
|
7660
|
-
const
|
|
7691
|
+
const variantRoleSchema = z.enum(VARIANT_ROLES);
|
|
7692
|
+
const buttonSurfaceFallbackSchema = z.discriminatedUnion("kind", [z.strictObject({ kind: z.literal("surface-outline") }), z.strictObject({
|
|
7693
|
+
kind: z.literal("variant"),
|
|
7694
|
+
role: variantRoleSchema
|
|
7695
|
+
})]);
|
|
7696
|
+
const standardButtonSurfacePolicy = {
|
|
7697
|
+
primary: [{ kind: "surface-outline" }],
|
|
7698
|
+
secondary: [{ kind: "surface-outline" }, {
|
|
7699
|
+
kind: "variant",
|
|
7700
|
+
role: "primary"
|
|
7701
|
+
}],
|
|
7702
|
+
outline: [{ kind: "surface-outline" }],
|
|
7703
|
+
ghost: [{ kind: "surface-outline" }],
|
|
7704
|
+
accent: [{ kind: "surface-outline" }, {
|
|
7705
|
+
kind: "variant",
|
|
7706
|
+
role: "primary"
|
|
7707
|
+
}]
|
|
7708
|
+
};
|
|
7709
|
+
const STANDARD_BUTTON_SURFACE_POLICY = Object.freeze(Object.fromEntries(VARIANT_ROLES.map((role) => [role, Object.freeze([...standardButtonSurfacePolicy[role]])])));
|
|
7710
|
+
function createStandardButtonSurfacePolicy() {
|
|
7711
|
+
return Object.fromEntries(VARIANT_ROLES.map((role) => [role, [...STANDARD_BUTTON_SURFACE_POLICY[role]]]));
|
|
7712
|
+
}
|
|
7713
|
+
const buttonSurfacePolicyShape = Object.fromEntries(VARIANT_ROLES.map((role) => [role, z.array(buttonSurfaceFallbackSchema).max(VARIANT_ROLES.length)]));
|
|
7714
|
+
const buttonSurfacePolicySchema = z.strictObject(buttonSurfacePolicyShape);
|
|
7715
|
+
const buttonSizeNameSchema = z.enum([
|
|
7661
7716
|
"sm",
|
|
7662
7717
|
"md",
|
|
7663
7718
|
"lg",
|
|
@@ -7671,13 +7726,13 @@ const buttonSizeNameSchema = z$1.enum([
|
|
|
7671
7726
|
* generator trust the shape rather than defensively defaulting downstream.
|
|
7672
7727
|
*/
|
|
7673
7728
|
const PADDING_TOKEN_PATTERN = /^(?:0|\d+(?:\.\d+)?(?:rem|em|px|%))$/;
|
|
7674
|
-
const paddingShorthandSchema = z
|
|
7729
|
+
const paddingShorthandSchema = z.string().refine((value) => {
|
|
7675
7730
|
const parts = value.split(/\s+/).filter(Boolean);
|
|
7676
7731
|
return parts.length === 2 && parts.every((token) => PADDING_TOKEN_PATTERN.test(token));
|
|
7677
7732
|
}, { message: "Padding must be two space-separated CSS length tokens (e.g. \"0.5rem 1rem\"). Use `0` for zero." });
|
|
7678
|
-
const buttonSizeConfigSchema = z
|
|
7733
|
+
const buttonSizeConfigSchema = z.object({
|
|
7679
7734
|
padding: paddingShorthandSchema,
|
|
7680
|
-
fontSize: z
|
|
7735
|
+
fontSize: z.string().optional()
|
|
7681
7736
|
});
|
|
7682
7737
|
/**
|
|
7683
7738
|
* `xl` is optional on the wire so themes persisted before the `xl` size was
|
|
@@ -7685,7 +7740,7 @@ const buttonSizeConfigSchema = z$1.object({
|
|
|
7685
7740
|
* backfills it from `lg`, keeping `ButtonSizes` a complete `sm/md/lg/xl` map
|
|
7686
7741
|
* downstream — generators never need to deal with an undefined `xl`.
|
|
7687
7742
|
*/
|
|
7688
|
-
const buttonSizesSchema = z
|
|
7743
|
+
const buttonSizesSchema = z.object({
|
|
7689
7744
|
sm: buttonSizeConfigSchema,
|
|
7690
7745
|
md: buttonSizeConfigSchema,
|
|
7691
7746
|
lg: buttonSizeConfigSchema,
|
|
@@ -7696,9 +7751,9 @@ const buttonSizesSchema = z$1.object({
|
|
|
7696
7751
|
lg,
|
|
7697
7752
|
xl: xl ?? lg
|
|
7698
7753
|
}));
|
|
7699
|
-
const buttonGlobalSettingsBaseSchema = z
|
|
7754
|
+
const buttonGlobalSettingsBaseSchema = z.strictObject({
|
|
7700
7755
|
cornerStyle: cornerStyleSchema,
|
|
7701
|
-
cornerRadius: z
|
|
7756
|
+
cornerRadius: z.number().min(0).max(24).optional(),
|
|
7702
7757
|
/**
|
|
7703
7758
|
* Family-level shadow inherited by variants that don't set their own.
|
|
7704
7759
|
* Optional and flat-by-default: when omitted, buttons carry no drop shadow
|
|
@@ -7710,23 +7765,23 @@ const buttonGlobalSettingsBaseSchema = z$1.strictObject({
|
|
|
7710
7765
|
textTransform: textTransformSchema,
|
|
7711
7766
|
fontWeight: fontWeightSchema,
|
|
7712
7767
|
typography: buttonTypographySchema.optional(),
|
|
7713
|
-
fontSize: z
|
|
7768
|
+
fontSize: z.string().optional(),
|
|
7714
7769
|
letterSpacing: letterSpacingSchema.optional(),
|
|
7715
|
-
italic: z
|
|
7770
|
+
italic: z.boolean().optional(),
|
|
7716
7771
|
paddingPreset: buttonPaddingPresetSchema.optional(),
|
|
7717
7772
|
hoverTransform: hoverTransformSchema,
|
|
7718
7773
|
gradientStyle: gradientStyleSchema.optional(),
|
|
7719
|
-
gradientAngle: z
|
|
7774
|
+
gradientAngle: z.number().min(0).max(360).optional(),
|
|
7720
7775
|
gradientSharpness: gradientSharpnessSchema.optional()
|
|
7721
7776
|
});
|
|
7722
|
-
const buttonGlobalSettingsSchema = z
|
|
7723
|
-
hoverColor: z
|
|
7724
|
-
hoverColorToken: z
|
|
7777
|
+
const buttonGlobalSettingsSchema = z.discriminatedUnion("hoverColor", [buttonGlobalSettingsBaseSchema.extend({
|
|
7778
|
+
hoverColor: z.literal("none"),
|
|
7779
|
+
hoverColorToken: z.never().optional()
|
|
7725
7780
|
}), buttonGlobalSettingsBaseSchema.extend({
|
|
7726
|
-
hoverColor: z
|
|
7781
|
+
hoverColor: z.literal("token"),
|
|
7727
7782
|
hoverColorToken: opaqueButtonColourTokenSchema
|
|
7728
7783
|
})]);
|
|
7729
|
-
const gradientDirectionSchema$1 = z
|
|
7784
|
+
const gradientDirectionSchema$1 = z.enum([
|
|
7730
7785
|
"to-r",
|
|
7731
7786
|
"to-l",
|
|
7732
7787
|
"to-t",
|
|
@@ -7736,14 +7791,14 @@ const gradientDirectionSchema$1 = z$1.enum([
|
|
|
7736
7791
|
"to-br",
|
|
7737
7792
|
"to-bl"
|
|
7738
7793
|
]);
|
|
7739
|
-
const buttonColourTreatmentSchema = z
|
|
7740
|
-
z
|
|
7741
|
-
type: z
|
|
7794
|
+
const buttonColourTreatmentSchema = z.discriminatedUnion("type", [
|
|
7795
|
+
z.strictObject({
|
|
7796
|
+
type: z.literal("solid"),
|
|
7742
7797
|
colorToken: opaqueButtonColourTokenSchema
|
|
7743
7798
|
}),
|
|
7744
|
-
z
|
|
7745
|
-
type: z
|
|
7746
|
-
stops: z
|
|
7799
|
+
z.strictObject({
|
|
7800
|
+
type: z.literal("gradient"),
|
|
7801
|
+
stops: z.array(opaqueButtonColourTokenSchema).min(2).transform((stops) => {
|
|
7747
7802
|
const [first, second, ...rest] = stops;
|
|
7748
7803
|
if (first === void 0 || second === void 0) throw new Error("Invariant: gradient stops passed the minimum length schema");
|
|
7749
7804
|
return [
|
|
@@ -7755,34 +7810,34 @@ const buttonColourTreatmentSchema = z$1.discriminatedUnion("type", [
|
|
|
7755
7810
|
direction: gradientDirectionSchema$1,
|
|
7756
7811
|
foregroundToken: opaqueButtonColourTokenSchema
|
|
7757
7812
|
}),
|
|
7758
|
-
z
|
|
7759
|
-
type: z
|
|
7760
|
-
role: z
|
|
7813
|
+
z.strictObject({
|
|
7814
|
+
type: z.literal("surface"),
|
|
7815
|
+
role: z.literal("link")
|
|
7761
7816
|
})
|
|
7762
7817
|
]);
|
|
7763
7818
|
const buttonBackgroundSchema = buttonColourTreatmentSchema;
|
|
7764
|
-
const buttonBorderSchema = z
|
|
7765
|
-
const buttonVariantAffordanceSchema = z
|
|
7766
|
-
const variantShadowSchema = z
|
|
7767
|
-
elevation: z
|
|
7819
|
+
const buttonBorderSchema = z.strictObject({ widthClass: z.string() });
|
|
7820
|
+
const buttonVariantAffordanceSchema = z.strictObject({ iconId: z.string().min(1) });
|
|
7821
|
+
const variantShadowSchema = z.strictObject({
|
|
7822
|
+
elevation: z.enum([
|
|
7768
7823
|
"none",
|
|
7769
7824
|
"low",
|
|
7770
7825
|
"medium",
|
|
7771
7826
|
"high"
|
|
7772
7827
|
]),
|
|
7773
|
-
softness: z
|
|
7828
|
+
softness: z.enum([
|
|
7774
7829
|
"crisp",
|
|
7775
7830
|
"soft",
|
|
7776
7831
|
"hard"
|
|
7777
7832
|
]).nullable(),
|
|
7778
|
-
position: z
|
|
7833
|
+
position: z.enum(["bottom", "bottom-right"]).default("bottom"),
|
|
7779
7834
|
colorToken: opaqueButtonColourTokenSchema.optional()
|
|
7780
7835
|
});
|
|
7781
|
-
const variantEffectsSchema = z
|
|
7782
|
-
base: z
|
|
7783
|
-
hover: z
|
|
7784
|
-
active: z
|
|
7785
|
-
focus: z
|
|
7836
|
+
const variantEffectsSchema = z.strictObject({
|
|
7837
|
+
base: z.array(buttonEffectApplicationSchema).optional(),
|
|
7838
|
+
hover: z.array(buttonEffectApplicationSchema).optional(),
|
|
7839
|
+
active: z.array(buttonEffectApplicationSchema).optional(),
|
|
7840
|
+
focus: z.array(buttonEffectApplicationSchema).optional()
|
|
7786
7841
|
});
|
|
7787
7842
|
/**
|
|
7788
7843
|
* Per-variant size overrides schema — every entry is optional.
|
|
@@ -7791,7 +7846,7 @@ const variantEffectsSchema = z$1.strictObject({
|
|
|
7791
7846
|
* for that size on this variant. Missing sizes fall through to theme.sizes,
|
|
7792
7847
|
* then system defaults.
|
|
7793
7848
|
*/
|
|
7794
|
-
const variantSizeOverridesSchema = z
|
|
7849
|
+
const variantSizeOverridesSchema = z.object({
|
|
7795
7850
|
sm: buttonSizeConfigSchema.optional(),
|
|
7796
7851
|
md: buttonSizeConfigSchema.optional(),
|
|
7797
7852
|
lg: buttonSizeConfigSchema.optional(),
|
|
@@ -7803,14 +7858,14 @@ const variantSizeOverridesSchema = z$1.object({
|
|
|
7803
7858
|
* default (e.g. link-style variants declaring zero horizontal padding at
|
|
7804
7859
|
* every size).
|
|
7805
7860
|
*/
|
|
7806
|
-
const buttonVariantSchema = z
|
|
7861
|
+
const buttonVariantSchema = z.strictObject({
|
|
7807
7862
|
id: buttonVariantIdSchema,
|
|
7808
|
-
name: z
|
|
7809
|
-
enabled: z
|
|
7863
|
+
name: z.string().min(1).max(20),
|
|
7864
|
+
enabled: z.boolean(),
|
|
7810
7865
|
priority: prioritySchema,
|
|
7811
7866
|
background: buttonBackgroundSchema,
|
|
7812
7867
|
/** Tailwind radius token (e.g. `'rounded-md'`). Omit to inherit from `global.cornerStyle`. */
|
|
7813
|
-
borderRadius: z
|
|
7868
|
+
borderRadius: z.string().optional(),
|
|
7814
7869
|
shadow: variantShadowSchema.optional(),
|
|
7815
7870
|
border: buttonBorderSchema.optional(),
|
|
7816
7871
|
hoverBackgroundToken: opaqueButtonColourTokenSchema.optional(),
|
|
@@ -7818,10 +7873,11 @@ const buttonVariantSchema = z$1.strictObject({
|
|
|
7818
7873
|
sizes: variantSizeOverridesSchema.optional(),
|
|
7819
7874
|
affordance: buttonVariantAffordanceSchema.optional()
|
|
7820
7875
|
});
|
|
7821
|
-
const buttonSystemSchema = z
|
|
7876
|
+
const buttonSystemSchema = z.strictObject({
|
|
7822
7877
|
global: buttonGlobalSettingsSchema,
|
|
7823
|
-
variants: z
|
|
7824
|
-
sizes: buttonSizesSchema.optional()
|
|
7878
|
+
variants: z.array(buttonVariantSchema).min(1).max(6),
|
|
7879
|
+
sizes: buttonSizesSchema.optional(),
|
|
7880
|
+
surfacePolicy: buttonSurfacePolicySchema.optional()
|
|
7825
7881
|
}).superRefine((system, ctx) => {
|
|
7826
7882
|
const seen = /* @__PURE__ */ new Set();
|
|
7827
7883
|
system.variants.forEach((variant, index) => {
|
|
@@ -7839,47 +7895,49 @@ const buttonSystemSchema = z$1.strictObject({
|
|
|
7839
7895
|
});
|
|
7840
7896
|
//#endregion
|
|
7841
7897
|
//#region ../theme-core/src/lib/media.ts
|
|
7842
|
-
const hotspotSchema
|
|
7898
|
+
const hotspotSchema = z.object({
|
|
7843
7899
|
x: z.number().min(0).max(1),
|
|
7844
7900
|
y: z.number().min(0).max(1),
|
|
7845
7901
|
radius: z.number().optional()
|
|
7846
7902
|
});
|
|
7847
|
-
const rotationSchema
|
|
7903
|
+
const rotationSchema = z.union([
|
|
7848
7904
|
z.literal(0),
|
|
7849
7905
|
z.literal(90),
|
|
7850
7906
|
z.literal(180),
|
|
7851
7907
|
z.literal(270)
|
|
7852
7908
|
]);
|
|
7853
|
-
const rectSchema
|
|
7909
|
+
const rectSchema = z.tuple([
|
|
7854
7910
|
z.number(),
|
|
7855
7911
|
z.number(),
|
|
7856
7912
|
z.number(),
|
|
7857
7913
|
z.number()
|
|
7858
7914
|
]);
|
|
7859
|
-
const aspectCropSchema
|
|
7915
|
+
const aspectCropSchema = z.object({
|
|
7860
7916
|
aspect: z.preprocess((value) => value == null ? void 0 : value, z.string().optional()),
|
|
7861
|
-
rect: z.preprocess((value) => value == null ? void 0 : value, rectSchema
|
|
7862
|
-
hotspot: z.preprocess((value) => value == null ? void 0 : value, hotspotSchema
|
|
7863
|
-
rotation: z.preprocess((value) => value == null ? void 0 : value, rotationSchema
|
|
7917
|
+
rect: z.preprocess((value) => value == null ? void 0 : value, rectSchema.optional()),
|
|
7918
|
+
hotspot: z.preprocess((value) => value == null ? void 0 : value, hotspotSchema.optional()),
|
|
7919
|
+
rotation: z.preprocess((value) => value == null ? void 0 : value, rotationSchema.optional())
|
|
7864
7920
|
});
|
|
7865
|
-
const transformSchema
|
|
7921
|
+
const transformSchema = z.object({
|
|
7866
7922
|
aspectCrops: z.preprocess((value) => {
|
|
7867
7923
|
if (!value || typeof value !== "object" || Array.isArray(value)) return;
|
|
7868
7924
|
return value;
|
|
7869
|
-
}, z.record(z.string(), aspectCropSchema
|
|
7870
|
-
rect: rectSchema
|
|
7871
|
-
hotspot: hotspotSchema
|
|
7872
|
-
rotation: rotationSchema
|
|
7925
|
+
}, z.record(z.string(), aspectCropSchema.catch({}))).optional(),
|
|
7926
|
+
rect: rectSchema.optional(),
|
|
7927
|
+
hotspot: hotspotSchema.optional(),
|
|
7928
|
+
rotation: rotationSchema.optional()
|
|
7873
7929
|
});
|
|
7874
|
-
const
|
|
7875
|
-
|
|
7876
|
-
|
|
7877
|
-
|
|
7878
|
-
|
|
7879
|
-
|
|
7880
|
-
|
|
7881
|
-
|
|
7882
|
-
|
|
7930
|
+
const mediaPosterSchema = z.discriminatedUnion("tag", [z.object({
|
|
7931
|
+
tag: z.literal("storage"),
|
|
7932
|
+
assetId: z.string().optional(),
|
|
7933
|
+
storageBucket: z.string().min(1),
|
|
7934
|
+
storagePath: z.string().min(1)
|
|
7935
|
+
}), z.object({
|
|
7936
|
+
tag: z.literal("external-src"),
|
|
7937
|
+
assetId: z.string().optional(),
|
|
7938
|
+
src: z.string().url()
|
|
7939
|
+
})]);
|
|
7940
|
+
const mediaBaseSchema = z.object({
|
|
7883
7941
|
purpose: z.string().optional(),
|
|
7884
7942
|
placeholder: z.boolean().default(true).optional(),
|
|
7885
7943
|
assetId: z.string().optional(),
|
|
@@ -7892,8 +7950,33 @@ const mediaSchema$1 = z.object({
|
|
|
7892
7950
|
height: z.number().optional(),
|
|
7893
7951
|
storageBucket: z.string().optional(),
|
|
7894
7952
|
storagePath: z.string().optional(),
|
|
7895
|
-
|
|
7953
|
+
poster: mediaPosterSchema.optional(),
|
|
7954
|
+
transform: transformSchema.optional()
|
|
7896
7955
|
});
|
|
7956
|
+
const mediaIdentifierSchema = z.string().trim().min(1).brand();
|
|
7957
|
+
const imageMediaSchema = mediaBaseSchema.extend({ type: z.literal("image") });
|
|
7958
|
+
const videoMediaSchema = mediaBaseSchema.extend({ type: z.literal("video") });
|
|
7959
|
+
const audioMediaSchema = mediaBaseSchema.extend({ type: z.literal("audio") });
|
|
7960
|
+
const documentMediaSchema = mediaBaseSchema.extend({ type: z.literal("document") });
|
|
7961
|
+
const spreadsheetMediaSchema = mediaBaseSchema.extend({ type: z.literal("spreadsheet") });
|
|
7962
|
+
const archiveMediaSchema = mediaBaseSchema.extend({ type: z.literal("archive") });
|
|
7963
|
+
const mediaSchema = z.discriminatedUnion("type", [
|
|
7964
|
+
imageMediaSchema,
|
|
7965
|
+
videoMediaSchema,
|
|
7966
|
+
audioMediaSchema,
|
|
7967
|
+
documentMediaSchema,
|
|
7968
|
+
spreadsheetMediaSchema,
|
|
7969
|
+
archiveMediaSchema
|
|
7970
|
+
]);
|
|
7971
|
+
const persistableMediaBaseSchema = mediaBaseSchema.extend({ identifier: mediaIdentifierSchema });
|
|
7972
|
+
z.discriminatedUnion("type", [
|
|
7973
|
+
persistableMediaBaseSchema.extend({ type: z.literal("image") }),
|
|
7974
|
+
persistableMediaBaseSchema.extend({ type: z.literal("video") }),
|
|
7975
|
+
persistableMediaBaseSchema.extend({ type: z.literal("audio") }),
|
|
7976
|
+
persistableMediaBaseSchema.extend({ type: z.literal("document") }),
|
|
7977
|
+
persistableMediaBaseSchema.extend({ type: z.literal("spreadsheet") }),
|
|
7978
|
+
persistableMediaBaseSchema.extend({ type: z.literal("archive") })
|
|
7979
|
+
]);
|
|
7897
7980
|
//#endregion
|
|
7898
7981
|
//#region ../theme-core/src/palette/colors.ts
|
|
7899
7982
|
const HEX_COLOR_REGEX = /^#[0-9a-f]{6}$/;
|
|
@@ -7913,11 +7996,11 @@ const THEME_PALETTE_COLOR_ORDER = [
|
|
|
7913
7996
|
"primaryForeground",
|
|
7914
7997
|
"border"
|
|
7915
7998
|
];
|
|
7916
|
-
const hexColorSchema = z
|
|
7917
|
-
const paletteModeSchema = z
|
|
7999
|
+
const hexColorSchema = z.string().regex(HEX_COLOR_REGEX, "Hex must be #RRGGBB (lowercase)").transform((value) => value);
|
|
8000
|
+
const paletteModeSchema = z.enum(["light", "dark"]);
|
|
7918
8001
|
const PALETTE_VALUE_KEY_PREFIX = "palette-value:v1|";
|
|
7919
|
-
z
|
|
7920
|
-
const paletteColorsSchema = z
|
|
8002
|
+
z.string().regex(/^[0-9a-f]{64}$/, "Palette hash must be a lowercase SHA-256 value").transform((value) => value);
|
|
8003
|
+
const paletteColorsSchema = z.object({
|
|
7921
8004
|
primary: hexColorSchema,
|
|
7922
8005
|
primaryForeground: hexColorSchema,
|
|
7923
8006
|
secondary: hexColorSchema,
|
|
@@ -8023,25 +8106,25 @@ function parsePaletteValueKey(value) {
|
|
|
8023
8106
|
if (!colors.ok || paletteValueKey(colors.colors, mode.data) !== value) return null;
|
|
8024
8107
|
return value;
|
|
8025
8108
|
}
|
|
8026
|
-
z
|
|
8109
|
+
z.string().transform((value, ctx) => {
|
|
8027
8110
|
const parsed = parsePaletteValueKey(value);
|
|
8028
8111
|
if (parsed) return parsed;
|
|
8029
8112
|
ctx.addIssue({
|
|
8030
8113
|
code: "custom",
|
|
8031
8114
|
message: "Invalid canonical palette value key"
|
|
8032
8115
|
});
|
|
8033
|
-
return z
|
|
8116
|
+
return z.NEVER;
|
|
8034
8117
|
});
|
|
8035
8118
|
//#endregion
|
|
8036
8119
|
//#region ../theme-core/src/palette/schema.ts
|
|
8037
|
-
const colourHexString = z
|
|
8038
|
-
const paletteColorSchema = z
|
|
8039
|
-
name: z
|
|
8120
|
+
const colourHexString = z.string().regex(/^#([0-9A-Fa-f]{3}){1,2}$/);
|
|
8121
|
+
const paletteColorSchema = z.object({
|
|
8122
|
+
name: z.string().min(1),
|
|
8040
8123
|
hex: colourHexString
|
|
8041
8124
|
});
|
|
8042
|
-
const paletteMetaSchema = z
|
|
8043
|
-
const paletteSchema = z
|
|
8044
|
-
colors: z
|
|
8125
|
+
const paletteMetaSchema = z.object({ mode: z.enum(["light", "dark"]) });
|
|
8126
|
+
const paletteSchema = z.object({
|
|
8127
|
+
colors: z.array(paletteColorSchema),
|
|
8045
8128
|
meta: paletteMetaSchema
|
|
8046
8129
|
}).transform((palette, ctx) => {
|
|
8047
8130
|
const colors = paletteColorsFromEntries(palette.colors);
|
|
@@ -8050,7 +8133,7 @@ const paletteSchema = z$1.object({
|
|
|
8050
8133
|
code: "custom",
|
|
8051
8134
|
message: `Invalid complete palette: ${colors.error.kind}`
|
|
8052
8135
|
});
|
|
8053
|
-
return z
|
|
8136
|
+
return z.NEVER;
|
|
8054
8137
|
}
|
|
8055
8138
|
return {
|
|
8056
8139
|
colors: paletteColorEntries(colors.colors).map(({ name, hex }) => ({
|
|
@@ -8064,7 +8147,27 @@ const paletteSchema = z$1.object({
|
|
|
8064
8147
|
//#region ../theme-core/src/cards/types.ts
|
|
8065
8148
|
const cardVariantRoleValues = ["default", "alternative"];
|
|
8066
8149
|
const boxlessCardVariantValue = "none";
|
|
8067
|
-
const
|
|
8150
|
+
const openCardRoleValue = "open";
|
|
8151
|
+
/**
|
|
8152
|
+
* The roles a site style implements with an actual card variant. `none` is
|
|
8153
|
+
* deliberately absent: it is a role value only, never a variant.
|
|
8154
|
+
*/
|
|
8155
|
+
const surfaceCardRoleValues = [...cardVariantRoleValues, openCardRoleValue];
|
|
8156
|
+
/**
|
|
8157
|
+
* The closed card-role vocabulary Looks and blocks address cards by — this is
|
|
8158
|
+
* `BoxStylesCardVariant` widened with `open`, not a parallel enum.
|
|
8159
|
+
*
|
|
8160
|
+
* - `none` — no site-style card surface; the block's own composition and
|
|
8161
|
+
* the author's own card fields govern the item. This is *not*
|
|
8162
|
+
* a promise of visible boxlessness: a block whose base class
|
|
8163
|
+
* draws a border still draws one. It says the Look is not
|
|
8164
|
+
* asking the site style for a card.
|
|
8165
|
+
* - `open` — boxless but marked (a rule or accent edge, no enclosing box)
|
|
8166
|
+
* - `default` — the site's quiet everyday card
|
|
8167
|
+
* - `alternative` — the statement card carrying the site's personality
|
|
8168
|
+
*/
|
|
8169
|
+
const cardRoleValues = [...surfaceCardRoleValues, boxlessCardVariantValue];
|
|
8170
|
+
const cardSpacingSchema = z.enum([
|
|
8068
8171
|
"none",
|
|
8069
8172
|
"compact",
|
|
8070
8173
|
"cozy",
|
|
@@ -8072,7 +8175,18 @@ const cardSpacingSchema = z$1.enum([
|
|
|
8072
8175
|
"comfortable",
|
|
8073
8176
|
"spacious"
|
|
8074
8177
|
]);
|
|
8075
|
-
|
|
8178
|
+
/** Per-axis padding, for boxless cards whose inline padding differs from block. */
|
|
8179
|
+
const cardSpacingAxesSchema = z.object({
|
|
8180
|
+
block: cardSpacingSchema,
|
|
8181
|
+
inline: cardSpacingSchema
|
|
8182
|
+
});
|
|
8183
|
+
/**
|
|
8184
|
+
* A card's content padding: one value for both axes, or one per axis. Two
|
|
8185
|
+
* fields would let a variant say both and leave the reader to guess, so this is
|
|
8186
|
+
* a union — the legacy `spacingAxes` key is lifted into it on parse.
|
|
8187
|
+
*/
|
|
8188
|
+
const cardSpacingValueSchema = z.union([cardSpacingSchema, cardSpacingAxesSchema]);
|
|
8189
|
+
const gradientDirectionSchema = z.enum([
|
|
8076
8190
|
"to-r",
|
|
8077
8191
|
"to-l",
|
|
8078
8192
|
"to-t",
|
|
@@ -8082,85 +8196,138 @@ const gradientDirectionSchema = z$1.enum([
|
|
|
8082
8196
|
"to-br",
|
|
8083
8197
|
"to-bl"
|
|
8084
8198
|
]);
|
|
8085
|
-
z
|
|
8086
|
-
const
|
|
8087
|
-
const
|
|
8088
|
-
|
|
8089
|
-
|
|
8199
|
+
z.enum(cardVariantRoleValues);
|
|
8200
|
+
const surfaceCardRoleSchema = z.enum(surfaceCardRoleValues);
|
|
8201
|
+
const cardRoleSchema = z.enum(cardRoleValues);
|
|
8202
|
+
/**
|
|
8203
|
+
* Historical name for the role vocabulary as it reaches box styles. Widened to
|
|
8204
|
+
* the full `CardRole` set — old values keep parsing, `open` now parses too.
|
|
8205
|
+
*/
|
|
8206
|
+
const boxStylesCardVariantSchema = cardRoleSchema;
|
|
8207
|
+
const PRIORITY_ROLE_INFERENCE = {
|
|
8208
|
+
1: "default",
|
|
8209
|
+
2: "alternative"
|
|
8210
|
+
};
|
|
8211
|
+
/**
|
|
8212
|
+
* Role inference for legacy card systems authored before variants carried a
|
|
8213
|
+
* `role`. Priority 1 is the everyday card, priority 2 the statement card —
|
|
8214
|
+
* which is how variants are surfaced today. `open` is never inferred: a site
|
|
8215
|
+
* style has to opt into it.
|
|
8216
|
+
*/
|
|
8217
|
+
function inferCardVariantRoleFromPriority(priority) {
|
|
8218
|
+
return PRIORITY_ROLE_INFERENCE[priority] ?? null;
|
|
8219
|
+
}
|
|
8220
|
+
const cardBackgroundSchema = z.discriminatedUnion("type", [
|
|
8221
|
+
z.object({
|
|
8222
|
+
type: z.literal("solid"),
|
|
8090
8223
|
colorToken: themeColorTokenSchema
|
|
8091
8224
|
}),
|
|
8092
|
-
z
|
|
8093
|
-
type: z
|
|
8225
|
+
z.object({
|
|
8226
|
+
type: z.literal("gradient"),
|
|
8094
8227
|
fromToken: themeColorTokenSchema,
|
|
8095
8228
|
toToken: themeColorTokenSchema,
|
|
8096
8229
|
direction: gradientDirectionSchema
|
|
8097
8230
|
}),
|
|
8098
|
-
z
|
|
8231
|
+
z.object({ type: z.literal("transparent") })
|
|
8099
8232
|
]);
|
|
8100
|
-
const cardBorderSchema = z
|
|
8101
|
-
widthClass: z
|
|
8233
|
+
const cardBorderSchema = z.object({
|
|
8234
|
+
widthClass: z.string(),
|
|
8102
8235
|
colorToken: themeColorTokenSchema
|
|
8103
8236
|
});
|
|
8104
8237
|
/** Per-corner radius value. `expressive` is a large block-radius multiple. */
|
|
8105
|
-
const cardCornerValueSchema = z
|
|
8238
|
+
const cardCornerValueSchema = z.enum([
|
|
8106
8239
|
"square",
|
|
8107
8240
|
"soft",
|
|
8108
8241
|
"rounded",
|
|
8109
8242
|
"pill",
|
|
8110
8243
|
"expressive"
|
|
8111
8244
|
]);
|
|
8245
|
+
const cardEdgeSchema = z.enum([
|
|
8246
|
+
"left",
|
|
8247
|
+
"top",
|
|
8248
|
+
"right",
|
|
8249
|
+
"bottom"
|
|
8250
|
+
]);
|
|
8112
8251
|
/**
|
|
8113
|
-
*
|
|
8114
|
-
*
|
|
8252
|
+
* Legacy single accented card edge (e.g. a left accent bar). Persisted and
|
|
8253
|
+
* curated data may still carry it; it lifts into a one-element `decorations`
|
|
8254
|
+
* list at the parse boundary and has no representation after that.
|
|
8115
8255
|
*/
|
|
8116
|
-
const cardAccentEdgeSchema = z
|
|
8117
|
-
edge:
|
|
8118
|
-
"left",
|
|
8119
|
-
"top",
|
|
8120
|
-
"right",
|
|
8121
|
-
"bottom"
|
|
8122
|
-
]),
|
|
8256
|
+
const cardAccentEdgeSchema = z.object({
|
|
8257
|
+
edge: cardEdgeSchema,
|
|
8123
8258
|
colorToken: themeColorTokenSchema,
|
|
8124
|
-
width: z
|
|
8259
|
+
width: z.enum([
|
|
8125
8260
|
"thin",
|
|
8126
8261
|
"medium",
|
|
8127
8262
|
"thick",
|
|
8128
8263
|
"heavy"
|
|
8129
8264
|
])
|
|
8130
8265
|
});
|
|
8131
|
-
|
|
8266
|
+
/** `hairline` (1px) is the widening the boxless `open` role needs. */
|
|
8267
|
+
const cardEdgeRuleWidthSchema = z.enum([
|
|
8268
|
+
"hairline",
|
|
8269
|
+
"thin",
|
|
8270
|
+
"medium",
|
|
8271
|
+
"thick",
|
|
8272
|
+
"heavy"
|
|
8273
|
+
]);
|
|
8274
|
+
const cardEdgeRuleLengthSchema = z.enum(["full", "short"]);
|
|
8275
|
+
const cardEdgeRuleAlignSchema = z.enum([
|
|
8276
|
+
"start",
|
|
8277
|
+
"center",
|
|
8278
|
+
"end"
|
|
8279
|
+
]);
|
|
8280
|
+
/**
|
|
8281
|
+
* Decorations are edge rules today. The alias exists so the list can grow into
|
|
8282
|
+
* a discriminated union without every call site changing.
|
|
8283
|
+
*/
|
|
8284
|
+
const cardDecorationSchema = z.object({
|
|
8285
|
+
edge: cardEdgeSchema,
|
|
8286
|
+
colorToken: themeColorTokenSchema,
|
|
8287
|
+
width: cardEdgeRuleWidthSchema,
|
|
8288
|
+
/** Defaults to `full`. */
|
|
8289
|
+
length: cardEdgeRuleLengthSchema.optional(),
|
|
8290
|
+
/** Where a `short` rule sits along its edge. Defaults to `start`. */
|
|
8291
|
+
align: cardEdgeRuleAlignSchema.optional(),
|
|
8292
|
+
/** Opacity applied to `colorToken`, 0–1. Scoped here, not on the token. */
|
|
8293
|
+
alpha: z.number().min(0).max(1).optional()
|
|
8294
|
+
});
|
|
8295
|
+
const cardDecorationsSchema = z.array(cardDecorationSchema).max(2);
|
|
8296
|
+
const cardCornerRadiiSchema = z.object({
|
|
8132
8297
|
topLeft: cardCornerValueSchema.optional(),
|
|
8133
8298
|
topRight: cardCornerValueSchema.optional(),
|
|
8134
8299
|
bottomLeft: cardCornerValueSchema.optional(),
|
|
8135
8300
|
bottomRight: cardCornerValueSchema.optional()
|
|
8136
8301
|
});
|
|
8137
|
-
const
|
|
8138
|
-
id: z
|
|
8139
|
-
name: z
|
|
8140
|
-
enabled: z
|
|
8141
|
-
priority: z
|
|
8142
|
-
z
|
|
8143
|
-
z
|
|
8144
|
-
z
|
|
8302
|
+
const cardVariantInputSchema = z.object({
|
|
8303
|
+
id: z.string(),
|
|
8304
|
+
name: z.string().min(1).max(20),
|
|
8305
|
+
enabled: z.boolean(),
|
|
8306
|
+
priority: z.union([
|
|
8307
|
+
z.literal(1),
|
|
8308
|
+
z.literal(2),
|
|
8309
|
+
z.literal(3)
|
|
8145
8310
|
]),
|
|
8311
|
+
role: surfaceCardRoleSchema.optional(),
|
|
8146
8312
|
background: cardBackgroundSchema,
|
|
8147
|
-
spacing:
|
|
8313
|
+
spacing: cardSpacingValueSchema,
|
|
8314
|
+
spacingAxes: cardSpacingAxesSchema.optional(),
|
|
8148
8315
|
foregroundToken: themeColorTokenSchema.optional(),
|
|
8149
|
-
shadow: z
|
|
8150
|
-
elevation: z
|
|
8316
|
+
shadow: z.object({
|
|
8317
|
+
elevation: z.enum([
|
|
8151
8318
|
"none",
|
|
8152
8319
|
"low",
|
|
8153
8320
|
"medium",
|
|
8154
8321
|
"high"
|
|
8155
8322
|
]),
|
|
8156
|
-
softness: z
|
|
8323
|
+
softness: z.enum([
|
|
8157
8324
|
"crisp",
|
|
8158
8325
|
"soft",
|
|
8159
8326
|
"hard"
|
|
8160
8327
|
]).nullable(),
|
|
8161
|
-
position: z
|
|
8328
|
+
position: z.enum(["bottom", "bottom-right"]).default("bottom")
|
|
8162
8329
|
}).optional(),
|
|
8163
|
-
corners: z
|
|
8330
|
+
corners: z.enum([
|
|
8164
8331
|
"square",
|
|
8165
8332
|
"soft",
|
|
8166
8333
|
"rounded",
|
|
@@ -8168,15 +8335,97 @@ const cardVariantSchema = z$1.object({
|
|
|
8168
8335
|
]).optional(),
|
|
8169
8336
|
cornerRadii: cardCornerRadiiSchema.optional(),
|
|
8170
8337
|
border: cardBorderSchema.optional(),
|
|
8338
|
+
decorations: cardDecorationsSchema.optional(),
|
|
8171
8339
|
accentEdge: cardAccentEdgeSchema.optional()
|
|
8172
8340
|
});
|
|
8173
|
-
|
|
8341
|
+
/**
|
|
8342
|
+
* Lift a legacy `accentEdge` into the decoration list. The old emitter reset
|
|
8343
|
+
* `border: 0` implicitly whenever an accent edge was present; conversion drops
|
|
8344
|
+
* the border instead, so the output is unchanged and the data says so.
|
|
8345
|
+
*/
|
|
8346
|
+
function normalizeLegacyAccentEdge(variant) {
|
|
8347
|
+
const { accentEdge, ...rest } = normalizeLegacySpacingAxes(variant);
|
|
8348
|
+
if (!accentEdge) return rest;
|
|
8349
|
+
const { border: _droppedByAccentEdgeReset, ...withoutBorder } = rest;
|
|
8350
|
+
return {
|
|
8351
|
+
...withoutBorder,
|
|
8352
|
+
decorations: [{
|
|
8353
|
+
...accentEdge,
|
|
8354
|
+
length: "full"
|
|
8355
|
+
}]
|
|
8356
|
+
};
|
|
8357
|
+
}
|
|
8358
|
+
/**
|
|
8359
|
+
* Lift a legacy `spacingAxes` into `spacing`. It always won over the flat value
|
|
8360
|
+
* when both were set, so the lift preserves the emitted padding exactly.
|
|
8361
|
+
*/
|
|
8362
|
+
function normalizeLegacySpacingAxes(variant) {
|
|
8363
|
+
const { spacingAxes, ...rest } = variant;
|
|
8364
|
+
return spacingAxes ? {
|
|
8365
|
+
...rest,
|
|
8366
|
+
spacing: spacingAxes
|
|
8367
|
+
} : variant;
|
|
8368
|
+
}
|
|
8369
|
+
function validateSingleDecorationSource(variant, ctx) {
|
|
8370
|
+
if (!variant.accentEdge || !variant.decorations) return;
|
|
8371
|
+
ctx.addIssue({
|
|
8372
|
+
code: "custom",
|
|
8373
|
+
path: ["decorations"],
|
|
8374
|
+
message: "A card variant carries either the legacy `accentEdge` or `decorations`, never both."
|
|
8375
|
+
});
|
|
8376
|
+
}
|
|
8377
|
+
const cardVariantSchema = cardVariantInputSchema.superRefine(validateSingleDecorationSource).transform(normalizeLegacyAccentEdge);
|
|
8378
|
+
/**
|
|
8379
|
+
* Fill in roles for legacy systems whose variants declare none. Inference is
|
|
8380
|
+
* collision-tolerant on purpose: first claimant wins and a later variant that
|
|
8381
|
+
* would infer a taken role simply gets no role. Legacy data is not obliged to
|
|
8382
|
+
* be well-formed, and a card system that fails to parse takes the whole theme
|
|
8383
|
+
* down with it.
|
|
8384
|
+
*/
|
|
8385
|
+
function withInferredRoles(variants) {
|
|
8386
|
+
const claimed = new Set(variants.flatMap((variant) => variant.role ? [variant.role] : []));
|
|
8387
|
+
return variants.map((variant) => {
|
|
8388
|
+
if (variant.role) return variant;
|
|
8389
|
+
const inferred = inferCardVariantRoleFromPriority(variant.priority);
|
|
8390
|
+
if (!inferred || claimed.has(inferred)) return variant;
|
|
8391
|
+
claimed.add(inferred);
|
|
8392
|
+
return {
|
|
8393
|
+
...variant,
|
|
8394
|
+
role: inferred
|
|
8395
|
+
};
|
|
8396
|
+
});
|
|
8397
|
+
}
|
|
8398
|
+
/**
|
|
8399
|
+
* Only *declared* roles are validated — a site style saying "these two
|
|
8400
|
+
* variants are both the default card" is an authoring error worth rejecting.
|
|
8401
|
+
*/
|
|
8402
|
+
function validateUniqueDeclaredCardVariantRoles(system, ctx) {
|
|
8403
|
+
const declared = /* @__PURE__ */ new Set();
|
|
8404
|
+
system.variants.forEach((variant, index) => {
|
|
8405
|
+
const role = variant.role;
|
|
8406
|
+
if (!role) return;
|
|
8407
|
+
if (declared.has(role)) {
|
|
8408
|
+
ctx.addIssue({
|
|
8409
|
+
code: "custom",
|
|
8410
|
+
path: [
|
|
8411
|
+
"variants",
|
|
8412
|
+
index,
|
|
8413
|
+
"role"
|
|
8414
|
+
],
|
|
8415
|
+
message: `Card role "${role}" is already implemented by another variant.`
|
|
8416
|
+
});
|
|
8417
|
+
return;
|
|
8418
|
+
}
|
|
8419
|
+
declared.add(role);
|
|
8420
|
+
});
|
|
8421
|
+
}
|
|
8422
|
+
const cardSystemSchema = z.object({ variants: z.array(cardVariantSchema).min(1).max(3) }).superRefine(validateUniqueDeclaredCardVariantRoles).transform((system) => ({ variants: withInferredRoles(system.variants) }));
|
|
8174
8423
|
//#endregion
|
|
8175
8424
|
//#region ../theme-core/src/accordions/types.ts
|
|
8176
8425
|
/**
|
|
8177
8426
|
* Accordion icon styles for expand/collapse indicators
|
|
8178
8427
|
*/
|
|
8179
|
-
const accordionIconSchema = z
|
|
8428
|
+
const accordionIconSchema = z.enum([
|
|
8180
8429
|
"plus-minus",
|
|
8181
8430
|
"chevron",
|
|
8182
8431
|
"caret",
|
|
@@ -8187,12 +8436,12 @@ const accordionIconSchema = z$1.enum([
|
|
|
8187
8436
|
* Accordion configuration for a theme
|
|
8188
8437
|
* Single style per theme (no variants needed)
|
|
8189
8438
|
*/
|
|
8190
|
-
const accordionSystemSchema = z
|
|
8191
|
-
background: z
|
|
8192
|
-
type: z
|
|
8439
|
+
const accordionSystemSchema = z.object({
|
|
8440
|
+
background: z.object({
|
|
8441
|
+
type: z.literal("solid"),
|
|
8193
8442
|
colorToken: themeColorTokenSchema
|
|
8194
8443
|
}).nullable(),
|
|
8195
|
-
spacing: z
|
|
8444
|
+
spacing: z.enum([
|
|
8196
8445
|
"none",
|
|
8197
8446
|
"compact",
|
|
8198
8447
|
"cozy",
|
|
@@ -8200,84 +8449,84 @@ const accordionSystemSchema = z$1.object({
|
|
|
8200
8449
|
"comfortable",
|
|
8201
8450
|
"spacious"
|
|
8202
8451
|
]),
|
|
8203
|
-
corners: z
|
|
8452
|
+
corners: z.enum([
|
|
8204
8453
|
"square",
|
|
8205
8454
|
"soft",
|
|
8206
8455
|
"rounded",
|
|
8207
8456
|
"pill"
|
|
8208
8457
|
]).nullable(),
|
|
8209
|
-
border: z
|
|
8210
|
-
widthClass: z
|
|
8458
|
+
border: z.object({
|
|
8459
|
+
widthClass: z.string(),
|
|
8211
8460
|
colorToken: themeColorTokenSchema
|
|
8212
8461
|
}).nullable(),
|
|
8213
|
-
shadow: z
|
|
8214
|
-
elevation: z
|
|
8462
|
+
shadow: z.object({
|
|
8463
|
+
elevation: z.enum([
|
|
8215
8464
|
"none",
|
|
8216
8465
|
"low",
|
|
8217
8466
|
"medium",
|
|
8218
8467
|
"high"
|
|
8219
8468
|
]),
|
|
8220
|
-
softness: z
|
|
8469
|
+
softness: z.enum([
|
|
8221
8470
|
"soft",
|
|
8222
8471
|
"crisp",
|
|
8223
8472
|
"hard"
|
|
8224
8473
|
]).nullable(),
|
|
8225
|
-
position: z
|
|
8474
|
+
position: z.enum(["bottom", "bottom-right"])
|
|
8226
8475
|
}).nullable(),
|
|
8227
|
-
icon: z
|
|
8476
|
+
icon: z.object({
|
|
8228
8477
|
style: accordionIconSchema,
|
|
8229
|
-
position: z
|
|
8230
|
-
size: z
|
|
8478
|
+
position: z.enum(["left", "right"]),
|
|
8479
|
+
size: z.enum([
|
|
8231
8480
|
"sm",
|
|
8232
8481
|
"md",
|
|
8233
8482
|
"lg"
|
|
8234
8483
|
]),
|
|
8235
8484
|
colorToken: themeColorTokenSchema.optional()
|
|
8236
8485
|
}),
|
|
8237
|
-
trigger: z
|
|
8486
|
+
trigger: z.object({
|
|
8238
8487
|
textColorToken: themeColorTokenSchema,
|
|
8239
|
-
fontWeight: z
|
|
8488
|
+
fontWeight: z.enum([
|
|
8240
8489
|
"regular",
|
|
8241
8490
|
"medium",
|
|
8242
8491
|
"semibold",
|
|
8243
8492
|
"bold"
|
|
8244
8493
|
]).nullable(),
|
|
8245
|
-
fontFamily: z
|
|
8246
|
-
fontScale: z
|
|
8494
|
+
fontFamily: z.enum(["body", "heading"]).optional(),
|
|
8495
|
+
fontScale: z.enum([
|
|
8247
8496
|
"body",
|
|
8248
8497
|
"md",
|
|
8249
8498
|
"lg"
|
|
8250
8499
|
]).optional(),
|
|
8251
|
-
letterSpacing: z
|
|
8500
|
+
letterSpacing: z.enum([
|
|
8252
8501
|
"normal",
|
|
8253
8502
|
"tight",
|
|
8254
8503
|
"wide"
|
|
8255
8504
|
]).optional(),
|
|
8256
|
-
textTransform: z
|
|
8505
|
+
textTransform: z.enum(["none", "uppercase"]).optional()
|
|
8257
8506
|
}),
|
|
8258
|
-
hover: z
|
|
8507
|
+
hover: z.object({
|
|
8259
8508
|
backgroundColorToken: themeColorTokenSchema.optional(),
|
|
8260
8509
|
textColorToken: themeColorTokenSchema.optional(),
|
|
8261
8510
|
borderColorToken: themeColorTokenSchema.optional()
|
|
8262
8511
|
}),
|
|
8263
|
-
openState: z
|
|
8512
|
+
openState: z.object({
|
|
8264
8513
|
backgroundColorToken: themeColorTokenSchema.optional(),
|
|
8265
8514
|
triggerColorToken: themeColorTokenSchema.optional(),
|
|
8266
|
-
accent: z
|
|
8267
|
-
edge: z
|
|
8515
|
+
accent: z.object({
|
|
8516
|
+
edge: z.enum([
|
|
8268
8517
|
"left",
|
|
8269
8518
|
"top",
|
|
8270
8519
|
"bottom"
|
|
8271
8520
|
]),
|
|
8272
8521
|
colorToken: themeColorTokenSchema,
|
|
8273
|
-
thickness: z
|
|
8522
|
+
thickness: z.enum([
|
|
8274
8523
|
"thin",
|
|
8275
8524
|
"medium",
|
|
8276
8525
|
"thick"
|
|
8277
8526
|
])
|
|
8278
8527
|
}).optional()
|
|
8279
8528
|
}).optional(),
|
|
8280
|
-
content: z
|
|
8529
|
+
content: z.object({ textColorToken: themeColorTokenSchema })
|
|
8281
8530
|
});
|
|
8282
8531
|
//#endregion
|
|
8283
8532
|
//#region ../theme-core/src/inputs/types.ts
|
|
@@ -8291,80 +8540,80 @@ const accordionSystemSchema = z$1.object({
|
|
|
8291
8540
|
*
|
|
8292
8541
|
* Single configuration per theme (no variants needed for inputs)
|
|
8293
8542
|
*/
|
|
8294
|
-
const inputSystemSchema = z
|
|
8295
|
-
base: z
|
|
8296
|
-
background: z
|
|
8297
|
-
type: z
|
|
8543
|
+
const inputSystemSchema = z.object({
|
|
8544
|
+
base: z.object({
|
|
8545
|
+
background: z.union([z.object({
|
|
8546
|
+
type: z.literal("solid"),
|
|
8298
8547
|
colorToken: themeColorTokenSchema
|
|
8299
|
-
}), z
|
|
8548
|
+
}), z.object({ type: z.literal("transparent") })]),
|
|
8300
8549
|
textColorToken: themeColorTokenSchema,
|
|
8301
|
-
border: z
|
|
8302
|
-
widthClass: z
|
|
8550
|
+
border: z.object({
|
|
8551
|
+
widthClass: z.string(),
|
|
8303
8552
|
colorToken: themeColorTokenSchema,
|
|
8304
|
-
style: z
|
|
8553
|
+
style: z.enum(["all", "underline"]).optional()
|
|
8305
8554
|
}),
|
|
8306
|
-
corners: z
|
|
8555
|
+
corners: z.enum([
|
|
8307
8556
|
"square",
|
|
8308
8557
|
"soft",
|
|
8309
8558
|
"rounded",
|
|
8310
8559
|
"pill"
|
|
8311
8560
|
]).nullable(),
|
|
8312
|
-
shadow: z
|
|
8313
|
-
elevation: z
|
|
8561
|
+
shadow: z.object({
|
|
8562
|
+
elevation: z.enum([
|
|
8314
8563
|
"none",
|
|
8315
8564
|
"low",
|
|
8316
8565
|
"medium"
|
|
8317
8566
|
]),
|
|
8318
|
-
softness: z
|
|
8567
|
+
softness: z.enum([
|
|
8319
8568
|
"soft",
|
|
8320
8569
|
"crisp",
|
|
8321
8570
|
"hard"
|
|
8322
8571
|
]).nullable()
|
|
8323
8572
|
}).nullable(),
|
|
8324
|
-
spacing: z
|
|
8573
|
+
spacing: z.enum([
|
|
8325
8574
|
"compact",
|
|
8326
8575
|
"cozy",
|
|
8327
8576
|
"medium",
|
|
8328
8577
|
"comfortable"
|
|
8329
8578
|
]),
|
|
8330
|
-
fontSize: z
|
|
8579
|
+
fontSize: z.enum([
|
|
8331
8580
|
"sm",
|
|
8332
8581
|
"base",
|
|
8333
8582
|
"lg"
|
|
8334
8583
|
])
|
|
8335
8584
|
}),
|
|
8336
|
-
label: z
|
|
8585
|
+
label: z.object({
|
|
8337
8586
|
textColorToken: themeColorTokenSchema,
|
|
8338
|
-
fontWeight: z
|
|
8587
|
+
fontWeight: z.enum([
|
|
8339
8588
|
"regular",
|
|
8340
8589
|
"medium",
|
|
8341
8590
|
"semibold",
|
|
8342
8591
|
"bold",
|
|
8343
8592
|
"black"
|
|
8344
8593
|
]),
|
|
8345
|
-
fontSize: z
|
|
8594
|
+
fontSize: z.enum([
|
|
8346
8595
|
"2xs",
|
|
8347
8596
|
"xs",
|
|
8348
8597
|
"sm",
|
|
8349
8598
|
"base"
|
|
8350
8599
|
]),
|
|
8351
|
-
textTransform: z
|
|
8600
|
+
textTransform: z.enum([
|
|
8352
8601
|
"none",
|
|
8353
8602
|
"uppercase",
|
|
8354
8603
|
"lowercase",
|
|
8355
8604
|
"capitalize"
|
|
8356
8605
|
]).optional(),
|
|
8357
|
-
letterSpacing: z
|
|
8606
|
+
letterSpacing: z.enum([
|
|
8358
8607
|
"normal",
|
|
8359
8608
|
"wide",
|
|
8360
8609
|
"wider",
|
|
8361
8610
|
"widest"
|
|
8362
8611
|
]).optional(),
|
|
8363
|
-
opacity: z
|
|
8612
|
+
opacity: z.number().min(.2).max(1).optional()
|
|
8364
8613
|
}),
|
|
8365
|
-
focus: z
|
|
8614
|
+
focus: z.object({
|
|
8366
8615
|
ringColorToken: themeColorTokenSchema,
|
|
8367
|
-
ringWidth: z
|
|
8616
|
+
ringWidth: z.enum([
|
|
8368
8617
|
"0",
|
|
8369
8618
|
"1",
|
|
8370
8619
|
"2",
|
|
@@ -8372,14 +8621,14 @@ const inputSystemSchema = z$1.object({
|
|
|
8372
8621
|
]),
|
|
8373
8622
|
borderColorToken: themeColorTokenSchema.optional()
|
|
8374
8623
|
}),
|
|
8375
|
-
error: z
|
|
8624
|
+
error: z.object({
|
|
8376
8625
|
borderColorToken: themeColorTokenSchema,
|
|
8377
8626
|
textColorToken: themeColorTokenSchema
|
|
8378
8627
|
}),
|
|
8379
|
-
disabled: z
|
|
8628
|
+
disabled: z.object({
|
|
8380
8629
|
backgroundColorToken: themeColorTokenSchema,
|
|
8381
8630
|
textColorToken: themeColorTokenSchema,
|
|
8382
|
-
opacity: z
|
|
8631
|
+
opacity: z.number().min(.3).max(.7)
|
|
8383
8632
|
})
|
|
8384
8633
|
});
|
|
8385
8634
|
//#endregion
|
|
@@ -8390,9 +8639,9 @@ const inputSystemSchema = z$1.object({
|
|
|
8390
8639
|
/**
|
|
8391
8640
|
* Gradient color stop
|
|
8392
8641
|
*/
|
|
8393
|
-
const gradientStopSchema = z
|
|
8642
|
+
const gradientStopSchema = z.object({
|
|
8394
8643
|
color: themeColorTokenSchema,
|
|
8395
|
-
position: z
|
|
8644
|
+
position: z.number().min(0).max(100)
|
|
8396
8645
|
});
|
|
8397
8646
|
/**
|
|
8398
8647
|
* Radial gradient shape. Optional; defaults to `circle` (the historical shape)
|
|
@@ -8401,7 +8650,7 @@ const gradientStopSchema = z$1.object({
|
|
|
8401
8650
|
* Named `RadialGradientShape` to avoid clashing with `styles/gradients.ts`'s
|
|
8402
8651
|
* `GradientShape` (which names the gradient *kind*: linear/radial/conic).
|
|
8403
8652
|
*/
|
|
8404
|
-
const radialGradientShapeSchema = z
|
|
8653
|
+
const radialGradientShapeSchema = z.enum(["circle", "ellipse"]);
|
|
8405
8654
|
/**
|
|
8406
8655
|
* Gradient configuration.
|
|
8407
8656
|
*
|
|
@@ -8412,16 +8661,16 @@ const radialGradientShapeSchema = z$1.enum(["circle", "ellipse"]);
|
|
|
8412
8661
|
* - radial: optional `shape` (circle/ellipse) + `position`
|
|
8413
8662
|
* - conic: optional `angle` (from-angle, degrees) + `position`
|
|
8414
8663
|
*/
|
|
8415
|
-
const gradientConfigSchema = z
|
|
8416
|
-
type: z
|
|
8664
|
+
const gradientConfigSchema = z.object({
|
|
8665
|
+
type: z.enum([
|
|
8417
8666
|
"linear",
|
|
8418
8667
|
"radial",
|
|
8419
8668
|
"conic"
|
|
8420
8669
|
]).default("linear"),
|
|
8421
|
-
angle: z
|
|
8670
|
+
angle: z.number().min(0).max(360).optional(),
|
|
8422
8671
|
shape: radialGradientShapeSchema.optional(),
|
|
8423
|
-
position: z
|
|
8424
|
-
stops: z
|
|
8672
|
+
position: z.string().optional(),
|
|
8673
|
+
stops: z.array(gradientStopSchema).min(2)
|
|
8425
8674
|
});
|
|
8426
8675
|
//#endregion
|
|
8427
8676
|
//#region ../theme-core/src/interactive/baseSchema.ts
|
|
@@ -8433,46 +8682,46 @@ const gradientConfigSchema = z$1.object({
|
|
|
8433
8682
|
/**
|
|
8434
8683
|
* Typography settings shared by buttons and nav links
|
|
8435
8684
|
*/
|
|
8436
|
-
const interactiveTypographySchema = z
|
|
8685
|
+
const interactiveTypographySchema = z.object({
|
|
8437
8686
|
/** Font family source */
|
|
8438
|
-
typography: z
|
|
8687
|
+
typography: z.enum(["body", "heading"]).default("body"),
|
|
8439
8688
|
/** Font weight */
|
|
8440
|
-
fontWeight: z
|
|
8689
|
+
fontWeight: z.enum([
|
|
8441
8690
|
"regular",
|
|
8442
8691
|
"medium",
|
|
8443
8692
|
"semibold",
|
|
8444
8693
|
"bold"
|
|
8445
8694
|
]).default("medium"),
|
|
8446
8695
|
/** Text transform */
|
|
8447
|
-
textTransform: z
|
|
8696
|
+
textTransform: z.enum([
|
|
8448
8697
|
"none",
|
|
8449
8698
|
"uppercase",
|
|
8450
8699
|
"capitalize"
|
|
8451
8700
|
]).default("none"),
|
|
8452
8701
|
/** Italic style */
|
|
8453
|
-
italic: z
|
|
8702
|
+
italic: z.boolean().default(false)
|
|
8454
8703
|
});
|
|
8455
8704
|
/**
|
|
8456
8705
|
* Effect application reference (shared between buttons and nav)
|
|
8457
8706
|
*/
|
|
8458
|
-
const effectApplicationSchema = z
|
|
8707
|
+
const effectApplicationSchema = z.object({
|
|
8459
8708
|
/** Effect preset ID */
|
|
8460
|
-
effectId: z
|
|
8709
|
+
effectId: z.string(),
|
|
8461
8710
|
/** User-provided customization options */
|
|
8462
|
-
options: z
|
|
8711
|
+
options: z.record(z.string(), z.any()).optional()
|
|
8463
8712
|
});
|
|
8464
8713
|
/**
|
|
8465
8714
|
* Effect composition by state (shared pattern)
|
|
8466
8715
|
*/
|
|
8467
|
-
const effectCompositionSchema = z
|
|
8716
|
+
const effectCompositionSchema = z.object({
|
|
8468
8717
|
/** Effects always applied */
|
|
8469
|
-
base: z
|
|
8718
|
+
base: z.array(effectApplicationSchema).optional(),
|
|
8470
8719
|
/** Effects applied on hover */
|
|
8471
|
-
hover: z
|
|
8720
|
+
hover: z.array(effectApplicationSchema).optional(),
|
|
8472
8721
|
/** Effects applied on active/pressed */
|
|
8473
|
-
active: z
|
|
8722
|
+
active: z.array(effectApplicationSchema).optional(),
|
|
8474
8723
|
/** Effects applied on focus */
|
|
8475
|
-
focus: z
|
|
8724
|
+
focus: z.array(effectApplicationSchema).optional()
|
|
8476
8725
|
});
|
|
8477
8726
|
//#endregion
|
|
8478
8727
|
//#region ../theme-core/src/navigation/types.ts
|
|
@@ -8484,7 +8733,7 @@ const effectCompositionSchema = z$1.object({
|
|
|
8484
8733
|
/**
|
|
8485
8734
|
* Padding preset options for nav links
|
|
8486
8735
|
*/
|
|
8487
|
-
const navLinkPaddingSchema = z
|
|
8736
|
+
const navLinkPaddingSchema = z.enum([
|
|
8488
8737
|
"none",
|
|
8489
8738
|
"compact",
|
|
8490
8739
|
"default"
|
|
@@ -8493,7 +8742,7 @@ const navLinkPaddingSchema = z$1.enum([
|
|
|
8493
8742
|
* Horizontal padding override for nav links.
|
|
8494
8743
|
* When set, overrides only the horizontal component of the `padding` preset.
|
|
8495
8744
|
*/
|
|
8496
|
-
const navLinkPaddingXSchema = z
|
|
8745
|
+
const navLinkPaddingXSchema = z.enum([
|
|
8497
8746
|
"none",
|
|
8498
8747
|
"tight",
|
|
8499
8748
|
"compact",
|
|
@@ -8504,7 +8753,7 @@ const navLinkPaddingXSchema = z$1.enum([
|
|
|
8504
8753
|
/**
|
|
8505
8754
|
* Border radius options for nav links
|
|
8506
8755
|
*/
|
|
8507
|
-
const navLinkBorderRadiusSchema = z
|
|
8756
|
+
const navLinkBorderRadiusSchema = z.enum([
|
|
8508
8757
|
"none",
|
|
8509
8758
|
"sm",
|
|
8510
8759
|
"md",
|
|
@@ -8513,7 +8762,7 @@ const navLinkBorderRadiusSchema = z$1.enum([
|
|
|
8513
8762
|
/**
|
|
8514
8763
|
* Typography size options for nav links.
|
|
8515
8764
|
*/
|
|
8516
|
-
const navLinkTextSizeSchema = z
|
|
8765
|
+
const navLinkTextSizeSchema = z.enum([
|
|
8517
8766
|
"xs",
|
|
8518
8767
|
"sm",
|
|
8519
8768
|
"base",
|
|
@@ -8523,7 +8772,7 @@ const navLinkTextSizeSchema = z$1.enum([
|
|
|
8523
8772
|
/**
|
|
8524
8773
|
* Letter spacing options for nav links.
|
|
8525
8774
|
*/
|
|
8526
|
-
const navLinkLetterSpacingSchema = z
|
|
8775
|
+
const navLinkLetterSpacingSchema = z.enum([
|
|
8527
8776
|
"normal",
|
|
8528
8777
|
"wide",
|
|
8529
8778
|
"wider",
|
|
@@ -8532,15 +8781,15 @@ const navLinkLetterSpacingSchema = z$1.enum([
|
|
|
8532
8781
|
/**
|
|
8533
8782
|
* Optional legibility aid for nav text that floats over uncertain imagery or color.
|
|
8534
8783
|
*/
|
|
8535
|
-
const navLinkContrastTreatmentSchema = z
|
|
8784
|
+
const navLinkContrastTreatmentSchema = z.enum(["none", "soft-glow"]);
|
|
8536
8785
|
/**
|
|
8537
8786
|
* Nav link style schema
|
|
8538
8787
|
*
|
|
8539
8788
|
* Extends interactive typography base with nav-specific settings.
|
|
8540
8789
|
*/
|
|
8541
|
-
const navLinkStyleSchema = z
|
|
8790
|
+
const navLinkStyleSchema = z.object({
|
|
8542
8791
|
/** Display name for the style */
|
|
8543
|
-
name: z
|
|
8792
|
+
name: z.string().min(1).max(30).optional(),
|
|
8544
8793
|
/** Typography settings (inherited from interactive base) */
|
|
8545
8794
|
...interactiveTypographySchema.shape,
|
|
8546
8795
|
/** Text color token */
|
|
@@ -8625,7 +8874,7 @@ function containsForbiddenSelector(selector) {
|
|
|
8625
8874
|
/**
|
|
8626
8875
|
* Validates a CSS selector for safety.
|
|
8627
8876
|
*/
|
|
8628
|
-
const selectorSchema = z
|
|
8877
|
+
const selectorSchema = z.string().min(1, "Selector cannot be empty").max(200, "Selector too long (max 200 characters)").refine((s) => !containsForbiddenSelector(s), { message: "Global selectors (:root, html, body, *) are not allowed" });
|
|
8629
8878
|
/**
|
|
8630
8879
|
* Check if a CSS value contains a remote URL.
|
|
8631
8880
|
*/
|
|
@@ -8643,31 +8892,31 @@ function containsJavascriptUrl(value) {
|
|
|
8643
8892
|
* Allows: url(#id), url(data:...), url(/path), var(--)
|
|
8644
8893
|
* Forbids: url(http...), url(//...), javascript:
|
|
8645
8894
|
*/
|
|
8646
|
-
const declarationValueSchema = z
|
|
8895
|
+
const declarationValueSchema = z.string().max(500, "Declaration value too long (max 500 characters)").refine((v) => !containsRemoteUrl(v), { message: "Remote url() references are not allowed. Use local paths, data URIs, or fragment IDs." }).refine((v) => !containsJavascriptUrl(v), { message: "javascript: URLs are not allowed" });
|
|
8647
8896
|
/**
|
|
8648
8897
|
* Schema for CSS declarations object (property -> value map).
|
|
8649
8898
|
*/
|
|
8650
|
-
const declarationsSchema = z
|
|
8899
|
+
const declarationsSchema = z.record(z.string().min(1).max(100), declarationValueSchema);
|
|
8651
8900
|
/**
|
|
8652
8901
|
* Schema for a single custom CSS rule.
|
|
8653
8902
|
*/
|
|
8654
|
-
const customCssRuleSchema = z
|
|
8655
|
-
id: z
|
|
8903
|
+
const customCssRuleSchema = z.object({
|
|
8904
|
+
id: z.string().min(1, "Rule ID is required").max(50, "Rule ID too long"),
|
|
8656
8905
|
selector: selectorSchema,
|
|
8657
8906
|
declarations: declarationsSchema
|
|
8658
8907
|
});
|
|
8659
8908
|
/**
|
|
8660
8909
|
* Schema for block-specific CSS rule.
|
|
8661
8910
|
*/
|
|
8662
|
-
const blockCustomCssRuleSchema = customCssRuleSchema.extend({ blockKind: z
|
|
8911
|
+
const blockCustomCssRuleSchema = customCssRuleSchema.extend({ blockKind: z.string().min(1, "Block kind is required").max(50, "Block kind too long") });
|
|
8663
8912
|
/**
|
|
8664
8913
|
* Array of custom CSS rules for theme-level styling.
|
|
8665
8914
|
*/
|
|
8666
|
-
const customCssRulesSchema = z
|
|
8915
|
+
const customCssRulesSchema = z.array(customCssRuleSchema).optional();
|
|
8667
8916
|
/**
|
|
8668
8917
|
* Array of block-specific CSS rules.
|
|
8669
8918
|
*/
|
|
8670
|
-
const blockCustomCssRulesSchema = z
|
|
8919
|
+
const blockCustomCssRulesSchema = z.array(blockCustomCssRuleSchema).optional();
|
|
8671
8920
|
//#endregion
|
|
8672
8921
|
//#region ../theme-core/src/customCss/atRuleValidation.ts
|
|
8673
8922
|
/**
|
|
@@ -8685,9 +8934,9 @@ const BLOCKED_AT_RULES = ["@import", "@charset"];
|
|
|
8685
8934
|
/** Pattern to detect blocked at-rules */
|
|
8686
8935
|
const BLOCKED_AT_RULE_PATTERN = /@(?:import|charset)\b/i;
|
|
8687
8936
|
/** Rule ID schema - reused from main validation */
|
|
8688
|
-
const ruleIdSchema = z
|
|
8937
|
+
const ruleIdSchema = z.string().min(1, "Rule ID is required").max(50, "Rule ID too long");
|
|
8689
8938
|
/** Nested rule schema for @media and @supports */
|
|
8690
|
-
const nestedRuleSchema = z
|
|
8939
|
+
const nestedRuleSchema = z.object({
|
|
8691
8940
|
selector: selectorSchema,
|
|
8692
8941
|
declarations: declarationsSchema
|
|
8693
8942
|
});
|
|
@@ -8704,46 +8953,46 @@ function isValidKeyframeOffset(offset) {
|
|
|
8704
8953
|
return value >= 0 && value <= 100;
|
|
8705
8954
|
}
|
|
8706
8955
|
/** Keyframe offset validation (0%, 50%, 100%, from, to) */
|
|
8707
|
-
const keyframeOffsetSchema = z
|
|
8956
|
+
const keyframeOffsetSchema = z.string().transform((offset) => offset.trim()).refine((offset) => KEYFRAME_OFFSET_PATTERN.test(offset), { message: "Invalid keyframe offset. Use percentages (0%, 50%, 100%) or \"from\"/\"to\"" }).refine(isValidKeyframeOffset, { message: "Keyframe offset must be between 0% and 100%" });
|
|
8708
8957
|
/** Animation name validation (CSS identifier) */
|
|
8709
|
-
const animationNameSchema = z
|
|
8958
|
+
const animationNameSchema = z.string().min(1, "Animation name is required").max(50, "Animation name too long").refine((name) => ANIMATION_NAME_PATTERN.test(name), { message: "Invalid animation name. Use letters, numbers, dashes, underscores (start with letter, dash, or underscore)" });
|
|
8710
8959
|
/** Single keyframe (offset + declarations) */
|
|
8711
|
-
const keyframeSchema = z
|
|
8960
|
+
const keyframeSchema = z.object({
|
|
8712
8961
|
offset: keyframeOffsetSchema,
|
|
8713
8962
|
declarations: declarationsSchema
|
|
8714
8963
|
});
|
|
8715
8964
|
/** @keyframes rule schema */
|
|
8716
|
-
const keyframesAtRuleSchema = z
|
|
8965
|
+
const keyframesAtRuleSchema = z.object({
|
|
8717
8966
|
id: ruleIdSchema,
|
|
8718
|
-
type: z
|
|
8967
|
+
type: z.literal("keyframes"),
|
|
8719
8968
|
name: animationNameSchema,
|
|
8720
|
-
frames: z
|
|
8969
|
+
frames: z.array(keyframeSchema).min(1, "At least one keyframe is required")
|
|
8721
8970
|
});
|
|
8722
8971
|
/** Font-face declarations - uses standard declarations but with font-specific validation */
|
|
8723
|
-
const fontFaceDeclarationsSchema = z
|
|
8972
|
+
const fontFaceDeclarationsSchema = z.record(z.string().min(1).max(100), declarationValueSchema).refine((decls) => "fontFamily" in decls || "font-family" in decls, { message: "font-family is required in @font-face" });
|
|
8724
8973
|
/** @font-face rule schema */
|
|
8725
|
-
const fontFaceAtRuleSchema = z
|
|
8974
|
+
const fontFaceAtRuleSchema = z.object({
|
|
8726
8975
|
id: ruleIdSchema,
|
|
8727
|
-
type: z
|
|
8976
|
+
type: z.literal("font-face"),
|
|
8728
8977
|
declarations: fontFaceDeclarationsSchema
|
|
8729
8978
|
});
|
|
8730
8979
|
/** Media query string validation */
|
|
8731
|
-
const mediaQuerySchema = z
|
|
8980
|
+
const mediaQuerySchema = z.string().min(1, "Media query is required").max(200, "Media query too long");
|
|
8732
8981
|
/** @media rule schema */
|
|
8733
|
-
const mediaAtRuleSchema = z
|
|
8982
|
+
const mediaAtRuleSchema = z.object({
|
|
8734
8983
|
id: ruleIdSchema,
|
|
8735
|
-
type: z
|
|
8984
|
+
type: z.literal("media"),
|
|
8736
8985
|
query: mediaQuerySchema,
|
|
8737
|
-
rules: z
|
|
8986
|
+
rules: z.array(nestedRuleSchema).min(1, "At least one rule is required")
|
|
8738
8987
|
});
|
|
8739
8988
|
/** Supports condition string validation */
|
|
8740
|
-
const supportsConditionSchema = z
|
|
8989
|
+
const supportsConditionSchema = z.string().min(1, "Supports condition is required").max(200, "Supports condition too long");
|
|
8741
8990
|
/** @supports rule schema */
|
|
8742
|
-
const supportsAtRuleSchema = z
|
|
8991
|
+
const supportsAtRuleSchema = z.object({
|
|
8743
8992
|
id: ruleIdSchema,
|
|
8744
|
-
type: z
|
|
8993
|
+
type: z.literal("supports"),
|
|
8745
8994
|
condition: supportsConditionSchema,
|
|
8746
|
-
rules: z
|
|
8995
|
+
rules: z.array(nestedRuleSchema).min(1, "At least one rule is required")
|
|
8747
8996
|
});
|
|
8748
8997
|
/**
|
|
8749
8998
|
* Check if raw CSS contains blocked at-rules.
|
|
@@ -8752,17 +9001,17 @@ function containsBlockedAtRule(css) {
|
|
|
8752
9001
|
return BLOCKED_AT_RULE_PATTERN.test(css);
|
|
8753
9002
|
}
|
|
8754
9003
|
/** Raw CSS validation - blocks @import, @charset, must start with @ */
|
|
8755
|
-
const rawCssSchema = z
|
|
9004
|
+
const rawCssSchema = z.string().min(1, "CSS is required").max(5e3, "Raw CSS too long (max 5000 characters)").refine((css) => css.trim().startsWith("@"), { message: "Raw at-rule must start with @" }).refine((css) => !containsBlockedAtRule(css), { message: `Blocked at-rules: ${BLOCKED_AT_RULES.join(", ")}. Use typed at-rules or local assets instead.` });
|
|
8756
9005
|
/** Raw at-rule schema */
|
|
8757
|
-
const rawAtRuleSchema = z
|
|
9006
|
+
const rawAtRuleSchema = z.object({
|
|
8758
9007
|
id: ruleIdSchema,
|
|
8759
|
-
type: z
|
|
9008
|
+
type: z.literal("raw"),
|
|
8760
9009
|
css: rawCssSchema
|
|
8761
9010
|
});
|
|
8762
9011
|
/**
|
|
8763
9012
|
* Discriminated union schema for all at-rule types.
|
|
8764
9013
|
*/
|
|
8765
|
-
const customCssAtRuleSchema = z
|
|
9014
|
+
const customCssAtRuleSchema = z.discriminatedUnion("type", [
|
|
8766
9015
|
keyframesAtRuleSchema,
|
|
8767
9016
|
fontFaceAtRuleSchema,
|
|
8768
9017
|
mediaAtRuleSchema,
|
|
@@ -8772,7 +9021,7 @@ const customCssAtRuleSchema = z$1.discriminatedUnion("type", [
|
|
|
8772
9021
|
/**
|
|
8773
9022
|
* Array of at-rules for theme-level styling.
|
|
8774
9023
|
*/
|
|
8775
|
-
const customCssAtRulesSchema = z
|
|
9024
|
+
const customCssAtRulesSchema = z.array(customCssAtRuleSchema).optional();
|
|
8776
9025
|
//#endregion
|
|
8777
9026
|
//#region ../theme-core/src/shared/componentStyles.ts
|
|
8778
9027
|
/**
|
|
@@ -8790,22 +9039,22 @@ const customCssAtRulesSchema = z$1.array(customCssAtRuleSchema).optional();
|
|
|
8790
9039
|
* Shared border schema for themed components.
|
|
8791
9040
|
* Position is excluded - each component determines its own border position.
|
|
8792
9041
|
*/
|
|
8793
|
-
const componentBorderSchema = z
|
|
8794
|
-
width: z
|
|
9042
|
+
const componentBorderSchema = z.object({
|
|
9043
|
+
width: z.enum([
|
|
8795
9044
|
"none",
|
|
8796
9045
|
"hairline",
|
|
8797
9046
|
"thin",
|
|
8798
9047
|
"medium",
|
|
8799
9048
|
"thick"
|
|
8800
9049
|
]).default("none"),
|
|
8801
|
-
style: z
|
|
9050
|
+
style: z.enum(["solid", "dashed"]).default("solid"),
|
|
8802
9051
|
colorToken: themeColorTokenSchema.optional()
|
|
8803
9052
|
});
|
|
8804
9053
|
/**
|
|
8805
9054
|
* Shared shadow schema for themed components.
|
|
8806
9055
|
* Softness is inherited from global theme, not configurable per-component.
|
|
8807
9056
|
*/
|
|
8808
|
-
const componentShadowSchema = z
|
|
9057
|
+
const componentShadowSchema = z.object({ elevation: z.enum([
|
|
8809
9058
|
"none",
|
|
8810
9059
|
"sm",
|
|
8811
9060
|
"md",
|
|
@@ -8900,43 +9149,43 @@ const logoDensityValues = [
|
|
|
8900
9149
|
"detailed",
|
|
8901
9150
|
"unknown"
|
|
8902
9151
|
];
|
|
8903
|
-
const logoContainsTextSchema = z
|
|
8904
|
-
z
|
|
8905
|
-
kind: z
|
|
8906
|
-
confidence: z
|
|
8907
|
-
text: z
|
|
9152
|
+
const logoContainsTextSchema = z.discriminatedUnion("kind", [
|
|
9153
|
+
z.object({
|
|
9154
|
+
kind: z.literal("contains-text"),
|
|
9155
|
+
confidence: z.enum(logoTextConfidenceValues),
|
|
9156
|
+
text: z.string().trim().min(1).max(200).optional()
|
|
8908
9157
|
}),
|
|
8909
|
-
z
|
|
8910
|
-
kind: z
|
|
8911
|
-
confidence: z
|
|
9158
|
+
z.object({
|
|
9159
|
+
kind: z.literal("no-text"),
|
|
9160
|
+
confidence: z.enum(logoTextConfidenceValues)
|
|
8912
9161
|
}),
|
|
8913
|
-
z
|
|
8914
|
-
kind: z
|
|
8915
|
-
reason: z
|
|
9162
|
+
z.object({
|
|
9163
|
+
kind: z.literal("unknown"),
|
|
9164
|
+
reason: z.enum([
|
|
8916
9165
|
"analysis-unavailable",
|
|
8917
9166
|
"unsupported-file",
|
|
8918
9167
|
"low-confidence"
|
|
8919
9168
|
])
|
|
8920
9169
|
})
|
|
8921
9170
|
]);
|
|
8922
|
-
const logoAnalysisSourceSchema = z
|
|
8923
|
-
z
|
|
8924
|
-
z
|
|
8925
|
-
kind: z
|
|
8926
|
-
reason: z
|
|
9171
|
+
const logoAnalysisSourceSchema = z.discriminatedUnion("kind", [
|
|
9172
|
+
z.object({ kind: z.literal("none") }),
|
|
9173
|
+
z.object({
|
|
9174
|
+
kind: z.literal("deterministic"),
|
|
9175
|
+
reason: z.enum(["dimensions", "fallback"])
|
|
8927
9176
|
}),
|
|
8928
|
-
z
|
|
8929
|
-
kind: z
|
|
8930
|
-
model: z
|
|
8931
|
-
analyzedAt: z
|
|
9177
|
+
z.object({
|
|
9178
|
+
kind: z.literal("llm"),
|
|
9179
|
+
model: z.literal("gpt-5.4-mini"),
|
|
9180
|
+
analyzedAt: z.string().trim().min(1).max(80).optional()
|
|
8932
9181
|
}),
|
|
8933
|
-
z
|
|
9182
|
+
z.object({ kind: z.literal("manual-override") })
|
|
8934
9183
|
]);
|
|
8935
|
-
z
|
|
8936
|
-
shape: z
|
|
9184
|
+
z.object({
|
|
9185
|
+
shape: z.enum(logoAssetShapeValues),
|
|
8937
9186
|
containsText: logoContainsTextSchema,
|
|
8938
|
-
kind: z
|
|
8939
|
-
density: z
|
|
9187
|
+
kind: z.enum(logoKindValues),
|
|
9188
|
+
density: z.enum(logoDensityValues),
|
|
8940
9189
|
source: logoAnalysisSourceSchema
|
|
8941
9190
|
});
|
|
8942
9191
|
const brandDisplayModeValues = [
|
|
@@ -8990,7 +9239,59 @@ const siteChromeBackgroundOverrideOwner = "site-chrome-editor";
|
|
|
8990
9239
|
* the legacy empty-string "no color" sentinel. Semantic validation needs
|
|
8991
9240
|
* palette context and happens in `parseThemeColorReference`.
|
|
8992
9241
|
*/
|
|
8993
|
-
const tokenOrCssColorValueSchema = z
|
|
9242
|
+
const tokenOrCssColorValueSchema = z.string();
|
|
9243
|
+
//#endregion
|
|
9244
|
+
//#region ../theme-core/src/header/legacyHeaderVariant.ts
|
|
9245
|
+
/**
|
|
9246
|
+
* The header variants the system actually renders.
|
|
9247
|
+
*
|
|
9248
|
+
* Each one has a layout row in the site-header block and a paint target in
|
|
9249
|
+
* `paintTargets.ts`. This is the canonical list: the block transform's variant
|
|
9250
|
+
* class allowlist and the AI theme generator's enum both derive from it, so
|
|
9251
|
+
* they cannot drift.
|
|
9252
|
+
*/
|
|
9253
|
+
const headerVariantValues = [
|
|
9254
|
+
"classic",
|
|
9255
|
+
"centered",
|
|
9256
|
+
"floating"
|
|
9257
|
+
];
|
|
9258
|
+
z.enum(headerVariantValues);
|
|
9259
|
+
/**
|
|
9260
|
+
* Header variant spellings that were once authorable but no longer name a
|
|
9261
|
+
* layout of their own, and the variant they read as now.
|
|
9262
|
+
*
|
|
9263
|
+
* `transparent` was an overlay header with no CSS of its own: everything it
|
|
9264
|
+
* did (transparent root background, overlay content flow) is what `floating`
|
|
9265
|
+
* already does, and it had zero persisted usage in production or locally when
|
|
9266
|
+
* it was retired. It survives here as a one-boundary alias so a theme authored
|
|
9267
|
+
* against the old vocabulary still parses.
|
|
9268
|
+
*
|
|
9269
|
+
* This matters because the theme schema is strict and has no per-field
|
|
9270
|
+
* `.catch()`: an out-of-enum variant fails `themeSchema.safeParse` for the
|
|
9271
|
+
* *whole* theme, which silently swaps the site's theme for
|
|
9272
|
+
* `modernMinimalTheme`. Aliasing here keeps that from happening.
|
|
9273
|
+
*/
|
|
9274
|
+
const legacyHeaderVariants = { transparent: "floating" };
|
|
9275
|
+
const legacyHeaderVariantValues = Object.keys(legacyHeaderVariants);
|
|
9276
|
+
/**
|
|
9277
|
+
* The header variant boundary for themes that go through `themeSchema`:
|
|
9278
|
+
* canonical variants pass through, legacy spellings normalize to the variant
|
|
9279
|
+
* they meant, everything else fails the parse.
|
|
9280
|
+
*
|
|
9281
|
+
* Deliberately an enum plus a transform rather than a `z.preprocess`, so the
|
|
9282
|
+
* schema's *input* type stays an accurate union (the legacy spelling is still
|
|
9283
|
+
* accepted on the wire) instead of widening to `unknown`. `SdkThemeWire` in
|
|
9284
|
+
* `@riverbankcms/api` is `z.input<typeof themeSchema>`, so a widened input here
|
|
9285
|
+
* would leak straight into a public type.
|
|
9286
|
+
*
|
|
9287
|
+
* Not every read of a persisted theme goes through the schema:
|
|
9288
|
+
* `resolveRuntimeTheme` in
|
|
9289
|
+
* `apps/dashboard/src/server/services/sites/runtimeSiteResponse.ts` returns the
|
|
9290
|
+
* raw database JSON asserted as `Theme` with no parse, so a theme still
|
|
9291
|
+
* carrying a legacy spelling reaches the theme editor un-aliased. That gap
|
|
9292
|
+
* predates this alias and is harmless while persisted usage is zero.
|
|
9293
|
+
*/
|
|
9294
|
+
const headerVariantWithLegacyAliasSchema = z.enum([...headerVariantValues, ...legacyHeaderVariantValues]).transform((value) => value in legacyHeaderVariants ? legacyHeaderVariants[value] : value);
|
|
8994
9295
|
const BREAKPOINT_LG = 1024;
|
|
8995
9296
|
const BREAKPOINT_XL = 1280;
|
|
8996
9297
|
const BREAKPOINT_LG_DOWN = BREAKPOINT_LG - 1;
|
|
@@ -9015,14 +9316,14 @@ mqDown(640);
|
|
|
9015
9316
|
mqDown(768);
|
|
9016
9317
|
//#endregion
|
|
9017
9318
|
//#region ../theme-core/src/header/scrollTreatment.ts
|
|
9018
|
-
const headerScrollTreatmentSchema = z
|
|
9019
|
-
kind: z
|
|
9020
|
-
backgroundTone: z
|
|
9319
|
+
const headerScrollTreatmentSchema = z.discriminatedUnion("kind", [z.object({
|
|
9320
|
+
kind: z.literal("contrast-glass"),
|
|
9321
|
+
backgroundTone: z.enum(["light", "dark"])
|
|
9021
9322
|
})]).optional();
|
|
9022
9323
|
//#endregion
|
|
9023
9324
|
//#region ../theme-core/src/header/containerSchema.ts
|
|
9024
|
-
const headerContainerSchema = z
|
|
9025
|
-
rounded: z
|
|
9325
|
+
const headerContainerSchema = z.object({
|
|
9326
|
+
rounded: z.enum([
|
|
9026
9327
|
"none",
|
|
9027
9328
|
"sm",
|
|
9028
9329
|
"md",
|
|
@@ -9030,77 +9331,146 @@ const headerContainerSchema = z$1.object({
|
|
|
9030
9331
|
"xl",
|
|
9031
9332
|
"2xl"
|
|
9032
9333
|
]).default("xl"),
|
|
9033
|
-
border: z
|
|
9034
|
-
shadow: z
|
|
9035
|
-
padding: z
|
|
9334
|
+
border: z.boolean().default(true),
|
|
9335
|
+
shadow: z.boolean().default(true),
|
|
9336
|
+
padding: z.enum([
|
|
9036
9337
|
"sm",
|
|
9037
9338
|
"md",
|
|
9038
9339
|
"lg"
|
|
9039
9340
|
]).default("md"),
|
|
9040
|
-
tint: z
|
|
9041
|
-
opacity: z
|
|
9341
|
+
tint: z.string().nullable().optional(),
|
|
9342
|
+
opacity: z.number().min(0).max(1).default(.12)
|
|
9042
9343
|
}).optional();
|
|
9043
|
-
const headerInteractionPaletteSchema = z
|
|
9344
|
+
const headerInteractionPaletteSchema = z.enum([
|
|
9044
9345
|
"primary",
|
|
9045
9346
|
"secondary",
|
|
9046
9347
|
"accent"
|
|
9047
9348
|
]);
|
|
9048
9349
|
//#endregion
|
|
9350
|
+
//#region ../theme-core/src/boxBackgroundSchema.ts
|
|
9351
|
+
const boxBackgroundOverlaySchema = z.preprocess(normalizeAuthoringOpacity, z.discriminatedUnion("type", [
|
|
9352
|
+
z.object({ type: z.literal("none") }),
|
|
9353
|
+
z.object({
|
|
9354
|
+
type: z.literal("color"),
|
|
9355
|
+
color: tokenOrCssColorValueSchema.nullable().optional(),
|
|
9356
|
+
opacity: z.number().min(0).max(1).nullable().optional()
|
|
9357
|
+
}),
|
|
9358
|
+
z.object({
|
|
9359
|
+
type: z.literal("gradient"),
|
|
9360
|
+
gradient: z.string().nullable().optional(),
|
|
9361
|
+
opacity: z.number().min(0).max(1).nullable().optional()
|
|
9362
|
+
})
|
|
9363
|
+
]));
|
|
9364
|
+
const commonSchema = z.object({
|
|
9365
|
+
contentOwner: z.literal(pageDesignEditorBackgroundOverrideOwner).optional(),
|
|
9366
|
+
textColor: tokenOrCssColorValueSchema.nullable().optional(),
|
|
9367
|
+
headingColor: tokenOrCssColorValueSchema.nullable().optional(),
|
|
9368
|
+
linkColor: tokenOrCssColorValueSchema.nullable().optional(),
|
|
9369
|
+
supportingColor: tokenOrCssColorValueSchema.nullable().optional()
|
|
9370
|
+
});
|
|
9371
|
+
const mediaPresentationSchema = commonSchema.extend({
|
|
9372
|
+
opacity: z.preprocess(normalizeOpacity, z.number().min(0).max(1).nullable()).optional(),
|
|
9373
|
+
objectFit: z.enum([
|
|
9374
|
+
"fill",
|
|
9375
|
+
"fit",
|
|
9376
|
+
"original",
|
|
9377
|
+
"custom"
|
|
9378
|
+
]).nullable().optional(),
|
|
9379
|
+
scale: z.string().nullable().optional(),
|
|
9380
|
+
position: z.string().nullable().optional(),
|
|
9381
|
+
motion: z.enum(["static", "fixed-frame"]).nullable().optional(),
|
|
9382
|
+
overflow: z.boolean().nullable().optional(),
|
|
9383
|
+
overlay: boxBackgroundOverlaySchema.nullable().optional()
|
|
9384
|
+
});
|
|
9385
|
+
const boxBackgroundSchema = z.discriminatedUnion("type", [
|
|
9386
|
+
commonSchema.extend({
|
|
9387
|
+
type: z.literal("color"),
|
|
9388
|
+
color: tokenOrCssColorValueSchema.nullable().optional()
|
|
9389
|
+
}),
|
|
9390
|
+
commonSchema.extend({
|
|
9391
|
+
type: z.literal("gradient"),
|
|
9392
|
+
gradient: z.string().nullable().optional(),
|
|
9393
|
+
gradientPresetId: z.string().min(1).nullable().optional()
|
|
9394
|
+
}),
|
|
9395
|
+
mediaPresentationSchema.extend({
|
|
9396
|
+
type: z.literal("image"),
|
|
9397
|
+
image: imageMediaSchema.nullable().optional()
|
|
9398
|
+
}),
|
|
9399
|
+
mediaPresentationSchema.extend({
|
|
9400
|
+
type: z.literal("video"),
|
|
9401
|
+
image: videoMediaSchema.nullable().optional(),
|
|
9402
|
+
showVideoOnMobile: z.boolean().nullable().optional()
|
|
9403
|
+
})
|
|
9404
|
+
]);
|
|
9405
|
+
function normalizeAuthoringOpacity(value) {
|
|
9406
|
+
if (!isRecord$3(value)) return value;
|
|
9407
|
+
return {
|
|
9408
|
+
...value,
|
|
9409
|
+
opacity: normalizeOpacity(value.opacity)
|
|
9410
|
+
};
|
|
9411
|
+
}
|
|
9412
|
+
function normalizeOpacity(value) {
|
|
9413
|
+
return typeof value === "number" && value > 1 && value <= 100 ? value / 100 : value;
|
|
9414
|
+
}
|
|
9415
|
+
function isRecord$3(value) {
|
|
9416
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
9417
|
+
}
|
|
9418
|
+
//#endregion
|
|
9049
9419
|
//#region ../theme-core/src/schema.ts
|
|
9050
|
-
const axesSchema = z
|
|
9051
|
-
tone: z
|
|
9420
|
+
const axesSchema = z.object({
|
|
9421
|
+
tone: z.enum([
|
|
9052
9422
|
"minimal",
|
|
9053
9423
|
"classic",
|
|
9054
9424
|
"bold"
|
|
9055
9425
|
]),
|
|
9056
|
-
energy: z
|
|
9057
|
-
density: z
|
|
9426
|
+
energy: z.enum(["calm", "vibrant"]),
|
|
9427
|
+
density: z.enum([
|
|
9058
9428
|
"airy",
|
|
9059
9429
|
"regular",
|
|
9060
9430
|
"compact"
|
|
9061
9431
|
]),
|
|
9062
|
-
mediaBias: z
|
|
9432
|
+
mediaBias: z.enum([
|
|
9063
9433
|
"text",
|
|
9064
9434
|
"media",
|
|
9065
9435
|
"mixed"
|
|
9066
9436
|
]),
|
|
9067
|
-
conversionBias: z
|
|
9437
|
+
conversionBias: z.enum([
|
|
9068
9438
|
"low",
|
|
9069
9439
|
"med",
|
|
9070
9440
|
"high"
|
|
9071
9441
|
]),
|
|
9072
|
-
motion: z
|
|
9442
|
+
motion: z.enum([
|
|
9073
9443
|
"subtle",
|
|
9074
9444
|
"standard",
|
|
9075
9445
|
"expressive"
|
|
9076
9446
|
])
|
|
9077
9447
|
});
|
|
9078
|
-
const typographyStyleSchema = z
|
|
9079
|
-
family: z
|
|
9080
|
-
weight: z
|
|
9448
|
+
const typographyStyleSchema = z.object({
|
|
9449
|
+
family: z.string().min(1),
|
|
9450
|
+
weight: z.enum([
|
|
9081
9451
|
"light",
|
|
9082
9452
|
"regular",
|
|
9083
9453
|
"medium",
|
|
9084
9454
|
"semibold",
|
|
9085
9455
|
"bold"
|
|
9086
9456
|
]),
|
|
9087
|
-
letterSpacing: z
|
|
9457
|
+
letterSpacing: z.enum([
|
|
9088
9458
|
"tight",
|
|
9089
9459
|
"normal",
|
|
9090
9460
|
"loose"
|
|
9091
9461
|
]),
|
|
9092
|
-
lineHeight: z
|
|
9462
|
+
lineHeight: z.enum([
|
|
9093
9463
|
"normal",
|
|
9094
9464
|
"relaxed",
|
|
9095
9465
|
"loose"
|
|
9096
9466
|
])
|
|
9097
9467
|
});
|
|
9098
|
-
const bodyTypographyStyleSchema = typographyStyleSchema.extend({ size: z
|
|
9468
|
+
const bodyTypographyStyleSchema = typographyStyleSchema.extend({ size: z.enum([
|
|
9099
9469
|
"md",
|
|
9100
9470
|
"lg",
|
|
9101
9471
|
"xl"
|
|
9102
9472
|
]) });
|
|
9103
|
-
const headingSizeSchema = z
|
|
9473
|
+
const headingSizeSchema = z.enum([
|
|
9104
9474
|
"xs",
|
|
9105
9475
|
"sm",
|
|
9106
9476
|
"md",
|
|
@@ -9108,68 +9478,68 @@ const headingSizeSchema = z$1.enum([
|
|
|
9108
9478
|
"xl",
|
|
9109
9479
|
"2xl"
|
|
9110
9480
|
]);
|
|
9111
|
-
const headingTypographyOverridesSchema = z
|
|
9112
|
-
weight: z
|
|
9481
|
+
const headingTypographyOverridesSchema = z.object({
|
|
9482
|
+
weight: z.enum([
|
|
9113
9483
|
"light",
|
|
9114
9484
|
"regular",
|
|
9115
9485
|
"medium",
|
|
9116
9486
|
"semibold",
|
|
9117
9487
|
"bold"
|
|
9118
9488
|
]).nullable().optional(),
|
|
9119
|
-
letterSpacing: z
|
|
9489
|
+
letterSpacing: z.enum([
|
|
9120
9490
|
"tight",
|
|
9121
9491
|
"normal",
|
|
9122
9492
|
"loose"
|
|
9123
9493
|
]).nullable().optional(),
|
|
9124
9494
|
size: headingSizeSchema.nullable().optional(),
|
|
9125
|
-
lineHeight: z
|
|
9495
|
+
lineHeight: z.enum([
|
|
9126
9496
|
"tight",
|
|
9127
9497
|
"snug",
|
|
9128
9498
|
"normal",
|
|
9129
9499
|
"relaxed",
|
|
9130
9500
|
"loose"
|
|
9131
9501
|
]).nullable().optional(),
|
|
9132
|
-
italic: z
|
|
9502
|
+
italic: z.boolean().nullable().optional(),
|
|
9133
9503
|
colorToken: themeColorTokenSchema.nullable().optional()
|
|
9134
9504
|
});
|
|
9135
9505
|
const headingTypographyStyleSchema = typographyStyleSchema.extend({
|
|
9136
|
-
case: z
|
|
9506
|
+
case: z.enum([
|
|
9137
9507
|
"uppercase",
|
|
9138
9508
|
"normal",
|
|
9139
9509
|
"smallCaps"
|
|
9140
9510
|
]).nullable(),
|
|
9141
|
-
italic: z
|
|
9511
|
+
italic: z.boolean().nullable(),
|
|
9142
9512
|
colorToken: themeColorTokenSchema.nullable().optional()
|
|
9143
9513
|
});
|
|
9144
|
-
const proseLinkUnderlineStyleSchema = z
|
|
9514
|
+
const proseLinkUnderlineStyleSchema = z.enum([
|
|
9145
9515
|
"solid",
|
|
9146
9516
|
"dotted",
|
|
9147
9517
|
"dashed"
|
|
9148
9518
|
]);
|
|
9149
|
-
const proseLinkUnderlineThicknessSchema = z
|
|
9519
|
+
const proseLinkUnderlineThicknessSchema = z.enum([
|
|
9150
9520
|
"auto",
|
|
9151
9521
|
"fromFont",
|
|
9152
9522
|
"thin",
|
|
9153
9523
|
"medium",
|
|
9154
9524
|
"thick"
|
|
9155
9525
|
]);
|
|
9156
|
-
const proseLinkUnderlineOffsetSchema = z
|
|
9526
|
+
const proseLinkUnderlineOffsetSchema = z.enum([
|
|
9157
9527
|
"auto",
|
|
9158
9528
|
"tight",
|
|
9159
9529
|
"normal",
|
|
9160
9530
|
"loose"
|
|
9161
9531
|
]);
|
|
9162
|
-
const proseLinkStyleSchema = z
|
|
9532
|
+
const proseLinkStyleSchema = z.object({
|
|
9163
9533
|
colorToken: themeColorTokenSchema.optional(),
|
|
9164
9534
|
hoverColorToken: themeColorTokenSchema.optional(),
|
|
9165
|
-
underline: z
|
|
9535
|
+
underline: z.boolean().optional(),
|
|
9166
9536
|
decorationColorToken: themeColorTokenSchema.optional(),
|
|
9167
9537
|
hoverDecorationColorToken: themeColorTokenSchema.optional(),
|
|
9168
9538
|
underlineStyle: proseLinkUnderlineStyleSchema.optional(),
|
|
9169
9539
|
underlineThickness: proseLinkUnderlineThicknessSchema.optional(),
|
|
9170
9540
|
underlineOffset: proseLinkUnderlineOffsetSchema.optional()
|
|
9171
9541
|
});
|
|
9172
|
-
const semanticSpacingSchema = z
|
|
9542
|
+
const semanticSpacingSchema = z.enum([
|
|
9173
9543
|
"none",
|
|
9174
9544
|
"compact",
|
|
9175
9545
|
"cozy",
|
|
@@ -9177,7 +9547,7 @@ const semanticSpacingSchema = z$1.enum([
|
|
|
9177
9547
|
"comfortable",
|
|
9178
9548
|
"spacious"
|
|
9179
9549
|
]);
|
|
9180
|
-
const boxRoundedSchema = z
|
|
9550
|
+
const boxRoundedSchema = z.enum([
|
|
9181
9551
|
"none",
|
|
9182
9552
|
"sm",
|
|
9183
9553
|
"md",
|
|
@@ -9186,82 +9556,45 @@ const boxRoundedSchema = z$1.enum([
|
|
|
9186
9556
|
"2xl",
|
|
9187
9557
|
"full"
|
|
9188
9558
|
]);
|
|
9189
|
-
const
|
|
9190
|
-
|
|
9191
|
-
|
|
9192
|
-
|
|
9193
|
-
"gradient"
|
|
9194
|
-
]).nullable().optional(),
|
|
9195
|
-
color: tokenOrCssColorValueSchema.nullable().optional(),
|
|
9196
|
-
gradient: z$1.string().nullable().optional(),
|
|
9197
|
-
opacity: z$1.number().min(0).max(1).nullable().optional()
|
|
9559
|
+
const noHeadingDecorationSchema = z.object({ family: z.literal("none") });
|
|
9560
|
+
const visibleHeadingDecorationSchema = z.object({
|
|
9561
|
+
family: z.enum(visibleHeadingDecorationFamilyValues),
|
|
9562
|
+
colorToken: z.enum(headingDecorationColorTokenValues).optional()
|
|
9198
9563
|
});
|
|
9199
|
-
const
|
|
9200
|
-
|
|
9201
|
-
|
|
9202
|
-
|
|
9203
|
-
|
|
9204
|
-
|
|
9205
|
-
|
|
9206
|
-
color: tokenOrCssColorValueSchema.nullable().optional(),
|
|
9207
|
-
gradient: z$1.string().nullable().optional(),
|
|
9208
|
-
gradientPresetId: z$1.string().min(1).nullable().optional(),
|
|
9209
|
-
image: mediaSchema$1.nullable().optional(),
|
|
9210
|
-
objectFit: z$1.enum([
|
|
9211
|
-
"fill",
|
|
9212
|
-
"fit",
|
|
9213
|
-
"original",
|
|
9214
|
-
"custom"
|
|
9215
|
-
]).nullable().optional(),
|
|
9216
|
-
scale: z$1.string().nullable().optional(),
|
|
9217
|
-
position: z$1.string().nullable().optional(),
|
|
9218
|
-
opacity: z$1.number().min(0).max(1).nullable().optional(),
|
|
9219
|
-
motion: z$1.enum(["static", "fixed-frame"]).nullable().optional(),
|
|
9220
|
-
overlay: boxBackgroundOverlaySchema.nullable().optional(),
|
|
9221
|
-
textColor: tokenOrCssColorValueSchema.nullable().optional(),
|
|
9222
|
-
headingColor: tokenOrCssColorValueSchema.nullable().optional(),
|
|
9223
|
-
linkColor: tokenOrCssColorValueSchema.nullable().optional(),
|
|
9224
|
-
supportingColor: tokenOrCssColorValueSchema.nullable().optional()
|
|
9225
|
-
});
|
|
9226
|
-
const noHeadingDecorationSchema = z$1.object({ family: z$1.literal("none") });
|
|
9227
|
-
const visibleHeadingDecorationSchema = z$1.object({
|
|
9228
|
-
family: z$1.enum(visibleHeadingDecorationFamilyValues),
|
|
9229
|
-
colorToken: z$1.enum(headingDecorationColorTokenValues).optional()
|
|
9564
|
+
const headingDecorationSchema = z.union([noHeadingDecorationSchema, visibleHeadingDecorationSchema]);
|
|
9565
|
+
const headingDecorationOverrideSchema = z.union([z.enum(headingDecorationOverrideValues), z.literal("on").transform(() => "site-default")]);
|
|
9566
|
+
const accordionIconTreatmentSchema = z.object({
|
|
9567
|
+
iconSet: z.enum(accordionIconSetValues),
|
|
9568
|
+
colorToken: z.enum(accordionIconColorTokenValues),
|
|
9569
|
+
openColorToken: z.enum(accordionIconColorTokenValues).optional(),
|
|
9570
|
+
motion: z.enum(accordionIconMotionValues)
|
|
9230
9571
|
});
|
|
9231
|
-
const
|
|
9232
|
-
const headingDecorationOverrideSchema = z$1.union([z$1.enum(headingDecorationOverrideValues), z$1.literal("on").transform(() => "site-default")]);
|
|
9233
|
-
const accordionIconTreatmentSchema = z$1.object({
|
|
9234
|
-
iconSet: z$1.enum(accordionIconSetValues),
|
|
9235
|
-
colorToken: z$1.enum(accordionIconColorTokenValues),
|
|
9236
|
-
openColorToken: z$1.enum(accordionIconColorTokenValues).optional(),
|
|
9237
|
-
motion: z$1.enum(accordionIconMotionValues)
|
|
9238
|
-
});
|
|
9239
|
-
const sectionStylesOverrideSchema = z$1.object({
|
|
9572
|
+
const sectionStylesOverrideSchema = z.object({
|
|
9240
9573
|
background: boxBackgroundSchema.nullable().optional(),
|
|
9241
9574
|
spacing: semanticSpacingSchema.nullable().optional(),
|
|
9242
|
-
minHeight: z
|
|
9575
|
+
minHeight: z.enum([
|
|
9243
9576
|
"none",
|
|
9244
9577
|
"banner",
|
|
9245
9578
|
"hero",
|
|
9246
9579
|
"immersive"
|
|
9247
9580
|
]).nullable().optional(),
|
|
9248
|
-
tileTreatment: z
|
|
9249
|
-
eventListTreatment: z
|
|
9250
|
-
eyebrowTreatment: z
|
|
9581
|
+
tileTreatment: z.enum(tileTreatmentValues).nullable().optional(),
|
|
9582
|
+
eventListTreatment: z.enum(eventListTreatmentValues).nullable().optional(),
|
|
9583
|
+
eyebrowTreatment: z.enum(eyebrowTreatmentValues).nullable().optional(),
|
|
9251
9584
|
headingDecoration: headingDecorationSchema.nullable().optional(),
|
|
9252
9585
|
headingDecorationOverride: headingDecorationOverrideSchema.nullable().optional(),
|
|
9253
9586
|
accordionIconTreatment: accordionIconTreatmentSchema.nullable().optional()
|
|
9254
9587
|
});
|
|
9255
|
-
const containerStylesOverrideSchema = z
|
|
9588
|
+
const containerStylesOverrideSchema = z.object({
|
|
9256
9589
|
background: boxBackgroundSchema.nullable().optional(),
|
|
9257
9590
|
spacing: semanticSpacingSchema.nullable().optional(),
|
|
9258
|
-
raised: z
|
|
9591
|
+
raised: z.boolean().nullable().optional(),
|
|
9259
9592
|
rounded: boxRoundedSchema.nullable().optional(),
|
|
9260
|
-
fullWidth: z
|
|
9593
|
+
fullWidth: z.boolean().nullable().optional()
|
|
9261
9594
|
});
|
|
9262
|
-
const cardBorderOverrideSchema = z
|
|
9263
|
-
enabled: z
|
|
9264
|
-
width: z
|
|
9595
|
+
const cardBorderOverrideSchema = z.object({
|
|
9596
|
+
enabled: z.boolean().nullable().optional(),
|
|
9597
|
+
width: z.enum([
|
|
9265
9598
|
"none",
|
|
9266
9599
|
"1",
|
|
9267
9600
|
"2",
|
|
@@ -9269,32 +9602,25 @@ const cardBorderOverrideSchema = z$1.object({
|
|
|
9269
9602
|
]).nullable().optional(),
|
|
9270
9603
|
colorToken: themeColorTokenSchema.nullable().optional()
|
|
9271
9604
|
});
|
|
9272
|
-
const cardStylesOverrideSchema = z
|
|
9605
|
+
const cardStylesOverrideSchema = z.object({
|
|
9273
9606
|
background: boxBackgroundSchema.nullable().optional(),
|
|
9274
9607
|
border: cardBorderOverrideSchema.nullable().optional(),
|
|
9275
9608
|
spacing: semanticSpacingSchema.nullable().optional(),
|
|
9276
|
-
raised: z
|
|
9609
|
+
raised: z.boolean().nullable().optional(),
|
|
9277
9610
|
rounded: boxRoundedSchema.nullable().optional(),
|
|
9278
|
-
|
|
9279
|
-
"accent-quote",
|
|
9280
|
-
"editorial-rule",
|
|
9281
|
-
"soft-panel",
|
|
9282
|
-
"editorial-serif-quote",
|
|
9283
|
-
"editorial-open",
|
|
9284
|
-
"color-blocked"
|
|
9285
|
-
]).nullable().optional(),
|
|
9611
|
+
role: cardRoleSchema.nullable().optional(),
|
|
9286
9612
|
cardVariant: boxStylesCardVariantSchema.nullable().optional()
|
|
9287
9613
|
});
|
|
9288
|
-
const blockStyleOverridesSchema = z
|
|
9614
|
+
const blockStyleOverridesSchema = z.object({
|
|
9289
9615
|
sectionStyles: sectionStylesOverrideSchema.nullable().optional(),
|
|
9290
9616
|
containerStyles: containerStylesOverrideSchema.nullable().optional(),
|
|
9291
9617
|
cardStyles: cardStylesOverrideSchema.nullable().optional()
|
|
9292
9618
|
});
|
|
9293
|
-
const blockThemeOverrideSchema = z
|
|
9294
|
-
typography: z
|
|
9619
|
+
const blockThemeOverrideSchema = z.object({
|
|
9620
|
+
typography: z.object({ proseLinkStyle: proseLinkStyleSchema.optional() }).optional(),
|
|
9295
9621
|
styles: blockStyleOverridesSchema.optional()
|
|
9296
9622
|
});
|
|
9297
|
-
const typographyScaleSchema = z
|
|
9623
|
+
const typographyScaleSchema = z.enum([
|
|
9298
9624
|
"compact",
|
|
9299
9625
|
"balanced",
|
|
9300
9626
|
"spacious",
|
|
@@ -9302,31 +9628,31 @@ const typographyScaleSchema = z$1.enum([
|
|
|
9302
9628
|
"majorThird",
|
|
9303
9629
|
"perfectFourth"
|
|
9304
9630
|
]);
|
|
9305
|
-
const eyebrowTypographyStyleSchema = z
|
|
9306
|
-
family: z
|
|
9307
|
-
size: z
|
|
9631
|
+
const eyebrowTypographyStyleSchema = z.object({
|
|
9632
|
+
family: z.string().min(1),
|
|
9633
|
+
size: z.enum([
|
|
9308
9634
|
"sm",
|
|
9309
9635
|
"md",
|
|
9310
9636
|
"lg"
|
|
9311
9637
|
]).optional(),
|
|
9312
|
-
weight: z
|
|
9638
|
+
weight: z.enum([
|
|
9313
9639
|
"light",
|
|
9314
9640
|
"regular",
|
|
9315
9641
|
"medium",
|
|
9316
9642
|
"semibold",
|
|
9317
9643
|
"bold"
|
|
9318
9644
|
]).optional(),
|
|
9319
|
-
letterSpacing: z
|
|
9645
|
+
letterSpacing: z.enum([
|
|
9320
9646
|
"tight",
|
|
9321
9647
|
"normal",
|
|
9322
9648
|
"loose",
|
|
9323
9649
|
"wide"
|
|
9324
9650
|
]).optional(),
|
|
9325
|
-
case: z
|
|
9651
|
+
case: z.enum(["uppercase", "normal"]).optional()
|
|
9326
9652
|
});
|
|
9327
|
-
const typographySchema = z
|
|
9653
|
+
const typographySchema = z.object({
|
|
9328
9654
|
body: bodyTypographyStyleSchema,
|
|
9329
|
-
headings: z
|
|
9655
|
+
headings: z.object({
|
|
9330
9656
|
default: headingTypographyStyleSchema,
|
|
9331
9657
|
h1: headingTypographyOverridesSchema,
|
|
9332
9658
|
h2: headingTypographyOverridesSchema,
|
|
@@ -9339,105 +9665,75 @@ const typographySchema = z$1.object({
|
|
|
9339
9665
|
proseLinkStyle: proseLinkStyleSchema.optional(),
|
|
9340
9666
|
eyebrow: eyebrowTypographyStyleSchema.optional()
|
|
9341
9667
|
});
|
|
9342
|
-
const spaceSchema = z
|
|
9668
|
+
const spaceSchema = z.enum([
|
|
9343
9669
|
"comfortable",
|
|
9344
9670
|
"standard",
|
|
9345
9671
|
"dense"
|
|
9346
9672
|
]);
|
|
9347
|
-
const corners = z
|
|
9673
|
+
const corners = z.enum([
|
|
9348
9674
|
"square",
|
|
9349
9675
|
"soft",
|
|
9350
9676
|
"rounded",
|
|
9351
9677
|
"pill"
|
|
9352
9678
|
]);
|
|
9353
|
-
const shadow = z
|
|
9354
|
-
elevation: z
|
|
9679
|
+
const shadow = z.object({
|
|
9680
|
+
elevation: z.enum([
|
|
9355
9681
|
"none",
|
|
9356
9682
|
"low",
|
|
9357
9683
|
"medium",
|
|
9358
9684
|
"high"
|
|
9359
9685
|
]),
|
|
9360
|
-
softness: z
|
|
9686
|
+
softness: z.enum([
|
|
9361
9687
|
"crisp",
|
|
9362
9688
|
"soft",
|
|
9363
9689
|
"hard"
|
|
9364
9690
|
]).nullable(),
|
|
9365
|
-
position: z
|
|
9691
|
+
position: z.enum(["bottom", "bottom-right"]).default("bottom"),
|
|
9366
9692
|
colorToken: themeColorTokenSchema.optional()
|
|
9367
9693
|
});
|
|
9368
|
-
const border = z
|
|
9369
|
-
width: z
|
|
9694
|
+
const border = z.object({
|
|
9695
|
+
width: z.enum([
|
|
9370
9696
|
"none",
|
|
9371
9697
|
"hairline",
|
|
9372
9698
|
"thin",
|
|
9373
9699
|
"thick"
|
|
9374
9700
|
]),
|
|
9375
|
-
style: z
|
|
9701
|
+
style: z.enum(["solid", "dashed"])
|
|
9376
9702
|
});
|
|
9377
|
-
const motion = z
|
|
9378
|
-
level: z
|
|
9703
|
+
const motion = z.object({
|
|
9704
|
+
level: z.enum([
|
|
9379
9705
|
"off",
|
|
9380
9706
|
"low",
|
|
9381
9707
|
"medium",
|
|
9382
9708
|
"high"
|
|
9383
9709
|
]),
|
|
9384
|
-
easing: z
|
|
9710
|
+
easing: z.enum([
|
|
9385
9711
|
"standard",
|
|
9386
9712
|
"snappy",
|
|
9387
9713
|
"gentle"
|
|
9388
9714
|
]).nullable()
|
|
9389
9715
|
});
|
|
9390
|
-
z
|
|
9391
|
-
z
|
|
9392
|
-
elevation: z$1.enum([
|
|
9393
|
-
"none",
|
|
9394
|
-
"low",
|
|
9395
|
-
"medium",
|
|
9396
|
-
"high"
|
|
9397
|
-
]),
|
|
9398
|
-
border: z$1.enum([
|
|
9399
|
-
"none",
|
|
9400
|
-
"subtle",
|
|
9401
|
-
"defined"
|
|
9402
|
-
]),
|
|
9403
|
-
shape: corners,
|
|
9404
|
-
headerStyle: z$1.enum([
|
|
9405
|
-
"plain",
|
|
9406
|
-
"accentBar",
|
|
9407
|
-
"subtleBg"
|
|
9408
|
-
]).nullable(),
|
|
9409
|
-
mediaTreatment: z$1.enum([
|
|
9410
|
-
"square",
|
|
9411
|
-
"rounded",
|
|
9412
|
-
"bleed"
|
|
9413
|
-
]).nullable()
|
|
9414
|
-
});
|
|
9415
|
-
const inputStyle = z$1.object({
|
|
9716
|
+
z.object({ shape: corners });
|
|
9717
|
+
const inputStyle = z.object({
|
|
9416
9718
|
shape: corners,
|
|
9417
|
-
border: z
|
|
9719
|
+
border: z.enum([
|
|
9418
9720
|
"subtle",
|
|
9419
9721
|
"defined",
|
|
9420
9722
|
"underline"
|
|
9421
9723
|
]),
|
|
9422
|
-
focus: z
|
|
9724
|
+
focus: z.enum([
|
|
9423
9725
|
"glow",
|
|
9424
9726
|
"ring",
|
|
9425
9727
|
"underline"
|
|
9426
9728
|
]),
|
|
9427
|
-
label: z
|
|
9729
|
+
label: z.enum(["inside", "above"])
|
|
9428
9730
|
});
|
|
9429
|
-
const
|
|
9430
|
-
"classic",
|
|
9431
|
-
"centered",
|
|
9432
|
-
"transparent",
|
|
9433
|
-
"floating"
|
|
9434
|
-
]);
|
|
9435
|
-
const headerPositioning = z$1.enum([
|
|
9731
|
+
const headerPositioning = z.enum([
|
|
9436
9732
|
"static",
|
|
9437
9733
|
"sticky",
|
|
9438
9734
|
"fixed"
|
|
9439
9735
|
]);
|
|
9440
|
-
const headerNavStyle = z
|
|
9736
|
+
const headerNavStyle = z.enum([
|
|
9441
9737
|
"minimal",
|
|
9442
9738
|
"underline",
|
|
9443
9739
|
"underline-grow",
|
|
@@ -9446,59 +9742,59 @@ const headerNavStyle = z$1.enum([
|
|
|
9446
9742
|
"frosted",
|
|
9447
9743
|
"solid"
|
|
9448
9744
|
]);
|
|
9449
|
-
const navFontWeight = z
|
|
9745
|
+
const navFontWeight = z.enum([
|
|
9450
9746
|
"regular",
|
|
9451
9747
|
"medium",
|
|
9452
9748
|
"semibold",
|
|
9453
9749
|
"bold"
|
|
9454
9750
|
]);
|
|
9455
|
-
const headerMaxWidth = z
|
|
9456
|
-
const headerBarFrame = z
|
|
9457
|
-
const headerBorderSchema = componentBorderSchema.extend({ position: z
|
|
9751
|
+
const headerMaxWidth = z.enum(["container", "full"]);
|
|
9752
|
+
const headerBarFrame = z.enum(["full-bleed", "inset-shell"]);
|
|
9753
|
+
const headerBorderSchema = componentBorderSchema.extend({ position: z.enum([
|
|
9458
9754
|
"bottom",
|
|
9459
9755
|
"top",
|
|
9460
9756
|
"both",
|
|
9461
9757
|
"none"
|
|
9462
9758
|
]).default("bottom") }).optional();
|
|
9463
|
-
const logoStyleSchema = z
|
|
9464
|
-
fontFamily: z
|
|
9465
|
-
letterSpacing: z
|
|
9759
|
+
const logoStyleSchema = z.object({
|
|
9760
|
+
fontFamily: z.enum(["heading", "body"]).default("heading"),
|
|
9761
|
+
letterSpacing: z.enum([
|
|
9466
9762
|
"normal",
|
|
9467
9763
|
"wide",
|
|
9468
9764
|
"wider",
|
|
9469
9765
|
"widest"
|
|
9470
9766
|
]).default("normal"),
|
|
9471
|
-
gradient: z
|
|
9472
|
-
brandDisplay: z
|
|
9473
|
-
size: z
|
|
9474
|
-
accommodation: z
|
|
9767
|
+
gradient: z.boolean().default(false),
|
|
9768
|
+
brandDisplay: z.enum(brandDisplayModeValues).optional(),
|
|
9769
|
+
size: z.enum(logoSizePolicyValues).optional(),
|
|
9770
|
+
accommodation: z.enum(logoAccommodationPatternValues).optional()
|
|
9475
9771
|
}).optional();
|
|
9476
|
-
const headerLogoTextSchema = z
|
|
9477
|
-
mobileWrapLines: z
|
|
9478
|
-
mobileMaxWidth: z
|
|
9772
|
+
const headerLogoTextSchema = z.object({
|
|
9773
|
+
mobileWrapLines: z.union([z.literal(1), z.literal(2)]).optional(),
|
|
9774
|
+
mobileMaxWidth: z.enum([
|
|
9479
9775
|
"xs",
|
|
9480
9776
|
"sm",
|
|
9481
9777
|
"md"
|
|
9482
9778
|
]).optional(),
|
|
9483
|
-
hideOnShrink: z
|
|
9779
|
+
hideOnShrink: z.boolean().optional()
|
|
9484
9780
|
}).optional();
|
|
9485
|
-
const navEffectsSchema = z
|
|
9486
|
-
underlineGradient: z
|
|
9487
|
-
glow: z
|
|
9488
|
-
glowColor: z
|
|
9489
|
-
neumorphic: z
|
|
9781
|
+
const navEffectsSchema = z.object({
|
|
9782
|
+
underlineGradient: z.boolean().default(false),
|
|
9783
|
+
glow: z.boolean().default(false),
|
|
9784
|
+
glowColor: z.string().optional(),
|
|
9785
|
+
neumorphic: z.boolean().default(false)
|
|
9490
9786
|
}).optional();
|
|
9491
|
-
const dropdownStyleSchema = z
|
|
9787
|
+
const dropdownStyleSchema = z.object({
|
|
9492
9788
|
background: themeColorTokenSchema.default("surface"),
|
|
9493
9789
|
textColor: themeColorTokenSchema.default("text"),
|
|
9494
9790
|
borderColor: themeColorTokenSchema.nullable().default("border"),
|
|
9495
|
-
shadow: z
|
|
9791
|
+
shadow: z.enum([
|
|
9496
9792
|
"none",
|
|
9497
9793
|
"sm",
|
|
9498
9794
|
"md",
|
|
9499
9795
|
"lg"
|
|
9500
9796
|
]).default("md"),
|
|
9501
|
-
borderRadius: z
|
|
9797
|
+
borderRadius: z.enum([
|
|
9502
9798
|
"none",
|
|
9503
9799
|
"sm",
|
|
9504
9800
|
"md",
|
|
@@ -9506,23 +9802,23 @@ const dropdownStyleSchema = z$1.object({
|
|
|
9506
9802
|
]).default("md"),
|
|
9507
9803
|
hoverBackground: themeColorTokenSchema.nullable().optional(),
|
|
9508
9804
|
hoverTextColor: themeColorTokenSchema.nullable().optional(),
|
|
9509
|
-
textTransform: z
|
|
9805
|
+
textTransform: z.enum([
|
|
9510
9806
|
"none",
|
|
9511
9807
|
"uppercase",
|
|
9512
9808
|
"capitalize"
|
|
9513
9809
|
]).default("none"),
|
|
9514
|
-
letterSpacing: z
|
|
9810
|
+
letterSpacing: z.enum([
|
|
9515
9811
|
"normal",
|
|
9516
9812
|
"wide",
|
|
9517
9813
|
"wider"
|
|
9518
9814
|
]).default("normal"),
|
|
9519
|
-
fontWeight: z
|
|
9815
|
+
fontWeight: z.enum([
|
|
9520
9816
|
"regular",
|
|
9521
9817
|
"medium",
|
|
9522
9818
|
"semibold",
|
|
9523
9819
|
"bold"
|
|
9524
9820
|
]).optional(),
|
|
9525
|
-
textSize: z
|
|
9821
|
+
textSize: z.enum([
|
|
9526
9822
|
"xs",
|
|
9527
9823
|
"sm",
|
|
9528
9824
|
"base",
|
|
@@ -9533,7 +9829,7 @@ const dropdownStyleSchema = z$1.object({
|
|
|
9533
9829
|
* CTA button gap (left margin) for desktop header.
|
|
9534
9830
|
* Controls the spacing between nav links and the CTA button.
|
|
9535
9831
|
*/
|
|
9536
|
-
const headerCtaGapSchema = z
|
|
9832
|
+
const headerCtaGapSchema = z.enum([
|
|
9537
9833
|
"none",
|
|
9538
9834
|
"tight",
|
|
9539
9835
|
"compact",
|
|
@@ -9541,7 +9837,7 @@ const headerCtaGapSchema = z$1.enum([
|
|
|
9541
9837
|
"relaxed",
|
|
9542
9838
|
"spacious"
|
|
9543
9839
|
]);
|
|
9544
|
-
const headerCtaTreatmentSchema = z
|
|
9840
|
+
const headerCtaTreatmentSchema = z.enum([
|
|
9545
9841
|
"default",
|
|
9546
9842
|
"primary",
|
|
9547
9843
|
"secondary",
|
|
@@ -9549,39 +9845,39 @@ const headerCtaTreatmentSchema = z$1.enum([
|
|
|
9549
9845
|
"outline",
|
|
9550
9846
|
"ghost"
|
|
9551
9847
|
]);
|
|
9552
|
-
const navContainerSchema = z
|
|
9553
|
-
type: z
|
|
9848
|
+
const navContainerSchema = z.object({
|
|
9849
|
+
type: z.enum([
|
|
9554
9850
|
"none",
|
|
9555
9851
|
"pill",
|
|
9556
9852
|
"glass"
|
|
9557
9853
|
]).default("none"),
|
|
9558
|
-
tint: z
|
|
9559
|
-
opacity: z
|
|
9854
|
+
tint: z.string().nullable().optional(),
|
|
9855
|
+
opacity: z.number().min(0).max(1).default(.15)
|
|
9560
9856
|
}).default({
|
|
9561
9857
|
type: "none",
|
|
9562
9858
|
tint: null,
|
|
9563
9859
|
opacity: .15
|
|
9564
9860
|
});
|
|
9565
|
-
const headerBackgroundSchema = z
|
|
9566
|
-
type: z
|
|
9861
|
+
const headerBackgroundSchema = z.object({
|
|
9862
|
+
type: z.enum([
|
|
9567
9863
|
"color",
|
|
9568
9864
|
"gradient",
|
|
9569
9865
|
"image"
|
|
9570
9866
|
]),
|
|
9571
|
-
contentOwner: z
|
|
9867
|
+
contentOwner: z.literal(siteChromeBackgroundOverrideOwner).optional(),
|
|
9572
9868
|
color: tokenOrCssColorValueSchema.nullable().optional(),
|
|
9573
9869
|
gradient: gradientConfigSchema.nullable().optional(),
|
|
9574
|
-
image: mediaSchema
|
|
9870
|
+
image: mediaSchema.nullable().optional(),
|
|
9575
9871
|
textColor: tokenOrCssColorValueSchema.nullable().optional()
|
|
9576
9872
|
});
|
|
9577
|
-
const headerSchema = z
|
|
9578
|
-
variant:
|
|
9873
|
+
const headerSchema = z.object({
|
|
9874
|
+
variant: headerVariantWithLegacyAliasSchema,
|
|
9579
9875
|
positioning: headerPositioning,
|
|
9580
|
-
shrinkOnScroll: z
|
|
9876
|
+
shrinkOnScroll: z.boolean(),
|
|
9581
9877
|
maxWidth: headerMaxWidth,
|
|
9582
9878
|
barFrame: headerBarFrame.optional(),
|
|
9583
9879
|
scrollTreatment: headerScrollTreatmentSchema,
|
|
9584
|
-
logoOverride: mediaSchema
|
|
9880
|
+
logoOverride: mediaSchema.nullable().optional(),
|
|
9585
9881
|
background: headerBackgroundSchema.default({
|
|
9586
9882
|
type: "color",
|
|
9587
9883
|
color: "surface"
|
|
@@ -9590,11 +9886,10 @@ const headerSchema = z$1.object({
|
|
|
9590
9886
|
navStyle: headerNavStyle,
|
|
9591
9887
|
navColor: themeColorTokenSchema.nullable().optional(),
|
|
9592
9888
|
navWeight: navFontWeight.default("medium"),
|
|
9593
|
-
navFontRole: z
|
|
9594
|
-
navTypography: z$1.enum(["body", "heading"]).optional(),
|
|
9889
|
+
navFontRole: z.enum(["body", "heading"]).optional(),
|
|
9595
9890
|
navTextSize: navLinkStyleSchema.shape.textSize,
|
|
9596
9891
|
interactionPalette: headerInteractionPaletteSchema.optional(),
|
|
9597
|
-
navPlacement: z
|
|
9892
|
+
navPlacement: z.enum(["end", "center"]).optional(),
|
|
9598
9893
|
container: headerContainerSchema,
|
|
9599
9894
|
border: headerBorderSchema,
|
|
9600
9895
|
shadow: componentShadowSchema.optional(),
|
|
@@ -9605,47 +9900,33 @@ const headerSchema = z$1.object({
|
|
|
9605
9900
|
navLinkStyle: navLinkStyleSchema.optional(),
|
|
9606
9901
|
ctaGap: headerCtaGapSchema.optional(),
|
|
9607
9902
|
ctaTreatment: headerCtaTreatmentSchema.optional(),
|
|
9608
|
-
ctaVariant: z
|
|
9903
|
+
ctaVariant: z.string().min(1).optional(),
|
|
9609
9904
|
dropdownStyle: dropdownStyleSchema
|
|
9610
|
-
})
|
|
9611
|
-
|
|
9612
|
-
* Normalises the legacy `navTypography` font-role alias into the canonical
|
|
9613
|
-
* `navFontRole` field so persisted themes migrate at the parse boundary without
|
|
9614
|
-
* a data migration. `navFontRole` always wins when both are present; the legacy
|
|
9615
|
-
* field is dropped so we never carry a dual write forward.
|
|
9616
|
-
*/
|
|
9617
|
-
function normaliseHeaderNavFontRole(header) {
|
|
9618
|
-
if (header.navTypography === void 0) return header;
|
|
9619
|
-
const { navTypography, ...rest } = header;
|
|
9620
|
-
return header.navFontRole === void 0 ? {
|
|
9621
|
-
...rest,
|
|
9622
|
-
navFontRole: navTypography
|
|
9623
|
-
} : rest;
|
|
9624
|
-
}
|
|
9625
|
-
const footerVariant = z$1.enum([
|
|
9905
|
+
});
|
|
9906
|
+
const footerVariant = z.enum([
|
|
9626
9907
|
"simple",
|
|
9627
9908
|
"columns",
|
|
9628
9909
|
"split"
|
|
9629
9910
|
]);
|
|
9630
|
-
const footerMaxWidth = z
|
|
9631
|
-
const footerMode = z
|
|
9911
|
+
const footerMaxWidth = z.enum(["container", "full"]);
|
|
9912
|
+
const footerMode = z.enum([
|
|
9632
9913
|
"default",
|
|
9633
9914
|
"blocks",
|
|
9634
9915
|
"default+blocks",
|
|
9635
9916
|
"none"
|
|
9636
9917
|
]);
|
|
9637
|
-
const footerNavLayoutMode = z
|
|
9918
|
+
const footerNavLayoutMode = z.enum([
|
|
9638
9919
|
"stack",
|
|
9639
9920
|
"inline",
|
|
9640
9921
|
"inline-wrap"
|
|
9641
9922
|
]);
|
|
9642
|
-
const footerNavLayoutAlign = z
|
|
9923
|
+
const footerNavLayoutAlign = z.enum([
|
|
9643
9924
|
"start",
|
|
9644
9925
|
"center",
|
|
9645
9926
|
"end",
|
|
9646
9927
|
"space-between"
|
|
9647
9928
|
]);
|
|
9648
|
-
const footerSpacing = z
|
|
9929
|
+
const footerSpacing = z.enum([
|
|
9649
9930
|
"none",
|
|
9650
9931
|
"tight",
|
|
9651
9932
|
"compact",
|
|
@@ -9653,45 +9934,45 @@ const footerSpacing = z$1.enum([
|
|
|
9653
9934
|
"relaxed",
|
|
9654
9935
|
"spacious"
|
|
9655
9936
|
]);
|
|
9656
|
-
const footerLogoPlacement = z
|
|
9937
|
+
const footerLogoPlacement = z.enum([
|
|
9657
9938
|
"left",
|
|
9658
9939
|
"right",
|
|
9659
9940
|
"above",
|
|
9660
9941
|
"below"
|
|
9661
9942
|
]);
|
|
9662
|
-
const footerLogoSize = z
|
|
9943
|
+
const footerLogoSize = z.enum([
|
|
9663
9944
|
"sm",
|
|
9664
9945
|
"md",
|
|
9665
9946
|
"lg",
|
|
9666
9947
|
"xl"
|
|
9667
9948
|
]);
|
|
9668
|
-
const footerLogoMaxHeight = z
|
|
9949
|
+
const footerLogoMaxHeight = z.enum([
|
|
9669
9950
|
"sm",
|
|
9670
9951
|
"md",
|
|
9671
9952
|
"lg",
|
|
9672
9953
|
"xl"
|
|
9673
9954
|
]);
|
|
9674
|
-
const footerBottomTextLinkStyleSchema = z
|
|
9955
|
+
const footerBottomTextLinkStyleSchema = z.object({
|
|
9675
9956
|
colorToken: themeColorTokenSchema.optional(),
|
|
9676
9957
|
hoverColorToken: themeColorTokenSchema.nullable().optional(),
|
|
9677
9958
|
decorationColorToken: themeColorTokenSchema.nullable().optional(),
|
|
9678
|
-
underline: z
|
|
9959
|
+
underline: z.boolean().optional()
|
|
9679
9960
|
});
|
|
9680
|
-
const footerBottomBarSchema = z
|
|
9681
|
-
enabled: z
|
|
9682
|
-
fullBleed: z
|
|
9961
|
+
const footerBottomBarSchema = z.object({
|
|
9962
|
+
enabled: z.boolean().optional(),
|
|
9963
|
+
fullBleed: z.boolean().optional(),
|
|
9683
9964
|
background: headerBackgroundSchema.optional(),
|
|
9684
9965
|
textColor: themeColorTokenSchema.nullable().optional(),
|
|
9685
|
-
textAlign: z
|
|
9966
|
+
textAlign: z.enum([
|
|
9686
9967
|
"left",
|
|
9687
9968
|
"center",
|
|
9688
9969
|
"right"
|
|
9689
9970
|
]).optional(),
|
|
9690
9971
|
paddingY: footerSpacing.optional(),
|
|
9691
9972
|
paddingX: footerSpacing.optional(),
|
|
9692
|
-
borderTop: z
|
|
9973
|
+
borderTop: z.object({
|
|
9693
9974
|
colorToken: themeColorTokenSchema.nullable().optional(),
|
|
9694
|
-
width: z
|
|
9975
|
+
width: z.enum([
|
|
9695
9976
|
"none",
|
|
9696
9977
|
"thin",
|
|
9697
9978
|
"medium",
|
|
@@ -9699,26 +9980,26 @@ const footerBottomBarSchema = z$1.object({
|
|
|
9699
9980
|
]).optional()
|
|
9700
9981
|
}).optional()
|
|
9701
9982
|
});
|
|
9702
|
-
const footerNavLayoutSchema = z
|
|
9983
|
+
const footerNavLayoutSchema = z.object({
|
|
9703
9984
|
layout: footerNavLayoutMode.optional(),
|
|
9704
9985
|
align: footerNavLayoutAlign.optional(),
|
|
9705
9986
|
gapX: footerSpacing.optional(),
|
|
9706
9987
|
gapY: footerSpacing.optional(),
|
|
9707
|
-
columns: z
|
|
9988
|
+
columns: z.number().int().min(1).max(6).optional()
|
|
9708
9989
|
});
|
|
9709
|
-
const footerLogoSchema = z
|
|
9710
|
-
showLogo: z
|
|
9711
|
-
showLogoText: z
|
|
9990
|
+
const footerLogoSchema = z.object({
|
|
9991
|
+
showLogo: z.boolean().default(true),
|
|
9992
|
+
showLogoText: z.boolean().optional(),
|
|
9712
9993
|
placement: footerLogoPlacement.optional(),
|
|
9713
9994
|
size: footerLogoSize.optional(),
|
|
9714
9995
|
maxHeight: footerLogoMaxHeight.optional(),
|
|
9715
|
-
align: z
|
|
9996
|
+
align: z.enum([
|
|
9716
9997
|
"start",
|
|
9717
9998
|
"center",
|
|
9718
9999
|
"end"
|
|
9719
10000
|
]).optional()
|
|
9720
10001
|
});
|
|
9721
|
-
const footerSchema = z
|
|
10002
|
+
const footerSchema = z.object({
|
|
9722
10003
|
/**
|
|
9723
10004
|
* SDK-only footer rendering mode.
|
|
9724
10005
|
*
|
|
@@ -9727,7 +10008,7 @@ const footerSchema = z$1.object({
|
|
|
9727
10008
|
mode: footerMode.optional(),
|
|
9728
10009
|
variant: footerVariant,
|
|
9729
10010
|
maxWidth: footerMaxWidth,
|
|
9730
|
-
showLogoText: z
|
|
10011
|
+
showLogoText: z.boolean().optional(),
|
|
9731
10012
|
background: headerBackgroundSchema.default({
|
|
9732
10013
|
type: "color",
|
|
9733
10014
|
color: "surface"
|
|
@@ -9741,18 +10022,18 @@ const footerSchema = z$1.object({
|
|
|
9741
10022
|
logo: footerLogoSchema.optional(),
|
|
9742
10023
|
bottomBar: footerBottomBarSchema.optional()
|
|
9743
10024
|
});
|
|
9744
|
-
const containerPaddingPresetSchema = z
|
|
10025
|
+
const containerPaddingPresetSchema = z.enum([
|
|
9745
10026
|
"tight",
|
|
9746
10027
|
"compact",
|
|
9747
10028
|
"default",
|
|
9748
10029
|
"relaxed"
|
|
9749
10030
|
]);
|
|
9750
|
-
const layoutSchema = z
|
|
10031
|
+
const layoutSchema = z.object({ containerPadding: z.object({
|
|
9751
10032
|
mobile: containerPaddingPresetSchema.optional(),
|
|
9752
10033
|
tablet: containerPaddingPresetSchema.optional(),
|
|
9753
10034
|
desktop: containerPaddingPresetSchema.optional()
|
|
9754
10035
|
}).optional() }).optional();
|
|
9755
|
-
const heroTypographySizeSchema = z
|
|
10036
|
+
const heroTypographySizeSchema = z.enum([
|
|
9756
10037
|
"sm",
|
|
9757
10038
|
"base",
|
|
9758
10039
|
"lg",
|
|
@@ -9764,19 +10045,19 @@ const heroTypographySizeSchema = z$1.enum([
|
|
|
9764
10045
|
"6xl",
|
|
9765
10046
|
"editorial"
|
|
9766
10047
|
]);
|
|
9767
|
-
const heroTypographyLineHeightSchema = z
|
|
10048
|
+
const heroTypographyLineHeightSchema = z.enum([
|
|
9768
10049
|
"tight",
|
|
9769
10050
|
"snug",
|
|
9770
10051
|
"normal",
|
|
9771
10052
|
"relaxed"
|
|
9772
10053
|
]);
|
|
9773
|
-
const heroResponsiveTypographySchema = z
|
|
10054
|
+
const heroResponsiveTypographySchema = z.object({
|
|
9774
10055
|
headlineSize: heroTypographySizeSchema.optional(),
|
|
9775
10056
|
headlineLineHeight: heroTypographyLineHeightSchema.optional(),
|
|
9776
10057
|
subheadlineSize: heroTypographySizeSchema.optional(),
|
|
9777
10058
|
subheadlineLineHeight: heroTypographyLineHeightSchema.optional()
|
|
9778
10059
|
});
|
|
9779
|
-
const heroTypographySchema = z
|
|
10060
|
+
const heroTypographySchema = z.object({
|
|
9780
10061
|
headlineSize: heroTypographySizeSchema.optional(),
|
|
9781
10062
|
headlineLineHeight: heroTypographyLineHeightSchema.optional(),
|
|
9782
10063
|
subheadlineSize: heroTypographySizeSchema.optional(),
|
|
@@ -9785,21 +10066,21 @@ const heroTypographySchema = z$1.object({
|
|
|
9785
10066
|
microHeadlineLineHeight: heroTypographyLineHeightSchema.optional(),
|
|
9786
10067
|
microSubheadlineSize: heroTypographySizeSchema.optional(),
|
|
9787
10068
|
microSubheadlineLineHeight: heroTypographyLineHeightSchema.optional(),
|
|
9788
|
-
responsive: z
|
|
10069
|
+
responsive: z.object({
|
|
9789
10070
|
tablet: heroResponsiveTypographySchema.optional(),
|
|
9790
10071
|
mobile: heroResponsiveTypographySchema.optional()
|
|
9791
10072
|
}).optional()
|
|
9792
10073
|
});
|
|
9793
|
-
const heroSchema = z
|
|
9794
|
-
const bodyTextIntroTypographySizeSchema = z
|
|
9795
|
-
const bodyTextSchema = z
|
|
10074
|
+
const heroSchema = z.object({ typography: heroTypographySchema.optional() }).optional();
|
|
10075
|
+
const bodyTextIntroTypographySizeSchema = z.enum(["default", "editorial"]);
|
|
10076
|
+
const bodyTextSchema = z.object({ intro: z.object({
|
|
9796
10077
|
paragraphSize: bodyTextIntroTypographySizeSchema.optional(),
|
|
9797
10078
|
headingSize: bodyTextIntroTypographySizeSchema.optional()
|
|
9798
10079
|
}).optional() }).optional();
|
|
9799
|
-
const gradientsSchema = z
|
|
9800
|
-
button: z
|
|
9801
|
-
hero: z
|
|
9802
|
-
background: z
|
|
10080
|
+
const gradientsSchema = z.object({
|
|
10081
|
+
button: z.string().min(1).nullable().optional(),
|
|
10082
|
+
hero: z.string().min(1).nullable().optional(),
|
|
10083
|
+
background: z.string().min(1).nullable().optional()
|
|
9803
10084
|
});
|
|
9804
10085
|
/**
|
|
9805
10086
|
* Testimonial quote-mark treatment, owned by the site style (analogous to the
|
|
@@ -9807,27 +10088,27 @@ const gradientsSchema = z$1.object({
|
|
|
9807
10088
|
* it. `none` hides the mark. The block renders the mark; the site style decides
|
|
9808
10089
|
* its character; a look may still hide it.
|
|
9809
10090
|
*/
|
|
9810
|
-
const testimonialQuoteTreatmentSchema = z
|
|
9811
|
-
style: z
|
|
10091
|
+
const testimonialQuoteTreatmentSchema = z.object({
|
|
10092
|
+
style: z.enum([
|
|
9812
10093
|
"serif-display",
|
|
9813
10094
|
"accent-glyph",
|
|
9814
10095
|
"none"
|
|
9815
10096
|
]),
|
|
9816
|
-
fontFamily: z
|
|
9817
|
-
scale: z
|
|
10097
|
+
fontFamily: z.enum(["heading", "body"]).optional(),
|
|
10098
|
+
scale: z.enum([
|
|
9818
10099
|
"sm",
|
|
9819
10100
|
"md",
|
|
9820
10101
|
"lg",
|
|
9821
10102
|
"xl"
|
|
9822
10103
|
]).optional(),
|
|
9823
10104
|
colorToken: themeColorTokenSchema.optional(),
|
|
9824
|
-
opacity: z
|
|
10105
|
+
opacity: z.number().min(0).max(1).optional()
|
|
9825
10106
|
});
|
|
9826
|
-
const themeSchema = z
|
|
9827
|
-
name: z
|
|
9828
|
-
description: z
|
|
9829
|
-
rationale: z
|
|
9830
|
-
siteStyleId: z
|
|
10107
|
+
const themeSchema = z.object({
|
|
10108
|
+
name: z.string().min(1).max(30),
|
|
10109
|
+
description: z.string().min(1).max(400),
|
|
10110
|
+
rationale: z.string().min(1).max(400),
|
|
10111
|
+
siteStyleId: z.string().min(1).transform((value) => asSiteStyleId(value)).optional(),
|
|
9831
10112
|
axes: axesSchema,
|
|
9832
10113
|
palette: paletteSchema,
|
|
9833
10114
|
typography: typographySchema,
|
|
@@ -9848,8 +10129,8 @@ const themeSchema = z$1.object({
|
|
|
9848
10129
|
testimonialQuote: testimonialQuoteTreatmentSchema.optional(),
|
|
9849
10130
|
inputs: inputSystemSchema.optional(),
|
|
9850
10131
|
inputStyle: inputStyle.optional(),
|
|
9851
|
-
blockCustomVars: z
|
|
9852
|
-
blockOverrides: z
|
|
10132
|
+
blockCustomVars: z.record(z.string(), z.record(z.string(), z.string())).optional(),
|
|
10133
|
+
blockOverrides: z.record(z.string(), blockThemeOverrideSchema).optional(),
|
|
9853
10134
|
headingDecoration: headingDecorationSchema.optional(),
|
|
9854
10135
|
customCssRules: customCssRulesSchema,
|
|
9855
10136
|
blockCustomCssRules: blockCustomCssRulesSchema,
|
|
@@ -9879,11 +10160,11 @@ const themeSchema = z$1.object({
|
|
|
9879
10160
|
* }
|
|
9880
10161
|
* ```
|
|
9881
10162
|
*/
|
|
9882
|
-
styleGroups: z
|
|
10163
|
+
styleGroups: z.record(z.string(), z.array(z.string())).optional()
|
|
9883
10164
|
});
|
|
9884
|
-
z
|
|
9885
|
-
message: z
|
|
9886
|
-
themes: z
|
|
10165
|
+
z.object({
|
|
10166
|
+
message: z.string().min(1),
|
|
10167
|
+
themes: z.array(themeSchema).length(3)
|
|
9887
10168
|
});
|
|
9888
10169
|
//#endregion
|
|
9889
10170
|
//#region ../theme-core/src/buttons/classNames.ts
|
|
@@ -9997,6 +10278,7 @@ function resolveButtonStyleRecipe(recipe, parameters) {
|
|
|
9997
10278
|
const buttonSystem = {
|
|
9998
10279
|
global: definition.global,
|
|
9999
10280
|
variants: PUBLIC_BUTTON_ROLES.map((role) => roles[role]),
|
|
10281
|
+
surfacePolicy: definition.surfacePolicy ?? createStandardButtonSurfacePolicy(),
|
|
10000
10282
|
...definition.sizes ? { sizes: definition.sizes } : {}
|
|
10001
10283
|
};
|
|
10002
10284
|
const parsedButtonSystem = buttonSystemSchema.safeParse(buttonSystem);
|
|
@@ -10057,15 +10339,15 @@ const BUTTON_STYLE_IDS = [
|
|
|
10057
10339
|
"ornate-ritual",
|
|
10058
10340
|
"quiet-arrow"
|
|
10059
10341
|
];
|
|
10060
|
-
const quietArrowParametersSchema = z
|
|
10061
|
-
const emptyParametersSchema$1 = z
|
|
10342
|
+
const quietArrowParametersSchema = z.object({ secondaryTreatment: z.enum(["outlined", "solid-accent"]) }).strict();
|
|
10343
|
+
const emptyParametersSchema$1 = z.object({}).strict();
|
|
10062
10344
|
function selectionBranch(styleId, parameters) {
|
|
10063
|
-
return z
|
|
10064
|
-
styleId: z
|
|
10345
|
+
return z.object({
|
|
10346
|
+
styleId: z.literal(styleId),
|
|
10065
10347
|
parameters
|
|
10066
10348
|
}).strict();
|
|
10067
10349
|
}
|
|
10068
|
-
z
|
|
10350
|
+
z.discriminatedUnion("styleId", [
|
|
10069
10351
|
selectionBranch("soft-pill", emptyParametersSchema$1),
|
|
10070
10352
|
selectionBranch("earth-pill", emptyParametersSchema$1),
|
|
10071
10353
|
selectionBranch("confident-chip", emptyParametersSchema$1),
|
|
@@ -10210,7 +10492,7 @@ const quietArrowRecipe = defineButtonStyleRecipe({
|
|
|
10210
10492
|
});
|
|
10211
10493
|
//#endregion
|
|
10212
10494
|
//#region ../theme-core/src/buttons/styles/recipes/defineStaticButtonStyleRecipe.ts
|
|
10213
|
-
const emptyParametersSchema = z
|
|
10495
|
+
const emptyParametersSchema = z.object({}).strict();
|
|
10214
10496
|
function defineStaticButtonStyleRecipe(input) {
|
|
10215
10497
|
const system = normalizeSystem(input.system);
|
|
10216
10498
|
return defineButtonStyleRecipe({
|
|
@@ -11577,13 +11859,25 @@ function presetCategory(recipe) {
|
|
|
11577
11859
|
function joinClasses(...parts) {
|
|
11578
11860
|
return parts.filter((part) => typeof part === "string" && part.length > 0).join(" ");
|
|
11579
11861
|
}
|
|
11580
|
-
|
|
11862
|
+
/**
|
|
11863
|
+
* The class each treatment contributes on top of whatever the caller passed.
|
|
11864
|
+
*
|
|
11865
|
+
* `panel` contributes nothing: its callers already pass `alert alert-*`, so
|
|
11866
|
+
* adopting the vocabulary changes no existing rendering. `field-note` needs a
|
|
11867
|
+
* single hook — its tone styling keys off `data-feedback-tone` in the
|
|
11868
|
+
* theme-generated CSS rather than off a second class.
|
|
11869
|
+
*/
|
|
11870
|
+
function treatmentClass(treatment) {
|
|
11871
|
+
return treatment === "field-note" ? "feedback-note" : void 0;
|
|
11872
|
+
}
|
|
11873
|
+
function FeedbackMessage({ tone, treatment = "panel", children, className, id, title, titleClassName, bodyClassName, role = "status", live }) {
|
|
11581
11874
|
const resolvedLive = live ?? (role === "alert" ? "assertive" : "polite");
|
|
11582
|
-
const shouldWrapBody = Boolean(title || bodyClassName);
|
|
11875
|
+
const shouldWrapBody = Boolean(title || bodyClassName) || treatment === "field-note";
|
|
11583
11876
|
return /* @__PURE__ */ jsxs("div", {
|
|
11584
11877
|
id,
|
|
11585
|
-
className,
|
|
11878
|
+
className: joinClasses(className, treatmentClass(treatment)) || void 0,
|
|
11586
11879
|
"data-feedback-tone": tone,
|
|
11880
|
+
"data-feedback-treatment": treatment,
|
|
11587
11881
|
role,
|
|
11588
11882
|
"aria-live": resolvedLive === "off" ? void 0 : resolvedLive,
|
|
11589
11883
|
children: [title ? /* @__PURE__ */ jsx("p", {
|
|
@@ -12762,16 +13056,10 @@ function DefaultBookingErrorSummary({ errors, id }) {
|
|
|
12762
13056
|
if (!hasBookingValidationErrors(errors)) return null;
|
|
12763
13057
|
return /* @__PURE__ */ jsxs(FeedbackMessage, {
|
|
12764
13058
|
tone: "error",
|
|
12765
|
-
|
|
13059
|
+
treatment: "field-note",
|
|
12766
13060
|
id,
|
|
12767
13061
|
role: "alert",
|
|
12768
|
-
children: [errors.formError ? /* @__PURE__ */ jsx("p", {
|
|
12769
|
-
className: "rb-caption",
|
|
12770
|
-
children: /* @__PURE__ */ jsx("strong", { children: errors.formError })
|
|
12771
|
-
}) : null, Object.entries(errors.fieldErrors).map(([key, message]) => /* @__PURE__ */ jsx("p", {
|
|
12772
|
-
className: "rb-caption",
|
|
12773
|
-
children: message
|
|
12774
|
-
}, key))]
|
|
13062
|
+
children: [errors.formError ? /* @__PURE__ */ jsx("p", { children: /* @__PURE__ */ jsx("strong", { children: errors.formError }) }) : null, Object.entries(errors.fieldErrors).map(([key, message]) => /* @__PURE__ */ jsx("p", { children: message }, key))]
|
|
12775
13063
|
});
|
|
12776
13064
|
}
|
|
12777
13065
|
function SelectedCheck() {
|
|
@@ -12782,67 +13070,67 @@ function SelectedCheck() {
|
|
|
12782
13070
|
}
|
|
12783
13071
|
//#endregion
|
|
12784
13072
|
//#region ../blocks/src/system/blocks/shared/bookingPaymentTerms.ts
|
|
12785
|
-
const bookingDepositRefundPolicySchema = z
|
|
12786
|
-
const bookingInstalmentPlanSchema = z
|
|
12787
|
-
z
|
|
12788
|
-
kind: z
|
|
12789
|
-
depositAmountCents: z
|
|
13073
|
+
const bookingDepositRefundPolicySchema = z.enum(["refundable", "non_refundable"]);
|
|
13074
|
+
const bookingInstalmentPlanSchema = z.union([
|
|
13075
|
+
z.object({
|
|
13076
|
+
kind: z.literal("deposit_plus_one_remainder"),
|
|
13077
|
+
depositAmountCents: z.number().int().min(0),
|
|
12790
13078
|
depositRefundability: bookingDepositRefundPolicySchema,
|
|
12791
|
-
remainderDueCount: z
|
|
12792
|
-
intervalUnit: z
|
|
13079
|
+
remainderDueCount: z.number().int().positive(),
|
|
13080
|
+
intervalUnit: z.enum([
|
|
12793
13081
|
"day",
|
|
12794
13082
|
"week",
|
|
12795
13083
|
"month"
|
|
12796
13084
|
])
|
|
12797
13085
|
}),
|
|
12798
|
-
z
|
|
12799
|
-
kind: z
|
|
12800
|
-
depositAmountCents: z
|
|
13086
|
+
z.object({
|
|
13087
|
+
kind: z.literal("deposit_plus_scheduled_instalments"),
|
|
13088
|
+
depositAmountCents: z.number().int().min(0),
|
|
12801
13089
|
depositRefundability: bookingDepositRefundPolicySchema,
|
|
12802
|
-
instalmentCount: z
|
|
12803
|
-
intervalCount: z
|
|
12804
|
-
intervalUnit: z
|
|
13090
|
+
instalmentCount: z.number().int().positive(),
|
|
13091
|
+
intervalCount: z.number().int().positive(),
|
|
13092
|
+
intervalUnit: z.enum([
|
|
12805
13093
|
"day",
|
|
12806
13094
|
"week",
|
|
12807
13095
|
"month"
|
|
12808
13096
|
])
|
|
12809
13097
|
}),
|
|
12810
|
-
z
|
|
12811
|
-
kind: z
|
|
12812
|
-
instalmentCount: z
|
|
12813
|
-
intervalCount: z
|
|
12814
|
-
intervalUnit: z
|
|
13098
|
+
z.object({
|
|
13099
|
+
kind: z.literal("equal_scheduled_instalments"),
|
|
13100
|
+
instalmentCount: z.number().int().positive(),
|
|
13101
|
+
intervalCount: z.number().int().positive(),
|
|
13102
|
+
intervalUnit: z.enum([
|
|
12815
13103
|
"day",
|
|
12816
13104
|
"week",
|
|
12817
13105
|
"month"
|
|
12818
13106
|
])
|
|
12819
13107
|
})
|
|
12820
13108
|
]);
|
|
12821
|
-
const bookingFlexibleBalanceDueDateRuleSchema = z
|
|
12822
|
-
kind: z
|
|
12823
|
-
daysBeforeStart: z
|
|
12824
|
-
}), z
|
|
12825
|
-
kind: z
|
|
12826
|
-
dueAt: z
|
|
13109
|
+
const bookingFlexibleBalanceDueDateRuleSchema = z.union([z.object({
|
|
13110
|
+
kind: z.literal("relative_to_start_date"),
|
|
13111
|
+
daysBeforeStart: z.number().int().positive()
|
|
13112
|
+
}), z.object({
|
|
13113
|
+
kind: z.literal("fixed_calendar_date"),
|
|
13114
|
+
dueAt: z.string().datetime()
|
|
12827
13115
|
})]);
|
|
12828
|
-
const bookingFlexibleBalanceConfigSchema = z
|
|
12829
|
-
upfrontAmountCents: z
|
|
13116
|
+
const bookingFlexibleBalanceConfigSchema = z.object({
|
|
13117
|
+
upfrontAmountCents: z.number().int().min(0),
|
|
12830
13118
|
dueDateRule: bookingFlexibleBalanceDueDateRuleSchema,
|
|
12831
13119
|
depositRefundability: bookingDepositRefundPolicySchema
|
|
12832
13120
|
});
|
|
12833
|
-
const blockBookingPaymentCollectionOptionSchema = z
|
|
12834
|
-
z
|
|
12835
|
-
z
|
|
12836
|
-
z
|
|
12837
|
-
kind: z
|
|
13121
|
+
const blockBookingPaymentCollectionOptionSchema = z.union([
|
|
13122
|
+
z.object({ kind: z.literal("upfront") }),
|
|
13123
|
+
z.object({ kind: z.literal("deferred_manual") }),
|
|
13124
|
+
z.object({
|
|
13125
|
+
kind: z.literal("instalment_plan"),
|
|
12838
13126
|
plan: bookingInstalmentPlanSchema
|
|
12839
13127
|
}),
|
|
12840
|
-
z
|
|
12841
|
-
kind: z
|
|
13128
|
+
z.object({
|
|
13129
|
+
kind: z.literal("flexible_balance"),
|
|
12842
13130
|
config: bookingFlexibleBalanceConfigSchema
|
|
12843
13131
|
})
|
|
12844
13132
|
]);
|
|
12845
|
-
const blockBookingPaymentTermsSchema = z
|
|
13133
|
+
const blockBookingPaymentTermsSchema = z.object({ allowedOptions: z.array(blockBookingPaymentCollectionOptionSchema).min(1) });
|
|
12846
13134
|
//#endregion
|
|
12847
13135
|
//#region ../blocks/src/system/runtime/shared/utils/checkoutUrls.ts
|
|
12848
13136
|
/**
|
|
@@ -14416,95 +14704,6 @@ function requiresPaymentStep(params) {
|
|
|
14416
14704
|
return !isEntitlementSelection(params.paymentSelection);
|
|
14417
14705
|
}
|
|
14418
14706
|
//#endregion
|
|
14419
|
-
//#region ../blocks/src/lib/media.ts
|
|
14420
|
-
const hotspotSchema = z.object({
|
|
14421
|
-
x: z.number().min(0).max(1),
|
|
14422
|
-
y: z.number().min(0).max(1),
|
|
14423
|
-
radius: z.number().optional()
|
|
14424
|
-
});
|
|
14425
|
-
const rotationSchema = z.union([
|
|
14426
|
-
z.literal(0),
|
|
14427
|
-
z.literal(90),
|
|
14428
|
-
z.literal(180),
|
|
14429
|
-
z.literal(270)
|
|
14430
|
-
]);
|
|
14431
|
-
const rectSchema = z.tuple([
|
|
14432
|
-
z.number(),
|
|
14433
|
-
z.number(),
|
|
14434
|
-
z.number(),
|
|
14435
|
-
z.number()
|
|
14436
|
-
]);
|
|
14437
|
-
const aspectCropSchema = z.object({
|
|
14438
|
-
aspect: z.preprocess((value) => value == null ? void 0 : value, z.string().optional()),
|
|
14439
|
-
rect: z.preprocess((value) => value == null ? void 0 : value, rectSchema.optional()),
|
|
14440
|
-
hotspot: z.preprocess((value) => value == null ? void 0 : value, hotspotSchema.optional()),
|
|
14441
|
-
rotation: z.preprocess((value) => value == null ? void 0 : value, rotationSchema.optional())
|
|
14442
|
-
});
|
|
14443
|
-
const transformSchema = z.object({
|
|
14444
|
-
aspectCrops: z.preprocess((value) => {
|
|
14445
|
-
if (!value || typeof value !== "object" || Array.isArray(value)) return;
|
|
14446
|
-
return value;
|
|
14447
|
-
}, z.record(z.string(), aspectCropSchema.catch({}))).optional(),
|
|
14448
|
-
rect: rectSchema.optional(),
|
|
14449
|
-
hotspot: hotspotSchema.optional(),
|
|
14450
|
-
rotation: rotationSchema.optional()
|
|
14451
|
-
});
|
|
14452
|
-
const mediaPosterSchema = z.discriminatedUnion("tag", [z.object({
|
|
14453
|
-
tag: z.literal("storage"),
|
|
14454
|
-
assetId: z.string().optional(),
|
|
14455
|
-
storageBucket: z.string().min(1),
|
|
14456
|
-
storagePath: z.string().min(1)
|
|
14457
|
-
}), z.object({
|
|
14458
|
-
tag: z.literal("external-src"),
|
|
14459
|
-
assetId: z.string().optional(),
|
|
14460
|
-
src: z.string().url()
|
|
14461
|
-
})]);
|
|
14462
|
-
const mediaBaseSchema = z.object({
|
|
14463
|
-
purpose: z.string().optional(),
|
|
14464
|
-
placeholder: z.boolean().default(true).optional(),
|
|
14465
|
-
assetId: z.string().optional(),
|
|
14466
|
-
identifier: z.string().optional(),
|
|
14467
|
-
src: z.string().optional(),
|
|
14468
|
-
alt: z.string().optional(),
|
|
14469
|
-
filename: z.string().optional(),
|
|
14470
|
-
mimeType: z.string().optional(),
|
|
14471
|
-
width: z.number().optional(),
|
|
14472
|
-
height: z.number().optional(),
|
|
14473
|
-
storageBucket: z.string().optional(),
|
|
14474
|
-
storagePath: z.string().optional(),
|
|
14475
|
-
poster: mediaPosterSchema.optional(),
|
|
14476
|
-
transform: transformSchema.optional()
|
|
14477
|
-
});
|
|
14478
|
-
/**
|
|
14479
|
-
* Canonical identifier carried by media values that are safe to persist.
|
|
14480
|
-
* Parsing trims boundary input so downstream writers cannot retain whitespace-only
|
|
14481
|
-
* identifiers or independently disagree about normalization.
|
|
14482
|
-
*/
|
|
14483
|
-
const mediaIdentifierSchema = z.string().trim().min(1).brand();
|
|
14484
|
-
const imageMediaSchema = mediaBaseSchema.extend({ type: z.literal("image") });
|
|
14485
|
-
const videoMediaSchema = mediaBaseSchema.extend({ type: z.literal("video") });
|
|
14486
|
-
const audioMediaSchema = mediaBaseSchema.extend({ type: z.literal("audio") });
|
|
14487
|
-
const documentMediaSchema = mediaBaseSchema.extend({ type: z.literal("document") });
|
|
14488
|
-
const spreadsheetMediaSchema = mediaBaseSchema.extend({ type: z.literal("spreadsheet") });
|
|
14489
|
-
const archiveMediaSchema = mediaBaseSchema.extend({ type: z.literal("archive") });
|
|
14490
|
-
const mediaSchema = z.discriminatedUnion("type", [
|
|
14491
|
-
imageMediaSchema,
|
|
14492
|
-
videoMediaSchema,
|
|
14493
|
-
audioMediaSchema,
|
|
14494
|
-
documentMediaSchema,
|
|
14495
|
-
spreadsheetMediaSchema,
|
|
14496
|
-
archiveMediaSchema
|
|
14497
|
-
]);
|
|
14498
|
-
const persistableMediaBaseSchema = mediaBaseSchema.extend({ identifier: mediaIdentifierSchema });
|
|
14499
|
-
z.discriminatedUnion("type", [
|
|
14500
|
-
persistableMediaBaseSchema.extend({ type: z.literal("image") }),
|
|
14501
|
-
persistableMediaBaseSchema.extend({ type: z.literal("video") }),
|
|
14502
|
-
persistableMediaBaseSchema.extend({ type: z.literal("audio") }),
|
|
14503
|
-
persistableMediaBaseSchema.extend({ type: z.literal("document") }),
|
|
14504
|
-
persistableMediaBaseSchema.extend({ type: z.literal("spreadsheet") }),
|
|
14505
|
-
persistableMediaBaseSchema.extend({ type: z.literal("archive") })
|
|
14506
|
-
]);
|
|
14507
|
-
//#endregion
|
|
14508
14707
|
//#region ../blocks/src/system/manifest/richTextSchema.ts
|
|
14509
14708
|
/**
|
|
14510
14709
|
* Shared Rich Text Schema
|
|
@@ -14525,16 +14724,16 @@ z.discriminatedUnion("type", [
|
|
|
14525
14724
|
* - attrs: Node attributes (e.g., alignment, color)
|
|
14526
14725
|
* - marks: Text formatting marks (e.g., bold, italic)
|
|
14527
14726
|
*/
|
|
14528
|
-
const TipTapMarkSchema = z
|
|
14529
|
-
type: z
|
|
14530
|
-
attrs: z
|
|
14727
|
+
const TipTapMarkSchema = z.object({
|
|
14728
|
+
type: z.string().min(1),
|
|
14729
|
+
attrs: z.record(z.string(), z.unknown()).optional()
|
|
14531
14730
|
}).strict();
|
|
14532
|
-
const TipTapNodeSchema = z
|
|
14533
|
-
type: z
|
|
14534
|
-
content: z
|
|
14535
|
-
text: z
|
|
14536
|
-
attrs: z
|
|
14537
|
-
marks: z
|
|
14731
|
+
const TipTapNodeSchema = z.lazy(() => z.object({
|
|
14732
|
+
type: z.string().min(1),
|
|
14733
|
+
content: z.array(TipTapNodeSchema).optional(),
|
|
14734
|
+
text: z.string().optional(),
|
|
14735
|
+
attrs: z.record(z.string(), z.unknown()).optional(),
|
|
14736
|
+
marks: z.array(TipTapMarkSchema).optional()
|
|
14538
14737
|
}).strict().superRefine((node, ctx) => {
|
|
14539
14738
|
if (node.type === "doc") ctx.addIssue({
|
|
14540
14739
|
code: "custom",
|
|
@@ -14569,113 +14768,114 @@ const TipTapNodeSchema = z$1.lazy(() => z$1.object({
|
|
|
14569
14768
|
* non-legacy consumer can rely on.
|
|
14570
14769
|
*
|
|
14571
14770
|
*/
|
|
14572
|
-
const RichTextDocSchema = z
|
|
14573
|
-
type: z
|
|
14574
|
-
content: z
|
|
14771
|
+
const RichTextDocSchema = z.object({
|
|
14772
|
+
type: z.literal("doc"),
|
|
14773
|
+
content: z.array(TipTapNodeSchema)
|
|
14575
14774
|
}).strict();
|
|
14576
14775
|
//#endregion
|
|
14577
14776
|
//#region ../blocks/src/system/blocks/courses/shared/schemas.ts
|
|
14578
14777
|
/**
|
|
14579
14778
|
* Zod schema for course venue data
|
|
14580
14779
|
*/
|
|
14581
|
-
const courseVenueSchema = z
|
|
14582
|
-
id: z
|
|
14583
|
-
name: z
|
|
14584
|
-
address: z
|
|
14780
|
+
const courseVenueSchema = z.object({
|
|
14781
|
+
id: z.string(),
|
|
14782
|
+
name: z.string(),
|
|
14783
|
+
address: z.string().nullable()
|
|
14585
14784
|
});
|
|
14586
14785
|
/**
|
|
14587
14786
|
* Zod schema for course session (occurrence) data
|
|
14588
14787
|
*/
|
|
14589
|
-
const courseSessionSchema = z
|
|
14590
|
-
id: z
|
|
14591
|
-
startsAt: z
|
|
14592
|
-
endsAt: z
|
|
14593
|
-
timeZone: z
|
|
14594
|
-
capacityOverride: z
|
|
14595
|
-
overrides: z
|
|
14788
|
+
const courseSessionSchema = z.object({
|
|
14789
|
+
id: z.string(),
|
|
14790
|
+
startsAt: z.string(),
|
|
14791
|
+
endsAt: z.string(),
|
|
14792
|
+
timeZone: z.string(),
|
|
14793
|
+
capacityOverride: z.number().nullable().optional(),
|
|
14794
|
+
overrides: z.record(z.string(), z.unknown()).nullable().optional()
|
|
14596
14795
|
});
|
|
14597
|
-
const courseTeamMemberSummarySchema = z
|
|
14598
|
-
id: z
|
|
14599
|
-
name: z
|
|
14600
|
-
roleLabel: z
|
|
14601
|
-
summary: z
|
|
14602
|
-
profilePath: z
|
|
14796
|
+
const courseTeamMemberSummarySchema = z.object({
|
|
14797
|
+
id: z.string(),
|
|
14798
|
+
name: z.string(),
|
|
14799
|
+
roleLabel: z.string().nullable(),
|
|
14800
|
+
summary: z.string().nullable(),
|
|
14801
|
+
profilePath: z.string().nullable()
|
|
14603
14802
|
});
|
|
14604
|
-
const coursePricingOptionSchema = z
|
|
14605
|
-
id: z
|
|
14606
|
-
name: z
|
|
14607
|
-
description: z
|
|
14608
|
-
priceAmount: z
|
|
14609
|
-
isActive: z
|
|
14610
|
-
sortOrder: z
|
|
14611
|
-
capacityLimit: z
|
|
14612
|
-
saleStartsAt: z
|
|
14613
|
-
saleEndsAt: z
|
|
14614
|
-
attendanceScope: z
|
|
14803
|
+
const coursePricingOptionSchema = z.object({
|
|
14804
|
+
id: z.string(),
|
|
14805
|
+
name: z.string(),
|
|
14806
|
+
description: z.string().nullable(),
|
|
14807
|
+
priceAmount: z.number(),
|
|
14808
|
+
isActive: z.boolean(),
|
|
14809
|
+
sortOrder: z.number(),
|
|
14810
|
+
capacityLimit: z.number().nullable(),
|
|
14811
|
+
saleStartsAt: z.string().nullable(),
|
|
14812
|
+
saleEndsAt: z.string().nullable(),
|
|
14813
|
+
attendanceScope: z.enum([
|
|
14615
14814
|
"in_person",
|
|
14616
14815
|
"online",
|
|
14617
14816
|
"both"
|
|
14618
14817
|
]).nullable().optional()
|
|
14619
14818
|
});
|
|
14620
|
-
const coursePricingSchema = z
|
|
14621
|
-
bookingRequirement: z
|
|
14622
|
-
pricingStrategy: z
|
|
14819
|
+
const coursePricingSchema = z.object({
|
|
14820
|
+
bookingRequirement: z.enum(["none", "required"]),
|
|
14821
|
+
pricingStrategy: z.enum([
|
|
14623
14822
|
"free",
|
|
14624
14823
|
"single",
|
|
14625
14824
|
"tiered",
|
|
14626
14825
|
"sliding_scale"
|
|
14627
14826
|
]),
|
|
14628
|
-
currency: z
|
|
14629
|
-
singlePriceAmount: z
|
|
14630
|
-
slidingMinAmount: z
|
|
14631
|
-
slidingMaxAmount: z
|
|
14632
|
-
slidingSuggestedAmount: z
|
|
14827
|
+
currency: z.string(),
|
|
14828
|
+
singlePriceAmount: z.number().nullable(),
|
|
14829
|
+
slidingMinAmount: z.number().nullable().optional(),
|
|
14830
|
+
slidingMaxAmount: z.number().nullable().optional(),
|
|
14831
|
+
slidingSuggestedAmount: z.number().nullable().optional(),
|
|
14633
14832
|
paymentTerms: blockBookingPaymentTermsSchema,
|
|
14634
|
-
options: z
|
|
14833
|
+
options: z.array(coursePricingOptionSchema)
|
|
14635
14834
|
});
|
|
14636
14835
|
/**
|
|
14637
14836
|
* Zod schema for public course data
|
|
14638
14837
|
*/
|
|
14639
|
-
const publicWholeSeriesOfferingSchema = z
|
|
14640
|
-
eventSeriesId: z
|
|
14641
|
-
eventOfferingId: z
|
|
14642
|
-
title: z
|
|
14643
|
-
slug: z
|
|
14644
|
-
description: z
|
|
14645
|
-
teamMembers: z
|
|
14646
|
-
enrollmentOpen: z
|
|
14838
|
+
const publicWholeSeriesOfferingSchema = z.object({
|
|
14839
|
+
eventSeriesId: z.string(),
|
|
14840
|
+
eventOfferingId: z.string(),
|
|
14841
|
+
title: z.string(),
|
|
14842
|
+
slug: z.string(),
|
|
14843
|
+
description: z.unknown().nullable(),
|
|
14844
|
+
teamMembers: z.array(courseTeamMemberSummarySchema).optional(),
|
|
14845
|
+
enrollmentOpen: z.boolean(),
|
|
14647
14846
|
pricing: coursePricingSchema,
|
|
14648
|
-
currency: z
|
|
14847
|
+
currency: z.string(),
|
|
14649
14848
|
paymentTerms: blockBookingPaymentTermsSchema,
|
|
14650
|
-
enrollmentCapacity: z
|
|
14651
|
-
acceptsMemberships: z
|
|
14652
|
-
status: z
|
|
14849
|
+
enrollmentCapacity: z.number().nullable(),
|
|
14850
|
+
acceptsMemberships: z.boolean(),
|
|
14851
|
+
status: z.enum([
|
|
14653
14852
|
"active",
|
|
14654
14853
|
"draft",
|
|
14655
14854
|
"cancelled"
|
|
14656
14855
|
]),
|
|
14657
|
-
sessionsCount: z
|
|
14658
|
-
enrolledCount: z
|
|
14659
|
-
availableSpots: z
|
|
14660
|
-
sessions: z
|
|
14856
|
+
sessionsCount: z.number(),
|
|
14857
|
+
enrolledCount: z.number(),
|
|
14858
|
+
availableSpots: z.number().nullable(),
|
|
14859
|
+
sessions: z.array(courseSessionSchema),
|
|
14661
14860
|
venue: courseVenueSchema.nullable()
|
|
14662
14861
|
});
|
|
14663
|
-
z
|
|
14862
|
+
z.array(publicWholeSeriesOfferingSchema);
|
|
14664
14863
|
//#endregion
|
|
14665
14864
|
//#region ../blocks/src/system/blocks/events/shared/schemas.ts
|
|
14666
|
-
const eventPresetSchema = z
|
|
14865
|
+
const eventPresetSchema = z.enum([
|
|
14667
14866
|
"event",
|
|
14668
14867
|
"class",
|
|
14669
14868
|
"course",
|
|
14869
|
+
"term",
|
|
14670
14870
|
"workshop",
|
|
14671
14871
|
"retreat",
|
|
14672
14872
|
"performance"
|
|
14673
14873
|
]);
|
|
14674
|
-
const eventScheduleScopeSchema = z
|
|
14675
|
-
const publicEventRecurrenceSchema = z
|
|
14676
|
-
kind: z
|
|
14677
|
-
interval: z
|
|
14678
|
-
weekdays: z
|
|
14874
|
+
const eventScheduleScopeSchema = z.enum(["recurring", "oneOff"]);
|
|
14875
|
+
const publicEventRecurrenceSchema = z.discriminatedUnion("kind", [z.object({
|
|
14876
|
+
kind: z.literal("weekly"),
|
|
14877
|
+
interval: z.number().int().positive(),
|
|
14878
|
+
weekdays: z.array(z.enum([
|
|
14679
14879
|
"MO",
|
|
14680
14880
|
"TU",
|
|
14681
14881
|
"WE",
|
|
@@ -14684,38 +14884,38 @@ const publicEventRecurrenceSchema = z$1.discriminatedUnion("kind", [z$1.object({
|
|
|
14684
14884
|
"SA",
|
|
14685
14885
|
"SU"
|
|
14686
14886
|
]))
|
|
14687
|
-
}).readonly(), z
|
|
14688
|
-
const eventDestinationModeSchema = z
|
|
14689
|
-
const publicEventDestinationSchema = z
|
|
14690
|
-
kind: z
|
|
14887
|
+
}).readonly(), z.object({ kind: z.literal("other") }).readonly()]);
|
|
14888
|
+
const eventDestinationModeSchema = z.enum(["cms-managed", "system-managed"]);
|
|
14889
|
+
const publicEventDestinationSchema = z.discriminatedUnion("kind", [z.object({
|
|
14890
|
+
kind: z.literal("native"),
|
|
14691
14891
|
mode: eventDestinationModeSchema,
|
|
14692
|
-
path: z
|
|
14693
|
-
}), z
|
|
14694
|
-
kind: z
|
|
14695
|
-
url: z
|
|
14696
|
-
label: z
|
|
14892
|
+
path: z.string()
|
|
14893
|
+
}), z.object({
|
|
14894
|
+
kind: z.literal("external"),
|
|
14895
|
+
url: z.string(),
|
|
14896
|
+
label: z.string()
|
|
14697
14897
|
})]);
|
|
14698
14898
|
/**
|
|
14699
14899
|
* Zod schema for venue data
|
|
14700
14900
|
*/
|
|
14701
|
-
const eventVenueSchema = z
|
|
14702
|
-
id: z
|
|
14703
|
-
name: z
|
|
14704
|
-
address: z
|
|
14705
|
-
location: z
|
|
14706
|
-
lat: z
|
|
14707
|
-
lng: z
|
|
14901
|
+
const eventVenueSchema = z.object({
|
|
14902
|
+
id: z.string(),
|
|
14903
|
+
name: z.string(),
|
|
14904
|
+
address: z.string().nullable(),
|
|
14905
|
+
location: z.object({
|
|
14906
|
+
lat: z.number(),
|
|
14907
|
+
lng: z.number()
|
|
14708
14908
|
}).nullable()
|
|
14709
14909
|
});
|
|
14710
14910
|
/**
|
|
14711
14911
|
* Zod schema for event category data
|
|
14712
14912
|
*/
|
|
14713
|
-
const eventCategorySchema = z
|
|
14714
|
-
id: z
|
|
14715
|
-
name: z
|
|
14716
|
-
color: z
|
|
14913
|
+
const eventCategorySchema = z.object({
|
|
14914
|
+
id: z.string(),
|
|
14915
|
+
name: z.string(),
|
|
14916
|
+
color: z.string().nullable()
|
|
14717
14917
|
});
|
|
14718
|
-
z
|
|
14918
|
+
z.enum([
|
|
14719
14919
|
"free",
|
|
14720
14920
|
"paid",
|
|
14721
14921
|
"external"
|
|
@@ -14723,290 +14923,278 @@ z$1.enum([
|
|
|
14723
14923
|
/**
|
|
14724
14924
|
* Access restriction type for public events
|
|
14725
14925
|
*/
|
|
14726
|
-
const accessRestrictionSchema = z
|
|
14727
|
-
z
|
|
14728
|
-
const
|
|
14729
|
-
z
|
|
14730
|
-
|
|
14731
|
-
|
|
14732
|
-
|
|
14733
|
-
z
|
|
14734
|
-
|
|
14735
|
-
|
|
14736
|
-
|
|
14737
|
-
|
|
14738
|
-
z
|
|
14739
|
-
|
|
14740
|
-
|
|
14741
|
-
|
|
14742
|
-
|
|
14743
|
-
z
|
|
14744
|
-
|
|
14745
|
-
|
|
14746
|
-
|
|
14926
|
+
const accessRestrictionSchema = z.enum(["none", "category"]);
|
|
14927
|
+
z.enum(["single", "ticket_types"]);
|
|
14928
|
+
const freePriceDisplaySchema = z.object({
|
|
14929
|
+
kind: z.literal("free"),
|
|
14930
|
+
currency: z.string()
|
|
14931
|
+
});
|
|
14932
|
+
const exactPriceDisplaySchema = z.object({
|
|
14933
|
+
kind: z.literal("exact"),
|
|
14934
|
+
amount: z.number(),
|
|
14935
|
+
currency: z.string()
|
|
14936
|
+
});
|
|
14937
|
+
const fromPriceDisplaySchema = z.object({
|
|
14938
|
+
kind: z.literal("from"),
|
|
14939
|
+
amount: z.number(),
|
|
14940
|
+
currency: z.string()
|
|
14941
|
+
});
|
|
14942
|
+
const unavailablePriceDisplaySchema = z.object({
|
|
14943
|
+
kind: z.literal("unavailable"),
|
|
14944
|
+
currency: z.string()
|
|
14945
|
+
});
|
|
14946
|
+
const rangePriceDisplaySchema = z.object({
|
|
14947
|
+
kind: z.literal("range"),
|
|
14948
|
+
minAmount: z.number(),
|
|
14949
|
+
maxAmount: z.number(),
|
|
14950
|
+
currency: z.string()
|
|
14951
|
+
});
|
|
14952
|
+
const mixedPriceDisplaySchema = z.object({
|
|
14953
|
+
kind: z.literal("mixed"),
|
|
14954
|
+
paidFromAmount: z.number(),
|
|
14955
|
+
paidToAmount: z.number(),
|
|
14956
|
+
currency: z.string()
|
|
14957
|
+
});
|
|
14958
|
+
const publicCoursePriceDisplaySchema = z.discriminatedUnion("kind", [
|
|
14959
|
+
freePriceDisplaySchema,
|
|
14960
|
+
exactPriceDisplaySchema,
|
|
14961
|
+
fromPriceDisplaySchema,
|
|
14962
|
+
unavailablePriceDisplaySchema
|
|
14747
14963
|
]);
|
|
14748
|
-
z
|
|
14749
|
-
|
|
14750
|
-
|
|
14751
|
-
|
|
14752
|
-
|
|
14753
|
-
|
|
14754
|
-
|
|
14755
|
-
|
|
14756
|
-
|
|
14757
|
-
|
|
14758
|
-
z$1.object({
|
|
14759
|
-
kind: z$1.literal("from"),
|
|
14760
|
-
amount: z$1.number(),
|
|
14761
|
-
currency: z$1.string()
|
|
14762
|
-
}),
|
|
14763
|
-
z$1.object({
|
|
14764
|
-
kind: z$1.literal("range"),
|
|
14765
|
-
minAmount: z$1.number(),
|
|
14766
|
-
maxAmount: z$1.number(),
|
|
14767
|
-
currency: z$1.string()
|
|
14768
|
-
}),
|
|
14769
|
-
z$1.object({
|
|
14770
|
-
kind: z$1.literal("mixed"),
|
|
14771
|
-
paidFromAmount: z$1.number(),
|
|
14772
|
-
paidToAmount: z$1.number(),
|
|
14773
|
-
currency: z$1.string()
|
|
14774
|
-
}),
|
|
14775
|
-
z$1.object({
|
|
14776
|
-
kind: z$1.literal("unavailable"),
|
|
14777
|
-
currency: z$1.string()
|
|
14964
|
+
z.discriminatedUnion("kind", [
|
|
14965
|
+
freePriceDisplaySchema,
|
|
14966
|
+
exactPriceDisplaySchema,
|
|
14967
|
+
fromPriceDisplaySchema,
|
|
14968
|
+
rangePriceDisplaySchema,
|
|
14969
|
+
mixedPriceDisplaySchema,
|
|
14970
|
+
unavailablePriceDisplaySchema,
|
|
14971
|
+
z.object({
|
|
14972
|
+
kind: z.literal("external"),
|
|
14973
|
+
label: z.string()
|
|
14778
14974
|
}),
|
|
14779
|
-
z
|
|
14780
|
-
kind: z
|
|
14781
|
-
label: z$1.string()
|
|
14782
|
-
}),
|
|
14783
|
-
z$1.object({
|
|
14784
|
-
kind: z$1.literal("course"),
|
|
14975
|
+
z.object({
|
|
14976
|
+
kind: z.literal("course"),
|
|
14785
14977
|
display: publicCoursePriceDisplaySchema
|
|
14786
14978
|
})
|
|
14787
14979
|
]);
|
|
14788
|
-
const publicEventTicketTypePriceDisplaySchema = z
|
|
14789
|
-
|
|
14790
|
-
|
|
14791
|
-
|
|
14792
|
-
|
|
14793
|
-
|
|
14794
|
-
|
|
14795
|
-
amount: z$1.number(),
|
|
14796
|
-
currency: z$1.string()
|
|
14797
|
-
}),
|
|
14798
|
-
z$1.object({
|
|
14799
|
-
kind: z$1.literal("from"),
|
|
14800
|
-
amount: z$1.number(),
|
|
14801
|
-
currency: z$1.string()
|
|
14802
|
-
}),
|
|
14803
|
-
z$1.object({
|
|
14804
|
-
kind: z$1.literal("range"),
|
|
14805
|
-
minAmount: z$1.number(),
|
|
14806
|
-
maxAmount: z$1.number(),
|
|
14807
|
-
currency: z$1.string()
|
|
14808
|
-
}),
|
|
14809
|
-
z$1.object({
|
|
14810
|
-
kind: z$1.literal("mixed"),
|
|
14811
|
-
paidFromAmount: z$1.number(),
|
|
14812
|
-
paidToAmount: z$1.number(),
|
|
14813
|
-
currency: z$1.string()
|
|
14814
|
-
}),
|
|
14815
|
-
z$1.object({
|
|
14816
|
-
kind: z$1.literal("unavailable"),
|
|
14817
|
-
currency: z$1.string()
|
|
14818
|
-
})
|
|
14980
|
+
const publicEventTicketTypePriceDisplaySchema = z.union([
|
|
14981
|
+
freePriceDisplaySchema,
|
|
14982
|
+
exactPriceDisplaySchema,
|
|
14983
|
+
fromPriceDisplaySchema,
|
|
14984
|
+
rangePriceDisplaySchema,
|
|
14985
|
+
mixedPriceDisplaySchema,
|
|
14986
|
+
unavailablePriceDisplaySchema
|
|
14819
14987
|
]);
|
|
14820
|
-
const publicEventAttendanceModeSchema = z
|
|
14821
|
-
const publicEventAttendanceModeAvailabilitySchema = z
|
|
14988
|
+
const publicEventAttendanceModeSchema = z.enum(["in_person", "online"]);
|
|
14989
|
+
const publicEventAttendanceModeAvailabilitySchema = z.object({
|
|
14822
14990
|
mode: publicEventAttendanceModeSchema,
|
|
14823
|
-
capacity: z
|
|
14824
|
-
registeredCount: z
|
|
14825
|
-
availableSpots: z
|
|
14826
|
-
waitlistEnabled: z
|
|
14991
|
+
capacity: z.number().nullable(),
|
|
14992
|
+
registeredCount: z.number(),
|
|
14993
|
+
availableSpots: z.number().nullable(),
|
|
14994
|
+
waitlistEnabled: z.boolean()
|
|
14827
14995
|
});
|
|
14828
|
-
const publicEventTicketTypeAvailabilitySchema = z
|
|
14829
|
-
kind: z
|
|
14830
|
-
remainingCapacity: z
|
|
14831
|
-
}), z
|
|
14832
|
-
kind: z
|
|
14833
|
-
reason: z
|
|
14996
|
+
const publicEventTicketTypeAvailabilitySchema = z.union([z.object({
|
|
14997
|
+
kind: z.literal("available"),
|
|
14998
|
+
remainingCapacity: z.number().nullable()
|
|
14999
|
+
}), z.object({
|
|
15000
|
+
kind: z.literal("unavailable"),
|
|
15001
|
+
reason: z.enum([
|
|
14834
15002
|
"inactive",
|
|
14835
15003
|
"not_on_sale_yet",
|
|
14836
15004
|
"sale_ended",
|
|
14837
15005
|
"sold_out",
|
|
14838
15006
|
"event_sold_out"
|
|
14839
15007
|
]),
|
|
14840
|
-
remainingCapacity: z
|
|
15008
|
+
remainingCapacity: z.number().nullable()
|
|
14841
15009
|
})]);
|
|
14842
|
-
const publicEventTicketTypeSchema = z
|
|
14843
|
-
id: z
|
|
14844
|
-
siteId: z
|
|
14845
|
-
eventSeriesId: z
|
|
14846
|
-
name: z
|
|
14847
|
-
description: z
|
|
14848
|
-
priceAmount: z
|
|
14849
|
-
isActive: z
|
|
14850
|
-
sortOrder: z
|
|
14851
|
-
capacityMode: z
|
|
14852
|
-
capacityLimit: z
|
|
14853
|
-
attendanceScope: z
|
|
15010
|
+
const publicEventTicketTypeSchema = z.object({
|
|
15011
|
+
id: z.string(),
|
|
15012
|
+
siteId: z.string(),
|
|
15013
|
+
eventSeriesId: z.string(),
|
|
15014
|
+
name: z.string(),
|
|
15015
|
+
description: z.string().nullable(),
|
|
15016
|
+
priceAmount: z.number(),
|
|
15017
|
+
isActive: z.boolean(),
|
|
15018
|
+
sortOrder: z.number(),
|
|
15019
|
+
capacityMode: z.enum(["limited", "unlimited"]),
|
|
15020
|
+
capacityLimit: z.number().nullable(),
|
|
15021
|
+
attendanceScope: z.enum([
|
|
14854
15022
|
"in_person",
|
|
14855
15023
|
"online",
|
|
14856
15024
|
"both"
|
|
14857
15025
|
]).optional(),
|
|
14858
|
-
saleStartsAt: z
|
|
14859
|
-
saleEndsAt: z
|
|
15026
|
+
saleStartsAt: z.string().nullable(),
|
|
15027
|
+
saleEndsAt: z.string().nullable(),
|
|
14860
15028
|
availability: publicEventTicketTypeAvailabilitySchema,
|
|
14861
|
-
createdAt: z
|
|
14862
|
-
updatedAt: z
|
|
15029
|
+
createdAt: z.string(),
|
|
15030
|
+
updatedAt: z.string()
|
|
14863
15031
|
});
|
|
14864
|
-
const publicEventPricingSchema = z
|
|
14865
|
-
z
|
|
14866
|
-
kind: z
|
|
14867
|
-
currency: z
|
|
14868
|
-
display: z
|
|
14869
|
-
kind: z
|
|
14870
|
-
currency: z
|
|
15032
|
+
const publicEventPricingSchema = z.discriminatedUnion("kind", [
|
|
15033
|
+
z.object({
|
|
15034
|
+
kind: z.literal("drop_in"),
|
|
15035
|
+
currency: z.string(),
|
|
15036
|
+
display: z.object({
|
|
15037
|
+
kind: z.literal("free"),
|
|
15038
|
+
currency: z.string()
|
|
14871
15039
|
})
|
|
14872
15040
|
}),
|
|
14873
|
-
z
|
|
14874
|
-
kind: z
|
|
14875
|
-
currency: z
|
|
14876
|
-
display: z
|
|
14877
|
-
kind: z
|
|
14878
|
-
currency: z
|
|
15041
|
+
z.object({
|
|
15042
|
+
kind: z.literal("free_registration"),
|
|
15043
|
+
currency: z.string(),
|
|
15044
|
+
display: z.object({
|
|
15045
|
+
kind: z.literal("free"),
|
|
15046
|
+
currency: z.string()
|
|
14879
15047
|
})
|
|
14880
15048
|
}),
|
|
14881
|
-
z
|
|
14882
|
-
kind: z
|
|
14883
|
-
amount: z
|
|
14884
|
-
currency: z
|
|
14885
|
-
display: z
|
|
14886
|
-
kind: z
|
|
14887
|
-
amount: z
|
|
14888
|
-
currency: z
|
|
15049
|
+
z.object({
|
|
15050
|
+
kind: z.literal("single_paid"),
|
|
15051
|
+
amount: z.number(),
|
|
15052
|
+
currency: z.string(),
|
|
15053
|
+
display: z.object({
|
|
15054
|
+
kind: z.literal("exact"),
|
|
15055
|
+
amount: z.number(),
|
|
15056
|
+
currency: z.string()
|
|
14889
15057
|
})
|
|
14890
15058
|
}),
|
|
14891
|
-
z
|
|
14892
|
-
kind: z
|
|
14893
|
-
currency: z
|
|
14894
|
-
ticketTypes: z
|
|
15059
|
+
z.object({
|
|
15060
|
+
kind: z.literal("ticket_types"),
|
|
15061
|
+
currency: z.string(),
|
|
15062
|
+
ticketTypes: z.array(publicEventTicketTypeSchema),
|
|
14895
15063
|
display: publicEventTicketTypePriceDisplaySchema
|
|
14896
15064
|
}),
|
|
14897
|
-
z
|
|
14898
|
-
kind: z
|
|
14899
|
-
minAmount: z
|
|
14900
|
-
maxAmount: z
|
|
14901
|
-
suggestedAmount: z
|
|
14902
|
-
currency: z
|
|
14903
|
-
display: z
|
|
14904
|
-
kind: z
|
|
14905
|
-
minAmount: z
|
|
14906
|
-
maxAmount: z
|
|
14907
|
-
currency: z
|
|
15065
|
+
z.object({
|
|
15066
|
+
kind: z.literal("sliding_scale"),
|
|
15067
|
+
minAmount: z.number(),
|
|
15068
|
+
maxAmount: z.number(),
|
|
15069
|
+
suggestedAmount: z.number().nullable(),
|
|
15070
|
+
currency: z.string(),
|
|
15071
|
+
display: z.object({
|
|
15072
|
+
kind: z.literal("range"),
|
|
15073
|
+
minAmount: z.number(),
|
|
15074
|
+
maxAmount: z.number(),
|
|
15075
|
+
currency: z.string()
|
|
14908
15076
|
})
|
|
14909
15077
|
}),
|
|
14910
|
-
z
|
|
14911
|
-
kind: z
|
|
14912
|
-
display: z
|
|
14913
|
-
kind: z
|
|
15078
|
+
z.object({
|
|
15079
|
+
kind: z.literal("course"),
|
|
15080
|
+
display: z.object({
|
|
15081
|
+
kind: z.literal("course"),
|
|
14914
15082
|
display: publicCoursePriceDisplaySchema
|
|
14915
15083
|
})
|
|
14916
15084
|
}),
|
|
14917
|
-
z
|
|
14918
|
-
kind: z
|
|
14919
|
-
display: z
|
|
14920
|
-
kind: z
|
|
14921
|
-
label: z
|
|
15085
|
+
z.object({
|
|
15086
|
+
kind: z.literal("external"),
|
|
15087
|
+
display: z.object({
|
|
15088
|
+
kind: z.literal("external"),
|
|
15089
|
+
label: z.string()
|
|
14922
15090
|
})
|
|
14923
15091
|
})
|
|
14924
15092
|
]);
|
|
14925
|
-
const publicTeamMemberSummarySchema = z
|
|
14926
|
-
id: z
|
|
14927
|
-
name: z
|
|
14928
|
-
roleLabel: z
|
|
14929
|
-
summary: z
|
|
14930
|
-
profilePath: z
|
|
15093
|
+
const publicTeamMemberSummarySchema = z.object({
|
|
15094
|
+
id: z.string(),
|
|
15095
|
+
name: z.string(),
|
|
15096
|
+
roleLabel: z.string().nullable(),
|
|
15097
|
+
summary: z.string().nullable(),
|
|
15098
|
+
profilePath: z.string().nullable()
|
|
14931
15099
|
});
|
|
15100
|
+
const publicEventBookingAvailabilitySchema = z.discriminatedUnion("kind", [z.object({ kind: z.literal("open") }), z.object({
|
|
15101
|
+
kind: z.literal("closed"),
|
|
15102
|
+
reason: z.enum([
|
|
15103
|
+
"occurrence_cancelled",
|
|
15104
|
+
"occurrence_completed",
|
|
15105
|
+
"series_draft",
|
|
15106
|
+
"series_cancelled",
|
|
15107
|
+
"series_completed",
|
|
15108
|
+
"series_archived",
|
|
15109
|
+
"parent_archived",
|
|
15110
|
+
"parent_inconsistent",
|
|
15111
|
+
"not_public",
|
|
15112
|
+
"already_started",
|
|
15113
|
+
"enrollment_closed"
|
|
15114
|
+
])
|
|
15115
|
+
})]);
|
|
14932
15116
|
/**
|
|
14933
15117
|
* Zod schema for public event data
|
|
14934
15118
|
*/
|
|
14935
|
-
const publicEventSchema = z
|
|
14936
|
-
bookingScope: z
|
|
15119
|
+
const publicEventSchema = z.object({
|
|
15120
|
+
bookingScope: z.enum(["single_occurrence", "whole_series"]),
|
|
14937
15121
|
eventPreset: eventPresetSchema.optional(),
|
|
14938
15122
|
eventDestinationMode: eventDestinationModeSchema.optional(),
|
|
14939
15123
|
scheduleScope: eventScheduleScopeSchema.optional(),
|
|
14940
15124
|
recurrence: publicEventRecurrenceSchema.optional(),
|
|
14941
|
-
id: z
|
|
14942
|
-
occurrenceId: z
|
|
14943
|
-
seriesId: z
|
|
14944
|
-
title: z
|
|
14945
|
-
description: z
|
|
14946
|
-
content: z
|
|
14947
|
-
presentation: z
|
|
14948
|
-
cardTitleOverride: z
|
|
14949
|
-
summary: z
|
|
15125
|
+
id: z.string(),
|
|
15126
|
+
occurrenceId: z.string(),
|
|
15127
|
+
seriesId: z.string(),
|
|
15128
|
+
title: z.string(),
|
|
15129
|
+
description: z.string().nullable(),
|
|
15130
|
+
content: z.object({ body: RichTextDocSchema.nullable().optional() }).optional(),
|
|
15131
|
+
presentation: z.object({
|
|
15132
|
+
cardTitleOverride: z.string().nullable().optional(),
|
|
15133
|
+
summary: z.string().nullable().optional(),
|
|
14950
15134
|
image: mediaSchema.nullable().optional()
|
|
14951
15135
|
}).optional(),
|
|
14952
|
-
slug: z
|
|
14953
|
-
path: z
|
|
15136
|
+
slug: z.string(),
|
|
15137
|
+
path: z.string().nullable(),
|
|
14954
15138
|
destination: publicEventDestinationSchema,
|
|
14955
|
-
requiresRegistration: z
|
|
14956
|
-
|
|
15139
|
+
requiresRegistration: z.boolean(),
|
|
15140
|
+
bookingAvailability: publicEventBookingAvailabilitySchema,
|
|
15141
|
+
deliveryMode: z.enum([
|
|
14957
15142
|
"in_person",
|
|
14958
15143
|
"online",
|
|
14959
15144
|
"hybrid"
|
|
14960
15145
|
]),
|
|
14961
|
-
attendanceModes: z
|
|
14962
|
-
startsAt: z
|
|
14963
|
-
endsAt: z
|
|
14964
|
-
capacity: z
|
|
14965
|
-
registeredCount: z
|
|
14966
|
-
availableSpots: z
|
|
14967
|
-
waitlistEnabled: z
|
|
15146
|
+
attendanceModes: z.array(publicEventAttendanceModeAvailabilitySchema),
|
|
15147
|
+
startsAt: z.string(),
|
|
15148
|
+
endsAt: z.string(),
|
|
15149
|
+
capacity: z.number().nullable(),
|
|
15150
|
+
registeredCount: z.number(),
|
|
15151
|
+
availableSpots: z.number().nullable(),
|
|
15152
|
+
waitlistEnabled: z.boolean(),
|
|
14968
15153
|
venue: eventVenueSchema.nullable(),
|
|
14969
15154
|
eventCategory: eventCategorySchema.nullable(),
|
|
14970
|
-
teamMembers: z
|
|
14971
|
-
status: z
|
|
15155
|
+
teamMembers: z.array(publicTeamMemberSummarySchema).optional(),
|
|
15156
|
+
status: z.enum([
|
|
14972
15157
|
"active",
|
|
14973
15158
|
"draft",
|
|
15159
|
+
"cancelled",
|
|
15160
|
+
"completed",
|
|
14974
15161
|
"archived"
|
|
14975
15162
|
]).optional(),
|
|
14976
|
-
timeZone: z
|
|
15163
|
+
timeZone: z.string(),
|
|
14977
15164
|
pricing: publicEventPricingSchema,
|
|
14978
15165
|
paymentTerms: blockBookingPaymentTermsSchema,
|
|
14979
15166
|
accessRestriction: accessRestrictionSchema,
|
|
14980
|
-
allowedCategoryIds: z
|
|
14981
|
-
requireGuestDetails: z
|
|
14982
|
-
acceptsPasses: z
|
|
14983
|
-
acceptsMemberships: z
|
|
14984
|
-
wholeSeries: z
|
|
14985
|
-
eventSeriesId: z
|
|
15167
|
+
allowedCategoryIds: z.array(z.string()),
|
|
15168
|
+
requireGuestDetails: z.boolean().optional(),
|
|
15169
|
+
acceptsPasses: z.boolean().optional(),
|
|
15170
|
+
acceptsMemberships: z.boolean().optional(),
|
|
15171
|
+
wholeSeries: z.object({
|
|
15172
|
+
eventSeriesId: z.string(),
|
|
14986
15173
|
pricing: coursePricingSchema,
|
|
14987
|
-
currency: z
|
|
14988
|
-
enrollmentOpen: z
|
|
15174
|
+
currency: z.string(),
|
|
15175
|
+
enrollmentOpen: z.boolean()
|
|
14989
15176
|
}).nullable().optional()
|
|
14990
15177
|
});
|
|
14991
|
-
z
|
|
14992
|
-
const unsupportedEventRegistrationPageSurfaceSubjectSchema = z
|
|
14993
|
-
kind: z
|
|
14994
|
-
reason: z
|
|
15178
|
+
z.array(publicEventSchema);
|
|
15179
|
+
const unsupportedEventRegistrationPageSurfaceSubjectSchema = z.object({
|
|
15180
|
+
kind: z.literal("unsupported"),
|
|
15181
|
+
reason: z.enum([
|
|
14995
15182
|
"unsupportedSubject",
|
|
14996
15183
|
"invalidEventSeriesId",
|
|
15184
|
+
"invalidEventSeriesBookingScope",
|
|
14997
15185
|
"invalidEventOfferingId"
|
|
14998
15186
|
])
|
|
14999
15187
|
});
|
|
15000
|
-
z
|
|
15188
|
+
z.unknown().transform((value, ctx) => {
|
|
15001
15189
|
const unsupported = unsupportedEventRegistrationPageSurfaceSubjectSchema.safeParse(value);
|
|
15002
15190
|
if (unsupported.success) return unsupported.data;
|
|
15003
15191
|
const parsed = parseEventPageSurfaceSubject(value);
|
|
15004
15192
|
if (parsed.ok) return parsed.value;
|
|
15005
15193
|
ctx.addIssue({
|
|
15006
|
-
code: z
|
|
15194
|
+
code: z.ZodIssueCode.custom,
|
|
15007
15195
|
message: `Invalid event page-surface subject (${parsed.error.kind})`
|
|
15008
15196
|
});
|
|
15009
|
-
return z
|
|
15197
|
+
return z.NEVER;
|
|
15010
15198
|
});
|
|
15011
15199
|
function parseEventRegistrationPageSurfaceSubject(value) {
|
|
15012
15200
|
return parseEventPageSurfaceSubject(value);
|
|
@@ -15024,6 +15212,10 @@ function normalizeEventRegistrationPageSurfaceSubject(value) {
|
|
|
15024
15212
|
kind: "unsupported",
|
|
15025
15213
|
reason: "invalidEventSeriesId"
|
|
15026
15214
|
};
|
|
15215
|
+
case "invalidEventSeriesBookingScope": return {
|
|
15216
|
+
kind: "unsupported",
|
|
15217
|
+
reason: "invalidEventSeriesBookingScope"
|
|
15218
|
+
};
|
|
15027
15219
|
case "invalidEventOfferingId": return {
|
|
15028
15220
|
kind: "unsupported",
|
|
15029
15221
|
reason: "invalidEventOfferingId"
|
|
@@ -15136,8 +15328,8 @@ function normalizePublicEventLike(value) {
|
|
|
15136
15328
|
}
|
|
15137
15329
|
//#endregion
|
|
15138
15330
|
//#region ../blocks/src/system/runtime/nodes/event-registration/event-registration.headless.planning.ts
|
|
15139
|
-
function
|
|
15140
|
-
return
|
|
15331
|
+
function isEventRegistrationAvailable(event) {
|
|
15332
|
+
return event.bookingAvailability.kind === "open";
|
|
15141
15333
|
}
|
|
15142
15334
|
function normalizeEventRegistrationMaxTickets(value) {
|
|
15143
15335
|
if (typeof value === "number" && Number.isFinite(value) && value > 0) return Math.floor(value);
|
|
@@ -15293,8 +15485,7 @@ function resolveHeadlessEventRegistrationView(wizard) {
|
|
|
15293
15485
|
kind: "empty",
|
|
15294
15486
|
message: "No events available for registration."
|
|
15295
15487
|
};
|
|
15296
|
-
|
|
15297
|
-
if (!wizard.scopedEvents.some((event) => !event.status || allowedStatuses.includes(event.status)) && !wizard.occurrenceContext) return {
|
|
15488
|
+
if (!wizard.scopedEvents.some(isEventRegistrationAvailable) && !wizard.occurrenceContext) return {
|
|
15298
15489
|
kind: "unavailable",
|
|
15299
15490
|
message: "Registration is not currently available for this event."
|
|
15300
15491
|
};
|