feat(commands): add app state dispatcher foundation

This commit is contained in:
syntaxbullet
2026-07-03 09:28:06 +02:00
parent 697d12725d
commit a8dbd26474
11 changed files with 331 additions and 3 deletions

26
editor/initial-state.ts Normal file
View File

@@ -0,0 +1,26 @@
import type { AppState, EditorState } from "./state";
export const initialEditorState: EditorState = {
viewport: {
center: { x: 0, y: 0 },
zoom: 1,
rotation: 0,
size: { w: 0, h: 0 },
},
selection: {
layerIds: [],
},
};
export function createInitialAppState(name = "Untitled"): AppState {
return {
document: {
id: crypto.randomUUID(),
name,
version: 1,
artboards: [],
assets: [],
},
editor: initialEditorState,
};
}