pptx-vanilla-viewer 0.15.0 → 0.16.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,12 @@ 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
+ ## [0.15.0](https://github.com/ChristopherVR/pptx-viewer/releases/tag/pptx-vanilla-viewer@0.15.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
+
7
13
  ## [0.14.0](https://github.com/ChristopherVR/pptx-viewer/releases/tag/pptx-vanilla-viewer@0.14.0) - 2026-07-18
8
14
 
9
15
  ### Bug Fixes
package/README.md CHANGED
@@ -172,6 +172,76 @@ viewer.getRegistry().register('table', renderTable);
172
172
 
173
173
  See `src/viewer/render/elements/README.md` for the full renderer contract.
174
174
 
175
+ ## Building your own chrome
176
+
177
+ `createPptxViewer` mounts the whole viewer (ribbon, canvas, inspector,
178
+ controllers) as one unit. If you want to build custom chrome around the same
179
+ primitives instead, the ribbon builder and the canvas renderer are both
180
+ importable independently:
181
+
182
+ ```ts
183
+ import {
184
+ createRibbon,
185
+ createStore,
186
+ createInitialViewerState,
187
+ renderSlideStage,
188
+ createDefaultRegistry,
189
+ type RibbonHandlers,
190
+ type Store,
191
+ type ViewerState,
192
+ } from 'pptx-vanilla-viewer';
193
+
194
+ // Your own reactive container, seeded with the same shape `createPptxViewer`
195
+ // uses internally.
196
+ const store: Store<ViewerState> = createStore(createInitialViewerState());
197
+
198
+ // `createRibbon` is callback-driven: it never reaches into a `PptxViewer`
199
+ // instance or a store directly, so it renders against whatever `RibbonHandlers`
200
+ // you hand it.
201
+ const handlers: RibbonHandlers = {
202
+ /* nav, primary, file, slideShow, insert, edit, findReplace, design, draw */
203
+ };
204
+ const ribbon = createRibbon(document, t, handlers);
205
+ host.appendChild(ribbon.el);
206
+
207
+ // Draw the current slide with the same DOM renderer the bundled viewer uses.
208
+ const registry = createDefaultRegistry();
209
+ const stageEl = renderSlideStage({
210
+ doc: document,
211
+ slide: store.get().slides[store.get().currentSlide],
212
+ registry,
213
+ // ...canvasSize, scale, editable, selection, etc. (see `SlideStageOptions`)
214
+ });
215
+ canvasHost.appendChild(stageEl);
216
+
217
+ // Re-render on every store change.
218
+ store.subscribe((state) => {
219
+ ribbon.update({ current: state.currentSlide, total: state.slides.length, zoomPercent: 100 });
220
+ /* re-render the stage, drive ribbon.setEditState/updateSelection/etc. */
221
+ });
222
+ ```
223
+
224
+ Be aware of what this buys you and what it doesn't:
225
+
226
+ - `renderSlideStage`, `createElementRendererRegistry` / `createDefaultRegistry`,
227
+ and `createRibbon` are pure, callback-driven building blocks with no hidden
228
+ coupling to `PptxViewer`; they are safe to use standalone.
229
+ - `createStore` / `createInitialViewerState` give you the same reactive
230
+ container and `ViewerState` shape `createPptxViewer` uses, so you can seed
231
+ state and pass slices of it into `renderSlideStage`.
232
+ - `RibbonHandlers` (the `edit` and `findReplace` groups especially, typed by
233
+ the exported `EditActions` / `FindReplaceActions` interfaces) is a large
234
+ surface: insert/format/arrange/clipboard/history/animation/transition
235
+ actions, comments, sections, and more. The built-in implementations of
236
+ these (`createEditorController`, `createEditActions`, `RenderController`,
237
+ `LoadingController`, ...) are **not** exported: they're wired directly
238
+ into `PptxViewer`'s own mount lifecycle (`getChrome`, `getHandler`, history,
239
+ autosave) and aren't decomposable into standalone pieces without a larger
240
+ refactor. Building a fully-featured custom editor chrome today means
241
+ implementing `RibbonHandlers` yourself against your own store and history,
242
+ not reusing the bundled editor logic; `createPptxViewer` remains the
243
+ supported path for a complete, batteries-included editor.
244
+
175
245
  ## License
176
246
 
177
247
  Apache-2.0. See `LICENSE` and `NOTICE`.