Bind multiple Yjs docs to same editor

Hello everyone!

I’m trying to build an app with the following constraints

  • there are multiple pages
  • each page has multiple sections
  • one section can appear in multiple pages

Considering these, my main data object will be the section, not the page. However, I want the user to edit the sections in a seamless experience, just like editing a single page.

For this reason, I think the solution is to persist each section in a separate Yjs doc and bind multiple docs/subdocs to the same Prosemirror instance.

Any idea if that is possible? Any hints on how to approach the implementation?