Skip to content

resolveLivePreviewSettings

resolveLivePreviewSettings(props): ResolvedLivePreviewSettings<Partial<VexDocument>> | undefined

Defined in: packages/core/src/livePreview/resolveSettings.ts:35

Resolves one collection or global’s live-preview settings from every layer that may declare them.

The single place this precedence is written. Four call sites need a document’s preview settings — CollectionEditView, GlobalEditView, NextAdminPage, and the server-side URL endpoint — and they must not disagree about where a document previews or how fast it syncs.

Order per field, highest first:

  1. the collection/global’s own admin.livePreview.<field>
  2. config.livePreview.collections[slug].<field> / .globals[slug].<field>
  3. config.livePreview.<field> (root breakpoints only)
  4. the field’s built-in default

Merged field by field, not whole-object: a collection that sets only defaultOpen still inherits the root entry’s url. Whole-object replacement would make the root block useless as soon as one setting was overridden.

AdminLivePreviewConfigInput<Partial<VexDocument>>

The collection/global’s own admin.livePreview, if any.

LivePreviewConfig

Resolved root livePreview config.

"collection" | "global"

Which map to read the root entry from.

string

The collection or global slug.

ResolvedLivePreviewSettings<Partial<VexDocument>> | undefined

Fully resolved settings, or undefined when no layer supplied a url — i.e. live preview is not configured for this slug.