feat: add CurveEditor component (#8860)

## Summary
Prerequisite for upcoming native color correction nodes (ColorCurves).

Reusable curve editor with monotone cubic Hermite interpolation,
drag-to-add/move/delete control points, and SVG-based rendering.
Includes CurvePoint type, LUT generation utility, and useCurveEditor
composable for interaction logic.

## Screenshots (if applicable)



https://github.com/user-attachments/assets/948352c7-bdf2-40f9-a8f0-35bc2b2f3202

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-8860-feat-add-CurveEditor-component-and-d3-shape-dependency-3076d73d3650817f8421f98e349569d0)
by [Unito](https://www.unito.io)
This commit is contained in:
Terry Jia
2026-02-24 00:19:06 -05:00
committed by GitHub
parent aab09b5f99
commit e333ad459e
13 changed files with 716 additions and 1 deletions

View File

@@ -126,6 +126,15 @@ const zTextareaInputSpec = zBaseInputOptions.extend({
.optional()
})
const zCurvePoint = z.tuple([z.number(), z.number()])
const zCurveInputSpec = zBaseInputOptions.extend({
type: z.literal('CURVE'),
name: z.string(),
isOptional: z.boolean().optional(),
default: z.array(zCurvePoint).optional()
})
const zCustomInputSpec = zBaseInputOptions.extend({
type: z.string(),
name: z.string(),
@@ -146,6 +155,7 @@ const zInputSpec = z.union([
zChartInputSpec,
zGalleriaInputSpec,
zTextareaInputSpec,
zCurveInputSpec,
zCustomInputSpec
])
@@ -190,6 +200,7 @@ export type BoundingBoxInputSpec = z.infer<typeof zBoundingBoxInputSpec>
export type ChartInputSpec = z.infer<typeof zChartInputSpec>
export type GalleriaInputSpec = z.infer<typeof zGalleriaInputSpec>
export type TextareaInputSpec = z.infer<typeof zTextareaInputSpec>
export type CurveInputSpec = z.infer<typeof zCurveInputSpec>
export type CustomInputSpec = z.infer<typeof zCustomInputSpec>
export type InputSpec = z.infer<typeof zInputSpec>