pptx-angular-viewer 1.9.0 → 1.9.1

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
@@ -4,6 +4,8 @@ All notable changes to this project are documented here.
4
4
  This file is generated from [Conventional Commits](https://www.conventionalcommits.org)
5
5
  by [git-cliff](https://git-cliff.org); do not edit it by hand.
6
6
 
7
+ ## [1.9.0](https://github.com/ChristopherVR/pptx-viewer/releases/tag/pptx-angular-viewer@1.9.0) - 2026-07-07
8
+
7
9
  ## [1.8.0](https://github.com/ChristopherVR/pptx-viewer/releases/tag/pptx-angular-viewer@1.8.0) - 2026-07-07
8
10
 
9
11
  ## [1.7.2](https://github.com/ChristopherVR/pptx-viewer/releases/tag/pptx-angular-viewer@1.7.2) - 2026-07-07
@@ -31812,9 +31812,16 @@ function reflowToDrawingShapes(layoutResult, nodes) {
31812
31812
  */
31813
31813
  function rebuildDrawingShapesIfCleared(smartArtData, layout, palette, style, elementId, box) {
31814
31814
  const shapes = smartArtData.drawingShapes;
31815
- if ((shapes !== undefined && shapes.length > 0) || smartArtData.nodes.length === 0) {
31815
+ // Skip when:
31816
+ // - shapes is undefined: the element never had drawing shapes (freshly
31817
+ // inserted); the family SVG renderer handles display from node data.
31818
+ // - shapes is populated (length > 0): already current, no rebuild needed.
31819
+ // - no nodes: nothing to lay out.
31820
+ if (shapes === undefined || shapes.length > 0 || smartArtData.nodes.length === 0) {
31816
31821
  return smartArtData;
31817
31822
  }
31823
+ // shapes is an empty array [] -- a structural edit cleared previously-
31824
+ // populated shapes. Rebuild them from the algorithmic layout engine.
31818
31825
  const layoutResult = computeSmartArtLayout(smartArtData.nodes, box, palette, style, elementId, smartArtData.resolvedLayoutType, layout);
31819
31826
  return {
31820
31827
  ...smartArtData,
@@ -66533,6 +66540,30 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
66533
66540
  `, styles: [":host{position:absolute;inset:0;pointer-events:none;overflow:visible;z-index:9997}.pptx-ng-remote-selection{position:absolute;top:0;left:0;box-sizing:border-box;border:2px solid currentcolor;border-radius:2px;pointer-events:none;will-change:transform;transition:transform 90ms linear}.pptx-ng-remote-selection-label{position:absolute;top:-18px;left:-2px;max-width:150px;padding:1px 5px;border-radius:3px;color:#fff;font-family:system-ui,sans-serif;font-size:9px;font-weight:500;line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}\n"] }]
66534
66541
  }], propDecorators: { presences: [{ type: i0.Input, args: [{ isSignal: true, alias: "presences", required: false }] }], elements: [{ type: i0.Input, args: [{ isSignal: true, alias: "elements", required: false }] }], activeSlideIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeSlideIndex", required: false }] }], zoom: [{ type: i0.Input, args: [{ isSignal: true, alias: "zoom", required: false }] }] } });
66535
66542
 
66543
+ /**
66544
+ * ribbon-text-helpers.ts: shared text-style helpers for the ribbon's Font and
66545
+ * Paragraph control groups (split out of {@link RibbonComponent} so both the
66546
+ * {@link RibbonFontControlsComponent} and {@link RibbonParagraphControlsComponent}
66547
+ * mutate the selection's `textStyle` through the same code path).
66548
+ */
66549
+ /** The selection's text style, or null when the element carries no text props. */
66550
+ function textStyleOf(el) {
66551
+ return el && hasTextProperties(el) ? (el.textStyle ?? null) : null;
66552
+ }
66553
+ /** Whether the given element can take text formatting. */
66554
+ function isTextElement(el) {
66555
+ return el !== null && hasTextProperties(el);
66556
+ }
66557
+ /** Merge `patch` into the selection's text style and commit via the editor. */
66558
+ function patchTextStyle(editor, slideIndex, el, patch) {
66559
+ if (!el || !hasTextProperties(el)) {
66560
+ return;
66561
+ }
66562
+ editor.updateElement(slideIndex, el.id, {
66563
+ textStyle: { ...el.textStyle, ...patch },
66564
+ });
66565
+ }
66566
+
66536
66567
  /**
66537
66568
  * ribbon-animations-section.component.ts: the Animations ribbon tab (preview, the
66538
66569
  * Add Animation entrance/emphasis/exit gallery, Remove Animation, Animation
@@ -68170,30 +68201,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
68170
68201
  }]
68171
68202
  }], propDecorators: { current: [{ type: i0.Input, args: [{ isSignal: true, alias: "current", required: false }] }], presets: [{ type: i0.Input, args: [{ isSignal: true, alias: "presets", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], titleKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "titleKey", required: false }] }], swatchAriaKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "swatchAriaKey", required: false }] }], pick: [{ type: i0.Output, args: ["pick"] }] } });
68172
68203
 
68173
- /**
68174
- * ribbon-text-helpers.ts: shared text-style helpers for the ribbon's Font and
68175
- * Paragraph control groups (split out of {@link RibbonComponent} so both the
68176
- * {@link RibbonFontControlsComponent} and {@link RibbonParagraphControlsComponent}
68177
- * mutate the selection's `textStyle` through the same code path).
68178
- */
68179
- /** The selection's text style, or null when the element carries no text props. */
68180
- function textStyleOf(el) {
68181
- return el && hasTextProperties(el) ? (el.textStyle ?? null) : null;
68182
- }
68183
- /** Whether the given element can take text formatting. */
68184
- function isTextElement(el) {
68185
- return el !== null && hasTextProperties(el);
68186
- }
68187
- /** Merge `patch` into the selection's text style and commit via the editor. */
68188
- function patchTextStyle(editor, slideIndex, el, patch) {
68189
- if (!el || !hasTextProperties(el)) {
68190
- return;
68191
- }
68192
- editor.updateElement(slideIndex, el.id, {
68193
- textStyle: { ...el.textStyle, ...patch },
68194
- });
68195
- }
68196
-
68197
68204
  /**
68198
68205
  * ribbon-font-controls.component.ts: the ribbon's reusable Font control group
68199
68206
  * (family/size dropdowns, grow/shrink, clear-formatting, bold/italic/underline/
@@ -80758,6 +80765,129 @@ class PowerPointViewerComponent {
80758
80765
  }
80759
80766
  this.findReplace.openFindReplace();
80760
80767
  }
80768
+ /** Dispatch a command from the title-bar search palette. */
80769
+ handleCommandSearch(command) {
80770
+ const [category, action] = command.split('.');
80771
+ switch (category) {
80772
+ case 'format':
80773
+ this.dispatchFormatCommand(action);
80774
+ break;
80775
+ case 'insert':
80776
+ this.dispatchInsertCommand(action);
80777
+ break;
80778
+ case 'view':
80779
+ this.dispatchViewCommand(action);
80780
+ break;
80781
+ case 'slideShow':
80782
+ if (action === 'fromBeginning') {
80783
+ this.presentationMode.present();
80784
+ }
80785
+ else if (action === 'presenterView') {
80786
+ this.presentationMode.presentPresenter();
80787
+ }
80788
+ break;
80789
+ case 'design':
80790
+ if (action === 'browseThemes') {
80791
+ this.themeGallery.showThemeGallery.update((v) => !v);
80792
+ }
80793
+ else if (action === 'slideSize') {
80794
+ this.dialogs.showSetUpSlideShow.set(true);
80795
+ }
80796
+ break;
80797
+ case 'arrange':
80798
+ this.dispatchArrangeCommand(action);
80799
+ break;
80800
+ case 'review':
80801
+ if (action === 'spelling') {
80802
+ this.findReplace.openFindReplace();
80803
+ }
80804
+ else if (action === 'accessibility') {
80805
+ this.inspectorPanel.togglePanel('accessibility');
80806
+ }
80807
+ break;
80808
+ }
80809
+ }
80810
+ dispatchFormatCommand(action) {
80811
+ const el = this.selectedElement();
80812
+ const idx = this.activeSlideIndex();
80813
+ switch (action) {
80814
+ case 'bold':
80815
+ patchTextStyle(this.editor, idx, el, { bold: true });
80816
+ break;
80817
+ case 'italic':
80818
+ patchTextStyle(this.editor, idx, el, { italic: true });
80819
+ break;
80820
+ case 'underline':
80821
+ patchTextStyle(this.editor, idx, el, { underline: true });
80822
+ break;
80823
+ case 'alignLeft':
80824
+ patchTextStyle(this.editor, idx, el, { align: 'left' });
80825
+ break;
80826
+ case 'alignCenter':
80827
+ patchTextStyle(this.editor, idx, el, { align: 'center' });
80828
+ break;
80829
+ case 'alignRight':
80830
+ patchTextStyle(this.editor, idx, el, { align: 'right' });
80831
+ break;
80832
+ case 'clear':
80833
+ patchTextStyle(this.editor, idx, el, {
80834
+ bold: false,
80835
+ italic: false,
80836
+ underline: false,
80837
+ strikethrough: false,
80838
+ });
80839
+ break;
80840
+ }
80841
+ }
80842
+ dispatchInsertCommand(action) {
80843
+ const idx = this.activeSlideIndex();
80844
+ switch (action) {
80845
+ case 'textBox':
80846
+ this.editor.addElement(idx, newTextElement());
80847
+ break;
80848
+ case 'shape':
80849
+ this.editor.addElement(idx, newShapeElement('rect'));
80850
+ break;
80851
+ case 'table':
80852
+ this.editor.addElement(idx, newTableElement());
80853
+ break;
80854
+ case 'chart':
80855
+ this.editor.addElement(idx, newChartElement('bar'));
80856
+ break;
80857
+ case 'smartArt':
80858
+ this.showSmartArtInsert.set(true);
80859
+ break;
80860
+ case 'equation':
80861
+ this.dialogs.openEquationInsert();
80862
+ break;
80863
+ case 'link':
80864
+ this.docProperties.showHyperlink.set(true);
80865
+ break;
80866
+ }
80867
+ }
80868
+ dispatchViewCommand(action) {
80869
+ switch (action) {
80870
+ case 'toggleGrid':
80871
+ this.showGrid.update((v) => !v);
80872
+ break;
80873
+ case 'toggleRulers':
80874
+ this.showRulers.update((v) => !v);
80875
+ break;
80876
+ case 'slideSorter':
80877
+ this.showSorter.set(true);
80878
+ break;
80879
+ case 'zoomToFit':
80880
+ this.zoomSvc.zoomReset();
80881
+ break;
80882
+ }
80883
+ }
80884
+ dispatchArrangeCommand(action) {
80885
+ switch (action) {
80886
+ case 'duplicate':
80887
+ this.editor.duplicateSelected(this.activeSlideIndex());
80888
+ break;
80889
+ }
80890
+ }
80761
80891
  /**
80762
80892
  * Serialise the edited deck (templates merged back) to `.pptx` bytes for an
80763
80893
  * autosave recovery snapshot. Returns null when the deck is read-only so the
@@ -80909,6 +81039,7 @@ class PowerPointViewerComponent {
80909
81039
  (undo)="editor.undo()"
80910
81040
  (redo)="editor.redo()"
80911
81041
  (toggleFindReplace)="toggleFindReplace()"
81042
+ (commandSearch)="handleCommandSearch($event)"
80912
81043
  />
80913
81044
  <pptx-ribbon
80914
81045
  [slideIndex]="activeSlideIndex()"
@@ -81577,6 +81708,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
81577
81708
  (undo)="editor.undo()"
81578
81709
  (redo)="editor.redo()"
81579
81710
  (toggleFindReplace)="toggleFindReplace()"
81711
+ (commandSearch)="handleCommandSearch($event)"
81580
81712
  />
81581
81713
  <pptx-ribbon
81582
81714
  [slideIndex]="activeSlideIndex()"