Collaboration
Collaborate with others in a single document.
Backend Development in Progress - Demo Unavailable.
Features
- The yjs plugin enables support for collaboration using slate-yjs and Hocuspocus.
Frontend
Installation
npm install @udecode/plate-yjs
Usage
import { YjsPlugin } from '@udecode/plate-yjs/react';
const editor = createPlateEditor({
plugins: [
// ...otherPlugins,
YjsPlugin.configure({
hocuspocusProviderOptions: {
url: 'https://hocuspocus.test/hocuspocus',
name: 'test',
},
}),
]
});
Backend
Follow the backend instructions in Hocuspocus docs.
Plugins
YjsPlugin
Options
Configuration for handling cursors in the editor. These options are passed
to the withCursors
function.
Configuration for the Hocuspocus provider.
Optional configuration for the Yjs integration. These options are passed to
the withYjs
function.
A flag indicating whether to disable the cursor feature in the editor.
API
useYjsStore
State
A flag indicating whether the editor is connected to the Hocuspocus server.
A flag indicating whether the editor is synced with the Hocuspocus server.
withTYjs
Higher-order function that wraps a Plate editor with Yjs support, allowing for real-time collaborative editing.
PlateYjsEditorProps
Attributes
Extends YjsEditorProps
and CursorEditor.
YHistoryEditorProps
Extends YjsEditorProps
, YHistoryEditor.