@vectoriox/iox-builder 1.4.75 → 1.4.76

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.
@@ -1266,12 +1266,11 @@ class InteractionEngineService {
1266
1266
  const cleanups = [];
1267
1267
  for (const ix of node.interactions) {
1268
1268
  // Pre-state: hide target elements before their entrance animation fires.
1269
- // In builder mode: skip pre-state only for pageLoad and scrollProgress —
1270
- // those triggers are suppressed in the canvas so elements would stay hidden.
1271
- // viewportEnter uses IntersectionObserver with .preview-scroll as its root,
1272
- // so it fires correctly when the canvas scrolls — pre-state is safe to apply.
1273
- // Click/hover triggers are always active so their pre-state is applied too.
1274
- const skipPreState = inBuilder && (ix.trigger === 'pageLoad' || ix.trigger === 'scrollProgress');
1269
+ // In builder mode: skip pre-state for auto-fire triggers that either are
1270
+ // suppressed (pageLoad, scrollProgress) or use a Lenis scroll container
1271
+ // where pointer-events:none on canvas elements breaks wheel event routing
1272
+ // (viewportEnter). Click/hover triggers are always active.
1273
+ const skipPreState = inBuilder && ix.trigger !== 'click' && ix.trigger !== 'hover';
1275
1274
  if (!skipPreState) {
1276
1275
  for (const action of ix.actions) {
1277
1276
  if (this.ENTRANCE_TYPES.has(action.type)) {
@@ -1447,9 +1446,6 @@ class InteractionEngineService {
1447
1446
  firedSet.add(key);
1448
1447
  this.runActions(node, ix.actions);
1449
1448
  };
1450
- const canvasRoot = this.overlayService.getIntersectionRoot();
1451
- // IntersectionObserver (browser viewport, no root) fires immediately for elements
1452
- // already visible in the canvas frame. Works for initial above-fold detection.
1453
1449
  const observer = new IntersectionObserver((entries) => {
1454
1450
  for (const entry of entries) {
1455
1451
  if (entry.isIntersecting) {
@@ -1459,40 +1455,7 @@ class InteractionEngineService {
1459
1455
  }
1460
1456
  }, { threshold: 0.1 });
1461
1457
  observer.observe(element);
1462
- if (!canvasRoot) {
1463
- // Production mode: IntersectionObserver alone is sufficient.
1464
- return () => observer.disconnect();
1465
- }
1466
- // Builder mode: Lenis scrolls .preview-scroll via scrollTop on an overflow:hidden
1467
- // element. Browsers may not re-trigger IntersectionObserver when scrollTop changes
1468
- // on a non-scroll-container. Add a manual BoundingClientRect check on every Lenis
1469
- // scroll frame (dispatched as a native 'scroll' event on .preview-lenis-content).
1470
- const isInCanvasViewport = () => {
1471
- const rootRect = canvasRoot.getBoundingClientRect();
1472
- const elRect = element.getBoundingClientRect();
1473
- const overlapH = Math.min(elRect.bottom, rootRect.bottom) - Math.max(elRect.top, rootRect.top);
1474
- const elH = elRect.bottom - elRect.top;
1475
- return elH > 0 && overlapH / elH >= 0.1;
1476
- };
1477
- let scrollFired = false;
1478
- const onLenisScroll = () => {
1479
- if (scrollFired)
1480
- return;
1481
- if (isInCanvasViewport()) {
1482
- scrollFired = true;
1483
- observer.disconnect();
1484
- fire();
1485
- }
1486
- };
1487
- const lenisEl = this.overlayService.getScrollContainer();
1488
- if (lenisEl)
1489
- lenisEl.addEventListener('scroll', onLenisScroll, { passive: true });
1490
- return () => {
1491
- scrollFired = true;
1492
- observer.disconnect();
1493
- if (lenisEl)
1494
- lenisEl.removeEventListener('scroll', onLenisScroll);
1495
- };
1458
+ return () => observer.disconnect();
1496
1459
  }
1497
1460
  isBuilderMode() {
1498
1461
  return document.body.classList.contains('builder-active');