@riverbankcms/sdk 0.128.0 → 0.129.1
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 +52 -256
- package/dist/{PreviewEditorSidebar-Dbvb7GIr.mjs → PreviewEditorSidebar-DceRseRV.mjs} +3 -3
- package/dist/{PreviewEditorUI-e9O9l20X.mjs → PreviewEditorUI-BNunq3kk.mjs} +2 -2
- package/dist/{SdkPreviewModeRuntime-BZHt6e9w.mjs → SdkPreviewModeRuntime-Bt87-62u.mjs} +495 -292
- package/dist/{SiteChromeCustomizeContext-CvuGbHJX.mjs → SiteChromeCustomizeContext-BLl-OlL4.mjs} +600 -533
- package/dist/_dts/ai/src/contracts/commandExposure.d.ts +1 -1
- package/dist/_dts/ai/src/contracts/proposals.d.ts +4897 -4897
- package/dist/_dts/api/src/index.d.ts +2 -1
- package/dist/_dts/api/src/sdk-event-management.d.ts +53 -0
- package/dist/_dts/api/src/sdk-event-schedule.d.ts +3 -6
- package/dist/_dts/api/src/sdkContracts.d.ts +37 -50
- package/dist/_dts/api/src/sdkThemeWire.d.ts +2595 -0
- package/dist/_dts/api/src/sitePlatformEndpoints.d.ts +13 -29
- 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/media-core/src/index.d.ts +1 -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/config/types.d.ts +4 -4
- 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/_dts/theme-core/src/buttons/index.d.ts +1 -0
- package/dist/_dts/theme-core/src/palette/index.d.ts +1 -0
- package/dist/_dts/theme-core/src/site-styles/headerLayoutStyleCatalog.d.ts +254 -0
- package/dist/_dts/theme-core/src/site-styles/headerLegacyLooks.d.ts +372 -0
- package/dist/_dts/theme-core/src/site-styles/headerLookBranding.d.ts +106 -0
- package/dist/_dts/theme-core/src/site-styles/headerLookSelection.d.ts +2 -0
- package/dist/_dts/theme-core/src/site-styles/headerLookTypes.d.ts +212 -0
- package/dist/_dts/theme-core/src/site-styles/headerLooks.d.ts +7 -841
- package/dist/_dts/theme-core/src/site-styles/headerStyleCompiler.d.ts +3 -0
- package/dist/_dts/theme-core/src/site-styles/headerStyleCompilerPrimitives.d.ts +23 -0
- package/dist/client/client.mjs +911 -762
- package/dist/client/hooks.mjs +59 -36
- package/dist/client/rendering/client.mjs +593 -547
- package/dist/client/rendering.mjs +994 -783
- 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-C20CVWbb.mjs} +1 -1
- package/dist/{separator-CEoGABRc.mjs → separator-BE3NCquy.mjs} +1 -1
- package/dist/server/components.mjs +549 -399
- package/dist/server/config-validation.mjs +59 -36
- package/dist/server/config.mjs +59 -36
- package/dist/server/data.mjs +59 -36
- package/dist/server/index.mjs +1 -1
- package/dist/server/manifest.mjs +4966 -0
- package/dist/server/next.mjs +700 -537
- package/dist/server/page-converter.mjs +40 -36
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/rendering/server.mjs +571 -404
- package/dist/server/rendering.mjs +571 -404
- package/dist/server/routing.mjs +472 -402
- package/dist/server/server.mjs +60 -37
- package/dist/server/theme-bridge.mjs +70 -66
- package/package.json +9 -12
- package/dist/_dts/api/src/event-presentation.d.ts +0 -14
- package/dist/_dts/blocks/src/definitions.d.ts +0 -14
- package/dist/_dts/sdk/src/cli/canonical-entry-policy.d.ts +0 -53
- package/dist/_dts/sdk/src/cli/commands/audit.d.ts +0 -101
- package/dist/_dts/sdk/src/cli/commands/block.d.ts +0 -24
- package/dist/_dts/sdk/src/cli/commands/compare.d.ts +0 -62
- package/dist/_dts/sdk/src/cli/commands/content-type.d.ts +0 -10
- package/dist/_dts/sdk/src/cli/commands/content.d.ts +0 -56
- package/dist/_dts/sdk/src/cli/commands/delete.d.ts +0 -14
- package/dist/_dts/sdk/src/cli/commands/deploy.d.ts +0 -43
- package/dist/_dts/sdk/src/cli/commands/drafts.d.ts +0 -18
- package/dist/_dts/sdk/src/cli/commands/entry.d.ts +0 -55
- package/dist/_dts/sdk/src/cli/commands/env.d.ts +0 -31
- package/dist/_dts/sdk/src/cli/commands/event.d.ts +0 -23
- package/dist/_dts/sdk/src/cli/commands/eventOccurrenceSchedule.d.ts +0 -12
- package/dist/_dts/sdk/src/cli/commands/identifiers.d.ts +0 -10
- package/dist/_dts/sdk/src/cli/commands/init-docs.d.ts +0 -13
- package/dist/_dts/sdk/src/cli/commands/manifest.d.ts +0 -10
- package/dist/_dts/sdk/src/cli/commands/media-validation.d.ts +0 -3
- package/dist/_dts/sdk/src/cli/commands/migrate.d.ts +0 -11
- package/dist/_dts/sdk/src/cli/commands/navigation.d.ts +0 -12
- package/dist/_dts/sdk/src/cli/commands/page.d.ts +0 -14
- package/dist/_dts/sdk/src/cli/commands/publish-all.d.ts +0 -50
- package/dist/_dts/sdk/src/cli/commands/pull-dated-offering-scope.d.ts +0 -10
- package/dist/_dts/sdk/src/cli/commands/pull-dry-run.d.ts +0 -70
- package/dist/_dts/sdk/src/cli/commands/pull-scope-diff.d.ts +0 -8
- package/dist/_dts/sdk/src/cli/commands/pull.d.ts +0 -43
- package/dist/_dts/sdk/src/cli/commands/push/consts.d.ts +0 -3
- package/dist/_dts/sdk/src/cli/commands/push/execute/diff.d.ts +0 -19
- package/dist/_dts/sdk/src/cli/commands/push/execute/footer.d.ts +0 -42
- package/dist/_dts/sdk/src/cli/commands/push/execute/localMediaReporting.d.ts +0 -23
- package/dist/_dts/sdk/src/cli/commands/push/execute/media.d.ts +0 -22
- package/dist/_dts/sdk/src/cli/commands/push/execute/metadata.d.ts +0 -1
- package/dist/_dts/sdk/src/cli/commands/push/execute/reporting.d.ts +0 -7
- package/dist/_dts/sdk/src/cli/commands/push/execute/theme.d.ts +0 -63
- package/dist/_dts/sdk/src/cli/commands/push/filter.d.ts +0 -15
- package/dist/_dts/sdk/src/cli/commands/push/metadata.d.ts +0 -29
- package/dist/_dts/sdk/src/cli/commands/push/normalizeLocalContent.d.ts +0 -2
- package/dist/_dts/sdk/src/cli/commands/push/options.d.ts +0 -32
- package/dist/_dts/sdk/src/cli/commands/push/publishGuidance.d.ts +0 -15
- package/dist/_dts/sdk/src/cli/commands/push/pushAllExtras.d.ts +0 -25
- package/dist/_dts/sdk/src/cli/commands/push/scopes/commandBackedDatedOfferingScope.d.ts +0 -83
- package/dist/_dts/sdk/src/cli/commands/push/scopes/eventCategories.d.ts +0 -4
- package/dist/_dts/sdk/src/cli/commands/push/scopes/events.d.ts +0 -4
- package/dist/_dts/sdk/src/cli/commands/push/scopes/mediaPrep.d.ts +0 -14
- package/dist/_dts/sdk/src/cli/commands/push/scopes/pushScopeGeneric.d.ts +0 -6
- package/dist/_dts/sdk/src/cli/commands/push/scopes/types.d.ts +0 -87
- package/dist/_dts/sdk/src/cli/commands/push/scopes/venues.d.ts +0 -4
- package/dist/_dts/sdk/src/cli/commands/push/stale-resolution.d.ts +0 -48
- package/dist/_dts/sdk/src/cli/commands/push/stale.d.ts +0 -17
- package/dist/_dts/sdk/src/cli/commands/push/verification.d.ts +0 -56
- package/dist/_dts/sdk/src/cli/commands/push/workflowPlan.d.ts +0 -34
- package/dist/_dts/sdk/src/cli/commands/push-execute.d.ts +0 -54
- package/dist/_dts/sdk/src/cli/commands/push.d.ts +0 -40
- package/dist/_dts/sdk/src/cli/commands/setup.d.ts +0 -3
- package/dist/_dts/sdk/src/cli/commands/style.d.ts +0 -60
- package/dist/_dts/sdk/src/cli/commands/verify.d.ts +0 -11
- package/dist/_dts/sdk/src/cli/commands/webhooks.d.ts +0 -44
- package/dist/_dts/sdk/src/cli/config-loader.d.ts +0 -47
- package/dist/_dts/sdk/src/cli/content/collectionWriters.d.ts +0 -23
- package/dist/_dts/sdk/src/cli/content/edit/format.d.ts +0 -2
- package/dist/_dts/sdk/src/cli/content/edit/path.d.ts +0 -14
- package/dist/_dts/sdk/src/cli/content/edit/planner.d.ts +0 -46
- package/dist/_dts/sdk/src/cli/content/entryPaths.d.ts +0 -6
- package/dist/_dts/sdk/src/cli/content/footerFile.d.ts +0 -10
- package/dist/_dts/sdk/src/cli/content/fs-utils.d.ts +0 -39
- package/dist/_dts/sdk/src/cli/content/legacyEventScheduleShapeError.d.ts +0 -5
- package/dist/_dts/sdk/src/cli/content/localEventSchedule.d.ts +0 -17
- package/dist/_dts/sdk/src/cli/content/media-manifest.d.ts +0 -13
- package/dist/_dts/sdk/src/cli/content/metadataAfterPush.d.ts +0 -25
- package/dist/_dts/sdk/src/cli/content/metadataStore.d.ts +0 -29
- package/dist/_dts/sdk/src/cli/content/reader.d.ts +0 -488
- package/dist/_dts/sdk/src/cli/content/writer.d.ts +0 -142
- package/dist/_dts/sdk/src/cli/env-scope.d.ts +0 -2
- package/dist/_dts/sdk/src/cli/env.d.ts +0 -71
- package/dist/_dts/sdk/src/cli/errors.d.ts +0 -62
- package/dist/_dts/sdk/src/cli/helpers/ai-runtime.d.ts +0 -2
- package/dist/_dts/sdk/src/cli/helpers.d.ts +0 -399
- package/dist/_dts/sdk/src/cli/index.d.ts +0 -11
- package/dist/_dts/sdk/src/cli/init-docs/constants.d.ts +0 -16
- package/dist/_dts/sdk/src/cli/init-docs/index.d.ts +0 -12
- package/dist/_dts/sdk/src/cli/init-docs/templates.d.ts +0 -18
- package/dist/_dts/sdk/src/cli/init-docs/zod-to-markdown.d.ts +0 -28
- package/dist/_dts/sdk/src/cli/load-config.d.ts +0 -14
- package/dist/_dts/sdk/src/cli/media/identifiers.d.ts +0 -18
- package/dist/_dts/sdk/src/cli/media/local-media.d.ts +0 -14
- package/dist/_dts/sdk/src/cli/media/local-sync.d.ts +0 -91
- package/dist/_dts/sdk/src/cli/media/portable.d.ts +0 -11
- package/dist/_dts/sdk/src/cli/media/rich-text.d.ts +0 -12
- package/dist/_dts/sdk/src/cli/media/value-utils.d.ts +0 -15
- package/dist/_dts/sdk/src/cli/media/write-guard.d.ts +0 -52
- package/dist/_dts/sdk/src/cli/merge-remote/entryLocal.d.ts +0 -3
- package/dist/_dts/sdk/src/cli/merge-remote/entryMerge.d.ts +0 -78
- package/dist/_dts/sdk/src/cli/merge-remote/entryMergePlan.d.ts +0 -45
- package/dist/_dts/sdk/src/cli/merge-remote/entryMergePush.d.ts +0 -24
- package/dist/_dts/sdk/src/cli/merge-remote/entryMergeReport.d.ts +0 -18
- package/dist/_dts/sdk/src/cli/merge-remote/entryRemote.d.ts +0 -9
- package/dist/_dts/sdk/src/cli/merge-remote/entrySnapshots.d.ts +0 -48
- package/dist/_dts/sdk/src/cli/merge-remote/mergeFieldChanges.d.ts +0 -22
- package/dist/_dts/sdk/src/cli/merge-remote/pageLocal.d.ts +0 -3
- package/dist/_dts/sdk/src/cli/merge-remote/pageMerge.d.ts +0 -78
- package/dist/_dts/sdk/src/cli/merge-remote/pageMergePlan.d.ts +0 -36
- package/dist/_dts/sdk/src/cli/merge-remote/pageMergePush.d.ts +0 -23
- package/dist/_dts/sdk/src/cli/merge-remote/pageMergeReport.d.ts +0 -17
- package/dist/_dts/sdk/src/cli/merge-remote/pageSnapshots.d.ts +0 -46
- package/dist/_dts/sdk/src/cli/merge-remote/sharedBaseSnapshots.d.ts +0 -32
- package/dist/_dts/sdk/src/cli/merge-remote/sharedMergePlan.d.ts +0 -27
- package/dist/_dts/sdk/src/cli/merge-remote/sharedMergeReport.d.ts +0 -63
- package/dist/_dts/sdk/src/cli/migrations/entries.d.ts +0 -28
- package/dist/_dts/sdk/src/cli/migrations/events.d.ts +0 -73
- package/dist/_dts/sdk/src/cli/navigationIdentity.d.ts +0 -11
- package/dist/_dts/sdk/src/cli/output.d.ts +0 -133
- package/dist/_dts/sdk/src/cli/program.d.ts +0 -29
- package/dist/_dts/sdk/src/cli/push-config.d.ts +0 -49
- package/dist/_dts/sdk/src/cli/setup/setupPlan.d.ts +0 -51
- package/dist/_dts/sdk/src/cli/site-commands/commandKeys.d.ts +0 -13
- package/dist/_dts/sdk/src/cli/site-commands/commandRuntime.d.ts +0 -170
- package/dist/_dts/sdk/src/cli/site-commands/commandRuntimeCompat.d.ts +0 -21
- package/dist/_dts/sdk/src/cli/site-commands/commandSurfaceDispatch.d.ts +0 -32
- package/dist/_dts/sdk/src/cli/site-commands/datedOfferingCommands.d.ts +0 -53
- package/dist/_dts/sdk/src/cli/site-commands/entryCommands.d.ts +0 -65
- package/dist/_dts/sdk/src/cli/site-commands/eventScheduleCompiler.d.ts +0 -24
- package/dist/_dts/sdk/src/cli/site-commands/footerCommands.d.ts +0 -68
- package/dist/_dts/sdk/src/cli/site-commands/formCommands.d.ts +0 -53
- package/dist/_dts/sdk/src/cli/site-commands/index.d.ts +0 -8
- package/dist/_dts/sdk/src/cli/site-commands/localBlockManifestResolver.d.ts +0 -31
- package/dist/_dts/sdk/src/cli/site-commands/navigationCommands.d.ts +0 -57
- package/dist/_dts/sdk/src/cli/site-commands/oneOffCommands.d.ts +0 -82
- package/dist/_dts/sdk/src/cli/site-commands/pageCommands.d.ts +0 -84
- package/dist/_dts/sdk/src/cli/site-commands/pushExecution.d.ts +0 -39
- package/dist/_dts/sdk/src/cli/site-commands/pushExecutionPlan.d.ts +0 -8
- package/dist/_dts/sdk/src/cli/site-commands/pushExecutionTypes.d.ts +0 -97
- package/dist/_dts/sdk/src/cli/site-commands/residualSettingsTrimming.d.ts +0 -15
- package/dist/_dts/sdk/src/cli/sync/diff.d.ts +0 -222
- package/dist/_dts/sdk/src/cli/sync/executor.d.ts +0 -84
- package/dist/_dts/sdk/src/cli/sync/field-diff.d.ts +0 -39
- package/dist/_dts/sdk/src/cli/sync/index.d.ts +0 -10
- package/dist/_dts/sdk/src/cli/sync/mapper.d.ts +0 -41
- package/dist/_dts/sdk/src/cli/sync/media-sync.d.ts +0 -15
- package/dist/_dts/sdk/src/cli/sync/media.d.ts +0 -158
- package/dist/_dts/sdk/src/cli/sync/syncResultAggregation.d.ts +0 -4
- package/dist/_dts/sdk/src/cli/sync/validation.d.ts +0 -68
- package/dist/_dts/sdk/src/cli/utils/checksum.d.ts +0 -1
- package/dist/_dts/sdk/src/client/management/blocks.d.ts +0 -19
- package/dist/_dts/sdk/src/client/management/catalog.d.ts +0 -10
- package/dist/_dts/sdk/src/client/management/entries.d.ts +0 -6
- package/dist/_dts/sdk/src/client/management/eventCategories.d.ts +0 -6
- package/dist/_dts/sdk/src/client/management/events.d.ts +0 -7
- package/dist/_dts/sdk/src/client/management/footer.d.ts +0 -9
- package/dist/_dts/sdk/src/client/management/forms.d.ts +0 -6
- package/dist/_dts/sdk/src/client/management/http.d.ts +0 -79
- package/dist/_dts/sdk/src/client/management/identifiers.d.ts +0 -11
- package/dist/_dts/sdk/src/client/management/index.d.ts +0 -41
- package/dist/_dts/sdk/src/client/management/media.d.ts +0 -72
- package/dist/_dts/sdk/src/client/management/navigation.d.ts +0 -6
- package/dist/_dts/sdk/src/client/management/pages.d.ts +0 -6
- package/dist/_dts/sdk/src/client/management/pull.d.ts +0 -6
- package/dist/_dts/sdk/src/client/management/settings-branding.d.ts +0 -32
- package/dist/_dts/sdk/src/client/management/settings.d.ts +0 -6
- package/dist/_dts/sdk/src/client/management/theme.d.ts +0 -8
- package/dist/_dts/sdk/src/client/management/types.d.ts +0 -1069
- package/dist/_dts/sdk/src/client/management/venues.d.ts +0 -6
- package/dist/_dts/sdk/src/client/management/webhooks.d.ts +0 -3
- package/dist/_dts/sdk/src/test/env.d.ts +0 -4
- package/dist/_dts/site-commands/src/adapter.d.ts +0 -23
- package/dist/_dts/site-commands/src/appointmentCommandSchemas.d.ts +0 -100
- package/dist/_dts/site-commands/src/capabilityGaps.d.ts +0 -8
- package/dist/_dts/site-commands/src/commandContract.d.ts +0 -1277
- package/dist/_dts/site-commands/src/commandDomain.d.ts +0 -20
- package/dist/_dts/site-commands/src/commandIdentifiers.d.ts +0 -7
- package/dist/_dts/site-commands/src/commandValidation.d.ts +0 -10
- package/dist/_dts/site-commands/src/commands.d.ts +0 -1983
- package/dist/_dts/site-commands/src/domain.d.ts +0 -104
- package/dist/_dts/site-commands/src/eventCommandContent.d.ts +0 -11
- package/dist/_dts/site-commands/src/exposure.d.ts +0 -41
- package/dist/_dts/site-commands/src/guards.d.ts +0 -1
- package/dist/_dts/site-commands/src/index.d.ts +0 -18
- package/dist/_dts/site-commands/src/metadata.d.ts +0 -555
- package/dist/_dts/site-commands/src/pagePaths.d.ts +0 -6
- package/dist/_dts/site-commands/src/planner.d.ts +0 -58
- package/dist/_dts/site-commands/src/refContributions.d.ts +0 -11
- package/dist/_dts/site-commands/src/refs.d.ts +0 -90
- package/dist/_dts/site-commands/src/siteStyleCommandSchema.d.ts +0 -405
- package/dist/_dts/site-commands/src/siteStyleSelectionSchemaBuilder.d.ts +0 -46
- package/dist/_dts/site-commands/src/stableJson.d.ts +0 -5
- package/dist/_dts/site-commands/src/staticExecutionGaps.d.ts +0 -10
- package/dist/_dts/site-commands/src/venueCommandMapping.d.ts +0 -21
- package/dist/_dts/theme-core/src/data.d.ts +0 -12
- package/dist/_dts/theme-core/src/site-styles/headerStyleParts.d.ts +0 -4
- package/dist/cli/index.mjs +0 -162962
- package/dist/cli/init-docs/content/agents-section.md +0 -67
- package/dist/cli/init-docs/content/cli-reference.md +0 -1238
- package/dist/cli/init-docs/content/content-management.md +0 -792
- package/dist/cli/init-docs/content/context-brand.md +0 -125
- package/dist/cli/init-docs/content/context-brief.md +0 -77
- package/dist/cli/init-docs/content/context-knowledge.md +0 -111
- package/dist/cli/init-docs/content/getting-started.md +0 -171
- package/dist/cli/init-docs/content/site-workflows-readme.md +0 -96
- package/dist/cli/init-docs/content/workflow-add-block.md +0 -299
- package/dist/cli/init-docs/content/workflow-agent-safe-sync.md +0 -83
- package/dist/cli/init-docs/content/workflow-block-extensions.md +0 -370
- package/dist/cli/init-docs/content/workflow-cmsify-page.md +0 -357
- package/dist/cli/init-docs/content/workflow-content-types.md +0 -330
- package/dist/cli/init-docs/content/workflow-create-page.md +0 -212
- package/dist/cli/init-docs/content/workflow-custom-block.md +0 -470
- package/dist/cli/init-docs/content/workflow-editor-workflows.md +0 -130
- package/dist/cli/init-docs/content/workflow-isr-revalidation.md +0 -158
- package/dist/cli/init-docs/content/workflow-preview-mode.md +0 -239
- package/dist/cli/init-docs/content/workflow-publish.md +0 -285
- package/dist/cli/init-docs/content/workflow-remote-setup.md +0 -51
- package/dist/cli/init-docs/content/workflow-templates.md +0 -381
- /package/dist/_dts/{sdk/src/cli/utils/mime.d.ts → media-core/src/mimeType.d.ts} +0 -0
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
# Workflow: Build an Editor Workflow
|
|
2
|
-
|
|
3
|
-
## Purpose
|
|
4
|
-
|
|
5
|
-
Add a manual action to the Riverbank dashboard editor. Editor workflows are declared in `riverbank.config.ts` and run against either a content type or the page editor.
|
|
6
|
-
|
|
7
|
-
## Configure
|
|
8
|
-
|
|
9
|
-
Add a workflow to SDK config, then run `riverbankcms push-config`.
|
|
10
|
-
|
|
11
|
-
```ts
|
|
12
|
-
export default {
|
|
13
|
-
siteId: process.env.RIVERBANK_SITE_ID,
|
|
14
|
-
previewUrl: "https://preview.example.com",
|
|
15
|
-
workflows: [
|
|
16
|
-
{
|
|
17
|
-
id: "page.generate-seo",
|
|
18
|
-
title: "Generate SEO metadata",
|
|
19
|
-
description: "Draft page SEO fields from the current page.",
|
|
20
|
-
contentType: "page",
|
|
21
|
-
endpoint: "/api/workflows/generate-seo",
|
|
22
|
-
triggers: [{ type: "manual" }],
|
|
23
|
-
},
|
|
24
|
-
],
|
|
25
|
-
};
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
Use `contentType: "page"` for page workflows. Use a content type key, such as `blog-post`, for entry workflows. If `workflows` is missing or empty, the dashboard does not show the workflow section.
|
|
29
|
-
|
|
30
|
-
## Handle the Request
|
|
31
|
-
|
|
32
|
-
Riverbank saves the draft, disables the editor, creates a workflow run, and posts to your endpoint. Verify the raw body with the same HMAC helper used for webhooks:
|
|
33
|
-
|
|
34
|
-
The `x-riverbank-signature` header is formatted as `sha256=<hex HMAC-SHA256 digest>`.
|
|
35
|
-
|
|
36
|
-
```ts
|
|
37
|
-
import { verifyWebhookSignature } from "@riverbankcms/sdk/webhooks";
|
|
38
|
-
|
|
39
|
-
export async function POST(request: Request) {
|
|
40
|
-
const body = await request.text();
|
|
41
|
-
const signature = request.headers.get("x-riverbank-signature");
|
|
42
|
-
const secret = process.env.RIVERBANK_WEBHOOK_SECRET;
|
|
43
|
-
|
|
44
|
-
if (
|
|
45
|
-
!signature ||
|
|
46
|
-
!secret ||
|
|
47
|
-
!verifyWebhookSignature(body, signature, secret)
|
|
48
|
-
) {
|
|
49
|
-
return Response.json({ error: "Invalid signature" }, { status: 401 });
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
const payload = JSON.parse(body);
|
|
53
|
-
// payload.entry.kind is "page" or "content-entry"
|
|
54
|
-
|
|
55
|
-
return Response.json({
|
|
56
|
-
status: "succeeded",
|
|
57
|
-
summary: "Draft updated",
|
|
58
|
-
draftContentPatch: {
|
|
59
|
-
draftMetaDescription: "A concise search description.",
|
|
60
|
-
},
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
The request includes `runId`, `siteId`, `workflowId`, `contentType`, `entryId`, `trigger`, and an `entry` snapshot.
|
|
66
|
-
|
|
67
|
-
## Return a Result
|
|
68
|
-
|
|
69
|
-
For immediate changes, return:
|
|
70
|
-
|
|
71
|
-
```json
|
|
72
|
-
{
|
|
73
|
-
"status": "succeeded",
|
|
74
|
-
"summary": "Updated the draft",
|
|
75
|
-
"draftContentPatch": {}
|
|
76
|
-
}
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
For longer work, return:
|
|
80
|
-
|
|
81
|
-
```json
|
|
82
|
-
{
|
|
83
|
-
"status": "accepted",
|
|
84
|
-
"externalJobId": "job_123",
|
|
85
|
-
"summary": "Started"
|
|
86
|
-
}
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
Then call the management API when the job completes:
|
|
90
|
-
|
|
91
|
-
```bash
|
|
92
|
-
curl -X POST "$RIVERBANK_DASHBOARD_URL/api/sdk/$RIVERBANK_SITE_ID/workflows/runs/$RUN_ID/status" \
|
|
93
|
-
-H "Authorization: Bearer $RIVERBANK_MGMT_API_KEY" \
|
|
94
|
-
-H "Content-Type: application/json" \
|
|
95
|
-
-d '{"status":"succeeded","summary":"Done","draftContentPatch":{"draftMetaTitle":"Updated title"}}'
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
To report failure, return or callback with:
|
|
99
|
-
|
|
100
|
-
```json
|
|
101
|
-
{
|
|
102
|
-
"status": "failed",
|
|
103
|
-
"error": "Could not generate metadata"
|
|
104
|
-
}
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
## Draft Patch Rules
|
|
108
|
-
|
|
109
|
-
Content entry workflows patch draft content fields.
|
|
110
|
-
|
|
111
|
-
Page workflows patch route metadata only:
|
|
112
|
-
|
|
113
|
-
- `draftTitle`
|
|
114
|
-
- `draftSlug`
|
|
115
|
-
- `draftStatus`
|
|
116
|
-
- `scheduledPublishAt`
|
|
117
|
-
- `draftMetaTitle`
|
|
118
|
-
- `draftMetaDescription`
|
|
119
|
-
- `canonicalUrl`
|
|
120
|
-
- `ogImageId`
|
|
121
|
-
|
|
122
|
-
If the workflow returns no `draftContentPatch`, it must make changes through management API endpoints or leave the draft unchanged.
|
|
123
|
-
|
|
124
|
-
## Verification
|
|
125
|
-
|
|
126
|
-
1. Run `riverbankcms push-config`.
|
|
127
|
-
2. Open the matching entry or page in the dashboard.
|
|
128
|
-
3. Confirm the workflow section appears only when the config contains matching manual workflows.
|
|
129
|
-
4. Run the workflow and confirm the editor stays disabled until the endpoint returns or the async callback completes.
|
|
130
|
-
5. Confirm the draft reflects any returned patch.
|
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
# Workflow: Production ISR and Revalidation
|
|
2
|
-
|
|
3
|
-
## Purpose
|
|
4
|
-
|
|
5
|
-
Configure a Riverbank SDK Next.js App Router site to prerender published routes, serve production pages through ISR, and refresh affected paths when the CMS sends signed publish webhooks.
|
|
6
|
-
|
|
7
|
-
## Prerequisites
|
|
8
|
-
|
|
9
|
-
- A Riverbank SDK site using `createCatchAllPage()` in `src/app/[[...slug]]/page.tsx`.
|
|
10
|
-
- A production content API key in `RIVERBANK_API_KEY`.
|
|
11
|
-
- `RIVERBANK_SITE_ID` set to this site's Riverbank site ID.
|
|
12
|
-
- `NEXT_PUBLIC_DASHBOARD_URL` set to the dashboard origin, for example `https://cms.example.com`.
|
|
13
|
-
- `RIVERBANK_WEBHOOK_SECRET` set from the CMS-generated Riverbank webhook secret.
|
|
14
|
-
|
|
15
|
-
Preview deployments should also set `RIVERBANK_PREVIEW_MODE=true` so draft previews stay dynamic instead of serving stale ISR HTML.
|
|
16
|
-
|
|
17
|
-
## Configure the Catch-All Route
|
|
18
|
-
|
|
19
|
-
In `src/app/[[...slug]]/page.tsx`:
|
|
20
|
-
|
|
21
|
-
```tsx
|
|
22
|
-
import {
|
|
23
|
-
createCatchAllPage,
|
|
24
|
-
generateAllStaticParams,
|
|
25
|
-
getISRConfig,
|
|
26
|
-
} from '@riverbankcms/sdk/next'
|
|
27
|
-
|
|
28
|
-
import config from '@/riverbank.config'
|
|
29
|
-
import { blockOverrides } from '@/lib/block-overrides'
|
|
30
|
-
import { getRiverbankClient } from '@/lib/riverbank-client'
|
|
31
|
-
|
|
32
|
-
export const revalidate = getISRConfig().revalidate
|
|
33
|
-
export const dynamicParams = true
|
|
34
|
-
export { generateAllStaticParams as generateStaticParams }
|
|
35
|
-
|
|
36
|
-
const { Page, generateMetadata } = createCatchAllPage({
|
|
37
|
-
getClient: getRiverbankClient,
|
|
38
|
-
config,
|
|
39
|
-
blockOverrides,
|
|
40
|
-
})
|
|
41
|
-
|
|
42
|
-
export default Page
|
|
43
|
-
export { generateMetadata }
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
`generateAllStaticParams()` discovers published pages and routable entries at build time. It reads:
|
|
47
|
-
|
|
48
|
-
- `RIVERBANK_API_KEY`
|
|
49
|
-
- `RIVERBANK_SITE_ID`
|
|
50
|
-
- `NEXT_PUBLIC_DASHBOARD_URL`
|
|
51
|
-
|
|
52
|
-
By default, route discovery falls back to the homepage if the CMS is temporarily unavailable. Use strict mode when you want production CI to fail instead:
|
|
53
|
-
|
|
54
|
-
```tsx
|
|
55
|
-
import { generateAllStaticParams } from '@riverbankcms/sdk/next'
|
|
56
|
-
|
|
57
|
-
export function generateStaticParams() {
|
|
58
|
-
return generateAllStaticParams({ failureMode: 'throw' })
|
|
59
|
-
}
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
If your site already centralizes the SDK client, use the explicit factory:
|
|
63
|
-
|
|
64
|
-
```tsx
|
|
65
|
-
import { createGenerateStaticParams } from '@riverbankcms/sdk/next'
|
|
66
|
-
|
|
67
|
-
import config from '@/riverbank.config'
|
|
68
|
-
import { getRiverbankClient } from '@/lib/riverbank-client'
|
|
69
|
-
|
|
70
|
-
export const generateStaticParams = createGenerateStaticParams({
|
|
71
|
-
getClient: getRiverbankClient,
|
|
72
|
-
siteId: config.siteId,
|
|
73
|
-
failureMode: 'throw',
|
|
74
|
-
})
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
## Add the Revalidation Route
|
|
78
|
-
|
|
79
|
-
Create `src/app/api/revalidate/route.ts`:
|
|
80
|
-
|
|
81
|
-
```ts
|
|
82
|
-
import { createRevalidateHandler } from '@riverbankcms/sdk/next/revalidate'
|
|
83
|
-
import { getRiverbankClient } from '@/lib/riverbank-client'
|
|
84
|
-
|
|
85
|
-
export const POST = createRevalidateHandler({
|
|
86
|
-
getClient: getRiverbankClient,
|
|
87
|
-
})
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
The deployed site must have the CMS-generated webhook secret:
|
|
91
|
-
|
|
92
|
-
```bash
|
|
93
|
-
RIVERBANK_WEBHOOK_SECRET=...
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
Riverbank signs each request with:
|
|
97
|
-
|
|
98
|
-
```http
|
|
99
|
-
X-Riverbank-Signature: sha256=<hex HMAC-SHA256 digest>
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
The digest is computed over the raw JSON body. The SDK handler rejects unsigned requests, plain hex signatures without the `sha256=` prefix, malformed digests, bad signatures, and invalid payloads. Malformed path entries are skipped and reported in the response metadata while valid tags and paths still revalidate.
|
|
103
|
-
|
|
104
|
-
Passing `getClient: getRiverbankClient` also clears the current process's SDK client response cache after valid webhooks. This is useful in single-process deployments, `next dev`, `next start`, and runtimes where the revalidation route and render path share the same module instance. On serverless platforms such as Vercel, `/api/revalidate` and page rendering can run in separate functions and many warm containers, so this process-local cache clear is best-effort only. Use Next tag/path revalidation as the cross-instance freshness layer, and disable or shorten SDK response caching for force-dynamic deployments that need immediate freshness across serverless instances.
|
|
105
|
-
|
|
106
|
-
Riverbank includes a `dispatchId` in signed payloads and sends matching `X-Riverbank-Dispatch-Id` / `X-Riverbank-Correlation-Id` headers. To join CMS delivery logs with this site's deployment logs, use the optional callback metadata:
|
|
107
|
-
|
|
108
|
-
```ts
|
|
109
|
-
export const POST = createRevalidateHandler({
|
|
110
|
-
getClient: getRiverbankClient,
|
|
111
|
-
onRevalidate: (_payload, _items, metadata) => {
|
|
112
|
-
console.info('Riverbank ISR revalidated', metadata)
|
|
113
|
-
},
|
|
114
|
-
})
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
## Configure the CMS Webhook Endpoint
|
|
118
|
-
|
|
119
|
-
Use the SDK CLI to configure or reuse an enabled CMS webhook endpoint whose URL points at the deployed route:
|
|
120
|
-
|
|
121
|
-
```bash
|
|
122
|
-
riverbankcms webhooks setup \
|
|
123
|
-
--env=remote \
|
|
124
|
-
--url=https://www.example.com/api/revalidate \
|
|
125
|
-
--yes \
|
|
126
|
-
--vercel
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
The command keeps the CMS as the source of truth for the webhook secret. It creates or updates the endpoint, ensures the full SDK revalidation event list is subscribed, writes a newly generated one-time secret to `.env.local` when one is returned, and prints hosted-environment and deploy/test steps. Existing endpoint secrets are not returned or changed unless you pass `--rotate-secret`.
|
|
130
|
-
|
|
131
|
-
The deployed SDK site uses the returned one-time `RIVERBANK_WEBHOOK_SECRET`. The dashboard/CMS uses a separate `WEBHOOK_SIGNING_SECRET_KEYRING_JSON` environment variable to encrypt stored endpoint secrets; keep that keyring only in the dashboard environment.
|
|
132
|
-
|
|
133
|
-
The same destination URL can also be configured from the Riverbank dashboard:
|
|
134
|
-
|
|
135
|
-
```text
|
|
136
|
-
https://www.example.com/api/revalidate
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
SDK-site revalidation events include page and entry publish, unpublish, delete, and public path changes, along with navigation, theme, site settings, and public event updates. Event updates are tag-authoritative: they always invalidate the site-wide public event and event-filter tags, and include the linked event path when one is known. Events send top-level `paths` and `tags`; the SDK handler normalizes and dedupes them before calling `revalidatePath()` and `revalidateTag()`.
|
|
140
|
-
|
|
141
|
-
Some valid events are tags-only. Global render changes do not include explicit paths, and very large path sets degrade to tags-only delivery so webhook payloads stay bounded. Existing webhook endpoints may need their subscribed event list updated to receive the newer unpublish, delete, and path-change events.
|
|
142
|
-
|
|
143
|
-
For troubleshooting, inspect the endpoint's delivery logs in Riverbank. Each delivery stores minimized payload diagnostics with `dispatchId`, `siteId`, event, `pathCount`, `tagCount`, status, response time, and a minimized failure body. Secrets, signature headers, cookies, authorization headers, and raw sensitive fields are not written to delivery logs.
|
|
144
|
-
|
|
145
|
-
## Verify
|
|
146
|
-
|
|
147
|
-
1. Build the site with production environment variables present.
|
|
148
|
-
2. Confirm a published route is included in the static params output or appears as prerendered in the Next build summary.
|
|
149
|
-
3. Visit a published page.
|
|
150
|
-
4. Publish a change in the CMS.
|
|
151
|
-
5. Confirm the webhook delivery succeeds.
|
|
152
|
-
6. Reload the page and confirm the changed content appears without waiting for the normal ISR interval.
|
|
153
|
-
|
|
154
|
-
For local SDK development inside the Riverbank monorepo, the smoke check is:
|
|
155
|
-
|
|
156
|
-
```bash
|
|
157
|
-
pnpm --filter @riverbankcms/sdk test:isr-catch-all-revalidate-smoke
|
|
158
|
-
```
|
|
@@ -1,239 +0,0 @@
|
|
|
1
|
-
# Workflow: SDK Preview Mode
|
|
2
|
-
|
|
3
|
-
## Purpose
|
|
4
|
-
|
|
5
|
-
Enable dashboard preview editing for an SDK-hosted Next.js site. Preview mode lets the dashboard open the external site with a short-lived editor session, render draft content, and show the Riverbank preview shell.
|
|
6
|
-
|
|
7
|
-
## Prerequisites
|
|
8
|
-
|
|
9
|
-
- A Riverbank SDK site using the Next.js App Router.
|
|
10
|
-
- A preview/staging URL for the site.
|
|
11
|
-
- A Riverbank preview API key (`bld_preview_sk_...`) for draft content.
|
|
12
|
-
- Dashboard access to run `riverbankcms push-config`.
|
|
13
|
-
|
|
14
|
-
## Configure `riverbank.config.ts`
|
|
15
|
-
|
|
16
|
-
Set the preview URL and enable token-based preview editing:
|
|
17
|
-
|
|
18
|
-
```ts
|
|
19
|
-
import { defineConfig } from '@riverbankcms/sdk/config'
|
|
20
|
-
|
|
21
|
-
export default defineConfig({
|
|
22
|
-
siteId: process.env.RIVERBANK_SITE_ID!,
|
|
23
|
-
previewUrl: process.env.NEXT_PUBLIC_SITE_URL!,
|
|
24
|
-
dashboard: {
|
|
25
|
-
previewEditingEnabled: true,
|
|
26
|
-
},
|
|
27
|
-
})
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
Then sync the config:
|
|
31
|
-
|
|
32
|
-
```bash
|
|
33
|
-
riverbankcms push-config --env=remote
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
Use `--dashboard <url>` and `--api-key <key>` when you want explicit values to override environment variables.
|
|
37
|
-
|
|
38
|
-
## Add Preview Token Proxy
|
|
39
|
-
|
|
40
|
-
Create `src/proxy.ts`:
|
|
41
|
-
|
|
42
|
-
```ts
|
|
43
|
-
import { handlePreviewTokens } from '@riverbankcms/sdk/preview-next/middleware'
|
|
44
|
-
import { NextResponse, type NextRequest } from 'next/server'
|
|
45
|
-
|
|
46
|
-
import { getCmsConfig } from './lib/env'
|
|
47
|
-
|
|
48
|
-
export async function proxy(request: NextRequest) {
|
|
49
|
-
if (process.env.RIVERBANK_PREVIEW_MODE === 'true') {
|
|
50
|
-
const { dashboardUrl } = getCmsConfig()
|
|
51
|
-
const response = await handlePreviewTokens(request, {
|
|
52
|
-
dashboardUrl: dashboardUrl ?? null,
|
|
53
|
-
onExchangeFailure: (failure) => {
|
|
54
|
-
console.warn('[riverbank] preview token exchange failed', failure)
|
|
55
|
-
},
|
|
56
|
-
})
|
|
57
|
-
if (response) return response
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
return NextResponse.next()
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export const config = {
|
|
64
|
-
matcher: ['/((?!_next/static|_next/image|api|favicon.ico|robots.txt|sitemap.xml).*)'],
|
|
65
|
-
}
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
The example logs preview exchange failures with `console.warn`; replace it with your app logger if you already centralize server-side logging.
|
|
69
|
-
|
|
70
|
-
If you are upgrading an existing generated site, make sure your proxy imports `getCmsConfig`, is declared `async`, and passes `dashboardUrl` into `handlePreviewTokens`. Without the dashboard URL, visits with `preview_code` cannot exchange the short-lived code for preview cookies.
|
|
71
|
-
|
|
72
|
-
## Public Runtime Adapter Contracts
|
|
73
|
-
|
|
74
|
-
Use `resolveRouteDecision` for middleware or redirect-only checks. It returns only `contentExists`, `redirect`, `notFound`, or `loadFailed`; use `resolveRouteOutcome` only when the caller needs the full content payload for rendering.
|
|
75
|
-
|
|
76
|
-
Event registration endpoints use the `public-event-ticket-selection.v2` transport shape: pass `ticketSelections: [{ ticketTypeId, quantity }]`. Legacy top-level `ticketsCount` or `ticketTypeId` fields are rejected so stale clients fail visibly instead of silently selecting the wrong tickets.
|
|
77
|
-
|
|
78
|
-
## Add Preview Keep-Alive Route
|
|
79
|
-
|
|
80
|
-
Create `src/app/api/preview/keep-alive/route.ts`:
|
|
81
|
-
|
|
82
|
-
```ts
|
|
83
|
-
import type { NextRequest } from 'next/server'
|
|
84
|
-
|
|
85
|
-
import { createPreviewKeepAliveRouteHandler } from '@riverbankcms/sdk/preview-next/keep-alive'
|
|
86
|
-
|
|
87
|
-
const handler = createPreviewKeepAliveRouteHandler()
|
|
88
|
-
|
|
89
|
-
export function GET(request: NextRequest) {
|
|
90
|
-
return handler(request)
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
export function POST(request: NextRequest) {
|
|
94
|
-
return handler(request)
|
|
95
|
-
}
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
## Add The Client Preview Wrapper
|
|
99
|
-
|
|
100
|
-
Create `src/components/preview/SdkPreviewModeClient.tsx`:
|
|
101
|
-
|
|
102
|
-
```tsx
|
|
103
|
-
'use client'
|
|
104
|
-
|
|
105
|
-
import { PreviewQueryProvider, SdkPreviewMode, type SdkPreviewModeProps } from '@riverbankcms/sdk/preview-next/client'
|
|
106
|
-
|
|
107
|
-
import { blockOverrides } from '@/lib/block-overrides'
|
|
108
|
-
|
|
109
|
-
type SdkPreviewModeClientProps = Omit<SdkPreviewModeProps, 'blockOverrides'>
|
|
110
|
-
|
|
111
|
-
export function SdkPreviewModeClient(props: SdkPreviewModeClientProps) {
|
|
112
|
-
return (
|
|
113
|
-
<PreviewQueryProvider>
|
|
114
|
-
<SdkPreviewMode {...props} blockOverrides={blockOverrides} />
|
|
115
|
-
</PreviewQueryProvider>
|
|
116
|
-
)
|
|
117
|
-
}
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
## Wire The Catch-All Page
|
|
121
|
-
|
|
122
|
-
Use `createPreviewModeBeforeRender` in the catch-all page:
|
|
123
|
-
|
|
124
|
-
```tsx
|
|
125
|
-
import { createCatchAllPage } from '@riverbankcms/sdk/next'
|
|
126
|
-
import { createPreviewModeBeforeRender } from '@riverbankcms/sdk/preview-next/before-render'
|
|
127
|
-
|
|
128
|
-
import config from '../../../riverbank.config'
|
|
129
|
-
import { blockOverrides } from '@/lib/block-overrides'
|
|
130
|
-
import { getRiverbankClient } from '@/lib/riverbank-client'
|
|
131
|
-
import { SdkPreviewModeClient } from '@/components/preview/SdkPreviewModeClient'
|
|
132
|
-
|
|
133
|
-
const { Page, generateMetadata } = createCatchAllPage({
|
|
134
|
-
getClient: getRiverbankClient,
|
|
135
|
-
config,
|
|
136
|
-
blockOverrides,
|
|
137
|
-
beforeRender: createPreviewModeBeforeRender({
|
|
138
|
-
getClient: getRiverbankClient,
|
|
139
|
-
siteId: config.siteId,
|
|
140
|
-
PreviewModeClient: SdkPreviewModeClient,
|
|
141
|
-
}),
|
|
142
|
-
})
|
|
143
|
-
|
|
144
|
-
export default Page
|
|
145
|
-
export { generateMetadata }
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
## Custom Header/Footer Chrome
|
|
149
|
-
|
|
150
|
-
If your site replaces the SDK header or footer, pass that chrome into `PreviewLayoutProvider` only when there is an editable preview session. `RIVERBANK_PREVIEW_MODE=true` makes the route preview-capable, but `getPreviewSession()` tells you whether the current request actually has preview cookies. Regular visitors without preview cookies should keep the normal SDK `Layout`.
|
|
151
|
-
|
|
152
|
-
In `src/app/layout.tsx`:
|
|
153
|
-
|
|
154
|
-
```tsx
|
|
155
|
-
import type { ReactNode } from 'react'
|
|
156
|
-
|
|
157
|
-
import { Layout } from '@riverbankcms/sdk/rendering/server'
|
|
158
|
-
import { PreviewLayoutProvider } from '@riverbankcms/sdk/preview-next/client'
|
|
159
|
-
import { getPreviewSession } from '@riverbankcms/sdk/preview-next/session'
|
|
160
|
-
|
|
161
|
-
import { getRiverbankClient, getSiteId } from '@/lib/riverbank-client'
|
|
162
|
-
|
|
163
|
-
function SiteHeader() {
|
|
164
|
-
return <header>{/* your site header */}</header>
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
function SiteFooter() {
|
|
168
|
-
return <footer>{/* your site footer */}</footer>
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
export default async function RootLayout({ children }: { children: ReactNode }) {
|
|
172
|
-
const session = await getPreviewSession()
|
|
173
|
-
const hasEditablePreviewSession = Boolean(session?.canEdit && session?.token)
|
|
174
|
-
const headerNode = <SiteHeader />
|
|
175
|
-
const footerNode = <SiteFooter />
|
|
176
|
-
|
|
177
|
-
return (
|
|
178
|
-
<html lang="en">
|
|
179
|
-
<body>
|
|
180
|
-
{hasEditablePreviewSession ? (
|
|
181
|
-
<PreviewLayoutProvider headerNode={headerNode} footerNode={footerNode}>
|
|
182
|
-
{children}
|
|
183
|
-
</PreviewLayoutProvider>
|
|
184
|
-
) : (
|
|
185
|
-
<Layout
|
|
186
|
-
client={getRiverbankClient()}
|
|
187
|
-
siteId={getSiteId()}
|
|
188
|
-
header={() => headerNode}
|
|
189
|
-
footer={() => footerNode}
|
|
190
|
-
>
|
|
191
|
-
{children}
|
|
192
|
-
</Layout>
|
|
193
|
-
)}
|
|
194
|
-
</body>
|
|
195
|
-
</html>
|
|
196
|
-
)
|
|
197
|
-
}
|
|
198
|
-
```
|
|
199
|
-
|
|
200
|
-
If your custom chrome needs CMS navigation data, build the `headerNode` and `footerNode` from the same data used by your normal layout before branching. Calling `getPreviewSession()` in the root layout reads cookies, so the layout becomes dynamic.
|
|
201
|
-
|
|
202
|
-
## Import Preview CSS
|
|
203
|
-
|
|
204
|
-
For Tailwind sites, add this to `src/app/globals.css`:
|
|
205
|
-
|
|
206
|
-
```css
|
|
207
|
-
@import "tailwindcss";
|
|
208
|
-
@import "@riverbankcms/sdk/preview-next/tailwind-sources.css";
|
|
209
|
-
@import "@riverbankcms/sdk/preview-next/chrome.css";
|
|
210
|
-
```
|
|
211
|
-
|
|
212
|
-
For non-Tailwind sites, use the legacy single import:
|
|
213
|
-
|
|
214
|
-
```css
|
|
215
|
-
@import "@riverbankcms/sdk/preview-next/styles.css";
|
|
216
|
-
```
|
|
217
|
-
|
|
218
|
-
## Environment Variables
|
|
219
|
-
|
|
220
|
-
For Vercel preview or any external preview host:
|
|
221
|
-
|
|
222
|
-
```bash
|
|
223
|
-
RIVERBANK_PREVIEW_MODE=true
|
|
224
|
-
RIVERBANK_ENV=remote
|
|
225
|
-
RIVERBANK_REMOTE_SITE_ID=...
|
|
226
|
-
RIVERBANK_REMOTE_DASHBOARD_URL=https://...
|
|
227
|
-
RIVERBANK_REMOTE_PREVIEW_API_KEY=bld_preview_sk_...
|
|
228
|
-
```
|
|
229
|
-
|
|
230
|
-
Use a preview API key when `RIVERBANK_PREVIEW_MODE=true`; content/live keys cannot read draft content. Keep the management API key (`RIVERBANK_REMOTE_MGMT_API_KEY`) for CLI sync commands such as `push-config`, not for public rendering.
|
|
231
|
-
|
|
232
|
-
## Verification
|
|
233
|
-
|
|
234
|
-
1. Run `riverbankcms push-config --env=remote`.
|
|
235
|
-
2. Build the site with `RIVERBANK_PREVIEW_MODE=true`.
|
|
236
|
-
3. Open the dashboard preview button.
|
|
237
|
-
4. Confirm the URL starts at `previewUrl`.
|
|
238
|
-
5. Confirm the preview shell loads and editable content appears.
|
|
239
|
-
6. Confirm `/api/preview/keep-alive` returns without authentication errors during the session.
|