@vectoriox/iox-builder 1.9.1 → 1.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.
@@ -4254,6 +4254,19 @@ class BuilderComponent {
4254
4254
  this.panOriginY = 0;
4255
4255
  this.hoverHideRaf = 0;
4256
4256
  this.canvasContentHeight = 0;
4257
+ /**
4258
+ * Cancel the browser's default navigation for any link clicked on the editing canvas.
4259
+ *
4260
+ * Bound property (not a method) so add/removeEventListener share one reference. Matches the
4261
+ * clicked target's nearest `a[href]`, so it covers a Link/Button host as well as a click on
4262
+ * anything nested inside a LinkedContainer. Only the DEFAULT action is cancelled — propagation
4263
+ * is untouched, so node selection, the overlay and the context menu all behave normally.
4264
+ */
4265
+ this.blockCanvasNavigation = (event) => {
4266
+ const target = event.target;
4267
+ if (target?.closest?.('a[href]'))
4268
+ event.preventDefault();
4269
+ };
4257
4270
  this._scrollbarTimer = null;
4258
4271
  }
4259
4272
  ngOnInit() {
@@ -4329,6 +4342,16 @@ class BuilderComponent {
4329
4342
  }
4330
4343
  });
4331
4344
  this.canvasRo.observe(canvasEl);
4345
+ // The canvas is an EDITING surface: clicking a Link / LinkedContainer / Button (anything
4346
+ // rendering an <a href>) must select it, never navigate — a redirect unloads the builder
4347
+ // and loses unsaved work. Capture phase so it runs before the node's own click handler,
4348
+ // and canvas-level so it covers EVERY anchor, including repeater/slider preview clones
4349
+ // (RenderDirective skips its per-node listeners for those) and any future link component.
4350
+ // preventDefault only cancels the browser's default navigation — the click still
4351
+ // propagates, so selection/overlay behaviour is unchanged.
4352
+ // `auxclick` covers middle-click, which opens a tab without firing `click`.
4353
+ canvasEl.addEventListener('click', this.blockCanvasNavigation, true);
4354
+ canvasEl.addEventListener('auxclick', this.blockCanvasNavigation, true);
4332
4355
  }
4333
4356
  this.initLenis();
4334
4357
  // Moveable path (flag-gated — interact.js is untouched when off). Drive drag for the selected
@@ -4358,6 +4381,8 @@ class BuilderComponent {
4358
4381
  const canvasEl = document.getElementById('canvas-preview');
4359
4382
  if (canvasEl) {
4360
4383
  this.dragEngine.unregisterDropzone('canvas-preview', canvasEl);
4384
+ canvasEl.removeEventListener('click', this.blockCanvasNavigation, true);
4385
+ canvasEl.removeEventListener('auxclick', this.blockCanvasNavigation, true);
4361
4386
  }
4362
4387
  }
4363
4388
  /**