Skip to main content
Version: Next

History Plugin

Undo/redo stack with DOM transaction support for structural plugin edits.

Installation and Import

import { HistoryPlugin } from "@editora/plugins";
// or: import { HistoryPlugin } from "@editora/plugins/history";

Usage

const plugins = [HistoryPlugin()];

Command Matrix

ActionCommandShortcutToolbar
UndoundoMod-zUndo
RedoredoMod-y, Mod-Shift-zRedo
Record DOM transactionrecordDomTransactionNoneInternal/plugin use
Undo DOM transactionundoDomNoneInternal/plugin use
Redo DOM transactionredoDomNoneInternal/plugin use
Set attributesetAttributeNoneInternal/plugin use
Set textsetTextNoneInternal/plugin use

Config Options

This plugin does not expose plugin-level config options.

Integration Notes

  • Use DOM transaction commands for structural mutations in custom plugins
  • Ensure plugins dispatch input updates after applying DOM mutations
  • History stacks are maintained per editor instance

Validation Checklist

  • Undo/redo works for formatting and structural operations
  • Checklist/table/footnote changes are reversible
  • Multiple editors maintain isolated history stacks