From b23cdcba6b42de6234929c725b56e5c4d457eed0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Ku=CC=88hn?= Date: Sun, 3 Feb 2019 14:06:17 +0100 Subject: [PATCH] add basic collab implementation --- .../Components/Routes/Collaboration/Collab.js | 12 +++ .../Components/Routes/Collaboration/index.vue | 88 +++++++++++++++++++ examples/Components/Subnavigation/index.vue | 3 + examples/main.js | 7 ++ package.json | 4 +- yarn.lock | 7 ++ 6 files changed, 120 insertions(+), 1 deletion(-) create mode 100644 examples/Components/Routes/Collaboration/Collab.js create mode 100644 examples/Components/Routes/Collaboration/index.vue diff --git a/examples/Components/Routes/Collaboration/Collab.js b/examples/Components/Routes/Collaboration/Collab.js new file mode 100644 index 000000000..7607d18a9 --- /dev/null +++ b/examples/Components/Routes/Collaboration/Collab.js @@ -0,0 +1,12 @@ +import { Extension } from 'tiptap' +import { collab } from 'prosemirror-collab' + +export default class CollabExtension extends Extension { + get name() { + return 'collab' + } + + get plugins() { + return [collab()] + } +} diff --git a/examples/Components/Routes/Collaboration/index.vue b/examples/Components/Routes/Collaboration/index.vue new file mode 100644 index 000000000..bd89ace07 --- /dev/null +++ b/examples/Components/Routes/Collaboration/index.vue @@ -0,0 +1,88 @@ + + + diff --git a/examples/Components/Subnavigation/index.vue b/examples/Components/Subnavigation/index.vue index bcc2e2461..c4c3b796f 100644 --- a/examples/Components/Subnavigation/index.vue +++ b/examples/Components/Subnavigation/index.vue @@ -48,6 +48,9 @@ Export HTML or JSON + + Collaboration + diff --git a/examples/main.js b/examples/main.js index aea0bad97..3102cc931 100644 --- a/examples/main.js +++ b/examples/main.js @@ -124,6 +124,13 @@ const routes = [ githubUrl: 'https://github.com/scrumpy/tiptap/tree/master/examples/Components/Routes/Export', }, }, + { + path: '/collaboration', + component: () => import('Components/Routes/Collaboration'), + meta: { + githubUrl: 'https://github.com/scrumpy/tiptap/tree/master/examples/Components/Routes/Collaboration', + }, + }, ] const router = new VueRouter({ diff --git a/package.json b/package.json index 23fb1971a..15bdc6ca7 100644 --- a/package.json +++ b/package.json @@ -86,5 +86,7 @@ "webpack-svgstore-plugin": "^4.1.0", "zlib": "^1.0.5" }, - "dependencies": {} + "dependencies": { + "prosemirror-collab": "^1.1.1" + } } diff --git a/yarn.lock b/yarn.lock index 073741b9b..a50601f21 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9572,6 +9572,13 @@ promzard@^0.3.0: dependencies: read "1" +prosemirror-collab@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/prosemirror-collab/-/prosemirror-collab-1.1.1.tgz#c8f5d951abaeac8a80818b6bd960f5a392b35b3f" + integrity sha512-BpXIB3WBD7UvgxuiasKOxlAZ78TTOdW+SQN4bbJan995tVx/wM/OZXtRJebS+tSWWAbRisHaO3ciFo732vuvdA== + dependencies: + prosemirror-state "^1.0.0" + prosemirror-commands@^1.0.7: version "1.0.7" resolved "https://registry.yarnpkg.com/prosemirror-commands/-/prosemirror-commands-1.0.7.tgz#e5a2ba821e29ea7065c88277fe2c3d7f6b0b9d37"