@vectoriox/iox-builder 11.9.0 → 11.9.2

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.
@@ -2831,6 +2831,8 @@ class OverlayService {
2831
2831
  this.scrollContainer$ = new Subject();
2832
2832
  /** Emits cursor coords when a canvas element is right-clicked. */
2833
2833
  this.contextMenu$ = new Subject();
2834
+ /** Something selected moved with no scroll to say so: redraw the boxes in this same frame. */
2835
+ this.reposition$ = new Subject();
2834
2836
  /** The From-content row (1-based) a click came from when it selected a TEMPLATE part (CC2), else null. */
2835
2837
  this.selectedRow = null;
2836
2838
  }
@@ -2843,6 +2845,9 @@ class OverlayService {
2843
2845
  getContainer() {
2844
2846
  return this.containerElement;
2845
2847
  }
2848
+ repositionNow() {
2849
+ this.reposition$.next();
2850
+ }
2846
2851
  setScrollContainer(el) {
2847
2852
  this.scrollContainerElement = el;
2848
2853
  if (el) {
@@ -7956,6 +7961,8 @@ class OverlayComponent {
7956
7961
  this.activeScrollContainer = el;
7957
7962
  el.addEventListener('scroll', this.boundScrollUpdate, { passive: true });
7958
7963
  }));
7964
+ // A Scene's driver moved the selected layer: already inside its frame, so the box lands with it.
7965
+ this.subs.push(this.overlayService.reposition$.subscribe(() => this.updateAll()));
7959
7966
  // Open the more menu when a canvas element is right-clicked.
7960
7967
  this.subs.push(this.overlayService.contextMenu$.subscribe(({ x, y }) => {
7961
7968
  this.moreMenuStyle = { top: `${y}px`, left: `${x}px` };
@@ -8363,7 +8370,12 @@ class OverlayComponent {
8363
8370
  updateAll() {
8364
8371
  this.updateHover();
8365
8372
  this.updateSelect();
8366
- this.cdr.markForCheck();
8373
+ // A Scene's driver runs outside Angular's zone, so a layer moves with no tick coming to draw the new box. A local
8374
+ // pass, not a tick for the whole app: this runs on every frame a selected layer moves.
8375
+ if (NgZone.isInAngularZone())
8376
+ this.cdr.markForCheck();
8377
+ else
8378
+ this.cdr.detectChanges();
8367
8379
  }
8368
8380
  updateHover() {
8369
8381
  if (!this.hoverEntry) {
@@ -9799,11 +9811,12 @@ class BuilderComponent {
9799
9811
  // would cause Lenis to re-fire its scroll handler → infinite loop.)
9800
9812
  this.overlayService.setScrollContainer(this.lenisContentRef?.nativeElement || null);
9801
9813
  // A Scene's layer moves with no scroll to announce it (the damping runs on after the wheel stops, a scrubber or an
9802
- // edit moves it outright), so the selection box follows the driver's frames, the same way it follows Lenis's.
9814
+ // edit moves it outright), so the selection box follows the driver's frames. ⚠️ Told directly, never with a synthetic
9815
+ // 'scroll': the driver listens for scroll in capture on the window, so it would wake itself every frame, for ever.
9803
9816
  this.sceneFramesSub = this.sceneCanvas?.frames$.subscribe(() => {
9804
9817
  if (!this.overlayService.getCurrentSelection())
9805
9818
  return;
9806
- this.lenisContentRef?.nativeElement.dispatchEvent(new Event('scroll'));
9819
+ this.overlayService.repositionNow();
9807
9820
  this.moveableCanvas.refresh();
9808
9821
  });
9809
9822
  // .preview-scroll is the Lenis clipping container (overflow:hidden, scrollTop changes).