improved a lot of things
This commit is contained in:
@@ -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 }),
|
||||
|
||||
Reference in New Issue
Block a user