Export `ySyncAnnotation`
Export the ySyncAnnotation CodeMirror annotation type. This allows others to check if a transaction is a remote transaction using code like this:
import { ySyncAnnotation } from "y-codemirror.next";
function isRemote(tr: Transaction): boolean {
return !!tr.annotation(ySyncAnnotation);
}
Currently this is not possible as the annotation isn't exported by the package index.js
Alternatively this could be accomplished by tagging YJS CodeMirror transactions with Transaction.remote inside y-sync.js:
- view.dispatch({ changes, annotations: [ySyncAnnotation.of(this.conf)] })
+ view.dispatch({ changes, annotations: [ySyncAnnotation.of(this.conf), cmState.Transaction.remote] })
to be more true to CodeMirror's existing interface.
@dmonad Are you planning to merge this pull request? I also find the changes in this PR very useful.
Sure, I'll add it to the next release
Thank you very much.