import { defineToolcraft } from "../../schema/define-toolcraft"; import { timelineModule } from "../../modules/built-ins/timeline/timeline-module"; import type { ToolcraftExternalStore } from "../../state/toolcraft-external-store"; import { useToolcraftStore } from "./toolcraft-store-context"; export function StorePersistenceProbe() { const store = useToolcraftStore(); return (
); } export function CaptureStore({ capture, }: { capture: (store: ToolcraftExternalStore) => void; }) { capture(useToolcraftStore()); return null; } export function createHotPersistenceSchema() { return defineToolcraft({ base: { identity: { id: "root-test-hot", title: "Root Test Hot" }, canvas: { enabled: true }, panels: { controls: { sections: [ { id: "test-section-1", controls: { opacity: { applicability: { mode: "always" as const }, defaultValue: 75, target: "selectedLayer.opacity", type: "slider", }, }, }, ], title: "Controls", }, }, persistence: { storage: "localStorage", }, }, modules: [timelineModule({ mode: "keyframes" })], }); } export function createValuesPersistenceSchema() { return defineToolcraft({ base: { identity: { id: "root-test-committed-values", title: "Root Test Committed Values", }, canvas: { enabled: true }, panels: { controls: { sections: [ { id: "test-section-2", controls: { opacity: { applicability: { mode: "always" as const }, defaultValue: 75, target: "selectedLayer.opacity", type: "slider", }, }, }, ], title: "Controls", }, }, persistence: { storage: "localStorage", }, }, modules: [], }); }