@riverbankcms/sdk 0.70.2 → 0.70.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.
Files changed (89) hide show
  1. package/README.md +29 -0
  2. package/dist/_dts/api/src/contentTypes.d.ts +2 -1
  3. package/dist/_dts/block-form/src/client/index.d.ts +1 -1
  4. package/dist/_dts/block-form/src/fields/types.d.ts +14 -2
  5. package/dist/_dts/block-form/src/registry/schemas.d.ts +2 -0
  6. package/dist/_dts/block-form/src/widgets/MediaField/mediaFieldDefaults.d.ts +2 -2
  7. package/dist/_dts/block-form/src/widgets/MediaField/mediaFieldSchema.d.ts +2 -2
  8. package/dist/_dts/blocks/src/lib/media.d.ts +1 -1
  9. package/dist/_dts/blocks/src/system/blocks/appointment-booking.d.ts +1829 -149
  10. package/dist/_dts/blocks/src/system/blocks/blog-listing.d.ts +1829 -149
  11. package/dist/_dts/blocks/src/system/blocks/cart.d.ts +1829 -149
  12. package/dist/_dts/blocks/src/system/blocks/checkout.d.ts +1829 -149
  13. package/dist/_dts/blocks/src/system/blocks/collection.d.ts +1829 -149
  14. package/dist/_dts/blocks/src/system/blocks/cta-full.d.ts +1 -30727
  15. package/dist/_dts/blocks/src/system/blocks/events/event-spotlight.d.ts +11 -30827
  16. package/dist/_dts/blocks/src/system/blocks/faq.d.ts +1829 -149
  17. package/dist/_dts/blocks/src/system/blocks/file-download.d.ts +3 -3
  18. package/dist/_dts/blocks/src/system/blocks/gifting.d.ts +1829 -149
  19. package/dist/_dts/blocks/src/system/blocks/media-text.d.ts +106 -1
  20. package/dist/_dts/blocks/src/system/blocks/product-detail.d.ts +1829 -149
  21. package/dist/_dts/blocks/src/system/blocks/product-list.d.ts +1829 -149
  22. package/dist/_dts/blocks/src/system/blocks/shop.d.ts +1829 -149
  23. package/dist/_dts/blocks/src/system/defineBlock.d.ts +3 -3
  24. package/dist/_dts/blocks/src/system/fragments/library/card.d.ts +2 -30793
  25. package/dist/_dts/blocks/src/system/fragments/library/ctaRow.d.ts +2 -30727
  26. package/dist/_dts/blocks/src/system/fragments/library/feedbackCallout.d.ts +2 -30779
  27. package/dist/_dts/blocks/src/system/fragments/library/heroCtaRow.d.ts +33 -30743
  28. package/dist/_dts/blocks/src/system/fragments/library/sectionState.d.ts +2 -30770
  29. package/dist/_dts/blocks/src/system/fragments/types.d.ts +8 -7
  30. package/dist/_dts/blocks/src/system/manifest/derivedContent.d.ts +7 -5
  31. package/dist/_dts/blocks/src/system/manifest/fieldValidation/index.d.ts +1 -1
  32. package/dist/_dts/blocks/src/system/manifest/schema.d.ts +192 -3
  33. package/dist/_dts/blocks/src/system/runtime/nodes/file-download.d.ts +1 -1
  34. package/dist/_dts/content-model/src/content-types/schema.d.ts +7 -0
  35. package/dist/_dts/content-model/src/contentManifest.d.ts +4 -1
  36. package/dist/_dts/content-model/src/templates/bindingTypeCompatibility.d.ts +1 -1
  37. package/dist/_dts/core/src/index.d.ts +1 -1
  38. package/dist/_dts/core/src/planner.d.ts +4 -0
  39. package/dist/_dts/db/src/generated/supabase/database.types.d.ts +53 -20
  40. package/dist/_dts/editor-blocks/src/index.d.ts +1 -1
  41. package/dist/_dts/editor-blocks/src/media/MediaField.d.ts +6 -5
  42. package/dist/_dts/media-core/src/videoSlotPolicy.d.ts +0 -1
  43. package/dist/_dts/media-editor/src/context.d.ts +4 -1
  44. package/dist/_dts/media-react/src/hooks/useApiMediaUploader.d.ts +8 -1
  45. package/dist/_dts/media-react/src/index.d.ts +1 -5
  46. package/dist/_dts/preview-next/src/client/widgets/PreviewMediaField.d.ts +2 -1
  47. package/dist/_dts/preview-next/src/client/widgets/widgetOverrides.d.ts +1 -0
  48. package/dist/_dts/sdk/src/cli/commands/delete.d.ts +3 -0
  49. package/dist/_dts/sdk/src/cli/commands/style.d.ts +18 -0
  50. package/dist/_dts/sdk/src/cli/helpers.d.ts +8 -33
  51. package/dist/_dts/sdk/src/cli/site-commands/oneOffCommands.d.ts +81 -0
  52. package/dist/_dts/sdk/src/components.d.ts +2 -1
  53. package/dist/_dts/sdk/src/config/field-definitions.d.ts +6 -2
  54. package/dist/_dts/sdk/src/config/typed-entries.d.ts +4 -2
  55. package/dist/_dts/sdk/src/contracts/system-block-content.d.ts +2 -1
  56. package/dist/_dts/sdk/src/manifest/prompt/examples/cta.d.ts +5 -5
  57. package/dist/_dts/sdk/src/manifest/prompt/examples/features-grid.d.ts +2 -2
  58. package/dist/_dts/sdk/src/manifest/prompt/examples/hero.d.ts +2 -2
  59. package/dist/_dts/sdk/src/manifest/prompt/examples/pricing.d.ts +10 -10
  60. package/dist/_dts/sdk/src/manifest/prompt/examples/testimonials.d.ts +4 -4
  61. package/dist/_dts/sdk/src/manifest/validation/output-schema.d.ts +11 -1
  62. package/dist/_dts/sdk/src/next/types.d.ts +4 -2
  63. package/dist/_dts/sdk/src/public-api/contracts.d.ts +2 -1
  64. package/dist/_dts/sdk/src/rendering/index.d.ts +2 -1
  65. package/dist/_dts/sdk/src/rendering/overrideResolution.d.ts +10 -0
  66. package/dist/_dts/sdk/src/rendering/overrides.d.ts +12 -0
  67. package/dist/_dts/sdk/src/version.d.ts +1 -1
  68. package/dist/cli/index.mjs +1072 -289
  69. package/dist/cli/init-docs/content/workflow-preview-mode.md +167 -0
  70. package/dist/client/client.mjs +443 -403
  71. package/dist/client/hooks.mjs +172 -121
  72. package/dist/client/rendering/client.mjs +148 -112
  73. package/dist/client/rendering/islands.mjs +80 -31
  74. package/dist/client/rendering.mjs +25531 -25481
  75. package/dist/preview-next/client/runtime.mjs +394 -1136
  76. package/dist/server/components.mjs +229 -171
  77. package/dist/server/config-template-validation.mjs +31 -1
  78. package/dist/server/config-validation.mjs +172 -121
  79. package/dist/server/config.mjs +172 -121
  80. package/dist/server/data.mjs +172 -121
  81. package/dist/server/index.mjs +1 -1
  82. package/dist/server/next.mjs +301 -174
  83. package/dist/server/page-converter.mjs +379 -185
  84. package/dist/server/prebuild.mjs +1 -1
  85. package/dist/server/rendering/server.mjs +219 -171
  86. package/dist/server/rendering.mjs +229 -171
  87. package/dist/server/routing.mjs +175 -124
  88. package/dist/server/server.mjs +173 -122
  89. package/package.json +5 -3
@@ -4,6 +4,7 @@
4
4
  * Apply bounded site-style selections via the command-backed theme API.
5
5
  */
6
6
  import { Command } from 'commander';
7
+ import { type CuratedSiteStyle } from '../../../../theme-core/src/site-styles/index';
7
8
  import type { ThemeStyleSelectionApplyInput } from '../../client/management';
8
9
  export type StyleApplyOptions = Readonly<{
9
10
  siteStyleId: string;
@@ -15,5 +16,22 @@ export type StyleApplyOptions = Readonly<{
15
16
  headerLookId?: string;
16
17
  footerLookId?: string;
17
18
  }>;
19
+ export type StyleCatalogListOptions = Readonly<{
20
+ siteStyleId?: string;
21
+ }>;
22
+ export type StyleCatalogChoice = Readonly<{
23
+ id: string;
24
+ label: string;
25
+ }>;
26
+ export type StyleCatalogListRow = Readonly<{
27
+ siteStyleId: string;
28
+ name: string;
29
+ palettes: readonly StyleCatalogChoice[];
30
+ buttonPersonalities: readonly StyleCatalogChoice[];
31
+ headerLooks: readonly StyleCatalogChoice[];
32
+ footerLooks: readonly StyleCatalogChoice[];
33
+ }>;
18
34
  export declare function buildStyleSelectionApplyInputFromOptions(options: StyleApplyOptions): ThemeStyleSelectionApplyInput;
35
+ export declare function buildStyleCatalogListRows(styles?: readonly CuratedSiteStyle[], options?: StyleCatalogListOptions): readonly StyleCatalogListRow[];
36
+ export declare function formatStyleCatalogListRow(row: StyleCatalogListRow): string[];
19
37
  export declare const styleCommand: Command;
@@ -5,6 +5,7 @@
5
5
  * Reduces duplication and ensures consistent behavior.
6
6
  */
7
7
  import { Command } from 'commander';
8
+ import type { SiteId } from '../../../core/src/index';
8
9
  import type { ManagementClient } from '../client/management/types';
9
10
  import { type OutputContext } from './output';
10
11
  import { type CliErrorContext } from './errors';
@@ -52,6 +53,8 @@ export interface CommandContext {
52
53
  client: ManagementClient;
53
54
  isRemote: boolean;
54
55
  isJsonOutput: boolean;
56
+ targetEnv: EnvTarget;
57
+ siteId: SiteId;
55
58
  /** Environment targets for this operation */
56
59
  envTargets: EnvTarget[];
57
60
  }
@@ -271,6 +274,11 @@ export declare function handleCommandError(error: unknown, output: OutputContext
271
274
  * }))
