pptx-react-viewer 2.3.0 → 2.4.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.
Files changed (151) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/dist/{AiChatPanel-HC3CE3TL.js → AiChatPanel-HLLGXBZF.js} +23 -24
  3. package/dist/AiChatPanel-HLLGXBZF.js.br +0 -0
  4. package/dist/AiChatPanel-HLLGXBZF.js.gz +0 -0
  5. package/dist/{AiChatPanel-PXZYHJUB.mjs → AiChatPanel-SXYMXFYS.mjs} +4 -5
  6. package/dist/AiChatPanel-SXYMXFYS.mjs.br +0 -0
  7. package/dist/AiChatPanel-SXYMXFYS.mjs.gz +0 -0
  8. package/dist/{Model3DScene-ZG4HTMPX.mjs → Model3DScene-IECT4RWT.mjs} +1 -2
  9. package/dist/Model3DScene-IECT4RWT.mjs.br +0 -0
  10. package/dist/Model3DScene-IECT4RWT.mjs.gz +0 -0
  11. package/dist/{Model3DScene-37QZRHV5.js → Model3DScene-ZQBWLAMC.js} +2 -3
  12. package/dist/Model3DScene-ZQBWLAMC.js.br +0 -0
  13. package/dist/Model3DScene-ZQBWLAMC.js.gz +0 -0
  14. package/dist/{PowerPointViewer-gmU5rc7K.d.ts → PowerPointViewer-Cjn1RgSz.d.ts} +2 -2
  15. package/dist/{PowerPointViewer-gmU5rc7K.d.ts.map → PowerPointViewer-Cjn1RgSz.d.ts.map} +1 -1
  16. package/dist/{SurfaceChart3DScene-QIREQ66D.js → SurfaceChart3DScene-4KRMRWW6.js} +2 -3
  17. package/dist/SurfaceChart3DScene-4KRMRWW6.js.br +0 -0
  18. package/dist/SurfaceChart3DScene-4KRMRWW6.js.gz +0 -0
  19. package/dist/{SurfaceChart3DScene-Z7R6DZXN.mjs → SurfaceChart3DScene-52C3IMPQ.mjs} +1 -2
  20. package/dist/SurfaceChart3DScene-52C3IMPQ.mjs.br +0 -0
  21. package/dist/SurfaceChart3DScene-52C3IMPQ.mjs.gz +0 -0
  22. package/dist/audience-content-store-BMlth_3U.d.ts +386 -0
  23. package/dist/audience-content-store-BMlth_3U.d.ts.map +1 -0
  24. package/dist/{chunk-YIFO3WQO.js → chunk-25VSL2BB.js} +1 -0
  25. package/dist/chunk-25VSL2BB.js.br +0 -0
  26. package/dist/chunk-25VSL2BB.js.gz +0 -0
  27. package/dist/{chunk-EUIFPDXZ.js → chunk-5GHLRHBR.js} +3 -3
  28. package/dist/chunk-5GHLRHBR.js.br +0 -0
  29. package/dist/chunk-5GHLRHBR.js.gz +0 -0
  30. package/dist/{chunk-P7UVBRFO.js → chunk-5TPQJWEO.js} +248 -249
  31. package/dist/chunk-5TPQJWEO.js.br +0 -0
  32. package/dist/chunk-5TPQJWEO.js.gz +0 -0
  33. package/dist/{chunk-VOHTAUN4.mjs → chunk-G6Q3NXRV.mjs} +3 -4
  34. package/dist/chunk-G6Q3NXRV.mjs.br +0 -0
  35. package/dist/chunk-G6Q3NXRV.mjs.gz +0 -0
  36. package/dist/{chunk-J5A22DZ7.mjs → chunk-KK7FWBGO.mjs} +36 -41
  37. package/dist/chunk-KK7FWBGO.mjs.br +0 -0
  38. package/dist/chunk-KK7FWBGO.mjs.gz +0 -0
  39. package/dist/{chunk-I5LEMC5C.mjs → chunk-LRIXPSVT.mjs} +4 -6
  40. package/dist/chunk-LRIXPSVT.mjs.br +0 -0
  41. package/dist/chunk-LRIXPSVT.mjs.gz +0 -0
  42. package/dist/{chunk-M5YR3QSB.mjs → chunk-Q6FC2552.mjs} +1 -1
  43. package/dist/chunk-Q6FC2552.mjs.br +0 -0
  44. package/dist/{chunk-M5YR3QSB.mjs.gz → chunk-Q6FC2552.mjs.gz} +0 -0
  45. package/dist/{chunk-3TB45PVK.js → chunk-QBZA2GMB.mjs} +47751 -32270
  46. package/dist/chunk-QBZA2GMB.mjs.br +0 -0
  47. package/dist/chunk-QBZA2GMB.mjs.gz +0 -0
  48. package/dist/{chunk-L7JNCVTF.js → chunk-VEZO33T2.js} +314 -316
  49. package/dist/chunk-VEZO33T2.js.br +0 -0
  50. package/dist/chunk-VEZO33T2.js.gz +0 -0
  51. package/dist/{chunk-JFNMD6TM.mjs → chunk-WK56SFN7.js} +48250 -31698
  52. package/dist/chunk-WK56SFN7.js.br +0 -0
  53. package/dist/chunk-WK56SFN7.js.gz +0 -0
  54. package/dist/{chunk-ZLSVW5GP.js → chunk-XSBFV6TL.js} +876 -881
  55. package/dist/chunk-XSBFV6TL.js.br +0 -0
  56. package/dist/chunk-XSBFV6TL.js.gz +0 -0
  57. package/dist/{chunk-PZTPX3HK.mjs → chunk-Z6HIZWIQ.mjs} +1 -0
  58. package/dist/chunk-Z6HIZWIQ.mjs.br +0 -0
  59. package/dist/chunk-Z6HIZWIQ.mjs.gz +0 -0
  60. package/dist/i18n.js +4 -4
  61. package/dist/i18n.js.br +0 -0
  62. package/dist/i18n.js.gz +0 -0
  63. package/dist/i18n.mjs +1 -1
  64. package/dist/i18n.mjs.br +0 -0
  65. package/dist/i18n.mjs.gz +0 -0
  66. package/dist/index.d.ts +79 -87
  67. package/dist/index.js +39 -40
  68. package/dist/index.js.br +0 -0
  69. package/dist/index.js.gz +0 -0
  70. package/dist/index.mjs +6 -7
  71. package/dist/index.mjs.br +0 -0
  72. package/dist/index.mjs.gz +0 -0
  73. package/dist/internals.d.ts +506 -514
  74. package/dist/internals.d.ts.map +1 -1
  75. package/dist/internals.js +79 -81
  76. package/dist/internals.js.br +0 -0
  77. package/dist/internals.js.gz +0 -0
  78. package/dist/internals.mjs +4 -6
  79. package/dist/internals.mjs.br +0 -0
  80. package/dist/internals.mjs.gz +0 -0
  81. package/dist/pptx-viewer.css +1 -1
  82. package/dist/pptx-viewer.css.br +0 -0
  83. package/dist/pptx-viewer.css.gz +0 -0
  84. package/dist/{animation-timeline-eb5z0SHW.d.ts → types-DciBT90G.d.ts} +4 -3
  85. package/dist/types-DciBT90G.d.ts.map +1 -0
  86. package/dist/{useViewerBuildingBlocks-CjureTRf.d.ts → useViewerBuildingBlocks-DMDZRawe.d.ts} +4 -4
  87. package/dist/{useViewerBuildingBlocks-CjureTRf.d.ts.map → useViewerBuildingBlocks-DMDZRawe.d.ts.map} +1 -1
  88. package/dist/viewer/index.d.ts +79 -88
  89. package/dist/viewer/index.js +22 -24
  90. package/dist/viewer/index.js.br +0 -0
  91. package/dist/viewer/index.js.gz +0 -0
  92. package/dist/viewer/index.mjs +6 -8
  93. package/dist/viewer/index.mjs.br +0 -0
  94. package/dist/viewer/index.mjs.gz +0 -0
  95. package/package.json +4 -4
  96. package/dist/AiChatPanel-HC3CE3TL.js.br +0 -0
  97. package/dist/AiChatPanel-HC3CE3TL.js.gz +0 -0
  98. package/dist/AiChatPanel-PXZYHJUB.mjs.br +0 -0
  99. package/dist/AiChatPanel-PXZYHJUB.mjs.gz +0 -0
  100. package/dist/Model3DScene-37QZRHV5.js.br +0 -0
  101. package/dist/Model3DScene-37QZRHV5.js.gz +0 -0
  102. package/dist/Model3DScene-ZG4HTMPX.mjs.br +0 -0
  103. package/dist/Model3DScene-ZG4HTMPX.mjs.gz +0 -0
  104. package/dist/SurfaceChart3DScene-QIREQ66D.js.br +0 -0
  105. package/dist/SurfaceChart3DScene-QIREQ66D.js.gz +0 -0
  106. package/dist/SurfaceChart3DScene-Z7R6DZXN.mjs.br +0 -0
  107. package/dist/SurfaceChart3DScene-Z7R6DZXN.mjs.gz +0 -0
  108. package/dist/animation-timeline-eb5z0SHW.d.ts.map +0 -1
  109. package/dist/chunk-3TB45PVK.js.br +0 -0
  110. package/dist/chunk-3TB45PVK.js.gz +0 -0
  111. package/dist/chunk-4AAFZFGH.mjs +0 -27633
  112. package/dist/chunk-4AAFZFGH.mjs.br +0 -0
  113. package/dist/chunk-4AAFZFGH.mjs.gz +0 -0
  114. package/dist/chunk-EUIFPDXZ.js.br +0 -0
  115. package/dist/chunk-EUIFPDXZ.js.gz +0 -0
  116. package/dist/chunk-I5LEMC5C.mjs.br +0 -0
  117. package/dist/chunk-I5LEMC5C.mjs.gz +0 -0
  118. package/dist/chunk-IKBO6CZC.js +0 -2
  119. package/dist/chunk-IKBO6CZC.js.br +0 -3
  120. package/dist/chunk-IKBO6CZC.js.gz +0 -0
  121. package/dist/chunk-J5A22DZ7.mjs.br +0 -0
  122. package/dist/chunk-J5A22DZ7.mjs.gz +0 -0
  123. package/dist/chunk-JFNMD6TM.mjs.br +0 -0
  124. package/dist/chunk-JFNMD6TM.mjs.gz +0 -0
  125. package/dist/chunk-KDW3LLG5.js +0 -28067
  126. package/dist/chunk-KDW3LLG5.js.br +0 -0
  127. package/dist/chunk-KDW3LLG5.js.gz +0 -0
  128. package/dist/chunk-L7JNCVTF.js.br +0 -0
  129. package/dist/chunk-L7JNCVTF.js.gz +0 -0
  130. package/dist/chunk-M5YR3QSB.mjs.br +0 -0
  131. package/dist/chunk-P7UVBRFO.js.br +0 -0
  132. package/dist/chunk-P7UVBRFO.js.gz +0 -0
  133. package/dist/chunk-PZTPX3HK.mjs.br +0 -0
  134. package/dist/chunk-PZTPX3HK.mjs.gz +0 -0
  135. package/dist/chunk-T5U6P2JH.mjs +0 -1
  136. package/dist/chunk-T5U6P2JH.mjs.br +0 -0
  137. package/dist/chunk-T5U6P2JH.mjs.gz +0 -0
  138. package/dist/chunk-VOHTAUN4.mjs.br +0 -0
  139. package/dist/chunk-VOHTAUN4.mjs.gz +0 -0
  140. package/dist/chunk-YIFO3WQO.js.br +0 -0
  141. package/dist/chunk-YIFO3WQO.js.gz +0 -0
  142. package/dist/chunk-ZLSVW5GP.js.br +0 -0
  143. package/dist/chunk-ZLSVW5GP.js.gz +0 -0
  144. package/dist/dist-FTEVZZPM.js +0 -2283
  145. package/dist/dist-FTEVZZPM.js.br +0 -0
  146. package/dist/dist-FTEVZZPM.js.gz +0 -0
  147. package/dist/dist-L7GZVBMG.mjs +0 -2
  148. package/dist/dist-L7GZVBMG.mjs.br +0 -0
  149. package/dist/dist-L7GZVBMG.mjs.gz +0 -0
  150. package/dist/index-CDCSXtK3.d.ts +0 -685
  151. package/dist/index-CDCSXtK3.d.ts.map +0 -1
