0.2.1 • Published 6 months ago

loro-prosemirror v0.2.1

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

Prosemirror Binding for Loro

  • Sync document state with Loro
  • Sync cursors with Loro's Awareness and Cursor
  • Undo/Redo in collaborative editing
  • 🎨 Try it online
import {
  CursorAwareness,
  LoroCursorPlugin,
  LoroSyncPlugin,
  LoroUndoPlugin,
  undo,
  redo,
} from "loro-prosemirror";
import { LoroDoc } from "loro-crdt";

const doc = new LoroDoc();
const awareness = new CursorAwareness(doc.peerIdStr);
const plugins = [
  ...pmPlugins,
  LoroSyncPlugin({ doc }),
  LoroUndoPlugin({ doc }),
  keymap({
    "Mod-z": undo,
    "Mod-y": redo,
    "Mod-Shift-z": redo,
  }),
  LoroCursorPlugin(awareness, {}),
];
const editor = new EditorView(editorDom, {
  state: EditorState.create({ doc, plugins }),
});

https://github.com/loro-dev/prosemirror/assets/18425020/d0f01760-b76c-43b5-b7f7-b0b224130d9d

0.2.1

6 months ago

0.2.0

9 months ago

0.1.0

9 months ago

0.0.7

11 months ago

0.0.6

12 months ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago