Skip to content

Commit

Permalink
v0.0.13
Browse files Browse the repository at this point in the history
  • Loading branch information
alexjg committed Oct 4, 2024
1 parent 4e8fe60 commit a05be3c
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit a05be3c

Please sign in to comment.