(pointer)
| 323 | } |
| 324 | |
| 325 | updateDrag(pointer) { |
| 326 | const { ghost } = this.dragState; |
| 327 | ghost.style.left = pointer.clientX + "px"; |
| 328 | ghost.style.top = pointer.clientY + "px"; |
| 329 | |
| 330 | const elementBelow = document.elementFromPoint( |
| 331 | pointer.clientX, |
| 332 | pointer.clientY, |
| 333 | ); |
| 334 | |
| 335 | this.cleanupHighlight(); |
| 336 | |
| 337 | const targetItem = elementBelow?.closest(".tool-item"); |
| 338 | if (targetItem && targetItem.dataset.type === "active") { |
| 339 | targetItem.classList.add("highlight-target"); |
| 340 | this.dragState.dropTarget = targetItem; |
| 341 | } else { |
| 342 | this.dragState.dropTarget = null; |
| 343 | } |
| 344 | } |
| 345 | |
| 346 | cleanupHighlight() { |
| 347 | const highlighted = this.container.querySelectorAll(".highlight-target"); |
no test coverage detected