@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.
- package/README.md +29 -0
- package/dist/_dts/ai/src/contracts/commandExposure.d.ts +8 -0
- package/dist/_dts/ai/src/contracts/feedback.d.ts +55 -0
- package/dist/_dts/ai/src/contracts/proposals.d.ts +34764 -0
- package/dist/_dts/ai/src/contracts.d.ts +5 -0
- package/dist/_dts/ai/src/designer/rfc6902.d.ts +16 -0
- package/dist/_dts/ai/src/designer/themePatch.d.ts +50 -0
- package/dist/_dts/api/src/aiPlayground.d.ts +1 -1
- package/dist/_dts/api/src/appointmentSetup.d.ts +19 -0
- package/dist/_dts/api/src/availability.d.ts +84 -2
- package/dist/_dts/api/src/bookingManagementEndpoints.d.ts +10 -1
- package/dist/_dts/api/src/contentRuntime.d.ts +1 -0
- package/dist/_dts/api/src/endpoints.d.ts +29 -0
- package/dist/_dts/api/src/sitePlatformEndpoints.d.ts +4 -0
- package/dist/_dts/api/src/siteRuntimeEndpoints.d.ts +29 -1
- package/dist/_dts/api/src/types.d.ts +1 -1
- package/dist/_dts/billing/src/components/index.d.ts +41 -0
- package/dist/_dts/db/src/generated/supabase/database.types.d.ts +219 -0
- package/dist/_dts/preview-next/src/client/preview/PreviewEditorSidebar.d.ts +2 -1
- package/dist/_dts/preview-next/src/client/preview/PreviewShell.d.ts +2 -1
- package/dist/_dts/preview-next/src/client/preview/PreviewShellLayout.d.ts +2 -1
- package/dist/_dts/preview-next/src/client/preview/SiteChromeCustomizeContext.d.ts +3 -1
- package/dist/_dts/preview-next/src/client/preview/StyleConfigurator.d.ts +3 -1
- package/dist/_dts/preview-next/src/client/preview/StyleConfigurator.state.d.ts +1 -0
- package/dist/_dts/preview-next/src/client/preview/styleConfiguratorApplyPayload.d.ts +8 -0
- package/dist/_dts/preview-next/src/client/preview/styleConfiguratorSnapshot.d.ts +1 -0
- package/dist/_dts/sdk/src/cli/commands/delete.d.ts +3 -0
- package/dist/_dts/sdk/src/cli/commands/style.d.ts +37 -0
- package/dist/_dts/sdk/src/cli/helpers.d.ts +8 -33
- package/dist/_dts/sdk/src/cli/site-commands/oneOffCommands.d.ts +81 -0
- package/dist/_dts/sdk/src/client/management/index.d.ts +2 -1
- package/dist/_dts/sdk/src/client/management/theme.d.ts +3 -1
- package/dist/_dts/sdk/src/client/management/types.d.ts +23 -0
- package/dist/_dts/sdk/src/components.d.ts +2 -1
- package/dist/_dts/sdk/src/next/types.d.ts +4 -2
- package/dist/_dts/sdk/src/public-api/contracts.d.ts +1 -0
- package/dist/_dts/sdk/src/rendering/index.d.ts +2 -1
- package/dist/_dts/sdk/src/rendering/overrideResolution.d.ts +10 -0
- package/dist/_dts/sdk/src/rendering/overrides.d.ts +12 -0
- package/dist/_dts/sdk/src/version.d.ts +1 -1
- package/dist/_dts/site-commands/src/commands.d.ts +25 -7
- package/dist/_dts/site-commands/src/metadata.d.ts +2 -2
- package/dist/cli/index.mjs +844 -108
- package/dist/client/client.mjs +256 -202
- package/dist/client/hooks.mjs +55 -1
- package/dist/client/rendering.mjs +25467 -25403
- package/dist/preview-next/before-render.mjs +39 -0
- package/dist/preview-next/client/runtime.mjs +160 -39
- package/dist/preview-next/middleware.mjs +39 -0
- package/dist/server/components.mjs +65 -1
- package/dist/server/config-validation.mjs +55 -1
- package/dist/server/config.mjs +55 -1
- package/dist/server/data.mjs +55 -1
- package/dist/server/index.mjs +40 -1
- package/dist/server/next.mjs +137 -4
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/rendering/server.mjs +55 -1
- package/dist/server/rendering.mjs +65 -1
- package/dist/server/routing.mjs +56 -2
- package/dist/server/server.mjs +56 -2
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -3257,6 +3257,35 @@ export default Page;
|
|
|
3257
3257
|
export { generateMetadata };
|
|
3258
3258
|
```
|
|
3259
3259
|
|
|
3260
|
+
### Lazy Block Overrides
|
|
3261
|
+
|
|
3262
|
+
Eager `blockOverrides` remain supported and are a good fit for small server-safe components. For client-heavy or rarely used custom blocks, register a lazy override so `createCatchAllPage()` resolves only the override modules needed by the page or entry template being rendered:
|
|
3263
|
+
|
|
3264
|
+
```tsx
|
|
3265
|
+
// src/app/[[...slug]]/page.tsx
|
|
3266
|
+
import { createCatchAllPage } from '@riverbankcms/sdk/next';
|
|
3267
|
+
import { defineLazyBlockOverride } from '@riverbankcms/sdk/rendering';
|
|
3268
|
+
import { getRiverbankClient } from '@/lib/builder-client';
|
|
3269
|
+
import config from '@/riverbank.config';
|
|
3270
|
+
|
|
3271
|
+
const { Page, generateMetadata } = createCatchAllPage({
|
|
3272
|
+
getClient: getRiverbankClient,
|
|
3273
|
+
config,
|
|
3274
|
+
blockOverrides: {
|
|
3275
|
+
'custom.quiz': defineLazyBlockOverride(async () =>
|
|
3276
|
+
import('@/components/blocks/QuizBlock').then((module) => module.QuizBlock)
|
|
3277
|
+
),
|
|
3278
|
+
},
|
|
3279
|
+
});
|
|
3280
|
+
|
|
3281
|
+
export default Page;
|
|
3282
|
+
export { generateMetadata };
|
|
3283
|
+
```
|
|
3284
|
+
|
|
3285
|
+
Keep the `import()` inside the lazy factory. Wrapping a component that was imported at the top of the route file is still eager from the bundler's point of view and will not slim the catch-all route graph. Lazy factories must be wrapped with `defineLazyBlockOverride()`; raw promise-returning functions are not treated as lazy overrides.
|
|
3286
|
+
|
|
3287
|
+
`createCatchAllPage()` filters and resolves lazy overrides per rendered page, so unused factories are not invoked. Next.js still builds the client-reference manifest from the static catch-all route graph, though, so a static `import('./HeavyClientBlock')` inside the route graph can still appear in internal build manifests even when that block is not on the current page. For client-heavy blocks, keep the server override wrapper small and put ALTCHA/forms/booking widgets behind block-local client boundaries, then verify the production build artifacts for the specific site.
|
|
3288
|
+
|
|
3260
3289
|
This single call replaces ~160 lines of typical boilerplate that handles:
|
|
3261
3290
|
- Path resolution from URL slugs
|
|
3262
3291
|
- Content loading (pages and entries)
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { AllowedRuntime, SiteCommandBatch, SiteCommandBatchExposureDecision, SiteCommandCapabilityGap, SiteCommandExposureDecision, SiteCommandExposureTarget } from '../../../site-commands/src/index';
|
|
2
|
+
export type AiCommandExposureOptions = Readonly<{
|
|
3
|
+
runtime?: AllowedRuntime;
|
|
4
|
+
capabilityGaps?: readonly SiteCommandCapabilityGap[];
|
|
5
|
+
}>;
|
|
6
|
+
export type AiCommandExposureDecision = SiteCommandExposureDecision | SiteCommandBatchExposureDecision;
|
|
7
|
+
export declare function evaluateAiCommandExposure(command: SiteCommandExposureTarget, options?: AiCommandExposureOptions): SiteCommandExposureDecision;
|
|
8
|
+
export declare function evaluateAiCommandExposure(batch: SiteCommandBatch, options?: AiCommandExposureOptions): SiteCommandBatchExposureDecision;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const RejectedThemeProposalSummarySchema: z.ZodObject<{
|
|
3
|
+
type: z.ZodLiteral<"theme">;
|
|
4
|
+
id: z.ZodString;
|
|
5
|
+
summary: z.ZodString;
|
|
6
|
+
}, z.core.$strip>;
|
|
7
|
+
export declare const RejectedPageOpsProposalSummarySchema: z.ZodObject<{
|
|
8
|
+
type: z.ZodLiteral<"pageOps">;
|
|
9
|
+
id: z.ZodString;
|
|
10
|
+
summary: z.ZodString;
|
|
11
|
+
}, z.core.$strip>;
|
|
12
|
+
export declare const RejectedContentEditProposalSummarySchema: z.ZodObject<{
|
|
13
|
+
type: z.ZodLiteral<"contentEdit">;
|
|
14
|
+
id: z.ZodString;
|
|
15
|
+
blockId: z.ZodString;
|
|
16
|
+
field: z.ZodString;
|
|
17
|
+
summary: z.ZodString;
|
|
18
|
+
rationale: z.ZodOptional<z.ZodString>;
|
|
19
|
+
}, z.core.$strip>;
|
|
20
|
+
export declare const RejectedProposalSummarySchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
21
|
+
type: z.ZodLiteral<"theme">;
|
|
22
|
+
id: z.ZodString;
|
|
23
|
+
summary: z.ZodString;
|
|
24
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
25
|
+
type: z.ZodLiteral<"pageOps">;
|
|
26
|
+
id: z.ZodString;
|
|
27
|
+
summary: z.ZodString;
|
|
28
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
29
|
+
type: z.ZodLiteral<"contentEdit">;
|
|
30
|
+
id: z.ZodString;
|
|
31
|
+
blockId: z.ZodString;
|
|
32
|
+
field: z.ZodString;
|
|
33
|
+
summary: z.ZodString;
|
|
34
|
+
rationale: z.ZodOptional<z.ZodString>;
|
|
35
|
+
}, z.core.$strip>], "type">;
|
|
36
|
+
export type RejectedProposalSummary = z.infer<typeof RejectedProposalSummarySchema>;
|
|
37
|
+
export declare const ChatFeedbackSchema: z.ZodObject<{
|
|
38
|
+
rejectedProposals: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
39
|
+
type: z.ZodLiteral<"theme">;
|
|
40
|
+
id: z.ZodString;
|
|
41
|
+
summary: z.ZodString;
|
|
42
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
43
|
+
type: z.ZodLiteral<"pageOps">;
|
|
44
|
+
id: z.ZodString;
|
|
45
|
+
summary: z.ZodString;
|
|
46
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
47
|
+
type: z.ZodLiteral<"contentEdit">;
|
|
48
|
+
id: z.ZodString;
|
|
49
|
+
blockId: z.ZodString;
|
|
50
|
+
field: z.ZodString;
|
|
51
|
+
summary: z.ZodString;
|
|
52
|
+
rationale: z.ZodOptional<z.ZodString>;
|
|
53
|
+
}, z.core.$strip>], "type">>>;
|
|
54
|
+
}, z.core.$strict>;
|
|
55
|
+
export type ChatFeedback = z.infer<typeof ChatFeedbackSchema>;
|