In general, you could break dependencies from the command on the editor
module by injection or with cheap interfaces. So, command-table
has two dependencies on editor
: It uses Selection.findFrom
, and it takes arguments of type ProseMirror
. The former dependency can be turned into one similar to the latter by passing Selection.findFrom
as first argument into moveCell
. That way, you conceptionally use types from from editor
, but have no dependencies on the JS code level.
To get rid of these logical dependencies, you could introduce a (smaller) interface wrapping the editor that schema, command and editor can depend on.
These are just some theoretical considerations, I’m not arguing that we should do this.