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

@@ -0,0 +1,38 @@
"use client";
import { Slider } from "@/components/ui/slider";
export function SliderRow({
label,
value,
min,
max,
step = 1,
onChange,
}: {
label: string;
value: number;
min: number;
max: number;
step?: number;
onChange: (nextValue: number) => void;
}) {
return (
<div className="space-y-1">
<div className="flex items-center justify-between text-[11px] text-muted-foreground">
<span>{label}</span>
<span className="font-medium text-foreground">{value.toFixed(step < 1 ? 2 : 0)}</span>
</div>
<Slider
value={[value]}
min={min}
max={max}
step={step}
onValueChange={(values) => {
onChange(values[0] ?? value);
}}
className="nodrag nowheel"
/>
</div>
);
}