pptx-svelte-viewer 0.5.0 → 0.6.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 +4 -0
- package/README.md +9 -6
- package/dist/{component-CtIGg1wg.js → component-NIMULjW3.js} +20923 -16749
- package/dist/i18n/context.d.ts +20 -0
- package/dist/i18n/context.d.ts.map +1 -0
- package/dist/i18n/index.d.ts +4 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/translator.d.ts +30 -0
- package/dist/i18n/translator.d.ts.map +1 -0
- package/dist/i18n.d.ts +56 -62
- package/dist/i18n.d.ts.map +1 -0
- package/dist/index.d.ts +765 -605
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1 -1
- package/dist/theme/index.d.ts +8 -0
- package/dist/theme/index.d.ts.map +1 -0
- package/dist/viewer/collab/collaboration-dialogs.svelte.d.ts +31 -0
- package/dist/viewer/collab/collaboration-dialogs.svelte.d.ts.map +1 -0
- package/dist/viewer/collab/collaboration-presence-effects.svelte.d.ts +9 -0
- package/dist/viewer/collab/collaboration-presence-effects.svelte.d.ts.map +1 -0
- package/dist/viewer/collab/collaboration-presence.svelte.d.ts +20 -0
- package/dist/viewer/collab/collaboration-presence.svelte.d.ts.map +1 -0
- package/dist/viewer/collab/collaboration-provider.d.ts +35 -0
- package/dist/viewer/collab/collaboration-provider.d.ts.map +1 -0
- package/dist/viewer/collab/collaboration-remote-sync.d.ts +12 -0
- package/dist/viewer/collab/collaboration-remote-sync.d.ts.map +1 -0
- package/dist/viewer/collab/collaboration-session.d.ts +24 -0
- package/dist/viewer/collab/collaboration-session.d.ts.map +1 -0
- package/dist/viewer/collab/collaboration-status.d.ts +14 -0
- package/dist/viewer/collab/collaboration-status.d.ts.map +1 -0
- package/dist/viewer/collab/collaboration.svelte.d.ts +55 -0
- package/dist/viewer/collab/collaboration.svelte.d.ts.map +1 -0
- package/dist/viewer/collab/components/props.d.ts +79 -0
- package/dist/viewer/collab/components/props.d.ts.map +1 -0
- package/dist/viewer/collab/components/share-helpers.d.ts +29 -0
- package/dist/viewer/collab/components/share-helpers.d.ts.map +1 -0
- package/dist/viewer/collab/index.d.ts +15 -0
- package/dist/viewer/collab/index.d.ts.map +1 -0
- package/dist/viewer/component.d.ts +13 -0
- package/dist/viewer/component.d.ts.map +1 -0
- package/dist/viewer/components/index.d.ts +7 -0
- package/dist/viewer/components/index.d.ts.map +1 -0
- package/dist/viewer/components/props.d.ts +185 -0
- package/dist/viewer/components/props.d.ts.map +1 -0
- package/dist/viewer/components/ribbon/animations/animation-categories.d.ts +10 -0
- package/dist/viewer/components/ribbon/animations/animation-categories.d.ts.map +1 -0
- package/dist/viewer/components/ribbon/design/theme-swatches.d.ts +16 -0
- package/dist/viewer/components/ribbon/design/theme-swatches.d.ts.map +1 -0
- package/dist/viewer/components/ribbon/insert/shape-glyphs.d.ts +8 -0
- package/dist/viewer/components/ribbon/insert/shape-glyphs.d.ts.map +1 -0
- package/dist/viewer/components/ribbon/ribbon-tabs.d.ts +17 -0
- package/dist/viewer/components/ribbon/ribbon-tabs.d.ts.map +1 -0
- package/dist/viewer/components/ribbon/ribbon-types.d.ts +67 -0
- package/dist/viewer/components/ribbon/ribbon-types.d.ts.map +1 -0
- package/dist/viewer/components/ribbon/transitions/transition-presets.d.ts +10 -0
- package/dist/viewer/components/ribbon/transitions/transition-presets.d.ts.map +1 -0
- package/dist/viewer/editor/editing-api.d.ts +20 -0
- package/dist/viewer/editor/editing-api.d.ts.map +1 -0
- package/dist/viewer/editor/editor-animation-controller.d.ts +25 -0
- package/dist/viewer/editor/editor-animation-controller.d.ts.map +1 -0
- package/dist/viewer/editor/editor-arrange-controller.d.ts +24 -0
- package/dist/viewer/editor/editor-arrange-controller.d.ts.map +1 -0
- package/dist/viewer/editor/editor-arrange-ops.d.ts +28 -0
- package/dist/viewer/editor/editor-arrange-ops.d.ts.map +1 -0
- package/dist/viewer/editor/editor-background-controller.d.ts +21 -0
- package/dist/viewer/editor/editor-background-controller.d.ts.map +1 -0
- package/dist/viewer/editor/editor-clipboard-controller.d.ts +18 -0
- package/dist/viewer/editor/editor-clipboard-controller.d.ts.map +1 -0
- package/dist/viewer/editor/editor-clipboard.d.ts +20 -0
- package/dist/viewer/editor/editor-clipboard.d.ts.map +1 -0
- package/dist/viewer/editor/editor-controller-geometry.d.ts +8 -0
- package/dist/viewer/editor/editor-controller-geometry.d.ts.map +1 -0
- package/dist/viewer/editor/editor-controller.svelte.d.ts +43 -0
- package/dist/viewer/editor/editor-controller.svelte.d.ts.map +1 -0
- package/dist/viewer/editor/editor-element-controller.d.ts +21 -0
- package/dist/viewer/editor/editor-element-controller.d.ts.map +1 -0
- package/dist/viewer/editor/editor-equation-controller.svelte.d.ts +12 -0
- package/dist/viewer/editor/editor-equation-controller.svelte.d.ts.map +1 -0
- package/dist/viewer/editor/editor-find-replace.svelte.d.ts +39 -0
- package/dist/viewer/editor/editor-find-replace.svelte.d.ts.map +1 -0
- package/dist/viewer/editor/editor-format-mutations.d.ts +39 -0
- package/dist/viewer/editor/editor-format-mutations.d.ts.map +1 -0
- package/dist/viewer/editor/editor-format-painter-controller.svelte.d.ts +13 -0
- package/dist/viewer/editor/editor-format-painter-controller.svelte.d.ts.map +1 -0
- package/dist/viewer/editor/editor-geometry.d.ts +29 -0
- package/dist/viewer/editor/editor-geometry.d.ts.map +1 -0
- package/dist/viewer/editor/editor-gestures.d.ts +48 -0
- package/dist/viewer/editor/editor-gestures.d.ts.map +1 -0
- package/dist/viewer/editor/editor-ink-controller.svelte.d.ts +59 -0
- package/dist/viewer/editor/editor-ink-controller.svelte.d.ts.map +1 -0
- package/dist/viewer/editor/editor-ink-gesture.d.ts +37 -0
- package/dist/viewer/editor/editor-ink-gesture.d.ts.map +1 -0
- package/dist/viewer/editor/editor-insert-action-button.d.ts +13 -0
- package/dist/viewer/editor/editor-insert-action-button.d.ts.map +1 -0
- package/dist/viewer/editor/editor-insert-chart.d.ts +10 -0
- package/dist/viewer/editor/editor-insert-chart.d.ts.map +1 -0
- package/dist/viewer/editor/editor-insert-equation.d.ts +5 -0
- package/dist/viewer/editor/editor-insert-equation.d.ts.map +1 -0
- package/dist/viewer/editor/editor-insert-field.d.ts +17 -0
- package/dist/viewer/editor/editor-insert-field.d.ts.map +1 -0
- package/dist/viewer/editor/editor-insert-media.d.ts +10 -0
- package/dist/viewer/editor/editor-insert-media.d.ts.map +1 -0
- package/dist/viewer/editor/editor-insert-smart-art.d.ts +8 -0
- package/dist/viewer/editor/editor-insert-smart-art.d.ts.map +1 -0
- package/dist/viewer/editor/editor-insert.d.ts +40 -0
- package/dist/viewer/editor/editor-insert.d.ts.map +1 -0
- package/dist/viewer/editor/editor-keyboard.d.ts +31 -0
- package/dist/viewer/editor/editor-keyboard.d.ts.map +1 -0
- package/dist/viewer/editor/editor-master-controller.d.ts +17 -0
- package/dist/viewer/editor/editor-master-controller.d.ts.map +1 -0
- package/dist/viewer/editor/editor-mutations.d.ts +59 -0
- package/dist/viewer/editor/editor-mutations.d.ts.map +1 -0
- package/dist/viewer/editor/editor-paragraph-mutations.d.ts +10 -0
- package/dist/viewer/editor/editor-paragraph-mutations.d.ts.map +1 -0
- package/dist/viewer/editor/editor-selection-gestures.d.ts +24 -0
- package/dist/viewer/editor/editor-selection-gestures.d.ts.map +1 -0
- package/dist/viewer/editor/editor-selection.svelte.d.ts +32 -0
- package/dist/viewer/editor/editor-selection.svelte.d.ts.map +1 -0
- package/dist/viewer/editor/editor-slide-ops.d.ts +23 -0
- package/dist/viewer/editor/editor-slide-ops.d.ts.map +1 -0
- package/dist/viewer/editor/editor-slides-controller.d.ts +22 -0
- package/dist/viewer/editor/editor-slides-controller.d.ts.map +1 -0
- package/dist/viewer/editor/editor-state.svelte.d.ts +102 -0
- package/dist/viewer/editor/editor-state.svelte.d.ts.map +1 -0
- package/dist/viewer/editor/editor-template-controller.d.ts +12 -0
- package/dist/viewer/editor/editor-template-controller.d.ts.map +1 -0
- package/dist/viewer/editor/editor-text-extra-mutations.d.ts +18 -0
- package/dist/viewer/editor/editor-text-extra-mutations.d.ts.map +1 -0
- package/dist/viewer/editor/editor-transition-controller.d.ts +22 -0
- package/dist/viewer/editor/editor-transition-controller.d.ts.map +1 -0
- package/dist/viewer/editor/editor-zorder.d.ts +16 -0
- package/dist/viewer/editor/editor-zorder.d.ts.map +1 -0
- package/dist/viewer/editor/element-hit.d.ts +17 -0
- package/dist/viewer/editor/element-hit.d.ts.map +1 -0
- package/dist/viewer/editor/index.d.ts +45 -0
- package/dist/viewer/editor/index.d.ts.map +1 -0
- package/dist/viewer/editor/inline-text.d.ts +36 -0
- package/dist/viewer/editor/inline-text.d.ts.map +1 -0
- package/dist/viewer/editor/types.d.ts +12 -0
- package/dist/viewer/editor/types.d.ts.map +1 -0
- package/dist/viewer/export/export-controller.svelte.d.ts +77 -0
- package/dist/viewer/export/export-controller.svelte.d.ts.map +1 -0
- package/dist/viewer/export/export-gif.d.ts +42 -0
- package/dist/viewer/export/export-gif.d.ts.map +1 -0
- package/dist/viewer/export/export-print.d.ts +55 -0
- package/dist/viewer/export/export-print.d.ts.map +1 -0
- package/dist/viewer/export/export-ui.svelte.d.ts +45 -0
- package/dist/viewer/export/export-ui.svelte.d.ts.map +1 -0
- package/dist/viewer/export/export-video.d.ts +56 -0
- package/dist/viewer/export/export-video.d.ts.map +1 -0
- package/dist/viewer/export/export-wiring.svelte.d.ts +35 -0
- package/dist/viewer/export/export-wiring.svelte.d.ts.map +1 -0
- package/dist/viewer/export/exporting-api.d.ts +19 -0
- package/dist/viewer/export/exporting-api.d.ts.map +1 -0
- package/dist/viewer/export/index.d.ts +16 -0
- package/dist/viewer/export/index.d.ts.map +1 -0
- package/dist/viewer/export/rasterize-slide.d.ts +44 -0
- package/dist/viewer/export/rasterize-slide.d.ts.map +1 -0
- package/dist/viewer/export/render-to-canvas.d.ts +15 -0
- package/dist/viewer/export/render-to-canvas.d.ts.map +1 -0
- package/dist/viewer/index.d.ts +7536 -7597
- package/dist/viewer/index.d.ts.map +1 -0
- package/dist/viewer/index.js +1 -1
- package/dist/viewer/master/master-view.d.ts +7 -0
- package/dist/viewer/master/master-view.d.ts.map +1 -0
- package/dist/viewer/presentation/animation-playback.svelte.d.ts +57 -0
- package/dist/viewer/presentation/animation-playback.svelte.d.ts.map +1 -0
- package/dist/viewer/presentation/apply-animation-styles.d.ts +8 -0
- package/dist/viewer/presentation/apply-animation-styles.d.ts.map +1 -0
- package/dist/viewer/presentation/index.d.ts +10 -0
- package/dist/viewer/presentation/index.d.ts.map +1 -0
- package/dist/viewer/presentation/keyframes.d.ts +3 -0
- package/dist/viewer/presentation/keyframes.d.ts.map +1 -0
- package/dist/viewer/presentation/presentation-controller.svelte.d.ts +69 -0
- package/dist/viewer/presentation/presentation-controller.svelte.d.ts.map +1 -0
- package/dist/viewer/presentation/presentation-effects.svelte.d.ts +31 -0
- package/dist/viewer/presentation/presentation-effects.svelte.d.ts.map +1 -0
- package/dist/viewer/render/chart-view.d.ts +35 -0
- package/dist/viewer/render/chart-view.d.ts.map +1 -0
- package/dist/viewer/render/contentpart-view.d.ts +24 -0
- package/dist/viewer/render/contentpart-view.d.ts.map +1 -0
- package/dist/viewer/render/index.d.ts +25 -0
- package/dist/viewer/render/index.d.ts.map +1 -0
- package/dist/viewer/render/ink-view.d.ts +25 -0
- package/dist/viewer/render/ink-view.d.ts.map +1 -0
- package/dist/viewer/render/media-view.d.ts +17 -0
- package/dist/viewer/render/media-view.d.ts.map +1 -0
- package/dist/viewer/render/model3d-view.d.ts +16 -0
- package/dist/viewer/render/model3d-view.d.ts.map +1 -0
- package/dist/viewer/render/ole-view.d.ts +44 -0
- package/dist/viewer/render/ole-view.d.ts.map +1 -0
- package/dist/viewer/render/smart-art-3d-view.d.ts +18 -0
- package/dist/viewer/render/smart-art-3d-view.d.ts.map +1 -0
- package/dist/viewer/render/smartart-view.d.ts +54 -0
- package/dist/viewer/render/smartart-view.d.ts.map +1 -0
- package/dist/viewer/render/table-view.d.ts +39 -0
- package/dist/viewer/render/table-view.d.ts.map +1 -0
- package/dist/viewer/render/zoom-view.d.ts +18 -0
- package/dist/viewer/render/zoom-view.d.ts.map +1 -0
- package/dist/viewer/state/autosave.svelte.d.ts +61 -0
- package/dist/viewer/state/autosave.svelte.d.ts.map +1 -0
- package/dist/viewer/state/fullscreen.d.ts +16 -0
- package/dist/viewer/state/fullscreen.d.ts.map +1 -0
- package/dist/viewer/state/index.d.ts +9 -0
- package/dist/viewer/state/index.d.ts.map +1 -0
- package/dist/viewer/state/layout-state.svelte.d.ts +30 -0
- package/dist/viewer/state/layout-state.svelte.d.ts.map +1 -0
- package/dist/viewer/state/loader-helpers.d.ts +27 -0
- package/dist/viewer/state/loader-helpers.d.ts.map +1 -0
- package/dist/viewer/state/navigation.d.ts +26 -0
- package/dist/viewer/state/navigation.d.ts.map +1 -0
- package/dist/viewer/state/presentation-loader.svelte.d.ts +41 -0
- package/dist/viewer/state/presentation-loader.svelte.d.ts.map +1 -0
- package/dist/viewer/state/render-context.d.ts +9 -0
- package/dist/viewer/state/render-context.d.ts.map +1 -0
- package/dist/viewer/state/smart-art-3d-context.d.ts +22 -0
- package/dist/viewer/state/smart-art-3d-context.d.ts.map +1 -0
- package/dist/viewer/state/viewer-effects.svelte.d.ts +31 -0
- package/dist/viewer/state/viewer-effects.svelte.d.ts.map +1 -0
- package/dist/viewer/state/viewer-state.svelte.d.ts +36 -0
- package/dist/viewer/state/viewer-state.svelte.d.ts.map +1 -0
- package/dist/viewer/state/viewport-handlers.d.ts +24 -0
- package/dist/viewer/state/viewport-handlers.d.ts.map +1 -0
- package/dist/viewer/style/connector-label.d.ts +13 -0
- package/dist/viewer/style/connector-label.d.ts.map +1 -0
- package/dist/viewer/style/css.d.ts +13 -0
- package/dist/viewer/style/css.d.ts.map +1 -0
- package/dist/viewer/style/element-style.d.ts +26 -0
- package/dist/viewer/style/element-style.d.ts.map +1 -0
- package/dist/viewer/style/index.d.ts +5 -0
- package/dist/viewer/style/index.d.ts.map +1 -0
- package/dist/viewer/style/merge-3d.d.ts +10 -0
- package/dist/viewer/style/merge-3d.d.ts.map +1 -0
- package/dist/viewer/style/text-style.d.ts +4 -0
- package/dist/viewer/style/text-style.d.ts.map +1 -0
- package/dist/viewer/types.d.ts +189 -0
- package/dist/viewer/types.d.ts.map +1 -0
- package/package.json +6 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,605 +1,765 @@
|
|
|
1
|
-
import { Component } from 'svelte';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
*/
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
*/
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
*/
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
*
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
/**
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
*
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
*
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
*
|
|
140
|
-
*
|
|
141
|
-
*
|
|
142
|
-
*
|
|
143
|
-
*
|
|
144
|
-
*
|
|
145
|
-
*
|
|
146
|
-
*
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
/**
|
|
153
|
-
|
|
154
|
-
/**
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
*
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
*
|
|
180
|
-
*
|
|
181
|
-
*
|
|
182
|
-
*
|
|
183
|
-
*
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
*
|
|
208
|
-
*
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
*/
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
*
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
*/
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
*/
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
/**
|
|
262
|
-
|
|
263
|
-
/**
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
*
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
*
|
|
339
|
-
*
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
* back
|
|
355
|
-
*
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
*
|
|
360
|
-
*
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
*
|
|
366
|
-
*
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
*
|
|
414
|
-
*
|
|
415
|
-
*
|
|
416
|
-
*
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
/**
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
/**
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
*
|
|
472
|
-
*
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
*
|
|
478
|
-
*
|
|
479
|
-
*
|
|
480
|
-
*
|
|
481
|
-
*
|
|
482
|
-
* `
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
*
|
|
492
|
-
*
|
|
493
|
-
*
|
|
494
|
-
*
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
/**
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
/**
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
export
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
/**
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
*/
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
1
|
+
import { Component } from 'svelte';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Theme configuration types for the PowerPoint viewer.
|
|
5
|
+
*
|
|
6
|
+
* All color values accept any valid CSS color string:
|
|
7
|
+
* hex (`#6366f1`), rgb (`rgb(99 102 241)`), hsl (`hsl(239 84% 67%)`),
|
|
8
|
+
* oklch (`oklch(0.585 0.233 277)`), named colors, etc.
|
|
9
|
+
*
|
|
10
|
+
* Framework-agnostic — shared by the React, Vue, and Angular bindings.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Semantic color tokens for the viewer UI.
|
|
14
|
+
*
|
|
15
|
+
* These map to CSS custom properties (`--pptx-<token>`) and drive all
|
|
16
|
+
* UI component colors. The naming follows the shadcn/ui convention so
|
|
17
|
+
* that Tailwind + shadcn users get a familiar experience.
|
|
18
|
+
*/
|
|
19
|
+
interface ViewerThemeColors {
|
|
20
|
+
/** Page / root background */
|
|
21
|
+
background: string;
|
|
22
|
+
/** Default text color */
|
|
23
|
+
foreground: string;
|
|
24
|
+
/** Card / panel surface */
|
|
25
|
+
card: string;
|
|
26
|
+
/** Text on card surfaces */
|
|
27
|
+
cardForeground: string;
|
|
28
|
+
/** Popover / dropdown surface */
|
|
29
|
+
popover: string;
|
|
30
|
+
/** Text inside popovers */
|
|
31
|
+
popoverForeground: string;
|
|
32
|
+
/** Primary action color (buttons, active indicators) */
|
|
33
|
+
primary: string;
|
|
34
|
+
/** Text on primary-colored backgrounds */
|
|
35
|
+
primaryForeground: string;
|
|
36
|
+
/** Secondary / subdued action color */
|
|
37
|
+
secondary: string;
|
|
38
|
+
/** Text on secondary backgrounds */
|
|
39
|
+
secondaryForeground: string;
|
|
40
|
+
/** Muted / disabled surface */
|
|
41
|
+
muted: string;
|
|
42
|
+
/** Text on muted surfaces (also used for secondary text) */
|
|
43
|
+
mutedForeground: string;
|
|
44
|
+
/** Accent / hover-highlight surface */
|
|
45
|
+
accent: string;
|
|
46
|
+
/** Text on accent surfaces */
|
|
47
|
+
accentForeground: string;
|
|
48
|
+
/** Destructive / danger action color */
|
|
49
|
+
destructive: string;
|
|
50
|
+
/** Text on destructive backgrounds */
|
|
51
|
+
destructiveForeground: string;
|
|
52
|
+
/** Default border color */
|
|
53
|
+
border: string;
|
|
54
|
+
/** Input field border color */
|
|
55
|
+
input: string;
|
|
56
|
+
/** Focus ring color */
|
|
57
|
+
ring: string;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Full viewer theme configuration.
|
|
61
|
+
*
|
|
62
|
+
* Every property is optional — unset values fall back to the built-in
|
|
63
|
+
* dark theme defaults.
|
|
64
|
+
*/
|
|
65
|
+
interface ViewerTheme {
|
|
66
|
+
/** Semantic UI colors. Each key maps to a `--pptx-<key>` CSS custom property. */
|
|
67
|
+
colors?: Partial<ViewerThemeColors>;
|
|
68
|
+
/** Base border-radius value (e.g. `"0.5rem"`, `"8px"`). */
|
|
69
|
+
radius?: string;
|
|
70
|
+
/**
|
|
71
|
+
* Escape hatch: arbitrary CSS custom properties to set on the viewer
|
|
72
|
+
* root element. Keys should include the `--` prefix.
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* ```ts
|
|
76
|
+
* { "--my-custom-shadow": "0 4px 12px rgba(0,0,0,0.5)" }
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
79
|
+
cssVars?: Record<string, string>;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Default dark-theme color values.
|
|
84
|
+
*
|
|
85
|
+
* These correspond to the built-in dark UI of the PowerPoint viewer and
|
|
86
|
+
* use Tailwind's gray palette as the neutral scale with indigo as the
|
|
87
|
+
* primary accent.
|
|
88
|
+
*/
|
|
89
|
+
declare const defaultThemeColors: ViewerThemeColors;
|
|
90
|
+
/** Default border-radius. */
|
|
91
|
+
declare const defaultRadius = "0.5rem";
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Convert a `ViewerTheme` into a flat `Record<string, string>` of CSS
|
|
95
|
+
* custom properties (including the `--` prefix) ready to be spread onto
|
|
96
|
+
* a `style` attribute.
|
|
97
|
+
*
|
|
98
|
+
* Only properties that differ from the built-in defaults are emitted when
|
|
99
|
+
* `omitDefaults` is true (the default).
|
|
100
|
+
*/
|
|
101
|
+
declare function themeToCssVars(theme: ViewerTheme | undefined, omitDefaults?: boolean): Record<string, string>;
|
|
102
|
+
/**
|
|
103
|
+
* Build the complete set of CSS custom properties with all defaults.
|
|
104
|
+
* Useful for generating a full fallback stylesheet.
|
|
105
|
+
*/
|
|
106
|
+
declare function defaultCssVars(): Record<string, string>;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Built-in "vermilion" theme presets.
|
|
110
|
+
*
|
|
111
|
+
* These mirror the pptx-viewer brand used on the documentation site:
|
|
112
|
+
* a warm paper canvas in light mode, a dimmed presenter room in dark
|
|
113
|
+
* mode, and the vermilion accent in both. Pass one to the viewer's
|
|
114
|
+
* `theme` prop (React/Vue) or `provideViewerTheme` (Angular), or spread
|
|
115
|
+
* the color objects to derive your own variant.
|
|
116
|
+
*/
|
|
117
|
+
/** Light "paper" palette: a projection screen in a bright room. */
|
|
118
|
+
declare const vermilionLightColors: ViewerThemeColors;
|
|
119
|
+
/** Dark "presenter" palette: the presenter room with the lights down. */
|
|
120
|
+
declare const vermilionDarkColors: ViewerThemeColors;
|
|
121
|
+
/** Shared border-radius for the vermilion presets (slightly sharper than the default). */
|
|
122
|
+
declare const vermilionRadius = "0.375rem";
|
|
123
|
+
/** Light vermilion theme, ready for the viewer's `theme` prop. */
|
|
124
|
+
declare const vermilionLightTheme: ViewerTheme;
|
|
125
|
+
/** Dark vermilion theme, ready for the viewer's `theme` prop. */
|
|
126
|
+
declare const vermilionDarkTheme: ViewerTheme;
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Strongly-typed parsed XML node from fast-xml-parser.
|
|
130
|
+
*
|
|
131
|
+
* The parser is configured with `attributeNamePrefix: '@_'`,
|
|
132
|
+
* `parseAttributeValue: false`, and `parseTagValue: false`, so attribute and
|
|
133
|
+
* text values are always strings at runtime. This type encodes that:
|
|
134
|
+
*
|
|
135
|
+
* - **Attributes** — keys matching `` `@_${string}` `` return
|
|
136
|
+
* `string | undefined` directly.
|
|
137
|
+
* - **Text content** — `#text` returns `string | undefined`.
|
|
138
|
+
* - **Child elements** — any other string key returns
|
|
139
|
+
* `XmlObject | XmlObject[] | string | undefined`. The union reflects that
|
|
140
|
+
* fast-xml-parser may emit an object (single child), an array (repeated
|
|
141
|
+
* children), or a bare string (text-only element collapsed by the parser).
|
|
142
|
+
*
|
|
143
|
+
* For traversal, prefer the helpers in {@link ./../utils/xml-access} —
|
|
144
|
+
* `xmlChild` / `xmlChildren` / `xmlAttr` / `xmlText` / `xmlPath` — which
|
|
145
|
+
* narrow the union and normalize the single-vs-array duality. Direct
|
|
146
|
+
* indexing works for attributes (typed as string) but chained child access
|
|
147
|
+
* (`obj['p:spPr']?.['a:xfrm']`) requires the helpers or a narrowing cast
|
|
148
|
+
* because TypeScript cannot index into the `XmlObject[] | string` part of
|
|
149
|
+
* the union.
|
|
150
|
+
*/
|
|
151
|
+
interface XmlObject {
|
|
152
|
+
/** Attributes (`@_`-prefixed keys) are always strings at runtime. */
|
|
153
|
+
[attr: `@_${string}`]: string | undefined;
|
|
154
|
+
/** Element text content surfaces under `#text` when present. */
|
|
155
|
+
'#text'?: string;
|
|
156
|
+
/**
|
|
157
|
+
* Child elements keyed by their (namespaced) tag name. fast-xml-parser
|
|
158
|
+
* emits a single object for unique elements, an array for repeated ones,
|
|
159
|
+
* and a bare string for elements collapsed to their text content. Use
|
|
160
|
+
* the helpers in `utils/xml-access` to narrow this union.
|
|
161
|
+
*/
|
|
162
|
+
[child: string]: XmlObject | XmlObject[] | string | undefined;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Image types: effects, crop shapes, and properties shared by image/picture
|
|
167
|
+
* elements.
|
|
168
|
+
*
|
|
169
|
+
* @module pptx-types/image
|
|
170
|
+
*/
|
|
171
|
+
/**
|
|
172
|
+
* Blend mode for `a:blend` container nodes inside an `a:effectDag` (CT_BlendEffect).
|
|
173
|
+
*
|
|
174
|
+
* Per ECMA-376 §20.1.8.10, valid values are: `darken`, `lighten`, `mult`,
|
|
175
|
+
* `over`, `screen`.
|
|
176
|
+
*/
|
|
177
|
+
type EffectDagBlendMode = 'darken' | 'lighten' | 'mult' | 'over' | 'screen';
|
|
178
|
+
/**
|
|
179
|
+
* Container node kind inside an `a:effectDag` (CT_EffectContainer @type).
|
|
180
|
+
*
|
|
181
|
+
* Per ECMA-376 §20.1.8.20, `sib` (sibling) draws each child independently
|
|
182
|
+
* over the same source; `tree` (tree) chains effects so each sees the output
|
|
183
|
+
* of its siblings.
|
|
184
|
+
*/
|
|
185
|
+
type EffectDagContainerType = 'sib' | 'tree';
|
|
186
|
+
/**
|
|
187
|
+
* Typed model of the directed-acyclic effect graph stored in `a:effectDag`.
|
|
188
|
+
*
|
|
189
|
+
* The four "structural" container/transform nodes are typed; any other inner
|
|
190
|
+
* effect (e.g. `a:outerShdw`, `a:glow`, `a:alphaInv`) is preserved verbatim
|
|
191
|
+
* as a raw XML object via the {@link EffectDagRawLeaf} variant so we never
|
|
192
|
+
* have to recurse into the full effect taxonomy.
|
|
193
|
+
*
|
|
194
|
+
* @example
|
|
195
|
+
* ```ts
|
|
196
|
+
* // <a:effectDag>
|
|
197
|
+
* // <a:cont type="sib">
|
|
198
|
+
* // <a:blend blend="mult"><a:cont type="tree" /></a:blend>
|
|
199
|
+
* // </a:cont>
|
|
200
|
+
* // </a:effectDag>
|
|
201
|
+
* const dag: EffectDagContainer = {
|
|
202
|
+
* kind: "cont",
|
|
203
|
+
* type: "sib",
|
|
204
|
+
* children: [{
|
|
205
|
+
* kind: "blend",
|
|
206
|
+
* mode: "mult",
|
|
207
|
+
* container: { kind: "cont", type: "tree", children: [] },
|
|
208
|
+
* }],
|
|
209
|
+
* };
|
|
210
|
+
* ```
|
|
211
|
+
*/
|
|
212
|
+
type EffectDagNode = EffectDagContainer | EffectDagBlend | EffectDagXfrm | EffectDagRelOff | EffectDagRawLeaf;
|
|
213
|
+
/** `a:cont` — CT_EffectContainer. Recursive; mirrors the top-level `effectDag`. */
|
|
214
|
+
interface EffectDagContainer {
|
|
215
|
+
kind: 'cont';
|
|
216
|
+
/** `@type` — `sib` or `tree`. */
|
|
217
|
+
type: EffectDagContainerType;
|
|
218
|
+
/** Optional `@name` attribute. */
|
|
219
|
+
name?: string;
|
|
220
|
+
/** Ordered children. */
|
|
221
|
+
children: EffectDagNode[];
|
|
222
|
+
}
|
|
223
|
+
/** `a:blend` — CT_BlendEffect. Always wraps a single `a:cont` child. */
|
|
224
|
+
interface EffectDagBlend {
|
|
225
|
+
kind: 'blend';
|
|
226
|
+
/** `@blend` attribute. */
|
|
227
|
+
mode: EffectDagBlendMode;
|
|
228
|
+
/** Required child `a:cont` container. */
|
|
229
|
+
container: EffectDagContainer;
|
|
230
|
+
}
|
|
231
|
+
/** `a:xfrmEffect` — CT_TransformEffect. Affine transform with no children. */
|
|
232
|
+
interface EffectDagXfrm {
|
|
233
|
+
kind: 'xfrmEffect';
|
|
234
|
+
/** Horizontal scale, percentage * 1000 (e.g. 100000 = 100%). */
|
|
235
|
+
sx?: number;
|
|
236
|
+
/** Vertical scale, percentage * 1000. */
|
|
237
|
+
sy?: number;
|
|
238
|
+
/** Horizontal skew, degrees * 60000. */
|
|
239
|
+
kx?: number;
|
|
240
|
+
/** Vertical skew, degrees * 60000. */
|
|
241
|
+
ky?: number;
|
|
242
|
+
/** Horizontal translation in EMU. */
|
|
243
|
+
tx?: number;
|
|
244
|
+
/** Vertical translation in EMU. */
|
|
245
|
+
ty?: number;
|
|
246
|
+
}
|
|
247
|
+
/** `a:relOff` — CT_RelativeOffsetEffect. Relative offset in 1000ths of a percent. */
|
|
248
|
+
interface EffectDagRelOff {
|
|
249
|
+
kind: 'relOff';
|
|
250
|
+
/** Horizontal offset, percentage * 1000. */
|
|
251
|
+
tx?: number;
|
|
252
|
+
/** Vertical offset, percentage * 1000. */
|
|
253
|
+
ty?: number;
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Catch-all leaf preserving any non-container effect (e.g. `a:outerShdw`,
|
|
257
|
+
* `a:glow`, `a:alphaInv`) as raw XML. Re-emitted verbatim on save.
|
|
258
|
+
*/
|
|
259
|
+
interface EffectDagRawLeaf {
|
|
260
|
+
kind: 'raw';
|
|
261
|
+
/** Local element name without the `a:` prefix (e.g. `outerShdw`, `glow`). */
|
|
262
|
+
tag: string;
|
|
263
|
+
/** Raw XML object captured at load — preserved verbatim on save. */
|
|
264
|
+
xml: Record<string, unknown>;
|
|
265
|
+
}
|
|
266
|
+
declare module "./index" {
|
|
267
|
+
interface TextStyle {
|
|
268
|
+
/**
|
|
269
|
+
* Raw `a:effectDag` XML node from `a:rPr`, preserved verbatim for
|
|
270
|
+
* round-trip serialisation. Mirrors the shape-level
|
|
271
|
+
* {@link import('./shape-style').ShapeStyle.effectDagXml} field.
|
|
272
|
+
*/
|
|
273
|
+
textEffectDagXml?: XmlObject;
|
|
274
|
+
/**
|
|
275
|
+
* Typed effect graph parsed from `textEffectDagXml`. The four structural
|
|
276
|
+
* container nodes (`a:cont`, `a:blend`, `a:xfrmEffect`, `a:relOff`) are
|
|
277
|
+
* fully typed; any other leaf effect is captured as
|
|
278
|
+
* {@link EffectDagRawLeaf} so we never have to recurse into the full
|
|
279
|
+
* effect taxonomy.
|
|
280
|
+
*/
|
|
281
|
+
textEffectDagTree?: EffectDagContainer;
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
declare module "./index" {
|
|
285
|
+
interface ShapeStyle {
|
|
286
|
+
/**
|
|
287
|
+
* Typed effect graph parsed from {@link ShapeStyle.effectDagXml}. The four
|
|
288
|
+
* structural container nodes (`a:cont`, `a:blend`, `a:xfrmEffect`,
|
|
289
|
+
* `a:relOff`) are fully typed; any other leaf effect (e.g. `a:outerShdw`,
|
|
290
|
+
* `a:glow`, `a:alphaInv`) is captured as {@link EffectDagRawLeaf} so we
|
|
291
|
+
* never have to recurse into the full effect taxonomy.
|
|
292
|
+
*/
|
|
293
|
+
effectDagTree?: EffectDagContainer;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* Framework-agnostic public types shared by the viewer bindings.
|
|
299
|
+
*
|
|
300
|
+
* These were duplicated in the React (`types-ui.ts`) and Vue (`viewer/types.ts`)
|
|
301
|
+
* packages; this is the canonical copy. Each binding layers its own
|
|
302
|
+
* framework-specific prop/event/handle types on top of these.
|
|
303
|
+
*/
|
|
304
|
+
|
|
305
|
+
/** Canvas dimensions in pixels. */
|
|
306
|
+
interface CanvasSize {
|
|
307
|
+
width: number;
|
|
308
|
+
height: number;
|
|
309
|
+
}
|
|
310
|
+
/** Collaboration role within a session. */
|
|
311
|
+
type CollaborationRole = 'owner' | 'collaborator' | 'viewer';
|
|
312
|
+
/**
|
|
313
|
+
* Collaboration transport.
|
|
314
|
+
*
|
|
315
|
+
* - `'websocket'` (default): y-websocket against `serverUrl`.
|
|
316
|
+
* - `'webrtc'`: y-webrtc peer-to-peer; needs no document server. Peers meet
|
|
317
|
+
* through the `signaling` servers (WebRTC signaling only, no document data)
|
|
318
|
+
* and same-browser tabs additionally sync via BroadcastChannel even without
|
|
319
|
+
* any signaling server, which makes this mode usable from static hosting.
|
|
320
|
+
*/
|
|
321
|
+
type CollaborationTransport = 'websocket' | 'webrtc';
|
|
322
|
+
/**
|
|
323
|
+
* Real-time collaboration configuration.
|
|
324
|
+
*
|
|
325
|
+
* The same shape is accepted by the React, Vue, and Angular bindings.
|
|
326
|
+
*/
|
|
327
|
+
interface CollaborationConfig {
|
|
328
|
+
/** Unique identifier for the collaboration room (alphanumeric, hyphens, underscores). */
|
|
329
|
+
roomId: string;
|
|
330
|
+
/**
|
|
331
|
+
* WebSocket server URL for the Yjs provider (e.g. "wss://collab.example.com").
|
|
332
|
+
* Ignored (may be empty) when `transport` is `'webrtc'`.
|
|
333
|
+
*/
|
|
334
|
+
serverUrl: string;
|
|
335
|
+
/** Transport to use. Defaults to `'websocket'`. */
|
|
336
|
+
transport?: CollaborationTransport;
|
|
337
|
+
/**
|
|
338
|
+
* WebRTC signaling server URLs (only used when `transport` is `'webrtc'`).
|
|
339
|
+
* Defaults to y-webrtc's built-in public signaling list. Same-browser tabs
|
|
340
|
+
* sync via BroadcastChannel regardless of signaling availability.
|
|
341
|
+
*/
|
|
342
|
+
signaling?: string[];
|
|
343
|
+
/** Display name for the local user. */
|
|
344
|
+
userName: string;
|
|
345
|
+
/** Avatar URL for the local user (optional). */
|
|
346
|
+
userAvatar?: string;
|
|
347
|
+
/** Hex colour for the local user's cursor/presence indicator. */
|
|
348
|
+
userColor?: string;
|
|
349
|
+
/** Optional authentication token sent with the WebSocket handshake. */
|
|
350
|
+
authToken?: string;
|
|
351
|
+
/** Role in the session; defaults to `'collaborator'`. */
|
|
352
|
+
role?: CollaborationRole;
|
|
353
|
+
/**
|
|
354
|
+
* Elected-writer write-back callback (Area 3 of the C3 hardening plan).
|
|
355
|
+
*
|
|
356
|
+
* When the local user has `role: 'owner'`, the binding debounces changes and
|
|
357
|
+
* serializes the current Y.Doc state to a PPTX byte array, then calls this
|
|
358
|
+
* callback so the host can persist the snapshot. Only one writer (the owner)
|
|
359
|
+
* does this; other collaborators never trigger write-back, eliminating the
|
|
360
|
+
* last-save-wins problem.
|
|
361
|
+
*/
|
|
362
|
+
onWriteBack?: (bytes: Uint8Array) => void;
|
|
363
|
+
/**
|
|
364
|
+
* Debounce delay (ms) between the last Y.Doc change and the write-back
|
|
365
|
+
* invocation. Defaults to 5000 ms. Set to 0 to write back on every change
|
|
366
|
+
* (not recommended for large documents).
|
|
367
|
+
*/
|
|
368
|
+
writeBackDebounceMs?: number;
|
|
369
|
+
}
|
|
370
|
+
interface AutosaveRecord {
|
|
371
|
+
key: string;
|
|
372
|
+
data: Uint8Array;
|
|
373
|
+
timestamp: number;
|
|
374
|
+
size: number;
|
|
375
|
+
}
|
|
376
|
+
/**
|
|
377
|
+
* Retrieve a single autosave snapshot by file path.
|
|
378
|
+
* Returns undefined when no snapshot exists.
|
|
379
|
+
*/
|
|
380
|
+
declare function getAutosaveSnapshot(filePath: string): Promise<AutosaveRecord | undefined>;
|
|
381
|
+
/**
|
|
382
|
+
* List all autosave snapshots (without the heavy `data` blob).
|
|
383
|
+
* Useful for showing a recovery picker on app start.
|
|
384
|
+
*/
|
|
385
|
+
declare function listAutosaveSnapshots(): Promise<Array<{
|
|
386
|
+
key: string;
|
|
387
|
+
timestamp: number;
|
|
388
|
+
size: number;
|
|
389
|
+
}>>;
|
|
390
|
+
/**
|
|
391
|
+
* Delete an autosave snapshot by file path.
|
|
392
|
+
*/
|
|
393
|
+
declare function deleteAutosaveSnapshot(filePath: string): Promise<boolean>;
|
|
394
|
+
|
|
395
|
+
/**
|
|
396
|
+
* Pure handout layout calculations, shared by every binding's print path.
|
|
397
|
+
*
|
|
398
|
+
* Handles distributing slides across pages, computing grid dimensions, and
|
|
399
|
+
* positioning cells within A4 page space. No DOM/framework dependency: callers
|
|
400
|
+
* render the resulting rectangles however their view layer prefers.
|
|
401
|
+
*/
|
|
402
|
+
/** Supported slides-per-page values. */
|
|
403
|
+
type HandoutSlidesPerPage = 1 | 2 | 3 | 4 | 6 | 9;
|
|
404
|
+
|
|
405
|
+
/**
|
|
406
|
+
* Pure print helpers shared by every binding's print path: settings validation,
|
|
407
|
+
* slide-range / colour-filter resolution, page-count estimation, HTML markup
|
|
408
|
+
* builders, escaping, and the full print-document assembler.
|
|
409
|
+
*
|
|
410
|
+
* No DOM side effects and no `window.print()`: everything is deterministic and
|
|
411
|
+
* the binding writes the returned HTML string into a print window. The handout
|
|
412
|
+
* grid geometry lives in `handout-layout`; this module reuses it.
|
|
413
|
+
*
|
|
414
|
+
* ng-packagr constraint honoured here (the Angular binding inlines this source
|
|
415
|
+
* and compiles it through ng-packagr): NO `String.prototype.replaceAll`
|
|
416
|
+
* (`escapeHtml` uses `.split(x).join(y)` instead).
|
|
417
|
+
*/
|
|
418
|
+
|
|
419
|
+
/** What to print. */
|
|
420
|
+
type PrintWhat = 'slides' | 'handouts' | 'notes' | 'outline';
|
|
421
|
+
/** Page orientation for the printed output. */
|
|
422
|
+
type PrintOrientation = 'portrait' | 'landscape';
|
|
423
|
+
/** Colour mode for the printed output. */
|
|
424
|
+
type PrintColorMode = 'color' | 'grayscale' | 'blackAndWhite';
|
|
425
|
+
/** Slide range mode. */
|
|
426
|
+
type PrintSlideRange = 'all' | 'current' | 'custom';
|
|
427
|
+
/** Resolved print settings emitted on confirm. */
|
|
428
|
+
interface PrintSettings {
|
|
429
|
+
printWhat: PrintWhat;
|
|
430
|
+
orientation: PrintOrientation;
|
|
431
|
+
colorMode: PrintColorMode;
|
|
432
|
+
frameSlides: boolean;
|
|
433
|
+
slidesPerPage: HandoutSlidesPerPage;
|
|
434
|
+
slideRange: PrintSlideRange;
|
|
435
|
+
customRangeFrom: number;
|
|
436
|
+
customRangeTo: number;
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
/**
|
|
440
|
+
* Animated-GIF export capture/encode pipeline. All the pure logic is shared:
|
|
441
|
+
* `planGifFrames` derives the per-slide frame delays (default duration +
|
|
442
|
+
* per-slide overrides), `clampGifDimensions` bounds the output size, and
|
|
443
|
+
* `encodeGif` (median-cut quantisation + LZW GIF89a) produces the bytes with
|
|
444
|
+
* each frame carrying its own plan delay. This module only owns the
|
|
445
|
+
* DOM-adjacent glue: rasterising each slide via the injected capture callback
|
|
446
|
+
* and normalising every frame onto a uniform-size canvas before pixel
|
|
447
|
+
* extraction. Blob download is left to the caller (`ExportController`).
|
|
448
|
+
*/
|
|
449
|
+
/** Options for the animated-GIF export. */
|
|
450
|
+
interface ExportGifOptions {
|
|
451
|
+
/** Duration each slide is shown, in milliseconds. Default 2000. */
|
|
452
|
+
slideDurationMs?: number;
|
|
453
|
+
/** Per-slide duration overrides in milliseconds (index maps to slide index). */
|
|
454
|
+
slideTimingsMs?: number[];
|
|
455
|
+
/**
|
|
456
|
+
* Longest allowed output side in pixels; frames are scaled down
|
|
457
|
+
* proportionally. Default 960 (GIF encoding cost grows with pixel count:
|
|
458
|
+
* every pixel is matched against a 256-colour palette per frame).
|
|
459
|
+
*/
|
|
460
|
+
maxDimension?: number;
|
|
461
|
+
/** Capture-phase progress callback: `(currentSlide, totalSlides)`. */
|
|
462
|
+
onProgress?: ExportProgress;
|
|
463
|
+
/** Abort the export early; checked before each slide capture. */
|
|
464
|
+
signal?: AbortSignal;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
/**
|
|
468
|
+
* Print flow: assemble the shared print document (slides / notes / handouts /
|
|
469
|
+
* outline) and hand it to a print surface. All the pure logic is shared and
|
|
470
|
+
* DOMPurify-hardened: `validatePrintSettings` normalises the caller's partial
|
|
471
|
+
* settings, `computeSlideIndices` / `computeColorFilter` resolve the range and
|
|
472
|
+
* colour mode, the `build*Html` helpers produce the escaped body markup, and
|
|
473
|
+
* `buildPrintHtmlDocument` sanitises + assembles the final document. This
|
|
474
|
+
* module (the Svelte counterpart of Vue's `usePrint`) only rasterises the
|
|
475
|
+
* selected slides and opens the print surface.
|
|
476
|
+
*
|
|
477
|
+
* **Print surface / popup-blocker caveats:** the default opener renders the
|
|
478
|
+
* document into a hidden same-origin `<iframe srcdoc>` and calls
|
|
479
|
+
* `contentWindow.print()`, so no popup window is involved and popup blockers
|
|
480
|
+
* cannot interfere (`document.write` is avoided too). A host that prefers a
|
|
481
|
+
* visible print window can inject its own {@link OpenPrintWindow} via the
|
|
482
|
+
* controller deps; note that a `window.open`-based opener only succeeds inside
|
|
483
|
+
* a user gesture (a click handler) and returns `null` under popup blockers,
|
|
484
|
+
* in which case it should report `false` so the flow resolves `false` and the
|
|
485
|
+
* host can surface "allow popups for this site" guidance.
|
|
486
|
+
*/
|
|
487
|
+
/** Options for the print flow: any subset of the shared print settings. */
|
|
488
|
+
type PrintOptions = Partial<PrintSettings>;
|
|
489
|
+
|
|
490
|
+
/**
|
|
491
|
+
* Video (WebM) export driven by the shared `video-plan` maths: segment timing
|
|
492
|
+
* comes from `planVideoSegments` (default duration + per-slide overrides +
|
|
493
|
+
* fps -> frame count), the frame pacing from `fpsToFrameIntervalMs`, and the
|
|
494
|
+
* recorder MIME type from `pickSupportedMimeType(WEBM_MIME_CANDIDATES)`. This
|
|
495
|
+
* module owns the browser glue only: rasterise every slide first (capture
|
|
496
|
+
* phase), then replay each canvas onto a recording canvas whose
|
|
497
|
+
* `captureStream()` feeds a `MediaRecorder` (recording phase). Mirrors
|
|
498
|
+
* React's `exportAllSlidesAsVideo`, minus the live-stage slide flipping (the
|
|
499
|
+
* injected rasteriser renders off-screen instead).
|
|
500
|
+
*/
|
|
501
|
+
/** Options for the WebM video export. */
|
|
502
|
+
interface ExportVideoOptions {
|
|
503
|
+
/** Duration each slide is shown, in milliseconds. Default 3000. */
|
|
504
|
+
slideDurationMs?: number;
|
|
505
|
+
/** Per-slide duration overrides in milliseconds (index maps to slide index). */
|
|
506
|
+
slideTimingsMs?: number[];
|
|
507
|
+
/** Recording frame rate. Default 30. */
|
|
508
|
+
fps?: number;
|
|
509
|
+
/** Recorder bitrate. Default 5,000,000 (5 Mbps). */
|
|
510
|
+
videoBitsPerSecond?: number;
|
|
511
|
+
/** Capture-phase progress callback: `(currentSlide, totalSlides)`. */
|
|
512
|
+
onProgress?: ExportProgress;
|
|
513
|
+
/** Recording-phase progress callback: `(currentSlide, totalSlides)`. */
|
|
514
|
+
onRecordProgress?: ExportProgress;
|
|
515
|
+
/** Abort the export early; checked between slides and between frames. */
|
|
516
|
+
signal?: AbortSignal;
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
/** Per-slide progress callback: `(currentSlideIndex, totalSlides)`. */
|
|
520
|
+
type ExportProgress = (current: number, total: number) => void;
|
|
521
|
+
/** Options for the multi-slide PDF export (progress + cooperative cancel). */
|
|
522
|
+
interface ExportPdfOptions {
|
|
523
|
+
/** Capture-phase progress callback: `(currentSlide, totalSlides)`. */
|
|
524
|
+
onProgress?: ExportProgress;
|
|
525
|
+
/** Abort the export early; the loop checks this between slides. */
|
|
526
|
+
signal?: AbortSignal;
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
/**
|
|
530
|
+
* Minimal, dependency-free translation layer for the Svelte binding.
|
|
531
|
+
*
|
|
532
|
+
* The canonical English dictionary lives in `pptx-viewer-shared/i18n` (shared
|
|
533
|
+
* with the React, Vue, and Angular bindings, which each plug it into their
|
|
534
|
+
* framework's i18n library). Svelte has no blessed i18n runtime, so this
|
|
535
|
+
* module implements the small subset the viewer needs: dictionary lookup by
|
|
536
|
+
* locale with English fallback, `{{name}}` interpolation, and the shared
|
|
537
|
+
* `keyToLabel` humanised fallback for missing keys.
|
|
538
|
+
*/
|
|
539
|
+
/** A flat dictionary of dotted `pptx.*` keys to display strings. */
|
|
540
|
+
type TranslationDictionary = Record<string, string>;
|
|
541
|
+
/** Translate `key`, interpolating `{{name}}` placeholders from `params`. */
|
|
542
|
+
type Translator = (key: string, params?: Record<string, string | number>) => string;
|
|
543
|
+
/**
|
|
544
|
+
* Register (or extend) the dictionary for a locale. Later registrations are
|
|
545
|
+
* merged over earlier ones, so hosts can override individual keys.
|
|
546
|
+
*/
|
|
547
|
+
declare function registerTranslations(locale: string, dictionary: TranslationDictionary): void;
|
|
548
|
+
|
|
549
|
+
/** Payload for the `onload` callback. */
|
|
550
|
+
interface ViewerLoadDetail {
|
|
551
|
+
/** Number of slides in the loaded presentation. */
|
|
552
|
+
slideCount: number;
|
|
553
|
+
/** Slide canvas size in pixels. */
|
|
554
|
+
canvasSize: CanvasSize;
|
|
555
|
+
}
|
|
556
|
+
/** Props for `<PowerPointViewer>`. */
|
|
557
|
+
interface PowerPointViewerProps {
|
|
558
|
+
/** PowerPoint content as `Uint8Array` (or `ArrayBuffer`). */
|
|
559
|
+
source: Uint8Array | ArrayBuffer | null | undefined;
|
|
560
|
+
/**
|
|
561
|
+
* Theme configuration for customising the viewer's appearance. Accepts
|
|
562
|
+
* partial color overrides, a custom border-radius, and arbitrary CSS
|
|
563
|
+
* custom properties. Unset values fall back to the built-in defaults.
|
|
564
|
+
*/
|
|
565
|
+
theme?: ViewerTheme;
|
|
566
|
+
/** UI locale (BCP 47). English ships built in; register others via `pptx-svelte-viewer/i18n`. */
|
|
567
|
+
locale?: string;
|
|
568
|
+
/** Slide shown after load (0-based, clamped). Default 0. */
|
|
569
|
+
initialSlide?: number;
|
|
570
|
+
/** Show the thumbnail sidebar. Default true. */
|
|
571
|
+
showThumbnails?: boolean;
|
|
572
|
+
/** Show the navigation/zoom toolbar. Default true. */
|
|
573
|
+
showToolbar?: boolean;
|
|
574
|
+
/**
|
|
575
|
+
* Show the speaker-notes panel and its toolbar toggle. Default true. The
|
|
576
|
+
* panel is plain-text only and reads the active slide's notes; pass
|
|
577
|
+
* `onnotesupdate` to make it editable (omitting it renders read-only).
|
|
578
|
+
*/
|
|
579
|
+
showNotes?: boolean;
|
|
580
|
+
/**
|
|
581
|
+
* Opt in to the experimental Three.js (WebGL) SmartArt renderer for
|
|
582
|
+
* `smartArt` elements, in place of the default SVG renderer. Requires the
|
|
583
|
+
* optional `three` peer dependency; when it is unavailable, or a diagram
|
|
584
|
+
* has no renderable nodes, or the WebGL mount fails, the SVG renderer is
|
|
585
|
+
* used automatically. Default false.
|
|
586
|
+
*/
|
|
587
|
+
smartArt3D?: boolean;
|
|
588
|
+
/**
|
|
589
|
+
* Enable in-place editing: click to select an element, drag to move, use the
|
|
590
|
+
* 8 handles to resize (Shift locks aspect) and the rotate handle to rotate,
|
|
591
|
+
* double-click text/shapes to edit their text, and the keyboard for
|
|
592
|
+
* delete/duplicate/nudge/undo/redo. Adds an Undo/Redo/Save/Download group to
|
|
593
|
+
* the toolbar. Default false (read-only viewer).
|
|
594
|
+
*/
|
|
595
|
+
editable?: boolean;
|
|
596
|
+
/** Optional class name applied to the root element. */
|
|
597
|
+
class?: string;
|
|
598
|
+
/** Optional display name shown in the desktop title bar. */
|
|
599
|
+
fileName?: string;
|
|
600
|
+
/** Fired after a presentation finishes loading. */
|
|
601
|
+
onload?: (detail: ViewerLoadDetail) => void;
|
|
602
|
+
/** Fired when a load fails (message is human-readable). */
|
|
603
|
+
onerror?: (message: string) => void;
|
|
604
|
+
/** Fired when the active slide changes (0-based index). */
|
|
605
|
+
onslidechange?: (index: number) => void;
|
|
606
|
+
/**
|
|
607
|
+
* Fired with the committed plain-text speaker notes when the user edits
|
|
608
|
+
* the notes panel (on `change` / `blur`). This binding has no built-in
|
|
609
|
+
* slide-mutation channel, so the host is responsible for writing the text
|
|
610
|
+
* back onto its own copy of the slide; omit this to render the notes
|
|
611
|
+
* panel read-only.
|
|
612
|
+
*/
|
|
613
|
+
onnotesupdate?: (notes: string) => void;
|
|
614
|
+
/**
|
|
615
|
+
* Fired after every committed editing mutation (move / resize / rotate /
|
|
616
|
+
* delete / duplicate / nudge / inline text / notes) when `editable`. Use it
|
|
617
|
+
* to track the dirty state or mirror edits into host state.
|
|
618
|
+
*/
|
|
619
|
+
onchange?: () => void;
|
|
620
|
+
/**
|
|
621
|
+
* Enable debounced crash-recovery autosave. On each edit (when `editable`)
|
|
622
|
+
* the current slides are serialized to `.pptx` bytes and written to the
|
|
623
|
+
* shared IndexedDB recovery store (keyed by {@link filePath}), and
|
|
624
|
+
* `onautosave` is fired with the bytes. Requires `filePath`; without one the
|
|
625
|
+
* autosave indicator reads "disabled". This binding does not auto-restore on
|
|
626
|
+
* load; recovery is a host concern (see the re-exported `getAutosaveSnapshot`
|
|
627
|
+
* / `listAutosaveSnapshots` helpers). Default false.
|
|
628
|
+
*/
|
|
629
|
+
autosave?: boolean;
|
|
630
|
+
/** Fired when the desktop title bar toggles AutoSave for this viewer instance. */
|
|
631
|
+
onautosavetoggle?: (enabled: boolean) => void;
|
|
632
|
+
/**
|
|
633
|
+
* IndexedDB record key for autosave (typically the open file's name/path).
|
|
634
|
+
* Autosave is inert until this is set.
|
|
635
|
+
*/
|
|
636
|
+
filePath?: string;
|
|
637
|
+
/** Autosave debounce window in milliseconds. Default 2000. */
|
|
638
|
+
autosaveIntervalMs?: number;
|
|
639
|
+
/** Fired with the serialized `.pptx` bytes after each successful autosave. */
|
|
640
|
+
onautosave?: (bytes: Uint8Array) => void;
|
|
641
|
+
/**
|
|
642
|
+
* Real-time collaboration configuration. When provided, the viewer connects
|
|
643
|
+
* to the room (y-websocket or serverless y-webrtc), publishes local edits
|
|
644
|
+
* granularly, and applies remote peers' edits into the editable slides.
|
|
645
|
+
* Clearing it (undefined) tears the session down. A `viewer` role makes the
|
|
646
|
+
* local user read-only. Remote cursors/presence render via the built-in
|
|
647
|
+
* Share/Broadcast toolbar buttons; see `collab/collaboration.svelte.ts` and
|
|
648
|
+
* `collab/components/`.
|
|
649
|
+
*/
|
|
650
|
+
collaboration?: CollaborationConfig;
|
|
651
|
+
/** Fired when a collaboration session starts (with the resolved config). */
|
|
652
|
+
onstartcollaboration?: (config: CollaborationConfig) => void;
|
|
653
|
+
/** Fired when a collaboration session stops. */
|
|
654
|
+
onstopcollaboration?: () => void;
|
|
655
|
+
/**
|
|
656
|
+
* Prefilled values for the built-in Share dialog's form (room id, display
|
|
657
|
+
* name, server URL). The Broadcast dialog reuses `serverUrl` from this same
|
|
658
|
+
* object. Purely a starting point; the user can still edit every field.
|
|
659
|
+
*/
|
|
660
|
+
shareDefaults?: {
|
|
661
|
+
roomId?: string;
|
|
662
|
+
userName?: string;
|
|
663
|
+
serverUrl?: string;
|
|
664
|
+
};
|
|
665
|
+
}
|
|
666
|
+
/**
|
|
667
|
+
* Imperative editing API exposed on the `<PowerPointViewer>` component
|
|
668
|
+
* instance (via `bind:this`). Mirrors the vanilla binding's `EditorController`
|
|
669
|
+
* surface subset the host drives directly.
|
|
670
|
+
*/
|
|
671
|
+
interface PowerPointViewerApi {
|
|
672
|
+
/** Undo the last committed edit. */
|
|
673
|
+
undo(): void;
|
|
674
|
+
/** Redo the last undone edit. */
|
|
675
|
+
redo(): void;
|
|
676
|
+
/** Whether an undo step is available (snapshot; not reactive). */
|
|
677
|
+
canUndo(): boolean;
|
|
678
|
+
/** Whether a redo step is available (snapshot; not reactive). */
|
|
679
|
+
canRedo(): boolean;
|
|
680
|
+
/** Delete the selected element (no-op when nothing is selected). */
|
|
681
|
+
deleteSelected(): void;
|
|
682
|
+
/** The selected top-level element id, or null. */
|
|
683
|
+
getSelectedElementId(): string | null;
|
|
684
|
+
/** Serialize the edited slides to `.pptx` bytes via the core handler. */
|
|
685
|
+
save(): Promise<Uint8Array>;
|
|
686
|
+
/** Save + trigger a browser download of the `.pptx` (default name). */
|
|
687
|
+
downloadPptx(fileName?: string): Promise<void>;
|
|
688
|
+
/**
|
|
689
|
+
* Export a slide as a PNG download (defaults to the current slide). Renders
|
|
690
|
+
* the slide off-screen at scale 1 and rasterises it with `html2canvas-pro`
|
|
691
|
+
* (dynamically imported), so the first call pays a one-time load cost.
|
|
692
|
+
*/
|
|
693
|
+
exportSlidePng(index?: number): Promise<void>;
|
|
694
|
+
/**
|
|
695
|
+
* Export every slide as a multi-page PDF download (one slide per page).
|
|
696
|
+
* `jspdf` is dynamically imported on first use.
|
|
697
|
+
*/
|
|
698
|
+
exportPdf(options?: ExportPdfOptions): Promise<void>;
|
|
699
|
+
/**
|
|
700
|
+
* Export every slide as an animated GIF download. Per-slide frame delays
|
|
701
|
+
* come from the shared frame plan: a default `slideDurationMs` (2000) with
|
|
702
|
+
* optional per-slide `slideTimingsMs` overrides. Supports `onProgress` and
|
|
703
|
+
* an `AbortSignal`, like {@link exportPdf}.
|
|
704
|
+
*/
|
|
705
|
+
exportGif(options?: ExportGifOptions): Promise<void>;
|
|
706
|
+
/**
|
|
707
|
+
* Export every slide as a WebM video download (canvas capture stream +
|
|
708
|
+
* `MediaRecorder`; codec picked from the shared WebM candidates). Timing
|
|
709
|
+
* follows the shared video plan (`slideDurationMs` default 3000, per-slide
|
|
710
|
+
* `slideTimingsMs`, `fps` default 30). Supports capture/recording progress
|
|
711
|
+
* callbacks and an `AbortSignal`.
|
|
712
|
+
*/
|
|
713
|
+
exportVideo(options?: ExportVideoOptions): Promise<void>;
|
|
714
|
+
/**
|
|
715
|
+
* Assemble the shared print document (slides / handouts / notes / outline,
|
|
716
|
+
* slide range + colour mode) and open the browser print dialog. The default
|
|
717
|
+
* print surface is a hidden same-origin iframe, so no popup window is
|
|
718
|
+
* involved; a custom `window.open`-based opener (injectable at the
|
|
719
|
+
* controller level) is subject to popup blockers, in which case the promise
|
|
720
|
+
* resolves `false`. Resolves `true` once the print surface opened.
|
|
721
|
+
*/
|
|
722
|
+
print(options?: PrintOptions): Promise<boolean>;
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
/**
|
|
726
|
+
* Explicitly-typed public export of the viewer component.
|
|
727
|
+
*
|
|
728
|
+
* `svelte-check` types the `.svelte` import precisely, but the plain
|
|
729
|
+
* TypeScript pass that emits the published declaration files resolves
|
|
730
|
+
* `.svelte` modules through a loose ambient shim (`src/shims-svelte.d.ts`).
|
|
731
|
+
* Re-exporting through this annotated constant keeps the published `.d.ts`
|
|
732
|
+
* fully typed regardless of which compiler produced it.
|
|
733
|
+
*/
|
|
734
|
+
declare const PowerPointViewer: Component<PowerPointViewerProps, PowerPointViewerApi>;
|
|
735
|
+
|
|
736
|
+
/**
|
|
737
|
+
* autosave.svelte.ts: debounced crash-recovery autosave for the Svelte viewer.
|
|
738
|
+
*
|
|
739
|
+
* A runes port that fuses the two shared semantics the other bindings use:
|
|
740
|
+
* - React's persistence target: each successful save writes the serialized
|
|
741
|
+
* `.pptx` bytes to the shared IndexedDB recovery store
|
|
742
|
+
* (`saveAutosaveSnapshot`, keyed by `filePath`), so a host can offer
|
|
743
|
+
* restore-on-load with `getAutosaveSnapshot` / `listAutosaveSnapshots`
|
|
744
|
+
* (both re-exported from this package). This binding does NOT auto-restore;
|
|
745
|
+
* matching React/Vue, recovery is a host concern.
|
|
746
|
+
* - Vue's debounce-on-edit trigger: an edit marks the document dirty and
|
|
747
|
+
* (re)arms a debounce timer instead of polling on a fixed interval.
|
|
748
|
+
*
|
|
749
|
+
* The controller registers its own edit-watching `$effect` in the constructor,
|
|
750
|
+
* so the SFC only has to construct it once during setup and read its reactive
|
|
751
|
+
* `status` / `isDirty` for the toolbar indicator.
|
|
752
|
+
*/
|
|
753
|
+
/**
|
|
754
|
+
* Autosave status, surfaced for the toolbar status pill.
|
|
755
|
+
*
|
|
756
|
+
* - `idle` : nothing has been saved yet (or no edits since mount).
|
|
757
|
+
* - `disabled` : autosave is inactive (off, not editable, or no file path).
|
|
758
|
+
* - `saving` : a save is currently in flight.
|
|
759
|
+
* - `saved` : the most recent save succeeded.
|
|
760
|
+
* - `error` : the most recent save threw.
|
|
761
|
+
*/
|
|
762
|
+
type AutosaveStatus = 'idle' | 'disabled' | 'saving' | 'saved' | 'error';
|
|
763
|
+
|
|
764
|
+
export { PowerPointViewer, defaultCssVars, defaultRadius, defaultThemeColors, deleteAutosaveSnapshot, getAutosaveSnapshot, listAutosaveSnapshots, registerTranslations, themeToCssVars, vermilionDarkColors, vermilionDarkTheme, vermilionLightColors, vermilionLightTheme, vermilionRadius };
|
|
765
|
+
export type { AutosaveRecord, AutosaveStatus, CanvasSize, CollaborationConfig, CollaborationRole, CollaborationTransport, ExportGifOptions, ExportPdfOptions, ExportVideoOptions, PowerPointViewerApi, PowerPointViewerProps, PrintOptions, TranslationDictionary, Translator, ViewerLoadDetail, ViewerTheme, ViewerThemeColors };
|