@vectoriox/iox-builder 2.0.3 → 2.0.4

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.
@@ -4454,16 +4454,21 @@ class BuilderComponent {
4454
4454
  }
4455
4455
  });
4456
4456
  this.canvasRo.observe(canvasEl);
4457
- // The canvas is an EDITING surface: clicking a Link / LinkedContainer / Button (anything
4458
- // rendering an <a href>) must select it, never navigate — a redirect unloads the builder
4459
- // and loses unsaved work. Capture phase so it runs before the node's own click handler,
4460
- // and canvas-level so it covers EVERY anchor, including repeater/slider preview clones
4461
- // (RenderDirective skips its per-node listeners for those) and any future link component.
4462
- // preventDefault only cancels the browser's default navigation — the click still
4463
- // propagates, so selection/overlay behaviour is unchanged.
4464
- // `auxclick` covers middle-click, which opens a tab without firing `click`.
4465
- canvasEl.addEventListener('click', this.blockCanvasNavigation, true);
4466
- canvasEl.addEventListener('auxclick', this.blockCanvasNavigation, true);
4457
+ }
4458
+ // The canvas is an EDITING surface: clicking a Link / LinkedContainer / Button (anything
4459
+ // rendering an <a href>) must select it, never navigate — a redirect unloads the builder and
4460
+ // loses unsaved work. Bound to `.preview` (NOT #canvas-preview) so it also covers the
4461
+ // GLOBAL-elements overlay, which is a SIBLING layer outside the page canvas — a linked
4462
+ // container in a global header used to slip past the old canvas-only guard and navigate.
4463
+ // Capture phase so it runs before the node's own click handler; it covers EVERY anchor,
4464
+ // including repeater/slider preview clones (RenderDirective skips their per-node listeners)
4465
+ // and any future link component. preventDefault only cancels default navigation — the click
4466
+ // still propagates, so selection/overlay behaviour is unchanged. `auxclick` covers
4467
+ // middle-click, which opens a tab without firing `click`.
4468
+ const previewEl = this.previewCanvas?.nativeElement;
4469
+ if (previewEl) {
4470
+ previewEl.addEventListener('click', this.blockCanvasNavigation, true);
4471
+ previewEl.addEventListener('auxclick', this.blockCanvasNavigation, true);
4467
4472
  }
4468
4473
  this.initLenis();
4469
4474
  // Moveable path (flag-gated — interact.js is untouched when off). Drive drag for the selected
@@ -4513,8 +4518,11 @@ class BuilderComponent {
4513
4518
  const canvasEl = document.getElementById('canvas-preview');
4514
4519
  if (canvasEl) {
4515
4520
  this.dragEngine.unregisterDropzone('canvas-preview', canvasEl);
4516
- canvasEl.removeEventListener('click', this.blockCanvasNavigation, true);
4517
- canvasEl.removeEventListener('auxclick', this.blockCanvasNavigation, true);
4521
+ }
4522
+ const previewEl = this.previewCanvas?.nativeElement;
4523
+ if (previewEl) {
4524
+ previewEl.removeEventListener('click', this.blockCanvasNavigation, true);
4525
+ previewEl.removeEventListener('auxclick', this.blockCanvasNavigation, true);
4518
4526
  }
4519
4527
  }
4520
4528
  /**