From bd5b7ac41d06322bd919ef40fccae03ab13a305e Mon Sep 17 00:00:00 2001 From: "David P. Novakovic" Date: Fri, 6 Dec 2024 11:12:47 +1000 Subject: [PATCH] doc: how to change name and color for cursors --- apps/www/content/docs/collaboration.mdx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/www/content/docs/collaboration.mdx b/apps/www/content/docs/collaboration.mdx index c596338522..1b2689a9ed 100644 --- a/apps/www/content/docs/collaboration.mdx +++ b/apps/www/content/docs/collaboration.mdx @@ -13,7 +13,7 @@ title: Collaboration ## Features - The yjs plugin enables support for collaboration using [slate-yjs](https://docs.slate-yjs.dev/) and [Hocuspocus](https://docs.slate-yjs.dev/walkthroughs/collaboration-hocuspocus). -- By default remote cursors are rendered slightly faded and become solid on hover. +- By default remote cursors are rendered slightly faded and become solid on hover. Use the `data` field in `cursorOptions` to customise the display name and color. - To customize, copy `YjsAboveEditable.tsx` and `Overlay.tsx` into your project and override the `options.render.aboveEditable` option to this plugin. @@ -36,6 +36,11 @@ const editor = createPlateEditor({ // ...otherPlugins, YjsPlugin.configure({ options: { + cursorOptions: { + autoSend: true, + data: { name: 'A plate user', color: '#5AC990' }, + }, + disableCursors: false, hocuspocusProviderOptions: { url: 'https://hocuspocus.test/hocuspocus', name: 'test',