Files
lemonspace_app/lib/canvas-node-types.ts
Matthias 624beac6dc Enhance canvas components with improved error handling and aspect ratio normalization
- Added error name tracking in NodeErrorBoundary for better debugging.
- Introduced aspect ratio normalization in PromptNode to ensure valid values are used.
- Updated debounced state management in CanvasInner for improved performance.
- Enhanced SelectContent component to support optional portal rendering.
2026-04-02 08:26:06 +02:00

69 lines
1.4 KiB
TypeScript

export const PHASE1_CANVAS_NODE_TYPES = [
"image",
"text",
"prompt",
"ai-image",
"group",
"frame",
"note",
"compare",
] as const;
export const CANVAS_NODE_TYPES = [
"image",
"text",
"prompt",
"color",
"video",
"asset",
"ai-image",
"ai-text",
"ai-video",
"agent-output",
"crop",
"bg-remove",
"upscale",
"style-transfer",
"face-restore",
"curves",
"color-adjust",
"light-adjust",
"detail-adjust",
"render",
"splitter",
"loop",
"agent",
"mixer",
"switch",
"group",
"frame",
"note",
"compare",
"text-overlay",
"comment",
"presentation",
] as const;
export const ADJUSTMENT_NODE_TYPES = [
"curves",
"color-adjust",
"light-adjust",
"detail-adjust",
"render",
] as const;
export type CanvasNodeType = (typeof CANVAS_NODE_TYPES)[number];
export type Phase1CanvasNodeType = (typeof PHASE1_CANVAS_NODE_TYPES)[number];
export type AdjustmentNodeType = (typeof ADJUSTMENT_NODE_TYPES)[number];
const CANVAS_NODE_TYPE_SET = new Set<CanvasNodeType>(CANVAS_NODE_TYPES);
const ADJUSTMENT_NODE_TYPE_SET = new Set<AdjustmentNodeType>(ADJUSTMENT_NODE_TYPES);
export function isCanvasNodeType(value: string): value is CanvasNodeType {
return CANVAS_NODE_TYPE_SET.has(value as CanvasNodeType);
}
export function isAdjustmentNodeType(value: string): value is AdjustmentNodeType {
return ADJUSTMENT_NODE_TYPE_SET.has(value as AdjustmentNodeType);
}