UNPKG

marshall-y-slate

Version:
39 lines (23 loc) 752 B
# slate-yjs @worktile/y-slate [中文文档](./README.zh.md) ### Thank slate-yjs and @worktile/y-slate ## USEAGE ``` npm i marshall-y-slate ``` then you can use it like [slate-yjs-example](https://github.com/BitPhinix/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`