@riverbankcms/sdk 0.125.0 → 0.127.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.
Files changed (177) hide show
  1. package/README.md +3 -1
  2. package/dist/{PreviewEditorSidebar-BezDOtQ7.mjs → PreviewEditorSidebar-BXtfF7tp.mjs} +122 -301
  3. package/dist/{PreviewEditorUI-CgSqmfo2.mjs → PreviewEditorUI-Dou73Q0K.mjs} +3 -3
  4. package/dist/{PreviewQueryProvider-BH-3-jSj.mjs → PreviewQueryProvider-DgFDIwvK.mjs} +1 -1
  5. package/dist/{SdkPreviewModeRuntime-Co3AHfj0.mjs → SdkPreviewModeRuntime-B0HPXr-l.mjs} +141 -63
  6. package/dist/{SiteChromeCustomizeContext-BHF-KANn.mjs → SiteChromeCustomizeContext-DZiDBAYu.mjs} +5330 -5841
  7. package/dist/_dts/ai/src/contracts/proposals.d.ts +1552 -202
  8. package/dist/_dts/api/src/common/envelope.d.ts +1 -1
  9. package/dist/_dts/api/src/contentRuntime.d.ts +1 -7
  10. package/dist/_dts/api/src/endpoints.d.ts +0 -7
  11. package/dist/_dts/api/src/sdk-event-upsert.d.ts +42 -0
  12. package/dist/_dts/api/src/sdkContracts.d.ts +11 -9
  13. package/dist/_dts/api/src/siteOperations.d.ts +18 -1
  14. package/dist/_dts/api/src/siteRuntimeEndpoints.d.ts +1 -14
  15. package/dist/_dts/block-form/src/backend/store-backend.d.ts +2 -1
  16. package/dist/_dts/block-form/src/blockDraftSaveability.d.ts +1 -0
  17. package/dist/_dts/blocks/src/index.d.ts +3 -2
  18. package/dist/_dts/blocks/src/lib/media.d.ts +267 -0
  19. package/dist/_dts/blocks/src/system/constants/buttonRoles.d.ts +0 -13
  20. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationStripeReturn.d.ts +15 -2
  21. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/eventCollectionContract.d.ts +4 -4
  22. package/dist/_dts/blocks/src/system/runtime/nodes/mergeResolveImageUrlContexts.d.ts +7 -0
  23. package/dist/_dts/blocks/src/system/runtime/nodes/shared/contract-schemas.d.ts +2 -2
  24. package/dist/_dts/content-editor/src/ui/blockValidationManifestRegistry.d.ts +17 -0
  25. package/dist/_dts/content-editor/src/ui/blockValidationView.d.ts +1 -1
  26. package/dist/_dts/content-editor/src/ui/editorUiStore.d.ts +4 -0
  27. package/dist/_dts/db/src/generated/supabase/database.types.d.ts +322 -171
  28. package/dist/_dts/editor-blocks/src/BlockEditor.d.ts +4 -0
  29. package/dist/_dts/editor-blocks/src/block-editor/hooks/useBlockValidationManifests.d.ts +26 -0
  30. package/dist/_dts/editor-blocks/src/widgets/rich-text/imageInsert.d.ts +3 -3
  31. package/dist/_dts/media-editor/src/MediaEditor.d.ts +2 -2
  32. package/dist/_dts/media-editor/src/context.d.ts +1 -2
  33. package/dist/_dts/media-editor/src/index.d.ts +3 -1
  34. package/dist/_dts/media-editor/src/mediaSelection.d.ts +32 -0
  35. package/dist/_dts/media-editor/src/types.d.ts +3 -1
  36. package/dist/_dts/media-editor/src/useMediaSelection.d.ts +26 -0
  37. package/dist/_dts/preview-next/src/client/index.d.ts +2 -0
  38. package/dist/_dts/preview-next/src/client/preview/HeaderMenuControls.d.ts +12 -0
  39. package/dist/_dts/preview-next/src/client/preview/PreviewEditorSidebar.d.ts +1 -2
  40. package/dist/_dts/preview-next/src/client/preview/PreviewShell.d.ts +13 -3
  41. package/dist/_dts/preview-next/src/client/preview/PreviewShellLayout.d.ts +7 -2
  42. package/dist/_dts/preview-next/src/client/preview/SiteChromeCustomizeContext.d.ts +6 -60
  43. package/dist/_dts/preview-next/src/client/preview/StyleConfigurator.d.ts +3 -13
  44. package/dist/_dts/preview-next/src/client/preview/StyleConfigurator.state.d.ts +8 -100
  45. package/dist/_dts/preview-next/src/client/preview/headerInteractionPaletteSurfaceState.d.ts +8 -0
  46. package/dist/_dts/preview-next/src/client/preview/previewThemeRoles.d.ts +15 -0
  47. package/dist/_dts/preview-next/src/client/preview/siteChromeCustomizeTypes.d.ts +54 -0
  48. package/dist/_dts/preview-next/src/client/preview/siteChromeLookRows.d.ts +13 -3
  49. package/dist/_dts/preview-next/src/client/preview/siteChromeNavQuickControlHistory.d.ts +3 -0
  50. package/dist/_dts/preview-next/src/client/preview/siteChromeQuickControlHistoryState.d.ts +6 -3
  51. package/dist/_dts/preview-next/src/client/preview/siteStylePreviewPlanner.d.ts +1 -4
  52. package/dist/_dts/preview-next/src/client/preview/styleConfiguratorApplyPayload.d.ts +1 -15
  53. package/dist/_dts/preview-next/src/client/preview/styleConfiguratorSnapshot.d.ts +11 -21
  54. package/dist/_dts/sdk/src/cli/commands/event.d.ts +2 -2
  55. package/dist/_dts/sdk/src/cli/commands/eventOccurrenceSchedule.d.ts +12 -0
  56. package/dist/_dts/sdk/src/cli/commands/push/pushAllExtras.d.ts +6 -0
  57. package/dist/_dts/sdk/src/cli/commands/style.d.ts +1 -1
  58. package/dist/_dts/sdk/src/cli/content/legacyEventScheduleShapeError.d.ts +5 -0
  59. package/dist/_dts/sdk/src/cli/content/localEventSchedule.d.ts +17 -0
  60. package/dist/_dts/sdk/src/cli/content/reader.d.ts +5 -10
  61. package/dist/_dts/sdk/src/cli/migrations/events.d.ts +1 -1
  62. package/dist/_dts/sdk/src/cli/site-commands/eventScheduleCompiler.d.ts +24 -0
  63. package/dist/_dts/sdk/src/client/management/http.d.ts +1 -1
  64. package/dist/_dts/sdk/src/client/management/types.d.ts +3 -28
  65. package/dist/_dts/sdk/src/config/index.d.ts +1 -1
  66. package/dist/_dts/sdk/src/public-api/contracts.d.ts +5 -20
  67. package/dist/_dts/sdk/src/rendering/index.d.ts +1 -1
  68. package/dist/_dts/sdk/src/rendering/islands/types.d.ts +2 -2
  69. package/dist/_dts/sdk/src/version.d.ts +1 -1
  70. package/dist/_dts/site-commands/src/commandContract.d.ts +33 -5
  71. package/dist/_dts/site-commands/src/commandDomain.d.ts +2 -2
  72. package/dist/_dts/site-commands/src/commands.d.ts +38 -9
  73. package/dist/_dts/site-commands/src/siteStyleCommandSchema.d.ts +28 -1
  74. package/dist/_dts/site-commands/src/siteStyleSelectionSchemaBuilder.d.ts +4 -4
  75. package/dist/_dts/theme-core/src/buttons/effects/presets/background.d.ts +1 -1
  76. package/dist/_dts/theme-core/src/buttons/styles/registry.d.ts +0 -18
  77. package/dist/_dts/theme-core/src/buttons/types.d.ts +1 -3
  78. package/dist/_dts/theme-core/src/header/containerSchema.d.ts +20 -0
  79. package/dist/_dts/theme-core/src/header/generateHeaderCss.d.ts +1 -1
  80. package/dist/_dts/theme-core/src/header/interactionPalette.d.ts +14 -0
  81. package/dist/_dts/theme-core/src/header/legacyNavLinkStyle.d.ts +3 -0
  82. package/dist/_dts/theme-core/src/header/paintTargets.d.ts +25 -0
  83. package/dist/_dts/theme-core/src/header/scrollTreatment.d.ts +11 -0
  84. package/dist/_dts/theme-core/src/header/surfaceRules.d.ts +9 -0
  85. package/dist/_dts/theme-core/src/mock-themes/all.d.ts +15 -0
  86. package/dist/_dts/theme-core/src/palette/colors.d.ts +1 -1
  87. package/dist/_dts/theme-core/src/palette/concretePalette.d.ts +20 -0
  88. package/dist/_dts/theme-core/src/palette/curated/index.d.ts +2 -17
  89. package/dist/_dts/theme-core/src/palette/index.d.ts +1 -6
  90. package/dist/_dts/theme-core/src/palette/schema.d.ts +39 -0
  91. package/dist/_dts/theme-core/src/schema.d.ts +105 -45
  92. package/dist/_dts/theme-core/src/site-styles/appearancePresetCatalog.d.ts +3 -51
  93. package/dist/_dts/theme-core/src/site-styles/appearancePresetTypes.d.ts +4 -11
  94. package/dist/_dts/theme-core/src/site-styles/blockAppearancePresets.d.ts +3 -51
  95. package/dist/_dts/theme-core/src/site-styles/headerInteractionPalette.d.ts +32 -0
  96. package/dist/_dts/theme-core/src/site-styles/headerLooks.d.ts +19 -106
  97. package/dist/_dts/theme-core/src/site-styles/headerOpeningForeground.d.ts +22 -0
  98. package/dist/_dts/theme-core/src/site-styles/headerOpeningSection.d.ts +2 -0
  99. package/dist/_dts/theme-core/src/site-styles/headerStyleParts.d.ts +4 -0
  100. package/dist/_dts/theme-core/src/site-styles/index.d.ts +3 -0
  101. package/dist/_dts/theme-core/src/site-styles/lookOptionGroups.d.ts +24 -0
  102. package/dist/_dts/theme-core/src/site-styles/lookResolution.d.ts +1 -2
  103. package/dist/_dts/theme-core/src/site-styles/pageDesignEditorModel.d.ts +4 -22
  104. package/dist/_dts/theme-core/src/site-styles/pageDesignEditorOptions.d.ts +21 -0
  105. package/dist/_dts/theme-core/src/site-styles/previewCompiler.d.ts +5 -7
  106. package/dist/_dts/theme-core/src/site-styles/runtimeCompiler.d.ts +5 -6
  107. package/dist/_dts/theme-core/src/site-styles/siteChromeNavPreferences.d.ts +4 -1
  108. package/dist/cli/index.mjs +1583 -1601
  109. package/dist/cli/init-docs/content/cli-reference.md +6 -3
  110. package/dist/cli/init-docs/content/content-management.md +24 -13
  111. package/dist/client/{DiscountCodeDisclosure-CyPpekBp.mjs → DiscountCodeDisclosure-BDFRp8Y7.mjs} +1 -1
  112. package/dist/client/{EventCombined.client-zywit-60.mjs → EventCombined.client-DJgF1_lf.mjs} +2 -2
  113. package/dist/client/{EventListing.client-J2nLhkKT.mjs → EventListing.client-CnWGNjOr.mjs} +2 -2
  114. package/dist/client/{LeafletStaticMap-CSubXWt6.mjs → LeafletStaticMap-BISs9Bl7.mjs} +1 -1
  115. package/dist/client/{MagicLinkForm-DDLIfiq9.mjs → MagicLinkForm-b5E_HoG9.mjs} +1 -1
  116. package/dist/client/{StepIndicator-DE8EvHIp.mjs → StepIndicator-D8gVYkK-.mjs} +2 -2
  117. package/dist/client/{accordion-Ct5T5NiA.mjs → accordion-DFDajgDz.mjs} +1 -1
  118. package/dist/client/{bookingForm-DMxtLPxw.mjs → bookingForm-Bdqj9-52.mjs} +5 -6
  119. package/dist/client/bookings.mjs +315 -46
  120. package/dist/client/{carousel--FMqgvob.mjs → carousel-Cvqf-kN8.mjs} +1 -1
  121. package/dist/client/{cart-BKX1bWiU.mjs → cart-CuH2TJXP.mjs} +3 -3
  122. package/dist/client/{checkout-B_jxi4WW.mjs → checkout-CMNPpejZ.mjs} +3 -3
  123. package/dist/client/client.mjs +1381 -1427
  124. package/dist/client/{courseRegistration-DH4MlkRD.mjs → courseRegistration-DTEYWL6Z.mjs} +6 -7
  125. package/dist/client/{eventCalendar-BQILwAcL.mjs → eventCalendar-BW-XoxZ0.mjs} +4 -4
  126. package/dist/client/{eventCombined-DFFW_Vmo.mjs → eventCombined-Bpn7s0y9.mjs} +2 -2
  127. package/dist/client/{eventDetails-B045CTSJ.mjs → eventDetails-D2uUSTMH.mjs} +3 -3
  128. package/dist/client/{eventListing-BDMYNVzS.mjs → eventListing-CVr1c094.mjs} +2 -2
  129. package/dist/client/{eventRegistration-CQ2-BSnB.mjs → eventRegistration-Dv4AvkMw.mjs} +30 -22
  130. package/dist/client/{form-DJKuyZgN.mjs → form-DxdKf9fs.mjs} +1 -1
  131. package/dist/client/{headerSection-DeTjfiDo.mjs → headerSection-BaXI5Sro.mjs} +2 -2
  132. package/dist/client/hooks.mjs +851 -976
  133. package/dist/client/{locationMap-i2wDA8gB.mjs → locationMap-BEtW2fKz.mjs} +2 -2
  134. package/dist/client/{newsletterForm-DKiueauk.mjs → newsletterForm-BKKs0S4R.mjs} +1 -1
  135. package/dist/client/{pricing-C01J3Epx.mjs → pricing-ClkqcElA.mjs} +1 -1
  136. package/dist/client/{productDetail-Dfc1sZaX.mjs → productDetail-H-ru8dyy.mjs} +3 -3
  137. package/dist/client/{productList-BXbvXWTF.mjs → productList-Buyi5c0C.mjs} +3 -3
  138. package/dist/client/{propsDecoder-CIR5DQ1l.mjs → propsDecoder-BF7i6Ijg.mjs} +293 -65
  139. package/dist/client/rendering/client.mjs +1145 -1190
  140. package/dist/client/rendering/islands.mjs +18 -18
  141. package/dist/client/rendering.mjs +1257 -1298
  142. package/dist/client/{useDiscountCodeUi-Bcyh4508.mjs → scrollToBlock-D_7t8yWb.mjs} +18 -2
  143. package/dist/client/{shop-BbNwPKM-.mjs → shop-CF7SZQNX.mjs} +5 -6
  144. package/dist/client/{shop-commerce-XO-XMFEt.mjs → shop-commerce-DA7_Rq5p.mjs} +4 -4
  145. package/dist/client/{shop-commerce-store-Byh6OUGK.mjs → shop-commerce-store-BmLqW7Gh.mjs} +1 -1
  146. package/dist/client/{shopShared-Bbq39mwr.mjs → shopShared-WL-E1znM.mjs} +2 -2
  147. package/dist/client/{useEventFilters-C8OOJ3el.mjs → useEventFilters-rc8VLeLV.mjs} +2 -2
  148. package/dist/client/{usePolling-CyJVo9kF.mjs → usePolling-1ncrfd4S.mjs} +2 -2
  149. package/dist/preview-next/before-render.mjs +0 -7
  150. package/dist/preview-next/client/runtime.mjs +4 -4
  151. package/dist/preview-next/middleware.mjs +0 -7
  152. package/dist/{previewAuthStore-CJX21dGi.mjs → previewAuthStore-Dev9CdG9.mjs} +0 -7
  153. package/dist/{sdk-runtime-BGhyuE-E.mjs → sdk-runtime-BnrCCFJq.mjs} +2 -2
  154. package/dist/{separator-BFs-Kmv5.mjs → separator-CFvBx2yl.mjs} +1 -1
  155. package/dist/server/components.mjs +1389 -1489
  156. package/dist/server/config-validation.mjs +851 -976
  157. package/dist/server/config.mjs +851 -976
  158. package/dist/server/data.mjs +851 -976
  159. package/dist/server/index.mjs +1 -8
  160. package/dist/server/next.mjs +1393 -1500
  161. package/dist/server/page-converter.mjs +851 -976
  162. package/dist/server/prebuild.mjs +1 -1
  163. package/dist/server/rendering/server.mjs +1346 -1446
  164. package/dist/server/rendering.mjs +1390 -1490
  165. package/dist/server/routing.mjs +939 -1041
  166. package/dist/server/server.mjs +852 -984
  167. package/dist/server/theme-bridge.mjs +322 -279
  168. package/dist/server/theme.mjs +277 -33
  169. package/package.json +1 -1
  170. package/dist/_dts/editor-blocks/src/widgets/rich-text/ensureRichTextImageAssetIdentifier.d.ts +0 -8
  171. package/dist/_dts/theme-core/src/palette/editorState.d.ts +0 -75
  172. package/dist/_dts/theme-core/src/palette/libraryModel.d.ts +0 -64
  173. package/dist/_dts/theme-core/src/palette/persistenceReadSource.d.ts +0 -81
  174. package/dist/_dts/theme-core/src/palette/resolveSelection.d.ts +0 -75
  175. package/dist/_dts/theme-core/src/palette/selection.d.ts +0 -74
  176. package/dist/_dts/theme-core/src/palette/sitePalettePersistence.d.ts +0 -34
  177. package/dist/client/scrollToBlock-C86BYkyV.mjs +0 -17
