@vectoriox/iox-builder 4.1.0 → 4.1.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.
@@ -5324,6 +5324,8 @@ class BuilderComponent {
5324
5324
  /** Overrides per breakpoint for the selection (or the whole page when nothing is selected) —
5325
5325
  * the breakpoint bar's dots. A field recomputed on change, never a getter (OnPush input). */
5326
5326
  this.breakpointCounts = {};
5327
+ /** Deadline for swallowing the canvas click that completes an overlay action. */
5328
+ this._ignoreCanvasClickUntil = 0;
5327
5329
  this.activeZoom = 100;
5328
5330
  this.activeScreenWidth = 1440;
5329
5331
  this.selectedItem = null;
@@ -5783,6 +5785,16 @@ class BuilderComponent {
5783
5785
  this.hoverHideRaf = requestAnimationFrame(() => this.overlayService.clearHover());
5784
5786
  }
5785
5787
  handleCanvasClick() {
5788
+ // An overlay action (Select parent, Duplicate, …) changes the selection, which RE-RENDERS the
5789
+ // overlay — so the button that got `mousedown` is gone by `mouseup`, and the browser
5790
+ // dispatches the click on the nearest common ancestor: `.preview` itself. It therefore never
5791
+ // passes through <app-overlay>, and stopping propagation there cannot help. Without this
5792
+ // guard that click reads as "clicked empty canvas" and wipes the selection the action just
5793
+ // made (empty breadcrumb; click-to-insert targeting the page).
5794
+ if (Date.now() < this._ignoreCanvasClickUntil) {
5795
+ this._ignoreCanvasClickUntil = 0;
5796
+ return;
5797
+ }
5786
5798
  // Only fires when clicking empty canvas space (renderers call stopPropagation)
5787
5799
  this.selectedItem = null;
5788
5800
  this.selectedPath = [];
@@ -5854,6 +5866,8 @@ class BuilderComponent {
5854
5866
  }
5855
5867
  // ── Toolbar actions ──────────────────────────────────────
5856
5868
  onToolbarAction(event) {
5869
+ // The click completing this action lands on `.preview` (see handleCanvasClick) — ignore it.
5870
+ this._ignoreCanvasClickUntil = Date.now() + 500;
5857
5871
  const { action, entry } = event;
5858
5872
  const node = entry.node;
5859
5873
  if (!node)
@@ -6176,8 +6190,14 @@ class BuilderComponent {
6176
6190
  const ref = this.overlayService.getNodeRef(repeater);
6177
6191
  ref?.componentRef?.instance?.refreshTemplate?.();
6178
6192
  }
6179
- /** Emit ELEMENT_SELECT with the ancestors the panels need (symbol + repeater item scope). */
6193
+ /**
6194
+ * Emit ELEMENT_SELECT with the ancestors the panels need (symbol + repeater item scope).
6195
+ * THE place the builder's own selection is set too — every path that announces a selection goes
6196
+ * through here, so `selectedItem` (breadcrumb, click-to-insert target) can't drift from what the
6197
+ * panels show. "Select parent" used to announce the parent while leaving selectedItem behind.
6198
+ */
6180
6199
  _emitElementSelect(node, componentRef) {
6200
+ this.selectedItem = node;
6181
6201
  const symbolAncestor = this.findSymbolAncestorOf(node, this.layout)
6182
6202
  ?? this.findSymbolAncestorOf(node, this.globalElements);
6183
6203
  const repeaterAncestor = this.findRepeaterAncestorOf(node, this.layout)