Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@lexical/history

Package Overview
Dependencies
Maintainers
0
Versions
207
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lexical/history

This package contains selection history helpers for Lexical.

  • 0.20.1-nightly.20241118.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
581K
increased by2.6%
Maintainers
0
Weekly downloads
 
Created

What is @lexical/history?

@lexical/history is a plugin for the Lexical framework that provides undo and redo functionality for text editors. It allows developers to easily integrate history management into their Lexical-based editors, enabling users to revert or reapply changes made to the content.

What are @lexical/history's main functionalities?

Undo

This feature allows users to undo the last change made in the editor. The `undo` method reverts the editor state to the previous state.

import { createHistoryPlugin } from '@lexical/history';

const historyPlugin = createHistoryPlugin();

// To undo the last change
historyPlugin.undo();

Redo

This feature allows users to redo the last undone change in the editor. The `redo` method reapplies the last change that was undone.

import { createHistoryPlugin } from '@lexical/history';

const historyPlugin = createHistoryPlugin();

// To redo the last undone change
historyPlugin.redo();

Custom History Management

This feature allows developers to customize the history management, such as setting a maximum stack size for the undo/redo history. The `createHistoryPlugin` function accepts configuration options to tailor the history behavior.

import { createHistoryPlugin } from '@lexical/history';

const historyPlugin = createHistoryPlugin({ maxStackSize: 100 });

// Custom history management with a maximum stack size of 100
historyPlugin.undo();

Other packages similar to @lexical/history

Keywords

FAQs

Package last updated on 18 Nov 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc