import type { BookElement, BookShapeElement, BookShapeId, BookTheme } from '@trek/shared'; import type { ReactNode } from 'react'; import { SHAPE_GROUPS, shapeName } from '../shapes'; import { NumField, Section } from '../StudioControls'; import { EdgeSection } from '../StudioEdgeControls'; import { ShapeGlyph } from '../StudioElementsPanel'; import { StudioShapeFill, StudioShapeOutline } from '../StudioShapePaint'; /** * The inspector of a shape: which shape it is and its corner first, then where * it sits, then its fill, and folded under that its outline and its cut edge, * each open on a shape that has one. */ export function StudioShapeInspector({ el, spreadIndex, selection, theme, set, position, t, }: { el: BookShapeElement; spreadIndex: number; selection: readonly string[]; theme: BookTheme | undefined; set: (patch: Partial) => void; position: ReactNode; t: (k: string) => string; }) { return ( <>
{/* Every shape, not just the two the element started as: swapping a placed shape keeps its position, size and colour, which deleting and re-adding would not. */}
{SHAPE_GROUPS.flatMap((g) => g.shapes).map((sh: BookShapeId) => ( ))}
set({ radius: v })} />
{position} set(patch)} t={t} /> ); }