From 1a2647a7b80f3730bee1ed4ea5dbd86d27496952 Mon Sep 17 00:00:00 2001 From: Julian Krauser Date: Fri, 28 Feb 2025 16:46:15 +0100 Subject: [PATCH] Quill Editor Sync --- package-lock.json | 132 ++++++------------ package.json | 2 +- src/helpers/quillConfig.ts | 4 +- src/stores/admin/operation/connection.ts | 1 - .../admin/operation/mission/MissionDetail.vue | 7 + 5 files changed, 49 insertions(+), 97 deletions(-) diff --git a/package-lock.json b/package-lock.json index 591cff1..110cc61 100644 --- a/package-lock.json +++ b/package-lock.json @@ -29,7 +29,7 @@ "vue": "^3.4.29", "vue-router": "^4.3.3", "y-protocols": "^1.0.6", - "y-quill": "^1.0.0", + "y-quill": "0.1.3", "yjs": "^13.6.23" }, "devDependencies": { @@ -3711,52 +3711,6 @@ "vue": "^3.2.41" } }, - "node_modules/@vueup/vue-quill/node_modules/eventemitter3": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-2.0.3.tgz", - "integrity": "sha512-jLN68Dx5kyFHaePoXWPsCGW5qdyZQtLYHkxkg02/Mz6g0kYpDx4FyP6XfArhQdlOC4b8Mv+EMxPo/8La7Tzghg==", - "license": "MIT" - }, - "node_modules/@vueup/vue-quill/node_modules/fast-diff": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.1.2.tgz", - "integrity": "sha512-KaJUt+M9t1qaIteSvjc6P3RbMdXsNhK61GRftR6SNxqmhthcd9MGIi4T+o0jD8LUSpSnSKXE20nLtJ3fOHxQig==", - "license": "Apache-2.0" - }, - "node_modules/@vueup/vue-quill/node_modules/parchment": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/parchment/-/parchment-1.1.4.tgz", - "integrity": "sha512-J5FBQt/pM2inLzg4hEWmzQx/8h8D0CiDxaG3vyp9rKrQRSDgBlhjdP5jQGgosEajXPSQouXGHOmVdgo7QmJuOg==", - "license": "BSD-3-Clause" - }, - "node_modules/@vueup/vue-quill/node_modules/quill": { - "version": "1.3.7", - "resolved": "https://registry.npmjs.org/quill/-/quill-1.3.7.tgz", - "integrity": "sha512-hG/DVzh/TiknWtE6QmWAF/pxoZKYxfe3J/d/+ShUWkDvvkZQVTPeVmUJVu1uE6DDooC4fWTiCLh84ul89oNz5g==", - "license": "BSD-3-Clause", - "dependencies": { - "clone": "^2.1.1", - "deep-equal": "^1.0.1", - "eventemitter3": "^2.0.3", - "extend": "^3.0.2", - "parchment": "^1.1.4", - "quill-delta": "^3.6.2" - } - }, - "node_modules/@vueup/vue-quill/node_modules/quill/node_modules/quill-delta": { - "version": "3.6.3", - "resolved": "https://registry.npmjs.org/quill-delta/-/quill-delta-3.6.3.tgz", - "integrity": "sha512-wdIGBlcX13tCHOXGMVnnTVFtGRLoP0imqxM696fIPwIf5ODIYUHIvHbZcyvGlZFiFhK5XzDC2lpjbxRhnM05Tg==", - "license": "MIT", - "dependencies": { - "deep-equal": "^1.0.1", - "extend": "^3.0.2", - "fast-diff": "1.1.2" - }, - "engines": { - "node": ">=0.10" - } - }, "node_modules/acorn": { "version": "8.14.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", @@ -5414,11 +5368,10 @@ } }, "node_modules/eventemitter3": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", - "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==", - "license": "MIT", - "peer": true + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-2.0.3.tgz", + "integrity": "sha512-jLN68Dx5kyFHaePoXWPsCGW5qdyZQtLYHkxkg02/Mz6g0kYpDx4FyP6XfArhQdlOC4b8Mv+EMxPo/8La7Tzghg==", + "license": "MIT" }, "node_modules/execa": { "version": "9.5.2", @@ -5471,7 +5424,8 @@ "node_modules/fast-diff": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.3.0.tgz", - "integrity": "sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==" + "integrity": "sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==", + "dev": true }, "node_modules/fast-fifo": { "version": "1.3.2", @@ -6952,13 +6906,6 @@ "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", "dev": true }, - "node_modules/lodash-es": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.21.tgz", - "integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==", - "license": "MIT", - "peer": true - }, "node_modules/lodash.clonedeep": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", @@ -7494,11 +7441,10 @@ "dev": true }, "node_modules/parchment": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/parchment/-/parchment-3.0.0.tgz", - "integrity": "sha512-HUrJFQ/StvgmXRcQ1ftY6VEZUq3jA2t9ncFN4F84J/vN0/FPpQF+8FKXb3l6fLces6q0uOHj6NJn+2xvZnxO6A==", - "license": "BSD-3-Clause", - "peer": true + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/parchment/-/parchment-1.1.4.tgz", + "integrity": "sha512-J5FBQt/pM2inLzg4hEWmzQx/8h8D0CiDxaG3vyp9rKrQRSDgBlhjdP5jQGgosEajXPSQouXGHOmVdgo7QmJuOg==", + "license": "BSD-3-Clause" }, "node_modules/parent-module": { "version": "1.0.1", @@ -8075,19 +8021,17 @@ "dev": true }, "node_modules/quill": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/quill/-/quill-2.0.3.tgz", - "integrity": "sha512-xEYQBqfYx/sfb33VJiKnSJp8ehloavImQ2A6564GAbqG55PGw1dAWUn1MUbQB62t0azawUS2CZZhWCjO8gRvTw==", + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/quill/-/quill-1.3.7.tgz", + "integrity": "sha512-hG/DVzh/TiknWtE6QmWAF/pxoZKYxfe3J/d/+ShUWkDvvkZQVTPeVmUJVu1uE6DDooC4fWTiCLh84ul89oNz5g==", "license": "BSD-3-Clause", - "peer": true, "dependencies": { - "eventemitter3": "^5.0.1", - "lodash-es": "^4.17.21", - "parchment": "^3.0.0", - "quill-delta": "^5.1.0" - }, - "engines": { - "npm": ">=8.2.3" + "clone": "^2.1.1", + "deep-equal": "^1.0.1", + "eventemitter3": "^2.0.3", + "extend": "^3.0.2", + "parchment": "^1.1.4", + "quill-delta": "^3.6.2" } }, "node_modules/quill-cursors": { @@ -8113,19 +8057,24 @@ "integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==", "license": "Apache-2.0" }, + "node_modules/quill/node_modules/fast-diff": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.1.2.tgz", + "integrity": "sha512-KaJUt+M9t1qaIteSvjc6P3RbMdXsNhK61GRftR6SNxqmhthcd9MGIi4T+o0jD8LUSpSnSKXE20nLtJ3fOHxQig==", + "license": "Apache-2.0" + }, "node_modules/quill/node_modules/quill-delta": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/quill-delta/-/quill-delta-5.1.0.tgz", - "integrity": "sha512-X74oCeRI4/p0ucjb5Ma8adTXd9Scumz367kkMK5V/IatcX6A0vlgLgKbzXWy5nZmCGeNJm2oQX0d2Eqj+ZIlCA==", + "version": "3.6.3", + "resolved": "https://registry.npmjs.org/quill-delta/-/quill-delta-3.6.3.tgz", + "integrity": "sha512-wdIGBlcX13tCHOXGMVnnTVFtGRLoP0imqxM696fIPwIf5ODIYUHIvHbZcyvGlZFiFhK5XzDC2lpjbxRhnM05Tg==", "license": "MIT", - "peer": true, "dependencies": { - "fast-diff": "^1.3.0", - "lodash.clonedeep": "^4.5.0", - "lodash.isequal": "^4.5.0" + "deep-equal": "^1.0.1", + "extend": "^3.0.2", + "fast-diff": "1.1.2" }, "engines": { - "node": ">= 12.0.0" + "node": ">=0.10" } }, "node_modules/randombytes": { @@ -10462,22 +10411,21 @@ } }, "node_modules/y-quill": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/y-quill/-/y-quill-1.0.0.tgz", - "integrity": "sha512-WpYBXsFXdofGuaAVyvKpZ3rg+TklWtKtpemUziY044NLhnwud0D+QTX2mdGKMrLON+BshKQeT77FbXa68ZJbcA==", + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/y-quill/-/y-quill-0.1.3.tgz", + "integrity": "sha512-A+pR77mffjqJBhxB/zZIguuUJrIYlWDaZEeHWyXhiYBp11HS14gM4fts5Ag7ztxyOflYjp4xicC1ZW4aHAUtJQ==", "license": "MIT", "dependencies": { - "lib0": "^0.2.93", - "y-protocols": "^1.0.6" + "lib0": "^0.2.31", + "y-protocols": "^1.0.0" }, "funding": { "type": "GitHub Sponsors ❤", "url": "https://github.com/sponsors/dmonad" }, "peerDependencies": { - "quill": "^2.0.0", - "quill-cursors": "^4.0.2", - "yjs": "^13.6.14" + "quill": "^1.3.7", + "yjs": "^13.0.0" } }, "node_modules/y18n": { diff --git a/package.json b/package.json index 2b855a3..43713c9 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ "vue": "^3.4.29", "vue-router": "^4.3.3", "y-protocols": "^1.0.6", - "y-quill": "^1.0.0", + "y-quill": "0.1.3", "yjs": "^13.6.23" }, "devDependencies": { diff --git a/src/helpers/quillConfig.ts b/src/helpers/quillConfig.ts index 2f8ac48..a1beeac 100644 --- a/src/helpers/quillConfig.ts +++ b/src/helpers/quillConfig.ts @@ -9,9 +9,7 @@ export const toolbarOptions = [ export const moduleOptions = { toolbar: toolbarOptions, - cursors: { - transformOnTextChange: true, - }, + cursors: true, history: { userOnly: true, }, diff --git a/src/stores/admin/operation/connection.ts b/src/stores/admin/operation/connection.ts index ab38096..6707b31 100644 --- a/src/stores/admin/operation/connection.ts +++ b/src/stores/admin/operation/connection.ts @@ -64,7 +64,6 @@ export const useConnectionStore = defineStore("connection", { notificationStore.push("Socket-Netzwerk-Fehler", "Reconnect Versuch in 10s", "error"); this.disconnectClient(); setTimeout(() => { - console.log("hi"); this.connectClient(); }, 10000); } else if (err.message == "Token expired") { diff --git a/src/views/admin/operation/mission/MissionDetail.vue b/src/views/admin/operation/mission/MissionDetail.vue index 15eb959..1c52624 100644 --- a/src/views/admin/operation/mission/MissionDetail.vue +++ b/src/views/admin/operation/mission/MissionDetail.vue @@ -117,8 +117,15 @@ export default defineComponent({ return this.document.getText("editor"); }, }, + beforeUnmount() { + if (this.binding) { + this.binding.destroy(); + this.binding = undefined; + } + }, methods: { initEditor(quill: Quill) { + quill.history.clear(); this.binding = new QuillBinding(this.editor, quill); this.cursors = quill.getModule("cursors") as QuillCursors; },