Add adjustment preset node type validation and enhance render data normalization

- Introduced `adjustmentPresetNodeTypeValidator` for validating new adjustment preset node types.
- Added new constants for render output resolutions and formats, including custom dimension constraints.
- Implemented normalization functions for render data, ensuring proper validation and error handling.
- Updated node creation and update mutations to utilize normalized data for improved consistency.
This commit is contained in:
Matthias
2026-04-02 08:46:55 +02:00
parent 624beac6dc
commit 9bab9bb93d
5 changed files with 255 additions and 12 deletions

View File

@@ -52,12 +52,23 @@ export const ADJUSTMENT_NODE_TYPES = [
"render",
] as const;
export const ADJUSTMENT_PRESET_NODE_TYPES = [
"curves",
"color-adjust",
"light-adjust",
"detail-adjust",
] 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];
export type AdjustmentPresetNodeType = (typeof ADJUSTMENT_PRESET_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);
const ADJUSTMENT_PRESET_NODE_TYPE_SET = new Set<AdjustmentPresetNodeType>(
ADJUSTMENT_PRESET_NODE_TYPES,
);
export function isCanvasNodeType(value: string): value is CanvasNodeType {
return CANVAS_NODE_TYPE_SET.has(value as CanvasNodeType);
@@ -66,3 +77,9 @@ export function isCanvasNodeType(value: string): value is CanvasNodeType {
export function isAdjustmentNodeType(value: string): value is AdjustmentNodeType {
return ADJUSTMENT_NODE_TYPE_SET.has(value as AdjustmentNodeType);
}
export function isAdjustmentPresetNodeType(
value: string,
): value is AdjustmentPresetNodeType {
return ADJUSTMENT_PRESET_NODE_TYPE_SET.has(value as AdjustmentPresetNodeType);
}