import { Label, type TextField, type VStack } from '../../ui'; import type { EditorState } from '../state'; import type { FieldContext, FieldRow } from './fieldFactory'; /** What the inspector sections build into: the panel body and the registry of rows. */ export interface InspectorHost extends FieldContext { readonly state: EditorState; readonly body: VStack; /** Rows by key; live refreshes and highlight updates find them here. */ readonly fields: Map; /** The name field at the top, when the selection has a name. */ nameField: TextField | null; } export function addTitle(host: InspectorHost, text: string): void { host.body.add(new Label(text, { style: 'title' })); } export function addNote( host: InspectorHost, text: string, style: 'muted' | 'small' | 'warning' = 'muted', ): void { host.body.add(new Label(text, { style })); } export function addGap(host: InspectorHost): void { host.body.add(new Label('')); }