@riverbankcms/sdk 0.130.0 → 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 +1 -1
- package/dist/{PreviewEditorSidebar-DiEpbOdw.mjs → PreviewEditorSidebar-BY-1QdE2.mjs} +18 -15
- package/dist/{PreviewEditorUI-C6MvxnIa.mjs → PreviewEditorUI-BS34jI9_.mjs} +3 -3
- package/dist/{PreviewQueryProvider-C2rnoPz6.mjs → PreviewQueryProvider-BD0kOjtI.mjs} +1 -1
- package/dist/{SdkPreviewModeRuntime-DRXA_m5L.mjs → SdkPreviewModeRuntime-B1pWnhu-.mjs} +48 -21
- package/dist/{SiteChromeCustomizeContext-BTHdv5_-.mjs → SiteChromeCustomizeContext-BhUG_72i.mjs} +6180 -5076
- package/dist/_dts/ai/src/contracts/proposals.d.ts +309 -32
- package/dist/_dts/ai/src/contracts/siteStyleProposalSchemas.d.ts +969 -112
- 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/bookingConfig.d.ts +10 -20
- package/dist/_dts/api/src/bookingManagementEndpoints.d.ts +4 -5
- package/dist/_dts/api/src/bookingManagementEventEndpointTypes.d.ts +15 -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/endpoints.d.ts +1253 -1209
- package/dist/_dts/api/src/event-destination-policy.d.ts +1 -1
- package/dist/_dts/api/src/eventManagementContracts.d.ts +83 -7
- 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 +11 -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/eventEndpoints.d.ts +5 -5
- package/dist/_dts/api/src/publicExperience/wholeSeriesEndpoints.d.ts +0 -1
- package/dist/_dts/api/src/sdk-event-upsert.d.ts +2 -0
- package/dist/_dts/api/src/sdkBlockUpsertContracts.d.ts +48 -0
- package/dist/_dts/api/src/sdkContracts.d.ts +5 -13
- package/dist/_dts/api/src/sdkEventCategoryContracts.d.ts +9 -0
- package/dist/_dts/api/src/sdkThemeWire.d.ts +40 -8
- 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 +12 -4
- 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/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/media-text.d.ts +7 -30
- 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/customize/backgrounds.d.ts +1 -3
- package/dist/_dts/blocks/src/system/fields/boxStyles.d.ts +13 -1
- package/dist/_dts/blocks/src/system/fields/gridLayout.d.ts +20 -0
- 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/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/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/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/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 +4 -0
- package/dist/_dts/blocks/src/system/transforms/registry/boxStyles.d.ts +26 -0
- package/dist/_dts/blocks/src/system/transforms/registry/layout.d.ts +4 -37
- package/dist/_dts/content-editor/src/components/ContentFieldsForm.d.ts +2 -2
- 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/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/index.d.ts +3 -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 +341 -0
- 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/PreviewShell.d.ts +2 -0
- package/dist/_dts/preview-next/src/client/preview/PreviewSiteFontStorageContext.d.ts +6 -0
- package/dist/_dts/preview-next/src/client/preview/siteFontPreview.d.ts +5 -0
- 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/contracts/index.d.ts +1 -1
- package/dist/_dts/sdk/src/contracts/system-block-content.d.ts +61 -39
- package/dist/_dts/sdk/src/preview-next/keep-alive.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/components/Layout.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/index.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/islands/types.d.ts +9 -1
- 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/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/mock-themes/all.d.ts +12 -135
- 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 +301 -94
- 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/designState.d.ts +21 -385
- package/dist/_dts/theme-core/src/site-styles/generatedSchemas.d.ts +10 -18
- package/dist/_dts/theme-core/src/site-styles/headerLayoutTypes.d.ts +2 -4
- package/dist/_dts/theme-core/src/site-styles/headerOpeningForeground.d.ts +2 -9
- package/dist/_dts/theme-core/src/site-styles/headerOpeningSection.d.ts +0 -2
- package/dist/_dts/theme-core/src/site-styles/index.d.ts +5 -0
- 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/previewRuntimeCapabilities.d.ts +19 -0
- package/dist/_dts/theme-core/src/site-styles/runtimeBackgroundResolution.d.ts +9 -0
- package/dist/_dts/theme-core/src/site-styles/runtimeCompiler.d.ts +1 -62
- 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-Bvtz9G9g.mjs → CourseRegistrationWizard-DGW9F0SQ.mjs} +7 -7
- package/dist/client/{DiscountCodeDisclosure-Ur-Xx1U_.mjs → DiscountCodeDisclosure-BPZ-yfGI.mjs} +1 -1
- package/dist/client/{EventCombined.client-EhscD4U6.mjs → EventCombined.client-Cjt3kKYR.mjs} +4 -4
- package/dist/client/{EventListing.client-Bn26cFTY.mjs → EventListing.client-DY9dn6Fh.mjs} +2 -2
- package/dist/client/{FeedbackMessage-ByMrs3cr.mjs → FeedbackMessage-CtLvvS_d.mjs} +15 -3
- package/dist/client/{LeafletStaticMap-BUw9Ntzr.mjs → LeafletStaticMap--2c61XYn.mjs} +1 -1
- package/dist/client/{StepIndicator-BfbdiVQI.mjs → StepIndicator-CLjQhkDb.mjs} +3 -3
- package/dist/client/{accordion-CjIeof73.mjs → accordion-_boYwHHi.mjs} +1 -1
- package/dist/client/{bookingForm-DwEeovf_.mjs → bookingForm--AqEfyBX.mjs} +56 -39
- package/dist/client/bookings.mjs +393 -192
- package/dist/client/{carousel-BMrfgOba.mjs → carousel-CVI2dqZr.mjs} +2 -2
- package/dist/client/{carousel.client-CpwTUhIo.mjs → carousel.client-59G_WMr4.mjs} +1 -1
- package/dist/client/{cart-rXEdxTdb.mjs → cart-DR6IiPz9.mjs} +3 -3
- package/dist/client/{checkout-D3JlSzh3.mjs → checkout-CsrGAfQt.mjs} +3 -3
- package/dist/client/client.mjs +4524 -3512
- 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-DO5XvMAA.mjs → courseRegistration-aNJVaLa3.mjs} +3 -3
- package/dist/client/{eventCalendar-DO6rTqCn.mjs → eventCalendar-OZ7h59VN.mjs} +6 -6
- package/dist/client/{eventCombined-bJ3i_ovU.mjs → eventCombined-BbJ6bFKz.mjs} +3 -3
- package/dist/client/{eventDetails-CCbrXE7o.mjs → eventDetails-BLyUBiCT.mjs} +3 -3
- package/dist/client/{eventListing-Bdlt9YTm.mjs → eventListing-DuP1yhBS.mjs} +3 -3
- package/dist/client/{eventRegistration-B02lt6iY.mjs → eventRegistration-BXyECPa-.mjs} +11 -12
- package/dist/client/{form-DrUBAAox.mjs → form-BA4t3kKU.mjs} +4 -4
- package/dist/client/{headerSection-MzqvHL6T.mjs → headerSection-CpNaJxhW.mjs} +2 -2
- package/dist/client/hooks.mjs +1967 -2059
- package/dist/client/{locationMap-DG8BxTBm.mjs → locationMap-3HGMCL7_.mjs} +3 -3
- package/dist/client/{media-CNE1Z-wb.mjs → media-BOHuueS5.mjs} +16 -4
- package/dist/client/{newsletterForm-BzO-Td3p.mjs → newsletterForm-C2s6Mw67.mjs} +4 -4
- package/dist/client/{pricing-NgK7ozkg.mjs → pricing-BiqIMgZk.mjs} +1 -1
- package/dist/client/{productDetail-CfQ7rhVK.mjs → productDetail-C9joWhdE.mjs} +3 -3
- package/dist/client/{productList-C23rOLUi.mjs → productList-CjzdU3pB.mjs} +3 -3
- package/dist/client/{propsDecoder-CAZdhwjs.mjs → propsDecoder-CBPGXEYX.mjs} +395 -402
- package/dist/client/rendering/client.mjs +2004 -2856
- package/dist/client/rendering/islands.mjs +20 -20
- package/dist/client/rendering.mjs +4605 -3496
- package/dist/client/{scrollToBlock-DSSqVQr1.mjs → scrollToBlock-DZ73aEX6.mjs} +1 -1
- package/dist/client/{shop-BMToKLK7.mjs → shop-CQRai7hj.mjs} +7 -7
- package/dist/client/{shop-commerce-DB4JRKmp.mjs → shop-commerce-hP9UboOx.mjs} +8 -8
- package/dist/client/{shop-commerce-store-BOqSIOuc.mjs → shop-commerce-store-DiD5a32e.mjs} +1 -1
- package/dist/client/{shopShared-B6SK9DZv.mjs → shopShared-DP8DXTkF.mjs} +5 -5
- package/dist/client/{useEventFilters-CULOa4nB.mjs → useEventFilters-pF_OJNQP.mjs} +137 -81
- package/dist/client/{usePolling-BGG_8-jl.mjs → usePolling-Cls91SD2.mjs} +2 -2
- package/dist/preview-next/before-render.mjs +192 -108
- package/dist/preview-next/client/runtime.mjs +4 -4
- package/dist/preview-next/keepAlive.mjs +7406 -29
- package/dist/preview-next/middleware.mjs +186 -107
- package/dist/{previewAuthStore-_GXFRg2W.mjs → previewAuthStore-CX1C_KJ4.mjs} +185 -107
- package/dist/{sdk-runtime-hhSOMShR.mjs → sdk-runtime-5CcPAI14.mjs} +2 -2
- package/dist/{separator-flRaFc14.mjs → separator-BXlYN_gr.mjs} +1 -1
- package/dist/server/components.mjs +6363 -4998
- package/dist/server/config-validation.mjs +1967 -2059
- package/dist/server/config.mjs +1967 -2059
- package/dist/server/data.mjs +1967 -2059
- package/dist/server/index.mjs +186 -108
- package/dist/server/next.mjs +6553 -5285
- package/dist/server/page-converter.mjs +1031 -1844
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/rendering/server.mjs +3352 -3006
- package/dist/server/rendering.mjs +6289 -4924
- package/dist/server/routing.mjs +1906 -1036
- package/dist/server/server.mjs +1976 -2165
- package/dist/server/theme-bridge.mjs +949 -670
- package/dist/server/theme.mjs +252 -51
- package/dist/styles/index.css +295 -334
- 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/client/clsx-DgIEfj3H.mjs +0 -16
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { E as ok$1, T as err$1, a as paletteColorEntries, c as themeColorTokenSchema, g as parseEventSeriesId, h as parseEventOfferingId, l as parseColorTokenParts, o as paletteColorsFromEntries, p as parseAspectRatioValue, r as rgbColorValue, s as parseThemeColorToken } from "./colorStyles-CrxJrPjJ.mjs";
|
|
2
|
+
import "react";
|
|
2
3
|
import { z } from "zod";
|
|
4
|
+
import "react/jsx-runtime";
|
|
3
5
|
//#region ../core/src/assert-never.ts
|
|
4
6
|
function assertNever$2(value, message = "Unexpected variant") {
|
|
5
7
|
throw new Error(`${message}: ${String(value)}`);
|
|
@@ -142,18 +144,32 @@ function formatEventPricing(pricing, options = {}) {
|
|
|
142
144
|
}
|
|
143
145
|
//#endregion
|
|
144
146
|
//#region ../core/src/event-page-surface-subject.ts
|
|
147
|
+
function createEventSeriesPageSurfaceSubject(eventSeriesId, bookingScope) {
|
|
148
|
+
return bookingScope === "whole_series" ? {
|
|
149
|
+
kind: "eventSeries",
|
|
150
|
+
eventSeriesId,
|
|
151
|
+
bookingScope,
|
|
152
|
+
isWholeSeriesBooking: true
|
|
153
|
+
} : {
|
|
154
|
+
kind: "eventSeries",
|
|
155
|
+
eventSeriesId,
|
|
156
|
+
bookingScope
|
|
157
|
+
};
|
|
158
|
+
}
|
|
145
159
|
function parseEventPageSurfaceSubject(value) {
|
|
146
160
|
if (!isRecord$6(value)) return err$1({ kind: "notObject" });
|
|
147
161
|
switch (value.kind) {
|
|
148
162
|
case "eventSeries": {
|
|
149
163
|
const eventSeriesId = parseEventSeriesId(value.eventSeriesId);
|
|
150
|
-
|
|
151
|
-
kind: "eventSeries",
|
|
152
|
-
eventSeriesId: eventSeriesId.value
|
|
153
|
-
}) : err$1({
|
|
164
|
+
if (!eventSeriesId.ok) return err$1({
|
|
154
165
|
kind: "invalidEventSeriesId",
|
|
155
166
|
error: eventSeriesId.error
|
|
156
167
|
});
|
|
168
|
+
if (value.bookingScope !== "single_occurrence" && value.bookingScope !== "whole_series") return err$1({
|
|
169
|
+
kind: "invalidEventSeriesBookingScope",
|
|
170
|
+
bookingScope: value.bookingScope
|
|
171
|
+
});
|
|
172
|
+
return ok$1(createEventSeriesPageSurfaceSubject(eventSeriesId.value, value.bookingScope));
|
|
157
173
|
}
|
|
158
174
|
case "eventOffering": {
|
|
159
175
|
const eventOfferingId = parseEventOfferingId(value.eventOfferingId);
|
|
@@ -1480,105 +1496,6 @@ const eventCalendarListLayoutValues = [
|
|
|
1480
1496
|
"compact"
|
|
1481
1497
|
];
|
|
1482
1498
|
//#endregion
|
|
1483
|
-
//#region ../theme-core/src/tokens/blockColorTokens.ts
|
|
1484
|
-
const blockColorTokenNames = [
|
|
1485
|
-
"text",
|
|
1486
|
-
"heading",
|
|
1487
|
-
"mutedText",
|
|
1488
|
-
"surface",
|
|
1489
|
-
"background",
|
|
1490
|
-
"foreground",
|
|
1491
|
-
"border",
|
|
1492
|
-
"primary",
|
|
1493
|
-
"secondary",
|
|
1494
|
-
"accent",
|
|
1495
|
-
"success",
|
|
1496
|
-
"warning",
|
|
1497
|
-
"info",
|
|
1498
|
-
"error",
|
|
1499
|
-
"destructive",
|
|
1500
|
-
"scrim",
|
|
1501
|
-
"shadow",
|
|
1502
|
-
"onPrimary",
|
|
1503
|
-
"onSecondary",
|
|
1504
|
-
"onAccent",
|
|
1505
|
-
"onSuccess",
|
|
1506
|
-
"onWarning",
|
|
1507
|
-
"onInfo",
|
|
1508
|
-
"onError",
|
|
1509
|
-
"onDestructive",
|
|
1510
|
-
"onSurface"
|
|
1511
|
-
];
|
|
1512
|
-
new Set(blockColorTokenNames);
|
|
1513
|
-
//#endregion
|
|
1514
|
-
//#region ../theme-core/src/tokens/themeColorTokens.ts
|
|
1515
|
-
/**
|
|
1516
|
-
* Known palette role token names. This is the low-level source of truth for
|
|
1517
|
-
* palette roles used by palette variants, Theme V2 schemas, and runtime color
|
|
1518
|
-
* reference parsing.
|
|
1519
|
-
*/
|
|
1520
|
-
const PALETTE_TOKEN_NAMES = [
|
|
1521
|
-
"primary",
|
|
1522
|
-
"primaryForeground",
|
|
1523
|
-
"secondary",
|
|
1524
|
-
"accent",
|
|
1525
|
-
"success",
|
|
1526
|
-
"warning",
|
|
1527
|
-
"destructive",
|
|
1528
|
-
"background",
|
|
1529
|
-
"surface",
|
|
1530
|
-
"surfaceAlt",
|
|
1531
|
-
"muted",
|
|
1532
|
-
"text",
|
|
1533
|
-
"border"
|
|
1534
|
-
];
|
|
1535
|
-
const paletteTokenNameSchema = z.enum(PALETTE_TOKEN_NAMES);
|
|
1536
|
-
const themeColorBaseTokenNames = [
|
|
1537
|
-
...PALETTE_TOKEN_NAMES,
|
|
1538
|
-
...blockColorTokenNames,
|
|
1539
|
-
"white",
|
|
1540
|
-
"neutral",
|
|
1541
|
-
"primaryText",
|
|
1542
|
-
"secondaryForeground",
|
|
1543
|
-
"accentForeground"
|
|
1544
|
-
];
|
|
1545
|
-
const themeColorBaseTokenSet = new Set(themeColorBaseTokenNames);
|
|
1546
|
-
const shadeStepSet = /* @__PURE__ */ new Set([
|
|
1547
|
-
"50",
|
|
1548
|
-
"100",
|
|
1549
|
-
"200",
|
|
1550
|
-
"300",
|
|
1551
|
-
"400",
|
|
1552
|
-
"500",
|
|
1553
|
-
"600",
|
|
1554
|
-
"700",
|
|
1555
|
-
"800",
|
|
1556
|
-
"900",
|
|
1557
|
-
"950"
|
|
1558
|
-
]);
|
|
1559
|
-
function isKnownBaseToken(value) {
|
|
1560
|
-
return themeColorBaseTokenSet.has(value);
|
|
1561
|
-
}
|
|
1562
|
-
function isKnownShadeToken(value) {
|
|
1563
|
-
const match = value.match(/^([a-zA-Z][a-zA-Z0-9]*)(?:-([0-9]{2,3}))$/);
|
|
1564
|
-
if (!match) return false;
|
|
1565
|
-
const [, base, shade] = match;
|
|
1566
|
-
return Boolean(base && shade && isKnownBaseToken(base) && shadeStepSet.has(shade));
|
|
1567
|
-
}
|
|
1568
|
-
function isThemeColorTokenBase(value) {
|
|
1569
|
-
return isKnownBaseToken(value) || isKnownShadeToken(value);
|
|
1570
|
-
}
|
|
1571
|
-
function isThemeColorToken(value) {
|
|
1572
|
-
if (typeof value !== "string") return false;
|
|
1573
|
-
const parts = parseColorTokenParts(value);
|
|
1574
|
-
return parts.kind === "token" && isThemeColorTokenBase(parts.token);
|
|
1575
|
-
}
|
|
1576
|
-
function parseThemeColorToken(value) {
|
|
1577
|
-
if (!isThemeColorToken(value)) return null;
|
|
1578
|
-
return value.trim();
|
|
1579
|
-
}
|
|
1580
|
-
const themeColorTokenSchema = z.string().min(1).refine((value) => Boolean(isThemeColorToken(value)), "Expected a known Theme V2 color token");
|
|
1581
|
-
//#endregion
|
|
1582
1499
|
//#region ../theme-core/src/buttons/types.ts
|
|
1583
1500
|
/**
|
|
1584
1501
|
* Standard semantic variant roles a theme exposes.
|
|
@@ -2062,144 +1979,6 @@ z.discriminatedUnion("type", [
|
|
|
2062
1979
|
persistableMediaBaseSchema.extend({ type: z.literal("archive") })
|
|
2063
1980
|
]);
|
|
2064
1981
|
//#endregion
|
|
2065
|
-
//#region ../theme-core/src/palette/colors.ts
|
|
2066
|
-
const HEX_COLOR_REGEX = /^#[0-9a-f]{6}$/;
|
|
2067
|
-
const NORMALIZABLE_HEX_REGEX = /^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;
|
|
2068
|
-
const THEME_PALETTE_COLOR_ORDER = [
|
|
2069
|
-
"primary",
|
|
2070
|
-
"secondary",
|
|
2071
|
-
"accent",
|
|
2072
|
-
"success",
|
|
2073
|
-
"warning",
|
|
2074
|
-
"destructive",
|
|
2075
|
-
"background",
|
|
2076
|
-
"surface",
|
|
2077
|
-
"surfaceAlt",
|
|
2078
|
-
"muted",
|
|
2079
|
-
"text",
|
|
2080
|
-
"primaryForeground",
|
|
2081
|
-
"border"
|
|
2082
|
-
];
|
|
2083
|
-
const hexColorSchema = z.string().regex(HEX_COLOR_REGEX, "Hex must be #RRGGBB (lowercase)").transform((value) => value);
|
|
2084
|
-
const paletteModeSchema = z.enum(["light", "dark"]);
|
|
2085
|
-
const PALETTE_VALUE_KEY_PREFIX = "palette-value:v1|";
|
|
2086
|
-
z.string().regex(/^[0-9a-f]{64}$/, "Palette hash must be a lowercase SHA-256 value").transform((value) => value);
|
|
2087
|
-
const paletteColorsSchema = z.object({
|
|
2088
|
-
primary: hexColorSchema,
|
|
2089
|
-
primaryForeground: hexColorSchema,
|
|
2090
|
-
secondary: hexColorSchema,
|
|
2091
|
-
accent: hexColorSchema,
|
|
2092
|
-
success: hexColorSchema,
|
|
2093
|
-
warning: hexColorSchema,
|
|
2094
|
-
destructive: hexColorSchema,
|
|
2095
|
-
background: hexColorSchema,
|
|
2096
|
-
surface: hexColorSchema,
|
|
2097
|
-
surfaceAlt: hexColorSchema,
|
|
2098
|
-
muted: hexColorSchema,
|
|
2099
|
-
text: hexColorSchema,
|
|
2100
|
-
border: hexColorSchema
|
|
2101
|
-
}).strict().transform((value) => value);
|
|
2102
|
-
function normalizePaletteHex(value) {
|
|
2103
|
-
if (!NORMALIZABLE_HEX_REGEX.test(value)) return null;
|
|
2104
|
-
const normalized = value.toLowerCase();
|
|
2105
|
-
if (normalized.length === 7) return normalized;
|
|
2106
|
-
const triplet = normalized.slice(1);
|
|
2107
|
-
const red = triplet.charAt(0);
|
|
2108
|
-
const green = triplet.charAt(1);
|
|
2109
|
-
const blue = triplet.charAt(2);
|
|
2110
|
-
return `#${red}${red}${green}${green}${blue}${blue}`;
|
|
2111
|
-
}
|
|
2112
|
-
function paletteColorsFromEntries(entries) {
|
|
2113
|
-
const values = {};
|
|
2114
|
-
for (const entry of entries) {
|
|
2115
|
-
const parsedRole = paletteTokenNameSchema.safeParse(entry.name);
|
|
2116
|
-
if (!parsedRole.success) return {
|
|
2117
|
-
ok: false,
|
|
2118
|
-
error: {
|
|
2119
|
-
kind: "unknown-role",
|
|
2120
|
-
role: entry.name
|
|
2121
|
-
}
|
|
2122
|
-
};
|
|
2123
|
-
const role = parsedRole.data;
|
|
2124
|
-
if (values[role] !== void 0) return {
|
|
2125
|
-
ok: false,
|
|
2126
|
-
error: {
|
|
2127
|
-
kind: "duplicate-role",
|
|
2128
|
-
role
|
|
2129
|
-
}
|
|
2130
|
-
};
|
|
2131
|
-
const hex = normalizePaletteHex(entry.hex);
|
|
2132
|
-
if (!hex) return {
|
|
2133
|
-
ok: false,
|
|
2134
|
-
error: {
|
|
2135
|
-
kind: "invalid-color",
|
|
2136
|
-
role,
|
|
2137
|
-
value: entry.hex
|
|
2138
|
-
}
|
|
2139
|
-
};
|
|
2140
|
-
values[role] = hex;
|
|
2141
|
-
}
|
|
2142
|
-
const missing = PALETTE_TOKEN_NAMES.filter((role) => values[role] === void 0);
|
|
2143
|
-
if (missing.length > 0) return {
|
|
2144
|
-
ok: false,
|
|
2145
|
-
error: {
|
|
2146
|
-
kind: "missing-roles",
|
|
2147
|
-
roles: missing
|
|
2148
|
-
}
|
|
2149
|
-
};
|
|
2150
|
-
return {
|
|
2151
|
-
ok: true,
|
|
2152
|
-
colors: paletteColorsSchema.parse(values)
|
|
2153
|
-
};
|
|
2154
|
-
}
|
|
2155
|
-
function paletteColorEntries(colors) {
|
|
2156
|
-
return THEME_PALETTE_COLOR_ORDER.map((name) => ({
|
|
2157
|
-
name,
|
|
2158
|
-
hex: colors[name]
|
|
2159
|
-
}));
|
|
2160
|
-
}
|
|
2161
|
-
function paletteColorFingerprint(colors) {
|
|
2162
|
-
return PALETTE_TOKEN_NAMES.map((name) => `${name}:${colors[name]}`).join("|");
|
|
2163
|
-
}
|
|
2164
|
-
function canonicalPaletteHashInput(colors, mode) {
|
|
2165
|
-
return `${mode}|${paletteColorFingerprint(colors)}`;
|
|
2166
|
-
}
|
|
2167
|
-
/**
|
|
2168
|
-
* Stable curated-catalogue identity. Do not reorder roles: the order comes
|
|
2169
|
-
* from PALETTE_TOKEN_NAMES through canonicalPaletteHashInput.
|
|
2170
|
-
*/
|
|
2171
|
-
function paletteValueKey(colors, mode) {
|
|
2172
|
-
return `${PALETTE_VALUE_KEY_PREFIX}${canonicalPaletteHashInput(colors, mode)}`;
|
|
2173
|
-
}
|
|
2174
|
-
/** Parses only the exact v1 canonical form emitted by paletteValueKey. */
|
|
2175
|
-
function parsePaletteValueKey(value) {
|
|
2176
|
-
if (typeof value !== "string" || !value.startsWith(PALETTE_VALUE_KEY_PREFIX)) return null;
|
|
2177
|
-
const [rawMode, ...rawRoles] = value.slice(17).split("|");
|
|
2178
|
-
const mode = paletteModeSchema.safeParse(rawMode);
|
|
2179
|
-
if (!mode.success || rawRoles.length !== PALETTE_TOKEN_NAMES.length) return null;
|
|
2180
|
-
const colors = paletteColorsFromEntries(rawRoles.map((roleValue) => {
|
|
2181
|
-
const separator = roleValue.indexOf(":");
|
|
2182
|
-
return separator === -1 ? {
|
|
2183
|
-
name: "",
|
|
2184
|
-
hex: ""
|
|
2185
|
-
} : {
|
|
2186
|
-
name: roleValue.slice(0, separator),
|
|
2187
|
-
hex: roleValue.slice(separator + 1)
|
|
2188
|
-
};
|
|
2189
|
-
}));
|
|
2190
|
-
if (!colors.ok || paletteValueKey(colors.colors, mode.data) !== value) return null;
|
|
2191
|
-
return value;
|
|
2192
|
-
}
|
|
2193
|
-
z.string().transform((value, ctx) => {
|
|
2194
|
-
const parsed = parsePaletteValueKey(value);
|
|
2195
|
-
if (parsed) return parsed;
|
|
2196
|
-
ctx.addIssue({
|
|
2197
|
-
code: "custom",
|
|
2198
|
-
message: "Invalid canonical palette value key"
|
|
2199
|
-
});
|
|
2200
|
-
return z.NEVER;
|
|
2201
|
-
});
|
|
2202
|
-
//#endregion
|
|
2203
1982
|
//#region ../theme-core/src/palette/schema.ts
|
|
2204
1983
|
const colourHexString = z.string().regex(/^#([0-9A-Fa-f]{3}){1,2}$/);
|
|
2205
1984
|
const paletteColorSchema = z.object({
|
|
@@ -2231,9 +2010,30 @@ const paletteSchema = z.object({
|
|
|
2231
2010
|
//#region ../theme-core/src/cards/types.ts
|
|
2232
2011
|
const cardVariantRoleValues = ["default", "alternative"];
|
|
2233
2012
|
const boxlessCardVariantValue = "none";
|
|
2013
|
+
const openCardRoleValue = "open";
|
|
2014
|
+
/**
|
|
2015
|
+
* The roles a site style implements with an actual card variant. `none` is
|
|
2016
|
+
* deliberately absent: it is a role value only, never a variant.
|
|
2017
|
+
*/
|
|
2018
|
+
const surfaceCardRoleValues = [...cardVariantRoleValues, openCardRoleValue];
|
|
2019
|
+
/**
|
|
2020
|
+
* The closed card-role vocabulary Looks and blocks address cards by — this is
|
|
2021
|
+
* `BoxStylesCardVariant` widened with `open`, not a parallel enum.
|
|
2022
|
+
*
|
|
2023
|
+
* - `none` — no site-style card surface; the block's own composition and
|
|
2024
|
+
* the author's own card fields govern the item. This is *not*
|
|
2025
|
+
* a promise of visible boxlessness: a block whose base class
|
|
2026
|
+
* draws a border still draws one. It says the Look is not
|
|
2027
|
+
* asking the site style for a card.
|
|
2028
|
+
* - `open` — boxless but marked (a rule or accent edge, no enclosing box)
|
|
2029
|
+
* - `default` — the site's quiet everyday card
|
|
2030
|
+
* - `alternative` — the statement card carrying the site's personality
|
|
2031
|
+
*/
|
|
2032
|
+
const cardRoleValues = [...surfaceCardRoleValues, boxlessCardVariantValue];
|
|
2234
2033
|
const legacyCardVariantRoleAliases = {
|
|
2235
2034
|
variant1: "alternative",
|
|
2236
|
-
variant2: "alternative"
|
|
2035
|
+
variant2: "alternative",
|
|
2036
|
+
statement: "alternative"
|
|
2237
2037
|
};
|
|
2238
2038
|
const cardSpacingSchema = z.enum([
|
|
2239
2039
|
"none",
|
|
@@ -2243,6 +2043,17 @@ const cardSpacingSchema = z.enum([
|
|
|
2243
2043
|
"comfortable",
|
|
2244
2044
|
"spacious"
|
|
2245
2045
|
]);
|
|
2046
|
+
/** Per-axis padding, for boxless cards whose inline padding differs from block. */
|
|
2047
|
+
const cardSpacingAxesSchema = z.object({
|
|
2048
|
+
block: cardSpacingSchema,
|
|
2049
|
+
inline: cardSpacingSchema
|
|
2050
|
+
});
|
|
2051
|
+
/**
|
|
2052
|
+
* A card's content padding: one value for both axes, or one per axis. Two
|
|
2053
|
+
* fields would let a variant say both and leave the reader to guess, so this is
|
|
2054
|
+
* a union — the legacy `spacingAxes` key is lifted into it on parse.
|
|
2055
|
+
*/
|
|
2056
|
+
const cardSpacingValueSchema = z.union([cardSpacingSchema, cardSpacingAxesSchema]);
|
|
2246
2057
|
const gradientDirectionSchema = z.enum([
|
|
2247
2058
|
"to-r",
|
|
2248
2059
|
"to-l",
|
|
@@ -2254,7 +2065,13 @@ const gradientDirectionSchema = z.enum([
|
|
|
2254
2065
|
"to-bl"
|
|
2255
2066
|
]);
|
|
2256
2067
|
const cardVariantRoleSchema = z.enum(cardVariantRoleValues);
|
|
2257
|
-
const
|
|
2068
|
+
const surfaceCardRoleSchema = z.enum(surfaceCardRoleValues);
|
|
2069
|
+
const cardRoleSchema = z.enum(cardRoleValues);
|
|
2070
|
+
/**
|
|
2071
|
+
* Historical name for the role vocabulary as it reaches box styles. Widened to
|
|
2072
|
+
* the full `CardRole` set — old values keep parsing, `open` now parses too.
|
|
2073
|
+
*/
|
|
2074
|
+
const boxStylesCardVariantSchema = cardRoleSchema;
|
|
2258
2075
|
function isCardVariantRole(value) {
|
|
2259
2076
|
return typeof value === "string" && cardVariantRoleValues.includes(value);
|
|
2260
2077
|
}
|
|
@@ -2263,6 +2080,19 @@ function normalizeCardVariantRole(value) {
|
|
|
2263
2080
|
if (typeof value !== "string") return null;
|
|
2264
2081
|
return legacyCardVariantRoleAliases[value] ?? null;
|
|
2265
2082
|
}
|
|
2083
|
+
const PRIORITY_ROLE_INFERENCE = {
|
|
2084
|
+
1: "default",
|
|
2085
|
+
2: "alternative"
|
|
2086
|
+
};
|
|
2087
|
+
/**
|
|
2088
|
+
* Role inference for legacy card systems authored before variants carried a
|
|
2089
|
+
* `role`. Priority 1 is the everyday card, priority 2 the statement card —
|
|
2090
|
+
* which is how variants are surfaced today. `open` is never inferred: a site
|
|
2091
|
+
* style has to opt into it.
|
|
2092
|
+
*/
|
|
2093
|
+
function inferCardVariantRoleFromPriority(priority) {
|
|
2094
|
+
return PRIORITY_ROLE_INFERENCE[priority] ?? null;
|
|
2095
|
+
}
|
|
2266
2096
|
const cardBackgroundSchema = z.discriminatedUnion("type", [
|
|
2267
2097
|
z.object({
|
|
2268
2098
|
type: z.literal("solid"),
|
|
@@ -2288,17 +2118,19 @@ const cardCornerValueSchema = z.enum([
|
|
|
2288
2118
|
"pill",
|
|
2289
2119
|
"expressive"
|
|
2290
2120
|
]);
|
|
2121
|
+
const cardEdgeSchema = z.enum([
|
|
2122
|
+
"left",
|
|
2123
|
+
"top",
|
|
2124
|
+
"right",
|
|
2125
|
+
"bottom"
|
|
2126
|
+
]);
|
|
2291
2127
|
/**
|
|
2292
|
-
*
|
|
2293
|
-
*
|
|
2128
|
+
* Legacy single accented card edge (e.g. a left accent bar). Persisted and
|
|
2129
|
+
* curated data may still carry it; it lifts into a one-element `decorations`
|
|
2130
|
+
* list at the parse boundary and has no representation after that.
|
|
2294
2131
|
*/
|
|
2295
2132
|
const cardAccentEdgeSchema = z.object({
|
|
2296
|
-
edge:
|
|
2297
|
-
"left",
|
|
2298
|
-
"top",
|
|
2299
|
-
"right",
|
|
2300
|
-
"bottom"
|
|
2301
|
-
]),
|
|
2133
|
+
edge: cardEdgeSchema,
|
|
2302
2134
|
colorToken: themeColorTokenSchema,
|
|
2303
2135
|
width: z.enum([
|
|
2304
2136
|
"thin",
|
|
@@ -2307,13 +2139,43 @@ const cardAccentEdgeSchema = z.object({
|
|
|
2307
2139
|
"heavy"
|
|
2308
2140
|
])
|
|
2309
2141
|
});
|
|
2142
|
+
/** `hairline` (1px) is the widening the boxless `open` role needs. */
|
|
2143
|
+
const cardEdgeRuleWidthSchema = z.enum([
|
|
2144
|
+
"hairline",
|
|
2145
|
+
"thin",
|
|
2146
|
+
"medium",
|
|
2147
|
+
"thick",
|
|
2148
|
+
"heavy"
|
|
2149
|
+
]);
|
|
2150
|
+
const cardEdgeRuleLengthSchema = z.enum(["full", "short"]);
|
|
2151
|
+
const cardEdgeRuleAlignSchema = z.enum([
|
|
2152
|
+
"start",
|
|
2153
|
+
"center",
|
|
2154
|
+
"end"
|
|
2155
|
+
]);
|
|
2156
|
+
/**
|
|
2157
|
+
* Decorations are edge rules today. The alias exists so the list can grow into
|
|
2158
|
+
* a discriminated union without every call site changing.
|
|
2159
|
+
*/
|
|
2160
|
+
const cardDecorationSchema = z.object({
|
|
2161
|
+
edge: cardEdgeSchema,
|
|
2162
|
+
colorToken: themeColorTokenSchema,
|
|
2163
|
+
width: cardEdgeRuleWidthSchema,
|
|
2164
|
+
/** Defaults to `full`. */
|
|
2165
|
+
length: cardEdgeRuleLengthSchema.optional(),
|
|
2166
|
+
/** Where a `short` rule sits along its edge. Defaults to `start`. */
|
|
2167
|
+
align: cardEdgeRuleAlignSchema.optional(),
|
|
2168
|
+
/** Opacity applied to `colorToken`, 0–1. Scoped here, not on the token. */
|
|
2169
|
+
alpha: z.number().min(0).max(1).optional()
|
|
2170
|
+
});
|
|
2171
|
+
const cardDecorationsSchema = z.array(cardDecorationSchema).max(2);
|
|
2310
2172
|
const cardCornerRadiiSchema = z.object({
|
|
2311
2173
|
topLeft: cardCornerValueSchema.optional(),
|
|
2312
2174
|
topRight: cardCornerValueSchema.optional(),
|
|
2313
2175
|
bottomLeft: cardCornerValueSchema.optional(),
|
|
2314
2176
|
bottomRight: cardCornerValueSchema.optional()
|
|
2315
2177
|
});
|
|
2316
|
-
const
|
|
2178
|
+
const cardVariantInputSchema = z.object({
|
|
2317
2179
|
id: z.string(),
|
|
2318
2180
|
name: z.string().min(1).max(20),
|
|
2319
2181
|
enabled: z.boolean(),
|
|
@@ -2322,8 +2184,10 @@ const cardVariantSchema = z.object({
|
|
|
2322
2184
|
z.literal(2),
|
|
2323
2185
|
z.literal(3)
|
|
2324
2186
|
]),
|
|
2187
|
+
role: surfaceCardRoleSchema.optional(),
|
|
2325
2188
|
background: cardBackgroundSchema,
|
|
2326
|
-
spacing:
|
|
2189
|
+
spacing: cardSpacingValueSchema,
|
|
2190
|
+
spacingAxes: cardSpacingAxesSchema.optional(),
|
|
2327
2191
|
foregroundToken: themeColorTokenSchema.optional(),
|
|
2328
2192
|
shadow: z.object({
|
|
2329
2193
|
elevation: z.enum([
|
|
@@ -2347,9 +2211,91 @@ const cardVariantSchema = z.object({
|
|
|
2347
2211
|
]).optional(),
|
|
2348
2212
|
cornerRadii: cardCornerRadiiSchema.optional(),
|
|
2349
2213
|
border: cardBorderSchema.optional(),
|
|
2214
|
+
decorations: cardDecorationsSchema.optional(),
|
|
2350
2215
|
accentEdge: cardAccentEdgeSchema.optional()
|
|
2351
2216
|
});
|
|
2352
|
-
|
|
2217
|
+
/**
|
|
2218
|
+
* Lift a legacy `accentEdge` into the decoration list. The old emitter reset
|
|
2219
|
+
* `border: 0` implicitly whenever an accent edge was present; conversion drops
|
|
2220
|
+
* the border instead, so the output is unchanged and the data says so.
|
|
2221
|
+
*/
|
|
2222
|
+
function normalizeLegacyAccentEdge(variant) {
|
|
2223
|
+
const { accentEdge, ...rest } = normalizeLegacySpacingAxes(variant);
|
|
2224
|
+
if (!accentEdge) return rest;
|
|
2225
|
+
const { border: _droppedByAccentEdgeReset, ...withoutBorder } = rest;
|
|
2226
|
+
return {
|
|
2227
|
+
...withoutBorder,
|
|
2228
|
+
decorations: [{
|
|
2229
|
+
...accentEdge,
|
|
2230
|
+
length: "full"
|
|
2231
|
+
}]
|
|
2232
|
+
};
|
|
2233
|
+
}
|
|
2234
|
+
/**
|
|
2235
|
+
* Lift a legacy `spacingAxes` into `spacing`. It always won over the flat value
|
|
2236
|
+
* when both were set, so the lift preserves the emitted padding exactly.
|
|
2237
|
+
*/
|
|
2238
|
+
function normalizeLegacySpacingAxes(variant) {
|
|
2239
|
+
const { spacingAxes, ...rest } = variant;
|
|
2240
|
+
return spacingAxes ? {
|
|
2241
|
+
...rest,
|
|
2242
|
+
spacing: spacingAxes
|
|
2243
|
+
} : variant;
|
|
2244
|
+
}
|
|
2245
|
+
function validateSingleDecorationSource(variant, ctx) {
|
|
2246
|
+
if (!variant.accentEdge || !variant.decorations) return;
|
|
2247
|
+
ctx.addIssue({
|
|
2248
|
+
code: "custom",
|
|
2249
|
+
path: ["decorations"],
|
|
2250
|
+
message: "A card variant carries either the legacy `accentEdge` or `decorations`, never both."
|
|
2251
|
+
});
|
|
2252
|
+
}
|
|
2253
|
+
const cardVariantSchema = cardVariantInputSchema.superRefine(validateSingleDecorationSource).transform(normalizeLegacyAccentEdge);
|
|
2254
|
+
/**
|
|
2255
|
+
* Fill in roles for legacy systems whose variants declare none. Inference is
|
|
2256
|
+
* collision-tolerant on purpose: first claimant wins and a later variant that
|
|
2257
|
+
* would infer a taken role simply gets no role. Legacy data is not obliged to
|
|
2258
|
+
* be well-formed, and a card system that fails to parse takes the whole theme
|
|
2259
|
+
* down with it.
|
|
2260
|
+
*/
|
|
2261
|
+
function withInferredRoles(variants) {
|
|
2262
|
+
const claimed = new Set(variants.flatMap((variant) => variant.role ? [variant.role] : []));
|
|
2263
|
+
return variants.map((variant) => {
|
|
2264
|
+
if (variant.role) return variant;
|
|
2265
|
+
const inferred = inferCardVariantRoleFromPriority(variant.priority);
|
|
2266
|
+
if (!inferred || claimed.has(inferred)) return variant;
|
|
2267
|
+
claimed.add(inferred);
|
|
2268
|
+
return {
|
|
2269
|
+
...variant,
|
|
2270
|
+
role: inferred
|
|
2271
|
+
};
|
|
2272
|
+
});
|
|
2273
|
+
}
|
|
2274
|
+
/**
|
|
2275
|
+
* Only *declared* roles are validated — a site style saying "these two
|
|
2276
|
+
* variants are both the default card" is an authoring error worth rejecting.
|
|
2277
|
+
*/
|
|
2278
|
+
function validateUniqueDeclaredCardVariantRoles(system, ctx) {
|
|
2279
|
+
const declared = /* @__PURE__ */ new Set();
|
|
2280
|
+
system.variants.forEach((variant, index) => {
|
|
2281
|
+
const role = variant.role;
|
|
2282
|
+
if (!role) return;
|
|
2283
|
+
if (declared.has(role)) {
|
|
2284
|
+
ctx.addIssue({
|
|
2285
|
+
code: "custom",
|
|
2286
|
+
path: [
|
|
2287
|
+
"variants",
|
|
2288
|
+
index,
|
|
2289
|
+
"role"
|
|
2290
|
+
],
|
|
2291
|
+
message: `Card role "${role}" is already implemented by another variant.`
|
|
2292
|
+
});
|
|
2293
|
+
return;
|
|
2294
|
+
}
|
|
2295
|
+
declared.add(role);
|
|
2296
|
+
});
|
|
2297
|
+
}
|
|
2298
|
+
const cardSystemSchema = z.object({ variants: z.array(cardVariantSchema).min(1).max(3) }).superRefine(validateUniqueDeclaredCardVariantRoles).transform((system) => ({ variants: withInferredRoles(system.variants) }));
|
|
2353
2299
|
//#endregion
|
|
2354
2300
|
//#region ../theme-core/src/accordions/types.ts
|
|
2355
2301
|
/**
|
|
@@ -3267,6 +3213,58 @@ function resolveOnColorForThemeToken(token) {
|
|
|
3267
3213
|
if (!shade) return rgbColorValue(`on${normalizedRole.charAt(0).toUpperCase() + normalizedRole.slice(1)}`);
|
|
3268
3214
|
return shade <= 400 ? "#000000" : "#FFFFFF";
|
|
3269
3215
|
}
|
|
3216
|
+
//#endregion
|
|
3217
|
+
//#region ../theme-core/src/header/legacyHeaderVariant.ts
|
|
3218
|
+
/**
|
|
3219
|
+
* The header variants the system actually renders.
|
|
3220
|
+
*
|
|
3221
|
+
* Each one has a layout row in the site-header block and a paint target in
|
|
3222
|
+
* `paintTargets.ts`. This is the canonical list: the block transform's variant
|
|
3223
|
+
* class allowlist and the AI theme generator's enum both derive from it, so
|
|
3224
|
+
* they cannot drift.
|
|
3225
|
+
*/
|
|
3226
|
+
const headerVariantValues = [
|
|
3227
|
+
"classic",
|
|
3228
|
+
"centered",
|
|
3229
|
+
"floating"
|
|
3230
|
+
];
|
|
3231
|
+
z.enum(headerVariantValues);
|
|
3232
|
+
/**
|
|
3233
|
+
* Header variant spellings that were once authorable but no longer name a
|
|
3234
|
+
* layout of their own, and the variant they read as now.
|
|
3235
|
+
*
|
|
3236
|
+
* `transparent` was an overlay header with no CSS of its own: everything it
|
|
3237
|
+
* did (transparent root background, overlay content flow) is what `floating`
|
|
3238
|
+
* already does, and it had zero persisted usage in production or locally when
|
|
3239
|
+
* it was retired. It survives here as a one-boundary alias so a theme authored
|
|
3240
|
+
* against the old vocabulary still parses.
|
|
3241
|
+
*
|
|
3242
|
+
* This matters because the theme schema is strict and has no per-field
|
|
3243
|
+
* `.catch()`: an out-of-enum variant fails `themeSchema.safeParse` for the
|
|
3244
|
+
* *whole* theme, which silently swaps the site's theme for
|
|
3245
|
+
* `modernMinimalTheme`. Aliasing here keeps that from happening.
|
|
3246
|
+
*/
|
|
3247
|
+
const legacyHeaderVariants = { transparent: "floating" };
|
|
3248
|
+
const legacyHeaderVariantValues = Object.keys(legacyHeaderVariants);
|
|
3249
|
+
/**
|
|
3250
|
+
* The header variant boundary for themes that go through `themeSchema`:
|
|
3251
|
+
* canonical variants pass through, legacy spellings normalize to the variant
|
|
3252
|
+
* they meant, everything else fails the parse.
|
|
3253
|
+
*
|
|
3254
|
+
* Deliberately an enum plus a transform rather than a `z.preprocess`, so the
|
|
3255
|
+
* schema's *input* type stays an accurate union (the legacy spelling is still
|
|
3256
|
+
* accepted on the wire) instead of widening to `unknown`. `SdkThemeWire` in
|
|
3257
|
+
* `@riverbankcms/api` is `z.input<typeof themeSchema>`, so a widened input here
|
|
3258
|
+
* would leak straight into a public type.
|
|
3259
|
+
*
|
|
3260
|
+
* Not every read of a persisted theme goes through the schema:
|
|
3261
|
+
* `resolveRuntimeTheme` in
|
|
3262
|
+
* `apps/dashboard/src/server/services/sites/runtimeSiteResponse.ts` returns the
|
|
3263
|
+
* raw database JSON asserted as `Theme` with no parse, so a theme still
|
|
3264
|
+
* carrying a legacy spelling reaches the theme editor un-aliased. That gap
|
|
3265
|
+
* predates this alias and is harmless while persisted usage is zero.
|
|
3266
|
+
*/
|
|
3267
|
+
const headerVariantWithLegacyAliasSchema = z.enum([...headerVariantValues, ...legacyHeaderVariantValues]).transform((value) => value in legacyHeaderVariants ? legacyHeaderVariants[value] : value);
|
|
3270
3268
|
const BREAKPOINT_LG = 1024;
|
|
3271
3269
|
const BREAKPOINT_XL = 1280;
|
|
3272
3270
|
const BREAKPOINT_LG_DOWN = BREAKPOINT_LG - 1;
|
|
@@ -3583,14 +3581,7 @@ const cardStylesOverrideSchema = z.object({
|
|
|
3583
3581
|
spacing: semanticSpacingSchema.nullable().optional(),
|
|
3584
3582
|
raised: z.boolean().nullable().optional(),
|
|
3585
3583
|
rounded: boxRoundedSchema.nullable().optional(),
|
|
3586
|
-
|
|
3587
|
-
"accent-quote",
|
|
3588
|
-
"editorial-rule",
|
|
3589
|
-
"soft-panel",
|
|
3590
|
-
"editorial-serif-quote",
|
|
3591
|
-
"editorial-open",
|
|
3592
|
-
"color-blocked"
|
|
3593
|
-
]).nullable().optional(),
|
|
3584
|
+
role: cardRoleSchema.nullable().optional(),
|
|
3594
3585
|
cardVariant: boxStylesCardVariantSchema.nullable().optional()
|
|
3595
3586
|
});
|
|
3596
3587
|
const blockStyleOverridesSchema = z.object({
|
|
@@ -3696,30 +3687,6 @@ const motion = z.object({
|
|
|
3696
3687
|
]).nullable()
|
|
3697
3688
|
});
|
|
3698
3689
|
z.object({ shape: corners });
|
|
3699
|
-
z.object({
|
|
3700
|
-
elevation: z.enum([
|
|
3701
|
-
"none",
|
|
3702
|
-
"low",
|
|
3703
|
-
"medium",
|
|
3704
|
-
"high"
|
|
3705
|
-
]),
|
|
3706
|
-
border: z.enum([
|
|
3707
|
-
"none",
|
|
3708
|
-
"subtle",
|
|
3709
|
-
"defined"
|
|
3710
|
-
]),
|
|
3711
|
-
shape: corners,
|
|
3712
|
-
headerStyle: z.enum([
|
|
3713
|
-
"plain",
|
|
3714
|
-
"accentBar",
|
|
3715
|
-
"subtleBg"
|
|
3716
|
-
]).nullable(),
|
|
3717
|
-
mediaTreatment: z.enum([
|
|
3718
|
-
"square",
|
|
3719
|
-
"rounded",
|
|
3720
|
-
"bleed"
|
|
3721
|
-
]).nullable()
|
|
3722
|
-
});
|
|
3723
3690
|
const inputStyle = z.object({
|
|
3724
3691
|
shape: corners,
|
|
3725
3692
|
border: z.enum([
|
|
@@ -3734,12 +3701,6 @@ const inputStyle = z.object({
|
|
|
3734
3701
|
]),
|
|
3735
3702
|
label: z.enum(["inside", "above"])
|
|
3736
3703
|
});
|
|
3737
|
-
const headerVariant = z.enum([
|
|
3738
|
-
"classic",
|
|
3739
|
-
"centered",
|
|
3740
|
-
"transparent",
|
|
3741
|
-
"floating"
|
|
3742
|
-
]);
|
|
3743
3704
|
const headerPositioning = z.enum([
|
|
3744
3705
|
"static",
|
|
3745
3706
|
"sticky",
|
|
@@ -3883,7 +3844,7 @@ const headerBackgroundSchema = z.object({
|
|
|
3883
3844
|
textColor: tokenOrCssColorValueSchema.nullable().optional()
|
|
3884
3845
|
});
|
|
3885
3846
|
const headerSchema = z.object({
|
|
3886
|
-
variant:
|
|
3847
|
+
variant: headerVariantWithLegacyAliasSchema,
|
|
3887
3848
|
positioning: headerPositioning,
|
|
3888
3849
|
shrinkOnScroll: z.boolean(),
|
|
3889
3850
|
maxWidth: headerMaxWidth,
|
|
@@ -4179,29 +4140,6 @@ z.object({
|
|
|
4179
4140
|
themes: z.array(themeSchema).length(3)
|
|
4180
4141
|
});
|
|
4181
4142
|
//#endregion
|
|
4182
|
-
//#region ../theme-core/src/palette/utils/colorConversion.ts
|
|
4183
|
-
function hexToRgb(hex) {
|
|
4184
|
-
const h = hex.replace(/^#/, "");
|
|
4185
|
-
const m = h.length === 3 ? h.split("").map((c) => c + c).join("") : h;
|
|
4186
|
-
if (m.length !== 6) throw new Error("Bad hex");
|
|
4187
|
-
const int = parseInt(m, 16);
|
|
4188
|
-
return {
|
|
4189
|
-
r: int >> 16 & 255,
|
|
4190
|
-
g: int >> 8 & 255,
|
|
4191
|
-
b: int & 255
|
|
4192
|
-
};
|
|
4193
|
-
}
|
|
4194
|
-
function srgbToLinear(u) {
|
|
4195
|
-
const x = u / 255;
|
|
4196
|
-
return x <= .04045 ? x / 12.92 : Math.pow((x + .055) / 1.055, 2.4);
|
|
4197
|
-
}
|
|
4198
|
-
//#endregion
|
|
4199
|
-
//#region ../theme-core/src/palette/utils/contrast.ts
|
|
4200
|
-
function relativeLuminance(r, g, b) {
|
|
4201
|
-
const R = srgbToLinear(r), G = srgbToLinear(g), B = srgbToLinear(b);
|
|
4202
|
-
return .2126 * R + .7152 * G + .0722 * B;
|
|
4203
|
-
}
|
|
4204
|
-
//#endregion
|
|
4205
4143
|
//#region ../theme-core/src/buttons/classNames.ts
|
|
4206
4144
|
function themeButtonVariantClassNames(variant) {
|
|
4207
4145
|
if (variant === "default") return [variant];
|
|
@@ -5939,6 +5877,7 @@ const unsupportedEventRegistrationPageSurfaceSubjectSchema = z.object({
|
|
|
5939
5877
|
reason: z.enum([
|
|
5940
5878
|
"unsupportedSubject",
|
|
5941
5879
|
"invalidEventSeriesId",
|
|
5880
|
+
"invalidEventSeriesBookingScope",
|
|
5942
5881
|
"invalidEventOfferingId"
|
|
5943
5882
|
])
|
|
5944
5883
|
});
|
|
@@ -6162,6 +6101,7 @@ const eventPresetSchema = z.enum([
|
|
|
6162
6101
|
"event",
|
|
6163
6102
|
"class",
|
|
6164
6103
|
"course",
|
|
6104
|
+
"term",
|
|
6165
6105
|
"workshop",
|
|
6166
6106
|
"retreat",
|
|
6167
6107
|
"performance"
|
|
@@ -6220,57 +6160,49 @@ z.enum([
|
|
|
6220
6160
|
*/
|
|
6221
6161
|
const accessRestrictionSchema = z.enum(["none", "category"]);
|
|
6222
6162
|
z.enum(["single", "ticket_types"]);
|
|
6163
|
+
const freePriceDisplaySchema = z.object({
|
|
6164
|
+
kind: z.literal("free"),
|
|
6165
|
+
currency: z.string()
|
|
6166
|
+
});
|
|
6167
|
+
const exactPriceDisplaySchema = z.object({
|
|
6168
|
+
kind: z.literal("exact"),
|
|
6169
|
+
amount: z.number(),
|
|
6170
|
+
currency: z.string()
|
|
6171
|
+
});
|
|
6172
|
+
const fromPriceDisplaySchema = z.object({
|
|
6173
|
+
kind: z.literal("from"),
|
|
6174
|
+
amount: z.number(),
|
|
6175
|
+
currency: z.string()
|
|
6176
|
+
});
|
|
6177
|
+
const unavailablePriceDisplaySchema = z.object({
|
|
6178
|
+
kind: z.literal("unavailable"),
|
|
6179
|
+
currency: z.string()
|
|
6180
|
+
});
|
|
6181
|
+
const rangePriceDisplaySchema = z.object({
|
|
6182
|
+
kind: z.literal("range"),
|
|
6183
|
+
minAmount: z.number(),
|
|
6184
|
+
maxAmount: z.number(),
|
|
6185
|
+
currency: z.string()
|
|
6186
|
+
});
|
|
6187
|
+
const mixedPriceDisplaySchema = z.object({
|
|
6188
|
+
kind: z.literal("mixed"),
|
|
6189
|
+
paidFromAmount: z.number(),
|
|
6190
|
+
paidToAmount: z.number(),
|
|
6191
|
+
currency: z.string()
|
|
6192
|
+
});
|
|
6223
6193
|
const publicCoursePriceDisplaySchema = z.discriminatedUnion("kind", [
|
|
6224
|
-
|
|
6225
|
-
|
|
6226
|
-
|
|
6227
|
-
|
|
6228
|
-
z.object({
|
|
6229
|
-
kind: z.literal("exact"),
|
|
6230
|
-
amount: z.number(),
|
|
6231
|
-
currency: z.string()
|
|
6232
|
-
}),
|
|
6233
|
-
z.object({
|
|
6234
|
-
kind: z.literal("from"),
|
|
6235
|
-
amount: z.number(),
|
|
6236
|
-
currency: z.string()
|
|
6237
|
-
}),
|
|
6238
|
-
z.object({
|
|
6239
|
-
kind: z.literal("unavailable"),
|
|
6240
|
-
currency: z.string()
|
|
6241
|
-
})
|
|
6194
|
+
freePriceDisplaySchema,
|
|
6195
|
+
exactPriceDisplaySchema,
|
|
6196
|
+
fromPriceDisplaySchema,
|
|
6197
|
+
unavailablePriceDisplaySchema
|
|
6242
6198
|
]);
|
|
6243
6199
|
z.discriminatedUnion("kind", [
|
|
6244
|
-
|
|
6245
|
-
|
|
6246
|
-
|
|
6247
|
-
|
|
6248
|
-
|
|
6249
|
-
|
|
6250
|
-
amount: z.number(),
|
|
6251
|
-
currency: z.string()
|
|
6252
|
-
}),
|
|
6253
|
-
z.object({
|
|
6254
|
-
kind: z.literal("from"),
|
|
6255
|
-
amount: z.number(),
|
|
6256
|
-
currency: z.string()
|
|
6257
|
-
}),
|
|
6258
|
-
z.object({
|
|
6259
|
-
kind: z.literal("range"),
|
|
6260
|
-
minAmount: z.number(),
|
|
6261
|
-
maxAmount: z.number(),
|
|
6262
|
-
currency: z.string()
|
|
6263
|
-
}),
|
|
6264
|
-
z.object({
|
|
6265
|
-
kind: z.literal("mixed"),
|
|
6266
|
-
paidFromAmount: z.number(),
|
|
6267
|
-
paidToAmount: z.number(),
|
|
6268
|
-
currency: z.string()
|
|
6269
|
-
}),
|
|
6270
|
-
z.object({
|
|
6271
|
-
kind: z.literal("unavailable"),
|
|
6272
|
-
currency: z.string()
|
|
6273
|
-
}),
|
|
6200
|
+
freePriceDisplaySchema,
|
|
6201
|
+
exactPriceDisplaySchema,
|
|
6202
|
+
fromPriceDisplaySchema,
|
|
6203
|
+
rangePriceDisplaySchema,
|
|
6204
|
+
mixedPriceDisplaySchema,
|
|
6205
|
+
unavailablePriceDisplaySchema,
|
|
6274
6206
|
z.object({
|
|
6275
6207
|
kind: z.literal("external"),
|
|
6276
6208
|
label: z.string()
|
|
@@ -6281,36 +6213,12 @@ z.discriminatedUnion("kind", [
|
|
|
6281
6213
|
})
|
|
6282
6214
|
]);
|
|
6283
6215
|
const publicEventTicketTypePriceDisplaySchema = z.union([
|
|
6284
|
-
|
|
6285
|
-
|
|
6286
|
-
|
|
6287
|
-
|
|
6288
|
-
|
|
6289
|
-
|
|
6290
|
-
amount: z.number(),
|
|
6291
|
-
currency: z.string()
|
|
6292
|
-
}),
|
|
6293
|
-
z.object({
|
|
6294
|
-
kind: z.literal("from"),
|
|
6295
|
-
amount: z.number(),
|
|
6296
|
-
currency: z.string()
|
|
6297
|
-
}),
|
|
6298
|
-
z.object({
|
|
6299
|
-
kind: z.literal("range"),
|
|
6300
|
-
minAmount: z.number(),
|
|
6301
|
-
maxAmount: z.number(),
|
|
6302
|
-
currency: z.string()
|
|
6303
|
-
}),
|
|
6304
|
-
z.object({
|
|
6305
|
-
kind: z.literal("mixed"),
|
|
6306
|
-
paidFromAmount: z.number(),
|
|
6307
|
-
paidToAmount: z.number(),
|
|
6308
|
-
currency: z.string()
|
|
6309
|
-
}),
|
|
6310
|
-
z.object({
|
|
6311
|
-
kind: z.literal("unavailable"),
|
|
6312
|
-
currency: z.string()
|
|
6313
|
-
})
|
|
6216
|
+
freePriceDisplaySchema,
|
|
6217
|
+
exactPriceDisplaySchema,
|
|
6218
|
+
fromPriceDisplaySchema,
|
|
6219
|
+
rangePriceDisplaySchema,
|
|
6220
|
+
mixedPriceDisplaySchema,
|
|
6221
|
+
unavailablePriceDisplaySchema
|
|
6314
6222
|
]);
|
|
6315
6223
|
const publicEventAttendanceModeSchema = z.enum(["in_person", "online"]);
|
|
6316
6224
|
const publicEventAttendanceModeAvailabilitySchema = z.object({
|
|
@@ -6424,6 +6332,22 @@ const publicTeamMemberSummarySchema = z.object({
|
|
|
6424
6332
|
summary: z.string().nullable(),
|
|
6425
6333
|
profilePath: z.string().nullable()
|
|
6426
6334
|
});
|
|
6335
|
+
const publicEventBookingAvailabilitySchema = z.discriminatedUnion("kind", [z.object({ kind: z.literal("open") }), z.object({
|
|
6336
|
+
kind: z.literal("closed"),
|
|
6337
|
+
reason: z.enum([
|
|
6338
|
+
"occurrence_cancelled",
|
|
6339
|
+
"occurrence_completed",
|
|
6340
|
+
"series_draft",
|
|
6341
|
+
"series_cancelled",
|
|
6342
|
+
"series_completed",
|
|
6343
|
+
"series_archived",
|
|
6344
|
+
"parent_archived",
|
|
6345
|
+
"parent_inconsistent",
|
|
6346
|
+
"not_public",
|
|
6347
|
+
"already_started",
|
|
6348
|
+
"enrollment_closed"
|
|
6349
|
+
])
|
|
6350
|
+
})]);
|
|
6427
6351
|
/**
|
|
6428
6352
|
* Zod schema for public event data
|
|
6429
6353
|
*/
|
|
@@ -6448,6 +6372,7 @@ const publicEventSchema = z.object({
|
|
|
6448
6372
|
path: z.string().nullable(),
|
|
6449
6373
|
destination: publicEventDestinationSchema,
|
|
6450
6374
|
requiresRegistration: z.boolean(),
|
|
6375
|
+
bookingAvailability: publicEventBookingAvailabilitySchema,
|
|
6451
6376
|
deliveryMode: z.enum([
|
|
6452
6377
|
"in_person",
|
|
6453
6378
|
"online",
|
|
@@ -6466,6 +6391,8 @@ const publicEventSchema = z.object({
|
|
|
6466
6391
|
status: z.enum([
|
|
6467
6392
|
"active",
|
|
6468
6393
|
"draft",
|
|
6394
|
+
"cancelled",
|
|
6395
|
+
"completed",
|
|
6469
6396
|
"archived"
|
|
6470
6397
|
]).optional(),
|
|
6471
6398
|
timeZone: z.string(),
|
|
@@ -6504,6 +6431,7 @@ function normalizeIdList(parts) {
|
|
|
6504
6431
|
//#region ../blocks/src/system/blocks/events/shared/filtering.ts
|
|
6505
6432
|
const eventSurfacePresetValues = [
|
|
6506
6433
|
"course",
|
|
6434
|
+
"term",
|
|
6507
6435
|
"class",
|
|
6508
6436
|
"workshop",
|
|
6509
6437
|
"retreat",
|
|
@@ -6648,6 +6576,43 @@ function groupItemsByDate(items, accessors) {
|
|
|
6648
6576
|
}
|
|
6649
6577
|
return grouped;
|
|
6650
6578
|
}
|
|
6579
|
+
/**
|
|
6580
|
+
* Canonical responsive ladder for a user-configured column count: 1 column at
|
|
6581
|
+
* base, 2 from `sm`, 3 from `lg` (when the count allows), and the full count
|
|
6582
|
+
* from `xl`. This matches the events blocks' COLUMN_CLASSES ladder — the two
|
|
6583
|
+
* are derived from this single function.
|
|
6584
|
+
*/
|
|
6585
|
+
function gridUserColumnLadder(count) {
|
|
6586
|
+
const capped = Number.isFinite(count) ? Math.max(1, Math.min(4, Math.floor(count))) : 3;
|
|
6587
|
+
const ladder = { base: 1 };
|
|
6588
|
+
if (capped >= 2) ladder.sm = 2;
|
|
6589
|
+
if (capped >= 3) ladder.lg = 3;
|
|
6590
|
+
if (capped >= 4) ladder.xl = capped;
|
|
6591
|
+
return ladder;
|
|
6592
|
+
}
|
|
6593
|
+
/** The ladder as a space-separated `rb-*` utility class string. */
|
|
6594
|
+
function gridUserColumnClasses(count) {
|
|
6595
|
+
const ladder = gridUserColumnLadder(count);
|
|
6596
|
+
return GRID_BREAKPOINTS.flatMap((bp) => {
|
|
6597
|
+
const value = ladder[bp];
|
|
6598
|
+
return typeof value === "number" ? [COL_COUNT_CLASS[bp](value)] : [];
|
|
6599
|
+
}).join(" ");
|
|
6600
|
+
}
|
|
6601
|
+
/** Utility class for a numeric column COUNT at a given breakpoint. */
|
|
6602
|
+
const COL_COUNT_CLASS = {
|
|
6603
|
+
base: (n) => `rb-grid-cols-${n}`,
|
|
6604
|
+
sm: (n) => `rb-sm-grid-cols-${n}`,
|
|
6605
|
+
md: (n) => `rb-md-grid-cols-${n}`,
|
|
6606
|
+
lg: (n) => `rb-lg-grid-cols-${n}`,
|
|
6607
|
+
xl: (n) => `rb-xl-grid-cols-${n}`
|
|
6608
|
+
};
|
|
6609
|
+
const GRID_BREAKPOINTS = [
|
|
6610
|
+
"base",
|
|
6611
|
+
"sm",
|
|
6612
|
+
"md",
|
|
6613
|
+
"lg",
|
|
6614
|
+
"xl"
|
|
6615
|
+
];
|
|
6651
6616
|
//#endregion
|
|
6652
6617
|
//#region ../blocks/src/system/runtime/nodes/events/shared/eventCapacity.ts
|
|
6653
6618
|
/**
|
|
@@ -6898,11 +6863,14 @@ function readAmount(value) {
|
|
|
6898
6863
|
/**
|
|
6899
6864
|
* Shared utility functions for event blocks
|
|
6900
6865
|
*/
|
|
6901
|
-
/**
|
|
6866
|
+
/**
|
|
6867
|
+
* Column class mappings for grid layouts, derived from the canonical
|
|
6868
|
+
* responsive column ladder (see gridUserColumnLadder).
|
|
6869
|
+
*/
|
|
6902
6870
|
const COLUMN_CLASSES = {
|
|
6903
|
-
"2":
|
|
6904
|
-
"3":
|
|
6905
|
-
"4":
|
|
6871
|
+
"2": gridUserColumnClasses(2),
|
|
6872
|
+
"3": gridUserColumnClasses(3),
|
|
6873
|
+
"4": gridUserColumnClasses(4)
|
|
6906
6874
|
};
|
|
6907
6875
|
/**
|
|
6908
6876
|
* Build container class based on layout mode
|
|
@@ -6914,7 +6882,7 @@ function getContainerClass(layout, columns) {
|
|
|
6914
6882
|
if (layout === "compact") return "event-listing-compact-container rb-flex rb-flex-col";
|
|
6915
6883
|
if (layout === "stack") return "rb-flex rb-flex-col rb-gap-6";
|
|
6916
6884
|
const fallbackColumnClass = COLUMN_CLASSES["3"] ?? "";
|
|
6917
|
-
return `rb-grid rb-items-stretch rb-
|
|
6885
|
+
return `rb-grid rb-items-stretch rb-gap-6 ${COLUMN_CLASSES[columns] ?? fallbackColumnClass}`;
|
|
6918
6886
|
}
|
|
6919
6887
|
/**
|
|
6920
6888
|
* Get card orientation based on layout mode
|
|
@@ -7047,6 +7015,22 @@ function formatEventPrice(event) {
|
|
|
7047
7015
|
function formatEventPriceDisplay(pricing) {
|
|
7048
7016
|
return formatEventPricing(pricing, { decimals: "auto" });
|
|
7049
7017
|
}
|
|
7018
|
+
function closedEventBookingLabel(reason) {
|
|
7019
|
+
switch (reason) {
|
|
7020
|
+
case "occurrence_cancelled":
|
|
7021
|
+
case "series_cancelled": return "Cancelled";
|
|
7022
|
+
case "occurrence_completed":
|
|
7023
|
+
case "series_completed": return "Completed";
|
|
7024
|
+
case "series_draft":
|
|
7025
|
+
case "series_archived":
|
|
7026
|
+
case "parent_archived":
|
|
7027
|
+
case "parent_inconsistent":
|
|
7028
|
+
case "not_public":
|
|
7029
|
+
case "already_started":
|
|
7030
|
+
case "enrollment_closed": return "Registration closed";
|
|
7031
|
+
default: return assertNever$2(reason);
|
|
7032
|
+
}
|
|
7033
|
+
}
|
|
7050
7034
|
function resolveEventHref(event) {
|
|
7051
7035
|
const destination = resolveRuntimeEventDestination(event);
|
|
7052
7036
|
return destination.kind === "external" ? destination.url : destination.path;
|
|
@@ -7071,6 +7055,15 @@ function resolveEventCta(event, buttonText) {
|
|
|
7071
7055
|
const defaultButtonText = isExternal ? destination.label : event.bookingScope === "whole_series" ? "Book course" : "Book";
|
|
7072
7056
|
const effectiveButtonText = buttonText ?? defaultButtonText;
|
|
7073
7057
|
const href = resolveEventHref(event);
|
|
7058
|
+
if (event.bookingAvailability.kind === "closed") {
|
|
7059
|
+
const linksToClosedWholeSeriesDetails = event.bookingAvailability.reason === "enrollment_closed" && !isExternal;
|
|
7060
|
+
return {
|
|
7061
|
+
label: closedEventBookingLabel(event.bookingAvailability.reason),
|
|
7062
|
+
href,
|
|
7063
|
+
external: isExternal,
|
|
7064
|
+
hidden: !linksToClosedWholeSeriesDetails
|
|
7065
|
+
};
|
|
7066
|
+
}
|
|
7074
7067
|
if (!isExternal && isSoldOut) return {
|
|
7075
7068
|
label: "Sold out",
|
|
7076
7069
|
href,
|
|
@@ -7078,7 +7071,7 @@ function resolveEventCta(event, buttonText) {
|
|
|
7078
7071
|
hidden: true
|
|
7079
7072
|
};
|
|
7080
7073
|
return {
|
|
7081
|
-
label:
|
|
7074
|
+
label: effectiveButtonText,
|
|
7082
7075
|
href,
|
|
7083
7076
|
external: isExternal,
|
|
7084
7077
|
hidden: false
|
|
@@ -11849,4 +11842,4 @@ function defineIslandPropsDecoder(kind) {
|
|
|
11849
11842
|
};
|
|
11850
11843
|
}
|
|
11851
11844
|
//#endregion
|
|
11852
|
-
export {
|
|
11845
|
+
export { resolveOnColorForThemeToken as $, normalizeOptionalId as A, formatLocalScheduleDate as At, groupEventsByDate as B, publicEventPricingType as Bt, getWizardStepsForContext as C, reportWorkflowError as Ct, getEventRuntimeFiltersKey as D, formatBookingDateTime as Dt, buildEventRuntimeFilters as E, formatBookingDate as Et, formatEventPriceDisplay as F, toScheduledBookingDateTime as Ft, getEventAvailabilityStatus as G, resolveEventLinkProps as H, publicEventTicketTypes as Ht, formatEventTeacherLine as I, parseEventPageSurfaceSubject as It, RichTextDocSchema as J, getLocalDateKey as K, formatTime as L, formatBookingPriceDisplay as Lt, formatEventCompactDateRail as M, parseBookingLocalDate as Mt, formatEventDateParts as N, resolveBookingTimeZoneId as Nt, normalizeCsvIds as O, formatBookingInstant as Ot, formatEventPrice as P, toBookingTimeZone as Pt, isCssColorLiteral as Q, getCardOrientation as R, publicEventPricingCurrency as Rt, getStepNumber as S, okWith as St, staticHeaderChromeRuntime as T, addLocalScheduleDays as Tt, resolveRuntimeEventPricing as U, formatCurrencyAmount as Ut, resolveEventCta as V, publicEventScalarPrice as Vt, getEventAvailability as W, assertNever$2 as Wt, resolveEventRegistrationScopedEvents as X, isRecord$3 as Y, themeButtonClassName as Z, findPreSelectedEvent as _, BOOKING_FORM_DATA_RESERVED_KEYS as _t, buildProductDetailDisplay as a, formatBookingSubmissionPreparationError as at, resolveRegistrationTarget as b, err as bt, EMPTY_COMMERCE_CART_STATE as c, getBookingSuccessMessage as ct, deriveCommerceCheckoutState as d, prepareBookingSubmission as dt, resolveTokenOrCssColorValue as et, parseStoredCommerceCartState as f, resolveAppointmentCheckoutVerificationState as ft, findEventByOccurrenceId as g, toSelectedCollectionOptionKind as gt, toRegistrationEvents as h, resolveDefaultBookingServiceId as ht, buildProductCardDisplay as i, formatBookingCentsAsCurrencyInput as it, formatDate as j, getBookingLocalDateKey as jt, normalizeCsvString as k, formatBookingTime as kt, buildPassCartItem as l, isBookingServiceSlidingAmountInRange as lt, reduceCommerceCart as m, resolveBookingSiteId as mt, getShopDisplayForItems as n, logger as nt, formatCommercePrice as o, getBookingRedirectStateFromLocation as ot, productItemKey as p, resolveBookingPaymentStep as pt, getLocalMinuteOfDay as q, buildCartDisplay as r, deriveBookingFormViewState as rt, formatInterval as s, getBookingServiceSlidingScale as st, defineIslandPropsDecoder as t, normalizeCardVariantRole as tt, buildProductCartItem as u, parseBookingCurrencyInputToCents as ut, resolveDiscountContext as v, assertNever$1 as vt, buildEventCalendarListingRender as w, reportWorkflowSuccess as wt, WIZARD_STEPS as x, ok as xt, resolveEventRequiresPayment as y, clearWorkflowFeedback as yt, getContainerClass as z, publicEventPricingMode as zt };
|