@vectoriox/iox-builder 1.4.75 → 1.4.77
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,11 +1266,8 @@ 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
|
|
1270
|
-
//
|
|
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.
|
|
1269
|
+
// In builder mode: skip only suppressed triggers (pageLoad, scrollProgress).
|
|
1270
|
+
// viewportEnter IS active in builder — elements must be hidden before trigger.
|
|
1274
1271
|
const skipPreState = inBuilder && (ix.trigger === 'pageLoad' || ix.trigger === 'scrollProgress');
|
|
1275
1272
|
if (!skipPreState) {
|
|
1276
1273
|
for (const action of ix.actions) {
|
|
@@ -1447,52 +1444,48 @@ class InteractionEngineService {
|
|
|
1447
1444
|
firedSet.add(key);
|
|
1448
1445
|
this.runActions(node, ix.actions);
|
|
1449
1446
|
};
|
|
1450
|
-
|
|
1451
|
-
//
|
|
1452
|
-
//
|
|
1447
|
+
// IntersectionObserver with no root uses the browser viewport.
|
|
1448
|
+
// It respects overflow:hidden clipping from .preview-scroll so it fires
|
|
1449
|
+
// correctly as Lenis scrolls (Lenis changes scrollTop on .preview-scroll).
|
|
1453
1450
|
const observer = new IntersectionObserver((entries) => {
|
|
1454
1451
|
for (const entry of entries) {
|
|
1455
1452
|
if (entry.isIntersecting) {
|
|
1456
|
-
|
|
1453
|
+
cleanup();
|
|
1457
1454
|
fire();
|
|
1458
1455
|
}
|
|
1459
1456
|
}
|
|
1460
1457
|
}, { threshold: 0.1 });
|
|
1461
1458
|
observer.observe(element);
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
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
|
-
};
|
|
1459
|
+
// Builder: also listen to Lenis scroll events on .preview-lenis-content
|
|
1460
|
+
// as a fallback in case IntersectionObserver misses elements behind a
|
|
1461
|
+
// CSS transform (scale) on iox-page-component.
|
|
1462
|
+
const lenisEl = this.overlayService.getScrollContainer();
|
|
1477
1463
|
let scrollFired = false;
|
|
1478
|
-
const
|
|
1464
|
+
const onScroll = () => {
|
|
1479
1465
|
if (scrollFired)
|
|
1480
1466
|
return;
|
|
1481
|
-
|
|
1467
|
+
const rootEl = this.overlayService.getIntersectionRoot();
|
|
1468
|
+
if (!rootEl)
|
|
1469
|
+
return;
|
|
1470
|
+
const rootRect = rootEl.getBoundingClientRect();
|
|
1471
|
+
const elRect = element.getBoundingClientRect();
|
|
1472
|
+
const overlapH = Math.min(elRect.bottom, rootRect.bottom) - Math.max(elRect.top, rootRect.top);
|
|
1473
|
+
const elH = elRect.bottom - elRect.top;
|
|
1474
|
+
if (elH > 0 && overlapH / elH >= 0.1) {
|
|
1482
1475
|
scrollFired = true;
|
|
1483
|
-
|
|
1476
|
+
cleanup();
|
|
1484
1477
|
fire();
|
|
1485
1478
|
}
|
|
1486
1479
|
};
|
|
1487
|
-
const lenisEl = this.overlayService.getScrollContainer();
|
|
1488
1480
|
if (lenisEl)
|
|
1489
|
-
lenisEl.addEventListener('scroll',
|
|
1490
|
-
|
|
1491
|
-
scrollFired = true;
|
|
1481
|
+
lenisEl.addEventListener('scroll', onScroll, { passive: true });
|
|
1482
|
+
const cleanup = () => {
|
|
1492
1483
|
observer.disconnect();
|
|
1484
|
+
scrollFired = true;
|
|
1493
1485
|
if (lenisEl)
|
|
1494
|
-
lenisEl.removeEventListener('scroll',
|
|
1486
|
+
lenisEl.removeEventListener('scroll', onScroll);
|
|
1495
1487
|
};
|
|
1488
|
+
return cleanup;
|
|
1496
1489
|
}
|
|
1497
1490
|
isBuilderMode() {
|
|
1498
1491
|
return document.body.classList.contains('builder-active');
|
|
@@ -1638,9 +1631,9 @@ class InteractionEngineService {
|
|
|
1638
1631
|
* trigger fires. Called for ALL entrance-type actions regardless of trigger so
|
|
1639
1632
|
* that a click-triggered fadeIn on a menu overlay also starts it hidden.
|
|
1640
1633
|
*
|
|
1641
|
-
*
|
|
1642
|
-
*
|
|
1643
|
-
*
|
|
1634
|
+
* In production also sets pointer-events:none. In builder mode pointer-events
|
|
1635
|
+
* are left as-is so wheel events still reach the Lenis scroll container;
|
|
1636
|
+
* the data-iox-hidden guard in render.directive.ts prevents overlay selection.
|
|
1644
1637
|
*/
|
|
1645
1638
|
applyPreState(element, action) {
|
|
1646
1639
|
const { keyframes } = this.buildAnimation(action);
|
|
@@ -1650,10 +1643,10 @@ class InteractionEngineService {
|
|
|
1650
1643
|
for (const [prop, val] of Object.entries(first)) {
|
|
1651
1644
|
element.style[prop] = String(val);
|
|
1652
1645
|
}
|
|
1653
|
-
// Mark as hidden so the builder overlay and drag engine can ignore this element
|
|
1654
|
-
// and all of its children regardless of which entrance animation type is used.
|
|
1655
1646
|
element.setAttribute('data-iox-hidden', '');
|
|
1656
|
-
|
|
1647
|
+
if (!this.isBuilderMode()) {
|
|
1648
|
+
element.style.setProperty('pointer-events', 'none');
|
|
1649
|
+
}
|
|
1657
1650
|
this.preStatedElements.add(element);
|
|
1658
1651
|
}
|
|
1659
1652
|
clearInlineAnimationStyles(element) {
|