r/javascript • • 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!

4 Upvotes

6 comments sorted by

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.

1

u/scrollin_thru 16d ago

Yes and no. Resize and z-index commands do exist and you can hook them up to keyboard events, but we haven't yet implemented full keyboard functionality. We do have a plan for making shuffle keyboard accessible though, which we'll have before we release v1!

1

u/ma-i_274 1d ago

Will the planned keyboard flow also keep the editor selection on the moved block?

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:

  1. User A cuts from position 1

  2. User A pastes to position 2

  3. User B (offline, does not yet see user A's changes) cuts from position 1

  4. User B pastes to position 3

  5. User B comes online, tries to write steps, is told to rebase

  6. Step 3 gets dropped (cutting an already-deleted position)

  7. Step 4 gets reapplied

So you end up with the block duplicated at both positions.