Hey, I am exploring the idea of separating out data model (EditorState) from how its being rendered (view), specifically we want to be able to sort/filter table rows without changing the content of the table in the document, so that filter/sort state would be controlled only by an attribute (e.g. attrs: {sort: āa-zā}).
Since each node only knows how to render itself (and specify the content āholeā), it seems like thereās no way to influence child nodes from the parent node (e.g. filter out/sort rows from table node), or at least I couldnāt figure out one
Would it make sense to extend the NodeView API to possibly provide a function that would operate on children, something like:
preRender: (indexes: number[]) => number[]
, where indexes
would be an array of indexes of child nodes, so that we could return what child nodes need to be rendered and in what order. ProseMirror document stays the same, positions of nodes would be the same, the only difference would be in how a nodeās content is rendered.
What would be the implications of such approach? I am happy to go with whatever is best for the community and Iām open to considering alternative approaches. Cheers.