Hi Marijn,
We (Kevin from Y.js and Nick from BlockNote) are considering going back on our previous approach of suggested content as marks and are now reevaluating to represent suggestions as decorations.
The reason that we’ve gone back on this is that there can be cases where showing a deleted node can actually inject content into a node at a position which does not actually abide by the parent nodes content declaration. So, in such cases the prosemirror node cannot be created since it is not valid to the schema.
We’ve explored an alternative approach where we inject only “suggested” nodes which we’ve crafted to be valid in any position within the parent nodes content declaration. This did work in some capacity but would prove to be difficult to implement in an editor, since it breaks several assumptions about the schema of a document (e.g. injecting nodes into a table will break a lot of the assumptions that prosemirror-tables makes about its structure).
So, I’m now advocating for what you had originally suggested, to use decorations to insert the deleted content (which may be invalid to the schema, but since it is in a decoration it does not count as part of the document). The question that we are running into though, is how to be able to edit this content. I know that you have a demo for footnotes that embeds an editor view just for the footnotes content, would you suggest a similar approach for this? I guess that we are essentially trying to make a decoration act as an editor and will run into some issues with that, keyboard shortcuts, copy/paste etc. Do you have any other directions that we could look into?
