DocumentEditRuntimeState
Defined in: packages/react/src/documents/DocumentEditRuntimeContext.tsx:13
View-local UI state useVexDocument deliberately excludes (S5, decision 18): which history
version is being previewed, how to re-point the view at a new row id after a mutation returns
one, how to settle the form once a save round-trips, and the live-preview panel’s open state.
One instance per mounted edit view — CollectionEditForm/GlobalEditView own the real state
and pass it down as value; built-ins only ever read it.
Properties
Section titled “Properties”livePreview?
Section titled “livePreview?”
optionallivePreview?:object
Defined in: packages/react/src/documents/DocumentEditRuntimeContext.tsx:27
Live-preview panel state for this resource, or undefined when no livePreview config resolves.
isOpen
Section titled “isOpen”isOpen:
boolean
isSplit
Section titled “isSplit”isSplit:
boolean
toggle
Section titled “toggle”toggle: () =>
void
Returns
Section titled “Returns”void
onDocumentIdChange?
Section titled “onDocumentIdChange?”
optionalonDocumentIdChange?: (id) =>void
Defined in: packages/react/src/documents/DocumentEditRuntimeContext.tsx:23
Re-points the view at a different row id — called after saveDraft/publish returns one
(the first draft save on a published document bootstraps a new row). Omitted for a global,
which has no separate row id to re-point.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”void
onSaved
Section titled “onSaved”onSaved: (
changes) =>void
Defined in: packages/react/src/documents/DocumentEditRuntimeContext.tsx:25
Defers the form’s post-save reset until the live row reflects the write — see useResetWhenSaved.
Parameters
Section titled “Parameters”changes
Section titled “changes”Record<string, unknown>
Returns
Section titled “Returns”void
onViewVersion
Section titled “onViewVersion”onViewVersion: (
view) =>void
Defined in: packages/react/src/documents/DocumentEditRuntimeContext.tsx:17
Shows a version’s snapshot in the form, or null to return to the live document. Never saves.
Parameters
Section titled “Parameters”ViewedVersion | null
Returns
Section titled “Returns”void
viewedVersion
Section titled “viewedVersion”viewedVersion:
ViewedVersion|null
Defined in: packages/react/src/documents/DocumentEditRuntimeContext.tsx:15
The history version currently shown in the form, or null for the live document.