@vectoriox/iox-builder 1.5.6 → 1.5.7
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable, inject, EventEmitter, Output, Input, Directive, ChangeDetectionStrategy, Component, ViewChild, Optional, Inject, InjectionToken, ContentChildren, NO_ERRORS_SCHEMA, NgModule } from '@angular/core';
|
|
2
|
+
import { Injectable, inject, NgZone, EventEmitter, Output, Input, Directive, ChangeDetectionStrategy, Component, ViewChild, Optional, Inject, InjectionToken, ContentChildren, NO_ERRORS_SCHEMA, NgModule } from '@angular/core';
|
|
3
3
|
import * as i2 from '@angular/common';
|
|
4
4
|
import { CommonModule } from '@angular/common';
|
|
5
5
|
import * as i4$1 from '@angular/forms';
|
|
@@ -1243,9 +1243,21 @@ class InteractionEngineService {
|
|
|
1243
1243
|
'swiperAutoplayStart', 'swiperAutoplayStop', 'swiperAutoplayPause',
|
|
1244
1244
|
]);
|
|
1245
1245
|
this.instanceRegistry = inject(ComponentInstanceRegistryService);
|
|
1246
|
+
this.ngZone = inject(NgZone);
|
|
1247
|
+
}
|
|
1248
|
+
/**
|
|
1249
|
+
* Run all DOM-manipulation operations (pre-state, observers, animations)
|
|
1250
|
+
* outside the Angular zone so Zone.js does not schedule unnecessary CD ticks
|
|
1251
|
+
* for each RAF/IntersectionObserver/animation callback.
|
|
1252
|
+
* The caller is responsible for calling markForCheck() / refreshSelect() inside
|
|
1253
|
+
* the zone after this returns.
|
|
1254
|
+
*/
|
|
1255
|
+
runOutside(fn) {
|
|
1256
|
+
return this.ngZone.runOutsideAngular(fn);
|
|
1246
1257
|
}
|
|
1247
1258
|
/** Wire all interactions for a node to its rendered DOM element. */
|
|
1248
|
-
attach(node) {
|
|
1259
|
+
attach(node) { this.runOutside(() => this._attach(node)); }
|
|
1260
|
+
_attach(node) {
|
|
1249
1261
|
const ref = this.overlayService.getNodeRef(node);
|
|
1250
1262
|
if (!ref)
|
|
1251
1263
|
return;
|
|
@@ -1290,7 +1302,8 @@ class InteractionEngineService {
|
|
|
1290
1302
|
this.attached.set(node, cleanups);
|
|
1291
1303
|
}
|
|
1292
1304
|
/** Tear down all interaction listeners for a node and reset its animated state. */
|
|
1293
|
-
detach(node) {
|
|
1305
|
+
detach(node) { this.runOutside(() => this._detach(node)); }
|
|
1306
|
+
_detach(node) {
|
|
1294
1307
|
const entries = this.attached.get(node);
|
|
1295
1308
|
if (!entries)
|
|
1296
1309
|
return;
|
|
@@ -1341,15 +1354,15 @@ class InteractionEngineService {
|
|
|
1341
1354
|
}
|
|
1342
1355
|
/** Re-attach interactions after they have been edited in the panel. */
|
|
1343
1356
|
refresh(node) {
|
|
1344
|
-
this.
|
|
1345
|
-
this.attach(node);
|
|
1357
|
+
this.runOutside(() => { this._detach(node); this._attach(node); });
|
|
1346
1358
|
}
|
|
1347
1359
|
/**
|
|
1348
1360
|
* Replay all interactions on a node immediately, regardless of their trigger.
|
|
1349
1361
|
* Used by the builder overlay play button for in-editor animation preview.
|
|
1350
1362
|
* Uses fill:'none' so the element returns to its natural state after the preview.
|
|
1351
1363
|
*/
|
|
1352
|
-
replay(node) {
|
|
1364
|
+
replay(node) { this.runOutside(() => this._replay(node)); }
|
|
1365
|
+
_replay(node) {
|
|
1353
1366
|
if (!node.interactions?.length)
|
|
1354
1367
|
return;
|
|
1355
1368
|
const ref = this.overlayService.getNodeRef(node);
|
|
@@ -1379,7 +1392,8 @@ class InteractionEngineService {
|
|
|
1379
1392
|
* Used by Swiper (and future components) to dispatch their events into the
|
|
1380
1393
|
* interaction engine without coupling to the engine's attach/detach lifecycle.
|
|
1381
1394
|
*/
|
|
1382
|
-
replayTrigger(nodeId, trigger) {
|
|
1395
|
+
replayTrigger(nodeId, trigger) { this.runOutside(() => this._replayTrigger(nodeId, trigger)); }
|
|
1396
|
+
_replayTrigger(nodeId, trigger) {
|
|
1383
1397
|
for (const [node] of this.attached) {
|
|
1384
1398
|
if (node.id !== nodeId)
|
|
1385
1399
|
continue;
|