@@ -1,685 +0,0 @@
1
- import { D as ConnectionStatus, O as UserPresence, T as CollaborationContextValue, h as PresentationAnimationRuntime, t as ElementAnimationState, ut as ViewerMode$1, w as CollaborationConfig$1 } from "./animation-timeline-eb5z0SHW.js";
2
- import { PptxAction, PptxData, PptxElement, PptxHandler, PptxSlide, PptxSlideTransition, PptxThemeColorScheme, PptxThemeFontScheme, PptxThemePreset } from "pptx-viewer-core";
3
- import { CollaborationConfig, CollaborationLivePatcher, PresentationPointerTool, PresentationSnapshot, clearAudienceContent, loadAudienceContent, storeAudienceContent } from "pptx-viewer-shared";
4
- import { RefObject } from "react";
5
- import * as Y from "yjs";
6
- import { Doc, Doc as YDoc } from "yjs";
7
- //#region src/viewer/hooks/presentation-mode/types.d.ts
8
- /**
9
- * How a forward/backward slide advance was requested.
10
- *
11
- * - `'click'`: a click/tap on the slide surface (PowerPoint's "On Mouse Click"
12
- * advance). This is the only trigger governed by `advanceOnClick`.
13
- * - `'explicit'`: keyboard, navigation buttons, action triggers, and timed
14
- * auto-advance. These always navigate regardless of `advanceOnClick`, matching
15
- * PowerPoint (arrow keys / Next always work even when click-advance is off).
16
- */
17
- type SlideAdvanceTrigger = 'click' | 'explicit';
18
- /**
19
- * State describing the transition overlay that plays while advancing into a
20
- * slide that carries a `p:transition`. The outgoing slide is snapshotted into
21
- * an animated overlay layer while the incoming slide renders underneath on the
22
- * main stage; the overlay tears down once `durationMs` elapses.
23
- */
24
- interface PresentationTransitionOverlayState {
25
- /** Index of the leaving slide, rendered (animated) in the overlay layer. */
26
- outgoingSlideIndex: number;
27
- /** Index of the arriving slide, already live on the main stage. */
28
- incomingSlideIndex: number;
29
- /** The incoming slide's transition definition (drives the CSS animation). */
30
- transition: PptxSlideTransition;
31
- /** Resolved transition duration (ms). */
32
- durationMs: number;
33
- }
34
- interface UsePresentationModeInput {
35
- mode: ViewerMode$1;
36
- slides: PptxSlide[];
37
- visibleSlideIndexes: number[];
38
- activeSlideIndex: number;
39
- containerRef: React.RefObject<HTMLElement | null>;
40
- /** Raw PPTX bytes: forwarded to audience window for content sharing. */
41
- content?: ArrayBuffer | Uint8Array | null;
42
- onSetMode: (mode: ViewerMode$1) => void;
43
- onSetActiveSlideIndex: (index: number) => void;
44
- /**
45
- * Play a sound file for an action/transition. When `options.loop` is true the
46
- * audio repeats until the next animation sound plays or the show exits
47
- * (used for transition sounds flagged with `soundLoop`).
48
- */
49
- onPlayActionSound?: (soundPath: string, options?: {
50
- loop?: boolean;
51
- }) => void;
52
- /** Select a pointer tool (Ctrl+L laser, Ctrl+P pen, Ctrl+A arrow, Ctrl+E eraser). */
53
- onSetPointerTool?: (tool: PresentationPointerTool | 'arrow') => void;
54
- /** Erase the current slide's ink annotations (E). */
55
- onEraseAnnotations?: () => void;
56
- /** Show or hide ink markup (Ctrl+M). */
57
- onToggleInkMarkup?: () => void;
58
- /** Show or hide the slide-show chrome (Ctrl+H). */
59
- onToggleToolbar?: () => void;
60
- /** Open the All Slides navigator (Ctrl+S). */
61
- onShowAllSlides?: () => void;
62
- /** Called to persist rehearsal timings into slide transitions. */
63
- onSaveRehearsalTimings?: (timings: Record<number, number>) => void;
64
- /** Whether to loop continuously (kiosk or explicit loop setting). */
65
- loopContinuously?: boolean;
66
- /** Whether to play animations during the slide show (false = skip all animations). */
67
- showWithAnimation?: boolean;
68
- /** Whether to use rehearsed auto-advance timings (false = manual advance only). */
69
- useTimings?: boolean;
70
- /**
71
- * Options > Advanced > "End with black slide". When true (PowerPoint's
72
- * default), advancing past the last slide shows a black end-of-show
73
- * screen; the next advance (or a click on it) exits. When false,
74
- * advancing past the last slide exits the show directly.
75
- */
76
- endWithBlackSlide?: boolean;
77
- }
78
- interface UsePresentationModeResult {
79
- presentationSlideIndex: number;
80
- setPresentationSlideIndex: (index: number) => void;
81
- presentationSlideVisible: boolean;
82
- /** Active slide-transition overlay, or `null` when no transition is playing. */
83
- transitionOverlay: PresentationTransitionOverlayState | null;
84
- /** Tear down the transition overlay once its animation completes. */
85
- handleTransitionOverlayComplete: () => void;
86
- presentationAnimations: PresentationAnimationRuntime[];
87
- presentationElementStates: Map<string, ElementAnimationState>;
88
- presentationKeyframesCss: string;
89
- clearPresentationTimers: () => void;
90
- runPresentationEntranceAnimations: (slideIndex: number) => void;
91
- /** True while the black "End of slide show" screen is displayed. */
92
- endOfShowVisible: boolean;
93
- /** Whether the All Slides navigator (Ctrl+S) is open during the show. */
94
- allSlidesOpen: boolean;
95
- openAllSlides: () => void;
96
- closeAllSlides: () => void;
97
- movePresentationSlide: (direction: 1 | -1, trigger?: SlideAdvanceTrigger) => void;
98
- navigateToSlide: (slideIndex: number) => void;
99
- handlePresentationAction: (action: PptxAction) => void;
100
- /**
101
- * Handle a shape click in presentation mode. If the shape is an interactive
102
- * trigger, play its animation sequence. Returns `true` if handled.
103
- */
104
- handleInteractiveShapeClick: (shapeId: string) => boolean;
105
- /** Set of shape IDs that are interactive sequence triggers on the current slide. */
106
- interactiveTriggerShapeIds: ReadonlySet<string>;
107
- /** Set of shape IDs that are hover animation triggers on the current slide. */
108
- hoverTriggerShapeIds: ReadonlySet<string>;
109
- /** Handle hover start on a shape. If the shape has a hover sequence, play it. Returns `true` if handled. */
110
- handleHoverStart: (shapeId: string) => boolean;
111
- /** Handle hover end on a shape. Resets the hover sequence for replay. */
112
- handleHoverEnd: (shapeId: string) => void;
113
- /** Must be called from a user-gesture handler (click) to satisfy browser fullscreen policy. */
114
- enterPresentMode: () => void;
115
- /** Whether presenter view (split-screen with notes) is active instead of fullscreen. */
116
- presenterMode: boolean;
117
- /** Enter presenter view mode (no fullscreen, shows notes panel). */
118
- enterPresenterView: () => void;
119
- /** Toggle between fullscreen and presenter view during presentation. */
120
- togglePresenterView: () => void;
121
- /** Timestamp (ms) when the presentation started: used for elapsed timer. */
122
- presentationStartTime: number | null;
123
- /** Whether the current presentation session is in rehearse-timings mode. */
124
- rehearsing: boolean;
125
- /** Enter rehearse-timings mode (fullscreen presentation + timing HUD). */
126
- enterRehearsalMode: () => void;
127
- /** Recorded timings in ms, keyed by slide index. Populated during rehearsal. */
128
- recordedTimings: Record<number, number>;
129
- /** Timestamp when the current slide started (ms since epoch). */
130
- slideStartTime: number | null;
131
- /** Whether the rehearsal summary dialog should be shown. */
132
- showRehearsalSummary: boolean;
133
- /** Dismiss the rehearsal summary (discard timings). */
134
- dismissRehearsalSummary: () => void;
135
- /** Save recorded timings into each slide's transition.advanceAfterMs. */
136
- saveRehearsalTimings: () => void;
137
- /** Whether rehearsal timer is paused. */
138
- rehearsalPaused: boolean;
139
- /** Toggle the rehearsal timer pause state. */
140
- toggleRehearsalPause: () => void;
141
- /** Handle a zoom element click in presentation mode. */
142
- handleZoomClick: (targetSlideIndex: number, returnSlideIndex: number) => void;
143
- /** Ref holding the slide index to return to after zoom navigation. */
144
- zoomReturnSlideIndex: React.RefObject<number | null>;
145
- /** Navigate back to the zoom summary slide. Returns true if navigation occurred. */
146
- returnToZoomSlide: () => boolean;
147
- /** Clear the stored zoom return index. */
148
- clearZoomReturn: () => void;
149
- /** Open the audience display in a separate browser window. Returns `true` if successful. */
150
- openAudienceWindow: () => boolean;
151
- /** Close the audience display window. */
152
- closeAudienceWindow: () => void;
153
- /** Whether the audience window is currently open. */
154
- isAudienceWindowOpen: () => boolean;
155
- /** Send a slide index to the audience window explicitly. */
156
- syncSlideToAudience: (slideIndex: number) => void;
157
- syncStateToAudience: (snapshot: PresentationSnapshot) => void;
158
- presenterSnapshot: PresentationSnapshot;
159
- setPresenterBlackout: (blackout: PresentationSnapshot['blackout']) => void;
160
- togglePresenterTimer: () => void;
161
- resetPresenterTimer: () => void;
162
- stepPresenterZoom: (direction: 1 | -1) => void;
163
- resetPresenterZoom: () => void;
164
- setPresenterCaption: (caption: string) => void;
165
- setPresenterSubtitlesVisible: (visible: boolean) => void;
166
- updatePresenterSnapshot: (patch: Partial<PresentationSnapshot>) => void;
167
- swapPresenterDisplays: () => Promise<boolean>;
168
- }
169
- //#endregion
170
- //#region src/viewer/hooks/useThemeSwitching.d.ts
171
- interface UseThemeSwitchingInput {
172
- /** Ref to the PptxHandler instance. */
173
- handlerRef: RefObject<PptxHandler | null>;
174
- /** Current parsed presentation data (null when nothing is loaded). */
175
- data: PptxData | null;
176
- /** Callback to update the presentation data after theme switch. */
177
- onDataChange: (newData: PptxData) => void;
178
- /** Optional callback fired when theme switch completes successfully. */
179
- onThemeChanged?: (preset: PptxThemePreset) => void;
180
- }
181
- interface ThemeSwitchingResult {
182
- /** All available built-in theme presets. */
183
- presets: readonly PptxThemePreset[];
184
- /**
185
- * Apply a theme preset to the current presentation.
186
- * Updates both the in-memory ZIP and all resolved element colours.
187
- */
188
- switchToPreset: (preset: PptxThemePreset) => Promise<void>;
189
- /**
190
- * Apply a custom colour scheme (and optional font scheme) to the
191
- * current presentation.
192
- */
193
- switchToCustom: (colorScheme: PptxThemeColorScheme, fontScheme?: PptxThemeFontScheme, themeName?: string) => Promise<void>;
194
- /**
195
- * Get the preset matching the current presentation theme (if any).
196
- * Returns undefined if the current theme does not match a built-in preset.
197
- */
198
- currentPreset: PptxThemePreset | undefined;
199
- }
200
- /**
201
- * React hook providing theme switching capabilities for the PowerPoint viewer.
202
- *
203
- * @example
204
- * ```tsx
205
- * const { presets, switchToPreset, currentPreset } = useThemeSwitching({
206
- * handlerRef,
207
- * data,
208
- * onDataChange: setData,
209
- * });
210
- *
211
- * return (
212
- * <div>
213
- * {presets.map(preset => (
214
- * <button
215
- * key={preset.id}
216
- * onClick={() => switchToPreset(preset)}
217
- * aria-pressed={preset.id === currentPreset?.id}
218
- * >
219
- * {preset.name}
220
- * </button>
221
- * ))}
222
- * </div>
223
- * );
224
- * ```
225
- */
226
- declare function useThemeSwitching(input: UseThemeSwitchingInput): ThemeSwitchingResult;
227
- //#endregion
228
- //#region ../../node_modules/.bun/lib0@0.2.117/node_modules/lib0/observable.d.ts
229
- /**
230
- * Handles named events.
231
- *
232
- * @deprecated
233
- * @template N
234
- */
235
- declare class Observable<N> {
236
- /**
237
- * Some desc.
238
- * @type {Map<N, any>}
239
- */
240
- _observers: Map<N, any>;
241
- /**
242
- * @param {N} name
243
- * @param {function} f
244
- */
245
- on(name: N, f: Function): void;
246
- /**
247
- * @param {N} name
248
- * @param {function} f
249
- */
250
- once(name: N, f: Function): void;
251
- /**
252
- * @param {N} name
253
- * @param {function} f
254
- */
255
- off(name: N, f: Function): void;
256
- /**
257
- * Emit a named event. All registered event listeners that listen to the
258
- * specified name will receive the event.
259
- *
260
- * @todo This should catch exceptions
261
- *
262
- * @param {N} name The event name.
263
- * @param {Array<any>} args The arguments that are applied to the event listener.
264
- */
265
- emit(name: N, args: Array<any>): void;
266
- destroy(): void;
267
- }
268
- //#endregion
269
- //#region ../../node_modules/.bun/y-protocols@1.0.7+253afa400b9c0a30/node_modules/y-protocols/awareness.d.ts
270
- /**
271
- * @typedef {Object} MetaClientState
272
- * @property {number} MetaClientState.clock
273
- * @property {number} MetaClientState.lastUpdated unix timestamp
274
- */
275
- /**
276
- * The Awareness class implements a simple shared state protocol that can be used for non-persistent data like awareness information
277
- * (cursor, username, status, ..). Each client can update its own local state and listen to state changes of
278
- * remote clients. Every client may set a state of a remote peer to `null` to mark the client as offline.
279
- *
280
- * Each client is identified by a unique client id (something we borrow from `doc.clientID`). A client can override
281
- * its own state by propagating a message with an increasing timestamp (`clock`). If such a message is received, it is
282
- * applied if the known state of that client is older than the new state (`clock < newClock`). If a client thinks that
283
- * a remote client is offline, it may propagate a message with
284
- * `{ clock: currentClientClock, state: null, client: remoteClient }`. If such a
285
- * message is received, and the known clock of that client equals the received clock, it will override the state with `null`.
286
- *
287
- * Before a client disconnects, it should propagate a `null` state with an updated clock.
288
- *
289
- * Awareness states must be updated every 30 seconds. Otherwise the Awareness instance will delete the client state.
290
- *
291
- * @extends {Observable<string>}
292
- */
293
- declare class Awareness extends Observable<string> {
294
- /**
295
- * @param {Y.Doc} doc
296
- */
297
- constructor(doc: Y.Doc);
298
- doc: Y.Doc;
299
- /**
300
- * @type {number}
301
- */
302
- clientID: number;
303
- /**
304
- * Maps from client id to client state
305
- * @type {Map<number, Object<string, any>>}
306
- */
307
- states: Map<number, {
308
- [x: string]: any;
309
- }>;
310
- /**
311
- * @type {Map<number, MetaClientState>}
312
- */
313
- meta: Map<number, MetaClientState>;
314
- _checkInterval: any;
315
- /**
316
- * @return {Object<string,any>|null}
317
- */
318
- getLocalState(): {
319
- [x: string]: any;
320
- } | null;
321
- /**
322
- * @param {Object<string,any>|null} state
323
- */
324
- setLocalState(state: {
325
- [x: string]: any;
326
- } | null): void;
327
- /**
328
- * @param {string} field
329
- * @param {any} value
330
- */
331
- setLocalStateField(field: string, value: any): void;
332
- /**
333
- * @return {Map<number,Object<string,any>>}
334
- */
335
- getStates(): Map<number, {
336
- [x: string]: any;
337
- }>;
338
- }
339
- type MetaClientState = {
340
- clock: number;
341
- /**
342
- * unix timestamp
343
- */
344
- lastUpdated: number;
345
- };
346
- //#endregion
347
- //#region src/viewer/hooks/collaboration/useYjsProvider.d.ts
348
- interface UseYjsProviderInput {
349
- /**
350
- * Collaboration config, or `undefined` when collaboration is inactive. The
351
- * hook is always called (React hook rules) but stays fully dormant, never
352
- * opening a transport, while config is absent.
353
- */
354
- config?: CollaborationConfig$1;
355
- }
356
- interface UseYjsProviderResult {
357
- /** Current WebSocket connection status. */
358
- status: ConnectionStatus;
359
- /** The Yjs awareness instance (null until connected). */
360
- awareness: Awareness | null;
361
- /** The Yjs document (null until initialised). */
362
- doc: YDoc | null;
363
- /** Local awareness client ID. */
364
- clientId: number | null;
365
- /**
366
- * Whether the provider completed its initial document sync. Local doc
367
- * writes should be gated on this so a late joiner never seeds its
368
- * bootstrap deck into a room whose content has not arrived yet. Websocket
369
- * flips it on the provider's 'synced' event; webrtc flips it on peer sync
370
- * or after {@link INITIAL_SYNC_GRACE_MS} (a lone fresh-room peer never
371
- * receives a sync event).
372
- */
373
- synced: boolean;
374
- /** Manually retry the connection after a timeout or error. */
375
- retry: () => void;
376
- }
377
- /**
378
- * Lazily loads `yjs` and `y-websocket`, creates a Y.Doc and
379
- * WebSocketProvider, and tracks the connection lifecycle.
380
- *
381
- * If the connection does not succeed within {@link CONNECTION_TIMEOUT_MS},
382
- * the provider is torn down and status moves to `'error'`. The consumer
383
- * can call `retry()` to attempt a fresh connection.
384
- *
385
- * The Yjs packages are dynamically imported so they are fully
386
- * tree-shaken when collaboration is not enabled.
387
- */
388
- declare function useYjsProvider({ config }: UseYjsProviderInput): UseYjsProviderResult;
389
- //#endregion
390
- //#region src/viewer/hooks/collaboration/usePresenceTracking.d.ts
391
- interface UsePresenceTrackingInput {
392
- awareness: Awareness | null;
393
- localClientId: number | null;
394
- userName: string;
395
- userColor: string;
396
- userAvatar?: string;
397
- /** Role in the session (broadcaster, viewer, or collaborator). */
398
- role?: string;
399
- canvasWidth: number;
400
- canvasHeight: number;
401
- }
402
- interface UsePresenceTrackingResult {
403
- /** Presence data for all remote users (excludes local). */
404
- remoteUsers: UserPresence[];
405
- /** Broadcast a partial presence update for the local user. */
406
- broadcastPresence: (update: Partial<Omit<UserPresence, 'clientId'>>) => void;
407
- }
408
- declare function usePresenceTracking({ awareness, localClientId, userName, userColor, userAvatar, role, canvasWidth, canvasHeight }: UsePresenceTrackingInput): UsePresenceTrackingResult;
409
- //#endregion
410
- //#region src/viewer/hooks/collaboration/useCollaborativeState.d.ts
411
- interface UseCollaborativeStateInput {
412
- /**
413
- * Collaboration config, or `undefined` when collaboration is inactive. The
414
- * hook is always called so the surrounding provider keeps a stable React
415
- * tree shape; it produces a dormant value (no transport, empty presence)
416
- * while config is absent.
417
- */
418
- config?: CollaborationConfig$1;
419
- canvasWidth: number;
420
- canvasHeight: number;
421
- }
422
- declare function useCollaborativeState({ config, canvasWidth, canvasHeight }: UseCollaborativeStateInput): CollaborationContextValue | null;
423
- //#endregion
424
- //#region src/viewer/hooks/collaboration/useCollaborativeHistory.d.ts
425
- interface UseCollaborativeHistoryInput {
426
- /** The local user's client ID (from Yjs awareness). */
427
- localClientId: number | null;
428
- /** Standard history undo function. */
429
- handleUndo: () => void;
430
- /** Standard history redo function. */
431
- handleRedo: () => void;
432
- /** Whether undo is available. */
433
- canUndo: boolean;
434
- /** Whether redo is available. */
435
- canRedo: boolean;
436
- }
437
- interface UseCollaborativeHistoryResult {
438
- /** Undo the last local change. */
439
- handleUndo: () => void;
440
- /** Redo the last undone local change. */
441
- handleRedo: () => void;
442
- /** Whether undo is available. */
443
- canUndo: boolean;
444
- /** Whether redo is available. */
445
- canRedo: boolean;
446
- }
447
- declare function useCollaborativeHistory({ localClientId: _localClientId, handleUndo, handleRedo, canUndo, canRedo }: UseCollaborativeHistoryInput): UseCollaborativeHistoryResult;
448
- //#endregion
449
- //#region src/viewer/hooks/collaboration/useYjsDocumentSync.d.ts
450
- interface UseYjsDocumentSyncInput {
451
- /** The Yjs document (from useYjsProvider). null when not collaborating. */
452
- doc: Doc | null;
453
- /** Current slides state. */
454
- slides: PptxSlide[];
455
- /** Separated master/layout (template) elements, merged back on write-back. */
456
- templateElementsBySlideId: Record<string, PptxElement[]>;
457
- /** React state setter for slides. */
458
- setSlides: React.Dispatch<React.SetStateAction<PptxSlide[]>>;
459
- /** Whether collaboration is active (status === 'connected'). */
460
- isConnected: boolean;
461
- /**
462
- * Whether the provider completed its initial document sync. Local -> doc
463
- * writes are gated on this so a late joiner never seeds its bootstrap deck
464
- * into a room whose real content has not arrived yet. Defaults to true for
465
- * callers that manage sync readiness themselves.
466
- */
467
- isSynced?: boolean;
468
- /** Collaboration config (for role and write-back). */
469
- config?: Pick<CollaborationConfig, 'role' | 'onWriteBack' | 'writeBackDebounceMs'>;
470
- /**
471
- * Return the source PPTX bytes for write-back serialization. Only called
472
- * when role === 'owner' and onWriteBack is set.
473
- */
474
- getSourceBytes?: () => Uint8Array | null;
475
- /**
476
- * Monotonic counter bumped each time the content-load pipeline finishes
477
- * applying a parsed deck to viewer state. A local load that lands while the
478
- * shared doc already holds slides (a late joiner's bootstrap deck parsing
479
- * after the room state arrived) would silently clobber the synced slides;
480
- * each bump re-adopts the doc's slides when the room has content.
481
- */
482
- loadVersion?: number;
483
- }
484
- declare function useYjsDocumentSync({ doc, slides, templateElementsBySlideId, setSlides, isConnected, isSynced, config, getSourceBytes, loadVersion }: UseYjsDocumentSyncInput): void;
485
- //#endregion
486
- //#region src/viewer/hooks/collaboration/useBroadcastFollower.d.ts
487
- interface UseBroadcastFollowerInput {
488
- /** The collaboration context (null when collaboration is disabled). */
489
- collab: CollaborationContextValue | null;
490
- /** Current local active slide index. */
491
- activeSlideIndex: number;
492
- /** Setter for the active slide index. */
493
- setActiveSlideIndex: (index: number) => void;
494
- /** Total number of slides (for bounds checking). */
495
- slideCount: number;
496
- /**
497
- * When true, auto-follow stands down (e.g. the local user is manually
498
- * following a specific peer via the follow bar). Defaults to false.
499
- */
500
- paused?: boolean;
501
- }
502
- declare function useBroadcastFollower({ collab, activeSlideIndex, setActiveSlideIndex, slideCount, paused }: UseBroadcastFollowerInput): void;
503
- //#endregion
504
- //#region src/viewer/hooks/collaboration/useFollowMode.d.ts
505
- interface UseFollowModeInput {
506
- /** The collaboration context (null when collaboration is disabled). */
507
- collab: CollaborationContextValue | null;
508
- /** Current local active slide index. */
509
- activeSlideIndex: number;
510
- /** Setter for the active slide index. */
511
- setActiveSlideIndex: (index: number) => void;
512
- /** Total number of slides (for bounds checking). */
513
- slideCount: number;
514
- }
515
- interface UseFollowModeResult {
516
- /** The clientId currently being followed, or null. */
517
- followedClientId: number | null;
518
- /** Follow the given peer, or `null` to stop following. */
519
- followUser: (clientId: number | null) => void;
520
- }
521
- declare function useFollowMode({ collab, activeSlideIndex, setActiveSlideIndex, slideCount }: UseFollowModeInput): UseFollowModeResult;
522
- //#endregion
523
- //#region src/viewer/hooks/presentation-mode/useAnimationPlayback.d.ts
524
- interface UseAnimationPlaybackInput {
525
- slides: PptxSlide[];
526
- onPlayActionSound?: (soundPath: string) => void;
527
- /** When false, all animations are skipped (elements shown immediately). */
528
- showWithAnimation?: boolean;
529
- }
530
- interface UseAnimationPlaybackResult {
531
- presentationAnimations: PresentationAnimationRuntime[];
532
- presentationElementStates: Map<string, ElementAnimationState>;
533
- presentationKeyframesCss: string;
534
- interactiveTriggerShapeIds: ReadonlySet<string>;
535
- hoverTriggerShapeIds: ReadonlySet<string>;
536
- clearPresentationTimers: () => void;
537
- playNextAnimationGroup: () => boolean;
538
- handleInteractiveShapeClick: (shapeId: string) => boolean;
539
- handleHoverStart: (shapeId: string) => boolean;
540
- handleHoverEnd: (shapeId: string) => void;
541
- runPresentationEntranceAnimations: (slideIndex: number) => void;
542
- /** Exposed so the orchestrator can schedule additional timers (e.g. auto-advance). */
543
- presentationTimersRef: React.RefObject<number[]>;
544
- }
545
- declare function useAnimationPlayback(input: UseAnimationPlaybackInput): UseAnimationPlaybackResult;
546
- //#endregion
547
- //#region src/viewer/hooks/presentation-mode/useRehearsalTimings.d.ts
548
- interface UseRehearsalTimingsInput {
549
- containerRef: React.RefObject<HTMLElement | null>;
550
- onSetMode: (mode: ViewerMode$1) => void;
551
- onSaveRehearsalTimings?: (timings: Record<number, number>) => void;
552
- setPresentationStartTime: (time: number | null) => void;
553
- setPresenterMode: (mode: boolean) => void;
554
- }
555
- interface UseRehearsalTimingsResult {
556
- rehearsing: boolean;
557
- setRehearsing: React.Dispatch<React.SetStateAction<boolean>>;
558
- recordedTimings: Record<number, number>;
559
- slideStartTime: number | null;
560
- showRehearsalSummary: boolean;
561
- setShowRehearsalSummary: React.Dispatch<React.SetStateAction<boolean>>;
562
- rehearsalPaused: boolean;
563
- recordCurrentSlideTime: (slideIndex: number) => void;
564
- dismissRehearsalSummary: () => void;
565
- saveRehearsalTimings: () => void;
566
- enterRehearsalMode: () => void;
567
- toggleRehearsalPause: () => void;
568
- }
569
- declare function useRehearsalTimings(input: UseRehearsalTimingsInput): UseRehearsalTimingsResult;
570
- //#endregion
571
- //#region src/viewer/hooks/presentation-mode/usePresentationKeyboard.d.ts
572
- interface UsePresentationKeyboardInput {
573
- mode: ViewerMode$1;
574
- movePresentationSlide: (direction: 1 | -1) => void;
575
- /** Jump to a 0-based slide index (Home / End / typed slide number). */
576
- navigateToSlide: (index: number) => void;
577
- /** Total slide count, so End can resolve the last slide. */
578
- slideCount: number;
579
- onSetMode: (mode: ViewerMode$1) => void;
580
- /** Select a pointer tool (Ctrl+L / Ctrl+P / Ctrl+A / Ctrl+E). */
581
- onSetPointerTool?: (tool: PresentationPointerTool | 'arrow') => void;
582
- /** Erase this slide's ink annotations (E). */
583
- onEraseAnnotations?: () => void;
584
- /** Show or hide ink markup (Ctrl+M). */
585
- onToggleInkMarkup?: () => void;
586
- /** Show or hide the slide-show chrome (Ctrl+H). */
587
- onToggleToolbar?: () => void;
588
- /** Open the All Slides navigator (Ctrl+S). */
589
- onShowAllSlides?: () => void;
590
- onToggleBlackScreen?: () => void;
591
- onToggleWhiteScreen?: () => void;
592
- rehearsing: boolean;
593
- recordCurrentSlideTime: (slideIndex: number) => void;
594
- presentationSlideIndex: number;
595
- setShowRehearsalSummary: (value: boolean) => void;
596
- }
597
- /**
598
- * Registers PowerPoint's slide-show shortcuts while a show is running.
599
- *
600
- * The key-to-action mapping lives in `pptx-viewer-shared` so every binding
601
- * resolves the same chords; this hook only performs the resulting actions.
602
- */
603
- declare function usePresentationKeyboard(input: UsePresentationKeyboardInput): void;
604
- //#endregion
605
- //#region src/viewer/hooks/presentation-mode/useSlideNavigation.d.ts
606
- interface UseSlideNavigationInput {
607
- slides: PptxSlide[];
608
- visibleSlideIndexes: number[];
609
- presentationSlideIndex: number;
610
- setPresentationSlideIndex: (index: number) => void;
611
- setPresentationSlideVisible: (visible: boolean) => void;
612
- setTransitionOverlay: (state: PresentationTransitionOverlayState | null) => void;
613
- onSetMode: (mode: ViewerMode$1) => void;
614
- onSetActiveSlideIndex: (index: number) => void;
615
- onPlayActionSound?: (soundPath: string) => void;
616
- loopContinuously?: boolean;
617
- /** Whether to use rehearsed auto-advance timings. When false, slides advance only on click. */
618
- useTimings?: boolean;
619
- /**
620
- * Fired when the user advances past the last slide (no loop, no rehearsal).
621
- * The presentation-mode hook uses it for PowerPoint's "End with black
622
- * slide" behavior. When absent, advancing past the end clamps as before.
623
- */
624
- onAdvancePastLastSlide?: () => void;
625
- playNextAnimationGroup: () => boolean;
626
- clearPresentationTimers: () => void;
627
- runPresentationEntranceAnimations: (slideIndex: number) => void;
628
- presentationTimersRef: {
629
- current: number[];
630
- };
631
- rehearsing: boolean;
632
- recordCurrentSlideTime: (slideIndex: number) => void;
633
- setShowRehearsalSummary: (value: boolean) => void;
634
- }
635
- interface UseSlideNavigationResult {
636
- movePresentationSlide: (direction: 1 | -1, trigger?: SlideAdvanceTrigger) => void;
637
- navigateToSlide: (slideIndex: number) => void;
638
- handlePresentationAction: (action: PptxAction) => void;
639
- scheduleAutoAdvanceForSlide: (slideIndex: number) => void;
640
- }
641
- declare function useSlideNavigation(input: UseSlideNavigationInput): UseSlideNavigationResult;
642
- //#endregion
643
- //#region src/viewer/hooks/presentation-mode/usePresenterWindow.d.ts
644
- /**
645
- * Parse the session nonce from the current page URL hash. Returns null if the
646
- * hash is not in the expected `#pptx-audience&nonce=<uuid>` form.
647
- */
648
- declare function parseAudienceNonce(): string | null;
649
- /** Returns true if the current page was opened as an audience tab. */
650
- declare function isAudienceTab(): boolean;
651
- interface UsePresenterWindowInput {
652
- currentSlideIndex: number;
653
- isPresenterMode: boolean;
654
- /** Raw PPTX bytes to share with the audience tab via IndexedDB. */
655
- content?: ArrayBuffer | Uint8Array | null;
656
- snapshot: PresentationSnapshot;
657
- }
658
- interface UsePresenterWindowResult {
659
- openAudienceWindow: () => boolean;
660
- closeAudienceWindow: () => void;
661
- isAudienceWindowOpen: () => boolean;
662
- syncSlideToAudience: (slideIndex: number) => void;
663
- syncStateToAudience: (snapshot: PresentationSnapshot) => void;
664
- swapDisplays: () => Promise<boolean>;
665
- }
666
- declare function usePresenterWindow(input: UsePresenterWindowInput): UsePresenterWindowResult;
667
- //#endregion
668
- //#region src/viewer/hooks/presentation-mode/useAudienceMode.d.ts
669
- interface UseAudienceModeInput {
670
- mode: ViewerMode$1;
671
- onSetMode: (mode: ViewerMode$1) => void;
672
- onSetActiveSlideIndex: (index: number) => void;
673
- containerRef: React.RefObject<HTMLElement | null>;
674
- onSnapshot?: (snapshot: PresentationSnapshot) => void;
675
- }
676
- /**
677
- * When the page was opened with the `#pptx-audience` hash, this hook:
678
- * 1. Auto-enters fullscreen presentation mode after content loads
679
- * 2. Listens on BroadcastChannel for slide-change messages from the presenter
680
- * 3. Exits presentation mode when the presenter sends an exit signal
681
- */
682
- declare function useAudienceMode(input: UseAudienceModeInput): void;
683
- //#endregion
684
- export { UseCollaborativeStateInput as A, useThemeSwitching as B, UseBroadcastFollowerInput as C, UseCollaborativeHistoryInput as D, useYjsDocumentSync as E, UseYjsProviderInput as F, UsePresentationModeResult as H, UseYjsProviderResult as I, useYjsProvider as L, UsePresenceTrackingInput as M, UsePresenceTrackingResult as N, UseCollaborativeHistoryResult as O, usePresenceTracking as P, ThemeSwitchingResult as R, useFollowMode as S, UseYjsDocumentSyncInput as T, UsePresentationModeInput as V, UseAnimationPlaybackInput as _, UsePresenterWindowInput as a, UseFollowModeInput as b, parseAudienceNonce as c, UseSlideNavigationResult as d, useSlideNavigation as f, useRehearsalTimings as g, UseRehearsalTimingsResult as h, useAudienceMode as i, useCollaborativeState as j, useCollaborativeHistory as k, usePresenterWindow as l, UseRehearsalTimingsInput as m, loadAudienceContent as n, UsePresenterWindowResult as o, usePresentationKeyboard as p, storeAudienceContent as r, isAudienceTab as s, clearAudienceContent as t, UseSlideNavigationInput as u, UseAnimationPlaybackResult as v, useBroadcastFollower as w, UseFollowModeResult as x, useAnimationPlayback as y, UseThemeSwitchingInput as z };
685
- //# sourceMappingURL=index-CDCSXtK3.d.ts.map