/** * Left panel: node types grouped by category. Items are dragged onto the * canvas (HTML5 drag & drop carrying the type id) or double-clicked to drop * at the viewport center. */ import { useMemo, useState } from 'react'; import { nodeTypesByCategory, type NodeTypeDef } from '../model/nodeTypes'; import { svgDataUri } from '../editor/shapes'; import { getColorScheme } from '../editor/colorSchemes'; export const PALETTE_MIME = 'application/x-pipeline-node-type'; interface PaletteProps { schemeId: string; onQuickAdd(typeId: string): void; } function PaletteItem({ type, schemeId, onQuickAdd }: { type: NodeTypeDef; schemeId: string; onQuickAdd(typeId: string): void; }) { const scheme = getColorScheme(schemeId); return (