Citation types

Look up the fields stored with a citation and returned in a citation snapshot.

FieldsType and meaning
id, sourceIdString IDs for the citation and its source.
kind'inline' | 'node'. How the citation attaches to the document.
text, confirmedTextCurrent and confirmed text.
confirmedReviewTextOptional string | null. Approved inline comparison text with hard breaks when it differs from confirmedText.
nodeAttributesOptional CitationNodeAttributes, a read-only snapshot of the cited node's current JSON attributes.
source, sourceRevisionCurrent SourceSnapshot and revision string. A missing source yields undefined and null, respectively.
confirmedSourceRevisionConfirmed revision string.
status, invalidReasons'valid' | 'invalid' and a read-only array of invalid reasons.
rangesRead-only CitationRange objects with numeric ProseMirror positions from and to. A node citation's range covers the whole node.
createdBy, updatedBy, lastApprovedByRead-only CitationUser objects. The last approver is null before explicit approval.
createdAt, updatedAt, lastApprovedAtUTC ISO timestamps. The last approval time is null before explicit approval.

CitationAttributes covers the IDs, confirmed text, optional confirmedReviewText, confirmed source revision, and attribution stored in the document. A snapshot groups all surviving ranges for the same ID. See the text review rule for the strings passed to the callback.

Inline citations require nonempty confirmed text. For a node such as an image, the confirmed text can be empty. When importing HTML, Smart Citations drops invalid citation marks and preserves their text.