@vectoriox/iox-builder 11.9.1 → 11.9.3
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) {
|
|
@@ -5297,6 +5302,10 @@ class SceneCanvasService {
|
|
|
5297
5302
|
this.rootsById.delete(id);
|
|
5298
5303
|
this.idsByRoot.delete(root);
|
|
5299
5304
|
}
|
|
5305
|
+
/** The canvas's Lenis just moved the scroll, inside this frame: hold every stage in this same frame. */
|
|
5306
|
+
pinNow() {
|
|
5307
|
+
this.driver?.pinNow();
|
|
5308
|
+
}
|
|
5300
5309
|
/** The damped progress a root's layers stand at. */
|
|
5301
5310
|
progressOf(root) {
|
|
5302
5311
|
return this.driver?.progressOf(root) ?? null;
|
|
@@ -7956,6 +7965,8 @@ class OverlayComponent {
|
|
|
7956
7965
|
this.activeScrollContainer = el;
|
|
7957
7966
|
el.addEventListener('scroll', this.boundScrollUpdate, { passive: true });
|
|
7958
7967
|
}));
|
|
7968
|
+
// A Scene's driver moved the selected layer: already inside its frame, so the box lands with it.
|
|
7969
|
+
this.subs.push(this.overlayService.reposition$.subscribe(() => this.updateAll()));
|
|
7959
7970
|
// Open the more menu when a canvas element is right-clicked.
|
|
7960
7971
|
this.subs.push(this.overlayService.contextMenu$.subscribe(({ x, y }) => {
|
|
7961
7972
|
this.moreMenuStyle = { top: `${y}px`, left: `${x}px` };
|
|
@@ -9804,11 +9815,12 @@ class BuilderComponent {
|
|
|
9804
9815
|
// would cause Lenis to re-fire its scroll handler → infinite loop.)
|
|
9805
9816
|
this.overlayService.setScrollContainer(this.lenisContentRef?.nativeElement || null);
|
|
9806
9817
|
// A Scene's layer moves with no scroll to announce it (the damping runs on after the wheel stops, a scrubber or an
|
|
9807
|
-
// edit moves it outright), so the selection box follows the driver's frames
|
|
9818
|
+
// edit moves it outright), so the selection box follows the driver's frames. ⚠️ Told directly, never with a synthetic
|
|
9819
|
+
// 'scroll': the driver listens for scroll in capture on the window, so it would wake itself every frame, for ever.
|
|
9808
9820
|
this.sceneFramesSub = this.sceneCanvas?.frames$.subscribe(() => {
|
|
9809
9821
|
if (!this.overlayService.getCurrentSelection())
|
|
9810
9822
|
return;
|
|
9811
|
-
this.
|
|
9823
|
+
this.overlayService.repositionNow();
|
|
9812
9824
|
this.moveableCanvas.refresh();
|
|
9813
9825
|
});
|
|
9814
9826
|
// .preview-scroll is the Lenis clipping container (overflow:hidden, scrollTop changes).
|
|
@@ -9969,6 +9981,8 @@ class BuilderComponent {
|
|
|
9969
9981
|
autoResize: false, // we drive resize() manually via canvasRo + viewportSub
|
|
9970
9982
|
});
|
|
9971
9983
|
this.lenis.on('scroll', (instance) => {
|
|
9984
|
+
// A Scene's stage is held against this very scroll: a frame later, it would paint carried off its pin.
|
|
9985
|
+
this.sceneCanvas?.pinNow();
|
|
9972
9986
|
const clientH = this.previewScrollRef.nativeElement.clientHeight;
|
|
9973
9987
|
this.onPageScroll({
|
|
9974
9988
|
scrollTop: instance.scroll,
|