Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01HT6iXLYUUp9pJz5Kza9xCW
44 lines
1.1 KiB
TypeScript
44 lines
1.1 KiB
TypeScript
import controls from "./controls.generated.json" with { type: "json" };
|
|
|
|
/**
|
|
* Editor panels. Crop and Basic are shown by default; each user can enable the others and the choice syncs
|
|
* across their devices. Generated from `engine/core` so web, desktop and server agree on control ids.
|
|
*/
|
|
export const MODULES = [
|
|
"crop",
|
|
"basic",
|
|
"toneCurve",
|
|
"colorMixer",
|
|
"blackAndWhite",
|
|
"colorGrading",
|
|
"detail",
|
|
"optics",
|
|
"geometry",
|
|
"vignette",
|
|
"grain",
|
|
"calibration",
|
|
"hdr",
|
|
"advanced",
|
|
] as const;
|
|
export type Module = (typeof MODULES)[number];
|
|
|
|
export const DEFAULT_MODULES: readonly Module[] = ["crop", "basic"];
|
|
|
|
export interface ControlInfo {
|
|
id: string;
|
|
module: Module;
|
|
label: string;
|
|
min: number;
|
|
max: number;
|
|
default: number;
|
|
step: number;
|
|
}
|
|
|
|
export const CONTROLS: readonly ControlInfo[] = controls as ControlInfo[];
|
|
|
|
const byId = new Map(CONTROLS.map((c) => [c.id, c]));
|
|
|
|
export const getControl = (id: string): ControlInfo | undefined => byId.get(id);
|
|
|
|
export const controlsForModule = (module: Module): ControlInfo[] => CONTROLS.filter((c) => c.module === module);
|