@riverbankcms/sdk 0.70.0 → 0.70.3

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 (61) hide show
  1. package/README.md +29 -0
  2. package/dist/_dts/ai/src/contracts/commandExposure.d.ts +8 -0
  3. package/dist/_dts/ai/src/contracts/feedback.d.ts +55 -0
  4. package/dist/_dts/ai/src/contracts/proposals.d.ts +34764 -0
  5. package/dist/_dts/ai/src/contracts.d.ts +5 -0
  6. package/dist/_dts/ai/src/designer/rfc6902.d.ts +16 -0
  7. package/dist/_dts/ai/src/designer/themePatch.d.ts +50 -0
  8. package/dist/_dts/api/src/aiPlayground.d.ts +1 -1
  9. package/dist/_dts/api/src/appointmentSetup.d.ts +19 -0
  10. package/dist/_dts/api/src/availability.d.ts +84 -2
  11. package/dist/_dts/api/src/bookingManagementEndpoints.d.ts +10 -1
  12. package/dist/_dts/api/src/contentRuntime.d.ts +1 -0
  13. package/dist/_dts/api/src/endpoints.d.ts +29 -0
  14. package/dist/_dts/api/src/sitePlatformEndpoints.d.ts +4 -0
  15. package/dist/_dts/api/src/siteRuntimeEndpoints.d.ts +29 -1
  16. package/dist/_dts/api/src/types.d.ts +1 -1
  17. package/dist/_dts/billing/src/components/index.d.ts +41 -0
  18. package/dist/_dts/db/src/generated/supabase/database.types.d.ts +219 -0
  19. package/dist/_dts/preview-next/src/client/preview/PreviewEditorSidebar.d.ts +2 -1
  20. package/dist/_dts/preview-next/src/client/preview/PreviewShell.d.ts +2 -1
  21. package/dist/_dts/preview-next/src/client/preview/PreviewShellLayout.d.ts +2 -1
  22. package/dist/_dts/preview-next/src/client/preview/SiteChromeCustomizeContext.d.ts +3 -1
  23. package/dist/_dts/preview-next/src/client/preview/StyleConfigurator.d.ts +3 -1
  24. package/dist/_dts/preview-next/src/client/preview/StyleConfigurator.state.d.ts +1 -0
  25. package/dist/_dts/preview-next/src/client/preview/styleConfiguratorApplyPayload.d.ts +8 -0
  26. package/dist/_dts/preview-next/src/client/preview/styleConfiguratorSnapshot.d.ts +1 -0
  27. package/dist/_dts/sdk/src/cli/commands/delete.d.ts +3 -0
  28. package/dist/_dts/sdk/src/cli/commands/style.d.ts +37 -0
  29. package/dist/_dts/sdk/src/cli/helpers.d.ts +8 -33
  30. package/dist/_dts/sdk/src/cli/site-commands/oneOffCommands.d.ts +81 -0
  31. package/dist/_dts/sdk/src/client/management/index.d.ts +2 -1
  32. package/dist/_dts/sdk/src/client/management/theme.d.ts +3 -1
  33. package/dist/_dts/sdk/src/client/management/types.d.ts +23 -0
  34. package/dist/_dts/sdk/src/components.d.ts +2 -1
  35. package/dist/_dts/sdk/src/next/types.d.ts +4 -2
  36. package/dist/_dts/sdk/src/public-api/contracts.d.ts +1 -0
  37. package/dist/_dts/sdk/src/rendering/index.d.ts +2 -1
  38. package/dist/_dts/sdk/src/rendering/overrideResolution.d.ts +10 -0
  39. package/dist/_dts/sdk/src/rendering/overrides.d.ts +12 -0
  40. package/dist/_dts/sdk/src/version.d.ts +1 -1
  41. package/dist/_dts/site-commands/src/commands.d.ts +25 -7
  42. package/dist/_dts/site-commands/src/metadata.d.ts +2 -2
  43. package/dist/cli/index.mjs +844 -108
  44. package/dist/client/client.mjs +256 -202
  45. package/dist/client/hooks.mjs +55 -1
  46. package/dist/client/rendering.mjs +25467 -25403
  47. package/dist/preview-next/before-render.mjs +39 -0
  48. package/dist/preview-next/client/runtime.mjs +160 -39
  49. package/dist/preview-next/middleware.mjs +39 -0
  50. package/dist/server/components.mjs +65 -1
  51. package/dist/server/config-validation.mjs +55 -1
  52. package/dist/server/config.mjs +55 -1
  53. package/dist/server/data.mjs +55 -1
  54. package/dist/server/index.mjs +40 -1
  55. package/dist/server/next.mjs +137 -4
  56. package/dist/server/prebuild.mjs +1 -1
  57. package/dist/server/rendering/server.mjs +55 -1
  58. package/dist/server/rendering.mjs +65 -1
  59. package/dist/server/routing.mjs +56 -2
  60. package/dist/server/server.mjs +56 -2
  61. package/package.json +4 -3
