How to use the prosemirror-history.undo function in prosemirror-history

To help you get started, we’ve selected a few prosemirror-history examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github guardian / prosemirror-noting / test / helpers / prosemirror.js View on Github external
undo(n = 1) {
    for (let i = 0; i < n; i += 1) {
      undo(this.state, tr => this.apply(tr));
    }
    return this;
  }
github ProseMirror / prosemirror-menu / src / menu.js View on Github external
  enable: state => undo(state),
  icon: icons.undo
github zodiac-team / zodiac-ui / libs / editor / src / plugins / code / code.nodeview.ts View on Github external
            [`${mod}-Z`]: () => undo(view.state, view.dispatch),
            [`Shift-${mod}-Z`]: () => redo(view.state, view.dispatch),
github chanzuckerberg / czi-prosemirror / src / HistoryUndoCommand.js View on Github external
execute = (
    state: EditorState,
    dispatch: ?(tr: Transform) => void,
    view: ?EditorView
  ): boolean => {
    return undo(state, dispatch);
  };
}
github ProseMirror / website / example / footnote / index.js View on Github external
          "Mod-z": () => undo(this.outerView.state, this.outerView.dispatch),
          "Mod-y": () => redo(this.outerView.state, this.outerView.dispatch)
github ProseMirror / website / example / codemirror / index.js View on Github external
      [`${mod}-Z`]: () => undo(view.state, view.dispatch),
      [`Shift-${mod}-Z`]: () => redo(view.state, view.dispatch),
github nib-edit / Nib / packages / core / src / plugins / history / ToolbarComponent.js View on Github external
undo = () => {
    const { pmstate } = this.props;
    const { state, dispatch } = pmstate.pmview;
    undo(state, dispatch);
  };
github taktik / icure-backend / web / icure-ht / app / src / elements / prose-editor / prose-editor / prose-editor.ts View on Github external
doUndo(e: CustomEvent) {
    e.stopPropagation()
    e.preventDefault()
    if (this.editorView) {
      undo(this.editorView.state, this.editorView.dispatch)
      this.editorView.focus()
    }
  }

prosemirror-history

Undo history for ProseMirror

MIT
Latest version published 29 days ago

Package Health Score

74 / 100
Full package analysis

Similar packages