undo_redo/document_delta library

Classes

CursorSnapshot
Cursor / selection state captured at the time of the delta.
DocumentDelta
Represents a change to the document at the node level. Deltas are much smaller than full document snapshots because they store only the affected nodes, not the entire tree.
NodeChange
A single changed node: old JSON → new JSON at a specific index.
NodeDeleteDelta
Deletes a top-level node at a given index.
NodeInsertDelta
Inserts a new top-level node at a given index.
NodeReplaceDelta
Replaces one or more top-level nodes. This covers 95% of editor operations (typing, formatting, delete, enter, etc.).