(element)
| 116 | * Get element's position relative to viewport |
| 117 | */ |
| 118 | export function getElementPosition(element) { |
| 119 | if (!element) return null; |
| 120 | |
| 121 | const rect = element.getBoundingClientRect(); |
| 122 | return { |
| 123 | top: rect.top, |
| 124 | left: rect.left, |
| 125 | bottom: rect.bottom, |
| 126 | right: rect.right, |
| 127 | width: rect.width, |
| 128 | height: rect.height, |
| 129 | centerX: rect.left + rect.width / 2, |
| 130 | centerY: rect.top + rect.height / 2 |
| 131 | }; |
| 132 | } |
| 133 | |
| 134 | /** |
| 135 | * Extract label text for an element using multiple strategies |
nothing calls this directly
no outgoing calls
no test coverage detected