There used to be an onAction() editor prop which I used to dump the current state into a text area (for debugging) like this:
const json = document.getElementById('json');
let view = new MenuBarEditorView(document.querySelector("#editor"), {
state: EditorState.create({
doc: Node.fromJSON(schema, JSON.parse(json.value)),
schema: schema,
plugins: exampleSetup({schema})
}) ,
onAction(action) {
view.updateState(view.editor.state.applyAction(action));
//current state as json in text area
json.value = JSON.stringify(view.editor.state.doc.toJSON(), null, 4);
}
});
window.view = view.editor;
But it seems this prop is gone. What would be the equivalent to that?