272
275
  */
273
276
  export declare function withErrorHandling<TArgs extends unknown[]>(action: (...args: [...TArgs, Command]) => Promise<void>): (...args: [...TArgs, Command]) => Promise<void>;
277
+ /**
278
+ * Wrap a command action so handlers receive a resolved command context instead
279
+ * of the raw Commander instance.
280
+ */
281
+ export declare function withCommandContext<TArgs extends unknown[], TOptions = unknown>(action: (ctx: CommandContext, ...args: [...TArgs, TOptions]) => Promise<void>): (...args: [...TArgs, TOptions, Command]) => Promise<void>;
274
282
  /**
275
283
  * Wrap a destructive command action with confirmation prompt and error handling.
276
284
  *
@@ -289,39 +297,6 @@ export declare function withErrorHandling<TArgs extends unknown[]>(action: (...a
289
297
  * ))
290
298
  */
291
299
  export declare function withConfirmation<TArgs extends unknown[]>(getMessage: (...args: TArgs) => string, action: (ctx: CommandContext, ...args: TArgs) => Promise<void>): (...args: [...TArgs, ConfirmOptions, Command]) => Promise<void>;
292
- /**
293
- * Configuration for publish/unpublish command factories.
294
- */
295
- export interface PublishCommandConfig {
296
- /** Resource name for display (e.g., 'entry', 'page') */
297
- resourceName: string;
298
- /** Argument names (e.g., ['type', 'identifier'] or ['identifier']) */
299
- args: readonly string[];
300
- /** Function to call the appropriate client method */
301
- action: (client: ManagementClient, ...args: string[]) => Promise<void>;
302
- }
303
- /**
304
- * Create a publish command for a resource.
305
- *
306
- * @example
307
- * const publishCommand = createPublishCommand({
308
- * resourceName: 'entry',
309
- * args: ['type', 'identifier'],
310
- * action: (client, type, id) => client.entries.publish(type, id),
311
- * });
312
- */
313
- export declare function createPublishCommand(config: PublishCommandConfig): Command;
314
- /**
315
- * Create an unpublish command for a resource.
316
- *
317
- * @example
318
- * const unpublishCommand = createUnpublishCommand({
319
- * resourceName: 'entry',
320
- * args: ['type', 'identifier'],
321
- * action: (client, type, id) => client.entries.unpublish(type, id),
322
- * });
323
- */
324
- export declare function createUnpublishCommand(config: PublishCommandConfig): Command;
325
300
  /**
326
301
  * Configuration for get command factory.
327
302
  */
