pptx-angular-viewer 1.1.46 → 1.1.47

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.
@@ -49733,6 +49733,11 @@ class SmartArtRendererComponent {
49733
49733
  /** The mounted `<textarea>` for the active node edit, if any. */
49734
49734
  nodeEditor = viewChild('nodeEditor', /* @ts-ignore */
49735
49735
  ...(ngDevMode ? [{ debugName: "nodeEditor" }] : /* istanbul ignore next */ []));
49736
+ /**
49737
+ * Guards against a cancel-triggered DOM-removal blur committing the edit.
49738
+ * Set to true before programmatic cancellation; reset to false on each new edit.
49739
+ */
49740
+ editSettled = false;
49736
49741
  /** Whether node double-click / Enter enters inline edit (editable + has editor). */
49737
49742
  canEditNodes = computed(() => this.editable() && this.editor !== null, /* @ts-ignore */
49738
49743
  ...(ngDevMode ? [{ debugName: "canEditNodes" }] : /* istanbul ignore next */ []));
@@ -49857,6 +49862,10 @@ class SmartArtRendererComponent {
49857
49862
  }
49858
49863
  /** Commit the current edit (called on blur). */
49859
49864
  commitEdit(event) {
49865
+ if (this.editSettled) {
49866
+ this.editSettled = false;
49867
+ return;
49868
+ }
49860
49869
  const edit = this.editState();
49861
49870
  if (!edit) {
49862
49871
  return;
@@ -49875,11 +49884,14 @@ class SmartArtRendererComponent {
49875
49884
  }
49876
49885
  else if (event.key === 'Escape') {
49877
49886
  event.preventDefault();
49887
+ // Mark as settled so the DOM-removal blur does not commit the cancelled edit.
49888
+ this.editSettled = true;
49878
49889
  this.editState.set(null);
49879
49890
  }
49880
49891
  }
49881
49892
  /** Resolve the node id + geometry and open the editor seeded with full text. */
49882
49893
  enterEdit(node) {
49894
+ this.editSettled = false;
49883
49895
  const elementId = this.element().id;
49884
49896
  const seed = beginNodeEdit(node, elementId, this.rawNodeText(node));
49885
49897
  if (seed) {