@@ -23,6 +23,10 @@ type UiState = {
23
23
  isPathEdited: (blockId: Parameters<DraftsSlice['setAtPath']>[0], path: string) => boolean;
24
24
  showAllValidation: (blockId: Parameters<DraftsSlice['setAtPath']>[0]) => boolean;
25
25
  getBlockSaveability: (blockId: Parameters<DraftsSlice['setAtPath']>[0]) => BlockDraftSaveability;
26
+ setValidationManifests: (manifests: readonly Readonly<{
27
+ blockId: Parameters<DraftsSlice['setAtPath']>[0];
28
+ manifest: import('../../blocks/src/index').BlockManifest;
29
+ }>[]) => void;
26
30
  };
27
31
  structure: {
28
32
  getList: () => readonly BlockItem[];
@@ -0,0 +1,26 @@
1
+ import { type BlockManifest, type Theme } from '../../../../blocks/src/index';
2
+ import type { SdkBlockFieldExtensionsMap, SdkBlockFieldOptionsMap } from '../../../../block-form/src/client/index';
3
+ import { type EditorBlockId } from '../../../../core/src/index';
4
+ import type { BlockItem } from '../types';
5
+ import { type CustomBlockRegistryEntry, type SdkConfigForBlockPicker } from '../sdkBlockMerger';
6
+ type ValidationManifestStore = Readonly<{
7
+ getState: () => Readonly<{
8
+ blockValidation: Readonly<{
9
+ setValidationManifests: (entries: readonly Readonly<{
10
+ blockId: EditorBlockId;
11
+ manifest: BlockManifest;
12
+ }>[]) => void;
13
+ }>;
14
+ }>;
15
+ }>;
16
+ export declare function useBlockValidationManifests(input: Readonly<{
17
+ blockList: readonly BlockItem[];
18
+ uiStore: ValidationManifestStore;
19
+ sdkConfig: SdkConfigForBlockPicker | null;
20
+ customBlocks: readonly CustomBlockRegistryEntry[];
21
+ theme?: Theme | null;
22
+ blockFieldOptions: SdkBlockFieldOptionsMap | null;
23
+ blockFieldExtensions: SdkBlockFieldExtensionsMap | null;
24
+ hideThemeV2RawStyleFields: boolean;
25
+ }>): void;
26
+ export {};
@@ -1,4 +1,4 @@
1
- import type { MediaAssetWithLabels } from '@riverbankcms/media-storage-supabase';
1
+ import type { IdentifierReadyMediaAsset } from '../../../../media-editor/src/index';
2
2
  export declare const RICH_TEXT_IMAGE_MAX_WIDTH = 1920;
3
3
  export declare const RICH_TEXT_IMAGE_QUALITY = 85;
4
4
  export type RichTextImageInsertAttrs = {
@@ -9,9 +9,9 @@ export type RichTextImageInsertAttrs = {
9
9
  height?: number;
10
10
  };
11
11
  type BuildRichTextImageInsertAttrsArgs = {
12
- asset: MediaAssetWithLabels;
12
+ asset: IdentifierReadyMediaAsset;
13
13
  supabaseUrl?: string | null;
14
14
  fallbackSrc?: string | null;
15
15
  };
16
- export declare function buildRichTextImageInsertAttrs({ asset, supabaseUrl, fallbackSrc, }: BuildRichTextImageInsertAttrsArgs): RichTextImageInsertAttrs | null;
16
+ export declare function buildRichTextImageInsertAttrs({ asset, supabaseUrl, fallbackSrc, }: BuildRichTextImageInsertAttrsArgs): RichTextImageInsertAttrs;
17
17
  export {};
@@ -5,10 +5,10 @@ import { type UploadIntentResolver, type VideoPrepIntentResolver } from '../../m
5
5
  import type { VideoPrepIntent } from '../../media-core/src/index';
6
6
  import { type CropDialogProps } from './CropDialog';
7
7
  import { type MediaPickerDialogProps, type MediaPickerPolicy } from './MediaPickerDialog';
8
- import type { MediaValue } from './types';
8
+ import type { MediaValue, PersistableMediaValue } from './types';
9
9
  export type MediaEditorProps = {
10
10
  value: MediaValue | undefined;
11
- onChange: (next: MediaValue | undefined) => void;
11
+ onChange: (next: PersistableMediaValue | undefined) => void;
12
12
  allowedKinds?: readonly MediaKind[];
13
13
  previewAspectRatio?: number;
14
14
  minSourceWidth?: number;
@@ -2,7 +2,7 @@ import { type ReactNode } from 'react';
2
2
  import type { ApiClient } from '../../api/src/request';
3
3
  import type { MediaAssetWithLabels, MediaStorageRepo } from '@riverbankcms/media-storage-supabase';
4
4
  import type { UploadProgressHandler, UseApiMediaUploaderOptions } from '../../media-react/src/index';
5
- import type { MediaAssetIndex, ResolveImageUrlContext } from '../../blocks/src/index';
5
+ import type { ResolveImageUrlContext } from '../../blocks/src/index';
6
6
  type MediaEditorUploaderOptions = Omit<UseApiMediaUploaderOptions, 'siteId' | 'apiClient' | 'bucket'>;
7
7
  export type MediaEditorContextValue = {
8
8
  siteId: string;
@@ -13,7 +13,6 @@ export type MediaEditorContextValue = {
13
13
  getPublicUrl: (asset: MediaAssetWithLabels) => string;
14
14
  registerMediaAsset: (asset: MediaAssetWithLabels) => void;
15
15
  bearerToken?: string | null;
16
- mediaAssetIndex?: MediaAssetIndex;
17
16
  imageResolveContext: ResolveImageUrlContext;
18
17
  };
19
18
  export declare function MediaEditorContextProvider({ value, children, }: {
@@ -14,5 +14,7 @@ export { MediaEditorProvider } from './provider';
14
14
  export type { MediaEditorProviderProps } from './provider';
15
15
  export { createMediaEditorProvider } from './createMediaEditorProvider';
16
16
  export { withRepeaterStackMediaFieldUi, withRepeaterThumbnailMediaFieldUi, withRepeaterThumbnailPickerOnlyMediaFieldUi, } from './fieldUi';
17
- export type { MediaValue, MediaTransform, MediaHotspot } from './types';
17
+ export type { MediaValue, PersistableMediaValue, MediaTransform, MediaHotspot } from './types';
18
18
  export { DEFAULT_HOTSPOT } from './utils';
19
+ export { buildPersistableMediaValue, mediaSelectionFailureMessage, prepareMediaAssetForSelection, } from './mediaSelection';
20
+ export type { BuildPersistableMediaValueOptions, IdentifierReadyMediaAsset, PrepareMediaSelectionResult, } from './mediaSelection';
@@ -0,0 +1,32 @@
1
+ import type { ApiClient } from '../../api/src/request';
2
+ import { type MediaIdentifier } from '../../blocks/src/index';
3
+ import type { MediaAssetWithLabels } from '@riverbankcms/media-storage-supabase';
4
+ import type { MediaValue, PersistableMediaValue } from './types';
5
+ export type IdentifierReadyMediaAsset = Omit<MediaAssetWithLabels, 'identifier'> & Readonly<{
6
+ identifier: MediaIdentifier;
7
+ }>;
8
+ export type PrepareMediaSelectionResult = Readonly<{
9
+ tag: 'ready';
10
+ asset: IdentifierReadyMediaAsset;
11
+ }> | Readonly<{
12
+ tag: 'failed';
13
+ reason: 'identifier-assignment-failed';
14
+ error: unknown;
15
+ }> | Readonly<{
16
+ tag: 'failed';
17
+ reason: 'identifier-missing-after-assignment';
18
+ }>;
19
+ type PrepareMediaSelectionFailure = Extract<PrepareMediaSelectionResult, {
20
+ tag: 'failed';
21
+ }>;
22
+ export declare function mediaSelectionFailureMessage(failure: PrepareMediaSelectionFailure): string;
23
+ export type BuildPersistableMediaValueOptions = Readonly<{
24
+ asset: IdentifierReadyMediaAsset;
25
+ mediaKind: PersistableMediaValue['type'];
26
+ previousValue: MediaValue | undefined;
27
+ poster: MediaValue['poster'] | undefined;
28
+ publicUrl?: string;
29
+ }>;
30
+ export declare function buildPersistableMediaValue({ asset, mediaKind, previousValue, poster, publicUrl, }: BuildPersistableMediaValueOptions): PersistableMediaValue;
31
+ export declare function prepareMediaAssetForSelection(apiClient: ApiClient, asset: MediaAssetWithLabels): Promise<PrepareMediaSelectionResult>;
32
+ export {};
@@ -1,5 +1,5 @@
1
1
  import type { ImageHotspot } from '../../media-react/src/index';
2
- import type { Media } from '../../blocks/src/index';
2
+ import type { Media, PersistableMedia } from '../../blocks/src/index';
3
3
  export type MediaHotspot = ImageHotspot;
4
4
  export type MediaTransform = NonNullable<Media['transform']>;
5
5
  /**
@@ -7,3 +7,5 @@ export type MediaTransform = NonNullable<Media['transform']>;
7
7
  * and app consumers all speak the same content contract.
8
8
  */
9
9
  export type MediaValue = Media;
10
+ /** A media editor output that satisfies the canonical block write contract. */
11
+ export type PersistableMediaValue = PersistableMedia;
@@ -0,0 +1,26 @@
1
+ import type { MediaAssetWithLabels, MediaKind } from '@riverbankcms/media-storage-supabase';
2
+ import type { MediaEditorContextValue } from './context';
3
+ import type { MediaPickerAssetSelection } from './MediaPickerDialog';
4
+ import type { MediaValue, PersistableMediaValue } from './types';
5
+ export type MediaSelectionState = Readonly<{
6
+ tag: 'idle';
7
+ }> | Readonly<{
8
+ tag: 'preparing';
9
+ }> | Readonly<{
10
+ tag: 'failed';
11
+ message: string;
12
+ }>;
13
+ type UseMediaSelectionOptions = Readonly<{
14
+ context: MediaEditorContextValue;
15
+ value: MediaValue | undefined;
16
+ allowedKinds: readonly MediaKind[];
17
+ evaluateAssetSelection: (asset: MediaAssetWithLabels) => MediaPickerAssetSelection;
18
+ onChange: (next: PersistableMediaValue | undefined) => void;
19
+ onSelectionComplete: () => void;
20
+ }>;
21
+ export declare function useMediaSelection(options: UseMediaSelectionOptions): {
22
+ readonly cancelSelection: () => void;
23
+ readonly handleSelect: (picked: MediaAssetWithLabels) => Promise<void>;
24
+ readonly selectionState: MediaSelectionState;
25
+ };
26
+ export {};
@@ -35,6 +35,8 @@ export { PreviewShell } from "./preview/PreviewShell";
35
35
  export type { PreviewShellProps } from "./preview/PreviewShell";
36
36
  export { PreviewShellLayout } from "./preview/PreviewShellLayout";
37
37
  export type { PreviewShellLayoutProps } from "./preview/PreviewShellLayout";
38
+ export { resolvePreviewThemeRoles } from "./preview/previewThemeRoles";
39
+ export type { PreviewThemeRoles } from "./preview/previewThemeRoles";
38
40
  export type { PreviewFailureSource } from "./preview/usePreviewKeepAlive";
39
41
  export { usePreviewKeepAlive } from "./preview/usePreviewKeepAlive";
40
42
  export { EditablePageRenderer } from "./blocks/EditablePageRenderer";
@@ -0,0 +1,12 @@
1
+ import type { SiteChromeCustomizeSurfaceState } from './siteChromeCustomizeTypes';
2
+ export type HeaderMenuSurfaceState = Extract<SiteChromeCustomizeSurfaceState, {
3
+ kind: 'available';
4
+ surface: 'header';
5
+ }>;
6
+ export declare function isHeaderMenuSurfaceState(state: SiteChromeCustomizeSurfaceState): state is HeaderMenuSurfaceState;
7
+ export declare function HeaderMenuControls({ state, disabled, onMenuFontChange, onMenuFontSizeChange, }: Readonly<{
8
+ state: HeaderMenuSurfaceState;
9
+ disabled?: boolean;
10
+ onMenuFontChange?: (value: HeaderMenuSurfaceState['menuFont']) => void;
11
+ onMenuFontSizeChange?: (value: HeaderMenuSurfaceState['menuFontSize']) => void;
12
+ }>): import("react").JSX.Element;
@@ -35,7 +35,6 @@ export type PreviewEditorSidebarProps = {
35
35
  themeSelectionUpdatedAt?: string | null;
36
36
  /** Persisted Style configurator selections (Phase C / E). */
37
37
  themeSelectionButtonStyleSelection?: ButtonStyleSelection | null;
38
- runtimePaletteState: import("./styleConfiguratorSnapshot").PreviewRuntimePaletteState;
39
38
  themeSelectionHeaderLayoutId?: HeaderLayoutId | null;
40
39
  themeSelectionHeaderStyleId?: HeaderStyleId | null;
41
40
  themeSelectionHeaderLookId?: HeaderLookId | null;
@@ -61,4 +60,4 @@ export type PreviewEditorSidebarProps = {
61
60
  onViewportWidthChange: (width: ViewportWidth) => void;
62
61
  onZoomChange: (zoom: ZoomLevel) => void;
63
62
  };
64
- export declare function PreviewEditorSidebar({ surfaceId, siteId, dashboardBaseUrl, pageId, entryData, contentTypeSchema, referenceContentTypeKeys, draftContent, currentTemplate, theme, themeId, themeSelectionId, themeSelectionVersion, themeSelectionUpdatedAt, themeSelectionButtonStyleSelection, runtimePaletteState, themeSelectionHeaderLayoutId, themeSelectionHeaderStyleId, themeSelectionHeaderLookId, themeSelectionFooterLookId, themeSelectionHeaderContext, apiClient, bearerToken, supabaseUrl, entrySubrouteContext, assistantPanel, sdkConfig, mediaAssets, bookingOfferingPresets, siteStyleAccess, activeTab, onTabChange, onClose, onFooterSaved, viewportMode, viewportWidth, zoom, onViewportModeChange, onViewportWidthChange, onZoomChange, }: PreviewEditorSidebarProps): React.JSX.Element;
63
+ export declare function PreviewEditorSidebar({ surfaceId, siteId, dashboardBaseUrl, pageId, entryData, contentTypeSchema, referenceContentTypeKeys, draftContent, currentTemplate, theme, themeId, themeSelectionId, themeSelectionVersion, themeSelectionUpdatedAt, themeSelectionButtonStyleSelection, themeSelectionHeaderLayoutId, themeSelectionHeaderStyleId, themeSelectionHeaderLookId, themeSelectionFooterLookId, themeSelectionHeaderContext, apiClient, bearerToken, supabaseUrl, entrySubrouteContext, assistantPanel, sdkConfig, mediaAssets, bookingOfferingPresets, siteStyleAccess, activeTab, onTabChange, onClose, onFooterSaved, viewportMode, viewportWidth, zoom, onViewportModeChange, onViewportWidthChange, onZoomChange, }: PreviewEditorSidebarProps): React.JSX.Element;
@@ -31,7 +31,18 @@ export type PreviewShellProps = {
31
31
  previewToken: string;
32
32
  dashboardBaseUrl?: string | null;
33
33
  surfaceId: SurfaceId;
34
+ /**
35
+ * Canonical site theme — the persistence/configurator base. Site-style
36
+ * saves are computed against this theme, so it must never carry
37
+ * page-derived adaptations.
38
+ */
34
39
  theme: Theme;
40
+ /**
41
+ * Page-adapted theme used to render the preview document (e.g. opening-
42
+ * foreground header adaptation). Render-only: never persisted. Falls back
43
+ * to the canonical theme when absent.
44
+ */
45
+ renderTheme?: Theme | null;
35
46
  themeId?: string | null;
36
47
  themeSelectionId?: string | null;
37
48
  themeSelectionVersion?: number | null;
@@ -42,7 +53,6 @@ export type PreviewShellProps = {
42
53
  * complete palette state.
43
54
  */
44
55
  themeSelectionButtonStyleSelection?: ButtonStyleSelection | null;
45
- runtimePaletteState: import('./styleConfiguratorSnapshot').PreviewRuntimePaletteState;
46
56
  themeSelectionHeaderLayoutId?: HeaderLayoutId | null;
47
57
  themeSelectionHeaderStyleId?: HeaderStyleId | null;
48
58
  themeSelectionHeaderLookId?: HeaderLookId | null;
@@ -68,12 +78,12 @@ export type PreviewShellProps = {
68
78
  supabaseUrl?: string;
69
79
  themeRuntime?: PreviewThemeRuntime;
70
80
  designEditorEligibility?: PreviewDesignEditorEligibility;
71
- /** Hides site-style controls for runtimes without palette authority. */
81
+ /** Hides site-style controls when this runtime cannot persist design edits. */
72
82
  hideSiteStyleConfigurator?: boolean;
73
83
  baseFetch?: BaseFetch;
74
84
  onFooterSaved?: () => void;
75
85
  };
76
- export declare function PreviewShell({ children, apiBaseUrl, blockApiConfig, siteId, siteSlug, editableId, previewSession, previewToken, dashboardBaseUrl, surfaceId, theme, themeId, themeSelectionId, themeSelectionVersion, themeSelectionUpdatedAt, themeSelectionButtonStyleSelection, runtimePaletteState, themeSelectionHeaderLayoutId, themeSelectionHeaderStyleId, themeSelectionHeaderLookId, themeSelectionFooterLookId, themeSelectionHeaderContext, pageId, routeId, entryData, contentTypeSchema, referenceContentTypeKeys, draftContent, currentTemplate, initialStatus, initialBlocks, pageMetadata, isSiteLaunched, maintenanceModeEnabled, entrySubrouteContext, assistantPanel, sdkConfig, mediaAssets, bookingOfferingPresets, supabaseUrl, themeRuntime, designEditorEligibility, hideSiteStyleConfigurator, baseFetch, onFooterSaved, }: PreviewShellProps): React.JSX.Element;
86
+ export declare function PreviewShell({ children, apiBaseUrl, blockApiConfig, siteId, siteSlug, editableId, previewSession, previewToken, dashboardBaseUrl, surfaceId, theme, renderTheme, themeId, themeSelectionId, themeSelectionVersion, themeSelectionUpdatedAt, themeSelectionButtonStyleSelection, themeSelectionHeaderLayoutId, themeSelectionHeaderStyleId, themeSelectionHeaderLookId, themeSelectionFooterLookId, themeSelectionHeaderContext, pageId, routeId, entryData, contentTypeSchema, referenceContentTypeKeys, draftContent, currentTemplate, initialStatus, initialBlocks, pageMetadata, isSiteLaunched, maintenanceModeEnabled, entrySubrouteContext, assistantPanel, sdkConfig, mediaAssets, bookingOfferingPresets, supabaseUrl, themeRuntime, designEditorEligibility, hideSiteStyleConfigurator, baseFetch, onFooterSaved, }: PreviewShellProps): React.JSX.Element;
77
87
  export declare function defaultDesignEditorEligibility(input: Readonly<{
78
88
  pageId: string | null;
79
89
  entryData?: PreviewContentEntryData | null;
@@ -11,7 +11,13 @@ import { type SiteStyleAccess } from "./siteStyleAccess";
11
11
  import { type PreviewThemeRuntime } from "./themeRuntime";
12
12
  export type PreviewShellLayoutProps = {
13
13
  children: ReactNode;
14
+ /** Canonical site theme — persistence/configurator base, never page-adapted. */
14
15
  theme: Theme;
16
+ /**
17
+ * Page-adapted theme for rendering the preview document. Render-only;
18
+ * falls back to the canonical theme when absent.
19
+ */
20
+ renderTheme?: Theme | null;
15
21
  surfaceId: SurfaceId;
16
22
  siteId: string;
17
23
  dashboardBaseUrl?: string | null;
@@ -28,7 +34,6 @@ export type PreviewShellLayoutProps = {
28
34
  themeSelectionVersion?: number | null;
29
35
  themeSelectionUpdatedAt?: string | null;
30
36
  themeSelectionButtonStyleSelection?: ButtonStyleSelection | null;
31
- runtimePaletteState: import("./styleConfiguratorSnapshot").PreviewRuntimePaletteState;
32
37
  themeSelectionHeaderLayoutId?: HeaderLayoutId | null;
33
38
  themeSelectionHeaderStyleId?: HeaderStyleId | null;
34
39
  themeSelectionHeaderLookId?: HeaderLookId | null;
@@ -46,4 +51,4 @@ export type PreviewShellLayoutProps = {
46
51
  siteStyleAccess?: SiteStyleAccess;
47
52
  onFooterSaved?: () => void;
48
53
  };
49
- export declare function PreviewShellLayout({ children, theme, surfaceId, siteId, dashboardBaseUrl, pageId, entryData, contentTypeSchema, referenceContentTypeKeys, draftContent, currentTemplate, apiClient, bearerToken, themeId, themeSelectionId, themeSelectionVersion, themeSelectionUpdatedAt, themeSelectionButtonStyleSelection, runtimePaletteState, themeSelectionHeaderLayoutId, themeSelectionHeaderStyleId, themeSelectionHeaderLookId, themeSelectionFooterLookId, themeSelectionHeaderContext, supabaseUrl, isSiteLaunched, maintenanceModeEnabled, entrySubrouteContext, assistantPanel, sdkConfig, mediaAssets, bookingOfferingPresets, themeRuntime, siteStyleAccess, onFooterSaved, }: PreviewShellLayoutProps): React.JSX.Element;
54
+ export declare function PreviewShellLayout({ children, theme, renderTheme, surfaceId, siteId, dashboardBaseUrl, pageId, entryData, contentTypeSchema, referenceContentTypeKeys, draftContent, currentTemplate, apiClient, bearerToken, themeId, themeSelectionId, themeSelectionVersion, themeSelectionUpdatedAt, themeSelectionButtonStyleSelection, themeSelectionHeaderLayoutId, themeSelectionHeaderStyleId, themeSelectionHeaderLookId, themeSelectionFooterLookId, themeSelectionHeaderContext, supabaseUrl, isSiteLaunched, maintenanceModeEnabled, entrySubrouteContext, assistantPanel, sdkConfig, mediaAssets, bookingOfferingPresets, themeRuntime, siteStyleAccess, onFooterSaved, }: PreviewShellLayoutProps): React.JSX.Element;
@@ -1,14 +1,13 @@
1
1
  import React, { type ReactNode } from 'react';
2
2
  import { type ApiClient } from '../../../../api/src/request';
3
3
  import type { Theme } from '../../../../blocks/src/index';
4
- import type { ButtonStyleSelection } from '../../../../theme-core/src/buttons/index';
5
- import type { BrandDisplayMode, FooterLookId, HeaderNavFontSizePreference, HeaderNavTypographyPreference, HeaderLayoutId, HeaderLookId, HeaderSelectionContext, HeaderStyleId, LogoSizePolicy, SiteChromeBackgroundColorToken, SiteChromeBackgroundOverride } from '../../../../theme-core/src/site-styles/index';
6
- import { headerNavFontSizeOptions, headerNavTypographyOptions } from '../../../../theme-core/src/site-styles/index';
4
+ import type { BrandDisplayMode, HeaderNavFontSizePreference, HeaderNavTypographyPreference, HeaderInteractionPalettePreference, HeaderSelectionContext, LogoSizePolicy, SiteChromeBackgroundOverride } from '../../../../theme-core/src/site-styles/index';
7
5
  import { type StyleConfiguratorHistoryEntry } from './StyleConfigurator.state';
8
6
  import type { SiteStyleAccess } from './siteStyleAccess';
9
- import { type SiteChromeLookOption } from './siteChromeLookRows';
7
+ import { type StyleConfiguratorInitialSelections } from './styleConfiguratorSnapshot';
10
8
  import type { SiteChromeEditableSurfaceKind } from './SiteChromeEditableSurface';
11
- import { type HeaderBrandDisplayOption, type HeaderLogoSizeOption } from './siteChromeBrandPreferences';
9
+ import type { SiteChromeCustomizeSurfaceState } from './siteChromeCustomizeTypes';
10
+ export type { SiteChromeBackgroundControlState, SiteChromeCustomizeSurfaceState, } from './siteChromeCustomizeTypes';
12
11
  import { type SiteStyleHistoryFailure, type SiteStyleHistorySkipReason } from './siteStyleHistoryState';
13
12
  import { type SiteChromeQuickControlHistoryFailure, type SiteChromeQuickControlHistorySkipReason } from './siteChromeQuickControlHistoryState';
14
13
  type SiteStyleHistoryController = Readonly<{
@@ -44,50 +43,6 @@ type SiteChromeQuickControlApplyOutcome = Readonly<{
44
43
  kind: 'skipped';
45
44
  reason: SiteChromeQuickControlHistorySkipReason | 'superseded';
46
45
  }> | SiteChromeQuickControlHistoryFailure;
47
- export type SiteChromeBackgroundControlState = Readonly<{
48
- available: boolean;
49
- current: SiteChromeBackgroundOverride;
50
- currentLabel: string;
51
- quickTokens: readonly SiteChromeBackgroundColorToken[];
52
- advancedTokens: readonly SiteChromeBackgroundColorToken[];
53
- }>;
54
- export type SiteChromeCustomizeSurfaceState = Readonly<{
55
- kind: 'unavailable';
56
- }> | Readonly<{
57
- kind: 'available';
58
- surface: 'header';
59
- label: string;
60
- currentLayoutId: HeaderLayoutId;
61
- currentLayoutLabel: string;
62
- layoutOptions: readonly SiteChromeLookOption<HeaderLayoutId>[];
63
- currentId: HeaderStyleId;
64
- currentLabel: string;
65
- options: readonly SiteChromeLookOption<HeaderStyleId>[];
66
- brandDisplay: BrandDisplayMode;
67
- brandDisplayOptions: readonly HeaderBrandDisplayOption[];
68
- brandSizeLabel: string;
69
- logoSize: LogoSizePolicy;
70
- logoSizeOptions: readonly HeaderLogoSizeOption[];
71
- menuFont: HeaderNavTypographyPreference;
72
- menuFontOptions: typeof headerNavTypographyOptions;
73
- menuFontSize: HeaderNavFontSizePreference;
74
- menuFontSizeOptions: typeof headerNavFontSizeOptions;
75
- diagnostics: readonly string[];
76
- background: SiteChromeBackgroundControlState;
77
- failure: string | null;
78
- applyAllowed: boolean;
79
- }> | Readonly<{
80
- kind: 'available';
81
- surface: 'footer';
82
- label: string;
83
- currentId: FooterLookId | null;
84
- currentLabel: string;
85
- options: readonly SiteChromeLookOption<FooterLookId | null>[];
86
- diagnostics: readonly string[];
87
- background: SiteChromeBackgroundControlState;
88
- failure: string | null;
89
- applyAllowed: boolean;
90
- }>;
91
46
  type SiteChromeCustomizeContextValue = Readonly<{
92
47
  canOpenDesignEditor: boolean;
93
48
  getSurfaceState: (surface: SiteChromeEditableSurfaceKind) => SiteChromeCustomizeSurfaceState;
@@ -97,6 +52,7 @@ type SiteChromeCustomizeContextValue = Readonly<{
97
52
  setHeaderLogoSize: (value: LogoSizePolicy) => void;
98
53
  setHeaderMenuFont: (value: HeaderNavTypographyPreference) => void;
99
54
  setHeaderMenuFontSize: (value: HeaderNavFontSizePreference) => void;
55
+ setHeaderInteractionPalette: (value: HeaderInteractionPalettePreference) => void;
100
56
  cycleSurfaceBackground: (surface: SiteChromeEditableSurfaceKind, direction: 'prev' | 'next') => void;
101
57
  chooseSurfaceBackground: (surface: SiteChromeEditableSurfaceKind, override: SiteChromeBackgroundOverride) => void;
102
58
  siteStyleHistory: SiteStyleHistoryController;
@@ -111,20 +67,10 @@ export type SiteChromeCustomizeProviderProps = Readonly<{
111
67
  selectionId?: string | null;
112
68
  selectionVersion?: number | null;
113
69
  selectionUpdatedAt?: string | null;
114
- initialSelections: Readonly<{
115
- selectionVersion?: number | null;
116
- selectionUpdatedAt?: string | null;
117
- buttonStyleSelection: ButtonStyleSelection | null;
118
- runtimePaletteState: import('./styleConfiguratorSnapshot').PreviewRuntimePaletteState;
119
- headerLayoutId?: HeaderLayoutId | null;
120
- headerStyleId?: HeaderStyleId | null;
121
- headerLookId?: HeaderLookId | null;
122
- footerLookId?: FooterLookId | null;
123
- }> & Readonly<Record<string, unknown>>;
70
+ initialSelections: StyleConfiguratorInitialSelections & Readonly<Record<string, unknown>>;
124
71
  headerSelectionContext?: Partial<HeaderSelectionContext>;
125
72
  siteStyleAccess?: SiteStyleAccess;
126
73
  canOpenDesignEditor?: boolean;
127
74
  }>;
128
75
  export declare function SiteChromeCustomizeProvider({ children, siteId, apiClient, theme, themeId, selectionId, selectionVersion, selectionUpdatedAt, initialSelections, headerSelectionContext, siteStyleAccess, canOpenDesignEditor, }: SiteChromeCustomizeProviderProps): React.JSX.Element;
129
76
  export declare function useSiteChromeCustomizeOptional(): SiteChromeCustomizeContextValue | null;
130
- export {};
@@ -1,10 +1,9 @@
1
1
  import React from 'react';
2
2
  import type { ApiClient } from '../../../../api/src/request';
3
3
  import type { Theme } from '../../../../blocks/src/index';
4
- import { type ButtonStyleSelection } from '../../../../theme-core/src/buttons/index';
5
- import { type FooterLookId, type HeaderLayoutId, type HeaderLookId, type HeaderSelectionContext, type HeaderStyleId } from '../../../../theme-core/src/site-styles/index';
4
+ import { type HeaderSelectionContext } from '../../../../theme-core/src/site-styles/index';
6
5
  import { type VisibleSiteStyleAccess } from './siteStyleAccess';
7
- import type { PreviewRuntimePaletteState } from './styleConfiguratorSnapshot';
6
+ import { type StyleConfiguratorInitialSelections } from './styleConfiguratorSnapshot';
8
7
  export type StyleConfiguratorProps = Readonly<{
9
8
  siteId: string;
10
9
  apiClient: ApiClient;
@@ -14,16 +13,7 @@ export type StyleConfiguratorProps = Readonly<{
14
13
  selectionVersion?: number | null;
15
14
  selectionUpdatedAt?: string | null;
16
15
  /** Server-persisted design selections. */
17
- initialSelections: Readonly<{
18
- selectionVersion?: number | null;
19
- selectionUpdatedAt?: string | null;
20
- buttonStyleSelection: ButtonStyleSelection | null;
21
- runtimePaletteState: PreviewRuntimePaletteState;
22
- headerLayoutId?: HeaderLayoutId | null;
23
- headerStyleId?: HeaderStyleId | null;
24
- headerLookId?: HeaderLookId | null;
25
- footerLookId?: FooterLookId | null;
26
- }> & Readonly<Record<string, unknown>>;
16
+ initialSelections: StyleConfiguratorInitialSelections & Readonly<Record<string, unknown>>;
27
17
  headerSelectionContext?: Partial<HeaderSelectionContext>;
28
18
  onFocusedSurfaceChange?: (focused: boolean) => void;
29
19
  siteStyleAccess: VisibleSiteStyleAccess;
@@ -12,7 +12,7 @@
12
12
  */
13
13
  import { type ButtonStyleSelection } from '../../../../theme-core/src/buttons/index';
14
14
  import type { Theme } from '../../../../blocks/src/index';
15
- import type { PaletteColors, PaletteMode, PaletteSelection, PaletteEditorState, KnownCuratedPaletteValueKey, ResolvedPaletteSelection, RuntimePaletteState, SitePalette, SitePaletteId, SitePaletteVersion, PaletteLibraryAuthority } from '../../../../theme-core/src/palette/index';
15
+ import type { PaletteColors, KnownCuratedPaletteValueKey } from '../../../../theme-core/src/palette/index';
16
16
  import { type FooterLookId, type HeaderLayoutId, type HeaderLookId, type HeaderStyleId } from '../../../../theme-core/src/site-styles/index';
17
17
  import type { SelectionFallbackWarning, SiteStyleId } from '../../../../theme-core/src/site-styles/previewCompiler';
18
18
  import { type EditorStagedSessionCapabilities, type EditorStagedSessionState } from '../../../../content-editor/src/editorTransactionState';
@@ -48,41 +48,11 @@ export type TypographyDraftPatch = Readonly<{
48
48
  kind: 'scale';
49
49
  scale: ThemeTypography['scale'];
50
50
  }>;
51
- /** Runtime authority is deliberately separate from the editable core state. */
52
- export type PaletteSelectionSnapshot = Readonly<{
53
- kind: 'available';
54
- editor: PaletteEditorState;
55
- }> | Readonly<{
56
- kind: 'invalid';
57
- reason: PaletteAuthorityError;
58
- }>;
59
- export type PaletteAuthorityError = Extract<RuntimePaletteState, {
60
- kind: 'invalid';
61
- }>['reason'] | 'runtime-curated-palette-missing' | 'runtime-curated-palette-mismatch' | 'invalid-active-site-palette-version';
62
51
  /** Read-only UI projection. It intentionally owns no palette transitions. */
63
52
  export type PalettePreviewProjection = Readonly<{
64
- kind: 'curated';
65
- valueKey: KnownCuratedPaletteValueKey;
66
- colors: PaletteColors;
67
- mode: PaletteMode;
68
- }> | Readonly<{
69
- kind: 'curated-fork';
70
- sourceValueKey: KnownCuratedPaletteValueKey;
71
- colors: PaletteColors;
72
- mode: PaletteMode;
73
- }> | Readonly<{
74
- kind: 'site';
75
- paletteId: SitePaletteId;
53
+ curatedValueKey: KnownCuratedPaletteValueKey | null;
76
54
  colors: PaletteColors;
77
- mode: PaletteMode;
78
- version: SitePaletteVersion;
79
- }> | Readonly<{
80
- kind: 'new-site';
81
- colors: PaletteColors;
82
- mode: PaletteMode;
83
- }> | Readonly<{
84
- kind: 'invalid';
85
- reason: PaletteAuthorityError;
55
+ mode: Theme['palette']['meta']['mode'];
86
56
  }>;
87
57
  export type SelectionSnapshot = Readonly<{
88
58
  siteStyleId: SiteStyleId;
@@ -93,7 +63,7 @@ export type SelectionSnapshot = Readonly<{
93
63
  headerLookId: HeaderLookId | null;
94
64
  footerLookId: FooterLookId | null;
95
65
  buttonStyleSelection: ButtonStyleSelection;
96
- palette: PaletteSelectionSnapshot;
66
+ palette: Theme['palette'];
97
67
  typography: ThemeTypography;
98
68
  }>;
99
69
  type StyleConfiguratorTargetKey = 'design:site-style';
@@ -104,22 +74,6 @@ export type StyleConfiguratorHistoryEntry = Readonly<{
104
74
  next: SelectionSnapshot;
105
75
  }>;
106
76
  export type StyleConfiguratorStagedSession = EditorStagedSessionState<SelectionSnapshot, StyleConfiguratorHistoryEntry, StyleConfiguratorTargetKey>;
107
- /**
108
- * A collaborator selected a different active palette while this editor had an
109
- * unsaved edit to the formerly active site palette. The base remains the
110
- * server authority; the complete local draft remains available for an
111
- * intentional retry or cancel.
112
- */
113
- export type StyleConfiguratorStalePaletteConflict = Readonly<{
114
- kind: 'active-palette-changed';
115
- originalPaletteId: SitePaletteId;
116
- localDraft: Readonly<{
117
- paletteId: SitePaletteId;
118
- expectedVersion: SitePaletteVersion;
119
- colors: PaletteColors;
120
- mode: PaletteMode;
121
- }>;
122
- }>;
123
77
  export type StyleConfiguratorState = Readonly<{
124
78
  /**
125
79
  * Last persisted server snapshot. Updated on apply-success (and on
@@ -134,19 +88,10 @@ export type StyleConfiguratorState = Readonly<{
134
88
  saveStatus: StyleConfiguratorSaveStatus;
135
89
  warnings: ReadonlyArray<SelectionFallbackWarning>;
136
90
  notices: ReadonlyArray<StyleConfiguratorNotice>;
137
- stalePaletteConflict: StyleConfiguratorStalePaletteConflict | null;
138
91
  expandedRow: StyleConfiguratorExpandedRow;
139
92
  stagedSession: StyleConfiguratorStagedSession;
140
93
  }>;
141
- export type PaletteMutationCapability = Readonly<{
142
- kind: 'editable';
143
- }> | Readonly<{
144
- kind: 'blocked';
145
- reason: 'invalid-palette';
146
- message: string;
147
- }>;
148
94
  export declare function createStyleConfiguratorState(base: SelectionSnapshot): StyleConfiguratorState;
149
- export declare function paletteMutationCapability(state: StyleConfiguratorState): PaletteMutationCapability;
150
95
  export declare function openRow(state: StyleConfiguratorState, row: Exclude<StyleConfiguratorExpandedRow, null>): StyleConfiguratorState;
151
96
  /**
152
97
  * True iff the user has previewed a change that hasn't been applied yet.
@@ -165,21 +110,13 @@ export declare function previewTypography(state: StyleConfiguratorState, typogra
165
110
  export declare function applyTypographyDraftPatch(state: StyleConfiguratorState, currentTypography: ThemeTypography, patch: TypographyDraftPatch): StyleConfiguratorState;
166
111
  export declare function resetTypographyToSaved(state: StyleConfiguratorState): StyleConfiguratorState;
167
112
  export declare function previewCuratedPalette(state: StyleConfiguratorState, valueKey: KnownCuratedPaletteValueKey): StyleConfiguratorState;
168
- export declare function previewSitePalette(state: StyleConfiguratorState, palette: Readonly<{
169
- paletteId: SitePaletteId;
170
- colors: PaletteColors;
171
- mode: PaletteMode;
172
- version: SitePaletteVersion;
173
- }>): StyleConfiguratorState;
174
- /** Starts a manual palette from the active complete palette, never sparse overrides. */
175
- export declare function createPalette(state: StyleConfiguratorState): StyleConfiguratorState;
176
113
  export declare function setPaletteColors(state: StyleConfiguratorState, colors: PaletteColors): StyleConfiguratorState;
177
114
  /**
178
115
  * Records the post-compile resolved selection + any fallback warnings.
179
116
  * Used after `compileSiteThemeFromSelections` runs against a new site style:
180
- * the resolver may have auto-picked a different button style if the user's
181
- * previous selection is not offered for the new style, or a different palette
182
- * if the persisted palette value key is no longer known.
117
+ * the resolver may have auto-picked a different button style or chrome look
118
+ * when the user's previous selection is not offered for the new style. The
119
+ * concrete palette is carried independently in the compiled Theme.
183
120
  *
184
121
  */
185
122
  export declare function applyResolvedSelections(state: StyleConfiguratorState, input: Readonly<{
@@ -190,10 +127,6 @@ export declare function cancelPreview(state: StyleConfiguratorState): StyleConfi
190
127
  export declare function markApplySaving(state: StyleConfiguratorState): StyleConfiguratorState;
191
128
  export declare function markApplySaved(state: StyleConfiguratorState, persisted: SelectionSnapshot): StyleConfiguratorState;
192
129
  export declare function markApplyFailed(state: StyleConfiguratorState, message: string, failureKind?: 'retryable' | 'stale'): StyleConfiguratorState;
193
- /** Advances a stale site's CAS token only for the user's explicit retry. */
194
- export declare function prepareStalePaletteRetry(state: StyleConfiguratorState, input?: Readonly<{
195
- sitePalettes: readonly SitePalette[];
196
- }>): StyleConfiguratorState;
197
130
  export declare function toggleRow(state: StyleConfiguratorState, row: StyleConfiguratorExpandedRow): StyleConfiguratorState;
198
131
  export declare function dismissWarnings(state: StyleConfiguratorState): StyleConfiguratorState;
199
132
  export declare function dismissNotices(state: StyleConfiguratorState): StyleConfiguratorState;
@@ -203,32 +136,7 @@ export declare function dismissNotices(state: StyleConfiguratorState): StyleConf
203
136
  * changes the persisted selection out-of-band.
204
137
  */
205
138
  export declare function syncStyleConfiguratorState(state: StyleConfiguratorState, base: SelectionSnapshot): StyleConfiguratorState;
206
- /** Reconciles typed palette-library authority with the editor's saved base. */
207
- export declare function reconcilePaletteLibraryActive(state: StyleConfiguratorState, active: PaletteLibraryAuthority, sitePalettes: readonly SitePalette[]): StyleConfiguratorState;
208
- /**
209
- * A palette-library response only refreshes palette authority. Unlike a full
210
- * server snapshot, it must never discard the user's staged site-style work.
211
- * Site drafts keep their complete local colours/mode and rebase their expected
212
- * version when the same palette was changed elsewhere.
213
- */
214
- export declare function rebasePaletteLibraryAuthority(state: StyleConfiguratorState, committedPalette: ResolvedPaletteSelection): StyleConfiguratorState;
215
139
  export declare function selectionSnapshotsEqual(a: SelectionSnapshot, b: SelectionSnapshot): boolean;
216
140
  export declare function typographyObjectsEqual(a: ThemeTypography, b: ThemeTypography): boolean;
217
- type ModernRuntimePaletteState = Extract<RuntimePaletteState, Readonly<{
218
- authority: 'curated';
219
- }>> | Extract<RuntimePaletteState, Readonly<{
220
- authority: 'site';
221
- }>> | Extract<RuntimePaletteState, Readonly<{
222
- kind: 'invalid';
223
- }>>;
224
- export declare function paletteSelectionSnapshotFromRuntime(runtime: ModernRuntimePaletteState): PaletteSelectionSnapshot;
225
- export declare function paletteSelectionSnapshotFromComplete(input: Readonly<{
226
- selection: PaletteSelection;
227
- colors: PaletteColors;
228
- mode: PaletteMode;
229
- version?: SitePaletteVersion;
230
- }>): PaletteSelectionSnapshot;
231
- export declare function paletteSelectionSnapshotsEqual(left: PaletteSelectionSnapshot, right: PaletteSelectionSnapshot): boolean;
232
- export declare function palettePreviewProjection(palette: PaletteSelectionSnapshot): PalettePreviewProjection;
233
- export declare function committedPaletteForSnapshot(palette: PaletteSelectionSnapshot): ResolvedPaletteSelection | null;
141
+ export declare function palettePreviewProjection(palette: Theme['palette']): PalettePreviewProjection;
234
142
  export {};
@@ -0,0 +1,8 @@
1
+ import type { HeaderInteractionPalettePreference, HeaderStyleId } from '../../../../theme-core/src/site-styles/index';
2
+ import { resolveHeaderInteractionPaletteControl } from '../../../../theme-core/src/site-styles/index';
3
+ type HeaderInteractionPaletteSurfaceState = Readonly<{
4
+ interactionPalette: ReturnType<typeof resolveHeaderInteractionPaletteControl>;
5
+ diagnostics: readonly string[];
6
+ }>;
7
+ export declare function headerInteractionPaletteSurfaceState(styleId: HeaderStyleId, preference: HeaderInteractionPalettePreference): HeaderInteractionPaletteSurfaceState;
8
+ export {};
@@ -0,0 +1,15 @@
1
+ import type { Theme } from "../../../../theme-core/src/index";
2
+ export type PreviewThemeRoles = Readonly<{
3
+ /** Base theme for site-style saves and configurator state. */
4
+ persistenceTheme: Theme;
5
+ /** Theme the preview document renders with (may be page-adapted). */
6
+ documentTheme: Theme;
7
+ }>;
8
+ /**
9
+ * Splits the preview theme inputs into their two distinct roles so the
10
+ * page-adapted render theme can never reach the persistence path.
11
+ */
12
+ export declare function resolvePreviewThemeRoles(input: {
13
+ theme: Theme;
14
+ renderTheme?: Theme | null;
15
+ }): PreviewThemeRoles;