@riverbankcms/sdk 0.129.1 → 0.130.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +32 -10
- package/dist/{PreviewEditorSidebar-DceRseRV.mjs → PreviewEditorSidebar-DiEpbOdw.mjs} +313 -239
- package/dist/{PreviewEditorUI-BNunq3kk.mjs → PreviewEditorUI-C6MvxnIa.mjs} +3 -3
- package/dist/{PreviewQueryProvider-B1kbhaJD.mjs → PreviewQueryProvider-C2rnoPz6.mjs} +1 -1
- package/dist/{SdkPreviewModeRuntime-Bt87-62u.mjs → SdkPreviewModeRuntime-DRXA_m5L.mjs} +208 -211
- package/dist/{SiteChromeCustomizeContext-BLl-OlL4.mjs → SiteChromeCustomizeContext-BTHdv5_-.mjs} +6204 -6239
- package/dist/_dts/ai/src/contracts/proposalPrimitives.d.ts +52 -0
- package/dist/_dts/ai/src/contracts/proposals.d.ts +4950 -29100
- package/dist/_dts/ai/src/contracts/siteStyleProposalSchemas.d.ts +32572 -0
- package/dist/_dts/api/src/appointmentSetup.d.ts +21 -9
- package/dist/_dts/api/src/bookingConfig.d.ts +4 -46
- package/dist/_dts/api/src/bookingManagementEndpoints.d.ts +13 -11
- package/dist/_dts/api/src/bookingRecords.d.ts +1 -0
- package/dist/_dts/api/src/contentRuntime.d.ts +3 -5
- package/dist/_dts/api/src/endpoints.d.ts +14 -21
- package/dist/_dts/api/src/eventManagementContracts.d.ts +76 -0
- package/dist/_dts/api/src/index.d.ts +3 -2
- package/dist/_dts/api/src/publicExperience/commerceEndpoints.d.ts +22 -47
- package/dist/_dts/api/src/sdk-event-schedule.d.ts +5 -0
- package/dist/_dts/api/src/sdk-event-upsert.d.ts +112 -20
- package/dist/_dts/api/src/sdkContracts.d.ts +38 -66
- package/dist/_dts/api/src/sdkManagedEventContracts.d.ts +35 -0
- package/dist/_dts/api/src/sdkThemeWire.d.ts +2423 -501
- package/dist/_dts/api/src/sitePlatformEndpoints.d.ts +5 -0
- package/dist/_dts/api/src/siteRuntimeEndpoints.d.ts +23 -37
- 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/system/blocks/location-map.d.ts +3 -2
- package/dist/_dts/blocks/src/system/blocks/media-text.d.ts +135 -90
- 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/componentFactory.d.ts +5 -5
- package/dist/_dts/blocks/src/system/customize/backgrounds.d.ts +8 -6
- 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 +5 -33
- 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/registry.d.ts +2 -0
- 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/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/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/transforms/registry/_utils/surfaceForegroundStyles.d.ts +3 -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 +3 -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 +0 -3
- 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/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/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/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 +1 -0
- package/dist/_dts/db/src/generated/supabase/database.types.d.ts +38 -18
- 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 +3 -5
- package/dist/_dts/preview-next/src/client/preview/PreviewShellLayout.d.ts +3 -5
- 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/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/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/system-block-content.d.ts +4 -41
- 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/public-api/contracts.d.ts +2 -16
- package/dist/_dts/sdk/src/rendering/components/Layout.d.ts +3 -2
- 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 +2 -0
- package/dist/_dts/sdk/src/rendering/islands/types.d.ts +6 -1
- 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/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/generated/containerResponsiveThemeCss.d.ts +1 -1
- package/dist/_dts/theme-core/src/lib/media.d.ts +583 -10
- package/dist/_dts/theme-core/src/mock-themes/all.d.ts +5117 -1433
- package/dist/_dts/theme-core/src/schema.d.ts +5079 -2005
- 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 +4 -4
- 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 +2 -2
- 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} +16 -86
- 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 -4
- package/dist/_dts/theme-core/src/site-styles/headerOpeningSection.d.ts +2 -2
- 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 +1 -1
- package/dist/_dts/theme-core/src/site-styles/previewCompiler.d.ts +14 -41
- package/dist/_dts/theme-core/src/site-styles/runtimeBackgroundResolution.d.ts +23 -0
- package/dist/_dts/theme-core/src/site-styles/runtimeCompiler.d.ts +8 -6
- package/dist/_dts/theme-core/src/site-styles/siteChromeNavPreferences.d.ts +1 -1
- package/dist/client/{CourseRegistrationWizard-xRmA7REV.mjs → CourseRegistrationWizard-Bvtz9G9g.mjs} +5 -5
- package/dist/client/{DiscountCodeDisclosure-B9vriL5C.mjs → DiscountCodeDisclosure-Ur-Xx1U_.mjs} +1 -1
- package/dist/client/{EventCombined.client-BgVnVTlz.mjs → EventCombined.client-EhscD4U6.mjs} +2 -2
- package/dist/client/{EventListing.client-CqdsO7jO.mjs → EventListing.client-Bn26cFTY.mjs} +2 -2
- package/dist/client/{LeafletStaticMap-CKPxot9M.mjs → LeafletStaticMap-BUw9Ntzr.mjs} +1 -1
- package/dist/client/{StepIndicator-DGCYuBJ1.mjs → StepIndicator-BfbdiVQI.mjs} +2 -2
- package/dist/client/{accordion-BfN5Eqd-.mjs → accordion-CjIeof73.mjs} +1 -1
- package/dist/client/{bookingForm-DOvCpBFP.mjs → bookingForm-DwEeovf_.mjs} +5 -5
- package/dist/client/bookings.mjs +1028 -1038
- package/dist/client/{carousel-DPNmiH0f.mjs → carousel-BMrfgOba.mjs} +1 -1
- package/dist/client/{cart--egVXlrR.mjs → cart-rXEdxTdb.mjs} +3 -3
- package/dist/client/{checkout-DywWtMcq.mjs → checkout-D3JlSzh3.mjs} +3 -3
- package/dist/client/client.mjs +18345 -18311
- package/dist/client/{courseRegistration-Dk9qFVwt.mjs → courseRegistration-DO5XvMAA.mjs} +2 -2
- package/dist/client/{eventCalendar-Bkz2HjlS.mjs → eventCalendar-DO6rTqCn.mjs} +4 -4
- package/dist/client/{eventCombined-D4kipYWg.mjs → eventCombined-bJ3i_ovU.mjs} +2 -2
- package/dist/client/{eventDetails-Dz_5ix2Q.mjs → eventDetails-CCbrXE7o.mjs} +3 -3
- package/dist/client/{eventListing-D0vm-zST.mjs → eventListing-Bdlt9YTm.mjs} +2 -2
- package/dist/client/{eventRegistration-Cw1E4Q4p.mjs → eventRegistration-B02lt6iY.mjs} +6 -6
- package/dist/client/{form-C2Zf1n3K.mjs → form-DrUBAAox.mjs} +1 -1
- package/dist/client/{headerSection-CP05gzdc.mjs → headerSection-MzqvHL6T.mjs} +151 -104
- package/dist/client/hooks.mjs +4532 -4216
- package/dist/client/{locationMap-Cl3x9PYJ.mjs → locationMap-DG8BxTBm.mjs} +2 -2
- package/dist/client/{newsletterForm-DyEJoClm.mjs → newsletterForm-BzO-Td3p.mjs} +1 -1
- package/dist/client/{pricing-DGuNR1W4.mjs → pricing-NgK7ozkg.mjs} +1 -1
- package/dist/client/{productDetail-Cq-HrGew.mjs → productDetail-CfQ7rhVK.mjs} +3 -3
- package/dist/client/{productList-DbB3jwqd.mjs → productList-C23rOLUi.mjs} +3 -3
- package/dist/client/{propsDecoder-CiTuhUwY.mjs → propsDecoder-CAZdhwjs.mjs} +2166 -2157
- package/dist/client/rendering/client.mjs +3600 -4118
- package/dist/client/rendering/islands.mjs +18 -18
- package/dist/client/rendering.mjs +15950 -15890
- package/dist/client/{scrollToBlock-CShkRqab.mjs → scrollToBlock-DSSqVQr1.mjs} +1 -1
- package/dist/client/{shop-Cu4Ib-ZA.mjs → shop-BMToKLK7.mjs} +34 -23
- package/dist/client/{shop-commerce-BzpsOdh7.mjs → shop-commerce-DB4JRKmp.mjs} +4 -4
- package/dist/client/{shop-commerce-store-DaE7Fhj8.mjs → shop-commerce-store-BOqSIOuc.mjs} +1 -1
- package/dist/client/{shopShared-cF0c20vB.mjs → shopShared-B6SK9DZv.mjs} +9 -3
- package/dist/client/{useEventFilters-QZ3HMgaJ.mjs → useEventFilters-CULOa4nB.mjs} +2 -2
- package/dist/client/{usePolling-BKf0GcE-.mjs → usePolling-BGG_8-jl.mjs} +2 -2
- package/dist/preview-next/before-render.mjs +16 -27
- package/dist/preview-next/client/runtime.mjs +4 -4
- package/dist/preview-next/middleware.mjs +16 -27
- package/dist/{previewAuthStore-BesgU5Xu.mjs → previewAuthStore-_GXFRg2W.mjs} +16 -27
- package/dist/{sdk-runtime-C20CVWbb.mjs → sdk-runtime-hhSOMShR.mjs} +2 -2
- package/dist/{separator-BE3NCquy.mjs → separator-flRaFc14.mjs} +1 -1
- package/dist/server/components.mjs +17770 -17866
- package/dist/server/config-validation.mjs +4711 -4421
- package/dist/server/config.mjs +4715 -4425
- package/dist/server/data.mjs +4515 -4216
- package/dist/server/date-time.mjs +22 -13
- package/dist/server/index.mjs +17 -28
- package/dist/server/next.mjs +17586 -17650
- package/dist/server/page-converter.mjs +3759 -4390
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/rendering/server.mjs +18952 -19064
- package/dist/server/rendering.mjs +17824 -17901
- package/dist/server/routing.mjs +4748 -4365
- package/dist/server/server.mjs +4591 -4269
- package/dist/server/theme-bridge.mjs +1393 -1886
- package/dist/server/theme.mjs +736 -605
- package/dist/styles/index.css +22 -3
- package/package.json +1 -1
- 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/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,
|
|
@@ -2877,7 +2877,7 @@ var BlockApiError = class extends Error {
|
|
|
2877
2877
|
this.name = "BlockApiError";
|
|
2878
2878
|
}
|
|
2879
2879
|
};
|
|
2880
|
-
function isRecord$
|
|
2880
|
+
function isRecord$7(value) {
|
|
2881
2881
|
return typeof value === "object" && value !== null;
|
|
2882
2882
|
}
|
|
2883
2883
|
function isJsonResponseContentType(contentType) {
|
|
@@ -2901,8 +2901,8 @@ async function parseJsonBody(response) {
|
|
|
2901
2901
|
}
|
|
2902
2902
|
}
|
|
2903
2903
|
function getBlockApiErrorDetails(data) {
|
|
2904
|
-
if (!isRecord$
|
|
2905
|
-
const nestedError = isRecord$
|
|
2904
|
+
if (!isRecord$7(data)) return {};
|
|
2905
|
+
const nestedError = isRecord$7(data.error) ? data.error : void 0;
|
|
2906
2906
|
return {
|
|
2907
2907
|
message: typeof nestedError?.message === "string" ? nestedError.message : typeof data.message === "string" ? data.message : void 0,
|
|
2908
2908
|
code: typeof nestedError?.code === "string" ? nestedError.code : typeof data.code === "string" ? data.code : void 0
|
|
@@ -3834,7 +3834,7 @@ function isFreePublicEventPriceDisplay(display) {
|
|
|
3834
3834
|
//#endregion
|
|
3835
3835
|
//#region ../core/src/event-page-surface-subject.ts
|
|
3836
3836
|
function parseEventPageSurfaceSubject(value) {
|
|
3837
|
-
if (!isRecord$
|
|
3837
|
+
if (!isRecord$6(value)) return err$1({ kind: "notObject" });
|
|
3838
3838
|
switch (value.kind) {
|
|
3839
3839
|
case "eventSeries": {
|
|
3840
3840
|
const eventSeriesId = parseEventSeriesId(value.eventSeriesId);
|
|
@@ -3877,7 +3877,7 @@ function parseEventPageSurfaceSubject(value) {
|
|
|
3877
3877
|
});
|
|
3878
3878
|
}
|
|
3879
3879
|
}
|
|
3880
|
-
function isRecord$
|
|
3880
|
+
function isRecord$6(value) {
|
|
3881
3881
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
3882
3882
|
}
|
|
3883
3883
|
//#endregion
|
|
@@ -3959,36 +3959,46 @@ function assertNever$1(value) {
|
|
|
3959
3959
|
throw new Error(`Unexpected value: ${String(value)}`);
|
|
3960
3960
|
}
|
|
3961
3961
|
//#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();
|
|
3962
|
+
//#region ../core/src/booking-time-zone.ts
|
|
3963
|
+
const TIME_ZONE_VALIDITY_CACHE_LIMIT = 100;
|
|
3968
3964
|
const timeZoneValidityCache = /* @__PURE__ */ new Map();
|
|
3969
|
-
|
|
3970
|
-
|
|
3965
|
+
const NUMERIC_OFFSET_TIME_ZONE_PATTERN = /^(?:[+-]\d{2}(?::?\d{2})?|(?:UTC|GMT)[+-]\d{1,2}(?::?\d{2})?)$/iu;
|
|
3966
|
+
function isValidBookingTimeZone(timeZone) {
|
|
3967
|
+
const normalized = timeZone.trim();
|
|
3968
|
+
if (NUMERIC_OFFSET_TIME_ZONE_PATTERN.test(normalized)) return false;
|
|
3969
|
+
const cached = timeZoneValidityCache.get(normalized);
|
|
3971
3970
|
if (cached !== void 0) return cached;
|
|
3972
3971
|
let isValid;
|
|
3973
3972
|
try {
|
|
3974
|
-
new Intl.DateTimeFormat(
|
|
3973
|
+
new Intl.DateTimeFormat("en-US", { timeZone: normalized }).format(/* @__PURE__ */ new Date());
|
|
3975
3974
|
isValid = true;
|
|
3976
3975
|
} catch {
|
|
3977
3976
|
isValid = false;
|
|
3978
3977
|
}
|
|
3979
|
-
if (timeZoneValidityCache.size >=
|
|
3980
|
-
timeZoneValidityCache.set(
|
|
3978
|
+
if (timeZoneValidityCache.size >= TIME_ZONE_VALIDITY_CACHE_LIMIT) timeZoneValidityCache.clear();
|
|
3979
|
+
timeZoneValidityCache.set(normalized, isValid);
|
|
3981
3980
|
return isValid;
|
|
3982
3981
|
}
|
|
3982
|
+
function parseBookingTimeZone(timeZone) {
|
|
3983
|
+
if (typeof timeZone !== "string") return err$1("invalid-time-zone");
|
|
3984
|
+
const normalized = timeZone.trim();
|
|
3985
|
+
if (normalized.length === 0 || NUMERIC_OFFSET_TIME_ZONE_PATTERN.test(normalized) || !isValidBookingTimeZone(normalized)) return err$1("invalid-time-zone");
|
|
3986
|
+
return ok(normalized);
|
|
3987
|
+
}
|
|
3988
|
+
//#endregion
|
|
3989
|
+
//#region ../core/src/booking-date-time.ts
|
|
3990
|
+
const DEFAULT_LOCALE = "en-US";
|
|
3991
|
+
const FALLBACK_TIMEZONE = "UTC";
|
|
3992
|
+
const LOCAL_DATE_PATTERN = /^(?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2})$/u;
|
|
3993
|
+
const DATE_TIME_FORMATTER_CACHE_LIMIT = 100;
|
|
3994
|
+
const dateTimeFormatterCache = /* @__PURE__ */ new Map();
|
|
3983
3995
|
function getSafeTimeZone(timeZone) {
|
|
3984
3996
|
const normalized = typeof timeZone === "string" ? timeZone.trim() : "";
|
|
3985
|
-
return normalized.length > 0 &&
|
|
3997
|
+
return normalized.length > 0 && isValidBookingTimeZone(normalized) ? normalized : FALLBACK_TIMEZONE;
|
|
3986
3998
|
}
|
|
3987
3999
|
function parseStrictBookingTimeZone(timeZone) {
|
|
3988
|
-
|
|
3989
|
-
|
|
3990
|
-
if (normalized.length === 0 || !isValidTimeZone(normalized)) return null;
|
|
3991
|
-
return normalized;
|
|
4000
|
+
const parsed = parseBookingTimeZone(timeZone);
|
|
4001
|
+
return parsed.ok ? parsed.value : null;
|
|
3992
4002
|
}
|
|
3993
4003
|
function formatParseError(error) {
|
|
3994
4004
|
switch (error.reason) {
|
|
@@ -4041,7 +4051,7 @@ function toBookingTimeZone(timeZone) {
|
|
|
4041
4051
|
function resolveBookingTimeZoneId(...candidates) {
|
|
4042
4052
|
for (const candidate of candidates) {
|
|
4043
4053
|
const normalized = typeof candidate === "string" ? candidate.trim() : "";
|
|
4044
|
-
if (normalized &&
|
|
4054
|
+
if (normalized && isValidBookingTimeZone(normalized)) return normalized;
|
|
4045
4055
|
}
|
|
4046
4056
|
return FALLBACK_TIMEZONE;
|
|
4047
4057
|
}
|
|
@@ -4333,12 +4343,12 @@ function resolveBookingSiteId(siteId, form) {
|
|
|
4333
4343
|
return siteId || form?.siteId || "";
|
|
4334
4344
|
}
|
|
4335
4345
|
function normalizeBookingFormConfig(form) {
|
|
4336
|
-
if (!isRecord$
|
|
4346
|
+
if (!isRecord$5(form)) return null;
|
|
4337
4347
|
const id = readNonEmptyString(form.id);
|
|
4338
4348
|
const name = readNonEmptyString(form.name);
|
|
4339
4349
|
if (!id || !name) return null;
|
|
4340
|
-
const schemaSource = isRecord$
|
|
4341
|
-
const settingsSource = isRecord$
|
|
4350
|
+
const schemaSource = isRecord$5(form.schema) ? form.schema : isRecord$5(form.schemaJson) ? form.schemaJson : null;
|
|
4351
|
+
const settingsSource = isRecord$5(form.settings) ? form.settings : isRecord$5(form.settingsJson) ? form.settingsJson : null;
|
|
4342
4352
|
return {
|
|
4343
4353
|
id,
|
|
4344
4354
|
name,
|
|
@@ -4358,8 +4368,8 @@ function normalizeBookingServices(services) {
|
|
|
4358
4368
|
};
|
|
4359
4369
|
if (!services) return [];
|
|
4360
4370
|
if (Array.isArray(services)) return services.filter(isBookingFormService).map(normalizeService);
|
|
4361
|
-
if (isRecord$
|
|
4362
|
-
return isRecord$
|
|
4371
|
+
if (isRecord$5(services) && "services" in services) return Array.isArray(services.services) ? services.services.filter(isBookingFormService).map(normalizeService) : [];
|
|
4372
|
+
return isRecord$5(services) ? Object.values(services).filter(isBookingFormService).map(normalizeService) : [];
|
|
4363
4373
|
}
|
|
4364
4374
|
function normalizeBookingSchema(value) {
|
|
4365
4375
|
if (!value) return void 0;
|
|
@@ -4370,7 +4380,7 @@ function normalizeBookingSchema(value) {
|
|
|
4370
4380
|
};
|
|
4371
4381
|
}
|
|
4372
4382
|
function readBookingFormField(value) {
|
|
4373
|
-
if (!isRecord$
|
|
4383
|
+
if (!isRecord$5(value)) return null;
|
|
4374
4384
|
const id = readNonEmptyString(value.id);
|
|
4375
4385
|
const label = readNonEmptyString(value.label);
|
|
4376
4386
|
const type = readBookingFieldType(value.type);
|
|
@@ -4414,7 +4424,7 @@ function readBookingFieldOptions(value) {
|
|
|
4414
4424
|
return options.length > 0 ? options : void 0;
|
|
4415
4425
|
}
|
|
4416
4426
|
function readBookingFieldOption(value) {
|
|
4417
|
-
if (!isRecord$
|
|
4427
|
+
if (!isRecord$5(value)) return null;
|
|
4418
4428
|
const optionValue = readNonEmptyString(value.value);
|
|
4419
4429
|
const label = readNonEmptyString(value.label);
|
|
4420
4430
|
return optionValue && label ? {
|
|
@@ -4434,7 +4444,7 @@ function normalizeBookingSettings(value) {
|
|
|
4434
4444
|
};
|
|
4435
4445
|
}
|
|
4436
4446
|
function isBookingFormService(value) {
|
|
4437
|
-
return isRecord$
|
|
4447
|
+
return isRecord$5(value) && typeof value.id === "string" && typeof value.siteId === "string" && typeof value.title === "string";
|
|
4438
4448
|
}
|
|
4439
4449
|
function collectBookingCustomFields(data) {
|
|
4440
4450
|
const customFields = {};
|
|
@@ -4484,7 +4494,7 @@ function readStringArray(value) {
|
|
|
4484
4494
|
const strings = value.filter((item) => typeof item === "string");
|
|
4485
4495
|
return strings.length > 0 ? strings : void 0;
|
|
4486
4496
|
}
|
|
4487
|
-
function isRecord$
|
|
4497
|
+
function isRecord$5(value) {
|
|
4488
4498
|
return typeof value === "object" && value !== null;
|
|
4489
4499
|
}
|
|
4490
4500
|
function getBookingServicePaymentSelectionMode(service) {
|
|
@@ -6411,7 +6421,7 @@ function omitRecordKey(record, key) {
|
|
|
6411
6421
|
return rest;
|
|
6412
6422
|
}
|
|
6413
6423
|
function readAppointmentBookingOverrideData(value) {
|
|
6414
|
-
if (!isRecord$
|
|
6424
|
+
if (!isRecord$4(value)) return null;
|
|
6415
6425
|
const services = normalizeBookingServices(value.services);
|
|
6416
6426
|
return {
|
|
6417
6427
|
form: normalizeBookingFormConfig(value.form),
|
|
@@ -6426,7 +6436,7 @@ function createOverrideInputError(reason, message, warnInDev = false) {
|
|
|
6426
6436
|
message
|
|
6427
6437
|
};
|
|
6428
6438
|
}
|
|
6429
|
-
function isRecord$
|
|
6439
|
+
function isRecord$4(value) {
|
|
6430
6440
|
return typeof value === "object" && value !== null;
|
|
6431
6441
|
}
|
|
6432
6442
|
//#endregion
|
|
@@ -7416,7 +7426,7 @@ const PALETTE_TOKEN_NAMES = [
|
|
|
7416
7426
|
"text",
|
|
7417
7427
|
"border"
|
|
7418
7428
|
];
|
|
7419
|
-
const paletteTokenNameSchema = z
|
|
7429
|
+
const paletteTokenNameSchema = z.enum(PALETTE_TOKEN_NAMES);
|
|
7420
7430
|
const themeColorBaseTokenNames = [
|
|
7421
7431
|
...PALETTE_TOKEN_NAMES,
|
|
7422
7432
|
...blockColorTokenNames,
|
|
@@ -7461,7 +7471,7 @@ function parseThemeColorToken(value) {
|
|
|
7461
7471
|
if (!isThemeColorToken(value)) return null;
|
|
7462
7472
|
return value.trim();
|
|
7463
7473
|
}
|
|
7464
|
-
const themeColorTokenSchema = z
|
|
7474
|
+
const themeColorTokenSchema = z.string().min(1).refine((value) => Boolean(isThemeColorToken(value)), "Expected a known Theme V2 color token");
|
|
7465
7475
|
//#endregion
|
|
7466
7476
|
//#region ../theme-core/src/buttons/types.ts
|
|
7467
7477
|
/**
|
|
@@ -7483,7 +7493,7 @@ const VARIANT_ROLES = [
|
|
|
7483
7493
|
* IDs become class selectors, so keep the contract deliberately narrower than
|
|
7484
7494
|
* an arbitrary string and shared with every authoring/runtime boundary.
|
|
7485
7495
|
*/
|
|
7486
|
-
const buttonVariantIdSchema = z
|
|
7496
|
+
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
7497
|
function parseOpaqueButtonColourToken(value) {
|
|
7488
7498
|
const token = parseThemeColorToken(value);
|
|
7489
7499
|
if (token === null) return null;
|
|
@@ -7498,8 +7508,8 @@ const opaqueButtonColourTokenSchema = themeColorTokenSchema.refine((value) => pa
|
|
|
7498
7508
|
if (token === null) throw new Error("Invariant: opaque button token passed its schema");
|
|
7499
7509
|
return token;
|
|
7500
7510
|
});
|
|
7501
|
-
const buttonShadeAmountSchema = z
|
|
7502
|
-
const buttonShadowIntensitySchema = z
|
|
7511
|
+
const buttonShadeAmountSchema = z.number().finite().min(0).max(900).multipleOf(100);
|
|
7512
|
+
const buttonShadowIntensitySchema = z.enum([
|
|
7503
7513
|
"subtle",
|
|
7504
7514
|
"medium",
|
|
7505
7515
|
"strong"
|
|
@@ -7511,153 +7521,176 @@ const buttonShadowIntensitySchema = z$1.enum([
|
|
|
7511
7521
|
* this closed union so unsupported effect IDs, unknown option keys, and unsafe
|
|
7512
7522
|
* CSS values cannot become representable after the schema boundary.
|
|
7513
7523
|
*/
|
|
7514
|
-
const buttonEffectApplicationSchema = z
|
|
7515
|
-
z
|
|
7516
|
-
effectId: z
|
|
7517
|
-
options: z
|
|
7524
|
+
const buttonEffectApplicationSchema = z.discriminatedUnion("effectId", [
|
|
7525
|
+
z.strictObject({
|
|
7526
|
+
effectId: z.literal("darken-background"),
|
|
7527
|
+
options: z.strictObject({ amount: buttonShadeAmountSchema.optional() }).optional()
|
|
7518
7528
|
}),
|
|
7519
|
-
z
|
|
7520
|
-
effectId: z
|
|
7521
|
-
options: z
|
|
7529
|
+
z.strictObject({
|
|
7530
|
+
effectId: z.literal("lighten-background"),
|
|
7531
|
+
options: z.strictObject({ amount: buttonShadeAmountSchema.optional() }).optional()
|
|
7522
7532
|
}),
|
|
7523
|
-
z
|
|
7524
|
-
effectId: z
|
|
7525
|
-
options: z
|
|
7533
|
+
z.strictObject({
|
|
7534
|
+
effectId: z.literal("background-on-hover"),
|
|
7535
|
+
options: z.strictObject({ colorToken: opaqueButtonColourTokenSchema.optional() }).optional()
|
|
7526
7536
|
}),
|
|
7527
|
-
z
|
|
7528
|
-
effectId: z
|
|
7529
|
-
options: z
|
|
7537
|
+
z.strictObject({
|
|
7538
|
+
effectId: z.literal("animated-gradient"),
|
|
7539
|
+
options: z.strictObject({ direction: z.enum(["horizontal", "vertical"]).optional() }).optional()
|
|
7530
7540
|
}),
|
|
7531
|
-
z
|
|
7532
|
-
effectId: z
|
|
7533
|
-
options: z
|
|
7541
|
+
z.strictObject({
|
|
7542
|
+
effectId: z.literal("drop-shadow"),
|
|
7543
|
+
options: z.strictObject({ intensity: buttonShadowIntensitySchema.optional() }).optional()
|
|
7534
7544
|
}),
|
|
7535
|
-
z
|
|
7536
|
-
effectId: z
|
|
7537
|
-
options: z
|
|
7545
|
+
z.strictObject({
|
|
7546
|
+
effectId: z.literal("inner-shadow"),
|
|
7547
|
+
options: z.strictObject({}).optional()
|
|
7538
7548
|
}),
|
|
7539
|
-
z
|
|
7540
|
-
effectId: z
|
|
7541
|
-
options: z
|
|
7542
|
-
mode: z
|
|
7549
|
+
z.strictObject({
|
|
7550
|
+
effectId: z.literal("neumorphic-shadow"),
|
|
7551
|
+
options: z.strictObject({
|
|
7552
|
+
mode: z.enum(["raised", "pressed"]).optional(),
|
|
7543
7553
|
intensity: buttonShadowIntensitySchema.optional()
|
|
7544
7554
|
}).optional()
|
|
7545
7555
|
}),
|
|
7546
|
-
z
|
|
7547
|
-
effectId: z
|
|
7548
|
-
options: z
|
|
7556
|
+
z.strictObject({
|
|
7557
|
+
effectId: z.literal("retro-3d-shadow"),
|
|
7558
|
+
options: z.strictObject({}).optional()
|
|
7549
7559
|
}),
|
|
7550
|
-
z
|
|
7551
|
-
effectId: z
|
|
7552
|
-
options: z
|
|
7560
|
+
z.strictObject({
|
|
7561
|
+
effectId: z.literal("scale-up"),
|
|
7562
|
+
options: z.strictObject({ scale: z.enum([
|
|
7553
7563
|
"1.02",
|
|
7554
7564
|
"1.03",
|
|
7555
7565
|
"1.05",
|
|
7556
7566
|
"1.10"
|
|
7557
7567
|
]).optional() }).optional()
|
|
7558
7568
|
}),
|
|
7559
|
-
z
|
|
7560
|
-
effectId: z
|
|
7561
|
-
options: z
|
|
7569
|
+
z.strictObject({
|
|
7570
|
+
effectId: z.literal("scale-down"),
|
|
7571
|
+
options: z.strictObject({ scale: z.enum([
|
|
7562
7572
|
"0.90",
|
|
7563
7573
|
"0.95",
|
|
7564
7574
|
"0.97",
|
|
7565
7575
|
"0.98"
|
|
7566
7576
|
]).optional() }).optional()
|
|
7567
7577
|
}),
|
|
7568
|
-
z
|
|
7569
|
-
effectId: z
|
|
7570
|
-
options: z
|
|
7578
|
+
z.strictObject({
|
|
7579
|
+
effectId: z.literal("lift"),
|
|
7580
|
+
options: z.strictObject({ amount: z.enum([
|
|
7571
7581
|
"0.25",
|
|
7572
7582
|
"0.5",
|
|
7573
7583
|
"1"
|
|
7574
7584
|
]).optional() }).optional()
|
|
7575
7585
|
}),
|
|
7576
|
-
z
|
|
7577
|
-
effectId: z
|
|
7578
|
-
options: z
|
|
7586
|
+
z.strictObject({
|
|
7587
|
+
effectId: z.literal("press-down"),
|
|
7588
|
+
options: z.strictObject({}).optional()
|
|
7579
7589
|
}),
|
|
7580
|
-
z
|
|
7581
|
-
effectId: z
|
|
7582
|
-
options: z
|
|
7590
|
+
z.strictObject({
|
|
7591
|
+
effectId: z.literal("pop"),
|
|
7592
|
+
options: z.strictObject({ intensity: z.enum([
|
|
7583
7593
|
"subtle",
|
|
7584
7594
|
"medium",
|
|
7585
7595
|
"dramatic"
|
|
7586
7596
|
]).optional() }).optional()
|
|
7587
7597
|
}),
|
|
7588
|
-
z
|
|
7589
|
-
effectId: z
|
|
7590
|
-
options: z
|
|
7591
|
-
height: z
|
|
7592
|
-
origin: z
|
|
7598
|
+
z.strictObject({
|
|
7599
|
+
effectId: z.literal("border-bottom-grow"),
|
|
7600
|
+
options: z.strictObject({
|
|
7601
|
+
height: z.union([z.literal(1), z.literal(2)]).optional(),
|
|
7602
|
+
origin: z.enum([
|
|
7593
7603
|
"left",
|
|
7594
7604
|
"center",
|
|
7595
7605
|
"right"
|
|
7596
7606
|
]).optional()
|
|
7597
7607
|
}).optional()
|
|
7598
7608
|
}),
|
|
7599
|
-
z
|
|
7600
|
-
effectId: z
|
|
7601
|
-
options: z
|
|
7609
|
+
z.strictObject({
|
|
7610
|
+
effectId: z.literal("sketchy-border"),
|
|
7611
|
+
options: z.strictObject({ intensity: buttonShadowIntensitySchema.optional() }).optional()
|
|
7602
7612
|
})
|
|
7603
7613
|
]);
|
|
7604
|
-
const cornerStyleSchema = z
|
|
7614
|
+
const cornerStyleSchema = z.enum([
|
|
7605
7615
|
"square",
|
|
7606
7616
|
"rounded",
|
|
7607
7617
|
"pill"
|
|
7608
7618
|
]);
|
|
7609
|
-
const shadowSizeSchema = z
|
|
7619
|
+
const shadowSizeSchema = z.enum([
|
|
7610
7620
|
"none",
|
|
7611
7621
|
"low",
|
|
7612
7622
|
"medium",
|
|
7613
7623
|
"high"
|
|
7614
7624
|
]);
|
|
7615
|
-
const textTransformSchema = z
|
|
7625
|
+
const textTransformSchema = z.enum([
|
|
7616
7626
|
"none",
|
|
7617
7627
|
"uppercase",
|
|
7618
7628
|
"lowercase",
|
|
7619
7629
|
"capitalize"
|
|
7620
7630
|
]);
|
|
7621
|
-
const fontWeightSchema = z
|
|
7622
|
-
z
|
|
7623
|
-
z
|
|
7624
|
-
z
|
|
7631
|
+
const fontWeightSchema = z.union([
|
|
7632
|
+
z.literal(500),
|
|
7633
|
+
z.literal(600),
|
|
7634
|
+
z.literal(700)
|
|
7625
7635
|
]);
|
|
7626
|
-
const buttonTypographySchema = z
|
|
7627
|
-
const letterSpacingSchema = z
|
|
7636
|
+
const buttonTypographySchema = z.enum(["body", "heading"]);
|
|
7637
|
+
const letterSpacingSchema = z.enum([
|
|
7628
7638
|
"tight",
|
|
7629
7639
|
"normal",
|
|
7630
7640
|
"loose"
|
|
7631
7641
|
]);
|
|
7632
|
-
const hoverTransformSchema = z
|
|
7642
|
+
const hoverTransformSchema = z.enum([
|
|
7633
7643
|
"none",
|
|
7634
7644
|
"lift",
|
|
7635
7645
|
"scale",
|
|
7636
7646
|
"press"
|
|
7637
7647
|
]);
|
|
7638
|
-
z
|
|
7639
|
-
const buttonPaddingPresetSchema = z
|
|
7648
|
+
z.enum(["none", "token"]);
|
|
7649
|
+
const buttonPaddingPresetSchema = z.enum([
|
|
7640
7650
|
"compact",
|
|
7641
7651
|
"default",
|
|
7642
7652
|
"spacious"
|
|
7643
7653
|
]);
|
|
7644
|
-
const gradientStyleSchema = z
|
|
7654
|
+
const gradientStyleSchema = z.enum([
|
|
7645
7655
|
"linear",
|
|
7646
7656
|
"radial",
|
|
7647
7657
|
"conic"
|
|
7648
7658
|
]);
|
|
7649
|
-
const gradientSharpnessSchema = z
|
|
7659
|
+
const gradientSharpnessSchema = z.enum([
|
|
7650
7660
|
"smooth",
|
|
7651
7661
|
"medium",
|
|
7652
7662
|
"hard"
|
|
7653
7663
|
]);
|
|
7654
|
-
const prioritySchema = z
|
|
7655
|
-
z
|
|
7656
|
-
z
|
|
7657
|
-
z
|
|
7664
|
+
const prioritySchema = z.union([
|
|
7665
|
+
z.literal(1),
|
|
7666
|
+
z.literal(2),
|
|
7667
|
+
z.literal(3)
|
|
7658
7668
|
]);
|
|
7659
|
-
z
|
|
7660
|
-
const
|
|
7669
|
+
const variantRoleSchema = z.enum(VARIANT_ROLES);
|
|
7670
|
+
const buttonSurfaceFallbackSchema = z.discriminatedUnion("kind", [z.strictObject({ kind: z.literal("surface-outline") }), z.strictObject({
|
|
7671
|
+
kind: z.literal("variant"),
|
|
7672
|
+
role: variantRoleSchema
|
|
7673
|
+
})]);
|
|
7674
|
+
const standardButtonSurfacePolicy = {
|
|
7675
|
+
primary: [{ kind: "surface-outline" }],
|
|
7676
|
+
secondary: [{ kind: "surface-outline" }, {
|
|
7677
|
+
kind: "variant",
|
|
7678
|
+
role: "primary"
|
|
7679
|
+
}],
|
|
7680
|
+
outline: [{ kind: "surface-outline" }],
|
|
7681
|
+
ghost: [{ kind: "surface-outline" }],
|
|
7682
|
+
accent: [{ kind: "surface-outline" }, {
|
|
7683
|
+
kind: "variant",
|
|
7684
|
+
role: "primary"
|
|
7685
|
+
}]
|
|
7686
|
+
};
|
|
7687
|
+
const STANDARD_BUTTON_SURFACE_POLICY = Object.freeze(Object.fromEntries(VARIANT_ROLES.map((role) => [role, Object.freeze([...standardButtonSurfacePolicy[role]])])));
|
|
7688
|
+
function createStandardButtonSurfacePolicy() {
|
|
7689
|
+
return Object.fromEntries(VARIANT_ROLES.map((role) => [role, [...STANDARD_BUTTON_SURFACE_POLICY[role]]]));
|
|
7690
|
+
}
|
|
7691
|
+
const buttonSurfacePolicyShape = Object.fromEntries(VARIANT_ROLES.map((role) => [role, z.array(buttonSurfaceFallbackSchema).max(VARIANT_ROLES.length)]));
|
|
7692
|
+
const buttonSurfacePolicySchema = z.strictObject(buttonSurfacePolicyShape);
|
|
7693
|
+
const buttonSizeNameSchema = z.enum([
|
|
7661
7694
|
"sm",
|
|
7662
7695
|
"md",
|
|
7663
7696
|
"lg",
|
|
@@ -7671,13 +7704,13 @@ const buttonSizeNameSchema = z$1.enum([
|
|
|
7671
7704
|
* generator trust the shape rather than defensively defaulting downstream.
|
|
7672
7705
|
*/
|
|
7673
7706
|
const PADDING_TOKEN_PATTERN = /^(?:0|\d+(?:\.\d+)?(?:rem|em|px|%))$/;
|
|
7674
|
-
const paddingShorthandSchema = z
|
|
7707
|
+
const paddingShorthandSchema = z.string().refine((value) => {
|
|
7675
7708
|
const parts = value.split(/\s+/).filter(Boolean);
|
|
7676
7709
|
return parts.length === 2 && parts.every((token) => PADDING_TOKEN_PATTERN.test(token));
|
|
7677
7710
|
}, { message: "Padding must be two space-separated CSS length tokens (e.g. \"0.5rem 1rem\"). Use `0` for zero." });
|
|
7678
|
-
const buttonSizeConfigSchema = z
|
|
7711
|
+
const buttonSizeConfigSchema = z.object({
|
|
7679
7712
|
padding: paddingShorthandSchema,
|
|
7680
|
-
fontSize: z
|
|
7713
|
+
fontSize: z.string().optional()
|
|
7681
7714
|
});
|
|
7682
7715
|
/**
|
|
7683
7716
|
* `xl` is optional on the wire so themes persisted before the `xl` size was
|
|
@@ -7685,7 +7718,7 @@ const buttonSizeConfigSchema = z$1.object({
|
|
|
7685
7718
|
* backfills it from `lg`, keeping `ButtonSizes` a complete `sm/md/lg/xl` map
|
|
7686
7719
|
* downstream — generators never need to deal with an undefined `xl`.
|
|
7687
7720
|
*/
|
|
7688
|
-
const buttonSizesSchema = z
|
|
7721
|
+
const buttonSizesSchema = z.object({
|
|
7689
7722
|
sm: buttonSizeConfigSchema,
|
|
7690
7723
|
md: buttonSizeConfigSchema,
|
|
7691
7724
|
lg: buttonSizeConfigSchema,
|
|
@@ -7696,9 +7729,9 @@ const buttonSizesSchema = z$1.object({
|
|
|
7696
7729
|
lg,
|
|
7697
7730
|
xl: xl ?? lg
|
|
7698
7731
|
}));
|
|
7699
|
-
const buttonGlobalSettingsBaseSchema = z
|
|
7732
|
+
const buttonGlobalSettingsBaseSchema = z.strictObject({
|
|
7700
7733
|
cornerStyle: cornerStyleSchema,
|
|
7701
|
-
cornerRadius: z
|
|
7734
|
+
cornerRadius: z.number().min(0).max(24).optional(),
|
|
7702
7735
|
/**
|
|
7703
7736
|
* Family-level shadow inherited by variants that don't set their own.
|
|
7704
7737
|
* Optional and flat-by-default: when omitted, buttons carry no drop shadow
|
|
@@ -7710,23 +7743,23 @@ const buttonGlobalSettingsBaseSchema = z$1.strictObject({
|
|
|
7710
7743
|
textTransform: textTransformSchema,
|
|
7711
7744
|
fontWeight: fontWeightSchema,
|
|
7712
7745
|
typography: buttonTypographySchema.optional(),
|
|
7713
|
-
fontSize: z
|
|
7746
|
+
fontSize: z.string().optional(),
|
|
7714
7747
|
letterSpacing: letterSpacingSchema.optional(),
|
|
7715
|
-
italic: z
|
|
7748
|
+
italic: z.boolean().optional(),
|
|
7716
7749
|
paddingPreset: buttonPaddingPresetSchema.optional(),
|
|
7717
7750
|
hoverTransform: hoverTransformSchema,
|
|
7718
7751
|
gradientStyle: gradientStyleSchema.optional(),
|
|
7719
|
-
gradientAngle: z
|
|
7752
|
+
gradientAngle: z.number().min(0).max(360).optional(),
|
|
7720
7753
|
gradientSharpness: gradientSharpnessSchema.optional()
|
|
7721
7754
|
});
|
|
7722
|
-
const buttonGlobalSettingsSchema = z
|
|
7723
|
-
hoverColor: z
|
|
7724
|
-
hoverColorToken: z
|
|
7755
|
+
const buttonGlobalSettingsSchema = z.discriminatedUnion("hoverColor", [buttonGlobalSettingsBaseSchema.extend({
|
|
7756
|
+
hoverColor: z.literal("none"),
|
|
7757
|
+
hoverColorToken: z.never().optional()
|
|
7725
7758
|
}), buttonGlobalSettingsBaseSchema.extend({
|
|
7726
|
-
hoverColor: z
|
|
7759
|
+
hoverColor: z.literal("token"),
|
|
7727
7760
|
hoverColorToken: opaqueButtonColourTokenSchema
|
|
7728
7761
|
})]);
|
|
7729
|
-
const gradientDirectionSchema$1 = z
|
|
7762
|
+
const gradientDirectionSchema$1 = z.enum([
|
|
7730
7763
|
"to-r",
|
|
7731
7764
|
"to-l",
|
|
7732
7765
|
"to-t",
|
|
@@ -7736,14 +7769,14 @@ const gradientDirectionSchema$1 = z$1.enum([
|
|
|
7736
7769
|
"to-br",
|
|
7737
7770
|
"to-bl"
|
|
7738
7771
|
]);
|
|
7739
|
-
const buttonColourTreatmentSchema = z
|
|
7740
|
-
z
|
|
7741
|
-
type: z
|
|
7772
|
+
const buttonColourTreatmentSchema = z.discriminatedUnion("type", [
|
|
7773
|
+
z.strictObject({
|
|
7774
|
+
type: z.literal("solid"),
|
|
7742
7775
|
colorToken: opaqueButtonColourTokenSchema
|
|
7743
7776
|
}),
|
|
7744
|
-
z
|
|
7745
|
-
type: z
|
|
7746
|
-
stops: z
|
|
7777
|
+
z.strictObject({
|
|
7778
|
+
type: z.literal("gradient"),
|
|
7779
|
+
stops: z.array(opaqueButtonColourTokenSchema).min(2).transform((stops) => {
|
|
7747
7780
|
const [first, second, ...rest] = stops;
|
|
7748
7781
|
if (first === void 0 || second === void 0) throw new Error("Invariant: gradient stops passed the minimum length schema");
|
|
7749
7782
|
return [
|
|
@@ -7755,34 +7788,34 @@ const buttonColourTreatmentSchema = z$1.discriminatedUnion("type", [
|
|
|
7755
7788
|
direction: gradientDirectionSchema$1,
|
|
7756
7789
|
foregroundToken: opaqueButtonColourTokenSchema
|
|
7757
7790
|
}),
|
|
7758
|
-
z
|
|
7759
|
-
type: z
|
|
7760
|
-
role: z
|
|
7791
|
+
z.strictObject({
|
|
7792
|
+
type: z.literal("surface"),
|
|
7793
|
+
role: z.literal("link")
|
|
7761
7794
|
})
|
|
7762
7795
|
]);
|
|
7763
7796
|
const buttonBackgroundSchema = buttonColourTreatmentSchema;
|
|
7764
|
-
const buttonBorderSchema = z
|
|
7765
|
-
const buttonVariantAffordanceSchema = z
|
|
7766
|
-
const variantShadowSchema = z
|
|
7767
|
-
elevation: z
|
|
7797
|
+
const buttonBorderSchema = z.strictObject({ widthClass: z.string() });
|
|
7798
|
+
const buttonVariantAffordanceSchema = z.strictObject({ iconId: z.string().min(1) });
|
|
7799
|
+
const variantShadowSchema = z.strictObject({
|
|
7800
|
+
elevation: z.enum([
|
|
7768
7801
|
"none",
|
|
7769
7802
|
"low",
|
|
7770
7803
|
"medium",
|
|
7771
7804
|
"high"
|
|
7772
7805
|
]),
|
|
7773
|
-
softness: z
|
|
7806
|
+
softness: z.enum([
|
|
7774
7807
|
"crisp",
|
|
7775
7808
|
"soft",
|
|
7776
7809
|
"hard"
|
|
7777
7810
|
]).nullable(),
|
|
7778
|
-
position: z
|
|
7811
|
+
position: z.enum(["bottom", "bottom-right"]).default("bottom"),
|
|
7779
7812
|
colorToken: opaqueButtonColourTokenSchema.optional()
|
|
7780
7813
|
});
|
|
7781
|
-
const variantEffectsSchema = z
|
|
7782
|
-
base: z
|
|
7783
|
-
hover: z
|
|
7784
|
-
active: z
|
|
7785
|
-
focus: z
|
|
7814
|
+
const variantEffectsSchema = z.strictObject({
|
|
7815
|
+
base: z.array(buttonEffectApplicationSchema).optional(),
|
|
7816
|
+
hover: z.array(buttonEffectApplicationSchema).optional(),
|
|
7817
|
+
active: z.array(buttonEffectApplicationSchema).optional(),
|
|
7818
|
+
focus: z.array(buttonEffectApplicationSchema).optional()
|
|
7786
7819
|
});
|
|
7787
7820
|
/**
|
|
7788
7821
|
* Per-variant size overrides schema — every entry is optional.
|
|
@@ -7791,7 +7824,7 @@ const variantEffectsSchema = z$1.strictObject({
|
|
|
7791
7824
|
* for that size on this variant. Missing sizes fall through to theme.sizes,
|
|
7792
7825
|
* then system defaults.
|
|
7793
7826
|
*/
|
|
7794
|
-
const variantSizeOverridesSchema = z
|
|
7827
|
+
const variantSizeOverridesSchema = z.object({
|
|
7795
7828
|
sm: buttonSizeConfigSchema.optional(),
|
|
7796
7829
|
md: buttonSizeConfigSchema.optional(),
|
|
7797
7830
|
lg: buttonSizeConfigSchema.optional(),
|
|
@@ -7803,14 +7836,14 @@ const variantSizeOverridesSchema = z$1.object({
|
|
|
7803
7836
|
* default (e.g. link-style variants declaring zero horizontal padding at
|
|
7804
7837
|
* every size).
|
|
7805
7838
|
*/
|
|
7806
|
-
const buttonVariantSchema = z
|
|
7839
|
+
const buttonVariantSchema = z.strictObject({
|
|
7807
7840
|
id: buttonVariantIdSchema,
|
|
7808
|
-
name: z
|
|
7809
|
-
enabled: z
|
|
7841
|
+
name: z.string().min(1).max(20),
|
|
7842
|
+
enabled: z.boolean(),
|
|
7810
7843
|
priority: prioritySchema,
|
|
7811
7844
|
background: buttonBackgroundSchema,
|
|
7812
7845
|
/** Tailwind radius token (e.g. `'rounded-md'`). Omit to inherit from `global.cornerStyle`. */
|
|
7813
|
-
borderRadius: z
|
|
7846
|
+
borderRadius: z.string().optional(),
|
|
7814
7847
|
shadow: variantShadowSchema.optional(),
|
|
7815
7848
|
border: buttonBorderSchema.optional(),
|
|
7816
7849
|
hoverBackgroundToken: opaqueButtonColourTokenSchema.optional(),
|
|
@@ -7818,10 +7851,11 @@ const buttonVariantSchema = z$1.strictObject({
|
|
|
7818
7851
|
sizes: variantSizeOverridesSchema.optional(),
|
|
7819
7852
|
affordance: buttonVariantAffordanceSchema.optional()
|
|
7820
7853
|
});
|
|
7821
|
-
const buttonSystemSchema = z
|
|
7854
|
+
const buttonSystemSchema = z.strictObject({
|
|
7822
7855
|
global: buttonGlobalSettingsSchema,
|
|
7823
|
-
variants: z
|
|
7824
|
-
sizes: buttonSizesSchema.optional()
|
|
7856
|
+
variants: z.array(buttonVariantSchema).min(1).max(6),
|
|
7857
|
+
sizes: buttonSizesSchema.optional(),
|
|
7858
|
+
surfacePolicy: buttonSurfacePolicySchema.optional()
|
|
7825
7859
|
}).superRefine((system, ctx) => {
|
|
7826
7860
|
const seen = /* @__PURE__ */ new Set();
|
|
7827
7861
|
system.variants.forEach((variant, index) => {
|
|
@@ -7839,47 +7873,49 @@ const buttonSystemSchema = z$1.strictObject({
|
|
|
7839
7873
|
});
|
|
7840
7874
|
//#endregion
|
|
7841
7875
|
//#region ../theme-core/src/lib/media.ts
|
|
7842
|
-
const hotspotSchema
|
|
7876
|
+
const hotspotSchema = z.object({
|
|
7843
7877
|
x: z.number().min(0).max(1),
|
|
7844
7878
|
y: z.number().min(0).max(1),
|
|
7845
7879
|
radius: z.number().optional()
|
|
7846
7880
|
});
|
|
7847
|
-
const rotationSchema
|
|
7881
|
+
const rotationSchema = z.union([
|
|
7848
7882
|
z.literal(0),
|
|
7849
7883
|
z.literal(90),
|
|
7850
7884
|
z.literal(180),
|
|
7851
7885
|
z.literal(270)
|
|
7852
7886
|
]);
|
|
7853
|
-
const rectSchema
|
|
7887
|
+
const rectSchema = z.tuple([
|
|
7854
7888
|
z.number(),
|
|
7855
7889
|
z.number(),
|
|
7856
7890
|
z.number(),
|
|
7857
7891
|
z.number()
|
|
7858
7892
|
]);
|
|
7859
|
-
const aspectCropSchema
|
|
7893
|
+
const aspectCropSchema = z.object({
|
|
7860
7894
|
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
|
|
7895
|
+
rect: z.preprocess((value) => value == null ? void 0 : value, rectSchema.optional()),
|
|
7896
|
+
hotspot: z.preprocess((value) => value == null ? void 0 : value, hotspotSchema.optional()),
|
|
7897
|
+
rotation: z.preprocess((value) => value == null ? void 0 : value, rotationSchema.optional())
|
|
7864
7898
|
});
|
|
7865
|
-
const transformSchema
|
|
7899
|
+
const transformSchema = z.object({
|
|
7866
7900
|
aspectCrops: z.preprocess((value) => {
|
|
7867
7901
|
if (!value || typeof value !== "object" || Array.isArray(value)) return;
|
|
7868
7902
|
return value;
|
|
7869
|
-
}, z.record(z.string(), aspectCropSchema
|
|
7870
|
-
rect: rectSchema
|
|
7871
|
-
hotspot: hotspotSchema
|
|
7872
|
-
rotation: rotationSchema
|
|
7903
|
+
}, z.record(z.string(), aspectCropSchema.catch({}))).optional(),
|
|
7904
|
+
rect: rectSchema.optional(),
|
|
7905
|
+
hotspot: hotspotSchema.optional(),
|
|
7906
|
+
rotation: rotationSchema.optional()
|
|
7873
7907
|
});
|
|
7874
|
-
const
|
|
7875
|
-
|
|
7876
|
-
|
|
7877
|
-
|
|
7878
|
-
|
|
7879
|
-
|
|
7880
|
-
|
|
7881
|
-
|
|
7882
|
-
|
|
7908
|
+
const mediaPosterSchema = z.discriminatedUnion("tag", [z.object({
|
|
7909
|
+
tag: z.literal("storage"),
|
|
7910
|
+
assetId: z.string().optional(),
|
|
7911
|
+
storageBucket: z.string().min(1),
|
|
7912
|
+
storagePath: z.string().min(1)
|
|
7913
|
+
}), z.object({
|
|
7914
|
+
tag: z.literal("external-src"),
|
|
7915
|
+
assetId: z.string().optional(),
|
|
7916
|
+
src: z.string().url()
|
|
7917
|
+
})]);
|
|
7918
|
+
const mediaBaseSchema = z.object({
|
|
7883
7919
|
purpose: z.string().optional(),
|
|
7884
7920
|
placeholder: z.boolean().default(true).optional(),
|
|
7885
7921
|
assetId: z.string().optional(),
|
|
@@ -7892,8 +7928,33 @@ const mediaSchema$1 = z.object({
|
|
|
7892
7928
|
height: z.number().optional(),
|
|
7893
7929
|
storageBucket: z.string().optional(),
|
|
7894
7930
|
storagePath: z.string().optional(),
|
|
7895
|
-
|
|
7931
|
+
poster: mediaPosterSchema.optional(),
|
|
7932
|
+
transform: transformSchema.optional()
|
|
7896
7933
|
});
|
|
7934
|
+
const mediaIdentifierSchema = z.string().trim().min(1).brand();
|
|
7935
|
+
const imageMediaSchema = mediaBaseSchema.extend({ type: z.literal("image") });
|
|
7936
|
+
const videoMediaSchema = mediaBaseSchema.extend({ type: z.literal("video") });
|
|
7937
|
+
const audioMediaSchema = mediaBaseSchema.extend({ type: z.literal("audio") });
|
|
7938
|
+
const documentMediaSchema = mediaBaseSchema.extend({ type: z.literal("document") });
|
|
7939
|
+
const spreadsheetMediaSchema = mediaBaseSchema.extend({ type: z.literal("spreadsheet") });
|
|
7940
|
+
const archiveMediaSchema = mediaBaseSchema.extend({ type: z.literal("archive") });
|
|
7941
|
+
const mediaSchema = z.discriminatedUnion("type", [
|
|
7942
|
+
imageMediaSchema,
|
|
7943
|
+
videoMediaSchema,
|
|
7944
|
+
audioMediaSchema,
|
|
7945
|
+
documentMediaSchema,
|
|
7946
|
+
spreadsheetMediaSchema,
|
|
7947
|
+
archiveMediaSchema
|
|
7948
|
+
]);
|
|
7949
|
+
const persistableMediaBaseSchema = mediaBaseSchema.extend({ identifier: mediaIdentifierSchema });
|
|
7950
|
+
z.discriminatedUnion("type", [
|
|
7951
|
+
persistableMediaBaseSchema.extend({ type: z.literal("image") }),
|
|
7952
|
+
persistableMediaBaseSchema.extend({ type: z.literal("video") }),
|
|
7953
|
+
persistableMediaBaseSchema.extend({ type: z.literal("audio") }),
|
|
7954
|
+
persistableMediaBaseSchema.extend({ type: z.literal("document") }),
|
|
7955
|
+
persistableMediaBaseSchema.extend({ type: z.literal("spreadsheet") }),
|
|
7956
|
+
persistableMediaBaseSchema.extend({ type: z.literal("archive") })
|
|
7957
|
+
]);
|
|
7897
7958
|
//#endregion
|
|
7898
7959
|
//#region ../theme-core/src/palette/colors.ts
|
|
7899
7960
|
const HEX_COLOR_REGEX = /^#[0-9a-f]{6}$/;
|
|
@@ -7913,11 +7974,11 @@ const THEME_PALETTE_COLOR_ORDER = [
|
|
|
7913
7974
|
"primaryForeground",
|
|
7914
7975
|
"border"
|
|
7915
7976
|
];
|
|
7916
|
-
const hexColorSchema = z
|
|
7917
|
-
const paletteModeSchema = z
|
|
7977
|
+
const hexColorSchema = z.string().regex(HEX_COLOR_REGEX, "Hex must be #RRGGBB (lowercase)").transform((value) => value);
|
|
7978
|
+
const paletteModeSchema = z.enum(["light", "dark"]);
|
|
7918
7979
|
const PALETTE_VALUE_KEY_PREFIX = "palette-value:v1|";
|
|
7919
|
-
z
|
|
7920
|
-
const paletteColorsSchema = z
|
|
7980
|
+
z.string().regex(/^[0-9a-f]{64}$/, "Palette hash must be a lowercase SHA-256 value").transform((value) => value);
|
|
7981
|
+
const paletteColorsSchema = z.object({
|
|
7921
7982
|
primary: hexColorSchema,
|
|
7922
7983
|
primaryForeground: hexColorSchema,
|
|
7923
7984
|
secondary: hexColorSchema,
|
|
@@ -8023,25 +8084,25 @@ function parsePaletteValueKey(value) {
|
|
|
8023
8084
|
if (!colors.ok || paletteValueKey(colors.colors, mode.data) !== value) return null;
|
|
8024
8085
|
return value;
|
|
8025
8086
|
}
|
|
8026
|
-
z
|
|
8087
|
+
z.string().transform((value, ctx) => {
|
|
8027
8088
|
const parsed = parsePaletteValueKey(value);
|
|
8028
8089
|
if (parsed) return parsed;
|
|
8029
8090
|
ctx.addIssue({
|
|
8030
8091
|
code: "custom",
|
|
8031
8092
|
message: "Invalid canonical palette value key"
|
|
8032
8093
|
});
|
|
8033
|
-
return z
|
|
8094
|
+
return z.NEVER;
|
|
8034
8095
|
});
|
|
8035
8096
|
//#endregion
|
|
8036
8097
|
//#region ../theme-core/src/palette/schema.ts
|
|
8037
|
-
const colourHexString = z
|
|
8038
|
-
const paletteColorSchema = z
|
|
8039
|
-
name: z
|
|
8098
|
+
const colourHexString = z.string().regex(/^#([0-9A-Fa-f]{3}){1,2}$/);
|
|
8099
|
+
const paletteColorSchema = z.object({
|
|
8100
|
+
name: z.string().min(1),
|
|
8040
8101
|
hex: colourHexString
|
|
8041
8102
|
});
|
|
8042
|
-
const paletteMetaSchema = z
|
|
8043
|
-
const paletteSchema = z
|
|
8044
|
-
colors: z
|
|
8103
|
+
const paletteMetaSchema = z.object({ mode: z.enum(["light", "dark"]) });
|
|
8104
|
+
const paletteSchema = z.object({
|
|
8105
|
+
colors: z.array(paletteColorSchema),
|
|
8045
8106
|
meta: paletteMetaSchema
|
|
8046
8107
|
}).transform((palette, ctx) => {
|
|
8047
8108
|
const colors = paletteColorsFromEntries(palette.colors);
|
|
@@ -8050,7 +8111,7 @@ const paletteSchema = z$1.object({
|
|
|
8050
8111
|
code: "custom",
|
|
8051
8112
|
message: `Invalid complete palette: ${colors.error.kind}`
|
|
8052
8113
|
});
|
|
8053
|
-
return z
|
|
8114
|
+
return z.NEVER;
|
|
8054
8115
|
}
|
|
8055
8116
|
return {
|
|
8056
8117
|
colors: paletteColorEntries(colors.colors).map(({ name, hex }) => ({
|
|
@@ -8064,7 +8125,7 @@ const paletteSchema = z$1.object({
|
|
|
8064
8125
|
//#region ../theme-core/src/cards/types.ts
|
|
8065
8126
|
const cardVariantRoleValues = ["default", "alternative"];
|
|
8066
8127
|
const boxlessCardVariantValue = "none";
|
|
8067
|
-
const cardSpacingSchema = z
|
|
8128
|
+
const cardSpacingSchema = z.enum([
|
|
8068
8129
|
"none",
|
|
8069
8130
|
"compact",
|
|
8070
8131
|
"cozy",
|
|
@@ -8072,7 +8133,7 @@ const cardSpacingSchema = z$1.enum([
|
|
|
8072
8133
|
"comfortable",
|
|
8073
8134
|
"spacious"
|
|
8074
8135
|
]);
|
|
8075
|
-
const gradientDirectionSchema = z
|
|
8136
|
+
const gradientDirectionSchema = z.enum([
|
|
8076
8137
|
"to-r",
|
|
8077
8138
|
"to-l",
|
|
8078
8139
|
"to-t",
|
|
@@ -8082,27 +8143,27 @@ const gradientDirectionSchema = z$1.enum([
|
|
|
8082
8143
|
"to-br",
|
|
8083
8144
|
"to-bl"
|
|
8084
8145
|
]);
|
|
8085
|
-
z
|
|
8086
|
-
const boxStylesCardVariantSchema = z
|
|
8087
|
-
const cardBackgroundSchema = z
|
|
8088
|
-
z
|
|
8089
|
-
type: z
|
|
8146
|
+
z.enum(cardVariantRoleValues);
|
|
8147
|
+
const boxStylesCardVariantSchema = z.enum([...cardVariantRoleValues, boxlessCardVariantValue]);
|
|
8148
|
+
const cardBackgroundSchema = z.discriminatedUnion("type", [
|
|
8149
|
+
z.object({
|
|
8150
|
+
type: z.literal("solid"),
|
|
8090
8151
|
colorToken: themeColorTokenSchema
|
|
8091
8152
|
}),
|
|
8092
|
-
z
|
|
8093
|
-
type: z
|
|
8153
|
+
z.object({
|
|
8154
|
+
type: z.literal("gradient"),
|
|
8094
8155
|
fromToken: themeColorTokenSchema,
|
|
8095
8156
|
toToken: themeColorTokenSchema,
|
|
8096
8157
|
direction: gradientDirectionSchema
|
|
8097
8158
|
}),
|
|
8098
|
-
z
|
|
8159
|
+
z.object({ type: z.literal("transparent") })
|
|
8099
8160
|
]);
|
|
8100
|
-
const cardBorderSchema = z
|
|
8101
|
-
widthClass: z
|
|
8161
|
+
const cardBorderSchema = z.object({
|
|
8162
|
+
widthClass: z.string(),
|
|
8102
8163
|
colorToken: themeColorTokenSchema
|
|
8103
8164
|
});
|
|
8104
8165
|
/** Per-corner radius value. `expressive` is a large block-radius multiple. */
|
|
8105
|
-
const cardCornerValueSchema = z
|
|
8166
|
+
const cardCornerValueSchema = z.enum([
|
|
8106
8167
|
"square",
|
|
8107
8168
|
"soft",
|
|
8108
8169
|
"rounded",
|
|
@@ -8113,54 +8174,54 @@ const cardCornerValueSchema = z$1.enum([
|
|
|
8113
8174
|
* A single accented card edge (e.g. a left accent bar). When set, it replaces
|
|
8114
8175
|
* the full `border` so the card reads as edge-accented rather than outlined.
|
|
8115
8176
|
*/
|
|
8116
|
-
const cardAccentEdgeSchema = z
|
|
8117
|
-
edge: z
|
|
8177
|
+
const cardAccentEdgeSchema = z.object({
|
|
8178
|
+
edge: z.enum([
|
|
8118
8179
|
"left",
|
|
8119
8180
|
"top",
|
|
8120
8181
|
"right",
|
|
8121
8182
|
"bottom"
|
|
8122
8183
|
]),
|
|
8123
8184
|
colorToken: themeColorTokenSchema,
|
|
8124
|
-
width: z
|
|
8185
|
+
width: z.enum([
|
|
8125
8186
|
"thin",
|
|
8126
8187
|
"medium",
|
|
8127
8188
|
"thick",
|
|
8128
8189
|
"heavy"
|
|
8129
8190
|
])
|
|
8130
8191
|
});
|
|
8131
|
-
const cardCornerRadiiSchema = z
|
|
8192
|
+
const cardCornerRadiiSchema = z.object({
|
|
8132
8193
|
topLeft: cardCornerValueSchema.optional(),
|
|
8133
8194
|
topRight: cardCornerValueSchema.optional(),
|
|
8134
8195
|
bottomLeft: cardCornerValueSchema.optional(),
|
|
8135
8196
|
bottomRight: cardCornerValueSchema.optional()
|
|
8136
8197
|
});
|
|
8137
|
-
const cardVariantSchema = z
|
|
8138
|
-
id: z
|
|
8139
|
-
name: z
|
|
8140
|
-
enabled: z
|
|
8141
|
-
priority: z
|
|
8142
|
-
z
|
|
8143
|
-
z
|
|
8144
|
-
z
|
|
8198
|
+
const cardVariantSchema = z.object({
|
|
8199
|
+
id: z.string(),
|
|
8200
|
+
name: z.string().min(1).max(20),
|
|
8201
|
+
enabled: z.boolean(),
|
|
8202
|
+
priority: z.union([
|
|
8203
|
+
z.literal(1),
|
|
8204
|
+
z.literal(2),
|
|
8205
|
+
z.literal(3)
|
|
8145
8206
|
]),
|
|
8146
8207
|
background: cardBackgroundSchema,
|
|
8147
8208
|
spacing: cardSpacingSchema,
|
|
8148
8209
|
foregroundToken: themeColorTokenSchema.optional(),
|
|
8149
|
-
shadow: z
|
|
8150
|
-
elevation: z
|
|
8210
|
+
shadow: z.object({
|
|
8211
|
+
elevation: z.enum([
|
|
8151
8212
|
"none",
|
|
8152
8213
|
"low",
|
|
8153
8214
|
"medium",
|
|
8154
8215
|
"high"
|
|
8155
8216
|
]),
|
|
8156
|
-
softness: z
|
|
8217
|
+
softness: z.enum([
|
|
8157
8218
|
"crisp",
|
|
8158
8219
|
"soft",
|
|
8159
8220
|
"hard"
|
|
8160
8221
|
]).nullable(),
|
|
8161
|
-
position: z
|
|
8222
|
+
position: z.enum(["bottom", "bottom-right"]).default("bottom")
|
|
8162
8223
|
}).optional(),
|
|
8163
|
-
corners: z
|
|
8224
|
+
corners: z.enum([
|
|
8164
8225
|
"square",
|
|
8165
8226
|
"soft",
|
|
8166
8227
|
"rounded",
|
|
@@ -8170,13 +8231,13 @@ const cardVariantSchema = z$1.object({
|
|
|
8170
8231
|
border: cardBorderSchema.optional(),
|
|
8171
8232
|
accentEdge: cardAccentEdgeSchema.optional()
|
|
8172
8233
|
});
|
|
8173
|
-
const cardSystemSchema = z
|
|
8234
|
+
const cardSystemSchema = z.object({ variants: z.array(cardVariantSchema).min(1).max(3) });
|
|
8174
8235
|
//#endregion
|
|
8175
8236
|
//#region ../theme-core/src/accordions/types.ts
|
|
8176
8237
|
/**
|
|
8177
8238
|
* Accordion icon styles for expand/collapse indicators
|
|
8178
8239
|
*/
|
|
8179
|
-
const accordionIconSchema = z
|
|
8240
|
+
const accordionIconSchema = z.enum([
|
|
8180
8241
|
"plus-minus",
|
|
8181
8242
|
"chevron",
|
|
8182
8243
|
"caret",
|
|
@@ -8187,12 +8248,12 @@ const accordionIconSchema = z$1.enum([
|
|
|
8187
8248
|
* Accordion configuration for a theme
|
|
8188
8249
|
* Single style per theme (no variants needed)
|
|
8189
8250
|
*/
|
|
8190
|
-
const accordionSystemSchema = z
|
|
8191
|
-
background: z
|
|
8192
|
-
type: z
|
|
8251
|
+
const accordionSystemSchema = z.object({
|
|
8252
|
+
background: z.object({
|
|
8253
|
+
type: z.literal("solid"),
|
|
8193
8254
|
colorToken: themeColorTokenSchema
|
|
8194
8255
|
}).nullable(),
|
|
8195
|
-
spacing: z
|
|
8256
|
+
spacing: z.enum([
|
|
8196
8257
|
"none",
|
|
8197
8258
|
"compact",
|
|
8198
8259
|
"cozy",
|
|
@@ -8200,84 +8261,84 @@ const accordionSystemSchema = z$1.object({
|
|
|
8200
8261
|
"comfortable",
|
|
8201
8262
|
"spacious"
|
|
8202
8263
|
]),
|
|
8203
|
-
corners: z
|
|
8264
|
+
corners: z.enum([
|
|
8204
8265
|
"square",
|
|
8205
8266
|
"soft",
|
|
8206
8267
|
"rounded",
|
|
8207
8268
|
"pill"
|
|
8208
8269
|
]).nullable(),
|
|
8209
|
-
border: z
|
|
8210
|
-
widthClass: z
|
|
8270
|
+
border: z.object({
|
|
8271
|
+
widthClass: z.string(),
|
|
8211
8272
|
colorToken: themeColorTokenSchema
|
|
8212
8273
|
}).nullable(),
|
|
8213
|
-
shadow: z
|
|
8214
|
-
elevation: z
|
|
8274
|
+
shadow: z.object({
|
|
8275
|
+
elevation: z.enum([
|
|
8215
8276
|
"none",
|
|
8216
8277
|
"low",
|
|
8217
8278
|
"medium",
|
|
8218
8279
|
"high"
|
|
8219
8280
|
]),
|
|
8220
|
-
softness: z
|
|
8281
|
+
softness: z.enum([
|
|
8221
8282
|
"soft",
|
|
8222
8283
|
"crisp",
|
|
8223
8284
|
"hard"
|
|
8224
8285
|
]).nullable(),
|
|
8225
|
-
position: z
|
|
8286
|
+
position: z.enum(["bottom", "bottom-right"])
|
|
8226
8287
|
}).nullable(),
|
|
8227
|
-
icon: z
|
|
8288
|
+
icon: z.object({
|
|
8228
8289
|
style: accordionIconSchema,
|
|
8229
|
-
position: z
|
|
8230
|
-
size: z
|
|
8290
|
+
position: z.enum(["left", "right"]),
|
|
8291
|
+
size: z.enum([
|
|
8231
8292
|
"sm",
|
|
8232
8293
|
"md",
|
|
8233
8294
|
"lg"
|
|
8234
8295
|
]),
|
|
8235
8296
|
colorToken: themeColorTokenSchema.optional()
|
|
8236
8297
|
}),
|
|
8237
|
-
trigger: z
|
|
8298
|
+
trigger: z.object({
|
|
8238
8299
|
textColorToken: themeColorTokenSchema,
|
|
8239
|
-
fontWeight: z
|
|
8300
|
+
fontWeight: z.enum([
|
|
8240
8301
|
"regular",
|
|
8241
8302
|
"medium",
|
|
8242
8303
|
"semibold",
|
|
8243
8304
|
"bold"
|
|
8244
8305
|
]).nullable(),
|
|
8245
|
-
fontFamily: z
|
|
8246
|
-
fontScale: z
|
|
8306
|
+
fontFamily: z.enum(["body", "heading"]).optional(),
|
|
8307
|
+
fontScale: z.enum([
|
|
8247
8308
|
"body",
|
|
8248
8309
|
"md",
|
|
8249
8310
|
"lg"
|
|
8250
8311
|
]).optional(),
|
|
8251
|
-
letterSpacing: z
|
|
8312
|
+
letterSpacing: z.enum([
|
|
8252
8313
|
"normal",
|
|
8253
8314
|
"tight",
|
|
8254
8315
|
"wide"
|
|
8255
8316
|
]).optional(),
|
|
8256
|
-
textTransform: z
|
|
8317
|
+
textTransform: z.enum(["none", "uppercase"]).optional()
|
|
8257
8318
|
}),
|
|
8258
|
-
hover: z
|
|
8319
|
+
hover: z.object({
|
|
8259
8320
|
backgroundColorToken: themeColorTokenSchema.optional(),
|
|
8260
8321
|
textColorToken: themeColorTokenSchema.optional(),
|
|
8261
8322
|
borderColorToken: themeColorTokenSchema.optional()
|
|
8262
8323
|
}),
|
|
8263
|
-
openState: z
|
|
8324
|
+
openState: z.object({
|
|
8264
8325
|
backgroundColorToken: themeColorTokenSchema.optional(),
|
|
8265
8326
|
triggerColorToken: themeColorTokenSchema.optional(),
|
|
8266
|
-
accent: z
|
|
8267
|
-
edge: z
|
|
8327
|
+
accent: z.object({
|
|
8328
|
+
edge: z.enum([
|
|
8268
8329
|
"left",
|
|
8269
8330
|
"top",
|
|
8270
8331
|
"bottom"
|
|
8271
8332
|
]),
|
|
8272
8333
|
colorToken: themeColorTokenSchema,
|
|
8273
|
-
thickness: z
|
|
8334
|
+
thickness: z.enum([
|
|
8274
8335
|
"thin",
|
|
8275
8336
|
"medium",
|
|
8276
8337
|
"thick"
|
|
8277
8338
|
])
|
|
8278
8339
|
}).optional()
|
|
8279
8340
|
}).optional(),
|
|
8280
|
-
content: z
|
|
8341
|
+
content: z.object({ textColorToken: themeColorTokenSchema })
|
|
8281
8342
|
});
|
|
8282
8343
|
//#endregion
|
|
8283
8344
|
//#region ../theme-core/src/inputs/types.ts
|
|
@@ -8291,80 +8352,80 @@ const accordionSystemSchema = z$1.object({
|
|
|
8291
8352
|
*
|
|
8292
8353
|
* Single configuration per theme (no variants needed for inputs)
|
|
8293
8354
|
*/
|
|
8294
|
-
const inputSystemSchema = z
|
|
8295
|
-
base: z
|
|
8296
|
-
background: z
|
|
8297
|
-
type: z
|
|
8355
|
+
const inputSystemSchema = z.object({
|
|
8356
|
+
base: z.object({
|
|
8357
|
+
background: z.union([z.object({
|
|
8358
|
+
type: z.literal("solid"),
|
|
8298
8359
|
colorToken: themeColorTokenSchema
|
|
8299
|
-
}), z
|
|
8360
|
+
}), z.object({ type: z.literal("transparent") })]),
|
|
8300
8361
|
textColorToken: themeColorTokenSchema,
|
|
8301
|
-
border: z
|
|
8302
|
-
widthClass: z
|
|
8362
|
+
border: z.object({
|
|
8363
|
+
widthClass: z.string(),
|
|
8303
8364
|
colorToken: themeColorTokenSchema,
|
|
8304
|
-
style: z
|
|
8365
|
+
style: z.enum(["all", "underline"]).optional()
|
|
8305
8366
|
}),
|
|
8306
|
-
corners: z
|
|
8367
|
+
corners: z.enum([
|
|
8307
8368
|
"square",
|
|
8308
8369
|
"soft",
|
|
8309
8370
|
"rounded",
|
|
8310
8371
|
"pill"
|
|
8311
8372
|
]).nullable(),
|
|
8312
|
-
shadow: z
|
|
8313
|
-
elevation: z
|
|
8373
|
+
shadow: z.object({
|
|
8374
|
+
elevation: z.enum([
|
|
8314
8375
|
"none",
|
|
8315
8376
|
"low",
|
|
8316
8377
|
"medium"
|
|
8317
8378
|
]),
|
|
8318
|
-
softness: z
|
|
8379
|
+
softness: z.enum([
|
|
8319
8380
|
"soft",
|
|
8320
8381
|
"crisp",
|
|
8321
8382
|
"hard"
|
|
8322
8383
|
]).nullable()
|
|
8323
8384
|
}).nullable(),
|
|
8324
|
-
spacing: z
|
|
8385
|
+
spacing: z.enum([
|
|
8325
8386
|
"compact",
|
|
8326
8387
|
"cozy",
|
|
8327
8388
|
"medium",
|
|
8328
8389
|
"comfortable"
|
|
8329
8390
|
]),
|
|
8330
|
-
fontSize: z
|
|
8391
|
+
fontSize: z.enum([
|
|
8331
8392
|
"sm",
|
|
8332
8393
|
"base",
|
|
8333
8394
|
"lg"
|
|
8334
8395
|
])
|
|
8335
8396
|
}),
|
|
8336
|
-
label: z
|
|
8397
|
+
label: z.object({
|
|
8337
8398
|
textColorToken: themeColorTokenSchema,
|
|
8338
|
-
fontWeight: z
|
|
8399
|
+
fontWeight: z.enum([
|
|
8339
8400
|
"regular",
|
|
8340
8401
|
"medium",
|
|
8341
8402
|
"semibold",
|
|
8342
8403
|
"bold",
|
|
8343
8404
|
"black"
|
|
8344
8405
|
]),
|
|
8345
|
-
fontSize: z
|
|
8406
|
+
fontSize: z.enum([
|
|
8346
8407
|
"2xs",
|
|
8347
8408
|
"xs",
|
|
8348
8409
|
"sm",
|
|
8349
8410
|
"base"
|
|
8350
8411
|
]),
|
|
8351
|
-
textTransform: z
|
|
8412
|
+
textTransform: z.enum([
|
|
8352
8413
|
"none",
|
|
8353
8414
|
"uppercase",
|
|
8354
8415
|
"lowercase",
|
|
8355
8416
|
"capitalize"
|
|
8356
8417
|
]).optional(),
|
|
8357
|
-
letterSpacing: z
|
|
8418
|
+
letterSpacing: z.enum([
|
|
8358
8419
|
"normal",
|
|
8359
8420
|
"wide",
|
|
8360
8421
|
"wider",
|
|
8361
8422
|
"widest"
|
|
8362
8423
|
]).optional(),
|
|
8363
|
-
opacity: z
|
|
8424
|
+
opacity: z.number().min(.2).max(1).optional()
|
|
8364
8425
|
}),
|
|
8365
|
-
focus: z
|
|
8426
|
+
focus: z.object({
|
|
8366
8427
|
ringColorToken: themeColorTokenSchema,
|
|
8367
|
-
ringWidth: z
|
|
8428
|
+
ringWidth: z.enum([
|
|
8368
8429
|
"0",
|
|
8369
8430
|
"1",
|
|
8370
8431
|
"2",
|
|
@@ -8372,14 +8433,14 @@ const inputSystemSchema = z$1.object({
|
|
|
8372
8433
|
]),
|
|
8373
8434
|
borderColorToken: themeColorTokenSchema.optional()
|
|
8374
8435
|
}),
|
|
8375
|
-
error: z
|
|
8436
|
+
error: z.object({
|
|
8376
8437
|
borderColorToken: themeColorTokenSchema,
|
|
8377
8438
|
textColorToken: themeColorTokenSchema
|
|
8378
8439
|
}),
|
|
8379
|
-
disabled: z
|
|
8440
|
+
disabled: z.object({
|
|
8380
8441
|
backgroundColorToken: themeColorTokenSchema,
|
|
8381
8442
|
textColorToken: themeColorTokenSchema,
|
|
8382
|
-
opacity: z
|
|
8443
|
+
opacity: z.number().min(.3).max(.7)
|
|
8383
8444
|
})
|
|
8384
8445
|
});
|
|
8385
8446
|
//#endregion
|
|
@@ -8390,9 +8451,9 @@ const inputSystemSchema = z$1.object({
|
|
|
8390
8451
|
/**
|
|
8391
8452
|
* Gradient color stop
|
|
8392
8453
|
*/
|
|
8393
|
-
const gradientStopSchema = z
|
|
8454
|
+
const gradientStopSchema = z.object({
|
|
8394
8455
|
color: themeColorTokenSchema,
|
|
8395
|
-
position: z
|
|
8456
|
+
position: z.number().min(0).max(100)
|
|
8396
8457
|
});
|
|
8397
8458
|
/**
|
|
8398
8459
|
* Radial gradient shape. Optional; defaults to `circle` (the historical shape)
|
|
@@ -8401,7 +8462,7 @@ const gradientStopSchema = z$1.object({
|
|
|
8401
8462
|
* Named `RadialGradientShape` to avoid clashing with `styles/gradients.ts`'s
|
|
8402
8463
|
* `GradientShape` (which names the gradient *kind*: linear/radial/conic).
|
|
8403
8464
|
*/
|
|
8404
|
-
const radialGradientShapeSchema = z
|
|
8465
|
+
const radialGradientShapeSchema = z.enum(["circle", "ellipse"]);
|
|
8405
8466
|
/**
|
|
8406
8467
|
* Gradient configuration.
|
|
8407
8468
|
*
|
|
@@ -8412,16 +8473,16 @@ const radialGradientShapeSchema = z$1.enum(["circle", "ellipse"]);
|
|
|
8412
8473
|
* - radial: optional `shape` (circle/ellipse) + `position`
|
|
8413
8474
|
* - conic: optional `angle` (from-angle, degrees) + `position`
|
|
8414
8475
|
*/
|
|
8415
|
-
const gradientConfigSchema = z
|
|
8416
|
-
type: z
|
|
8476
|
+
const gradientConfigSchema = z.object({
|
|
8477
|
+
type: z.enum([
|
|
8417
8478
|
"linear",
|
|
8418
8479
|
"radial",
|
|
8419
8480
|
"conic"
|
|
8420
8481
|
]).default("linear"),
|
|
8421
|
-
angle: z
|
|
8482
|
+
angle: z.number().min(0).max(360).optional(),
|
|
8422
8483
|
shape: radialGradientShapeSchema.optional(),
|
|
8423
|
-
position: z
|
|
8424
|
-
stops: z
|
|
8484
|
+
position: z.string().optional(),
|
|
8485
|
+
stops: z.array(gradientStopSchema).min(2)
|
|
8425
8486
|
});
|
|
8426
8487
|
//#endregion
|
|
8427
8488
|
//#region ../theme-core/src/interactive/baseSchema.ts
|
|
@@ -8433,46 +8494,46 @@ const gradientConfigSchema = z$1.object({
|
|
|
8433
8494
|
/**
|
|
8434
8495
|
* Typography settings shared by buttons and nav links
|
|
8435
8496
|
*/
|
|
8436
|
-
const interactiveTypographySchema = z
|
|
8497
|
+
const interactiveTypographySchema = z.object({
|
|
8437
8498
|
/** Font family source */
|
|
8438
|
-
typography: z
|
|
8499
|
+
typography: z.enum(["body", "heading"]).default("body"),
|
|
8439
8500
|
/** Font weight */
|
|
8440
|
-
fontWeight: z
|
|
8501
|
+
fontWeight: z.enum([
|
|
8441
8502
|
"regular",
|
|
8442
8503
|
"medium",
|
|
8443
8504
|
"semibold",
|
|
8444
8505
|
"bold"
|
|
8445
8506
|
]).default("medium"),
|
|
8446
8507
|
/** Text transform */
|
|
8447
|
-
textTransform: z
|
|
8508
|
+
textTransform: z.enum([
|
|
8448
8509
|
"none",
|
|
8449
8510
|
"uppercase",
|
|
8450
8511
|
"capitalize"
|
|
8451
8512
|
]).default("none"),
|
|
8452
8513
|
/** Italic style */
|
|
8453
|
-
italic: z
|
|
8514
|
+
italic: z.boolean().default(false)
|
|
8454
8515
|
});
|
|
8455
8516
|
/**
|
|
8456
8517
|
* Effect application reference (shared between buttons and nav)
|
|
8457
8518
|
*/
|
|
8458
|
-
const effectApplicationSchema = z
|
|
8519
|
+
const effectApplicationSchema = z.object({
|
|
8459
8520
|
/** Effect preset ID */
|
|
8460
|
-
effectId: z
|
|
8521
|
+
effectId: z.string(),
|
|
8461
8522
|
/** User-provided customization options */
|
|
8462
|
-
options: z
|
|
8523
|
+
options: z.record(z.string(), z.any()).optional()
|
|
8463
8524
|
});
|
|
8464
8525
|
/**
|
|
8465
8526
|
* Effect composition by state (shared pattern)
|
|
8466
8527
|
*/
|
|
8467
|
-
const effectCompositionSchema = z
|
|
8528
|
+
const effectCompositionSchema = z.object({
|
|
8468
8529
|
/** Effects always applied */
|
|
8469
|
-
base: z
|
|
8530
|
+
base: z.array(effectApplicationSchema).optional(),
|
|
8470
8531
|
/** Effects applied on hover */
|
|
8471
|
-
hover: z
|
|
8532
|
+
hover: z.array(effectApplicationSchema).optional(),
|
|
8472
8533
|
/** Effects applied on active/pressed */
|
|
8473
|
-
active: z
|
|
8534
|
+
active: z.array(effectApplicationSchema).optional(),
|
|
8474
8535
|
/** Effects applied on focus */
|
|
8475
|
-
focus: z
|
|
8536
|
+
focus: z.array(effectApplicationSchema).optional()
|
|
8476
8537
|
});
|
|
8477
8538
|
//#endregion
|
|
8478
8539
|
//#region ../theme-core/src/navigation/types.ts
|
|
@@ -8484,7 +8545,7 @@ const effectCompositionSchema = z$1.object({
|
|
|
8484
8545
|
/**
|
|
8485
8546
|
* Padding preset options for nav links
|
|
8486
8547
|
*/
|
|
8487
|
-
const navLinkPaddingSchema = z
|
|
8548
|
+
const navLinkPaddingSchema = z.enum([
|
|
8488
8549
|
"none",
|
|
8489
8550
|
"compact",
|
|
8490
8551
|
"default"
|
|
@@ -8493,7 +8554,7 @@ const navLinkPaddingSchema = z$1.enum([
|
|
|
8493
8554
|
* Horizontal padding override for nav links.
|
|
8494
8555
|
* When set, overrides only the horizontal component of the `padding` preset.
|
|
8495
8556
|
*/
|
|
8496
|
-
const navLinkPaddingXSchema = z
|
|
8557
|
+
const navLinkPaddingXSchema = z.enum([
|
|
8497
8558
|
"none",
|
|
8498
8559
|
"tight",
|
|
8499
8560
|
"compact",
|
|
@@ -8504,7 +8565,7 @@ const navLinkPaddingXSchema = z$1.enum([
|
|
|
8504
8565
|
/**
|
|
8505
8566
|
* Border radius options for nav links
|
|
8506
8567
|
*/
|
|
8507
|
-
const navLinkBorderRadiusSchema = z
|
|
8568
|
+
const navLinkBorderRadiusSchema = z.enum([
|
|
8508
8569
|
"none",
|
|
8509
8570
|
"sm",
|
|
8510
8571
|
"md",
|
|
@@ -8513,7 +8574,7 @@ const navLinkBorderRadiusSchema = z$1.enum([
|
|
|
8513
8574
|
/**
|
|
8514
8575
|
* Typography size options for nav links.
|
|
8515
8576
|
*/
|
|
8516
|
-
const navLinkTextSizeSchema = z
|
|
8577
|
+
const navLinkTextSizeSchema = z.enum([
|
|
8517
8578
|
"xs",
|
|
8518
8579
|
"sm",
|
|
8519
8580
|
"base",
|
|
@@ -8523,7 +8584,7 @@ const navLinkTextSizeSchema = z$1.enum([
|
|
|
8523
8584
|
/**
|
|
8524
8585
|
* Letter spacing options for nav links.
|
|
8525
8586
|
*/
|
|
8526
|
-
const navLinkLetterSpacingSchema = z
|
|
8587
|
+
const navLinkLetterSpacingSchema = z.enum([
|
|
8527
8588
|
"normal",
|
|
8528
8589
|
"wide",
|
|
8529
8590
|
"wider",
|
|
@@ -8532,15 +8593,15 @@ const navLinkLetterSpacingSchema = z$1.enum([
|
|
|
8532
8593
|
/**
|
|
8533
8594
|
* Optional legibility aid for nav text that floats over uncertain imagery or color.
|
|
8534
8595
|
*/
|
|
8535
|
-
const navLinkContrastTreatmentSchema = z
|
|
8596
|
+
const navLinkContrastTreatmentSchema = z.enum(["none", "soft-glow"]);
|
|
8536
8597
|
/**
|
|
8537
8598
|
* Nav link style schema
|
|
8538
8599
|
*
|
|
8539
8600
|
* Extends interactive typography base with nav-specific settings.
|
|
8540
8601
|
*/
|
|
8541
|
-
const navLinkStyleSchema = z
|
|
8602
|
+
const navLinkStyleSchema = z.object({
|
|
8542
8603
|
/** Display name for the style */
|
|
8543
|
-
name: z
|
|
8604
|
+
name: z.string().min(1).max(30).optional(),
|
|
8544
8605
|
/** Typography settings (inherited from interactive base) */
|
|
8545
8606
|
...interactiveTypographySchema.shape,
|
|
8546
8607
|
/** Text color token */
|
|
@@ -8625,7 +8686,7 @@ function containsForbiddenSelector(selector) {
|
|
|
8625
8686
|
/**
|
|
8626
8687
|
* Validates a CSS selector for safety.
|
|
8627
8688
|
*/
|
|
8628
|
-
const selectorSchema = z
|
|
8689
|
+
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
8690
|
/**
|
|
8630
8691
|
* Check if a CSS value contains a remote URL.
|
|
8631
8692
|
*/
|
|
@@ -8643,31 +8704,31 @@ function containsJavascriptUrl(value) {
|
|
|
8643
8704
|
* Allows: url(#id), url(data:...), url(/path), var(--)
|
|
8644
8705
|
* Forbids: url(http...), url(//...), javascript:
|
|
8645
8706
|
*/
|
|
8646
|
-
const declarationValueSchema = z
|
|
8707
|
+
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
8708
|
/**
|
|
8648
8709
|
* Schema for CSS declarations object (property -> value map).
|
|
8649
8710
|
*/
|
|
8650
|
-
const declarationsSchema = z
|
|
8711
|
+
const declarationsSchema = z.record(z.string().min(1).max(100), declarationValueSchema);
|
|
8651
8712
|
/**
|
|
8652
8713
|
* Schema for a single custom CSS rule.
|
|
8653
8714
|
*/
|
|
8654
|
-
const customCssRuleSchema = z
|
|
8655
|
-
id: z
|
|
8715
|
+
const customCssRuleSchema = z.object({
|
|
8716
|
+
id: z.string().min(1, "Rule ID is required").max(50, "Rule ID too long"),
|
|
8656
8717
|
selector: selectorSchema,
|
|
8657
8718
|
declarations: declarationsSchema
|
|
8658
8719
|
});
|
|
8659
8720
|
/**
|
|
8660
8721
|
* Schema for block-specific CSS rule.
|
|
8661
8722
|
*/
|
|
8662
|
-
const blockCustomCssRuleSchema = customCssRuleSchema.extend({ blockKind: z
|
|
8723
|
+
const blockCustomCssRuleSchema = customCssRuleSchema.extend({ blockKind: z.string().min(1, "Block kind is required").max(50, "Block kind too long") });
|
|
8663
8724
|
/**
|
|
8664
8725
|
* Array of custom CSS rules for theme-level styling.
|
|
8665
8726
|
*/
|
|
8666
|
-
const customCssRulesSchema = z
|
|
8727
|
+
const customCssRulesSchema = z.array(customCssRuleSchema).optional();
|
|
8667
8728
|
/**
|
|
8668
8729
|
* Array of block-specific CSS rules.
|
|
8669
8730
|
*/
|
|
8670
|
-
const blockCustomCssRulesSchema = z
|
|
8731
|
+
const blockCustomCssRulesSchema = z.array(blockCustomCssRuleSchema).optional();
|
|
8671
8732
|
//#endregion
|
|
8672
8733
|
//#region ../theme-core/src/customCss/atRuleValidation.ts
|
|
8673
8734
|
/**
|
|
@@ -8685,9 +8746,9 @@ const BLOCKED_AT_RULES = ["@import", "@charset"];
|
|
|
8685
8746
|
/** Pattern to detect blocked at-rules */
|
|
8686
8747
|
const BLOCKED_AT_RULE_PATTERN = /@(?:import|charset)\b/i;
|
|
8687
8748
|
/** Rule ID schema - reused from main validation */
|
|
8688
|
-
const ruleIdSchema = z
|
|
8749
|
+
const ruleIdSchema = z.string().min(1, "Rule ID is required").max(50, "Rule ID too long");
|
|
8689
8750
|
/** Nested rule schema for @media and @supports */
|
|
8690
|
-
const nestedRuleSchema = z
|
|
8751
|
+
const nestedRuleSchema = z.object({
|
|
8691
8752
|
selector: selectorSchema,
|
|
8692
8753
|
declarations: declarationsSchema
|
|
8693
8754
|
});
|
|
@@ -8704,46 +8765,46 @@ function isValidKeyframeOffset(offset) {
|
|
|
8704
8765
|
return value >= 0 && value <= 100;
|
|
8705
8766
|
}
|
|
8706
8767
|
/** Keyframe offset validation (0%, 50%, 100%, from, to) */
|
|
8707
|
-
const keyframeOffsetSchema = z
|
|
8768
|
+
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
8769
|
/** Animation name validation (CSS identifier) */
|
|
8709
|
-
const animationNameSchema = z
|
|
8770
|
+
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
8771
|
/** Single keyframe (offset + declarations) */
|
|
8711
|
-
const keyframeSchema = z
|
|
8772
|
+
const keyframeSchema = z.object({
|
|
8712
8773
|
offset: keyframeOffsetSchema,
|
|
8713
8774
|
declarations: declarationsSchema
|
|
8714
8775
|
});
|
|
8715
8776
|
/** @keyframes rule schema */
|
|
8716
|
-
const keyframesAtRuleSchema = z
|
|
8777
|
+
const keyframesAtRuleSchema = z.object({
|
|
8717
8778
|
id: ruleIdSchema,
|
|
8718
|
-
type: z
|
|
8779
|
+
type: z.literal("keyframes"),
|
|
8719
8780
|
name: animationNameSchema,
|
|
8720
|
-
frames: z
|
|
8781
|
+
frames: z.array(keyframeSchema).min(1, "At least one keyframe is required")
|
|
8721
8782
|
});
|
|
8722
8783
|
/** Font-face declarations - uses standard declarations but with font-specific validation */
|
|
8723
|
-
const fontFaceDeclarationsSchema = z
|
|
8784
|
+
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
8785
|
/** @font-face rule schema */
|
|
8725
|
-
const fontFaceAtRuleSchema = z
|
|
8786
|
+
const fontFaceAtRuleSchema = z.object({
|
|
8726
8787
|
id: ruleIdSchema,
|
|
8727
|
-
type: z
|
|
8788
|
+
type: z.literal("font-face"),
|
|
8728
8789
|
declarations: fontFaceDeclarationsSchema
|
|
8729
8790
|
});
|
|
8730
8791
|
/** Media query string validation */
|
|
8731
|
-
const mediaQuerySchema = z
|
|
8792
|
+
const mediaQuerySchema = z.string().min(1, "Media query is required").max(200, "Media query too long");
|
|
8732
8793
|
/** @media rule schema */
|
|
8733
|
-
const mediaAtRuleSchema = z
|
|
8794
|
+
const mediaAtRuleSchema = z.object({
|
|
8734
8795
|
id: ruleIdSchema,
|
|
8735
|
-
type: z
|
|
8796
|
+
type: z.literal("media"),
|
|
8736
8797
|
query: mediaQuerySchema,
|
|
8737
|
-
rules: z
|
|
8798
|
+
rules: z.array(nestedRuleSchema).min(1, "At least one rule is required")
|
|
8738
8799
|
});
|
|
8739
8800
|
/** Supports condition string validation */
|
|
8740
|
-
const supportsConditionSchema = z
|
|
8801
|
+
const supportsConditionSchema = z.string().min(1, "Supports condition is required").max(200, "Supports condition too long");
|
|
8741
8802
|
/** @supports rule schema */
|
|
8742
|
-
const supportsAtRuleSchema = z
|
|
8803
|
+
const supportsAtRuleSchema = z.object({
|
|
8743
8804
|
id: ruleIdSchema,
|
|
8744
|
-
type: z
|
|
8805
|
+
type: z.literal("supports"),
|
|
8745
8806
|
condition: supportsConditionSchema,
|
|
8746
|
-
rules: z
|
|
8807
|
+
rules: z.array(nestedRuleSchema).min(1, "At least one rule is required")
|
|
8747
8808
|
});
|
|
8748
8809
|
/**
|
|
8749
8810
|
* Check if raw CSS contains blocked at-rules.
|
|
@@ -8752,17 +8813,17 @@ function containsBlockedAtRule(css) {
|
|
|
8752
8813
|
return BLOCKED_AT_RULE_PATTERN.test(css);
|
|
8753
8814
|
}
|
|
8754
8815
|
/** Raw CSS validation - blocks @import, @charset, must start with @ */
|
|
8755
|
-
const rawCssSchema = z
|
|
8816
|
+
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
8817
|
/** Raw at-rule schema */
|
|
8757
|
-
const rawAtRuleSchema = z
|
|
8818
|
+
const rawAtRuleSchema = z.object({
|
|
8758
8819
|
id: ruleIdSchema,
|
|
8759
|
-
type: z
|
|
8820
|
+
type: z.literal("raw"),
|
|
8760
8821
|
css: rawCssSchema
|
|
8761
8822
|
});
|
|
8762
8823
|
/**
|
|
8763
8824
|
* Discriminated union schema for all at-rule types.
|
|
8764
8825
|
*/
|
|
8765
|
-
const customCssAtRuleSchema = z
|
|
8826
|
+
const customCssAtRuleSchema = z.discriminatedUnion("type", [
|
|
8766
8827
|
keyframesAtRuleSchema,
|
|
8767
8828
|
fontFaceAtRuleSchema,
|
|
8768
8829
|
mediaAtRuleSchema,
|
|
@@ -8772,7 +8833,7 @@ const customCssAtRuleSchema = z$1.discriminatedUnion("type", [
|
|
|
8772
8833
|
/**
|
|
8773
8834
|
* Array of at-rules for theme-level styling.
|
|
8774
8835
|
*/
|
|
8775
|
-
const customCssAtRulesSchema = z
|
|
8836
|
+
const customCssAtRulesSchema = z.array(customCssAtRuleSchema).optional();
|
|
8776
8837
|
//#endregion
|
|
8777
8838
|
//#region ../theme-core/src/shared/componentStyles.ts
|
|
8778
8839
|
/**
|
|
@@ -8790,22 +8851,22 @@ const customCssAtRulesSchema = z$1.array(customCssAtRuleSchema).optional();
|
|
|
8790
8851
|
* Shared border schema for themed components.
|
|
8791
8852
|
* Position is excluded - each component determines its own border position.
|
|
8792
8853
|
*/
|
|
8793
|
-
const componentBorderSchema = z
|
|
8794
|
-
width: z
|
|
8854
|
+
const componentBorderSchema = z.object({
|
|
8855
|
+
width: z.enum([
|
|
8795
8856
|
"none",
|
|
8796
8857
|
"hairline",
|
|
8797
8858
|
"thin",
|
|
8798
8859
|
"medium",
|
|
8799
8860
|
"thick"
|
|
8800
8861
|
]).default("none"),
|
|
8801
|
-
style: z
|
|
8862
|
+
style: z.enum(["solid", "dashed"]).default("solid"),
|
|
8802
8863
|
colorToken: themeColorTokenSchema.optional()
|
|
8803
8864
|
});
|
|
8804
8865
|
/**
|
|
8805
8866
|
* Shared shadow schema for themed components.
|
|
8806
8867
|
* Softness is inherited from global theme, not configurable per-component.
|
|
8807
8868
|
*/
|
|
8808
|
-
const componentShadowSchema = z
|
|
8869
|
+
const componentShadowSchema = z.object({ elevation: z.enum([
|
|
8809
8870
|
"none",
|
|
8810
8871
|
"sm",
|
|
8811
8872
|
"md",
|
|
@@ -8900,43 +8961,43 @@ const logoDensityValues = [
|
|
|
8900
8961
|
"detailed",
|
|
8901
8962
|
"unknown"
|
|
8902
8963
|
];
|
|
8903
|
-
const logoContainsTextSchema = z
|
|
8904
|
-
z
|
|
8905
|
-
kind: z
|
|
8906
|
-
confidence: z
|
|
8907
|
-
text: z
|
|
8964
|
+
const logoContainsTextSchema = z.discriminatedUnion("kind", [
|
|
8965
|
+
z.object({
|
|
8966
|
+
kind: z.literal("contains-text"),
|
|
8967
|
+
confidence: z.enum(logoTextConfidenceValues),
|
|
8968
|
+
text: z.string().trim().min(1).max(200).optional()
|
|
8908
8969
|
}),
|
|
8909
|
-
z
|
|
8910
|
-
kind: z
|
|
8911
|
-
confidence: z
|
|
8970
|
+
z.object({
|
|
8971
|
+
kind: z.literal("no-text"),
|
|
8972
|
+
confidence: z.enum(logoTextConfidenceValues)
|
|
8912
8973
|
}),
|
|
8913
|
-
z
|
|
8914
|
-
kind: z
|
|
8915
|
-
reason: z
|
|
8974
|
+
z.object({
|
|
8975
|
+
kind: z.literal("unknown"),
|
|
8976
|
+
reason: z.enum([
|
|
8916
8977
|
"analysis-unavailable",
|
|
8917
8978
|
"unsupported-file",
|
|
8918
8979
|
"low-confidence"
|
|
8919
8980
|
])
|
|
8920
8981
|
})
|
|
8921
8982
|
]);
|
|
8922
|
-
const logoAnalysisSourceSchema = z
|
|
8923
|
-
z
|
|
8924
|
-
z
|
|
8925
|
-
kind: z
|
|
8926
|
-
reason: z
|
|
8983
|
+
const logoAnalysisSourceSchema = z.discriminatedUnion("kind", [
|
|
8984
|
+
z.object({ kind: z.literal("none") }),
|
|
8985
|
+
z.object({
|
|
8986
|
+
kind: z.literal("deterministic"),
|
|
8987
|
+
reason: z.enum(["dimensions", "fallback"])
|
|
8927
8988
|
}),
|
|
8928
|
-
z
|
|
8929
|
-
kind: z
|
|
8930
|
-
model: z
|
|
8931
|
-
analyzedAt: z
|
|
8989
|
+
z.object({
|
|
8990
|
+
kind: z.literal("llm"),
|
|
8991
|
+
model: z.literal("gpt-5.4-mini"),
|
|
8992
|
+
analyzedAt: z.string().trim().min(1).max(80).optional()
|
|
8932
8993
|
}),
|
|
8933
|
-
z
|
|
8994
|
+
z.object({ kind: z.literal("manual-override") })
|
|
8934
8995
|
]);
|
|
8935
|
-
z
|
|
8936
|
-
shape: z
|
|
8996
|
+
z.object({
|
|
8997
|
+
shape: z.enum(logoAssetShapeValues),
|
|
8937
8998
|
containsText: logoContainsTextSchema,
|
|
8938
|
-
kind: z
|
|
8939
|
-
density: z
|
|
8999
|
+
kind: z.enum(logoKindValues),
|
|
9000
|
+
density: z.enum(logoDensityValues),
|
|
8940
9001
|
source: logoAnalysisSourceSchema
|
|
8941
9002
|
});
|
|
8942
9003
|
const brandDisplayModeValues = [
|
|
@@ -8990,7 +9051,7 @@ const siteChromeBackgroundOverrideOwner = "site-chrome-editor";
|
|
|
8990
9051
|
* the legacy empty-string "no color" sentinel. Semantic validation needs
|
|
8991
9052
|
* palette context and happens in `parseThemeColorReference`.
|
|
8992
9053
|
*/
|
|
8993
|
-
const tokenOrCssColorValueSchema = z
|
|
9054
|
+
const tokenOrCssColorValueSchema = z.string();
|
|
8994
9055
|
const BREAKPOINT_LG = 1024;
|
|
8995
9056
|
const BREAKPOINT_XL = 1280;
|
|
8996
9057
|
const BREAKPOINT_LG_DOWN = BREAKPOINT_LG - 1;
|
|
@@ -9015,14 +9076,14 @@ mqDown(640);
|
|
|
9015
9076
|
mqDown(768);
|
|
9016
9077
|
//#endregion
|
|
9017
9078
|
//#region ../theme-core/src/header/scrollTreatment.ts
|
|
9018
|
-
const headerScrollTreatmentSchema = z
|
|
9019
|
-
kind: z
|
|
9020
|
-
backgroundTone: z
|
|
9079
|
+
const headerScrollTreatmentSchema = z.discriminatedUnion("kind", [z.object({
|
|
9080
|
+
kind: z.literal("contrast-glass"),
|
|
9081
|
+
backgroundTone: z.enum(["light", "dark"])
|
|
9021
9082
|
})]).optional();
|
|
9022
9083
|
//#endregion
|
|
9023
9084
|
//#region ../theme-core/src/header/containerSchema.ts
|
|
9024
|
-
const headerContainerSchema = z
|
|
9025
|
-
rounded: z
|
|
9085
|
+
const headerContainerSchema = z.object({
|
|
9086
|
+
rounded: z.enum([
|
|
9026
9087
|
"none",
|
|
9027
9088
|
"sm",
|
|
9028
9089
|
"md",
|
|
@@ -9030,77 +9091,146 @@ const headerContainerSchema = z$1.object({
|
|
|
9030
9091
|
"xl",
|
|
9031
9092
|
"2xl"
|
|
9032
9093
|
]).default("xl"),
|
|
9033
|
-
border: z
|
|
9034
|
-
shadow: z
|
|
9035
|
-
padding: z
|
|
9094
|
+
border: z.boolean().default(true),
|
|
9095
|
+
shadow: z.boolean().default(true),
|
|
9096
|
+
padding: z.enum([
|
|
9036
9097
|
"sm",
|
|
9037
9098
|
"md",
|
|
9038
9099
|
"lg"
|
|
9039
9100
|
]).default("md"),
|
|
9040
|
-
tint: z
|
|
9041
|
-
opacity: z
|
|
9101
|
+
tint: z.string().nullable().optional(),
|
|
9102
|
+
opacity: z.number().min(0).max(1).default(.12)
|
|
9042
9103
|
}).optional();
|
|
9043
|
-
const headerInteractionPaletteSchema = z
|
|
9104
|
+
const headerInteractionPaletteSchema = z.enum([
|
|
9044
9105
|
"primary",
|
|
9045
9106
|
"secondary",
|
|
9046
9107
|
"accent"
|
|
9047
9108
|
]);
|
|
9048
9109
|
//#endregion
|
|
9110
|
+
//#region ../theme-core/src/boxBackgroundSchema.ts
|
|
9111
|
+
const boxBackgroundOverlaySchema = z.preprocess(normalizeAuthoringOpacity, z.discriminatedUnion("type", [
|
|
9112
|
+
z.object({ type: z.literal("none") }),
|
|
9113
|
+
z.object({
|
|
9114
|
+
type: z.literal("color"),
|
|
9115
|
+
color: tokenOrCssColorValueSchema.nullable().optional(),
|
|
9116
|
+
opacity: z.number().min(0).max(1).nullable().optional()
|
|
9117
|
+
}),
|
|
9118
|
+
z.object({
|
|
9119
|
+
type: z.literal("gradient"),
|
|
9120
|
+
gradient: z.string().nullable().optional(),
|
|
9121
|
+
opacity: z.number().min(0).max(1).nullable().optional()
|
|
9122
|
+
})
|
|
9123
|
+
]));
|
|
9124
|
+
const commonSchema = z.object({
|
|
9125
|
+
contentOwner: z.literal(pageDesignEditorBackgroundOverrideOwner).optional(),
|
|
9126
|
+
textColor: tokenOrCssColorValueSchema.nullable().optional(),
|
|
9127
|
+
headingColor: tokenOrCssColorValueSchema.nullable().optional(),
|
|
9128
|
+
linkColor: tokenOrCssColorValueSchema.nullable().optional(),
|
|
9129
|
+
supportingColor: tokenOrCssColorValueSchema.nullable().optional()
|
|
9130
|
+
});
|
|
9131
|
+
const mediaPresentationSchema = commonSchema.extend({
|
|
9132
|
+
opacity: z.preprocess(normalizeOpacity, z.number().min(0).max(1).nullable()).optional(),
|
|
9133
|
+
objectFit: z.enum([
|
|
9134
|
+
"fill",
|
|
9135
|
+
"fit",
|
|
9136
|
+
"original",
|
|
9137
|
+
"custom"
|
|
9138
|
+
]).nullable().optional(),
|
|
9139
|
+
scale: z.string().nullable().optional(),
|
|
9140
|
+
position: z.string().nullable().optional(),
|
|
9141
|
+
motion: z.enum(["static", "fixed-frame"]).nullable().optional(),
|
|
9142
|
+
overflow: z.boolean().nullable().optional(),
|
|
9143
|
+
overlay: boxBackgroundOverlaySchema.nullable().optional()
|
|
9144
|
+
});
|
|
9145
|
+
const boxBackgroundSchema = z.discriminatedUnion("type", [
|
|
9146
|
+
commonSchema.extend({
|
|
9147
|
+
type: z.literal("color"),
|
|
9148
|
+
color: tokenOrCssColorValueSchema.nullable().optional()
|
|
9149
|
+
}),
|
|
9150
|
+
commonSchema.extend({
|
|
9151
|
+
type: z.literal("gradient"),
|
|
9152
|
+
gradient: z.string().nullable().optional(),
|
|
9153
|
+
gradientPresetId: z.string().min(1).nullable().optional()
|
|
9154
|
+
}),
|
|
9155
|
+
mediaPresentationSchema.extend({
|
|
9156
|
+
type: z.literal("image"),
|
|
9157
|
+
image: imageMediaSchema.nullable().optional()
|
|
9158
|
+
}),
|
|
9159
|
+
mediaPresentationSchema.extend({
|
|
9160
|
+
type: z.literal("video"),
|
|
9161
|
+
image: videoMediaSchema.nullable().optional(),
|
|
9162
|
+
showVideoOnMobile: z.boolean().nullable().optional()
|
|
9163
|
+
})
|
|
9164
|
+
]);
|
|
9165
|
+
function normalizeAuthoringOpacity(value) {
|
|
9166
|
+
if (!isRecord$3(value)) return value;
|
|
9167
|
+
return {
|
|
9168
|
+
...value,
|
|
9169
|
+
opacity: normalizeOpacity(value.opacity)
|
|
9170
|
+
};
|
|
9171
|
+
}
|
|
9172
|
+
function normalizeOpacity(value) {
|
|
9173
|
+
return typeof value === "number" && value > 1 && value <= 100 ? value / 100 : value;
|
|
9174
|
+
}
|
|
9175
|
+
function isRecord$3(value) {
|
|
9176
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
9177
|
+
}
|
|
9178
|
+
//#endregion
|
|
9049
9179
|
//#region ../theme-core/src/schema.ts
|
|
9050
|
-
const axesSchema = z
|
|
9051
|
-
tone: z
|
|
9180
|
+
const axesSchema = z.object({
|
|
9181
|
+
tone: z.enum([
|
|
9052
9182
|
"minimal",
|
|
9053
9183
|
"classic",
|
|
9054
9184
|
"bold"
|
|
9055
9185
|
]),
|
|
9056
|
-
energy: z
|
|
9057
|
-
density: z
|
|
9186
|
+
energy: z.enum(["calm", "vibrant"]),
|
|
9187
|
+
density: z.enum([
|
|
9058
9188
|
"airy",
|
|
9059
9189
|
"regular",
|
|
9060
9190
|
"compact"
|
|
9061
9191
|
]),
|
|
9062
|
-
mediaBias: z
|
|
9192
|
+
mediaBias: z.enum([
|
|
9063
9193
|
"text",
|
|
9064
9194
|
"media",
|
|
9065
9195
|
"mixed"
|
|
9066
9196
|
]),
|
|
9067
|
-
conversionBias: z
|
|
9197
|
+
conversionBias: z.enum([
|
|
9068
9198
|
"low",
|
|
9069
9199
|
"med",
|
|
9070
9200
|
"high"
|
|
9071
9201
|
]),
|
|
9072
|
-
motion: z
|
|
9202
|
+
motion: z.enum([
|
|
9073
9203
|
"subtle",
|
|
9074
9204
|
"standard",
|
|
9075
9205
|
"expressive"
|
|
9076
9206
|
])
|
|
9077
9207
|
});
|
|
9078
|
-
const typographyStyleSchema = z
|
|
9079
|
-
family: z
|
|
9080
|
-
weight: z
|
|
9208
|
+
const typographyStyleSchema = z.object({
|
|
9209
|
+
family: z.string().min(1),
|
|
9210
|
+
weight: z.enum([
|
|
9081
9211
|
"light",
|
|
9082
9212
|
"regular",
|
|
9083
9213
|
"medium",
|
|
9084
9214
|
"semibold",
|
|
9085
9215
|
"bold"
|
|
9086
9216
|
]),
|
|
9087
|
-
letterSpacing: z
|
|
9217
|
+
letterSpacing: z.enum([
|
|
9088
9218
|
"tight",
|
|
9089
9219
|
"normal",
|
|
9090
9220
|
"loose"
|
|
9091
9221
|
]),
|
|
9092
|
-
lineHeight: z
|
|
9222
|
+
lineHeight: z.enum([
|
|
9093
9223
|
"normal",
|
|
9094
9224
|
"relaxed",
|
|
9095
9225
|
"loose"
|
|
9096
9226
|
])
|
|
9097
9227
|
});
|
|
9098
|
-
const bodyTypographyStyleSchema = typographyStyleSchema.extend({ size: z
|
|
9228
|
+
const bodyTypographyStyleSchema = typographyStyleSchema.extend({ size: z.enum([
|
|
9099
9229
|
"md",
|
|
9100
9230
|
"lg",
|
|
9101
9231
|
"xl"
|
|
9102
9232
|
]) });
|
|
9103
|
-
const headingSizeSchema = z
|
|
9233
|
+
const headingSizeSchema = z.enum([
|
|
9104
9234
|
"xs",
|
|
9105
9235
|
"sm",
|
|
9106
9236
|
"md",
|
|
@@ -9108,68 +9238,68 @@ const headingSizeSchema = z$1.enum([
|
|
|
9108
9238
|
"xl",
|
|
9109
9239
|
"2xl"
|
|
9110
9240
|
]);
|
|
9111
|
-
const headingTypographyOverridesSchema = z
|
|
9112
|
-
weight: z
|
|
9241
|
+
const headingTypographyOverridesSchema = z.object({
|
|
9242
|
+
weight: z.enum([
|
|
9113
9243
|
"light",
|
|
9114
9244
|
"regular",
|
|
9115
9245
|
"medium",
|
|
9116
9246
|
"semibold",
|
|
9117
9247
|
"bold"
|
|
9118
9248
|
]).nullable().optional(),
|
|
9119
|
-
letterSpacing: z
|
|
9249
|
+
letterSpacing: z.enum([
|
|
9120
9250
|
"tight",
|
|
9121
9251
|
"normal",
|
|
9122
9252
|
"loose"
|
|
9123
9253
|
]).nullable().optional(),
|
|
9124
9254
|
size: headingSizeSchema.nullable().optional(),
|
|
9125
|
-
lineHeight: z
|
|
9255
|
+
lineHeight: z.enum([
|
|
9126
9256
|
"tight",
|
|
9127
9257
|
"snug",
|
|
9128
9258
|
"normal",
|
|
9129
9259
|
"relaxed",
|
|
9130
9260
|
"loose"
|
|
9131
9261
|
]).nullable().optional(),
|
|
9132
|
-
italic: z
|
|
9262
|
+
italic: z.boolean().nullable().optional(),
|
|
9133
9263
|
colorToken: themeColorTokenSchema.nullable().optional()
|
|
9134
9264
|
});
|
|
9135
9265
|
const headingTypographyStyleSchema = typographyStyleSchema.extend({
|
|
9136
|
-
case: z
|
|
9266
|
+
case: z.enum([
|
|
9137
9267
|
"uppercase",
|
|
9138
9268
|
"normal",
|
|
9139
9269
|
"smallCaps"
|
|
9140
9270
|
]).nullable(),
|
|
9141
|
-
italic: z
|
|
9271
|
+
italic: z.boolean().nullable(),
|
|
9142
9272
|
colorToken: themeColorTokenSchema.nullable().optional()
|
|
9143
9273
|
});
|
|
9144
|
-
const proseLinkUnderlineStyleSchema = z
|
|
9274
|
+
const proseLinkUnderlineStyleSchema = z.enum([
|
|
9145
9275
|
"solid",
|
|
9146
9276
|
"dotted",
|
|
9147
9277
|
"dashed"
|
|
9148
9278
|
]);
|
|
9149
|
-
const proseLinkUnderlineThicknessSchema = z
|
|
9279
|
+
const proseLinkUnderlineThicknessSchema = z.enum([
|
|
9150
9280
|
"auto",
|
|
9151
9281
|
"fromFont",
|
|
9152
9282
|
"thin",
|
|
9153
9283
|
"medium",
|
|
9154
9284
|
"thick"
|
|
9155
9285
|
]);
|
|
9156
|
-
const proseLinkUnderlineOffsetSchema = z
|
|
9286
|
+
const proseLinkUnderlineOffsetSchema = z.enum([
|
|
9157
9287
|
"auto",
|
|
9158
9288
|
"tight",
|
|
9159
9289
|
"normal",
|
|
9160
9290
|
"loose"
|
|
9161
9291
|
]);
|
|
9162
|
-
const proseLinkStyleSchema = z
|
|
9292
|
+
const proseLinkStyleSchema = z.object({
|
|
9163
9293
|
colorToken: themeColorTokenSchema.optional(),
|
|
9164
9294
|
hoverColorToken: themeColorTokenSchema.optional(),
|
|
9165
|
-
underline: z
|
|
9295
|
+
underline: z.boolean().optional(),
|
|
9166
9296
|
decorationColorToken: themeColorTokenSchema.optional(),
|
|
9167
9297
|
hoverDecorationColorToken: themeColorTokenSchema.optional(),
|
|
9168
9298
|
underlineStyle: proseLinkUnderlineStyleSchema.optional(),
|
|
9169
9299
|
underlineThickness: proseLinkUnderlineThicknessSchema.optional(),
|
|
9170
9300
|
underlineOffset: proseLinkUnderlineOffsetSchema.optional()
|
|
9171
9301
|
});
|
|
9172
|
-
const semanticSpacingSchema = z
|
|
9302
|
+
const semanticSpacingSchema = z.enum([
|
|
9173
9303
|
"none",
|
|
9174
9304
|
"compact",
|
|
9175
9305
|
"cozy",
|
|
@@ -9177,7 +9307,7 @@ const semanticSpacingSchema = z$1.enum([
|
|
|
9177
9307
|
"comfortable",
|
|
9178
9308
|
"spacious"
|
|
9179
9309
|
]);
|
|
9180
|
-
const boxRoundedSchema = z
|
|
9310
|
+
const boxRoundedSchema = z.enum([
|
|
9181
9311
|
"none",
|
|
9182
9312
|
"sm",
|
|
9183
9313
|
"md",
|
|
@@ -9186,82 +9316,45 @@ const boxRoundedSchema = z$1.enum([
|
|
|
9186
9316
|
"2xl",
|
|
9187
9317
|
"full"
|
|
9188
9318
|
]);
|
|
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()
|
|
9198
|
-
});
|
|
9199
|
-
const boxBackgroundSchema = z$1.object({
|
|
9200
|
-
type: z$1.enum([
|
|
9201
|
-
"color",
|
|
9202
|
-
"gradient",
|
|
9203
|
-
"image"
|
|
9204
|
-
]).optional(),
|
|
9205
|
-
contentOwner: z$1.literal(pageDesignEditorBackgroundOverrideOwner).optional(),
|
|
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()
|
|
9319
|
+
const noHeadingDecorationSchema = z.object({ family: z.literal("none") });
|
|
9320
|
+
const visibleHeadingDecorationSchema = z.object({
|
|
9321
|
+
family: z.enum(visibleHeadingDecorationFamilyValues),
|
|
9322
|
+
colorToken: z.enum(headingDecorationColorTokenValues).optional()
|
|
9225
9323
|
});
|
|
9226
|
-
const
|
|
9227
|
-
const
|
|
9228
|
-
|
|
9229
|
-
|
|
9324
|
+
const headingDecorationSchema = z.union([noHeadingDecorationSchema, visibleHeadingDecorationSchema]);
|
|
9325
|
+
const headingDecorationOverrideSchema = z.union([z.enum(headingDecorationOverrideValues), z.literal("on").transform(() => "site-default")]);
|
|
9326
|
+
const accordionIconTreatmentSchema = z.object({
|
|
9327
|
+
iconSet: z.enum(accordionIconSetValues),
|
|
9328
|
+
colorToken: z.enum(accordionIconColorTokenValues),
|
|
9329
|
+
openColorToken: z.enum(accordionIconColorTokenValues).optional(),
|
|
9330
|
+
motion: z.enum(accordionIconMotionValues)
|
|
9230
9331
|
});
|
|
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({
|
|
9332
|
+
const sectionStylesOverrideSchema = z.object({
|
|
9240
9333
|
background: boxBackgroundSchema.nullable().optional(),
|
|
9241
9334
|
spacing: semanticSpacingSchema.nullable().optional(),
|
|
9242
|
-
minHeight: z
|
|
9335
|
+
minHeight: z.enum([
|
|
9243
9336
|
"none",
|
|
9244
9337
|
"banner",
|
|
9245
9338
|
"hero",
|
|
9246
9339
|
"immersive"
|
|
9247
9340
|
]).nullable().optional(),
|
|
9248
|
-
tileTreatment: z
|
|
9249
|
-
eventListTreatment: z
|
|
9250
|
-
eyebrowTreatment: z
|
|
9341
|
+
tileTreatment: z.enum(tileTreatmentValues).nullable().optional(),
|
|
9342
|
+
eventListTreatment: z.enum(eventListTreatmentValues).nullable().optional(),
|
|
9343
|
+
eyebrowTreatment: z.enum(eyebrowTreatmentValues).nullable().optional(),
|
|
9251
9344
|
headingDecoration: headingDecorationSchema.nullable().optional(),
|
|
9252
9345
|
headingDecorationOverride: headingDecorationOverrideSchema.nullable().optional(),
|
|
9253
9346
|
accordionIconTreatment: accordionIconTreatmentSchema.nullable().optional()
|
|
9254
9347
|
});
|
|
9255
|
-
const containerStylesOverrideSchema = z
|
|
9348
|
+
const containerStylesOverrideSchema = z.object({
|
|
9256
9349
|
background: boxBackgroundSchema.nullable().optional(),
|
|
9257
9350
|
spacing: semanticSpacingSchema.nullable().optional(),
|
|
9258
|
-
raised: z
|
|
9351
|
+
raised: z.boolean().nullable().optional(),
|
|
9259
9352
|
rounded: boxRoundedSchema.nullable().optional(),
|
|
9260
|
-
fullWidth: z
|
|
9353
|
+
fullWidth: z.boolean().nullable().optional()
|
|
9261
9354
|
});
|
|
9262
|
-
const cardBorderOverrideSchema = z
|
|
9263
|
-
enabled: z
|
|
9264
|
-
width: z
|
|
9355
|
+
const cardBorderOverrideSchema = z.object({
|
|
9356
|
+
enabled: z.boolean().nullable().optional(),
|
|
9357
|
+
width: z.enum([
|
|
9265
9358
|
"none",
|
|
9266
9359
|
"1",
|
|
9267
9360
|
"2",
|
|
@@ -9269,13 +9362,13 @@ const cardBorderOverrideSchema = z$1.object({
|
|
|
9269
9362
|
]).nullable().optional(),
|
|
9270
9363
|
colorToken: themeColorTokenSchema.nullable().optional()
|
|
9271
9364
|
});
|
|
9272
|
-
const cardStylesOverrideSchema = z
|
|
9365
|
+
const cardStylesOverrideSchema = z.object({
|
|
9273
9366
|
background: boxBackgroundSchema.nullable().optional(),
|
|
9274
9367
|
border: cardBorderOverrideSchema.nullable().optional(),
|
|
9275
9368
|
spacing: semanticSpacingSchema.nullable().optional(),
|
|
9276
|
-
raised: z
|
|
9369
|
+
raised: z.boolean().nullable().optional(),
|
|
9277
9370
|
rounded: boxRoundedSchema.nullable().optional(),
|
|
9278
|
-
treatment: z
|
|
9371
|
+
treatment: z.enum([
|
|
9279
9372
|
"accent-quote",
|
|
9280
9373
|
"editorial-rule",
|
|
9281
9374
|
"soft-panel",
|
|
@@ -9285,16 +9378,16 @@ const cardStylesOverrideSchema = z$1.object({
|
|
|
9285
9378
|
]).nullable().optional(),
|
|
9286
9379
|
cardVariant: boxStylesCardVariantSchema.nullable().optional()
|
|
9287
9380
|
});
|
|
9288
|
-
const blockStyleOverridesSchema = z
|
|
9381
|
+
const blockStyleOverridesSchema = z.object({
|
|
9289
9382
|
sectionStyles: sectionStylesOverrideSchema.nullable().optional(),
|
|
9290
9383
|
containerStyles: containerStylesOverrideSchema.nullable().optional(),
|
|
9291
9384
|
cardStyles: cardStylesOverrideSchema.nullable().optional()
|
|
9292
9385
|
});
|
|
9293
|
-
const blockThemeOverrideSchema = z
|
|
9294
|
-
typography: z
|
|
9386
|
+
const blockThemeOverrideSchema = z.object({
|
|
9387
|
+
typography: z.object({ proseLinkStyle: proseLinkStyleSchema.optional() }).optional(),
|
|
9295
9388
|
styles: blockStyleOverridesSchema.optional()
|
|
9296
9389
|
});
|
|
9297
|
-
const typographyScaleSchema = z
|
|
9390
|
+
const typographyScaleSchema = z.enum([
|
|
9298
9391
|
"compact",
|
|
9299
9392
|
"balanced",
|
|
9300
9393
|
"spacious",
|
|
@@ -9302,31 +9395,31 @@ const typographyScaleSchema = z$1.enum([
|
|
|
9302
9395
|
"majorThird",
|
|
9303
9396
|
"perfectFourth"
|
|
9304
9397
|
]);
|
|
9305
|
-
const eyebrowTypographyStyleSchema = z
|
|
9306
|
-
family: z
|
|
9307
|
-
size: z
|
|
9398
|
+
const eyebrowTypographyStyleSchema = z.object({
|
|
9399
|
+
family: z.string().min(1),
|
|
9400
|
+
size: z.enum([
|
|
9308
9401
|
"sm",
|
|
9309
9402
|
"md",
|
|
9310
9403
|
"lg"
|
|
9311
9404
|
]).optional(),
|
|
9312
|
-
weight: z
|
|
9405
|
+
weight: z.enum([
|
|
9313
9406
|
"light",
|
|
9314
9407
|
"regular",
|
|
9315
9408
|
"medium",
|
|
9316
9409
|
"semibold",
|
|
9317
9410
|
"bold"
|
|
9318
9411
|
]).optional(),
|
|
9319
|
-
letterSpacing: z
|
|
9412
|
+
letterSpacing: z.enum([
|
|
9320
9413
|
"tight",
|
|
9321
9414
|
"normal",
|
|
9322
9415
|
"loose",
|
|
9323
9416
|
"wide"
|
|
9324
9417
|
]).optional(),
|
|
9325
|
-
case: z
|
|
9418
|
+
case: z.enum(["uppercase", "normal"]).optional()
|
|
9326
9419
|
});
|
|
9327
|
-
const typographySchema = z
|
|
9420
|
+
const typographySchema = z.object({
|
|
9328
9421
|
body: bodyTypographyStyleSchema,
|
|
9329
|
-
headings: z
|
|
9422
|
+
headings: z.object({
|
|
9330
9423
|
default: headingTypographyStyleSchema,
|
|
9331
9424
|
h1: headingTypographyOverridesSchema,
|
|
9332
9425
|
h2: headingTypographyOverridesSchema,
|
|
@@ -9339,105 +9432,105 @@ const typographySchema = z$1.object({
|
|
|
9339
9432
|
proseLinkStyle: proseLinkStyleSchema.optional(),
|
|
9340
9433
|
eyebrow: eyebrowTypographyStyleSchema.optional()
|
|
9341
9434
|
});
|
|
9342
|
-
const spaceSchema = z
|
|
9435
|
+
const spaceSchema = z.enum([
|
|
9343
9436
|
"comfortable",
|
|
9344
9437
|
"standard",
|
|
9345
9438
|
"dense"
|
|
9346
9439
|
]);
|
|
9347
|
-
const corners = z
|
|
9440
|
+
const corners = z.enum([
|
|
9348
9441
|
"square",
|
|
9349
9442
|
"soft",
|
|
9350
9443
|
"rounded",
|
|
9351
9444
|
"pill"
|
|
9352
9445
|
]);
|
|
9353
|
-
const shadow = z
|
|
9354
|
-
elevation: z
|
|
9446
|
+
const shadow = z.object({
|
|
9447
|
+
elevation: z.enum([
|
|
9355
9448
|
"none",
|
|
9356
9449
|
"low",
|
|
9357
9450
|
"medium",
|
|
9358
9451
|
"high"
|
|
9359
9452
|
]),
|
|
9360
|
-
softness: z
|
|
9453
|
+
softness: z.enum([
|
|
9361
9454
|
"crisp",
|
|
9362
9455
|
"soft",
|
|
9363
9456
|
"hard"
|
|
9364
9457
|
]).nullable(),
|
|
9365
|
-
position: z
|
|
9458
|
+
position: z.enum(["bottom", "bottom-right"]).default("bottom"),
|
|
9366
9459
|
colorToken: themeColorTokenSchema.optional()
|
|
9367
9460
|
});
|
|
9368
|
-
const border = z
|
|
9369
|
-
width: z
|
|
9461
|
+
const border = z.object({
|
|
9462
|
+
width: z.enum([
|
|
9370
9463
|
"none",
|
|
9371
9464
|
"hairline",
|
|
9372
9465
|
"thin",
|
|
9373
9466
|
"thick"
|
|
9374
9467
|
]),
|
|
9375
|
-
style: z
|
|
9468
|
+
style: z.enum(["solid", "dashed"])
|
|
9376
9469
|
});
|
|
9377
|
-
const motion = z
|
|
9378
|
-
level: z
|
|
9470
|
+
const motion = z.object({
|
|
9471
|
+
level: z.enum([
|
|
9379
9472
|
"off",
|
|
9380
9473
|
"low",
|
|
9381
9474
|
"medium",
|
|
9382
9475
|
"high"
|
|
9383
9476
|
]),
|
|
9384
|
-
easing: z
|
|
9477
|
+
easing: z.enum([
|
|
9385
9478
|
"standard",
|
|
9386
9479
|
"snappy",
|
|
9387
9480
|
"gentle"
|
|
9388
9481
|
]).nullable()
|
|
9389
9482
|
});
|
|
9390
|
-
z
|
|
9391
|
-
z
|
|
9392
|
-
elevation: z
|
|
9483
|
+
z.object({ shape: corners });
|
|
9484
|
+
z.object({
|
|
9485
|
+
elevation: z.enum([
|
|
9393
9486
|
"none",
|
|
9394
9487
|
"low",
|
|
9395
9488
|
"medium",
|
|
9396
9489
|
"high"
|
|
9397
9490
|
]),
|
|
9398
|
-
border: z
|
|
9491
|
+
border: z.enum([
|
|
9399
9492
|
"none",
|
|
9400
9493
|
"subtle",
|
|
9401
9494
|
"defined"
|
|
9402
9495
|
]),
|
|
9403
9496
|
shape: corners,
|
|
9404
|
-
headerStyle: z
|
|
9497
|
+
headerStyle: z.enum([
|
|
9405
9498
|
"plain",
|
|
9406
9499
|
"accentBar",
|
|
9407
9500
|
"subtleBg"
|
|
9408
9501
|
]).nullable(),
|
|
9409
|
-
mediaTreatment: z
|
|
9502
|
+
mediaTreatment: z.enum([
|
|
9410
9503
|
"square",
|
|
9411
9504
|
"rounded",
|
|
9412
9505
|
"bleed"
|
|
9413
9506
|
]).nullable()
|
|
9414
9507
|
});
|
|
9415
|
-
const inputStyle = z
|
|
9508
|
+
const inputStyle = z.object({
|
|
9416
9509
|
shape: corners,
|
|
9417
|
-
border: z
|
|
9510
|
+
border: z.enum([
|
|
9418
9511
|
"subtle",
|
|
9419
9512
|
"defined",
|
|
9420
9513
|
"underline"
|
|
9421
9514
|
]),
|
|
9422
|
-
focus: z
|
|
9515
|
+
focus: z.enum([
|
|
9423
9516
|
"glow",
|
|
9424
9517
|
"ring",
|
|
9425
9518
|
"underline"
|
|
9426
9519
|
]),
|
|
9427
|
-
label: z
|
|
9520
|
+
label: z.enum(["inside", "above"])
|
|
9428
9521
|
});
|
|
9429
|
-
const headerVariant = z
|
|
9522
|
+
const headerVariant = z.enum([
|
|
9430
9523
|
"classic",
|
|
9431
9524
|
"centered",
|
|
9432
9525
|
"transparent",
|
|
9433
9526
|
"floating"
|
|
9434
9527
|
]);
|
|
9435
|
-
const headerPositioning = z
|
|
9528
|
+
const headerPositioning = z.enum([
|
|
9436
9529
|
"static",
|
|
9437
9530
|
"sticky",
|
|
9438
9531
|
"fixed"
|
|
9439
9532
|
]);
|
|
9440
|
-
const headerNavStyle = z
|
|
9533
|
+
const headerNavStyle = z.enum([
|
|
9441
9534
|
"minimal",
|
|
9442
9535
|
"underline",
|
|
9443
9536
|
"underline-grow",
|
|
@@ -9446,59 +9539,59 @@ const headerNavStyle = z$1.enum([
|
|
|
9446
9539
|
"frosted",
|
|
9447
9540
|
"solid"
|
|
9448
9541
|
]);
|
|
9449
|
-
const navFontWeight = z
|
|
9542
|
+
const navFontWeight = z.enum([
|
|
9450
9543
|
"regular",
|
|
9451
9544
|
"medium",
|
|
9452
9545
|
"semibold",
|
|
9453
9546
|
"bold"
|
|
9454
9547
|
]);
|
|
9455
|
-
const headerMaxWidth = z
|
|
9456
|
-
const headerBarFrame = z
|
|
9457
|
-
const headerBorderSchema = componentBorderSchema.extend({ position: z
|
|
9548
|
+
const headerMaxWidth = z.enum(["container", "full"]);
|
|
9549
|
+
const headerBarFrame = z.enum(["full-bleed", "inset-shell"]);
|
|
9550
|
+
const headerBorderSchema = componentBorderSchema.extend({ position: z.enum([
|
|
9458
9551
|
"bottom",
|
|
9459
9552
|
"top",
|
|
9460
9553
|
"both",
|
|
9461
9554
|
"none"
|
|
9462
9555
|
]).default("bottom") }).optional();
|
|
9463
|
-
const logoStyleSchema = z
|
|
9464
|
-
fontFamily: z
|
|
9465
|
-
letterSpacing: z
|
|
9556
|
+
const logoStyleSchema = z.object({
|
|
9557
|
+
fontFamily: z.enum(["heading", "body"]).default("heading"),
|
|
9558
|
+
letterSpacing: z.enum([
|
|
9466
9559
|
"normal",
|
|
9467
9560
|
"wide",
|
|
9468
9561
|
"wider",
|
|
9469
9562
|
"widest"
|
|
9470
9563
|
]).default("normal"),
|
|
9471
|
-
gradient: z
|
|
9472
|
-
brandDisplay: z
|
|
9473
|
-
size: z
|
|
9474
|
-
accommodation: z
|
|
9564
|
+
gradient: z.boolean().default(false),
|
|
9565
|
+
brandDisplay: z.enum(brandDisplayModeValues).optional(),
|
|
9566
|
+
size: z.enum(logoSizePolicyValues).optional(),
|
|
9567
|
+
accommodation: z.enum(logoAccommodationPatternValues).optional()
|
|
9475
9568
|
}).optional();
|
|
9476
|
-
const headerLogoTextSchema = z
|
|
9477
|
-
mobileWrapLines: z
|
|
9478
|
-
mobileMaxWidth: z
|
|
9569
|
+
const headerLogoTextSchema = z.object({
|
|
9570
|
+
mobileWrapLines: z.union([z.literal(1), z.literal(2)]).optional(),
|
|
9571
|
+
mobileMaxWidth: z.enum([
|
|
9479
9572
|
"xs",
|
|
9480
9573
|
"sm",
|
|
9481
9574
|
"md"
|
|
9482
9575
|
]).optional(),
|
|
9483
|
-
hideOnShrink: z
|
|
9576
|
+
hideOnShrink: z.boolean().optional()
|
|
9484
9577
|
}).optional();
|
|
9485
|
-
const navEffectsSchema = z
|
|
9486
|
-
underlineGradient: z
|
|
9487
|
-
glow: z
|
|
9488
|
-
glowColor: z
|
|
9489
|
-
neumorphic: z
|
|
9578
|
+
const navEffectsSchema = z.object({
|
|
9579
|
+
underlineGradient: z.boolean().default(false),
|
|
9580
|
+
glow: z.boolean().default(false),
|
|
9581
|
+
glowColor: z.string().optional(),
|
|
9582
|
+
neumorphic: z.boolean().default(false)
|
|
9490
9583
|
}).optional();
|
|
9491
|
-
const dropdownStyleSchema = z
|
|
9584
|
+
const dropdownStyleSchema = z.object({
|
|
9492
9585
|
background: themeColorTokenSchema.default("surface"),
|
|
9493
9586
|
textColor: themeColorTokenSchema.default("text"),
|
|
9494
9587
|
borderColor: themeColorTokenSchema.nullable().default("border"),
|
|
9495
|
-
shadow: z
|
|
9588
|
+
shadow: z.enum([
|
|
9496
9589
|
"none",
|
|
9497
9590
|
"sm",
|
|
9498
9591
|
"md",
|
|
9499
9592
|
"lg"
|
|
9500
9593
|
]).default("md"),
|
|
9501
|
-
borderRadius: z
|
|
9594
|
+
borderRadius: z.enum([
|
|
9502
9595
|
"none",
|
|
9503
9596
|
"sm",
|
|
9504
9597
|
"md",
|
|
@@ -9506,23 +9599,23 @@ const dropdownStyleSchema = z$1.object({
|
|
|
9506
9599
|
]).default("md"),
|
|
9507
9600
|
hoverBackground: themeColorTokenSchema.nullable().optional(),
|
|
9508
9601
|
hoverTextColor: themeColorTokenSchema.nullable().optional(),
|
|
9509
|
-
textTransform: z
|
|
9602
|
+
textTransform: z.enum([
|
|
9510
9603
|
"none",
|
|
9511
9604
|
"uppercase",
|
|
9512
9605
|
"capitalize"
|
|
9513
9606
|
]).default("none"),
|
|
9514
|
-
letterSpacing: z
|
|
9607
|
+
letterSpacing: z.enum([
|
|
9515
9608
|
"normal",
|
|
9516
9609
|
"wide",
|
|
9517
9610
|
"wider"
|
|
9518
9611
|
]).default("normal"),
|
|
9519
|
-
fontWeight: z
|
|
9612
|
+
fontWeight: z.enum([
|
|
9520
9613
|
"regular",
|
|
9521
9614
|
"medium",
|
|
9522
9615
|
"semibold",
|
|
9523
9616
|
"bold"
|
|
9524
9617
|
]).optional(),
|
|
9525
|
-
textSize: z
|
|
9618
|
+
textSize: z.enum([
|
|
9526
9619
|
"xs",
|
|
9527
9620
|
"sm",
|
|
9528
9621
|
"base",
|
|
@@ -9533,7 +9626,7 @@ const dropdownStyleSchema = z$1.object({
|
|
|
9533
9626
|
* CTA button gap (left margin) for desktop header.
|
|
9534
9627
|
* Controls the spacing between nav links and the CTA button.
|
|
9535
9628
|
*/
|
|
9536
|
-
const headerCtaGapSchema = z
|
|
9629
|
+
const headerCtaGapSchema = z.enum([
|
|
9537
9630
|
"none",
|
|
9538
9631
|
"tight",
|
|
9539
9632
|
"compact",
|
|
@@ -9541,7 +9634,7 @@ const headerCtaGapSchema = z$1.enum([
|
|
|
9541
9634
|
"relaxed",
|
|
9542
9635
|
"spacious"
|
|
9543
9636
|
]);
|
|
9544
|
-
const headerCtaTreatmentSchema = z
|
|
9637
|
+
const headerCtaTreatmentSchema = z.enum([
|
|
9545
9638
|
"default",
|
|
9546
9639
|
"primary",
|
|
9547
9640
|
"secondary",
|
|
@@ -9549,39 +9642,39 @@ const headerCtaTreatmentSchema = z$1.enum([
|
|
|
9549
9642
|
"outline",
|
|
9550
9643
|
"ghost"
|
|
9551
9644
|
]);
|
|
9552
|
-
const navContainerSchema = z
|
|
9553
|
-
type: z
|
|
9645
|
+
const navContainerSchema = z.object({
|
|
9646
|
+
type: z.enum([
|
|
9554
9647
|
"none",
|
|
9555
9648
|
"pill",
|
|
9556
9649
|
"glass"
|
|
9557
9650
|
]).default("none"),
|
|
9558
|
-
tint: z
|
|
9559
|
-
opacity: z
|
|
9651
|
+
tint: z.string().nullable().optional(),
|
|
9652
|
+
opacity: z.number().min(0).max(1).default(.15)
|
|
9560
9653
|
}).default({
|
|
9561
9654
|
type: "none",
|
|
9562
9655
|
tint: null,
|
|
9563
9656
|
opacity: .15
|
|
9564
9657
|
});
|
|
9565
|
-
const headerBackgroundSchema = z
|
|
9566
|
-
type: z
|
|
9658
|
+
const headerBackgroundSchema = z.object({
|
|
9659
|
+
type: z.enum([
|
|
9567
9660
|
"color",
|
|
9568
9661
|
"gradient",
|
|
9569
9662
|
"image"
|
|
9570
9663
|
]),
|
|
9571
|
-
contentOwner: z
|
|
9664
|
+
contentOwner: z.literal(siteChromeBackgroundOverrideOwner).optional(),
|
|
9572
9665
|
color: tokenOrCssColorValueSchema.nullable().optional(),
|
|
9573
9666
|
gradient: gradientConfigSchema.nullable().optional(),
|
|
9574
|
-
image: mediaSchema
|
|
9667
|
+
image: mediaSchema.nullable().optional(),
|
|
9575
9668
|
textColor: tokenOrCssColorValueSchema.nullable().optional()
|
|
9576
9669
|
});
|
|
9577
|
-
const headerSchema = z
|
|
9670
|
+
const headerSchema = z.object({
|
|
9578
9671
|
variant: headerVariant,
|
|
9579
9672
|
positioning: headerPositioning,
|
|
9580
|
-
shrinkOnScroll: z
|
|
9673
|
+
shrinkOnScroll: z.boolean(),
|
|
9581
9674
|
maxWidth: headerMaxWidth,
|
|
9582
9675
|
barFrame: headerBarFrame.optional(),
|
|
9583
9676
|
scrollTreatment: headerScrollTreatmentSchema,
|
|
9584
|
-
logoOverride: mediaSchema
|
|
9677
|
+
logoOverride: mediaSchema.nullable().optional(),
|
|
9585
9678
|
background: headerBackgroundSchema.default({
|
|
9586
9679
|
type: "color",
|
|
9587
9680
|
color: "surface"
|
|
@@ -9590,11 +9683,10 @@ const headerSchema = z$1.object({
|
|
|
9590
9683
|
navStyle: headerNavStyle,
|
|
9591
9684
|
navColor: themeColorTokenSchema.nullable().optional(),
|
|
9592
9685
|
navWeight: navFontWeight.default("medium"),
|
|
9593
|
-
navFontRole: z
|
|
9594
|
-
navTypography: z$1.enum(["body", "heading"]).optional(),
|
|
9686
|
+
navFontRole: z.enum(["body", "heading"]).optional(),
|
|
9595
9687
|
navTextSize: navLinkStyleSchema.shape.textSize,
|
|
9596
9688
|
interactionPalette: headerInteractionPaletteSchema.optional(),
|
|
9597
|
-
navPlacement: z
|
|
9689
|
+
navPlacement: z.enum(["end", "center"]).optional(),
|
|
9598
9690
|
container: headerContainerSchema,
|
|
9599
9691
|
border: headerBorderSchema,
|
|
9600
9692
|
shadow: componentShadowSchema.optional(),
|
|
@@ -9605,47 +9697,33 @@ const headerSchema = z$1.object({
|
|
|
9605
9697
|
navLinkStyle: navLinkStyleSchema.optional(),
|
|
9606
9698
|
ctaGap: headerCtaGapSchema.optional(),
|
|
9607
9699
|
ctaTreatment: headerCtaTreatmentSchema.optional(),
|
|
9608
|
-
ctaVariant: z
|
|
9700
|
+
ctaVariant: z.string().min(1).optional(),
|
|
9609
9701
|
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([
|
|
9702
|
+
});
|
|
9703
|
+
const footerVariant = z.enum([
|
|
9626
9704
|
"simple",
|
|
9627
9705
|
"columns",
|
|
9628
9706
|
"split"
|
|
9629
9707
|
]);
|
|
9630
|
-
const footerMaxWidth = z
|
|
9631
|
-
const footerMode = z
|
|
9708
|
+
const footerMaxWidth = z.enum(["container", "full"]);
|
|
9709
|
+
const footerMode = z.enum([
|
|
9632
9710
|
"default",
|
|
9633
9711
|
"blocks",
|
|
9634
9712
|
"default+blocks",
|
|
9635
9713
|
"none"
|
|
9636
9714
|
]);
|
|
9637
|
-
const footerNavLayoutMode = z
|
|
9715
|
+
const footerNavLayoutMode = z.enum([
|
|
9638
9716
|
"stack",
|
|
9639
9717
|
"inline",
|
|
9640
9718
|
"inline-wrap"
|
|
9641
9719
|
]);
|
|
9642
|
-
const footerNavLayoutAlign = z
|
|
9720
|
+
const footerNavLayoutAlign = z.enum([
|
|
9643
9721
|
"start",
|
|
9644
9722
|
"center",
|
|
9645
9723
|
"end",
|
|
9646
9724
|
"space-between"
|
|
9647
9725
|
]);
|
|
9648
|
-
const footerSpacing = z
|
|
9726
|
+
const footerSpacing = z.enum([
|
|
9649
9727
|
"none",
|
|
9650
9728
|
"tight",
|
|
9651
9729
|
"compact",
|
|
@@ -9653,45 +9731,45 @@ const footerSpacing = z$1.enum([
|
|
|
9653
9731
|
"relaxed",
|
|
9654
9732
|
"spacious"
|
|
9655
9733
|
]);
|
|
9656
|
-
const footerLogoPlacement = z
|
|
9734
|
+
const footerLogoPlacement = z.enum([
|
|
9657
9735
|
"left",
|
|
9658
9736
|
"right",
|
|
9659
9737
|
"above",
|
|
9660
9738
|
"below"
|
|
9661
9739
|
]);
|
|
9662
|
-
const footerLogoSize = z
|
|
9740
|
+
const footerLogoSize = z.enum([
|
|
9663
9741
|
"sm",
|
|
9664
9742
|
"md",
|
|
9665
9743
|
"lg",
|
|
9666
9744
|
"xl"
|
|
9667
9745
|
]);
|
|
9668
|
-
const footerLogoMaxHeight = z
|
|
9746
|
+
const footerLogoMaxHeight = z.enum([
|
|
9669
9747
|
"sm",
|
|
9670
9748
|
"md",
|
|
9671
9749
|
"lg",
|
|
9672
9750
|
"xl"
|
|
9673
9751
|
]);
|
|
9674
|
-
const footerBottomTextLinkStyleSchema = z
|
|
9752
|
+
const footerBottomTextLinkStyleSchema = z.object({
|
|
9675
9753
|
colorToken: themeColorTokenSchema.optional(),
|
|
9676
9754
|
hoverColorToken: themeColorTokenSchema.nullable().optional(),
|
|
9677
9755
|
decorationColorToken: themeColorTokenSchema.nullable().optional(),
|
|
9678
|
-
underline: z
|
|
9756
|
+
underline: z.boolean().optional()
|
|
9679
9757
|
});
|
|
9680
|
-
const footerBottomBarSchema = z
|
|
9681
|
-
enabled: z
|
|
9682
|
-
fullBleed: z
|
|
9758
|
+
const footerBottomBarSchema = z.object({
|
|
9759
|
+
enabled: z.boolean().optional(),
|
|
9760
|
+
fullBleed: z.boolean().optional(),
|
|
9683
9761
|
background: headerBackgroundSchema.optional(),
|
|
9684
9762
|
textColor: themeColorTokenSchema.nullable().optional(),
|
|
9685
|
-
textAlign: z
|
|
9763
|
+
textAlign: z.enum([
|
|
9686
9764
|
"left",
|
|
9687
9765
|
"center",
|
|
9688
9766
|
"right"
|
|
9689
9767
|
]).optional(),
|
|
9690
9768
|
paddingY: footerSpacing.optional(),
|
|
9691
9769
|
paddingX: footerSpacing.optional(),
|
|
9692
|
-
borderTop: z
|
|
9770
|
+
borderTop: z.object({
|
|
9693
9771
|
colorToken: themeColorTokenSchema.nullable().optional(),
|
|
9694
|
-
width: z
|
|
9772
|
+
width: z.enum([
|
|
9695
9773
|
"none",
|
|
9696
9774
|
"thin",
|
|
9697
9775
|
"medium",
|
|
@@ -9699,26 +9777,26 @@ const footerBottomBarSchema = z$1.object({
|
|
|
9699
9777
|
]).optional()
|
|
9700
9778
|
}).optional()
|
|
9701
9779
|
});
|
|
9702
|
-
const footerNavLayoutSchema = z
|
|
9780
|
+
const footerNavLayoutSchema = z.object({
|
|
9703
9781
|
layout: footerNavLayoutMode.optional(),
|
|
9704
9782
|
align: footerNavLayoutAlign.optional(),
|
|
9705
9783
|
gapX: footerSpacing.optional(),
|
|
9706
9784
|
gapY: footerSpacing.optional(),
|
|
9707
|
-
columns: z
|
|
9785
|
+
columns: z.number().int().min(1).max(6).optional()
|
|
9708
9786
|
});
|
|
9709
|
-
const footerLogoSchema = z
|
|
9710
|
-
showLogo: z
|
|
9711
|
-
showLogoText: z
|
|
9787
|
+
const footerLogoSchema = z.object({
|
|
9788
|
+
showLogo: z.boolean().default(true),
|
|
9789
|
+
showLogoText: z.boolean().optional(),
|
|
9712
9790
|
placement: footerLogoPlacement.optional(),
|
|
9713
9791
|
size: footerLogoSize.optional(),
|
|
9714
9792
|
maxHeight: footerLogoMaxHeight.optional(),
|
|
9715
|
-
align: z
|
|
9793
|
+
align: z.enum([
|
|
9716
9794
|
"start",
|
|
9717
9795
|
"center",
|
|
9718
9796
|
"end"
|
|
9719
9797
|
]).optional()
|
|
9720
9798
|
});
|
|
9721
|
-
const footerSchema = z
|
|
9799
|
+
const footerSchema = z.object({
|
|
9722
9800
|
/**
|
|
9723
9801
|
* SDK-only footer rendering mode.
|
|
9724
9802
|
*
|
|
@@ -9727,7 +9805,7 @@ const footerSchema = z$1.object({
|
|
|
9727
9805
|
mode: footerMode.optional(),
|
|
9728
9806
|
variant: footerVariant,
|
|
9729
9807
|
maxWidth: footerMaxWidth,
|
|
9730
|
-
showLogoText: z
|
|
9808
|
+
showLogoText: z.boolean().optional(),
|
|
9731
9809
|
background: headerBackgroundSchema.default({
|
|
9732
9810
|
type: "color",
|
|
9733
9811
|
color: "surface"
|
|
@@ -9741,18 +9819,18 @@ const footerSchema = z$1.object({
|
|
|
9741
9819
|
logo: footerLogoSchema.optional(),
|
|
9742
9820
|
bottomBar: footerBottomBarSchema.optional()
|
|
9743
9821
|
});
|
|
9744
|
-
const containerPaddingPresetSchema = z
|
|
9822
|
+
const containerPaddingPresetSchema = z.enum([
|
|
9745
9823
|
"tight",
|
|
9746
9824
|
"compact",
|
|
9747
9825
|
"default",
|
|
9748
9826
|
"relaxed"
|
|
9749
9827
|
]);
|
|
9750
|
-
const layoutSchema = z
|
|
9828
|
+
const layoutSchema = z.object({ containerPadding: z.object({
|
|
9751
9829
|
mobile: containerPaddingPresetSchema.optional(),
|
|
9752
9830
|
tablet: containerPaddingPresetSchema.optional(),
|
|
9753
9831
|
desktop: containerPaddingPresetSchema.optional()
|
|
9754
9832
|
}).optional() }).optional();
|
|
9755
|
-
const heroTypographySizeSchema = z
|
|
9833
|
+
const heroTypographySizeSchema = z.enum([
|
|
9756
9834
|
"sm",
|
|
9757
9835
|
"base",
|
|
9758
9836
|
"lg",
|
|
@@ -9764,19 +9842,19 @@ const heroTypographySizeSchema = z$1.enum([
|
|
|
9764
9842
|
"6xl",
|
|
9765
9843
|
"editorial"
|
|
9766
9844
|
]);
|
|
9767
|
-
const heroTypographyLineHeightSchema = z
|
|
9845
|
+
const heroTypographyLineHeightSchema = z.enum([
|
|
9768
9846
|
"tight",
|
|
9769
9847
|
"snug",
|
|
9770
9848
|
"normal",
|
|
9771
9849
|
"relaxed"
|
|
9772
9850
|
]);
|
|
9773
|
-
const heroResponsiveTypographySchema = z
|
|
9851
|
+
const heroResponsiveTypographySchema = z.object({
|
|
9774
9852
|
headlineSize: heroTypographySizeSchema.optional(),
|
|
9775
9853
|
headlineLineHeight: heroTypographyLineHeightSchema.optional(),
|
|
9776
9854
|
subheadlineSize: heroTypographySizeSchema.optional(),
|
|
9777
9855
|
subheadlineLineHeight: heroTypographyLineHeightSchema.optional()
|
|
9778
9856
|
});
|
|
9779
|
-
const heroTypographySchema = z
|
|
9857
|
+
const heroTypographySchema = z.object({
|
|
9780
9858
|
headlineSize: heroTypographySizeSchema.optional(),
|
|
9781
9859
|
headlineLineHeight: heroTypographyLineHeightSchema.optional(),
|
|
9782
9860
|
subheadlineSize: heroTypographySizeSchema.optional(),
|
|
@@ -9785,21 +9863,21 @@ const heroTypographySchema = z$1.object({
|
|
|
9785
9863
|
microHeadlineLineHeight: heroTypographyLineHeightSchema.optional(),
|
|
9786
9864
|
microSubheadlineSize: heroTypographySizeSchema.optional(),
|
|
9787
9865
|
microSubheadlineLineHeight: heroTypographyLineHeightSchema.optional(),
|
|
9788
|
-
responsive: z
|
|
9866
|
+
responsive: z.object({
|
|
9789
9867
|
tablet: heroResponsiveTypographySchema.optional(),
|
|
9790
9868
|
mobile: heroResponsiveTypographySchema.optional()
|
|
9791
9869
|
}).optional()
|
|
9792
9870
|
});
|
|
9793
|
-
const heroSchema = z
|
|
9794
|
-
const bodyTextIntroTypographySizeSchema = z
|
|
9795
|
-
const bodyTextSchema = z
|
|
9871
|
+
const heroSchema = z.object({ typography: heroTypographySchema.optional() }).optional();
|
|
9872
|
+
const bodyTextIntroTypographySizeSchema = z.enum(["default", "editorial"]);
|
|
9873
|
+
const bodyTextSchema = z.object({ intro: z.object({
|
|
9796
9874
|
paragraphSize: bodyTextIntroTypographySizeSchema.optional(),
|
|
9797
9875
|
headingSize: bodyTextIntroTypographySizeSchema.optional()
|
|
9798
9876
|
}).optional() }).optional();
|
|
9799
|
-
const gradientsSchema = z
|
|
9800
|
-
button: z
|
|
9801
|
-
hero: z
|
|
9802
|
-
background: z
|
|
9877
|
+
const gradientsSchema = z.object({
|
|
9878
|
+
button: z.string().min(1).nullable().optional(),
|
|
9879
|
+
hero: z.string().min(1).nullable().optional(),
|
|
9880
|
+
background: z.string().min(1).nullable().optional()
|
|
9803
9881
|
});
|
|
9804
9882
|
/**
|
|
9805
9883
|
* Testimonial quote-mark treatment, owned by the site style (analogous to the
|
|
@@ -9807,27 +9885,27 @@ const gradientsSchema = z$1.object({
|
|
|
9807
9885
|
* it. `none` hides the mark. The block renders the mark; the site style decides
|
|
9808
9886
|
* its character; a look may still hide it.
|
|
9809
9887
|
*/
|
|
9810
|
-
const testimonialQuoteTreatmentSchema = z
|
|
9811
|
-
style: z
|
|
9888
|
+
const testimonialQuoteTreatmentSchema = z.object({
|
|
9889
|
+
style: z.enum([
|
|
9812
9890
|
"serif-display",
|
|
9813
9891
|
"accent-glyph",
|
|
9814
9892
|
"none"
|
|
9815
9893
|
]),
|
|
9816
|
-
fontFamily: z
|
|
9817
|
-
scale: z
|
|
9894
|
+
fontFamily: z.enum(["heading", "body"]).optional(),
|
|
9895
|
+
scale: z.enum([
|
|
9818
9896
|
"sm",
|
|
9819
9897
|
"md",
|
|
9820
9898
|
"lg",
|
|
9821
9899
|
"xl"
|
|
9822
9900
|
]).optional(),
|
|
9823
9901
|
colorToken: themeColorTokenSchema.optional(),
|
|
9824
|
-
opacity: z
|
|
9902
|
+
opacity: z.number().min(0).max(1).optional()
|
|
9825
9903
|
});
|
|
9826
|
-
const themeSchema = z
|
|
9827
|
-
name: z
|
|
9828
|
-
description: z
|
|
9829
|
-
rationale: z
|
|
9830
|
-
siteStyleId: z
|
|
9904
|
+
const themeSchema = z.object({
|
|
9905
|
+
name: z.string().min(1).max(30),
|
|
9906
|
+
description: z.string().min(1).max(400),
|
|
9907
|
+
rationale: z.string().min(1).max(400),
|
|
9908
|
+
siteStyleId: z.string().min(1).transform((value) => asSiteStyleId(value)).optional(),
|
|
9831
9909
|
axes: axesSchema,
|
|
9832
9910
|
palette: paletteSchema,
|
|
9833
9911
|
typography: typographySchema,
|
|
@@ -9848,8 +9926,8 @@ const themeSchema = z$1.object({
|
|
|
9848
9926
|
testimonialQuote: testimonialQuoteTreatmentSchema.optional(),
|
|
9849
9927
|
inputs: inputSystemSchema.optional(),
|
|
9850
9928
|
inputStyle: inputStyle.optional(),
|
|
9851
|
-
blockCustomVars: z
|
|
9852
|
-
blockOverrides: z
|
|
9929
|
+
blockCustomVars: z.record(z.string(), z.record(z.string(), z.string())).optional(),
|
|
9930
|
+
blockOverrides: z.record(z.string(), blockThemeOverrideSchema).optional(),
|
|
9853
9931
|
headingDecoration: headingDecorationSchema.optional(),
|
|
9854
9932
|
customCssRules: customCssRulesSchema,
|
|
9855
9933
|
blockCustomCssRules: blockCustomCssRulesSchema,
|
|
@@ -9879,11 +9957,11 @@ const themeSchema = z$1.object({
|
|
|
9879
9957
|
* }
|
|
9880
9958
|
* ```
|
|
9881
9959
|
*/
|
|
9882
|
-
styleGroups: z
|
|
9960
|
+
styleGroups: z.record(z.string(), z.array(z.string())).optional()
|
|
9883
9961
|
});
|
|
9884
|
-
z
|
|
9885
|
-
message: z
|
|
9886
|
-
themes: z
|
|
9962
|
+
z.object({
|
|
9963
|
+
message: z.string().min(1),
|
|
9964
|
+
themes: z.array(themeSchema).length(3)
|
|
9887
9965
|
});
|
|
9888
9966
|
//#endregion
|
|
9889
9967
|
//#region ../theme-core/src/buttons/classNames.ts
|
|
@@ -9997,6 +10075,7 @@ function resolveButtonStyleRecipe(recipe, parameters) {
|
|
|
9997
10075
|
const buttonSystem = {
|
|
9998
10076
|
global: definition.global,
|
|
9999
10077
|
variants: PUBLIC_BUTTON_ROLES.map((role) => roles[role]),
|
|
10078
|
+
surfacePolicy: definition.surfacePolicy ?? createStandardButtonSurfacePolicy(),
|
|
10000
10079
|
...definition.sizes ? { sizes: definition.sizes } : {}
|
|
10001
10080
|
};
|
|
10002
10081
|
const parsedButtonSystem = buttonSystemSchema.safeParse(buttonSystem);
|
|
@@ -10057,15 +10136,15 @@ const BUTTON_STYLE_IDS = [
|
|
|
10057
10136
|
"ornate-ritual",
|
|
10058
10137
|
"quiet-arrow"
|
|
10059
10138
|
];
|
|
10060
|
-
const quietArrowParametersSchema = z
|
|
10061
|
-
const emptyParametersSchema$1 = z
|
|
10139
|
+
const quietArrowParametersSchema = z.object({ secondaryTreatment: z.enum(["outlined", "solid-accent"]) }).strict();
|
|
10140
|
+
const emptyParametersSchema$1 = z.object({}).strict();
|
|
10062
10141
|
function selectionBranch(styleId, parameters) {
|
|
10063
|
-
return z
|
|
10064
|
-
styleId: z
|
|
10142
|
+
return z.object({
|
|
10143
|
+
styleId: z.literal(styleId),
|
|
10065
10144
|
parameters
|
|
10066
10145
|
}).strict();
|
|
10067
10146
|
}
|
|
10068
|
-
z
|
|
10147
|
+
z.discriminatedUnion("styleId", [
|
|
10069
10148
|
selectionBranch("soft-pill", emptyParametersSchema$1),
|
|
10070
10149
|
selectionBranch("earth-pill", emptyParametersSchema$1),
|
|
10071
10150
|
selectionBranch("confident-chip", emptyParametersSchema$1),
|
|
@@ -10210,7 +10289,7 @@ const quietArrowRecipe = defineButtonStyleRecipe({
|
|
|
10210
10289
|
});
|
|
10211
10290
|
//#endregion
|
|
10212
10291
|
//#region ../theme-core/src/buttons/styles/recipes/defineStaticButtonStyleRecipe.ts
|
|
10213
|
-
const emptyParametersSchema = z
|
|
10292
|
+
const emptyParametersSchema = z.object({}).strict();
|
|
10214
10293
|
function defineStaticButtonStyleRecipe(input) {
|
|
10215
10294
|
const system = normalizeSystem(input.system);
|
|
10216
10295
|
return defineButtonStyleRecipe({
|
|
@@ -12782,67 +12861,67 @@ function SelectedCheck() {
|
|
|
12782
12861
|
}
|
|
12783
12862
|
//#endregion
|
|
12784
12863
|
//#region ../blocks/src/system/blocks/shared/bookingPaymentTerms.ts
|
|
12785
|
-
const bookingDepositRefundPolicySchema = z
|
|
12786
|
-
const bookingInstalmentPlanSchema = z
|
|
12787
|
-
z
|
|
12788
|
-
kind: z
|
|
12789
|
-
depositAmountCents: z
|
|
12864
|
+
const bookingDepositRefundPolicySchema = z.enum(["refundable", "non_refundable"]);
|
|
12865
|
+
const bookingInstalmentPlanSchema = z.union([
|
|
12866
|
+
z.object({
|
|
12867
|
+
kind: z.literal("deposit_plus_one_remainder"),
|
|
12868
|
+
depositAmountCents: z.number().int().min(0),
|
|
12790
12869
|
depositRefundability: bookingDepositRefundPolicySchema,
|
|
12791
|
-
remainderDueCount: z
|
|
12792
|
-
intervalUnit: z
|
|
12870
|
+
remainderDueCount: z.number().int().positive(),
|
|
12871
|
+
intervalUnit: z.enum([
|
|
12793
12872
|
"day",
|
|
12794
12873
|
"week",
|
|
12795
12874
|
"month"
|
|
12796
12875
|
])
|
|
12797
12876
|
}),
|
|
12798
|
-
z
|
|
12799
|
-
kind: z
|
|
12800
|
-
depositAmountCents: z
|
|
12877
|
+
z.object({
|
|
12878
|
+
kind: z.literal("deposit_plus_scheduled_instalments"),
|
|
12879
|
+
depositAmountCents: z.number().int().min(0),
|
|
12801
12880
|
depositRefundability: bookingDepositRefundPolicySchema,
|
|
12802
|
-
instalmentCount: z
|
|
12803
|
-
intervalCount: z
|
|
12804
|
-
intervalUnit: z
|
|
12881
|
+
instalmentCount: z.number().int().positive(),
|
|
12882
|
+
intervalCount: z.number().int().positive(),
|
|
12883
|
+
intervalUnit: z.enum([
|
|
12805
12884
|
"day",
|
|
12806
12885
|
"week",
|
|
12807
12886
|
"month"
|
|
12808
12887
|
])
|
|
12809
12888
|
}),
|
|
12810
|
-
z
|
|
12811
|
-
kind: z
|
|
12812
|
-
instalmentCount: z
|
|
12813
|
-
intervalCount: z
|
|
12814
|
-
intervalUnit: z
|
|
12889
|
+
z.object({
|
|
12890
|
+
kind: z.literal("equal_scheduled_instalments"),
|
|
12891
|
+
instalmentCount: z.number().int().positive(),
|
|
12892
|
+
intervalCount: z.number().int().positive(),
|
|
12893
|
+
intervalUnit: z.enum([
|
|
12815
12894
|
"day",
|
|
12816
12895
|
"week",
|
|
12817
12896
|
"month"
|
|
12818
12897
|
])
|
|
12819
12898
|
})
|
|
12820
12899
|
]);
|
|
12821
|
-
const bookingFlexibleBalanceDueDateRuleSchema = z
|
|
12822
|
-
kind: z
|
|
12823
|
-
daysBeforeStart: z
|
|
12824
|
-
}), z
|
|
12825
|
-
kind: z
|
|
12826
|
-
dueAt: z
|
|
12900
|
+
const bookingFlexibleBalanceDueDateRuleSchema = z.union([z.object({
|
|
12901
|
+
kind: z.literal("relative_to_start_date"),
|
|
12902
|
+
daysBeforeStart: z.number().int().positive()
|
|
12903
|
+
}), z.object({
|
|
12904
|
+
kind: z.literal("fixed_calendar_date"),
|
|
12905
|
+
dueAt: z.string().datetime()
|
|
12827
12906
|
})]);
|
|
12828
|
-
const bookingFlexibleBalanceConfigSchema = z
|
|
12829
|
-
upfrontAmountCents: z
|
|
12907
|
+
const bookingFlexibleBalanceConfigSchema = z.object({
|
|
12908
|
+
upfrontAmountCents: z.number().int().min(0),
|
|
12830
12909
|
dueDateRule: bookingFlexibleBalanceDueDateRuleSchema,
|
|
12831
12910
|
depositRefundability: bookingDepositRefundPolicySchema
|
|
12832
12911
|
});
|
|
12833
|
-
const blockBookingPaymentCollectionOptionSchema = z
|
|
12834
|
-
z
|
|
12835
|
-
z
|
|
12836
|
-
z
|
|
12837
|
-
kind: z
|
|
12912
|
+
const blockBookingPaymentCollectionOptionSchema = z.union([
|
|
12913
|
+
z.object({ kind: z.literal("upfront") }),
|
|
12914
|
+
z.object({ kind: z.literal("deferred_manual") }),
|
|
12915
|
+
z.object({
|
|
12916
|
+
kind: z.literal("instalment_plan"),
|
|
12838
12917
|
plan: bookingInstalmentPlanSchema
|
|
12839
12918
|
}),
|
|
12840
|
-
z
|
|
12841
|
-
kind: z
|
|
12919
|
+
z.object({
|
|
12920
|
+
kind: z.literal("flexible_balance"),
|
|
12842
12921
|
config: bookingFlexibleBalanceConfigSchema
|
|
12843
12922
|
})
|
|
12844
12923
|
]);
|
|
12845
|
-
const blockBookingPaymentTermsSchema = z
|
|
12924
|
+
const blockBookingPaymentTermsSchema = z.object({ allowedOptions: z.array(blockBookingPaymentCollectionOptionSchema).min(1) });
|
|
12846
12925
|
//#endregion
|
|
12847
12926
|
//#region ../blocks/src/system/runtime/shared/utils/checkoutUrls.ts
|
|
12848
12927
|
/**
|
|
@@ -14416,95 +14495,6 @@ function requiresPaymentStep(params) {
|
|
|
14416
14495
|
return !isEntitlementSelection(params.paymentSelection);
|
|
14417
14496
|
}
|
|
14418
14497
|
//#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
14498
|
//#region ../blocks/src/system/manifest/richTextSchema.ts
|
|
14509
14499
|
/**
|
|
14510
14500
|
* Shared Rich Text Schema
|
|
@@ -14525,16 +14515,16 @@ z.discriminatedUnion("type", [
|
|
|
14525
14515
|
* - attrs: Node attributes (e.g., alignment, color)
|
|
14526
14516
|
* - marks: Text formatting marks (e.g., bold, italic)
|
|
14527
14517
|
*/
|
|
14528
|
-
const TipTapMarkSchema = z
|
|
14529
|
-
type: z
|
|
14530
|
-
attrs: z
|
|
14518
|
+
const TipTapMarkSchema = z.object({
|
|
14519
|
+
type: z.string().min(1),
|
|
14520
|
+
attrs: z.record(z.string(), z.unknown()).optional()
|
|
14531
14521
|
}).strict();
|
|
14532
|
-
const TipTapNodeSchema = z
|
|
14533
|
-
type: z
|
|
14534
|
-
content: z
|
|
14535
|
-
text: z
|
|
14536
|
-
attrs: z
|
|
14537
|
-
marks: z
|
|
14522
|
+
const TipTapNodeSchema = z.lazy(() => z.object({
|
|
14523
|
+
type: z.string().min(1),
|
|
14524
|
+
content: z.array(TipTapNodeSchema).optional(),
|
|
14525
|
+
text: z.string().optional(),
|
|
14526
|
+
attrs: z.record(z.string(), z.unknown()).optional(),
|
|
14527
|
+
marks: z.array(TipTapMarkSchema).optional()
|
|
14538
14528
|
}).strict().superRefine((node, ctx) => {
|
|
14539
14529
|
if (node.type === "doc") ctx.addIssue({
|
|
14540
14530
|
code: "custom",
|
|
@@ -14569,101 +14559,101 @@ const TipTapNodeSchema = z$1.lazy(() => z$1.object({
|
|
|
14569
14559
|
* non-legacy consumer can rely on.
|
|
14570
14560
|
*
|
|
14571
14561
|
*/
|
|
14572
|
-
const RichTextDocSchema = z
|
|
14573
|
-
type: z
|
|
14574
|
-
content: z
|
|
14562
|
+
const RichTextDocSchema = z.object({
|
|
14563
|
+
type: z.literal("doc"),
|
|
14564
|
+
content: z.array(TipTapNodeSchema)
|
|
14575
14565
|
}).strict();
|
|
14576
14566
|
//#endregion
|
|
14577
14567
|
//#region ../blocks/src/system/blocks/courses/shared/schemas.ts
|
|
14578
14568
|
/**
|
|
14579
14569
|
* Zod schema for course venue data
|
|
14580
14570
|
*/
|
|
14581
|
-
const courseVenueSchema = z
|
|
14582
|
-
id: z
|
|
14583
|
-
name: z
|
|
14584
|
-
address: z
|
|
14571
|
+
const courseVenueSchema = z.object({
|
|
14572
|
+
id: z.string(),
|
|
14573
|
+
name: z.string(),
|
|
14574
|
+
address: z.string().nullable()
|
|
14585
14575
|
});
|
|
14586
14576
|
/**
|
|
14587
14577
|
* Zod schema for course session (occurrence) data
|
|
14588
14578
|
*/
|
|
14589
|
-
const courseSessionSchema = z
|
|
14590
|
-
id: z
|
|
14591
|
-
startsAt: z
|
|
14592
|
-
endsAt: z
|
|
14593
|
-
timeZone: z
|
|
14594
|
-
capacityOverride: z
|
|
14595
|
-
overrides: z
|
|
14579
|
+
const courseSessionSchema = z.object({
|
|
14580
|
+
id: z.string(),
|
|
14581
|
+
startsAt: z.string(),
|
|
14582
|
+
endsAt: z.string(),
|
|
14583
|
+
timeZone: z.string(),
|
|
14584
|
+
capacityOverride: z.number().nullable().optional(),
|
|
14585
|
+
overrides: z.record(z.string(), z.unknown()).nullable().optional()
|
|
14596
14586
|
});
|
|
14597
|
-
const courseTeamMemberSummarySchema = z
|
|
14598
|
-
id: z
|
|
14599
|
-
name: z
|
|
14600
|
-
roleLabel: z
|
|
14601
|
-
summary: z
|
|
14602
|
-
profilePath: z
|
|
14587
|
+
const courseTeamMemberSummarySchema = z.object({
|
|
14588
|
+
id: z.string(),
|
|
14589
|
+
name: z.string(),
|
|
14590
|
+
roleLabel: z.string().nullable(),
|
|
14591
|
+
summary: z.string().nullable(),
|
|
14592
|
+
profilePath: z.string().nullable()
|
|
14603
14593
|
});
|
|
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
|
|
14594
|
+
const coursePricingOptionSchema = z.object({
|
|
14595
|
+
id: z.string(),
|
|
14596
|
+
name: z.string(),
|
|
14597
|
+
description: z.string().nullable(),
|
|
14598
|
+
priceAmount: z.number(),
|
|
14599
|
+
isActive: z.boolean(),
|
|
14600
|
+
sortOrder: z.number(),
|
|
14601
|
+
capacityLimit: z.number().nullable(),
|
|
14602
|
+
saleStartsAt: z.string().nullable(),
|
|
14603
|
+
saleEndsAt: z.string().nullable(),
|
|
14604
|
+
attendanceScope: z.enum([
|
|
14615
14605
|
"in_person",
|
|
14616
14606
|
"online",
|
|
14617
14607
|
"both"
|
|
14618
14608
|
]).nullable().optional()
|
|
14619
14609
|
});
|
|
14620
|
-
const coursePricingSchema = z
|
|
14621
|
-
bookingRequirement: z
|
|
14622
|
-
pricingStrategy: z
|
|
14610
|
+
const coursePricingSchema = z.object({
|
|
14611
|
+
bookingRequirement: z.enum(["none", "required"]),
|
|
14612
|
+
pricingStrategy: z.enum([
|
|
14623
14613
|
"free",
|
|
14624
14614
|
"single",
|
|
14625
14615
|
"tiered",
|
|
14626
14616
|
"sliding_scale"
|
|
14627
14617
|
]),
|
|
14628
|
-
currency: z
|
|
14629
|
-
singlePriceAmount: z
|
|
14630
|
-
slidingMinAmount: z
|
|
14631
|
-
slidingMaxAmount: z
|
|
14632
|
-
slidingSuggestedAmount: z
|
|
14618
|
+
currency: z.string(),
|
|
14619
|
+
singlePriceAmount: z.number().nullable(),
|
|
14620
|
+
slidingMinAmount: z.number().nullable().optional(),
|
|
14621
|
+
slidingMaxAmount: z.number().nullable().optional(),
|
|
14622
|
+
slidingSuggestedAmount: z.number().nullable().optional(),
|
|
14633
14623
|
paymentTerms: blockBookingPaymentTermsSchema,
|
|
14634
|
-
options: z
|
|
14624
|
+
options: z.array(coursePricingOptionSchema)
|
|
14635
14625
|
});
|
|
14636
14626
|
/**
|
|
14637
14627
|
* Zod schema for public course data
|
|
14638
14628
|
*/
|
|
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
|
|
14629
|
+
const publicWholeSeriesOfferingSchema = z.object({
|
|
14630
|
+
eventSeriesId: z.string(),
|
|
14631
|
+
eventOfferingId: z.string(),
|
|
14632
|
+
title: z.string(),
|
|
14633
|
+
slug: z.string(),
|
|
14634
|
+
description: z.unknown().nullable(),
|
|
14635
|
+
teamMembers: z.array(courseTeamMemberSummarySchema).optional(),
|
|
14636
|
+
enrollmentOpen: z.boolean(),
|
|
14647
14637
|
pricing: coursePricingSchema,
|
|
14648
|
-
currency: z
|
|
14638
|
+
currency: z.string(),
|
|
14649
14639
|
paymentTerms: blockBookingPaymentTermsSchema,
|
|
14650
|
-
enrollmentCapacity: z
|
|
14651
|
-
acceptsMemberships: z
|
|
14652
|
-
status: z
|
|
14640
|
+
enrollmentCapacity: z.number().nullable(),
|
|
14641
|
+
acceptsMemberships: z.boolean(),
|
|
14642
|
+
status: z.enum([
|
|
14653
14643
|
"active",
|
|
14654
14644
|
"draft",
|
|
14655
14645
|
"cancelled"
|
|
14656
14646
|
]),
|
|
14657
|
-
sessionsCount: z
|
|
14658
|
-
enrolledCount: z
|
|
14659
|
-
availableSpots: z
|
|
14660
|
-
sessions: z
|
|
14647
|
+
sessionsCount: z.number(),
|
|
14648
|
+
enrolledCount: z.number(),
|
|
14649
|
+
availableSpots: z.number().nullable(),
|
|
14650
|
+
sessions: z.array(courseSessionSchema),
|
|
14661
14651
|
venue: courseVenueSchema.nullable()
|
|
14662
14652
|
});
|
|
14663
|
-
z
|
|
14653
|
+
z.array(publicWholeSeriesOfferingSchema);
|
|
14664
14654
|
//#endregion
|
|
14665
14655
|
//#region ../blocks/src/system/blocks/events/shared/schemas.ts
|
|
14666
|
-
const eventPresetSchema = z
|
|
14656
|
+
const eventPresetSchema = z.enum([
|
|
14667
14657
|
"event",
|
|
14668
14658
|
"class",
|
|
14669
14659
|
"course",
|
|
@@ -14671,11 +14661,11 @@ const eventPresetSchema = z$1.enum([
|
|
|
14671
14661
|
"retreat",
|
|
14672
14662
|
"performance"
|
|
14673
14663
|
]);
|
|
14674
|
-
const eventScheduleScopeSchema = z
|
|
14675
|
-
const publicEventRecurrenceSchema = z
|
|
14676
|
-
kind: z
|
|
14677
|
-
interval: z
|
|
14678
|
-
weekdays: z
|
|
14664
|
+
const eventScheduleScopeSchema = z.enum(["recurring", "oneOff"]);
|
|
14665
|
+
const publicEventRecurrenceSchema = z.discriminatedUnion("kind", [z.object({
|
|
14666
|
+
kind: z.literal("weekly"),
|
|
14667
|
+
interval: z.number().int().positive(),
|
|
14668
|
+
weekdays: z.array(z.enum([
|
|
14679
14669
|
"MO",
|
|
14680
14670
|
"TU",
|
|
14681
14671
|
"WE",
|
|
@@ -14684,38 +14674,38 @@ const publicEventRecurrenceSchema = z$1.discriminatedUnion("kind", [z$1.object({
|
|
|
14684
14674
|
"SA",
|
|
14685
14675
|
"SU"
|
|
14686
14676
|
]))
|
|
14687
|
-
}).readonly(), z
|
|
14688
|
-
const eventDestinationModeSchema = z
|
|
14689
|
-
const publicEventDestinationSchema = z
|
|
14690
|
-
kind: z
|
|
14677
|
+
}).readonly(), z.object({ kind: z.literal("other") }).readonly()]);
|
|
14678
|
+
const eventDestinationModeSchema = z.enum(["cms-managed", "system-managed"]);
|
|
14679
|
+
const publicEventDestinationSchema = z.discriminatedUnion("kind", [z.object({
|
|
14680
|
+
kind: z.literal("native"),
|
|
14691
14681
|
mode: eventDestinationModeSchema,
|
|
14692
|
-
path: z
|
|
14693
|
-
}), z
|
|
14694
|
-
kind: z
|
|
14695
|
-
url: z
|
|
14696
|
-
label: z
|
|
14682
|
+
path: z.string()
|
|
14683
|
+
}), z.object({
|
|
14684
|
+
kind: z.literal("external"),
|
|
14685
|
+
url: z.string(),
|
|
14686
|
+
label: z.string()
|
|
14697
14687
|
})]);
|
|
14698
14688
|
/**
|
|
14699
14689
|
* Zod schema for venue data
|
|
14700
14690
|
*/
|
|
14701
|
-
const eventVenueSchema = z
|
|
14702
|
-
id: z
|
|
14703
|
-
name: z
|
|
14704
|
-
address: z
|
|
14705
|
-
location: z
|
|
14706
|
-
lat: z
|
|
14707
|
-
lng: z
|
|
14691
|
+
const eventVenueSchema = z.object({
|
|
14692
|
+
id: z.string(),
|
|
14693
|
+
name: z.string(),
|
|
14694
|
+
address: z.string().nullable(),
|
|
14695
|
+
location: z.object({
|
|
14696
|
+
lat: z.number(),
|
|
14697
|
+
lng: z.number()
|
|
14708
14698
|
}).nullable()
|
|
14709
14699
|
});
|
|
14710
14700
|
/**
|
|
14711
14701
|
* Zod schema for event category data
|
|
14712
14702
|
*/
|
|
14713
|
-
const eventCategorySchema = z
|
|
14714
|
-
id: z
|
|
14715
|
-
name: z
|
|
14716
|
-
color: z
|
|
14703
|
+
const eventCategorySchema = z.object({
|
|
14704
|
+
id: z.string(),
|
|
14705
|
+
name: z.string(),
|
|
14706
|
+
color: z.string().nullable()
|
|
14717
14707
|
});
|
|
14718
|
-
z
|
|
14708
|
+
z.enum([
|
|
14719
14709
|
"free",
|
|
14720
14710
|
"paid",
|
|
14721
14711
|
"external"
|
|
@@ -14723,290 +14713,290 @@ z$1.enum([
|
|
|
14723
14713
|
/**
|
|
14724
14714
|
* Access restriction type for public events
|
|
14725
14715
|
*/
|
|
14726
|
-
const accessRestrictionSchema = z
|
|
14727
|
-
z
|
|
14728
|
-
const publicCoursePriceDisplaySchema = z
|
|
14729
|
-
z
|
|
14730
|
-
kind: z
|
|
14731
|
-
currency: z
|
|
14716
|
+
const accessRestrictionSchema = z.enum(["none", "category"]);
|
|
14717
|
+
z.enum(["single", "ticket_types"]);
|
|
14718
|
+
const publicCoursePriceDisplaySchema = z.discriminatedUnion("kind", [
|
|
14719
|
+
z.object({
|
|
14720
|
+
kind: z.literal("free"),
|
|
14721
|
+
currency: z.string()
|
|
14732
14722
|
}),
|
|
14733
|
-
z
|
|
14734
|
-
kind: z
|
|
14735
|
-
amount: z
|
|
14736
|
-
currency: z
|
|
14723
|
+
z.object({
|
|
14724
|
+
kind: z.literal("exact"),
|
|
14725
|
+
amount: z.number(),
|
|
14726
|
+
currency: z.string()
|
|
14737
14727
|
}),
|
|
14738
|
-
z
|
|
14739
|
-
kind: z
|
|
14740
|
-
amount: z
|
|
14741
|
-
currency: z
|
|
14728
|
+
z.object({
|
|
14729
|
+
kind: z.literal("from"),
|
|
14730
|
+
amount: z.number(),
|
|
14731
|
+
currency: z.string()
|
|
14742
14732
|
}),
|
|
14743
|
-
z
|
|
14744
|
-
kind: z
|
|
14745
|
-
currency: z
|
|
14733
|
+
z.object({
|
|
14734
|
+
kind: z.literal("unavailable"),
|
|
14735
|
+
currency: z.string()
|
|
14746
14736
|
})
|
|
14747
14737
|
]);
|
|
14748
|
-
z
|
|
14749
|
-
z
|
|
14750
|
-
kind: z
|
|
14751
|
-
currency: z
|
|
14738
|
+
z.discriminatedUnion("kind", [
|
|
14739
|
+
z.object({
|
|
14740
|
+
kind: z.literal("free"),
|
|
14741
|
+
currency: z.string()
|
|
14752
14742
|
}),
|
|
14753
|
-
z
|
|
14754
|
-
kind: z
|
|
14755
|
-
amount: z
|
|
14756
|
-
currency: z
|
|
14743
|
+
z.object({
|
|
14744
|
+
kind: z.literal("exact"),
|
|
14745
|
+
amount: z.number(),
|
|
14746
|
+
currency: z.string()
|
|
14757
14747
|
}),
|
|
14758
|
-
z
|
|
14759
|
-
kind: z
|
|
14760
|
-
amount: z
|
|
14761
|
-
currency: z
|
|
14748
|
+
z.object({
|
|
14749
|
+
kind: z.literal("from"),
|
|
14750
|
+
amount: z.number(),
|
|
14751
|
+
currency: z.string()
|
|
14762
14752
|
}),
|
|
14763
|
-
z
|
|
14764
|
-
kind: z
|
|
14765
|
-
minAmount: z
|
|
14766
|
-
maxAmount: z
|
|
14767
|
-
currency: z
|
|
14753
|
+
z.object({
|
|
14754
|
+
kind: z.literal("range"),
|
|
14755
|
+
minAmount: z.number(),
|
|
14756
|
+
maxAmount: z.number(),
|
|
14757
|
+
currency: z.string()
|
|
14768
14758
|
}),
|
|
14769
|
-
z
|
|
14770
|
-
kind: z
|
|
14771
|
-
paidFromAmount: z
|
|
14772
|
-
paidToAmount: z
|
|
14773
|
-
currency: z
|
|
14759
|
+
z.object({
|
|
14760
|
+
kind: z.literal("mixed"),
|
|
14761
|
+
paidFromAmount: z.number(),
|
|
14762
|
+
paidToAmount: z.number(),
|
|
14763
|
+
currency: z.string()
|
|
14774
14764
|
}),
|
|
14775
|
-
z
|
|
14776
|
-
kind: z
|
|
14777
|
-
currency: z
|
|
14765
|
+
z.object({
|
|
14766
|
+
kind: z.literal("unavailable"),
|
|
14767
|
+
currency: z.string()
|
|
14778
14768
|
}),
|
|
14779
|
-
z
|
|
14780
|
-
kind: z
|
|
14781
|
-
label: z
|
|
14769
|
+
z.object({
|
|
14770
|
+
kind: z.literal("external"),
|
|
14771
|
+
label: z.string()
|
|
14782
14772
|
}),
|
|
14783
|
-
z
|
|
14784
|
-
kind: z
|
|
14773
|
+
z.object({
|
|
14774
|
+
kind: z.literal("course"),
|
|
14785
14775
|
display: publicCoursePriceDisplaySchema
|
|
14786
14776
|
})
|
|
14787
14777
|
]);
|
|
14788
|
-
const publicEventTicketTypePriceDisplaySchema = z
|
|
14789
|
-
z
|
|
14790
|
-
kind: z
|
|
14791
|
-
currency: z
|
|
14778
|
+
const publicEventTicketTypePriceDisplaySchema = z.union([
|
|
14779
|
+
z.object({
|
|
14780
|
+
kind: z.literal("free"),
|
|
14781
|
+
currency: z.string()
|
|
14792
14782
|
}),
|
|
14793
|
-
z
|
|
14794
|
-
kind: z
|
|
14795
|
-
amount: z
|
|
14796
|
-
currency: z
|
|
14783
|
+
z.object({
|
|
14784
|
+
kind: z.literal("exact"),
|
|
14785
|
+
amount: z.number(),
|
|
14786
|
+
currency: z.string()
|
|
14797
14787
|
}),
|
|
14798
|
-
z
|
|
14799
|
-
kind: z
|
|
14800
|
-
amount: z
|
|
14801
|
-
currency: z
|
|
14788
|
+
z.object({
|
|
14789
|
+
kind: z.literal("from"),
|
|
14790
|
+
amount: z.number(),
|
|
14791
|
+
currency: z.string()
|
|
14802
14792
|
}),
|
|
14803
|
-
z
|
|
14804
|
-
kind: z
|
|
14805
|
-
minAmount: z
|
|
14806
|
-
maxAmount: z
|
|
14807
|
-
currency: z
|
|
14793
|
+
z.object({
|
|
14794
|
+
kind: z.literal("range"),
|
|
14795
|
+
minAmount: z.number(),
|
|
14796
|
+
maxAmount: z.number(),
|
|
14797
|
+
currency: z.string()
|
|
14808
14798
|
}),
|
|
14809
|
-
z
|
|
14810
|
-
kind: z
|
|
14811
|
-
paidFromAmount: z
|
|
14812
|
-
paidToAmount: z
|
|
14813
|
-
currency: z
|
|
14799
|
+
z.object({
|
|
14800
|
+
kind: z.literal("mixed"),
|
|
14801
|
+
paidFromAmount: z.number(),
|
|
14802
|
+
paidToAmount: z.number(),
|
|
14803
|
+
currency: z.string()
|
|
14814
14804
|
}),
|
|
14815
|
-
z
|
|
14816
|
-
kind: z
|
|
14817
|
-
currency: z
|
|
14805
|
+
z.object({
|
|
14806
|
+
kind: z.literal("unavailable"),
|
|
14807
|
+
currency: z.string()
|
|
14818
14808
|
})
|
|
14819
14809
|
]);
|
|
14820
|
-
const publicEventAttendanceModeSchema = z
|
|
14821
|
-
const publicEventAttendanceModeAvailabilitySchema = z
|
|
14810
|
+
const publicEventAttendanceModeSchema = z.enum(["in_person", "online"]);
|
|
14811
|
+
const publicEventAttendanceModeAvailabilitySchema = z.object({
|
|
14822
14812
|
mode: publicEventAttendanceModeSchema,
|
|
14823
|
-
capacity: z
|
|
14824
|
-
registeredCount: z
|
|
14825
|
-
availableSpots: z
|
|
14826
|
-
waitlistEnabled: z
|
|
14813
|
+
capacity: z.number().nullable(),
|
|
14814
|
+
registeredCount: z.number(),
|
|
14815
|
+
availableSpots: z.number().nullable(),
|
|
14816
|
+
waitlistEnabled: z.boolean()
|
|
14827
14817
|
});
|
|
14828
|
-
const publicEventTicketTypeAvailabilitySchema = z
|
|
14829
|
-
kind: z
|
|
14830
|
-
remainingCapacity: z
|
|
14831
|
-
}), z
|
|
14832
|
-
kind: z
|
|
14833
|
-
reason: z
|
|
14818
|
+
const publicEventTicketTypeAvailabilitySchema = z.union([z.object({
|
|
14819
|
+
kind: z.literal("available"),
|
|
14820
|
+
remainingCapacity: z.number().nullable()
|
|
14821
|
+
}), z.object({
|
|
14822
|
+
kind: z.literal("unavailable"),
|
|
14823
|
+
reason: z.enum([
|
|
14834
14824
|
"inactive",
|
|
14835
14825
|
"not_on_sale_yet",
|
|
14836
14826
|
"sale_ended",
|
|
14837
14827
|
"sold_out",
|
|
14838
14828
|
"event_sold_out"
|
|
14839
14829
|
]),
|
|
14840
|
-
remainingCapacity: z
|
|
14830
|
+
remainingCapacity: z.number().nullable()
|
|
14841
14831
|
})]);
|
|
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
|
|
14832
|
+
const publicEventTicketTypeSchema = z.object({
|
|
14833
|
+
id: z.string(),
|
|
14834
|
+
siteId: z.string(),
|
|
14835
|
+
eventSeriesId: z.string(),
|
|
14836
|
+
name: z.string(),
|
|
14837
|
+
description: z.string().nullable(),
|
|
14838
|
+
priceAmount: z.number(),
|
|
14839
|
+
isActive: z.boolean(),
|
|
14840
|
+
sortOrder: z.number(),
|
|
14841
|
+
capacityMode: z.enum(["limited", "unlimited"]),
|
|
14842
|
+
capacityLimit: z.number().nullable(),
|
|
14843
|
+
attendanceScope: z.enum([
|
|
14854
14844
|
"in_person",
|
|
14855
14845
|
"online",
|
|
14856
14846
|
"both"
|
|
14857
14847
|
]).optional(),
|
|
14858
|
-
saleStartsAt: z
|
|
14859
|
-
saleEndsAt: z
|
|
14848
|
+
saleStartsAt: z.string().nullable(),
|
|
14849
|
+
saleEndsAt: z.string().nullable(),
|
|
14860
14850
|
availability: publicEventTicketTypeAvailabilitySchema,
|
|
14861
|
-
createdAt: z
|
|
14862
|
-
updatedAt: z
|
|
14851
|
+
createdAt: z.string(),
|
|
14852
|
+
updatedAt: z.string()
|
|
14863
14853
|
});
|
|
14864
|
-
const publicEventPricingSchema = z
|
|
14865
|
-
z
|
|
14866
|
-
kind: z
|
|
14867
|
-
currency: z
|
|
14868
|
-
display: z
|
|
14869
|
-
kind: z
|
|
14870
|
-
currency: z
|
|
14854
|
+
const publicEventPricingSchema = z.discriminatedUnion("kind", [
|
|
14855
|
+
z.object({
|
|
14856
|
+
kind: z.literal("drop_in"),
|
|
14857
|
+
currency: z.string(),
|
|
14858
|
+
display: z.object({
|
|
14859
|
+
kind: z.literal("free"),
|
|
14860
|
+
currency: z.string()
|
|
14871
14861
|
})
|
|
14872
14862
|
}),
|
|
14873
|
-
z
|
|
14874
|
-
kind: z
|
|
14875
|
-
currency: z
|
|
14876
|
-
display: z
|
|
14877
|
-
kind: z
|
|
14878
|
-
currency: z
|
|
14863
|
+
z.object({
|
|
14864
|
+
kind: z.literal("free_registration"),
|
|
14865
|
+
currency: z.string(),
|
|
14866
|
+
display: z.object({
|
|
14867
|
+
kind: z.literal("free"),
|
|
14868
|
+
currency: z.string()
|
|
14879
14869
|
})
|
|
14880
14870
|
}),
|
|
14881
|
-
z
|
|
14882
|
-
kind: z
|
|
14883
|
-
amount: z
|
|
14884
|
-
currency: z
|
|
14885
|
-
display: z
|
|
14886
|
-
kind: z
|
|
14887
|
-
amount: z
|
|
14888
|
-
currency: z
|
|
14871
|
+
z.object({
|
|
14872
|
+
kind: z.literal("single_paid"),
|
|
14873
|
+
amount: z.number(),
|
|
14874
|
+
currency: z.string(),
|
|
14875
|
+
display: z.object({
|
|
14876
|
+
kind: z.literal("exact"),
|
|
14877
|
+
amount: z.number(),
|
|
14878
|
+
currency: z.string()
|
|
14889
14879
|
})
|
|
14890
14880
|
}),
|
|
14891
|
-
z
|
|
14892
|
-
kind: z
|
|
14893
|
-
currency: z
|
|
14894
|
-
ticketTypes: z
|
|
14881
|
+
z.object({
|
|
14882
|
+
kind: z.literal("ticket_types"),
|
|
14883
|
+
currency: z.string(),
|
|
14884
|
+
ticketTypes: z.array(publicEventTicketTypeSchema),
|
|
14895
14885
|
display: publicEventTicketTypePriceDisplaySchema
|
|
14896
14886
|
}),
|
|
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
|
|
14887
|
+
z.object({
|
|
14888
|
+
kind: z.literal("sliding_scale"),
|
|
14889
|
+
minAmount: z.number(),
|
|
14890
|
+
maxAmount: z.number(),
|
|
14891
|
+
suggestedAmount: z.number().nullable(),
|
|
14892
|
+
currency: z.string(),
|
|
14893
|
+
display: z.object({
|
|
14894
|
+
kind: z.literal("range"),
|
|
14895
|
+
minAmount: z.number(),
|
|
14896
|
+
maxAmount: z.number(),
|
|
14897
|
+
currency: z.string()
|
|
14908
14898
|
})
|
|
14909
14899
|
}),
|
|
14910
|
-
z
|
|
14911
|
-
kind: z
|
|
14912
|
-
display: z
|
|
14913
|
-
kind: z
|
|
14900
|
+
z.object({
|
|
14901
|
+
kind: z.literal("course"),
|
|
14902
|
+
display: z.object({
|
|
14903
|
+
kind: z.literal("course"),
|
|
14914
14904
|
display: publicCoursePriceDisplaySchema
|
|
14915
14905
|
})
|
|
14916
14906
|
}),
|
|
14917
|
-
z
|
|
14918
|
-
kind: z
|
|
14919
|
-
display: z
|
|
14920
|
-
kind: z
|
|
14921
|
-
label: z
|
|
14907
|
+
z.object({
|
|
14908
|
+
kind: z.literal("external"),
|
|
14909
|
+
display: z.object({
|
|
14910
|
+
kind: z.literal("external"),
|
|
14911
|
+
label: z.string()
|
|
14922
14912
|
})
|
|
14923
14913
|
})
|
|
14924
14914
|
]);
|
|
14925
|
-
const publicTeamMemberSummarySchema = z
|
|
14926
|
-
id: z
|
|
14927
|
-
name: z
|
|
14928
|
-
roleLabel: z
|
|
14929
|
-
summary: z
|
|
14930
|
-
profilePath: z
|
|
14915
|
+
const publicTeamMemberSummarySchema = z.object({
|
|
14916
|
+
id: z.string(),
|
|
14917
|
+
name: z.string(),
|
|
14918
|
+
roleLabel: z.string().nullable(),
|
|
14919
|
+
summary: z.string().nullable(),
|
|
14920
|
+
profilePath: z.string().nullable()
|
|
14931
14921
|
});
|
|
14932
14922
|
/**
|
|
14933
14923
|
* Zod schema for public event data
|
|
14934
14924
|
*/
|
|
14935
|
-
const publicEventSchema = z
|
|
14936
|
-
bookingScope: z
|
|
14925
|
+
const publicEventSchema = z.object({
|
|
14926
|
+
bookingScope: z.enum(["single_occurrence", "whole_series"]),
|
|
14937
14927
|
eventPreset: eventPresetSchema.optional(),
|
|
14938
14928
|
eventDestinationMode: eventDestinationModeSchema.optional(),
|
|
14939
14929
|
scheduleScope: eventScheduleScopeSchema.optional(),
|
|
14940
14930
|
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
|
|
14931
|
+
id: z.string(),
|
|
14932
|
+
occurrenceId: z.string(),
|
|
14933
|
+
seriesId: z.string(),
|
|
14934
|
+
title: z.string(),
|
|
14935
|
+
description: z.string().nullable(),
|
|
14936
|
+
content: z.object({ body: RichTextDocSchema.nullable().optional() }).optional(),
|
|
14937
|
+
presentation: z.object({
|
|
14938
|
+
cardTitleOverride: z.string().nullable().optional(),
|
|
14939
|
+
summary: z.string().nullable().optional(),
|
|
14950
14940
|
image: mediaSchema.nullable().optional()
|
|
14951
14941
|
}).optional(),
|
|
14952
|
-
slug: z
|
|
14953
|
-
path: z
|
|
14942
|
+
slug: z.string(),
|
|
14943
|
+
path: z.string().nullable(),
|
|
14954
14944
|
destination: publicEventDestinationSchema,
|
|
14955
|
-
requiresRegistration: z
|
|
14956
|
-
deliveryMode: z
|
|
14945
|
+
requiresRegistration: z.boolean(),
|
|
14946
|
+
deliveryMode: z.enum([
|
|
14957
14947
|
"in_person",
|
|
14958
14948
|
"online",
|
|
14959
14949
|
"hybrid"
|
|
14960
14950
|
]),
|
|
14961
|
-
attendanceModes: z
|
|
14962
|
-
startsAt: z
|
|
14963
|
-
endsAt: z
|
|
14964
|
-
capacity: z
|
|
14965
|
-
registeredCount: z
|
|
14966
|
-
availableSpots: z
|
|
14967
|
-
waitlistEnabled: z
|
|
14951
|
+
attendanceModes: z.array(publicEventAttendanceModeAvailabilitySchema),
|
|
14952
|
+
startsAt: z.string(),
|
|
14953
|
+
endsAt: z.string(),
|
|
14954
|
+
capacity: z.number().nullable(),
|
|
14955
|
+
registeredCount: z.number(),
|
|
14956
|
+
availableSpots: z.number().nullable(),
|
|
14957
|
+
waitlistEnabled: z.boolean(),
|
|
14968
14958
|
venue: eventVenueSchema.nullable(),
|
|
14969
14959
|
eventCategory: eventCategorySchema.nullable(),
|
|
14970
|
-
teamMembers: z
|
|
14971
|
-
status: z
|
|
14960
|
+
teamMembers: z.array(publicTeamMemberSummarySchema).optional(),
|
|
14961
|
+
status: z.enum([
|
|
14972
14962
|
"active",
|
|
14973
14963
|
"draft",
|
|
14974
14964
|
"archived"
|
|
14975
14965
|
]).optional(),
|
|
14976
|
-
timeZone: z
|
|
14966
|
+
timeZone: z.string(),
|
|
14977
14967
|
pricing: publicEventPricingSchema,
|
|
14978
14968
|
paymentTerms: blockBookingPaymentTermsSchema,
|
|
14979
14969
|
accessRestriction: accessRestrictionSchema,
|
|
14980
|
-
allowedCategoryIds: z
|
|
14981
|
-
requireGuestDetails: z
|
|
14982
|
-
acceptsPasses: z
|
|
14983
|
-
acceptsMemberships: z
|
|
14984
|
-
wholeSeries: z
|
|
14985
|
-
eventSeriesId: z
|
|
14970
|
+
allowedCategoryIds: z.array(z.string()),
|
|
14971
|
+
requireGuestDetails: z.boolean().optional(),
|
|
14972
|
+
acceptsPasses: z.boolean().optional(),
|
|
14973
|
+
acceptsMemberships: z.boolean().optional(),
|
|
14974
|
+
wholeSeries: z.object({
|
|
14975
|
+
eventSeriesId: z.string(),
|
|
14986
14976
|
pricing: coursePricingSchema,
|
|
14987
|
-
currency: z
|
|
14988
|
-
enrollmentOpen: z
|
|
14977
|
+
currency: z.string(),
|
|
14978
|
+
enrollmentOpen: z.boolean()
|
|
14989
14979
|
}).nullable().optional()
|
|
14990
14980
|
});
|
|
14991
|
-
z
|
|
14992
|
-
const unsupportedEventRegistrationPageSurfaceSubjectSchema = z
|
|
14993
|
-
kind: z
|
|
14994
|
-
reason: z
|
|
14981
|
+
z.array(publicEventSchema);
|
|
14982
|
+
const unsupportedEventRegistrationPageSurfaceSubjectSchema = z.object({
|
|
14983
|
+
kind: z.literal("unsupported"),
|
|
14984
|
+
reason: z.enum([
|
|
14995
14985
|
"unsupportedSubject",
|
|
14996
14986
|
"invalidEventSeriesId",
|
|
14997
14987
|
"invalidEventOfferingId"
|
|
14998
14988
|
])
|
|
14999
14989
|
});
|
|
15000
|
-
z
|
|
14990
|
+
z.unknown().transform((value, ctx) => {
|
|
15001
14991
|
const unsupported = unsupportedEventRegistrationPageSurfaceSubjectSchema.safeParse(value);
|
|
15002
14992
|
if (unsupported.success) return unsupported.data;
|
|
15003
14993
|
const parsed = parseEventPageSurfaceSubject(value);
|
|
15004
14994
|
if (parsed.ok) return parsed.value;
|
|
15005
14995
|
ctx.addIssue({
|
|
15006
|
-
code: z
|
|
14996
|
+
code: z.ZodIssueCode.custom,
|
|
15007
14997
|
message: `Invalid event page-surface subject (${parsed.error.kind})`
|
|
15008
14998
|
});
|
|
15009
|
-
return z
|
|
14999
|
+
return z.NEVER;
|
|
15010
15000
|
});
|
|
15011
15001
|
function parseEventRegistrationPageSurfaceSubject(value) {
|
|
15012
15002
|
return parseEventPageSurfaceSubject(value);
|