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.
@@ -1046,6 +1046,9 @@ var tailwind_built_default = `/*! tailwindcss v4.2.2 | MIT License | https://tai
1046
1046
  .w-4 {
1047
1047
  width: calc(var(--spacing) * 4);
1048
1048
  }
1049
+ .w-12 {
1050
+ width: calc(var(--spacing) * 12);
1051
+ }
1049
1052
  .w-20 {
1050
1053
  width: calc(var(--spacing) * 20);
1051
1054
  }
@@ -3226,16 +3229,18 @@ function createCursorTooltip(deps) {
3226
3229
  const renderBody = () => {
3227
3230
  body.replaceChildren();
3228
3231
  if (typeof currentContent === "string") {
3229
- applyColor(DEFAULT_TOOLTIP_COLOR);
3232
+ applyColor("#a1a1aa");
3233
+ el2.style.opacity = "0.6";
3230
3234
  body.append(document.createTextNode(currentContent));
3231
3235
  return;
3232
3236
  }
3233
3237
  if (!currentContent) return;
3238
+ el2.style.opacity = "1";
3234
3239
  const { entity, node } = currentContent;
3235
3240
  const style = KIND_STYLE[entity.kind];
3236
3241
  const demoted = entity.kind === "primitive";
3237
3242
  applyColor(style?.color ?? DEFAULT_TOOLTIP_COLOR);
3238
- el2.style.opacity = demoted ? "0.55" : "1";
3243
+ if (demoted) el2.style.opacity = "0.55";
3239
3244
  if (style) {
3240
3245
  const svg = (0, import_lucide2.createElement)(style.icon);
3241
3246
  svg.setAttribute("aria-hidden", "true");
@@ -3343,7 +3348,8 @@ function createInspector(options) {
3343
3348
  resolveAll = (target) => defaultResolveAllMatches(target, registry),
3344
3349
  onHover,
3345
3350
  onSelect,
3346
- onCycle
3351
+ onCycle,
3352
+ onObscured
3347
3353
  } = options;
3348
3354
  let mounted = false;
3349
3355
  let currentEl = null;
@@ -3352,6 +3358,13 @@ function createInspector(options) {
3352
3358
  let layerIndex = 0;
3353
3359
  let lastCursor = { x: 0, y: 0 };
3354
3360
  const makeStack = () => stack.length > 0 ? { matches: stack, index: layerIndex, current: stack[layerIndex] } : null;
3361
+ const onDocumentLeave = () => {
3362
+ currentEl = null;
3363
+ stack = [];
3364
+ layerIndex = 0;
3365
+ session.highlight.unhover();
3366
+ onObscured?.(lastCursor);
3367
+ };
3355
3368
  const onMouseMove = (e) => {
3356
3369
  if (!(e.target instanceof Element)) return;
3357
3370
  const matches = resolveAll(e.target);
@@ -3404,6 +3417,7 @@ function createInspector(options) {
3404
3417
  document.head.appendChild(cursorStyleEl);
3405
3418
  }
3406
3419
  document.addEventListener("mousemove", onMouseMove);
3420
+ document.addEventListener("mouseleave", onDocumentLeave);
3407
3421
  document.addEventListener("click", onClick, true);
3408
3422
  document.addEventListener("contextmenu", onContextMenu, true);
3409
3423
  },
@@ -3418,6 +3432,7 @@ function createInspector(options) {
3418
3432
  cursorStyleEl = null;
3419
3433
  }
3420
3434
  document.removeEventListener("mousemove", onMouseMove);
3435
+ document.removeEventListener("mouseleave", onDocumentLeave);
3421
3436
  document.removeEventListener("click", onClick, true);
3422
3437
  document.removeEventListener("contextmenu", onContextMenu, true);
3423
3438
  session.highlight.unhover();
@@ -4194,6 +4209,10 @@ function createSurfaceShell(options) {
4194
4209
  },
4195
4210
  onCycle: (stack, cursor) => {
4196
4211
  showStack(stack, cursor);
4212
+ },
4213
+ onObscured: (cursor) => {
4214
+ overlay.hide();
4215
+ tooltip.update("iframe", cursor);
4197
4216
  }
4198
4217
  });
4199
4218
  cleanup.add(inspector);