feat(view): show default artboard canvas

This commit is contained in:
syntaxbullet
2026-07-03 10:01:02 +02:00
parent fb0c424745
commit b4f1a149c6
4 changed files with 25 additions and 6 deletions

View File

@@ -7,10 +7,18 @@ import { createAppStore } from "@editor/store";
export type ImageStudioApp = ReturnType<typeof createImageStudioApp>;
export function createImageStudioApp(options?: { documentName?: string }) {
export function createImageStudioApp(options?: { documentName?: string; createDefaultArtboard?: boolean }) {
const registry = createCommandRegistry([...viewportCommands, ...selectionCommands, ...documentCommands]);
const store = createAppStore(createInitialAppState(options?.documentName), registry);
if (options?.createDefaultArtboard !== false) {
store.dispatch("document.addArtboard", {
id: crypto.randomUUID(),
name: "Artboard 1",
bounds: { x: -400, y: -300, w: 800, h: 600 },
});
}
return {
registry,
store,