@@ -0,0 +1,81 @@
1
+ import { type Result, type SiteId } from '../../../../core/src/index';
2
+ import type { ManagementBlock, ManagementClient, ManagementEntry, ManagementNavigationMenu, ManagementPage, NavigationItemInput } from '../../client/management/types';
3
+ import type { EnvTarget } from '../helpers';
4
+ import { type CliCommandCompileBatchSuccessWithReports, type CliCommandValidationCompileError } from './commandRuntime';
5
+ import { type EntryCommandReportSubject, type EntrySiteCommand, type EntrySiteCommandType } from './entryCommands';
6
+ import { type NavigationCommandReportSubject, type NavigationSiteCommand, type NavigationSiteCommandType } from './navigationCommands';
7
+ import { type PageCommandReportSubject, type PageSiteCommand, type PageSiteCommandType } from './pageCommands';
8
+ export type OneOffCommandBatchSource = 'one_off_entry' | 'one_off_page' | 'one_off_block' | 'one_off_navigation';
9
+ type OneOffCompileInput<TMutation> = Readonly<{
10
+ source: OneOffCommandBatchSource;
11
+ siteId: SiteId;
12
+ targetEnv: EnvTarget;
13
+ mutation: TMutation;
14
+ }>;
15
+ export type OneOffEntryMutation = Readonly<{
16
+ kind: 'upsert';
17
+ contentType: string;
18
+ identifier: string;
19
+ data: Record<string, unknown>;
20
+ slug?: string;
21
+ }> | Readonly<{
22
+ kind: 'publish' | 'unpublish';
23
+ contentType: string;
24
+ identifier: string;
25
+ }>;
26
+ export type OneOffPageMutation = Readonly<{
27
+ kind: 'upsert';
28
+ identifier: string;
29
+ title: string;
30
+ path: string;
31
+ seoTitle?: string;
32
+ seoDescription?: string;
33
+ }> | Readonly<{
34
+ kind: 'publish' | 'unpublish';
35
+ identifier: string;
36
+ }>;
37
+ export type OneOffBlockMutation = Readonly<{
38
+ kind: 'upsert';
39
+ pageIdentifier: string;
40
+ blockIdentifier: string;
41
+ blockKind: string;
42
+ data: Record<string, unknown>;
43
+ }> | Readonly<{
44
+ kind: 'reorder';
45
+ pageIdentifier: string;
46
+ blockIdentifiers: readonly string[];
47
+ }>;
48
+ export type OneOffNavigationMutation = Readonly<{
49
+ kind: 'upsert';
50
+ menuName: string;
51
+ items: readonly NavigationItemInput[];
52
+ }>;
53
+ export type OneOffEntryCommandCompileSuccess = CliCommandCompileBatchSuccessWithReports<EntrySiteCommandType, EntryCommandReportSubject>;
54
+ export type OneOffPageCommandCompileSuccess = CliCommandCompileBatchSuccessWithReports<PageSiteCommandType, PageCommandReportSubject>;
55
+ export type OneOffNavigationCommandCompileSuccess = CliCommandCompileBatchSuccessWithReports<NavigationSiteCommandType, NavigationCommandReportSubject>;
56
+ export declare function compileOneOffEntryCommand(input: OneOffCompileInput<OneOffEntryMutation>): Result<OneOffEntryCommandCompileSuccess, CliCommandValidationCompileError>;
57
+ export declare function compileOneOffPageCommand(input: OneOffCompileInput<OneOffPageMutation>): Result<OneOffPageCommandCompileSuccess, CliCommandValidationCompileError>;
58
+ export declare function compileOneOffBlockCommand(input: OneOffCompileInput<OneOffBlockMutation>): Result<OneOffPageCommandCompileSuccess, CliCommandValidationCompileError>;
59
+ export declare function compileOneOffNavigationCommand(input: OneOffCompileInput<OneOffNavigationMutation>): Result<OneOffNavigationCommandCompileSuccess, CliCommandValidationCompileError>;
60
+ export declare function executeOneOffEntryCommand<TResult>(input: Readonly<{
61
+ compiledPlan: Pick<OneOffEntryCommandCompileSuccess, 'plan'>;
62
+ client: Pick<ManagementClient, 'entries'>;
63
+ apply: (command: EntrySiteCommand, client: Pick<ManagementClient, 'entries'>) => Promise<TResult>;
64
+ }>): Promise<TResult>;
65
+ export declare function executeOneOffPageCommand<TResult>(input: Readonly<{
66
+ compiledPlan: Pick<OneOffPageCommandCompileSuccess, 'plan'>;
67
+ client: Pick<ManagementClient, 'pages' | 'blocks'>;
68
+ apply: (command: PageSiteCommand, client: Pick<ManagementClient, 'pages' | 'blocks'>) => Promise<TResult>;
69
+ }>): Promise<TResult>;
70
+ export declare function executeOneOffNavigationCommand<TResult>(input: Readonly<{
71
+ compiledPlan: Pick<OneOffNavigationCommandCompileSuccess, 'plan'>;
72
+ client: Pick<ManagementClient, 'navigation'>;
73
+ apply: (command: NavigationSiteCommand, client: Pick<ManagementClient, 'navigation'>) => Promise<TResult>;
74
+ }>): Promise<TResult>;
75
+ export declare function applyOneOffEntryCommand(command: EntrySiteCommand, client: Pick<ManagementClient, 'entries'>): Promise<ManagementEntry | void>;
76
+ export declare function applyOneOffEntryCommandReturningEntry(command: EntrySiteCommand, client: Pick<ManagementClient, 'entries'>): Promise<ManagementEntry>;
77
+ export declare function applyOneOffPageCommand(command: PageSiteCommand, client: Pick<ManagementClient, 'pages' | 'blocks'>): Promise<ManagementPage | ManagementBlock | void>;
78
+ export declare function applyOneOffPageCommandReturningPage(command: PageSiteCommand, client: Pick<ManagementClient, 'pages' | 'blocks'>): Promise<ManagementPage>;
79
+ export declare function applyOneOffPageCommandReturningBlock(command: PageSiteCommand, client: Pick<ManagementClient, 'pages' | 'blocks'>): Promise<ManagementBlock>;
80
+ export declare function applyOneOffNavigationCommand(command: NavigationSiteCommand, client: Pick<ManagementClient, 'navigation'>): Promise<ManagementNavigationMenu>;
81
+ export {};
@@ -27,4 +27,5 @@ export { Layout } from './rendering/components/Layout';
27
27
  export type { LayoutProps, HeaderData, FooterData } from './rendering/components/Layout';
28
28
  export { PageRenderer, ThemeScope, buildThemeRuntime, RichText, resolveImageUrl, resolveImageUrlWithContext, resolveImageSourceSetWithContext, ImagePresets, } from './rendering';
29
29
  export type { AppointmentBookingContent, BlogListingContent, BlogPostContent, BodyTextAlignment, BodyTextContent, CollectionContent, ColumnsContent, CourseDetailsContent, CourseRegistrationContent, CtaFullContent, EmbedContent, EventCalendarContent, EventDetailsContent, EventListingContent, EventRegistrationContent, EventSpotlightContent, FaqContent, FormBlockContent, GiftingContent, HeroContent, HeroMedia, ImageGalleryContent, MediaTextContent, NewsletterSignupContent, ShopContent, SingleButtonContent, SiteFooterContent, SiteHeaderContent, SystemBlockContentByKind, SystemBlockContentFor, TeamMembersContent, TestimonialEntryContent, TestimonialsBlockContent, VideoGridContent, ImageOptions, ResolveImageUrlContext, ResolveImageSourceSetOptions, ResolvedImageSourceSet, PageOutline, RouteMap, Theme, ThemeTokens, Media, TipTapNode, LinkValue, RichTextPrimitiveProps, } from './rendering';
