@hyperframes/inspector 0.8.192 → 0.8.194

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.
@@ -1431,7 +1431,16 @@
1431
1431
  const startCache = /* @__PURE__ */ new WeakMap();
1432
1432
  const durationCache = /* @__PURE__ */ new WeakMap();
1433
1433
  const visiting = /* @__PURE__ */ new Set();
1434
- const findReferenceTarget = (refId) => {
1434
+ const compositionScopeOf = (element) => (element.hasAttribute("data-composition-id") ? element.parentElement : element)?.closest(
1435
+ "[data-composition-id]"
1436
+ ) ?? null;
1437
+ const findReferenceTarget = (refId, from) => {
1438
+ const scope = compositionScopeOf(from);
1439
+ if (scope) {
1440
+ for (const candidate of scope.querySelectorAll(`[id="${refId}"]`)) {
1441
+ if (compositionScopeOf(candidate) === scope) return candidate;
1442
+ }
1443
+ }
1435
1444
  const byId = doc.getElementById(refId);
1436
1445
  if (byId) return byId;
1437
1446
  return Array.from(doc.querySelectorAll("[data-composition-id]")).find(
@@ -1486,7 +1495,7 @@
1486
1495
  if (expression.kind === "absolute") {
1487
1496
  return resolveHostOffsetForElement(element, fallback) + Math.max(0, expression.value);
1488
1497
  }
1489
- const target = findReferenceTarget(expression.refId);
1498
+ const target = findReferenceTarget(expression.refId, element);
1490
1499
  if (!target) return fallback;
1491
1500
  const targetStart = resolveStartForElementInternal(target, 0);
1492
1501
  const targetDuration = resolveDurationForElement(target) ?? 0;