@vectoriox/iox-builder 1.9.0 → 1.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.
@@ -2239,7 +2239,11 @@ class TypographyGroupStyleConfig extends GroupStyleConfig {
2239
2239
  new TraitConfig('fontSize', 'Font Size', TraitInputType.Scrub, { min: 8, max: 200, step: 1, units: UNITS_ALL }, '16px'),
2240
2240
  new TraitConfig('fontWeight', 'Weight', TraitInputType.Scrub, { min: 100, max: 900, step: 100, units: [''] }, '400'),
2241
2241
  new TraitConfig('color', 'Color', TraitInputType.Color, { allowGradient: false, allowTransparent: false, formats: ['hex', 'rgb', 'hsl'] }, '#000000'),
2242
- new TraitConfig('lineHeight', 'Line Height', TraitInputType.Scrub, { min: 0.5, max: 5, step: 0.05, units: [''] }, '1.5'),
2242
+ // Unitless on purpose (`units: ['']`): a unitless line-height inherits as a RATIO — each
2243
+ // descendant multiplies it by its OWN font-size — whereas `1.5em`/`24px` inherits a fixed
2244
+ // computed length that ignores the child's font-size. min:0 so a line box can be collapsed
2245
+ // completely (icons/glyph-only elements), which `0.5` used to block.
2246
+ new TraitConfig('lineHeight', 'Line Height', TraitInputType.Scrub, { min: 0, max: 5, step: 0.05, units: [''] }, '1.5'),
2243
2247
  new TraitConfig('letterSpacing', 'Spacing', TraitInputType.Scrub, { min: -5, max: 50, step: 0.5, units: UNITS_FIXED }, '0px'),
2244
2248
  new TraitConfig('textAlign', '', TraitInputType.SelectButton, [
2245
2249
  { value: 'left', icon: 'ph-thin ph-text-align-left' },
@@ -4250,6 +4254,19 @@ class BuilderComponent {
4250
4254
  this.panOriginY = 0;
4251
4255
  this.hoverHideRaf = 0;
4252
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
+ };
4253
4270
  this._scrollbarTimer = null;
4254
4271
  }
4255
4272
  ngOnInit() {
@@ -4325,6 +4342,16 @@ class BuilderComponent {
4325
4342
  }
4326
4343
  });
4327
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);
4328
4355
  }
4329
4356
  this.initLenis();
4330
4357
  // Moveable path (flag-gated — interact.js is untouched when off). Drive drag for the selected
@@ -4354,6 +4381,8 @@ class BuilderComponent {
4354
4381
  const canvasEl = document.getElementById('canvas-preview');
4355
4382
  if (canvasEl) {
4356
4383
  this.dragEngine.unregisterDropzone('canvas-preview', canvasEl);
4384
+ canvasEl.removeEventListener('click', this.blockCanvasNavigation, true);
4385
+ canvasEl.removeEventListener('auxclick', this.blockCanvasNavigation, true);
4357
4386
  }
4358
4387
  }
4359
4388
  /**
@@ -7491,10 +7520,10 @@ class BuilderIconComponentConfig extends ComponentConfig {
7491
7520
  fontSize: '24px',
7492
7521
  color: '#374151',
7493
7522
  // An icon is a glyph, not a paragraph — the Typography group's default line-height of
7494
- // 1.5 adds phantom vertical space and misaligns it. Default it to 1 so the box hugs the
7495
- // glyph. Serialized into styleProps (self-describing node), so the builder AND the SSR
7496
- // engine both compile `line-height: 1` — no engine-side special-case needed.
7497
- lineHeight: '1',
7523
+ // 1.5 adds phantom vertical space and misaligns it. Default to 0 so the line box is fully
7524
+ // collapsed and the icon contributes no extra vertical space (spacing comes from
7525
+ // padding/margin instead). Serialized into styleProps (self-describing node).
7526
+ lineHeight: '0',
7498
7527
  });
7499
7528
  }
7500
7529
  }