-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
26 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters