@riverbankcms/sdk 0.128.0 → 0.129.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 (51) hide show
  1. package/README.md +33 -0
  2. package/dist/{PreviewEditorSidebar-Dbvb7GIr.mjs → PreviewEditorSidebar-B43CJ0g_.mjs} +3 -3
  3. package/dist/{PreviewEditorUI-e9O9l20X.mjs → PreviewEditorUI-DHirVkeM.mjs} +2 -2
  4. package/dist/{SdkPreviewModeRuntime-BZHt6e9w.mjs → SdkPreviewModeRuntime-BJumZy1B.mjs} +495 -292
  5. package/dist/{SiteChromeCustomizeContext-CvuGbHJX.mjs → SiteChromeCustomizeContext-D9SlpwEj.mjs} +140 -140
  6. package/dist/_dts/blocks/src/PageRenderer.d.ts +20 -10
  7. package/dist/_dts/blocks/src/index.d.ts +2 -1
  8. package/dist/_dts/blocks/src/pageRendererBoundaries.d.ts +30 -0
  9. package/dist/_dts/blocks/src/pageRenderingMode.d.ts +37 -0
  10. package/dist/_dts/blocks/src/server.d.ts +1 -1
  11. package/dist/_dts/db/src/generated/supabase/database.types.d.ts +14 -0
  12. package/dist/_dts/preview-next/src/client/blocks/pageDesignRuntimePreview.d.ts +2 -0
  13. package/dist/_dts/preview-next/src/client/index.d.ts +47 -47
  14. package/dist/_dts/preview-next/src/client/preview/PreviewShell.d.ts +18 -6
  15. package/dist/_dts/preview-next/src/client/preview/PreviewShellLayout.d.ts +30 -21
  16. package/dist/_dts/preview-next/src/client/preview/PreviewThemedSiteDocument.d.ts +18 -5
  17. package/dist/_dts/preview-next/src/client/preview/themeRuntime.d.ts +9 -0
  18. package/dist/_dts/preview-next/src/client/sdk/SdkPreviewMode.d.ts +21 -6
  19. package/dist/_dts/preview-next/src/client/sdk-runtime.d.ts +8 -8
  20. package/dist/_dts/sdk/src/next/catch-all.d.ts +6 -0
  21. package/dist/_dts/sdk/src/next/index.d.ts +2 -1
  22. package/dist/_dts/sdk/src/next/renderSdkContent.d.ts +33 -0
  23. package/dist/_dts/sdk/src/next/types.d.ts +23 -9
  24. package/dist/_dts/sdk/src/preview-next/before-render.d.ts +4 -6
  25. package/dist/_dts/sdk/src/preview-next/client/index.d.ts +3 -3
  26. package/dist/_dts/sdk/src/preview-next/client/runtime.d.ts +1 -1
  27. package/dist/_dts/sdk/src/rendering/blocks-page-renderer.d.ts +25 -3
  28. package/dist/_dts/sdk/src/rendering/components/Block.shared.d.ts +13 -2
  29. package/dist/_dts/sdk/src/rendering/components/Layout.d.ts +31 -18
  30. package/dist/_dts/sdk/src/rendering/components/pageShared.d.ts +20 -9
  31. package/dist/_dts/sdk/src/rendering/index.d.ts +4 -2
  32. package/dist/_dts/sdk/src/rendering/renderingMode.d.ts +23 -0
  33. package/dist/_dts/sdk/src/rendering/server.d.ts +5 -3
  34. package/dist/_dts/sdk/src/rendering/themeRuntime.d.ts +6 -0
  35. package/dist/_dts/sdk/src/version.d.ts +1 -1
  36. package/dist/cli/index.mjs +237 -211
  37. package/dist/cli/init-docs/content/workflow-preview-mode.md +24 -11
  38. package/dist/client/client.mjs +420 -337
  39. package/dist/client/rendering.mjs +503 -358
  40. package/dist/preview-next/before-render.mjs +10 -3
  41. package/dist/preview-next/client/runtime.mjs +3 -3
  42. package/dist/{sdk-runtime-Cn_QSCOg.mjs → sdk-runtime-CfZd5pAm.mjs} +1 -1
  43. package/dist/{separator-CEoGABRc.mjs → separator-DkTe68HE.mjs} +1 -1
  44. package/dist/server/components.mjs +478 -351
  45. package/dist/server/index.mjs +1 -1
  46. package/dist/server/next.mjs +640 -500
  47. package/dist/server/prebuild.mjs +1 -1
  48. package/dist/server/rendering/server.mjs +499 -355
  49. package/dist/server/rendering.mjs +499 -355
  50. package/dist/server/server.mjs +1 -1
  51. package/package.json +1 -1
@@ -7,7 +7,7 @@ import type { ContentTypeSchema } from '../../../../content-model/src/index';
7
7
  import type { SdkConfigForBlockPicker } from '../../../../editor-blocks/src/index';
8
8
  import type { SurfaceId } from '../../../../surfaces/src/index';
9
9
  import { type PreviewBlock, type PreviewContentEntryData, type PreviewPageMetadata } from './PreviewEntryControllerProvider';
