SharedRichText, live
Three watershed documents share one
rich-text channel over the rich_text_kernel. It runs the
same single-op-in-flight client-transform protocol as the json_ot demo, but over quill-delta's algebra:
operations retain, insert, or delete spans of
text. Each op can carry an attribute patch (bold, color, …) or wrap an
embed (an image) instead of plain text. Positions are counted in UTF-16
code units (the units Quill and JavaScript strings index by), so nothing
converts at the editor boundary. Each editor keeps at most one op in flight;
anything typed while it's outstanding composes into a single buffered
op behind it. This is SharedRichText, watershed's OT-backed rich text. For
CRDT-backed plain text, SharedText indexes
graphemes by stable identity and converges by merge rather than by
transform.
Local edits apply the instant you type, Quill's own optimistic model, no different from typing into any editor. Race two clients at the same spot, format concurrently, or delete under someone else's formatting, then watch the op log and the canonical text below each editor converge. Peer cursors (dashed, colored) track where the other two are looking, transformed through every edit exactly like the local caret is.
Client B
syncedClient C
syncedConverged replicas identical · nothing pending
The scenario buttons submit through each editor's own Quill instance (the same path a browser keystroke takes), so you're watching the genuine client-transform protocol, not a scripted animation. Manual typing and toolbar formatting work in all three editors too; try editing one while a race is still in flight in another.
The live demo couldn’t start: it runs the production client runtime against
the in-memory sluice and a Quill editor as compiled
JavaScript, and this browser didn’t load it. The rest of the page works
fine without it.