@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.
- package/README.md +33 -0
- package/dist/{PreviewEditorSidebar-Dbvb7GIr.mjs → PreviewEditorSidebar-B43CJ0g_.mjs} +3 -3
- package/dist/{PreviewEditorUI-e9O9l20X.mjs → PreviewEditorUI-DHirVkeM.mjs} +2 -2
- package/dist/{SdkPreviewModeRuntime-BZHt6e9w.mjs → SdkPreviewModeRuntime-BJumZy1B.mjs} +495 -292
- package/dist/{SiteChromeCustomizeContext-CvuGbHJX.mjs → SiteChromeCustomizeContext-D9SlpwEj.mjs} +140 -140
- package/dist/_dts/blocks/src/PageRenderer.d.ts +20 -10
- package/dist/_dts/blocks/src/index.d.ts +2 -1
- package/dist/_dts/blocks/src/pageRendererBoundaries.d.ts +30 -0
- package/dist/_dts/blocks/src/pageRenderingMode.d.ts +37 -0
- package/dist/_dts/blocks/src/server.d.ts +1 -1
- package/dist/_dts/db/src/generated/supabase/database.types.d.ts +14 -0
- package/dist/_dts/preview-next/src/client/blocks/pageDesignRuntimePreview.d.ts +2 -0
- package/dist/_dts/preview-next/src/client/index.d.ts +47 -47
- package/dist/_dts/preview-next/src/client/preview/PreviewShell.d.ts +18 -6
- package/dist/_dts/preview-next/src/client/preview/PreviewShellLayout.d.ts +30 -21
- package/dist/_dts/preview-next/src/client/preview/PreviewThemedSiteDocument.d.ts +18 -5
- package/dist/_dts/preview-next/src/client/preview/themeRuntime.d.ts +9 -0
- package/dist/_dts/preview-next/src/client/sdk/SdkPreviewMode.d.ts +21 -6
- package/dist/_dts/preview-next/src/client/sdk-runtime.d.ts +8 -8
- package/dist/_dts/sdk/src/next/catch-all.d.ts +6 -0
- package/dist/_dts/sdk/src/next/index.d.ts +2 -1
- package/dist/_dts/sdk/src/next/renderSdkContent.d.ts +33 -0
- package/dist/_dts/sdk/src/next/types.d.ts +23 -9
- package/dist/_dts/sdk/src/preview-next/before-render.d.ts +4 -6
- package/dist/_dts/sdk/src/preview-next/client/index.d.ts +3 -3
- package/dist/_dts/sdk/src/preview-next/client/runtime.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/blocks-page-renderer.d.ts +25 -3
- package/dist/_dts/sdk/src/rendering/components/Block.shared.d.ts +13 -2
- package/dist/_dts/sdk/src/rendering/components/Layout.d.ts +31 -18
- package/dist/_dts/sdk/src/rendering/components/pageShared.d.ts +20 -9
- package/dist/_dts/sdk/src/rendering/index.d.ts +4 -2
- package/dist/_dts/sdk/src/rendering/renderingMode.d.ts +23 -0
- package/dist/_dts/sdk/src/rendering/server.d.ts +5 -3
- package/dist/_dts/sdk/src/rendering/themeRuntime.d.ts +6 -0
- package/dist/_dts/sdk/src/version.d.ts +1 -1
- package/dist/cli/index.mjs +237 -211
- package/dist/cli/init-docs/content/workflow-preview-mode.md +24 -11
- package/dist/client/client.mjs +420 -337
- package/dist/client/rendering.mjs +503 -358
- package/dist/preview-next/before-render.mjs +10 -3
- package/dist/preview-next/client/runtime.mjs +3 -3
- package/dist/{sdk-runtime-Cn_QSCOg.mjs → sdk-runtime-CfZd5pAm.mjs} +1 -1
- package/dist/{separator-CEoGABRc.mjs → separator-DkTe68HE.mjs} +1 -1
- package/dist/server/components.mjs +478 -351
- package/dist/server/index.mjs +1 -1
- package/dist/server/next.mjs +640 -500
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/rendering/server.mjs +499 -355
- package/dist/server/rendering.mjs +499 -355
- package/dist/server/server.mjs +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2627,6 +2627,38 @@ export default Page;
|
|
|
2627
2627
|
export { generateMetadata };
|
|
2628
2628
|
```
|
|
2629
2629
|
|
|
2630
|
+
### Fully custom, override-only rendering
|
|
2631
|
+
|
|
2632
|
+
Hosts that own all visual rendering can opt out of CMS theme admission and built-in block fallbacks explicitly. The registry only needs to cover block kinds the host's content actually uses; `satisfies BlockOverrideRegistrations` checks each registration without pretending custom block kinds form a closed exhaustive set.
|
|
2633
|
+
|
|
2634
|
+
```tsx
|
|
2635
|
+
import { createCatchAllPage } from '@riverbankcms/sdk/next';
|
|
2636
|
+
import type {
|
|
2637
|
+
BlockOverrideProps,
|
|
2638
|
+
BlockOverrideRegistrations,
|
|
2639
|
+
} from '@riverbankcms/sdk/rendering';
|
|
2640
|
+
|
|
2641
|
+
const blockOverrides = {
|
|
2642
|
+
hero: ({ content }: BlockOverrideProps) => (
|
|
2643
|
+
<Hero heading={String(content.heading ?? '')} />
|
|
2644
|
+
),
|
|
2645
|
+
'custom.product-grid': ProductGrid,
|
|
2646
|
+
} satisfies BlockOverrideRegistrations;
|
|
2647
|
+
|
|
2648
|
+
const { Page, generateMetadata } = createCatchAllPage({
|
|
2649
|
+
getClient: getRiverbankClient,
|
|
2650
|
+
config,
|
|
2651
|
+
rendering: { kind: 'overrides-only' },
|
|
2652
|
+
blockOverrides,
|
|
2653
|
+
});
|
|
2654
|
+
```
|
|
2655
|
+
|
|
2656
|
+
In this mode the SDK does not resolve, parse, normalize, or build tokens from the response theme. Overrides receive the usual content, resolved data, routing, media, API/auth, IDs, and preview context, but no `theme` or `themeConfig`. A page fails with `MissingBlockOverrideError` when its content contains an unregistered kind; it never falls through to the known built-in renderer.
|
|
2657
|
+
|
|
2658
|
+
The optional theme-independent wrapper belongs inside `rendering`: use `runtime: { kind: 'responsive-only' }` (the default) for Riverbank's generated responsive utility scope, or `runtime: { kind: 'none' }` when the host owns that too. Do not combine override-only rendering with top-level `themeRuntime`, `theme`, `themes`, or `getTheme`. If you use SDK `Layout` directly, its header and footer must both be custom or disabled. Preview receives the same rendering selection and registry.
|
|
2659
|
+
|
|
2660
|
+
The content response still carries a compatibility theme field for now; override-only rendering deliberately ignores it. Wire-level theme nullability is tracked separately in #1290.
|
|
2661
|
+
|
|
2630
2662
|
Keep the `server-only` marker at the top of the registry so Next.js turns an accidental Client Component import into a build error. `generateMetadata()` never receives or runs host loaders—even with `customMetadata`—so a normal request does not repeat host queries for metadata and rendering.
|
|
2631
2663
|
|
|
2632
2664
|
```tsx
|
|
@@ -3772,6 +3804,7 @@ createCatchAllPage({
|
|
|
3772
3804
|
| `getClient` | `() => RiverbankClient` | Yes | Factory function returning a configured client |
|
|
3773
3805
|
| `config` | `RiverbankSiteConfig` | Yes | Site config from `defineConfig()` |
|
|
3774
3806
|
| `blockOverrides` | `BlockOverrides` | No | Custom block component overrides |
|
|
3807
|
+
| `rendering` | `{ kind: 'overrides-only', runtime?: { kind: 'responsive-only' \| 'none' } }` | No | Opt into host-only rendering; requires `blockOverrides` and forbids theme options |
|
|
3775
3808
|
| `siteUrl` | `string` | No | Override site URL for metadata (uses `config.liveUrl`/`previewUrl` as fallback) |
|
|
3776
3809
|
| `beforeRender` | `function` | No | Intercept before rendering |
|
|
3777
3810
|
| `customMetadata` | `function` | No | Custom metadata generation |
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { $ as createOptimisticActionRunner, $i as Callout, A as isPreviewingChange, B as previewHeaderStyle, Br as getHeaderStyle, Ca as DropdownMenuLabel, Ci as updateButtonStyleSelectionChoice, D as createStyleConfiguratorState, Da as Button, Dr as getCuratedSiteStyle, E as cancelPreview, F as palettePreviewProjection, Ft as BlockEditor, G as syncStyleConfiguratorState, H as resetTypographyToSaved, Ht as useEditorUiStoreInstance, I as previewButtonStyle, Ji as Select, K as toggleRow, L as previewCuratedPalette, La as X$1, M as markApplySaved, Mi as paletteColorsSchema, N as markApplySaving, Na as assertNever$1, O as deriveStyleConfiguratorCapabilities, On as ThemeScope, P as openRow, Qa as LoaderCircle, Qi as SelectValue, R as previewFooterLook, Sa as DropdownMenuItem, Si as resolveButtonStyleSelection, T as applyTypographyDraftPatch, Ta as DropdownMenuTrigger, Ti as themeButtonClassName, Tr as curatedSiteStyles, U as setPaletteColors, Ua as Smartphone, V as previewSiteStyle, Va as Tablet, Vt as useEditorUiStore, W as styleConfiguratorHistoryEntryForPersistedSelection, Wa as SlidersHorizontal, Xa as Monitor, Xi as SelectItem, Yi as SelectContent, Za as Maximize2, Zi as SelectTrigger, _ as cycleableSiteChromeOptions, _a as CollapsibleContent, aa as Input, an as deriveRouteMetadataPresentation, ba as DropdownMenu, bi as buttonStyleSelectionParameterValue, c as selectionSnapshotFromApplySiteStyleSelectionResponse, ca as TabsList, d as resolveStyleConfiguratorInitialSnapshot, ea as CalloutDescription, et as resolvePreviewSidebarTab, fn as createManifestValidation, g as cycleSiteChromeLookId, ga as Collapsible, h as buildSiteChromeLookModels, hn as createStoreBackend, ia as PopoverTrigger, io as ChevronLeft, j as markApplyFailed, ja as unsafeAsEditorBlockId, ji as paletteColorEntries, k as dismissWarnings, ka as cn, kr as findFooterLook, l as deriveSiteStylePreviewUpdate, la as TabsTrigger, m as reportPreviewDesignError, n as useSiteChromeCustomizeOptional, na as Popover, oa as Tabs, on as resolvePageRouteSlug, oo as Check, ot as ContentFieldsForm, p as PREVIEW_DESIGN_SAVE_ERROR_MESSAGE, pn as FormRenderer, qr as curatedPalettes, ra as PopoverContent, rn as isAdapterReferenceKind, ro as ChevronRight, s as buildApplySiteStyleSelectionBody, sa as TabsContent, sn as resolveContentTitle, st as useUISelector, ta as SearchInput, tt as FooterComposerPanel, u as planSiteStylePreviewChange, un as ManifestForm, ut as useEntryController, v as planSiteChromeLookSelection, va as CollapsibleTrigger, w as applyResolvedSelections, wa as DropdownMenuSeparator, wi as buttonStyleSelectionKey, x as usePreviewDesignCoordinator, xa as DropdownMenuContent, xi as findButtonStyleRecipe, y as siteChromeLookUnavailableReasonLabel, ya as Surface, yn as listEntryPageContentSlots, z as previewHeaderLayout, zr as getHeaderLayout } from "./SiteChromeCustomizeContext-
|
|
2
|
+
import { $ as createOptimisticActionRunner, $i as Callout, A as isPreviewingChange, B as previewHeaderStyle, Br as getHeaderStyle, Ca as DropdownMenuLabel, Ci as updateButtonStyleSelectionChoice, D as createStyleConfiguratorState, Da as Button, Dr as getCuratedSiteStyle, E as cancelPreview, F as palettePreviewProjection, Ft as BlockEditor, G as syncStyleConfiguratorState, H as resetTypographyToSaved, Ht as useEditorUiStoreInstance, I as previewButtonStyle, Ji as Select, K as toggleRow, L as previewCuratedPalette, La as X$1, M as markApplySaved, Mi as paletteColorsSchema, N as markApplySaving, Na as assertNever$1, O as deriveStyleConfiguratorCapabilities, On as ThemeScope, P as openRow, Qa as LoaderCircle, Qi as SelectValue, R as previewFooterLook, Sa as DropdownMenuItem, Si as resolveButtonStyleSelection, T as applyTypographyDraftPatch, Ta as DropdownMenuTrigger, Ti as themeButtonClassName, Tr as curatedSiteStyles, U as setPaletteColors, Ua as Smartphone, V as previewSiteStyle, Va as Tablet, Vt as useEditorUiStore, W as styleConfiguratorHistoryEntryForPersistedSelection, Wa as SlidersHorizontal, Xa as Monitor, Xi as SelectItem, Yi as SelectContent, Za as Maximize2, Zi as SelectTrigger, _ as cycleableSiteChromeOptions, _a as CollapsibleContent, aa as Input, an as deriveRouteMetadataPresentation, ba as DropdownMenu, bi as buttonStyleSelectionParameterValue, c as selectionSnapshotFromApplySiteStyleSelectionResponse, ca as TabsList, d as resolveStyleConfiguratorInitialSnapshot, ea as CalloutDescription, et as resolvePreviewSidebarTab, fn as createManifestValidation, g as cycleSiteChromeLookId, ga as Collapsible, h as buildSiteChromeLookModels, hn as createStoreBackend, ia as PopoverTrigger, io as ChevronLeft, j as markApplyFailed, ja as unsafeAsEditorBlockId, ji as paletteColorEntries, k as dismissWarnings, ka as cn, kr as findFooterLook, l as deriveSiteStylePreviewUpdate, la as TabsTrigger, m as reportPreviewDesignError, n as useSiteChromeCustomizeOptional, na as Popover, oa as Tabs, on as resolvePageRouteSlug, oo as Check, ot as ContentFieldsForm, p as PREVIEW_DESIGN_SAVE_ERROR_MESSAGE, pn as FormRenderer, qr as curatedPalettes, ra as PopoverContent, rn as isAdapterReferenceKind, ro as ChevronRight, s as buildApplySiteStyleSelectionBody, sa as TabsContent, sn as resolveContentTitle, st as useUISelector, ta as SearchInput, tt as FooterComposerPanel, u as planSiteStylePreviewChange, un as ManifestForm, ut as useEntryController, v as planSiteChromeLookSelection, va as CollapsibleTrigger, w as applyResolvedSelections, wa as DropdownMenuSeparator, wi as buttonStyleSelectionKey, x as usePreviewDesignCoordinator, xa as DropdownMenuContent, xi as findButtonStyleRecipe, y as siteChromeLookUnavailableReasonLabel, ya as Surface, yn as listEntryPageContentSlots, z as previewHeaderLayout, zr as getHeaderLayout } from "./SiteChromeCustomizeContext-D9SlpwEj.mjs";
|
|
3
3
|
import { d as unwrapResponse, f as getDashboardUrl, r as usePreviewAuth } from "./previewAuthStore-BesgU5Xu.mjs";
|
|
4
|
-
import { t as Separator } from "./separator-
|
|
5
|
-
import { S as getSiteFontsStorageUrl, _ as useBlockCustomizeControls, b as buildFontPreviewUrl, d as resolvePreviewDashboardSetupHandoff, f as resolvePreviewEditorGuidanceModel, g as usePreviewBlockCustomizeSelectionOptional, h as canInspectSiteStyle, m as canApplySiteStyle, p as resolvePreviewSidebarChromeModel, u as buildPreviewDashboardSetupUrl, v as PreviewFormProvider, x as generateFontFaceCss, y as previewWidgetOverrides } from "./SdkPreviewModeRuntime-
|
|
4
|
+
import { t as Separator } from "./separator-DkTe68HE.mjs";
|
|
5
|
+
import { S as getSiteFontsStorageUrl, _ as useBlockCustomizeControls, b as buildFontPreviewUrl, d as resolvePreviewDashboardSetupHandoff, f as resolvePreviewEditorGuidanceModel, g as usePreviewBlockCustomizeSelectionOptional, h as canInspectSiteStyle, m as canApplySiteStyle, p as resolvePreviewSidebarChromeModel, u as buildPreviewDashboardSetupUrl, v as PreviewFormProvider, x as generateFontFaceCss, y as previewWidgetOverrides } from "./SdkPreviewModeRuntime-BJumZy1B.mjs";
|
|
6
6
|
import React, { createContext, forwardRef, useCallback, useContext, useEffect, useId, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore, useTransition } from "react";
|
|
7
7
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
import { useQuery, useQueryClient } from "@tanstack/react-query";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { Ba as TriangleAlert, Bt as classifyHistoryShortcut, Da as Button, Gi as Tooltip, Ha as Sparkles, Ht as useEditorUiStoreInstance, Ja as PenLine, Ka as Redo2, Ki as TooltipContent, Mt as useEditor, Oa as cva, Qa as LoaderCircle, Qt as useMultiAutosave, Sa as DropdownMenuItem, Ta as DropdownMenuTrigger, Vt as useEditorUiStore, Ya as Palette, a as previewDesignHistoryDomainForCommand, ao as ChevronDown, ba as DropdownMenu, da as DialogContent, dt as useEntryEditorController, fa as DialogDescription, ha as DialogTitle, i as usePreviewDesignHistoryOrder, ka as cn, ma as DialogHeader, n as useSiteChromeCustomizeOptional, no as EllipsisVertical, o as selectPreviewDesignHistoryDomain, qa as Pencil, qi as TooltipTrigger, to as Eye, ua as Dialog, xa as DropdownMenuContent, za as Undo2 } from "./SiteChromeCustomizeContext-
|
|
2
|
+
import { Ba as TriangleAlert, Bt as classifyHistoryShortcut, Da as Button, Gi as Tooltip, Ha as Sparkles, Ht as useEditorUiStoreInstance, Ja as PenLine, Ka as Redo2, Ki as TooltipContent, Mt as useEditor, Oa as cva, Qa as LoaderCircle, Qt as useMultiAutosave, Sa as DropdownMenuItem, Ta as DropdownMenuTrigger, Vt as useEditorUiStore, Ya as Palette, a as previewDesignHistoryDomainForCommand, ao as ChevronDown, ba as DropdownMenu, da as DialogContent, dt as useEntryEditorController, fa as DialogDescription, ha as DialogTitle, i as usePreviewDesignHistoryOrder, ka as cn, ma as DialogHeader, n as useSiteChromeCustomizeOptional, no as EllipsisVertical, o as selectPreviewDesignHistoryDomain, qa as Pencil, qi as TooltipTrigger, to as Eye, ua as Dialog, xa as DropdownMenuContent, za as Undo2 } from "./SiteChromeCustomizeContext-D9SlpwEj.mjs";
|
|
3
3
|
import { d as unwrapResponse, r as usePreviewAuth } from "./previewAuthStore-BesgU5Xu.mjs";
|
|
4
|
-
import { C as FixedBottomSurface, a as usePreviewPageDesignEditorState, c as applyPreviewChromeSurfaceToElement, l as resolvePreviewChromeSurface, o as PREVIEW_CHROME_PORTAL_CLASS_NAME, s as PREVIEW_CHROME_THEME_CLASS_NAME } from "./SdkPreviewModeRuntime-
|
|
4
|
+
import { C as FixedBottomSurface, a as usePreviewPageDesignEditorState, c as applyPreviewChromeSurfaceToElement, l as resolvePreviewChromeSurface, o as PREVIEW_CHROME_PORTAL_CLASS_NAME, s as PREVIEW_CHROME_THEME_CLASS_NAME } from "./SdkPreviewModeRuntime-BJumZy1B.mjs";
|
|
5
5
|
import * as React$1 from "react";
|
|
6
6
|
import { useCallback, useEffect, useMemo, useState, useTransition } from "react";
|
|
7
7
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|