10
- import { type PreviewThemeRuntime } from './themeRuntime';
10
+ import { type PreviewRenderingMode, type PreviewThemeRuntime } from './themeRuntime';
11
11
  import type { PreviewEditorSidebarProps, PreviewTemplateData } from './PreviewEditorSidebar';
12
12
  import { type PreviewRuntimeSession } from '../../auth-contract';
13
13
  type BaseFetch = (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;
@@ -20,7 +20,7 @@ export type PreviewDesignEditorEligibility = Readonly<{
20
20
  }> | Readonly<{
21
21
  kind: 'unsupported';
22
22
  }>;
23
- export type PreviewShellProps = {
23
+ type PreviewShellCommonProps = {
24
24
  children: ReactNode;
25
25
  apiBaseUrl: string;
26
26
  blockApiConfig: ComponentProps<typeof BlockApiProvider>['config'];
@@ -36,13 +36,11 @@ export type PreviewShellProps = {
36
36
  * saves are computed against this theme, so it must never carry
37
37
  * page-derived adaptations.
38
38
  */
39
- theme: Theme;
40
39
  /**
41
40
  * Page-adapted theme used to render the preview document (e.g. opening-
42
41
  * foreground header adaptation). Render-only: never persisted. Falls back
43
42
  * to the canonical theme when absent.
44
43
  */
45
- renderTheme?: Theme | null;
46
44
  themeId?: string | null;
47
45
  themeSelectionId?: string | null;
48
46
  themeSelectionVersion?: number | null;
@@ -76,14 +74,28 @@ export type PreviewShellProps = {
76
74
  mediaAssets?: readonly MediaAssetIndexItem[];
77
75
  bookingOfferingPresets?: readonly BookingOfferingPresetSummary[] | null;
78
76
  supabaseUrl?: string;
79
- themeRuntime?: PreviewThemeRuntime;
80
77
  designEditorEligibility?: PreviewDesignEditorEligibility;
81
78
  /** Hides site-style controls when this runtime cannot persist design edits. */
82
79
  hideSiteStyleConfigurator?: boolean;
83
80
  baseFetch?: BaseFetch;
84
81
  onFooterSaved?: () => void;
85
82
  };
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;
83
+ type ThemedPreviewShellProps = PreviewShellCommonProps & {
84
+ rendering?: never;
85
+ theme: Theme;
86
+ renderTheme?: Theme | null;
87
+ themeRuntime?: PreviewThemeRuntime;
88
+ };
89
+ type OverrideOnlyPreviewShellProps = PreviewShellCommonProps & {
90
+ rendering: Extract<PreviewRenderingMode, {
91
+ kind: 'overrides-only';
92
+ }>;
93
+ theme?: never;
94
+ renderTheme?: never;
95
+ themeRuntime?: never;
96
+ };
97
+ export type PreviewShellProps = ThemedPreviewShellProps | OverrideOnlyPreviewShellProps;
98
+ export declare function PreviewShell(props: PreviewShellProps): React.JSX.Element;
87
99
  export declare function defaultDesignEditorEligibility(input: Readonly<{
88
100
  pageId: string | null;
89
101
  entryData?: PreviewContentEntryData | null;
@@ -1,23 +1,16 @@
1
- import React, { type ReactNode } from "react";
2
- import { type EntrySubrouteContextData, type BookingOfferingPresetSummary, type Theme } from "../../../../blocks/src/index";
3
- import type { ButtonStyleSelection } from "../../../../theme-core/src/buttons/index";
4
- import type { HeaderSelectionContext, FooterLookId, HeaderLayoutId, HeaderLookId, HeaderStyleId } from "../../../../theme-core/src/site-styles/index";
5
- import type { ContentTypeSchema } from "../../../../content-model/src/index";
6
- import type { ApiClient } from "../../../../api/src/request";
7
- import type { SdkConfigForBlockPicker } from "../../../../editor-blocks/src/index";
8
- import type { SurfaceId } from "../../../../surfaces/src/index";
9
- import { type PreviewEntryData, type PreviewTemplateData } from "./PreviewEditorSidebar";
10
- import { type SiteStyleAccess } from "./siteStyleAccess";
11
- import { type PreviewThemeRuntime } from "./themeRuntime";
12
- export type PreviewShellLayoutProps = {
1
+ import React, { type ReactNode } from 'react';
2
+ import { type EntrySubrouteContextData, type BookingOfferingPresetSummary, type Theme } from '../../../../blocks/src/index';
3
+ import type { ButtonStyleSelection } from '../../../../theme-core/src/buttons/index';
4
+ import type { HeaderSelectionContext, FooterLookId, HeaderLayoutId, HeaderLookId, HeaderStyleId } from '../../../../theme-core/src/site-styles/index';
5
+ import type { ContentTypeSchema } from '../../../../content-model/src/index';
6
+ import type { ApiClient } from '../../../../api/src/request';
7
+ import type { SdkConfigForBlockPicker } from '../../../../editor-blocks/src/index';
8
+ import type { SurfaceId } from '../../../../surfaces/src/index';
9
+ import { type PreviewEntryData, type PreviewTemplateData } from './PreviewEditorSidebar';
10
+ import { type SiteStyleAccess } from './siteStyleAccess';
11
+ import { type PreviewRenderingMode, type PreviewThemeRuntime } from './themeRuntime';
12
+ type PreviewShellLayoutCommonProps = {
13
13
  children: ReactNode;
14
- /** Canonical site theme — persistence/configurator base, never page-adapted. */
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;
21
14
  surfaceId: SurfaceId;
22
15
  siteId: string;
23
16
  dashboardBaseUrl?: string | null;
@@ -45,8 +38,24 @@ export type PreviewShellLayoutProps = {
45
38
  assistantPanel?: ReactNode;
46
39
  sdkConfig?: SdkConfigForBlockPicker | null;
47
40
  bookingOfferingPresets?: readonly BookingOfferingPresetSummary[] | null;
48
- themeRuntime?: PreviewThemeRuntime;
49
41
  siteStyleAccess?: SiteStyleAccess;
50
42
  onFooterSaved?: () => void;
51
43
  };
52
- 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, isSiteLaunched, maintenanceModeEnabled, entrySubrouteContext, assistantPanel, sdkConfig, bookingOfferingPresets, themeRuntime, siteStyleAccess, onFooterSaved, }: PreviewShellLayoutProps): React.JSX.Element;
44
+ type ThemedPreviewShellLayoutProps = PreviewShellLayoutCommonProps & {
45
+ rendering?: never;
46
+ /** Canonical persistence/configurator base, never page-adapted. */
47
+ theme: Theme;
48
+ renderTheme?: Theme | null;
49
+ themeRuntime?: PreviewThemeRuntime;
50
+ };
51
+ type OverrideOnlyPreviewShellLayoutProps = PreviewShellLayoutCommonProps & {
52
+ rendering: Extract<PreviewRenderingMode, {
53
+ kind: 'overrides-only';
54
+ }>;
55
+ theme?: never;
56
+ renderTheme?: never;
57
+ themeRuntime?: never;
58
+ };
59
+ export type PreviewShellLayoutProps = ThemedPreviewShellLayoutProps | OverrideOnlyPreviewShellLayoutProps;
60
+ export declare function PreviewShellLayout(props: PreviewShellLayoutProps): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | React.JSX.Element | null | undefined;
61
+ export {};
@@ -1,13 +1,13 @@
1
- import React, { type ReactElement, type ReactNode } from "react";
2
- import { type SiteChromeRenderModel } from "../../../../blocks/src/client/site-chrome";
3
- import type { ViewportMode } from "./PreviewViewportControls";
4
- import { type PreviewThemeRuntime } from "./themeRuntime";
1
+ import React, { type ReactElement, type ReactNode } from 'react';
2
+ import { type SiteChromeRenderModel } from '../../../../blocks/src/client/site-chrome';
3
+ import type { ViewportMode } from './PreviewViewportControls';
4
+ import { type PreviewThemeRuntime } from './themeRuntime';
5
5
  export declare function PreviewThemedSiteDocument({ children, themeRuntime, useContainerResponsiveMode, viewportMode, viewportWidth, scale, contentHeight, scaleContainerRef, contentRef, staticHeaderNode, bannerNode, staticFooterNode, siteChromeRenderModel, }: {
6
6
  children: ReactNode;
7
7
  themeRuntime?: PreviewThemeRuntime;
8
8
  useContainerResponsiveMode: boolean;
9
9
  viewportMode: ViewportMode;
10
- viewportWidth: number | "full";
10
+ viewportWidth: number | 'full';
11
11
  scale: number;
12
12
  contentHeight: number;
13
13
  scaleContainerRef: (node: HTMLDivElement | null) => void;
@@ -17,3 +17,16 @@ export declare function PreviewThemedSiteDocument({ children, themeRuntime, useC
17
17
  staticFooterNode: ReactNode;
18
18
  siteChromeRenderModel: SiteChromeRenderModel | null;
19
19
  }): ReactElement | null;
20
+ export declare function PreviewOverrideOnlySiteDocument({ children, runtime, useContainerResponsiveMode, viewportMode, viewportWidth, scale, contentHeight, scaleContainerRef, contentRef, }: {
21
+ children: ReactNode;
22
+ runtime: Extract<PreviewThemeRuntime, {
23
+ kind: 'responsive-only' | 'none';
24
+ }>;
25
+ useContainerResponsiveMode: boolean;
26
+ viewportMode: ViewportMode;
27
+ viewportWidth: number | 'full';
28
+ scale: number;
29
+ contentHeight: number;
30
+ scaleContainerRef: (node: HTMLDivElement | null) => void;
31
+ contentRef: React.RefObject<HTMLDivElement | null>;
32
+ }): ReactElement | null;
@@ -1,6 +1,15 @@
1
1
  import type { ThemeResponsiveMode, ThemeRuntime } from '../../../../theme-core/src/index';
2
2
  export type PreviewThemeResponsiveMode = ThemeResponsiveMode;
3
3
  export type PreviewThemeRuntime = ThemeRuntime;
4
+ export type PreviewRenderingMode = Readonly<{
5
+ kind: 'themed';
6
+ themeRuntime: PreviewThemeRuntime;
7
+ }> | Readonly<{
8
+ kind: 'overrides-only';
9
+ runtime: Extract<PreviewThemeRuntime, {
10
+ kind: 'responsive-only' | 'none';
11
+ }>;
12
+ }>;
4
13
  export declare const defaultPreviewThemeRuntime: {
5
14
  readonly kind: "cms-theme";
6
15
  };
@@ -1,8 +1,8 @@
1
- import type { MediaAssetIndexItem } from "../../../../blocks/src/index";
2
- import type { SurfaceId } from "../../../../surfaces/src/index";
3
- import type { PreviewRuntimeSession } from "../../auth-contract";
4
- import type { PreviewThemeRuntime } from "../preview/themeRuntime";
5
- export { SdkPreviewModeRuntime as SdkPreviewMode } from "./SdkPreviewModeRuntime";
1
+ import type { MediaAssetIndexItem } from '../../../../blocks/src/index';
2
+ import type { SurfaceId } from '../../../../surfaces/src/index';
3
+ import type { PreviewRuntimeSession } from '../../auth-contract';
4
+ import type { PreviewRenderingMode, PreviewThemeRuntime } from '../preview/themeRuntime';
5
+ export { SdkPreviewModeRuntime as SdkPreviewMode } from './SdkPreviewModeRuntime';
6
6
  export type SdkPreviewModeContent = {
7
7
  page: unknown;
8
8
  pageId: string;
@@ -18,7 +18,8 @@ export type SdkPreviewModeContent = {
18
18
  supabaseUrl?: string;
19
19
  mediaAssets?: MediaAssetIndexItem[];
20
20
  };
21
- export type SdkPreviewModeProps = {
21
+ export type SdkPreviewRenderingMode = PreviewRenderingMode;
22
+ type SdkPreviewModeCommonProps = {
22
23
  apiBaseUrl: string;
23
24
  dashboardBaseUrl?: string | null;
24
25
  siteId: string;
@@ -27,6 +28,20 @@ export type SdkPreviewModeProps = {
27
28
  previewSession: PreviewRuntimeSession | null;
28
29
  previewToken: string;
29
30
  content: SdkPreviewModeContent;
31
+ };
32
+ type ThemedSdkPreviewModeProps = SdkPreviewModeCommonProps & {
33
+ rendering?: Extract<PreviewRenderingMode, {
34
+ kind: 'themed';
35
+ }>;
30
36
  blockOverrides?: unknown;
31
37
  themeRuntime?: PreviewThemeRuntime;
32
38
  };
39
+ type OverrideOnlySdkPreviewModeProps = SdkPreviewModeCommonProps & {
40
+ rendering: Extract<PreviewRenderingMode, {
41
+ kind: 'overrides-only';
42
+ }>;
43
+ blockOverrides: unknown;
44
+ themeRuntime?: never;
45
+ };
46
+ export type SdkPreviewModeProps = ThemedSdkPreviewModeProps | OverrideOnlySdkPreviewModeProps;
47
+ export type SdkPreviewModePropsWithoutBlockOverrides = SdkPreviewModeProps extends infer Props ? Props extends unknown ? Omit<Props, 'blockOverrides'> : never : never;
@@ -1,8 +1,8 @@
1
- export { PreviewLayoutProvider, usePreviewLayout, useOptionalPreviewLayout, } from "./layout/PreviewLayoutContext";
2
- export { PreviewQueryProvider, createPreviewQueryClient, } from "./preview/PreviewQueryProvider";
3
- export { PreviewShell } from "./preview/PreviewShell";
4
- export type { PreviewShellProps } from "./preview/PreviewShell";
5
- export { PreviewShellLayout } from "./preview/PreviewShellLayout";
6
- export type { PreviewShellLayoutProps } from "./preview/PreviewShellLayout";
7
- export type { SdkPreviewModeContent, SdkPreviewModeProps, } from "./sdk/SdkPreviewMode";
8
- export { SdkPreviewMode } from "./sdk/SdkPreviewMode";
1
+ export { PreviewLayoutProvider, usePreviewLayout, useOptionalPreviewLayout, } from './layout/PreviewLayoutContext';
2
+ export { PreviewQueryProvider, createPreviewQueryClient, } from './preview/PreviewQueryProvider';
3
+ export { PreviewShell } from './preview/PreviewShell';
4
+ export type { PreviewShellProps } from './preview/PreviewShell';
5
+ export { PreviewShellLayout } from './preview/PreviewShellLayout';
6
+ export type { PreviewShellLayoutProps } from './preview/PreviewShellLayout';
7
+ export type { SdkPreviewModeContent, SdkPreviewModeProps, SdkPreviewModePropsWithoutBlockOverrides, } from './sdk/SdkPreviewMode';
8
+ export { SdkPreviewMode } from './sdk/SdkPreviewMode';
@@ -1,3 +1,9 @@
1
1
  import type { CreateCatchAllPageOptions, CreateCatchAllPageResult } from './types';
2
+ type InvalidCatchAllRenderingOption = 'missing_block_overrides' | 'theme_option_in_overrides_only' | 'theme_runtime_in_overrides_only';
3
+ export declare class InvalidCatchAllRenderingOptionsError extends Error {
4
+ readonly code: InvalidCatchAllRenderingOption;
5
+ constructor(code: InvalidCatchAllRenderingOption);
6
+ }
2
7
  /** Build a Next.js catch-all page and metadata generator for Riverbank content. */
3
8
  export declare function createCatchAllPage(options: CreateCatchAllPageOptions): CreateCatchAllPageResult;
9
+ export {};
@@ -37,9 +37,10 @@
37
37
  *
38
38
  * @packageDocumentation
39
39
  */
40
- export { createCatchAllPage } from './catch-all';
40
+ export { createCatchAllPage, InvalidCatchAllRenderingOptionsError, } from './catch-all';
41
41
  export { RiverbankContentLoadError, SdkContentLoadError, classifyContentLoadError, isSdkContentLoadError, toContentLoadFailureLogFields, type CatchAllContentLoadFailureContext, type CatchAllRequestContext, type ClassifiedContentLoadError, type SdkContentLoadFailure, type SdkContentLoadFailureKind, type SdkContentLoadNotFound, } from './content-load-failure';
42
42
  export type { CreateCatchAllPageOptions, CreateCatchAllPageResult, CatchAllPageProps, CatchAllContext, ThemeSwitchConfigV1, ThemeResolverContext, } from './types';
43
+ export type { SdkOverrideOnlyRendering, SdkOverrideOnlyRuntime, SdkRenderingMode, } from '../rendering/renderingMode';
43
44
  export type { BlockLoaderMap, DataLoaderContext, DataLoaderFn, DataLoaderOverrides, DataLoaderPreviewStage, DataLoaderRenderTarget, DataLoaderSearchParams, DataLoaderValue, } from '../data/types';
44
45
  export { createGenerateStaticParams, generateAllStaticParams, normalizeStaticRoutePath, validateStaticParamsEnv, pathToSlugArray, routesToStaticParams, type CreateGenerateStaticParamsOptions, type GenerateAllStaticParamsOptions, type StaticParam, type StaticParamsClient, type StaticParamsEnvResult, type StaticParamsFailureContext, type StaticParamsFailureMode, type StaticParamsRoute, } from './static-params';
45
46
  export { createSitemap, type CreateSitemapOptions, type SitemapGenerator, } from './sitemap';
@@ -0,0 +1,33 @@
1
+ import React from 'react';
2
+ import { type LoadContentResult } from '../rendering/helpers/loadContent';
3
+ import type { BlockOverrideRegistrations } from '../rendering/overrides';
4
+ import type { SdkRenderingMode } from '../rendering/renderingMode';
5
+ import type { SdkThemeRuntime } from '../rendering/themeRuntime';
6
+ import type { Theme } from '../contracts';
7
+ import type { toEntrySubrouteContext } from './catch-all-utils';
8
+ type CommonRenderInput = Readonly<{
9
+ apiBaseUrl: string;
10
+ blockOverrides?: BlockOverrideRegistrations;
11
+ content: LoadContentResult;
12
+ entrySubrouteContext: ReturnType<typeof toEntrySubrouteContext>;
13
+ portalToken: string | null;
14
+ preview: boolean;
15
+ }>;
16
+ export type SdkContentRenderInput = CommonRenderInput & (Readonly<{
17
+ kind: 'themed';
18
+ theme: Theme;
19
+ themeRuntime: SdkThemeRuntime;
20
+ }> | Readonly<{
21
+ kind: 'overrides-only';
22
+ rendering: Extract<SdkRenderingMode, {
23
+ kind: 'overrides-only';
24
+ }>;
25
+ }>);
26
+ export type RenderSdkContentResult = Readonly<{
27
+ kind: 'rendered';
28
+ node: React.ReactNode;
29
+ }> | Readonly<{
30
+ kind: 'not-found';
31
+ }>;
32
+ export declare function renderSdkContent(input: SdkContentRenderInput): Promise<RenderSdkContentResult>;
33
+ export {};
@@ -9,6 +9,7 @@ import type { RiverbankClient } from '../client/types';
9
9
  import type { RiverbankSiteConfig } from '../config/types';
10
10
  import type { Theme } from '../contracts';
11
11
  import type { SdkThemeRuntime } from '../rendering/themeRuntime';
12
+ import type { SdkOverrideOnlyRendering, SdkRenderingMode } from '../rendering/renderingMode';
12
13
  import type { BlockOverrideRegistrations } from '../rendering/overrides';
13
14
  import type { Metadata } from '../metadata/generatePageMetadata';
14
15
  import type { LoadContentResult } from '../rendering/helpers/loadContent';
@@ -30,6 +31,8 @@ export interface CatchAllContext {
30
31
  * visual theme/responsive infrastructure contract.
31
32
  */
32
33
  themeRuntime: SdkThemeRuntime;
34
+ /** Explicit rendering capabilities selected for this request. */
35
+ rendering: SdkRenderingMode;
33
36
  /** Search parameters from the URL (for filtering, pagination, etc.) */
34
37
  searchParams: DataLoaderSearchParams;
35
38
  }
@@ -138,7 +141,7 @@ type CatchAllThemeOptions = {
138
141
  * });
139
142
  * ```
140
143
  */
141
- export type CreateCatchAllPageOptions = {
144
+ type CreateCatchAllPageBaseOptions = {
142
145
  /**
143
146
  * Function that returns the Riverbank client.
144
147
  * Called fresh on each request to support different caching strategies.
@@ -186,7 +189,6 @@ export type CreateCatchAllPageOptions = {
186
189
  * Wrap client-heavy dynamic imports with defineLazyBlockOverride(); raw
187
190
  * promise-returning functions are not lazy override registrations.
188
191
  */
189
- blockOverrides?: BlockOverrideRegistrations;
190
192
  /**
191
193
  * Server-only host data loaders for custom blocks.
192
194
  *
@@ -286,12 +288,6 @@ export type CreateCatchAllPageOptions = {
286
288
  wrapper?: (props: {
287
289
  children: ReactNode;
288
290
  }) => ReactNode | Promise<ReactNode>;
289
- /**
290
- * Controls the runtime wrapper around rendered page content.
291
- *
292
- * @default { kind: 'responsive-only' }
293
- */
294
- themeRuntime?: SdkThemeRuntime;
295
291
  /**
296
292
  * Enable portal authentication for the reserved `/portal` customer route.
297
293
  *
@@ -315,7 +311,25 @@ export type CreateCatchAllPageOptions = {
315
311
  * ```
316
312
  */
317
313
  enablePortal?: boolean;
318
- } & CatchAllThemeOptions;
314
+ };
315
+ type ThemedCatchAllOptions = CatchAllThemeOptions & {
316
+ /** Default theme-backed rendering behavior. */
317
+ rendering?: never;
318
+ blockOverrides?: BlockOverrideRegistrations;
319
+ /** @default { kind: 'responsive-only' } */
320
+ themeRuntime?: SdkThemeRuntime;
321
+ };
322
+ type OverrideOnlyCatchAllOptions = {
323
+ /** Render exclusively through host-provided block overrides. */
324
+ rendering: SdkOverrideOnlyRendering;
325
+ blockOverrides: BlockOverrideRegistrations;
326
+ themeRuntime?: never;
327
+ theme?: never;
328
+ themes?: never;
329
+ themeSwitch?: never;
330
+ getTheme?: never;
331
+ };
332
+ export type CreateCatchAllPageOptions = CreateCatchAllPageBaseOptions & (ThemedCatchAllOptions | OverrideOnlyCatchAllOptions);
319
333
  /**
320
334
  * Next.js page props for catch-all routes.
321
335
  *
@@ -1,14 +1,13 @@
1
- import type { ComponentType, ReactNode } from "react";
2
- import type { CatchAllContext } from "../next/types";
3
- import type { SdkPreviewModeProps } from "./client";
4
- type PreviewModeClientProps = Omit<SdkPreviewModeProps, "blockOverrides">;
1
+ import type { ComponentType, ReactNode } from 'react';
2
+ import type { CatchAllContext } from '../next/types';
3
+ import type { SdkPreviewModePropsWithoutBlockOverrides } from './client';
5
4
  export type CreatePreviewModeBeforeRenderOptions = {
6
5
  getClient: () => {
7
6
  getBaseUrl(): string;
8
7
  };
9
8
  siteId: string;
10
9
  siteSlug: string;
11
- PreviewModeClient: ComponentType<PreviewModeClientProps>;
10
+ PreviewModeClient: ComponentType<SdkPreviewModePropsWithoutBlockOverrides>;
12
11
  /**
13
12
  * When omitted, defaults to `process.env.RIVERBANK_PREVIEW_MODE === 'true'`.
14
13
  * This mirrors the scaffolds and makes it easy to keep preview wiring committed
@@ -34,4 +33,3 @@ export type CreatePreviewModeBeforeRenderOptions = {
34
33
  * (e.g. `SdkPreviewModeClient`) to avoid serializing functions over the RSC boundary.
35
34
  */
36
35
  export declare function createPreviewModeBeforeRender(options: CreatePreviewModeBeforeRenderOptions): (context: CatchAllContext) => Promise<ReactNode | null>;
37
- export {};
@@ -1,6 +1,6 @@
1
- import React, { type ReactNode } from "react";
2
- import type { PreviewShellLayoutProps, PreviewShellProps, SdkPreviewModeProps } from "../../../../preview-next/src/client/index";
3
- export type { SdkPreviewModeContent, SdkPreviewModeProps, PreviewThemeRuntime, PreviewThemeResponsiveMode, PreviewShellProps, PreviewShellLayoutProps, } from '../../../../preview-next/src/client/index';
1
+ import React, { type ReactNode } from 'react';
2
+ import type { PreviewShellLayoutProps, PreviewShellProps, SdkPreviewModeProps } from '../../../../preview-next/src/client/index';
3
+ export type { SdkPreviewModeContent, SdkPreviewModeProps, SdkPreviewModePropsWithoutBlockOverrides, PreviewThemeRuntime, PreviewThemeResponsiveMode, PreviewShellProps, PreviewShellLayoutProps, } from '../../../../preview-next/src/client/index';
4
4
  type PreviewQueryProviderProps = Readonly<{
5
5
  children: ReactNode;
6
6
  }>;
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import type { PreviewShellLayoutProps, PreviewShellProps, SdkPreviewModeProps } from '../../../../preview-next/src/client/sdk-runtime';
3
3
  export { PreviewLayoutProvider, usePreviewLayout, useOptionalPreviewLayout, } from '../../../../preview-next/src/client/layout/PreviewLayoutContext';
4
4
  export { PreviewQueryProvider, createPreviewQueryClient, } from '../../../../preview-next/src/client/preview/PreviewQueryProvider';
5
- export type { PreviewShellProps, PreviewShellLayoutProps, SdkPreviewModeContent, SdkPreviewModeProps, } from '../../../../preview-next/src/client/sdk-runtime';
5
+ export type { PreviewShellProps, PreviewShellLayoutProps, SdkPreviewModeContent, SdkPreviewModeProps, SdkPreviewModePropsWithoutBlockOverrides, } from '../../../../preview-next/src/client/sdk-runtime';
6
6
  export declare function SdkPreviewMode(props: SdkPreviewModeProps): React.JSX.Element;
7
7
  export declare function PreviewShell(props: PreviewShellProps): React.JSX.Element;
8
8
  export declare function PreviewShellLayout(props: PreviewShellLayoutProps): React.JSX.Element;
@@ -6,6 +6,15 @@ import type { SiteBookingOfferingPresetSummary } from '../public-api/contracts';
6
6
  import { type BlocksImageResolveContextInput, type BlocksMediaAssetIndexItem } from './mediaAssets';
7
7
  import type { EventPageSurfaceSubjectWire } from '../../../core/src/index';
8
8
  export type ComponentRegistry = Record<string, React.ElementType>;
9
+ export type MissingBlockOverrideError = Error & Readonly<{
10
+ code: 'missing_block_override';
11
+ blockKind: string;
12
+ }>;
13
+ type MissingBlockOverrideErrorConstructor = Readonly<{
14
+ new (blockKind: string): MissingBlockOverrideError;
15
+ prototype: MissingBlockOverrideError;
16
+ }>;
17
+ export declare const MissingBlockOverrideError: MissingBlockOverrideErrorConstructor;
9
18
  export type PageRendererDataContext = {
10
19
  siteId?: string;
11
20
  pageId?: string;
@@ -36,8 +45,7 @@ export type BlocksPageRendererDataContext = Omit<PageRendererDataContext, 'media
36
45
  export type SdkConfigForRenderer = {
37
46
  customBlocks?: SdkCustomBlock[];
38
47
  };
39
- export type PageRendererProps = {
40
- theme: Theme;
48
+ type PageRendererCommonProps = {
41
49
  page: PageOutline | null;
42
50
  runtimeBoundaries?: readonly PageRuntimeBoundary[];
43
51
  usePlaceholders?: boolean;
@@ -45,10 +53,24 @@ export type PageRendererProps = {
45
53
  routeMap?: RouteMap;
46
54
  wrapBlock?: (blockId: string, rendered: React.ReactNode) => React.ReactNode;
47
55
  registry?: ComponentRegistry;
48
- themeTokens?: ThemeTokens;
49
56
  blockOverrides?: BlockOverrides;
50
57
  sdkConfig?: SdkConfigForRenderer | null;
51
58
  customBlocks?: SdkCustomBlock[];
52
59
  };
60
+ type ThemedPageRendererProps = PageRendererCommonProps & {
61
+ rendering?: never;
62
+ theme: Theme;
63
+ themeTokens?: ThemeTokens;
64
+ };
65
+ type OverrideOnlyPageRendererProps = PageRendererCommonProps & {
66
+ rendering: {
67
+ kind: 'overrides-only';
68
+ };
69
+ theme?: never;
70
+ themeTokens?: never;
71
+ blockOverrides: BlockOverrides;
72
+ };
73
+ export type PageRendererProps = ThemedPageRendererProps | OverrideOnlyPageRendererProps;
53
74
  export declare function toBlocksPageRendererDataContext(dataContext: PageRendererDataContext): BlocksPageRendererDataContext;
54
75
  export declare function PageRenderer(props: PageRendererProps): React.ReactElement;
76
+ export {};
@@ -11,11 +11,10 @@ import type { RiverbankClient } from '../../client/types';
11
11
  import type { BlockKind } from '../../types';
12
12
  import type { BlockOverrideComponent } from '../overrides';
13
13
  export type { BlockOverrideComponent } from '../overrides';
14
- export type BlockProps = {
14
+ type BlockCommonProps = {
15
15
  blockKind: BlockKind;
16
16
  blockId?: string | null;
17
17
  content: Record<string, unknown>;
18
- theme: Theme;
19
18
  siteId?: string;
20
19
  /**
21
20
  * Supabase storage URL for direct image access in SSR output and client
@@ -63,6 +62,18 @@ export type BlockProps = {
63
62
  */
64
63
  override?: BlockOverrideComponent;
65
64
  };
65
+ type ThemedBlockProps = BlockCommonProps & {
66
+ rendering?: never;
67
+ theme: Theme;
68
+ };
69
+ type OverrideOnlyBlockProps = BlockCommonProps & {
70
+ rendering: {
71
+ kind: 'overrides-only';
72
+ };
73
+ theme?: never;
74
+ override: BlockOverrideComponent;
75
+ };
76
+ export type BlockProps = ThemedBlockProps | OverrideOnlyBlockProps;
66
77
  export type BlockHydrationBootstrapConfig = {
67
78
  siteId?: string;
68
79
  supabaseUrl?: string;
@@ -6,32 +6,34 @@
6
6
  import { buildMenu, buildFooterMenu, buildFooterMenuForRole, buildLogo } from '../../navigation';
7
7
  import type { RiverbankClient, SiteResponse } from '../../client/types';
8
8
  import { type SdkThemeRuntime } from '../themeRuntime';
9
- export type HeaderData = {
9
+ import { type SdkOverrideOnlyRendering } from '../renderingMode';
10
+ export type CustomHeaderData = {
10
11
  menu: ReturnType<typeof buildMenu>;
11
12
  logo: ReturnType<typeof buildLogo>;
12
13
  site: SiteResponse['site'];
13
- theme: SiteResponse['theme'];
14
14
  routes: SiteResponse['routes'];
15
15
  };
16
- export type FooterData = {
16
+ export type CustomFooterData = {
17
17
  menu: ReturnType<typeof buildMenu>;
18
18
  footerMenu: ReturnType<typeof buildFooterMenu>;
19
19
  legalFooterMenu: ReturnType<typeof buildFooterMenuForRole>;
20
20
  logo: ReturnType<typeof buildLogo>;
21
21
  site: SiteResponse['site'];
22
- theme: SiteResponse['theme'];
23
22
  routes: SiteResponse['routes'];
24
23
  };
25
- export type LayoutProps = {
24
+ export type HeaderData = CustomHeaderData & {
25
+ theme: SiteResponse['theme'];
26
+ };
27
+ export type FooterData = CustomFooterData & {
28
+ theme: SiteResponse['theme'];
29
+ };
30
+ type LayoutCommonProps = {
26
31
  siteData?: SiteResponse;
27
32
  client?: RiverbankClient;
28
33
  siteId?: string;
29
34
  slug?: string;
30
35
  domain?: string;
31
36
  children: React.ReactNode;
32
- header?: boolean | ((data: HeaderData) => React.ReactNode);
33
- footer?: boolean | ((data: FooterData) => React.ReactNode);
34
- headerVariant?: 'classic' | 'centered' | 'transparent' | 'floating';
35
37
  /**
36
38
  * Whether the current request has an active portal session.
37
39
  * Used to resolve portal navigation labels (e.g. "Login" vs "My account").
@@ -41,17 +43,27 @@ export type LayoutProps = {
41
43
  hasPortalSession?: boolean;
42
44
  /** Render stage for internal links and block transforms. */
43
45
  previewStage?: 'published' | 'preview';
44
- /**
45
- * Controls the runtime wrapper around SDK layout content.
46
- *
47
- * - cms-theme: inject CMS theme variables and component CSS
48
- * - responsive-only: keep the responsive utility root without CMS theme styles
49
- * - none: render no SDK runtime wrapper; only safe with fully custom chrome
50
- *
51
- * @default { kind: 'cms-theme' }
52
- */
46
+ };
47
+ type ThemedLayoutProps = LayoutCommonProps & {
48
+ rendering?: never;
49
+ header?: boolean | ((data: HeaderData) => React.ReactNode);
50
+ footer?: boolean | ((data: FooterData) => React.ReactNode);
51
+ headerVariant?: 'classic' | 'centered' | 'transparent' | 'floating';
53
52
  themeRuntime?: SdkThemeRuntime;
54
53
  };
54
+ type OverrideOnlyLayoutProps = LayoutCommonProps & {
55
+ rendering: SdkOverrideOnlyRendering;
56
+ header: false | ((data: CustomHeaderData) => React.ReactNode);
57
+ footer: false | ((data: CustomFooterData) => React.ReactNode);
58
+ headerVariant?: never;
59
+ themeRuntime?: never;
60
+ };
61
+ export type LayoutProps = ThemedLayoutProps | OverrideOnlyLayoutProps;
62
+ export declare class UnsupportedOverrideOnlyLayoutChromeError extends Error {
63
+ readonly surface: 'header' | 'footer';
64
+ readonly code = "unsupported_override_only_layout_chrome";
65
+ constructor(surface: 'header' | 'footer');
66
+ }
55
67
  /**
56
68
  * Layout component that wraps content with site header and footer.
57
69
  *
@@ -87,4 +99,5 @@ export type LayoutProps = {
87
99
  * </Layout>
88
100
  * ```
89
101
  */
90
- export declare function Layout({ siteData: providedSiteData, client, siteId, slug, domain, children, header, footer, headerVariant, hasPortalSession, previewStage, themeRuntime, }: LayoutProps): Promise<import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>>;
102
+ export declare function Layout(props: LayoutProps): Promise<import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>>;
103
+ export {};