According to the documentation, whenever content is edited, old.map(tr.mapping, tr.doc);
preserves decorations for existing content and it does.
In my case, I’m trying to both preserve existing decorations and as well as add decorations for newly created content and add it to my old decorations and return its mapping as below
In my plugin, inside apply method
old = old.add(tr.doc, newDecos)
return old.map(tr.mapping, tr.doc);
Issue with this is newly created decos dont have ‘proseMirror-widget’ class applied and thus dont render in the editor. This class is only applied to decoration widgets when I return as such return DecorationSet.create(tr.doc, newDecos)
Do we not have an option to both preserve and apply new decorations?