@@ -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';
@@ -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.
@@ -297,6 +297,7 @@ export type SiteResponse = {
297
297
  theme: Theme;
298
298
  themeId?: string | null;
299
299
  selectionId?: string | null;
300
+ selectionVersion?: number | null;
300
301
  selectionUpdatedAt?: string | null;
301
302
  /**
302
303
  * Persisted design selections. Optional so legacy
@@ -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.0";
11
+ export declare const SDK_VERSION = "0.70.3";
@@ -35,11 +35,17 @@ export declare const configureSiteIdentityCommandSchema: z.ZodObject<{
35
35
  }>>;
36
36
  }, z.core.$strict>;
37
37
  }, z.core.$strict>;
38
- export declare const applySiteStyleCommandSchema: z.ZodObject<{
39
- type: z.ZodLiteral<"applySiteStyle">;
38
+ export declare const applySiteStyleSelectionCommandSchema: z.ZodObject<{
39
+ type: z.ZodLiteral<"applySiteStyleSelection">;
40
40
  ref: z.ZodPipe<z.ZodString, z.ZodTransform<SiteStyleRef, string>>;
41
41
  input: z.ZodObject<{
42
- styleKey: z.ZodString;
42
+ siteStyleId: z.ZodPipe<z.ZodString, z.ZodTransform<SiteStyleRef, string>>;
43
+ buttonPersonalityId: z.ZodNullable<z.ZodString>;
44
+ paletteVariantId: z.ZodNullable<z.ZodString>;
45
+ paletteOverrides: z.ZodNullable<z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodString>>>;
46
+ headerLookId: z.ZodNullable<z.ZodString>;
47
+ footerLookId: z.ZodNullable<z.ZodString>;
48
+ baseSelectionVersion: z.ZodOptional<z.ZodNumber>;
43
49
  }, z.core.$strict>;
44
50
  }, z.core.$strict>;
45
51
  export declare const upsertMediaAssetCommandSchema: z.ZodObject<{
@@ -977,10 +983,16 @@ export declare const siteCommandSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
977
983
  }, z.core.$strict>>;
978
984
  }, z.core.$strict>;
979
985
  }, z.core.$strict>, z.ZodObject<{
980
- type: z.ZodLiteral<"applySiteStyle">;
986
+ type: z.ZodLiteral<"applySiteStyleSelection">;
981
987
  ref: z.ZodPipe<z.ZodString, z.ZodTransform<SiteStyleRef, string>>;
982
988
  input: z.ZodObject<{
983
- styleKey: z.ZodString;
989
+ siteStyleId: z.ZodPipe<z.ZodString, z.ZodTransform<SiteStyleRef, string>>;
990
+ buttonPersonalityId: z.ZodNullable<z.ZodString>;
991
+ paletteVariantId: z.ZodNullable<z.ZodString>;
992
+ paletteOverrides: z.ZodNullable<z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodString>>>;
993
+ headerLookId: z.ZodNullable<z.ZodString>;
994
+ footerLookId: z.ZodNullable<z.ZodString>;
995
+ baseSelectionVersion: z.ZodOptional<z.ZodNumber>;
984
996
  }, z.core.$strict>;
985
997
  }, z.core.$strict>, z.ZodObject<{
986
998
  type: z.ZodLiteral<"upsertMediaAsset">;
@@ -1799,10 +1811,16 @@ export declare const siteCommandBatchSchema: z.ZodObject<{
1799
1811
  }, z.core.$strict>>;
1800
1812
  }, z.core.$strict>;
1801
1813
  }, z.core.$strict>, z.ZodObject<{
1802
- type: z.ZodLiteral<"applySiteStyle">;
1814
+ type: z.ZodLiteral<"applySiteStyleSelection">;
1803
1815
  ref: z.ZodPipe<z.ZodString, z.ZodTransform<SiteStyleRef, string>>;
1804
1816
  input: z.ZodObject<{
1805
- styleKey: z.ZodString;
1817
+ siteStyleId: z.ZodPipe<z.ZodString, z.ZodTransform<SiteStyleRef, string>>;
1818
+ buttonPersonalityId: z.ZodNullable<z.ZodString>;
1819
+ paletteVariantId: z.ZodNullable<z.ZodString>;
1820
+ paletteOverrides: z.ZodNullable<z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodString>>>;
1821
+ headerLookId: z.ZodNullable<z.ZodString>;
1822
+ footerLookId: z.ZodNullable<z.ZodString>;
1823
+ baseSelectionVersion: z.ZodOptional<z.ZodNumber>;
1806
1824
  }, z.core.$strict>;
1807
1825
  }, z.core.$strict>, z.ZodObject<{
1808
1826
  type: z.ZodLiteral<"upsertMediaAsset">;
@@ -28,7 +28,7 @@ export declare const siteCommandMetadata: {
28
28
  readonly capability: "bookings.settings.write";
29
29
  readonly support: "supported";
30
30
  };
31
- readonly applySiteStyle: {
31
+ readonly applySiteStyleSelection: {
32
32
  readonly scope: "style";
33
33
  readonly risk: "low";
34
34
  readonly writeSemantics: "upsert";
@@ -37,7 +37,7 @@ export declare const siteCommandMetadata: {
37
37
  readonly conflictPolicy: "update_existing";
38
38
  readonly previewability: "static_preview";
39
39
  readonly allowedRuntimes: readonly ["development", "staging", "demo", "production"];
40
- readonly intendedExposure: readonly ["recipe", "sdk_cli", "onboarding_planner", "internal_apply"];
40
+ readonly intendedExposure: readonly ["recipe", "sdk_cli", "onboarding_planner", "ai_proposal", "internal_apply"];
41
41
  readonly capability: "theme.write";
42
42
  readonly support: "supported";
43
43
  };