import { action, observable } from 'mobx'; import { observer } from 'mobx-react'; import * as React from 'react'; import { UndoManager } from '../util/UndoManager'; import './UndoStack.scss'; interface UndoStackProps { width?: number; height?: number; inline?: boolean; } @observer export class UndoStack extends React.Component { @observable static HideInline: boolean; @observable static Expand: boolean; render() { return this.props.inline && UndoStack.HideInline ? null : (
(UndoStack.Expand = !UndoStack.Expand))} onDoubleClick={action(e => (UndoStack.Expand = UndoStack.HideInline = false))}>
r?.scroll({ behavior: 'auto', top: r?.scrollHeight + 20 })} style={{ background: UndoManager.batchCounter.get() ? 'yellow' : undefined }}>
Undo/Redo Stack
{UndoManager.undoStackNames.map((name, i) => (
{name.replace(/[^\.]*\./, '')}
))} {Array.from(UndoManager.redoStackNames) .reverse() .map((name, i) => (
{name.replace(/[^\.]*\./, '')}
))}
); } }