dev-tooltip 1.1.4 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -25,13 +25,16 @@ export function devTooltipDev(prefix = "debug_") {
25
25
  border-radius: 4px;
26
26
  z-index: 9999;
27
27
  pointer-events: none;
28
+ white-space: nowrap;
28
29
  \`;
29
30
 
30
31
  document.body.appendChild(tooltip);
31
32
 
32
33
  const move = (ev) => {
33
- tooltip.style.left = ev.clientX + 10 + "px";
34
- tooltip.style.top = ev.clientY + 10 + "px";
34
+ const tooltipHeight = tooltip.offsetHeight;
35
+
36
+ tooltip.style.left = ev.clientX + 10 + "px"; // right of cursor
37
+ tooltip.style.top = ev.clientY - tooltipHeight - 10 + "px"; // above cursor
35
38
  };
36
39
 
37
40
  document.addEventListener("mousemove", move);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dev-tooltip",
3
- "version": "1.1.4",
3
+ "version": "1.2.0",
4
4
  "description": "Dev-only tooltips using debug_* attributes, stripped from production builds",
5
5
  "type": "module",
6
6
  "main": "index.js",