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:
- the collection/global’s own
admin.livePreview.<field> config.livePreview.collections[slug].<field>/.globals[slug].<field>config.livePreview.<field>(rootbreakpointsonly)- 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.
Parameters
Section titled “Parameters”admin?
Section titled “admin?”AdminLivePreviewConfigInput<Partial<VexDocument>>
The collection/global’s own admin.livePreview, if any.
config
Section titled “config”Resolved root livePreview config.
"collection" | "global"
Which map to read the root entry from.
string
The collection or global slug.
Returns
Section titled “Returns”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.