improved a lot of things

This commit is contained in:
SinachPat
2026-04-27 04:52:15 +01:00
parent 197313c0ef
commit 9d9d7d7a37
25 changed files with 1598 additions and 288 deletions
+8
View File
@@ -22,6 +22,10 @@ interface CanvasStore {
liveArtboardIds: Set<string>;
setArtboardLive: (id: string, live: boolean) => void;
// ── Fiber tree cache (per artboard, updated on each FIBER_TREE_UPDATE) ─────
artboardFiberRoots: Record<string, FiberNode>;
setFiberRoot: (artboardId: string, root: FiberNode) => void;
// ── Component selection (from SelectionOverlay / fiber tree) ───────────────
selectedComponentId: string | null;
selectedComponentData: FiberNode | null;
@@ -48,6 +52,10 @@ export const useCanvas = create<CanvasStore>((set) => ({
return { liveArtboardIds: next };
}),
artboardFiberRoots: {},
setFiberRoot: (artboardId, root) =>
set((state) => ({ artboardFiberRoots: { ...state.artboardFiberRoots, [artboardId]: root } })),
selectedComponentId: null,
selectedComponentData: null,
selectComponent: (id, data) => set({ selectedComponentId: id, selectedComponentData: data }),