@vectoriox/iox-builder 11.8.0 → 11.8.1
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.
|
@@ -5262,15 +5262,19 @@ const PREVIEW_SCROLLER = '.iox-page-wrapper';
|
|
|
5262
5262
|
class SceneCanvasService {
|
|
5263
5263
|
constructor() {
|
|
5264
5264
|
this.zone = inject(NgZone);
|
|
5265
|
-
this.onCanvas = inject(IOX_BUILDER_CANVAS, { optional: true }) ?? false;
|
|
5266
5265
|
this.driver = null;
|
|
5267
5266
|
}
|
|
5268
|
-
|
|
5267
|
+
/**
|
|
5268
|
+
* Drive a root. `onCanvas` comes from the caller, because only the render directive can read IOX_BUILDER_CANVAS: the
|
|
5269
|
+
* token is provided on the canvas's element, below where this service lives. Read here, it answered false, and the
|
|
5270
|
+
* canvas measured its Scenes against a page that moves with them, so they never left progress 0.
|
|
5271
|
+
*/
|
|
5272
|
+
attach(root, onCanvas) {
|
|
5269
5273
|
this.zone.runOutsideAngular(() => {
|
|
5270
5274
|
this.driver ??= new ScrollDriver({
|
|
5271
|
-
pin:
|
|
5275
|
+
pin: onCanvas,
|
|
5272
5276
|
observe: true,
|
|
5273
|
-
originOf: el => el.closest(
|
|
5277
|
+
originOf: el => el.closest(onCanvas ? CANVAS_SCROLLER : PREVIEW_SCROLLER),
|
|
5274
5278
|
});
|
|
5275
5279
|
this.driver.add(root);
|
|
5276
5280
|
});
|
|
@@ -5822,7 +5826,7 @@ class RenderDirective {
|
|
|
5822
5826
|
}
|
|
5823
5827
|
// A Scene runs on the canvas: the driver reads the attributes `syncA11y` wrote, and follows edits to them.
|
|
5824
5828
|
if (nativeEl && node.role === SceneRole.Scene && this.sceneCanvas) {
|
|
5825
|
-
this.sceneCanvas.attach(nativeEl);
|
|
5829
|
+
this.sceneCanvas.attach(nativeEl, this.onCanvas);
|
|
5826
5830
|
this.sceneRootEl = nativeEl;
|
|
5827
5831
|
}
|
|
5828
5832
|
// Wire up interactions (animations) after the element is in the DOM. Preview clones are
|