feat(history): add undo redo stack

This commit is contained in:
syntaxbullet
2026-07-03 17:30:31 +02:00
parent fedeaffa57
commit 0ffbc4f68b
12 changed files with 139 additions and 7 deletions

View File

@@ -25,5 +25,6 @@ export function createInitialAppState(name = "Untitled"): AppState {
assets: [],
},
editor: initialEditorState,
history: { past: [], future: [] },
};
}

View File

@@ -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;
};