pptx-angular-viewer 1.1.45 → 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.
package/CHANGELOG.md CHANGED
@@ -6,6 +6,10 @@ by [git-cliff](https://git-cliff.org); do not edit it by hand.
6
6
 
7
7
  ## [1.1.45](https://github.com/ChristopherVR/pptx-viewer/releases/tag/pptx-angular-viewer@1.1.45) - 2026-06-25
8
8
 
9
+ ### Other
10
+
11
+ - **smartart:** Snapshot in-progress SmartArt session work (by @ChristopherVR) ([0cac22f](https://github.com/ChristopherVR/pptx-viewer/commit/0cac22f5b1a0ecc33960f4712ff2ef691beb3f65))
12
+
9
13
  ### Refactor
10
14
 
11
15
  - **shared:** Extract text-rendering pure logic (line-height, warp, effects) (by @ChristopherVR) ([11c8d22](https://github.com/ChristopherVR/pptx-viewer/commit/11c8d22e9910dda9c8dfa18e0f6d7683577c7b9f))
@@ -15271,8 +15271,24 @@ function shouldCommitSmartArtNodeText(data, nodeId, nextText) {
15271
15271
  *
15272
15272
  * Returns the resolved node id, or `undefined` when no confident match exists
15273
15273
  * (in which case the shape is not made editable).
15274
+ *
15275
+ * Arrow/connector shapes (preset geometry names that end with `"Arrow"`, e.g.
15276
+ * `rightArrow`, `leftRightArrow`, `downArrow`) that carry no text are always
15277
+ * structural decorators in SmartArt - never editable node content. They are
15278
+ * excluded before any heuristic runs so that reflow connector shapes with ids
15279
+ * like `reflow-bending-arrow-n1` (which end with `-n1` and would otherwise
15280
+ * match node `n1` via heuristic 1) are correctly left untagged.
15281
+ *
15282
+ * Arrow shapes that DO carry text (e.g. content nodes in an "Opposing Arrows"
15283
+ * layout) are intentional content and are allowed through.
15274
15284
  */
15275
15285
  function resolveDrawingShapeNodeId(shape, shapeIndex, shapes, nodes) {
15286
+ // Arrow shapes without text are structural connector decorators and are
15287
+ // never editable node content. All OOXML arrow preset geometry names end
15288
+ // with "Arrow" (rightArrow, leftArrow, downArrow, leftRightArrow, etc.).
15289
+ if (shape.shapeType?.endsWith('Arrow') && !shape.text) {
15290
+ return undefined;
15291
+ }
15276
15292
  // 1. Reflow shapes embed the node id as the id suffix.
15277
15293
  if (shape.id.startsWith('reflow-')) {
15278
15294
  const match = nodes.find((n) => shape.id.endsWith(`-${n.id}`));
@@ -49717,6 +49733,11 @@ class SmartArtRendererComponent {
49717
49733
  /** The mounted `<textarea>` for the active node edit, if any. */
49718
49734
  nodeEditor = viewChild('nodeEditor', /* @ts-ignore */
49719
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;
49720
49741
  /** Whether node double-click / Enter enters inline edit (editable + has editor). */
49721
49742
  canEditNodes = computed(() => this.editable() && this.editor !== null, /* @ts-ignore */
49722
49743
  ...(ngDevMode ? [{ debugName: "canEditNodes" }] : /* istanbul ignore next */ []));
@@ -49841,6 +49862,10 @@ class SmartArtRendererComponent {
49841
49862
  }
49842
49863
  /** Commit the current edit (called on blur). */
49843
49864
  commitEdit(event) {
49865
+ if (this.editSettled) {
49866
+ this.editSettled = false;
49867
+ return;
49868
+ }
49844
49869
  const edit = this.editState();
49845
49870
  if (!edit) {
49846
49871
  return;
@@ -49859,11 +49884,14 @@ class SmartArtRendererComponent {
49859
49884
  }
49860
49885
  else if (event.key === 'Escape') {
49861
49886
  event.preventDefault();
49887
+ // Mark as settled so the DOM-removal blur does not commit the cancelled edit.
49888
+ this.editSettled = true;
49862
49889
  this.editState.set(null);
49863
49890
  }
49864
49891
  }
49865
49892
  /** Resolve the node id + geometry and open the editor seeded with full text. */
49866
49893
  enterEdit(node) {
49894
+ this.editSettled = false;
49867
49895
  const elementId = this.element().id;
49868
49896
  const seed = beginNodeEdit(node, elementId, this.rawNodeText(node));
49869
49897
  if (seed) {