diff --git a/frontend/src/components/PropertiesPanel.tsx b/frontend/src/components/PropertiesPanel.tsx index ee14b9e..ed21985 100644 --- a/frontend/src/components/PropertiesPanel.tsx +++ b/frontend/src/components/PropertiesPanel.tsx @@ -3,6 +3,7 @@ import { polygonArea } from '../tools/modification/geometry'; import { formatArea } from '../utils/format'; import type { PropertiesPanelProps } from '../types/ui.types'; import { formatInputValue, parseDistance, type UnitType } from '../utils/format'; +import { getActiveDocument } from '../kernel/document/documentService'; const parseNum = (s: string) => parseFloat(s.replace(/[^0-9.\-]/g, '')) || 0; @@ -77,7 +78,37 @@ const PropertiesPanel: React.FC = ({ {formatArea(polygonArea(el.properties.points as Array<{ x: number; y: number }>), unit, scaleFactor)} - )}` : ''} + )} + + {/* ─── Task D12: Block-Attribute-Formular (block_instance) ─── */} + {el.type === 'block_instance' && (() => { + const blockId = el.properties.blockId as string | undefined; + if (!blockId) return null; + const block = getActiveDocument()?.getBlock(blockId); + const attrDefs = block?.attrDefs ?? []; + if (attrDefs.length === 0) return null; + const attrValues = (el.properties.attrValues as Record | undefined) ?? {}; + return ( +
+
Block-Attribute
+ {attrDefs.map((def) => ( +
+ + { + const next = { ...attrValues, [def.tag]: ev.target.value }; + onUpdateProperty('attrValues', next); + }} + /> +
+ ))} +
+ ); + })()}` : ''}
{onDelete && el && (