Skip to content

cosmicshelter/tweakpane-undo-redo-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tweakpane plugin to add Undo/Redo feature to your panes

Installation

npm install github:cosmicshelter/tweakpane-undo-redo-plugin

Usage

import addUndoRedoFeature from 'tweakpane-undo-redo-plugin';
import * as Tweakpane from 'tweakpane';

addUndoRedoFeature(Tweakpane);

If needed, you can call clear to empty the action history stack :

const undoRedoFeature = addUndoRedoFeature(Tweakpane);
undoRedoFeature.clear();

You can also call destroy to clear the history and remove the keydown event listener :

const undoRedoFeature = addUndoRedoFeature(Tweakpane);
undoRedoFeature.destroy();

Disclamer

I had to make my way around the official Tweakpane API to make this work, using internal methods etc... It might not work properly for Tweakpane versions other than v4.0.5.

Roadmap

  • More testing
  • Handle blades
  • Handle other plugins

About

Tweakpane plugin to add undo/redo logic to your panes

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published