30
- export type { BlockOverrideProps, BlockOverrides, BlockOverrideComponent, KnownSystemBlockOverrides, } from './rendering';
30
+ export type { BlockOverrideProps, BlockOverrideRegistration, BlockOverrideRegistrations, BlockOverrides, BlockOverrideComponent, KnownSystemBlockOverrides, LazyBlockOverrideFactory, LazyBlockOverrideRegistration, } from './rendering';
31
+ export { defineLazyBlockOverride } from './rendering';
@@ -104,9 +104,13 @@ export type RichTextFieldDefinition = FieldBase & {
104
104
  };
105
105
  export type MediaFieldDefinition = FieldBase & {
106
106
  type: 'media';
107
- mediaKinds?: Array<'image' | 'video' | 'audio' | 'document' | 'spreadsheet' | 'archive'>;
107
+ mediaKinds?: Array<'image' | 'video' | 'audio'>;
108
108
  aspectRatio?: string;
109
109
  };
110
+ export type FileFieldDefinition = FieldBase & {
111
+ type: 'file';
112
+ fileKinds?: Array<'document' | 'spreadsheet' | 'archive' | 'audio'>;
113
+ };
110
114
  export type BooleanFieldDefinition = FieldBase & {
111
115
  type: 'boolean';
112
116
  };
@@ -221,5 +225,5 @@ export type EntryPickerFieldDefinition = FieldBase & {
221
225
  /** Which entry field to store as the value: 'id' (UUID), 'identifier', or 'slug'. */
222
226
  valueFrom?: 'id' | 'identifier' | 'slug';
223
227
  };
224
- export type FieldDefinition = TextFieldDefinition | RichTextFieldDefinition | MediaFieldDefinition | BooleanFieldDefinition | NumberFieldDefinition | DateFieldDefinition | TimeFieldDefinition | DateTimeFieldDefinition | SlugFieldDefinition | UrlFieldDefinition | LinkFieldDefinition | SelectFieldDefinition | ReferenceFieldDefinition | RepeaterFieldDefinition | GroupFieldDefinition | ModalFieldDefinition | TabGroupFieldDefinition | PresetOrCustomFieldDefinition | ContentTypeSelectFieldDefinition | EntryPickerFieldDefinition;
228
+ export type FieldDefinition = TextFieldDefinition | RichTextFieldDefinition | MediaFieldDefinition | FileFieldDefinition | BooleanFieldDefinition | NumberFieldDefinition | DateFieldDefinition | TimeFieldDefinition | DateTimeFieldDefinition | SlugFieldDefinition | UrlFieldDefinition | LinkFieldDefinition | SelectFieldDefinition | ReferenceFieldDefinition | RepeaterFieldDefinition | GroupFieldDefinition | ModalFieldDefinition | TabGroupFieldDefinition | PresetOrCustomFieldDefinition | ContentTypeSelectFieldDefinition | EntryPickerFieldDefinition;
225
229
  export type { TipTapNode, Media, LinkValue };
@@ -30,7 +30,7 @@
30
30
  * });
