块编辑器开发文档

@wordpress/undo-manager

💡 云策文档标注

概述

@wordpress/undo-manager 是一个简单的撤销管理器模块,用于在 WordPress 开发中管理撤销和重做操作。它作为 Gutenberg 项目的一部分,通过 npm 安装使用。

关键要点

  • 提供 createUndoManager API 来创建撤销管理器实例,返回 UndoManager 类型。
  • 安装方式:使用 npm install @wordpress/undo-manager --save 命令安装。
  • 该项目是 Gutenberg monorepo 中的独立包,贡献指南请参考项目主文档。

📄 原文内容

A simple undo manager.

Installation

Install the module

npm install @wordpress/undo-manager --save

API

createUndoManager

Creates an undo manager.

Returns

  • UndoManager< T >: Undo manager.

Contributing to this package

This is an individual package that’s part of the Gutenberg project. The project is organized as a monorepo. It’s made up of multiple self-contained software packages, each with a specific purpose. The packages in this monorepo are published to npm and used by WordPress as well as other software projects.

To find out more about contributing to this package or Gutenberg as a whole, please read the project’s main contributor guide.