diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..1b82111 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,25 @@ +## 0.0.13 + +Instead of intercepting and replacing ProseMirror transactions the library now implements a plugin that listens to ProseMirror transactions and updates the automerge document. This means that this library now plays nice with other plugins such as the history plugin. Thanks to @brianhung for implementing this. + +Now that we have a plugin based architecture we are able to simplify the API, so where you would previously have instantiated an `AutoMirror` and used it to intercept transactions in ProseMirrors' `dispatchTransaction` method, you now use `init` from this library to create a plugin, ProseMirror document, and schema, which you pass to the editor. + +```javascript +// This is the important part, we initialize the plugin with some handle and the path to the text field in the document +// and we get back a schema, a ProseMirror document, and a plugin +const { schema, pmDoc, plugin } = init(handle, ["text"]) + +// Create your prosemirror state with the schema, plugin, and document +let editorConfig = { + schema, + plugins: [ + plugin, + ... + ], + doc: pmDoc +} +``` + +## Contributors +- @alexjg +- @brianhung diff --git a/package.json b/package.json index 9a2ea71..0d744ec 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@automerge/prosemirror", - "version": "0.0.13-alpha.3", + "version": "0.0.13", "license": "MIT", "scripts": { "prettier": "prettier '**/*.{js,ts,tsx,json}' --check",