add support for raw Y.js fragments to the collaboration extension

This commit is contained in:
Hans Pagel
2021-01-11 18:37:30 +01:00
parent 7809aa13f5
commit ecd0a6669a
4 changed files with 48 additions and 27 deletions

View File

@@ -20,10 +20,11 @@ yarn add @tiptap/extension-collaboration yjs y-websocket
```
## Settings
| Option | Type | Default | Description |
| -------- | -------- | --------- | ----------------------------------------------------------------------------------------- |
| document | `Object` | `null` | An initialized Y.js document. |
| fragment | `String` | `default` | Name of the Y.js fragment, can be changed to sync multiple fields with one Y.js document. |
| Option | Type | Default | Description |
| -------- | -------- | ----------- | --------------------------------------------------------------------------------------- |
| document | `Object` | `null` | An initialized Y.js document. |
| field | `String` | `'default'` | Name of a Y.js fragment, can be changed to sync multiple fields with one Y.js document. |
| fragment | `Object` | `null` | A raw Y.js fragment, can be used instead of `document` and `field`. |
## Commands
| Command | Parameters | Description |