feat: customizable connection points per side (issue #243)

Generalize the bottom-only handle machinery to all four sides. Top/Bottom
keep their single-handle default; Left/Right are opt-in (default 0) so
existing diagrams render unchanged. Handle IDs stay keyed off the bare side
name at slot 0, keeping saved edges valid.

- handleUtils: side-generic API (handleId, handlePositions, clampHandles,
  sideDefault, removedHandleIds, sideHandleCount); legacy bottom fns kept as
  delegating aliases
- BaseNode + ProxmoxGroupNode render all sides via new shared SideHandles
- updateNode remaps edges on any side's shrink (fallback to slot-0 / bottom)
- serializer round-trips top/left/right_handles
- NodeModal: spatial cross of -/N/+ steppers around a node preview, replacing
  the four stacked sliders; seeds per-type defaults
- CustomStyleModal: per-type default connection points per side

ha-relevant: yes
This commit is contained in:
Pouzor
2026-07-03 21:25:14 +02:00
parent c9a35b730d
commit b708a08fd0
15 changed files with 701 additions and 183 deletions
+13 -2
View File
@@ -140,9 +140,15 @@ export interface NodeData extends Record<string, unknown> {
*/
collapsed?: boolean
custom_icon?: string
/** Number of bottom connection points, 1..64. Default 1 (centered). */
/** Number of top connection points, 0..64. Default 1. */
top_handles?: number
/** Number of bottom connection points, 0..64. Default 1 (centered). */
bottom_handles?: number
/** Show a port number (1..N) above each bottom connection point. */
/** Number of left connection points, 0..64. Default 0 (opt-in). */
left_handles?: number
/** Number of right connection points, 0..64. Default 0 (opt-in). */
right_handles?: number
/** Show a port number (1..N) next to each connection point. */
show_port_numbers?: boolean
/** Text node content (type === 'text') */
text_content?: string
@@ -239,6 +245,11 @@ export interface NodeTypeStyle {
iconOpacity: number
width: number
height: number
/** Default connection-point counts per side for new nodes of this type. */
topHandles?: number
bottomHandles?: number
leftHandles?: number
rightHandles?: number
}
export interface EdgeTypeStyle {