- 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.
39 lines
797 B
TypeScript
39 lines
797 B
TypeScript
"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>
|
|
);
|
|
}
|