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.
@@ -1304,6 +1304,9 @@ var tailwind_built_default = `/*! tailwindcss v4.2.2 | MIT License | https://tai
1304
1304
  .w-4 {
1305
1305
  width: calc(var(--spacing) * 4);
1306
1306
  }
1307
+ .w-12 {
1308
+ width: calc(var(--spacing) * 12);
1309
+ }
1307
1310
  .w-20 {
1308
1311
  width: calc(var(--spacing) * 20);
1309
1312
  }
@@ -3485,16 +3488,18 @@ function createCursorTooltip(deps) {
3485
3488
  const renderBody = () => {
3486
3489
  body.replaceChildren();
3487
3490
  if (typeof currentContent === "string") {
3488
- applyColor(DEFAULT_TOOLTIP_COLOR);
3491
+ applyColor("#a1a1aa");
3492
+ el2.style.opacity = "0.6";
3489
3493
  body.append(document.createTextNode(currentContent));
3490
3494
  return;
3491
3495
  }
3492
3496
  if (!currentContent) return;
3497
+ el2.style.opacity = "1";
3493
3498
  const { entity, node } = currentContent;
3494
3499
  const style = KIND_STYLE[entity.kind];
3495
3500
  const demoted = entity.kind === "primitive";
3496
3501
  applyColor(style?.color ?? DEFAULT_TOOLTIP_COLOR);
3497
- el2.style.opacity = demoted ? "0.55" : "1";
3502
+ if (demoted) el2.style.opacity = "0.55";
3498
3503
  if (style) {
3499
3504
  const svg2 = createLucideElement(style.icon);
3500
3505
  svg2.setAttribute("aria-hidden", "true");
@@ -3611,7 +3616,8 @@ function createInspector(options) {
3611
3616
  resolveAll = (target) => defaultResolveAllMatches(target, registry),
3612
3617
  onHover,
3613
3618
  onSelect,
3614
- onCycle
3619
+ onCycle,
3620
+ onObscured
3615
3621
  } = options;
3616
3622
  let mounted = false;
3617
3623
  let currentEl = null;
@@ -3620,6 +3626,13 @@ function createInspector(options) {
3620
3626
  let layerIndex = 0;
3621
3627
  let lastCursor = { x: 0, y: 0 };
3622
3628
  const makeStack = () => stack.length > 0 ? { matches: stack, index: layerIndex, current: stack[layerIndex] } : null;
3629
+ const onDocumentLeave = () => {
3630
+ currentEl = null;
3631
+ stack = [];
3632
+ layerIndex = 0;
3633
+ session.highlight.unhover();
3634
+ onObscured?.(lastCursor);
3635
+ };
3623
3636
  const onMouseMove = (e) => {
3624
3637
  if (!(e.target instanceof Element)) return;
3625
3638
  const matches = resolveAll(e.target);
@@ -3672,6 +3685,7 @@ function createInspector(options) {
3672
3685
  document.head.appendChild(cursorStyleEl);
3673
3686
  }
3674
3687
  document.addEventListener("mousemove", onMouseMove);
3688
+ document.addEventListener("mouseleave", onDocumentLeave);
3675
3689
  document.addEventListener("click", onClick, true);
3676
3690
  document.addEventListener("contextmenu", onContextMenu, true);
3677
3691
  },
@@ -3686,6 +3700,7 @@ function createInspector(options) {
3686
3700
  cursorStyleEl = null;
3687
3701
  }
3688
3702
  document.removeEventListener("mousemove", onMouseMove);
3703
+ document.removeEventListener("mouseleave", onDocumentLeave);
3689
3704
  document.removeEventListener("click", onClick, true);
3690
3705
  document.removeEventListener("contextmenu", onContextMenu, true);
3691
3706
  session.highlight.unhover();
@@ -4593,6 +4608,10 @@ function createSurfaceShell(options) {
4593
4608
  },
4594
4609
  onCycle: (stack, cursor) => {
4595
4610
  showStack(stack, cursor);
4611
+ },
4612
+ onObscured: (cursor) => {
4613
+ overlay.hide();
4614
+ tooltip.update("iframe", cursor);
4596
4615
  }
4597
4616
  });
4598
4617
  cleanup.add(inspector);