uidex 0.5.0 → 0.5.2

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.
package/dist/index.cjs CHANGED
@@ -1379,6 +1379,9 @@ var tailwind_built_default = `/*! tailwindcss v4.2.2 | MIT License | https://tai
1379
1379
  .w-4 {
1380
1380
  width: calc(var(--spacing) * 4);
1381
1381
  }
1382
+ .w-12 {
1383
+ width: calc(var(--spacing) * 12);
1384
+ }
1382
1385
  .w-20 {
1383
1386
  width: calc(var(--spacing) * 20);
1384
1387
  }
@@ -3560,16 +3563,18 @@ function createCursorTooltip(deps) {
3560
3563
  const renderBody = () => {
3561
3564
  body.replaceChildren();
3562
3565
  if (typeof currentContent === "string") {
3563
- applyColor(DEFAULT_TOOLTIP_COLOR);
3566
+ applyColor("#a1a1aa");
3567
+ el2.style.opacity = "0.6";
3564
3568
  body.append(document.createTextNode(currentContent));
3565
3569
  return;
3566
3570
  }
3567
3571
  if (!currentContent) return;
3572
+ el2.style.opacity = "1";
3568
3573
  const { entity, node } = currentContent;
3569
3574
  const style = KIND_STYLE[entity.kind];
3570
3575
  const demoted = entity.kind === "primitive";
3571
3576
  applyColor(style?.color ?? DEFAULT_TOOLTIP_COLOR);
3572
- el2.style.opacity = demoted ? "0.55" : "1";
3577
+ if (demoted) el2.style.opacity = "0.55";
3573
3578
  if (style) {
3574
3579
  const svg2 = (0, import_lucide2.createElement)(style.icon);
3575
3580
  svg2.setAttribute("aria-hidden", "true");
@@ -3730,7 +3735,8 @@ function createInspector(options) {
3730
3735
  resolveAll = (target) => defaultResolveAllMatches(target, registry),
3731
3736
  onHover,
3732
3737
  onSelect,
3733
- onCycle
3738
+ onCycle,
3739
+ onObscured
3734
3740
  } = options;
3735
3741
  let mounted = false;
3736
3742
  let currentEl = null;
@@ -3739,6 +3745,13 @@ function createInspector(options) {
3739
3745
  let layerIndex = 0;
3740
3746
  let lastCursor = { x: 0, y: 0 };
3741
3747
  const makeStack = () => stack.length > 0 ? { matches: stack, index: layerIndex, current: stack[layerIndex] } : null;
3748
+ const onDocumentLeave = () => {
3749
+ currentEl = null;
3750
+ stack = [];
3751
+ layerIndex = 0;
3752
+ session.highlight.unhover();
3753
+ onObscured?.(lastCursor);
3754
+ };
3742
3755
  const onMouseMove = (e) => {
3743
3756
  if (!(e.target instanceof Element)) return;
3744
3757
  const matches = resolveAll(e.target);
@@ -3791,6 +3804,7 @@ function createInspector(options) {
3791
3804
  document.head.appendChild(cursorStyleEl);
3792
3805
  }
3793
3806
  document.addEventListener("mousemove", onMouseMove);
3807
+ document.addEventListener("mouseleave", onDocumentLeave);
3794
3808
  document.addEventListener("click", onClick, true);
3795
3809
  document.addEventListener("contextmenu", onContextMenu, true);
3796
3810
  },
@@ -3805,6 +3819,7 @@ function createInspector(options) {
3805
3819
  cursorStyleEl = null;
3806
3820
  }
3807
3821
  document.removeEventListener("mousemove", onMouseMove);
3822
+ document.removeEventListener("mouseleave", onDocumentLeave);
3808
3823
  document.removeEventListener("click", onClick, true);
3809
3824
  document.removeEventListener("contextmenu", onContextMenu, true);
3810
3825
  session.highlight.unhover();
@@ -4703,6 +4718,10 @@ function createSurfaceShell(options) {
4703
4718
  },
4704
4719
  onCycle: (stack, cursor) => {
4705
4720
  showStack(stack, cursor);
4721
+ },
4722
+ onObscured: (cursor) => {
4723
+ overlay.hide();
4724
+ tooltip.update("iframe", cursor);
4706
4725
  }
4707
4726
  });
4708
4727
  cleanup.add(inspector);