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.
@@ -1029,6 +1029,9 @@ var tailwind_built_default = `/*! tailwindcss v4.2.2 | MIT License | https://tai
1029
1029
  .w-4 {
1030
1030
  width: calc(var(--spacing) * 4);
1031
1031
  }
1032
+ .w-12 {
1033
+ width: calc(var(--spacing) * 12);
1034
+ }
1032
1035
  .w-20 {
1033
1036
  width: calc(var(--spacing) * 20);
1034
1037
  }
@@ -3209,16 +3212,18 @@ function createCursorTooltip(deps) {
3209
3212
  const renderBody = () => {
3210
3213
  body.replaceChildren();
3211
3214
  if (typeof currentContent === "string") {
3212
- applyColor(DEFAULT_TOOLTIP_COLOR);
3215
+ applyColor("#a1a1aa");
3216
+ el2.style.opacity = "0.6";
3213
3217
  body.append(document.createTextNode(currentContent));
3214
3218
  return;
3215
3219
  }
3216
3220
  if (!currentContent) return;
3221
+ el2.style.opacity = "1";
3217
3222
  const { entity, node } = currentContent;
3218
3223
  const style = KIND_STYLE[entity.kind];
3219
3224
  const demoted = entity.kind === "primitive";
3220
3225
  applyColor(style?.color ?? DEFAULT_TOOLTIP_COLOR);
3221
- el2.style.opacity = demoted ? "0.55" : "1";
3226
+ if (demoted) el2.style.opacity = "0.55";
3222
3227
  if (style) {
3223
3228
  const svg = createLucideElement(style.icon);
3224
3229
  svg.setAttribute("aria-hidden", "true");
@@ -3326,7 +3331,8 @@ function createInspector(options) {
3326
3331
  resolveAll = (target) => defaultResolveAllMatches(target, registry),
3327
3332
  onHover,
3328
3333
  onSelect,
3329
- onCycle
3334
+ onCycle,
3335
+ onObscured
3330
3336
  } = options;
3331
3337
  let mounted = false;
3332
3338
  let currentEl = null;
@@ -3335,6 +3341,13 @@ function createInspector(options) {
3335
3341
  let layerIndex = 0;
3336
3342
  let lastCursor = { x: 0, y: 0 };
3337
3343
  const makeStack = () => stack.length > 0 ? { matches: stack, index: layerIndex, current: stack[layerIndex] } : null;
3344
+ const onDocumentLeave = () => {
3345
+ currentEl = null;
3346
+ stack = [];
3347
+ layerIndex = 0;
3348
+ session.highlight.unhover();
3349
+ onObscured?.(lastCursor);
3350
+ };
3338
3351
  const onMouseMove = (e) => {
3339
3352
  if (!(e.target instanceof Element)) return;
3340
3353
  const matches = resolveAll(e.target);
@@ -3387,6 +3400,7 @@ function createInspector(options) {
3387
3400
  document.head.appendChild(cursorStyleEl);
3388
3401
  }
3389
3402
  document.addEventListener("mousemove", onMouseMove);
3403
+ document.addEventListener("mouseleave", onDocumentLeave);
3390
3404
  document.addEventListener("click", onClick, true);
3391
3405
  document.addEventListener("contextmenu", onContextMenu, true);
3392
3406
  },
@@ -3401,6 +3415,7 @@ function createInspector(options) {
3401
3415
  cursorStyleEl = null;
3402
3416
  }
3403
3417
  document.removeEventListener("mousemove", onMouseMove);
3418
+ document.removeEventListener("mouseleave", onDocumentLeave);
3404
3419
  document.removeEventListener("click", onClick, true);
3405
3420
  document.removeEventListener("contextmenu", onContextMenu, true);
3406
3421
  session.highlight.unhover();
@@ -4186,6 +4201,10 @@ function createSurfaceShell(options) {
4186
4201
  },
4187
4202
  onCycle: (stack, cursor) => {
4188
4203
  showStack(stack, cursor);
4204
+ },
4205
+ onObscured: (cursor) => {
4206
+ overlay.hide();
4207
+ tooltip.update("iframe", cursor);
4189
4208
  }
4190
4209
  });
4191
4210
  cleanup.add(inspector);