r/javascript • u/scrollin_thru • 17d ago
Announcing Pitter Patter! (a new collaborative rich text editing framework)
https://handlewithcare.dev/blog/pitter_patter_launch_announcement/Pitter Patter is an open source toolkit of feature-complete building blocks for collaborative rich text editors, made with ProseMirror. Each piece is useful on its own, and you can use what you need, when you need it. And every library is built directly on ProseMirror’s APIs, not on top of an abstraction layer, so you always have full access to the thing underneath.
So far, we have three packages: shuffle (grid-based drag-and-drop), collab, and presence.
Check out our demo to see the collab and shuffle features in action. In the demo, you can drag and drop nodes, resize content, watch how remote edits come in to an editor and even demo offline reconciliation!
1
u/akrause_9521 1d ago
If two collaborators move the same block while one is offline, how does reconciliation resolve it? That's a useful edge case for shuffle.
1
u/scrollin_thru 1d ago
You can test out edge cases like this in the demo! ProseMirror doesn't have a move operation, so each drag is treated like a cut-and-paste. So in the scenario you described, the block gets duplicated:
User A cuts from position 1
User A pastes to position 2
User B (offline, does not yet see user A's changes) cuts from position 1
User B pastes to position 3
User B comes online, tries to write steps, is told to rebase
Step 3 gets dropped (cutting an already-deleted position)
Step 4 gets reapplied
So you end up with the block duplicated at both positions.
1
u/Discordbothost 16d ago
does Shuffle expose move/resize commands that a keyboard UI can call? the docs demo focuses on dragging. being able to move a block and keep the editor selection on it would matter a lot for keyboard-only use.