Skip to content

Commit

Permalink
docs: add try it online link
Browse files Browse the repository at this point in the history
  • Loading branch information
zxch3n committed Jun 6, 2024
1 parent 3a7bd30 commit 9a04d47
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 16 deletions.
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
- Sync document state with Loro
- Sync cursors with Loro's Awareness and [Cursor](https://loro.dev/docs/tutorial/cursor)
- Undo/Redo in collaborative editing
- [🎨 Try it online](https://6661e86e215da40180d90507-ansgznbrmy.chromatic.com)

```ts
import {
Expand All @@ -22,9 +23,9 @@ const plugins = [
LoroSyncPlugin({ doc }),
LoroUndoPlugin({ doc }),
keymap({
"Mod-z": state => undo(state, () => {}),
"Mod-y": state => redo(state, () => {}),
"Mod-Shift-z": state => redo(state, () => {}),
"Mod-z": (state) => undo(state, () => {}),
"Mod-y": (state) => redo(state, () => {}),
"Mod-Shift-z": (state) => redo(state, () => {}),
}),
LoroCursorPlugin(awareness, {}),
];
Expand All @@ -34,6 +35,3 @@ const editor = new EditorView(editorDom, {
```

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



2 changes: 1 addition & 1 deletion examples/stories/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"dependencies": {
"loro-crdt": "^0.16.3",
"loro-prosemirror": "link:../..",
"loro-prosemirror": "0.0.3",
"prosemirror-commands": "^1.5.2",
"prosemirror-example-setup": "^1.2.2",
"prosemirror-keymap": "^1.2.2",
Expand Down
44 changes: 35 additions & 9 deletions examples/stories/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"@rollup/plugin-node-resolve": "^15.0.1",
"@typescript-eslint/parser": "^7.4.0",
"@vitest/coverage-v8": "^1.4.0",
"chromatic": "^11.5.3",
"eslint": "^8.57.0",
"lib0": "^0.2.93",
"prettier": "^3.2.5",
Expand Down
16 changes: 16 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9a04d47

Please sign in to comment.