pptx-vanilla-viewer 0.16.0 → 0.17.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 +12 -0
- package/README.md +67 -3
- package/dist/index.cjs +195 -113
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +195 -113
- package/dist/styles.css +82 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,18 @@ 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.16.1](https://github.com/ChristopherVR/pptx-viewer/releases/tag/pptx-vanilla-viewer@0.16.1) - 2026-07-18
|
|
8
|
+
|
|
9
|
+
### Documentation
|
|
10
|
+
|
|
11
|
+
- Correct and expand the per-package npm readmes (by @ChristopherVR) ([46f7c57](https://github.com/ChristopherVR/pptx-viewer/commit/46f7c573701a19e91c507d41ebdc956c64699c38))
|
|
12
|
+
|
|
13
|
+
## [0.16.0](https://github.com/ChristopherVR/pptx-viewer/releases/tag/pptx-vanilla-viewer@0.16.0) - 2026-07-18
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
- **vanilla:** Export createRibbon for independent composition (by @ChristopherVR) ([521d494](https://github.com/ChristopherVR/pptx-viewer/commit/521d4943e2d457d87e5305c15090928212c58a3c))
|
|
18
|
+
|
|
7
19
|
## [0.15.0](https://github.com/ChristopherVR/pptx-viewer/releases/tag/pptx-vanilla-viewer@0.15.0) - 2026-07-18
|
|
8
20
|
|
|
9
21
|
### Dependencies
|
package/README.md
CHANGED
|
@@ -71,6 +71,73 @@ viewer.destroy();
|
|
|
71
71
|
|
|
72
72
|
The container should have a size (the viewer fills it: `width/height: 100%`).
|
|
73
73
|
|
|
74
|
+
## Options
|
|
75
|
+
|
|
76
|
+
All options are optional except the container element itself. Beyond the ones
|
|
77
|
+
shown above:
|
|
78
|
+
|
|
79
|
+
| Option | Type | Default | Description |
|
|
80
|
+
| -------------------------------------- | ----------------------------------------------------- | --------------------- | ------------------------------------------------------------------------------------------- |
|
|
81
|
+
| `source` | `string \| ArrayBuffer \| Uint8Array \| Blob \| File` | - | The presentation to open (URL or bytes). Omit to start empty and call `loadFile`/`loadUrl`. |
|
|
82
|
+
| `fonts` | `ViewerFontSource[]` | - | Licensed font sources supplied by the host application. |
|
|
83
|
+
| `theme` | `ViewerTheme` | - | Chrome theme (colors, radius, CSS vars). |
|
|
84
|
+
| `fileName` | `string` | - | Display name shown in the title bar. |
|
|
85
|
+
| `locale` / `messages` | `string` / `TranslationMessages` | `'en'` | UI locale and per-locale `pptx.*` dictionaries (see [i18n](#i18n)). |
|
|
86
|
+
| `initialSlide` | `number` | `0` | Zero-based slide shown after load. |
|
|
87
|
+
| `editable` | `boolean` | `false` | Enable editing (see [Editing](#editing)). |
|
|
88
|
+
| `showToolbar` | `boolean` | `true` | Whole ribbon/title-bar/status-bar chrome. |
|
|
89
|
+
| `showThumbnails` | `boolean` | `true` | Thumbnail sidebar. |
|
|
90
|
+
| `showFormatToolbar` | `boolean` | `true` | Editing format toolbar row (visible only while editing). |
|
|
91
|
+
| `showInspector` | `boolean` | `true` | Property inspector panel (visible only while editing). |
|
|
92
|
+
| `hiddenActions` | `ToolbarActionId[]` | - | Hide individual buttons/tabs (see [Toolbar customization](#toolbar-customization)). |
|
|
93
|
+
| `registry` | `ElementRendererRegistry` | - | Custom element-renderer registry (see [Element coverage](#element-coverage)). |
|
|
94
|
+
| `smartArt3D` | `boolean` | `false` | Opt-in Three.js 3D SmartArt renderer (optional `three` peer, lazily imported). |
|
|
95
|
+
| `autosave` | `boolean` | `false` | Debounced crash-recovery autosave to IndexedDB. |
|
|
96
|
+
| `autosaveIntervalMs` | `number` | `2000` | Autosave debounce window. |
|
|
97
|
+
| `autosaveFilePath` | `string` | `'presentation.pptx'` | IndexedDB recovery key for autosave snapshots. |
|
|
98
|
+
| `collaboration` | `CollaborationConfig` | - | Start a Yjs collaboration session immediately (y-websocket or serverless y-webrtc). |
|
|
99
|
+
| `shareDefaults` | `{ roomId?, userName?, serverUrl? }` | - | Prefilled values for the Share/Broadcast dialogs. |
|
|
100
|
+
| `availableThemes` / `availableLocales` | catalog entries | - | Choices offered by File > Options. |
|
|
101
|
+
| `onThemeChange` / `onLocaleChange` | `(key: string) => void` | - | Host hooks for the File > Options pickers (host owns persistence when supplied). |
|
|
102
|
+
| `accountAuth` | `AccountAuthConfig` | - | Optional sign-in hook point for File > Account. |
|
|
103
|
+
|
|
104
|
+
Callbacks: `onLoad`, `onError`, `onSlideChange`, `onZoomChange`,
|
|
105
|
+
`onPresentationChange`, `onChange` (any document mutation), `onDirtyChange`,
|
|
106
|
+
`onSelectionChange`, `onAutosaveStatus`, `onAutosaveRecovery` (offers a prior
|
|
107
|
+
session's recovery snapshot), `onToggleAutosave`, and `onCollaborationStatus`.
|
|
108
|
+
|
|
109
|
+
## Instance API
|
|
110
|
+
|
|
111
|
+
The handle returned by `createPptxViewer` implements the shared
|
|
112
|
+
`PowerPointViewerAPI` (the same imperative contract as the React/Vue/Angular/
|
|
113
|
+
Svelte bindings: `getContent`, `goTo`, `undo`/`redo`, zoom and mode getters/
|
|
114
|
+
setters, `getSlides`/`getSlide`/`getActiveSlide`, `addSlide`/`deleteSlides`/
|
|
115
|
+
`duplicateSlides`/`moveSlide`/`toggleHideSlides`, `getElements`/
|
|
116
|
+
`getElementById`/`updateElement`/`deleteElements`/`duplicateElement`, and the
|
|
117
|
+
selection methods) plus vanilla-specific methods:
|
|
118
|
+
|
|
119
|
+
- **Loading**: `loadFile(bytesOrBlob)`, `loadUrl(url)`.
|
|
120
|
+
- **Navigation / zoom**: `next()`, `prev()`, `goToSlide(index)`,
|
|
121
|
+
`getSlideCount()`, `getCurrentSlide()`, `getZoom()`, `setZoom(scale)`,
|
|
122
|
+
`zoomIn()`, `zoomOut()`, `zoomToFit()`.
|
|
123
|
+
- **Presentation**: `enterPresentation()`, `exitPresentation()`.
|
|
124
|
+
- **Editing**: `setEditable(flag)`, `setEditTemplateMode(flag)`, `undo()`,
|
|
125
|
+
`redo()`, `canUndo()`, `canRedo()`, `deleteSelected()`,
|
|
126
|
+
`getSelectedElementId()`.
|
|
127
|
+
- **Saving**: `save(format?)`, `downloadPptx(fileName?)`,
|
|
128
|
+
`downloadAs(format, fileName?)`, `packageForSharing(fileName?)`.
|
|
129
|
+
- **Export / print**: `exportSlidePng(index?)`, `copySlideAsImage(index?)`,
|
|
130
|
+
`exportPdf(options?)`, `exportGif(options?)`, `exportVideo(options?)`,
|
|
131
|
+
`print(options?)` (returns `false` when the popup was blocked; call from a
|
|
132
|
+
click handler).
|
|
133
|
+
- **Collaboration**: `startCollaboration(config)`, `stopCollaboration()`,
|
|
134
|
+
`getCollaborationStatus()`.
|
|
135
|
+
- **Autosave**: `autosaveNow()`, `setAutosaveEnabled(flag)`,
|
|
136
|
+
`isAutosaveEnabled()`.
|
|
137
|
+
- **Chrome / extension**: `setTheme(theme?)`, `setLocale(locale)`,
|
|
138
|
+
`getRegistry()`, `getHandler()` (the live `pptx-viewer-core` handler),
|
|
139
|
+
`destroy()`.
|
|
140
|
+
|
|
74
141
|
## Keyboard
|
|
75
142
|
|
|
76
143
|
Navigation: arrow keys / PageUp / PageDown / Space, Home/End jump to the
|
|
@@ -137,9 +204,6 @@ Pass `editable: true` (or call `setEditable(true)` at runtime) to turn on:
|
|
|
137
204
|
- The toolbar's Save button (shown only when `editable`), which calls
|
|
138
205
|
`downloadPptx()` to serialise and download the edited `.pptx`.
|
|
139
206
|
|
|
140
|
-
For CSP-strict hosts, import `pptx-vanilla-viewer/styles.css` instead of using
|
|
141
|
-
automatic style injection.
|
|
142
|
-
|
|
143
207
|
Use `viewer.getSelectedElementId()` and the `onSelectionChange` /
|
|
144
208
|
`onDirtyChange` callbacks to build your own chrome around the selection
|
|
145
209
|
state.
|