1.0.2 • Published 2 years ago
marshall-y-slate v1.0.2
slate-yjs @worktile/y-slate
Thank slate-yjs and @worktile/y-slate
USEAGE
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:
* [@worktile/y-slate](https://github.com/worktile/y-slate)
* [slate-yjs branch main](https://github.com/BitPhinix/slate-yjs/tree/main)
modify:
* `/model/index.ts`
```
isCaret: boolean;
```
* `/plugin/use-cursors.ts`
use `useCursors.ts` in `slate-yjs`