diff --git a/babel.config.js b/babel.config.js index ebc1a2539..9f8a0a192 100644 --- a/babel.config.js +++ b/babel.config.js @@ -4,6 +4,5 @@ module.exports = { ], plugins: [ '@babel/plugin-syntax-dynamic-import', - '@babel/plugin-proposal-class-properties', ], } diff --git a/package.json b/package.json index f9b2d6490..193b2aad3 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,6 @@ "devDependencies": { "@babel/core": "^7.4.4", "@babel/node": "^7.2.2", - "@babel/plugin-proposal-class-properties": "^7.4.4", "@babel/plugin-syntax-dynamic-import": "^7.2.0", "@babel/plugin-transform-runtime": "^7.4.4", "@babel/polyfill": "^7.4.4", diff --git a/packages/tiptap-extensions/src/extensions/Collaboration.js b/packages/tiptap-extensions/src/extensions/Collaboration.js index 3b4a122c1..ab1052094 100644 --- a/packages/tiptap-extensions/src/extensions/Collaboration.js +++ b/packages/tiptap-extensions/src/extensions/Collaboration.js @@ -14,6 +14,18 @@ export default class Collaboration extends Extension { } init() { + this.getSendableSteps = this.debounce(state => { + const sendable = sendableSteps(state) + + if (sendable) { + this.options.onSendable({ + version: sendable.version, + steps: sendable.steps.map(step => step.toJSON()), + clientID: sendable.clientID, + }) + } + }, this.options.debounce) + this.editor.on('update', ({ state }) => { this.getSendableSteps(state) }) @@ -50,18 +62,6 @@ export default class Collaboration extends Extension { ] } - getSendableSteps = this.debounce(state => { - const sendable = sendableSteps(state) - - if (sendable) { - this.options.onSendable({ - version: sendable.version, - steps: sendable.steps.map(step => step.toJSON()), - clientID: sendable.clientID, - }) - } - }, this.options.debounce) - debounce(fn, delay) { let timeout return function (...args) { diff --git a/yarn.lock b/yarn.lock index 9ade5f77b..c69a9341d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -64,18 +64,6 @@ "@babel/traverse" "^7.4.4" "@babel/types" "^7.4.4" -"@babel/helper-create-class-features-plugin@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.4.4.tgz#fc3d690af6554cc9efc607364a82d48f58736dba" - integrity sha512-UbBHIa2qeAGgyiNR9RszVF7bUHEdgS4JAUNT8SiqrAN6YJVxlOxeLr5pBzb5kan302dejJ9nla4RyKcR1XT6XA== - dependencies: - "@babel/helper-function-name" "^7.1.0" - "@babel/helper-member-expression-to-functions" "^7.0.0" - "@babel/helper-optimise-call-expression" "^7.0.0" - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/helper-replace-supers" "^7.4.4" - "@babel/helper-split-export-declaration" "^7.4.4" - "@babel/helper-define-map@^7.4.4": version "7.4.4" resolved "https://registry.yarnpkg.com/@babel/helper-define-map/-/helper-define-map-7.4.4.tgz#6969d1f570b46bdc900d1eba8e5d59c48ba2c12a" @@ -250,14 +238,6 @@ "@babel/helper-remap-async-to-generator" "^7.1.0" "@babel/plugin-syntax-async-generators" "^7.2.0" -"@babel/plugin-proposal-class-properties@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.4.4.tgz#93a6486eed86d53452ab9bab35e368e9461198ce" - integrity sha512-WjKTI8g8d5w1Bc9zgwSz2nfrsNQsXcCf9J9cdCvrJV6RF56yztwm4TmJC0MgJ9tvwO9gUA/mcYe89bLdGfiXFg== - dependencies: - "@babel/helper-create-class-features-plugin" "^7.4.4" - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-proposal-json-strings@^7.2.0": version "7.2.0" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.2.0.tgz#568ecc446c6148ae6b267f02551130891e29f317"