refactor the collaboration extensions

This commit is contained in:
Hans Pagel
2020-11-30 13:35:49 +01:00
parent 18959051b4
commit e2c5720a0d
3 changed files with 43 additions and 42 deletions

View File

@@ -7,17 +7,19 @@ import {
} from 'y-prosemirror'
export interface CollaborationOptions {
type: any,
provider: any,
}
const Collaboration = Extension.create({
defaultOptions: <CollaborationOptions>{
type: null,
provider: null,
},
addProseMirrorPlugins() {
return [
ySyncPlugin(this.options.type),
ySyncPlugin(
this.options.provider.doc.getXmlFragment('prosemirror'),
),
yUndoPlugin(),
]
},