Converts a Yjs text delta into edits addressed against the pre-edit document.
A Yjs delta walks two cursors at once: retain advances in both the old and the new
document, insert advances only in the new one, and delete advances only in the old
one. The edits produced here are collected and applied together against the pre-edit
model, so every offset must address that same, unchanged document. The cursor therefore
advances on retain and delete and stands still on insert.
Non-string inserts (embeds) carry no text for a plain text model and are skipped.
Converts a Yjs text delta into edits addressed against the pre-edit document.
A Yjs delta walks two cursors at once:
retainadvances in both the old and the new document,insertadvances only in the new one, anddeleteadvances only in the old one. The edits produced here are collected and applied together against the pre-edit model, so every offset must address that same, unchanged document. The cursor therefore advances onretainanddeleteand stands still oninsert.Non-string inserts (embeds) carry no text for a plain text model and are skipped.