Support for history commands including undo(), redo(), markHistoryEvent(“Moved 10 pixels left”), isDirty() and getHistoryArray().
In plugins it’s often the case that your plugin makes a change. Having access to undo() would allow your plugin to make changes and then undo them without exiting the plugin.
Bob writes a plugin that modifies the artboard. He adds an line to the artboard, gets the rotation matrix and then uses
command.undo() to remove it.
Greta is making an History panel for XD. She gets the history commands and makes it. She has undo and redo buttons that call
Victor is making an instructional plugin that teaches people how to use XD. His first guide is adding a rectangle to the stage and setting the fill to a linear gradient.
When he adds an ellipse and sets the linear gradient. At each step he calls
markHistoryEvent() then uses the
undo() command to go back to the first step. He has created a step by step walk through.
Then the user is instructed to exit the plugin and use the undo and redo shortcuts to move forward step by step in the action history.