Enhance canvas functionality with new node types and validation

- Added support for new canvas node types: curves, color-adjust, light-adjust, detail-adjust, and render.
- Implemented validation for adjustment nodes to restrict incoming edges to one.
- Updated canvas connection validation to improve user feedback on invalid connections.
- Enhanced node creation and rendering logic to accommodate new node types and their properties.
- Refactored related components and utilities for better maintainability and performance.
This commit is contained in:
Matthias
2026-04-02 11:39:05 +02:00
parent 9bab9bb93d
commit f3c5c2d8f1
52 changed files with 5755 additions and 44 deletions

View File

@@ -11,11 +11,12 @@ import { useStore, type Edge as RFEdge } from "@xyflow/react";
import type { Id } from "@/convex/_generated/dataModel";
import { NODE_DEFAULTS, NODE_HANDLE_MAP } from "@/lib/canvas-utils";
import type { CanvasNodeType } from "@/lib/canvas-node-types";
import { isOptimisticEdgeId } from "./canvas-helpers";
type CreateNodeArgs = {
canvasId: Id<"canvases">;
type: string;
type: CanvasNodeType;
positionX: number;
positionY: number;
width: number;
@@ -28,7 +29,7 @@ type CreateNodeArgs = {
type CreateNodeWithEdgeSplitArgs = {
canvasId: Id<"canvases">;
type: string;
type: CanvasNodeType;
positionX: number;
positionY: number;
width: number;
@@ -70,7 +71,7 @@ type CreateNodeWithEdgeToTargetMutation = (
type FlowPoint = { x: number; y: number };
type CreateNodeWithIntersectionInput = {
type: string;
type: CanvasNodeType;
position: FlowPoint;
width?: number;
height?: number;