From 9a04d4756c3757ff35832d53e3a1721be5a52a45 Mon Sep 17 00:00:00 2001 From: Zixuan Chen Date: Fri, 7 Jun 2024 01:00:37 +0800 Subject: [PATCH] docs: add try it online link --- README.md | 10 +++----- examples/stories/package.json | 2 +- examples/stories/pnpm-lock.yaml | 44 ++++++++++++++++++++++++++------- package.json | 1 + pnpm-lock.yaml | 16 ++++++++++++ 5 files changed, 57 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 81455a9..4a2a6dc 100644 --- a/README.md +++ b/README.md @@ -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 { @@ -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, {}), ]; @@ -34,6 +35,3 @@ const editor = new EditorView(editorDom, { ``` https://github.com/loro-dev/prosemirror/assets/18425020/d0f01760-b76c-43b5-b7f7-b0b224130d9d - - - diff --git a/examples/stories/package.json b/examples/stories/package.json index d390c52..c7f30b9 100644 --- a/examples/stories/package.json +++ b/examples/stories/package.json @@ -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", diff --git a/examples/stories/pnpm-lock.yaml b/examples/stories/pnpm-lock.yaml index 0b61a66..99abdbf 100644 --- a/examples/stories/pnpm-lock.yaml +++ b/examples/stories/pnpm-lock.yaml @@ -6,11 +6,11 @@ settings: dependencies: loro-crdt: - specifier: ^0.16.2 - version: 0.16.2 + specifier: ^0.16.3 + version: 0.16.3 loro-prosemirror: - specifier: link:../.. - version: link:../.. + specifier: 0.0.3 + version: 0.0.3(prosemirror-model@1.20.0)(prosemirror-state@1.4.3)(prosemirror-view@1.33.4) prosemirror-commands: specifier: ^1.5.2 version: 1.5.2 @@ -5479,6 +5479,10 @@ packages: engines: {node: '>=0.10.0'} dev: true + /isomorphic.js@0.2.5: + resolution: {integrity: sha512-PIeMbHqMt4DnUP3MA/Flc0HElYjMXArsw1qwJZcm9sqR8mq3l8NYizFMty0pWwE/tzIGH3EKK5+jes5mAr85yw==} + dev: false + /jackspeak@2.3.6: resolution: {integrity: sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ==} engines: {node: '>=14'} @@ -5627,6 +5631,14 @@ packages: type-check: 0.4.0 dev: true + /lib0@0.2.94: + resolution: {integrity: sha512-hZ3p54jL4Wpu7IOg26uC7dnEWiMyNlUrb9KoG7+xYs45WkQwpVvKFndVq2+pqLYKe1u8Fp3+zAfZHVvTK34PvQ==} + engines: {node: '>=16'} + hasBin: true + dependencies: + isomorphic.js: 0.2.5 + dev: false + /lilconfig@2.1.0: resolution: {integrity: sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==} engines: {node: '>=10'} @@ -5689,14 +5701,28 @@ packages: dependencies: js-tokens: 4.0.0 - /loro-crdt@0.16.2: - resolution: {integrity: sha512-+iS6GdKk+ethW98S2jX0Sp475cXKiSG+c6zXvjaGfycSHnQSGiof/gM1NOQ96QyNHXoA0DyCukhpLSNbRe9fLA==} + /loro-crdt@0.16.3: + resolution: {integrity: sha512-+iwDK7aV0Sa5ZlErdU3F4wh4nW3jNfa1cBcVuKna7UPdaNp/hohKRuGPTCf6ynhkmZvzwKpg7ZzibETxxKoczA==} dependencies: - loro-wasm: 0.16.2 + loro-wasm: 0.16.3 + dev: false + + /loro-prosemirror@0.0.3(prosemirror-model@1.20.0)(prosemirror-state@1.4.3)(prosemirror-view@1.33.4): + resolution: {integrity: sha512-Nlet+shWOSPisVykyj9uFPpDGV6VODYT4zq/Debzja/kotpD7TCkdNAJshOGazE8qso3Y+RH4cAIcikHvM9R5Q==} + peerDependencies: + prosemirror-model: ^1.18.1 + prosemirror-state: ^1.4.1 + prosemirror-view: ^1.28.0 + dependencies: + lib0: 0.2.94 + loro-crdt: 0.16.3 + prosemirror-model: 1.20.0 + prosemirror-state: 1.4.3 + prosemirror-view: 1.33.4 dev: false - /loro-wasm@0.16.2: - resolution: {integrity: sha512-8SJuGCGXl69/1TDF6cjERBHsh+NzAATVRFklMGN6M5bq45MH8iO1Npy9KsgarRfOugvlnYNiVhQEYunJenLGxQ==} + /loro-wasm@0.16.3: + resolution: {integrity: sha512-ftJnoAVImVGCxwDWkgOU00tWAunqqc9abWtXC/cRCx8wzqMwrEnBMls/0N6HTuUNSzweTR77Izt7y/i7dccLgg==} dev: false /loupe@2.3.7: diff --git a/package.json b/package.json index 1b54278..56cd133 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 92032f9..64f1977 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -22,6 +22,9 @@ devDependencies: '@vitest/coverage-v8': specifier: ^1.4.0 version: 1.4.0(vitest@1.4.0) + chromatic: + specifier: ^11.5.3 + version: 11.5.3 eslint: specifier: ^8.57.0 version: 8.57.0 @@ -1109,6 +1112,19 @@ packages: get-func-name: 2.0.2 dev: true + /chromatic@11.5.3: + resolution: {integrity: sha512-EtDDXA4OdhsjE0IuLr5AZvOX+ZYXgqdRPtdTAQrM3nImjlteQ5biBmdEEEcdAXDTPU881rEUaUIy2owecB0wYg==} + hasBin: true + peerDependencies: + '@chromatic-com/cypress': ^0.*.* || ^1.0.0 + '@chromatic-com/playwright': ^0.*.* || ^1.0.0 + peerDependenciesMeta: + '@chromatic-com/cypress': + optional: true + '@chromatic-com/playwright': + optional: true + dev: true + /color-convert@1.9.3: resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==} requiresBuild: true