TiptapCollab

This commit is contained in:
Jan Thurau 2023-03-28 10:39:21 +02:00
parent 3a9b775bda
commit ad9a50239a
No known key found for this signature in database
GPG Key ID: 60B3EB3A1C49AC04
4 changed files with 27 additions and 27 deletions

View File

@ -9,7 +9,7 @@
"ts": "tsc --project tsconfig.base.json --noEmit && tsc --project tsconfig.react.json --noEmit && tsc --project tsconfig.vue-2.json --noEmit && tsc --project tsconfig.vue-3.json --noEmit"
},
"dependencies": {
"@hocuspocus/provider": "^1.0.0-alpha.29",
"@hocuspocus/provider": "^1.1.3",
"d3": "^7.3.0",
"fast-glob": "^3.2.11",
"highlight.js": "^11.6.0",

View File

@ -1,6 +1,6 @@
import './styles.scss'
import { HocuspocusProvider } from '@hocuspocus/provider'
import { TiptapCollabProvider } from '@hocuspocus/provider'
import CharacterCount from '@tiptap/extension-character-count'
import Collaboration from '@tiptap/extension-collaboration'
import CollaborationCursor from '@tiptap/extension-collaboration-cursor'
@ -60,11 +60,8 @@ const getRandomName = () => getRandomElement(names)
const room = getRandomRoom()
const ydoc = new Y.Doc()
const websocketProvider = new HocuspocusProvider({
url: 'wss://connect.hocuspocus.cloud',
parameters: {
key: 'write_bqgvQ3Zwl34V4Nxt43zR',
},
const websocketProvider = new TiptapCollabProvider({
appId: '7j9y6m10',
name: room,
document: ydoc,
})

View File

@ -21,7 +21,7 @@
</template>
<script>
import { HocuspocusProvider } from '@hocuspocus/provider'
import { TiptapCollabProvider } from '@hocuspocus/provider'
import CharacterCount from '@tiptap/extension-character-count'
import Collaboration from '@tiptap/extension-collaboration'
import CollaborationCursor from '@tiptap/extension-collaboration-cursor'
@ -67,11 +67,8 @@ export default {
mounted() {
const ydoc = new Y.Doc()
this.provider = new HocuspocusProvider({
url: 'wss://connect.hocuspocus.cloud',
parameters: {
key: 'write_bqgvQ3Zwl34V4Nxt43zR',
},
this.provider = new TiptapCollabProvider({
appId: '7j9y6m10',
name: this.room,
document: ydoc,
})

34
package-lock.json generated
View File

@ -52,7 +52,7 @@
"name": "tiptap-demos",
"version": "2.0.0-beta.220",
"dependencies": {
"@hocuspocus/provider": "^1.0.0-alpha.29",
"@hocuspocus/provider": "^1.1.3",
"d3": "^7.3.0",
"fast-glob": "^3.2.11",
"highlight.js": "^11.6.0",
@ -1836,19 +1836,23 @@
"license": "MIT"
},
"node_modules/@hocuspocus/common": {
"version": "1.0.0-alpha.11",
"license": "MIT",
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/@hocuspocus/common/-/common-1.1.3.tgz",
"integrity": "sha512-U5wQcMsVTooUKSqAq8m2bmMPWaVp78oTl1YFcJ2v3Dq0Wt1MBik3AohcnuUZ2JcP1fblf8lZVugCs9qg9mbu6g==",
"dependencies": {
"lib0": "^0.2.47"
}
},
"node_modules/@hocuspocus/provider": {
"version": "1.0.0-alpha.38",
"license": "MIT",
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/@hocuspocus/provider/-/provider-1.1.3.tgz",
"integrity": "sha512-8AYFM1q3ICEyK835USGskMsT/z9QgiJOqYz1IStR4OrC08RVBTEm0vDdtHx+5y3wxIMg22tHQL7ubghWRj3BPg==",
"dependencies": {
"@hocuspocus/common": "^1.0.0-alpha.11",
"@hocuspocus/common": "^1.1.3",
"@lifeomic/attempt": "^3.0.2",
"lib0": "^0.2.46",
"lib0": "^0.2.46"
},
"peerDependencies": {
"y-protocols": "^1.0.5",
"yjs": "^13.5.29"
}
@ -21292,19 +21296,21 @@
"dev": true
},
"@hocuspocus/common": {
"version": "1.0.0-alpha.11",
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/@hocuspocus/common/-/common-1.1.3.tgz",
"integrity": "sha512-U5wQcMsVTooUKSqAq8m2bmMPWaVp78oTl1YFcJ2v3Dq0Wt1MBik3AohcnuUZ2JcP1fblf8lZVugCs9qg9mbu6g==",
"requires": {
"lib0": "^0.2.47"
}
},
"@hocuspocus/provider": {
"version": "1.0.0-alpha.38",
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/@hocuspocus/provider/-/provider-1.1.3.tgz",
"integrity": "sha512-8AYFM1q3ICEyK835USGskMsT/z9QgiJOqYz1IStR4OrC08RVBTEm0vDdtHx+5y3wxIMg22tHQL7ubghWRj3BPg==",
"requires": {
"@hocuspocus/common": "^1.0.0-alpha.11",
"@hocuspocus/common": "^1.1.3",
"@lifeomic/attempt": "^3.0.2",
"lib0": "^0.2.46",
"y-protocols": "^1.0.5",
"yjs": "^13.5.29"
"lib0": "^0.2.46"
}
},
"@humanwhocodes/config-array": {
@ -32128,7 +32134,7 @@
"tiptap-demos": {
"version": "file:demos",
"requires": {
"@hocuspocus/provider": "^1.0.0-alpha.29",
"@hocuspocus/provider": "^1.1.3",
"@sveltejs/vite-plugin-svelte": "^1.0.0-next.49",
"@types/uuid": "^8.3.4",
"@vitejs/plugin-react": "^1.3.1",