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

@@ -1,4 +1,5 @@
import { documentCommands } from "@commands/document";
import { historyCommands } from "@commands/history";
import { commandIds } from "@commands/ids";
import { createCommandRegistry } from "@commands/registry";
import { selectionCommands } from "@commands/selection";
@@ -11,7 +12,7 @@ import { createAppStore } from "@editor/store";
export type ImageStudioApp = ReturnType<typeof createImageStudioApp>;
export function createImageStudioApp(options?: { documentName?: string; createDefaultArtboard?: boolean }) {
const registry = createCommandRegistry([...viewportCommands, ...selectionCommands, ...documentCommands, ...toolCommands, ...transformCommands]);
const registry = createCommandRegistry([...viewportCommands, ...selectionCommands, ...documentCommands, ...toolCommands, ...transformCommands, ...historyCommands]);
const store = createAppStore(createInitialAppState(options?.documentName), registry);
if (options?.createDefaultArtboard !== false) {