31
31
  * ```
32
32
  */
33
- import type { BooleanFieldDefinition, ContentTypeSelectFieldDefinition, DateFieldDefinition, DateTimeFieldDefinition, EntryPickerFieldDefinition, FieldDefinition, GroupFieldDefinition, LinkFieldDefinition, MediaFieldDefinition, ModalFieldDefinition, NumberFieldDefinition, PresetOrCustomFieldDefinition, ReferenceFieldDefinition, RepeaterFieldDefinition, RichTextFieldDefinition, SelectFieldDefinition, SlugFieldDefinition, TabGroupFieldDefinition, TextFieldDefinition, TimeFieldDefinition, UrlFieldDefinition } from './field-definitions';
33
+ import type { BooleanFieldDefinition, ContentTypeSelectFieldDefinition, DateFieldDefinition, DateTimeFieldDefinition, EntryPickerFieldDefinition, FileFieldDefinition, FieldDefinition, GroupFieldDefinition, LinkFieldDefinition, MediaFieldDefinition, ModalFieldDefinition, NumberFieldDefinition, PresetOrCustomFieldDefinition, ReferenceFieldDefinition, RepeaterFieldDefinition, RichTextFieldDefinition, SelectFieldDefinition, SlugFieldDefinition, TabGroupFieldDefinition, TextFieldDefinition, TimeFieldDefinition, UrlFieldDefinition } from './field-definitions';
34
34
  import type { LinkValue, Media, TipTapNode } from '../contracts';
35
35
  import type { ContentTypeConfig, EntryConfig } from './content-types';
36
36
  export type { TipTapNode, Media, LinkValue, InternalLinkValue, ExternalLinkValue, CustomLinkValue, } from '../contracts';
@@ -66,6 +66,8 @@ export type FieldValueType<F extends FieldDefinition> = F extends {
66
66
  type: 'richText';
67
67
  } ? TipTapNode : F extends {
68
68
  type: 'media';
69
+ } ? Media | null : F extends {
70
+ type: 'file';
69
71
  } ? Media | null : F extends {
70
72
  type: 'link';
71
73
  } ? LinkValue | null : F extends {
@@ -91,7 +93,7 @@ export type FieldValueType<F extends FieldDefinition> = F extends {
91
93
  type: 'select';
92
94
  } ? string : F extends {
93
95
  type: 'entryPicker';
94
- } ? string | null : F extends TextFieldDefinition ? string : F extends BooleanFieldDefinition ? boolean : F extends NumberFieldDefinition ? number : F extends RichTextFieldDefinition ? TipTapNode : F extends MediaFieldDefinition ? Media | null : F extends LinkFieldDefinition ? LinkValue | null : F extends DateFieldDefinition ? string : F extends TimeFieldDefinition ? string : F extends DateTimeFieldDefinition ? string : F extends SlugFieldDefinition ? string : F extends UrlFieldDefinition ? string : F extends ReferenceFieldDefinition ? string : F extends PresetOrCustomFieldDefinition ? string : F extends ContentTypeSelectFieldDefinition ? string : F extends SelectFieldDefinition & {
96
+ } ? string | null : F extends TextFieldDefinition ? string : F extends BooleanFieldDefinition ? boolean : F extends NumberFieldDefinition ? number : F extends RichTextFieldDefinition ? TipTapNode : F extends MediaFieldDefinition ? Media | null : F extends FileFieldDefinition ? Media | null : F extends LinkFieldDefinition ? LinkValue | null : F extends DateFieldDefinition ? string : F extends TimeFieldDefinition ? string : F extends DateTimeFieldDefinition ? string : F extends SlugFieldDefinition ? string : F extends UrlFieldDefinition ? string : F extends ReferenceFieldDefinition ? string : F extends PresetOrCustomFieldDefinition ? string : F extends ContentTypeSelectFieldDefinition ? string : F extends SelectFieldDefinition & {
95
97
  multiple: true;
96
98
  } ? string[] : F extends SelectFieldDefinition ? string : F extends EntryPickerFieldDefinition ? string | null : F extends GroupFieldDefinition & {
97
99
  schema: {
@@ -521,13 +521,14 @@ export type AudioPlayerContent = {
521
521
  }) | null;
522
522
  };
523
523
  export type PublicDownloadMedia = Media & {
524
- type: 'document' | 'spreadsheet' | 'archive' | 'audio' | 'video';
524
+ type: 'document' | 'spreadsheet' | 'archive' | 'audio';
525
525
  };
526
526
  export type FileDownloadContent = {
527
527
  file?: PublicDownloadMedia | null;
528
528
  title?: string | null;
529
529
  description?: string | null;
530
530
  buttonLabel?: string | null;
531
+ buttonVariant?: 'primary' | 'secondary' | 'outline' | 'link' | null;
531
532
  };
532
533
  export type AppointmentBookingContent = {
533
534
  formId: string;
@@ -29,7 +29,7 @@ export declare const ctaExample: {
29
29
  label: string;
30
30
  required: boolean;
31
31
  multiline: boolean;
32
- readonly defaultValue?: undefined;
32
+ defaultValue?: undefined;
33
33
  schema?: undefined;
34
34
  } | {
35
35
  id: string;
@@ -49,12 +49,12 @@ export declare const ctaExample: {
49
49
  type: string;
50
50
  label: string;
51
51
  required: boolean;
52
- readonly multiline?: undefined;
53
- readonly defaultValue?: undefined;
52
+ multiline?: undefined;
53
+ defaultValue?: undefined;
54
54
  })[];
55
55
  };
56
- readonly multiline?: undefined;
57
- readonly defaultValue?: undefined;
56
+ multiline?: undefined;
57
+ defaultValue?: undefined;
58
58
  })[];
59
59
  layout: {
60
60
  type: string;
@@ -55,8 +55,8 @@ export declare const featuresGridExample: {
55
55
  ui?: undefined;
56
56
  })[];
57
57
  };
58
- readonly multiline?: undefined;
59
- readonly defaultValue?: undefined;
58
+ multiline?: undefined;
59
+ defaultValue?: undefined;
60
60
  })[];
61
61
  layout: {
62
62
  type: string;
@@ -27,8 +27,8 @@ export declare const heroExample: {
27
27
  type: string;
28
28
  label: string;
29
29
  required: boolean;
30
- readonly multiline?: undefined;
31
- readonly defaultValue?: undefined;
30
+ multiline?: undefined;
31
+ defaultValue?: undefined;
32
32
  })[];
33
33
  layout: {
34
34
  type: string;
@@ -34,7 +34,7 @@ export declare const pricingExample: {
34
34
  label: string;
35
35
  required: boolean;
36
36
  multiline: boolean;
37
- readonly defaultValue?: undefined;
37
+ defaultValue?: undefined;
38
38
  itemLabel?: undefined;
39
39
  itemLabelSource?: undefined;
40
40
  minItems?: undefined;
@@ -59,7 +59,7 @@ export declare const pricingExample: {
59
59
  required: boolean;
60
60
  multiline: boolean;
61
61
  ui?: undefined;
62
- readonly defaultValue?: undefined;
62
+ defaultValue?: undefined;
63
63
  itemLabel?: undefined;
64
64
  minItems?: undefined;
65
65
  allowConversion?: undefined;
@@ -73,7 +73,7 @@ export declare const pricingExample: {
73
73
  ui: {
74
74
  placeholder: string;
75
75
  };
76
- readonly defaultValue?: undefined;
76
+ defaultValue?: undefined;
77
77
  itemLabel?: undefined;
78
78
  minItems?: undefined;
79
79
  allowConversion?: undefined;
@@ -96,7 +96,7 @@ export declare const pricingExample: {
96
96
  label: string;
97
97
  required: boolean;
98
98
  defaultValue: boolean;
99
- readonly multiline?: undefined;
99
+ multiline?: undefined;
100
100
  ui?: undefined;
101
101
  itemLabel?: undefined;
102
102
  minItems?: undefined;
@@ -119,25 +119,25 @@ export declare const pricingExample: {
119
119
  multiline: boolean;
120
120
  }[];
121
121
  };
122
- readonly multiline?: undefined;
122
+ multiline?: undefined;
123
123
  ui?: undefined;
124
- readonly defaultValue?: undefined;
124
+ defaultValue?: undefined;
125
125
  } | {
126
126
  id: string;
127
127
  type: string;
128
128
  label: string;
129
129
  required: boolean;
130
- readonly multiline?: undefined;
130
+ multiline?: undefined;
131
131
  ui?: undefined;
132
- readonly defaultValue?: undefined;
132
+ defaultValue?: undefined;
133
133
  itemLabel?: undefined;
134
134
  minItems?: undefined;
135
135
  allowConversion?: undefined;
136
136
  schema?: undefined;
137
137
  })[];
138
138
  };
139
- readonly multiline?: undefined;
140
- readonly defaultValue?: undefined;
139
+ multiline?: undefined;
140
+ defaultValue?: undefined;
141
141
  })[];
142
142
  layout: {
143
143
  type: string;
@@ -34,7 +34,7 @@ export declare const testimonialsExample: {
34
34
  label: string;
35
35
  required: boolean;
36
36
  multiline: boolean;
37
- readonly defaultValue?: undefined;
37
+ defaultValue?: undefined;
38
38
  itemLabel?: undefined;
39
39
  itemLabelSource?: undefined;
40
40
  minItems?: undefined;
@@ -65,11 +65,11 @@ export declare const testimonialsExample: {
65
65
  label: string;
66
66
  required: boolean;
67
67
  mediaKinds: string[];
68
- readonly multiline?: undefined;
68
+ multiline?: undefined;
69
69
  })[];
70
70
  };
71
- readonly multiline?: undefined;
72
- readonly defaultValue?: undefined;
71
+ multiline?: undefined;
72
+ defaultValue?: undefined;
73
73
  })[];
74
74
  layout: {
75
75
  type: string;
@@ -132,7 +132,7 @@ export declare function normalizeLlmMediaAtRule(atRule: z.infer<typeof llmMediaA
132
132
  };
133
133
  /**
134
134
  * Combined field schema for LLM output.
135
- * Supports: text, richText, media, boolean, link, select, number, group, repeater.
135
+ * Supports: text, richText, media, file, boolean, link, select, number, group, repeater.
136
136
  */
137
137
  declare const llmFieldSchema: z.ZodUnion<readonly [z.ZodObject<{
138
138
  id: z.ZodString;
@@ -161,6 +161,16 @@ declare const llmFieldSchema: z.ZodUnion<readonly [z.ZodObject<{
161
161
  image: "image";
162
162
  video: "video";
163
163
  audio: "audio";
164
+ }>>>;
165
+ }, z.core.$strip>, z.ZodObject<{
166
+ id: z.ZodString;
167
+ label: z.ZodString;
168
+ description: z.ZodNullable<z.ZodString>;
169
+ required: z.ZodBoolean;
170
+ defaultValue: z.ZodNullable<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>]>>;
171
+ type: z.ZodLiteral<"file">;
172
+ fileKinds: z.ZodNullable<z.ZodArray<z.ZodEnum<{
173
+ audio: "audio";
164
174
  document: "document";
165
175
  spreadsheet: "spreadsheet";
166
176
  archive: "archive";
@@ -8,7 +8,7 @@ import type { ReactNode } from 'react';
8
8
  import type { RiverbankClient } from '../client/types';
9
9
  import type { RiverbankSiteConfig } from '../config/types';
10
10
  import type { Theme } from '../contracts';
11
- import type { BlockOverrides } from '../rendering/overrides';
11
+ import type { BlockOverrideRegistrations } from '../rendering/overrides';
12
12
  import type { Metadata } from '../metadata/generatePageMetadata';
13
13
  import type { LoadContentResult } from '../rendering/helpers/loadContent';
14
14
  /**
@@ -182,8 +182,10 @@ export type CreateCatchAllPageOptions = {
182
182
  /**
183
183
  * Custom block component overrides for rendering.
184
184
  * Keys can be full block kind ("block.hero") or short form ("hero").
185
+ * Wrap client-heavy dynamic imports with defineLazyBlockOverride(); raw
186
+ * promise-returning functions are not lazy override registrations.
185
187
  */
186
- blockOverrides?: BlockOverrides;
188
+ blockOverrides?: BlockOverrideRegistrations;
187
189
  /**
188
190
  * Override site URL for metadata generation.
189
191
  * Defaults to `config.liveUrl` or `config.previewUrl` based on preview mode.
@@ -438,7 +438,8 @@ export type ContentEntryListItem<TContent = Record<string, unknown>> = {
438
438
  export type PublicContentTypeFieldMeta = {
439
439
  id: string;
440
440
  type: string;
441
- mediaKinds: Array<"image" | "video" | "audio" | "document" | "spreadsheet" | "archive"> | null;
441
+ mediaKinds: Array<"image" | "video" | "audio"> | null;
442
+ fileKinds: Array<"document" | "spreadsheet" | "archive" | "audio"> | null;
442
443
  };
443
444
  export type PublicContentTypeMeta = {
444
445
  key: string;
@@ -23,7 +23,8 @@ export { ThemeScope, } from './blocks-theme-scope';
23
23
  export { buildThemeRuntime, } from './blocks-theme-runtime';
24
24
  export type { ComponentRegistry, PageRendererDataContext, PageRendererProps, SdkConfigForRenderer, } from './blocks-page-renderer';
25
25
  export type { ThemeScopeProps, } from './blocks-theme-scope';
26
- export type { BlockOverrideProps, BlockOverrideComponent, BlockOverrides, KnownSystemBlockOverrides, } from './overrides';
26
+ export type { BlockOverrideProps, BlockOverrideComponent, BlockOverrideRegistration, BlockOverrideRegistrations, BlockOverrides, KnownSystemBlockOverrides, LazyBlockOverrideFactory, LazyBlockOverrideRegistration, } from './overrides';
27
+ export { defineLazyBlockOverride } from './overrides';
27
28
  /**
28
29
  * @example Server-side rendering (Next.js App Router)
29
30
  * ```tsx
