import { TOOLCRAFT_MODEL_IMPORT_LIMIT_NAMES } from "../model-import/model-import-limit-values"; import { defineToolcraft } from "./define-toolcraft"; import { getProductSections } from "./define-toolcraft-test-utils"; import type { ToolcraftAppSchema, ToolcraftControlSchema, ToolcraftModelImportLimits, } from "./types"; export const MODEL_LIMIT_KEYS: readonly (keyof ToolcraftModelImportLimits)[] = TOOLCRAFT_MODEL_IMPORT_LIMIT_NAMES; export function createSourceControlSchema( control: ToolcraftControlSchema, ): ToolcraftAppSchema { return { canvas: { enabled: true }, panels: { controls: { sections: [ { controls: { source: control, }, title: "Source", }, ], title: "Controls", }, }, }; } export function createFileDropSchema( overrides: Record = {}, ): ToolcraftAppSchema { return createSourceControlSchema({ target: "source.asset", type: "fileDrop", ...overrides, } as ToolcraftControlSchema); } export function getSourceControl(app: ReturnType) { return getProductSections(app)[0]?.controls.source; }