feat: add Text node type to canvas

New canvas object Text with edit/create modal: text content (single
or multi-line), font (Inter, JetBrains Mono, Serif, System Sans),
size, color, border (style + width + color), background. Double-click
on node opens edit modal. Sidebar gets "Add Text" entry below "Add Zone".

Refs #124
This commit is contained in:
Pouzor
2026-05-10 15:58:35 +02:00
parent e672cb086a
commit 27fd78ece6
10 changed files with 654 additions and 4 deletions
+4
View File
@@ -19,6 +19,7 @@ export type NodeType =
| 'generic'
| 'groupRect'
| 'group'
| 'text'
| 'zigbee_coordinator'
| 'zigbee_router'
| 'zigbee_enddevice'
@@ -99,6 +100,8 @@ export interface NodeData extends Record<string, unknown> {
custom_icon?: string
/** Number of bottom connection points, 1..48. Default 1 (centered). */
bottom_handles?: number
/** Text node content (type === 'text') */
text_content?: string
}
export type EdgePathStyle = 'bezier' | 'smooth'
@@ -140,6 +143,7 @@ export const NODE_TYPE_LABELS: Record<NodeType, string> = {
generic: 'Generic Device',
groupRect: 'Group Rectangle',
group: 'Node Group',
text: 'Text',
zigbee_coordinator: 'Zigbee Coordinator',
zigbee_router: 'Zigbee Router',
zigbee_enddevice: 'Zigbee End Device',