🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

prosemirror-history

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

prosemirror-history

Undo history for ProseMirror

1.4.1
latest
Source
npm
Version published
Weekly downloads
1.9M
-13.5%
Maintainers
1
Weekly downloads
 
Created

What is prosemirror-history?

The prosemirror-history package is a module for ProseMirror, a toolkit for building rich-text editors. This package specifically provides functionality for undo and redo actions within the editor's history. It is essential for implementing non-linear history and tracking changes in the document state over time.

What are prosemirror-history's main functionalities?

Undo Functionality

This feature allows users to undo the last change made to the editor's document. The 'undo' function is used in conjunction with the 'history' plugin, which must be added to the editor's state configuration.

import { undo, history } from 'prosemirror-history';

const myEditorState = EditorState.create({
  plugins: [
    history()
  ]
});

// To undo the last change
undo(myEditorState);

Redo Functionality

This feature enables users to redo changes that were previously undone using the undo function. Similar to undo, the 'redo' function requires the 'history' plugin to be present in the editor's configuration.

import { redo, history } from 'prosemirror-history';

const myEditorState = EditorState.create({
  plugins: [
    history()
  ]
});

// To redo the last undone change
redo(myEditorState);

Other packages similar to prosemirror-history

FAQs

Package last updated on 10 Jul 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts