@vectoriox/iox-builder 1.7.9 → 1.7.10
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.
|
@@ -1466,10 +1466,10 @@ class InteractionEngineService {
|
|
|
1466
1466
|
attachPageLoad(node, ix, element) {
|
|
1467
1467
|
const timer = setTimeout(() => {
|
|
1468
1468
|
if (this.hasPreStatedAncestor(element)) {
|
|
1469
|
-
this.deferUntilVisible(element, () => this.runActions(node, ix.actions));
|
|
1469
|
+
this.deferUntilVisible(element, () => this.runActions(node, ix.actions, element));
|
|
1470
1470
|
}
|
|
1471
1471
|
else {
|
|
1472
|
-
this.runActions(node, ix.actions);
|
|
1472
|
+
this.runActions(node, ix.actions, element);
|
|
1473
1473
|
}
|
|
1474
1474
|
}, 50);
|
|
1475
1475
|
return () => clearTimeout(timer);
|
|
@@ -1485,12 +1485,12 @@ class InteractionEngineService {
|
|
|
1485
1485
|
if (ix.actions.some(a => a.once) && firedSet.has(key))
|
|
1486
1486
|
return;
|
|
1487
1487
|
firedSet.add(key);
|
|
1488
|
-
this.runActions(node, ix.actions);
|
|
1488
|
+
this.runActions(node, ix.actions, element);
|
|
1489
1489
|
});
|
|
1490
1490
|
return;
|
|
1491
1491
|
}
|
|
1492
1492
|
firedSet.add(key);
|
|
1493
|
-
this.runActions(node, ix.actions);
|
|
1493
|
+
this.runActions(node, ix.actions, element);
|
|
1494
1494
|
};
|
|
1495
1495
|
// IntersectionObserver with no root uses the browser viewport.
|
|
1496
1496
|
// It respects overflow:hidden clipping from .preview-scroll so it fires
|
|
@@ -1565,22 +1565,22 @@ class InteractionEngineService {
|
|
|
1565
1565
|
if (ix.reverseActions?.length) {
|
|
1566
1566
|
// Toggle: alternate between primary and reverse actions on each click.
|
|
1567
1567
|
const isToggled = this.toggleStates.get(ix.id) ?? false;
|
|
1568
|
-
this.runActions(node, isToggled ? ix.reverseActions : ix.actions);
|
|
1568
|
+
this.runActions(node, isToggled ? ix.reverseActions : ix.actions, element);
|
|
1569
1569
|
this.toggleStates.set(ix.id, !isToggled);
|
|
1570
1570
|
}
|
|
1571
1571
|
else {
|
|
1572
|
-
this.runActions(node, ix.actions);
|
|
1572
|
+
this.runActions(node, ix.actions, element);
|
|
1573
1573
|
}
|
|
1574
1574
|
};
|
|
1575
1575
|
element.addEventListener('click', handler);
|
|
1576
1576
|
return () => element.removeEventListener('click', handler);
|
|
1577
1577
|
}
|
|
1578
1578
|
attachHover(node, ix, element) {
|
|
1579
|
-
const enterHandler = () => this.runActions(node, ix.actions);
|
|
1579
|
+
const enterHandler = () => this.runActions(node, ix.actions, element);
|
|
1580
1580
|
const leaveHandler = () => {
|
|
1581
1581
|
// Reverse animations on leave for hover triggers
|
|
1582
1582
|
for (const action of ix.actions) {
|
|
1583
|
-
const target = this.resolveTarget(node, action);
|
|
1583
|
+
const target = this.resolveTarget(node, action, element);
|
|
1584
1584
|
if (!target)
|
|
1585
1585
|
continue;
|
|
1586
1586
|
this.reverseAction(target, action);
|
|
@@ -1594,13 +1594,15 @@ class InteractionEngineService {
|
|
|
1594
1594
|
};
|
|
1595
1595
|
}
|
|
1596
1596
|
// ── Actions ──────────────────────────────────────────────
|
|
1597
|
-
runActions(node, actions) {
|
|
1597
|
+
runActions(node, actions, selfEl) {
|
|
1598
1598
|
for (const action of actions) {
|
|
1599
1599
|
if (this.SWIPER_ACTIONS.has(action.type)) {
|
|
1600
1600
|
this.executeSwiperAction(action);
|
|
1601
1601
|
continue;
|
|
1602
1602
|
}
|
|
1603
|
-
|
|
1603
|
+
// selfEl lets 'self'-targeted actions resolve for preview CLONES, which aren't
|
|
1604
|
+
// overlay-registered (getNodeRef would return undefined) — see attachTo. (issue #2)
|
|
1605
|
+
const target = this.resolveTarget(node, action, selfEl);
|
|
1604
1606
|
if (!target)
|
|
1605
1607
|
continue;
|
|
1606
1608
|
this.executeAction(target, action);
|