started adding a better collab demo

This commit is contained in:
Philipp Kühn
2019-02-05 02:20:49 +01:00
parent 9b0c35d34c
commit aba26c7e74
4 changed files with 184 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
import { Extension } from 'tiptap'
import { collab } from 'prosemirror-collab'
export default class CollabExtension extends Extension {
get name() {
return 'collab'
}
get defaultOptions() {
return {
version: 0,
clientID: Math.floor(Math.random() * 0xFFFFFFFF),
}
}
get plugins() {
return [
collab({
version: this.options.version,
clientID: this.options.clientID,
}),
]
}
}