npm i marshall-y-slate
then you can use it like slate-yjs-example
Code snippet
import { toSharedType, useCursors, withCursor, withYjs, withUndoManager } from 'marshall-y-slate';
withReact(withCursor(withUndoManager(withYjs(createEditor(), sharedType)), provider.awareness))
source:
modify:
-
/model/index.ts
isCaret: boolean;
-
/plugin/use-cursors.ts
useuseCursors.ts
inslate-yjs