UNPKG

@atlaskit/editor-plugin-undo-redo

Version:

Undo redo plugin for @atlaskit/editor-core

30 lines (29 loc) 1.22 kB
import type { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types'; import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics'; import type { HistoryPlugin } from '@atlaskit/editor-plugin-history'; import type { PrimaryToolbarPlugin } from '@atlaskit/editor-plugin-primary-toolbar'; import type { ToolbarPlugin } from '@atlaskit/editor-plugin-toolbar'; import type { TypeAheadPlugin } from '@atlaskit/editor-plugin-type-ahead'; import type { InputSource } from './pm-plugins/enums'; export type UndoRedoAction = (inputSource?: InputSource) => boolean; export type UndoRedoPlugin = NextEditorPlugin<'undoRedoPlugin', { actions: { redo: UndoRedoAction; undo: UndoRedoAction; }; dependencies: [ TypeAheadPlugin, HistoryPlugin, OptionalPlugin<PrimaryToolbarPlugin>, OptionalPlugin<AnalyticsPlugin>, OptionalPlugin<ToolbarPlugin> ]; pluginConfiguration: { /** * Determines whether or not to show the toolbar buttons * If not it just allows use of the actions + keybindings + analytics etc. * Defaults to true */ showToolbarButton: boolean; } | undefined; }>;