API reference / Common / Engine types / TextMarkup
Type Alias: TextMarkup
type TextMarkup =
| {
contentControl: ContentControl;
}
| {
customXml: CustomXml;
}
| {
smartTag: SmartTag;
}
| {
revision: TextRevision;
}
| {
binding: TextBinding;
};One wrapper around text, whichever kind it is: a member of the markup family, a revision around runs, or a binding.
None of them brings characters of its own. The text CRDT carries each as its id in a mark over the units it wraps — markup:block on a block's terminating unit, markup:span on a character — and the mark key names the level and nothing else, so nothing in the character stream says whether an id is a control or a smart tag. The story's markup map, keyed by id, holds this value to say so. See Text Model.
The model tree never holds this: a node holds the concrete payload, and the node also says the level (TextControlBlock, TextSmartTagSpan, …). It is what text holds wherever the wrappers are a flat list instead — a unit and the wrappers it sits in, outermost first:
- the co-editing payload map, keyed by id;
- the edit intents that name a wrapper before any node exists to hold it (
WrapBlocks,WrapSpans) or restate one (ReplaceMarkup); - the operations a peer's change decodes to (
SetBlockMarkup,SetSpanMarkup,UpdateMarkup); - the story's flattening that applies them, then folds each list back into nodes.
Because one map is keyed by the raw id, ids are unique across the kinds — they are minted from the one session IdGenerator, so this costs nothing to hold.
A table holds none of its own: a wrapper around rows or cells is a node in the table's CRDT, and the node's kind says which payload it holds.