feat(history): add undo redo stack
This commit is contained in:
@@ -25,5 +25,6 @@ export function createInitialAppState(name = "Untitled"): AppState {
|
||||
assets: [],
|
||||
},
|
||||
editor: initialEditorState,
|
||||
history: { past: [], future: [] },
|
||||
};
|
||||
}
|
||||
|
||||
@@ -23,7 +23,18 @@ export type EditorState = {
|
||||
transformSession?: TransformSession;
|
||||
};
|
||||
|
||||
export type AppState = {
|
||||
export type HistorySnapshot = {
|
||||
document: ImageDocument;
|
||||
editor: EditorState;
|
||||
};
|
||||
|
||||
export type HistoryState = {
|
||||
past: HistorySnapshot[];
|
||||
future: HistorySnapshot[];
|
||||
};
|
||||
|
||||
export type AppState = {
|
||||
document: ImageDocument;
|
||||
editor: EditorState;
|
||||
history: HistoryState;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user