InsertContentAtCursorOptionsNEW
InsertContentAtCursorOptions:
type InsertContentAtCursorOptions =Options for DocAuthEditor.insertContentAtCursor, a discriminated
union keyed by format. When format is omitted, defaults to 'text'.
Type Declaration
Section titled “Type Declaration”{ format?: "text"; content: string; }
format?
Section titled “format?”
optionalformat:"text"
Inserts the given string at the cursor. Default when format is omitted.
content
Section titled “content”content:
string
{ format: "fragment"; content: object; inlineFormatting?: boolean; }
format
Section titled “format”format:
"fragment"
Inserts a structured fragment at the cursor. Use a value obtained from
DocAuthEditor.getSelectionContent with format: 'fragment',
or one round-tripped through JSON.
content
Section titled “content”content:
object
The fragment object to insert. Opaque JSON-serializable data; don’t depend on its internal shape.
inlineFormatting?
Section titled “inlineFormatting?”
optionalinlineFormatting:boolean
Controls whether inserted content keeps its source formatting or takes the
destination’s. Defaults to true.
It affects two things: the character formatting that inserted text got from its source paragraph or paragraph style (bold, italic, font, size, colour), and the padding, shading and borders of inserted table cells when a range of cells is inserted over another range. Formatting set directly on the text itself is always kept, whichever value you pass.
trueinlines the source formatting: the character formatting the text inherited from its paragraph or style is written directly onto the inserted text, and each inserted cell takes the source cell’s padding, shading and borders. The destination paragraph still keeps its own alignment, indent, style and list, and the destination table keeps its row and column spans.falsetakes the destination’s formatting. Inserted text falls back to the destination paragraph’s formatting, and inserted cells keep the destination cells’ padding, shading and borders.
For text, this only applies when inserting into the middle of a paragraph; inserting whole paragraphs always keeps the source paragraph’s formatting.