@vectoriox/iox-builder 4.18.3 → 4.19.0

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.
@@ -872,6 +872,13 @@ var PanelEventTypes;
872
872
  * would (`string` component type, or a block / symbol object). The builder resolves WHERE from
873
873
  * the current selection — see `resolveInsertTarget`. */
874
874
  PanelEventTypes["INSERT_COMPONENT"] = "insertcomponent";
875
+ /** A panel wants to select a NODE it already has a reference to (e.g. the Form's nested field
876
+ * list). Carries `{ node }`. `OverlayService.setSelect()` alone only updates the overlay's own
877
+ * visual state — `selectedItem`/`selectedPath` (breadcrumb) and every other panel's idea of
878
+ * "what's selected" stay stale unless the SAME `_emitElementSelect` a real canvas click goes
879
+ * through also runs. This event is that path for code outside `BuilderComponent` itself,
880
+ * mirroring what `onTreeNodeSelect`/`onCrumbSelect` already do internally. */
881
+ PanelEventTypes["SELECT_NODE"] = "selectnode";
875
882
  })(PanelEventTypes || (PanelEventTypes = {}));
876
883
  class PanelEventService {
877
884
  constructor() {
@@ -7077,6 +7084,19 @@ class BuilderComponent {
7077
7084
  this.insertFromPanel(panelEvent.data);
7078
7085
  return;
7079
7086
  }
7087
+ // A panel (e.g. the Form's nested field list) wants to select a node it already holds a
7088
+ // reference to — same path onTreeNodeSelect/onCrumbSelect use, so selectedItem/selectedPath
7089
+ // and every panel stay in sync, not just the overlay's own visual selection box.
7090
+ if (panelEvent.type === PanelEventTypes.SELECT_NODE) {
7091
+ const node = panelEvent.data?.node;
7092
+ const ref = node ? this.overlayService.getNodeRef(node) : undefined;
7093
+ if (node && ref) {
7094
+ this.selectedItem = node;
7095
+ this.overlayService.setSelect(ref.element, node.type, this.activeMode, node, ref.componentRef);
7096
+ this._emitElementSelect(node, ref.componentRef);
7097
+ }
7098
+ return;
7099
+ }
7080
7100
  // Every style or structural edit — including a breakpoint override — emits LAYOUT_CHANGED.
7081
7101
  if (panelEvent.type === PanelEventTypes.LAYOUT_CHANGED) {
7082
7102
  this.refreshBreakpointCounts();