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.
@@ -1336,6 +1336,9 @@ var tailwind_built_default = `/*! tailwindcss v4.2.2 | MIT License | https://tai
1336
1336
  .w-4 {
1337
1337
  width: calc(var(--spacing) * 4);
1338
1338
  }
1339
+ .w-12 {
1340
+ width: calc(var(--spacing) * 12);
1341
+ }
1339
1342
  .w-20 {
1340
1343
  width: calc(var(--spacing) * 20);
1341
1344
  }
@@ -3517,16 +3520,18 @@ function createCursorTooltip(deps) {
3517
3520
  const renderBody = () => {
3518
3521
  body.replaceChildren();
3519
3522
  if (typeof currentContent === "string") {
3520
- applyColor(DEFAULT_TOOLTIP_COLOR);
3523
+ applyColor("#a1a1aa");
3524
+ el2.style.opacity = "0.6";
3521
3525
  body.append(document.createTextNode(currentContent));
3522
3526
  return;
3523
3527
  }
3524
3528
  if (!currentContent) return;
3529
+ el2.style.opacity = "1";
3525
3530
  const { entity, node } = currentContent;
3526
3531
  const style = KIND_STYLE[entity.kind];
3527
3532
  const demoted = entity.kind === "primitive";
3528
3533
  applyColor(style?.color ?? DEFAULT_TOOLTIP_COLOR);
3529
- el2.style.opacity = demoted ? "0.55" : "1";
3534
+ if (demoted) el2.style.opacity = "0.55";
3530
3535
  if (style) {
3531
3536
  const svg2 = (0, import_lucide2.createElement)(style.icon);
3532
3537
  svg2.setAttribute("aria-hidden", "true");
@@ -3643,7 +3648,8 @@ function createInspector(options) {
3643
3648
  resolveAll = (target) => defaultResolveAllMatches(target, registry),
3644
3649
  onHover,
3645
3650
  onSelect,
3646
- onCycle
3651
+ onCycle,
3652
+ onObscured
3647
3653
  } = options;
3648
3654
  let mounted = false;
3649
3655
  let currentEl = null;
@@ -3652,6 +3658,13 @@ function createInspector(options) {
3652
3658
  let layerIndex = 0;
3653
3659
  let lastCursor = { x: 0, y: 0 };
3654
3660
  const makeStack = () => stack.length > 0 ? { matches: stack, index: layerIndex, current: stack[layerIndex] } : null;
3661
+ const onDocumentLeave = () => {
3662
+ currentEl = null;
3663
+ stack = [];
3664
+ layerIndex = 0;
3665
+ session.highlight.unhover();
3666
+ onObscured?.(lastCursor);
3667
+ };
3655
3668
  const onMouseMove = (e) => {
3656
3669
  if (!(e.target instanceof Element)) return;
3657
3670
  const matches = resolveAll(e.target);
@@ -3704,6 +3717,7 @@ function createInspector(options) {
3704
3717
  document.head.appendChild(cursorStyleEl);
3705
3718
  }
3706
3719
  document.addEventListener("mousemove", onMouseMove);
3720
+ document.addEventListener("mouseleave", onDocumentLeave);
3707
3721
  document.addEventListener("click", onClick, true);
3708
3722
  document.addEventListener("contextmenu", onContextMenu, true);
3709
3723
  },
@@ -3718,6 +3732,7 @@ function createInspector(options) {
3718
3732
  cursorStyleEl = null;
3719
3733
  }
3720
3734
  document.removeEventListener("mousemove", onMouseMove);
3735
+ document.removeEventListener("mouseleave", onDocumentLeave);
3721
3736
  document.removeEventListener("click", onClick, true);
3722
3737
  document.removeEventListener("contextmenu", onContextMenu, true);
3723
3738
  session.highlight.unhover();
@@ -4616,6 +4631,10 @@ function createSurfaceShell(options) {
4616
4631
  },
4617
4632
  onCycle: (stack, cursor) => {
4618
4633
  showStack(stack, cursor);
4634
+ },
4635
+ onObscured: (cursor) => {
4636
+ overlay.hide();
4637
+ tooltip.update("iframe", cursor);
4619
4638
  }
4620
4639
  });
4621
4640
  cleanup.add(inspector);