@riverbankcms/sdk 0.62.2 → 0.62.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_dts/api/src/accessAdmin.d.ts +7 -0
- package/dist/_dts/api/src/bookingClosures.d.ts +106 -0
- package/dist/_dts/api/src/bookingManagementEndpoints.d.ts +18 -0
- package/dist/_dts/api/src/bookingRecords.d.ts +1 -1
- package/dist/_dts/api/src/calendar.d.ts +11 -1
- package/dist/_dts/api/src/contentRuntime.d.ts +2 -0
- package/dist/_dts/api/src/contentVersionHistory.d.ts +52 -0
- package/dist/_dts/api/src/contentVersionHistoryClient.d.ts +45 -0
- package/dist/_dts/api/src/endpoints.d.ts +110 -6
- package/dist/_dts/api/src/index.d.ts +4 -1
- package/dist/_dts/api/src/siteManagementEndpoints.d.ts +31 -7
- package/dist/_dts/api/src/siteMembers.d.ts +10 -1
- package/dist/_dts/api/src/siteRuntimeEndpoints.d.ts +33 -12
- package/dist/_dts/api/src/types.d.ts +2 -1
- package/dist/_dts/api/src/url.d.ts +3 -3
- package/dist/_dts/blocks/src/bindings/index.d.ts +2 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/newsletter-form.client.state.d.ts +12 -0
- package/dist/_dts/blocks/src/system/runtime/shared/components/FieldValidationMessage.d.ts +19 -0
- package/dist/_dts/blocks/src/system/runtime/shared/components/TerminalPanel.d.ts +8 -2
- package/dist/_dts/blocks/src/system/runtime/shared/components/index.d.ts +3 -1
- package/dist/_dts/blocks/src/system/runtime/shared/index.d.ts +2 -2
- package/dist/_dts/blocks/src/system/transforms/registry/_utils/themeColorResolution.d.ts +7 -0
- package/dist/_dts/content-editor/src/hooks/useDebouncedLatestSave.d.ts +24 -0
- package/dist/_dts/content-editor/src/index.d.ts +1 -0
- package/dist/_dts/content-editor/src/ui/stores/autosaveStore.d.ts +1 -0
- package/dist/_dts/content-editor/src/ui/stores/types.d.ts +1 -0
- package/dist/_dts/db/src/generated/supabase/database.types.d.ts +208 -0
- package/dist/_dts/db/src/schemas/forms.d.ts +1 -0
- package/dist/_dts/preview-next/src/client/blocks/BlockToolbar.d.ts +2 -1
- package/dist/_dts/preview-next/src/client/blocks/composer/composePageFromBlocks.d.ts +2 -1
- package/dist/_dts/preview-next/src/client/blocks/composer/index.d.ts +2 -2
- package/dist/_dts/preview-next/src/client/blocks/composer/mergeDrafts.d.ts +2 -1
- package/dist/_dts/preview-next/src/client/blocks/composer/types.d.ts +31 -8
- package/dist/_dts/preview-next/src/client/blocks/pageDesignRuntimePreview.d.ts +6 -5
- package/dist/_dts/preview-next/src/client/blocks/previewProjection/aiProposalProjection.d.ts +7 -0
- package/dist/_dts/preview-next/src/client/blocks/previewProjection/applyPreviewProjections.d.ts +7 -0
- package/dist/_dts/preview-next/src/client/blocks/previewProjection/index.d.ts +4 -0
- package/dist/_dts/preview-next/src/client/blocks/previewProjection/runtimeContentDecoration.d.ts +5 -0
- package/dist/_dts/preview-next/src/client/blocks/previewProjection/types.d.ts +72 -0
- package/dist/_dts/preview-next/src/client/index.d.ts +1 -1
- package/dist/_dts/preview-next/src/client/layout/PreviewLayoutContext.d.ts +6 -5
- package/dist/_dts/preview-next/src/client/preview/PageDesignEditorStateContext.d.ts +2 -1
- package/dist/_dts/preview-next/src/client/preview/PreviewEditorSidebar.d.ts +11 -1
- package/dist/_dts/preview-next/src/client/preview/PreviewShell.d.ts +9 -5
- package/dist/_dts/preview-next/src/client/preview/PreviewShellLayout.d.ts +6 -1
- package/dist/_dts/preview-next/src/client/preview/StyleConfigurator.d.ts +13 -2
- package/dist/_dts/preview-next/src/client/preview/StyleConfigurator.state.d.ts +7 -1
- package/dist/_dts/preview-next/src/client/preview/previewCustomizeControlStyles.d.ts +1 -0
- package/dist/_dts/preview-next/src/client/preview/previewCustomizeHistory.d.ts +1 -0
- package/dist/_dts/preview-next/src/client/preview/previewCustomizeRuntimePatch.d.ts +9 -1
- package/dist/_dts/preview-next/src/client/preview/previewCustomizeWorkflowState.d.ts +13 -0
- package/dist/_dts/preview-next/src/client/preview/sidebarTabPreference.d.ts +8 -2
- package/dist/_dts/preview-next/src/client/preview/siteChromeLookRows.d.ts +49 -0
- package/dist/_dts/sdk/src/public-api/contracts.d.ts +3 -1
- package/dist/_dts/sdk/src/version.d.ts +1 -1
- package/dist/_dts/surfaces/src/index.d.ts +1 -0
- package/dist/_dts/theme-core/src/generated/containerResponsiveThemeCss.d.ts +1 -1
- package/dist/_dts/theme-core/src/index.d.ts +1 -1
- package/dist/_dts/theme-core/src/palette/variants/types.d.ts +2 -21
- package/dist/_dts/theme-core/src/site-styles/appearancePresetCatalog.d.ts +3 -67
- package/dist/_dts/theme-core/src/site-styles/appearancePresetTypes.d.ts +4 -62
- package/dist/_dts/theme-core/src/site-styles/appearancePresets.d.ts +1 -1
- package/dist/_dts/theme-core/src/site-styles/curatedSiteStyles.d.ts +24 -0
- package/dist/_dts/theme-core/src/site-styles/customizableSurfaces.d.ts +94 -0
- package/dist/_dts/theme-core/src/site-styles/footerLooks.d.ts +59 -0
- package/dist/_dts/theme-core/src/site-styles/generatedDesignPipeline.d.ts +4 -0
- package/dist/_dts/theme-core/src/site-styles/headerCtaVariants.d.ts +3 -0
- package/dist/_dts/theme-core/src/site-styles/headerLooks.d.ts +155 -0
- package/dist/_dts/theme-core/src/site-styles/headerOpeningSection.d.ts +15 -0
- package/dist/_dts/theme-core/src/site-styles/index.d.ts +6 -0
- package/dist/_dts/theme-core/src/site-styles/pageDesignAuthority.d.ts +7 -0
- package/dist/_dts/theme-core/src/site-styles/pageDesignEditorModel.d.ts +25 -0
- package/dist/_dts/theme-core/src/site-styles/previewCompiler.d.ts +15 -1
- package/dist/_dts/theme-core/src/site-styles/records.d.ts +1 -0
- package/dist/_dts/theme-core/src/site-styles/siteStyleBlockPolicies.d.ts +96 -0
- package/dist/_dts/theme-core/src/site-styles/types.d.ts +1 -2
- package/dist/_dts/theme-core/src/siteChrome.d.ts +44 -2
- package/dist/_dts/theme-core/src/tokens/colorTokenParts.d.ts +13 -0
- package/dist/_dts/theme-core/src/tokens/index.d.ts +2 -0
- package/dist/_dts/theme-core/src/tokens/themeColorTokens.d.ts +29 -0
- package/dist/_dts/theme-core/src/utils/tokenOrColor.d.ts +27 -1
- package/dist/cli/index.mjs +1139 -471
- package/dist/client/bookings.mjs +519 -368
- package/dist/client/client.mjs +4507 -3535
- package/dist/client/hooks.mjs +2634 -2035
- package/dist/client/rendering/client.mjs +4413 -3549
- package/dist/client/rendering/islands.mjs +3456 -2589
- package/dist/client/rendering.mjs +4921 -3949
- package/dist/preview-next/before-render.mjs +138 -6
- package/dist/preview-next/client/runtime.mjs +3541 -1573
- package/dist/preview-next/editor-base.css +31 -0
- package/dist/preview-next/middleware.mjs +131 -6
- package/dist/server/components.mjs +3214 -2560
- package/dist/server/config-validation.mjs +2859 -2260
- package/dist/server/config.mjs +2859 -2260
- package/dist/server/data.mjs +2634 -2035
- package/dist/server/index.mjs +132 -7
- package/dist/server/next.mjs +2983 -2329
- package/dist/server/page-converter.mjs +2478 -2029
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/rendering/server.mjs +3214 -2560
- package/dist/server/rendering.mjs +3233 -2579
- package/dist/server/routing.mjs +2725 -2028
- package/dist/server/server.mjs +2636 -2037
- package/dist/server/theme-bridge.mjs +1250 -767
- package/dist/server/theme.mjs +623 -498
- package/dist/styles/index.css +33 -0
- package/package.json +1 -1
- package/dist/_dts/blocks/src/system/transforms/registry/_utils/colorResolution.d.ts +0 -13
- package/dist/_dts/preview-next/src/client/blocks/overlay.d.ts +0 -30
- package/dist/_dts/theme-core/src/site-styles/siteChromeAppearancePresets.d.ts +0 -67
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { BlockDesignPlan, DesignBlockId, ResolvedBlockDesignPlan } from './types';
|
|
2
|
+
import type { HeaderLookId, HeaderOpeningSectionContext } from './headerLooks';
|
|
3
|
+
export type HeaderOpeningSectionRepair = 'promote-opening-hero-surface' | 'add-opening-contrast-overlay' | 'add-opening-top-spacing';
|
|
4
|
+
export type HeaderOpeningSectionPlan<TBlockId extends DesignBlockId = DesignBlockId> = Readonly<{
|
|
5
|
+
plan: readonly BlockDesignPlan<TBlockId>[];
|
|
6
|
+
repairs: readonly HeaderOpeningSectionRepair[];
|
|
7
|
+
}>;
|
|
8
|
+
export declare function planGeneratedHeaderOpeningSection<TBlockId extends DesignBlockId>(input: Readonly<{
|
|
9
|
+
plan: readonly BlockDesignPlan<TBlockId>[];
|
|
10
|
+
recommendedHeaderLookIds: readonly HeaderLookId[];
|
|
11
|
+
}>): HeaderOpeningSectionPlan<TBlockId>;
|
|
12
|
+
export declare function deriveHeaderOpeningSectionContext(input: Readonly<{
|
|
13
|
+
openingBlock: ResolvedBlockDesignPlan | null;
|
|
14
|
+
openingContent?: Record<string, unknown> | null;
|
|
15
|
+
}>): HeaderOpeningSectionContext;
|
|
@@ -5,9 +5,13 @@ export * from './contentTemplateDesignIntent';
|
|
|
5
5
|
export * from './contentTemplateRuntimeCompiler';
|
|
6
6
|
export * from './curatedChoices';
|
|
7
7
|
export * from './curatedSiteStyles';
|
|
8
|
+
export * from './customizableSurfaces';
|
|
8
9
|
export * from './designState';
|
|
10
|
+
export * from './footerLooks';
|
|
9
11
|
export * from './generatedSchemas';
|
|
10
12
|
export * from './generatedDesignPipeline';
|
|
13
|
+
export * from './headerLooks';
|
|
14
|
+
export * from './headerOpeningSection';
|
|
11
15
|
export * from './lookResolution';
|
|
12
16
|
export * from './pageDesignAuthority';
|
|
13
17
|
export * from './pageDesignEditorErrors';
|
|
@@ -15,8 +19,10 @@ export * from './pageDesignEditorModel';
|
|
|
15
19
|
export * from './pageDesignIntent';
|
|
16
20
|
export * from './previewCustomization';
|
|
17
21
|
export * from './rawStyleFields';
|
|
22
|
+
export * from './records';
|
|
18
23
|
export * from './resolver';
|
|
19
24
|
export * from './runtimeCompiler';
|
|
25
|
+
export * from './siteStyleBlockPolicies';
|
|
20
26
|
export * from './sourceCatalogs';
|
|
21
27
|
export * from './styleTags';
|
|
22
28
|
export * from './tokenRecipes';
|
|
@@ -36,6 +36,9 @@ export type PageDesignPublishPlan = Readonly<{
|
|
|
36
36
|
/** Persisted as content_versions.data for the page-owned published design row. */
|
|
37
37
|
versionData: PublishedPageDesignVersionDataV1;
|
|
38
38
|
}>;
|
|
39
|
+
export type PublishedPageDesignVersionDataPlan = Result<PublishedPageDesignVersionDataV1, Extract<PageDesignPublishBlocker, {
|
|
40
|
+
kind: 'missing-published-block-content';
|
|
41
|
+
}>>;
|
|
39
42
|
export type PageDesignRuntimePairingIssue = Readonly<{
|
|
40
43
|
kind: 'missing-current-block';
|
|
41
44
|
persisted: PublishedPageBlockSnapshot;
|
|
@@ -258,6 +261,10 @@ export declare function buildPageDesignPublishPlan(input: Readonly<{
|
|
|
258
261
|
authority: PageDesignAuthority;
|
|
259
262
|
blockSequence: readonly PageBlockSnapshot[];
|
|
260
263
|
}>): Result<PageDesignPublishPlan, PageDesignPublishBlocker>;
|
|
264
|
+
export declare function buildPublishedPageDesignVersionData(input: Readonly<{
|
|
265
|
+
pageId: DesignPageId;
|
|
266
|
+
blockSequence: readonly PageBlockSnapshot[];
|
|
267
|
+
}>): PublishedPageDesignVersionDataPlan;
|
|
261
268
|
export declare function buildPageDesignRuntimePairingPlan(input: Readonly<{
|
|
262
269
|
versionData: PublishedPageDesignVersionDataV1;
|
|
263
270
|
currentBlockSequence: readonly PageBlockSnapshot[];
|
|
@@ -53,6 +53,10 @@ export type PageDesignEditorLayoutOption = Readonly<{
|
|
|
53
53
|
label: string;
|
|
54
54
|
profile: BlockLayoutDesignProfile;
|
|
55
55
|
}>;
|
|
56
|
+
export type PageDesignEditorLooksForLayout = Readonly<{
|
|
57
|
+
layoutVariantKey: LayoutVariantKey;
|
|
58
|
+
availableLooks: readonly PageDesignEditorLookOption[];
|
|
59
|
+
}>;
|
|
56
60
|
export type PageDesignEditorBlockContentRevision = Readonly<{
|
|
57
61
|
contentId: string | null;
|
|
58
62
|
}>;
|
|
@@ -62,6 +66,7 @@ export type PageDesignEditorBlock<TBlockId extends DesignBlockId = DesignBlockId
|
|
|
62
66
|
contentRevision?: PageDesignEditorBlockContentRevision;
|
|
63
67
|
layout: PageDesignEditorSelection<LayoutVariantKey> | null;
|
|
64
68
|
availableLayouts: readonly PageDesignEditorLayoutOption[];
|
|
69
|
+
availableLooksByLayout: readonly PageDesignEditorLooksForLayout[];
|
|
65
70
|
look: PageDesignEditorChoice<AppearancePresetId>;
|
|
66
71
|
availableLooks: readonly PageDesignEditorLookOption[];
|
|
67
72
|
}>;
|
|
@@ -164,3 +169,23 @@ export declare function resolveVisiblePromotedFieldPathsForEditorBlock(input: Re
|
|
|
164
169
|
block: PageDesignEditorBlock;
|
|
165
170
|
promotedFieldPaths?: readonly string[];
|
|
166
171
|
}>): readonly string[];
|
|
172
|
+
export type PageDesignLayoutLookIntentChange = Readonly<{
|
|
173
|
+
kind: 'preserve-auto';
|
|
174
|
+
}> | Readonly<{
|
|
175
|
+
kind: 'preserve-supported-pin';
|
|
176
|
+
appearancePresetId: AppearancePresetId;
|
|
177
|
+
}> | Readonly<{
|
|
178
|
+
kind: 'reset-incompatible-pin';
|
|
179
|
+
previousAppearancePresetId: AppearancePresetId;
|
|
180
|
+
}>;
|
|
181
|
+
export type PageDesignLayoutLookCompatibilityPlan = Readonly<{
|
|
182
|
+
kind: 'layout-unavailable';
|
|
183
|
+
layoutVariantKey: LayoutVariantKey;
|
|
184
|
+
}> | Readonly<{
|
|
185
|
+
kind: 'layout-supported';
|
|
186
|
+
layout: PageDesignEditorSelection<LayoutVariantKey>;
|
|
187
|
+
availableLooks: readonly PageDesignEditorLookOption[];
|
|
188
|
+
look: PageDesignEditorChoice<AppearancePresetId>;
|
|
189
|
+
lookIntentChange: PageDesignLayoutLookIntentChange;
|
|
190
|
+
}>;
|
|
191
|
+
export declare function planPageDesignLayoutLookCompatibility(block: PageDesignEditorBlock, layoutVariantKey: LayoutVariantKey): PageDesignLayoutLookCompatibilityPlan;
|
|
@@ -3,6 +3,8 @@ import { type Theme } from '../schema';
|
|
|
3
3
|
import { type ButtonPersonalityId } from '../buttons/personalities';
|
|
4
4
|
import { type PaletteOverrides, type PaletteVariantId } from '../palette/variants';
|
|
5
5
|
import { type CuratedSiteStyle } from './curatedSiteStyles';
|
|
6
|
+
import { type FooterLookId, type FooterSelectionContext, type FooterSelectionResult } from './footerLooks';
|
|
7
|
+
import { type HeaderSelectionContext, type HeaderLookId, type HeaderSelectionResult } from './headerLooks';
|
|
6
8
|
import { type CompiledBlockRuntimeFields, type CompiledPageRuntime, type ComponentRuntimeRules, type DesignRuntimeRules, type SemanticSpacing } from './runtimeCompiler';
|
|
7
9
|
import type { AppearancePresetId, DesignBlockId, SiteStyleId } from './types';
|
|
8
10
|
/**
|
|
@@ -16,7 +18,7 @@ import type { AppearancePresetId, DesignBlockId, SiteStyleId } from './types';
|
|
|
16
18
|
export { defineBlockDesignMetadata, type BlockDesignMetadata, type BlockDesignMetadataInput, type BlockDesignMetadataMap, type BlockFlowBoundaryPreference, type BlockFlowContract, type BlockFlowSurfaceBehavior, type BlockFlowWeight, type BlockLayoutBoundaryBias, type BlockLayoutDesignProfile, type BlockLayoutDesignProfileInput, type BlockLayoutFamily, type BlockLayoutVisualWeight, type PageFlowRole, } from './blockFlow';
|
|
17
19
|
export { buildPageDesignEditorReadModel, boundaryOptions, pageFlowPresets, type BoundaryOption, type PageDesignEditorBlock, type PageDesignEditorBoundary, type PageDesignEditorChoice, type PageDesignEditorIssue, type PageDesignEditorReadModel, type PageDesignEditorSelection, type PageFlowPreset, } from './pageDesignEditorModel';
|
|
18
20
|
export { autoDesignChoice, reducePageDesignIntentForUserAction, resolvePageDesignBlockLookChoice, resolvePageDesignBoundaryChoice, userPinnedDesignChoice, type PageDesignChoice, type PageDesignIntent, type PageDesignUserAction, } from './pageDesignIntent';
|
|
19
|
-
export { repairDesignIssue, resolveBlockDesignPlan
|
|
21
|
+
export { repairDesignIssue, resolveBlockDesignPlan } from './resolver';
|
|
20
22
|
export { cycleableOptionsFromResolved, deriveDesignCustomizationScope, recommendedDesignOption, type CycleableDesignOption, type CycleableOptions, type DesignCustomizationAuthority, type DesignCustomizationScope, type DesignCustomizationSurface, type DesignCustomizationUnsupportedReason, type DesignOptionIssue, type ResolvedDesignOption, } from './previewCustomization';
|
|
21
23
|
export { compileBlockRuntimeFields, compilePageRuntimeFields, compileTokenRecipes, compiledRuntimeStyleFieldNames, defaultComponentRuntimeRules, defaultDesignRuntimeRules, stripCompiledRuntimeStyleFields, type CompiledBlockRuntime, type CompiledBlockRuntimeFields, type CompiledPageRuntime, type CompileBlockRuntimeInput, type ComponentRuntimeRules, type DesignRuntimeRules, type SemanticSpacing, } from './runtimeCompiler';
|
|
22
24
|
export { defaultCuratedChoice, requireEntriesForCuratedChoices, resolveCuratedChoice, type CuratedChoice, type CuratedChoiceResolution, } from './curatedChoices';
|
|
@@ -52,13 +54,25 @@ export type SiteThemeSelectionsInput = Readonly<{
|
|
|
52
54
|
buttonPersonalityId: ButtonPersonalityId | null;
|
|
53
55
|
paletteVariantId: PaletteVariantId | null;
|
|
54
56
|
paletteOverrides: PaletteOverrides | null;
|
|
57
|
+
headerLookId?: HeaderLookId | null;
|
|
58
|
+
footerLookId?: FooterLookId | null;
|
|
59
|
+
headerSelectionContext?: Partial<HeaderSelectionContext>;
|
|
60
|
+
footerSelectionContext?: Partial<FooterSelectionContext>;
|
|
55
61
|
}>;
|
|
56
62
|
export type SiteThemeSelectionsResult = Readonly<{
|
|
57
63
|
theme: CuratedSiteStyleTheme;
|
|
64
|
+
requestedSelections: Readonly<{
|
|
65
|
+
headerLookId: HeaderLookId | null;
|
|
66
|
+
footerLookId: FooterLookId | null;
|
|
67
|
+
}>;
|
|
58
68
|
resolvedSelections: Readonly<{
|
|
59
69
|
buttonPersonalityId: ButtonPersonalityId;
|
|
60
70
|
paletteVariantId: PaletteVariantId;
|
|
71
|
+
headerLookId: HeaderLookId;
|
|
72
|
+
footerLookId: FooterLookId;
|
|
61
73
|
}>;
|
|
74
|
+
headerSelection: HeaderSelectionResult;
|
|
75
|
+
footerSelection: FooterSelectionResult;
|
|
62
76
|
warnings: ReadonlyArray<SelectionFallbackWarning>;
|
|
63
77
|
}>;
|
|
64
78
|
/**
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isRecord(value: unknown): value is Record<string, unknown>;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import type { BlockLayoutDesignProfile } from './blockFlow';
|
|
2
|
+
import { autoDesignChoice, type PageDesignBlockDescriptor, type PageDesignIntent, type PageDesignUserPinnedChoice } from './pageDesignIntent';
|
|
3
|
+
import { type AppearancePresetId, type BoundaryOptionId, type DesignBlockId, type LayoutVariantKey, type SiteStyleId } from './types';
|
|
4
|
+
export declare const defaultPolicyPageFlowPresetId: import("@riverbankcms/blocks").PageFlowPresetId;
|
|
5
|
+
export type OpenSiteStyleBlockPolicy = Readonly<{
|
|
6
|
+
kind: 'open';
|
|
7
|
+
}>;
|
|
8
|
+
export type LockedLookAndLayoutsSiteStyleBlockPolicy = Readonly<{
|
|
9
|
+
kind: 'locked-look-and-layouts';
|
|
10
|
+
blockKind: string;
|
|
11
|
+
lookId: AppearancePresetId;
|
|
12
|
+
allowedLayoutVariantKeys: readonly LayoutVariantKey[];
|
|
13
|
+
defaultLayoutVariantKey: LayoutVariantKey;
|
|
14
|
+
defaultBoundaryAfter?: Readonly<{
|
|
15
|
+
optionId: BoundaryOptionId;
|
|
16
|
+
mode: 'default-only';
|
|
17
|
+
}>;
|
|
18
|
+
customize: Readonly<{
|
|
19
|
+
hideDisallowedLooks: true;
|
|
20
|
+
hideDisallowedLayouts: true;
|
|
21
|
+
}>;
|
|
22
|
+
}>;
|
|
23
|
+
export type SiteStyleBlockPolicy = OpenSiteStyleBlockPolicy | LockedLookAndLayoutsSiteStyleBlockPolicy;
|
|
24
|
+
type RegisteredSiteStyleBlockPolicy = LockedLookAndLayoutsSiteStyleBlockPolicy & Readonly<{
|
|
25
|
+
siteStyleId: SiteStyleId;
|
|
26
|
+
}>;
|
|
27
|
+
export type BlockPolicyDescriptor<TBlockId extends DesignBlockId = DesignBlockId> = PageDesignBlockDescriptor<TBlockId> & Readonly<{
|
|
28
|
+
currentLayoutVariantKey?: LayoutVariantKey | null;
|
|
29
|
+
layoutProfiles?: readonly BlockLayoutDesignProfile[] | null;
|
|
30
|
+
}>;
|
|
31
|
+
export type BlockContentVariantPolicyPlan = Readonly<{
|
|
32
|
+
kind: 'unchanged';
|
|
33
|
+
}> | Readonly<{
|
|
34
|
+
kind: 'set-variant';
|
|
35
|
+
variantKey: LayoutVariantKey;
|
|
36
|
+
}>;
|
|
37
|
+
export type PageDesignPolicyAuditIssue<TBlockId extends DesignBlockId = DesignBlockId> = Readonly<{
|
|
38
|
+
kind: 'missing-page-design-authority';
|
|
39
|
+
siteStyleId: SiteStyleId;
|
|
40
|
+
policyBlockCount: number;
|
|
41
|
+
}> | Readonly<{
|
|
42
|
+
kind: 'missing-required-look-pin';
|
|
43
|
+
blockId: TBlockId;
|
|
44
|
+
blockKind: string;
|
|
45
|
+
requiredLookId: AppearancePresetId;
|
|
46
|
+
}> | Readonly<{
|
|
47
|
+
kind: 'unsupported-look-pin';
|
|
48
|
+
blockId: TBlockId;
|
|
49
|
+
blockKind: string;
|
|
50
|
+
actualLookId: AppearancePresetId;
|
|
51
|
+
requiredLookId: AppearancePresetId;
|
|
52
|
+
}> | Readonly<{
|
|
53
|
+
kind: 'unsupported-layout-variant';
|
|
54
|
+
blockId: TBlockId;
|
|
55
|
+
blockKind: string;
|
|
56
|
+
actualLayoutVariantKey: LayoutVariantKey;
|
|
57
|
+
defaultLayoutVariantKey: LayoutVariantKey;
|
|
58
|
+
}>;
|
|
59
|
+
export declare function siteStyleBlockPolicies(): readonly RegisteredSiteStyleBlockPolicy[];
|
|
60
|
+
export declare function buildInitialPolicyPageDesignIntent(siteStyleId: SiteStyleId): PageDesignIntent;
|
|
61
|
+
export declare function hasPolicyForBlocks(input: Readonly<{
|
|
62
|
+
siteStyleId: SiteStyleId;
|
|
63
|
+
blocks: readonly PageDesignBlockDescriptor[];
|
|
64
|
+
}>): boolean;
|
|
65
|
+
export declare function deriveSiteStyleBlockPolicy(input: Readonly<{
|
|
66
|
+
siteStyleId: SiteStyleId;
|
|
67
|
+
blockKind: string;
|
|
68
|
+
}>): SiteStyleBlockPolicy;
|
|
69
|
+
export declare function isLayoutVariantAllowedByPolicy(policy: SiteStyleBlockPolicy, layoutVariantKey: LayoutVariantKey): boolean;
|
|
70
|
+
export declare function normalizeLayoutVariantForPolicy(policy: SiteStyleBlockPolicy, layoutVariantKey: LayoutVariantKey | null | undefined): LayoutVariantKey | null;
|
|
71
|
+
export declare function filterLayoutProfilesForPolicy(policy: SiteStyleBlockPolicy, layoutProfiles: readonly BlockLayoutDesignProfile[]): readonly BlockLayoutDesignProfile[];
|
|
72
|
+
export declare function isLookAllowedByPolicy(policy: SiteStyleBlockPolicy, lookId: AppearancePresetId): boolean;
|
|
73
|
+
export declare function filterLookIdsForPolicy<TLook extends Readonly<{
|
|
74
|
+
id: AppearancePresetId;
|
|
75
|
+
}>>(policy: SiteStyleBlockPolicy, looks: readonly TLook[]): readonly TLook[];
|
|
76
|
+
export declare function applySiteStyleBlockPoliciesToPageDesignIntent<TBlockId extends DesignBlockId>(intent: PageDesignIntent<TBlockId>, blocks: readonly PageDesignBlockDescriptor<TBlockId>[]): PageDesignIntent<TBlockId>;
|
|
77
|
+
export declare function planBlockContentVariantPolicyUpdate(input: Readonly<{
|
|
78
|
+
policy: SiteStyleBlockPolicy;
|
|
79
|
+
content: Readonly<Record<string, unknown>>;
|
|
80
|
+
}>): BlockContentVariantPolicyPlan;
|
|
81
|
+
export declare function applyBlockContentVariantPolicy(input: Readonly<{
|
|
82
|
+
policy: SiteStyleBlockPolicy;
|
|
83
|
+
content: Readonly<Record<string, unknown>>;
|
|
84
|
+
}>): Readonly<Record<string, unknown>>;
|
|
85
|
+
export declare function auditPageDesignIntentPolicy<TBlockId extends DesignBlockId>(input: Readonly<{
|
|
86
|
+
intent: PageDesignIntent<TBlockId>;
|
|
87
|
+
blocks: readonly BlockPolicyDescriptor<TBlockId>[];
|
|
88
|
+
}>): readonly PageDesignPolicyAuditIssue<TBlockId>[];
|
|
89
|
+
export declare function auditPageDesignAuthorityPolicy<TBlockId extends DesignBlockId>(input: Readonly<{
|
|
90
|
+
siteStyleId: SiteStyleId;
|
|
91
|
+
intent: PageDesignIntent<TBlockId> | null;
|
|
92
|
+
blocks: readonly BlockPolicyDescriptor<TBlockId>[];
|
|
93
|
+
}>): readonly PageDesignPolicyAuditIssue<TBlockId>[];
|
|
94
|
+
export declare function assertRegisteredSiteStyleBlockPoliciesAreValid(): void;
|
|
95
|
+
export declare function autoChoiceAllowedByPolicy(policy: SiteStyleBlockPolicy): ReturnType<typeof autoDesignChoice> | PageDesignUserPinnedChoice<AppearancePresetId>;
|
|
96
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Theme } from '../schema';
|
|
2
|
-
type Brand<T, TBrand extends string> = T & {
|
|
2
|
+
export type Brand<T, TBrand extends string> = T & {
|
|
3
3
|
readonly __brand: TBrand;
|
|
4
4
|
};
|
|
5
5
|
export type DesignBlockId = Brand<string, 'DesignBlockId'>;
|
|
@@ -635,4 +635,3 @@ export type SiteStyleSwitchResult<TBlockId extends string = DesignBlockId, TPurp
|
|
|
635
635
|
incompatibleBlockIds: readonly TBlockId[];
|
|
636
636
|
fallbackBlockIds: readonly TBlockId[];
|
|
637
637
|
}>;
|
|
638
|
-
export {};
|
|
@@ -1,11 +1,53 @@
|
|
|
1
|
-
import { type ReactNode } from "react";
|
|
1
|
+
import React, { type ReactNode } from "react";
|
|
2
2
|
import type { Theme } from "./schema";
|
|
3
|
-
export type SiteTopShellBehavior = "normal-flow" | "shared-sticky-shell";
|
|
3
|
+
export type SiteTopShellBehavior = "normal-flow" | "shared-sticky-shell" | "banner-above-overlay-header";
|
|
4
|
+
export type SiteTopShellPlan = Readonly<{
|
|
5
|
+
behavior: "normal-flow";
|
|
6
|
+
contentStartsUnderHeader: boolean;
|
|
7
|
+
requiresHeaderOffset: false;
|
|
8
|
+
}> | Readonly<{
|
|
9
|
+
behavior: "shared-sticky-shell";
|
|
10
|
+
contentStartsUnderHeader: false;
|
|
11
|
+
requiresHeaderOffset: false;
|
|
12
|
+
}> | Readonly<{
|
|
13
|
+
behavior: "banner-above-overlay-header";
|
|
14
|
+
contentStartsUnderHeader: true;
|
|
15
|
+
requiresHeaderOffset: true;
|
|
16
|
+
}>;
|
|
4
17
|
export type SiteChromeLayoutNodes = Readonly<{
|
|
5
18
|
headerNode: ReactNode;
|
|
6
19
|
bannerNode?: ReactNode;
|
|
7
20
|
bannerShellBehavior?: SiteTopShellBehavior;
|
|
8
21
|
footerNode: ReactNode;
|
|
9
22
|
}>;
|
|
23
|
+
type HeaderPositioning = NonNullable<Theme["header"]>["positioning"];
|
|
24
|
+
export type SiteDocumentLayoutMode = "normal-flow" | "header-overlay";
|
|
25
|
+
export type SiteDocumentPlan = Readonly<{
|
|
26
|
+
topShell: SiteTopShellPlan;
|
|
27
|
+
layoutMode: SiteDocumentLayoutMode;
|
|
28
|
+
}>;
|
|
29
|
+
export type SiteDocumentPlanInput = Readonly<{
|
|
30
|
+
headerPositioning: HeaderPositioning;
|
|
31
|
+
headerVariant?: Theme["header"]["variant"] | null;
|
|
32
|
+
hasVisibleBanner: boolean;
|
|
33
|
+
}>;
|
|
34
|
+
export type SiteDocumentLayoutProps = Omit<SiteChromeLayoutNodes, "bannerShellBehavior"> & Readonly<{
|
|
35
|
+
plan: SiteDocumentPlan;
|
|
36
|
+
children: ReactNode;
|
|
37
|
+
as?: "div" | "main";
|
|
38
|
+
role?: string;
|
|
39
|
+
className?: string | null;
|
|
40
|
+
minHeightClassName?: string | null;
|
|
41
|
+
contentClassName?: string | null;
|
|
42
|
+
style?: React.CSSProperties;
|
|
43
|
+
}>;
|
|
10
44
|
export declare function getStandaloneHeaderShellClassName(theme: Theme): string | null;
|
|
11
45
|
export declare function renderSiteTopChrome({ headerNode, bannerNode, bannerShellBehavior, }: Pick<SiteChromeLayoutNodes, "headerNode" | "bannerNode" | "bannerShellBehavior">): ReactNode;
|
|
46
|
+
export declare function planSiteDocument(input: SiteDocumentPlanInput): SiteDocumentPlan;
|
|
47
|
+
export declare function SiteDocumentLayout({ plan, headerNode, bannerNode, footerNode, children, as: Root, role, className, minHeightClassName, contentClassName, style, }: SiteDocumentLayoutProps): React.ReactElement;
|
|
48
|
+
export declare function planSiteTopShell(input: Readonly<{
|
|
49
|
+
headerPositioning: HeaderPositioning;
|
|
50
|
+
headerVariant?: Theme["header"]["variant"] | null;
|
|
51
|
+
hasVisibleBanner: boolean;
|
|
52
|
+
}>): SiteTopShellPlan;
|
|
53
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type ColorTokenParts = {
|
|
2
|
+
readonly kind: 'token';
|
|
3
|
+
readonly token: string;
|
|
4
|
+
readonly opacityPercent: number | null;
|
|
5
|
+
} | {
|
|
6
|
+
readonly kind: 'raw';
|
|
7
|
+
readonly value: string;
|
|
8
|
+
} | {
|
|
9
|
+
readonly kind: 'invalid';
|
|
10
|
+
readonly token: string;
|
|
11
|
+
};
|
|
12
|
+
export declare function parseOpacityPercent(source: string): number | null;
|
|
13
|
+
export declare function parseColorTokenParts(source: string): ColorTokenParts;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Known palette role token names. This is the low-level source of truth for
|
|
4
|
+
* palette roles used by palette variants, Theme V2 schemas, and runtime color
|
|
5
|
+
* reference parsing.
|
|
6
|
+
*/
|
|
7
|
+
export declare const PALETTE_TOKEN_NAMES: readonly ["primary", "primaryForeground", "secondary", "accent", "success", "warning", "destructive", "background", "surface", "surfaceAlt", "muted", "text", "border"];
|
|
8
|
+
export type PaletteTokenName = (typeof PALETTE_TOKEN_NAMES)[number];
|
|
9
|
+
export declare const paletteTokenNameSchema: z.ZodEnum<{
|
|
10
|
+
success: "success";
|
|
11
|
+
text: "text";
|
|
12
|
+
surface: "surface";
|
|
13
|
+
warning: "warning";
|
|
14
|
+
border: "border";
|
|
15
|
+
background: "background";
|
|
16
|
+
primary: "primary";
|
|
17
|
+
secondary: "secondary";
|
|
18
|
+
primaryForeground: "primaryForeground";
|
|
19
|
+
accent: "accent";
|
|
20
|
+
destructive: "destructive";
|
|
21
|
+
surfaceAlt: "surfaceAlt";
|
|
22
|
+
muted: "muted";
|
|
23
|
+
}>;
|
|
24
|
+
export type ThemeColorToken = string & {
|
|
25
|
+
readonly __brand: 'ThemeColorToken';
|
|
26
|
+
};
|
|
27
|
+
export declare function isThemeColorToken(value: unknown): value is ThemeColorToken;
|
|
28
|
+
export declare function parseThemeColorToken(value: unknown): ThemeColorToken | null;
|
|
29
|
+
export declare const themeColorTokenSchema: z.ZodString;
|
|
@@ -1,10 +1,36 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { type ThemeColorToken } from '../tokens/themeColorTokens';
|
|
1
3
|
export type TokenOrColor = string;
|
|
4
|
+
/**
|
|
5
|
+
* Runtime color-reference fields intentionally accept any string, including
|
|
6
|
+
* the legacy empty-string "no color" sentinel. Semantic validation needs
|
|
7
|
+
* palette context and happens in `parseThemeColorReference`.
|
|
8
|
+
*/
|
|
9
|
+
export declare const tokenOrCssColorValueSchema: z.ZodString;
|
|
10
|
+
export type PaletteContextColorToken = string & {
|
|
11
|
+
readonly __brand: 'PaletteContextColorToken';
|
|
12
|
+
};
|
|
13
|
+
export type ThemeColorReference = {
|
|
14
|
+
kind: 'theme-token';
|
|
15
|
+
token: ThemeColorToken;
|
|
16
|
+
} | {
|
|
17
|
+
kind: 'palette-context-token';
|
|
18
|
+
token: PaletteContextColorToken;
|
|
19
|
+
} | {
|
|
20
|
+
kind: 'literal-css';
|
|
21
|
+
value: string;
|
|
22
|
+
};
|
|
23
|
+
export type ThemeColorReferenceContext = {
|
|
24
|
+
palette?: Readonly<Record<string, string>>;
|
|
25
|
+
};
|
|
2
26
|
type ParsedToken = {
|
|
3
27
|
role: string;
|
|
4
28
|
shade: number | null;
|
|
5
29
|
};
|
|
6
30
|
export declare function isCssColorLiteral(value: string): boolean;
|
|
7
31
|
export declare function parseThemeToken(token: string): ParsedToken;
|
|
8
|
-
export declare function
|
|
32
|
+
export declare function parseThemeColorReference(input: TokenOrColor, context?: ThemeColorReferenceContext): ThemeColorReference;
|
|
33
|
+
export declare function resolveThemeColorReferenceValue(input: TokenOrColor, context?: ThemeColorReferenceContext): string;
|
|
34
|
+
export declare function resolveTokenOrCssColorValue(input: TokenOrColor, context?: ThemeColorReferenceContext): string;
|
|
9
35
|
export declare function resolveOnColorForThemeToken(token: string): string | null;
|
|
10
36
|
export {};
|