feat: full studio build -- light theme, canvas thumbnails, i18n (fa/en)
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
import type { Scene } from "@/lib/studio-types";
|
||||
|
||||
export const STUDIO_HISTORY_LIMIT = 50;
|
||||
|
||||
export interface StudioHistorySnapshot {
|
||||
scenes: Scene[];
|
||||
activeSceneId: string;
|
||||
selectedLayerId: string | null;
|
||||
}
|
||||
|
||||
export function cloneScenes(scenes: Scene[]): Scene[] {
|
||||
return scenes.map((scene) => ({
|
||||
...scene,
|
||||
layers: scene.layers.map((layer) => ({
|
||||
...layer,
|
||||
props: { ...layer.props },
|
||||
})),
|
||||
}));
|
||||
}
|
||||
|
||||
export function captureHistorySnapshot(state: {
|
||||
scenes: Scene[];
|
||||
activeSceneId: string;
|
||||
selectedLayerId: string | null;
|
||||
}): StudioHistorySnapshot {
|
||||
return {
|
||||
scenes: cloneScenes(state.scenes),
|
||||
activeSceneId: state.activeSceneId,
|
||||
selectedLayerId: state.selectedLayerId,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user