@@ -0,0 +1,10 @@
1
+ import type { PageOutline } from '../contracts';
2
+ import { type BlockOverrideRegistrations, type BlockOverrides } from './overrides';
3
+ /**
4
+ * Resolve only override registrations used by the current page or template.
5
+ *
6
+ * Eager components are passed through unchanged. Lazy registrations created
7
+ * with `defineLazyBlockOverride()` are loaded only after their block kind is
8
+ * found in the rendered block tree.
9
+ */
10
+ export declare function resolveBlockOverridesForPage(registrations: BlockOverrideRegistrations | undefined, page: PageOutline | null | undefined): Promise<BlockOverrides | undefined>;
@@ -25,8 +25,20 @@ type BivariantOverrideComponent<TContent = Record<string, unknown>> = {
25
25
  bivarianceHack(props: BlockOverrideProps<TContent, Record<string, unknown>>): React.ReactElement | null;
26
26
  }['bivarianceHack'];
27
27
  type CompatibleBlockOverrideComponent<TContent = Record<string, unknown>> = BlockOverrideComponent<TContent, Record<string, unknown>> | BivariantOverrideComponent<TContent>;
28
+ export declare const lazyBlockOverrideSymbol: unique symbol;
29
+ export type LazyBlockOverrideFactory<TContent = Record<string, unknown>> = () => Promise<BivariantOverrideComponent<TContent>>;
30
+ export type LazyBlockOverrideRegistration<TContent = Record<string, unknown>> = {
31
+ readonly [lazyBlockOverrideSymbol]: true;
32
+ readonly load: LazyBlockOverrideFactory<TContent>;
33
+ };
34
+ export type BlockOverrideRegistration<TContent = Record<string, unknown>> = CompatibleBlockOverrideComponent<TContent> | LazyBlockOverrideRegistration<TContent>;
35
+ export declare function defineLazyBlockOverride<TContent = Record<string, unknown>>(load: LazyBlockOverrideFactory<TContent>): LazyBlockOverrideRegistration<TContent>;
28
36
  export type KnownSystemBlockOverrides = {
29
37
  [K in keyof SystemBlockContentByKind]?: CompatibleBlockOverrideComponent<SystemBlockContentByKind[K]>;
30
38
  };
31
39
  export type BlockOverrides = KnownSystemBlockOverrides & Record<string, CompatibleBlockOverrideComponent<Record<string, unknown>>>;
40
+ export type KnownSystemBlockOverrideRegistrations = {
41
+ [K in keyof SystemBlockContentByKind]?: BlockOverrideRegistration<SystemBlockContentByKind[K]>;
42
+ };
43
+ export type BlockOverrideRegistrations = KnownSystemBlockOverrideRegistrations & Record<string, BlockOverrideRegistration<Record<string, unknown>>>;
32
44
  export {};
@@ -8,4 +8,4 @@
8
8
  * 1. This constant
9
9
  * 2. The "version" field in package.json
10
10
  */
11
- export declare const SDK_VERSION = "0.70.2";
11
+ export declare const SDK_VERSION = "0.70.4";