pptx-angular-viewer 1.28.1 → 1.30.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.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,14 @@ 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.29.0](https://github.com/ChristopherVR/pptx-viewer/releases/tag/pptx-angular-viewer@1.29.0) - 2026-07-18
8
+
9
+ ### Dependencies
10
+
11
+ - **deps:** Update dependencies to latest and migrate core/shared/locales to TypeScript 7 (by @ChristopherVR) ([cc72948](https://github.com/ChristopherVR/pptx-viewer/commit/cc729482cc5ae4ae56e1219f290c2953ec83c12a))
12
+
13
+ ## [1.28.1](https://github.com/ChristopherVR/pptx-viewer/releases/tag/pptx-angular-viewer@1.28.1) - 2026-07-18
14
+
7
15
  ## [1.28.0](https://github.com/ChristopherVR/pptx-viewer/releases/tag/pptx-angular-viewer@1.28.0) - 2026-07-18
8
16
 
9
17
  ## [1.27.0](https://github.com/ChristopherVR/pptx-viewer/releases/tag/pptx-angular-viewer@1.27.0) - 2026-07-17
package/README.md CHANGED
@@ -141,6 +141,66 @@ async save() {
141
141
  }
142
142
  ```
143
143
 
144
+ ### Composing your own custom viewer host
145
+
146
+ `<pptx-viewer>` (`PowerPointViewerComponent`) is the bundled, batteries-included
147
+ chrome, but its building blocks are curated exports too, so you can compose
148
+ your own host component instead: bring your own layout/toolbar and reuse the
149
+ ribbon and slide canvas directly, wired to the same shared DI state via
150
+ `POWER_POINT_VIEWER_PROVIDERS`, the exact provider list `PowerPointViewerComponent`
151
+ itself uses.
152
+
153
+ ```ts
154
+ import { Component, inject, signal } from '@angular/core';
155
+ import {
156
+ DEFAULT_CANVAS_HEIGHT,
157
+ DEFAULT_CANVAS_WIDTH,
158
+ EditorStateService,
159
+ LoadContentService,
160
+ POWER_POINT_VIEWER_PROVIDERS,
161
+ RibbonComponent,
162
+ SlideCanvasComponent,
163
+ } from 'pptx-angular-viewer';
164
+
165
+ @Component({
166
+ selector: 'my-custom-viewer',
167
+ standalone: true,
168
+ providers: [...POWER_POINT_VIEWER_PROVIDERS],
169
+ imports: [RibbonComponent, SlideCanvasComponent],
170
+ template: `
171
+ <pptx-ribbon
172
+ [slideIndex]="loader.activeSlideIndex()"
173
+ [slideCount]="editor.slides().length"
174
+ [canEdit]="true"
175
+ (save)="onSave()"
176
+ />
177
+ <pptx-slide-canvas
178
+ [slide]="editor.slides()[loader.activeSlideIndex()]"
179
+ [canvasSize]="{ width: DEFAULT_CANVAS_WIDTH, height: DEFAULT_CANVAS_HEIGHT }"
180
+ [editable]="true"
181
+ />
182
+ `,
183
+ })
184
+ export class MyCustomViewerComponent {
185
+ protected readonly loader = inject(LoadContentService);
186
+ protected readonly editor = inject(EditorStateService);
187
+ protected readonly DEFAULT_CANVAS_WIDTH = DEFAULT_CANVAS_WIDTH;
188
+ protected readonly DEFAULT_CANVAS_HEIGHT = DEFAULT_CANVAS_HEIGHT;
189
+
190
+ onSave() {
191
+ /* ... */
192
+ }
193
+ }
194
+ ```
195
+
196
+ `RibbonComponent` and `SlideCanvasComponent` are plain, DI-free `input()`/`output()`
197
+ signal components (the ribbon renders ~90 bindings for the full Office-style tab
198
+ set; the snippet above shows an illustrative subset, not the exhaustive list),
199
+ so this recipe scales down too: provide only the services the pieces you use
200
+ actually need instead of the full `POWER_POINT_VIEWER_PROVIDERS` list, as long
201
+ as you cover whatever `inject()` calls those pieces make (`EditorStateService`
202
+ and `LoadContentService` are the two nearly everything depends on).
203
+
144
204
  ## API
145
205
 
146
206
  ### Inputs
@@ -194,9 +254,12 @@ async save() {
194
254
 
195
255
  ### Exported components & helpers
196
256
 
197
- `PowerPointViewerComponent`, `SlideCanvasComponent`, `ElementRendererComponent`,
198
- `LoadContentService`, `provideViewerTheme`, `VIEWER_THEME`, and the
199
- `ViewerTheme` / `CanvasSize` / `CollaborationConfig` types.
257
+ `PowerPointViewerComponent`, `SlideCanvasComponent`, `RibbonComponent`,
258
+ `ElementRendererComponent`, `LoadContentService`, `POWER_POINT_VIEWER_PROVIDERS`,
259
+ `provideViewerTheme`, `VIEWER_THEME`, and the `ViewerTheme` / `CanvasSize` /
260
+ `CollaborationConfig` types. See "Composing your own custom viewer host" above
261
+ for using `RibbonComponent` and `SlideCanvasComponent` outside
262
+ `PowerPointViewerComponent`.
200
263
 
201
264
  ## Localization (i18n)
202
265