mirror of
https://github.com/ueberdosis/tiptap.git
synced 2025-01-18 22:36:14 +08:00
TiptapCollab
This commit is contained in:
parent
3a9b775bda
commit
ad9a50239a
@ -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",
|
||||
|
@ -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,
|
||||
})
|
||||
|
@ -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
34
package-lock.json
generated
@ -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",
|
||||
|
Loading…
Reference in New Issue
Block a user