remove logging in prosemirror binding

This commit is contained in:
Kevin Jahns 2018-11-09 01:23:16 +01:00
parent aafe15757f
commit 28fb7b6e9c
3 changed files with 7 additions and 9 deletions

View File

@ -80,7 +80,6 @@ export const cursorPlugin = new Plugin({
view: view => {
const y = prosemirrorPluginKey.getState(view.state).y
const awarenessListener = () => {
console.log(y.getAwarenessInfo())
view.updateState(view.state)
}
y.on('awareness', awarenessListener)
@ -267,5 +266,4 @@ const updateYFragment = (yDomFragment, state, mapping) => {
yDomFragment.delete(left, yChildCnt - left - right)
yDomFragment.insert(left, state.doc.content.content.slice(left, pChildCnt - right).map(node => createTypeFromNode(node, mapping)))
})
console.log(yDomFragment.toDomString())
}

12
package-lock.json generated
View File

@ -4088,7 +4088,7 @@
},
"http-errors": {
"version": "1.6.3",
"resolved": "http://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz",
"resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz",
"integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=",
"dev": true,
"requires": {
@ -5046,7 +5046,7 @@
},
"magic-string": {
"version": "0.22.5",
"resolved": "http://registry.npmjs.org/magic-string/-/magic-string-0.22.5.tgz",
"resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.22.5.tgz",
"integrity": "sha512-oreip9rJZkzvA8Qzk9HFs8fZGF/u7H/gtrE8EN6RjKJ9kh2HlC+yQ2QezifqTZfGyiuAV0dRv5a+y/8gBb1m9w==",
"dev": true,
"requires": {
@ -5067,7 +5067,7 @@
},
"marked": {
"version": "0.3.19",
"resolved": "http://registry.npmjs.org/marked/-/marked-0.3.19.tgz",
"resolved": "https://registry.npmjs.org/marked/-/marked-0.3.19.tgz",
"integrity": "sha512-ea2eGWOqNxPcXv8dyERdSr/6FmzvWwzjMxpfGB/sbMccXoct+xY+YukPD+QTUZwyvK7BZwcr4m21WBOW41pAkg==",
"dev": true
},
@ -5424,7 +5424,7 @@
},
"parchment": {
"version": "1.1.4",
"resolved": "http://registry.npmjs.org/parchment/-/parchment-1.1.4.tgz",
"resolved": "https://registry.npmjs.org/parchment/-/parchment-1.1.4.tgz",
"integrity": "sha512-J5FBQt/pM2inLzg4hEWmzQx/8h8D0CiDxaG3vyp9rKrQRSDgBlhjdP5jQGgosEajXPSQouXGHOmVdgo7QmJuOg==",
"dev": true
},
@ -5848,7 +5848,7 @@
},
"quill": {
"version": "1.3.6",
"resolved": "http://registry.npmjs.org/quill/-/quill-1.3.6.tgz",
"resolved": "https://registry.npmjs.org/quill/-/quill-1.3.6.tgz",
"integrity": "sha512-K0mvhimWZN6s+9OQ249CH2IEPZ9JmkFuCQeHAOQax3EZ2nDJ3wfGh59mnlQaZV2i7u8eFarx6wAtvQKgShojug==",
"dev": true,
"requires": {
@ -6275,7 +6275,7 @@
},
"rollup-plugin-commonjs": {
"version": "8.4.1",
"resolved": "http://registry.npmjs.org/rollup-plugin-commonjs/-/rollup-plugin-commonjs-8.4.1.tgz",
"resolved": "https://registry.npmjs.org/rollup-plugin-commonjs/-/rollup-plugin-commonjs-8.4.1.tgz",
"integrity": "sha512-mg+WuD+jlwoo8bJtW3Mvx7Tz6TsIdMsdhuvCnDMoyjh0oxsVgsjB/N0X984RJCWwc5IIiqNVJhXeeITcc73++A==",
"dev": true,
"requires": {

View File

@ -86,7 +86,7 @@ class WebsocketsSharedDocument extends Y.Y {
if (field !== null) {
this._localAwarenessState[field] = value
}
if (this.ws !== null) {
if (this.wsconnected) {
const encoder = Y.createEncoder()
Y.writeVarUint(encoder, messageAwareness)
Y.writeUsersStateChange(encoder, [{ userID: this.userID, state: this._localAwarenessState }])